diff -Nup -r atheme-0.2.2/configure.ac atheme-0.2.2.patched/configure.ac --- atheme-0.2.2/configure.ac 2005-09-03 21:17:30.000000000 +0000 +++ atheme-0.2.2.patched/configure.ac 2005-09-04 02:16:20.000000000 +0000 @@ -95,43 +95,61 @@ echo " " 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/include/psql" -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_WITH(postgresql, +AC_HELP_STRING([--with-postgresql],[ Enables PostgreSQL backend support.]), +[ + case "$withval" in + yes|no) + POSTGRESQL="$withval" + ;; + *) + AC_MSG_ERROR([Invalid argument to --with-postgresql (expecting either 'yes' or 'no')]) + ;; + esac +]) -POSTGRESQL_C="" +AC_MSG_CHECKING([whether to enable PostgreSQL backend support]) +AC_MSG_RESULT($POSTGRESQL) -AC_MSG_RESULT($pg_inc_dir) +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/include/psql" + 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 -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" + POSTGRESQL_C="" + + 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" + fi fi AC_SUBST(POSTGRESQL_C)