]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/autoconf/configure.in
Fix batch insert detection on SLES 11
[bacula/bacula] / bacula / autoconf / configure.in
index c01c9c9f5e36fa487dcb15b4b260fcabe85cc8fb..b15ec2315279247a092c84189765639d024f93eb 100644 (file)
@@ -36,11 +36,13 @@ BACULA=${BACULA:-Bacula}
 VERSION=`sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
 DATE=`sed -n -e 's/^.*[ \t]*BDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
 LSMDATE=`sed -n -e 's/^.*LSMDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
+BDB_VERSION=`sed -n -e 's/^.*BDB_VERSION \(.*\)$/\1/p' ${srcdir}/src/cats/cats.h`
 AC_SUBST(VERSION)dnl 
 AC_SUBST(DATE)dnl 
 AC_SUBST(LSMDATE)dnl 
 AC_SUBST(BACULA)dnl
 AC_SUBST(post_host)dnl
+AC_SUBST(BDB_VERSION)dnl
 
 dnl src/lib
 dnl can be overwritten by specific values from version.h
@@ -811,10 +813,10 @@ if test x$support_ipv6 = xyes; then
 fi
 
 TERM_LIB=""
-AC_CHECK_HEADER(termcap.h, 
-  [ AC_CHECK_LIB(termcap, tgetent, 
-    [ TERM_LIB="-ltermcap" ],
-    [ AC_CHECK_LIB(ncurses, tgetent, [ TERM_LIB="-lncurses" ])
+AC_CHECK_HEADER(curses.h, 
+  [ AC_CHECK_LIB(ncurses, tgetent, 
+    [ TERM_LIB="-lncurses" ],
+    [ AC_CHECK_LIB(termcap, tgetent, [ TERM_LIB="-ltermcap" ])
     ])
   ],
   [  AC_CHECK_HEADERS(curses.h)
@@ -1197,6 +1199,7 @@ else
    OPENSSL_LIBS=""
    OPENSSL_INC=""
 fi
+AC_MSG_RESULT([$support_tls])
 
 if test "$support_tls" = "no"; then
    OPENSSL_LIBS=""
@@ -1207,7 +1210,6 @@ if test "$support_crypto" = "no"; then
    OPENSSL_INC=""
 fi  
 
-AC_MSG_RESULT([$support_tls])
 AC_SUBST(OPENSSL_LIBS)
 AC_SUBST(OPENSSL_INC)
 
@@ -1755,9 +1757,19 @@ dnl Check if postgresql can support batch mode
 if test x$DB_TYPE = xpostgresql; then
    AC_CHECK_LIB(pq, PQisthreadsafe, AC_DEFINE(HAVE_PQISTHREADSAFE, 1, [Set if have PQisthreadsafe]))
    AC_CHECK_LIB(pq, PQputCopyData, AC_DEFINE(HAVE_PQ_COPY, 1, [Set if have PQputCopyData]))
-   if test "x$ac_cv_lib_pq_PQputCopyData" != "xyes"
-    then
-       support_batch_insert=no
+   test "x$ac_cv_lib_pq_PQputCopyData" != "xyes"
+   pkg=$?
+   if test $pkg = 0; then
+      AC_ARG_ENABLE(batch-insert,
+        AC_HELP_STRING([--enable-batch-insert], [enable the DB batch insert code @<:@default=no@:>@]),
+        [
+            if test x$enableval = xno; then
+               support_batch_insert=no
+            else
+               support_batch_insert=yes
+            fi
+        ]
+      )
    fi
 fi
 
@@ -1806,6 +1818,11 @@ LIBS="${saved_LIBS}"
 
 AC_SUBST(uncomment_dbi)
 
+dnl For Ingres always enable batch inserts.
+if test x$DB_TYPE = xingres; then
+   support_batch_insert=yes
+fi
+
 if test $support_batch_insert = yes ; then
    AC_DEFINE(HAVE_BATCH_FILE_INSERT, 1, [Set if DB batch insert code enabled])
 fi
@@ -2389,6 +2406,7 @@ AC_FUNC_STRFTIME
 AC_FUNC_VPRINTF
 AC_FUNC_ALLOCA
 AC_FUNC_GETMNTENT
+AC_CHECK_FUNCS(getmntinfo, [AC_DEFINE(HAVE_GETMNTINFO)])
 AC_FUNC_CLOSEDIR_VOID
 AC_FUNC_SETPGRP            dnl check for BSD setpgrp.
 # AC_FUNC_FNMATCH    dnl use local version
@@ -2398,12 +2416,89 @@ AC_CHECK_LIB(intl, gettext, [LIBS="$LIBS -lintl"])
 AC_CHECK_LIB(sun, getpwnam)
 
 AC_CHECK_HEADERS(zlib.h)
-AC_CHECK_LIB(z, deflate, [FDLIBS="-lz"])
+AC_CHECK_LIB(z, deflate, [ZLIBS="-lz"])
 have_zlib=no
-if test x$FDLIBS = x-lz; then
+if test x$ZLIBS = x-lz; then
    AC_DEFINE(HAVE_LIBZ)
    have_zlib=yes
 fi
+AC_SUBST(ZLIBS)
+
+dnl
+dnl Check if we have AFS on this system
+dnl
+AFS_CFLAGS=""
+AFS_LIBS=""
+support_afs=auto
+AC_ARG_ENABLE(afs,
+   AC_HELP_STRING([--disable-afs], [disable afs support @<:@default=auto@:>@]),
+   [
+       if test x$enableval = xyes; then
+         support_afs=yes
+       elif test x$enableval = xno; then
+         support_afs=no
+       fi
+   ]
+)
+
+have_afs=no
+if test x$support_afs = xyes -o x$support_afs = xauto; then
+   AC_ARG_WITH(afsdir,
+      AC_HELP_STRING([--with-afsdir@<:@=DIR@:>@], [Directory holding AFS includes/libs]),
+      with_afsdir=$withval
+   )
+
+   dnl
+   dnl Search in standard places, or --with-afsdir not specified
+   dnl
+   if test x$with_afsdir = x; then
+      for root in /usr /usr/local; do
+        if test -d ${root}/include/afs/ ; then
+           with_afsdir=${root}
+           break
+        fi
+      done
+   fi
+
+   AFS_CFLAGS="-I${with_afsdir}/include"
+
+   saved_CFLAGS="${CFLAGS}"
+   CFLAGS="${AFS_CFLAGS} ${saved_CFLAGS}"
+
+   AC_CHECK_HEADERS(afs/stds.h)
+
+   CFLAGS="${saved_CFLAGS}"
+
+   dnl
+   dnl See if we can find a libsys with the pioctl symbol in there
+   dnl
+   for dir in ${with_afsdir}/lib ${with_afsdir}/lib/afs
+   do
+      for arch_type in .a .so
+      do
+        A=`test -f ${dir}/libsys${arch_type} && nm ${dir}/libsys${arch_type} | grep pioctl`
+        pkg=$?
+        if test $pkg = 0; then
+           have_afs=yes
+           AFS_LIBS="-L${dir} -lsys -lrx -llwp ${dir}/util.a"
+           break
+        fi
+      done
+   done
+
+   if test x$support_afs = xyes -a $have_afs != yes; then
+      AC_MSG_ERROR([afs support explicitly enabled but no supported afs implementation found, 
+  please either load the afs libraries or rerun configure without --enable-afs])
+   else
+      if test $have_afs = yes; then
+        AC_DEFINE([HAVE_AFS],1,[Defines if your system has AFS support])
+        AC_DEFINE([HAVE_AFS_ACL],1,[Andrew FileSystem ACL support])
+      fi
+   fi
+fi
+
+AC_SUBST(AFS_CFLAGS)
+AC_SUBST(AFS_LIBS)
 
 dnl
 dnl Check for ACL support and libraries
@@ -2431,7 +2526,18 @@ if test x$support_acl = xyes -o x$support_acl = xauto; then
          AC_CHECK_LIB(acl, acl_get_file,
             [
                 have_acl=yes;
-                FDLIBS="-lacl $FDLIBS"
+                if test $have_afs = yes; then
+                   dnl
+                   dnl Because of possible naming conflict with AFS libacl make sure we use the one in /usr/lib64 or /usr/lib !!!
+                   dnl
+                   if test -d /usr/lib64/; then
+                      FDLIBS="-L/usr/lib64 -lacl $FDLIBS"
+                   else
+                      FDLIBS="-L/usr/lib -lacl $FDLIBS"
+                   fi
+                else
+                   FDLIBS="-lacl $FDLIBS"
+                fi
             ], [
                 AC_CHECK_LIB(pacl, acl_get_file,
                    [
@@ -2921,7 +3027,8 @@ suse)
        platforms/suse/Makefile \
        platforms/suse/bacula-fd \
        platforms/suse/bacula-sd \
-       platforms/suse/bacula-dir"
+       platforms/suse/bacula-dir \
+       platforms/suse/bacula"
   ;;
 suse5)
    DISTNAME=suse
@@ -3061,12 +3168,6 @@ AC_OUTPUT([autoconf/Make.common \
           src/cats/drop_ingres_database \
           src/cats/sqlite \
           src/cats/mysql \
-          src/cats/create_bdb_database \
-          src/cats/update_bdb_tables \
-          src/cats/make_bdb_tables \
-          src/cats/grant_bdb_privileges \
-          src/cats/drop_bdb_tables \
-          src/cats/drop_bdb_database \
           src/cats/create_bacula_database \
           src/cats/update_bacula_tables \
           src/cats/grant_bacula_privileges \
@@ -3130,6 +3231,7 @@ c=updatedb
 chmod 755 $c/update_mysql_tables_10_to_11   $c/update_sqlite3_tables_10_to_11
 chmod 755 $c/update_postgresql_tables_10_to_11
 
+
 c=src/cats
 
 chmod 755 $c/create_bacula_database   $c/update_bacula_tables  $c/make_bacula_tables
@@ -3260,6 +3362,7 @@ Configuration on `date`:
    build-dird:             ${build_dird}
    build-stored:           ${build_stored}
    Plugin support:         ${have_plugins}
+   AFS support:            ${have_afs}
    ACL support:            ${have_acl}
    XATTR support:          ${have_xattr}
    Python support:         ${support_python} ${PYTHON_LIBS}