Source: libotf
Version: 0.9.13-4
Tags: patch upstream
User: helm...@debian.org
Usertags: rebootstrap

libotf regressed cross building. It recently gained an invocation of the
wrong pkg-config. The attached patch fixes that using the
PKG_CHECK_MODULES macro. It automatically substitutes _CFLAGS and _LIBS
variables, so I renamed them in the build system. Furthermore,
PKG_CHECK_MODULES must not be used in an if (but can be used in AS_IF),
because it uses AC_REQUIRE. Please consider applying the patch.

Helmut
--- libotf-0.9.13.orig/configure.ac
+++ libotf-0.9.13/configure.ac
@@ -50,25 +50,22 @@
 
 # Check for Freetype2 usability.
 AC_CHECK_PROG(HAVE_PKG_CONFIG, pkg-config, yes)
-if test "x$HAVE_PKG_CONFIG" = "xyes"; then
-  FREETYPE_INC=`pkg-config freetype2 --cflags`
-  CPPFLAGS="$CPPFLAGS $FREETYPE_INC"
+AS_IF([test "x$HAVE_PKG_CONFIG" = "xyes"],[
+  PKG_CHECK_MODULES([FREETYPE],[freetype2],[],[HAVE_FREETYPE=no])
+  CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS"
   AC_CHECK_HEADER(ft2build.h, HAVE_FREETYPE=yes,
   			      HAVE_FREETYPE=no CPPFLAGS=$save_CPPFLAGS)
   if test "x$HAVE_FREETYPE" = "xyes" ; then
-    FREETYPE_LD_FLAGS=`pkg-config freetype2 --libs`;
-    LIBS="$LIBS $FREETYPE_LD_FLAGS"
+    LIBS="$LIBS $FREETYPE_LIBS"
     AC_CHECK_LIB(freetype, FT_Init_FreeType, HAVE_FREETYPE=yes,
     			   		     HAVE_FREETYPE=no)
   fi
-fi
+])
 
 if test "x$HAVE_FREETYPE" != "xyes" ; then
   echo "Freetype library wan't found in your system!"
   exit 1
 fi
-AC_SUBST(FREETYPE_INC)
-AC_SUBST(FREETYPE_LD_FLAGS)
 
 if test "x$no_x" != "xyes"; then
   X11_XT_XAW_XMU="-lX11 -lXt -lXaw -lXmu"
--- libotf-0.9.13.orig/libotf.pc.in
+++ libotf-0.9.13/libotf.pc.in
@@ -7,5 +7,5 @@
 Description: OpenType font library
 Version: @PACKAGE_VERSION@
 Requires: freetype2
-Libs: @FREETYPE_LD_FLAGS@ -L${libdir} -lotf
-Cflags: @FREETYPE_INC@ -I${includedir}
+Libs: @FREETYPE_LIBS@ -L${libdir} -lotf
+Cflags: @FREETYPE_CFLAGS@ -I${includedir}

Reply via email to