[Git][ghc/ghc][master] Change Alex and Happy m4 scripts to display which version was found in the...
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: d59ef6b6 by Hai / @BestYeen at 2025-10-14T21:51:14-04:00 Change Alex and Happy m4 scripts to display which version was found in the system, adapt small formatting details in Happy script to be more like the Alex script again. - - - - - 2 changed files: - m4/fptools_alex.m4 - m4/fptools_happy.m4 Changes: ===================================== m4/fptools_alex.m4 ===================================== @@ -23,10 +23,16 @@ changequote([, ])dnl ]) if test ! -f compiler/GHC/Parser/Lexer.hs || test ! -f compiler/GHC/Cmm/Lexer.hs then + if test x"$fptools_cv_alex_version" != x; then + fptools_cv_alex_version_display="version $fptools_cv_alex_version"; + else + fptools_cv_alex_version_display="none"; + fi; + failure_msg="Alex version >= 3.2.6 && < 4 is required to compile GHC. (Found: $fptools_cv_alex_version_display)" FP_COMPARE_VERSIONS([$fptools_cv_alex_version],[-lt],[3.2.6], - [AC_MSG_ERROR([Alex >= 3.2.6 && < 4 is required to compile GHC.])])[] + [AC_MSG_ERROR([$failure_msg])])[] FP_COMPARE_VERSIONS([$fptools_cv_alex_version],[-ge],[4.0.0], - [AC_MSG_ERROR([Alex >= 3.2.6 && < 4 is required to compile GHC.])])[] + [AC_MSG_ERROR([$failure_msg])])[] fi AlexVersion=$fptools_cv_alex_version; AC_SUBST(AlexVersion) ===================================== m4/fptools_happy.m4 ===================================== @@ -13,8 +13,7 @@ AC_DEFUN([FPTOOLS_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 @@ -24,7 +23,12 @@ changequote([, ])dnl ]) if test ! -f compiler/GHC/Parser.hs || test ! -f compiler/GHC/Cmm/Parser.hs then - failure_msg="Happy version == 1.20.* || >= 2.0.2 && < 2.2 is required to compile GHC" + if test x"$fptools_cv_happy_version" != x; then + fptools_cv_happy_version_display="version $fptools_cv_happy_version"; + else + fptools_cv_happy_version_display="none"; + fi; + failure_msg="Happy version == 1.20.* || >= 2.0.2 && < 2.2 is required to compile GHC. (Found: $fptools_cv_happy_version_display)" FP_COMPARE_VERSIONS([$fptools_cv_happy_version],[-lt],[1.20.0], [AC_MSG_ERROR([$failure_msg])])[] FP_COMPARE_VERSIONS([$fptools_cv_happy_version],[-ge],[1.21.0], @@ -32,7 +36,6 @@ then [AC_MSG_ERROR([$failure_msg])])[])[] FP_COMPARE_VERSIONS([$fptools_cv_happy_version],[-ge],[2.2.0], [AC_MSG_ERROR([$failure_msg])])[] - fi HappyVersion=$fptools_cv_happy_version; AC_SUBST(HappyVersion) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d59ef6b66e36e6b3ef7783c7ea8971ee... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d59ef6b66e36e6b3ef7783c7ea8971ee... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Marge Bot (@marge-bot)