aboutsummaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure40
1 files changed, 39 insertions, 1 deletions
diff --git a/configure b/configure
index 7ce5a1f2..0ab60adc 100755
--- a/configure
+++ b/configure
@@ -21,6 +21,7 @@ has_runtime_lib=true
has_standard_headers=true
clightgen=false
responsefile="gnu"
+merlin=false
usage='Usage: ./configure [options] target
@@ -69,6 +70,7 @@ Options:
-no-runtime-lib Do not compile nor install the runtime support library
-no-standard-headers Do not install nor use the standard .h headers
-clightgen Also compile the clightgen tool
+ -merlin Generate .merlin file
'
@@ -93,6 +95,8 @@ while : ; do
has_standard_headers=false;;
-clightgen)
clightgen=true;;
+ -merlin)
+ merlin=true;;
*)
if test -n "$target"; then echo "$usage" 1>&2; exit 2; fi
target="$1";;
@@ -449,8 +453,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."
@@ -484,6 +489,32 @@ if $missingtools; then
exit 2
fi
+if $merlin; then
+ cat > .merlin <<EOF
+S lib
+S common
+S $arch
+S backend
+S cfrontend
+S driver
+S debug
+S exportclight
+S cparser
+S extraction
+
+B lib
+B common
+B $arch
+B backend
+B cfrontend
+B driver
+B debug
+B exportclight
+B cparser
+B extraction
+
+EOF
+fi
#
# Generate Makefile.config
@@ -495,9 +526,16 @@ cat > Makefile.config <<EOF
PREFIX=$prefix
BINDIR=$bindir
LIBDIR=$libdir
+MANDIR=$sharedir/man
SHAREDIR=$sharedir
OCAML_OPT_COMP=$ocaml_opt_comp
+MENHIR_INCLUDES=$menhir_includes
EOF
+if $merlin; then
+ cat >> Makefile.config <<EOF
+COMPFLAGS=-bin-annot
+EOF
+fi
if test "$target" != "manual"; then
cat >> Makefile.config <<EOF