]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/autoconf/configure.in
Implement feature request #1939
[bacula/bacula] / bacula / autoconf / configure.in
index 690b548e605034d85d641d14318312229352fc1a..de09194390db0d47c098e0a8e4289039eb688410 100644 (file)
@@ -4,7 +4,9 @@ dnl Process this file with autoconf to produce a configure script.
 dnl
 dnl require a recent autoconf
 AC_PREREQ(2.61)
-AC_INIT(src/version.h)
+AC_INIT([bacula], m4_esyscmd([sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' ../src/version.h src/version.h 2> /dev/null | tr -d '\n']))
+AC_CONFIG_SRCDIR(src/version.h)
+
 BUILD_DIR=`pwd`
 cd ..
 TOP_DIR=`pwd`
@@ -176,6 +178,7 @@ AC_ARG_ENABLE(libtool,
    ]
 )
 LT_INIT([shared disable-static])
+LT_LIB_DLLOAD
 LT_LANG([C++])
 
 if test x$use_libtool != xno; then
@@ -335,12 +338,12 @@ fi
 dnl -------------------------------------------------------------------------
 dnl  If the user has not set --htmldir, we default to /usr/share/doc/bacula/html
 dnl -------------------------------------------------------------------------
-if test x$htmldir = x${docdir} ; then
-   htmldir=`eval echo ${docdir}bacula/html`
+if test x$htmldir = x'/usr/share/doc/bacula/' ; then
+   htmldir=`eval echo ${docdir}html`
 fi
 
 dnl -------------------------------------------------------------------------
-dnl  If the user has not set --docdir, we default to /usr/share/doc/
+dnl  If the user has not set --docdir, we default to /usr/share/doc/bacula
 dnl -------------------------------------------------------------------------
 if test x$docdir = x'/usr/share/doc/' ; then
    docdir=`eval echo ${docdir}bacula`
@@ -378,6 +381,7 @@ build_client_only=no
 build_dird=yes
 build_stored=yes
 db_backends=""
+batch_insert_db_backends=""
 support_lockmgr=no
 
 dnl --------------------------------------------------------------------------
@@ -385,7 +389,7 @@ dnl CHECKING COMMAND LINE OPTIONS
 dnl --------------------------------------------------------------------------
 
 dnl -------------------------------------------
-dnl gnome (default off)
+dnl gnome -- no longer supported
 dnl -------------------------------------------
 AC_ARG_ENABLE(gnome,
    AC_HELP_STRING([--enable-gnome], [enable build of bgnome-console GUI @<:@default=no@:>@]),
@@ -833,7 +837,7 @@ if test x$support_conio = xyes; then
       support_readline=no
       AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled]) 
    else
-      echo " "; echo "Required libraries not found. CONIO turned off ..."; echo " "],
+      echo " "; echo "Required libraries not found. CONIO turned off ..."; echo " "
    fi
 fi
 
@@ -954,7 +958,7 @@ AC_ARG_WITH(python,
                PYTHON_LIBS=`/usr/bin/python-config --libs`
             else
                for python_root in /usr /usr/local /usr/sfw; do
-                  for ver in python2.2 python2.3 python2.4 python2.5 python2.6 python3; do
+                  for ver in python2.2 python2.3 python2.4 python2.5 python2.6 python2.7 python3; do
                      if test -f $python_root/include/${ver}/Python.h; then
                         PYTHON_INCDIR=-I$python_root/include/${ver}
                         if test -d $python_root/lib64/${ver}/config; then
@@ -1169,6 +1173,7 @@ if test "x$with_openssl_directory" != "xno"; then
       ]
    )
 
+   AC_MSG_RESULT([$support_tls])
    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])
@@ -1192,19 +1197,13 @@ if test "x$with_openssl_directory" != "xno"; then
 else
    support_tls="no"
    support_crypto="no"
-   OPENSSL_LIBS=""
-   OPENSSL_INC=""
+   AC_MSG_RESULT([$support_tls])
 fi
-AC_MSG_RESULT([$support_tls])
 
-if test "$support_tls" = "no"; then
+if test "$support_tls" = "no" -o "$support_crypto" = "no"; then
    OPENSSL_LIBS=""
    OPENSSL_INC=""
-fi  
-if test "$support_crypto" = "no"; then
-   OPENSSL_LIBS=""
-   OPENSSL_INC=""
-fi  
+fi
 
 AC_SUBST(OPENSSL_LIBS)
 AC_SUBST(OPENSSL_INC)
@@ -1266,6 +1265,11 @@ hostname=`uname -n | cut -d '.' -f 1`
 if test x${hostname} = x ; then
   hostname="localhost"
 fi
+dnl Make sure hostname is resolved
+ping -c 1 $hostname 2>/dev/null 1>/dev/null
+if test ! $? = 0; then
+  hostname="localhost"
+fi
 AC_ARG_WITH(hostname,
    AC_HELP_STRING([--with-hostname=RESNAME], [specify host name for daemons]),
    [
@@ -1297,7 +1301,7 @@ AC_SUBST(scriptdir)
 dnl ------------------------------------------
 dnl Where to place bsrdir (bsr files)
 dnl ------------------------------------------
-bsrdir=/tmp
+bsrdir=`eval echo ${prefix}/var/bacula/working`
 AC_ARG_WITH(bsrdir,
    AC_HELP_STRING([--with-bsrdir=PATH], [specify path of Bacula bsrs directory]),
    [
@@ -1312,7 +1316,7 @@ AC_SUBST(bsrdir)
 dnl ------------------------------------------
 dnl Where to place logdir (bsr files)
 dnl ------------------------------------------
-logdir=/tmp
+logdir=`eval echo ${prefix}/var/bacula/working`
 AC_ARG_WITH(logdir,
    AC_HELP_STRING([--with-logdir=PATH], [specify path of Bacula logs directory]),
    [
@@ -1704,20 +1708,51 @@ AC_ARG_WITH(sbin-perm,
 
 AC_SUBST(SBINPERM)
 
+dnl -------------------------------------------
+dnl enable batch attribute DB insert (default on)
+dnl -------------------------------------------
+support_batch_insert=yes
+AC_ARG_ENABLE(batch-insert,
+   AC_HELP_STRING([--enable-batch-insert], [enable the DB batch insert code @<:@default=yes@:>@]),
+   [
+       if test x$enableval = xno; then
+         support_batch_insert=no
+       fi
+   ]
+)
+
+if test x$support_batch_insert = xyes; then
+   AC_DEFINE(USE_BATCH_FILE_INSERT, 1, [Set if DB batch insert code enabled])
+fi
+
 dnl ------------------------------------------------
 dnl Bacula check for various SQL database engines
 dnl ------------------------------------------------
+
+dnl
+dnl Set uncomment_dbi by default to '#' if DBI is enabled this will get reset
+dnl
+uncomment_dbi="#"
+
 BA_CHECK_POSTGRESQL_DB
 
 BA_CHECK_MYSQL_DB
 
 BA_CHECK_SQLITE3_DB
 
-BA_CHECK_INGRES_DB
+#BA_CHECK_INGRES_DB
 
-BA_CHECK_DBI_DB
+#BA_CHECK_DBI_DB
 
-BA_CHECK_DBI_DRIVER
+#BA_CHECK_DBI_DRIVER
+
+dnl -------------------------------------------
+dnl If no batch insert backend are enable set
+dnl variable to None
+dnl -------------------------------------------
+if test -z "${batch_insert_db_backends}"; then
+   batch_insert_db_backends="None"
+fi
 
 dnl -------------------------------------------
 dnl Make sure at least one database backend is found
@@ -1726,7 +1761,7 @@ if test "x${db_backends}" = "x" ; then
    echo " "
    echo " "
    echo "You have not specified either --enable-client-only or one of the"
-   echo "supported databases: MySQL, PostgreSQL, Ingres, SQLite3 or DBI."
+   echo "supported databases: MySQL, PostgreSQL, or SQLite3."
    echo "This is not permitted. Please reconfigure."
    echo " "
    echo "Aborting the configuration ..."
@@ -1760,7 +1795,7 @@ case `echo $DB_BACKENDS | wc -w | sed -e 's/^ *//'` in
         echo " "
         echo " "
         echo "You have specified two or more of the"
-        echo "supported databases: MySQL, PostgreSQL, Ingres, SQLite3 or DBI."
+        echo "supported databases: MySQL, PostgreSQL, or SQLite3."
         echo "This is not permitted when not using libtool Please reconfigure."
         echo " "
         echo "Aborting the configuration ..."
@@ -1791,102 +1826,12 @@ if test x$use_libtool = xyes; then
    DB_LIBS=""
 fi
 
+AC_SUBST(uncomment_dbi)
 AC_SUBST(DB_BACKENDS)
 AC_SUBST(DB_LIBS)
 AC_SUBST(DEFAULT_DB_TYPE)
 AC_SUBST(SHARED_CATALOG_TARGETS)
 
-dnl -------------------------------------------
-dnl enable batch attribute DB insert (default on)
-dnl -------------------------------------------
-support_batch_insert=yes
-AC_ARG_ENABLE(batch-insert,
-   AC_HELP_STRING([--enable-batch-insert], [enable the DB batch insert code @<:@default=yes@:>@]),
-   [
-       if test x$enableval = xno; then
-         support_batch_insert=no
-       fi
-   ]
-)
-
-if test x$support_batch_insert = xyes; then
-   AC_DEFINE(USE_BATCH_FILE_INSERT, 1, [Set if DB batch insert code enabled])
-fi
-
-dnl -------------------------------------------
-dnl Check if mysql supports batch mode  
-dnl -------------------------------------------
-if test ! -z "$MYSQL_LIB"; then
-   AC_CHECK_LIB(mysql_r, mysql_thread_safe, AC_DEFINE(HAVE_MYSQL_THREAD_SAFE, 1, [Set if have mysql_thread_safe]))
-fi
-
-dnl -------------------------------------------
-dnl Check if sqlite supports batch mode   
-dnl -------------------------------------------
-if test ! -z "SQLITE_LIB"; then
-   AC_CHECK_LIB(sqlite3, sqlite3_threadsafe, AC_DEFINE(HAVE_SQLITE3_THREADSAFE, 1, [Set if have sqlite3_threadsafe]))
-fi
-
-dnl -------------------------------------------
-dnl Check if postgresql supports batch mode   
-dnl -------------------------------------------
-if test ! -z "$POSTGRESQL_LIB"; then
-   dnl For postgresql checking
-   saved_LIBS="${LIBS}"
-   LIBS="${saved_LIBS} ${POSTGRESQL_LIB}"
-   
-   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
-      if test $support_batch_insert = yes ; then
-        AC_DEFINE(HAVE_POSTGRESQL_BATCH_FILE_INSERT, 1, [Set if PostgreSQL DB batch insert code enabled])
-      fi
-   fi
-
-   if test x$ac_cv_lib_pq_PQisthreadsafe != xyes -a x$support_batch_insert = xyes
-   then
-      echo "WARNING: Your PostgreSQL client library is too old to detect "
-      echo "if it was compiled with --enable-thread-safety, consider to "
-      echo "upgrade it in order to avoid problems with Batch insert mode"
-      echo
-   fi
-
-   dnl Revert after postgresql checks
-   LIBS="${saved_LIBS}"
-fi
-
-dnl -------------------------------------------
-dnl Check if dbi supports batch mode   
-dnl -------------------------------------------
-if test ! -z "$DBI_LIBS"; then
-   dnl -------------------------------------------
-   dnl Push the DB_PROG onto the stack of supported database backends for DBI
-   dnl -------------------------------------------
-   DB_BACKENDS="${DB_BACKENDS} ${DB_PROG}"
-
-   dnl -------------------------------------------
-   dnl Check for batch insert
-   dnl -------------------------------------------
-   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"
-      pkg=$?
-      if test $pkg = 0; then
-        if test $support_batch_insert = yes ; then
-           AC_DEFINE(HAVE_DBI_BATCH_FILE_INSERT, 1, [Set if DBI DB batch insert code enabled])
-        fi
-      fi
-   fi
-else 
-   dnl -------------------------------------------
-   dnl If dbi was not chosen, let the comment in file
-   dnl -------------------------------------------
-   uncomment_dbi="#"  
-fi
-
-AC_SUBST(uncomment_dbi)
-
 AC_DEFINE(PROTOTYPES)
 
 dnl --------------------------------------------------------------------------
@@ -1921,6 +1866,7 @@ AC_CHECK_HEADERS( \
    stdarg.h \
    stdlib.h \
    stdint.h \
+   inttypes.h \
    string.h \
    strings.h \
    termios.h \
@@ -2104,6 +2050,10 @@ AC_MSG_RESULT($fstype)
 
 AC_CHECK_HEADER(sys/statvfs.h, [ AC_DEFINE(HAVE_SYS_STATVFS_H,1,[Defines if your system have the sys/statvfs.h header file])] , )
 
+AC_LANG_PUSH(C++)
+AC_CHECK_FUNCS(backtrace)
+AC_LANG_POP(C++)
+
 dnl --------------------------------------------------------------------------
 dnl CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
 dnl --------------------------------------------------------------------------
@@ -2399,6 +2349,14 @@ AC_CHECK_FUNCS( \
    [echo 'configure: cannot find needed function.'; exit 1]
 )
 
+AC_CHECK_DECL(
+    F_CLOSEM,
+    AC_DEFINE(HAVE_FCNTL_F_CLOSEM, 1, [Set if you have 'F_CLOSEM' fcntl flag]),
+    ,
+    [#include <fcntl.h>]
+)
+
+AC_CHECK_FUNC(closefrom, [AC_DEFINE(HAVE_CLOSEFROM, 1, [Define to 1 if you have the 'closefrom' function.])])
 AC_CHECK_FUNCS(getpagesize, [AC_DEFINE(HAVE_GETPAGESIZE, 1, [Set if have getpagesize])])
 AC_CHECK_FUNCS(malloc_trim, [AC_DEFINE(HAVE_MALLOC_TRIM, 1, [Set if have malloc_trim])])
 
@@ -2467,6 +2425,58 @@ if test $ac_cv_struct_sockaddr_sa_len = yes; then
   AC_DEFINE(HAVE_SA_LEN, 1, [Define if sa_len field exists in struct sockaddr])
 fi
 
+dnl
+dnl check for working getaddrinfo()
+dnl
+dnl Note that if the system doesn't have gai_strerror(), we
+dnl can't use getaddrinfo() because we can't get strings
+dnl describing the error codes.
+dnl
+AC_CACHE_CHECK(for working getaddrinfo, ac_cv_working_getaddrinfo,
+   [
+       AC_TRY_RUN(
+         [
+             #include <netdb.h>
+             #include <string.h>
+             #include <sys/types.h>
+             #include <sys/socket.h>
+
+             void main(void) {
+                 struct addrinfo hints, *ai;
+                 int error;
+
+                 memset(&hints, 0, sizeof(hints));
+                 hints.ai_family = AF_UNSPEC;
+                 hints.ai_socktype = SOCK_STREAM;
+                 error = getaddrinfo("127.0.0.1", NULL, &hints, &ai);
+                 if (error) {
+                     exit(1);
+                 }
+                 if (ai->ai_addr->sa_family != AF_INET) {
+                     exit(1);
+                 }
+                 exit(0);
+             }
+         ],[
+             ac_cv_working_getaddrinfo="yes"
+         ],[
+             ac_cv_working_getaddrinfo="no"
+         ],[
+             ac_cv_working_getaddrinfo="yes"
+         ]
+       )
+   ]
+)
+AC_CHECK_FUNC(gai_strerror, [AC_DEFINE(HAVE_GAI_STRERROR, 1, [Define to 1 if you have the 'gai_strerror' function.])])
+
+if test "$ac_cv_working_getaddrinfo" = "yes"; then
+  if test "$ac_cv_func_gai_strerror" != "yes"; then
+    ac_cv_working_getaddrinfo="no"
+  else
+    AC_DEFINE(HAVE_GETADDRINFO, 1, [Define to 1 if getaddrinfo exists and works])
+  fi
+fi
+
 AC_FUNC_STRFTIME
 AC_FUNC_VPRINTF
 AC_FUNC_ALLOCA
@@ -2489,6 +2499,24 @@ if test x$ZLIBS = x-lz; then
 fi
 AC_SUBST(ZLIBS)
 
+dnl
+dnl Check for lzo
+dnl
+have_lzo=no
+AC_CHECK_HEADER(lzo/lzoconf.h, 
+[
+   AC_CHECK_HEADER(lzo/lzo1x.h,
+   [
+      AC_CHECK_LIB(lzo2, lzo1x_1_compress,
+      [
+        LZOLIBS="-llzo2"
+        AC_DEFINE(HAVE_LZO,1,[Define to 1 if you have LZO compression])
+        have_lzo=yes
+      ])
+   ])
+])
+AC_SUBST(LZOLIBS)
+
 dnl
 dnl Check if we have AFS on this system
 dnl
@@ -2522,46 +2550,77 @@ if test x$support_afs = xyes -o x$support_afs = xauto; then
            with_afsdir=${root}
            break
         fi
+        if test -d ${root}/include/openafs/afs/ ; then
+           with_afsdir=${root}
+           break
+        fi
       done
    fi
 
-   AFS_CFLAGS="-I${with_afsdir}/include"
+   if test -d ${with_afsdir}/include/afs/ ; then
+      AFS_CFLAGS="-I${with_afsdir}/include"
+   else
+      if test -d ${with_afsdir}/include/openafs/afs/ ; then
+        AFS_CFLAGS="-I${with_afsdir}/include/openafs"
+      fi
+   fi
 
    saved_CFLAGS="${CFLAGS}"
+   saved_CPPFLAGS="${CPPFLAGS}"
    CFLAGS="${AFS_CFLAGS} ${saved_CFLAGS}"
+   CPPFLAGS="${AFS_CFLAGS} ${saved_CPPFLAGS}"
 
-   AC_CHECK_HEADERS(afs/stds.h)
+   AC_CHECK_HEADERS(afs/afsint.h)
+   AC_TRY_CPP(
+       [
+         #include <afs/afsint.h>
+         #include <afs/venus.h>
+       ],
+       AC_DEFINE(HAVE_AFS_VENUS_H,1,[Define to 1 if you have the <afs/venus.h> header file.])
+   )
 
    CFLAGS="${saved_CFLAGS}"
+   CPPFLAGS="${saved_CPPFLAGS}"
 
    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
+   AC_MSG_CHECKING(for pioctl in AFS libsys)
+   for dir in ${with_afsdir}/lib \
+             ${with_afsdir}/lib/afs \
+             ${with_afsdir}/lib/openafs \
+             ${with_afsdir}/lib64 \
+             ${with_afsdir}/lib64/afs \
+             ${with_afsdir}/lib64/openafs
    do
       for arch_type in .a .so
       do
-        A=`test -f ${dir}/libsys${arch_type} && nm ${dir}/libsys${arch_type} | grep pioctl`
+        A=`test -f ${dir}/libsys${arch_type} && nm ${dir}/libsys${arch_type} 2>/dev/null | grep pioctl`
         pkg=$?
         if test $pkg = 0; then
            have_afs=yes
-           AFS_LIBS="-L${dir} -lsys -lrx -llwp ${dir}/util.a"
+           AFS_LIBS="-L${dir} -lsys -lrx -llwp ${dir}/util${arch_type}"
            break
         fi
       done
    done
 
+   if test $have_afs = yes; then
+      AC_MSG_RESULT(yes)
+   else
+      AC_MSG_RESULT(no)
+   fi
+
    if test x$support_afs = xyes -a $have_afs != yes; then
-      AC_MSG_ERROR([afs support explicitly enabled but no supported afs implementation found, 
+      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])
+        AC_DEFINE(HAVE_AFS,1,[Define to 1 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)
 
@@ -2619,14 +2678,55 @@ if test x$support_acl = xyes -o x$support_acl = xauto; then
 
    dnl
    dnl Check for acl_get_file in libpacl (OSF1)
+   dnl and if ACL_TYPE_DEFAULT_DIR is defined.
    dnl
-   if test $have_acl = no; then
+   if test $have_acl = no -a \
+          x${HAVE_OSF1_OS_TRUE} = x; then
       AC_CHECK_LIB(pacl, acl_get_file,
         [
             have_acl=yes
             FDLIBS="-lpacl $FDLIBS"
         ]
       )
+
+      AC_MSG_CHECKING(for ACL_TYPE_DEFAULT_DIR in acl.h include file)
+      grep ACL_TYPE_DEFAULT_DIR /usr/include/sys/acl.h > /dev/null 2>&1
+      if test $? = 0; then
+        AC_DEFINE(HAVE_ACL_TYPE_DEFAULT_DIR,1,[Defines if your system have the ACL_TYPE_DEFAULT_DIR acl type])
+        AC_MSG_RESULT(yes)
+      else
+        AC_MSG_RESULT(no)
+      fi
+   fi
+
+   dnl
+   dnl On OSX check for availability of ACL_TYPE_EXTENDED
+   dnl
+   if test $have_acl = yes -a \
+          x${HAVE_DARWIN_OS_TRUE} = x; then
+      AC_MSG_CHECKING(for ACL_TYPE_EXTENDED in acl.h include file)
+      grep ACL_TYPE_EXTENDED /usr/include/sys/acl.h > /dev/null 2>&1
+      if test $? = 0; then
+        AC_DEFINE(HAVE_ACL_TYPE_EXTENDED,1,[Defines if your system have the ACL_TYPE_EXTENDED acl type])
+        AC_MSG_RESULT(yes)
+      else
+        AC_MSG_RESULT(no)
+      fi
+   fi
+
+   dnl
+   dnl On FreeBSD check for availability of ACL_TYPE_NFS4
+   dnl
+   if test $have_acl = yes -a \
+          x${HAVE_FREEBSD_OS_TRUE} = x; then
+      AC_MSG_CHECKING(for ACL_TYPE_NFS4 in acl.h include file)
+      grep ACL_TYPE_NFS4 /usr/include/sys/acl.h > /dev/null 2>&1
+      if test $? = 0; then
+        AC_DEFINE(HAVE_ACL_TYPE_NFS4,1,[Defines if your system have the ACL_TYPE_NFS4 acl type])
+        AC_MSG_RESULT(yes)
+      else
+        AC_MSG_RESULT(no)
+      fi
    fi
 
    dnl
@@ -2941,16 +3041,7 @@ PFILES="platforms/Makefile"
 PSCMD="ps -e"
 WIN32=
 MACOSX=
-
-hostname=`uname -n | cut -d '.' -f 1`
-if test x${hostname} = x ; then
-   hostname="localhost"
-fi
-dnl Make sure hostname is resolved
-ping -c 1 $hostname 2>/dev/null 1>/dev/null
-if test ! $? = 0; then
-  hostname="localhost"
-fi
+COMPRESS_MANPAGES=yes
 
 case "$DISTNAME" in
 aix)
@@ -3061,6 +3152,16 @@ freebsd)
        platforms/freebsd/bacula-dir"
    largefile_support="yes"
   ;;
+hurd)
+   DISTVER=`uname -r`
+   TAPEDRIVE="/dev/nst0"
+   PSCMD="ps -e -o pid,command"
+   PFILES="${PFILES} \
+       platforms/hurd/Makefile \
+       platforms/hurd/bacula-fd \
+       platforms/hurd/bacula-sd \
+       platforms/hurd/bacula-dir"
+  ;;
 hpux)
    PSCMD="UNIX95=1; ps -e -o pid,comm"
    CFLAGS="${CFLAGS} -D_XOPEN_SOURCE_EXTENDED=1"
@@ -3168,9 +3269,18 @@ solaris)
        platforms/solaris/bacula-fd \
        platforms/solaris/bacula-sd \
        platforms/solaris/bacula-dir"
-   if test x$DISTVER = x5.6 ; then
-       AC_DEFINE(HAVE_OLD_SOCKOPT)
-   fi
+   COMPRESS_MANPAGES=
+   case ${DISTVER} in
+   5.5|5.6)
+      AC_DEFINE(HAVE_OLD_SOCKOPT)
+      AC_DEFINE(USE_THR_SETCONCURRENCY)
+      ;;
+   5.7|5.8)
+      AC_DEFINE(USE_THR_SETCONCURRENCY)
+      ;;
+   *)
+      ;;
+   esac
    LIBS="$LIBS -lresolv -lrt"
   ;;
 suse)
@@ -3205,6 +3315,40 @@ unknown)
   ;;
 esac  
 
+dnl -------------------------------------------
+dnl systemd (default off)
+dnl -------------------------------------------
+AC_MSG_CHECKING(for systemd support)
+AC_ARG_WITH(systemd,
+   AC_HELP_STRING([--with-systemd@<:@=UNITDIR@:>@], [Include systemd support. UNITDIR is where systemd system .service files are located, default is to ask systemctl.]),
+   [
+       if test "$withval" != "no"; then
+          if test "$withval" = "yes"; then
+              SYSTEMD_UNITDIR="`systemctl show | grep UnitPath | cut -d " " -f2`"
+          else
+              SYSTEMD_UNITDIR="${withval}"
+          fi
+
+          PFILES="${PFILES} \
+                  platforms/systemd/Makefile \
+                  platforms/systemd/bacula.conf \
+                  platforms/systemd/bacula-dir.service \
+                  platforms/systemd/bacula-fd.service \
+                  platforms/systemd/bacula-sd.service"
+          AC_DEFINE(HAVE_SYSTEMD, 1, [Define to 1 if systemd support should be enabled])
+          AC_MSG_RESULT(yes)
+          support_systemd="yes"
+       else
+          AC_MSG_RESULT(no)
+          support_systemd="no"
+       fi
+   ],[
+       support_systemd="no"
+       AC_MSG_RESULT(no)
+   ]
+)
+AC_SUBST(SYSTEMD_UNITDIR)
+
 AC_SUBST(hostname)
 
 LIBS="$PTHREAD_LIB $LIBS"
@@ -3217,6 +3361,7 @@ AC_SUBST(WIN32)
 AC_SUBST(MACOSX)
 AC_SUBST(DISTNAME)
 AC_SUBST(DISTVER)
+AC_SUBST(COMPRESS_MANPAGES)
 
 dnl common parts of the Makefile
 MCOMMON=./autoconf/Make.common
@@ -3254,7 +3399,6 @@ AC_OUTPUT([autoconf/Make.common \
           scripts/bacula.desktop.gnome2.consolehelper \
           scripts/bacula.desktop.gnome1.xsu \
           scripts/bacula.desktop.gnome2.xsu \
-          scripts/bgnome-console.console_apps \
           scripts/mtx-changer \
           scripts/disk-changer \
           scripts/dvd-handler \
@@ -3312,12 +3456,6 @@ AC_OUTPUT([autoconf/Make.common \
           src/cats/grant_sqlite3_privileges \
           src/cats/drop_sqlite3_tables \
           src/cats/drop_sqlite3_database \
-          src/cats/create_ingres_database \
-          src/cats/update_ingres_tables \
-          src/cats/make_ingres_tables \
-          src/cats/grant_ingres_privileges \
-          src/cats/drop_ingres_tables \
-          src/cats/drop_ingres_database \
           src/cats/sqlite \
           src/cats/mysql \
           src/cats/create_bacula_database \
@@ -3326,6 +3464,7 @@ AC_OUTPUT([autoconf/Make.common \
           src/cats/make_bacula_tables \
           src/cats/drop_bacula_tables \
           src/cats/drop_bacula_database \
+          src/cats/install-default-backend \
           src/findlib/Makefile \
           src/tools/Makefile \
           src/plugins/fd/Makefile \
@@ -3342,7 +3481,14 @@ AC_OUTPUT([autoconf/Make.common \
           updatedb/update_mysql_tables_11_to_12 \
           updatedb/update_sqlite3_tables_11_to_12 \
           updatedb/update_postgresql_tables_11_to_12 \
+          updatedb/update_mysql_tables_12_to_14 \
+          updatedb/update_sqlite3_tables_12_to_14 \
+          updatedb/update_postgresql_tables_12_to_14 \
           examples/nagios/check_bacula/Makefile \
+          platforms/rpms/redhat/bacula.spec \
+          platforms/rpms/redhat/bacula-bat.spec \
+          platforms/rpms/redhat/bacula-docs.spec \
+          platforms/rpms/redhat/bacula-mtx.spec \
           $PFILES ],  
      [ ]
 )
@@ -3402,14 +3548,16 @@ chmod 755 $c/grant_sqlite3_privileges  $c/drop_sqlite3_tables    $c/drop_sqlite3_d
 chmod 755 $c/create_postgresql_database  $c/update_postgresql_tables $c/make_postgresql_tables
 chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables   $c/drop_postgresql_database
 
-chmod 755 $c/create_ingres_database  $c/update_ingres_tables $c/make_ingres_tables
-chmod 755 $c/grant_ingres_privileges $c/drop_ingres_tables   $c/drop_ingres_database
+#chmod 755 $c/create_ingres_database  $c/update_ingres_tables $c/make_ingres_tables
+#chmod 755 $c/grant_ingres_privileges $c/drop_ingres_tables   $c/drop_ingres_database
 
 
 chmod 755 $c/make_catalog_backup $c/delete_catalog_backup  $c/make_catalog_backup.pl
 chmod 755 $c/sqlite
 chmod 755 $c/mysql
 
+chmod 755 $c/install-default-backend
+
 chmod 755 src/win32/build-depkgs-mingw32
 
 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
@@ -3485,28 +3633,30 @@ Configuration on `date`:
    File Daemon User:        ${fd_user}
    File Daemon Group:       ${fd_group}
  
-   Large file support:     $largefile_support
-   Bacula conio support:    ${got_conio} ${CONS_LIBS}
-   readline support:       ${got_readline} ${PRTREADLINE_SRC}
-   TCP Wrappers support:    ${TCPW_MSG} ${WRAPLIBS}
-   TLS support:            ${support_tls}
-   Encryption support:     ${support_crypto} 
-   ZLIB support:           ${have_zlib}
-   enable-smartalloc:      ${support_smartalloc} 
-   enable-lockmgr:         ${support_lockmgr}
-   bat support:            ${support_bat}
-   enable-gnome:           ${support_gnome} ${gnome_version}
-   enable-bwx-console:     ${support_wx_console} ${wx_version}
-   enable-tray-monitor:     ${support_tray_monitor}
-   client-only:            ${build_client_only}
-   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}
-   Batch insert enabled:    ${support_batch_insert}
+   Large file support:      $largefile_support
+   Bacula conio support:     ${got_conio} ${CONS_LIBS}
+   readline support:        ${got_readline} ${PRTREADLINE_SRC}
+   TCP Wrappers support:     ${TCPW_MSG} ${WRAPLIBS}
+   TLS support:             ${support_tls}
+   Encryption support:      ${support_crypto} 
+   ZLIB support:            ${have_zlib}
+   LZO support:             ${have_lzo}
+   enable-smartalloc:       ${support_smartalloc} 
+   enable-lockmgr:          ${support_lockmgr}
+   bat support:             ${support_bat}
+   enable-gnome:            ${support_gnome} ${gnome_version}
+   enable-bwx-console:      ${support_wx_console} ${wx_version}
+   enable-tray-monitor:      ${support_tray_monitor}
+   client-only:             ${build_client_only}
+   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}
+   systemd support:         ${support_systemd} ${SYSTEMD_UNITDIR}
+   Batch insert enabled:     ${batch_insert_db_backends}
 
   " > config.out