diff --git a/ChangeLog b/ChangeLog index 5c5854bfa9..47a6cfa8d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2003-01-28 Derek Atkins + + * configure.in -- fix the PG test to deal properly with non-standard + locations. In particular, AC_CHECK_HEADERS() uses CPPFLAGS, not + CFLAGS. + * src/backend/postgres/Makefile.am: use PGSQL_CFLAGS and PGSQL_LIBS + * src/backend/postgres/test/Makefile.am: use PGSQL_CFLAGS + 2003-01-28 Christian Stimming * po/it.po: Updated Italian translation by Lorenzo Cappelletti diff --git a/configure.in b/configure.in index 7e471d2da2..cf4dbe01f5 100644 --- a/configure.in +++ b/configure.in @@ -390,9 +390,11 @@ AC_ARG_ENABLE( sql, PGSQL_CFLAGS=`${PG_CONFIG} --includedir` if test "x$PGSQL_CFLAGS" != x; then - CFLAGS="${CFLAGS} -I${PGSQL_CFLAGS}" + PGSQL_CFLAGS="-I${PGSQL_CFLAGS}" fi + saved_CPPFLAGS="${CPPFLAGS}" + CPPFLAGS="${CPPFLAGS} ${PGSQL_CFLAGS}" 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]) @@ -414,16 +416,15 @@ AC_ARG_ENABLE( sql, done fi - AS_SCRUB_INCLUDE(CFLAGS) - - saved_LIBS="$LIBS" + AS_SCRUB_INCLUDE(PGSQL_CFLAGS) PGSQL_LIBS=`${PG_CONFIG} --libdir` if test "x$PGSQL_LIBS" != x; then - LIBS="-L${PGSQL_LIBS} -lpq $LIBS" - else - LIBS="-lpq $LIBS" + PGSQL_LIBS="-L${PGSQL_LIBS}" fi + + saved_LIBS="$LIBS" + LIBS="${PGSQL_LIBS} -lpq $LIBS" AC_MSG_CHECKING(for libpq) AC_TRY_LINK( [ @@ -442,10 +443,13 @@ AC_ARG_ENABLE( sql, ) LIBS="$saved_LIBS" fi + CPPFLAGS="$saved_CPPFLAGS" fi ] ) +AC_SUBST(PGSQL_CFLAGS) +AC_SUBST(PGSQL_LIBS) AC_SUBST(SQL_DIR) diff --git a/src/backend/postgres/Makefile.am b/src/backend/postgres/Makefile.am index e6524b947d..d65f8c7f43 100644 --- a/src/backend/postgres/Makefile.am +++ b/src/backend/postgres/Makefile.am @@ -4,7 +4,7 @@ pkglib_LTLIBRARIES = libgncmod-backend-postgres.la libgncmod_backend_postgres_la_LDFLAGS = -module -libgncmod_backend_postgres_la_LIBADD = -lpq \ +libgncmod_backend_postgres_la_LIBADD = ${PGSQL_LIBS} -lpq \ ${top_builddir}/src/engine/libgncmod-engine.la \ ${GLIB_LIBS} @@ -96,6 +96,7 @@ AM_CFLAGS = \ -I../.. -I${srcdir}/../.. \ -I../../engine -I${srcdir}/../../engine \ -I../../gnc-module -I${srcdir}/../../gnc-module \ + ${PGSQL_CFLAGS} \ ${GLIB_CFLAGS} $(M4_SRC): table.m4 diff --git a/src/backend/postgres/test/Makefile.am b/src/backend/postgres/test/Makefile.am index fa334f9fd3..0ee351d4d7 100644 --- a/src/backend/postgres/test/Makefile.am +++ b/src/backend/postgres/test/Makefile.am @@ -39,6 +39,7 @@ AM_CFLAGS = \ -I${top_srcdir}/src/engine/test-core \ -I.. \ -I${srcdir}/.. \ + ${PGSQL_CFLAGS} \ ${GLIB_CFLAGS} \ ${GUILE_INCS}