[commit: ghc] wip/T15916: configure: introduce HAPPY and ALEX vars and deprecate --with-ghc in favour of the GHC var (7fcc07c)

git at git.haskell.org git at git.haskell.org
Sat Jan 5 08:46:50 UTC 2019


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/T15916
Link       : http://ghc.haskell.org/trac/ghc/changeset/7fcc07c89fcc7f17c4a54e23bba884c8cc0982c3/ghc

>---------------------------------------------------------------

commit 7fcc07c89fcc7f17c4a54e23bba884c8cc0982c3
Author: Adam Sandberg Eriksson <adam at sandbergericsson.se>
Date:   Mon Dec 31 00:42:35 2018 +0100

    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.


>---------------------------------------------------------------

7fcc07c89fcc7f17c4a54e23bba884c8cc0982c3
 .gitlab-ci.yml                   |  4 ++--
 aclocal.m4                       | 26 +++++++++++++++++---------
 configure.ac                     | 16 +++++++++-------
 docs/users_guide/8.8.1-notes.rst |  3 +++
 4 files changed, 31 insertions(+), 18 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 87a5333..05d32ad 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -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'
diff --git a/aclocal.m4 b/aclocal.m4
index 03f43d1..a7026e2 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -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
diff --git a/configure.ac b/configure.ac
index 874a128..b75220d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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 --------------------------------------------------
diff --git a/docs/users_guide/8.8.1-notes.rst b/docs/users_guide/8.8.1-notes.rst
index 6e52a63..69d5397 100644
--- a/docs/users_guide/8.8.1-notes.rst
+++ b/docs/users_guide/8.8.1-notes.rst
@@ -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
 ------------------



More information about the ghc-commits mailing list