configure uses ocamlfind when possible

parent 036f2d42
......@@ -2,6 +2,7 @@
version 0.64, Feb 16, 2011
==========================
o configure: if possible, use ocamlfind to find lablgtk2 and sqlite3
o algebraic types: must be well-founded, non-positive constructors
are forbidden, recursive functions and predicates must
structurally terminate
......
......@@ -429,14 +429,14 @@ IDEMLI = $(addsuffix .mli, $(IDEMODULES))
IDECMO = $(addsuffix .cmo, $(IDEMODULES))
IDECMX = $(addsuffix .cmx, $(IDEMODULES))
$(IDECMO) $(IDECMX): INCLUDES += -I src/ide -I +sqlite3
$(IDECMO) $(IDECMX): INCLUDES += -I src/ide -I @SQLITE3LIB@
# build targets
byte: bin/why3ide.byte
opt: bin/why3ide.opt
bin/why3ide.opt bin/why3ide.byte: INCLUDES += -thread -I +threads -I +lablgtk2 -I +sqlite3
bin/why3ide.opt bin/why3ide.byte: INCLUDES += -thread -I +threads -I @LABLGTK2LIB@ -I @SQLITE3LIB@
bin/why3ide.opt bin/why3ide.byte: EXTOBJS += gtkThread
bin/why3ide.opt bin/why3ide.byte: EXTLIBS += threads lablgtk lablgtksourceview2 sqlite3
......@@ -492,7 +492,7 @@ BENCHMLI = $(addsuffix .mli, $(BENCHMODULES))
BENCHCMO = $(addsuffix .cmo, $(BENCHMODULES))
BENCHCMX = $(addsuffix .cmx, $(BENCHMODULES))
$(BENCHCMO) $(BENCHCMX): INCLUDES += -I src/ide -I src/bench -I +sqlite3
$(BENCHCMO) $(BENCHCMX): INCLUDES += -I src/ide -I src/bench -I @SQLITE3LIB@
# build targets
......
......@@ -250,6 +250,21 @@ fi
AC_CHECK_PROG(CAMLP5O,camlp5o,camlp5o,no)
## Where are the library we need
# we look for ocamlfind; if not present, we just don't use it to find
# libraries
AC_CHECK_PROG(USEOCAMLFIND,ocamlfind,yes,no)
if test "$USEOCAMLFIND" = yes; then
OCAMLFINDLIB=$(ocamlfind printconf stdlib)
OCAMLFIND=$(which ocamlfind)
if test "$OCAMLFINDLIB" != "$OCAMLLIB"; then
USEOCAMLFIND=no;
echo "but your ocamlfind is not compatible with your ocamlc:"
echo "ocamlfind : $OCAMLFINDLIB, ocamlc : $OCAMLLIB"
fi
fi
AC_CHECK_PROG(MENHIR,menhir,menhir,no)
if test "$MENHIR" = no ; then
enable_whytptp=no
......@@ -273,25 +288,41 @@ fi
# checking for lablgtk2
if test "$enable_ide" = yes ; then
AC_CHECK_FILE($OCAMLLIB/lablgtk2/lablgtk.cma,,enable_ide=no)
if test "$enable_ide" = no; then
AC_MSG_WARN(Lib lablgtk2 not found, IDE disabled.)
reason_ide=" (lablgtk2 not found)"
else
AC_CHECK_FILE($OCAMLLIB/lablgtk2/lablgtksourceview2.cma,,enable_ide=no)
if test "$enable_ide" = no; then
AC_MSG_WARN(Lib lablgtksourceview2 not found, IDE disabled.)
reason_ide=" (lablgtksourceview2 not found)"
if test "$USEOCAMLFIND" == yes; then
LABLGTK2LIB=$(ocamlfind query lablgtk2)
fi
if test -n "$LABLGTK2LIB";then
echo "ocamlfind found lablgtk2 in $LABLGTK2LIB"
else
LABLGTK2LIB="+lablgtk2"
AC_CHECK_FILE($OCAMLLIB/lablgtk2/lablgtk.cma,,enable_ide=no)
if test "$enable_ide" = no; then
AC_MSG_WARN(Lib lablgtk2 not found, IDE disabled.)
reason_ide=" (lablgtk2 not found)"
else
AC_CHECK_FILE($OCAMLLIB/lablgtk2/lablgtksourceview2.cma,,enable_ide=no)
if test "$enable_ide" = no; then
AC_MSG_WARN(Lib lablgtksourceview2 not found, IDE disabled.)
reason_ide=" (lablgtksourceview2 not found)"
fi
fi
fi
fi
fi
# checking for sqlite3
if test "$enable_ide" = yes ; then
AC_CHECK_FILE($OCAMLLIB/sqlite3/sqlite3.cma,,enable_ide=no)
if test "$enable_ide" = no; then
AC_MSG_WARN(Lib sqlite3 not found, IDE disabled.)
reason_ide=" (sqlite3 not found)"
if test "$USEOCAMLFIND" == yes; then
SQLITE3LIB=$(ocamlfind query sqlite3)
fi
if test -n "$SQLITE3LIB";then
echo "ocamlfind found sqlite3 in $SQLITE3LIB"
else
SQLITE3LIB="+sqlite3"
AC_CHECK_FILE($OCAMLLIB/sqlite3/sqlite3.cma,,enable_ide=no)
if test "$enable_ide" = no; then
AC_MSG_WARN(Lib sqlite3 not found, IDE disabled.)
reason_ide=" (sqlite3 not found)"
fi
fi
fi
......@@ -419,6 +450,8 @@ AC_SUBST(enable_profiling)
AC_SUBST(CAMLP5O)
AC_SUBST(enable_ide)
AC_SUBST(LABLGTK2LIB)
AC_SUBST(SQLITE3LIB)
AC_SUBST(enable_bench)
AC_SUBST(enable_plugins)
AC_SUBST(DYNLINK)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment