GHC_CONVERT_VENDOR([$target_vendor], [TargetVendor])
GHC_CONVERT_OS([$target_os], [TargetOS])
fi
+
+ windows=NO
+ exeext=''
+ soext='.so'
+ case $host in
+ *-unknown-cygwin32)
+ AC_MSG_WARN([GHC does not support the Cygwin target at the moment])
+ AC_MSG_WARN([I'm assuming you wanted to build for i386-unknown-mingw32])
+ exit 1
+ ;;
+ *-unknown-mingw32)
+ windows=YES
+ exeext='.exe'
+ soext='.dll'
+ ;;
+ i386-apple-darwin|powerpc-apple-darwin)
+ soext='.dylib'
+ ;;
+ x86_64-apple-darwin)
+ soext='.dylib'
+ ;;
+ esac
+])
+
+
+# FP_SETTINGS
+# ----------------------------------
+# Set the variables used in the settings file
+AC_DEFUN([FP_SETTINGS],
+[
+ if test "$windows" = YES
+ then
+ SettingsCCompilerCommand='$topdir/../mingw/bin/gcc.exe'
+ SettingsCCompilerFlags=''
+ SettingsPerlCommand='$topdir/../perl/perl.exe'
+ SettingsDllWrapCommand='$topdir/../mingw/bin/dllwrap.exe'
+ SettingsWindresCommand='$topdir/../mingw/bin/windres.exe'
+ SettingsTouchCommand='$topdir/touchy.exe'
+ else
+ SettingsCCompilerCommand="$WhatGccIsCalled"
+ SettingsCCompilerFlags="$CONF_CC_OPTS_STAGE2"
+ SettingsPerlCommand="$PerlCmd"
+ SettingsDllWrapCommand="/bin/false"
+ SettingsWindresCommand="/bin/false"
+ SettingsTouchCommand='touch'
+ fi
+ AC_SUBST(SettingsCCompilerCommand)
+ AC_SUBST(SettingsCCompilerFlags)
+ AC_SUBST(SettingsPerlCommand)
+ AC_SUBST(SettingsDllWrapCommand)
+ AC_SUBST(SettingsWindresCommand)
+ AC_SUBST(SettingsTouchCommand)
])
then
FP_COMPARE_VERSIONS([$fptools_cv_alex_version],[-lt],[2.1.0],
[AC_MSG_ERROR([Alex version 2.1.0 or later is required to compile GHC.])])[]
+ FP_COMPARE_VERSIONS([$fptools_cv_alex_version],[-ge],[3.0],
+ [Alex3=YES],[Alex3=NO])
fi
AlexVersion=$fptools_cv_alex_version;
AC_SUBST(AlexVersion)
+AC_SUBST(Alex3)
])
then
AC_MSG_ERROR([gcc is required])
fi
-GccLT34=
+GccLT34=NO
+GccLT46=NO
AC_CACHE_CHECK([version of gcc], [fp_cv_gcc_version],
[
fp_cv_gcc_version="`$CC -v 2>&1 | grep 'version ' | sed -e 's/.*version [[^0-9]]*\([[0-9.]]*\).*/\1/g'`"
# isn't a very good reason for that, but for now just make configure
# fail.
FP_COMPARE_VERSIONS([$fp_cv_gcc_version], [-lt], [3.4], GccLT34=YES)
+ FP_COMPARE_VERSIONS([$fp_cv_gcc_version], [-lt], [4.6], GccLT46=YES)
])
AC_SUBST([GccVersion], [$fp_cv_gcc_version])
AC_SUBST(GccLT34)
+AC_SUBST(GccLT46)
])# FP_GCC_VERSION
dnl Small feature test for perl version. Assumes PerlCmd
])
AC_DEFUN([FP_BINDIST_GHC_PWD],[
- GHC_PWD=utils/ghc-pwd/dist/build/tmp/ghc-pwd
+ GHC_PWD=utils/ghc-pwd/dist-install/build/tmp/ghc-pwd
])
AC_DEFUN([FP_FIND_ROOT],[
pc|gentoo) # like i686-pc-linux-gnu and i686-gentoo-freebsd8
$2="unknown"
;;
+ softfloat) # like armv5tel-softfloat-linux-gnueabi
+ $2="unknown"
+ ;;
*)
#pass thru by default
$2="$1"
AC_SUBST($1)
])
-# LIBRARY_VERSION(lib)
+# LIBRARY_VERSION(lib, [dir])
# --------------------------------
# Gets the version number of a library.
# If $1 is ghc-prim, then we define LIBRARY_ghc_prim_VERSION as 1.2.3
+# $2 points to the directory under libraries/
AC_DEFUN([LIBRARY_VERSION],[
-LIBRARY_[]translit([$1], [-], [_])[]_VERSION=`grep -i "^version:" libraries/$1/$1.cabal | sed "s/.* //"`
+dir=m4_default([$2],[$1])
+LIBRARY_[]translit([$1], [-], [_])[]_VERSION=`grep -i "^version:" libraries/${dir}/$1.cabal | sed "s/.* //"`
AC_SUBST(LIBRARY_[]translit([$1], [-], [_])[]_VERSION)
])
+# XCODE_VERSION()
+# --------------------------------
+# Gets the version number of XCode, if on a Mac
+AC_DEFUN([XCODE_VERSION],[
+ if test "$TargetOS_CPP" = "darwin"
+ then
+ AC_MSG_CHECKING(XCode version)
+ XCodeVersion=`xcodebuild -version | grep Xcode | sed "s/Xcode //"`
+ # Old XCode versions don't actually give the XCode version
+ if test "$XCodeVersion" = ""
+ then
+ AC_MSG_RESULT(not found (too old?))
+ XCodeVersion1=0
+ XCodeVersion2=0
+ else
+ AC_MSG_RESULT($XCodeVersion)
+ XCodeVersion1=`echo "$XCodeVersion" | sed 's/\..*//'`
+ changequote(, )dnl
+ XCodeVersion2=`echo "$XCodeVersion" | sed 's/[^.]*\.\([^.]*\).*/\1/'`
+ changequote([, ])dnl
+ AC_MSG_NOTICE(XCode version component 1: $XCodeVersion1)
+ AC_MSG_NOTICE(XCode version component 2: $XCodeVersion2)
+ fi
+ fi
+])
+
+# FIND_GCC()
+# --------------------------------
+# Finds where gcc is
+AC_DEFUN([FIND_GCC],[
+ if test "$TargetOS_CPP" = "darwin" &&
+ test "$XCodeVersion1" -ge 4
+ then
+ # From Xcode 4, use 'gcc-4.2' to force the use of the gcc legacy
+ # backend (instead of the LLVM backend)
+ FP_ARG_WITH_PATH_GNU_PROG([CC], [gcc-4.2])
+ else
+ FP_ARG_WITH_PATH_GNU_PROG([CC], [gcc])
+ fi
+ export CC
+ WhatGccIsCalled="$CC"
+ AC_SUBST(WhatGccIsCalled)
+])
+
# LocalWords: fi