3 dnl Process this file with autoconf to produce a configure script.
5 dnl require a recent autoconf
7 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']))
8 AC_CONFIG_SRCDIR(src/version.h)
16 AC_CONFIG_AUX_DIR(${BUILD_DIR}/autoconf)
17 AC_CONFIG_HEADERS(src/config.h:autoconf/config.h.in)
19 dnl search for true and false programs.
20 AC_PATH_PROGS(TRUEPRG, true, :)
21 AC_PATH_PROGS(FALSEPRG, false, :)
26 if test "x$BACULA" != x; then
27 post_host=`echo -${BACULA} | tr 'A-Z ' 'a-z-'`
29 BACULA=${BACULA:-Bacula}
30 VERSION=`sed -n -e 's/^#define VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
31 RELEASE=`sed -n -e 's/^#define RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
32 DATE=`sed -n -e 's/^#define BDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
33 LSMDATE=`sed -n -e 's/^#define LSMDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
34 BDB_VERSION=`sed -n -e 's/^#define BDB_VERSION \(.*\)$/\1/p' ${srcdir}/src/cats/cats.h`
35 DEPKGS_VERSION=`sed -n -e 's/^#define DEPKGS_VERSION \(.*\)$/\1/p' ${srcdir}/src/cats/cats.h`
36 DEPKGS_QT_VERSION=`sed -n -e 's/^#define DEPKGS_QT_VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
37 BQT_VERSION=`sed -n -e 's/^#define BQT_VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
42 AC_SUBST(post_host)dnl
43 AC_SUBST(BDB_VERSION)dnl
44 AC_SUBST(DEPKGS_QT_VERSION)dnl
45 AC_SUBST(DEPKGS_VERSION)dnl
46 AC_SUBST(BQT4_VERSION)dnl
49 dnl can be overwritten by specific values from version.h
50 LIBBAC_LT_RELEASE=`sed -n -e 's/^#.*LIBBAC_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
51 LIBBACCFG_LT_RELEASE=`sed -n -e 's/^#.*LIBBACCFG_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
52 LIBBACPY_LT_RELEASE=`sed -n -e 's/^#.*LIBBACPY_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
54 LIBBAC_LT_RELEASE=${LIBBAC_LT_RELEASE:-$VERSION}
55 LIBBACCFG_LT_RELEASE=${LIBBACCFG_LT_RELEASE:-$VERSION}
56 LIBBACPY_LT_RELEASE=${LIBBACPY_LT_RELEASE:-$VERSION}
58 AC_SUBST(LIBBAC_LT_RELEASE)dnl
59 AC_SUBST(LIBBACCFG_LT_RELEASE)dnl
60 AC_SUBST(LIBBACPY_LT_RELEASE)dnl
63 dnl can be overwritten by specific values from version.h
64 LIBBACSQL_LT_RELEASE=`sed -n -e 's/^#.*LIBBACSQL_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
65 LIBBACCATS_LT_RELEASE=`sed -n -e 's/^#.*LIBBACCATS_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
67 LIBBACSQL_LT_RELEASE=${LIBBACSQL_LT_RELEASE:-$VERSION}
68 LIBBACCATS_LT_RELEASE=${LIBBACCATS_LT_RELEASE:-$VERSION}
70 AC_SUBST(LIBBACSQL_LT_RELEASE)dnl
71 AC_SUBST(LIBBACCATS_LT_RELEASE)dnl
74 dnl can be overwritten by specific values from version.h
75 LIBBACFIND_LT_RELEASE=`sed -n -e 's/^#.*LIBBACFIND_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
77 LIBBACFIND_LT_RELEASE=${LIBBACFIND_LT_RELEASE:-$VERSION}
79 AC_SUBST(LIBBACFIND_LT_RELEASE)dnl
81 echo "configuring for ${BACULA} $VERSION ($DATE)"
84 dnl -------------------------------------------------------
85 dnl Check for compiler.
86 dnl ------------------------------------------------------
90 AC_PROG_CC_C_O dnl Determine if C compiler support -c -o.
91 AC_PROG_GCC_TRADITIONAL dnl Determine if ioctl() need -traditional.
95 if test "x$BASECC" = xgcc; then
99 AC_PATH_PROG(CXX, $CXX, $CXX)
100 if test ! -e $CXX; then
101 AC_MSG_ERROR(Unable to find C++ compiler)
104 dnl -------------------------------------------------------
105 dnl Check for programs.
106 dnl ------------------------------------------------------
108 AC_PATH_PROG(MV, mv, mv)
110 dnl If we name the variable RM it will shadow the RM variable in the configure script and we overwrite the
111 dnl value with the name of the rm command and not rm -f which is its normal content. This gives all kind
112 dnl of strange output of the configure script (like things don't exist etc.).
113 dnl So we name it REMOVE (more software has run into this problem)
114 AC_PATH_PROG(REMOVE, rm, rm)
115 AC_PATH_PROG(CP, cp, cp)
116 AC_PATH_PROG(SED, sed, sed)
117 AC_PATH_PROG(ECHO, echo, echo)
118 AC_PATH_PROG(CMP, cmp, cmp)
119 AC_PATH_PROG(TBL, tbl, tbl)
120 AC_PATH_PROG(AR, ar, ar)
121 AC_PATH_PROG(OPENSSL, openssl, none)
122 AC_PATH_PROG(MTX, mtx, mtx)
123 AC_PATH_PROG(DD, dd, dd)
124 AC_PATH_PROG(MKISOFS, mkisofs, mkisofs)
125 AC_PATH_PROG(PYTHON, python, python)
126 AC_PATH_PROG(GROWISOFS, growisofs, growisofs)
127 AC_PATH_PROG(DVDRWMEDIAINFO, dvd+rw-mediainfo, dvd+rw-mediainfo)
128 AC_PATH_PROG(DVDRWFORMAT, dvd+rw-format, dvd+rw-format)
129 AC_PATH_PROG(PKGCONFIG, pkg-config, pkg-config)
130 AC_PATH_PROG(QMAKE, qmake, none)
131 AC_PATH_PROG(GMAKE, gmake, none)
132 AC_PATH_PROG(CDRECORD, cdrecord, cdrecord)
133 AC_PATH_PROG(PIDOF, pidof, pidof)
135 # Some AWK programs fail, so test it and warn the user
136 if echo xfoo | $AWK 'BEGIN { prog=ARGV[1]; ARGC=1 }
137 { if ((prog == $2) || (("(" prog ")") == $2) ||
138 (("[" prog "]") == $2) ||
139 ((prog ":") == $2)) { print $1 ; exit 0 } }' xfoo>/dev/null; then :;
141 AC_MSG_ERROR([!!!!!!!!! WARNING !!!!!!!!!!!!!!
142 The regex engine of $AWK is too broken to be used you
143 might want to install GNU AWK.
144 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!])
147 AC_PATH_PROG(AWK, $THE_AWK, $THE_AWK)
150 test -n "$ARFLAG" || ARFLAGS="cr"
157 AC_SUBST(LOCAL_CFLAGS)
158 AC_SUBST(LOCAL_LDFLAGS)
161 dnl --------------------------------------------------
163 dnl --------------------------------------------------
165 AC_ARG_ENABLE(libtool,
166 AC_HELP_STRING([--enable-libtool], [enable building using GNU libtool @<:@default=yes@:>@]),
168 if test x$enableval = xno; then
173 LT_INIT([shared disable-static])
177 if test x$use_libtool != xno; then
178 DEFAULT_OBJECT_TYPE=".lo"
179 DEFAULT_ARCHIVE_TYPE=".la"
180 DEFAULT_SHARED_OBJECT_TYPE=".la"
181 LIBTOOL="\$(LIBTOOL)"
182 LIBTOOL_INSTALL_TARGET="libtool-install"
183 LIBTOOL_UNINSTALL_TARGET="libtool-uninstall"
184 LIBTOOL_CLEAN_TARGET="libtool-clean"
185 QMAKE_LIBTOOL="${BUILD_DIR}/libtool"
186 FD_PLUGIN_DIR="src/plugins/fd"
189 DEFAULT_OBJECT_TYPE=".o"
190 DEFAULT_ARCHIVE_TYPE=".a"
191 DEFAULT_SHARED_OBJECT_TYPE=".so"
192 LIBTOOL="# \$(LIBTOOL)"
193 LIBTOOL_INSTALL_TARGET=""
194 LIBTOOL_UNINSTALL_TARGET=""
195 LIBTOOL_CLEAN_TARGET=""
196 QMAKE_LIBTOOL="# ${BUILD_DIR}/libtool"
201 AC_SUBST(DEFAULT_OBJECT_TYPE)
202 AC_SUBST(DEFAULT_ARCHIVE_TYPE)
203 AC_SUBST(DEFAULT_SHARED_OBJECT_TYPE)
205 AC_SUBST(LIBTOOL_INSTALL_TARGET)
206 AC_SUBST(LIBTOOL_UNINSTALL_TARGET)
207 AC_SUBST(LIBTOOL_CLEAN_TARGET)
208 AC_SUBST(QMAKE_LIBTOOL)
209 AC_SUBST(FD_PLUGIN_DIR)
211 dnl --------------------------------------------------
212 dnl Include file handling
213 dnl --------------------------------------------------
214 AC_ARG_ENABLE(includes,
215 AC_HELP_STRING([--enable-includes], [enable installing of include files @<:@default=no@:>@]),
217 if test x$enableval = xyes; then
223 dnl It only makes sense to install include files when you install libraries which only happens when
224 dnl libtool is enabled
226 if test x$use_libtool != xno -a x$install_includes = xyes; then
227 INCLUDE_INSTALL_TARGET="install-includes"
228 INCLUDE_UNINSTALL_TARGET="uninstall-includes"
230 INCLUDE_INSTALL_TARGET=""
231 INCLUDE_UNINSTALL_TARGET=""
233 AC_SUBST(INCLUDE_INSTALL_TARGET)
234 AC_SUBST(INCLUDE_UNINSTALL_TARGET)
236 dnl --------------------------------------------------
237 dnl Bacula OP Sys determination (see aclocal.m4)
238 dnl --------------------------------------------------
241 dnl -----------------------------------------------------------
242 dnl Bacula OPSys Distribution determination (see aclocal.m4)
243 dnl ----------------------------------------------------------
244 BA_CHECK_OPSYS_DISTNAME
246 dnl --------------------------------------------------
247 dnl Suppport for gettext (translations)
248 dnl By default, $datarootdir is ${prefix}/share
249 dnl --------------------------------------------------
250 AM_GNU_GETTEXT([external])
252 dnl ------------------------------------------------------------------
253 dnl If the user has not set --prefix, we set our default to nothing.
254 dnl In this case, if the user has not set --sysconfdir, we set it
255 dnl to the package default of /etc/bacula. If either --prefix or
256 dnl --sysconfdir is set, we leave sysconfdir alone except to eval it.
257 dnl If the user has not set --libdir, we set it to the package
258 dnl default of /usr/lib. If either --prefix or --libdir is set,
259 dnl we leave libdir alone except to eval it. If the user has not set
260 dnl --includedir, we set it to the package default of /usr/include.
261 dnl If either --prefix or --includedir is set, we leave includedir
262 dnl alone except to eval it
263 dnl ------------------------------------------------------------------
264 os_name=`uname -s 2>/dev/null`
265 if test x${prefix} = xNONE ; then
266 if test `eval echo ${sysconfdir}` = NONE/etc ; then
267 sysconfdir=/etc/bacula
270 if test `eval echo ${libdir}` = NONE/lib ; then
273 os_processor=`uname -p 2>/dev/null`
274 case ${os_processor} in
289 if test `eval echo ${includedir}` = NONE/include ; then
290 includedir=/usr/include
293 if test `eval echo ${datarootdir}` = NONE/share ; then
294 datarootdir=/usr/share
299 dnl -------------------------------------------------------------------------
300 dnl If the user has not set --exec-prefix, we default to ${prefix}
301 dnl -------------------------------------------------------------------------
302 if test x${exec_prefix} = xNONE ; then
303 exec_prefix=${prefix}
306 sysconfdir=`eval echo ${sysconfdir}`
307 datarootdir=`eval echo ${datarootdir}`
308 docdir=`eval echo ${docdir}`
309 htmldir=`eval echo ${htmldir}`
310 libdir=`eval echo ${libdir}`
311 includedir=`eval echo ${includedir}`
312 localedir=`eval echo ${datarootdir}/locale`
313 AC_DEFINE_UNQUOTED(SYSCONFDIR, "$sysconfdir")
314 AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir")
316 dnl ------------------------------------------------------------------
317 dnl If the user has not set --sbindir, we set our default as /sbin
318 dnl ------------------------------------------------------------------
319 if test x$sbindir = x'${exec_prefix}/sbin' ; then
320 sbindir=${exec_prefix}/sbin
322 sbindir=`eval echo ${sbindir}`
324 dnl -------------------------------------------------------------------------
325 dnl If the user has not set --mandir, we default to /usr/share/man
326 dnl -------------------------------------------------------------------------
327 if test x$mandir = x'${prefix}/man' ; then
328 mandir=/usr/share/man
331 dnl -------------------------------------------------------------------------
332 dnl If the user has not set --htmldir, we default to /usr/share/doc/bacula/html
333 dnl -------------------------------------------------------------------------
334 if test x$htmldir = x'/usr/share/doc/bacula/' ; then
335 htmldir=`eval echo ${docdir}html`
338 dnl -------------------------------------------------------------------------
339 dnl If the user has not set --docdir, we default to /usr/share/doc/bacula
340 dnl -------------------------------------------------------------------------
341 if test x$docdir = x'/usr/share/doc/' ; then
342 docdir=`eval echo ${docdir}bacula`
346 AC_PATH_PROGS(MSGFMT, msgfmt, no)
347 if test "$MSGFMT" = "no"
349 echo 'msgfmt program not found, disabling NLS !'
351 USE_INCLUDED_LIBINTL=no
356 support_smartalloc=yes
363 support_static_tools=no
366 support_static_dir=no
367 support_static_cons=no
373 batch_insert_db_backends=""
376 dnl --------------------------------------------------------------------------
377 dnl CHECKING COMMAND LINE OPTIONS
378 dnl --------------------------------------------------------------------------
380 dnl -------------------------------------------
381 dnl bat (default off)
382 dnl -------------------------------------------
384 AC_HELP_STRING([--enable-bat], [enable build of bat Qt4 GUI @<:@default=no@:>@]),
386 if test x$enableval = xyes; then
387 AC_DEFINE(HAVE_BAT, 1, [Set if Bacula bat Qt4 GUI support enabled])
394 if test x$support_bat = xyes; then
395 abc=`$PKGCONFIG --atleast-version=4.2 QtGui`
397 if test $pkg = 0; then
398 BAT_DIR=src/qt-console
400 AC_MSG_ERROR(Unable to find Qt4 installation needed by bat)
405 dnl The qwt library was used with bat, but that is no longer the case
413 dnl if test x$support_bat = xyes; then
414 dnl AC_MSG_CHECKING(for qwt support)
416 dnl AC_HELP_STRING([--with-qwt@<:@=DIR@:>@], [specify qwt library directory]),
418 dnl case "$with_qwt" in
423 dnl if test -f ${with_qwt}/include/qwt.h; then
424 dnl QWT_INC="${with_qwt}/include"
425 dnl QWT_LDFLAGS="-L${with_qwt}/lib"
435 dnl dnl Search in standard places, or --with-qwt not specified
437 dnl if test $no_qwt = no; then
438 dnl if test x$QWT_INC = x; then
439 dnl for root in /usr /usr/local; do
440 dnl for ver in qwt qwt5 qwt-qt4; do
441 dnl if test -f ${root}/include/${ver}/qwt.h; then
442 dnl QWT_INC="${root}/include/${ver}"
443 dnl if test -d ${root}/lib64/; then
444 dnl QWT_LDFLAGS="-L${root}/lib64"
445 dnl elif test -d ${root}/lib/64/; then
446 dnl QWT_LDFLAGS="-L${root}/64"
448 dnl QWT_LDFLAGS="-L${root}/lib"
459 dnl if test x$QWT_INC = x; then
460 dnl AC_MSG_RESULT(no)
462 dnl AC_DEFINE(HAVE_QWT, 1, [Set if bat QWT library found])
463 dnl AC_MSG_RESULT(yes)
469 AC_SUBST(QWT_LDFLAGS)
474 dnl -------------------------------------------
475 dnl smartalloc (default off)
476 dnl -------------------------------------------
477 AC_ARG_ENABLE(smartalloc,
478 AC_HELP_STRING([--enable-smartalloc], [enable smartalloc debugging support @<:@default=no@:>@]),
480 if test x$enableval = xno; then
481 support_smartalloc=no
486 if test x$support_smartalloc = xyes; then
487 AC_DEFINE(SMARTALLOC, 1, [Set if you want Smartalloc enabled])
490 dnl -------------------------------------------
491 dnl Lock Manager (default off)
492 dnl -------------------------------------------
493 AC_ARG_ENABLE(lockmgr,
494 AC_HELP_STRING([--enable-lockmgr], [enable lock manager support @<:@default=no@:>@]),
496 if test x$enableval = xyes; then
502 if test x$support_lockmgr = xyes; then
503 AC_DEFINE(_USE_LOCKMGR, 1, [Set if you want Lock Manager enabled])
507 dnl -------------------------------------------
508 dnl static-tools (default off)
509 dnl -------------------------------------------
510 AC_ARG_ENABLE(static-tools,
511 AC_HELP_STRING([--enable-static-tools], [enable static tape tools @<:@default=no@:>@]),
513 if test x$enableval = xyes; then
514 if test x$use_libtool = xyes; then
515 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
516 please rerun configure with --disable-libtool])
518 support_static_tools=yes
524 if test x$support_static_tools = xyes; then
525 TTOOL_LDFLAGS="-static"
527 AC_SUBST(TTOOL_LDFLAGS)
529 dnl -------------------------------------------
530 dnl static-fd (default off)
531 dnl -------------------------------------------
532 AC_ARG_ENABLE(static-fd,
533 AC_HELP_STRING([--enable-static-fd], [enable static File daemon @<:@default=no@:>@]),
535 if test x$enableval = xyes; then
536 if test x$use_libtool = xyes; then
537 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
538 please rerun configure with --disable-libtool])
540 support_static_fd=yes
546 if test x$support_static_fd = xyes; then
547 STATIC_FD="static-bacula-fd"
551 dnl -------------------------------------------
552 dnl static-sd (default off)
553 dnl -------------------------------------------
554 AC_ARG_ENABLE(static-sd,
555 AC_HELP_STRING([--enable-static-sd], [enable static Storage daemon @<:@default=no@:>@]),
557 if test x$enableval = xyes; then
558 if test x$use_libtool = xyes; then
559 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
560 please rerun configure with --disable-libtool])
562 support_static_sd=yes
568 if test x$support_static_sd = xyes; then
569 STATIC_SD="static-bacula-sd"
573 dnl -------------------------------------------
574 dnl static-dir (default off)
575 dnl -------------------------------------------
576 AC_ARG_ENABLE(static-dir,
577 AC_HELP_STRING([--enable-static-dir], [enable static Director @<:@default=no@:>@]),
579 if test x$enableval = xyes; then
580 if test x$use_libtool = xyes; then
581 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
582 please rerun configure with --disable-libtool])
584 support_static_dir=yes
590 if test x$support_static_dir = xyes; then
591 STATIC_DIR="static-bacula-dir"
595 dnl -------------------------------------------
596 dnl static-cons (default off)
597 dnl -------------------------------------------
598 AC_ARG_ENABLE(static-cons,
599 AC_HELP_STRING([--enable-static-cons], [enable static Console @<:@default=no@:>@]),
601 if test x$enableval = xyes; then
602 if test x$use_libtool = xyes; then
603 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
604 please rerun configure with --disable-libtool])
606 support_static_cons=yes
612 if test x$support_static_cons = xyes; then
613 STATIC_CONS="static-bconsole"
615 AC_SUBST(STATIC_CONS)
617 dnl -------------------------------------------
618 dnl client_only (default off)
619 dnl -------------------------------------------
620 AC_ARG_ENABLE(client-only,
621 AC_HELP_STRING([--enable-client-only], [build client (File daemon) only @<:@default=no@:>@]),
623 if test x$enableval = xyes; then
624 build_client_only=yes
630 if test x$build_client_only = xno; then
637 dnl -------------------------------------------
638 dnl director (default on)
639 dnl -------------------------------------------
640 AC_ARG_ENABLE(build-dird,
641 AC_HELP_STRING([--enable-build-dird], [enable building of dird (Director) @<:@default=yes@:>@]),
643 if test x$enableval = xno; then
648 if test x$build_dird = xyes; then
653 DIR_TOOLS="NODIRTOOLS"
658 dnl -------------------------------------------
659 dnl stored (default on)
660 dnl -------------------------------------------
661 AC_ARG_ENABLE(build-stored,
662 AC_HELP_STRING([--enable-build-stored], [enable building of stored (Storage daemon) @<:@default=yes@:>@]),
664 if test x$enableval = xno; then
669 if test x$build_stored = xyes; then
670 STORED_DIR="src/stored"
676 dnl ---------------------------------------------------
677 dnl Check for conio (Bacula readline substitute)(
678 dnl ---------------------------------------------------
679 dnl this allows you to turn it completely off
681 AC_HELP_STRING([--disable-conio], [disable conio support @<:@default=no@:>@]),
683 if test x$enableval = xno; then
690 dnl ---------------------------------------------------
691 dnl Check for IPv6 support
692 dnl ---------------------------------------------------
693 dnl this allows you to turn it completely off
696 AC_HELP_STRING([--enable-ipv6], [enable ipv6 support @<:@default=yes@:>@]),
698 if test x$enableval = xno; then
704 if test x$support_ipv6 = xyes; then
705 AC_TRY_LINK([ #include <sys/types.h>
706 #include <sys/socket.h>
707 #include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;],
708 [support_ipv6=yes], [support_ipv6=no])
711 if test x$support_ipv6 = xyes; then
712 AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
716 AC_CHECK_HEADER(curses.h, [
717 AC_CHECK_LIB(tinfo, tgetent, [ TERM_LIB="-ltinfo" ], [
718 AC_CHECK_LIB(ncurses, tgetent, [ TERM_LIB="-lncurses" ], [
719 AC_CHECK_LIB(termcap, tgetent, [ TERM_LIB="-ltermcap" ])
723 [ AC_CHECK_HEADERS(curses.h)
724 AC_CHECK_HEADER(term.h,
725 [ AC_CHECK_LIB(curses, tgetent,
726 [ TERM_LIB="-lcurses" ] )
732 if test x$support_conio = xyes; then
733 if test x$TERM_LIB != x; then
739 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
741 echo " "; echo "Required libraries not found. CONIO turned off ..."; echo " "
746 dnl ---------------------------------------------------
747 dnl Check for readline support/directory (default off)
748 dnl ---------------------------------------------------
749 dnl this allows you to turn it completely off
750 AC_ARG_ENABLE(readline,
751 AC_HELP_STRING([--disable-readline], [disable readline support @<:@default=yes@:>@]),
753 if test x$enableval = xno; then
761 if test x$support_readline = xyes; then
762 AC_ARG_WITH(readline,
763 AC_HELP_STRING([--with-readline@<:@=DIR@:>@], [specify readline library directory]),
765 case "$with_readline" in
770 if test -f ${with_readline}/readline.h; then
771 CONS_INC="-I${with_readline}"
772 CONS_LDFLAGS="-L$with_readline"
773 elif test -f ${with_readline}/include/readline/readline.h; then
774 CONS_INC="-I${with_readline}/include/readline"
775 CONS_LDFLAGS="-L${with_readline}/lib"
776 with_readline="${with_readline}/include/readline"
778 with_readline="/usr/include/readline"
781 AC_CHECK_HEADER(${with_readline}/readline.h,
783 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
784 CONS_LIBS="-lreadline -lhistory ${TERM_LIB}"
788 echo "readline.h not found. readline turned off ..."
795 dnl check for standard readline library
796 AC_CHECK_HEADER(/usr/include/readline/readline.h,
798 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
800 CONS_INC="-I/usr/include/readline"
801 CONS_LIBS="-lreadline ${TERM_LIB}"
803 dnl Did not find standard library, so try Bacula's default
804 AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h,
806 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
808 CONS_INC="-I${TOP_DIR}/depkgs/readline"
809 CONS_LIBS="-lreadline -lhistory ${TERM_LIB}"
810 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
811 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
814 echo "readline.h not found. readline turned off ..."
828 AC_SUBST(CONS_LDFLAGS)
829 AC_SUBST(READLINE_SRC)
831 dnl Minimal stuff for readline Makefile configuration
836 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr)
837 AC_CHECK_FUNCS(lstat lchown lchmod futimes fchmod fchown)
838 AC_CHECK_FUNCS(nanosleep nl_langinfo)
839 AC_CHECK_HEADERS(varargs.h)
841 dnl End of readline/conio stuff
842 dnl -----------------------------------------------------------------------
844 dnl -----------------------------------------------------------------------
845 dnl Check for Python support
847 AC_MSG_CHECKING(for Python support)
849 AC_HELP_STRING([--with-python@<:@=DIR@:>@], [Include Python support. DIR is the Python base install directory, default is to search through a number of common places for the Python files.]),
853 if test "$withval" != "no"; then
854 if test "$withval" = "yes"; then
855 if test -e /usr/bin/python-config ; then
856 PYTHON_INCDIR=`/usr/bin/python-config --includes`
857 PYTHON_LIBS=`/usr/bin/python-config --libs`
859 for python_root in /usr /usr/local /usr/sfw; do
860 for ver in python2.2 python2.3 python2.4 python2.5 python2.6 python2.7 python3; do
861 if test -f $python_root/include/${ver}/Python.h; then
862 PYTHON_INCDIR=-I$python_root/include/${ver}
863 if test -d $python_root/lib64/${ver}/config; then
864 PYTHON_LIBS="-L$python_root/lib64/${ver}/config -l${ver}"
866 PYTHON_LIBS="-L$python_root/lib/${ver}/config -l${ver}"
873 if test x$PYTHON_INCDIR = x; then
874 if test -f $prefix/include/Python.h; then
875 PYTHON_INCDIR=-I$prefix/include
876 if test -d $prefix/lib64/config; then
877 PYTHON_LIBS="-L$prefix/lib64/config -lpython"
879 PYTHON_LIBS="-L$prefix/lib/config -lpython"
883 AC_MSG_ERROR(Unable to find Python.h in standard locations)
888 if test -e $withval/bin/python-config ; then
889 PYTHON_INCDIR=`$withval/bin/python-config --includes`
890 PYTHON_LIBS=`$withval/bin/python-config --libs`
891 elif test -f $withval/Python.h; then
892 PYTHON_INCDIR=-I$withval
893 PYTHON_LIBS="-L$withval/config -lpython"
894 elif test -f $withval/include/Python.h; then
895 PYTHON_INCDIR=-I$withval/include
896 if test -d $withval/lib64/config; then
897 PYTHON_LIBS="-L$withval/lib64/config -lpython"
899 PYTHON_LIBS="-L$withval/lib/config -lpython"
901 elif test -f $withval/include/python/Python.h; then
902 PYTHON_INCDIR=-I$withval/include/python
903 if test -d $withval/lib64/python/config; then
904 PYTHON_LIBS="-L$withval/lib64/python/config -lpython"
906 PYTHON_LIBS="-L$withval/lib/python/config -lpython"
910 AC_MSG_ERROR(Invalid Python directory $withval - unable to find Python.h under $withval)
914 AC_DEFINE([HAVE_PYTHON], 1)
917 AC_MSG_NOTICE(checking for more Python libs)
918 saved_LIBS="$LIBS"; LIBS=
919 AC_SEARCH_LIBS(shm_open, [rt])
920 AC_CHECK_LIB(util, openpty)
921 PYTHON_LIBS="$PYTHON_LIBS $LIBS"
930 AC_SUBST(PYTHON_LIBS)
931 AC_SUBST(PYTHON_INCDIR)
934 dnl Find where sockets are (especially for Solaris)
935 dnl Do this before the TCP Wrappers test since tcp wrappers
936 dnl uses the socket library and some linkers are stupid.
938 AC_CHECK_FUNC(socket,
939 AC_MSG_RESULT(using libc's socket),
940 AC_CHECK_LIB(xnet,socket)
941 AC_CHECK_LIB(socket,socket)
942 AC_CHECK_LIB(inet,socket))
944 dnl -----------------------------------------------------------
945 dnl Check whether user wants TCP wrappers support (default off)
946 dnl -----------------------------------------------------------
949 AC_ARG_WITH(tcp-wrappers,
950 AC_HELP_STRING([--with-tcp-wrappers@<:@=DIR@:>@], [enable tcpwrappers support]),
952 if test "x$withval" != "xno" ; then
954 LIBS="$saved_LIBS -lwrap"
955 AC_SEARCH_LIBS(nanosleep, [rt])
956 AC_MSG_CHECKING(for libwrap)
959 #include <sys/types.h>
961 int deny_severity = 0;
962 int allow_severity = 0;
963 struct request_info *req;
968 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
973 LIBS="$saved_LIBS -lwrap -lnsl"
974 WRAPLIBS="$saved_LIBS -lwrap -lnsl"
977 #include <sys/types.h>
979 int deny_severity = 0;
980 int allow_severity = 0;
981 struct request_info *req;
986 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
991 AC_MSG_ERROR([*** libwrap missing])
1001 dnl -----------------------------------------------------------
1002 dnl Check whether OpenSSL is available
1003 dnl -----------------------------------------------------------
1004 AC_MSG_CHECKING([for OpenSSL])
1005 dnl The following uses quadrigraphs:
1008 AC_ARG_WITH(openssl,
1009 AC_HELP_STRING([--with-openssl@<:@=DIR@:>@], [Include OpenSSL support. DIR is the OpenSSL base]),
1011 with_openssl_directory=${withval}
1015 if test "x$with_openssl_directory" != "xno"; then
1016 OPENSSL_LIBS="-lssl -lcrypto"
1019 if test "x$with_openssl_directory" != "xyes" && test x"${with_openssl_directory}" != "x"; then
1021 # Make sure the $with_openssl_directory also makes sense
1023 if test -d "$with_openssl_directory/lib" -a -d "$with_openssl_directory/include"; then
1024 OPENSSL_LIBS="-L$with_openssl_directory/lib $OPENSSL_LIBS"
1025 OPENSSL_INC="-I$with_openssl_directory/include $OPENSSL_INC"
1029 saved_LIBS="${LIBS}"
1030 saved_CFLAGS="${CFLAGS}"
1031 LIBS="${saved_LIBS} ${OPENSSL_LIBS}"
1032 CFLAGS="${saved_CFLAGS} ${OPENSSL_INC}"
1036 #include <openssl/ssl.h>
1038 CRYPTO_set_id_callback(NULL);
1041 support_crypto="yes"
1050 #include <openssl/evp.h>
1054 ac_cv_openssl_sha2="yes"
1056 ac_cv_openssl_sha2="no"
1060 dnl Solaris disables greater than 128+ bit encryption in their OpenSSL
1061 dnl implementation, presumably for export reasons. If 192bit AES
1062 dnl is available, we assume that we're running with a 'non-export'
1063 dnl openssl library.
1066 #include <openssl/evp.h>
1070 ac_cv_openssl_export="no"
1072 ac_cv_openssl_export="yes"
1076 AC_MSG_RESULT([$support_tls])
1077 if test "$support_tls" = "yes"; then
1078 AC_DEFINE(HAVE_OPENSSL, 1, [Define if OpenSSL library is available])
1079 AC_DEFINE(HAVE_TLS, 1, [Define if TLS support should be enabled])
1080 AC_DEFINE(HAVE_CRYPTO, 1, [Define if encryption support should be enabled])
1083 if test "$ac_cv_openssl_sha2" = "yes"; then
1084 AC_DEFINE(HAVE_SHA2, 1, [Define if the SHA-2 family of digest algorithms is available])
1087 if test "$ac_cv_openssl_export" = "yes"; then
1088 AC_DEFINE(HAVE_OPENSSL_EXPORT_LIBRARY, 1, [Define if the OpenSSL library is export-contrained to 128bit ciphers])
1091 if test "$support_crypto" = "yes"; then
1092 AC_CHECK_LIB(crypto, EVP_PKEY_encrypt_old, AC_DEFINE(HAVE_OPENSSLv1, 1, [Set if have OpenSSL version 1.x]))
1095 LIBS="${saved_LIBS}"
1096 CFLAGS="${saved_CFLAGS}"
1100 AC_MSG_RESULT([$support_tls])
1103 if test "$support_tls" = "no" -o "$support_crypto" = "no"; then
1108 AC_SUBST(OPENSSL_LIBS)
1109 AC_SUBST(OPENSSL_INC)
1111 dnl -----------------------------------------------------------
1112 dnl dlopen is needed for plugins
1113 dnl -----------------------------------------------------------
1114 AC_SEARCH_LIBS(dlopen, [dl])
1116 dnl ------------------------------------------
1117 dnl Where to place working dir
1118 dnl ------------------------------------------
1119 working_dir=`eval echo /opt/bacula/working`
1120 AC_ARG_WITH(working-dir,
1121 AC_HELP_STRING([--with-working-dir=PATH], [specify path of Bacula working directory]),
1123 if test "x$withval" != "xno" ; then
1124 working_dir=$withval
1129 AC_SUBST(working_dir)
1131 dnl ------------------------------------------------------------------
1132 dnl If the user has not set archivedir, we set our default as /tmp
1133 dnl ------------------------------------------------------------------
1135 AC_ARG_WITH(archivedir,
1136 AC_HELP_STRING([--with-archivedir=PATH], [specify path of SD archive directory]),
1138 if test "x$withval" != "xno" ; then
1144 AC_SUBST(archivedir)
1146 dnl ------------------------------------------------------------------
1147 dnl Allow the user to specify the daemon resource name default hostname
1148 dnl ------------------------------------------------------------------
1150 AC_ARG_WITH(basename,
1151 AC_HELP_STRING([--with-basename=RESNAME], [specify base resource name for daemons]),
1153 if test "x$withval" != "xno" ; then
1161 dnl ------------------------------------------------------------------
1162 dnl Allow the user to override the hostname (default = machine hostname)
1163 dnl ------------------------------------------------------------------
1164 hostname=`uname -n | cut -d '.' -f 1`
1165 if test x${hostname} = x ; then
1166 hostname="localhost"
1168 dnl Make sure hostname is resolved
1169 ping -c 1 $hostname 2>/dev/null 1>/dev/null
1170 if test ! $? = 0; then
1171 hostname="localhost"
1173 AC_ARG_WITH(hostname,
1174 AC_HELP_STRING([--with-hostname=RESNAME], [specify host name for daemons]),
1176 if test "x$withval" != "xno" ; then
1185 dnl ------------------------------------------
1186 dnl Where to place scriptdir (script files)
1187 dnl ------------------------------------------
1188 scriptdir=`eval echo ${sysconfdir}`
1189 AC_ARG_WITH(scriptdir,
1190 AC_HELP_STRING([--with-scriptdir=PATH], [specify path of Bacula scripts directory]),
1192 if test "x$withval" != "xno" ; then
1201 dnl ------------------------------------------
1202 dnl Where to place bsrdir (bsr files)
1203 dnl ------------------------------------------
1204 bsrdir=`eval echo /opt/bacula/bsr`
1206 AC_HELP_STRING([--with-bsrdir=PATH], [specify path of Bacula bsrs directory]),
1208 if test "x$withval" != "xno" ; then
1216 dnl ------------------------------------------
1217 dnl Where to place logdir
1218 dnl ------------------------------------------
1219 logdir=`eval echo /opt/bacula/log`
1221 AC_HELP_STRING([--with-logdir=PATH], [specify path of Bacula logs directory]),
1223 if test "x$withval" != "xno" ; then
1232 # ------------------------------------------
1233 # Where to place plugindir (plugin files)
1234 # ------------------------------------------
1235 plugindir=`eval echo ${libdir}`
1236 AC_ARG_WITH(plugindir,
1237 AC_HELP_STRING([--with-plugindir=PATH], [specify path of Bacula plugins directory]),
1239 if test "x$withval" != "xno" ; then
1247 dnl ------------------------------------------
1248 dnl Where to send dump email
1249 dnl ------------------------------------------
1250 dump_email=root@localhost
1251 AC_ARG_WITH(dump-email,
1252 AC_HELP_STRING([--with-dump-email=EMAIL], [dump email address]),
1254 if test "x$withval" != "xno" ; then
1260 AC_SUBST(dump_email)
1262 dnl ------------------------------------------
1263 dnl Where to send job email
1264 dnl ------------------------------------------
1265 job_email=root@localhost
1266 AC_ARG_WITH(job-email,
1267 AC_HELP_STRING([--with-job-email=EMAIL], [job output email address]),
1269 if test "x$withval" != "xno" ; then
1277 dnl ------------------------------------------
1278 dnl Where to find smtp host
1279 dnl ------------------------------------------
1281 AC_ARG_WITH(smtp_host,
1282 AC_HELP_STRING([--with-smtp-host=HOST], [SMTP mail host address]),
1284 if test "x$withval" != "xno" ; then
1292 dnl ------------------------------------
1293 dnl Where to place pid files
1294 dnl ------------------------------------
1296 AC_ARG_WITH(pid-dir,
1297 AC_HELP_STRING([--with-pid-dir=PATH], [specify location of Bacula pid files]),
1299 if test "x$withval" != "xno" ; then
1305 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
1308 dnl ------------------------------------
1309 dnl Where to place subsys "lock file"
1310 dnl ------------------------------------
1311 subsysdir=/var/run/subsys
1312 if test -d /var/run/subsys; then
1313 subsysdir=/var/run/subsys
1314 elif test -d /var/lock/subsys; then
1315 subsysdir=/var/lock/subsys
1317 subsysdir=/var/run/subsys
1319 AC_ARG_WITH(subsys-dir,
1320 AC_HELP_STRING([--with-subsys-dir=PATH], [specify location of Bacula subsys file]),
1322 if test "x$withval" != "xno" ; then
1330 dnl ------------------------------------
1331 dnl Where to start assigning ports
1332 dnl ------------------------------------
1334 AC_ARG_WITH(baseport,
1335 AC_HELP_STRING([--with-baseport=PORT], [specify base port address for daemons]),
1337 if test "x$withval" != "xno" ; then
1344 dir_port=`expr $baseport`
1345 fd_port=`expr $baseport + 1`
1346 sd_port=`expr $fd_port + 1`
1352 dnl ------------------------------------------
1353 dnl Generate passwords
1354 dnl ------------------------------------------
1356 AC_ARG_WITH(dir-password,
1357 AC_HELP_STRING([--with-dir-password=PASSWORD], [specify Director's password]),
1359 if test "x$withval" != "xno" ; then
1360 dir_password=$withval
1365 if test "x$dir_password" = "x" ; then
1366 if test "x$OPENSSL" = "xnone" ; then
1367 key=`autoconf/randpass 33`
1369 key=`openssl rand -base64 33`
1375 AC_ARG_WITH(fd-password,
1376 AC_HELP_STRING([--with-fd-password=PASSWORD], [specify Client's password]),
1378 if test "x$withval" != "xno" ; then
1379 fd_password=$withval
1384 if test "x$fd_password" = "x" ; then
1385 if test "x$OPENSSL" = "xnone" ; then
1386 key=`autoconf/randpass 37`
1388 key=`openssl rand -base64 33`
1394 AC_ARG_WITH(sd-password,
1395 AC_HELP_STRING([--with-sd-password=PASSWORD], [specify Storage daemon's password]),
1397 if test "x$withval" != "xno" ; then
1398 sd_password=$withval
1403 if test "x$sd_password" = "x" ; then
1404 if test "x$OPENSSL" = "xnone" ; then
1405 key=`autoconf/randpass 41`
1407 key=`openssl rand -base64 33`
1413 AC_ARG_WITH(mon-dir-password,
1414 AC_HELP_STRING([--with-mon-dir-password=PASSWORD], [specify Director's password used by the monitor]),
1416 if test "x$withval" != "xno" ; then
1417 mon_dir_password=$withval
1422 if test "x$mon_dir_password" = "x" ; then
1423 if test "x$OPENSSL" = "xnone" ; then
1424 key=`autoconf/randpass 33`
1426 key=`openssl rand -base64 33`
1428 mon_dir_password=$key
1432 AC_ARG_WITH(mon-fd-password,
1433 AC_HELP_STRING([--with-mon-fd-password=PASSWORD], [specify Client's password used by the monitor]),
1435 if test "x$withval" != "xno" ; then
1436 mon_fd_password=$withval
1441 if test "x$mon_fd_password" = "x" ; then
1442 if test "x$OPENSSL" = "xnone" ; then
1443 key=`autoconf/randpass 37`
1445 key=`openssl rand -base64 33`
1447 mon_fd_password=$key
1451 AC_ARG_WITH(mon-sd-password,
1452 AC_HELP_STRING([--with-mon-sd-password=PASSWORD], [specify Storage daemon's password used by the monitor]),
1454 if test "x$withval" != "xno" ; then
1455 mon_sd_password=$withval
1460 if test "x$mon_sd_password" = "x" ; then
1461 if test "x$OPENSSL" = "xnone" ; then
1462 key=`autoconf/randpass 41`
1464 key=`openssl rand -base64 33`
1466 mon_sd_password=$key
1469 AC_SUBST(dir_password)
1470 AC_SUBST(fd_password)
1471 AC_SUBST(sd_password)
1472 AC_SUBST(mon_dir_password)
1473 AC_SUBST(mon_fd_password)
1474 AC_SUBST(mon_sd_password)
1477 dnl Pickup any database name
1480 AC_ARG_WITH(db_name,
1481 AC_HELP_STRING([--with-db-name=DBNAME], [specify database name @<:@default=bacula@:>@]),
1483 if test "x$withval" != "x" ; then
1491 AC_ARG_WITH(db_user,
1492 AC_HELP_STRING([--with-db-user=UNAME], [specify database user @<:@default=bacula@:>@]),
1494 if test "x$withval" != "x" ; then
1502 AC_ARG_WITH(db_password,
1503 AC_HELP_STRING([--with-db-password=PWD], [specify database password @<:@default=*none*@:>@]),
1505 if test "x$withval" != "x" ; then
1506 db_password=$withval
1510 AC_SUBST(db_password)
1513 dnl Pickup a database port
1516 AC_ARG_WITH(db_port,
1517 AC_HELP_STRING([--with-db-port=DBPORT], [specify a database port @<:@default=null@:>@]),
1519 if test "x$withval" != "x" ; then
1527 # Handle users and groups for each daemon
1530 AC_ARG_WITH(dir_user,
1531 AC_HELP_STRING([--with-dir-user=USER], [specify user for Director daemon]),
1533 if test "x$withval" != "x" ; then
1540 AC_ARG_WITH(dir_group,
1541 AC_HELP_STRING([--with-dir-group=GROUP], [specify group for Director daemon]),
1543 if test "x$withval" != "x" ; then
1550 AC_ARG_WITH(sd_user,
1551 AC_HELP_STRING([--with-sd-user=USER], [specify user for Storage daemon]),
1553 if test "x$withval" != "x" ; then
1560 AC_ARG_WITH(sd_group,
1561 AC_HELP_STRING([--with-sd-group=GROUP], [specify group for Storage daemon]),
1563 if test "x$withval" != "x" ; then
1570 AC_ARG_WITH(fd_user,
1571 AC_HELP_STRING([--with-fd-user=USER], [specify user for File daemon]),
1573 if test "x$withval" != "x" ; then
1580 AC_ARG_WITH(fd_group,
1581 AC_HELP_STRING([--with-fd-group=GROUP], [specify group for File daemon]),
1583 if test "x$withval" != "x" ; then
1597 dnl allow setting default executable permissions
1600 AC_ARG_WITH(sbin-perm,
1601 AC_HELP_STRING([--with-sbin-perm=MODE], [specify permissions for sbin binaries @<:@default=0750@:>@]),
1603 if test "x$withval" != "x" ; then
1611 dnl -------------------------------------------
1612 dnl enable batch attribute DB insert (default on)
1613 dnl -------------------------------------------
1614 support_batch_insert=yes
1615 AC_ARG_ENABLE(batch-insert,
1616 AC_HELP_STRING([--enable-batch-insert], [enable the DB batch insert code @<:@default=yes@:>@]),
1618 if test x$enableval = xno; then
1619 support_batch_insert=no
1624 if test x$support_batch_insert = xyes; then
1625 AC_DEFINE(USE_BATCH_FILE_INSERT, 1, [Set if DB batch insert code enabled])
1628 dnl ------------------------------------------------
1629 dnl Bacula check for various SQL database engines
1630 dnl ------------------------------------------------
1633 dnl Set uncomment_dbi by default to '#' if DBI is enabled this will get reset
1637 BA_CHECK_POSTGRESQL_DB
1643 dnl -------------------------------------------
1644 dnl If no batch insert backend are enable set
1645 dnl variable to None
1646 dnl -------------------------------------------
1647 if test -z "${batch_insert_db_backends}"; then
1648 batch_insert_db_backends="None"
1651 dnl -------------------------------------------
1652 dnl Make sure at least one database backend is found
1653 dnl -------------------------------------------
1654 if test "x${db_backends}" = "x" ; then
1657 echo "You have not specified either --enable-client-only or one of the"
1658 echo "supported databases: MySQL, PostgreSQL, or SQLite3."
1659 echo "This is not permitted. Please reconfigure."
1661 echo "Aborting the configuration ..."
1667 dnl -------------------------------------------
1668 dnl See how many catalog backends are configured.
1669 dnl -------------------------------------------
1670 case `echo $DB_BACKENDS | wc -w | sed -e 's/^ *//'` in
1672 DEFAULT_DB_TYPE="${DB_BACKENDS}"
1673 if test x$use_libtool = xno; then
1674 SHARED_CATALOG_TARGETS=""
1676 SHARED_CATALOG_TARGETS="libbaccats-${DEFAULT_DB_TYPE}.la"
1680 dnl ------------------------------------------------
1681 dnl Set the default backend to the first backend found
1682 dnl ------------------------------------------------
1683 DEFAULT_DB_TYPE=`echo ${DB_BACKENDS} | cut -d' ' -f1`
1685 dnl ------------------------------------------------
1686 dnl For multiple backend we need libtool support.
1687 dnl ------------------------------------------------
1688 if test x$use_libtool = xno; then
1691 echo "You have specified two or more of the"
1692 echo "supported databases: MySQL, PostgreSQL, or SQLite3."
1693 echo "This is not permitted when not using libtool Please reconfigure."
1695 echo "Aborting the configuration ..."
1701 SHARED_CATALOG_TARGETS=""
1702 for db_type in ${DB_BACKENDS}
1704 if test -z "${SHARED_CATALOG_TARGETS}"; then
1705 SHARED_CATALOG_TARGETS="libbaccats-${db_type}.la"
1707 SHARED_CATALOG_TARGETS="${SHARED_CATALOG_TARGETS} libbaccats-${db_type}.la"
1713 dnl -------------------------------------------
1714 dnl Unset DB_LIBS when using libtool as we link the
1715 dnl shared library using the right database lib no need to
1716 dnl set DB_LIBS which is only used for non shared versions
1717 dnl of the backends.
1718 dnl -------------------------------------------
1719 if test x$use_libtool = xyes; then
1723 AC_SUBST(uncomment_dbi)
1724 AC_SUBST(DB_BACKENDS)
1726 AC_SUBST(DEFAULT_DB_TYPE)
1727 AC_SUBST(SHARED_CATALOG_TARGETS)
1729 AC_DEFINE(PROTOTYPES)
1731 dnl --------------------------------------------------------------------------
1732 dnl Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
1734 if test -z "$CFLAGS" -o "$CFLAGS" = "-g -O2"; then
1735 if test -z "$CCOPTS"; then
1736 CCOPTS='-g -O2 -Wall'
1744 dnl See if we can use 64 bit file addresses
1745 largefile_support="no"
1750 dnl --------------------------------------------------------------------------
1751 dnl CHECKING FOR HEADER FILES
1752 dnl --------------------------------------------------------------------------
1791 AC_STRUCT_ST_BLKSIZE
1795 dnl --------------------------------------------------------------------------
1796 dnl Check for utime.h structure
1797 dnl --------------------------------------------------------------------------
1798 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
1802 #include <sys/types.h>
1807 ba_cv_header_utime_h=yes
1809 ba_cv_header_utime_h=no
1814 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H, 1, [Set if utime.h exists])
1816 dnl --------------------------------------------------------------------------
1817 dnl Check for socklen_t
1818 dnl --------------------------------------------------------------------------
1819 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
1823 #include <sys/types.h>
1824 #include <sys/socket.h>
1828 ba_cv_header_socklen_t=yes
1830 ba_cv_header_socklen_t=no
1835 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T, 1, [Set if socklen_t exists])
1837 dnl --------------------------------------------------------------------------
1838 dnl Check for ioctl request type
1839 dnl --------------------------------------------------------------------------
1841 AC_CACHE_CHECK(for ioctl_req_t, ba_cv_header_ioctl_req_t,
1846 #include <sys/types.h>
1847 #include <sys/ioctl.h>
1849 int (*d_ioctl)(int fd, unsigned long int request, ...);
1852 ba_cv_header_ioctl_req_t=yes
1854 ba_cv_header_ioctl_req_t=no
1859 test $ba_cv_header_ioctl_req_t = yes && AC_DEFINE(HAVE_IOCTL_ULINT_REQUEST, 1, [Set if ioctl request is unsigned long int])
1861 dnl Note: it is more correct to use AC_LANG(C++) but some of the older
1862 dnl *BSD systems still use old style C prototypes, which are wrong with
1863 dnl compiled with a C++ compiler.
1866 dnl --------------------------------------------------------------------------
1867 dnl Check for typeof()
1868 dnl --------------------------------------------------------------------------
1870 AC_CACHE_CHECK(for typeof, ba_cv_have_typeof,
1874 main(){char *a = 0; a = (typeof a)a;}
1876 ba_cv_have_typeof=yes
1878 ba_cv_have_typeof=no
1880 ba_cv_have_typeof=no
1885 test $ba_cv_have_typeof = yes && AC_DEFINE([HAVE_TYPEOF], 1, [Defind to 1 if compiler has typeof])
1890 AC_C_BIGENDIAN([AC_DEFINE([HAVE_BIG_ENDIAN], [1], [Big Endian])], [AC_DEFINE([HAVE_LITTLE_ENDIAN], [1], [Little Endian])])
1892 dnl --------------------------------------------------------------------------
1893 dnl CHECKING FOR FILESYSTEM TYPE
1894 dnl --------------------------------------------------------------------------
1895 AC_MSG_CHECKING(how to get filesystem type)
1897 # The order of these tests is important.
1900 #include <sys/statvfs.h>
1901 #include <sys/fstyp.h>
1903 AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4
1905 if test $fstype = no; then
1908 #include <sys/statfs.h>
1909 #include <sys/fstyp.h>
1911 AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3
1914 if test $fstype = no; then
1917 #include <sys/statfs.h>
1918 #include <sys/vmount.h>
1920 AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX
1923 if test $fstype = no; then
1928 AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD
1931 if test $fstype = no; then
1932 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
1934 if test $fstype = no; then
1937 #include <sys/mount.h>
1938 #include <sys/fs_types.h>
1940 AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix
1943 AC_MSG_RESULT($fstype)
1945 AC_CHECK_HEADER(sys/statvfs.h, [ AC_DEFINE(HAVE_SYS_STATVFS_H,1,[Defines if your system have the sys/statvfs.h header file])] , )
1948 AC_CHECK_FUNCS(backtrace)
1951 dnl --------------------------------------------------------------------------
1952 dnl CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
1953 dnl --------------------------------------------------------------------------
1963 AC_CHECK_TYPE(ino_t, unsigned long)
1964 AC_CHECK_TYPE(dev_t, unsigned long)
1965 AC_CHECK_TYPE(daddr_t, long)
1966 AC_CHECK_TYPE(major_t, int)
1967 AC_CHECK_TYPE(minor_t, int)
1968 AC_CHECK_TYPE(ssize_t, int)
1974 AC_CHECK_SIZEOF(char, 1)
1975 AC_CHECK_SIZEOF(short int, 2)
1976 AC_CHECK_SIZEOF(int, 4)
1977 AC_CHECK_SIZEOF(long int, 4)
1978 AC_CHECK_SIZEOF(long long int, 8)
1979 AC_CHECK_SIZEOF(int *, 4)
1981 dnl Check for sys/types.h types
1982 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int,
1986 #include <sys/types.h>
1990 ac_cv_have_u_int="yes"
1992 ac_cv_have_u_int="no"
1997 if test "x$ac_cv_have_u_int" = "xyes" ; then
1998 AC_DEFINE(HAVE_U_INT)
2002 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t,
2006 #include <sys/types.h>
2010 ac_cv_have_intmax_t="yes"
2018 ac_cv_have_intmax_t="yes"
2020 ac_cv_have_intmax_t="no"
2027 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
2028 AC_DEFINE(HAVE_INTMAX_T)
2032 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t,
2036 #include <sys/types.h>
2038 u_intmax_t a; a = 1;
2040 ac_cv_have_u_intmax_t="yes"
2046 u_intmax_t a; a = 1;
2048 ac_cv_have_u_intmax_t="yes"
2050 ac_cv_have_u_intmax_t="no"
2057 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
2058 AC_DEFINE(HAVE_U_INTMAX_T)
2062 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t,
2066 #include <sys/types.h>
2068 int8_t a; int16_t b; int32_t c; a = b = c = 1;
2070 ac_cv_have_intxx_t="yes"
2072 ac_cv_have_intxx_t="no"
2077 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
2078 AC_DEFINE(HAVE_INTXX_T)
2082 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t,
2086 #include <sys/types.h>
2090 ac_cv_have_int64_t="yes"
2092 ac_cv_have_int64_t="no"
2097 if test "x$ac_cv_have_int64_t" = "xyes" ; then
2098 AC_DEFINE(HAVE_INT64_T)
2102 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t,
2106 #include <sys/types.h>
2108 u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;
2110 ac_cv_have_u_intxx_t="yes"
2112 ac_cv_have_u_intxx_t="no"
2117 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
2118 AC_DEFINE(HAVE_U_INTXX_T)
2122 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t,
2126 #include <sys/types.h>
2130 ac_cv_have_u_int64_t="yes"
2132 ac_cv_have_u_int64_t="no"
2137 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
2138 AC_DEFINE(HAVE_U_INT64_T)
2142 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
2143 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2145 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
2148 #include <sys/bitypes.h>
2150 int8_t a; int16_t b; int32_t c;
2151 u_int8_t e; u_int16_t f; u_int32_t g;
2152 a = b = c = e = f = g = 1;
2154 AC_DEFINE(HAVE_U_INTXX_T)
2155 AC_DEFINE(HAVE_INTXX_T)
2156 AC_DEFINE(HAVE_SYS_BITYPES_H)
2164 if test -z "$have_u_intxx_t" ; then
2165 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t,
2169 #include <sys/types.h>
2171 uint8_t a; uint16_t b;
2172 uint32_t c; a = b = c = 1;
2174 ac_cv_have_uintxx_t="yes"
2176 ac_cv_have_uintxx_t="no"
2181 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
2182 AC_DEFINE(HAVE_UINTXX_T)
2186 if (test -z "$have_u_int64_t" || test -z "$have_int64_t" && \
2187 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2189 AC_MSG_CHECKING([for int64_t and u_int64_t types in sys/bitypes.h])
2192 #include <sys/bitypes.h>
2194 int64_t a; u_int64_t b;
2197 AC_DEFINE(HAVE_U_INT64_T)
2198 AC_DEFINE(HAVE_INT64_T)
2206 if (test -z "$have_uintxx_t" && \
2207 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2209 AC_MSG_CHECKING([for uintXX_t types in sys/bitypes.h])
2212 #include <sys/bitypes.h>
2214 uint8_t a; uint16_t b;
2215 uint32_t c; a = b = c = 1;
2217 AC_DEFINE(HAVE_UINTXX_T)
2225 dnl --------------------------------------------------------------------------
2226 dnl CHECKING FOR REQUIRED LIBRARY FUNCTIONS
2227 dnl --------------------------------------------------------------------------
2243 [echo 'configure: cannot find needed function.'; exit 1]
2248 AC_DEFINE(HAVE_FCNTL_F_CLOSEM, 1, [Set if you have 'F_CLOSEM' fcntl flag]),
2250 [#include <fcntl.h>]
2253 AC_CHECK_FUNC(closefrom, [AC_DEFINE(HAVE_CLOSEFROM, 1, [Define to 1 if you have the 'closefrom' function.])])
2254 AC_CHECK_FUNCS(getpagesize, [AC_DEFINE(HAVE_GETPAGESIZE, 1, [Set if have getpagesize])])
2255 AC_CHECK_FUNCS(malloc_trim, [AC_DEFINE(HAVE_MALLOC_TRIM, 1, [Set if have malloc_trim])])
2257 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
2258 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
2259 AC_CHECK_FUNCS(posix_fadvise)
2260 AC_CHECK_FUNCS(fdatasync)
2262 AC_CHECK_FUNCS(chflags)
2264 AC_CHECK_FUNCS(snprintf vsnprintf gethostid fseeko)
2266 AC_CACHE_CHECK(for va_copy, ba_cv_va_copy,
2271 void use_va_copy(va_list args){va_list args2; va_copy(args2,args); va_end(args2);}
2272 void call_use_va_copy(int junk,...){va_list args; va_start(args,junk); use_va_copy(args); va_end(args);}
2274 call_use_va_copy(1,2,3)
2283 test $ba_cv_va_copy = yes && AC_DEFINE(HAVE_VA_COPY, 1, [Set if va_copy exists])
2285 dnl --------------------------------------------------------------------------
2286 dnl CHECKING FOR THREAD SAFE FUNCTIONS
2287 dnl --------------------------------------------------------------------------
2288 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
2290 # If resolver functions are not in libc check for -lnsl or -lresolv.
2291 AC_CHECK_FUNC(gethostbyname_r,
2292 AC_MSG_RESULT(using libc's resolver),
2293 AC_CHECK_LIB(nsl,gethostbyname_r)
2294 AC_CHECK_LIB(resolv,gethostbyname_r))
2296 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
2297 AC_CHECK_FUNCS(inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)])
2298 AC_CHECK_FUNCS(gethostbyname2, [AC_DEFINE(HAVE_GETHOSTBYNAME2)])
2299 AC_CHECK_FUNCS(getnameinfo, [AC_DEFINE(HAVE_GETNAMEINFO)])
2302 dnl ----------------------------
2303 dnl check sa_len of sockaddr
2304 dnl ----------------------------
2305 AC_CACHE_CHECK(for struct sockaddr has a sa_len field, ac_cv_struct_sockaddr_sa_len,
2309 #include <sys/socket.h>
2311 struct sockaddr s; s.sa_len;
2313 ac_cv_struct_sockaddr_sa_len=yes
2314 ], [ac_cv_struct_sockaddr_sa_len=no
2320 if test $ac_cv_struct_sockaddr_sa_len = yes; then
2321 AC_DEFINE(HAVE_SA_LEN, 1, [Define if sa_len field exists in struct sockaddr])
2325 dnl check for working getaddrinfo()
2327 dnl Note that if the system doesn't have gai_strerror(), we
2328 dnl can't use getaddrinfo() because we can't get strings
2329 dnl describing the error codes.
2331 AC_CACHE_CHECK(for working getaddrinfo, ac_cv_working_getaddrinfo,
2337 #include <sys/types.h>
2338 #include <sys/socket.h>
2341 struct addrinfo hints, *ai;
2344 memset(&hints, 0, sizeof(hints));
2345 hints.ai_family = AF_UNSPEC;
2346 hints.ai_socktype = SOCK_STREAM;
2347 error = getaddrinfo("127.0.0.1", NULL, &hints, &ai);
2351 if (ai->ai_addr->sa_family != AF_INET) {
2357 ac_cv_working_getaddrinfo="yes"
2359 ac_cv_working_getaddrinfo="no"
2361 ac_cv_working_getaddrinfo="yes"
2366 AC_CHECK_FUNC(gai_strerror, [AC_DEFINE(HAVE_GAI_STRERROR, 1, [Define to 1 if you have the 'gai_strerror' function.])])
2368 if test "$ac_cv_working_getaddrinfo" = "yes"; then
2369 if test "$ac_cv_func_gai_strerror" != "yes"; then
2370 ac_cv_working_getaddrinfo="no"
2372 AC_DEFINE(HAVE_GETADDRINFO, 1, [Define to 1 if getaddrinfo exists and works])
2380 AC_CHECK_FUNCS(getmntinfo, [AC_DEFINE(HAVE_GETMNTINFO)])
2381 AC_FUNC_CLOSEDIR_VOID
2382 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
2383 # AC_FUNC_FNMATCH dnl use local version
2385 AC_CHECK_LIB(intl, gettext, [LIBS="$LIBS -lintl"])
2387 AC_CHECK_LIB(sun, getpwnam)
2389 AC_CHECK_HEADERS(zlib.h)
2390 AC_CHECK_LIB(z, deflate, [ZLIBS="-lz"])
2392 if test x$ZLIBS = x-lz; then
2393 AC_DEFINE(HAVE_LIBZ)
2399 dnl Check if we have AFS on this system
2405 AC_HELP_STRING([--disable-afs], [disable afs support @<:@default=auto@:>@]),
2407 if test x$enableval = xyes; then
2409 elif test x$enableval = xno; then
2416 if test x$support_afs = xyes -o x$support_afs = xauto; then
2418 AC_HELP_STRING([--with-afsdir@<:@=DIR@:>@], [Directory holding AFS includes/libs]),
2419 with_afsdir=$withval
2423 dnl Search in standard places, or --with-afsdir not specified
2425 if test x$with_afsdir = x; then
2426 for root in /usr /usr/local; do
2427 if test -d ${root}/include/afs/ ; then
2431 if test -d ${root}/include/openafs/afs/ ; then
2438 if test -d ${with_afsdir}/include/afs/ ; then
2439 AFS_CFLAGS="-I${with_afsdir}/include"
2441 if test -d ${with_afsdir}/include/openafs/afs/ ; then
2442 AFS_CFLAGS="-I${with_afsdir}/include/openafs"
2446 saved_CFLAGS="${CFLAGS}"
2447 saved_CPPFLAGS="${CPPFLAGS}"
2448 CFLAGS="${AFS_CFLAGS} ${saved_CFLAGS}"
2449 CPPFLAGS="${AFS_CFLAGS} ${saved_CPPFLAGS}"
2451 AC_CHECK_HEADERS(afs/afsint.h)
2454 #include <afs/afsint.h>
2455 #include <afs/venus.h>
2457 AC_DEFINE(HAVE_AFS_VENUS_H,1,[Define to 1 if you have the <afs/venus.h> header file.])
2460 CFLAGS="${saved_CFLAGS}"
2461 CPPFLAGS="${saved_CPPFLAGS}"
2464 dnl See if we can find a libsys with the pioctl symbol in there
2466 AC_MSG_CHECKING(for pioctl in AFS libsys)
2467 for dir in ${with_afsdir}/lib \
2468 ${with_afsdir}/lib/afs \
2469 ${with_afsdir}/lib/openafs \
2470 ${with_afsdir}/lib64 \
2471 ${with_afsdir}/lib64/afs \
2472 ${with_afsdir}/lib64/openafs
2474 for arch_type in .a .so
2476 A=`test -f ${dir}/libsys${arch_type} && nm ${dir}/libsys${arch_type} 2>/dev/null | grep pioctl`
2478 if test $pkg = 0; then
2480 AFS_LIBS="-L${dir} -lsys -lrx -llwp ${dir}/util${arch_type}"
2486 if test $have_afs = yes; then
2492 if test x$support_afs = xyes -a $have_afs != yes; then
2493 AC_MSG_ERROR([afs support explicitly enabled but no supported afs implementation found,
2494 please either load the afs libraries or rerun configure without --enable-afs])
2496 if test $have_afs = yes; then
2497 AC_DEFINE(HAVE_AFS,1,[Define to 1 if your system has AFS support])
2498 AC_DEFINE(HAVE_AFS_ACL,1,[Andrew FileSystem ACL support])
2502 AC_SUBST(AFS_CFLAGS)
2505 dnl ---------------------------------------------------
2506 dnl Check for lzo support/directory (default on)
2507 dnl ---------------------------------------------------
2508 dnl this allows you to turn it completely off
2511 AC_HELP_STRING([--disable-lzo], [disable lzo support @<:@default=yes@:>@]),
2513 if test x$enableval = xno; then
2524 if test x$support_lzo = xyes; then
2526 AC_HELP_STRING([--with-lzo@<:@=DIR@:>@], [specify lzo library directory]),
2533 if test -f ${with_lzo}/include/lzo/lzoconf.h; then
2534 LZO_INC="-I${with_lzo}/include"
2535 LZO_LDFLAGS="-L${with_lzo}/lib"
2536 with_lzo="${with_lzo}/include"
2538 with_lzo="/usr/include"
2541 AC_CHECK_HEADER(${with_lzo}/lzo/lzoconf.h,
2543 AC_DEFINE(HAVE_LZO, 1, [Define to 1 if you have LZO compression])
2544 LZO_LIBS="${LZO_LDFLAGS} -lzo2"
2548 echo "lzoconf.h not found. lzo turned off ..."
2555 AC_CHECK_HEADER(lzo/lzoconf.h,
2557 AC_CHECK_HEADER(lzo/lzo1x.h,
2559 AC_CHECK_LIB(lzo2, lzo1x_1_compress,
2562 AC_DEFINE(HAVE_LZO,1,[Define to 1 if you have LZO compression])
2575 dnl Check for ACL support and libraries
2579 AC_HELP_STRING([--disable-acl], [disable acl support @<:@default=auto@:>@]),
2581 if test x$enableval = xyes; then
2583 elif test x$enableval = xno; then
2590 have_extended_acl=no
2591 if test x$support_acl = xyes -o x$support_acl = xauto; then
2592 AC_CHECK_HEADER(sys/acl.h, [ AC_DEFINE(HAVE_SYS_ACL_H,1,[Defines if your system have the sys/acl.h header file])] , )
2595 dnl First check for acl_get_file in libc
2597 AC_CHECK_FUNC(acl_get_file,
2604 dnl Check for acl_get_file in libacl (Linux)
2606 if test $have_acl = no; then
2607 AC_CHECK_LIB(acl, acl_get_file,
2610 if test $have_afs = yes; then
2612 dnl Because of possible naming conflict with AFS libacl make sure we use the one in /usr/lib64 or /usr/lib !!!
2614 if test -d /usr/lib64/; then
2615 FDLIBS="-L/usr/lib64 -lacl $FDLIBS"
2617 FDLIBS="-L/usr/lib -lacl $FDLIBS"
2620 FDLIBS="-lacl $FDLIBS"
2627 dnl Check for acl_get_file in libpacl (OSF1)
2628 dnl and if ACL_TYPE_DEFAULT_DIR is defined.
2630 if test $have_acl = no -a \
2631 x${HAVE_OSF1_OS_TRUE} = x; then
2632 AC_CHECK_LIB(pacl, acl_get_file,
2635 FDLIBS="-lpacl $FDLIBS"
2639 AC_MSG_CHECKING(for ACL_TYPE_DEFAULT_DIR in acl.h include file)
2640 grep ACL_TYPE_DEFAULT_DIR /usr/include/sys/acl.h > /dev/null 2>&1
2641 if test $? = 0; then
2642 AC_DEFINE(HAVE_ACL_TYPE_DEFAULT_DIR,1,[Defines if your system have the ACL_TYPE_DEFAULT_DIR acl type])
2650 dnl On OSX check for availability of ACL_TYPE_EXTENDED
2652 if test $have_acl = yes -a \
2653 x${HAVE_DARWIN_OS_TRUE} = x; then
2654 AC_MSG_CHECKING(for ACL_TYPE_EXTENDED in acl.h include file)
2655 grep ACL_TYPE_EXTENDED /usr/include/sys/acl.h > /dev/null 2>&1
2656 if test $? = 0; then
2657 AC_DEFINE(HAVE_ACL_TYPE_EXTENDED,1,[Defines if your system have the ACL_TYPE_EXTENDED acl type])
2665 dnl On FreeBSD check for availability of ACL_TYPE_NFS4
2667 if test $have_acl = yes -a \
2668 x${HAVE_FREEBSD_OS_TRUE} = x; then
2669 AC_MSG_CHECKING(for ACL_TYPE_NFS4 in acl.h include file)
2670 grep ACL_TYPE_NFS4 /usr/include/sys/acl.h > /dev/null 2>&1
2671 if test $? = 0; then
2672 AC_DEFINE(HAVE_ACL_TYPE_NFS4,1,[Defines if your system have the ACL_TYPE_NFS4 acl type])
2680 dnl Check for acltotext and acl_totext (Solaris)
2682 if test $have_acl = no -a \
2683 x${HAVE_SUN_OS_TRUE} = x; then
2684 AC_CHECK_LIB(sec, acltotext,
2687 FDLIBS="-lsec $FDLIBS"
2689 AC_CHECK_LIB(sec, acl_totext,
2691 have_extended_acl=yes
2699 dnl Check for acl_get and aclx_get (AIX)
2701 if test $have_acl = no -a \
2702 x${HAVE_AIX_OS_TRUE} = x; then
2703 AC_CHECK_FUNC(acl_get,
2707 AC_CHECK_FUNC(aclx_get,
2709 have_extended_acl=yes
2716 if test x$support_acl = xyes -a $have_acl != yes; then
2717 AC_MSG_ERROR([acl support explicitly enabled but no supported acl implementation found,
2718 please either load the acl libraries or rerun configure without --enable-acl])
2720 if test $have_acl = yes; then
2721 AC_DEFINE([HAVE_ACL],1,[Normal acl support])
2724 if test $have_extended_acl = yes; then
2725 AC_DEFINE([HAVE_EXTENDED_ACL],1,[Extended acl support])
2731 dnl Check for XATTR support
2734 AC_ARG_ENABLE(xattr,
2735 AC_HELP_STRING([--disable-xattr], [disable xattr support @<:@default=auto@:>@]),
2737 if test x$enableval = xyes; then
2739 elif test x$enableval = xno; then
2746 if test x$support_xattr = xyes -o x$support_xattr = xauto; then
2748 dnl First check for *BSD support
2749 dnl When running on a BSD variant
2751 if test x${HAVE_FREEBSD_OS_TRUE} = x -o \
2752 x${HAVE_NETBSD_OS_TRUE} = x -o \
2753 x${HAVE_OPENBSD_OS_TRUE} = x; then
2754 AC_CHECK_HEADER(sys/extattr.h, [ AC_DEFINE(HAVE_SYS_EXTATTR_H,1,[Defines if your system have the sys/extattr.h header file])] , )
2755 AC_CHECK_HEADER(libutil.h, [ AC_DEFINE(HAVE_LIBUTIL_H,1,[Defines if your system have the libutil.h header file])] , )
2756 AC_CHECK_FUNCS(extattr_get_link extattr_set_link extattr_list_link,
2759 AC_DEFINE([HAVE_EXTATTR_GET_LINK],1,[Define to 1 if you have the 'extattr_get_link' function.])
2760 AC_DEFINE([HAVE_EXTATTR_SET_LINK],1,[Define to 1 if you have the 'extattr_set_link' function.])
2761 AC_DEFINE([HAVE_EXTATTR_LIST_LINK],1,[Define to 1 if you have the 'extattr_list_link' function.])
2765 if test $have_xattr = no; then
2766 AC_CHECK_FUNCS(extattr_get_file extattr_set_file extattr_list_file,
2769 AC_DEFINE([HAVE_EXTATTR_GET_FILE],1,[Define to 1 if you have the 'extattr_get_file' function.])
2770 AC_DEFINE([HAVE_EXTATTR_SET_FILE],1,[Define to 1 if you have the 'extattr_set_file' function.])
2771 AC_DEFINE([HAVE_EXTATTR_LIST_FILE],1,[Define to 1 if you have the 'extattr_list_file' function.])
2776 if test $have_xattr = yes; then
2777 have_extattr_string_in_libc=no
2778 AC_CHECK_FUNCS(extattr_namespace_to_string extattr_string_to_namespace,
2780 have_extattr_string_in_libc=yes
2781 AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2782 AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2787 dnl If extattr_namespace_to_string and extattr_string_to_namespace are not in libc see if they are in libutil
2789 if test $have_extattr_string_in_libc = no; then
2790 AC_CHECK_LIB(util, extattr_namespace_to_string extattr_string_to_namespace,
2792 AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2793 AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2794 FDLIBS="-lutil $FDLIBS"
2802 dnl If we failed to find *BSD support try the AIX implementation of extented attributes (EA)
2803 dnl When running on AIX
2805 if test $have_xattr = no -a \
2806 x${HAVE_AIX_OS_TRUE} = x; then
2807 AC_CHECK_HEADER(sys/ea.h, [ AC_DEFINE(HAVE_SYS_EA_H,1,[Defines if your system have the sys/ea.h header file])] , )
2808 AC_CHECK_FUNCS(llistea lgetea lsetea,
2811 AC_DEFINE([HAVE_LLISTEA],1,[Define to 1 if you have the 'llistea' function.])
2812 AC_DEFINE([HAVE_LGETEA],1,[Define to 1 if you have the 'lgetea' function.])
2813 AC_DEFINE([HAVE_LSETEA],1,[Define to 1 if you have the 'lsetea' function.])
2817 if test $have_xattr = no; then
2818 AC_CHECK_FUNCS(listea getea setea,
2821 AC_DEFINE([HAVE_LISTEA],1,[Define to 1 if you have the 'listea' function.])
2822 AC_DEFINE([HAVE_GETEA],1,[Define to 1 if you have the 'getea' function.])
2823 AC_DEFINE([HAVE_SETEA],1,[Define to 1 if you have the 'setea' function.])
2830 dnl If we failed to find AIX support try the TRU64 implementation of extented attributes
2831 dnl when running on a TRU64 OS.
2833 if test $have_xattr = no -a \
2834 x${HAVE_OSF1_OS_TRUE} = x; then
2835 AC_CHECK_HEADER(sys/proplist.h, [ AC_DEFINE(HAVE_SYS_PROPLIST_H,1,[Defines if your system have the sys/proplist.h header file])] , )
2836 AC_CHECK_FUNCS(getproplist get_proplist_entry sizeof_proplist_entry add_proplist_entry setproplist,
2839 AC_DEFINE([HAVE_GETPROPLIST],1,[Define to 1 if you have the 'getproplist' function.])
2840 AC_DEFINE([HAVE_GET_PROPLIST_ENTRY],1,[Define to 1 if you have the 'get_proplist_entry' function.])
2841 AC_DEFINE([HAVE_SIZEOF_PROPLIST_ENTRY],1,[Define to 1 if you have the 'sizeof_proplist_entry' function.])
2842 AC_DEFINE([HAVE_ADD_PROPLIST_ENTRY],1,[Define to 1 if you have the 'add_proplist_entry' function.])
2843 AC_DEFINE([HAVE_SETPROPLIST],1,[Define to 1 if you have the 'setproplist' function.])
2849 dnl If we failed to find TRU64 support try the SOLARIS implementation of extented and extensible attributes
2850 dnl when running on a Solaris.
2852 if test $have_xattr = no -a \
2853 x${HAVE_SUN_OS_TRUE} = x; then
2854 AC_CHECK_HEADER(sys/attr.h, [ AC_DEFINE(HAVE_SYS_ATTR_H,1,[Defines if your system have the sys/attr.h header file])] , )
2855 AC_CHECK_HEADER(sys/nvpair.h, [ AC_DEFINE(HAVE_SYS_NVPAIR_H,1,[Defines if your system have the sys/nvpair.h header file])] , )
2856 AC_CHECK_HEADER(attr.h, [ AC_DEFINE(HAVE_ATTR_H,1,[Defines if your system have the attr.h header file])] , )
2858 AC_CHECK_FUNCS(openat fstatat unlinkat fchownat futimesat,
2861 AC_DEFINE([HAVE_OPENAT],1,[Define to 1 if you have the 'openat' function.])
2862 AC_DEFINE([HAVE_FSTATAT],1,[Define to 1 if you have the 'fstatat' function.])
2863 AC_DEFINE([HAVE_UNLINKAT],1,[Define to 1 if you have the 'unlinkat' function.])
2864 AC_DEFINE([HAVE_FCHOWNAT],1,[Define to 1 if you have the 'fchownat' function.])
2865 AC_DEFINE([HAVE_FUTIMESAT],1,[Define to 1 if you have the 'futimesat' function.])
2869 if test $have_xattr = yes; then
2870 AC_CHECK_LIB(nvpair, nvlist_next_nvpair,
2872 AC_DEFINE([HAVE_NVLIST_NEXT_NVPAIR],1,[Define to 1 if you have the 'nvlist_next_nvpair' function.])
2873 FDLIBS="-lnvpair $FDLIBS"
2880 dnl If we failed to find Solaris support try the generic xattr support code
2882 if test $have_xattr = no; then
2883 AC_CHECK_HEADER(sys/xattr.h, [ AC_DEFINE(HAVE_SYS_XATTR_H,1,[Defines if your system have the sys/xattr.h header file])] , )
2884 AC_CHECK_FUNCS(llistxattr lgetxattr lsetxattr,
2887 AC_DEFINE([HAVE_LLISTXATTR],1,[Define to 1 if you have the 'llistxattr' function.])
2888 AC_DEFINE([HAVE_LGETXATTR],1,[Define to 1 if you have the 'lgetxattr' function.])
2889 AC_DEFINE([HAVE_LSETXATTR],1,[Define to 1 if you have the 'lsetxattr' function.])
2893 if test $have_xattr = no; then
2894 AC_CHECK_FUNCS(listxattr getxattr setxattr,
2897 AC_DEFINE([HAVE_LISTXATTR],1,[Define to 1 if you have the 'listxattr' function.])
2898 AC_DEFINE([HAVE_GETXATTR],1,[Define to 1 if you have the 'getxattr' function.])
2899 AC_DEFINE([HAVE_SETXATTR],1,[Define to 1 if you have the 'setxattr' function.])
2905 if test x$support_xattr = xyes -a $have_xattr != yes; then
2906 AC_MSG_ERROR([xattr support explicitly enabled but no supported xattr implementation found,
2907 please either load the xattr libraries or rerun configure without --enable-xattr])
2909 if test $have_xattr = yes; then
2910 AC_DEFINE([HAVE_XATTR],1,[Extended Attributes support])
2916 dnl Check for pthread libraries
2919 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
2921 AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
2923 AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
2925 AC_CHECK_FUNC(pthread_create)
2934 dnl Check for headers, functions and libraries required to support
2935 dnl keeping readall capabilities
2937 AC_CHECK_HEADERS(sys/prctl.h sys/capability.h)
2938 AC_CHECK_FUNCS(prctl setreuid)
2939 AC_CHECK_LIB([cap], [cap_set_proc], [CAP_LIBS="-lcap"], [CAP_LIBS=])
2940 if test x$CAP_LIBS = x-lcap; then
2941 AC_DEFINE(HAVE_LIBCAP, 1, [Define if you have libcap])
2950 if test x$have_gcc = xyes ; then
2951 CPPFLAGS="$CPPFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
2952 CFLAGS="$CFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
2954 LDFLAGS=${LDFLAGS--O}
2955 CPPFLAGS="$CPPFLAGS"
2967 AC_SUBST(X_EXTRA_LIBS)
2972 dnl extra configurable objects
2983 dnl Finally we set appropriate distribution specific
2984 dnl variables and defaults
2986 dnl PFILES are platform specific files
2987 PFILES="platforms/Makefile"
2990 COMPRESS_MANPAGES=yes
2995 PSCMD="ps -e -o pid,comm"
2997 platforms/aix/Makefile"
2998 TAPEDRIVE="/dev/rmt0.1"
3002 PTHREAD_LIB="-lpthread -lexc"
3003 if test "${CC}" = "gcc" ; then
3010 TAPEDRIVE="/dev/nrmt0"
3013 DISTVER=`uname -a |awk '{print $3}'`
3014 TAPEDRIVE="/dev/nrmt0"
3015 PTHREAD_LIB="-pthread"
3016 CFLAGS="${CFLAGS} -pthread"
3017 PSCMD="ps -ax -o pid,command"
3021 platforms/bsdi/Makefile \
3022 platforms/bsdi/bacula-fd \
3023 platforms/bsdi/bacula-sd \
3024 platforms/bsdi/bacula-dir"
3025 largefile_support="yes"
3029 TAPEDRIVE="/dev/nst0"
3030 PSCMD="ps -e -o pid,command"
3033 platforms/darwin/Makefile"
3037 TAPEDRIVE="/dev/nst0"
3038 PSCMD="ps -e -o pid,command"
3041 platforms/osx/Makefile"
3044 if `test -f /etc/apt/sources.list && grep -q ubuntu /etc/apt/sources.list`; then
3047 DISTVER=`cat /etc/debian_version`
3048 if test -f /etc/lsb-release ; then
3050 if test "x$DISTRIB_ID" != "x" ; then
3051 DISTNAME=$DISTRIB_ID
3053 if test "x$DISTRIB_RELEASE" != "x" ; then
3054 DISTVER=$DISTRIB_RELEASE
3057 if test "$DISTNAME" = "Ubuntu" ; then
3060 TAPEDRIVE="/dev/nst0"
3061 PSCMD="ps -e -o pid,command"
3062 if test "$DISTNAME" = "ubuntu" ; then
3064 platforms/ubuntu/Makefile \
3065 platforms/ubuntu/bacula-fd \
3066 platforms/ubuntu/bacula-sd \
3067 platforms/ubuntu/bacula-dir"
3070 platforms/debian/Makefile \
3071 platforms/debian/bacula-fd \
3072 platforms/debian/bacula-sd \
3073 platforms/debian/bacula-dir"
3077 DISTVER=`uname -a |awk '{print $3}'`
3078 VER=`echo $DISTVER | cut -c 1`
3079 if test x$VER = x4 ; then
3080 PTHREAD_LIB="${PTHREAD_LIBS:--pthread}"
3081 CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS:--pthread}"
3085 TAPEDRIVE="/dev/nrsa0"
3086 PSCMD="ps -ax -o pid,command"
3088 platforms/freebsd/Makefile \
3089 platforms/freebsd/bacula-fd \
3090 platforms/freebsd/bacula-sd \
3091 platforms/freebsd/bacula-dir"
3092 largefile_support="yes"
3096 TAPEDRIVE="/dev/nst0"
3097 PSCMD="ps -e -o pid,command"
3099 platforms/hurd/Makefile \
3100 platforms/hurd/bacula-fd \
3101 platforms/hurd/bacula-sd \
3102 platforms/hurd/bacula-dir"
3105 PSCMD="UNIX95=1; ps -e -o pid,comm"
3106 CFLAGS="${CFLAGS} -D_XOPEN_SOURCE_EXTENDED=1"
3108 TAPEDRIVE="/dev/rmt/0hnb"
3109 PTHREAD_LIB="-lpthread"
3110 AC_DEFINE([_INCLUDE_LONGLONG])
3114 TAPEDRIVE="/dev/rmt/0cbn"
3115 PSCMD="ps -e -o pid,comm"
3117 platforms/irix/Makefile \
3118 platforms/irix/bacula-fd \
3119 platforms/irix/bacula-sd \
3120 platforms/irix/bacula-dir"
3123 DISTVER=`uname -a |awk '{print $3}'`
3126 TAPEDRIVE="/dev/nrst0"
3127 PSCMD="ps -ax -o pid,command"
3128 PTHREAD_LIB="-pthread"
3129 CFLAGS="${CFLAGS} -pthread"
3132 DISTVER=`uname -a |awk '{print $3}'`
3135 TAPEDRIVE="/dev/nrst0"
3136 PSCMD="ps -ax -o pid,command"
3137 PTHREAD_LIB="-pthread"
3138 CFLAGS="${CFLAGS} -pthread"
3140 platforms/openbsd/Makefile \
3141 platforms/openbsd/bacula-fd \
3142 platforms/openbsd/bacula-sd \
3143 platforms/openbsd/bacula-dir"
3146 if test -f /etc/whitebox-release ; then
3147 f=/etc/whitebox-release
3149 f=/etc/redhat-release
3151 if test `cat $f | grep release |\
3152 cut -f 3 -d ' '`x = "Enterprise"x ; then
3153 DISTVER="Enterprise "`cat $f | grep release |\
3156 DISTVER=`cat /etc/redhat-release | grep release |\
3159 TAPEDRIVE="/dev/nst0"
3160 PSCMD="ps -e -o pid,command"
3162 platforms/redhat/Makefile \
3163 platforms/redhat/bacula-fd \
3164 platforms/redhat/bacula-sd \
3165 platforms/redhat/bacula-dir
3169 DISTVER=`cat /etc/mandrake-release | grep release |\
3171 TAPEDRIVE="/dev/nst0"
3172 PSCMD="ps -e -o pid,command"
3174 platforms/mandrake/Makefile \
3175 platforms/mandrake/bacula-fd \
3176 platforms/mandrake/bacula-sd \
3177 platforms/mandrake/bacula-dir \
3181 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
3182 TAPEDRIVE="/dev/nst0"
3183 PSCMD="ps -e -o pid,command"
3185 platforms/gentoo/Makefile \
3186 platforms/gentoo/bacula-init \
3187 platforms/gentoo/bacula-fd \
3188 platforms/gentoo/bacula-sd \
3189 platforms/gentoo/bacula-dir"
3192 DISTVER=`cat /etc/slackware-version`
3193 TAPEDRIVE="/dev/nst0"
3194 PSCMD="ps -e -o pid,command"
3196 platforms/slackware/Makefile \
3197 platforms/slackware/rc.bacula-fd \
3198 platforms/slackware/rc.bacula-sd \
3199 platforms/slackware/rc.bacula-dir\
3200 platforms/slackware/functions.bacula"
3204 TAPEDRIVE="/dev/rmt/0cbn"
3205 PSCMD="ps -e -o pid,comm"
3207 platforms/solaris/Makefile \
3208 platforms/solaris/bacula-fd \
3209 platforms/solaris/bacula-sd \
3210 platforms/solaris/bacula-dir"
3214 AC_DEFINE(HAVE_OLD_SOCKOPT)
3215 AC_DEFINE(USE_THR_SETCONCURRENCY)
3218 AC_DEFINE(USE_THR_SETCONCURRENCY)
3223 LIBS="$LIBS -lresolv -lrt"
3226 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
3228 TAPEDRIVE="/dev/nst0"
3229 PSCMD="ps -e -o pid,command"
3231 platforms/suse/Makefile \
3232 platforms/suse/bacula-fd \
3233 platforms/suse/bacula-sd \
3234 platforms/suse/bacula-dir \
3235 platforms/suse/bacula"
3240 TAPEDRIVE="/dev/nst0"
3241 PSCMD="ps -e -o pid,command"
3243 platforms/suse/Makefile \
3244 platforms/suse/bacula-fd \
3245 platforms/suse/bacula-sd \
3246 platforms/suse/bacula-dir"
3250 TAPEDRIVE="/dev/nst0"
3253 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
3257 dnl -------------------------------------------
3258 dnl systemd (default off)
3259 dnl -------------------------------------------
3260 AC_MSG_CHECKING(for systemd support)
3261 AC_ARG_WITH(systemd,
3262 AC_HELP_STRING([--with-systemd@<:@=UNITDIR@:>@], [Include systemd support. UNITDIR is where systemd system .service files are located, default is to ask systemctl.]),
3264 if test "$withval" != "no"; then
3265 if test "$withval" = "yes"; then
3266 SYSTEMD_UNITDIR="`systemctl show | grep UnitPath | cut -d " " -f2`"
3268 SYSTEMD_UNITDIR="${withval}"
3272 platforms/systemd/Makefile \
3273 platforms/systemd/bacula.conf \
3274 platforms/systemd/bacula-dir.service \
3275 platforms/systemd/bacula-fd.service \
3276 platforms/systemd/bacula-sd.service"
3277 AC_DEFINE(HAVE_SYSTEMD, 1, [Define to 1 if systemd support should be enabled])
3279 support_systemd="yes"
3282 support_systemd="no"
3285 support_systemd="no"
3289 AC_SUBST(SYSTEMD_UNITDIR)
3293 LIBS="$PTHREAD_LIB $LIBS"
3295 AC_DEFINE_UNQUOTED(lld, "$lld")
3296 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 ..."
3322 AC_OUTPUT([autoconf/Make.common \
3325 scripts/btraceback \
3328 scripts/bacula-ctl-dir \
3329 scripts/bacula-ctl-fd \
3330 scripts/bacula-ctl-sd \
3331 scripts/devel_bacula \
3334 scripts/mtx-changer \
3335 scripts/disk-changer \
3336 scripts/dvd-handler \
3337 scripts/dvd-simulator \
3338 scripts/logwatch/Makefile \
3339 scripts/logwatch/logfile.bacula.conf \
3340 scripts/bat.desktop \
3341 scripts/bat.desktop.xsu \
3342 scripts/bat.desktop.consolehelper \
3343 scripts/bat.console_apps \
3346 src/console/Makefile \
3347 src/console/bconsole.conf \
3348 src/qt-console/bat.conf \
3349 src/qt-console/bat.pro \
3350 src/qt-console/bat.pro.mingw32 \
3351 src/qt-console/install_conf_file \
3353 src/dird/bacula-dir.conf \
3355 src/stored/Makefile \
3356 src/stored/bacula-sd.conf \
3357 src/filed/Makefile \
3358 src/filed/bacula-fd.conf \
3360 src/cats/make_catalog_backup.pl \
3361 src/cats/make_catalog_backup \
3362 src/cats/delete_catalog_backup \
3363 src/cats/create_postgresql_database \
3364 src/cats/update_postgresql_tables \
3365 src/cats/make_postgresql_tables \
3366 src/cats/grant_postgresql_privileges \
3367 src/cats/drop_postgresql_tables \
3368 src/cats/drop_postgresql_database \
3369 src/cats/create_mysql_database \
3370 src/cats/update_mysql_tables \
3371 src/cats/make_mysql_tables \
3372 src/cats/grant_mysql_privileges \
3373 src/cats/drop_mysql_tables \
3374 src/cats/drop_mysql_database \
3375 src/cats/create_sqlite3_database \
3376 src/cats/update_sqlite3_tables \
3377 src/cats/make_sqlite3_tables \
3378 src/cats/grant_sqlite3_privileges \
3379 src/cats/drop_sqlite3_tables \
3380 src/cats/drop_sqlite3_database \
3383 src/cats/create_bacula_database \
3384 src/cats/update_bacula_tables \
3385 src/cats/grant_bacula_privileges \
3386 src/cats/make_bacula_tables \
3387 src/cats/drop_bacula_tables \
3388 src/cats/drop_bacula_database \
3389 src/cats/install-default-backend \
3390 src/findlib/Makefile \
3391 src/tools/Makefile \
3392 src/plugins/fd/Makefile \
3393 src/plugins/sd/Makefile \
3394 src/plugins/dir/Makefile \
3396 updatedb/update_mysql_tables_9_to_10 \
3397 updatedb/update_sqlite3_tables_9_to_10 \
3398 updatedb/update_postgresql_tables_9_to_10 \
3399 updatedb/update_mysql_tables_10_to_11 \
3400 updatedb/update_sqlite3_tables_10_to_11 \
3401 updatedb/update_postgresql_tables_10_to_11 \
3402 updatedb/update_mysql_tables_11_to_12 \
3403 updatedb/update_sqlite3_tables_11_to_12 \
3404 updatedb/update_postgresql_tables_11_to_12 \
3405 examples/nagios/check_bacula/Makefile \
3406 platforms/rpms/redhat/bacula.spec \
3407 platforms/rpms/redhat/bacula-bat.spec \
3408 platforms/rpms/redhat/bacula-docs.spec \
3409 platforms/rpms/redhat/bacula-mtx.spec \
3410 platforms/rpms/suse/bacula.spec \
3411 platforms/rpms/suse/bacula-bat.spec \
3412 platforms/rpms/suse/bacula-docs.spec \
3413 platforms/rpms/suse/bacula-mtx.spec \
3418 if test "${support_bat}" = "yes" ; then
3419 if test "x$QMAKE" = "xnone"; then
3420 AC_MSG_ERROR([Could not find qmake $PATH. Check your Qt installation])
3424 echo "Creating bat Makefile"
3435 dnl if CC is gcc, we can rebuild the dependencies (since the depend rule
3436 dnl requires gcc). If it's not, don't rebuild dependencies
3438 if test X"$GCC" = "Xyes" ; then
3439 echo "Doing make of dependencies"
3440 ${MAKE:-make} depend
3444 chmod 755 install_conf_file build-depkgs-qt-console
3448 chmod 755 bacula btraceback mtx-changer storage-ctl bsg_persist
3449 chmod 755 dvd-handler dvd-simulator
3450 chmod 755 bconsole disk-changer devel_bacula logrotate
3454 chmod 755 $c/update_mysql_tables_10_to_11 $c/update_sqlite3_tables_10_to_11
3455 chmod 755 $c/update_postgresql_tables_10_to_11
3456 chmod 755 $c/update_mysql_tables_11_to_12 $c/update_sqlite3_tables_11_to_12
3457 chmod 755 $c/update_postgresql_tables_11_to_12
3462 chmod 755 $c/create_bacula_database $c/update_bacula_tables $c/make_bacula_tables
3463 chmod 755 $c/grant_bacula_privileges $c/drop_bacula_tables $c/drop_bacula_database
3465 chmod 755 $c/create_mysql_database $c/update_mysql_tables $c/make_mysql_tables
3466 chmod 755 $c/grant_mysql_privileges $c/drop_mysql_tables $c/drop_mysql_database
3468 chmod 755 $c/create_sqlite3_database $c/update_sqlite3_tables $c/make_sqlite3_tables
3469 chmod 755 $c/grant_sqlite3_privileges $c/drop_sqlite3_tables $c/drop_sqlite3_database
3471 chmod 755 $c/create_postgresql_database $c/update_postgresql_tables $c/make_postgresql_tables
3472 chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables $c/drop_postgresql_database
3474 #chmod 755 $c/create_ingres_database $c/update_ingres_tables $c/make_ingres_tables
3475 #chmod 755 $c/grant_ingres_privileges $c/drop_ingres_tables $c/drop_ingres_database
3478 chmod 755 $c/make_catalog_backup $c/delete_catalog_backup $c/make_catalog_backup.pl
3482 chmod 755 $c/install-default-backend
3484 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
3485 largefile_support="yes"
3488 dnl Only try to find out the version number of the compiler when we know its some kind of GCC compiler
3489 if test X"$GCC" = "Xyes" ; then
3491 dnl A whole lot of hand springs to get the compiler version.
3492 dnl This is because gcc changed the output in version 3.0
3494 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3495 if test "x${CCVERSION}" = "x" ; then
3496 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3498 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3499 if test x"${CXXVERSION}" = x ; then
3500 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3504 # clean up any old junk
3511 Configuration on `date`:
3513 Host: ${host}${post_host} -- ${DISTNAME} ${DISTVER}
3514 Bacula version: ${BACULA} ${VERSION} (${DATE})
3515 Source code location: ${srcdir}
3516 Install binaries: ${sbindir}
3517 Install libraries: ${libdir}
3518 Install config files: ${sysconfdir}
3519 Scripts directory: ${scriptdir}
3520 Archive directory: ${archivedir}
3521 Working directory: ${working_dir}
3522 PID directory: ${piddir}
3523 Subsys directory: ${subsysdir}
3524 Man directory: ${mandir}
3525 Data directory: ${datarootdir}
3526 Plugin directory: ${plugindir}
3527 C Compiler: ${CC} ${CCVERSION}
3528 C++ Compiler: ${CXX} ${CXXVERSION}
3529 Compiler flags: ${WCFLAGS} ${CFLAGS}
3530 Linker flags: ${WLDFLAGS} ${LDFLAGS}
3532 Statically Linked Tools: ${support_static_tools}
3533 Statically Linked FD: ${support_static_fd}
3534 Statically Linked SD: ${support_static_sd}
3535 Statically Linked DIR: ${support_static_dir}
3536 Statically Linked CONS: ${support_static_cons}
3537 Database backends: ${db_backends}
3538 Database port: ${db_port}
3539 Database name: ${db_name}
3540 Database user: ${db_user}
3542 Job Output Email: ${job_email}
3543 Traceback Email: ${dump_email}
3544 SMTP Host Address: ${smtp_host}
3546 Director Port: ${dir_port}
3547 File daemon Port: ${fd_port}
3548 Storage daemon Port: ${sd_port}
3550 Director User: ${dir_user}
3551 Director Group: ${dir_group}
3552 Storage Daemon User: ${sd_user}
3553 Storage DaemonGroup: ${sd_group}
3554 File Daemon User: ${fd_user}
3555 File Daemon Group: ${fd_group}
3557 Large file support: $largefile_support
3558 Bacula conio support: ${got_conio} ${CONS_LIBS}
3559 readline support: ${got_readline} ${PRTREADLINE_SRC}
3560 TCP Wrappers support: ${TCPW_MSG} ${WRAPLIBS}
3561 TLS support: ${support_tls}
3562 Encryption support: ${support_crypto}
3563 ZLIB support: ${have_zlib}
3564 LZO support: ${have_lzo}
3565 enable-smartalloc: ${support_smartalloc}
3566 enable-lockmgr: ${support_lockmgr}
3567 bat support: ${support_bat}
3568 client-only: ${build_client_only}
3569 build-dird: ${build_dird}
3570 build-stored: ${build_stored}
3571 Plugin support: ${have_plugins}
3572 AFS support: ${have_afs}
3573 ACL support: ${have_acl}
3574 XATTR support: ${have_xattr}
3575 Python support: ${support_python} ${PYTHON_LIBS}
3576 systemd support: ${support_systemd} ${SYSTEMD_UNITDIR}
3577 Batch insert enabled: ${batch_insert_db_backends}
3581 # create a small shell script useful for support with
3582 # configure options and config.out info
3583 cat > scripts/bacula_config << EOF
3586 $ $0 $ac_configure_args
3588 cat config.out >> scripts/bacula_config
3589 echo __EOC__ >> scripts/bacula_config
3590 chmod 755 scripts/bacula_config