aboutsummaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorXavier Leroy <xavierleroy@users.noreply.github.com>2020-07-07 14:07:37 +0200
committerGitHub <noreply@github.com>2020-07-07 14:07:37 +0200
commit3b1f3dd57d8c10c1c29f67f0f745e3263d9d3daf (patch)
treedcd09ff56e6487937b1efc7f559d014d941516a8 /configure
parentbb9fa5550d6145344c4ed296ed980cb419e4cb27 (diff)
downloadcompcert-kvx-3b1f3dd57d8c10c1c29f67f0f745e3263d9d3daf.tar.gz
compcert-kvx-3b1f3dd57d8c10c1c29f67f0f745e3263d9d3daf.zip
Revised detection of menhirLib directory (#248)
Use `ocamlfind query menhirLib` in preference to `menhir --suggest-menhirLib`. Fixes: #363
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure8
1 files changed, 6 insertions, 2 deletions
diff --git a/configure b/configure
index b358f3cb..432bacff 100755
--- a/configure
+++ b/configure
@@ -582,8 +582,12 @@ case "$menhir_ver" in
20[0-9][0-9][0-9][0-9][0-9][0-9])
if test "$menhir_ver" -ge $MENHIR_REQUIRED; then
echo "version $menhir_ver -- good!"
- menhir_dir=$(menhir --suggest-menhirLib | tr -d '\r' | tr '\\' '/')
- if test -z "$menhir_dir"; then
+ menhir_dir=$(ocamlfind query menhirLib 2>/dev/null \
+ | tr -d '\r' | tr '\\' '/') || \
+ menhir_dir=$(menhir --suggest-menhirLib \
+ | tr -d '\r' | tr '\\' '/') || \
+ menhir_dir=""
+ if test ! -d "$menhir_dir"; then
echo "Error: cannot determine the location of the Menhir API library."
echo "This can be due to an incorrect Menhir package."
echo "Consider using the OPAM package for Menhir."