3 dnl Process this file with autoconf to produce a configure script.
12 AC_CONFIG_AUX_DIR(${BUILD_DIR}/autoconf)
13 AC_CONFIG_HEADER(src/config.h:autoconf/config.h.in)
15 dnl minimal Win32 stuff for "make clean"
16 WIN32BUILDDIR=${BUILD_DIR}/src/win32
17 WIN32MAINDIR=${BUILD_DIR}
18 WIN32TOPDIR=${TOP_DIR}
19 AC_SUBST(WIN32BUILDDIR)
20 AC_SUBST(WIN32MAINDIR)
23 dnl require a recent autoconf
27 dnl search for true and false programs.
28 AC_PATH_PROGS(TRUEPRG, true, :)
29 AC_PATH_PROGS(FALSEPRG, false, :)
34 if test "x$BACULA" != x; then
35 post_host=`echo -${BACULA} | tr 'A-Z ' 'a-z-'`
37 BACULA=${BACULA:-Bacula}
38 VERSION=`sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
39 DATE=`sed -n -e 's/^.*[ \t]*BDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
40 LSMDATE=`sed -n -e 's/^.*LSMDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
45 AC_SUBST(post_host)dnl
46 echo "configuring for ${BACULA} $VERSION ($DATE)"
48 dnl -------------------------------------------------------
49 dnl Check for compiler.
50 dnl ------------------------------------------------------
54 AC_PROG_CC_C_O dnl Determine if C compiler support -c -o.
55 AC_PROG_GCC_TRADITIONAL dnl Determine if ioctl() need -traditional.
59 if test "x$BASECC" = xgcc; then
63 AC_PATH_PROG(CXX, $CXX, $CXX)
64 if test ! -e $CXX; then
65 AC_MSG_ERROR(Unable to find C++ compiler)
68 dnl -------------------------------------------------------
69 dnl Check for programs.
70 dnl ------------------------------------------------------
72 AC_PATH_PROG(MV, mv, mv)
74 dnl If we name the variable RM it will shadow the RM variable in the configure script and we overwrite the
75 dnl value with the name of the rm command and not rm -f which is its normal content. This gives all kind
76 dnl of strange output of the configure script (like things don't exist etc.).
77 dnl So we name it REMOVE (more software has run into this problem)
78 AC_PATH_PROG(REMOVE, rm, rm)
79 AC_PATH_PROG(CP, cp, cp)
80 AC_PATH_PROG(SED, sed, sed)
81 AC_PATH_PROG(ECHO, echo, echo)
82 AC_PATH_PROG(CMP, cmp, cmp)
83 AC_PATH_PROG(TBL, tbl, tbl)
84 AC_PATH_PROG(AR, ar, ar)
85 AC_PATH_PROG(OPENSSL, openssl, none)
86 AC_PATH_PROG(MTX, mtx, mtx)
87 AC_PATH_PROG(DD, dd, dd)
88 AC_PATH_PROG(MKISOFS, mkisofs, mkisofs)
89 AC_PATH_PROG(PYTHON, python, python)
90 AC_PATH_PROG(GROWISOFS, growisofs, growisofs)
91 AC_PATH_PROG(DVDRWMEDIAINFO, dvd+rw-mediainfo, dvd+rw-mediainfo)
92 AC_PATH_PROG(DVDRWFORMAT, dvd+rw-format, dvd+rw-format)
93 AC_PATH_PROG(PKGCONFIG, pkg-config, pkg-config)
94 AC_PATH_PROG(QMAKE, qmake, none)
95 AC_PATH_PROG(QMAKEQT4, qmake-qt4, none)
96 AC_PATH_PROG(GMAKE, gmake, none)
97 AC_ARG_VAR(WXCONFIG, [wx-config command. On some systems, you must set it to wx-config-2.6 to use wxWidgets 2.6.])
98 if test "x$WXCONFIG" = x; then
101 AC_PATH_PROG(WXCONFIG, ${WXCONFIG}, ${WXCONFIG})
102 AC_ARG_VAR(WXFLAGS, [Parameters to pass to wx-config (e.g. --unicode=no).])
103 AC_PATH_PROG(CDRECORD, cdrecord, cdrecord)
104 AC_PATH_PROG(PIDOF, pidof, pidof)
106 # Some AWK programs fail, so test it and warn the user
107 if echo xfoo | $AWK 'BEGIN { prog=ARGV[1]; ARGC=1 }
108 { if ((prog == $2) || (("(" prog ")") == $2) ||
109 (("[" prog "]") == $2) ||
110 ((prog ":") == $2)) { print $1 ; exit 0 } }' xfoo>/dev/null; then :;
112 AC_MSG_ERROR([!!!!!!!!! WARNING !!!!!!!!!!!!!!
113 The regex engine of $AWK is too broken to be used you
114 might want to install GNU AWK.
115 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!])
118 AC_PATH_PROG(AWK, $THE_AWK, $THE_AWK)
121 test -n "$ARFLAG" || ARFLAGS="cr"
128 AC_SUBST(LOCAL_CFLAGS)
129 AC_SUBST(LOCAL_LDFLAGS)
132 dnl --------------------------------------------------
134 dnl --------------------------------------------------
135 AC_ARG_ENABLE(libtool,
136 AC_HELP_STRING([--enable-libtool], [enable building using GNU libtool @<:@default=yes@:>@]),
138 if test x$enableval = xno; then
143 LT_INIT([shared disable-static])
146 if test x$use_libtool != xno; then
147 DEFAULT_OBJECT_TYPE=".lo"
148 DEFAULT_ARCHIVE_TYPE=".la"
149 DEFAULT_SHARED_OBJECT_TYPE=".la"
150 LIBTOOL="\$(LIBTOOL)"
151 LIBTOOL_INSTALL_TARGET="libtool-install"
152 LIBTOOL_UNINSTALL_TARGET="libtool-uninstall"
153 LIBTOOL_CLEAN_TARGET="libtool-clean"
154 QMAKE_LIBTOOL="${BUILD_DIR}/libtool"
156 DEFAULT_OBJECT_TYPE=".o"
157 DEFAULT_ARCHIVE_TYPE=".a"
158 DEFAULT_SHARED_OBJECT_TYPE=".so"
159 LIBTOOL="# \$(LIBTOOL)"
160 LIBTOOL_INSTALL_TARGET=""
161 LIBTOOL_UNINSTALL_TARGET=""
162 LIBTOOL_CLEAN_TARGET=""
163 QMAKE_LIBTOOL="# ${BUILD_DIR}/libtool"
166 AC_SUBST(DEFAULT_OBJECT_TYPE)
167 AC_SUBST(DEFAULT_ARCHIVE_TYPE)
168 AC_SUBST(DEFAULT_SHARED_OBJECT_TYPE)
170 AC_SUBST(LIBTOOL_INSTALL_TARGET)
171 AC_SUBST(LIBTOOL_UNINSTALL_TARGET)
172 AC_SUBST(LIBTOOL_CLEAN_TARGET)
173 AC_SUBST(QMAKE_LIBTOOL)
175 dnl --------------------------------------------------
176 dnl Include file handling
177 dnl --------------------------------------------------
178 AC_ARG_ENABLE(includes,
179 AC_HELP_STRING([--enable-includes], [enable installing of include files @<:@default=no@:>@]),
181 if test x$enableval = xyes; then
187 dnl It only makes sense to install include files when you install libraries which only happens when
188 dnl libtool is enabled
190 if test x$use_libtool != xno -a x$install_includes = xyes; then
191 INCLUDE_INSTALL_TARGET="install-includes"
192 INCLUDE_UNINSTALL_TARGET="uninstall-includes"
194 INCLUDE_INSTALL_TARGET=""
195 INCLUDE_UNINSTALL_TARGET=""
197 AC_SUBST(INCLUDE_INSTALL_TARGET)
198 AC_SUBST(INCLUDE_UNINSTALL_TARGET)
200 dnl --------------------------------------------------
201 dnl Bacula OP Sys determination (see aclocal.m4)
202 dnl --------------------------------------------------
205 dnl -----------------------------------------------------------
206 dnl Bacula OPSys Distribution determination (see aclocal.m4)
207 dnl ----------------------------------------------------------
208 BA_CHECK_OPSYS_DISTNAME
210 dnl --------------------------------------------------
211 dnl Suppport for gettext (translations)
212 dnl By default, $datarootdir is ${prefix}/share
213 dnl --------------------------------------------------
214 AM_GNU_GETTEXT([external])
216 dnl ------------------------------------------------------------------
217 dnl If the user has not set --prefix, we set our default to nothing.
218 dnl In this case, if the user has not set --sysconfdir, we set it
219 dnl to the package default of /etc/bacula. If either --prefix or
220 dnl --sysconfdir is set, we leave sysconfdir alone except to eval it.
221 dnl If the user has not set --libdir, we set it to the package
222 dnl default of /usr/lib. If either --prefix or --libdir is set,
223 dnl we leave libdir alone except to eval it. If the user has not set
224 dnl --includedir, we set it to the package default of /usr/include.
225 dnl If either --prefix or --includedir is set, we leave includedir
226 dnl alone except to eval it
227 dnl ------------------------------------------------------------------
228 os_name=`uname -s 2>/dev/null`
229 if test x${prefix} = xNONE ; then
230 if test `eval echo ${sysconfdir}` = NONE/etc ; then
231 sysconfdir=/etc/bacula
234 if test `eval echo ${libdir}` = NONE/lib ; then
237 os_processor=`uname -p 2>/dev/null`
238 case ${os_processor} in
253 if test `eval echo ${includedir}` = NONE/include ; then
254 includedir=/usr/include
257 if test `eval echo ${datarootdir}` = NONE/share ; then
258 datarootdir=/usr/share
263 dnl -------------------------------------------------------------------------
264 dnl If the user has not set --exec-prefix, we default to ${prefix}
265 dnl -------------------------------------------------------------------------
266 if test x${exec_prefix} = xNONE ; then
267 exec_prefix=${prefix}
270 sysconfdir=`eval echo ${sysconfdir}`
271 datarootdir=`eval echo ${datarootdir}`
272 docdir=`eval echo ${docdir}`
273 htmldir=`eval echo ${htmldir}`
274 libdir=`eval echo ${libdir}`
275 includedir=`eval echo ${includedir}`
276 localedir=`eval echo ${datarootdir}/locale`
277 AC_DEFINE_UNQUOTED(SYSCONFDIR, "$sysconfdir")
278 AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir")
280 dnl ------------------------------------------------------------------
281 dnl If the user has not set --sbindir, we set our default as /sbin
282 dnl ------------------------------------------------------------------
283 if test x$sbindir = x'${exec_prefix}/sbin' ; then
284 sbindir=${exec_prefix}/sbin
286 sbindir=`eval echo ${sbindir}`
288 dnl -------------------------------------------------------------------------
289 dnl If the user has not set --mandir, we default to /usr/share/man
290 dnl -------------------------------------------------------------------------
291 if test x$mandir = x'${prefix}/man' ; then
292 mandir=/usr/share/man
295 dnl -------------------------------------------------------------------------
296 dnl If the user has not set --htmldir, we default to /usr/share/doc/bacula/html
297 dnl -------------------------------------------------------------------------
298 if test x$htmldir = x${docdir} ; then
299 htmldir=`eval echo ${docdir}bacula/html`
302 dnl -------------------------------------------------------------------------
303 dnl If the user has not set --docdir, we default to /usr/share/doc/
304 dnl -------------------------------------------------------------------------
305 if test x$docdir = x'/usr/share/doc/' ; then
306 docdir=`eval echo ${docdir}bacula`
310 AC_PATH_PROGS(MSGFMT, msgfmt, no)
311 if test "$MSGFMT" = "no"
313 echo 'msgfmt program not found, disabling NLS !'
315 USE_INCLUDED_LIBINTL=no
323 support_postgresql=no
325 support_smartalloc=yes
330 support_wx_console=no
331 support_tray_monitor=no
336 support_static_tools=no
339 support_static_dir=no
340 support_static_cons=no
350 dnl --------------------------------------------------------------------------
351 dnl CHECKING COMMAND LINE OPTIONS
352 dnl --------------------------------------------------------------------------
354 dnl -------------------------------------------
355 dnl gnome (default off)
356 dnl -------------------------------------------
358 AC_HELP_STRING([--enable-gnome], [enable build of bgnome-console GUI @<:@default=no@:>@]),
360 if test x$enableval = xyes; then
367 if test x$support_gnome = xyes; then
368 AC_MSG_ERROR(bgnome-console no longer supported)
369 AC_MSG_ERROR(--enable-gnome option no longer supported)
371 # AC_SUBST(GNOME_DIR)
373 dnl -------------------------------------------
374 dnl bat (default off)
375 dnl -------------------------------------------
377 AC_HELP_STRING([--enable-bat], [enable build of bat Qt4 GUI @<:@default=no@:>@]),
379 if test x$enableval = xyes; then
380 AC_DEFINE(HAVE_BAT, 1, [Set if Bacula bat Qt4 GUI support enabled])
387 if test x$support_bat = xyes; then
388 abc=`$PKGCONFIG --atleast-version=4.2 QtGui`
390 if test $pkg = 0; then
391 BAT_DIR=src/qt-console
393 AC_MSG_ERROR(Unable to find Qt4 installation needed by bat)
398 dnl If bat is enabled, we need the qwt library
406 if test x$support_bat = xyes; then
407 AC_MSG_CHECKING(for qwt support)
409 AC_HELP_STRING([--with-qwt@<:@=DIR@:>@], [specify qwt library directory]),
416 if test -f ${with_qwt}/include/qwt.h; then
417 QWT_INC="${with_qwt}/include"
418 QWT_LDFLAGS="-L${with_qwt}/lib"
428 dnl Search in standard places, or --with-qwt not specified
430 if test $no_qwt = no; then
431 if test x$QWT_INC = x; then
432 for root in /usr /usr/local; do
433 for ver in qwt qwt5 qwt-qt4; do
434 if test -f ${root}/include/${ver}/qwt.h; then
435 QWT_INC="${root}/include/${ver}"
436 if test -d ${root}/lib64/; then
437 QWT_LDFLAGS="-L${root}/lib64"
438 elif test -d ${root}/lib/64/; then
439 QWT_LDFLAGS="-L${root}/64"
441 QWT_LDFLAGS="-L${root}/lib"
452 if test x$QWT_INC = x; then
455 AC_DEFINE(HAVE_QWT, 1, [Set if bat QWT library found])
462 AC_SUBST(QWT_LDFLAGS)
466 dnl -------------------------------------------
467 dnl bwx-console (default off)
468 dnl -------------------------------------------
469 AC_ARG_ENABLE(bwx-console,
470 AC_HELP_STRING([--enable-bwx-console], [enable build of wxWidgets console @<:@default=no@:>@]),
472 if test x$enableval = xyes; then
473 support_wx_console=yes
479 if test x$support_wx_console = xyes; then
480 abc=`$WXCONFIG $WXFLAGS --cppflags`
482 if test $pkg = 0; then
483 wx_version="wxWidgets `$WXCONFIG $WXFLAGS --release`"
484 WXCONS_CPPFLAGS=`$WXCONFIG $WXFLAGS --cppflags`
485 WXCONS_LDFLAGS=`$WXCONFIG $WXFLAGS --libs`
487 AC_SUBST(WXCONS_CPPFLAGS)
488 AC_SUBST(WXCONS_LDFLAGS)
489 WX_DIR="src/wx-console"
492 echo "wx-config program not found. bwx-console disabled."
494 support_wx_console=no
499 dnl -------------------------------------------
500 dnl tray-monitor (default off)
501 dnl -------------------------------------------
502 AC_ARG_ENABLE(tray-monitor,
503 AC_HELP_STRING([--enable-tray-monitor], [enable build of Gnome tray monitor (compatible with KDE @<:@default=no@:>@]),
505 if test x$enableval = xyes; then
506 support_tray_monitor=yes
512 if test x$support_tray_monitor = xyes; then
513 abc=`$PKGCONFIG --exists gtk+-2.0`
515 if test $pkg = 0; then
516 TRAY_MONITOR_CPPFLAGS=`$PKGCONFIG --cflags gtk+-2.0`
517 TRAY_MONITOR_LDFLAGS=`$PKGCONFIG --libs gtk+-2.0`
518 AC_SUBST(TRAY_MONITOR_CPPFLAGS)
519 AC_SUBST(TRAY_MONITOR_LDFLAGS)
520 TRAY_MONITOR_DIR=src/tray-monitor
521 abc=`$PKGCONFIG --atleast-version=2.4 gtk+-2.0`
523 if test $pkg = 0; then
524 AC_DEFINE(HAVE_GTK_2_4, 1, [Set if you have GTK 4.2 or greater loaded])
528 AC_SUBST(TRAY_MONITOR_DIR)
530 dnl -------------------------------------------
531 dnl smartalloc (default off)
532 dnl -------------------------------------------
533 AC_ARG_ENABLE(smartalloc,
534 AC_HELP_STRING([--enable-smartalloc], [enable smartalloc debugging support @<:@default=no@:>@]),
536 if test x$enableval = xno; then
537 support_smartalloc=no
542 if test x$support_smartalloc = xyes; then
543 AC_DEFINE(SMARTALLOC, 1, [Set if you want Smartalloc enabled])
546 dnl -------------------------------------------
547 dnl Lock Manager (default off)
548 dnl -------------------------------------------
549 AC_ARG_ENABLE(lockmgr,
550 AC_HELP_STRING([--enable-lockmgr], [enable lock manager support @<:@default=no@:>@]),
552 if test x$enableval = xyes; then
558 if test x$support_lockmgr = xyes; then
559 AC_DEFINE(_USE_LOCKMGR, 1, [Set if you want Lock Manager enabled])
563 dnl -------------------------------------------
564 dnl static-tools (default off)
565 dnl -------------------------------------------
566 AC_ARG_ENABLE(static-tools,
567 AC_HELP_STRING([--enable-static-tools], [enable static tape tools @<:@default=no@:>@]),
569 if test x$enableval = xyes; then
570 if test x$use_libtool = xyes; then
571 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
572 please rerun configure with --disable-libtool])
574 support_static_tools=yes
580 if test x$support_static_tools = xyes; then
581 TTOOL_LDFLAGS="-static"
583 AC_SUBST(TTOOL_LDFLAGS)
585 dnl -------------------------------------------
586 dnl static-fd (default off)
587 dnl -------------------------------------------
588 AC_ARG_ENABLE(static-fd,
589 AC_HELP_STRING([--enable-static-fd], [enable static File daemon @<:@default=no@:>@]),
591 if test x$enableval = xyes; then
592 if test x$use_libtool = xyes; then
593 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
594 please rerun configure with --disable-libtool])
596 support_static_fd=yes
602 if test x$support_static_fd = xyes; then
603 STATIC_FD="static-bacula-fd"
607 dnl -------------------------------------------
608 dnl static-sd (default off)
609 dnl -------------------------------------------
610 AC_ARG_ENABLE(static-sd,
611 AC_HELP_STRING([--enable-static-sd], [enable static Storage daemon @<:@default=no@:>@]),
613 if test x$enableval = xyes; then
614 if test x$use_libtool = xyes; then
615 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
616 please rerun configure with --disable-libtool])
618 support_static_sd=yes
624 if test x$support_static_sd = xyes; then
625 STATIC_SD="static-bacula-sd"
629 dnl -------------------------------------------
630 dnl static-dir (default off)
631 dnl -------------------------------------------
632 AC_ARG_ENABLE(static-dir,
633 AC_HELP_STRING([--enable-static-dir], [enable static Director @<:@default=no@:>@]),
635 if test x$enableval = xyes; then
636 if test x$use_libtool = xyes; then
637 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
638 please rerun configure with --disable-libtool])
640 support_static_dir=yes
646 if test x$support_static_dir = xyes; then
647 STATIC_DIR="static-bacula-dir"
651 dnl -------------------------------------------
652 dnl static-cons (default off)
653 dnl -------------------------------------------
654 AC_ARG_ENABLE(static-cons,
655 AC_HELP_STRING([--enable-static-cons], [enable static Console @<:@default=no@:>@]),
657 if test x$enableval = xyes; then
658 if test x$use_libtool = xyes; then
659 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
660 please rerun configure with --disable-libtool])
662 support_static_cons=yes
670 if test x$support_static_cons = xyes; then
671 STATIC_CONS="static-bconsole"
672 STATIC_GNOME_CONS="static-bgnome-console"
673 STATIC_WX_CONS="static-bwx-console"
675 AC_SUBST(STATIC_CONS)
676 AC_SUBST(STATIC_GNOME_CONS)
677 AC_SUBST(STATIC_WX_CONS)
679 dnl -------------------------------------------
680 dnl client_only (default off)
681 dnl -------------------------------------------
682 AC_ARG_ENABLE(client-only,
683 AC_HELP_STRING([--enable-client-only], [build client (File daemon) only @<:@default=no@:>@]),
685 if test x$enableval = xyes; then
686 build_client_only=yes
692 if test x$build_client_only = xno; then
699 dnl -------------------------------------------
700 dnl director (default on)
701 dnl -------------------------------------------
702 AC_ARG_ENABLE(build-dird,
703 AC_HELP_STRING([--enable-build-dird], [enable building of dird (Director) @<:@default=yes@:>@]),
705 if test x$enableval = xno; then
710 if test x$build_dird = xyes; then
715 DIR_TOOLS="NODIRTOOLS"
720 dnl -------------------------------------------
721 dnl stored (default on)
722 dnl -------------------------------------------
723 AC_ARG_ENABLE(build-stored,
724 AC_HELP_STRING([--enable-build-stored], [enable building of stored (Storage daemon) @<:@default=yes@:>@]),
726 if test x$enableval = xno; then
731 if test x$build_stored = xyes; then
732 STORED_DIR="src/stored"
738 dnl ---------------------------------------------------
739 dnl Check for conio (Bacula readline substitute)(
740 dnl ---------------------------------------------------
741 dnl this allows you to turn it completely off
743 AC_HELP_STRING([--disable-conio], [disable conio support @<:@default=no@:>@]),
745 if test x$enableval = xno; then
752 dnl ---------------------------------------------------
753 dnl Check for IPv6 support
754 dnl ---------------------------------------------------
755 dnl this allows you to turn it completely off
758 AC_HELP_STRING([--enable-ipv6], [enable ipv6 support @<:@default=yes@:>@]),
760 if test x$enableval = xno; then
766 if test x$support_ipv6 = xyes; then
767 AC_TRY_LINK([ #include <sys/types.h>
768 #include <sys/socket.h>
769 #include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;],
770 [support_ipv6=yes], [support_ipv6=no])
773 if test x$support_ipv6 = xyes; then
774 AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
778 if test x$support_conio = xyes; then
779 AC_CHECK_HEADER(termcap.h,
780 [ AC_CHECK_LIB(termcap, tgetent,
781 [ CONS_LIBS="-ltermcap"
786 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
788 [ AC_CHECK_LIB(ncurses, tgetent,
789 [ CONS_LIBS="-lncurses"
794 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
799 AC_CHECK_HEADERS(curses.h)
800 AC_CHECK_HEADER(term.h,
801 [ AC_CHECK_LIB(curses, tgetent,
802 [ CONS_LIBS="-lcurses"
807 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
810 [ echo " "; echo "Required libraries not found. CONIO turned off ..."; echo " "],
819 dnl ---------------------------------------------------
820 dnl Check for readline support/directory (default off)
821 dnl ---------------------------------------------------
822 dnl this allows you to turn it completely off
823 AC_ARG_ENABLE(readline,
824 AC_HELP_STRING([--disable-readline], [disable readline support @<:@default=yes@:>@]),
826 if test x$enableval = xno; then
834 if test x$support_readline = xyes; then
835 AC_ARG_WITH(readline,
836 AC_HELP_STRING([--with-readline@<:@=DIR@:>@], [specify readline library directory]),
838 case "$with_readline" in
843 if test -f ${with_readline}/readline.h; then
844 CONS_INC="-I${with_readline}"
845 CONS_LDFLAGS="-L$with_readline"
846 elif test -f ${with_readline}/include/readline/readline.h; then
847 CONS_INC="-I${with_readline}/include/readline"
848 CONS_LDFLAGS="-L${with_readline}/lib"
849 with_readline="${with_readline}/include/readline"
851 with_readline="/usr/include/readline"
854 AC_CHECK_HEADER(${with_readline}/readline.h,
856 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
857 CONS_LIBS="-lreadline -lhistory -ltermcap"
861 echo "readline.h not found. readline turned off ..."
868 dnl check for standard readline library
869 AC_CHECK_HEADER(/usr/include/readline/readline.h,
871 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
873 CONS_INC="-I/usr/include/readline"
874 CONS_LIBS="-lreadline -ltermcap"
876 dnl Did not find standard library, so try Bacula's default
877 AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h,
879 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
881 CONS_INC="-I${TOP_DIR}/depkgs/readline"
882 CONS_LIBS="-lreadline -lhistory -ltermcap"
883 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
884 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
887 echo "readline.h not found. readline turned off ..."
901 AC_SUBST(CONS_LDFLAGS)
902 AC_SUBST(READLINE_SRC)
904 dnl Minimal stuff for readline Makefile configuration
909 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr lstat lchown)
910 AC_CHECK_FUNCS(nanosleep nl_langinfo)
911 AC_CHECK_HEADERS(varargs.h)
913 dnl End of readline/conio stuff
914 dnl -----------------------------------------------------------------------
916 dnl -----------------------------------------------------------------------
917 dnl Check for Python support
919 AC_MSG_CHECKING(for Python support)
921 AC_HELP_STRING([--with-python@<:@=DIR@:>@], [Include Python support. DIR is the Python base install directory, default is to search through a number of common places for the Python files.]),
925 if test "$withval" != "no"; then
926 if test "$withval" = "yes"; then
927 if test -e /usr/bin/python-config ; then
928 PYTHON_INCDIR=`/usr/bin/python-config --includes`
929 PYTHON_LIBS=`/usr/bin/python-config --libs`
931 for python_root in /usr /usr/local /usr/sfw; do
932 for ver in python2.2 python2.3 python2.4 python2.5 python2.6 python3; do
933 if test -f $python_root/include/${ver}/Python.h; then
934 PYTHON_INCDIR=-I$python_root/include/${ver}
935 if test -d $python_root/lib64/${ver}/config; then
936 PYTHON_LIBS="-L$python_root/lib64/${ver}/config -l${ver}"
938 PYTHON_LIBS="-L$python_root/lib/${ver}/config -l${ver}"
945 if test x$PYTHON_INCDIR = x; then
946 if test -f $prefix/include/Python.h; then
947 PYTHON_INCDIR=-I$prefix/include
948 if test -d $prefix/lib64/config; then
949 PYTHON_LIBS="-L$prefix/lib64/config -lpython"
951 PYTHON_LIBS="-L$prefix/lib/config -lpython"
955 AC_MSG_ERROR(Unable to find Python.h in standard locations)
960 if test -e $withval/bin/python-config ; then
961 PYTHON_INCDIR=`$withval/bin/python-config --includes`
962 PYTHON_LIBS=`$withval/bin/python-config --libs`
963 elif test -f $withval/Python.h; then
964 PYTHON_INCDIR=-I$withval
965 PYTHON_LIBS="-L$withval/config -lpython"
966 elif test -f $withval/include/Python.h; then
967 PYTHON_INCDIR=-I$withval/include
968 if test -d $withval/lib64/config; then
969 PYTHON_LIBS="-L$withval/lib64/config -lpython"
971 PYTHON_LIBS="-L$withval/lib/config -lpython"
973 elif test -f $withval/include/python/Python.h; then
974 PYTHON_INCDIR=-I$withval/include/python
975 if test -d $withval/lib64/python/config; then
976 PYTHON_LIBS="-L$withval/lib64/python/config -lpython"
978 PYTHON_LIBS="-L$withval/lib/python/config -lpython"
982 AC_MSG_ERROR(Invalid Python directory $withval - unable to find Python.h under $withval)
986 AC_DEFINE([HAVE_PYTHON], 1)
989 AC_MSG_NOTICE(checking for more Python libs)
990 saved_LIBS="$LIBS"; LIBS=
991 AC_SEARCH_LIBS(shm_open, [rt])
992 AC_CHECK_LIB(util, openpty)
993 PYTHON_LIBS="$PYTHON_LIBS $LIBS"
1002 AC_SUBST(PYTHON_LIBS)
1003 AC_SUBST(PYTHON_INCDIR)
1006 dnl Find where sockets are (especially for Solaris)
1007 dnl Do this before the TCP Wrappers test since tcp wrappers
1008 dnl uses the socket library and some linkers are stupid.
1010 AC_CHECK_FUNC(socket,
1011 AC_MSG_RESULT(using libc's socket),
1012 AC_CHECK_LIB(xnet,socket)
1013 AC_CHECK_LIB(socket,socket)
1014 AC_CHECK_LIB(inet,socket))
1016 dnl -----------------------------------------------------------
1017 dnl Check whether user wants TCP wrappers support (default off)
1018 dnl -----------------------------------------------------------
1021 AC_ARG_WITH(tcp-wrappers,
1022 AC_HELP_STRING([--with-tcp-wrappers@<:@=DIR@:>@], [enable tcpwrappers support]),
1024 if test "x$withval" != "xno" ; then
1026 LIBS="$saved_LIBS -lwrap"
1027 AC_SEARCH_LIBS(nanosleep, [rt])
1028 AC_MSG_CHECKING(for libwrap)
1031 #include <sys/types.h>
1033 int deny_severity = 0;
1034 int allow_severity = 0;
1035 struct request_info *req;
1040 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
1045 LIBS="$saved_LIBS -lwrap -lnsl"
1046 WRAPLIBS="$saved_LIBS -lwrap -lnsl"
1049 #include <sys/types.h>
1051 int deny_severity = 0;
1052 int allow_severity = 0;
1053 struct request_info *req;
1058 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
1063 AC_MSG_ERROR([*** libwrap missing])
1072 dnl -----------------------------------------------------------
1073 dnl Check whether OpenSSL is available
1074 dnl -----------------------------------------------------------
1075 AC_MSG_CHECKING([for OpenSSL])
1076 dnl The following uses quadrigraphs:
1079 AC_ARG_WITH(openssl,
1080 AC_HELP_STRING([--with-openssl@<:@=DIR@:>@], [Include OpenSSL support. DIR is the OpenSSL base]),
1082 with_openssl_directory=${withval}
1086 if test "x$with_openssl_directory" != "xno"; then
1087 OPENSSL_LIBS="-lssl -lcrypto"
1090 if test "x$with_openssl_directory" != "xyes" && test x"${with_openssl_directory}" != "x"; then
1092 # Make sure the $with_openssl_directory also makes sense
1094 if test -d "$with_openssl_directory/lib" -a -d "$with_openssl_directory/include"; then
1095 OPENSSL_LIBS="-L$with_openssl_directory/lib $OPENSSL_LIBS"
1096 OPENSSL_INC="-I$with_openssl_directory/include $OPENSSL_INC"
1100 saved_LIBS="${LIBS}"
1101 saved_CFLAGS="${CFLAGS}"
1102 LIBS="${saved_LIBS} ${OPENSSL_LIBS}"
1103 CFLAGS="${saved_CFLAGS} ${OPENSSL_INC}"
1107 #include <openssl/ssl.h>
1109 CRYPTO_set_id_callback(NULL);
1112 support_crypto="yes"
1120 #include <openssl/evp.h>
1124 ac_cv_openssl_sha2="yes"
1126 ac_cv_openssl_sha2="no"
1130 dnl Solaris disables greater than 128+ bit encryption in their OpenSSL
1131 dnl implementation, presumably for export reasons. If 192bit AES
1132 dnl is available, we assume that we're running with a 'non-export'
1133 dnl openssl library.
1136 #include <openssl/evp.h>
1140 ac_cv_openssl_export="no"
1142 ac_cv_openssl_export="yes"
1146 LIBS="${saved_LIBS}"
1147 CFLAGS="${saved_CFLAGS}"
1149 if test "$support_tls" = "yes"; then
1150 AC_DEFINE(HAVE_OPENSSL, 1, [Define if OpenSSL library is available])
1151 AC_DEFINE(HAVE_TLS, 1, [Define if TLS support should be enabled])
1152 AC_DEFINE(HAVE_CRYPTO, 1, [Define if encryption support should be enabled])
1155 if test "$ac_cv_openssl_sha2" = "yes"; then
1156 AC_DEFINE(HAVE_SHA2, 1, [Define if the SHA-2 family of digest algorithms is available])
1159 if test "$ac_cv_openssl_export" = "yes"; then
1160 AC_DEFINE(HAVE_OPENSSL_EXPORT_LIBRARY, 1, [Define if the OpenSSL library is export-contrained to 128bit ciphers])
1169 if test "$support_tls" = "no"; then
1174 AC_MSG_RESULT([$support_tls])
1175 AC_SUBST(OPENSSL_LIBS)
1176 AC_SUBST(OPENSSL_INC)
1178 dnl -----------------------------------------------------------
1179 dnl dlopen is needed for plugins
1180 dnl -----------------------------------------------------------
1181 AC_SEARCH_LIBS(dlopen, [dl])
1183 dnl ------------------------------------------
1184 dnl Where to place working dir
1185 dnl ------------------------------------------
1186 working_dir=`eval echo ${prefix}/var/bacula/working`
1187 AC_ARG_WITH(working-dir,
1188 AC_HELP_STRING([--with-working-dir=PATH], [specify path of Bacula working directory]),
1190 if test "x$withval" != "xno" ; then
1191 working_dir=$withval
1196 AC_SUBST(working_dir)
1198 dnl ------------------------------------------------------------------
1199 dnl If the user has not set archivedir, we set our default as /tmp
1200 dnl ------------------------------------------------------------------
1202 AC_ARG_WITH(archivedir,
1203 AC_HELP_STRING([--with-archivedir=PATH], [specify path of SD archive directory]),
1205 if test "x$withval" != "xno" ; then
1211 AC_SUBST(archivedir)
1213 dnl ------------------------------------------------------------------
1214 dnl Allow the user to specify the daemon resource name default hostname
1215 dnl ------------------------------------------------------------------
1217 AC_ARG_WITH(basename,
1218 AC_HELP_STRING([--with-basename=RESNAME], [specify base resource name for daemons]),
1220 if test "x$withval" != "xno" ; then
1228 dnl ------------------------------------------------------------------
1229 dnl Allow the user to override the hostname (default = machine hostname)
1230 dnl ------------------------------------------------------------------
1231 hostname=`uname -n | cut -d '.' -f 1`
1232 if test x${hostname} = x ; then
1233 hostname="localhost"
1235 AC_ARG_WITH(hostname,
1236 AC_HELP_STRING([--with-hostname=RESNAME], [specify host name for daemons]),
1238 if test "x$withval" != "xno" ; then
1247 dnl ------------------------------------------
1248 dnl Where to place scriptdir (script files)
1249 dnl ------------------------------------------
1250 scriptdir=`eval echo ${sysconfdir}`
1251 AC_ARG_WITH(scriptdir,
1252 AC_HELP_STRING([--with-scriptdir=PATH], [specify path of Bacula scripts directory]),
1254 if test "x$withval" != "xno" ; then
1263 dnl ------------------------------------------
1264 dnl Where to place bsrdir (bsr files)
1265 dnl ------------------------------------------
1268 AC_HELP_STRING([--with-bsrdir=PATH], [specify path of Bacula bsrs directory]),
1270 if test "x$withval" != "xno" ; then
1278 dnl ------------------------------------------
1279 dnl Where to place logdir (bsr files)
1280 dnl ------------------------------------------
1283 AC_HELP_STRING([--with-logdir=PATH], [specify path of Bacula logs directory]),
1285 if test "x$withval" != "xno" ; then
1294 # ------------------------------------------
1295 # Where to place plugindir (plugin files)
1296 # ------------------------------------------
1297 plugindir=`eval echo ${libdir}`
1298 AC_ARG_WITH(plugindir,
1299 AC_HELP_STRING([--with-plugindir=PATH], [specify path of Bacula plugins directory]),
1301 if test "x$withval" != "xno" ; then
1309 dnl ------------------------------------------
1310 dnl Where to send dump email
1311 dnl ------------------------------------------
1312 dump_email=root@localhost
1313 AC_ARG_WITH(dump-email,
1314 AC_HELP_STRING([--with-dump-email=EMAIL], [dump email address]),
1316 if test "x$withval" != "xno" ; then
1322 AC_SUBST(dump_email)
1324 dnl ------------------------------------------
1325 dnl Where to send job email
1326 dnl ------------------------------------------
1327 job_email=root@localhost
1328 AC_ARG_WITH(job-email,
1329 AC_HELP_STRING([--with-job-email=EMAIL], [job output email address]),
1331 if test "x$withval" != "xno" ; then
1339 dnl ------------------------------------------
1340 dnl Where to find smtp host
1341 dnl ------------------------------------------
1343 AC_ARG_WITH(smtp_host,
1344 AC_HELP_STRING([--with-smtp-host=HOST], [SMTP mail host address]),
1346 if test "x$withval" != "xno" ; then
1354 dnl ------------------------------------
1355 dnl Where to place pid files
1356 dnl ------------------------------------
1358 AC_ARG_WITH(pid-dir,
1359 AC_HELP_STRING([--with-pid-dir=PATH], [specify location of Bacula pid files]),
1361 if test "x$withval" != "xno" ; then
1367 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
1370 dnl ------------------------------------
1371 dnl Where to place subsys "lock file"
1372 dnl ------------------------------------
1373 subsysdir=/var/run/subsys
1374 if test -d /var/run/subsys; then
1375 subsysdir=/var/run/subsys
1376 elif test -d /var/lock/subsys; then
1377 subsysdir=/var/lock/subsys
1379 subsysdir=/var/run/subsys
1381 AC_ARG_WITH(subsys-dir,
1382 AC_HELP_STRING([--with-subsys-dir=PATH], [specify location of Bacula subsys file]),
1384 if test "x$withval" != "xno" ; then
1392 dnl ------------------------------------
1393 dnl Where to start assigning ports
1394 dnl ------------------------------------
1396 AC_ARG_WITH(baseport,
1397 AC_HELP_STRING([--with-baseport=PORT], [specify base port address for daemons]),
1399 if test "x$withval" != "xno" ; then
1406 dir_port=`expr $baseport`
1407 fd_port=`expr $baseport + 1`
1408 sd_port=`expr $fd_port + 1`
1414 dnl ------------------------------------------
1415 dnl Generate passwords
1416 dnl ------------------------------------------
1418 AC_ARG_WITH(dir-password,
1419 AC_HELP_STRING([--with-dir-password=PASSWORD], [specify Director's password]),
1421 if test "x$withval" != "xno" ; then
1422 dir_password=$withval
1427 if test "x$dir_password" = "x" ; then
1428 if test "x$OPENSSL" = "xnone" ; then
1429 key=`autoconf/randpass 33`
1431 key=`openssl rand -base64 33`
1437 AC_ARG_WITH(fd-password,
1438 AC_HELP_STRING([--with-fd-password=PASSWORD], [specify Client's password]),
1440 if test "x$withval" != "xno" ; then
1441 fd_password=$withval
1446 if test "x$fd_password" = "x" ; then
1447 if test "x$OPENSSL" = "xnone" ; then
1448 key=`autoconf/randpass 37`
1450 key=`openssl rand -base64 33`
1456 AC_ARG_WITH(sd-password,
1457 AC_HELP_STRING([--with-sd-password=PASSWORD], [specify Storage daemon's password]),
1459 if test "x$withval" != "xno" ; then
1460 sd_password=$withval
1465 if test "x$sd_password" = "x" ; then
1466 if test "x$OPENSSL" = "xnone" ; then
1467 key=`autoconf/randpass 41`
1469 key=`openssl rand -base64 33`
1475 AC_ARG_WITH(mon-dir-password,
1476 AC_HELP_STRING([--with-mon-dir-password=PASSWORD], [specify Director's password used by the monitor]),
1478 if test "x$withval" != "xno" ; then
1479 mon_dir_password=$withval
1484 if test "x$mon_dir_password" = "x" ; then
1485 if test "x$OPENSSL" = "xnone" ; then
1486 key=`autoconf/randpass 33`
1488 key=`openssl rand -base64 33`
1490 mon_dir_password=$key
1494 AC_ARG_WITH(mon-fd-password,
1495 AC_HELP_STRING([--with-mon-fd-password=PASSWORD], [specify Client's password used by the monitor]),
1497 if test "x$withval" != "xno" ; then
1498 mon_fd_password=$withval
1503 if test "x$mon_fd_password" = "x" ; then
1504 if test "x$OPENSSL" = "xnone" ; then
1505 key=`autoconf/randpass 37`
1507 key=`openssl rand -base64 33`
1509 mon_fd_password=$key
1513 AC_ARG_WITH(mon-sd-password,
1514 AC_HELP_STRING([--with-mon-sd-password=PASSWORD], [specify Storage daemon's password used by the monitor]),
1516 if test "x$withval" != "xno" ; then
1517 mon_sd_password=$withval
1522 if test "x$mon_sd_password" = "x" ; then
1523 if test "x$OPENSSL" = "xnone" ; then
1524 key=`autoconf/randpass 41`
1526 key=`openssl rand -base64 33`
1528 mon_sd_password=$key
1531 AC_SUBST(dir_password)
1532 AC_SUBST(fd_password)
1533 AC_SUBST(sd_password)
1534 AC_SUBST(mon_dir_password)
1535 AC_SUBST(mon_fd_password)
1536 AC_SUBST(mon_sd_password)
1539 dnl Pickup any database name
1542 AC_ARG_WITH(db_name,
1543 AC_HELP_STRING([--with-db-name=DBNAME], [specify database name @<:@default=bacula@:>@]),
1545 if test "x$withval" != "x" ; then
1553 AC_ARG_WITH(db_user,
1554 AC_HELP_STRING([--with-db-user=UNAME], [specify database user @<:@default=bacula@:>@]),
1556 if test "x$withval" != "x" ; then
1564 AC_ARG_WITH(db_password,
1565 AC_HELP_STRING([--with-db-password=PWD], [specify database password @<:@default=*none*@:>@]),
1567 if test "x$withval" != "x" ; then
1568 db_password=$withval
1572 AC_SUBST(db_password)
1575 dnl Pickup a database port
1578 AC_ARG_WITH(db_port,
1579 AC_HELP_STRING([--with-db-port=DBPORT], [specify a database port @<:@default=null@:>@]),
1581 if test "x$withval" != "x" ; then
1589 # Handle users and groups for each daemon
1592 AC_ARG_WITH(dir_user,
1593 AC_HELP_STRING([--with-dir-user=USER], [specify user for Director daemon]),
1595 if test "x$withval" != "x" ; then
1602 AC_ARG_WITH(dir_group,
1603 AC_HELP_STRING([--with-dir-group=GROUP], [specify group for Director daemon]),
1605 if test "x$withval" != "x" ; then
1612 AC_ARG_WITH(sd_user,
1613 AC_HELP_STRING([--with-sd-user=USER], [specify user for Storage daemon]),
1615 if test "x$withval" != "x" ; then
1622 AC_ARG_WITH(sd_group,
1623 AC_HELP_STRING([--with-sd-group=GROUP], [specify group for Storage daemon]),
1625 if test "x$withval" != "x" ; then
1632 AC_ARG_WITH(fd_user,
1633 AC_HELP_STRING([--with-fd-user=USER], [specify user for File daemon]),
1635 if test "x$withval" != "x" ; then
1642 AC_ARG_WITH(fd_group,
1643 AC_HELP_STRING([--with-fd-group=GROUP], [specify group for File daemon]),
1645 if test "x$withval" != "x" ; then
1659 dnl allow setting default executable permissions
1662 AC_ARG_WITH(sbin-perm,
1663 AC_HELP_STRING([--with-sbin-perm=MODE], [specify permissions for sbin binaries @<:@default=0754@:>@]),
1665 if test "x$withval" != "x" ; then
1673 dnl ------------------------------------------------
1674 dnl Bacula check for various SQL database engines
1675 dnl ------------------------------------------------
1677 BA_CHECK_POSTGRESQL_DB
1692 dnl -------------------------------------------
1693 dnl enable batch attribute DB insert (default on)
1694 dnl -------------------------------------------
1695 support_batch_insert=no
1696 A=`test -f $SQL_LIB && nm $SQL_LIB | grep pthread_mutex_lock`
1698 if test $pkg = 0; then
1699 support_batch_insert=yes
1700 AC_ARG_ENABLE(batch-insert,
1701 AC_HELP_STRING([--enable-batch-insert], [enable the DB batch insert code @<:@default=no@:>@]),
1703 if test x$enableval = xno; then
1704 support_batch_insert=no
1706 support_batch_insert=yes
1712 dnl Check if postgresql support batch mode
1713 if test x$DB_TYPE = xpostgresql; then
1714 A=`test -f $SQL_LIB && nm $SQL_LIB | grep PQputCopyData`
1716 if test $pkg != 0; then
1717 support_batch_insert=no
1721 if test x$DB_TYPE = xdbi; then
1725 dnl Check for batch insert
1726 if test $DB_PROG = postgresql; then
1727 A=`test -f $SQL_LIB && nm $SQL_LIB | grep PQputCopyData`
1731 if test $DB_PROG = mysql; then
1732 A=`test -f $SQL_LIB && nm $DB_PROG_LIB | grep pthread_mutex_lock`
1736 if test $DB_PROG = sqlite3; then
1737 A=`test -f $SQL_LIB && nm $DB_PROG_LIB | grep pthread_mutex_lock`
1741 if test $pkg = 0; then
1742 AC_ARG_ENABLE(batch-insert,
1743 AC_HELP_STRING([--enable-batch-insert], [enable the DB batch insert code @<:@default=no@:>@]),
1745 if test x$enableval = xno; then
1746 support_batch_insert=no
1748 support_batch_insert=yes
1754 dnl If dbi was not chosen, let the comment in file
1758 AC_SUBST(uncomment_dbi)
1760 if test $support_batch_insert = yes ; then
1761 AC_DEFINE(HAVE_BATCH_FILE_INSERT, 1, [Set if DB batch insert code enabled])
1764 AC_DEFINE(PROTOTYPES)
1766 dnl --------------------------------------------------------------------------
1767 dnl Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
1769 if test -z "$CFLAGS" -o "$CFLAGS" = "-g -O2"; then
1770 if test -z "$CCOPTS"; then
1771 CCOPTS='-g -O2 -Wall'
1779 dnl See if we can use 64 bit file addresses
1780 largefile_support="no"
1785 dnl --------------------------------------------------------------------------
1786 dnl CHECKING FOR HEADER FILES
1787 dnl --------------------------------------------------------------------------
1825 AC_STRUCT_ST_BLKSIZE
1829 dnl --------------------------------------------------------------------------
1830 dnl Check for utime.h structure
1831 dnl --------------------------------------------------------------------------
1832 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
1836 #include <sys/types.h>
1841 ba_cv_header_utime_h=yes
1843 ba_cv_header_utime_h=no
1848 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H, 1, [Set if utime.h exists])
1850 dnl --------------------------------------------------------------------------
1851 dnl Check for socklen_t
1852 dnl --------------------------------------------------------------------------
1853 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
1857 #include <sys/types.h>
1858 #include <sys/socket.h>
1862 ba_cv_header_socklen_t=yes
1864 ba_cv_header_socklen_t=no
1869 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T)
1871 dnl --------------------------------------------------------------------------
1872 dnl Check for typeof()
1873 dnl --------------------------------------------------------------------------
1875 AC_CACHE_CHECK(for typeof, ba_cv_have_typeof,
1879 main(){char *a = 0; a = (typeof a)a;}
1881 ba_cv_have_typeof=yes
1883 ba_cv_have_typeof=no
1885 ba_cv_have_typeof=no
1890 test $ba_cv_have_typeof = yes && AC_DEFINE([HAVE_TYPEOF], 1, [Defind to 1 if compiler has typeof])
1895 dnl --------------------------------------------------------------------------
1896 dnl CHECKING FOR FILESYSTEM TYPE
1897 dnl --------------------------------------------------------------------------
1898 AC_MSG_CHECKING(how to get filesystem type)
1900 # The order of these tests is important.
1903 #include <sys/statvfs.h>
1904 #include <sys/fstyp.h>
1906 AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4
1908 if test $fstype = no; then
1911 #include <sys/statfs.h>
1912 #include <sys/fstyp.h>
1914 AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3
1917 if test $fstype = no; then
1920 #include <sys/statfs.h>
1921 #include <sys/vmount.h>
1923 AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX
1926 if test $fstype = no; then
1931 AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD
1934 if test $fstype = no; then
1935 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
1937 if test $fstype = no; then
1940 #include <sys/mount.h>
1941 #include <sys/fs_types.h>
1943 AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix
1946 AC_MSG_RESULT($fstype)
1948 AC_CHECK_HEADER(sys/statvfs.h, [ AC_DEFINE(HAVE_SYS_STATVFS_H,1,[Defines if your system have the sys/statvfs.h header file])] , )
1950 dnl --------------------------------------------------------------------------
1951 dnl CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
1952 dnl --------------------------------------------------------------------------
1962 AC_CHECK_TYPE(ino_t, unsigned long)
1963 AC_CHECK_TYPE(dev_t, unsigned long)
1964 AC_CHECK_TYPE(daddr_t, long)
1965 AC_CHECK_TYPE(major_t, int)
1966 AC_CHECK_TYPE(minor_t, int)
1967 AC_CHECK_TYPE(ssize_t, int)
1973 AC_CHECK_SIZEOF(char, 1)
1974 AC_CHECK_SIZEOF(short int, 2)
1975 AC_CHECK_SIZEOF(int, 4)
1976 AC_CHECK_SIZEOF(long int, 4)
1977 AC_CHECK_SIZEOF(long long int, 8)
1978 AC_CHECK_SIZEOF(int *, 4)
1980 dnl Check for sys/types.h types
1981 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int,
1985 #include <sys/types.h>
1989 ac_cv_have_u_int="yes"
1991 ac_cv_have_u_int="no"
1996 if test "x$ac_cv_have_u_int" = "xyes" ; then
1997 AC_DEFINE(HAVE_U_INT)
2001 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t,
2005 #include <sys/types.h>
2009 ac_cv_have_intmax_t="yes"
2017 ac_cv_have_intmax_t="yes"
2019 ac_cv_have_intmax_t="no"
2026 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
2027 AC_DEFINE(HAVE_INTMAX_T)
2031 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t,
2035 #include <sys/types.h>
2037 u_intmax_t a; a = 1;
2039 ac_cv_have_u_intmax_t="yes"
2045 u_intmax_t a; a = 1;
2047 ac_cv_have_u_intmax_t="yes"
2049 ac_cv_have_u_intmax_t="no"
2056 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
2057 AC_DEFINE(HAVE_U_INTMAX_T)
2061 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t,
2065 #include <sys/types.h>
2067 int8_t a; int16_t b; int32_t c; a = b = c = 1;
2069 ac_cv_have_intxx_t="yes"
2071 ac_cv_have_intxx_t="no"
2076 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
2077 AC_DEFINE(HAVE_INTXX_T)
2081 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t,
2085 #include <sys/types.h>
2089 ac_cv_have_int64_t="yes"
2091 ac_cv_have_int64_t="no"
2096 if test "x$ac_cv_have_int64_t" = "xyes" ; then
2097 AC_DEFINE(HAVE_INT64_T)
2101 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t,
2105 #include <sys/types.h>
2107 u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;
2109 ac_cv_have_u_intxx_t="yes"
2111 ac_cv_have_u_intxx_t="no"
2116 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
2117 AC_DEFINE(HAVE_U_INTXX_T)
2121 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t,
2125 #include <sys/types.h>
2129 ac_cv_have_u_int64_t="yes"
2131 ac_cv_have_u_int64_t="no"
2136 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
2137 AC_DEFINE(HAVE_U_INT64_T)
2141 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
2142 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2144 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
2147 #include <sys/bitypes.h>
2149 int8_t a; int16_t b; int32_t c;
2150 u_int8_t e; u_int16_t f; u_int32_t g;
2151 a = b = c = e = f = g = 1;
2153 AC_DEFINE(HAVE_U_INTXX_T)
2154 AC_DEFINE(HAVE_INTXX_T)
2155 AC_DEFINE(HAVE_SYS_BITYPES_H)
2163 if test -z "$have_u_intxx_t" ; then
2164 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t,
2168 #include <sys/types.h>
2170 uint8_t a; uint16_t b;
2171 uint32_t c; a = b = c = 1;
2173 ac_cv_have_uintxx_t="yes"
2175 ac_cv_have_uintxx_t="no"
2180 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
2181 AC_DEFINE(HAVE_UINTXX_T)
2185 if (test -z "$have_u_int64_t" || test -z "$have_int64_t" && \
2186 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2188 AC_MSG_CHECKING([for int64_t and u_int64_t types in sys/bitypes.h])
2191 #include <sys/bitypes.h>
2193 int64_t a; u_int64_t b;
2196 AC_DEFINE(HAVE_U_INT64_T)
2197 AC_DEFINE(HAVE_INT64_T)
2205 if (test -z "$have_uintxx_t" && \
2206 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2208 AC_MSG_CHECKING([for uintXX_t types in sys/bitypes.h])
2211 #include <sys/bitypes.h>
2213 uint8_t a; uint16_t b;
2214 uint32_t c; a = b = c = 1;
2216 AC_DEFINE(HAVE_UINTXX_T)
2224 dnl --------------------------------------------------------------------------
2225 dnl CHECKING FOR REQUIRED LIBRARY FUNCTIONS
2226 dnl --------------------------------------------------------------------------
2242 [echo 'configure: cannot find needed function.'; exit 1]
2245 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
2246 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
2247 AC_CHECK_FUNCS(posix_fadvise)
2248 AC_CHECK_FUNCS(fdatasync)
2250 AC_CHECK_FUNCS(chflags)
2252 AC_CHECK_FUNCS(snprintf vsnprintf gethostid fseeko)
2254 AC_CACHE_CHECK(for va_copy, ba_cv_va_copy,
2259 void use_va_copy(va_list args){va_list args2; va_copy(args2,args); va_end(args2);}
2260 void call_use_va_copy(int junk,...){va_list args; va_start(args,junk); use_va_copy(args); va_end(args);}
2262 call_use_va_copy(1,2,3)
2271 test $ba_cv_va_copy = yes && AC_DEFINE(HAVE_VA_COPY, 1, [Set if va_copy exists])
2273 dnl --------------------------------------------------------------------------
2274 dnl CHECKING FOR THREAD SAFE FUNCTIONS
2275 dnl --------------------------------------------------------------------------
2276 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
2278 # If resolver functions are not in libc check for -lnsl or -lresolv.
2279 AC_CHECK_FUNC(gethostbyname_r,
2280 AC_MSG_RESULT(using libc's resolver),
2281 AC_CHECK_LIB(nsl,gethostbyname_r)
2282 AC_CHECK_LIB(resolv,gethostbyname_r))
2284 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
2285 AC_CHECK_FUNCS(inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)])
2286 AC_CHECK_FUNCS(gethostbyname2, [AC_DEFINE(HAVE_GETHOSTBYNAME2)])
2288 dnl ----------------------------
2289 dnl check sa_len of sockaddr
2290 dnl ----------------------------
2291 AC_CACHE_CHECK(for struct sockaddr has a sa_len field, ac_cv_struct_sockaddr_sa_len,
2295 #include <sys/socket.h>
2297 struct sockaddr s; s.sa_len;
2299 ac_cv_struct_sockaddr_sa_len=yes
2300 ], [ac_cv_struct_sockaddr_sa_len=no
2306 if test $ac_cv_struct_sockaddr_sa_len = yes; then
2307 AC_DEFINE(HAVE_SA_LEN, 1, [Define if sa_len field exists in struct sockaddr])
2314 AC_FUNC_CLOSEDIR_VOID
2315 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
2316 # AC_FUNC_FNMATCH dnl use local version
2318 AC_CHECK_LIB(intl, gettext, [LIBS="$LIBS -lintl"])
2320 AC_CHECK_LIB(sun, getpwnam)
2322 AC_CHECK_HEADERS(zlib.h)
2323 AC_CHECK_LIB(z, deflate, [FDLIBS="-lz"])
2325 if test x$FDLIBS = x-lz; then
2326 AC_DEFINE(HAVE_LIBZ)
2331 dnl Check for ACL support and libraries
2335 AC_HELP_STRING([--disable-acl], [disable acl support @<:@default=auto@:>@]),
2337 if test x$enableval = xyes; then
2339 elif test x$enableval = xno; then
2346 have_extended_acl=no
2347 if test x$support_acl = xyes -o x$support_acl = xauto; then
2348 AC_CHECK_HEADER(sys/acl.h, [ AC_DEFINE(HAVE_SYS_ACL_H,1,[Defines if your system have the sys/acl.h header file])] , )
2349 AC_CHECK_FUNC(acl_get_file,
2353 AC_CHECK_LIB(acl, acl_get_file,
2356 FDLIBS="-lacl $FDLIBS"
2358 AC_CHECK_LIB(pacl, acl_get_file,
2361 FDLIBS="-lpacl $FDLIBS"
2363 AC_CHECK_LIB(sec, acltotext,
2366 FDLIBS="-lsec $FDLIBS"
2368 AC_CHECK_LIB(sec, acl_totext,
2370 have_extended_acl=yes
2382 if test x$support_acl = xyes -a $have_acl != yes; then
2383 AC_MSG_ERROR([acl support explicitly enabled but no supported acl implementation found,
2384 please either load the acl libraries or rerun configure without --enable-acl])
2386 if test $have_acl = yes; then
2387 AC_DEFINE([HAVE_ACL],1,[Normal acl support])
2390 if test $have_extended_acl = yes; then
2391 AC_DEFINE([HAVE_EXTENDED_ACL],1,[Extended acl support])
2397 dnl Check for XATTR support
2400 AC_ARG_ENABLE(xattr,
2401 AC_HELP_STRING([--disable-xattr], [disable xattr support @<:@default=auto@:>@]),
2403 if test x$enableval = xyes; then
2405 elif test x$enableval = xno; then
2412 if test x$support_xattr = xyes -o x$support_xattr = xauto; then
2414 dnl First check for *BSD support
2416 AC_CHECK_HEADER(sys/extattr.h, [ AC_DEFINE(HAVE_SYS_EXTATTR_H,1,[Defines if your system have the sys/extattr.h header file])] , )
2417 AC_CHECK_HEADER(libutil.h, [ AC_DEFINE(HAVE_LIBUTIL_H,1,[Defines if your system have the libutil.h header file])] , )
2418 AC_CHECK_FUNCS(extattr_get_link extattr_set_link extattr_list_link,
2421 AC_DEFINE([HAVE_EXTATTR_GET_LINK],1,[Define to 1 if you have the 'extattr_get_link' function.])
2422 AC_DEFINE([HAVE_EXTATTR_SET_LINK],1,[Define to 1 if you have the 'extattr_set_link' function.])
2423 AC_DEFINE([HAVE_EXTATTR_LIST_LINK],1,[Define to 1 if you have the 'extattr_list_link' function.])
2427 if test $have_xattr = no; then
2428 AC_CHECK_FUNCS(extattr_get_file extattr_set_file extattr_list_file,
2431 AC_DEFINE([HAVE_EXTATTR_GET_FILE],1,[Define to 1 if you have the 'extattr_get_file' function.])
2432 AC_DEFINE([HAVE_EXTATTR_SET_FILE],1,[Define to 1 if you have the 'extattr_set_file' function.])
2433 AC_DEFINE([HAVE_EXTATTR_LIST_FILE],1,[Define to 1 if you have the 'extattr_list_file' function.])
2438 if test $have_xattr = yes; then
2439 have_extattr_string_in_libc=no
2440 AC_CHECK_FUNCS(extattr_namespace_to_string extattr_string_to_namespace,
2442 have_extattr_string_in_libc=yes
2443 AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2444 AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2449 dnl If extattr_namespace_to_string and extattr_string_to_namespace are not in libc see if they are in libutil
2451 if test $have_extattr_string_in_libc = no; then
2452 AC_CHECK_LIB(util, extattr_namespace_to_string extattr_string_to_namespace,
2454 AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2455 AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2456 FDLIBS="-lutil $FDLIBS"
2463 dnl If we failed to find *BSD support try the Linux or OSX implementation of xattr
2465 if test $have_xattr = no; then
2466 AC_CHECK_HEADER(sys/xattr.h, [ AC_DEFINE(HAVE_SYS_XATTR_H,1,[Defines if your system have the sys/xattr.h header file])] , )
2467 AC_CHECK_FUNCS(llistxattr lgetxattr lsetxattr,
2470 AC_DEFINE([HAVE_LLISTXATTR],1,[Define to 1 if you have the 'llistxattr' function.])
2471 AC_DEFINE([HAVE_LGETXATTR],1,[Define to 1 if you have the 'lgetxattr' function.])
2472 AC_DEFINE([HAVE_LSETXATTR],1,[Define to 1 if you have the 'lsetxattr' function.])
2476 if test $have_xattr = no; then
2477 AC_CHECK_FUNCS(listxattr getxattr setxattr,
2480 AC_DEFINE([HAVE_LISTXATTR],1,[Define to 1 if you have the 'listxattr' function.])
2481 AC_DEFINE([HAVE_GETXATTR],1,[Define to 1 if you have the 'getxattr' function.])
2482 AC_DEFINE([HAVE_SETXATTR],1,[Define to 1 if you have the 'setxattr' function.])
2489 dnl If we failed to find *BSD support and the Linux or OSX implementation of xattr try the Solaris xattr implementation
2491 if test $have_xattr = no; then
2492 AC_CHECK_HEADER(sys/attr.h, [ AC_DEFINE(HAVE_SYS_ATTR_H,1,[Defines if your system have the sys/attr.h header file])] , )
2493 AC_CHECK_HEADER(sys/nvpair.h, [ AC_DEFINE(HAVE_SYS_NVPAIR_H,1,[Defines if your system have the sys/nvpair.h header file])] , )
2494 AC_CHECK_HEADER(attr.h, [ AC_DEFINE(HAVE_ATTR_H,1,[Defines if your system have the attr.h header file])] , )
2496 AC_CHECK_FUNCS(openat fstatat unlinkat fchownat futimesat,
2499 AC_DEFINE([HAVE_OPENAT],1,[Define to 1 if you have the 'openat' function.])
2500 AC_DEFINE([HAVE_FSTATAT],1,[Define to 1 if you have the 'fstatat' function.])
2501 AC_DEFINE([HAVE_UNLINKAT],1,[Define to 1 if you have the 'unlinkat' function.])
2502 AC_DEFINE([HAVE_FCHOWNAT],1,[Define to 1 if you have the 'fchownat' function.])
2503 AC_DEFINE([HAVE_FUTIMESAT],1,[Define to 1 if you have the 'futimesat' function.])
2507 if test $have_xattr = yes; then
2508 AC_CHECK_LIB(nvpair, nvlist_next_nvpair,
2510 AC_DEFINE([HAVE_NVLIST_NEXT_NVPAIR],1,[Define to 1 if you have the 'nvlist_next_nvpair' function.])
2511 FDLIBS="-lnvpair $FDLIBS"
2517 if test x$support_xattr = xyes -a $have_xattr != yes; then
2518 AC_MSG_ERROR([xattr support explicitly enabled but no supported xattr implementation found,
2519 please either load the xattr libraries or rerun configure without --enable-xattr])
2521 if test $have_xattr = yes; then
2522 AC_DEFINE([HAVE_XATTR],1,[Extended Attributes support])
2528 dnl Check for pthread libraries
2531 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
2533 AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
2535 AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
2537 AC_CHECK_FUNC(pthread_create)
2546 dnl Check for headers, functions and libraries required to support
2547 dnl keeping readall capabilities
2549 AC_CHECK_HEADERS(sys/prctl.h sys/capability.h)
2550 AC_CHECK_FUNCS(prctl setreuid)
2551 AC_CHECK_LIB([cap], [cap_set_proc], [CAP_LIBS="-lcap"], [CAP_LIBS=])
2552 if test x$CAP_LIBS = x-lcap; then
2553 AC_DEFINE(HAVE_LIBCAP, 1, [Define if you have libcap])
2562 if test x$have_gcc = xyes ; then
2563 CPPFLAGS="$CPPFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
2564 CFLAGS="$CFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
2566 LDFLAGS=${LDFLAGS--O}
2567 DB_LIBS="${SQL_LFLAGS}"
2568 CPPFLAGS="$CPPFLAGS"
2581 AC_SUBST(X_EXTRA_LIBS)
2586 dnl extra configurable objects
2597 dnl Finally we set appropriate distribution specific
2598 dnl variables and defaults
2600 dnl PFILES are platform specific files
2601 PFILES="platforms/Makefile"
2606 hostname=`uname -n | cut -d '.' -f 1`
2607 if test x${hostname} = x ; then
2608 hostname="localhost"
2610 dnl Make sure hostname is resolved
2611 ping -c 1 $hostname 2>/dev/null 1>/dev/null
2612 if test ! $? = 0; then
2613 hostname="localhost"
2619 PSCMD="ps -e -o pid,comm"
2621 platforms/aix/Makefile"
2622 TAPEDRIVE="/dev/rmt0.1"
2626 PTHREAD_LIB="-lpthread -lexc"
2627 if test "${CC}" = "gcc" ; then
2634 TAPEDRIVE="/dev/nrmt0"
2637 DISTVER=`uname -a |awk '{print $3}'`
2638 TAPEDRIVE="/dev/nrmt0"
2639 PTHREAD_LIB="-pthread"
2640 CFLAGS="${CFLAGS} -pthread"
2641 PSCMD="ps -ax -o pid,command"
2645 platforms/bsdi/Makefile \
2646 platforms/bsdi/bacula-fd \
2647 platforms/bsdi/bacula-sd \
2648 platforms/bsdi/bacula-dir"
2649 largefile_support="yes"
2652 DISTVER=`uname -a |awk '{print $3}'`
2653 TAPEDRIVE="/dev/nrst0"
2656 WLDFLAGS="-mwindows"
2660 TAPEDRIVE="/dev/nst0"
2661 PSCMD="ps -e -o pid,command"
2664 platforms/darwin/Makefile"
2668 TAPEDRIVE="/dev/nst0"
2669 PSCMD="ps -e -o pid,command"
2672 platforms/osx/Makefile"
2675 if `test -f /etc/apt/sources.list && grep -q ubuntu /etc/apt/sources.list`; then
2678 DISTVER=`cat /etc/debian_version`
2679 if test -f /etc/lsb-release ; then
2681 if test "x$DISTRIB_ID" != "x" ; then
2682 DISTNAME=$DISTRIB_ID
2684 if test "x$DISTRIB_RELEASE" != "x" ; then
2685 DISTVER=$DISTRIB_RELEASE
2688 if test "$DISTNAME" = "Ubuntu" ; then
2691 TAPEDRIVE="/dev/nst0"
2692 PSCMD="ps -e -o pid,command"
2693 if test "$DISTNAME" = "ubuntu" ; then
2695 platforms/ubuntu/Makefile \
2696 platforms/ubuntu/bacula-fd \
2697 platforms/ubuntu/bacula-sd \
2698 platforms/ubuntu/bacula-dir"
2701 platforms/debian/Makefile \
2702 platforms/debian/bacula-fd \
2703 platforms/debian/bacula-sd \
2704 platforms/debian/bacula-dir"
2708 DISTVER=`uname -a |awk '{print $3}'`
2709 VER=`echo $DISTVER | cut -c 1`
2710 if test x$VER = x4 ; then
2711 PTHREAD_LIB="${PTHREAD_LIBS:--pthread}"
2712 CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS:--pthread}"
2716 TAPEDRIVE="/dev/nrsa0"
2717 PSCMD="ps -ax -o pid,command"
2719 platforms/freebsd/Makefile \
2720 platforms/freebsd/bacula-fd \
2721 platforms/freebsd/bacula-sd \
2722 platforms/freebsd/bacula-dir"
2723 largefile_support="yes"
2726 PSCMD="UNIX95=1; ps -e -o pid,comm"
2727 CFLAGS="${CFLAGS} -D_XOPEN_SOURCE_EXTENDED=1"
2729 TAPEDRIVE="/dev/rmt/0hnb"
2730 PTHREAD_LIB="-lpthread"
2731 AC_DEFINE([_INCLUDE_LONGLONG])
2735 TAPEDRIVE="/dev/rmt/0cbn"
2736 PSCMD="ps -e -o pid,comm"
2738 platforms/irix/Makefile \
2739 platforms/irix/bacula-fd \
2740 platforms/irix/bacula-sd \
2741 platforms/irix/bacula-dir"
2744 DISTVER=`uname -a |awk '{print $3}'`
2747 TAPEDRIVE="/dev/nrst0"
2748 PSCMD="ps -ax -o pid,command"
2749 PTHREAD_LIB="-pthread"
2750 CFLAGS="${CFLAGS} -pthread"
2753 DISTVER=`uname -a |awk '{print $3}'`
2756 TAPEDRIVE="/dev/nrst0"
2757 PSCMD="ps -ax -o pid,command"
2758 PTHREAD_LIB="-pthread"
2759 CFLAGS="${CFLAGS} -pthread"
2761 platforms/openbsd/Makefile \
2762 platforms/openbsd/bacula-fd \
2763 platforms/openbsd/bacula-sd \
2764 platforms/openbsd/bacula-dir"
2767 if test -f /etc/whitebox-release ; then
2768 f=/etc/whitebox-release
2770 f=/etc/redhat-release
2772 if test `cat $f | grep release |\
2773 cut -f 3 -d ' '`x = "Enterprise"x ; then
2774 DISTVER="Enterprise "`cat $f | grep release |\
2777 DISTVER=`cat /etc/redhat-release | grep release |\
2780 TAPEDRIVE="/dev/nst0"
2781 PSCMD="ps -e -o pid,command"
2783 platforms/redhat/Makefile \
2784 platforms/redhat/bacula-fd \
2785 platforms/redhat/bacula-sd \
2786 platforms/redhat/bacula-dir
2790 DISTVER=`cat /etc/mandrake-release | grep release |\
2792 TAPEDRIVE="/dev/nst0"
2793 PSCMD="ps -e -o pid,command"
2795 platforms/mandrake/Makefile \
2796 platforms/mandrake/bacula-fd \
2797 platforms/mandrake/bacula-sd \
2798 platforms/mandrake/bacula-dir \
2799 platforms/mandrake/bacula.spec \
2803 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
2804 TAPEDRIVE="/dev/nst0"
2805 PSCMD="ps -e -o pid,command"
2807 platforms/gentoo/Makefile \
2808 platforms/gentoo/bacula-init \
2809 platforms/gentoo/bacula-fd \
2810 platforms/gentoo/bacula-sd \
2811 platforms/gentoo/bacula-dir"
2814 DISTVER=`cat /etc/slackware-version`
2815 TAPEDRIVE="/dev/nst0"
2816 PSCMD="ps -e -o pid,command"
2818 platforms/slackware/Makefile \
2819 platforms/slackware/rc.bacula-fd \
2820 platforms/slackware/rc.bacula-sd \
2821 platforms/slackware/rc.bacula-dir\
2822 platforms/slackware/functions.bacula"
2826 TAPEDRIVE="/dev/rmt/0cbn"
2827 PSCMD="ps -e -o pid,comm"
2829 platforms/solaris/Makefile \
2830 platforms/solaris/bacula-fd \
2831 platforms/solaris/bacula-sd \
2832 platforms/solaris/bacula-dir"
2833 if test x$DISTVER = x5.6 ; then
2834 AC_DEFINE(HAVE_OLD_SOCKOPT)
2836 LIBS="$LIBS -lresolv"
2839 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
2841 TAPEDRIVE="/dev/nst0"
2842 PSCMD="ps -e -o pid,command"
2844 platforms/suse/Makefile \
2845 platforms/suse/bacula-fd \
2846 platforms/suse/bacula-sd \
2847 platforms/suse/bacula-dir \
2848 platforms/suse/bacula \
2849 platforms/suse/bacula.spec"
2854 TAPEDRIVE="/dev/nst0"
2855 PSCMD="ps -e -o pid,command"
2857 platforms/suse/Makefile \
2858 platforms/suse/bacula-fd \
2859 platforms/suse/bacula-sd \
2860 platforms/suse/bacula-dir"
2864 TAPEDRIVE="/dev/nst0"
2867 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
2873 LIBS="$PTHREAD_LIB $LIBS"
2875 AC_DEFINE_UNQUOTED(lld, "$lld")
2876 AC_DEFINE_UNQUOTED(llu, "$llu")
2884 dnl common parts of the Makefile
2885 MCOMMON=./autoconf/Make.common
2886 AC_SUBST_FILE(MCOMMON)
2889 if test "x${subsysdir}" = "x${sbindir}" ; then
2892 echo "You have set both --sbindir and --with-subsys-dir"
2893 echo " equal to: ${subsysdir} "
2894 echo "This is not permitted. Please reconfigure."
2896 echo "Aborting configuration ..."
2902 AC_OUTPUT([autoconf/Make.common \
2905 scripts/startmysql \
2907 scripts/btraceback \
2913 scripts/bacula-ctl-dir \
2914 scripts/bacula-ctl-fd \
2915 scripts/bacula-ctl-sd \
2916 scripts/devel_bacula \
2919 scripts/bacula.desktop.gnome1 \
2920 scripts/bacula.desktop.gnome2 \
2921 scripts/bacula.desktop.gnome1.consolehelper \
2922 scripts/bacula.desktop.gnome2.consolehelper \
2923 scripts/bacula.desktop.gnome1.xsu \
2924 scripts/bacula.desktop.gnome2.xsu \
2925 scripts/bgnome-console.console_apps \
2926 scripts/mtx-changer \
2927 scripts/disk-changer \
2928 scripts/dvd-handler \
2929 scripts/dvd-simulator \
2930 scripts/bacula-tray-monitor.desktop \
2931 scripts/logwatch/Makefile \
2932 scripts/logwatch/logfile.bacula.conf \
2933 scripts/wxconsole.console_apps \
2934 scripts/wxconsole.desktop.consolehelper \
2935 scripts/wxconsole.desktop.xsu \
2936 scripts/bat.desktop \
2937 scripts/bat.desktop.xsu \
2938 scripts/bat.desktop.consolehelper \
2939 scripts/bat.console_apps \
2942 src/console/Makefile \
2943 src/console/bconsole.conf \
2944 src/qt-console/bat.conf \
2945 src/qt-console/bat.pro \
2946 src/qt-console/bat.pro.mingw32 \
2947 src/qt-console/install_conf_file \
2948 src/wx-console/Makefile \
2949 src/wx-console/bwx-console.conf \
2950 src/tray-monitor/Makefile \
2951 src/tray-monitor/tray-monitor.conf \
2953 src/dird/bacula-dir.conf \
2955 src/stored/Makefile \
2956 src/stored/bacula-sd.conf \
2957 src/filed/Makefile \
2958 src/filed/bacula-fd.conf \
2960 src/cats/make_catalog_backup \
2961 src/cats/delete_catalog_backup \
2962 src/cats/create_postgresql_database \
2963 src/cats/update_postgresql_tables \
2964 src/cats/make_postgresql_tables \
2965 src/cats/grant_postgresql_privileges \
2966 src/cats/drop_postgresql_tables \
2967 src/cats/drop_postgresql_database \
2968 src/cats/create_mysql_database \
2969 src/cats/update_mysql_tables \
2970 src/cats/make_mysql_tables \
2971 src/cats/grant_mysql_privileges \
2972 src/cats/drop_mysql_tables \
2973 src/cats/drop_mysql_database \
2974 src/cats/create_sqlite_database \
2975 src/cats/update_sqlite_tables \
2976 src/cats/make_sqlite_tables \
2977 src/cats/grant_sqlite_privileges \
2978 src/cats/drop_sqlite_tables \
2979 src/cats/drop_sqlite_database \
2980 src/cats/create_sqlite3_database \
2981 src/cats/update_sqlite3_tables \
2982 src/cats/make_sqlite3_tables \
2983 src/cats/grant_sqlite3_privileges \
2984 src/cats/drop_sqlite3_tables \
2985 src/cats/drop_sqlite3_database \
2988 src/cats/create_bdb_database \
2989 src/cats/update_bdb_tables \
2990 src/cats/make_bdb_tables \
2991 src/cats/grant_bdb_privileges \
2992 src/cats/drop_bdb_tables \
2993 src/cats/drop_bdb_database \
2994 src/cats/create_bacula_database \
2995 src/cats/update_bacula_tables \
2996 src/cats/grant_bacula_privileges \
2997 src/cats/make_bacula_tables \
2998 src/cats/drop_bacula_tables \
2999 src/cats/drop_bacula_database \
3000 src/findlib/Makefile \
3001 src/tools/Makefile \
3002 src/plugins/fd/Makefile \
3003 src/plugins/sd/Makefile \
3004 src/plugins/dir/Makefile \
3005 src/win32/Makefile.inc \
3007 updatedb/update_mysql_tables_9_to_10 \
3008 updatedb/update_sqlite3_tables_9_to_10 \
3009 updatedb/update_postgresql_tables_9_to_10 \
3010 updatedb/update_sqlite_tables_9_to_10 \
3011 updatedb/update_mysql_tables_10_to_11 \
3012 updatedb/update_sqlite3_tables_10_to_11 \
3013 updatedb/update_postgresql_tables_10_to_11 \
3014 updatedb/update_sqlite_tables_10_to_11 \
3019 if test "${support_bat}" = "yes" ; then
3020 if test "x$QMAKE" = "xnone" && test "x$QMAKEQT4" = "xnone"; then
3021 AC_MSG_ERROR([Could not find qmake or qmake-qt4 in $PATH. Check your Qt installation])
3026 if test "x$QMAKEQT4" != "xnone"; then
3031 echo "Creating bat Makefile"
3040 dnl if CC is gcc, we can rebuild the dependencies (since the depend rule
3041 dnl requires gcc). If it's not, don't rebuild dependencies
3043 if test X"$GCC" = "Xyes" ; then
3044 echo "Doing make of dependencies"
3045 ${MAKE:-make} depend
3049 chmod 755 install_conf_file build-depkgs-qt-console
3053 chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
3054 chmod 755 dvd-handler dvd-simulator
3055 chmod 755 bconsole gconsole mtx-changer devel_bacula logrotate
3059 chmod 755 $c/update_mysql_tables_10_to_11 $c/update_sqlite3_tables_10_to_11
3060 chmod 755 $c/update_postgresql_tables_10_to_11 $c/update_sqlite_tables_10_to_11
3064 chmod 755 $c/create_bacula_database $c/update_bacula_tables $c/make_bacula_tables
3065 chmod 755 $c/grant_bacula_privileges $c/drop_bacula_tables $c/drop_bacula_database
3067 chmod 755 $c/create_bdb_database $c/update_bdb_tables $c/make_bdb_tables
3068 chmod 755 $c/grant_bdb_privileges $c/drop_bdb_tables $c/drop_bdb_database
3070 chmod 755 $c/create_mysql_database $c/update_mysql_tables $c/make_mysql_tables
3071 chmod 755 $c/grant_mysql_privileges $c/drop_mysql_tables $c/drop_mysql_database
3073 chmod 755 $c/create_sqlite_database $c/update_sqlite_tables $c/make_sqlite_tables
3074 chmod 755 $c/grant_sqlite_privileges $c/drop_sqlite_tables $c/drop_sqlite_database
3076 chmod 755 $c/create_sqlite3_database $c/update_sqlite3_tables $c/make_sqlite3_tables
3077 chmod 755 $c/grant_sqlite3_privileges $c/drop_sqlite3_tables $c/drop_sqlite3_database
3079 chmod 755 $c/create_postgresql_database $c/update_postgresql_tables $c/make_postgresql_tables
3080 chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables $c/drop_postgresql_database
3082 chmod 755 $c/make_catalog_backup $c/delete_catalog_backup
3086 chmod 755 src/win32/build-depkgs-mingw32
3088 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
3089 largefile_support="yes"
3092 dnl Only try to find out the version number of the compiler when we know its some kind of GCC compiler
3093 if test X"$GCC" = "Xyes" ; then
3095 dnl A whole lot of hand springs to get the compiler version.
3096 dnl This is because gcc changed the output in version 3.0
3098 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3099 if test "x${CCVERSION}" = "x" ; then
3100 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3102 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3103 if test x"${CXXVERSION}" = x ; then
3104 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3108 # clean up any old junk
3114 if test "x${db_type}" = "xInternal" ; then
3117 echo "You have not specified either --enable-client-only or one of the"
3118 echo " supported databases: MySQL, PostgreSQL, SQLite3, SQLite or DBI."
3119 echo " This is not permitted. Please reconfigure."
3121 echo "Aborting the configuration ..."
3128 Configuration on `date`:
3130 Host: ${host}${post_host} -- ${DISTNAME} ${DISTVER}
3131 Bacula version: ${BACULA} ${VERSION} (${DATE})
3132 Source code location: ${srcdir}
3133 Install binaries: ${sbindir}
3134 Install libraries: ${libdir}
3135 Install config files: ${sysconfdir}
3136 Scripts directory: ${scriptdir}
3137 Archive directory: ${archivedir}
3138 Working directory: ${working_dir}
3139 PID directory: ${piddir}
3140 Subsys directory: ${subsysdir}
3141 Man directory: ${mandir}
3142 Data directory: ${datarootdir}
3143 Plugin directory: ${plugindir}
3144 C Compiler: ${CC} ${CCVERSION}
3145 C++ Compiler: ${CXX} ${CXXVERSION}
3146 Compiler flags: ${WCFLAGS} ${CFLAGS}
3147 Linker flags: ${WLDFLAGS} ${LDFLAGS}
3149 Statically Linked Tools: ${support_static_tools}
3150 Statically Linked FD: ${support_static_fd}
3151 Statically Linked SD: ${support_static_sd}
3152 Statically Linked DIR: ${support_static_dir}
3153 Statically Linked CONS: ${support_static_cons}
3154 Database type: ${db_type}
3155 Database port: ${db_port}
3156 Database lib: ${DB_LIBS}
3157 Database name: ${db_name}
3158 Database user: ${db_user}
3160 Job Output Email: ${job_email}
3161 Traceback Email: ${dump_email}
3162 SMTP Host Address: ${smtp_host}
3164 Director Port: ${dir_port}
3165 File daemon Port: ${fd_port}
3166 Storage daemon Port: ${sd_port}
3168 Director User: ${dir_user}
3169 Director Group: ${dir_group}
3170 Storage Daemon User: ${sd_user}
3171 Storage DaemonGroup: ${sd_group}
3172 File Daemon User: ${fd_user}
3173 File Daemon Group: ${fd_group}
3175 SQL binaries Directory ${SQL_BINDIR}
3177 Large file support: $largefile_support
3178 Bacula conio support: ${got_conio} ${CONS_LIBS}
3179 readline support: ${got_readline} ${PRTREADLINE_SRC}
3180 TCP Wrappers support: ${TCPW_MSG} ${WRAPLIBS}
3181 TLS support: ${support_tls}
3182 Encryption support: ${support_crypto}
3183 ZLIB support: ${have_zlib}
3184 enable-smartalloc: ${support_smartalloc}
3185 enable-lockmgr: ${support_lockmgr}
3186 bat support: ${support_bat} ${QWT_LDFLAGS}
3187 enable-gnome: ${support_gnome} ${gnome_version}
3188 enable-bwx-console: ${support_wx_console} ${wx_version}
3189 enable-tray-monitor: ${support_tray_monitor}
3190 client-only: ${build_client_only}
3191 build-dird: ${build_dird}
3192 build-stored: ${build_stored}
3193 ACL support: ${have_acl}
3194 XATTR support: ${have_xattr}
3195 Python support: ${support_python} ${PYTHON_LIBS}
3196 Batch insert enabled: ${support_batch_insert}