]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/autoconf/configure.in
Added configure support for the AIX extended attributes interface.
[bacula/bacula] / bacula / autoconf / configure.in
index 77c92199fd447e0035103437df42a8c9b2ff7287..1071a6e2ba4df02fbdb2c0a697da8b005c79d782 100644 (file)
@@ -36,48 +36,43 @@ 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
-LIBBAC_LT_CURRENT=`sed -n -e 's/^.*LIBBAC_LT_CURRENT *\(.*\)$/\1/p' ${srcdir}/src/version.h`
-LIBBAC_LT_REVISION=`sed -n -e 's/^.*LIBBAC_LT_REVISION *\(.*\)$/\1/p' ${srcdir}/src/version.h`
-LIBBAC_LT_AGE=`sed -n -e 's/^.*LIBBAC_LT_AGE *\(.*\)$/\1/p' ${srcdir}/src/version.h`
-LIBBACCFG_LT_CURRENT=`sed -n -e 's/^.*LIBBACCFG_LT_CURRENT *\(.*\)$/\1/p' ${srcdir}/src/version.h`
-LIBBACCFG_LT_REVISION=`sed -n -e 's/^.*LIBBACCFG_LT_REVISION *\(.*\)$/\1/p' ${srcdir}/src/version.h`
-LIBBACCFG_LT_AGE=`sed -n -e 's/^.*LIBBACCFG_LT_AGE *\(.*\)$/\1/p' ${srcdir}/src/version.h`
-LIBBACPY_LT_CURRENT=`sed -n -e 's/^.*LIBBACPY_LT_CURRENT *\(.*\)$/\1/p' ${srcdir}/src/version.h`
-LIBBACPY_LT_REVISION=`sed -n -e 's/^.*LIBBACPY_LT_REVISION *\(.*\)$/\1/p' ${srcdir}/src/version.h`
-LIBBACPY_LT_AGE=`sed -n -e 's/^.*LIBBACPY_LT_AGE *\(.*\)$/\1/p' ${srcdir}/src/version.h`
-
-AC_SUBST(LIBBAC_LT_CURRENT)dnl
-AC_SUBST(LIBBAC_LT_REVISION)dnl
-AC_SUBST(LIBBAC_LT_AGE)dnl
-AC_SUBST(LIBBACCFG_LT_CURRENT)dnl
-AC_SUBST(LIBBACCFG_LT_REVISION)dnl
-AC_SUBST(LIBBACCFG_LT_AGE)dnl
-AC_SUBST(LIBBACPY_LT_CURRENT)dnl
-AC_SUBST(LIBBACPY_LT_REVISION)dnl
-AC_SUBST(LIBBACPY_LT_AGE)dnl
+dnl can be overwritten by specific values from version.h
+LIBBAC_LT_RELEASE=`sed -n -e 's/^#.*LIBBAC_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
+LIBBACCFG_LT_RELEASE=`sed -n -e 's/^#.*LIBBACCFG_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
+LIBBACPY_LT_RELEASE=`sed -n -e 's/^#.*LIBBACPY_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
+
+LIBBAC_LT_RELEASE=${LIBBAC_LT_RELEASE:-$VERSION}
+LIBBACCFG_LT_RELEASE=${LIBBACCFG_LT_RELEASE:-$VERSION}
+LIBBACPY_LT_RELEASE=${LIBBACPY_LT_RELEASE:-$VERSION}
+
+AC_SUBST(LIBBAC_LT_RELEASE)dnl
+AC_SUBST(LIBBACCFG_LT_RELEASE)dnl
+AC_SUBST(LIBBACPY_LT_RELEASE)dnl
 
 dnl src/cats
-LIBBACSQL_LT_CURRENT=`sed -n -e 's/^.*LIBBACSQL_LT_CURRENT *\(.*\)$/\1/p' ${srcdir}/src/version.h`
-LIBBACSQL_LT_REVISION=`sed -n -e 's/^.*LIBBACSQL_LT_REVISION *\(.*\)$/\1/p' ${srcdir}/src/version.h`
-LIBBACSQL_LT_AGE=`sed -n -e 's/^.*LIBBACSQL_LT_AGE *\(.*\)$/\1/p' ${srcdir}/src/version.h`
-AC_SUBST(LIBBACSQL_LT_CURRENT)dnl
-AC_SUBST(LIBBACSQL_LT_REVISION)dnl
-AC_SUBST(LIBBACSQL_LT_AGE)dnl
+dnl can be overwritten by specific values from version.h
+LIBBACSQL_LT_RELEASE=`sed -n -e 's/^#.*LIBBACSQL_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
+
+LIBBACSQL_LT_RELEASE=${LIBBACSQL_LT_RELEASE:-$VERSION}
+
+AC_SUBST(LIBBACSQL_LT_RELEASE)dnl
 
 dnl src/findlib
-LIBBACFIND_LT_CURRENT=`sed -n -e 's/^.*LIBBACFIND_LT_CURRENT *\(.*\)$/\1/p' ${srcdir}/src/version.h`
-LIBBACFIND_LT_REVISION=`sed -n -e 's/^.*LIBBACFIND_LT_REVISION *\(.*\)$/\1/p' ${srcdir}/src/version.h`
-LIBBACFIND_LT_AGE=`sed -n -e 's/^.*LIBBACFIND_LT_AGE *\(.*\)$/\1/p' ${srcdir}/src/version.h`
-AC_SUBST(LIBBACFIND_LT_CURRENT)dnl
-AC_SUBST(LIBBACFIND_LT_REVISION)dnl
-AC_SUBST(LIBBACFIND_LT_AGE)dnl
+dnl can be overwritten by specific values from version.h
+LIBBACFIND_LT_RELEASE=`sed -n -e 's/^#.*LIBBACFIND_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
+
+LIBBACFIND_LT_RELEASE=${LIBBACFIND_LT_RELEASE:-$VERSION}
+
+AC_SUBST(LIBBACFIND_LT_RELEASE)dnl
 
 echo "configuring for ${BACULA} $VERSION ($DATE)"
 
@@ -1178,9 +1173,6 @@ if test "x$with_openssl_directory" != "xno"; then
       ]
    )
 
-   LIBS="${saved_LIBS}"
-   CFLAGS="${saved_CFLAGS}"
-
    if test "$support_tls" = "yes"; then
       AC_DEFINE(HAVE_OPENSSL, 1, [Define if OpenSSL library is available])
       AC_DEFINE(HAVE_TLS, 1, [Define if TLS support should be enabled])
@@ -1194,6 +1186,13 @@ if test "x$with_openssl_directory" != "xno"; then
    if test "$ac_cv_openssl_export" = "yes"; then
       AC_DEFINE(HAVE_OPENSSL_EXPORT_LIBRARY, 1, [Define if the OpenSSL library is export-contrained to 128bit ciphers])
    fi
+
+   if test "$support_crypto" = "yes"; then
+      AC_CHECK_LIB(ssl, EVP_PKEY_encrypt_old, AC_DEFINE(HAVE_OPENSSLv1, 1, [Set if have OpenSSL version 1.x]))
+   fi
+
+   LIBS="${saved_LIBS}"
+   CFLAGS="${saved_CFLAGS}"
 else
    support_tls="no"
    support_crypto="no"
@@ -1209,8 +1208,6 @@ fi
 if test "$support_crypto" = "no"; then
    OPENSSL_LIBS=""
    OPENSSL_INC=""
-else
-   AC_CHECK_LIB(ssl, EVP_PKEY_encrypt_old, AC_DEFINE(HAVE_OPENSSLv1, 1, [Set if have OpenSSL version 1.x]))
 fi  
 
 AC_SUBST(OPENSSL_LIBS)
@@ -1751,14 +1748,29 @@ if test $pkg = 0; then
       ]
    )
 fi
+
+dnl For postgresql checking
+saved_LIBS="${LIBS}"
+LIBS="${saved_LIBS} ${SQL_LFLAGS}"
    
-dnl Check if postgresql can support batch mode  
+dnl Check if postgresql can support batch mode
 if test x$DB_TYPE = xpostgresql; then
+   support_batch_insert=yes
    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
+            fi
+        ]
+      )
+   else
+      support_batch_insert=no
    fi
 fi
 
@@ -1770,7 +1782,7 @@ if test x$DB_TYPE = xdbi; then
    if test $DB_PROG = postgresql; then
       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_PQputCopyData" != "xyes"
+      test "x$ac_cv_lib_pq_PQputCopyData" = "xyes"
       pkg=$?
    fi
 
@@ -1802,6 +1814,9 @@ else
    uncomment_dbi="#"  
 fi
 
+dnl revert after postgresql checks
+LIBS="${saved_LIBS}"
+
 AC_SUBST(uncomment_dbi)
 
 dnl For Ingres always enable batch inserts.
@@ -1973,6 +1988,8 @@ AC_LANG_POP(C++)
 
 AC_C_CONST
 
+AC_C_BIGENDIAN([AC_DEFINE([HAVE_BIG_ENDIAN], [1], [Big Endian])], [AC_DEFINE([HAVE_LITTLE_ENDIAN], [1], [Little Endian])])
+
 dnl --------------------------------------------------------------------------
 dnl CHECKING FOR FILESYSTEM TYPE
 dnl --------------------------------------------------------------------------
@@ -2439,10 +2456,10 @@ if test x$support_afs = xyes -o x$support_afs = xauto; then
    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
+        if test -d ${root}/include/afs/ ; then
+           with_afsdir=${root}
+           break
+        fi
       done
    fi
 
@@ -2462,13 +2479,13 @@ if test x$support_afs = xyes -o x$support_afs = xauto; then
    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
+        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
 
@@ -2478,15 +2495,13 @@ if test x$support_afs = xyes -o x$support_afs = xauto; then
    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])
+        AC_DEFINE([HAVE_AFS_ACL],1,[Andrew FileSystem ACL support])
       fi
    fi
 fi
 
 AC_SUBST(AFS_CFLAGS)
 AC_SUBST(AFS_LIBS)
-AC_DEFINE(AFS_CFLAGS)
-AC_DEFINE(AFS_LIBS)
 
 dnl
 dnl Check for ACL support and libraries
@@ -2507,50 +2522,86 @@ have_acl=no
 have_extended_acl=no
 if test x$support_acl = xyes -o x$support_acl = xauto; then
    AC_CHECK_HEADER(sys/acl.h, [ AC_DEFINE(HAVE_SYS_ACL_H,1,[Defines if your system have the sys/acl.h header file])] , )
+
+   dnl
+   dnl First check for acl_get_file in libc
+   dnl
    AC_CHECK_FUNC(acl_get_file,
       [
          have_acl=yes
-      ], [
-         AC_CHECK_LIB(acl, acl_get_file,
-            [
-                have_acl=yes;
-                 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,
-                   [
-                       have_acl=yes;
-                       FDLIBS="-lpacl $FDLIBS"
-                   ], [
-                       AC_CHECK_LIB(sec, acltotext,
-                          [
-                              have_acl=yes;
-                              FDLIBS="-lsec $FDLIBS"
-
-                              AC_CHECK_LIB(sec, acl_totext,
-                                 [
-                                     have_extended_acl=yes
-                                 ]
-                              )
-                          ]
-                       )
-                   ]
-                )
-            ]
-         )
       ]
    )
 
+   dnl
+   dnl Check for acl_get_file in libacl (Linux)
+   dnl
+   if test $have_acl = no; then
+      AC_CHECK_LIB(acl, acl_get_file,
+         [
+            have_acl=yes
+             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
+         ]
+      )
+   fi
+
+   dnl
+   dnl Check for acl_get_file in libpacl (OSF1)
+   dnl
+   if test $have_acl = no; then
+      AC_CHECK_LIB(pacl, acl_get_file,
+         [
+            have_acl=yes
+             FDLIBS="-lpacl $FDLIBS"
+         ]
+      )
+   fi
+
+   dnl
+   dnl Check for acltotext and acl_totext (Solaris)
+   dnl
+   if test $have_acl = no; then
+      AC_CHECK_LIB(sec, acltotext,
+         [
+            have_acl=yes
+             FDLIBS="-lsec $FDLIBS"
+
+             AC_CHECK_LIB(sec, acl_totext,
+                [
+                    have_extended_acl=yes
+                ]
+             )
+         ]
+      )
+   fi
+
+   dnl
+   dnl Check for acl_get and aclx_get (AIX)
+   dnl
+   if test $have_acl = no; then
+      AC_CHECK_FUNC(acl_get,
+         [
+            have_acl=yes
+
+             AC_CHECK_FUNC(aclx_get,
+                [
+                    have_extended_acl=yes
+                ]
+             )
+         ]
+      )
+   fi
+
    if test x$support_acl = xyes -a $have_acl != yes; then
       AC_MSG_ERROR([acl support explicitly enabled but no supported acl implementation found, 
   please either load the acl libraries or rerun configure without --enable-acl])
@@ -2632,7 +2683,33 @@ if test x$support_xattr = xyes -o x$support_xattr = xauto; then
    fi
 
    dnl
-   dnl If we failed to find *BSD support try the Linux or OSX implementation of xattr
+   dnl If we failed to find *BSD support try the AIX implementation of extented attributes (EA)
+   dnl
+   if test $have_xattr = no; then
+      AC_CHECK_HEADER(sys/ea.h, [ AC_DEFINE(HAVE_SYS_EA_H,1,[Defines if your system have the sys/ea.h header file])] , )
+      AC_CHECK_FUNCS(llistea lgetea lsetea,
+        [
+            have_xattr=yes
+            AC_DEFINE([HAVE_LLISTEA],1,[Define to 1 if you have the 'llistea' function.])
+            AC_DEFINE([HAVE_LGETEA],1,[Define to 1 if you have the 'lgetea' function.])
+            AC_DEFINE([HAVE_LSETEA],1,[Define to 1 if you have the 'lsetea' function.])
+        ]
+      )
+
+      if test $have_xattr = no; then
+        AC_CHECK_FUNCS(listea getea setea,
+           [
+               have_xattr=yes
+               AC_DEFINE([HAVE_LISTEA],1,[Define to 1 if you have the 'listea' function.])
+               AC_DEFINE([HAVE_GETEA],1,[Define to 1 if you have the 'getea' function.])
+               AC_DEFINE([HAVE_SETEA],1,[Define to 1 if you have the 'setea' function.])
+           ]
+        )
+      fi
+   fi
+
+   dnl
+   dnl If we failed to find AIX support try the Linux or OSX implementation of xattr
    dnl
    if test $have_xattr = no; then
       AC_CHECK_HEADER(sys/xattr.h, [ AC_DEFINE(HAVE_SYS_XATTR_H,1,[Defines if your system have the sys/xattr.h header file])] , )
@@ -2659,8 +2736,11 @@ if test x$support_xattr = xyes -o x$support_xattr = xauto; then
 
    dnl
    dnl If we failed to find *BSD support and the Linux or OSX implementation of xattr try the Solaris xattr implementation
+   dnl when we are running on an Solaris OS (checked by running uname -s) we don't just check the openat function as
+   dnl the posix openat, fstatat, unlinkat etc. are also available on other os-es but don't indicate xattr support is
+   dnl available.
    dnl
-   if test $have_xattr = no; then
+   if test $have_xattr = no -a `uname -s` = SunOS; then
       AC_CHECK_HEADER(sys/attr.h, [ AC_DEFINE(HAVE_SYS_ATTR_H,1,[Defines if your system have the sys/attr.h header file])] , )
       AC_CHECK_HEADER(sys/nvpair.h, [ AC_DEFINE(HAVE_SYS_NVPAIR_H,1,[Defines if your system have the sys/nvpair.h header file])] , )
       AC_CHECK_HEADER(attr.h, [ AC_DEFINE(HAVE_ATTR_H,1,[Defines if your system have the attr.h header file])] , )
@@ -3175,6 +3255,9 @@ AC_OUTPUT([autoconf/Make.common \
           updatedb/update_mysql_tables_10_to_11 \
           updatedb/update_sqlite3_tables_10_to_11 \
           updatedb/update_postgresql_tables_10_to_11 \
+          updatedb/update_mysql_tables_11_to_12 \
+          updatedb/update_sqlite3_tables_11_to_12 \
+          updatedb/update_postgresql_tables_11_to_12 \
           examples/nagios/check_bacula/Makefile \
           $PFILES ],  
      [ ]
@@ -3218,15 +3301,15 @@ cd ..
 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
+chmod 755 $c/update_mysql_tables_11_to_12   $c/update_sqlite3_tables_11_to_12
+chmod 755 $c/update_postgresql_tables_11_to_12
+
 
 c=src/cats
 
 chmod 755 $c/create_bacula_database   $c/update_bacula_tables  $c/make_bacula_tables
 chmod 755 $c/grant_bacula_privileges  $c/drop_bacula_tables    $c/drop_bacula_database
 
-chmod 755 $c/create_bdb_database      $c/update_bdb_tables     $c/make_bdb_tables
-chmod 755 $c/grant_bdb_privileges     $c/drop_bdb_tables       $c/drop_bdb_database
-
 chmod 755 $c/create_mysql_database    $c/update_mysql_tables   $c/make_mysql_tables
 chmod 755 $c/grant_mysql_privileges   $c/drop_mysql_tables     $c/drop_mysql_database
 
@@ -3352,7 +3435,7 @@ Configuration on `date`:
    build-dird:             ${build_dird}
    build-stored:           ${build_stored}
    Plugin support:         ${have_plugins}
-   AFS support:                    ${have_afs}
+   AFS support:            ${have_afs}
    ACL support:            ${have_acl}
    XATTR support:          ${have_xattr}
    Python support:         ${support_python} ${PYTHON_LIBS}