Source: fvwm3
Version: 1.1.0+ds-1
Tags: patch upstream
User: [email protected]
Usertags: ftcbfs

fvwm3 fails to cross build from source, because it uses AC_RUN_IFELSE
with no extra cross argument. I also noticed that it was calling bare
pkg-config and came up with the attached patch:

 * Don't overwrite libevent_LIBS (with a possibly empty string) as that
   already is set by PKG_CHECK_MODULES three lines earlier.
 * Simplify checking for freetype2 using PKG_CHECK_MODULES.
 * Add cross case to fribidi check.
 * Check for FRIBIDI_CHARSET_NOT_FOUND using AC_CHECK_DECL rather than
   AC_RUN_IFELSE.

This does not completely fix the build. For instance the mkstemp check
still fails. It does move fvm3 significantly closer to being cross
buildable though.

Helmut
--- fvwm3-1.1.0+ds.orig/configure.ac
+++ fvwm3-1.1.0+ds/configure.ac
@@ -465,7 +465,6 @@
 PKG_CHECK_MODULES([libevent], [libevent >= 2.0],
 [
 	 AC_DEFINE(HAVE_LIBEVENT)
-	libevent_LIBS=`pkg-config --libs libevent`
 ],
 [
 	 AC_MSG_ERROR([*** libevent >=2 not found.  Install its header files. ***])
@@ -558,19 +557,11 @@
 AH_TEMPLATE([HAVE_XFT],[Define if Xft library is used.])
 AH_TEMPLATE([HAVE_XFT2],[Define if Xft 2 library is used.])
 AH_TEMPLATE([HAVE_XFT_UTF8],[Define if Xft library can handle utf8 encoding])
-  AC_MSG_CHECKING([whether pkg-config could find freetype2])
-  if "${PKG_CONFIG}" --exists freetype2; then
-    AC_MSG_RESULT([yes])
-    CFLAGS_FREETYPE=`"${PKG_CONFIG}" --cflags freetype2`
-    FREETYPE_LIBS=`"${PKG_CONFIG}" --libs freetype2`
-    freetype_CFLAGS="$CFLAGS_FREETYPE"
-    freetype_LIBS="$FREETYPE_LIBS"
-
+  PKG_CHECK_MODULES([freetype], [freetype2], [
     have_freetype=yes
-  else
-  AC_MSG_RESULT([no])
-  have_freetype=no
-  fi
+  ], [
+    have_freetype=no
+  ])
 
   AC_SUBST(freetype_CFLAGS)
   AC_SUBST(freetype_LIBS)
@@ -1042,7 +1033,9 @@
 		logical_unicode_str);
 	return 0;
 }
-], [:], [fribidi_in_path=no])
+], [:], [fribidi_in_path=no], [
+  echo $ac_n "cross compiling; assumed OK... $ac_c"
+])
   LIBS="$ac_save_LIBS"
   if test ! x"$fribidi_in_path" = xyes; then
     ac_save_CFLAGS="$CFLAGS"
@@ -1078,11 +1071,7 @@
   Bidi_LIBS=
 else
   AC_DEFINE(HAVE_BIDI)
-  AC_TRY_RUN([#include <fribidi/fribidi.h>
-    int main(int c, char **v) {
-      return FRIBIDI_CHARSET_NOT_FOUND * 0;
-    }
-  ], [AC_DEFINE(FRIBIDI_CHARSET_SPELLING)])
+  AC_CHECK_DECL([FRIBIDI_CHARSET_NOT_FOUND], [AC_DEFINE(FRIBIDI_CHARSET_SPELLING)])
 fi
 AH_VERBATIM([_FRIBIDI_CHARSET_SPELLING],
 [#ifdef FRIBIDI_CHARSET_SPELLING

Reply via email to