1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
|
dnl Process this file with autoconf to produce a configure script.
AC_INIT(guile-simplesql.c)
AC_PREREQ(2.50)
AM_INIT_AUTOMAKE(guile-simplesql,2.3.2,no-define)
AM_MAINTAINER_MODE
AM_CONFIG_HEADER(config.h)
AC_PROG_CC
AM_PROG_LIBTOOL
AC_PROG_MAKE_SET
AC_HEADER_STDC
AC_C_CONST
AC_HEADER_TIME
AC_STRUCT_TM
AC_CHECK_HEADERS(sys/time.h)
AC_CHECK_DECLS([strptime],,,
[#define _GNU_SOURCE /* Get strptime from glibc. */
#include <time.h>])
AC_CHECK_FUNCS(strdup)
AC_CHECK_FUNCS(strptime)
AH_TEMPLATE([HAVE_MYSQL], [Define to 1 if building MySQL backend.])
AH_TEMPLATE([HAVE_POSTGRESQL], [Define to 1 if building PostgreSQL backend.])
AC_CHECK_PROG(GUILE_CONFIG,guile-config,guile-config,no)
if test "$GUILE_CONFIG" = no; then
AC_MSG_ERROR([Unable to find guile-config, required for compilation]);
fi
GUILE_DIR=`guile-config info pkgdatadir`
AC_SUBST(GUILE_DIR)
GUILE_LINK=`guile-config link`
AC_SUBST(GUILE_LINK)
GUILE_COMPILE=`guile-config compile`
AC_SUBST(GUILE_COMPILE)
AC_CHECK_PROG(GUILE_SNARF,guile-snarf,guile-snarf,no)
if test "$GUILE_SNARF" = no; then
AC_MSG_ERROR([Unable to find guile-snarf, required for compilation]);
fi
### Detect database backends
BACKENDS=""
AC_CHECK_LIB(mysqlclient, mysql_init,
[AC_DEFINE(HAVE_MYSQL)
LIBS="$LIBS -lmysqlclient"
AC_LIBOBJ(simplesql-mysql)
BACKENDS="$BACKENDS MySQL"])
AC_CHECK_LIB(pq, PQsetdbLogin,
[AC_DEFINE(HAVE_POSTGRESQL)
LIBS="$LIBS -lpq"
AC_LIBOBJ(simplesql-postgresql)
BACKENDS="$BACKENDS Postgresql"])
if test "x$BACKENDS" = "x"; then
AC_MSG_ERROR([No database backends detected])
fi
## If we're creating a shared library (using libtool!), then we'll
## need to generate a list of .lo files corresponding to the .o files
## given in LIBOBJS.
LIB@&t@OBJS=`echo "$LIB@&t@OBJS" |
sed 's,\.[[^.]]* ,$U&,g;s,\.[[^.]]*$,$U&,'`
LTLIBOBJS=`echo "$LIB@&t@OBJS" |
sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
AC_SUBST(LTLIBOBJS)
AC_OUTPUT(Makefile)
### Local variables:
### mode: sh
### End:
|