summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsimonmar <unknown>2003-01-08 12:03:29 +0000
committersimonmar <unknown>2003-01-08 12:03:29 +0000
commit7a156bdfc2b3ba1b406f96a3a68abb0d076410b0 (patch)
treeb01949c02e9380f278f29300a03b37bfa4a39c6c
parent3801775fcf2c8f0e05a6ea9e5db7cd2cd4d50975 (diff)
downloadhaskell-7a156bdfc2b3ba1b406f96a3a68abb0d076410b0.tar.gz
[project @ 2003-01-08 12:03:28 by simonmar]
- 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.
-rw-r--r--acconfig.h9
-rw-r--r--aclocal.m426
-rw-r--r--configure.in1
-rw-r--r--mk/config.h.in15
4 files changed, 41 insertions, 10 deletions
diff --git a/acconfig.h b/acconfig.h
index 0ddbcb8ece..33a2256d32 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -357,6 +357,9 @@
/* 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
@@ -411,6 +414,12 @@
/* 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
diff --git a/aclocal.m4 b/aclocal.m4
index b5b5a2b20c..647c077932 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -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
diff --git a/configure.in b/configure.in
index 996be592f5..d2426e29e2 100644
--- a/configure.in
+++ b/configure.in
@@ -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
diff --git a/mk/config.h.in b/mk/config.h.in
index ae303f9254..9334929dd3 100644
--- a/mk/config.h.in
+++ b/mk/config.h.in
@@ -357,6 +357,9 @@
/* 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
@@ -411,6 +414,12 @@
/* 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
@@ -1077,9 +1086,3 @@
/* 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