aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.menhir37
-rwxr-xr-xconfigure4
2 files changed, 3 insertions, 38 deletions
diff --git a/Makefile.menhir b/Makefile.menhir
index b72c52f3..1530536f 100644
--- a/Makefile.menhir
+++ b/Makefile.menhir
@@ -47,40 +47,3 @@ endif
%.ml %.mli: %.mly
$(MENHIR) $(MENHIR_MODE) $(MENHIR_FLAGS) $<
-
-# Note 1: finding where MenhirLib has been installed would be easier if we
-# could depend on ocamlfind, but as far as I understand and as of today,
-# CompCert can be compiled and linked even in the absence of ocamlfind.
-# So, we should not require ocamlfind.
-
-# Note 2: Menhir has options --suggest-comp-flags and --suggest-link-flags
-# which we are supposed to help solve this difficulty. However, they don't
-# work for us out of the box, because if Menhir has been installed using
-# ocamlfind, then Menhir will suggest using ocamlfind (i.e. it will suggest
-# -package and -linkpkg options), which we don't want to do.
-
-# Solution: Ask Menhir first. If Menhir answers "-package menhirLib", then
-# Menhir was installed with ocamlfind, so we should not ask Menhir, but we
-# can instead ask ocamlfind where Menhir's library was installed. Otherwise,
-# Menhir answers directly with a "-I ..." directive, which we use.
-
-ifndef MENHIR_INCLUDES
-
-ifeq ($(MENHIR_TABLE),true)
-
- MENHIR_SUGGESTION = $(MENHIR) $(MENHIR_MODE) --suggest-comp-flags
-
- MENHIR_INCLUDES := $(shell \
- if $(MENHIR_SUGGESTION) | grep -e "-package" >/dev/null ; then \
- echo "-I `ocamlfind query menhirLib`" ; \
- else \
- $(MENHIR_SUGGESTION) ; \
- fi)
-
-else
-
- MENHIR_INCLUDES =
-
-endif
-
-endif
diff --git a/configure b/configure
index e4b5a169..134001cd 100755
--- a/configure
+++ b/configure
@@ -404,8 +404,9 @@ echo "Testing Menhir... " | tr -d '\n'
menhir_ver=`menhir --version 2>/dev/null | sed -n -e 's/^.*version \([0-9]*\).*$/\1/p'`
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
+ if test "$menhir_ver" -ge $MENHIR_REQUIRED; then
echo "version $menhir_ver -- good!"
+ menhir_includes="-I `menhir --suggest-menhirLib`"
else
echo "version $menhir_ver -- UNSUPPORTED"
echo "Error: CompCert requires Menhir version $MENHIR_REQUIRED or later."
@@ -478,6 +479,7 @@ BINDIR=$bindir
LIBDIR=$libdir
SHAREDIR=$sharedir
OCAML_OPT_COMP=$ocaml_opt_comp
+MENHIR_INCLUDES=$menhir_includes
EOF
if $merlin; then
cat >> Makefile.config <<EOF