Comments only
[ghc-hetmet.git] / aclocal.m4
index 53bd165..f386b35 100644 (file)
 AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
 [
     case $$1 in
-    i386-apple-darwin|powerpc-apple-darwin)
-        $2="$$2 -m32"
-        $3="$$3 -m32"
+    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
+        # back to generic i686 compatibility. Trac #2983.
+        $2="$$2 -march=i686 -m32"
+        $3="$$3 -march=i686 -m32"
         ;;
     x86_64-apple-darwin)
         $2="$$2 -m64"
         $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
 ])
 
 
@@ -141,7 +154,7 @@ AC_DEFUN([FP_COMPUTE_INT],
 # A variation of AC_CHECK_SIZEOF for computing the alignment restrictions of a
 # given type. Defines ALIGNMENT_TYPE.
 AC_DEFUN([FP_CHECK_ALIGNMENT],
-[AS_LITERAL_IF([$1], [],
+[AS_LITERAL_IF(m4_translit([[$1]], [*], [p]), [],
                [AC_FATAL([$0: requires literal arguments])])[]dnl
 AC_CHECK_TYPE([$1], [], [], [$3])[]dnl
 m4_pushdef([fp_Cache], [AS_TR_SH([fp_cv_alignment_$1])])[]dnl
@@ -742,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
@@ -754,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">
@@ -849,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*
@@ -1253,7 +1266,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