]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Try and automatically detect pure 64 bit systems with no 32 bit support.
authorTom Hughes <tom@compton.nu>
Wed, 7 Jun 2006 17:44:36 +0000 (17:44 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 7 Jun 2006 17:44:36 +0000 (17:44 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5966

configure.in

index 2edd6f7279de3a7d14b86bb5596b160b4d563bd6..d342e09ed8e5d343b9e9f1852987b03e6a49bca7 100644 (file)
@@ -238,6 +238,31 @@ case "${host_os}" in
        ;;
 esac
 
+# If we are building on a 64 bit platform test to see if the system
+# supports building 32 bit programs and disable 32 bit support if it
+# does not support building 32 bit programs
+
+case "$VG_ARCH-$VG_OS" in
+     amd64-linux|ppc64-linux)
+        AC_MSG_CHECKING([for 32 bit build support])
+        safe_CFLAGS=$CFLAGS
+        CFLAGS="-m32"
+        AC_TRY_LINK(, [
+        int main () { return 0 ; }
+        ],
+        [
+        AC_MSG_RESULT([yes])
+        ], [
+        vg_cv_only64bit="yes"
+        AC_MSG_RESULT([no])
+        ])
+        CFLAGS=$safe_CFLAGS;;
+esac
+
+if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then
+   AC_MSG_ERROR(
+      [--enable-only32bit was specified but system does not support 32 bit builds])
+fi
 
 # Establish VG_PLATFORM_PRI.  This is the primary build target.  The
 # entire system, including regression and performance tests, will be