# see what flags are available. (Better yet, read the documentation!)
#
-AC_INIT([The Glorious Glasgow Haskell Compilation System], [6.11.20081214], [glasgow-haskell-bugs@haskell.org], [ghc])
+AC_INIT([The Glorious Glasgow Haskell Compilation System], [6.11], [glasgow-haskell-bugs@haskell.org], [ghc])
# Set this to YES for a released version, otherwise NO
: ${RELEASE=NO}
dnl ** check for more functions
dnl ** The following have been verified to be used in ghc/, but might be used somewhere else, too.
AC_CHECK_FUNCS([getclock getrusage gettimeofday setitimer siginterrupt sysconf times ctime_r])
+
+AC_TRY_RUN([
+#include <sys/types.h>
+#include <sys/time.h>
+int main(void) {
+ struct itimerval tval;
+ tval.it_value.tv_sec = 1;
+ tval.it_value.tv_usec = 0;
+ tval.it_interval = tval.it_value;
+ return setitimer(ITIMER_VIRTUAL, &tval, (void*)0) != 0;
+}
+],[AC_DEFINE([HAVE_SETITIMER_VIRTUAL], [1], [Define to 1 if setitimer accepts ITIMER_VIRTUAL, 0 else.])])
+
dnl ** On OS X 10.4 (at least), time.h doesn't declare ctime_r if
dnl ** _POSIX_C_SOURCE is defined
AC_CHECK_DECLS([ctime_r], , ,
AC_CONFIG_FILES([mk/config.mk compiler/ghc.cabal ghc/ghc-bin.cabal ghc.spec extra-gcc-opts docs/users_guide/ug-book.xml])
AC_CONFIG_COMMANDS([mk/stamp-h],[echo timestamp > mk/stamp-h])
AC_OUTPUT
+
+# We get caught by
+# http://savannah.gnu.org/bugs/index.php?1516
+# $(eval ...) inside conditionals causes errors
+# with make 3.80, so warn the user if it looks like they're about to
+# try to use it.
+checkMake380() {
+ if $1 --version 2>&1 | head -1 | grep -q 'GNU Make 3\.80'
+ then
+ echo
+ echo "WARNING: It looks like \"$1\" is GNU make 3.80."
+ echo "This version cannot be used to build GHC."
+ echo "Please use GNU make >= 3.81."
+ fi
+}
+
+checkMake380 make
+checkMake380 gmake
+