AX_BOOST_BASE: fix host boost search when cross-compiling
authorMike Frysinger <vapier@gentoo.org>
Tue, 29 Dec 2009 08:48:59 +0000 (03:48 -0500)
committerGerd von Egidy <gerd.von.egidy@intra2net.com>
Mon, 4 Jan 2010 09:47:02 +0000 (10:47 +0100)
The AX_BOOST_BASE macro likes to do searches in the host paths (/usr and
such) which is obviously incorrect for cross-compiling.  So disable these
fallback searches when cross-compiling.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

acinclude.m4

index 80b33bf..6d10141 100644 (file)
@@ -86,7 +86,7 @@ if test "x$want_boost" = "xyes"; then
        if test "$ac_boost_path" != ""; then
                BOOST_LDFLAGS="-L$ac_boost_path/lib"
                BOOST_CPPFLAGS="-I$ac_boost_path/include"
-       else
+       elif test "$cross_compiling" != yes; then
                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
                                BOOST_LDFLAGS="-L$ac_boost_path_tmp/lib"
@@ -146,25 +146,28 @@ if test "x$want_boost" = "xyes"; then
                                done
                        fi
                else
-                       for ac_boost_path in /usr /usr/local /opt /opt/local ; do
-                               if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
-                                       for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
-                                               _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
-                                               V_CHECK=`expr $_version_tmp \> $_version`
-                                               if test "$V_CHECK" = "1" ; then
-                                                       _version=$_version_tmp
-                                                       best_path=$ac_boost_path
-                                               fi
-                                       done
+                       if test "$cross_compiling" != yes; then
+                               for ac_boost_path in /usr /usr/local /opt /opt/local ; do
+                                       if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
+                                               for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
+                                                       _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
+                                                       V_CHECK=`expr $_version_tmp \> $_version`
+                                                       if test "$V_CHECK" = "1" ; then
+                                                               _version=$_version_tmp
+                                                               best_path=$ac_boost_path
+                                                       fi
+                                               done
+                                       fi
+                               done
+
+                               VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
+                               BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE"
+                               if test "$ac_boost_lib_path" = ""
+                               then
+                                       BOOST_LDFLAGS="-L$best_path/lib"
                                fi
-                       done
-
-                       VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
-                       BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE"
-            if test "$ac_boost_lib_path" = ""
-            then
-               BOOST_LDFLAGS="-L$best_path/lib"
-            fi
+
+                       fi
 
                        if test "x$BOOST_ROOT" != "x"; then
                                if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/lib" && test -r "$BOOST_ROOT/stage/lib"; then