aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorletouzey2007-09-15 10:35:59 +0000
committerletouzey2007-09-15 10:35:59 +0000
commitda3edaa7eab2bed17cdfb2c455f2e6b5b0318c4d (patch)
tree14b6ae25300dc08c9ca5ff86ad88a78910df7b92 /configure
parent4f39e160d05b0e5501a909b3041589303651670b (diff)
* Adding compability with ocaml 3.10 + camlp5 (rework of
the patch by S. Mimram) * for detecting architecture, also look for /bin/uname * restore the compatibility of kernel/byterun/coq_interp.c with ocaml 3.07 (caml_modify vs. modify). There is still an issue with this 3.07 and 64-bits architecture (see coqdev and a future bug report). git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@10122 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure42
1 files changed, 26 insertions, 16 deletions
diff --git a/configure b/configure
index 6d497e29ff..41f0571044 100755
--- a/configure
+++ b/configure
@@ -228,6 +228,8 @@ case $arch_spec in
# cygwin returns a name of the form /cygdrive/c/...
# that coqc does not understand; need to transform it
COQTOP=`echo $COQTOP | sed -e "s#.*cygdrive.\(.\)#\1:#"`
+ elif test -x /bin/uname ; then
+ ARCH=`/bin/uname -s`
elif test -x /usr/bin/uname ; then
ARCH=`/usr/bin/uname -s`
else
@@ -359,17 +361,28 @@ fi
CAMLLIB=`"$CAMLC" -where`
-# Camlp4 (greatly simplified since merged with ocaml)
+# Camlp4 / Camlp5 configuration
+# Very basic for the moment: if camlp5 exists, we use it...
+if [ -x "${CAMLLIB}/camlp5" ] ; then
+ CAMLP4=camlp5
+ camlp4oexec=`echo $camlp4oexec | sed -e 's/4/5/'`
+else
+ case $CAMLVERSION in
+ 3.10*)
+ echo "Objective Caml 3.10 found but no Camlp5 installed"
+ echo "Configuration script failed!"
+ exit 1;;
+ *)
+ CAMLP4=camlp4;;
+ esac
+fi
+CAMLP4LIB=+$CAMLP4
+FULLCAMLP4LIB=${CAMLLIB}/$CAMLP4
+# Assume that camlp(4|5) binaries are at the same place as ocaml ones
+# (this should become configurable some day)
CAMLP4BIN=${CAMLBIN}
-#case $OS in
-# Win32)
- CAMLP4LIB=+camlp4
-# ;;
-# *)
-# CAMLP4LIB=${CAMLLIB}/camlp4
-#esac
# OS dependent libraries
@@ -612,13 +625,14 @@ escape_var () {
EOF
}
-export COQTOP BINDIR LIBDIR CAMLBIN CAMLLIB
+export COQTOP BINDIR LIBDIR CAMLBIN CAMLLIB CAMLP4 CAMLP4LIB FULLCAMLP4LIB
ESCCOQTOP="`VAR=COQTOP escape_var`"
ESCBINDIR="`VAR=BINDIR escape_var`"
ESCLIBDIR="`VAR=LIBDIR escape_var`"
ESCCAMLDIR="`VAR=CAMLBIN escape_var`"
ESCCAMLLIB="`VAR=CAMLLIB escape_var`"
-ESCCAMLP4LIB="$ESCCAMLLIB"/camlp4
+ESCCAMLP4="`VAR=CAMLP4 escape_var`"
+ESCCAMLP4LIB="`VAR=FULLCAMLP4LIB escape_var`"
mlconfig_file="$COQSRC/config/coq_config.ml"
rm -f $mlconfig_file
@@ -631,6 +645,7 @@ let coqlib = "$ESCLIBDIR"
let coqtop = "$ESCCOQTOP"
let camldir = "$ESCCAMLDIR"
let camllib = "$ESCCAMLLIB"
+let camlp4 = "$ESCCAMLP4"
let camlp4lib = "$ESCCAMLP4LIB"
let best = "$best_compiler"
let arch = "$ARCH"
@@ -741,15 +756,10 @@ OCAMLDEBUGCOQ=$COQTOP/dev/ocamldebug-coq
if test "$coq_debug_flag" = "-g" ; then
rm -f $OCAMLDEBUGCOQ
- if [ "$CAMLP4LIB" = "+camlp4" ] ; then
- CAMLP4LIBFORCAMLDEBUG=$CAMLLIB/camlp4
- else
- CAMLP4LIBFORCAMLDEBUG=$CAMLP4LIB
- fi
sed -e "s|COQTOPDIRECTORY|$COQTOP|" \
-e "s|COQLIBDIRECTORY|$LIBDIR|" \
-e "s|CAMLBINDIRECTORY|$CAMLBIN|" \
- -e "s|CAMLP4LIBDIRECTORY|$CAMLP4LIBFORCAMLDEBUG|" \
+ -e "s|CAMLP4LIBDIRECTORY|$FULLCAMLP4LIB|"\
$OCAMLDEBUGCOQ.template > $OCAMLDEBUGCOQ
chmod a-w,a+x $OCAMLDEBUGCOQ
fi