@@ -156,8 +156,7 @@ function buildSDL() {
156156 AC_MSG_ERROR ( [ libsdl2-dev not installed: configure failed.] )
157157 fi
158158
159- AC_CHECK_PROG ( have_freetype2 , freetype-config , [ yes] , [ no] )
160- if test "${have_freetype2}" = "no" ; then
159+ if [ ! pkg-config --cflags freetype2 ] ; then
161160 AC_MSG_ERROR ( [ libfreetype6-dev not installed: configure failed.] )
162161 fi
163162
@@ -178,7 +177,7 @@ function buildSDL() {
178177 PACKAGE_CFLAGS="${PACKAGE_CFLAGS} -mms-bitfields"
179178 PACKAGE_LIBS="${PACKAGE_LIBS} -lwsock32 -lws2_32 -static-libgcc -static-libstdc++"
180179 PACKAGE_LIBS="${PACKAGE_LIBS} -Wl,-Bstatic -Wl,-Map=output.map"
181- PACKAGE_LIBS="${PACKAGE_LIBS} `sdl2-config --static-libs` `freetype -config --libs`"
180+ PACKAGE_LIBS="${PACKAGE_LIBS} `sdl2-config --static-libs` `pkg -config --libs freetype2 `"
182181 AC_DEFINE ( _Win32 , 1 , [ Windows build] )
183182 ;;
184183
@@ -193,7 +192,7 @@ function buildSDL() {
193192 dnl backlinking support for modules
194193 PACKAGE_LIBS="${PACKAGE_LIBS} -ldl"
195194 PACKAGE_LIBS="${PACKAGE_LIBS} ${FONTCONFIG_LIBS}"
196- PACKAGE_LIBS="${PACKAGE_LIBS} `sdl2-config --libs` `freetype -config --libs`"
195+ PACKAGE_LIBS="${PACKAGE_LIBS} `sdl2-config --libs` `pkg -config --libs freetype2 `"
197196 ;;
198197
199198 *)
@@ -207,10 +206,10 @@ function buildSDL() {
207206 dnl backlinking support for modules
208207 PACKAGE_LIBS="${PACKAGE_LIBS} -ldl -no-pie"
209208 PACKAGE_LIBS="${PACKAGE_LIBS} ${FONTCONFIG_LIBS}"
210- PACKAGE_LIBS="-static-libgcc ${PACKAGE_LIBS} `sdl2-config --static-libs` `freetype -config --libs`"
209+ PACKAGE_LIBS="-static-libgcc ${PACKAGE_LIBS} `sdl2-config --static-libs` `pkg -config --libs freetype2 `"
211210 esac
212211
213- PACKAGE_CFLAGS="${PACKAGE_CFLAGS} `sdl2-config --cflags` `freetype -config --cflags` -fno-exceptions"
212+ PACKAGE_CFLAGS="${PACKAGE_CFLAGS} `sdl2-config --cflags` `pkg -config --cflags freetype2 ` -fno-exceptions"
214213 CXXFLAGS="${CXXFLAGS} -fno-rtti -std=c++11"
215214
216215 dnl preconfigured values for SDL build
@@ -441,6 +440,13 @@ echo ${TARGET}
441440echo "CFLAGS=${CFLAGS}"
442441echo "CXXFLAGS=${CXXFLAGS}"
443442echo "PACKAGE_LIBS=${PACKAGE_LIBS}"
443+
444+ if test x$ac_build_sdl = xyes; then
445+ echo
446+ echo "sdl2: `sdl2-config --version`"
447+ echo "freetype: `pkg-config --version freetype2`"
448+ fi
449+
444450echo
445451
446452if test x$ac_build_dist = xyes; then
0 commit comments