Commit e23ddaa0 authored by bguillaum's avatar bguillaum

chose best ocaml compilers

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/semagramme/libcaml-grew/trunk@7080 7838e531-6607-4d57-9587-6c381814729c
parent 51c7e492
......@@ -8,8 +8,12 @@ all:
include config/Makefile
conf:
cd config && rm -rf ac_lib_checking.*
cd config && wget https://gforge.inria.fr/scm/viewvc.php/*checkout*/ac_lib_checking/ac_lib_checking.m4?root=semagramme --no-check-certificate || true
cd config && mv ac_lib_checking.m4?root=semagramme ac_lib_checking.m4 || true
cd config && aclocal
autoconf -o configure config/configure.in
cd config && autoconf -o ../configure configure.in
rm -rf config.status config.log autom4te.cache config/autom4te.cache config/ac_lib_checking.m4
purge_makefile:
@make -C src purge_makefile
......@@ -22,11 +26,11 @@ clean:
uninstall:
rm -rf $(OCAMLFIND_DIR)/for_mac_libgrew
ocamlfind remove libgrew > /dev/null
$(OCAMLFIND) remove libgrew > /dev/null
uninstall_dev:
rm -rf $(OCAMLFIND_DIR)/for_mac_libgrew
ocamlfind remove libgrew_dev > /dev/null
$(OCAMLFIND) remove libgrew_dev > /dev/null
LIB_DEP = libgrew.cma libgrew.cmxa libgrew.a libgrew.cmi
......@@ -40,7 +44,7 @@ ifneq ($(DESTDIR),)
endif
mkdir -p $(DESTDIR)$(DATA_DIR)/
cp data/style.css $(DESTDIR)$(DATA_DIR)/
cd src && ocamlfind install libgrew ../META $(LIB_DEP)
cd src && $(OCAMLFIND) install libgrew ../META $(LIB_DEP)
mv META_ META
install_dev: uninstall_dev
......@@ -48,7 +52,7 @@ install_dev: uninstall_dev
sed -itmp "s|@VERSION@|$(VERSION)|g" META
sed -itmp "s|@DEV@|_dev|g" META
rm -rf METAtmp
cd src && ocamlfind install libgrew_dev ../META $(LIB_DEP)
cd src && $(OCAMLFIND) install libgrew_dev ../META $(LIB_DEP)
mv META_ META
cp data/style.css $(DESTDIR)$(DATA_DIR)/
......
LOG_DIR = @LOG_INCLUDE@
LOG_BYTE = $(LOG_DIR) log.cma
LOG_OPT = $(LOG_DIR) log.cmxa
DEP2PICT=@DEP2PICT@
DEP2PICT_DIR = @DEP2PICT_INCLUDE@
DEP2PICT_BYTE = $(DEP2PICT_DIR) dep2pict.cma
DEP2PICT_OPT = $(DEP2PICT_DIR) dep2pict.cmxa
ANSITERMINAL_DIR = @ANSITERMINAL_INCLUDE@
ANSITERMINAL_BYTE = $(ANSITERMINAL_DIR) ANSITerminal.cma
ANSITERMINAL_OPT = $(ANSITERMINAL_DIR) ANSITerminal.cmxa
VERSION = 0.10.0
INSTALL_DIR_LIB = @OCAMLLIB@
INSTALL_DIR = @prefix@/bin/
DATA_DIR = @prefix@@datarootdir@/libgrew/
DOC_DIR = @prefix@@datarootdir@/libgrew-doc/
OCAMLC = @OCAMLC@
OCAMLOPT = @OCAMLOPT@
OCAMLLIB = @OCAMLLIB@
OCAMLFIND = @OCAMLFIND@
OCAMLLEX = @OCAMLLEX@
MENHIR = @MENHIR@
OCAMLFIND_DIR=`$(OCAMLFIND) printconf destdir`
BYTE_FLAGS = -g -dtypes
OPT_FLAGS = -g -dtypes
......@@ -26,9 +21,19 @@ WARNING = @WARNING@
MESSAGE = @MESSAGE@
INFO = @INFO@
OCAMLFIND_DIR=`ocamlfind printconf destdir`
LOG_DIR = @LOG_INCLUDE@
LOG_BYTE = $(LOG_DIR) log.cma
LOG_OPT = $(LOG_DIR) log.cmxa
DEP2PICT=@DEP2PICT@
DEP2PICT_DIR = @DEP2PICT_INCLUDE@
DEP2PICT_BYTE = $(DEP2PICT_DIR) dep2pict.cma
DEP2PICT_OPT = $(DEP2PICT_DIR) dep2pict.cmxa
ANSITERMINAL_DIR = @ANSITERMINAL_INCLUDE@
ANSITERMINAL_BYTE = $(ANSITERMINAL_DIR) ANSITerminal.cma
ANSITERMINAL_OPT = $(ANSITERMINAL_DIR) ANSITerminal.cmxa
VERSION = 0.10.0
cleanup:
rm -rf *.cmo *.cmx *.cmi *.annot *.o *.*~
......@@ -47,17 +52,20 @@ infos:
@echo "data install dir -> " $(DATA_DIR)
@echo "doc install dir -> " $(DOC_DIR)
@echo ""
@echo "OCAMLC -> " $(OCAMLC)
@echo "OCAMLOPT -> " $(OCAMLOPT)
@echo "OCAMLLIB -> " $(OCAMLLIB)
@echo "OCAMLFIND -> " $(OCAMLFIND)
@echo "byte compil flags -> " $(BYTE_FLAGS)
@echo "native compil flags -> " $(OPT_FLAGS)
@echo ""
@echo "log -> " $(LOG_OPT)
@echo "dep2pict -> " $(DEP2PICT_OPT)
@echo "ansiterminal -> " $(ANSITERMINAL_OPT)
@echo ""
@echo "byte compil flags -> " $(BYTE_FLAGS)
@echo "native compil flags -> " $(OPT_FLAGS)
@echo ""
@echo "DEBUG -> " $(DEBUG)
@echo "WARNING -> " $(WARNING)
@echo "MESSAGE -> " $(MESSAGE)
@echo "INFO -> " $(INFO)
@echo ""
@echo "use dep2pict -> " $(DEP2PICT)
AC_PREREQ([2.63])
AC_INIT(grew, 1.0, paul.masson@inria.fr)
echo ""
echo "Checking essential libraries, tools and programs."
echo ""
AC_INIT(libcaml-grew, 1.0, bruno.guillaume@inria.fr)
AC_ARG_ENABLE(
[config],
[AS_HELP_STRING(
[--enable-config],
[Enable configuration check (default is yes)])],
[AS_HELP_STRING([--enable-config],[Enable configuration check (default is yes)])],
[config=$enableval],
[config=yes])
AC_ARG_ENABLE(
[dep2pict],
[AS_HELP_STRING(
[--enable-dep2pict],
[Enable dep2pict (default is yes)])],
[AS_HELP_STRING([--enable-dep2pict],[Enable dep2pict (default is yes)])],
[dep2pict=$enableval],
[dep2pict=yes])
if test "$config" = yes ; then
# Look for ocamlfind
AC_PATH_PROG(OCAMLFIND,ocamlfind,no)
# Checks for programs.
AC_CHECK_PROGS(OCAMLC,ocamlc.opt ocamlc,no)
if test "$OCAMLC" = no ; then
AC_MSG_ERROR(Cannot find ocamlc)
fi
AC_SUBST(OCAMLC)
AC_CHECK_PROGS(OCAMLOPT,ocamlopt.opt ocamlopt,no)
if test "$OCAMLOPT" = no ; then
AC_MSG_ERROR(Cannot find ocamlopt)
fi
AC_SUBST(OCAMLOPT)
AC_CHECK_PROGS(OCAMLLEX,ocamllex.opt ocamllex,no)
if test "$OCAMLLEX" = no ; then
AC_MSG_ERROR(Cannot find ocamllex)
fi
AC_SUBST(OCAMLLEX)
# Checks for libraries.
AC_MSG_CHECKING(for ocaml library path)
OCAMLLIB=$(ocamlc -where)
OCAMLLIB=$($OCAMLC -where)
AC_MSG_RESULT($OCAMLLIB)
if test "$OCAMLLIB" = ""; then
AC_MSG_ERROR(Cannot find ocaml library path)
fi
AC_SUBST(OCAMLLIB)
# Look for ocamlfind
AC_PATH_PROG(OCAMLFIND,ocamlfind,no)
if test "$OCAMLFIND" = no ; then
AC_MSG_ERROR(Cannot find ocamlfind)
fi
AC_SUBST(OCAMLFIND)
AC_PATH_PROG(MENHIR,menhir,no)
if test "$MENHIR" = "no"; then
AC_MSG_ERROR(Cannot find menhir)
fi
AC_SUBST(MENHIR)
m4_include(ac_lib_checking.m4)
#Look for ANSITerminal
AC_MSG_CHECKING([for ANSITerminal])
if test -f c_check_ANSITerminal.ml ; then
if test -w c_check_ANSITerminal.ml ; then
rm c_check_ANSITerminal.* >& /dev/null
else
AC_MSG_ERROR(Cannot remove c_check_ANSITerminal.ml. Please change its right with chmod 666 c_check_ANSITerminal.ml)
fi
fi
echo "open ANSITerminal;;" > c_check_ANSITerminal.ml
if (ocaml ANSITerminal.cma c_check_ANSITerminal.ml >& /dev/null) ; then
AC_MSG_RESULT(standard)
else
if test "$OCAMLFIND" = no ; then
AC_MSG_ERROR(The ANSITerminal library is missing.)
else
if $OCAMLFIND query ANSITerminal > /dev/null 2>&1 ; then
ANSITERMINAL_INCLUDE="-I `$OCAMLFIND query ANSITerminal`"
AC_MSG_RESULT(ocamlfind)
else
AC_MSG_ERROR(The ANSITerminal library is missing.)
fi
fi
fi
rm c_check_ANSITerminal.ml >& /dev/null
AC_LIB_CHECKING(ANSITerminal,ANSITerminal,ANSITerminal,ANSITerminal,ANSITerminal,"",true)
AC_SUBST(ANSITERMINAL_INCLUDE,$LIB_INCLUDE)
#Look for Log
AC_MSG_CHECKING([for log])
if test -f c_check_log.ml ; then
if test -w c_check_log.ml ; then
rm c_check_log.* >& /dev/null
else
AC_MSG_ERROR(Cannot remove c_check_log.ml. Please change its right with chmod 666 c_check_log.ml)
fi
fi
echo "open Log;;" > c_check_log.ml
if (ocamlc -c log.cma c_check_log.ml >& /dev/null) ; then
AC_MSG_RESULT(standard)
else
if test "$OCAMLFIND" = no ; then
AC_MSG_ERROR(The log library is missing.)
else
if $OCAMLFIND query log > /dev/null 2>&1 ; then
LOG_INCLUDE="-I `$OCAMLFIND query log`"
AC_MSG_RESULT(ocamlfind)
else
AC_MSG_ERROR(The log library is missing.)
fi
fi
fi
rm c_check_log.* >& /dev/null
AC_LIB_CHECKING(Log,log,log,log,Log,"",true)
AC_SUBST(LOG_INCLUDE,$LIB_INCLUDE)
DEP2PICT="no"
if test "$dep2pict" = yes ; then
......@@ -177,10 +147,6 @@ fi
TRUNK=`pwd`
AC_SUBST(TRUNK)
AC_SUBST(OCAMLC)
AC_SUBST(OCAMLOPT)
AC_SUBST(OCAMLLIB)
AC_SUBST(ANSITERMINAL_INCLUDE)
AC_SUBST(LOG_INCLUDE)
AC_SUBST(DEP2PICT_INCLUDE)
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.68 for grew 1.0.
# Generated by GNU Autoconf 2.68 for libcaml-grew 1.0.
#
# Report bugs to <paul.masson@inria.fr>.
# Report bugs to <bruno.guillaume@inria.fr>.
#
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
......@@ -238,10 +238,10 @@ fi
$as_echo "$0: be upgraded to zsh 4.3.4 or later."
else
$as_echo "$0: Please tell bug-autoconf@gnu.org and
$0: paul.masson@inria.fr about your system, including any
$0: error possibly output before this message. Then install
$0: a modern shell, or manually run the script under such a
$0: shell if you do have one."
$0: bruno.guillaume@inria.fr about your system, including
$0: any error possibly output before this message. Then
$0: install a modern shell, or manually run the script
$0: under such a shell if you do have one."
fi
exit 1
fi
......@@ -557,11 +557,11 @@ MFLAGS=
MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='grew'
PACKAGE_TARNAME='grew'
PACKAGE_NAME='libcaml-grew'
PACKAGE_TARNAME='libcaml-grew'
PACKAGE_VERSION='1.0'
PACKAGE_STRING='grew 1.0'
PACKAGE_BUGREPORT='paul.masson@inria.fr'
PACKAGE_STRING='libcaml-grew 1.0'
PACKAGE_BUGREPORT='bruno.guillaume@inria.fr'
PACKAGE_URL=''
ac_subst_vars='LTLIBOBJS
......@@ -569,19 +569,19 @@ LIBOBJS
VERSION
SET_MAKE
DEP2PICT_INCLUDE
LOG_INCLUDE
ANSITERMINAL_INCLUDE
OCAMLLIB
OCAMLOPT
OCAMLC
TRUNK
INFO
MESSAGE
WARNING
DEBUG
DEP2PICT
LOG_INCLUDE
ANSITERMINAL_INCLUDE
MENHIR
OCAMLFIND
OCAMLLIB
OCAMLOPT
OCAMLC
target_alias
host_alias
build_alias
......@@ -1175,7 +1175,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures grew 1.0 to adapt to many kinds of systems.
\`configure' configures libcaml-grew 1.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1223,7 +1223,7 @@ Fine tuning of the installation directories:
--infodir=DIR info documentation [DATAROOTDIR/info]
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
--mandir=DIR man documentation [DATAROOTDIR/man]
--docdir=DIR documentation root [DATAROOTDIR/doc/grew]
--docdir=DIR documentation root [DATAROOTDIR/doc/libcaml-grew]
--htmldir=DIR html documentation [DOCDIR]
--dvidir=DIR dvi documentation [DOCDIR]
--pdfdir=DIR pdf documentation [DOCDIR]
......@@ -1236,7 +1236,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of grew 1.0:";;
short | recursive ) echo "Configuration of libcaml-grew 1.0:";;
esac
cat <<\_ACEOF
......@@ -1251,7 +1251,7 @@ Optional Features:
--enable-message Display message trace
--enable-info Display info trace
Report bugs to <paul.masson@inria.fr>.
Report bugs to <bruno.guillaume@inria.fr>.
_ACEOF
ac_status=$?
fi
......@@ -1314,7 +1314,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
grew configure 1.0
libcaml-grew configure 1.0
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
......@@ -1331,7 +1331,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by grew $as_me 1.0, which was
It was created by libcaml-grew $as_me 1.0, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
......@@ -1680,10 +1680,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
echo ""
echo "Checking essential libraries, tools and programs."
echo ""
# Check whether --enable-config was given.
if test "${enable_config+set}" = set; then :
enableval=$enable_config; config=$enableval
......@@ -1692,7 +1688,6 @@ else
fi
# Check whether --enable-dep2pict was given.
if test "${enable_dep2pict+set}" = set; then :
enableval=$enable_dep2pict; dep2pict=$enableval
......@@ -1703,6 +1698,114 @@ fi
if test "$config" = yes ; then
# Checks for programs.
for ac_prog in ocamlc.opt ocamlc
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_OCAMLC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$OCAMLC"; then
ac_cv_prog_OCAMLC="$OCAMLC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_OCAMLC="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
OCAMLC=$ac_cv_prog_OCAMLC
if test -n "$OCAMLC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLC" >&5
$as_echo "$OCAMLC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -n "$OCAMLC" && break
done
test -n "$OCAMLC" || OCAMLC="no"
if test "$OCAMLC" = no ; then
as_fn_error $? "Cannot find ocamlc" "$LINENO" 5
fi
for ac_prog in ocamlopt.opt ocamlopt
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_OCAMLOPT+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$OCAMLOPT"; then
ac_cv_prog_OCAMLOPT="$OCAMLOPT" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_OCAMLOPT="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
OCAMLOPT=$ac_cv_prog_OCAMLOPT
if test -n "$OCAMLOPT"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPT" >&5
$as_echo "$OCAMLOPT" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -n "$OCAMLOPT" && break
done
test -n "$OCAMLOPT" || OCAMLOPT="no"
if test "$OCAMLOPT" = no ; then
as_fn_error $? "Cannot find ocamlopt" "$LINENO" 5
fi
# Checks for libraries.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ocaml library path" >&5
$as_echo_n "checking for ocaml library path... " >&6; }
OCAMLLIB=$($OCAMLC -where)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLIB" >&5
$as_echo "$OCAMLLIB" >&6; }
if test "$OCAMLLIB" = ""; then
as_fn_error $? "Cannot find ocaml library path" "$LINENO" 5
fi
# Look for ocamlfind
# Extract the first word of "ocamlfind", so it can be a program name with args.
set dummy ocamlfind; ac_word=$2
......@@ -1745,17 +1848,13 @@ $as_echo "no" >&6; }
fi
# Checks for libraries.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ocaml library path" >&5
$as_echo_n "checking for ocaml library path... " >&6; }
OCAMLLIB=$(ocamlc -where)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLIB" >&5
$as_echo "$OCAMLLIB" >&6; }
if test "$OCAMLLIB" = ""; then
as_fn_error $? "Cannot find ocaml library path" "$LINENO" 5
if test "$OCAMLFIND" = no ; then
as_fn_error $? "Cannot find ocamlfind" "$LINENO" 5
fi
# Extract the first word of "menhir", so it can be a program name with args.
set dummy menhir; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
......@@ -1801,64 +1900,289 @@ fi
as_fn_error $? "Cannot find menhir" "$LINENO" 5
fi
################################################################################
# AC_LIB_CHECKING
# permet le test de la présence d'une librairie Ocaml dans le repertoire
# standard d'installation des librairies (ocamlc -where), dans un repertoire
# dédié (+...), ou installée avec ocamlfind
# @param $1 : le nom a afficher de la librairie
# @param $2 : le repertoire standard de la librairie (par ex : zen pour -I +zen)
# @param $3 : le nom de la librairie pour ocamlfind
# @param $4 : le nom du fichier contenant la librairie
# @param $5 : le module a tester pour vérifier la présence de la librairie
# @param $6 : les options de "compilation" pour la verification de la présence de la lib
# @param $7 : true si la librairie est obligatoire, false si elle est optionnelle
# @param $8 : true si il faut utiliser le path complet pour le repertoire de la lib (+zen -> `ocamlc -where`/zen), false autrement
################################################################################
MACRO="A"
MACRO=$MACRO"C_LIB_CHECKING"
NAME=ANSITerminal
STD_FOLDER=ANSITerminal
OFIND_NAME=ANSITerminal
LIB_FILE=ANSITerminal
MOD=ANSITerminal
OPTIONS=""
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
#Look for ANSITerminal
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSITerminal" >&5
$as_echo_n "checking for ANSITerminal... " >&6; }
if test -f c_check_ANSITerminal.ml ; then
if test -w c_check_ANSITerminal.ml ; then
rm c_check_ANSITerminal.* >& /dev/null
# 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_fn_error $? "Cannot remove c_check_ANSITerminal.ml. Please change its right with chmod 666 c_check_ANSITerminal.ml" "$LINENO" 5
{ { $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_ANSITerminal.ml. Please change its right with chmod 666 c_check_ANSITerminal.ml
See \`config.log' for more details" "$LINENO" 5; }
fi
fi
echo "open ANSITerminal;;" > c_check_ANSITerminal.ml
if (ocaml ANSITerminal.cma c_check_ANSITerminal.ml >& /dev/null) ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: standard" >&5
$as_echo "standard" >&6; }
# 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
if test "$OCAMLFIND" = no ; then
as_fn_error $? "The ANSITerminal library is missing." "$LINENO" 5
else
if $OCAMLFIND query ANSITerminal > /dev/null 2>&1 ; then
ANSITERMINAL_INCLUDE="-I `$OCAMLFIND query ANSITerminal`"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ocamlfind" >&5
$as_echo "ocamlfind" >&6; }
else
as_fn_error $? "The ANSITerminal library is missing." "$LINENO" 5
fi
fi
# 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
rm c_check_ANSITerminal.ml >& /dev/null
#Look for Log
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for log" >&5
$as_echo_n "checking for log... " >&6; }
if test -f c_check_log.ml ; then
if test -w c_check_log.ml ; then
rm c_check_log.* >& /dev/null