3 dnl Process this file with autoconf to produce a configure script.
5 dnl require a recent autoconf
14 AC_CONFIG_AUX_DIR(${BUILD_DIR}/autoconf)
15 AC_CONFIG_HEADERS(src/config.h:autoconf/config.h.in)
17 dnl minimal Win32 stuff for "make clean"
18 WIN32BUILDDIR=${BUILD_DIR}/src/win32
19 WIN32MAINDIR=${BUILD_DIR}
20 WIN32TOPDIR=${TOP_DIR}
21 AC_SUBST(WIN32BUILDDIR)
22 AC_SUBST(WIN32MAINDIR)
25 dnl search for true and false programs.
26 AC_PATH_PROGS(TRUEPRG, true, :)
27 AC_PATH_PROGS(FALSEPRG, false, :)
32 if test "x$BACULA" != x; then
33 post_host=`echo -${BACULA} | tr 'A-Z ' 'a-z-'`
35 BACULA=${BACULA:-Bacula}
36 VERSION=`sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
37 DATE=`sed -n -e 's/^.*[ \t]*BDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
38 LSMDATE=`sed -n -e 's/^.*LSMDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
43 AC_SUBST(post_host)dnl
44 echo "configuring for ${BACULA} $VERSION ($DATE)"
46 dnl -------------------------------------------------------
47 dnl Check for compiler.
48 dnl ------------------------------------------------------
52 AC_PROG_CC_C_O dnl Determine if C compiler support -c -o.
53 AC_PROG_GCC_TRADITIONAL dnl Determine if ioctl() need -traditional.
57 if test "x$BASECC" = xgcc; then
61 AC_PATH_PROG(CXX, $CXX, $CXX)
62 if test ! -e $CXX; then
63 AC_MSG_ERROR(Unable to find C++ compiler)
66 dnl -------------------------------------------------------
67 dnl Check for programs.
68 dnl ------------------------------------------------------
70 AC_PATH_PROG(MV, mv, mv)
72 dnl If we name the variable RM it will shadow the RM variable in the configure script and we overwrite the
73 dnl value with the name of the rm command and not rm -f which is its normal content. This gives all kind
74 dnl of strange output of the configure script (like things don't exist etc.).
75 dnl So we name it REMOVE (more software has run into this problem)
76 AC_PATH_PROG(REMOVE, rm, rm)
77 AC_PATH_PROG(CP, cp, cp)
78 AC_PATH_PROG(SED, sed, sed)
79 AC_PATH_PROG(ECHO, echo, echo)
80 AC_PATH_PROG(CMP, cmp, cmp)
81 AC_PATH_PROG(TBL, tbl, tbl)
82 AC_PATH_PROG(AR, ar, ar)
83 AC_PATH_PROG(OPENSSL, openssl, none)
84 AC_PATH_PROG(MTX, mtx, mtx)
85 AC_PATH_PROG(DD, dd, dd)
86 AC_PATH_PROG(MKISOFS, mkisofs, mkisofs)
87 AC_PATH_PROG(PYTHON, python, python)
88 AC_PATH_PROG(GROWISOFS, growisofs, growisofs)
89 AC_PATH_PROG(DVDRWMEDIAINFO, dvd+rw-mediainfo, dvd+rw-mediainfo)
90 AC_PATH_PROG(DVDRWFORMAT, dvd+rw-format, dvd+rw-format)
91 AC_PATH_PROG(PKGCONFIG, pkg-config, pkg-config)
92 AC_PATH_PROG(QMAKE, qmake, none)
93 AC_PATH_PROG(GMAKE, gmake, none)
94 AC_ARG_VAR(WXCONFIG, [wx-config command. On some systems, you must set it to wx-config-2.6 to use wxWidgets 2.6.])
95 if test "x$WXCONFIG" = x; then
98 AC_PATH_PROG(WXCONFIG, ${WXCONFIG}, ${WXCONFIG})
99 AC_ARG_VAR(WXFLAGS, [Parameters to pass to wx-config (e.g. --unicode=no).])
100 AC_PATH_PROG(CDRECORD, cdrecord, cdrecord)
101 AC_PATH_PROG(PIDOF, pidof, pidof)
103 # Some AWK programs fail, so test it and warn the user
104 if echo xfoo | $AWK 'BEGIN { prog=ARGV[1]; ARGC=1 }
105 { if ((prog == $2) || (("(" prog ")") == $2) ||
106 (("[" prog "]") == $2) ||
107 ((prog ":") == $2)) { print $1 ; exit 0 } }' xfoo>/dev/null; then :;
109 AC_MSG_ERROR([!!!!!!!!! WARNING !!!!!!!!!!!!!!
110 The regex engine of $AWK is too broken to be used you
111 might want to install GNU AWK.
112 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!])
115 AC_PATH_PROG(AWK, $THE_AWK, $THE_AWK)
118 test -n "$ARFLAG" || ARFLAGS="cr"
125 AC_SUBST(LOCAL_CFLAGS)
126 AC_SUBST(LOCAL_LDFLAGS)
129 dnl --------------------------------------------------
131 dnl --------------------------------------------------
133 AC_ARG_ENABLE(libtool,
134 AC_HELP_STRING([--enable-libtool], [enable building using GNU libtool @<:@default=yes@:>@]),
136 if test x$enableval = xno; then
141 LT_INIT([shared disable-static])
144 if test x$use_libtool != xno; then
145 DEFAULT_OBJECT_TYPE=".lo"
146 DEFAULT_ARCHIVE_TYPE=".la"
147 DEFAULT_SHARED_OBJECT_TYPE=".la"
148 LIBTOOL="\$(LIBTOOL)"
149 LIBTOOL_INSTALL_TARGET="libtool-install"
150 LIBTOOL_UNINSTALL_TARGET="libtool-uninstall"
151 LIBTOOL_CLEAN_TARGET="libtool-clean"
152 QMAKE_LIBTOOL="${BUILD_DIR}/libtool"
153 FD_PLUGIN_DIR="src/plugins/fd"
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"
168 AC_SUBST(DEFAULT_OBJECT_TYPE)
169 AC_SUBST(DEFAULT_ARCHIVE_TYPE)
170 AC_SUBST(DEFAULT_SHARED_OBJECT_TYPE)
172 AC_SUBST(LIBTOOL_INSTALL_TARGET)
173 AC_SUBST(LIBTOOL_UNINSTALL_TARGET)
174 AC_SUBST(LIBTOOL_CLEAN_TARGET)
175 AC_SUBST(QMAKE_LIBTOOL)
176 AC_SUBST(FD_PLUGIN_DIR)
178 dnl --------------------------------------------------
179 dnl Include file handling
180 dnl --------------------------------------------------
181 AC_ARG_ENABLE(includes,
182 AC_HELP_STRING([--enable-includes], [enable installing of include files @<:@default=no@:>@]),
184 if test x$enableval = xyes; then
190 dnl It only makes sense to install include files when you install libraries which only happens when
191 dnl libtool is enabled
193 if test x$use_libtool != xno -a x$install_includes = xyes; then
194 INCLUDE_INSTALL_TARGET="install-includes"
195 INCLUDE_UNINSTALL_TARGET="uninstall-includes"
197 INCLUDE_INSTALL_TARGET=""
198 INCLUDE_UNINSTALL_TARGET=""
200 AC_SUBST(INCLUDE_INSTALL_TARGET)
201 AC_SUBST(INCLUDE_UNINSTALL_TARGET)
203 dnl --------------------------------------------------
204 dnl Bacula OP Sys determination (see aclocal.m4)
205 dnl --------------------------------------------------
208 dnl -----------------------------------------------------------
209 dnl Bacula OPSys Distribution determination (see aclocal.m4)
210 dnl ----------------------------------------------------------
211 BA_CHECK_OPSYS_DISTNAME
213 dnl --------------------------------------------------
214 dnl Suppport for gettext (translations)
215 dnl By default, $datarootdir is ${prefix}/share
216 dnl --------------------------------------------------
217 AM_GNU_GETTEXT([external])
219 dnl ------------------------------------------------------------------
220 dnl If the user has not set --prefix, we set our default to nothing.
221 dnl In this case, if the user has not set --sysconfdir, we set it
222 dnl to the package default of /etc/bacula. If either --prefix or
223 dnl --sysconfdir is set, we leave sysconfdir alone except to eval it.
224 dnl If the user has not set --libdir, we set it to the package
225 dnl default of /usr/lib. If either --prefix or --libdir is set,
226 dnl we leave libdir alone except to eval it. If the user has not set
227 dnl --includedir, we set it to the package default of /usr/include.
228 dnl If either --prefix or --includedir is set, we leave includedir
229 dnl alone except to eval it
230 dnl ------------------------------------------------------------------
231 os_name=`uname -s 2>/dev/null`
232 if test x${prefix} = xNONE ; then
233 if test `eval echo ${sysconfdir}` = NONE/etc ; then
234 sysconfdir=/etc/bacula
237 if test `eval echo ${libdir}` = NONE/lib ; then
240 os_processor=`uname -p 2>/dev/null`
241 case ${os_processor} in
256 if test `eval echo ${includedir}` = NONE/include ; then
257 includedir=/usr/include
260 if test `eval echo ${datarootdir}` = NONE/share ; then
261 datarootdir=/usr/share
266 dnl -------------------------------------------------------------------------
267 dnl If the user has not set --exec-prefix, we default to ${prefix}
268 dnl -------------------------------------------------------------------------
269 if test x${exec_prefix} = xNONE ; then
270 exec_prefix=${prefix}
273 sysconfdir=`eval echo ${sysconfdir}`
274 datarootdir=`eval echo ${datarootdir}`
275 docdir=`eval echo ${docdir}`
276 htmldir=`eval echo ${htmldir}`
277 libdir=`eval echo ${libdir}`
278 includedir=`eval echo ${includedir}`
279 localedir=`eval echo ${datarootdir}/locale`
280 AC_DEFINE_UNQUOTED(SYSCONFDIR, "$sysconfdir")
281 AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir")
283 dnl ------------------------------------------------------------------
284 dnl If the user has not set --sbindir, we set our default as /sbin
285 dnl ------------------------------------------------------------------
286 if test x$sbindir = x'${exec_prefix}/sbin' ; then
287 sbindir=${exec_prefix}/sbin
289 sbindir=`eval echo ${sbindir}`
291 dnl -------------------------------------------------------------------------
292 dnl If the user has not set --mandir, we default to /usr/share/man
293 dnl -------------------------------------------------------------------------
294 if test x$mandir = x'${prefix}/man' ; then
295 mandir=/usr/share/man
298 dnl -------------------------------------------------------------------------
299 dnl If the user has not set --htmldir, we default to /usr/share/doc/bacula/html
300 dnl -------------------------------------------------------------------------
301 if test x$htmldir = x${docdir} ; then
302 htmldir=`eval echo ${docdir}bacula/html`
305 dnl -------------------------------------------------------------------------
306 dnl If the user has not set --docdir, we default to /usr/share/doc/
307 dnl -------------------------------------------------------------------------
308 if test x$docdir = x'/usr/share/doc/' ; then
309 docdir=`eval echo ${docdir}bacula`
313 AC_PATH_PROGS(MSGFMT, msgfmt, no)
314 if test "$MSGFMT" = "no"
316 echo 'msgfmt program not found, disabling NLS !'
318 USE_INCLUDED_LIBINTL=no
326 support_postgresql=no
329 support_smartalloc=yes
334 support_wx_console=no
335 support_tray_monitor=no
340 support_static_tools=no
343 support_static_dir=no
344 support_static_cons=no
354 dnl --------------------------------------------------------------------------
355 dnl CHECKING COMMAND LINE OPTIONS
356 dnl --------------------------------------------------------------------------
358 dnl -------------------------------------------
359 dnl gnome (default off)
360 dnl -------------------------------------------
362 AC_HELP_STRING([--enable-gnome], [enable build of bgnome-console GUI @<:@default=no@:>@]),
364 if test x$enableval = xyes; then
371 if test x$support_gnome = xyes; then
372 AC_MSG_ERROR(bgnome-console no longer supported)
373 AC_MSG_ERROR(--enable-gnome option no longer supported)
375 # AC_SUBST(GNOME_DIR)
377 dnl -------------------------------------------
378 dnl bat (default off)
379 dnl -------------------------------------------
381 AC_HELP_STRING([--enable-bat], [enable build of bat Qt4 GUI @<:@default=no@:>@]),
383 if test x$enableval = xyes; then
384 AC_DEFINE(HAVE_BAT, 1, [Set if Bacula bat Qt4 GUI support enabled])
391 if test x$support_bat = xyes; then
392 abc=`$PKGCONFIG --atleast-version=4.2 QtGui`
394 if test $pkg = 0; then
395 BAT_DIR=src/qt-console
397 AC_MSG_ERROR(Unable to find Qt4 installation needed by bat)
402 dnl The qwt library was used with bat, but that is no longer the case
410 dnl if test x$support_bat = xyes; then
411 dnl AC_MSG_CHECKING(for qwt support)
413 dnl AC_HELP_STRING([--with-qwt@<:@=DIR@:>@], [specify qwt library directory]),
415 dnl case "$with_qwt" in
420 dnl if test -f ${with_qwt}/include/qwt.h; then
421 dnl QWT_INC="${with_qwt}/include"
422 dnl QWT_LDFLAGS="-L${with_qwt}/lib"
432 dnl dnl Search in standard places, or --with-qwt not specified
434 dnl if test $no_qwt = no; then
435 dnl if test x$QWT_INC = x; then
436 dnl for root in /usr /usr/local; do
437 dnl for ver in qwt qwt5 qwt-qt4; do
438 dnl if test -f ${root}/include/${ver}/qwt.h; then
439 dnl QWT_INC="${root}/include/${ver}"
440 dnl if test -d ${root}/lib64/; then
441 dnl QWT_LDFLAGS="-L${root}/lib64"
442 dnl elif test -d ${root}/lib/64/; then
443 dnl QWT_LDFLAGS="-L${root}/64"
445 dnl QWT_LDFLAGS="-L${root}/lib"
456 dnl if test x$QWT_INC = x; then
457 dnl AC_MSG_RESULT(no)
459 dnl AC_DEFINE(HAVE_QWT, 1, [Set if bat QWT library found])
460 dnl AC_MSG_RESULT(yes)
466 AC_SUBST(QWT_LDFLAGS)
470 dnl -------------------------------------------
471 dnl bwx-console (default off)
472 dnl -------------------------------------------
473 AC_ARG_ENABLE(bwx-console,
474 AC_HELP_STRING([--enable-bwx-console], [enable build of wxWidgets console @<:@default=no@:>@]),
476 if test x$enableval = xyes; then
477 support_wx_console=yes
483 if test x$support_wx_console = xyes; then
484 abc=`$WXCONFIG $WXFLAGS --cppflags`
486 if test $pkg = 0; then
487 wx_version="wxWidgets `$WXCONFIG $WXFLAGS --release`"
488 WXCONS_CPPFLAGS=`$WXCONFIG $WXFLAGS --cppflags`
489 WXCONS_LDFLAGS=`$WXCONFIG $WXFLAGS --libs`
491 AC_SUBST(WXCONS_CPPFLAGS)
492 AC_SUBST(WXCONS_LDFLAGS)
493 WX_DIR="src/wx-console"
496 echo "wx-config program not found. bwx-console disabled."
498 support_wx_console=no
503 dnl -------------------------------------------
504 dnl tray-monitor (default off)
505 dnl -------------------------------------------
506 AC_ARG_ENABLE(tray-monitor,
507 AC_HELP_STRING([--enable-tray-monitor], [enable build of Gnome tray monitor (compatible with KDE @<:@default=no@:>@]),
509 if test x$enableval = xyes; then
510 support_tray_monitor=yes
516 if test x$support_tray_monitor = xyes; then
517 abc=`$PKGCONFIG --exists gtk+-2.0`
519 if test $pkg = 0; then
520 TRAY_MONITOR_CPPFLAGS=`$PKGCONFIG --cflags gtk+-2.0`
521 TRAY_MONITOR_LDFLAGS=`$PKGCONFIG --libs gtk+-2.0`
522 AC_SUBST(TRAY_MONITOR_CPPFLAGS)
523 AC_SUBST(TRAY_MONITOR_LDFLAGS)
524 TRAY_MONITOR_DIR=src/tray-monitor
525 abc=`$PKGCONFIG --atleast-version=2.4 gtk+-2.0`
527 if test $pkg = 0; then
528 AC_DEFINE(HAVE_GTK_2_4, 1, [Set if you have GTK 4.2 or greater loaded])
532 AC_SUBST(TRAY_MONITOR_DIR)
534 dnl -------------------------------------------
535 dnl smartalloc (default off)
536 dnl -------------------------------------------
537 AC_ARG_ENABLE(smartalloc,
538 AC_HELP_STRING([--enable-smartalloc], [enable smartalloc debugging support @<:@default=no@:>@]),
540 if test x$enableval = xno; then
541 support_smartalloc=no
546 if test x$support_smartalloc = xyes; then
547 AC_DEFINE(SMARTALLOC, 1, [Set if you want Smartalloc enabled])
550 dnl -------------------------------------------
551 dnl Lock Manager (default off)
552 dnl -------------------------------------------
553 AC_ARG_ENABLE(lockmgr,
554 AC_HELP_STRING([--enable-lockmgr], [enable lock manager support @<:@default=no@:>@]),
556 if test x$enableval = xyes; then
562 if test x$support_lockmgr = xyes; then
563 AC_DEFINE(_USE_LOCKMGR, 1, [Set if you want Lock Manager enabled])
567 dnl -------------------------------------------
568 dnl static-tools (default off)
569 dnl -------------------------------------------
570 AC_ARG_ENABLE(static-tools,
571 AC_HELP_STRING([--enable-static-tools], [enable static tape tools @<:@default=no@:>@]),
573 if test x$enableval = xyes; then
574 if test x$use_libtool = xyes; then
575 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
576 please rerun configure with --disable-libtool])
578 support_static_tools=yes
584 if test x$support_static_tools = xyes; then
585 TTOOL_LDFLAGS="-static"
587 AC_SUBST(TTOOL_LDFLAGS)
589 dnl -------------------------------------------
590 dnl static-fd (default off)
591 dnl -------------------------------------------
592 AC_ARG_ENABLE(static-fd,
593 AC_HELP_STRING([--enable-static-fd], [enable static File daemon @<:@default=no@:>@]),
595 if test x$enableval = xyes; then
596 if test x$use_libtool = xyes; then
597 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
598 please rerun configure with --disable-libtool])
600 support_static_fd=yes
606 if test x$support_static_fd = xyes; then
607 STATIC_FD="static-bacula-fd"
611 dnl -------------------------------------------
612 dnl static-sd (default off)
613 dnl -------------------------------------------
614 AC_ARG_ENABLE(static-sd,
615 AC_HELP_STRING([--enable-static-sd], [enable static Storage daemon @<:@default=no@:>@]),
617 if test x$enableval = xyes; then
618 if test x$use_libtool = xyes; then
619 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
620 please rerun configure with --disable-libtool])
622 support_static_sd=yes
628 if test x$support_static_sd = xyes; then
629 STATIC_SD="static-bacula-sd"
633 dnl -------------------------------------------
634 dnl static-dir (default off)
635 dnl -------------------------------------------
636 AC_ARG_ENABLE(static-dir,
637 AC_HELP_STRING([--enable-static-dir], [enable static Director @<:@default=no@:>@]),
639 if test x$enableval = xyes; then
640 if test x$use_libtool = xyes; then
641 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
642 please rerun configure with --disable-libtool])
644 support_static_dir=yes
650 if test x$support_static_dir = xyes; then
651 STATIC_DIR="static-bacula-dir"
655 dnl -------------------------------------------
656 dnl static-cons (default off)
657 dnl -------------------------------------------
658 AC_ARG_ENABLE(static-cons,
659 AC_HELP_STRING([--enable-static-cons], [enable static Console @<:@default=no@:>@]),
661 if test x$enableval = xyes; then
662 if test x$use_libtool = xyes; then
663 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
664 please rerun configure with --disable-libtool])
666 support_static_cons=yes
674 if test x$support_static_cons = xyes; then
675 STATIC_CONS="static-bconsole"
676 STATIC_GNOME_CONS="static-bgnome-console"
677 STATIC_WX_CONS="static-bwx-console"
679 AC_SUBST(STATIC_CONS)
680 AC_SUBST(STATIC_GNOME_CONS)
681 AC_SUBST(STATIC_WX_CONS)
683 dnl -------------------------------------------
684 dnl client_only (default off)
685 dnl -------------------------------------------
686 AC_ARG_ENABLE(client-only,
687 AC_HELP_STRING([--enable-client-only], [build client (File daemon) only @<:@default=no@:>@]),
689 if test x$enableval = xyes; then
690 build_client_only=yes
696 if test x$build_client_only = xno; then
703 dnl -------------------------------------------
704 dnl director (default on)
705 dnl -------------------------------------------
706 AC_ARG_ENABLE(build-dird,
707 AC_HELP_STRING([--enable-build-dird], [enable building of dird (Director) @<:@default=yes@:>@]),
709 if test x$enableval = xno; then
714 if test x$build_dird = xyes; then
719 DIR_TOOLS="NODIRTOOLS"
724 dnl -------------------------------------------
725 dnl stored (default on)
726 dnl -------------------------------------------
727 AC_ARG_ENABLE(build-stored,
728 AC_HELP_STRING([--enable-build-stored], [enable building of stored (Storage daemon) @<:@default=yes@:>@]),
730 if test x$enableval = xno; then
735 if test x$build_stored = xyes; then
736 STORED_DIR="src/stored"
742 dnl ---------------------------------------------------
743 dnl Check for conio (Bacula readline substitute)(
744 dnl ---------------------------------------------------
745 dnl this allows you to turn it completely off
747 AC_HELP_STRING([--disable-conio], [disable conio support @<:@default=no@:>@]),
749 if test x$enableval = xno; then
756 dnl ---------------------------------------------------
757 dnl Check for IPv6 support
758 dnl ---------------------------------------------------
759 dnl this allows you to turn it completely off
762 AC_HELP_STRING([--enable-ipv6], [enable ipv6 support @<:@default=yes@:>@]),
764 if test x$enableval = xno; then
770 if test x$support_ipv6 = xyes; then
771 AC_TRY_LINK([ #include <sys/types.h>
772 #include <sys/socket.h>
773 #include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;],
774 [support_ipv6=yes], [support_ipv6=no])
777 if test x$support_ipv6 = xyes; then
778 AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
782 if test x$support_conio = xyes; then
783 AC_CHECK_HEADER(termcap.h,
784 [ AC_CHECK_LIB(termcap, tgetent,
785 [ CONS_LIBS="-ltermcap"
790 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
792 [ AC_CHECK_LIB(ncurses, tgetent,
793 [ CONS_LIBS="-lncurses"
798 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
803 AC_CHECK_HEADERS(curses.h)
804 AC_CHECK_HEADER(term.h,
805 [ AC_CHECK_LIB(curses, tgetent,
806 [ CONS_LIBS="-lcurses"
811 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
814 [ echo " "; echo "Required libraries not found. CONIO turned off ..."; echo " "],
823 dnl ---------------------------------------------------
824 dnl Check for readline support/directory (default off)
825 dnl ---------------------------------------------------
826 dnl this allows you to turn it completely off
827 AC_ARG_ENABLE(readline,
828 AC_HELP_STRING([--disable-readline], [disable readline support @<:@default=yes@:>@]),
830 if test x$enableval = xno; then
838 if test x$support_readline = xyes; then
839 AC_ARG_WITH(readline,
840 AC_HELP_STRING([--with-readline@<:@=DIR@:>@], [specify readline library directory]),
842 case "$with_readline" in
847 if test -f ${with_readline}/readline.h; then
848 CONS_INC="-I${with_readline}"
849 CONS_LDFLAGS="-L$with_readline"
850 elif test -f ${with_readline}/include/readline/readline.h; then
851 CONS_INC="-I${with_readline}/include/readline"
852 CONS_LDFLAGS="-L${with_readline}/lib"
853 with_readline="${with_readline}/include/readline"
855 with_readline="/usr/include/readline"
858 AC_CHECK_HEADER(${with_readline}/readline.h,
860 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
861 CONS_LIBS="-lreadline -lhistory -ltermcap"
865 echo "readline.h not found. readline turned off ..."
872 dnl check for standard readline library
873 AC_CHECK_HEADER(/usr/include/readline/readline.h,
875 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
877 CONS_INC="-I/usr/include/readline"
878 CONS_LIBS="-lreadline -ltermcap"
880 dnl Did not find standard library, so try Bacula's default
881 AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h,
883 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
885 CONS_INC="-I${TOP_DIR}/depkgs/readline"
886 CONS_LIBS="-lreadline -lhistory -ltermcap"
887 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
888 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
891 echo "readline.h not found. readline turned off ..."
905 AC_SUBST(CONS_LDFLAGS)
906 AC_SUBST(READLINE_SRC)
908 dnl Minimal stuff for readline Makefile configuration
913 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr lstat lchown)
914 AC_CHECK_FUNCS(nanosleep nl_langinfo)
915 AC_CHECK_HEADERS(varargs.h)
917 dnl End of readline/conio stuff
918 dnl -----------------------------------------------------------------------
920 dnl -----------------------------------------------------------------------
921 dnl Check for Python support
923 AC_MSG_CHECKING(for Python support)
925 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.]),
929 if test "$withval" != "no"; then
930 if test "$withval" = "yes"; then
931 if test -e /usr/bin/python-config ; then
932 PYTHON_INCDIR=`/usr/bin/python-config --includes`
933 PYTHON_LIBS=`/usr/bin/python-config --libs`
935 for python_root in /usr /usr/local /usr/sfw; do
936 for ver in python2.2 python2.3 python2.4 python2.5 python2.6 python3; do
937 if test -f $python_root/include/${ver}/Python.h; then
938 PYTHON_INCDIR=-I$python_root/include/${ver}
939 if test -d $python_root/lib64/${ver}/config; then
940 PYTHON_LIBS="-L$python_root/lib64/${ver}/config -l${ver}"
942 PYTHON_LIBS="-L$python_root/lib/${ver}/config -l${ver}"
949 if test x$PYTHON_INCDIR = x; then
950 if test -f $prefix/include/Python.h; then
951 PYTHON_INCDIR=-I$prefix/include
952 if test -d $prefix/lib64/config; then
953 PYTHON_LIBS="-L$prefix/lib64/config -lpython"
955 PYTHON_LIBS="-L$prefix/lib/config -lpython"
959 AC_MSG_ERROR(Unable to find Python.h in standard locations)
964 if test -e $withval/bin/python-config ; then
965 PYTHON_INCDIR=`$withval/bin/python-config --includes`
966 PYTHON_LIBS=`$withval/bin/python-config --libs`
967 elif test -f $withval/Python.h; then
968 PYTHON_INCDIR=-I$withval
969 PYTHON_LIBS="-L$withval/config -lpython"
970 elif test -f $withval/include/Python.h; then
971 PYTHON_INCDIR=-I$withval/include
972 if test -d $withval/lib64/config; then
973 PYTHON_LIBS="-L$withval/lib64/config -lpython"
975 PYTHON_LIBS="-L$withval/lib/config -lpython"
977 elif test -f $withval/include/python/Python.h; then
978 PYTHON_INCDIR=-I$withval/include/python
979 if test -d $withval/lib64/python/config; then
980 PYTHON_LIBS="-L$withval/lib64/python/config -lpython"
982 PYTHON_LIBS="-L$withval/lib/python/config -lpython"
986 AC_MSG_ERROR(Invalid Python directory $withval - unable to find Python.h under $withval)
990 AC_DEFINE([HAVE_PYTHON], 1)
993 AC_MSG_NOTICE(checking for more Python libs)
994 saved_LIBS="$LIBS"; LIBS=
995 AC_SEARCH_LIBS(shm_open, [rt])
996 AC_CHECK_LIB(util, openpty)
997 PYTHON_LIBS="$PYTHON_LIBS $LIBS"
1006 AC_SUBST(PYTHON_LIBS)
1007 AC_SUBST(PYTHON_INCDIR)
1010 dnl Find where sockets are (especially for Solaris)
1011 dnl Do this before the TCP Wrappers test since tcp wrappers
1012 dnl uses the socket library and some linkers are stupid.
1014 AC_CHECK_FUNC(socket,
1015 AC_MSG_RESULT(using libc's socket),
1016 AC_CHECK_LIB(xnet,socket)
1017 AC_CHECK_LIB(socket,socket)
1018 AC_CHECK_LIB(inet,socket))
1020 dnl -----------------------------------------------------------
1021 dnl Check whether user wants TCP wrappers support (default off)
1022 dnl -----------------------------------------------------------
1025 AC_ARG_WITH(tcp-wrappers,
1026 AC_HELP_STRING([--with-tcp-wrappers@<:@=DIR@:>@], [enable tcpwrappers support]),
1028 if test "x$withval" != "xno" ; then
1030 LIBS="$saved_LIBS -lwrap"
1031 AC_SEARCH_LIBS(nanosleep, [rt])
1032 AC_MSG_CHECKING(for libwrap)
1035 #include <sys/types.h>
1037 int deny_severity = 0;
1038 int allow_severity = 0;
1039 struct request_info *req;
1044 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
1049 LIBS="$saved_LIBS -lwrap -lnsl"
1050 WRAPLIBS="$saved_LIBS -lwrap -lnsl"
1053 #include <sys/types.h>
1055 int deny_severity = 0;
1056 int allow_severity = 0;
1057 struct request_info *req;
1062 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
1067 AC_MSG_ERROR([*** libwrap missing])
1076 dnl -----------------------------------------------------------
1077 dnl Check whether OpenSSL is available
1078 dnl -----------------------------------------------------------
1079 AC_MSG_CHECKING([for OpenSSL])
1080 dnl The following uses quadrigraphs:
1083 AC_ARG_WITH(openssl,
1084 AC_HELP_STRING([--with-openssl@<:@=DIR@:>@], [Include OpenSSL support. DIR is the OpenSSL base]),
1086 with_openssl_directory=${withval}
1090 if test "x$with_openssl_directory" != "xno"; then
1091 OPENSSL_LIBS="-lssl -lcrypto"
1094 if test "x$with_openssl_directory" != "xyes" && test x"${with_openssl_directory}" != "x"; then
1096 # Make sure the $with_openssl_directory also makes sense
1098 if test -d "$with_openssl_directory/lib" -a -d "$with_openssl_directory/include"; then
1099 OPENSSL_LIBS="-L$with_openssl_directory/lib $OPENSSL_LIBS"
1100 OPENSSL_INC="-I$with_openssl_directory/include $OPENSSL_INC"
1104 saved_LIBS="${LIBS}"
1105 saved_CFLAGS="${CFLAGS}"
1106 LIBS="${saved_LIBS} ${OPENSSL_LIBS}"
1107 CFLAGS="${saved_CFLAGS} ${OPENSSL_INC}"
1111 #include <openssl/ssl.h>
1113 CRYPTO_set_id_callback(NULL);
1116 support_crypto="yes"
1125 #include <openssl/evp.h>
1129 ac_cv_openssl_sha2="yes"
1131 ac_cv_openssl_sha2="no"
1135 dnl Solaris disables greater than 128+ bit encryption in their OpenSSL
1136 dnl implementation, presumably for export reasons. If 192bit AES
1137 dnl is available, we assume that we're running with a 'non-export'
1138 dnl openssl library.
1141 #include <openssl/evp.h>
1145 ac_cv_openssl_export="no"
1147 ac_cv_openssl_export="yes"
1151 LIBS="${saved_LIBS}"
1152 CFLAGS="${saved_CFLAGS}"
1154 if test "$support_tls" = "yes"; then
1155 AC_DEFINE(HAVE_OPENSSL, 1, [Define if OpenSSL library is available])
1156 AC_DEFINE(HAVE_TLS, 1, [Define if TLS support should be enabled])
1157 AC_DEFINE(HAVE_CRYPTO, 1, [Define if encryption support should be enabled])
1160 if test "$ac_cv_openssl_sha2" = "yes"; then
1161 AC_DEFINE(HAVE_SHA2, 1, [Define if the SHA-2 family of digest algorithms is available])
1164 if test "$ac_cv_openssl_export" = "yes"; then
1165 AC_DEFINE(HAVE_OPENSSL_EXPORT_LIBRARY, 1, [Define if the OpenSSL library is export-contrained to 128bit ciphers])
1174 if test "$support_tls" = "no"; then
1178 if test "$support_crypto" = "no"; then
1183 AC_MSG_RESULT([$support_tls])
1184 AC_SUBST(OPENSSL_LIBS)
1185 AC_SUBST(OPENSSL_INC)
1187 dnl -----------------------------------------------------------
1188 dnl dlopen is needed for plugins
1189 dnl -----------------------------------------------------------
1190 AC_SEARCH_LIBS(dlopen, [dl])
1192 dnl ------------------------------------------
1193 dnl Where to place working dir
1194 dnl ------------------------------------------
1195 working_dir=`eval echo ${prefix}/var/bacula/working`
1196 AC_ARG_WITH(working-dir,
1197 AC_HELP_STRING([--with-working-dir=PATH], [specify path of Bacula working directory]),
1199 if test "x$withval" != "xno" ; then
1200 working_dir=$withval
1205 AC_SUBST(working_dir)
1207 dnl ------------------------------------------------------------------
1208 dnl If the user has not set archivedir, we set our default as /tmp
1209 dnl ------------------------------------------------------------------
1211 AC_ARG_WITH(archivedir,
1212 AC_HELP_STRING([--with-archivedir=PATH], [specify path of SD archive directory]),
1214 if test "x$withval" != "xno" ; then
1220 AC_SUBST(archivedir)
1222 dnl ------------------------------------------------------------------
1223 dnl Allow the user to specify the daemon resource name default hostname
1224 dnl ------------------------------------------------------------------
1226 AC_ARG_WITH(basename,
1227 AC_HELP_STRING([--with-basename=RESNAME], [specify base resource name for daemons]),
1229 if test "x$withval" != "xno" ; then
1237 dnl ------------------------------------------------------------------
1238 dnl Allow the user to override the hostname (default = machine hostname)
1239 dnl ------------------------------------------------------------------
1240 hostname=`uname -n | cut -d '.' -f 1`
1241 if test x${hostname} = x ; then
1242 hostname="localhost"
1244 AC_ARG_WITH(hostname,
1245 AC_HELP_STRING([--with-hostname=RESNAME], [specify host name for daemons]),
1247 if test "x$withval" != "xno" ; then
1256 dnl ------------------------------------------
1257 dnl Where to place scriptdir (script files)
1258 dnl ------------------------------------------
1259 scriptdir=`eval echo ${sysconfdir}`
1260 AC_ARG_WITH(scriptdir,
1261 AC_HELP_STRING([--with-scriptdir=PATH], [specify path of Bacula scripts directory]),
1263 if test "x$withval" != "xno" ; then
1272 dnl ------------------------------------------
1273 dnl Where to place bsrdir (bsr files)
1274 dnl ------------------------------------------
1277 AC_HELP_STRING([--with-bsrdir=PATH], [specify path of Bacula bsrs directory]),
1279 if test "x$withval" != "xno" ; then
1287 dnl ------------------------------------------
1288 dnl Where to place logdir (bsr files)
1289 dnl ------------------------------------------
1292 AC_HELP_STRING([--with-logdir=PATH], [specify path of Bacula logs directory]),
1294 if test "x$withval" != "xno" ; then
1303 # ------------------------------------------
1304 # Where to place plugindir (plugin files)
1305 # ------------------------------------------
1306 plugindir=`eval echo ${libdir}`
1307 AC_ARG_WITH(plugindir,
1308 AC_HELP_STRING([--with-plugindir=PATH], [specify path of Bacula plugins directory]),
1310 if test "x$withval" != "xno" ; then
1318 dnl ------------------------------------------
1319 dnl Where to send dump email
1320 dnl ------------------------------------------
1321 dump_email=root@localhost
1322 AC_ARG_WITH(dump-email,
1323 AC_HELP_STRING([--with-dump-email=EMAIL], [dump email address]),
1325 if test "x$withval" != "xno" ; then
1331 AC_SUBST(dump_email)
1333 dnl ------------------------------------------
1334 dnl Where to send job email
1335 dnl ------------------------------------------
1336 job_email=root@localhost
1337 AC_ARG_WITH(job-email,
1338 AC_HELP_STRING([--with-job-email=EMAIL], [job output email address]),
1340 if test "x$withval" != "xno" ; then
1348 dnl ------------------------------------------
1349 dnl Where to find smtp host
1350 dnl ------------------------------------------
1352 AC_ARG_WITH(smtp_host,
1353 AC_HELP_STRING([--with-smtp-host=HOST], [SMTP mail host address]),
1355 if test "x$withval" != "xno" ; then
1363 dnl ------------------------------------
1364 dnl Where to place pid files
1365 dnl ------------------------------------
1367 AC_ARG_WITH(pid-dir,
1368 AC_HELP_STRING([--with-pid-dir=PATH], [specify location of Bacula pid files]),
1370 if test "x$withval" != "xno" ; then
1376 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
1379 dnl ------------------------------------
1380 dnl Where to place subsys "lock file"
1381 dnl ------------------------------------
1382 subsysdir=/var/run/subsys
1383 if test -d /var/run/subsys; then
1384 subsysdir=/var/run/subsys
1385 elif test -d /var/lock/subsys; then
1386 subsysdir=/var/lock/subsys
1388 subsysdir=/var/run/subsys
1390 AC_ARG_WITH(subsys-dir,
1391 AC_HELP_STRING([--with-subsys-dir=PATH], [specify location of Bacula subsys file]),
1393 if test "x$withval" != "xno" ; then
1401 dnl ------------------------------------
1402 dnl Where to start assigning ports
1403 dnl ------------------------------------
1405 AC_ARG_WITH(baseport,
1406 AC_HELP_STRING([--with-baseport=PORT], [specify base port address for daemons]),
1408 if test "x$withval" != "xno" ; then
1415 dir_port=`expr $baseport`
1416 fd_port=`expr $baseport + 1`
1417 sd_port=`expr $fd_port + 1`
1423 dnl ------------------------------------------
1424 dnl Generate passwords
1425 dnl ------------------------------------------
1427 AC_ARG_WITH(dir-password,
1428 AC_HELP_STRING([--with-dir-password=PASSWORD], [specify Director's password]),
1430 if test "x$withval" != "xno" ; then
1431 dir_password=$withval
1436 if test "x$dir_password" = "x" ; then
1437 if test "x$OPENSSL" = "xnone" ; then
1438 key=`autoconf/randpass 33`
1440 key=`openssl rand -base64 33`
1446 AC_ARG_WITH(fd-password,
1447 AC_HELP_STRING([--with-fd-password=PASSWORD], [specify Client's password]),
1449 if test "x$withval" != "xno" ; then
1450 fd_password=$withval
1455 if test "x$fd_password" = "x" ; then
1456 if test "x$OPENSSL" = "xnone" ; then
1457 key=`autoconf/randpass 37`
1459 key=`openssl rand -base64 33`
1465 AC_ARG_WITH(sd-password,
1466 AC_HELP_STRING([--with-sd-password=PASSWORD], [specify Storage daemon's password]),
1468 if test "x$withval" != "xno" ; then
1469 sd_password=$withval
1474 if test "x$sd_password" = "x" ; then
1475 if test "x$OPENSSL" = "xnone" ; then
1476 key=`autoconf/randpass 41`
1478 key=`openssl rand -base64 33`
1484 AC_ARG_WITH(mon-dir-password,
1485 AC_HELP_STRING([--with-mon-dir-password=PASSWORD], [specify Director's password used by the monitor]),
1487 if test "x$withval" != "xno" ; then
1488 mon_dir_password=$withval
1493 if test "x$mon_dir_password" = "x" ; then
1494 if test "x$OPENSSL" = "xnone" ; then
1495 key=`autoconf/randpass 33`
1497 key=`openssl rand -base64 33`
1499 mon_dir_password=$key
1503 AC_ARG_WITH(mon-fd-password,
1504 AC_HELP_STRING([--with-mon-fd-password=PASSWORD], [specify Client's password used by the monitor]),
1506 if test "x$withval" != "xno" ; then
1507 mon_fd_password=$withval
1512 if test "x$mon_fd_password" = "x" ; then
1513 if test "x$OPENSSL" = "xnone" ; then
1514 key=`autoconf/randpass 37`
1516 key=`openssl rand -base64 33`
1518 mon_fd_password=$key
1522 AC_ARG_WITH(mon-sd-password,
1523 AC_HELP_STRING([--with-mon-sd-password=PASSWORD], [specify Storage daemon's password used by the monitor]),
1525 if test "x$withval" != "xno" ; then
1526 mon_sd_password=$withval
1531 if test "x$mon_sd_password" = "x" ; then
1532 if test "x$OPENSSL" = "xnone" ; then
1533 key=`autoconf/randpass 41`
1535 key=`openssl rand -base64 33`
1537 mon_sd_password=$key
1540 AC_SUBST(dir_password)
1541 AC_SUBST(fd_password)
1542 AC_SUBST(sd_password)
1543 AC_SUBST(mon_dir_password)
1544 AC_SUBST(mon_fd_password)
1545 AC_SUBST(mon_sd_password)
1548 dnl Pickup any database name
1551 AC_ARG_WITH(db_name,
1552 AC_HELP_STRING([--with-db-name=DBNAME], [specify database name @<:@default=bacula@:>@]),
1554 if test "x$withval" != "x" ; then
1562 AC_ARG_WITH(db_user,
1563 AC_HELP_STRING([--with-db-user=UNAME], [specify database user @<:@default=bacula@:>@]),
1565 if test "x$withval" != "x" ; then
1573 AC_ARG_WITH(db_password,
1574 AC_HELP_STRING([--with-db-password=PWD], [specify database password @<:@default=*none*@:>@]),
1576 if test "x$withval" != "x" ; then
1577 db_password=$withval
1581 AC_SUBST(db_password)
1584 dnl Pickup a database port
1587 AC_ARG_WITH(db_port,
1588 AC_HELP_STRING([--with-db-port=DBPORT], [specify a database port @<:@default=null@:>@]),
1590 if test "x$withval" != "x" ; then
1598 # Handle users and groups for each daemon
1601 AC_ARG_WITH(dir_user,
1602 AC_HELP_STRING([--with-dir-user=USER], [specify user for Director daemon]),
1604 if test "x$withval" != "x" ; then
1611 AC_ARG_WITH(dir_group,
1612 AC_HELP_STRING([--with-dir-group=GROUP], [specify group for Director daemon]),
1614 if test "x$withval" != "x" ; then
1621 AC_ARG_WITH(sd_user,
1622 AC_HELP_STRING([--with-sd-user=USER], [specify user for Storage daemon]),
1624 if test "x$withval" != "x" ; then
1631 AC_ARG_WITH(sd_group,
1632 AC_HELP_STRING([--with-sd-group=GROUP], [specify group for Storage daemon]),
1634 if test "x$withval" != "x" ; then
1641 AC_ARG_WITH(fd_user,
1642 AC_HELP_STRING([--with-fd-user=USER], [specify user for File daemon]),
1644 if test "x$withval" != "x" ; then
1651 AC_ARG_WITH(fd_group,
1652 AC_HELP_STRING([--with-fd-group=GROUP], [specify group for File daemon]),
1654 if test "x$withval" != "x" ; then
1668 dnl allow setting default executable permissions
1671 AC_ARG_WITH(sbin-perm,
1672 AC_HELP_STRING([--with-sbin-perm=MODE], [specify permissions for sbin binaries @<:@default=0754@:>@]),
1674 if test "x$withval" != "x" ; then
1682 dnl ------------------------------------------------
1683 dnl Bacula check for various SQL database engines
1684 dnl ------------------------------------------------
1686 BA_CHECK_POSTGRESQL_DB
1694 # BA_CHECK_SQLITE_DB
1703 dnl -------------------------------------------
1704 dnl enable batch attribute DB insert (default on)
1705 dnl -------------------------------------------
1706 support_batch_insert=no
1707 A=`test -f $SQL_LIB && nm $SQL_LIB | grep pthread_mutex_lock`
1709 if test $pkg = 0; then
1710 support_batch_insert=yes
1711 AC_ARG_ENABLE(batch-insert,
1712 AC_HELP_STRING([--enable-batch-insert], [enable the DB batch insert code @<:@default=no@:>@]),
1714 if test x$enableval = xno; then
1715 support_batch_insert=no
1717 support_batch_insert=yes
1723 dnl Check if postgresql can support batch mode
1724 if test x$DB_TYPE = xpostgresql; then
1725 AC_CHECK_LIB(pq, PQisthreadsafe, AC_DEFINE(HAVE_PQISTHREADSAFE, 1, [Set if have PQisthreadsafe]))
1726 AC_CHECK_LIB(pq, PQputCopyData, AC_DEFINE(HAVE_PQ_COPY, 1, [Set if have PQputCopyData]))
1727 if test "x$ac_cv_lib_pq_PQputCopyData" != "xyes"
1729 support_batch_insert=no
1733 if test x$DB_TYPE = xdbi; then
1737 dnl Check for batch insert
1738 if test $DB_PROG = postgresql; then
1739 AC_CHECK_LIB(pq, PQisthreadsafe, AC_DEFINE(HAVE_PQISTHREADSAFE))
1740 AC_CHECK_LIB(pq, PQputCopyData, AC_DEFINE(HAVE_PQ_COPY))
1741 test "x$ac_cv_lib_pq_PQputCopyData" != "xyes"
1745 if test $DB_PROG = mysql; then
1746 A=`test -f $SQL_LIB && nm $DB_PROG_LIB | grep pthread_mutex_lock`
1750 if test $DB_PROG = sqlite3; then
1751 A=`test -f $SQL_LIB && nm $DB_PROG_LIB | grep pthread_mutex_lock`
1755 if test $pkg = 0; then
1756 AC_ARG_ENABLE(batch-insert,
1757 AC_HELP_STRING([--enable-batch-insert], [enable the DB batch insert code @<:@default=no@:>@]),
1759 if test x$enableval = xno; then
1760 support_batch_insert=no
1762 support_batch_insert=yes
1768 dnl If dbi was not chosen, let the comment in file
1772 AC_SUBST(uncomment_dbi)
1774 if test $support_batch_insert = yes ; then
1775 AC_DEFINE(HAVE_BATCH_FILE_INSERT, 1, [Set if DB batch insert code enabled])
1778 AC_DEFINE(PROTOTYPES)
1780 dnl --------------------------------------------------------------------------
1781 dnl Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
1783 if test -z "$CFLAGS" -o "$CFLAGS" = "-g -O2"; then
1784 if test -z "$CCOPTS"; then
1785 CCOPTS='-g -O2 -Wall'
1793 dnl See if we can use 64 bit file addresses
1794 largefile_support="no"
1799 dnl --------------------------------------------------------------------------
1800 dnl CHECKING FOR HEADER FILES
1801 dnl --------------------------------------------------------------------------
1839 AC_STRUCT_ST_BLKSIZE
1843 dnl --------------------------------------------------------------------------
1844 dnl Check for utime.h structure
1845 dnl --------------------------------------------------------------------------
1846 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
1850 #include <sys/types.h>
1855 ba_cv_header_utime_h=yes
1857 ba_cv_header_utime_h=no
1862 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H, 1, [Set if utime.h exists])
1864 dnl --------------------------------------------------------------------------
1865 dnl Check for socklen_t
1866 dnl --------------------------------------------------------------------------
1867 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
1871 #include <sys/types.h>
1872 #include <sys/socket.h>
1876 ba_cv_header_socklen_t=yes
1878 ba_cv_header_socklen_t=no
1883 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T, 1, [Set if socklen_t exists])
1885 dnl --------------------------------------------------------------------------
1886 dnl Check for ioctl request type
1887 dnl --------------------------------------------------------------------------
1889 AC_CACHE_CHECK(for ioctl_req_t, ba_cv_header_ioctl_req_t,
1894 #include <sys/types.h>
1895 #include <sys/ioctl.h>
1897 int (*d_ioctl)(int fd, unsigned long int request, ...);
1900 ba_cv_header_ioctl_req_t=yes
1902 ba_cv_header_ioctl_req_t=no
1907 test $ba_cv_header_ioctl_req_t = yes && AC_DEFINE(HAVE_IOCTL_ULINT_REQUEST, 1, [Set if ioctl request is unsigned long int])
1909 dnl Note: it is more correct to use AC_LANG(C++) but some of the older
1910 dnl *BSD systems still use old style C prototypes, which are wrong with
1911 dnl compiled with a C++ compiler.
1914 dnl --------------------------------------------------------------------------
1915 dnl Check for typeof()
1916 dnl --------------------------------------------------------------------------
1918 AC_CACHE_CHECK(for typeof, ba_cv_have_typeof,
1922 main(){char *a = 0; a = (typeof a)a;}
1924 ba_cv_have_typeof=yes
1926 ba_cv_have_typeof=no
1928 ba_cv_have_typeof=no
1933 test $ba_cv_have_typeof = yes && AC_DEFINE([HAVE_TYPEOF], 1, [Defind to 1 if compiler has typeof])
1938 dnl --------------------------------------------------------------------------
1939 dnl CHECKING FOR FILESYSTEM TYPE
1940 dnl --------------------------------------------------------------------------
1941 AC_MSG_CHECKING(how to get filesystem type)
1943 # The order of these tests is important.
1946 #include <sys/statvfs.h>
1947 #include <sys/fstyp.h>
1949 AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4
1951 if test $fstype = no; then
1954 #include <sys/statfs.h>
1955 #include <sys/fstyp.h>
1957 AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3
1960 if test $fstype = no; then
1963 #include <sys/statfs.h>
1964 #include <sys/vmount.h>
1966 AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX
1969 if test $fstype = no; then
1974 AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD
1977 if test $fstype = no; then
1978 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
1980 if test $fstype = no; then
1983 #include <sys/mount.h>
1984 #include <sys/fs_types.h>
1986 AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix
1989 AC_MSG_RESULT($fstype)
1991 AC_CHECK_HEADER(sys/statvfs.h, [ AC_DEFINE(HAVE_SYS_STATVFS_H,1,[Defines if your system have the sys/statvfs.h header file])] , )
1993 dnl --------------------------------------------------------------------------
1994 dnl CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
1995 dnl --------------------------------------------------------------------------
2005 AC_CHECK_TYPE(ino_t, unsigned long)
2006 AC_CHECK_TYPE(dev_t, unsigned long)
2007 AC_CHECK_TYPE(daddr_t, long)
2008 AC_CHECK_TYPE(major_t, int)
2009 AC_CHECK_TYPE(minor_t, int)
2010 AC_CHECK_TYPE(ssize_t, int)
2016 AC_CHECK_SIZEOF(char, 1)
2017 AC_CHECK_SIZEOF(short int, 2)
2018 AC_CHECK_SIZEOF(int, 4)
2019 AC_CHECK_SIZEOF(long int, 4)
2020 AC_CHECK_SIZEOF(long long int, 8)
2021 AC_CHECK_SIZEOF(int *, 4)
2023 dnl Check for sys/types.h types
2024 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int,
2028 #include <sys/types.h>
2032 ac_cv_have_u_int="yes"
2034 ac_cv_have_u_int="no"
2039 if test "x$ac_cv_have_u_int" = "xyes" ; then
2040 AC_DEFINE(HAVE_U_INT)
2044 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t,
2048 #include <sys/types.h>
2052 ac_cv_have_intmax_t="yes"
2060 ac_cv_have_intmax_t="yes"
2062 ac_cv_have_intmax_t="no"
2069 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
2070 AC_DEFINE(HAVE_INTMAX_T)
2074 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t,
2078 #include <sys/types.h>
2080 u_intmax_t a; a = 1;
2082 ac_cv_have_u_intmax_t="yes"
2088 u_intmax_t a; a = 1;
2090 ac_cv_have_u_intmax_t="yes"
2092 ac_cv_have_u_intmax_t="no"
2099 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
2100 AC_DEFINE(HAVE_U_INTMAX_T)
2104 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t,
2108 #include <sys/types.h>
2110 int8_t a; int16_t b; int32_t c; a = b = c = 1;
2112 ac_cv_have_intxx_t="yes"
2114 ac_cv_have_intxx_t="no"
2119 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
2120 AC_DEFINE(HAVE_INTXX_T)
2124 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t,
2128 #include <sys/types.h>
2132 ac_cv_have_int64_t="yes"
2134 ac_cv_have_int64_t="no"
2139 if test "x$ac_cv_have_int64_t" = "xyes" ; then
2140 AC_DEFINE(HAVE_INT64_T)
2144 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t,
2148 #include <sys/types.h>
2150 u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;
2152 ac_cv_have_u_intxx_t="yes"
2154 ac_cv_have_u_intxx_t="no"
2159 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
2160 AC_DEFINE(HAVE_U_INTXX_T)
2164 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t,
2168 #include <sys/types.h>
2172 ac_cv_have_u_int64_t="yes"
2174 ac_cv_have_u_int64_t="no"
2179 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
2180 AC_DEFINE(HAVE_U_INT64_T)
2184 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
2185 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2187 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
2190 #include <sys/bitypes.h>
2192 int8_t a; int16_t b; int32_t c;
2193 u_int8_t e; u_int16_t f; u_int32_t g;
2194 a = b = c = e = f = g = 1;
2196 AC_DEFINE(HAVE_U_INTXX_T)
2197 AC_DEFINE(HAVE_INTXX_T)
2198 AC_DEFINE(HAVE_SYS_BITYPES_H)
2206 if test -z "$have_u_intxx_t" ; then
2207 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t,
2211 #include <sys/types.h>
2213 uint8_t a; uint16_t b;
2214 uint32_t c; a = b = c = 1;
2216 ac_cv_have_uintxx_t="yes"
2218 ac_cv_have_uintxx_t="no"
2223 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
2224 AC_DEFINE(HAVE_UINTXX_T)
2228 if (test -z "$have_u_int64_t" || test -z "$have_int64_t" && \
2229 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2231 AC_MSG_CHECKING([for int64_t and u_int64_t types in sys/bitypes.h])
2234 #include <sys/bitypes.h>
2236 int64_t a; u_int64_t b;
2239 AC_DEFINE(HAVE_U_INT64_T)
2240 AC_DEFINE(HAVE_INT64_T)
2248 if (test -z "$have_uintxx_t" && \
2249 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2251 AC_MSG_CHECKING([for uintXX_t types in sys/bitypes.h])
2254 #include <sys/bitypes.h>
2256 uint8_t a; uint16_t b;
2257 uint32_t c; a = b = c = 1;
2259 AC_DEFINE(HAVE_UINTXX_T)
2267 dnl --------------------------------------------------------------------------
2268 dnl CHECKING FOR REQUIRED LIBRARY FUNCTIONS
2269 dnl --------------------------------------------------------------------------
2285 [echo 'configure: cannot find needed function.'; exit 1]
2288 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
2289 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
2290 AC_CHECK_FUNCS(posix_fadvise)
2291 AC_CHECK_FUNCS(fdatasync)
2293 AC_CHECK_FUNCS(chflags)
2295 AC_CHECK_FUNCS(snprintf vsnprintf gethostid fseeko)
2297 AC_CACHE_CHECK(for va_copy, ba_cv_va_copy,
2302 void use_va_copy(va_list args){va_list args2; va_copy(args2,args); va_end(args2);}
2303 void call_use_va_copy(int junk,...){va_list args; va_start(args,junk); use_va_copy(args); va_end(args);}
2305 call_use_va_copy(1,2,3)
2314 test $ba_cv_va_copy = yes && AC_DEFINE(HAVE_VA_COPY, 1, [Set if va_copy exists])
2316 dnl --------------------------------------------------------------------------
2317 dnl CHECKING FOR THREAD SAFE FUNCTIONS
2318 dnl --------------------------------------------------------------------------
2319 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
2321 # If resolver functions are not in libc check for -lnsl or -lresolv.
2322 AC_CHECK_FUNC(gethostbyname_r,
2323 AC_MSG_RESULT(using libc's resolver),
2324 AC_CHECK_LIB(nsl,gethostbyname_r)
2325 AC_CHECK_LIB(resolv,gethostbyname_r))
2327 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
2328 AC_CHECK_FUNCS(inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)])
2329 AC_CHECK_FUNCS(gethostbyname2, [AC_DEFINE(HAVE_GETHOSTBYNAME2)])
2331 dnl ----------------------------
2332 dnl check sa_len of sockaddr
2333 dnl ----------------------------
2334 AC_CACHE_CHECK(for struct sockaddr has a sa_len field, ac_cv_struct_sockaddr_sa_len,
2338 #include <sys/socket.h>
2340 struct sockaddr s; s.sa_len;
2342 ac_cv_struct_sockaddr_sa_len=yes
2343 ], [ac_cv_struct_sockaddr_sa_len=no
2349 if test $ac_cv_struct_sockaddr_sa_len = yes; then
2350 AC_DEFINE(HAVE_SA_LEN, 1, [Define if sa_len field exists in struct sockaddr])
2357 AC_FUNC_CLOSEDIR_VOID
2358 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
2359 # AC_FUNC_FNMATCH dnl use local version
2361 AC_CHECK_LIB(intl, gettext, [LIBS="$LIBS -lintl"])
2363 AC_CHECK_LIB(sun, getpwnam)
2365 AC_CHECK_HEADERS(zlib.h)
2366 AC_CHECK_LIB(z, deflate, [FDLIBS="-lz"])
2368 if test x$FDLIBS = x-lz; then
2369 AC_DEFINE(HAVE_LIBZ)
2374 dnl Check for ACL support and libraries
2378 AC_HELP_STRING([--disable-acl], [disable acl support @<:@default=auto@:>@]),
2380 if test x$enableval = xyes; then
2382 elif test x$enableval = xno; then
2389 have_extended_acl=no
2390 if test x$support_acl = xyes -o x$support_acl = xauto; then
2391 AC_CHECK_HEADER(sys/acl.h, [ AC_DEFINE(HAVE_SYS_ACL_H,1,[Defines if your system have the sys/acl.h header file])] , )
2392 AC_CHECK_FUNC(acl_get_file,
2396 AC_CHECK_LIB(acl, acl_get_file,
2399 FDLIBS="-lacl $FDLIBS"
2401 AC_CHECK_LIB(pacl, acl_get_file,
2404 FDLIBS="-lpacl $FDLIBS"
2406 AC_CHECK_LIB(sec, acltotext,
2409 FDLIBS="-lsec $FDLIBS"
2411 AC_CHECK_LIB(sec, acl_totext,
2413 have_extended_acl=yes
2425 if test x$support_acl = xyes -a $have_acl != yes; then
2426 AC_MSG_ERROR([acl support explicitly enabled but no supported acl implementation found,
2427 please either load the acl libraries or rerun configure without --enable-acl])
2429 if test $have_acl = yes; then
2430 AC_DEFINE([HAVE_ACL],1,[Normal acl support])
2433 if test $have_extended_acl = yes; then
2434 AC_DEFINE([HAVE_EXTENDED_ACL],1,[Extended acl support])
2440 dnl Check for XATTR support
2443 AC_ARG_ENABLE(xattr,
2444 AC_HELP_STRING([--disable-xattr], [disable xattr support @<:@default=auto@:>@]),
2446 if test x$enableval = xyes; then
2448 elif test x$enableval = xno; then
2455 if test x$support_xattr = xyes -o x$support_xattr = xauto; then
2457 dnl First check for *BSD support
2459 AC_CHECK_HEADER(sys/extattr.h, [ AC_DEFINE(HAVE_SYS_EXTATTR_H,1,[Defines if your system have the sys/extattr.h header file])] , )
2460 AC_CHECK_HEADER(libutil.h, [ AC_DEFINE(HAVE_LIBUTIL_H,1,[Defines if your system have the libutil.h header file])] , )
2461 AC_CHECK_FUNCS(extattr_get_link extattr_set_link extattr_list_link,
2464 AC_DEFINE([HAVE_EXTATTR_GET_LINK],1,[Define to 1 if you have the 'extattr_get_link' function.])
2465 AC_DEFINE([HAVE_EXTATTR_SET_LINK],1,[Define to 1 if you have the 'extattr_set_link' function.])
2466 AC_DEFINE([HAVE_EXTATTR_LIST_LINK],1,[Define to 1 if you have the 'extattr_list_link' function.])
2470 if test $have_xattr = no; then
2471 AC_CHECK_FUNCS(extattr_get_file extattr_set_file extattr_list_file,
2474 AC_DEFINE([HAVE_EXTATTR_GET_FILE],1,[Define to 1 if you have the 'extattr_get_file' function.])
2475 AC_DEFINE([HAVE_EXTATTR_SET_FILE],1,[Define to 1 if you have the 'extattr_set_file' function.])
2476 AC_DEFINE([HAVE_EXTATTR_LIST_FILE],1,[Define to 1 if you have the 'extattr_list_file' function.])
2481 if test $have_xattr = yes; then
2482 have_extattr_string_in_libc=no
2483 AC_CHECK_FUNCS(extattr_namespace_to_string extattr_string_to_namespace,
2485 have_extattr_string_in_libc=yes
2486 AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2487 AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2492 dnl If extattr_namespace_to_string and extattr_string_to_namespace are not in libc see if they are in libutil
2494 if test $have_extattr_string_in_libc = no; then
2495 AC_CHECK_LIB(util, extattr_namespace_to_string extattr_string_to_namespace,
2497 AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2498 AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2499 FDLIBS="-lutil $FDLIBS"
2506 dnl If we failed to find *BSD support try the Linux or OSX implementation of xattr
2508 if test $have_xattr = no; then
2509 AC_CHECK_HEADER(sys/xattr.h, [ AC_DEFINE(HAVE_SYS_XATTR_H,1,[Defines if your system have the sys/xattr.h header file])] , )
2510 AC_CHECK_FUNCS(llistxattr lgetxattr lsetxattr,
2513 AC_DEFINE([HAVE_LLISTXATTR],1,[Define to 1 if you have the 'llistxattr' function.])
2514 AC_DEFINE([HAVE_LGETXATTR],1,[Define to 1 if you have the 'lgetxattr' function.])
2515 AC_DEFINE([HAVE_LSETXATTR],1,[Define to 1 if you have the 'lsetxattr' function.])
2519 if test $have_xattr = no; then
2520 AC_CHECK_FUNCS(listxattr getxattr setxattr,
2523 AC_DEFINE([HAVE_LISTXATTR],1,[Define to 1 if you have the 'listxattr' function.])
2524 AC_DEFINE([HAVE_GETXATTR],1,[Define to 1 if you have the 'getxattr' function.])
2525 AC_DEFINE([HAVE_SETXATTR],1,[Define to 1 if you have the 'setxattr' function.])
2532 dnl If we failed to find *BSD support and the Linux or OSX implementation of xattr try the Solaris xattr implementation
2534 if test $have_xattr = no; then
2535 AC_CHECK_HEADER(sys/attr.h, [ AC_DEFINE(HAVE_SYS_ATTR_H,1,[Defines if your system have the sys/attr.h header file])] , )
2536 AC_CHECK_HEADER(sys/nvpair.h, [ AC_DEFINE(HAVE_SYS_NVPAIR_H,1,[Defines if your system have the sys/nvpair.h header file])] , )
2537 AC_CHECK_HEADER(attr.h, [ AC_DEFINE(HAVE_ATTR_H,1,[Defines if your system have the attr.h header file])] , )
2539 AC_CHECK_FUNCS(openat fstatat unlinkat fchownat futimesat,
2542 AC_DEFINE([HAVE_OPENAT],1,[Define to 1 if you have the 'openat' function.])
2543 AC_DEFINE([HAVE_FSTATAT],1,[Define to 1 if you have the 'fstatat' function.])
2544 AC_DEFINE([HAVE_UNLINKAT],1,[Define to 1 if you have the 'unlinkat' function.])
2545 AC_DEFINE([HAVE_FCHOWNAT],1,[Define to 1 if you have the 'fchownat' function.])
2546 AC_DEFINE([HAVE_FUTIMESAT],1,[Define to 1 if you have the 'futimesat' function.])
2550 if test $have_xattr = yes; then
2551 AC_CHECK_LIB(nvpair, nvlist_next_nvpair,
2553 AC_DEFINE([HAVE_NVLIST_NEXT_NVPAIR],1,[Define to 1 if you have the 'nvlist_next_nvpair' function.])
2554 FDLIBS="-lnvpair $FDLIBS"
2560 if test x$support_xattr = xyes -a $have_xattr != yes; then
2561 AC_MSG_ERROR([xattr support explicitly enabled but no supported xattr implementation found,
2562 please either load the xattr libraries or rerun configure without --enable-xattr])
2564 if test $have_xattr = yes; then
2565 AC_DEFINE([HAVE_XATTR],1,[Extended Attributes support])
2571 dnl Check for pthread libraries
2574 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
2576 AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
2578 AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
2580 AC_CHECK_FUNC(pthread_create)
2589 dnl Check for headers, functions and libraries required to support
2590 dnl keeping readall capabilities
2592 AC_CHECK_HEADERS(sys/prctl.h sys/capability.h)
2593 AC_CHECK_FUNCS(prctl setreuid)
2594 AC_CHECK_LIB([cap], [cap_set_proc], [CAP_LIBS="-lcap"], [CAP_LIBS=])
2595 if test x$CAP_LIBS = x-lcap; then
2596 AC_DEFINE(HAVE_LIBCAP, 1, [Define if you have libcap])
2605 if test x$have_gcc = xyes ; then
2606 CPPFLAGS="$CPPFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
2607 CFLAGS="$CFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
2609 LDFLAGS=${LDFLAGS--O}
2610 DB_LIBS="${SQL_LFLAGS}"
2611 CPPFLAGS="$CPPFLAGS"
2624 AC_SUBST(X_EXTRA_LIBS)
2629 dnl extra configurable objects
2640 dnl Finally we set appropriate distribution specific
2641 dnl variables and defaults
2643 dnl PFILES are platform specific files
2644 PFILES="platforms/Makefile"
2649 hostname=`uname -n | cut -d '.' -f 1`
2650 if test x${hostname} = x ; then
2651 hostname="localhost"
2653 dnl Make sure hostname is resolved
2654 ping -c 1 $hostname 2>/dev/null 1>/dev/null
2655 if test ! $? = 0; then
2656 hostname="localhost"
2662 PSCMD="ps -e -o pid,comm"
2664 platforms/aix/Makefile"
2665 TAPEDRIVE="/dev/rmt0.1"
2669 PTHREAD_LIB="-lpthread -lexc"
2670 if test "${CC}" = "gcc" ; then
2677 TAPEDRIVE="/dev/nrmt0"
2680 DISTVER=`uname -a |awk '{print $3}'`
2681 TAPEDRIVE="/dev/nrmt0"
2682 PTHREAD_LIB="-pthread"
2683 CFLAGS="${CFLAGS} -pthread"
2684 PSCMD="ps -ax -o pid,command"
2688 platforms/bsdi/Makefile \
2689 platforms/bsdi/bacula-fd \
2690 platforms/bsdi/bacula-sd \
2691 platforms/bsdi/bacula-dir"
2692 largefile_support="yes"
2695 DISTVER=`uname -a |awk '{print $3}'`
2696 TAPEDRIVE="/dev/nrst0"
2699 WLDFLAGS="-mwindows"
2703 TAPEDRIVE="/dev/nst0"
2704 PSCMD="ps -e -o pid,command"
2707 platforms/darwin/Makefile"
2711 TAPEDRIVE="/dev/nst0"
2712 PSCMD="ps -e -o pid,command"
2715 platforms/osx/Makefile"
2718 if `test -f /etc/apt/sources.list && grep -q ubuntu /etc/apt/sources.list`; then
2721 DISTVER=`cat /etc/debian_version`
2722 if test -f /etc/lsb-release ; then
2724 if test "x$DISTRIB_ID" != "x" ; then
2725 DISTNAME=$DISTRIB_ID
2727 if test "x$DISTRIB_RELEASE" != "x" ; then
2728 DISTVER=$DISTRIB_RELEASE
2731 if test "$DISTNAME" = "Ubuntu" ; then
2734 TAPEDRIVE="/dev/nst0"
2735 PSCMD="ps -e -o pid,command"
2736 if test "$DISTNAME" = "ubuntu" ; then
2738 platforms/ubuntu/Makefile \
2739 platforms/ubuntu/bacula-fd \
2740 platforms/ubuntu/bacula-sd \
2741 platforms/ubuntu/bacula-dir"
2744 platforms/debian/Makefile \
2745 platforms/debian/bacula-fd \
2746 platforms/debian/bacula-sd \
2747 platforms/debian/bacula-dir"
2751 DISTVER=`uname -a |awk '{print $3}'`
2752 VER=`echo $DISTVER | cut -c 1`
2753 if test x$VER = x4 ; then
2754 PTHREAD_LIB="${PTHREAD_LIBS:--pthread}"
2755 CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS:--pthread}"
2759 TAPEDRIVE="/dev/nrsa0"
2760 PSCMD="ps -ax -o pid,command"
2762 platforms/freebsd/Makefile \
2763 platforms/freebsd/bacula-fd \
2764 platforms/freebsd/bacula-sd \
2765 platforms/freebsd/bacula-dir"
2766 largefile_support="yes"
2769 PSCMD="UNIX95=1; ps -e -o pid,comm"
2770 CFLAGS="${CFLAGS} -D_XOPEN_SOURCE_EXTENDED=1"
2772 TAPEDRIVE="/dev/rmt/0hnb"
2773 PTHREAD_LIB="-lpthread"
2774 AC_DEFINE([_INCLUDE_LONGLONG])
2778 TAPEDRIVE="/dev/rmt/0cbn"
2779 PSCMD="ps -e -o pid,comm"
2781 platforms/irix/Makefile \
2782 platforms/irix/bacula-fd \
2783 platforms/irix/bacula-sd \
2784 platforms/irix/bacula-dir"
2787 DISTVER=`uname -a |awk '{print $3}'`
2790 TAPEDRIVE="/dev/nrst0"
2791 PSCMD="ps -ax -o pid,command"
2792 PTHREAD_LIB="-pthread"
2793 CFLAGS="${CFLAGS} -pthread"
2796 DISTVER=`uname -a |awk '{print $3}'`
2799 TAPEDRIVE="/dev/nrst0"
2800 PSCMD="ps -ax -o pid,command"
2801 PTHREAD_LIB="-pthread"
2802 CFLAGS="${CFLAGS} -pthread"
2804 platforms/openbsd/Makefile \
2805 platforms/openbsd/bacula-fd \
2806 platforms/openbsd/bacula-sd \
2807 platforms/openbsd/bacula-dir"
2810 if test -f /etc/whitebox-release ; then
2811 f=/etc/whitebox-release
2813 f=/etc/redhat-release
2815 if test `cat $f | grep release |\
2816 cut -f 3 -d ' '`x = "Enterprise"x ; then
2817 DISTVER="Enterprise "`cat $f | grep release |\
2820 DISTVER=`cat /etc/redhat-release | grep release |\
2823 TAPEDRIVE="/dev/nst0"
2824 PSCMD="ps -e -o pid,command"
2826 platforms/redhat/Makefile \
2827 platforms/redhat/bacula-fd \
2828 platforms/redhat/bacula-sd \
2829 platforms/redhat/bacula-dir
2833 DISTVER=`cat /etc/mandrake-release | grep release |\
2835 TAPEDRIVE="/dev/nst0"
2836 PSCMD="ps -e -o pid,command"
2838 platforms/mandrake/Makefile \
2839 platforms/mandrake/bacula-fd \
2840 platforms/mandrake/bacula-sd \
2841 platforms/mandrake/bacula-dir \
2842 platforms/mandrake/bacula.spec \
2846 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
2847 TAPEDRIVE="/dev/nst0"
2848 PSCMD="ps -e -o pid,command"
2850 platforms/gentoo/Makefile \
2851 platforms/gentoo/bacula-init \
2852 platforms/gentoo/bacula-fd \
2853 platforms/gentoo/bacula-sd \
2854 platforms/gentoo/bacula-dir"
2857 DISTVER=`cat /etc/slackware-version`
2858 TAPEDRIVE="/dev/nst0"
2859 PSCMD="ps -e -o pid,command"
2861 platforms/slackware/Makefile \
2862 platforms/slackware/rc.bacula-fd \
2863 platforms/slackware/rc.bacula-sd \
2864 platforms/slackware/rc.bacula-dir\
2865 platforms/slackware/functions.bacula"
2869 TAPEDRIVE="/dev/rmt/0cbn"
2870 PSCMD="ps -e -o pid,comm"
2872 platforms/solaris/Makefile \
2873 platforms/solaris/bacula-fd \
2874 platforms/solaris/bacula-sd \
2875 platforms/solaris/bacula-dir"
2876 if test x$DISTVER = x5.6 ; then
2877 AC_DEFINE(HAVE_OLD_SOCKOPT)
2879 LIBS="$LIBS -lresolv"
2882 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
2884 TAPEDRIVE="/dev/nst0"
2885 PSCMD="ps -e -o pid,command"
2887 platforms/suse/Makefile \
2888 platforms/suse/bacula-fd \
2889 platforms/suse/bacula-sd \
2890 platforms/suse/bacula-dir \
2891 platforms/suse/bacula \
2892 platforms/suse/bacula.spec"
2897 TAPEDRIVE="/dev/nst0"
2898 PSCMD="ps -e -o pid,command"
2900 platforms/suse/Makefile \
2901 platforms/suse/bacula-fd \
2902 platforms/suse/bacula-sd \
2903 platforms/suse/bacula-dir"
2907 TAPEDRIVE="/dev/nst0"
2910 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
2916 LIBS="$PTHREAD_LIB $LIBS"
2918 AC_DEFINE_UNQUOTED(lld, "$lld")
2919 AC_DEFINE_UNQUOTED(llu, "$llu")
2927 dnl common parts of the Makefile
2928 MCOMMON=./autoconf/Make.common
2929 AC_SUBST_FILE(MCOMMON)
2932 if test "x${subsysdir}" = "x${sbindir}" ; then
2935 echo "You have set both --sbindir and --with-subsys-dir"
2936 echo " equal to: ${subsysdir} "
2937 echo "This is not permitted. Please reconfigure."
2939 echo "Aborting configuration ..."
2945 AC_OUTPUT([autoconf/Make.common \
2948 scripts/startmysql \
2950 scripts/btraceback \
2956 scripts/bacula-ctl-dir \
2957 scripts/bacula-ctl-fd \
2958 scripts/bacula-ctl-sd \
2959 scripts/devel_bacula \
2962 scripts/bacula.desktop.gnome1 \
2963 scripts/bacula.desktop.gnome2 \
2964 scripts/bacula.desktop.gnome1.consolehelper \
2965 scripts/bacula.desktop.gnome2.consolehelper \
2966 scripts/bacula.desktop.gnome1.xsu \
2967 scripts/bacula.desktop.gnome2.xsu \
2968 scripts/bgnome-console.console_apps \
2969 scripts/mtx-changer \
2970 scripts/disk-changer \
2971 scripts/dvd-handler \
2972 scripts/dvd-simulator \
2973 scripts/bacula-tray-monitor.desktop \
2974 scripts/logwatch/Makefile \
2975 scripts/logwatch/logfile.bacula.conf \
2976 scripts/wxconsole.console_apps \
2977 scripts/wxconsole.desktop.consolehelper \
2978 scripts/wxconsole.desktop.xsu \
2979 scripts/bat.desktop \
2980 scripts/bat.desktop.xsu \
2981 scripts/bat.desktop.consolehelper \
2982 scripts/bat.console_apps \
2985 src/console/Makefile \
2986 src/console/bconsole.conf \
2987 src/qt-console/bat.conf \
2988 src/qt-console/bat.pro \
2989 src/qt-console/bat.pro.mingw32 \
2990 src/qt-console/install_conf_file \
2991 src/wx-console/Makefile \
2992 src/wx-console/bwx-console.conf \
2993 src/tray-monitor/Makefile \
2994 src/tray-monitor/tray-monitor.conf \
2996 src/dird/bacula-dir.conf \
2998 src/stored/Makefile \
2999 src/stored/bacula-sd.conf \
3000 src/filed/Makefile \
3001 src/filed/bacula-fd.conf \
3003 src/cats/make_catalog_backup.pl \
3004 src/cats/make_catalog_backup \
3005 src/cats/delete_catalog_backup \
3006 src/cats/create_postgresql_database \
3007 src/cats/update_postgresql_tables \
3008 src/cats/make_postgresql_tables \
3009 src/cats/grant_postgresql_privileges \
3010 src/cats/drop_postgresql_tables \
3011 src/cats/drop_postgresql_database \
3012 src/cats/create_mysql_database \
3013 src/cats/update_mysql_tables \
3014 src/cats/make_mysql_tables \
3015 src/cats/grant_mysql_privileges \
3016 src/cats/drop_mysql_tables \
3017 src/cats/drop_mysql_database \
3018 src/cats/create_sqlite3_database \
3019 src/cats/update_sqlite3_tables \
3020 src/cats/make_sqlite3_tables \
3021 src/cats/grant_sqlite3_privileges \
3022 src/cats/drop_sqlite3_tables \
3023 src/cats/drop_sqlite3_database \
3024 src/cats/create_ingres_database \
3025 src/cats/update_ingres_tables \
3026 src/cats/make_ingres_tables \
3027 src/cats/grant_ingres_privileges \
3028 src/cats/drop_ingres_tables \
3029 src/cats/drop_ingres_database \
3032 src/cats/create_bdb_database \
3033 src/cats/update_bdb_tables \
3034 src/cats/make_bdb_tables \
3035 src/cats/grant_bdb_privileges \
3036 src/cats/drop_bdb_tables \
3037 src/cats/drop_bdb_database \
3038 src/cats/create_bacula_database \
3039 src/cats/update_bacula_tables \
3040 src/cats/grant_bacula_privileges \
3041 src/cats/make_bacula_tables \
3042 src/cats/drop_bacula_tables \
3043 src/cats/drop_bacula_database \
3044 src/findlib/Makefile \
3045 src/tools/Makefile \
3046 src/plugins/fd/Makefile \
3047 src/plugins/sd/Makefile \
3048 src/plugins/dir/Makefile \
3049 src/win32/Makefile.inc \
3051 updatedb/update_mysql_tables_9_to_10 \
3052 updatedb/update_sqlite3_tables_9_to_10 \
3053 updatedb/update_postgresql_tables_9_to_10 \
3054 updatedb/update_mysql_tables_10_to_11 \
3055 updatedb/update_sqlite3_tables_10_to_11 \
3056 updatedb/update_postgresql_tables_10_to_11 \
3057 examples/nagios/check_bacula/Makefile \
3062 if test "${support_bat}" = "yes" ; then
3063 if test "x$QMAKE" = "xnone"; then
3064 AC_MSG_ERROR([Could not find qmake $PATH. Check your Qt installation])
3069 echo "Creating bat Makefile"
3079 dnl if CC is gcc, we can rebuild the dependencies (since the depend rule
3080 dnl requires gcc). If it's not, don't rebuild dependencies
3082 if test X"$GCC" = "Xyes" ; then
3083 echo "Doing make of dependencies"
3084 ${MAKE:-make} depend
3088 chmod 755 install_conf_file build-depkgs-qt-console
3092 chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
3093 chmod 755 dvd-handler dvd-simulator
3094 chmod 755 bconsole gconsole mtx-changer devel_bacula logrotate
3098 chmod 755 $c/update_mysql_tables_10_to_11 $c/update_sqlite3_tables_10_to_11
3099 chmod 755 $c/update_postgresql_tables_10_to_11
3103 chmod 755 $c/create_bacula_database $c/update_bacula_tables $c/make_bacula_tables
3104 chmod 755 $c/grant_bacula_privileges $c/drop_bacula_tables $c/drop_bacula_database
3106 chmod 755 $c/create_bdb_database $c/update_bdb_tables $c/make_bdb_tables
3107 chmod 755 $c/grant_bdb_privileges $c/drop_bdb_tables $c/drop_bdb_database
3109 chmod 755 $c/create_mysql_database $c/update_mysql_tables $c/make_mysql_tables
3110 chmod 755 $c/grant_mysql_privileges $c/drop_mysql_tables $c/drop_mysql_database
3112 chmod 755 $c/create_sqlite3_database $c/update_sqlite3_tables $c/make_sqlite3_tables
3113 chmod 755 $c/grant_sqlite3_privileges $c/drop_sqlite3_tables $c/drop_sqlite3_database
3115 chmod 755 $c/create_postgresql_database $c/update_postgresql_tables $c/make_postgresql_tables
3116 chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables $c/drop_postgresql_database
3118 chmod 755 $c/create_ingres_database $c/update_ingres_tables $c/make_ingres_tables
3119 chmod 755 $c/grant_ingres_privileges $c/drop_ingres_tables $c/drop_ingres_database
3122 chmod 755 $c/make_catalog_backup $c/delete_catalog_backup $c/make_catalog_backup.pl
3126 chmod 755 src/win32/build-depkgs-mingw32
3128 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
3129 largefile_support="yes"
3132 dnl Only try to find out the version number of the compiler when we know its some kind of GCC compiler
3133 if test X"$GCC" = "Xyes" ; then
3135 dnl A whole lot of hand springs to get the compiler version.
3136 dnl This is because gcc changed the output in version 3.0
3138 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3139 if test "x${CCVERSION}" = "x" ; then
3140 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3142 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3143 if test x"${CXXVERSION}" = x ; then
3144 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3148 # clean up any old junk
3154 if test "x${db_type}" = "xInternal" ; then
3157 echo "You have not specified either --enable-client-only or one of the"
3158 echo " supported databases: MySQL, PostgreSQL, Ingres, SQLite3 or DBI."
3159 echo " This is not permitted. Please reconfigure."
3161 echo "Aborting the configuration ..."
3168 Configuration on `date`:
3170 Host: ${host}${post_host} -- ${DISTNAME} ${DISTVER}
3171 Bacula version: ${BACULA} ${VERSION} (${DATE})
3172 Source code location: ${srcdir}
3173 Install binaries: ${sbindir}
3174 Install libraries: ${libdir}
3175 Install config files: ${sysconfdir}
3176 Scripts directory: ${scriptdir}
3177 Archive directory: ${archivedir}
3178 Working directory: ${working_dir}
3179 PID directory: ${piddir}
3180 Subsys directory: ${subsysdir}
3181 Man directory: ${mandir}
3182 Data directory: ${datarootdir}
3183 Plugin directory: ${plugindir}
3184 C Compiler: ${CC} ${CCVERSION}
3185 C++ Compiler: ${CXX} ${CXXVERSION}
3186 Compiler flags: ${WCFLAGS} ${CFLAGS}
3187 Linker flags: ${WLDFLAGS} ${LDFLAGS}
3189 Statically Linked Tools: ${support_static_tools}
3190 Statically Linked FD: ${support_static_fd}
3191 Statically Linked SD: ${support_static_sd}
3192 Statically Linked DIR: ${support_static_dir}
3193 Statically Linked CONS: ${support_static_cons}
3194 Database type: ${db_type}
3195 Database port: ${db_port}
3196 Database lib: ${DB_LIBS}
3197 Database name: ${db_name}
3198 Database user: ${db_user}
3200 Job Output Email: ${job_email}
3201 Traceback Email: ${dump_email}
3202 SMTP Host Address: ${smtp_host}
3204 Director Port: ${dir_port}
3205 File daemon Port: ${fd_port}
3206 Storage daemon Port: ${sd_port}
3208 Director User: ${dir_user}
3209 Director Group: ${dir_group}
3210 Storage Daemon User: ${sd_user}
3211 Storage DaemonGroup: ${sd_group}
3212 File Daemon User: ${fd_user}
3213 File Daemon Group: ${fd_group}
3215 SQL binaries Directory ${SQL_BINDIR}
3217 Large file support: $largefile_support
3218 Bacula conio support: ${got_conio} ${CONS_LIBS}
3219 readline support: ${got_readline} ${PRTREADLINE_SRC}
3220 TCP Wrappers support: ${TCPW_MSG} ${WRAPLIBS}
3221 TLS support: ${support_tls}
3222 Encryption support: ${support_crypto}
3223 ZLIB support: ${have_zlib}
3224 enable-smartalloc: ${support_smartalloc}
3225 enable-lockmgr: ${support_lockmgr}
3226 bat support: ${support_bat}
3227 enable-gnome: ${support_gnome} ${gnome_version}
3228 enable-bwx-console: ${support_wx_console} ${wx_version}
3229 enable-tray-monitor: ${support_tray_monitor}
3230 client-only: ${build_client_only}
3231 build-dird: ${build_dird}
3232 build-stored: ${build_stored}
3233 Plugin support: ${have_plugins}
3234 ACL support: ${have_acl}
3235 XATTR support: ${have_xattr}
3236 Python support: ${support_python} ${PYTHON_LIBS}
3237 Batch insert enabled: ${support_batch_insert}
3241 # create a small shell script useful for support with
3242 # configure options and config.out info
3243 cat > scripts/bacula_config << EOF
3246 $ $0 $ac_configure_args
3248 cat config.out >> scripts/bacula_config
3249 echo __EOC__ >> scripts/bacula_config
3250 chmod 755 scripts/bacula_config
3254 # Display a warning message if postgresql client lib is <= 8.1
3255 if test x$DB_TYPE = xpostgresql -a x$ac_cv_lib_pq_PQisthreadsafe != xyes \
3256 -a x$support_batch_insert = xyes
3258 echo "WARNING: Your PostgreSQL client library is too old to detect "
3259 echo " if it was compiled with --enable-thread-safety, consider to"
3260 echo " upgrade it in order to avoid problems with Batch insert mode"