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 --------------------------------------------------
136 AC_ARG_ENABLE(libtool,
137 AC_HELP_STRING([--enable-libtool], [enable building using GNU libtool @<:@default=yes@:>@]),
139 if test x$enableval = xno; then
144 LT_INIT([shared disable-static])
147 if test x$use_libtool != xno; then
148 DEFAULT_OBJECT_TYPE=".lo"
149 DEFAULT_ARCHIVE_TYPE=".la"
150 DEFAULT_SHARED_OBJECT_TYPE=".la"
151 LIBTOOL="\$(LIBTOOL)"
152 LIBTOOL_INSTALL_TARGET="libtool-install"
153 LIBTOOL_UNINSTALL_TARGET="libtool-uninstall"
154 LIBTOOL_CLEAN_TARGET="libtool-clean"
155 QMAKE_LIBTOOL="${BUILD_DIR}/libtool"
156 FD_PLUGIN_DIR="src/plugins/fd"
159 DEFAULT_OBJECT_TYPE=".o"
160 DEFAULT_ARCHIVE_TYPE=".a"
161 DEFAULT_SHARED_OBJECT_TYPE=".so"
162 LIBTOOL="# \$(LIBTOOL)"
163 LIBTOOL_INSTALL_TARGET=""
164 LIBTOOL_UNINSTALL_TARGET=""
165 LIBTOOL_CLEAN_TARGET=""
166 QMAKE_LIBTOOL="# ${BUILD_DIR}/libtool"
171 AC_SUBST(DEFAULT_OBJECT_TYPE)
172 AC_SUBST(DEFAULT_ARCHIVE_TYPE)
173 AC_SUBST(DEFAULT_SHARED_OBJECT_TYPE)
175 AC_SUBST(LIBTOOL_INSTALL_TARGET)
176 AC_SUBST(LIBTOOL_UNINSTALL_TARGET)
177 AC_SUBST(LIBTOOL_CLEAN_TARGET)
178 AC_SUBST(QMAKE_LIBTOOL)
179 AC_SUBST(FD_PLUGIN_DIR)
181 dnl --------------------------------------------------
182 dnl Include file handling
183 dnl --------------------------------------------------
184 AC_ARG_ENABLE(includes,
185 AC_HELP_STRING([--enable-includes], [enable installing of include files @<:@default=no@:>@]),
187 if test x$enableval = xyes; then
193 dnl It only makes sense to install include files when you install libraries which only happens when
194 dnl libtool is enabled
196 if test x$use_libtool != xno -a x$install_includes = xyes; then
197 INCLUDE_INSTALL_TARGET="install-includes"
198 INCLUDE_UNINSTALL_TARGET="uninstall-includes"
200 INCLUDE_INSTALL_TARGET=""
201 INCLUDE_UNINSTALL_TARGET=""
203 AC_SUBST(INCLUDE_INSTALL_TARGET)
204 AC_SUBST(INCLUDE_UNINSTALL_TARGET)
206 dnl --------------------------------------------------
207 dnl Bacula OP Sys determination (see aclocal.m4)
208 dnl --------------------------------------------------
211 dnl -----------------------------------------------------------
212 dnl Bacula OPSys Distribution determination (see aclocal.m4)
213 dnl ----------------------------------------------------------
214 BA_CHECK_OPSYS_DISTNAME
216 dnl --------------------------------------------------
217 dnl Suppport for gettext (translations)
218 dnl By default, $datarootdir is ${prefix}/share
219 dnl --------------------------------------------------
220 AM_GNU_GETTEXT([external])
222 dnl ------------------------------------------------------------------
223 dnl If the user has not set --prefix, we set our default to nothing.
224 dnl In this case, if the user has not set --sysconfdir, we set it
225 dnl to the package default of /etc/bacula. If either --prefix or
226 dnl --sysconfdir is set, we leave sysconfdir alone except to eval it.
227 dnl If the user has not set --libdir, we set it to the package
228 dnl default of /usr/lib. If either --prefix or --libdir is set,
229 dnl we leave libdir alone except to eval it. If the user has not set
230 dnl --includedir, we set it to the package default of /usr/include.
231 dnl If either --prefix or --includedir is set, we leave includedir
232 dnl alone except to eval it
233 dnl ------------------------------------------------------------------
234 os_name=`uname -s 2>/dev/null`
235 if test x${prefix} = xNONE ; then
236 if test `eval echo ${sysconfdir}` = NONE/etc ; then
237 sysconfdir=/etc/bacula
240 if test `eval echo ${libdir}` = NONE/lib ; then
243 os_processor=`uname -p 2>/dev/null`
244 case ${os_processor} in
259 if test `eval echo ${includedir}` = NONE/include ; then
260 includedir=/usr/include
263 if test `eval echo ${datarootdir}` = NONE/share ; then
264 datarootdir=/usr/share
269 dnl -------------------------------------------------------------------------
270 dnl If the user has not set --exec-prefix, we default to ${prefix}
271 dnl -------------------------------------------------------------------------
272 if test x${exec_prefix} = xNONE ; then
273 exec_prefix=${prefix}
276 sysconfdir=`eval echo ${sysconfdir}`
277 datarootdir=`eval echo ${datarootdir}`
278 docdir=`eval echo ${docdir}`
279 htmldir=`eval echo ${htmldir}`
280 libdir=`eval echo ${libdir}`
281 includedir=`eval echo ${includedir}`
282 localedir=`eval echo ${datarootdir}/locale`
283 AC_DEFINE_UNQUOTED(SYSCONFDIR, "$sysconfdir")
284 AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir")
286 dnl ------------------------------------------------------------------
287 dnl If the user has not set --sbindir, we set our default as /sbin
288 dnl ------------------------------------------------------------------
289 if test x$sbindir = x'${exec_prefix}/sbin' ; then
290 sbindir=${exec_prefix}/sbin
292 sbindir=`eval echo ${sbindir}`
294 dnl -------------------------------------------------------------------------
295 dnl If the user has not set --mandir, we default to /usr/share/man
296 dnl -------------------------------------------------------------------------
297 if test x$mandir = x'${prefix}/man' ; then
298 mandir=/usr/share/man
301 dnl -------------------------------------------------------------------------
302 dnl If the user has not set --htmldir, we default to /usr/share/doc/bacula/html
303 dnl -------------------------------------------------------------------------
304 if test x$htmldir = x${docdir} ; then
305 htmldir=`eval echo ${docdir}bacula/html`
308 dnl -------------------------------------------------------------------------
309 dnl If the user has not set --docdir, we default to /usr/share/doc/
310 dnl -------------------------------------------------------------------------
311 if test x$docdir = x'/usr/share/doc/' ; then
312 docdir=`eval echo ${docdir}bacula`
316 AC_PATH_PROGS(MSGFMT, msgfmt, no)
317 if test "$MSGFMT" = "no"
319 echo 'msgfmt program not found, disabling NLS !'
321 USE_INCLUDED_LIBINTL=no
329 support_postgresql=no
332 support_smartalloc=yes
337 support_wx_console=no
338 support_tray_monitor=no
343 support_static_tools=no
346 support_static_dir=no
347 support_static_cons=no
357 dnl --------------------------------------------------------------------------
358 dnl CHECKING COMMAND LINE OPTIONS
359 dnl --------------------------------------------------------------------------
361 dnl -------------------------------------------
362 dnl gnome (default off)
363 dnl -------------------------------------------
365 AC_HELP_STRING([--enable-gnome], [enable build of bgnome-console GUI @<:@default=no@:>@]),
367 if test x$enableval = xyes; then
374 if test x$support_gnome = xyes; then
375 AC_MSG_ERROR(bgnome-console no longer supported)
376 AC_MSG_ERROR(--enable-gnome option no longer supported)
378 # AC_SUBST(GNOME_DIR)
380 dnl -------------------------------------------
381 dnl bat (default off)
382 dnl -------------------------------------------
384 AC_HELP_STRING([--enable-bat], [enable build of bat Qt4 GUI @<:@default=no@:>@]),
386 if test x$enableval = xyes; then
387 AC_DEFINE(HAVE_BAT, 1, [Set if Bacula bat Qt4 GUI support enabled])
394 if test x$support_bat = xyes; then
395 abc=`$PKGCONFIG --atleast-version=4.2 QtGui`
397 if test $pkg = 0; then
398 BAT_DIR=src/qt-console
400 AC_MSG_ERROR(Unable to find Qt4 installation needed by bat)
405 dnl The qwt library was used with bat, but that is no longer the case
413 dnl if test x$support_bat = xyes; then
414 dnl AC_MSG_CHECKING(for qwt support)
416 dnl AC_HELP_STRING([--with-qwt@<:@=DIR@:>@], [specify qwt library directory]),
418 dnl case "$with_qwt" in
423 dnl if test -f ${with_qwt}/include/qwt.h; then
424 dnl QWT_INC="${with_qwt}/include"
425 dnl QWT_LDFLAGS="-L${with_qwt}/lib"
435 dnl dnl Search in standard places, or --with-qwt not specified
437 dnl if test $no_qwt = no; then
438 dnl if test x$QWT_INC = x; then
439 dnl for root in /usr /usr/local; do
440 dnl for ver in qwt qwt5 qwt-qt4; do
441 dnl if test -f ${root}/include/${ver}/qwt.h; then
442 dnl QWT_INC="${root}/include/${ver}"
443 dnl if test -d ${root}/lib64/; then
444 dnl QWT_LDFLAGS="-L${root}/lib64"
445 dnl elif test -d ${root}/lib/64/; then
446 dnl QWT_LDFLAGS="-L${root}/64"
448 dnl QWT_LDFLAGS="-L${root}/lib"
459 dnl if test x$QWT_INC = x; then
460 dnl AC_MSG_RESULT(no)
462 dnl AC_DEFINE(HAVE_QWT, 1, [Set if bat QWT library found])
463 dnl AC_MSG_RESULT(yes)
469 AC_SUBST(QWT_LDFLAGS)
473 dnl -------------------------------------------
474 dnl bwx-console (default off)
475 dnl -------------------------------------------
476 AC_ARG_ENABLE(bwx-console,
477 AC_HELP_STRING([--enable-bwx-console], [enable build of wxWidgets console @<:@default=no@:>@]),
479 if test x$enableval = xyes; then
480 support_wx_console=yes
486 if test x$support_wx_console = xyes; then
487 abc=`$WXCONFIG $WXFLAGS --cppflags`
489 if test $pkg = 0; then
490 wx_version="wxWidgets `$WXCONFIG $WXFLAGS --release`"
491 WXCONS_CPPFLAGS=`$WXCONFIG $WXFLAGS --cppflags`
492 WXCONS_LDFLAGS=`$WXCONFIG $WXFLAGS --libs`
494 AC_SUBST(WXCONS_CPPFLAGS)
495 AC_SUBST(WXCONS_LDFLAGS)
496 WX_DIR="src/wx-console"
499 echo "wx-config program not found. bwx-console disabled."
501 support_wx_console=no
506 dnl -------------------------------------------
507 dnl tray-monitor (default off)
508 dnl -------------------------------------------
509 AC_ARG_ENABLE(tray-monitor,
510 AC_HELP_STRING([--enable-tray-monitor], [enable build of Gnome tray monitor (compatible with KDE @<:@default=no@:>@]),
512 if test x$enableval = xyes; then
513 support_tray_monitor=yes
519 if test x$support_tray_monitor = xyes; then
520 abc=`$PKGCONFIG --exists gtk+-2.0`
522 if test $pkg = 0; then
523 TRAY_MONITOR_CPPFLAGS=`$PKGCONFIG --cflags gtk+-2.0`
524 TRAY_MONITOR_LDFLAGS=`$PKGCONFIG --libs gtk+-2.0`
525 AC_SUBST(TRAY_MONITOR_CPPFLAGS)
526 AC_SUBST(TRAY_MONITOR_LDFLAGS)
527 TRAY_MONITOR_DIR=src/tray-monitor
528 abc=`$PKGCONFIG --atleast-version=2.4 gtk+-2.0`
530 if test $pkg = 0; then
531 AC_DEFINE(HAVE_GTK_2_4, 1, [Set if you have GTK 4.2 or greater loaded])
535 AC_SUBST(TRAY_MONITOR_DIR)
537 dnl -------------------------------------------
538 dnl smartalloc (default off)
539 dnl -------------------------------------------
540 AC_ARG_ENABLE(smartalloc,
541 AC_HELP_STRING([--enable-smartalloc], [enable smartalloc debugging support @<:@default=no@:>@]),
543 if test x$enableval = xno; then
544 support_smartalloc=no
549 if test x$support_smartalloc = xyes; then
550 AC_DEFINE(SMARTALLOC, 1, [Set if you want Smartalloc enabled])
553 dnl -------------------------------------------
554 dnl Lock Manager (default off)
555 dnl -------------------------------------------
556 AC_ARG_ENABLE(lockmgr,
557 AC_HELP_STRING([--enable-lockmgr], [enable lock manager support @<:@default=no@:>@]),
559 if test x$enableval = xyes; then
565 if test x$support_lockmgr = xyes; then
566 AC_DEFINE(_USE_LOCKMGR, 1, [Set if you want Lock Manager enabled])
570 dnl -------------------------------------------
571 dnl static-tools (default off)
572 dnl -------------------------------------------
573 AC_ARG_ENABLE(static-tools,
574 AC_HELP_STRING([--enable-static-tools], [enable static tape tools @<:@default=no@:>@]),
576 if test x$enableval = xyes; then
577 if test x$use_libtool = xyes; then
578 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
579 please rerun configure with --disable-libtool])
581 support_static_tools=yes
587 if test x$support_static_tools = xyes; then
588 TTOOL_LDFLAGS="-static"
590 AC_SUBST(TTOOL_LDFLAGS)
592 dnl -------------------------------------------
593 dnl static-fd (default off)
594 dnl -------------------------------------------
595 AC_ARG_ENABLE(static-fd,
596 AC_HELP_STRING([--enable-static-fd], [enable static File daemon @<:@default=no@:>@]),
598 if test x$enableval = xyes; then
599 if test x$use_libtool = xyes; then
600 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
601 please rerun configure with --disable-libtool])
603 support_static_fd=yes
609 if test x$support_static_fd = xyes; then
610 STATIC_FD="static-bacula-fd"
614 dnl -------------------------------------------
615 dnl static-sd (default off)
616 dnl -------------------------------------------
617 AC_ARG_ENABLE(static-sd,
618 AC_HELP_STRING([--enable-static-sd], [enable static Storage daemon @<:@default=no@:>@]),
620 if test x$enableval = xyes; then
621 if test x$use_libtool = xyes; then
622 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
623 please rerun configure with --disable-libtool])
625 support_static_sd=yes
631 if test x$support_static_sd = xyes; then
632 STATIC_SD="static-bacula-sd"
636 dnl -------------------------------------------
637 dnl static-dir (default off)
638 dnl -------------------------------------------
639 AC_ARG_ENABLE(static-dir,
640 AC_HELP_STRING([--enable-static-dir], [enable static Director @<:@default=no@:>@]),
642 if test x$enableval = xyes; then
643 if test x$use_libtool = xyes; then
644 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
645 please rerun configure with --disable-libtool])
647 support_static_dir=yes
653 if test x$support_static_dir = xyes; then
654 STATIC_DIR="static-bacula-dir"
658 dnl -------------------------------------------
659 dnl static-cons (default off)
660 dnl -------------------------------------------
661 AC_ARG_ENABLE(static-cons,
662 AC_HELP_STRING([--enable-static-cons], [enable static Console @<:@default=no@:>@]),
664 if test x$enableval = xyes; then
665 if test x$use_libtool = xyes; then
666 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
667 please rerun configure with --disable-libtool])
669 support_static_cons=yes
677 if test x$support_static_cons = xyes; then
678 STATIC_CONS="static-bconsole"
679 STATIC_GNOME_CONS="static-bgnome-console"
680 STATIC_WX_CONS="static-bwx-console"
682 AC_SUBST(STATIC_CONS)
683 AC_SUBST(STATIC_GNOME_CONS)
684 AC_SUBST(STATIC_WX_CONS)
686 dnl -------------------------------------------
687 dnl client_only (default off)
688 dnl -------------------------------------------
689 AC_ARG_ENABLE(client-only,
690 AC_HELP_STRING([--enable-client-only], [build client (File daemon) only @<:@default=no@:>@]),
692 if test x$enableval = xyes; then
693 build_client_only=yes
699 if test x$build_client_only = xno; then
706 dnl -------------------------------------------
707 dnl director (default on)
708 dnl -------------------------------------------
709 AC_ARG_ENABLE(build-dird,
710 AC_HELP_STRING([--enable-build-dird], [enable building of dird (Director) @<:@default=yes@:>@]),
712 if test x$enableval = xno; then
717 if test x$build_dird = xyes; then
722 DIR_TOOLS="NODIRTOOLS"
727 dnl -------------------------------------------
728 dnl stored (default on)
729 dnl -------------------------------------------
730 AC_ARG_ENABLE(build-stored,
731 AC_HELP_STRING([--enable-build-stored], [enable building of stored (Storage daemon) @<:@default=yes@:>@]),
733 if test x$enableval = xno; then
738 if test x$build_stored = xyes; then
739 STORED_DIR="src/stored"
745 dnl ---------------------------------------------------
746 dnl Check for conio (Bacula readline substitute)(
747 dnl ---------------------------------------------------
748 dnl this allows you to turn it completely off
750 AC_HELP_STRING([--disable-conio], [disable conio support @<:@default=no@:>@]),
752 if test x$enableval = xno; then
759 dnl ---------------------------------------------------
760 dnl Check for IPv6 support
761 dnl ---------------------------------------------------
762 dnl this allows you to turn it completely off
765 AC_HELP_STRING([--enable-ipv6], [enable ipv6 support @<:@default=yes@:>@]),
767 if test x$enableval = xno; then
773 if test x$support_ipv6 = xyes; then
774 AC_TRY_LINK([ #include <sys/types.h>
775 #include <sys/socket.h>
776 #include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;],
777 [support_ipv6=yes], [support_ipv6=no])
780 if test x$support_ipv6 = xyes; then
781 AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
785 if test x$support_conio = xyes; then
786 AC_CHECK_HEADER(termcap.h,
787 [ AC_CHECK_LIB(termcap, tgetent,
788 [ CONS_LIBS="-ltermcap"
793 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
795 [ AC_CHECK_LIB(ncurses, tgetent,
796 [ CONS_LIBS="-lncurses"
801 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
806 AC_CHECK_HEADERS(curses.h)
807 AC_CHECK_HEADER(term.h,
808 [ AC_CHECK_LIB(curses, tgetent,
809 [ CONS_LIBS="-lcurses"
814 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
817 [ echo " "; echo "Required libraries not found. CONIO turned off ..."; echo " "],
826 dnl ---------------------------------------------------
827 dnl Check for readline support/directory (default off)
828 dnl ---------------------------------------------------
829 dnl this allows you to turn it completely off
830 AC_ARG_ENABLE(readline,
831 AC_HELP_STRING([--disable-readline], [disable readline support @<:@default=yes@:>@]),
833 if test x$enableval = xno; then
841 if test x$support_readline = xyes; then
842 AC_ARG_WITH(readline,
843 AC_HELP_STRING([--with-readline@<:@=DIR@:>@], [specify readline library directory]),
845 case "$with_readline" in
850 if test -f ${with_readline}/readline.h; then
851 CONS_INC="-I${with_readline}"
852 CONS_LDFLAGS="-L$with_readline"
853 elif test -f ${with_readline}/include/readline/readline.h; then
854 CONS_INC="-I${with_readline}/include/readline"
855 CONS_LDFLAGS="-L${with_readline}/lib"
856 with_readline="${with_readline}/include/readline"
858 with_readline="/usr/include/readline"
861 AC_CHECK_HEADER(${with_readline}/readline.h,
863 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
864 CONS_LIBS="-lreadline -lhistory -ltermcap"
868 echo "readline.h not found. readline turned off ..."
875 dnl check for standard readline library
876 AC_CHECK_HEADER(/usr/include/readline/readline.h,
878 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
880 CONS_INC="-I/usr/include/readline"
881 CONS_LIBS="-lreadline -ltermcap"
883 dnl Did not find standard library, so try Bacula's default
884 AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h,
886 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
888 CONS_INC="-I${TOP_DIR}/depkgs/readline"
889 CONS_LIBS="-lreadline -lhistory -ltermcap"
890 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
891 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
894 echo "readline.h not found. readline turned off ..."
908 AC_SUBST(CONS_LDFLAGS)
909 AC_SUBST(READLINE_SRC)
911 dnl Minimal stuff for readline Makefile configuration
916 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr lstat lchown)
917 AC_CHECK_FUNCS(nanosleep nl_langinfo)
918 AC_CHECK_HEADERS(varargs.h)
920 dnl End of readline/conio stuff
921 dnl -----------------------------------------------------------------------
923 dnl -----------------------------------------------------------------------
924 dnl Check for Python support
926 AC_MSG_CHECKING(for Python support)
928 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.]),
932 if test "$withval" != "no"; then
933 if test "$withval" = "yes"; then
934 if test -e /usr/bin/python-config ; then
935 PYTHON_INCDIR=`/usr/bin/python-config --includes`
936 PYTHON_LIBS=`/usr/bin/python-config --libs`
938 for python_root in /usr /usr/local /usr/sfw; do
939 for ver in python2.2 python2.3 python2.4 python2.5 python2.6 python3; do
940 if test -f $python_root/include/${ver}/Python.h; then
941 PYTHON_INCDIR=-I$python_root/include/${ver}
942 if test -d $python_root/lib64/${ver}/config; then
943 PYTHON_LIBS="-L$python_root/lib64/${ver}/config -l${ver}"
945 PYTHON_LIBS="-L$python_root/lib/${ver}/config -l${ver}"
952 if test x$PYTHON_INCDIR = x; then
953 if test -f $prefix/include/Python.h; then
954 PYTHON_INCDIR=-I$prefix/include
955 if test -d $prefix/lib64/config; then
956 PYTHON_LIBS="-L$prefix/lib64/config -lpython"
958 PYTHON_LIBS="-L$prefix/lib/config -lpython"
962 AC_MSG_ERROR(Unable to find Python.h in standard locations)
967 if test -e $withval/bin/python-config ; then
968 PYTHON_INCDIR=`$withval/bin/python-config --includes`
969 PYTHON_LIBS=`$withval/bin/python-config --libs`
970 elif test -f $withval/Python.h; then
971 PYTHON_INCDIR=-I$withval
972 PYTHON_LIBS="-L$withval/config -lpython"
973 elif test -f $withval/include/Python.h; then
974 PYTHON_INCDIR=-I$withval/include
975 if test -d $withval/lib64/config; then
976 PYTHON_LIBS="-L$withval/lib64/config -lpython"
978 PYTHON_LIBS="-L$withval/lib/config -lpython"
980 elif test -f $withval/include/python/Python.h; then
981 PYTHON_INCDIR=-I$withval/include/python
982 if test -d $withval/lib64/python/config; then
983 PYTHON_LIBS="-L$withval/lib64/python/config -lpython"
985 PYTHON_LIBS="-L$withval/lib/python/config -lpython"
989 AC_MSG_ERROR(Invalid Python directory $withval - unable to find Python.h under $withval)
993 AC_DEFINE([HAVE_PYTHON], 1)
996 AC_MSG_NOTICE(checking for more Python libs)
997 saved_LIBS="$LIBS"; LIBS=
998 AC_SEARCH_LIBS(shm_open, [rt])
999 AC_CHECK_LIB(util, openpty)
1000 PYTHON_LIBS="$PYTHON_LIBS $LIBS"
1009 AC_SUBST(PYTHON_LIBS)
1010 AC_SUBST(PYTHON_INCDIR)
1013 dnl Find where sockets are (especially for Solaris)
1014 dnl Do this before the TCP Wrappers test since tcp wrappers
1015 dnl uses the socket library and some linkers are stupid.
1017 AC_CHECK_FUNC(socket,
1018 AC_MSG_RESULT(using libc's socket),
1019 AC_CHECK_LIB(xnet,socket)
1020 AC_CHECK_LIB(socket,socket)
1021 AC_CHECK_LIB(inet,socket))
1023 dnl -----------------------------------------------------------
1024 dnl Check whether user wants TCP wrappers support (default off)
1025 dnl -----------------------------------------------------------
1028 AC_ARG_WITH(tcp-wrappers,
1029 AC_HELP_STRING([--with-tcp-wrappers@<:@=DIR@:>@], [enable tcpwrappers support]),
1031 if test "x$withval" != "xno" ; then
1033 LIBS="$saved_LIBS -lwrap"
1034 AC_SEARCH_LIBS(nanosleep, [rt])
1035 AC_MSG_CHECKING(for libwrap)
1038 #include <sys/types.h>
1040 int deny_severity = 0;
1041 int allow_severity = 0;
1042 struct request_info *req;
1047 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
1052 LIBS="$saved_LIBS -lwrap -lnsl"
1053 WRAPLIBS="$saved_LIBS -lwrap -lnsl"
1056 #include <sys/types.h>
1058 int deny_severity = 0;
1059 int allow_severity = 0;
1060 struct request_info *req;
1065 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
1070 AC_MSG_ERROR([*** libwrap missing])
1079 dnl -----------------------------------------------------------
1080 dnl Check whether OpenSSL is available
1081 dnl -----------------------------------------------------------
1082 AC_MSG_CHECKING([for OpenSSL])
1083 dnl The following uses quadrigraphs:
1086 AC_ARG_WITH(openssl,
1087 AC_HELP_STRING([--with-openssl@<:@=DIR@:>@], [Include OpenSSL support. DIR is the OpenSSL base]),
1089 with_openssl_directory=${withval}
1093 if test "x$with_openssl_directory" != "xno"; then
1094 OPENSSL_LIBS="-lssl -lcrypto"
1097 if test "x$with_openssl_directory" != "xyes" && test x"${with_openssl_directory}" != "x"; then
1099 # Make sure the $with_openssl_directory also makes sense
1101 if test -d "$with_openssl_directory/lib" -a -d "$with_openssl_directory/include"; then
1102 OPENSSL_LIBS="-L$with_openssl_directory/lib $OPENSSL_LIBS"
1103 OPENSSL_INC="-I$with_openssl_directory/include $OPENSSL_INC"
1107 saved_LIBS="${LIBS}"
1108 saved_CFLAGS="${CFLAGS}"
1109 LIBS="${saved_LIBS} ${OPENSSL_LIBS}"
1110 CFLAGS="${saved_CFLAGS} ${OPENSSL_INC}"
1114 #include <openssl/ssl.h>
1116 CRYPTO_set_id_callback(NULL);
1119 support_crypto="yes"
1127 #include <openssl/evp.h>
1131 ac_cv_openssl_sha2="yes"
1133 ac_cv_openssl_sha2="no"
1137 dnl Solaris disables greater than 128+ bit encryption in their OpenSSL
1138 dnl implementation, presumably for export reasons. If 192bit AES
1139 dnl is available, we assume that we're running with a 'non-export'
1140 dnl openssl library.
1143 #include <openssl/evp.h>
1147 ac_cv_openssl_export="no"
1149 ac_cv_openssl_export="yes"
1153 LIBS="${saved_LIBS}"
1154 CFLAGS="${saved_CFLAGS}"
1156 if test "$support_tls" = "yes"; then
1157 AC_DEFINE(HAVE_OPENSSL, 1, [Define if OpenSSL library is available])
1158 AC_DEFINE(HAVE_TLS, 1, [Define if TLS support should be enabled])
1159 AC_DEFINE(HAVE_CRYPTO, 1, [Define if encryption support should be enabled])
1162 if test "$ac_cv_openssl_sha2" = "yes"; then
1163 AC_DEFINE(HAVE_SHA2, 1, [Define if the SHA-2 family of digest algorithms is available])
1166 if test "$ac_cv_openssl_export" = "yes"; then
1167 AC_DEFINE(HAVE_OPENSSL_EXPORT_LIBRARY, 1, [Define if the OpenSSL library is export-contrained to 128bit ciphers])
1176 if test "$support_tls" = "no"; then
1181 AC_MSG_RESULT([$support_tls])
1182 AC_SUBST(OPENSSL_LIBS)
1183 AC_SUBST(OPENSSL_INC)
1185 dnl -----------------------------------------------------------
1186 dnl dlopen is needed for plugins
1187 dnl -----------------------------------------------------------
1188 AC_SEARCH_LIBS(dlopen, [dl])
1190 dnl ------------------------------------------
1191 dnl Where to place working dir
1192 dnl ------------------------------------------
1193 working_dir=`eval echo ${prefix}/var/bacula/working`
1194 AC_ARG_WITH(working-dir,
1195 AC_HELP_STRING([--with-working-dir=PATH], [specify path of Bacula working directory]),
1197 if test "x$withval" != "xno" ; then
1198 working_dir=$withval
1203 AC_SUBST(working_dir)
1205 dnl ------------------------------------------------------------------
1206 dnl If the user has not set archivedir, we set our default as /tmp
1207 dnl ------------------------------------------------------------------
1209 AC_ARG_WITH(archivedir,
1210 AC_HELP_STRING([--with-archivedir=PATH], [specify path of SD archive directory]),
1212 if test "x$withval" != "xno" ; then
1218 AC_SUBST(archivedir)
1220 dnl ------------------------------------------------------------------
1221 dnl Allow the user to specify the daemon resource name default hostname
1222 dnl ------------------------------------------------------------------
1224 AC_ARG_WITH(basename,
1225 AC_HELP_STRING([--with-basename=RESNAME], [specify base resource name for daemons]),
1227 if test "x$withval" != "xno" ; then
1235 dnl ------------------------------------------------------------------
1236 dnl Allow the user to override the hostname (default = machine hostname)
1237 dnl ------------------------------------------------------------------
1238 hostname=`uname -n | cut -d '.' -f 1`
1239 if test x${hostname} = x ; then
1240 hostname="localhost"
1242 AC_ARG_WITH(hostname,
1243 AC_HELP_STRING([--with-hostname=RESNAME], [specify host name for daemons]),
1245 if test "x$withval" != "xno" ; then
1254 dnl ------------------------------------------
1255 dnl Where to place scriptdir (script files)
1256 dnl ------------------------------------------
1257 scriptdir=`eval echo ${sysconfdir}`
1258 AC_ARG_WITH(scriptdir,
1259 AC_HELP_STRING([--with-scriptdir=PATH], [specify path of Bacula scripts directory]),
1261 if test "x$withval" != "xno" ; then
1270 dnl ------------------------------------------
1271 dnl Where to place bsrdir (bsr files)
1272 dnl ------------------------------------------
1275 AC_HELP_STRING([--with-bsrdir=PATH], [specify path of Bacula bsrs directory]),
1277 if test "x$withval" != "xno" ; then
1285 dnl ------------------------------------------
1286 dnl Where to place logdir (bsr files)
1287 dnl ------------------------------------------
1290 AC_HELP_STRING([--with-logdir=PATH], [specify path of Bacula logs directory]),
1292 if test "x$withval" != "xno" ; then
1301 # ------------------------------------------
1302 # Where to place plugindir (plugin files)
1303 # ------------------------------------------
1304 plugindir=`eval echo ${libdir}`
1305 AC_ARG_WITH(plugindir,
1306 AC_HELP_STRING([--with-plugindir=PATH], [specify path of Bacula plugins directory]),
1308 if test "x$withval" != "xno" ; then
1316 dnl ------------------------------------------
1317 dnl Where to send dump email
1318 dnl ------------------------------------------
1319 dump_email=root@localhost
1320 AC_ARG_WITH(dump-email,
1321 AC_HELP_STRING([--with-dump-email=EMAIL], [dump email address]),
1323 if test "x$withval" != "xno" ; then
1329 AC_SUBST(dump_email)
1331 dnl ------------------------------------------
1332 dnl Where to send job email
1333 dnl ------------------------------------------
1334 job_email=root@localhost
1335 AC_ARG_WITH(job-email,
1336 AC_HELP_STRING([--with-job-email=EMAIL], [job output email address]),
1338 if test "x$withval" != "xno" ; then
1346 dnl ------------------------------------------
1347 dnl Where to find smtp host
1348 dnl ------------------------------------------
1350 AC_ARG_WITH(smtp_host,
1351 AC_HELP_STRING([--with-smtp-host=HOST], [SMTP mail host address]),
1353 if test "x$withval" != "xno" ; then
1361 dnl ------------------------------------
1362 dnl Where to place pid files
1363 dnl ------------------------------------
1365 AC_ARG_WITH(pid-dir,
1366 AC_HELP_STRING([--with-pid-dir=PATH], [specify location of Bacula pid files]),
1368 if test "x$withval" != "xno" ; then
1374 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
1377 dnl ------------------------------------
1378 dnl Where to place subsys "lock file"
1379 dnl ------------------------------------
1380 subsysdir=/var/run/subsys
1381 if test -d /var/run/subsys; then
1382 subsysdir=/var/run/subsys
1383 elif test -d /var/lock/subsys; then
1384 subsysdir=/var/lock/subsys
1386 subsysdir=/var/run/subsys
1388 AC_ARG_WITH(subsys-dir,
1389 AC_HELP_STRING([--with-subsys-dir=PATH], [specify location of Bacula subsys file]),
1391 if test "x$withval" != "xno" ; then
1399 dnl ------------------------------------
1400 dnl Where to start assigning ports
1401 dnl ------------------------------------
1403 AC_ARG_WITH(baseport,
1404 AC_HELP_STRING([--with-baseport=PORT], [specify base port address for daemons]),
1406 if test "x$withval" != "xno" ; then
1413 dir_port=`expr $baseport`
1414 fd_port=`expr $baseport + 1`
1415 sd_port=`expr $fd_port + 1`
1421 dnl ------------------------------------------
1422 dnl Generate passwords
1423 dnl ------------------------------------------
1425 AC_ARG_WITH(dir-password,
1426 AC_HELP_STRING([--with-dir-password=PASSWORD], [specify Director's password]),
1428 if test "x$withval" != "xno" ; then
1429 dir_password=$withval
1434 if test "x$dir_password" = "x" ; then
1435 if test "x$OPENSSL" = "xnone" ; then
1436 key=`autoconf/randpass 33`
1438 key=`openssl rand -base64 33`
1444 AC_ARG_WITH(fd-password,
1445 AC_HELP_STRING([--with-fd-password=PASSWORD], [specify Client's password]),
1447 if test "x$withval" != "xno" ; then
1448 fd_password=$withval
1453 if test "x$fd_password" = "x" ; then
1454 if test "x$OPENSSL" = "xnone" ; then
1455 key=`autoconf/randpass 37`
1457 key=`openssl rand -base64 33`
1463 AC_ARG_WITH(sd-password,
1464 AC_HELP_STRING([--with-sd-password=PASSWORD], [specify Storage daemon's password]),
1466 if test "x$withval" != "xno" ; then
1467 sd_password=$withval
1472 if test "x$sd_password" = "x" ; then
1473 if test "x$OPENSSL" = "xnone" ; then
1474 key=`autoconf/randpass 41`
1476 key=`openssl rand -base64 33`
1482 AC_ARG_WITH(mon-dir-password,
1483 AC_HELP_STRING([--with-mon-dir-password=PASSWORD], [specify Director's password used by the monitor]),
1485 if test "x$withval" != "xno" ; then
1486 mon_dir_password=$withval
1491 if test "x$mon_dir_password" = "x" ; then
1492 if test "x$OPENSSL" = "xnone" ; then
1493 key=`autoconf/randpass 33`
1495 key=`openssl rand -base64 33`
1497 mon_dir_password=$key
1501 AC_ARG_WITH(mon-fd-password,
1502 AC_HELP_STRING([--with-mon-fd-password=PASSWORD], [specify Client's password used by the monitor]),
1504 if test "x$withval" != "xno" ; then
1505 mon_fd_password=$withval
1510 if test "x$mon_fd_password" = "x" ; then
1511 if test "x$OPENSSL" = "xnone" ; then
1512 key=`autoconf/randpass 37`
1514 key=`openssl rand -base64 33`
1516 mon_fd_password=$key
1520 AC_ARG_WITH(mon-sd-password,
1521 AC_HELP_STRING([--with-mon-sd-password=PASSWORD], [specify Storage daemon's password used by the monitor]),
1523 if test "x$withval" != "xno" ; then
1524 mon_sd_password=$withval
1529 if test "x$mon_sd_password" = "x" ; then
1530 if test "x$OPENSSL" = "xnone" ; then
1531 key=`autoconf/randpass 41`
1533 key=`openssl rand -base64 33`
1535 mon_sd_password=$key
1538 AC_SUBST(dir_password)
1539 AC_SUBST(fd_password)
1540 AC_SUBST(sd_password)
1541 AC_SUBST(mon_dir_password)
1542 AC_SUBST(mon_fd_password)
1543 AC_SUBST(mon_sd_password)
1546 dnl Pickup any database name
1549 AC_ARG_WITH(db_name,
1550 AC_HELP_STRING([--with-db-name=DBNAME], [specify database name @<:@default=bacula@:>@]),
1552 if test "x$withval" != "x" ; then
1560 AC_ARG_WITH(db_user,
1561 AC_HELP_STRING([--with-db-user=UNAME], [specify database user @<:@default=bacula@:>@]),
1563 if test "x$withval" != "x" ; then
1571 AC_ARG_WITH(db_password,
1572 AC_HELP_STRING([--with-db-password=PWD], [specify database password @<:@default=*none*@:>@]),
1574 if test "x$withval" != "x" ; then
1575 db_password=$withval
1579 AC_SUBST(db_password)
1582 dnl Pickup a database port
1585 AC_ARG_WITH(db_port,
1586 AC_HELP_STRING([--with-db-port=DBPORT], [specify a database port @<:@default=null@:>@]),
1588 if test "x$withval" != "x" ; then
1596 # Handle users and groups for each daemon
1599 AC_ARG_WITH(dir_user,
1600 AC_HELP_STRING([--with-dir-user=USER], [specify user for Director daemon]),
1602 if test "x$withval" != "x" ; then
1609 AC_ARG_WITH(dir_group,
1610 AC_HELP_STRING([--with-dir-group=GROUP], [specify group for Director daemon]),
1612 if test "x$withval" != "x" ; then
1619 AC_ARG_WITH(sd_user,
1620 AC_HELP_STRING([--with-sd-user=USER], [specify user for Storage daemon]),
1622 if test "x$withval" != "x" ; then
1629 AC_ARG_WITH(sd_group,
1630 AC_HELP_STRING([--with-sd-group=GROUP], [specify group for Storage daemon]),
1632 if test "x$withval" != "x" ; then
1639 AC_ARG_WITH(fd_user,
1640 AC_HELP_STRING([--with-fd-user=USER], [specify user for File daemon]),
1642 if test "x$withval" != "x" ; then
1649 AC_ARG_WITH(fd_group,
1650 AC_HELP_STRING([--with-fd-group=GROUP], [specify group for File daemon]),
1652 if test "x$withval" != "x" ; then
1666 dnl allow setting default executable permissions
1669 AC_ARG_WITH(sbin-perm,
1670 AC_HELP_STRING([--with-sbin-perm=MODE], [specify permissions for sbin binaries @<:@default=0754@:>@]),
1672 if test "x$withval" != "x" ; then
1680 dnl ------------------------------------------------
1681 dnl Bacula check for various SQL database engines
1682 dnl ------------------------------------------------
1684 BA_CHECK_POSTGRESQL_DB
1692 # BA_CHECK_SQLITE_DB
1701 dnl -------------------------------------------
1702 dnl enable batch attribute DB insert (default on)
1703 dnl -------------------------------------------
1704 support_batch_insert=no
1705 A=`test -f $SQL_LIB && nm $SQL_LIB | grep pthread_mutex_lock`
1707 if test $pkg = 0; then
1708 support_batch_insert=yes
1709 AC_ARG_ENABLE(batch-insert,
1710 AC_HELP_STRING([--enable-batch-insert], [enable the DB batch insert code @<:@default=no@:>@]),
1712 if test x$enableval = xno; then
1713 support_batch_insert=no
1715 support_batch_insert=yes
1721 dnl Check if postgresql can support batch mode
1722 if test x$DB_TYPE = xpostgresql; then
1723 AC_CHECK_LIB(pq, PQisthreadsafe, AC_DEFINE(HAVE_PQISTHREADSAFE, 1, [Set if have PQisthreadsafe]))
1724 AC_CHECK_LIB(pq, PQputCopyData, AC_DEFINE(HAVE_PQ_COPY, 1, [Set if have PQputCopyData]))
1725 if test "x$ac_cv_lib_pq_PQputCopyData" != "xyes"
1727 support_batch_insert=no
1731 if test x$DB_TYPE = xdbi; then
1735 dnl Check for batch insert
1736 if test $DB_PROG = postgresql; then
1737 AC_CHECK_LIB(pq, PQisthreadsafe, AC_DEFINE(HAVE_PQISTHREADSAFE))
1738 AC_CHECK_LIB(pq, PQputCopyData, AC_DEFINE(HAVE_PQ_COPY))
1739 test "x$ac_cv_lib_pq_PQputCopyData" != "xyes"
1743 if test $DB_PROG = mysql; then
1744 A=`test -f $SQL_LIB && nm $DB_PROG_LIB | grep pthread_mutex_lock`
1748 if test $DB_PROG = sqlite3; then
1749 A=`test -f $SQL_LIB && nm $DB_PROG_LIB | grep pthread_mutex_lock`
1753 if test $pkg = 0; then
1754 AC_ARG_ENABLE(batch-insert,
1755 AC_HELP_STRING([--enable-batch-insert], [enable the DB batch insert code @<:@default=no@:>@]),
1757 if test x$enableval = xno; then
1758 support_batch_insert=no
1760 support_batch_insert=yes
1766 dnl If dbi was not chosen, let the comment in file
1770 AC_SUBST(uncomment_dbi)
1772 if test $support_batch_insert = yes ; then
1773 AC_DEFINE(HAVE_BATCH_FILE_INSERT, 1, [Set if DB batch insert code enabled])
1776 AC_DEFINE(PROTOTYPES)
1778 dnl --------------------------------------------------------------------------
1779 dnl Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
1781 if test -z "$CFLAGS" -o "$CFLAGS" = "-g -O2"; then
1782 if test -z "$CCOPTS"; then
1783 CCOPTS='-g -O2 -Wall'
1791 dnl See if we can use 64 bit file addresses
1792 largefile_support="no"
1797 dnl --------------------------------------------------------------------------
1798 dnl CHECKING FOR HEADER FILES
1799 dnl --------------------------------------------------------------------------
1837 AC_STRUCT_ST_BLKSIZE
1841 dnl --------------------------------------------------------------------------
1842 dnl Check for utime.h structure
1843 dnl --------------------------------------------------------------------------
1844 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
1848 #include <sys/types.h>
1853 ba_cv_header_utime_h=yes
1855 ba_cv_header_utime_h=no
1860 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H, 1, [Set if utime.h exists])
1862 dnl --------------------------------------------------------------------------
1863 dnl Check for socklen_t
1864 dnl --------------------------------------------------------------------------
1865 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
1869 #include <sys/types.h>
1870 #include <sys/socket.h>
1874 ba_cv_header_socklen_t=yes
1876 ba_cv_header_socklen_t=no
1881 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T, 1, [Set if socklen_t exists])
1883 dnl --------------------------------------------------------------------------
1884 dnl Check for ioctl request type
1885 dnl --------------------------------------------------------------------------
1887 AC_CACHE_CHECK(for ioctl_req_t, ba_cv_header_ioctl_req_t,
1892 #include <sys/types.h>
1893 #include <sys/ioctl.h>
1895 int (*d_ioctl)(int fd, unsigned long int request, ...);
1898 ba_cv_header_ioctl_req_t=yes
1900 ba_cv_header_ioct_req_t_t=no
1905 test $ba_cv_header_ioctl_req_t = yes && AC_DEFINE(HAVE_IOCTL_ULINT_REQUEST, 1, [Set if ioctl request is unsigned long int])
1907 dnl Note: it is more correct to use AC_LANG(C++) but some of the older
1908 dnl *BSD systems still use old style C prototypes, which are wrong with
1909 dnl compiled with a C++ compiler.
1912 dnl --------------------------------------------------------------------------
1913 dnl Check for typeof()
1914 dnl --------------------------------------------------------------------------
1916 AC_CACHE_CHECK(for typeof, ba_cv_have_typeof,
1920 main(){char *a = 0; a = (typeof a)a;}
1922 ba_cv_have_typeof=yes
1924 ba_cv_have_typeof=no
1926 ba_cv_have_typeof=no
1931 test $ba_cv_have_typeof = yes && AC_DEFINE([HAVE_TYPEOF], 1, [Defind to 1 if compiler has typeof])
1936 dnl --------------------------------------------------------------------------
1937 dnl CHECKING FOR FILESYSTEM TYPE
1938 dnl --------------------------------------------------------------------------
1939 AC_MSG_CHECKING(how to get filesystem type)
1941 # The order of these tests is important.
1944 #include <sys/statvfs.h>
1945 #include <sys/fstyp.h>
1947 AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4
1949 if test $fstype = no; then
1952 #include <sys/statfs.h>
1953 #include <sys/fstyp.h>
1955 AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3
1958 if test $fstype = no; then
1961 #include <sys/statfs.h>
1962 #include <sys/vmount.h>
1964 AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX
1967 if test $fstype = no; then
1972 AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD
1975 if test $fstype = no; then
1976 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
1978 if test $fstype = no; then
1981 #include <sys/mount.h>
1982 #include <sys/fs_types.h>
1984 AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix
1987 AC_MSG_RESULT($fstype)
1989 AC_CHECK_HEADER(sys/statvfs.h, [ AC_DEFINE(HAVE_SYS_STATVFS_H,1,[Defines if your system have the sys/statvfs.h header file])] , )
1991 dnl --------------------------------------------------------------------------
1992 dnl CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
1993 dnl --------------------------------------------------------------------------
2003 AC_CHECK_TYPE(ino_t, unsigned long)
2004 AC_CHECK_TYPE(dev_t, unsigned long)
2005 AC_CHECK_TYPE(daddr_t, long)
2006 AC_CHECK_TYPE(major_t, int)
2007 AC_CHECK_TYPE(minor_t, int)
2008 AC_CHECK_TYPE(ssize_t, int)
2014 AC_CHECK_SIZEOF(char, 1)
2015 AC_CHECK_SIZEOF(short int, 2)
2016 AC_CHECK_SIZEOF(int, 4)
2017 AC_CHECK_SIZEOF(long int, 4)
2018 AC_CHECK_SIZEOF(long long int, 8)
2019 AC_CHECK_SIZEOF(int *, 4)
2021 dnl Check for sys/types.h types
2022 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int,
2026 #include <sys/types.h>
2030 ac_cv_have_u_int="yes"
2032 ac_cv_have_u_int="no"
2037 if test "x$ac_cv_have_u_int" = "xyes" ; then
2038 AC_DEFINE(HAVE_U_INT)
2042 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t,
2046 #include <sys/types.h>
2050 ac_cv_have_intmax_t="yes"
2058 ac_cv_have_intmax_t="yes"
2060 ac_cv_have_intmax_t="no"
2067 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
2068 AC_DEFINE(HAVE_INTMAX_T)
2072 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t,
2076 #include <sys/types.h>
2078 u_intmax_t a; a = 1;
2080 ac_cv_have_u_intmax_t="yes"
2086 u_intmax_t a; a = 1;
2088 ac_cv_have_u_intmax_t="yes"
2090 ac_cv_have_u_intmax_t="no"
2097 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
2098 AC_DEFINE(HAVE_U_INTMAX_T)
2102 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t,
2106 #include <sys/types.h>
2108 int8_t a; int16_t b; int32_t c; a = b = c = 1;
2110 ac_cv_have_intxx_t="yes"
2112 ac_cv_have_intxx_t="no"
2117 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
2118 AC_DEFINE(HAVE_INTXX_T)
2122 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t,
2126 #include <sys/types.h>
2130 ac_cv_have_int64_t="yes"
2132 ac_cv_have_int64_t="no"
2137 if test "x$ac_cv_have_int64_t" = "xyes" ; then
2138 AC_DEFINE(HAVE_INT64_T)
2142 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t,
2146 #include <sys/types.h>
2148 u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;
2150 ac_cv_have_u_intxx_t="yes"
2152 ac_cv_have_u_intxx_t="no"
2157 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
2158 AC_DEFINE(HAVE_U_INTXX_T)
2162 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t,
2166 #include <sys/types.h>
2170 ac_cv_have_u_int64_t="yes"
2172 ac_cv_have_u_int64_t="no"
2177 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
2178 AC_DEFINE(HAVE_U_INT64_T)
2182 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
2183 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2185 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
2188 #include <sys/bitypes.h>
2190 int8_t a; int16_t b; int32_t c;
2191 u_int8_t e; u_int16_t f; u_int32_t g;
2192 a = b = c = e = f = g = 1;
2194 AC_DEFINE(HAVE_U_INTXX_T)
2195 AC_DEFINE(HAVE_INTXX_T)
2196 AC_DEFINE(HAVE_SYS_BITYPES_H)
2204 if test -z "$have_u_intxx_t" ; then
2205 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t,
2209 #include <sys/types.h>
2211 uint8_t a; uint16_t b;
2212 uint32_t c; a = b = c = 1;
2214 ac_cv_have_uintxx_t="yes"
2216 ac_cv_have_uintxx_t="no"
2221 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
2222 AC_DEFINE(HAVE_UINTXX_T)
2226 if (test -z "$have_u_int64_t" || test -z "$have_int64_t" && \
2227 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2229 AC_MSG_CHECKING([for int64_t and u_int64_t types in sys/bitypes.h])
2232 #include <sys/bitypes.h>
2234 int64_t a; u_int64_t b;
2237 AC_DEFINE(HAVE_U_INT64_T)
2238 AC_DEFINE(HAVE_INT64_T)
2246 if (test -z "$have_uintxx_t" && \
2247 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2249 AC_MSG_CHECKING([for uintXX_t types in sys/bitypes.h])
2252 #include <sys/bitypes.h>
2254 uint8_t a; uint16_t b;
2255 uint32_t c; a = b = c = 1;
2257 AC_DEFINE(HAVE_UINTXX_T)
2265 dnl --------------------------------------------------------------------------
2266 dnl CHECKING FOR REQUIRED LIBRARY FUNCTIONS
2267 dnl --------------------------------------------------------------------------
2283 [echo 'configure: cannot find needed function.'; exit 1]
2286 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
2287 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
2288 AC_CHECK_FUNCS(posix_fadvise)
2289 AC_CHECK_FUNCS(fdatasync)
2291 AC_CHECK_FUNCS(chflags)
2293 AC_CHECK_FUNCS(snprintf vsnprintf gethostid fseeko)
2295 AC_CACHE_CHECK(for va_copy, ba_cv_va_copy,
2300 void use_va_copy(va_list args){va_list args2; va_copy(args2,args); va_end(args2);}
2301 void call_use_va_copy(int junk,...){va_list args; va_start(args,junk); use_va_copy(args); va_end(args);}
2303 call_use_va_copy(1,2,3)
2312 test $ba_cv_va_copy = yes && AC_DEFINE(HAVE_VA_COPY, 1, [Set if va_copy exists])
2314 dnl --------------------------------------------------------------------------
2315 dnl CHECKING FOR THREAD SAFE FUNCTIONS
2316 dnl --------------------------------------------------------------------------
2317 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
2319 # If resolver functions are not in libc check for -lnsl or -lresolv.
2320 AC_CHECK_FUNC(gethostbyname_r,
2321 AC_MSG_RESULT(using libc's resolver),
2322 AC_CHECK_LIB(nsl,gethostbyname_r)
2323 AC_CHECK_LIB(resolv,gethostbyname_r))
2325 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
2326 AC_CHECK_FUNCS(inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)])
2327 AC_CHECK_FUNCS(gethostbyname2, [AC_DEFINE(HAVE_GETHOSTBYNAME2)])
2329 dnl ----------------------------
2330 dnl check sa_len of sockaddr
2331 dnl ----------------------------
2332 AC_CACHE_CHECK(for struct sockaddr has a sa_len field, ac_cv_struct_sockaddr_sa_len,
2336 #include <sys/socket.h>
2338 struct sockaddr s; s.sa_len;
2340 ac_cv_struct_sockaddr_sa_len=yes
2341 ], [ac_cv_struct_sockaddr_sa_len=no
2347 if test $ac_cv_struct_sockaddr_sa_len = yes; then
2348 AC_DEFINE(HAVE_SA_LEN, 1, [Define if sa_len field exists in struct sockaddr])
2355 AC_FUNC_CLOSEDIR_VOID
2356 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
2357 # AC_FUNC_FNMATCH dnl use local version
2359 AC_CHECK_LIB(intl, gettext, [LIBS="$LIBS -lintl"])
2361 AC_CHECK_LIB(sun, getpwnam)
2363 AC_CHECK_HEADERS(zlib.h)
2364 AC_CHECK_LIB(z, deflate, [FDLIBS="-lz"])
2366 if test x$FDLIBS = x-lz; then
2367 AC_DEFINE(HAVE_LIBZ)
2372 dnl Check for ACL support and libraries
2376 AC_HELP_STRING([--disable-acl], [disable acl support @<:@default=auto@:>@]),
2378 if test x$enableval = xyes; then
2380 elif test x$enableval = xno; then
2387 have_extended_acl=no
2388 if test x$support_acl = xyes -o x$support_acl = xauto; then
2389 AC_CHECK_HEADER(sys/acl.h, [ AC_DEFINE(HAVE_SYS_ACL_H,1,[Defines if your system have the sys/acl.h header file])] , )
2390 AC_CHECK_FUNC(acl_get_file,
2394 AC_CHECK_LIB(acl, acl_get_file,
2397 FDLIBS="-lacl $FDLIBS"
2399 AC_CHECK_LIB(pacl, acl_get_file,
2402 FDLIBS="-lpacl $FDLIBS"
2404 AC_CHECK_LIB(sec, acltotext,
2407 FDLIBS="-lsec $FDLIBS"
2409 AC_CHECK_LIB(sec, acl_totext,
2411 have_extended_acl=yes
2423 if test x$support_acl = xyes -a $have_acl != yes; then
2424 AC_MSG_ERROR([acl support explicitly enabled but no supported acl implementation found,
2425 please either load the acl libraries or rerun configure without --enable-acl])
2427 if test $have_acl = yes; then
2428 AC_DEFINE([HAVE_ACL],1,[Normal acl support])
2431 if test $have_extended_acl = yes; then
2432 AC_DEFINE([HAVE_EXTENDED_ACL],1,[Extended acl support])
2438 dnl Check for XATTR support
2441 AC_ARG_ENABLE(xattr,
2442 AC_HELP_STRING([--disable-xattr], [disable xattr support @<:@default=auto@:>@]),
2444 if test x$enableval = xyes; then
2446 elif test x$enableval = xno; then
2453 if test x$support_xattr = xyes -o x$support_xattr = xauto; then
2455 dnl First check for *BSD support
2457 AC_CHECK_HEADER(sys/extattr.h, [ AC_DEFINE(HAVE_SYS_EXTATTR_H,1,[Defines if your system have the sys/extattr.h header file])] , )
2458 AC_CHECK_HEADER(libutil.h, [ AC_DEFINE(HAVE_LIBUTIL_H,1,[Defines if your system have the libutil.h header file])] , )
2459 AC_CHECK_FUNCS(extattr_get_link extattr_set_link extattr_list_link,
2462 AC_DEFINE([HAVE_EXTATTR_GET_LINK],1,[Define to 1 if you have the 'extattr_get_link' function.])
2463 AC_DEFINE([HAVE_EXTATTR_SET_LINK],1,[Define to 1 if you have the 'extattr_set_link' function.])
2464 AC_DEFINE([HAVE_EXTATTR_LIST_LINK],1,[Define to 1 if you have the 'extattr_list_link' function.])
2468 if test $have_xattr = no; then
2469 AC_CHECK_FUNCS(extattr_get_file extattr_set_file extattr_list_file,
2472 AC_DEFINE([HAVE_EXTATTR_GET_FILE],1,[Define to 1 if you have the 'extattr_get_file' function.])
2473 AC_DEFINE([HAVE_EXTATTR_SET_FILE],1,[Define to 1 if you have the 'extattr_set_file' function.])
2474 AC_DEFINE([HAVE_EXTATTR_LIST_FILE],1,[Define to 1 if you have the 'extattr_list_file' function.])
2479 if test $have_xattr = yes; then
2480 have_extattr_string_in_libc=no
2481 AC_CHECK_FUNCS(extattr_namespace_to_string extattr_string_to_namespace,
2483 have_extattr_string_in_libc=yes
2484 AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2485 AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2490 dnl If extattr_namespace_to_string and extattr_string_to_namespace are not in libc see if they are in libutil
2492 if test $have_extattr_string_in_libc = no; then
2493 AC_CHECK_LIB(util, extattr_namespace_to_string extattr_string_to_namespace,
2495 AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2496 AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2497 FDLIBS="-lutil $FDLIBS"
2504 dnl If we failed to find *BSD support try the Linux or OSX implementation of xattr
2506 if test $have_xattr = no; then
2507 AC_CHECK_HEADER(sys/xattr.h, [ AC_DEFINE(HAVE_SYS_XATTR_H,1,[Defines if your system have the sys/xattr.h header file])] , )
2508 AC_CHECK_FUNCS(llistxattr lgetxattr lsetxattr,
2511 AC_DEFINE([HAVE_LLISTXATTR],1,[Define to 1 if you have the 'llistxattr' function.])
2512 AC_DEFINE([HAVE_LGETXATTR],1,[Define to 1 if you have the 'lgetxattr' function.])
2513 AC_DEFINE([HAVE_LSETXATTR],1,[Define to 1 if you have the 'lsetxattr' function.])
2517 if test $have_xattr = no; then
2518 AC_CHECK_FUNCS(listxattr getxattr setxattr,
2521 AC_DEFINE([HAVE_LISTXATTR],1,[Define to 1 if you have the 'listxattr' function.])
2522 AC_DEFINE([HAVE_GETXATTR],1,[Define to 1 if you have the 'getxattr' function.])
2523 AC_DEFINE([HAVE_SETXATTR],1,[Define to 1 if you have the 'setxattr' function.])
2530 dnl If we failed to find *BSD support and the Linux or OSX implementation of xattr try the Solaris xattr implementation
2532 if test $have_xattr = no; then
2533 AC_CHECK_HEADER(sys/attr.h, [ AC_DEFINE(HAVE_SYS_ATTR_H,1,[Defines if your system have the sys/attr.h header file])] , )
2534 AC_CHECK_HEADER(sys/nvpair.h, [ AC_DEFINE(HAVE_SYS_NVPAIR_H,1,[Defines if your system have the sys/nvpair.h header file])] , )
2535 AC_CHECK_HEADER(attr.h, [ AC_DEFINE(HAVE_ATTR_H,1,[Defines if your system have the attr.h header file])] , )
2537 AC_CHECK_FUNCS(openat fstatat unlinkat fchownat futimesat,
2540 AC_DEFINE([HAVE_OPENAT],1,[Define to 1 if you have the 'openat' function.])
2541 AC_DEFINE([HAVE_FSTATAT],1,[Define to 1 if you have the 'fstatat' function.])
2542 AC_DEFINE([HAVE_UNLINKAT],1,[Define to 1 if you have the 'unlinkat' function.])
2543 AC_DEFINE([HAVE_FCHOWNAT],1,[Define to 1 if you have the 'fchownat' function.])
2544 AC_DEFINE([HAVE_FUTIMESAT],1,[Define to 1 if you have the 'futimesat' function.])
2548 if test $have_xattr = yes; then
2549 AC_CHECK_LIB(nvpair, nvlist_next_nvpair,
2551 AC_DEFINE([HAVE_NVLIST_NEXT_NVPAIR],1,[Define to 1 if you have the 'nvlist_next_nvpair' function.])
2552 FDLIBS="-lnvpair $FDLIBS"
2558 if test x$support_xattr = xyes -a $have_xattr != yes; then
2559 AC_MSG_ERROR([xattr support explicitly enabled but no supported xattr implementation found,
2560 please either load the xattr libraries or rerun configure without --enable-xattr])
2562 if test $have_xattr = yes; then
2563 AC_DEFINE([HAVE_XATTR],1,[Extended Attributes support])
2569 dnl Check for pthread libraries
2572 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
2574 AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
2576 AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
2578 AC_CHECK_FUNC(pthread_create)
2587 dnl Check for headers, functions and libraries required to support
2588 dnl keeping readall capabilities
2590 AC_CHECK_HEADERS(sys/prctl.h sys/capability.h)
2591 AC_CHECK_FUNCS(prctl setreuid)
2592 AC_CHECK_LIB([cap], [cap_set_proc], [CAP_LIBS="-lcap"], [CAP_LIBS=])
2593 if test x$CAP_LIBS = x-lcap; then
2594 AC_DEFINE(HAVE_LIBCAP, 1, [Define if you have libcap])
2603 if test x$have_gcc = xyes ; then
2604 CPPFLAGS="$CPPFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
2605 CFLAGS="$CFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
2607 LDFLAGS=${LDFLAGS--O}
2608 DB_LIBS="${SQL_LFLAGS}"
2609 CPPFLAGS="$CPPFLAGS"
2622 AC_SUBST(X_EXTRA_LIBS)
2627 dnl extra configurable objects
2638 dnl Finally we set appropriate distribution specific
2639 dnl variables and defaults
2641 dnl PFILES are platform specific files
2642 PFILES="platforms/Makefile"
2647 hostname=`uname -n | cut -d '.' -f 1`
2648 if test x${hostname} = x ; then
2649 hostname="localhost"
2651 dnl Make sure hostname is resolved
2652 ping -c 1 $hostname 2>/dev/null 1>/dev/null
2653 if test ! $? = 0; then
2654 hostname="localhost"
2660 PSCMD="ps -e -o pid,comm"
2662 platforms/aix/Makefile"
2663 TAPEDRIVE="/dev/rmt0.1"
2667 PTHREAD_LIB="-lpthread -lexc"
2668 if test "${CC}" = "gcc" ; then
2675 TAPEDRIVE="/dev/nrmt0"
2678 DISTVER=`uname -a |awk '{print $3}'`
2679 TAPEDRIVE="/dev/nrmt0"
2680 PTHREAD_LIB="-pthread"
2681 CFLAGS="${CFLAGS} -pthread"
2682 PSCMD="ps -ax -o pid,command"
2686 platforms/bsdi/Makefile \
2687 platforms/bsdi/bacula-fd \
2688 platforms/bsdi/bacula-sd \
2689 platforms/bsdi/bacula-dir"
2690 largefile_support="yes"
2693 DISTVER=`uname -a |awk '{print $3}'`
2694 TAPEDRIVE="/dev/nrst0"
2697 WLDFLAGS="-mwindows"
2701 TAPEDRIVE="/dev/nst0"
2702 PSCMD="ps -e -o pid,command"
2705 platforms/darwin/Makefile"
2709 TAPEDRIVE="/dev/nst0"
2710 PSCMD="ps -e -o pid,command"
2713 platforms/osx/Makefile"
2716 if `test -f /etc/apt/sources.list && grep -q ubuntu /etc/apt/sources.list`; then
2719 DISTVER=`cat /etc/debian_version`
2720 if test -f /etc/lsb-release ; then
2722 if test "x$DISTRIB_ID" != "x" ; then
2723 DISTNAME=$DISTRIB_ID
2725 if test "x$DISTRIB_RELEASE" != "x" ; then
2726 DISTVER=$DISTRIB_RELEASE
2729 if test "$DISTNAME" = "Ubuntu" ; then
2732 TAPEDRIVE="/dev/nst0"
2733 PSCMD="ps -e -o pid,command"
2734 if test "$DISTNAME" = "ubuntu" ; then
2736 platforms/ubuntu/Makefile \
2737 platforms/ubuntu/bacula-fd \
2738 platforms/ubuntu/bacula-sd \
2739 platforms/ubuntu/bacula-dir"
2742 platforms/debian/Makefile \
2743 platforms/debian/bacula-fd \
2744 platforms/debian/bacula-sd \
2745 platforms/debian/bacula-dir"
2749 DISTVER=`uname -a |awk '{print $3}'`
2750 VER=`echo $DISTVER | cut -c 1`
2751 if test x$VER = x4 ; then
2752 PTHREAD_LIB="${PTHREAD_LIBS:--pthread}"
2753 CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS:--pthread}"
2757 TAPEDRIVE="/dev/nrsa0"
2758 PSCMD="ps -ax -o pid,command"
2760 platforms/freebsd/Makefile \
2761 platforms/freebsd/bacula-fd \
2762 platforms/freebsd/bacula-sd \
2763 platforms/freebsd/bacula-dir"
2764 largefile_support="yes"
2767 PSCMD="UNIX95=1; ps -e -o pid,comm"
2768 CFLAGS="${CFLAGS} -D_XOPEN_SOURCE_EXTENDED=1"
2770 TAPEDRIVE="/dev/rmt/0hnb"
2771 PTHREAD_LIB="-lpthread"
2772 AC_DEFINE([_INCLUDE_LONGLONG])
2776 TAPEDRIVE="/dev/rmt/0cbn"
2777 PSCMD="ps -e -o pid,comm"
2779 platforms/irix/Makefile \
2780 platforms/irix/bacula-fd \
2781 platforms/irix/bacula-sd \
2782 platforms/irix/bacula-dir"
2785 DISTVER=`uname -a |awk '{print $3}'`
2788 TAPEDRIVE="/dev/nrst0"
2789 PSCMD="ps -ax -o pid,command"
2790 PTHREAD_LIB="-pthread"
2791 CFLAGS="${CFLAGS} -pthread"
2794 DISTVER=`uname -a |awk '{print $3}'`
2797 TAPEDRIVE="/dev/nrst0"
2798 PSCMD="ps -ax -o pid,command"
2799 PTHREAD_LIB="-pthread"
2800 CFLAGS="${CFLAGS} -pthread"
2802 platforms/openbsd/Makefile \
2803 platforms/openbsd/bacula-fd \
2804 platforms/openbsd/bacula-sd \
2805 platforms/openbsd/bacula-dir"
2808 if test -f /etc/whitebox-release ; then
2809 f=/etc/whitebox-release
2811 f=/etc/redhat-release
2813 if test `cat $f | grep release |\
2814 cut -f 3 -d ' '`x = "Enterprise"x ; then
2815 DISTVER="Enterprise "`cat $f | grep release |\
2818 DISTVER=`cat /etc/redhat-release | grep release |\
2821 TAPEDRIVE="/dev/nst0"
2822 PSCMD="ps -e -o pid,command"
2824 platforms/redhat/Makefile \
2825 platforms/redhat/bacula-fd \
2826 platforms/redhat/bacula-sd \
2827 platforms/redhat/bacula-dir
2831 DISTVER=`cat /etc/mandrake-release | grep release |\
2833 TAPEDRIVE="/dev/nst0"
2834 PSCMD="ps -e -o pid,command"
2836 platforms/mandrake/Makefile \
2837 platforms/mandrake/bacula-fd \
2838 platforms/mandrake/bacula-sd \
2839 platforms/mandrake/bacula-dir \
2840 platforms/mandrake/bacula.spec \
2844 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
2845 TAPEDRIVE="/dev/nst0"
2846 PSCMD="ps -e -o pid,command"
2848 platforms/gentoo/Makefile \
2849 platforms/gentoo/bacula-init \
2850 platforms/gentoo/bacula-fd \
2851 platforms/gentoo/bacula-sd \
2852 platforms/gentoo/bacula-dir"
2855 DISTVER=`cat /etc/slackware-version`
2856 TAPEDRIVE="/dev/nst0"
2857 PSCMD="ps -e -o pid,command"
2859 platforms/slackware/Makefile \
2860 platforms/slackware/rc.bacula-fd \
2861 platforms/slackware/rc.bacula-sd \
2862 platforms/slackware/rc.bacula-dir\
2863 platforms/slackware/functions.bacula"
2867 TAPEDRIVE="/dev/rmt/0cbn"
2868 PSCMD="ps -e -o pid,comm"
2870 platforms/solaris/Makefile \
2871 platforms/solaris/bacula-fd \
2872 platforms/solaris/bacula-sd \
2873 platforms/solaris/bacula-dir"
2874 if test x$DISTVER = x5.6 ; then
2875 AC_DEFINE(HAVE_OLD_SOCKOPT)
2877 LIBS="$LIBS -lresolv"
2880 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
2882 TAPEDRIVE="/dev/nst0"
2883 PSCMD="ps -e -o pid,command"
2885 platforms/suse/Makefile \
2886 platforms/suse/bacula-fd \
2887 platforms/suse/bacula-sd \
2888 platforms/suse/bacula-dir \
2889 platforms/suse/bacula \
2890 platforms/suse/bacula.spec"
2895 TAPEDRIVE="/dev/nst0"
2896 PSCMD="ps -e -o pid,command"
2898 platforms/suse/Makefile \
2899 platforms/suse/bacula-fd \
2900 platforms/suse/bacula-sd \
2901 platforms/suse/bacula-dir"
2905 TAPEDRIVE="/dev/nst0"
2908 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
2914 LIBS="$PTHREAD_LIB $LIBS"
2916 AC_DEFINE_UNQUOTED(lld, "$lld")
2917 AC_DEFINE_UNQUOTED(llu, "$llu")
2925 dnl common parts of the Makefile
2926 MCOMMON=./autoconf/Make.common
2927 AC_SUBST_FILE(MCOMMON)
2930 if test "x${subsysdir}" = "x${sbindir}" ; then
2933 echo "You have set both --sbindir and --with-subsys-dir"
2934 echo " equal to: ${subsysdir} "
2935 echo "This is not permitted. Please reconfigure."
2937 echo "Aborting configuration ..."
2943 AC_OUTPUT([autoconf/Make.common \
2946 scripts/startmysql \
2948 scripts/btraceback \
2954 scripts/bacula-ctl-dir \
2955 scripts/bacula-ctl-fd \
2956 scripts/bacula-ctl-sd \
2957 scripts/devel_bacula \
2960 scripts/bacula.desktop.gnome1 \
2961 scripts/bacula.desktop.gnome2 \
2962 scripts/bacula.desktop.gnome1.consolehelper \
2963 scripts/bacula.desktop.gnome2.consolehelper \
2964 scripts/bacula.desktop.gnome1.xsu \
2965 scripts/bacula.desktop.gnome2.xsu \
2966 scripts/bgnome-console.console_apps \
2967 scripts/mtx-changer \
2968 scripts/disk-changer \
2969 scripts/dvd-handler \
2970 scripts/dvd-simulator \
2971 scripts/bacula-tray-monitor.desktop \
2972 scripts/logwatch/Makefile \
2973 scripts/logwatch/logfile.bacula.conf \
2974 scripts/wxconsole.console_apps \
2975 scripts/wxconsole.desktop.consolehelper \
2976 scripts/wxconsole.desktop.xsu \
2977 scripts/bat.desktop \
2978 scripts/bat.desktop.xsu \
2979 scripts/bat.desktop.consolehelper \
2980 scripts/bat.console_apps \
2981 scripts/make_catalog_backup.pl \
2984 src/console/Makefile \
2985 src/console/bconsole.conf \
2986 src/qt-console/bat.conf \
2987 src/qt-console/bat.pro \
2988 src/qt-console/bat.pro.mingw32 \
2989 src/qt-console/install_conf_file \
2990 src/wx-console/Makefile \
2991 src/wx-console/bwx-console.conf \
2992 src/tray-monitor/Makefile \
2993 src/tray-monitor/tray-monitor.conf \
2995 src/dird/bacula-dir.conf \
2997 src/stored/Makefile \
2998 src/stored/bacula-sd.conf \
2999 src/filed/Makefile \
3000 src/filed/bacula-fd.conf \
3002 src/cats/make_catalog_backup \
3003 src/cats/delete_catalog_backup \
3004 src/cats/create_postgresql_database \
3005 src/cats/update_postgresql_tables \
3006 src/cats/make_postgresql_tables \
3007 src/cats/grant_postgresql_privileges \
3008 src/cats/drop_postgresql_tables \
3009 src/cats/drop_postgresql_database \
3010 src/cats/create_mysql_database \
3011 src/cats/update_mysql_tables \
3012 src/cats/make_mysql_tables \
3013 src/cats/grant_mysql_privileges \
3014 src/cats/drop_mysql_tables \
3015 src/cats/drop_mysql_database \
3016 src/cats/create_sqlite3_database \
3017 src/cats/update_sqlite3_tables \
3018 src/cats/make_sqlite3_tables \
3019 src/cats/grant_sqlite3_privileges \
3020 src/cats/drop_sqlite3_tables \
3021 src/cats/drop_sqlite3_database \
3022 src/cats/create_ingres_database \
3023 src/cats/update_ingres_tables \
3024 src/cats/make_ingres_tables \
3025 src/cats/grant_ingres_privileges \
3026 src/cats/drop_ingres_tables \
3027 src/cats/drop_ingres_database \
3030 src/cats/create_bdb_database \
3031 src/cats/update_bdb_tables \
3032 src/cats/make_bdb_tables \
3033 src/cats/grant_bdb_privileges \
3034 src/cats/drop_bdb_tables \
3035 src/cats/drop_bdb_database \
3036 src/cats/create_bacula_database \
3037 src/cats/update_bacula_tables \
3038 src/cats/grant_bacula_privileges \
3039 src/cats/make_bacula_tables \
3040 src/cats/drop_bacula_tables \
3041 src/cats/drop_bacula_database \
3042 src/findlib/Makefile \
3043 src/tools/Makefile \
3044 src/plugins/fd/Makefile \
3045 src/plugins/sd/Makefile \
3046 src/plugins/dir/Makefile \
3047 src/win32/Makefile.inc \
3049 updatedb/update_mysql_tables_9_to_10 \
3050 updatedb/update_sqlite3_tables_9_to_10 \
3051 updatedb/update_postgresql_tables_9_to_10 \
3052 updatedb/update_mysql_tables_10_to_11 \
3053 updatedb/update_sqlite3_tables_10_to_11 \
3054 updatedb/update_postgresql_tables_10_to_11 \
3055 examples/nagios/check_bacula/Makefile \
3060 if test "${support_bat}" = "yes" ; then
3061 if test "x$QMAKE" = "xnone" && test "x$QMAKEQT4" = "xnone"; then
3062 AC_MSG_ERROR([Could not find qmake or qmake-qt4 in $PATH. Check your Qt installation])
3067 if test "x$QMAKEQT4" != "xnone"; then
3072 echo "Creating bat Makefile"
3081 dnl if CC is gcc, we can rebuild the dependencies (since the depend rule
3082 dnl requires gcc). If it's not, don't rebuild dependencies
3084 if test X"$GCC" = "Xyes" ; then
3085 echo "Doing make of dependencies"
3086 ${MAKE:-make} depend
3090 chmod 755 install_conf_file build-depkgs-qt-console
3094 chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
3095 chmod 755 dvd-handler dvd-simulator make_catalog_backup.pl
3096 chmod 755 bconsole gconsole mtx-changer devel_bacula logrotate
3100 chmod 755 $c/update_mysql_tables_10_to_11 $c/update_sqlite3_tables_10_to_11
3101 chmod 755 $c/update_postgresql_tables_10_to_11
3105 chmod 755 $c/create_bacula_database $c/update_bacula_tables $c/make_bacula_tables
3106 chmod 755 $c/grant_bacula_privileges $c/drop_bacula_tables $c/drop_bacula_database
3108 chmod 755 $c/create_bdb_database $c/update_bdb_tables $c/make_bdb_tables
3109 chmod 755 $c/grant_bdb_privileges $c/drop_bdb_tables $c/drop_bdb_database
3111 chmod 755 $c/create_mysql_database $c/update_mysql_tables $c/make_mysql_tables
3112 chmod 755 $c/grant_mysql_privileges $c/drop_mysql_tables $c/drop_mysql_database
3114 chmod 755 $c/create_sqlite3_database $c/update_sqlite3_tables $c/make_sqlite3_tables
3115 chmod 755 $c/grant_sqlite3_privileges $c/drop_sqlite3_tables $c/drop_sqlite3_database
3117 chmod 755 $c/create_postgresql_database $c/update_postgresql_tables $c/make_postgresql_tables
3118 chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables $c/drop_postgresql_database
3120 chmod 755 $c/create_ingres_database $c/update_ingres_tables $c/make_ingres_tables
3121 chmod 755 $c/grant_ingres_privileges $c/drop_ingres_tables $c/drop_ingres_database
3124 chmod 755 $c/make_catalog_backup $c/delete_catalog_backup
3128 chmod 755 src/win32/build-depkgs-mingw32
3130 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
3131 largefile_support="yes"
3134 dnl Only try to find out the version number of the compiler when we know its some kind of GCC compiler
3135 if test X"$GCC" = "Xyes" ; then
3137 dnl A whole lot of hand springs to get the compiler version.
3138 dnl This is because gcc changed the output in version 3.0
3140 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3141 if test "x${CCVERSION}" = "x" ; then
3142 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3144 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3145 if test x"${CXXVERSION}" = x ; then
3146 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3150 # clean up any old junk
3156 if test "x${db_type}" = "xInternal" ; then
3159 echo "You have not specified either --enable-client-only or one of the"
3160 echo " supported databases: MySQL, PostgreSQL, Ingres, SQLite3 or DBI."
3161 echo " This is not permitted. Please reconfigure."
3163 echo "Aborting the configuration ..."
3170 Configuration on `date`:
3172 Host: ${host}${post_host} -- ${DISTNAME} ${DISTVER}
3173 Bacula version: ${BACULA} ${VERSION} (${DATE})
3174 Source code location: ${srcdir}
3175 Install binaries: ${sbindir}
3176 Install libraries: ${libdir}
3177 Install config files: ${sysconfdir}
3178 Scripts directory: ${scriptdir}
3179 Archive directory: ${archivedir}
3180 Working directory: ${working_dir}
3181 PID directory: ${piddir}
3182 Subsys directory: ${subsysdir}
3183 Man directory: ${mandir}
3184 Data directory: ${datarootdir}
3185 Plugin directory: ${plugindir}
3186 C Compiler: ${CC} ${CCVERSION}
3187 C++ Compiler: ${CXX} ${CXXVERSION}
3188 Compiler flags: ${WCFLAGS} ${CFLAGS}
3189 Linker flags: ${WLDFLAGS} ${LDFLAGS}
3191 Statically Linked Tools: ${support_static_tools}
3192 Statically Linked FD: ${support_static_fd}
3193 Statically Linked SD: ${support_static_sd}
3194 Statically Linked DIR: ${support_static_dir}
3195 Statically Linked CONS: ${support_static_cons}
3196 Database type: ${db_type}
3197 Database port: ${db_port}
3198 Database lib: ${DB_LIBS}
3199 Database name: ${db_name}
3200 Database user: ${db_user}
3202 Job Output Email: ${job_email}
3203 Traceback Email: ${dump_email}
3204 SMTP Host Address: ${smtp_host}
3206 Director Port: ${dir_port}
3207 File daemon Port: ${fd_port}
3208 Storage daemon Port: ${sd_port}
3210 Director User: ${dir_user}
3211 Director Group: ${dir_group}
3212 Storage Daemon User: ${sd_user}
3213 Storage DaemonGroup: ${sd_group}
3214 File Daemon User: ${fd_user}
3215 File Daemon Group: ${fd_group}
3217 SQL binaries Directory ${SQL_BINDIR}
3219 Large file support: $largefile_support
3220 Bacula conio support: ${got_conio} ${CONS_LIBS}
3221 readline support: ${got_readline} ${PRTREADLINE_SRC}
3222 TCP Wrappers support: ${TCPW_MSG} ${WRAPLIBS}
3223 TLS support: ${support_tls}
3224 Encryption support: ${support_crypto}
3225 ZLIB support: ${have_zlib}
3226 enable-smartalloc: ${support_smartalloc}
3227 enable-lockmgr: ${support_lockmgr}
3228 bat support: ${support_bat}
3229 enable-gnome: ${support_gnome} ${gnome_version}
3230 enable-bwx-console: ${support_wx_console} ${wx_version}
3231 enable-tray-monitor: ${support_tray_monitor}
3232 client-only: ${build_client_only}
3233 build-dird: ${build_dird}
3234 build-stored: ${build_stored}
3235 Plugin support: ${have_plugins}
3236 ACL support: ${have_acl}
3237 XATTR support: ${have_xattr}
3238 Python support: ${support_python} ${PYTHON_LIBS}
3239 Batch insert enabled: ${support_batch_insert}
3243 # create a small shell script useful for support with
3244 # configure options and config.out info
3245 cat > scripts/bacula_config << EOF
3248 $ $0 $ac_configure_args
3250 cat config.out >> scripts/bacula_config
3251 echo __EOC__ >> scripts/bacula_config
3252 chmod 755 scripts/bacula_config
3256 # Display a warning message if postgresql client lib is <= 8.1
3257 if test x$DB_TYPE = xpostgresql -a x$ac_cv_lib_pq_PQisthreadsafe != xyes \
3258 -a x$support_batch_insert = xyes
3260 echo "WARNING: Your PostgreSQL client library is too old to detect "
3261 echo " if it was compiled with --enable-thread-safety, consider to"
3262 echo " upgrade it in order to avoid problems with Batch insert mode"