X-Git-Url: http://git.nguyen.vg/gitweb/?p=tatoo.git;a=blobdiff_plain;f=configure.in;h=5bcb4c0594674d498dfa779241bf2656f05b52e2;hp=fb0932705134e67509d66c951151d7cb512a4e52;hb=3406b26f1ea26a997d7f194c547439891c108ce6;hpb=8af68de11421dacc2f77a8398dcb48c75a5ff3b1 diff --git a/configure.in b/configure.in index fb09327..5bcb4c0 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], @@ -150,8 +149,8 @@ AC_SUBST(EXE) # required libraries AC_MSG_CHECKING([for ulex]) -$OCAMLFIND query ulex >/dev/null 2>&1 -if test $? ; then +ulex_path=`$OCAMLFIND query ulex 2>/dev/null` +if test "$ulex_path" ; then AC_MSG_RESULT([found]) else AC_MSG_RESULT([not found]) @@ -159,12 +158,12 @@ else fi AC_MSG_CHECKING([for expat]) -$OCAMLFIND query ulex >/dev/null 2>&1 -if test $? ; then +expat_path=`$OCAMLFIND query expat 2>/dev/null` +if test "$expat_path" ; then AC_MSG_RESULT([found]) else AC_MSG_RESULT([not found]) - AC_MSG_ERROR([Cannot find ulex.]) + AC_MSG_ERROR([Cannot find expat.]) fi #compilation options @@ -229,16 +228,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 @@ -250,4 +257,5 @@ AC_SUBST(OCAMLCFLAGS) AC_SUBST(OCAMLOPTFLAGS) AC_SUBST(CAMLP4FLAGS) AC_CONFIG_FILES(Remakefile) +AC_CONFIG_FILES(Makefile) AC_OUTPUT