Source: sfst Version: 1.4.7b-1 Tags: patch upstream User: debian-cr...@lists.debian.org Usertags: ftcbfs
sfst fails to cross build from source, because it's architecture detection is broken. It runs the "arch" tool to figure out the host architecture, but it receives the build architecture. autotools already has functions for figuring that out. The attached patch uses that support and makes sfst cross buildable. Please consider applying it. Helmut
--- sfst-1.4.7b.orig/configure.ac +++ sfst-1.4.7b/configure.ac @@ -44,11 +44,7 @@ # Checks for programs. -AC_MSG_CHECKING([Compilation architecture: PPC, i686, x86_64, Other]) -if test x$(which arch) = x -then ARCH=$($(which uname) -m) -else ARCH=$($(which arch)) -fi +AC_CANONICAL_HOST AC_COMPILE_IFELSE([ #if defined(__GNUC__) && (__GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4)) @@ -61,7 +57,7 @@ return 0; }], [HAVE_ALTIVEC=yes], [HAVE_ALTIVEC=no]) -if test x$ARCH = xppc +if test x$host_cpu = xpowerpc then AC_MSG_RESULT([PowerPC]) CFLAGS="-Wall -ansi -mpowerpc -fno-pic -fomit-frame-pointer $CFLAGS" @@ -72,7 +68,7 @@ CXXFLAGS="-maltivec $CXXFLAGS" fi else - if test x$ARCH = xi686 + if test x$host_cpu = xi686 then AC_MSG_RESULT([i686]) CFLAGS="-Wall -ansi -march=i686 -O3 -fomit-frame-pointer -funroll-loops $CFLAGS" @@ -80,7 +76,7 @@ -fomit-frame-pointer -funroll-loops $CXXFLAGS" else - if test x$ARCH = xx86_64 + if test x$host_cpu = xx86_64 then AC_MSG_RESULT([x86_64]) CFLAGS="-Wall -ansi -O3 -mtune=nocona -fomit-frame-pointer -funroll-loops $CFLAGS"