Commit ffef2e046aaec853be356f0b8770a335185ea9cf

Anthony Green 2013-02-07T15:47:01

x32 and libtool fixes

diff --git a/ChangeLog b/ChangeLog
index 14dc3cc..37d415a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-02-07  Daniel Schepler <dschepler@gmail.com>
+
+	* configure.ac: Correctly identify x32 systems as 64-bit.
+	* m4/libtool.m4: Remove libtool expr error.
+	* aclocal.m4, configure: Rebuilt.
+
 2013-02-07  Anthony Green <green@moxielogic.com>
 
 	* configure.ac: Fix GCC usage test.
diff --git a/configure b/configure
index 696081a..d9f23a3 100755
--- a/configure
+++ b/configure
@@ -5361,7 +5361,8 @@ else
     ;;
   *)
     lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
-    if test -n "$lt_cv_sys_max_cmd_len"; then
+    if test -n "$lt_cv_sys_max_cmd_len" && \
+      test undefined != "$lt_cv_sys_max_cmd_len"; then
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
     else
@@ -13385,7 +13386,14 @@ case "$host" in
   i?86-*-* | x86_64-*-*)
 	TARGETDIR=x86
 	if test $ac_cv_sizeof_size_t = 4; then
-	  TARGET=X86;
+	  case "$host" in
+	    *-gnux32)
+	      TARGET=X86_64
+	      ;;
+	    *)
+	      TARGET=X86
+	      ;;
+          esac
 	else
 	  TARGET=X86_64;
 	fi
diff --git a/configure.ac b/configure.ac
index f44ed8f..4a37d0b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -166,7 +166,14 @@ case "$host" in
   i?86-*-* | x86_64-*-*)
 	TARGETDIR=x86
 	if test $ac_cv_sizeof_size_t = 4; then
-	  TARGET=X86; 
+	  case "$host" in
+	    *-gnux32)
+	      TARGET=X86_64
+	      ;;
+	    *)
+	      TARGET=X86
+	      ;;
+          esac	
 	else
 	  TARGET=X86_64; 
 	fi	  
diff --git a/m4/libtool.m4 b/m4/libtool.m4
index 540e0b4..3318f27 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -1695,7 +1695,8 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
     ;;
   *)
     lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
-    if test -n "$lt_cv_sys_max_cmd_len"; then
+    if test -n "$lt_cv_sys_max_cmd_len" && \
+      test undefined != "$lt_cv_sys_max_cmd_len"; then
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
     else