Source: horgand
Version: 1.14-7
Tags: patch upstream
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

horgand fails to cross build from source. For one thing its configure
uses /proc/cpuinfo to determine whether sse is available. This produces
broken results for cross compiling. A better way is asking the compiler
whether it supports -msse. Then it hard codes bare pkg-config. One
should use PKG_CHECK_MODULES instead. The attached patch implements both
and makes horgand cross buildable. Please consider applying it.

Helmut
--- horgand-1.14.orig/configure.in
+++ horgand-1.14/configure.in
@@ -66,16 +66,23 @@
 AC_DEFINE([WEBSITE],["horgand.berlios.de"],[WEBSITE])
 
 
-SSE=$(cat /proc/cpuinfo | grep sse) 
+AC_MSG_CHECKING([for SSE])
+_save_CFLAGS=$CFLAGS
+CFLAGS="$CFLAGS -msse"
+AC_TRY_COMPILE([],[],[
+        AC_MSG_RESULT([yes])
+	SSE=-msse
+],[
+   	AC_MSG_RESULT([no])
+	SSE=
+])
+CFLAGS="$_save_CFLAGS"
 
-if test -z "$SSE"; then 
-SSE=""
-else
-SSE="-msse"
-fi
+PKG_CHECK_MODULES([JACK],[jack])
+PKG_CHECK_MODULES([SNDFILE],[sndfile])
 
-LIBS="`$FLTKCONFIG --ldflags` -lasound `pkg-config --libs jack` `pkg-config --libs sndfile` -lXpm"
-CXXFLAGS="-O3 -fno-rtti -pipe -ffast-math -ffunction-sections -fomit-frame-pointer $SSE -Wall `$FLTKCONFIG --cxxflags` `pkg-config --cflags jack` `pkg-config --cflags sndfile`"
+LIBS="`$FLTKCONFIG --ldflags` -lasound $JACK_LIBS $SNDFILE_LIBS -lXpm"
+CXXFLAGS="-O3 -fno-rtti -pipe -ffast-math -ffunction-sections -fomit-frame-pointer $SSE -Wall `$FLTKCONFIG --cxxflags` $JACK_CFLAGS $SNDFILE_CFLAGS"
 AC_CONFIG_FILES([Makefile src/Makefile data/Makefile man/Makefile])
 AC_OUTPUT
 

Reply via email to