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
#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(ANSITerminal,ANSITerminal,ANSITerminal,ANSITerminal,ANSITerminal,"",true)
AC_SUBST(ANSITERMINAL_INCLUDE,$LIB_INCLUDE)
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)
......
This diff is collapsed.
This diff is collapsed.
......@@ -5,36 +5,36 @@ byte: parser_global.cmo gr_grs_parser.cmo lexer.cmo grew_parser.cmo
include ../../config/Makefile
parser_global.cmo: parser_global.ml
ocamlc.opt -c $(BYTE_FLAGS) parser_global.ml
$(OCAMLC) -c $(BYTE_FLAGS) parser_global.ml
parser_global.cmx: parser_global.ml
ocamlopt.opt -c $(OPT_FLAGS) parser_global.ml
$(OCAMLOPT) -c $(OPT_FLAGS) parser_global.ml
gr_grs_parser.ml: gr_grs_parser.mly
menhir --infer --ocamlc "ocamlc -c -I .. grew_utils.cmo grew_ast.cmo parser_global.cmo" gr_grs_parser.mly
gr_grs_parser.cmx: gr_grs_parser.ml ../grew_utils.cmx ../grew_ast.cmx parser_global.cmo
ocamlopt.opt -c $(OPT_FLAGS) -I .. grew_utils.cmx grew_ast.cmx gr_grs_parser.mli
ocamlopt.opt -c $(OPT_FLAGS) -I .. grew_utils.cmx grew_ast.cmx gr_grs_parser.ml
$(OCAMLOPT) -c $(OPT_FLAGS) -I .. grew_utils.cmx grew_ast.cmx gr_grs_parser.mli
$(OCAMLOPT) -c $(OPT_FLAGS) -I .. grew_utils.cmx grew_ast.cmx gr_grs_parser.ml
gr_grs_parser.cmo: gr_grs_parser.ml ../grew_utils.cmo ../grew_ast.cmx parser_global.cmo
ocamlc.opt -c $(BYTE_FLAGS) -I .. grew_utils.cmo grew_ast.cmo gr_grs_parser.mli
ocamlc.opt -c $(BYTE_FLAGS) -I .. grew_utils.cmo grew_ast.cmo gr_grs_parser.ml
$(OCAMLC) -c $(BYTE_FLAGS) -I .. grew_utils.cmo grew_ast.cmo gr_grs_parser.mli
$(OCAMLC) -c $(BYTE_FLAGS) -I .. grew_utils.cmo grew_ast.cmo gr_grs_parser.ml
lexer.ml: lexer.mll
ocamllex lexer.mll
lexer.cmx: gr_grs_parser.cmx lexer.ml ../grew_ast.cmx
ocamlopt.opt -c $(OPT_FLAGS) -I .. grew_ast.cmx lexer.ml
$(OCAMLOPT) -c $(OPT_FLAGS) -I .. grew_ast.cmx lexer.ml
lexer.cmo: gr_grs_parser.cmo lexer.ml ../grew_ast.cmo
ocamlc.opt -c $(BYTE_FLAGS) -I .. grew_ast.cmo lexer.ml
$(OCAMLC) -c $(BYTE_FLAGS) -I .. grew_ast.cmo lexer.ml
grew_parser.cmx: gr_grs_parser.cmx lexer.cmx grew_parser.ml ../grew_ast.cmx
ocamlopt.opt -c $(OPT_FLAGS) -I .. grew_ast.cmx grew_parser.ml
$(OCAMLOPT) -c $(OPT_FLAGS) -I .. grew_ast.cmx grew_parser.ml
grew_parser.cmo: gr_grs_parser.cmo lexer.cmo grew_parser.ml ../grew_ast.cmo
ocamlc.opt -c $(BYTE_FLAGS) -I .. grew_ast.cmo grew_parser.ml
$(OCAMLC) -c $(BYTE_FLAGS) -I .. grew_ast.cmo grew_parser.ml
clean:
rm -rf *.cmi *.cmx *.cmo lexer.ml gr_grs_parser.ml *.o *.mli *.annot
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