apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject svn commit: r673299 - in /apr/apr-util/trunk: CHANGES build/dbd.m4
Date Wed, 02 Jul 2008 06:48:49 GMT
Author: bojan
Date: Tue Jul  1 23:48:48 2008
New Revision: 673299

URL: http://svn.apache.org/viewvc?rev=673299&view=rev
Log:
Detection of PostgreSQL may fail if LIBS contains all libs returned by
pg_config. Use it only as the last resort.

Modified:
    apr/apr-util/trunk/CHANGES
    apr/apr-util/trunk/build/dbd.m4

Modified: apr/apr-util/trunk/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/CHANGES?rev=673299&r1=673298&r2=673299&view=diff
==============================================================================
--- apr/apr-util/trunk/CHANGES [utf-8] (original)
+++ apr/apr-util/trunk/CHANGES [utf-8] Tue Jul  1 23:48:48 2008
@@ -16,6 +16,9 @@
   *) PostgreSQL rows (internally) start from zero, not one. Account for it in
      row fetching function. [Bojan Smojver]
 
+  *) Detection of PostgreSQL may fail if LIBS contains all libs returned by
+     pg_config. Use it only as the last resort. [Bojan Smojver]
+
 Changes with APR-util 1.3.0
 
   *) apr_reslist: destroy all resources in apr_cleanup.

Modified: apr/apr-util/trunk/build/dbd.m4
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/build/dbd.m4?rev=673299&r1=673298&r2=673299&view=diff
==============================================================================
--- apr/apr-util/trunk/build/dbd.m4 (original)
+++ apr/apr-util/trunk/build/dbd.m4 Tue Jul  1 23:48:48 2008
@@ -35,16 +35,32 @@
       if test "x$PGSQL_CONFIG" != 'x'; then
         pgsql_CPPFLAGS="-I`$PGSQL_CONFIG --includedir`"
         pgsql_LDFLAGS="-L`$PGSQL_CONFIG --libdir`"
-        pgsql_LIBS="`$PGSQL_CONFIG --libs`"
 
         APR_ADDTO(CPPFLAGS, [$pgsql_CPPFLAGS])
         APR_ADDTO(LDFLAGS, [$pgsql_LDFLAGS])
-        APR_ADDTO(LIBS, [$pgsql_LIBS])
       fi
 
-      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],[
+        if test "x$PGSQL_CONFIG" != 'x'; then
+          unset ac_cv_lib_pq_PQsendQueryPrepared
+          pgsql_LIBS="`$PGSQL_CONFIG --libs`"
+          APR_ADDTO(LIBS, [$pgsql_LIBS])
+          AC_CHECK_LIB(pq, PQsendQueryPrepared, [apu_have_pgsql=1])
+        fi
+        ])
+      ])
       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],[
+          if test "x$PGSQL_CONFIG" != 'x'; then
+            unset ac_cv_lib_pq_PQsendQueryPrepared
+            pgsql_LIBS="`$PGSQL_CONFIG --libs`"
+            APR_ADDTO(LIBS, [$pgsql_LIBS])
+            AC_CHECK_LIB(pq, PQsendQueryPrepared, [apu_have_pgsql=1])
+          fi
+          ])
+        ])
       fi
       if test "$apu_have_pgsql" != "0" && test "x$PGSQL_CONFIG" != 'x'; then
         APR_ADDTO(APRUTIL_PRIV_INCLUDES, [$pgsql_CPPFLAGS])
@@ -56,7 +72,6 @@
       if test "x$PGSQL_CONFIG" != 'x'; then
         pgsql_CPPFLAGS="-I`$PGSQL_CONFIG --includedir`"
         pgsql_LDFLAGS="-L`$PGSQL_CONFIG --libdir`"
-        pgsql_LIBS="`$PGSQL_CONFIG --libs`"
       else
         pgsql_CPPFLAGS="-I$withval/include"
         pgsql_LDFLAGS="-L$withval/lib "
@@ -64,12 +79,29 @@
 
       APR_ADDTO(CPPFLAGS, [$pgsql_CPPFLAGS])
       APR_ADDTO(LDFLAGS, [$pgsql_LDFLAGS])
-      APR_ADDTO(LIBS, [$pgsql_LIBS])
 
       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],[
+        if test "x$PGSQL_CONFIG" != 'x'; then
+          unset ac_cv_lib_pq_PQsendQueryPrepared
+          pgsql_LIBS="`$PGSQL_CONFIG --libs`"
+          APR_ADDTO(LIBS, [$pgsql_LIBS])
+          AC_CHECK_LIB(pq, PQsendQueryPrepared, [apu_have_pgsql=1])
+        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],[
+          if test "x$PGSQL_CONFIG" != 'x'; then
+            unset ac_cv_lib_pq_PQsendQueryPrepared
+            pgsql_LIBS="`$PGSQL_CONFIG --libs`"
+            APR_ADDTO(LIBS, [$pgsql_LIBS])
+            AC_CHECK_LIB(pq, PQsendQueryPrepared, [apu_have_pgsql=1])
+          fi
+          ])
+        ])
       fi
       if test "$apu_have_pgsql" != "0"; then
         APR_ADDTO(APRUTIL_PRIV_INCLUDES, [$pgsql_CPPFLAGS])
@@ -80,16 +112,32 @@
     if test "x$PGSQL_CONFIG" != 'x'; then
       pgsql_CPPFLAGS="-I`$PGSQL_CONFIG --includedir`"
       pgsql_LDFLAGS="-L`$PGSQL_CONFIG --libdir`"
-      pgsql_LIBS="`$PGSQL_CONFIG --libs`"
 
       APR_ADDTO(CPPFLAGS, [$pgsql_CPPFLAGS])
       APR_ADDTO(LDFLAGS, [$pgsql_LDFLAGS])
-      APR_ADDTO(LIBS, [$pgsql_LIBS])
     fi
 
-    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],[
+      if test "x$PGSQL_CONFIG" != 'x'; then
+        unset ac_cv_lib_pq_PQsendQueryPrepared
+        pgsql_LIBS="`$PGSQL_CONFIG --libs`"
+        APR_ADDTO(LIBS, [$pgsql_LIBS])
+        AC_CHECK_LIB(pq, PQsendQueryPrepared, [apu_have_pgsql=1])
+      fi
+      ])
+    ])
     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],[
+        if test "x$PGSQL_CONFIG" != 'x'; then
+          unset ac_cv_lib_pq_PQsendQueryPrepared
+          pgsql_LIBS="`$PGSQL_CONFIG --libs`"
+          APR_ADDTO(LIBS, [$pgsql_LIBS])
+          AC_CHECK_LIB(pq, PQsendQueryPrepared, [apu_have_pgsql=1])
+        fi
+        ])
+      ])
     fi
     if test "$apu_have_pgsql" != "0" && test "x$PGSQL_CONFIG" != 'x'; then
       APR_ADDTO(APRUTIL_PRIV_INCLUDES, [$pgsql_CPPFLAGS])



Mime
View raw message