aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorherbelin2007-10-07 00:18:05 +0000
committerherbelin2007-10-07 00:18:05 +0000
commit85f8d5fb8138cd54d2eb27b57ea21159379642ea (patch)
tree7af725fad80ced8f902599d8872c44a0fdce39de
parente38c7771d1098d43cacf388887493122d65fc89e (diff)
Ajout de la possibilité de donner le chemin de la bibliothèque camlp5
+ recherche par défaut de camlp5 et lablgtk aussi dans site-lib git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@10189 85f007b7-540e-0410-9357-904b9bb8a0f7
-rwxr-xr-xconfigure96
1 files changed, 62 insertions, 34 deletions
diff --git a/configure b/configure
index 474beb66af..f731d92455 100755
--- a/configure
+++ b/configure
@@ -42,9 +42,11 @@ usage () {
echo "-coqdocdir"
echo -e "\tSpecifies where Coqdoc style files are to be installed\n"
echo "-camldir"
- echo -e "\tTells configure where to look for OCaml files\n"
+ echo -e "\tSpecifies the path to the OCaml library\n"
echo "-lablgtkdir"
- echo -e "\tTells configure where to look for Lablgtk files\n"
+ echo -e "\tSpecifies the path to the Lablgtk library\n"
+ echo "-camlp5dir"
+ echo -e "\tSpecifies where to look for the Camlp5 library and tells to use it\n"
echo "-arch"
echo -e "\tSpecifies the architecture\n"
echo "-opt"
@@ -154,6 +156,9 @@ while : ; do
-lablgtkdir|--lablgtkdir) lablgtkdir_spec=yes
lablgtkdir="$2"
shift;;
+ -camlp5dir|--camlp5dir)
+ camlp5dir="$2"
+ shift;;
-arch|--arch) arch_spec=yes
arch=$2
shift;;
@@ -385,21 +390,32 @@ esac
# Camlp4 / Camlp5 configuration
# Very basic for the moment: if camlp5 exists, we use it...
-if [ -x "${CAMLLIB}/camlp5" ] ; then
- CAMLP4=camlp5
+if [ "$camlp5dir" != "" ]; then
+ CAMLP4=$camlp5dir
+ CAMLP4LIB=$camlp5dir
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
+elif [ "$CAMLTAG" = "OCAML310" ]; then
+ if [ -x "${CAMLLIB}/camlp5" ]; then
+ CAMLP4=camlp5
+ elif [ -x "${CAMLLIB}/site-lib/camlp5" ]; then
+ CAMLP4=site-lib/camlp5
+ else
+ echo "Objective Caml 3.10 found but no Camlp5 installed"
+ echo "Configuration script failed!"
+ exit 1
+ fi
+ CAMLP4LIB=+$CAMLP4
+ camlp4oexec=`echo $camlp4oexec | sed -e 's/4/5/'`
+else
+ CAMLP4=camlp4
+ CAMLP4LIB=+$CAMLP4
fi
-CAMLP4LIB=+$CAMLP4
-FULLCAMLP4LIB=${CAMLLIB}/$CAMLP4
+
+case $CAMLP4LIB in
+ +*) FULLCAMLP4LIB=$CAMLLIB/`echo $CAMLP4LIB | cut -b 2-`;;
+ *) FULLCAMLP4LIB=$CAMLP4LIB;;
+esac
+
# Assume that camlp(4|5) binaries are at the same place as ocaml ones
# (this should become configurable some day)
CAMLP4BIN=${CAMLBIN}
@@ -424,10 +440,6 @@ esac
# lablgtk2 and CoqIDE
-case $lablgtkdir_spec in
- no) lablgtkdir=${CAMLLIB}/lablgtk2
-esac
-
# -byte-only should imply -coqide byte, unless the user decides otherwise
if [ "$best_compiler" = "byte" -a "$coqide_spec" = "no" ]; then
@@ -439,21 +451,37 @@ fi
if [ "$coqide_spec" = "yes" -a "$COQIDE" = "no" ]; then
echo "CoqIde disabled as requested"
-elif [ ! -f "$lablgtkdir/glib.mli" ]; then
- echo "LablGtk2 not found: CoqIde will not be available"
- COQIDE=no
-elif [ -z "`grep -w convert_with_fallback "$lablgtkdir/glib.mli"`" ]; then
- echo "LablGtk2 found but too old: CoqIde will not be available"
- COQIDE=no;
-elif [ "$coqide_spec" = "yes" -a "$COQIDE" = "byte" ]; then
- echo "LablGtk2 found, bytecode CoqIde will be used as requested"
- COQIDE=byte
-elif [ ! -f "${CAMLLIB}/threads/threads.cmxa" ]; then
- echo "LablGtk2 found, no native threads: bytecode CoqIde will be available"
- COQIDE=byte
-else
- echo "LablGtk2 found, native threads: native CoqIde will be available"
- COQIDE=opt
+else
+ case $lablgtkdir_spec in
+ no)
+ if [ -f "${CAMLLIB}/lablgtk2/glib.mli" ]; then
+ lablgtkdir=${CAMLLIB}/lablgtk2
+ elif [ -f "${CAMLLIB}/site-lib/lablgtk2/glib.mli" ]; then
+ lablgtkdir=${CAMLLIB}/site-lib/lablgtk2
+ else
+ echo "LablGtk2 not found: CoqIde will not be available"
+ COQIDE=no
+ fi;;
+ yes)
+ if [ ! -f "$lablgtkdir/glib.mli" ]; then
+ echo "Incorrect LablGtk2 library (glib.mli not found)"
+ echo "Configuration script failed!"
+ exit 1
+ fi;;
+ esac
+ if [ -z "`grep -w convert_with_fallback "$lablgtkdir/glib.mli"`" ]; then
+ echo "LablGtk2 found but too old: CoqIde will not be available"
+ COQIDE=no;
+ elif [ "$coqide_spec" = "yes" -a "$COQIDE" = "byte" ]; then
+ echo "LablGtk2 found, bytecode CoqIde will be used as requested"
+ COQIDE=byte
+ elif [ ! -f "${CAMLLIB}/threads/threads.cmxa" ]; then
+ echo "LablGtk2 found, no native threads: bytecode CoqIde will be available"
+ COQIDE=byte
+ else
+ echo "LablGtk2 found, native threads: native CoqIde will be available"
+ COQIDE=opt
+ fi
fi
case $COQIDE in