# $Id: options.ac,v 1.32 2006/06/13 19:32:29 gmf Exp $ # Process user-specified options. AC_DEFUN(AM_OPTIONS_SET, [ AC_MSG_CHECKING(if --enable-debug option specified) AC_ARG_ENABLE(debug, [AC_HELP_STRING([--enable-debug], [Build a debugging version.])], [db_cv_debug="$enable_debug"], [db_cv_debug="no"]) AC_MSG_RESULT($db_cv_debug) AC_MSG_CHECKING(if --enable-profile option specified) AC_ARG_ENABLE(profile, [AC_HELP_STRING([--enable-profile], [Build a profiling version.])], [db_cv_profile="$enable_profile"], [db_cv_profile="no"]) AC_MSG_RESULT($db_cv_profile) AC_MSG_CHECKING(if --enable-dependencies option specified) AC_ARG_ENABLE(dependencies, [AC_HELP_STRING([--enable-dependencies], [Build include dependencies.])], [db_cv_depend="$enable_dependencies"], [db_cv_depend="no"]) AC_MSG_RESULT($db_cv_depend) AC_MSG_CHECKING(if --enable-diagnostic option specified) AC_ARG_ENABLE(diagnostic, [AC_HELP_STRING([--enable-diagnostic], [Build a version with run-time diagnostics.])], [db_cv_diagnostic="$enable_diagnostic"], [db_cv_diagnostic="no"]) AC_MSG_RESULT($db_cv_diagnostic) AC_MSG_CHECKING(if --enable-java option specified) AC_ARG_ENABLE(java, [AC_HELP_STRING([--enable-java], [Build Java API.])], [db_cv_java="$enable_java"], [db_cv_java="no"]) AC_MSG_RESULT($db_cv_java) AC_MSG_CHECKING(if --enable-tcl option specified) AC_ARG_ENABLE(tcl, [AC_HELP_STRING([--enable-tcl], [Build Tcl API.])], [db_cv_tcl="$enable_tcl"], [db_cv_tcl="no"]) AC_MSG_RESULT($db_cv_tcl) AC_MSG_CHECKING(if --enable-test option specified) AC_ARG_ENABLE(test, [AC_HELP_STRING([--enable-test], [Configure to run the test suite.])], [db_cv_test="$enable_test"], [db_cv_test="no"]) AC_MSG_RESULT($db_cv_test) AC_MSG_CHECKING([if --with-berkeleydb=DIR option specified]) AC_ARG_WITH(berkeleydb, [AC_HELP_STRING([--with-berkeleydb=DIR], [Path of Berkeley DB. [DIR="/usr/local/BerkeleyDB.@DB_VERSION_MAJOR@.@DB_VERSION_MINOR@"]])], [with_berkeleydb="$withval"], [with_berkeleydb="no"]) AC_MSG_RESULT($with_berkeleydb) # If --with-berkeleydb isn't specified, assume it's here | wc -l` -gt 0 if test "$with_berkeleydb" = "no"; then with_berkeleydb="/usr/local/BerkeleyDB.@DB_VERSION_MAJOR@.@DB_VERSION_MINOR@" fi with_berkeleydb=`cd $with_berkeleydb && pwd` if test `ls "$with_berkeleydb"/lib/libdb_cxx-*.la 2>/dev/null | wc -l` -gt 0 ; then AC_MSG_CHECKING([for Berkeley DB version from install tree]) db_version=`ls "$with_berkeleydb"/lib/libdb_cxx-*.la | sed 's/.*db_cxx-\(.*\).la/\1/'` AC_MSG_RESULT([$db_version]) if test "$db_version" != "4.3" && test "$db_version" != "4.4" && test "$db_version" != "4.5"; then AC_MSG_ERROR([$with_berkeleydb is version $db_version, which is not a supported version of Berkeley DB. The version must be at least 4.3]) fi echo "$CPPFLAGS" | grep "$with_berkeleydb/include" >/dev/null 2>&1 || CPPFLAGS="$CPPFLAGS -I$with_berkeleydb/include" LIBS="$LIBS $with_berkeleydb/lib/libdb_cxx-$db_version.la" # find test lib locations, if specified, and possible # it could be safer to require that --with-berkeleydb point to a build # tree when --enable test is set, but that's not the case right now # Use --with-dbbuild, if specified. Also look in ../lib/db-* for a build tree. # If all of this fails, put strings in the file to make it obvious how to edit. if test "$db_cv_test" = "yes"; then AC_SUBST(DB_TCLLIB) AC_SUBST(DB_TEST_PATH) AC_SUBST(DB_UTIL_PATH) if test "${with_dbbuild+set}" = set && test -d $with_dbbuild/test; then DB_TCLLIB="$with_dbbuild/build_unix/.libs/libdb_tcl-$db_version" DB_TEST_PATH="$with_dbbuild/test" DB_UTIL_PATH="$with_dbbuild/build_unix" else if test `ls -d ../lib/db-* 2>/dev/null | wc -l` -eq 1; then dbdir=`ls -d ../lib/db-*` DB_TCLLIB="$dbdir/build_unix/.libs/libdb_tcl-$db_version" DB_TEST_PATH="$dbdir/test" DB_UTIL_PATH="$dbdir/build_unix" else DB_TCLLIB="/libdb_tcl-$db_version" DB_TEST_PATH="/test" DB_UTIL_PATH="/build_unix" fi fi fi ADDITIONAL_CLASSPATH="$ADDITIONAL_CLASSPATH:$with_berkeleydb/lib/db.jar" elif test `ls "$with_berkeleydb"/build_unix/libdb_cxx-*.la 2>/dev/null | wc -l` -gt 0 ; then AC_MSG_CHECKING([for Berkeley DB version from build tree]) db_version=`ls "$with_berkeleydb"/build_unix/libdb_cxx-*.la | sed 's/.*db_cxx-\(.*\).la/\1/'` AC_MSG_RESULT([$db_version]) CPPFLAGS="$CPPFLAGS -I$with_berkeleydb/build_unix -I$with_berkeleydb -I$with_berkeleydb/dbinc" LIBS="$LIBS -L$with_berkeleydb/build_unix -ldb_cxx-$db_version" AC_SUBST(DB_TCLLIB) DB_TCLLIB="$with_berkeleydb/build_unix/.libs/libdb_tcl-$db_version" AC_SUBST(DB_TEST_PATH) DB_TEST_PATH="$with_berkeleydb/test" AC_SUBST(DB_UTIL_PATH) DB_UTIL_PATH="$with_berkeleydb/build_unix" ADDITIONAL_CLASSPATH="$ADDITIONAL_CLASSPATH:$with_berkeleydb/build_unix/db.jar" elif test `ls "$with_berkeleydb"/build_unix/libdb_cxx-*.a 2>/dev/null | wc -l` -gt 0 ; then AC_MSG_CHECKING([for Berkeley DB version from build tree]) db_version=`ls "$with_berkeleydb"/build_unix/libdb_cxx-*.a | sed 's/.*db_cxx-\(.*\).a/\1/'` AC_MSG_RESULT([$db_version]) CPPFLAGS="$CPPFLAGS -I$with_berkeleydb/build_unix -I$with_berkeleydb -I$with_berkeleydb/dbinc" LIBS="$LIBS -L$with_berkeleydb/build_unix -ldb_cxx-$db_version" AC_SUBST(DB_TCLLIB) DB_TCLLIB="$with_berkeleydb/build_unix/.libs/libdb_tcl-$db_version" AC_SUBST(DB_TEST_PATH) DB_TEST_PATH="$with_berkeleydb/test" AC_SUBST(DB_UTIL_PATH) DB_UTIL_PATH="$with_berkeleydb/build_unix" ADDITIONAL_CLASSPATH="$ADDITIONAL_CLASSPATH:$with_berkeleydb/build_unix/db.jar" else AC_MSG_ERROR([$with_berkeleydb not a valid Berkeley DB tree. Note that Berkeley DB must be configured and built with '--enable-cxx'.]) fi DB_DIR=$with_berkeleydb # Check for XQilla AC_MSG_CHECKING([if --with-xqilla=DIR option specified]) AC_ARG_WITH(xqilla, [AC_HELP_STRING([--with-xqilla=DIR], [Path of XQilla. [DIR="@XQILLA_HOME@"]])], [with_xqilla="$withval"], [with_xqilla="no"]) AC_MSG_RESULT($with_xqilla) if test "$with_xqilla" = "no"; then with_xqilla="@XQILLA_HOME@" fi with_xqilla=`cd $with_xqilla && pwd` # Try as an install directory if test `ls "$with_xqilla"/lib/libxqilla*.la 2>/dev/null | wc -l` -gt 0 ; then echo "$CPPFLAGS" | grep "$with_xqilla/include" >/dev/null 2>&1 || CPPFLAGS="$CPPFLAGS -I$with_xqilla/include" LIBS="$LIBS -L$with_xqilla/lib -lxqilla" # Try as a source directory, built in the top level directory elif test `ls "$with_xqilla"/libxqilla*.la 2>/dev/null | wc -l` -gt 0 ; then # If we have been given a build directory inside the XQilla top # level directory, then we need the include directory that is # a child of our parent directory if test -d "$with_xqilla"/../include; then CPPFLAGS="$CPPFLAGS -I$with_xqilla/../include" else CPPFLAGS="$CPPFLAGS -I$with_xqilla/include" fi LIBS="$LIBS -L$with_xqilla -lxqilla" else AC_MSG_ERROR([XQilla is required to build DB XML. $with_xqilla is not a valid XQilla tree (maybe it has not been compiled). You should specify the path where XQilla is installed with --with-xqilla.]) fi XQILLA_DIR=$with_xqilla AC_MSG_CHECKING([if --with-xerces=DIR option specified]) AC_ARG_WITH(xerces, [AC_HELP_STRING([--with-xerces=DIR], [Path of Xerces. [DIR="@XERCES_UNIXHOME@"]])], [with_xerces="$withval"], [with_xerces="no"]) AC_MSG_RESULT($with_xerces) if test "$with_xerces" = "no"; then with_xerces="@XERCES_UNIXHOME@" fi # specifically test for 2.6 or 2.7. This needs to change as releases change if test `ls $with_xerces/lib/libxerces-c.*2[[6-7]].* 2>/dev/null | wc -l` -gt 0 ; then AC_MSG_CHECKING([for Xerces C++ version from install tree]) xerces_version=`ls "$with_xerces"/lib/libxerces-c.*[[0-9]][[0-9]].* | tail -1 | sed 's/.*xerces-c.*\([[0-9]]\)\([[0-9]]\).*/\1.\2/'` with_xerces=`cd $with_xerces && pwd` echo "$CPPFLAGS" | grep "$with_xerces/include" >/dev/null 2>&1 || CPPFLAGS="$CPPFLAGS -I$with_xerces/include" LIBS="$LIBS -L$with_xerces/lib -R$with_xerces/lib -lxerces-c" AC_MSG_RESULT([$xerces_version]) elif test `ls $with_xerces/lib/libxerces-c*2[[6-7]].* 2>/dev/null | wc -l` -gt 0 ; then AC_MSG_CHECKING([for Xerces C++ version from install tree]) xerces_version=`ls "$with_xerces"/lib/libxerces-c*[[0-9]][[0-9]].* | tail -1 | sed 's/.*xerces-c*\([[0-9]]\)\([[0-9]]\).*/\1.\2/'` with_xerces=`cd $with_xerces && pwd` echo "$CPPFLAGS" | grep "$with_xerces/include" >/dev/null 2>&1 || CPPFLAGS="$CPPFLAGS -I$with_xerces/include" LIBS="$LIBS -L$with_xerces/lib -R$with_xerces/lib -lxerces-c" AC_MSG_RESULT([$xerces_version]) else AC_MSG_ERROR([Xerces-C++ is required to build DB XML. $with_xerces not a valid, supported Xerces tree (maybe it has not been compiled). You should specify the path where Xerces is installed with --with-xerces.]) fi XERCES_DIR=$with_xerces AC_MSG_CHECKING([if --with-tcl=DIR option specified]) AC_ARG_WITH(tcl, [AC_HELP_STRING([--with-tcl=DIR], [Directory location of tclConfig.sh.])], [with_tclconfig="$withval"], [with_tclconfig="no"]) AC_MSG_RESULT($with_tclconfig) if test "$with_tclconfig" != "no"; then db_cv_tcl="yes" BUILD_TCL_TARGET="tcl_build" INSTALL_TCL_TARGET='$(libtso_target)' fi if test "$db_cv_java" != "no"; then BUILD_JAVA_TARGET="java" INSTALL_JAVA_TARGET='$(libjso_target)' fi # Test requires Tcl if test "$db_cv_test" = "yes"; then if test "$db_cv_tcl" = "no"; then AC_MSG_ERROR([--enable-test requires --enable-tcl]) fi BUILD_TEST_TARGET="test_build" fi]) AC_SUBST(BUILD_TCL_TARGET) AC_SUBST(INSTALL_TCL_TARGET) AC_SUBST(BUILD_TEST_TARGET) AC_SUBST(BUILD_JAVA_TARGET) AC_SUBST(INSTALL_JAVA_TARGET)