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(VIX_VERSION)dnl
54 AC_SUBST(JAVA_VERSION)dnl
55 AC_SUBST(NDMP_VERSION)dnl
56 AC_SUBST(LIBRSYNC_VERSION)dnl
60 dnl can be overwritten by specific values from version.h
61 LIBBAC_LT_RELEASE=`sed -n -e 's/^#.*LIBBAC_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
62 LIBBACCFG_LT_RELEASE=`sed -n -e 's/^#.*LIBBACCFG_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
63 LIBBACPY_LT_RELEASE=`sed -n -e 's/^#.*LIBBACPY_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
65 LIBBAC_LT_RELEASE=${LIBBAC_LT_RELEASE:-$VERSION}
66 LIBBACCFG_LT_RELEASE=${LIBBACCFG_LT_RELEASE:-$VERSION}
68 AC_SUBST(LIBBAC_LT_RELEASE)dnl
69 AC_SUBST(LIBBACCFG_LT_RELEASE)dnl
72 dnl can be overwritten by specific values from version.h
73 LIBBACSQL_LT_RELEASE=`sed -n -e 's/^#.*LIBBACSQL_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
74 LIBBACCATS_LT_RELEASE=`sed -n -e 's/^#.*LIBBACCATS_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
76 LIBBACSQL_LT_RELEASE=${LIBBACSQL_LT_RELEASE:-$VERSION}
77 LIBBACCATS_LT_RELEASE=${LIBBACCATS_LT_RELEASE:-$VERSION}
79 AC_SUBST(LIBBACSQL_LT_RELEASE)dnl
80 AC_SUBST(LIBBACCATS_LT_RELEASE)dnl
83 dnl can be overwritten by specific values from version.h
84 LIBBACFIND_LT_RELEASE=`sed -n -e 's/^#.*LIBBACFIND_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
86 LIBBACFIND_LT_RELEASE=${LIBBACFIND_LT_RELEASE:-$VERSION}
88 AC_SUBST(LIBBACFIND_LT_RELEASE)dnl
90 dnl PFILES are platform or plugin specific files
91 PFILES="platforms/Makefile"
93 echo "configuring for ${BACULA} $VERSION ($DATE)"
96 dnl -------------------------------------------------------
97 dnl Check for compiler.
98 dnl ------------------------------------------------------
100 AC_PROG_CC dnl this sets $GCC if using GNU C compiler
102 AC_PROG_CC_C_O dnl Determine if C compiler support -c -o.
103 AC_PROG_GCC_TRADITIONAL dnl Determine if ioctl() need -traditional.
105 BASECC=`basename $CC`
107 if test x"$GCC" = "xyes"; then
111 AC_PATH_PROG(CXX, $CXX, $CXX)
112 if test ! -e $CXX; then
113 AC_MSG_ERROR(Unable to find C++ compiler)
116 dnl -------------------------------------------------------
117 dnl Check for programs.
118 dnl ------------------------------------------------------
120 AC_PATH_PROG(MV, mv, mv)
122 dnl If we name the variable RM it will shadow the RM variable in the configure script and we overwrite the
123 dnl value with the name of the rm command and not rm -f which is its normal content. This gives all kind
124 dnl of strange output of the configure script (like things don't exist etc.).
125 dnl So we name it REMOVE (more software has run into this problem)
126 AC_PATH_PROG(REMOVE, rm, rm)
127 AC_PATH_PROG(CP, cp, cp)
128 AC_PATH_PROG(SED, sed, sed)
129 AC_PATH_PROG(ECHO, echo, echo)
130 AC_PATH_PROG(CMP, cmp, cmp)
131 AC_PATH_PROG(TBL, tbl, tbl)
132 AC_PATH_PROG(AR, ar, ar)
133 AC_PATH_PROG(OPENSSL, openssl, none)
134 AC_PATH_PROG(MTX, mtx, mtx)
135 AC_PATH_PROG(DD, dd, dd)
136 AC_PATH_PROG(MKISOFS, mkisofs, mkisofs)
137 AC_PATH_PROG(PYTHON, python, python)
138 AC_PATH_PROG(GROWISOFS, growisofs, growisofs)
139 AC_PATH_PROG(DVDRWMEDIAINFO, dvd+rw-mediainfo, dvd+rw-mediainfo)
140 AC_PATH_PROG(DVDRWFORMAT, dvd+rw-format, dvd+rw-format)
141 AC_PATH_PROG(PKGCONFIG, pkg-config, pkg-config)
142 AC_PATH_PROG(QMAKE, qmake, none)
143 AC_PATH_PROG(GMAKE, gmake, none)
144 AC_PATH_PROG(PIDOF, pidof, pidof)
146 # Some AWK programs fail, so test it and warn the user
147 if echo xfoo | $AWK 'BEGIN { prog=ARGV[1]; ARGC=1 }
148 { if ((prog == $2) || (("(" prog ")") == $2) ||
149 (("[" prog "]") == $2) ||
150 ((prog ":") == $2)) { print $1 ; exit 0 } }' xfoo>/dev/null; then :;
152 AC_MSG_ERROR([!!!!!!!!! WARNING !!!!!!!!!!!!!!
153 The regex engine of $AWK is too broken to be used you
154 might want to install GNU AWK.
155 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!])
158 AC_PATH_PROG(AWK, $THE_AWK, $THE_AWK)
161 test -n "$ARFLAG" || ARFLAGS="cr"
168 AC_SUBST(LOCAL_CFLAGS)
169 AC_SUBST(LOCAL_LDFLAGS)
172 dnl --------------------------------------------------
174 dnl --------------------------------------------------
176 AC_ARG_ENABLE(libtool,
177 AC_HELP_STRING([--enable-libtool], [enable building using GNU libtool @<:@default=yes@:>@]),
179 if test x$enableval = xno; then
184 LT_INIT([shared disable-static])
188 if test x$use_libtool != xno; then
189 DEFAULT_OBJECT_TYPE=".lo"
190 DEFAULT_ARCHIVE_TYPE=".la"
191 DEFAULT_SHARED_OBJECT_TYPE=".la"
192 LIBTOOL="\$(LIBTOOL)"
193 LIBTOOL_INSTALL_TARGET="libtool-install"
194 LIBTOOL_UNINSTALL_TARGET="libtool-uninstall"
195 LIBTOOL_CLEAN_TARGET="libtool-clean"
196 QMAKE_LIBTOOL="${BUILD_DIR}/libtool"
197 FD_PLUGIN_DIR="src/plugins/fd"
200 DEFAULT_OBJECT_TYPE=".o"
201 DEFAULT_ARCHIVE_TYPE=".a"
202 DEFAULT_SHARED_OBJECT_TYPE=".so"
203 LIBTOOL="# \$(LIBTOOL)"
204 LIBTOOL_INSTALL_TARGET=""
205 LIBTOOL_UNINSTALL_TARGET=""
206 LIBTOOL_CLEAN_TARGET=""
207 QMAKE_LIBTOOL="# ${BUILD_DIR}/libtool"
212 AC_SUBST(DEFAULT_OBJECT_TYPE)
213 AC_SUBST(DEFAULT_ARCHIVE_TYPE)
214 AC_SUBST(DEFAULT_SHARED_OBJECT_TYPE)
216 AC_SUBST(LIBTOOL_INSTALL_TARGET)
217 AC_SUBST(LIBTOOL_UNINSTALL_TARGET)
218 AC_SUBST(LIBTOOL_CLEAN_TARGET)
219 AC_SUBST(QMAKE_LIBTOOL)
220 AC_SUBST(FD_PLUGIN_DIR)
222 dnl --------------------------------------------------
223 dnl Include file handling
224 dnl --------------------------------------------------
225 AC_ARG_ENABLE(includes,
226 AC_HELP_STRING([--enable-includes], [enable installing of include files @<:@default=no@:>@]),
228 if test x$enableval = xyes; then
234 dnl It only makes sense to install include files when you install libraries which only happens when
235 dnl libtool is enabled
237 if test x$use_libtool != xno -a x$install_includes = xyes; then
238 INCLUDE_INSTALL_TARGET="install-includes"
239 INCLUDE_UNINSTALL_TARGET="uninstall-includes"
241 INCLUDE_INSTALL_TARGET=""
242 INCLUDE_UNINSTALL_TARGET=""
244 AC_SUBST(INCLUDE_INSTALL_TARGET)
245 AC_SUBST(INCLUDE_UNINSTALL_TARGET)
247 dnl --------------------------------------------------
248 dnl Bacula OP Sys determination (see aclocal.m4)
249 dnl --------------------------------------------------
252 dnl -----------------------------------------------------------
253 dnl Bacula OPSys Distribution determination (see aclocal.m4)
254 dnl ----------------------------------------------------------
255 BA_CHECK_OPSYS_DISTNAME
257 dnl --------------------------------------------------
258 dnl Suppport for gettext (translations)
259 dnl By default, $datarootdir is ${prefix}/share
260 dnl --------------------------------------------------
261 AM_GNU_GETTEXT([external])
263 dnl ------------------------------------------------------------------
264 dnl If the user has not set --prefix, we set our default to nothing.
265 dnl In this case, if the user has not set --sysconfdir, we set it
266 dnl to the package default of /etc/bacula. If either --prefix or
267 dnl --sysconfdir is set, we leave sysconfdir alone except to eval it.
268 dnl If the user has not set --libdir, we set it to the package
269 dnl default of /usr/lib. If either --prefix or --libdir is set,
270 dnl we leave libdir alone except to eval it. If the user has not set
271 dnl --includedir, we set it to the package default of /usr/include.
272 dnl If either --prefix or --includedir is set, we leave includedir
273 dnl alone except to eval it
274 dnl ------------------------------------------------------------------
275 os_name=`uname -s 2>/dev/null`
276 if test x${prefix} = xNONE ; then
277 if test `eval echo ${sysconfdir}` = NONE/etc ; then
278 sysconfdir=/etc/bacula
281 if test `eval echo ${libdir}` = NONE/lib ; then
284 os_processor=`uname -p 2>/dev/null`
285 case ${os_processor} in
300 if test `eval echo ${includedir}` = NONE/include ; then
301 includedir=/usr/include
304 if test `eval echo ${datarootdir}` = NONE/share ; then
305 datarootdir=/usr/share
310 dnl -------------------------------------------------------------------------
311 dnl If the user has not set --exec-prefix, we default to ${prefix}
312 dnl -------------------------------------------------------------------------
313 if test x${exec_prefix} = xNONE ; then
314 exec_prefix=${prefix}
317 sysconfdir=`eval echo ${sysconfdir}`
318 datarootdir=`eval echo ${datarootdir}`
319 docdir=`eval echo ${docdir}`
320 htmldir=`eval echo ${htmldir}`
321 libdir=`eval echo ${libdir}`
322 includedir=`eval echo ${includedir}`
323 localedir=`eval echo ${datarootdir}/locale`
324 AC_DEFINE_UNQUOTED(SYSCONFDIR, "$sysconfdir")
325 AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir")
327 dnl ------------------------------------------------------------------
328 dnl If the user has not set --sbindir, we set our default as /sbin
329 dnl ------------------------------------------------------------------
330 if test x$sbindir = x'${exec_prefix}/sbin' ; then
331 sbindir=${exec_prefix}/sbin
333 sbindir=`eval echo ${sbindir}`
335 dnl -------------------------------------------------------------------------
336 dnl If the user has not set --mandir, we default to /usr/share/man
337 dnl -------------------------------------------------------------------------
338 if test x$mandir = x'${prefix}/man' ; then
339 mandir=/usr/share/man
342 dnl -------------------------------------------------------------------------
343 dnl If the user has not set --htmldir, we default to /usr/share/doc/bacula/html
344 dnl -------------------------------------------------------------------------
345 if test x$htmldir = x'/usr/share/doc/bacula/' ; then
346 htmldir=`eval echo ${docdir}html`
349 dnl -------------------------------------------------------------------------
350 dnl If the user has not set --docdir, we default to /usr/share/doc/bacula
351 dnl -------------------------------------------------------------------------
352 if test x$docdir = x'/usr/share/doc/' ; then
353 docdir=`eval echo ${docdir}bacula`
357 AC_PATH_PROGS(MSGFMT, msgfmt, no)
358 if test "$MSGFMT" = "no"
360 echo 'msgfmt program not found, disabling NLS !'
362 USE_INCLUDED_LIBINTL=no
367 support_smartalloc=yes
374 support_static_tools=no
377 support_static_dir=no
378 support_static_cons=no
383 batch_insert_db_backends=""
386 dnl --------------------------------------------------------------------------
387 dnl CHECKING COMMAND LINE OPTIONS
388 dnl --------------------------------------------------------------------------
390 dnl -------------------------------------------
391 dnl bat (default off)
392 dnl -------------------------------------------
394 AC_HELP_STRING([--enable-bat], [enable build of bat Qt GUI @<:@default=no@:>@]),
396 if test x$enableval = xyes; then
397 AC_DEFINE(HAVE_BAT, 1, [Set if Bacula bat Qt GUI support enabled])
404 if test x$support_bat = xyes; then
406 abc=`$PKGCONFIG QtGui`
408 if test $pkg = 0; then
409 BAT_DIR=src/qt-console
412 abc=`$PKGCONFIG Qt5Gui`
414 if test $pkg = 0; then
415 BAT_DIR=src/qt-console
417 AC_MSG_ERROR(Unable to find either Qt4 or Qt5 installation needed by bat)
424 AC_SUBST(QWT_LDFLAGS)
428 dnl -------------------------------------------
429 dnl smartalloc (default off)
430 dnl -------------------------------------------
431 AC_ARG_ENABLE(smartalloc,
432 AC_HELP_STRING([--enable-smartalloc], [enable smartalloc debugging support @<:@default=no@:>@]),
434 if test x$enableval = xno; then
435 support_smartalloc=no
440 if test x$support_smartalloc = xyes; then
441 AC_DEFINE(SMARTALLOC, 1, [Set if you want Smartalloc enabled])
444 dnl -------------------------------------------
445 dnl Lock Manager (default off)
446 dnl -------------------------------------------
447 AC_ARG_ENABLE(lockmgr,
448 AC_HELP_STRING([--enable-lockmgr], [enable lock manager support @<:@default=no@:>@]),
450 if test x$enableval = xyes; then
456 if test x$support_lockmgr = xyes; then
457 AC_DEFINE(USE_LOCKMGR, 1, [Set if you want Lock Manager enabled])
461 dnl -------------------------------------------
462 dnl static-tools (default off)
463 dnl -------------------------------------------
464 AC_ARG_ENABLE(static-tools,
465 AC_HELP_STRING([--enable-static-tools], [enable static tape tools @<:@default=no@:>@]),
467 if test x$enableval = xyes; then
468 if test x$use_libtool = xyes; then
469 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
470 please rerun configure with --disable-libtool])
472 support_static_tools=yes
478 if test x$support_static_tools = xyes; then
479 TTOOL_LDFLAGS="-static"
481 AC_SUBST(TTOOL_LDFLAGS)
483 dnl -------------------------------------------
484 dnl static-fd (default off)
485 dnl -------------------------------------------
486 AC_ARG_ENABLE(static-fd,
487 AC_HELP_STRING([--enable-static-fd], [enable static File daemon @<:@default=no@:>@]),
489 if test x$enableval = xyes; then
490 if test x$use_libtool = xyes; then
491 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
492 please rerun configure with --disable-libtool])
494 support_static_fd=yes
500 if test x$support_static_fd = xyes; then
501 STATIC_FD="static-bacula-fd"
505 dnl -------------------------------------------
506 dnl static-sd (default off)
507 dnl -------------------------------------------
508 AC_ARG_ENABLE(static-sd,
509 AC_HELP_STRING([--enable-static-sd], [enable static Storage daemon @<:@default=no@:>@]),
511 if test x$enableval = xyes; then
512 if test x$use_libtool = xyes; then
513 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
514 please rerun configure with --disable-libtool])
516 support_static_sd=yes
522 if test x$support_static_sd = xyes; then
523 STATIC_SD="static-bacula-sd"
527 dnl -------------------------------------------
528 dnl static-dir (default off)
529 dnl -------------------------------------------
530 AC_ARG_ENABLE(static-dir,
531 AC_HELP_STRING([--enable-static-dir], [enable static Director @<:@default=no@:>@]),
533 if test x$enableval = xyes; then
534 if test x$use_libtool = xyes; then
535 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
536 please rerun configure with --disable-libtool])
538 support_static_dir=yes
544 if test x$support_static_dir = xyes; then
545 STATIC_DIR="static-bacula-dir"
549 dnl -------------------------------------------
550 dnl static-cons (default off)
551 dnl -------------------------------------------
552 AC_ARG_ENABLE(static-cons,
553 AC_HELP_STRING([--enable-static-cons], [enable static Console @<:@default=no@:>@]),
555 if test x$enableval = xyes; then
556 if test x$use_libtool = xyes; then
557 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
558 please rerun configure with --disable-libtool])
560 support_static_cons=yes
566 if test x$support_static_cons = xyes; then
567 STATIC_CONS="static-bconsole"
569 AC_SUBST(STATIC_CONS)
571 dnl -------------------------------------------
572 dnl client_only (default off)
573 dnl -------------------------------------------
574 AC_ARG_ENABLE(client-only,
575 AC_HELP_STRING([--enable-client-only], [build client (File daemon) only @<:@default=no@:>@]),
577 if test x$enableval = xyes; then
578 build_client_only=yes
584 if test x$build_client_only = xno; then
591 dnl -------------------------------------------
592 dnl director (default on)
593 dnl -------------------------------------------
594 AC_ARG_ENABLE(build-dird,
595 AC_HELP_STRING([--enable-build-dird], [enable building of dird (Director) @<:@default=yes@:>@]),
597 if test x$enableval = xno; then
609 dnl -------------------------------------------
610 dnl stored (default on)
611 dnl -------------------------------------------
612 AC_ARG_ENABLE(build-stored,
613 AC_HELP_STRING([--enable-build-stored], [enable building of stored (Storage daemon) @<:@default=yes@:>@]),
615 if test x$enableval = xno; then
620 if test x$build_stored = xyes; then
621 STORED_DIR="src/stored"
627 dnl ---------------------------------------------------
628 dnl Check for conio (Bacula readline substitute)(
629 dnl ---------------------------------------------------
630 dnl this allows you to turn it completely off
632 AC_HELP_STRING([--disable-conio], [disable conio support @<:@default=no@:>@]),
634 if test x$enableval = xno; then
641 dnl ---------------------------------------------------
642 dnl Check for IPv6 support
643 dnl ---------------------------------------------------
644 dnl this allows you to turn it completely off
647 AC_HELP_STRING([--enable-ipv6], [enable ipv6 support @<:@default=yes@:>@]),
649 if test x$enableval = xno; then
655 if test x$support_ipv6 = xyes; then
656 AC_TRY_LINK([ #include <sys/types.h>
657 #include <sys/socket.h>
658 #include <netinet/in.h>], [struct in6_addr t=in6addr_any; t.s6_addr[0] = 0;],
659 [support_in6addr_any=yes], [support_in6addr_any=no])
661 if test x$support_in6addr_any = xno ; then
662 in6addr_any="const struct in6_addr in6addr_any"
667 AC_TRY_LINK([ #include <sys/types.h>
668 #include <sys/socket.h>
669 #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;],
670 [support_ipv6=yes], [support_ipv6=no])
673 if test x$support_ipv6 = xyes; then
674 AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
676 if test x$support_in6addr_any = xno ; then
677 AC_DEFINE(NEED_IN6ADDR_ANY,1,[Whether to have in6addr_any support])
682 AC_CHECK_HEADER(curses.h, [
683 AC_CHECK_LIB(tinfo, tgetent, [ TERM_LIB="-ltinfo" ], [
684 AC_CHECK_LIB(ncurses, tgetent, [ TERM_LIB="-lncurses" ], [
685 AC_CHECK_LIB(termcap, tgetent, [ TERM_LIB="-ltermcap" ])
689 [ AC_CHECK_HEADERS(curses.h)
690 AC_CHECK_HEADER(term.h,
691 [ AC_CHECK_LIB(curses, tgetent,
692 [ TERM_LIB="-lcurses" ] )
698 if test x$support_conio = xyes; then
699 if test x$TERM_LIB != x; then
705 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
707 echo " "; echo "Required libraries not found. CONIO turned off ..."; echo " "
712 dnl ---------------------------------------------------
713 dnl Check for readline support/directory (default off)
714 dnl ---------------------------------------------------
715 dnl this allows you to turn it completely off
716 AC_ARG_ENABLE(readline,
717 AC_HELP_STRING([--disable-readline], [disable readline support @<:@default=yes@:>@]),
719 if test x$enableval = xno; then
727 if test x$support_readline = xyes; then
728 AC_ARG_WITH(readline,
729 AC_HELP_STRING([--with-readline@<:@=DIR@:>@], [specify readline library directory]),
731 case "$with_readline" in
736 if test -f ${with_readline}/readline.h; then
737 CONS_INC="-I${with_readline}"
738 CONS_LDFLAGS="-L$with_readline"
739 elif test -f ${with_readline}/include/readline/readline.h; then
740 CONS_INC="-I${with_readline}/include/readline"
741 CONS_LDFLAGS="-L${with_readline}/lib"
742 with_readline="${with_readline}/include/readline"
744 with_readline="/usr/include/readline"
747 AC_CHECK_HEADER(${with_readline}/readline.h,
749 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
750 CONS_LIBS="-lreadline -lhistory ${TERM_LIB}"
754 echo "readline.h not found. readline turned off ..."
761 dnl check for standard readline library
762 AC_CHECK_HEADER(/usr/include/readline/readline.h,
764 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
766 CONS_INC="-I/usr/include/readline"
767 CONS_LIBS="-lreadline ${TERM_LIB}"
769 dnl Did not find standard library, so try Bacula's default
770 AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h,
772 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
774 CONS_INC="-I${TOP_DIR}/depkgs/readline"
775 CONS_LIBS="-lreadline -lhistory ${TERM_LIB}"
776 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
777 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
780 echo "readline.h not found. readline turned off ..."
794 AC_SUBST(CONS_LDFLAGS)
795 AC_SUBST(READLINE_SRC)
797 dnl Minimal stuff for readline Makefile configuration
802 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr)
803 AC_CHECK_FUNCS(lstat lchown lchmod futimes fchmod fchown lutimes)
804 AC_CHECK_FUNCS(nanosleep nl_langinfo)
805 AC_CHECK_FUNCS(be64toh htobe64)
806 AC_CHECK_HEADERS(varargs.h)
808 dnl End of readline/conio stuff
809 dnl -----------------------------------------------------------------------
812 dnl Find where sockets are (especially for Solaris)
813 dnl Do this before the TCP Wrappers test since tcp wrappers
814 dnl uses the socket library and some linkers are stupid.
816 AC_CHECK_FUNC(socket,
817 AC_MSG_RESULT(using libc's socket),
818 AC_CHECK_LIB(xnet,socket)
819 AC_CHECK_LIB(socket,socket)
820 AC_CHECK_LIB(inet,socket))
822 dnl -----------------------------------------------------------
823 dnl Check whether user wants TCP wrappers support (default off)
824 dnl -----------------------------------------------------------
827 AC_ARG_WITH(tcp-wrappers,
828 AC_HELP_STRING([--with-tcp-wrappers@<:@=DIR@:>@], [enable tcpwrappers support]),
830 if test "x$withval" != "xno" ; then
832 LIBS="$saved_LIBS -lwrap"
833 AC_SEARCH_LIBS(nanosleep, [rt])
834 AC_MSG_CHECKING(for libwrap)
837 #include <sys/types.h>
839 int deny_severity = 0;
840 int allow_severity = 0;
841 struct request_info *req;
846 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
851 LIBS="$saved_LIBS -lwrap -lnsl"
852 WRAPLIBS="$saved_LIBS -lwrap -lnsl"
855 #include <sys/types.h>
857 int deny_severity = 0;
858 int allow_severity = 0;
859 struct request_info *req;
864 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
869 AC_MSG_ERROR([*** libwrap missing])
878 dnl -----------------------------------------------------------
879 dnl Check whether OpenSSL is available
880 dnl -----------------------------------------------------------
881 AC_MSG_CHECKING([for OpenSSL])
882 dnl The following uses quadrigraphs:
886 AC_HELP_STRING([--with-openssl@<:@=DIR@:>@], [Include OpenSSL support. DIR is the OpenSSL base]),
888 with_openssl_directory=${withval}
892 if test "x$with_openssl_directory" != "xno"; then
893 OPENSSL_LIBS="-lssl -lcrypto"
896 if test "x$with_openssl_directory" != "xyes" && test x"${with_openssl_directory}" != "x"; then
898 # Make sure the $with_openssl_directory also makes sense
900 if test -d "$with_openssl_directory/lib" -a -d "$with_openssl_directory/include"; then
901 OPENSSL_LIBS="-L$with_openssl_directory/lib $OPENSSL_LIBS"
902 OPENSSL_INC="-I$with_openssl_directory/include $OPENSSL_INC"
907 saved_CFLAGS="${CFLAGS}"
908 LIBS="${saved_LIBS} ${OPENSSL_LIBS}"
909 CFLAGS="${saved_CFLAGS} ${OPENSSL_INC}"
913 #include <openssl/ssl.h>
915 CRYPTO_set_id_callback(NULL);
927 #include <openssl/evp.h>
931 ac_cv_openssl_sha2="yes"
933 ac_cv_openssl_sha2="no"
937 dnl Solaris disables greater than 128+ bit encryption in their OpenSSL
938 dnl implementation, presumably for export reasons. If 192bit AES
939 dnl is available, we assume that we're running with a 'non-export'
943 #include <openssl/evp.h>
947 ac_cv_openssl_export="no"
949 ac_cv_openssl_export="yes"
953 AC_MSG_RESULT([$support_tls])
954 if test "$support_tls" = "yes"; then
955 AC_DEFINE(HAVE_OPENSSL, 1, [Define if OpenSSL library is available])
956 AC_DEFINE(HAVE_TLS, 1, [Define if TLS support should be enabled])
957 AC_DEFINE(HAVE_CRYPTO, 1, [Define if encryption support should be enabled])
960 if test "$ac_cv_openssl_sha2" = "yes"; then
961 AC_DEFINE(HAVE_SHA2, 1, [Define if the SHA-2 family of digest algorithms is available])
964 if test "$ac_cv_openssl_export" = "yes"; then
965 AC_DEFINE(HAVE_OPENSSL_EXPORT_LIBRARY, 1, [Define if the OpenSSL library is export-contrained to 128bit ciphers])
968 if test "$support_crypto" = "yes"; then
969 AC_CHECK_LIB(crypto, EVP_PKEY_encrypt_old, AC_DEFINE(HAVE_OPENSSLv1, 1, [Set if have OpenSSL version 1.x]))
973 CFLAGS="${saved_CFLAGS}"
977 AC_MSG_RESULT([$support_tls])
980 if test "$support_tls" = "no" -o "$support_crypto" = "no"; then
985 AC_SUBST(OPENSSL_LIBS)
986 AC_SUBST(OPENSSL_INC)
988 dnl -----------------------------------------------------------
989 dnl dlopen is needed for plugins
990 dnl -----------------------------------------------------------
991 AC_SEARCH_LIBS(dlopen, [dl])
993 dnl ------------------------------------------
994 dnl Where to place working dir
995 dnl ------------------------------------------
996 working_dir=`eval echo /opt/bacula/working`
997 AC_ARG_WITH(working-dir,
998 AC_HELP_STRING([--with-working-dir=PATH], [specify path of Bacula working directory]),
1000 if test "x$withval" != "xno" ; then
1001 working_dir=$withval
1006 AC_SUBST(working_dir)
1008 dnl ------------------------------------------------------------------
1009 dnl If the user has not set archivedir, we set our default as /tmp
1010 dnl ------------------------------------------------------------------
1012 AC_ARG_WITH(archivedir,
1013 AC_HELP_STRING([--with-archivedir=PATH], [specify path of SD archive directory]),
1015 if test "x$withval" != "xno" ; then
1021 AC_SUBST(archivedir)
1023 dnl ------------------------------------------------------------------
1024 dnl Allow the user to specify the daemon resource name default hostname
1025 dnl ------------------------------------------------------------------
1027 AC_ARG_WITH(basename,
1028 AC_HELP_STRING([--with-basename=RESNAME], [specify base resource name for daemons]),
1030 if test "x$withval" != "xno" ; then
1038 dnl ------------------------------------------------------------------
1039 dnl Allow the user to override the hostname (default = machine hostname)
1040 dnl ------------------------------------------------------------------
1041 hostname=`uname -n | cut -d '.' -f 1`
1042 if test x${hostname} = x ; then
1043 hostname="localhost"
1045 dnl Make sure hostname is resolved
1046 ping -c 1 $hostname 2>/dev/null 1>/dev/null
1047 if test ! $? = 0; then
1048 hostname="localhost"
1050 AC_ARG_WITH(hostname,
1051 AC_HELP_STRING([--with-hostname=RESNAME], [specify host name for daemons]),
1053 if test "x$withval" != "xno" ; then
1062 dnl ------------------------------------------
1063 dnl Where to place scriptdir (script files)
1064 dnl ------------------------------------------
1065 scriptdir=`eval echo ${sysconfdir}`
1066 AC_ARG_WITH(scriptdir,
1067 AC_HELP_STRING([--with-scriptdir=PATH], [specify path of Bacula scripts directory]),
1069 if test "x$withval" != "xno" ; then
1078 dnl ------------------------------------------
1079 dnl Where to place bsrdir (bsr files)
1080 dnl ------------------------------------------
1081 bsrdir=`eval echo /opt/bacula/bsr`
1083 AC_HELP_STRING([--with-bsrdir=PATH], [specify path of Bacula bsrs directory]),
1085 if test "x$withval" != "xno" ; then
1093 dnl ------------------------------------------
1094 dnl Where to place logdir
1095 dnl ------------------------------------------
1096 logdir=`eval echo /opt/bacula/log`
1098 AC_HELP_STRING([--with-logdir=PATH], [specify path of Bacula logs directory]),
1100 if test "x$withval" != "xno" ; then
1109 # ------------------------------------------
1110 # Where to place plugindir (plugin files)
1111 # ------------------------------------------
1112 plugindir=`eval echo ${libdir}`
1113 AC_ARG_WITH(plugindir,
1114 AC_HELP_STRING([--with-plugindir=PATH], [specify path of Bacula plugins directory]),
1116 if test "x$withval" != "xno" ; then
1124 dnl ------------------------------------------
1125 dnl Where to send dump email
1126 dnl ------------------------------------------
1128 dnl ------------------------------------------
1129 dnl Where to send dump email
1130 dnl ------------------------------------------
1131 dump_email=root@localhost
1132 AC_ARG_WITH(dump-email,
1133 AC_HELP_STRING([--with-dump-email=EMAIL], [dump email address]),
1135 if test "x$withval" != "xno" ; then
1141 AC_SUBST(dump_email)
1143 dnl ------------------------------------------
1144 dnl Where to send job email
1145 dnl ------------------------------------------
1146 job_email=root@localhost
1147 AC_ARG_WITH(job-email,
1148 AC_HELP_STRING([--with-job-email=EMAIL], [job output email address]),
1150 if test "x$withval" != "xno" ; then
1158 dnl ------------------------------------------
1159 dnl Where to find smtp host
1160 dnl ------------------------------------------
1162 AC_ARG_WITH(smtp_host,
1163 AC_HELP_STRING([--with-smtp-host=HOST], [SMTP mail host address]),
1165 if test "x$withval" != "xno" ; then
1173 dnl ------------------------------------
1174 dnl Where to place pid files
1175 dnl ------------------------------------
1177 AC_ARG_WITH(pid-dir,
1178 AC_HELP_STRING([--with-pid-dir=PATH], [specify location of Bacula pid files]),
1180 if test "x$withval" != "xno" ; then
1186 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
1189 dnl ------------------------------------
1190 dnl Where to place subsys "lock file"
1191 dnl ------------------------------------
1192 subsysdir=/var/run/subsys
1193 if test -d /var/run/subsys; then
1194 subsysdir=/var/run/subsys
1195 elif test -d /var/lock/subsys; then
1196 subsysdir=/var/lock/subsys
1198 subsysdir=/var/run/subsys
1200 AC_ARG_WITH(subsys-dir,
1201 AC_HELP_STRING([--with-subsys-dir=PATH], [specify location of Bacula subsys file]),
1203 if test "x$withval" != "xno" ; then
1211 dnl ------------------------------------
1212 dnl Where to start assigning ports
1213 dnl ------------------------------------
1215 AC_ARG_WITH(baseport,
1216 AC_HELP_STRING([--with-baseport=PORT], [specify base port address for daemons]),
1218 if test "x$withval" != "xno" ; then
1225 dir_port=`expr $baseport`
1226 fd_port=`expr $baseport + 1`
1227 sd_port=`expr $fd_port + 1`
1233 dnl ------------------------------------------
1234 dnl Generate passwords
1235 dnl ------------------------------------------
1237 AC_ARG_WITH(dir-password,
1238 AC_HELP_STRING([--with-dir-password=PASSWORD], [specify Director's password]),
1240 if test "x$withval" != "xno" ; then
1241 dir_password=$withval
1246 if test "x$dir_password" = "x" ; then
1247 if test "x$OPENSSL" = "xnone" ; then
1248 key=`autoconf/randpass 33`
1250 key=`openssl rand -base64 33`
1256 AC_ARG_WITH(fd-password,
1257 AC_HELP_STRING([--with-fd-password=PASSWORD], [specify Client's password]),
1259 if test "x$withval" != "xno" ; then
1260 fd_password=$withval
1265 if test "x$fd_password" = "x" ; then
1266 if test "x$OPENSSL" = "xnone" ; then
1267 key=`autoconf/randpass 37`
1269 key=`openssl rand -base64 33`
1275 AC_ARG_WITH(sd-password,
1276 AC_HELP_STRING([--with-sd-password=PASSWORD], [specify Storage daemon's password]),
1278 if test "x$withval" != "xno" ; then
1279 sd_password=$withval
1284 if test "x$sd_password" = "x" ; then
1285 if test "x$OPENSSL" = "xnone" ; then
1286 key=`autoconf/randpass 41`
1288 key=`openssl rand -base64 33`
1294 AC_ARG_WITH(mon-dir-password,
1295 AC_HELP_STRING([--with-mon-dir-password=PASSWORD], [specify Director's password used by the monitor]),
1297 if test "x$withval" != "xno" ; then
1298 mon_dir_password=$withval
1303 if test "x$mon_dir_password" = "x" ; then
1304 if test "x$OPENSSL" = "xnone" ; then
1305 key=`autoconf/randpass 33`
1307 key=`openssl rand -base64 33`
1309 mon_dir_password=$key
1313 AC_ARG_WITH(mon-fd-password,
1314 AC_HELP_STRING([--with-mon-fd-password=PASSWORD], [specify Client's password used by the monitor]),
1316 if test "x$withval" != "xno" ; then
1317 mon_fd_password=$withval
1322 if test "x$mon_fd_password" = "x" ; then
1323 if test "x$OPENSSL" = "xnone" ; then
1324 key=`autoconf/randpass 37`
1326 key=`openssl rand -base64 33`
1328 mon_fd_password=$key
1332 AC_ARG_WITH(mon-sd-password,
1333 AC_HELP_STRING([--with-mon-sd-password=PASSWORD], [specify Storage daemon's password used by the monitor]),
1335 if test "x$withval" != "xno" ; then
1336 mon_sd_password=$withval
1341 if test "x$mon_sd_password" = "x" ; then
1342 if test "x$OPENSSL" = "xnone" ; then
1343 key=`autoconf/randpass 41`
1345 key=`openssl rand -base64 33`
1347 mon_sd_password=$key
1350 AC_SUBST(dir_password)
1351 AC_SUBST(fd_password)
1352 AC_SUBST(sd_password)
1353 AC_SUBST(mon_dir_password)
1354 AC_SUBST(mon_fd_password)
1355 AC_SUBST(mon_sd_password)
1358 dnl Pickup any database name
1361 AC_ARG_WITH(db_name,
1362 AC_HELP_STRING([--with-db-name=DBNAME], [specify database name @<:@default=bacula@:>@]),
1364 if test "x$withval" != "x" ; then
1372 AC_ARG_WITH(db_user,
1373 AC_HELP_STRING([--with-db-user=UNAME], [specify database user @<:@default=bacula@:>@]),
1375 if test "x$withval" != "x" ; then
1383 AC_ARG_WITH(db_password,
1384 AC_HELP_STRING([--with-db-password=PWD], [specify database password @<:@default=*none*@:>@]),
1386 if test "x$withval" != "x" ; then
1387 db_password=$withval
1391 AC_SUBST(db_password)
1394 dnl Pickup a database port
1397 AC_ARG_WITH(db_port,
1398 AC_HELP_STRING([--with-db-port=DBPORT], [specify a database port @<:@default=null@:>@]),
1400 if test "x$withval" != "x" ; then
1408 dnl Pickup MySQL SSL options for database user connection
1411 AC_ARG_WITH(db_ssl_options,
1412 AC_HELP_STRING([--with-db-ssl-options=DBSSLOPTIONS], [specify SSL options for database user connection @<:@default=null@:>@]),
1414 if test "x$withval" != "x" ; then
1415 db_ssl_options=$withval
1419 AC_SUBST(db_ssl_options)
1422 # Handle users and groups for each daemon
1425 AC_ARG_WITH(dir_user,
1426 AC_HELP_STRING([--with-dir-user=USER], [specify user for Director daemon]),
1428 if test "x$withval" != "x" ; then
1435 AC_ARG_WITH(dir_group,
1436 AC_HELP_STRING([--with-dir-group=GROUP], [specify group for Director daemon]),
1438 if test "x$withval" != "x" ; then
1445 AC_ARG_WITH(sd_user,
1446 AC_HELP_STRING([--with-sd-user=USER], [specify user for Storage daemon]),
1448 if test "x$withval" != "x" ; then
1455 AC_ARG_WITH(sd_group,
1456 AC_HELP_STRING([--with-sd-group=GROUP], [specify group for Storage daemon]),
1458 if test "x$withval" != "x" ; then
1465 AC_ARG_WITH(fd_user,
1466 AC_HELP_STRING([--with-fd-user=USER], [specify user for File daemon]),
1468 if test "x$withval" != "x" ; then
1475 AC_ARG_WITH(fd_group,
1476 AC_HELP_STRING([--with-fd-group=GROUP], [specify group for File daemon]),
1478 if test "x$withval" != "x" ; then
1492 dnl allow setting default executable permissions
1495 AC_ARG_WITH(sbin-perm,
1496 AC_HELP_STRING([--with-sbin-perm=MODE], [specify permissions for sbin binaries @<:@default=0750@:>@]),
1498 if test "x$withval" != "x" ; then
1506 dnl -------------------------------------------
1507 dnl enable batch attribute DB insert (default on)
1508 dnl -------------------------------------------
1509 support_batch_insert=yes
1510 AC_ARG_ENABLE(batch-insert,
1511 AC_HELP_STRING([--enable-batch-insert], [enable the DB batch insert code @<:@default=yes@:>@]),
1513 if test x$enableval = xno; then
1514 support_batch_insert=no
1519 if test x$support_batch_insert = xyes; then
1520 AC_DEFINE(USE_BATCH_FILE_INSERT, 1, [Set if DB batch insert code enabled])
1523 dnl ------------------------------------------------
1524 dnl Bacula check for various SQL database engines
1525 dnl ------------------------------------------------
1528 dnl Set uncomment_dbi by default to '#' if DBI is enabled this will get reset
1532 BA_CHECK_POSTGRESQL_DB
1538 dnl -------------------------------------------
1539 dnl If no batch insert backend are enable set
1540 dnl variable to None
1541 dnl -------------------------------------------
1542 if test -z "${batch_insert_db_backends}"; then
1543 batch_insert_db_backends="None"
1546 dnl -------------------------------------------
1547 dnl Make sure at least one database backend is found
1548 dnl -------------------------------------------
1549 if test "x${db_backends}" = "x" ; then
1552 echo "You have not specified either --enable-client-only or one of the"
1553 echo "supported databases: MySQL, PostgreSQL, or SQLite3."
1554 echo "This is not permitted. Please reconfigure."
1556 echo "Aborting the configuration ..."
1562 dnl -------------------------------------------
1563 dnl See how many catalog backends are configured.
1564 dnl -------------------------------------------
1565 case `echo $DB_BACKENDS | wc -w | sed -e 's/^ *//'` in
1567 DEFAULT_DB_TYPE="${DB_BACKENDS}"
1568 if test x$use_libtool = xno; then
1569 SHARED_CATALOG_TARGETS=""
1571 SHARED_CATALOG_TARGETS="libbaccats-${DEFAULT_DB_TYPE}.la"
1575 dnl ------------------------------------------------
1576 dnl Set the default backend to the first backend found
1577 dnl ------------------------------------------------
1578 DEFAULT_DB_TYPE=`echo ${DB_BACKENDS} | cut -d' ' -f1`
1580 dnl ------------------------------------------------
1581 dnl For multiple backend we need libtool support.
1582 dnl ------------------------------------------------
1583 if test x$use_libtool = xno; then
1586 echo "You have specified two or more of the"
1587 echo "supported databases: MySQL, PostgreSQL, or SQLite3."
1588 echo "This is not permitted when not using libtool Please reconfigure."
1590 echo "Aborting the configuration ..."
1596 SHARED_CATALOG_TARGETS=""
1597 for db_type in ${DB_BACKENDS}
1599 if test -z "${SHARED_CATALOG_TARGETS}"; then
1600 SHARED_CATALOG_TARGETS="libbaccats-${db_type}.la"
1602 SHARED_CATALOG_TARGETS="${SHARED_CATALOG_TARGETS} libbaccats-${db_type}.la"
1608 dnl -------------------------------------------
1609 dnl Unset DB_LIBS when using libtool as we link the
1610 dnl shared library using the right database lib no need to
1611 dnl set DB_LIBS which is only used for non shared versions
1612 dnl of the backends.
1613 dnl -------------------------------------------
1614 if test x$use_libtool = xyes; then
1618 AC_SUBST(uncomment_dbi)
1619 AC_SUBST(DB_BACKENDS)
1621 AC_SUBST(DEFAULT_DB_TYPE)
1622 AC_SUBST(SHARED_CATALOG_TARGETS)
1624 AC_DEFINE(PROTOTYPES)
1626 dnl --------------------------------------------------------------------------
1627 dnl Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
1629 if test -z "$CFLAGS" -o "$CFLAGS" = "-g -O2"; then
1630 if test -z "$CCOPTS"; then
1631 CCOPTS='-g -O2 -Wall'
1639 dnl See if we can use 64 bit file addresses
1640 largefile_support="no"
1645 dnl --------------------------------------------------------------------------
1646 dnl CHECKING FOR HEADER FILES
1647 dnl --------------------------------------------------------------------------
1686 AC_STRUCT_ST_BLKSIZE
1690 dnl --------------------------------------------------------------------------
1691 dnl Check for utime.h structure
1692 dnl --------------------------------------------------------------------------
1693 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
1697 #include <sys/types.h>
1702 ba_cv_header_utime_h=yes
1704 ba_cv_header_utime_h=no
1709 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H, 1, [Set if utime.h exists])
1711 dnl --------------------------------------------------------------------------
1712 dnl Check for socklen_t
1713 dnl --------------------------------------------------------------------------
1714 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
1718 #include <sys/types.h>
1719 #include <sys/socket.h>
1723 ba_cv_header_socklen_t=yes
1725 ba_cv_header_socklen_t=no
1730 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T, 1, [Set if socklen_t exists])
1732 dnl --------------------------------------------------------------------------
1733 dnl Check for ioctl request type
1734 dnl --------------------------------------------------------------------------
1736 AC_CACHE_CHECK(for ioctl_req_t, ba_cv_header_ioctl_req_t,
1741 #include <sys/types.h>
1742 #include <sys/ioctl.h>
1744 int (*d_ioctl)(int fd, unsigned long int request, ...);
1747 ba_cv_header_ioctl_req_t=yes
1749 ba_cv_header_ioctl_req_t=no
1754 test $ba_cv_header_ioctl_req_t = yes && AC_DEFINE(HAVE_IOCTL_ULINT_REQUEST, 1, [Set if ioctl request is unsigned long int])
1756 dnl Note: it is more correct to use AC_LANG(C++) but some of the older
1757 dnl *BSD systems still use old style C prototypes, which are wrong with
1758 dnl compiled with a C++ compiler.
1761 dnl --------------------------------------------------------------------------
1762 dnl Check for typeof()
1763 dnl --------------------------------------------------------------------------
1765 AC_CACHE_CHECK(for typeof, ba_cv_have_typeof,
1769 main(){char *a = 0; a = (typeof a)a;}
1771 ba_cv_have_typeof=yes
1773 ba_cv_have_typeof=no
1775 ba_cv_have_typeof=no
1780 test $ba_cv_have_typeof = yes && AC_DEFINE([HAVE_TYPEOF], 1, [Defind to 1 if compiler has typeof])
1785 AC_C_BIGENDIAN([AC_DEFINE([HAVE_BIG_ENDIAN], [1], [Big Endian])], [AC_DEFINE([HAVE_LITTLE_ENDIAN], [1], [Little Endian])])
1787 dnl --------------------------------------------------------------------------
1788 dnl CHECKING FOR FILESYSTEM TYPE
1789 dnl --------------------------------------------------------------------------
1790 AC_MSG_CHECKING(how to get filesystem type)
1792 # The order of these tests is important.
1795 #include <sys/statvfs.h>
1796 #include <sys/fstyp.h>
1798 AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4
1800 if test $fstype = no; then
1803 #include <sys/statfs.h>
1804 #include <sys/fstyp.h>
1806 AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3
1809 if test $fstype = no; then
1812 #include <sys/statfs.h>
1813 #include <sys/vmount.h>
1815 AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX
1818 if test $fstype = no; then
1823 AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD
1826 if test $fstype = no; then
1827 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
1829 if test $fstype = no; then
1832 #include <sys/mount.h>
1833 #include <sys/fs_types.h>
1835 AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix
1838 AC_MSG_RESULT($fstype)
1840 AC_CHECK_HEADER(sys/statvfs.h, [ AC_DEFINE(HAVE_SYS_STATVFS_H,1,[Defines if your system have the sys/statvfs.h header file])] , )
1842 AC_CHECK_DECLS([O_CLOEXEC],,[AC_DEFINE([O_CLOEXEC],[0], [Defined to 0 if not provided])],
1849 AC_CHECK_DECLS([FD_CLOEXEC],,[AC_DEFINE([FD_CLOEXEC],[0], [Defined to 0 if not provided])],
1856 AC_CHECK_DECLS([SOCK_CLOEXEC],,[AC_DEFINE([SOCK_CLOEXEC],[0],[Defined to 0 if not provided])],
1858 #ifdef HAVE_SYS_SOCKET_H
1859 # include <sys/socket.h>
1863 AC_CACHE_CHECK(for close on exec modifier for fopen(), ac_cv_feature_stream_cloexec_flag,
1864 [if test $ac_cv_have_decl_O_CLOEXEC = yes ; then
1865 if test $ac_cv_have_decl_SOCK_CLOEXEC = yes ; then
1866 ac_cv_feature_stream_cloexec_flag="e"
1870 if test "x$ac_cv_feature_stream_cloexec_flag" = "xe" ; then
1871 AC_DEFINE(HAVE_STREAM_CLOEXEC,[0],[Defined to 0 if not provided])
1874 AC_DEFINE_UNQUOTED([STREAM_CLOEXEC], "$ac_cv_feature_stream_cloexec_flag", [fopen() modifier for setting close on exec flag])
1876 AC_CHECK_FUNC(accept4, [AC_DEFINE(HAVE_ACCEPT4, 1, [Define to 1 if you have the 'accept4' function.])])
1883 if test x$support_s3 = xyes; then
1885 AC_HELP_STRING([--with-s3@<:@=DIR@:>@], [specify s3 library directory]),
1892 if test -f ${with_s3}/include/libs3.h; then
1893 S3_INC="-I${with_s3}/include"
1894 S3_LDFLAGS="-L${with_s3}/lib"
1895 with_s3="${with_s3}/include"
1897 with_s3="/usr/include"
1900 AC_CHECK_HEADER(${with_s3}/libs3.h,
1902 AC_DEFINE(HAVE_LIBS3, 1, [Define to 1 if you have libs3])
1903 S3_LIBS="${S3_LDFLAGS} -ls3"
1907 echo "libs3.h not found. s3 turned off ..."
1914 AC_CHECK_HEADER(libs3.h,
1916 AC_CHECK_LIB(s3, S3_initialize,
1919 AC_DEFINE(HAVE_LIBS3,1,[Define to 1 if you have libs3])
1930 AC_CHECK_FUNCS(backtrace)
1933 dnl --------------------------------------------------------------------------
1934 dnl CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
1935 dnl --------------------------------------------------------------------------
1945 AC_CHECK_TYPE(ino_t, unsigned long)
1946 AC_CHECK_TYPE(dev_t, unsigned long)
1947 AC_CHECK_TYPE(daddr_t, long)
1948 AC_CHECK_TYPE(major_t, int)
1949 AC_CHECK_TYPE(minor_t, int)
1950 AC_CHECK_TYPE(ssize_t, int)
1957 AC_CHECK_SIZEOF(char, 1)
1958 AC_CHECK_SIZEOF(short int, 2)
1959 AC_CHECK_SIZEOF(int, 4)
1960 AC_CHECK_SIZEOF(long int, 4)
1961 AC_CHECK_SIZEOF(long long int, 8)
1962 AC_CHECK_SIZEOF(int *, 4)
1964 dnl Check for sys/types.h types
1965 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int,
1969 #include <sys/types.h>
1973 ac_cv_have_u_int="yes"
1975 ac_cv_have_u_int="no"
1980 if test "x$ac_cv_have_u_int" = "xyes" ; then
1981 AC_DEFINE(HAVE_U_INT)
1985 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t,
1989 #include <sys/types.h>
1993 ac_cv_have_intmax_t="yes"
2001 ac_cv_have_intmax_t="yes"
2003 ac_cv_have_intmax_t="no"
2010 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
2011 AC_DEFINE(HAVE_INTMAX_T)
2015 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t,
2019 #include <sys/types.h>
2021 u_intmax_t a; a = 1;
2023 ac_cv_have_u_intmax_t="yes"
2029 u_intmax_t a; a = 1;
2031 ac_cv_have_u_intmax_t="yes"
2033 ac_cv_have_u_intmax_t="no"
2040 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
2041 AC_DEFINE(HAVE_U_INTMAX_T)
2045 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t,
2049 #include <sys/types.h>
2051 int8_t a; int16_t b; int32_t c; a = b = c = 1;
2053 ac_cv_have_intxx_t="yes"
2055 ac_cv_have_intxx_t="no"
2060 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
2061 AC_DEFINE(HAVE_INTXX_T)
2065 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t,
2069 #include <sys/types.h>
2073 ac_cv_have_int64_t="yes"
2075 ac_cv_have_int64_t="no"
2080 if test "x$ac_cv_have_int64_t" = "xyes" ; then
2081 AC_DEFINE(HAVE_INT64_T)
2085 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t,
2089 #include <sys/types.h>
2091 u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;
2093 ac_cv_have_u_intxx_t="yes"
2095 ac_cv_have_u_intxx_t="no"
2100 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
2101 AC_DEFINE(HAVE_U_INTXX_T)
2105 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t,
2109 #include <sys/types.h>
2113 ac_cv_have_u_int64_t="yes"
2115 ac_cv_have_u_int64_t="no"
2120 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
2121 AC_DEFINE(HAVE_U_INT64_T)
2125 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
2126 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2128 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
2131 #include <sys/bitypes.h>
2133 int8_t a; int16_t b; int32_t c;
2134 u_int8_t e; u_int16_t f; u_int32_t g;
2135 a = b = c = e = f = g = 1;
2137 AC_DEFINE(HAVE_U_INTXX_T)
2138 AC_DEFINE(HAVE_INTXX_T)
2139 AC_DEFINE(HAVE_SYS_BITYPES_H)
2147 if test -z "$have_u_intxx_t" ; then
2148 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t,
2152 #include <sys/types.h>
2154 uint8_t a; uint16_t b;
2155 uint32_t c; a = b = c = 1;
2157 ac_cv_have_uintxx_t="yes"
2159 ac_cv_have_uintxx_t="no"
2164 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
2165 AC_DEFINE(HAVE_UINTXX_T)
2169 if (test -z "$have_u_int64_t" || test -z "$have_int64_t" && \
2170 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2172 AC_MSG_CHECKING([for int64_t and u_int64_t types in sys/bitypes.h])
2175 #include <sys/bitypes.h>
2177 int64_t a; u_int64_t b;
2180 AC_DEFINE(HAVE_U_INT64_T)
2181 AC_DEFINE(HAVE_INT64_T)
2189 if (test -z "$have_uintxx_t" && \
2190 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2192 AC_MSG_CHECKING([for uintXX_t types in sys/bitypes.h])
2195 #include <sys/bitypes.h>
2197 uint8_t a; uint16_t b;
2198 uint32_t c; a = b = c = 1;
2200 AC_DEFINE(HAVE_UINTXX_T)
2208 dnl --------------------------------------------------------------------------
2209 dnl CHECKING FOR REQUIRED LIBRARY FUNCTIONS
2210 dnl --------------------------------------------------------------------------
2226 [echo 'configure: cannot find needed function.'; exit 1]
2231 AC_DEFINE(HAVE_FCNTL_F_CLOSEM, 1, [Set if you have 'F_CLOSEM' fcntl flag]),
2233 [#include <fcntl.h>]
2238 AC_DEFINE(HAVE_FCNTL_LOCK, 1, [Set if fcntl supports file locking]),
2240 [#include <fcntl.h>]
2243 AC_CHECK_FUNC(closefrom, [AC_DEFINE(HAVE_CLOSEFROM, 1, [Define to 1 if you have the 'closefrom' function.])])
2244 AC_CHECK_FUNCS(getpagesize, [AC_DEFINE(HAVE_GETPAGESIZE, 1, [Set if have getpagesize])])
2245 AC_CHECK_FUNCS(malloc_trim, [AC_DEFINE(HAVE_MALLOC_TRIM, 1, [Set if have malloc_trim])])
2247 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
2248 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
2249 AC_CHECK_FUNCS(posix_fadvise)
2250 AC_CHECK_FUNCS(posix_fallocate)
2251 AC_CHECK_FUNCS(fdatasync)
2253 AC_CHECK_FUNCS(chflags)
2255 AC_CHECK_FUNCS(snprintf vsnprintf gethostid fseeko)
2257 AC_CACHE_CHECK(for va_copy, ba_cv_va_copy,
2262 void use_va_copy(va_list args){va_list args2; va_copy(args2,args); va_end(args2);}
2263 void call_use_va_copy(int junk,...){va_list args; va_start(args,junk); use_va_copy(args); va_end(args);}
2265 call_use_va_copy(1,2,3)
2274 test $ba_cv_va_copy = yes && AC_DEFINE(HAVE_VA_COPY, 1, [Set if va_copy exists])
2276 dnl --------------------------------------------------------------------------
2277 dnl CHECKING FOR THREAD SAFE FUNCTIONS
2278 dnl --------------------------------------------------------------------------
2279 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
2281 # If resolver functions are not in libc check for -lnsl or -lresolv.
2282 AC_CHECK_FUNC(gethostbyname_r,
2283 AC_MSG_RESULT(using libc's resolver),
2284 AC_CHECK_LIB(nsl,gethostbyname_r)
2285 AC_CHECK_LIB(resolv,gethostbyname_r))
2287 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
2288 AC_CHECK_FUNCS(inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)])
2289 AC_CHECK_FUNCS(gethostbyname2, [AC_DEFINE(HAVE_GETHOSTBYNAME2)])
2290 AC_CHECK_FUNCS(getnameinfo, [AC_DEFINE(HAVE_GETNAMEINFO)])
2293 dnl ----------------------------
2294 dnl check sa_len of sockaddr
2295 dnl ----------------------------
2296 AC_CACHE_CHECK(for struct sockaddr has a sa_len field, ac_cv_struct_sockaddr_sa_len,
2300 #include <sys/socket.h>
2302 struct sockaddr s; s.sa_len;
2304 ac_cv_struct_sockaddr_sa_len=yes
2305 ], [ac_cv_struct_sockaddr_sa_len=no
2311 if test $ac_cv_struct_sockaddr_sa_len = yes; then
2312 AC_DEFINE(HAVE_SA_LEN, 1, [Define if sa_len field exists in struct sockaddr])
2316 dnl check for working getaddrinfo()
2318 dnl Note that if the system doesn't have gai_strerror(), we
2319 dnl can't use getaddrinfo() because we can't get strings
2320 dnl describing the error codes.
2322 AC_CACHE_CHECK(for working getaddrinfo, ac_cv_working_getaddrinfo,
2328 #include <sys/types.h>
2329 #include <sys/socket.h>
2332 struct addrinfo hints, *ai;
2335 memset(&hints, 0, sizeof(hints));
2336 hints.ai_family = AF_UNSPEC;
2337 hints.ai_socktype = SOCK_STREAM;
2338 error = getaddrinfo("127.0.0.1", NULL, &hints, &ai);
2342 if (ai->ai_addr->sa_family != AF_INET) {
2348 ac_cv_working_getaddrinfo="yes"
2350 ac_cv_working_getaddrinfo="no"
2352 ac_cv_working_getaddrinfo="yes"
2357 AC_CHECK_FUNC(gai_strerror, [AC_DEFINE(HAVE_GAI_STRERROR, 1, [Define to 1 if you have the 'gai_strerror' function.])])
2359 if test "$ac_cv_working_getaddrinfo" = "yes"; then
2360 if test "$ac_cv_func_gai_strerror" != "yes"; then
2361 ac_cv_working_getaddrinfo="no"
2363 AC_DEFINE(HAVE_GETADDRINFO, 1, [Define to 1 if getaddrinfo exists and works])
2371 AC_CHECK_FUNCS(getmntinfo, [AC_DEFINE(HAVE_GETMNTINFO)])
2372 AC_FUNC_CLOSEDIR_VOID
2373 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
2374 # AC_FUNC_FNMATCH dnl use local version
2376 AC_CHECK_LIB(intl, gettext, [LIBS="$LIBS -lintl"])
2378 AC_CHECK_LIB(sun, getpwnam)
2380 AC_CHECK_HEADERS(zlib.h)
2381 AC_CHECK_LIB(z, deflate, [ZLIBS="-lz"])
2383 if test x$ZLIBS = x-lz; then
2384 AC_DEFINE(HAVE_LIBZ)
2390 dnl Check if we have AFS on this system
2396 AC_HELP_STRING([--disable-afs], [disable afs support @<:@default=auto@:>@]),
2398 if test x$enableval = xyes; then
2400 elif test x$enableval = xno; then
2407 if test x$support_afs = xyes -o x$support_afs = xauto; then
2409 AC_HELP_STRING([--with-afsdir@<:@=DIR@:>@], [Directory holding AFS includes/libs]),
2410 with_afsdir=$withval
2414 dnl Search in standard places, or --with-afsdir not specified
2416 if test x$with_afsdir = x; then
2417 for root in /usr /usr/local; do
2418 if test -d ${root}/include/afs/ ; then
2422 if test -d ${root}/include/openafs/afs/ ; then
2429 if test -d ${with_afsdir}/include/afs/ ; then
2430 AFS_CFLAGS="-I${with_afsdir}/include"
2432 if test -d ${with_afsdir}/include/openafs/afs/ ; then
2433 AFS_CFLAGS="-I${with_afsdir}/include/openafs"
2437 saved_CFLAGS="${CFLAGS}"
2438 saved_CPPFLAGS="${CPPFLAGS}"
2439 CFLAGS="${AFS_CFLAGS} ${saved_CFLAGS}"
2440 CPPFLAGS="${AFS_CFLAGS} ${saved_CPPFLAGS}"
2442 AC_CHECK_HEADERS(afs/afsint.h)
2445 #include <afs/afsint.h>
2446 #include <afs/venus.h>
2448 AC_DEFINE(HAVE_AFS_VENUS_H,1,[Define to 1 if you have the <afs/venus.h> header file.])
2451 CFLAGS="${saved_CFLAGS}"
2452 CPPFLAGS="${saved_CPPFLAGS}"
2455 dnl See if we can find a libsys with the pioctl symbol in there
2457 AC_MSG_CHECKING(for pioctl in AFS libsys)
2458 for dir in ${with_afsdir}/lib \
2459 ${with_afsdir}/lib/afs \
2460 ${with_afsdir}/lib/openafs \
2461 ${with_afsdir}/lib64 \
2462 ${with_afsdir}/lib64/afs \
2463 ${with_afsdir}/lib64/openafs
2465 for arch_type in .a .so
2467 A=`test -f ${dir}/libsys${arch_type} && nm ${dir}/libsys${arch_type} 2>/dev/null | grep pioctl`
2469 if test $pkg = 0; then
2471 AFS_LIBS="-L${dir} -lsys -lrx -llwp ${dir}/util${arch_type}"
2477 if test $have_afs = yes; then
2483 if test x$support_afs = xyes -a $have_afs != yes; then
2484 AC_MSG_ERROR([afs support explicitly enabled but no supported afs implementation found,
2485 please either load the afs libraries or rerun configure without --enable-afs])
2487 if test $have_afs = yes; then
2488 AC_DEFINE(HAVE_AFS,1,[Define to 1 if your system has AFS support])
2489 AC_DEFINE(HAVE_AFS_ACL,1,[Andrew FileSystem ACL support])
2493 AC_SUBST(AFS_CFLAGS)
2496 dnl ---------------------------------------------------
2497 dnl Check for lzo support/directory (default on)
2498 dnl ---------------------------------------------------
2499 dnl this allows you to turn it completely off
2502 AC_HELP_STRING([--disable-lzo], [disable lzo support @<:@default=yes@:>@]),
2504 if test x$enableval = xno; then
2515 if test x$support_lzo = xyes; then
2517 AC_HELP_STRING([--with-lzo@<:@=DIR@:>@], [specify lzo library directory]),
2524 if test -f ${with_lzo}/include/lzo/lzoconf.h; then
2525 LZO_INC="-I${with_lzo}/include"
2526 LZO_LDFLAGS="-L${with_lzo}/lib"
2527 with_lzo="${with_lzo}/include"
2529 with_lzo="/usr/include"
2532 AC_CHECK_HEADER(${with_lzo}/lzo/lzoconf.h,
2534 AC_DEFINE(HAVE_LZO, 1, [Define to 1 if you have LZO compression])
2535 LZO_LIBS="${LZO_LDFLAGS} -llzo2"
2539 echo "lzoconf.h not found. lzo turned off ..."
2546 AC_CHECK_HEADER(lzo/lzoconf.h,
2548 AC_CHECK_HEADER(lzo/lzo1x.h,
2550 AC_CHECK_LIB(lzo2, lzo1x_1_compress,
2553 AC_DEFINE(HAVE_LZO,1,[Define to 1 if you have LZO compression])
2566 dnl Check for ACL support and libraries
2570 AC_HELP_STRING([--disable-acl], [disable acl support @<:@default=auto@:>@]),
2572 if test x$enableval = xyes; then
2574 elif test x$enableval = xno; then
2581 have_extended_acl=no
2582 if test x$support_acl = xyes -o x$support_acl = xauto; then
2583 AC_CHECK_HEADER(sys/acl.h, [ AC_DEFINE(HAVE_SYS_ACL_H,1,[Defines if your system have the sys/acl.h header file])] , )
2586 dnl First check for acl_get_file in libc
2588 AC_CHECK_FUNC(acl_get_file,
2595 dnl Check for acl_get_file in libacl (Linux)
2597 if test $have_acl = no; then
2598 AC_CHECK_LIB(acl, acl_get_file,
2601 if test $have_afs = yes; then
2603 dnl Because of possible naming conflict with AFS libacl make sure we use the one in /usr/lib64 or /usr/lib !!!
2605 if test -d /usr/lib64/; then
2606 FDLIBS="-L/usr/lib64 -lacl $FDLIBS"
2608 FDLIBS="-L/usr/lib -lacl $FDLIBS"
2611 FDLIBS="-lacl $FDLIBS"
2618 dnl Check for acl_get_file in libpacl (OSF1)
2619 dnl and if ACL_TYPE_DEFAULT_DIR is defined.
2621 if test $have_acl = no -a \
2622 x${HAVE_OSF1_OS_TRUE} = x; then
2623 AC_CHECK_LIB(pacl, acl_get_file,
2626 FDLIBS="-lpacl $FDLIBS"
2630 AC_MSG_CHECKING(for ACL_TYPE_DEFAULT_DIR in acl.h include file)
2631 grep ACL_TYPE_DEFAULT_DIR /usr/include/sys/acl.h > /dev/null 2>&1
2632 if test $? = 0; then
2633 AC_DEFINE(HAVE_ACL_TYPE_DEFAULT_DIR,1,[Defines if your system have the ACL_TYPE_DEFAULT_DIR acl type])
2641 dnl On OSX check for availability of ACL_TYPE_EXTENDED
2643 if test $have_acl = yes -a \
2644 x${HAVE_DARWIN_OS_TRUE} = x; then
2645 AC_MSG_CHECKING(for ACL_TYPE_EXTENDED in acl.h include file)
2646 grep ACL_TYPE_EXTENDED /usr/include/sys/acl.h > /dev/null 2>&1
2647 if test $? = 0; then
2648 AC_DEFINE(HAVE_ACL_TYPE_EXTENDED,1,[Defines if your system have the ACL_TYPE_EXTENDED acl type])
2656 dnl On FreeBSD check for availability of ACL_TYPE_NFS4
2658 if test $have_acl = yes -a \
2659 x${HAVE_FREEBSD_OS_TRUE} = x; then
2660 AC_MSG_CHECKING(for ACL_TYPE_NFS4 in acl.h include file)
2661 grep ACL_TYPE_NFS4 /usr/include/sys/acl.h > /dev/null 2>&1
2662 if test $? = 0; then
2663 AC_DEFINE(HAVE_ACL_TYPE_NFS4,1,[Defines if your system have the ACL_TYPE_NFS4 acl type])
2671 dnl Check for acltotext and acl_totext (Solaris)
2673 if test $have_acl = no -a \
2674 x${HAVE_SUN_OS_TRUE} = x; then
2675 AC_CHECK_LIB(sec, acltotext,
2678 FDLIBS="-lsec $FDLIBS"
2680 AC_CHECK_LIB(sec, acl_totext,
2682 have_extended_acl=yes
2690 dnl Check for acl_get and aclx_get (AIX)
2692 if test $have_acl = no -a \
2693 x${HAVE_AIX_OS_TRUE} = x; then
2694 AC_CHECK_FUNC(acl_get,
2698 AC_CHECK_FUNC(aclx_get,
2700 have_extended_acl=yes
2707 if test x$support_acl = xyes -a $have_acl != yes; then
2708 AC_MSG_ERROR([acl support explicitly enabled but no supported acl implementation found,
2709 please either load the acl libraries or rerun configure without --enable-acl])
2711 if test $have_acl = yes; then
2712 AC_DEFINE([HAVE_ACL],1,[Normal acl support])
2715 if test $have_extended_acl = yes; then
2716 AC_DEFINE([HAVE_EXTENDED_ACL],1,[Extended acl support])
2722 dnl Check for XATTR support
2725 AC_ARG_ENABLE(xattr,
2726 AC_HELP_STRING([--disable-xattr], [disable xattr support @<:@default=auto@:>@]),
2728 if test x$enableval = xyes; then
2730 elif test x$enableval = xno; then
2737 if test x$support_xattr = xyes -o x$support_xattr = xauto; then
2739 dnl First check for *BSD support
2740 dnl When running on a BSD variant
2742 if test x${HAVE_FREEBSD_OS_TRUE} = x -o \
2743 x${HAVE_NETBSD_OS_TRUE} = x -o \
2744 x${HAVE_OPENBSD_OS_TRUE} = x; then
2745 AC_CHECK_HEADER(sys/extattr.h, [ AC_DEFINE(HAVE_SYS_EXTATTR_H,1,[Defines if your system have the sys/extattr.h header file])] , )
2746 AC_CHECK_HEADER(libutil.h, [ AC_DEFINE(HAVE_LIBUTIL_H,1,[Defines if your system have the libutil.h header file])] , )
2747 AC_CHECK_FUNCS(extattr_get_link extattr_set_link extattr_list_link,
2750 AC_DEFINE([HAVE_EXTATTR_GET_LINK],1,[Define to 1 if you have the 'extattr_get_link' function.])
2751 AC_DEFINE([HAVE_EXTATTR_SET_LINK],1,[Define to 1 if you have the 'extattr_set_link' function.])
2752 AC_DEFINE([HAVE_EXTATTR_LIST_LINK],1,[Define to 1 if you have the 'extattr_list_link' function.])
2756 if test $have_xattr = no; then
2757 AC_CHECK_FUNCS(extattr_get_file extattr_set_file extattr_list_file,
2760 AC_DEFINE([HAVE_EXTATTR_GET_FILE],1,[Define to 1 if you have the 'extattr_get_file' function.])
2761 AC_DEFINE([HAVE_EXTATTR_SET_FILE],1,[Define to 1 if you have the 'extattr_set_file' function.])
2762 AC_DEFINE([HAVE_EXTATTR_LIST_FILE],1,[Define to 1 if you have the 'extattr_list_file' function.])
2767 if test $have_xattr = yes; then
2768 have_extattr_string_in_libc=no
2769 AC_CHECK_FUNCS(extattr_namespace_to_string extattr_string_to_namespace,
2771 have_extattr_string_in_libc=yes
2772 AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2773 AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2778 dnl If extattr_namespace_to_string and extattr_string_to_namespace are not in libc see if they are in libutil
2780 if test $have_extattr_string_in_libc = no; then
2781 AC_CHECK_LIB(util, extattr_namespace_to_string extattr_string_to_namespace,
2783 AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2784 AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2785 FDLIBS="-lutil $FDLIBS"
2793 dnl If we failed to find *BSD support try the AIX implementation of extented attributes (EA)
2794 dnl When running on AIX
2796 if test $have_xattr = no -a \
2797 x${HAVE_AIX_OS_TRUE} = x; then
2798 AC_CHECK_HEADER(sys/ea.h, [ AC_DEFINE(HAVE_SYS_EA_H,1,[Defines if your system have the sys/ea.h header file])] , )
2799 AC_CHECK_FUNCS(llistea lgetea lsetea,
2802 AC_DEFINE([HAVE_LLISTEA],1,[Define to 1 if you have the 'llistea' function.])
2803 AC_DEFINE([HAVE_LGETEA],1,[Define to 1 if you have the 'lgetea' function.])
2804 AC_DEFINE([HAVE_LSETEA],1,[Define to 1 if you have the 'lsetea' function.])
2808 if test $have_xattr = no; then
2809 AC_CHECK_FUNCS(listea getea setea,
2812 AC_DEFINE([HAVE_LISTEA],1,[Define to 1 if you have the 'listea' function.])
2813 AC_DEFINE([HAVE_GETEA],1,[Define to 1 if you have the 'getea' function.])
2814 AC_DEFINE([HAVE_SETEA],1,[Define to 1 if you have the 'setea' function.])
2821 dnl If we failed to find AIX support try the TRU64 implementation of extented attributes
2822 dnl when running on a TRU64 OS.
2824 if test $have_xattr = no -a \
2825 x${HAVE_OSF1_OS_TRUE} = x; then
2826 AC_CHECK_HEADER(sys/proplist.h, [ AC_DEFINE(HAVE_SYS_PROPLIST_H,1,[Defines if your system have the sys/proplist.h header file])] , )
2827 AC_CHECK_FUNCS(getproplist get_proplist_entry sizeof_proplist_entry add_proplist_entry setproplist,
2830 AC_DEFINE([HAVE_GETPROPLIST],1,[Define to 1 if you have the 'getproplist' function.])
2831 AC_DEFINE([HAVE_GET_PROPLIST_ENTRY],1,[Define to 1 if you have the 'get_proplist_entry' function.])
2832 AC_DEFINE([HAVE_SIZEOF_PROPLIST_ENTRY],1,[Define to 1 if you have the 'sizeof_proplist_entry' function.])
2833 AC_DEFINE([HAVE_ADD_PROPLIST_ENTRY],1,[Define to 1 if you have the 'add_proplist_entry' function.])
2834 AC_DEFINE([HAVE_SETPROPLIST],1,[Define to 1 if you have the 'setproplist' function.])
2840 dnl If we failed to find TRU64 support try the SOLARIS implementation of extented and extensible attributes
2841 dnl when running on a Solaris.
2843 if test $have_xattr = no -a \
2844 x${HAVE_SUN_OS_TRUE} = x; then
2845 AC_CHECK_HEADER(sys/attr.h, [ AC_DEFINE(HAVE_SYS_ATTR_H,1,[Defines if your system have the sys/attr.h header file])] , )
2846 AC_CHECK_HEADER(sys/nvpair.h, [ AC_DEFINE(HAVE_SYS_NVPAIR_H,1,[Defines if your system have the sys/nvpair.h header file])] , )
2847 AC_CHECK_HEADER(attr.h, [ AC_DEFINE(HAVE_ATTR_H,1,[Defines if your system have the attr.h header file])] , )
2849 AC_CHECK_FUNCS(openat fstatat unlinkat fchownat futimesat,
2852 AC_DEFINE([HAVE_OPENAT],1,[Define to 1 if you have the 'openat' function.])
2853 AC_DEFINE([HAVE_FSTATAT],1,[Define to 1 if you have the 'fstatat' function.])
2854 AC_DEFINE([HAVE_UNLINKAT],1,[Define to 1 if you have the 'unlinkat' function.])
2855 AC_DEFINE([HAVE_FCHOWNAT],1,[Define to 1 if you have the 'fchownat' function.])
2856 AC_DEFINE([HAVE_FUTIMESAT],1,[Define to 1 if you have the 'futimesat' function.])
2860 if test $have_xattr = yes; then
2861 AC_CHECK_LIB(nvpair, nvlist_next_nvpair,
2863 AC_DEFINE([HAVE_NVLIST_NEXT_NVPAIR],1,[Define to 1 if you have the 'nvlist_next_nvpair' function.])
2864 FDLIBS="-lnvpair $FDLIBS"
2871 dnl If we failed to find Solaris support try the generic xattr support code
2873 if test $have_xattr = no; then
2874 AC_CHECK_HEADER(sys/xattr.h, [ AC_DEFINE(HAVE_SYS_XATTR_H,1,[Defines if your system have the sys/xattr.h header file])] , )
2875 AC_CHECK_FUNCS(llistxattr lgetxattr lsetxattr,
2878 AC_DEFINE([HAVE_LLISTXATTR],1,[Define to 1 if you have the 'llistxattr' function.])
2879 AC_DEFINE([HAVE_LGETXATTR],1,[Define to 1 if you have the 'lgetxattr' function.])
2880 AC_DEFINE([HAVE_LSETXATTR],1,[Define to 1 if you have the 'lsetxattr' function.])
2884 if test $have_xattr = no; then
2885 AC_CHECK_FUNCS(listxattr getxattr setxattr,
2888 AC_DEFINE([HAVE_LISTXATTR],1,[Define to 1 if you have the 'listxattr' function.])
2889 AC_DEFINE([HAVE_GETXATTR],1,[Define to 1 if you have the 'getxattr' function.])
2890 AC_DEFINE([HAVE_SETXATTR],1,[Define to 1 if you have the 'setxattr' function.])
2896 if test x$support_xattr = xyes -a $have_xattr != yes; then
2897 AC_MSG_ERROR([xattr support explicitly enabled but no supported xattr implementation found,
2898 please either load the xattr libraries or rerun configure without --enable-xattr])
2900 if test $have_xattr = yes; then
2901 AC_DEFINE([HAVE_XATTR],1,[Extended Attributes support])
2907 dnl Check for pthread libraries
2910 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
2912 AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
2914 AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
2916 AC_CHECK_FUNC(pthread_create)
2925 dnl Check for headers, functions and libraries required to support
2926 dnl keeping readall capabilities
2928 AC_CHECK_HEADERS(sys/prctl.h sys/capability.h)
2929 AC_CHECK_FUNCS(prctl setreuid)
2930 AC_CHECK_LIB([cap], [cap_set_proc], [CAP_LIBS="-lcap"], [CAP_LIBS=])
2931 if test x$CAP_LIBS = x-lcap; then
2932 AC_DEFINE(HAVE_LIBCAP, 1, [Define if you have libcap])
2941 if test x$have_gcc = xyes ; then
2942 CPPFLAGS="$CPPFLAGS -x c++ -fno-strict-aliasing -fno-exceptions -fno-rtti"
2943 CFLAGS="$CFLAGS -x c++ -fno-strict-aliasing -fno-exceptions -fno-rtti"
2945 LDFLAGS=${LDFLAGS--O}
2946 CPPFLAGS="$CPPFLAGS"
2958 AC_SUBST(X_EXTRA_LIBS)
2963 dnl extra configurable objects
2974 dnl Finally we set appropriate distribution specific
2975 dnl variables and defaults
2980 COMPRESS_MANPAGES=yes
2985 PSCMD="ps -e -o pid,comm"
2986 PFILES="${PFILES} platforms/aix/Makefile"
2987 TAPEDRIVE="/dev/rmt0.1"
2991 PTHREAD_LIB="-lpthread -lexc"
2992 if test "${CC}" = "gcc" ; then
2999 TAPEDRIVE="/dev/nrmt0"
3002 DISTVER=`uname -a |awk '{print $3}'`
3003 TAPEDRIVE="/dev/nrmt0"
3004 PTHREAD_LIB="-pthread"
3005 CFLAGS="${CFLAGS} -pthread"
3006 PSCMD="ps -ax -o pid,command"
3010 platforms/bsdi/Makefile \
3011 platforms/bsdi/bacula-fd \
3012 platforms/bsdi/bacula-sd \
3013 platforms/bsdi/bacula-dir"
3014 largefile_support="yes"
3017 DISTVER=`uname -a |awk '{print $3}'`
3018 TAPEDRIVE="/dev/nrst0"
3021 WLDFLAGS="-mwindows"
3025 TAPEDRIVE="/dev/nst0"
3026 PSCMD="ps -e -o pid,command"
3029 platforms/darwin/Makefile"
3033 TAPEDRIVE="/dev/nst0"
3034 PSCMD="ps -e -o pid,command"
3037 platforms/osx/Makefile"
3040 if `test -f /etc/apt/sources.list && grep -q ubuntu /etc/apt/sources.list`; then
3043 DISTVER=`cat /etc/debian_version`
3044 if test -f /etc/lsb-release ; then
3046 if test "x$DISTRIB_ID" != "x" ; then
3047 DISTNAME=$DISTRIB_ID
3049 if test "x$DISTRIB_RELEASE" != "x" ; then
3050 DISTVER=$DISTRIB_RELEASE
3053 if test "$DISTNAME" = "Ubuntu" ; then
3056 TAPEDRIVE="/dev/nst0"
3057 PSCMD="ps -e -o pid,command"
3058 if test "$DISTNAME" = "ubuntu" ; then
3060 platforms/ubuntu/Makefile \
3061 platforms/ubuntu/bacula-fd \
3062 platforms/ubuntu/bacula-sd \
3063 platforms/ubuntu/bacula-dir"
3066 platforms/debian/Makefile \
3067 platforms/debian/bacula-fd \
3068 platforms/debian/bacula-sd \
3069 platforms/debian/bacula-dir"
3073 DISTVER=`uname -a |awk '{print $3}'`
3074 VER=`echo $DISTVER | cut -c 1`
3075 if test x$VER = x4 ; then
3076 PTHREAD_LIB="${PTHREAD_LIBS:--pthread}"
3077 CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS:--pthread}"
3081 TAPEDRIVE="/dev/nrsa0"
3082 PSCMD="ps -ax -o pid,command"
3084 platforms/freebsd/Makefile \
3085 platforms/freebsd/bacula-fd \
3086 platforms/freebsd/bacula-sd \
3087 platforms/freebsd/bacula-dir"
3088 largefile_support="yes"
3092 TAPEDRIVE="/dev/nst0"
3093 PSCMD="ps -e -o pid,command"
3095 platforms/hurd/Makefile \
3096 platforms/hurd/bacula-fd \
3097 platforms/hurd/bacula-sd \
3098 platforms/hurd/bacula-dir"
3101 PSCMD="UNIX95=1; ps -e -o pid,comm"
3102 CFLAGS="${CFLAGS} -D_XOPEN_SOURCE_EXTENDED=1"
3104 TAPEDRIVE="/dev/rmt/0hnb"
3105 PTHREAD_LIB="-lpthread"
3106 AC_DEFINE([_INCLUDE_LONGLONG])
3110 TAPEDRIVE="/dev/rmt/0cbn"
3111 PSCMD="ps -e -o pid,comm"
3113 platforms/irix/Makefile \
3114 platforms/irix/bacula-fd \
3115 platforms/irix/bacula-sd \
3116 platforms/irix/bacula-dir"
3119 DISTVER=`uname -a |awk '{print $3}'`
3122 TAPEDRIVE="/dev/nrst0"
3123 PSCMD="ps -ax -o pid,command"
3124 PTHREAD_LIB="-pthread"
3125 CFLAGS="${CFLAGS} -pthread"
3128 DISTVER=`uname -a |awk '{print $3}'`
3131 TAPEDRIVE="/dev/nrst0"
3132 PSCMD="ps -ax -o pid,command"
3133 PTHREAD_LIB="-pthread"
3134 CFLAGS="${CFLAGS} -pthread"
3136 platforms/openbsd/Makefile \
3137 platforms/openbsd/bacula-fd \
3138 platforms/openbsd/bacula-sd \
3139 platforms/openbsd/bacula-dir"
3142 if test -f /etc/whitebox-release ; then
3143 f=/etc/whitebox-release
3145 f=/etc/redhat-release
3147 if test `cat $f | grep release |\
3148 cut -f 3 -d ' '`x = "Enterprise"x ; then
3149 DISTVER="Enterprise "`cat $f | grep release |\
3152 DISTVER=`cat /etc/redhat-release | grep release |\
3155 TAPEDRIVE="/dev/nst0"
3156 PSCMD="ps -e -o pid,command"
3158 platforms/redhat/Makefile \
3159 platforms/redhat/bacula-fd \
3160 platforms/redhat/bacula-sd \
3161 platforms/redhat/bacula-dir
3165 DISTVER=`cat /etc/mandrake-release | grep release |\
3167 TAPEDRIVE="/dev/nst0"
3168 PSCMD="ps -e -o pid,command"
3170 platforms/mandrake/Makefile \
3171 platforms/mandrake/bacula-fd \
3172 platforms/mandrake/bacula-sd \
3173 platforms/mandrake/bacula-dir \
3177 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
3178 TAPEDRIVE="/dev/nst0"
3179 PSCMD="ps -e -o pid,command"
3181 platforms/gentoo/Makefile \
3182 platforms/gentoo/bacula-init \
3183 platforms/gentoo/bacula-fd \
3184 platforms/gentoo/bacula-sd \
3185 platforms/gentoo/bacula-dir"
3188 DISTVER=`cat /etc/slackware-version`
3189 TAPEDRIVE="/dev/nst0"
3190 PSCMD="ps -e -o pid,command"
3192 platforms/slackware/Makefile \
3193 platforms/slackware/rc.bacula-fd \
3194 platforms/slackware/rc.bacula-sd \
3195 platforms/slackware/rc.bacula-dir\
3196 platforms/slackware/functions.bacula"
3200 TAPEDRIVE="/dev/rmt/0cbn"
3201 PSCMD="ps -e -o pid,comm"
3203 platforms/solaris/Makefile \
3204 platforms/solaris/bacula-fd \
3205 platforms/solaris/bacula-sd \
3206 platforms/solaris/bacula-dir"
3210 AC_DEFINE(HAVE_OLD_SOCKOPT)
3211 AC_DEFINE(USE_THR_SETCONCURRENCY)
3214 AC_DEFINE(USE_THR_SETCONCURRENCY)
3217 AC_DEFINE(HAVE_SOLARIS10, 1, [Set if building on Solaris 10])
3222 LIBS="$LIBS -lresolv -lrt"
3225 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
3227 TAPEDRIVE="/dev/nst0"
3228 PSCMD="ps -e -o pid,command"
3230 platforms/suse/Makefile \
3231 platforms/suse/bacula-fd \
3232 platforms/suse/bacula-sd \
3233 platforms/suse/bacula-dir \
3234 platforms/suse/bacula"
3239 TAPEDRIVE="/dev/nst0"
3240 PSCMD="ps -e -o pid,command"
3242 platforms/suse/Makefile \
3243 platforms/suse/bacula-fd \
3244 platforms/suse/bacula-sd \
3245 platforms/suse/bacula-dir"
3249 TAPEDRIVE="/dev/nst0"
3252 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
3256 dnl -------------------------------------------
3257 dnl systemd (default off)
3258 dnl -------------------------------------------
3259 AC_MSG_CHECKING(for systemd support)
3260 AC_ARG_WITH(systemd,
3261 AC_HELP_STRING([--with-systemd@<:@=UNITDIR@:>@], [Include systemd support. UNITDIR is where systemd system .service files are located, default is to ask systemctl.]),
3263 if test "$withval" != "no"; then
3264 if test "$withval" = "yes"; then
3265 SYSTEMD_UNITDIR="`systemctl show | grep UnitPath | cut -d " " -f2`"
3267 SYSTEMD_UNITDIR="${withval}"
3271 platforms/systemd/Makefile \
3272 platforms/systemd/bacula.conf \
3273 platforms/systemd/bacula-dir.service \
3274 platforms/systemd/bacula-fd.service \
3275 platforms/systemd/bacula-sd.service"
3276 AC_DEFINE(HAVE_SYSTEMD, 1, [Define to 1 if systemd support should be enabled])
3278 support_systemd="yes"
3281 support_systemd="no"
3284 support_systemd="no"
3288 AC_SUBST(SYSTEMD_UNITDIR)
3292 LIBS="$PTHREAD_LIB $LIBS"
3294 AC_DEFINE_UNQUOTED(lld, "$lld")
3295 AC_DEFINE_UNQUOTED(llu, "$llu")
3302 AC_SUBST(COMPRESS_MANPAGES)
3304 dnl common parts of the Makefile
3305 MCOMMON=./autoconf/Make.common
3306 AC_SUBST_FILE(MCOMMON)
3309 if test "x${subsysdir}" = "x${sbindir}" ; then
3312 echo "You have set both --sbindir and --with-subsys-dir"
3313 echo " equal to: ${subsysdir} "
3314 echo "This is not permitted. Please reconfigure."
3316 echo "Aborting configuration ..."
3323 AC_OUTPUT([autoconf/Make.common \
3326 scripts/btraceback \
3328 scripts/baculabackupreport \
3330 scripts/bacula-ctl-dir \
3331 scripts/bacula-ctl-fd \
3332 scripts/bacula-ctl-sd \
3333 scripts/devel_bacula \
3336 scripts/mtx-changer \
3337 scripts/disk-changer \
3338 scripts/dvd-handler \
3339 scripts/dvd-simulator \
3340 scripts/logwatch/Makefile \
3341 scripts/logwatch/logfile.bacula.conf \
3342 scripts/bat.desktop \
3343 scripts/bat.desktop.xsu \
3344 scripts/bat.desktop.consolehelper \
3345 scripts/bat.console_apps \
3346 scripts/bacula-tray-monitor.desktop \
3349 src/console/Makefile \
3350 src/console/bconsole.conf \
3351 src/qt-console/bat.conf \
3352 src/qt-console/bat.pro \
3353 src/qt-console/bat.pro.mingw32 \
3354 src/qt-console/bat.pro.mingw64 \
3355 src/qt-console/install_conf_file \
3356 src/qt-console/tray-monitor/tray-monitor.conf \
3357 src/qt-console/tray-monitor/tray-monitor.pro \
3358 src/qt-console/tray-monitor/tray-monitor.pro.mingw32 \
3359 src/qt-console/tray-monitor/tray-monitor.pro.mingw64 \
3361 src/dird/bacula-dir.conf \
3363 src/stored/Makefile \
3364 src/stored/bacula-sd.conf \
3365 src/filed/Makefile \
3366 src/filed/bacula-fd.conf \
3368 src/cats/make_catalog_backup.pl \
3369 src/cats/make_catalog_backup \
3370 src/cats/delete_catalog_backup \
3371 src/cats/create_postgresql_database \
3372 src/cats/update_postgresql_tables \
3373 src/cats/make_postgresql_tables \
3374 src/cats/grant_postgresql_privileges \
3375 src/cats/drop_postgresql_tables \
3376 src/cats/drop_postgresql_database \
3377 src/cats/create_mysql_database \
3378 src/cats/update_mysql_tables \
3379 src/cats/make_mysql_tables \
3380 src/cats/grant_mysql_privileges \
3381 src/cats/drop_mysql_tables \
3382 src/cats/drop_mysql_database \
3383 src/cats/create_sqlite3_database \
3384 src/cats/update_sqlite3_tables \
3385 src/cats/make_sqlite3_tables \
3386 src/cats/grant_sqlite3_privileges \
3387 src/cats/drop_sqlite3_tables \
3388 src/cats/drop_sqlite3_database \
3391 src/cats/create_bacula_database \
3392 src/cats/update_bacula_tables \
3393 src/cats/grant_bacula_privileges \
3394 src/cats/make_bacula_tables \
3395 src/cats/drop_bacula_tables \
3396 src/cats/drop_bacula_database \
3397 src/cats/install-default-backend \
3398 src/findlib/Makefile \
3399 src/tools/Makefile \
3400 src/plugins/fd/Makefile \
3401 src/plugins/sd/Makefile \
3402 src/plugins/dir/Makefile \
3404 updatedb/update_mysql_tables \
3405 updatedb/update_sqlite3_tables \
3406 updatedb/update_postgresql_tables \
3407 updatedb/update_mysql_tables_9_to_10 \
3408 updatedb/update_sqlite3_tables_9_to_10 \
3409 updatedb/update_postgresql_tables_9_to_10 \
3410 updatedb/update_mysql_tables_10_to_11 \
3411 updatedb/update_sqlite3_tables_10_to_11 \
3412 updatedb/update_postgresql_tables_10_to_11 \
3413 updatedb/update_mysql_tables_11_to_12 \
3414 updatedb/update_sqlite3_tables_11_to_12 \
3415 updatedb/update_postgresql_tables_11_to_12 \
3416 examples/nagios/check_bacula/Makefile \
3417 platforms/rpms/redhat/bacula.spec \
3418 platforms/rpms/redhat/bacula-bat.spec \
3419 platforms/rpms/redhat/bacula-docs.spec \
3420 platforms/rpms/redhat/bacula-mtx.spec \
3421 platforms/rpms/suse/bacula.spec \
3422 platforms/rpms/suse/bacula-bat.spec \
3423 platforms/rpms/suse/bacula-docs.spec \
3424 platforms/rpms/suse/bacula-mtx.spec \
3429 if test "${support_bat}" = "yes" ; then
3430 if test "x$QMAKE" = "xnone"; then
3431 AC_MSG_ERROR([Could not find qmake $PATH. Check your Qt installation])
3435 echo "Creating bat Makefile"
3446 dnl if CC is gcc, we can rebuild the dependencies (since the depend rule
3447 dnl requires gcc). If it's not, don't rebuild dependencies
3449 if test X"$GCC" = "Xyes" ; then
3450 echo "Doing make of dependencies"
3451 ${MAKE:-make} depend
3455 chmod 755 install_conf_file build-depkgs-qt-console
3459 chmod 755 bacula btraceback mtx-changer
3460 chmod 755 dvd-handler dvd-simulator
3461 chmod 755 bconsole disk-changer devel_bacula logrotate
3465 chmod 755 $c/update_mysql_tables_10_to_11 $c/update_sqlite3_tables_10_to_11
3466 chmod 755 $c/update_postgresql_tables_10_to_11
3467 chmod 755 $c/update_mysql_tables_11_to_12 $c/update_sqlite3_tables_11_to_12
3468 chmod 755 $c/update_postgresql_tables_11_to_12
3473 chmod 755 $c/create_bacula_database $c/update_bacula_tables $c/make_bacula_tables
3474 chmod 755 $c/grant_bacula_privileges $c/drop_bacula_tables $c/drop_bacula_database
3476 chmod 755 $c/create_mysql_database $c/update_mysql_tables $c/make_mysql_tables
3477 chmod 755 $c/grant_mysql_privileges $c/drop_mysql_tables $c/drop_mysql_database
3479 chmod 755 $c/create_sqlite3_database $c/update_sqlite3_tables $c/make_sqlite3_tables
3480 chmod 755 $c/grant_sqlite3_privileges $c/drop_sqlite3_tables $c/drop_sqlite3_database
3482 chmod 755 $c/create_postgresql_database $c/update_postgresql_tables $c/make_postgresql_tables
3483 chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables $c/drop_postgresql_database
3485 chmod 755 $c/make_catalog_backup $c/delete_catalog_backup $c/make_catalog_backup.pl
3489 chmod 755 $c/install-default-backend
3491 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
3492 largefile_support="yes"
3495 dnl Only try to find out the version number of the compiler when we know its some kind of GCC compiler
3496 if test X"$GCC" = "Xyes" ; then
3498 dnl A whole lot of hand springs to get the compiler version.
3499 dnl This is because gcc changed the output in version 3.0
3501 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3502 if test "x${CCVERSION}" = "x" ; then
3503 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3505 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3506 if test x"${CXXVERSION}" = x ; then
3507 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3511 # clean up any old junk
3518 Configuration on `date`:
3520 Host: ${host}${post_host} -- ${DISTNAME} ${DISTVER}
3521 Bacula version: ${BACULA} ${VERSION} (${DATE})
3522 Source code location: ${srcdir}
3523 Install binaries: ${sbindir}
3524 Install libraries: ${libdir}
3525 Install config files: ${sysconfdir}
3526 Scripts directory: ${scriptdir}
3527 Archive directory: ${archivedir}
3528 Working directory: ${working_dir}
3529 PID directory: ${piddir}
3530 Subsys directory: ${subsysdir}
3531 Man directory: ${mandir}
3532 Data directory: ${datarootdir}
3533 Plugin directory: ${plugindir}
3534 C Compiler: ${CC} ${CCVERSION}
3535 C++ Compiler: ${CXX} ${CXXVERSION}
3536 Compiler flags: ${WCFLAGS} ${CFLAGS}
3537 Linker flags: ${WLDFLAGS} ${LDFLAGS}
3539 Statically Linked Tools: ${support_static_tools}
3540 Statically Linked FD: ${support_static_fd}
3541 Statically Linked SD: ${support_static_sd}
3542 Statically Linked DIR: ${support_static_dir}
3543 Statically Linked CONS: ${support_static_cons}
3544 Database backends: ${db_backends}
3545 Database port: ${db_port}
3546 Database name: ${db_name}
3547 Database user: ${db_user}
3548 Database SSL options: ${db_ssl_options}
3550 Job Output Email: ${job_email}
3551 Traceback Email: ${dump_email}
3552 SMTP Host Address: ${smtp_host}
3554 Director Port: ${dir_port}
3555 File daemon Port: ${fd_port}
3556 Storage daemon Port: ${sd_port}
3558 Director User: ${dir_user}
3559 Director Group: ${dir_group}
3560 Storage Daemon User: ${sd_user}
3561 Storage DaemonGroup: ${sd_group}
3562 File Daemon User: ${fd_user}
3563 File Daemon Group: ${fd_group}
3565 Large file support: $largefile_support
3566 Bacula conio support: ${got_conio} ${CONS_LIBS}
3567 readline support: ${got_readline} ${PRTREADLINE_SRC}
3568 TCP Wrappers support: ${TCPW_MSG} ${WRAPLIBS}
3569 TLS support: ${support_tls}
3570 Encryption support: ${support_crypto}
3571 ZLIB support: ${have_zlib}
3572 LZO support: ${have_lzo}
3573 enable-smartalloc: ${support_smartalloc}
3574 enable-lockmgr: ${support_lockmgr}
3575 bat support: ${support_bat}
3576 client-only: ${build_client_only}
3577 build-dird: ${build_dird}
3578 build-stored: ${build_stored}
3579 Plugin support: ${have_plugins}
3580 AFS support: ${have_afs}
3581 ACL support: ${have_acl}
3582 XATTR support: ${have_xattr}
3583 systemd support: ${support_systemd} ${SYSTEMD_UNITDIR}
3584 Batch insert enabled: ${batch_insert_db_backends}
3588 # create a small shell script useful for support with
3589 # configure options and config.out info
3590 cat > scripts/bacula_config << EOF
3593 $ $0 $ac_configure_args
3595 cat config.out >> scripts/bacula_config
3596 echo __EOC__ >> scripts/bacula_config
3597 chmod 755 scripts/bacula_config