Add an extension for GHC's layout-rule relaxations
[ghc-hetmet.git] / aclocal.m4
index e0cae15..9ebfe7d 100644 (file)
@@ -10,7 +10,7 @@
 AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
 [
     case $$1 in
-    i386-apple-darwin|powerpc-apple-darwin)
+    i386-apple-darwin)
         # By default, gcc on OS X will generate SSE
         # instructions, which need things 16-byte aligned,
         # but we don't 16-byte align things. Thus drop
@@ -23,6 +23,15 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
         $3="$$3 -m64"
         ;;
     esac
+
+    # If gcc knows about the stack protector, turn it off.
+    # Otherwise the stack-smash handler gets triggered.
+    echo 'int main(void) {return 0;}' > conftest.c
+    if $CC -c conftest.c -fno-stack-protector > /dev/null 2>&1
+    then
+        $2="$$2 -fno-stack-protector"
+    fi
+    rm conftest.c conftest.o
 ])
 
 
@@ -746,7 +755,7 @@ AS_VAR_POPDEF([fp_func])dnl
 
 # FP_GEN_DOCBOOK_XML
 # ------------------
-# Generates a DocBook XML V4.2 document in conftest.xml.
+# Generates a DocBook XML V4.5 document in conftest.xml.
 #
 # It took a lot of experimentation to find a document that will cause
 # xsltproc to fail with an error code when the relevant
@@ -758,8 +767,8 @@ AC_DEFUN([FP_GEN_DOCBOOK_XML],
 [rm -f conftest.xml conftest-book.xml
 cat > conftest.xml << EOF
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
-   "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [[
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+   "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [[
 <!ENTITY conftest-book SYSTEM "conftest-book.xml">
 ]]>
 <book id="test">
@@ -853,7 +862,7 @@ if test -n "$XmllintCmd"; then
     AC_MSG_RESULT([ok])
   else
     AC_MSG_RESULT([failed])
-    AC_MSG_WARN([cannot find a DTD for DocBook XML V4.2, you will not be able to validate your documentation])
+    AC_MSG_WARN([cannot find a DTD for DocBook XML V4.5, you will not be able to validate your documentation])
     AC_MSG_WARN([check your XML_CATALOG_FILES environment variable and/or /etc/xml/catalog])
   fi
   rm -rf conftest*
@@ -966,9 +975,6 @@ AC_SUBST([GhcPkgCmd])
 # reordering things in the module and confusing the manger and/or splitter.
 # (eg. Trac #1427)
 #
-# If gcc knows about the stack protector, turn it off.
-# Otherwise the stack-smash handler gets triggered.
-#
 AC_DEFUN([FP_GCC_EXTRA_FLAGS],
 [AC_REQUIRE([FP_HAVE_GCC])
 AC_CACHE_CHECK([for extra options to pass gcc when compiling via C], [fp_cv_gcc_extra_opts],
@@ -994,12 +1000,6 @@ AC_CACHE_CHECK([for extra options to pass gcc when compiling via C], [fp_cv_gcc_
       [])
   ;;
  esac
- echo 'int main(void) {return 0;}' > conftest.c
- if $CC -c conftest.c -fno-stack-protector > /dev/null 2>&1
- then
-     fp_cv_gcc_extra_opts="$fp_cv_gcc_extra_opts -fno-stack-protector"
- fi
- rm conftest.c conftest.o
 ])
 AC_SUBST([GccExtraViaCOpts],$fp_cv_gcc_extra_opts)
 ])
@@ -1199,27 +1199,53 @@ case $fptools_cv_timer_create_works in
 esac
 ])
 
-# FP_ARG_GMP
+# FP_ICONV
 # -------------
-AC_DEFUN([FP_ARG_GMP],
+AC_DEFUN([FP_ICONV],
 [
-AC_ARG_WITH([gmp-includes],
-  [AC_HELP_STRING([--with-gmp-includes],
-    [directory containing gmp.h])],
-    [gmp_includes=$withval],
-    [gmp_includes=NONE])
-
-AC_ARG_WITH([gmp-libraries],
-  [AC_HELP_STRING([--with-gmp-libraries],
-    [directory containing gmp library])],
-    [gmp_libraries=$withval],
-    [gmp_libraries=NONE])
-])# FP_ARG_GMP
-
-AC_DEFUN([CHECK_GMP],
-[AC_REQUIRE([AC_PROG_CPP])
-AC_REQUIRE([AC_PROG_CC])
-])
+  dnl--------------------------------------------------------------------
+  dnl * Deal with arguments telling us iconv is somewhere odd
+  dnl--------------------------------------------------------------------
+
+  dnl Note: ICONV_LIB_DIRS and ICONV_INCLUDE_DIRS are not predefined
+  dnl to the empty string to allow them to be overridden from the
+  dnl environment.
+
+  AC_ARG_WITH([iconv-includes],
+    [AC_HELP_STRING([--with-iconv-includes],
+      [directory containing iconv.h])],
+      [ICONV_INCLUDE_DIRS=$withval])
+
+  AC_ARG_WITH([iconv-libraries],
+    [AC_HELP_STRING([--with-iconv-libraries],
+      [directory containing iconv library])],
+      [ICONV_LIB_DIRS=$withval])
+
+  AC_SUBST(ICONV_INCLUDE_DIRS)
+  AC_SUBST(ICONV_LIB_DIRS)
+])# FP_ICONV
+
+# FP_GMP
+# -------------
+AC_DEFUN([FP_GMP],
+[
+  dnl--------------------------------------------------------------------
+  dnl * Deal with arguments telling us gmp is somewhere odd
+  dnl--------------------------------------------------------------------
+
+  AC_ARG_WITH([gmp-includes],
+    [AC_HELP_STRING([--with-gmp-includes],
+      [directory containing gmp.h])],
+      [GMP_INCLUDE_DIRS=$withval])
+
+  AC_ARG_WITH([gmp-libraries],
+    [AC_HELP_STRING([--with-gmp-libraries],
+      [directory containing gmp library])],
+      [GMP_LIB_DIRS=$withval])
+
+  AC_SUBST(GMP_INCLUDE_DIRS)
+  AC_SUBST(GMP_LIB_DIRS)
+])# FP_GMP
 
 # FP_CHECK_MACOSX_DEPLOYMENT_TARGET
 # ---------------------------------
@@ -1266,7 +1292,7 @@ if test ! -f utils/ghc-pwd/ghc-pwd && test ! -f utils/ghc-pwd/ghc-pwd.exe; then
   rm -f *.hi
   rm -f ghc-pwd
   rm -f ghc-pwd.exe
-  "$WithGhc" -v0 --make ghc-pwd -o ghc-pwd
+  "$WithGhc" -v0 -no-user-package-conf --make ghc-pwd -o ghc-pwd
   cd ../..
 fi