3 dnl Process this file with autoconf to produce a configure script.
12 AC_CONFIG_AUX_DIR(${BUILD_DIR}/autoconf)
13 AC_CONFIG_HEADER(src/config.h:autoconf/config.h.in)
15 dnl minimal Win32 stuff for "make clean"
16 WIN32BUILDDIR=${BUILD_DIR}/src/win32
17 WIN32MAINDIR=${BUILD_DIR}
18 WIN32TOPDIR=${TOP_DIR}
19 AC_SUBST(WIN32BUILDDIR)
20 AC_SUBST(WIN32MAINDIR)
23 dnl require a recent autoconf
27 dnl search for true and false programs.
28 AC_PATH_PROGS(TRUEPRG, true, :)
29 AC_PATH_PROGS(FALSEPRG, false, :)
34 if test "x$BACULA" != x; then
35 post_host=`echo -${BACULA} | tr 'A-Z ' 'a-z-'`
37 BACULA=${BACULA:-Bacula}
38 VERSION=`sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
39 DATE=`sed -n -e 's/^.*[ \t]*BDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
40 LSMDATE=`sed -n -e 's/^.*LSMDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
45 AC_SUBST(post_host)dnl
46 echo "configuring for ${BACULA} $VERSION ($DATE)"
48 dnl -------------------------------------------------------
49 dnl Check for compiler.
50 dnl ------------------------------------------------------
54 AC_PROG_CC_C_O dnl Determine if C compiler support -c -o.
55 AC_PROG_GCC_TRADITIONAL dnl Determine if ioctl() need -traditional.
59 if test "x$BASECC" = xgcc; then
63 AC_PATH_PROG(CXX, $CXX, $CXX)
64 if test ! -e $CXX; then
65 AC_MSG_ERROR(Unable to find C++ compiler)
68 dnl -------------------------------------------------------
69 dnl Check for programs.
70 dnl ------------------------------------------------------
72 AC_PATH_PROG(MV, mv, mv)
74 dnl If we name the variable RM it will shadow the RM variable in the configure script and we overwrite the
75 dnl value with the name of the rm command and not rm -f which is its normal content. This gives all kind
76 dnl of strange output of the configure script (like things don't exist etc.).
77 dnl So we name it REMOVE (more software has run into this problem)
78 AC_PATH_PROG(REMOVE, rm, rm)
79 AC_PATH_PROG(CP, cp, cp)
80 AC_PATH_PROG(SED, sed, sed)
81 AC_PATH_PROG(ECHO, echo, echo)
82 AC_PATH_PROG(CMP, cmp, cmp)
83 AC_PATH_PROG(TBL, tbl, tbl)
84 AC_PATH_PROG(AR, ar, ar)
85 AC_PATH_PROG(OPENSSL, openssl, none)
86 AC_PATH_PROG(MTX, mtx, mtx)
87 AC_PATH_PROG(DD, dd, dd)
88 AC_PATH_PROG(MKISOFS, mkisofs, mkisofs)
89 AC_PATH_PROG(PYTHON, python, python)
90 AC_PATH_PROG(GROWISOFS, growisofs, growisofs)
91 AC_PATH_PROG(DVDRWMEDIAINFO, dvd+rw-mediainfo, dvd+rw-mediainfo)
92 AC_PATH_PROG(DVDRWFORMAT, dvd+rw-format, dvd+rw-format)
93 AC_PATH_PROG(PKGCONFIG, pkg-config, pkg-config)
94 AC_PATH_PROG(QMAKE, qmake, none)
95 AC_PATH_PROG(QMAKEQT4, qmake-qt4, none)
96 AC_PATH_PROG(GMAKE, gmake, none)
97 AC_ARG_VAR(WXCONFIG, [wx-config command. On some systems, you must set it to wx-config-2.6 to use wxWidgets 2.6.])
98 if test "x$WXCONFIG" = x; then
101 AC_PATH_PROG(WXCONFIG, ${WXCONFIG}, ${WXCONFIG})
102 AC_ARG_VAR(WXFLAGS, [Parameters to pass to wx-config (e.g. --unicode=no).])
103 AC_PATH_PROG(CDRECORD, cdrecord, cdrecord)
104 AC_PATH_PROG(PIDOF, pidof, pidof)
106 # Some AWK programs fail, so test it and warn the user
107 if echo xfoo | $AWK 'BEGIN { prog=ARGV[1]; ARGC=1 }
108 { if ((prog == $2) || (("(" prog ")") == $2) ||
109 (("[" prog "]") == $2) ||
110 ((prog ":") == $2)) { print $1 ; exit 0 } }' xfoo>/dev/null; then :;
112 AC_MSG_ERROR([!!!!!!!!! WARNING !!!!!!!!!!!!!!
113 The regex engine of $AWK is too broken to be used you
114 might want to install GNU AWK.
115 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!])
118 AC_PATH_PROG(AWK, $THE_AWK, $THE_AWK)
121 test -n "$ARFLAG" || ARFLAGS="cr"
128 AC_SUBST(LOCAL_CFLAGS)
129 AC_SUBST(LOCAL_LDFLAGS)
132 dnl --------------------------------------------------
134 dnl --------------------------------------------------
135 AC_ARG_ENABLE(libtool,
136 AC_HELP_STRING([--enable-libtool], [enable building using GNU libtool @<:@default=yes@:>@]),
138 if test x$enableval = xno; then
143 LT_INIT([shared disable-static])
146 if test x$use_libtool != xno; then
147 DEFAULT_OBJECT_TYPE=".lo"
148 DEFAULT_ARCHIVE_TYPE=".la"
149 DEFAULT_SHARED_OBJECT_TYPE=".la"
150 LIBTOOL="\$(LIBTOOL)"
151 LIBTOOL_INSTALL_TARGET="libtool-install"
152 LIBTOOL_UNINSTALL_TARGET="libtool-uninstall"
153 LIBTOOL_CLEAN_TARGET="libtool-clean"
154 QMAKE_LIBTOOL="${BUILD_DIR}/libtool"
156 DEFAULT_OBJECT_TYPE=".o"
157 DEFAULT_ARCHIVE_TYPE=".a"
158 DEFAULT_SHARED_OBJECT_TYPE=".so"
159 LIBTOOL="# \$(LIBTOOL)"
160 LIBTOOL_INSTALL_TARGET=""
161 LIBTOOL_UNINSTALL_TARGET=""
162 LIBTOOL_CLEAN_TARGET=""
163 QMAKE_LIBTOOL="# ${BUILD_DIR}/libtool"
166 AC_SUBST(DEFAULT_OBJECT_TYPE)
167 AC_SUBST(DEFAULT_ARCHIVE_TYPE)
168 AC_SUBST(DEFAULT_SHARED_OBJECT_TYPE)
170 AC_SUBST(LIBTOOL_INSTALL_TARGET)
171 AC_SUBST(LIBTOOL_UNINSTALL_TARGET)
172 AC_SUBST(LIBTOOL_CLEAN_TARGET)
173 AC_SUBST(QMAKE_LIBTOOL)
175 dnl --------------------------------------------------
176 dnl Include file handling
177 dnl --------------------------------------------------
178 AC_ARG_ENABLE(includes,
179 AC_HELP_STRING([--enable-includes], [enable installing of include files @<:@default=no@:>@]),
181 if test x$enableval = xyes; then
187 dnl It only makes sense to install include files when you install libraries which only happens when
188 dnl libtool is enabled
190 if test x$use_libtool != xno -a x$install_includes = xyes; then
191 INCLUDE_INSTALL_TARGET="install-includes"
192 INCLUDE_UNINSTALL_TARGET="uninstall-includes"
194 INCLUDE_INSTALL_TARGET=""
195 INCLUDE_UNINSTALL_TARGET=""
197 AC_SUBST(INCLUDE_INSTALL_TARGET)
198 AC_SUBST(INCLUDE_UNINSTALL_TARGET)
200 dnl --------------------------------------------------
201 dnl Bacula OP Sys determination (see aclocal.m4)
202 dnl --------------------------------------------------
205 dnl -----------------------------------------------------------
206 dnl Bacula OPSys Distribution determination (see aclocal.m4)
207 dnl ----------------------------------------------------------
208 BA_CHECK_OPSYS_DISTNAME
210 dnl --------------------------------------------------
211 dnl Suppport for gettext (translations)
212 dnl By default, $datarootdir is ${prefix}/share
213 dnl --------------------------------------------------
214 AM_GNU_GETTEXT([external])
216 dnl ------------------------------------------------------------------
217 dnl If the user has not set --prefix, we set our default to nothing.
218 dnl In this case, if the user has not set --sysconfdir, we set it
219 dnl to the package default of /etc/bacula. If either --prefix or
220 dnl --sysconfdir is set, we leave sysconfdir alone except to eval it.
221 dnl If the user has not set --libdir, we set it to the package
222 dnl default of /usr/lib. If either --prefix or --libdir is set,
223 dnl we leave libdir alone except to eval it. If the user has not set
224 dnl --includedir, we set it to the package default of /usr/include.
225 dnl If either --prefix or --includedir is set, we leave includedir
226 dnl alone except to eval it
227 dnl ------------------------------------------------------------------
228 if test x${prefix} = xNONE ; then
229 if test `eval echo ${sysconfdir}` = NONE/etc ; then
230 sysconfdir=/etc/bacula
233 if test `eval echo ${libdir}` = NONE/lib ; then
237 if test `eval echo ${includedir}` = NONE/include ; then
238 includedir=/usr/include
241 if test `eval echo ${datarootdir}` = NONE/share ; then
242 datarootdir=/usr/share
247 dnl -------------------------------------------------------------------------
248 dnl If the user has not set --exec-prefix, we default to ${prefix}
249 dnl -------------------------------------------------------------------------
250 if test x${exec_prefix} = xNONE ; then
251 exec_prefix=${prefix}
254 sysconfdir=`eval echo ${sysconfdir}`
255 datarootdir=`eval echo ${datarootdir}`
256 docdir=`eval echo ${docdir}`
257 htmldir=`eval echo ${htmldir}`
258 libdir=`eval echo ${libdir}`
259 includedir=`eval echo ${includedir}`
260 localedir=`eval echo ${datarootdir}/locale`
261 AC_DEFINE_UNQUOTED(SYSCONFDIR, "$sysconfdir")
262 AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir")
264 dnl ------------------------------------------------------------------
265 dnl If the user has not set --sbindir, we set our default as /sbin
266 dnl ------------------------------------------------------------------
267 if test x$sbindir = x'${exec_prefix}/sbin' ; then
268 sbindir=${exec_prefix}/sbin
270 sbindir=`eval echo ${sbindir}`
272 dnl -------------------------------------------------------------------------
273 dnl If the user has not set --mandir, we default to /usr/share/man
274 dnl -------------------------------------------------------------------------
275 if test x$mandir = x'${prefix}/man' ; then
276 mandir=/usr/share/man
279 dnl -------------------------------------------------------------------------
280 dnl If the user has not set --htmldir, we default to /usr/share/doc/bacula/html
281 dnl -------------------------------------------------------------------------
282 if test x$htmldir = x${docdir} ; then
283 htmldir=`eval echo ${docdir}bacula/html`
286 dnl -------------------------------------------------------------------------
287 dnl If the user has not set --docdir, we default to /usr/share/doc/
288 dnl -------------------------------------------------------------------------
289 if test x$docdir = x'/usr/share/doc/' ; then
290 docdir=`eval echo ${docdir}bacula`
294 AC_PATH_PROGS(MSGFMT, msgfmt, no)
295 if test "$MSGFMT" = "no"
297 echo 'msgfmt program not found, disabling NLS !'
299 USE_INCLUDED_LIBINTL=no
307 support_postgresql=no
309 support_smartalloc=yes
314 support_wx_console=no
315 support_tray_monitor=no
320 support_static_tools=no
323 support_static_dir=no
324 support_static_cons=no
334 dnl --------------------------------------------------------------------------
335 dnl CHECKING COMMAND LINE OPTIONS
336 dnl --------------------------------------------------------------------------
338 dnl -------------------------------------------
339 dnl gnome (default off)
340 dnl -------------------------------------------
342 AC_HELP_STRING([--enable-gnome], [enable build of bgnome-console GUI @<:@default=no@:>@]),
344 if test x$enableval = xyes; then
351 if test x$support_gnome = xyes; then
352 abc=`$PKGCONFIG --exists libgnomeui-2.0`
354 if test $pkg = 0; then
355 GNOME_INCLUDEDIR=`$PKGCONFIG --cflags-only-I libgnomeui-2.0`
356 GNOMEUI_LIBS=`$PKGCONFIG --libs-only-l libgnomeui-2.0`
357 GNOME_LIBDIR=`$PKGCONFIG --libs libgnomeui-2.0`
358 GNOME_LIBS=`$PKGCONFIG --libs-only-l libgnomeui-2.0`
359 AC_SUBST(GNOME_INCLUDEDIR)
360 AC_SUBST(GNOMEUI_LIBS)
361 AC_SUBST(GNOME_LIBDIR)
363 GNOME_DIR=src/gnome2-console
364 gnome_version="Version 2.x"
366 AC_MSG_ERROR(Unable to find Gnome 2 installation)
371 dnl -------------------------------------------
372 dnl bat (default off)
373 dnl -------------------------------------------
375 AC_HELP_STRING([--enable-bat], [enable build of bat Qt4 GUI @<:@default=no@:>@]),
377 if test x$enableval = xyes; then
378 AC_DEFINE(HAVE_BAT, 1, [Set if Bacula bat Qt4 GUI support enabled])
385 if test x$support_bat = xyes; then
386 abc=`$PKGCONFIG --atleast-version=4.2 QtGui`
388 if test $pkg = 0; then
389 BAT_DIR=src/qt-console
391 AC_MSG_ERROR(Unable to find Qt4 installation needed by bat)
396 dnl If bat is enabled, we need the qwt library
404 if test x$support_bat = xyes; then
405 AC_MSG_CHECKING(for qwt support)
407 AC_HELP_STRING([--with-qwt@<:@=DIR@:>@], [specify qwt library directory]),
414 if test -f ${with_qwt}/include/qwt.h; then
415 QWT_INC="${with_qwt}/include"
416 QWT_LDFLAGS="-L${with_qwt}/lib"
426 dnl Search in standard places, or --with-qwt not specified
428 if test $no_qwt = no; then
429 if test x$QWT_INC = x; then
430 for root in /usr /usr/local; do
431 for ver in qwt qwt5 qwt-qt4; do
432 if test -f ${root}/include/${ver}/qwt.h; then
433 QWT_INC="${root}/include/${ver}"
434 if test -d ${root}/lib64/; then
435 QWT_LDFLAGS="-L${root}/lib64"
436 elif test -d ${root}/lib/64/; then
437 QWT_LDFLAGS="-L${root}/64"
439 QWT_LDFLAGS="-L${root}/lib"
450 if test x$QWT_INC = x; then
453 AC_DEFINE(HAVE_QWT, 1, [Set if bat QWT library found])
460 AC_SUBST(QWT_LDFLAGS)
464 dnl -------------------------------------------
465 dnl bwx-console (default off)
466 dnl -------------------------------------------
467 AC_ARG_ENABLE(bwx-console,
468 AC_HELP_STRING([--enable-bwx-console], [enable build of wxWidgets console @<:@default=no@:>@]),
470 if test x$enableval = xyes; then
471 support_wx_console=yes
477 if test x$support_wx_console = xyes; then
478 abc=`$WXCONFIG $WXFLAGS --cppflags`
480 if test $pkg = 0; then
481 wx_version="wxWidgets `$WXCONFIG $WXFLAGS --release`"
482 WXCONS_CPPFLAGS=`$WXCONFIG $WXFLAGS --cppflags`
483 WXCONS_LDFLAGS=`$WXCONFIG $WXFLAGS --libs`
485 AC_SUBST(WXCONS_CPPFLAGS)
486 AC_SUBST(WXCONS_LDFLAGS)
487 WX_DIR="src/wx-console"
490 echo "wx-config program not found. bwx-console disabled."
492 support_wx_console=no
497 dnl -------------------------------------------
498 dnl tray-monitor (default off)
499 dnl -------------------------------------------
500 AC_ARG_ENABLE(tray-monitor,
501 AC_HELP_STRING([--enable-tray-monitor], [enable build of Gnome tray monitor (compatible with KDE @<:@default=no@:>@]),
503 if test x$enableval = xyes; then
504 support_tray_monitor=yes
510 if test x$support_tray_monitor = xyes; then
511 abc=`$PKGCONFIG --exists gtk+-2.0`
513 if test $pkg = 0; then
514 TRAY_MONITOR_CPPFLAGS=`$PKGCONFIG --cflags gtk+-2.0`
515 TRAY_MONITOR_LDFLAGS=`$PKGCONFIG --libs gtk+-2.0`
516 AC_SUBST(TRAY_MONITOR_CPPFLAGS)
517 AC_SUBST(TRAY_MONITOR_LDFLAGS)
518 TRAY_MONITOR_DIR=src/tray-monitor
519 abc=`$PKGCONFIG --atleast-version=2.4 gtk+-2.0`
521 if test $pkg = 0; then
522 AC_DEFINE(HAVE_GTK_2_4, 1, [Set if you have GTK 4.2 or greater loaded])
526 AC_SUBST(TRAY_MONITOR_DIR)
528 dnl -------------------------------------------
529 dnl smartalloc (default off)
530 dnl -------------------------------------------
531 AC_ARG_ENABLE(smartalloc,
532 AC_HELP_STRING([--enable-smartalloc], [enable smartalloc debugging support @<:@default=no@:>@]),
534 if test x$enableval = xno; then
535 support_smartalloc=no
540 if test x$support_smartalloc = xyes; then
541 AC_DEFINE(SMARTALLOC, 1, [Set if you want Smartalloc enabled])
544 dnl -------------------------------------------
545 dnl Lock Manager (default off)
546 dnl -------------------------------------------
547 AC_ARG_ENABLE(lockmgr,
548 AC_HELP_STRING([--enable-lockmgr], [enable lock manager support @<:@default=no@:>@]),
550 if test x$enableval = xyes; then
556 if test x$support_lockmgr = xyes; then
557 AC_DEFINE(_USE_LOCKMGR, 1, [Set if you want Lock Manager enabled])
561 dnl -------------------------------------------
562 dnl static-tools (default off)
563 dnl -------------------------------------------
564 AC_ARG_ENABLE(static-tools,
565 AC_HELP_STRING([--enable-static-tools], [enable static tape tools @<:@default=no@:>@]),
567 if test x$enableval = xyes; then
568 if test x$use_libtool = xyes; then
569 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
570 please rerun configure with --disable-libtool])
572 support_static_tools=yes
578 if test x$support_static_tools = xyes; then
579 TTOOL_LDFLAGS="-static"
581 AC_SUBST(TTOOL_LDFLAGS)
583 dnl -------------------------------------------
584 dnl static-fd (default off)
585 dnl -------------------------------------------
586 AC_ARG_ENABLE(static-fd,
587 AC_HELP_STRING([--enable-static-fd], [enable static File daemon @<:@default=no@:>@]),
589 if test x$enableval = xyes; then
590 if test x$use_libtool = xyes; then
591 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
592 please rerun configure with --disable-libtool])
594 support_static_fd=yes
600 if test x$support_static_fd = xyes; then
601 STATIC_FD="static-bacula-fd"
605 dnl -------------------------------------------
606 dnl static-sd (default off)
607 dnl -------------------------------------------
608 AC_ARG_ENABLE(static-sd,
609 AC_HELP_STRING([--enable-static-sd], [enable static Storage daemon @<:@default=no@:>@]),
611 if test x$enableval = xyes; then
612 if test x$use_libtool = xyes; then
613 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
614 please rerun configure with --disable-libtool])
616 support_static_sd=yes
622 if test x$support_static_sd = xyes; then
623 STATIC_SD="static-bacula-sd"
627 dnl -------------------------------------------
628 dnl static-dir (default off)
629 dnl -------------------------------------------
630 AC_ARG_ENABLE(static-dir,
631 AC_HELP_STRING([--enable-static-dir], [enable static Director @<:@default=no@:>@]),
633 if test x$enableval = xyes; then
634 if test x$use_libtool = xyes; then
635 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
636 please rerun configure with --disable-libtool])
638 support_static_dir=yes
644 if test x$support_static_dir = xyes; then
645 STATIC_DIR="static-bacula-dir"
649 dnl -------------------------------------------
650 dnl static-cons (default off)
651 dnl -------------------------------------------
652 AC_ARG_ENABLE(static-cons,
653 AC_HELP_STRING([--enable-static-cons], [enable static Console @<:@default=no@:>@]),
655 if test x$enableval = xyes; then
656 if test x$use_libtool = xyes; then
657 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
658 please rerun configure with --disable-libtool])
660 support_static_cons=yes
668 if test x$support_static_cons = xyes; then
669 STATIC_CONS="static-bconsole"
670 STATIC_GNOME_CONS="static-bgnome-console"
671 STATIC_WX_CONS="static-bwx-console"
673 AC_SUBST(STATIC_CONS)
674 AC_SUBST(STATIC_GNOME_CONS)
675 AC_SUBST(STATIC_WX_CONS)
677 dnl -------------------------------------------
678 dnl client_only (default off)
679 dnl -------------------------------------------
680 AC_ARG_ENABLE(client-only,
681 AC_HELP_STRING([--enable-client-only], [build client (File daemon) only @<:@default=no@:>@]),
683 if test x$enableval = xyes; then
684 build_client_only=yes
690 if test x$build_client_only = xno; then
697 dnl -------------------------------------------
698 dnl director (default on)
699 dnl -------------------------------------------
700 AC_ARG_ENABLE(build-dird,
701 AC_HELP_STRING([--enable-build-dird], [enable building of dird (Director) @<:@default=yes@:>@]),
703 if test x$enableval = xno; then
708 if test x$build_dird = xyes; then
713 DIR_TOOLS="NODIRTOOLS"
718 dnl -------------------------------------------
719 dnl stored (default on)
720 dnl -------------------------------------------
721 AC_ARG_ENABLE(build-stored,
722 AC_HELP_STRING([--enable-build-stored], [enable building of stored (Storage daemon) @<:@default=yes@:>@]),
724 if test x$enableval = xno; then
729 if test x$build_stored = xyes; then
730 STORED_DIR="src/stored"
736 dnl ---------------------------------------------------
737 dnl Check for conio (Bacula readline substitute)(
738 dnl ---------------------------------------------------
739 dnl this allows you to turn it completely off
741 AC_HELP_STRING([--disable-conio], [disable conio support @<:@default=no@:>@]),
743 if test x$enableval = xno; then
750 dnl ---------------------------------------------------
751 dnl Check for IPv6 support
752 dnl ---------------------------------------------------
753 dnl this allows you to turn it completely off
756 AC_HELP_STRING([--enable-ipv6], [enable ipv6 support @<:@default=yes@:>@]),
758 if test x$enableval = xno; then
764 if test x$support_ipv6 = xyes; then
765 AC_TRY_LINK([ #include <sys/types.h>
766 #include <sys/socket.h>
767 #include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;],
768 [support_ipv6=yes], [support_ipv6=no])
771 if test x$support_ipv6 = xyes; then
772 AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
776 if test x$support_conio = xyes; then
777 AC_CHECK_HEADER(termcap.h,
778 [ AC_CHECK_LIB(termcap, tgetent,
779 [ CONS_LIBS="-ltermcap"
784 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
786 [ AC_CHECK_LIB(ncurses, tgetent,
787 [ CONS_LIBS="-lncurses"
792 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
797 AC_CHECK_HEADERS(curses.h)
798 AC_CHECK_HEADER(term.h,
799 [ AC_CHECK_LIB(curses, tgetent,
800 [ CONS_LIBS="-lcurses"
805 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
808 [ echo " "; echo "Required libraries not found. CONIO turned off ..."; echo " "],
817 dnl ---------------------------------------------------
818 dnl Check for readline support/directory (default off)
819 dnl ---------------------------------------------------
820 dnl this allows you to turn it completely off
821 AC_ARG_ENABLE(readline,
822 AC_HELP_STRING([--disable-readline], [disable readline support @<:@default=yes@:>@]),
824 if test x$enableval = xno; then
832 if test x$support_readline = xyes; then
833 AC_ARG_WITH(readline,
834 AC_HELP_STRING([--with-readline@<:@=DIR@:>@], [specify readline library directory]),
836 case "$with_readline" in
841 if test -f ${with_readline}/readline.h; then
842 CONS_INC="-I${with_readline}"
843 CONS_LDFLAGS="-L$with_readline"
844 elif test -f ${with_readline}/include/readline/readline.h; then
845 CONS_INC="-I${with_readline}/include/readline"
846 CONS_LDFLAGS="-L${with_readline}/lib"
847 with_readline="${with_readline}/include/readline"
849 with_readline="/usr/include/readline"
852 AC_CHECK_HEADER(${with_readline}/readline.h,
854 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
855 CONS_LIBS="-lreadline -lhistory -ltermcap"
859 echo "readline.h not found. readline turned off ..."
866 dnl check for standard readline library
867 AC_CHECK_HEADER(/usr/include/readline/readline.h,
869 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
871 CONS_INC="-I/usr/include/readline"
872 CONS_LIBS="-lreadline -ltermcap"
874 dnl Did not find standard library, so try Bacula's default
875 AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h,
877 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
879 CONS_INC="-I${TOP_DIR}/depkgs/readline"
880 CONS_LIBS="-lreadline -lhistory -ltermcap"
881 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
882 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
885 echo "readline.h not found. readline turned off ..."
899 AC_SUBST(CONS_LDFLAGS)
900 AC_SUBST(READLINE_SRC)
902 dnl Minimal stuff for readline Makefile configuration
907 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr lstat lchown)
908 AC_CHECK_FUNCS(nanosleep nl_langinfo)
909 AC_CHECK_HEADERS(varargs.h)
911 dnl End of readline/conio stuff
912 dnl -----------------------------------------------------------------------
914 dnl -----------------------------------------------------------------------
915 dnl Check for Python support
917 AC_MSG_CHECKING(for Python support)
919 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.]),
923 if test "$withval" != "no"; then
924 if test "$withval" = "yes"; then
925 for python_root in /usr /usr/local /usr/sfw; do
926 for ver in python2.2 python2.3 python2.4 python2.5 python2.6 python3; do
927 if test -f $python_root/include/${ver}/Python.h; then
928 PYTHON_INCDIR=-I$python_root/include/${ver}
929 if test -d $python_root/lib64/${ver}/config; then
930 PYTHON_LIBS="-L$python_root/lib64/${ver}/config -l${ver}"
932 PYTHON_LIBS="-L$python_root/lib/${ver}/config -l${ver}"
939 if test x$PYTHON_INCDIR = x; then
940 if test -f $prefix/include/Python.h; then
941 PYTHON_INCDIR=-I$prefix/include
942 if test -d $prefix/lib64/config; then
943 PYTHON_LIBS="-L$prefix/lib64/config -lpython"
945 PYTHON_LIBS="-L$prefix/lib/config -lpython"
949 AC_MSG_ERROR(Unable to find Python.h in standard locations)
953 if test -f $withval/Python.h; then
954 PYTHON_INCDIR=-I$withval
955 PYTHON_LIBS="-L$withval/config -lpython"
956 elif test -f $withval/include/Python.h; then
957 PYTHON_INCDIR=-I$withval/include
958 if test -d $withval/lib64/config; then
959 PYTHON_LIBS="-L$withval/lib64/config -lpython"
961 PYTHON_LIBS="-L$withval/lib/config -lpython"
963 elif test -f $withval/include/python/Python.h; then
964 PYTHON_INCDIR=-I$withval/include/python
965 if test -d $withval/lib64/python/config; then
966 PYTHON_LIBS="-L$withval/lib64/python/config -lpython"
968 PYTHON_LIBS="-L$withval/lib/python/config -lpython"
972 AC_MSG_ERROR(Invalid Python directory $withval - unable to find Python.h under $withval)
976 AC_DEFINE([HAVE_PYTHON], 1)
979 AC_MSG_NOTICE(checking for more Python libs)
980 saved_LIBS="$LIBS"; LIBS=
981 AC_SEARCH_LIBS(shm_open, [rt])
982 AC_CHECK_LIB(util, openpty)
983 PYTHON_LIBS="$PYTHON_LIBS $LIBS"
992 AC_SUBST(PYTHON_LIBS)
993 AC_SUBST(PYTHON_INCDIR)
996 dnl Find where sockets are (especially for Solaris)
997 dnl Do this before the TCP Wrappers test since tcp wrappers
998 dnl uses the socket library and some linkers are stupid.
1000 AC_CHECK_FUNC(socket,
1001 AC_MSG_RESULT(using libc's socket),
1002 AC_CHECK_LIB(xnet,socket)
1003 AC_CHECK_LIB(socket,socket)
1004 AC_CHECK_LIB(inet,socket))
1006 dnl -----------------------------------------------------------
1007 dnl Check whether user wants TCP wrappers support (default off)
1008 dnl -----------------------------------------------------------
1011 AC_ARG_WITH(tcp-wrappers,
1012 AC_HELP_STRING([--with-tcp-wrappers@<:@=DIR@:>@], [enable tcpwrappers support]),
1014 if test "x$withval" != "xno" ; then
1016 LIBS="$saved_LIBS -lwrap"
1017 AC_MSG_CHECKING(for libwrap)
1018 AC_SEARCH_LIBS(nanosleep, [rt])
1021 #include <sys/types.h>
1023 int deny_severity = 0;
1024 int allow_severity = 0;
1025 struct request_info *req;
1030 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
1035 LIBS="$saved_LIBS -lwrap -lnsl"
1036 WRAPLIBS="$saved_LIBS -lwrap -lnsl"
1039 #include <sys/types.h>
1041 int deny_severity = 0;
1042 int allow_severity = 0;
1043 struct request_info *req;
1048 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
1053 AC_MSG_ERROR([*** libwrap missing])
1062 dnl -----------------------------------------------------------
1063 dnl Check whether OpenSSL is available
1064 dnl -----------------------------------------------------------
1065 AC_MSG_CHECKING([for OpenSSL])
1066 dnl The following uses quadrigraphs:
1069 AC_ARG_WITH(openssl,
1070 AC_HELP_STRING([--with-openssl@<:@=DIR@:>@], [Include OpenSSL support. DIR is the OpenSSL base]),
1072 with_openssl_directory=${withval}
1076 if test "x$with_openssl_directory" != "xno"; then
1077 OPENSSL_LIBS="-lssl -lcrypto"
1080 if test "x$with_openssl_directory" != "xyes" && test x"${with_openssl_directory}" != "x"; then
1082 # Make sure the $with_openssl_directory also makes sense
1084 if test -d "$with_openssl_directory/lib" -a -d "$with_openssl_directory/include"; then
1085 OPENSSL_LIBS="-L$with_openssl_directory/lib $OPENSSL_LIBS"
1086 OPENSSL_INC="-I$with_openssl_directory/include $OPENSSL_INC"
1090 saved_LIBS="${LIBS}"
1091 saved_CFLAGS="${CFLAGS}"
1092 LIBS="${saved_LIBS} ${OPENSSL_LIBS}"
1093 CFLAGS="${saved_CFLAGS} ${OPENSSL_INC}"
1097 #include <openssl/ssl.h>
1099 CRYPTO_set_id_callback(NULL);
1102 support_crypto="yes"
1110 #include <openssl/evp.h>
1114 ac_cv_openssl_sha2="yes"
1116 ac_cv_openssl_sha2="no"
1120 dnl Solaris disables greater than 128+ bit encryption in their OpenSSL
1121 dnl implementation, presumably for export reasons. If 192bit AES
1122 dnl is available, we assume that we're running with a 'non-export'
1123 dnl openssl library.
1126 #include <openssl/evp.h>
1130 ac_cv_openssl_export="no"
1132 ac_cv_openssl_export="yes"
1136 LIBS="${saved_LIBS}"
1137 CFLAGS="${saved_CFLAGS}"
1139 if test "$support_tls" = "yes"; then
1140 AC_DEFINE(HAVE_OPENSSL, 1, [Define if OpenSSL library is available])
1141 AC_DEFINE(HAVE_TLS, 1, [Define if TLS support should be enabled])
1142 AC_DEFINE(HAVE_CRYPTO, 1, [Define if encryption support should be enabled])
1145 if test "$ac_cv_openssl_sha2" = "yes"; then
1146 AC_DEFINE(HAVE_SHA2, 1, [Define if the SHA-2 family of digest algorithms is available])
1149 if test "$ac_cv_openssl_export" = "yes"; then
1150 AC_DEFINE(HAVE_OPENSSL_EXPORT_LIBRARY, 1, [Define if the OpenSSL library is export-contrained to 128bit ciphers])
1159 AC_MSG_RESULT([$support_tls])
1160 AC_SUBST(OPENSSL_LIBS)
1161 AC_SUBST(OPENSSL_INC)
1163 dnl -----------------------------------------------------------
1164 dnl dlopen is needed for plugins
1165 dnl -----------------------------------------------------------
1166 AC_SEARCH_LIBS(dlopen, [dl])
1168 dnl ------------------------------------------
1169 dnl Where to place working dir
1170 dnl ------------------------------------------
1171 working_dir=`eval echo ${prefix}/var/bacula/working`
1172 AC_ARG_WITH(working-dir,
1173 AC_HELP_STRING([--with-working-dir=PATH], [specify path of Bacula working directory]),
1175 if test "x$withval" != "xno" ; then
1176 working_dir=$withval
1181 AC_SUBST(working_dir)
1183 dnl ------------------------------------------------------------------
1184 dnl If the user has not set archivedir, we set our default as /tmp
1185 dnl ------------------------------------------------------------------
1187 AC_ARG_WITH(archivedir,
1188 AC_HELP_STRING([--with-archivedir=PATH], [specify path of SD archive directory]),
1190 if test "x$withval" != "xno" ; then
1196 AC_SUBST(archivedir)
1198 dnl ------------------------------------------------------------------
1199 dnl Allow the user to specify the daemon resource name default hostname
1200 dnl ------------------------------------------------------------------
1202 AC_ARG_WITH(basename,
1203 AC_HELP_STRING([--with-basename=RESNAME], [specify base resource name for daemons]),
1205 if test "x$withval" != "xno" ; then
1213 dnl ------------------------------------------------------------------
1214 dnl Allow the user to override the hostname (default = machine hostname)
1215 dnl ------------------------------------------------------------------
1216 hostname=`uname -n | cut -d '.' -f 1`
1217 if test x${hostname} = x ; then
1218 hostname="localhost"
1220 AC_ARG_WITH(hostname,
1221 AC_HELP_STRING([--with-hostname=RESNAME], [specify host name for daemons]),
1223 if test "x$withval" != "xno" ; then
1232 dnl ------------------------------------------
1233 dnl Where to place scriptdir (script files)
1234 dnl ------------------------------------------
1235 scriptdir=`eval echo ${sysconfdir}`
1236 AC_ARG_WITH(scriptdir,
1237 AC_HELP_STRING([--with-scriptdir=PATH], [specify path of Bacula scripts directory]),
1239 if test "x$withval" != "xno" ; then
1248 dnl ------------------------------------------
1249 dnl Where to place bsrdir (bsr files)
1250 dnl ------------------------------------------
1253 AC_HELP_STRING([--with-bsrdir=PATH], [specify path of Bacula bsrs directory]),
1255 if test "x$withval" != "xno" ; then
1263 dnl ------------------------------------------
1264 dnl Where to place logdir (bsr files)
1265 dnl ------------------------------------------
1268 AC_HELP_STRING([--with-logdir=PATH], [specify path of Bacula logs directory]),
1270 if test "x$withval" != "xno" ; then
1279 # ------------------------------------------
1280 # Where to place plugindir (plugin files)
1281 # ------------------------------------------
1282 plugindir=`eval echo ${libdir}`
1283 AC_ARG_WITH(plugindir,
1284 AC_HELP_STRING([--with-plugindir=PATH], [specify path of Bacula plugins directory]),
1286 if test "x$withval" != "xno" ; then
1294 dnl ------------------------------------------
1295 dnl Where to send dump email
1296 dnl ------------------------------------------
1297 dump_email=root@localhost
1298 AC_ARG_WITH(dump-email,
1299 AC_HELP_STRING([--with-dump-email=EMAIL], [dump email address]),
1301 if test "x$withval" != "xno" ; then
1307 AC_SUBST(dump_email)
1309 dnl ------------------------------------------
1310 dnl Where to send job email
1311 dnl ------------------------------------------
1312 job_email=root@localhost
1313 AC_ARG_WITH(job-email,
1314 AC_HELP_STRING([--with-job-email=EMAIL], [job output email address]),
1316 if test "x$withval" != "xno" ; then
1324 dnl ------------------------------------------
1325 dnl Where to find smtp host
1326 dnl ------------------------------------------
1328 AC_ARG_WITH(smtp_host,
1329 AC_HELP_STRING([--with-smtp-host=HOST], [SMTP mail host address]),
1331 if test "x$withval" != "xno" ; then
1339 dnl ------------------------------------
1340 dnl Where to place pid files
1341 dnl ------------------------------------
1343 AC_ARG_WITH(pid-dir,
1344 AC_HELP_STRING([--with-pid-dir=PATH], [specify location of Bacula pid files]),
1346 if test "x$withval" != "xno" ; then
1352 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
1355 dnl ------------------------------------
1356 dnl Where to place subsys "lock file"
1357 dnl ------------------------------------
1358 subsysdir=/var/run/subsys
1359 if test -d /var/run/subsys; then
1360 subsysdir=/var/run/subsys
1361 elif test -d /var/lock/subsys; then
1362 subsysdir=/var/lock/subsys
1364 subsysdir=/var/run/subsys
1366 AC_ARG_WITH(subsys-dir,
1367 AC_HELP_STRING([--with-subsys-dir=PATH], [specify location of Bacula subsys file]),
1369 if test "x$withval" != "xno" ; then
1377 dnl ------------------------------------
1378 dnl Where to start assigning ports
1379 dnl ------------------------------------
1381 AC_ARG_WITH(baseport,
1382 AC_HELP_STRING([--with-baseport=PORT], [specify base port address for daemons]),
1384 if test "x$withval" != "xno" ; then
1391 dir_port=`expr $baseport`
1392 fd_port=`expr $baseport + 1`
1393 sd_port=`expr $fd_port + 1`
1399 dnl ------------------------------------------
1400 dnl Generate passwords
1401 dnl ------------------------------------------
1403 AC_ARG_WITH(dir-password,
1404 AC_HELP_STRING([--with-dir-password=PASSWORD], [specify Director's password]),
1406 if test "x$withval" != "xno" ; then
1407 dir_password=$withval
1412 if test "x$dir_password" = "x" ; then
1413 if test "x$OPENSSL" = "xnone" ; then
1414 key=`autoconf/randpass 33`
1416 key=`openssl rand -base64 33`
1422 AC_ARG_WITH(fd-password,
1423 AC_HELP_STRING([--with-fd-password=PASSWORD], [specify Client's password]),
1425 if test "x$withval" != "xno" ; then
1426 fd_password=$withval
1431 if test "x$fd_password" = "x" ; then
1432 if test "x$OPENSSL" = "xnone" ; then
1433 key=`autoconf/randpass 37`
1435 key=`openssl rand -base64 33`
1441 AC_ARG_WITH(sd-password,
1442 AC_HELP_STRING([--with-sd-password=PASSWORD], [specify Storage daemon's password]),
1444 if test "x$withval" != "xno" ; then
1445 sd_password=$withval
1450 if test "x$sd_password" = "x" ; then
1451 if test "x$OPENSSL" = "xnone" ; then
1452 key=`autoconf/randpass 41`
1454 key=`openssl rand -base64 33`
1460 AC_ARG_WITH(mon-dir-password,
1461 AC_HELP_STRING([--with-mon-dir-password=PASSWORD], [specify Director's password used by the monitor]),
1463 if test "x$withval" != "xno" ; then
1464 mon_dir_password=$withval
1469 if test "x$mon_dir_password" = "x" ; then
1470 if test "x$OPENSSL" = "xnone" ; then
1471 key=`autoconf/randpass 33`
1473 key=`openssl rand -base64 33`
1475 mon_dir_password=$key
1479 AC_ARG_WITH(mon-fd-password,
1480 AC_HELP_STRING([--with-mon-fd-password=PASSWORD], [specify Client's password used by the monitor]),
1482 if test "x$withval" != "xno" ; then
1483 mon_fd_password=$withval
1488 if test "x$mon_fd_password" = "x" ; then
1489 if test "x$OPENSSL" = "xnone" ; then
1490 key=`autoconf/randpass 37`
1492 key=`openssl rand -base64 33`
1494 mon_fd_password=$key
1498 AC_ARG_WITH(mon-sd-password,
1499 AC_HELP_STRING([--with-mon-sd-password=PASSWORD], [specify Storage daemon's password used by the monitor]),
1501 if test "x$withval" != "xno" ; then
1502 mon_sd_password=$withval
1507 if test "x$mon_sd_password" = "x" ; then
1508 if test "x$OPENSSL" = "xnone" ; then
1509 key=`autoconf/randpass 41`
1511 key=`openssl rand -base64 33`
1513 mon_sd_password=$key
1516 AC_SUBST(dir_password)
1517 AC_SUBST(fd_password)
1518 AC_SUBST(sd_password)
1519 AC_SUBST(mon_dir_password)
1520 AC_SUBST(mon_fd_password)
1521 AC_SUBST(mon_sd_password)
1524 dnl Pickup any database name
1527 AC_ARG_WITH(db_name,
1528 AC_HELP_STRING([--with-db-name=DBNAME], [specify database name @<:@default=bacula@:>@]),
1530 if test "x$withval" != "x" ; then
1538 AC_ARG_WITH(db_user,
1539 AC_HELP_STRING([--with-db-user=UNAME], [specify database user @<:@default=bacula@:>@]),
1541 if test "x$withval" != "x" ; then
1549 AC_ARG_WITH(db_password,
1550 AC_HELP_STRING([--with-db-password=PWD], [specify database password @<:@default=*none*@:>@]),
1552 if test "x$withval" != "x" ; then
1553 db_password=$withval
1557 AC_SUBST(db_password)
1560 dnl Pickup a database port
1563 AC_ARG_WITH(db_port,
1564 AC_HELP_STRING([--with-db-port=DBPORT], [specify a database port @<:@default=null@:>@]),
1566 if test "x$withval" != "x" ; then
1574 # Handle users and groups for each daemon
1577 AC_ARG_WITH(dir_user,
1578 AC_HELP_STRING([--with-dir-user=USER], [specify user for Director daemon]),
1580 if test "x$withval" != "x" ; then
1587 AC_ARG_WITH(dir_group,
1588 AC_HELP_STRING([--with-dir-group=GROUP], [specify group for Director daemon]),
1590 if test "x$withval" != "x" ; then
1597 AC_ARG_WITH(sd_user,
1598 AC_HELP_STRING([--with-sd-user=USER], [specify user for Storage daemon]),
1600 if test "x$withval" != "x" ; then
1607 AC_ARG_WITH(sd_group,
1608 AC_HELP_STRING([--with-sd-group=GROUP], [specify group for Storage daemon]),
1610 if test "x$withval" != "x" ; then
1617 AC_ARG_WITH(fd_user,
1618 AC_HELP_STRING([--with-fd-user=USER], [specify user for File daemon]),
1620 if test "x$withval" != "x" ; then
1627 AC_ARG_WITH(fd_group,
1628 AC_HELP_STRING([--with-fd-group=GROUP], [specify group for File daemon]),
1630 if test "x$withval" != "x" ; then
1644 dnl allow setting default executable permissions
1647 AC_ARG_WITH(sbin-perm,
1648 AC_HELP_STRING([--with-sbin-perm=MODE], [specify permissions for sbin binaries @<:@default=0754@:>@]),
1650 if test "x$withval" != "x" ; then
1658 dnl ------------------------------------------------
1659 dnl Bacula check for various SQL database engines
1660 dnl ------------------------------------------------
1662 BA_CHECK_POSTGRESQL_DB
1677 dnl -------------------------------------------
1678 dnl enable batch attribute DB insert (default on)
1679 dnl -------------------------------------------
1680 support_batch_insert=no
1681 A=`test -f $SQL_LIB && nm $SQL_LIB | grep pthread_mutex_lock`
1683 if test $pkg = 0; then
1684 support_batch_insert=yes
1685 AC_ARG_ENABLE(batch-insert,
1686 AC_HELP_STRING([--enable-batch-insert], [enable the DB batch insert code @<:@default=no@:>@]),
1688 if test x$enableval = xno; then
1689 support_batch_insert=no
1691 support_batch_insert=yes
1697 dnl Check if postgresql support batch mode
1698 if test x$DB_TYPE = xpostgresql; then
1699 A=`test -f $SQL_LIB && nm $SQL_LIB | grep PQputCopyData`
1701 if test $pkg != 0; then
1702 support_batch_insert=no
1706 if test x$DB_TYPE = xdbi; then
1710 dnl Check for batch insert
1711 if test $DB_PROG = postgresql; then
1712 A=`test -f $SQL_LIB && nm $SQL_LIB | grep PQputCopyData`
1716 if test $DB_PROG = mysql; then
1717 A=`test -f $SQL_LIB && nm $DB_PROG_LIB | grep pthread_mutex_lock`
1721 if test $DB_PROG = sqlite3; then
1722 A=`test -f $SQL_LIB && nm $DB_PROG_LIB | grep pthread_mutex_lock`
1726 if test $pkg = 0; then
1727 AC_ARG_ENABLE(batch-insert,
1728 AC_HELP_STRING([--enable-batch-insert], [enable the DB batch insert code @<:@default=no@:>@]),
1730 if test x$enableval = xno; then
1731 support_batch_insert=no
1733 support_batch_insert=yes
1739 dnl If dbi was not chosen, let the comment in file
1743 AC_SUBST(uncomment_dbi)
1745 if test $support_batch_insert = yes ; then
1746 AC_DEFINE(HAVE_BATCH_FILE_INSERT, 1, [Set if DB batch insert code enabled])
1749 AC_DEFINE(PROTOTYPES)
1751 dnl --------------------------------------------------------------------------
1752 dnl Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
1754 if test -z "$CFLAGS" -o "$CFLAGS" = "-g -O2"; then
1755 if test -z "$CCOPTS"; then
1756 CCOPTS='-g -O2 -Wall'
1764 dnl See if we can use 64 bit file addresses
1765 largefile_support="no"
1770 dnl --------------------------------------------------------------------------
1771 dnl CHECKING FOR HEADER FILES
1772 dnl --------------------------------------------------------------------------
1810 AC_STRUCT_ST_BLKSIZE
1814 dnl --------------------------------------------------------------------------
1815 dnl Check for utime.h structure
1816 dnl --------------------------------------------------------------------------
1817 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
1821 #include <sys/types.h>
1826 ba_cv_header_utime_h=yes
1828 ba_cv_header_utime_h=no
1833 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H, 1, [Set if utime.h exists])
1835 dnl --------------------------------------------------------------------------
1836 dnl Check for socklen_t
1837 dnl --------------------------------------------------------------------------
1838 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
1842 #include <sys/types.h>
1843 #include <sys/socket.h>
1847 ba_cv_header_socklen_t=yes
1849 ba_cv_header_socklen_t=no
1854 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T)
1856 dnl --------------------------------------------------------------------------
1857 dnl Check for bigendian
1858 dnl --------------------------------------------------------------------------
1859 AC_CACHE_CHECK([for bigendian], ba_cv_bigendian,
1863 main(){long a=1L; char *p=(char *)&a; exit(*p);}
1874 test $ba_cv_bigendian = yes && AC_DEFINE(HAVE_BIGENDIAN)
1876 dnl --------------------------------------------------------------------------
1877 dnl Check for typeof()
1878 dnl --------------------------------------------------------------------------
1880 AC_CACHE_CHECK(for typeof, ba_cv_have_typeof,
1884 main(){char *a = 0; a = (typeof a)a;}
1886 ba_cv_have_typeof=yes
1888 ba_cv_have_typeof=no
1890 ba_cv_have_typeof=no
1895 test $ba_cv_have_typeof = yes && AC_DEFINE([HAVE_TYPEOF], 1, [Defind to 1 if compiler has typeof])
1900 dnl --------------------------------------------------------------------------
1901 dnl CHECKING FOR FILESYSTEM TYPE
1902 dnl --------------------------------------------------------------------------
1903 AC_MSG_CHECKING(how to get filesystem type)
1905 # The order of these tests is important.
1908 #include <sys/statvfs.h>
1909 #include <sys/fstyp.h>
1911 AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4
1913 if test $fstype = no; then
1916 #include <sys/statfs.h>
1917 #include <sys/fstyp.h>
1919 AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3
1922 if test $fstype = no; then
1925 #include <sys/statfs.h>
1926 #include <sys/vmount.h>
1928 AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX
1931 if test $fstype = no; then
1936 AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD
1939 if test $fstype = no; then
1940 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
1942 if test $fstype = no; then
1945 #include <sys/mount.h>
1946 #include <sys/fs_types.h>
1948 AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix
1951 AC_MSG_RESULT($fstype)
1953 AC_CHECK_HEADER(sys/statvfs.h, [ AC_DEFINE(HAVE_SYS_STATVFS_H,1,[Defines if your system have the sys/statvfs.h header file])] , )
1955 dnl --------------------------------------------------------------------------
1956 dnl CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
1957 dnl --------------------------------------------------------------------------
1967 AC_CHECK_TYPE(ino_t, unsigned long)
1968 AC_CHECK_TYPE(dev_t, unsigned long)
1969 AC_CHECK_TYPE(daddr_t, long)
1970 AC_CHECK_TYPE(major_t, int)
1971 AC_CHECK_TYPE(minor_t, int)
1972 AC_CHECK_TYPE(ssize_t, int)
1978 AC_CHECK_SIZEOF(char, 1)
1979 AC_CHECK_SIZEOF(short int, 2)
1980 AC_CHECK_SIZEOF(int, 4)
1981 AC_CHECK_SIZEOF(long int, 4)
1982 AC_CHECK_SIZEOF(long long int, 8)
1983 AC_CHECK_SIZEOF(int *, 4)
1985 dnl Check for sys/types.h types
1986 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int,
1990 #include <sys/types.h>
1994 ac_cv_have_u_int="yes"
1996 ac_cv_have_u_int="no"
2001 if test "x$ac_cv_have_u_int" = "xyes" ; then
2002 AC_DEFINE(HAVE_U_INT)
2006 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t,
2010 #include <sys/types.h>
2014 ac_cv_have_intmax_t="yes"
2022 ac_cv_have_intmax_t="yes"
2024 ac_cv_have_intmax_t="no"
2031 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
2032 AC_DEFINE(HAVE_INTMAX_T)
2036 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t,
2040 #include <sys/types.h>
2042 u_intmax_t a; a = 1;
2044 ac_cv_have_u_intmax_t="yes"
2050 u_intmax_t a; a = 1;
2052 ac_cv_have_u_intmax_t="yes"
2054 ac_cv_have_u_intmax_t="no"
2061 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
2062 AC_DEFINE(HAVE_U_INTMAX_T)
2066 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t,
2070 #include <sys/types.h>
2072 int8_t a; int16_t b; int32_t c; a = b = c = 1;
2074 ac_cv_have_intxx_t="yes"
2076 ac_cv_have_intxx_t="no"
2081 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
2082 AC_DEFINE(HAVE_INTXX_T)
2086 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t,
2090 #include <sys/types.h>
2094 ac_cv_have_int64_t="yes"
2096 ac_cv_have_int64_t="no"
2101 if test "x$ac_cv_have_int64_t" = "xyes" ; then
2102 AC_DEFINE(HAVE_INT64_T)
2106 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t,
2110 #include <sys/types.h>
2112 u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;
2114 ac_cv_have_u_intxx_t="yes"
2116 ac_cv_have_u_intxx_t="no"
2121 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
2122 AC_DEFINE(HAVE_U_INTXX_T)
2126 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t,
2130 #include <sys/types.h>
2134 ac_cv_have_u_int64_t="yes"
2136 ac_cv_have_u_int64_t="no"
2141 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
2142 AC_DEFINE(HAVE_U_INT64_T)
2146 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
2147 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2149 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
2152 #include <sys/bitypes.h>
2154 int8_t a; int16_t b; int32_t c;
2155 u_int8_t e; u_int16_t f; u_int32_t g;
2156 a = b = c = e = f = g = 1;
2158 AC_DEFINE(HAVE_U_INTXX_T)
2159 AC_DEFINE(HAVE_INTXX_T)
2160 AC_DEFINE(HAVE_SYS_BITYPES_H)
2168 if test -z "$have_u_intxx_t" ; then
2169 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t,
2173 #include <sys/types.h>
2175 uint8_t a; uint16_t b;
2176 uint32_t c; a = b = c = 1;
2178 ac_cv_have_uintxx_t="yes"
2180 ac_cv_have_uintxx_t="no"
2185 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
2186 AC_DEFINE(HAVE_UINTXX_T)
2190 if (test -z "$have_u_int64_t" || test -z "$have_int64_t" && \
2191 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2193 AC_MSG_CHECKING([for int64_t and u_int64_t types in sys/bitypes.h])
2196 #include <sys/bitypes.h>
2198 int64_t a; u_int64_t b;
2201 AC_DEFINE(HAVE_U_INT64_T)
2202 AC_DEFINE(HAVE_INT64_T)
2210 if (test -z "$have_uintxx_t" && \
2211 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2213 AC_MSG_CHECKING([for uintXX_t types in sys/bitypes.h])
2216 #include <sys/bitypes.h>
2218 uint8_t a; uint16_t b;
2219 uint32_t c; a = b = c = 1;
2221 AC_DEFINE(HAVE_UINTXX_T)
2229 dnl --------------------------------------------------------------------------
2230 dnl CHECKING FOR REQUIRED LIBRARY FUNCTIONS
2231 dnl --------------------------------------------------------------------------
2247 [echo 'configure: cannot find needed function.'; exit 1]
2250 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
2251 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
2252 AC_CHECK_FUNCS(posix_fadvise)
2253 AC_CHECK_FUNCS(fdatasync)
2255 AC_CHECK_FUNCS(chflags)
2257 AC_CHECK_FUNCS(snprintf vsnprintf gethostid fseeko)
2259 AC_CACHE_CHECK(for va_copy, ba_cv_va_copy,
2264 void use_va_copy(va_list args){va_list args2; va_copy(args2,args); va_end(args2);}
2265 void call_use_va_copy(int junk,...){va_list args; va_start(args,junk); use_va_copy(args); va_end(args);}
2267 call_use_va_copy(1,2,3)
2276 test $ba_cv_va_copy = yes && AC_DEFINE(HAVE_VA_COPY, 1, [Set if va_copy exists])
2278 dnl --------------------------------------------------------------------------
2279 dnl CHECKING FOR THREAD SAFE FUNCTIONS
2280 dnl --------------------------------------------------------------------------
2281 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
2283 # If resolver functions are not in libc check for -lnsl or -lresolv.
2284 AC_CHECK_FUNC(gethostbyname_r,
2285 AC_MSG_RESULT(using libc's resolver),
2286 AC_CHECK_LIB(nsl,gethostbyname_r)
2287 AC_CHECK_LIB(resolv,gethostbyname_r))
2289 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
2290 AC_CHECK_FUNCS(inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)])
2291 AC_CHECK_FUNCS(gethostbyname2, [AC_DEFINE(HAVE_GETHOSTBYNAME2)])
2293 dnl ----------------------------
2294 dnl check sa_len of sockaddr
2295 dnl ----------------------------
2296 AC_CACHE_CHECK(for struct sockaddr has a sa_len field, ac_cv_struct_sockaddr_sa_len,
2300 #include <sys/socket.h>
2302 struct sockaddr s; s.sa_len;
2304 ac_cv_struct_sockaddr_sa_len=yes
2305 ], [ac_cv_struct_sockaddr_sa_len=no
2311 if test $ac_cv_struct_sockaddr_sa_len = yes; then
2312 AC_DEFINE(HAVE_SA_LEN, 1, [Define if sa_len field exists in struct sockaddr])
2319 AC_FUNC_CLOSEDIR_VOID
2320 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
2321 # AC_FUNC_FNMATCH dnl use local version
2323 AC_CHECK_LIB(intl, gettext, [LIBS="$LIBS -lintl"])
2325 AC_CHECK_LIB(sun, getpwnam)
2327 AC_CHECK_HEADERS(zlib.h)
2328 AC_CHECK_LIB(z, deflate, [FDLIBS="-lz"])
2330 if test x$FDLIBS = x-lz; then
2331 AC_DEFINE(HAVE_LIBZ)
2336 dnl Check for ACL support and libraries
2340 AC_HELP_STRING([--disable-acl], [disable acl support @<:@default=auto@:>@]),
2342 if test x$enableval = xyes; then
2344 elif test x$enableval = xno; then
2351 have_extended_acl=no
2352 if test x$support_acl = xyes -o x$support_acl = xauto; then
2353 AC_CHECK_HEADER(sys/acl.h, [ AC_DEFINE(HAVE_SYS_ACL_H,1,[Defines if your system have the sys/acl.h header file])] , )
2354 AC_CHECK_FUNC(acl_get_file,
2358 AC_CHECK_LIB(acl, acl_get_file,
2361 FDLIBS="-lacl $FDLIBS"
2363 AC_CHECK_LIB(pacl, acl_get_file,
2366 FDLIBS="-lpacl $FDLIBS"
2368 AC_CHECK_LIB(sec, acltotext,
2371 FDLIBS="-lsec $FDLIBS"
2373 AC_CHECK_LIB(sec, acl_totext,
2375 have_extended_acl=yes
2387 if test x$support_acl = xyes -a $have_acl != yes; then
2388 AC_MSG_ERROR([acl support explicitly enabled but no supported acl implementation found,
2389 please either load the acl libraries or rerun configure without --enable-acl])
2391 if test $have_acl = yes; then
2392 AC_DEFINE([HAVE_ACL], [], [Normal attribute support])
2395 if test $have_extended_acl = yes; then
2396 AC_DEFINE([HAVE_EXTENDED_ACL], [], [Extended attribute support])
2402 dnl Check for XATTR support
2405 AC_ARG_ENABLE(xattr,
2406 AC_HELP_STRING([--disable-xattr], [disable xattr support @<:@default=auto@:>@]),
2408 if test x$enableval = xyes; then
2410 elif test x$enableval = xno; then
2417 if test x$support_xattr = xyes -o x$support_xattr = xauto; then
2418 AC_CHECK_HEADER(sys/xattr.h, [ AC_DEFINE(HAVE_SYS_XATTR_H,1,[Defines if your system have the sys/xattr.h header file])] , )
2419 AC_CHECK_FUNCS(llistxattr lgetxattr lsetxattr,
2422 AC_DEFINE([HAVE_LLISTXATTR], [], [LLISTXATTR support])
2423 AC_DEFINE([HAVE_LGETXATTR], [], [LGETXATTR support])
2424 AC_DEFINE([HAVE_LSETXATTR], [], [LSETXATTR support])
2431 if test $have_xattr = no; then
2432 AC_CHECK_FUNCS(listxattr getxattr setxattr,
2435 AC_DEFINE([HAVE_LLISTXATTR], [], [LLISTXATTR support])
2436 AC_DEFINE([HAVE_LGETXATTR], [], [LGETXATTR support])
2437 AC_DEFINE([HAVE_LSETXATTR], [], [LSETXATTR support])
2445 if test $have_xattr = no; then
2446 AC_CHECK_HEADER(sys/attr.h, [ AC_DEFINE(HAVE_SYS_ATTR_H,1,[Defines if your system have the sys/attr.h header file])] , )
2447 AC_CHECK_HEADER(sys/nvpair.h, [ AC_DEFINE(HAVE_SYS_NVPAIR_H,1,[Defines if your system have the sys/nvpair.h header file])] , )
2448 AC_CHECK_HEADER(attr.h, [ AC_DEFINE(HAVE_ATTR_H,1,[Defines if your system have the attr.h header file])] , )
2450 AC_CHECK_FUNCS(openat fstatat unlinkat fchownat futimesat,
2453 AC_DEFINE([HAVE_OPENAT], [], [OPENAT support])
2454 AC_DEFINE([HAVE_FSTATAT], [], [FSTATAT support])
2455 AC_DEFINE([HAVE_UNLINKAT], [], [UNLINKAT support])
2456 AC_DEFINE([HAVE_FCHOWNAT], [], [FCHOWNAT support])
2457 AC_DEFINE([HAVE_FUTIMESAT], [], [FUTIMESAT support])
2461 if test $have_xattr = yes; then
2462 AC_CHECK_LIB(nvpair, nvlist_next_nvpair,
2464 FDLIBS="-lnvpair $FDLIBS"
2470 if test x$support_xattr = xyes -a $have_xattr != yes; then
2471 AC_MSG_ERROR([xattr support explicitly enabled but no supported xattr implementation found,
2472 please either load the xattr libraries or rerun configure without --enable-xatt])
2474 if test $have_xattr = yes; then
2475 AC_DEFINE([HAVE_XATTR], [], [XATTR support])
2481 dnl Check for pthread libraries
2484 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
2486 AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
2488 AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
2490 AC_CHECK_FUNC(pthread_create)
2503 if test x$have_gcc = xyes ; then
2504 CPPFLAGS="$CPPFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
2505 CFLAGS="$CFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
2507 LDFLAGS=${LDFLAGS--O}
2508 DB_LIBS="${SQL_LFLAGS}"
2509 CPPFLAGS="$CPPFLAGS"
2522 AC_SUBST(X_EXTRA_LIBS)
2527 dnl extra configurable objects
2538 dnl Finally we set appropriate distribution specific
2539 dnl variables and defaults
2541 dnl PFILES are platform specific files
2542 PFILES="platforms/Makefile"
2546 hostname=`uname -n | cut -d '.' -f 1`
2547 if test x${hostname} = x ; then
2548 hostname="localhost"
2553 PSCMD="ps -e -o pid,comm"
2555 platforms/aix/Makefile"
2556 TAPEDRIVE="/dev/rmt0.1"
2560 PTHREAD_LIB="-lpthread -lexc"
2561 if test "${CC}" = "gcc" ; then
2568 TAPEDRIVE="/dev/nrmt0"
2571 DISTVER=`uname -a |awk '{print $3}'`
2572 TAPEDRIVE="/dev/nrmt0"
2573 PTHREAD_LIB="-pthread"
2574 CFLAGS="${CFLAGS} -pthread"
2575 PSCMD="ps -ax -o pid,command"
2579 platforms/bsdi/Makefile \
2580 platforms/bsdi/bacula-fd \
2581 platforms/bsdi/bacula-sd \
2582 platforms/bsdi/bacula-dir"
2583 largefile_support="yes"
2586 DISTVER=`uname -a |awk '{print $3}'`
2587 TAPEDRIVE="/dev/nrst0"
2590 WLDFLAGS="-mwindows"
2594 TAPEDRIVE="/dev/nst0"
2595 PSCMD="ps -e -o pid,command"
2598 platforms/darwin/Makefile"
2601 dnl Make sure hostname is resolved
2602 ping -c 1 $hostname 2>&1 1>/dev/null
2603 if test ! $? = 0; then
2604 hostname="localhost"
2606 if `test -f /etc/apt/sources.list && grep -q ubuntu /etc/apt/sources.list`; then
2609 DISTVER=`cat /etc/debian_version`
2610 if test -f /etc/lsb-release ; then
2612 if test "x$DISTRIB_ID" != "x" ; then
2613 DISTNAME=$DISTRIB_ID
2615 if test "x$DISTRIB_RELEASE" != "x" ; then
2616 DISTVER=$DISTRIB_RELEASE
2619 if test "$DISTNAME" = "Ubuntu" ; then
2622 TAPEDRIVE="/dev/nst0"
2623 PSCMD="ps -e -o pid,command"
2624 if test "$DISTNAME" = "ubuntu" ; then
2626 platforms/ubuntu/Makefile \
2627 platforms/ubuntu/bacula-fd \
2628 platforms/ubuntu/bacula-sd \
2629 platforms/ubuntu/bacula-dir"
2632 platforms/debian/Makefile \
2633 platforms/debian/bacula-fd \
2634 platforms/debian/bacula-sd \
2635 platforms/debian/bacula-dir"
2639 dnl Make sure hostname is resolved
2640 ping -c 1 $hostname 2>&1 1>/dev/null
2641 if test ! $? = 0; then
2642 hostname="localhost"
2644 DISTVER=`uname -a |awk '{print $3}'`
2645 VER=`echo $DISTVER | cut -c 1`
2646 if test x$VER = x4 ; then
2647 PTHREAD_LIB="${PTHREAD_LIBS:--pthread}"
2648 CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS:--pthread}"
2652 TAPEDRIVE="/dev/nrsa0"
2653 PSCMD="ps -ax -o pid,command"
2655 platforms/freebsd/Makefile \
2656 platforms/freebsd/bacula-fd \
2657 platforms/freebsd/bacula-sd \
2658 platforms/freebsd/bacula-dir"
2659 largefile_support="yes"
2662 PSCMD="UNIX95=1; ps -e -o pid,comm"
2663 CFLAGS="${CFLAGS} -D_XOPEN_SOURCE_EXTENDED=1"
2665 TAPEDRIVE="/dev/rmt/0hnb"
2666 PTHREAD_LIB="-lpthread"
2667 AC_DEFINE([_INCLUDE_LONGLONG])
2671 TAPEDRIVE="/dev/rmt/0cbn"
2672 PSCMD="ps -e -o pid,comm"
2674 platforms/irix/Makefile \
2675 platforms/irix/bacula-fd \
2676 platforms/irix/bacula-sd \
2677 platforms/irix/bacula-dir"
2680 DISTVER=`uname -a |awk '{print $3}'`
2683 TAPEDRIVE="/dev/nrst0"
2684 PSCMD="ps -ax -o pid,command"
2685 PTHREAD_LIB="-pthread"
2686 CFLAGS="${CFLAGS} -pthread"
2689 DISTVER=`uname -a |awk '{print $3}'`
2692 TAPEDRIVE="/dev/nrst0"
2693 PSCMD="ps -ax -o pid,command"
2694 PTHREAD_LIB="-pthread"
2695 CFLAGS="${CFLAGS} -pthread"
2697 platforms/openbsd/Makefile \
2698 platforms/openbsd/bacula-fd \
2699 platforms/openbsd/bacula-sd \
2700 platforms/openbsd/bacula-dir"
2703 dnl Make sure hostname is resolved
2704 ping -c 1 $hostname 2>&1 1>/dev/null
2705 if test ! $? = 0; then
2706 hostname="localhost"
2708 if test -f /etc/whitebox-release ; then
2709 f=/etc/whitebox-release
2711 f=/etc/redhat-release
2713 if test `cat $f | grep release |\
2714 cut -f 3 -d ' '`x = "Enterprise"x ; then
2715 DISTVER="Enterprise "`cat $f | grep release |\
2718 DISTVER=`cat /etc/redhat-release | grep release |\
2721 TAPEDRIVE="/dev/nst0"
2722 PSCMD="ps -e -o pid,command"
2724 platforms/redhat/Makefile \
2725 platforms/redhat/bacula-fd \
2726 platforms/redhat/bacula-sd \
2727 platforms/redhat/bacula-dir \
2728 platforms/redhat/bacula.spec \
2732 dnl Make sure hostname is resolved
2733 ping -c 1 $hostname 2>&1 1>/dev/null
2734 if test ! $? = 0; then
2735 hostname="localhost"
2737 DISTVER=`cat /etc/mandrake-release | grep release |\
2739 TAPEDRIVE="/dev/nst0"
2740 PSCMD="ps -e -o pid,command"
2742 platforms/mandrake/Makefile \
2743 platforms/mandrake/bacula-fd \
2744 platforms/mandrake/bacula-sd \
2745 platforms/mandrake/bacula-dir \
2746 platforms/mandrake/bacula.spec \
2750 dnl Make sure hostname is resolved
2751 ping -c 1 $hostname 2>&1 1>/dev/null
2752 if test ! $? = 0; then
2753 hostname="localhost"
2755 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
2756 TAPEDRIVE="/dev/nst0"
2757 PSCMD="ps -e -o pid,command"
2759 platforms/gentoo/Makefile \
2760 platforms/gentoo/bacula-init \
2761 platforms/gentoo/bacula-fd \
2762 platforms/gentoo/bacula-sd \
2763 platforms/gentoo/bacula-dir"
2766 dnl Make sure hostname is resolved
2767 ping -c 1 $hostname 2>&1 1>/dev/null
2768 if test ! $? = 0; then
2769 hostname="localhost"
2771 DISTVER=`cat /etc/slackware-version`
2772 TAPEDRIVE="/dev/nst0"
2773 PSCMD="ps -e -o pid,command"
2775 platforms/slackware/Makefile \
2776 platforms/slackware/rc.bacula-fd \
2777 platforms/slackware/rc.bacula-sd \
2778 platforms/slackware/rc.bacula-dir\
2779 platforms/slackware/functions.bacula"
2783 TAPEDRIVE="/dev/rmt/0cbn"
2784 PSCMD="ps -e -o pid,comm"
2786 platforms/solaris/Makefile \
2787 platforms/solaris/bacula-fd \
2788 platforms/solaris/bacula-sd \
2789 platforms/solaris/bacula-dir"
2790 if test x$DISTVER = x5.6 ; then
2791 AC_DEFINE(HAVE_OLD_SOCKOPT)
2793 LIBS="$LIBS -lresolv"
2796 dnl Make sure hostname is resolved
2797 ping -c 1 $hostname 2>&1 1>/dev/null
2798 if test ! $? = 0; then
2799 hostname="localhost"
2801 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
2803 TAPEDRIVE="/dev/nst0"
2804 PSCMD="ps -e -o pid,command"
2806 platforms/suse/Makefile \
2807 platforms/suse/bacula-fd \
2808 platforms/suse/bacula-sd \
2809 platforms/suse/bacula-dir \
2810 platforms/suse/bacula \
2811 platforms/suse/bacula.spec"
2814 dnl Make sure hostname is resolved
2815 ping -c 1 $hostname 2>&1 1>/dev/null
2816 if test ! $? = 0; then
2817 hostname="localhost"
2821 TAPEDRIVE="/dev/nst0"
2822 PSCMD="ps -e -o pid,command"
2824 platforms/suse/Makefile \
2825 platforms/suse/bacula-fd \
2826 platforms/suse/bacula-sd \
2827 platforms/suse/bacula-dir"
2831 TAPEDRIVE="/dev/nst0"
2834 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
2840 LIBS="$PTHREAD_LIB $LIBS"
2842 AC_DEFINE_UNQUOTED(lld, "$lld")
2843 AC_DEFINE_UNQUOTED(llu, "$llu")
2851 dnl common parts of the Makefile
2852 MCOMMON=./autoconf/Make.common
2853 AC_SUBST_FILE(MCOMMON)
2856 if test "x${subsysdir}" = "x${sbindir}" ; then
2859 echo "You have set both --sbindir and --with-subsys-dir"
2860 echo " equal to: ${subsysdir} "
2861 echo "This is not permitted. Please reconfigure."
2863 echo "Aborting configuration ..."
2869 AC_OUTPUT([autoconf/Make.common \
2872 scripts/startmysql \
2874 scripts/btraceback \
2880 scripts/bacula-ctl-dir \
2881 scripts/bacula-ctl-fd \
2882 scripts/bacula-ctl-sd \
2883 scripts/devel_bacula \
2886 scripts/bacula.desktop.gnome1 \
2887 scripts/bacula.desktop.gnome2 \
2888 scripts/bacula.desktop.gnome1.consolehelper \
2889 scripts/bacula.desktop.gnome2.consolehelper \
2890 scripts/bacula.desktop.gnome1.xsu \
2891 scripts/bacula.desktop.gnome2.xsu \
2892 scripts/bgnome-console.console_apps \
2893 scripts/mtx-changer \
2894 scripts/disk-changer \
2895 scripts/dvd-handler \
2896 scripts/dvd-simulator \
2897 scripts/bacula-tray-monitor.desktop \
2898 scripts/logwatch/Makefile \
2899 scripts/logwatch/logfile.bacula.conf \
2900 scripts/wxconsole.console_apps \
2901 scripts/wxconsole.desktop.consolehelper \
2902 scripts/wxconsole.desktop.xsu \
2903 scripts/bat.desktop \
2904 scripts/bat.desktop.xsu \
2905 scripts/bat.desktop.consolehelper \
2906 scripts/bat.console_apps \
2909 src/console/Makefile \
2910 src/console/bconsole.conf \
2911 src/gnome2-console/Makefile \
2912 src/gnome2-console/bgnome-console.conf \
2913 src/qt-console/bat.conf \
2914 src/qt-console/bat.pro \
2915 src/qt-console/bat.pro.mingw32 \
2916 src/qt-console/install_conf_file \
2917 src/wx-console/Makefile \
2918 src/wx-console/bwx-console.conf \
2919 src/tray-monitor/Makefile \
2920 src/tray-monitor/tray-monitor.conf \
2922 src/dird/bacula-dir.conf \
2924 src/stored/Makefile \
2925 src/stored/bacula-sd.conf \
2926 src/filed/Makefile \
2927 src/filed/bacula-fd.conf \
2929 src/cats/make_catalog_backup \
2930 src/cats/delete_catalog_backup \
2931 src/cats/create_postgresql_database \
2932 src/cats/update_postgresql_tables \
2933 src/cats/make_postgresql_tables \
2934 src/cats/grant_postgresql_privileges \
2935 src/cats/drop_postgresql_tables \
2936 src/cats/drop_postgresql_database \
2937 src/cats/create_mysql_database \
2938 src/cats/update_mysql_tables \
2939 src/cats/make_mysql_tables \
2940 src/cats/grant_mysql_privileges \
2941 src/cats/drop_mysql_tables \
2942 src/cats/drop_mysql_database \
2943 src/cats/create_sqlite_database \
2944 src/cats/update_sqlite_tables \
2945 src/cats/make_sqlite_tables \
2946 src/cats/grant_sqlite_privileges \
2947 src/cats/drop_sqlite_tables \
2948 src/cats/drop_sqlite_database \
2949 src/cats/create_sqlite3_database \
2950 src/cats/update_sqlite3_tables \
2951 src/cats/make_sqlite3_tables \
2952 src/cats/grant_sqlite3_privileges \
2953 src/cats/drop_sqlite3_tables \
2954 src/cats/drop_sqlite3_database \
2957 src/cats/create_bdb_database \
2958 src/cats/update_bdb_tables \
2959 src/cats/make_bdb_tables \
2960 src/cats/grant_bdb_privileges \
2961 src/cats/drop_bdb_tables \
2962 src/cats/drop_bdb_database \
2963 src/cats/create_bacula_database \
2964 src/cats/update_bacula_tables \
2965 src/cats/grant_bacula_privileges \
2966 src/cats/make_bacula_tables \
2967 src/cats/drop_bacula_tables \
2968 src/cats/drop_bacula_database \
2969 src/findlib/Makefile \
2970 src/tools/Makefile \
2971 src/plugins/fd/Makefile \
2972 src/plugins/sd/Makefile \
2973 src/plugins/dir/Makefile \
2974 src/win32/Makefile.inc \
2976 updatedb/update_mysql_tables_9_to_10 \
2977 updatedb/update_sqlite3_tables_9_to_10 \
2978 updatedb/update_postgresql_tables_9_to_10 \
2979 updatedb/update_sqlite_tables_9_to_10 \
2980 updatedb/update_mysql_tables_10_to_11 \
2981 updatedb/update_sqlite3_tables_10_to_11 \
2982 updatedb/update_postgresql_tables_10_to_11 \
2983 updatedb/update_sqlite_tables_10_to_11 \
2988 if test "${support_bat}" = "yes" ; then
2989 if test "x$QMAKE" = "xnone" && test "x$QMAKEQT4" = "xnone"; then
2990 AC_MSG_ERROR([Could not find qmake or qmake-qt4 in $PATH. Check your Qt installation])
2995 if test "x$QMAKEQT4" != "xnone"; then
3000 echo "Creating bat Makefile"
3009 dnl if CC is gcc, we can rebuild the dependencies (since the depend rule
3010 dnl requires gcc). If it's not, don't rebuild dependencies
3012 if test X"$GCC" = "Xyes" ; then
3013 echo "Doing make of dependencies"
3014 ${MAKE:-make} depend
3018 chmod 755 install_conf_file build-depkgs-qt-console
3022 chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
3023 chmod 755 dvd-handler dvd-simulator
3024 chmod 755 bconsole gconsole mtx-changer devel_bacula logrotate
3028 chmod 755 $c/update_mysql_tables_10_to_11 $c/update_sqlite3_tables_10_to_11
3029 chmod 755 $c/update_postgresql_tables_10_to_11 $c/update_sqlite_tables_10_to_11
3033 chmod 755 $c/create_bacula_database $c/update_bacula_tables $c/make_bacula_tables
3034 chmod 755 $c/grant_bacula_privileges $c/drop_bacula_tables $c/drop_bacula_database
3036 chmod 755 $c/create_bdb_database $c/update_bdb_tables $c/make_bdb_tables
3037 chmod 755 $c/grant_bdb_privileges $c/drop_bdb_tables $c/drop_bdb_database
3039 chmod 755 $c/create_mysql_database $c/update_mysql_tables $c/make_mysql_tables
3040 chmod 755 $c/grant_mysql_privileges $c/drop_mysql_tables $c/drop_mysql_database
3042 chmod 755 $c/create_sqlite_database $c/update_sqlite_tables $c/make_sqlite_tables
3043 chmod 755 $c/grant_sqlite_privileges $c/drop_sqlite_tables $c/drop_sqlite_database
3045 chmod 755 $c/create_sqlite3_database $c/update_sqlite3_tables $c/make_sqlite3_tables
3046 chmod 755 $c/grant_sqlite3_privileges $c/drop_sqlite3_tables $c/drop_sqlite3_database
3048 chmod 755 $c/create_postgresql_database $c/update_postgresql_tables $c/make_postgresql_tables
3049 chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables $c/drop_postgresql_database
3051 chmod 755 $c/make_catalog_backup $c/delete_catalog_backup
3055 chmod 755 src/win32/build-depkgs-mingw32
3057 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
3058 largefile_support="yes"
3061 dnl Only try to find out the version number of the compiler when we know its some kind of GCC compiler
3062 if test X"$GCC" = "Xyes" ; then
3064 dnl A whole lot of hand springs to get the compiler version.
3065 dnl This is because gcc changed the output in version 3.0
3067 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3068 if test "x${CCVERSION}" = "x" ; then
3069 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3071 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3072 if test x"${CXXVERSION}" = x ; then
3073 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3077 # clean up any old junk
3083 if test "x${db_type}" = "xInternal" ; then
3086 echo "You have not specified either --enable-client-only or one of the"
3087 echo " supported databases: MySQL, PostgreSQL, SQLite3, SQLite or DBI."
3088 echo " This is not permitted. Please reconfigure."
3090 echo "Aborting the configuration ..."
3097 Configuration on `date`:
3099 Host: ${host}${post_host} -- ${DISTNAME} ${DISTVER}
3100 Bacula version: ${BACULA} ${VERSION} (${DATE})
3101 Source code location: ${srcdir}
3102 Install binaries: ${sbindir}
3103 Install libraries: ${libdir}
3104 Install config files: ${sysconfdir}
3105 Scripts directory: ${scriptdir}
3106 Archive directory: ${archivedir}
3107 Working directory: ${working_dir}
3108 PID directory: ${piddir}
3109 Subsys directory: ${subsysdir}
3110 Man directory: ${mandir}
3111 Data directory: ${datarootdir}
3112 Plugin directory: ${plugindir}
3113 C Compiler: ${CC} ${CCVERSION}
3114 C++ Compiler: ${CXX} ${CXXVERSION}
3115 Compiler flags: ${WCFLAGS} ${CFLAGS}
3116 Linker flags: ${WLDFLAGS} ${LDFLAGS}
3118 Statically Linked Tools: ${support_static_tools}
3119 Statically Linked FD: ${support_static_fd}
3120 Statically Linked SD: ${support_static_sd}
3121 Statically Linked DIR: ${support_static_dir}
3122 Statically Linked CONS: ${support_static_cons}
3123 Database type: ${db_type}
3124 Database port: ${db_port}
3125 Database lib: ${DB_LIBS}
3126 Database name: ${db_name}
3127 Database user: ${db_user}
3129 Job Output Email: ${job_email}
3130 Traceback Email: ${dump_email}
3131 SMTP Host Address: ${smtp_host}
3133 Director Port: ${dir_port}
3134 File daemon Port: ${fd_port}
3135 Storage daemon Port: ${sd_port}
3137 Director User: ${dir_user}
3138 Director Group: ${dir_group}
3139 Storage Daemon User: ${sd_user}
3140 Storage DaemonGroup: ${sd_group}
3141 File Daemon User: ${fd_user}
3142 File Daemon Group: ${fd_group}
3144 SQL binaries Directory ${SQL_BINDIR}
3146 Large file support: $largefile_support
3147 Bacula conio support: ${got_conio} ${CONS_LIBS}
3148 readline support: ${got_readline} ${PRTREADLINE_SRC}
3149 TCP Wrappers support: ${TCPW_MSG} ${WRAPLIBS}
3150 TLS support: ${support_tls}
3151 Encryption support: ${support_crypto}
3152 ZLIB support: ${have_zlib}
3153 enable-smartalloc: ${support_smartalloc}
3154 enable-lockmgr: ${support_lockmgr}
3155 bat support: ${support_bat} ${QWT_LDFLAGS}
3156 enable-gnome: ${support_gnome} ${gnome_version}
3157 enable-bwx-console: ${support_wx_console} ${wx_version}
3158 enable-tray-monitor: ${support_tray_monitor}
3159 client-only: ${build_client_only}
3160 build-dird: ${build_dird}
3161 build-stored: ${build_stored}
3162 ACL support: ${have_acl}
3163 XATTR support: ${have_xattr}
3164 Python support: ${support_python} ${PYTHON_LIBS}
3165 Batch insert enabled: ${support_batch_insert}