summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac35
1 files changed, 30 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 8d6e9e3..81725e2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -42,11 +42,36 @@ if test "x$GCC" = "xyes" ; then
CFLAGS="$CFLAGS -pipe -Wall"
fi
-AC_CHECK_LIB([pq], [PQconnectdb])
-AC_CHECK_LIB([sqlite], [sqlite_open])
+# Check for PostgreSQL
+AC_ARG_ENABLE(postgres, AS_HELP_STRING(--disable-postgres,Don't build postgres client),
+[case "${enableval}" in
+ yes) postgres=yes ;;
+ no) postgres=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --disable-postgres) ;;
+esac],[postgres=yes])
+
+if test "x$postgres" = "xyes" ; then
+ AC_CHECK_LIB([pq], [PQconnectdb],,[AC_MSG_ERROR([*** Sorry, you have to install libpq or use --disable-postgres ***])])
+ AC_CHECK_HEADER([postgresql/libpq-fe.h],,[AC_MSG_ERROR([*** Sorry, you have to install postgresql-dev or use --disable-postgres ***])])
+fi
+
+
+AM_CONDITIONAL([POSTGRES], [test "x$postgres" = "xyes"])
+
+# Check for SQLite
+AC_ARG_ENABLE(sqlite, AS_HELP_STRING(--disable-sqlite,Don't build sqlite client),
+[case "${enableval}" in
+ yes) sqlite=yes ;;
+ no) sqlite=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --sqlite-postgres);;
+esac],[sqlite=yes])
+
+if test "x$sqlite" = "xyes" ; then
+ AC_CHECK_LIB([sqlite], [sqlite_open],,[AC_MSG_ERROR([*** Sorry, you have to install libsqlite or use --disable-sqlite ***])])
+ AC_CHECK_HEADER([sqlite.h],,[AC_MSG_ERROR([*** Sorry, you have to install libsqlite-dev or use --disable-sqlite ***])])
+fi
-AM_CONDITIONAL([POSTGRES], [true])
-AM_CONDITIONAL([SQLITE], [true])
+AM_CONDITIONAL([SQLITE], [test "x$sqlite" = "xyes"])
# Checks for header files.
AC_HEADER_STDC
@@ -85,5 +110,5 @@ fi
AM_CONDITIONAL([USE_LYNX], [test "x$lynx" = xyes])
-AC_CONFIG_FILES([src/Makefile Makefile]) # conf/Makefile doc/Makefile doc/README.html])
+AC_CONFIG_FILES([src/Makefile Makefile doc/Makefile doc/README.html php/Makefile sql/Makefile])
AC_OUTPUT