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 if test x${prefix} = xNONE ; then
229 if test `eval echo ${sysconfdir}` = NONE/etc ; then
230 sysconfdir=/etc/bacula
233 if test `eval echo ${libdir}` = NONE/lib ; then
237 if test `eval echo ${includedir}` = NONE/include ; then
238 includedir=/usr/include
241 if test `eval echo ${datarootdir}` = NONE/share ; then
242 datarootdir=/usr/share
247 dnl -------------------------------------------------------------------------
248 dnl If the user has not set --exec-prefix, we default to ${prefix}
249 dnl -------------------------------------------------------------------------
250 if test x${exec_prefix} = xNONE ; then
251 exec_prefix=${prefix}
254 sysconfdir=`eval echo ${sysconfdir}`
255 datarootdir=`eval echo ${datarootdir}`
256 docdir=`eval echo ${docdir}`
257 htmldir=`eval echo ${htmldir}`
258 libdir=`eval echo ${libdir}`
259 includedir=`eval echo ${includedir}`
260 localedir=`eval echo ${datarootdir}/locale`
261 AC_DEFINE_UNQUOTED(SYSCONFDIR, "$sysconfdir")
262 AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir")
264 dnl ------------------------------------------------------------------
265 dnl If the user has not set --sbindir, we set our default as /sbin
266 dnl ------------------------------------------------------------------
267 if test x$sbindir = x'${exec_prefix}/sbin' ; then
268 sbindir=${exec_prefix}/sbin
270 sbindir=`eval echo ${sbindir}`
272 dnl -------------------------------------------------------------------------
273 dnl If the user has not set --mandir, we default to /usr/share/man
274 dnl -------------------------------------------------------------------------
275 if test x$mandir = x'${prefix}/man' ; then
276 mandir=/usr/share/man
279 dnl -------------------------------------------------------------------------
280 dnl If the user has not set --htmldir, we default to /usr/share/doc/bacula/html
281 dnl -------------------------------------------------------------------------
282 if test x$htmldir = x${docdir} ; then
283 htmldir=`eval echo ${docdir}bacula/html`
286 dnl -------------------------------------------------------------------------
287 dnl If the user has not set --docdir, we default to /usr/share/doc/
288 dnl -------------------------------------------------------------------------
289 if test x$docdir = x'/usr/share/doc/' ; then
290 docdir=`eval echo ${docdir}bacula`
294 AC_PATH_PROGS(MSGFMT, msgfmt, no)
295 if test "$MSGFMT" = "no"
297 echo 'msgfmt program not found, disabling NLS !'
299 USE_INCLUDED_LIBINTL=no
307 support_postgresql=no
309 support_smartalloc=yes
314 support_wx_console=no
315 support_tray_monitor=no
320 support_static_tools=no
323 support_static_dir=no
324 support_static_cons=no
334 dnl --------------------------------------------------------------------------
335 dnl CHECKING COMMAND LINE OPTIONS
336 dnl --------------------------------------------------------------------------
338 dnl -------------------------------------------
339 dnl gnome (default off)
340 dnl -------------------------------------------
342 AC_HELP_STRING([--enable-gnome], [enable build of bgnome-console GUI @<:@default=no@:>@]),
344 if test x$enableval = xyes; then
351 if test x$support_gnome = xyes; then
352 AC_MSG_ERROR(bgnome-console no longer supported)
353 AC_MSG_ERROR(--enable-gnome option no longer supported)
355 # AC_SUBST(GNOME_DIR)
357 dnl -------------------------------------------
358 dnl bat (default off)
359 dnl -------------------------------------------
361 AC_HELP_STRING([--enable-bat], [enable build of bat Qt4 GUI @<:@default=no@:>@]),
363 if test x$enableval = xyes; then
364 AC_DEFINE(HAVE_BAT, 1, [Set if Bacula bat Qt4 GUI support enabled])
371 if test x$support_bat = xyes; then
372 abc=`$PKGCONFIG --atleast-version=4.2 QtGui`
374 if test $pkg = 0; then
375 BAT_DIR=src/qt-console
377 AC_MSG_ERROR(Unable to find Qt4 installation needed by bat)
382 dnl If bat is enabled, we need the qwt library
390 if test x$support_bat = xyes; then
391 AC_MSG_CHECKING(for qwt support)
393 AC_HELP_STRING([--with-qwt@<:@=DIR@:>@], [specify qwt library directory]),
400 if test -f ${with_qwt}/include/qwt.h; then
401 QWT_INC="${with_qwt}/include"
402 QWT_LDFLAGS="-L${with_qwt}/lib"
412 dnl Search in standard places, or --with-qwt not specified
414 if test $no_qwt = no; then
415 if test x$QWT_INC = x; then
416 for root in /usr /usr/local; do
417 for ver in qwt qwt5 qwt-qt4; do
418 if test -f ${root}/include/${ver}/qwt.h; then
419 QWT_INC="${root}/include/${ver}"
420 if test -d ${root}/lib64/; then
421 QWT_LDFLAGS="-L${root}/lib64"
422 elif test -d ${root}/lib/64/; then
423 QWT_LDFLAGS="-L${root}/64"
425 QWT_LDFLAGS="-L${root}/lib"
436 if test x$QWT_INC = x; then
439 AC_DEFINE(HAVE_QWT, 1, [Set if bat QWT library found])
446 AC_SUBST(QWT_LDFLAGS)
450 dnl -------------------------------------------
451 dnl bwx-console (default off)
452 dnl -------------------------------------------
453 AC_ARG_ENABLE(bwx-console,
454 AC_HELP_STRING([--enable-bwx-console], [enable build of wxWidgets console @<:@default=no@:>@]),
456 if test x$enableval = xyes; then
457 support_wx_console=yes
463 if test x$support_wx_console = xyes; then
464 abc=`$WXCONFIG $WXFLAGS --cppflags`
466 if test $pkg = 0; then
467 wx_version="wxWidgets `$WXCONFIG $WXFLAGS --release`"
468 WXCONS_CPPFLAGS=`$WXCONFIG $WXFLAGS --cppflags`
469 WXCONS_LDFLAGS=`$WXCONFIG $WXFLAGS --libs`
471 AC_SUBST(WXCONS_CPPFLAGS)
472 AC_SUBST(WXCONS_LDFLAGS)
473 WX_DIR="src/wx-console"
476 echo "wx-config program not found. bwx-console disabled."
478 support_wx_console=no
483 dnl -------------------------------------------
484 dnl tray-monitor (default off)
485 dnl -------------------------------------------
486 AC_ARG_ENABLE(tray-monitor,
487 AC_HELP_STRING([--enable-tray-monitor], [enable build of Gnome tray monitor (compatible with KDE @<:@default=no@:>@]),
489 if test x$enableval = xyes; then
490 support_tray_monitor=yes
496 if test x$support_tray_monitor = xyes; then
497 abc=`$PKGCONFIG --exists gtk+-2.0`
499 if test $pkg = 0; then
500 TRAY_MONITOR_CPPFLAGS=`$PKGCONFIG --cflags gtk+-2.0`
501 TRAY_MONITOR_LDFLAGS=`$PKGCONFIG --libs gtk+-2.0`
502 AC_SUBST(TRAY_MONITOR_CPPFLAGS)
503 AC_SUBST(TRAY_MONITOR_LDFLAGS)
504 TRAY_MONITOR_DIR=src/tray-monitor
505 abc=`$PKGCONFIG --atleast-version=2.4 gtk+-2.0`
507 if test $pkg = 0; then
508 AC_DEFINE(HAVE_GTK_2_4, 1, [Set if you have GTK 4.2 or greater loaded])
512 AC_SUBST(TRAY_MONITOR_DIR)
514 dnl -------------------------------------------
515 dnl smartalloc (default off)
516 dnl -------------------------------------------
517 AC_ARG_ENABLE(smartalloc,
518 AC_HELP_STRING([--enable-smartalloc], [enable smartalloc debugging support @<:@default=no@:>@]),
520 if test x$enableval = xno; then
521 support_smartalloc=no
526 if test x$support_smartalloc = xyes; then
527 AC_DEFINE(SMARTALLOC, 1, [Set if you want Smartalloc enabled])
530 dnl -------------------------------------------
531 dnl Lock Manager (default off)
532 dnl -------------------------------------------
533 AC_ARG_ENABLE(lockmgr,
534 AC_HELP_STRING([--enable-lockmgr], [enable lock manager support @<:@default=no@:>@]),
536 if test x$enableval = xyes; then
542 if test x$support_lockmgr = xyes; then
543 AC_DEFINE(_USE_LOCKMGR, 1, [Set if you want Lock Manager enabled])
547 dnl -------------------------------------------
548 dnl static-tools (default off)
549 dnl -------------------------------------------
550 AC_ARG_ENABLE(static-tools,
551 AC_HELP_STRING([--enable-static-tools], [enable static tape tools @<:@default=no@:>@]),
553 if test x$enableval = xyes; then
554 if test x$use_libtool = xyes; then
555 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
556 please rerun configure with --disable-libtool])
558 support_static_tools=yes
564 if test x$support_static_tools = xyes; then
565 TTOOL_LDFLAGS="-static"
567 AC_SUBST(TTOOL_LDFLAGS)
569 dnl -------------------------------------------
570 dnl static-fd (default off)
571 dnl -------------------------------------------
572 AC_ARG_ENABLE(static-fd,
573 AC_HELP_STRING([--enable-static-fd], [enable static File daemon @<:@default=no@:>@]),
575 if test x$enableval = xyes; then
576 if test x$use_libtool = xyes; then
577 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
578 please rerun configure with --disable-libtool])
580 support_static_fd=yes
586 if test x$support_static_fd = xyes; then
587 STATIC_FD="static-bacula-fd"
591 dnl -------------------------------------------
592 dnl static-sd (default off)
593 dnl -------------------------------------------
594 AC_ARG_ENABLE(static-sd,
595 AC_HELP_STRING([--enable-static-sd], [enable static Storage daemon @<:@default=no@:>@]),
597 if test x$enableval = xyes; then
598 if test x$use_libtool = xyes; then
599 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
600 please rerun configure with --disable-libtool])
602 support_static_sd=yes
608 if test x$support_static_sd = xyes; then
609 STATIC_SD="static-bacula-sd"
613 dnl -------------------------------------------
614 dnl static-dir (default off)
615 dnl -------------------------------------------
616 AC_ARG_ENABLE(static-dir,
617 AC_HELP_STRING([--enable-static-dir], [enable static Director @<:@default=no@:>@]),
619 if test x$enableval = xyes; then
620 if test x$use_libtool = xyes; then
621 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
622 please rerun configure with --disable-libtool])
624 support_static_dir=yes
630 if test x$support_static_dir = xyes; then
631 STATIC_DIR="static-bacula-dir"
635 dnl -------------------------------------------
636 dnl static-cons (default off)
637 dnl -------------------------------------------
638 AC_ARG_ENABLE(static-cons,
639 AC_HELP_STRING([--enable-static-cons], [enable static Console @<:@default=no@:>@]),
641 if test x$enableval = xyes; then
642 if test x$use_libtool = xyes; then
643 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
644 please rerun configure with --disable-libtool])
646 support_static_cons=yes
654 if test x$support_static_cons = xyes; then
655 STATIC_CONS="static-bconsole"
656 STATIC_GNOME_CONS="static-bgnome-console"
657 STATIC_WX_CONS="static-bwx-console"
659 AC_SUBST(STATIC_CONS)
660 AC_SUBST(STATIC_GNOME_CONS)
661 AC_SUBST(STATIC_WX_CONS)
663 dnl -------------------------------------------
664 dnl client_only (default off)
665 dnl -------------------------------------------
666 AC_ARG_ENABLE(client-only,
667 AC_HELP_STRING([--enable-client-only], [build client (File daemon) only @<:@default=no@:>@]),
669 if test x$enableval = xyes; then
670 build_client_only=yes
676 if test x$build_client_only = xno; then
683 dnl -------------------------------------------
684 dnl director (default on)
685 dnl -------------------------------------------
686 AC_ARG_ENABLE(build-dird,
687 AC_HELP_STRING([--enable-build-dird], [enable building of dird (Director) @<:@default=yes@:>@]),
689 if test x$enableval = xno; then
694 if test x$build_dird = xyes; then
699 DIR_TOOLS="NODIRTOOLS"
704 dnl -------------------------------------------
705 dnl stored (default on)
706 dnl -------------------------------------------
707 AC_ARG_ENABLE(build-stored,
708 AC_HELP_STRING([--enable-build-stored], [enable building of stored (Storage daemon) @<:@default=yes@:>@]),
710 if test x$enableval = xno; then
715 if test x$build_stored = xyes; then
716 STORED_DIR="src/stored"
722 dnl ---------------------------------------------------
723 dnl Check for conio (Bacula readline substitute)(
724 dnl ---------------------------------------------------
725 dnl this allows you to turn it completely off
727 AC_HELP_STRING([--disable-conio], [disable conio support @<:@default=no@:>@]),
729 if test x$enableval = xno; then
736 dnl ---------------------------------------------------
737 dnl Check for IPv6 support
738 dnl ---------------------------------------------------
739 dnl this allows you to turn it completely off
742 AC_HELP_STRING([--enable-ipv6], [enable ipv6 support @<:@default=yes@:>@]),
744 if test x$enableval = xno; then
750 if test x$support_ipv6 = xyes; then
751 AC_TRY_LINK([ #include <sys/types.h>
752 #include <sys/socket.h>
753 #include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;],
754 [support_ipv6=yes], [support_ipv6=no])
757 if test x$support_ipv6 = xyes; then
758 AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
762 if test x$support_conio = xyes; then
763 AC_CHECK_HEADER(termcap.h,
764 [ AC_CHECK_LIB(termcap, tgetent,
765 [ CONS_LIBS="-ltermcap"
770 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
772 [ AC_CHECK_LIB(ncurses, tgetent,
773 [ CONS_LIBS="-lncurses"
778 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
783 AC_CHECK_HEADERS(curses.h)
784 AC_CHECK_HEADER(term.h,
785 [ AC_CHECK_LIB(curses, tgetent,
786 [ CONS_LIBS="-lcurses"
791 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
794 [ echo " "; echo "Required libraries not found. CONIO turned off ..."; echo " "],
803 dnl ---------------------------------------------------
804 dnl Check for readline support/directory (default off)
805 dnl ---------------------------------------------------
806 dnl this allows you to turn it completely off
807 AC_ARG_ENABLE(readline,
808 AC_HELP_STRING([--disable-readline], [disable readline support @<:@default=yes@:>@]),
810 if test x$enableval = xno; then
818 if test x$support_readline = xyes; then
819 AC_ARG_WITH(readline,
820 AC_HELP_STRING([--with-readline@<:@=DIR@:>@], [specify readline library directory]),
822 case "$with_readline" in
827 if test -f ${with_readline}/readline.h; then
828 CONS_INC="-I${with_readline}"
829 CONS_LDFLAGS="-L$with_readline"
830 elif test -f ${with_readline}/include/readline/readline.h; then
831 CONS_INC="-I${with_readline}/include/readline"
832 CONS_LDFLAGS="-L${with_readline}/lib"
833 with_readline="${with_readline}/include/readline"
835 with_readline="/usr/include/readline"
838 AC_CHECK_HEADER(${with_readline}/readline.h,
840 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
841 CONS_LIBS="-lreadline -lhistory -ltermcap"
845 echo "readline.h not found. readline turned off ..."
852 dnl check for standard readline library
853 AC_CHECK_HEADER(/usr/include/readline/readline.h,
855 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
857 CONS_INC="-I/usr/include/readline"
858 CONS_LIBS="-lreadline -ltermcap"
860 dnl Did not find standard library, so try Bacula's default
861 AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h,
863 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
865 CONS_INC="-I${TOP_DIR}/depkgs/readline"
866 CONS_LIBS="-lreadline -lhistory -ltermcap"
867 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
868 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
871 echo "readline.h not found. readline turned off ..."
885 AC_SUBST(CONS_LDFLAGS)
886 AC_SUBST(READLINE_SRC)
888 dnl Minimal stuff for readline Makefile configuration
893 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr lstat lchown)
894 AC_CHECK_FUNCS(nanosleep nl_langinfo)
895 AC_CHECK_HEADERS(varargs.h)
897 dnl End of readline/conio stuff
898 dnl -----------------------------------------------------------------------
900 dnl -----------------------------------------------------------------------
901 dnl Check for Python support
903 AC_MSG_CHECKING(for Python support)
905 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.]),
909 if test "$withval" != "no"; then
910 if test "$withval" = "yes"; then
911 if test -e /usr/bin/python-config ; then
912 PYTHON_INCDIR=`/usr/bin/python-config --includes`
913 PYTHON_LIBS=`/usr/bin/python-config --libs`
915 for python_root in /usr /usr/local /usr/sfw; do
916 for ver in python2.2 python2.3 python2.4 python2.5 python2.6 python3; do
917 if test -f $python_root/include/${ver}/Python.h; then
918 PYTHON_INCDIR=-I$python_root/include/${ver}
919 if test -d $python_root/lib64/${ver}/config; then
920 PYTHON_LIBS="-L$python_root/lib64/${ver}/config -l${ver}"
922 PYTHON_LIBS="-L$python_root/lib/${ver}/config -l${ver}"
929 if test x$PYTHON_INCDIR = x; then
930 if test -f $prefix/include/Python.h; then
931 PYTHON_INCDIR=-I$prefix/include
932 if test -d $prefix/lib64/config; then
933 PYTHON_LIBS="-L$prefix/lib64/config -lpython"
935 PYTHON_LIBS="-L$prefix/lib/config -lpython"
939 AC_MSG_ERROR(Unable to find Python.h in standard locations)
944 if test -e $withval/bin/python-config ; then
945 PYTHON_INCDIR=`$withval/bin/python-config --includes`
946 PYTHON_LIBS=`$withval/bin/python-config --libs`
947 elif test -f $withval/Python.h; then
948 PYTHON_INCDIR=-I$withval
949 PYTHON_LIBS="-L$withval/config -lpython"
950 elif test -f $withval/include/Python.h; then
951 PYTHON_INCDIR=-I$withval/include
952 if test -d $withval/lib64/config; then
953 PYTHON_LIBS="-L$withval/lib64/config -lpython"
955 PYTHON_LIBS="-L$withval/lib/config -lpython"
957 elif test -f $withval/include/python/Python.h; then
958 PYTHON_INCDIR=-I$withval/include/python
959 if test -d $withval/lib64/python/config; then
960 PYTHON_LIBS="-L$withval/lib64/python/config -lpython"
962 PYTHON_LIBS="-L$withval/lib/python/config -lpython"
966 AC_MSG_ERROR(Invalid Python directory $withval - unable to find Python.h under $withval)
970 AC_DEFINE([HAVE_PYTHON], 1)
973 AC_MSG_NOTICE(checking for more Python libs)
974 saved_LIBS="$LIBS"; LIBS=
975 AC_SEARCH_LIBS(shm_open, [rt])
976 AC_CHECK_LIB(util, openpty)
977 PYTHON_LIBS="$PYTHON_LIBS $LIBS"
986 AC_SUBST(PYTHON_LIBS)
987 AC_SUBST(PYTHON_INCDIR)
990 dnl Find where sockets are (especially for Solaris)
991 dnl Do this before the TCP Wrappers test since tcp wrappers
992 dnl uses the socket library and some linkers are stupid.
994 AC_CHECK_FUNC(socket,
995 AC_MSG_RESULT(using libc's socket),
996 AC_CHECK_LIB(xnet,socket)
997 AC_CHECK_LIB(socket,socket)
998 AC_CHECK_LIB(inet,socket))
1000 dnl -----------------------------------------------------------
1001 dnl Check whether user wants TCP wrappers support (default off)
1002 dnl -----------------------------------------------------------
1005 AC_ARG_WITH(tcp-wrappers,
1006 AC_HELP_STRING([--with-tcp-wrappers@<:@=DIR@:>@], [enable tcpwrappers support]),
1008 if test "x$withval" != "xno" ; then
1010 LIBS="$saved_LIBS -lwrap"
1011 AC_SEARCH_LIBS(nanosleep, [rt])
1012 AC_MSG_CHECKING(for libwrap)
1015 #include <sys/types.h>
1017 int deny_severity = 0;
1018 int allow_severity = 0;
1019 struct request_info *req;
1024 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
1029 LIBS="$saved_LIBS -lwrap -lnsl"
1030 WRAPLIBS="$saved_LIBS -lwrap -lnsl"
1033 #include <sys/types.h>
1035 int deny_severity = 0;
1036 int allow_severity = 0;
1037 struct request_info *req;
1042 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
1047 AC_MSG_ERROR([*** libwrap missing])
1056 dnl -----------------------------------------------------------
1057 dnl Check whether OpenSSL is available
1058 dnl -----------------------------------------------------------
1059 AC_MSG_CHECKING([for OpenSSL])
1060 dnl The following uses quadrigraphs:
1063 AC_ARG_WITH(openssl,
1064 AC_HELP_STRING([--with-openssl@<:@=DIR@:>@], [Include OpenSSL support. DIR is the OpenSSL base]),
1066 with_openssl_directory=${withval}
1070 if test "x$with_openssl_directory" != "xno"; then
1071 OPENSSL_LIBS="-lssl -lcrypto"
1074 if test "x$with_openssl_directory" != "xyes" && test x"${with_openssl_directory}" != "x"; then
1076 # Make sure the $with_openssl_directory also makes sense
1078 if test -d "$with_openssl_directory/lib" -a -d "$with_openssl_directory/include"; then
1079 OPENSSL_LIBS="-L$with_openssl_directory/lib $OPENSSL_LIBS"
1080 OPENSSL_INC="-I$with_openssl_directory/include $OPENSSL_INC"
1084 saved_LIBS="${LIBS}"
1085 saved_CFLAGS="${CFLAGS}"
1086 LIBS="${saved_LIBS} ${OPENSSL_LIBS}"
1087 CFLAGS="${saved_CFLAGS} ${OPENSSL_INC}"
1091 #include <openssl/ssl.h>
1093 CRYPTO_set_id_callback(NULL);
1096 support_crypto="yes"
1104 #include <openssl/evp.h>
1108 ac_cv_openssl_sha2="yes"
1110 ac_cv_openssl_sha2="no"
1114 dnl Solaris disables greater than 128+ bit encryption in their OpenSSL
1115 dnl implementation, presumably for export reasons. If 192bit AES
1116 dnl is available, we assume that we're running with a 'non-export'
1117 dnl openssl library.
1120 #include <openssl/evp.h>
1124 ac_cv_openssl_export="no"
1126 ac_cv_openssl_export="yes"
1130 LIBS="${saved_LIBS}"
1131 CFLAGS="${saved_CFLAGS}"
1133 if test "$support_tls" = "yes"; then
1134 AC_DEFINE(HAVE_OPENSSL, 1, [Define if OpenSSL library is available])
1135 AC_DEFINE(HAVE_TLS, 1, [Define if TLS support should be enabled])
1136 AC_DEFINE(HAVE_CRYPTO, 1, [Define if encryption support should be enabled])
1139 if test "$ac_cv_openssl_sha2" = "yes"; then
1140 AC_DEFINE(HAVE_SHA2, 1, [Define if the SHA-2 family of digest algorithms is available])
1143 if test "$ac_cv_openssl_export" = "yes"; then
1144 AC_DEFINE(HAVE_OPENSSL_EXPORT_LIBRARY, 1, [Define if the OpenSSL library is export-contrained to 128bit ciphers])
1153 if test "$support_tls" = "no"; then
1158 AC_MSG_RESULT([$support_tls])
1159 AC_SUBST(OPENSSL_LIBS)
1160 AC_SUBST(OPENSSL_INC)
1162 dnl -----------------------------------------------------------
1163 dnl dlopen is needed for plugins
1164 dnl -----------------------------------------------------------
1165 AC_SEARCH_LIBS(dlopen, [dl])
1167 dnl ------------------------------------------
1168 dnl Where to place working dir
1169 dnl ------------------------------------------
1170 working_dir=`eval echo ${prefix}/var/bacula/working`
1171 AC_ARG_WITH(working-dir,
1172 AC_HELP_STRING([--with-working-dir=PATH], [specify path of Bacula working directory]),
1174 if test "x$withval" != "xno" ; then
1175 working_dir=$withval
1180 AC_SUBST(working_dir)
1182 dnl ------------------------------------------------------------------
1183 dnl If the user has not set archivedir, we set our default as /tmp
1184 dnl ------------------------------------------------------------------
1186 AC_ARG_WITH(archivedir,
1187 AC_HELP_STRING([--with-archivedir=PATH], [specify path of SD archive directory]),
1189 if test "x$withval" != "xno" ; then
1195 AC_SUBST(archivedir)
1197 dnl ------------------------------------------------------------------
1198 dnl Allow the user to specify the daemon resource name default hostname
1199 dnl ------------------------------------------------------------------
1201 AC_ARG_WITH(basename,
1202 AC_HELP_STRING([--with-basename=RESNAME], [specify base resource name for daemons]),
1204 if test "x$withval" != "xno" ; then
1212 dnl ------------------------------------------------------------------
1213 dnl Allow the user to override the hostname (default = machine hostname)
1214 dnl ------------------------------------------------------------------
1215 hostname=`uname -n | cut -d '.' -f 1`
1216 if test x${hostname} = x ; then
1217 hostname="localhost"
1219 AC_ARG_WITH(hostname,
1220 AC_HELP_STRING([--with-hostname=RESNAME], [specify host name for daemons]),
1222 if test "x$withval" != "xno" ; then
1231 dnl ------------------------------------------
1232 dnl Where to place scriptdir (script files)
1233 dnl ------------------------------------------
1234 scriptdir=`eval echo ${sysconfdir}`
1235 AC_ARG_WITH(scriptdir,
1236 AC_HELP_STRING([--with-scriptdir=PATH], [specify path of Bacula scripts directory]),
1238 if test "x$withval" != "xno" ; then
1247 dnl ------------------------------------------
1248 dnl Where to place bsrdir (bsr files)
1249 dnl ------------------------------------------
1252 AC_HELP_STRING([--with-bsrdir=PATH], [specify path of Bacula bsrs directory]),
1254 if test "x$withval" != "xno" ; then
1262 dnl ------------------------------------------
1263 dnl Where to place logdir (bsr files)
1264 dnl ------------------------------------------
1267 AC_HELP_STRING([--with-logdir=PATH], [specify path of Bacula logs directory]),
1269 if test "x$withval" != "xno" ; then
1278 # ------------------------------------------
1279 # Where to place plugindir (plugin files)
1280 # ------------------------------------------
1281 plugindir=`eval echo ${libdir}`
1282 AC_ARG_WITH(plugindir,
1283 AC_HELP_STRING([--with-plugindir=PATH], [specify path of Bacula plugins directory]),
1285 if test "x$withval" != "xno" ; then
1293 dnl ------------------------------------------
1294 dnl Where to send dump email
1295 dnl ------------------------------------------
1296 dump_email=root@localhost
1297 AC_ARG_WITH(dump-email,
1298 AC_HELP_STRING([--with-dump-email=EMAIL], [dump email address]),
1300 if test "x$withval" != "xno" ; then
1306 AC_SUBST(dump_email)
1308 dnl ------------------------------------------
1309 dnl Where to send job email
1310 dnl ------------------------------------------
1311 job_email=root@localhost
1312 AC_ARG_WITH(job-email,
1313 AC_HELP_STRING([--with-job-email=EMAIL], [job output email address]),
1315 if test "x$withval" != "xno" ; then
1323 dnl ------------------------------------------
1324 dnl Where to find smtp host
1325 dnl ------------------------------------------
1327 AC_ARG_WITH(smtp_host,
1328 AC_HELP_STRING([--with-smtp-host=HOST], [SMTP mail host address]),
1330 if test "x$withval" != "xno" ; then
1338 dnl ------------------------------------
1339 dnl Where to place pid files
1340 dnl ------------------------------------
1342 AC_ARG_WITH(pid-dir,
1343 AC_HELP_STRING([--with-pid-dir=PATH], [specify location of Bacula pid files]),
1345 if test "x$withval" != "xno" ; then
1351 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
1354 dnl ------------------------------------
1355 dnl Where to place subsys "lock file"
1356 dnl ------------------------------------
1357 subsysdir=/var/run/subsys
1358 if test -d /var/run/subsys; then
1359 subsysdir=/var/run/subsys
1360 elif test -d /var/lock/subsys; then
1361 subsysdir=/var/lock/subsys
1363 subsysdir=/var/run/subsys
1365 AC_ARG_WITH(subsys-dir,
1366 AC_HELP_STRING([--with-subsys-dir=PATH], [specify location of Bacula subsys file]),
1368 if test "x$withval" != "xno" ; then
1376 dnl ------------------------------------
1377 dnl Where to start assigning ports
1378 dnl ------------------------------------
1380 AC_ARG_WITH(baseport,
1381 AC_HELP_STRING([--with-baseport=PORT], [specify base port address for daemons]),
1383 if test "x$withval" != "xno" ; then
1390 dir_port=`expr $baseport`
1391 fd_port=`expr $baseport + 1`
1392 sd_port=`expr $fd_port + 1`
1398 dnl ------------------------------------------
1399 dnl Generate passwords
1400 dnl ------------------------------------------
1402 AC_ARG_WITH(dir-password,
1403 AC_HELP_STRING([--with-dir-password=PASSWORD], [specify Director's password]),
1405 if test "x$withval" != "xno" ; then
1406 dir_password=$withval
1411 if test "x$dir_password" = "x" ; then
1412 if test "x$OPENSSL" = "xnone" ; then
1413 key=`autoconf/randpass 33`
1415 key=`openssl rand -base64 33`
1421 AC_ARG_WITH(fd-password,
1422 AC_HELP_STRING([--with-fd-password=PASSWORD], [specify Client's password]),
1424 if test "x$withval" != "xno" ; then
1425 fd_password=$withval
1430 if test "x$fd_password" = "x" ; then
1431 if test "x$OPENSSL" = "xnone" ; then
1432 key=`autoconf/randpass 37`
1434 key=`openssl rand -base64 33`
1440 AC_ARG_WITH(sd-password,
1441 AC_HELP_STRING([--with-sd-password=PASSWORD], [specify Storage daemon's password]),
1443 if test "x$withval" != "xno" ; then
1444 sd_password=$withval
1449 if test "x$sd_password" = "x" ; then
1450 if test "x$OPENSSL" = "xnone" ; then
1451 key=`autoconf/randpass 41`
1453 key=`openssl rand -base64 33`
1459 AC_ARG_WITH(mon-dir-password,
1460 AC_HELP_STRING([--with-mon-dir-password=PASSWORD], [specify Director's password used by the monitor]),
1462 if test "x$withval" != "xno" ; then
1463 mon_dir_password=$withval
1468 if test "x$mon_dir_password" = "x" ; then
1469 if test "x$OPENSSL" = "xnone" ; then
1470 key=`autoconf/randpass 33`
1472 key=`openssl rand -base64 33`
1474 mon_dir_password=$key
1478 AC_ARG_WITH(mon-fd-password,
1479 AC_HELP_STRING([--with-mon-fd-password=PASSWORD], [specify Client's password used by the monitor]),
1481 if test "x$withval" != "xno" ; then
1482 mon_fd_password=$withval
1487 if test "x$mon_fd_password" = "x" ; then
1488 if test "x$OPENSSL" = "xnone" ; then
1489 key=`autoconf/randpass 37`
1491 key=`openssl rand -base64 33`
1493 mon_fd_password=$key
1497 AC_ARG_WITH(mon-sd-password,
1498 AC_HELP_STRING([--with-mon-sd-password=PASSWORD], [specify Storage daemon's password used by the monitor]),
1500 if test "x$withval" != "xno" ; then
1501 mon_sd_password=$withval
1506 if test "x$mon_sd_password" = "x" ; then
1507 if test "x$OPENSSL" = "xnone" ; then
1508 key=`autoconf/randpass 41`
1510 key=`openssl rand -base64 33`
1512 mon_sd_password=$key
1515 AC_SUBST(dir_password)
1516 AC_SUBST(fd_password)
1517 AC_SUBST(sd_password)
1518 AC_SUBST(mon_dir_password)
1519 AC_SUBST(mon_fd_password)
1520 AC_SUBST(mon_sd_password)
1523 dnl Pickup any database name
1526 AC_ARG_WITH(db_name,
1527 AC_HELP_STRING([--with-db-name=DBNAME], [specify database name @<:@default=bacula@:>@]),
1529 if test "x$withval" != "x" ; then
1537 AC_ARG_WITH(db_user,
1538 AC_HELP_STRING([--with-db-user=UNAME], [specify database user @<:@default=bacula@:>@]),
1540 if test "x$withval" != "x" ; then
1548 AC_ARG_WITH(db_password,
1549 AC_HELP_STRING([--with-db-password=PWD], [specify database password @<:@default=*none*@:>@]),
1551 if test "x$withval" != "x" ; then
1552 db_password=$withval
1556 AC_SUBST(db_password)
1559 dnl Pickup a database port
1562 AC_ARG_WITH(db_port,
1563 AC_HELP_STRING([--with-db-port=DBPORT], [specify a database port @<:@default=null@:>@]),
1565 if test "x$withval" != "x" ; then
1573 # Handle users and groups for each daemon
1576 AC_ARG_WITH(dir_user,
1577 AC_HELP_STRING([--with-dir-user=USER], [specify user for Director daemon]),
1579 if test "x$withval" != "x" ; then
1586 AC_ARG_WITH(dir_group,
1587 AC_HELP_STRING([--with-dir-group=GROUP], [specify group for Director daemon]),
1589 if test "x$withval" != "x" ; then
1596 AC_ARG_WITH(sd_user,
1597 AC_HELP_STRING([--with-sd-user=USER], [specify user for Storage daemon]),
1599 if test "x$withval" != "x" ; then
1606 AC_ARG_WITH(sd_group,
1607 AC_HELP_STRING([--with-sd-group=GROUP], [specify group for Storage daemon]),
1609 if test "x$withval" != "x" ; then
1616 AC_ARG_WITH(fd_user,
1617 AC_HELP_STRING([--with-fd-user=USER], [specify user for File daemon]),
1619 if test "x$withval" != "x" ; then
1626 AC_ARG_WITH(fd_group,
1627 AC_HELP_STRING([--with-fd-group=GROUP], [specify group for File daemon]),
1629 if test "x$withval" != "x" ; then
1643 dnl allow setting default executable permissions
1646 AC_ARG_WITH(sbin-perm,
1647 AC_HELP_STRING([--with-sbin-perm=MODE], [specify permissions for sbin binaries @<:@default=0754@:>@]),
1649 if test "x$withval" != "x" ; then
1657 dnl ------------------------------------------------
1658 dnl Bacula check for various SQL database engines
1659 dnl ------------------------------------------------
1661 BA_CHECK_POSTGRESQL_DB
1676 dnl -------------------------------------------
1677 dnl enable batch attribute DB insert (default on)
1678 dnl -------------------------------------------
1679 support_batch_insert=no
1680 A=`test -f $SQL_LIB && nm $SQL_LIB | grep pthread_mutex_lock`
1682 if test $pkg = 0; then
1683 support_batch_insert=yes
1684 AC_ARG_ENABLE(batch-insert,
1685 AC_HELP_STRING([--enable-batch-insert], [enable the DB batch insert code @<:@default=no@:>@]),
1687 if test x$enableval = xno; then
1688 support_batch_insert=no
1690 support_batch_insert=yes
1696 dnl Check if postgresql support batch mode
1697 if test x$DB_TYPE = xpostgresql; then
1698 A=`test -f $SQL_LIB && nm $SQL_LIB | grep PQputCopyData`
1700 if test $pkg != 0; then
1701 support_batch_insert=no
1705 if test x$DB_TYPE = xdbi; then
1709 dnl Check for batch insert
1710 if test $DB_PROG = postgresql; then
1711 A=`test -f $SQL_LIB && nm $SQL_LIB | grep PQputCopyData`
1715 if test $DB_PROG = mysql; then
1716 A=`test -f $SQL_LIB && nm $DB_PROG_LIB | grep pthread_mutex_lock`
1720 if test $DB_PROG = sqlite3; then
1721 A=`test -f $SQL_LIB && nm $DB_PROG_LIB | grep pthread_mutex_lock`
1725 if test $pkg = 0; then
1726 AC_ARG_ENABLE(batch-insert,
1727 AC_HELP_STRING([--enable-batch-insert], [enable the DB batch insert code @<:@default=no@:>@]),
1729 if test x$enableval = xno; then
1730 support_batch_insert=no
1732 support_batch_insert=yes
1738 dnl If dbi was not chosen, let the comment in file
1742 AC_SUBST(uncomment_dbi)
1744 if test $support_batch_insert = yes ; then
1745 AC_DEFINE(HAVE_BATCH_FILE_INSERT, 1, [Set if DB batch insert code enabled])
1748 AC_DEFINE(PROTOTYPES)
1750 dnl --------------------------------------------------------------------------
1751 dnl Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
1753 if test -z "$CFLAGS" -o "$CFLAGS" = "-g -O2"; then
1754 if test -z "$CCOPTS"; then
1755 CCOPTS='-g -O2 -Wall'
1763 dnl See if we can use 64 bit file addresses
1764 largefile_support="no"
1769 dnl --------------------------------------------------------------------------
1770 dnl CHECKING FOR HEADER FILES
1771 dnl --------------------------------------------------------------------------
1809 AC_STRUCT_ST_BLKSIZE
1813 dnl --------------------------------------------------------------------------
1814 dnl Check for utime.h structure
1815 dnl --------------------------------------------------------------------------
1816 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
1820 #include <sys/types.h>
1825 ba_cv_header_utime_h=yes
1827 ba_cv_header_utime_h=no
1832 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H, 1, [Set if utime.h exists])
1834 dnl --------------------------------------------------------------------------
1835 dnl Check for socklen_t
1836 dnl --------------------------------------------------------------------------
1837 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
1841 #include <sys/types.h>
1842 #include <sys/socket.h>
1846 ba_cv_header_socklen_t=yes
1848 ba_cv_header_socklen_t=no
1853 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T)
1855 dnl --------------------------------------------------------------------------
1856 dnl Check for typeof()
1857 dnl --------------------------------------------------------------------------
1859 AC_CACHE_CHECK(for typeof, ba_cv_have_typeof,
1863 main(){char *a = 0; a = (typeof a)a;}
1865 ba_cv_have_typeof=yes
1867 ba_cv_have_typeof=no
1869 ba_cv_have_typeof=no
1874 test $ba_cv_have_typeof = yes && AC_DEFINE([HAVE_TYPEOF], 1, [Defind to 1 if compiler has typeof])
1879 dnl --------------------------------------------------------------------------
1880 dnl CHECKING FOR FILESYSTEM TYPE
1881 dnl --------------------------------------------------------------------------
1882 AC_MSG_CHECKING(how to get filesystem type)
1884 # The order of these tests is important.
1887 #include <sys/statvfs.h>
1888 #include <sys/fstyp.h>
1890 AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4
1892 if test $fstype = no; then
1895 #include <sys/statfs.h>
1896 #include <sys/fstyp.h>
1898 AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3
1901 if test $fstype = no; then
1904 #include <sys/statfs.h>
1905 #include <sys/vmount.h>
1907 AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX
1910 if test $fstype = no; then
1915 AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD
1918 if test $fstype = no; then
1919 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
1921 if test $fstype = no; then
1924 #include <sys/mount.h>
1925 #include <sys/fs_types.h>
1927 AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix
1930 AC_MSG_RESULT($fstype)
1932 AC_CHECK_HEADER(sys/statvfs.h, [ AC_DEFINE(HAVE_SYS_STATVFS_H,1,[Defines if your system have the sys/statvfs.h header file])] , )
1934 dnl --------------------------------------------------------------------------
1935 dnl CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
1936 dnl --------------------------------------------------------------------------
1946 AC_CHECK_TYPE(ino_t, unsigned long)
1947 AC_CHECK_TYPE(dev_t, unsigned long)
1948 AC_CHECK_TYPE(daddr_t, long)
1949 AC_CHECK_TYPE(major_t, int)
1950 AC_CHECK_TYPE(minor_t, int)
1951 AC_CHECK_TYPE(ssize_t, int)
1957 AC_CHECK_SIZEOF(char, 1)
1958 AC_CHECK_SIZEOF(short int, 2)
1959 AC_CHECK_SIZEOF(int, 4)
1960 AC_CHECK_SIZEOF(long int, 4)
1961 AC_CHECK_SIZEOF(long long int, 8)
1962 AC_CHECK_SIZEOF(int *, 4)
1964 dnl Check for sys/types.h types
1965 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int,
1969 #include <sys/types.h>
1973 ac_cv_have_u_int="yes"
1975 ac_cv_have_u_int="no"
1980 if test "x$ac_cv_have_u_int" = "xyes" ; then
1981 AC_DEFINE(HAVE_U_INT)
1985 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t,
1989 #include <sys/types.h>
1993 ac_cv_have_intmax_t="yes"
2001 ac_cv_have_intmax_t="yes"
2003 ac_cv_have_intmax_t="no"
2010 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
2011 AC_DEFINE(HAVE_INTMAX_T)
2015 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t,
2019 #include <sys/types.h>
2021 u_intmax_t a; a = 1;
2023 ac_cv_have_u_intmax_t="yes"
2029 u_intmax_t a; a = 1;
2031 ac_cv_have_u_intmax_t="yes"
2033 ac_cv_have_u_intmax_t="no"
2040 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
2041 AC_DEFINE(HAVE_U_INTMAX_T)
2045 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t,
2049 #include <sys/types.h>
2051 int8_t a; int16_t b; int32_t c; a = b = c = 1;
2053 ac_cv_have_intxx_t="yes"
2055 ac_cv_have_intxx_t="no"
2060 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
2061 AC_DEFINE(HAVE_INTXX_T)
2065 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t,
2069 #include <sys/types.h>
2073 ac_cv_have_int64_t="yes"
2075 ac_cv_have_int64_t="no"
2080 if test "x$ac_cv_have_int64_t" = "xyes" ; then
2081 AC_DEFINE(HAVE_INT64_T)
2085 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t,
2089 #include <sys/types.h>
2091 u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;
2093 ac_cv_have_u_intxx_t="yes"
2095 ac_cv_have_u_intxx_t="no"
2100 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
2101 AC_DEFINE(HAVE_U_INTXX_T)
2105 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t,
2109 #include <sys/types.h>
2113 ac_cv_have_u_int64_t="yes"
2115 ac_cv_have_u_int64_t="no"
2120 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
2121 AC_DEFINE(HAVE_U_INT64_T)
2125 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
2126 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2128 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
2131 #include <sys/bitypes.h>
2133 int8_t a; int16_t b; int32_t c;
2134 u_int8_t e; u_int16_t f; u_int32_t g;
2135 a = b = c = e = f = g = 1;
2137 AC_DEFINE(HAVE_U_INTXX_T)
2138 AC_DEFINE(HAVE_INTXX_T)
2139 AC_DEFINE(HAVE_SYS_BITYPES_H)
2147 if test -z "$have_u_intxx_t" ; then
2148 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t,
2152 #include <sys/types.h>
2154 uint8_t a; uint16_t b;
2155 uint32_t c; a = b = c = 1;
2157 ac_cv_have_uintxx_t="yes"
2159 ac_cv_have_uintxx_t="no"
2164 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
2165 AC_DEFINE(HAVE_UINTXX_T)
2169 if (test -z "$have_u_int64_t" || test -z "$have_int64_t" && \
2170 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2172 AC_MSG_CHECKING([for int64_t and u_int64_t types in sys/bitypes.h])
2175 #include <sys/bitypes.h>
2177 int64_t a; u_int64_t b;
2180 AC_DEFINE(HAVE_U_INT64_T)
2181 AC_DEFINE(HAVE_INT64_T)
2189 if (test -z "$have_uintxx_t" && \
2190 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2192 AC_MSG_CHECKING([for uintXX_t types in sys/bitypes.h])
2195 #include <sys/bitypes.h>
2197 uint8_t a; uint16_t b;
2198 uint32_t c; a = b = c = 1;
2200 AC_DEFINE(HAVE_UINTXX_T)
2208 dnl --------------------------------------------------------------------------
2209 dnl CHECKING FOR REQUIRED LIBRARY FUNCTIONS
2210 dnl --------------------------------------------------------------------------
2226 [echo 'configure: cannot find needed function.'; exit 1]
2229 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
2230 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
2231 AC_CHECK_FUNCS(posix_fadvise)
2232 AC_CHECK_FUNCS(fdatasync)
2234 AC_CHECK_FUNCS(chflags)
2236 AC_CHECK_FUNCS(snprintf vsnprintf gethostid fseeko)
2238 AC_CACHE_CHECK(for va_copy, ba_cv_va_copy,
2243 void use_va_copy(va_list args){va_list args2; va_copy(args2,args); va_end(args2);}
2244 void call_use_va_copy(int junk,...){va_list args; va_start(args,junk); use_va_copy(args); va_end(args);}
2246 call_use_va_copy(1,2,3)
2255 test $ba_cv_va_copy = yes && AC_DEFINE(HAVE_VA_COPY, 1, [Set if va_copy exists])
2257 dnl --------------------------------------------------------------------------
2258 dnl CHECKING FOR THREAD SAFE FUNCTIONS
2259 dnl --------------------------------------------------------------------------
2260 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
2262 # If resolver functions are not in libc check for -lnsl or -lresolv.
2263 AC_CHECK_FUNC(gethostbyname_r,
2264 AC_MSG_RESULT(using libc's resolver),
2265 AC_CHECK_LIB(nsl,gethostbyname_r)
2266 AC_CHECK_LIB(resolv,gethostbyname_r))
2268 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
2269 AC_CHECK_FUNCS(inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)])
2270 AC_CHECK_FUNCS(gethostbyname2, [AC_DEFINE(HAVE_GETHOSTBYNAME2)])
2272 dnl ----------------------------
2273 dnl check sa_len of sockaddr
2274 dnl ----------------------------
2275 AC_CACHE_CHECK(for struct sockaddr has a sa_len field, ac_cv_struct_sockaddr_sa_len,
2279 #include <sys/socket.h>
2281 struct sockaddr s; s.sa_len;
2283 ac_cv_struct_sockaddr_sa_len=yes
2284 ], [ac_cv_struct_sockaddr_sa_len=no
2290 if test $ac_cv_struct_sockaddr_sa_len = yes; then
2291 AC_DEFINE(HAVE_SA_LEN, 1, [Define if sa_len field exists in struct sockaddr])
2298 AC_FUNC_CLOSEDIR_VOID
2299 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
2300 # AC_FUNC_FNMATCH dnl use local version
2302 AC_CHECK_LIB(intl, gettext, [LIBS="$LIBS -lintl"])
2304 AC_CHECK_LIB(sun, getpwnam)
2306 AC_CHECK_HEADERS(zlib.h)
2307 AC_CHECK_LIB(z, deflate, [FDLIBS="-lz"])
2309 if test x$FDLIBS = x-lz; then
2310 AC_DEFINE(HAVE_LIBZ)
2315 dnl Check for ACL support and libraries
2319 AC_HELP_STRING([--disable-acl], [disable acl support @<:@default=auto@:>@]),
2321 if test x$enableval = xyes; then
2323 elif test x$enableval = xno; then
2330 have_extended_acl=no
2331 if test x$support_acl = xyes -o x$support_acl = xauto; then
2332 AC_CHECK_HEADER(sys/acl.h, [ AC_DEFINE(HAVE_SYS_ACL_H,1,[Defines if your system have the sys/acl.h header file])] , )
2333 AC_CHECK_FUNC(acl_get_file,
2337 AC_CHECK_LIB(acl, acl_get_file,
2340 FDLIBS="-lacl $FDLIBS"
2342 AC_CHECK_LIB(pacl, acl_get_file,
2345 FDLIBS="-lpacl $FDLIBS"
2347 AC_CHECK_LIB(sec, acltotext,
2350 FDLIBS="-lsec $FDLIBS"
2352 AC_CHECK_LIB(sec, acl_totext,
2354 have_extended_acl=yes
2366 if test x$support_acl = xyes -a $have_acl != yes; then
2367 AC_MSG_ERROR([acl support explicitly enabled but no supported acl implementation found,
2368 please either load the acl libraries or rerun configure without --enable-acl])
2370 if test $have_acl = yes; then
2371 AC_DEFINE([HAVE_ACL],1,[Normal acl support])
2374 if test $have_extended_acl = yes; then
2375 AC_DEFINE([HAVE_EXTENDED_ACL],1,[Extended acl support])
2381 dnl Check for XATTR support
2384 AC_ARG_ENABLE(xattr,
2385 AC_HELP_STRING([--disable-xattr], [disable xattr support @<:@default=auto@:>@]),
2387 if test x$enableval = xyes; then
2389 elif test x$enableval = xno; then
2396 if test x$support_xattr = xyes -o x$support_xattr = xauto; then
2398 dnl First check for *BSD support
2400 AC_CHECK_HEADER(sys/extattr.h, [ AC_DEFINE(HAVE_SYS_EXTATTR_H,1,[Defines if your system have the sys/extattr.h header file])] , )
2401 AC_CHECK_HEADER(libutil.h, [ AC_DEFINE(HAVE_LIBUTIL_H,1,[Defines if your system have the libutil.h header file])] , )
2402 AC_CHECK_FUNCS(extattr_get_link extattr_set_link extattr_list_link,
2405 AC_DEFINE([HAVE_EXTATTR_GET_LINK],1,[Define to 1 if you have the 'extattr_get_link' function.])
2406 AC_DEFINE([HAVE_EXTATTR_SET_LINK],1,[Define to 1 if you have the 'extattr_set_link' function.])
2407 AC_DEFINE([HAVE_EXTATTR_LIST_LINK],1,[Define to 1 if you have the 'extattr_list_link' function.])
2411 if test $have_xattr = no; then
2412 AC_CHECK_FUNCS(extattr_get_file extattr_set_file extattr_list_file,
2415 AC_DEFINE([HAVE_EXTATTR_GET_FILE],1,[Define to 1 if you have the 'extattr_get_file' function.])
2416 AC_DEFINE([HAVE_EXTATTR_SET_FILE],1,[Define to 1 if you have the 'extattr_set_file' function.])
2417 AC_DEFINE([HAVE_EXTATTR_LIST_FILE],1,[Define to 1 if you have the 'extattr_list_file' function.])
2422 if test $have_xattr = yes; then
2423 have_extattr_string_in_libc=no
2424 AC_CHECK_FUNCS(extattr_namespace_to_string extattr_string_to_namespace,
2426 have_extattr_string_in_libc=yes
2427 AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2428 AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2433 dnl If extattr_namespace_to_string and extattr_string_to_namespace are not in libc see if they are in libutil
2435 if test $have_extattr_string_in_libc = no; then
2436 AC_CHECK_LIB(util, extattr_namespace_to_string extattr_string_to_namespace,
2438 AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2439 AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2440 FDLIBS="-lutil $FDLIBS"
2447 dnl If we failed to find *BSD support try the Linux or OSX implementation of xattr
2449 if test $have_xattr = no; then
2450 AC_CHECK_HEADER(sys/xattr.h, [ AC_DEFINE(HAVE_SYS_XATTR_H,1,[Defines if your system have the sys/xattr.h header file])] , )
2451 AC_CHECK_FUNCS(llistxattr lgetxattr lsetxattr,
2454 AC_DEFINE([HAVE_LLISTXATTR],1,[Define to 1 if you have the 'llistxattr' function.])
2455 AC_DEFINE([HAVE_LGETXATTR],1,[Define to 1 if you have the 'lgetxattr' function.])
2456 AC_DEFINE([HAVE_LSETXATTR],1,[Define to 1 if you have the 'lsetxattr' function.])
2460 if test $have_xattr = no; then
2461 AC_CHECK_FUNCS(listxattr getxattr setxattr,
2464 AC_DEFINE([HAVE_LISTXATTR],1,[Define to 1 if you have the 'listxattr' function.])
2465 AC_DEFINE([HAVE_GETXATTR],1,[Define to 1 if you have the 'getxattr' function.])
2466 AC_DEFINE([HAVE_SETXATTR],1,[Define to 1 if you have the 'setxattr' function.])
2473 dnl If we failed to find *BSD support and the Linux or OSX implementation of xattr try the Solaris xattr implementation
2475 if test $have_xattr = no; then
2476 AC_CHECK_HEADER(sys/attr.h, [ AC_DEFINE(HAVE_SYS_ATTR_H,1,[Defines if your system have the sys/attr.h header file])] , )
2477 AC_CHECK_HEADER(sys/nvpair.h, [ AC_DEFINE(HAVE_SYS_NVPAIR_H,1,[Defines if your system have the sys/nvpair.h header file])] , )
2478 AC_CHECK_HEADER(attr.h, [ AC_DEFINE(HAVE_ATTR_H,1,[Defines if your system have the attr.h header file])] , )
2480 AC_CHECK_FUNCS(openat fstatat unlinkat fchownat futimesat,
2483 AC_DEFINE([HAVE_OPENAT],1,[Define to 1 if you have the 'openat' function.])
2484 AC_DEFINE([HAVE_FSTATAT],1,[Define to 1 if you have the 'fstatat' function.])
2485 AC_DEFINE([HAVE_UNLINKAT],1,[Define to 1 if you have the 'unlinkat' function.])
2486 AC_DEFINE([HAVE_FCHOWNAT],1,[Define to 1 if you have the 'fchownat' function.])
2487 AC_DEFINE([HAVE_FUTIMESAT],1,[Define to 1 if you have the 'futimesat' function.])
2491 if test $have_xattr = yes; then
2492 AC_CHECK_LIB(nvpair, nvlist_next_nvpair,
2494 AC_DEFINE([HAVE_NVLIST_NEXT_NVPAIR],1,[Define to 1 if you have the 'nvlist_next_nvpair' function.])
2495 FDLIBS="-lnvpair $FDLIBS"
2501 if test x$support_xattr = xyes -a $have_xattr != yes; then
2502 AC_MSG_ERROR([xattr support explicitly enabled but no supported xattr implementation found,
2503 please either load the xattr libraries or rerun configure without --enable-xattr])
2505 if test $have_xattr = yes; then
2506 AC_DEFINE([HAVE_XATTR],1,[Extended Attributes support])
2512 dnl Check for pthread libraries
2515 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
2517 AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
2519 AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
2521 AC_CHECK_FUNC(pthread_create)
2530 dnl Check for headers, functions and libraries required to support
2531 dnl keeping readall capabilities
2533 AC_CHECK_HEADERS(sys/prctl.h sys/capability.h)
2534 AC_CHECK_FUNCS(prctl setreuid)
2535 AC_CHECK_LIB([cap], [cap_set_proc], [CAP_LIBS="-lcap"], [CAP_LIBS=])
2536 if test x$CAP_LIBS = x-lcap; then
2537 AC_DEFINE(HAVE_LIBCAP, 1, [Define if you have libcap])
2546 if test x$have_gcc = xyes ; then
2547 CPPFLAGS="$CPPFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
2548 CFLAGS="$CFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
2550 LDFLAGS=${LDFLAGS--O}
2551 DB_LIBS="${SQL_LFLAGS}"
2552 CPPFLAGS="$CPPFLAGS"
2565 AC_SUBST(X_EXTRA_LIBS)
2570 dnl extra configurable objects
2581 dnl Finally we set appropriate distribution specific
2582 dnl variables and defaults
2584 dnl PFILES are platform specific files
2585 PFILES="platforms/Makefile"
2590 hostname=`uname -n | cut -d '.' -f 1`
2591 if test x${hostname} = x ; then
2592 hostname="localhost"
2594 dnl Make sure hostname is resolved
2595 ping -c 1 $hostname 2>/dev/null 1>/dev/null
2596 if test ! $? = 0; then
2597 hostname="localhost"
2603 PSCMD="ps -e -o pid,comm"
2605 platforms/aix/Makefile"
2606 TAPEDRIVE="/dev/rmt0.1"
2610 PTHREAD_LIB="-lpthread -lexc"
2611 if test "${CC}" = "gcc" ; then
2618 TAPEDRIVE="/dev/nrmt0"
2621 DISTVER=`uname -a |awk '{print $3}'`
2622 TAPEDRIVE="/dev/nrmt0"
2623 PTHREAD_LIB="-pthread"
2624 CFLAGS="${CFLAGS} -pthread"
2625 PSCMD="ps -ax -o pid,command"
2629 platforms/bsdi/Makefile \
2630 platforms/bsdi/bacula-fd \
2631 platforms/bsdi/bacula-sd \
2632 platforms/bsdi/bacula-dir"
2633 largefile_support="yes"
2636 DISTVER=`uname -a |awk '{print $3}'`
2637 TAPEDRIVE="/dev/nrst0"
2640 WLDFLAGS="-mwindows"
2644 TAPEDRIVE="/dev/nst0"
2645 PSCMD="ps -e -o pid,command"
2648 platforms/darwin/Makefile"
2652 TAPEDRIVE="/dev/nst0"
2653 PSCMD="ps -e -o pid,command"
2656 platforms/osx/Makefile"
2659 if `test -f /etc/apt/sources.list && grep -q ubuntu /etc/apt/sources.list`; then
2662 DISTVER=`cat /etc/debian_version`
2663 if test -f /etc/lsb-release ; then
2665 if test "x$DISTRIB_ID" != "x" ; then
2666 DISTNAME=$DISTRIB_ID
2668 if test "x$DISTRIB_RELEASE" != "x" ; then
2669 DISTVER=$DISTRIB_RELEASE
2672 if test "$DISTNAME" = "Ubuntu" ; then
2675 TAPEDRIVE="/dev/nst0"
2676 PSCMD="ps -e -o pid,command"
2677 if test "$DISTNAME" = "ubuntu" ; then
2679 platforms/ubuntu/Makefile \
2680 platforms/ubuntu/bacula-fd \
2681 platforms/ubuntu/bacula-sd \
2682 platforms/ubuntu/bacula-dir"
2685 platforms/debian/Makefile \
2686 platforms/debian/bacula-fd \
2687 platforms/debian/bacula-sd \
2688 platforms/debian/bacula-dir"
2692 DISTVER=`uname -a |awk '{print $3}'`
2693 VER=`echo $DISTVER | cut -c 1`
2694 if test x$VER = x4 ; then
2695 PTHREAD_LIB="${PTHREAD_LIBS:--pthread}"
2696 CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS:--pthread}"
2700 TAPEDRIVE="/dev/nrsa0"
2701 PSCMD="ps -ax -o pid,command"
2703 platforms/freebsd/Makefile \
2704 platforms/freebsd/bacula-fd \
2705 platforms/freebsd/bacula-sd \
2706 platforms/freebsd/bacula-dir"
2707 largefile_support="yes"
2710 PSCMD="UNIX95=1; ps -e -o pid,comm"
2711 CFLAGS="${CFLAGS} -D_XOPEN_SOURCE_EXTENDED=1"
2713 TAPEDRIVE="/dev/rmt/0hnb"
2714 PTHREAD_LIB="-lpthread"
2715 AC_DEFINE([_INCLUDE_LONGLONG])
2719 TAPEDRIVE="/dev/rmt/0cbn"
2720 PSCMD="ps -e -o pid,comm"
2722 platforms/irix/Makefile \
2723 platforms/irix/bacula-fd \
2724 platforms/irix/bacula-sd \
2725 platforms/irix/bacula-dir"
2728 DISTVER=`uname -a |awk '{print $3}'`
2731 TAPEDRIVE="/dev/nrst0"
2732 PSCMD="ps -ax -o pid,command"
2733 PTHREAD_LIB="-pthread"
2734 CFLAGS="${CFLAGS} -pthread"
2737 DISTVER=`uname -a |awk '{print $3}'`
2740 TAPEDRIVE="/dev/nrst0"
2741 PSCMD="ps -ax -o pid,command"
2742 PTHREAD_LIB="-pthread"
2743 CFLAGS="${CFLAGS} -pthread"
2745 platforms/openbsd/Makefile \
2746 platforms/openbsd/bacula-fd \
2747 platforms/openbsd/bacula-sd \
2748 platforms/openbsd/bacula-dir"
2751 if test -f /etc/whitebox-release ; then
2752 f=/etc/whitebox-release
2754 f=/etc/redhat-release
2756 if test `cat $f | grep release |\
2757 cut -f 3 -d ' '`x = "Enterprise"x ; then
2758 DISTVER="Enterprise "`cat $f | grep release |\
2761 DISTVER=`cat /etc/redhat-release | grep release |\
2764 TAPEDRIVE="/dev/nst0"
2765 PSCMD="ps -e -o pid,command"
2767 platforms/redhat/Makefile \
2768 platforms/redhat/bacula-fd \
2769 platforms/redhat/bacula-sd \
2770 platforms/redhat/bacula-dir
2774 DISTVER=`cat /etc/mandrake-release | grep release |\
2776 TAPEDRIVE="/dev/nst0"
2777 PSCMD="ps -e -o pid,command"
2779 platforms/mandrake/Makefile \
2780 platforms/mandrake/bacula-fd \
2781 platforms/mandrake/bacula-sd \
2782 platforms/mandrake/bacula-dir \
2783 platforms/mandrake/bacula.spec \
2787 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
2788 TAPEDRIVE="/dev/nst0"
2789 PSCMD="ps -e -o pid,command"
2791 platforms/gentoo/Makefile \
2792 platforms/gentoo/bacula-init \
2793 platforms/gentoo/bacula-fd \
2794 platforms/gentoo/bacula-sd \
2795 platforms/gentoo/bacula-dir"
2798 DISTVER=`cat /etc/slackware-version`
2799 TAPEDRIVE="/dev/nst0"
2800 PSCMD="ps -e -o pid,command"
2802 platforms/slackware/Makefile \
2803 platforms/slackware/rc.bacula-fd \
2804 platforms/slackware/rc.bacula-sd \
2805 platforms/slackware/rc.bacula-dir\
2806 platforms/slackware/functions.bacula"
2810 TAPEDRIVE="/dev/rmt/0cbn"
2811 PSCMD="ps -e -o pid,comm"
2813 platforms/solaris/Makefile \
2814 platforms/solaris/bacula-fd \
2815 platforms/solaris/bacula-sd \
2816 platforms/solaris/bacula-dir"
2817 if test x$DISTVER = x5.6 ; then
2818 AC_DEFINE(HAVE_OLD_SOCKOPT)
2820 LIBS="$LIBS -lresolv"
2823 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
2825 TAPEDRIVE="/dev/nst0"
2826 PSCMD="ps -e -o pid,command"
2828 platforms/suse/Makefile \
2829 platforms/suse/bacula-fd \
2830 platforms/suse/bacula-sd \
2831 platforms/suse/bacula-dir \
2832 platforms/suse/bacula \
2833 platforms/suse/bacula.spec"
2838 TAPEDRIVE="/dev/nst0"
2839 PSCMD="ps -e -o pid,command"
2841 platforms/suse/Makefile \
2842 platforms/suse/bacula-fd \
2843 platforms/suse/bacula-sd \
2844 platforms/suse/bacula-dir"
2848 TAPEDRIVE="/dev/nst0"
2851 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
2857 LIBS="$PTHREAD_LIB $LIBS"
2859 AC_DEFINE_UNQUOTED(lld, "$lld")
2860 AC_DEFINE_UNQUOTED(llu, "$llu")
2868 dnl common parts of the Makefile
2869 MCOMMON=./autoconf/Make.common
2870 AC_SUBST_FILE(MCOMMON)
2873 if test "x${subsysdir}" = "x${sbindir}" ; then
2876 echo "You have set both --sbindir and --with-subsys-dir"
2877 echo " equal to: ${subsysdir} "
2878 echo "This is not permitted. Please reconfigure."
2880 echo "Aborting configuration ..."
2886 AC_OUTPUT([autoconf/Make.common \
2889 scripts/startmysql \
2891 scripts/btraceback \
2897 scripts/bacula-ctl-dir \
2898 scripts/bacula-ctl-fd \
2899 scripts/bacula-ctl-sd \
2900 scripts/devel_bacula \
2903 scripts/bacula.desktop.gnome1 \
2904 scripts/bacula.desktop.gnome2 \
2905 scripts/bacula.desktop.gnome1.consolehelper \
2906 scripts/bacula.desktop.gnome2.consolehelper \
2907 scripts/bacula.desktop.gnome1.xsu \
2908 scripts/bacula.desktop.gnome2.xsu \
2909 scripts/bgnome-console.console_apps \
2910 scripts/mtx-changer \
2911 scripts/disk-changer \
2912 scripts/dvd-handler \
2913 scripts/dvd-simulator \
2914 scripts/bacula-tray-monitor.desktop \
2915 scripts/logwatch/Makefile \
2916 scripts/logwatch/logfile.bacula.conf \
2917 scripts/wxconsole.console_apps \
2918 scripts/wxconsole.desktop.consolehelper \
2919 scripts/wxconsole.desktop.xsu \
2920 scripts/bat.desktop \
2921 scripts/bat.desktop.xsu \
2922 scripts/bat.desktop.consolehelper \
2923 scripts/bat.console_apps \
2926 src/console/Makefile \
2927 src/console/bconsole.conf \
2928 src/qt-console/bat.conf \
2929 src/qt-console/bat.pro \
2930 src/qt-console/bat.pro.mingw32 \
2931 src/qt-console/install_conf_file \
2932 src/wx-console/Makefile \
2933 src/wx-console/bwx-console.conf \
2934 src/tray-monitor/Makefile \
2935 src/tray-monitor/tray-monitor.conf \
2937 src/dird/bacula-dir.conf \
2939 src/stored/Makefile \
2940 src/stored/bacula-sd.conf \
2941 src/filed/Makefile \
2942 src/filed/bacula-fd.conf \
2944 src/cats/make_catalog_backup \
2945 src/cats/delete_catalog_backup \
2946 src/cats/create_postgresql_database \
2947 src/cats/update_postgresql_tables \
2948 src/cats/make_postgresql_tables \
2949 src/cats/grant_postgresql_privileges \
2950 src/cats/drop_postgresql_tables \
2951 src/cats/drop_postgresql_database \
2952 src/cats/create_mysql_database \
2953 src/cats/update_mysql_tables \
2954 src/cats/make_mysql_tables \
2955 src/cats/grant_mysql_privileges \
2956 src/cats/drop_mysql_tables \
2957 src/cats/drop_mysql_database \
2958 src/cats/create_sqlite_database \
2959 src/cats/update_sqlite_tables \
2960 src/cats/make_sqlite_tables \
2961 src/cats/grant_sqlite_privileges \
2962 src/cats/drop_sqlite_tables \
2963 src/cats/drop_sqlite_database \
2964 src/cats/create_sqlite3_database \
2965 src/cats/update_sqlite3_tables \
2966 src/cats/make_sqlite3_tables \
2967 src/cats/grant_sqlite3_privileges \
2968 src/cats/drop_sqlite3_tables \
2969 src/cats/drop_sqlite3_database \
2972 src/cats/create_bdb_database \
2973 src/cats/update_bdb_tables \
2974 src/cats/make_bdb_tables \
2975 src/cats/grant_bdb_privileges \
2976 src/cats/drop_bdb_tables \
2977 src/cats/drop_bdb_database \
2978 src/cats/create_bacula_database \
2979 src/cats/update_bacula_tables \
2980 src/cats/grant_bacula_privileges \
2981 src/cats/make_bacula_tables \
2982 src/cats/drop_bacula_tables \
2983 src/cats/drop_bacula_database \
2984 src/findlib/Makefile \
2985 src/tools/Makefile \
2986 src/plugins/fd/Makefile \
2987 src/plugins/sd/Makefile \
2988 src/plugins/dir/Makefile \
2989 src/win32/Makefile.inc \
2991 updatedb/update_mysql_tables_9_to_10 \
2992 updatedb/update_sqlite3_tables_9_to_10 \
2993 updatedb/update_postgresql_tables_9_to_10 \
2994 updatedb/update_sqlite_tables_9_to_10 \
2995 updatedb/update_mysql_tables_10_to_11 \
2996 updatedb/update_sqlite3_tables_10_to_11 \
2997 updatedb/update_postgresql_tables_10_to_11 \
2998 updatedb/update_sqlite_tables_10_to_11 \
3003 if test "${support_bat}" = "yes" ; then
3004 if test "x$QMAKE" = "xnone" && test "x$QMAKEQT4" = "xnone"; then
3005 AC_MSG_ERROR([Could not find qmake or qmake-qt4 in $PATH. Check your Qt installation])
3010 if test "x$QMAKEQT4" != "xnone"; then
3015 echo "Creating bat Makefile"
3024 dnl if CC is gcc, we can rebuild the dependencies (since the depend rule
3025 dnl requires gcc). If it's not, don't rebuild dependencies
3027 if test X"$GCC" = "Xyes" ; then
3028 echo "Doing make of dependencies"
3029 ${MAKE:-make} depend
3033 chmod 755 install_conf_file build-depkgs-qt-console
3037 chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
3038 chmod 755 dvd-handler dvd-simulator
3039 chmod 755 bconsole gconsole mtx-changer devel_bacula logrotate
3043 chmod 755 $c/update_mysql_tables_10_to_11 $c/update_sqlite3_tables_10_to_11
3044 chmod 755 $c/update_postgresql_tables_10_to_11 $c/update_sqlite_tables_10_to_11
3048 chmod 755 $c/create_bacula_database $c/update_bacula_tables $c/make_bacula_tables
3049 chmod 755 $c/grant_bacula_privileges $c/drop_bacula_tables $c/drop_bacula_database
3051 chmod 755 $c/create_bdb_database $c/update_bdb_tables $c/make_bdb_tables
3052 chmod 755 $c/grant_bdb_privileges $c/drop_bdb_tables $c/drop_bdb_database
3054 chmod 755 $c/create_mysql_database $c/update_mysql_tables $c/make_mysql_tables
3055 chmod 755 $c/grant_mysql_privileges $c/drop_mysql_tables $c/drop_mysql_database
3057 chmod 755 $c/create_sqlite_database $c/update_sqlite_tables $c/make_sqlite_tables
3058 chmod 755 $c/grant_sqlite_privileges $c/drop_sqlite_tables $c/drop_sqlite_database
3060 chmod 755 $c/create_sqlite3_database $c/update_sqlite3_tables $c/make_sqlite3_tables
3061 chmod 755 $c/grant_sqlite3_privileges $c/drop_sqlite3_tables $c/drop_sqlite3_database
3063 chmod 755 $c/create_postgresql_database $c/update_postgresql_tables $c/make_postgresql_tables
3064 chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables $c/drop_postgresql_database
3066 chmod 755 $c/make_catalog_backup $c/delete_catalog_backup
3070 chmod 755 src/win32/build-depkgs-mingw32
3072 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
3073 largefile_support="yes"
3076 dnl Only try to find out the version number of the compiler when we know its some kind of GCC compiler
3077 if test X"$GCC" = "Xyes" ; then
3079 dnl A whole lot of hand springs to get the compiler version.
3080 dnl This is because gcc changed the output in version 3.0
3082 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3083 if test "x${CCVERSION}" = "x" ; then
3084 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3086 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3087 if test x"${CXXVERSION}" = x ; then
3088 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3092 # clean up any old junk
3098 if test "x${db_type}" = "xInternal" ; then
3101 echo "You have not specified either --enable-client-only or one of the"
3102 echo " supported databases: MySQL, PostgreSQL, SQLite3, SQLite or DBI."
3103 echo " This is not permitted. Please reconfigure."
3105 echo "Aborting the configuration ..."
3112 Configuration on `date`:
3114 Host: ${host}${post_host} -- ${DISTNAME} ${DISTVER}
3115 Bacula version: ${BACULA} ${VERSION} (${DATE})
3116 Source code location: ${srcdir}
3117 Install binaries: ${sbindir}
3118 Install libraries: ${libdir}
3119 Install config files: ${sysconfdir}
3120 Scripts directory: ${scriptdir}
3121 Archive directory: ${archivedir}
3122 Working directory: ${working_dir}
3123 PID directory: ${piddir}
3124 Subsys directory: ${subsysdir}
3125 Man directory: ${mandir}
3126 Data directory: ${datarootdir}
3127 Plugin directory: ${plugindir}
3128 C Compiler: ${CC} ${CCVERSION}
3129 C++ Compiler: ${CXX} ${CXXVERSION}
3130 Compiler flags: ${WCFLAGS} ${CFLAGS}
3131 Linker flags: ${WLDFLAGS} ${LDFLAGS}
3133 Statically Linked Tools: ${support_static_tools}
3134 Statically Linked FD: ${support_static_fd}
3135 Statically Linked SD: ${support_static_sd}
3136 Statically Linked DIR: ${support_static_dir}
3137 Statically Linked CONS: ${support_static_cons}
3138 Database type: ${db_type}
3139 Database port: ${db_port}
3140 Database lib: ${DB_LIBS}
3141 Database name: ${db_name}
3142 Database user: ${db_user}
3144 Job Output Email: ${job_email}
3145 Traceback Email: ${dump_email}
3146 SMTP Host Address: ${smtp_host}
3148 Director Port: ${dir_port}
3149 File daemon Port: ${fd_port}
3150 Storage daemon Port: ${sd_port}
3152 Director User: ${dir_user}
3153 Director Group: ${dir_group}
3154 Storage Daemon User: ${sd_user}
3155 Storage DaemonGroup: ${sd_group}
3156 File Daemon User: ${fd_user}
3157 File Daemon Group: ${fd_group}
3159 SQL binaries Directory ${SQL_BINDIR}
3161 Large file support: $largefile_support
3162 Bacula conio support: ${got_conio} ${CONS_LIBS}
3163 readline support: ${got_readline} ${PRTREADLINE_SRC}
3164 TCP Wrappers support: ${TCPW_MSG} ${WRAPLIBS}
3165 TLS support: ${support_tls}
3166 Encryption support: ${support_crypto}
3167 ZLIB support: ${have_zlib}
3168 enable-smartalloc: ${support_smartalloc}
3169 enable-lockmgr: ${support_lockmgr}
3170 bat support: ${support_bat} ${QWT_LDFLAGS}
3171 enable-gnome: ${support_gnome} ${gnome_version}
3172 enable-bwx-console: ${support_wx_console} ${wx_version}
3173 enable-tray-monitor: ${support_tray_monitor}
3174 client-only: ${build_client_only}
3175 build-dird: ${build_dird}
3176 build-stored: ${build_stored}
3177 ACL support: ${have_acl}
3178 XATTR support: ${have_xattr}
3179 Python support: ${support_python} ${PYTHON_LIBS}
3180 Batch insert enabled: ${support_batch_insert}