summaryrefslogtreecommitdiff
path: root/aclocal.m4
diff options
context:
space:
mode:
authorTamar Christina <tamar@zhox.com>2017-06-11 11:40:11 +0100
committerTamar Christina <tamar@zhox.com>2017-06-17 00:49:16 +0100
commitfda094d000cf2c2874a8205c8212cb83b52259ef (patch)
tree38f013140cfdf5b690cd383595534fedbc1117bb /aclocal.m4
parentdc8e6861dc5586a8222484afc3bd26c432e2d69c (diff)
downloadhaskell-fda094d000cf2c2874a8205c8212cb83b52259ef.tar.gz
Provide way to build using existing C compiler on Windows.
Summary: There are various distros that build GHC using their own C compilers such as MSYS2. Currently they have to patch the build scripts everytime. This patch provides the configure argument `--enable-distro-toolchain` which allows one to build using any C compiler on the path. This is also useful for testing new versions of GCC. Test Plan: ./configure --enable-distro-toolchain && make - && make THREADS=9 test ./validate Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, erikd, #ghc_windows_task_force GHC Trac Issues: #13792 Differential Revision: https://phabricator.haskell.org/D3637
Diffstat (limited to 'aclocal.m4')
-rw-r--r--aclocal.m422
1 files changed, 17 insertions, 5 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index d566f83e8c..db394f38d6 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -460,7 +460,7 @@ AC_DEFUN([GET_ARM_ISA],
# Set the variables used in the settings file
AC_DEFUN([FP_SETTINGS],
[
- if test "$windows" = YES
+ if test "$windows" = YES -a "$EnableDistroToolchain" = "NO"
then
mingw_bin_prefix=mingw/bin/
SettingsCCompilerCommand="\$topdir/../${mingw_bin_prefix}gcc.exe"
@@ -472,6 +472,18 @@ AC_DEFUN([FP_SETTINGS],
SettingsDllWrapCommand="\$topdir/../${mingw_bin_prefix}dllwrap.exe"
SettingsWindresCommand="\$topdir/../${mingw_bin_prefix}windres.exe"
SettingsTouchCommand='$topdir/bin/touchy.exe'
+ elif test "$EnableDistroToolchain" = "YES"
+ then
+ SettingsCCompilerCommand="$(basename $CC)"
+ SettingsCCompilerFlags="$CONF_CC_OPTS_STAGE2"
+ SettingsHaskellCPPCommand="$(basename $HaskellCPPCmd)"
+ SettingsHaskellCPPFlags="$HaskellCPPArgs"
+ SettingsLdCommand="$(basename $LdCmd)"
+ SettingsArCommand="$(basename $ArCmd)"
+ SettingsPerlCommand="$(basename $PerlCmd)"
+ SettingsDllWrapCommand="$(basename $DllWrapCmd)"
+ SettingsWindresCommand="$(basename $WindresCmd)"
+ SettingsTouchCommand='$topdir/bin/touchy.exe'
else
SettingsCCompilerCommand="$CC"
SettingsHaskellCPPCommand="$HaskellCPPCmd"
@@ -479,17 +491,17 @@ AC_DEFUN([FP_SETTINGS],
SettingsLdCommand="$LdCmd"
SettingsArCommand="$ArCmd"
SettingsPerlCommand="$PerlCmd"
- if test -z "$DllWrap"
+ if test -z "$DllWrapCmd"
then
SettingsDllWrapCommand="/bin/false"
else
- SettingsDllWrapCommand="$DllWrap"
+ SettingsDllWrapCommand="$DllWrapCmd"
fi
- if test -z "$Windres"
+ if test -z "$WindresCmd"
then
SettingsWindresCommand="/bin/false"
else
- SettingsWindresCommand="$Windres"
+ SettingsWindresCommand="$WindresCmd"
fi
SettingsTouchCommand='touch'
fi