[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1003310: soundmodem FTCBFS for architectures other than i686-pc-cygwin



Source: soundmodem
Version: 0.20-6
Tags: patch upstream
User: debian-cross@lists.debian.org
Usertags: ftcbfs

soundmodem fails to cross build from source, because its configure
script thinks that cross building means building for i686-pc-cygwin, but
there are many other architectures. It also thinks that during cross
building, pkg-config doesn't work, which happens to be the think that
just works on Debian. I'm attaching a patch to extend the cross build
support upstream. Please consider applying it.

Helmut
--- soundmodem-0.20.orig/configure.ac
+++ soundmodem-0.20/configure.ac
@@ -32,7 +32,7 @@
 AC_OBJEXT
 
 dnl check for cross compiler path
-if test x$cross_compiling = xyes; then
+if test x$cross_compiling = xyes && test "x$host_alias" = i686-pc-cygwin; then
   AC_MSG_CHECKING(for cross compiler path)
   if test -d /usr/local/cross/i686-pc-cygwin; then
     CROSSCOMPPATH=/usr/local/cross/i686-pc-cygwin
@@ -137,25 +137,28 @@
   LIBS="$LIBS -ldsound -lgdi32"
 fi
 
-if test x$cross_compiling = xyes; then
-  gtk=no
-  xlibs="$LIBS"
-  LIBS="$LIBS -L$CROSSCOMPPATH/gtk/lib"
-  AC_CHECK_LIB(gtk,gtk_main,gtk=yes)
-  LIBS="$xlibs"
-  if test x$gtk = xyes; then
-    GTK_CFLAGS="-I$CROSSCOMPPATH/gtk/include -I$CROSSCOMPPATH/gtk/include/glib -I$CROSSCOMPPATH/gtk/include/gdk"
-    GTK_LIBS="-L$CROSSCOMPPATH/gtk/lib -lgtk -lgdk -lglib"
-    PTHREAD_CFLAGS="-I$CROSSCOMPPATH/gtk/include"
-    PTHREAD_LIBS="-L$CROSSCOMPPATH/gtk/lib"
+PKG_CHECK_MODULES([GTK],[gtk+-2.0 >= 2.6.0],,[
+  if test x$cross_compiling = xyes; then
+    gtk=no
+    xlibs="$LIBS"
+    LIBS="$LIBS -L$CROSSCOMPPATH/gtk/lib"
+    AC_CHECK_LIB(gtk,gtk_main,gtk=yes)
+    LIBS="$xlibs"
+    if test x$gtk = xyes; then
+      GTK_CFLAGS="-I$CROSSCOMPPATH/gtk/include -I$CROSSCOMPPATH/gtk/include/glib -I$CROSSCOMPPATH/gtk/include/gdk"
+      GTK_LIBS="-L$CROSSCOMPPATH/gtk/lib -lgtk -lgdk -lglib"
+      PTHREAD_CFLAGS="-I$CROSSCOMPPATH/gtk/include"
+      PTHREAD_LIBS="-L$CROSSCOMPPATH/gtk/lib"
+    fi
+  fi
+])
+PKG_CHECK_MODULES([XML],[libxml-2.0])
+PKG_CHECK_MODULES([AUDIOFILE],[audiofile],,[
+  if test x$cross_compiling = xyes && test "x$GTK_LIBS" != x; then
     AUDIOFILE_CFLAGS="-I$CROSSCOMPPATH/audiofile/include"
     AUDIOFILE_LIBS="-L$CROSSCOMPPATH/audiofile/lib -laudiofile"
   fi
-else
-  PKG_CHECK_MODULES(XML,libxml-2.0)
-  PKG_CHECK_MODULES(GTK,gtk+-2.0 >= 2.6.0)
-  PKG_CHECK_MODULES(AUDIOFILE,audiofile)
-fi
+])
 
 dnl Check for recently introduced GTK symbols
 xlibs="$LIBS"

Reply to: