apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pque...@apache.org
Subject svn commit: r154402 - in apr/apr-util/trunk: build.conf build/dbd.m4 configure.in include/apu.h.in
Date Sat, 19 Feb 2005 10:12:43 GMT
Author: pquerna
Date: Sat Feb 19 02:12:41 2005
New Revision: 154402

URL: http://svn.apache.org/viewcvs?view=rev&rev=154402
Log:
Hook the PostgreSQL DBD driver into autoconf.
The current code will not autodetect Postgres on all systems.

Added:
    apr/apr-util/trunk/build/dbd.m4
Modified:
    apr/apr-util/trunk/build.conf
    apr/apr-util/trunk/configure.in
    apr/apr-util/trunk/include/apu.h.in

Modified: apr/apr-util/trunk/build.conf
URL: http://svn.apache.org/viewcvs/apr/apr-util/trunk/build.conf?view=diff&r1=154401&r2=154402
==============================================================================
--- apr/apr-util/trunk/build.conf (original)
+++ apr/apr-util/trunk/build.conf Sat Feb 19 02:12:41 2005
@@ -18,7 +18,7 @@
   xml/*.c
   strmatch/*.c
   xlate/*.c
-  dbd/apr_dbd.c
+  dbd/*.c
 
 # we have no platform-specific subdirs
 platform_dirs =

Added: apr/apr-util/trunk/build/dbd.m4
URL: http://svn.apache.org/viewcvs/apr/apr-util/trunk/build/dbd.m4?view=auto&rev=154402
==============================================================================
--- apr/apr-util/trunk/build/dbd.m4 (added)
+++ apr/apr-util/trunk/build/dbd.m4 Sat Feb 19 02:12:41 2005
@@ -0,0 +1,58 @@
+dnl
+dnl DBD module
+dnl
+
+dnl
+dnl APU_CHECK_DBD: see what kind of DBD backend to use for apr_dbd.
+dnl
+AC_DEFUN(APU_CHECK_DBD, [
+  apu_have_pgsql=0
+
+  AC_ARG_WITH([pgsql], [
+  --with-pgsql=DIR          specify PostgreSQL location
+  ], [
+    apu_have_pgsql=0
+    if test "$withval" = "yes"; then
+      AC_CHECK_HEADER(libpq-fe.h, AC_CHECK_LIB(pq, PQconnectdb, [apu_have_pgsql=1]))
+      if test "$apu_have_pgsql" == "0"; then
+        AC_CHECK_HEADER(postgresql/libpq-fe.h, AC_CHECK_LIB(pq, PQconnectdb, [apu_have_pgsql=1]))
+        if test "$apu_have_pgsql" != "0"; then
+          APR_ADDTO(APRUTIL_INCLUDES, [-I$withval/include/postgresql])
+        fi
+      fi
+    elif test "$withval" = "no"; then
+      apu_have_pgsql=0
+    else
+      CPPFLAGS="-I$withval/include"
+      LIBS="-L$withval/lib "
+
+      AC_MSG_NOTICE(checking for pgsql in $withval)
+      AC_CHECK_HEADER(libpq-fe.h, AC_CHECK_LIB(pq, PQconnectdb, [apu_have_pgsql=1]))
+      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_HEADER(postgresql/libpq-fe.h, AC_CHECK_LIB(pq, PQconnectdb, [apu_have_pgsql=1]))
+        if test "$apu_have_pgsql" != "0"; then
+          APR_ADDTO(APRUTIL_INCLUDES, [-I$withval/include/postgresql])
+          APR_ADDTO(APRUTIL_LDFLAGS, [-L$withval/lib])
+        fi
+      fi
+    fi
+  ], [
+    apu_have_pgsql=0
+    AC_CHECK_HEADER(libpq-fe.h, AC_CHECK_LIB(pq, PQconnectdb, [apu_have_pgsql=1]))
+  ])
+
+  AC_SUBST(apu_have_pgsql)
+
+  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])
+  fi
+])
+

Modified: apr/apr-util/trunk/configure.in
URL: http://svn.apache.org/viewcvs/apr/apr-util/trunk/configure.in?view=diff&r1=154401&r2=154402
==============================================================================
--- apr/apr-util/trunk/configure.in (original)
+++ apr/apr-util/trunk/configure.in Sat Feb 19 02:12:41 2005
@@ -14,6 +14,7 @@
 sinclude(build/apr_common.m4)
 sinclude(build/find_apr.m4)
 sinclude(build/dbm.m4)
+sinclude(build/dbd.m4)
 
 dnl Generate ./config.nice for reproducing runs of configure
 dnl 
@@ -117,6 +118,7 @@
 dnl Find an iconv library
 APU_FIND_LDAP
 APU_CHECK_DBM
+APU_CHECK_DBD
 APU_FIND_EXPAT
 APU_FIND_ICONV
 

Modified: apr/apr-util/trunk/include/apu.h.in
URL: http://svn.apache.org/viewcvs/apr/apr-util/trunk/include/apu.h.in?view=diff&r1=154401&r2=154402
==============================================================================
--- apr/apr-util/trunk/include/apu.h.in (original)
+++ apr/apr-util/trunk/include/apu.h.in Sat Feb 19 02:12:41 2005
@@ -77,6 +77,8 @@
 #define APU_HAVE_DB_VERSION    @apu_db_version@
 #endif /* APU_HAVE_DB */
 
+#define APU_HAVE_PGSQL         @apu_have_pgsql@
+
 #define APU_HAVE_APR_ICONV     @have_apr_iconv@
 #define APU_HAVE_ICONV         @have_iconv@
 #define APR_HAS_XLATE          (APU_HAVE_APR_ICONV || APU_HAVE_ICONV)



Mime
View raw message