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`
53 LIBBAC_LT_RELEASE=${LIBBAC_LT_RELEASE:-$VERSION}
54 LIBBACCFG_LT_RELEASE=${LIBBACCFG_LT_RELEASE:-$VERSION}
56 AC_SUBST(LIBBAC_LT_RELEASE)dnl
57 AC_SUBST(LIBBACCFG_LT_RELEASE)dnl
60 dnl can be overwritten by specific values from version.h
61 LIBBACSQL_LT_RELEASE=`sed -n -e 's/^#.*LIBBACSQL_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
62 LIBBACCATS_LT_RELEASE=`sed -n -e 's/^#.*LIBBACCATS_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
64 LIBBACSQL_LT_RELEASE=${LIBBACSQL_LT_RELEASE:-$VERSION}
65 LIBBACCATS_LT_RELEASE=${LIBBACCATS_LT_RELEASE:-$VERSION}
67 AC_SUBST(LIBBACSQL_LT_RELEASE)dnl
68 AC_SUBST(LIBBACCATS_LT_RELEASE)dnl
71 dnl can be overwritten by specific values from version.h
72 LIBBACFIND_LT_RELEASE=`sed -n -e 's/^#.*LIBBACFIND_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
74 LIBBACFIND_LT_RELEASE=${LIBBACFIND_LT_RELEASE:-$VERSION}
76 AC_SUBST(LIBBACFIND_LT_RELEASE)dnl
78 echo "configuring for ${BACULA} $VERSION ($DATE)"
81 dnl -------------------------------------------------------
82 dnl Check for compiler.
83 dnl ------------------------------------------------------
87 AC_PROG_CC_C_O dnl Determine if C compiler support -c -o.
88 AC_PROG_GCC_TRADITIONAL dnl Determine if ioctl() need -traditional.
92 if test "x$BASECC" = xgcc; then
96 AC_PATH_PROG(CXX, $CXX, $CXX)
97 if test ! -e $CXX; then
98 AC_MSG_ERROR(Unable to find C++ compiler)
101 dnl -------------------------------------------------------
102 dnl Check for programs.
103 dnl ------------------------------------------------------
105 AC_PATH_PROG(MV, mv, mv)
107 dnl If we name the variable RM it will shadow the RM variable in the configure script and we overwrite the
108 dnl value with the name of the rm command and not rm -f which is its normal content. This gives all kind
109 dnl of strange output of the configure script (like things don't exist etc.).
110 dnl So we name it REMOVE (more software has run into this problem)
111 AC_PATH_PROG(REMOVE, rm, rm)
112 AC_PATH_PROG(CP, cp, cp)
113 AC_PATH_PROG(SED, sed, sed)
114 AC_PATH_PROG(ECHO, echo, echo)
115 AC_PATH_PROG(CMP, cmp, cmp)
116 AC_PATH_PROG(TBL, tbl, tbl)
117 AC_PATH_PROG(AR, ar, ar)
118 AC_PATH_PROG(OPENSSL, openssl, none)
119 AC_PATH_PROG(MTX, mtx, mtx)
120 AC_PATH_PROG(DD, dd, dd)
121 AC_PATH_PROG(MKISOFS, mkisofs, mkisofs)
122 AC_PATH_PROG(PYTHON, python, python)
123 AC_PATH_PROG(GROWISOFS, growisofs, growisofs)
124 AC_PATH_PROG(DVDRWMEDIAINFO, dvd+rw-mediainfo, dvd+rw-mediainfo)
125 AC_PATH_PROG(DVDRWFORMAT, dvd+rw-format, dvd+rw-format)
126 AC_PATH_PROG(PKGCONFIG, pkg-config, pkg-config)
127 AC_PATH_PROG(QMAKE, qmake, none)
128 AC_PATH_PROG(GMAKE, gmake, none)
129 AC_PATH_PROG(CDRECORD, cdrecord, cdrecord)
130 AC_PATH_PROG(PIDOF, pidof, pidof)
132 # Some AWK programs fail, so test it and warn the user
133 if echo xfoo | $AWK 'BEGIN { prog=ARGV[1]; ARGC=1 }
134 { if ((prog == $2) || (("(" prog ")") == $2) ||
135 (("[" prog "]") == $2) ||
136 ((prog ":") == $2)) { print $1 ; exit 0 } }' xfoo>/dev/null; then :;
138 AC_MSG_ERROR([!!!!!!!!! WARNING !!!!!!!!!!!!!!
139 The regex engine of $AWK is too broken to be used you
140 might want to install GNU AWK.
141 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!])
144 AC_PATH_PROG(AWK, $THE_AWK, $THE_AWK)
147 test -n "$ARFLAG" || ARFLAGS="cr"
154 AC_SUBST(LOCAL_CFLAGS)
155 AC_SUBST(LOCAL_LDFLAGS)
158 dnl --------------------------------------------------
160 dnl --------------------------------------------------
162 AC_ARG_ENABLE(libtool,
163 AC_HELP_STRING([--enable-libtool], [enable building using GNU libtool @<:@default=yes@:>@]),
165 if test x$enableval = xno; then
170 LT_INIT([shared disable-static])
174 if test x$use_libtool != xno; then
175 DEFAULT_OBJECT_TYPE=".lo"
176 DEFAULT_ARCHIVE_TYPE=".la"
177 DEFAULT_SHARED_OBJECT_TYPE=".la"
178 LIBTOOL="\$(LIBTOOL)"
179 LIBTOOL_INSTALL_TARGET="libtool-install"
180 LIBTOOL_UNINSTALL_TARGET="libtool-uninstall"
181 LIBTOOL_CLEAN_TARGET="libtool-clean"
182 QMAKE_LIBTOOL="${BUILD_DIR}/libtool"
183 FD_PLUGIN_DIR="src/plugins/fd"
186 DEFAULT_OBJECT_TYPE=".o"
187 DEFAULT_ARCHIVE_TYPE=".a"
188 DEFAULT_SHARED_OBJECT_TYPE=".so"
189 LIBTOOL="# \$(LIBTOOL)"
190 LIBTOOL_INSTALL_TARGET=""
191 LIBTOOL_UNINSTALL_TARGET=""
192 LIBTOOL_CLEAN_TARGET=""
193 QMAKE_LIBTOOL="# ${BUILD_DIR}/libtool"
198 AC_SUBST(DEFAULT_OBJECT_TYPE)
199 AC_SUBST(DEFAULT_ARCHIVE_TYPE)
200 AC_SUBST(DEFAULT_SHARED_OBJECT_TYPE)
202 AC_SUBST(LIBTOOL_INSTALL_TARGET)
203 AC_SUBST(LIBTOOL_UNINSTALL_TARGET)
204 AC_SUBST(LIBTOOL_CLEAN_TARGET)
205 AC_SUBST(QMAKE_LIBTOOL)
206 AC_SUBST(FD_PLUGIN_DIR)
208 dnl --------------------------------------------------
209 dnl Include file handling
210 dnl --------------------------------------------------
211 AC_ARG_ENABLE(includes,
212 AC_HELP_STRING([--enable-includes], [enable installing of include files @<:@default=no@:>@]),
214 if test x$enableval = xyes; then
220 dnl It only makes sense to install include files when you install libraries which only happens when
221 dnl libtool is enabled
223 if test x$use_libtool != xno -a x$install_includes = xyes; then
224 INCLUDE_INSTALL_TARGET="install-includes"
225 INCLUDE_UNINSTALL_TARGET="uninstall-includes"
227 INCLUDE_INSTALL_TARGET=""
228 INCLUDE_UNINSTALL_TARGET=""
230 AC_SUBST(INCLUDE_INSTALL_TARGET)
231 AC_SUBST(INCLUDE_UNINSTALL_TARGET)
233 dnl --------------------------------------------------
234 dnl Bacula OP Sys determination (see aclocal.m4)
235 dnl --------------------------------------------------
238 dnl -----------------------------------------------------------
239 dnl Bacula OPSys Distribution determination (see aclocal.m4)
240 dnl ----------------------------------------------------------
241 BA_CHECK_OPSYS_DISTNAME
243 dnl --------------------------------------------------
244 dnl Suppport for gettext (translations)
245 dnl By default, $datarootdir is ${prefix}/share
246 dnl --------------------------------------------------
247 AM_GNU_GETTEXT([external])
249 dnl ------------------------------------------------------------------
250 dnl If the user has not set --prefix, we set our default to nothing.
251 dnl In this case, if the user has not set --sysconfdir, we set it
252 dnl to the package default of /etc/bacula. If either --prefix or
253 dnl --sysconfdir is set, we leave sysconfdir alone except to eval it.
254 dnl If the user has not set --libdir, we set it to the package
255 dnl default of /usr/lib. If either --prefix or --libdir is set,
256 dnl we leave libdir alone except to eval it. If the user has not set
257 dnl --includedir, we set it to the package default of /usr/include.
258 dnl If either --prefix or --includedir is set, we leave includedir
259 dnl alone except to eval it
260 dnl ------------------------------------------------------------------
261 os_name=`uname -s 2>/dev/null`
262 if test x${prefix} = xNONE ; then
263 if test `eval echo ${sysconfdir}` = NONE/etc ; then
264 sysconfdir=/etc/bacula
267 if test `eval echo ${libdir}` = NONE/lib ; then
270 os_processor=`uname -p 2>/dev/null`
271 case ${os_processor} in
286 if test `eval echo ${includedir}` = NONE/include ; then
287 includedir=/usr/include
290 if test `eval echo ${datarootdir}` = NONE/share ; then
291 datarootdir=/usr/share
296 dnl -------------------------------------------------------------------------
297 dnl If the user has not set --exec-prefix, we default to ${prefix}
298 dnl -------------------------------------------------------------------------
299 if test x${exec_prefix} = xNONE ; then
300 exec_prefix=${prefix}
303 sysconfdir=`eval echo ${sysconfdir}`
304 datarootdir=`eval echo ${datarootdir}`
305 docdir=`eval echo ${docdir}`
306 htmldir=`eval echo ${htmldir}`
307 libdir=`eval echo ${libdir}`
308 includedir=`eval echo ${includedir}`
309 localedir=`eval echo ${datarootdir}/locale`
310 AC_DEFINE_UNQUOTED(SYSCONFDIR, "$sysconfdir")
311 AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir")
313 dnl ------------------------------------------------------------------
314 dnl If the user has not set --sbindir, we set our default as /sbin
315 dnl ------------------------------------------------------------------
316 if test x$sbindir = x'${exec_prefix}/sbin' ; then
317 sbindir=${exec_prefix}/sbin
319 sbindir=`eval echo ${sbindir}`
321 dnl -------------------------------------------------------------------------
322 dnl If the user has not set --mandir, we default to /usr/share/man
323 dnl -------------------------------------------------------------------------
324 if test x$mandir = x'${prefix}/man' ; then
325 mandir=/usr/share/man
328 dnl -------------------------------------------------------------------------
329 dnl If the user has not set --htmldir, we default to /usr/share/doc/bacula/html
330 dnl -------------------------------------------------------------------------
331 if test x$htmldir = x'/usr/share/doc/bacula/' ; then
332 htmldir=`eval echo ${docdir}html`
335 dnl -------------------------------------------------------------------------
336 dnl If the user has not set --docdir, we default to /usr/share/doc/bacula
337 dnl -------------------------------------------------------------------------
338 if test x$docdir = x'/usr/share/doc/' ; then
339 docdir=`eval echo ${docdir}bacula`
343 AC_PATH_PROGS(MSGFMT, msgfmt, no)
344 if test "$MSGFMT" = "no"
346 echo 'msgfmt program not found, disabling NLS !'
348 USE_INCLUDED_LIBINTL=no
353 support_smartalloc=yes
360 support_static_tools=no
363 support_static_dir=no
364 support_static_cons=no
369 batch_insert_db_backends=""
372 dnl --------------------------------------------------------------------------
373 dnl CHECKING COMMAND LINE OPTIONS
374 dnl --------------------------------------------------------------------------
376 dnl -------------------------------------------
377 dnl bat (default off)
378 dnl -------------------------------------------
380 AC_HELP_STRING([--enable-bat], [enable build of bat Qt4 GUI @<:@default=no@:>@]),
382 if test x$enableval = xyes; then
383 AC_DEFINE(HAVE_BAT, 1, [Set if Bacula bat Qt4 GUI support enabled])
390 if test x$support_bat = xyes; then
391 abc=`$PKGCONFIG --atleast-version=4.2 QtGui`
393 if test $pkg = 0; then
394 BAT_DIR=src/qt-console
396 AC_MSG_ERROR(Unable to find Qt4 installation needed by bat)
401 dnl The qwt library was used with bat, but that is no longer the case
409 dnl if test x$support_bat = xyes; then
410 dnl AC_MSG_CHECKING(for qwt support)
412 dnl AC_HELP_STRING([--with-qwt@<:@=DIR@:>@], [specify qwt library directory]),
414 dnl case "$with_qwt" in
419 dnl if test -f ${with_qwt}/include/qwt.h; then
420 dnl QWT_INC="${with_qwt}/include"
421 dnl QWT_LDFLAGS="-L${with_qwt}/lib"
431 dnl dnl Search in standard places, or --with-qwt not specified
433 dnl if test $no_qwt = no; then
434 dnl if test x$QWT_INC = x; then
435 dnl for root in /usr /usr/local; do
436 dnl for ver in qwt qwt5 qwt-qt4; do
437 dnl if test -f ${root}/include/${ver}/qwt.h; then
438 dnl QWT_INC="${root}/include/${ver}"
439 dnl if test -d ${root}/lib64/; then
440 dnl QWT_LDFLAGS="-L${root}/lib64"
441 dnl elif test -d ${root}/lib/64/; then
442 dnl QWT_LDFLAGS="-L${root}/64"
444 dnl QWT_LDFLAGS="-L${root}/lib"
455 dnl if test x$QWT_INC = x; then
456 dnl AC_MSG_RESULT(no)
458 dnl AC_DEFINE(HAVE_QWT, 1, [Set if bat QWT library found])
459 dnl AC_MSG_RESULT(yes)
465 AC_SUBST(QWT_LDFLAGS)
470 dnl -------------------------------------------
471 dnl smartalloc (default off)
472 dnl -------------------------------------------
473 AC_ARG_ENABLE(smartalloc,
474 AC_HELP_STRING([--enable-smartalloc], [enable smartalloc debugging support @<:@default=no@:>@]),
476 if test x$enableval = xno; then
477 support_smartalloc=no
482 if test x$support_smartalloc = xyes; then
483 AC_DEFINE(SMARTALLOC, 1, [Set if you want Smartalloc enabled])
486 dnl -------------------------------------------
487 dnl Lock Manager (default off)
488 dnl -------------------------------------------
489 AC_ARG_ENABLE(lockmgr,
490 AC_HELP_STRING([--enable-lockmgr], [enable lock manager support @<:@default=no@:>@]),
492 if test x$enableval = xyes; then
498 if test x$support_lockmgr = xyes; then
499 AC_DEFINE(_USE_LOCKMGR, 1, [Set if you want Lock Manager enabled])
503 dnl -------------------------------------------
504 dnl static-tools (default off)
505 dnl -------------------------------------------
506 AC_ARG_ENABLE(static-tools,
507 AC_HELP_STRING([--enable-static-tools], [enable static tape tools @<:@default=no@:>@]),
509 if test x$enableval = xyes; then
510 if test x$use_libtool = xyes; then
511 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
512 please rerun configure with --disable-libtool])
514 support_static_tools=yes
520 if test x$support_static_tools = xyes; then
521 TTOOL_LDFLAGS="-static"
523 AC_SUBST(TTOOL_LDFLAGS)
525 dnl -------------------------------------------
526 dnl static-fd (default off)
527 dnl -------------------------------------------
528 AC_ARG_ENABLE(static-fd,
529 AC_HELP_STRING([--enable-static-fd], [enable static File daemon @<:@default=no@:>@]),
531 if test x$enableval = xyes; then
532 if test x$use_libtool = xyes; then
533 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
534 please rerun configure with --disable-libtool])
536 support_static_fd=yes
542 if test x$support_static_fd = xyes; then
543 STATIC_FD="static-bacula-fd"
547 dnl -------------------------------------------
548 dnl static-sd (default off)
549 dnl -------------------------------------------
550 AC_ARG_ENABLE(static-sd,
551 AC_HELP_STRING([--enable-static-sd], [enable static Storage daemon @<:@default=no@:>@]),
553 if test x$enableval = xyes; then
554 if test x$use_libtool = xyes; then
555 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
556 please rerun configure with --disable-libtool])
558 support_static_sd=yes
564 if test x$support_static_sd = xyes; then
565 STATIC_SD="static-bacula-sd"
569 dnl -------------------------------------------
570 dnl static-dir (default off)
571 dnl -------------------------------------------
572 AC_ARG_ENABLE(static-dir,
573 AC_HELP_STRING([--enable-static-dir], [enable static Director @<:@default=no@:>@]),
575 if test x$enableval = xyes; then
576 if test x$use_libtool = xyes; then
577 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
578 please rerun configure with --disable-libtool])
580 support_static_dir=yes
586 if test x$support_static_dir = xyes; then
587 STATIC_DIR="static-bacula-dir"
591 dnl -------------------------------------------
592 dnl static-cons (default off)
593 dnl -------------------------------------------
594 AC_ARG_ENABLE(static-cons,
595 AC_HELP_STRING([--enable-static-cons], [enable static Console @<:@default=no@:>@]),
597 if test x$enableval = xyes; then
598 if test x$use_libtool = xyes; then
599 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
600 please rerun configure with --disable-libtool])
602 support_static_cons=yes
608 if test x$support_static_cons = xyes; then
609 STATIC_CONS="static-bconsole"
611 AC_SUBST(STATIC_CONS)
613 dnl -------------------------------------------
614 dnl client_only (default off)
615 dnl -------------------------------------------
616 AC_ARG_ENABLE(client-only,
617 AC_HELP_STRING([--enable-client-only], [build client (File daemon) only @<:@default=no@:>@]),
619 if test x$enableval = xyes; then
620 build_client_only=yes
626 if test x$build_client_only = xno; then
633 dnl -------------------------------------------
634 dnl director (default on)
635 dnl -------------------------------------------
636 AC_ARG_ENABLE(build-dird,
637 AC_HELP_STRING([--enable-build-dird], [enable building of dird (Director) @<:@default=yes@:>@]),
639 if test x$enableval = xno; then
644 if test x$build_dird = xyes; then
649 DIR_TOOLS="NODIRTOOLS"
654 dnl -------------------------------------------
655 dnl stored (default on)
656 dnl -------------------------------------------
657 AC_ARG_ENABLE(build-stored,
658 AC_HELP_STRING([--enable-build-stored], [enable building of stored (Storage daemon) @<:@default=yes@:>@]),
660 if test x$enableval = xno; then
665 if test x$build_stored = xyes; then
666 STORED_DIR="src/stored"
672 dnl ---------------------------------------------------
673 dnl Check for conio (Bacula readline substitute)(
674 dnl ---------------------------------------------------
675 dnl this allows you to turn it completely off
677 AC_HELP_STRING([--disable-conio], [disable conio support @<:@default=no@:>@]),
679 if test x$enableval = xno; then
686 dnl ---------------------------------------------------
687 dnl Check for IPv6 support
688 dnl ---------------------------------------------------
689 dnl this allows you to turn it completely off
692 AC_HELP_STRING([--enable-ipv6], [enable ipv6 support @<:@default=yes@:>@]),
694 if test x$enableval = xno; then
700 if test x$support_ipv6 = xyes; then
701 AC_TRY_LINK([ #include <sys/types.h>
702 #include <sys/socket.h>
703 #include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;],
704 [support_ipv6=yes], [support_ipv6=no])
707 if test x$support_ipv6 = xyes; then
708 AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
712 AC_CHECK_HEADER(curses.h, [
713 AC_CHECK_LIB(tinfo, tgetent, [ TERM_LIB="-ltinfo" ], [
714 AC_CHECK_LIB(ncurses, tgetent, [ TERM_LIB="-lncurses" ], [
715 AC_CHECK_LIB(termcap, tgetent, [ TERM_LIB="-ltermcap" ])
719 [ AC_CHECK_HEADERS(curses.h)
720 AC_CHECK_HEADER(term.h,
721 [ AC_CHECK_LIB(curses, tgetent,
722 [ TERM_LIB="-lcurses" ] )
728 if test x$support_conio = xyes; then
729 if test x$TERM_LIB != x; then
735 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
737 echo " "; echo "Required libraries not found. CONIO turned off ..."; echo " "
742 dnl ---------------------------------------------------
743 dnl Check for readline support/directory (default off)
744 dnl ---------------------------------------------------
745 dnl this allows you to turn it completely off
746 AC_ARG_ENABLE(readline,
747 AC_HELP_STRING([--disable-readline], [disable readline support @<:@default=yes@:>@]),
749 if test x$enableval = xno; then
757 if test x$support_readline = xyes; then
758 AC_ARG_WITH(readline,
759 AC_HELP_STRING([--with-readline@<:@=DIR@:>@], [specify readline library directory]),
761 case "$with_readline" in
766 if test -f ${with_readline}/readline.h; then
767 CONS_INC="-I${with_readline}"
768 CONS_LDFLAGS="-L$with_readline"
769 elif test -f ${with_readline}/include/readline/readline.h; then
770 CONS_INC="-I${with_readline}/include/readline"
771 CONS_LDFLAGS="-L${with_readline}/lib"
772 with_readline="${with_readline}/include/readline"
774 with_readline="/usr/include/readline"
777 AC_CHECK_HEADER(${with_readline}/readline.h,
779 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
780 CONS_LIBS="-lreadline -lhistory ${TERM_LIB}"
784 echo "readline.h not found. readline turned off ..."
791 dnl check for standard readline library
792 AC_CHECK_HEADER(/usr/include/readline/readline.h,
794 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
796 CONS_INC="-I/usr/include/readline"
797 CONS_LIBS="-lreadline ${TERM_LIB}"
799 dnl Did not find standard library, so try Bacula's default
800 AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h,
802 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
804 CONS_INC="-I${TOP_DIR}/depkgs/readline"
805 CONS_LIBS="-lreadline -lhistory ${TERM_LIB}"
806 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
807 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
810 echo "readline.h not found. readline turned off ..."
824 AC_SUBST(CONS_LDFLAGS)
825 AC_SUBST(READLINE_SRC)
827 dnl Minimal stuff for readline Makefile configuration
832 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr)
833 AC_CHECK_FUNCS(lstat lchown lchmod futimes fchmod fchown)
834 AC_CHECK_FUNCS(nanosleep nl_langinfo)
835 AC_CHECK_HEADERS(varargs.h)
837 dnl End of readline/conio stuff
838 dnl -----------------------------------------------------------------------
841 dnl Find where sockets are (especially for Solaris)
842 dnl Do this before the TCP Wrappers test since tcp wrappers
843 dnl uses the socket library and some linkers are stupid.
845 AC_CHECK_FUNC(socket,
846 AC_MSG_RESULT(using libc's socket),
847 AC_CHECK_LIB(xnet,socket)
848 AC_CHECK_LIB(socket,socket)
849 AC_CHECK_LIB(inet,socket))
851 dnl -----------------------------------------------------------
852 dnl Check whether user wants TCP wrappers support (default off)
853 dnl -----------------------------------------------------------
856 AC_ARG_WITH(tcp-wrappers,
857 AC_HELP_STRING([--with-tcp-wrappers@<:@=DIR@:>@], [enable tcpwrappers support]),
859 if test "x$withval" != "xno" ; then
861 LIBS="$saved_LIBS -lwrap"
862 AC_SEARCH_LIBS(nanosleep, [rt])
863 AC_MSG_CHECKING(for libwrap)
866 #include <sys/types.h>
868 int deny_severity = 0;
869 int allow_severity = 0;
870 struct request_info *req;
875 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
880 LIBS="$saved_LIBS -lwrap -lnsl"
881 WRAPLIBS="$saved_LIBS -lwrap -lnsl"
884 #include <sys/types.h>
886 int deny_severity = 0;
887 int allow_severity = 0;
888 struct request_info *req;
893 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
898 AC_MSG_ERROR([*** libwrap missing])
908 dnl -----------------------------------------------------------
909 dnl Check whether OpenSSL is available
910 dnl -----------------------------------------------------------
911 AC_MSG_CHECKING([for OpenSSL])
912 dnl The following uses quadrigraphs:
916 AC_HELP_STRING([--with-openssl@<:@=DIR@:>@], [Include OpenSSL support. DIR is the OpenSSL base]),
918 with_openssl_directory=${withval}
922 if test "x$with_openssl_directory" != "xno"; then
923 OPENSSL_LIBS="-lssl -lcrypto"
926 if test "x$with_openssl_directory" != "xyes" && test x"${with_openssl_directory}" != "x"; then
928 # Make sure the $with_openssl_directory also makes sense
930 if test -d "$with_openssl_directory/lib" -a -d "$with_openssl_directory/include"; then
931 OPENSSL_LIBS="-L$with_openssl_directory/lib $OPENSSL_LIBS"
932 OPENSSL_INC="-I$with_openssl_directory/include $OPENSSL_INC"
937 saved_CFLAGS="${CFLAGS}"
938 LIBS="${saved_LIBS} ${OPENSSL_LIBS}"
939 CFLAGS="${saved_CFLAGS} ${OPENSSL_INC}"
943 #include <openssl/ssl.h>
945 CRYPTO_set_id_callback(NULL);
957 #include <openssl/evp.h>
961 ac_cv_openssl_sha2="yes"
963 ac_cv_openssl_sha2="no"
967 dnl Solaris disables greater than 128+ bit encryption in their OpenSSL
968 dnl implementation, presumably for export reasons. If 192bit AES
969 dnl is available, we assume that we're running with a 'non-export'
973 #include <openssl/evp.h>
977 ac_cv_openssl_export="no"
979 ac_cv_openssl_export="yes"
983 AC_MSG_RESULT([$support_tls])
984 if test "$support_tls" = "yes"; then
985 AC_DEFINE(HAVE_OPENSSL, 1, [Define if OpenSSL library is available])
986 AC_DEFINE(HAVE_TLS, 1, [Define if TLS support should be enabled])
987 AC_DEFINE(HAVE_CRYPTO, 1, [Define if encryption support should be enabled])
990 if test "$ac_cv_openssl_sha2" = "yes"; then
991 AC_DEFINE(HAVE_SHA2, 1, [Define if the SHA-2 family of digest algorithms is available])
994 if test "$ac_cv_openssl_export" = "yes"; then
995 AC_DEFINE(HAVE_OPENSSL_EXPORT_LIBRARY, 1, [Define if the OpenSSL library is export-contrained to 128bit ciphers])
998 if test "$support_crypto" = "yes"; then
999 AC_CHECK_LIB(crypto, EVP_PKEY_encrypt_old, AC_DEFINE(HAVE_OPENSSLv1, 1, [Set if have OpenSSL version 1.x]))
1002 LIBS="${saved_LIBS}"
1003 CFLAGS="${saved_CFLAGS}"
1007 AC_MSG_RESULT([$support_tls])
1010 if test "$support_tls" = "no" -o "$support_crypto" = "no"; then
1015 AC_SUBST(OPENSSL_LIBS)
1016 AC_SUBST(OPENSSL_INC)
1018 dnl -----------------------------------------------------------
1019 dnl dlopen is needed for plugins
1020 dnl -----------------------------------------------------------
1021 AC_SEARCH_LIBS(dlopen, [dl])
1023 dnl ------------------------------------------
1024 dnl Where to place working dir
1025 dnl ------------------------------------------
1026 working_dir=`eval echo /opt/bacula/working`
1027 AC_ARG_WITH(working-dir,
1028 AC_HELP_STRING([--with-working-dir=PATH], [specify path of Bacula working directory]),
1030 if test "x$withval" != "xno" ; then
1031 working_dir=$withval
1036 AC_SUBST(working_dir)
1038 dnl ------------------------------------------------------------------
1039 dnl If the user has not set archivedir, we set our default as /tmp
1040 dnl ------------------------------------------------------------------
1042 AC_ARG_WITH(archivedir,
1043 AC_HELP_STRING([--with-archivedir=PATH], [specify path of SD archive directory]),
1045 if test "x$withval" != "xno" ; then
1051 AC_SUBST(archivedir)
1053 dnl ------------------------------------------------------------------
1054 dnl Allow the user to specify the daemon resource name default hostname
1055 dnl ------------------------------------------------------------------
1057 AC_ARG_WITH(basename,
1058 AC_HELP_STRING([--with-basename=RESNAME], [specify base resource name for daemons]),
1060 if test "x$withval" != "xno" ; then
1068 dnl ------------------------------------------------------------------
1069 dnl Allow the user to override the hostname (default = machine hostname)
1070 dnl ------------------------------------------------------------------
1071 hostname=`uname -n | cut -d '.' -f 1`
1072 if test x${hostname} = x ; then
1073 hostname="localhost"
1075 dnl Make sure hostname is resolved
1076 ping -c 1 $hostname 2>/dev/null 1>/dev/null
1077 if test ! $? = 0; then
1078 hostname="localhost"
1080 AC_ARG_WITH(hostname,
1081 AC_HELP_STRING([--with-hostname=RESNAME], [specify host name for daemons]),
1083 if test "x$withval" != "xno" ; then
1092 dnl ------------------------------------------
1093 dnl Where to place scriptdir (script files)
1094 dnl ------------------------------------------
1095 scriptdir=`eval echo ${sysconfdir}`
1096 AC_ARG_WITH(scriptdir,
1097 AC_HELP_STRING([--with-scriptdir=PATH], [specify path of Bacula scripts directory]),
1099 if test "x$withval" != "xno" ; then
1108 dnl ------------------------------------------
1109 dnl Where to place bsrdir (bsr files)
1110 dnl ------------------------------------------
1111 bsrdir=`eval echo /opt/bacula/bsr`
1113 AC_HELP_STRING([--with-bsrdir=PATH], [specify path of Bacula bsrs directory]),
1115 if test "x$withval" != "xno" ; then
1123 dnl ------------------------------------------
1124 dnl Where to place logdir
1125 dnl ------------------------------------------
1126 logdir=`eval echo /opt/bacula/log`
1128 AC_HELP_STRING([--with-logdir=PATH], [specify path of Bacula logs directory]),
1130 if test "x$withval" != "xno" ; then
1139 # ------------------------------------------
1140 # Where to place plugindir (plugin files)
1141 # ------------------------------------------
1142 plugindir=`eval echo ${libdir}`
1143 AC_ARG_WITH(plugindir,
1144 AC_HELP_STRING([--with-plugindir=PATH], [specify path of Bacula plugins directory]),
1146 if test "x$withval" != "xno" ; then
1154 dnl ------------------------------------------
1155 dnl Where to send dump email
1156 dnl ------------------------------------------
1157 dump_email=root@localhost
1158 AC_ARG_WITH(dump-email,
1159 AC_HELP_STRING([--with-dump-email=EMAIL], [dump email address]),
1161 if test "x$withval" != "xno" ; then
1167 AC_SUBST(dump_email)
1169 dnl ------------------------------------------
1170 dnl Where to send job email
1171 dnl ------------------------------------------
1172 job_email=root@localhost
1173 AC_ARG_WITH(job-email,
1174 AC_HELP_STRING([--with-job-email=EMAIL], [job output email address]),
1176 if test "x$withval" != "xno" ; then
1184 dnl ------------------------------------------
1185 dnl Where to find smtp host
1186 dnl ------------------------------------------
1188 AC_ARG_WITH(smtp_host,
1189 AC_HELP_STRING([--with-smtp-host=HOST], [SMTP mail host address]),
1191 if test "x$withval" != "xno" ; then
1199 dnl ------------------------------------
1200 dnl Where to place pid files
1201 dnl ------------------------------------
1203 AC_ARG_WITH(pid-dir,
1204 AC_HELP_STRING([--with-pid-dir=PATH], [specify location of Bacula pid files]),
1206 if test "x$withval" != "xno" ; then
1212 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
1215 dnl ------------------------------------
1216 dnl Where to place subsys "lock file"
1217 dnl ------------------------------------
1218 subsysdir=/var/run/subsys
1219 if test -d /var/run/subsys; then
1220 subsysdir=/var/run/subsys
1221 elif test -d /var/lock/subsys; then
1222 subsysdir=/var/lock/subsys
1224 subsysdir=/var/run/subsys
1226 AC_ARG_WITH(subsys-dir,
1227 AC_HELP_STRING([--with-subsys-dir=PATH], [specify location of Bacula subsys file]),
1229 if test "x$withval" != "xno" ; then
1237 dnl ------------------------------------
1238 dnl Where to start assigning ports
1239 dnl ------------------------------------
1241 AC_ARG_WITH(baseport,
1242 AC_HELP_STRING([--with-baseport=PORT], [specify base port address for daemons]),
1244 if test "x$withval" != "xno" ; then
1251 dir_port=`expr $baseport`
1252 fd_port=`expr $baseport + 1`
1253 sd_port=`expr $fd_port + 1`
1259 dnl ------------------------------------------
1260 dnl Generate passwords
1261 dnl ------------------------------------------
1263 AC_ARG_WITH(dir-password,
1264 AC_HELP_STRING([--with-dir-password=PASSWORD], [specify Director's password]),
1266 if test "x$withval" != "xno" ; then
1267 dir_password=$withval
1272 if test "x$dir_password" = "x" ; then
1273 if test "x$OPENSSL" = "xnone" ; then
1274 key=`autoconf/randpass 33`
1276 key=`openssl rand -base64 33`
1282 AC_ARG_WITH(fd-password,
1283 AC_HELP_STRING([--with-fd-password=PASSWORD], [specify Client's password]),
1285 if test "x$withval" != "xno" ; then
1286 fd_password=$withval
1291 if test "x$fd_password" = "x" ; then
1292 if test "x$OPENSSL" = "xnone" ; then
1293 key=`autoconf/randpass 37`
1295 key=`openssl rand -base64 33`
1301 AC_ARG_WITH(sd-password,
1302 AC_HELP_STRING([--with-sd-password=PASSWORD], [specify Storage daemon's password]),
1304 if test "x$withval" != "xno" ; then
1305 sd_password=$withval
1310 if test "x$sd_password" = "x" ; then
1311 if test "x$OPENSSL" = "xnone" ; then
1312 key=`autoconf/randpass 41`
1314 key=`openssl rand -base64 33`
1320 AC_ARG_WITH(mon-dir-password,
1321 AC_HELP_STRING([--with-mon-dir-password=PASSWORD], [specify Director's password used by the monitor]),
1323 if test "x$withval" != "xno" ; then
1324 mon_dir_password=$withval
1329 if test "x$mon_dir_password" = "x" ; then
1330 if test "x$OPENSSL" = "xnone" ; then
1331 key=`autoconf/randpass 33`
1333 key=`openssl rand -base64 33`
1335 mon_dir_password=$key
1339 AC_ARG_WITH(mon-fd-password,
1340 AC_HELP_STRING([--with-mon-fd-password=PASSWORD], [specify Client's password used by the monitor]),
1342 if test "x$withval" != "xno" ; then
1343 mon_fd_password=$withval
1348 if test "x$mon_fd_password" = "x" ; then
1349 if test "x$OPENSSL" = "xnone" ; then
1350 key=`autoconf/randpass 37`
1352 key=`openssl rand -base64 33`
1354 mon_fd_password=$key
1358 AC_ARG_WITH(mon-sd-password,
1359 AC_HELP_STRING([--with-mon-sd-password=PASSWORD], [specify Storage daemon's password used by the monitor]),
1361 if test "x$withval" != "xno" ; then
1362 mon_sd_password=$withval
1367 if test "x$mon_sd_password" = "x" ; then
1368 if test "x$OPENSSL" = "xnone" ; then
1369 key=`autoconf/randpass 41`
1371 key=`openssl rand -base64 33`
1373 mon_sd_password=$key
1376 AC_SUBST(dir_password)
1377 AC_SUBST(fd_password)
1378 AC_SUBST(sd_password)
1379 AC_SUBST(mon_dir_password)
1380 AC_SUBST(mon_fd_password)
1381 AC_SUBST(mon_sd_password)
1384 dnl Pickup any database name
1387 AC_ARG_WITH(db_name,
1388 AC_HELP_STRING([--with-db-name=DBNAME], [specify database name @<:@default=bacula@:>@]),
1390 if test "x$withval" != "x" ; then
1398 AC_ARG_WITH(db_user,
1399 AC_HELP_STRING([--with-db-user=UNAME], [specify database user @<:@default=bacula@:>@]),
1401 if test "x$withval" != "x" ; then
1409 AC_ARG_WITH(db_password,
1410 AC_HELP_STRING([--with-db-password=PWD], [specify database password @<:@default=*none*@:>@]),
1412 if test "x$withval" != "x" ; then
1413 db_password=$withval
1417 AC_SUBST(db_password)
1420 dnl Pickup a database port
1423 AC_ARG_WITH(db_port,
1424 AC_HELP_STRING([--with-db-port=DBPORT], [specify a database port @<:@default=null@:>@]),
1426 if test "x$withval" != "x" ; then
1434 # Handle users and groups for each daemon
1437 AC_ARG_WITH(dir_user,
1438 AC_HELP_STRING([--with-dir-user=USER], [specify user for Director daemon]),
1440 if test "x$withval" != "x" ; then
1447 AC_ARG_WITH(dir_group,
1448 AC_HELP_STRING([--with-dir-group=GROUP], [specify group for Director daemon]),
1450 if test "x$withval" != "x" ; then
1457 AC_ARG_WITH(sd_user,
1458 AC_HELP_STRING([--with-sd-user=USER], [specify user for Storage daemon]),
1460 if test "x$withval" != "x" ; then
1467 AC_ARG_WITH(sd_group,
1468 AC_HELP_STRING([--with-sd-group=GROUP], [specify group for Storage daemon]),
1470 if test "x$withval" != "x" ; then
1477 AC_ARG_WITH(fd_user,
1478 AC_HELP_STRING([--with-fd-user=USER], [specify user for File daemon]),
1480 if test "x$withval" != "x" ; then
1487 AC_ARG_WITH(fd_group,
1488 AC_HELP_STRING([--with-fd-group=GROUP], [specify group for File daemon]),
1490 if test "x$withval" != "x" ; then
1504 dnl allow setting default executable permissions
1507 AC_ARG_WITH(sbin-perm,
1508 AC_HELP_STRING([--with-sbin-perm=MODE], [specify permissions for sbin binaries @<:@default=0750@:>@]),
1510 if test "x$withval" != "x" ; then
1518 dnl -------------------------------------------
1519 dnl enable batch attribute DB insert (default on)
1520 dnl -------------------------------------------
1521 support_batch_insert=yes
1522 AC_ARG_ENABLE(batch-insert,
1523 AC_HELP_STRING([--enable-batch-insert], [enable the DB batch insert code @<:@default=yes@:>@]),
1525 if test x$enableval = xno; then
1526 support_batch_insert=no
1531 if test x$support_batch_insert = xyes; then
1532 AC_DEFINE(USE_BATCH_FILE_INSERT, 1, [Set if DB batch insert code enabled])
1535 dnl ------------------------------------------------
1536 dnl Bacula check for various SQL database engines
1537 dnl ------------------------------------------------
1540 dnl Set uncomment_dbi by default to '#' if DBI is enabled this will get reset
1544 BA_CHECK_POSTGRESQL_DB
1550 dnl -------------------------------------------
1551 dnl If no batch insert backend are enable set
1552 dnl variable to None
1553 dnl -------------------------------------------
1554 if test -z "${batch_insert_db_backends}"; then
1555 batch_insert_db_backends="None"
1558 dnl -------------------------------------------
1559 dnl Make sure at least one database backend is found
1560 dnl -------------------------------------------
1561 if test "x${db_backends}" = "x" ; then
1564 echo "You have not specified either --enable-client-only or one of the"
1565 echo "supported databases: MySQL, PostgreSQL, or SQLite3."
1566 echo "This is not permitted. Please reconfigure."
1568 echo "Aborting the configuration ..."
1574 dnl -------------------------------------------
1575 dnl See how many catalog backends are configured.
1576 dnl -------------------------------------------
1577 case `echo $DB_BACKENDS | wc -w | sed -e 's/^ *//'` in
1579 DEFAULT_DB_TYPE="${DB_BACKENDS}"
1580 if test x$use_libtool = xno; then
1581 SHARED_CATALOG_TARGETS=""
1583 SHARED_CATALOG_TARGETS="libbaccats-${DEFAULT_DB_TYPE}.la"
1587 dnl ------------------------------------------------
1588 dnl Set the default backend to the first backend found
1589 dnl ------------------------------------------------
1590 DEFAULT_DB_TYPE=`echo ${DB_BACKENDS} | cut -d' ' -f1`
1592 dnl ------------------------------------------------
1593 dnl For multiple backend we need libtool support.
1594 dnl ------------------------------------------------
1595 if test x$use_libtool = xno; then
1598 echo "You have specified two or more of the"
1599 echo "supported databases: MySQL, PostgreSQL, or SQLite3."
1600 echo "This is not permitted when not using libtool Please reconfigure."
1602 echo "Aborting the configuration ..."
1608 SHARED_CATALOG_TARGETS=""
1609 for db_type in ${DB_BACKENDS}
1611 if test -z "${SHARED_CATALOG_TARGETS}"; then
1612 SHARED_CATALOG_TARGETS="libbaccats-${db_type}.la"
1614 SHARED_CATALOG_TARGETS="${SHARED_CATALOG_TARGETS} libbaccats-${db_type}.la"
1620 dnl -------------------------------------------
1621 dnl Unset DB_LIBS when using libtool as we link the
1622 dnl shared library using the right database lib no need to
1623 dnl set DB_LIBS which is only used for non shared versions
1624 dnl of the backends.
1625 dnl -------------------------------------------
1626 if test x$use_libtool = xyes; then
1630 AC_SUBST(uncomment_dbi)
1631 AC_SUBST(DB_BACKENDS)
1633 AC_SUBST(DEFAULT_DB_TYPE)
1634 AC_SUBST(SHARED_CATALOG_TARGETS)
1636 AC_DEFINE(PROTOTYPES)
1638 dnl --------------------------------------------------------------------------
1639 dnl Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
1641 if test -z "$CFLAGS" -o "$CFLAGS" = "-g -O2"; then
1642 if test -z "$CCOPTS"; then
1643 CCOPTS='-g -O2 -Wall'
1651 dnl See if we can use 64 bit file addresses
1652 largefile_support="no"
1657 dnl --------------------------------------------------------------------------
1658 dnl CHECKING FOR HEADER FILES
1659 dnl --------------------------------------------------------------------------
1698 AC_STRUCT_ST_BLKSIZE
1702 dnl --------------------------------------------------------------------------
1703 dnl Check for utime.h structure
1704 dnl --------------------------------------------------------------------------
1705 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
1709 #include <sys/types.h>
1714 ba_cv_header_utime_h=yes
1716 ba_cv_header_utime_h=no
1721 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H, 1, [Set if utime.h exists])
1723 dnl --------------------------------------------------------------------------
1724 dnl Check for socklen_t
1725 dnl --------------------------------------------------------------------------
1726 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
1730 #include <sys/types.h>
1731 #include <sys/socket.h>
1735 ba_cv_header_socklen_t=yes
1737 ba_cv_header_socklen_t=no
1742 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T, 1, [Set if socklen_t exists])
1744 dnl --------------------------------------------------------------------------
1745 dnl Check for ioctl request type
1746 dnl --------------------------------------------------------------------------
1748 AC_CACHE_CHECK(for ioctl_req_t, ba_cv_header_ioctl_req_t,
1753 #include <sys/types.h>
1754 #include <sys/ioctl.h>
1756 int (*d_ioctl)(int fd, unsigned long int request, ...);
1759 ba_cv_header_ioctl_req_t=yes
1761 ba_cv_header_ioctl_req_t=no
1766 test $ba_cv_header_ioctl_req_t = yes && AC_DEFINE(HAVE_IOCTL_ULINT_REQUEST, 1, [Set if ioctl request is unsigned long int])
1768 dnl Note: it is more correct to use AC_LANG(C++) but some of the older
1769 dnl *BSD systems still use old style C prototypes, which are wrong with
1770 dnl compiled with a C++ compiler.
1773 dnl --------------------------------------------------------------------------
1774 dnl Check for typeof()
1775 dnl --------------------------------------------------------------------------
1777 AC_CACHE_CHECK(for typeof, ba_cv_have_typeof,
1781 main(){char *a = 0; a = (typeof a)a;}
1783 ba_cv_have_typeof=yes
1785 ba_cv_have_typeof=no
1787 ba_cv_have_typeof=no
1792 test $ba_cv_have_typeof = yes && AC_DEFINE([HAVE_TYPEOF], 1, [Defind to 1 if compiler has typeof])
1797 AC_C_BIGENDIAN([AC_DEFINE([HAVE_BIG_ENDIAN], [1], [Big Endian])], [AC_DEFINE([HAVE_LITTLE_ENDIAN], [1], [Little Endian])])
1799 dnl --------------------------------------------------------------------------
1800 dnl CHECKING FOR FILESYSTEM TYPE
1801 dnl --------------------------------------------------------------------------
1802 AC_MSG_CHECKING(how to get filesystem type)
1804 # The order of these tests is important.
1807 #include <sys/statvfs.h>
1808 #include <sys/fstyp.h>
1810 AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4
1812 if test $fstype = no; then
1815 #include <sys/statfs.h>
1816 #include <sys/fstyp.h>
1818 AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3
1821 if test $fstype = no; then
1824 #include <sys/statfs.h>
1825 #include <sys/vmount.h>
1827 AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX
1830 if test $fstype = no; then
1835 AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD
1838 if test $fstype = no; then
1839 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
1841 if test $fstype = no; then
1844 #include <sys/mount.h>
1845 #include <sys/fs_types.h>
1847 AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix
1850 AC_MSG_RESULT($fstype)
1852 AC_CHECK_HEADER(sys/statvfs.h, [ AC_DEFINE(HAVE_SYS_STATVFS_H,1,[Defines if your system have the sys/statvfs.h header file])] , )
1855 AC_CHECK_FUNCS(backtrace)
1858 dnl --------------------------------------------------------------------------
1859 dnl CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
1860 dnl --------------------------------------------------------------------------
1870 AC_CHECK_TYPE(ino_t, unsigned long)
1871 AC_CHECK_TYPE(dev_t, unsigned long)
1872 AC_CHECK_TYPE(daddr_t, long)
1873 AC_CHECK_TYPE(major_t, int)
1874 AC_CHECK_TYPE(minor_t, int)
1875 AC_CHECK_TYPE(ssize_t, int)
1881 AC_CHECK_SIZEOF(char, 1)
1882 AC_CHECK_SIZEOF(short int, 2)
1883 AC_CHECK_SIZEOF(int, 4)
1884 AC_CHECK_SIZEOF(long int, 4)
1885 AC_CHECK_SIZEOF(long long int, 8)
1886 AC_CHECK_SIZEOF(int *, 4)
1888 dnl Check for sys/types.h types
1889 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int,
1893 #include <sys/types.h>
1897 ac_cv_have_u_int="yes"
1899 ac_cv_have_u_int="no"
1904 if test "x$ac_cv_have_u_int" = "xyes" ; then
1905 AC_DEFINE(HAVE_U_INT)
1909 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t,
1913 #include <sys/types.h>
1917 ac_cv_have_intmax_t="yes"
1925 ac_cv_have_intmax_t="yes"
1927 ac_cv_have_intmax_t="no"
1934 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
1935 AC_DEFINE(HAVE_INTMAX_T)
1939 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t,
1943 #include <sys/types.h>
1945 u_intmax_t a; a = 1;
1947 ac_cv_have_u_intmax_t="yes"
1953 u_intmax_t a; a = 1;
1955 ac_cv_have_u_intmax_t="yes"
1957 ac_cv_have_u_intmax_t="no"
1964 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
1965 AC_DEFINE(HAVE_U_INTMAX_T)
1969 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t,
1973 #include <sys/types.h>
1975 int8_t a; int16_t b; int32_t c; a = b = c = 1;
1977 ac_cv_have_intxx_t="yes"
1979 ac_cv_have_intxx_t="no"
1984 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1985 AC_DEFINE(HAVE_INTXX_T)
1989 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t,
1993 #include <sys/types.h>
1997 ac_cv_have_int64_t="yes"
1999 ac_cv_have_int64_t="no"
2004 if test "x$ac_cv_have_int64_t" = "xyes" ; then
2005 AC_DEFINE(HAVE_INT64_T)
2009 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t,
2013 #include <sys/types.h>
2015 u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;
2017 ac_cv_have_u_intxx_t="yes"
2019 ac_cv_have_u_intxx_t="no"
2024 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
2025 AC_DEFINE(HAVE_U_INTXX_T)
2029 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t,
2033 #include <sys/types.h>
2037 ac_cv_have_u_int64_t="yes"
2039 ac_cv_have_u_int64_t="no"
2044 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
2045 AC_DEFINE(HAVE_U_INT64_T)
2049 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
2050 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2052 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
2055 #include <sys/bitypes.h>
2057 int8_t a; int16_t b; int32_t c;
2058 u_int8_t e; u_int16_t f; u_int32_t g;
2059 a = b = c = e = f = g = 1;
2061 AC_DEFINE(HAVE_U_INTXX_T)
2062 AC_DEFINE(HAVE_INTXX_T)
2063 AC_DEFINE(HAVE_SYS_BITYPES_H)
2071 if test -z "$have_u_intxx_t" ; then
2072 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t,
2076 #include <sys/types.h>
2078 uint8_t a; uint16_t b;
2079 uint32_t c; a = b = c = 1;
2081 ac_cv_have_uintxx_t="yes"
2083 ac_cv_have_uintxx_t="no"
2088 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
2089 AC_DEFINE(HAVE_UINTXX_T)
2093 if (test -z "$have_u_int64_t" || test -z "$have_int64_t" && \
2094 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2096 AC_MSG_CHECKING([for int64_t and u_int64_t types in sys/bitypes.h])
2099 #include <sys/bitypes.h>
2101 int64_t a; u_int64_t b;
2104 AC_DEFINE(HAVE_U_INT64_T)
2105 AC_DEFINE(HAVE_INT64_T)
2113 if (test -z "$have_uintxx_t" && \
2114 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2116 AC_MSG_CHECKING([for uintXX_t types in sys/bitypes.h])
2119 #include <sys/bitypes.h>
2121 uint8_t a; uint16_t b;
2122 uint32_t c; a = b = c = 1;
2124 AC_DEFINE(HAVE_UINTXX_T)
2132 dnl --------------------------------------------------------------------------
2133 dnl CHECKING FOR REQUIRED LIBRARY FUNCTIONS
2134 dnl --------------------------------------------------------------------------
2150 [echo 'configure: cannot find needed function.'; exit 1]
2155 AC_DEFINE(HAVE_FCNTL_F_CLOSEM, 1, [Set if you have 'F_CLOSEM' fcntl flag]),
2157 [#include <fcntl.h>]
2160 AC_CHECK_FUNC(closefrom, [AC_DEFINE(HAVE_CLOSEFROM, 1, [Define to 1 if you have the 'closefrom' function.])])
2161 AC_CHECK_FUNCS(getpagesize, [AC_DEFINE(HAVE_GETPAGESIZE, 1, [Set if have getpagesize])])
2162 AC_CHECK_FUNCS(malloc_trim, [AC_DEFINE(HAVE_MALLOC_TRIM, 1, [Set if have malloc_trim])])
2164 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
2165 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
2166 AC_CHECK_FUNCS(posix_fadvise)
2167 AC_CHECK_FUNCS(fdatasync)
2169 AC_CHECK_FUNCS(chflags)
2171 AC_CHECK_FUNCS(snprintf vsnprintf gethostid fseeko)
2173 AC_CACHE_CHECK(for va_copy, ba_cv_va_copy,
2178 void use_va_copy(va_list args){va_list args2; va_copy(args2,args); va_end(args2);}
2179 void call_use_va_copy(int junk,...){va_list args; va_start(args,junk); use_va_copy(args); va_end(args);}
2181 call_use_va_copy(1,2,3)
2190 test $ba_cv_va_copy = yes && AC_DEFINE(HAVE_VA_COPY, 1, [Set if va_copy exists])
2192 dnl --------------------------------------------------------------------------
2193 dnl CHECKING FOR THREAD SAFE FUNCTIONS
2194 dnl --------------------------------------------------------------------------
2195 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
2197 # If resolver functions are not in libc check for -lnsl or -lresolv.
2198 AC_CHECK_FUNC(gethostbyname_r,
2199 AC_MSG_RESULT(using libc's resolver),
2200 AC_CHECK_LIB(nsl,gethostbyname_r)
2201 AC_CHECK_LIB(resolv,gethostbyname_r))
2203 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
2204 AC_CHECK_FUNCS(inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)])
2205 AC_CHECK_FUNCS(gethostbyname2, [AC_DEFINE(HAVE_GETHOSTBYNAME2)])
2206 AC_CHECK_FUNCS(getnameinfo, [AC_DEFINE(HAVE_GETNAMEINFO)])
2209 dnl ----------------------------
2210 dnl check sa_len of sockaddr
2211 dnl ----------------------------
2212 AC_CACHE_CHECK(for struct sockaddr has a sa_len field, ac_cv_struct_sockaddr_sa_len,
2216 #include <sys/socket.h>
2218 struct sockaddr s; s.sa_len;
2220 ac_cv_struct_sockaddr_sa_len=yes
2221 ], [ac_cv_struct_sockaddr_sa_len=no
2227 if test $ac_cv_struct_sockaddr_sa_len = yes; then
2228 AC_DEFINE(HAVE_SA_LEN, 1, [Define if sa_len field exists in struct sockaddr])
2232 dnl check for working getaddrinfo()
2234 dnl Note that if the system doesn't have gai_strerror(), we
2235 dnl can't use getaddrinfo() because we can't get strings
2236 dnl describing the error codes.
2238 AC_CACHE_CHECK(for working getaddrinfo, ac_cv_working_getaddrinfo,
2244 #include <sys/types.h>
2245 #include <sys/socket.h>
2248 struct addrinfo hints, *ai;
2251 memset(&hints, 0, sizeof(hints));
2252 hints.ai_family = AF_UNSPEC;
2253 hints.ai_socktype = SOCK_STREAM;
2254 error = getaddrinfo("127.0.0.1", NULL, &hints, &ai);
2258 if (ai->ai_addr->sa_family != AF_INET) {
2264 ac_cv_working_getaddrinfo="yes"
2266 ac_cv_working_getaddrinfo="no"
2268 ac_cv_working_getaddrinfo="yes"
2273 AC_CHECK_FUNC(gai_strerror, [AC_DEFINE(HAVE_GAI_STRERROR, 1, [Define to 1 if you have the 'gai_strerror' function.])])
2275 if test "$ac_cv_working_getaddrinfo" = "yes"; then
2276 if test "$ac_cv_func_gai_strerror" != "yes"; then
2277 ac_cv_working_getaddrinfo="no"
2279 AC_DEFINE(HAVE_GETADDRINFO, 1, [Define to 1 if getaddrinfo exists and works])
2287 AC_CHECK_FUNCS(getmntinfo, [AC_DEFINE(HAVE_GETMNTINFO)])
2288 AC_FUNC_CLOSEDIR_VOID
2289 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
2290 # AC_FUNC_FNMATCH dnl use local version
2292 AC_CHECK_LIB(intl, gettext, [LIBS="$LIBS -lintl"])
2294 AC_CHECK_LIB(sun, getpwnam)
2296 AC_CHECK_HEADERS(zlib.h)
2297 AC_CHECK_LIB(z, deflate, [ZLIBS="-lz"])
2299 if test x$ZLIBS = x-lz; then
2300 AC_DEFINE(HAVE_LIBZ)
2306 dnl Check if we have AFS on this system
2312 AC_HELP_STRING([--disable-afs], [disable afs support @<:@default=auto@:>@]),
2314 if test x$enableval = xyes; then
2316 elif test x$enableval = xno; then
2323 if test x$support_afs = xyes -o x$support_afs = xauto; then
2325 AC_HELP_STRING([--with-afsdir@<:@=DIR@:>@], [Directory holding AFS includes/libs]),
2326 with_afsdir=$withval
2330 dnl Search in standard places, or --with-afsdir not specified
2332 if test x$with_afsdir = x; then
2333 for root in /usr /usr/local; do
2334 if test -d ${root}/include/afs/ ; then
2338 if test -d ${root}/include/openafs/afs/ ; then
2345 if test -d ${with_afsdir}/include/afs/ ; then
2346 AFS_CFLAGS="-I${with_afsdir}/include"
2348 if test -d ${with_afsdir}/include/openafs/afs/ ; then
2349 AFS_CFLAGS="-I${with_afsdir}/include/openafs"
2353 saved_CFLAGS="${CFLAGS}"
2354 saved_CPPFLAGS="${CPPFLAGS}"
2355 CFLAGS="${AFS_CFLAGS} ${saved_CFLAGS}"
2356 CPPFLAGS="${AFS_CFLAGS} ${saved_CPPFLAGS}"
2358 AC_CHECK_HEADERS(afs/afsint.h)
2361 #include <afs/afsint.h>
2362 #include <afs/venus.h>
2364 AC_DEFINE(HAVE_AFS_VENUS_H,1,[Define to 1 if you have the <afs/venus.h> header file.])
2367 CFLAGS="${saved_CFLAGS}"
2368 CPPFLAGS="${saved_CPPFLAGS}"
2371 dnl See if we can find a libsys with the pioctl symbol in there
2373 AC_MSG_CHECKING(for pioctl in AFS libsys)
2374 for dir in ${with_afsdir}/lib \
2375 ${with_afsdir}/lib/afs \
2376 ${with_afsdir}/lib/openafs \
2377 ${with_afsdir}/lib64 \
2378 ${with_afsdir}/lib64/afs \
2379 ${with_afsdir}/lib64/openafs
2381 for arch_type in .a .so
2383 A=`test -f ${dir}/libsys${arch_type} && nm ${dir}/libsys${arch_type} 2>/dev/null | grep pioctl`
2385 if test $pkg = 0; then
2387 AFS_LIBS="-L${dir} -lsys -lrx -llwp ${dir}/util${arch_type}"
2393 if test $have_afs = yes; then
2399 if test x$support_afs = xyes -a $have_afs != yes; then
2400 AC_MSG_ERROR([afs support explicitly enabled but no supported afs implementation found,
2401 please either load the afs libraries or rerun configure without --enable-afs])
2403 if test $have_afs = yes; then
2404 AC_DEFINE(HAVE_AFS,1,[Define to 1 if your system has AFS support])
2405 AC_DEFINE(HAVE_AFS_ACL,1,[Andrew FileSystem ACL support])
2409 AC_SUBST(AFS_CFLAGS)
2412 dnl ---------------------------------------------------
2413 dnl Check for lzo support/directory (default on)
2414 dnl ---------------------------------------------------
2415 dnl this allows you to turn it completely off
2418 AC_HELP_STRING([--disable-lzo], [disable lzo support @<:@default=yes@:>@]),
2420 if test x$enableval = xno; then
2431 if test x$support_lzo = xyes; then
2433 AC_HELP_STRING([--with-lzo@<:@=DIR@:>@], [specify lzo library directory]),
2440 if test -f ${with_lzo}/include/lzo/lzoconf.h; then
2441 LZO_INC="-I${with_lzo}/include"
2442 LZO_LDFLAGS="-L${with_lzo}/lib"
2443 with_lzo="${with_lzo}/include"
2445 with_lzo="/usr/include"
2448 AC_CHECK_HEADER(${with_lzo}/lzo/lzoconf.h,
2450 AC_DEFINE(HAVE_LZO, 1, [Define to 1 if you have LZO compression])
2451 LZO_LIBS="${LZO_LDFLAGS} -lzo2"
2455 echo "lzoconf.h not found. lzo turned off ..."
2462 AC_CHECK_HEADER(lzo/lzoconf.h,
2464 AC_CHECK_HEADER(lzo/lzo1x.h,
2466 AC_CHECK_LIB(lzo2, lzo1x_1_compress,
2469 AC_DEFINE(HAVE_LZO,1,[Define to 1 if you have LZO compression])
2482 dnl Check for ACL support and libraries
2486 AC_HELP_STRING([--disable-acl], [disable acl support @<:@default=auto@:>@]),
2488 if test x$enableval = xyes; then
2490 elif test x$enableval = xno; then
2497 have_extended_acl=no
2498 if test x$support_acl = xyes -o x$support_acl = xauto; then
2499 AC_CHECK_HEADER(sys/acl.h, [ AC_DEFINE(HAVE_SYS_ACL_H,1,[Defines if your system have the sys/acl.h header file])] , )
2502 dnl First check for acl_get_file in libc
2504 AC_CHECK_FUNC(acl_get_file,
2511 dnl Check for acl_get_file in libacl (Linux)
2513 if test $have_acl = no; then
2514 AC_CHECK_LIB(acl, acl_get_file,
2517 if test $have_afs = yes; then
2519 dnl Because of possible naming conflict with AFS libacl make sure we use the one in /usr/lib64 or /usr/lib !!!
2521 if test -d /usr/lib64/; then
2522 FDLIBS="-L/usr/lib64 -lacl $FDLIBS"
2524 FDLIBS="-L/usr/lib -lacl $FDLIBS"
2527 FDLIBS="-lacl $FDLIBS"
2534 dnl Check for acl_get_file in libpacl (OSF1)
2535 dnl and if ACL_TYPE_DEFAULT_DIR is defined.
2537 if test $have_acl = no -a \
2538 x${HAVE_OSF1_OS_TRUE} = x; then
2539 AC_CHECK_LIB(pacl, acl_get_file,
2542 FDLIBS="-lpacl $FDLIBS"
2546 AC_MSG_CHECKING(for ACL_TYPE_DEFAULT_DIR in acl.h include file)
2547 grep ACL_TYPE_DEFAULT_DIR /usr/include/sys/acl.h > /dev/null 2>&1
2548 if test $? = 0; then
2549 AC_DEFINE(HAVE_ACL_TYPE_DEFAULT_DIR,1,[Defines if your system have the ACL_TYPE_DEFAULT_DIR acl type])
2557 dnl On OSX check for availability of ACL_TYPE_EXTENDED
2559 if test $have_acl = yes -a \
2560 x${HAVE_DARWIN_OS_TRUE} = x; then
2561 AC_MSG_CHECKING(for ACL_TYPE_EXTENDED in acl.h include file)
2562 grep ACL_TYPE_EXTENDED /usr/include/sys/acl.h > /dev/null 2>&1
2563 if test $? = 0; then
2564 AC_DEFINE(HAVE_ACL_TYPE_EXTENDED,1,[Defines if your system have the ACL_TYPE_EXTENDED acl type])
2572 dnl On FreeBSD check for availability of ACL_TYPE_NFS4
2574 if test $have_acl = yes -a \
2575 x${HAVE_FREEBSD_OS_TRUE} = x; then
2576 AC_MSG_CHECKING(for ACL_TYPE_NFS4 in acl.h include file)
2577 grep ACL_TYPE_NFS4 /usr/include/sys/acl.h > /dev/null 2>&1
2578 if test $? = 0; then
2579 AC_DEFINE(HAVE_ACL_TYPE_NFS4,1,[Defines if your system have the ACL_TYPE_NFS4 acl type])
2587 dnl Check for acltotext and acl_totext (Solaris)
2589 if test $have_acl = no -a \
2590 x${HAVE_SUN_OS_TRUE} = x; then
2591 AC_CHECK_LIB(sec, acltotext,
2594 FDLIBS="-lsec $FDLIBS"
2596 AC_CHECK_LIB(sec, acl_totext,
2598 have_extended_acl=yes
2606 dnl Check for acl_get and aclx_get (AIX)
2608 if test $have_acl = no -a \
2609 x${HAVE_AIX_OS_TRUE} = x; then
2610 AC_CHECK_FUNC(acl_get,
2614 AC_CHECK_FUNC(aclx_get,
2616 have_extended_acl=yes
2623 if test x$support_acl = xyes -a $have_acl != yes; then
2624 AC_MSG_ERROR([acl support explicitly enabled but no supported acl implementation found,
2625 please either load the acl libraries or rerun configure without --enable-acl])
2627 if test $have_acl = yes; then
2628 AC_DEFINE([HAVE_ACL],1,[Normal acl support])
2631 if test $have_extended_acl = yes; then
2632 AC_DEFINE([HAVE_EXTENDED_ACL],1,[Extended acl support])
2638 dnl Check for XATTR support
2641 AC_ARG_ENABLE(xattr,
2642 AC_HELP_STRING([--disable-xattr], [disable xattr support @<:@default=auto@:>@]),
2644 if test x$enableval = xyes; then
2646 elif test x$enableval = xno; then
2653 if test x$support_xattr = xyes -o x$support_xattr = xauto; then
2655 dnl First check for *BSD support
2656 dnl When running on a BSD variant
2658 if test x${HAVE_FREEBSD_OS_TRUE} = x -o \
2659 x${HAVE_NETBSD_OS_TRUE} = x -o \
2660 x${HAVE_OPENBSD_OS_TRUE} = x; then
2661 AC_CHECK_HEADER(sys/extattr.h, [ AC_DEFINE(HAVE_SYS_EXTATTR_H,1,[Defines if your system have the sys/extattr.h header file])] , )
2662 AC_CHECK_HEADER(libutil.h, [ AC_DEFINE(HAVE_LIBUTIL_H,1,[Defines if your system have the libutil.h header file])] , )
2663 AC_CHECK_FUNCS(extattr_get_link extattr_set_link extattr_list_link,
2666 AC_DEFINE([HAVE_EXTATTR_GET_LINK],1,[Define to 1 if you have the 'extattr_get_link' function.])
2667 AC_DEFINE([HAVE_EXTATTR_SET_LINK],1,[Define to 1 if you have the 'extattr_set_link' function.])
2668 AC_DEFINE([HAVE_EXTATTR_LIST_LINK],1,[Define to 1 if you have the 'extattr_list_link' function.])
2672 if test $have_xattr = no; then
2673 AC_CHECK_FUNCS(extattr_get_file extattr_set_file extattr_list_file,
2676 AC_DEFINE([HAVE_EXTATTR_GET_FILE],1,[Define to 1 if you have the 'extattr_get_file' function.])
2677 AC_DEFINE([HAVE_EXTATTR_SET_FILE],1,[Define to 1 if you have the 'extattr_set_file' function.])
2678 AC_DEFINE([HAVE_EXTATTR_LIST_FILE],1,[Define to 1 if you have the 'extattr_list_file' function.])
2683 if test $have_xattr = yes; then
2684 have_extattr_string_in_libc=no
2685 AC_CHECK_FUNCS(extattr_namespace_to_string extattr_string_to_namespace,
2687 have_extattr_string_in_libc=yes
2688 AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2689 AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2694 dnl If extattr_namespace_to_string and extattr_string_to_namespace are not in libc see if they are in libutil
2696 if test $have_extattr_string_in_libc = no; then
2697 AC_CHECK_LIB(util, extattr_namespace_to_string extattr_string_to_namespace,
2699 AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2700 AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2701 FDLIBS="-lutil $FDLIBS"
2709 dnl If we failed to find *BSD support try the AIX implementation of extented attributes (EA)
2710 dnl When running on AIX
2712 if test $have_xattr = no -a \
2713 x${HAVE_AIX_OS_TRUE} = x; then
2714 AC_CHECK_HEADER(sys/ea.h, [ AC_DEFINE(HAVE_SYS_EA_H,1,[Defines if your system have the sys/ea.h header file])] , )
2715 AC_CHECK_FUNCS(llistea lgetea lsetea,
2718 AC_DEFINE([HAVE_LLISTEA],1,[Define to 1 if you have the 'llistea' function.])
2719 AC_DEFINE([HAVE_LGETEA],1,[Define to 1 if you have the 'lgetea' function.])
2720 AC_DEFINE([HAVE_LSETEA],1,[Define to 1 if you have the 'lsetea' function.])
2724 if test $have_xattr = no; then
2725 AC_CHECK_FUNCS(listea getea setea,
2728 AC_DEFINE([HAVE_LISTEA],1,[Define to 1 if you have the 'listea' function.])
2729 AC_DEFINE([HAVE_GETEA],1,[Define to 1 if you have the 'getea' function.])
2730 AC_DEFINE([HAVE_SETEA],1,[Define to 1 if you have the 'setea' function.])
2737 dnl If we failed to find AIX support try the TRU64 implementation of extented attributes
2738 dnl when running on a TRU64 OS.
2740 if test $have_xattr = no -a \
2741 x${HAVE_OSF1_OS_TRUE} = x; then
2742 AC_CHECK_HEADER(sys/proplist.h, [ AC_DEFINE(HAVE_SYS_PROPLIST_H,1,[Defines if your system have the sys/proplist.h header file])] , )
2743 AC_CHECK_FUNCS(getproplist get_proplist_entry sizeof_proplist_entry add_proplist_entry setproplist,
2746 AC_DEFINE([HAVE_GETPROPLIST],1,[Define to 1 if you have the 'getproplist' function.])
2747 AC_DEFINE([HAVE_GET_PROPLIST_ENTRY],1,[Define to 1 if you have the 'get_proplist_entry' function.])
2748 AC_DEFINE([HAVE_SIZEOF_PROPLIST_ENTRY],1,[Define to 1 if you have the 'sizeof_proplist_entry' function.])
2749 AC_DEFINE([HAVE_ADD_PROPLIST_ENTRY],1,[Define to 1 if you have the 'add_proplist_entry' function.])
2750 AC_DEFINE([HAVE_SETPROPLIST],1,[Define to 1 if you have the 'setproplist' function.])
2756 dnl If we failed to find TRU64 support try the SOLARIS implementation of extented and extensible attributes
2757 dnl when running on a Solaris.
2759 if test $have_xattr = no -a \
2760 x${HAVE_SUN_OS_TRUE} = x; then
2761 AC_CHECK_HEADER(sys/attr.h, [ AC_DEFINE(HAVE_SYS_ATTR_H,1,[Defines if your system have the sys/attr.h header file])] , )
2762 AC_CHECK_HEADER(sys/nvpair.h, [ AC_DEFINE(HAVE_SYS_NVPAIR_H,1,[Defines if your system have the sys/nvpair.h header file])] , )
2763 AC_CHECK_HEADER(attr.h, [ AC_DEFINE(HAVE_ATTR_H,1,[Defines if your system have the attr.h header file])] , )
2765 AC_CHECK_FUNCS(openat fstatat unlinkat fchownat futimesat,
2768 AC_DEFINE([HAVE_OPENAT],1,[Define to 1 if you have the 'openat' function.])
2769 AC_DEFINE([HAVE_FSTATAT],1,[Define to 1 if you have the 'fstatat' function.])
2770 AC_DEFINE([HAVE_UNLINKAT],1,[Define to 1 if you have the 'unlinkat' function.])
2771 AC_DEFINE([HAVE_FCHOWNAT],1,[Define to 1 if you have the 'fchownat' function.])
2772 AC_DEFINE([HAVE_FUTIMESAT],1,[Define to 1 if you have the 'futimesat' function.])
2776 if test $have_xattr = yes; then
2777 AC_CHECK_LIB(nvpair, nvlist_next_nvpair,
2779 AC_DEFINE([HAVE_NVLIST_NEXT_NVPAIR],1,[Define to 1 if you have the 'nvlist_next_nvpair' function.])
2780 FDLIBS="-lnvpair $FDLIBS"
2787 dnl If we failed to find Solaris support try the generic xattr support code
2789 if test $have_xattr = no; then
2790 AC_CHECK_HEADER(sys/xattr.h, [ AC_DEFINE(HAVE_SYS_XATTR_H,1,[Defines if your system have the sys/xattr.h header file])] , )
2791 AC_CHECK_FUNCS(llistxattr lgetxattr lsetxattr,
2794 AC_DEFINE([HAVE_LLISTXATTR],1,[Define to 1 if you have the 'llistxattr' function.])
2795 AC_DEFINE([HAVE_LGETXATTR],1,[Define to 1 if you have the 'lgetxattr' function.])
2796 AC_DEFINE([HAVE_LSETXATTR],1,[Define to 1 if you have the 'lsetxattr' function.])
2800 if test $have_xattr = no; then
2801 AC_CHECK_FUNCS(listxattr getxattr setxattr,
2804 AC_DEFINE([HAVE_LISTXATTR],1,[Define to 1 if you have the 'listxattr' function.])
2805 AC_DEFINE([HAVE_GETXATTR],1,[Define to 1 if you have the 'getxattr' function.])
2806 AC_DEFINE([HAVE_SETXATTR],1,[Define to 1 if you have the 'setxattr' function.])
2812 if test x$support_xattr = xyes -a $have_xattr != yes; then
2813 AC_MSG_ERROR([xattr support explicitly enabled but no supported xattr implementation found,
2814 please either load the xattr libraries or rerun configure without --enable-xattr])
2816 if test $have_xattr = yes; then
2817 AC_DEFINE([HAVE_XATTR],1,[Extended Attributes support])
2823 dnl Check for pthread libraries
2826 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
2828 AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
2830 AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
2832 AC_CHECK_FUNC(pthread_create)
2841 dnl Check for headers, functions and libraries required to support
2842 dnl keeping readall capabilities
2844 AC_CHECK_HEADERS(sys/prctl.h sys/capability.h)
2845 AC_CHECK_FUNCS(prctl setreuid)
2846 AC_CHECK_LIB([cap], [cap_set_proc], [CAP_LIBS="-lcap"], [CAP_LIBS=])
2847 if test x$CAP_LIBS = x-lcap; then
2848 AC_DEFINE(HAVE_LIBCAP, 1, [Define if you have libcap])
2857 if test x$have_gcc = xyes ; then
2858 CPPFLAGS="$CPPFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
2859 CFLAGS="$CFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
2861 LDFLAGS=${LDFLAGS--O}
2862 CPPFLAGS="$CPPFLAGS"
2874 AC_SUBST(X_EXTRA_LIBS)
2879 dnl extra configurable objects
2890 dnl Finally we set appropriate distribution specific
2891 dnl variables and defaults
2893 dnl PFILES are platform specific files
2894 PFILES="platforms/Makefile"
2897 COMPRESS_MANPAGES=yes
2902 PSCMD="ps -e -o pid,comm"
2904 platforms/aix/Makefile"
2905 TAPEDRIVE="/dev/rmt0.1"
2909 PTHREAD_LIB="-lpthread -lexc"
2910 if test "${CC}" = "gcc" ; then
2917 TAPEDRIVE="/dev/nrmt0"
2920 DISTVER=`uname -a |awk '{print $3}'`
2921 TAPEDRIVE="/dev/nrmt0"
2922 PTHREAD_LIB="-pthread"
2923 CFLAGS="${CFLAGS} -pthread"
2924 PSCMD="ps -ax -o pid,command"
2928 platforms/bsdi/Makefile \
2929 platforms/bsdi/bacula-fd \
2930 platforms/bsdi/bacula-sd \
2931 platforms/bsdi/bacula-dir"
2932 largefile_support="yes"
2936 TAPEDRIVE="/dev/nst0"
2937 PSCMD="ps -e -o pid,command"
2940 platforms/darwin/Makefile"
2944 TAPEDRIVE="/dev/nst0"
2945 PSCMD="ps -e -o pid,command"
2948 platforms/osx/Makefile"
2951 if `test -f /etc/apt/sources.list && grep -q ubuntu /etc/apt/sources.list`; then
2954 DISTVER=`cat /etc/debian_version`
2955 if test -f /etc/lsb-release ; then
2957 if test "x$DISTRIB_ID" != "x" ; then
2958 DISTNAME=$DISTRIB_ID
2960 if test "x$DISTRIB_RELEASE" != "x" ; then
2961 DISTVER=$DISTRIB_RELEASE
2964 if test "$DISTNAME" = "Ubuntu" ; then
2967 TAPEDRIVE="/dev/nst0"
2968 PSCMD="ps -e -o pid,command"
2969 if test "$DISTNAME" = "ubuntu" ; then
2971 platforms/ubuntu/Makefile \
2972 platforms/ubuntu/bacula-fd \
2973 platforms/ubuntu/bacula-sd \
2974 platforms/ubuntu/bacula-dir"
2977 platforms/debian/Makefile \
2978 platforms/debian/bacula-fd \
2979 platforms/debian/bacula-sd \
2980 platforms/debian/bacula-dir"
2984 DISTVER=`uname -a |awk '{print $3}'`
2985 VER=`echo $DISTVER | cut -c 1`
2986 if test x$VER = x4 ; then
2987 PTHREAD_LIB="${PTHREAD_LIBS:--pthread}"
2988 CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS:--pthread}"
2992 TAPEDRIVE="/dev/nrsa0"
2993 PSCMD="ps -ax -o pid,command"
2995 platforms/freebsd/Makefile \
2996 platforms/freebsd/bacula-fd \
2997 platforms/freebsd/bacula-sd \
2998 platforms/freebsd/bacula-dir"
2999 largefile_support="yes"
3003 TAPEDRIVE="/dev/nst0"
3004 PSCMD="ps -e -o pid,command"
3006 platforms/hurd/Makefile \
3007 platforms/hurd/bacula-fd \
3008 platforms/hurd/bacula-sd \
3009 platforms/hurd/bacula-dir"
3012 PSCMD="UNIX95=1; ps -e -o pid,comm"
3013 CFLAGS="${CFLAGS} -D_XOPEN_SOURCE_EXTENDED=1"
3015 TAPEDRIVE="/dev/rmt/0hnb"
3016 PTHREAD_LIB="-lpthread"
3017 AC_DEFINE([_INCLUDE_LONGLONG])
3021 TAPEDRIVE="/dev/rmt/0cbn"
3022 PSCMD="ps -e -o pid,comm"
3024 platforms/irix/Makefile \
3025 platforms/irix/bacula-fd \
3026 platforms/irix/bacula-sd \
3027 platforms/irix/bacula-dir"
3030 DISTVER=`uname -a |awk '{print $3}'`
3033 TAPEDRIVE="/dev/nrst0"
3034 PSCMD="ps -ax -o pid,command"
3035 PTHREAD_LIB="-pthread"
3036 CFLAGS="${CFLAGS} -pthread"
3039 DISTVER=`uname -a |awk '{print $3}'`
3042 TAPEDRIVE="/dev/nrst0"
3043 PSCMD="ps -ax -o pid,command"
3044 PTHREAD_LIB="-pthread"
3045 CFLAGS="${CFLAGS} -pthread"
3047 platforms/openbsd/Makefile \
3048 platforms/openbsd/bacula-fd \
3049 platforms/openbsd/bacula-sd \
3050 platforms/openbsd/bacula-dir"
3053 if test -f /etc/whitebox-release ; then
3054 f=/etc/whitebox-release
3056 f=/etc/redhat-release
3058 if test `cat $f | grep release |\
3059 cut -f 3 -d ' '`x = "Enterprise"x ; then
3060 DISTVER="Enterprise "`cat $f | grep release |\
3063 DISTVER=`cat /etc/redhat-release | grep release |\
3066 TAPEDRIVE="/dev/nst0"
3067 PSCMD="ps -e -o pid,command"
3069 platforms/redhat/Makefile \
3070 platforms/redhat/bacula-fd \
3071 platforms/redhat/bacula-sd \
3072 platforms/redhat/bacula-dir
3076 DISTVER=`cat /etc/mandrake-release | grep release |\
3078 TAPEDRIVE="/dev/nst0"
3079 PSCMD="ps -e -o pid,command"
3081 platforms/mandrake/Makefile \
3082 platforms/mandrake/bacula-fd \
3083 platforms/mandrake/bacula-sd \
3084 platforms/mandrake/bacula-dir \
3088 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
3089 TAPEDRIVE="/dev/nst0"
3090 PSCMD="ps -e -o pid,command"
3092 platforms/gentoo/Makefile \
3093 platforms/gentoo/bacula-init \
3094 platforms/gentoo/bacula-fd \
3095 platforms/gentoo/bacula-sd \
3096 platforms/gentoo/bacula-dir"
3099 DISTVER=`cat /etc/slackware-version`
3100 TAPEDRIVE="/dev/nst0"
3101 PSCMD="ps -e -o pid,command"
3103 platforms/slackware/Makefile \
3104 platforms/slackware/rc.bacula-fd \
3105 platforms/slackware/rc.bacula-sd \
3106 platforms/slackware/rc.bacula-dir\
3107 platforms/slackware/functions.bacula"
3111 TAPEDRIVE="/dev/rmt/0cbn"
3112 PSCMD="ps -e -o pid,comm"
3114 platforms/solaris/Makefile \
3115 platforms/solaris/bacula-fd \
3116 platforms/solaris/bacula-sd \
3117 platforms/solaris/bacula-dir"
3121 AC_DEFINE(HAVE_OLD_SOCKOPT)
3122 AC_DEFINE(USE_THR_SETCONCURRENCY)
3125 AC_DEFINE(USE_THR_SETCONCURRENCY)
3130 LIBS="$LIBS -lresolv -lrt"
3133 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
3135 TAPEDRIVE="/dev/nst0"
3136 PSCMD="ps -e -o pid,command"
3138 platforms/suse/Makefile \
3139 platforms/suse/bacula-fd \
3140 platforms/suse/bacula-sd \
3141 platforms/suse/bacula-dir \
3142 platforms/suse/bacula"
3147 TAPEDRIVE="/dev/nst0"
3148 PSCMD="ps -e -o pid,command"
3150 platforms/suse/Makefile \
3151 platforms/suse/bacula-fd \
3152 platforms/suse/bacula-sd \
3153 platforms/suse/bacula-dir"
3157 TAPEDRIVE="/dev/nst0"
3160 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
3164 dnl -------------------------------------------
3165 dnl systemd (default off)
3166 dnl -------------------------------------------
3167 AC_MSG_CHECKING(for systemd support)
3168 AC_ARG_WITH(systemd,
3169 AC_HELP_STRING([--with-systemd@<:@=UNITDIR@:>@], [Include systemd support. UNITDIR is where systemd system .service files are located, default is to ask systemctl.]),
3171 if test "$withval" != "no"; then
3172 if test "$withval" = "yes"; then
3173 SYSTEMD_UNITDIR="`systemctl show | grep UnitPath | cut -d " " -f2`"
3175 SYSTEMD_UNITDIR="${withval}"
3179 platforms/systemd/Makefile \
3180 platforms/systemd/bacula.conf \
3181 platforms/systemd/bacula-dir.service \
3182 platforms/systemd/bacula-fd.service \
3183 platforms/systemd/bacula-sd.service"
3184 AC_DEFINE(HAVE_SYSTEMD, 1, [Define to 1 if systemd support should be enabled])
3186 support_systemd="yes"
3189 support_systemd="no"
3192 support_systemd="no"
3196 AC_SUBST(SYSTEMD_UNITDIR)
3200 LIBS="$PTHREAD_LIB $LIBS"
3202 AC_DEFINE_UNQUOTED(lld, "$lld")
3203 AC_DEFINE_UNQUOTED(llu, "$llu")
3209 AC_SUBST(COMPRESS_MANPAGES)
3211 dnl common parts of the Makefile
3212 MCOMMON=./autoconf/Make.common
3213 AC_SUBST_FILE(MCOMMON)
3216 if test "x${subsysdir}" = "x${sbindir}" ; then
3219 echo "You have set both --sbindir and --with-subsys-dir"
3220 echo " equal to: ${subsysdir} "
3221 echo "This is not permitted. Please reconfigure."
3223 echo "Aborting configuration ..."
3229 AC_OUTPUT([autoconf/Make.common \
3232 scripts/btraceback \
3235 scripts/bacula-ctl-dir \
3236 scripts/bacula-ctl-fd \
3237 scripts/bacula-ctl-sd \
3238 scripts/devel_bacula \
3241 scripts/mtx-changer \
3242 scripts/disk-changer \
3243 scripts/dvd-handler \
3244 scripts/dvd-simulator \
3245 scripts/logwatch/Makefile \
3246 scripts/logwatch/logfile.bacula.conf \
3247 scripts/bat.desktop \
3248 scripts/bat.desktop.xsu \
3249 scripts/bat.desktop.consolehelper \
3250 scripts/bat.console_apps \
3253 src/console/Makefile \
3254 src/console/bconsole.conf \
3255 src/qt-console/bat.conf \
3256 src/qt-console/bat.pro \
3257 src/qt-console/bat.pro.mingw32 \
3258 src/qt-console/install_conf_file \
3260 src/dird/bacula-dir.conf \
3262 src/stored/Makefile \
3263 src/stored/bacula-sd.conf \
3264 src/filed/Makefile \
3265 src/filed/bacula-fd.conf \
3267 src/cats/make_catalog_backup.pl \
3268 src/cats/make_catalog_backup \
3269 src/cats/delete_catalog_backup \
3270 src/cats/create_postgresql_database \
3271 src/cats/update_postgresql_tables \
3272 src/cats/make_postgresql_tables \
3273 src/cats/grant_postgresql_privileges \
3274 src/cats/drop_postgresql_tables \
3275 src/cats/drop_postgresql_database \
3276 src/cats/create_mysql_database \
3277 src/cats/update_mysql_tables \
3278 src/cats/make_mysql_tables \
3279 src/cats/grant_mysql_privileges \
3280 src/cats/drop_mysql_tables \
3281 src/cats/drop_mysql_database \
3282 src/cats/create_sqlite3_database \
3283 src/cats/update_sqlite3_tables \
3284 src/cats/make_sqlite3_tables \
3285 src/cats/grant_sqlite3_privileges \
3286 src/cats/drop_sqlite3_tables \
3287 src/cats/drop_sqlite3_database \
3290 src/cats/create_bacula_database \
3291 src/cats/update_bacula_tables \
3292 src/cats/grant_bacula_privileges \
3293 src/cats/make_bacula_tables \
3294 src/cats/drop_bacula_tables \
3295 src/cats/drop_bacula_database \
3296 src/cats/install-default-backend \
3297 src/findlib/Makefile \
3298 src/tools/Makefile \
3299 src/plugins/fd/Makefile \
3300 src/plugins/sd/Makefile \
3301 src/plugins/dir/Makefile \
3303 updatedb/update_mysql_tables_9_to_10 \
3304 updatedb/update_sqlite3_tables_9_to_10 \
3305 updatedb/update_postgresql_tables_9_to_10 \
3306 updatedb/update_mysql_tables_10_to_11 \
3307 updatedb/update_sqlite3_tables_10_to_11 \
3308 updatedb/update_postgresql_tables_10_to_11 \
3309 updatedb/update_mysql_tables_11_to_12 \
3310 updatedb/update_sqlite3_tables_11_to_12 \
3311 updatedb/update_postgresql_tables_11_to_12 \
3312 examples/nagios/check_bacula/Makefile \
3313 platforms/rpms/redhat/bacula.spec \
3314 platforms/rpms/redhat/bacula-bat.spec \
3315 platforms/rpms/redhat/bacula-docs.spec \
3316 platforms/rpms/redhat/bacula-mtx.spec \
3317 platforms/rpms/suse/bacula.spec \
3318 platforms/rpms/suse/bacula-bat.spec \
3319 platforms/rpms/suse/bacula-docs.spec \
3320 platforms/rpms/suse/bacula-mtx.spec \
3325 if test "${support_bat}" = "yes" ; then
3326 if test "x$QMAKE" = "xnone"; then
3327 AC_MSG_ERROR([Could not find qmake $PATH. Check your Qt installation])
3331 echo "Creating bat Makefile"
3342 dnl if CC is gcc, we can rebuild the dependencies (since the depend rule
3343 dnl requires gcc). If it's not, don't rebuild dependencies
3345 if test X"$GCC" = "Xyes" ; then
3346 echo "Doing make of dependencies"
3347 ${MAKE:-make} depend
3351 chmod 755 install_conf_file build-depkgs-qt-console
3355 chmod 755 bacula btraceback mtx-changer storage-ctl bsg_persist
3356 chmod 755 dvd-handler dvd-simulator
3357 chmod 755 bconsole disk-changer devel_bacula logrotate
3361 chmod 755 $c/update_mysql_tables_10_to_11 $c/update_sqlite3_tables_10_to_11
3362 chmod 755 $c/update_postgresql_tables_10_to_11
3363 chmod 755 $c/update_mysql_tables_11_to_12 $c/update_sqlite3_tables_11_to_12
3364 chmod 755 $c/update_postgresql_tables_11_to_12
3369 chmod 755 $c/create_bacula_database $c/update_bacula_tables $c/make_bacula_tables
3370 chmod 755 $c/grant_bacula_privileges $c/drop_bacula_tables $c/drop_bacula_database
3372 chmod 755 $c/create_mysql_database $c/update_mysql_tables $c/make_mysql_tables
3373 chmod 755 $c/grant_mysql_privileges $c/drop_mysql_tables $c/drop_mysql_database
3375 chmod 755 $c/create_sqlite3_database $c/update_sqlite3_tables $c/make_sqlite3_tables
3376 chmod 755 $c/grant_sqlite3_privileges $c/drop_sqlite3_tables $c/drop_sqlite3_database
3378 chmod 755 $c/create_postgresql_database $c/update_postgresql_tables $c/make_postgresql_tables
3379 chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables $c/drop_postgresql_database
3381 #chmod 755 $c/create_ingres_database $c/update_ingres_tables $c/make_ingres_tables
3382 #chmod 755 $c/grant_ingres_privileges $c/drop_ingres_tables $c/drop_ingres_database
3385 chmod 755 $c/make_catalog_backup $c/delete_catalog_backup $c/make_catalog_backup.pl
3389 chmod 755 $c/install-default-backend
3391 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
3392 largefile_support="yes"
3395 dnl Only try to find out the version number of the compiler when we know its some kind of GCC compiler
3396 if test X"$GCC" = "Xyes" ; then
3398 dnl A whole lot of hand springs to get the compiler version.
3399 dnl This is because gcc changed the output in version 3.0
3401 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3402 if test "x${CCVERSION}" = "x" ; then
3403 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3405 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3406 if test x"${CXXVERSION}" = x ; then
3407 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3411 # clean up any old junk
3418 Configuration on `date`:
3420 Host: ${host}${post_host} -- ${DISTNAME} ${DISTVER}
3421 Bacula version: ${BACULA} ${VERSION} (${DATE})
3422 Source code location: ${srcdir}
3423 Install binaries: ${sbindir}
3424 Install libraries: ${libdir}
3425 Install config files: ${sysconfdir}
3426 Scripts directory: ${scriptdir}
3427 Archive directory: ${archivedir}
3428 Working directory: ${working_dir}
3429 PID directory: ${piddir}
3430 Subsys directory: ${subsysdir}
3431 Man directory: ${mandir}
3432 Data directory: ${datarootdir}
3433 Plugin directory: ${plugindir}
3434 C Compiler: ${CC} ${CCVERSION}
3435 C++ Compiler: ${CXX} ${CXXVERSION}
3436 Compiler flags: ${WCFLAGS} ${CFLAGS}
3437 Linker flags: ${WLDFLAGS} ${LDFLAGS}
3439 Statically Linked Tools: ${support_static_tools}
3440 Statically Linked FD: ${support_static_fd}
3441 Statically Linked SD: ${support_static_sd}
3442 Statically Linked DIR: ${support_static_dir}
3443 Statically Linked CONS: ${support_static_cons}
3444 Database backends: ${db_backends}
3445 Database port: ${db_port}
3446 Database name: ${db_name}
3447 Database user: ${db_user}
3449 Job Output Email: ${job_email}
3450 Traceback Email: ${dump_email}
3451 SMTP Host Address: ${smtp_host}
3453 Director Port: ${dir_port}
3454 File daemon Port: ${fd_port}
3455 Storage daemon Port: ${sd_port}
3457 Director User: ${dir_user}
3458 Director Group: ${dir_group}
3459 Storage Daemon User: ${sd_user}
3460 Storage DaemonGroup: ${sd_group}
3461 File Daemon User: ${fd_user}
3462 File Daemon Group: ${fd_group}
3464 Large file support: $largefile_support
3465 Bacula conio support: ${got_conio} ${CONS_LIBS}
3466 readline support: ${got_readline} ${PRTREADLINE_SRC}
3467 TCP Wrappers support: ${TCPW_MSG} ${WRAPLIBS}
3468 TLS support: ${support_tls}
3469 Encryption support: ${support_crypto}
3470 ZLIB support: ${have_zlib}
3471 LZO support: ${have_lzo}
3472 enable-smartalloc: ${support_smartalloc}
3473 enable-lockmgr: ${support_lockmgr}
3474 bat support: ${support_bat}
3475 client-only: ${build_client_only}
3476 build-dird: ${build_dird}
3477 build-stored: ${build_stored}
3478 Plugin support: ${have_plugins}
3479 AFS support: ${have_afs}
3480 ACL support: ${have_acl}
3481 XATTR support: ${have_xattr}
3482 systemd support: ${support_systemd} ${SYSTEMD_UNITDIR}
3483 Batch insert enabled: ${batch_insert_db_backends}
3487 # create a small shell script useful for support with
3488 # configure options and config.out info
3489 cat > scripts/bacula_config << EOF
3492 $ $0 $ac_configure_args
3494 cat config.out >> scripts/bacula_config
3495 echo __EOC__ >> scripts/bacula_config
3496 chmod 755 scripts/bacula_config