From: John Darrington Date: Wed, 6 Feb 2008 10:33:05 +0000 (+0000) Subject: Increase the chances of finding libpq if it's installed. X-Git-Tag: v0.6.0~128 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp-builds.git;a=commitdiff_plain;h=58c47d4adc7f01f7fb82219cc73bd96dee837fdb Increase the chances of finding libpq if it's installed. --- diff --git a/configure.ac b/configure.ac index 9c52b30a..57e7ae8a 100644 --- a/configure.ac +++ b/configure.ac @@ -48,13 +48,15 @@ AM_CONDITIONAL(WITHGUI, test x"$with_gui" != x"no") dnl Checks needed for psql reader -AC_CHECK_PROG(psql_support, pg_config, yes, no) -if test x"$psql_support" = x"yes" ; then +AC_ARG_VAR([PG_CONFIG], [Full pathname of the pg_config program shipped with Postgresql]) +AC_PATH_PROG([PG_CONFIG], [pg_config], [], [$PATH:/usr/local/pgsql/bin:/usr/pgsql/bin]) +if test -n "$PG_CONFIG" ; then + AC_SUBST(PG_CONFIG) AC_DEFINE([PSQL_SUPPORT], 1, [Define to 1 if building in support for reading from postgres databases.]) - PG_CFLAGS=-I`pg_config --includedir` + PG_CFLAGS=-I`$PG_CONFIG --includedir` AC_SUBST(PG_CFLAGS) - PG_LDFLAGS=-L`pg_config --libdir` + PG_LDFLAGS=-R`$PG_CONFIG --libdir` AC_SUBST(PG_LDFLAGS) PG_LIBS=-lpq AC_SUBST(PG_LIBS) @@ -63,7 +65,7 @@ if test x"$psql_support" = x"yes" ; then [Define to 1 if the openssl library is present.]) ,) fi -AM_CONDITIONAL(PSQL_SUPPORT, test x"$psql_support" = x"yes") +AM_CONDITIONAL(PSQL_SUPPORT, test -n "$PG_CONFIG") dnl Checks needed for gnumeric reader gnm_support=yes; diff --git a/src/ui/gui/automake.mk b/src/ui/gui/automake.mk index dfbc5785..498ffd47 100644 --- a/src/ui/gui/automake.mk +++ b/src/ui/gui/automake.mk @@ -9,6 +9,7 @@ src_ui_gui_psppire_CFLAGS = $(GTK_CFLAGS) $(GLADE_CFLAGS) -Wall \ src_ui_gui_psppire_LDFLAGS = \ + $(PG_LDFLAGS) \ -export-dynamic diff --git a/src/ui/terminal/automake.mk b/src/ui/terminal/automake.mk index 0684e313..57eedb29 100644 --- a/src/ui/terminal/automake.mk +++ b/src/ui/terminal/automake.mk @@ -41,6 +41,8 @@ src_ui_terminal_pspp_LDADD = \ +src_ui_terminal_pspp_LDFLAGS = $(PG_LDFLAGS) + if RELOCATABLE_VIA_LD -src_ui_terminal_pspp_LDFLAGS = `$(RELOCATABLE_LDFLAGS) $(bindir)` +src_ui_terminal_pspp_LDFLAGS += `$(RELOCATABLE_LDFLAGS) $(bindir)` endif diff --git a/tests/automake.mk b/tests/automake.mk index 6d0fd670..e00fa21d 100644 --- a/tests/automake.mk +++ b/tests/automake.mk @@ -1,7 +1,7 @@ ## Process this file with automake to produce Makefile.in -*- makefile -*- TESTS_ENVIRONMENT = top_srcdir='$(top_srcdir)' top_builddir='$(top_builddir)' -TESTS_ENVIRONMENT += PERL='@PERL@' +TESTS_ENVIRONMENT += PERL='@PERL@' PG_CONFIG='@PG_CONFIG@' # Allow locale_charset to find charset.alias before running "make install". TESTS_ENVIRONMENT += CHARSETALIASDIR='$(abs_top_builddir)/gl' diff --git a/tests/command/get-data-psql.sh b/tests/command/get-data-psql.sh index 6b501025..521a97f8 100755 --- a/tests/command/get-data-psql.sh +++ b/tests/command/get-data-psql.sh @@ -21,7 +21,7 @@ export LANG port=6543 dbase=pspptest -PG_CONFIG=pg_config +PG_CONFIG=${PG_CONFIG:=pg_config} pgpath=`$PG_CONFIG | awk '/BINDIR/{print $3}'` cleanup()