X-Git-Url: http://git.nguyen.vg/gitweb/?p=tatoo.git;a=blobdiff_plain;f=configure.in;h=34a9e31f994106f9e0bdc34652b48133acb87ca2;hp=fd2059ec8bd2ed42810250477720a4914bcf35bf;hb=91d60f0cf46661abde8df94fead3688ec43a2db9;hpb=b57556aee8b43d71a919decb9682dd293aba4933 diff --git a/configure.in b/configure.in index fd2059e..34a9e31 100644 --- a/configure.in +++ b/configure.in @@ -3,7 +3,6 @@ AC_INIT([TAToo], [Kim Nguyễn ], [tatoo]) - #detect ocamlfind OCAMLFIND=ocamlfind AC_ARG_WITH([ocamlfind], @@ -69,49 +68,50 @@ esac AC_SUBST(OCAMLVERSION) +dnl ocamlyacc and ocamllex are not needed #detect ocamlyacc -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 ocamllex -OCAMLLEX=ocamllex -AC_ARG_WITH([ocamllex], - AS_HELP_STRING([--with-ocamllex=PATH], [location of the ocamllex binary]), - [OCAMLLEX="$withval"]) -AC_MSG_CHECKING([for ocamllex ($OCAMLLEX)]) -OCAMLLEX_VERSION=$($OCAMLLEX -version 2>/dev/null || echo foo) -case "$OCAMLLEX_VERSION" in - *$OCAMLVERSION) - AC_MSG_RESULT([ok]) - ;; - foo) - AC_MSG_RESULT([failed]) - AC_MSG_ERROR([Cannot find ocamllex]) - ;; - *) - AC_MSG_RESULT([failed]) - AC_MSG_ERROR([Bad ocamllex version]) - ;; -esac -AC_SUBST([OCAMLLEX]) +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]) #detect camlp4 @@ -158,6 +158,32 @@ 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 @@ -229,16 +255,24 @@ 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 - if test $? != 0; then AC_MSG_FAILURE([failed]); fi + $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 - if test $? != 0; then 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