From 7ff6f76cf41dd8261c20c3ddbde348477b93e91b Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Mon, 21 Dec 2009 11:13:16 +0100 Subject: [PATCH] Cleanup configure.in to use AC_CHECK_LIB instead of grep --- bacula/autoconf/configure.in | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in index 05ce2f01bd..2008d5a98d 100644 --- a/bacula/autoconf/configure.in +++ b/bacula/autoconf/configure.in @@ -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 -- 2.39.5