libftdi Archives

Subject: [PATCH] AX_BOOST_BASE: fix host boost search when cross-compiling

From: Mike Frysinger <vapier@xxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Cc: Thomas Porschberg <thomas@xxxxxxxxxxxxxxx>, autoconf-archive-maintainers@xxxxxxxxxx, Peter Simons <simons@xxxxxxx>
Date: Tue, 29 Dec 2009 03:48:59 -0500
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@xxxxxxxxxx>
---
 acinclude.m4 |   41 ++++++++++++++++++++++-------------------
 1 files changed, 22 insertions(+), 19 deletions(-)

diff --git a/acinclude.m4 b/acinclude.m4
index 80b33bf..6d10141 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -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
-- 
1.6.6


--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread
  • [PATCH] AX_BOOST_BASE: fix host boost search when cross-compiling, Mike Frysinger <=