From: Eric Bollengier Date: Mon, 21 Dec 2009 10:13:16 +0000 (+0100) Subject: Cleanup configure.in to use AC_CHECK_LIB instead of grep X-Git-Tag: Release-5.0.0~130 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7ff6f76cf41dd8261c20c3ddbde348477b93e91b;p=bacula%2Fbacula Cleanup configure.in to use AC_CHECK_LIB instead of grep --- 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