AC_INIT(monotone-viz, 0.15) AC_PROG_OCAML AC_PROG_OCAML_TOOLS AC_PROG_CAMLP4 if test -z "$CAMLP4O" ; then AC_MSG_ERROR([ Could not find camlp4o. Camlp4 is required to build monotone-viz.]) fi AC_ARG_PROGRAM # Check LablGTK AC_ARG_VAR(LABLGTK_DIR,[LablGTK location]) AC_ARG_WITH([lablgtk-dir], AS_HELP_STRING([--with-lablgtk-dir=], [specify location of lablgtk library]), LABLGTK_DIR=$withval) AC_ARG_WITH([local-lablgtk], AS_HELP_STRING([--without-local-lablgtk], [do not use the local copy of lablgtk]), LOCAL_LABLGTK=$withval, LOCAL_LABLGTK=maybe) AC_SUBST(LOCAL_LABLGTK) # Check if the local lablgtk is present and wether to use it if test "$LOCAL_LABLGTK" = "yes" ; then if ! test -d "lablgtk" ; then AC_MSG_ERROR([ Could not find the local LablGTK tree.]) fi elif test "$LOCAL_LABLGTK" = "maybe" ; then if test -d "lablgtk" ; then LOCAL_LABLGTK=yes else LOCAL_LABLGTK=no fi else LOCAL_LABLGTK=no fi if test "$LOCAL_LABLGTK" = "no" ; then FINDLIB_LABLGTK="$(ocamlfind query lablgtk2 2> /dev/null)" AC_CHECK_OCAML_MODULE(lablgtk, LABLGTK_DIR, GFile, +lablgtk2 +lablgtk ${FINDLIB_LABLGTK}) # Stop if LablGTK is not found if test -z "$LABLGTK_DIR" ; then AC_MSG_ERROR([ Could not find LablGTK. Make sure LablGTK >= 2.4.0 is installed and specify its location to configure with the `--with-lablgtk-dir=' option or the LABLGTK_DIR environment variable.]) fi LABLGTK_DIR="$(echo $LABLGTK_DIR | sed "s@^+@$OCAMLLIB/@")" # Check if LablGTK was compiled with libgnomecanvas support AC_MSG_CHECKING([GnomeCanvas support]) if test -r "$LABLGTK_DIR/lablgnomecanvas.cma" ; then AC_MSG_RESULT(found) else AC_MSG_ERROR([ libgnomecanvas support not found. LablGTK need to be built with GnomeCanvas support.]) fi # Check if LablGTK is natively compiled if test -r "$LABLGTK_DIR/lablgtk.cmxa" -a -r "$LABLGTK_DIR/lablgnomecanvas.cmxa"; then echo [Using the native code compiler] else echo [Using the byte code compiler] OCAMLBEST=byte fi else echo echo echo [CONFIGURING LOCAL LABLGTK] echo echo cd lablgtk ./configure --without-gl --without-glade --without-rsvg --with-gnomecanvas --without-gnomeui --without-panel --without-gtkspell cd .. echo echo echo [DONE CONFIGURING LOCAL LABLGTK] echo echo fi # Check the sqlite3 sources AC_ARG_WITH([monotone-dir], AS_HELP_STRING([--with-monotone-dir=], [specify location of monotone build tree]), MONOTONE_DIR=$withval, MONOTONE_DIR=monotone) AC_ARG_WITH([shared-sqlite], AS_HELP_STRING([--without-shared-sqlite], [use a system-wide shared sqlite library]), SHARED_SQLITE=$withval, SHARED_SQLITE=maybe) if test "$SHARED_SQLITE" = "yes" -o '(' "$SHARED_SQLITE" = "maybe" -a ! -d "$MONOTONE_DIR" ')' ; then # Actually we need at least 3.2.2 but the micro number isn't in the # pkgconfig file (sigh) PKG_CHECK_MODULES(SQLITE, sqlite3 >= 3.2, SHARED_SQLITE=yes, if test "$SHARED_SQLITE" = "yes" ; then AC_MSG_ERROR([ Couldn't find the shared sqlite package.]) ; fi) fi if test "$SHARED_SQLITE" != "yes" ; then AC_MSG_CHECKING(monotone's sqlite) if test -d "$MONOTONE_DIR" -a -r "$MONOTONE_DIR/sqlite/lib3rdparty_a-main.o" ; then AC_MSG_RESULT(found in $MONOTONE_DIR/sqlite) else AC_MSG_ERROR([ Could not find compiled sqlite sources. Monotone-viz needs a compiled monotone tree for the sqlite library. Create a link named `monotone' or specify the location to configure using the `--with-monotone-dir=' option.]) fi if test "${MONOTONE_DIR:0:1}" != "/" ; then MONOTONE_DIR="$(pwd)/$MONOTONE_DIR" fi fi AC_SUBST(MONOTONE_DIR) # Check for libcrypto using pkg-config, defaulting to /usr/lib AC_MSG_CHECKING(OpenSSL's crypto lib) CRYPTO_LIB_DIR="$(pkg-config openssl --variable=libdir)" CRYPTO_LIB="${CRYPTO_LIB_DIR:-/usr/lib}/libcrypto.a" AC_MSG_RESULT($CRYPTO_LIB) AC_SUBST(CRYPTO_LIB) # Keep CPPFLAGS around, can be useful if caml headers are in a # non-standard location. AC_SUBST(CPPFLAGS) AC_OUTPUT(config.make)