X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=bacula%2Fautoconf%2Fconfigure.in;h=c1623a37797f6210c9303a2c7fad1168dec1181d;hb=10cfd798ced2d27f61ead2de6fe9b1bcc8e3468d;hp=acbdf2f9087c6b9cfe2061ab3f29e05647c959d9;hpb=ca5fe9aa968d204da71887b212675a1c995895ad;p=bacula%2Fbacula diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in index acbdf2f908..c1623a3779 100644 --- a/bacula/autoconf/configure.in +++ b/bacula/autoconf/configure.in @@ -2,9 +2,12 @@ dnl dnl dnl Process this file with autoconf to produce a configure script. dnl +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) -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_INIT([bacula], m4_esyscmd([sed -n -e 's/^#define VERSION.*"\(.*\)"$/\1/p' ../src/version.h src/version.h 2> /dev/null | tr -d '\n'])) AC_CONFIG_SRCDIR(src/version.h) BUILD_DIR=`pwd` @@ -19,7 +22,7 @@ AC_CONFIG_HEADERS(src/config.h:autoconf/config.h.in) dnl minimal Win32 stuff for "make clean" WIN32BUILDDIR=${BUILD_DIR}/src/win32 WIN32MAINDIR=${BUILD_DIR} -WIN32TOPDIR=${TOP_DIR} +WIN32TOPDIR=${TOP_DIR} AC_SUBST(WIN32BUILDDIR) AC_SUBST(WIN32MAINDIR) AC_SUBST(WIN32TOPDIR) @@ -35,16 +38,31 @@ if test "x$BACULA" != x; then post_host=`echo -${BACULA} | tr 'A-Z ' 'a-z-'` fi 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 +VERSION=`sed -n -e 's/^#define VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h` +RELEASE=`sed -n -e 's/^#define RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h` +DATE=`sed -n -e 's/^#define BDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h` +LSMDATE=`sed -n -e 's/^#define LSMDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h` +BDB_VERSION=`sed -n -e 's/^#define BDB_VERSION \(.*\)$/\1/p' ${srcdir}/src/cats/cats.h` +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(BACULA)dnl AC_SUBST(post_host)dnl AC_SUBST(BDB_VERSION)dnl +AC_SUBST(DEPKGS_QT_VERSION)dnl +AC_SUBST(DEPKGS_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 @@ -54,11 +72,9 @@ LIBBACPY_LT_RELEASE=`sed -n -e 's/^#.*LIBBACPY_LT_RELEASE.*"\(.*\)"$/\1/p' ${src 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 dnl can be overwritten by specific values from version.h @@ -79,6 +95,9 @@ LIBBACFIND_LT_RELEASE=${LIBBACFIND_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)" @@ -86,14 +105,14 @@ dnl ------------------------------------------------------- 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 @@ -130,23 +149,16 @@ AC_PATH_PROG(DVDRWFORMAT, dvd+rw-format, dvd+rw-format) AC_PATH_PROG(PKGCONFIG, pkg-config, pkg-config) AC_PATH_PROG(QMAKE, qmake, none) AC_PATH_PROG(GMAKE, gmake, none) -AC_ARG_VAR(WXCONFIG, [wx-config command. On some systems, you must set it to wx-config-2.6 to use wxWidgets 2.6.]) -if test "x$WXCONFIG" = x; then - WXCONFIG=wx-config -fi -AC_PATH_PROG(WXCONFIG, ${WXCONFIG}, ${WXCONFIG}) -AC_ARG_VAR(WXFLAGS, [Parameters to pass to wx-config (e.g. --unicode=no).]) -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 -if echo xfoo | $AWK 'BEGIN { prog=ARGV[1]; ARGC=1 } +if echo xfoo | $AWK 'BEGIN { prog=ARGV[1]; ARGC=1 } { if ((prog == $2) || (("(" prog ")") == $2) || (("[" prog "]") == $2) || ((prog ":") == $2)) { print $1 ; exit 0 } }' xfoo>/dev/null; then :; else AC_MSG_ERROR([!!!!!!!!! WARNING !!!!!!!!!!!!!! - The regex engine of $AWK is too broken to be used you + The regex engine of $AWK is too broken to be used you might want to install GNU AWK. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!]) fi @@ -178,6 +190,7 @@ AC_ARG_ENABLE(libtool, ] ) LT_INIT([shared disable-static]) +LT_LIB_DLLOAD LT_LANG([C++]) if test x$use_libtool != xno; then @@ -317,7 +330,7 @@ libdir=`eval echo ${libdir}` includedir=`eval echo ${includedir}` localedir=`eval echo ${datarootdir}/locale` AC_DEFINE_UNQUOTED(SYSCONFDIR, "$sysconfdir") -AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir") +AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir") dnl ------------------------------------------------------------------ dnl If the user has not set --sbindir, we set our default as /sbin @@ -348,7 +361,7 @@ if test x$docdir = x'/usr/share/doc/' ; then docdir=`eval echo ${docdir}bacula` fi - + AC_PATH_PROGS(MSGFMT, msgfmt, no) if test "$MSGFMT" = "no" then @@ -361,21 +374,16 @@ fi support_smartalloc=yes support_readline=yes +support_lzo=yes support_conio=yes -support_gnome=no support_bat=no -support_wx_console=no -support_tray_monitor=no support_tls=no support_crypto=no -gnome_version= -wx_version= support_static_tools=no support_static_fd=no support_static_sd=no support_static_dir=no support_static_cons=no -support_python=no build_client_only=no build_dird=yes build_stored=yes @@ -387,33 +395,14 @@ dnl -------------------------------------------------------------------------- dnl CHECKING COMMAND LINE OPTIONS dnl -------------------------------------------------------------------------- -dnl ------------------------------------------- -dnl gnome -- no longer supported -dnl ------------------------------------------- -AC_ARG_ENABLE(gnome, - AC_HELP_STRING([--enable-gnome], [enable build of bgnome-console GUI @<:@default=no@:>@]), - [ - if test x$enableval = xyes; then - support_gnome=yes - fi - ] -) - -GNOME_DIR= -if test x$support_gnome = xyes; then - AC_MSG_ERROR(bgnome-console no longer supported) - AC_MSG_ERROR(--enable-gnome option no longer supported) -fi -# AC_SUBST(GNOME_DIR) - dnl ------------------------------------------- dnl bat (default off) dnl ------------------------------------------- AC_ARG_ENABLE(bat, - AC_HELP_STRING([--enable-bat], [enable build of bat Qt4 GUI @<:@default=no@:>@]), + AC_HELP_STRING([--enable-bat], [enable build of bat Qt GUI @<:@default=no@:>@]), [ if test x$enableval = xyes; then - AC_DEFINE(HAVE_BAT, 1, [Set if Bacula bat Qt4 GUI support enabled]) + AC_DEFINE(HAVE_BAT, 1, [Set if Bacula bat Qt GUI support enabled]) support_bat=yes fi ] @@ -421,148 +410,29 @@ AC_ARG_ENABLE(bat, BAT_DIR= if test x$support_bat = xyes; then - abc=`$PKGCONFIG --atleast-version=4.2 QtGui` +dnl look for Qt4 + abc=`$PKGCONFIG QtGui` pkg=$? if test $pkg = 0; then BAT_DIR=src/qt-console else - AC_MSG_ERROR(Unable to find Qt4 installation needed by bat) +dnl look for Qt5 + abc=`$PKGCONFIG Qt5Gui` + pkg=$? + if test $pkg = 0; then + BAT_DIR=src/qt-console + else + AC_MSG_ERROR(Unable to find either Qt4 or Qt5 installation needed by bat) + fi fi fi -dnl -dnl The qwt library was used with bat, but that is no longer the case -dnl -got_qwt=no -QWT_INC= -QWT_LDFLAGS= -QWT_LIB= -QWT= -no_qwt=no -dnl if test x$support_bat = xyes; then -dnl AC_MSG_CHECKING(for qwt support) -dnl AC_ARG_WITH(qwt, -dnl AC_HELP_STRING([--with-qwt@<:@=DIR@:>@], [specify qwt library directory]), -dnl [ -dnl case "$with_qwt" in -dnl no) -dnl no_qwt=yes -dnl ;; -dnl yes|*) -dnl if test -f ${with_qwt}/include/qwt.h; then -dnl QWT_INC="${with_qwt}/include" -dnl QWT_LDFLAGS="-L${with_qwt}/lib" -dnl QWT_LIB="-lqwt" -dnl QWT="qwt" -dnl fi -dnl ;; -dnl esac -dnl ] -dnl ) - -dnl dnl -dnl dnl Search in standard places, or --with-qwt not specified -dnl dnl -dnl if test $no_qwt = no; then -dnl if test x$QWT_INC = x; then -dnl for root in /usr /usr/local; do -dnl for ver in qwt qwt5 qwt-qt4; do -dnl if test -f ${root}/include/${ver}/qwt.h; then -dnl QWT_INC="${root}/include/${ver}" -dnl if test -d ${root}/lib64/; then -dnl QWT_LDFLAGS="-L${root}/lib64" -dnl elif test -d ${root}/lib/64/; then -dnl QWT_LDFLAGS="-L${root}/64" -dnl else -dnl QWT_LDFLAGS="-L${root}/lib" -dnl fi -dnl QWT_LIB="-lqwt" -dnl QWT="qwt" -dnl got_qwt=yes -dnl break; -dnl fi -dnl done -dnl done -dnl fi -dnl fi -dnl if test x$QWT_INC = x; then -dnl AC_MSG_RESULT(no) -dnl else -dnl AC_DEFINE(HAVE_QWT, 1, [Set if bat QWT library found]) -dnl AC_MSG_RESULT(yes) -dnl fi -dnl fi - AC_SUBST(BAT_DIR) AC_SUBST(QWT_INC) AC_SUBST(QWT_LDFLAGS) AC_SUBST(QWT_LIB) AC_SUBST(QWT) -dnl ------------------------------------------- -dnl bwx-console (default off) -dnl ------------------------------------------- -AC_ARG_ENABLE(bwx-console, - AC_HELP_STRING([--enable-bwx-console], [enable build of wxWidgets console @<:@default=no@:>@]), - [ - if test x$enableval = xyes; then - support_wx_console=yes - fi - ] -) - -WX_DIR= -if test x$support_wx_console = xyes; then - abc=`$WXCONFIG $WXFLAGS --cppflags` - pkg=$? - if test $pkg = 0; then - wx_version="wxWidgets `$WXCONFIG $WXFLAGS --release`" - WXCONS_CPPFLAGS=`$WXCONFIG $WXFLAGS --cppflags` - WXCONS_LDFLAGS=`$WXCONFIG $WXFLAGS --libs` - - AC_SUBST(WXCONS_CPPFLAGS) - AC_SUBST(WXCONS_LDFLAGS) - WX_DIR="src/wx-console" - else - echo " " - echo "wx-config program not found. bwx-console disabled." - echo " " - support_wx_console=no - fi -fi -AC_SUBST(WX_DIR) - -dnl ------------------------------------------- -dnl tray-monitor (default off) -dnl ------------------------------------------- -AC_ARG_ENABLE(tray-monitor, - AC_HELP_STRING([--enable-tray-monitor], [enable build of Gnome tray monitor (compatible with KDE @<:@default=no@:>@]), - [ - if test x$enableval = xyes; then - support_tray_monitor=yes - fi - ] -) - -TRAY_MONITOR_DIR= -if test x$support_tray_monitor = xyes; then - abc=`$PKGCONFIG --exists gtk+-2.0` - pkg=$? - if test $pkg = 0; then - TRAY_MONITOR_CPPFLAGS=`$PKGCONFIG --cflags gtk+-2.0` - TRAY_MONITOR_LDFLAGS=`$PKGCONFIG --libs gtk+-2.0` - AC_SUBST(TRAY_MONITOR_CPPFLAGS) - AC_SUBST(TRAY_MONITOR_LDFLAGS) - TRAY_MONITOR_DIR=src/tray-monitor - abc=`$PKGCONFIG --atleast-version=2.4 gtk+-2.0` - pkg=$? - if test $pkg = 0; then - AC_DEFINE(HAVE_GTK_2_4, 1, [Set if you have GTK 4.2 or greater loaded]) - fi - fi -fi -AC_SUBST(TRAY_MONITOR_DIR) - dnl ------------------------------------------- dnl smartalloc (default off) dnl ------------------------------------------- @@ -592,7 +462,7 @@ AC_ARG_ENABLE(lockmgr, ) 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 @@ -604,7 +474,7 @@ AC_ARG_ENABLE(static-tools, [ if test x$enableval = xyes; then if test x$use_libtool = xyes; then - AC_MSG_ERROR([Libtool is enabled, not compatible with static tools, + AC_MSG_ERROR([Libtool is enabled, not compatible with static tools, please rerun configure with --disable-libtool]) fi support_static_tools=yes @@ -626,7 +496,7 @@ AC_ARG_ENABLE(static-fd, [ if test x$enableval = xyes; then if test x$use_libtool = xyes; then - AC_MSG_ERROR([Libtool is enabled, not compatible with static tools, + AC_MSG_ERROR([Libtool is enabled, not compatible with static tools, please rerun configure with --disable-libtool]) fi support_static_fd=yes @@ -648,7 +518,7 @@ AC_ARG_ENABLE(static-sd, [ if test x$enableval = xyes; then if test x$use_libtool = xyes; then - AC_MSG_ERROR([Libtool is enabled, not compatible with static tools, + AC_MSG_ERROR([Libtool is enabled, not compatible with static tools, please rerun configure with --disable-libtool]) fi support_static_sd=yes @@ -670,7 +540,7 @@ AC_ARG_ENABLE(static-dir, [ if test x$enableval = xyes; then if test x$use_libtool = xyes; then - AC_MSG_ERROR([Libtool is enabled, not compatible with static tools, + AC_MSG_ERROR([Libtool is enabled, not compatible with static tools, please rerun configure with --disable-libtool]) fi support_static_dir=yes @@ -692,7 +562,7 @@ AC_ARG_ENABLE(static-cons, [ if test x$enableval = xyes; then if test x$use_libtool = xyes; then - AC_MSG_ERROR([Libtool is enabled, not compatible with static tools, + AC_MSG_ERROR([Libtool is enabled, not compatible with static tools, please rerun configure with --disable-libtool]) fi support_static_cons=yes @@ -701,16 +571,10 @@ AC_ARG_ENABLE(static-cons, ) STATIC_CONS= -STATIC_GNOME_CONS= -STATIC_WX_CONS= if test x$support_static_cons = xyes; then STATIC_CONS="static-bconsole" - STATIC_GNOME_CONS="static-bgnome-console" - STATIC_WX_CONS="static-bwx-console" fi AC_SUBST(STATIC_CONS) -AC_SUBST(STATIC_GNOME_CONS) -AC_SUBST(STATIC_WX_CONS) dnl ------------------------------------------- dnl client_only (default off) @@ -743,13 +607,10 @@ AC_ARG_ENABLE(build-dird, 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) @@ -783,18 +644,18 @@ AC_ARG_ENABLE(conio, fi ] ) - + dnl --------------------------------------------------- dnl Check for IPv6 support dnl --------------------------------------------------- dnl this allows you to turn it completely off support_ipv6=yes -AC_ARG_ENABLE(ipv6, +AC_ARG_ENABLE(ipv6, AC_HELP_STRING([--enable-ipv6], [enable ipv6 support @<:@default=yes@:>@]), [ if test x$enableval = xno; then - support_ipv6=no + support_ipv6=no fi ] ) @@ -802,16 +663,31 @@ AC_ARG_ENABLE(ipv6, if test x$support_ipv6 = xyes; then AC_TRY_LINK([ #include #include -#include ], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;], +#include ], [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 +#include +#include ], [$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_CHECK_HEADER(curses.h, [ +AC_CHECK_HEADER(curses.h, [ AC_CHECK_LIB(tinfo, tgetent, [ TERM_LIB="-ltinfo" ], [ AC_CHECK_LIB(ncurses, tgetent, [ TERM_LIB="-lncurses" ], [ AC_CHECK_LIB(termcap, tgetent, [ TERM_LIB="-ltermcap" ]) @@ -820,7 +696,7 @@ AC_CHECK_HEADER(curses.h, [ ], [ AC_CHECK_HEADERS(curses.h) AC_CHECK_HEADER(term.h, - [ AC_CHECK_LIB(curses, tgetent, + [ AC_CHECK_LIB(curses, tgetent, [ TERM_LIB="-lcurses" ] ) ]) ]) @@ -834,7 +710,7 @@ if test x$support_conio = xyes; then CONS_SRC="conio.c" got_conio="yes" support_readline=no - AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled]) + AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled]) else echo " "; echo "Required libraries not found. CONIO turned off ..."; echo " " fi @@ -853,9 +729,6 @@ AC_ARG_ENABLE(readline, fi ] ) -if test x$TERM_LIB = x ; then - support_readline=no -fi got_readline="no" READLINE_SRC= @@ -876,14 +749,14 @@ if test x$support_readline = xyes; then CONS_LDFLAGS="-L${with_readline}/lib" with_readline="${with_readline}/include/readline" else - with_readline="/usr/include/readline" + with_readline="/usr/include/readline" fi - AC_CHECK_HEADER(${with_readline}/readline.h, + AC_CHECK_HEADER(${with_readline}/readline.h, [ AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support]) - CONS_LIBS="-lreadline -lhistory $TERM_LIB" - got_readline="yes" + CONS_LIBS="-lreadline -lhistory ${TERM_LIB}" + got_readline="yes" ], [ echo " " echo "readline.h not found. readline turned off ..." @@ -894,20 +767,20 @@ if test x$support_readline = xyes; then esac ],[ dnl check for standard readline library - AC_CHECK_HEADER(/usr/include/readline/readline.h, + AC_CHECK_HEADER(/usr/include/readline/readline.h, [ AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support]) got_readline="yes" CONS_INC="-I/usr/include/readline" - CONS_LIBS="-lreadline $TERM_LIB" + CONS_LIBS="-lreadline ${TERM_LIB}" ], [ dnl Did not find standard library, so try Bacula's default - AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h, + AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h, [ AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support]) - got_readline="yes" + got_readline="yes" CONS_INC="-I${TOP_DIR}/depkgs/readline" - CONS_LIBS="-lreadline -lhistory $TERM_LIB" + CONS_LIBS="-lreadline -lhistory ${TERM_LIB}" CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline" PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline" ], [ @@ -918,7 +791,7 @@ if test x$support_readline = xyes; then ) ] ) - ] + ] ) fi @@ -934,102 +807,15 @@ MAKE_SHELL=/bin/sh AC_SUBST(MAKE_SHELL) AC_HEADER_STAT AC_HEADER_DIRENT -AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr lstat lchown) +AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr) +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 ----------------------------------------------------------------------- -dnl Check for Python support -dnl -AC_MSG_CHECKING(for Python support) -AC_ARG_WITH(python, - AC_HELP_STRING([--with-python@<:@=DIR@:>@], [Include Python support. DIR is the Python base install directory, default is to search through a number of common places for the Python files.]), - [ - PYTHON_INCDIR= - PYTHON_LIBS= - if test "$withval" != "no"; then - if test "$withval" = "yes"; then - if test -e /usr/bin/python-config ; then - PYTHON_INCDIR=`/usr/bin/python-config --includes` - 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 - 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 - PYTHON_LIBS="-L$python_root/lib64/${ver}/config -l${ver}" - else - PYTHON_LIBS="-L$python_root/lib/${ver}/config -l${ver}" - fi - break - fi - done - done - - if test x$PYTHON_INCDIR = x; then - if test -f $prefix/include/Python.h; then - PYTHON_INCDIR=-I$prefix/include - if test -d $prefix/lib64/config; then - PYTHON_LIBS="-L$prefix/lib64/config -lpython" - else - PYTHON_LIBS="-L$prefix/lib/config -lpython" - fi - else - AC_MSG_RESULT(no) - AC_MSG_ERROR(Unable to find Python.h in standard locations) - fi - fi - fi - else - if test -e $withval/bin/python-config ; then - PYTHON_INCDIR=`$withval/bin/python-config --includes` - PYTHON_LIBS=`$withval/bin/python-config --libs` - elif test -f $withval/Python.h; then - PYTHON_INCDIR=-I$withval - PYTHON_LIBS="-L$withval/config -lpython" - elif test -f $withval/include/Python.h; then - PYTHON_INCDIR=-I$withval/include - if test -d $withval/lib64/config; then - PYTHON_LIBS="-L$withval/lib64/config -lpython" - else - PYTHON_LIBS="-L$withval/lib/config -lpython" - fi - elif test -f $withval/include/python/Python.h; then - PYTHON_INCDIR=-I$withval/include/python - if test -d $withval/lib64/python/config; then - PYTHON_LIBS="-L$withval/lib64/python/config -lpython" - else - PYTHON_LIBS="-L$withval/lib/python/config -lpython" - fi - else - AC_MSG_RESULT(no) - AC_MSG_ERROR(Invalid Python directory $withval - unable to find Python.h under $withval) - fi - fi - - AC_DEFINE([HAVE_PYTHON], 1) - AC_MSG_RESULT(yes) - support_python=yes - AC_MSG_NOTICE(checking for more Python libs) - saved_LIBS="$LIBS"; LIBS= - AC_SEARCH_LIBS(shm_open, [rt]) - AC_CHECK_LIB(util, openpty) - PYTHON_LIBS="$PYTHON_LIBS $LIBS" - LIBS="$saved_LIBS" - else - AC_MSG_RESULT(no) - fi - ],[ - AC_MSG_RESULT(no) - ] -) -AC_SUBST(PYTHON_LIBS) -AC_SUBST(PYTHON_INCDIR) - dnl dnl Find where sockets are (especially for Solaris) dnl Do this before the TCP Wrappers test since tcp wrappers @@ -1044,7 +830,7 @@ AC_CHECK_FUNC(socket, dnl ----------------------------------------------------------- dnl Check whether user wants TCP wrappers support (default off) dnl ----------------------------------------------------------- -TCPW_MSG="no" +TCPW_MSG="no" WRAPLIBS="" AC_ARG_WITH(tcp-wrappers, AC_HELP_STRING([--with-tcp-wrappers@<:@=DIR@:>@], [enable tcpwrappers support]), @@ -1055,7 +841,7 @@ AC_ARG_WITH(tcp-wrappers, AC_SEARCH_LIBS(nanosleep, [rt]) AC_MSG_CHECKING(for libwrap) AC_TRY_LINK( - [ + [ #include #include int deny_severity = 0; @@ -1066,7 +852,7 @@ AC_ARG_WITH(tcp-wrappers, ], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support]) - TCPW_MSG="yes" + TCPW_MSG="yes" LIBS="$saved_LIBS" WRAPLIBS="-lwrap" ], [ @@ -1084,7 +870,7 @@ AC_ARG_WITH(tcp-wrappers, ], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support]) - TCPW_MSG="yes" + TCPW_MSG="yes" LIBS="$saved_LIBS" WRAPLIBS="-lwrap" ], [ @@ -1215,11 +1001,11 @@ AC_SEARCH_LIBS(dlopen, [dl]) dnl ------------------------------------------ dnl Where to place working dir dnl ------------------------------------------ -working_dir=`eval echo ${prefix}/var/bacula/working` +working_dir=`eval echo /opt/bacula/working` AC_ARG_WITH(working-dir, AC_HELP_STRING([--with-working-dir=PATH], [specify path of Bacula working directory]), [ - if test "x$withval" != "xno" ; then + if test "x$withval" != "xno" ; then working_dir=$withval fi ] @@ -1234,7 +1020,7 @@ archivedir=/tmp AC_ARG_WITH(archivedir, AC_HELP_STRING([--with-archivedir=PATH], [specify path of SD archive directory]), [ - if test "x$withval" != "xno" ; then + if test "x$withval" != "xno" ; then archivedir=$withval fi ] @@ -1249,7 +1035,7 @@ basename=`hostname` AC_ARG_WITH(basename, AC_HELP_STRING([--with-basename=RESNAME], [specify base resource name for daemons]), [ - if test "x$withval" != "xno" ; then + if test "x$withval" != "xno" ; then basename=$withval fi ] @@ -1288,7 +1074,7 @@ scriptdir=`eval echo ${sysconfdir}` AC_ARG_WITH(scriptdir, AC_HELP_STRING([--with-scriptdir=PATH], [specify path of Bacula scripts directory]), [ - if test "x$withval" != "xno" ; then + if test "x$withval" != "xno" ; then scriptdir=$withval fi ] @@ -1300,11 +1086,11 @@ AC_SUBST(scriptdir) dnl ------------------------------------------ dnl Where to place bsrdir (bsr files) dnl ------------------------------------------ -bsrdir=/tmp +bsrdir=`eval echo /opt/bacula/bsr` AC_ARG_WITH(bsrdir, AC_HELP_STRING([--with-bsrdir=PATH], [specify path of Bacula bsrs directory]), [ - if test "x$withval" != "xno" ; then + if test "x$withval" != "xno" ; then bsrdir=$withval fi ] @@ -1313,13 +1099,13 @@ AC_ARG_WITH(bsrdir, AC_SUBST(bsrdir) dnl ------------------------------------------ -dnl Where to place logdir (bsr files) +dnl Where to place logdir dnl ------------------------------------------ -logdir=/tmp +logdir=`eval echo /opt/bacula/log` AC_ARG_WITH(logdir, AC_HELP_STRING([--with-logdir=PATH], [specify path of Bacula logs directory]), [ - if test "x$withval" != "xno" ; then + if test "x$withval" != "xno" ; then logdir=$withval fi ] @@ -1335,7 +1121,7 @@ plugindir=`eval echo ${libdir}` AC_ARG_WITH(plugindir, AC_HELP_STRING([--with-plugindir=PATH], [specify path of Bacula plugins directory]), [ - if test "x$withval" != "xno" ; then + if test "x$withval" != "xno" ; then plugindir=$withval fi ] @@ -1343,6 +1129,10 @@ AC_ARG_WITH(plugindir, AC_SUBST(plugindir) +dnl ------------------------------------------ +dnl Where to send dump email +dnl ------------------------------------------ + dnl ------------------------------------------ dnl Where to send dump email dnl ------------------------------------------ @@ -1350,7 +1140,7 @@ dump_email=root@localhost AC_ARG_WITH(dump-email, AC_HELP_STRING([--with-dump-email=EMAIL], [dump email address]), [ - if test "x$withval" != "xno" ; then + if test "x$withval" != "xno" ; then dump_email=$withval fi ] @@ -1365,7 +1155,7 @@ job_email=root@localhost AC_ARG_WITH(job-email, AC_HELP_STRING([--with-job-email=EMAIL], [job output email address]), [ - if test "x$withval" != "xno" ; then + if test "x$withval" != "xno" ; then job_email=$withval fi ] @@ -1380,7 +1170,7 @@ smtp_host=localhost AC_ARG_WITH(smtp_host, AC_HELP_STRING([--with-smtp-host=HOST], [SMTP mail host address]), [ - if test "x$withval" != "xno" ; then + if test "x$withval" != "xno" ; then smtp_host=$withval fi ] @@ -1395,7 +1185,7 @@ piddir=/var/run AC_ARG_WITH(pid-dir, AC_HELP_STRING([--with-pid-dir=PATH], [specify location of Bacula pid files]), [ - if test "x$withval" != "xno" ; then + if test "x$withval" != "xno" ; then piddir=$withval fi ] @@ -1418,7 +1208,7 @@ fi AC_ARG_WITH(subsys-dir, AC_HELP_STRING([--with-subsys-dir=PATH], [specify location of Bacula subsys file]), [ - if test "x$withval" != "xno" ; then + if test "x$withval" != "xno" ; then subsysdir=$withval fi ] @@ -1433,7 +1223,7 @@ baseport=9101 AC_ARG_WITH(baseport, AC_HELP_STRING([--with-baseport=PORT], [specify base port address for daemons]), [ - if test "x$withval" != "xno" ; then + if test "x$withval" != "xno" ; then baseport=$withval fi ] @@ -1455,7 +1245,7 @@ dir_password= AC_ARG_WITH(dir-password, AC_HELP_STRING([--with-dir-password=PASSWORD], [specify Director's password]), [ - if test "x$withval" != "xno" ; then + if test "x$withval" != "xno" ; then dir_password=$withval fi ] @@ -1474,7 +1264,7 @@ fd_password= AC_ARG_WITH(fd-password, AC_HELP_STRING([--with-fd-password=PASSWORD], [specify Client's password]), [ - if test "x$withval" != "xno" ; then + if test "x$withval" != "xno" ; then fd_password=$withval fi ] @@ -1493,7 +1283,7 @@ sd_password= AC_ARG_WITH(sd-password, AC_HELP_STRING([--with-sd-password=PASSWORD], [specify Storage daemon's password]), [ - if test "x$withval" != "xno" ; then + if test "x$withval" != "xno" ; then sd_password=$withval fi ] @@ -1512,7 +1302,7 @@ mon_dir_password= AC_ARG_WITH(mon-dir-password, AC_HELP_STRING([--with-mon-dir-password=PASSWORD], [specify Director's password used by the monitor]), [ - if test "x$withval" != "xno" ; then + if test "x$withval" != "xno" ; then mon_dir_password=$withval fi ] @@ -1531,7 +1321,7 @@ mon_fd_password= AC_ARG_WITH(mon-fd-password, AC_HELP_STRING([--with-mon-fd-password=PASSWORD], [specify Client's password used by the monitor]), [ - if test "x$withval" != "xno" ; then + if test "x$withval" != "xno" ; then mon_fd_password=$withval fi ] @@ -1550,7 +1340,7 @@ mon_sd_password= AC_ARG_WITH(mon-sd-password, AC_HELP_STRING([--with-mon-sd-password=PASSWORD], [specify Storage daemon's password used by the monitor]), [ - if test "x$withval" != "xno" ; then + if test "x$withval" != "xno" ; then mon_sd_password=$withval fi ] @@ -1579,7 +1369,7 @@ db_name=bacula AC_ARG_WITH(db_name, AC_HELP_STRING([--with-db-name=DBNAME], [specify database name @<:@default=bacula@:>@]), [ - if test "x$withval" != "x" ; then + if test "x$withval" != "x" ; then db_name=$withval fi ] @@ -1590,7 +1380,7 @@ db_user=bacula AC_ARG_WITH(db_user, AC_HELP_STRING([--with-db-user=UNAME], [specify database user @<:@default=bacula@:>@]), [ - if test "x$withval" != "x" ; then + if test "x$withval" != "x" ; then db_user=$withval fi ] @@ -1601,7 +1391,7 @@ db_password= AC_ARG_WITH(db_password, AC_HELP_STRING([--with-db-password=PWD], [specify database password @<:@default=*none*@:>@]), [ - if test "x$withval" != "x" ; then + if test "x$withval" != "x" ; then db_password=$withval fi ] @@ -1622,6 +1412,20 @@ AC_ARG_WITH(db_port, ) 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 # @@ -1629,7 +1433,7 @@ dir_user= AC_ARG_WITH(dir_user, AC_HELP_STRING([--with-dir-user=USER], [specify user for Director daemon]), [ - if test "x$withval" != "x" ; then + if test "x$withval" != "x" ; then dir_user=$withval fi ] @@ -1639,7 +1443,7 @@ dir_group= AC_ARG_WITH(dir_group, AC_HELP_STRING([--with-dir-group=GROUP], [specify group for Director daemon]), [ - if test "x$withval" != "x" ; then + if test "x$withval" != "x" ; then dir_group=$withval fi ] @@ -1649,7 +1453,7 @@ sd_user= AC_ARG_WITH(sd_user, AC_HELP_STRING([--with-sd-user=USER], [specify user for Storage daemon]), [ - if test "x$withval" != "x" ; then + if test "x$withval" != "x" ; then sd_user=$withval fi ] @@ -1659,7 +1463,7 @@ sd_group= AC_ARG_WITH(sd_group, AC_HELP_STRING([--with-sd-group=GROUP], [specify group for Storage daemon]), [ - if test "x$withval" != "x" ; then + if test "x$withval" != "x" ; then sd_group=$withval fi ] @@ -1669,7 +1473,7 @@ fd_user= AC_ARG_WITH(fd_user, AC_HELP_STRING([--with-fd-user=USER], [specify user for File daemon]), [ - if test "x$withval" != "x" ; then + if test "x$withval" != "x" ; then fd_user=$withval fi ] @@ -1679,7 +1483,7 @@ fd_group= AC_ARG_WITH(fd_group, AC_HELP_STRING([--with-fd-group=GROUP], [specify group for File daemon]), [ - if test "x$withval" != "x" ; then + if test "x$withval" != "x" ; then fd_group=$withval fi ] @@ -1699,7 +1503,7 @@ SBINPERM=0750 AC_ARG_WITH(sbin-perm, AC_HELP_STRING([--with-sbin-perm=MODE], [specify permissions for sbin binaries @<:@default=0750@:>@]), [ - if test "x$withval" != "x" ; then + if test "x$withval" != "x" ; then SBINPERM=$withval fi ] @@ -1739,12 +1543,6 @@ BA_CHECK_MYSQL_DB BA_CHECK_SQLITE3_DB -#BA_CHECK_INGRES_DB - -#BA_CHECK_DBI_DB - -#BA_CHECK_DBI_DRIVER - dnl ------------------------------------------- dnl If no batch insert backend are enable set dnl variable to None @@ -1843,7 +1641,7 @@ if test -z "$CFLAGS" -o "$CFLAGS" = "-g -O2"; then CFLAGS="$CCOPTS" fi -dnl A few others +dnl A few others AC_EXEEXT dnl See if we can use 64 bit file addresses @@ -1865,6 +1663,7 @@ AC_CHECK_HEADERS( \ stdarg.h \ stdlib.h \ stdint.h \ + inttypes.h \ string.h \ strings.h \ termios.h \ @@ -1897,7 +1696,7 @@ AC_STRUCT_ST_BLOCKS AC_STRUCT_TIMEZONE dnl -------------------------------------------------------------------------- -dnl Check for utime.h structure +dnl Check for utime.h structure dnl -------------------------------------------------------------------------- AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h, [ @@ -1964,7 +1763,7 @@ test $ba_cv_header_ioctl_req_t = yes && AC_DEFINE(HAVE_IOCTL_ULINT_REQUEST, 1, [ dnl Note: it is more correct to use AC_LANG(C++) but some of the older dnl *BSD systems still use old style C prototypes, which are wrong with -dnl compiled with a C++ compiler. +dnl compiled with a C++ compiler. AC_LANG(C) dnl -------------------------------------------------------------------------- @@ -2024,7 +1823,7 @@ if test $fstype = no; then AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX ) fi -if test $fstype = no; then +if test $fstype = no; then AC_TRY_CPP( [ #include @@ -2032,10 +1831,10 @@ if test $fstype = no; then AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD ) fi -if test $fstype = no; then +if test $fstype = no; then AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1) fi -if test $fstype = no; then +if test $fstype = no; then AC_TRY_CPP( [ #include @@ -2048,6 +1847,93 @@ 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_CHECK_DECLS([O_CLOEXEC],,[AC_DEFINE([O_CLOEXEC],[0], [Defined to 0 if not provided])], +[[ +#ifdef HAVE_FCNTL_H +# include +#endif +]]) + +AC_CHECK_DECLS([FD_CLOEXEC],,[AC_DEFINE([FD_CLOEXEC],[0], [Defined to 0 if not provided])], +[[ +#ifdef HAVE_FCNTL_H +# include +#endif +]]) + +AC_CHECK_DECLS([SOCK_CLOEXEC],,[AC_DEFINE([SOCK_CLOEXEC],[0],[Defined to 0 if not provided])], +[[ +#ifdef HAVE_SYS_SOCKET_H +# include +#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++) @@ -2074,6 +1960,7 @@ AC_STRUCT_ST_BLOCKS AC_STRUCT_ST_RDEV AC_STRUCT_TM AC_C_CONST +AC_C_RESTRICT AC_CHECK_SIZEOF(char, 1) AC_CHECK_SIZEOF(short int, 2) @@ -2112,7 +1999,7 @@ AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t, intmax_t a; a = 1; ], [ ac_cv_have_intmax_t="yes" - ], [ + ], [ AC_TRY_COMPILE( [ #include @@ -2125,7 +2012,7 @@ AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t, ] ) ] - ) + ) ] ) if test "x$ac_cv_have_intmax_t" = "xyes" ; then @@ -2142,7 +2029,7 @@ AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t, u_intmax_t a; a = 1; ], [ ac_cv_have_u_intmax_t="yes" - ], [ + ], [ AC_TRY_COMPILE( [ #include @@ -2182,7 +2069,7 @@ if test "x$ac_cv_have_intxx_t" = "xyes" ; then AC_DEFINE(HAVE_INTXX_T) have_intxx_t=1 fi - + AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [ AC_TRY_COMPILE( @@ -2202,7 +2089,7 @@ if test "x$ac_cv_have_int64_t" = "xyes" ; then AC_DEFINE(HAVE_INT64_T) have_int64_t=1 fi - + AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [ AC_TRY_COMPILE( @@ -2262,7 +2149,7 @@ then ], [ AC_MSG_RESULT(no) ] - ) + ) fi if test -z "$have_u_intxx_t" ; then @@ -2272,7 +2159,7 @@ if test -z "$have_u_intxx_t" ; then [ #include ], [ - uint8_t a; uint16_t b; + uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ], [ ac_cv_have_uintxx_t="yes" @@ -2295,7 +2182,7 @@ then [ #include ], [ - int64_t a; u_int64_t b; + int64_t a; u_int64_t b; a = b = 1; ], [ AC_DEFINE(HAVE_U_INT64_T) @@ -2304,7 +2191,7 @@ then ], [ AC_MSG_RESULT(no) ] - ) + ) fi if (test -z "$have_uintxx_t" && \ @@ -2315,7 +2202,7 @@ then [ #include ], [ - uint8_t a; uint16_t b; + uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ], [ AC_DEFINE(HAVE_UINTXX_T) @@ -2323,7 +2210,7 @@ then ], [ AC_MSG_RESULT(no) ] - ) + ) fi dnl -------------------------------------------------------------------------- @@ -2347,15 +2234,33 @@ 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 ] +) + +AC_CHECK_DECL( + F_SETLK, + AC_DEFINE(HAVE_FCNTL_LOCK, 1, [Set if fcntl supports file locking]), + , + [#include ] +) + +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(realpath) +AC_CHECK_FUNCS(getrlimit) -AC_CHECK_FUNCS(chflags) +AC_CHECK_FUNCS(chflags) AC_CHECK_FUNCS(snprintf vsnprintf gethostid fseeko) @@ -2369,7 +2274,7 @@ AC_CACHE_CHECK(for va_copy, ba_cv_va_copy, ], [ call_use_va_copy(1,2,3) ], [ - ba_cv_va_copy=yes, + ba_cv_va_copy=yes ], [ ba_cv_va_copy=no ] @@ -2392,6 +2297,8 @@ AC_CHECK_FUNC(gethostbyname_r, AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)]) AC_CHECK_FUNCS(inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)]) AC_CHECK_FUNCS(gethostbyname2, [AC_DEFINE(HAVE_GETHOSTBYNAME2)]) +AC_CHECK_FUNCS(getnameinfo, [AC_DEFINE(HAVE_GETNAMEINFO)]) + dnl ---------------------------- dnl check sa_len of sockaddr @@ -2415,6 +2322,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 + #include + #include + #include + + 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 @@ -2438,22 +2397,180 @@ fi AC_SUBST(ZLIBS) dnl -dnl Check for lzo +dnl Check if we have AFS on this system dnl -have_lzo=no -AC_CHECK_HEADER(lzo/lzoconf.h, -[ - AC_CHECK_HEADER(lzo/lzo1x.h, +AFS_CFLAGS="" +AFS_LIBS="" +support_afs=auto +AC_ARG_ENABLE(afs, + AC_HELP_STRING([--disable-afs], [disable afs support @<:@default=auto@:>@]), + [ + if test x$enableval = xyes; then + support_afs=yes + elif test x$enableval = xno; then + support_afs=no + fi + ] +) + +have_afs=no +if test x$support_afs = xyes -o x$support_afs = xauto; then + AC_ARG_WITH(afsdir, + AC_HELP_STRING([--with-afsdir@<:@=DIR@:>@], [Directory holding AFS includes/libs]), + with_afsdir=$withval + ) + + dnl + dnl Search in standard places, or --with-afsdir not specified + 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/openafs/afs/ ; then + with_afsdir=${root} + break + fi + done + fi + + 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/afsint.h) + AC_TRY_CPP( + [ + #include + #include + ], + AC_DEFINE(HAVE_AFS_VENUS_H,1,[Define to 1 if you have the header file.]) + ) + + CFLAGS="${saved_CFLAGS}" + CPPFLAGS="${saved_CPPFLAGS}" + + dnl + dnl See if we can find a libsys with the pioctl symbol in there + dnl + 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} 2>/dev/null | grep pioctl` + pkg=$? + if test $pkg = 0; then + have_afs=yes + 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, + please either load the afs libraries or rerun configure without --enable-afs]) + else + if test $have_afs = yes; then + 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) + +dnl --------------------------------------------------- +dnl Check for lzo support/directory (default on) +dnl --------------------------------------------------- +dnl this allows you to turn it completely off + +AC_ARG_ENABLE(lzo, + AC_HELP_STRING([--disable-lzo], [disable lzo support @<:@default=yes@:>@]), [ - AC_CHECK_LIB(lzo2, lzo1x_1_compress, + if test x$enableval = xno; then + support_lzo=no + fi + ] +) + +LZO_INC= +LZO_LIBS= +LZO_LDFLAGS= + +have_lzo="no" +if test x$support_lzo = xyes; then + AC_ARG_WITH(lzo, + AC_HELP_STRING([--with-lzo@<:@=DIR@:>@], [specify lzo library directory]), [ - LZOLIBS="-llzo2" - AC_DEFINE(HAVE_LZO,1,[Define to 1 if you have LZO compression]) - have_lzo=yes + case "$with_lzo" in + no) + : + ;; + yes|*) + if test -f ${with_lzo}/include/lzo/lzoconf.h; then + LZO_INC="-I${with_lzo}/include" + LZO_LDFLAGS="-L${with_lzo}/lib" + with_lzo="${with_lzo}/include" + else + with_lzo="/usr/include" + fi + + 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} -llzo2" + have_lzo="yes" + ], [ + echo " " + echo "lzoconf.h not found. lzo turned off ..." + echo " " + ] + ) + ;; + esac + ],[ + AC_CHECK_HEADER(lzo/lzoconf.h, + [ + AC_CHECK_HEADER(lzo/lzo1x.h, + [ + AC_CHECK_LIB(lzo2, lzo1x_1_compress, + [ + LZO_LIBS="-llzo2" + AC_DEFINE(HAVE_LZO,1,[Define to 1 if you have LZO compression]) + have_lzo=yes + ]) + ]) + ]) ]) - ]) -]) -AC_SUBST(LZOLIBS) +fi + +AC_SUBST(LZO_INC) +AC_SUBST(LZO_LIBS) + dnl dnl Check for ACL support and libraries @@ -2491,7 +2608,18 @@ if test x$support_acl = xyes -o x$support_acl = xauto; then AC_CHECK_LIB(acl, acl_get_file, [ have_acl=yes - FDLIBS="-lacl $FDLIBS" + 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 @@ -2587,7 +2715,7 @@ if test x$support_acl = xyes -o x$support_acl = xauto; then 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, + 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]) else if test $have_acl = yes; then @@ -2634,7 +2762,7 @@ if test x$support_xattr = xyes -o x$support_xattr = xauto; then 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, [ @@ -2645,7 +2773,7 @@ if test x$support_xattr = xyes -o x$support_xattr = xauto; then ] ) fi - + if test $have_xattr = yes; then have_extattr_string_in_libc=no AC_CHECK_FUNCS(extattr_namespace_to_string extattr_string_to_namespace, @@ -2776,7 +2904,7 @@ if test x$support_xattr = xyes -o x$support_xattr = xauto; then 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, + 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]) else if test $have_xattr = yes; then @@ -2821,8 +2949,8 @@ AC_DEFINE(FDLIBS) 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" @@ -2856,8 +2984,6 @@ dnl 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= @@ -2867,8 +2993,7 @@ case "$DISTNAME" in aix) DISTVER=`uname -r` PSCMD="ps -e -o pid,comm" - PFILES="${PFILES} \ - platforms/aix/Makefile" + PFILES="${PFILES} platforms/aix/Makefile" TAPEDRIVE="/dev/rmt0.1" ;; alpha) @@ -2946,7 +3071,7 @@ debian) platforms/ubuntu/bacula-fd \ platforms/ubuntu/bacula-sd \ platforms/ubuntu/bacula-dir" - else + else PFILES="${PFILES} \ platforms/debian/Makefile \ platforms/debian/bacula-fd \ @@ -2972,6 +3097,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" @@ -3088,6 +3223,9 @@ solaris) 5.7|5.8) AC_DEFINE(USE_THR_SETCONCURRENCY) ;; + 5.10) + AC_DEFINE(HAVE_SOLARIS10, 1, [Set if building on Solaris 10]) + ;; *) ;; esac @@ -3123,7 +3261,7 @@ unknown) *) echo " === Something went wrong. Unknown DISTNAME $DISTNAME ===" ;; -esac +esac dnl ------------------------------------------- dnl systemd (default off) @@ -3141,6 +3279,7 @@ AC_ARG_WITH(systemd, PFILES="${PFILES} \ platforms/systemd/Makefile \ + platforms/systemd/bacula.conf \ platforms/systemd/bacula-dir.service \ platforms/systemd/bacula-fd.service \ platforms/systemd/bacula-sd.service" @@ -3188,13 +3327,15 @@ if test "x${subsysdir}" = "x${sbindir}" ; then echo " " echo " " exit 1 -fi +fi + AC_OUTPUT([autoconf/Make.common \ Makefile \ manpages/Makefile \ scripts/btraceback \ scripts/bconsole \ + scripts/baculabackupreport \ scripts/bacula \ scripts/bacula-ctl-dir \ scripts/bacula-ctl-fd \ @@ -3202,40 +3343,30 @@ AC_OUTPUT([autoconf/Make.common \ scripts/devel_bacula \ scripts/Makefile \ scripts/logrotate \ - scripts/bacula.desktop.gnome1 \ - scripts/bacula.desktop.gnome2 \ - scripts/bacula.desktop.gnome1.consolehelper \ - scripts/bacula.desktop.gnome2.consolehelper \ - scripts/bacula.desktop.gnome1.xsu \ - scripts/bacula.desktop.gnome2.xsu \ scripts/mtx-changer \ scripts/disk-changer \ scripts/dvd-handler \ scripts/dvd-simulator \ - scripts/bacula-tray-monitor.desktop \ scripts/logwatch/Makefile \ scripts/logwatch/logfile.bacula.conf \ - scripts/wxconsole.console_apps \ - scripts/wxconsole.desktop.consolehelper \ - scripts/wxconsole.desktop.xsu \ scripts/bat.desktop \ scripts/bat.desktop.xsu \ scripts/bat.desktop.consolehelper \ scripts/bat.console_apps \ + scripts/bacula-tray-monitor.desktop \ src/Makefile \ src/host.h \ src/console/Makefile \ src/console/bconsole.conf \ - src/qt-console/tray-monitor/tray-monitor.pro \ - src/qt-console/tray-monitor/tray-monitor.conf \ 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/wx-console/Makefile \ - src/wx-console/bwx-console.conf \ - src/tray-monitor/Makefile \ - src/tray-monitor/tray-monitor.conf \ + 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 \ @@ -3281,6 +3412,9 @@ AC_OUTPUT([autoconf/Make.common \ src/plugins/dir/Makefile \ src/win32/Makefile.inc \ 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 \ @@ -3290,15 +3424,16 @@ 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 ], + platforms/rpms/suse/bacula.spec \ + platforms/rpms/suse/bacula-bat.spec \ + platforms/rpms/suse/bacula-docs.spec \ + platforms/rpms/suse/bacula-mtx.spec \ + $PFILES ], [ ] ) @@ -3312,6 +3447,7 @@ if test "${support_bat}" = "yes" ; then touch bat chmod 755 bat rm -f Makefile + rm -rf moc32 obj32 $QMAKE ${MAKE:-make} clean cd ${BUILD_DIR} @@ -3333,7 +3469,7 @@ cd ${BUILD_DIR} cd scripts chmod 755 bacula btraceback mtx-changer chmod 755 dvd-handler dvd-simulator -chmod 755 bconsole mtx-changer devel_bacula logrotate +chmod 755 bconsole disk-changer devel_bacula logrotate cd .. c=updatedb @@ -3357,18 +3493,12 @@ 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/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 largefile_support="yes" fi @@ -3414,7 +3544,7 @@ Configuration on `date`: Plugin directory: ${plugindir} C Compiler: ${CC} ${CCVERSION} C++ Compiler: ${CXX} ${CXXVERSION} - Compiler flags: ${WCFLAGS} ${CFLAGS} + Compiler flags: ${WCFLAGS} ${CFLAGS} Linker flags: ${WLDFLAGS} ${LDFLAGS} Libraries: ${LIBS} Statically Linked Tools: ${support_static_tools} @@ -3426,43 +3556,41 @@ Configuration on `date`: 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} + Encryption support: ${support_crypto} ZLIB support: ${have_zlib} LZO support: ${have_lzo} - enable-smartalloc: ${support_smartalloc} + 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}