]> git.sur5r.net Git - bacula/bacula/commitdiff
Cleanup configure.in to use AC_CHECK_LIB instead of grep
authorEric Bollengier <eric@eb.homelinux.org>
Mon, 21 Dec 2009 10:13:16 +0000 (11:13 +0100)
committerEric Bollengier <eric@eb.homelinux.org>
Mon, 21 Dec 2009 10:18:25 +0000 (11:18 +0100)
bacula/autoconf/configure.in

index 05ce2f01bdac4605d2179d3ac23fec2238ad6e09..2008d5a98d479af200952f894a33a8430ff21a22 100644 (file)
@@ -1710,13 +1710,14 @@ if test $pkg = 0; then
    )
 fi
    
-dnl Check if postgresql support batch mode   
+dnl Check if postgresql can support batch mode   
 if test x$DB_TYPE = xpostgresql; then
-   A=`test -f $SQL_LIB && nm $SQL_LIB | grep PQputCopyData`
-   pkg=$?
-   if test $pkg != 0; then
-      support_batch_insert=no
-   fi
+   AC_CHECK_LIB(pq, PQisthreadsafe, AC_DEFINE(HAVE_PQISTHREADSAFE))
+   AC_CHECK_LIB(pq, PQputCopyData, AC_DEFINE(HAVE_PQ_COPY))
+   if test "x$ac_cv_lib_pq_PQisthreadsafe" != "xyes" -o "x$ac_cv_lib_pq_PQputCopyData" != "xyes"
+    then
+        support_batch_insert=no
+    fi
 fi
 
 if test x$DB_TYPE = xdbi; then
@@ -1725,7 +1726,9 @@ if test x$DB_TYPE = xdbi; then
    pkg=1
    dnl Check for batch insert
    if test $DB_PROG = postgresql; then
-      A=`test -f $SQL_LIB && nm $SQL_LIB | grep PQputCopyData`
+      AC_CHECK_LIB(pq, PQisthreadsafe, AC_DEFINE(HAVE_PQISTHREADSAFE))
+      AC_CHECK_LIB(pq, PQputCopyData, AC_DEFINE(HAVE_PQ_COPY))
+      test "x$ac_cv_lib_pq_PQisthreadsafe" != "xyes" -o "x$ac_cv_lib_pq_PQputCopyData" != "xyes"
       pkg=$?
    fi