Skip to content

Commit

Permalink
configure: simplify check for GHC (#475)
Browse files Browse the repository at this point in the history
This tool lookup and included AM_CONDITIIONAL was originally added in
commit 73b5e40, using the same logic
introduced in this commit. It was originally changed in commit
95558c6 to avoid checking whether GHC
was found, and instead check whether ghc-pkg claimed mmap was found.

A long time later, the use of ghc-pkg was removed in commit
e7a3741, and the check was restored to
"check if GHC exists", which however did not restore the *mechanism*
for checking.

Instead, it attempted to run GHC, whether it existed or not. Checking if
it was found should be enough. But checking that it runs --version is
not particularly useful:
- a command not found / permission denied error is produced if GHC was
  not found, due to trying to execute "" as a command:

  ./configure: 7028: : Permission denied

- if it was found, the version output would be interspersed into
  ./configure output

Similarly a couple lines below, pandoc is checked for and only its
presence is cared about.
  • Loading branch information
eli-schwartz authored Mar 19, 2024
1 parent 2b42191 commit 6548e04
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_RANLIB
AC_CHECK_TOOL(GHC, ghc)
AM_CONDITIONAL([HAVE_GHC], ["$GHC" --version])
AM_CONDITIONAL([HAVE_GHC], [test "$GHC"])
AC_CHECK_PROG(PANDOC, pandoc, yes)
AM_CONDITIONAL([HAVE_PANDOC], [test x"$PANDOC" = x"yes"])
AM_PROG_AR
Expand Down

0 comments on commit 6548e04

Please sign in to comment.