]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
gcc-3.0.4 (x86) doesn't understand -m32, so autoconfiscate it
authorJulian Seward <jseward@acm.org>
Sat, 4 Jun 2005 23:14:53 +0000 (23:14 +0000)
committerJulian Seward <jseward@acm.org>
Sat, 4 Jun 2005 23:14:53 +0000 (23:14 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3848

configure.in

index 39650377b9e12671ec036a23903a966026e7c672..0aed2b8cac2b0b9206f0aaa59ba4952daa82334f 100644 (file)
@@ -62,7 +62,7 @@ AC_SUBST(ASFLAGS)
 DEFAULT_SUPP=""
 
 
-# We don't want gcc 2.7
+# We don't want gcc < 3.0
 AC_MSG_CHECKING([for a supported version of gcc])
 
 gcc_version=`${CC} --version | head -n 1`
@@ -70,7 +70,15 @@ gcc_version=`${CC} --version | head -n 1`
 case "${gcc_version}" in
      gcc-2.7.*)
        AC_MSG_RESULT([no (${gcc_version})])
-       AC_MSG_ERROR([please use a recent (>= gcc-2.95) version of gcc])
+       AC_MSG_ERROR([please use a recent (>= gcc-3.0) version of gcc])
+       ;;
+     gcc-2.8.*)
+       AC_MSG_RESULT([no (${gcc_version})])
+       AC_MSG_ERROR([please use a recent (>= gcc-3.0) version of gcc])
+       ;;
+     gcc-2.9*)
+       AC_MSG_RESULT([no (${gcc_version})])
+       AC_MSG_ERROR([please use a recent (>= gcc-3.0) version of gcc])
        ;;
 
      *)
@@ -96,9 +104,9 @@ case "${host_cpu}" in
        AC_MSG_RESULT([ok (${host_cpu})])
         VG_ARCH="x86"
         KICKSTART_BASE="0xb0000000"
-        ARCH_CORE_AM_CFLAGS="-m32 @PREFERRED_STACK_BOUNDARY@ -DELFSZ=32"
-        ARCH_TOOL_AM_CFLAGS="-m32 @PREFERRED_STACK_BOUNDARY@"
-        ARCH_CORE_AM_CCASFLAGS="-m32"
+        ARCH_CORE_AM_CFLAGS="@FLAG_M32@ @PREFERRED_STACK_BOUNDARY@ -DELFSZ=32"
+        ARCH_TOOL_AM_CFLAGS="@FLAG_M32@ @PREFERRED_STACK_BOUNDARY@"
+        ARCH_CORE_AM_CCASFLAGS="@FLAG_M32@"
         ;;
 
      x86_64) 
@@ -268,6 +276,7 @@ case "${glibc}" in
        ;;
 esac
 
+
 # We don't know how to detect the X client library version
 # (detecting the server version is easy, bu no help).  So we
 # just use a hack: always include the suppressions for both
@@ -279,6 +288,27 @@ if test "${no_x}" != 'yes' ; then
 fi
 
 
+# does this compiler support -m32 ?
+AC_MSG_CHECKING([if gcc accepts -m32])
+
+safe_CFLAGS=$CFLAGS
+CFLAGS="-m32"
+
+AC_TRY_COMPILE(, [
+int main () { return 0 ; }
+],
+[
+FLAG_M32="-m32"
+AC_MSG_RESULT([yes])
+], [
+FLAG_M32=""
+AC_MSG_RESULT([no])
+])
+CFLAGS=$safe_CFLAGS
+
+AC_SUBST(FLAG_M32)
+
+
 # does this compiler support -mpreferred-stack-boundary=2 ?
 AC_MSG_CHECKING([if gcc accepts -mpreferred-stack-boundary])
 
@@ -299,6 +329,7 @@ CFLAGS=$safe_CFLAGS
 
 AC_SUBST(PREFERRED_STACK_BOUNDARY)
 
+
 # does this compiler support -Wno-pointer-sign ?
 AC_MSG_CHECKING([if gcc accepts -Wno-pointer-sign ])
 
@@ -321,6 +352,7 @@ if test x$no_pointer_sign = xyes; then
   CFLAGS="$CFLAGS -Wno-pointer-sign"
 fi
 
+
 # Check for TLS support in the compiler and linker
 AC_CACHE_CHECK([for TLS support], vg_cv_tls,
               [AC_ARG_ENABLE(tls, [  --enable-tls            platform supports TLS],
@@ -334,6 +366,7 @@ if test "$vg_cv_tls" = yes; then
 AC_DEFINE([HAVE_TLS], 1, [can use __thread to define thread-local variables])
 fi
 
+
 # Check for PIE support in the compiler and linker
 AC_SUBST(PIE_AM_CFLAGS)
 AC_CACHE_CHECK([for PIE support], vg_cv_pie,
@@ -360,12 +393,14 @@ AM_CONDITIONAL(USE_PIE, test "$vg_cv_pie" = "yes")
 AC_HEADER_STDC
 AC_CHECK_HEADERS([sys/endian.h endian.h mqueue.h])
 
+
 # Checks for typedefs, structures, and compiler characteristics.
 AC_TYPE_UID_T
 AC_TYPE_OFF_T
 AC_TYPE_SIZE_T
 AC_HEADER_TIME
 
+
 # Checks for library functions.
 AC_FUNC_MEMCMP
 AC_FUNC_MMAP