Commit 1d2c6107 authored by bguillaum's avatar bguillaum

version 2.17: add camomile dependency, adapt to libcaml-dep2pict-2.20

git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/semagramme/dep2pict/trunk@8674 7838e531-6607-4d57-9587-6c381814729c
parent 2ad4cd1f
VERSION = 2.16.4
VERSION = 2.17
INSTALL_DIR = @prefix@@bindir@
DATA_DIR = @prefix@@datarootdir@/dep2pict/
......@@ -18,6 +18,10 @@ ANSITERMINAL_DIR = @ANSITERMINAL_INCLUDE@
ANSITERMINAL_BYTE = $(ANSITERMINAL_DIR) ANSITerminal.cma
ANSITERMINAL_OPT = $(ANSITERMINAL_DIR) ANSITerminal.cmxa
CAMOMILE_DIR = @CAMOMILE_INCLUDE@
CAMOMILE_BYTE = $(CAMOMILE_DIR) camomile.cma
CAMOMILE_OPT = $(CAMOMILE_DIR) camomile.cmxa
XML_LIGHT_DIR = @XMLLIGHT_INCLUDE@
XML_LIGHT_BYTE = $(XML_LIGHT_DIR) xml-light.cma
XML_LIGHT_OPT = $(XML_LIGHT_DIR) xml-light.cmxa
......
......@@ -92,6 +92,9 @@ if test "$config" = yes ; then
AC_LIB_CHECKING(Dep2pict,dep2pict,dep2pict,dep2pict,Dep2pict,"",true,true)
AC_SUBST(DEP2PICT_INCLUDE,$LIB_INCLUDE)
AC_LIB_CHECKING(Camomile,camomile,camomile,camomile,"CamomileLibraryDefault","bigarray.cma",true)
AC_SUBST(CAMOMILE_INCLUDE,$LIB_INCLUDE)
AC_LIB_CHECKING(Log,log,log,log,Log,"",true,true)
AC_SUBST(LOG_INCLUDE,$LIB_INCLUDE)
......
......@@ -599,6 +599,7 @@ BUILD_GUI
XMLLIGHT_INCLUDE
ANSITERMINAL_INCLUDE
LOG_INCLUDE
CAMOMILE_INCLUDE
DEP2PICT_INCLUDE
CAIRO_INCLUDE
OCAMLFIND
......@@ -2285,6 +2286,139 @@ $as_echo "The $NAME library is missing." >&6; }
DEP2PICT_INCLUDE=$LIB_INCLUDE
MACRO="A"
MACRO=$MACRO"C_LIB_CHECKING"
NAME=Camomile
STD_FOLDER=camomile
OFIND_NAME=camomile
LIB_FILE=camomile
MOD="CamomileLibraryDefault"
OPTIONS="bigarray.cma"
NO_OPTIONAL=true
FULL_PATH=
OCAMLLIB_DIR=`ocamlc -where`
# test au cas ou un argument obligatoire est manquant
if test "$NAME" = "" || test "$STD_FOLDER" = "" || test "$OFIND_NAME" = "" || test "$LIB_FILE" = "" || test "$MOD" = "" ; then
echo ""
echo "Can't check a library"
echo "Missing argument in $MACRO($NAME,$STD_FOLDER,$OFIND_NAME,$LIB_FILE,$MOD,$OPTIONS,$NO_OPTIONAL)"
echo ""
exit 1
fi
# affichage du nom de la librairie a checker (avec details sur l'optionalité)
if test "$NO_OPTIONAL" = true; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for requested library : $NAME" >&5
$as_echo_n "checking for requested library : $NAME... " >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for optional library : $NAME" >&5
$as_echo_n "checking for optional library : $NAME... " >&6; }
fi
# si le fichier ml de test existe
if test -f c_check_$STD_FOLDER.ml ; then
# si on peut le supprimer
if test -w c_check_$STD_FOLDER.ml ; then
# on le supprimer
rm c_check_$STD_FOLDER.ml >& /dev/null
# sinon on arrete et on balance un message d'erreur (ie on a pas les droits sur le fichier
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "Cannot remove c_check_camomile.ml. Please change its right with chmod 666 c_check_camomile.ml
See \`config.log' for more details" "$LINENO" 5; }
fi
fi
# on prepare le fichier ml de test
echo "open $MOD;;" > c_check_$STD_FOLDER.ml
# si on arrive à l'executer avec la librairie dans le rep de lib de caml
if (ocamlc -c $OPTIONS c_check_$STD_FOLDER.ml >& /dev/null) ; then
# pas besoin d'include
LIB_INCLUDE=""
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Found in ocaml lib directory" >&5
$as_echo "Found in ocaml lib directory" >&6; }
# sinon on essaie avec un repertoire dedié à la lib (-I +xxx yyy.cma)
elif (ocamlc -c $OPTIONS -I +$STD_FOLDER $LIB_FILE.cma c_check_$STD_FOLDER.ml >& /dev/null) ; then
# si ca marche, on s'arrete et on precise le include
if test "$FULL_PATH" = "true" ; then
LIB_INCLUDE="-I $OCAMLLIB_DIR/$STD_FOLDER"
else
LIB_INCLUDE="-I +$STD_FOLDER"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Found in $STD_FOLDER directory => $LIB_INCLUDE" >&5
$as_echo "Found in $STD_FOLDER directory => $LIB_INCLUDE" >&6; }
# sinon, on essaie avec ocamlfind
else
# si on n'a pas ocamlfind , on s'arrete (dans le cas d'une lib oblig.) ou
# on lance un warning (dans le cas d'une lib optionelle)
if test "ocamlfind" = no ; then
if test "$NO_OPTIONAL" = "true"; then
as_fn_error $? "The $NAME library is missing." "$LINENO" 5
LIB_INCLUDE="no"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: The $NAME library is missing." >&5
$as_echo "The $NAME library is missing." >&6; }
LIB_INCLUDE="no"
fi
# sinon, ocamlfind est présent
else
# on regarde déjà si la lib est installée avec ocamlfind
if ocamlfind query $OFIND_NAME > /dev/null 2>&1 ; then
# si c'est le cas, on recupere le repertoire d'installation et le include correspondant
LIB_INCLUDE=`ocamlfind query $OFIND_NAME`
LIB_INCLUDE="-I $LIB_INCLUDE"
# on teste maintenant si on peut exectuer le fichier ml de test
if (ocamlc -c $OPTIONS $LIB_INCLUDE $LIB_FILE.cma c_check_$STD_FOLDER.ml >& /dev/null) ; then
# on y arrive, on dit qu'on a trouvé la lib avec ocamlfind
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Found with ocamlfind => $LIB_INCLUDE" >&5
$as_echo "Found with ocamlfind => $LIB_INCLUDE" >&6; }
# si on y arrive pas
else
# suivant l'optionalité de la lib: un warning ou une erreur
if test "$NO_OPTIONAL" = "true"; then
as_fn_error $? "The $NAME library is missing." "$LINENO" 5
LIB_INCLUDE="no"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: The $NAME library is missing." >&5
$as_echo "The $NAME library is missing." >&6; }
LIB_INCLUDE="no"
fi
fi
# si la lib n'est pas installée avec ocamlfind
else
# suivant l'optionalité de la lib: un warning ou une erreur
if test "$NO_OPTIONAL" = "true"; then
as_fn_error $? "The $NAME library is missing." "$LINENO" 5
LIB_INCLUDE="no"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: The $NAME library is missing." >&5
$as_echo "The $NAME library is missing." >&6; }
LIB_INCLUDE="no"
fi
fi
fi
fi
# suppression du fichier ml de test
rm c_check_$STD_FOLDER.ml >& /dev/null
rm c_check_$STD_FOLDER.cmo >& /dev/null
rm c_check_$STD_FOLDER.cmi >& /dev/null
CAMOMILE_INCLUDE=$LIB_INCLUDE
MACRO="A"
MACRO=$MACRO"C_LIB_CHECKING"
......
......@@ -5,5 +5,5 @@ build: [
["make"]
["make" "install"]
]
depends: ["ANSITerminal" "libcaml-log" "cairo2" "lablgtk" "libcaml-dep2pict"]
depends: ["ANSITerminal" "camomile" "libcaml-log" "cairo2" "lablgtk" "libcaml-dep2pict"]
......@@ -25,8 +25,8 @@ dep2pict_glade.ml : dep2pict.glade
dep2pict_glade.cmx : dep2pict_glade.ml
$(OCAMLOPT) -c $(LABLGTK_OPT) $(LABLWEBKIT_OPT) $(CAIRO_OPT) dep2pict_glade.ml
DEP_OPT= unix.cmxa str.cmxa bigarray.cmxa $(LABLGTK_OPT) $(LABLWEBKIT_OPT) $(CAIRO_OPT) $(XML_LIGHT_OPT) $(ANSITERMINAL_OPT) $(LOG_OPT) $(DEP2PICT_OPT)
DEP_OPT_NOGUI= unix.cmxa str.cmxa bigarray.cmxa $(CAIRO_OPT) $(XML_LIGHT_OPT) $(ANSITERMINAL_OPT) $(LOG_OPT) $(DEP2PICT_OPT)
DEP_OPT= unix.cmxa str.cmxa bigarray.cmxa $(LABLGTK_OPT) $(LABLWEBKIT_OPT) $(CAIRO_OPT) $(CAMOMILE_OPT) $(XML_LIGHT_OPT) $(ANSITERMINAL_OPT) $(LOG_OPT) $(DEP2PICT_OPT)
DEP_OPT_NOGUI= unix.cmxa str.cmxa bigarray.cmxa $(CAIRO_OPT) $(CAMOMILE_OPT) $(XML_LIGHT_OPT) $(ANSITERMINAL_OPT) $(LOG_OPT) $(DEP2PICT_OPT)
global.cmx : global.ml
$(OCAMLOPT) -c -pp 'camlp4o pa_macro.cmo -DBUILD_GUI -DDATA_DIR=\"$(DATA_DIR)\" $(LOG) -DVERSION=\"$(VERSION)\"' $(DEP_OPT) global.ml
......
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