postgres configure fixes

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@5286 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas
2001-09-05 15:47:13 +00:00
parent a6595861d9
commit 9b741dd37c

View File

@@ -167,13 +167,23 @@ AC_ARG_ENABLE( profile,
### --------------------------------------------------------------------------
### SQL
# Check to see if the user wants to have Postgres support
#
# hack alert ... we should use 'pg_config --includedir' and
# 'pg_config --libdir' to find paths; unfortunately pg_config itself
# is hard to find :-(
AC_ARG_ENABLE( sql,
[ --enable-sql compile with sql support],
[
if test "x$enableval" != "xno" ; then
AC_CHECK_HEADERS(pgsql/libpq-fe.h postgresql/libpq-fe.h)
if test "x$ac_cv_header_pgsql_libpq_fe_h$ac_cv_header_postgresql_libpq_fe_h" = xnono; then
PGSQL_CFLAGS=`/usr/lib/postgresql/bin/pg_config --includedir`
if test "x$PGSQL_CFLAGS" != x; then
CFLAGS="${CFLAGS} -I${PGSQL_CFLAGS}"
fi
AC_CHECK_HEADERS(pgsql/libpq-fe.h postgresql/libpq-fe.h libpq-fe.h)
if test "x$ac_cv_header_pgsql_libpq_fe_h$ac_cv_header_postgresql_libpq_fe_h$ac_cv_header_libpq_fe_h" = xnonono; then
AC_MSG_ERROR([Cannot find PostgreSQL headers; won't build sql backend])
else
master_dirs="/usr/include /usr/local/include"
@@ -182,7 +192,7 @@ AC_ARG_ENABLE( sql,
if test -f "$dir/pgsql/libpq-fe.h"; then
CFLAGS="${CFLAGS} -I$dir/pgsql"
break
fi
fi
done
elif test "x$ac_cv_header_postgresql_libpq_fe_h" != xno; then
for dir in $master_dirs; do
@@ -194,7 +204,12 @@ AC_ARG_ENABLE( sql,
fi
saved_LIBS="$LIBS"
LIBS="-lpq $LIBS"
PGSQL_LIBS=`/usr/lib/postgresql/bin/pg_config --libdir`
if test "x$PGSQL_LIBS" != x; then
LIBS="-L${PGSQL_LIBS} -lpq $LIBS"
else
LIBS="-lpq $LIBS"
fi
AC_MSG_CHECKING(for libpq)
AC_TRY_LINK(
[