Commit 7fcc07c8 authored by Adam Sandberg Eriksson's avatar Adam Sandberg Eriksson 🐈 Committed by Ben Gamari

configure: introduce HAPPY and ALEX vars and deprecate --with-ghc in favour of the GHC var

Also updates the windows gitlab ci to use the new configure variables.
parent 374e4470
......@@ -337,7 +337,7 @@ validate-x86_64-windows-hadrian:
- |
set MSYSTEM=MINGW64
python boot
bash -c './configure --with-ghc=`pwd`/toolchain/bin/ghc --enable-tarballs-autodownload HappyCmd=`pwd`/toolchain/bin/happy AlexCmd=`pwd`/toolchain/bin/alex'
bash -c './configure --enable-tarballs-autodownload GHC=`pwd`/toolchain/bin/ghc HAPPY=`pwd`/toolchain/bin/happy ALEX=`pwd`/toolchain/bin/alex'
mkdir -p _build
cp -R inplace/mingw _build/mingw
# FIXME: --no-lint due to #15950
......@@ -361,7 +361,7 @@ validate-x86_64-windows:
- |
set MSYSTEM=MINGW64
python boot
bash -c './configure --with-ghc=`pwd`/toolchain/bin/ghc --enable-tarballs-autodownload HappyCmd=`pwd`/toolchain/bin/happy AlexCmd=`pwd`/toolchain/bin/alex'
bash -c './configure --enable-tarballs-autodownload GHC=`pwd`/toolchain/bin/ghc HAPPY=`pwd`/toolchain/bin/happy ALEX=`pwd`/toolchain/bin/alex'
- bash -c "echo include mk/flavours/quick.mk > mk/build.mk"
- bash -c "PATH=`pwd`/toolchain/bin:$PATH make -j`mk/detect-cpu-count.sh`"
- bash -c 'make V=0 test THREADS=`mk/detect-cpu-count.sh` JUNIT_FILE=../../junit.xml'
......
......@@ -902,18 +902,22 @@ AS_IF([test "$fp_num1" $2 "$fp_num2"], [$4], [$5])[]dnl
dnl
dnl Check for Happy and version.
dnl If there's no installed Happy, we look
dnl for a happy source tree and point the build system at that instead.
dnl Check for Happy and version:
dnl
dnl 1. Use happy specified in env var HAPPY
dnl 2. Find happy in path
dnl 3. Check happy version
dnl
dnl If you increase the minimum version requirement, please also update:
dnl https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Tools
dnl
AC_DEFUN([FPTOOLS_HAPPY],
[AC_PATH_PROG(HappyCmd,happy,)
[AC_PATH_PROG(HAPPY,[happy],)
AC_SUBST(HappyCmd,$HAPPY)
AC_CACHE_CHECK([for version of happy], fptools_cv_happy_version,
changequote(, )dnl
[if test x"$HappyCmd" != x; then
[
if test x"$HappyCmd" != x; then
fptools_cv_happy_version=`"$HappyCmd" -v |
grep 'Happy Version' | sed -e 's/Happy Version \([^ ]*\).*/\1/g'` ;
else
......@@ -932,13 +936,17 @@ AC_SUBST(HappyVersion)
dnl
dnl Check for Alex and version.
dnl
dnl 1. Use alex specified in env var ALEX
dnl 2. Find alex in path
dnl 3. Check alex version
dnl
dnl If you increase the minimum version requirement, please also update:
dnl https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Tools
dnl
AC_DEFUN([FPTOOLS_ALEX],
[
AC_PATH_PROG(AlexCmd,alex,)
[AC_PATH_PROG(ALEX,[alex],)
AC_SUBST(AlexCmd,$ALEX)
AC_CACHE_CHECK([for version of alex], fptools_cv_alex_version,
changequote(, )dnl
[if test x"$AlexCmd" != x; then
......
......@@ -87,14 +87,12 @@ dnl use either is considered a Feature.
dnl ** What command to use to compile compiler sources ?
dnl --------------------------------------------------------------
AC_ARG_VAR(GHC,[Use as the path to GHC [default=autodetect]])
AC_PATH_PROG([GHC], [ghc])
AC_ARG_WITH([ghc],
[AC_HELP_STRING([--with-ghc=ARG],
[Use ARG as the path to GHC [default=autodetect]])],
[WithGhc="$withval"],
[if test "$GHC" = ""; then
AC_PATH_PROG([GHC], [ghc])
fi
WithGhc="$GHC"])
AS_HELP_STRING([--with-ghc=ARG], [Use ARG as the path to ghc (obsolete, use GHC=ARG instead) [default=autodetect]]),
AC_MSG_ERROR([--with-ghc=$withval is obsolete (use './configure GHC=$withval' or 'GHC=$withval ./configure' instead)]))
AC_SUBST(WithGhc,$GHC)
dnl ** Tell the make system which OS we are using
dnl $OSTYPE is set by the operating system to "msys" or "cygwin" or something
......@@ -867,9 +865,13 @@ dnl ** check for ghc-pkg command
FP_PROG_GHC_PKG
dnl ** check for installed happy binary + version
AC_ARG_VAR(HAPPY,[Use as the path to happy [default=autodetect]])
FPTOOLS_HAPPY
dnl ** check for installed alex binary + version
AC_ARG_VAR(ALEX,[Use as the path to alex [default=autodetect]])
FPTOOLS_ALEX
dnl --------------------------------------------------
......
......@@ -160,6 +160,9 @@ Template Haskell
Build system
~~~~~~~~~~~~
- Configure: Add ALEX and HAPPY variables to explicitly set the alex and happy
programs to use.
- Configure: Deprecate --with-ghc=ARG in favour of the GHC variable.
Included libraries
------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment