From dev-return-20145-apmail-apr-dev-archive=apr.apache.org@apr.apache.org Thu May 15 13:09:36 2008 Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 41017 invoked from network); 15 May 2008 13:09:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 May 2008 13:09:36 -0000 Received: (qmail 43719 invoked by uid 500); 15 May 2008 13:09:37 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 43674 invoked by uid 500); 15 May 2008 13:09:37 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 43663 invoked by uid 99); 15 May 2008 13:09:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 May 2008 06:09:36 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=FM_FAKE_HELO_VERIZON,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [206.46.173.5] (HELO vms173005pub.verizon.net) (206.46.173.5) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 May 2008 13:08:42 +0000 Received: from black ([71.245.67.80]) by vms173005.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0K0W00B5MUWQVGT3@vms173005.mailsrvcs.net> for dev@apr.apache.org; Thu, 15 May 2008 08:02:50 -0500 (CDT) Received: from bob by black with local (Exim 4.69) (envelope-from ) id 1JwdCV-00060p-8y for dev@apr.apache.org; Thu, 15 May 2008 09:08:51 -0400 Date: Thu, 15 May 2008 09:08:51 -0400 From: Bob Rossi Subject: dbd pgsql autotools patch To: dev@apr.apache.org Mail-followup-to: dev@apr.apache.org Message-id: <20080515130851.GC19638@brasko.net> MIME-version: 1.0 Content-type: multipart/mixed; boundary=82I3+IH0IqGh5yIs Content-disposition: inline User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Virus-Checked: Checked by ClamAV on apache.org --82I3+IH0IqGh5yIs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, I just downloaded and installed postgresql, and installed it into a root. Then I used the apr-util option --with-pgsql. The apr-util autotools machinary failed. That's because it tries to link a program against -lpg, but doesn't use the other libs specified in pg_config. So, I get a link error, because it needs to link against -lcrypt. Attached is the patch that fixes the problem, what do you think? Bob Rossi --82I3+IH0IqGh5yIs Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="pgsql.diff" --- apr-util-2006-12-14-cvs-2/apr-util-2006-12-14-cvs/build/dbd.m4 2006-12-14 20:41:02.000000000 -0500 +++ apr-util-2006-12-14-cvs-3/apr-util-2006-12-14-cvs/build/dbd.m4 2008-05-15 08:50:59.000000000 -0400 @@ -29,9 +29,14 @@ ], [ apu_have_pgsql=0 if test "$withval" = "yes"; then - AC_CHECK_HEADERS(libpq-fe.h, AC_CHECK_LIB(pq, PQsendQueryPrepared, [apu_have_pgsql=1])) + AC_PATH_PROG([PG_CONFIG],[pg_config]) + if test "x$PG_CONFIG" != 'x'; then + pgsql_LIBS="`$withval/bin/pg_config --libs`" + fi + + AC_CHECK_HEADERS(libpq-fe.h, AC_CHECK_LIB(pq, PQsendQueryPrepared, [apu_have_pgsql=1], [], [$pgsql_LIBS])) if test "$apu_have_pgsql" = "0"; then - AC_CHECK_HEADERS(postgresql/libpq-fe.h, AC_CHECK_LIB(pq, PQsendQueryPrepared, [apu_have_pgsql=1])) + AC_CHECK_HEADERS(postgresql/libpq-fe.h, AC_CHECK_LIB(pq, PQsendQueryPrepared, [apu_have_pgsql=1], [], [$pgsql_LIBS])) fi elif test "$withval" = "no"; then apu_have_pgsql=0 @@ -41,18 +46,21 @@ pgsql_CPPFLAGS="-I$withval/include" pgsql_LDFLAGS="-L$withval/lib " + if test -e "$withval/bin/pg_config"; then + pgsql_LIBS="`$withval/bin/pg_config --libs`" + fi APR_ADDTO(CPPFLAGS, [$pgsql_CPPFLAGS]) APR_ADDTO(LDFLAGS, [$pgsql_LDFLAGS]) AC_MSG_NOTICE(checking for pgsql in $withval) - AC_CHECK_HEADERS(libpq-fe.h, AC_CHECK_LIB(pq, PQsendQueryPrepared, [apu_have_pgsql=1])) + AC_CHECK_HEADERS(libpq-fe.h, AC_CHECK_LIB(pq, PQsendQueryPrepared, [apu_have_pgsql=1], [], [$pgsql_LIBS])) if test "$apu_have_pgsql" != "0"; then APR_ADDTO(APRUTIL_LDFLAGS, [-L$withval/lib]) APR_ADDTO(APRUTIL_INCLUDES, [-I$withval/include]) fi if test "$apu_have_pgsql" != "1"; then - AC_CHECK_HEADERS(postgresql/libpq-fe.h, AC_CHECK_LIB(pq, PQsendQueryPrepared, [apu_have_pgsql=1])) + AC_CHECK_HEADERS(postgresql/libpq-fe.h, AC_CHECK_LIB(pq, PQsendQueryPrepared, [apu_have_pgsql=1], [], [$pgsql_LIBS])) if test "$apu_have_pgsql" != "0"; then APR_ADDTO(APRUTIL_INCLUDES, [-I$withval/include/postgresql]) APR_ADDTO(APRUTIL_LDFLAGS, [-L$withval/lib]) @@ -70,8 +78,8 @@ dnl Since we have already done the AC_CHECK_LIB tests, if we have it, dnl we know the library is there. if test "$apu_have_pgsql" = "1"; then - APR_ADDTO(APRUTIL_EXPORT_LIBS,[-lpq]) - APR_ADDTO(APRUTIL_LIBS,[-lpq]) + APR_ADDTO(APRUTIL_EXPORT_LIBS,[-lpq $pgsql_LIBS]) + APR_ADDTO(APRUTIL_LIBS,[-lpq $pgsql_LIBS]) fi ]) dnl --82I3+IH0IqGh5yIs--