dnl
dnl Process this file with autoconf to produce a configure script.
dnl
-dnl Author: Kern Sibbald, Copyright, 2000-2015
-dnl License: BSD 2-Clause
+dnl Copyright (C) 2000-2017 Kern Sibbald
+dnl License: BSD 2-Clause; see file LICENSE-FOSS
dnl
dnl require a recent autoconf
AC_PREREQ(2.61)
DEPKGS_VERSION=`sed -n -e 's/^#define DEPKGS_VERSION \(.*\)$/\1/p' ${srcdir}/src/cats/cats.h`
DEPKGS_QT_VERSION=`sed -n -e 's/^#define DEPKGS_QT_VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
BQT_VERSION=`sed -n -e 's/^#define BQT_VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
+VIX_VERSION=`sed -n -e 's/^#define VIX_VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
+JAVA_VERSION=`sed -n -e 's/^#define JAVA_VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
+NDMP_VERSION=`sed -n -e 's/^#define NDMP_VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
+LIBRSYNC_VERSION=`sed -n -e 's/^#define LIBRSYNC_VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
AC_SUBST(VERSION)dnl
AC_SUBST(DATE)dnl
AC_SUBST(LSMDATE)dnl
AC_SUBST(DEPKGS_QT_VERSION)dnl
AC_SUBST(DEPKGS_VERSION)dnl
AC_SUBST(BQT4_VERSION)dnl
+AC_SUBST(VIX_VERSION)dnl
+AC_SUBST(JAVA_VERSION)dnl
+AC_SUBST(NDMP_VERSION)dnl
+AC_SUBST(LIBRSYNC_VERSION)dnl
+
dnl src/lib
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}
AC_SUBST(LIBBACFIND_LT_RELEASE)dnl
+dnl PFILES are platform or plugin specific files
+PFILES="platforms/Makefile"
+
echo "configuring for ${BACULA} $VERSION ($DATE)"
dnl Check for compiler.
dnl ------------------------------------------------------
-AC_PROG_CC
+AC_PROG_CC dnl this sets $GCC if using GNU C compiler
AC_PROG_CXX
-AC_PROG_CC_C_O dnl Determine if C compiler support -c -o.
-AC_PROG_GCC_TRADITIONAL dnl Determine if ioctl() need -traditional.
+AC_PROG_CC_C_O dnl Determine if C compiler support -c -o.
+AC_PROG_GCC_TRADITIONAL dnl Determine if ioctl() need -traditional.
BASECC=`basename $CC`
have_gcc=no
-if test "x$BASECC" = xgcc; then
+if test x"$GCC" = "xyes"; then
AC_DEFINE(HAVE_GCC)
have_gcc=yes
fi
AC_PATH_PROG(PKGCONFIG, pkg-config, pkg-config)
AC_PATH_PROG(QMAKE, qmake, none)
AC_PATH_PROG(GMAKE, gmake, none)
-AC_PATH_PROG(CDRECORD, cdrecord, cdrecord)
AC_PATH_PROG(PIDOF, pidof, pidof)
AC_PROG_AWK
# Some AWK programs fail, so test it and warn the user
AC_SUBST(QWT_LIB)
AC_SUBST(QWT)
-
dnl -------------------------------------------
dnl smartalloc (default off)
dnl -------------------------------------------
)
if test x$support_lockmgr = xyes; then
- AC_DEFINE(_USE_LOCKMGR, 1, [Set if you want Lock Manager enabled])
+ AC_DEFINE(USE_LOCKMGR, 1, [Set if you want Lock Manager enabled])
fi
fi
]
)
-if test x$build_dird = xyes; then
- DIRD_DIR="src/dird"
- DIR_TOOLS="DIRTOOLS"
-else
- DIRD_DIR=""
- DIR_TOOLS="NODIRTOOLS"
-fi
+
+DIRD_DIR="src/dird"
+DIR_TOOLS="DIRTOOLS"
+
AC_SUBST(DIRD_DIR)
AC_SUBST(DIR_TOOLS)
if test x$support_ipv6 = xyes; then
AC_TRY_LINK([ #include <sys/types.h>
#include <sys/socket.h>
-#include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;],
+#include <netinet/in.h>], [struct in6_addr t=in6addr_any; t.s6_addr[0] = 0;],
+ [support_in6addr_any=yes], [support_in6addr_any=no])
+
+ if test x$support_in6addr_any = xno ; then
+ in6addr_any="const struct in6_addr in6addr_any"
+ else
+ in6addr_any="1"
+ fi
+
+ AC_TRY_LINK([ #include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>], [$in6addr_any; struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;],
[support_ipv6=yes], [support_ipv6=no])
fi
if test x$support_ipv6 = xyes; then
AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
+
+ if test x$support_in6addr_any = xno ; then
+ AC_DEFINE(NEED_IN6ADDR_ANY,1,[Whether to have in6addr_any support])
+ fi
fi
TERM_LIB=""
AC_HEADER_STAT
AC_HEADER_DIRENT
AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr)
-AC_CHECK_FUNCS(lstat lchown lchmod futimes fchmod fchown)
+AC_CHECK_FUNCS(lstat lchown lchmod futimes fchmod fchown lutimes)
AC_CHECK_FUNCS(nanosleep nl_langinfo)
+AC_CHECK_FUNCS(be64toh htobe64)
AC_CHECK_HEADERS(varargs.h)
dnl End of readline/conio stuff
]
)
-
dnl -----------------------------------------------------------
dnl Check whether OpenSSL is available
dnl -----------------------------------------------------------
AC_SUBST(plugindir)
+dnl ------------------------------------------
+dnl Where to send dump email
+dnl ------------------------------------------
+
dnl ------------------------------------------
dnl Where to send dump email
dnl ------------------------------------------
)
AC_SUBST(db_port)
+dnl
+dnl Pickup MySQL SSL options for database user connection
+dnl
+db_ssl_options=
+AC_ARG_WITH(db_ssl_options,
+ AC_HELP_STRING([--with-db-ssl-options=DBSSLOPTIONS], [specify SSL options for database user connection @<:@default=null@:>@]),
+ [
+ if test "x$withval" != "x" ; then
+ db_ssl_options=$withval
+ fi
+ ]
+)
+AC_SUBST(db_ssl_options)
+
#
# Handle users and groups for each daemon
#
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_CHECK_DECLS([O_CLOEXEC],,[AC_DEFINE([O_CLOEXEC],[0], [Defined to 0 if not provided])],
+[[
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+]])
+
+AC_CHECK_DECLS([FD_CLOEXEC],,[AC_DEFINE([FD_CLOEXEC],[0], [Defined to 0 if not provided])],
+[[
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+]])
+
+AC_CHECK_DECLS([SOCK_CLOEXEC],,[AC_DEFINE([SOCK_CLOEXEC],[0],[Defined to 0 if not provided])],
+[[
+#ifdef HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+]])
+
+AC_CACHE_CHECK(for close on exec modifier for fopen(), ac_cv_feature_stream_cloexec_flag,
+ [if test $ac_cv_have_decl_O_CLOEXEC = yes ; then
+ if test $ac_cv_have_decl_SOCK_CLOEXEC = yes ; then
+ ac_cv_feature_stream_cloexec_flag="e"
+ fi
+ fi])
+
+if test "x$ac_cv_feature_stream_cloexec_flag" = "xe" ; then
+ AC_DEFINE(HAVE_STREAM_CLOEXEC,[0],[Defined to 0 if not provided])
+fi
+
+AC_DEFINE_UNQUOTED([STREAM_CLOEXEC], "$ac_cv_feature_stream_cloexec_flag", [fopen() modifier for setting close on exec flag])
+
+AC_CHECK_FUNC(accept4, [AC_DEFINE(HAVE_ACCEPT4, 1, [Define to 1 if you have the 'accept4' function.])])
+
+S3_INC=
+S3_LIBS=
+S3_LDFLAGS=
+have_libs3=no
+
+if test x$support_s3 = xyes; then
+ AC_ARG_WITH(s3,
+ AC_HELP_STRING([--with-s3@<:@=DIR@:>@], [specify s3 library directory]),
+ [
+ case "$with_s3" in
+ no)
+ :
+ ;;
+ yes|*)
+ if test -f ${with_s3}/include/libs3.h; then
+ S3_INC="-I${with_s3}/include"
+ S3_LDFLAGS="-L${with_s3}/lib"
+ with_s3="${with_s3}/include"
+ else
+ with_s3="/usr/include"
+ fi
+
+ AC_CHECK_HEADER(${with_s3}/libs3.h,
+ [
+ AC_DEFINE(HAVE_LIBS3, 1, [Define to 1 if you have libs3])
+ S3_LIBS="${S3_LDFLAGS} -ls3"
+ have_libs3="yes"
+ ], [
+ echo " "
+ echo "libs3.h not found. s3 turned off ..."
+ echo " "
+ ]
+ )
+ ;;
+ esac
+ ],[
+ AC_CHECK_HEADER(libs3.h,
+ [
+ AC_CHECK_LIB(s3, S3_initialize,
+ [
+ S3_LIBS="-ls3"
+ AC_DEFINE(HAVE_LIBS3,1,[Define to 1 if you have libs3])
+ have_libs3=yes
+ ])
+ ])
+ ])
+fi
+
+AC_SUBST(S3_INC)
+AC_SUBST(S3_LIBS)
+
AC_LANG_PUSH(C++)
AC_CHECK_FUNCS(backtrace)
AC_LANG_POP(C++)
AC_STRUCT_ST_RDEV
AC_STRUCT_TM
AC_C_CONST
+AC_C_RESTRICT
AC_CHECK_SIZEOF(char, 1)
AC_CHECK_SIZEOF(short int, 2)
[#include <fcntl.h>]
)
+AC_CHECK_DECL(
+ F_SETLK,
+ AC_DEFINE(HAVE_FCNTL_LOCK, 1, [Set if fcntl supports file locking]),
+ ,
+ [#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])])
AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
AC_CHECK_FUNCS(posix_fadvise)
+AC_CHECK_FUNCS(posix_fallocate)
AC_CHECK_FUNCS(fdatasync)
AC_CHECK_FUNCS(chflags)
AC_CHECK_HEADER(${with_lzo}/lzo/lzoconf.h,
[
AC_DEFINE(HAVE_LZO, 1, [Define to 1 if you have LZO compression])
- LZO_LIBS="${LZO_LDFLAGS} -lzo2"
+ LZO_LIBS="${LZO_LDFLAGS} -llzo2"
have_lzo="yes"
], [
echo " "
CFLAGS=${CFLAGS--O}
if test x$have_gcc = xyes ; then
- CPPFLAGS="$CPPFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
- CFLAGS="$CFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
+ CPPFLAGS="$CPPFLAGS -x c++ -fno-strict-aliasing -fno-exceptions -fno-rtti"
+ CFLAGS="$CFLAGS -x c++ -fno-strict-aliasing -fno-exceptions -fno-rtti"
fi
LDFLAGS=${LDFLAGS--O}
CPPFLAGS="$CPPFLAGS"
dnl Finally we set appropriate distribution specific
dnl variables and defaults
dnl
-dnl PFILES are platform specific files
-PFILES="platforms/Makefile"
PSCMD="ps -e"
+WIN32=
MACOSX=
COMPRESS_MANPAGES=yes
aix)
DISTVER=`uname -r`
PSCMD="ps -e -o pid,comm"
- PFILES="${PFILES} \
- platforms/aix/Makefile"
- TAPEDRIVE="/dev/rmt0.1"
- ;;
+ PFILES="${PFILES} platforms/aix/Makefile"
+ TAPEDRIVE="/dev/rmt0.1"
+ ;;
alpha)
DISTVER=`uname -r`
PTHREAD_LIB="-lpthread -lexc"
platforms/bsdi/bacula-dir"
largefile_support="yes"
;;
+cygwin)
+ DISTVER=`uname -a |awk '{print $3}'`
+ TAPEDRIVE="/dev/nrst0"
+ WIN32=win32
+ WCFLAGS="-mwindows"
+ WLDFLAGS="-mwindows"
+ ;;
darwin)
DISTVER=`uname -r`
TAPEDRIVE="/dev/nst0"
5.7|5.8)
AC_DEFINE(USE_THR_SETCONCURRENCY)
;;
+ 5.10)
+ AC_DEFINE(HAVE_SOLARIS10, 1, [Set if building on Solaris 10])
+ ;;
*)
;;
esac
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_UNQUOTED(llu, "$llu")
AC_SUBST(TAPEDRIVE)
AC_SUBST(PSCMD)
+AC_SUBST(WIN32)
AC_SUBST(MACOSX)
AC_SUBST(DISTNAME)
AC_SUBST(DISTVER)
exit 1
fi
+
AC_OUTPUT([autoconf/Make.common \
Makefile \
manpages/Makefile \
src/qt-console/bat.conf \
src/qt-console/bat.pro \
src/qt-console/bat.pro.mingw32 \
+ src/qt-console/bat.pro.mingw64 \
src/qt-console/install_conf_file \
+ src/qt-console/tray-monitor/tray-monitor.conf \
+ src/qt-console/tray-monitor/tray-monitor.pro \
+ src/qt-console/tray-monitor/tray-monitor.pro.mingw32 \
+ src/qt-console/tray-monitor/tray-monitor.pro.mingw64 \
src/dird/Makefile \
src/dird/bacula-dir.conf \
src/lib/Makefile \
src/plugins/sd/Makefile \
src/plugins/dir/Makefile \
po/Makefile.in \
+ updatedb/update_mysql_tables \
+ updatedb/update_sqlite3_tables \
+ updatedb/update_postgresql_tables \
updatedb/update_mysql_tables_9_to_10 \
updatedb/update_sqlite3_tables_9_to_10 \
updatedb/update_postgresql_tables_9_to_10 \
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 \
cd ${BUILD_DIR}
cd scripts
-chmod 755 bacula btraceback mtx-changer storage-ctl bsg_persist
+chmod 755 bacula btraceback mtx-changer
chmod 755 dvd-handler dvd-simulator
chmod 755 bconsole disk-changer devel_bacula logrotate
cd ..
echo "
Configuration on `date`:
- Host: ${host}${post_host} -- ${DISTNAME} ${DISTVER}
- Bacula version: ${BACULA} ${VERSION} (${DATE})
- Source code location: ${srcdir}
- Install binaries: ${sbindir}
- Install libraries: ${libdir}
- Install config files: ${sysconfdir}
- Scripts directory: ${scriptdir}
- Archive directory: ${archivedir}
- Working directory: ${working_dir}
- PID directory: ${piddir}
- Subsys directory: ${subsysdir}
- Man directory: ${mandir}
- Data directory: ${datarootdir}
- Plugin directory: ${plugindir}
- C Compiler: ${CC} ${CCVERSION}
- C++ Compiler: ${CXX} ${CXXVERSION}
- Compiler flags: ${WCFLAGS} ${CFLAGS}
- Linker flags: ${WLDFLAGS} ${LDFLAGS}
- Libraries: ${LIBS}
- Statically Linked Tools: ${support_static_tools}
- Statically Linked FD: ${support_static_fd}
- Statically Linked SD: ${support_static_sd}
- Statically Linked DIR: ${support_static_dir}
- Statically Linked CONS: ${support_static_cons}
- Database backends: ${db_backends}
- Database port: ${db_port}
- Database name: ${db_name}
- Database user: ${db_user}
-
- Job Output Email: ${job_email}
- Traceback Email: ${dump_email}
- SMTP Host Address: ${smtp_host}
-
- Director Port: ${dir_port}
- File daemon Port: ${fd_port}
- Storage daemon Port: ${sd_port}
-
- Director User: ${dir_user}
- Director Group: ${dir_group}
- Storage Daemon User: ${sd_user}
- Storage DaemonGroup: ${sd_group}
- 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}
- 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}
- systemd support: ${support_systemd} ${SYSTEMD_UNITDIR}
- Batch insert enabled: ${batch_insert_db_backends}
+ Host: ${host}${post_host} -- ${DISTNAME} ${DISTVER}
+ Bacula version: ${BACULA} ${VERSION} (${DATE})
+ Source code location: ${srcdir}
+ Install binaries: ${sbindir}
+ Install libraries: ${libdir}
+ Install config files: ${sysconfdir}
+ Scripts directory: ${scriptdir}
+ Archive directory: ${archivedir}
+ Working directory: ${working_dir}
+ PID directory: ${piddir}
+ Subsys directory: ${subsysdir}
+ Man directory: ${mandir}
+ Data directory: ${datarootdir}
+ Plugin directory: ${plugindir}
+ C Compiler: ${CC} ${CCVERSION}
+ C++ Compiler: ${CXX} ${CXXVERSION}
+ Compiler flags: ${WCFLAGS} ${CFLAGS}
+ Linker flags: ${WLDFLAGS} ${LDFLAGS}
+ Libraries: ${LIBS}
+ Statically Linked Tools: ${support_static_tools}
+ Statically Linked FD: ${support_static_fd}
+ Statically Linked SD: ${support_static_sd}
+ Statically Linked DIR: ${support_static_dir}
+ Statically Linked CONS: ${support_static_cons}
+ Database backends: ${db_backends}
+ Database port: ${db_port}
+ Database name: ${db_name}
+ Database user: ${db_user}
+ Database SSL options: ${db_ssl_options}
+
+ Job Output Email: ${job_email}
+ Traceback Email: ${dump_email}
+ SMTP Host Address: ${smtp_host}
+
+ Director Port: ${dir_port}
+ File daemon Port: ${fd_port}
+ Storage daemon Port: ${sd_port}
+
+ Director User: ${dir_user}
+ Director Group: ${dir_group}
+ Storage Daemon User: ${sd_user}
+ Storage DaemonGroup: ${sd_group}
+ 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}
+ 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}
+ systemd support: ${support_systemd} ${SYSTEMD_UNITDIR}
+ Batch insert enabled: ${batch_insert_db_backends}
" > config.out