[Kim Nguyễn <kn@lri.fr>],
[tatoo])
-
#detect ocamlfind
OCAMLFIND=ocamlfind
AC_ARG_WITH([ocamlfind],
# 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])
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
#debugging mode
-OCAMLFLAGS=$OCAMLFLAGS
CAMLP4FLAGS=$CAMLP4FLAGS
-OCAMLCFLAGS=$OCAMLCFLAGS
-OCAMLOPTFLAGS=$OCAMLOPTFLAGS
+OCAMLBUILDFLAGS=$OCAMLBUILDFLAGS
AC_ARG_ENABLE([debug],
[ --enable-debug build in debug mode],
[DEBUG=no])
if test "x$DEBUG" = "xyes"; then
- OCAMLFLAGS="$OCAMLFLAGS -g"
- CAMLP4FLAGS="$CAMLP4FLAGS -DDEBUG"
+ OCAMLBUILDFLAGS="$OCAMLBUILDFLAGS -tag debug"
+ CAMLP4FLAGS="$CAMLP4FLAGS -D DEBUG"
fi
#profiling
[PROFILE=no])
if test "x$PROFILE" = "xyes"; then
- OCAMLOPTFLAGS="$OCAMLOPTFLAGS -p"
+ OCAMLBUILDFLAGS="$OCAMLBUILDFLAGS -tag profile"
OCAMLC="$OCAMLFIND ocamlcp"
fi
[TRACE=no])
if test "x$TRACE" = "xyes"; then
- CAMLP4FLAGS="$CAMLP4FLAGS -DHTMLTRACE"
+ CAMLP4FLAGS="$CAMLP4FLAGS -D HTMLTRACE"
fi
#inlining
fi
-AC_PROG_CXX()
-
-
-AC_SUBST([REMAKE], [./remake$EXE])
-if test ! -x "$REMAKE" -o "$REMAKE" -ot remake.cpp; then
-AC_MSG_NOTICE([creating $REMAKE])
-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 remake.cpp
- if test $? != 0; then AC_MSG_FAILURE([failed]); fi
- ;;
-esac
-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