From f188540043714bb9d927b46ee467517a1a89c6a9 Mon Sep 17 00:00:00 2001 From: Danny Auble <da@llnl.gov> Date: Fri, 18 Jan 2008 00:24:26 +0000 Subject: [PATCH] different check for postgres --- auxdir/x_ac_databases.m4 | 60 ++++++++++++++++------------------------ src/common/Makefile.am | 1 - src/common/Makefile.in | 1 - 3 files changed, 24 insertions(+), 38 deletions(-) diff --git a/auxdir/x_ac_databases.m4 b/auxdir/x_ac_databases.m4 index 839dd8ac7ce..b5c99bde769 100644 --- a/auxdir/x_ac_databases.m4 +++ b/auxdir/x_ac_databases.m4 @@ -67,40 +67,28 @@ AC_DEFUN([X_AC_DATABASES], save_CFLAGS="$CFLAGS" CFLAGS="$PGSQL_CFLAGS $save_CFLAGS" - AC_CHECK_HEADERS($PGSQL_INCLUDEDIR/libpq-fe.h, - [has_pgsql_header="true"], - [has_pgsql_header="false"]) - if test "$has_pgsql_header" = "true"; then - AC_CHECK_LIB(pq, PQconnectdb, [has_pgsql_lib="true"], [has_pgsql_lib="false"]) - if test "$has_pgsql_lib" = "true"; then - PGSQL_LIBS=" -lpq" - save_LIBS="$LIBS" - LIBS="$PGSQL_LIBS $save_LIBS" - AC_TRY_LINK([#include <libpq-fe.h>],[ - int main() - { - PGconn *conn; - conn = PQconnectdb("dbname = postgres"); - (void) PQfinish(conn); - } - ], - [ac_have_pgsql="yes"], - [ac_have_pgsql="no"]) - LIBS="$save_LIBS" - if test "$ac_have_pgsql" == "yes"; then - AC_MSG_RESULT([PostgreSQL test program built properly.]) - AC_SUBST(PGSQL_LIBS) - AC_SUBST(PGSQL_CFLAGS) - AC_DEFINE(HAVE_PGSQL, 1, [Define to 1 if using PostgreSQL libaries]) - else - AC_MSG_WARN([*** PostgreSQL test program execution failed.]) - fi - else - AC_MSG_WARN(libpq not found: PostgreSQL support not available) - fi - else - AC_MSG_WARN(libpq-fe.h header not found: PostgreSQL support not available) - fi - CFLAGS="$save_CFLAGS" - fi + PGSQL_LIBS=" -lpq" + save_LIBS="$LIBS" + LIBS="$PGSQL_LIBS $save_LIBS" + AC_TRY_LINK([#include <libpq-fe.h>],[ + int main() + { + PGconn *conn; + conn = PQconnectdb("dbname = postgres"); + (void) PQfinish(conn); + } + ], + [ac_have_pgsql="yes"], + [ac_have_pgsql="no"]) + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + if test "$ac_have_pgsql" == "yes"; then + AC_MSG_RESULT([PostgreSQL test program built properly.]) + AC_SUBST(PGSQL_LIBS) + AC_SUBST(PGSQL_CFLAGS) + AC_DEFINE(HAVE_PGSQL, 1, [Define to 1 if using PostgreSQL libaries]) + else + AC_MSG_WARN([*** PostgreSQL test program execution failed.]) + fi + fi ]) diff --git a/src/common/Makefile.am b/src/common/Makefile.am index 627b7413ce3..68ff83768f1 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -106,7 +106,6 @@ libspank_la_SOURCES = \ libcommon_la_LIBADD = $(SSL_LIBS) -ldl $(PGSQL_LIBS) $(MYSQL_LIBS) libcommon_la_LDFLAGS = $(LIB_LDFLAGS) $(SSL_LDFLAGS) -libcommon_la_LIBS = $(PGSQL_LIBS) $(MYSQL_LIBS) libcommon_la_CFLAGS = $(PGSQL_CFLAGS) $(MYSQL_CFLAGS) global_defaults.c : $(top_builddir)/config.h Makefile diff --git a/src/common/Makefile.in b/src/common/Makefile.in index 78362a0a272..96f8b247ac4 100644 --- a/src/common/Makefile.in +++ b/src/common/Makefile.in @@ -430,7 +430,6 @@ libspank_la_SOURCES = \ libcommon_la_LIBADD = $(SSL_LIBS) -ldl $(PGSQL_LIBS) $(MYSQL_LIBS) libcommon_la_LDFLAGS = $(LIB_LDFLAGS) $(SSL_LDFLAGS) -libcommon_la_LIBS = $(PGSQL_LIBS) $(MYSQL_LIBS) libcommon_la_CFLAGS = $(PGSQL_CFLAGS) $(MYSQL_CFLAGS) all: all-am -- GitLab