diff options
author | Ian Lynagh <igloo@earth.li> | 2011-06-22 20:40:47 +0100 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2011-06-22 21:03:39 +0100 |
commit | 81c6dc7684178f9feb8884fe3049f42f43245786 (patch) | |
tree | 628fdd40b589dccaf63206dd3333f60c904172d6 /aclocal.m4 | |
parent | 6ecb8d38b38e134760cf6fd88b078b224b2d8424 (diff) | |
download | haskell-81c6dc7684178f9feb8884fe3049f42f43245786.tar.gz |
Share more code between configure.ac and distrib/configure.ac.in
Diffstat (limited to 'aclocal.m4')
-rw-r--r-- | aclocal.m4 | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/aclocal.m4 b/aclocal.m4 index 34265564d8..4a2a354a18 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -78,6 +78,58 @@ AC_DEFUN([FPTOOLS_SET_PLATFORM_VARS], 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/touch.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) ]) |