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 minimal Win32 stuff for "make clean"
23 WIN32BUILDDIR=${BUILD_DIR}/src/win32
24 WIN32MAINDIR=${BUILD_DIR}
25 WIN32TOPDIR=${TOP_DIR}
26 AC_SUBST(WIN32BUILDDIR)
27 AC_SUBST(WIN32MAINDIR)
30 dnl search for true and false programs.
31 AC_PATH_PROGS(TRUEPRG, true, :)
32 AC_PATH_PROGS(FALSEPRG, false, :)
37 if test "x$BACULA" != x; then
38 post_host=`echo -${BACULA} | tr 'A-Z ' 'a-z-'`
40 BACULA=${BACULA:-Bacula}
41 VERSION=`sed -n -e 's/^#define VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
42 RELEASE=`sed -n -e 's/^#define RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
43 DATE=`sed -n -e 's/^#define BDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
44 LSMDATE=`sed -n -e 's/^#define LSMDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
45 BDB_VERSION=`sed -n -e 's/^#define BDB_VERSION \(.*\)$/\1/p' ${srcdir}/src/cats/cats.h`
46 DEPKGS_VERSION=`sed -n -e 's/^#define DEPKGS_VERSION \(.*\)$/\1/p' ${srcdir}/src/cats/cats.h`
47 DEPKGS_QT_VERSION=`sed -n -e 's/^#define DEPKGS_QT_VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
48 BQT_VERSION=`sed -n -e 's/^#define BQT_VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
49 VIX_VERSION=`sed -n -e 's/^#define VIX_VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
50 JAVA_VERSION=`sed -n -e 's/^#define JAVA_VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
51 NDMP_VERSION=`sed -n -e 's/^#define NDMP_VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
52 LIBRSYNC_VERSION=`sed -n -e 's/^#define LIBRSYNC_VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
57 AC_SUBST(post_host)dnl
58 AC_SUBST(BDB_VERSION)dnl
59 AC_SUBST(DEPKGS_QT_VERSION)dnl
60 AC_SUBST(DEPKGS_VERSION)dnl
61 AC_SUBST(VIX_VERSION)dnl
62 AC_SUBST(JAVA_VERSION)dnl
63 AC_SUBST(NDMP_VERSION)dnl
64 AC_SUBST(LIBRSYNC_VERSION)dnl
68 dnl can be overwritten by specific values from version.h
69 LIBBAC_LT_RELEASE=`sed -n -e 's/^#.*LIBBAC_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
70 LIBBACCFG_LT_RELEASE=`sed -n -e 's/^#.*LIBBACCFG_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
71 LIBBACPY_LT_RELEASE=`sed -n -e 's/^#.*LIBBACPY_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
73 LIBBAC_LT_RELEASE=${LIBBAC_LT_RELEASE:-$VERSION}
74 LIBBACCFG_LT_RELEASE=${LIBBACCFG_LT_RELEASE:-$VERSION}
76 AC_SUBST(LIBBAC_LT_RELEASE)dnl
77 AC_SUBST(LIBBACCFG_LT_RELEASE)dnl
80 dnl can be overwritten by specific values from version.h
81 LIBBACSQL_LT_RELEASE=`sed -n -e 's/^#.*LIBBACSQL_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
82 LIBBACCATS_LT_RELEASE=`sed -n -e 's/^#.*LIBBACCATS_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
84 LIBBACSQL_LT_RELEASE=${LIBBACSQL_LT_RELEASE:-$VERSION}
85 LIBBACCATS_LT_RELEASE=${LIBBACCATS_LT_RELEASE:-$VERSION}
87 AC_SUBST(LIBBACSQL_LT_RELEASE)dnl
88 AC_SUBST(LIBBACCATS_LT_RELEASE)dnl
91 dnl can be overwritten by specific values from version.h
92 LIBBACFIND_LT_RELEASE=`sed -n -e 's/^#.*LIBBACFIND_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
94 LIBBACFIND_LT_RELEASE=${LIBBACFIND_LT_RELEASE:-$VERSION}
96 AC_SUBST(LIBBACFIND_LT_RELEASE)dnl
98 dnl PFILES are platform or plugin specific files
99 PFILES="platforms/Makefile"
101 echo "configuring for ${BACULA} $VERSION ($DATE)"
104 dnl -------------------------------------------------------
105 dnl Check for compiler.
106 dnl ------------------------------------------------------
108 AC_PROG_CC dnl this sets $GCC if using GNU C compiler
110 AC_PROG_CC_C_O dnl Determine if C compiler support -c -o.
111 AC_PROG_GCC_TRADITIONAL dnl Determine if ioctl() need -traditional.
113 BASECC=`basename $CC`
115 if test x"$GCC" = "xyes"; then
119 AC_PATH_PROG(CXX, $CXX, $CXX)
120 if test ! -e $CXX; then
121 AC_MSG_ERROR(Unable to find C++ compiler)
124 dnl -------------------------------------------------------
125 dnl Check for programs.
126 dnl ------------------------------------------------------
128 AC_PATH_PROG(MV, mv, mv)
130 dnl If we name the variable RM it will shadow the RM variable in the configure script and we overwrite the
131 dnl value with the name of the rm command and not rm -f which is its normal content. This gives all kind
132 dnl of strange output of the configure script (like things don't exist etc.).
133 dnl So we name it REMOVE (more software has run into this problem)
134 AC_PATH_PROG(REMOVE, rm, rm)
135 AC_PATH_PROG(CP, cp, cp)
136 AC_PATH_PROG(SED, sed, sed)
137 AC_PATH_PROG(ECHO, echo, echo)
138 AC_PATH_PROG(CMP, cmp, cmp)
139 AC_PATH_PROG(TBL, tbl, tbl)
140 AC_PATH_PROG(AR, ar, ar)
141 AC_PATH_PROG(OPENSSL, openssl, none)
142 AC_PATH_PROG(MTX, mtx, mtx)
143 AC_PATH_PROG(DD, dd, dd)
144 AC_PATH_PROG(MKISOFS, mkisofs, mkisofs)
145 AC_PATH_PROG(PYTHON, python, python)
146 AC_PATH_PROG(GROWISOFS, growisofs, growisofs)
147 AC_PATH_PROG(DVDRWMEDIAINFO, dvd+rw-mediainfo, dvd+rw-mediainfo)
148 AC_PATH_PROG(DVDRWFORMAT, dvd+rw-format, dvd+rw-format)
149 AC_PATH_PROG(PKGCONFIG, pkg-config, pkg-config)
150 AC_PATH_PROG(QMAKE, qmake, none)
151 AC_PATH_PROG(GMAKE, gmake, none)
152 AC_PATH_PROG(PIDOF, pidof, pidof)
154 # Some AWK programs fail, so test it and warn the user
155 if echo xfoo | $AWK 'BEGIN { prog=ARGV[1]; ARGC=1 }
156 { if ((prog == $2) || (("(" prog ")") == $2) ||
157 (("[" prog "]") == $2) ||
158 ((prog ":") == $2)) { print $1 ; exit 0 } }' xfoo>/dev/null; then :;
160 AC_MSG_ERROR([!!!!!!!!! WARNING !!!!!!!!!!!!!!
161 The regex engine of $AWK is too broken to be used you
162 might want to install GNU AWK.
163 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!])
166 AC_PATH_PROG(AWK, $THE_AWK, $THE_AWK)
169 test -n "$ARFLAG" || ARFLAGS="cr"
176 AC_SUBST(LOCAL_CFLAGS)
177 AC_SUBST(LOCAL_LDFLAGS)
180 dnl --------------------------------------------------
182 dnl --------------------------------------------------
184 AC_ARG_ENABLE(libtool,
185 AC_HELP_STRING([--enable-libtool], [enable building using GNU libtool @<:@default=yes@:>@]),
187 if test x$enableval = xno; then
192 LT_INIT([shared disable-static])
196 if test x$use_libtool != xno; then
197 DEFAULT_OBJECT_TYPE=".lo"
198 DEFAULT_ARCHIVE_TYPE=".la"
199 DEFAULT_SHARED_OBJECT_TYPE=".la"
200 LIBTOOL="\$(LIBTOOL)"
201 LIBTOOL_INSTALL_TARGET="libtool-install"
202 LIBTOOL_UNINSTALL_TARGET="libtool-uninstall"
203 LIBTOOL_CLEAN_TARGET="libtool-clean"
204 QMAKE_LIBTOOL="${BUILD_DIR}/libtool"
205 FD_PLUGIN_DIR="src/plugins/fd"
208 DEFAULT_OBJECT_TYPE=".o"
209 DEFAULT_ARCHIVE_TYPE=".a"
210 DEFAULT_SHARED_OBJECT_TYPE=".so"
211 LIBTOOL="# \$(LIBTOOL)"
212 LIBTOOL_INSTALL_TARGET=""
213 LIBTOOL_UNINSTALL_TARGET=""
214 LIBTOOL_CLEAN_TARGET=""
215 QMAKE_LIBTOOL="# ${BUILD_DIR}/libtool"
220 AC_SUBST(DEFAULT_OBJECT_TYPE)
221 AC_SUBST(DEFAULT_ARCHIVE_TYPE)
222 AC_SUBST(DEFAULT_SHARED_OBJECT_TYPE)
224 AC_SUBST(LIBTOOL_INSTALL_TARGET)
225 AC_SUBST(LIBTOOL_UNINSTALL_TARGET)
226 AC_SUBST(LIBTOOL_CLEAN_TARGET)
227 AC_SUBST(QMAKE_LIBTOOL)
228 AC_SUBST(FD_PLUGIN_DIR)
230 dnl --------------------------------------------------
231 dnl Include file handling
232 dnl --------------------------------------------------
233 AC_ARG_ENABLE(includes,
234 AC_HELP_STRING([--enable-includes], [enable installing of include files @<:@default=no@:>@]),
236 if test x$enableval = xyes; then
242 dnl It only makes sense to install include files when you install libraries which only happens when
243 dnl libtool is enabled
245 if test x$use_libtool != xno -a x$install_includes = xyes; then
246 INCLUDE_INSTALL_TARGET="install-includes"
247 INCLUDE_UNINSTALL_TARGET="uninstall-includes"
249 INCLUDE_INSTALL_TARGET=""
250 INCLUDE_UNINSTALL_TARGET=""
252 AC_SUBST(INCLUDE_INSTALL_TARGET)
253 AC_SUBST(INCLUDE_UNINSTALL_TARGET)
255 dnl --------------------------------------------------
256 dnl Bacula OP Sys determination (see aclocal.m4)
257 dnl --------------------------------------------------
260 dnl -----------------------------------------------------------
261 dnl Bacula OPSys Distribution determination (see aclocal.m4)
262 dnl ----------------------------------------------------------
263 BA_CHECK_OPSYS_DISTNAME
265 dnl --------------------------------------------------
266 dnl Suppport for gettext (translations)
267 dnl By default, $datarootdir is ${prefix}/share
268 dnl --------------------------------------------------
269 AM_GNU_GETTEXT([external])
271 dnl ------------------------------------------------------------------
272 dnl If the user has not set --prefix, we set our default to nothing.
273 dnl In this case, if the user has not set --sysconfdir, we set it
274 dnl to the package default of /etc/bacula. If either --prefix or
275 dnl --sysconfdir is set, we leave sysconfdir alone except to eval it.
276 dnl If the user has not set --libdir, we set it to the package
277 dnl default of /usr/lib. If either --prefix or --libdir is set,
278 dnl we leave libdir alone except to eval it. If the user has not set
279 dnl --includedir, we set it to the package default of /usr/include.
280 dnl If either --prefix or --includedir is set, we leave includedir
281 dnl alone except to eval it
282 dnl ------------------------------------------------------------------
283 os_name=`uname -s 2>/dev/null`
284 if test x${prefix} = xNONE ; then
285 if test `eval echo ${sysconfdir}` = NONE/etc ; then
286 sysconfdir=/etc/bacula
289 if test `eval echo ${libdir}` = NONE/lib ; then
292 os_processor=`uname -p 2>/dev/null`
293 case ${os_processor} in
308 if test `eval echo ${includedir}` = NONE/include ; then
309 includedir=/usr/include
312 if test `eval echo ${datarootdir}` = NONE/share ; then
313 datarootdir=/usr/share
318 dnl -------------------------------------------------------------------------
319 dnl If the user has not set --exec-prefix, we default to ${prefix}
320 dnl -------------------------------------------------------------------------
321 if test x${exec_prefix} = xNONE ; then
322 exec_prefix=${prefix}
325 sysconfdir=`eval echo ${sysconfdir}`
326 datarootdir=`eval echo ${datarootdir}`
327 docdir=`eval echo ${docdir}`
328 htmldir=`eval echo ${htmldir}`
329 libdir=`eval echo ${libdir}`
330 includedir=`eval echo ${includedir}`
331 localedir=`eval echo ${datarootdir}/locale`
332 AC_DEFINE_UNQUOTED(SYSCONFDIR, "$sysconfdir")
333 AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir")
335 dnl ------------------------------------------------------------------
336 dnl If the user has not set --sbindir, we set our default as /sbin
337 dnl ------------------------------------------------------------------
338 if test x$sbindir = x'${exec_prefix}/sbin' ; then
339 sbindir=${exec_prefix}/sbin
341 sbindir=`eval echo ${sbindir}`
343 dnl -------------------------------------------------------------------------
344 dnl If the user has not set --mandir, we default to /usr/share/man
345 dnl -------------------------------------------------------------------------
346 if test x$mandir = x'${prefix}/man' ; then
347 mandir=/usr/share/man
350 dnl -------------------------------------------------------------------------
351 dnl If the user has not set --htmldir, we default to /usr/share/doc/bacula/html
352 dnl -------------------------------------------------------------------------
353 if test x$htmldir = x'/usr/share/doc/bacula/' ; then
354 htmldir=`eval echo ${docdir}html`
357 dnl -------------------------------------------------------------------------
358 dnl If the user has not set --docdir, we default to /usr/share/doc/bacula
359 dnl -------------------------------------------------------------------------
360 if test x$docdir = x'/usr/share/doc/' ; then
361 docdir=`eval echo ${docdir}bacula`
365 AC_PATH_PROGS(MSGFMT, msgfmt, no)
366 if test "$MSGFMT" = "no"
368 echo 'msgfmt program not found, disabling NLS !'
370 USE_INCLUDED_LIBINTL=no
375 support_smartalloc=yes
382 support_static_tools=no
385 support_static_dir=no
386 support_static_cons=no
391 batch_insert_db_backends=""
394 dnl --------------------------------------------------------------------------
395 dnl CHECKING COMMAND LINE OPTIONS
396 dnl --------------------------------------------------------------------------
398 dnl -------------------------------------------
399 dnl bat (default off)
400 dnl -------------------------------------------
402 AC_HELP_STRING([--enable-bat], [enable build of bat Qt GUI @<:@default=no@:>@]),
404 if test x$enableval = xyes; then
405 AC_DEFINE(HAVE_BAT, 1, [Set if Bacula bat Qt GUI support enabled])
412 if test x$support_bat = xyes; then
414 abc=`$PKGCONFIG QtGui`
416 if test $pkg = 0; then
417 BAT_DIR=src/qt-console
420 abc=`$PKGCONFIG Qt5Gui`
422 if test $pkg = 0; then
423 BAT_DIR=src/qt-console
425 AC_MSG_ERROR(Unable to find either Qt4 or Qt5 installation needed by bat)
432 AC_SUBST(QWT_LDFLAGS)
436 dnl -------------------------------------------
437 dnl smartalloc (default off)
438 dnl -------------------------------------------
439 AC_ARG_ENABLE(smartalloc,
440 AC_HELP_STRING([--enable-smartalloc], [enable smartalloc debugging support @<:@default=no@:>@]),
442 if test x$enableval = xno; then
443 support_smartalloc=no
448 if test x$support_smartalloc = xyes; then
449 AC_DEFINE(SMARTALLOC, 1, [Set if you want Smartalloc enabled])
452 dnl -------------------------------------------
453 dnl Lock Manager (default off)
454 dnl -------------------------------------------
455 AC_ARG_ENABLE(lockmgr,
456 AC_HELP_STRING([--enable-lockmgr], [enable lock manager support @<:@default=no@:>@]),
458 if test x$enableval = xyes; then
464 if test x$support_lockmgr = xyes; then
465 AC_DEFINE(USE_LOCKMGR, 1, [Set if you want Lock Manager enabled])
469 dnl -------------------------------------------
470 dnl static-tools (default off)
471 dnl -------------------------------------------
472 AC_ARG_ENABLE(static-tools,
473 AC_HELP_STRING([--enable-static-tools], [enable static tape tools @<:@default=no@:>@]),
475 if test x$enableval = xyes; then
476 if test x$use_libtool = xyes; then
477 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
478 please rerun configure with --disable-libtool])
480 support_static_tools=yes
486 if test x$support_static_tools = xyes; then
487 TTOOL_LDFLAGS="-static"
489 AC_SUBST(TTOOL_LDFLAGS)
491 dnl -------------------------------------------
492 dnl static-fd (default off)
493 dnl -------------------------------------------
494 AC_ARG_ENABLE(static-fd,
495 AC_HELP_STRING([--enable-static-fd], [enable static File daemon @<:@default=no@:>@]),
497 if test x$enableval = xyes; then
498 if test x$use_libtool = xyes; then
499 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
500 please rerun configure with --disable-libtool])
502 support_static_fd=yes
508 if test x$support_static_fd = xyes; then
509 STATIC_FD="static-bacula-fd"
513 dnl -------------------------------------------
514 dnl static-sd (default off)
515 dnl -------------------------------------------
516 AC_ARG_ENABLE(static-sd,
517 AC_HELP_STRING([--enable-static-sd], [enable static Storage daemon @<:@default=no@:>@]),
519 if test x$enableval = xyes; then
520 if test x$use_libtool = xyes; then
521 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
522 please rerun configure with --disable-libtool])
524 support_static_sd=yes
530 if test x$support_static_sd = xyes; then
531 STATIC_SD="static-bacula-sd"
535 dnl -------------------------------------------
536 dnl static-dir (default off)
537 dnl -------------------------------------------
538 AC_ARG_ENABLE(static-dir,
539 AC_HELP_STRING([--enable-static-dir], [enable static Director @<:@default=no@:>@]),
541 if test x$enableval = xyes; then
542 if test x$use_libtool = xyes; then
543 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
544 please rerun configure with --disable-libtool])
546 support_static_dir=yes
552 if test x$support_static_dir = xyes; then
553 STATIC_DIR="static-bacula-dir"
557 dnl -------------------------------------------
558 dnl static-cons (default off)
559 dnl -------------------------------------------
560 AC_ARG_ENABLE(static-cons,
561 AC_HELP_STRING([--enable-static-cons], [enable static Console @<:@default=no@:>@]),
563 if test x$enableval = xyes; then
564 if test x$use_libtool = xyes; then
565 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
566 please rerun configure with --disable-libtool])
568 support_static_cons=yes
574 if test x$support_static_cons = xyes; then
575 STATIC_CONS="static-bconsole"
577 AC_SUBST(STATIC_CONS)
579 dnl -------------------------------------------
580 dnl client_only (default off)
581 dnl -------------------------------------------
582 AC_ARG_ENABLE(client-only,
583 AC_HELP_STRING([--enable-client-only], [build client (File daemon) only @<:@default=no@:>@]),
585 if test x$enableval = xyes; then
586 build_client_only=yes
592 if test x$build_client_only = xno; then
599 dnl -------------------------------------------
600 dnl director (default on)
601 dnl -------------------------------------------
602 AC_ARG_ENABLE(build-dird,
603 AC_HELP_STRING([--enable-build-dird], [enable building of dird (Director) @<:@default=yes@:>@]),
605 if test x$enableval = xno; then
617 dnl -------------------------------------------
618 dnl stored (default on)
619 dnl -------------------------------------------
620 AC_ARG_ENABLE(build-stored,
621 AC_HELP_STRING([--enable-build-stored], [enable building of stored (Storage daemon) @<:@default=yes@:>@]),
623 if test x$enableval = xno; then
628 if test x$build_stored = xyes; then
629 STORED_DIR="src/stored"
635 dnl ---------------------------------------------------
636 dnl Check for conio (Bacula readline substitute)(
637 dnl ---------------------------------------------------
638 dnl this allows you to turn it completely off
640 AC_HELP_STRING([--disable-conio], [disable conio support @<:@default=no@:>@]),
642 if test x$enableval = xno; then
649 dnl ---------------------------------------------------
650 dnl Check for IPv6 support
651 dnl ---------------------------------------------------
652 dnl this allows you to turn it completely off
655 AC_HELP_STRING([--enable-ipv6], [enable ipv6 support @<:@default=yes@:>@]),
657 if test x$enableval = xno; then
663 if test x$support_ipv6 = xyes; then
664 AC_TRY_LINK([ #include <sys/types.h>
665 #include <sys/socket.h>
666 #include <netinet/in.h>], [struct in6_addr t=in6addr_any; t.s6_addr[0] = 0;],
667 [support_in6addr_any=yes], [support_in6addr_any=no])
669 if test x$support_in6addr_any = xno ; then
670 in6addr_any="const struct in6_addr in6addr_any"
675 AC_TRY_LINK([ #include <sys/types.h>
676 #include <sys/socket.h>
677 #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;],
678 [support_ipv6=yes], [support_ipv6=no])
681 if test x$support_ipv6 = xyes; then
682 AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
684 if test x$support_in6addr_any = xno ; then
685 AC_DEFINE(NEED_IN6ADDR_ANY,1,[Whether to have in6addr_any support])
690 AC_CHECK_HEADER(curses.h, [
691 AC_CHECK_LIB(tinfo, tgetent, [ TERM_LIB="-ltinfo" ], [
692 AC_CHECK_LIB(ncurses, tgetent, [ TERM_LIB="-lncurses" ], [
693 AC_CHECK_LIB(termcap, tgetent, [ TERM_LIB="-ltermcap" ])
697 [ AC_CHECK_HEADERS(curses.h)
698 AC_CHECK_HEADER(term.h,
699 [ AC_CHECK_LIB(curses, tgetent,
700 [ TERM_LIB="-lcurses" ] )
706 if test x$support_conio = xyes; then
707 if test x$TERM_LIB != x; then
713 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
715 echo " "; echo "Required libraries not found. CONIO turned off ..."; echo " "
720 dnl ---------------------------------------------------
721 dnl Check for readline support/directory (default off)
722 dnl ---------------------------------------------------
723 dnl this allows you to turn it completely off
724 AC_ARG_ENABLE(readline,
725 AC_HELP_STRING([--disable-readline], [disable readline support @<:@default=yes@:>@]),
727 if test x$enableval = xno; then
735 if test x$support_readline = xyes; then
736 AC_ARG_WITH(readline,
737 AC_HELP_STRING([--with-readline@<:@=DIR@:>@], [specify readline library directory]),
739 case "$with_readline" in
744 if test -f ${with_readline}/readline.h; then
745 CONS_INC="-I${with_readline}"
746 CONS_LDFLAGS="-L$with_readline"
747 elif test -f ${with_readline}/include/readline/readline.h; then
748 CONS_INC="-I${with_readline}/include/readline"
749 CONS_LDFLAGS="-L${with_readline}/lib"
750 with_readline="${with_readline}/include/readline"
752 with_readline="/usr/include/readline"
755 AC_CHECK_HEADER(${with_readline}/readline.h,
757 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
758 CONS_LIBS="-lreadline -lhistory ${TERM_LIB}"
762 echo "readline.h not found. readline turned off ..."
769 dnl check for standard readline library
770 AC_CHECK_HEADER(/usr/include/readline/readline.h,
772 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
774 CONS_INC="-I/usr/include/readline"
775 CONS_LIBS="-lreadline ${TERM_LIB}"
777 dnl Did not find standard library, so try Bacula's default
778 AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h,
780 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
782 CONS_INC="-I${TOP_DIR}/depkgs/readline"
783 CONS_LIBS="-lreadline -lhistory ${TERM_LIB}"
784 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
785 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
788 echo "readline.h not found. readline turned off ..."
802 AC_SUBST(CONS_LDFLAGS)
803 AC_SUBST(READLINE_SRC)
805 dnl Minimal stuff for readline Makefile configuration
810 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr)
811 AC_CHECK_FUNCS(lstat lchown lchmod futimes fchmod fchown lutimes)
812 AC_CHECK_FUNCS(nanosleep nl_langinfo)
813 AC_CHECK_FUNCS(be64toh htobe64)
814 AC_CHECK_HEADERS(varargs.h)
816 dnl End of readline/conio stuff
817 dnl -----------------------------------------------------------------------
820 dnl Find where sockets are (especially for Solaris)
821 dnl Do this before the TCP Wrappers test since tcp wrappers
822 dnl uses the socket library and some linkers are stupid.
824 AC_CHECK_FUNC(socket,
825 AC_MSG_RESULT(using libc's socket),
826 AC_CHECK_LIB(xnet,socket)
827 AC_CHECK_LIB(socket,socket)
828 AC_CHECK_LIB(inet,socket))
830 dnl -----------------------------------------------------------
831 dnl Check whether user wants TCP wrappers support (default off)
832 dnl -----------------------------------------------------------
835 AC_ARG_WITH(tcp-wrappers,
836 AC_HELP_STRING([--with-tcp-wrappers@<:@=DIR@:>@], [enable tcpwrappers support]),
838 if test "x$withval" != "xno" ; then
840 LIBS="$saved_LIBS -lwrap"
841 AC_SEARCH_LIBS(nanosleep, [rt])
842 AC_MSG_CHECKING(for libwrap)
845 #include <sys/types.h>
847 int deny_severity = 0;
848 int allow_severity = 0;
849 struct request_info *req;
854 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
859 LIBS="$saved_LIBS -lwrap -lnsl"
860 WRAPLIBS="$saved_LIBS -lwrap -lnsl"
863 #include <sys/types.h>
865 int deny_severity = 0;
866 int allow_severity = 0;
867 struct request_info *req;
872 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
877 AC_MSG_ERROR([*** libwrap missing])
886 dnl -----------------------------------------------------------
887 dnl Check whether OpenSSL is available
888 dnl -----------------------------------------------------------
889 AC_MSG_CHECKING([for OpenSSL])
890 dnl The following uses quadrigraphs:
894 AC_HELP_STRING([--with-openssl@<:@=DIR@:>@], [Include OpenSSL support. DIR is the OpenSSL base]),
896 with_openssl_directory=${withval}
900 if test "x$with_openssl_directory" != "xno"; then
901 OPENSSL_LIBS="-lssl -lcrypto"
904 if test "x$with_openssl_directory" != "xyes" && test x"${with_openssl_directory}" != "x"; then
906 # Make sure the $with_openssl_directory also makes sense
908 if test -d "$with_openssl_directory/lib" -a -d "$with_openssl_directory/include"; then
909 OPENSSL_LIBS="-L$with_openssl_directory/lib $OPENSSL_LIBS"
910 OPENSSL_INC="-I$with_openssl_directory/include $OPENSSL_INC"
915 saved_CFLAGS="${CFLAGS}"
916 LIBS="${saved_LIBS} ${OPENSSL_LIBS}"
917 CFLAGS="${saved_CFLAGS} ${OPENSSL_INC}"
921 #include <openssl/ssl.h>
923 CRYPTO_set_id_callback(NULL);
935 #include <openssl/evp.h>
939 ac_cv_openssl_sha2="yes"
941 ac_cv_openssl_sha2="no"
945 dnl Solaris disables greater than 128+ bit encryption in their OpenSSL
946 dnl implementation, presumably for export reasons. If 192bit AES
947 dnl is available, we assume that we're running with a 'non-export'
951 #include <openssl/evp.h>
955 ac_cv_openssl_export="no"
957 ac_cv_openssl_export="yes"
961 AC_MSG_RESULT([$support_tls])
962 if test "$support_tls" = "yes"; then
963 AC_DEFINE(HAVE_OPENSSL, 1, [Define if OpenSSL library is available])
964 AC_DEFINE(HAVE_TLS, 1, [Define if TLS support should be enabled])
965 AC_DEFINE(HAVE_CRYPTO, 1, [Define if encryption support should be enabled])
968 if test "$ac_cv_openssl_sha2" = "yes"; then
969 AC_DEFINE(HAVE_SHA2, 1, [Define if the SHA-2 family of digest algorithms is available])
972 if test "$ac_cv_openssl_export" = "yes"; then
973 AC_DEFINE(HAVE_OPENSSL_EXPORT_LIBRARY, 1, [Define if the OpenSSL library is export-contrained to 128bit ciphers])
976 if test "$support_crypto" = "yes"; then
977 AC_CHECK_LIB(crypto, EVP_PKEY_encrypt_old, AC_DEFINE(HAVE_OPENSSLv1, 1, [Set if have OpenSSL version 1.x]))
981 CFLAGS="${saved_CFLAGS}"
985 AC_MSG_RESULT([$support_tls])
988 if test "$support_tls" = "no" -o "$support_crypto" = "no"; then
993 AC_SUBST(OPENSSL_LIBS)
994 AC_SUBST(OPENSSL_INC)
996 dnl -----------------------------------------------------------
997 dnl dlopen is needed for plugins
998 dnl -----------------------------------------------------------
999 AC_SEARCH_LIBS(dlopen, [dl])
1001 dnl ------------------------------------------
1002 dnl Where to place working dir
1003 dnl ------------------------------------------
1004 working_dir=`eval echo /opt/bacula/working`
1005 AC_ARG_WITH(working-dir,
1006 AC_HELP_STRING([--with-working-dir=PATH], [specify path of Bacula working directory]),
1008 if test "x$withval" != "xno" ; then
1009 working_dir=$withval
1014 AC_SUBST(working_dir)
1016 dnl ------------------------------------------------------------------
1017 dnl If the user has not set archivedir, we set our default as /tmp
1018 dnl ------------------------------------------------------------------
1020 AC_ARG_WITH(archivedir,
1021 AC_HELP_STRING([--with-archivedir=PATH], [specify path of SD archive directory]),
1023 if test "x$withval" != "xno" ; then
1029 AC_SUBST(archivedir)
1031 dnl ------------------------------------------------------------------
1032 dnl Allow the user to specify the daemon resource name default hostname
1033 dnl ------------------------------------------------------------------
1035 AC_ARG_WITH(basename,
1036 AC_HELP_STRING([--with-basename=RESNAME], [specify base resource name for daemons]),
1038 if test "x$withval" != "xno" ; then
1046 dnl ------------------------------------------------------------------
1047 dnl Allow the user to override the hostname (default = machine hostname)
1048 dnl ------------------------------------------------------------------
1049 hostname=`uname -n | cut -d '.' -f 1`
1050 if test x${hostname} = x ; then
1051 hostname="localhost"
1053 dnl Make sure hostname is resolved
1054 ping -c 1 $hostname 2>/dev/null 1>/dev/null
1055 if test ! $? = 0; then
1056 hostname="localhost"
1058 AC_ARG_WITH(hostname,
1059 AC_HELP_STRING([--with-hostname=RESNAME], [specify host name for daemons]),
1061 if test "x$withval" != "xno" ; then
1070 dnl ------------------------------------------
1071 dnl Where to place scriptdir (script files)
1072 dnl ------------------------------------------
1073 scriptdir=`eval echo ${sysconfdir}`
1074 AC_ARG_WITH(scriptdir,
1075 AC_HELP_STRING([--with-scriptdir=PATH], [specify path of Bacula scripts directory]),
1077 if test "x$withval" != "xno" ; then
1086 dnl ------------------------------------------
1087 dnl Where to place bsrdir (bsr files)
1088 dnl ------------------------------------------
1089 bsrdir=`eval echo /opt/bacula/bsr`
1091 AC_HELP_STRING([--with-bsrdir=PATH], [specify path of Bacula bsrs directory]),
1093 if test "x$withval" != "xno" ; then
1101 dnl ------------------------------------------
1102 dnl Where to place logdir
1103 dnl ------------------------------------------
1104 logdir=`eval echo /opt/bacula/log`
1106 AC_HELP_STRING([--with-logdir=PATH], [specify path of Bacula logs directory]),
1108 if test "x$withval" != "xno" ; then
1117 # ------------------------------------------
1118 # Where to place plugindir (plugin files)
1119 # ------------------------------------------
1120 plugindir=`eval echo ${libdir}`
1121 AC_ARG_WITH(plugindir,
1122 AC_HELP_STRING([--with-plugindir=PATH], [specify path of Bacula plugins directory]),
1124 if test "x$withval" != "xno" ; then
1132 dnl ------------------------------------------
1133 dnl Where to send dump email
1134 dnl ------------------------------------------
1136 dnl ------------------------------------------
1137 dnl Where to send dump email
1138 dnl ------------------------------------------
1139 dump_email=root@localhost
1140 AC_ARG_WITH(dump-email,
1141 AC_HELP_STRING([--with-dump-email=EMAIL], [dump email address]),
1143 if test "x$withval" != "xno" ; then
1149 AC_SUBST(dump_email)
1151 dnl ------------------------------------------
1152 dnl Where to send job email
1153 dnl ------------------------------------------
1154 job_email=root@localhost
1155 AC_ARG_WITH(job-email,
1156 AC_HELP_STRING([--with-job-email=EMAIL], [job output email address]),
1158 if test "x$withval" != "xno" ; then
1166 dnl ------------------------------------------
1167 dnl Where to find smtp host
1168 dnl ------------------------------------------
1170 AC_ARG_WITH(smtp_host,
1171 AC_HELP_STRING([--with-smtp-host=HOST], [SMTP mail host address]),
1173 if test "x$withval" != "xno" ; then
1181 dnl ------------------------------------
1182 dnl Where to place pid files
1183 dnl ------------------------------------
1185 AC_ARG_WITH(pid-dir,
1186 AC_HELP_STRING([--with-pid-dir=PATH], [specify location of Bacula pid files]),
1188 if test "x$withval" != "xno" ; then
1194 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
1197 dnl ------------------------------------
1198 dnl Where to place subsys "lock file"
1199 dnl ------------------------------------
1200 subsysdir=/var/run/subsys
1201 if test -d /var/run/subsys; then
1202 subsysdir=/var/run/subsys
1203 elif test -d /var/lock/subsys; then
1204 subsysdir=/var/lock/subsys
1206 subsysdir=/var/run/subsys
1208 AC_ARG_WITH(subsys-dir,
1209 AC_HELP_STRING([--with-subsys-dir=PATH], [specify location of Bacula subsys file]),
1211 if test "x$withval" != "xno" ; then
1219 dnl ------------------------------------
1220 dnl Where to start assigning ports
1221 dnl ------------------------------------
1223 AC_ARG_WITH(baseport,
1224 AC_HELP_STRING([--with-baseport=PORT], [specify base port address for daemons]),
1226 if test "x$withval" != "xno" ; then
1233 dir_port=`expr $baseport`
1234 fd_port=`expr $baseport + 1`
1235 sd_port=`expr $fd_port + 1`
1241 dnl ------------------------------------------
1242 dnl Generate passwords
1243 dnl ------------------------------------------
1245 AC_ARG_WITH(dir-password,
1246 AC_HELP_STRING([--with-dir-password=PASSWORD], [specify Director's password]),
1248 if test "x$withval" != "xno" ; then
1249 dir_password=$withval
1254 if test "x$dir_password" = "x" ; then
1255 if test "x$OPENSSL" = "xnone" ; then
1256 key=`autoconf/randpass 33`
1258 key=`openssl rand -base64 33`
1264 AC_ARG_WITH(fd-password,
1265 AC_HELP_STRING([--with-fd-password=PASSWORD], [specify Client's password]),
1267 if test "x$withval" != "xno" ; then
1268 fd_password=$withval
1273 if test "x$fd_password" = "x" ; then
1274 if test "x$OPENSSL" = "xnone" ; then
1275 key=`autoconf/randpass 37`
1277 key=`openssl rand -base64 33`
1283 AC_ARG_WITH(sd-password,
1284 AC_HELP_STRING([--with-sd-password=PASSWORD], [specify Storage daemon's password]),
1286 if test "x$withval" != "xno" ; then
1287 sd_password=$withval
1292 if test "x$sd_password" = "x" ; then
1293 if test "x$OPENSSL" = "xnone" ; then
1294 key=`autoconf/randpass 41`
1296 key=`openssl rand -base64 33`
1302 AC_ARG_WITH(mon-dir-password,
1303 AC_HELP_STRING([--with-mon-dir-password=PASSWORD], [specify Director's password used by the monitor]),
1305 if test "x$withval" != "xno" ; then
1306 mon_dir_password=$withval
1311 if test "x$mon_dir_password" = "x" ; then
1312 if test "x$OPENSSL" = "xnone" ; then
1313 key=`autoconf/randpass 33`
1315 key=`openssl rand -base64 33`
1317 mon_dir_password=$key
1321 AC_ARG_WITH(mon-fd-password,
1322 AC_HELP_STRING([--with-mon-fd-password=PASSWORD], [specify Client's password used by the monitor]),
1324 if test "x$withval" != "xno" ; then
1325 mon_fd_password=$withval
1330 if test "x$mon_fd_password" = "x" ; then
1331 if test "x$OPENSSL" = "xnone" ; then
1332 key=`autoconf/randpass 37`
1334 key=`openssl rand -base64 33`
1336 mon_fd_password=$key
1340 AC_ARG_WITH(mon-sd-password,
1341 AC_HELP_STRING([--with-mon-sd-password=PASSWORD], [specify Storage daemon's password used by the monitor]),
1343 if test "x$withval" != "xno" ; then
1344 mon_sd_password=$withval
1349 if test "x$mon_sd_password" = "x" ; then
1350 if test "x$OPENSSL" = "xnone" ; then
1351 key=`autoconf/randpass 41`
1353 key=`openssl rand -base64 33`
1355 mon_sd_password=$key
1358 AC_SUBST(dir_password)
1359 AC_SUBST(fd_password)
1360 AC_SUBST(sd_password)
1361 AC_SUBST(mon_dir_password)
1362 AC_SUBST(mon_fd_password)
1363 AC_SUBST(mon_sd_password)
1366 dnl Pickup any database name
1369 AC_ARG_WITH(db_name,
1370 AC_HELP_STRING([--with-db-name=DBNAME], [specify database name @<:@default=bacula@:>@]),
1372 if test "x$withval" != "x" ; then
1380 AC_ARG_WITH(db_user,
1381 AC_HELP_STRING([--with-db-user=UNAME], [specify database user @<:@default=bacula@:>@]),
1383 if test "x$withval" != "x" ; then
1391 AC_ARG_WITH(db_password,
1392 AC_HELP_STRING([--with-db-password=PWD], [specify database password @<:@default=*none*@:>@]),
1394 if test "x$withval" != "x" ; then
1395 db_password=$withval
1399 AC_SUBST(db_password)
1402 dnl Pickup a database port
1405 AC_ARG_WITH(db_port,
1406 AC_HELP_STRING([--with-db-port=DBPORT], [specify a database port @<:@default=null@:>@]),
1408 if test "x$withval" != "x" ; then
1416 dnl Pickup MySQL SSL options for database user connection
1419 AC_ARG_WITH(db_ssl_options,
1420 AC_HELP_STRING([--with-db-ssl-options=DBSSLOPTIONS], [specify SSL options for database user connection @<:@default=null@:>@]),
1422 if test "x$withval" != "x" ; then
1423 db_ssl_options=$withval
1427 AC_SUBST(db_ssl_options)
1430 # Handle users and groups for each daemon
1433 AC_ARG_WITH(dir_user,
1434 AC_HELP_STRING([--with-dir-user=USER], [specify user for Director daemon]),
1436 if test "x$withval" != "x" ; then
1443 AC_ARG_WITH(dir_group,
1444 AC_HELP_STRING([--with-dir-group=GROUP], [specify group for Director daemon]),
1446 if test "x$withval" != "x" ; then
1453 AC_ARG_WITH(sd_user,
1454 AC_HELP_STRING([--with-sd-user=USER], [specify user for Storage daemon]),
1456 if test "x$withval" != "x" ; then
1463 AC_ARG_WITH(sd_group,
1464 AC_HELP_STRING([--with-sd-group=GROUP], [specify group for Storage daemon]),
1466 if test "x$withval" != "x" ; then
1473 AC_ARG_WITH(fd_user,
1474 AC_HELP_STRING([--with-fd-user=USER], [specify user for File daemon]),
1476 if test "x$withval" != "x" ; then
1483 AC_ARG_WITH(fd_group,
1484 AC_HELP_STRING([--with-fd-group=GROUP], [specify group for File daemon]),
1486 if test "x$withval" != "x" ; then
1500 dnl allow setting default executable permissions
1503 AC_ARG_WITH(sbin-perm,
1504 AC_HELP_STRING([--with-sbin-perm=MODE], [specify permissions for sbin binaries @<:@default=0750@:>@]),
1506 if test "x$withval" != "x" ; then
1514 dnl -------------------------------------------
1515 dnl enable batch attribute DB insert (default on)
1516 dnl -------------------------------------------
1517 support_batch_insert=yes
1518 AC_ARG_ENABLE(batch-insert,
1519 AC_HELP_STRING([--enable-batch-insert], [enable the DB batch insert code @<:@default=yes@:>@]),
1521 if test x$enableval = xno; then
1522 support_batch_insert=no
1527 if test x$support_batch_insert = xyes; then
1528 AC_DEFINE(USE_BATCH_FILE_INSERT, 1, [Set if DB batch insert code enabled])
1531 dnl ------------------------------------------------
1532 dnl Bacula check for various SQL database engines
1533 dnl ------------------------------------------------
1536 dnl Set uncomment_dbi by default to '#' if DBI is enabled this will get reset
1540 BA_CHECK_POSTGRESQL_DB
1546 dnl -------------------------------------------
1547 dnl If no batch insert backend are enable set
1548 dnl variable to None
1549 dnl -------------------------------------------
1550 if test -z "${batch_insert_db_backends}"; then
1551 batch_insert_db_backends="None"
1554 dnl -------------------------------------------
1555 dnl Make sure at least one database backend is found
1556 dnl -------------------------------------------
1557 if test "x${db_backends}" = "x" ; then
1560 echo "You have not specified either --enable-client-only or one of the"
1561 echo "supported databases: MySQL, PostgreSQL, or SQLite3."
1562 echo "This is not permitted. Please reconfigure."
1564 echo "Aborting the configuration ..."
1570 dnl -------------------------------------------
1571 dnl See how many catalog backends are configured.
1572 dnl -------------------------------------------
1573 case `echo $DB_BACKENDS | wc -w | sed -e 's/^ *//'` in
1575 DEFAULT_DB_TYPE="${DB_BACKENDS}"
1576 if test x$use_libtool = xno; then
1577 SHARED_CATALOG_TARGETS=""
1579 SHARED_CATALOG_TARGETS="libbaccats-${DEFAULT_DB_TYPE}.la"
1583 dnl ------------------------------------------------
1584 dnl Set the default backend to the first backend found
1585 dnl ------------------------------------------------
1586 DEFAULT_DB_TYPE=`echo ${DB_BACKENDS} | cut -d' ' -f1`
1588 dnl ------------------------------------------------
1589 dnl For multiple backend we need libtool support.
1590 dnl ------------------------------------------------
1591 if test x$use_libtool = xno; then
1594 echo "You have specified two or more of the"
1595 echo "supported databases: MySQL, PostgreSQL, or SQLite3."
1596 echo "This is not permitted when not using libtool Please reconfigure."
1598 echo "Aborting the configuration ..."
1604 SHARED_CATALOG_TARGETS=""
1605 for db_type in ${DB_BACKENDS}
1607 if test -z "${SHARED_CATALOG_TARGETS}"; then
1608 SHARED_CATALOG_TARGETS="libbaccats-${db_type}.la"
1610 SHARED_CATALOG_TARGETS="${SHARED_CATALOG_TARGETS} libbaccats-${db_type}.la"
1616 dnl -------------------------------------------
1617 dnl Unset DB_LIBS when using libtool as we link the
1618 dnl shared library using the right database lib no need to
1619 dnl set DB_LIBS which is only used for non shared versions
1620 dnl of the backends.
1621 dnl -------------------------------------------
1622 if test x$use_libtool = xyes; then
1626 AC_SUBST(uncomment_dbi)
1627 AC_SUBST(DB_BACKENDS)
1629 AC_SUBST(DEFAULT_DB_TYPE)
1630 AC_SUBST(SHARED_CATALOG_TARGETS)
1632 AC_DEFINE(PROTOTYPES)
1634 dnl --------------------------------------------------------------------------
1635 dnl Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
1637 if test -z "$CFLAGS" -o "$CFLAGS" = "-g -O2"; then
1638 if test -z "$CCOPTS"; then
1639 CCOPTS='-g -O2 -Wall'
1647 dnl See if we can use 64 bit file addresses
1648 largefile_support="no"
1653 dnl --------------------------------------------------------------------------
1654 dnl CHECKING FOR HEADER FILES
1655 dnl --------------------------------------------------------------------------
1694 AC_STRUCT_ST_BLKSIZE
1698 dnl --------------------------------------------------------------------------
1699 dnl Check for utime.h structure
1700 dnl --------------------------------------------------------------------------
1701 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
1705 #include <sys/types.h>
1710 ba_cv_header_utime_h=yes
1712 ba_cv_header_utime_h=no
1717 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H, 1, [Set if utime.h exists])
1719 dnl --------------------------------------------------------------------------
1720 dnl Check for socklen_t
1721 dnl --------------------------------------------------------------------------
1722 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
1726 #include <sys/types.h>
1727 #include <sys/socket.h>
1731 ba_cv_header_socklen_t=yes
1733 ba_cv_header_socklen_t=no
1738 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T, 1, [Set if socklen_t exists])
1740 dnl --------------------------------------------------------------------------
1741 dnl Check for ioctl request type
1742 dnl --------------------------------------------------------------------------
1744 AC_CACHE_CHECK(for ioctl_req_t, ba_cv_header_ioctl_req_t,
1749 #include <sys/types.h>
1750 #include <sys/ioctl.h>
1752 int (*d_ioctl)(int fd, unsigned long int request, ...);
1755 ba_cv_header_ioctl_req_t=yes
1757 ba_cv_header_ioctl_req_t=no
1762 test $ba_cv_header_ioctl_req_t = yes && AC_DEFINE(HAVE_IOCTL_ULINT_REQUEST, 1, [Set if ioctl request is unsigned long int])
1764 dnl Note: it is more correct to use AC_LANG(C++) but some of the older
1765 dnl *BSD systems still use old style C prototypes, which are wrong with
1766 dnl compiled with a C++ compiler.
1769 dnl --------------------------------------------------------------------------
1770 dnl Check for typeof()
1771 dnl --------------------------------------------------------------------------
1773 AC_CACHE_CHECK(for typeof, ba_cv_have_typeof,
1777 main(){char *a = 0; a = (typeof a)a;}
1779 ba_cv_have_typeof=yes
1781 ba_cv_have_typeof=no
1783 ba_cv_have_typeof=no
1788 test $ba_cv_have_typeof = yes && AC_DEFINE([HAVE_TYPEOF], 1, [Defind to 1 if compiler has typeof])
1793 AC_C_BIGENDIAN([AC_DEFINE([HAVE_BIG_ENDIAN], [1], [Big Endian])], [AC_DEFINE([HAVE_LITTLE_ENDIAN], [1], [Little Endian])])
1795 dnl --------------------------------------------------------------------------
1796 dnl CHECKING FOR FILESYSTEM TYPE
1797 dnl --------------------------------------------------------------------------
1798 AC_MSG_CHECKING(how to get filesystem type)
1800 # The order of these tests is important.
1803 #include <sys/statvfs.h>
1804 #include <sys/fstyp.h>
1806 AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4
1808 if test $fstype = no; then
1811 #include <sys/statfs.h>
1812 #include <sys/fstyp.h>
1814 AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3
1817 if test $fstype = no; then
1820 #include <sys/statfs.h>
1821 #include <sys/vmount.h>
1823 AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX
1826 if test $fstype = no; then
1831 AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD
1834 if test $fstype = no; then
1835 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
1837 if test $fstype = no; then
1840 #include <sys/mount.h>
1841 #include <sys/fs_types.h>
1843 AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix
1846 AC_MSG_RESULT($fstype)
1848 AC_CHECK_HEADER(sys/statvfs.h, [ AC_DEFINE(HAVE_SYS_STATVFS_H,1,[Defines if your system have the sys/statvfs.h header file])] , )
1850 AC_CHECK_DECLS([O_CLOEXEC],,[AC_DEFINE([O_CLOEXEC],[0], [Defined to 0 if not provided])],
1857 AC_CHECK_DECLS([FD_CLOEXEC],,[AC_DEFINE([FD_CLOEXEC],[0], [Defined to 0 if not provided])],
1864 AC_CHECK_DECLS([SOCK_CLOEXEC],,[AC_DEFINE([SOCK_CLOEXEC],[0],[Defined to 0 if not provided])],
1866 #ifdef HAVE_SYS_SOCKET_H
1867 # include <sys/socket.h>
1871 AC_CACHE_CHECK(for close on exec modifier for fopen(), ac_cv_feature_stream_cloexec_flag,
1872 [if test $ac_cv_have_decl_O_CLOEXEC = yes ; then
1873 if test $ac_cv_have_decl_SOCK_CLOEXEC = yes ; then
1874 ac_cv_feature_stream_cloexec_flag="e"
1878 if test "x$ac_cv_feature_stream_cloexec_flag" = "xe" ; then
1879 AC_DEFINE(HAVE_STREAM_CLOEXEC,[0],[Defined to 0 if not provided])
1882 AC_DEFINE_UNQUOTED([STREAM_CLOEXEC], "$ac_cv_feature_stream_cloexec_flag", [fopen() modifier for setting close on exec flag])
1884 AC_CHECK_FUNC(accept4, [AC_DEFINE(HAVE_ACCEPT4, 1, [Define to 1 if you have the 'accept4' function.])])
1891 if test x$support_s3 = xyes; then
1893 AC_HELP_STRING([--with-s3@<:@=DIR@:>@], [specify s3 library directory]),
1900 if test -f ${with_s3}/include/libs3.h; then
1901 S3_INC="-I${with_s3}/include"
1902 S3_LDFLAGS="-L${with_s3}/lib"
1903 with_s3="${with_s3}/include"
1905 with_s3="/usr/include"
1908 AC_CHECK_HEADER(${with_s3}/libs3.h,
1910 AC_DEFINE(HAVE_LIBS3, 1, [Define to 1 if you have libs3])
1911 S3_LIBS="${S3_LDFLAGS} -ls3"
1915 echo "libs3.h not found. s3 turned off ..."
1922 AC_CHECK_HEADER(libs3.h,
1924 AC_CHECK_LIB(s3, S3_initialize,
1927 AC_DEFINE(HAVE_LIBS3,1,[Define to 1 if you have libs3])
1938 AC_CHECK_FUNCS(backtrace)
1941 dnl --------------------------------------------------------------------------
1942 dnl CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
1943 dnl --------------------------------------------------------------------------
1953 AC_CHECK_TYPE(ino_t, unsigned long)
1954 AC_CHECK_TYPE(dev_t, unsigned long)
1955 AC_CHECK_TYPE(daddr_t, long)
1956 AC_CHECK_TYPE(major_t, int)
1957 AC_CHECK_TYPE(minor_t, int)
1958 AC_CHECK_TYPE(ssize_t, int)
1965 AC_CHECK_SIZEOF(char, 1)
1966 AC_CHECK_SIZEOF(short int, 2)
1967 AC_CHECK_SIZEOF(int, 4)
1968 AC_CHECK_SIZEOF(long int, 4)
1969 AC_CHECK_SIZEOF(long long int, 8)
1970 AC_CHECK_SIZEOF(int *, 4)
1972 dnl Check for sys/types.h types
1973 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int,
1977 #include <sys/types.h>
1981 ac_cv_have_u_int="yes"
1983 ac_cv_have_u_int="no"
1988 if test "x$ac_cv_have_u_int" = "xyes" ; then
1989 AC_DEFINE(HAVE_U_INT)
1993 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t,
1997 #include <sys/types.h>
2001 ac_cv_have_intmax_t="yes"
2009 ac_cv_have_intmax_t="yes"
2011 ac_cv_have_intmax_t="no"
2018 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
2019 AC_DEFINE(HAVE_INTMAX_T)
2023 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t,
2027 #include <sys/types.h>
2029 u_intmax_t a; a = 1;
2031 ac_cv_have_u_intmax_t="yes"
2037 u_intmax_t a; a = 1;
2039 ac_cv_have_u_intmax_t="yes"
2041 ac_cv_have_u_intmax_t="no"
2048 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
2049 AC_DEFINE(HAVE_U_INTMAX_T)
2053 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t,
2057 #include <sys/types.h>
2059 int8_t a; int16_t b; int32_t c; a = b = c = 1;
2061 ac_cv_have_intxx_t="yes"
2063 ac_cv_have_intxx_t="no"
2068 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
2069 AC_DEFINE(HAVE_INTXX_T)
2073 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t,
2077 #include <sys/types.h>
2081 ac_cv_have_int64_t="yes"
2083 ac_cv_have_int64_t="no"
2088 if test "x$ac_cv_have_int64_t" = "xyes" ; then
2089 AC_DEFINE(HAVE_INT64_T)
2093 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t,
2097 #include <sys/types.h>
2099 u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;
2101 ac_cv_have_u_intxx_t="yes"
2103 ac_cv_have_u_intxx_t="no"
2108 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
2109 AC_DEFINE(HAVE_U_INTXX_T)
2113 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t,
2117 #include <sys/types.h>
2121 ac_cv_have_u_int64_t="yes"
2123 ac_cv_have_u_int64_t="no"
2128 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
2129 AC_DEFINE(HAVE_U_INT64_T)
2133 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
2134 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2136 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
2139 #include <sys/bitypes.h>
2141 int8_t a; int16_t b; int32_t c;
2142 u_int8_t e; u_int16_t f; u_int32_t g;
2143 a = b = c = e = f = g = 1;
2145 AC_DEFINE(HAVE_U_INTXX_T)
2146 AC_DEFINE(HAVE_INTXX_T)
2147 AC_DEFINE(HAVE_SYS_BITYPES_H)
2155 if test -z "$have_u_intxx_t" ; then
2156 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t,
2160 #include <sys/types.h>
2162 uint8_t a; uint16_t b;
2163 uint32_t c; a = b = c = 1;
2165 ac_cv_have_uintxx_t="yes"
2167 ac_cv_have_uintxx_t="no"
2172 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
2173 AC_DEFINE(HAVE_UINTXX_T)
2177 if (test -z "$have_u_int64_t" || test -z "$have_int64_t" && \
2178 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2180 AC_MSG_CHECKING([for int64_t and u_int64_t types in sys/bitypes.h])
2183 #include <sys/bitypes.h>
2185 int64_t a; u_int64_t b;
2188 AC_DEFINE(HAVE_U_INT64_T)
2189 AC_DEFINE(HAVE_INT64_T)
2197 if (test -z "$have_uintxx_t" && \
2198 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2200 AC_MSG_CHECKING([for uintXX_t types in sys/bitypes.h])
2203 #include <sys/bitypes.h>
2205 uint8_t a; uint16_t b;
2206 uint32_t c; a = b = c = 1;
2208 AC_DEFINE(HAVE_UINTXX_T)
2216 dnl --------------------------------------------------------------------------
2217 dnl CHECKING FOR REQUIRED LIBRARY FUNCTIONS
2218 dnl --------------------------------------------------------------------------
2234 [echo 'configure: cannot find needed function.'; exit 1]
2239 AC_DEFINE(HAVE_FCNTL_F_CLOSEM, 1, [Set if you have 'F_CLOSEM' fcntl flag]),
2241 [#include <fcntl.h>]
2246 AC_DEFINE(HAVE_FCNTL_LOCK, 1, [Set if fcntl supports file locking]),
2248 [#include <fcntl.h>]
2251 AC_CHECK_FUNC(closefrom, [AC_DEFINE(HAVE_CLOSEFROM, 1, [Define to 1 if you have the 'closefrom' function.])])
2252 AC_CHECK_FUNCS(getpagesize, [AC_DEFINE(HAVE_GETPAGESIZE, 1, [Set if have getpagesize])])
2253 AC_CHECK_FUNCS(malloc_trim, [AC_DEFINE(HAVE_MALLOC_TRIM, 1, [Set if have malloc_trim])])
2255 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
2256 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
2257 AC_CHECK_FUNCS(posix_fadvise)
2258 AC_CHECK_FUNCS(posix_fallocate)
2259 AC_CHECK_FUNCS(fdatasync)
2260 AC_CHECK_FUNCS(realpath)
2261 AC_CHECK_FUNCS(getrlimit)
2263 AC_CHECK_FUNCS(chflags)
2265 AC_CHECK_FUNCS(snprintf vsnprintf gethostid fseeko)
2267 AC_CACHE_CHECK(for va_copy, ba_cv_va_copy,
2272 void use_va_copy(va_list args){va_list args2; va_copy(args2,args); va_end(args2);}
2273 void call_use_va_copy(int junk,...){va_list args; va_start(args,junk); use_va_copy(args); va_end(args);}
2275 call_use_va_copy(1,2,3)
2284 test $ba_cv_va_copy = yes && AC_DEFINE(HAVE_VA_COPY, 1, [Set if va_copy exists])
2286 dnl --------------------------------------------------------------------------
2287 dnl CHECKING FOR THREAD SAFE FUNCTIONS
2288 dnl --------------------------------------------------------------------------
2289 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
2291 # If resolver functions are not in libc check for -lnsl or -lresolv.
2292 AC_CHECK_FUNC(gethostbyname_r,
2293 AC_MSG_RESULT(using libc's resolver),
2294 AC_CHECK_LIB(nsl,gethostbyname_r)
2295 AC_CHECK_LIB(resolv,gethostbyname_r))
2297 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
2298 AC_CHECK_FUNCS(inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)])
2299 AC_CHECK_FUNCS(gethostbyname2, [AC_DEFINE(HAVE_GETHOSTBYNAME2)])
2300 AC_CHECK_FUNCS(getnameinfo, [AC_DEFINE(HAVE_GETNAMEINFO)])
2303 dnl ----------------------------
2304 dnl check sa_len of sockaddr
2305 dnl ----------------------------
2306 AC_CACHE_CHECK(for struct sockaddr has a sa_len field, ac_cv_struct_sockaddr_sa_len,
2310 #include <sys/socket.h>
2312 struct sockaddr s; s.sa_len;
2314 ac_cv_struct_sockaddr_sa_len=yes
2315 ], [ac_cv_struct_sockaddr_sa_len=no
2321 if test $ac_cv_struct_sockaddr_sa_len = yes; then
2322 AC_DEFINE(HAVE_SA_LEN, 1, [Define if sa_len field exists in struct sockaddr])
2326 dnl check for working getaddrinfo()
2328 dnl Note that if the system doesn't have gai_strerror(), we
2329 dnl can't use getaddrinfo() because we can't get strings
2330 dnl describing the error codes.
2332 AC_CACHE_CHECK(for working getaddrinfo, ac_cv_working_getaddrinfo,
2338 #include <sys/types.h>
2339 #include <sys/socket.h>
2342 struct addrinfo hints, *ai;
2345 memset(&hints, 0, sizeof(hints));
2346 hints.ai_family = AF_UNSPEC;
2347 hints.ai_socktype = SOCK_STREAM;
2348 error = getaddrinfo("127.0.0.1", NULL, &hints, &ai);
2352 if (ai->ai_addr->sa_family != AF_INET) {
2358 ac_cv_working_getaddrinfo="yes"
2360 ac_cv_working_getaddrinfo="no"
2362 ac_cv_working_getaddrinfo="yes"
2367 AC_CHECK_FUNC(gai_strerror, [AC_DEFINE(HAVE_GAI_STRERROR, 1, [Define to 1 if you have the 'gai_strerror' function.])])
2369 if test "$ac_cv_working_getaddrinfo" = "yes"; then
2370 if test "$ac_cv_func_gai_strerror" != "yes"; then
2371 ac_cv_working_getaddrinfo="no"
2373 AC_DEFINE(HAVE_GETADDRINFO, 1, [Define to 1 if getaddrinfo exists and works])
2381 AC_CHECK_FUNCS(getmntinfo, [AC_DEFINE(HAVE_GETMNTINFO)])
2382 AC_FUNC_CLOSEDIR_VOID
2383 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
2384 # AC_FUNC_FNMATCH dnl use local version
2386 AC_CHECK_LIB(intl, gettext, [LIBS="$LIBS -lintl"])
2388 AC_CHECK_LIB(sun, getpwnam)
2390 AC_CHECK_HEADERS(zlib.h)
2391 AC_CHECK_LIB(z, deflate, [ZLIBS="-lz"])
2393 if test x$ZLIBS = x-lz; then
2394 AC_DEFINE(HAVE_LIBZ)
2400 dnl Check if we have AFS on this system
2406 AC_HELP_STRING([--disable-afs], [disable afs support @<:@default=auto@:>@]),
2408 if test x$enableval = xyes; then
2410 elif test x$enableval = xno; then
2417 if test x$support_afs = xyes -o x$support_afs = xauto; then
2419 AC_HELP_STRING([--with-afsdir@<:@=DIR@:>@], [Directory holding AFS includes/libs]),
2420 with_afsdir=$withval
2424 dnl Search in standard places, or --with-afsdir not specified
2426 if test x$with_afsdir = x; then
2427 for root in /usr /usr/local; do
2428 if test -d ${root}/include/afs/ ; then
2432 if test -d ${root}/include/openafs/afs/ ; then
2439 if test -d ${with_afsdir}/include/afs/ ; then
2440 AFS_CFLAGS="-I${with_afsdir}/include"
2442 if test -d ${with_afsdir}/include/openafs/afs/ ; then
2443 AFS_CFLAGS="-I${with_afsdir}/include/openafs"
2447 saved_CFLAGS="${CFLAGS}"
2448 saved_CPPFLAGS="${CPPFLAGS}"
2449 CFLAGS="${AFS_CFLAGS} ${saved_CFLAGS}"
2450 CPPFLAGS="${AFS_CFLAGS} ${saved_CPPFLAGS}"
2452 AC_CHECK_HEADERS(afs/afsint.h)
2455 #include <afs/afsint.h>
2456 #include <afs/venus.h>
2458 AC_DEFINE(HAVE_AFS_VENUS_H,1,[Define to 1 if you have the <afs/venus.h> header file.])
2461 CFLAGS="${saved_CFLAGS}"
2462 CPPFLAGS="${saved_CPPFLAGS}"
2465 dnl See if we can find a libsys with the pioctl symbol in there
2467 AC_MSG_CHECKING(for pioctl in AFS libsys)
2468 for dir in ${with_afsdir}/lib \
2469 ${with_afsdir}/lib/afs \
2470 ${with_afsdir}/lib/openafs \
2471 ${with_afsdir}/lib64 \
2472 ${with_afsdir}/lib64/afs \
2473 ${with_afsdir}/lib64/openafs
2475 for arch_type in .a .so
2477 A=`test -f ${dir}/libsys${arch_type} && nm ${dir}/libsys${arch_type} 2>/dev/null | grep pioctl`
2479 if test $pkg = 0; then
2481 AFS_LIBS="-L${dir} -lsys -lrx -llwp ${dir}/util${arch_type}"
2487 if test $have_afs = yes; then
2493 if test x$support_afs = xyes -a $have_afs != yes; then
2494 AC_MSG_ERROR([afs support explicitly enabled but no supported afs implementation found,
2495 please either load the afs libraries or rerun configure without --enable-afs])
2497 if test $have_afs = yes; then
2498 AC_DEFINE(HAVE_AFS,1,[Define to 1 if your system has AFS support])
2499 AC_DEFINE(HAVE_AFS_ACL,1,[Andrew FileSystem ACL support])
2503 AC_SUBST(AFS_CFLAGS)
2506 dnl ---------------------------------------------------
2507 dnl Check for lzo support/directory (default on)
2508 dnl ---------------------------------------------------
2509 dnl this allows you to turn it completely off
2512 AC_HELP_STRING([--disable-lzo], [disable lzo support @<:@default=yes@:>@]),
2514 if test x$enableval = xno; then
2525 if test x$support_lzo = xyes; then
2527 AC_HELP_STRING([--with-lzo@<:@=DIR@:>@], [specify lzo library directory]),
2534 if test -f ${with_lzo}/include/lzo/lzoconf.h; then
2535 LZO_INC="-I${with_lzo}/include"
2536 LZO_LDFLAGS="-L${with_lzo}/lib"
2537 with_lzo="${with_lzo}/include"
2539 with_lzo="/usr/include"
2542 AC_CHECK_HEADER(${with_lzo}/lzo/lzoconf.h,
2544 AC_DEFINE(HAVE_LZO, 1, [Define to 1 if you have LZO compression])
2545 LZO_LIBS="${LZO_LDFLAGS} -llzo2"
2549 echo "lzoconf.h not found. lzo turned off ..."
2556 AC_CHECK_HEADER(lzo/lzoconf.h,
2558 AC_CHECK_HEADER(lzo/lzo1x.h,
2560 AC_CHECK_LIB(lzo2, lzo1x_1_compress,
2563 AC_DEFINE(HAVE_LZO,1,[Define to 1 if you have LZO compression])
2576 dnl Check for ACL support and libraries
2580 AC_HELP_STRING([--disable-acl], [disable acl support @<:@default=auto@:>@]),
2582 if test x$enableval = xyes; then
2584 elif test x$enableval = xno; then
2591 have_extended_acl=no
2592 if test x$support_acl = xyes -o x$support_acl = xauto; then
2593 AC_CHECK_HEADER(sys/acl.h, [ AC_DEFINE(HAVE_SYS_ACL_H,1,[Defines if your system have the sys/acl.h header file])] , )
2596 dnl First check for acl_get_file in libc
2598 AC_CHECK_FUNC(acl_get_file,
2605 dnl Check for acl_get_file in libacl (Linux)
2607 if test $have_acl = no; then
2608 AC_CHECK_LIB(acl, acl_get_file,
2611 if test $have_afs = yes; then
2613 dnl Because of possible naming conflict with AFS libacl make sure we use the one in /usr/lib64 or /usr/lib !!!
2615 if test -d /usr/lib64/; then
2616 FDLIBS="-L/usr/lib64 -lacl $FDLIBS"
2618 FDLIBS="-L/usr/lib -lacl $FDLIBS"
2621 FDLIBS="-lacl $FDLIBS"
2628 dnl Check for acl_get_file in libpacl (OSF1)
2629 dnl and if ACL_TYPE_DEFAULT_DIR is defined.
2631 if test $have_acl = no -a \
2632 x${HAVE_OSF1_OS_TRUE} = x; then
2633 AC_CHECK_LIB(pacl, acl_get_file,
2636 FDLIBS="-lpacl $FDLIBS"
2640 AC_MSG_CHECKING(for ACL_TYPE_DEFAULT_DIR in acl.h include file)
2641 grep ACL_TYPE_DEFAULT_DIR /usr/include/sys/acl.h > /dev/null 2>&1
2642 if test $? = 0; then
2643 AC_DEFINE(HAVE_ACL_TYPE_DEFAULT_DIR,1,[Defines if your system have the ACL_TYPE_DEFAULT_DIR acl type])
2651 dnl On OSX check for availability of ACL_TYPE_EXTENDED
2653 if test $have_acl = yes -a \
2654 x${HAVE_DARWIN_OS_TRUE} = x; then
2655 AC_MSG_CHECKING(for ACL_TYPE_EXTENDED in acl.h include file)
2656 grep ACL_TYPE_EXTENDED /usr/include/sys/acl.h > /dev/null 2>&1
2657 if test $? = 0; then
2658 AC_DEFINE(HAVE_ACL_TYPE_EXTENDED,1,[Defines if your system have the ACL_TYPE_EXTENDED acl type])
2666 dnl On FreeBSD check for availability of ACL_TYPE_NFS4
2668 if test $have_acl = yes -a \
2669 x${HAVE_FREEBSD_OS_TRUE} = x; then
2670 AC_MSG_CHECKING(for ACL_TYPE_NFS4 in acl.h include file)
2671 grep ACL_TYPE_NFS4 /usr/include/sys/acl.h > /dev/null 2>&1
2672 if test $? = 0; then
2673 AC_DEFINE(HAVE_ACL_TYPE_NFS4,1,[Defines if your system have the ACL_TYPE_NFS4 acl type])
2681 dnl Check for acltotext and acl_totext (Solaris)
2683 if test $have_acl = no -a \
2684 x${HAVE_SUN_OS_TRUE} = x; then
2685 AC_CHECK_LIB(sec, acltotext,
2688 FDLIBS="-lsec $FDLIBS"
2690 AC_CHECK_LIB(sec, acl_totext,
2692 have_extended_acl=yes
2700 dnl Check for acl_get and aclx_get (AIX)
2702 if test $have_acl = no -a \
2703 x${HAVE_AIX_OS_TRUE} = x; then
2704 AC_CHECK_FUNC(acl_get,
2708 AC_CHECK_FUNC(aclx_get,
2710 have_extended_acl=yes
2717 if test x$support_acl = xyes -a $have_acl != yes; then
2718 AC_MSG_ERROR([acl support explicitly enabled but no supported acl implementation found,
2719 please either load the acl libraries or rerun configure without --enable-acl])
2721 if test $have_acl = yes; then
2722 AC_DEFINE([HAVE_ACL],1,[Normal acl support])
2725 if test $have_extended_acl = yes; then
2726 AC_DEFINE([HAVE_EXTENDED_ACL],1,[Extended acl support])
2732 dnl Check for XATTR support
2735 AC_ARG_ENABLE(xattr,
2736 AC_HELP_STRING([--disable-xattr], [disable xattr support @<:@default=auto@:>@]),
2738 if test x$enableval = xyes; then
2740 elif test x$enableval = xno; then
2747 if test x$support_xattr = xyes -o x$support_xattr = xauto; then
2749 dnl First check for *BSD support
2750 dnl When running on a BSD variant
2752 if test x${HAVE_FREEBSD_OS_TRUE} = x -o \
2753 x${HAVE_NETBSD_OS_TRUE} = x -o \
2754 x${HAVE_OPENBSD_OS_TRUE} = x; then
2755 AC_CHECK_HEADER(sys/extattr.h, [ AC_DEFINE(HAVE_SYS_EXTATTR_H,1,[Defines if your system have the sys/extattr.h header file])] , )
2756 AC_CHECK_HEADER(libutil.h, [ AC_DEFINE(HAVE_LIBUTIL_H,1,[Defines if your system have the libutil.h header file])] , )
2757 AC_CHECK_FUNCS(extattr_get_link extattr_set_link extattr_list_link,
2760 AC_DEFINE([HAVE_EXTATTR_GET_LINK],1,[Define to 1 if you have the 'extattr_get_link' function.])
2761 AC_DEFINE([HAVE_EXTATTR_SET_LINK],1,[Define to 1 if you have the 'extattr_set_link' function.])
2762 AC_DEFINE([HAVE_EXTATTR_LIST_LINK],1,[Define to 1 if you have the 'extattr_list_link' function.])
2766 if test $have_xattr = no; then
2767 AC_CHECK_FUNCS(extattr_get_file extattr_set_file extattr_list_file,
2770 AC_DEFINE([HAVE_EXTATTR_GET_FILE],1,[Define to 1 if you have the 'extattr_get_file' function.])
2771 AC_DEFINE([HAVE_EXTATTR_SET_FILE],1,[Define to 1 if you have the 'extattr_set_file' function.])
2772 AC_DEFINE([HAVE_EXTATTR_LIST_FILE],1,[Define to 1 if you have the 'extattr_list_file' function.])
2777 if test $have_xattr = yes; then
2778 have_extattr_string_in_libc=no
2779 AC_CHECK_FUNCS(extattr_namespace_to_string extattr_string_to_namespace,
2781 have_extattr_string_in_libc=yes
2782 AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2783 AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2788 dnl If extattr_namespace_to_string and extattr_string_to_namespace are not in libc see if they are in libutil
2790 if test $have_extattr_string_in_libc = no; then
2791 AC_CHECK_LIB(util, extattr_namespace_to_string extattr_string_to_namespace,
2793 AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2794 AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2795 FDLIBS="-lutil $FDLIBS"
2803 dnl If we failed to find *BSD support try the AIX implementation of extented attributes (EA)
2804 dnl When running on AIX
2806 if test $have_xattr = no -a \
2807 x${HAVE_AIX_OS_TRUE} = x; then
2808 AC_CHECK_HEADER(sys/ea.h, [ AC_DEFINE(HAVE_SYS_EA_H,1,[Defines if your system have the sys/ea.h header file])] , )
2809 AC_CHECK_FUNCS(llistea lgetea lsetea,
2812 AC_DEFINE([HAVE_LLISTEA],1,[Define to 1 if you have the 'llistea' function.])
2813 AC_DEFINE([HAVE_LGETEA],1,[Define to 1 if you have the 'lgetea' function.])
2814 AC_DEFINE([HAVE_LSETEA],1,[Define to 1 if you have the 'lsetea' function.])
2818 if test $have_xattr = no; then
2819 AC_CHECK_FUNCS(listea getea setea,
2822 AC_DEFINE([HAVE_LISTEA],1,[Define to 1 if you have the 'listea' function.])
2823 AC_DEFINE([HAVE_GETEA],1,[Define to 1 if you have the 'getea' function.])
2824 AC_DEFINE([HAVE_SETEA],1,[Define to 1 if you have the 'setea' function.])
2831 dnl If we failed to find AIX support try the TRU64 implementation of extented attributes
2832 dnl when running on a TRU64 OS.
2834 if test $have_xattr = no -a \
2835 x${HAVE_OSF1_OS_TRUE} = x; then
2836 AC_CHECK_HEADER(sys/proplist.h, [ AC_DEFINE(HAVE_SYS_PROPLIST_H,1,[Defines if your system have the sys/proplist.h header file])] , )
2837 AC_CHECK_FUNCS(getproplist get_proplist_entry sizeof_proplist_entry add_proplist_entry setproplist,
2840 AC_DEFINE([HAVE_GETPROPLIST],1,[Define to 1 if you have the 'getproplist' function.])
2841 AC_DEFINE([HAVE_GET_PROPLIST_ENTRY],1,[Define to 1 if you have the 'get_proplist_entry' function.])
2842 AC_DEFINE([HAVE_SIZEOF_PROPLIST_ENTRY],1,[Define to 1 if you have the 'sizeof_proplist_entry' function.])
2843 AC_DEFINE([HAVE_ADD_PROPLIST_ENTRY],1,[Define to 1 if you have the 'add_proplist_entry' function.])
2844 AC_DEFINE([HAVE_SETPROPLIST],1,[Define to 1 if you have the 'setproplist' function.])
2850 dnl If we failed to find TRU64 support try the SOLARIS implementation of extented and extensible attributes
2851 dnl when running on a Solaris.
2853 if test $have_xattr = no -a \
2854 x${HAVE_SUN_OS_TRUE} = x; then
2855 AC_CHECK_HEADER(sys/attr.h, [ AC_DEFINE(HAVE_SYS_ATTR_H,1,[Defines if your system have the sys/attr.h header file])] , )
2856 AC_CHECK_HEADER(sys/nvpair.h, [ AC_DEFINE(HAVE_SYS_NVPAIR_H,1,[Defines if your system have the sys/nvpair.h header file])] , )
2857 AC_CHECK_HEADER(attr.h, [ AC_DEFINE(HAVE_ATTR_H,1,[Defines if your system have the attr.h header file])] , )
2859 AC_CHECK_FUNCS(openat fstatat unlinkat fchownat futimesat,
2862 AC_DEFINE([HAVE_OPENAT],1,[Define to 1 if you have the 'openat' function.])
2863 AC_DEFINE([HAVE_FSTATAT],1,[Define to 1 if you have the 'fstatat' function.])
2864 AC_DEFINE([HAVE_UNLINKAT],1,[Define to 1 if you have the 'unlinkat' function.])
2865 AC_DEFINE([HAVE_FCHOWNAT],1,[Define to 1 if you have the 'fchownat' function.])
2866 AC_DEFINE([HAVE_FUTIMESAT],1,[Define to 1 if you have the 'futimesat' function.])
2870 if test $have_xattr = yes; then
2871 AC_CHECK_LIB(nvpair, nvlist_next_nvpair,
2873 AC_DEFINE([HAVE_NVLIST_NEXT_NVPAIR],1,[Define to 1 if you have the 'nvlist_next_nvpair' function.])
2874 FDLIBS="-lnvpair $FDLIBS"
2881 dnl If we failed to find Solaris support try the generic xattr support code
2883 if test $have_xattr = no; then
2884 AC_CHECK_HEADER(sys/xattr.h, [ AC_DEFINE(HAVE_SYS_XATTR_H,1,[Defines if your system have the sys/xattr.h header file])] , )
2885 AC_CHECK_FUNCS(llistxattr lgetxattr lsetxattr,
2888 AC_DEFINE([HAVE_LLISTXATTR],1,[Define to 1 if you have the 'llistxattr' function.])
2889 AC_DEFINE([HAVE_LGETXATTR],1,[Define to 1 if you have the 'lgetxattr' function.])
2890 AC_DEFINE([HAVE_LSETXATTR],1,[Define to 1 if you have the 'lsetxattr' function.])
2894 if test $have_xattr = no; then
2895 AC_CHECK_FUNCS(listxattr getxattr setxattr,
2898 AC_DEFINE([HAVE_LISTXATTR],1,[Define to 1 if you have the 'listxattr' function.])
2899 AC_DEFINE([HAVE_GETXATTR],1,[Define to 1 if you have the 'getxattr' function.])
2900 AC_DEFINE([HAVE_SETXATTR],1,[Define to 1 if you have the 'setxattr' function.])
2906 if test x$support_xattr = xyes -a $have_xattr != yes; then
2907 AC_MSG_ERROR([xattr support explicitly enabled but no supported xattr implementation found,
2908 please either load the xattr libraries or rerun configure without --enable-xattr])
2910 if test $have_xattr = yes; then
2911 AC_DEFINE([HAVE_XATTR],1,[Extended Attributes support])
2917 dnl Check for pthread libraries
2920 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
2922 AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
2924 AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
2926 AC_CHECK_FUNC(pthread_create)
2935 dnl Check for headers, functions and libraries required to support
2936 dnl keeping readall capabilities
2938 AC_CHECK_HEADERS(sys/prctl.h sys/capability.h)
2939 AC_CHECK_FUNCS(prctl setreuid)
2940 AC_CHECK_LIB([cap], [cap_set_proc], [CAP_LIBS="-lcap"], [CAP_LIBS=])
2941 if test x$CAP_LIBS = x-lcap; then
2942 AC_DEFINE(HAVE_LIBCAP, 1, [Define if you have libcap])
2951 if test x$have_gcc = xyes ; then
2952 CPPFLAGS="$CPPFLAGS -x c++ -fno-strict-aliasing -fno-exceptions -fno-rtti"
2953 CFLAGS="$CFLAGS -x c++ -fno-strict-aliasing -fno-exceptions -fno-rtti"
2955 LDFLAGS=${LDFLAGS--O}
2956 CPPFLAGS="$CPPFLAGS"
2968 AC_SUBST(X_EXTRA_LIBS)
2973 dnl extra configurable objects
2984 dnl Finally we set appropriate distribution specific
2985 dnl variables and defaults
2990 COMPRESS_MANPAGES=yes
2995 PSCMD="ps -e -o pid,comm"
2996 PFILES="${PFILES} platforms/aix/Makefile"
2997 TAPEDRIVE="/dev/rmt0.1"
3001 PTHREAD_LIB="-lpthread -lexc"
3002 if test "${CC}" = "gcc" ; then
3009 TAPEDRIVE="/dev/nrmt0"
3012 DISTVER=`uname -a |awk '{print $3}'`
3013 TAPEDRIVE="/dev/nrmt0"
3014 PTHREAD_LIB="-pthread"
3015 CFLAGS="${CFLAGS} -pthread"
3016 PSCMD="ps -ax -o pid,command"
3020 platforms/bsdi/Makefile \
3021 platforms/bsdi/bacula-fd \
3022 platforms/bsdi/bacula-sd \
3023 platforms/bsdi/bacula-dir"
3024 largefile_support="yes"
3027 DISTVER=`uname -a |awk '{print $3}'`
3028 TAPEDRIVE="/dev/nrst0"
3031 WLDFLAGS="-mwindows"
3035 TAPEDRIVE="/dev/nst0"
3036 PSCMD="ps -e -o pid,command"
3039 platforms/darwin/Makefile"
3043 TAPEDRIVE="/dev/nst0"
3044 PSCMD="ps -e -o pid,command"
3047 platforms/osx/Makefile"
3050 if `test -f /etc/apt/sources.list && grep -q ubuntu /etc/apt/sources.list`; then
3053 DISTVER=`cat /etc/debian_version`
3054 if test -f /etc/lsb-release ; then
3056 if test "x$DISTRIB_ID" != "x" ; then
3057 DISTNAME=$DISTRIB_ID
3059 if test "x$DISTRIB_RELEASE" != "x" ; then
3060 DISTVER=$DISTRIB_RELEASE
3063 if test "$DISTNAME" = "Ubuntu" ; then
3066 TAPEDRIVE="/dev/nst0"
3067 PSCMD="ps -e -o pid,command"
3068 if test "$DISTNAME" = "ubuntu" ; then
3070 platforms/ubuntu/Makefile \
3071 platforms/ubuntu/bacula-fd \
3072 platforms/ubuntu/bacula-sd \
3073 platforms/ubuntu/bacula-dir"
3076 platforms/debian/Makefile \
3077 platforms/debian/bacula-fd \
3078 platforms/debian/bacula-sd \
3079 platforms/debian/bacula-dir"
3083 DISTVER=`uname -a |awk '{print $3}'`
3084 VER=`echo $DISTVER | cut -c 1`
3085 if test x$VER = x4 ; then
3086 PTHREAD_LIB="${PTHREAD_LIBS:--pthread}"
3087 CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS:--pthread}"
3091 TAPEDRIVE="/dev/nrsa0"
3092 PSCMD="ps -ax -o pid,command"
3094 platforms/freebsd/Makefile \
3095 platforms/freebsd/bacula-fd \
3096 platforms/freebsd/bacula-sd \
3097 platforms/freebsd/bacula-dir"
3098 largefile_support="yes"
3102 TAPEDRIVE="/dev/nst0"
3103 PSCMD="ps -e -o pid,command"
3105 platforms/hurd/Makefile \
3106 platforms/hurd/bacula-fd \
3107 platforms/hurd/bacula-sd \
3108 platforms/hurd/bacula-dir"
3111 PSCMD="UNIX95=1; ps -e -o pid,comm"
3112 CFLAGS="${CFLAGS} -D_XOPEN_SOURCE_EXTENDED=1"
3114 TAPEDRIVE="/dev/rmt/0hnb"
3115 PTHREAD_LIB="-lpthread"
3116 AC_DEFINE([_INCLUDE_LONGLONG])
3120 TAPEDRIVE="/dev/rmt/0cbn"
3121 PSCMD="ps -e -o pid,comm"
3123 platforms/irix/Makefile \
3124 platforms/irix/bacula-fd \
3125 platforms/irix/bacula-sd \
3126 platforms/irix/bacula-dir"
3129 DISTVER=`uname -a |awk '{print $3}'`
3132 TAPEDRIVE="/dev/nrst0"
3133 PSCMD="ps -ax -o pid,command"
3134 PTHREAD_LIB="-pthread"
3135 CFLAGS="${CFLAGS} -pthread"
3138 DISTVER=`uname -a |awk '{print $3}'`
3141 TAPEDRIVE="/dev/nrst0"
3142 PSCMD="ps -ax -o pid,command"
3143 PTHREAD_LIB="-pthread"
3144 CFLAGS="${CFLAGS} -pthread"
3146 platforms/openbsd/Makefile \
3147 platforms/openbsd/bacula-fd \
3148 platforms/openbsd/bacula-sd \
3149 platforms/openbsd/bacula-dir"
3152 if test -f /etc/whitebox-release ; then
3153 f=/etc/whitebox-release
3155 f=/etc/redhat-release
3157 if test `cat $f | grep release |\
3158 cut -f 3 -d ' '`x = "Enterprise"x ; then
3159 DISTVER="Enterprise "`cat $f | grep release |\
3162 DISTVER=`cat /etc/redhat-release | grep release |\
3165 TAPEDRIVE="/dev/nst0"
3166 PSCMD="ps -e -o pid,command"
3168 platforms/redhat/Makefile \
3169 platforms/redhat/bacula-fd \
3170 platforms/redhat/bacula-sd \
3171 platforms/redhat/bacula-dir
3175 DISTVER=`cat /etc/mandrake-release | grep release |\
3177 TAPEDRIVE="/dev/nst0"
3178 PSCMD="ps -e -o pid,command"
3180 platforms/mandrake/Makefile \
3181 platforms/mandrake/bacula-fd \
3182 platforms/mandrake/bacula-sd \
3183 platforms/mandrake/bacula-dir \
3187 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
3188 TAPEDRIVE="/dev/nst0"
3189 PSCMD="ps -e -o pid,command"
3191 platforms/gentoo/Makefile \
3192 platforms/gentoo/bacula-init \
3193 platforms/gentoo/bacula-fd \
3194 platforms/gentoo/bacula-sd \
3195 platforms/gentoo/bacula-dir"
3198 DISTVER=`cat /etc/slackware-version`
3199 TAPEDRIVE="/dev/nst0"
3200 PSCMD="ps -e -o pid,command"
3202 platforms/slackware/Makefile \
3203 platforms/slackware/rc.bacula-fd \
3204 platforms/slackware/rc.bacula-sd \
3205 platforms/slackware/rc.bacula-dir\
3206 platforms/slackware/functions.bacula"
3210 TAPEDRIVE="/dev/rmt/0cbn"
3211 PSCMD="ps -e -o pid,comm"
3213 platforms/solaris/Makefile \
3214 platforms/solaris/bacula-fd \
3215 platforms/solaris/bacula-sd \
3216 platforms/solaris/bacula-dir"
3220 AC_DEFINE(HAVE_OLD_SOCKOPT)
3221 AC_DEFINE(USE_THR_SETCONCURRENCY)
3224 AC_DEFINE(USE_THR_SETCONCURRENCY)
3227 AC_DEFINE(HAVE_SOLARIS10, 1, [Set if building on Solaris 10])
3232 LIBS="$LIBS -lresolv -lrt"
3235 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
3237 TAPEDRIVE="/dev/nst0"
3238 PSCMD="ps -e -o pid,command"
3240 platforms/suse/Makefile \
3241 platforms/suse/bacula-fd \
3242 platforms/suse/bacula-sd \
3243 platforms/suse/bacula-dir \
3244 platforms/suse/bacula"
3249 TAPEDRIVE="/dev/nst0"
3250 PSCMD="ps -e -o pid,command"
3252 platforms/suse/Makefile \
3253 platforms/suse/bacula-fd \
3254 platforms/suse/bacula-sd \
3255 platforms/suse/bacula-dir"
3259 TAPEDRIVE="/dev/nst0"
3262 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
3266 dnl -------------------------------------------
3267 dnl systemd (default off)
3268 dnl -------------------------------------------
3269 AC_MSG_CHECKING(for systemd support)
3270 AC_ARG_WITH(systemd,
3271 AC_HELP_STRING([--with-systemd@<:@=UNITDIR@:>@], [Include systemd support. UNITDIR is where systemd system .service files are located, default is to ask systemctl.]),
3273 if test "$withval" != "no"; then
3274 if test "$withval" = "yes"; then
3275 SYSTEMD_UNITDIR="`systemctl show | grep UnitPath | cut -d " " -f2`"
3277 SYSTEMD_UNITDIR="${withval}"
3281 platforms/systemd/Makefile \
3282 platforms/systemd/bacula.conf \
3283 platforms/systemd/bacula-dir.service \
3284 platforms/systemd/bacula-fd.service \
3285 platforms/systemd/bacula-sd.service"
3286 AC_DEFINE(HAVE_SYSTEMD, 1, [Define to 1 if systemd support should be enabled])
3288 support_systemd="yes"
3291 support_systemd="no"
3294 support_systemd="no"
3298 AC_SUBST(SYSTEMD_UNITDIR)
3302 LIBS="$PTHREAD_LIB $LIBS"
3304 AC_DEFINE_UNQUOTED(lld, "$lld")
3305 AC_DEFINE_UNQUOTED(llu, "$llu")
3312 AC_SUBST(COMPRESS_MANPAGES)
3314 dnl common parts of the Makefile
3315 MCOMMON=./autoconf/Make.common
3316 AC_SUBST_FILE(MCOMMON)
3319 if test "x${subsysdir}" = "x${sbindir}" ; then
3322 echo "You have set both --sbindir and --with-subsys-dir"
3323 echo " equal to: ${subsysdir} "
3324 echo "This is not permitted. Please reconfigure."
3326 echo "Aborting configuration ..."
3333 AC_OUTPUT([autoconf/Make.common \
3336 scripts/btraceback \
3338 scripts/baculabackupreport \
3340 scripts/bacula-ctl-dir \
3341 scripts/bacula-ctl-fd \
3342 scripts/bacula-ctl-sd \
3343 scripts/devel_bacula \
3346 scripts/mtx-changer \
3347 scripts/disk-changer \
3348 scripts/dvd-handler \
3349 scripts/dvd-simulator \
3350 scripts/logwatch/Makefile \
3351 scripts/logwatch/logfile.bacula.conf \
3352 scripts/bat.desktop \
3353 scripts/bat.desktop.xsu \
3354 scripts/bat.desktop.consolehelper \
3355 scripts/bat.console_apps \
3356 scripts/bacula-tray-monitor.desktop \
3359 src/console/Makefile \
3360 src/console/bconsole.conf \
3361 src/qt-console/bat.conf \
3362 src/qt-console/bat.pro \
3363 src/qt-console/bat.pro.mingw32 \
3364 src/qt-console/bat.pro.mingw64 \
3365 src/qt-console/install_conf_file \
3366 src/qt-console/tray-monitor/tray-monitor.conf \
3367 src/qt-console/tray-monitor/tray-monitor.pro \
3368 src/qt-console/tray-monitor/tray-monitor.pro.mingw32 \
3369 src/qt-console/tray-monitor/tray-monitor.pro.mingw64 \
3371 src/dird/bacula-dir.conf \
3373 src/stored/Makefile \
3374 src/stored/bacula-sd.conf \
3375 src/filed/Makefile \
3376 src/filed/bacula-fd.conf \
3378 src/cats/make_catalog_backup.pl \
3379 src/cats/make_catalog_backup \
3380 src/cats/delete_catalog_backup \
3381 src/cats/create_postgresql_database \
3382 src/cats/update_postgresql_tables \
3383 src/cats/make_postgresql_tables \
3384 src/cats/grant_postgresql_privileges \
3385 src/cats/drop_postgresql_tables \
3386 src/cats/drop_postgresql_database \
3387 src/cats/create_mysql_database \
3388 src/cats/update_mysql_tables \
3389 src/cats/make_mysql_tables \
3390 src/cats/grant_mysql_privileges \
3391 src/cats/drop_mysql_tables \
3392 src/cats/drop_mysql_database \
3393 src/cats/create_sqlite3_database \
3394 src/cats/update_sqlite3_tables \
3395 src/cats/make_sqlite3_tables \
3396 src/cats/grant_sqlite3_privileges \
3397 src/cats/drop_sqlite3_tables \
3398 src/cats/drop_sqlite3_database \
3401 src/cats/create_bacula_database \
3402 src/cats/update_bacula_tables \
3403 src/cats/grant_bacula_privileges \
3404 src/cats/make_bacula_tables \
3405 src/cats/drop_bacula_tables \
3406 src/cats/drop_bacula_database \
3407 src/cats/install-default-backend \
3408 src/findlib/Makefile \
3409 src/tools/Makefile \
3410 src/plugins/fd/Makefile \
3411 src/plugins/sd/Makefile \
3412 src/plugins/dir/Makefile \
3413 src/win32/Makefile.inc \
3415 updatedb/update_mysql_tables \
3416 updatedb/update_sqlite3_tables \
3417 updatedb/update_postgresql_tables \
3418 updatedb/update_mysql_tables_9_to_10 \
3419 updatedb/update_sqlite3_tables_9_to_10 \
3420 updatedb/update_postgresql_tables_9_to_10 \
3421 updatedb/update_mysql_tables_10_to_11 \
3422 updatedb/update_sqlite3_tables_10_to_11 \
3423 updatedb/update_postgresql_tables_10_to_11 \
3424 updatedb/update_mysql_tables_11_to_12 \
3425 updatedb/update_sqlite3_tables_11_to_12 \
3426 updatedb/update_postgresql_tables_11_to_12 \
3427 examples/nagios/check_bacula/Makefile \
3428 platforms/rpms/redhat/bacula.spec \
3429 platforms/rpms/redhat/bacula-bat.spec \
3430 platforms/rpms/redhat/bacula-docs.spec \
3431 platforms/rpms/redhat/bacula-mtx.spec \
3432 platforms/rpms/suse/bacula.spec \
3433 platforms/rpms/suse/bacula-bat.spec \
3434 platforms/rpms/suse/bacula-docs.spec \
3435 platforms/rpms/suse/bacula-mtx.spec \
3440 if test "${support_bat}" = "yes" ; then
3441 if test "x$QMAKE" = "xnone"; then
3442 AC_MSG_ERROR([Could not find qmake $PATH. Check your Qt installation])
3446 echo "Creating bat Makefile"
3457 dnl if CC is gcc, we can rebuild the dependencies (since the depend rule
3458 dnl requires gcc). If it's not, don't rebuild dependencies
3460 if test X"$GCC" = "Xyes" ; then
3461 echo "Doing make of dependencies"
3462 ${MAKE:-make} depend
3466 chmod 755 install_conf_file build-depkgs-qt-console
3470 chmod 755 bacula btraceback mtx-changer
3471 chmod 755 dvd-handler dvd-simulator
3472 chmod 755 bconsole disk-changer devel_bacula logrotate
3476 chmod 755 $c/update_mysql_tables_10_to_11 $c/update_sqlite3_tables_10_to_11
3477 chmod 755 $c/update_postgresql_tables_10_to_11
3478 chmod 755 $c/update_mysql_tables_11_to_12 $c/update_sqlite3_tables_11_to_12
3479 chmod 755 $c/update_postgresql_tables_11_to_12
3484 chmod 755 $c/create_bacula_database $c/update_bacula_tables $c/make_bacula_tables
3485 chmod 755 $c/grant_bacula_privileges $c/drop_bacula_tables $c/drop_bacula_database
3487 chmod 755 $c/create_mysql_database $c/update_mysql_tables $c/make_mysql_tables
3488 chmod 755 $c/grant_mysql_privileges $c/drop_mysql_tables $c/drop_mysql_database
3490 chmod 755 $c/create_sqlite3_database $c/update_sqlite3_tables $c/make_sqlite3_tables
3491 chmod 755 $c/grant_sqlite3_privileges $c/drop_sqlite3_tables $c/drop_sqlite3_database
3493 chmod 755 $c/create_postgresql_database $c/update_postgresql_tables $c/make_postgresql_tables
3494 chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables $c/drop_postgresql_database
3496 chmod 755 $c/make_catalog_backup $c/delete_catalog_backup $c/make_catalog_backup.pl
3500 chmod 755 $c/install-default-backend
3502 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
3503 largefile_support="yes"
3506 dnl Only try to find out the version number of the compiler when we know its some kind of GCC compiler
3507 if test X"$GCC" = "Xyes" ; then
3509 dnl A whole lot of hand springs to get the compiler version.
3510 dnl This is because gcc changed the output in version 3.0
3512 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3513 if test "x${CCVERSION}" = "x" ; then
3514 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3516 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3517 if test x"${CXXVERSION}" = x ; then
3518 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3522 # clean up any old junk
3529 Configuration on `date`:
3531 Host: ${host}${post_host} -- ${DISTNAME} ${DISTVER}
3532 Bacula version: ${BACULA} ${VERSION} (${DATE})
3533 Source code location: ${srcdir}
3534 Install binaries: ${sbindir}
3535 Install libraries: ${libdir}
3536 Install config files: ${sysconfdir}
3537 Scripts directory: ${scriptdir}
3538 Archive directory: ${archivedir}
3539 Working directory: ${working_dir}
3540 PID directory: ${piddir}
3541 Subsys directory: ${subsysdir}
3542 Man directory: ${mandir}
3543 Data directory: ${datarootdir}
3544 Plugin directory: ${plugindir}
3545 C Compiler: ${CC} ${CCVERSION}
3546 C++ Compiler: ${CXX} ${CXXVERSION}
3547 Compiler flags: ${WCFLAGS} ${CFLAGS}
3548 Linker flags: ${WLDFLAGS} ${LDFLAGS}
3550 Statically Linked Tools: ${support_static_tools}
3551 Statically Linked FD: ${support_static_fd}
3552 Statically Linked SD: ${support_static_sd}
3553 Statically Linked DIR: ${support_static_dir}
3554 Statically Linked CONS: ${support_static_cons}
3555 Database backends: ${db_backends}
3556 Database port: ${db_port}
3557 Database name: ${db_name}
3558 Database user: ${db_user}
3559 Database SSL options: ${db_ssl_options}
3561 Job Output Email: ${job_email}
3562 Traceback Email: ${dump_email}
3563 SMTP Host Address: ${smtp_host}
3565 Director Port: ${dir_port}
3566 File daemon Port: ${fd_port}
3567 Storage daemon Port: ${sd_port}
3569 Director User: ${dir_user}
3570 Director Group: ${dir_group}
3571 Storage Daemon User: ${sd_user}
3572 Storage DaemonGroup: ${sd_group}
3573 File Daemon User: ${fd_user}
3574 File Daemon Group: ${fd_group}
3576 Large file support: $largefile_support
3577 Bacula conio support: ${got_conio} ${CONS_LIBS}
3578 readline support: ${got_readline} ${PRTREADLINE_SRC}
3579 TCP Wrappers support: ${TCPW_MSG} ${WRAPLIBS}
3580 TLS support: ${support_tls}
3581 Encryption support: ${support_crypto}
3582 ZLIB support: ${have_zlib}
3583 LZO support: ${have_lzo}
3584 enable-smartalloc: ${support_smartalloc}
3585 enable-lockmgr: ${support_lockmgr}
3586 bat support: ${support_bat}
3587 client-only: ${build_client_only}
3588 build-dird: ${build_dird}
3589 build-stored: ${build_stored}
3590 Plugin support: ${have_plugins}
3591 AFS support: ${have_afs}
3592 ACL support: ${have_acl}
3593 XATTR support: ${have_xattr}
3594 systemd support: ${support_systemd} ${SYSTEMD_UNITDIR}
3595 Batch insert enabled: ${batch_insert_db_backends}
3599 # create a small shell script useful for support with
3600 # configure options and config.out info
3601 cat > scripts/bacula_config << EOF
3604 $ $0 $ac_configure_args
3606 cat config.out >> scripts/bacula_config
3607 echo __EOC__ >> scripts/bacula_config
3608 chmod 755 scripts/bacula_config