Commit 8b7e4e09 authored by Simon Marlow's avatar Simon Marlow

cache the values of ghc_ge_XXX at configure-time

This avoids recomputing them via $(shell) each time make expands one
of these variables, which is very expensive (0.3s or so) on Windows.
parent f50b7874
......@@ -715,6 +715,16 @@ if test "$WithGhc" != ""; then
AC_SUBST(GhcMajVersion)dnl
AC_SUBST(GhcMinVersion)dnl
AC_SUBST(GhcPatchLevel)dnl
ghc_ge_504=`if test $(GhcCanonVersion) -ge 504; then echo YES; else echo NO; fi`
AC_SUBST(ghc_ge_504)dnl
ghc_ge_601=`if test $(GhcCanonVersion) -ge 601; then echo YES; else echo NO; fi`
AC_SUBST(ghc_ge_601)dnl
ghc_ge_602=`if test $(GhcCanonVersion) -ge 602; then echo YES; else echo NO; fi`
AC_SUBST(ghc_ge_602)dnl
ghc_ge_603=`if test $(GhcCanonVersion) -ge 603; then echo YES; else echo NO; fi`
AC_SUBST(ghc_ge_603)dnl
ghc_ge_605=`if test $(GhcCanonVersion) -ge 605; then echo YES; else echo NO; fi`
AC_SUBST(ghc_ge_605)dnl
fi
# Check whether this GHC has readline installed
......
......@@ -833,11 +833,11 @@ GhcMajVersion = @GhcMajVersion@
GhcMinVersion = @GhcMinVersion@
# Some useful GHC version predicates:
ghc_ge_504 = $(shell if (test $(GhcCanonVersion) -ge 504); then echo YES; else echo NO; fi)
ghc_ge_601 = $(shell if (test $(GhcCanonVersion) -ge 601); then echo YES; else echo NO; fi)
ghc_ge_602 = $(shell if (test $(GhcCanonVersion) -ge 602); then echo YES; else echo NO; fi)
ghc_ge_603 = $(shell if (test $(GhcCanonVersion) -ge 603); then echo YES; else echo NO; fi)
ghc_ge_605 = $(shell if (test $(GhcCanonVersion) -ge 605); then echo YES; else echo NO; fi)
ghc_ge_504 = @ghc_ge_504@
ghc_ge_601 = @ghc_ge_601@
ghc_ge_602 = @ghc_ge_602@
ghc_ge_603 = @ghc_ge_603@
ghc_ge_605 = @ghc_ge_605@
endif
# Canonicalised ghc version number, used for easy (integer) version
......
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