# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) AC_INIT(libcpjit, 0, libcpjit@schmorp.de) AC_CONFIG_SRCDIR([cpjit.h]) AC_CONFIG_HEADER([config.h]) # Checks for programs. AC_PROG_CXX # Checks for libraries. AC_ARG_WITH(db, [ --with-db=PATH Specify path to BerkelyDB install directory ], [ if test "x$withval" != "xno" ; then if test -d "$withval/lib"; then LDFLAGS="-L${withval}/lib $LDFLAGS" else LDFLAGS="-L${withval} $LDFLAGS" fi if test -d "$withval/include"; then CPPFLAGS="-I${withval}/include $CPPFLAGS" else CPPFLAGS="-I${withval} $CPPFLAGS" fi fi ], [ AC_EGREP_HEADER([DB_VERSION_MAJOR *3|4], [db.h],, AC_MSG_ERROR([No suitable BerkeleyDB db.h header file found. Use --with-db=PATH to specify the path to a version 3 or later install directory. You can download BerkeleyDB from http://www.sleepycat.com] ) ) ] ) AC_TRY_LINK_FUNC(db_create,, AC_CHECK_LIB(db-4, db_create, LIBS="$LIBS -ldb-4", AC_CHECK_LIB(db-3, db_create, LIBS="$LIBS -ldb-3", AC_CHECK_LIB(db-2, db_create, LIBS="$LIBS -ldb-2", AC_CHECK_LIB(db, db_create, LIBS="$LIBS -ldb", AC_CHECK_LIB(db3, db_create, LIBS="$LIBS -ldb3", AC_CHECK_LIB(db-3.1, db_create, LIBS="$LIBS -ldb-3.1", AC_CHECK_LIB(db4, db_create, LIBS="$LIBS -ldb4", AC_MSG_ERROR([No suitable BerkeleyDB library found. Use --with-db=PATH to specify the path to a version 3 or later install directory. You can download BerkeleyDB from http://www.sleepycat.com]))))))))) # Checks for header files. # Checks for typedefs, structures, and compiler characteristics. AC_CONFIG_FILES(Makefile) AH_BOTTOM([ #if SIZEOF_CHAR == 1 # define TYPE_INT8 char #else # error no 8-bit type found #endif #if SIZEOF_SHORT == 2 # define TYPE_INT16 short #elif SIZEOF_INT == 2 # define TYPE_INT16 int #else # error no 16-bit type found #endif #if SIZEOF_INT == 4 # define TYPE_INT32 int #elif SIZEOF_LONG == 4 # define TYPE_INT32 long #else # error no 32-bit type found #endif #if SIZEOF_INT == 8 # define TYPE_INT64 short #elif SIZEOF_LONG == 8 # define TYPE_INT64 long #elif SIZEOF_LONG_LONG == 8 # define TYPE_INT64 long long #else # error no 64-bit type found #endif ]) AC_CHECK_SIZEOF(char) AC_CHECK_SIZEOF(short) AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(long long) # Checks for library functions. AC_OUTPUT