dnl Process this file with autoconf to produce a configure script. AC_INIT(drivers/sqlite/dbd_sqlite.c) AM_MAINTAINER_MODE AM_INIT_AUTOMAKE(libdbi-drivers, 0.8.1) AM_CONFIG_HEADER(config.h) dnl library versioning currently unnecessary... dnl dnl Library versioning dnl LIB_CURRENT=0 dnl LIB_REVISION=4 dnl LIB_AGE=0 dnl AC_SUBST(LIB_CURRENT) dnl AC_SUBST(LIB_REVISION) dnl AC_SUBST(LIB_AGE) AC_CANONICAL_HOST driverdir=$libdir/dbd AC_SUBST(driverdir) dnl ==================================== dnl Check for programs dnl ==================================== AC_PROG_CC AC_PROG_CPP AC_PROG_LD AC_PROG_INSTALL AM_PROG_LIBTOOL dnl ==================================== dnl Set some general compile options dnl ==================================== if test -z "$GCC"; then case $host in *-*-irix*) if test -z "$CC"; then CC=cc fi DEBUG="-g -signed" CFLAGS="-O2 -w -signed" PROFILE="-p -g3 -O2 -signed" ;; sparc-sun-solaris*) DEBUG="-v -g" CFLAGS="-xO4 -fast -w -fsimple -native -xcg92" PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc" ;; *) DEBUG="-g" CFLAGS="-O" PROFILE="-g -p" ;; esac else case $host in *-*-linux*) DEBUG="-g -Wall -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char" CFLAGS="-O20 -ffast-math -D_REENTRANT -fsigned-char" PROFILE="-pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char";; sparc-sun-*) DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char -mv8" CFLAGS="-O20 -ffast-math -D__NO_MATH_INLINES -fsigned-char -mv8" PROFILE="-pg -g -O20 -D__NO_MATH_INLINES -fsigned-char -mv8" ;; *) DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char" CFLAGS="-O20 -D__NO_MATH_INLINES -fsigned-char" PROFILE="-O20 -g -pg -D__NO_MATH_INLINES -fsigned-char" ;; esac fi AC_SUBST(DEBUG) AC_SUBST(PROFILE) case $host in *-*-*bsd*) dlopen_flag="RTLD_LAZY" ;; *) dlopen_flag="RTLD_NOW" ;; esac AC_DEFINE_UNQUOTED(DLOPEN_FLAG, $dlopen_flag, [ Specifies the mode of dlopen behavior ]) dnl ============================== dnl Check for libraries dnl ============================== dnl start test dnl functions to load dynamic libraries use_ltdl=no AC_ARG_WITH(ltdl, [ --with-ltdl Use libtool's libltdl to load runtime modules [no]], [ use_ltdl=$withval ]) if test "x$use_ltdl" = xyes; then AC_CHECK_HEADERS([ltdl.h], [AC_CHECK_LIB([ltdl],[lt_dlopen],[LIBADD_DL=-lltdl])]) else AC_CHECK_HEADERS([mach-o/dyld.h],[AC_CHECK_FUNCS([NSLinkModule], [ LIBADD_DL="" dlsym_prefix=_ ])], [ AC_CHECK_HEADERS([dlfcn.h]) AC_CHECK_FUNCS([dlopen],[LIBADD_DL=], [AC_CHECK_LIB([dl],[dlopen],[LIBADD_DL=-ldl],[])])]) fi AC_SUBST(LIBADD_DL) dnl end test dnl framework and database engine client libraries AC_CHECK_DBI AC_CHECK_MYSQL AC_CHECK_PGSQL AC_CHECK_SQLITE AC_CHECK_SQLITE3 AC_CHECK_MSQL AC_CHECK_ORACLE AC_CHECK_FIREBIRD_INTERBASE AC_CHECK_FREETDS dnl ============================== dnl Check for functions dnl ============================== case $host in *-*-win32*) shlib_ext=.dll ;; *-*-cygwin*) shlib_ext=.dll ;; *-*-mingw32*) shlib_ext=.dll ;; *) shlib_ext=.so ;; esac AC_ARG_WITH(shlib-ext, [ --with-shlib-ext Specifies the filename extension of loadable modules (usually not necessary).], [ shlib_ext=$withval ]) AC_DEFINE_UNQUOTED(DRIVER_EXT, "$shlib_ext", [ Specifies the filename extension of loadable modules ]) AC_CHECK_FUNCS(strtoll) AC_REPLACE_FUNCS(atoll) dnl i think we'll eventually get an error here... AC_CHECK_FUNCS(vasprintf) AC_REPLACE_FUNCS(asprintf) dnl ============================== dnl Checks for header files dnl ============================== AC_CHECK_HEADERS(string.h strings.h) AC_OUTPUT([ libdbi.spec Makefile drivers/Makefile drivers/mysql/Makefile drivers/pgsql/Makefile drivers/sqlite/Makefile drivers/sqlite3/Makefile drivers/msql/Makefile drivers/oracle/Makefile drivers/firebird/Makefile drivers/freetds/Makefile tests/Makefile ]) dnl doc/Makefile echo "If make check fails with a linker error, reconfigure with --with-ltdl" if test "$ac_mysql" = "NO" && test "$ac_pgsql" = "NO" && test "$ac_sqlite" = "NO" && test "$ac_sqlite3" = "NO" && test "$ac_msql" = "NO" && test "$ac_oracle" = "NO" && test "$ac_firebird" = "NO" && test "$ac_freetds" = "NO"; then echo "" echo "***WARNING***" echo "You did not request any drivers to be built. This is most likely not what you want. Please run ./configure --help for a list of switches and select at least one driver." fi