Source: libg15render
Version: 1.3.0~svn316-2.4
Tags: patch
User: [email protected]
Usertags: ftcbfs

libg15render fails to cross build from source, because ./configure hard
codes the build architecture pkg-config and thus fails finding
freetype2. This is a regression introduced in #892334. Replacing a
freetype-config with pkg-config does not simply work. freetype-config
was architecture-dependent while pkg-config needs to be told about the
architecture by a prefix. For this reason, one should always be using
PKG_CHECK_MODULES with autoconf. Note that PKG_CHECK_MODULES does not
work inside AC_ARG_VAR. I had to do a bit of restructuring, but the
resulting code is more concise. Please consider applying the attached
patch.

Helmut
--- libg15render-1.3.0~svn316.orig/configure.in
+++ libg15render-1.3.0~svn316/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 `pkg-config --cflags freetype2`"
-		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
--- libg15render-1.3.0~svn316.orig/src/Makefile.am
+++ libg15render-1.3.0~svn316/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@

Reply via email to