From: Helmut Grohne Subject: Fix cross build from source Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=945403 --- a/configure.in +++ b/configure.in @@ -14,17 +14,15 @@ # Checks for --enable args AC_MSG_CHECKING(whether to enable FreeType2 support) -AC_ARG_ENABLE(ttf, [ --enable-ttf enable FreeType2 support], - if [[[ "$enableval" = "yes" ]]]; then - AC_DEFINE(TTF_SUPPORT, [1], [Define to 1 to enable FreeType2 support]) - CFLAGS="$CFLAGS `freetype-config --cflags`" - FTLIB="-lfreetype" - ttf_support="yes" - else - ttf_support="no" - fi, +AC_ARG_ENABLE(ttf, [ --enable-ttf enable FreeType2 support]) +AS_IF([[[ "$enable_ttf" = "yes" ]]],[ + AC_DEFINE(TTF_SUPPORT, [1], [Define to 1 to enable FreeType2 support]) + PKG_CHECK_MODULES([FREETYPE2],[freetype2]) + CFLAGS="$CFLAGS $FREETYPE2_CFLAGS" + ttf_support="yes" +],[ ttf_support="no" -) +]) AC_MSG_RESULT($ttf_support) # Checks for libraries. @@ -43,7 +41,6 @@ AC_HEADER_STDC AC_CHECK_FUNCS([memset]) -AC_SUBST(FTLIB) AC_CONFIG_FILES([ Makefile src/Makefile --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,10 +5,10 @@ lib_LTLIBRARIES = libg15render.la libg15render_la_SOURCES = libg15render.h text.c pixel.c screen.c -libg15render_la_LIBADD = @FTLIB@ +libg15render_la_LIBADD = @FREETYPE2_LIBS@ libg15render_la_LDFLAGS = -version-info 2:0:1 include_HEADERS= libg15render.h bin_PROGRAMS = g15fontconvert g15fontconvert_SOURCES = g15fontconvert.c -g15fontconvert_LDADD = libg15render.la @FTLIB@ +g15fontconvert_LDADD = libg15render.la @FREETYPE2_LIBS@