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
331 support_smartalloc=yes
336 support_wx_console=no
337 support_tray_monitor=no
342 support_static_tools=no
345 support_static_dir=no
346 support_static_cons=no
356 dnl --------------------------------------------------------------------------
357 dnl CHECKING COMMAND LINE OPTIONS
358 dnl --------------------------------------------------------------------------
360 dnl -------------------------------------------
361 dnl gnome (default off)
362 dnl -------------------------------------------
364 AC_HELP_STRING([--enable-gnome], [enable build of bgnome-console GUI @<:@default=no@:>@]),
366 if test x$enableval = xyes; then
373 if test x$support_gnome = xyes; then
374 AC_MSG_ERROR(bgnome-console no longer supported)
375 AC_MSG_ERROR(--enable-gnome option no longer supported)
377 # AC_SUBST(GNOME_DIR)
379 dnl -------------------------------------------
380 dnl bat (default off)
381 dnl -------------------------------------------
383 AC_HELP_STRING([--enable-bat], [enable build of bat Qt4 GUI @<:@default=no@:>@]),
385 if test x$enableval = xyes; then
386 AC_DEFINE(HAVE_BAT, 1, [Set if Bacula bat Qt4 GUI support enabled])
393 if test x$support_bat = xyes; then
394 abc=`$PKGCONFIG --atleast-version=4.2 QtGui`
396 if test $pkg = 0; then
397 BAT_DIR=src/qt-console
399 AC_MSG_ERROR(Unable to find Qt4 installation needed by bat)
404 dnl If bat is enabled, we need the qwt library
412 if test x$support_bat = xyes; then
413 AC_MSG_CHECKING(for qwt support)
415 AC_HELP_STRING([--with-qwt@<:@=DIR@:>@], [specify qwt library directory]),
422 if test -f ${with_qwt}/include/qwt.h; then
423 QWT_INC="${with_qwt}/include"
424 QWT_LDFLAGS="-L${with_qwt}/lib"
434 dnl Search in standard places, or --with-qwt not specified
436 if test $no_qwt = no; then
437 if test x$QWT_INC = x; then
438 for root in /usr /usr/local; do
439 for ver in qwt qwt5 qwt-qt4; do
440 if test -f ${root}/include/${ver}/qwt.h; then
441 QWT_INC="${root}/include/${ver}"
442 if test -d ${root}/lib64/; then
443 QWT_LDFLAGS="-L${root}/lib64"
444 elif test -d ${root}/lib/64/; then
445 QWT_LDFLAGS="-L${root}/64"
447 QWT_LDFLAGS="-L${root}/lib"
458 if test x$QWT_INC = x; then
461 AC_DEFINE(HAVE_QWT, 1, [Set if bat QWT library found])
468 AC_SUBST(QWT_LDFLAGS)
472 dnl -------------------------------------------
473 dnl bwx-console (default off)
474 dnl -------------------------------------------
475 AC_ARG_ENABLE(bwx-console,
476 AC_HELP_STRING([--enable-bwx-console], [enable build of wxWidgets console @<:@default=no@:>@]),
478 if test x$enableval = xyes; then
479 support_wx_console=yes
485 if test x$support_wx_console = xyes; then
486 abc=`$WXCONFIG $WXFLAGS --cppflags`
488 if test $pkg = 0; then
489 wx_version="wxWidgets `$WXCONFIG $WXFLAGS --release`"
490 WXCONS_CPPFLAGS=`$WXCONFIG $WXFLAGS --cppflags`
491 WXCONS_LDFLAGS=`$WXCONFIG $WXFLAGS --libs`
493 AC_SUBST(WXCONS_CPPFLAGS)
494 AC_SUBST(WXCONS_LDFLAGS)
495 WX_DIR="src/wx-console"
498 echo "wx-config program not found. bwx-console disabled."
500 support_wx_console=no
505 dnl -------------------------------------------
506 dnl tray-monitor (default off)
507 dnl -------------------------------------------
508 AC_ARG_ENABLE(tray-monitor,
509 AC_HELP_STRING([--enable-tray-monitor], [enable build of Gnome tray monitor (compatible with KDE @<:@default=no@:>@]),
511 if test x$enableval = xyes; then
512 support_tray_monitor=yes
518 if test x$support_tray_monitor = xyes; then
519 abc=`$PKGCONFIG --exists gtk+-2.0`
521 if test $pkg = 0; then
522 TRAY_MONITOR_CPPFLAGS=`$PKGCONFIG --cflags gtk+-2.0`
523 TRAY_MONITOR_LDFLAGS=`$PKGCONFIG --libs gtk+-2.0`
524 AC_SUBST(TRAY_MONITOR_CPPFLAGS)
525 AC_SUBST(TRAY_MONITOR_LDFLAGS)
526 TRAY_MONITOR_DIR=src/tray-monitor
527 abc=`$PKGCONFIG --atleast-version=2.4 gtk+-2.0`
529 if test $pkg = 0; then
530 AC_DEFINE(HAVE_GTK_2_4, 1, [Set if you have GTK 4.2 or greater loaded])
534 AC_SUBST(TRAY_MONITOR_DIR)
536 dnl -------------------------------------------
537 dnl smartalloc (default off)
538 dnl -------------------------------------------
539 AC_ARG_ENABLE(smartalloc,
540 AC_HELP_STRING([--enable-smartalloc], [enable smartalloc debugging support @<:@default=no@:>@]),
542 if test x$enableval = xno; then
543 support_smartalloc=no
548 if test x$support_smartalloc = xyes; then
549 AC_DEFINE(SMARTALLOC, 1, [Set if you want Smartalloc enabled])
552 dnl -------------------------------------------
553 dnl Lock Manager (default off)
554 dnl -------------------------------------------
555 AC_ARG_ENABLE(lockmgr,
556 AC_HELP_STRING([--enable-lockmgr], [enable lock manager support @<:@default=no@:>@]),
558 if test x$enableval = xyes; then
564 if test x$support_lockmgr = xyes; then
565 AC_DEFINE(_USE_LOCKMGR, 1, [Set if you want Lock Manager enabled])
569 dnl -------------------------------------------
570 dnl static-tools (default off)
571 dnl -------------------------------------------
572 AC_ARG_ENABLE(static-tools,
573 AC_HELP_STRING([--enable-static-tools], [enable static tape tools @<:@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_tools=yes
586 if test x$support_static_tools = xyes; then
587 TTOOL_LDFLAGS="-static"
589 AC_SUBST(TTOOL_LDFLAGS)
591 dnl -------------------------------------------
592 dnl static-fd (default off)
593 dnl -------------------------------------------
594 AC_ARG_ENABLE(static-fd,
595 AC_HELP_STRING([--enable-static-fd], [enable static File 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_fd=yes
608 if test x$support_static_fd = xyes; then
609 STATIC_FD="static-bacula-fd"
613 dnl -------------------------------------------
614 dnl static-sd (default off)
615 dnl -------------------------------------------
616 AC_ARG_ENABLE(static-sd,
617 AC_HELP_STRING([--enable-static-sd], [enable static Storage daemon @<:@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_sd=yes
630 if test x$support_static_sd = xyes; then
631 STATIC_SD="static-bacula-sd"
635 dnl -------------------------------------------
636 dnl static-dir (default off)
637 dnl -------------------------------------------
638 AC_ARG_ENABLE(static-dir,
639 AC_HELP_STRING([--enable-static-dir], [enable static Director @<:@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_dir=yes
652 if test x$support_static_dir = xyes; then
653 STATIC_DIR="static-bacula-dir"
657 dnl -------------------------------------------
658 dnl static-cons (default off)
659 dnl -------------------------------------------
660 AC_ARG_ENABLE(static-cons,
661 AC_HELP_STRING([--enable-static-cons], [enable static Console @<:@default=no@:>@]),
663 if test x$enableval = xyes; then
664 if test x$use_libtool = xyes; then
665 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
666 please rerun configure with --disable-libtool])
668 support_static_cons=yes
676 if test x$support_static_cons = xyes; then
677 STATIC_CONS="static-bconsole"
678 STATIC_GNOME_CONS="static-bgnome-console"
679 STATIC_WX_CONS="static-bwx-console"
681 AC_SUBST(STATIC_CONS)
682 AC_SUBST(STATIC_GNOME_CONS)
683 AC_SUBST(STATIC_WX_CONS)
685 dnl -------------------------------------------
686 dnl client_only (default off)
687 dnl -------------------------------------------
688 AC_ARG_ENABLE(client-only,
689 AC_HELP_STRING([--enable-client-only], [build client (File daemon) only @<:@default=no@:>@]),
691 if test x$enableval = xyes; then
692 build_client_only=yes
698 if test x$build_client_only = xno; then
705 dnl -------------------------------------------
706 dnl director (default on)
707 dnl -------------------------------------------
708 AC_ARG_ENABLE(build-dird,
709 AC_HELP_STRING([--enable-build-dird], [enable building of dird (Director) @<:@default=yes@:>@]),
711 if test x$enableval = xno; then
716 if test x$build_dird = xyes; then
721 DIR_TOOLS="NODIRTOOLS"
726 dnl -------------------------------------------
727 dnl stored (default on)
728 dnl -------------------------------------------
729 AC_ARG_ENABLE(build-stored,
730 AC_HELP_STRING([--enable-build-stored], [enable building of stored (Storage daemon) @<:@default=yes@:>@]),
732 if test x$enableval = xno; then
737 if test x$build_stored = xyes; then
738 STORED_DIR="src/stored"
744 dnl ---------------------------------------------------
745 dnl Check for conio (Bacula readline substitute)(
746 dnl ---------------------------------------------------
747 dnl this allows you to turn it completely off
749 AC_HELP_STRING([--disable-conio], [disable conio support @<:@default=no@:>@]),
751 if test x$enableval = xno; then
758 dnl ---------------------------------------------------
759 dnl Check for IPv6 support
760 dnl ---------------------------------------------------
761 dnl this allows you to turn it completely off
764 AC_HELP_STRING([--enable-ipv6], [enable ipv6 support @<:@default=yes@:>@]),
766 if test x$enableval = xno; then
772 if test x$support_ipv6 = xyes; then
773 AC_TRY_LINK([ #include <sys/types.h>
774 #include <sys/socket.h>
775 #include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;],
776 [support_ipv6=yes], [support_ipv6=no])
779 if test x$support_ipv6 = xyes; then
780 AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
784 if test x$support_conio = xyes; then
785 AC_CHECK_HEADER(termcap.h,
786 [ AC_CHECK_LIB(termcap, tgetent,
787 [ CONS_LIBS="-ltermcap"
792 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
794 [ AC_CHECK_LIB(ncurses, tgetent,
795 [ CONS_LIBS="-lncurses"
800 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
805 AC_CHECK_HEADERS(curses.h)
806 AC_CHECK_HEADER(term.h,
807 [ AC_CHECK_LIB(curses, tgetent,
808 [ CONS_LIBS="-lcurses"
813 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
816 [ echo " "; echo "Required libraries not found. CONIO turned off ..."; echo " "],
825 dnl ---------------------------------------------------
826 dnl Check for readline support/directory (default off)
827 dnl ---------------------------------------------------
828 dnl this allows you to turn it completely off
829 AC_ARG_ENABLE(readline,
830 AC_HELP_STRING([--disable-readline], [disable readline support @<:@default=yes@:>@]),
832 if test x$enableval = xno; then
840 if test x$support_readline = xyes; then
841 AC_ARG_WITH(readline,
842 AC_HELP_STRING([--with-readline@<:@=DIR@:>@], [specify readline library directory]),
844 case "$with_readline" in
849 if test -f ${with_readline}/readline.h; then
850 CONS_INC="-I${with_readline}"
851 CONS_LDFLAGS="-L$with_readline"
852 elif test -f ${with_readline}/include/readline/readline.h; then
853 CONS_INC="-I${with_readline}/include/readline"
854 CONS_LDFLAGS="-L${with_readline}/lib"
855 with_readline="${with_readline}/include/readline"
857 with_readline="/usr/include/readline"
860 AC_CHECK_HEADER(${with_readline}/readline.h,
862 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
863 CONS_LIBS="-lreadline -lhistory -ltermcap"
867 echo "readline.h not found. readline turned off ..."
874 dnl check for standard readline library
875 AC_CHECK_HEADER(/usr/include/readline/readline.h,
877 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
879 CONS_INC="-I/usr/include/readline"
880 CONS_LIBS="-lreadline -ltermcap"
882 dnl Did not find standard library, so try Bacula's default
883 AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h,
885 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
887 CONS_INC="-I${TOP_DIR}/depkgs/readline"
888 CONS_LIBS="-lreadline -lhistory -ltermcap"
889 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
890 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
893 echo "readline.h not found. readline turned off ..."
907 AC_SUBST(CONS_LDFLAGS)
908 AC_SUBST(READLINE_SRC)
910 dnl Minimal stuff for readline Makefile configuration
915 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr lstat lchown)
916 AC_CHECK_FUNCS(nanosleep nl_langinfo)
917 AC_CHECK_HEADERS(varargs.h)
919 dnl End of readline/conio stuff
920 dnl -----------------------------------------------------------------------
922 dnl -----------------------------------------------------------------------
923 dnl Check for Python support
925 AC_MSG_CHECKING(for Python support)
927 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.]),
931 if test "$withval" != "no"; then
932 if test "$withval" = "yes"; then
933 if test -e /usr/bin/python-config ; then
934 PYTHON_INCDIR=`/usr/bin/python-config --includes`
935 PYTHON_LIBS=`/usr/bin/python-config --libs`
937 for python_root in /usr /usr/local /usr/sfw; do
938 for ver in python2.2 python2.3 python2.4 python2.5 python2.6 python3; do
939 if test -f $python_root/include/${ver}/Python.h; then
940 PYTHON_INCDIR=-I$python_root/include/${ver}
941 if test -d $python_root/lib64/${ver}/config; then
942 PYTHON_LIBS="-L$python_root/lib64/${ver}/config -l${ver}"
944 PYTHON_LIBS="-L$python_root/lib/${ver}/config -l${ver}"
951 if test x$PYTHON_INCDIR = x; then
952 if test -f $prefix/include/Python.h; then
953 PYTHON_INCDIR=-I$prefix/include
954 if test -d $prefix/lib64/config; then
955 PYTHON_LIBS="-L$prefix/lib64/config -lpython"
957 PYTHON_LIBS="-L$prefix/lib/config -lpython"
961 AC_MSG_ERROR(Unable to find Python.h in standard locations)
966 if test -e $withval/bin/python-config ; then
967 PYTHON_INCDIR=`$withval/bin/python-config --includes`
968 PYTHON_LIBS=`$withval/bin/python-config --libs`
969 elif test -f $withval/Python.h; then
970 PYTHON_INCDIR=-I$withval
971 PYTHON_LIBS="-L$withval/config -lpython"
972 elif test -f $withval/include/Python.h; then
973 PYTHON_INCDIR=-I$withval/include
974 if test -d $withval/lib64/config; then
975 PYTHON_LIBS="-L$withval/lib64/config -lpython"
977 PYTHON_LIBS="-L$withval/lib/config -lpython"
979 elif test -f $withval/include/python/Python.h; then
980 PYTHON_INCDIR=-I$withval/include/python
981 if test -d $withval/lib64/python/config; then
982 PYTHON_LIBS="-L$withval/lib64/python/config -lpython"
984 PYTHON_LIBS="-L$withval/lib/python/config -lpython"
988 AC_MSG_ERROR(Invalid Python directory $withval - unable to find Python.h under $withval)
992 AC_DEFINE([HAVE_PYTHON], 1)
995 AC_MSG_NOTICE(checking for more Python libs)
996 saved_LIBS="$LIBS"; LIBS=
997 AC_SEARCH_LIBS(shm_open, [rt])
998 AC_CHECK_LIB(util, openpty)
999 PYTHON_LIBS="$PYTHON_LIBS $LIBS"
1008 AC_SUBST(PYTHON_LIBS)
1009 AC_SUBST(PYTHON_INCDIR)
1012 dnl Find where sockets are (especially for Solaris)
1013 dnl Do this before the TCP Wrappers test since tcp wrappers
1014 dnl uses the socket library and some linkers are stupid.
1016 AC_CHECK_FUNC(socket,
1017 AC_MSG_RESULT(using libc's socket),
1018 AC_CHECK_LIB(xnet,socket)
1019 AC_CHECK_LIB(socket,socket)
1020 AC_CHECK_LIB(inet,socket))
1022 dnl -----------------------------------------------------------
1023 dnl Check whether user wants TCP wrappers support (default off)
1024 dnl -----------------------------------------------------------
1027 AC_ARG_WITH(tcp-wrappers,
1028 AC_HELP_STRING([--with-tcp-wrappers@<:@=DIR@:>@], [enable tcpwrappers support]),
1030 if test "x$withval" != "xno" ; then
1032 LIBS="$saved_LIBS -lwrap"
1033 AC_SEARCH_LIBS(nanosleep, [rt])
1034 AC_MSG_CHECKING(for libwrap)
1037 #include <sys/types.h>
1039 int deny_severity = 0;
1040 int allow_severity = 0;
1041 struct request_info *req;
1046 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
1051 LIBS="$saved_LIBS -lwrap -lnsl"
1052 WRAPLIBS="$saved_LIBS -lwrap -lnsl"
1055 #include <sys/types.h>
1057 int deny_severity = 0;
1058 int allow_severity = 0;
1059 struct request_info *req;
1064 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
1069 AC_MSG_ERROR([*** libwrap missing])
1078 dnl -----------------------------------------------------------
1079 dnl Check whether OpenSSL is available
1080 dnl -----------------------------------------------------------
1081 AC_MSG_CHECKING([for OpenSSL])
1082 dnl The following uses quadrigraphs:
1085 AC_ARG_WITH(openssl,
1086 AC_HELP_STRING([--with-openssl@<:@=DIR@:>@], [Include OpenSSL support. DIR is the OpenSSL base]),
1088 with_openssl_directory=${withval}
1092 if test "x$with_openssl_directory" != "xno"; then
1093 OPENSSL_LIBS="-lssl -lcrypto"
1096 if test "x$with_openssl_directory" != "xyes" && test x"${with_openssl_directory}" != "x"; then
1098 # Make sure the $with_openssl_directory also makes sense
1100 if test -d "$with_openssl_directory/lib" -a -d "$with_openssl_directory/include"; then
1101 OPENSSL_LIBS="-L$with_openssl_directory/lib $OPENSSL_LIBS"
1102 OPENSSL_INC="-I$with_openssl_directory/include $OPENSSL_INC"
1106 saved_LIBS="${LIBS}"
1107 saved_CFLAGS="${CFLAGS}"
1108 LIBS="${saved_LIBS} ${OPENSSL_LIBS}"
1109 CFLAGS="${saved_CFLAGS} ${OPENSSL_INC}"
1113 #include <openssl/ssl.h>
1115 CRYPTO_set_id_callback(NULL);
1118 support_crypto="yes"
1126 #include <openssl/evp.h>
1130 ac_cv_openssl_sha2="yes"
1132 ac_cv_openssl_sha2="no"
1136 dnl Solaris disables greater than 128+ bit encryption in their OpenSSL
1137 dnl implementation, presumably for export reasons. If 192bit AES
1138 dnl is available, we assume that we're running with a 'non-export'
1139 dnl openssl library.
1142 #include <openssl/evp.h>
1146 ac_cv_openssl_export="no"
1148 ac_cv_openssl_export="yes"
1152 LIBS="${saved_LIBS}"
1153 CFLAGS="${saved_CFLAGS}"
1155 if test "$support_tls" = "yes"; then
1156 AC_DEFINE(HAVE_OPENSSL, 1, [Define if OpenSSL library is available])
1157 AC_DEFINE(HAVE_TLS, 1, [Define if TLS support should be enabled])
1158 AC_DEFINE(HAVE_CRYPTO, 1, [Define if encryption support should be enabled])
1161 if test "$ac_cv_openssl_sha2" = "yes"; then
1162 AC_DEFINE(HAVE_SHA2, 1, [Define if the SHA-2 family of digest algorithms is available])
1165 if test "$ac_cv_openssl_export" = "yes"; then
1166 AC_DEFINE(HAVE_OPENSSL_EXPORT_LIBRARY, 1, [Define if the OpenSSL library is export-contrained to 128bit ciphers])
1175 if test "$support_tls" = "no"; then
1180 AC_MSG_RESULT([$support_tls])
1181 AC_SUBST(OPENSSL_LIBS)
1182 AC_SUBST(OPENSSL_INC)
1184 dnl -----------------------------------------------------------
1185 dnl dlopen is needed for plugins
1186 dnl -----------------------------------------------------------
1187 AC_SEARCH_LIBS(dlopen, [dl])
1189 dnl ------------------------------------------
1190 dnl Where to place working dir
1191 dnl ------------------------------------------
1192 working_dir=`eval echo ${prefix}/var/bacula/working`
1193 AC_ARG_WITH(working-dir,
1194 AC_HELP_STRING([--with-working-dir=PATH], [specify path of Bacula working directory]),
1196 if test "x$withval" != "xno" ; then
1197 working_dir=$withval
1202 AC_SUBST(working_dir)
1204 dnl ------------------------------------------------------------------
1205 dnl If the user has not set archivedir, we set our default as /tmp
1206 dnl ------------------------------------------------------------------
1208 AC_ARG_WITH(archivedir,
1209 AC_HELP_STRING([--with-archivedir=PATH], [specify path of SD archive directory]),
1211 if test "x$withval" != "xno" ; then
1217 AC_SUBST(archivedir)
1219 dnl ------------------------------------------------------------------
1220 dnl Allow the user to specify the daemon resource name default hostname
1221 dnl ------------------------------------------------------------------
1223 AC_ARG_WITH(basename,
1224 AC_HELP_STRING([--with-basename=RESNAME], [specify base resource name for daemons]),
1226 if test "x$withval" != "xno" ; then
1234 dnl ------------------------------------------------------------------
1235 dnl Allow the user to override the hostname (default = machine hostname)
1236 dnl ------------------------------------------------------------------
1237 hostname=`uname -n | cut -d '.' -f 1`
1238 if test x${hostname} = x ; then
1239 hostname="localhost"
1241 AC_ARG_WITH(hostname,
1242 AC_HELP_STRING([--with-hostname=RESNAME], [specify host name for daemons]),
1244 if test "x$withval" != "xno" ; then
1253 dnl ------------------------------------------
1254 dnl Where to place scriptdir (script files)
1255 dnl ------------------------------------------
1256 scriptdir=`eval echo ${sysconfdir}`
1257 AC_ARG_WITH(scriptdir,
1258 AC_HELP_STRING([--with-scriptdir=PATH], [specify path of Bacula scripts directory]),
1260 if test "x$withval" != "xno" ; then
1269 dnl ------------------------------------------
1270 dnl Where to place bsrdir (bsr files)
1271 dnl ------------------------------------------
1274 AC_HELP_STRING([--with-bsrdir=PATH], [specify path of Bacula bsrs directory]),
1276 if test "x$withval" != "xno" ; then
1284 dnl ------------------------------------------
1285 dnl Where to place logdir (bsr files)
1286 dnl ------------------------------------------
1289 AC_HELP_STRING([--with-logdir=PATH], [specify path of Bacula logs directory]),
1291 if test "x$withval" != "xno" ; then
1300 # ------------------------------------------
1301 # Where to place plugindir (plugin files)
1302 # ------------------------------------------
1303 plugindir=`eval echo ${libdir}`
1304 AC_ARG_WITH(plugindir,
1305 AC_HELP_STRING([--with-plugindir=PATH], [specify path of Bacula plugins directory]),
1307 if test "x$withval" != "xno" ; then
1315 dnl ------------------------------------------
1316 dnl Where to send dump email
1317 dnl ------------------------------------------
1318 dump_email=root@localhost
1319 AC_ARG_WITH(dump-email,
1320 AC_HELP_STRING([--with-dump-email=EMAIL], [dump email address]),
1322 if test "x$withval" != "xno" ; then
1328 AC_SUBST(dump_email)
1330 dnl ------------------------------------------
1331 dnl Where to send job email
1332 dnl ------------------------------------------
1333 job_email=root@localhost
1334 AC_ARG_WITH(job-email,
1335 AC_HELP_STRING([--with-job-email=EMAIL], [job output email address]),
1337 if test "x$withval" != "xno" ; then
1345 dnl ------------------------------------------
1346 dnl Where to find smtp host
1347 dnl ------------------------------------------
1349 AC_ARG_WITH(smtp_host,
1350 AC_HELP_STRING([--with-smtp-host=HOST], [SMTP mail host address]),
1352 if test "x$withval" != "xno" ; then
1360 dnl ------------------------------------
1361 dnl Where to place pid files
1362 dnl ------------------------------------
1364 AC_ARG_WITH(pid-dir,
1365 AC_HELP_STRING([--with-pid-dir=PATH], [specify location of Bacula pid files]),
1367 if test "x$withval" != "xno" ; then
1373 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
1376 dnl ------------------------------------
1377 dnl Where to place subsys "lock file"
1378 dnl ------------------------------------
1379 subsysdir=/var/run/subsys
1380 if test -d /var/run/subsys; then
1381 subsysdir=/var/run/subsys
1382 elif test -d /var/lock/subsys; then
1383 subsysdir=/var/lock/subsys
1385 subsysdir=/var/run/subsys
1387 AC_ARG_WITH(subsys-dir,
1388 AC_HELP_STRING([--with-subsys-dir=PATH], [specify location of Bacula subsys file]),
1390 if test "x$withval" != "xno" ; then
1398 dnl ------------------------------------
1399 dnl Where to start assigning ports
1400 dnl ------------------------------------
1402 AC_ARG_WITH(baseport,
1403 AC_HELP_STRING([--with-baseport=PORT], [specify base port address for daemons]),
1405 if test "x$withval" != "xno" ; then
1412 dir_port=`expr $baseport`
1413 fd_port=`expr $baseport + 1`
1414 sd_port=`expr $fd_port + 1`
1420 dnl ------------------------------------------
1421 dnl Generate passwords
1422 dnl ------------------------------------------
1424 AC_ARG_WITH(dir-password,
1425 AC_HELP_STRING([--with-dir-password=PASSWORD], [specify Director's password]),
1427 if test "x$withval" != "xno" ; then
1428 dir_password=$withval
1433 if test "x$dir_password" = "x" ; then
1434 if test "x$OPENSSL" = "xnone" ; then
1435 key=`autoconf/randpass 33`
1437 key=`openssl rand -base64 33`
1443 AC_ARG_WITH(fd-password,
1444 AC_HELP_STRING([--with-fd-password=PASSWORD], [specify Client's password]),
1446 if test "x$withval" != "xno" ; then
1447 fd_password=$withval
1452 if test "x$fd_password" = "x" ; then
1453 if test "x$OPENSSL" = "xnone" ; then
1454 key=`autoconf/randpass 37`
1456 key=`openssl rand -base64 33`
1462 AC_ARG_WITH(sd-password,
1463 AC_HELP_STRING([--with-sd-password=PASSWORD], [specify Storage daemon's password]),
1465 if test "x$withval" != "xno" ; then
1466 sd_password=$withval
1471 if test "x$sd_password" = "x" ; then
1472 if test "x$OPENSSL" = "xnone" ; then
1473 key=`autoconf/randpass 41`
1475 key=`openssl rand -base64 33`
1481 AC_ARG_WITH(mon-dir-password,
1482 AC_HELP_STRING([--with-mon-dir-password=PASSWORD], [specify Director's password used by the monitor]),
1484 if test "x$withval" != "xno" ; then
1485 mon_dir_password=$withval
1490 if test "x$mon_dir_password" = "x" ; then
1491 if test "x$OPENSSL" = "xnone" ; then
1492 key=`autoconf/randpass 33`
1494 key=`openssl rand -base64 33`
1496 mon_dir_password=$key
1500 AC_ARG_WITH(mon-fd-password,
1501 AC_HELP_STRING([--with-mon-fd-password=PASSWORD], [specify Client's password used by the monitor]),
1503 if test "x$withval" != "xno" ; then
1504 mon_fd_password=$withval
1509 if test "x$mon_fd_password" = "x" ; then
1510 if test "x$OPENSSL" = "xnone" ; then
1511 key=`autoconf/randpass 37`
1513 key=`openssl rand -base64 33`
1515 mon_fd_password=$key
1519 AC_ARG_WITH(mon-sd-password,
1520 AC_HELP_STRING([--with-mon-sd-password=PASSWORD], [specify Storage daemon's password used by the monitor]),
1522 if test "x$withval" != "xno" ; then
1523 mon_sd_password=$withval
1528 if test "x$mon_sd_password" = "x" ; then
1529 if test "x$OPENSSL" = "xnone" ; then
1530 key=`autoconf/randpass 41`
1532 key=`openssl rand -base64 33`
1534 mon_sd_password=$key
1537 AC_SUBST(dir_password)
1538 AC_SUBST(fd_password)
1539 AC_SUBST(sd_password)
1540 AC_SUBST(mon_dir_password)
1541 AC_SUBST(mon_fd_password)
1542 AC_SUBST(mon_sd_password)
1545 dnl Pickup any database name
1548 AC_ARG_WITH(db_name,
1549 AC_HELP_STRING([--with-db-name=DBNAME], [specify database name @<:@default=bacula@:>@]),
1551 if test "x$withval" != "x" ; then
1559 AC_ARG_WITH(db_user,
1560 AC_HELP_STRING([--with-db-user=UNAME], [specify database user @<:@default=bacula@:>@]),
1562 if test "x$withval" != "x" ; then
1570 AC_ARG_WITH(db_password,
1571 AC_HELP_STRING([--with-db-password=PWD], [specify database password @<:@default=*none*@:>@]),
1573 if test "x$withval" != "x" ; then
1574 db_password=$withval
1578 AC_SUBST(db_password)
1581 dnl Pickup a database port
1584 AC_ARG_WITH(db_port,
1585 AC_HELP_STRING([--with-db-port=DBPORT], [specify a database port @<:@default=null@:>@]),
1587 if test "x$withval" != "x" ; then
1595 # Handle users and groups for each daemon
1598 AC_ARG_WITH(dir_user,
1599 AC_HELP_STRING([--with-dir-user=USER], [specify user for Director daemon]),
1601 if test "x$withval" != "x" ; then
1608 AC_ARG_WITH(dir_group,
1609 AC_HELP_STRING([--with-dir-group=GROUP], [specify group for Director daemon]),
1611 if test "x$withval" != "x" ; then
1618 AC_ARG_WITH(sd_user,
1619 AC_HELP_STRING([--with-sd-user=USER], [specify user for Storage daemon]),
1621 if test "x$withval" != "x" ; then
1628 AC_ARG_WITH(sd_group,
1629 AC_HELP_STRING([--with-sd-group=GROUP], [specify group for Storage daemon]),
1631 if test "x$withval" != "x" ; then
1638 AC_ARG_WITH(fd_user,
1639 AC_HELP_STRING([--with-fd-user=USER], [specify user for File daemon]),
1641 if test "x$withval" != "x" ; then
1648 AC_ARG_WITH(fd_group,
1649 AC_HELP_STRING([--with-fd-group=GROUP], [specify group for File daemon]),
1651 if test "x$withval" != "x" ; then
1665 dnl allow setting default executable permissions
1668 AC_ARG_WITH(sbin-perm,
1669 AC_HELP_STRING([--with-sbin-perm=MODE], [specify permissions for sbin binaries @<:@default=0754@:>@]),
1671 if test "x$withval" != "x" ; then
1679 dnl ------------------------------------------------
1680 dnl Bacula check for various SQL database engines
1681 dnl ------------------------------------------------
1683 BA_CHECK_POSTGRESQL_DB
1689 # BA_CHECK_SQLITE_DB
1698 dnl -------------------------------------------
1699 dnl enable batch attribute DB insert (default on)
1700 dnl -------------------------------------------
1701 support_batch_insert=no
1702 A=`test -f $SQL_LIB && nm $SQL_LIB | grep pthread_mutex_lock`
1704 if test $pkg = 0; then
1705 support_batch_insert=yes
1706 AC_ARG_ENABLE(batch-insert,
1707 AC_HELP_STRING([--enable-batch-insert], [enable the DB batch insert code @<:@default=no@:>@]),
1709 if test x$enableval = xno; then
1710 support_batch_insert=no
1712 support_batch_insert=yes
1718 dnl Check if postgresql can support batch mode
1719 if test x$DB_TYPE = xpostgresql; then
1720 AC_CHECK_LIB(pq, PQisthreadsafe, AC_DEFINE(HAVE_PQISTHREADSAFE, 1, [Set if have PQisthreadsafe]))
1721 AC_CHECK_LIB(pq, PQputCopyData, AC_DEFINE(HAVE_PQ_COPY, 1, [Set if have PQputCopyData]))
1722 if test "x$ac_cv_lib_pq_PQputCopyData" != "xyes"
1724 support_batch_insert=no
1728 if test x$DB_TYPE = xdbi; then
1732 dnl Check for batch insert
1733 if test $DB_PROG = postgresql; then
1734 AC_CHECK_LIB(pq, PQisthreadsafe, AC_DEFINE(HAVE_PQISTHREADSAFE))
1735 AC_CHECK_LIB(pq, PQputCopyData, AC_DEFINE(HAVE_PQ_COPY))
1736 test "x$ac_cv_lib_pq_PQputCopyData" != "xyes"
1740 if test $DB_PROG = mysql; then
1741 A=`test -f $SQL_LIB && nm $DB_PROG_LIB | grep pthread_mutex_lock`
1745 if test $DB_PROG = sqlite3; then
1746 A=`test -f $SQL_LIB && nm $DB_PROG_LIB | grep pthread_mutex_lock`
1750 if test $pkg = 0; then
1751 AC_ARG_ENABLE(batch-insert,
1752 AC_HELP_STRING([--enable-batch-insert], [enable the DB batch insert code @<:@default=no@:>@]),
1754 if test x$enableval = xno; then
1755 support_batch_insert=no
1757 support_batch_insert=yes
1763 dnl If dbi was not chosen, let the comment in file
1767 AC_SUBST(uncomment_dbi)
1769 if test $support_batch_insert = yes ; then
1770 AC_DEFINE(HAVE_BATCH_FILE_INSERT, 1, [Set if DB batch insert code enabled])
1773 AC_DEFINE(PROTOTYPES)
1775 dnl --------------------------------------------------------------------------
1776 dnl Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
1778 if test -z "$CFLAGS" -o "$CFLAGS" = "-g -O2"; then
1779 if test -z "$CCOPTS"; then
1780 CCOPTS='-g -O2 -Wall'
1788 dnl See if we can use 64 bit file addresses
1789 largefile_support="no"
1794 dnl --------------------------------------------------------------------------
1795 dnl CHECKING FOR HEADER FILES
1796 dnl --------------------------------------------------------------------------
1834 AC_STRUCT_ST_BLKSIZE
1838 dnl --------------------------------------------------------------------------
1839 dnl Check for utime.h structure
1840 dnl --------------------------------------------------------------------------
1841 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
1845 #include <sys/types.h>
1850 ba_cv_header_utime_h=yes
1852 ba_cv_header_utime_h=no
1857 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H, 1, [Set if utime.h exists])
1859 dnl --------------------------------------------------------------------------
1860 dnl Check for socklen_t
1861 dnl --------------------------------------------------------------------------
1862 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
1866 #include <sys/types.h>
1867 #include <sys/socket.h>
1871 ba_cv_header_socklen_t=yes
1873 ba_cv_header_socklen_t=no
1878 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T, 1, [Set if socklen_t exists])
1880 dnl --------------------------------------------------------------------------
1881 dnl Check for ioctl request type
1882 dnl --------------------------------------------------------------------------
1883 AC_CACHE_CHECK(for ioctl_req_t, ba_cv_header_ioctl_req_t,
1887 #include <sys/types.h>
1888 #include <sys/ioctl.h>
1890 unsigned long int req = 0;
1894 ba_cv_header_ioctl_req_t=yes
1896 ba_cv_header_ioct_req_t_t=no
1901 test $ba_cv_header_ioctl_req_t = yes && AC_DEFINE(HAVE_IOCTL_ULINT_REQUEST, 1, [Set if ioctl request is unsigned long int])
1904 dnl --------------------------------------------------------------------------
1905 dnl Check for typeof()
1906 dnl --------------------------------------------------------------------------
1908 AC_CACHE_CHECK(for typeof, ba_cv_have_typeof,
1912 main(){char *a = 0; a = (typeof a)a;}
1914 ba_cv_have_typeof=yes
1916 ba_cv_have_typeof=no
1918 ba_cv_have_typeof=no
1923 test $ba_cv_have_typeof = yes && AC_DEFINE([HAVE_TYPEOF], 1, [Defind to 1 if compiler has typeof])
1928 dnl --------------------------------------------------------------------------
1929 dnl CHECKING FOR FILESYSTEM TYPE
1930 dnl --------------------------------------------------------------------------
1931 AC_MSG_CHECKING(how to get filesystem type)
1933 # The order of these tests is important.
1936 #include <sys/statvfs.h>
1937 #include <sys/fstyp.h>
1939 AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4
1941 if test $fstype = no; then
1944 #include <sys/statfs.h>
1945 #include <sys/fstyp.h>
1947 AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3
1950 if test $fstype = no; then
1953 #include <sys/statfs.h>
1954 #include <sys/vmount.h>
1956 AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX
1959 if test $fstype = no; then
1964 AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD
1967 if test $fstype = no; then
1968 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
1970 if test $fstype = no; then
1973 #include <sys/mount.h>
1974 #include <sys/fs_types.h>
1976 AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix
1979 AC_MSG_RESULT($fstype)
1981 AC_CHECK_HEADER(sys/statvfs.h, [ AC_DEFINE(HAVE_SYS_STATVFS_H,1,[Defines if your system have the sys/statvfs.h header file])] , )
1983 dnl --------------------------------------------------------------------------
1984 dnl CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
1985 dnl --------------------------------------------------------------------------
1995 AC_CHECK_TYPE(ino_t, unsigned long)
1996 AC_CHECK_TYPE(dev_t, unsigned long)
1997 AC_CHECK_TYPE(daddr_t, long)
1998 AC_CHECK_TYPE(major_t, int)
1999 AC_CHECK_TYPE(minor_t, int)
2000 AC_CHECK_TYPE(ssize_t, int)
2006 AC_CHECK_SIZEOF(char, 1)
2007 AC_CHECK_SIZEOF(short int, 2)
2008 AC_CHECK_SIZEOF(int, 4)
2009 AC_CHECK_SIZEOF(long int, 4)
2010 AC_CHECK_SIZEOF(long long int, 8)
2011 AC_CHECK_SIZEOF(int *, 4)
2013 dnl Check for sys/types.h types
2014 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int,
2018 #include <sys/types.h>
2022 ac_cv_have_u_int="yes"
2024 ac_cv_have_u_int="no"
2029 if test "x$ac_cv_have_u_int" = "xyes" ; then
2030 AC_DEFINE(HAVE_U_INT)
2034 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t,
2038 #include <sys/types.h>
2042 ac_cv_have_intmax_t="yes"
2050 ac_cv_have_intmax_t="yes"
2052 ac_cv_have_intmax_t="no"
2059 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
2060 AC_DEFINE(HAVE_INTMAX_T)
2064 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t,
2068 #include <sys/types.h>
2070 u_intmax_t a; a = 1;
2072 ac_cv_have_u_intmax_t="yes"
2078 u_intmax_t a; a = 1;
2080 ac_cv_have_u_intmax_t="yes"
2082 ac_cv_have_u_intmax_t="no"
2089 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
2090 AC_DEFINE(HAVE_U_INTMAX_T)
2094 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t,
2098 #include <sys/types.h>
2100 int8_t a; int16_t b; int32_t c; a = b = c = 1;
2102 ac_cv_have_intxx_t="yes"
2104 ac_cv_have_intxx_t="no"
2109 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
2110 AC_DEFINE(HAVE_INTXX_T)
2114 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t,
2118 #include <sys/types.h>
2122 ac_cv_have_int64_t="yes"
2124 ac_cv_have_int64_t="no"
2129 if test "x$ac_cv_have_int64_t" = "xyes" ; then
2130 AC_DEFINE(HAVE_INT64_T)
2134 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t,
2138 #include <sys/types.h>
2140 u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;
2142 ac_cv_have_u_intxx_t="yes"
2144 ac_cv_have_u_intxx_t="no"
2149 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
2150 AC_DEFINE(HAVE_U_INTXX_T)
2154 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t,
2158 #include <sys/types.h>
2162 ac_cv_have_u_int64_t="yes"
2164 ac_cv_have_u_int64_t="no"
2169 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
2170 AC_DEFINE(HAVE_U_INT64_T)
2174 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
2175 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2177 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
2180 #include <sys/bitypes.h>
2182 int8_t a; int16_t b; int32_t c;
2183 u_int8_t e; u_int16_t f; u_int32_t g;
2184 a = b = c = e = f = g = 1;
2186 AC_DEFINE(HAVE_U_INTXX_T)
2187 AC_DEFINE(HAVE_INTXX_T)
2188 AC_DEFINE(HAVE_SYS_BITYPES_H)
2196 if test -z "$have_u_intxx_t" ; then
2197 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t,
2201 #include <sys/types.h>
2203 uint8_t a; uint16_t b;
2204 uint32_t c; a = b = c = 1;
2206 ac_cv_have_uintxx_t="yes"
2208 ac_cv_have_uintxx_t="no"
2213 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
2214 AC_DEFINE(HAVE_UINTXX_T)
2218 if (test -z "$have_u_int64_t" || test -z "$have_int64_t" && \
2219 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2221 AC_MSG_CHECKING([for int64_t and u_int64_t types in sys/bitypes.h])
2224 #include <sys/bitypes.h>
2226 int64_t a; u_int64_t b;
2229 AC_DEFINE(HAVE_U_INT64_T)
2230 AC_DEFINE(HAVE_INT64_T)
2238 if (test -z "$have_uintxx_t" && \
2239 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2241 AC_MSG_CHECKING([for uintXX_t types in sys/bitypes.h])
2244 #include <sys/bitypes.h>
2246 uint8_t a; uint16_t b;
2247 uint32_t c; a = b = c = 1;
2249 AC_DEFINE(HAVE_UINTXX_T)
2257 dnl --------------------------------------------------------------------------
2258 dnl CHECKING FOR REQUIRED LIBRARY FUNCTIONS
2259 dnl --------------------------------------------------------------------------
2275 [echo 'configure: cannot find needed function.'; exit 1]
2278 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
2279 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
2280 AC_CHECK_FUNCS(posix_fadvise)
2281 AC_CHECK_FUNCS(fdatasync)
2283 AC_CHECK_FUNCS(chflags)
2285 AC_CHECK_FUNCS(snprintf vsnprintf gethostid fseeko)
2287 AC_CACHE_CHECK(for va_copy, ba_cv_va_copy,
2292 void use_va_copy(va_list args){va_list args2; va_copy(args2,args); va_end(args2);}
2293 void call_use_va_copy(int junk,...){va_list args; va_start(args,junk); use_va_copy(args); va_end(args);}
2295 call_use_va_copy(1,2,3)
2304 test $ba_cv_va_copy = yes && AC_DEFINE(HAVE_VA_COPY, 1, [Set if va_copy exists])
2306 dnl --------------------------------------------------------------------------
2307 dnl CHECKING FOR THREAD SAFE FUNCTIONS
2308 dnl --------------------------------------------------------------------------
2309 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
2311 # If resolver functions are not in libc check for -lnsl or -lresolv.
2312 AC_CHECK_FUNC(gethostbyname_r,
2313 AC_MSG_RESULT(using libc's resolver),
2314 AC_CHECK_LIB(nsl,gethostbyname_r)
2315 AC_CHECK_LIB(resolv,gethostbyname_r))
2317 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
2318 AC_CHECK_FUNCS(inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)])
2319 AC_CHECK_FUNCS(gethostbyname2, [AC_DEFINE(HAVE_GETHOSTBYNAME2)])
2321 dnl ----------------------------
2322 dnl check sa_len of sockaddr
2323 dnl ----------------------------
2324 AC_CACHE_CHECK(for struct sockaddr has a sa_len field, ac_cv_struct_sockaddr_sa_len,
2328 #include <sys/socket.h>
2330 struct sockaddr s; s.sa_len;
2332 ac_cv_struct_sockaddr_sa_len=yes
2333 ], [ac_cv_struct_sockaddr_sa_len=no
2339 if test $ac_cv_struct_sockaddr_sa_len = yes; then
2340 AC_DEFINE(HAVE_SA_LEN, 1, [Define if sa_len field exists in struct sockaddr])
2347 AC_FUNC_CLOSEDIR_VOID
2348 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
2349 # AC_FUNC_FNMATCH dnl use local version
2351 AC_CHECK_LIB(intl, gettext, [LIBS="$LIBS -lintl"])
2353 AC_CHECK_LIB(sun, getpwnam)
2355 AC_CHECK_HEADERS(zlib.h)
2356 AC_CHECK_LIB(z, deflate, [FDLIBS="-lz"])
2358 if test x$FDLIBS = x-lz; then
2359 AC_DEFINE(HAVE_LIBZ)
2364 dnl Check for ACL support and libraries
2368 AC_HELP_STRING([--disable-acl], [disable acl support @<:@default=auto@:>@]),
2370 if test x$enableval = xyes; then
2372 elif test x$enableval = xno; then
2379 have_extended_acl=no
2380 if test x$support_acl = xyes -o x$support_acl = xauto; then
2381 AC_CHECK_HEADER(sys/acl.h, [ AC_DEFINE(HAVE_SYS_ACL_H,1,[Defines if your system have the sys/acl.h header file])] , )
2382 AC_CHECK_FUNC(acl_get_file,
2386 AC_CHECK_LIB(acl, acl_get_file,
2389 FDLIBS="-lacl $FDLIBS"
2391 AC_CHECK_LIB(pacl, acl_get_file,
2394 FDLIBS="-lpacl $FDLIBS"
2396 AC_CHECK_LIB(sec, acltotext,
2399 FDLIBS="-lsec $FDLIBS"
2401 AC_CHECK_LIB(sec, acl_totext,
2403 have_extended_acl=yes
2415 if test x$support_acl = xyes -a $have_acl != yes; then
2416 AC_MSG_ERROR([acl support explicitly enabled but no supported acl implementation found,
2417 please either load the acl libraries or rerun configure without --enable-acl])
2419 if test $have_acl = yes; then
2420 AC_DEFINE([HAVE_ACL],1,[Normal acl support])
2423 if test $have_extended_acl = yes; then
2424 AC_DEFINE([HAVE_EXTENDED_ACL],1,[Extended acl support])
2430 dnl Check for XATTR support
2433 AC_ARG_ENABLE(xattr,
2434 AC_HELP_STRING([--disable-xattr], [disable xattr support @<:@default=auto@:>@]),
2436 if test x$enableval = xyes; then
2438 elif test x$enableval = xno; then
2445 if test x$support_xattr = xyes -o x$support_xattr = xauto; then
2447 dnl First check for *BSD support
2449 AC_CHECK_HEADER(sys/extattr.h, [ AC_DEFINE(HAVE_SYS_EXTATTR_H,1,[Defines if your system have the sys/extattr.h header file])] , )
2450 AC_CHECK_HEADER(libutil.h, [ AC_DEFINE(HAVE_LIBUTIL_H,1,[Defines if your system have the libutil.h header file])] , )
2451 AC_CHECK_FUNCS(extattr_get_link extattr_set_link extattr_list_link,
2454 AC_DEFINE([HAVE_EXTATTR_GET_LINK],1,[Define to 1 if you have the 'extattr_get_link' function.])
2455 AC_DEFINE([HAVE_EXTATTR_SET_LINK],1,[Define to 1 if you have the 'extattr_set_link' function.])
2456 AC_DEFINE([HAVE_EXTATTR_LIST_LINK],1,[Define to 1 if you have the 'extattr_list_link' function.])
2460 if test $have_xattr = no; then
2461 AC_CHECK_FUNCS(extattr_get_file extattr_set_file extattr_list_file,
2464 AC_DEFINE([HAVE_EXTATTR_GET_FILE],1,[Define to 1 if you have the 'extattr_get_file' function.])
2465 AC_DEFINE([HAVE_EXTATTR_SET_FILE],1,[Define to 1 if you have the 'extattr_set_file' function.])
2466 AC_DEFINE([HAVE_EXTATTR_LIST_FILE],1,[Define to 1 if you have the 'extattr_list_file' function.])
2471 if test $have_xattr = yes; then
2472 have_extattr_string_in_libc=no
2473 AC_CHECK_FUNCS(extattr_namespace_to_string extattr_string_to_namespace,
2475 have_extattr_string_in_libc=yes
2476 AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2477 AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2482 dnl If extattr_namespace_to_string and extattr_string_to_namespace are not in libc see if they are in libutil
2484 if test $have_extattr_string_in_libc = no; then
2485 AC_CHECK_LIB(util, extattr_namespace_to_string extattr_string_to_namespace,
2487 AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2488 AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2489 FDLIBS="-lutil $FDLIBS"
2496 dnl If we failed to find *BSD support try the Linux or OSX implementation of xattr
2498 if test $have_xattr = no; then
2499 AC_CHECK_HEADER(sys/xattr.h, [ AC_DEFINE(HAVE_SYS_XATTR_H,1,[Defines if your system have the sys/xattr.h header file])] , )
2500 AC_CHECK_FUNCS(llistxattr lgetxattr lsetxattr,
2503 AC_DEFINE([HAVE_LLISTXATTR],1,[Define to 1 if you have the 'llistxattr' function.])
2504 AC_DEFINE([HAVE_LGETXATTR],1,[Define to 1 if you have the 'lgetxattr' function.])
2505 AC_DEFINE([HAVE_LSETXATTR],1,[Define to 1 if you have the 'lsetxattr' function.])
2509 if test $have_xattr = no; then
2510 AC_CHECK_FUNCS(listxattr getxattr setxattr,
2513 AC_DEFINE([HAVE_LISTXATTR],1,[Define to 1 if you have the 'listxattr' function.])
2514 AC_DEFINE([HAVE_GETXATTR],1,[Define to 1 if you have the 'getxattr' function.])
2515 AC_DEFINE([HAVE_SETXATTR],1,[Define to 1 if you have the 'setxattr' function.])
2522 dnl If we failed to find *BSD support and the Linux or OSX implementation of xattr try the Solaris xattr implementation
2524 if test $have_xattr = no; then
2525 AC_CHECK_HEADER(sys/attr.h, [ AC_DEFINE(HAVE_SYS_ATTR_H,1,[Defines if your system have the sys/attr.h header file])] , )
2526 AC_CHECK_HEADER(sys/nvpair.h, [ AC_DEFINE(HAVE_SYS_NVPAIR_H,1,[Defines if your system have the sys/nvpair.h header file])] , )
2527 AC_CHECK_HEADER(attr.h, [ AC_DEFINE(HAVE_ATTR_H,1,[Defines if your system have the attr.h header file])] , )
2529 AC_CHECK_FUNCS(openat fstatat unlinkat fchownat futimesat,
2532 AC_DEFINE([HAVE_OPENAT],1,[Define to 1 if you have the 'openat' function.])
2533 AC_DEFINE([HAVE_FSTATAT],1,[Define to 1 if you have the 'fstatat' function.])
2534 AC_DEFINE([HAVE_UNLINKAT],1,[Define to 1 if you have the 'unlinkat' function.])
2535 AC_DEFINE([HAVE_FCHOWNAT],1,[Define to 1 if you have the 'fchownat' function.])
2536 AC_DEFINE([HAVE_FUTIMESAT],1,[Define to 1 if you have the 'futimesat' function.])
2540 if test $have_xattr = yes; then
2541 AC_CHECK_LIB(nvpair, nvlist_next_nvpair,
2543 AC_DEFINE([HAVE_NVLIST_NEXT_NVPAIR],1,[Define to 1 if you have the 'nvlist_next_nvpair' function.])
2544 FDLIBS="-lnvpair $FDLIBS"
2550 if test x$support_xattr = xyes -a $have_xattr != yes; then
2551 AC_MSG_ERROR([xattr support explicitly enabled but no supported xattr implementation found,
2552 please either load the xattr libraries or rerun configure without --enable-xattr])
2554 if test $have_xattr = yes; then
2555 AC_DEFINE([HAVE_XATTR],1,[Extended Attributes support])
2561 dnl Check for pthread libraries
2564 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
2566 AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
2568 AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
2570 AC_CHECK_FUNC(pthread_create)
2579 dnl Check for headers, functions and libraries required to support
2580 dnl keeping readall capabilities
2582 AC_CHECK_HEADERS(sys/prctl.h sys/capability.h)
2583 AC_CHECK_FUNCS(prctl setreuid)
2584 AC_CHECK_LIB([cap], [cap_set_proc], [CAP_LIBS="-lcap"], [CAP_LIBS=])
2585 if test x$CAP_LIBS = x-lcap; then
2586 AC_DEFINE(HAVE_LIBCAP, 1, [Define if you have libcap])
2595 if test x$have_gcc = xyes ; then
2596 CPPFLAGS="$CPPFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
2597 CFLAGS="$CFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
2599 LDFLAGS=${LDFLAGS--O}
2600 DB_LIBS="${SQL_LFLAGS}"
2601 CPPFLAGS="$CPPFLAGS"
2614 AC_SUBST(X_EXTRA_LIBS)
2619 dnl extra configurable objects
2630 dnl Finally we set appropriate distribution specific
2631 dnl variables and defaults
2633 dnl PFILES are platform specific files
2634 PFILES="platforms/Makefile"
2639 hostname=`uname -n | cut -d '.' -f 1`
2640 if test x${hostname} = x ; then
2641 hostname="localhost"
2643 dnl Make sure hostname is resolved
2644 ping -c 1 $hostname 2>/dev/null 1>/dev/null
2645 if test ! $? = 0; then
2646 hostname="localhost"
2652 PSCMD="ps -e -o pid,comm"
2654 platforms/aix/Makefile"
2655 TAPEDRIVE="/dev/rmt0.1"
2659 PTHREAD_LIB="-lpthread -lexc"
2660 if test "${CC}" = "gcc" ; then
2667 TAPEDRIVE="/dev/nrmt0"
2670 DISTVER=`uname -a |awk '{print $3}'`
2671 TAPEDRIVE="/dev/nrmt0"
2672 PTHREAD_LIB="-pthread"
2673 CFLAGS="${CFLAGS} -pthread"
2674 PSCMD="ps -ax -o pid,command"
2678 platforms/bsdi/Makefile \
2679 platforms/bsdi/bacula-fd \
2680 platforms/bsdi/bacula-sd \
2681 platforms/bsdi/bacula-dir"
2682 largefile_support="yes"
2685 DISTVER=`uname -a |awk '{print $3}'`
2686 TAPEDRIVE="/dev/nrst0"
2689 WLDFLAGS="-mwindows"
2693 TAPEDRIVE="/dev/nst0"
2694 PSCMD="ps -e -o pid,command"
2697 platforms/darwin/Makefile"
2701 TAPEDRIVE="/dev/nst0"
2702 PSCMD="ps -e -o pid,command"
2705 platforms/osx/Makefile"
2708 if `test -f /etc/apt/sources.list && grep -q ubuntu /etc/apt/sources.list`; then
2711 DISTVER=`cat /etc/debian_version`
2712 if test -f /etc/lsb-release ; then
2714 if test "x$DISTRIB_ID" != "x" ; then
2715 DISTNAME=$DISTRIB_ID
2717 if test "x$DISTRIB_RELEASE" != "x" ; then
2718 DISTVER=$DISTRIB_RELEASE
2721 if test "$DISTNAME" = "Ubuntu" ; then
2724 TAPEDRIVE="/dev/nst0"
2725 PSCMD="ps -e -o pid,command"
2726 if test "$DISTNAME" = "ubuntu" ; then
2728 platforms/ubuntu/Makefile \
2729 platforms/ubuntu/bacula-fd \
2730 platforms/ubuntu/bacula-sd \
2731 platforms/ubuntu/bacula-dir"
2734 platforms/debian/Makefile \
2735 platforms/debian/bacula-fd \
2736 platforms/debian/bacula-sd \
2737 platforms/debian/bacula-dir"
2741 DISTVER=`uname -a |awk '{print $3}'`
2742 VER=`echo $DISTVER | cut -c 1`
2743 if test x$VER = x4 ; then
2744 PTHREAD_LIB="${PTHREAD_LIBS:--pthread}"
2745 CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS:--pthread}"
2749 TAPEDRIVE="/dev/nrsa0"
2750 PSCMD="ps -ax -o pid,command"
2752 platforms/freebsd/Makefile \
2753 platforms/freebsd/bacula-fd \
2754 platforms/freebsd/bacula-sd \
2755 platforms/freebsd/bacula-dir"
2756 largefile_support="yes"
2759 PSCMD="UNIX95=1; ps -e -o pid,comm"
2760 CFLAGS="${CFLAGS} -D_XOPEN_SOURCE_EXTENDED=1"
2762 TAPEDRIVE="/dev/rmt/0hnb"
2763 PTHREAD_LIB="-lpthread"
2764 AC_DEFINE([_INCLUDE_LONGLONG])
2768 TAPEDRIVE="/dev/rmt/0cbn"
2769 PSCMD="ps -e -o pid,comm"
2771 platforms/irix/Makefile \
2772 platforms/irix/bacula-fd \
2773 platforms/irix/bacula-sd \
2774 platforms/irix/bacula-dir"
2777 DISTVER=`uname -a |awk '{print $3}'`
2780 TAPEDRIVE="/dev/nrst0"
2781 PSCMD="ps -ax -o pid,command"
2782 PTHREAD_LIB="-pthread"
2783 CFLAGS="${CFLAGS} -pthread"
2786 DISTVER=`uname -a |awk '{print $3}'`
2789 TAPEDRIVE="/dev/nrst0"
2790 PSCMD="ps -ax -o pid,command"
2791 PTHREAD_LIB="-pthread"
2792 CFLAGS="${CFLAGS} -pthread"
2794 platforms/openbsd/Makefile \
2795 platforms/openbsd/bacula-fd \
2796 platforms/openbsd/bacula-sd \
2797 platforms/openbsd/bacula-dir"
2800 if test -f /etc/whitebox-release ; then
2801 f=/etc/whitebox-release
2803 f=/etc/redhat-release
2805 if test `cat $f | grep release |\
2806 cut -f 3 -d ' '`x = "Enterprise"x ; then
2807 DISTVER="Enterprise "`cat $f | grep release |\
2810 DISTVER=`cat /etc/redhat-release | grep release |\
2813 TAPEDRIVE="/dev/nst0"
2814 PSCMD="ps -e -o pid,command"
2816 platforms/redhat/Makefile \
2817 platforms/redhat/bacula-fd \
2818 platforms/redhat/bacula-sd \
2819 platforms/redhat/bacula-dir
2823 DISTVER=`cat /etc/mandrake-release | grep release |\
2825 TAPEDRIVE="/dev/nst0"
2826 PSCMD="ps -e -o pid,command"
2828 platforms/mandrake/Makefile \
2829 platforms/mandrake/bacula-fd \
2830 platforms/mandrake/bacula-sd \
2831 platforms/mandrake/bacula-dir \
2832 platforms/mandrake/bacula.spec \
2836 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
2837 TAPEDRIVE="/dev/nst0"
2838 PSCMD="ps -e -o pid,command"
2840 platforms/gentoo/Makefile \
2841 platforms/gentoo/bacula-init \
2842 platforms/gentoo/bacula-fd \
2843 platforms/gentoo/bacula-sd \
2844 platforms/gentoo/bacula-dir"
2847 DISTVER=`cat /etc/slackware-version`
2848 TAPEDRIVE="/dev/nst0"
2849 PSCMD="ps -e -o pid,command"
2851 platforms/slackware/Makefile \
2852 platforms/slackware/rc.bacula-fd \
2853 platforms/slackware/rc.bacula-sd \
2854 platforms/slackware/rc.bacula-dir\
2855 platforms/slackware/functions.bacula"
2859 TAPEDRIVE="/dev/rmt/0cbn"
2860 PSCMD="ps -e -o pid,comm"
2862 platforms/solaris/Makefile \
2863 platforms/solaris/bacula-fd \
2864 platforms/solaris/bacula-sd \
2865 platforms/solaris/bacula-dir"
2866 if test x$DISTVER = x5.6 ; then
2867 AC_DEFINE(HAVE_OLD_SOCKOPT)
2869 LIBS="$LIBS -lresolv"
2872 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
2874 TAPEDRIVE="/dev/nst0"
2875 PSCMD="ps -e -o pid,command"
2877 platforms/suse/Makefile \
2878 platforms/suse/bacula-fd \
2879 platforms/suse/bacula-sd \
2880 platforms/suse/bacula-dir \
2881 platforms/suse/bacula \
2882 platforms/suse/bacula.spec"
2887 TAPEDRIVE="/dev/nst0"
2888 PSCMD="ps -e -o pid,command"
2890 platforms/suse/Makefile \
2891 platforms/suse/bacula-fd \
2892 platforms/suse/bacula-sd \
2893 platforms/suse/bacula-dir"
2897 TAPEDRIVE="/dev/nst0"
2900 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
2906 LIBS="$PTHREAD_LIB $LIBS"
2908 AC_DEFINE_UNQUOTED(lld, "$lld")
2909 AC_DEFINE_UNQUOTED(llu, "$llu")
2917 dnl common parts of the Makefile
2918 MCOMMON=./autoconf/Make.common
2919 AC_SUBST_FILE(MCOMMON)
2922 if test "x${subsysdir}" = "x${sbindir}" ; then
2925 echo "You have set both --sbindir and --with-subsys-dir"
2926 echo " equal to: ${subsysdir} "
2927 echo "This is not permitted. Please reconfigure."
2929 echo "Aborting configuration ..."
2935 AC_OUTPUT([autoconf/Make.common \
2938 scripts/startmysql \
2940 scripts/btraceback \
2946 scripts/bacula-ctl-dir \
2947 scripts/bacula-ctl-fd \
2948 scripts/bacula-ctl-sd \
2949 scripts/devel_bacula \
2952 scripts/bacula.desktop.gnome1 \
2953 scripts/bacula.desktop.gnome2 \
2954 scripts/bacula.desktop.gnome1.consolehelper \
2955 scripts/bacula.desktop.gnome2.consolehelper \
2956 scripts/bacula.desktop.gnome1.xsu \
2957 scripts/bacula.desktop.gnome2.xsu \
2958 scripts/bgnome-console.console_apps \
2959 scripts/mtx-changer \
2960 scripts/disk-changer \
2961 scripts/dvd-handler \
2962 scripts/dvd-simulator \
2963 scripts/bacula-tray-monitor.desktop \
2964 scripts/logwatch/Makefile \
2965 scripts/logwatch/logfile.bacula.conf \
2966 scripts/wxconsole.console_apps \
2967 scripts/wxconsole.desktop.consolehelper \
2968 scripts/wxconsole.desktop.xsu \
2969 scripts/bat.desktop \
2970 scripts/bat.desktop.xsu \
2971 scripts/bat.desktop.consolehelper \
2972 scripts/bat.console_apps \
2975 src/console/Makefile \
2976 src/console/bconsole.conf \
2977 src/qt-console/bat.conf \
2978 src/qt-console/bat.pro \
2979 src/qt-console/bat.pro.mingw32 \
2980 src/qt-console/install_conf_file \
2981 src/wx-console/Makefile \
2982 src/wx-console/bwx-console.conf \
2983 src/tray-monitor/Makefile \
2984 src/tray-monitor/tray-monitor.conf \
2986 src/dird/bacula-dir.conf \
2988 src/stored/Makefile \
2989 src/stored/bacula-sd.conf \
2990 src/filed/Makefile \
2991 src/filed/bacula-fd.conf \
2993 src/cats/make_catalog_backup \
2994 src/cats/delete_catalog_backup \
2995 src/cats/create_postgresql_database \
2996 src/cats/update_postgresql_tables \
2997 src/cats/make_postgresql_tables \
2998 src/cats/grant_postgresql_privileges \
2999 src/cats/drop_postgresql_tables \
3000 src/cats/drop_postgresql_database \
3001 src/cats/create_mysql_database \
3002 src/cats/update_mysql_tables \
3003 src/cats/make_mysql_tables \
3004 src/cats/grant_mysql_privileges \
3005 src/cats/drop_mysql_tables \
3006 src/cats/drop_mysql_database \
3007 src/cats/create_sqlite3_database \
3008 src/cats/update_sqlite3_tables \
3009 src/cats/make_sqlite3_tables \
3010 src/cats/grant_sqlite3_privileges \
3011 src/cats/drop_sqlite3_tables \
3012 src/cats/drop_sqlite3_database \
3015 src/cats/create_bdb_database \
3016 src/cats/update_bdb_tables \
3017 src/cats/make_bdb_tables \
3018 src/cats/grant_bdb_privileges \
3019 src/cats/drop_bdb_tables \
3020 src/cats/drop_bdb_database \
3021 src/cats/create_bacula_database \
3022 src/cats/update_bacula_tables \
3023 src/cats/grant_bacula_privileges \
3024 src/cats/make_bacula_tables \
3025 src/cats/drop_bacula_tables \
3026 src/cats/drop_bacula_database \
3027 src/findlib/Makefile \
3028 src/tools/Makefile \
3029 src/plugins/fd/Makefile \
3030 src/plugins/sd/Makefile \
3031 src/plugins/dir/Makefile \
3032 src/win32/Makefile.inc \
3034 updatedb/update_mysql_tables_9_to_10 \
3035 updatedb/update_sqlite3_tables_9_to_10 \
3036 updatedb/update_postgresql_tables_9_to_10 \
3037 updatedb/update_mysql_tables_10_to_11 \
3038 updatedb/update_sqlite3_tables_10_to_11 \
3039 updatedb/update_postgresql_tables_10_to_11 \
3040 examples/nagios/check_bacula/Makefile \
3045 if test "${support_bat}" = "yes" ; then
3046 if test "x$QMAKE" = "xnone" && test "x$QMAKEQT4" = "xnone"; then
3047 AC_MSG_ERROR([Could not find qmake or qmake-qt4 in $PATH. Check your Qt installation])
3052 if test "x$QMAKEQT4" != "xnone"; then
3057 echo "Creating bat Makefile"
3066 dnl if CC is gcc, we can rebuild the dependencies (since the depend rule
3067 dnl requires gcc). If it's not, don't rebuild dependencies
3069 if test X"$GCC" = "Xyes" ; then
3070 echo "Doing make of dependencies"
3071 ${MAKE:-make} depend
3075 chmod 755 install_conf_file build-depkgs-qt-console
3079 chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
3080 chmod 755 dvd-handler dvd-simulator breload make_catalog_backup.pl
3081 chmod 755 bconsole gconsole mtx-changer devel_bacula logrotate
3085 chmod 755 $c/update_mysql_tables_10_to_11 $c/update_sqlite3_tables_10_to_11
3086 chmod 755 $c/update_postgresql_tables_10_to_11
3090 chmod 755 $c/create_bacula_database $c/update_bacula_tables $c/make_bacula_tables
3091 chmod 755 $c/grant_bacula_privileges $c/drop_bacula_tables $c/drop_bacula_database
3093 chmod 755 $c/create_bdb_database $c/update_bdb_tables $c/make_bdb_tables
3094 chmod 755 $c/grant_bdb_privileges $c/drop_bdb_tables $c/drop_bdb_database
3096 chmod 755 $c/create_mysql_database $c/update_mysql_tables $c/make_mysql_tables
3097 chmod 755 $c/grant_mysql_privileges $c/drop_mysql_tables $c/drop_mysql_database
3099 chmod 755 $c/create_sqlite3_database $c/update_sqlite3_tables $c/make_sqlite3_tables
3100 chmod 755 $c/grant_sqlite3_privileges $c/drop_sqlite3_tables $c/drop_sqlite3_database
3102 chmod 755 $c/create_postgresql_database $c/update_postgresql_tables $c/make_postgresql_tables
3103 chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables $c/drop_postgresql_database
3105 chmod 755 $c/make_catalog_backup $c/delete_catalog_backup
3109 chmod 755 src/win32/build-depkgs-mingw32
3111 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
3112 largefile_support="yes"
3115 dnl Only try to find out the version number of the compiler when we know its some kind of GCC compiler
3116 if test X"$GCC" = "Xyes" ; then
3118 dnl A whole lot of hand springs to get the compiler version.
3119 dnl This is because gcc changed the output in version 3.0
3121 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3122 if test "x${CCVERSION}" = "x" ; then
3123 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3125 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3126 if test x"${CXXVERSION}" = x ; then
3127 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3131 # clean up any old junk
3137 if test "x${db_type}" = "xInternal" ; then
3140 echo "You have not specified either --enable-client-only or one of the"
3141 echo " supported databases: MySQL, PostgreSQL, SQLite3, SQLite or DBI."
3142 echo " This is not permitted. Please reconfigure."
3144 echo "Aborting the configuration ..."
3151 Configuration on `date`:
3153 Host: ${host}${post_host} -- ${DISTNAME} ${DISTVER}
3154 Bacula version: ${BACULA} ${VERSION} (${DATE})
3155 Source code location: ${srcdir}
3156 Install binaries: ${sbindir}
3157 Install libraries: ${libdir}
3158 Install config files: ${sysconfdir}
3159 Scripts directory: ${scriptdir}
3160 Archive directory: ${archivedir}
3161 Working directory: ${working_dir}
3162 PID directory: ${piddir}
3163 Subsys directory: ${subsysdir}
3164 Man directory: ${mandir}
3165 Data directory: ${datarootdir}
3166 Plugin directory: ${plugindir}
3167 C Compiler: ${CC} ${CCVERSION}
3168 C++ Compiler: ${CXX} ${CXXVERSION}
3169 Compiler flags: ${WCFLAGS} ${CFLAGS}
3170 Linker flags: ${WLDFLAGS} ${LDFLAGS}
3172 Statically Linked Tools: ${support_static_tools}
3173 Statically Linked FD: ${support_static_fd}
3174 Statically Linked SD: ${support_static_sd}
3175 Statically Linked DIR: ${support_static_dir}
3176 Statically Linked CONS: ${support_static_cons}
3177 Database type: ${db_type}
3178 Database port: ${db_port}
3179 Database lib: ${DB_LIBS}
3180 Database name: ${db_name}
3181 Database user: ${db_user}
3183 Job Output Email: ${job_email}
3184 Traceback Email: ${dump_email}
3185 SMTP Host Address: ${smtp_host}
3187 Director Port: ${dir_port}
3188 File daemon Port: ${fd_port}
3189 Storage daemon Port: ${sd_port}
3191 Director User: ${dir_user}
3192 Director Group: ${dir_group}
3193 Storage Daemon User: ${sd_user}
3194 Storage DaemonGroup: ${sd_group}
3195 File Daemon User: ${fd_user}
3196 File Daemon Group: ${fd_group}
3198 SQL binaries Directory ${SQL_BINDIR}
3200 Large file support: $largefile_support
3201 Bacula conio support: ${got_conio} ${CONS_LIBS}
3202 readline support: ${got_readline} ${PRTREADLINE_SRC}
3203 TCP Wrappers support: ${TCPW_MSG} ${WRAPLIBS}
3204 TLS support: ${support_tls}
3205 Encryption support: ${support_crypto}
3206 ZLIB support: ${have_zlib}
3207 enable-smartalloc: ${support_smartalloc}
3208 enable-lockmgr: ${support_lockmgr}
3209 bat support: ${support_bat} ${QWT_LDFLAGS}
3210 enable-gnome: ${support_gnome} ${gnome_version}
3211 enable-bwx-console: ${support_wx_console} ${wx_version}
3212 enable-tray-monitor: ${support_tray_monitor}
3213 client-only: ${build_client_only}
3214 build-dird: ${build_dird}
3215 build-stored: ${build_stored}
3216 Plugin support: ${have_plugins}
3217 ACL support: ${have_acl}
3218 XATTR support: ${have_xattr}
3219 Python support: ${support_python} ${PYTHON_LIBS}
3220 Batch insert enabled: ${support_batch_insert}
3224 # create a small shell script useful for support with
3225 # configure options and config.out info
3226 cat > scripts/bacula_config << EOF
3229 $ $0 $ac_configure_args
3231 cat config.out >> scripts/bacula_config
3232 echo __EOC__ >> scripts/bacula_config
3233 chmod 755 scripts/bacula_config
3237 # Display a warning message if postgresql client lib is <= 8.1
3238 if test x$DB_TYPE = xpostgresql -a x$ac_cv_lib_pq_PQisthreadsafe != xyes \
3239 -a x$support_batch_insert = xyes
3241 echo "WARNING: Your PostgreSQL client library is too old to detect "
3242 echo " if it was compiled with --enable-thread-safety, consider to"
3243 echo " upgrade it in order to avoid problems with Batch insert mode"