3 dnl Process this file with autoconf to produce a configure script.
5 dnl Author: Kern Sibbald
8 dnl require a recent autoconf
10 AC_INIT([bacula], m4_esyscmd([sed -n -e 's/^#define VERSION.*"\(.*\)"$/\1/p' ../src/version.h src/version.h 2> /dev/null | tr -d '\n']))
11 AC_CONFIG_SRCDIR(src/version.h)
19 AC_CONFIG_AUX_DIR(${BUILD_DIR}/autoconf)
20 AC_CONFIG_HEADERS(src/config.h:autoconf/config.h.in)
22 dnl search for true and false programs.
23 AC_PATH_PROGS(TRUEPRG, true, :)
24 AC_PATH_PROGS(FALSEPRG, false, :)
29 if test "x$BACULA" != x; then
30 post_host=`echo -${BACULA} | tr 'A-Z ' 'a-z-'`
32 BACULA=${BACULA:-Bacula}
33 VERSION=`sed -n -e 's/^#define VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
34 RELEASE=`sed -n -e 's/^#define RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
35 DATE=`sed -n -e 's/^#define BDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
36 LSMDATE=`sed -n -e 's/^#define LSMDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
37 BDB_VERSION=`sed -n -e 's/^#define BDB_VERSION \(.*\)$/\1/p' ${srcdir}/src/cats/cats.h`
38 DEPKGS_VERSION=`sed -n -e 's/^#define DEPKGS_VERSION \(.*\)$/\1/p' ${srcdir}/src/cats/cats.h`
39 DEPKGS_QT_VERSION=`sed -n -e 's/^#define DEPKGS_QT_VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
40 BQT_VERSION=`sed -n -e 's/^#define BQT_VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
45 AC_SUBST(post_host)dnl
46 AC_SUBST(BDB_VERSION)dnl
47 AC_SUBST(DEPKGS_QT_VERSION)dnl
48 AC_SUBST(DEPKGS_VERSION)dnl
49 AC_SUBST(BQT4_VERSION)dnl
52 dnl can be overwritten by specific values from version.h
53 LIBBAC_LT_RELEASE=`sed -n -e 's/^#.*LIBBAC_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
54 LIBBACCFG_LT_RELEASE=`sed -n -e 's/^#.*LIBBACCFG_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
56 LIBBAC_LT_RELEASE=${LIBBAC_LT_RELEASE:-$VERSION}
57 LIBBACCFG_LT_RELEASE=${LIBBACCFG_LT_RELEASE:-$VERSION}
59 AC_SUBST(LIBBAC_LT_RELEASE)dnl
60 AC_SUBST(LIBBACCFG_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
372 batch_insert_db_backends=""
375 dnl --------------------------------------------------------------------------
376 dnl CHECKING COMMAND LINE OPTIONS
377 dnl --------------------------------------------------------------------------
379 dnl -------------------------------------------
380 dnl bat (default off)
381 dnl -------------------------------------------
383 AC_HELP_STRING([--enable-bat], [enable build of bat Qt4 GUI @<:@default=no@:>@]),
385 if test x$enableval = xyes; then
386 AC_DEFINE(HAVE_BAT, 1, [Set if Bacula bat Qt4 GUI support enabled])
393 if test x$support_bat = xyes; then
394 abc=`$PKGCONFIG --atleast-version=4.2 QtGui`
396 if test $pkg = 0; then
397 BAT_DIR=src/qt-console
399 AC_MSG_ERROR(Unable to find Qt4 installation needed by bat)
404 dnl The qwt library was used with bat, but that is no longer the case
412 dnl if test x$support_bat = xyes; then
413 dnl AC_MSG_CHECKING(for qwt support)
415 dnl AC_HELP_STRING([--with-qwt@<:@=DIR@:>@], [specify qwt library directory]),
417 dnl case "$with_qwt" in
422 dnl if test -f ${with_qwt}/include/qwt.h; then
423 dnl QWT_INC="${with_qwt}/include"
424 dnl QWT_LDFLAGS="-L${with_qwt}/lib"
434 dnl dnl Search in standard places, or --with-qwt not specified
436 dnl if test $no_qwt = no; then
437 dnl if test x$QWT_INC = x; then
438 dnl for root in /usr /usr/local; do
439 dnl for ver in qwt qwt5 qwt-qt4; do
440 dnl if test -f ${root}/include/${ver}/qwt.h; then
441 dnl QWT_INC="${root}/include/${ver}"
442 dnl if test -d ${root}/lib64/; then
443 dnl QWT_LDFLAGS="-L${root}/lib64"
444 dnl elif test -d ${root}/lib/64/; then
445 dnl QWT_LDFLAGS="-L${root}/64"
447 dnl QWT_LDFLAGS="-L${root}/lib"
458 dnl if test x$QWT_INC = x; then
459 dnl AC_MSG_RESULT(no)
461 dnl AC_DEFINE(HAVE_QWT, 1, [Set if bat QWT library found])
462 dnl AC_MSG_RESULT(yes)
468 AC_SUBST(QWT_LDFLAGS)
473 dnl -------------------------------------------
474 dnl smartalloc (default off)
475 dnl -------------------------------------------
476 AC_ARG_ENABLE(smartalloc,
477 AC_HELP_STRING([--enable-smartalloc], [enable smartalloc debugging support @<:@default=no@:>@]),
479 if test x$enableval = xno; then
480 support_smartalloc=no
485 if test x$support_smartalloc = xyes; then
486 AC_DEFINE(SMARTALLOC, 1, [Set if you want Smartalloc enabled])
489 dnl -------------------------------------------
490 dnl Lock Manager (default off)
491 dnl -------------------------------------------
492 AC_ARG_ENABLE(lockmgr,
493 AC_HELP_STRING([--enable-lockmgr], [enable lock manager support @<:@default=no@:>@]),
495 if test x$enableval = xyes; then
501 if test x$support_lockmgr = xyes; then
502 AC_DEFINE(_USE_LOCKMGR, 1, [Set if you want Lock Manager enabled])
506 dnl -------------------------------------------
507 dnl static-tools (default off)
508 dnl -------------------------------------------
509 AC_ARG_ENABLE(static-tools,
510 AC_HELP_STRING([--enable-static-tools], [enable static tape tools @<:@default=no@:>@]),
512 if test x$enableval = xyes; then
513 if test x$use_libtool = xyes; then
514 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
515 please rerun configure with --disable-libtool])
517 support_static_tools=yes
523 if test x$support_static_tools = xyes; then
524 TTOOL_LDFLAGS="-static"
526 AC_SUBST(TTOOL_LDFLAGS)
528 dnl -------------------------------------------
529 dnl static-fd (default off)
530 dnl -------------------------------------------
531 AC_ARG_ENABLE(static-fd,
532 AC_HELP_STRING([--enable-static-fd], [enable static File daemon @<:@default=no@:>@]),
534 if test x$enableval = xyes; then
535 if test x$use_libtool = xyes; then
536 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
537 please rerun configure with --disable-libtool])
539 support_static_fd=yes
545 if test x$support_static_fd = xyes; then
546 STATIC_FD="static-bacula-fd"
550 dnl -------------------------------------------
551 dnl static-sd (default off)
552 dnl -------------------------------------------
553 AC_ARG_ENABLE(static-sd,
554 AC_HELP_STRING([--enable-static-sd], [enable static Storage daemon @<:@default=no@:>@]),
556 if test x$enableval = xyes; then
557 if test x$use_libtool = xyes; then
558 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
559 please rerun configure with --disable-libtool])
561 support_static_sd=yes
567 if test x$support_static_sd = xyes; then
568 STATIC_SD="static-bacula-sd"
572 dnl -------------------------------------------
573 dnl static-dir (default off)
574 dnl -------------------------------------------
575 AC_ARG_ENABLE(static-dir,
576 AC_HELP_STRING([--enable-static-dir], [enable static Director @<:@default=no@:>@]),
578 if test x$enableval = xyes; then
579 if test x$use_libtool = xyes; then
580 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
581 please rerun configure with --disable-libtool])
583 support_static_dir=yes
589 if test x$support_static_dir = xyes; then
590 STATIC_DIR="static-bacula-dir"
594 dnl -------------------------------------------
595 dnl static-cons (default off)
596 dnl -------------------------------------------
597 AC_ARG_ENABLE(static-cons,
598 AC_HELP_STRING([--enable-static-cons], [enable static Console @<:@default=no@:>@]),
600 if test x$enableval = xyes; then
601 if test x$use_libtool = xyes; then
602 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
603 please rerun configure with --disable-libtool])
605 support_static_cons=yes
611 if test x$support_static_cons = xyes; then
612 STATIC_CONS="static-bconsole"
614 AC_SUBST(STATIC_CONS)
616 dnl -------------------------------------------
617 dnl client_only (default off)
618 dnl -------------------------------------------
619 AC_ARG_ENABLE(client-only,
620 AC_HELP_STRING([--enable-client-only], [build client (File daemon) only @<:@default=no@:>@]),
622 if test x$enableval = xyes; then
623 build_client_only=yes
629 if test x$build_client_only = xno; then
636 dnl -------------------------------------------
637 dnl director (default on)
638 dnl -------------------------------------------
639 AC_ARG_ENABLE(build-dird,
640 AC_HELP_STRING([--enable-build-dird], [enable building of dird (Director) @<:@default=yes@:>@]),
642 if test x$enableval = xno; then
647 if test x$build_dird = xyes; then
652 DIR_TOOLS="NODIRTOOLS"
657 dnl -------------------------------------------
658 dnl stored (default on)
659 dnl -------------------------------------------
660 AC_ARG_ENABLE(build-stored,
661 AC_HELP_STRING([--enable-build-stored], [enable building of stored (Storage daemon) @<:@default=yes@:>@]),
663 if test x$enableval = xno; then
668 if test x$build_stored = xyes; then
669 STORED_DIR="src/stored"
675 dnl ---------------------------------------------------
676 dnl Check for conio (Bacula readline substitute)(
677 dnl ---------------------------------------------------
678 dnl this allows you to turn it completely off
680 AC_HELP_STRING([--disable-conio], [disable conio support @<:@default=no@:>@]),
682 if test x$enableval = xno; then
689 dnl ---------------------------------------------------
690 dnl Check for IPv6 support
691 dnl ---------------------------------------------------
692 dnl this allows you to turn it completely off
695 AC_HELP_STRING([--enable-ipv6], [enable ipv6 support @<:@default=yes@:>@]),
697 if test x$enableval = xno; then
703 if test x$support_ipv6 = xyes; then
704 AC_TRY_LINK([ #include <sys/types.h>
705 #include <sys/socket.h>
706 #include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;],
707 [support_ipv6=yes], [support_ipv6=no])
710 if test x$support_ipv6 = xyes; then
711 AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
715 AC_CHECK_HEADER(curses.h, [
716 AC_CHECK_LIB(tinfo, tgetent, [ TERM_LIB="-ltinfo" ], [
717 AC_CHECK_LIB(ncurses, tgetent, [ TERM_LIB="-lncurses" ], [
718 AC_CHECK_LIB(termcap, tgetent, [ TERM_LIB="-ltermcap" ])
722 [ AC_CHECK_HEADERS(curses.h)
723 AC_CHECK_HEADER(term.h,
724 [ AC_CHECK_LIB(curses, tgetent,
725 [ TERM_LIB="-lcurses" ] )
731 if test x$support_conio = xyes; then
732 if test x$TERM_LIB != x; then
738 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
740 echo " "; echo "Required libraries not found. CONIO turned off ..."; echo " "
745 dnl ---------------------------------------------------
746 dnl Check for readline support/directory (default off)
747 dnl ---------------------------------------------------
748 dnl this allows you to turn it completely off
749 AC_ARG_ENABLE(readline,
750 AC_HELP_STRING([--disable-readline], [disable readline support @<:@default=yes@:>@]),
752 if test x$enableval = xno; then
760 if test x$support_readline = xyes; then
761 AC_ARG_WITH(readline,
762 AC_HELP_STRING([--with-readline@<:@=DIR@:>@], [specify readline library directory]),
764 case "$with_readline" in
769 if test -f ${with_readline}/readline.h; then
770 CONS_INC="-I${with_readline}"
771 CONS_LDFLAGS="-L$with_readline"
772 elif test -f ${with_readline}/include/readline/readline.h; then
773 CONS_INC="-I${with_readline}/include/readline"
774 CONS_LDFLAGS="-L${with_readline}/lib"
775 with_readline="${with_readline}/include/readline"
777 with_readline="/usr/include/readline"
780 AC_CHECK_HEADER(${with_readline}/readline.h,
782 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
783 CONS_LIBS="-lreadline -lhistory ${TERM_LIB}"
787 echo "readline.h not found. readline turned off ..."
794 dnl check for standard readline library
795 AC_CHECK_HEADER(/usr/include/readline/readline.h,
797 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
799 CONS_INC="-I/usr/include/readline"
800 CONS_LIBS="-lreadline ${TERM_LIB}"
802 dnl Did not find standard library, so try Bacula's default
803 AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h,
805 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
807 CONS_INC="-I${TOP_DIR}/depkgs/readline"
808 CONS_LIBS="-lreadline -lhistory ${TERM_LIB}"
809 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
810 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
813 echo "readline.h not found. readline turned off ..."
827 AC_SUBST(CONS_LDFLAGS)
828 AC_SUBST(READLINE_SRC)
830 dnl Minimal stuff for readline Makefile configuration
835 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr)
836 AC_CHECK_FUNCS(lstat lchown lchmod futimes fchmod fchown)
837 AC_CHECK_FUNCS(nanosleep nl_langinfo)
838 AC_CHECK_HEADERS(varargs.h)
840 dnl End of readline/conio stuff
841 dnl -----------------------------------------------------------------------
844 dnl Find where sockets are (especially for Solaris)
845 dnl Do this before the TCP Wrappers test since tcp wrappers
846 dnl uses the socket library and some linkers are stupid.
848 AC_CHECK_FUNC(socket,
849 AC_MSG_RESULT(using libc's socket),
850 AC_CHECK_LIB(xnet,socket)
851 AC_CHECK_LIB(socket,socket)
852 AC_CHECK_LIB(inet,socket))
854 dnl -----------------------------------------------------------
855 dnl Check whether user wants TCP wrappers support (default off)
856 dnl -----------------------------------------------------------
859 AC_ARG_WITH(tcp-wrappers,
860 AC_HELP_STRING([--with-tcp-wrappers@<:@=DIR@:>@], [enable tcpwrappers support]),
862 if test "x$withval" != "xno" ; then
864 LIBS="$saved_LIBS -lwrap"
865 AC_SEARCH_LIBS(nanosleep, [rt])
866 AC_MSG_CHECKING(for libwrap)
869 #include <sys/types.h>
871 int deny_severity = 0;
872 int allow_severity = 0;
873 struct request_info *req;
878 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
883 LIBS="$saved_LIBS -lwrap -lnsl"
884 WRAPLIBS="$saved_LIBS -lwrap -lnsl"
887 #include <sys/types.h>
889 int deny_severity = 0;
890 int allow_severity = 0;
891 struct request_info *req;
896 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
901 AC_MSG_ERROR([*** libwrap missing])
911 dnl -----------------------------------------------------------
912 dnl Check whether OpenSSL is available
913 dnl -----------------------------------------------------------
914 AC_MSG_CHECKING([for OpenSSL])
915 dnl The following uses quadrigraphs:
919 AC_HELP_STRING([--with-openssl@<:@=DIR@:>@], [Include OpenSSL support. DIR is the OpenSSL base]),
921 with_openssl_directory=${withval}
925 if test "x$with_openssl_directory" != "xno"; then
926 OPENSSL_LIBS="-lssl -lcrypto"
929 if test "x$with_openssl_directory" != "xyes" && test x"${with_openssl_directory}" != "x"; then
931 # Make sure the $with_openssl_directory also makes sense
933 if test -d "$with_openssl_directory/lib" -a -d "$with_openssl_directory/include"; then
934 OPENSSL_LIBS="-L$with_openssl_directory/lib $OPENSSL_LIBS"
935 OPENSSL_INC="-I$with_openssl_directory/include $OPENSSL_INC"
940 saved_CFLAGS="${CFLAGS}"
941 LIBS="${saved_LIBS} ${OPENSSL_LIBS}"
942 CFLAGS="${saved_CFLAGS} ${OPENSSL_INC}"
946 #include <openssl/ssl.h>
948 CRYPTO_set_id_callback(NULL);
960 #include <openssl/evp.h>
964 ac_cv_openssl_sha2="yes"
966 ac_cv_openssl_sha2="no"
970 dnl Solaris disables greater than 128+ bit encryption in their OpenSSL
971 dnl implementation, presumably for export reasons. If 192bit AES
972 dnl is available, we assume that we're running with a 'non-export'
976 #include <openssl/evp.h>
980 ac_cv_openssl_export="no"
982 ac_cv_openssl_export="yes"
986 AC_MSG_RESULT([$support_tls])
987 if test "$support_tls" = "yes"; then
988 AC_DEFINE(HAVE_OPENSSL, 1, [Define if OpenSSL library is available])
989 AC_DEFINE(HAVE_TLS, 1, [Define if TLS support should be enabled])
990 AC_DEFINE(HAVE_CRYPTO, 1, [Define if encryption support should be enabled])
993 if test "$ac_cv_openssl_sha2" = "yes"; then
994 AC_DEFINE(HAVE_SHA2, 1, [Define if the SHA-2 family of digest algorithms is available])
997 if test "$ac_cv_openssl_export" = "yes"; then
998 AC_DEFINE(HAVE_OPENSSL_EXPORT_LIBRARY, 1, [Define if the OpenSSL library is export-contrained to 128bit ciphers])
1001 if test "$support_crypto" = "yes"; then
1002 AC_CHECK_LIB(crypto, EVP_PKEY_encrypt_old, AC_DEFINE(HAVE_OPENSSLv1, 1, [Set if have OpenSSL version 1.x]))
1005 LIBS="${saved_LIBS}"
1006 CFLAGS="${saved_CFLAGS}"
1010 AC_MSG_RESULT([$support_tls])
1013 if test "$support_tls" = "no" -o "$support_crypto" = "no"; then
1018 AC_SUBST(OPENSSL_LIBS)
1019 AC_SUBST(OPENSSL_INC)
1021 dnl -----------------------------------------------------------
1022 dnl dlopen is needed for plugins
1023 dnl -----------------------------------------------------------
1024 AC_SEARCH_LIBS(dlopen, [dl])
1026 dnl ------------------------------------------
1027 dnl Where to place working dir
1028 dnl ------------------------------------------
1029 working_dir=`eval echo /opt/bacula/working`
1030 AC_ARG_WITH(working-dir,
1031 AC_HELP_STRING([--with-working-dir=PATH], [specify path of Bacula working directory]),
1033 if test "x$withval" != "xno" ; then
1034 working_dir=$withval
1039 AC_SUBST(working_dir)
1041 dnl ------------------------------------------------------------------
1042 dnl If the user has not set archivedir, we set our default as /tmp
1043 dnl ------------------------------------------------------------------
1045 AC_ARG_WITH(archivedir,
1046 AC_HELP_STRING([--with-archivedir=PATH], [specify path of SD archive directory]),
1048 if test "x$withval" != "xno" ; then
1054 AC_SUBST(archivedir)
1056 dnl ------------------------------------------------------------------
1057 dnl Allow the user to specify the daemon resource name default hostname
1058 dnl ------------------------------------------------------------------
1060 AC_ARG_WITH(basename,
1061 AC_HELP_STRING([--with-basename=RESNAME], [specify base resource name for daemons]),
1063 if test "x$withval" != "xno" ; then
1071 dnl ------------------------------------------------------------------
1072 dnl Allow the user to override the hostname (default = machine hostname)
1073 dnl ------------------------------------------------------------------
1074 hostname=`uname -n | cut -d '.' -f 1`
1075 if test x${hostname} = x ; then
1076 hostname="localhost"
1078 dnl Make sure hostname is resolved
1079 ping -c 1 $hostname 2>/dev/null 1>/dev/null
1080 if test ! $? = 0; then
1081 hostname="localhost"
1083 AC_ARG_WITH(hostname,
1084 AC_HELP_STRING([--with-hostname=RESNAME], [specify host name for daemons]),
1086 if test "x$withval" != "xno" ; then
1095 dnl ------------------------------------------
1096 dnl Where to place scriptdir (script files)
1097 dnl ------------------------------------------
1098 scriptdir=`eval echo ${sysconfdir}`
1099 AC_ARG_WITH(scriptdir,
1100 AC_HELP_STRING([--with-scriptdir=PATH], [specify path of Bacula scripts directory]),
1102 if test "x$withval" != "xno" ; then
1111 dnl ------------------------------------------
1112 dnl Where to place bsrdir (bsr files)
1113 dnl ------------------------------------------
1114 bsrdir=`eval echo /opt/bacula/bsr`
1116 AC_HELP_STRING([--with-bsrdir=PATH], [specify path of Bacula bsrs directory]),
1118 if test "x$withval" != "xno" ; then
1126 dnl ------------------------------------------
1127 dnl Where to place logdir
1128 dnl ------------------------------------------
1129 logdir=`eval echo /opt/bacula/log`
1131 AC_HELP_STRING([--with-logdir=PATH], [specify path of Bacula logs directory]),
1133 if test "x$withval" != "xno" ; then
1142 # ------------------------------------------
1143 # Where to place plugindir (plugin files)
1144 # ------------------------------------------
1145 plugindir=`eval echo ${libdir}`
1146 AC_ARG_WITH(plugindir,
1147 AC_HELP_STRING([--with-plugindir=PATH], [specify path of Bacula plugins directory]),
1149 if test "x$withval" != "xno" ; then
1157 dnl ------------------------------------------
1158 dnl Where to send dump email
1159 dnl ------------------------------------------
1160 dump_email=root@localhost
1161 AC_ARG_WITH(dump-email,
1162 AC_HELP_STRING([--with-dump-email=EMAIL], [dump email address]),
1164 if test "x$withval" != "xno" ; then
1170 AC_SUBST(dump_email)
1172 dnl ------------------------------------------
1173 dnl Where to send job email
1174 dnl ------------------------------------------
1175 job_email=root@localhost
1176 AC_ARG_WITH(job-email,
1177 AC_HELP_STRING([--with-job-email=EMAIL], [job output email address]),
1179 if test "x$withval" != "xno" ; then
1187 dnl ------------------------------------------
1188 dnl Where to find smtp host
1189 dnl ------------------------------------------
1191 AC_ARG_WITH(smtp_host,
1192 AC_HELP_STRING([--with-smtp-host=HOST], [SMTP mail host address]),
1194 if test "x$withval" != "xno" ; then
1202 dnl ------------------------------------
1203 dnl Where to place pid files
1204 dnl ------------------------------------
1206 AC_ARG_WITH(pid-dir,
1207 AC_HELP_STRING([--with-pid-dir=PATH], [specify location of Bacula pid files]),
1209 if test "x$withval" != "xno" ; then
1215 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
1218 dnl ------------------------------------
1219 dnl Where to place subsys "lock file"
1220 dnl ------------------------------------
1221 subsysdir=/var/run/subsys
1222 if test -d /var/run/subsys; then
1223 subsysdir=/var/run/subsys
1224 elif test -d /var/lock/subsys; then
1225 subsysdir=/var/lock/subsys
1227 subsysdir=/var/run/subsys
1229 AC_ARG_WITH(subsys-dir,
1230 AC_HELP_STRING([--with-subsys-dir=PATH], [specify location of Bacula subsys file]),
1232 if test "x$withval" != "xno" ; then
1240 dnl ------------------------------------
1241 dnl Where to start assigning ports
1242 dnl ------------------------------------
1244 AC_ARG_WITH(baseport,
1245 AC_HELP_STRING([--with-baseport=PORT], [specify base port address for daemons]),
1247 if test "x$withval" != "xno" ; then
1254 dir_port=`expr $baseport`
1255 fd_port=`expr $baseport + 1`
1256 sd_port=`expr $fd_port + 1`
1262 dnl ------------------------------------------
1263 dnl Generate passwords
1264 dnl ------------------------------------------
1266 AC_ARG_WITH(dir-password,
1267 AC_HELP_STRING([--with-dir-password=PASSWORD], [specify Director's password]),
1269 if test "x$withval" != "xno" ; then
1270 dir_password=$withval
1275 if test "x$dir_password" = "x" ; then
1276 if test "x$OPENSSL" = "xnone" ; then
1277 key=`autoconf/randpass 33`
1279 key=`openssl rand -base64 33`
1285 AC_ARG_WITH(fd-password,
1286 AC_HELP_STRING([--with-fd-password=PASSWORD], [specify Client's password]),
1288 if test "x$withval" != "xno" ; then
1289 fd_password=$withval
1294 if test "x$fd_password" = "x" ; then
1295 if test "x$OPENSSL" = "xnone" ; then
1296 key=`autoconf/randpass 37`
1298 key=`openssl rand -base64 33`
1304 AC_ARG_WITH(sd-password,
1305 AC_HELP_STRING([--with-sd-password=PASSWORD], [specify Storage daemon's password]),
1307 if test "x$withval" != "xno" ; then
1308 sd_password=$withval
1313 if test "x$sd_password" = "x" ; then
1314 if test "x$OPENSSL" = "xnone" ; then
1315 key=`autoconf/randpass 41`
1317 key=`openssl rand -base64 33`
1323 AC_ARG_WITH(mon-dir-password,
1324 AC_HELP_STRING([--with-mon-dir-password=PASSWORD], [specify Director's password used by the monitor]),
1326 if test "x$withval" != "xno" ; then
1327 mon_dir_password=$withval
1332 if test "x$mon_dir_password" = "x" ; then
1333 if test "x$OPENSSL" = "xnone" ; then
1334 key=`autoconf/randpass 33`
1336 key=`openssl rand -base64 33`
1338 mon_dir_password=$key
1342 AC_ARG_WITH(mon-fd-password,
1343 AC_HELP_STRING([--with-mon-fd-password=PASSWORD], [specify Client's password used by the monitor]),
1345 if test "x$withval" != "xno" ; then
1346 mon_fd_password=$withval
1351 if test "x$mon_fd_password" = "x" ; then
1352 if test "x$OPENSSL" = "xnone" ; then
1353 key=`autoconf/randpass 37`
1355 key=`openssl rand -base64 33`
1357 mon_fd_password=$key
1361 AC_ARG_WITH(mon-sd-password,
1362 AC_HELP_STRING([--with-mon-sd-password=PASSWORD], [specify Storage daemon's password used by the monitor]),
1364 if test "x$withval" != "xno" ; then
1365 mon_sd_password=$withval
1370 if test "x$mon_sd_password" = "x" ; then
1371 if test "x$OPENSSL" = "xnone" ; then
1372 key=`autoconf/randpass 41`
1374 key=`openssl rand -base64 33`
1376 mon_sd_password=$key
1379 AC_SUBST(dir_password)
1380 AC_SUBST(fd_password)
1381 AC_SUBST(sd_password)
1382 AC_SUBST(mon_dir_password)
1383 AC_SUBST(mon_fd_password)
1384 AC_SUBST(mon_sd_password)
1387 dnl Pickup any database name
1390 AC_ARG_WITH(db_name,
1391 AC_HELP_STRING([--with-db-name=DBNAME], [specify database name @<:@default=bacula@:>@]),
1393 if test "x$withval" != "x" ; then
1401 AC_ARG_WITH(db_user,
1402 AC_HELP_STRING([--with-db-user=UNAME], [specify database user @<:@default=bacula@:>@]),
1404 if test "x$withval" != "x" ; then
1412 AC_ARG_WITH(db_password,
1413 AC_HELP_STRING([--with-db-password=PWD], [specify database password @<:@default=*none*@:>@]),
1415 if test "x$withval" != "x" ; then
1416 db_password=$withval
1420 AC_SUBST(db_password)
1423 dnl Pickup a database port
1426 AC_ARG_WITH(db_port,
1427 AC_HELP_STRING([--with-db-port=DBPORT], [specify a database port @<:@default=null@:>@]),
1429 if test "x$withval" != "x" ; then
1437 # Handle users and groups for each daemon
1440 AC_ARG_WITH(dir_user,
1441 AC_HELP_STRING([--with-dir-user=USER], [specify user for Director daemon]),
1443 if test "x$withval" != "x" ; then
1450 AC_ARG_WITH(dir_group,
1451 AC_HELP_STRING([--with-dir-group=GROUP], [specify group for Director daemon]),
1453 if test "x$withval" != "x" ; then
1460 AC_ARG_WITH(sd_user,
1461 AC_HELP_STRING([--with-sd-user=USER], [specify user for Storage daemon]),
1463 if test "x$withval" != "x" ; then
1470 AC_ARG_WITH(sd_group,
1471 AC_HELP_STRING([--with-sd-group=GROUP], [specify group for Storage daemon]),
1473 if test "x$withval" != "x" ; then
1480 AC_ARG_WITH(fd_user,
1481 AC_HELP_STRING([--with-fd-user=USER], [specify user for File daemon]),
1483 if test "x$withval" != "x" ; then
1490 AC_ARG_WITH(fd_group,
1491 AC_HELP_STRING([--with-fd-group=GROUP], [specify group for File daemon]),
1493 if test "x$withval" != "x" ; then
1507 dnl allow setting default executable permissions
1510 AC_ARG_WITH(sbin-perm,
1511 AC_HELP_STRING([--with-sbin-perm=MODE], [specify permissions for sbin binaries @<:@default=0750@:>@]),
1513 if test "x$withval" != "x" ; then
1521 dnl -------------------------------------------
1522 dnl enable batch attribute DB insert (default on)
1523 dnl -------------------------------------------
1524 support_batch_insert=yes
1525 AC_ARG_ENABLE(batch-insert,
1526 AC_HELP_STRING([--enable-batch-insert], [enable the DB batch insert code @<:@default=yes@:>@]),
1528 if test x$enableval = xno; then
1529 support_batch_insert=no
1534 if test x$support_batch_insert = xyes; then
1535 AC_DEFINE(USE_BATCH_FILE_INSERT, 1, [Set if DB batch insert code enabled])
1538 dnl ------------------------------------------------
1539 dnl Bacula check for various SQL database engines
1540 dnl ------------------------------------------------
1543 dnl Set uncomment_dbi by default to '#' if DBI is enabled this will get reset
1547 BA_CHECK_POSTGRESQL_DB
1553 dnl -------------------------------------------
1554 dnl If no batch insert backend are enable set
1555 dnl variable to None
1556 dnl -------------------------------------------
1557 if test -z "${batch_insert_db_backends}"; then
1558 batch_insert_db_backends="None"
1561 dnl -------------------------------------------
1562 dnl Make sure at least one database backend is found
1563 dnl -------------------------------------------
1564 if test "x${db_backends}" = "x" ; then
1567 echo "You have not specified either --enable-client-only or one of the"
1568 echo "supported databases: MySQL, PostgreSQL, or SQLite3."
1569 echo "This is not permitted. Please reconfigure."
1571 echo "Aborting the configuration ..."
1577 dnl -------------------------------------------
1578 dnl See how many catalog backends are configured.
1579 dnl -------------------------------------------
1580 case `echo $DB_BACKENDS | wc -w | sed -e 's/^ *//'` in
1582 DEFAULT_DB_TYPE="${DB_BACKENDS}"
1583 if test x$use_libtool = xno; then
1584 SHARED_CATALOG_TARGETS=""
1586 SHARED_CATALOG_TARGETS="libbaccats-${DEFAULT_DB_TYPE}.la"
1590 dnl ------------------------------------------------
1591 dnl Set the default backend to the first backend found
1592 dnl ------------------------------------------------
1593 DEFAULT_DB_TYPE=`echo ${DB_BACKENDS} | cut -d' ' -f1`
1595 dnl ------------------------------------------------
1596 dnl For multiple backend we need libtool support.
1597 dnl ------------------------------------------------
1598 if test x$use_libtool = xno; then
1601 echo "You have specified two or more of the"
1602 echo "supported databases: MySQL, PostgreSQL, or SQLite3."
1603 echo "This is not permitted when not using libtool Please reconfigure."
1605 echo "Aborting the configuration ..."
1611 SHARED_CATALOG_TARGETS=""
1612 for db_type in ${DB_BACKENDS}
1614 if test -z "${SHARED_CATALOG_TARGETS}"; then
1615 SHARED_CATALOG_TARGETS="libbaccats-${db_type}.la"
1617 SHARED_CATALOG_TARGETS="${SHARED_CATALOG_TARGETS} libbaccats-${db_type}.la"
1623 dnl -------------------------------------------
1624 dnl Unset DB_LIBS when using libtool as we link the
1625 dnl shared library using the right database lib no need to
1626 dnl set DB_LIBS which is only used for non shared versions
1627 dnl of the backends.
1628 dnl -------------------------------------------
1629 if test x$use_libtool = xyes; then
1633 AC_SUBST(uncomment_dbi)
1634 AC_SUBST(DB_BACKENDS)
1636 AC_SUBST(DEFAULT_DB_TYPE)
1637 AC_SUBST(SHARED_CATALOG_TARGETS)
1639 AC_DEFINE(PROTOTYPES)
1641 dnl --------------------------------------------------------------------------
1642 dnl Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
1644 if test -z "$CFLAGS" -o "$CFLAGS" = "-g -O2"; then
1645 if test -z "$CCOPTS"; then
1646 CCOPTS='-g -O2 -Wall'
1654 dnl See if we can use 64 bit file addresses
1655 largefile_support="no"
1660 dnl --------------------------------------------------------------------------
1661 dnl CHECKING FOR HEADER FILES
1662 dnl --------------------------------------------------------------------------
1701 AC_STRUCT_ST_BLKSIZE
1705 dnl --------------------------------------------------------------------------
1706 dnl Check for utime.h structure
1707 dnl --------------------------------------------------------------------------
1708 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
1712 #include <sys/types.h>
1717 ba_cv_header_utime_h=yes
1719 ba_cv_header_utime_h=no
1724 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H, 1, [Set if utime.h exists])
1726 dnl --------------------------------------------------------------------------
1727 dnl Check for socklen_t
1728 dnl --------------------------------------------------------------------------
1729 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
1733 #include <sys/types.h>
1734 #include <sys/socket.h>
1738 ba_cv_header_socklen_t=yes
1740 ba_cv_header_socklen_t=no
1745 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T, 1, [Set if socklen_t exists])
1747 dnl --------------------------------------------------------------------------
1748 dnl Check for ioctl request type
1749 dnl --------------------------------------------------------------------------
1751 AC_CACHE_CHECK(for ioctl_req_t, ba_cv_header_ioctl_req_t,
1756 #include <sys/types.h>
1757 #include <sys/ioctl.h>
1759 int (*d_ioctl)(int fd, unsigned long int request, ...);
1762 ba_cv_header_ioctl_req_t=yes
1764 ba_cv_header_ioctl_req_t=no
1769 test $ba_cv_header_ioctl_req_t = yes && AC_DEFINE(HAVE_IOCTL_ULINT_REQUEST, 1, [Set if ioctl request is unsigned long int])
1771 dnl Note: it is more correct to use AC_LANG(C++) but some of the older
1772 dnl *BSD systems still use old style C prototypes, which are wrong with
1773 dnl compiled with a C++ compiler.
1776 dnl --------------------------------------------------------------------------
1777 dnl Check for typeof()
1778 dnl --------------------------------------------------------------------------
1780 AC_CACHE_CHECK(for typeof, ba_cv_have_typeof,
1784 main(){char *a = 0; a = (typeof a)a;}
1786 ba_cv_have_typeof=yes
1788 ba_cv_have_typeof=no
1790 ba_cv_have_typeof=no
1795 test $ba_cv_have_typeof = yes && AC_DEFINE([HAVE_TYPEOF], 1, [Defind to 1 if compiler has typeof])
1800 AC_C_BIGENDIAN([AC_DEFINE([HAVE_BIG_ENDIAN], [1], [Big Endian])], [AC_DEFINE([HAVE_LITTLE_ENDIAN], [1], [Little Endian])])
1802 dnl --------------------------------------------------------------------------
1803 dnl CHECKING FOR FILESYSTEM TYPE
1804 dnl --------------------------------------------------------------------------
1805 AC_MSG_CHECKING(how to get filesystem type)
1807 # The order of these tests is important.
1810 #include <sys/statvfs.h>
1811 #include <sys/fstyp.h>
1813 AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4
1815 if test $fstype = no; then
1818 #include <sys/statfs.h>
1819 #include <sys/fstyp.h>
1821 AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3
1824 if test $fstype = no; then
1827 #include <sys/statfs.h>
1828 #include <sys/vmount.h>
1830 AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX
1833 if test $fstype = no; then
1838 AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD
1841 if test $fstype = no; then
1842 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
1844 if test $fstype = no; then
1847 #include <sys/mount.h>
1848 #include <sys/fs_types.h>
1850 AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix
1853 AC_MSG_RESULT($fstype)
1855 AC_CHECK_HEADER(sys/statvfs.h, [ AC_DEFINE(HAVE_SYS_STATVFS_H,1,[Defines if your system have the sys/statvfs.h header file])] , )
1858 AC_CHECK_FUNCS(backtrace)
1861 dnl --------------------------------------------------------------------------
1862 dnl CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
1863 dnl --------------------------------------------------------------------------
1873 AC_CHECK_TYPE(ino_t, unsigned long)
1874 AC_CHECK_TYPE(dev_t, unsigned long)
1875 AC_CHECK_TYPE(daddr_t, long)
1876 AC_CHECK_TYPE(major_t, int)
1877 AC_CHECK_TYPE(minor_t, int)
1878 AC_CHECK_TYPE(ssize_t, int)
1884 AC_CHECK_SIZEOF(char, 1)
1885 AC_CHECK_SIZEOF(short int, 2)
1886 AC_CHECK_SIZEOF(int, 4)
1887 AC_CHECK_SIZEOF(long int, 4)
1888 AC_CHECK_SIZEOF(long long int, 8)
1889 AC_CHECK_SIZEOF(int *, 4)
1891 dnl Check for sys/types.h types
1892 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int,
1896 #include <sys/types.h>
1900 ac_cv_have_u_int="yes"
1902 ac_cv_have_u_int="no"
1907 if test "x$ac_cv_have_u_int" = "xyes" ; then
1908 AC_DEFINE(HAVE_U_INT)
1912 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t,
1916 #include <sys/types.h>
1920 ac_cv_have_intmax_t="yes"
1928 ac_cv_have_intmax_t="yes"
1930 ac_cv_have_intmax_t="no"
1937 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
1938 AC_DEFINE(HAVE_INTMAX_T)
1942 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t,
1946 #include <sys/types.h>
1948 u_intmax_t a; a = 1;
1950 ac_cv_have_u_intmax_t="yes"
1956 u_intmax_t a; a = 1;
1958 ac_cv_have_u_intmax_t="yes"
1960 ac_cv_have_u_intmax_t="no"
1967 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
1968 AC_DEFINE(HAVE_U_INTMAX_T)
1972 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t,
1976 #include <sys/types.h>
1978 int8_t a; int16_t b; int32_t c; a = b = c = 1;
1980 ac_cv_have_intxx_t="yes"
1982 ac_cv_have_intxx_t="no"
1987 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1988 AC_DEFINE(HAVE_INTXX_T)
1992 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t,
1996 #include <sys/types.h>
2000 ac_cv_have_int64_t="yes"
2002 ac_cv_have_int64_t="no"
2007 if test "x$ac_cv_have_int64_t" = "xyes" ; then
2008 AC_DEFINE(HAVE_INT64_T)
2012 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t,
2016 #include <sys/types.h>
2018 u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;
2020 ac_cv_have_u_intxx_t="yes"
2022 ac_cv_have_u_intxx_t="no"
2027 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
2028 AC_DEFINE(HAVE_U_INTXX_T)
2032 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t,
2036 #include <sys/types.h>
2040 ac_cv_have_u_int64_t="yes"
2042 ac_cv_have_u_int64_t="no"
2047 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
2048 AC_DEFINE(HAVE_U_INT64_T)
2052 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
2053 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2055 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
2058 #include <sys/bitypes.h>
2060 int8_t a; int16_t b; int32_t c;
2061 u_int8_t e; u_int16_t f; u_int32_t g;
2062 a = b = c = e = f = g = 1;
2064 AC_DEFINE(HAVE_U_INTXX_T)
2065 AC_DEFINE(HAVE_INTXX_T)
2066 AC_DEFINE(HAVE_SYS_BITYPES_H)
2074 if test -z "$have_u_intxx_t" ; then
2075 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t,
2079 #include <sys/types.h>
2081 uint8_t a; uint16_t b;
2082 uint32_t c; a = b = c = 1;
2084 ac_cv_have_uintxx_t="yes"
2086 ac_cv_have_uintxx_t="no"
2091 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
2092 AC_DEFINE(HAVE_UINTXX_T)
2096 if (test -z "$have_u_int64_t" || test -z "$have_int64_t" && \
2097 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2099 AC_MSG_CHECKING([for int64_t and u_int64_t types in sys/bitypes.h])
2102 #include <sys/bitypes.h>
2104 int64_t a; u_int64_t b;
2107 AC_DEFINE(HAVE_U_INT64_T)
2108 AC_DEFINE(HAVE_INT64_T)
2116 if (test -z "$have_uintxx_t" && \
2117 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2119 AC_MSG_CHECKING([for uintXX_t types in sys/bitypes.h])
2122 #include <sys/bitypes.h>
2124 uint8_t a; uint16_t b;
2125 uint32_t c; a = b = c = 1;
2127 AC_DEFINE(HAVE_UINTXX_T)
2135 dnl --------------------------------------------------------------------------
2136 dnl CHECKING FOR REQUIRED LIBRARY FUNCTIONS
2137 dnl --------------------------------------------------------------------------
2153 [echo 'configure: cannot find needed function.'; exit 1]
2158 AC_DEFINE(HAVE_FCNTL_F_CLOSEM, 1, [Set if you have 'F_CLOSEM' fcntl flag]),
2160 [#include <fcntl.h>]
2163 AC_CHECK_FUNC(closefrom, [AC_DEFINE(HAVE_CLOSEFROM, 1, [Define to 1 if you have the 'closefrom' function.])])
2164 AC_CHECK_FUNCS(getpagesize, [AC_DEFINE(HAVE_GETPAGESIZE, 1, [Set if have getpagesize])])
2165 AC_CHECK_FUNCS(malloc_trim, [AC_DEFINE(HAVE_MALLOC_TRIM, 1, [Set if have malloc_trim])])
2167 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
2168 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
2169 AC_CHECK_FUNCS(posix_fadvise)
2170 AC_CHECK_FUNCS(fdatasync)
2172 AC_CHECK_FUNCS(chflags)
2174 AC_CHECK_FUNCS(snprintf vsnprintf gethostid fseeko)
2176 AC_CACHE_CHECK(for va_copy, ba_cv_va_copy,
2181 void use_va_copy(va_list args){va_list args2; va_copy(args2,args); va_end(args2);}
2182 void call_use_va_copy(int junk,...){va_list args; va_start(args,junk); use_va_copy(args); va_end(args);}
2184 call_use_va_copy(1,2,3)
2193 test $ba_cv_va_copy = yes && AC_DEFINE(HAVE_VA_COPY, 1, [Set if va_copy exists])
2195 dnl --------------------------------------------------------------------------
2196 dnl CHECKING FOR THREAD SAFE FUNCTIONS
2197 dnl --------------------------------------------------------------------------
2198 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
2200 # If resolver functions are not in libc check for -lnsl or -lresolv.
2201 AC_CHECK_FUNC(gethostbyname_r,
2202 AC_MSG_RESULT(using libc's resolver),
2203 AC_CHECK_LIB(nsl,gethostbyname_r)
2204 AC_CHECK_LIB(resolv,gethostbyname_r))
2206 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
2207 AC_CHECK_FUNCS(inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)])
2208 AC_CHECK_FUNCS(gethostbyname2, [AC_DEFINE(HAVE_GETHOSTBYNAME2)])
2209 AC_CHECK_FUNCS(getnameinfo, [AC_DEFINE(HAVE_GETNAMEINFO)])
2212 dnl ----------------------------
2213 dnl check sa_len of sockaddr
2214 dnl ----------------------------
2215 AC_CACHE_CHECK(for struct sockaddr has a sa_len field, ac_cv_struct_sockaddr_sa_len,
2219 #include <sys/socket.h>
2221 struct sockaddr s; s.sa_len;
2223 ac_cv_struct_sockaddr_sa_len=yes
2224 ], [ac_cv_struct_sockaddr_sa_len=no
2230 if test $ac_cv_struct_sockaddr_sa_len = yes; then
2231 AC_DEFINE(HAVE_SA_LEN, 1, [Define if sa_len field exists in struct sockaddr])
2235 dnl check for working getaddrinfo()
2237 dnl Note that if the system doesn't have gai_strerror(), we
2238 dnl can't use getaddrinfo() because we can't get strings
2239 dnl describing the error codes.
2241 AC_CACHE_CHECK(for working getaddrinfo, ac_cv_working_getaddrinfo,
2247 #include <sys/types.h>
2248 #include <sys/socket.h>
2251 struct addrinfo hints, *ai;
2254 memset(&hints, 0, sizeof(hints));
2255 hints.ai_family = AF_UNSPEC;
2256 hints.ai_socktype = SOCK_STREAM;
2257 error = getaddrinfo("127.0.0.1", NULL, &hints, &ai);
2261 if (ai->ai_addr->sa_family != AF_INET) {
2267 ac_cv_working_getaddrinfo="yes"
2269 ac_cv_working_getaddrinfo="no"
2271 ac_cv_working_getaddrinfo="yes"
2276 AC_CHECK_FUNC(gai_strerror, [AC_DEFINE(HAVE_GAI_STRERROR, 1, [Define to 1 if you have the 'gai_strerror' function.])])
2278 if test "$ac_cv_working_getaddrinfo" = "yes"; then
2279 if test "$ac_cv_func_gai_strerror" != "yes"; then
2280 ac_cv_working_getaddrinfo="no"
2282 AC_DEFINE(HAVE_GETADDRINFO, 1, [Define to 1 if getaddrinfo exists and works])
2290 AC_CHECK_FUNCS(getmntinfo, [AC_DEFINE(HAVE_GETMNTINFO)])
2291 AC_FUNC_CLOSEDIR_VOID
2292 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
2293 # AC_FUNC_FNMATCH dnl use local version
2295 AC_CHECK_LIB(intl, gettext, [LIBS="$LIBS -lintl"])
2297 AC_CHECK_LIB(sun, getpwnam)
2299 AC_CHECK_HEADERS(zlib.h)
2300 AC_CHECK_LIB(z, deflate, [ZLIBS="-lz"])
2302 if test x$ZLIBS = x-lz; then
2303 AC_DEFINE(HAVE_LIBZ)
2309 dnl Check if we have AFS on this system
2315 AC_HELP_STRING([--disable-afs], [disable afs support @<:@default=auto@:>@]),
2317 if test x$enableval = xyes; then
2319 elif test x$enableval = xno; then
2326 if test x$support_afs = xyes -o x$support_afs = xauto; then
2328 AC_HELP_STRING([--with-afsdir@<:@=DIR@:>@], [Directory holding AFS includes/libs]),
2329 with_afsdir=$withval
2333 dnl Search in standard places, or --with-afsdir not specified
2335 if test x$with_afsdir = x; then
2336 for root in /usr /usr/local; do
2337 if test -d ${root}/include/afs/ ; then
2341 if test -d ${root}/include/openafs/afs/ ; then
2348 if test -d ${with_afsdir}/include/afs/ ; then
2349 AFS_CFLAGS="-I${with_afsdir}/include"
2351 if test -d ${with_afsdir}/include/openafs/afs/ ; then
2352 AFS_CFLAGS="-I${with_afsdir}/include/openafs"
2356 saved_CFLAGS="${CFLAGS}"
2357 saved_CPPFLAGS="${CPPFLAGS}"
2358 CFLAGS="${AFS_CFLAGS} ${saved_CFLAGS}"
2359 CPPFLAGS="${AFS_CFLAGS} ${saved_CPPFLAGS}"
2361 AC_CHECK_HEADERS(afs/afsint.h)
2364 #include <afs/afsint.h>
2365 #include <afs/venus.h>
2367 AC_DEFINE(HAVE_AFS_VENUS_H,1,[Define to 1 if you have the <afs/venus.h> header file.])
2370 CFLAGS="${saved_CFLAGS}"
2371 CPPFLAGS="${saved_CPPFLAGS}"
2374 dnl See if we can find a libsys with the pioctl symbol in there
2376 AC_MSG_CHECKING(for pioctl in AFS libsys)
2377 for dir in ${with_afsdir}/lib \
2378 ${with_afsdir}/lib/afs \
2379 ${with_afsdir}/lib/openafs \
2380 ${with_afsdir}/lib64 \
2381 ${with_afsdir}/lib64/afs \
2382 ${with_afsdir}/lib64/openafs
2384 for arch_type in .a .so
2386 A=`test -f ${dir}/libsys${arch_type} && nm ${dir}/libsys${arch_type} 2>/dev/null | grep pioctl`
2388 if test $pkg = 0; then
2390 AFS_LIBS="-L${dir} -lsys -lrx -llwp ${dir}/util${arch_type}"
2396 if test $have_afs = yes; then
2402 if test x$support_afs = xyes -a $have_afs != yes; then
2403 AC_MSG_ERROR([afs support explicitly enabled but no supported afs implementation found,
2404 please either load the afs libraries or rerun configure without --enable-afs])
2406 if test $have_afs = yes; then
2407 AC_DEFINE(HAVE_AFS,1,[Define to 1 if your system has AFS support])
2408 AC_DEFINE(HAVE_AFS_ACL,1,[Andrew FileSystem ACL support])
2412 AC_SUBST(AFS_CFLAGS)
2415 dnl ---------------------------------------------------
2416 dnl Check for lzo support/directory (default on)
2417 dnl ---------------------------------------------------
2418 dnl this allows you to turn it completely off
2421 AC_HELP_STRING([--disable-lzo], [disable lzo support @<:@default=yes@:>@]),
2423 if test x$enableval = xno; then
2434 if test x$support_lzo = xyes; then
2436 AC_HELP_STRING([--with-lzo@<:@=DIR@:>@], [specify lzo library directory]),
2443 if test -f ${with_lzo}/include/lzo/lzoconf.h; then
2444 LZO_INC="-I${with_lzo}/include"
2445 LZO_LDFLAGS="-L${with_lzo}/lib"
2446 with_lzo="${with_lzo}/include"
2448 with_lzo="/usr/include"
2451 AC_CHECK_HEADER(${with_lzo}/lzo/lzoconf.h,
2453 AC_DEFINE(HAVE_LZO, 1, [Define to 1 if you have LZO compression])
2454 LZO_LIBS="${LZO_LDFLAGS} -lzo2"
2458 echo "lzoconf.h not found. lzo turned off ..."
2465 AC_CHECK_HEADER(lzo/lzoconf.h,
2467 AC_CHECK_HEADER(lzo/lzo1x.h,
2469 AC_CHECK_LIB(lzo2, lzo1x_1_compress,
2472 AC_DEFINE(HAVE_LZO,1,[Define to 1 if you have LZO compression])
2485 dnl Check for ACL support and libraries
2489 AC_HELP_STRING([--disable-acl], [disable acl support @<:@default=auto@:>@]),
2491 if test x$enableval = xyes; then
2493 elif test x$enableval = xno; then
2500 have_extended_acl=no
2501 if test x$support_acl = xyes -o x$support_acl = xauto; then
2502 AC_CHECK_HEADER(sys/acl.h, [ AC_DEFINE(HAVE_SYS_ACL_H,1,[Defines if your system have the sys/acl.h header file])] , )
2505 dnl First check for acl_get_file in libc
2507 AC_CHECK_FUNC(acl_get_file,
2514 dnl Check for acl_get_file in libacl (Linux)
2516 if test $have_acl = no; then
2517 AC_CHECK_LIB(acl, acl_get_file,
2520 if test $have_afs = yes; then
2522 dnl Because of possible naming conflict with AFS libacl make sure we use the one in /usr/lib64 or /usr/lib !!!
2524 if test -d /usr/lib64/; then
2525 FDLIBS="-L/usr/lib64 -lacl $FDLIBS"
2527 FDLIBS="-L/usr/lib -lacl $FDLIBS"
2530 FDLIBS="-lacl $FDLIBS"
2537 dnl Check for acl_get_file in libpacl (OSF1)
2538 dnl and if ACL_TYPE_DEFAULT_DIR is defined.
2540 if test $have_acl = no -a \
2541 x${HAVE_OSF1_OS_TRUE} = x; then
2542 AC_CHECK_LIB(pacl, acl_get_file,
2545 FDLIBS="-lpacl $FDLIBS"
2549 AC_MSG_CHECKING(for ACL_TYPE_DEFAULT_DIR in acl.h include file)
2550 grep ACL_TYPE_DEFAULT_DIR /usr/include/sys/acl.h > /dev/null 2>&1
2551 if test $? = 0; then
2552 AC_DEFINE(HAVE_ACL_TYPE_DEFAULT_DIR,1,[Defines if your system have the ACL_TYPE_DEFAULT_DIR acl type])
2560 dnl On OSX check for availability of ACL_TYPE_EXTENDED
2562 if test $have_acl = yes -a \
2563 x${HAVE_DARWIN_OS_TRUE} = x; then
2564 AC_MSG_CHECKING(for ACL_TYPE_EXTENDED in acl.h include file)
2565 grep ACL_TYPE_EXTENDED /usr/include/sys/acl.h > /dev/null 2>&1
2566 if test $? = 0; then
2567 AC_DEFINE(HAVE_ACL_TYPE_EXTENDED,1,[Defines if your system have the ACL_TYPE_EXTENDED acl type])
2575 dnl On FreeBSD check for availability of ACL_TYPE_NFS4
2577 if test $have_acl = yes -a \
2578 x${HAVE_FREEBSD_OS_TRUE} = x; then
2579 AC_MSG_CHECKING(for ACL_TYPE_NFS4 in acl.h include file)
2580 grep ACL_TYPE_NFS4 /usr/include/sys/acl.h > /dev/null 2>&1
2581 if test $? = 0; then
2582 AC_DEFINE(HAVE_ACL_TYPE_NFS4,1,[Defines if your system have the ACL_TYPE_NFS4 acl type])
2590 dnl Check for acltotext and acl_totext (Solaris)
2592 if test $have_acl = no -a \
2593 x${HAVE_SUN_OS_TRUE} = x; then
2594 AC_CHECK_LIB(sec, acltotext,
2597 FDLIBS="-lsec $FDLIBS"
2599 AC_CHECK_LIB(sec, acl_totext,
2601 have_extended_acl=yes
2609 dnl Check for acl_get and aclx_get (AIX)
2611 if test $have_acl = no -a \
2612 x${HAVE_AIX_OS_TRUE} = x; then
2613 AC_CHECK_FUNC(acl_get,
2617 AC_CHECK_FUNC(aclx_get,
2619 have_extended_acl=yes
2626 if test x$support_acl = xyes -a $have_acl != yes; then
2627 AC_MSG_ERROR([acl support explicitly enabled but no supported acl implementation found,
2628 please either load the acl libraries or rerun configure without --enable-acl])
2630 if test $have_acl = yes; then
2631 AC_DEFINE([HAVE_ACL],1,[Normal acl support])
2634 if test $have_extended_acl = yes; then
2635 AC_DEFINE([HAVE_EXTENDED_ACL],1,[Extended acl support])
2641 dnl Check for XATTR support
2644 AC_ARG_ENABLE(xattr,
2645 AC_HELP_STRING([--disable-xattr], [disable xattr support @<:@default=auto@:>@]),
2647 if test x$enableval = xyes; then
2649 elif test x$enableval = xno; then
2656 if test x$support_xattr = xyes -o x$support_xattr = xauto; then
2658 dnl First check for *BSD support
2659 dnl When running on a BSD variant
2661 if test x${HAVE_FREEBSD_OS_TRUE} = x -o \
2662 x${HAVE_NETBSD_OS_TRUE} = x -o \
2663 x${HAVE_OPENBSD_OS_TRUE} = x; then
2664 AC_CHECK_HEADER(sys/extattr.h, [ AC_DEFINE(HAVE_SYS_EXTATTR_H,1,[Defines if your system have the sys/extattr.h header file])] , )
2665 AC_CHECK_HEADER(libutil.h, [ AC_DEFINE(HAVE_LIBUTIL_H,1,[Defines if your system have the libutil.h header file])] , )
2666 AC_CHECK_FUNCS(extattr_get_link extattr_set_link extattr_list_link,
2669 AC_DEFINE([HAVE_EXTATTR_GET_LINK],1,[Define to 1 if you have the 'extattr_get_link' function.])
2670 AC_DEFINE([HAVE_EXTATTR_SET_LINK],1,[Define to 1 if you have the 'extattr_set_link' function.])
2671 AC_DEFINE([HAVE_EXTATTR_LIST_LINK],1,[Define to 1 if you have the 'extattr_list_link' function.])
2675 if test $have_xattr = no; then
2676 AC_CHECK_FUNCS(extattr_get_file extattr_set_file extattr_list_file,
2679 AC_DEFINE([HAVE_EXTATTR_GET_FILE],1,[Define to 1 if you have the 'extattr_get_file' function.])
2680 AC_DEFINE([HAVE_EXTATTR_SET_FILE],1,[Define to 1 if you have the 'extattr_set_file' function.])
2681 AC_DEFINE([HAVE_EXTATTR_LIST_FILE],1,[Define to 1 if you have the 'extattr_list_file' function.])
2686 if test $have_xattr = yes; then
2687 have_extattr_string_in_libc=no
2688 AC_CHECK_FUNCS(extattr_namespace_to_string extattr_string_to_namespace,
2690 have_extattr_string_in_libc=yes
2691 AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2692 AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2697 dnl If extattr_namespace_to_string and extattr_string_to_namespace are not in libc see if they are in libutil
2699 if test $have_extattr_string_in_libc = no; then
2700 AC_CHECK_LIB(util, extattr_namespace_to_string extattr_string_to_namespace,
2702 AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2703 AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2704 FDLIBS="-lutil $FDLIBS"
2712 dnl If we failed to find *BSD support try the AIX implementation of extented attributes (EA)
2713 dnl When running on AIX
2715 if test $have_xattr = no -a \
2716 x${HAVE_AIX_OS_TRUE} = x; then
2717 AC_CHECK_HEADER(sys/ea.h, [ AC_DEFINE(HAVE_SYS_EA_H,1,[Defines if your system have the sys/ea.h header file])] , )
2718 AC_CHECK_FUNCS(llistea lgetea lsetea,
2721 AC_DEFINE([HAVE_LLISTEA],1,[Define to 1 if you have the 'llistea' function.])
2722 AC_DEFINE([HAVE_LGETEA],1,[Define to 1 if you have the 'lgetea' function.])
2723 AC_DEFINE([HAVE_LSETEA],1,[Define to 1 if you have the 'lsetea' function.])
2727 if test $have_xattr = no; then
2728 AC_CHECK_FUNCS(listea getea setea,
2731 AC_DEFINE([HAVE_LISTEA],1,[Define to 1 if you have the 'listea' function.])
2732 AC_DEFINE([HAVE_GETEA],1,[Define to 1 if you have the 'getea' function.])
2733 AC_DEFINE([HAVE_SETEA],1,[Define to 1 if you have the 'setea' function.])
2740 dnl If we failed to find AIX support try the TRU64 implementation of extented attributes
2741 dnl when running on a TRU64 OS.
2743 if test $have_xattr = no -a \
2744 x${HAVE_OSF1_OS_TRUE} = x; then
2745 AC_CHECK_HEADER(sys/proplist.h, [ AC_DEFINE(HAVE_SYS_PROPLIST_H,1,[Defines if your system have the sys/proplist.h header file])] , )
2746 AC_CHECK_FUNCS(getproplist get_proplist_entry sizeof_proplist_entry add_proplist_entry setproplist,
2749 AC_DEFINE([HAVE_GETPROPLIST],1,[Define to 1 if you have the 'getproplist' function.])
2750 AC_DEFINE([HAVE_GET_PROPLIST_ENTRY],1,[Define to 1 if you have the 'get_proplist_entry' function.])
2751 AC_DEFINE([HAVE_SIZEOF_PROPLIST_ENTRY],1,[Define to 1 if you have the 'sizeof_proplist_entry' function.])
2752 AC_DEFINE([HAVE_ADD_PROPLIST_ENTRY],1,[Define to 1 if you have the 'add_proplist_entry' function.])
2753 AC_DEFINE([HAVE_SETPROPLIST],1,[Define to 1 if you have the 'setproplist' function.])
2759 dnl If we failed to find TRU64 support try the SOLARIS implementation of extented and extensible attributes
2760 dnl when running on a Solaris.
2762 if test $have_xattr = no -a \
2763 x${HAVE_SUN_OS_TRUE} = x; then
2764 AC_CHECK_HEADER(sys/attr.h, [ AC_DEFINE(HAVE_SYS_ATTR_H,1,[Defines if your system have the sys/attr.h header file])] , )
2765 AC_CHECK_HEADER(sys/nvpair.h, [ AC_DEFINE(HAVE_SYS_NVPAIR_H,1,[Defines if your system have the sys/nvpair.h header file])] , )
2766 AC_CHECK_HEADER(attr.h, [ AC_DEFINE(HAVE_ATTR_H,1,[Defines if your system have the attr.h header file])] , )
2768 AC_CHECK_FUNCS(openat fstatat unlinkat fchownat futimesat,
2771 AC_DEFINE([HAVE_OPENAT],1,[Define to 1 if you have the 'openat' function.])
2772 AC_DEFINE([HAVE_FSTATAT],1,[Define to 1 if you have the 'fstatat' function.])
2773 AC_DEFINE([HAVE_UNLINKAT],1,[Define to 1 if you have the 'unlinkat' function.])
2774 AC_DEFINE([HAVE_FCHOWNAT],1,[Define to 1 if you have the 'fchownat' function.])
2775 AC_DEFINE([HAVE_FUTIMESAT],1,[Define to 1 if you have the 'futimesat' function.])
2779 if test $have_xattr = yes; then
2780 AC_CHECK_LIB(nvpair, nvlist_next_nvpair,
2782 AC_DEFINE([HAVE_NVLIST_NEXT_NVPAIR],1,[Define to 1 if you have the 'nvlist_next_nvpair' function.])
2783 FDLIBS="-lnvpair $FDLIBS"
2790 dnl If we failed to find Solaris support try the generic xattr support code
2792 if test $have_xattr = no; then
2793 AC_CHECK_HEADER(sys/xattr.h, [ AC_DEFINE(HAVE_SYS_XATTR_H,1,[Defines if your system have the sys/xattr.h header file])] , )
2794 AC_CHECK_FUNCS(llistxattr lgetxattr lsetxattr,
2797 AC_DEFINE([HAVE_LLISTXATTR],1,[Define to 1 if you have the 'llistxattr' function.])
2798 AC_DEFINE([HAVE_LGETXATTR],1,[Define to 1 if you have the 'lgetxattr' function.])
2799 AC_DEFINE([HAVE_LSETXATTR],1,[Define to 1 if you have the 'lsetxattr' function.])
2803 if test $have_xattr = no; then
2804 AC_CHECK_FUNCS(listxattr getxattr setxattr,
2807 AC_DEFINE([HAVE_LISTXATTR],1,[Define to 1 if you have the 'listxattr' function.])
2808 AC_DEFINE([HAVE_GETXATTR],1,[Define to 1 if you have the 'getxattr' function.])
2809 AC_DEFINE([HAVE_SETXATTR],1,[Define to 1 if you have the 'setxattr' function.])
2815 if test x$support_xattr = xyes -a $have_xattr != yes; then
2816 AC_MSG_ERROR([xattr support explicitly enabled but no supported xattr implementation found,
2817 please either load the xattr libraries or rerun configure without --enable-xattr])
2819 if test $have_xattr = yes; then
2820 AC_DEFINE([HAVE_XATTR],1,[Extended Attributes support])
2826 dnl Check for pthread libraries
2829 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
2831 AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
2833 AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
2835 AC_CHECK_FUNC(pthread_create)
2844 dnl Check for headers, functions and libraries required to support
2845 dnl keeping readall capabilities
2847 AC_CHECK_HEADERS(sys/prctl.h sys/capability.h)
2848 AC_CHECK_FUNCS(prctl setreuid)
2849 AC_CHECK_LIB([cap], [cap_set_proc], [CAP_LIBS="-lcap"], [CAP_LIBS=])
2850 if test x$CAP_LIBS = x-lcap; then
2851 AC_DEFINE(HAVE_LIBCAP, 1, [Define if you have libcap])
2860 if test x$have_gcc = xyes ; then
2861 CPPFLAGS="$CPPFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
2862 CFLAGS="$CFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
2864 LDFLAGS=${LDFLAGS--O}
2865 CPPFLAGS="$CPPFLAGS"
2877 AC_SUBST(X_EXTRA_LIBS)
2882 dnl extra configurable objects
2893 dnl Finally we set appropriate distribution specific
2894 dnl variables and defaults
2896 dnl PFILES are platform specific files
2897 PFILES="platforms/Makefile"
2900 COMPRESS_MANPAGES=yes
2905 PSCMD="ps -e -o pid,comm"
2907 platforms/aix/Makefile"
2908 TAPEDRIVE="/dev/rmt0.1"
2912 PTHREAD_LIB="-lpthread -lexc"
2913 if test "${CC}" = "gcc" ; then
2920 TAPEDRIVE="/dev/nrmt0"
2923 DISTVER=`uname -a |awk '{print $3}'`
2924 TAPEDRIVE="/dev/nrmt0"
2925 PTHREAD_LIB="-pthread"
2926 CFLAGS="${CFLAGS} -pthread"
2927 PSCMD="ps -ax -o pid,command"
2931 platforms/bsdi/Makefile \
2932 platforms/bsdi/bacula-fd \
2933 platforms/bsdi/bacula-sd \
2934 platforms/bsdi/bacula-dir"
2935 largefile_support="yes"
2939 TAPEDRIVE="/dev/nst0"
2940 PSCMD="ps -e -o pid,command"
2943 platforms/darwin/Makefile"
2947 TAPEDRIVE="/dev/nst0"
2948 PSCMD="ps -e -o pid,command"
2951 platforms/osx/Makefile"
2954 if `test -f /etc/apt/sources.list && grep -q ubuntu /etc/apt/sources.list`; then
2957 DISTVER=`cat /etc/debian_version`
2958 if test -f /etc/lsb-release ; then
2960 if test "x$DISTRIB_ID" != "x" ; then
2961 DISTNAME=$DISTRIB_ID
2963 if test "x$DISTRIB_RELEASE" != "x" ; then
2964 DISTVER=$DISTRIB_RELEASE
2967 if test "$DISTNAME" = "Ubuntu" ; then
2970 TAPEDRIVE="/dev/nst0"
2971 PSCMD="ps -e -o pid,command"
2972 if test "$DISTNAME" = "ubuntu" ; then
2974 platforms/ubuntu/Makefile \
2975 platforms/ubuntu/bacula-fd \
2976 platforms/ubuntu/bacula-sd \
2977 platforms/ubuntu/bacula-dir"
2980 platforms/debian/Makefile \
2981 platforms/debian/bacula-fd \
2982 platforms/debian/bacula-sd \
2983 platforms/debian/bacula-dir"
2987 DISTVER=`uname -a |awk '{print $3}'`
2988 VER=`echo $DISTVER | cut -c 1`
2989 if test x$VER = x4 ; then
2990 PTHREAD_LIB="${PTHREAD_LIBS:--pthread}"
2991 CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS:--pthread}"
2995 TAPEDRIVE="/dev/nrsa0"
2996 PSCMD="ps -ax -o pid,command"
2998 platforms/freebsd/Makefile \
2999 platforms/freebsd/bacula-fd \
3000 platforms/freebsd/bacula-sd \
3001 platforms/freebsd/bacula-dir"
3002 largefile_support="yes"
3006 TAPEDRIVE="/dev/nst0"
3007 PSCMD="ps -e -o pid,command"
3009 platforms/hurd/Makefile \
3010 platforms/hurd/bacula-fd \
3011 platforms/hurd/bacula-sd \
3012 platforms/hurd/bacula-dir"
3015 PSCMD="UNIX95=1; ps -e -o pid,comm"
3016 CFLAGS="${CFLAGS} -D_XOPEN_SOURCE_EXTENDED=1"
3018 TAPEDRIVE="/dev/rmt/0hnb"
3019 PTHREAD_LIB="-lpthread"
3020 AC_DEFINE([_INCLUDE_LONGLONG])
3024 TAPEDRIVE="/dev/rmt/0cbn"
3025 PSCMD="ps -e -o pid,comm"
3027 platforms/irix/Makefile \
3028 platforms/irix/bacula-fd \
3029 platforms/irix/bacula-sd \
3030 platforms/irix/bacula-dir"
3033 DISTVER=`uname -a |awk '{print $3}'`
3036 TAPEDRIVE="/dev/nrst0"
3037 PSCMD="ps -ax -o pid,command"
3038 PTHREAD_LIB="-pthread"
3039 CFLAGS="${CFLAGS} -pthread"
3042 DISTVER=`uname -a |awk '{print $3}'`
3045 TAPEDRIVE="/dev/nrst0"
3046 PSCMD="ps -ax -o pid,command"
3047 PTHREAD_LIB="-pthread"
3048 CFLAGS="${CFLAGS} -pthread"
3050 platforms/openbsd/Makefile \
3051 platforms/openbsd/bacula-fd \
3052 platforms/openbsd/bacula-sd \
3053 platforms/openbsd/bacula-dir"
3056 if test -f /etc/whitebox-release ; then
3057 f=/etc/whitebox-release
3059 f=/etc/redhat-release
3061 if test `cat $f | grep release |\
3062 cut -f 3 -d ' '`x = "Enterprise"x ; then
3063 DISTVER="Enterprise "`cat $f | grep release |\
3066 DISTVER=`cat /etc/redhat-release | grep release |\
3069 TAPEDRIVE="/dev/nst0"
3070 PSCMD="ps -e -o pid,command"
3072 platforms/redhat/Makefile \
3073 platforms/redhat/bacula-fd \
3074 platforms/redhat/bacula-sd \
3075 platforms/redhat/bacula-dir
3079 DISTVER=`cat /etc/mandrake-release | grep release |\
3081 TAPEDRIVE="/dev/nst0"
3082 PSCMD="ps -e -o pid,command"
3084 platforms/mandrake/Makefile \
3085 platforms/mandrake/bacula-fd \
3086 platforms/mandrake/bacula-sd \
3087 platforms/mandrake/bacula-dir \
3091 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
3092 TAPEDRIVE="/dev/nst0"
3093 PSCMD="ps -e -o pid,command"
3095 platforms/gentoo/Makefile \
3096 platforms/gentoo/bacula-init \
3097 platforms/gentoo/bacula-fd \
3098 platforms/gentoo/bacula-sd \
3099 platforms/gentoo/bacula-dir"
3102 DISTVER=`cat /etc/slackware-version`
3103 TAPEDRIVE="/dev/nst0"
3104 PSCMD="ps -e -o pid,command"
3106 platforms/slackware/Makefile \
3107 platforms/slackware/rc.bacula-fd \
3108 platforms/slackware/rc.bacula-sd \
3109 platforms/slackware/rc.bacula-dir\
3110 platforms/slackware/functions.bacula"
3114 TAPEDRIVE="/dev/rmt/0cbn"
3115 PSCMD="ps -e -o pid,comm"
3117 platforms/solaris/Makefile \
3118 platforms/solaris/bacula-fd \
3119 platforms/solaris/bacula-sd \
3120 platforms/solaris/bacula-dir"
3124 AC_DEFINE(HAVE_OLD_SOCKOPT)
3125 AC_DEFINE(USE_THR_SETCONCURRENCY)
3128 AC_DEFINE(USE_THR_SETCONCURRENCY)
3133 LIBS="$LIBS -lresolv -lrt"
3136 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
3138 TAPEDRIVE="/dev/nst0"
3139 PSCMD="ps -e -o pid,command"
3141 platforms/suse/Makefile \
3142 platforms/suse/bacula-fd \
3143 platforms/suse/bacula-sd \
3144 platforms/suse/bacula-dir \
3145 platforms/suse/bacula"
3150 TAPEDRIVE="/dev/nst0"
3151 PSCMD="ps -e -o pid,command"
3153 platforms/suse/Makefile \
3154 platforms/suse/bacula-fd \
3155 platforms/suse/bacula-sd \
3156 platforms/suse/bacula-dir"
3160 TAPEDRIVE="/dev/nst0"
3163 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
3167 dnl -------------------------------------------
3168 dnl systemd (default off)
3169 dnl -------------------------------------------
3170 AC_MSG_CHECKING(for systemd support)
3171 AC_ARG_WITH(systemd,
3172 AC_HELP_STRING([--with-systemd@<:@=UNITDIR@:>@], [Include systemd support. UNITDIR is where systemd system .service files are located, default is to ask systemctl.]),
3174 if test "$withval" != "no"; then
3175 if test "$withval" = "yes"; then
3176 SYSTEMD_UNITDIR="`systemctl show | grep UnitPath | cut -d " " -f2`"
3178 SYSTEMD_UNITDIR="${withval}"
3182 platforms/systemd/Makefile \
3183 platforms/systemd/bacula.conf \
3184 platforms/systemd/bacula-dir.service \
3185 platforms/systemd/bacula-fd.service \
3186 platforms/systemd/bacula-sd.service"
3187 AC_DEFINE(HAVE_SYSTEMD, 1, [Define to 1 if systemd support should be enabled])
3189 support_systemd="yes"
3192 support_systemd="no"
3195 support_systemd="no"
3199 AC_SUBST(SYSTEMD_UNITDIR)
3203 LIBS="$PTHREAD_LIB $LIBS"
3205 AC_DEFINE_UNQUOTED(lld, "$lld")
3206 AC_DEFINE_UNQUOTED(llu, "$llu")
3212 AC_SUBST(COMPRESS_MANPAGES)
3214 dnl common parts of the Makefile
3215 MCOMMON=./autoconf/Make.common
3216 AC_SUBST_FILE(MCOMMON)
3219 if test "x${subsysdir}" = "x${sbindir}" ; then
3222 echo "You have set both --sbindir and --with-subsys-dir"
3223 echo " equal to: ${subsysdir} "
3224 echo "This is not permitted. Please reconfigure."
3226 echo "Aborting configuration ..."
3232 AC_OUTPUT([autoconf/Make.common \
3235 scripts/btraceback \
3238 scripts/bacula-ctl-dir \
3239 scripts/bacula-ctl-fd \
3240 scripts/bacula-ctl-sd \
3241 scripts/devel_bacula \
3244 scripts/mtx-changer \
3245 scripts/disk-changer \
3246 scripts/dvd-handler \
3247 scripts/dvd-simulator \
3248 scripts/logwatch/Makefile \
3249 scripts/logwatch/logfile.bacula.conf \
3250 scripts/bat.desktop \
3251 scripts/bat.desktop.xsu \
3252 scripts/bat.desktop.consolehelper \
3253 scripts/bat.console_apps \
3256 src/console/Makefile \
3257 src/console/bconsole.conf \
3258 src/qt-console/bat.conf \
3259 src/qt-console/bat.pro \
3260 src/qt-console/bat.pro.mingw32 \
3261 src/qt-console/install_conf_file \
3263 src/dird/bacula-dir.conf \
3265 src/stored/Makefile \
3266 src/stored/bacula-sd.conf \
3267 src/filed/Makefile \
3268 src/filed/bacula-fd.conf \
3270 src/cats/make_catalog_backup.pl \
3271 src/cats/make_catalog_backup \
3272 src/cats/delete_catalog_backup \
3273 src/cats/create_postgresql_database \
3274 src/cats/update_postgresql_tables \
3275 src/cats/make_postgresql_tables \
3276 src/cats/grant_postgresql_privileges \
3277 src/cats/drop_postgresql_tables \
3278 src/cats/drop_postgresql_database \
3279 src/cats/create_mysql_database \
3280 src/cats/update_mysql_tables \
3281 src/cats/make_mysql_tables \
3282 src/cats/grant_mysql_privileges \
3283 src/cats/drop_mysql_tables \
3284 src/cats/drop_mysql_database \
3285 src/cats/create_sqlite3_database \
3286 src/cats/update_sqlite3_tables \
3287 src/cats/make_sqlite3_tables \
3288 src/cats/grant_sqlite3_privileges \
3289 src/cats/drop_sqlite3_tables \
3290 src/cats/drop_sqlite3_database \
3293 src/cats/create_bacula_database \
3294 src/cats/update_bacula_tables \
3295 src/cats/grant_bacula_privileges \
3296 src/cats/make_bacula_tables \
3297 src/cats/drop_bacula_tables \
3298 src/cats/drop_bacula_database \
3299 src/cats/install-default-backend \
3300 src/findlib/Makefile \
3301 src/tools/Makefile \
3302 src/plugins/fd/Makefile \
3303 src/plugins/sd/Makefile \
3304 src/plugins/dir/Makefile \
3306 updatedb/update_mysql_tables_9_to_10 \
3307 updatedb/update_sqlite3_tables_9_to_10 \
3308 updatedb/update_postgresql_tables_9_to_10 \
3309 updatedb/update_mysql_tables_10_to_11 \
3310 updatedb/update_sqlite3_tables_10_to_11 \
3311 updatedb/update_postgresql_tables_10_to_11 \
3312 updatedb/update_mysql_tables_11_to_12 \
3313 updatedb/update_sqlite3_tables_11_to_12 \
3314 updatedb/update_postgresql_tables_11_to_12 \
3315 updatedb/update_mysql_tables_12_to_14 \
3316 updatedb/update_sqlite3_tables_12_to_14 \
3317 updatedb/update_postgresql_tables_12_to_14 \
3318 examples/nagios/check_bacula/Makefile \
3319 platforms/rpms/redhat/bacula.spec \
3320 platforms/rpms/redhat/bacula-bat.spec \
3321 platforms/rpms/redhat/bacula-docs.spec \
3322 platforms/rpms/redhat/bacula-mtx.spec \
3323 platforms/rpms/suse/bacula.spec \
3324 platforms/rpms/suse/bacula-bat.spec \
3325 platforms/rpms/suse/bacula-docs.spec \
3326 platforms/rpms/suse/bacula-mtx.spec \
3331 if test "${support_bat}" = "yes" ; then
3332 if test "x$QMAKE" = "xnone"; then
3333 AC_MSG_ERROR([Could not find qmake $PATH. Check your Qt installation])
3337 echo "Creating bat Makefile"
3348 dnl if CC is gcc, we can rebuild the dependencies (since the depend rule
3349 dnl requires gcc). If it's not, don't rebuild dependencies
3351 if test X"$GCC" = "Xyes" ; then
3352 echo "Doing make of dependencies"
3353 ${MAKE:-make} depend
3357 chmod 755 install_conf_file build-depkgs-qt-console
3361 chmod 755 bacula btraceback mtx-changer storage-ctl bsg_persist
3362 chmod 755 dvd-handler dvd-simulator
3363 chmod 755 bconsole disk-changer devel_bacula logrotate
3367 chmod 755 $c/update_mysql_tables_10_to_11 $c/update_sqlite3_tables_10_to_11
3368 chmod 755 $c/update_postgresql_tables_10_to_11
3369 chmod 755 $c/update_mysql_tables_11_to_12 $c/update_sqlite3_tables_11_to_12
3370 chmod 755 $c/update_postgresql_tables_11_to_12
3375 chmod 755 $c/create_bacula_database $c/update_bacula_tables $c/make_bacula_tables
3376 chmod 755 $c/grant_bacula_privileges $c/drop_bacula_tables $c/drop_bacula_database
3378 chmod 755 $c/create_mysql_database $c/update_mysql_tables $c/make_mysql_tables
3379 chmod 755 $c/grant_mysql_privileges $c/drop_mysql_tables $c/drop_mysql_database
3381 chmod 755 $c/create_sqlite3_database $c/update_sqlite3_tables $c/make_sqlite3_tables
3382 chmod 755 $c/grant_sqlite3_privileges $c/drop_sqlite3_tables $c/drop_sqlite3_database
3384 chmod 755 $c/create_postgresql_database $c/update_postgresql_tables $c/make_postgresql_tables
3385 chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables $c/drop_postgresql_database
3387 #chmod 755 $c/create_ingres_database $c/update_ingres_tables $c/make_ingres_tables
3388 #chmod 755 $c/grant_ingres_privileges $c/drop_ingres_tables $c/drop_ingres_database
3391 chmod 755 $c/make_catalog_backup $c/delete_catalog_backup $c/make_catalog_backup.pl
3395 chmod 755 $c/install-default-backend
3397 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
3398 largefile_support="yes"
3401 dnl Only try to find out the version number of the compiler when we know its some kind of GCC compiler
3402 if test X"$GCC" = "Xyes" ; then
3404 dnl A whole lot of hand springs to get the compiler version.
3405 dnl This is because gcc changed the output in version 3.0
3407 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3408 if test "x${CCVERSION}" = "x" ; then
3409 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3411 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3412 if test x"${CXXVERSION}" = x ; then
3413 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3417 # clean up any old junk
3424 Configuration on `date`:
3426 Host: ${host}${post_host} -- ${DISTNAME} ${DISTVER}
3427 Bacula version: ${BACULA} ${VERSION} (${DATE})
3428 Source code location: ${srcdir}
3429 Install binaries: ${sbindir}
3430 Install libraries: ${libdir}
3431 Install config files: ${sysconfdir}
3432 Scripts directory: ${scriptdir}
3433 Archive directory: ${archivedir}
3434 Working directory: ${working_dir}
3435 PID directory: ${piddir}
3436 Subsys directory: ${subsysdir}
3437 Man directory: ${mandir}
3438 Data directory: ${datarootdir}
3439 Plugin directory: ${plugindir}
3440 C Compiler: ${CC} ${CCVERSION}
3441 C++ Compiler: ${CXX} ${CXXVERSION}
3442 Compiler flags: ${WCFLAGS} ${CFLAGS}
3443 Linker flags: ${WLDFLAGS} ${LDFLAGS}
3445 Statically Linked Tools: ${support_static_tools}
3446 Statically Linked FD: ${support_static_fd}
3447 Statically Linked SD: ${support_static_sd}
3448 Statically Linked DIR: ${support_static_dir}
3449 Statically Linked CONS: ${support_static_cons}
3450 Database backends: ${db_backends}
3451 Database port: ${db_port}
3452 Database name: ${db_name}
3453 Database user: ${db_user}
3455 Job Output Email: ${job_email}
3456 Traceback Email: ${dump_email}
3457 SMTP Host Address: ${smtp_host}
3459 Director Port: ${dir_port}
3460 File daemon Port: ${fd_port}
3461 Storage daemon Port: ${sd_port}
3463 Director User: ${dir_user}
3464 Director Group: ${dir_group}
3465 Storage Daemon User: ${sd_user}
3466 Storage DaemonGroup: ${sd_group}
3467 File Daemon User: ${fd_user}
3468 File Daemon Group: ${fd_group}
3470 Large file support: $largefile_support
3471 Bacula conio support: ${got_conio} ${CONS_LIBS}
3472 readline support: ${got_readline} ${PRTREADLINE_SRC}
3473 TCP Wrappers support: ${TCPW_MSG} ${WRAPLIBS}
3474 TLS support: ${support_tls}
3475 Encryption support: ${support_crypto}
3476 ZLIB support: ${have_zlib}
3477 LZO support: ${have_lzo}
3478 enable-smartalloc: ${support_smartalloc}
3479 enable-lockmgr: ${support_lockmgr}
3480 bat support: ${support_bat}
3481 client-only: ${build_client_only}
3482 build-dird: ${build_dird}
3483 build-stored: ${build_stored}
3484 Plugin support: ${have_plugins}
3485 AFS support: ${have_afs}
3486 ACL support: ${have_acl}
3487 XATTR support: ${have_xattr}
3488 systemd support: ${support_systemd} ${SYSTEMD_UNITDIR}
3489 Batch insert enabled: ${batch_insert_db_backends}
3493 # create a small shell script useful for support with
3494 # configure options and config.out info
3495 cat > scripts/bacula_config << EOF
3498 $ $0 $ac_configure_args
3500 cat config.out >> scripts/bacula_config
3501 echo __EOC__ >> scripts/bacula_config
3502 chmod 755 scripts/bacula_config