3 dnl Process this file with autoconf to produce a configure script.
12 AC_CONFIG_AUX_DIR(${BUILD_DIR}/autoconf)
13 AC_CONFIG_HEADER(src/config.h:autoconf/config.h.in)
15 dnl minimal Win32 stuff for "make clean"
16 WIN32BUILDDIR=${BUILD_DIR}/src/win32
17 WIN32MAINDIR=${BUILD_DIR}
18 WIN32TOPDIR=${TOP_DIR}
19 AC_SUBST(WIN32BUILDDIR)
20 AC_SUBST(WIN32MAINDIR)
23 dnl require a recent autoconf
27 dnl search for true and false programs.
28 AC_PATH_PROGS(TRUEPRG, true, :)
29 AC_PATH_PROGS(FALSEPRG, false, :)
34 if test "x$BACULA" != x; then
35 post_host=`echo -${BACULA} | tr 'A-Z ' 'a-z-'`
37 BACULA=${BACULA:-Bacula}
38 VERSION=`sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
39 DATE=`sed -n -e 's/^.*[ \t]*BDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
40 LSMDATE=`sed -n -e 's/^.*LSMDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
45 AC_SUBST(post_host)dnl
46 echo "configuring for ${BACULA} $VERSION ($DATE)"
48 dnl -------------------------------------------------------
49 dnl Check for compiler.
50 dnl ------------------------------------------------------
54 AC_PROG_CC_C_O dnl Determine if C compiler support -c -o.
55 AC_PROG_GCC_TRADITIONAL dnl Determine if ioctl() need -traditional.
59 if test "x$BASECC" = xgcc; then
63 AC_PATH_PROG(CXX, $CXX, $CXX)
64 if test ! -e $CXX; then
65 AC_MSG_ERROR(Unable to find C++ compiler)
68 dnl -------------------------------------------------------
69 dnl Check for programs.
70 dnl ------------------------------------------------------
72 AC_PATH_PROG(MV, mv, mv)
74 dnl If we name the variable RM it will shadow the RM variable in the configure script and we overwrite the
75 dnl value with the name of the rm command and not rm -f which is its normal content. This gives all kind
76 dnl of strange output of the configure script (like things don't exist etc.).
77 dnl So we name it REMOVE (more software has run into this problem)
78 AC_PATH_PROG(REMOVE, rm, rm)
79 AC_PATH_PROG(CP, cp, cp)
80 AC_PATH_PROG(SED, sed, sed)
81 AC_PATH_PROG(ECHO, echo, echo)
82 AC_PATH_PROG(CMP, cmp, cmp)
83 AC_PATH_PROG(TBL, tbl, tbl)
84 AC_PATH_PROG(AR, ar, ar)
85 AC_PATH_PROG(OPENSSL, openssl, none)
86 AC_PATH_PROG(MTX, mtx, mtx)
87 AC_PATH_PROG(DD, dd, dd)
88 AC_PATH_PROG(MKISOFS, mkisofs, mkisofs)
89 AC_PATH_PROG(PYTHON, python, python)
90 AC_PATH_PROG(GROWISOFS, growisofs, growisofs)
91 AC_PATH_PROG(DVDRWMEDIAINFO, dvd+rw-mediainfo, dvd+rw-mediainfo)
92 AC_PATH_PROG(DVDRWFORMAT, dvd+rw-format, dvd+rw-format)
93 AC_PATH_PROG(PKGCONFIG, pkg-config, pkg-config)
94 AC_PATH_PROG(QMAKE, qmake, none)
95 AC_PATH_PROG(QMAKEQT4, qmake-qt4, none)
96 AC_PATH_PROG(GMAKE, gmake, none)
97 AC_ARG_VAR(WXCONFIG, [wx-config command. On some systems, you must set it to wx-config-2.6 to use wxWidgets 2.6.])
98 if test "x$WXCONFIG" = x; then
101 AC_PATH_PROG(WXCONFIG, ${WXCONFIG}, ${WXCONFIG})
102 AC_ARG_VAR(WXFLAGS, [Parameters to pass to wx-config (e.g. --unicode=no).])
103 AC_PATH_PROG(CDRECORD, cdrecord, cdrecord)
104 AC_PATH_PROG(PIDOF, pidof, pidof)
106 # Some AWK programs fail, so test it and warn the user
107 if echo xfoo | $AWK 'BEGIN { prog=ARGV[1]; ARGC=1 }
108 { if ((prog == $2) || (("(" prog ")") == $2) ||
109 (("[" prog "]") == $2) ||
110 ((prog ":") == $2)) { print $1 ; exit 0 } }' xfoo>/dev/null; then :;
112 AC_MSG_ERROR([!!!!!!!!! WARNING !!!!!!!!!!!!!!
113 The regex engine of $AWK is too broken to be used you
114 might want to install GNU AWK.
115 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!])
118 AC_PATH_PROG(AWK, $THE_AWK, $THE_AWK)
121 test -n "$ARFLAG" || ARFLAGS="cr"
128 AC_SUBST(LOCAL_CFLAGS)
129 AC_SUBST(LOCAL_LDFLAGS)
132 dnl --------------------------------------------------
134 dnl --------------------------------------------------
135 AC_ARG_ENABLE(libtool,
136 AC_HELP_STRING([--enable-libtool], [enable building using GNU libtool @<:@default=yes@:>@]),
138 if test x$enableval = xno; then
143 LT_INIT([shared disable-static])
146 if test x$use_libtool != xno; then
147 DEFAULT_OBJECT_TYPE=".lo"
148 DEFAULT_ARCHIVE_TYPE=".la"
149 DEFAULT_SHARED_OBJECT_TYPE=".la"
150 LIBTOOL="\$(LIBTOOL)"
151 LIBTOOL_INSTALL_TARGET="libtool-install"
152 LIBTOOL_UNINSTALL_TARGET="libtool-uninstall"
153 LIBTOOL_CLEAN_TARGET="libtool-clean"
154 QMAKE_LIBTOOL="${BUILD_DIR}/libtool"
156 DEFAULT_OBJECT_TYPE=".o"
157 DEFAULT_ARCHIVE_TYPE=".a"
158 DEFAULT_SHARED_OBJECT_TYPE=".so"
159 LIBTOOL="# \$(LIBTOOL)"
160 LIBTOOL_INSTALL_TARGET=""
161 LIBTOOL_UNINSTALL_TARGET=""
162 LIBTOOL_CLEAN_TARGET=""
163 QMAKE_LIBTOOL="# ${BUILD_DIR}/libtool"
166 AC_SUBST(DEFAULT_OBJECT_TYPE)
167 AC_SUBST(DEFAULT_ARCHIVE_TYPE)
168 AC_SUBST(DEFAULT_SHARED_OBJECT_TYPE)
170 AC_SUBST(LIBTOOL_INSTALL_TARGET)
171 AC_SUBST(LIBTOOL_UNINSTALL_TARGET)
172 AC_SUBST(LIBTOOL_CLEAN_TARGET)
173 AC_SUBST(QMAKE_LIBTOOL)
175 dnl --------------------------------------------------
176 dnl Include file handling
177 dnl --------------------------------------------------
178 AC_ARG_ENABLE(includes,
179 AC_HELP_STRING([--enable-includes], [enable installing of include files @<:@default=no@:>@]),
181 if test x$enableval = xyes; then
187 dnl It only makes sense to install include files when you install libraries which only happens when
188 dnl libtool is enabled
190 if test x$use_libtool != xno -a x$install_includes = xyes; then
191 INCLUDE_INSTALL_TARGET="install-includes"
192 INCLUDE_UNINSTALL_TARGET="uninstall-includes"
194 INCLUDE_INSTALL_TARGET=""
195 INCLUDE_UNINSTALL_TARGET=""
197 AC_SUBST(INCLUDE_INSTALL_TARGET)
198 AC_SUBST(INCLUDE_UNINSTALL_TARGET)
200 dnl --------------------------------------------------
201 dnl Bacula OP Sys determination (see aclocal.m4)
202 dnl --------------------------------------------------
205 dnl -----------------------------------------------------------
206 dnl Bacula OPSys Distribution determination (see aclocal.m4)
207 dnl ----------------------------------------------------------
208 BA_CHECK_OPSYS_DISTNAME
210 dnl --------------------------------------------------
211 dnl Suppport for gettext (translations)
212 dnl By default, $datarootdir is ${prefix}/share
213 dnl --------------------------------------------------
214 AM_GNU_GETTEXT([external])
216 dnl ------------------------------------------------------------------
217 dnl If the user has not set --prefix, we set our default to nothing.
218 dnl In this case, if the user has not set --sysconfdir, we set it
219 dnl to the package default of /etc/bacula. If either --prefix or
220 dnl --sysconfdir is set, we leave sysconfdir alone except to eval it.
221 dnl If the user has not set --libdir, we set it to the package
222 dnl default of /usr/lib. If either --prefix or --libdir is set,
223 dnl we leave libdir alone except to eval it. If the user has not set
224 dnl --includedir, we set it to the package default of /usr/include.
225 dnl If either --prefix or --includedir is set, we leave includedir
226 dnl alone except to eval it
227 dnl ------------------------------------------------------------------
228 if test x${prefix} = xNONE ; then
229 if test `eval echo ${sysconfdir}` = NONE/etc ; then
230 sysconfdir=/etc/bacula
233 if test `eval echo ${libdir}` = NONE/lib ; then
237 if test `eval echo ${includedir}` = NONE/include ; then
238 includedir=/usr/include
241 if test `eval echo ${datarootdir}` = NONE/share ; then
242 datarootdir=/usr/share
247 dnl -------------------------------------------------------------------------
248 dnl If the user has not set --exec-prefix, we default to ${prefix}
249 dnl -------------------------------------------------------------------------
250 if test x${exec_prefix} = xNONE ; then
251 exec_prefix=${prefix}
254 sysconfdir=`eval echo ${sysconfdir}`
255 datarootdir=`eval echo ${datarootdir}`
256 docdir=`eval echo ${docdir}`
257 htmldir=`eval echo ${htmldir}`
258 libdir=`eval echo ${libdir}`
259 includedir=`eval echo ${includedir}`
260 localedir=`eval echo ${datarootdir}/locale`
261 AC_DEFINE_UNQUOTED(SYSCONFDIR, "$sysconfdir")
262 AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir")
264 dnl ------------------------------------------------------------------
265 dnl If the user has not set --sbindir, we set our default as /sbin
266 dnl ------------------------------------------------------------------
267 if test x$sbindir = x'${exec_prefix}/sbin' ; then
268 sbindir=${exec_prefix}/sbin
270 sbindir=`eval echo ${sbindir}`
272 dnl -------------------------------------------------------------------------
273 dnl If the user has not set --mandir, we default to /usr/share/man
274 dnl -------------------------------------------------------------------------
275 if test x$mandir = x'${prefix}/man' ; then
276 mandir=/usr/share/man
279 dnl -------------------------------------------------------------------------
280 dnl If the user has not set --htmldir, we default to /usr/share/doc/bacula/html
281 dnl -------------------------------------------------------------------------
283 if test x$htmldir = x${docdir} ; then
284 htmldir=`eval echo ${docdir}bacula/html`
287 dnl -------------------------------------------------------------------------
288 dnl If the user has not set --docdir, we default to /usr/share/doc/
289 dnl -------------------------------------------------------------------------
291 if test x$docdir = x'/usr/share/doc/' ; then
292 docdir=`eval echo ${docdir}bacula`
296 AC_PATH_PROGS(MSGFMT, msgfmt, no)
297 if test "$MSGFMT" = "no"
299 echo 'msgfmt program not found, disabling NLS !'
301 USE_INCLUDED_LIBINTL=no
309 support_postgresql=no
311 support_smartalloc=yes
316 support_wx_console=no
317 support_tray_monitor=no
322 support_static_tools=no
325 support_static_dir=no
326 support_static_cons=no
336 dnl --------------------------------------------------------------------------
337 dnl CHECKING COMMAND LINE OPTIONS
338 dnl --------------------------------------------------------------------------
340 dnl -------------------------------------------
341 dnl gnome (default off)
342 dnl -------------------------------------------
344 AC_HELP_STRING([--enable-gnome], [enable build of bgnome-console GUI @<:@default=no@:>@]),
346 if test x$enableval = xyes; then
353 if test x$support_gnome = xyes; then
354 abc=`$PKGCONFIG --exists libgnomeui-2.0`
356 if test $pkg = 0; then
357 GNOME_INCLUDEDIR=`$PKGCONFIG --cflags-only-I libgnomeui-2.0`
358 GNOMEUI_LIBS=`$PKGCONFIG --libs-only-l libgnomeui-2.0`
359 GNOME_LIBDIR=`$PKGCONFIG --libs libgnomeui-2.0`
360 GNOME_LIBS=`$PKGCONFIG --libs-only-l libgnomeui-2.0`
361 AC_SUBST(GNOME_INCLUDEDIR)
362 AC_SUBST(GNOMEUI_LIBS)
363 AC_SUBST(GNOME_LIBDIR)
365 GNOME_DIR=src/gnome2-console
366 gnome_version="Version 2.x"
368 AC_MSG_ERROR(Unable to find Gnome 2 installation)
373 dnl -------------------------------------------
374 dnl bat (default off)
375 dnl -------------------------------------------
377 AC_HELP_STRING([--enable-bat], [enable build of bat Qt4 GUI @<:@default=no@:>@]),
379 if test x$enableval = xyes; then
380 AC_DEFINE(HAVE_BAT, 1, [Set if Bacula bat Qt4 GUI support enabled])
387 if test x$support_bat = xyes; then
388 abc=`$PKGCONFIG --atleast-version=4.2 QtGui`
390 if test $pkg = 0; then
391 BAT_DIR=src/qt-console
393 AC_MSG_ERROR(Unable to find Qt4 installation needed by bat)
398 dnl If bat is enabled, we need the qwt library
406 if test x$support_bat = xyes; then
407 AC_MSG_CHECKING(for qwt support)
409 AC_HELP_STRING([--with-qwt@<:@=DIR@:>@], [specify qwt library directory]),
416 if test -f ${with_qwt}/include/qwt.h; then
417 QWT_INC="${with_qwt}/include"
418 QWT_LDFLAGS="-L${with_qwt}/lib"
428 dnl Search in standard places, or --with-qwt not specified
430 if test $no_qwt = no; then
431 if test x$QWT_INC = x; then
432 for root in /usr /usr/local; do
433 for ver in qwt qwt5 qwt-qt4; do
434 if test -f ${root}/include/${ver}/qwt.h; then
435 QWT_INC="${root}/include/${ver}"
436 if test -d ${root}/lib64/; then
437 QWT_LDFLAGS="-L${root}/lib64"
438 elif test -d ${root}/lib/64/; then
439 QWT_LDFLAGS="-L${root}/64"
441 QWT_LDFLAGS="-L${root}/lib"
452 if test x$QWT_INC = x; then
455 AC_DEFINE(HAVE_QWT, 1, [Set if bat QWT library found])
462 AC_SUBST(QWT_LDFLAGS)
466 dnl -------------------------------------------
467 dnl bwx-console (default off)
468 dnl -------------------------------------------
469 AC_ARG_ENABLE(bwx-console,
470 AC_HELP_STRING([--enable-bwx-console], [enable build of wxWidgets console @<:@default=no@:>@]),
472 if test x$enableval = xyes; then
473 support_wx_console=yes
479 if test x$support_wx_console = xyes; then
480 abc=`$WXCONFIG $WXFLAGS --cppflags`
482 if test $pkg = 0; then
483 wx_version="wxWidgets `$WXCONFIG $WXFLAGS --release`"
484 WXCONS_CPPFLAGS=`$WXCONFIG $WXFLAGS --cppflags`
485 WXCONS_LDFLAGS=`$WXCONFIG $WXFLAGS --libs`
487 AC_SUBST(WXCONS_CPPFLAGS)
488 AC_SUBST(WXCONS_LDFLAGS)
489 WX_DIR="src/wx-console"
492 echo "wx-config program not found. bwx-console disabled."
494 support_wx_console=no
499 dnl -------------------------------------------
500 dnl tray-monitor (default off)
501 dnl -------------------------------------------
502 AC_ARG_ENABLE(tray-monitor,
503 AC_HELP_STRING([--enable-tray-monitor], [enable build of Gnome tray monitor (compatible with KDE @<:@default=no@:>@]),
505 if test x$enableval = xyes; then
506 support_tray_monitor=yes
512 if test x$support_tray_monitor = xyes; then
513 abc=`$PKGCONFIG --exists gtk+-2.0`
515 if test $pkg = 0; then
516 TRAY_MONITOR_CPPFLAGS=`$PKGCONFIG --cflags gtk+-2.0`
517 TRAY_MONITOR_LDFLAGS=`$PKGCONFIG --libs gtk+-2.0`
518 AC_SUBST(TRAY_MONITOR_CPPFLAGS)
519 AC_SUBST(TRAY_MONITOR_LDFLAGS)
520 TRAY_MONITOR_DIR=src/tray-monitor
521 abc=`$PKGCONFIG --atleast-version=2.4 gtk+-2.0`
523 if test $pkg = 0; then
524 AC_DEFINE(HAVE_GTK_2_4, 1, [Set if you have GTK 4.2 or greater loaded])
528 AC_SUBST(TRAY_MONITOR_DIR)
530 dnl -------------------------------------------
531 dnl smartalloc (default off)
532 dnl -------------------------------------------
533 AC_ARG_ENABLE(smartalloc,
534 AC_HELP_STRING([--enable-smartalloc], [enable smartalloc debugging support @<:@default=no@:>@]),
536 if test x$enableval = xno; then
537 support_smartalloc=no
542 if test x$support_smartalloc = xyes; then
543 AC_DEFINE(SMARTALLOC, 1, [Set if you want Smartalloc enabled])
546 dnl -------------------------------------------
547 dnl Lock Manager (default off)
548 dnl -------------------------------------------
549 AC_ARG_ENABLE(lockmgr,
550 AC_HELP_STRING([--enable-lockmgr], [enable lock manager support @<:@default=no@:>@]),
552 if test x$enableval = xyes; then
558 if test x$support_lockmgr = xyes; then
559 AC_DEFINE(_USE_LOCKMGR, 1, [Set if you want Lock Manager enabled])
563 dnl -------------------------------------------
564 dnl static-tools (default off)
565 dnl -------------------------------------------
566 AC_ARG_ENABLE(static-tools,
567 AC_HELP_STRING([--enable-static-tools], [enable static tape tools @<:@default=no@:>@]),
569 if test x$enableval = xyes; then
570 if test x$use_libtool = xyes; then
571 echo "Libtool is enabled, not compatible with static tools, please rerun configure with --disable-libtool"
574 support_static_tools=yes
580 if test x$support_static_tools = xyes; then
581 TTOOL_LDFLAGS="-static"
583 AC_SUBST(TTOOL_LDFLAGS)
585 dnl -------------------------------------------
586 dnl static-fd (default off)
587 dnl -------------------------------------------
588 AC_ARG_ENABLE(static-fd,
589 AC_HELP_STRING([--enable-static-fd], [enable static File daemon @<:@default=no@:>@]),
591 if test x$enableval = xyes; then
592 if test x$use_libtool = xyes; then
593 echo "Libtool is enabled, not compatible with static tools, please rerun configure with --disable-libtool"
596 support_static_fd=yes
602 if test x$support_static_fd = xyes; then
603 STATIC_FD="static-bacula-fd"
607 dnl -------------------------------------------
608 dnl static-sd (default off)
609 dnl -------------------------------------------
610 AC_ARG_ENABLE(static-sd,
611 AC_HELP_STRING([--enable-static-sd], [enable static Storage daemon @<:@default=no@:>@]),
613 if test x$enableval = xyes; then
614 if test x$use_libtool = xyes; then
615 echo "Libtool is enabled, not compatible with static tools, please rerun configure with --disable-libtool"
618 support_static_sd=yes
624 if test x$support_static_sd = xyes; then
625 STATIC_SD="static-bacula-sd"
629 dnl -------------------------------------------
630 dnl static-dir (default off)
631 dnl -------------------------------------------
632 AC_ARG_ENABLE(static-dir,
633 AC_HELP_STRING([--enable-static-dir], [enable static Director @<:@default=no@:>@]),
635 if test x$enableval = xyes; then
636 if test x$use_libtool = xyes; then
637 echo "Libtool is enabled, not compatible with static tools, please rerun configure with --disable-libtool"
640 support_static_dir=yes
646 if test x$support_static_dir = xyes; then
647 STATIC_DIR="static-bacula-dir"
651 dnl -------------------------------------------
652 dnl static-cons (default off)
653 dnl -------------------------------------------
654 AC_ARG_ENABLE(static-cons,
655 AC_HELP_STRING([--enable-static-cons], [enable static Console @<:@default=no@:>@]),
657 if test x$enableval = xyes; then
658 if test x$use_libtool = xyes; then
659 echo "Libtool is enabled, not compatible with static tools, please rerun configure with --disable-libtool"
662 support_static_cons=yes
670 if test x$support_static_cons = xyes; then
671 STATIC_CONS="static-bconsole"
672 STATIC_GNOME_CONS="static-bgnome-console"
673 STATIC_WX_CONS="static-bwx-console"
675 AC_SUBST(STATIC_CONS)
676 AC_SUBST(STATIC_GNOME_CONS)
677 AC_SUBST(STATIC_WX_CONS)
679 dnl -------------------------------------------
680 dnl client_only (default off)
681 dnl -------------------------------------------
682 AC_ARG_ENABLE(client-only,
683 AC_HELP_STRING([--enable-client-only], [build client (File daemon) only @<:@default=no@:>@]),
685 if test x$enableval = xyes; then
686 build_client_only=yes
692 if test x$build_client_only = xno; then
699 dnl -------------------------------------------
700 dnl director (default on)
701 dnl -------------------------------------------
702 AC_ARG_ENABLE(build-dird,
703 AC_HELP_STRING([--enable-build-dird], [enable building of dird (Director) @<:@default=yes@:>@]),
705 if test x$enableval = xno; then
710 if test x$build_dird = xyes; then
715 DIR_TOOLS="NODIRTOOLS"
720 dnl -------------------------------------------
721 dnl stored (default on)
722 dnl -------------------------------------------
723 AC_ARG_ENABLE(build-stored,
724 AC_HELP_STRING([--enable-build-stored], [enable building of stored (Storage daemon) @<:@default=yes@:>@]),
726 if test x$enableval = xno; then
731 if test x$build_stored = xyes; then
732 STORED_DIR="src/stored"
738 dnl ---------------------------------------------------
739 dnl Check for conio (Bacula readline substitute)(
740 dnl ---------------------------------------------------
741 dnl this allows you to turn it completely off
743 AC_HELP_STRING([--disable-conio], [disable conio support @<:@default=no@:>@]),
745 if test x$enableval = xno; then
752 dnl ---------------------------------------------------
753 dnl Check for IPv6 support
754 dnl ---------------------------------------------------
755 dnl this allows you to turn it completely off
758 AC_HELP_STRING([--enable-ipv6], [enable ipv6 support @<:@default=yes@:>@]),
760 if test x$enableval = xno; then
766 if test x$support_ipv6 = xyes; then
767 AC_TRY_LINK([ #include <sys/types.h>
768 #include <sys/socket.h>
769 #include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;],
770 [support_ipv6=yes], [support_ipv6=no])
773 if test x$support_ipv6 = xyes; then
774 AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
778 if test x$support_conio = xyes; then
779 AC_CHECK_HEADER(termcap.h,
780 [ AC_CHECK_LIB(termcap, tgetent,
781 [ CONS_LIBS="-ltermcap"
786 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
788 [ AC_CHECK_LIB(ncurses, tgetent,
789 [ CONS_LIBS="-lncurses"
794 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
799 AC_CHECK_HEADERS(curses.h)
800 AC_CHECK_HEADER(term.h,
801 [ AC_CHECK_LIB(curses, tgetent,
802 [ CONS_LIBS="-lcurses"
807 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
810 [ echo " "; echo "Required libraries not found. CONIO turned off ..."; echo " "],
819 dnl ---------------------------------------------------
820 dnl Check for readline support/directory (default off)
821 dnl ---------------------------------------------------
822 dnl this allows you to turn it completely off
823 AC_ARG_ENABLE(readline,
824 AC_HELP_STRING([--disable-readline], [disable readline support @<:@default=yes@:>@]),
826 if test x$enableval = xno; then
834 if test x$support_readline = xyes; then
835 AC_ARG_WITH(readline,
836 AC_HELP_STRING([--with-readline@<:@=DIR@:>@], [specify readline library directory]),
838 case "$with_readline" in
843 if test -f ${with_readline}/readline.h; then
844 CONS_INC="-I${with_readline}"
845 CONS_LDFLAGS="-L$with_readline"
846 elif test -f ${with_readline}/include/readline/readline.h; then
847 CONS_INC="-I${with_readline}/include/readline"
848 CONS_LDFLAGS="-L${with_readline}/lib"
849 with_readline="${with_readline}/include/readline"
851 with_readline="/usr/include/readline"
854 AC_CHECK_HEADER(${with_readline}/readline.h,
856 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
857 CONS_LIBS="-lreadline -lhistory -ltermcap"
861 echo "readline.h not found. readline turned off ..."
868 dnl check for standard readline library
869 AC_CHECK_HEADER(/usr/include/readline/readline.h,
871 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
873 CONS_INC="-I/usr/include/readline"
874 CONS_LIBS="-lreadline -ltermcap"
876 dnl Did not find standard library, so try Bacula's default
877 AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h,
879 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
881 CONS_INC="-I${TOP_DIR}/depkgs/readline"
882 CONS_LIBS="-lreadline -lhistory -ltermcap"
883 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
884 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
887 echo "readline.h not found. readline turned off ..."
901 AC_SUBST(CONS_LDFLAGS)
902 AC_SUBST(READLINE_SRC)
904 dnl Minimal stuff for readline Makefile configuration
909 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr lstat lchown)
910 AC_CHECK_FUNCS(nanosleep nl_langinfo)
911 AC_CHECK_HEADERS(varargs.h)
913 dnl End of readline/conio stuff
914 dnl -----------------------------------------------------------------------
916 dnl -----------------------------------------------------------------------
917 dnl Check for Python support
919 AC_MSG_CHECKING(for Python support)
921 AC_HELP_STRING([--with-python@<:@=DIR@:>@], [Include Python support. DIR is the Python base install directory, default is to search through a number of common places for the Python files.]),
925 if test "$withval" != "no"; then
926 if test "$withval" = "yes"; then
927 for python_root in /usr /usr/local /usr/sfw; do
928 for ver in python2.2 python2.3 python2.4 python2.5 python2.6 python3; do
929 if test -f $python_root/include/${ver}/Python.h; then
930 PYTHON_INCDIR=-I$python_root/include/${ver}
931 if test -d $python_root/lib64/${ver}/config; then
932 PYTHON_LIBS="-L$python_root/lib64/${ver}/config -l${ver}"
934 PYTHON_LIBS="-L$python_root/lib/${ver}/config -l${ver}"
941 if test x$PYTHON_INCDIR = x; then
942 if test -f $prefix/include/Python.h; then
943 PYTHON_INCDIR=-I$prefix/include
944 if test -d $prefix/lib64/config; then
945 PYTHON_LIBS="-L$prefix/lib64/config -lpython"
947 PYTHON_LIBS="-L$prefix/lib/config -lpython"
951 AC_MSG_ERROR(Unable to find Python.h in standard locations)
955 if test -f $withval/Python.h; then
956 PYTHON_INCDIR=-I$withval
957 PYTHON_LIBS="-L$withval/config -lpython"
958 elif test -f $withval/include/Python.h; then
959 PYTHON_INCDIR=-I$withval/include
960 if test -d $withval/lib64/config; then
961 PYTHON_LIBS="-L$withval/lib64/config -lpython"
963 PYTHON_LIBS="-L$withval/lib/config -lpython"
965 elif test -f $withval/include/python/Python.h; then
966 PYTHON_INCDIR=-I$withval/include/python
967 if test -d $withval/lib64/python/config; then
968 PYTHON_LIBS="-L$withval/lib64/python/config -lpython"
970 PYTHON_LIBS="-L$withval/lib/python/config -lpython"
974 AC_MSG_ERROR(Invalid Python directory $withval - unable to find Python.h under $withval)
978 AC_DEFINE([HAVE_PYTHON], 1)
981 AC_MSG_NOTICE(checking for more Python libs)
982 saved_LIBS="$LIBS"; LIBS=
983 AC_SEARCH_LIBS(shm_open, [rt])
984 AC_CHECK_LIB(util, openpty)
985 PYTHON_LIBS="$PYTHON_LIBS $LIBS"
994 AC_SUBST(PYTHON_LIBS)
995 AC_SUBST(PYTHON_INCDIR)
998 dnl Find where sockets are (especially for Solaris)
999 dnl Do this before the TCP Wrappers test since tcp wrappers
1000 dnl uses the socket library and some linkers are stupid.
1002 AC_CHECK_FUNC(socket,
1003 AC_MSG_RESULT(using libc's socket),
1004 AC_CHECK_LIB(xnet,socket)
1005 AC_CHECK_LIB(socket,socket)
1006 AC_CHECK_LIB(inet,socket))
1008 dnl -----------------------------------------------------------
1009 dnl Check whether user wants TCP wrappers support (default off)
1010 dnl -----------------------------------------------------------
1013 AC_ARG_WITH(tcp-wrappers,
1014 AC_HELP_STRING([--with-tcp-wrappers@<:@=DIR@:>@], [enable tcpwrappers support]),
1016 if test "x$withval" != "xno" ; then
1018 LIBS="$saved_LIBS -lwrap"
1019 AC_MSG_CHECKING(for libwrap)
1020 AC_SEARCH_LIBS(nanosleep, [rt])
1023 #include <sys/types.h>
1025 int deny_severity = 0;
1026 int allow_severity = 0;
1027 struct request_info *req;
1032 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
1037 LIBS="$saved_LIBS -lwrap -lnsl"
1038 WRAPLIBS="$saved_LIBS -lwrap -lnsl"
1041 #include <sys/types.h>
1043 int deny_severity = 0;
1044 int allow_severity = 0;
1045 struct request_info *req;
1050 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
1055 AC_MSG_ERROR([*** libwrap missing])
1064 dnl -----------------------------------------------------------
1065 dnl Check whether OpenSSL is available
1066 dnl -----------------------------------------------------------
1067 AC_MSG_CHECKING([for OpenSSL])
1068 dnl The following uses quadrigraphs:
1071 AC_ARG_WITH(openssl,
1072 AC_HELP_STRING([--with-openssl@<:@=DIR@:>@], [Include OpenSSL support. DIR is the OpenSSL base]),
1074 with_openssl_directory=${withval}
1078 if test "x$with_openssl_directory" != "xno"; then
1079 OPENSSL_LIBS="-lssl -lcrypto"
1082 if test "x$with_openssl_directory" != "xyes" && test x"${with_openssl_directory}" != "x"; then
1084 # Make sure the $with_openssl_directory also makes sense
1086 if test -d "$with_openssl_directory/lib" -a -d "$with_openssl_directory/include"; then
1087 OPENSSL_LIBS="-L$with_openssl_directory/lib $OPENSSL_LIBS"
1088 OPENSSL_INC="-I$with_openssl_directory/include $OPENSSL_INC"
1092 saved_LIBS="${LIBS}"
1093 saved_CFLAGS="${CFLAGS}"
1094 LIBS="${saved_LIBS} ${OPENSSL_LIBS}"
1095 CFLAGS="${saved_CFLAGS} ${OPENSSL_INC}"
1099 #include <openssl/ssl.h>
1101 CRYPTO_set_id_callback(NULL);
1104 support_crypto="yes"
1112 #include <openssl/evp.h>
1116 ac_cv_openssl_sha2="yes"
1118 ac_cv_openssl_sha2="no"
1122 dnl Solaris disables greater than 128+ bit encryption in their OpenSSL
1123 dnl implementation, presumably for export reasons. If 192bit AES
1124 dnl is available, we assume that we're running with a 'non-export'
1125 dnl openssl library.
1128 #include <openssl/evp.h>
1132 ac_cv_openssl_export="no"
1134 ac_cv_openssl_export="yes"
1138 LIBS="${saved_LIBS}"
1139 CFLAGS="${saved_CFLAGS}"
1141 if test "$support_tls" = "yes"; then
1142 AC_DEFINE(HAVE_OPENSSL, 1, [Define if OpenSSL library is available])
1143 AC_DEFINE(HAVE_TLS, 1, [Define if TLS support should be enabled])
1144 AC_DEFINE(HAVE_CRYPTO, 1, [Define if encryption support should be enabled])
1147 if test "$ac_cv_openssl_sha2" = "yes"; then
1148 AC_DEFINE(HAVE_SHA2, 1, [Define if the SHA-2 family of digest algorithms is available])
1151 if test "$ac_cv_openssl_export" = "yes"; then
1152 AC_DEFINE(HAVE_OPENSSL_EXPORT_LIBRARY, 1, [Define if the OpenSSL library is export-contrained to 128bit ciphers])
1161 AC_MSG_RESULT([$support_tls])
1162 AC_SUBST(OPENSSL_LIBS)
1163 AC_SUBST(OPENSSL_INC)
1165 dnl -----------------------------------------------------------
1166 dnl dlopen is needed for plugins
1167 dnl -----------------------------------------------------------
1168 AC_SEARCH_LIBS(dlopen, [dl])
1170 dnl ------------------------------------------
1171 dnl Where to place working dir
1172 dnl ------------------------------------------
1173 working_dir=`eval echo ${prefix}/var/bacula/working`
1174 AC_ARG_WITH(working-dir,
1175 AC_HELP_STRING([--with-working-dir=PATH], [specify path of Bacula working directory]),
1177 if test "x$withval" != "xno" ; then
1178 working_dir=$withval
1183 AC_SUBST(working_dir)
1185 dnl ------------------------------------------------------------------
1186 dnl If the user has not set archivedir, we set our default as /tmp
1187 dnl ------------------------------------------------------------------
1189 AC_ARG_WITH(archivedir,
1190 AC_HELP_STRING([--with-archivedir=PATH], [specify path of SD archive directory]),
1192 if test "x$withval" != "xno" ; then
1198 AC_SUBST(archivedir)
1200 dnl ------------------------------------------
1201 dnl Where to place scriptdir (script files)
1202 dnl ------------------------------------------
1203 scriptdir=`eval echo ${sysconfdir}`
1204 AC_ARG_WITH(scriptdir,
1205 AC_HELP_STRING([--with-scriptdir=PATH], [specify path of Bacula scripts directory]),
1207 if test "x$withval" != "xno" ; then
1215 # ------------------------------------------
1216 # Where to place plugindir (plugin files)
1217 # ------------------------------------------
1218 plugindir=`eval echo ${sysconfdir}`
1219 AC_ARG_WITH(plugindir,
1220 AC_HELP_STRING([--with-plugindir=PATH], [specify path of Bacula plugins directory]),
1222 if test "x$withval" != "xno" ; then
1230 dnl ------------------------------------------
1231 dnl Where to send dump email
1232 dnl ------------------------------------------
1233 dump_email=root@localhost
1234 AC_ARG_WITH(dump-email,
1235 AC_HELP_STRING([--with-dump-email=EMAIL], [dump email address]),
1237 if test "x$withval" != "xno" ; then
1243 AC_SUBST(dump_email)
1245 dnl ------------------------------------------
1246 dnl Where to send job email
1247 dnl ------------------------------------------
1248 job_email=root@localhost
1249 AC_ARG_WITH(job-email,
1250 AC_HELP_STRING([--with-job-email=EMAIL], [job output email address]),
1252 if test "x$withval" != "xno" ; then
1260 dnl ------------------------------------------
1261 dnl Where to find smtp host
1262 dnl ------------------------------------------
1264 AC_ARG_WITH(smtp_host,
1265 AC_HELP_STRING([--with-smtp-host=HOST], [SMTP mail host address]),
1267 if test "x$withval" != "xno" ; then
1275 dnl ------------------------------------
1276 dnl Where to place pid files
1277 dnl ------------------------------------
1279 AC_ARG_WITH(pid-dir,
1280 AC_HELP_STRING([--with-pid-dir=PATH], [specify location of Bacula pid files]),
1282 if test "x$withval" != "xno" ; then
1288 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
1291 dnl ------------------------------------
1292 dnl Where to place subsys "lock file"
1293 dnl ------------------------------------
1294 subsysdir=/var/run/subsys
1295 if test -d /var/run/subsys; then
1296 subsysdir=/var/run/subsys
1297 elif test -d /var/lock/subsys; then
1298 subsysdir=/var/lock/subsys
1300 subsysdir=/var/run/subsys
1302 AC_ARG_WITH(subsys-dir,
1303 AC_HELP_STRING([--with-subsys-dir=PATH], [specify location of Bacula subsys file]),
1305 if test "x$withval" != "xno" ; then
1313 dnl ------------------------------------
1314 dnl Where to start assigning ports
1315 dnl ------------------------------------
1317 AC_ARG_WITH(baseport,
1318 AC_HELP_STRING([--with-baseport=PORT], [specify base port address for daemons]),
1320 if test "x$withval" != "xno" ; then
1327 dir_port=`expr $baseport`
1328 fd_port=`expr $baseport + 1`
1329 sd_port=`expr $fd_port + 1`
1335 dnl ------------------------------------------
1336 dnl Generate passwords
1337 dnl ------------------------------------------
1339 AC_ARG_WITH(dir-password,
1340 AC_HELP_STRING([--with-dir-password=PASSWORD], [specify Director's password]),
1342 if test "x$withval" != "xno" ; then
1343 dir_password=$withval
1348 if test "x$dir_password" = "x" ; then
1349 if test "x$OPENSSL" = "xnone" ; then
1350 key=`autoconf/randpass 33`
1352 key=`openssl rand -base64 33`
1358 AC_ARG_WITH(fd-password,
1359 AC_HELP_STRING([--with-fd-password=PASSWORD], [specify Client's password]),
1361 if test "x$withval" != "xno" ; then
1362 fd_password=$withval
1367 if test "x$fd_password" = "x" ; then
1368 if test "x$OPENSSL" = "xnone" ; then
1369 key=`autoconf/randpass 37`
1371 key=`openssl rand -base64 33`
1377 AC_ARG_WITH(sd-password,
1378 AC_HELP_STRING([--with-sd-password=PASSWORD], [specify Storage daemon's password]),
1380 if test "x$withval" != "xno" ; then
1381 sd_password=$withval
1386 if test "x$sd_password" = "x" ; then
1387 if test "x$OPENSSL" = "xnone" ; then
1388 key=`autoconf/randpass 41`
1390 key=`openssl rand -base64 33`
1396 AC_ARG_WITH(mon-dir-password,
1397 AC_HELP_STRING([--with-mon-dir-password=PASSWORD], [specify Director's password used by the monitor]),
1399 if test "x$withval" != "xno" ; then
1400 mon_dir_password=$withval
1405 if test "x$mon_dir_password" = "x" ; then
1406 if test "x$OPENSSL" = "xnone" ; then
1407 key=`autoconf/randpass 33`
1409 key=`openssl rand -base64 33`
1411 mon_dir_password=$key
1415 AC_ARG_WITH(mon-fd-password,
1416 AC_HELP_STRING([--with-mon-fd-password=PASSWORD], [specify Client's password used by the monitor]),
1418 if test "x$withval" != "xno" ; then
1419 mon_fd_password=$withval
1424 if test "x$mon_fd_password" = "x" ; then
1425 if test "x$OPENSSL" = "xnone" ; then
1426 key=`autoconf/randpass 37`
1428 key=`openssl rand -base64 33`
1430 mon_fd_password=$key
1434 AC_ARG_WITH(mon-sd-password,
1435 AC_HELP_STRING([--with-mon-sd-password=PASSWORD], [specify Storage daemon's password used by the monitor]),
1437 if test "x$withval" != "xno" ; then
1438 mon_sd_password=$withval
1443 if test "x$mon_sd_password" = "x" ; then
1444 if test "x$OPENSSL" = "xnone" ; then
1445 key=`autoconf/randpass 41`
1447 key=`openssl rand -base64 33`
1449 mon_sd_password=$key
1452 AC_SUBST(dir_password)
1453 AC_SUBST(fd_password)
1454 AC_SUBST(sd_password)
1455 AC_SUBST(mon_dir_password)
1456 AC_SUBST(mon_fd_password)
1457 AC_SUBST(mon_sd_password)
1460 dnl Pickup any database name
1463 AC_ARG_WITH(db_name,
1464 AC_HELP_STRING([--with-db-name=DBNAME], [specify database name @<:@default=bacula@:>@]),
1466 if test "x$withval" != "x" ; then
1474 AC_ARG_WITH(db_user,
1475 AC_HELP_STRING([--with-db-user=UNAME], [specify database user @<:@default=bacula@:>@]),
1477 if test "x$withval" != "x" ; then
1485 AC_ARG_WITH(db_password,
1486 AC_HELP_STRING([--with-db-password=PWD], [specify database password @<:@default=*none*@:>@]),
1488 if test "x$withval" != "x" ; then
1489 db_password=$withval
1493 AC_SUBST(db_password)
1496 dnl Pickup a database port
1499 AC_ARG_WITH(db_port,
1500 AC_HELP_STRING([--with-db-port=DBPORT], [specify a database port @<:@default=null@:>@]),
1502 if test "x$withval" != "x" ; then
1510 # Handle users and groups for each daemon
1513 AC_ARG_WITH(dir_user,
1514 AC_HELP_STRING([--with-dir-user=USER], [specify user for Director daemon]),
1516 if test "x$withval" != "x" ; then
1523 AC_ARG_WITH(dir_group,
1524 AC_HELP_STRING([--with-dir-group=GROUP], [specify group for Director daemon]),
1526 if test "x$withval" != "x" ; then
1533 AC_ARG_WITH(sd_user,
1534 AC_HELP_STRING([--with-sd-user=USER], [specify user for Storage daemon]),
1536 if test "x$withval" != "x" ; then
1543 AC_ARG_WITH(sd_group,
1544 AC_HELP_STRING([--with-sd-group=GROUP], [specify group for Storage daemon]),
1546 if test "x$withval" != "x" ; then
1553 AC_ARG_WITH(fd_user,
1554 AC_HELP_STRING([--with-fd-user=USER], [specify user for File daemon]),
1556 if test "x$withval" != "x" ; then
1563 AC_ARG_WITH(fd_group,
1564 AC_HELP_STRING([--with-fd-group=GROUP], [specify group for File daemon]),
1566 if test "x$withval" != "x" ; then
1580 dnl allow setting default executable permissions
1583 AC_ARG_WITH(sbin-perm,
1584 AC_HELP_STRING([--with-sbin-perm=MODE], [specify permissions for sbin binaries @<:@default=0754@:>@]),
1586 if test "x$withval" != "x" ; then
1594 dnl ------------------------------------------------
1595 dnl Bacula check for various SQL database engines
1596 dnl ------------------------------------------------
1598 BA_CHECK_POSTGRESQL_DB
1613 dnl -------------------------------------------
1614 dnl enable batch attribute DB insert (default on)
1615 dnl -------------------------------------------
1616 support_batch_insert=no
1617 A=`test -f $SQL_LIB && nm $SQL_LIB | grep pthread_mutex_lock`
1619 if test $pkg = 0; then
1620 support_batch_insert=yes
1621 AC_ARG_ENABLE(batch-insert,
1622 AC_HELP_STRING([--enable-batch-insert], [enable the DB batch insert code @<:@default=no@:>@]),
1624 if test x$enableval = xno; then
1625 support_batch_insert=no
1627 support_batch_insert=yes
1633 dnl Check if postgresql support batch mode
1634 if test x$DB_TYPE = xpostgresql; then
1635 A=`test -f $SQL_LIB && nm $SQL_LIB | grep PQputCopyData`
1637 if test $pkg != 0; then
1638 support_batch_insert=no
1642 if test x$DB_TYPE = xdbi; then
1646 dnl Check for batch insert
1647 if test $DB_PROG = postgresql; then
1648 A=`test -f $SQL_LIB && nm $SQL_LIB | grep PQputCopyData`
1652 if test $DB_PROG = mysql; then
1653 A=`test -f $SQL_LIB && nm $DB_PROG_LIB | grep pthread_mutex_lock`
1657 if test $DB_PROG = sqlite3; then
1658 A=`test -f $SQL_LIB && nm $DB_PROG_LIB | grep pthread_mutex_lock`
1662 if test $pkg = 0; then
1663 AC_ARG_ENABLE(batch-insert,
1664 AC_HELP_STRING([--enable-batch-insert], [enable the DB batch insert code @<:@default=no@:>@]),
1666 if test x$enableval = xno; then
1667 support_batch_insert=no
1669 support_batch_insert=yes
1675 dnl If dbi was not chosen, let the comment in file
1679 AC_SUBST(uncomment_dbi)
1681 if test $support_batch_insert = yes ; then
1682 AC_DEFINE(HAVE_BATCH_FILE_INSERT, 1, [Set if DB batch insert code enabled])
1685 AC_DEFINE(PROTOTYPES)
1687 dnl --------------------------------------------------------------------------
1688 dnl Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
1690 if test -z "$CFLAGS" -o "$CFLAGS" = "-g -O2"; then
1691 if test -z "$CCOPTS"; then
1692 CCOPTS='-g -O2 -Wall'
1700 dnl See if we can use 64 bit file addresses
1701 largefile_support="no"
1706 dnl --------------------------------------------------------------------------
1707 dnl CHECKING FOR HEADER FILES
1708 dnl --------------------------------------------------------------------------
1746 AC_STRUCT_ST_BLKSIZE
1750 dnl --------------------------------------------------------------------------
1751 dnl Check for utime.h structure
1752 dnl --------------------------------------------------------------------------
1753 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
1757 #include <sys/types.h>
1762 ba_cv_header_utime_h=yes
1764 ba_cv_header_utime_h=no
1769 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H, 1, [Set if utime.h exists])
1771 dnl --------------------------------------------------------------------------
1772 dnl Check for socklen_t
1773 dnl --------------------------------------------------------------------------
1774 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
1778 #include <sys/types.h>
1779 #include <sys/socket.h>
1783 ba_cv_header_socklen_t=yes
1785 ba_cv_header_socklen_t=no
1790 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T)
1792 dnl --------------------------------------------------------------------------
1793 dnl Check for bigendian
1794 dnl --------------------------------------------------------------------------
1795 AC_CACHE_CHECK([for bigendian], ba_cv_bigendian,
1799 main(){long a=1L; char *p=(char *)&a; exit(*p);}
1810 test $ba_cv_bigendian = yes && AC_DEFINE(HAVE_BIGENDIAN)
1812 dnl --------------------------------------------------------------------------
1813 dnl Check for typeof()
1814 dnl --------------------------------------------------------------------------
1816 AC_CACHE_CHECK(for typeof, ba_cv_have_typeof,
1820 main(){char *a = 0; a = (typeof a)a;}
1822 ba_cv_have_typeof=yes
1824 ba_cv_have_typeof=no
1826 ba_cv_have_typeof=no
1831 test $ba_cv_have_typeof = yes && AC_DEFINE([HAVE_TYPEOF], 1, [Defind to 1 if compiler has typeof])
1836 dnl --------------------------------------------------------------------------
1837 dnl CHECKING FOR FILESYSTEM TYPE
1838 dnl --------------------------------------------------------------------------
1839 AC_MSG_CHECKING(how to get filesystem type)
1841 # The order of these tests is important.
1844 #include <sys/statvfs.h>
1845 #include <sys/fstyp.h>
1847 AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4
1849 if test $fstype = no; then
1852 #include <sys/statfs.h>
1853 #include <sys/fstyp.h>
1855 AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3
1858 if test $fstype = no; then
1861 #include <sys/statfs.h>
1862 #include <sys/vmount.h>
1864 AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX
1867 if test $fstype = no; then
1872 AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD
1875 if test $fstype = no; then
1876 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
1878 if test $fstype = no; then
1881 #include <sys/mount.h>
1882 #include <sys/fs_types.h>
1884 AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix
1887 AC_MSG_RESULT($fstype)
1889 AC_CHECK_HEADER(sys/statvfs.h, [ AC_DEFINE(HAVE_SYS_STATVFS_H,1,[Defines if your system have the sys/statvfs.h header file])] , )
1891 dnl --------------------------------------------------------------------------
1892 dnl CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
1893 dnl --------------------------------------------------------------------------
1903 AC_CHECK_TYPE(ino_t, unsigned long)
1904 AC_CHECK_TYPE(dev_t, unsigned long)
1905 AC_CHECK_TYPE(daddr_t, long)
1906 AC_CHECK_TYPE(major_t, int)
1907 AC_CHECK_TYPE(minor_t, int)
1908 AC_CHECK_TYPE(ssize_t, int)
1914 AC_CHECK_SIZEOF(char, 1)
1915 AC_CHECK_SIZEOF(short int, 2)
1916 AC_CHECK_SIZEOF(int, 4)
1917 AC_CHECK_SIZEOF(long int, 4)
1918 AC_CHECK_SIZEOF(long long int, 8)
1919 AC_CHECK_SIZEOF(int *, 4)
1921 dnl Check for sys/types.h types
1922 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int,
1926 #include <sys/types.h>
1930 ac_cv_have_u_int="yes"
1932 ac_cv_have_u_int="no"
1937 if test "x$ac_cv_have_u_int" = "xyes" ; then
1938 AC_DEFINE(HAVE_U_INT)
1942 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t,
1946 #include <sys/types.h>
1950 ac_cv_have_intmax_t="yes"
1958 ac_cv_have_intmax_t="yes"
1960 ac_cv_have_intmax_t="no"
1967 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
1968 AC_DEFINE(HAVE_INTMAX_T)
1972 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t,
1976 #include <sys/types.h>
1978 u_intmax_t a; a = 1;
1980 ac_cv_have_u_intmax_t="yes"
1986 u_intmax_t a; a = 1;
1988 ac_cv_have_u_intmax_t="yes"
1990 ac_cv_have_u_intmax_t="no"
1997 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
1998 AC_DEFINE(HAVE_U_INTMAX_T)
2002 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t,
2006 #include <sys/types.h>
2008 int8_t a; int16_t b; int32_t c; a = b = c = 1;
2010 ac_cv_have_intxx_t="yes"
2012 ac_cv_have_intxx_t="no"
2017 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
2018 AC_DEFINE(HAVE_INTXX_T)
2022 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t,
2026 #include <sys/types.h>
2030 ac_cv_have_int64_t="yes"
2032 ac_cv_have_int64_t="no"
2037 if test "x$ac_cv_have_int64_t" = "xyes" ; then
2038 AC_DEFINE(HAVE_INT64_T)
2042 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t,
2046 #include <sys/types.h>
2048 u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;
2050 ac_cv_have_u_intxx_t="yes"
2052 ac_cv_have_u_intxx_t="no"
2057 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
2058 AC_DEFINE(HAVE_U_INTXX_T)
2062 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t,
2066 #include <sys/types.h>
2070 ac_cv_have_u_int64_t="yes"
2072 ac_cv_have_u_int64_t="no"
2077 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
2078 AC_DEFINE(HAVE_U_INT64_T)
2082 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
2083 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2085 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
2088 #include <sys/bitypes.h>
2090 int8_t a; int16_t b; int32_t c;
2091 u_int8_t e; u_int16_t f; u_int32_t g;
2092 a = b = c = e = f = g = 1;
2094 AC_DEFINE(HAVE_U_INTXX_T)
2095 AC_DEFINE(HAVE_INTXX_T)
2096 AC_DEFINE(HAVE_SYS_BITYPES_H)
2104 if test -z "$have_u_intxx_t" ; then
2105 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t,
2109 #include <sys/types.h>
2111 uint8_t a; uint16_t b;
2112 uint32_t c; a = b = c = 1;
2114 ac_cv_have_uintxx_t="yes"
2116 ac_cv_have_uintxx_t="no"
2121 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
2122 AC_DEFINE(HAVE_UINTXX_T)
2126 if (test -z "$have_u_int64_t" || test -z "$have_int64_t" && \
2127 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2129 AC_MSG_CHECKING([for int64_t and u_int64_t types in sys/bitypes.h])
2132 #include <sys/bitypes.h>
2134 int64_t a; u_int64_t b;
2137 AC_DEFINE(HAVE_U_INT64_T)
2138 AC_DEFINE(HAVE_INT64_T)
2146 if (test -z "$have_uintxx_t" && \
2147 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2149 AC_MSG_CHECKING([for uintXX_t types in sys/bitypes.h])
2152 #include <sys/bitypes.h>
2154 uint8_t a; uint16_t b;
2155 uint32_t c; a = b = c = 1;
2157 AC_DEFINE(HAVE_UINTXX_T)
2165 dnl --------------------------------------------------------------------------
2166 dnl CHECKING FOR REQUIRED LIBRARY FUNCTIONS
2167 dnl --------------------------------------------------------------------------
2183 [echo 'configure: cannot find needed function.'; exit 1]
2186 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
2187 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
2188 AC_CHECK_FUNCS(posix_fadvise)
2189 AC_CHECK_FUNCS(fdatasync)
2191 AC_CHECK_FUNCS(chflags)
2193 AC_CHECK_FUNCS(snprintf vsnprintf gethostid fseeko)
2195 AC_CACHE_CHECK(for va_copy, ba_cv_va_copy,
2200 void use_va_copy(va_list args){va_list args2; va_copy(args2,args); va_end(args2);}
2201 void call_use_va_copy(int junk,...){va_list args; va_start(args,junk); use_va_copy(args); va_end(args);}
2203 call_use_va_copy(1,2,3)
2212 test $ba_cv_va_copy = yes && AC_DEFINE(HAVE_VA_COPY, 1, [Set if va_copy exists])
2214 dnl --------------------------------------------------------------------------
2215 dnl CHECKING FOR THREAD SAFE FUNCTIONS
2216 dnl --------------------------------------------------------------------------
2217 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
2219 # If resolver functions are not in libc check for -lnsl or -lresolv.
2220 AC_CHECK_FUNC(gethostbyname_r,
2221 AC_MSG_RESULT(using libc's resolver),
2222 AC_CHECK_LIB(nsl,gethostbyname_r)
2223 AC_CHECK_LIB(resolv,gethostbyname_r))
2225 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
2226 AC_CHECK_FUNCS(inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)])
2227 AC_CHECK_FUNCS(gethostbyname2, [AC_DEFINE(HAVE_GETHOSTBYNAME2)])
2229 dnl ----------------------------
2230 dnl check sa_len of sockaddr
2231 dnl ----------------------------
2232 AC_CACHE_CHECK(for struct sockaddr has a sa_len field, ac_cv_struct_sockaddr_sa_len,
2236 #include <sys/socket.h>
2238 struct sockaddr s; s.sa_len;
2240 ac_cv_struct_sockaddr_sa_len=yes
2241 ], [ac_cv_struct_sockaddr_sa_len=no
2247 if test $ac_cv_struct_sockaddr_sa_len = yes; then
2248 AC_DEFINE(HAVE_SA_LEN, 1, [Define if sa_len field exists in struct sockaddr])
2255 AC_FUNC_CLOSEDIR_VOID
2256 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
2257 # AC_FUNC_FNMATCH dnl use local version
2259 AC_CHECK_LIB(intl, gettext, [LIBS="$LIBS -lintl"])
2261 AC_CHECK_LIB(sun, getpwnam)
2263 AC_CHECK_HEADERS(zlib.h)
2264 AC_CHECK_LIB(z, deflate, [FDLIBS="-lz"])
2266 if test x$FDLIBS = x-lz; then
2267 AC_DEFINE(HAVE_LIBZ)
2272 dnl Check for ACL support and libraries
2276 AC_HELP_STRING([--disable-acl], [disable acl support @<:@default=auto@:>@]),
2278 if test x$enableval = xno; then
2285 have_extended_acl=no
2286 if test x$support_acl = xyes; then
2287 AC_CHECK_HEADER(sys/acl.h, [ AC_DEFINE(HAVE_SYS_ACL_H,1,[Defines if your system have the sys/acl.h header file])] , )
2288 AC_CHECK_FUNC(acl_get_file,
2292 AC_CHECK_LIB(acl, acl_get_file,
2295 FDLIBS="-lacl $FDLIBS"
2297 AC_CHECK_LIB(pacl, acl_get_file,
2300 FDLIBS="-lpacl $FDLIBS"
2302 AC_CHECK_LIB(sec, acltotext,
2305 FDLIBS="-lsec $FDLIBS"
2307 AC_CHECK_LIB(sec, acl_totext,
2309 have_extended_acl=yes
2320 if test $have_acl = yes; then
2321 AC_DEFINE([HAVE_ACL], [], [Normal attribute support])
2324 if test $have_extended_acl = yes; then
2325 AC_DEFINE([HAVE_EXTENDED_ACL], [], [Extended attribute support])
2330 dnl Check for XATTR support
2333 AC_ARG_ENABLE(xattr,
2334 AC_HELP_STRING([--disable-xattr], [disable xattr support @<:@default=auto@:>@]),
2336 if test x$enableval = xno; then
2343 if test x$support_xattr = xyes; then
2344 AC_CHECK_HEADER(sys/xattr.h, [ AC_DEFINE(HAVE_SYS_XATTR_H,1,[Defines if your system have the sys/xattr.h header file])] , )
2345 AC_CHECK_FUNCS(llistxattr lgetxattr lsetxattr,
2348 AC_DEFINE([HAVE_LLISTXATTR], [], [LLISTXATTR support])
2349 AC_DEFINE([HAVE_LGETXATTR], [], [LGETXATTR support])
2350 AC_DEFINE([HAVE_LSETXATTR], [], [LSETXATTR support])
2357 if test $have_xattr = no; then
2358 AC_CHECK_FUNCS(listxattr getxattr setxattr,
2361 AC_DEFINE([HAVE_LLISTXATTR], [], [LLISTXATTR support])
2362 AC_DEFINE([HAVE_LGETXATTR], [], [LGETXATTR support])
2363 AC_DEFINE([HAVE_LSETXATTR], [], [LSETXATTR support])
2371 if test $have_xattr = no; then
2372 AC_CHECK_HEADER(sys/attr.h, [ AC_DEFINE(HAVE_SYS_ATTR_H,1,[Defines if your system have the sys/attr.h header file])] , )
2373 AC_CHECK_HEADER(sys/nvpair.h, [ AC_DEFINE(HAVE_SYS_NVPAIR_H,1,[Defines if your system have the sys/nvpair.h header file])] , )
2374 AC_CHECK_HEADER(attr.h, [ AC_DEFINE(HAVE_ATTR_H,1,[Defines if your system have the attr.h header file])] , )
2376 AC_CHECK_FUNCS(openat fstatat unlinkat fchownat futimesat,
2379 AC_DEFINE([HAVE_OPENAT], [], [OPENAT support])
2380 AC_DEFINE([HAVE_FSTATAT], [], [FSTATAT support])
2381 AC_DEFINE([HAVE_UNLINKAT], [], [UNLINKAT support])
2382 AC_DEFINE([HAVE_FCHOWNAT], [], [FCHOWNAT support])
2383 AC_DEFINE([HAVE_FUTIMESAT], [], [FUTIMESAT support])
2387 if test $have_xattr = yes; then
2388 AC_CHECK_LIB(nvpair, nvlist_next_nvpair,
2390 FDLIBS="-lnvpair $FDLIBS"
2396 if test $have_xattr = yes; then
2397 AC_DEFINE([HAVE_XATTR], [], [XATTR support])
2402 dnl Check for pthread libraries
2405 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
2407 AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
2409 AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
2411 AC_CHECK_FUNC(pthread_create)
2424 if test x$have_gcc = xyes ; then
2425 CPPFLAGS="$CPPFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
2426 CFLAGS="$CFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
2428 LDFLAGS=${LDFLAGS--O}
2429 DB_LIBS="${SQL_LFLAGS}"
2430 CPPFLAGS="$CPPFLAGS"
2443 AC_SUBST(X_EXTRA_LIBS)
2448 dnl extra configurable objects
2459 dnl Finally we set appropriate distribution specific
2460 dnl variables and defaults
2462 dnl PFILES are platform specific files
2463 PFILES="platforms/Makefile"
2467 hostname=`uname -n | cut -d '.' -f 1`
2468 if test x${hostname} = x ; then
2469 hostname="localhost"
2474 PSCMD="ps -e -o pid,comm"
2476 platforms/aix/Makefile"
2477 TAPEDRIVE="/dev/rmt0.1"
2481 PTHREAD_LIB="-lpthread -lexc"
2482 if test "${CC}" = "gcc" ; then
2489 TAPEDRIVE="/dev/nrmt0"
2492 DISTVER=`uname -a |awk '{print $3}'`
2493 TAPEDRIVE="/dev/nrmt0"
2494 PTHREAD_LIB="-pthread"
2495 CFLAGS="${CFLAGS} -pthread"
2496 PSCMD="ps -ax -o pid,command"
2500 platforms/bsdi/Makefile \
2501 platforms/bsdi/bacula-fd \
2502 platforms/bsdi/bacula-sd \
2503 platforms/bsdi/bacula-dir"
2504 largefile_support="yes"
2507 DISTVER=`uname -a |awk '{print $3}'`
2508 TAPEDRIVE="/dev/nrst0"
2511 WLDFLAGS="-mwindows"
2515 TAPEDRIVE="/dev/nst0"
2516 PSCMD="ps -e -o pid,command"
2519 platforms/darwin/Makefile"
2522 dnl Make sure hostname is resolved
2523 ping -c 1 $hostname 2>&1 1>/dev/null
2524 if test ! $? = 0; then
2525 hostname="localhost"
2527 if `test -f /etc/apt/sources.list && grep -q ubuntu /etc/apt/sources.list`; then
2530 DISTVER=`cat /etc/debian_version`
2531 if test -f /etc/lsb-release ; then
2533 if test "x$DISTRIB_ID" != "x" ; then
2534 DISTNAME=$DISTRIB_ID
2536 if test "x$DISTRIB_RELEASE" != "x" ; then
2537 DISTVER=$DISTRIB_RELEASE
2540 if test "$DISTNAME" = "Ubuntu" ; then
2543 TAPEDRIVE="/dev/nst0"
2544 PSCMD="ps -e -o pid,command"
2545 if test "$DISTNAME" = "ubuntu" ; then
2547 platforms/ubuntu/Makefile \
2548 platforms/ubuntu/bacula-fd \
2549 platforms/ubuntu/bacula-sd \
2550 platforms/ubuntu/bacula-dir"
2553 platforms/debian/Makefile \
2554 platforms/debian/bacula-fd \
2555 platforms/debian/bacula-sd \
2556 platforms/debian/bacula-dir"
2560 dnl Make sure hostname is resolved
2561 ping -c 1 $hostname 2>&1 1>/dev/null
2562 if test ! $? = 0; then
2563 hostname="localhost"
2565 DISTVER=`uname -a |awk '{print $3}'`
2566 VER=`echo $DISTVER | cut -c 1`
2567 if test x$VER = x4 ; then
2568 PTHREAD_LIB="${PTHREAD_LIBS:--pthread}"
2569 CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS:--pthread}"
2573 TAPEDRIVE="/dev/nrsa0"
2574 PSCMD="ps -ax -o pid,command"
2576 platforms/freebsd/Makefile \
2577 platforms/freebsd/bacula-fd \
2578 platforms/freebsd/bacula-sd \
2579 platforms/freebsd/bacula-dir"
2580 largefile_support="yes"
2583 PSCMD="UNIX95=1; ps -e -o pid,comm"
2584 CFLAGS="${CFLAGS} -D_XOPEN_SOURCE_EXTENDED=1"
2586 TAPEDRIVE="/dev/rmt/0hnb"
2587 PTHREAD_LIB="-lpthread"
2588 AC_DEFINE([_INCLUDE_LONGLONG])
2592 TAPEDRIVE="/dev/rmt/0cbn"
2593 PSCMD="ps -e -o pid,comm"
2595 platforms/irix/Makefile \
2596 platforms/irix/bacula-fd \
2597 platforms/irix/bacula-sd \
2598 platforms/irix/bacula-dir"
2601 DISTVER=`uname -a |awk '{print $3}'`
2604 TAPEDRIVE="/dev/nrst0"
2605 PSCMD="ps -ax -o pid,command"
2606 PTHREAD_LIB="-pthread"
2607 CFLAGS="${CFLAGS} -pthread"
2610 DISTVER=`uname -a |awk '{print $3}'`
2613 TAPEDRIVE="/dev/nrst0"
2614 PSCMD="ps -ax -o pid,command"
2615 PTHREAD_LIB="-pthread"
2616 CFLAGS="${CFLAGS} -pthread"
2618 platforms/openbsd/Makefile \
2619 platforms/openbsd/bacula-fd \
2620 platforms/openbsd/bacula-sd \
2621 platforms/openbsd/bacula-dir"
2624 dnl Make sure hostname is resolved
2625 ping -c 1 $hostname 2>&1 1>/dev/null
2626 if test ! $? = 0; then
2627 hostname="localhost"
2629 if test -f /etc/whitebox-release ; then
2630 f=/etc/whitebox-release
2632 f=/etc/redhat-release
2634 if test `cat $f | grep release |\
2635 cut -f 3 -d ' '`x = "Enterprise"x ; then
2636 DISTVER="Enterprise "`cat $f | grep release |\
2639 DISTVER=`cat /etc/redhat-release | grep release |\
2642 TAPEDRIVE="/dev/nst0"
2643 PSCMD="ps -e -o pid,command"
2645 platforms/redhat/Makefile \
2646 platforms/redhat/bacula-fd \
2647 platforms/redhat/bacula-sd \
2648 platforms/redhat/bacula-dir \
2649 platforms/redhat/bacula.spec \
2653 dnl Make sure hostname is resolved
2654 ping -c 1 $hostname 2>&1 1>/dev/null
2655 if test ! $? = 0; then
2656 hostname="localhost"
2658 DISTVER=`cat /etc/mandrake-release | grep release |\
2660 TAPEDRIVE="/dev/nst0"
2661 PSCMD="ps -e -o pid,command"
2663 platforms/mandrake/Makefile \
2664 platforms/mandrake/bacula-fd \
2665 platforms/mandrake/bacula-sd \
2666 platforms/mandrake/bacula-dir \
2667 platforms/mandrake/bacula.spec \
2671 dnl Make sure hostname is resolved
2672 ping -c 1 $hostname 2>&1 1>/dev/null
2673 if test ! $? = 0; then
2674 hostname="localhost"
2676 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
2677 TAPEDRIVE="/dev/nst0"
2678 PSCMD="ps -e -o pid,command"
2680 platforms/gentoo/Makefile \
2681 platforms/gentoo/bacula-init \
2682 platforms/gentoo/bacula-fd \
2683 platforms/gentoo/bacula-sd \
2684 platforms/gentoo/bacula-dir"
2687 dnl Make sure hostname is resolved
2688 ping -c 1 $hostname 2>&1 1>/dev/null
2689 if test ! $? = 0; then
2690 hostname="localhost"
2692 DISTVER=`cat /etc/slackware-version`
2693 TAPEDRIVE="/dev/nst0"
2694 PSCMD="ps -e -o pid,command"
2696 platforms/slackware/Makefile \
2697 platforms/slackware/rc.bacula-fd \
2698 platforms/slackware/rc.bacula-sd \
2699 platforms/slackware/rc.bacula-dir\
2700 platforms/slackware/functions.bacula"
2704 TAPEDRIVE="/dev/rmt/0cbn"
2705 PSCMD="ps -e -o pid,comm"
2707 platforms/solaris/Makefile \
2708 platforms/solaris/bacula-fd \
2709 platforms/solaris/bacula-sd \
2710 platforms/solaris/bacula-dir"
2711 if test x$DISTVER = x5.6 ; then
2712 AC_DEFINE(HAVE_OLD_SOCKOPT)
2714 LIBS="$LIBS -lresolv"
2717 dnl Make sure hostname is resolved
2718 ping -c 1 $hostname 2>&1 1>/dev/null
2719 if test ! $? = 0; then
2720 hostname="localhost"
2722 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
2724 TAPEDRIVE="/dev/nst0"
2725 PSCMD="ps -e -o pid,command"
2727 platforms/suse/Makefile \
2728 platforms/suse/bacula-fd \
2729 platforms/suse/bacula-sd \
2730 platforms/suse/bacula-dir \
2731 platforms/suse/bacula \
2732 platforms/suse/bacula.spec"
2735 dnl Make sure hostname is resolved
2736 ping -c 1 $hostname 2>&1 1>/dev/null
2737 if test ! $? = 0; then
2738 hostname="localhost"
2742 TAPEDRIVE="/dev/nst0"
2743 PSCMD="ps -e -o pid,command"
2745 platforms/suse/Makefile \
2746 platforms/suse/bacula-fd \
2747 platforms/suse/bacula-sd \
2748 platforms/suse/bacula-dir"
2752 TAPEDRIVE="/dev/nst0"
2755 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
2761 LIBS="$PTHREAD_LIB $LIBS"
2763 AC_DEFINE_UNQUOTED(lld, "$lld")
2764 AC_DEFINE_UNQUOTED(llu, "$llu")
2772 dnl common parts of the Makefile
2773 MCOMMON=./autoconf/Make.common
2774 AC_SUBST_FILE(MCOMMON)
2777 if test "x${subsysdir}" = "x${sbindir}" ; then
2780 echo "You have set both --sbindir and --with-subsys-dir"
2781 echo " equal to: ${subsysdir} "
2782 echo "This is not permitted. Please reconfigure."
2784 echo "Aborting configuration ..."
2790 AC_OUTPUT([autoconf/Make.common \
2793 scripts/startmysql \
2795 scripts/btraceback \
2801 scripts/bacula-ctl-dir \
2802 scripts/bacula-ctl-fd \
2803 scripts/bacula-ctl-sd \
2804 scripts/devel_bacula \
2807 scripts/bacula.desktop.gnome1 \
2808 scripts/bacula.desktop.gnome2 \
2809 scripts/bacula.desktop.gnome1.consolehelper \
2810 scripts/bacula.desktop.gnome2.consolehelper \
2811 scripts/bacula.desktop.gnome1.xsu \
2812 scripts/bacula.desktop.gnome2.xsu \
2813 scripts/bgnome-console.console_apps \
2814 scripts/mtx-changer \
2815 scripts/disk-changer \
2816 scripts/dvd-handler \
2817 scripts/dvd-simulator \
2818 scripts/bacula-tray-monitor.desktop \
2819 scripts/logwatch/Makefile \
2820 scripts/logwatch/logfile.bacula.conf \
2821 scripts/wxconsole.console_apps \
2822 scripts/wxconsole.desktop.consolehelper \
2823 scripts/wxconsole.desktop.xsu \
2824 scripts/bat.desktop \
2825 scripts/bat.desktop.xsu \
2826 scripts/bat.desktop.consolehelper \
2827 scripts/bat.console_apps \
2830 src/console/Makefile \
2831 src/console/bconsole.conf \
2832 src/gnome2-console/Makefile \
2833 src/gnome2-console/bgnome-console.conf \
2834 src/qt-console/bat.conf \
2835 src/qt-console/bat.pro \
2836 src/qt-console/bat.pro.mingw32 \
2837 src/qt-console/install_conf_file \
2838 src/wx-console/Makefile \
2839 src/wx-console/bwx-console.conf \
2840 src/tray-monitor/Makefile \
2841 src/tray-monitor/tray-monitor.conf \
2843 src/dird/bacula-dir.conf \
2845 src/stored/Makefile \
2846 src/stored/bacula-sd.conf \
2847 src/filed/Makefile \
2848 src/filed/bacula-fd.conf \
2850 src/cats/make_catalog_backup \
2851 src/cats/delete_catalog_backup \
2852 src/cats/create_postgresql_database \
2853 src/cats/update_postgresql_tables \
2854 src/cats/make_postgresql_tables \
2855 src/cats/grant_postgresql_privileges \
2856 src/cats/drop_postgresql_tables \
2857 src/cats/drop_postgresql_database \
2858 src/cats/create_mysql_database \
2859 src/cats/update_mysql_tables \
2860 src/cats/make_mysql_tables \
2861 src/cats/grant_mysql_privileges \
2862 src/cats/drop_mysql_tables \
2863 src/cats/drop_mysql_database \
2864 src/cats/create_sqlite_database \
2865 src/cats/update_sqlite_tables \
2866 src/cats/make_sqlite_tables \
2867 src/cats/grant_sqlite_privileges \
2868 src/cats/drop_sqlite_tables \
2869 src/cats/drop_sqlite_database \
2870 src/cats/create_sqlite3_database \
2871 src/cats/update_sqlite3_tables \
2872 src/cats/make_sqlite3_tables \
2873 src/cats/grant_sqlite3_privileges \
2874 src/cats/drop_sqlite3_tables \
2875 src/cats/drop_sqlite3_database \
2878 src/cats/create_bdb_database \
2879 src/cats/update_bdb_tables \
2880 src/cats/make_bdb_tables \
2881 src/cats/grant_bdb_privileges \
2882 src/cats/drop_bdb_tables \
2883 src/cats/drop_bdb_database \
2884 src/cats/create_bacula_database \
2885 src/cats/update_bacula_tables \
2886 src/cats/grant_bacula_privileges \
2887 src/cats/make_bacula_tables \
2888 src/cats/drop_bacula_tables \
2889 src/cats/drop_bacula_database \
2890 src/findlib/Makefile \
2891 src/tools/Makefile \
2892 src/plugins/fd/Makefile \
2893 src/plugins/sd/Makefile \
2894 src/plugins/dir/Makefile \
2895 src/win32/Makefile.inc \
2897 updatedb/update_mysql_tables_9_to_10 \
2898 updatedb/update_sqlite3_tables_9_to_10 \
2899 updatedb/update_postgresql_tables_9_to_10 \
2900 updatedb/update_sqlite_tables_9_to_10 \
2901 updatedb/update_mysql_tables_10_to_11 \
2902 updatedb/update_sqlite3_tables_10_to_11 \
2903 updatedb/update_postgresql_tables_10_to_11 \
2904 updatedb/update_sqlite_tables_10_to_11 \
2909 if test "${support_bat}" = "yes" ; then
2910 if test "x$QMAKE" = "xnone" && test "x$QMAKEQT4" = "xnone"; then
2911 echo "Could not find qmake or qmake-qt4 in $PATH. Check your Qt installation"
2917 if test "x$QMAKEQT4" != "xnone"; then
2922 echo "Creating bat Makefile"
2929 dnl if CC is gcc, we can rebuild the dependencies (since the depend rule
2930 dnl requires gcc). If it's not, don't rebuild dependencies
2932 if test X"$GCC" = "Xyes" ; then
2933 echo "Doing make of dependencies"
2934 ${MAKE:-make} depend
2938 chmod 755 install_conf_file build-depkgs-qt-console
2942 chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
2943 chmod 755 dvd-handler dvd-simulator
2944 chmod 755 bconsole gconsole mtx-changer devel_bacula logrotate
2948 chmod 755 $c/update_mysql_tables_10_to_11 $c/update_sqlite3_tables_10_to_11
2949 chmod 755 $c/update_postgresql_tables_10_to_11 $c/update_sqlite_tables_10_to_11
2953 chmod 755 $c/create_bacula_database $c/update_bacula_tables $c/make_bacula_tables
2954 chmod 755 $c/grant_bacula_privileges $c/drop_bacula_tables $c/drop_bacula_database
2956 chmod 755 $c/create_bdb_database $c/update_bdb_tables $c/make_bdb_tables
2957 chmod 755 $c/grant_bdb_privileges $c/drop_bdb_tables $c/drop_bdb_database
2959 chmod 755 $c/create_mysql_database $c/update_mysql_tables $c/make_mysql_tables
2960 chmod 755 $c/grant_mysql_privileges $c/drop_mysql_tables $c/drop_mysql_database
2962 chmod 755 $c/create_sqlite_database $c/update_sqlite_tables $c/make_sqlite_tables
2963 chmod 755 $c/grant_sqlite_privileges $c/drop_sqlite_tables $c/drop_sqlite_database
2965 chmod 755 $c/create_sqlite3_database $c/update_sqlite3_tables $c/make_sqlite3_tables
2966 chmod 755 $c/grant_sqlite3_privileges $c/drop_sqlite3_tables $c/drop_sqlite3_database
2968 chmod 755 $c/create_postgresql_database $c/update_postgresql_tables $c/make_postgresql_tables
2969 chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables $c/drop_postgresql_database
2971 chmod 755 $c/make_catalog_backup $c/delete_catalog_backup
2975 chmod 755 src/win32/build-depkgs-mingw32
2977 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
2978 largefile_support="yes"
2981 dnl Only try to find out the version number of the compiler when we know its some kind of GCC compiler
2982 if test X"$GCC" = "Xyes" ; then
2984 dnl A whole lot of hand springs to get the compiler version.
2985 dnl This is because gcc changed the output in version 3.0
2987 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
2988 if test "x${CCVERSION}" = "x" ; then
2989 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
2991 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
2992 if test x"${CXXVERSION}" = x ; then
2993 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
2997 # clean up any old junk
3003 if test "x${db_type}" = "xInternal" ; then
3006 echo "You have not specified either --enable-client-only or one of the"
3007 echo " supported databases: MySQL, PostgreSQL, SQLite3, SQLite or DBI."
3008 echo " This is not permitted. Please reconfigure."
3010 echo "Aborting the configuration ..."
3017 Configuration on `date`:
3019 Host: ${host}${post_host} -- ${DISTNAME} ${DISTVER}
3020 Bacula version: ${BACULA} ${VERSION} (${DATE})
3021 Source code location: ${srcdir}
3022 Install binaries: ${sbindir}
3023 Install libraries: ${libdir}
3024 Install config files: ${sysconfdir}
3025 Scripts directory: ${scriptdir}
3026 Archive directory: ${archivedir}
3027 Working directory: ${working_dir}
3028 PID directory: ${piddir}
3029 Subsys directory: ${subsysdir}
3030 Man directory: ${mandir}
3031 Data directory: ${datarootdir}
3032 Plugin directory: ${plugindir}
3033 C Compiler: ${CC} ${CCVERSION}
3034 C++ Compiler: ${CXX} ${CXXVERSION}
3035 Compiler flags: ${WCFLAGS} ${CFLAGS}
3036 Linker flags: ${WLDFLAGS} ${LDFLAGS}
3038 Statically Linked Tools: ${support_static_tools}
3039 Statically Linked FD: ${support_static_fd}
3040 Statically Linked SD: ${support_static_sd}
3041 Statically Linked DIR: ${support_static_dir}
3042 Statically Linked CONS: ${support_static_cons}
3043 Database type: ${db_type}
3044 Database port: ${db_port}
3045 Database lib: ${DB_LIBS}
3046 Database name: ${db_name}
3047 Database user: ${db_user}
3049 Job Output Email: ${job_email}
3050 Traceback Email: ${dump_email}
3051 SMTP Host Address: ${smtp_host}
3053 Director Port: ${dir_port}
3054 File daemon Port: ${fd_port}
3055 Storage daemon Port: ${sd_port}
3057 Director User: ${dir_user}
3058 Director Group: ${dir_group}
3059 Storage Daemon User: ${sd_user}
3060 Storage DaemonGroup: ${sd_group}
3061 File Daemon User: ${fd_user}
3062 File Daemon Group: ${fd_group}
3064 SQL binaries Directory ${SQL_BINDIR}
3066 Large file support: $largefile_support
3067 Bacula conio support: ${got_conio} ${CONS_LIBS}
3068 readline support: ${got_readline} ${PRTREADLINE_SRC}
3069 TCP Wrappers support: ${TCPW_MSG} ${WRAPLIBS}
3070 TLS support: ${support_tls}
3071 Encryption support: ${support_crypto}
3072 ZLIB support: ${have_zlib}
3073 enable-smartalloc: ${support_smartalloc}
3074 enable-lockmgr: ${support_lockmgr}
3075 bat support: ${support_bat} ${QWT_LDFLAGS}
3076 enable-gnome: ${support_gnome} ${gnome_version}
3077 enable-bwx-console: ${support_wx_console} ${wx_version}
3078 enable-tray-monitor: ${support_tray_monitor}
3079 client-only: ${build_client_only}
3080 build-dird: ${build_dird}
3081 build-stored: ${build_stored}
3082 ACL support: ${have_acl}
3083 XATTR support: ${have_xattr}
3084 Python support: ${support_python} ${PYTHON_LIBS}
3085 Batch insert enabled: ${support_batch_insert}