Don't overwrite the *OPTS/*Opts variables in mk/validate-settings.mk
[ghc-hetmet.git] / configure.ac
index 0650d46..085dd35 100644 (file)
@@ -371,7 +371,10 @@ x86_64-apple-darwin*)
         HostArch_CPP='x86_64'
         HostVendor_CPP='apple'
         HostOS_CPP='darwin'
-       soext='.dylib'
+        soext='.dylib'
+        # By default, gcc makes 32bit executables on OS X
+        CFLAGS="$CFLAGS -m64"
+        LDFLAGS="$LDFLAGS -m64"
         ;;
 m68k-*-linux*)
         HostPlatform=m68k-unknown-linux # hack again
@@ -685,15 +688,8 @@ AC_ARG_ENABLE(bootstrap-with-devel-snapshot,
 if test "$WithGhc" != ""; then
   FPTOOLS_GHC_VERSION([GhcVersion], [GhcMajVersion], [GhcMinVersion], [GhcPatchLevel])dnl
 
-  if test `expr $GhcMinVersion % 2` = "1"; then
-     echo $EnableBootstrapWithDevelSnaphost
-     if test "$EnableBootstrapWithDevelSnaphost" = "NO"; then
-        AC_MSG_ERROR([
-     $WithGhc is a development snapshot of GHC, version $GhcVersion.
-     Bootstrapping using this version of GHC is not supported, and may not
-     work.  Use --enable-bootstrap-with-devel-snapshot to try it anyway,
-     or --with-ghc to specify a different GHC to use.])
-     fi
+  if test "$GhcMajVersion" = "unknown" -o "$GhcMinVersion" = "unknown"; then
+     AC_MSG_ERROR([Cannot determine the version of $WithGhc.  Is it really GHC?])
   fi
 
   AC_SUBST(GhcVersion)dnl
@@ -825,6 +821,17 @@ if test "$BootingFromHc" = "NO" -a -d "$srcdir/compiler"; then
   fi
   FP_COMPARE_VERSIONS([$GhcVersion],[-lt],[6.6],
     [AC_MSG_ERROR([GHC version 6.6 or later is required to compile GHC.])])dnl
+
+  if test `expr $GhcMinVersion % 2` = "1"; then
+     echo $EnableBootstrapWithDevelSnaphost
+     if test "$EnableBootstrapWithDevelSnaphost" = "NO"; then
+        AC_MSG_ERROR([
+     $WithGhc is a development snapshot of GHC, version $GhcVersion.
+     Bootstrapping using this version of GHC is not supported, and may not
+     work.  Use --enable-bootstrap-with-devel-snapshot to try it anyway,
+     or --with-ghc to specify a different GHC to use.])
+     fi
+  fi
 fi;
 
 # This uses GHC, so put it after the "GHC is required" check above:
@@ -944,7 +951,11 @@ AC_PROG_CPP
 dnl ** Without optimization some INLINE trickery fails for GHCi
 SRC_CC_OPTS="-O"
 
+SRC_CC_OPTS="$SRC_CC_OPTS $CFLAGS"
+SRC_LD_OPTS="$SRC_LD_OPTS $LDFLAGS"
+
 AC_SUBST(SRC_CC_OPTS)
+AC_SUBST(SRC_LD_OPTS)
 
 dnl ** figure out how to do context diffs
 FP_PROG_CONTEXT_DIFF
@@ -1000,7 +1011,10 @@ fi
 dnl ** check for DocBook toolchain
 FP_CHECK_DOCBOOK_DTD
 FP_DIR_DOCBOOK_XSL([/usr/share/xml/docbook/stylesheet/nwalsh/current /usr/share/xml/docbook/stylesheet/nwalsh /usr/share/xml/docbook/xsl-stylesheets* /usr/share/sgml/docbook/docbook-xsl-stylesheets* /usr/share/sgml/docbook/xsl-stylesheets* /opt/kde?/share/apps/ksgmltools2/docbook/xsl /usr/share/docbook-xsl /usr/share/sgml/docbkxsl /usr/local/share/xsl/docbook /sw/share/xml/xsl/docbook-xsl /opt/local/share/xsl/docbook-xsl])
-FP_PROG_FO_PROCESSOR
+
+FP_PROG_DBLATEX
+
+FP_PROG_HSTAGS
 
 dnl ** check for ghc-pkg command
 FP_PROG_GHC_PKG
@@ -1297,6 +1311,26 @@ else
 fi
 AC_SUBST(HavePapi)
 
+if test "$DIR_DOCBOOK_XSL" = "" ||
+   test "$XsltprocCmd" = ""
+then
+    BUILD_DOCBOOK_HTML=NO
+else
+    BUILD_DOCBOOK_HTML=YES
+fi
+AC_SUBST(BUILD_DOCBOOK_HTML)
+
+if test "$DblatexCmd" = ""
+then
+    BUILD_DOCBOOK_PS=NO
+    BUILD_DOCBOOK_PDF=NO
+else
+    BUILD_DOCBOOK_PS=YES
+    BUILD_DOCBOOK_PDF=YES
+fi
+AC_SUBST(BUILD_DOCBOOK_PS)
+AC_SUBST(BUILD_DOCBOOK_PDF)
+
 AC_CONFIG_FILES([mk/config.mk mk/project.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
@@ -1362,17 +1396,11 @@ echo ["\
 "]
 fi
 
-if test "$DIR_DOCBOOK_XSL" = ""; then
-echo ["\
-   Building DocBook documentation : no"]
-else
-echo ["\
-   Building DocBook documentation : yes"]
-fi
+echo "Building DocBook HTML documentation: $BUILD_DOCBOOK_HTML"
+echo "Building DocBook PS documentation:   $BUILD_DOCBOOK_PS"
+echo "Building DocBook PDF documentation:  $BUILD_DOCBOOK_PDF"
 
-
-echo ["\
-   Building shared libraries      : $BuildSharedLibs"]
+echo ["Building shared libraries      : $BuildSharedLibs"]
 
 echo ["----------------------------------------------------------------------
 "]