diff -Nur atheme-1.2.1.orig/configure.ac atheme-1.2.1/configure.ac --- atheme-1.2.1.orig/configure.ac 2006-07-10 13:23:14.000000000 +0000 +++ atheme-1.2.1/configure.ac 2006-10-22 11:52:40.281188612 +0000 @@ -196,43 +196,61 @@ POSTGRESQL="yes" -AC_MSG_CHECKING(for PostgreSQL include directory) -if test -d /usr/include/pgsql ; then - pg_inc_dir="/usr/include/pgsql" -elif test -f /usr/local/include/libpq-fe.h ; then -# kludge for freebsd ports, found on liveharmony boxes. --nenolod - pg_inc_dir="/usr/local/include" - LDFLAGS="-L/usr/local/lib" -elif test -d /usr/include/postgresql ; then - pg_inc_dir="/usr/include/postgresql" -elif test -d /usr/local/psql/include ; then - pg_inc_dir="/usr/local/psql/include" -elif test -d /usr/local/include/postgresql ; then - pg_inc_dir="/usr/local/include/postgresql" -elif test -d /usr/local/pgsql/include ; then - pg_inc_dir="/usr/local/pgsql/include" -elif test -d /usr/local/include/psql ; then - pg_inc_dir="/usr/local/include/psql" -elif test -d /opt/psql/include ; then - pg_inc_dir="/opt/psql/include" -else - pg_inc_dir="no" - PQLIB="" - POSTGRESQL="no" -fi +AC_ARG_ENABLE(postgresql, +AC_HELP_STRING([--enable-postgresql], [Enables PostgreSQL backend support.]), +[ + case "$enableval" in + yes|no) + POSTGRESQL="$enableval" + ;; + *) + AC_MSG_ERROR([Invalid argument to --enable-postgresql (expecting either 'yes' or 'no')]) + ;; + esac +]) + +AC_MSG_CHECKING([whether to enable PostgreSQL backend support]) +AC_MSG_RESULT($POSTGRESQL) + +if test "x$POSTGRESQL" = xyes; then + AC_MSG_CHECKING(for PostgreSQL include directory) + if test -d /usr/include/pgsql ; then + pg_inc_dir="/usr/include/pgsql" + elif test -f /usr/local/include/libpq-fe.h ; then + # kludge for freebsd ports, found on liveharmony boxes. --nenolod + pg_inc_dir="/usr/local/include" + LDFLAGS="-L/usr/local/lib" + elif test -d /usr/include/postgresql ; then + pg_inc_dir="/usr/include/postgresql" + elif test -d /usr/local/psql/include ; then + pg_inc_dir="/usr/local/psql/include" + elif test -d /usr/local/include/postgresql ; then + pg_inc_dir="/usr/local/include/postgresql" + elif test -d /usr/local/pgsql/include ; then + pg_inc_dir="/usr/local/pgsql/include" + elif test -d /usr/local/include/psql ; then + pg_inc_dir="/usr/local/include/psql" + elif test -d /opt/psql/include ; then + pg_inc_dir="/opt/psql/include" + else + pg_inc_dir="no" + PQLIB="" + POSTGRESQL="no" + fi -POSTGRESQL_C="" + POSTGRESQL_C="" -AC_MSG_RESULT($pg_inc_dir) + AC_MSG_RESULT($pg_inc_dir) -if test "$pg_inc_dir" != "no"; then - AC_CHECK_HEADER($pg_inc_dir/libpq-fe.h, [ - PGINC="-I$pg_inc_dir" - AC_CHECK_LIB(pq, PQconnectdb, [PQLIB="-lpq" - POSTGRESQL_C="postgresql.c"]) - ]) -else - POSTGRESQL="no" + if test "$pg_inc_dir" != "no"; then + AC_CHECK_HEADER($pg_inc_dir/libpq-fe.h, [ + PGINC="-I$pg_inc_dir" + AC_CHECK_LIB(pq, PQconnectdb, [PQLIB="-lpq" + POSTGRESQL_C="postgresql.c"]) + ]) + else + POSTGRESQL="no" + fi fi AC_SUBST(POSTGRESQL_C)