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"
157 DEFAULT_OBJECT_TYPE=".o"
158 DEFAULT_ARCHIVE_TYPE=".a"
159 DEFAULT_SHARED_OBJECT_TYPE=".so"
160 LIBTOOL="# \$(LIBTOOL)"
161 LIBTOOL_INSTALL_TARGET=""
162 LIBTOOL_UNINSTALL_TARGET=""
163 LIBTOOL_CLEAN_TARGET=""
164 QMAKE_LIBTOOL="# ${BUILD_DIR}/libtool"
167 AC_SUBST(DEFAULT_OBJECT_TYPE)
168 AC_SUBST(DEFAULT_ARCHIVE_TYPE)
169 AC_SUBST(DEFAULT_SHARED_OBJECT_TYPE)
171 AC_SUBST(LIBTOOL_INSTALL_TARGET)
172 AC_SUBST(LIBTOOL_UNINSTALL_TARGET)
173 AC_SUBST(LIBTOOL_CLEAN_TARGET)
174 AC_SUBST(QMAKE_LIBTOOL)
176 dnl --------------------------------------------------
177 dnl Include file handling
178 dnl --------------------------------------------------
179 AC_ARG_ENABLE(includes,
180 AC_HELP_STRING([--enable-includes], [enable installing of include files @<:@default=no@:>@]),
182 if test x$enableval = xyes; then
188 dnl It only makes sense to install include files when you install libraries which only happens when
189 dnl libtool is enabled
191 if test x$use_libtool != xno -a x$install_includes = xyes; then
192 INCLUDE_INSTALL_TARGET="install-includes"
193 INCLUDE_UNINSTALL_TARGET="uninstall-includes"
195 INCLUDE_INSTALL_TARGET=""
196 INCLUDE_UNINSTALL_TARGET=""
198 AC_SUBST(INCLUDE_INSTALL_TARGET)
199 AC_SUBST(INCLUDE_UNINSTALL_TARGET)
201 dnl --------------------------------------------------
202 dnl Bacula OP Sys determination (see aclocal.m4)
203 dnl --------------------------------------------------
206 dnl -----------------------------------------------------------
207 dnl Bacula OPSys Distribution determination (see aclocal.m4)
208 dnl ----------------------------------------------------------
209 BA_CHECK_OPSYS_DISTNAME
211 dnl --------------------------------------------------
212 dnl Suppport for gettext (translations)
213 dnl By default, $datarootdir is ${prefix}/share
214 dnl --------------------------------------------------
215 AM_GNU_GETTEXT([external])
217 dnl ------------------------------------------------------------------
218 dnl If the user has not set --prefix, we set our default to nothing.
219 dnl In this case, if the user has not set --sysconfdir, we set it
220 dnl to the package default of /etc/bacula. If either --prefix or
221 dnl --sysconfdir is set, we leave sysconfdir alone except to eval it.
222 dnl If the user has not set --libdir, we set it to the package
223 dnl default of /usr/lib. If either --prefix or --libdir is set,
224 dnl we leave libdir alone except to eval it. If the user has not set
225 dnl --includedir, we set it to the package default of /usr/include.
226 dnl If either --prefix or --includedir is set, we leave includedir
227 dnl alone except to eval it
228 dnl ------------------------------------------------------------------
229 os_name=`uname -s 2>/dev/null`
230 if test x${prefix} = xNONE ; then
231 if test `eval echo ${sysconfdir}` = NONE/etc ; then
232 sysconfdir=/etc/bacula
235 if test `eval echo ${libdir}` = NONE/lib ; then
238 os_processor=`uname -p 2>/dev/null`
239 case ${os_processor} in
254 if test `eval echo ${includedir}` = NONE/include ; then
255 includedir=/usr/include
258 if test `eval echo ${datarootdir}` = NONE/share ; then
259 datarootdir=/usr/share
264 dnl -------------------------------------------------------------------------
265 dnl If the user has not set --exec-prefix, we default to ${prefix}
266 dnl -------------------------------------------------------------------------
267 if test x${exec_prefix} = xNONE ; then
268 exec_prefix=${prefix}
271 sysconfdir=`eval echo ${sysconfdir}`
272 datarootdir=`eval echo ${datarootdir}`
273 docdir=`eval echo ${docdir}`
274 htmldir=`eval echo ${htmldir}`
275 libdir=`eval echo ${libdir}`
276 includedir=`eval echo ${includedir}`
277 localedir=`eval echo ${datarootdir}/locale`
278 AC_DEFINE_UNQUOTED(SYSCONFDIR, "$sysconfdir")
279 AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir")
281 dnl ------------------------------------------------------------------
282 dnl If the user has not set --sbindir, we set our default as /sbin
283 dnl ------------------------------------------------------------------
284 if test x$sbindir = x'${exec_prefix}/sbin' ; then
285 sbindir=${exec_prefix}/sbin
287 sbindir=`eval echo ${sbindir}`
289 dnl -------------------------------------------------------------------------
290 dnl If the user has not set --mandir, we default to /usr/share/man
291 dnl -------------------------------------------------------------------------
292 if test x$mandir = x'${prefix}/man' ; then
293 mandir=/usr/share/man
296 dnl -------------------------------------------------------------------------
297 dnl If the user has not set --htmldir, we default to /usr/share/doc/bacula/html
298 dnl -------------------------------------------------------------------------
299 if test x$htmldir = x${docdir} ; then
300 htmldir=`eval echo ${docdir}bacula/html`
303 dnl -------------------------------------------------------------------------
304 dnl If the user has not set --docdir, we default to /usr/share/doc/
305 dnl -------------------------------------------------------------------------
306 if test x$docdir = x'/usr/share/doc/' ; then
307 docdir=`eval echo ${docdir}bacula`
311 AC_PATH_PROGS(MSGFMT, msgfmt, no)
312 if test "$MSGFMT" = "no"
314 echo 'msgfmt program not found, disabling NLS !'
316 USE_INCLUDED_LIBINTL=no
324 support_postgresql=no
326 support_smartalloc=yes
331 support_wx_console=no
332 support_tray_monitor=no
337 support_static_tools=no
340 support_static_dir=no
341 support_static_cons=no
351 dnl --------------------------------------------------------------------------
352 dnl CHECKING COMMAND LINE OPTIONS
353 dnl --------------------------------------------------------------------------
355 dnl -------------------------------------------
356 dnl gnome (default off)
357 dnl -------------------------------------------
359 AC_HELP_STRING([--enable-gnome], [enable build of bgnome-console GUI @<:@default=no@:>@]),
361 if test x$enableval = xyes; then
368 if test x$support_gnome = xyes; then
369 AC_MSG_ERROR(bgnome-console no longer supported)
370 AC_MSG_ERROR(--enable-gnome option no longer supported)
372 # AC_SUBST(GNOME_DIR)
374 dnl -------------------------------------------
375 dnl bat (default off)
376 dnl -------------------------------------------
378 AC_HELP_STRING([--enable-bat], [enable build of bat Qt4 GUI @<:@default=no@:>@]),
380 if test x$enableval = xyes; then
381 AC_DEFINE(HAVE_BAT, 1, [Set if Bacula bat Qt4 GUI support enabled])
388 if test x$support_bat = xyes; then
389 abc=`$PKGCONFIG --atleast-version=4.2 QtGui`
391 if test $pkg = 0; then
392 BAT_DIR=src/qt-console
394 AC_MSG_ERROR(Unable to find Qt4 installation needed by bat)
399 dnl If bat is enabled, we need the qwt library
407 if test x$support_bat = xyes; then
408 AC_MSG_CHECKING(for qwt support)
410 AC_HELP_STRING([--with-qwt@<:@=DIR@:>@], [specify qwt library directory]),
417 if test -f ${with_qwt}/include/qwt.h; then
418 QWT_INC="${with_qwt}/include"
419 QWT_LDFLAGS="-L${with_qwt}/lib"
429 dnl Search in standard places, or --with-qwt not specified
431 if test $no_qwt = no; then
432 if test x$QWT_INC = x; then
433 for root in /usr /usr/local; do
434 for ver in qwt qwt5 qwt-qt4; do
435 if test -f ${root}/include/${ver}/qwt.h; then
436 QWT_INC="${root}/include/${ver}"
437 if test -d ${root}/lib64/; then
438 QWT_LDFLAGS="-L${root}/lib64"
439 elif test -d ${root}/lib/64/; then
440 QWT_LDFLAGS="-L${root}/64"
442 QWT_LDFLAGS="-L${root}/lib"
453 if test x$QWT_INC = x; then
456 AC_DEFINE(HAVE_QWT, 1, [Set if bat QWT library found])
463 AC_SUBST(QWT_LDFLAGS)
467 dnl -------------------------------------------
468 dnl bwx-console (default off)
469 dnl -------------------------------------------
470 AC_ARG_ENABLE(bwx-console,
471 AC_HELP_STRING([--enable-bwx-console], [enable build of wxWidgets console @<:@default=no@:>@]),
473 if test x$enableval = xyes; then
474 support_wx_console=yes
480 if test x$support_wx_console = xyes; then
481 abc=`$WXCONFIG $WXFLAGS --cppflags`
483 if test $pkg = 0; then
484 wx_version="wxWidgets `$WXCONFIG $WXFLAGS --release`"
485 WXCONS_CPPFLAGS=`$WXCONFIG $WXFLAGS --cppflags`
486 WXCONS_LDFLAGS=`$WXCONFIG $WXFLAGS --libs`
488 AC_SUBST(WXCONS_CPPFLAGS)
489 AC_SUBST(WXCONS_LDFLAGS)
490 WX_DIR="src/wx-console"
493 echo "wx-config program not found. bwx-console disabled."
495 support_wx_console=no
500 dnl -------------------------------------------
501 dnl tray-monitor (default off)
502 dnl -------------------------------------------
503 AC_ARG_ENABLE(tray-monitor,
504 AC_HELP_STRING([--enable-tray-monitor], [enable build of Gnome tray monitor (compatible with KDE @<:@default=no@:>@]),
506 if test x$enableval = xyes; then
507 support_tray_monitor=yes
513 if test x$support_tray_monitor = xyes; then
514 abc=`$PKGCONFIG --exists gtk+-2.0`
516 if test $pkg = 0; then
517 TRAY_MONITOR_CPPFLAGS=`$PKGCONFIG --cflags gtk+-2.0`
518 TRAY_MONITOR_LDFLAGS=`$PKGCONFIG --libs gtk+-2.0`
519 AC_SUBST(TRAY_MONITOR_CPPFLAGS)
520 AC_SUBST(TRAY_MONITOR_LDFLAGS)
521 TRAY_MONITOR_DIR=src/tray-monitor
522 abc=`$PKGCONFIG --atleast-version=2.4 gtk+-2.0`
524 if test $pkg = 0; then
525 AC_DEFINE(HAVE_GTK_2_4, 1, [Set if you have GTK 4.2 or greater loaded])
529 AC_SUBST(TRAY_MONITOR_DIR)
531 dnl -------------------------------------------
532 dnl smartalloc (default off)
533 dnl -------------------------------------------
534 AC_ARG_ENABLE(smartalloc,
535 AC_HELP_STRING([--enable-smartalloc], [enable smartalloc debugging support @<:@default=no@:>@]),
537 if test x$enableval = xno; then
538 support_smartalloc=no
543 if test x$support_smartalloc = xyes; then
544 AC_DEFINE(SMARTALLOC, 1, [Set if you want Smartalloc enabled])
547 dnl -------------------------------------------
548 dnl Lock Manager (default off)
549 dnl -------------------------------------------
550 AC_ARG_ENABLE(lockmgr,
551 AC_HELP_STRING([--enable-lockmgr], [enable lock manager support @<:@default=no@:>@]),
553 if test x$enableval = xyes; then
559 if test x$support_lockmgr = xyes; then
560 AC_DEFINE(_USE_LOCKMGR, 1, [Set if you want Lock Manager enabled])
564 dnl -------------------------------------------
565 dnl static-tools (default off)
566 dnl -------------------------------------------
567 AC_ARG_ENABLE(static-tools,
568 AC_HELP_STRING([--enable-static-tools], [enable static tape tools @<:@default=no@:>@]),
570 if test x$enableval = xyes; then
571 if test x$use_libtool = xyes; then
572 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
573 please rerun configure with --disable-libtool])
575 support_static_tools=yes
581 if test x$support_static_tools = xyes; then
582 TTOOL_LDFLAGS="-static"
584 AC_SUBST(TTOOL_LDFLAGS)
586 dnl -------------------------------------------
587 dnl static-fd (default off)
588 dnl -------------------------------------------
589 AC_ARG_ENABLE(static-fd,
590 AC_HELP_STRING([--enable-static-fd], [enable static File daemon @<:@default=no@:>@]),
592 if test x$enableval = xyes; then
593 if test x$use_libtool = xyes; then
594 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
595 please rerun configure with --disable-libtool])
597 support_static_fd=yes
603 if test x$support_static_fd = xyes; then
604 STATIC_FD="static-bacula-fd"
608 dnl -------------------------------------------
609 dnl static-sd (default off)
610 dnl -------------------------------------------
611 AC_ARG_ENABLE(static-sd,
612 AC_HELP_STRING([--enable-static-sd], [enable static Storage daemon @<:@default=no@:>@]),
614 if test x$enableval = xyes; then
615 if test x$use_libtool = xyes; then
616 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
617 please rerun configure with --disable-libtool])
619 support_static_sd=yes
625 if test x$support_static_sd = xyes; then
626 STATIC_SD="static-bacula-sd"
630 dnl -------------------------------------------
631 dnl static-dir (default off)
632 dnl -------------------------------------------
633 AC_ARG_ENABLE(static-dir,
634 AC_HELP_STRING([--enable-static-dir], [enable static Director @<:@default=no@:>@]),
636 if test x$enableval = xyes; then
637 if test x$use_libtool = xyes; then
638 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
639 please rerun configure with --disable-libtool])
641 support_static_dir=yes
647 if test x$support_static_dir = xyes; then
648 STATIC_DIR="static-bacula-dir"
652 dnl -------------------------------------------
653 dnl static-cons (default off)
654 dnl -------------------------------------------
655 AC_ARG_ENABLE(static-cons,
656 AC_HELP_STRING([--enable-static-cons], [enable static Console @<:@default=no@:>@]),
658 if test x$enableval = xyes; then
659 if test x$use_libtool = xyes; then
660 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
661 please rerun configure with --disable-libtool])
663 support_static_cons=yes
671 if test x$support_static_cons = xyes; then
672 STATIC_CONS="static-bconsole"
673 STATIC_GNOME_CONS="static-bgnome-console"
674 STATIC_WX_CONS="static-bwx-console"
676 AC_SUBST(STATIC_CONS)
677 AC_SUBST(STATIC_GNOME_CONS)
678 AC_SUBST(STATIC_WX_CONS)
680 dnl -------------------------------------------
681 dnl client_only (default off)
682 dnl -------------------------------------------
683 AC_ARG_ENABLE(client-only,
684 AC_HELP_STRING([--enable-client-only], [build client (File daemon) only @<:@default=no@:>@]),
686 if test x$enableval = xyes; then
687 build_client_only=yes
693 if test x$build_client_only = xno; then
700 dnl -------------------------------------------
701 dnl director (default on)
702 dnl -------------------------------------------
703 AC_ARG_ENABLE(build-dird,
704 AC_HELP_STRING([--enable-build-dird], [enable building of dird (Director) @<:@default=yes@:>@]),
706 if test x$enableval = xno; then
711 if test x$build_dird = xyes; then
716 DIR_TOOLS="NODIRTOOLS"
721 dnl -------------------------------------------
722 dnl stored (default on)
723 dnl -------------------------------------------
724 AC_ARG_ENABLE(build-stored,
725 AC_HELP_STRING([--enable-build-stored], [enable building of stored (Storage daemon) @<:@default=yes@:>@]),
727 if test x$enableval = xno; then
732 if test x$build_stored = xyes; then
733 STORED_DIR="src/stored"
739 dnl ---------------------------------------------------
740 dnl Check for conio (Bacula readline substitute)(
741 dnl ---------------------------------------------------
742 dnl this allows you to turn it completely off
744 AC_HELP_STRING([--disable-conio], [disable conio support @<:@default=no@:>@]),
746 if test x$enableval = xno; then
753 dnl ---------------------------------------------------
754 dnl Check for IPv6 support
755 dnl ---------------------------------------------------
756 dnl this allows you to turn it completely off
759 AC_HELP_STRING([--enable-ipv6], [enable ipv6 support @<:@default=yes@:>@]),
761 if test x$enableval = xno; then
767 if test x$support_ipv6 = xyes; then
768 AC_TRY_LINK([ #include <sys/types.h>
769 #include <sys/socket.h>
770 #include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;],
771 [support_ipv6=yes], [support_ipv6=no])
774 if test x$support_ipv6 = xyes; then
775 AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
779 if test x$support_conio = xyes; then
780 AC_CHECK_HEADER(termcap.h,
781 [ AC_CHECK_LIB(termcap, tgetent,
782 [ CONS_LIBS="-ltermcap"
787 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
789 [ AC_CHECK_LIB(ncurses, tgetent,
790 [ CONS_LIBS="-lncurses"
795 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
800 AC_CHECK_HEADERS(curses.h)
801 AC_CHECK_HEADER(term.h,
802 [ AC_CHECK_LIB(curses, tgetent,
803 [ CONS_LIBS="-lcurses"
808 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
811 [ echo " "; echo "Required libraries not found. CONIO turned off ..."; echo " "],
820 dnl ---------------------------------------------------
821 dnl Check for readline support/directory (default off)
822 dnl ---------------------------------------------------
823 dnl this allows you to turn it completely off
824 AC_ARG_ENABLE(readline,
825 AC_HELP_STRING([--disable-readline], [disable readline support @<:@default=yes@:>@]),
827 if test x$enableval = xno; then
835 if test x$support_readline = xyes; then
836 AC_ARG_WITH(readline,
837 AC_HELP_STRING([--with-readline@<:@=DIR@:>@], [specify readline library directory]),
839 case "$with_readline" in
844 if test -f ${with_readline}/readline.h; then
845 CONS_INC="-I${with_readline}"
846 CONS_LDFLAGS="-L$with_readline"
847 elif test -f ${with_readline}/include/readline/readline.h; then
848 CONS_INC="-I${with_readline}/include/readline"
849 CONS_LDFLAGS="-L${with_readline}/lib"
850 with_readline="${with_readline}/include/readline"
852 with_readline="/usr/include/readline"
855 AC_CHECK_HEADER(${with_readline}/readline.h,
857 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
858 CONS_LIBS="-lreadline -lhistory -ltermcap"
862 echo "readline.h not found. readline turned off ..."
869 dnl check for standard readline library
870 AC_CHECK_HEADER(/usr/include/readline/readline.h,
872 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
874 CONS_INC="-I/usr/include/readline"
875 CONS_LIBS="-lreadline -ltermcap"
877 dnl Did not find standard library, so try Bacula's default
878 AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h,
880 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
882 CONS_INC="-I${TOP_DIR}/depkgs/readline"
883 CONS_LIBS="-lreadline -lhistory -ltermcap"
884 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
885 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
888 echo "readline.h not found. readline turned off ..."
902 AC_SUBST(CONS_LDFLAGS)
903 AC_SUBST(READLINE_SRC)
905 dnl Minimal stuff for readline Makefile configuration
910 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr lstat lchown)
911 AC_CHECK_FUNCS(nanosleep nl_langinfo)
912 AC_CHECK_HEADERS(varargs.h)
914 dnl End of readline/conio stuff
915 dnl -----------------------------------------------------------------------
917 dnl -----------------------------------------------------------------------
918 dnl Check for Python support
920 AC_MSG_CHECKING(for Python support)
922 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.]),
926 if test "$withval" != "no"; then
927 if test "$withval" = "yes"; then
928 if test -e /usr/bin/python-config ; then
929 PYTHON_INCDIR=`/usr/bin/python-config --includes`
930 PYTHON_LIBS=`/usr/bin/python-config --libs`
932 for python_root in /usr /usr/local /usr/sfw; do
933 for ver in python2.2 python2.3 python2.4 python2.5 python2.6 python3; do
934 if test -f $python_root/include/${ver}/Python.h; then
935 PYTHON_INCDIR=-I$python_root/include/${ver}
936 if test -d $python_root/lib64/${ver}/config; then
937 PYTHON_LIBS="-L$python_root/lib64/${ver}/config -l${ver}"
939 PYTHON_LIBS="-L$python_root/lib/${ver}/config -l${ver}"
946 if test x$PYTHON_INCDIR = x; then
947 if test -f $prefix/include/Python.h; then
948 PYTHON_INCDIR=-I$prefix/include
949 if test -d $prefix/lib64/config; then
950 PYTHON_LIBS="-L$prefix/lib64/config -lpython"
952 PYTHON_LIBS="-L$prefix/lib/config -lpython"
956 AC_MSG_ERROR(Unable to find Python.h in standard locations)
961 if test -e $withval/bin/python-config ; then
962 PYTHON_INCDIR=`$withval/bin/python-config --includes`
963 PYTHON_LIBS=`$withval/bin/python-config --libs`
964 elif test -f $withval/Python.h; then
965 PYTHON_INCDIR=-I$withval
966 PYTHON_LIBS="-L$withval/config -lpython"
967 elif test -f $withval/include/Python.h; then
968 PYTHON_INCDIR=-I$withval/include
969 if test -d $withval/lib64/config; then
970 PYTHON_LIBS="-L$withval/lib64/config -lpython"
972 PYTHON_LIBS="-L$withval/lib/config -lpython"
974 elif test -f $withval/include/python/Python.h; then
975 PYTHON_INCDIR=-I$withval/include/python
976 if test -d $withval/lib64/python/config; then
977 PYTHON_LIBS="-L$withval/lib64/python/config -lpython"
979 PYTHON_LIBS="-L$withval/lib/python/config -lpython"
983 AC_MSG_ERROR(Invalid Python directory $withval - unable to find Python.h under $withval)
987 AC_DEFINE([HAVE_PYTHON], 1)
990 AC_MSG_NOTICE(checking for more Python libs)
991 saved_LIBS="$LIBS"; LIBS=
992 AC_SEARCH_LIBS(shm_open, [rt])
993 AC_CHECK_LIB(util, openpty)
994 PYTHON_LIBS="$PYTHON_LIBS $LIBS"
1003 AC_SUBST(PYTHON_LIBS)
1004 AC_SUBST(PYTHON_INCDIR)
1007 dnl Find where sockets are (especially for Solaris)
1008 dnl Do this before the TCP Wrappers test since tcp wrappers
1009 dnl uses the socket library and some linkers are stupid.
1011 AC_CHECK_FUNC(socket,
1012 AC_MSG_RESULT(using libc's socket),
1013 AC_CHECK_LIB(xnet,socket)
1014 AC_CHECK_LIB(socket,socket)
1015 AC_CHECK_LIB(inet,socket))
1017 dnl -----------------------------------------------------------
1018 dnl Check whether user wants TCP wrappers support (default off)
1019 dnl -----------------------------------------------------------
1022 AC_ARG_WITH(tcp-wrappers,
1023 AC_HELP_STRING([--with-tcp-wrappers@<:@=DIR@:>@], [enable tcpwrappers support]),
1025 if test "x$withval" != "xno" ; then
1027 LIBS="$saved_LIBS -lwrap"
1028 AC_SEARCH_LIBS(nanosleep, [rt])
1029 AC_MSG_CHECKING(for libwrap)
1032 #include <sys/types.h>
1034 int deny_severity = 0;
1035 int allow_severity = 0;
1036 struct request_info *req;
1041 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
1046 LIBS="$saved_LIBS -lwrap -lnsl"
1047 WRAPLIBS="$saved_LIBS -lwrap -lnsl"
1050 #include <sys/types.h>
1052 int deny_severity = 0;
1053 int allow_severity = 0;
1054 struct request_info *req;
1059 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
1064 AC_MSG_ERROR([*** libwrap missing])
1073 dnl -----------------------------------------------------------
1074 dnl Check whether OpenSSL is available
1075 dnl -----------------------------------------------------------
1076 AC_MSG_CHECKING([for OpenSSL])
1077 dnl The following uses quadrigraphs:
1080 AC_ARG_WITH(openssl,
1081 AC_HELP_STRING([--with-openssl@<:@=DIR@:>@], [Include OpenSSL support. DIR is the OpenSSL base]),
1083 with_openssl_directory=${withval}
1087 if test "x$with_openssl_directory" != "xno"; then
1088 OPENSSL_LIBS="-lssl -lcrypto"
1091 if test "x$with_openssl_directory" != "xyes" && test x"${with_openssl_directory}" != "x"; then
1093 # Make sure the $with_openssl_directory also makes sense
1095 if test -d "$with_openssl_directory/lib" -a -d "$with_openssl_directory/include"; then
1096 OPENSSL_LIBS="-L$with_openssl_directory/lib $OPENSSL_LIBS"
1097 OPENSSL_INC="-I$with_openssl_directory/include $OPENSSL_INC"
1101 saved_LIBS="${LIBS}"
1102 saved_CFLAGS="${CFLAGS}"
1103 LIBS="${saved_LIBS} ${OPENSSL_LIBS}"
1104 CFLAGS="${saved_CFLAGS} ${OPENSSL_INC}"
1108 #include <openssl/ssl.h>
1110 CRYPTO_set_id_callback(NULL);
1113 support_crypto="yes"
1121 #include <openssl/evp.h>
1125 ac_cv_openssl_sha2="yes"
1127 ac_cv_openssl_sha2="no"
1131 dnl Solaris disables greater than 128+ bit encryption in their OpenSSL
1132 dnl implementation, presumably for export reasons. If 192bit AES
1133 dnl is available, we assume that we're running with a 'non-export'
1134 dnl openssl library.
1137 #include <openssl/evp.h>
1141 ac_cv_openssl_export="no"
1143 ac_cv_openssl_export="yes"
1147 LIBS="${saved_LIBS}"
1148 CFLAGS="${saved_CFLAGS}"
1150 if test "$support_tls" = "yes"; then
1151 AC_DEFINE(HAVE_OPENSSL, 1, [Define if OpenSSL library is available])
1152 AC_DEFINE(HAVE_TLS, 1, [Define if TLS support should be enabled])
1153 AC_DEFINE(HAVE_CRYPTO, 1, [Define if encryption support should be enabled])
1156 if test "$ac_cv_openssl_sha2" = "yes"; then
1157 AC_DEFINE(HAVE_SHA2, 1, [Define if the SHA-2 family of digest algorithms is available])
1160 if test "$ac_cv_openssl_export" = "yes"; then
1161 AC_DEFINE(HAVE_OPENSSL_EXPORT_LIBRARY, 1, [Define if the OpenSSL library is export-contrained to 128bit ciphers])
1170 if test "$support_tls" = "no"; then
1175 AC_MSG_RESULT([$support_tls])
1176 AC_SUBST(OPENSSL_LIBS)
1177 AC_SUBST(OPENSSL_INC)
1179 dnl -----------------------------------------------------------
1180 dnl dlopen is needed for plugins
1181 dnl -----------------------------------------------------------
1182 AC_SEARCH_LIBS(dlopen, [dl])
1184 dnl ------------------------------------------
1185 dnl Where to place working dir
1186 dnl ------------------------------------------
1187 working_dir=`eval echo ${prefix}/var/bacula/working`
1188 AC_ARG_WITH(working-dir,
1189 AC_HELP_STRING([--with-working-dir=PATH], [specify path of Bacula working directory]),
1191 if test "x$withval" != "xno" ; then
1192 working_dir=$withval
1197 AC_SUBST(working_dir)
1199 dnl ------------------------------------------------------------------
1200 dnl If the user has not set archivedir, we set our default as /tmp
1201 dnl ------------------------------------------------------------------
1203 AC_ARG_WITH(archivedir,
1204 AC_HELP_STRING([--with-archivedir=PATH], [specify path of SD archive directory]),
1206 if test "x$withval" != "xno" ; then
1212 AC_SUBST(archivedir)
1214 dnl ------------------------------------------------------------------
1215 dnl Allow the user to specify the daemon resource name default hostname
1216 dnl ------------------------------------------------------------------
1218 AC_ARG_WITH(basename,
1219 AC_HELP_STRING([--with-basename=RESNAME], [specify base resource name for daemons]),
1221 if test "x$withval" != "xno" ; then
1229 dnl ------------------------------------------------------------------
1230 dnl Allow the user to override the hostname (default = machine hostname)
1231 dnl ------------------------------------------------------------------
1232 hostname=`uname -n | cut -d '.' -f 1`
1233 if test x${hostname} = x ; then
1234 hostname="localhost"
1236 AC_ARG_WITH(hostname,
1237 AC_HELP_STRING([--with-hostname=RESNAME], [specify host name for daemons]),
1239 if test "x$withval" != "xno" ; then
1248 dnl ------------------------------------------
1249 dnl Where to place scriptdir (script files)
1250 dnl ------------------------------------------
1251 scriptdir=`eval echo ${sysconfdir}`
1252 AC_ARG_WITH(scriptdir,
1253 AC_HELP_STRING([--with-scriptdir=PATH], [specify path of Bacula scripts directory]),
1255 if test "x$withval" != "xno" ; then
1264 dnl ------------------------------------------
1265 dnl Where to place bsrdir (bsr files)
1266 dnl ------------------------------------------
1269 AC_HELP_STRING([--with-bsrdir=PATH], [specify path of Bacula bsrs directory]),
1271 if test "x$withval" != "xno" ; then
1279 dnl ------------------------------------------
1280 dnl Where to place logdir (bsr files)
1281 dnl ------------------------------------------
1284 AC_HELP_STRING([--with-logdir=PATH], [specify path of Bacula logs directory]),
1286 if test "x$withval" != "xno" ; then
1295 # ------------------------------------------
1296 # Where to place plugindir (plugin files)
1297 # ------------------------------------------
1298 plugindir=`eval echo ${libdir}`
1299 AC_ARG_WITH(plugindir,
1300 AC_HELP_STRING([--with-plugindir=PATH], [specify path of Bacula plugins directory]),
1302 if test "x$withval" != "xno" ; then
1310 dnl ------------------------------------------
1311 dnl Where to send dump email
1312 dnl ------------------------------------------
1313 dump_email=root@localhost
1314 AC_ARG_WITH(dump-email,
1315 AC_HELP_STRING([--with-dump-email=EMAIL], [dump email address]),
1317 if test "x$withval" != "xno" ; then
1323 AC_SUBST(dump_email)
1325 dnl ------------------------------------------
1326 dnl Where to send job email
1327 dnl ------------------------------------------
1328 job_email=root@localhost
1329 AC_ARG_WITH(job-email,
1330 AC_HELP_STRING([--with-job-email=EMAIL], [job output email address]),
1332 if test "x$withval" != "xno" ; then
1340 dnl ------------------------------------------
1341 dnl Where to find smtp host
1342 dnl ------------------------------------------
1344 AC_ARG_WITH(smtp_host,
1345 AC_HELP_STRING([--with-smtp-host=HOST], [SMTP mail host address]),
1347 if test "x$withval" != "xno" ; then
1355 dnl ------------------------------------
1356 dnl Where to place pid files
1357 dnl ------------------------------------
1359 AC_ARG_WITH(pid-dir,
1360 AC_HELP_STRING([--with-pid-dir=PATH], [specify location of Bacula pid files]),
1362 if test "x$withval" != "xno" ; then
1368 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
1371 dnl ------------------------------------
1372 dnl Where to place subsys "lock file"
1373 dnl ------------------------------------
1374 subsysdir=/var/run/subsys
1375 if test -d /var/run/subsys; then
1376 subsysdir=/var/run/subsys
1377 elif test -d /var/lock/subsys; then
1378 subsysdir=/var/lock/subsys
1380 subsysdir=/var/run/subsys
1382 AC_ARG_WITH(subsys-dir,
1383 AC_HELP_STRING([--with-subsys-dir=PATH], [specify location of Bacula subsys file]),
1385 if test "x$withval" != "xno" ; then
1393 dnl ------------------------------------
1394 dnl Where to start assigning ports
1395 dnl ------------------------------------
1397 AC_ARG_WITH(baseport,
1398 AC_HELP_STRING([--with-baseport=PORT], [specify base port address for daemons]),
1400 if test "x$withval" != "xno" ; then
1407 dir_port=`expr $baseport`
1408 fd_port=`expr $baseport + 1`
1409 sd_port=`expr $fd_port + 1`
1415 dnl ------------------------------------------
1416 dnl Generate passwords
1417 dnl ------------------------------------------
1419 AC_ARG_WITH(dir-password,
1420 AC_HELP_STRING([--with-dir-password=PASSWORD], [specify Director's password]),
1422 if test "x$withval" != "xno" ; then
1423 dir_password=$withval
1428 if test "x$dir_password" = "x" ; then
1429 if test "x$OPENSSL" = "xnone" ; then
1430 key=`autoconf/randpass 33`
1432 key=`openssl rand -base64 33`
1438 AC_ARG_WITH(fd-password,
1439 AC_HELP_STRING([--with-fd-password=PASSWORD], [specify Client's password]),
1441 if test "x$withval" != "xno" ; then
1442 fd_password=$withval
1447 if test "x$fd_password" = "x" ; then
1448 if test "x$OPENSSL" = "xnone" ; then
1449 key=`autoconf/randpass 37`
1451 key=`openssl rand -base64 33`
1457 AC_ARG_WITH(sd-password,
1458 AC_HELP_STRING([--with-sd-password=PASSWORD], [specify Storage daemon's password]),
1460 if test "x$withval" != "xno" ; then
1461 sd_password=$withval
1466 if test "x$sd_password" = "x" ; then
1467 if test "x$OPENSSL" = "xnone" ; then
1468 key=`autoconf/randpass 41`
1470 key=`openssl rand -base64 33`
1476 AC_ARG_WITH(mon-dir-password,
1477 AC_HELP_STRING([--with-mon-dir-password=PASSWORD], [specify Director's password used by the monitor]),
1479 if test "x$withval" != "xno" ; then
1480 mon_dir_password=$withval
1485 if test "x$mon_dir_password" = "x" ; then
1486 if test "x$OPENSSL" = "xnone" ; then
1487 key=`autoconf/randpass 33`
1489 key=`openssl rand -base64 33`
1491 mon_dir_password=$key
1495 AC_ARG_WITH(mon-fd-password,
1496 AC_HELP_STRING([--with-mon-fd-password=PASSWORD], [specify Client's password used by the monitor]),
1498 if test "x$withval" != "xno" ; then
1499 mon_fd_password=$withval
1504 if test "x$mon_fd_password" = "x" ; then
1505 if test "x$OPENSSL" = "xnone" ; then
1506 key=`autoconf/randpass 37`
1508 key=`openssl rand -base64 33`
1510 mon_fd_password=$key
1514 AC_ARG_WITH(mon-sd-password,
1515 AC_HELP_STRING([--with-mon-sd-password=PASSWORD], [specify Storage daemon's password used by the monitor]),
1517 if test "x$withval" != "xno" ; then
1518 mon_sd_password=$withval
1523 if test "x$mon_sd_password" = "x" ; then
1524 if test "x$OPENSSL" = "xnone" ; then
1525 key=`autoconf/randpass 41`
1527 key=`openssl rand -base64 33`
1529 mon_sd_password=$key
1532 AC_SUBST(dir_password)
1533 AC_SUBST(fd_password)
1534 AC_SUBST(sd_password)
1535 AC_SUBST(mon_dir_password)
1536 AC_SUBST(mon_fd_password)
1537 AC_SUBST(mon_sd_password)
1540 dnl Pickup any database name
1543 AC_ARG_WITH(db_name,
1544 AC_HELP_STRING([--with-db-name=DBNAME], [specify database name @<:@default=bacula@:>@]),
1546 if test "x$withval" != "x" ; then
1554 AC_ARG_WITH(db_user,
1555 AC_HELP_STRING([--with-db-user=UNAME], [specify database user @<:@default=bacula@:>@]),
1557 if test "x$withval" != "x" ; then
1565 AC_ARG_WITH(db_password,
1566 AC_HELP_STRING([--with-db-password=PWD], [specify database password @<:@default=*none*@:>@]),
1568 if test "x$withval" != "x" ; then
1569 db_password=$withval
1573 AC_SUBST(db_password)
1576 dnl Pickup a database port
1579 AC_ARG_WITH(db_port,
1580 AC_HELP_STRING([--with-db-port=DBPORT], [specify a database port @<:@default=null@:>@]),
1582 if test "x$withval" != "x" ; then
1590 # Handle users and groups for each daemon
1593 AC_ARG_WITH(dir_user,
1594 AC_HELP_STRING([--with-dir-user=USER], [specify user for Director daemon]),
1596 if test "x$withval" != "x" ; then
1603 AC_ARG_WITH(dir_group,
1604 AC_HELP_STRING([--with-dir-group=GROUP], [specify group for Director daemon]),
1606 if test "x$withval" != "x" ; then
1613 AC_ARG_WITH(sd_user,
1614 AC_HELP_STRING([--with-sd-user=USER], [specify user for Storage daemon]),
1616 if test "x$withval" != "x" ; then
1623 AC_ARG_WITH(sd_group,
1624 AC_HELP_STRING([--with-sd-group=GROUP], [specify group for Storage daemon]),
1626 if test "x$withval" != "x" ; then
1633 AC_ARG_WITH(fd_user,
1634 AC_HELP_STRING([--with-fd-user=USER], [specify user for File daemon]),
1636 if test "x$withval" != "x" ; then
1643 AC_ARG_WITH(fd_group,
1644 AC_HELP_STRING([--with-fd-group=GROUP], [specify group for File daemon]),
1646 if test "x$withval" != "x" ; then
1660 dnl allow setting default executable permissions
1663 AC_ARG_WITH(sbin-perm,
1664 AC_HELP_STRING([--with-sbin-perm=MODE], [specify permissions for sbin binaries @<:@default=0754@:>@]),
1666 if test "x$withval" != "x" ; then
1674 dnl ------------------------------------------------
1675 dnl Bacula check for various SQL database engines
1676 dnl ------------------------------------------------
1678 BA_CHECK_POSTGRESQL_DB
1684 # BA_CHECK_SQLITE_DB
1693 dnl -------------------------------------------
1694 dnl enable batch attribute DB insert (default on)
1695 dnl -------------------------------------------
1696 support_batch_insert=no
1697 A=`test -f $SQL_LIB && nm $SQL_LIB | grep pthread_mutex_lock`
1699 if test $pkg = 0; then
1700 support_batch_insert=yes
1701 AC_ARG_ENABLE(batch-insert,
1702 AC_HELP_STRING([--enable-batch-insert], [enable the DB batch insert code @<:@default=no@:>@]),
1704 if test x$enableval = xno; then
1705 support_batch_insert=no
1707 support_batch_insert=yes
1713 dnl Check if postgresql support batch mode
1714 if test x$DB_TYPE = xpostgresql; then
1715 A=`test -f $SQL_LIB && nm $SQL_LIB | grep PQputCopyData`
1717 if test $pkg != 0; then
1718 support_batch_insert=no
1722 if test x$DB_TYPE = xdbi; then
1726 dnl Check for batch insert
1727 if test $DB_PROG = postgresql; then
1728 A=`test -f $SQL_LIB && nm $SQL_LIB | grep PQputCopyData`
1732 if test $DB_PROG = mysql; then
1733 A=`test -f $SQL_LIB && nm $DB_PROG_LIB | grep pthread_mutex_lock`
1737 if test $DB_PROG = sqlite3; then
1738 A=`test -f $SQL_LIB && nm $DB_PROG_LIB | grep pthread_mutex_lock`
1742 if test $pkg = 0; then
1743 AC_ARG_ENABLE(batch-insert,
1744 AC_HELP_STRING([--enable-batch-insert], [enable the DB batch insert code @<:@default=no@:>@]),
1746 if test x$enableval = xno; then
1747 support_batch_insert=no
1749 support_batch_insert=yes
1755 dnl If dbi was not chosen, let the comment in file
1759 AC_SUBST(uncomment_dbi)
1761 if test $support_batch_insert = yes ; then
1762 AC_DEFINE(HAVE_BATCH_FILE_INSERT, 1, [Set if DB batch insert code enabled])
1765 AC_DEFINE(PROTOTYPES)
1767 dnl --------------------------------------------------------------------------
1768 dnl Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
1770 if test -z "$CFLAGS" -o "$CFLAGS" = "-g -O2"; then
1771 if test -z "$CCOPTS"; then
1772 CCOPTS='-g -O2 -Wall'
1780 dnl See if we can use 64 bit file addresses
1781 largefile_support="no"
1786 dnl --------------------------------------------------------------------------
1787 dnl CHECKING FOR HEADER FILES
1788 dnl --------------------------------------------------------------------------
1826 AC_STRUCT_ST_BLKSIZE
1830 dnl --------------------------------------------------------------------------
1831 dnl Check for utime.h structure
1832 dnl --------------------------------------------------------------------------
1833 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
1837 #include <sys/types.h>
1842 ba_cv_header_utime_h=yes
1844 ba_cv_header_utime_h=no
1849 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H, 1, [Set if utime.h exists])
1851 dnl --------------------------------------------------------------------------
1852 dnl Check for socklen_t
1853 dnl --------------------------------------------------------------------------
1854 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
1858 #include <sys/types.h>
1859 #include <sys/socket.h>
1863 ba_cv_header_socklen_t=yes
1865 ba_cv_header_socklen_t=no
1870 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T)
1872 dnl --------------------------------------------------------------------------
1873 dnl Check for typeof()
1874 dnl --------------------------------------------------------------------------
1876 AC_CACHE_CHECK(for typeof, ba_cv_have_typeof,
1880 main(){char *a = 0; a = (typeof a)a;}
1882 ba_cv_have_typeof=yes
1884 ba_cv_have_typeof=no
1886 ba_cv_have_typeof=no
1891 test $ba_cv_have_typeof = yes && AC_DEFINE([HAVE_TYPEOF], 1, [Defind to 1 if compiler has typeof])
1896 dnl --------------------------------------------------------------------------
1897 dnl CHECKING FOR FILESYSTEM TYPE
1898 dnl --------------------------------------------------------------------------
1899 AC_MSG_CHECKING(how to get filesystem type)
1901 # The order of these tests is important.
1904 #include <sys/statvfs.h>
1905 #include <sys/fstyp.h>
1907 AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4
1909 if test $fstype = no; then
1912 #include <sys/statfs.h>
1913 #include <sys/fstyp.h>
1915 AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3
1918 if test $fstype = no; then
1921 #include <sys/statfs.h>
1922 #include <sys/vmount.h>
1924 AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX
1927 if test $fstype = no; then
1932 AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD
1935 if test $fstype = no; then
1936 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
1938 if test $fstype = no; then
1941 #include <sys/mount.h>
1942 #include <sys/fs_types.h>
1944 AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix
1947 AC_MSG_RESULT($fstype)
1949 AC_CHECK_HEADER(sys/statvfs.h, [ AC_DEFINE(HAVE_SYS_STATVFS_H,1,[Defines if your system have the sys/statvfs.h header file])] , )
1951 dnl --------------------------------------------------------------------------
1952 dnl CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
1953 dnl --------------------------------------------------------------------------
1963 AC_CHECK_TYPE(ino_t, unsigned long)
1964 AC_CHECK_TYPE(dev_t, unsigned long)
1965 AC_CHECK_TYPE(daddr_t, long)
1966 AC_CHECK_TYPE(major_t, int)
1967 AC_CHECK_TYPE(minor_t, int)
1968 AC_CHECK_TYPE(ssize_t, int)
1974 AC_CHECK_SIZEOF(char, 1)
1975 AC_CHECK_SIZEOF(short int, 2)
1976 AC_CHECK_SIZEOF(int, 4)
1977 AC_CHECK_SIZEOF(long int, 4)
1978 AC_CHECK_SIZEOF(long long int, 8)
1979 AC_CHECK_SIZEOF(int *, 4)
1981 dnl Check for sys/types.h types
1982 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int,
1986 #include <sys/types.h>
1990 ac_cv_have_u_int="yes"
1992 ac_cv_have_u_int="no"
1997 if test "x$ac_cv_have_u_int" = "xyes" ; then
1998 AC_DEFINE(HAVE_U_INT)
2002 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t,
2006 #include <sys/types.h>
2010 ac_cv_have_intmax_t="yes"
2018 ac_cv_have_intmax_t="yes"
2020 ac_cv_have_intmax_t="no"
2027 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
2028 AC_DEFINE(HAVE_INTMAX_T)
2032 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t,
2036 #include <sys/types.h>
2038 u_intmax_t a; a = 1;
2040 ac_cv_have_u_intmax_t="yes"
2046 u_intmax_t a; a = 1;
2048 ac_cv_have_u_intmax_t="yes"
2050 ac_cv_have_u_intmax_t="no"
2057 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
2058 AC_DEFINE(HAVE_U_INTMAX_T)
2062 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t,
2066 #include <sys/types.h>
2068 int8_t a; int16_t b; int32_t c; a = b = c = 1;
2070 ac_cv_have_intxx_t="yes"
2072 ac_cv_have_intxx_t="no"
2077 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
2078 AC_DEFINE(HAVE_INTXX_T)
2082 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t,
2086 #include <sys/types.h>
2090 ac_cv_have_int64_t="yes"
2092 ac_cv_have_int64_t="no"
2097 if test "x$ac_cv_have_int64_t" = "xyes" ; then
2098 AC_DEFINE(HAVE_INT64_T)
2102 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t,
2106 #include <sys/types.h>
2108 u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;
2110 ac_cv_have_u_intxx_t="yes"
2112 ac_cv_have_u_intxx_t="no"
2117 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
2118 AC_DEFINE(HAVE_U_INTXX_T)
2122 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t,
2126 #include <sys/types.h>
2130 ac_cv_have_u_int64_t="yes"
2132 ac_cv_have_u_int64_t="no"
2137 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
2138 AC_DEFINE(HAVE_U_INT64_T)
2142 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
2143 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2145 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
2148 #include <sys/bitypes.h>
2150 int8_t a; int16_t b; int32_t c;
2151 u_int8_t e; u_int16_t f; u_int32_t g;
2152 a = b = c = e = f = g = 1;
2154 AC_DEFINE(HAVE_U_INTXX_T)
2155 AC_DEFINE(HAVE_INTXX_T)
2156 AC_DEFINE(HAVE_SYS_BITYPES_H)
2164 if test -z "$have_u_intxx_t" ; then
2165 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t,
2169 #include <sys/types.h>
2171 uint8_t a; uint16_t b;
2172 uint32_t c; a = b = c = 1;
2174 ac_cv_have_uintxx_t="yes"
2176 ac_cv_have_uintxx_t="no"
2181 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
2182 AC_DEFINE(HAVE_UINTXX_T)
2186 if (test -z "$have_u_int64_t" || test -z "$have_int64_t" && \
2187 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2189 AC_MSG_CHECKING([for int64_t and u_int64_t types in sys/bitypes.h])
2192 #include <sys/bitypes.h>
2194 int64_t a; u_int64_t b;
2197 AC_DEFINE(HAVE_U_INT64_T)
2198 AC_DEFINE(HAVE_INT64_T)
2206 if (test -z "$have_uintxx_t" && \
2207 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2209 AC_MSG_CHECKING([for uintXX_t types in sys/bitypes.h])
2212 #include <sys/bitypes.h>
2214 uint8_t a; uint16_t b;
2215 uint32_t c; a = b = c = 1;
2217 AC_DEFINE(HAVE_UINTXX_T)
2225 dnl --------------------------------------------------------------------------
2226 dnl CHECKING FOR REQUIRED LIBRARY FUNCTIONS
2227 dnl --------------------------------------------------------------------------
2243 [echo 'configure: cannot find needed function.'; exit 1]
2246 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
2247 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
2248 AC_CHECK_FUNCS(posix_fadvise)
2249 AC_CHECK_FUNCS(fdatasync)
2251 AC_CHECK_FUNCS(chflags)
2253 AC_CHECK_FUNCS(snprintf vsnprintf gethostid fseeko)
2255 AC_CACHE_CHECK(for va_copy, ba_cv_va_copy,
2260 void use_va_copy(va_list args){va_list args2; va_copy(args2,args); va_end(args2);}
2261 void call_use_va_copy(int junk,...){va_list args; va_start(args,junk); use_va_copy(args); va_end(args);}
2263 call_use_va_copy(1,2,3)
2272 test $ba_cv_va_copy = yes && AC_DEFINE(HAVE_VA_COPY, 1, [Set if va_copy exists])
2274 dnl --------------------------------------------------------------------------
2275 dnl CHECKING FOR THREAD SAFE FUNCTIONS
2276 dnl --------------------------------------------------------------------------
2277 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
2279 # If resolver functions are not in libc check for -lnsl or -lresolv.
2280 AC_CHECK_FUNC(gethostbyname_r,
2281 AC_MSG_RESULT(using libc's resolver),
2282 AC_CHECK_LIB(nsl,gethostbyname_r)
2283 AC_CHECK_LIB(resolv,gethostbyname_r))
2285 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
2286 AC_CHECK_FUNCS(inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)])
2287 AC_CHECK_FUNCS(gethostbyname2, [AC_DEFINE(HAVE_GETHOSTBYNAME2)])
2289 dnl ----------------------------
2290 dnl check sa_len of sockaddr
2291 dnl ----------------------------
2292 AC_CACHE_CHECK(for struct sockaddr has a sa_len field, ac_cv_struct_sockaddr_sa_len,
2296 #include <sys/socket.h>
2298 struct sockaddr s; s.sa_len;
2300 ac_cv_struct_sockaddr_sa_len=yes
2301 ], [ac_cv_struct_sockaddr_sa_len=no
2307 if test $ac_cv_struct_sockaddr_sa_len = yes; then
2308 AC_DEFINE(HAVE_SA_LEN, 1, [Define if sa_len field exists in struct sockaddr])
2315 AC_FUNC_CLOSEDIR_VOID
2316 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
2317 # AC_FUNC_FNMATCH dnl use local version
2319 AC_CHECK_LIB(intl, gettext, [LIBS="$LIBS -lintl"])
2321 AC_CHECK_LIB(sun, getpwnam)
2323 AC_CHECK_HEADERS(zlib.h)
2324 AC_CHECK_LIB(z, deflate, [FDLIBS="-lz"])
2326 if test x$FDLIBS = x-lz; then
2327 AC_DEFINE(HAVE_LIBZ)
2332 dnl Check for ACL support and libraries
2336 AC_HELP_STRING([--disable-acl], [disable acl support @<:@default=auto@:>@]),
2338 if test x$enableval = xyes; then
2340 elif test x$enableval = xno; then
2347 have_extended_acl=no
2348 if test x$support_acl = xyes -o x$support_acl = xauto; then
2349 AC_CHECK_HEADER(sys/acl.h, [ AC_DEFINE(HAVE_SYS_ACL_H,1,[Defines if your system have the sys/acl.h header file])] , )
2350 AC_CHECK_FUNC(acl_get_file,
2354 AC_CHECK_LIB(acl, acl_get_file,
2357 FDLIBS="-lacl $FDLIBS"
2359 AC_CHECK_LIB(pacl, acl_get_file,
2362 FDLIBS="-lpacl $FDLIBS"
2364 AC_CHECK_LIB(sec, acltotext,
2367 FDLIBS="-lsec $FDLIBS"
2369 AC_CHECK_LIB(sec, acl_totext,
2371 have_extended_acl=yes
2383 if test x$support_acl = xyes -a $have_acl != yes; then
2384 AC_MSG_ERROR([acl support explicitly enabled but no supported acl implementation found,
2385 please either load the acl libraries or rerun configure without --enable-acl])
2387 if test $have_acl = yes; then
2388 AC_DEFINE([HAVE_ACL],1,[Normal acl support])
2391 if test $have_extended_acl = yes; then
2392 AC_DEFINE([HAVE_EXTENDED_ACL],1,[Extended acl support])
2398 dnl Check for XATTR support
2401 AC_ARG_ENABLE(xattr,
2402 AC_HELP_STRING([--disable-xattr], [disable xattr support @<:@default=auto@:>@]),
2404 if test x$enableval = xyes; then
2406 elif test x$enableval = xno; then
2413 if test x$support_xattr = xyes -o x$support_xattr = xauto; then
2415 dnl First check for *BSD support
2417 AC_CHECK_HEADER(sys/extattr.h, [ AC_DEFINE(HAVE_SYS_EXTATTR_H,1,[Defines if your system have the sys/extattr.h header file])] , )
2418 AC_CHECK_HEADER(libutil.h, [ AC_DEFINE(HAVE_LIBUTIL_H,1,[Defines if your system have the libutil.h header file])] , )
2419 AC_CHECK_FUNCS(extattr_get_link extattr_set_link extattr_list_link,
2422 AC_DEFINE([HAVE_EXTATTR_GET_LINK],1,[Define to 1 if you have the 'extattr_get_link' function.])
2423 AC_DEFINE([HAVE_EXTATTR_SET_LINK],1,[Define to 1 if you have the 'extattr_set_link' function.])
2424 AC_DEFINE([HAVE_EXTATTR_LIST_LINK],1,[Define to 1 if you have the 'extattr_list_link' function.])
2428 if test $have_xattr = no; then
2429 AC_CHECK_FUNCS(extattr_get_file extattr_set_file extattr_list_file,
2432 AC_DEFINE([HAVE_EXTATTR_GET_FILE],1,[Define to 1 if you have the 'extattr_get_file' function.])
2433 AC_DEFINE([HAVE_EXTATTR_SET_FILE],1,[Define to 1 if you have the 'extattr_set_file' function.])
2434 AC_DEFINE([HAVE_EXTATTR_LIST_FILE],1,[Define to 1 if you have the 'extattr_list_file' function.])
2439 if test $have_xattr = yes; then
2440 have_extattr_string_in_libc=no
2441 AC_CHECK_FUNCS(extattr_namespace_to_string extattr_string_to_namespace,
2443 have_extattr_string_in_libc=yes
2444 AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2445 AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2450 dnl If extattr_namespace_to_string and extattr_string_to_namespace are not in libc see if they are in libutil
2452 if test $have_extattr_string_in_libc = no; then
2453 AC_CHECK_LIB(util, extattr_namespace_to_string extattr_string_to_namespace,
2455 AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2456 AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2457 FDLIBS="-lutil $FDLIBS"
2464 dnl If we failed to find *BSD support try the Linux or OSX implementation of xattr
2466 if test $have_xattr = no; then
2467 AC_CHECK_HEADER(sys/xattr.h, [ AC_DEFINE(HAVE_SYS_XATTR_H,1,[Defines if your system have the sys/xattr.h header file])] , )
2468 AC_CHECK_FUNCS(llistxattr lgetxattr lsetxattr,
2471 AC_DEFINE([HAVE_LLISTXATTR],1,[Define to 1 if you have the 'llistxattr' function.])
2472 AC_DEFINE([HAVE_LGETXATTR],1,[Define to 1 if you have the 'lgetxattr' function.])
2473 AC_DEFINE([HAVE_LSETXATTR],1,[Define to 1 if you have the 'lsetxattr' function.])
2477 if test $have_xattr = no; then
2478 AC_CHECK_FUNCS(listxattr getxattr setxattr,
2481 AC_DEFINE([HAVE_LISTXATTR],1,[Define to 1 if you have the 'listxattr' function.])
2482 AC_DEFINE([HAVE_GETXATTR],1,[Define to 1 if you have the 'getxattr' function.])
2483 AC_DEFINE([HAVE_SETXATTR],1,[Define to 1 if you have the 'setxattr' function.])
2490 dnl If we failed to find *BSD support and the Linux or OSX implementation of xattr try the Solaris xattr implementation
2492 if test $have_xattr = no; then
2493 AC_CHECK_HEADER(sys/attr.h, [ AC_DEFINE(HAVE_SYS_ATTR_H,1,[Defines if your system have the sys/attr.h header file])] , )
2494 AC_CHECK_HEADER(sys/nvpair.h, [ AC_DEFINE(HAVE_SYS_NVPAIR_H,1,[Defines if your system have the sys/nvpair.h header file])] , )
2495 AC_CHECK_HEADER(attr.h, [ AC_DEFINE(HAVE_ATTR_H,1,[Defines if your system have the attr.h header file])] , )
2497 AC_CHECK_FUNCS(openat fstatat unlinkat fchownat futimesat,
2500 AC_DEFINE([HAVE_OPENAT],1,[Define to 1 if you have the 'openat' function.])
2501 AC_DEFINE([HAVE_FSTATAT],1,[Define to 1 if you have the 'fstatat' function.])
2502 AC_DEFINE([HAVE_UNLINKAT],1,[Define to 1 if you have the 'unlinkat' function.])
2503 AC_DEFINE([HAVE_FCHOWNAT],1,[Define to 1 if you have the 'fchownat' function.])
2504 AC_DEFINE([HAVE_FUTIMESAT],1,[Define to 1 if you have the 'futimesat' function.])
2508 if test $have_xattr = yes; then
2509 AC_CHECK_LIB(nvpair, nvlist_next_nvpair,
2511 AC_DEFINE([HAVE_NVLIST_NEXT_NVPAIR],1,[Define to 1 if you have the 'nvlist_next_nvpair' function.])
2512 FDLIBS="-lnvpair $FDLIBS"
2518 if test x$support_xattr = xyes -a $have_xattr != yes; then
2519 AC_MSG_ERROR([xattr support explicitly enabled but no supported xattr implementation found,
2520 please either load the xattr libraries or rerun configure without --enable-xattr])
2522 if test $have_xattr = yes; then
2523 AC_DEFINE([HAVE_XATTR],1,[Extended Attributes support])
2529 dnl Check for pthread libraries
2532 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
2534 AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
2536 AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
2538 AC_CHECK_FUNC(pthread_create)
2547 dnl Check for headers, functions and libraries required to support
2548 dnl keeping readall capabilities
2550 AC_CHECK_HEADERS(sys/prctl.h sys/capability.h)
2551 AC_CHECK_FUNCS(prctl setreuid)
2552 AC_CHECK_LIB([cap], [cap_set_proc], [CAP_LIBS="-lcap"], [CAP_LIBS=])
2553 if test x$CAP_LIBS = x-lcap; then
2554 AC_DEFINE(HAVE_LIBCAP, 1, [Define if you have libcap])
2563 if test x$have_gcc = xyes ; then
2564 CPPFLAGS="$CPPFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
2565 CFLAGS="$CFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
2567 LDFLAGS=${LDFLAGS--O}
2568 DB_LIBS="${SQL_LFLAGS}"
2569 CPPFLAGS="$CPPFLAGS"
2582 AC_SUBST(X_EXTRA_LIBS)
2587 dnl extra configurable objects
2598 dnl Finally we set appropriate distribution specific
2599 dnl variables and defaults
2601 dnl PFILES are platform specific files
2602 PFILES="platforms/Makefile"
2607 hostname=`uname -n | cut -d '.' -f 1`
2608 if test x${hostname} = x ; then
2609 hostname="localhost"
2611 dnl Make sure hostname is resolved
2612 ping -c 1 $hostname 2>/dev/null 1>/dev/null
2613 if test ! $? = 0; then
2614 hostname="localhost"
2620 PSCMD="ps -e -o pid,comm"
2622 platforms/aix/Makefile"
2623 TAPEDRIVE="/dev/rmt0.1"
2627 PTHREAD_LIB="-lpthread -lexc"
2628 if test "${CC}" = "gcc" ; then
2635 TAPEDRIVE="/dev/nrmt0"
2638 DISTVER=`uname -a |awk '{print $3}'`
2639 TAPEDRIVE="/dev/nrmt0"
2640 PTHREAD_LIB="-pthread"
2641 CFLAGS="${CFLAGS} -pthread"
2642 PSCMD="ps -ax -o pid,command"
2646 platforms/bsdi/Makefile \
2647 platforms/bsdi/bacula-fd \
2648 platforms/bsdi/bacula-sd \
2649 platforms/bsdi/bacula-dir"
2650 largefile_support="yes"
2653 DISTVER=`uname -a |awk '{print $3}'`
2654 TAPEDRIVE="/dev/nrst0"
2657 WLDFLAGS="-mwindows"
2661 TAPEDRIVE="/dev/nst0"
2662 PSCMD="ps -e -o pid,command"
2665 platforms/darwin/Makefile"
2669 TAPEDRIVE="/dev/nst0"
2670 PSCMD="ps -e -o pid,command"
2673 platforms/osx/Makefile"
2676 if `test -f /etc/apt/sources.list && grep -q ubuntu /etc/apt/sources.list`; then
2679 DISTVER=`cat /etc/debian_version`
2680 if test -f /etc/lsb-release ; then
2682 if test "x$DISTRIB_ID" != "x" ; then
2683 DISTNAME=$DISTRIB_ID
2685 if test "x$DISTRIB_RELEASE" != "x" ; then
2686 DISTVER=$DISTRIB_RELEASE
2689 if test "$DISTNAME" = "Ubuntu" ; then
2692 TAPEDRIVE="/dev/nst0"
2693 PSCMD="ps -e -o pid,command"
2694 if test "$DISTNAME" = "ubuntu" ; then
2696 platforms/ubuntu/Makefile \
2697 platforms/ubuntu/bacula-fd \
2698 platforms/ubuntu/bacula-sd \
2699 platforms/ubuntu/bacula-dir"
2702 platforms/debian/Makefile \
2703 platforms/debian/bacula-fd \
2704 platforms/debian/bacula-sd \
2705 platforms/debian/bacula-dir"
2709 DISTVER=`uname -a |awk '{print $3}'`
2710 VER=`echo $DISTVER | cut -c 1`
2711 if test x$VER = x4 ; then
2712 PTHREAD_LIB="${PTHREAD_LIBS:--pthread}"
2713 CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS:--pthread}"
2717 TAPEDRIVE="/dev/nrsa0"
2718 PSCMD="ps -ax -o pid,command"
2720 platforms/freebsd/Makefile \
2721 platforms/freebsd/bacula-fd \
2722 platforms/freebsd/bacula-sd \
2723 platforms/freebsd/bacula-dir"
2724 largefile_support="yes"
2727 PSCMD="UNIX95=1; ps -e -o pid,comm"
2728 CFLAGS="${CFLAGS} -D_XOPEN_SOURCE_EXTENDED=1"
2730 TAPEDRIVE="/dev/rmt/0hnb"
2731 PTHREAD_LIB="-lpthread"
2732 AC_DEFINE([_INCLUDE_LONGLONG])
2736 TAPEDRIVE="/dev/rmt/0cbn"
2737 PSCMD="ps -e -o pid,comm"
2739 platforms/irix/Makefile \
2740 platforms/irix/bacula-fd \
2741 platforms/irix/bacula-sd \
2742 platforms/irix/bacula-dir"
2745 DISTVER=`uname -a |awk '{print $3}'`
2748 TAPEDRIVE="/dev/nrst0"
2749 PSCMD="ps -ax -o pid,command"
2750 PTHREAD_LIB="-pthread"
2751 CFLAGS="${CFLAGS} -pthread"
2754 DISTVER=`uname -a |awk '{print $3}'`
2757 TAPEDRIVE="/dev/nrst0"
2758 PSCMD="ps -ax -o pid,command"
2759 PTHREAD_LIB="-pthread"
2760 CFLAGS="${CFLAGS} -pthread"
2762 platforms/openbsd/Makefile \
2763 platforms/openbsd/bacula-fd \
2764 platforms/openbsd/bacula-sd \
2765 platforms/openbsd/bacula-dir"
2768 if test -f /etc/whitebox-release ; then
2769 f=/etc/whitebox-release
2771 f=/etc/redhat-release
2773 if test `cat $f | grep release |\
2774 cut -f 3 -d ' '`x = "Enterprise"x ; then
2775 DISTVER="Enterprise "`cat $f | grep release |\
2778 DISTVER=`cat /etc/redhat-release | grep release |\
2781 TAPEDRIVE="/dev/nst0"
2782 PSCMD="ps -e -o pid,command"
2784 platforms/redhat/Makefile \
2785 platforms/redhat/bacula-fd \
2786 platforms/redhat/bacula-sd \
2787 platforms/redhat/bacula-dir
2791 DISTVER=`cat /etc/mandrake-release | grep release |\
2793 TAPEDRIVE="/dev/nst0"
2794 PSCMD="ps -e -o pid,command"
2796 platforms/mandrake/Makefile \
2797 platforms/mandrake/bacula-fd \
2798 platforms/mandrake/bacula-sd \
2799 platforms/mandrake/bacula-dir \
2800 platforms/mandrake/bacula.spec \
2804 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
2805 TAPEDRIVE="/dev/nst0"
2806 PSCMD="ps -e -o pid,command"
2808 platforms/gentoo/Makefile \
2809 platforms/gentoo/bacula-init \
2810 platforms/gentoo/bacula-fd \
2811 platforms/gentoo/bacula-sd \
2812 platforms/gentoo/bacula-dir"
2815 DISTVER=`cat /etc/slackware-version`
2816 TAPEDRIVE="/dev/nst0"
2817 PSCMD="ps -e -o pid,command"
2819 platforms/slackware/Makefile \
2820 platforms/slackware/rc.bacula-fd \
2821 platforms/slackware/rc.bacula-sd \
2822 platforms/slackware/rc.bacula-dir\
2823 platforms/slackware/functions.bacula"
2827 TAPEDRIVE="/dev/rmt/0cbn"
2828 PSCMD="ps -e -o pid,comm"
2830 platforms/solaris/Makefile \
2831 platforms/solaris/bacula-fd \
2832 platforms/solaris/bacula-sd \
2833 platforms/solaris/bacula-dir"
2834 if test x$DISTVER = x5.6 ; then
2835 AC_DEFINE(HAVE_OLD_SOCKOPT)
2837 LIBS="$LIBS -lresolv"
2840 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
2842 TAPEDRIVE="/dev/nst0"
2843 PSCMD="ps -e -o pid,command"
2845 platforms/suse/Makefile \
2846 platforms/suse/bacula-fd \
2847 platforms/suse/bacula-sd \
2848 platforms/suse/bacula-dir \
2849 platforms/suse/bacula \
2850 platforms/suse/bacula.spec"
2855 TAPEDRIVE="/dev/nst0"
2856 PSCMD="ps -e -o pid,command"
2858 platforms/suse/Makefile \
2859 platforms/suse/bacula-fd \
2860 platforms/suse/bacula-sd \
2861 platforms/suse/bacula-dir"
2865 TAPEDRIVE="/dev/nst0"
2868 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
2874 LIBS="$PTHREAD_LIB $LIBS"
2876 AC_DEFINE_UNQUOTED(lld, "$lld")
2877 AC_DEFINE_UNQUOTED(llu, "$llu")
2885 dnl common parts of the Makefile
2886 MCOMMON=./autoconf/Make.common
2887 AC_SUBST_FILE(MCOMMON)
2890 if test "x${subsysdir}" = "x${sbindir}" ; then
2893 echo "You have set both --sbindir and --with-subsys-dir"
2894 echo " equal to: ${subsysdir} "
2895 echo "This is not permitted. Please reconfigure."
2897 echo "Aborting configuration ..."
2903 AC_OUTPUT([autoconf/Make.common \
2906 scripts/startmysql \
2908 scripts/btraceback \
2914 scripts/bacula-ctl-dir \
2915 scripts/bacula-ctl-fd \
2916 scripts/bacula-ctl-sd \
2917 scripts/devel_bacula \
2920 scripts/bacula.desktop.gnome1 \
2921 scripts/bacula.desktop.gnome2 \
2922 scripts/bacula.desktop.gnome1.consolehelper \
2923 scripts/bacula.desktop.gnome2.consolehelper \
2924 scripts/bacula.desktop.gnome1.xsu \
2925 scripts/bacula.desktop.gnome2.xsu \
2926 scripts/bgnome-console.console_apps \
2927 scripts/mtx-changer \
2928 scripts/disk-changer \
2929 scripts/dvd-handler \
2930 scripts/dvd-simulator \
2931 scripts/bacula-tray-monitor.desktop \
2932 scripts/logwatch/Makefile \
2933 scripts/logwatch/logfile.bacula.conf \
2934 scripts/wxconsole.console_apps \
2935 scripts/wxconsole.desktop.consolehelper \
2936 scripts/wxconsole.desktop.xsu \
2937 scripts/bat.desktop \
2938 scripts/bat.desktop.xsu \
2939 scripts/bat.desktop.consolehelper \
2940 scripts/bat.console_apps \
2943 src/console/Makefile \
2944 src/console/bconsole.conf \
2945 src/qt-console/bat.conf \
2946 src/qt-console/bat.pro \
2947 src/qt-console/bat.pro.mingw32 \
2948 src/qt-console/install_conf_file \
2949 src/wx-console/Makefile \
2950 src/wx-console/bwx-console.conf \
2951 src/tray-monitor/Makefile \
2952 src/tray-monitor/tray-monitor.conf \
2954 src/dird/bacula-dir.conf \
2956 src/stored/Makefile \
2957 src/stored/bacula-sd.conf \
2958 src/filed/Makefile \
2959 src/filed/bacula-fd.conf \
2961 src/cats/make_catalog_backup \
2962 src/cats/delete_catalog_backup \
2963 src/cats/create_postgresql_database \
2964 src/cats/update_postgresql_tables \
2965 src/cats/make_postgresql_tables \
2966 src/cats/grant_postgresql_privileges \
2967 src/cats/drop_postgresql_tables \
2968 src/cats/drop_postgresql_database \
2969 src/cats/create_mysql_database \
2970 src/cats/update_mysql_tables \
2971 src/cats/make_mysql_tables \
2972 src/cats/grant_mysql_privileges \
2973 src/cats/drop_mysql_tables \
2974 src/cats/drop_mysql_database \
2975 src/cats/create_sqlite3_database \
2976 src/cats/update_sqlite3_tables \
2977 src/cats/make_sqlite3_tables \
2978 src/cats/grant_sqlite3_privileges \
2979 src/cats/drop_sqlite3_tables \
2980 src/cats/drop_sqlite3_database \
2983 src/cats/create_bdb_database \
2984 src/cats/update_bdb_tables \
2985 src/cats/make_bdb_tables \
2986 src/cats/grant_bdb_privileges \
2987 src/cats/drop_bdb_tables \
2988 src/cats/drop_bdb_database \
2989 src/cats/create_bacula_database \
2990 src/cats/update_bacula_tables \
2991 src/cats/grant_bacula_privileges \
2992 src/cats/make_bacula_tables \
2993 src/cats/drop_bacula_tables \
2994 src/cats/drop_bacula_database \
2995 src/findlib/Makefile \
2996 src/tools/Makefile \
2997 src/plugins/fd/Makefile \
2998 src/plugins/sd/Makefile \
2999 src/plugins/dir/Makefile \
3000 src/win32/Makefile.inc \
3002 updatedb/update_mysql_tables_9_to_10 \
3003 updatedb/update_sqlite3_tables_9_to_10 \
3004 updatedb/update_postgresql_tables_9_to_10 \
3005 updatedb/update_mysql_tables_10_to_11 \
3006 updatedb/update_sqlite3_tables_10_to_11 \
3007 updatedb/update_postgresql_tables_10_to_11 \
3008 examples/nagios/check_bacula/Makefile \
3013 if test "${support_bat}" = "yes" ; then
3014 if test "x$QMAKE" = "xnone" && test "x$QMAKEQT4" = "xnone"; then
3015 AC_MSG_ERROR([Could not find qmake or qmake-qt4 in $PATH. Check your Qt installation])
3020 if test "x$QMAKEQT4" != "xnone"; then
3025 echo "Creating bat Makefile"
3034 dnl if CC is gcc, we can rebuild the dependencies (since the depend rule
3035 dnl requires gcc). If it's not, don't rebuild dependencies
3037 if test X"$GCC" = "Xyes" ; then
3038 echo "Doing make of dependencies"
3039 ${MAKE:-make} depend
3043 chmod 755 install_conf_file build-depkgs-qt-console
3047 chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
3048 chmod 755 dvd-handler dvd-simulator breload make_catalog_backup.pl
3049 chmod 755 bconsole gconsole mtx-changer devel_bacula logrotate
3053 chmod 755 $c/update_mysql_tables_10_to_11 $c/update_sqlite3_tables_10_to_11
3054 chmod 755 $c/update_postgresql_tables_10_to_11
3058 chmod 755 $c/create_bacula_database $c/update_bacula_tables $c/make_bacula_tables
3059 chmod 755 $c/grant_bacula_privileges $c/drop_bacula_tables $c/drop_bacula_database
3061 chmod 755 $c/create_bdb_database $c/update_bdb_tables $c/make_bdb_tables
3062 chmod 755 $c/grant_bdb_privileges $c/drop_bdb_tables $c/drop_bdb_database
3064 chmod 755 $c/create_mysql_database $c/update_mysql_tables $c/make_mysql_tables
3065 chmod 755 $c/grant_mysql_privileges $c/drop_mysql_tables $c/drop_mysql_database
3067 chmod 755 $c/create_sqlite3_database $c/update_sqlite3_tables $c/make_sqlite3_tables
3068 chmod 755 $c/grant_sqlite3_privileges $c/drop_sqlite3_tables $c/drop_sqlite3_database
3070 chmod 755 $c/create_postgresql_database $c/update_postgresql_tables $c/make_postgresql_tables
3071 chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables $c/drop_postgresql_database
3073 chmod 755 $c/make_catalog_backup $c/delete_catalog_backup
3077 chmod 755 src/win32/build-depkgs-mingw32
3079 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
3080 largefile_support="yes"
3083 dnl Only try to find out the version number of the compiler when we know its some kind of GCC compiler
3084 if test X"$GCC" = "Xyes" ; then
3086 dnl A whole lot of hand springs to get the compiler version.
3087 dnl This is because gcc changed the output in version 3.0
3089 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3090 if test "x${CCVERSION}" = "x" ; then
3091 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3093 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3094 if test x"${CXXVERSION}" = x ; then
3095 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3099 # clean up any old junk
3105 if test "x${db_type}" = "xInternal" ; then
3108 echo "You have not specified either --enable-client-only or one of the"
3109 echo " supported databases: MySQL, PostgreSQL, SQLite3, SQLite or DBI."
3110 echo " This is not permitted. Please reconfigure."
3112 echo "Aborting the configuration ..."
3119 Configuration on `date`:
3121 Host: ${host}${post_host} -- ${DISTNAME} ${DISTVER}
3122 Bacula version: ${BACULA} ${VERSION} (${DATE})
3123 Source code location: ${srcdir}
3124 Install binaries: ${sbindir}
3125 Install libraries: ${libdir}
3126 Install config files: ${sysconfdir}
3127 Scripts directory: ${scriptdir}
3128 Archive directory: ${archivedir}
3129 Working directory: ${working_dir}
3130 PID directory: ${piddir}
3131 Subsys directory: ${subsysdir}
3132 Man directory: ${mandir}
3133 Data directory: ${datarootdir}
3134 Plugin directory: ${plugindir}
3135 C Compiler: ${CC} ${CCVERSION}
3136 C++ Compiler: ${CXX} ${CXXVERSION}
3137 Compiler flags: ${WCFLAGS} ${CFLAGS}
3138 Linker flags: ${WLDFLAGS} ${LDFLAGS}
3140 Statically Linked Tools: ${support_static_tools}
3141 Statically Linked FD: ${support_static_fd}
3142 Statically Linked SD: ${support_static_sd}
3143 Statically Linked DIR: ${support_static_dir}
3144 Statically Linked CONS: ${support_static_cons}
3145 Database type: ${db_type}
3146 Database port: ${db_port}
3147 Database lib: ${DB_LIBS}
3148 Database name: ${db_name}
3149 Database user: ${db_user}
3151 Job Output Email: ${job_email}
3152 Traceback Email: ${dump_email}
3153 SMTP Host Address: ${smtp_host}
3155 Director Port: ${dir_port}
3156 File daemon Port: ${fd_port}
3157 Storage daemon Port: ${sd_port}
3159 Director User: ${dir_user}
3160 Director Group: ${dir_group}
3161 Storage Daemon User: ${sd_user}
3162 Storage DaemonGroup: ${sd_group}
3163 File Daemon User: ${fd_user}
3164 File Daemon Group: ${fd_group}
3166 SQL binaries Directory ${SQL_BINDIR}
3168 Large file support: $largefile_support
3169 Bacula conio support: ${got_conio} ${CONS_LIBS}
3170 readline support: ${got_readline} ${PRTREADLINE_SRC}
3171 TCP Wrappers support: ${TCPW_MSG} ${WRAPLIBS}
3172 TLS support: ${support_tls}
3173 Encryption support: ${support_crypto}
3174 ZLIB support: ${have_zlib}
3175 enable-smartalloc: ${support_smartalloc}
3176 enable-lockmgr: ${support_lockmgr}
3177 bat support: ${support_bat} ${QWT_LDFLAGS}
3178 enable-gnome: ${support_gnome} ${gnome_version}
3179 enable-bwx-console: ${support_wx_console} ${wx_version}
3180 enable-tray-monitor: ${support_tray_monitor}
3181 client-only: ${build_client_only}
3182 build-dird: ${build_dird}
3183 build-stored: ${build_stored}
3184 ACL support: ${have_acl}
3185 XATTR support: ${have_xattr}
3186 Python support: ${support_python} ${PYTHON_LIBS}
3187 Batch insert enabled: ${support_batch_insert}