[project @ 2003-01-08 12:03:28 by simonmar]
authorsimonmar <unknown>
Wed, 8 Jan 2003 12:03:29 +0000 (12:03 +0000)
committersimonmar <unknown>
Wed, 8 Jan 2003 12:03:29 +0000 (12:03 +0000)
- Detect whether we have a recent GCC that might need
  -mno-omit-leaf-fram-pointer.

- Add missing HAVE_SC_GETGR_R_SIZE_MAX and HAVE_SC_GETPW_R_SIZE_MAX
  templates to acconfig.h.

- Regen mk/config.h.in.

acconfig.h
aclocal.m4
configure.in
mk/config.h.in

index 0ddbcb8..33a2256 100644 (file)
 /* Define if the HaskellSupport.framework is installed (Mac OS X only) */
 #undef HAVE_FRAMEWORK_HASKELLSUPPORT
 
+/* Define if gcc supports -mno-omit-leaf-frame-pointer */
+#undef HAVE_GCC_MNO_OMIT_LFPTR
+
 /* Define if you have the GetModuleFileName function.  */
 #undef HAVE_GETMODULEFILENAME
 
 /* Define if readline has version >= 4.2. */
 #undef HAVE_READLINE_4_2
 
+/* Define if <unistd.h> defines _SC_GETGR_R_SIZE_MAX */
+#undef HAVE_SC_GETGR_R_SIZE_MAX
+
+/* Define if <unistd.h> defines _SC_GETPW_R_SIZE_MAX */
+#undef HAVE_SC_GETPW_R_SIZE_MAX
+
 /* Define if you have the sigpoll() function */
 #undef HAVE_SIGPOLL
 
index b5b5a2b..647c077 100644 (file)
@@ -1,4 +1,4 @@
-dnl $Id: aclocal.m4,v 1.110 2002/12/19 11:28:58 simonmar Exp $
+dnl $Id: aclocal.m4,v 1.111 2003/01/08 12:03:28 simonmar Exp $
 dnl 
 dnl Extra autoconf macros for the Glasgow fptools
 dnl
@@ -417,10 +417,10 @@ AC_DEFUN(FPTOOLS_HAVE_GCC,
     fptools_cv_have_gcc='no'
 else
 changequote(, )dnl
-    is_gcc_v1="`$CC -v 2>&1 | grep 'version ' | sed -e 's/.*version [^0-9]*\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/expr 2000 \\\>= \1 \\\* 1000 + \2/g' `"
+    gcc_version_str="`$CC -v 2>&1 | grep 'version ' | sed -e 's/.*version [^0-9]*\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\1\.\2/g' `"
 changequote([, ])dnl
     fptools_cv_have_gcc='yes'
-    if test `eval $is_gcc_v1 2>/dev/null` = "1"; then
+    FPTOOLS_PROG_CHECK_VERSION($gcc_version_str, -lt, "2.0",
         fptools_cv_have_gcc='no'
         echo ""
        echo "your gcc version appears to be ..."
@@ -428,13 +428,31 @@ changequote([, ])dnl
         echo "gcc prior to 2.0 and have never worked with ghc."
         echo "we recommend 2.95.3, although versions back to 2.7.2 should be ok."
         AC_MSG_ERROR([gcc 1.X has never been supported])
-    fi
+    )
 fi
 ])
 HaveGcc=`echo $fptools_cv_have_gcc | sed 'y/yesno/YESNO/'`
 AC_SUBST(HaveGcc)
 ])
 
+dnl
+dnl Some OSs (Mandrake Linux, in particular) configure GCC with
+dnl -momit-leaf-frame-pointer on by default.  If this is the case, we
+dnl need to turn it off for mangling to work.  The test is currently a bit
+dnl crude, using only the version number of gcc.
+dnl
+AC_DEFUN(FPTOOLS_GCC_NEEDS_NO_OMIT_LFPTR,
+[AC_CACHE_CHECK([whether gcc needs -mno-omit-leaf-frame-pointer], fptools_cv_gcc_needs_no_omit_lfptr,
+[
+ fptools_cv_gcc_needs_no_omit_lfptr='no'
+ FPTOOLS_PROG_CHECK_VERSION($gcc_version_str, -ge, "3.2",
+     fptools_cv_gcc_needs_no_omit_lfptr='yes')
+])
+if test "$fptools_cv_gcc_needs_no_omit_lfptr" = "yes"; then
+   AC_DEFINE(HAVE_GCC_MNO_OMIT_LFPTR)
+fi
+])
+
 dnl Small feature test for perl version. Assumes PerlCmd
 dnl contains path to perl binary
 dnl
index 996be59..d2426e2 100644 (file)
@@ -594,6 +594,7 @@ dnl     If gcc, make sure it's at least 2.1
 dnl
 AC_PROG_CC
 FPTOOLS_HAVE_GCC
+FPTOOLS_GCC_NEEDS_NO_OMIT_LFPTR
 
 dnl ** figure out how to invoke cpp directly (gcc -E is no good)
 AC_PROG_CPP
index ae303f9..9334929 100644 (file)
 /* Define if the HaskellSupport.framework is installed (Mac OS X only) */
 #undef HAVE_FRAMEWORK_HASKELLSUPPORT
 
+/* Define if gcc supports -mno-omit-leaf-frame-pointer */
+#undef HAVE_GCC_MNO_OMIT_LFPTR
+
 /* Define if you have the GetModuleFileName function.  */
 #undef HAVE_GETMODULEFILENAME
 
 /* Define if readline has version >= 4.2. */
 #undef HAVE_READLINE_4_2
 
+/* Define if <unistd.h> defines _SC_GETGR_R_SIZE_MAX */
+#undef HAVE_SC_GETGR_R_SIZE_MAX
+
+/* Define if <unistd.h> defines _SC_GETPW_R_SIZE_MAX */
+#undef HAVE_SC_GETPW_R_SIZE_MAX
+
 /* Define if you have the sigpoll() function */
 #undef HAVE_SIGPOLL
 
 
 /* Define to empty if `const' does not conform to ANSI C. */
 #undef const
-
-/* Define if <unistd.h> defines _SC_GETGR_R_SIZE_MAX */
-#undef HAVE_SC_GETGR_R_SIZE_MAX
-
-/* Define if <unistd.h> defines _SC_GETPW_R_SIZE_MAX */
-#undef HAVE_SC_GETPW_R_SIZE_MAX