X-Git-Url: http://git.nguyen.vg/gitweb/?p=tatoo.git;a=blobdiff_plain;f=configure.in;h=0adc97018dd98f566cf6b724f27a67862f260a08;hp=34a9e31f994106f9e0bdc34652b48133acb87ca2;hb=406c70f1fe88c94c66489604eb8337d1e54043b9;hpb=91d60f0cf46661abde8df94fead3688ec43a2db9 diff --git a/configure.in b/configure.in index 34a9e31..0adc970 100644 --- a/configure.in +++ b/configure.in @@ -68,50 +68,27 @@ esac AC_SUBST(OCAMLVERSION) -dnl ocamlyacc and ocamllex are not needed #detect ocamlyacc -dnl OCAMLYACC=ocamlyacc -dnl AC_ARG_WITH([ocamlyacc], -dnl AS_HELP_STRING([--with-ocamlyacc=PATH], [location of the ocamlyacc binary]), -dnl [OCAMLYACC="$withval"]) -dnl AC_MSG_CHECKING([for ocamlyacc ($OCAMLYACC)]) -dnl OCAMLYACC_VERSION=$($OCAMLYACC -version 2>/dev/null || echo foo) -dnl case "$OCAMLYACC_VERSION" in -dnl *$OCAMLVERSION) -dnl AC_MSG_RESULT([ok]) -dnl ;; -dnl foo) -dnl AC_MSG_RESULT([failed]) -dnl AC_MSG_ERROR([Cannot find ocamlyacc]) -dnl ;; -dnl *) -dnl AC_MSG_RESULT([failed]) -dnl AC_MSG_ERROR([Bad ocamlyacc version]) -dnl ;; -dnl esac -dnl AC_SUBST([OCAMLYACC]) - -dnl #detect ocamllex -dnl OCAMLLEX=ocamllex -dnl AC_ARG_WITH([ocamllex], -dnl AS_HELP_STRING([--with-ocamllex=PATH], [location of the ocamllex binary]), -dnl [OCAMLLEX="$withval"]) -dnl AC_MSG_CHECKING([for ocamllex ($OCAMLLEX)]) -dnl OCAMLLEX_VERSION=$($OCAMLLEX -version 2>/dev/null || echo foo) -dnl case "$OCAMLLEX_VERSION" in -dnl *$OCAMLVERSION) -dnl AC_MSG_RESULT([ok]) -dnl ;; -dnl foo) -dnl AC_MSG_RESULT([failed]) -dnl AC_MSG_ERROR([Cannot find ocamllex]) -dnl ;; -dnl *) -dnl AC_MSG_RESULT([failed]) -dnl AC_MSG_ERROR([Bad ocamllex version]) -dnl ;; -dnl esac -dnl AC_SUBST([OCAMLLEX]) +OCAMLYACC=ocamlyacc +AC_ARG_WITH([ocamlyacc], + AS_HELP_STRING([--with-ocamlyacc=PATH], [location of the ocamlyacc binary]), + [OCAMLYACC="$withval"]) +AC_MSG_CHECKING([for ocamlyacc ($OCAMLYACC)]) +OCAMLYACC_VERSION=$($OCAMLYACC -version 2>/dev/null || echo foo) +case "$OCAMLYACC_VERSION" in + *$OCAMLVERSION) + AC_MSG_RESULT([ok]) + ;; + foo) + AC_MSG_RESULT([failed]) + AC_MSG_ERROR([Cannot find ocamlyacc]) + ;; + *) + AC_MSG_RESULT([failed]) + AC_MSG_ERROR([Bad ocamlyacc version]) + ;; +esac +AC_SUBST([OCAMLYACC]) #detect camlp4 @@ -136,6 +113,29 @@ case "$CAMLP4_VERSION" in esac AC_SUBST([CAMLP4]) +#detect ocamlbuild +OCAMLBUILD=ocamlbuild +AC_ARG_WITH([ocamlbuild], + AS_HELP_STRING([--with-ocamlbuild=PATH], [location of the ocamlbuild binary]), + [CAMLP4="$withval"]) +AC_MSG_CHECKING([for ocamlbuild ($OCAMLBUILD)]) +OCAMLBUILD_VERSION=$($OCAMLBUILD -version 2>/dev/null || echo foo) +case "$CAMLP4_VERSION" in + *$OCAMLVERSION) + AC_MSG_RESULT([ok]) + ;; + foo) + AC_MSG_RESULT([failed]) + AC_MSG_ERROR([Cannot find ocamlbuild]) + ;; + *) + AC_MSG_RESULT([failed]) + AC_MSG_ERROR([Bad ocamlbuild version]) + ;; +esac +AC_SUBST([OCAMLBUILD]) + + # platform AC_MSG_CHECKING([platform]) OCAML_PLATFORM=$(echo 'print_endline Sys.os_type;;' | ocaml -noprompt | grep '^@<:@A-Z@:>@') @@ -158,32 +158,6 @@ else AC_MSG_ERROR([Cannot find ulex.]) fi - -MENHIR=menhir -AC_ARG_WITH([menhir], - AS_HELP_STRING([--with-menhir=PATH], [location of the menhir binary]), - [MENHIR="$withval"]) - -AC_MSG_CHECKING([for menhir ($MENHIR)]) - -MENHIR_VERSION=$($MENHIR --version 2>/dev/null || echo not_found) -MENHIR_VERSION=$(echo "$MENHIR_VERSION" | cut -f 2- -d ',' | cut -f 2- -d ' ') -case "$MENHIR_VERSION" in - 'version 201'[[0-9]]*) - AC_MSG_RESULT([ok (${MENHIR_VERSION})]) - ;; - not_found) - AC_MSG_RESULT([failed]) - AC_MSG_ERROR([Cannot find menhir]) - ;; - *) - AC_MSG_RESULT([failed]) - AC_MSG_ERROR([Your version of menhir is too old (${MENHIR_VERSION})]) - ;; -esac -AC_SUBST([MENHIR]) - - AC_MSG_CHECKING([for expat]) expat_path=`$OCAMLFIND query expat 2>/dev/null` if test "$expat_path" ; then @@ -195,10 +169,8 @@ fi #compilation options #debugging mode -OCAMLFLAGS=$OCAMLFLAGS CAMLP4FLAGS=$CAMLP4FLAGS -OCAMLCFLAGS=$OCAMLCFLAGS -OCAMLOPTFLAGS=$OCAMLOPTFLAGS +OCAMLBUILDFLAGS=$OCAMLBUILDFLAGS AC_ARG_ENABLE([debug], [ --enable-debug build in debug mode], @@ -206,8 +178,8 @@ AC_ARG_ENABLE([debug], [DEBUG=no]) if test "x$DEBUG" = "xyes"; then - OCAMLFLAGS="$OCAMLFLAGS -g" - CAMLP4FLAGS="$CAMLP4FLAGS -DDEBUG" + OCAMLBUILDFLAGS="$OCAMLBUILDFLAGS -tag debug" + CAMLP4FLAGS="$CAMLP4FLAGS ppopt\(-D\) ppopt\(DEBUG\)" fi #profiling @@ -217,7 +189,7 @@ AC_ARG_ENABLE([profile], [PROFILE=no]) if test "x$PROFILE" = "xyes"; then - OCAMLOPTFLAGS="$OCAMLOPTFLAGS -p" + OCAMLBUILDFLAGS="$OCAMLBUILDFLAGS -tag profile" OCAMLC="$OCAMLFIND ocamlcp" fi @@ -228,7 +200,7 @@ AC_ARG_ENABLE([trace], [TRACE=no]) if test "x$TRACE" = "xyes"; then - CAMLP4FLAGS="$CAMLP4FLAGS -DHTMLTRACE" + CAMLP4FLAGS="$CAMLP4FLAGS ppopt\(-D\) ppopt\(HTMLTRACE\)" fi #inlining @@ -245,44 +217,13 @@ AC_ARG_ENABLE([unsafe], [UNSAFE=0]) if test "x$UNSAFE" = "xyes"; then - CAMLP4FLAGS="$CAMLP4FLAGS -unsafe" + CAMLP4FLAGS="$CAMLP4FLAGS ppopt\(-unsafe\)" fi -AC_PROG_CXX() - - -AC_SUBST([REMAKE], [./remake$EXE]) -if test ! -x "$REMAKE" -o "$REMAKE" -ot remake.cpp; then -AC_MSG_NOTICE([creating $REMAKE]) -REMAKE_LOG=build_remake.log -case $(uname -s) in -MINGW*) - $CXX -Wall -O2 -o remake.exe remake.cpp -lws2_32 > "$REMAKE_LOG" 2>&1 - if test $? != 0; then - cat "$REMAKE_LOG"; rm -f "$REMAKE_LOG"; - AC_MSG_FAILURE([failed]); - fi - ;; -*) - $CXX -Wall -O2 -o remake remake.cpp > "$REMAKE_LOG" 2>&1 - if test $? != 0; then - cat "$REMAKE_LOG"; rm -f "$REMAKE_LOG"; - AC_MSG_FAILURE([failed]); - fi - ;; -esac -rm -f "$REMAKE_LOG"; -else -AC_MSG_NOTICE([$REMAKE exists, not rebuilding]) -fi - AC_SUBST(INLINE) -AC_SUBST(OCAMLFLAGS) -AC_SUBST(OCAMLCFLAGS) -AC_SUBST(OCAMLOPTFLAGS) +AC_SUBST(OCAMLBUILDFLAGS) AC_SUBST(CAMLP4FLAGS) -AC_CONFIG_FILES(Remakefile) AC_CONFIG_FILES(Makefile) AC_OUTPUT