3 dnl Process this file with autoconf to produce a configure script.
5 dnl Copyright (C) 2000-2015 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`
45 AC_SUBST(post_host)dnl
46 AC_SUBST(BDB_VERSION)dnl
47 AC_SUBST(DEPKGS_QT_VERSION)dnl
48 AC_SUBST(DEPKGS_VERSION)dnl
49 AC_SUBST(BQT4_VERSION)dnl
52 dnl can be overwritten by specific values from version.h
53 LIBBAC_LT_RELEASE=`sed -n -e 's/^#.*LIBBAC_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
54 LIBBACCFG_LT_RELEASE=`sed -n -e 's/^#.*LIBBACCFG_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
55 LIBBACPY_LT_RELEASE=`sed -n -e 's/^#.*LIBBACPY_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
57 LIBBAC_LT_RELEASE=${LIBBAC_LT_RELEASE:-$VERSION}
58 LIBBACCFG_LT_RELEASE=${LIBBACCFG_LT_RELEASE:-$VERSION}
60 AC_SUBST(LIBBAC_LT_RELEASE)dnl
61 AC_SUBST(LIBBACCFG_LT_RELEASE)dnl
64 dnl can be overwritten by specific values from version.h
65 LIBBACSQL_LT_RELEASE=`sed -n -e 's/^#.*LIBBACSQL_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
66 LIBBACCATS_LT_RELEASE=`sed -n -e 's/^#.*LIBBACCATS_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
68 LIBBACSQL_LT_RELEASE=${LIBBACSQL_LT_RELEASE:-$VERSION}
69 LIBBACCATS_LT_RELEASE=${LIBBACCATS_LT_RELEASE:-$VERSION}
71 AC_SUBST(LIBBACSQL_LT_RELEASE)dnl
72 AC_SUBST(LIBBACCATS_LT_RELEASE)dnl
75 dnl can be overwritten by specific values from version.h
76 LIBBACFIND_LT_RELEASE=`sed -n -e 's/^#.*LIBBACFIND_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
78 LIBBACFIND_LT_RELEASE=${LIBBACFIND_LT_RELEASE:-$VERSION}
80 AC_SUBST(LIBBACFIND_LT_RELEASE)dnl
83 dnl PFILES are platform or plugin specific files
84 PFILES="platforms/Makefile"
86 echo "configuring for ${BACULA} $VERSION ($DATE)"
89 dnl -------------------------------------------------------
90 dnl Check for compiler.
91 dnl ------------------------------------------------------
93 AC_PROG_CC dnl this sets $GCC if using GNU C compiler
95 AC_PROG_CC_C_O dnl Determine if C compiler support -c -o.
96 AC_PROG_GCC_TRADITIONAL dnl Determine if ioctl() need -traditional.
100 if test x"$GCC" = "xyes"; then
104 AC_PATH_PROG(CXX, $CXX, $CXX)
105 if test ! -e $CXX; then
106 AC_MSG_ERROR(Unable to find C++ compiler)
109 dnl -------------------------------------------------------
110 dnl Check for programs.
111 dnl ------------------------------------------------------
113 AC_PATH_PROG(MV, mv, mv)
115 dnl If we name the variable RM it will shadow the RM variable in the configure script and we overwrite the
116 dnl value with the name of the rm command and not rm -f which is its normal content. This gives all kind
117 dnl of strange output of the configure script (like things don't exist etc.).
118 dnl So we name it REMOVE (more software has run into this problem)
119 AC_PATH_PROG(REMOVE, rm, rm)
120 AC_PATH_PROG(CP, cp, cp)
121 AC_PATH_PROG(SED, sed, sed)
122 AC_PATH_PROG(ECHO, echo, echo)
123 AC_PATH_PROG(CMP, cmp, cmp)
124 AC_PATH_PROG(TBL, tbl, tbl)
125 AC_PATH_PROG(AR, ar, ar)
126 AC_PATH_PROG(OPENSSL, openssl, none)
127 AC_PATH_PROG(MTX, mtx, mtx)
128 AC_PATH_PROG(DD, dd, dd)
129 AC_PATH_PROG(MKISOFS, mkisofs, mkisofs)
130 AC_PATH_PROG(PYTHON, python, python)
131 AC_PATH_PROG(GROWISOFS, growisofs, growisofs)
132 AC_PATH_PROG(DVDRWMEDIAINFO, dvd+rw-mediainfo, dvd+rw-mediainfo)
133 AC_PATH_PROG(DVDRWFORMAT, dvd+rw-format, dvd+rw-format)
134 AC_PATH_PROG(PKGCONFIG, pkg-config, pkg-config)
135 AC_PATH_PROG(QMAKE, qmake, none)
136 AC_PATH_PROG(GMAKE, gmake, none)
137 AC_PATH_PROG(PIDOF, pidof, pidof)
139 # Some AWK programs fail, so test it and warn the user
140 if echo xfoo | $AWK 'BEGIN { prog=ARGV[1]; ARGC=1 }
141 { if ((prog == $2) || (("(" prog ")") == $2) ||
142 (("[" prog "]") == $2) ||
143 ((prog ":") == $2)) { print $1 ; exit 0 } }' xfoo>/dev/null; then :;
145 AC_MSG_ERROR([!!!!!!!!! WARNING !!!!!!!!!!!!!!
146 The regex engine of $AWK is too broken to be used you
147 might want to install GNU AWK.
148 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!])
151 AC_PATH_PROG(AWK, $THE_AWK, $THE_AWK)
154 test -n "$ARFLAG" || ARFLAGS="cr"
161 AC_SUBST(LOCAL_CFLAGS)
162 AC_SUBST(LOCAL_LDFLAGS)
165 dnl --------------------------------------------------
167 dnl --------------------------------------------------
169 AC_ARG_ENABLE(libtool,
170 AC_HELP_STRING([--enable-libtool], [enable building using GNU libtool @<:@default=yes@:>@]),
172 if test x$enableval = xno; then
177 LT_INIT([shared disable-static])
181 if test x$use_libtool != xno; then
182 DEFAULT_OBJECT_TYPE=".lo"
183 DEFAULT_ARCHIVE_TYPE=".la"
184 DEFAULT_SHARED_OBJECT_TYPE=".la"
185 LIBTOOL="\$(LIBTOOL)"
186 LIBTOOL_INSTALL_TARGET="libtool-install"
187 LIBTOOL_UNINSTALL_TARGET="libtool-uninstall"
188 LIBTOOL_CLEAN_TARGET="libtool-clean"
189 QMAKE_LIBTOOL="${BUILD_DIR}/libtool"
190 FD_PLUGIN_DIR="src/plugins/fd"
193 DEFAULT_OBJECT_TYPE=".o"
194 DEFAULT_ARCHIVE_TYPE=".a"
195 DEFAULT_SHARED_OBJECT_TYPE=".so"
196 LIBTOOL="# \$(LIBTOOL)"
197 LIBTOOL_INSTALL_TARGET=""
198 LIBTOOL_UNINSTALL_TARGET=""
199 LIBTOOL_CLEAN_TARGET=""
200 QMAKE_LIBTOOL="# ${BUILD_DIR}/libtool"
205 AC_SUBST(DEFAULT_OBJECT_TYPE)
206 AC_SUBST(DEFAULT_ARCHIVE_TYPE)
207 AC_SUBST(DEFAULT_SHARED_OBJECT_TYPE)
209 AC_SUBST(LIBTOOL_INSTALL_TARGET)
210 AC_SUBST(LIBTOOL_UNINSTALL_TARGET)
211 AC_SUBST(LIBTOOL_CLEAN_TARGET)
212 AC_SUBST(QMAKE_LIBTOOL)
213 AC_SUBST(FD_PLUGIN_DIR)
215 dnl --------------------------------------------------
216 dnl Include file handling
217 dnl --------------------------------------------------
218 AC_ARG_ENABLE(includes,
219 AC_HELP_STRING([--enable-includes], [enable installing of include files @<:@default=no@:>@]),
221 if test x$enableval = xyes; then
227 dnl It only makes sense to install include files when you install libraries which only happens when
228 dnl libtool is enabled
230 if test x$use_libtool != xno -a x$install_includes = xyes; then
231 INCLUDE_INSTALL_TARGET="install-includes"
232 INCLUDE_UNINSTALL_TARGET="uninstall-includes"
234 INCLUDE_INSTALL_TARGET=""
235 INCLUDE_UNINSTALL_TARGET=""
237 AC_SUBST(INCLUDE_INSTALL_TARGET)
238 AC_SUBST(INCLUDE_UNINSTALL_TARGET)
240 dnl --------------------------------------------------
241 dnl Bacula OP Sys determination (see aclocal.m4)
242 dnl --------------------------------------------------
245 dnl -----------------------------------------------------------
246 dnl Bacula OPSys Distribution determination (see aclocal.m4)
247 dnl ----------------------------------------------------------
248 BA_CHECK_OPSYS_DISTNAME
250 dnl --------------------------------------------------
251 dnl Suppport for gettext (translations)
252 dnl By default, $datarootdir is ${prefix}/share
253 dnl --------------------------------------------------
254 AM_GNU_GETTEXT([external])
256 dnl ------------------------------------------------------------------
257 dnl If the user has not set --prefix, we set our default to nothing.
258 dnl In this case, if the user has not set --sysconfdir, we set it
259 dnl to the package default of /etc/bacula. If either --prefix or
260 dnl --sysconfdir is set, we leave sysconfdir alone except to eval it.
261 dnl If the user has not set --libdir, we set it to the package
262 dnl default of /usr/lib. If either --prefix or --libdir is set,
263 dnl we leave libdir alone except to eval it. If the user has not set
264 dnl --includedir, we set it to the package default of /usr/include.
265 dnl If either --prefix or --includedir is set, we leave includedir
266 dnl alone except to eval it
267 dnl ------------------------------------------------------------------
268 os_name=`uname -s 2>/dev/null`
269 if test x${prefix} = xNONE ; then
270 if test `eval echo ${sysconfdir}` = NONE/etc ; then
271 sysconfdir=/etc/bacula
274 if test `eval echo ${libdir}` = NONE/lib ; then
277 os_processor=`uname -p 2>/dev/null`
278 case ${os_processor} in
293 if test `eval echo ${includedir}` = NONE/include ; then
294 includedir=/usr/include
297 if test `eval echo ${datarootdir}` = NONE/share ; then
298 datarootdir=/usr/share
303 dnl -------------------------------------------------------------------------
304 dnl If the user has not set --exec-prefix, we default to ${prefix}
305 dnl -------------------------------------------------------------------------
306 if test x${exec_prefix} = xNONE ; then
307 exec_prefix=${prefix}
310 sysconfdir=`eval echo ${sysconfdir}`
311 datarootdir=`eval echo ${datarootdir}`
312 docdir=`eval echo ${docdir}`
313 htmldir=`eval echo ${htmldir}`
314 libdir=`eval echo ${libdir}`
315 includedir=`eval echo ${includedir}`
316 localedir=`eval echo ${datarootdir}/locale`
317 AC_DEFINE_UNQUOTED(SYSCONFDIR, "$sysconfdir")
318 AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir")
320 dnl ------------------------------------------------------------------
321 dnl If the user has not set --sbindir, we set our default as /sbin
322 dnl ------------------------------------------------------------------
323 if test x$sbindir = x'${exec_prefix}/sbin' ; then
324 sbindir=${exec_prefix}/sbin
326 sbindir=`eval echo ${sbindir}`
328 dnl -------------------------------------------------------------------------
329 dnl If the user has not set --mandir, we default to /usr/share/man
330 dnl -------------------------------------------------------------------------
331 if test x$mandir = x'${prefix}/man' ; then
332 mandir=/usr/share/man
335 dnl -------------------------------------------------------------------------
336 dnl If the user has not set --htmldir, we default to /usr/share/doc/bacula/html
337 dnl -------------------------------------------------------------------------
338 if test x$htmldir = x'/usr/share/doc/bacula/' ; then
339 htmldir=`eval echo ${docdir}html`
342 dnl -------------------------------------------------------------------------
343 dnl If the user has not set --docdir, we default to /usr/share/doc/bacula
344 dnl -------------------------------------------------------------------------
345 if test x$docdir = x'/usr/share/doc/' ; then
346 docdir=`eval echo ${docdir}bacula`
350 AC_PATH_PROGS(MSGFMT, msgfmt, no)
351 if test "$MSGFMT" = "no"
353 echo 'msgfmt program not found, disabling NLS !'
355 USE_INCLUDED_LIBINTL=no
360 support_smartalloc=yes
367 support_static_tools=no
370 support_static_dir=no
371 support_static_cons=no
376 batch_insert_db_backends=""
379 dnl --------------------------------------------------------------------------
380 dnl CHECKING COMMAND LINE OPTIONS
381 dnl --------------------------------------------------------------------------
383 dnl -------------------------------------------
384 dnl bat (default off)
385 dnl -------------------------------------------
387 AC_HELP_STRING([--enable-bat], [enable build of bat Qt4 GUI @<:@default=no@:>@]),
389 if test x$enableval = xyes; then
390 AC_DEFINE(HAVE_BAT, 1, [Set if Bacula bat Qt4 GUI support enabled])
397 if test x$support_bat = xyes; then
398 abc=`$PKGCONFIG --atleast-version=4.2 QtGui`
400 if test $pkg = 0; then
401 BAT_DIR=src/qt-console
403 AC_MSG_ERROR(Unable to find Qt4 installation needed by bat)
408 dnl The qwt library was used with bat, but that is no longer the case
416 dnl if test x$support_bat = xyes; then
417 dnl AC_MSG_CHECKING(for qwt support)
419 dnl AC_HELP_STRING([--with-qwt@<:@=DIR@:>@], [specify qwt library directory]),
421 dnl case "$with_qwt" in
426 dnl if test -f ${with_qwt}/include/qwt.h; then
427 dnl QWT_INC="${with_qwt}/include"
428 dnl QWT_LDFLAGS="-L${with_qwt}/lib"
438 dnl dnl Search in standard places, or --with-qwt not specified
440 dnl if test $no_qwt = no; then
441 dnl if test x$QWT_INC = x; then
442 dnl for root in /usr /usr/local; do
443 dnl for ver in qwt qwt5 qwt-qt4; do
444 dnl if test -f ${root}/include/${ver}/qwt.h; then
445 dnl QWT_INC="${root}/include/${ver}"
446 dnl if test -d ${root}/lib64/; then
447 dnl QWT_LDFLAGS="-L${root}/lib64"
448 dnl elif test -d ${root}/lib/64/; then
449 dnl QWT_LDFLAGS="-L${root}/64"
451 dnl QWT_LDFLAGS="-L${root}/lib"
462 dnl if test x$QWT_INC = x; then
463 dnl AC_MSG_RESULT(no)
465 dnl AC_DEFINE(HAVE_QWT, 1, [Set if bat QWT library found])
466 dnl AC_MSG_RESULT(yes)
472 AC_SUBST(QWT_LDFLAGS)
476 dnl -------------------------------------------
477 dnl smartalloc (default off)
478 dnl -------------------------------------------
479 AC_ARG_ENABLE(smartalloc,
480 AC_HELP_STRING([--enable-smartalloc], [enable smartalloc debugging support @<:@default=no@:>@]),
482 if test x$enableval = xno; then
483 support_smartalloc=no
488 if test x$support_smartalloc = xyes; then
489 AC_DEFINE(SMARTALLOC, 1, [Set if you want Smartalloc enabled])
492 dnl -------------------------------------------
493 dnl Lock Manager (default off)
494 dnl -------------------------------------------
495 AC_ARG_ENABLE(lockmgr,
496 AC_HELP_STRING([--enable-lockmgr], [enable lock manager support @<:@default=no@:>@]),
498 if test x$enableval = xyes; then
504 if test x$support_lockmgr = xyes; then
505 AC_DEFINE(USE_LOCKMGR, 1, [Set if you want Lock Manager enabled])
509 dnl -------------------------------------------
510 dnl static-tools (default off)
511 dnl -------------------------------------------
512 AC_ARG_ENABLE(static-tools,
513 AC_HELP_STRING([--enable-static-tools], [enable static tape tools @<:@default=no@:>@]),
515 if test x$enableval = xyes; then
516 if test x$use_libtool = xyes; then
517 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
518 please rerun configure with --disable-libtool])
520 support_static_tools=yes
526 if test x$support_static_tools = xyes; then
527 TTOOL_LDFLAGS="-static"
529 AC_SUBST(TTOOL_LDFLAGS)
531 dnl -------------------------------------------
532 dnl static-fd (default off)
533 dnl -------------------------------------------
534 AC_ARG_ENABLE(static-fd,
535 AC_HELP_STRING([--enable-static-fd], [enable static File daemon @<:@default=no@:>@]),
537 if test x$enableval = xyes; then
538 if test x$use_libtool = xyes; then
539 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
540 please rerun configure with --disable-libtool])
542 support_static_fd=yes
548 if test x$support_static_fd = xyes; then
549 STATIC_FD="static-bacula-fd"
553 dnl -------------------------------------------
554 dnl static-sd (default off)
555 dnl -------------------------------------------
556 AC_ARG_ENABLE(static-sd,
557 AC_HELP_STRING([--enable-static-sd], [enable static Storage daemon @<:@default=no@:>@]),
559 if test x$enableval = xyes; then
560 if test x$use_libtool = xyes; then
561 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
562 please rerun configure with --disable-libtool])
564 support_static_sd=yes
570 if test x$support_static_sd = xyes; then
571 STATIC_SD="static-bacula-sd"
575 dnl -------------------------------------------
576 dnl static-dir (default off)
577 dnl -------------------------------------------
578 AC_ARG_ENABLE(static-dir,
579 AC_HELP_STRING([--enable-static-dir], [enable static Director @<:@default=no@:>@]),
581 if test x$enableval = xyes; then
582 if test x$use_libtool = xyes; then
583 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
584 please rerun configure with --disable-libtool])
586 support_static_dir=yes
592 if test x$support_static_dir = xyes; then
593 STATIC_DIR="static-bacula-dir"
597 dnl -------------------------------------------
598 dnl static-cons (default off)
599 dnl -------------------------------------------
600 AC_ARG_ENABLE(static-cons,
601 AC_HELP_STRING([--enable-static-cons], [enable static Console @<:@default=no@:>@]),
603 if test x$enableval = xyes; then
604 if test x$use_libtool = xyes; then
605 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
606 please rerun configure with --disable-libtool])
608 support_static_cons=yes
614 if test x$support_static_cons = xyes; then
615 STATIC_CONS="static-bconsole"
617 AC_SUBST(STATIC_CONS)
619 dnl -------------------------------------------
620 dnl client_only (default off)
621 dnl -------------------------------------------
622 AC_ARG_ENABLE(client-only,
623 AC_HELP_STRING([--enable-client-only], [build client (File daemon) only @<:@default=no@:>@]),
625 if test x$enableval = xyes; then
626 build_client_only=yes
632 if test x$build_client_only = xno; then
639 dnl -------------------------------------------
640 dnl director (default on)
641 dnl -------------------------------------------
642 AC_ARG_ENABLE(build-dird,
643 AC_HELP_STRING([--enable-build-dird], [enable building of dird (Director) @<:@default=yes@:>@]),
645 if test x$enableval = xno; then
657 dnl -------------------------------------------
658 dnl stored (default on)
659 dnl -------------------------------------------
660 AC_ARG_ENABLE(build-stored,
661 AC_HELP_STRING([--enable-build-stored], [enable building of stored (Storage daemon) @<:@default=yes@:>@]),
663 if test x$enableval = xno; then
668 if test x$build_stored = xyes; then
669 STORED_DIR="src/stored"
675 dnl ---------------------------------------------------
676 dnl Check for conio (Bacula readline substitute)(
677 dnl ---------------------------------------------------
678 dnl this allows you to turn it completely off
680 AC_HELP_STRING([--disable-conio], [disable conio support @<:@default=no@:>@]),
682 if test x$enableval = xno; then
689 dnl ---------------------------------------------------
690 dnl Check for IPv6 support
691 dnl ---------------------------------------------------
692 dnl this allows you to turn it completely off
695 AC_HELP_STRING([--enable-ipv6], [enable ipv6 support @<:@default=yes@:>@]),
697 if test x$enableval = xno; then
703 if test x$support_ipv6 = xyes; then
704 AC_TRY_LINK([ #include <sys/types.h>
705 #include <sys/socket.h>
706 #include <netinet/in.h>], [struct in6_addr t=in6addr_any; t.s6_addr[0] = 0;],
707 [support_in6addr_any=yes], [support_in6addr_any=no])
709 if test x$support_in6addr_any = xno ; then
710 in6addr_any="const struct in6_addr in6addr_any"
715 AC_TRY_LINK([ #include <sys/types.h>
716 #include <sys/socket.h>
717 #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;],
718 [support_ipv6=yes], [support_ipv6=no])
721 if test x$support_ipv6 = xyes; then
722 AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
724 if test x$support_in6addr_any = xno ; then
725 AC_DEFINE(NEED_IN6ADDR_ANY,1,[Whether to have in6addr_any support])
730 AC_CHECK_HEADER(curses.h, [
731 AC_CHECK_LIB(tinfo, tgetent, [ TERM_LIB="-ltinfo" ], [
732 AC_CHECK_LIB(ncurses, tgetent, [ TERM_LIB="-lncurses" ], [
733 AC_CHECK_LIB(termcap, tgetent, [ TERM_LIB="-ltermcap" ])
737 [ AC_CHECK_HEADERS(curses.h)
738 AC_CHECK_HEADER(term.h,
739 [ AC_CHECK_LIB(curses, tgetent,
740 [ TERM_LIB="-lcurses" ] )
746 if test x$support_conio = xyes; then
747 if test x$TERM_LIB != x; then
753 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
755 echo " "; echo "Required libraries not found. CONIO turned off ..."; echo " "
760 dnl ---------------------------------------------------
761 dnl Check for readline support/directory (default off)
762 dnl ---------------------------------------------------
763 dnl this allows you to turn it completely off
764 AC_ARG_ENABLE(readline,
765 AC_HELP_STRING([--disable-readline], [disable readline support @<:@default=yes@:>@]),
767 if test x$enableval = xno; then
775 if test x$support_readline = xyes; then
776 AC_ARG_WITH(readline,
777 AC_HELP_STRING([--with-readline@<:@=DIR@:>@], [specify readline library directory]),
779 case "$with_readline" in
784 if test -f ${with_readline}/readline.h; then
785 CONS_INC="-I${with_readline}"
786 CONS_LDFLAGS="-L$with_readline"
787 elif test -f ${with_readline}/include/readline/readline.h; then
788 CONS_INC="-I${with_readline}/include/readline"
789 CONS_LDFLAGS="-L${with_readline}/lib"
790 with_readline="${with_readline}/include/readline"
792 with_readline="/usr/include/readline"
795 AC_CHECK_HEADER(${with_readline}/readline.h,
797 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
798 CONS_LIBS="-lreadline -lhistory ${TERM_LIB}"
802 echo "readline.h not found. readline turned off ..."
809 dnl check for standard readline library
810 AC_CHECK_HEADER(/usr/include/readline/readline.h,
812 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
814 CONS_INC="-I/usr/include/readline"
815 CONS_LIBS="-lreadline ${TERM_LIB}"
817 dnl Did not find standard library, so try Bacula's default
818 AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h,
820 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
822 CONS_INC="-I${TOP_DIR}/depkgs/readline"
823 CONS_LIBS="-lreadline -lhistory ${TERM_LIB}"
824 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
825 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
828 echo "readline.h not found. readline turned off ..."
842 AC_SUBST(CONS_LDFLAGS)
843 AC_SUBST(READLINE_SRC)
845 dnl Minimal stuff for readline Makefile configuration
850 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr)
851 AC_CHECK_FUNCS(lstat lchown lchmod futimes fchmod fchown)
852 AC_CHECK_FUNCS(nanosleep nl_langinfo)
853 AC_CHECK_FUNCS(be64toh htobe64)
854 AC_CHECK_HEADERS(varargs.h)
856 dnl End of readline/conio stuff
857 dnl -----------------------------------------------------------------------
860 dnl Find where sockets are (especially for Solaris)
861 dnl Do this before the TCP Wrappers test since tcp wrappers
862 dnl uses the socket library and some linkers are stupid.
864 AC_CHECK_FUNC(socket,
865 AC_MSG_RESULT(using libc's socket),
866 AC_CHECK_LIB(xnet,socket)
867 AC_CHECK_LIB(socket,socket)
868 AC_CHECK_LIB(inet,socket))
870 dnl -----------------------------------------------------------
871 dnl Check whether user wants TCP wrappers support (default off)
872 dnl -----------------------------------------------------------
875 AC_ARG_WITH(tcp-wrappers,
876 AC_HELP_STRING([--with-tcp-wrappers@<:@=DIR@:>@], [enable tcpwrappers support]),
878 if test "x$withval" != "xno" ; then
880 LIBS="$saved_LIBS -lwrap"
881 AC_SEARCH_LIBS(nanosleep, [rt])
882 AC_MSG_CHECKING(for libwrap)
885 #include <sys/types.h>
887 int deny_severity = 0;
888 int allow_severity = 0;
889 struct request_info *req;
894 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
899 LIBS="$saved_LIBS -lwrap -lnsl"
900 WRAPLIBS="$saved_LIBS -lwrap -lnsl"
903 #include <sys/types.h>
905 int deny_severity = 0;
906 int allow_severity = 0;
907 struct request_info *req;
912 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
917 AC_MSG_ERROR([*** libwrap missing])
926 dnl -----------------------------------------------------------
927 dnl Check whether OpenSSL is available
928 dnl -----------------------------------------------------------
929 AC_MSG_CHECKING([for OpenSSL])
930 dnl The following uses quadrigraphs:
934 AC_HELP_STRING([--with-openssl@<:@=DIR@:>@], [Include OpenSSL support. DIR is the OpenSSL base]),
936 with_openssl_directory=${withval}
940 if test "x$with_openssl_directory" != "xno"; then
941 OPENSSL_LIBS="-lssl -lcrypto"
944 if test "x$with_openssl_directory" != "xyes" && test x"${with_openssl_directory}" != "x"; then
946 # Make sure the $with_openssl_directory also makes sense
948 if test -d "$with_openssl_directory/lib" -a -d "$with_openssl_directory/include"; then
949 OPENSSL_LIBS="-L$with_openssl_directory/lib $OPENSSL_LIBS"
950 OPENSSL_INC="-I$with_openssl_directory/include $OPENSSL_INC"
955 saved_CFLAGS="${CFLAGS}"
956 LIBS="${saved_LIBS} ${OPENSSL_LIBS}"
957 CFLAGS="${saved_CFLAGS} ${OPENSSL_INC}"
961 #include <openssl/ssl.h>
963 CRYPTO_set_id_callback(NULL);
975 #include <openssl/evp.h>
979 ac_cv_openssl_sha2="yes"
981 ac_cv_openssl_sha2="no"
985 dnl Solaris disables greater than 128+ bit encryption in their OpenSSL
986 dnl implementation, presumably for export reasons. If 192bit AES
987 dnl is available, we assume that we're running with a 'non-export'
991 #include <openssl/evp.h>
995 ac_cv_openssl_export="no"
997 ac_cv_openssl_export="yes"
1001 AC_MSG_RESULT([$support_tls])
1002 if test "$support_tls" = "yes"; then
1003 AC_DEFINE(HAVE_OPENSSL, 1, [Define if OpenSSL library is available])
1004 AC_DEFINE(HAVE_TLS, 1, [Define if TLS support should be enabled])
1005 AC_DEFINE(HAVE_CRYPTO, 1, [Define if encryption support should be enabled])
1008 if test "$ac_cv_openssl_sha2" = "yes"; then
1009 AC_DEFINE(HAVE_SHA2, 1, [Define if the SHA-2 family of digest algorithms is available])
1012 if test "$ac_cv_openssl_export" = "yes"; then
1013 AC_DEFINE(HAVE_OPENSSL_EXPORT_LIBRARY, 1, [Define if the OpenSSL library is export-contrained to 128bit ciphers])
1016 if test "$support_crypto" = "yes"; then
1017 AC_CHECK_LIB(crypto, EVP_PKEY_encrypt_old, AC_DEFINE(HAVE_OPENSSLv1, 1, [Set if have OpenSSL version 1.x]))
1020 LIBS="${saved_LIBS}"
1021 CFLAGS="${saved_CFLAGS}"
1025 AC_MSG_RESULT([$support_tls])
1028 if test "$support_tls" = "no" -o "$support_crypto" = "no"; then
1033 AC_SUBST(OPENSSL_LIBS)
1034 AC_SUBST(OPENSSL_INC)
1036 dnl -----------------------------------------------------------
1037 dnl dlopen is needed for plugins
1038 dnl -----------------------------------------------------------
1039 AC_SEARCH_LIBS(dlopen, [dl])
1041 dnl ------------------------------------------
1042 dnl Where to place working dir
1043 dnl ------------------------------------------
1044 working_dir=`eval echo /opt/bacula/working`
1045 AC_ARG_WITH(working-dir,
1046 AC_HELP_STRING([--with-working-dir=PATH], [specify path of Bacula working directory]),
1048 if test "x$withval" != "xno" ; then
1049 working_dir=$withval
1054 AC_SUBST(working_dir)
1056 dnl ------------------------------------------------------------------
1057 dnl If the user has not set archivedir, we set our default as /tmp
1058 dnl ------------------------------------------------------------------
1060 AC_ARG_WITH(archivedir,
1061 AC_HELP_STRING([--with-archivedir=PATH], [specify path of SD archive directory]),
1063 if test "x$withval" != "xno" ; then
1069 AC_SUBST(archivedir)
1071 dnl ------------------------------------------------------------------
1072 dnl Allow the user to specify the daemon resource name default hostname
1073 dnl ------------------------------------------------------------------
1075 AC_ARG_WITH(basename,
1076 AC_HELP_STRING([--with-basename=RESNAME], [specify base resource name for daemons]),
1078 if test "x$withval" != "xno" ; then
1086 dnl ------------------------------------------------------------------
1087 dnl Allow the user to override the hostname (default = machine hostname)
1088 dnl ------------------------------------------------------------------
1089 hostname=`uname -n | cut -d '.' -f 1`
1090 if test x${hostname} = x ; then
1091 hostname="localhost"
1093 dnl Make sure hostname is resolved
1094 ping -c 1 $hostname 2>/dev/null 1>/dev/null
1095 if test ! $? = 0; then
1096 hostname="localhost"
1098 AC_ARG_WITH(hostname,
1099 AC_HELP_STRING([--with-hostname=RESNAME], [specify host name for daemons]),
1101 if test "x$withval" != "xno" ; then
1110 dnl ------------------------------------------
1111 dnl Where to place scriptdir (script files)
1112 dnl ------------------------------------------
1113 scriptdir=`eval echo ${sysconfdir}`
1114 AC_ARG_WITH(scriptdir,
1115 AC_HELP_STRING([--with-scriptdir=PATH], [specify path of Bacula scripts directory]),
1117 if test "x$withval" != "xno" ; then
1126 dnl ------------------------------------------
1127 dnl Where to place bsrdir (bsr files)
1128 dnl ------------------------------------------
1129 bsrdir=`eval echo /opt/bacula/bsr`
1131 AC_HELP_STRING([--with-bsrdir=PATH], [specify path of Bacula bsrs directory]),
1133 if test "x$withval" != "xno" ; then
1141 dnl ------------------------------------------
1142 dnl Where to place logdir
1143 dnl ------------------------------------------
1144 logdir=`eval echo /opt/bacula/log`
1146 AC_HELP_STRING([--with-logdir=PATH], [specify path of Bacula logs directory]),
1148 if test "x$withval" != "xno" ; then
1157 # ------------------------------------------
1158 # Where to place plugindir (plugin files)
1159 # ------------------------------------------
1160 plugindir=`eval echo ${libdir}`
1161 AC_ARG_WITH(plugindir,
1162 AC_HELP_STRING([--with-plugindir=PATH], [specify path of Bacula plugins directory]),
1164 if test "x$withval" != "xno" ; then
1172 dnl ------------------------------------------
1173 dnl Where to send dump email
1174 dnl ------------------------------------------
1176 dnl ------------------------------------------
1177 dnl Where to send dump email
1178 dnl ------------------------------------------
1179 dump_email=root@localhost
1180 AC_ARG_WITH(dump-email,
1181 AC_HELP_STRING([--with-dump-email=EMAIL], [dump email address]),
1183 if test "x$withval" != "xno" ; then
1189 AC_SUBST(dump_email)
1191 dnl ------------------------------------------
1192 dnl Where to send job email
1193 dnl ------------------------------------------
1194 job_email=root@localhost
1195 AC_ARG_WITH(job-email,
1196 AC_HELP_STRING([--with-job-email=EMAIL], [job output email address]),
1198 if test "x$withval" != "xno" ; then
1206 dnl ------------------------------------------
1207 dnl Where to find smtp host
1208 dnl ------------------------------------------
1210 AC_ARG_WITH(smtp_host,
1211 AC_HELP_STRING([--with-smtp-host=HOST], [SMTP mail host address]),
1213 if test "x$withval" != "xno" ; then
1221 dnl ------------------------------------
1222 dnl Where to place pid files
1223 dnl ------------------------------------
1225 AC_ARG_WITH(pid-dir,
1226 AC_HELP_STRING([--with-pid-dir=PATH], [specify location of Bacula pid files]),
1228 if test "x$withval" != "xno" ; then
1234 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
1237 dnl ------------------------------------
1238 dnl Where to place subsys "lock file"
1239 dnl ------------------------------------
1240 subsysdir=/var/run/subsys
1241 if test -d /var/run/subsys; then
1242 subsysdir=/var/run/subsys
1243 elif test -d /var/lock/subsys; then
1244 subsysdir=/var/lock/subsys
1246 subsysdir=/var/run/subsys
1248 AC_ARG_WITH(subsys-dir,
1249 AC_HELP_STRING([--with-subsys-dir=PATH], [specify location of Bacula subsys file]),
1251 if test "x$withval" != "xno" ; then
1259 dnl ------------------------------------
1260 dnl Where to start assigning ports
1261 dnl ------------------------------------
1263 AC_ARG_WITH(baseport,
1264 AC_HELP_STRING([--with-baseport=PORT], [specify base port address for daemons]),
1266 if test "x$withval" != "xno" ; then
1273 dir_port=`expr $baseport`
1274 fd_port=`expr $baseport + 1`
1275 sd_port=`expr $fd_port + 1`
1281 dnl ------------------------------------------
1282 dnl Generate passwords
1283 dnl ------------------------------------------
1285 AC_ARG_WITH(dir-password,
1286 AC_HELP_STRING([--with-dir-password=PASSWORD], [specify Director's password]),
1288 if test "x$withval" != "xno" ; then
1289 dir_password=$withval
1294 if test "x$dir_password" = "x" ; then
1295 if test "x$OPENSSL" = "xnone" ; then
1296 key=`autoconf/randpass 33`
1298 key=`openssl rand -base64 33`
1304 AC_ARG_WITH(fd-password,
1305 AC_HELP_STRING([--with-fd-password=PASSWORD], [specify Client's password]),
1307 if test "x$withval" != "xno" ; then
1308 fd_password=$withval
1313 if test "x$fd_password" = "x" ; then
1314 if test "x$OPENSSL" = "xnone" ; then
1315 key=`autoconf/randpass 37`
1317 key=`openssl rand -base64 33`
1323 AC_ARG_WITH(sd-password,
1324 AC_HELP_STRING([--with-sd-password=PASSWORD], [specify Storage daemon's password]),
1326 if test "x$withval" != "xno" ; then
1327 sd_password=$withval
1332 if test "x$sd_password" = "x" ; then
1333 if test "x$OPENSSL" = "xnone" ; then
1334 key=`autoconf/randpass 41`
1336 key=`openssl rand -base64 33`
1342 AC_ARG_WITH(mon-dir-password,
1343 AC_HELP_STRING([--with-mon-dir-password=PASSWORD], [specify Director's password used by the monitor]),
1345 if test "x$withval" != "xno" ; then
1346 mon_dir_password=$withval
1351 if test "x$mon_dir_password" = "x" ; then
1352 if test "x$OPENSSL" = "xnone" ; then
1353 key=`autoconf/randpass 33`
1355 key=`openssl rand -base64 33`
1357 mon_dir_password=$key
1361 AC_ARG_WITH(mon-fd-password,
1362 AC_HELP_STRING([--with-mon-fd-password=PASSWORD], [specify Client's password used by the monitor]),
1364 if test "x$withval" != "xno" ; then
1365 mon_fd_password=$withval
1370 if test "x$mon_fd_password" = "x" ; then
1371 if test "x$OPENSSL" = "xnone" ; then
1372 key=`autoconf/randpass 37`
1374 key=`openssl rand -base64 33`
1376 mon_fd_password=$key
1380 AC_ARG_WITH(mon-sd-password,
1381 AC_HELP_STRING([--with-mon-sd-password=PASSWORD], [specify Storage daemon's password used by the monitor]),
1383 if test "x$withval" != "xno" ; then
1384 mon_sd_password=$withval
1389 if test "x$mon_sd_password" = "x" ; then
1390 if test "x$OPENSSL" = "xnone" ; then
1391 key=`autoconf/randpass 41`
1393 key=`openssl rand -base64 33`
1395 mon_sd_password=$key
1398 AC_SUBST(dir_password)
1399 AC_SUBST(fd_password)
1400 AC_SUBST(sd_password)
1401 AC_SUBST(mon_dir_password)
1402 AC_SUBST(mon_fd_password)
1403 AC_SUBST(mon_sd_password)
1406 dnl Pickup any database name
1409 AC_ARG_WITH(db_name,
1410 AC_HELP_STRING([--with-db-name=DBNAME], [specify database name @<:@default=bacula@:>@]),
1412 if test "x$withval" != "x" ; then
1420 AC_ARG_WITH(db_user,
1421 AC_HELP_STRING([--with-db-user=UNAME], [specify database user @<:@default=bacula@:>@]),
1423 if test "x$withval" != "x" ; then
1431 AC_ARG_WITH(db_password,
1432 AC_HELP_STRING([--with-db-password=PWD], [specify database password @<:@default=*none*@:>@]),
1434 if test "x$withval" != "x" ; then
1435 db_password=$withval
1439 AC_SUBST(db_password)
1442 dnl Pickup a database port
1445 AC_ARG_WITH(db_port,
1446 AC_HELP_STRING([--with-db-port=DBPORT], [specify a database port @<:@default=null@:>@]),
1448 if test "x$withval" != "x" ; then
1456 dnl Pickup MySQL SSL options for database user connection
1459 AC_ARG_WITH(db_ssl_options,
1460 AC_HELP_STRING([--with-db-ssl-options=DBSSLOPTIONS], [specify SSL options for database user connection @<:@default=null@:>@]),
1462 if test "x$withval" != "x" ; then
1463 db_ssl_options=$withval
1467 AC_SUBST(db_ssl_options)
1470 # Handle users and groups for each daemon
1473 AC_ARG_WITH(dir_user,
1474 AC_HELP_STRING([--with-dir-user=USER], [specify user for Director daemon]),
1476 if test "x$withval" != "x" ; then
1483 AC_ARG_WITH(dir_group,
1484 AC_HELP_STRING([--with-dir-group=GROUP], [specify group for Director daemon]),
1486 if test "x$withval" != "x" ; then
1493 AC_ARG_WITH(sd_user,
1494 AC_HELP_STRING([--with-sd-user=USER], [specify user for Storage daemon]),
1496 if test "x$withval" != "x" ; then
1503 AC_ARG_WITH(sd_group,
1504 AC_HELP_STRING([--with-sd-group=GROUP], [specify group for Storage daemon]),
1506 if test "x$withval" != "x" ; then
1513 AC_ARG_WITH(fd_user,
1514 AC_HELP_STRING([--with-fd-user=USER], [specify user for File daemon]),
1516 if test "x$withval" != "x" ; then
1523 AC_ARG_WITH(fd_group,
1524 AC_HELP_STRING([--with-fd-group=GROUP], [specify group for File daemon]),
1526 if test "x$withval" != "x" ; then
1540 dnl allow setting default executable permissions
1543 AC_ARG_WITH(sbin-perm,
1544 AC_HELP_STRING([--with-sbin-perm=MODE], [specify permissions for sbin binaries @<:@default=0750@:>@]),
1546 if test "x$withval" != "x" ; then
1554 dnl -------------------------------------------
1555 dnl enable batch attribute DB insert (default on)
1556 dnl -------------------------------------------
1557 support_batch_insert=yes
1558 AC_ARG_ENABLE(batch-insert,
1559 AC_HELP_STRING([--enable-batch-insert], [enable the DB batch insert code @<:@default=yes@:>@]),
1561 if test x$enableval = xno; then
1562 support_batch_insert=no
1567 if test x$support_batch_insert = xyes; then
1568 AC_DEFINE(USE_BATCH_FILE_INSERT, 1, [Set if DB batch insert code enabled])
1571 dnl ------------------------------------------------
1572 dnl Bacula check for various SQL database engines
1573 dnl ------------------------------------------------
1576 dnl Set uncomment_dbi by default to '#' if DBI is enabled this will get reset
1580 BA_CHECK_POSTGRESQL_DB
1586 dnl -------------------------------------------
1587 dnl If no batch insert backend are enable set
1588 dnl variable to None
1589 dnl -------------------------------------------
1590 if test -z "${batch_insert_db_backends}"; then
1591 batch_insert_db_backends="None"
1594 dnl -------------------------------------------
1595 dnl Make sure at least one database backend is found
1596 dnl -------------------------------------------
1597 if test "x${db_backends}" = "x" ; then
1600 echo "You have not specified either --enable-client-only or one of the"
1601 echo "supported databases: MySQL, PostgreSQL, or SQLite3."
1602 echo "This is not permitted. Please reconfigure."
1604 echo "Aborting the configuration ..."
1610 dnl -------------------------------------------
1611 dnl See how many catalog backends are configured.
1612 dnl -------------------------------------------
1613 case `echo $DB_BACKENDS | wc -w | sed -e 's/^ *//'` in
1615 DEFAULT_DB_TYPE="${DB_BACKENDS}"
1616 if test x$use_libtool = xno; then
1617 SHARED_CATALOG_TARGETS=""
1619 SHARED_CATALOG_TARGETS="libbaccats-${DEFAULT_DB_TYPE}.la"
1623 dnl ------------------------------------------------
1624 dnl Set the default backend to the first backend found
1625 dnl ------------------------------------------------
1626 DEFAULT_DB_TYPE=`echo ${DB_BACKENDS} | cut -d' ' -f1`
1628 dnl ------------------------------------------------
1629 dnl For multiple backend we need libtool support.
1630 dnl ------------------------------------------------
1631 if test x$use_libtool = xno; then
1634 echo "You have specified two or more of the"
1635 echo "supported databases: MySQL, PostgreSQL, or SQLite3."
1636 echo "This is not permitted when not using libtool Please reconfigure."
1638 echo "Aborting the configuration ..."
1644 SHARED_CATALOG_TARGETS=""
1645 for db_type in ${DB_BACKENDS}
1647 if test -z "${SHARED_CATALOG_TARGETS}"; then
1648 SHARED_CATALOG_TARGETS="libbaccats-${db_type}.la"
1650 SHARED_CATALOG_TARGETS="${SHARED_CATALOG_TARGETS} libbaccats-${db_type}.la"
1656 dnl -------------------------------------------
1657 dnl Unset DB_LIBS when using libtool as we link the
1658 dnl shared library using the right database lib no need to
1659 dnl set DB_LIBS which is only used for non shared versions
1660 dnl of the backends.
1661 dnl -------------------------------------------
1662 if test x$use_libtool = xyes; then
1666 AC_SUBST(uncomment_dbi)
1667 AC_SUBST(DB_BACKENDS)
1669 AC_SUBST(DEFAULT_DB_TYPE)
1670 AC_SUBST(SHARED_CATALOG_TARGETS)
1672 AC_DEFINE(PROTOTYPES)
1674 dnl --------------------------------------------------------------------------
1675 dnl Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
1677 if test -z "$CFLAGS" -o "$CFLAGS" = "-g -O2"; then
1678 if test -z "$CCOPTS"; then
1679 CCOPTS='-g -O2 -Wall'
1687 dnl See if we can use 64 bit file addresses
1688 largefile_support="no"
1693 dnl --------------------------------------------------------------------------
1694 dnl CHECKING FOR HEADER FILES
1695 dnl --------------------------------------------------------------------------
1734 AC_STRUCT_ST_BLKSIZE
1738 dnl --------------------------------------------------------------------------
1739 dnl Check for utime.h structure
1740 dnl --------------------------------------------------------------------------
1741 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
1745 #include <sys/types.h>
1750 ba_cv_header_utime_h=yes
1752 ba_cv_header_utime_h=no
1757 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H, 1, [Set if utime.h exists])
1759 dnl --------------------------------------------------------------------------
1760 dnl Check for socklen_t
1761 dnl --------------------------------------------------------------------------
1762 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
1766 #include <sys/types.h>
1767 #include <sys/socket.h>
1771 ba_cv_header_socklen_t=yes
1773 ba_cv_header_socklen_t=no
1778 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T, 1, [Set if socklen_t exists])
1780 dnl --------------------------------------------------------------------------
1781 dnl Check for ioctl request type
1782 dnl --------------------------------------------------------------------------
1784 AC_CACHE_CHECK(for ioctl_req_t, ba_cv_header_ioctl_req_t,
1789 #include <sys/types.h>
1790 #include <sys/ioctl.h>
1792 int (*d_ioctl)(int fd, unsigned long int request, ...);
1795 ba_cv_header_ioctl_req_t=yes
1797 ba_cv_header_ioctl_req_t=no
1802 test $ba_cv_header_ioctl_req_t = yes && AC_DEFINE(HAVE_IOCTL_ULINT_REQUEST, 1, [Set if ioctl request is unsigned long int])
1804 dnl Note: it is more correct to use AC_LANG(C++) but some of the older
1805 dnl *BSD systems still use old style C prototypes, which are wrong with
1806 dnl compiled with a C++ compiler.
1809 dnl --------------------------------------------------------------------------
1810 dnl Check for typeof()
1811 dnl --------------------------------------------------------------------------
1813 AC_CACHE_CHECK(for typeof, ba_cv_have_typeof,
1817 main(){char *a = 0; a = (typeof a)a;}
1819 ba_cv_have_typeof=yes
1821 ba_cv_have_typeof=no
1823 ba_cv_have_typeof=no
1828 test $ba_cv_have_typeof = yes && AC_DEFINE([HAVE_TYPEOF], 1, [Defind to 1 if compiler has typeof])
1833 AC_C_BIGENDIAN([AC_DEFINE([HAVE_BIG_ENDIAN], [1], [Big Endian])], [AC_DEFINE([HAVE_LITTLE_ENDIAN], [1], [Little Endian])])
1835 dnl --------------------------------------------------------------------------
1836 dnl CHECKING FOR FILESYSTEM TYPE
1837 dnl --------------------------------------------------------------------------
1838 AC_MSG_CHECKING(how to get filesystem type)
1840 # The order of these tests is important.
1843 #include <sys/statvfs.h>
1844 #include <sys/fstyp.h>
1846 AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4
1848 if test $fstype = no; then
1851 #include <sys/statfs.h>
1852 #include <sys/fstyp.h>
1854 AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3
1857 if test $fstype = no; then
1860 #include <sys/statfs.h>
1861 #include <sys/vmount.h>
1863 AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX
1866 if test $fstype = no; then
1871 AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD
1874 if test $fstype = no; then
1875 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
1877 if test $fstype = no; then
1880 #include <sys/mount.h>
1881 #include <sys/fs_types.h>
1883 AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix
1886 AC_MSG_RESULT($fstype)
1888 AC_CHECK_HEADER(sys/statvfs.h, [ AC_DEFINE(HAVE_SYS_STATVFS_H,1,[Defines if your system have the sys/statvfs.h header file])] , )
1891 AC_CHECK_FUNCS(backtrace)
1894 dnl --------------------------------------------------------------------------
1895 dnl CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
1896 dnl --------------------------------------------------------------------------
1906 AC_CHECK_TYPE(ino_t, unsigned long)
1907 AC_CHECK_TYPE(dev_t, unsigned long)
1908 AC_CHECK_TYPE(daddr_t, long)
1909 AC_CHECK_TYPE(major_t, int)
1910 AC_CHECK_TYPE(minor_t, int)
1911 AC_CHECK_TYPE(ssize_t, int)
1918 AC_CHECK_SIZEOF(char, 1)
1919 AC_CHECK_SIZEOF(short int, 2)
1920 AC_CHECK_SIZEOF(int, 4)
1921 AC_CHECK_SIZEOF(long int, 4)
1922 AC_CHECK_SIZEOF(long long int, 8)
1923 AC_CHECK_SIZEOF(int *, 4)
1925 dnl Check for sys/types.h types
1926 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int,
1930 #include <sys/types.h>
1934 ac_cv_have_u_int="yes"
1936 ac_cv_have_u_int="no"
1941 if test "x$ac_cv_have_u_int" = "xyes" ; then
1942 AC_DEFINE(HAVE_U_INT)
1946 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t,
1950 #include <sys/types.h>
1954 ac_cv_have_intmax_t="yes"
1962 ac_cv_have_intmax_t="yes"
1964 ac_cv_have_intmax_t="no"
1971 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
1972 AC_DEFINE(HAVE_INTMAX_T)
1976 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t,
1980 #include <sys/types.h>
1982 u_intmax_t a; a = 1;
1984 ac_cv_have_u_intmax_t="yes"
1990 u_intmax_t a; a = 1;
1992 ac_cv_have_u_intmax_t="yes"
1994 ac_cv_have_u_intmax_t="no"
2001 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
2002 AC_DEFINE(HAVE_U_INTMAX_T)
2006 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t,
2010 #include <sys/types.h>
2012 int8_t a; int16_t b; int32_t c; a = b = c = 1;
2014 ac_cv_have_intxx_t="yes"
2016 ac_cv_have_intxx_t="no"
2021 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
2022 AC_DEFINE(HAVE_INTXX_T)
2026 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t,
2030 #include <sys/types.h>
2034 ac_cv_have_int64_t="yes"
2036 ac_cv_have_int64_t="no"
2041 if test "x$ac_cv_have_int64_t" = "xyes" ; then
2042 AC_DEFINE(HAVE_INT64_T)
2046 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t,
2050 #include <sys/types.h>
2052 u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;
2054 ac_cv_have_u_intxx_t="yes"
2056 ac_cv_have_u_intxx_t="no"
2061 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
2062 AC_DEFINE(HAVE_U_INTXX_T)
2066 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t,
2070 #include <sys/types.h>
2074 ac_cv_have_u_int64_t="yes"
2076 ac_cv_have_u_int64_t="no"
2081 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
2082 AC_DEFINE(HAVE_U_INT64_T)
2086 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
2087 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2089 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
2092 #include <sys/bitypes.h>
2094 int8_t a; int16_t b; int32_t c;
2095 u_int8_t e; u_int16_t f; u_int32_t g;
2096 a = b = c = e = f = g = 1;
2098 AC_DEFINE(HAVE_U_INTXX_T)
2099 AC_DEFINE(HAVE_INTXX_T)
2100 AC_DEFINE(HAVE_SYS_BITYPES_H)
2108 if test -z "$have_u_intxx_t" ; then
2109 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t,
2113 #include <sys/types.h>
2115 uint8_t a; uint16_t b;
2116 uint32_t c; a = b = c = 1;
2118 ac_cv_have_uintxx_t="yes"
2120 ac_cv_have_uintxx_t="no"
2125 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
2126 AC_DEFINE(HAVE_UINTXX_T)
2130 if (test -z "$have_u_int64_t" || test -z "$have_int64_t" && \
2131 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2133 AC_MSG_CHECKING([for int64_t and u_int64_t types in sys/bitypes.h])
2136 #include <sys/bitypes.h>
2138 int64_t a; u_int64_t b;
2141 AC_DEFINE(HAVE_U_INT64_T)
2142 AC_DEFINE(HAVE_INT64_T)
2150 if (test -z "$have_uintxx_t" && \
2151 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2153 AC_MSG_CHECKING([for uintXX_t types in sys/bitypes.h])
2156 #include <sys/bitypes.h>
2158 uint8_t a; uint16_t b;
2159 uint32_t c; a = b = c = 1;
2161 AC_DEFINE(HAVE_UINTXX_T)
2169 dnl --------------------------------------------------------------------------
2170 dnl CHECKING FOR REQUIRED LIBRARY FUNCTIONS
2171 dnl --------------------------------------------------------------------------
2187 [echo 'configure: cannot find needed function.'; exit 1]
2192 AC_DEFINE(HAVE_FCNTL_F_CLOSEM, 1, [Set if you have 'F_CLOSEM' fcntl flag]),
2194 [#include <fcntl.h>]
2199 AC_DEFINE(HAVE_FCNTL_LOCK, 1, [Set if fcntl supports file locking]),
2201 [#include <fcntl.h>]
2204 AC_CHECK_FUNC(closefrom, [AC_DEFINE(HAVE_CLOSEFROM, 1, [Define to 1 if you have the 'closefrom' function.])])
2205 AC_CHECK_FUNCS(getpagesize, [AC_DEFINE(HAVE_GETPAGESIZE, 1, [Set if have getpagesize])])
2206 AC_CHECK_FUNCS(malloc_trim, [AC_DEFINE(HAVE_MALLOC_TRIM, 1, [Set if have malloc_trim])])
2208 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
2209 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
2210 AC_CHECK_FUNCS(posix_fadvise)
2211 AC_CHECK_FUNCS(posix_fallocate)
2212 AC_CHECK_FUNCS(fdatasync)
2214 AC_CHECK_FUNCS(chflags)
2216 AC_CHECK_FUNCS(snprintf vsnprintf gethostid fseeko)
2218 AC_CACHE_CHECK(for va_copy, ba_cv_va_copy,
2223 void use_va_copy(va_list args){va_list args2; va_copy(args2,args); va_end(args2);}
2224 void call_use_va_copy(int junk,...){va_list args; va_start(args,junk); use_va_copy(args); va_end(args);}
2226 call_use_va_copy(1,2,3)
2235 test $ba_cv_va_copy = yes && AC_DEFINE(HAVE_VA_COPY, 1, [Set if va_copy exists])
2237 dnl --------------------------------------------------------------------------
2238 dnl CHECKING FOR THREAD SAFE FUNCTIONS
2239 dnl --------------------------------------------------------------------------
2240 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
2242 # If resolver functions are not in libc check for -lnsl or -lresolv.
2243 AC_CHECK_FUNC(gethostbyname_r,
2244 AC_MSG_RESULT(using libc's resolver),
2245 AC_CHECK_LIB(nsl,gethostbyname_r)
2246 AC_CHECK_LIB(resolv,gethostbyname_r))
2248 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
2249 AC_CHECK_FUNCS(inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)])
2250 AC_CHECK_FUNCS(gethostbyname2, [AC_DEFINE(HAVE_GETHOSTBYNAME2)])
2251 AC_CHECK_FUNCS(getnameinfo, [AC_DEFINE(HAVE_GETNAMEINFO)])
2254 dnl ----------------------------
2255 dnl check sa_len of sockaddr
2256 dnl ----------------------------
2257 AC_CACHE_CHECK(for struct sockaddr has a sa_len field, ac_cv_struct_sockaddr_sa_len,
2261 #include <sys/socket.h>
2263 struct sockaddr s; s.sa_len;
2265 ac_cv_struct_sockaddr_sa_len=yes
2266 ], [ac_cv_struct_sockaddr_sa_len=no
2272 if test $ac_cv_struct_sockaddr_sa_len = yes; then
2273 AC_DEFINE(HAVE_SA_LEN, 1, [Define if sa_len field exists in struct sockaddr])
2277 dnl check for working getaddrinfo()
2279 dnl Note that if the system doesn't have gai_strerror(), we
2280 dnl can't use getaddrinfo() because we can't get strings
2281 dnl describing the error codes.
2283 AC_CACHE_CHECK(for working getaddrinfo, ac_cv_working_getaddrinfo,
2289 #include <sys/types.h>
2290 #include <sys/socket.h>
2293 struct addrinfo hints, *ai;
2296 memset(&hints, 0, sizeof(hints));
2297 hints.ai_family = AF_UNSPEC;
2298 hints.ai_socktype = SOCK_STREAM;
2299 error = getaddrinfo("127.0.0.1", NULL, &hints, &ai);
2303 if (ai->ai_addr->sa_family != AF_INET) {
2309 ac_cv_working_getaddrinfo="yes"
2311 ac_cv_working_getaddrinfo="no"
2313 ac_cv_working_getaddrinfo="yes"
2318 AC_CHECK_FUNC(gai_strerror, [AC_DEFINE(HAVE_GAI_STRERROR, 1, [Define to 1 if you have the 'gai_strerror' function.])])
2320 if test "$ac_cv_working_getaddrinfo" = "yes"; then
2321 if test "$ac_cv_func_gai_strerror" != "yes"; then
2322 ac_cv_working_getaddrinfo="no"
2324 AC_DEFINE(HAVE_GETADDRINFO, 1, [Define to 1 if getaddrinfo exists and works])
2332 AC_CHECK_FUNCS(getmntinfo, [AC_DEFINE(HAVE_GETMNTINFO)])
2333 AC_FUNC_CLOSEDIR_VOID
2334 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
2335 # AC_FUNC_FNMATCH dnl use local version
2337 AC_CHECK_LIB(intl, gettext, [LIBS="$LIBS -lintl"])
2339 AC_CHECK_LIB(sun, getpwnam)
2341 AC_CHECK_HEADERS(zlib.h)
2342 AC_CHECK_LIB(z, deflate, [ZLIBS="-lz"])
2344 if test x$ZLIBS = x-lz; then
2345 AC_DEFINE(HAVE_LIBZ)
2351 dnl Check if we have AFS on this system
2357 AC_HELP_STRING([--disable-afs], [disable afs support @<:@default=auto@:>@]),
2359 if test x$enableval = xyes; then
2361 elif test x$enableval = xno; then
2368 if test x$support_afs = xyes -o x$support_afs = xauto; then
2370 AC_HELP_STRING([--with-afsdir@<:@=DIR@:>@], [Directory holding AFS includes/libs]),
2371 with_afsdir=$withval
2375 dnl Search in standard places, or --with-afsdir not specified
2377 if test x$with_afsdir = x; then
2378 for root in /usr /usr/local; do
2379 if test -d ${root}/include/afs/ ; then
2383 if test -d ${root}/include/openafs/afs/ ; then
2390 if test -d ${with_afsdir}/include/afs/ ; then
2391 AFS_CFLAGS="-I${with_afsdir}/include"
2393 if test -d ${with_afsdir}/include/openafs/afs/ ; then
2394 AFS_CFLAGS="-I${with_afsdir}/include/openafs"
2398 saved_CFLAGS="${CFLAGS}"
2399 saved_CPPFLAGS="${CPPFLAGS}"
2400 CFLAGS="${AFS_CFLAGS} ${saved_CFLAGS}"
2401 CPPFLAGS="${AFS_CFLAGS} ${saved_CPPFLAGS}"
2403 AC_CHECK_HEADERS(afs/afsint.h)
2406 #include <afs/afsint.h>
2407 #include <afs/venus.h>
2409 AC_DEFINE(HAVE_AFS_VENUS_H,1,[Define to 1 if you have the <afs/venus.h> header file.])
2412 CFLAGS="${saved_CFLAGS}"
2413 CPPFLAGS="${saved_CPPFLAGS}"
2416 dnl See if we can find a libsys with the pioctl symbol in there
2418 AC_MSG_CHECKING(for pioctl in AFS libsys)
2419 for dir in ${with_afsdir}/lib \
2420 ${with_afsdir}/lib/afs \
2421 ${with_afsdir}/lib/openafs \
2422 ${with_afsdir}/lib64 \
2423 ${with_afsdir}/lib64/afs \
2424 ${with_afsdir}/lib64/openafs
2426 for arch_type in .a .so
2428 A=`test -f ${dir}/libsys${arch_type} && nm ${dir}/libsys${arch_type} 2>/dev/null | grep pioctl`
2430 if test $pkg = 0; then
2432 AFS_LIBS="-L${dir} -lsys -lrx -llwp ${dir}/util${arch_type}"
2438 if test $have_afs = yes; then
2444 if test x$support_afs = xyes -a $have_afs != yes; then
2445 AC_MSG_ERROR([afs support explicitly enabled but no supported afs implementation found,
2446 please either load the afs libraries or rerun configure without --enable-afs])
2448 if test $have_afs = yes; then
2449 AC_DEFINE(HAVE_AFS,1,[Define to 1 if your system has AFS support])
2450 AC_DEFINE(HAVE_AFS_ACL,1,[Andrew FileSystem ACL support])
2454 AC_SUBST(AFS_CFLAGS)
2457 dnl ---------------------------------------------------
2458 dnl Check for lzo support/directory (default on)
2459 dnl ---------------------------------------------------
2460 dnl this allows you to turn it completely off
2463 AC_HELP_STRING([--disable-lzo], [disable lzo support @<:@default=yes@:>@]),
2465 if test x$enableval = xno; then
2476 if test x$support_lzo = xyes; then
2478 AC_HELP_STRING([--with-lzo@<:@=DIR@:>@], [specify lzo library directory]),
2485 if test -f ${with_lzo}/include/lzo/lzoconf.h; then
2486 LZO_INC="-I${with_lzo}/include"
2487 LZO_LDFLAGS="-L${with_lzo}/lib"
2488 with_lzo="${with_lzo}/include"
2490 with_lzo="/usr/include"
2493 AC_CHECK_HEADER(${with_lzo}/lzo/lzoconf.h,
2495 AC_DEFINE(HAVE_LZO, 1, [Define to 1 if you have LZO compression])
2496 LZO_LIBS="${LZO_LDFLAGS} -llzo2"
2500 echo "lzoconf.h not found. lzo turned off ..."
2507 AC_CHECK_HEADER(lzo/lzoconf.h,
2509 AC_CHECK_HEADER(lzo/lzo1x.h,
2511 AC_CHECK_LIB(lzo2, lzo1x_1_compress,
2514 AC_DEFINE(HAVE_LZO,1,[Define to 1 if you have LZO compression])
2527 dnl Check for ACL support and libraries
2531 AC_HELP_STRING([--disable-acl], [disable acl support @<:@default=auto@:>@]),
2533 if test x$enableval = xyes; then
2535 elif test x$enableval = xno; then
2542 have_extended_acl=no
2543 if test x$support_acl = xyes -o x$support_acl = xauto; then
2544 AC_CHECK_HEADER(sys/acl.h, [ AC_DEFINE(HAVE_SYS_ACL_H,1,[Defines if your system have the sys/acl.h header file])] , )
2547 dnl First check for acl_get_file in libc
2549 AC_CHECK_FUNC(acl_get_file,
2556 dnl Check for acl_get_file in libacl (Linux)
2558 if test $have_acl = no; then
2559 AC_CHECK_LIB(acl, acl_get_file,
2562 if test $have_afs = yes; then
2564 dnl Because of possible naming conflict with AFS libacl make sure we use the one in /usr/lib64 or /usr/lib !!!
2566 if test -d /usr/lib64/; then
2567 FDLIBS="-L/usr/lib64 -lacl $FDLIBS"
2569 FDLIBS="-L/usr/lib -lacl $FDLIBS"
2572 FDLIBS="-lacl $FDLIBS"
2579 dnl Check for acl_get_file in libpacl (OSF1)
2580 dnl and if ACL_TYPE_DEFAULT_DIR is defined.
2582 if test $have_acl = no -a \
2583 x${HAVE_OSF1_OS_TRUE} = x; then
2584 AC_CHECK_LIB(pacl, acl_get_file,
2587 FDLIBS="-lpacl $FDLIBS"
2591 AC_MSG_CHECKING(for ACL_TYPE_DEFAULT_DIR in acl.h include file)
2592 grep ACL_TYPE_DEFAULT_DIR /usr/include/sys/acl.h > /dev/null 2>&1
2593 if test $? = 0; then
2594 AC_DEFINE(HAVE_ACL_TYPE_DEFAULT_DIR,1,[Defines if your system have the ACL_TYPE_DEFAULT_DIR acl type])
2602 dnl On OSX check for availability of ACL_TYPE_EXTENDED
2604 if test $have_acl = yes -a \
2605 x${HAVE_DARWIN_OS_TRUE} = x; then
2606 AC_MSG_CHECKING(for ACL_TYPE_EXTENDED in acl.h include file)
2607 grep ACL_TYPE_EXTENDED /usr/include/sys/acl.h > /dev/null 2>&1
2608 if test $? = 0; then
2609 AC_DEFINE(HAVE_ACL_TYPE_EXTENDED,1,[Defines if your system have the ACL_TYPE_EXTENDED acl type])
2617 dnl On FreeBSD check for availability of ACL_TYPE_NFS4
2619 if test $have_acl = yes -a \
2620 x${HAVE_FREEBSD_OS_TRUE} = x; then
2621 AC_MSG_CHECKING(for ACL_TYPE_NFS4 in acl.h include file)
2622 grep ACL_TYPE_NFS4 /usr/include/sys/acl.h > /dev/null 2>&1
2623 if test $? = 0; then
2624 AC_DEFINE(HAVE_ACL_TYPE_NFS4,1,[Defines if your system have the ACL_TYPE_NFS4 acl type])
2632 dnl Check for acltotext and acl_totext (Solaris)
2634 if test $have_acl = no -a \
2635 x${HAVE_SUN_OS_TRUE} = x; then
2636 AC_CHECK_LIB(sec, acltotext,
2639 FDLIBS="-lsec $FDLIBS"
2641 AC_CHECK_LIB(sec, acl_totext,
2643 have_extended_acl=yes
2651 dnl Check for acl_get and aclx_get (AIX)
2653 if test $have_acl = no -a \
2654 x${HAVE_AIX_OS_TRUE} = x; then
2655 AC_CHECK_FUNC(acl_get,
2659 AC_CHECK_FUNC(aclx_get,
2661 have_extended_acl=yes
2668 if test x$support_acl = xyes -a $have_acl != yes; then
2669 AC_MSG_ERROR([acl support explicitly enabled but no supported acl implementation found,
2670 please either load the acl libraries or rerun configure without --enable-acl])
2672 if test $have_acl = yes; then
2673 AC_DEFINE([HAVE_ACL],1,[Normal acl support])
2676 if test $have_extended_acl = yes; then
2677 AC_DEFINE([HAVE_EXTENDED_ACL],1,[Extended acl support])
2683 dnl Check for XATTR support
2686 AC_ARG_ENABLE(xattr,
2687 AC_HELP_STRING([--disable-xattr], [disable xattr support @<:@default=auto@:>@]),
2689 if test x$enableval = xyes; then
2691 elif test x$enableval = xno; then
2698 if test x$support_xattr = xyes -o x$support_xattr = xauto; then
2700 dnl First check for *BSD support
2701 dnl When running on a BSD variant
2703 if test x${HAVE_FREEBSD_OS_TRUE} = x -o \
2704 x${HAVE_NETBSD_OS_TRUE} = x -o \
2705 x${HAVE_OPENBSD_OS_TRUE} = x; then
2706 AC_CHECK_HEADER(sys/extattr.h, [ AC_DEFINE(HAVE_SYS_EXTATTR_H,1,[Defines if your system have the sys/extattr.h header file])] , )
2707 AC_CHECK_HEADER(libutil.h, [ AC_DEFINE(HAVE_LIBUTIL_H,1,[Defines if your system have the libutil.h header file])] , )
2708 AC_CHECK_FUNCS(extattr_get_link extattr_set_link extattr_list_link,
2711 AC_DEFINE([HAVE_EXTATTR_GET_LINK],1,[Define to 1 if you have the 'extattr_get_link' function.])
2712 AC_DEFINE([HAVE_EXTATTR_SET_LINK],1,[Define to 1 if you have the 'extattr_set_link' function.])
2713 AC_DEFINE([HAVE_EXTATTR_LIST_LINK],1,[Define to 1 if you have the 'extattr_list_link' function.])
2717 if test $have_xattr = no; then
2718 AC_CHECK_FUNCS(extattr_get_file extattr_set_file extattr_list_file,
2721 AC_DEFINE([HAVE_EXTATTR_GET_FILE],1,[Define to 1 if you have the 'extattr_get_file' function.])
2722 AC_DEFINE([HAVE_EXTATTR_SET_FILE],1,[Define to 1 if you have the 'extattr_set_file' function.])
2723 AC_DEFINE([HAVE_EXTATTR_LIST_FILE],1,[Define to 1 if you have the 'extattr_list_file' function.])
2728 if test $have_xattr = yes; then
2729 have_extattr_string_in_libc=no
2730 AC_CHECK_FUNCS(extattr_namespace_to_string extattr_string_to_namespace,
2732 have_extattr_string_in_libc=yes
2733 AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2734 AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2739 dnl If extattr_namespace_to_string and extattr_string_to_namespace are not in libc see if they are in libutil
2741 if test $have_extattr_string_in_libc = no; then
2742 AC_CHECK_LIB(util, extattr_namespace_to_string extattr_string_to_namespace,
2744 AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2745 AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2746 FDLIBS="-lutil $FDLIBS"
2754 dnl If we failed to find *BSD support try the AIX implementation of extented attributes (EA)
2755 dnl When running on AIX
2757 if test $have_xattr = no -a \
2758 x${HAVE_AIX_OS_TRUE} = x; then
2759 AC_CHECK_HEADER(sys/ea.h, [ AC_DEFINE(HAVE_SYS_EA_H,1,[Defines if your system have the sys/ea.h header file])] , )
2760 AC_CHECK_FUNCS(llistea lgetea lsetea,
2763 AC_DEFINE([HAVE_LLISTEA],1,[Define to 1 if you have the 'llistea' function.])
2764 AC_DEFINE([HAVE_LGETEA],1,[Define to 1 if you have the 'lgetea' function.])
2765 AC_DEFINE([HAVE_LSETEA],1,[Define to 1 if you have the 'lsetea' function.])
2769 if test $have_xattr = no; then
2770 AC_CHECK_FUNCS(listea getea setea,
2773 AC_DEFINE([HAVE_LISTEA],1,[Define to 1 if you have the 'listea' function.])
2774 AC_DEFINE([HAVE_GETEA],1,[Define to 1 if you have the 'getea' function.])
2775 AC_DEFINE([HAVE_SETEA],1,[Define to 1 if you have the 'setea' function.])
2782 dnl If we failed to find AIX support try the TRU64 implementation of extented attributes
2783 dnl when running on a TRU64 OS.
2785 if test $have_xattr = no -a \
2786 x${HAVE_OSF1_OS_TRUE} = x; then
2787 AC_CHECK_HEADER(sys/proplist.h, [ AC_DEFINE(HAVE_SYS_PROPLIST_H,1,[Defines if your system have the sys/proplist.h header file])] , )
2788 AC_CHECK_FUNCS(getproplist get_proplist_entry sizeof_proplist_entry add_proplist_entry setproplist,
2791 AC_DEFINE([HAVE_GETPROPLIST],1,[Define to 1 if you have the 'getproplist' function.])
2792 AC_DEFINE([HAVE_GET_PROPLIST_ENTRY],1,[Define to 1 if you have the 'get_proplist_entry' function.])
2793 AC_DEFINE([HAVE_SIZEOF_PROPLIST_ENTRY],1,[Define to 1 if you have the 'sizeof_proplist_entry' function.])
2794 AC_DEFINE([HAVE_ADD_PROPLIST_ENTRY],1,[Define to 1 if you have the 'add_proplist_entry' function.])
2795 AC_DEFINE([HAVE_SETPROPLIST],1,[Define to 1 if you have the 'setproplist' function.])
2801 dnl If we failed to find TRU64 support try the SOLARIS implementation of extented and extensible attributes
2802 dnl when running on a Solaris.
2804 if test $have_xattr = no -a \
2805 x${HAVE_SUN_OS_TRUE} = x; then
2806 AC_CHECK_HEADER(sys/attr.h, [ AC_DEFINE(HAVE_SYS_ATTR_H,1,[Defines if your system have the sys/attr.h header file])] , )
2807 AC_CHECK_HEADER(sys/nvpair.h, [ AC_DEFINE(HAVE_SYS_NVPAIR_H,1,[Defines if your system have the sys/nvpair.h header file])] , )
2808 AC_CHECK_HEADER(attr.h, [ AC_DEFINE(HAVE_ATTR_H,1,[Defines if your system have the attr.h header file])] , )
2810 AC_CHECK_FUNCS(openat fstatat unlinkat fchownat futimesat,
2813 AC_DEFINE([HAVE_OPENAT],1,[Define to 1 if you have the 'openat' function.])
2814 AC_DEFINE([HAVE_FSTATAT],1,[Define to 1 if you have the 'fstatat' function.])
2815 AC_DEFINE([HAVE_UNLINKAT],1,[Define to 1 if you have the 'unlinkat' function.])
2816 AC_DEFINE([HAVE_FCHOWNAT],1,[Define to 1 if you have the 'fchownat' function.])
2817 AC_DEFINE([HAVE_FUTIMESAT],1,[Define to 1 if you have the 'futimesat' function.])
2821 if test $have_xattr = yes; then
2822 AC_CHECK_LIB(nvpair, nvlist_next_nvpair,
2824 AC_DEFINE([HAVE_NVLIST_NEXT_NVPAIR],1,[Define to 1 if you have the 'nvlist_next_nvpair' function.])
2825 FDLIBS="-lnvpair $FDLIBS"
2832 dnl If we failed to find Solaris support try the generic xattr support code
2834 if test $have_xattr = no; then
2835 AC_CHECK_HEADER(sys/xattr.h, [ AC_DEFINE(HAVE_SYS_XATTR_H,1,[Defines if your system have the sys/xattr.h header file])] , )
2836 AC_CHECK_FUNCS(llistxattr lgetxattr lsetxattr,
2839 AC_DEFINE([HAVE_LLISTXATTR],1,[Define to 1 if you have the 'llistxattr' function.])
2840 AC_DEFINE([HAVE_LGETXATTR],1,[Define to 1 if you have the 'lgetxattr' function.])
2841 AC_DEFINE([HAVE_LSETXATTR],1,[Define to 1 if you have the 'lsetxattr' function.])
2845 if test $have_xattr = no; then
2846 AC_CHECK_FUNCS(listxattr getxattr setxattr,
2849 AC_DEFINE([HAVE_LISTXATTR],1,[Define to 1 if you have the 'listxattr' function.])
2850 AC_DEFINE([HAVE_GETXATTR],1,[Define to 1 if you have the 'getxattr' function.])
2851 AC_DEFINE([HAVE_SETXATTR],1,[Define to 1 if you have the 'setxattr' function.])
2857 if test x$support_xattr = xyes -a $have_xattr != yes; then
2858 AC_MSG_ERROR([xattr support explicitly enabled but no supported xattr implementation found,
2859 please either load the xattr libraries or rerun configure without --enable-xattr])
2861 if test $have_xattr = yes; then
2862 AC_DEFINE([HAVE_XATTR],1,[Extended Attributes support])
2868 dnl Check for pthread libraries
2871 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
2873 AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
2875 AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
2877 AC_CHECK_FUNC(pthread_create)
2886 dnl Check for headers, functions and libraries required to support
2887 dnl keeping readall capabilities
2889 AC_CHECK_HEADERS(sys/prctl.h sys/capability.h)
2890 AC_CHECK_FUNCS(prctl setreuid)
2891 AC_CHECK_LIB([cap], [cap_set_proc], [CAP_LIBS="-lcap"], [CAP_LIBS=])
2892 if test x$CAP_LIBS = x-lcap; then
2893 AC_DEFINE(HAVE_LIBCAP, 1, [Define if you have libcap])
2902 if test x$have_gcc = xyes ; then
2903 CPPFLAGS="$CPPFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
2904 CFLAGS="$CFLAGS -x c++ -fno-strict-aliasing -fno-exceptions -fno-rtti"
2906 LDFLAGS=${LDFLAGS--O}
2907 CPPFLAGS="$CPPFLAGS"
2919 AC_SUBST(X_EXTRA_LIBS)
2924 dnl extra configurable objects
2935 dnl Finally we set appropriate distribution specific
2936 dnl variables and defaults
2941 COMPRESS_MANPAGES=yes
2946 PSCMD="ps -e -o pid,comm"
2947 PFILES="${PFILES} platforms/aix/Makefile"
2948 TAPEDRIVE="/dev/rmt0.1"
2952 PTHREAD_LIB="-lpthread -lexc"
2953 if test "${CC}" = "gcc" ; then
2960 TAPEDRIVE="/dev/nrmt0"
2963 DISTVER=`uname -a |awk '{print $3}'`
2964 TAPEDRIVE="/dev/nrmt0"
2965 PTHREAD_LIB="-pthread"
2966 CFLAGS="${CFLAGS} -pthread"
2967 PSCMD="ps -ax -o pid,command"
2971 platforms/bsdi/Makefile \
2972 platforms/bsdi/bacula-fd \
2973 platforms/bsdi/bacula-sd \
2974 platforms/bsdi/bacula-dir"
2975 largefile_support="yes"
2978 DISTVER=`uname -a |awk '{print $3}'`
2979 TAPEDRIVE="/dev/nrst0"
2982 WLDFLAGS="-mwindows"
2986 TAPEDRIVE="/dev/nst0"
2987 PSCMD="ps -e -o pid,command"
2990 platforms/darwin/Makefile"
2994 TAPEDRIVE="/dev/nst0"
2995 PSCMD="ps -e -o pid,command"
2998 platforms/osx/Makefile"
3001 if `test -f /etc/apt/sources.list && grep -q ubuntu /etc/apt/sources.list`; then
3004 DISTVER=`cat /etc/debian_version`
3005 if test -f /etc/lsb-release ; then
3007 if test "x$DISTRIB_ID" != "x" ; then
3008 DISTNAME=$DISTRIB_ID
3010 if test "x$DISTRIB_RELEASE" != "x" ; then
3011 DISTVER=$DISTRIB_RELEASE
3014 if test "$DISTNAME" = "Ubuntu" ; then
3017 TAPEDRIVE="/dev/nst0"
3018 PSCMD="ps -e -o pid,command"
3019 if test "$DISTNAME" = "ubuntu" ; then
3021 platforms/ubuntu/Makefile \
3022 platforms/ubuntu/bacula-fd \
3023 platforms/ubuntu/bacula-sd \
3024 platforms/ubuntu/bacula-dir"
3027 platforms/debian/Makefile \
3028 platforms/debian/bacula-fd \
3029 platforms/debian/bacula-sd \
3030 platforms/debian/bacula-dir"
3034 DISTVER=`uname -a |awk '{print $3}'`
3035 VER=`echo $DISTVER | cut -c 1`
3036 if test x$VER = x4 ; then
3037 PTHREAD_LIB="${PTHREAD_LIBS:--pthread}"
3038 CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS:--pthread}"
3042 TAPEDRIVE="/dev/nrsa0"
3043 PSCMD="ps -ax -o pid,command"
3045 platforms/freebsd/Makefile \
3046 platforms/freebsd/bacula-fd \
3047 platforms/freebsd/bacula-sd \
3048 platforms/freebsd/bacula-dir"
3049 largefile_support="yes"
3053 TAPEDRIVE="/dev/nst0"
3054 PSCMD="ps -e -o pid,command"
3056 platforms/hurd/Makefile \
3057 platforms/hurd/bacula-fd \
3058 platforms/hurd/bacula-sd \
3059 platforms/hurd/bacula-dir"
3062 PSCMD="UNIX95=1; ps -e -o pid,comm"
3063 CFLAGS="${CFLAGS} -D_XOPEN_SOURCE_EXTENDED=1"
3065 TAPEDRIVE="/dev/rmt/0hnb"
3066 PTHREAD_LIB="-lpthread"
3067 AC_DEFINE([_INCLUDE_LONGLONG])
3071 TAPEDRIVE="/dev/rmt/0cbn"
3072 PSCMD="ps -e -o pid,comm"
3074 platforms/irix/Makefile \
3075 platforms/irix/bacula-fd \
3076 platforms/irix/bacula-sd \
3077 platforms/irix/bacula-dir"
3080 DISTVER=`uname -a |awk '{print $3}'`
3083 TAPEDRIVE="/dev/nrst0"
3084 PSCMD="ps -ax -o pid,command"
3085 PTHREAD_LIB="-pthread"
3086 CFLAGS="${CFLAGS} -pthread"
3089 DISTVER=`uname -a |awk '{print $3}'`
3092 TAPEDRIVE="/dev/nrst0"
3093 PSCMD="ps -ax -o pid,command"
3094 PTHREAD_LIB="-pthread"
3095 CFLAGS="${CFLAGS} -pthread"
3097 platforms/openbsd/Makefile \
3098 platforms/openbsd/bacula-fd \
3099 platforms/openbsd/bacula-sd \
3100 platforms/openbsd/bacula-dir"
3103 if test -f /etc/whitebox-release ; then
3104 f=/etc/whitebox-release
3106 f=/etc/redhat-release
3108 if test `cat $f | grep release |\
3109 cut -f 3 -d ' '`x = "Enterprise"x ; then
3110 DISTVER="Enterprise "`cat $f | grep release |\
3113 DISTVER=`cat /etc/redhat-release | grep release |\
3116 TAPEDRIVE="/dev/nst0"
3117 PSCMD="ps -e -o pid,command"
3119 platforms/redhat/Makefile \
3120 platforms/redhat/bacula-fd \
3121 platforms/redhat/bacula-sd \
3122 platforms/redhat/bacula-dir
3126 DISTVER=`cat /etc/mandrake-release | grep release |\
3128 TAPEDRIVE="/dev/nst0"
3129 PSCMD="ps -e -o pid,command"
3131 platforms/mandrake/Makefile \
3132 platforms/mandrake/bacula-fd \
3133 platforms/mandrake/bacula-sd \
3134 platforms/mandrake/bacula-dir \
3138 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
3139 TAPEDRIVE="/dev/nst0"
3140 PSCMD="ps -e -o pid,command"
3142 platforms/gentoo/Makefile \
3143 platforms/gentoo/bacula-init \
3144 platforms/gentoo/bacula-fd \
3145 platforms/gentoo/bacula-sd \
3146 platforms/gentoo/bacula-dir"
3149 DISTVER=`cat /etc/slackware-version`
3150 TAPEDRIVE="/dev/nst0"
3151 PSCMD="ps -e -o pid,command"
3153 platforms/slackware/Makefile \
3154 platforms/slackware/rc.bacula-fd \
3155 platforms/slackware/rc.bacula-sd \
3156 platforms/slackware/rc.bacula-dir\
3157 platforms/slackware/functions.bacula"
3161 TAPEDRIVE="/dev/rmt/0cbn"
3162 PSCMD="ps -e -o pid,comm"
3164 platforms/solaris/Makefile \
3165 platforms/solaris/bacula-fd \
3166 platforms/solaris/bacula-sd \
3167 platforms/solaris/bacula-dir"
3171 AC_DEFINE(HAVE_OLD_SOCKOPT)
3172 AC_DEFINE(USE_THR_SETCONCURRENCY)
3175 AC_DEFINE(USE_THR_SETCONCURRENCY)
3180 LIBS="$LIBS -lresolv -lrt"
3183 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
3185 TAPEDRIVE="/dev/nst0"
3186 PSCMD="ps -e -o pid,command"
3188 platforms/suse/Makefile \
3189 platforms/suse/bacula-fd \
3190 platforms/suse/bacula-sd \
3191 platforms/suse/bacula-dir \
3192 platforms/suse/bacula"
3197 TAPEDRIVE="/dev/nst0"
3198 PSCMD="ps -e -o pid,command"
3200 platforms/suse/Makefile \
3201 platforms/suse/bacula-fd \
3202 platforms/suse/bacula-sd \
3203 platforms/suse/bacula-dir"
3207 TAPEDRIVE="/dev/nst0"
3210 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
3214 dnl -------------------------------------------
3215 dnl systemd (default off)
3216 dnl -------------------------------------------
3217 AC_MSG_CHECKING(for systemd support)
3218 AC_ARG_WITH(systemd,
3219 AC_HELP_STRING([--with-systemd@<:@=UNITDIR@:>@], [Include systemd support. UNITDIR is where systemd system .service files are located, default is to ask systemctl.]),
3221 if test "$withval" != "no"; then
3222 if test "$withval" = "yes"; then
3223 SYSTEMD_UNITDIR="`systemctl show | grep UnitPath | cut -d " " -f2`"
3225 SYSTEMD_UNITDIR="${withval}"
3229 platforms/systemd/Makefile \
3230 platforms/systemd/bacula-dir.service \
3231 platforms/systemd/bacula-fd.service \
3232 platforms/systemd/bacula-sd.service"
3233 AC_DEFINE(HAVE_SYSTEMD, 1, [Define to 1 if systemd support should be enabled])
3235 support_systemd="yes"
3238 support_systemd="no"
3241 support_systemd="no"
3245 AC_SUBST(SYSTEMD_UNITDIR)
3249 LIBS="$PTHREAD_LIB $LIBS"
3251 AC_DEFINE_UNQUOTED(lld, "$lld")
3252 AC_DEFINE_UNQUOTED(llu, "$llu")
3259 AC_SUBST(COMPRESS_MANPAGES)
3261 dnl common parts of the Makefile
3262 MCOMMON=./autoconf/Make.common
3263 AC_SUBST_FILE(MCOMMON)
3266 if test "x${subsysdir}" = "x${sbindir}" ; then
3269 echo "You have set both --sbindir and --with-subsys-dir"
3270 echo " equal to: ${subsysdir} "
3271 echo "This is not permitted. Please reconfigure."
3273 echo "Aborting configuration ..."
3280 AC_OUTPUT([autoconf/Make.common \
3283 scripts/btraceback \
3286 scripts/bacula-ctl-dir \
3287 scripts/bacula-ctl-fd \
3288 scripts/bacula-ctl-sd \
3289 scripts/devel_bacula \
3292 scripts/mtx-changer \
3293 scripts/disk-changer \
3294 scripts/dvd-handler \
3295 scripts/dvd-simulator \
3296 scripts/logwatch/Makefile \
3297 scripts/logwatch/logfile.bacula.conf \
3298 scripts/bat.desktop \
3299 scripts/bat.desktop.xsu \
3300 scripts/bat.desktop.consolehelper \
3301 scripts/bat.console_apps \
3304 src/console/Makefile \
3305 src/console/bconsole.conf \
3306 src/qt-console/bat.conf \
3307 src/qt-console/bat.pro \
3308 src/qt-console/bat.pro.mingw32 \
3309 src/qt-console/bat.pro.mingw64 \
3310 src/qt-console/install_conf_file \
3311 src/qt-console/tray-monitor/tray-monitor.conf \
3312 src/qt-console/tray-monitor/tray-monitor.pro \
3313 src/qt-console/tray-monitor/tray-monitor.pro.mingw32 \
3314 src/qt-console/tray-monitor/tray-monitor.pro.mingw64 \
3316 src/dird/bacula-dir.conf \
3318 src/stored/Makefile \
3319 src/stored/bacula-sd.conf \
3320 src/filed/Makefile \
3321 src/filed/bacula-fd.conf \
3323 src/cats/make_catalog_backup.pl \
3324 src/cats/make_catalog_backup \
3325 src/cats/delete_catalog_backup \
3326 src/cats/create_postgresql_database \
3327 src/cats/update_postgresql_tables \
3328 src/cats/make_postgresql_tables \
3329 src/cats/grant_postgresql_privileges \
3330 src/cats/drop_postgresql_tables \
3331 src/cats/drop_postgresql_database \
3332 src/cats/create_mysql_database \
3333 src/cats/update_mysql_tables \
3334 src/cats/make_mysql_tables \
3335 src/cats/grant_mysql_privileges \
3336 src/cats/drop_mysql_tables \
3337 src/cats/drop_mysql_database \
3338 src/cats/create_sqlite3_database \
3339 src/cats/update_sqlite3_tables \
3340 src/cats/make_sqlite3_tables \
3341 src/cats/grant_sqlite3_privileges \
3342 src/cats/drop_sqlite3_tables \
3343 src/cats/drop_sqlite3_database \
3346 src/cats/create_bacula_database \
3347 src/cats/update_bacula_tables \
3348 src/cats/grant_bacula_privileges \
3349 src/cats/make_bacula_tables \
3350 src/cats/drop_bacula_tables \
3351 src/cats/drop_bacula_database \
3352 src/cats/install-default-backend \
3353 src/findlib/Makefile \
3354 src/tools/Makefile \
3355 src/plugins/fd/Makefile \
3356 src/plugins/sd/Makefile \
3357 src/plugins/dir/Makefile \
3359 updatedb/update_mysql_tables \
3360 updatedb/update_sqlite3_tables \
3361 updatedb/update_postgresql_tables \
3362 updatedb/update_mysql_tables_9_to_10 \
3363 updatedb/update_sqlite3_tables_9_to_10 \
3364 updatedb/update_postgresql_tables_9_to_10 \
3365 updatedb/update_mysql_tables_10_to_11 \
3366 updatedb/update_sqlite3_tables_10_to_11 \
3367 updatedb/update_postgresql_tables_10_to_11 \
3368 updatedb/update_mysql_tables_11_to_12 \
3369 updatedb/update_sqlite3_tables_11_to_12 \
3370 updatedb/update_postgresql_tables_11_to_12 \
3371 updatedb/update_mysql_tables_12_to_13 \
3372 updatedb/update_postgresql_tables_12_to_13 \
3373 updatedb/update_mysql_tables_13_to_14 \
3374 updatedb/update_postgresql_tables_13_to_14 \
3375 examples/nagios/check_bacula/Makefile \
3376 platforms/rpms/redhat/bacula.spec \
3377 platforms/rpms/redhat/bacula-bat.spec \
3378 platforms/rpms/redhat/bacula-docs.spec \
3379 platforms/rpms/redhat/bacula-mtx.spec \
3380 platforms/rpms/suse/bacula.spec \
3381 platforms/rpms/suse/bacula-bat.spec \
3382 platforms/rpms/suse/bacula-docs.spec \
3383 platforms/rpms/suse/bacula-mtx.spec \
3388 if test "${support_bat}" = "yes" ; then
3389 if test "x$QMAKE" = "xnone"; then
3390 AC_MSG_ERROR([Could not find qmake $PATH. Check your Qt installation])
3394 echo "Creating bat Makefile"
3405 dnl if CC is gcc, we can rebuild the dependencies (since the depend rule
3406 dnl requires gcc). If it's not, don't rebuild dependencies
3408 if test X"$GCC" = "Xyes" ; then
3409 echo "Doing make of dependencies"
3410 ${MAKE:-make} depend
3414 chmod 755 install_conf_file build-depkgs-qt-console
3418 chmod 755 bacula btraceback mtx-changer
3419 chmod 755 dvd-handler dvd-simulator
3420 chmod 755 bconsole disk-changer devel_bacula logrotate
3424 chmod 755 $c/update_mysql_tables_10_to_11 $c/update_sqlite3_tables_10_to_11
3425 chmod 755 $c/update_postgresql_tables_10_to_11
3426 chmod 755 $c/update_mysql_tables_11_to_12 $c/update_sqlite3_tables_11_to_12
3427 chmod 755 $c/update_postgresql_tables_11_to_12
3432 chmod 755 $c/create_bacula_database $c/update_bacula_tables $c/make_bacula_tables
3433 chmod 755 $c/grant_bacula_privileges $c/drop_bacula_tables $c/drop_bacula_database
3435 chmod 755 $c/create_mysql_database $c/update_mysql_tables $c/make_mysql_tables
3436 chmod 755 $c/grant_mysql_privileges $c/drop_mysql_tables $c/drop_mysql_database
3438 chmod 755 $c/create_sqlite3_database $c/update_sqlite3_tables $c/make_sqlite3_tables
3439 chmod 755 $c/grant_sqlite3_privileges $c/drop_sqlite3_tables $c/drop_sqlite3_database
3441 chmod 755 $c/create_postgresql_database $c/update_postgresql_tables $c/make_postgresql_tables
3442 chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables $c/drop_postgresql_database
3444 chmod 755 $c/make_catalog_backup $c/delete_catalog_backup $c/make_catalog_backup.pl
3448 chmod 755 $c/install-default-backend
3450 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
3451 largefile_support="yes"
3454 dnl Only try to find out the version number of the compiler when we know its some kind of GCC compiler
3455 if test X"$GCC" = "Xyes" ; then
3457 dnl A whole lot of hand springs to get the compiler version.
3458 dnl This is because gcc changed the output in version 3.0
3460 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3461 if test "x${CCVERSION}" = "x" ; then
3462 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3464 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3465 if test x"${CXXVERSION}" = x ; then
3466 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3470 # clean up any old junk
3477 Configuration on `date`:
3479 Host: ${host}${post_host} -- ${DISTNAME} ${DISTVER}
3480 Bacula version: ${BACULA} ${VERSION} (${DATE})
3481 Source code location: ${srcdir}
3482 Install binaries: ${sbindir}
3483 Install libraries: ${libdir}
3484 Install config files: ${sysconfdir}
3485 Scripts directory: ${scriptdir}
3486 Archive directory: ${archivedir}
3487 Working directory: ${working_dir}
3488 PID directory: ${piddir}
3489 Subsys directory: ${subsysdir}
3490 Man directory: ${mandir}
3491 Data directory: ${datarootdir}
3492 Plugin directory: ${plugindir}
3493 C Compiler: ${CC} ${CCVERSION}
3494 C++ Compiler: ${CXX} ${CXXVERSION}
3495 Compiler flags: ${WCFLAGS} ${CFLAGS}
3496 Linker flags: ${WLDFLAGS} ${LDFLAGS}
3498 Statically Linked Tools: ${support_static_tools}
3499 Statically Linked FD: ${support_static_fd}
3500 Statically Linked SD: ${support_static_sd}
3501 Statically Linked DIR: ${support_static_dir}
3502 Statically Linked CONS: ${support_static_cons}
3503 Database backends: ${db_backends}
3504 Database port: ${db_port}
3505 Database name: ${db_name}
3506 Database user: ${db_user}
3507 Database SSL options: ${db_ssl_options}
3509 Job Output Email: ${job_email}
3510 Traceback Email: ${dump_email}
3511 SMTP Host Address: ${smtp_host}
3513 Director Port: ${dir_port}
3514 File daemon Port: ${fd_port}
3515 Storage daemon Port: ${sd_port}
3517 Director User: ${dir_user}
3518 Director Group: ${dir_group}
3519 Storage Daemon User: ${sd_user}
3520 Storage DaemonGroup: ${sd_group}
3521 File Daemon User: ${fd_user}
3522 File Daemon Group: ${fd_group}
3524 Large file support: $largefile_support
3525 Bacula conio support: ${got_conio} ${CONS_LIBS}
3526 readline support: ${got_readline} ${PRTREADLINE_SRC}
3527 TCP Wrappers support: ${TCPW_MSG} ${WRAPLIBS}
3528 TLS support: ${support_tls}
3529 Encryption support: ${support_crypto}
3530 ZLIB support: ${have_zlib}
3531 LZO support: ${have_lzo}
3532 enable-smartalloc: ${support_smartalloc}
3533 enable-lockmgr: ${support_lockmgr}
3534 bat support: ${support_bat}
3535 client-only: ${build_client_only}
3536 build-dird: ${build_dird}
3537 build-stored: ${build_stored}
3538 Plugin support: ${have_plugins}
3539 AFS support: ${have_afs}
3540 ACL support: ${have_acl}
3541 XATTR support: ${have_xattr}
3542 systemd support: ${support_systemd} ${SYSTEMD_UNITDIR}
3543 Batch insert enabled: ${batch_insert_db_backends}
3547 # create a small shell script useful for support with
3548 # configure options and config.out info
3549 cat > scripts/bacula_config << EOF
3552 $ $0 $ac_configure_args
3554 cat config.out >> scripts/bacula_config
3555 echo __EOC__ >> scripts/bacula_config
3556 chmod 755 scripts/bacula_config