AC_SUBST([CONFIGURE_ARGS], [$ac_configure_args])
+dnl ----------------------------------------------------------
+dnl ** Find unixy sort and find commands,
+dnl ** which are needed by FP_SETUP_PROJECT_VERSION
+
+dnl ** Find find command (for Win32's benefit)
+FP_PROG_FIND
+
+dnl ** Find sort command (for the benefit of Win32 environs)
+FP_PROG_SORT
+
+dnl ----------------------------------------------------------
FP_SETUP_PROJECT_VERSION
# Hmmm, we fix the RPM release number to 1 here... Is this convenient?
fi
AC_SUBST([WithGhc])
+dnl ** Without optimization some INLINE trickery fails for GHCi
+SRC_CC_OPTS="-O"
+
dnl--------------------------------------------------------------------
dnl * Choose host(/target/build) platform
dnl--------------------------------------------------------------------
then
if test "${WithGhc}" != ""
then
- build=`${WithGhc} +RTS --info | grep '^ ,("Target platform"' | sed -e 's/.*, "//' -e 's/")//'`
+ build=`${WithGhc} +RTS --info | grep '^ ,("Target platform"' | sed -e 's/.*, "//' -e 's/")//' | tr -d '\r'`
echo "Build platform inferred as: $build"
else
echo "Can't work out build platform"
then
if test "${WithGhc}" != ""
then
- host=`${WithGhc} +RTS --info | grep '^ ,("Target platform"' | sed -e 's/.*, "//' -e 's/")//'`
+ host=`${WithGhc} +RTS --info | grep '^ ,("Target platform"' | sed -e 's/.*, "//' -e 's/")//' | tr -d '\r'`
echo "Host platform inferred as: $host"
else
echo "Can't work out host platform"
then
if test "${WithGhc}" != ""
then
- target=`${WithGhc} +RTS --info | grep '^ ,("Target platform"' | sed -e 's/.*, "//' -e 's/")//'`
+ target=`${WithGhc} +RTS --info | grep '^ ,("Target platform"' | sed -e 's/.*, "//' -e 's/")//' | tr -d '\r'`
echo "Target platform inferred as: $target"
else
echo "Can't work out target platform"
;;
i386-apple-darwin|powerpc-apple-darwin)
soext='.dylib'
+ CFLAGS="$CFLAGS -m32"
+ LDFLAGS="$LDFLAGS -m32"
+ SRC_CC_OPTS="$SRC_CC_OPTS -m32"
+ SRC_LD_OPTS="$SRC_LD_OPTS -m32"
;;
x86_64-apple-darwin)
soext='.dylib'
CFLAGS="$CFLAGS -m64"
LDFLAGS="$LDFLAGS -m64"
+ SRC_CC_OPTS="$SRC_CC_OPTS -m64"
+ SRC_LD_OPTS="$SRC_LD_OPTS -m64"
;;
esac
linux|freebsd|netbsd|openbsd|osf1|osf3|hpux|linuxaout|kfreebsdgnu|freebsd2|solaris2|cygwin32|mingw32|darwin|gnu|nextstep2|nextstep3|sunos4|ultrix|irix|aix)
;;
*)
- echo "Unknown OS $1"
+ echo "Unknown OS '$1'"
exit 1
;;
esac
[FP_PROG_LD()]
)
-dnl ** Build shared and/or static libs?
-dnl --------------------------------------------------------------
-AC_ARG_ENABLE(shared,
-[AC_HELP_STRING([--enable-shared],
-[Build shared libraries, if available (EXPERIMENTAL, non-working). [default=no]])],
-[ if test x"$enableval" = x"yes"; then
- AC_MSG_WARN([--enable-shared is experimental and not fully supported at this time])
- BuildSharedLibs=YES
- else
- BuildSharedLibs=NO
- fi
-],
-[BuildSharedLibs=NO]
-)
-AC_SUBST(BuildSharedLibs)
-
-# ToDo later:
-# AC_ARG_ENABLE(static,
-# [AC_HELP_STRING([--enable-static],
-# [Build static libraries. [default=yes]])],
-# [ if test x"$enableval" = x"yes"; then
-# BuildStaticLibs=YES
-# else
-# BuildStaticLibs=NO
-# fi
-# ],
-# [BuildStaticLibs=YES]
-# )
-# AC_SUBST(BuildStaticLibs)
-
dnl ** Booting from .hc files?
dnl --------------------------------------------------------------
AC_ARG_ENABLE(hc-boot,
dnl ** figure out how to invoke cpp directly (gcc -E is no good)
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
-dnl ** Find find command (for Win32's benefit)
-FP_PROG_FIND
-
-dnl ** Find sort command (for the benefit of Win32 environs)
-FP_PROG_SORT
-
dnl Let's make sure install-sh is executable here. If we got it from
dnl a darcs repo, it might not be (see bug #978).
chmod +x install-sh
AC_SUBST(HavePapiLib)
AC_SUBST(HavePapiHeader)
+AC_CHECK_FUNCS(__mingw_vfprintf)
+
if test "$HavePapiLib" = "YES" -a "$HavePapiHeader" = "YES"; then
HavePapi=YES
else
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 distrib/ghc.iss])
+if grep ' ' compiler/ghc.cabal.in 2>&1 >/dev/null; then
+ AC_MSG_ERROR([compiler/ghc.cabal.in contains tab characters; please remove them])
+fi
+
+AC_CONFIG_FILES([mk/config.mk mk/install.mk mk/project.mk compiler/ghc.cabal ghc/ghc-bin.cabal ghc.spec extra-gcc-opts docs/users_guide/ug-book.xml distrib/ghc.iss])
AC_CONFIG_COMMANDS([mk/stamp-h],[echo timestamp > mk/stamp-h])
AC_OUTPUT
echo ["\
Building DocBook HTML documentation : $BUILD_DOCBOOK_HTML
Building DocBook PS documentation : $BUILD_DOCBOOK_PS
- Building DocBook PDF documentation : $BUILD_DOCBOOK_PDF
-
- Building shared libraries : $BuildSharedLibs"]
+ Building DocBook PDF documentation : $BUILD_DOCBOOK_PDF"]
echo ["----------------------------------------------------------------------
"]