]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/autoconf/configure.in
Reverted the change of TRU64 to OSF1 for the OS detection rules. Although Compaq...
[bacula/bacula] / bacula / autoconf / configure.in
index f0f8595739b50ff038c5fae8cb3dcb90ca4697f4..2ffb3abbc419d391a13d69ead8fe87228029aafb 100644 (file)
@@ -1749,17 +1749,48 @@ if test $pkg = 0; then
    )
 fi
 
+if test x$support_batch_insert = xno; then
+  if test x$DB_TYPE = xmysql; then
+    A=`test -f $MYSQL_LIBDIR/libmysqlclient_r.so && nm -D $MYSQL_LIBDIR/libmysqlclient_r.so | grep pthread_mutex_lock`
+    pkg=$?
+    if test $pkg = 0; then
+      support_batch_insert=yes
+      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
+fi  
+
 dnl For postgresql checking
 saved_LIBS="${LIBS}"
 LIBS="${saved_LIBS} ${SQL_LFLAGS}"
    
 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
 
@@ -1771,7 +1802,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
 
@@ -2511,50 +2542,88 @@ 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 -a \
+           x${HAVE_SUN_OS}_TRUE = x; 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 -a \
+           x${HAVE_AIX_OS}_TRUE = x; 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])
@@ -2588,83 +2657,111 @@ have_xattr=no
 if test x$support_xattr = xyes -o x$support_xattr = xauto; then
    dnl
    dnl First check for *BSD support
+   dnl When running on a BSD variant
    dnl
-   AC_CHECK_HEADER(sys/extattr.h, [ AC_DEFINE(HAVE_SYS_EXTATTR_H,1,[Defines if your system have the sys/extattr.h header file])] , )
-   AC_CHECK_HEADER(libutil.h, [ AC_DEFINE(HAVE_LIBUTIL_H,1,[Defines if your system have the libutil.h header file])] , )
-   AC_CHECK_FUNCS(extattr_get_link extattr_set_link extattr_list_link,
-      [
-         have_xattr=yes
-         AC_DEFINE([HAVE_EXTATTR_GET_LINK],1,[Define to 1 if you have the 'extattr_get_link' function.])
-         AC_DEFINE([HAVE_EXTATTR_SET_LINK],1,[Define to 1 if you have the 'extattr_set_link' function.])
-         AC_DEFINE([HAVE_EXTATTR_LIST_LINK],1,[Define to 1 if you have the 'extattr_list_link' function.])
-      ]
-   )
-   
-   if test $have_xattr = no; then
-      AC_CHECK_FUNCS(extattr_get_file extattr_set_file extattr_list_file,
-        [
+   if test x${HAVE_FREEBSD_OS}_TRUE = x -o \
+           x${HAVE_NETBSD_OS}_TRUE = x -o \
+           x${HAVE_OPENBSD_OS}_TRUE = x; then
+      AC_CHECK_HEADER(sys/extattr.h, [ AC_DEFINE(HAVE_SYS_EXTATTR_H,1,[Defines if your system have the sys/extattr.h header file])] , )
+      AC_CHECK_HEADER(libutil.h, [ AC_DEFINE(HAVE_LIBUTIL_H,1,[Defines if your system have the libutil.h header file])] , )
+      AC_CHECK_FUNCS(extattr_get_link extattr_set_link extattr_list_link,
+         [
             have_xattr=yes
-            AC_DEFINE([HAVE_EXTATTR_GET_FILE],1,[Define to 1 if you have the 'extattr_get_file' function.])
-            AC_DEFINE([HAVE_EXTATTR_SET_FILE],1,[Define to 1 if you have the 'extattr_set_file' function.])
-            AC_DEFINE([HAVE_EXTATTR_LIST_FILE],1,[Define to 1 if you have the 'extattr_list_file' function.])
-        ]
+            AC_DEFINE([HAVE_EXTATTR_GET_LINK],1,[Define to 1 if you have the 'extattr_get_link' function.])
+            AC_DEFINE([HAVE_EXTATTR_SET_LINK],1,[Define to 1 if you have the 'extattr_set_link' function.])
+            AC_DEFINE([HAVE_EXTATTR_LIST_LINK],1,[Define to 1 if you have the 'extattr_list_link' function.])
+         ]
       )
-   fi
    
-   if test $have_xattr = yes; then
-      have_extattr_string_in_libc=no
-      AC_CHECK_FUNCS(extattr_namespace_to_string extattr_string_to_namespace,
-        [
-            have_extattr_string_in_libc=yes
-            AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
-            AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
-        ]
-      )
-
-      dnl
-      dnl If extattr_namespace_to_string and extattr_string_to_namespace are not in libc see if they are in libutil
-      dnl
-      if test $have_extattr_string_in_libc = no; then
-        AC_CHECK_LIB(util, extattr_namespace_to_string extattr_string_to_namespace,
+      if test $have_xattr = no; then
+         AC_CHECK_FUNCS(extattr_get_file extattr_set_file extattr_list_file,
            [
-               AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
-               AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
-               FDLIBS="-lutil $FDLIBS"
+               have_xattr=yes
+               AC_DEFINE([HAVE_EXTATTR_GET_FILE],1,[Define to 1 if you have the 'extattr_get_file' function.])
+               AC_DEFINE([HAVE_EXTATTR_SET_FILE],1,[Define to 1 if you have the 'extattr_set_file' function.])
+               AC_DEFINE([HAVE_EXTATTR_LIST_FILE],1,[Define to 1 if you have the 'extattr_list_file' function.])
            ]
-        )
+         )
+      fi
+   
+      if test $have_xattr = yes; then
+         have_extattr_string_in_libc=no
+         AC_CHECK_FUNCS(extattr_namespace_to_string extattr_string_to_namespace,
+           [
+               have_extattr_string_in_libc=yes
+               AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
+               AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
+           ]
+         )
+
+         dnl
+         dnl If extattr_namespace_to_string and extattr_string_to_namespace are not in libc see if they are in libutil
+         dnl
+         if test $have_extattr_string_in_libc = no; then
+           AC_CHECK_LIB(util, extattr_namespace_to_string extattr_string_to_namespace,
+              [
+                  AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
+                  AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
+                  FDLIBS="-lutil $FDLIBS"
+              ]
+           )
+         fi
       fi
    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 When running on AIX
    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])] , )
-      AC_CHECK_FUNCS(llistxattr lgetxattr lsetxattr,
+   if test $have_xattr = no -a \
+           x${HAVE_AIX_OS}_TRUE = x; 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_LLISTXATTR],1,[Define to 1 if you have the 'llistxattr' function.])
-            AC_DEFINE([HAVE_LGETXATTR],1,[Define to 1 if you have the 'lgetxattr' function.])
-            AC_DEFINE([HAVE_LSETXATTR],1,[Define to 1 if you have the 'lsetxattr' function.])
+            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(listxattr getxattr setxattr,
+        AC_CHECK_FUNCS(listea getea setea,
            [
                have_xattr=yes
-               AC_DEFINE([HAVE_LISTXATTR],1,[Define to 1 if you have the 'listxattr' function.])
-               AC_DEFINE([HAVE_GETXATTR],1,[Define to 1 if you have the 'getxattr' function.])
-               AC_DEFINE([HAVE_SETXATTR],1,[Define to 1 if you have the 'setxattr' function.])
+               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 *BSD support and the Linux or OSX implementation of xattr try the Solaris xattr implementation
+   dnl If we failed to find AIX support try the TRU64 implementation of extented attributes
+   dnl when running on a TRU64 OS.
    dnl
-   if test $have_xattr = no; then
+   if test $have_xattr = no -a \
+           x${HAVE_OSF1_OS}_TRUE = x; then
+      AC_CHECK_HEADER(sys/proplist.h, [ AC_DEFINE(HAVE_SYS_PROPLIST_H,1,[Defines if your system have the sys/proplist.h header file])] , )
+      AC_CHECK_FUNCS(getproplist get_proplist_entry sizeof_proplist_entry add_proplist_entry setproplist,
+        [
+            have_xattr=yes
+            AC_DEFINE([HAVE_GETPROPLIST],1,[Define to 1 if you have the 'getproplist' function.])
+            AC_DEFINE([HAVE_GET_PROPLIST_ENTRY],1,[Define to 1 if you have the 'get_proplist_entry' function.])
+            AC_DEFINE([HAVE_SIZEOF_PROPLIST_ENTRY],1,[Define to 1 if you have the 'sizeof_proplist_entry' function.])
+            AC_DEFINE([HAVE_ADD_PROPLIST_ENTRY],1,[Define to 1 if you have the 'add_proplist_entry' function.])
+            AC_DEFINE([HAVE_SETPROPLIST],1,[Define to 1 if you have the 'setproplist' function.])
+        ]
+      )
+   fi
+
+   dnl
+   dnl If we failed to find TRU64 support try the SOLARIS implementation of extented and extensible attributes
+   dnl when running on a Solaris.
+   dnl
+   if test $have_xattr = no -a \
+           x${HAVE_SUN_OS}_TRUE = x; 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])] , )
@@ -2690,6 +2787,32 @@ if test x$support_xattr = xyes -o x$support_xattr = xauto; then
       fi
    fi
 
+   dnl
+   dnl If we failed to find Solaris support try the generic xattr support code
+   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])] , )
+      AC_CHECK_FUNCS(llistxattr lgetxattr lsetxattr,
+        [
+            have_xattr=yes
+            AC_DEFINE([HAVE_LLISTXATTR],1,[Define to 1 if you have the 'llistxattr' function.])
+            AC_DEFINE([HAVE_LGETXATTR],1,[Define to 1 if you have the 'lgetxattr' function.])
+            AC_DEFINE([HAVE_LSETXATTR],1,[Define to 1 if you have the 'lsetxattr' function.])
+        ]
+      )
+
+      if test $have_xattr = no; then
+        AC_CHECK_FUNCS(listxattr getxattr setxattr,
+           [
+               have_xattr=yes
+               AC_DEFINE([HAVE_LISTXATTR],1,[Define to 1 if you have the 'listxattr' function.])
+               AC_DEFINE([HAVE_GETXATTR],1,[Define to 1 if you have the 'getxattr' function.])
+               AC_DEFINE([HAVE_SETXATTR],1,[Define to 1 if you have the 'setxattr' function.])
+           ]
+        )
+      fi
+   fi
+
    if test x$support_xattr = xyes -a $have_xattr != yes; then
       AC_MSG_ERROR([xattr support explicitly enabled but no supported xattr implementation found, 
   please either load the xattr libraries or rerun configure without --enable-xattr])