Package: autoconf-archive
Version: 20170321-1
File: /usr/share/aclocal/ax_boost_base.m4
User: helm...@debian.org
Usertags: rebootstrap
Tags: patch upstream
Control: affects -1 + src:gource

gource fails to cross build from source for wicked reasons. It
terminates with:

| Could not link against -lGLU !

But that is a red herring. GLU is found. It just happens that ax_lib
contains something old. The problem here is that BOOSTLIBDIR ends up
being empty. It is derived from BOOST_LDFLAGS e.g. in AX_BOOST_SYSTEM or
AX_BOOST_FILESYSTEM. Those latter macros expect that BOOST_LDFLAGS
contains a -L flag. That flag goes missing during cross compilation. In
AC_BOOST_BASE, the variable "libsubdirs" is properly set up to contain
the multiarch libdir of the host architecture first. However, it is only
searched for native compilation. For Debian systems, removing the cross
compiling guard would likely resolve the issue. I'm less sure that this
is universally correct though. Maybe a good solution would be to split
"libsubdirs" into the multiarch directory (which would always be
searched) and the others, which would only be searched for native
compilation. I am attaching a patch for this approach.

Helmut
--- a/ax_boost_base.m4
+++ b/ax_boost_base.m4
@@ -101,11 +101,11 @@ if test "x$want_boost" = "xyes"; then
     dnl them priority over the other paths since, if libs are found there, they
     dnl are almost assuredly the ones desired.
     AC_REQUIRE([AC_CANONICAL_HOST])
-    libsubdirs="lib/${host_cpu}-${host_os} $libsubdirs"
+    multiarch_libsubdir="lib/${host_cpu}-${host_os}"
 
     case ${host_cpu} in
       i?86)
-        libsubdirs="lib/i386-${host_os} $libsubdirs"
+        multiarch_libsubdir="lib/i386-${host_os}"
         ;;
     esac
 
@@ -114,16 +114,21 @@ if test "x$want_boost" = "xyes"; then
     dnl or if you install boost with RPM
     if test "$ac_boost_path" != ""; then
         BOOST_CPPFLAGS="-I$ac_boost_path/include"
-        for ac_boost_path_tmp in $libsubdirs; do
+        for ac_boost_path_tmp in $multiarch_libsubdir $libsubdirs; do
                 if test -d "$ac_boost_path"/"$ac_boost_path_tmp" ; then
                         BOOST_LDFLAGS="-L$ac_boost_path/$ac_boost_path_tmp"
                         break
                 fi
         done
-    elif test "$cross_compiling" != yes; then
+    else
+        if test "$cross_compiling" = yes; then
+            search_libsubdirs=$multiarch_libsubdir
+        else
+            search_libsubdirs="$multiarch_libsubdir $libsubdirs"
+        fi
         for ac_boost_path_tmp in /usr /usr/local /opt /opt/local ; do
             if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then
-                for libsubdir in $libsubdirs ; do
+                for libsubdir in $search_libsubdirs ; do
                     if ls "$ac_boost_path_tmp/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
                 done
                 BOOST_LDFLAGS="-L$ac_boost_path_tmp/$libsubdir"

Reply via email to