]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/autoconf/configure.in
Cleanup autoconf output for systemd check.
[bacula/bacula] / bacula / autoconf / configure.in
index ba5cb94ae69766a37d3975f3916e31332c25850f..afeaf9cfa81161bad7f57695c27db2a7599e3f6f 100644 (file)
@@ -380,6 +380,7 @@ build_client_only=no
 build_dird=yes
 build_stored=yes
 db_backends=""
+batch_insert_db_backends=""
 support_lockmgr=no
 
 dnl --------------------------------------------------------------------------
@@ -1701,9 +1702,32 @@ 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
@@ -1716,6 +1740,14 @@ BA_CHECK_SQLITE3_DB
 
 #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
 dnl -------------------------------------------
@@ -1788,102 +1820,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 --------------------------------------------------------------------------
@@ -3183,6 +3125,39 @@ 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-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"
@@ -3315,6 +3290,9 @@ 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 \
           $PFILES ],  
      [ ]
@@ -3460,28 +3438,29 @@ 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}
-   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}
-   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}
+   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