3 dnl Process this file with autoconf to produce a configure script.
5 dnl Copyright (C) 2000-2017 Kern Sibbald
6 dnl License: BSD 2-Clause; see file LICENSE-FOSS
8 dnl require a recent autoconf
10 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']))
11 AC_CONFIG_SRCDIR(src/version.h)
19 AC_CONFIG_AUX_DIR(${BUILD_DIR}/autoconf)
20 AC_CONFIG_HEADERS(src/config.h:autoconf/config.h.in)
22 dnl search for true and false programs.
23 AC_PATH_PROGS(TRUEPRG, true, :)
24 AC_PATH_PROGS(FALSEPRG, false, :)
29 if test "x$BACULA" != x; then
30 post_host=`echo -${BACULA} | tr 'A-Z ' 'a-z-'`
32 BACULA=${BACULA:-Bacula}
33 VERSION=`sed -n -e 's/^#define VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
34 RELEASE=`sed -n -e 's/^#define RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
35 DATE=`sed -n -e 's/^#define BDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
36 LSMDATE=`sed -n -e 's/^#define LSMDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
37 BDB_VERSION=`sed -n -e 's/^#define BDB_VERSION \(.*\)$/\1/p' ${srcdir}/src/cats/cats.h`
38 DEPKGS_VERSION=`sed -n -e 's/^#define DEPKGS_VERSION \(.*\)$/\1/p' ${srcdir}/src/cats/cats.h`
39 DEPKGS_QT_VERSION=`sed -n -e 's/^#define DEPKGS_QT_VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
40 BQT_VERSION=`sed -n -e 's/^#define BQT_VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
41 VIX_VERSION=`sed -n -e 's/^#define VIX_VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
42 JAVA_VERSION=`sed -n -e 's/^#define JAVA_VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
43 NDMP_VERSION=`sed -n -e 's/^#define NDMP_VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
44 LIBRSYNC_VERSION=`sed -n -e 's/^#define LIBRSYNC_VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
49 AC_SUBST(post_host)dnl
50 AC_SUBST(BDB_VERSION)dnl
51 AC_SUBST(DEPKGS_QT_VERSION)dnl
52 AC_SUBST(DEPKGS_VERSION)dnl
53 AC_SUBST(BQT4_VERSION)dnl
54 AC_SUBST(VIX_VERSION)dnl
55 AC_SUBST(JAVA_VERSION)dnl
56 AC_SUBST(NDMP_VERSION)dnl
57 AC_SUBST(LIBRSYNC_VERSION)dnl
61 dnl can be overwritten by specific values from version.h
62 LIBBAC_LT_RELEASE=`sed -n -e 's/^#.*LIBBAC_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
63 LIBBACCFG_LT_RELEASE=`sed -n -e 's/^#.*LIBBACCFG_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
64 LIBBACPY_LT_RELEASE=`sed -n -e 's/^#.*LIBBACPY_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
66 LIBBAC_LT_RELEASE=${LIBBAC_LT_RELEASE:-$VERSION}
67 LIBBACCFG_LT_RELEASE=${LIBBACCFG_LT_RELEASE:-$VERSION}
69 AC_SUBST(LIBBAC_LT_RELEASE)dnl
70 AC_SUBST(LIBBACCFG_LT_RELEASE)dnl
73 dnl can be overwritten by specific values from version.h
74 LIBBACSQL_LT_RELEASE=`sed -n -e 's/^#.*LIBBACSQL_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
75 LIBBACCATS_LT_RELEASE=`sed -n -e 's/^#.*LIBBACCATS_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
77 LIBBACSQL_LT_RELEASE=${LIBBACSQL_LT_RELEASE:-$VERSION}
78 LIBBACCATS_LT_RELEASE=${LIBBACCATS_LT_RELEASE:-$VERSION}
80 AC_SUBST(LIBBACSQL_LT_RELEASE)dnl
81 AC_SUBST(LIBBACCATS_LT_RELEASE)dnl
84 dnl can be overwritten by specific values from version.h
85 LIBBACFIND_LT_RELEASE=`sed -n -e 's/^#.*LIBBACFIND_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
87 LIBBACFIND_LT_RELEASE=${LIBBACFIND_LT_RELEASE:-$VERSION}
89 AC_SUBST(LIBBACFIND_LT_RELEASE)dnl
91 dnl PFILES are platform or plugin specific files
92 PFILES="platforms/Makefile"
94 echo "configuring for ${BACULA} $VERSION ($DATE)"
97 dnl -------------------------------------------------------
98 dnl Check for compiler.
99 dnl ------------------------------------------------------
101 AC_PROG_CC dnl this sets $GCC if using GNU C compiler
103 AC_PROG_CC_C_O dnl Determine if C compiler support -c -o.
104 AC_PROG_GCC_TRADITIONAL dnl Determine if ioctl() need -traditional.
106 BASECC=`basename $CC`
108 if test x"$GCC" = "xyes"; then
112 AC_PATH_PROG(CXX, $CXX, $CXX)
113 if test ! -e $CXX; then
114 AC_MSG_ERROR(Unable to find C++ compiler)
117 dnl -------------------------------------------------------
118 dnl Check for programs.
119 dnl ------------------------------------------------------
121 AC_PATH_PROG(MV, mv, mv)
123 dnl If we name the variable RM it will shadow the RM variable in the configure script and we overwrite the
124 dnl value with the name of the rm command and not rm -f which is its normal content. This gives all kind
125 dnl of strange output of the configure script (like things don't exist etc.).
126 dnl So we name it REMOVE (more software has run into this problem)
127 AC_PATH_PROG(REMOVE, rm, rm)
128 AC_PATH_PROG(CP, cp, cp)
129 AC_PATH_PROG(SED, sed, sed)
130 AC_PATH_PROG(ECHO, echo, echo)
131 AC_PATH_PROG(CMP, cmp, cmp)
132 AC_PATH_PROG(TBL, tbl, tbl)
133 AC_PATH_PROG(AR, ar, ar)
134 AC_PATH_PROG(OPENSSL, openssl, none)
135 AC_PATH_PROG(MTX, mtx, mtx)
136 AC_PATH_PROG(DD, dd, dd)
137 AC_PATH_PROG(MKISOFS, mkisofs, mkisofs)
138 AC_PATH_PROG(PYTHON, python, python)
139 AC_PATH_PROG(GROWISOFS, growisofs, growisofs)
140 AC_PATH_PROG(DVDRWMEDIAINFO, dvd+rw-mediainfo, dvd+rw-mediainfo)
141 AC_PATH_PROG(DVDRWFORMAT, dvd+rw-format, dvd+rw-format)
142 AC_PATH_PROG(PKGCONFIG, pkg-config, pkg-config)
143 AC_PATH_PROG(QMAKE, qmake, none)
144 AC_PATH_PROG(GMAKE, gmake, none)
145 AC_PATH_PROG(PIDOF, pidof, pidof)
147 # Some AWK programs fail, so test it and warn the user
148 if echo xfoo | $AWK 'BEGIN { prog=ARGV[1]; ARGC=1 }
149 { if ((prog == $2) || (("(" prog ")") == $2) ||
150 (("[" prog "]") == $2) ||
151 ((prog ":") == $2)) { print $1 ; exit 0 } }' xfoo>/dev/null; then :;
153 AC_MSG_ERROR([!!!!!!!!! WARNING !!!!!!!!!!!!!!
154 The regex engine of $AWK is too broken to be used you
155 might want to install GNU AWK.
156 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!])
159 AC_PATH_PROG(AWK, $THE_AWK, $THE_AWK)
162 test -n "$ARFLAG" || ARFLAGS="cr"
169 AC_SUBST(LOCAL_CFLAGS)
170 AC_SUBST(LOCAL_LDFLAGS)
173 dnl --------------------------------------------------
175 dnl --------------------------------------------------
177 AC_ARG_ENABLE(libtool,
178 AC_HELP_STRING([--enable-libtool], [enable building using GNU libtool @<:@default=yes@:>@]),
180 if test x$enableval = xno; then
185 LT_INIT([shared disable-static])
189 if test x$use_libtool != xno; then
190 DEFAULT_OBJECT_TYPE=".lo"
191 DEFAULT_ARCHIVE_TYPE=".la"
192 DEFAULT_SHARED_OBJECT_TYPE=".la"
193 LIBTOOL="\$(LIBTOOL)"
194 LIBTOOL_INSTALL_TARGET="libtool-install"
195 LIBTOOL_UNINSTALL_TARGET="libtool-uninstall"
196 LIBTOOL_CLEAN_TARGET="libtool-clean"
197 QMAKE_LIBTOOL="${BUILD_DIR}/libtool"
198 FD_PLUGIN_DIR="src/plugins/fd"
201 DEFAULT_OBJECT_TYPE=".o"
202 DEFAULT_ARCHIVE_TYPE=".a"
203 DEFAULT_SHARED_OBJECT_TYPE=".so"
204 LIBTOOL="# \$(LIBTOOL)"
205 LIBTOOL_INSTALL_TARGET=""
206 LIBTOOL_UNINSTALL_TARGET=""
207 LIBTOOL_CLEAN_TARGET=""
208 QMAKE_LIBTOOL="# ${BUILD_DIR}/libtool"
213 AC_SUBST(DEFAULT_OBJECT_TYPE)
214 AC_SUBST(DEFAULT_ARCHIVE_TYPE)
215 AC_SUBST(DEFAULT_SHARED_OBJECT_TYPE)
217 AC_SUBST(LIBTOOL_INSTALL_TARGET)
218 AC_SUBST(LIBTOOL_UNINSTALL_TARGET)
219 AC_SUBST(LIBTOOL_CLEAN_TARGET)
220 AC_SUBST(QMAKE_LIBTOOL)
221 AC_SUBST(FD_PLUGIN_DIR)
223 dnl --------------------------------------------------
224 dnl Include file handling
225 dnl --------------------------------------------------
226 AC_ARG_ENABLE(includes,
227 AC_HELP_STRING([--enable-includes], [enable installing of include files @<:@default=no@:>@]),
229 if test x$enableval = xyes; then
235 dnl It only makes sense to install include files when you install libraries which only happens when
236 dnl libtool is enabled
238 if test x$use_libtool != xno -a x$install_includes = xyes; then
239 INCLUDE_INSTALL_TARGET="install-includes"
240 INCLUDE_UNINSTALL_TARGET="uninstall-includes"
242 INCLUDE_INSTALL_TARGET=""
243 INCLUDE_UNINSTALL_TARGET=""
245 AC_SUBST(INCLUDE_INSTALL_TARGET)
246 AC_SUBST(INCLUDE_UNINSTALL_TARGET)
248 dnl --------------------------------------------------
249 dnl Bacula OP Sys determination (see aclocal.m4)
250 dnl --------------------------------------------------
253 dnl -----------------------------------------------------------
254 dnl Bacula OPSys Distribution determination (see aclocal.m4)
255 dnl ----------------------------------------------------------
256 BA_CHECK_OPSYS_DISTNAME
258 dnl --------------------------------------------------
259 dnl Suppport for gettext (translations)
260 dnl By default, $datarootdir is ${prefix}/share
261 dnl --------------------------------------------------
262 AM_GNU_GETTEXT([external])
264 dnl ------------------------------------------------------------------
265 dnl If the user has not set --prefix, we set our default to nothing.
266 dnl In this case, if the user has not set --sysconfdir, we set it
267 dnl to the package default of /etc/bacula. If either --prefix or
268 dnl --sysconfdir is set, we leave sysconfdir alone except to eval it.
269 dnl If the user has not set --libdir, we set it to the package
270 dnl default of /usr/lib. If either --prefix or --libdir is set,
271 dnl we leave libdir alone except to eval it. If the user has not set
272 dnl --includedir, we set it to the package default of /usr/include.
273 dnl If either --prefix or --includedir is set, we leave includedir
274 dnl alone except to eval it
275 dnl ------------------------------------------------------------------
276 os_name=`uname -s 2>/dev/null`
277 if test x${prefix} = xNONE ; then
278 if test `eval echo ${sysconfdir}` = NONE/etc ; then
279 sysconfdir=/etc/bacula
282 if test `eval echo ${libdir}` = NONE/lib ; then
285 os_processor=`uname -p 2>/dev/null`
286 case ${os_processor} in
301 if test `eval echo ${includedir}` = NONE/include ; then
302 includedir=/usr/include
305 if test `eval echo ${datarootdir}` = NONE/share ; then
306 datarootdir=/usr/share
311 dnl -------------------------------------------------------------------------
312 dnl If the user has not set --exec-prefix, we default to ${prefix}
313 dnl -------------------------------------------------------------------------
314 if test x${exec_prefix} = xNONE ; then
315 exec_prefix=${prefix}
318 sysconfdir=`eval echo ${sysconfdir}`
319 datarootdir=`eval echo ${datarootdir}`
320 docdir=`eval echo ${docdir}`
321 htmldir=`eval echo ${htmldir}`
322 libdir=`eval echo ${libdir}`
323 includedir=`eval echo ${includedir}`
324 localedir=`eval echo ${datarootdir}/locale`
325 AC_DEFINE_UNQUOTED(SYSCONFDIR, "$sysconfdir")
326 AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir")
328 dnl ------------------------------------------------------------------
329 dnl If the user has not set --sbindir, we set our default as /sbin
330 dnl ------------------------------------------------------------------
331 if test x$sbindir = x'${exec_prefix}/sbin' ; then
332 sbindir=${exec_prefix}/sbin
334 sbindir=`eval echo ${sbindir}`
336 dnl -------------------------------------------------------------------------
337 dnl If the user has not set --mandir, we default to /usr/share/man
338 dnl -------------------------------------------------------------------------
339 if test x$mandir = x'${prefix}/man' ; then
340 mandir=/usr/share/man
343 dnl -------------------------------------------------------------------------
344 dnl If the user has not set --htmldir, we default to /usr/share/doc/bacula/html
345 dnl -------------------------------------------------------------------------
346 if test x$htmldir = x'/usr/share/doc/bacula/' ; then
347 htmldir=`eval echo ${docdir}html`
350 dnl -------------------------------------------------------------------------
351 dnl If the user has not set --docdir, we default to /usr/share/doc/bacula
352 dnl -------------------------------------------------------------------------
353 if test x$docdir = x'/usr/share/doc/' ; then
354 docdir=`eval echo ${docdir}bacula`
358 AC_PATH_PROGS(MSGFMT, msgfmt, no)
359 if test "$MSGFMT" = "no"
361 echo 'msgfmt program not found, disabling NLS !'
363 USE_INCLUDED_LIBINTL=no
368 support_smartalloc=yes
375 support_static_tools=no
378 support_static_dir=no
379 support_static_cons=no
384 batch_insert_db_backends=""
387 dnl --------------------------------------------------------------------------
388 dnl CHECKING COMMAND LINE OPTIONS
389 dnl --------------------------------------------------------------------------
391 dnl -------------------------------------------
392 dnl bat (default off)
393 dnl -------------------------------------------
395 AC_HELP_STRING([--enable-bat], [enable build of bat Qt4 GUI @<:@default=no@:>@]),
397 if test x$enableval = xyes; then
398 AC_DEFINE(HAVE_BAT, 1, [Set if Bacula bat Qt4 GUI support enabled])
405 if test x$support_bat = xyes; then
406 abc=`$PKGCONFIG --atleast-version=4.2 QtGui`
408 if test $pkg = 0; then
409 BAT_DIR=src/qt-console
411 AC_MSG_ERROR(Unable to find Qt4 installation needed by bat)
416 dnl The qwt library was used with bat, but that is no longer the case
424 dnl if test x$support_bat = xyes; then
425 dnl AC_MSG_CHECKING(for qwt support)
427 dnl AC_HELP_STRING([--with-qwt@<:@=DIR@:>@], [specify qwt library directory]),
429 dnl case "$with_qwt" in
434 dnl if test -f ${with_qwt}/include/qwt.h; then
435 dnl QWT_INC="${with_qwt}/include"
436 dnl QWT_LDFLAGS="-L${with_qwt}/lib"
446 dnl dnl Search in standard places, or --with-qwt not specified
448 dnl if test $no_qwt = no; then
449 dnl if test x$QWT_INC = x; then
450 dnl for root in /usr /usr/local; do
451 dnl for ver in qwt qwt5 qwt-qt4; do
452 dnl if test -f ${root}/include/${ver}/qwt.h; then
453 dnl QWT_INC="${root}/include/${ver}"
454 dnl if test -d ${root}/lib64/; then
455 dnl QWT_LDFLAGS="-L${root}/lib64"
456 dnl elif test -d ${root}/lib/64/; then
457 dnl QWT_LDFLAGS="-L${root}/64"
459 dnl QWT_LDFLAGS="-L${root}/lib"
470 dnl if test x$QWT_INC = x; then
471 dnl AC_MSG_RESULT(no)
473 dnl AC_DEFINE(HAVE_QWT, 1, [Set if bat QWT library found])
474 dnl AC_MSG_RESULT(yes)
480 AC_SUBST(QWT_LDFLAGS)
484 dnl -------------------------------------------
485 dnl smartalloc (default off)
486 dnl -------------------------------------------
487 AC_ARG_ENABLE(smartalloc,
488 AC_HELP_STRING([--enable-smartalloc], [enable smartalloc debugging support @<:@default=no@:>@]),
490 if test x$enableval = xno; then
491 support_smartalloc=no
496 if test x$support_smartalloc = xyes; then
497 AC_DEFINE(SMARTALLOC, 1, [Set if you want Smartalloc enabled])
500 dnl -------------------------------------------
501 dnl Lock Manager (default off)
502 dnl -------------------------------------------
503 AC_ARG_ENABLE(lockmgr,
504 AC_HELP_STRING([--enable-lockmgr], [enable lock manager support @<:@default=no@:>@]),
506 if test x$enableval = xyes; then
512 if test x$support_lockmgr = xyes; then
513 AC_DEFINE(USE_LOCKMGR, 1, [Set if you want Lock Manager enabled])
517 dnl -------------------------------------------
518 dnl static-tools (default off)
519 dnl -------------------------------------------
520 AC_ARG_ENABLE(static-tools,
521 AC_HELP_STRING([--enable-static-tools], [enable static tape tools @<:@default=no@:>@]),
523 if test x$enableval = xyes; then
524 if test x$use_libtool = xyes; then
525 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
526 please rerun configure with --disable-libtool])
528 support_static_tools=yes
534 if test x$support_static_tools = xyes; then
535 TTOOL_LDFLAGS="-static"
537 AC_SUBST(TTOOL_LDFLAGS)
539 dnl -------------------------------------------
540 dnl static-fd (default off)
541 dnl -------------------------------------------
542 AC_ARG_ENABLE(static-fd,
543 AC_HELP_STRING([--enable-static-fd], [enable static File daemon @<:@default=no@:>@]),
545 if test x$enableval = xyes; then
546 if test x$use_libtool = xyes; then
547 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
548 please rerun configure with --disable-libtool])
550 support_static_fd=yes
556 if test x$support_static_fd = xyes; then
557 STATIC_FD="static-bacula-fd"
561 dnl -------------------------------------------
562 dnl static-sd (default off)
563 dnl -------------------------------------------
564 AC_ARG_ENABLE(static-sd,
565 AC_HELP_STRING([--enable-static-sd], [enable static Storage daemon @<:@default=no@:>@]),
567 if test x$enableval = xyes; then
568 if test x$use_libtool = xyes; then
569 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
570 please rerun configure with --disable-libtool])
572 support_static_sd=yes
578 if test x$support_static_sd = xyes; then
579 STATIC_SD="static-bacula-sd"
583 dnl -------------------------------------------
584 dnl static-dir (default off)
585 dnl -------------------------------------------
586 AC_ARG_ENABLE(static-dir,
587 AC_HELP_STRING([--enable-static-dir], [enable static Director @<:@default=no@:>@]),
589 if test x$enableval = xyes; then
590 if test x$use_libtool = xyes; then
591 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
592 please rerun configure with --disable-libtool])
594 support_static_dir=yes
600 if test x$support_static_dir = xyes; then
601 STATIC_DIR="static-bacula-dir"
605 dnl -------------------------------------------
606 dnl static-cons (default off)
607 dnl -------------------------------------------
608 AC_ARG_ENABLE(static-cons,
609 AC_HELP_STRING([--enable-static-cons], [enable static Console @<:@default=no@:>@]),
611 if test x$enableval = xyes; then
612 if test x$use_libtool = xyes; then
613 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
614 please rerun configure with --disable-libtool])
616 support_static_cons=yes
622 if test x$support_static_cons = xyes; then
623 STATIC_CONS="static-bconsole"
625 AC_SUBST(STATIC_CONS)
627 dnl -------------------------------------------
628 dnl client_only (default off)
629 dnl -------------------------------------------
630 AC_ARG_ENABLE(client-only,
631 AC_HELP_STRING([--enable-client-only], [build client (File daemon) only @<:@default=no@:>@]),
633 if test x$enableval = xyes; then
634 build_client_only=yes
640 if test x$build_client_only = xno; then
647 dnl -------------------------------------------
648 dnl director (default on)
649 dnl -------------------------------------------
650 AC_ARG_ENABLE(build-dird,
651 AC_HELP_STRING([--enable-build-dird], [enable building of dird (Director) @<:@default=yes@:>@]),
653 if test x$enableval = xno; then
665 dnl -------------------------------------------
666 dnl stored (default on)
667 dnl -------------------------------------------
668 AC_ARG_ENABLE(build-stored,
669 AC_HELP_STRING([--enable-build-stored], [enable building of stored (Storage daemon) @<:@default=yes@:>@]),
671 if test x$enableval = xno; then
676 if test x$build_stored = xyes; then
677 STORED_DIR="src/stored"
683 dnl ---------------------------------------------------
684 dnl Check for conio (Bacula readline substitute)(
685 dnl ---------------------------------------------------
686 dnl this allows you to turn it completely off
688 AC_HELP_STRING([--disable-conio], [disable conio support @<:@default=no@:>@]),
690 if test x$enableval = xno; then
697 dnl ---------------------------------------------------
698 dnl Check for IPv6 support
699 dnl ---------------------------------------------------
700 dnl this allows you to turn it completely off
703 AC_HELP_STRING([--enable-ipv6], [enable ipv6 support @<:@default=yes@:>@]),
705 if test x$enableval = xno; then
711 if test x$support_ipv6 = xyes; then
712 AC_TRY_LINK([ #include <sys/types.h>
713 #include <sys/socket.h>
714 #include <netinet/in.h>], [struct in6_addr t=in6addr_any; t.s6_addr[0] = 0;],
715 [support_in6addr_any=yes], [support_in6addr_any=no])
717 if test x$support_in6addr_any = xno ; then
718 in6addr_any="const struct in6_addr in6addr_any"
723 AC_TRY_LINK([ #include <sys/types.h>
724 #include <sys/socket.h>
725 #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;],
726 [support_ipv6=yes], [support_ipv6=no])
729 if test x$support_ipv6 = xyes; then
730 AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
732 if test x$support_in6addr_any = xno ; then
733 AC_DEFINE(NEED_IN6ADDR_ANY,1,[Whether to have in6addr_any support])
738 AC_CHECK_HEADER(curses.h, [
739 AC_CHECK_LIB(tinfo, tgetent, [ TERM_LIB="-ltinfo" ], [
740 AC_CHECK_LIB(ncurses, tgetent, [ TERM_LIB="-lncurses" ], [
741 AC_CHECK_LIB(termcap, tgetent, [ TERM_LIB="-ltermcap" ])
745 [ AC_CHECK_HEADERS(curses.h)
746 AC_CHECK_HEADER(term.h,
747 [ AC_CHECK_LIB(curses, tgetent,
748 [ TERM_LIB="-lcurses" ] )
754 if test x$support_conio = xyes; then
755 if test x$TERM_LIB != x; then
761 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
763 echo " "; echo "Required libraries not found. CONIO turned off ..."; echo " "
768 dnl ---------------------------------------------------
769 dnl Check for readline support/directory (default off)
770 dnl ---------------------------------------------------
771 dnl this allows you to turn it completely off
772 AC_ARG_ENABLE(readline,
773 AC_HELP_STRING([--disable-readline], [disable readline support @<:@default=yes@:>@]),
775 if test x$enableval = xno; then
783 if test x$support_readline = xyes; then
784 AC_ARG_WITH(readline,
785 AC_HELP_STRING([--with-readline@<:@=DIR@:>@], [specify readline library directory]),
787 case "$with_readline" in
792 if test -f ${with_readline}/readline.h; then
793 CONS_INC="-I${with_readline}"
794 CONS_LDFLAGS="-L$with_readline"
795 elif test -f ${with_readline}/include/readline/readline.h; then
796 CONS_INC="-I${with_readline}/include/readline"
797 CONS_LDFLAGS="-L${with_readline}/lib"
798 with_readline="${with_readline}/include/readline"
800 with_readline="/usr/include/readline"
803 AC_CHECK_HEADER(${with_readline}/readline.h,
805 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
806 CONS_LIBS="-lreadline -lhistory ${TERM_LIB}"
810 echo "readline.h not found. readline turned off ..."
817 dnl check for standard readline library
818 AC_CHECK_HEADER(/usr/include/readline/readline.h,
820 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
822 CONS_INC="-I/usr/include/readline"
823 CONS_LIBS="-lreadline ${TERM_LIB}"
825 dnl Did not find standard library, so try Bacula's default
826 AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h,
828 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
830 CONS_INC="-I${TOP_DIR}/depkgs/readline"
831 CONS_LIBS="-lreadline -lhistory ${TERM_LIB}"
832 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
833 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
836 echo "readline.h not found. readline turned off ..."
850 AC_SUBST(CONS_LDFLAGS)
851 AC_SUBST(READLINE_SRC)
853 dnl Minimal stuff for readline Makefile configuration
858 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr)
859 AC_CHECK_FUNCS(lstat lchown lchmod futimes fchmod fchown lutimes)
860 AC_CHECK_FUNCS(nanosleep nl_langinfo)
861 AC_CHECK_FUNCS(be64toh htobe64)
862 AC_CHECK_HEADERS(varargs.h)
864 dnl End of readline/conio stuff
865 dnl -----------------------------------------------------------------------
868 dnl Find where sockets are (especially for Solaris)
869 dnl Do this before the TCP Wrappers test since tcp wrappers
870 dnl uses the socket library and some linkers are stupid.
872 AC_CHECK_FUNC(socket,
873 AC_MSG_RESULT(using libc's socket),
874 AC_CHECK_LIB(xnet,socket)
875 AC_CHECK_LIB(socket,socket)
876 AC_CHECK_LIB(inet,socket))
878 dnl -----------------------------------------------------------
879 dnl Check whether user wants TCP wrappers support (default off)
880 dnl -----------------------------------------------------------
883 AC_ARG_WITH(tcp-wrappers,
884 AC_HELP_STRING([--with-tcp-wrappers@<:@=DIR@:>@], [enable tcpwrappers support]),
886 if test "x$withval" != "xno" ; then
888 LIBS="$saved_LIBS -lwrap"
889 AC_SEARCH_LIBS(nanosleep, [rt])
890 AC_MSG_CHECKING(for libwrap)
893 #include <sys/types.h>
895 int deny_severity = 0;
896 int allow_severity = 0;
897 struct request_info *req;
902 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
907 LIBS="$saved_LIBS -lwrap -lnsl"
908 WRAPLIBS="$saved_LIBS -lwrap -lnsl"
911 #include <sys/types.h>
913 int deny_severity = 0;
914 int allow_severity = 0;
915 struct request_info *req;
920 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
925 AC_MSG_ERROR([*** libwrap missing])
934 dnl -----------------------------------------------------------
935 dnl Check whether OpenSSL is available
936 dnl -----------------------------------------------------------
937 AC_MSG_CHECKING([for OpenSSL])
938 dnl The following uses quadrigraphs:
942 AC_HELP_STRING([--with-openssl@<:@=DIR@:>@], [Include OpenSSL support. DIR is the OpenSSL base]),
944 with_openssl_directory=${withval}
948 if test "x$with_openssl_directory" != "xno"; then
949 OPENSSL_LIBS="-lssl -lcrypto"
952 if test "x$with_openssl_directory" != "xyes" && test x"${with_openssl_directory}" != "x"; then
954 # Make sure the $with_openssl_directory also makes sense
956 if test -d "$with_openssl_directory/lib" -a -d "$with_openssl_directory/include"; then
957 OPENSSL_LIBS="-L$with_openssl_directory/lib $OPENSSL_LIBS"
958 OPENSSL_INC="-I$with_openssl_directory/include $OPENSSL_INC"
963 saved_CFLAGS="${CFLAGS}"
964 LIBS="${saved_LIBS} ${OPENSSL_LIBS}"
965 CFLAGS="${saved_CFLAGS} ${OPENSSL_INC}"
969 #include <openssl/ssl.h>
971 CRYPTO_set_id_callback(NULL);
983 #include <openssl/evp.h>
987 ac_cv_openssl_sha2="yes"
989 ac_cv_openssl_sha2="no"
993 dnl Solaris disables greater than 128+ bit encryption in their OpenSSL
994 dnl implementation, presumably for export reasons. If 192bit AES
995 dnl is available, we assume that we're running with a 'non-export'
999 #include <openssl/evp.h>
1003 ac_cv_openssl_export="no"
1005 ac_cv_openssl_export="yes"
1009 AC_MSG_RESULT([$support_tls])
1010 if test "$support_tls" = "yes"; then
1011 AC_DEFINE(HAVE_OPENSSL, 1, [Define if OpenSSL library is available])
1012 AC_DEFINE(HAVE_TLS, 1, [Define if TLS support should be enabled])
1013 AC_DEFINE(HAVE_CRYPTO, 1, [Define if encryption support should be enabled])
1016 if test "$ac_cv_openssl_sha2" = "yes"; then
1017 AC_DEFINE(HAVE_SHA2, 1, [Define if the SHA-2 family of digest algorithms is available])
1020 if test "$ac_cv_openssl_export" = "yes"; then
1021 AC_DEFINE(HAVE_OPENSSL_EXPORT_LIBRARY, 1, [Define if the OpenSSL library is export-contrained to 128bit ciphers])
1024 if test "$support_crypto" = "yes"; then
1025 AC_CHECK_LIB(crypto, EVP_PKEY_encrypt_old, AC_DEFINE(HAVE_OPENSSLv1, 1, [Set if have OpenSSL version 1.x]))
1028 LIBS="${saved_LIBS}"
1029 CFLAGS="${saved_CFLAGS}"
1033 AC_MSG_RESULT([$support_tls])
1036 if test "$support_tls" = "no" -o "$support_crypto" = "no"; then
1041 AC_SUBST(OPENSSL_LIBS)
1042 AC_SUBST(OPENSSL_INC)
1044 dnl -----------------------------------------------------------
1045 dnl dlopen is needed for plugins
1046 dnl -----------------------------------------------------------
1047 AC_SEARCH_LIBS(dlopen, [dl])
1049 dnl ------------------------------------------
1050 dnl Where to place working dir
1051 dnl ------------------------------------------
1052 working_dir=`eval echo /opt/bacula/working`
1053 AC_ARG_WITH(working-dir,
1054 AC_HELP_STRING([--with-working-dir=PATH], [specify path of Bacula working directory]),
1056 if test "x$withval" != "xno" ; then
1057 working_dir=$withval
1062 AC_SUBST(working_dir)
1064 dnl ------------------------------------------------------------------
1065 dnl If the user has not set archivedir, we set our default as /tmp
1066 dnl ------------------------------------------------------------------
1068 AC_ARG_WITH(archivedir,
1069 AC_HELP_STRING([--with-archivedir=PATH], [specify path of SD archive directory]),
1071 if test "x$withval" != "xno" ; then
1077 AC_SUBST(archivedir)
1079 dnl ------------------------------------------------------------------
1080 dnl Allow the user to specify the daemon resource name default hostname
1081 dnl ------------------------------------------------------------------
1083 AC_ARG_WITH(basename,
1084 AC_HELP_STRING([--with-basename=RESNAME], [specify base resource name for daemons]),
1086 if test "x$withval" != "xno" ; then
1094 dnl ------------------------------------------------------------------
1095 dnl Allow the user to override the hostname (default = machine hostname)
1096 dnl ------------------------------------------------------------------
1097 hostname=`uname -n | cut -d '.' -f 1`
1098 if test x${hostname} = x ; then
1099 hostname="localhost"
1101 dnl Make sure hostname is resolved
1102 ping -c 1 $hostname 2>/dev/null 1>/dev/null
1103 if test ! $? = 0; then
1104 hostname="localhost"
1106 AC_ARG_WITH(hostname,
1107 AC_HELP_STRING([--with-hostname=RESNAME], [specify host name for daemons]),
1109 if test "x$withval" != "xno" ; then
1118 dnl ------------------------------------------
1119 dnl Where to place scriptdir (script files)
1120 dnl ------------------------------------------
1121 scriptdir=`eval echo ${sysconfdir}`
1122 AC_ARG_WITH(scriptdir,
1123 AC_HELP_STRING([--with-scriptdir=PATH], [specify path of Bacula scripts directory]),
1125 if test "x$withval" != "xno" ; then
1134 dnl ------------------------------------------
1135 dnl Where to place bsrdir (bsr files)
1136 dnl ------------------------------------------
1137 bsrdir=`eval echo /opt/bacula/bsr`
1139 AC_HELP_STRING([--with-bsrdir=PATH], [specify path of Bacula bsrs directory]),
1141 if test "x$withval" != "xno" ; then
1149 dnl ------------------------------------------
1150 dnl Where to place logdir
1151 dnl ------------------------------------------
1152 logdir=`eval echo /opt/bacula/log`
1154 AC_HELP_STRING([--with-logdir=PATH], [specify path of Bacula logs directory]),
1156 if test "x$withval" != "xno" ; then
1165 # ------------------------------------------
1166 # Where to place plugindir (plugin files)
1167 # ------------------------------------------
1168 plugindir=`eval echo ${libdir}`
1169 AC_ARG_WITH(plugindir,
1170 AC_HELP_STRING([--with-plugindir=PATH], [specify path of Bacula plugins directory]),
1172 if test "x$withval" != "xno" ; then
1180 dnl ------------------------------------------
1181 dnl Where to send dump email
1182 dnl ------------------------------------------
1184 dnl ------------------------------------------
1185 dnl Where to send dump email
1186 dnl ------------------------------------------
1187 dump_email=root@localhost
1188 AC_ARG_WITH(dump-email,
1189 AC_HELP_STRING([--with-dump-email=EMAIL], [dump email address]),
1191 if test "x$withval" != "xno" ; then
1197 AC_SUBST(dump_email)
1199 dnl ------------------------------------------
1200 dnl Where to send job email
1201 dnl ------------------------------------------
1202 job_email=root@localhost
1203 AC_ARG_WITH(job-email,
1204 AC_HELP_STRING([--with-job-email=EMAIL], [job output email address]),
1206 if test "x$withval" != "xno" ; then
1214 dnl ------------------------------------------
1215 dnl Where to find smtp host
1216 dnl ------------------------------------------
1218 AC_ARG_WITH(smtp_host,
1219 AC_HELP_STRING([--with-smtp-host=HOST], [SMTP mail host address]),
1221 if test "x$withval" != "xno" ; then
1229 dnl ------------------------------------
1230 dnl Where to place pid files
1231 dnl ------------------------------------
1233 AC_ARG_WITH(pid-dir,
1234 AC_HELP_STRING([--with-pid-dir=PATH], [specify location of Bacula pid files]),
1236 if test "x$withval" != "xno" ; then
1242 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
1245 dnl ------------------------------------
1246 dnl Where to place subsys "lock file"
1247 dnl ------------------------------------
1248 subsysdir=/var/run/subsys
1249 if test -d /var/run/subsys; then
1250 subsysdir=/var/run/subsys
1251 elif test -d /var/lock/subsys; then
1252 subsysdir=/var/lock/subsys
1254 subsysdir=/var/run/subsys
1256 AC_ARG_WITH(subsys-dir,
1257 AC_HELP_STRING([--with-subsys-dir=PATH], [specify location of Bacula subsys file]),
1259 if test "x$withval" != "xno" ; then
1267 dnl ------------------------------------
1268 dnl Where to start assigning ports
1269 dnl ------------------------------------
1271 AC_ARG_WITH(baseport,
1272 AC_HELP_STRING([--with-baseport=PORT], [specify base port address for daemons]),
1274 if test "x$withval" != "xno" ; then
1281 dir_port=`expr $baseport`
1282 fd_port=`expr $baseport + 1`
1283 sd_port=`expr $fd_port + 1`
1289 dnl ------------------------------------------
1290 dnl Generate passwords
1291 dnl ------------------------------------------
1293 AC_ARG_WITH(dir-password,
1294 AC_HELP_STRING([--with-dir-password=PASSWORD], [specify Director's password]),
1296 if test "x$withval" != "xno" ; then
1297 dir_password=$withval
1302 if test "x$dir_password" = "x" ; then
1303 if test "x$OPENSSL" = "xnone" ; then
1304 key=`autoconf/randpass 33`
1306 key=`openssl rand -base64 33`
1312 AC_ARG_WITH(fd-password,
1313 AC_HELP_STRING([--with-fd-password=PASSWORD], [specify Client's password]),
1315 if test "x$withval" != "xno" ; then
1316 fd_password=$withval
1321 if test "x$fd_password" = "x" ; then
1322 if test "x$OPENSSL" = "xnone" ; then
1323 key=`autoconf/randpass 37`
1325 key=`openssl rand -base64 33`
1331 AC_ARG_WITH(sd-password,
1332 AC_HELP_STRING([--with-sd-password=PASSWORD], [specify Storage daemon's password]),
1334 if test "x$withval" != "xno" ; then
1335 sd_password=$withval
1340 if test "x$sd_password" = "x" ; then
1341 if test "x$OPENSSL" = "xnone" ; then
1342 key=`autoconf/randpass 41`
1344 key=`openssl rand -base64 33`
1350 AC_ARG_WITH(mon-dir-password,
1351 AC_HELP_STRING([--with-mon-dir-password=PASSWORD], [specify Director's password used by the monitor]),
1353 if test "x$withval" != "xno" ; then
1354 mon_dir_password=$withval
1359 if test "x$mon_dir_password" = "x" ; then
1360 if test "x$OPENSSL" = "xnone" ; then
1361 key=`autoconf/randpass 33`
1363 key=`openssl rand -base64 33`
1365 mon_dir_password=$key
1369 AC_ARG_WITH(mon-fd-password,
1370 AC_HELP_STRING([--with-mon-fd-password=PASSWORD], [specify Client's password used by the monitor]),
1372 if test "x$withval" != "xno" ; then
1373 mon_fd_password=$withval
1378 if test "x$mon_fd_password" = "x" ; then
1379 if test "x$OPENSSL" = "xnone" ; then
1380 key=`autoconf/randpass 37`
1382 key=`openssl rand -base64 33`
1384 mon_fd_password=$key
1388 AC_ARG_WITH(mon-sd-password,
1389 AC_HELP_STRING([--with-mon-sd-password=PASSWORD], [specify Storage daemon's password used by the monitor]),
1391 if test "x$withval" != "xno" ; then
1392 mon_sd_password=$withval
1397 if test "x$mon_sd_password" = "x" ; then
1398 if test "x$OPENSSL" = "xnone" ; then
1399 key=`autoconf/randpass 41`
1401 key=`openssl rand -base64 33`
1403 mon_sd_password=$key
1406 AC_SUBST(dir_password)
1407 AC_SUBST(fd_password)
1408 AC_SUBST(sd_password)
1409 AC_SUBST(mon_dir_password)
1410 AC_SUBST(mon_fd_password)
1411 AC_SUBST(mon_sd_password)
1414 dnl Pickup any database name
1417 AC_ARG_WITH(db_name,
1418 AC_HELP_STRING([--with-db-name=DBNAME], [specify database name @<:@default=bacula@:>@]),
1420 if test "x$withval" != "x" ; then
1428 AC_ARG_WITH(db_user,
1429 AC_HELP_STRING([--with-db-user=UNAME], [specify database user @<:@default=bacula@:>@]),
1431 if test "x$withval" != "x" ; then
1439 AC_ARG_WITH(db_password,
1440 AC_HELP_STRING([--with-db-password=PWD], [specify database password @<:@default=*none*@:>@]),
1442 if test "x$withval" != "x" ; then
1443 db_password=$withval
1447 AC_SUBST(db_password)
1450 dnl Pickup a database port
1453 AC_ARG_WITH(db_port,
1454 AC_HELP_STRING([--with-db-port=DBPORT], [specify a database port @<:@default=null@:>@]),
1456 if test "x$withval" != "x" ; then
1464 dnl Pickup MySQL SSL options for database user connection
1467 AC_ARG_WITH(db_ssl_options,
1468 AC_HELP_STRING([--with-db-ssl-options=DBSSLOPTIONS], [specify SSL options for database user connection @<:@default=null@:>@]),
1470 if test "x$withval" != "x" ; then
1471 db_ssl_options=$withval
1475 AC_SUBST(db_ssl_options)
1478 # Handle users and groups for each daemon
1481 AC_ARG_WITH(dir_user,
1482 AC_HELP_STRING([--with-dir-user=USER], [specify user for Director daemon]),
1484 if test "x$withval" != "x" ; then
1491 AC_ARG_WITH(dir_group,
1492 AC_HELP_STRING([--with-dir-group=GROUP], [specify group for Director daemon]),
1494 if test "x$withval" != "x" ; then
1501 AC_ARG_WITH(sd_user,
1502 AC_HELP_STRING([--with-sd-user=USER], [specify user for Storage daemon]),
1504 if test "x$withval" != "x" ; then
1511 AC_ARG_WITH(sd_group,
1512 AC_HELP_STRING([--with-sd-group=GROUP], [specify group for Storage daemon]),
1514 if test "x$withval" != "x" ; then
1521 AC_ARG_WITH(fd_user,
1522 AC_HELP_STRING([--with-fd-user=USER], [specify user for File daemon]),
1524 if test "x$withval" != "x" ; then
1531 AC_ARG_WITH(fd_group,
1532 AC_HELP_STRING([--with-fd-group=GROUP], [specify group for File daemon]),
1534 if test "x$withval" != "x" ; then
1548 dnl allow setting default executable permissions
1551 AC_ARG_WITH(sbin-perm,
1552 AC_HELP_STRING([--with-sbin-perm=MODE], [specify permissions for sbin binaries @<:@default=0750@:>@]),
1554 if test "x$withval" != "x" ; then
1562 dnl -------------------------------------------
1563 dnl enable batch attribute DB insert (default on)
1564 dnl -------------------------------------------
1565 support_batch_insert=yes
1566 AC_ARG_ENABLE(batch-insert,
1567 AC_HELP_STRING([--enable-batch-insert], [enable the DB batch insert code @<:@default=yes@:>@]),
1569 if test x$enableval = xno; then
1570 support_batch_insert=no
1575 if test x$support_batch_insert = xyes; then
1576 AC_DEFINE(USE_BATCH_FILE_INSERT, 1, [Set if DB batch insert code enabled])
1579 dnl ------------------------------------------------
1580 dnl Bacula check for various SQL database engines
1581 dnl ------------------------------------------------
1584 dnl Set uncomment_dbi by default to '#' if DBI is enabled this will get reset
1588 BA_CHECK_POSTGRESQL_DB
1594 dnl -------------------------------------------
1595 dnl If no batch insert backend are enable set
1596 dnl variable to None
1597 dnl -------------------------------------------
1598 if test -z "${batch_insert_db_backends}"; then
1599 batch_insert_db_backends="None"
1602 dnl -------------------------------------------
1603 dnl Make sure at least one database backend is found
1604 dnl -------------------------------------------
1605 if test "x${db_backends}" = "x" ; then
1608 echo "You have not specified either --enable-client-only or one of the"
1609 echo "supported databases: MySQL, PostgreSQL, or SQLite3."
1610 echo "This is not permitted. Please reconfigure."
1612 echo "Aborting the configuration ..."
1618 dnl -------------------------------------------
1619 dnl See how many catalog backends are configured.
1620 dnl -------------------------------------------
1621 case `echo $DB_BACKENDS | wc -w | sed -e 's/^ *//'` in
1623 DEFAULT_DB_TYPE="${DB_BACKENDS}"
1624 if test x$use_libtool = xno; then
1625 SHARED_CATALOG_TARGETS=""
1627 SHARED_CATALOG_TARGETS="libbaccats-${DEFAULT_DB_TYPE}.la"
1631 dnl ------------------------------------------------
1632 dnl Set the default backend to the first backend found
1633 dnl ------------------------------------------------
1634 DEFAULT_DB_TYPE=`echo ${DB_BACKENDS} | cut -d' ' -f1`
1636 dnl ------------------------------------------------
1637 dnl For multiple backend we need libtool support.
1638 dnl ------------------------------------------------
1639 if test x$use_libtool = xno; then
1642 echo "You have specified two or more of the"
1643 echo "supported databases: MySQL, PostgreSQL, or SQLite3."
1644 echo "This is not permitted when not using libtool Please reconfigure."
1646 echo "Aborting the configuration ..."
1652 SHARED_CATALOG_TARGETS=""
1653 for db_type in ${DB_BACKENDS}
1655 if test -z "${SHARED_CATALOG_TARGETS}"; then
1656 SHARED_CATALOG_TARGETS="libbaccats-${db_type}.la"
1658 SHARED_CATALOG_TARGETS="${SHARED_CATALOG_TARGETS} libbaccats-${db_type}.la"
1664 dnl -------------------------------------------
1665 dnl Unset DB_LIBS when using libtool as we link the
1666 dnl shared library using the right database lib no need to
1667 dnl set DB_LIBS which is only used for non shared versions
1668 dnl of the backends.
1669 dnl -------------------------------------------
1670 if test x$use_libtool = xyes; then
1674 AC_SUBST(uncomment_dbi)
1675 AC_SUBST(DB_BACKENDS)
1677 AC_SUBST(DEFAULT_DB_TYPE)
1678 AC_SUBST(SHARED_CATALOG_TARGETS)
1680 AC_DEFINE(PROTOTYPES)
1682 dnl --------------------------------------------------------------------------
1683 dnl Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
1685 if test -z "$CFLAGS" -o "$CFLAGS" = "-g -O2"; then
1686 if test -z "$CCOPTS"; then
1687 CCOPTS='-g -O2 -Wall'
1695 dnl See if we can use 64 bit file addresses
1696 largefile_support="no"
1701 dnl --------------------------------------------------------------------------
1702 dnl CHECKING FOR HEADER FILES
1703 dnl --------------------------------------------------------------------------
1742 AC_STRUCT_ST_BLKSIZE
1746 dnl --------------------------------------------------------------------------
1747 dnl Check for utime.h structure
1748 dnl --------------------------------------------------------------------------
1749 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
1753 #include <sys/types.h>
1758 ba_cv_header_utime_h=yes
1760 ba_cv_header_utime_h=no
1765 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H, 1, [Set if utime.h exists])
1767 dnl --------------------------------------------------------------------------
1768 dnl Check for socklen_t
1769 dnl --------------------------------------------------------------------------
1770 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
1774 #include <sys/types.h>
1775 #include <sys/socket.h>
1779 ba_cv_header_socklen_t=yes
1781 ba_cv_header_socklen_t=no
1786 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T, 1, [Set if socklen_t exists])
1788 dnl --------------------------------------------------------------------------
1789 dnl Check for ioctl request type
1790 dnl --------------------------------------------------------------------------
1792 AC_CACHE_CHECK(for ioctl_req_t, ba_cv_header_ioctl_req_t,
1797 #include <sys/types.h>
1798 #include <sys/ioctl.h>
1800 int (*d_ioctl)(int fd, unsigned long int request, ...);
1803 ba_cv_header_ioctl_req_t=yes
1805 ba_cv_header_ioctl_req_t=no
1810 test $ba_cv_header_ioctl_req_t = yes && AC_DEFINE(HAVE_IOCTL_ULINT_REQUEST, 1, [Set if ioctl request is unsigned long int])
1812 dnl Note: it is more correct to use AC_LANG(C++) but some of the older
1813 dnl *BSD systems still use old style C prototypes, which are wrong with
1814 dnl compiled with a C++ compiler.
1817 dnl --------------------------------------------------------------------------
1818 dnl Check for typeof()
1819 dnl --------------------------------------------------------------------------
1821 AC_CACHE_CHECK(for typeof, ba_cv_have_typeof,
1825 main(){char *a = 0; a = (typeof a)a;}
1827 ba_cv_have_typeof=yes
1829 ba_cv_have_typeof=no
1831 ba_cv_have_typeof=no
1836 test $ba_cv_have_typeof = yes && AC_DEFINE([HAVE_TYPEOF], 1, [Defind to 1 if compiler has typeof])
1841 AC_C_BIGENDIAN([AC_DEFINE([HAVE_BIG_ENDIAN], [1], [Big Endian])], [AC_DEFINE([HAVE_LITTLE_ENDIAN], [1], [Little Endian])])
1843 dnl --------------------------------------------------------------------------
1844 dnl CHECKING FOR FILESYSTEM TYPE
1845 dnl --------------------------------------------------------------------------
1846 AC_MSG_CHECKING(how to get filesystem type)
1848 # The order of these tests is important.
1851 #include <sys/statvfs.h>
1852 #include <sys/fstyp.h>
1854 AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4
1856 if test $fstype = no; then
1859 #include <sys/statfs.h>
1860 #include <sys/fstyp.h>
1862 AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3
1865 if test $fstype = no; then
1868 #include <sys/statfs.h>
1869 #include <sys/vmount.h>
1871 AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX
1874 if test $fstype = no; then
1879 AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD
1882 if test $fstype = no; then
1883 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
1885 if test $fstype = no; then
1888 #include <sys/mount.h>
1889 #include <sys/fs_types.h>
1891 AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix
1894 AC_MSG_RESULT($fstype)
1896 AC_CHECK_HEADER(sys/statvfs.h, [ AC_DEFINE(HAVE_SYS_STATVFS_H,1,[Defines if your system have the sys/statvfs.h header file])] , )
1898 AC_CHECK_DECLS([O_CLOEXEC],,[AC_DEFINE([O_CLOEXEC],[0], [Defined to 0 if not provided])],
1905 AC_CHECK_DECLS([FD_CLOEXEC],,[AC_DEFINE([FD_CLOEXEC],[0], [Defined to 0 if not provided])],
1912 AC_CHECK_DECLS([SOCK_CLOEXEC],,[AC_DEFINE([SOCK_CLOEXEC],[0],[Defined to 0 if not provided])],
1914 #ifdef HAVE_SYS_SOCKET_H
1915 # include <sys/socket.h>
1919 AC_CACHE_CHECK(for close on exec modifier for fopen(), ac_cv_feature_stream_cloexec_flag,
1920 [if test $ac_cv_have_decl_O_CLOEXEC = yes ; then
1921 if test $ac_cv_have_decl_SOCK_CLOEXEC = yes ; then
1922 ac_cv_feature_stream_cloexec_flag="e"
1926 if test "x$ac_cv_feature_stream_cloexec_flag" = "xe" ; then
1927 AC_DEFINE(HAVE_STREAM_CLOEXEC,[0],[Defined to 0 if not provided])
1930 AC_DEFINE_UNQUOTED([STREAM_CLOEXEC], "$ac_cv_feature_stream_cloexec_flag", [fopen() modifier for setting close on exec flag])
1932 AC_CHECK_FUNC(accept4, [AC_DEFINE(HAVE_ACCEPT4, 1, [Define to 1 if you have the 'accept4' function.])])
1939 if test x$support_s3 = xyes; then
1941 AC_HELP_STRING([--with-s3@<:@=DIR@:>@], [specify s3 library directory]),
1948 if test -f ${with_s3}/include/libs3.h; then
1949 S3_INC="-I${with_s3}/include"
1950 S3_LDFLAGS="-L${with_s3}/lib"
1951 with_s3="${with_s3}/include"
1953 with_s3="/usr/include"
1956 AC_CHECK_HEADER(${with_s3}/libs3.h,
1958 AC_DEFINE(HAVE_LIBS3, 1, [Define to 1 if you have libs3])
1959 S3_LIBS="${S3_LDFLAGS} -ls3"
1963 echo "libs3.h not found. s3 turned off ..."
1970 AC_CHECK_HEADER(libs3.h,
1972 AC_CHECK_LIB(s3, S3_initialize,
1975 AC_DEFINE(HAVE_LIBS3,1,[Define to 1 if you have libs3])
1986 AC_CHECK_FUNCS(backtrace)
1989 dnl --------------------------------------------------------------------------
1990 dnl CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
1991 dnl --------------------------------------------------------------------------
2001 AC_CHECK_TYPE(ino_t, unsigned long)
2002 AC_CHECK_TYPE(dev_t, unsigned long)
2003 AC_CHECK_TYPE(daddr_t, long)
2004 AC_CHECK_TYPE(major_t, int)
2005 AC_CHECK_TYPE(minor_t, int)
2006 AC_CHECK_TYPE(ssize_t, int)
2013 AC_CHECK_SIZEOF(char, 1)
2014 AC_CHECK_SIZEOF(short int, 2)
2015 AC_CHECK_SIZEOF(int, 4)
2016 AC_CHECK_SIZEOF(long int, 4)
2017 AC_CHECK_SIZEOF(long long int, 8)
2018 AC_CHECK_SIZEOF(int *, 4)
2020 dnl Check for sys/types.h types
2021 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int,
2025 #include <sys/types.h>
2029 ac_cv_have_u_int="yes"
2031 ac_cv_have_u_int="no"
2036 if test "x$ac_cv_have_u_int" = "xyes" ; then
2037 AC_DEFINE(HAVE_U_INT)
2041 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t,
2045 #include <sys/types.h>
2049 ac_cv_have_intmax_t="yes"
2057 ac_cv_have_intmax_t="yes"
2059 ac_cv_have_intmax_t="no"
2066 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
2067 AC_DEFINE(HAVE_INTMAX_T)
2071 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t,
2075 #include <sys/types.h>
2077 u_intmax_t a; a = 1;
2079 ac_cv_have_u_intmax_t="yes"
2085 u_intmax_t a; a = 1;
2087 ac_cv_have_u_intmax_t="yes"
2089 ac_cv_have_u_intmax_t="no"
2096 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
2097 AC_DEFINE(HAVE_U_INTMAX_T)
2101 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t,
2105 #include <sys/types.h>
2107 int8_t a; int16_t b; int32_t c; a = b = c = 1;
2109 ac_cv_have_intxx_t="yes"
2111 ac_cv_have_intxx_t="no"
2116 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
2117 AC_DEFINE(HAVE_INTXX_T)
2121 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t,
2125 #include <sys/types.h>
2129 ac_cv_have_int64_t="yes"
2131 ac_cv_have_int64_t="no"
2136 if test "x$ac_cv_have_int64_t" = "xyes" ; then
2137 AC_DEFINE(HAVE_INT64_T)
2141 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t,
2145 #include <sys/types.h>
2147 u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;
2149 ac_cv_have_u_intxx_t="yes"
2151 ac_cv_have_u_intxx_t="no"
2156 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
2157 AC_DEFINE(HAVE_U_INTXX_T)
2161 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t,
2165 #include <sys/types.h>
2169 ac_cv_have_u_int64_t="yes"
2171 ac_cv_have_u_int64_t="no"
2176 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
2177 AC_DEFINE(HAVE_U_INT64_T)
2181 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
2182 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2184 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
2187 #include <sys/bitypes.h>
2189 int8_t a; int16_t b; int32_t c;
2190 u_int8_t e; u_int16_t f; u_int32_t g;
2191 a = b = c = e = f = g = 1;
2193 AC_DEFINE(HAVE_U_INTXX_T)
2194 AC_DEFINE(HAVE_INTXX_T)
2195 AC_DEFINE(HAVE_SYS_BITYPES_H)
2203 if test -z "$have_u_intxx_t" ; then
2204 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t,
2208 #include <sys/types.h>
2210 uint8_t a; uint16_t b;
2211 uint32_t c; a = b = c = 1;
2213 ac_cv_have_uintxx_t="yes"
2215 ac_cv_have_uintxx_t="no"
2220 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
2221 AC_DEFINE(HAVE_UINTXX_T)
2225 if (test -z "$have_u_int64_t" || test -z "$have_int64_t" && \
2226 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2228 AC_MSG_CHECKING([for int64_t and u_int64_t types in sys/bitypes.h])
2231 #include <sys/bitypes.h>
2233 int64_t a; u_int64_t b;
2236 AC_DEFINE(HAVE_U_INT64_T)
2237 AC_DEFINE(HAVE_INT64_T)
2245 if (test -z "$have_uintxx_t" && \
2246 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2248 AC_MSG_CHECKING([for uintXX_t types in sys/bitypes.h])
2251 #include <sys/bitypes.h>
2253 uint8_t a; uint16_t b;
2254 uint32_t c; a = b = c = 1;
2256 AC_DEFINE(HAVE_UINTXX_T)
2264 dnl --------------------------------------------------------------------------
2265 dnl CHECKING FOR REQUIRED LIBRARY FUNCTIONS
2266 dnl --------------------------------------------------------------------------
2282 [echo 'configure: cannot find needed function.'; exit 1]
2287 AC_DEFINE(HAVE_FCNTL_F_CLOSEM, 1, [Set if you have 'F_CLOSEM' fcntl flag]),
2289 [#include <fcntl.h>]
2294 AC_DEFINE(HAVE_FCNTL_LOCK, 1, [Set if fcntl supports file locking]),
2296 [#include <fcntl.h>]
2299 AC_CHECK_FUNC(closefrom, [AC_DEFINE(HAVE_CLOSEFROM, 1, [Define to 1 if you have the 'closefrom' function.])])
2300 AC_CHECK_FUNCS(getpagesize, [AC_DEFINE(HAVE_GETPAGESIZE, 1, [Set if have getpagesize])])
2301 AC_CHECK_FUNCS(malloc_trim, [AC_DEFINE(HAVE_MALLOC_TRIM, 1, [Set if have malloc_trim])])
2303 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
2304 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
2305 AC_CHECK_FUNCS(posix_fadvise)
2306 AC_CHECK_FUNCS(posix_fallocate)
2307 AC_CHECK_FUNCS(fdatasync)
2309 AC_CHECK_FUNCS(chflags)
2311 AC_CHECK_FUNCS(snprintf vsnprintf gethostid fseeko)
2313 AC_CACHE_CHECK(for va_copy, ba_cv_va_copy,
2318 void use_va_copy(va_list args){va_list args2; va_copy(args2,args); va_end(args2);}
2319 void call_use_va_copy(int junk,...){va_list args; va_start(args,junk); use_va_copy(args); va_end(args);}
2321 call_use_va_copy(1,2,3)
2330 test $ba_cv_va_copy = yes && AC_DEFINE(HAVE_VA_COPY, 1, [Set if va_copy exists])
2332 dnl --------------------------------------------------------------------------
2333 dnl CHECKING FOR THREAD SAFE FUNCTIONS
2334 dnl --------------------------------------------------------------------------
2335 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
2337 # If resolver functions are not in libc check for -lnsl or -lresolv.
2338 AC_CHECK_FUNC(gethostbyname_r,
2339 AC_MSG_RESULT(using libc's resolver),
2340 AC_CHECK_LIB(nsl,gethostbyname_r)
2341 AC_CHECK_LIB(resolv,gethostbyname_r))
2343 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
2344 AC_CHECK_FUNCS(inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)])
2345 AC_CHECK_FUNCS(gethostbyname2, [AC_DEFINE(HAVE_GETHOSTBYNAME2)])
2346 AC_CHECK_FUNCS(getnameinfo, [AC_DEFINE(HAVE_GETNAMEINFO)])
2349 dnl ----------------------------
2350 dnl check sa_len of sockaddr
2351 dnl ----------------------------
2352 AC_CACHE_CHECK(for struct sockaddr has a sa_len field, ac_cv_struct_sockaddr_sa_len,
2356 #include <sys/socket.h>
2358 struct sockaddr s; s.sa_len;
2360 ac_cv_struct_sockaddr_sa_len=yes
2361 ], [ac_cv_struct_sockaddr_sa_len=no
2367 if test $ac_cv_struct_sockaddr_sa_len = yes; then
2368 AC_DEFINE(HAVE_SA_LEN, 1, [Define if sa_len field exists in struct sockaddr])
2372 dnl check for working getaddrinfo()
2374 dnl Note that if the system doesn't have gai_strerror(), we
2375 dnl can't use getaddrinfo() because we can't get strings
2376 dnl describing the error codes.
2378 AC_CACHE_CHECK(for working getaddrinfo, ac_cv_working_getaddrinfo,
2384 #include <sys/types.h>
2385 #include <sys/socket.h>
2388 struct addrinfo hints, *ai;
2391 memset(&hints, 0, sizeof(hints));
2392 hints.ai_family = AF_UNSPEC;
2393 hints.ai_socktype = SOCK_STREAM;
2394 error = getaddrinfo("127.0.0.1", NULL, &hints, &ai);
2398 if (ai->ai_addr->sa_family != AF_INET) {
2404 ac_cv_working_getaddrinfo="yes"
2406 ac_cv_working_getaddrinfo="no"
2408 ac_cv_working_getaddrinfo="yes"
2413 AC_CHECK_FUNC(gai_strerror, [AC_DEFINE(HAVE_GAI_STRERROR, 1, [Define to 1 if you have the 'gai_strerror' function.])])
2415 if test "$ac_cv_working_getaddrinfo" = "yes"; then
2416 if test "$ac_cv_func_gai_strerror" != "yes"; then
2417 ac_cv_working_getaddrinfo="no"
2419 AC_DEFINE(HAVE_GETADDRINFO, 1, [Define to 1 if getaddrinfo exists and works])
2427 AC_CHECK_FUNCS(getmntinfo, [AC_DEFINE(HAVE_GETMNTINFO)])
2428 AC_FUNC_CLOSEDIR_VOID
2429 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
2430 # AC_FUNC_FNMATCH dnl use local version
2432 AC_CHECK_LIB(intl, gettext, [LIBS="$LIBS -lintl"])
2434 AC_CHECK_LIB(sun, getpwnam)
2436 AC_CHECK_HEADERS(zlib.h)
2437 AC_CHECK_LIB(z, deflate, [ZLIBS="-lz"])
2439 if test x$ZLIBS = x-lz; then
2440 AC_DEFINE(HAVE_LIBZ)
2446 dnl Check if we have AFS on this system
2452 AC_HELP_STRING([--disable-afs], [disable afs support @<:@default=auto@:>@]),
2454 if test x$enableval = xyes; then
2456 elif test x$enableval = xno; then
2463 if test x$support_afs = xyes -o x$support_afs = xauto; then
2465 AC_HELP_STRING([--with-afsdir@<:@=DIR@:>@], [Directory holding AFS includes/libs]),
2466 with_afsdir=$withval
2470 dnl Search in standard places, or --with-afsdir not specified
2472 if test x$with_afsdir = x; then
2473 for root in /usr /usr/local; do
2474 if test -d ${root}/include/afs/ ; then
2478 if test -d ${root}/include/openafs/afs/ ; then
2485 if test -d ${with_afsdir}/include/afs/ ; then
2486 AFS_CFLAGS="-I${with_afsdir}/include"
2488 if test -d ${with_afsdir}/include/openafs/afs/ ; then
2489 AFS_CFLAGS="-I${with_afsdir}/include/openafs"
2493 saved_CFLAGS="${CFLAGS}"
2494 saved_CPPFLAGS="${CPPFLAGS}"
2495 CFLAGS="${AFS_CFLAGS} ${saved_CFLAGS}"
2496 CPPFLAGS="${AFS_CFLAGS} ${saved_CPPFLAGS}"
2498 AC_CHECK_HEADERS(afs/afsint.h)
2501 #include <afs/afsint.h>
2502 #include <afs/venus.h>
2504 AC_DEFINE(HAVE_AFS_VENUS_H,1,[Define to 1 if you have the <afs/venus.h> header file.])
2507 CFLAGS="${saved_CFLAGS}"
2508 CPPFLAGS="${saved_CPPFLAGS}"
2511 dnl See if we can find a libsys with the pioctl symbol in there
2513 AC_MSG_CHECKING(for pioctl in AFS libsys)
2514 for dir in ${with_afsdir}/lib \
2515 ${with_afsdir}/lib/afs \
2516 ${with_afsdir}/lib/openafs \
2517 ${with_afsdir}/lib64 \
2518 ${with_afsdir}/lib64/afs \
2519 ${with_afsdir}/lib64/openafs
2521 for arch_type in .a .so
2523 A=`test -f ${dir}/libsys${arch_type} && nm ${dir}/libsys${arch_type} 2>/dev/null | grep pioctl`
2525 if test $pkg = 0; then
2527 AFS_LIBS="-L${dir} -lsys -lrx -llwp ${dir}/util${arch_type}"
2533 if test $have_afs = yes; then
2539 if test x$support_afs = xyes -a $have_afs != yes; then
2540 AC_MSG_ERROR([afs support explicitly enabled but no supported afs implementation found,
2541 please either load the afs libraries or rerun configure without --enable-afs])
2543 if test $have_afs = yes; then
2544 AC_DEFINE(HAVE_AFS,1,[Define to 1 if your system has AFS support])
2545 AC_DEFINE(HAVE_AFS_ACL,1,[Andrew FileSystem ACL support])
2549 AC_SUBST(AFS_CFLAGS)
2552 dnl ---------------------------------------------------
2553 dnl Check for lzo support/directory (default on)
2554 dnl ---------------------------------------------------
2555 dnl this allows you to turn it completely off
2558 AC_HELP_STRING([--disable-lzo], [disable lzo support @<:@default=yes@:>@]),
2560 if test x$enableval = xno; then
2571 if test x$support_lzo = xyes; then
2573 AC_HELP_STRING([--with-lzo@<:@=DIR@:>@], [specify lzo library directory]),
2580 if test -f ${with_lzo}/include/lzo/lzoconf.h; then
2581 LZO_INC="-I${with_lzo}/include"
2582 LZO_LDFLAGS="-L${with_lzo}/lib"
2583 with_lzo="${with_lzo}/include"
2585 with_lzo="/usr/include"
2588 AC_CHECK_HEADER(${with_lzo}/lzo/lzoconf.h,
2590 AC_DEFINE(HAVE_LZO, 1, [Define to 1 if you have LZO compression])
2591 LZO_LIBS="${LZO_LDFLAGS} -llzo2"
2595 echo "lzoconf.h not found. lzo turned off ..."
2602 AC_CHECK_HEADER(lzo/lzoconf.h,
2604 AC_CHECK_HEADER(lzo/lzo1x.h,
2606 AC_CHECK_LIB(lzo2, lzo1x_1_compress,
2609 AC_DEFINE(HAVE_LZO,1,[Define to 1 if you have LZO compression])
2622 dnl Check for ACL support and libraries
2626 AC_HELP_STRING([--disable-acl], [disable acl support @<:@default=auto@:>@]),
2628 if test x$enableval = xyes; then
2630 elif test x$enableval = xno; then
2637 have_extended_acl=no
2638 if test x$support_acl = xyes -o x$support_acl = xauto; then
2639 AC_CHECK_HEADER(sys/acl.h, [ AC_DEFINE(HAVE_SYS_ACL_H,1,[Defines if your system have the sys/acl.h header file])] , )
2642 dnl First check for acl_get_file in libc
2644 AC_CHECK_FUNC(acl_get_file,
2651 dnl Check for acl_get_file in libacl (Linux)
2653 if test $have_acl = no; then
2654 AC_CHECK_LIB(acl, acl_get_file,
2657 if test $have_afs = yes; then
2659 dnl Because of possible naming conflict with AFS libacl make sure we use the one in /usr/lib64 or /usr/lib !!!
2661 if test -d /usr/lib64/; then
2662 FDLIBS="-L/usr/lib64 -lacl $FDLIBS"
2664 FDLIBS="-L/usr/lib -lacl $FDLIBS"
2667 FDLIBS="-lacl $FDLIBS"
2674 dnl Check for acl_get_file in libpacl (OSF1)
2675 dnl and if ACL_TYPE_DEFAULT_DIR is defined.
2677 if test $have_acl = no -a \
2678 x${HAVE_OSF1_OS_TRUE} = x; then
2679 AC_CHECK_LIB(pacl, acl_get_file,
2682 FDLIBS="-lpacl $FDLIBS"
2686 AC_MSG_CHECKING(for ACL_TYPE_DEFAULT_DIR in acl.h include file)
2687 grep ACL_TYPE_DEFAULT_DIR /usr/include/sys/acl.h > /dev/null 2>&1
2688 if test $? = 0; then
2689 AC_DEFINE(HAVE_ACL_TYPE_DEFAULT_DIR,1,[Defines if your system have the ACL_TYPE_DEFAULT_DIR acl type])
2697 dnl On OSX check for availability of ACL_TYPE_EXTENDED
2699 if test $have_acl = yes -a \
2700 x${HAVE_DARWIN_OS_TRUE} = x; then
2701 AC_MSG_CHECKING(for ACL_TYPE_EXTENDED in acl.h include file)
2702 grep ACL_TYPE_EXTENDED /usr/include/sys/acl.h > /dev/null 2>&1
2703 if test $? = 0; then
2704 AC_DEFINE(HAVE_ACL_TYPE_EXTENDED,1,[Defines if your system have the ACL_TYPE_EXTENDED acl type])
2712 dnl On FreeBSD check for availability of ACL_TYPE_NFS4
2714 if test $have_acl = yes -a \
2715 x${HAVE_FREEBSD_OS_TRUE} = x; then
2716 AC_MSG_CHECKING(for ACL_TYPE_NFS4 in acl.h include file)
2717 grep ACL_TYPE_NFS4 /usr/include/sys/acl.h > /dev/null 2>&1
2718 if test $? = 0; then
2719 AC_DEFINE(HAVE_ACL_TYPE_NFS4,1,[Defines if your system have the ACL_TYPE_NFS4 acl type])
2727 dnl Check for acltotext and acl_totext (Solaris)
2729 if test $have_acl = no -a \
2730 x${HAVE_SUN_OS_TRUE} = x; then
2731 AC_CHECK_LIB(sec, acltotext,
2734 FDLIBS="-lsec $FDLIBS"
2736 AC_CHECK_LIB(sec, acl_totext,
2738 have_extended_acl=yes
2746 dnl Check for acl_get and aclx_get (AIX)
2748 if test $have_acl = no -a \
2749 x${HAVE_AIX_OS_TRUE} = x; then
2750 AC_CHECK_FUNC(acl_get,
2754 AC_CHECK_FUNC(aclx_get,
2756 have_extended_acl=yes
2763 if test x$support_acl = xyes -a $have_acl != yes; then
2764 AC_MSG_ERROR([acl support explicitly enabled but no supported acl implementation found,
2765 please either load the acl libraries or rerun configure without --enable-acl])
2767 if test $have_acl = yes; then
2768 AC_DEFINE([HAVE_ACL],1,[Normal acl support])
2771 if test $have_extended_acl = yes; then
2772 AC_DEFINE([HAVE_EXTENDED_ACL],1,[Extended acl support])
2778 dnl Check for XATTR support
2781 AC_ARG_ENABLE(xattr,
2782 AC_HELP_STRING([--disable-xattr], [disable xattr support @<:@default=auto@:>@]),
2784 if test x$enableval = xyes; then
2786 elif test x$enableval = xno; then
2793 if test x$support_xattr = xyes -o x$support_xattr = xauto; then
2795 dnl First check for *BSD support
2796 dnl When running on a BSD variant
2798 if test x${HAVE_FREEBSD_OS_TRUE} = x -o \
2799 x${HAVE_NETBSD_OS_TRUE} = x -o \
2800 x${HAVE_OPENBSD_OS_TRUE} = x; then
2801 AC_CHECK_HEADER(sys/extattr.h, [ AC_DEFINE(HAVE_SYS_EXTATTR_H,1,[Defines if your system have the sys/extattr.h header file])] , )
2802 AC_CHECK_HEADER(libutil.h, [ AC_DEFINE(HAVE_LIBUTIL_H,1,[Defines if your system have the libutil.h header file])] , )
2803 AC_CHECK_FUNCS(extattr_get_link extattr_set_link extattr_list_link,
2806 AC_DEFINE([HAVE_EXTATTR_GET_LINK],1,[Define to 1 if you have the 'extattr_get_link' function.])
2807 AC_DEFINE([HAVE_EXTATTR_SET_LINK],1,[Define to 1 if you have the 'extattr_set_link' function.])
2808 AC_DEFINE([HAVE_EXTATTR_LIST_LINK],1,[Define to 1 if you have the 'extattr_list_link' function.])
2812 if test $have_xattr = no; then
2813 AC_CHECK_FUNCS(extattr_get_file extattr_set_file extattr_list_file,
2816 AC_DEFINE([HAVE_EXTATTR_GET_FILE],1,[Define to 1 if you have the 'extattr_get_file' function.])
2817 AC_DEFINE([HAVE_EXTATTR_SET_FILE],1,[Define to 1 if you have the 'extattr_set_file' function.])
2818 AC_DEFINE([HAVE_EXTATTR_LIST_FILE],1,[Define to 1 if you have the 'extattr_list_file' function.])
2823 if test $have_xattr = yes; then
2824 have_extattr_string_in_libc=no
2825 AC_CHECK_FUNCS(extattr_namespace_to_string extattr_string_to_namespace,
2827 have_extattr_string_in_libc=yes
2828 AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2829 AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2834 dnl If extattr_namespace_to_string and extattr_string_to_namespace are not in libc see if they are in libutil
2836 if test $have_extattr_string_in_libc = no; then
2837 AC_CHECK_LIB(util, extattr_namespace_to_string extattr_string_to_namespace,
2839 AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2840 AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2841 FDLIBS="-lutil $FDLIBS"
2849 dnl If we failed to find *BSD support try the AIX implementation of extented attributes (EA)
2850 dnl When running on AIX
2852 if test $have_xattr = no -a \
2853 x${HAVE_AIX_OS_TRUE} = x; then
2854 AC_CHECK_HEADER(sys/ea.h, [ AC_DEFINE(HAVE_SYS_EA_H,1,[Defines if your system have the sys/ea.h header file])] , )
2855 AC_CHECK_FUNCS(llistea lgetea lsetea,
2858 AC_DEFINE([HAVE_LLISTEA],1,[Define to 1 if you have the 'llistea' function.])
2859 AC_DEFINE([HAVE_LGETEA],1,[Define to 1 if you have the 'lgetea' function.])
2860 AC_DEFINE([HAVE_LSETEA],1,[Define to 1 if you have the 'lsetea' function.])
2864 if test $have_xattr = no; then
2865 AC_CHECK_FUNCS(listea getea setea,
2868 AC_DEFINE([HAVE_LISTEA],1,[Define to 1 if you have the 'listea' function.])
2869 AC_DEFINE([HAVE_GETEA],1,[Define to 1 if you have the 'getea' function.])
2870 AC_DEFINE([HAVE_SETEA],1,[Define to 1 if you have the 'setea' function.])
2877 dnl If we failed to find AIX support try the TRU64 implementation of extented attributes
2878 dnl when running on a TRU64 OS.
2880 if test $have_xattr = no -a \
2881 x${HAVE_OSF1_OS_TRUE} = x; then
2882 AC_CHECK_HEADER(sys/proplist.h, [ AC_DEFINE(HAVE_SYS_PROPLIST_H,1,[Defines if your system have the sys/proplist.h header file])] , )
2883 AC_CHECK_FUNCS(getproplist get_proplist_entry sizeof_proplist_entry add_proplist_entry setproplist,
2886 AC_DEFINE([HAVE_GETPROPLIST],1,[Define to 1 if you have the 'getproplist' function.])
2887 AC_DEFINE([HAVE_GET_PROPLIST_ENTRY],1,[Define to 1 if you have the 'get_proplist_entry' function.])
2888 AC_DEFINE([HAVE_SIZEOF_PROPLIST_ENTRY],1,[Define to 1 if you have the 'sizeof_proplist_entry' function.])
2889 AC_DEFINE([HAVE_ADD_PROPLIST_ENTRY],1,[Define to 1 if you have the 'add_proplist_entry' function.])
2890 AC_DEFINE([HAVE_SETPROPLIST],1,[Define to 1 if you have the 'setproplist' function.])
2896 dnl If we failed to find TRU64 support try the SOLARIS implementation of extented and extensible attributes
2897 dnl when running on a Solaris.
2899 if test $have_xattr = no -a \
2900 x${HAVE_SUN_OS_TRUE} = x; then
2901 AC_CHECK_HEADER(sys/attr.h, [ AC_DEFINE(HAVE_SYS_ATTR_H,1,[Defines if your system have the sys/attr.h header file])] , )
2902 AC_CHECK_HEADER(sys/nvpair.h, [ AC_DEFINE(HAVE_SYS_NVPAIR_H,1,[Defines if your system have the sys/nvpair.h header file])] , )
2903 AC_CHECK_HEADER(attr.h, [ AC_DEFINE(HAVE_ATTR_H,1,[Defines if your system have the attr.h header file])] , )
2905 AC_CHECK_FUNCS(openat fstatat unlinkat fchownat futimesat,
2908 AC_DEFINE([HAVE_OPENAT],1,[Define to 1 if you have the 'openat' function.])
2909 AC_DEFINE([HAVE_FSTATAT],1,[Define to 1 if you have the 'fstatat' function.])
2910 AC_DEFINE([HAVE_UNLINKAT],1,[Define to 1 if you have the 'unlinkat' function.])
2911 AC_DEFINE([HAVE_FCHOWNAT],1,[Define to 1 if you have the 'fchownat' function.])
2912 AC_DEFINE([HAVE_FUTIMESAT],1,[Define to 1 if you have the 'futimesat' function.])
2916 if test $have_xattr = yes; then
2917 AC_CHECK_LIB(nvpair, nvlist_next_nvpair,
2919 AC_DEFINE([HAVE_NVLIST_NEXT_NVPAIR],1,[Define to 1 if you have the 'nvlist_next_nvpair' function.])
2920 FDLIBS="-lnvpair $FDLIBS"
2927 dnl If we failed to find Solaris support try the generic xattr support code
2929 if test $have_xattr = no; then
2930 AC_CHECK_HEADER(sys/xattr.h, [ AC_DEFINE(HAVE_SYS_XATTR_H,1,[Defines if your system have the sys/xattr.h header file])] , )
2931 AC_CHECK_FUNCS(llistxattr lgetxattr lsetxattr,
2934 AC_DEFINE([HAVE_LLISTXATTR],1,[Define to 1 if you have the 'llistxattr' function.])
2935 AC_DEFINE([HAVE_LGETXATTR],1,[Define to 1 if you have the 'lgetxattr' function.])
2936 AC_DEFINE([HAVE_LSETXATTR],1,[Define to 1 if you have the 'lsetxattr' function.])
2940 if test $have_xattr = no; then
2941 AC_CHECK_FUNCS(listxattr getxattr setxattr,
2944 AC_DEFINE([HAVE_LISTXATTR],1,[Define to 1 if you have the 'listxattr' function.])
2945 AC_DEFINE([HAVE_GETXATTR],1,[Define to 1 if you have the 'getxattr' function.])
2946 AC_DEFINE([HAVE_SETXATTR],1,[Define to 1 if you have the 'setxattr' function.])
2952 if test x$support_xattr = xyes -a $have_xattr != yes; then
2953 AC_MSG_ERROR([xattr support explicitly enabled but no supported xattr implementation found,
2954 please either load the xattr libraries or rerun configure without --enable-xattr])
2956 if test $have_xattr = yes; then
2957 AC_DEFINE([HAVE_XATTR],1,[Extended Attributes support])
2963 dnl Check for pthread libraries
2966 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
2968 AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
2970 AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
2972 AC_CHECK_FUNC(pthread_create)
2981 dnl Check for headers, functions and libraries required to support
2982 dnl keeping readall capabilities
2984 AC_CHECK_HEADERS(sys/prctl.h sys/capability.h)
2985 AC_CHECK_FUNCS(prctl setreuid)
2986 AC_CHECK_LIB([cap], [cap_set_proc], [CAP_LIBS="-lcap"], [CAP_LIBS=])
2987 if test x$CAP_LIBS = x-lcap; then
2988 AC_DEFINE(HAVE_LIBCAP, 1, [Define if you have libcap])
2997 if test x$have_gcc = xyes ; then
2998 CPPFLAGS="$CPPFLAGS -x c++ -fno-strict-aliasing -fno-exceptions -fno-rtti"
2999 CFLAGS="$CFLAGS -x c++ -fno-strict-aliasing -fno-exceptions -fno-rtti"
3001 LDFLAGS=${LDFLAGS--O}
3002 CPPFLAGS="$CPPFLAGS"
3014 AC_SUBST(X_EXTRA_LIBS)
3019 dnl extra configurable objects
3030 dnl Finally we set appropriate distribution specific
3031 dnl variables and defaults
3036 COMPRESS_MANPAGES=yes
3041 PSCMD="ps -e -o pid,comm"
3042 PFILES="${PFILES} platforms/aix/Makefile"
3043 TAPEDRIVE="/dev/rmt0.1"
3047 PTHREAD_LIB="-lpthread -lexc"
3048 if test "${CC}" = "gcc" ; then
3055 TAPEDRIVE="/dev/nrmt0"
3058 DISTVER=`uname -a |awk '{print $3}'`
3059 TAPEDRIVE="/dev/nrmt0"
3060 PTHREAD_LIB="-pthread"
3061 CFLAGS="${CFLAGS} -pthread"
3062 PSCMD="ps -ax -o pid,command"
3066 platforms/bsdi/Makefile \
3067 platforms/bsdi/bacula-fd \
3068 platforms/bsdi/bacula-sd \
3069 platforms/bsdi/bacula-dir"
3070 largefile_support="yes"
3073 DISTVER=`uname -a |awk '{print $3}'`
3074 TAPEDRIVE="/dev/nrst0"
3077 WLDFLAGS="-mwindows"
3081 TAPEDRIVE="/dev/nst0"
3082 PSCMD="ps -e -o pid,command"
3085 platforms/darwin/Makefile"
3089 TAPEDRIVE="/dev/nst0"
3090 PSCMD="ps -e -o pid,command"
3093 platforms/osx/Makefile"
3096 if `test -f /etc/apt/sources.list && grep -q ubuntu /etc/apt/sources.list`; then
3099 DISTVER=`cat /etc/debian_version`
3100 if test -f /etc/lsb-release ; then
3102 if test "x$DISTRIB_ID" != "x" ; then
3103 DISTNAME=$DISTRIB_ID
3105 if test "x$DISTRIB_RELEASE" != "x" ; then
3106 DISTVER=$DISTRIB_RELEASE
3109 if test "$DISTNAME" = "Ubuntu" ; then
3112 TAPEDRIVE="/dev/nst0"
3113 PSCMD="ps -e -o pid,command"
3114 if test "$DISTNAME" = "ubuntu" ; then
3116 platforms/ubuntu/Makefile \
3117 platforms/ubuntu/bacula-fd \
3118 platforms/ubuntu/bacula-sd \
3119 platforms/ubuntu/bacula-dir"
3122 platforms/debian/Makefile \
3123 platforms/debian/bacula-fd \
3124 platforms/debian/bacula-sd \
3125 platforms/debian/bacula-dir"
3129 DISTVER=`uname -a |awk '{print $3}'`
3130 VER=`echo $DISTVER | cut -c 1`
3131 if test x$VER = x4 ; then
3132 PTHREAD_LIB="${PTHREAD_LIBS:--pthread}"
3133 CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS:--pthread}"
3137 TAPEDRIVE="/dev/nrsa0"
3138 PSCMD="ps -ax -o pid,command"
3140 platforms/freebsd/Makefile \
3141 platforms/freebsd/bacula-fd \
3142 platforms/freebsd/bacula-sd \
3143 platforms/freebsd/bacula-dir"
3144 largefile_support="yes"
3148 TAPEDRIVE="/dev/nst0"
3149 PSCMD="ps -e -o pid,command"
3151 platforms/hurd/Makefile \
3152 platforms/hurd/bacula-fd \
3153 platforms/hurd/bacula-sd \
3154 platforms/hurd/bacula-dir"
3157 PSCMD="UNIX95=1; ps -e -o pid,comm"
3158 CFLAGS="${CFLAGS} -D_XOPEN_SOURCE_EXTENDED=1"
3160 TAPEDRIVE="/dev/rmt/0hnb"
3161 PTHREAD_LIB="-lpthread"
3162 AC_DEFINE([_INCLUDE_LONGLONG])
3166 TAPEDRIVE="/dev/rmt/0cbn"
3167 PSCMD="ps -e -o pid,comm"
3169 platforms/irix/Makefile \
3170 platforms/irix/bacula-fd \
3171 platforms/irix/bacula-sd \
3172 platforms/irix/bacula-dir"
3175 DISTVER=`uname -a |awk '{print $3}'`
3178 TAPEDRIVE="/dev/nrst0"
3179 PSCMD="ps -ax -o pid,command"
3180 PTHREAD_LIB="-pthread"
3181 CFLAGS="${CFLAGS} -pthread"
3184 DISTVER=`uname -a |awk '{print $3}'`
3187 TAPEDRIVE="/dev/nrst0"
3188 PSCMD="ps -ax -o pid,command"
3189 PTHREAD_LIB="-pthread"
3190 CFLAGS="${CFLAGS} -pthread"
3192 platforms/openbsd/Makefile \
3193 platforms/openbsd/bacula-fd \
3194 platforms/openbsd/bacula-sd \
3195 platforms/openbsd/bacula-dir"
3198 if test -f /etc/whitebox-release ; then
3199 f=/etc/whitebox-release
3201 f=/etc/redhat-release
3203 if test `cat $f | grep release |\
3204 cut -f 3 -d ' '`x = "Enterprise"x ; then
3205 DISTVER="Enterprise "`cat $f | grep release |\
3208 DISTVER=`cat /etc/redhat-release | grep release |\
3211 TAPEDRIVE="/dev/nst0"
3212 PSCMD="ps -e -o pid,command"
3214 platforms/redhat/Makefile \
3215 platforms/redhat/bacula-fd \
3216 platforms/redhat/bacula-sd \
3217 platforms/redhat/bacula-dir
3221 DISTVER=`cat /etc/mandrake-release | grep release |\
3223 TAPEDRIVE="/dev/nst0"
3224 PSCMD="ps -e -o pid,command"
3226 platforms/mandrake/Makefile \
3227 platforms/mandrake/bacula-fd \
3228 platforms/mandrake/bacula-sd \
3229 platforms/mandrake/bacula-dir \
3233 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
3234 TAPEDRIVE="/dev/nst0"
3235 PSCMD="ps -e -o pid,command"
3237 platforms/gentoo/Makefile \
3238 platforms/gentoo/bacula-init \
3239 platforms/gentoo/bacula-fd \
3240 platforms/gentoo/bacula-sd \
3241 platforms/gentoo/bacula-dir"
3244 DISTVER=`cat /etc/slackware-version`
3245 TAPEDRIVE="/dev/nst0"
3246 PSCMD="ps -e -o pid,command"
3248 platforms/slackware/Makefile \
3249 platforms/slackware/rc.bacula-fd \
3250 platforms/slackware/rc.bacula-sd \
3251 platforms/slackware/rc.bacula-dir\
3252 platforms/slackware/functions.bacula"
3256 TAPEDRIVE="/dev/rmt/0cbn"
3257 PSCMD="ps -e -o pid,comm"
3259 platforms/solaris/Makefile \
3260 platforms/solaris/bacula-fd \
3261 platforms/solaris/bacula-sd \
3262 platforms/solaris/bacula-dir"
3266 AC_DEFINE(HAVE_OLD_SOCKOPT)
3267 AC_DEFINE(USE_THR_SETCONCURRENCY)
3270 AC_DEFINE(USE_THR_SETCONCURRENCY)
3275 LIBS="$LIBS -lresolv -lrt"
3278 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
3280 TAPEDRIVE="/dev/nst0"
3281 PSCMD="ps -e -o pid,command"
3283 platforms/suse/Makefile \
3284 platforms/suse/bacula-fd \
3285 platforms/suse/bacula-sd \
3286 platforms/suse/bacula-dir \
3287 platforms/suse/bacula"
3292 TAPEDRIVE="/dev/nst0"
3293 PSCMD="ps -e -o pid,command"
3295 platforms/suse/Makefile \
3296 platforms/suse/bacula-fd \
3297 platforms/suse/bacula-sd \
3298 platforms/suse/bacula-dir"
3302 TAPEDRIVE="/dev/nst0"
3305 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
3309 dnl -------------------------------------------
3310 dnl systemd (default off)
3311 dnl -------------------------------------------
3312 AC_MSG_CHECKING(for systemd support)
3313 AC_ARG_WITH(systemd,
3314 AC_HELP_STRING([--with-systemd@<:@=UNITDIR@:>@], [Include systemd support. UNITDIR is where systemd system .service files are located, default is to ask systemctl.]),
3316 if test "$withval" != "no"; then
3317 if test "$withval" = "yes"; then
3318 SYSTEMD_UNITDIR="`systemctl show | grep UnitPath | cut -d " " -f2`"
3320 SYSTEMD_UNITDIR="${withval}"
3324 platforms/systemd/Makefile \
3325 platforms/systemd/bacula-dir.service \
3326 platforms/systemd/bacula-fd.service \
3327 platforms/systemd/bacula-sd.service"
3328 AC_DEFINE(HAVE_SYSTEMD, 1, [Define to 1 if systemd support should be enabled])
3330 support_systemd="yes"
3333 support_systemd="no"
3336 support_systemd="no"
3340 AC_SUBST(SYSTEMD_UNITDIR)
3344 LIBS="$PTHREAD_LIB $LIBS"
3346 AC_DEFINE_UNQUOTED(lld, "$lld")
3347 AC_DEFINE_UNQUOTED(llu, "$llu")
3354 AC_SUBST(COMPRESS_MANPAGES)
3356 dnl common parts of the Makefile
3357 MCOMMON=./autoconf/Make.common
3358 AC_SUBST_FILE(MCOMMON)
3361 if test "x${subsysdir}" = "x${sbindir}" ; then
3364 echo "You have set both --sbindir and --with-subsys-dir"
3365 echo " equal to: ${subsysdir} "
3366 echo "This is not permitted. Please reconfigure."
3368 echo "Aborting configuration ..."
3375 AC_OUTPUT([autoconf/Make.common \
3378 scripts/btraceback \
3381 scripts/bacula-ctl-dir \
3382 scripts/bacula-ctl-fd \
3383 scripts/bacula-ctl-sd \
3384 scripts/devel_bacula \
3387 scripts/mtx-changer \
3388 scripts/disk-changer \
3389 scripts/dvd-handler \
3390 scripts/dvd-simulator \
3391 scripts/logwatch/Makefile \
3392 scripts/logwatch/logfile.bacula.conf \
3393 scripts/bat.desktop \
3394 scripts/bat.desktop.xsu \
3395 scripts/bat.desktop.consolehelper \
3396 scripts/bat.console_apps \
3399 src/console/Makefile \
3400 src/console/bconsole.conf \
3401 src/qt-console/bat.conf \
3402 src/qt-console/bat.pro \
3403 src/qt-console/bat.pro.mingw32 \
3404 src/qt-console/bat.pro.mingw64 \
3405 src/qt-console/install_conf_file \
3406 src/qt-console/tray-monitor/tray-monitor.conf \
3407 src/qt-console/tray-monitor/tray-monitor.pro \
3408 src/qt-console/tray-monitor/tray-monitor.pro.mingw32 \
3409 src/qt-console/tray-monitor/tray-monitor.pro.mingw64 \
3411 src/dird/bacula-dir.conf \
3413 src/stored/Makefile \
3414 src/stored/bacula-sd.conf \
3415 src/filed/Makefile \
3416 src/filed/bacula-fd.conf \
3418 src/cats/make_catalog_backup.pl \
3419 src/cats/make_catalog_backup \
3420 src/cats/delete_catalog_backup \
3421 src/cats/create_postgresql_database \
3422 src/cats/update_postgresql_tables \
3423 src/cats/make_postgresql_tables \
3424 src/cats/grant_postgresql_privileges \
3425 src/cats/drop_postgresql_tables \
3426 src/cats/drop_postgresql_database \
3427 src/cats/create_mysql_database \
3428 src/cats/update_mysql_tables \
3429 src/cats/make_mysql_tables \
3430 src/cats/grant_mysql_privileges \
3431 src/cats/drop_mysql_tables \
3432 src/cats/drop_mysql_database \
3433 src/cats/create_sqlite3_database \
3434 src/cats/update_sqlite3_tables \
3435 src/cats/make_sqlite3_tables \
3436 src/cats/grant_sqlite3_privileges \
3437 src/cats/drop_sqlite3_tables \
3438 src/cats/drop_sqlite3_database \
3441 src/cats/create_bacula_database \
3442 src/cats/update_bacula_tables \
3443 src/cats/grant_bacula_privileges \
3444 src/cats/make_bacula_tables \
3445 src/cats/drop_bacula_tables \
3446 src/cats/drop_bacula_database \
3447 src/cats/install-default-backend \
3448 src/findlib/Makefile \
3449 src/tools/Makefile \
3450 src/plugins/fd/Makefile \
3451 src/plugins/sd/Makefile \
3452 src/plugins/dir/Makefile \
3454 updatedb/update_mysql_tables \
3455 updatedb/update_sqlite3_tables \
3456 updatedb/update_postgresql_tables \
3457 updatedb/update_mysql_tables_9_to_10 \
3458 updatedb/update_sqlite3_tables_9_to_10 \
3459 updatedb/update_postgresql_tables_9_to_10 \
3460 updatedb/update_mysql_tables_10_to_11 \
3461 updatedb/update_sqlite3_tables_10_to_11 \
3462 updatedb/update_postgresql_tables_10_to_11 \
3463 updatedb/update_mysql_tables_11_to_12 \
3464 updatedb/update_sqlite3_tables_11_to_12 \
3465 updatedb/update_postgresql_tables_11_to_12 \
3466 examples/nagios/check_bacula/Makefile \
3467 platforms/rpms/redhat/bacula.spec \
3468 platforms/rpms/redhat/bacula-bat.spec \
3469 platforms/rpms/redhat/bacula-docs.spec \
3470 platforms/rpms/redhat/bacula-mtx.spec \
3471 platforms/rpms/suse/bacula.spec \
3472 platforms/rpms/suse/bacula-bat.spec \
3473 platforms/rpms/suse/bacula-docs.spec \
3474 platforms/rpms/suse/bacula-mtx.spec \
3479 if test "${support_bat}" = "yes" ; then
3480 if test "x$QMAKE" = "xnone"; then
3481 AC_MSG_ERROR([Could not find qmake $PATH. Check your Qt installation])
3485 echo "Creating bat Makefile"
3496 dnl if CC is gcc, we can rebuild the dependencies (since the depend rule
3497 dnl requires gcc). If it's not, don't rebuild dependencies
3499 if test X"$GCC" = "Xyes" ; then
3500 echo "Doing make of dependencies"
3501 ${MAKE:-make} depend
3505 chmod 755 install_conf_file build-depkgs-qt-console
3509 chmod 755 bacula btraceback mtx-changer
3510 chmod 755 dvd-handler dvd-simulator
3511 chmod 755 bconsole disk-changer devel_bacula logrotate
3515 chmod 755 $c/update_mysql_tables_10_to_11 $c/update_sqlite3_tables_10_to_11
3516 chmod 755 $c/update_postgresql_tables_10_to_11
3517 chmod 755 $c/update_mysql_tables_11_to_12 $c/update_sqlite3_tables_11_to_12
3518 chmod 755 $c/update_postgresql_tables_11_to_12
3523 chmod 755 $c/create_bacula_database $c/update_bacula_tables $c/make_bacula_tables
3524 chmod 755 $c/grant_bacula_privileges $c/drop_bacula_tables $c/drop_bacula_database
3526 chmod 755 $c/create_mysql_database $c/update_mysql_tables $c/make_mysql_tables
3527 chmod 755 $c/grant_mysql_privileges $c/drop_mysql_tables $c/drop_mysql_database
3529 chmod 755 $c/create_sqlite3_database $c/update_sqlite3_tables $c/make_sqlite3_tables
3530 chmod 755 $c/grant_sqlite3_privileges $c/drop_sqlite3_tables $c/drop_sqlite3_database
3532 chmod 755 $c/create_postgresql_database $c/update_postgresql_tables $c/make_postgresql_tables
3533 chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables $c/drop_postgresql_database
3535 chmod 755 $c/make_catalog_backup $c/delete_catalog_backup $c/make_catalog_backup.pl
3539 chmod 755 $c/install-default-backend
3541 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
3542 largefile_support="yes"
3545 dnl Only try to find out the version number of the compiler when we know its some kind of GCC compiler
3546 if test X"$GCC" = "Xyes" ; then
3548 dnl A whole lot of hand springs to get the compiler version.
3549 dnl This is because gcc changed the output in version 3.0
3551 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3552 if test "x${CCVERSION}" = "x" ; then
3553 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3555 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3556 if test x"${CXXVERSION}" = x ; then
3557 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3561 # clean up any old junk
3568 Configuration on `date`:
3570 Host: ${host}${post_host} -- ${DISTNAME} ${DISTVER}
3571 Bacula version: ${BACULA} ${VERSION} (${DATE})
3572 Source code location: ${srcdir}
3573 Install binaries: ${sbindir}
3574 Install libraries: ${libdir}
3575 Install config files: ${sysconfdir}
3576 Scripts directory: ${scriptdir}
3577 Archive directory: ${archivedir}
3578 Working directory: ${working_dir}
3579 PID directory: ${piddir}
3580 Subsys directory: ${subsysdir}
3581 Man directory: ${mandir}
3582 Data directory: ${datarootdir}
3583 Plugin directory: ${plugindir}
3584 C Compiler: ${CC} ${CCVERSION}
3585 C++ Compiler: ${CXX} ${CXXVERSION}
3586 Compiler flags: ${WCFLAGS} ${CFLAGS}
3587 Linker flags: ${WLDFLAGS} ${LDFLAGS}
3589 Statically Linked Tools: ${support_static_tools}
3590 Statically Linked FD: ${support_static_fd}
3591 Statically Linked SD: ${support_static_sd}
3592 Statically Linked DIR: ${support_static_dir}
3593 Statically Linked CONS: ${support_static_cons}
3594 Database backends: ${db_backends}
3595 Database port: ${db_port}
3596 Database name: ${db_name}
3597 Database user: ${db_user}
3598 Database SSL options: ${db_ssl_options}
3600 Job Output Email: ${job_email}
3601 Traceback Email: ${dump_email}
3602 SMTP Host Address: ${smtp_host}
3604 Director Port: ${dir_port}
3605 File daemon Port: ${fd_port}
3606 Storage daemon Port: ${sd_port}
3608 Director User: ${dir_user}
3609 Director Group: ${dir_group}
3610 Storage Daemon User: ${sd_user}
3611 Storage DaemonGroup: ${sd_group}
3612 File Daemon User: ${fd_user}
3613 File Daemon Group: ${fd_group}
3615 Large file support: $largefile_support
3616 Bacula conio support: ${got_conio} ${CONS_LIBS}
3617 readline support: ${got_readline} ${PRTREADLINE_SRC}
3618 TCP Wrappers support: ${TCPW_MSG} ${WRAPLIBS}
3619 TLS support: ${support_tls}
3620 Encryption support: ${support_crypto}
3621 ZLIB support: ${have_zlib}
3622 LZO support: ${have_lzo}
3623 enable-smartalloc: ${support_smartalloc}
3624 enable-lockmgr: ${support_lockmgr}
3625 bat support: ${support_bat}
3626 client-only: ${build_client_only}
3627 build-dird: ${build_dird}
3628 build-stored: ${build_stored}
3629 Plugin support: ${have_plugins}
3630 AFS support: ${have_afs}
3631 ACL support: ${have_acl}
3632 XATTR support: ${have_xattr}
3633 systemd support: ${support_systemd} ${SYSTEMD_UNITDIR}
3634 Batch insert enabled: ${batch_insert_db_backends}
3638 # create a small shell script useful for support with
3639 # configure options and config.out info
3640 cat > scripts/bacula_config << EOF
3643 $ $0 $ac_configure_args
3645 cat config.out >> scripts/bacula_config
3646 echo __EOC__ >> scripts/bacula_config
3647 chmod 755 scripts/bacula_config