Skip to content

Commit adedde2

Browse files
authored
Merge pull request #97 from comick/master
Fix build on recent debian based systems due to lack of freetype-config
2 parents 4a7f144 + 72fbf77 commit adedde2

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

configure.ac

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,10 @@ 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
161-
AC_MSG_ERROR([libfreetype6-dev not installed: configure failed.])
162-
fi
159+
SAVED_CPPFLAGS="$CPPFLAGS"
160+
CPPFLAGS="$CPPFLAGS `pkg-config freetype2 --cflags`"
161+
AC_CHECK_HEADERS([ft2build.h], [], [AC_MSG_ERROR([libfreetype6-dev not installed: configure failed.])])
162+
CPPFLAGS="$SAVED_CPPFLAGS"
163163

164164
AC_CHECK_PROG(have_xxd, xxd, [yes], [no])
165165
if test "${have_xxd}" = "no" ; then
@@ -178,7 +178,7 @@ function buildSDL() {
178178
PACKAGE_CFLAGS="${PACKAGE_CFLAGS} -mms-bitfields"
179179
PACKAGE_LIBS="${PACKAGE_LIBS} -lwsock32 -lws2_32 -static-libgcc -static-libstdc++"
180180
PACKAGE_LIBS="${PACKAGE_LIBS} -Wl,-Bstatic -Wl,-Map=output.map"
181-
PACKAGE_LIBS="${PACKAGE_LIBS} `sdl2-config --static-libs` `freetype-config --libs`"
181+
PACKAGE_LIBS="${PACKAGE_LIBS} `sdl2-config --static-libs` `pkg-config freetype2 --libs`"
182182
AC_DEFINE(_Win32, 1, [Windows build])
183183
;;
184184

@@ -193,7 +193,7 @@ function buildSDL() {
193193
dnl backlinking support for modules
194194
PACKAGE_LIBS="${PACKAGE_LIBS} -ldl"
195195
PACKAGE_LIBS="${PACKAGE_LIBS} ${FONTCONFIG_LIBS}"
196-
PACKAGE_LIBS="${PACKAGE_LIBS} `sdl2-config --libs` `freetype-config --libs`"
196+
PACKAGE_LIBS="${PACKAGE_LIBS} `sdl2-config --libs` `pkg-config freetype2 --libs`"
197197
;;
198198

199199
*)
@@ -207,10 +207,10 @@ function buildSDL() {
207207
dnl backlinking support for modules
208208
PACKAGE_LIBS="${PACKAGE_LIBS} -ldl -no-pie"
209209
PACKAGE_LIBS="${PACKAGE_LIBS} ${FONTCONFIG_LIBS}"
210-
PACKAGE_LIBS="-static-libgcc ${PACKAGE_LIBS} `sdl2-config --static-libs` `freetype-config --libs`"
210+
PACKAGE_LIBS="-static-libgcc ${PACKAGE_LIBS} `sdl2-config --static-libs` `pkg-config freetype2 --libs`"
211211
esac
212212

213-
PACKAGE_CFLAGS="${PACKAGE_CFLAGS} `sdl2-config --cflags` `freetype-config --cflags` -fno-exceptions"
213+
PACKAGE_CFLAGS="${PACKAGE_CFLAGS} `sdl2-config --cflags` `pkg-config freetype2 --cflags` -fno-exceptions"
214214
CXXFLAGS="${CXXFLAGS} -fno-rtti -std=c++11"
215215

216216
dnl preconfigured values for SDL build

0 commit comments

Comments
 (0)