3 dnl Process this file with autoconf to produce a configure script.
5 dnl require a recent autoconf
7 AC_INIT([bacula], m4_esyscmd([sed -n -e 's/^#define VERSION.*"\(.*\)"$/\1/p' ../src/version.h src/version.h 2> /dev/null | tr -d '\n']))
8 AC_CONFIG_SRCDIR(src/version.h)
16 AC_CONFIG_AUX_DIR(${BUILD_DIR}/autoconf)
17 AC_CONFIG_HEADERS(src/config.h:autoconf/config.h.in)
19 dnl search for true and false programs.
20 AC_PATH_PROGS(TRUEPRG, true, :)
21 AC_PATH_PROGS(FALSEPRG, false, :)
26 if test "x$BACULA" != x; then
27 post_host=`echo -${BACULA} | tr 'A-Z ' 'a-z-'`
29 BACULA=${BACULA:-Bacula}
30 VERSION=`sed -n -e 's/^#define VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
31 RELEASE=`sed -n -e 's/^#define RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
32 DATE=`sed -n -e 's/^#define BDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
33 LSMDATE=`sed -n -e 's/^#define LSMDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
34 BDB_VERSION=`sed -n -e 's/^#define BDB_VERSION \(.*\)$/\1/p' ${srcdir}/src/cats/cats.h`
35 DEPKGS_VERSION=`sed -n -e 's/^#define DEPKGS_VERSION \(.*\)$/\1/p' ${srcdir}/src/cats/cats.h`
36 DEPKGS_QT_VERSION=`sed -n -e 's/^#define DEPKGS_QT_VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
37 BQT_VERSION=`sed -n -e 's/^#define BQT_VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
42 AC_SUBST(post_host)dnl
43 AC_SUBST(BDB_VERSION)dnl
44 AC_SUBST(DEPKGS_QT_VERSION)dnl
45 AC_SUBST(DEPKGS_VERSION)dnl
46 AC_SUBST(BQT4_VERSION)dnl
49 dnl can be overwritten by specific values from version.h
50 LIBBAC_LT_RELEASE=`sed -n -e 's/^#.*LIBBAC_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
51 LIBBACCFG_LT_RELEASE=`sed -n -e 's/^#.*LIBBACCFG_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
52 LIBBACPY_LT_RELEASE=`sed -n -e 's/^#.*LIBBACPY_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
54 LIBBAC_LT_RELEASE=${LIBBAC_LT_RELEASE:-$VERSION}
55 LIBBACCFG_LT_RELEASE=${LIBBACCFG_LT_RELEASE:-$VERSION}
56 LIBBACPY_LT_RELEASE=${LIBBACPY_LT_RELEASE:-$VERSION}
58 AC_SUBST(LIBBAC_LT_RELEASE)dnl
59 AC_SUBST(LIBBACCFG_LT_RELEASE)dnl
60 AC_SUBST(LIBBACPY_LT_RELEASE)dnl
63 dnl can be overwritten by specific values from version.h
64 LIBBACSQL_LT_RELEASE=`sed -n -e 's/^#.*LIBBACSQL_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
65 LIBBACCATS_LT_RELEASE=`sed -n -e 's/^#.*LIBBACCATS_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
67 LIBBACSQL_LT_RELEASE=${LIBBACSQL_LT_RELEASE:-$VERSION}
68 LIBBACCATS_LT_RELEASE=${LIBBACCATS_LT_RELEASE:-$VERSION}
70 AC_SUBST(LIBBACSQL_LT_RELEASE)dnl
71 AC_SUBST(LIBBACCATS_LT_RELEASE)dnl
74 dnl can be overwritten by specific values from version.h
75 LIBBACFIND_LT_RELEASE=`sed -n -e 's/^#.*LIBBACFIND_LT_RELEASE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
77 LIBBACFIND_LT_RELEASE=${LIBBACFIND_LT_RELEASE:-$VERSION}
79 AC_SUBST(LIBBACFIND_LT_RELEASE)dnl
81 echo "configuring for ${BACULA} $VERSION ($DATE)"
84 dnl -------------------------------------------------------
85 dnl Check for compiler.
86 dnl ------------------------------------------------------
90 AC_PROG_CC_C_O dnl Determine if C compiler support -c -o.
91 AC_PROG_GCC_TRADITIONAL dnl Determine if ioctl() need -traditional.
95 if test "x$BASECC" = xgcc; then
99 AC_PATH_PROG(CXX, $CXX, $CXX)
100 if test ! -e $CXX; then
101 AC_MSG_ERROR(Unable to find C++ compiler)
104 dnl -------------------------------------------------------
105 dnl Check for programs.
106 dnl ------------------------------------------------------
108 AC_PATH_PROG(MV, mv, mv)
110 dnl If we name the variable RM it will shadow the RM variable in the configure script and we overwrite the
111 dnl value with the name of the rm command and not rm -f which is its normal content. This gives all kind
112 dnl of strange output of the configure script (like things don't exist etc.).
113 dnl So we name it REMOVE (more software has run into this problem)
114 AC_PATH_PROG(REMOVE, rm, rm)
115 AC_PATH_PROG(CP, cp, cp)
116 AC_PATH_PROG(SED, sed, sed)
117 AC_PATH_PROG(ECHO, echo, echo)
118 AC_PATH_PROG(CMP, cmp, cmp)
119 AC_PATH_PROG(TBL, tbl, tbl)
120 AC_PATH_PROG(AR, ar, ar)
121 AC_PATH_PROG(OPENSSL, openssl, none)
122 AC_PATH_PROG(MTX, mtx, mtx)
123 AC_PATH_PROG(DD, dd, dd)
124 AC_PATH_PROG(MKISOFS, mkisofs, mkisofs)
125 AC_PATH_PROG(GROWISOFS, growisofs, growisofs)
126 AC_PATH_PROG(DVDRWMEDIAINFO, dvd+rw-mediainfo, dvd+rw-mediainfo)
127 AC_PATH_PROG(DVDRWFORMAT, dvd+rw-format, dvd+rw-format)
128 AC_PATH_PROG(PKGCONFIG, pkg-config, pkg-config)
129 AC_PATH_PROG(QMAKE, qmake, none)
130 AC_PATH_PROG(GMAKE, gmake, none)
131 AC_PATH_PROG(CDRECORD, cdrecord, cdrecord)
132 AC_PATH_PROG(PIDOF, pidof, pidof)
134 # Some AWK programs fail, so test it and warn the user
135 if echo xfoo | $AWK 'BEGIN { prog=ARGV[1]; ARGC=1 }
136 { if ((prog == $2) || (("(" prog ")") == $2) ||
137 (("[" prog "]") == $2) ||
138 ((prog ":") == $2)) { print $1 ; exit 0 } }' xfoo>/dev/null; then :;
140 AC_MSG_ERROR([!!!!!!!!! WARNING !!!!!!!!!!!!!!
141 The regex engine of $AWK is too broken to be used you
142 might want to install GNU AWK.
143 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!])
146 AC_PATH_PROG(AWK, $THE_AWK, $THE_AWK)
149 test -n "$ARFLAG" || ARFLAGS="cr"
156 AC_SUBST(LOCAL_CFLAGS)
157 AC_SUBST(LOCAL_LDFLAGS)
160 dnl --------------------------------------------------
162 dnl --------------------------------------------------
164 AC_ARG_ENABLE(libtool,
165 AC_HELP_STRING([--enable-libtool], [enable building using GNU libtool @<:@default=yes@:>@]),
167 if test x$enableval = xno; then
172 LT_INIT([shared disable-static])
176 if test x$use_libtool != xno; then
177 DEFAULT_OBJECT_TYPE=".lo"
178 DEFAULT_ARCHIVE_TYPE=".la"
179 DEFAULT_SHARED_OBJECT_TYPE=".la"
180 LIBTOOL="\$(LIBTOOL)"
181 LIBTOOL_INSTALL_TARGET="libtool-install"
182 LIBTOOL_UNINSTALL_TARGET="libtool-uninstall"
183 LIBTOOL_CLEAN_TARGET="libtool-clean"
184 QMAKE_LIBTOOL="${BUILD_DIR}/libtool"
185 FD_PLUGIN_DIR="src/plugins/fd"
188 DEFAULT_OBJECT_TYPE=".o"
189 DEFAULT_ARCHIVE_TYPE=".a"
190 DEFAULT_SHARED_OBJECT_TYPE=".so"
191 LIBTOOL="# \$(LIBTOOL)"
192 LIBTOOL_INSTALL_TARGET=""
193 LIBTOOL_UNINSTALL_TARGET=""
194 LIBTOOL_CLEAN_TARGET=""
195 QMAKE_LIBTOOL="# ${BUILD_DIR}/libtool"
200 AC_SUBST(DEFAULT_OBJECT_TYPE)
201 AC_SUBST(DEFAULT_ARCHIVE_TYPE)
202 AC_SUBST(DEFAULT_SHARED_OBJECT_TYPE)
204 AC_SUBST(LIBTOOL_INSTALL_TARGET)
205 AC_SUBST(LIBTOOL_UNINSTALL_TARGET)
206 AC_SUBST(LIBTOOL_CLEAN_TARGET)
207 AC_SUBST(QMAKE_LIBTOOL)
208 AC_SUBST(FD_PLUGIN_DIR)
210 dnl --------------------------------------------------
211 dnl Include file handling
212 dnl --------------------------------------------------
213 AC_ARG_ENABLE(includes,
214 AC_HELP_STRING([--enable-includes], [enable installing of include files @<:@default=no@:>@]),
216 if test x$enableval = xyes; then
222 dnl It only makes sense to install include files when you install libraries which only happens when
223 dnl libtool is enabled
225 if test x$use_libtool != xno -a x$install_includes = xyes; then
226 INCLUDE_INSTALL_TARGET="install-includes"
227 INCLUDE_UNINSTALL_TARGET="uninstall-includes"
229 INCLUDE_INSTALL_TARGET=""
230 INCLUDE_UNINSTALL_TARGET=""
232 AC_SUBST(INCLUDE_INSTALL_TARGET)
233 AC_SUBST(INCLUDE_UNINSTALL_TARGET)
235 dnl --------------------------------------------------
236 dnl Bacula OP Sys determination (see aclocal.m4)
237 dnl --------------------------------------------------
240 dnl -----------------------------------------------------------
241 dnl Bacula OPSys Distribution determination (see aclocal.m4)
242 dnl ----------------------------------------------------------
243 BA_CHECK_OPSYS_DISTNAME
245 dnl --------------------------------------------------
246 dnl Suppport for gettext (translations)
247 dnl By default, $datarootdir is ${prefix}/share
248 dnl --------------------------------------------------
249 AM_GNU_GETTEXT([external])
251 dnl ------------------------------------------------------------------
252 dnl If the user has not set --prefix, we set our default to nothing.
253 dnl In this case, if the user has not set --sysconfdir, we set it
254 dnl to the package default of /etc/bacula. If either --prefix or
255 dnl --sysconfdir is set, we leave sysconfdir alone except to eval it.
256 dnl If the user has not set --libdir, we set it to the package
257 dnl default of /usr/lib. If either --prefix or --libdir is set,
258 dnl we leave libdir alone except to eval it. If the user has not set
259 dnl --includedir, we set it to the package default of /usr/include.
260 dnl If either --prefix or --includedir is set, we leave includedir
261 dnl alone except to eval it
262 dnl ------------------------------------------------------------------
263 os_name=`uname -s 2>/dev/null`
264 if test x${prefix} = xNONE ; then
265 if test `eval echo ${sysconfdir}` = NONE/etc ; then
266 sysconfdir=/etc/bacula
269 if test `eval echo ${libdir}` = NONE/lib ; then
272 os_processor=`uname -p 2>/dev/null`
273 case ${os_processor} in
288 if test `eval echo ${includedir}` = NONE/include ; then
289 includedir=/usr/include
292 if test `eval echo ${datarootdir}` = NONE/share ; then
293 datarootdir=/usr/share
298 dnl -------------------------------------------------------------------------
299 dnl If the user has not set --exec-prefix, we default to ${prefix}
300 dnl -------------------------------------------------------------------------
301 if test x${exec_prefix} = xNONE ; then
302 exec_prefix=${prefix}
305 sysconfdir=`eval echo ${sysconfdir}`
306 datarootdir=`eval echo ${datarootdir}`
307 docdir=`eval echo ${docdir}`
308 htmldir=`eval echo ${htmldir}`
309 libdir=`eval echo ${libdir}`
310 includedir=`eval echo ${includedir}`
311 localedir=`eval echo ${datarootdir}/locale`
312 AC_DEFINE_UNQUOTED(SYSCONFDIR, "$sysconfdir")
313 AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir")
315 dnl ------------------------------------------------------------------
316 dnl If the user has not set --sbindir, we set our default as /sbin
317 dnl ------------------------------------------------------------------
318 if test x$sbindir = x'${exec_prefix}/sbin' ; then
319 sbindir=${exec_prefix}/sbin
321 sbindir=`eval echo ${sbindir}`
323 dnl -------------------------------------------------------------------------
324 dnl If the user has not set --mandir, we default to /usr/share/man
325 dnl -------------------------------------------------------------------------
326 if test x$mandir = x'${prefix}/man' ; then
327 mandir=/usr/share/man
330 dnl -------------------------------------------------------------------------
331 dnl If the user has not set --htmldir, we default to /usr/share/doc/bacula/html
332 dnl -------------------------------------------------------------------------
333 if test x$htmldir = x'/usr/share/doc/bacula/' ; then
334 htmldir=`eval echo ${docdir}html`
337 dnl -------------------------------------------------------------------------
338 dnl If the user has not set --docdir, we default to /usr/share/doc/bacula
339 dnl -------------------------------------------------------------------------
340 if test x$docdir = x'/usr/share/doc/' ; then
341 docdir=`eval echo ${docdir}bacula`
345 AC_PATH_PROGS(MSGFMT, msgfmt, no)
346 if test "$MSGFMT" = "no"
348 echo 'msgfmt program not found, disabling NLS !'
350 USE_INCLUDED_LIBINTL=no
355 support_smartalloc=yes
362 support_static_tools=no
365 support_static_dir=no
366 support_static_cons=no
371 batch_insert_db_backends=""
374 dnl --------------------------------------------------------------------------
375 dnl CHECKING COMMAND LINE OPTIONS
376 dnl --------------------------------------------------------------------------
378 dnl -------------------------------------------
379 dnl bat (default off)
380 dnl -------------------------------------------
382 AC_HELP_STRING([--enable-bat], [enable build of bat Qt4 GUI @<:@default=no@:>@]),
384 if test x$enableval = xyes; then
385 AC_DEFINE(HAVE_BAT, 1, [Set if Bacula bat Qt4 GUI support enabled])
392 if test x$support_bat = xyes; then
393 abc=`$PKGCONFIG --atleast-version=4.2 QtGui`
395 if test $pkg = 0; then
396 BAT_DIR=src/qt-console
398 AC_MSG_ERROR(Unable to find Qt4 installation needed by bat)
403 dnl The qwt library was used with bat, but that is no longer the case
411 dnl if test x$support_bat = xyes; then
412 dnl AC_MSG_CHECKING(for qwt support)
414 dnl AC_HELP_STRING([--with-qwt@<:@=DIR@:>@], [specify qwt library directory]),
416 dnl case "$with_qwt" in
421 dnl if test -f ${with_qwt}/include/qwt.h; then
422 dnl QWT_INC="${with_qwt}/include"
423 dnl QWT_LDFLAGS="-L${with_qwt}/lib"
433 dnl dnl Search in standard places, or --with-qwt not specified
435 dnl if test $no_qwt = no; then
436 dnl if test x$QWT_INC = x; then
437 dnl for root in /usr /usr/local; do
438 dnl for ver in qwt qwt5 qwt-qt4; do
439 dnl if test -f ${root}/include/${ver}/qwt.h; then
440 dnl QWT_INC="${root}/include/${ver}"
441 dnl if test -d ${root}/lib64/; then
442 dnl QWT_LDFLAGS="-L${root}/lib64"
443 dnl elif test -d ${root}/lib/64/; then
444 dnl QWT_LDFLAGS="-L${root}/64"
446 dnl QWT_LDFLAGS="-L${root}/lib"
457 dnl if test x$QWT_INC = x; then
458 dnl AC_MSG_RESULT(no)
460 dnl AC_DEFINE(HAVE_QWT, 1, [Set if bat QWT library found])
461 dnl AC_MSG_RESULT(yes)
467 AC_SUBST(QWT_LDFLAGS)
472 dnl -------------------------------------------
473 dnl smartalloc (default off)
474 dnl -------------------------------------------
475 AC_ARG_ENABLE(smartalloc,
476 AC_HELP_STRING([--enable-smartalloc], [enable smartalloc debugging support @<:@default=no@:>@]),
478 if test x$enableval = xno; then
479 support_smartalloc=no
484 if test x$support_smartalloc = xyes; then
485 AC_DEFINE(SMARTALLOC, 1, [Set if you want Smartalloc enabled])
488 dnl -------------------------------------------
489 dnl Lock Manager (default off)
490 dnl -------------------------------------------
491 AC_ARG_ENABLE(lockmgr,
492 AC_HELP_STRING([--enable-lockmgr], [enable lock manager support @<:@default=no@:>@]),
494 if test x$enableval = xyes; then
500 if test x$support_lockmgr = xyes; then
501 AC_DEFINE(_USE_LOCKMGR, 1, [Set if you want Lock Manager enabled])
505 dnl -------------------------------------------
506 dnl static-tools (default off)
507 dnl -------------------------------------------
508 AC_ARG_ENABLE(static-tools,
509 AC_HELP_STRING([--enable-static-tools], [enable static tape tools @<:@default=no@:>@]),
511 if test x$enableval = xyes; then
512 if test x$use_libtool = xyes; then
513 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
514 please rerun configure with --disable-libtool])
516 support_static_tools=yes
522 if test x$support_static_tools = xyes; then
523 TTOOL_LDFLAGS="-static"
525 AC_SUBST(TTOOL_LDFLAGS)
527 dnl -------------------------------------------
528 dnl static-fd (default off)
529 dnl -------------------------------------------
530 AC_ARG_ENABLE(static-fd,
531 AC_HELP_STRING([--enable-static-fd], [enable static File daemon @<:@default=no@:>@]),
533 if test x$enableval = xyes; then
534 if test x$use_libtool = xyes; then
535 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
536 please rerun configure with --disable-libtool])
538 support_static_fd=yes
544 if test x$support_static_fd = xyes; then
545 STATIC_FD="static-bacula-fd"
549 dnl -------------------------------------------
550 dnl static-sd (default off)
551 dnl -------------------------------------------
552 AC_ARG_ENABLE(static-sd,
553 AC_HELP_STRING([--enable-static-sd], [enable static Storage daemon @<:@default=no@:>@]),
555 if test x$enableval = xyes; then
556 if test x$use_libtool = xyes; then
557 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
558 please rerun configure with --disable-libtool])
560 support_static_sd=yes
566 if test x$support_static_sd = xyes; then
567 STATIC_SD="static-bacula-sd"
571 dnl -------------------------------------------
572 dnl static-dir (default off)
573 dnl -------------------------------------------
574 AC_ARG_ENABLE(static-dir,
575 AC_HELP_STRING([--enable-static-dir], [enable static Director @<:@default=no@:>@]),
577 if test x$enableval = xyes; then
578 if test x$use_libtool = xyes; then
579 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
580 please rerun configure with --disable-libtool])
582 support_static_dir=yes
588 if test x$support_static_dir = xyes; then
589 STATIC_DIR="static-bacula-dir"
593 dnl -------------------------------------------
594 dnl static-cons (default off)
595 dnl -------------------------------------------
596 AC_ARG_ENABLE(static-cons,
597 AC_HELP_STRING([--enable-static-cons], [enable static Console @<:@default=no@:>@]),
599 if test x$enableval = xyes; then
600 if test x$use_libtool = xyes; then
601 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
602 please rerun configure with --disable-libtool])
604 support_static_cons=yes
610 if test x$support_static_cons = xyes; then
611 STATIC_CONS="static-bconsole"
613 AC_SUBST(STATIC_CONS)
615 dnl -------------------------------------------
616 dnl client_only (default off)
617 dnl -------------------------------------------
618 AC_ARG_ENABLE(client-only,
619 AC_HELP_STRING([--enable-client-only], [build client (File daemon) only @<:@default=no@:>@]),
621 if test x$enableval = xyes; then
622 build_client_only=yes
628 if test x$build_client_only = xno; then
635 dnl -------------------------------------------
636 dnl director (default on)
637 dnl -------------------------------------------
638 AC_ARG_ENABLE(build-dird,
639 AC_HELP_STRING([--enable-build-dird], [enable building of dird (Director) @<:@default=yes@:>@]),
641 if test x$enableval = xno; then
646 if test x$build_dird = xyes; then
651 DIR_TOOLS="NODIRTOOLS"
656 dnl -------------------------------------------
657 dnl stored (default on)
658 dnl -------------------------------------------
659 AC_ARG_ENABLE(build-stored,
660 AC_HELP_STRING([--enable-build-stored], [enable building of stored (Storage daemon) @<:@default=yes@:>@]),
662 if test x$enableval = xno; then
667 if test x$build_stored = xyes; then
668 STORED_DIR="src/stored"
674 dnl ---------------------------------------------------
675 dnl Check for conio (Bacula readline substitute)(
676 dnl ---------------------------------------------------
677 dnl this allows you to turn it completely off
679 AC_HELP_STRING([--disable-conio], [disable conio support @<:@default=no@:>@]),
681 if test x$enableval = xno; then
688 dnl ---------------------------------------------------
689 dnl Check for IPv6 support
690 dnl ---------------------------------------------------
691 dnl this allows you to turn it completely off
694 AC_HELP_STRING([--enable-ipv6], [enable ipv6 support @<:@default=yes@:>@]),
696 if test x$enableval = xno; then
702 if test x$support_ipv6 = xyes; then
703 AC_TRY_LINK([ #include <sys/types.h>
704 #include <sys/socket.h>
705 #include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;],
706 [support_ipv6=yes], [support_ipv6=no])
709 if test x$support_ipv6 = xyes; then
710 AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
714 AC_CHECK_HEADER(curses.h, [
715 AC_CHECK_LIB(tinfo, tgetent, [ TERM_LIB="-ltinfo" ], [
716 AC_CHECK_LIB(ncurses, tgetent, [ TERM_LIB="-lncurses" ], [
717 AC_CHECK_LIB(termcap, tgetent, [ TERM_LIB="-ltermcap" ])
721 [ AC_CHECK_HEADERS(curses.h)
722 AC_CHECK_HEADER(term.h,
723 [ AC_CHECK_LIB(curses, tgetent,
724 [ TERM_LIB="-lcurses" ] )
730 if test x$support_conio = xyes; then
731 if test x$TERM_LIB != x; then
737 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
739 echo " "; echo "Required libraries not found. CONIO turned off ..."; echo " "
744 dnl ---------------------------------------------------
745 dnl Check for readline support/directory (default off)
746 dnl ---------------------------------------------------
747 dnl this allows you to turn it completely off
748 AC_ARG_ENABLE(readline,
749 AC_HELP_STRING([--disable-readline], [disable readline support @<:@default=yes@:>@]),
751 if test x$enableval = xno; then
759 if test x$support_readline = xyes; then
760 AC_ARG_WITH(readline,
761 AC_HELP_STRING([--with-readline@<:@=DIR@:>@], [specify readline library directory]),
763 case "$with_readline" in
768 if test -f ${with_readline}/readline.h; then
769 CONS_INC="-I${with_readline}"
770 CONS_LDFLAGS="-L$with_readline"
771 elif test -f ${with_readline}/include/readline/readline.h; then
772 CONS_INC="-I${with_readline}/include/readline"
773 CONS_LDFLAGS="-L${with_readline}/lib"
774 with_readline="${with_readline}/include/readline"
776 with_readline="/usr/include/readline"
779 AC_CHECK_HEADER(${with_readline}/readline.h,
781 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
782 CONS_LIBS="-lreadline -lhistory ${TERM_LIB}"
786 echo "readline.h not found. readline turned off ..."
793 dnl check for standard readline library
794 AC_CHECK_HEADER(/usr/include/readline/readline.h,
796 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
798 CONS_INC="-I/usr/include/readline"
799 CONS_LIBS="-lreadline ${TERM_LIB}"
801 dnl Did not find standard library, so try Bacula's default
802 AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h,
804 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
806 CONS_INC="-I${TOP_DIR}/depkgs/readline"
807 CONS_LIBS="-lreadline -lhistory ${TERM_LIB}"
808 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
809 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
812 echo "readline.h not found. readline turned off ..."
826 AC_SUBST(CONS_LDFLAGS)
827 AC_SUBST(READLINE_SRC)
829 dnl Minimal stuff for readline Makefile configuration
834 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr)
835 AC_CHECK_FUNCS(lstat lchown lchmod futimes fchmod fchown)
836 AC_CHECK_FUNCS(nanosleep nl_langinfo)
837 AC_CHECK_HEADERS(varargs.h)
839 dnl End of readline/conio stuff
840 dnl -----------------------------------------------------------------------
843 dnl Find where sockets are (especially for Solaris)
844 dnl Do this before the TCP Wrappers test since tcp wrappers
845 dnl uses the socket library and some linkers are stupid.
847 AC_CHECK_FUNC(socket,
848 AC_MSG_RESULT(using libc's socket),
849 AC_CHECK_LIB(xnet,socket)
850 AC_CHECK_LIB(socket,socket)
851 AC_CHECK_LIB(inet,socket))
853 dnl -----------------------------------------------------------
854 dnl Check whether user wants TCP wrappers support (default off)
855 dnl -----------------------------------------------------------
858 AC_ARG_WITH(tcp-wrappers,
859 AC_HELP_STRING([--with-tcp-wrappers@<:@=DIR@:>@], [enable tcpwrappers support]),
861 if test "x$withval" != "xno" ; then
863 LIBS="$saved_LIBS -lwrap"
864 AC_SEARCH_LIBS(nanosleep, [rt])
865 AC_MSG_CHECKING(for libwrap)
868 #include <sys/types.h>
870 int deny_severity = 0;
871 int allow_severity = 0;
872 struct request_info *req;
877 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
882 LIBS="$saved_LIBS -lwrap -lnsl"
883 WRAPLIBS="$saved_LIBS -lwrap -lnsl"
886 #include <sys/types.h>
888 int deny_severity = 0;
889 int allow_severity = 0;
890 struct request_info *req;
895 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
900 AC_MSG_ERROR([*** libwrap missing])
910 dnl -----------------------------------------------------------
911 dnl Check whether OpenSSL is available
912 dnl -----------------------------------------------------------
913 AC_MSG_CHECKING([for OpenSSL])
914 dnl The following uses quadrigraphs:
918 AC_HELP_STRING([--with-openssl@<:@=DIR@:>@], [Include OpenSSL support. DIR is the OpenSSL base]),
920 with_openssl_directory=${withval}
924 if test "x$with_openssl_directory" != "xno"; then
925 OPENSSL_LIBS="-lssl -lcrypto"
928 if test "x$with_openssl_directory" != "xyes" && test x"${with_openssl_directory}" != "x"; then
930 # Make sure the $with_openssl_directory also makes sense
932 if test -d "$with_openssl_directory/lib" -a -d "$with_openssl_directory/include"; then
933 OPENSSL_LIBS="-L$with_openssl_directory/lib $OPENSSL_LIBS"
934 OPENSSL_INC="-I$with_openssl_directory/include $OPENSSL_INC"
939 saved_CFLAGS="${CFLAGS}"
940 LIBS="${saved_LIBS} ${OPENSSL_LIBS}"
941 CFLAGS="${saved_CFLAGS} ${OPENSSL_INC}"
945 #include <openssl/ssl.h>
947 CRYPTO_set_id_callback(NULL);
959 #include <openssl/evp.h>
963 ac_cv_openssl_sha2="yes"
965 ac_cv_openssl_sha2="no"
969 dnl Solaris disables greater than 128+ bit encryption in their OpenSSL
970 dnl implementation, presumably for export reasons. If 192bit AES
971 dnl is available, we assume that we're running with a 'non-export'
975 #include <openssl/evp.h>
979 ac_cv_openssl_export="no"
981 ac_cv_openssl_export="yes"
985 AC_MSG_RESULT([$support_tls])
986 if test "$support_tls" = "yes"; then
987 AC_DEFINE(HAVE_OPENSSL, 1, [Define if OpenSSL library is available])
988 AC_DEFINE(HAVE_TLS, 1, [Define if TLS support should be enabled])
989 AC_DEFINE(HAVE_CRYPTO, 1, [Define if encryption support should be enabled])
992 if test "$ac_cv_openssl_sha2" = "yes"; then
993 AC_DEFINE(HAVE_SHA2, 1, [Define if the SHA-2 family of digest algorithms is available])
996 if test "$ac_cv_openssl_export" = "yes"; then
997 AC_DEFINE(HAVE_OPENSSL_EXPORT_LIBRARY, 1, [Define if the OpenSSL library is export-contrained to 128bit ciphers])
1000 if test "$support_crypto" = "yes"; then
1001 AC_CHECK_LIB(crypto, EVP_PKEY_encrypt_old, AC_DEFINE(HAVE_OPENSSLv1, 1, [Set if have OpenSSL version 1.x]))
1004 LIBS="${saved_LIBS}"
1005 CFLAGS="${saved_CFLAGS}"
1009 AC_MSG_RESULT([$support_tls])
1012 if test "$support_tls" = "no" -o "$support_crypto" = "no"; then
1017 AC_SUBST(OPENSSL_LIBS)
1018 AC_SUBST(OPENSSL_INC)
1020 dnl -----------------------------------------------------------
1021 dnl dlopen is needed for plugins
1022 dnl -----------------------------------------------------------
1023 AC_SEARCH_LIBS(dlopen, [dl])
1025 dnl ------------------------------------------
1026 dnl Where to place working dir
1027 dnl ------------------------------------------
1028 working_dir=`eval echo /opt/bacula/working`
1029 AC_ARG_WITH(working-dir,
1030 AC_HELP_STRING([--with-working-dir=PATH], [specify path of Bacula working directory]),
1032 if test "x$withval" != "xno" ; then
1033 working_dir=$withval
1038 AC_SUBST(working_dir)
1040 dnl ------------------------------------------------------------------
1041 dnl If the user has not set archivedir, we set our default as /tmp
1042 dnl ------------------------------------------------------------------
1044 AC_ARG_WITH(archivedir,
1045 AC_HELP_STRING([--with-archivedir=PATH], [specify path of SD archive directory]),
1047 if test "x$withval" != "xno" ; then
1053 AC_SUBST(archivedir)
1055 dnl ------------------------------------------------------------------
1056 dnl Allow the user to specify the daemon resource name default hostname
1057 dnl ------------------------------------------------------------------
1059 AC_ARG_WITH(basename,
1060 AC_HELP_STRING([--with-basename=RESNAME], [specify base resource name for daemons]),
1062 if test "x$withval" != "xno" ; then
1070 dnl ------------------------------------------------------------------
1071 dnl Allow the user to override the hostname (default = machine hostname)
1072 dnl ------------------------------------------------------------------
1073 hostname=`uname -n | cut -d '.' -f 1`
1074 if test x${hostname} = x ; then
1075 hostname="localhost"
1077 dnl Make sure hostname is resolved
1078 ping -c 1 $hostname 2>/dev/null 1>/dev/null
1079 if test ! $? = 0; then
1080 hostname="localhost"
1082 AC_ARG_WITH(hostname,
1083 AC_HELP_STRING([--with-hostname=RESNAME], [specify host name for daemons]),
1085 if test "x$withval" != "xno" ; then
1094 dnl ------------------------------------------
1095 dnl Where to place scriptdir (script files)
1096 dnl ------------------------------------------
1097 scriptdir=`eval echo ${sysconfdir}`
1098 AC_ARG_WITH(scriptdir,
1099 AC_HELP_STRING([--with-scriptdir=PATH], [specify path of Bacula scripts directory]),
1101 if test "x$withval" != "xno" ; then
1110 dnl ------------------------------------------
1111 dnl Where to place bsrdir (bsr files)
1112 dnl ------------------------------------------
1113 bsrdir=`eval echo /opt/bacula/bsr`
1115 AC_HELP_STRING([--with-bsrdir=PATH], [specify path of Bacula bsrs directory]),
1117 if test "x$withval" != "xno" ; then
1125 dnl ------------------------------------------
1126 dnl Where to place logdir
1127 dnl ------------------------------------------
1128 logdir=`eval echo /opt/bacula/log`
1130 AC_HELP_STRING([--with-logdir=PATH], [specify path of Bacula logs directory]),
1132 if test "x$withval" != "xno" ; then
1141 # ------------------------------------------
1142 # Where to place plugindir (plugin files)
1143 # ------------------------------------------
1144 plugindir=`eval echo ${libdir}`
1145 AC_ARG_WITH(plugindir,
1146 AC_HELP_STRING([--with-plugindir=PATH], [specify path of Bacula plugins directory]),
1148 if test "x$withval" != "xno" ; then
1156 dnl ------------------------------------------
1157 dnl Where to send dump email
1158 dnl ------------------------------------------
1159 dump_email=root@localhost
1160 AC_ARG_WITH(dump-email,
1161 AC_HELP_STRING([--with-dump-email=EMAIL], [dump email address]),
1163 if test "x$withval" != "xno" ; then
1169 AC_SUBST(dump_email)
1171 dnl ------------------------------------------
1172 dnl Where to send job email
1173 dnl ------------------------------------------
1174 job_email=root@localhost
1175 AC_ARG_WITH(job-email,
1176 AC_HELP_STRING([--with-job-email=EMAIL], [job output email address]),
1178 if test "x$withval" != "xno" ; then
1186 dnl ------------------------------------------
1187 dnl Where to find smtp host
1188 dnl ------------------------------------------
1190 AC_ARG_WITH(smtp_host,
1191 AC_HELP_STRING([--with-smtp-host=HOST], [SMTP mail host address]),
1193 if test "x$withval" != "xno" ; then
1201 dnl ------------------------------------
1202 dnl Where to place pid files
1203 dnl ------------------------------------
1205 AC_ARG_WITH(pid-dir,
1206 AC_HELP_STRING([--with-pid-dir=PATH], [specify location of Bacula pid files]),
1208 if test "x$withval" != "xno" ; then
1214 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
1217 dnl ------------------------------------
1218 dnl Where to place subsys "lock file"
1219 dnl ------------------------------------
1220 subsysdir=/var/run/subsys
1221 if test -d /var/run/subsys; then
1222 subsysdir=/var/run/subsys
1223 elif test -d /var/lock/subsys; then
1224 subsysdir=/var/lock/subsys
1226 subsysdir=/var/run/subsys
1228 AC_ARG_WITH(subsys-dir,
1229 AC_HELP_STRING([--with-subsys-dir=PATH], [specify location of Bacula subsys file]),
1231 if test "x$withval" != "xno" ; then
1239 dnl ------------------------------------
1240 dnl Where to start assigning ports
1241 dnl ------------------------------------
1243 AC_ARG_WITH(baseport,
1244 AC_HELP_STRING([--with-baseport=PORT], [specify base port address for daemons]),
1246 if test "x$withval" != "xno" ; then
1253 dir_port=`expr $baseport`
1254 fd_port=`expr $baseport + 1`
1255 sd_port=`expr $fd_port + 1`
1261 dnl ------------------------------------------
1262 dnl Generate passwords
1263 dnl ------------------------------------------
1265 AC_ARG_WITH(dir-password,
1266 AC_HELP_STRING([--with-dir-password=PASSWORD], [specify Director's password]),
1268 if test "x$withval" != "xno" ; then
1269 dir_password=$withval
1274 if test "x$dir_password" = "x" ; then
1275 if test "x$OPENSSL" = "xnone" ; then
1276 key=`autoconf/randpass 33`
1278 key=`openssl rand -base64 33`
1284 AC_ARG_WITH(fd-password,
1285 AC_HELP_STRING([--with-fd-password=PASSWORD], [specify Client's password]),
1287 if test "x$withval" != "xno" ; then
1288 fd_password=$withval
1293 if test "x$fd_password" = "x" ; then
1294 if test "x$OPENSSL" = "xnone" ; then
1295 key=`autoconf/randpass 37`
1297 key=`openssl rand -base64 33`
1303 AC_ARG_WITH(sd-password,
1304 AC_HELP_STRING([--with-sd-password=PASSWORD], [specify Storage daemon's password]),
1306 if test "x$withval" != "xno" ; then
1307 sd_password=$withval
1312 if test "x$sd_password" = "x" ; then
1313 if test "x$OPENSSL" = "xnone" ; then
1314 key=`autoconf/randpass 41`
1316 key=`openssl rand -base64 33`
1322 AC_ARG_WITH(mon-dir-password,
1323 AC_HELP_STRING([--with-mon-dir-password=PASSWORD], [specify Director's password used by the monitor]),
1325 if test "x$withval" != "xno" ; then
1326 mon_dir_password=$withval
1331 if test "x$mon_dir_password" = "x" ; then
1332 if test "x$OPENSSL" = "xnone" ; then
1333 key=`autoconf/randpass 33`
1335 key=`openssl rand -base64 33`
1337 mon_dir_password=$key
1341 AC_ARG_WITH(mon-fd-password,
1342 AC_HELP_STRING([--with-mon-fd-password=PASSWORD], [specify Client's password used by the monitor]),
1344 if test "x$withval" != "xno" ; then
1345 mon_fd_password=$withval
1350 if test "x$mon_fd_password" = "x" ; then
1351 if test "x$OPENSSL" = "xnone" ; then
1352 key=`autoconf/randpass 37`
1354 key=`openssl rand -base64 33`
1356 mon_fd_password=$key
1360 AC_ARG_WITH(mon-sd-password,
1361 AC_HELP_STRING([--with-mon-sd-password=PASSWORD], [specify Storage daemon's password used by the monitor]),
1363 if test "x$withval" != "xno" ; then
1364 mon_sd_password=$withval
1369 if test "x$mon_sd_password" = "x" ; then
1370 if test "x$OPENSSL" = "xnone" ; then
1371 key=`autoconf/randpass 41`
1373 key=`openssl rand -base64 33`
1375 mon_sd_password=$key
1378 AC_SUBST(dir_password)
1379 AC_SUBST(fd_password)
1380 AC_SUBST(sd_password)
1381 AC_SUBST(mon_dir_password)
1382 AC_SUBST(mon_fd_password)
1383 AC_SUBST(mon_sd_password)
1386 dnl Pickup any database name
1389 AC_ARG_WITH(db_name,
1390 AC_HELP_STRING([--with-db-name=DBNAME], [specify database name @<:@default=bacula@:>@]),
1392 if test "x$withval" != "x" ; then
1400 AC_ARG_WITH(db_user,
1401 AC_HELP_STRING([--with-db-user=UNAME], [specify database user @<:@default=bacula@:>@]),
1403 if test "x$withval" != "x" ; then
1411 AC_ARG_WITH(db_password,
1412 AC_HELP_STRING([--with-db-password=PWD], [specify database password @<:@default=*none*@:>@]),
1414 if test "x$withval" != "x" ; then
1415 db_password=$withval
1419 AC_SUBST(db_password)
1422 dnl Pickup a database port
1425 AC_ARG_WITH(db_port,
1426 AC_HELP_STRING([--with-db-port=DBPORT], [specify a database port @<:@default=null@:>@]),
1428 if test "x$withval" != "x" ; then
1436 # Handle users and groups for each daemon
1439 AC_ARG_WITH(dir_user,
1440 AC_HELP_STRING([--with-dir-user=USER], [specify user for Director daemon]),
1442 if test "x$withval" != "x" ; then
1449 AC_ARG_WITH(dir_group,
1450 AC_HELP_STRING([--with-dir-group=GROUP], [specify group for Director daemon]),
1452 if test "x$withval" != "x" ; then
1459 AC_ARG_WITH(sd_user,
1460 AC_HELP_STRING([--with-sd-user=USER], [specify user for Storage daemon]),
1462 if test "x$withval" != "x" ; then
1469 AC_ARG_WITH(sd_group,
1470 AC_HELP_STRING([--with-sd-group=GROUP], [specify group for Storage daemon]),
1472 if test "x$withval" != "x" ; then
1479 AC_ARG_WITH(fd_user,
1480 AC_HELP_STRING([--with-fd-user=USER], [specify user for File daemon]),
1482 if test "x$withval" != "x" ; then
1489 AC_ARG_WITH(fd_group,
1490 AC_HELP_STRING([--with-fd-group=GROUP], [specify group for File daemon]),
1492 if test "x$withval" != "x" ; then
1506 dnl allow setting default executable permissions
1509 AC_ARG_WITH(sbin-perm,
1510 AC_HELP_STRING([--with-sbin-perm=MODE], [specify permissions for sbin binaries @<:@default=0750@:>@]),
1512 if test "x$withval" != "x" ; then
1520 dnl -------------------------------------------
1521 dnl enable batch attribute DB insert (default on)
1522 dnl -------------------------------------------
1523 support_batch_insert=yes
1524 AC_ARG_ENABLE(batch-insert,
1525 AC_HELP_STRING([--enable-batch-insert], [enable the DB batch insert code @<:@default=yes@:>@]),
1527 if test x$enableval = xno; then
1528 support_batch_insert=no
1533 if test x$support_batch_insert = xyes; then
1534 AC_DEFINE(USE_BATCH_FILE_INSERT, 1, [Set if DB batch insert code enabled])
1537 dnl ------------------------------------------------
1538 dnl Bacula check for various SQL database engines
1539 dnl ------------------------------------------------
1542 dnl Set uncomment_dbi by default to '#' if DBI is enabled this will get reset
1546 BA_CHECK_POSTGRESQL_DB
1552 dnl -------------------------------------------
1553 dnl If no batch insert backend are enable set
1554 dnl variable to None
1555 dnl -------------------------------------------
1556 if test -z "${batch_insert_db_backends}"; then
1557 batch_insert_db_backends="None"
1560 dnl -------------------------------------------
1561 dnl Make sure at least one database backend is found
1562 dnl -------------------------------------------
1563 if test "x${db_backends}" = "x" ; then
1566 echo "You have not specified either --enable-client-only or one of the"
1567 echo "supported databases: MySQL, PostgreSQL, or SQLite3."
1568 echo "This is not permitted. Please reconfigure."
1570 echo "Aborting the configuration ..."
1576 dnl -------------------------------------------
1577 dnl See how many catalog backends are configured.
1578 dnl -------------------------------------------
1579 case `echo $DB_BACKENDS | wc -w | sed -e 's/^ *//'` in
1581 DEFAULT_DB_TYPE="${DB_BACKENDS}"
1582 if test x$use_libtool = xno; then
1583 SHARED_CATALOG_TARGETS=""
1585 SHARED_CATALOG_TARGETS="libbaccats-${DEFAULT_DB_TYPE}.la"
1589 dnl ------------------------------------------------
1590 dnl Set the default backend to the first backend found
1591 dnl ------------------------------------------------
1592 DEFAULT_DB_TYPE=`echo ${DB_BACKENDS} | cut -d' ' -f1`
1594 dnl ------------------------------------------------
1595 dnl For multiple backend we need libtool support.
1596 dnl ------------------------------------------------
1597 if test x$use_libtool = xno; then
1600 echo "You have specified two or more of the"
1601 echo "supported databases: MySQL, PostgreSQL, or SQLite3."
1602 echo "This is not permitted when not using libtool Please reconfigure."
1604 echo "Aborting the configuration ..."
1610 SHARED_CATALOG_TARGETS=""
1611 for db_type in ${DB_BACKENDS}
1613 if test -z "${SHARED_CATALOG_TARGETS}"; then
1614 SHARED_CATALOG_TARGETS="libbaccats-${db_type}.la"
1616 SHARED_CATALOG_TARGETS="${SHARED_CATALOG_TARGETS} libbaccats-${db_type}.la"
1622 dnl -------------------------------------------
1623 dnl Unset DB_LIBS when using libtool as we link the
1624 dnl shared library using the right database lib no need to
1625 dnl set DB_LIBS which is only used for non shared versions
1626 dnl of the backends.
1627 dnl -------------------------------------------
1628 if test x$use_libtool = xyes; then
1632 AC_SUBST(uncomment_dbi)
1633 AC_SUBST(DB_BACKENDS)
1635 AC_SUBST(DEFAULT_DB_TYPE)
1636 AC_SUBST(SHARED_CATALOG_TARGETS)
1638 AC_DEFINE(PROTOTYPES)
1640 dnl --------------------------------------------------------------------------
1641 dnl Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
1643 if test -z "$CFLAGS" -o "$CFLAGS" = "-g -O2"; then
1644 if test -z "$CCOPTS"; then
1645 CCOPTS='-g -O2 -Wall'
1653 dnl See if we can use 64 bit file addresses
1654 largefile_support="no"
1659 dnl --------------------------------------------------------------------------
1660 dnl CHECKING FOR HEADER FILES
1661 dnl --------------------------------------------------------------------------
1700 AC_STRUCT_ST_BLKSIZE
1704 dnl --------------------------------------------------------------------------
1705 dnl Check for utime.h structure
1706 dnl --------------------------------------------------------------------------
1707 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
1711 #include <sys/types.h>
1716 ba_cv_header_utime_h=yes
1718 ba_cv_header_utime_h=no
1723 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H, 1, [Set if utime.h exists])
1725 dnl --------------------------------------------------------------------------
1726 dnl Check for socklen_t
1727 dnl --------------------------------------------------------------------------
1728 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
1732 #include <sys/types.h>
1733 #include <sys/socket.h>
1737 ba_cv_header_socklen_t=yes
1739 ba_cv_header_socklen_t=no
1744 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T, 1, [Set if socklen_t exists])
1746 dnl --------------------------------------------------------------------------
1747 dnl Check for ioctl request type
1748 dnl --------------------------------------------------------------------------
1750 AC_CACHE_CHECK(for ioctl_req_t, ba_cv_header_ioctl_req_t,
1755 #include <sys/types.h>
1756 #include <sys/ioctl.h>
1758 int (*d_ioctl)(int fd, unsigned long int request, ...);
1761 ba_cv_header_ioctl_req_t=yes
1763 ba_cv_header_ioctl_req_t=no
1768 test $ba_cv_header_ioctl_req_t = yes && AC_DEFINE(HAVE_IOCTL_ULINT_REQUEST, 1, [Set if ioctl request is unsigned long int])
1770 dnl Note: it is more correct to use AC_LANG(C++) but some of the older
1771 dnl *BSD systems still use old style C prototypes, which are wrong with
1772 dnl compiled with a C++ compiler.
1775 dnl --------------------------------------------------------------------------
1776 dnl Check for typeof()
1777 dnl --------------------------------------------------------------------------
1779 AC_CACHE_CHECK(for typeof, ba_cv_have_typeof,
1783 main(){char *a = 0; a = (typeof a)a;}
1785 ba_cv_have_typeof=yes
1787 ba_cv_have_typeof=no
1789 ba_cv_have_typeof=no
1794 test $ba_cv_have_typeof = yes && AC_DEFINE([HAVE_TYPEOF], 1, [Defind to 1 if compiler has typeof])
1799 AC_C_BIGENDIAN([AC_DEFINE([HAVE_BIG_ENDIAN], [1], [Big Endian])], [AC_DEFINE([HAVE_LITTLE_ENDIAN], [1], [Little Endian])])
1801 dnl --------------------------------------------------------------------------
1802 dnl CHECKING FOR FILESYSTEM TYPE
1803 dnl --------------------------------------------------------------------------
1804 AC_MSG_CHECKING(how to get filesystem type)
1806 # The order of these tests is important.
1809 #include <sys/statvfs.h>
1810 #include <sys/fstyp.h>
1812 AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4
1814 if test $fstype = no; then
1817 #include <sys/statfs.h>
1818 #include <sys/fstyp.h>
1820 AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3
1823 if test $fstype = no; then
1826 #include <sys/statfs.h>
1827 #include <sys/vmount.h>
1829 AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX
1832 if test $fstype = no; then
1837 AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD
1840 if test $fstype = no; then
1841 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
1843 if test $fstype = no; then
1846 #include <sys/mount.h>
1847 #include <sys/fs_types.h>
1849 AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix
1852 AC_MSG_RESULT($fstype)
1854 AC_CHECK_HEADER(sys/statvfs.h, [ AC_DEFINE(HAVE_SYS_STATVFS_H,1,[Defines if your system have the sys/statvfs.h header file])] , )
1857 AC_CHECK_FUNCS(backtrace)
1860 dnl --------------------------------------------------------------------------
1861 dnl CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
1862 dnl --------------------------------------------------------------------------
1872 AC_CHECK_TYPE(ino_t, unsigned long)
1873 AC_CHECK_TYPE(dev_t, unsigned long)
1874 AC_CHECK_TYPE(daddr_t, long)
1875 AC_CHECK_TYPE(major_t, int)
1876 AC_CHECK_TYPE(minor_t, int)
1877 AC_CHECK_TYPE(ssize_t, int)
1883 AC_CHECK_SIZEOF(char, 1)
1884 AC_CHECK_SIZEOF(short int, 2)
1885 AC_CHECK_SIZEOF(int, 4)
1886 AC_CHECK_SIZEOF(long int, 4)
1887 AC_CHECK_SIZEOF(long long int, 8)
1888 AC_CHECK_SIZEOF(int *, 4)
1890 dnl Check for sys/types.h types
1891 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int,
1895 #include <sys/types.h>
1899 ac_cv_have_u_int="yes"
1901 ac_cv_have_u_int="no"
1906 if test "x$ac_cv_have_u_int" = "xyes" ; then
1907 AC_DEFINE(HAVE_U_INT)
1911 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t,
1915 #include <sys/types.h>
1919 ac_cv_have_intmax_t="yes"
1927 ac_cv_have_intmax_t="yes"
1929 ac_cv_have_intmax_t="no"
1936 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
1937 AC_DEFINE(HAVE_INTMAX_T)
1941 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t,
1945 #include <sys/types.h>
1947 u_intmax_t a; a = 1;
1949 ac_cv_have_u_intmax_t="yes"
1955 u_intmax_t a; a = 1;
1957 ac_cv_have_u_intmax_t="yes"
1959 ac_cv_have_u_intmax_t="no"
1966 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
1967 AC_DEFINE(HAVE_U_INTMAX_T)
1971 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t,
1975 #include <sys/types.h>
1977 int8_t a; int16_t b; int32_t c; a = b = c = 1;
1979 ac_cv_have_intxx_t="yes"
1981 ac_cv_have_intxx_t="no"
1986 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1987 AC_DEFINE(HAVE_INTXX_T)
1991 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t,
1995 #include <sys/types.h>
1999 ac_cv_have_int64_t="yes"
2001 ac_cv_have_int64_t="no"
2006 if test "x$ac_cv_have_int64_t" = "xyes" ; then
2007 AC_DEFINE(HAVE_INT64_T)
2011 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t,
2015 #include <sys/types.h>
2017 u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;
2019 ac_cv_have_u_intxx_t="yes"
2021 ac_cv_have_u_intxx_t="no"
2026 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
2027 AC_DEFINE(HAVE_U_INTXX_T)
2031 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t,
2035 #include <sys/types.h>
2039 ac_cv_have_u_int64_t="yes"
2041 ac_cv_have_u_int64_t="no"
2046 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
2047 AC_DEFINE(HAVE_U_INT64_T)
2051 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
2052 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2054 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
2057 #include <sys/bitypes.h>
2059 int8_t a; int16_t b; int32_t c;
2060 u_int8_t e; u_int16_t f; u_int32_t g;
2061 a = b = c = e = f = g = 1;
2063 AC_DEFINE(HAVE_U_INTXX_T)
2064 AC_DEFINE(HAVE_INTXX_T)
2065 AC_DEFINE(HAVE_SYS_BITYPES_H)
2073 if test -z "$have_u_intxx_t" ; then
2074 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t,
2078 #include <sys/types.h>
2080 uint8_t a; uint16_t b;
2081 uint32_t c; a = b = c = 1;
2083 ac_cv_have_uintxx_t="yes"
2085 ac_cv_have_uintxx_t="no"
2090 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
2091 AC_DEFINE(HAVE_UINTXX_T)
2095 if (test -z "$have_u_int64_t" || test -z "$have_int64_t" && \
2096 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2098 AC_MSG_CHECKING([for int64_t and u_int64_t types in sys/bitypes.h])
2101 #include <sys/bitypes.h>
2103 int64_t a; u_int64_t b;
2106 AC_DEFINE(HAVE_U_INT64_T)
2107 AC_DEFINE(HAVE_INT64_T)
2115 if (test -z "$have_uintxx_t" && \
2116 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2118 AC_MSG_CHECKING([for uintXX_t types in sys/bitypes.h])
2121 #include <sys/bitypes.h>
2123 uint8_t a; uint16_t b;
2124 uint32_t c; a = b = c = 1;
2126 AC_DEFINE(HAVE_UINTXX_T)
2134 dnl --------------------------------------------------------------------------
2135 dnl CHECKING FOR REQUIRED LIBRARY FUNCTIONS
2136 dnl --------------------------------------------------------------------------
2152 [echo 'configure: cannot find needed function.'; exit 1]
2157 AC_DEFINE(HAVE_FCNTL_F_CLOSEM, 1, [Set if you have 'F_CLOSEM' fcntl flag]),
2159 [#include <fcntl.h>]
2162 AC_CHECK_FUNC(closefrom, [AC_DEFINE(HAVE_CLOSEFROM, 1, [Define to 1 if you have the 'closefrom' function.])])
2163 AC_CHECK_FUNCS(getpagesize, [AC_DEFINE(HAVE_GETPAGESIZE, 1, [Set if have getpagesize])])
2164 AC_CHECK_FUNCS(malloc_trim, [AC_DEFINE(HAVE_MALLOC_TRIM, 1, [Set if have malloc_trim])])
2166 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
2167 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
2168 AC_CHECK_FUNCS(posix_fadvise)
2169 AC_CHECK_FUNCS(fdatasync)
2171 AC_CHECK_FUNCS(chflags)
2173 AC_CHECK_FUNCS(snprintf vsnprintf gethostid fseeko)
2175 AC_CACHE_CHECK(for va_copy, ba_cv_va_copy,
2180 void use_va_copy(va_list args){va_list args2; va_copy(args2,args); va_end(args2);}
2181 void call_use_va_copy(int junk,...){va_list args; va_start(args,junk); use_va_copy(args); va_end(args);}
2183 call_use_va_copy(1,2,3)
2192 test $ba_cv_va_copy = yes && AC_DEFINE(HAVE_VA_COPY, 1, [Set if va_copy exists])
2194 dnl --------------------------------------------------------------------------
2195 dnl CHECKING FOR THREAD SAFE FUNCTIONS
2196 dnl --------------------------------------------------------------------------
2197 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
2199 # If resolver functions are not in libc check for -lnsl or -lresolv.
2200 AC_CHECK_FUNC(gethostbyname_r,
2201 AC_MSG_RESULT(using libc's resolver),
2202 AC_CHECK_LIB(nsl,gethostbyname_r)
2203 AC_CHECK_LIB(resolv,gethostbyname_r))
2205 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
2206 AC_CHECK_FUNCS(inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)])
2207 AC_CHECK_FUNCS(gethostbyname2, [AC_DEFINE(HAVE_GETHOSTBYNAME2)])
2208 AC_CHECK_FUNCS(getnameinfo, [AC_DEFINE(HAVE_GETNAMEINFO)])
2211 dnl ----------------------------
2212 dnl check sa_len of sockaddr
2213 dnl ----------------------------
2214 AC_CACHE_CHECK(for struct sockaddr has a sa_len field, ac_cv_struct_sockaddr_sa_len,
2218 #include <sys/socket.h>
2220 struct sockaddr s; s.sa_len;
2222 ac_cv_struct_sockaddr_sa_len=yes
2223 ], [ac_cv_struct_sockaddr_sa_len=no
2229 if test $ac_cv_struct_sockaddr_sa_len = yes; then
2230 AC_DEFINE(HAVE_SA_LEN, 1, [Define if sa_len field exists in struct sockaddr])
2234 dnl check for working getaddrinfo()
2236 dnl Note that if the system doesn't have gai_strerror(), we
2237 dnl can't use getaddrinfo() because we can't get strings
2238 dnl describing the error codes.
2240 AC_CACHE_CHECK(for working getaddrinfo, ac_cv_working_getaddrinfo,
2246 #include <sys/types.h>
2247 #include <sys/socket.h>
2250 struct addrinfo hints, *ai;
2253 memset(&hints, 0, sizeof(hints));
2254 hints.ai_family = AF_UNSPEC;
2255 hints.ai_socktype = SOCK_STREAM;
2256 error = getaddrinfo("127.0.0.1", NULL, &hints, &ai);
2260 if (ai->ai_addr->sa_family != AF_INET) {
2266 ac_cv_working_getaddrinfo="yes"
2268 ac_cv_working_getaddrinfo="no"
2270 ac_cv_working_getaddrinfo="yes"
2275 AC_CHECK_FUNC(gai_strerror, [AC_DEFINE(HAVE_GAI_STRERROR, 1, [Define to 1 if you have the 'gai_strerror' function.])])
2277 if test "$ac_cv_working_getaddrinfo" = "yes"; then
2278 if test "$ac_cv_func_gai_strerror" != "yes"; then
2279 ac_cv_working_getaddrinfo="no"
2281 AC_DEFINE(HAVE_GETADDRINFO, 1, [Define to 1 if getaddrinfo exists and works])
2289 AC_CHECK_FUNCS(getmntinfo, [AC_DEFINE(HAVE_GETMNTINFO)])
2290 AC_FUNC_CLOSEDIR_VOID
2291 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
2292 # AC_FUNC_FNMATCH dnl use local version
2294 AC_CHECK_LIB(intl, gettext, [LIBS="$LIBS -lintl"])
2296 AC_CHECK_LIB(sun, getpwnam)
2298 AC_CHECK_HEADERS(zlib.h)
2299 AC_CHECK_LIB(z, deflate, [ZLIBS="-lz"])
2301 if test x$ZLIBS = x-lz; then
2302 AC_DEFINE(HAVE_LIBZ)
2308 dnl Check if we have AFS on this system
2314 AC_HELP_STRING([--disable-afs], [disable afs support @<:@default=auto@:>@]),
2316 if test x$enableval = xyes; then
2318 elif test x$enableval = xno; then
2325 if test x$support_afs = xyes -o x$support_afs = xauto; then
2327 AC_HELP_STRING([--with-afsdir@<:@=DIR@:>@], [Directory holding AFS includes/libs]),
2328 with_afsdir=$withval
2332 dnl Search in standard places, or --with-afsdir not specified
2334 if test x$with_afsdir = x; then
2335 for root in /usr /usr/local; do
2336 if test -d ${root}/include/afs/ ; then
2340 if test -d ${root}/include/openafs/afs/ ; then
2347 if test -d ${with_afsdir}/include/afs/ ; then
2348 AFS_CFLAGS="-I${with_afsdir}/include"
2350 if test -d ${with_afsdir}/include/openafs/afs/ ; then
2351 AFS_CFLAGS="-I${with_afsdir}/include/openafs"
2355 saved_CFLAGS="${CFLAGS}"
2356 saved_CPPFLAGS="${CPPFLAGS}"
2357 CFLAGS="${AFS_CFLAGS} ${saved_CFLAGS}"
2358 CPPFLAGS="${AFS_CFLAGS} ${saved_CPPFLAGS}"
2360 AC_CHECK_HEADERS(afs/afsint.h)
2363 #include <afs/afsint.h>
2364 #include <afs/venus.h>
2366 AC_DEFINE(HAVE_AFS_VENUS_H,1,[Define to 1 if you have the <afs/venus.h> header file.])
2369 CFLAGS="${saved_CFLAGS}"
2370 CPPFLAGS="${saved_CPPFLAGS}"
2373 dnl See if we can find a libsys with the pioctl symbol in there
2375 AC_MSG_CHECKING(for pioctl in AFS libsys)
2376 for dir in ${with_afsdir}/lib \
2377 ${with_afsdir}/lib/afs \
2378 ${with_afsdir}/lib/openafs \
2379 ${with_afsdir}/lib64 \
2380 ${with_afsdir}/lib64/afs \
2381 ${with_afsdir}/lib64/openafs
2383 for arch_type in .a .so
2385 A=`test -f ${dir}/libsys${arch_type} && nm ${dir}/libsys${arch_type} 2>/dev/null | grep pioctl`
2387 if test $pkg = 0; then
2389 AFS_LIBS="-L${dir} -lsys -lrx -llwp ${dir}/util${arch_type}"
2395 if test $have_afs = yes; then
2401 if test x$support_afs = xyes -a $have_afs != yes; then
2402 AC_MSG_ERROR([afs support explicitly enabled but no supported afs implementation found,
2403 please either load the afs libraries or rerun configure without --enable-afs])
2405 if test $have_afs = yes; then
2406 AC_DEFINE(HAVE_AFS,1,[Define to 1 if your system has AFS support])
2407 AC_DEFINE(HAVE_AFS_ACL,1,[Andrew FileSystem ACL support])
2411 AC_SUBST(AFS_CFLAGS)
2414 dnl ---------------------------------------------------
2415 dnl Check for lzo support/directory (default on)
2416 dnl ---------------------------------------------------
2417 dnl this allows you to turn it completely off
2420 AC_HELP_STRING([--disable-lzo], [disable lzo support @<:@default=yes@:>@]),
2422 if test x$enableval = xno; then
2433 if test x$support_lzo = xyes; then
2435 AC_HELP_STRING([--with-lzo@<:@=DIR@:>@], [specify lzo library directory]),
2442 if test -f ${with_lzo}/include/lzo/lzoconf.h; then
2443 LZO_INC="-I${with_lzo}/include"
2444 LZO_LDFLAGS="-L${with_lzo}/lib"
2445 with_lzo="${with_lzo}/include"
2447 with_lzo="/usr/include"
2450 AC_CHECK_HEADER(${with_lzo}/lzo/lzoconf.h,
2452 AC_DEFINE(HAVE_LZO, 1, [Define to 1 if you have LZO compression])
2453 LZO_LIBS="${LZO_LDFLAGS} -lzo2"
2457 echo "lzoconf.h not found. lzo turned off ..."
2464 AC_CHECK_HEADER(lzo/lzoconf.h,
2466 AC_CHECK_HEADER(lzo/lzo1x.h,
2468 AC_CHECK_LIB(lzo2, lzo1x_1_compress,
2471 AC_DEFINE(HAVE_LZO,1,[Define to 1 if you have LZO compression])
2484 dnl Check for ACL support and libraries
2488 AC_HELP_STRING([--disable-acl], [disable acl support @<:@default=auto@:>@]),
2490 if test x$enableval = xyes; then
2492 elif test x$enableval = xno; then
2499 have_extended_acl=no
2500 if test x$support_acl = xyes -o x$support_acl = xauto; then
2501 AC_CHECK_HEADER(sys/acl.h, [ AC_DEFINE(HAVE_SYS_ACL_H,1,[Defines if your system have the sys/acl.h header file])] , )
2504 dnl First check for acl_get_file in libc
2506 AC_CHECK_FUNC(acl_get_file,
2513 dnl Check for acl_get_file in libacl (Linux)
2515 if test $have_acl = no; then
2516 AC_CHECK_LIB(acl, acl_get_file,
2519 if test $have_afs = yes; then
2521 dnl Because of possible naming conflict with AFS libacl make sure we use the one in /usr/lib64 or /usr/lib !!!
2523 if test -d /usr/lib64/; then
2524 FDLIBS="-L/usr/lib64 -lacl $FDLIBS"
2526 FDLIBS="-L/usr/lib -lacl $FDLIBS"
2529 FDLIBS="-lacl $FDLIBS"
2536 dnl Check for acl_get_file in libpacl (OSF1)
2537 dnl and if ACL_TYPE_DEFAULT_DIR is defined.
2539 if test $have_acl = no -a \
2540 x${HAVE_OSF1_OS_TRUE} = x; then
2541 AC_CHECK_LIB(pacl, acl_get_file,
2544 FDLIBS="-lpacl $FDLIBS"
2548 AC_MSG_CHECKING(for ACL_TYPE_DEFAULT_DIR in acl.h include file)
2549 grep ACL_TYPE_DEFAULT_DIR /usr/include/sys/acl.h > /dev/null 2>&1
2550 if test $? = 0; then
2551 AC_DEFINE(HAVE_ACL_TYPE_DEFAULT_DIR,1,[Defines if your system have the ACL_TYPE_DEFAULT_DIR acl type])
2559 dnl On OSX check for availability of ACL_TYPE_EXTENDED
2561 if test $have_acl = yes -a \
2562 x${HAVE_DARWIN_OS_TRUE} = x; then
2563 AC_MSG_CHECKING(for ACL_TYPE_EXTENDED in acl.h include file)
2564 grep ACL_TYPE_EXTENDED /usr/include/sys/acl.h > /dev/null 2>&1
2565 if test $? = 0; then
2566 AC_DEFINE(HAVE_ACL_TYPE_EXTENDED,1,[Defines if your system have the ACL_TYPE_EXTENDED acl type])
2574 dnl On FreeBSD check for availability of ACL_TYPE_NFS4
2576 if test $have_acl = yes -a \
2577 x${HAVE_FREEBSD_OS_TRUE} = x; then
2578 AC_MSG_CHECKING(for ACL_TYPE_NFS4 in acl.h include file)
2579 grep ACL_TYPE_NFS4 /usr/include/sys/acl.h > /dev/null 2>&1
2580 if test $? = 0; then
2581 AC_DEFINE(HAVE_ACL_TYPE_NFS4,1,[Defines if your system have the ACL_TYPE_NFS4 acl type])
2589 dnl Check for acltotext and acl_totext (Solaris)
2591 if test $have_acl = no -a \
2592 x${HAVE_SUN_OS_TRUE} = x; then
2593 AC_CHECK_LIB(sec, acltotext,
2596 FDLIBS="-lsec $FDLIBS"
2598 AC_CHECK_LIB(sec, acl_totext,
2600 have_extended_acl=yes
2608 dnl Check for acl_get and aclx_get (AIX)
2610 if test $have_acl = no -a \
2611 x${HAVE_AIX_OS_TRUE} = x; then
2612 AC_CHECK_FUNC(acl_get,
2616 AC_CHECK_FUNC(aclx_get,
2618 have_extended_acl=yes
2625 if test x$support_acl = xyes -a $have_acl != yes; then
2626 AC_MSG_ERROR([acl support explicitly enabled but no supported acl implementation found,
2627 please either load the acl libraries or rerun configure without --enable-acl])
2629 if test $have_acl = yes; then
2630 AC_DEFINE([HAVE_ACL],1,[Normal acl support])
2633 if test $have_extended_acl = yes; then
2634 AC_DEFINE([HAVE_EXTENDED_ACL],1,[Extended acl support])
2640 dnl Check for XATTR support
2643 AC_ARG_ENABLE(xattr,
2644 AC_HELP_STRING([--disable-xattr], [disable xattr support @<:@default=auto@:>@]),
2646 if test x$enableval = xyes; then
2648 elif test x$enableval = xno; then
2655 if test x$support_xattr = xyes -o x$support_xattr = xauto; then
2657 dnl First check for *BSD support
2658 dnl When running on a BSD variant
2660 if test x${HAVE_FREEBSD_OS_TRUE} = x -o \
2661 x${HAVE_NETBSD_OS_TRUE} = x -o \
2662 x${HAVE_OPENBSD_OS_TRUE} = x; then
2663 AC_CHECK_HEADER(sys/extattr.h, [ AC_DEFINE(HAVE_SYS_EXTATTR_H,1,[Defines if your system have the sys/extattr.h header file])] , )
2664 AC_CHECK_HEADER(libutil.h, [ AC_DEFINE(HAVE_LIBUTIL_H,1,[Defines if your system have the libutil.h header file])] , )
2665 AC_CHECK_FUNCS(extattr_get_link extattr_set_link extattr_list_link,
2668 AC_DEFINE([HAVE_EXTATTR_GET_LINK],1,[Define to 1 if you have the 'extattr_get_link' function.])
2669 AC_DEFINE([HAVE_EXTATTR_SET_LINK],1,[Define to 1 if you have the 'extattr_set_link' function.])
2670 AC_DEFINE([HAVE_EXTATTR_LIST_LINK],1,[Define to 1 if you have the 'extattr_list_link' function.])
2674 if test $have_xattr = no; then
2675 AC_CHECK_FUNCS(extattr_get_file extattr_set_file extattr_list_file,
2678 AC_DEFINE([HAVE_EXTATTR_GET_FILE],1,[Define to 1 if you have the 'extattr_get_file' function.])
2679 AC_DEFINE([HAVE_EXTATTR_SET_FILE],1,[Define to 1 if you have the 'extattr_set_file' function.])
2680 AC_DEFINE([HAVE_EXTATTR_LIST_FILE],1,[Define to 1 if you have the 'extattr_list_file' function.])
2685 if test $have_xattr = yes; then
2686 have_extattr_string_in_libc=no
2687 AC_CHECK_FUNCS(extattr_namespace_to_string extattr_string_to_namespace,
2689 have_extattr_string_in_libc=yes
2690 AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2691 AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2696 dnl If extattr_namespace_to_string and extattr_string_to_namespace are not in libc see if they are in libutil
2698 if test $have_extattr_string_in_libc = no; then
2699 AC_CHECK_LIB(util, extattr_namespace_to_string extattr_string_to_namespace,
2701 AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2702 AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2703 FDLIBS="-lutil $FDLIBS"
2711 dnl If we failed to find *BSD support try the AIX implementation of extented attributes (EA)
2712 dnl When running on AIX
2714 if test $have_xattr = no -a \
2715 x${HAVE_AIX_OS_TRUE} = x; then
2716 AC_CHECK_HEADER(sys/ea.h, [ AC_DEFINE(HAVE_SYS_EA_H,1,[Defines if your system have the sys/ea.h header file])] , )
2717 AC_CHECK_FUNCS(llistea lgetea lsetea,
2720 AC_DEFINE([HAVE_LLISTEA],1,[Define to 1 if you have the 'llistea' function.])
2721 AC_DEFINE([HAVE_LGETEA],1,[Define to 1 if you have the 'lgetea' function.])
2722 AC_DEFINE([HAVE_LSETEA],1,[Define to 1 if you have the 'lsetea' function.])
2726 if test $have_xattr = no; then
2727 AC_CHECK_FUNCS(listea getea setea,
2730 AC_DEFINE([HAVE_LISTEA],1,[Define to 1 if you have the 'listea' function.])
2731 AC_DEFINE([HAVE_GETEA],1,[Define to 1 if you have the 'getea' function.])
2732 AC_DEFINE([HAVE_SETEA],1,[Define to 1 if you have the 'setea' function.])
2739 dnl If we failed to find AIX support try the TRU64 implementation of extented attributes
2740 dnl when running on a TRU64 OS.
2742 if test $have_xattr = no -a \
2743 x${HAVE_OSF1_OS_TRUE} = x; then
2744 AC_CHECK_HEADER(sys/proplist.h, [ AC_DEFINE(HAVE_SYS_PROPLIST_H,1,[Defines if your system have the sys/proplist.h header file])] , )
2745 AC_CHECK_FUNCS(getproplist get_proplist_entry sizeof_proplist_entry add_proplist_entry setproplist,
2748 AC_DEFINE([HAVE_GETPROPLIST],1,[Define to 1 if you have the 'getproplist' function.])
2749 AC_DEFINE([HAVE_GET_PROPLIST_ENTRY],1,[Define to 1 if you have the 'get_proplist_entry' function.])
2750 AC_DEFINE([HAVE_SIZEOF_PROPLIST_ENTRY],1,[Define to 1 if you have the 'sizeof_proplist_entry' function.])
2751 AC_DEFINE([HAVE_ADD_PROPLIST_ENTRY],1,[Define to 1 if you have the 'add_proplist_entry' function.])
2752 AC_DEFINE([HAVE_SETPROPLIST],1,[Define to 1 if you have the 'setproplist' function.])
2758 dnl If we failed to find TRU64 support try the SOLARIS implementation of extented and extensible attributes
2759 dnl when running on a Solaris.
2761 if test $have_xattr = no -a \
2762 x${HAVE_SUN_OS_TRUE} = x; then
2763 AC_CHECK_HEADER(sys/attr.h, [ AC_DEFINE(HAVE_SYS_ATTR_H,1,[Defines if your system have the sys/attr.h header file])] , )
2764 AC_CHECK_HEADER(sys/nvpair.h, [ AC_DEFINE(HAVE_SYS_NVPAIR_H,1,[Defines if your system have the sys/nvpair.h header file])] , )
2765 AC_CHECK_HEADER(attr.h, [ AC_DEFINE(HAVE_ATTR_H,1,[Defines if your system have the attr.h header file])] , )
2767 AC_CHECK_FUNCS(openat fstatat unlinkat fchownat futimesat,
2770 AC_DEFINE([HAVE_OPENAT],1,[Define to 1 if you have the 'openat' function.])
2771 AC_DEFINE([HAVE_FSTATAT],1,[Define to 1 if you have the 'fstatat' function.])
2772 AC_DEFINE([HAVE_UNLINKAT],1,[Define to 1 if you have the 'unlinkat' function.])
2773 AC_DEFINE([HAVE_FCHOWNAT],1,[Define to 1 if you have the 'fchownat' function.])
2774 AC_DEFINE([HAVE_FUTIMESAT],1,[Define to 1 if you have the 'futimesat' function.])
2778 if test $have_xattr = yes; then
2779 AC_CHECK_LIB(nvpair, nvlist_next_nvpair,
2781 AC_DEFINE([HAVE_NVLIST_NEXT_NVPAIR],1,[Define to 1 if you have the 'nvlist_next_nvpair' function.])
2782 FDLIBS="-lnvpair $FDLIBS"
2789 dnl If we failed to find Solaris support try the generic xattr support code
2791 if test $have_xattr = no; then
2792 AC_CHECK_HEADER(sys/xattr.h, [ AC_DEFINE(HAVE_SYS_XATTR_H,1,[Defines if your system have the sys/xattr.h header file])] , )
2793 AC_CHECK_FUNCS(llistxattr lgetxattr lsetxattr,
2796 AC_DEFINE([HAVE_LLISTXATTR],1,[Define to 1 if you have the 'llistxattr' function.])
2797 AC_DEFINE([HAVE_LGETXATTR],1,[Define to 1 if you have the 'lgetxattr' function.])
2798 AC_DEFINE([HAVE_LSETXATTR],1,[Define to 1 if you have the 'lsetxattr' function.])
2802 if test $have_xattr = no; then
2803 AC_CHECK_FUNCS(listxattr getxattr setxattr,
2806 AC_DEFINE([HAVE_LISTXATTR],1,[Define to 1 if you have the 'listxattr' function.])
2807 AC_DEFINE([HAVE_GETXATTR],1,[Define to 1 if you have the 'getxattr' function.])
2808 AC_DEFINE([HAVE_SETXATTR],1,[Define to 1 if you have the 'setxattr' function.])
2814 if test x$support_xattr = xyes -a $have_xattr != yes; then
2815 AC_MSG_ERROR([xattr support explicitly enabled but no supported xattr implementation found,
2816 please either load the xattr libraries or rerun configure without --enable-xattr])
2818 if test $have_xattr = yes; then
2819 AC_DEFINE([HAVE_XATTR],1,[Extended Attributes support])
2825 dnl Check for pthread libraries
2828 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
2830 AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
2832 AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
2834 AC_CHECK_FUNC(pthread_create)
2843 dnl Check for headers, functions and libraries required to support
2844 dnl keeping readall capabilities
2846 AC_CHECK_HEADERS(sys/prctl.h sys/capability.h)
2847 AC_CHECK_FUNCS(prctl setreuid)
2848 AC_CHECK_LIB([cap], [cap_set_proc], [CAP_LIBS="-lcap"], [CAP_LIBS=])
2849 if test x$CAP_LIBS = x-lcap; then
2850 AC_DEFINE(HAVE_LIBCAP, 1, [Define if you have libcap])
2859 if test x$have_gcc = xyes ; then
2860 CPPFLAGS="$CPPFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
2861 CFLAGS="$CFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
2863 LDFLAGS=${LDFLAGS--O}
2864 CPPFLAGS="$CPPFLAGS"
2876 AC_SUBST(X_EXTRA_LIBS)
2881 dnl extra configurable objects
2892 dnl Finally we set appropriate distribution specific
2893 dnl variables and defaults
2895 dnl PFILES are platform specific files
2896 PFILES="platforms/Makefile"
2899 COMPRESS_MANPAGES=yes
2904 PSCMD="ps -e -o pid,comm"
2906 platforms/aix/Makefile"
2907 TAPEDRIVE="/dev/rmt0.1"
2911 PTHREAD_LIB="-lpthread -lexc"
2912 if test "${CC}" = "gcc" ; then
2919 TAPEDRIVE="/dev/nrmt0"
2922 DISTVER=`uname -a |awk '{print $3}'`
2923 TAPEDRIVE="/dev/nrmt0"
2924 PTHREAD_LIB="-pthread"
2925 CFLAGS="${CFLAGS} -pthread"
2926 PSCMD="ps -ax -o pid,command"
2930 platforms/bsdi/Makefile \
2931 platforms/bsdi/bacula-fd \
2932 platforms/bsdi/bacula-sd \
2933 platforms/bsdi/bacula-dir"
2934 largefile_support="yes"
2938 TAPEDRIVE="/dev/nst0"
2939 PSCMD="ps -e -o pid,command"
2942 platforms/darwin/Makefile"
2946 TAPEDRIVE="/dev/nst0"
2947 PSCMD="ps -e -o pid,command"
2950 platforms/osx/Makefile"
2953 if `test -f /etc/apt/sources.list && grep -q ubuntu /etc/apt/sources.list`; then
2956 DISTVER=`cat /etc/debian_version`
2957 if test -f /etc/lsb-release ; then
2959 if test "x$DISTRIB_ID" != "x" ; then
2960 DISTNAME=$DISTRIB_ID
2962 if test "x$DISTRIB_RELEASE" != "x" ; then
2963 DISTVER=$DISTRIB_RELEASE
2966 if test "$DISTNAME" = "Ubuntu" ; then
2969 TAPEDRIVE="/dev/nst0"
2970 PSCMD="ps -e -o pid,command"
2971 if test "$DISTNAME" = "ubuntu" ; then
2973 platforms/ubuntu/Makefile \
2974 platforms/ubuntu/bacula-fd \
2975 platforms/ubuntu/bacula-sd \
2976 platforms/ubuntu/bacula-dir"
2979 platforms/debian/Makefile \
2980 platforms/debian/bacula-fd \
2981 platforms/debian/bacula-sd \
2982 platforms/debian/bacula-dir"
2986 DISTVER=`uname -a |awk '{print $3}'`
2987 VER=`echo $DISTVER | cut -c 1`
2988 if test x$VER = x4 ; then
2989 PTHREAD_LIB="${PTHREAD_LIBS:--pthread}"
2990 CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS:--pthread}"
2994 TAPEDRIVE="/dev/nrsa0"
2995 PSCMD="ps -ax -o pid,command"
2997 platforms/freebsd/Makefile \
2998 platforms/freebsd/bacula-fd \
2999 platforms/freebsd/bacula-sd \
3000 platforms/freebsd/bacula-dir"
3001 largefile_support="yes"
3005 TAPEDRIVE="/dev/nst0"
3006 PSCMD="ps -e -o pid,command"
3008 platforms/hurd/Makefile \
3009 platforms/hurd/bacula-fd \
3010 platforms/hurd/bacula-sd \
3011 platforms/hurd/bacula-dir"
3014 PSCMD="UNIX95=1; ps -e -o pid,comm"
3015 CFLAGS="${CFLAGS} -D_XOPEN_SOURCE_EXTENDED=1"
3017 TAPEDRIVE="/dev/rmt/0hnb"
3018 PTHREAD_LIB="-lpthread"
3019 AC_DEFINE([_INCLUDE_LONGLONG])
3023 TAPEDRIVE="/dev/rmt/0cbn"
3024 PSCMD="ps -e -o pid,comm"
3026 platforms/irix/Makefile \
3027 platforms/irix/bacula-fd \
3028 platforms/irix/bacula-sd \
3029 platforms/irix/bacula-dir"
3032 DISTVER=`uname -a |awk '{print $3}'`
3035 TAPEDRIVE="/dev/nrst0"
3036 PSCMD="ps -ax -o pid,command"
3037 PTHREAD_LIB="-pthread"
3038 CFLAGS="${CFLAGS} -pthread"
3041 DISTVER=`uname -a |awk '{print $3}'`
3044 TAPEDRIVE="/dev/nrst0"
3045 PSCMD="ps -ax -o pid,command"
3046 PTHREAD_LIB="-pthread"
3047 CFLAGS="${CFLAGS} -pthread"
3049 platforms/openbsd/Makefile \
3050 platforms/openbsd/bacula-fd \
3051 platforms/openbsd/bacula-sd \
3052 platforms/openbsd/bacula-dir"
3055 if test -f /etc/whitebox-release ; then
3056 f=/etc/whitebox-release
3058 f=/etc/redhat-release
3060 if test `cat $f | grep release |\
3061 cut -f 3 -d ' '`x = "Enterprise"x ; then
3062 DISTVER="Enterprise "`cat $f | grep release |\
3065 DISTVER=`cat /etc/redhat-release | grep release |\
3068 TAPEDRIVE="/dev/nst0"
3069 PSCMD="ps -e -o pid,command"
3071 platforms/redhat/Makefile \
3072 platforms/redhat/bacula-fd \
3073 platforms/redhat/bacula-sd \
3074 platforms/redhat/bacula-dir
3078 DISTVER=`cat /etc/mandrake-release | grep release |\
3080 TAPEDRIVE="/dev/nst0"
3081 PSCMD="ps -e -o pid,command"
3083 platforms/mandrake/Makefile \
3084 platforms/mandrake/bacula-fd \
3085 platforms/mandrake/bacula-sd \
3086 platforms/mandrake/bacula-dir \
3090 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
3091 TAPEDRIVE="/dev/nst0"
3092 PSCMD="ps -e -o pid,command"
3094 platforms/gentoo/Makefile \
3095 platforms/gentoo/bacula-init \
3096 platforms/gentoo/bacula-fd \
3097 platforms/gentoo/bacula-sd \
3098 platforms/gentoo/bacula-dir"
3101 DISTVER=`cat /etc/slackware-version`
3102 TAPEDRIVE="/dev/nst0"
3103 PSCMD="ps -e -o pid,command"
3105 platforms/slackware/Makefile \
3106 platforms/slackware/rc.bacula-fd \
3107 platforms/slackware/rc.bacula-sd \
3108 platforms/slackware/rc.bacula-dir\
3109 platforms/slackware/functions.bacula"
3113 TAPEDRIVE="/dev/rmt/0cbn"
3114 PSCMD="ps -e -o pid,comm"
3116 platforms/solaris/Makefile \
3117 platforms/solaris/bacula-fd \
3118 platforms/solaris/bacula-sd \
3119 platforms/solaris/bacula-dir"
3123 AC_DEFINE(HAVE_OLD_SOCKOPT)
3124 AC_DEFINE(USE_THR_SETCONCURRENCY)
3127 AC_DEFINE(USE_THR_SETCONCURRENCY)
3132 LIBS="$LIBS -lresolv -lrt"
3135 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
3137 TAPEDRIVE="/dev/nst0"
3138 PSCMD="ps -e -o pid,command"
3140 platforms/suse/Makefile \
3141 platforms/suse/bacula-fd \
3142 platforms/suse/bacula-sd \
3143 platforms/suse/bacula-dir \
3144 platforms/suse/bacula"
3149 TAPEDRIVE="/dev/nst0"
3150 PSCMD="ps -e -o pid,command"
3152 platforms/suse/Makefile \
3153 platforms/suse/bacula-fd \
3154 platforms/suse/bacula-sd \
3155 platforms/suse/bacula-dir"
3159 TAPEDRIVE="/dev/nst0"
3162 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
3166 dnl -------------------------------------------
3167 dnl systemd (default off)
3168 dnl -------------------------------------------
3169 AC_MSG_CHECKING(for systemd support)
3170 AC_ARG_WITH(systemd,
3171 AC_HELP_STRING([--with-systemd@<:@=UNITDIR@:>@], [Include systemd support. UNITDIR is where systemd system .service files are located, default is to ask systemctl.]),
3173 if test "$withval" != "no"; then
3174 if test "$withval" = "yes"; then
3175 SYSTEMD_UNITDIR="`systemctl show | grep UnitPath | cut -d " " -f2`"
3177 SYSTEMD_UNITDIR="${withval}"
3181 platforms/systemd/Makefile \
3182 platforms/systemd/bacula.conf \
3183 platforms/systemd/bacula-dir.service \
3184 platforms/systemd/bacula-fd.service \
3185 platforms/systemd/bacula-sd.service"
3186 AC_DEFINE(HAVE_SYSTEMD, 1, [Define to 1 if systemd support should be enabled])
3188 support_systemd="yes"
3191 support_systemd="no"
3194 support_systemd="no"
3198 AC_SUBST(SYSTEMD_UNITDIR)
3202 LIBS="$PTHREAD_LIB $LIBS"
3204 AC_DEFINE_UNQUOTED(lld, "$lld")
3205 AC_DEFINE_UNQUOTED(llu, "$llu")
3211 AC_SUBST(COMPRESS_MANPAGES)
3213 dnl common parts of the Makefile
3214 MCOMMON=./autoconf/Make.common
3215 AC_SUBST_FILE(MCOMMON)
3218 if test "x${subsysdir}" = "x${sbindir}" ; then
3221 echo "You have set both --sbindir and --with-subsys-dir"
3222 echo " equal to: ${subsysdir} "
3223 echo "This is not permitted. Please reconfigure."
3225 echo "Aborting configuration ..."
3231 AC_OUTPUT([autoconf/Make.common \
3234 scripts/btraceback \
3237 scripts/bacula-ctl-dir \
3238 scripts/bacula-ctl-fd \
3239 scripts/bacula-ctl-sd \
3240 scripts/devel_bacula \
3243 scripts/mtx-changer \
3244 scripts/disk-changer \
3245 scripts/dvd-handler \
3246 scripts/dvd-simulator \
3247 scripts/logwatch/Makefile \
3248 scripts/logwatch/logfile.bacula.conf \
3249 scripts/bat.desktop \
3250 scripts/bat.desktop.xsu \
3251 scripts/bat.desktop.consolehelper \
3252 scripts/bat.console_apps \
3255 src/console/Makefile \
3256 src/console/bconsole.conf \
3257 src/qt-console/bat.conf \
3258 src/qt-console/bat.pro \
3259 src/qt-console/bat.pro.mingw32 \
3260 src/qt-console/install_conf_file \
3262 src/dird/bacula-dir.conf \
3264 src/stored/Makefile \
3265 src/stored/bacula-sd.conf \
3266 src/filed/Makefile \
3267 src/filed/bacula-fd.conf \
3269 src/cats/make_catalog_backup.pl \
3270 src/cats/make_catalog_backup \
3271 src/cats/delete_catalog_backup \
3272 src/cats/create_postgresql_database \
3273 src/cats/update_postgresql_tables \
3274 src/cats/make_postgresql_tables \
3275 src/cats/grant_postgresql_privileges \
3276 src/cats/drop_postgresql_tables \
3277 src/cats/drop_postgresql_database \
3278 src/cats/create_mysql_database \
3279 src/cats/update_mysql_tables \
3280 src/cats/make_mysql_tables \
3281 src/cats/grant_mysql_privileges \
3282 src/cats/drop_mysql_tables \
3283 src/cats/drop_mysql_database \
3284 src/cats/create_sqlite3_database \
3285 src/cats/update_sqlite3_tables \
3286 src/cats/make_sqlite3_tables \
3287 src/cats/grant_sqlite3_privileges \
3288 src/cats/drop_sqlite3_tables \
3289 src/cats/drop_sqlite3_database \
3292 src/cats/create_bacula_database \
3293 src/cats/update_bacula_tables \
3294 src/cats/grant_bacula_privileges \
3295 src/cats/make_bacula_tables \
3296 src/cats/drop_bacula_tables \
3297 src/cats/drop_bacula_database \
3298 src/cats/install-default-backend \
3299 src/findlib/Makefile \
3300 src/tools/Makefile \
3301 src/plugins/fd/Makefile \
3302 src/plugins/sd/Makefile \
3303 src/plugins/dir/Makefile \
3305 updatedb/update_mysql_tables_9_to_10 \
3306 updatedb/update_sqlite3_tables_9_to_10 \
3307 updatedb/update_postgresql_tables_9_to_10 \
3308 updatedb/update_mysql_tables_10_to_11 \
3309 updatedb/update_sqlite3_tables_10_to_11 \
3310 updatedb/update_postgresql_tables_10_to_11 \
3311 updatedb/update_mysql_tables_11_to_12 \
3312 updatedb/update_sqlite3_tables_11_to_12 \
3313 updatedb/update_postgresql_tables_11_to_12 \
3314 examples/nagios/check_bacula/Makefile \
3315 platforms/rpms/redhat/bacula.spec \
3316 platforms/rpms/redhat/bacula-bat.spec \
3317 platforms/rpms/redhat/bacula-docs.spec \
3318 platforms/rpms/redhat/bacula-mtx.spec \
3319 platforms/rpms/suse/bacula.spec \
3320 platforms/rpms/suse/bacula-bat.spec \
3321 platforms/rpms/suse/bacula-docs.spec \
3322 platforms/rpms/suse/bacula-mtx.spec \
3327 if test "${support_bat}" = "yes" ; then
3328 if test "x$QMAKE" = "xnone"; then
3329 AC_MSG_ERROR([Could not find qmake $PATH. Check your Qt installation])
3333 echo "Creating bat Makefile"
3344 dnl if CC is gcc, we can rebuild the dependencies (since the depend rule
3345 dnl requires gcc). If it's not, don't rebuild dependencies
3347 if test X"$GCC" = "Xyes" ; then
3348 echo "Doing make of dependencies"
3349 ${MAKE:-make} depend
3353 chmod 755 install_conf_file build-depkgs-qt-console
3357 chmod 755 bacula btraceback mtx-changer storage-ctl bsg_persist
3358 chmod 755 dvd-handler dvd-simulator
3359 chmod 755 bconsole disk-changer devel_bacula logrotate
3363 chmod 755 $c/update_mysql_tables_10_to_11 $c/update_sqlite3_tables_10_to_11
3364 chmod 755 $c/update_postgresql_tables_10_to_11
3365 chmod 755 $c/update_mysql_tables_11_to_12 $c/update_sqlite3_tables_11_to_12
3366 chmod 755 $c/update_postgresql_tables_11_to_12
3371 chmod 755 $c/create_bacula_database $c/update_bacula_tables $c/make_bacula_tables
3372 chmod 755 $c/grant_bacula_privileges $c/drop_bacula_tables $c/drop_bacula_database
3374 chmod 755 $c/create_mysql_database $c/update_mysql_tables $c/make_mysql_tables
3375 chmod 755 $c/grant_mysql_privileges $c/drop_mysql_tables $c/drop_mysql_database
3377 chmod 755 $c/create_sqlite3_database $c/update_sqlite3_tables $c/make_sqlite3_tables
3378 chmod 755 $c/grant_sqlite3_privileges $c/drop_sqlite3_tables $c/drop_sqlite3_database
3380 chmod 755 $c/create_postgresql_database $c/update_postgresql_tables $c/make_postgresql_tables
3381 chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables $c/drop_postgresql_database
3383 #chmod 755 $c/create_ingres_database $c/update_ingres_tables $c/make_ingres_tables
3384 #chmod 755 $c/grant_ingres_privileges $c/drop_ingres_tables $c/drop_ingres_database
3387 chmod 755 $c/make_catalog_backup $c/delete_catalog_backup $c/make_catalog_backup.pl
3391 chmod 755 $c/install-default-backend
3393 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
3394 largefile_support="yes"
3397 dnl Only try to find out the version number of the compiler when we know its some kind of GCC compiler
3398 if test X"$GCC" = "Xyes" ; then
3400 dnl A whole lot of hand springs to get the compiler version.
3401 dnl This is because gcc changed the output in version 3.0
3403 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3404 if test "x${CCVERSION}" = "x" ; then
3405 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3407 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3408 if test x"${CXXVERSION}" = x ; then
3409 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3413 # clean up any old junk
3420 Configuration on `date`:
3422 Host: ${host}${post_host} -- ${DISTNAME} ${DISTVER}
3423 Bacula version: ${BACULA} ${VERSION} (${DATE})
3424 Source code location: ${srcdir}
3425 Install binaries: ${sbindir}
3426 Install libraries: ${libdir}
3427 Install config files: ${sysconfdir}
3428 Scripts directory: ${scriptdir}
3429 Archive directory: ${archivedir}
3430 Working directory: ${working_dir}
3431 PID directory: ${piddir}
3432 Subsys directory: ${subsysdir}
3433 Man directory: ${mandir}
3434 Data directory: ${datarootdir}
3435 Plugin directory: ${plugindir}
3436 C Compiler: ${CC} ${CCVERSION}
3437 C++ Compiler: ${CXX} ${CXXVERSION}
3438 Compiler flags: ${WCFLAGS} ${CFLAGS}
3439 Linker flags: ${WLDFLAGS} ${LDFLAGS}
3441 Statically Linked Tools: ${support_static_tools}
3442 Statically Linked FD: ${support_static_fd}
3443 Statically Linked SD: ${support_static_sd}
3444 Statically Linked DIR: ${support_static_dir}
3445 Statically Linked CONS: ${support_static_cons}
3446 Database backends: ${db_backends}
3447 Database port: ${db_port}
3448 Database name: ${db_name}
3449 Database user: ${db_user}
3451 Job Output Email: ${job_email}
3452 Traceback Email: ${dump_email}
3453 SMTP Host Address: ${smtp_host}
3455 Director Port: ${dir_port}
3456 File daemon Port: ${fd_port}
3457 Storage daemon Port: ${sd_port}
3459 Director User: ${dir_user}
3460 Director Group: ${dir_group}
3461 Storage Daemon User: ${sd_user}
3462 Storage DaemonGroup: ${sd_group}
3463 File Daemon User: ${fd_user}
3464 File Daemon Group: ${fd_group}
3466 Large file support: $largefile_support
3467 Bacula conio support: ${got_conio} ${CONS_LIBS}
3468 readline support: ${got_readline} ${PRTREADLINE_SRC}
3469 TCP Wrappers support: ${TCPW_MSG} ${WRAPLIBS}
3470 TLS support: ${support_tls}
3471 Encryption support: ${support_crypto}
3472 ZLIB support: ${have_zlib}
3473 LZO support: ${have_lzo}
3474 enable-smartalloc: ${support_smartalloc}
3475 enable-lockmgr: ${support_lockmgr}
3476 bat support: ${support_bat}
3477 client-only: ${build_client_only}
3478 build-dird: ${build_dird}
3479 build-stored: ${build_stored}
3480 Plugin support: ${have_plugins}
3481 AFS support: ${have_afs}
3482 ACL support: ${have_acl}
3483 XATTR support: ${have_xattr}
3484 systemd support: ${support_systemd} ${SYSTEMD_UNITDIR}
3485 Batch insert enabled: ${batch_insert_db_backends}
3489 # create a small shell script useful for support with
3490 # configure options and config.out info
3491 cat > scripts/bacula_config << EOF
3494 $ $0 $ac_configure_args
3496 cat config.out >> scripts/bacula_config
3497 echo __EOC__ >> scripts/bacula_config
3498 chmod 755 scripts/bacula_config