GHC new build system megapatch
[ghc-hetmet.git] / distrib / configure-bin.ac
index a852ec9..62562b8 100644 (file)
@@ -5,7 +5,7 @@ dnl
 #
 
 # Is it there?
-AC_INIT(Makefile.in)
+AC_INIT(mk/config.mk.in)
 
 exeext=''
 
@@ -53,11 +53,6 @@ i[[3456]]86-*-cygwin*)
        TargetPlatform=i386-unknown-cygwin32;;
 i[[3456]]86-*-mingw32*)
        exeext='.exe'
-       # We assume you're using mingw32 via the gcc that comes
-       # with cygwin, and not the native port, so let's augment
-       # the gcc command-line used here with -mno-cygwin -mwin32
-       # to arrange for good things to happen.
-       CFLAGS="-mno-cygwin -mwin32 $CFLAGS"
        TargetPlatform=i386-unknown-mingw32
        ;;
 i[[3456]]86-apple-darwin*)
@@ -96,6 +91,8 @@ x86_64-*-openbsd*)
        TargetPlatform=x86_64-unknown-openbsd;;
 x86_64-*-netbsd*)
        TargetPlatform=x86_64-unknown-netbsd;;
+x86_64-apple-darwin*)
+       TargetPlatform=x86_64-apple-darwin;;
 *)
         echo "Unrecognised platform: $TargetPlatform"
         exit 1
@@ -106,6 +103,8 @@ echo "Which we'll further canonicalise into: $TargetPlatform"
 AC_SUBST(TargetPlatform)
 AC_SUBST(exeext)
 
+FP_FIND_ROOT
+
 #
 dnl ** Check Perl installation **
 #
@@ -128,6 +127,11 @@ dnl ** how to do symlinks **
 AC_PROG_LN_S()
 
 #
+dnl ** how to invoke `ar' and `ranlib'
+#
+FP_PROG_AR_NEEDS_RANLIB
+
+#
 dnl ** Find the path to sed **
 #
 AC_PATH_PROG(SedCmd,sed)
@@ -139,10 +143,15 @@ FP_HAVE_GCC
 AC_PROG_CPP
 
 #
-AC_OUTPUT(Makefile)
+dnl ** Check gcc version and flags we need to pass it **
+#
+FP_GCC_EXTRA_FLAGS
+
+#
+AC_CONFIG_FILES(extra-gcc-opts mk/config.mk)
+AC_OUTPUT
 
 echo "****************************************************"
-echo "Configuration done, ready to either 'make install'"
-echo "or 'make in-place'."
+echo "Configuration done, ready to 'make install'"
 echo "(see README and INSTALL files for more info.)"
 echo "****************************************************"