mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
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:
23
configure.in
23
configure.in
@@ -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(
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user