3 dnl Process this file with autoconf to produce a configure script.
12 AC_CONFIG_AUX_DIR(${BUILD_DIR}/autoconf)
13 AC_CONFIG_HEADER(src/config.h:autoconf/config.h.in)
15 dnl minimal Win32 stuff for "make clean"
16 WIN32BUILDDIR=${BUILD_DIR}/src/win32
17 WIN32MAINDIR=${BUILD_DIR}
18 WIN32TOPDIR=${TOP_DIR}
19 AC_SUBST(WIN32BUILDDIR)
20 AC_SUBST(WIN32MAINDIR)
23 dnl require a recent autoconf
27 dnl search for true and false programs.
28 AC_PATH_PROGS(TRUEPRG, true, :)
29 AC_PATH_PROGS(FALSEPRG, false, :)
34 if test "x$BACULA" != x; then
35 post_host=`echo -${BACULA} | tr 'A-Z ' 'a-z-'`
37 BACULA=${BACULA:-Bacula}
38 VERSION=`sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
39 DATE=`sed -n -e 's/^.*[ \t]*BDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
40 LSMDATE=`sed -n -e 's/^.*LSMDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
45 AC_SUBST(post_host)dnl
46 echo "configuring for ${BACULA} $VERSION ($DATE)"
48 dnl -------------------------------------------------------
49 dnl Check for compiler.
50 dnl ------------------------------------------------------
54 AC_PROG_CC_C_O dnl Determine if C compiler support -c -o.
55 AC_PROG_GCC_TRADITIONAL dnl Determine if ioctl() need -traditional.
59 if test "x$BASECC" = xgcc; then
63 AC_PATH_PROG(CXX, $CXX, $CXX)
64 if test ! -e $CXX; then
65 AC_MSG_ERROR(Unable to find C++ compiler)
68 dnl -------------------------------------------------------
69 dnl Check for programs.
70 dnl ------------------------------------------------------
72 AC_PATH_PROG(MV, mv, mv)
74 dnl If we name the variable RM it will shadow the RM variable in the configure script and we overwrite the
75 dnl value with the name of the rm command and not rm -f which is its normal content. This gives all kind
76 dnl of strange output of the configure script (like things don't exist etc.).
77 dnl So we name it REMOVE (more software has run into this problem)
78 AC_PATH_PROG(REMOVE, rm, rm)
79 AC_PATH_PROG(CP, cp, cp)
80 AC_PATH_PROG(SED, sed, sed)
81 AC_PATH_PROG(ECHO, echo, echo)
82 AC_PATH_PROG(CMP, cmp, cmp)
83 AC_PATH_PROG(TBL, tbl, tbl)
84 AC_PATH_PROG(AR, ar, ar)
85 AC_PATH_PROG(OPENSSL, openssl, none)
86 AC_PATH_PROG(MTX, mtx, mtx)
87 AC_PATH_PROG(DD, dd, dd)
88 AC_PATH_PROG(MKISOFS, mkisofs, mkisofs)
89 AC_PATH_PROG(PYTHON, python, python)
90 AC_PATH_PROG(GROWISOFS, growisofs, growisofs)
91 AC_PATH_PROG(DVDRWMEDIAINFO, dvd+rw-mediainfo, dvd+rw-mediainfo)
92 AC_PATH_PROG(DVDRWFORMAT, dvd+rw-format, dvd+rw-format)
93 AC_PATH_PROG(PKGCONFIG, pkg-config, pkg-config)
94 AC_PATH_PROG(QMAKE, qmake, none)
95 AC_PATH_PROG(QMAKEQT4, qmake-qt4, none)
96 AC_PATH_PROG(GMAKE, gmake, none)
97 AC_ARG_VAR(WXCONFIG, [wx-config command. On some systems, you must set it to wx-config-2.6 to use wxWidgets 2.6.])
98 if test "x$WXCONFIG" = x; then
101 AC_PATH_PROG(WXCONFIG, ${WXCONFIG}, ${WXCONFIG})
102 AC_ARG_VAR(WXFLAGS, [Parameters to pass to wx-config (e.g. --unicode=no).])
103 AC_PATH_PROG(CDRECORD, cdrecord, cdrecord)
104 AC_PATH_PROG(PIDOF, pidof, pidof)
106 # Some AWK programs fail, so test it and warn the user
107 if echo xfoo | $AWK 'BEGIN { prog=ARGV[1]; ARGC=1 }
108 { if ((prog == $2) || (("(" prog ")") == $2) ||
109 (("[" prog "]") == $2) ||
110 ((prog ":") == $2)) { print $1 ; exit 0 } }' xfoo>/dev/null; then :;
112 AC_MSG_ERROR([!!!!!!!!! WARNING !!!!!!!!!!!!!!
113 The regex engine of $AWK is too broken to be used you
114 might want to install GNU AWK.
115 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!])
118 AC_PATH_PROG(AWK, $THE_AWK, $THE_AWK)
121 test -n "$ARFLAG" || ARFLAGS="cr"
128 AC_SUBST(LOCAL_CFLAGS)
129 AC_SUBST(LOCAL_LDFLAGS)
132 dnl --------------------------------------------------
134 dnl --------------------------------------------------
136 AC_ARG_ENABLE(libtool,
137 AC_HELP_STRING([--enable-libtool], [enable building using GNU libtool @<:@default=yes@:>@]),
139 if test x$enableval = xno; then
144 LT_INIT([shared disable-static])
147 if test x$use_libtool != xno; then
148 DEFAULT_OBJECT_TYPE=".lo"
149 DEFAULT_ARCHIVE_TYPE=".la"
150 DEFAULT_SHARED_OBJECT_TYPE=".la"
151 LIBTOOL="\$(LIBTOOL)"
152 LIBTOOL_INSTALL_TARGET="libtool-install"
153 LIBTOOL_UNINSTALL_TARGET="libtool-uninstall"
154 LIBTOOL_CLEAN_TARGET="libtool-clean"
155 QMAKE_LIBTOOL="${BUILD_DIR}/libtool"
156 FD_PLUGIN_DIR="src/plugins/fd"
159 DEFAULT_OBJECT_TYPE=".o"
160 DEFAULT_ARCHIVE_TYPE=".a"
161 DEFAULT_SHARED_OBJECT_TYPE=".so"
162 LIBTOOL="# \$(LIBTOOL)"
163 LIBTOOL_INSTALL_TARGET=""
164 LIBTOOL_UNINSTALL_TARGET=""
165 LIBTOOL_CLEAN_TARGET=""
166 QMAKE_LIBTOOL="# ${BUILD_DIR}/libtool"
171 AC_SUBST(DEFAULT_OBJECT_TYPE)
172 AC_SUBST(DEFAULT_ARCHIVE_TYPE)
173 AC_SUBST(DEFAULT_SHARED_OBJECT_TYPE)
175 AC_SUBST(LIBTOOL_INSTALL_TARGET)
176 AC_SUBST(LIBTOOL_UNINSTALL_TARGET)
177 AC_SUBST(LIBTOOL_CLEAN_TARGET)
178 AC_SUBST(QMAKE_LIBTOOL)
179 AC_SUBST(FD_PLUGIN_DIR)
181 dnl --------------------------------------------------
182 dnl Include file handling
183 dnl --------------------------------------------------
184 AC_ARG_ENABLE(includes,
185 AC_HELP_STRING([--enable-includes], [enable installing of include files @<:@default=no@:>@]),
187 if test x$enableval = xyes; then
193 dnl It only makes sense to install include files when you install libraries which only happens when
194 dnl libtool is enabled
196 if test x$use_libtool != xno -a x$install_includes = xyes; then
197 INCLUDE_INSTALL_TARGET="install-includes"
198 INCLUDE_UNINSTALL_TARGET="uninstall-includes"
200 INCLUDE_INSTALL_TARGET=""
201 INCLUDE_UNINSTALL_TARGET=""
203 AC_SUBST(INCLUDE_INSTALL_TARGET)
204 AC_SUBST(INCLUDE_UNINSTALL_TARGET)
206 dnl --------------------------------------------------
207 dnl Bacula OP Sys determination (see aclocal.m4)
208 dnl --------------------------------------------------
211 dnl -----------------------------------------------------------
212 dnl Bacula OPSys Distribution determination (see aclocal.m4)
213 dnl ----------------------------------------------------------
214 BA_CHECK_OPSYS_DISTNAME
216 dnl --------------------------------------------------
217 dnl Suppport for gettext (translations)
218 dnl By default, $datarootdir is ${prefix}/share
219 dnl --------------------------------------------------
220 AM_GNU_GETTEXT([external])
222 dnl ------------------------------------------------------------------
223 dnl If the user has not set --prefix, we set our default to nothing.
224 dnl In this case, if the user has not set --sysconfdir, we set it
225 dnl to the package default of /etc/bacula. If either --prefix or
226 dnl --sysconfdir is set, we leave sysconfdir alone except to eval it.
227 dnl If the user has not set --libdir, we set it to the package
228 dnl default of /usr/lib. If either --prefix or --libdir is set,
229 dnl we leave libdir alone except to eval it. If the user has not set
230 dnl --includedir, we set it to the package default of /usr/include.
231 dnl If either --prefix or --includedir is set, we leave includedir
232 dnl alone except to eval it
233 dnl ------------------------------------------------------------------
234 os_name=`uname -s 2>/dev/null`
235 if test x${prefix} = xNONE ; then
236 if test `eval echo ${sysconfdir}` = NONE/etc ; then
237 sysconfdir=/etc/bacula
240 if test `eval echo ${libdir}` = NONE/lib ; then
243 os_processor=`uname -p 2>/dev/null`
244 case ${os_processor} in
259 if test `eval echo ${includedir}` = NONE/include ; then
260 includedir=/usr/include
263 if test `eval echo ${datarootdir}` = NONE/share ; then
264 datarootdir=/usr/share
269 dnl -------------------------------------------------------------------------
270 dnl If the user has not set --exec-prefix, we default to ${prefix}
271 dnl -------------------------------------------------------------------------
272 if test x${exec_prefix} = xNONE ; then
273 exec_prefix=${prefix}
276 sysconfdir=`eval echo ${sysconfdir}`
277 datarootdir=`eval echo ${datarootdir}`
278 docdir=`eval echo ${docdir}`
279 htmldir=`eval echo ${htmldir}`
280 libdir=`eval echo ${libdir}`
281 includedir=`eval echo ${includedir}`
282 localedir=`eval echo ${datarootdir}/locale`
283 AC_DEFINE_UNQUOTED(SYSCONFDIR, "$sysconfdir")
284 AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir")
286 dnl ------------------------------------------------------------------
287 dnl If the user has not set --sbindir, we set our default as /sbin
288 dnl ------------------------------------------------------------------
289 if test x$sbindir = x'${exec_prefix}/sbin' ; then
290 sbindir=${exec_prefix}/sbin
292 sbindir=`eval echo ${sbindir}`
294 dnl -------------------------------------------------------------------------
295 dnl If the user has not set --mandir, we default to /usr/share/man
296 dnl -------------------------------------------------------------------------
297 if test x$mandir = x'${prefix}/man' ; then
298 mandir=/usr/share/man
301 dnl -------------------------------------------------------------------------
302 dnl If the user has not set --htmldir, we default to /usr/share/doc/bacula/html
303 dnl -------------------------------------------------------------------------
304 if test x$htmldir = x${docdir} ; then
305 htmldir=`eval echo ${docdir}bacula/html`
308 dnl -------------------------------------------------------------------------
309 dnl If the user has not set --docdir, we default to /usr/share/doc/
310 dnl -------------------------------------------------------------------------
311 if test x$docdir = x'/usr/share/doc/' ; then
312 docdir=`eval echo ${docdir}bacula`
316 AC_PATH_PROGS(MSGFMT, msgfmt, no)
317 if test "$MSGFMT" = "no"
319 echo 'msgfmt program not found, disabling NLS !'
321 USE_INCLUDED_LIBINTL=no
329 support_postgresql=no
332 support_smartalloc=yes
337 support_wx_console=no
338 support_tray_monitor=no
343 support_static_tools=no
346 support_static_dir=no
347 support_static_cons=no
357 dnl --------------------------------------------------------------------------
358 dnl CHECKING COMMAND LINE OPTIONS
359 dnl --------------------------------------------------------------------------
361 dnl -------------------------------------------
362 dnl gnome (default off)
363 dnl -------------------------------------------
365 AC_HELP_STRING([--enable-gnome], [enable build of bgnome-console GUI @<:@default=no@:>@]),
367 if test x$enableval = xyes; then
374 if test x$support_gnome = xyes; then
375 AC_MSG_ERROR(bgnome-console no longer supported)
376 AC_MSG_ERROR(--enable-gnome option no longer supported)
378 # AC_SUBST(GNOME_DIR)
380 dnl -------------------------------------------
381 dnl bat (default off)
382 dnl -------------------------------------------
384 AC_HELP_STRING([--enable-bat], [enable build of bat Qt4 GUI @<:@default=no@:>@]),
386 if test x$enableval = xyes; then
387 AC_DEFINE(HAVE_BAT, 1, [Set if Bacula bat Qt4 GUI support enabled])
394 if test x$support_bat = xyes; then
395 abc=`$PKGCONFIG --atleast-version=4.2 QtGui`
397 if test $pkg = 0; then
398 BAT_DIR=src/qt-console
400 AC_MSG_ERROR(Unable to find Qt4 installation needed by bat)
405 dnl The qwt library was used with bat, but that is no longer the case
413 dnl if test x$support_bat = xyes; then
414 dnl AC_MSG_CHECKING(for qwt support)
416 dnl AC_HELP_STRING([--with-qwt@<:@=DIR@:>@], [specify qwt library directory]),
418 dnl case "$with_qwt" in
423 dnl if test -f ${with_qwt}/include/qwt.h; then
424 dnl QWT_INC="${with_qwt}/include"
425 dnl QWT_LDFLAGS="-L${with_qwt}/lib"
435 dnl dnl Search in standard places, or --with-qwt not specified
437 dnl if test $no_qwt = no; then
438 dnl if test x$QWT_INC = x; then
439 dnl for root in /usr /usr/local; do
440 dnl for ver in qwt qwt5 qwt-qt4; do
441 dnl if test -f ${root}/include/${ver}/qwt.h; then
442 dnl QWT_INC="${root}/include/${ver}"
443 dnl if test -d ${root}/lib64/; then
444 dnl QWT_LDFLAGS="-L${root}/lib64"
445 dnl elif test -d ${root}/lib/64/; then
446 dnl QWT_LDFLAGS="-L${root}/64"
448 dnl QWT_LDFLAGS="-L${root}/lib"
459 dnl if test x$QWT_INC = x; then
460 dnl AC_MSG_RESULT(no)
462 dnl AC_DEFINE(HAVE_QWT, 1, [Set if bat QWT library found])
463 dnl AC_MSG_RESULT(yes)
469 AC_SUBST(QWT_LDFLAGS)
473 dnl -------------------------------------------
474 dnl bwx-console (default off)
475 dnl -------------------------------------------
476 AC_ARG_ENABLE(bwx-console,
477 AC_HELP_STRING([--enable-bwx-console], [enable build of wxWidgets console @<:@default=no@:>@]),
479 if test x$enableval = xyes; then
480 support_wx_console=yes
486 if test x$support_wx_console = xyes; then
487 abc=`$WXCONFIG $WXFLAGS --cppflags`
489 if test $pkg = 0; then
490 wx_version="wxWidgets `$WXCONFIG $WXFLAGS --release`"
491 WXCONS_CPPFLAGS=`$WXCONFIG $WXFLAGS --cppflags`
492 WXCONS_LDFLAGS=`$WXCONFIG $WXFLAGS --libs`
494 AC_SUBST(WXCONS_CPPFLAGS)
495 AC_SUBST(WXCONS_LDFLAGS)
496 WX_DIR="src/wx-console"
499 echo "wx-config program not found. bwx-console disabled."
501 support_wx_console=no
506 dnl -------------------------------------------
507 dnl tray-monitor (default off)
508 dnl -------------------------------------------
509 AC_ARG_ENABLE(tray-monitor,
510 AC_HELP_STRING([--enable-tray-monitor], [enable build of Gnome tray monitor (compatible with KDE @<:@default=no@:>@]),
512 if test x$enableval = xyes; then
513 support_tray_monitor=yes
519 if test x$support_tray_monitor = xyes; then
520 abc=`$PKGCONFIG --exists gtk+-2.0`
522 if test $pkg = 0; then
523 TRAY_MONITOR_CPPFLAGS=`$PKGCONFIG --cflags gtk+-2.0`
524 TRAY_MONITOR_LDFLAGS=`$PKGCONFIG --libs gtk+-2.0`
525 AC_SUBST(TRAY_MONITOR_CPPFLAGS)
526 AC_SUBST(TRAY_MONITOR_LDFLAGS)
527 TRAY_MONITOR_DIR=src/tray-monitor
528 abc=`$PKGCONFIG --atleast-version=2.4 gtk+-2.0`
530 if test $pkg = 0; then
531 AC_DEFINE(HAVE_GTK_2_4, 1, [Set if you have GTK 4.2 or greater loaded])
535 AC_SUBST(TRAY_MONITOR_DIR)
537 dnl -------------------------------------------
538 dnl smartalloc (default off)
539 dnl -------------------------------------------
540 AC_ARG_ENABLE(smartalloc,
541 AC_HELP_STRING([--enable-smartalloc], [enable smartalloc debugging support @<:@default=no@:>@]),
543 if test x$enableval = xno; then
544 support_smartalloc=no
549 if test x$support_smartalloc = xyes; then
550 AC_DEFINE(SMARTALLOC, 1, [Set if you want Smartalloc enabled])
553 dnl -------------------------------------------
554 dnl Lock Manager (default off)
555 dnl -------------------------------------------
556 AC_ARG_ENABLE(lockmgr,
557 AC_HELP_STRING([--enable-lockmgr], [enable lock manager support @<:@default=no@:>@]),
559 if test x$enableval = xyes; then
565 if test x$support_lockmgr = xyes; then
566 AC_DEFINE(_USE_LOCKMGR, 1, [Set if you want Lock Manager enabled])
570 dnl -------------------------------------------
571 dnl static-tools (default off)
572 dnl -------------------------------------------
573 AC_ARG_ENABLE(static-tools,
574 AC_HELP_STRING([--enable-static-tools], [enable static tape tools @<:@default=no@:>@]),
576 if test x$enableval = xyes; then
577 if test x$use_libtool = xyes; then
578 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
579 please rerun configure with --disable-libtool])
581 support_static_tools=yes
587 if test x$support_static_tools = xyes; then
588 TTOOL_LDFLAGS="-static"
590 AC_SUBST(TTOOL_LDFLAGS)
592 dnl -------------------------------------------
593 dnl static-fd (default off)
594 dnl -------------------------------------------
595 AC_ARG_ENABLE(static-fd,
596 AC_HELP_STRING([--enable-static-fd], [enable static File daemon @<:@default=no@:>@]),
598 if test x$enableval = xyes; then
599 if test x$use_libtool = xyes; then
600 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
601 please rerun configure with --disable-libtool])
603 support_static_fd=yes
609 if test x$support_static_fd = xyes; then
610 STATIC_FD="static-bacula-fd"
614 dnl -------------------------------------------
615 dnl static-sd (default off)
616 dnl -------------------------------------------
617 AC_ARG_ENABLE(static-sd,
618 AC_HELP_STRING([--enable-static-sd], [enable static Storage daemon @<:@default=no@:>@]),
620 if test x$enableval = xyes; then
621 if test x$use_libtool = xyes; then
622 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
623 please rerun configure with --disable-libtool])
625 support_static_sd=yes
631 if test x$support_static_sd = xyes; then
632 STATIC_SD="static-bacula-sd"
636 dnl -------------------------------------------
637 dnl static-dir (default off)
638 dnl -------------------------------------------
639 AC_ARG_ENABLE(static-dir,
640 AC_HELP_STRING([--enable-static-dir], [enable static Director @<:@default=no@:>@]),
642 if test x$enableval = xyes; then
643 if test x$use_libtool = xyes; then
644 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
645 please rerun configure with --disable-libtool])
647 support_static_dir=yes
653 if test x$support_static_dir = xyes; then
654 STATIC_DIR="static-bacula-dir"
658 dnl -------------------------------------------
659 dnl static-cons (default off)
660 dnl -------------------------------------------
661 AC_ARG_ENABLE(static-cons,
662 AC_HELP_STRING([--enable-static-cons], [enable static Console @<:@default=no@:>@]),
664 if test x$enableval = xyes; then
665 if test x$use_libtool = xyes; then
666 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
667 please rerun configure with --disable-libtool])
669 support_static_cons=yes
677 if test x$support_static_cons = xyes; then
678 STATIC_CONS="static-bconsole"
679 STATIC_GNOME_CONS="static-bgnome-console"
680 STATIC_WX_CONS="static-bwx-console"
682 AC_SUBST(STATIC_CONS)
683 AC_SUBST(STATIC_GNOME_CONS)
684 AC_SUBST(STATIC_WX_CONS)
686 dnl -------------------------------------------
687 dnl client_only (default off)
688 dnl -------------------------------------------
689 AC_ARG_ENABLE(client-only,
690 AC_HELP_STRING([--enable-client-only], [build client (File daemon) only @<:@default=no@:>@]),
692 if test x$enableval = xyes; then
693 build_client_only=yes
699 if test x$build_client_only = xno; then
706 dnl -------------------------------------------
707 dnl director (default on)
708 dnl -------------------------------------------
709 AC_ARG_ENABLE(build-dird,
710 AC_HELP_STRING([--enable-build-dird], [enable building of dird (Director) @<:@default=yes@:>@]),
712 if test x$enableval = xno; then
717 if test x$build_dird = xyes; then
722 DIR_TOOLS="NODIRTOOLS"
727 dnl -------------------------------------------
728 dnl stored (default on)
729 dnl -------------------------------------------
730 AC_ARG_ENABLE(build-stored,
731 AC_HELP_STRING([--enable-build-stored], [enable building of stored (Storage daemon) @<:@default=yes@:>@]),
733 if test x$enableval = xno; then
738 if test x$build_stored = xyes; then
739 STORED_DIR="src/stored"
745 dnl ---------------------------------------------------
746 dnl Check for conio (Bacula readline substitute)(
747 dnl ---------------------------------------------------
748 dnl this allows you to turn it completely off
750 AC_HELP_STRING([--disable-conio], [disable conio support @<:@default=no@:>@]),
752 if test x$enableval = xno; then
759 dnl ---------------------------------------------------
760 dnl Check for IPv6 support
761 dnl ---------------------------------------------------
762 dnl this allows you to turn it completely off
765 AC_HELP_STRING([--enable-ipv6], [enable ipv6 support @<:@default=yes@:>@]),
767 if test x$enableval = xno; then
773 if test x$support_ipv6 = xyes; then
774 AC_TRY_LINK([ #include <sys/types.h>
775 #include <sys/socket.h>
776 #include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;],
777 [support_ipv6=yes], [support_ipv6=no])
780 if test x$support_ipv6 = xyes; then
781 AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
785 if test x$support_conio = xyes; then
786 AC_CHECK_HEADER(termcap.h,
787 [ AC_CHECK_LIB(termcap, tgetent,
788 [ CONS_LIBS="-ltermcap"
793 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
795 [ AC_CHECK_LIB(ncurses, tgetent,
796 [ CONS_LIBS="-lncurses"
801 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
806 AC_CHECK_HEADERS(curses.h)
807 AC_CHECK_HEADER(term.h,
808 [ AC_CHECK_LIB(curses, tgetent,
809 [ CONS_LIBS="-lcurses"
814 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
817 [ echo " "; echo "Required libraries not found. CONIO turned off ..."; echo " "],
826 dnl ---------------------------------------------------
827 dnl Check for readline support/directory (default off)
828 dnl ---------------------------------------------------
829 dnl this allows you to turn it completely off
830 AC_ARG_ENABLE(readline,
831 AC_HELP_STRING([--disable-readline], [disable readline support @<:@default=yes@:>@]),
833 if test x$enableval = xno; then
841 if test x$support_readline = xyes; then
842 AC_ARG_WITH(readline,
843 AC_HELP_STRING([--with-readline@<:@=DIR@:>@], [specify readline library directory]),
845 case "$with_readline" in
850 if test -f ${with_readline}/readline.h; then
851 CONS_INC="-I${with_readline}"
852 CONS_LDFLAGS="-L$with_readline"
853 elif test -f ${with_readline}/include/readline/readline.h; then
854 CONS_INC="-I${with_readline}/include/readline"
855 CONS_LDFLAGS="-L${with_readline}/lib"
856 with_readline="${with_readline}/include/readline"
858 with_readline="/usr/include/readline"
861 AC_CHECK_HEADER(${with_readline}/readline.h,
863 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
864 CONS_LIBS="-lreadline -lhistory -ltermcap"
868 echo "readline.h not found. readline turned off ..."
875 dnl check for standard readline library
876 AC_CHECK_HEADER(/usr/include/readline/readline.h,
878 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
880 CONS_INC="-I/usr/include/readline"
881 CONS_LIBS="-lreadline -ltermcap"
883 dnl Did not find standard library, so try Bacula's default
884 AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h,
886 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
888 CONS_INC="-I${TOP_DIR}/depkgs/readline"
889 CONS_LIBS="-lreadline -lhistory -ltermcap"
890 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
891 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
894 echo "readline.h not found. readline turned off ..."
908 AC_SUBST(CONS_LDFLAGS)
909 AC_SUBST(READLINE_SRC)
911 dnl Minimal stuff for readline Makefile configuration
916 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr lstat lchown)
917 AC_CHECK_FUNCS(nanosleep nl_langinfo)
918 AC_CHECK_HEADERS(varargs.h)
920 dnl End of readline/conio stuff
921 dnl -----------------------------------------------------------------------
923 dnl -----------------------------------------------------------------------
924 dnl Check for Python support
926 AC_MSG_CHECKING(for Python support)
928 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.]),
932 if test "$withval" != "no"; then
933 if test "$withval" = "yes"; then
934 if test -e /usr/bin/python-config ; then
935 PYTHON_INCDIR=`/usr/bin/python-config --includes`
936 PYTHON_LIBS=`/usr/bin/python-config --libs`
938 for python_root in /usr /usr/local /usr/sfw; do
939 for ver in python2.2 python2.3 python2.4 python2.5 python2.6 python3; do
940 if test -f $python_root/include/${ver}/Python.h; then
941 PYTHON_INCDIR=-I$python_root/include/${ver}
942 if test -d $python_root/lib64/${ver}/config; then
943 PYTHON_LIBS="-L$python_root/lib64/${ver}/config -l${ver}"
945 PYTHON_LIBS="-L$python_root/lib/${ver}/config -l${ver}"
952 if test x$PYTHON_INCDIR = x; then
953 if test -f $prefix/include/Python.h; then
954 PYTHON_INCDIR=-I$prefix/include
955 if test -d $prefix/lib64/config; then
956 PYTHON_LIBS="-L$prefix/lib64/config -lpython"
958 PYTHON_LIBS="-L$prefix/lib/config -lpython"
962 AC_MSG_ERROR(Unable to find Python.h in standard locations)
967 if test -e $withval/bin/python-config ; then
968 PYTHON_INCDIR=`$withval/bin/python-config --includes`
969 PYTHON_LIBS=`$withval/bin/python-config --libs`
970 elif test -f $withval/Python.h; then
971 PYTHON_INCDIR=-I$withval
972 PYTHON_LIBS="-L$withval/config -lpython"
973 elif test -f $withval/include/Python.h; then
974 PYTHON_INCDIR=-I$withval/include
975 if test -d $withval/lib64/config; then
976 PYTHON_LIBS="-L$withval/lib64/config -lpython"
978 PYTHON_LIBS="-L$withval/lib/config -lpython"
980 elif test -f $withval/include/python/Python.h; then
981 PYTHON_INCDIR=-I$withval/include/python
982 if test -d $withval/lib64/python/config; then
983 PYTHON_LIBS="-L$withval/lib64/python/config -lpython"
985 PYTHON_LIBS="-L$withval/lib/python/config -lpython"
989 AC_MSG_ERROR(Invalid Python directory $withval - unable to find Python.h under $withval)
993 AC_DEFINE([HAVE_PYTHON], 1)
996 AC_MSG_NOTICE(checking for more Python libs)
997 saved_LIBS="$LIBS"; LIBS=
998 AC_SEARCH_LIBS(shm_open, [rt])
999 AC_CHECK_LIB(util, openpty)
1000 PYTHON_LIBS="$PYTHON_LIBS $LIBS"
1009 AC_SUBST(PYTHON_LIBS)
1010 AC_SUBST(PYTHON_INCDIR)
1013 dnl Find where sockets are (especially for Solaris)
1014 dnl Do this before the TCP Wrappers test since tcp wrappers
1015 dnl uses the socket library and some linkers are stupid.
1017 AC_CHECK_FUNC(socket,
1018 AC_MSG_RESULT(using libc's socket),
1019 AC_CHECK_LIB(xnet,socket)
1020 AC_CHECK_LIB(socket,socket)
1021 AC_CHECK_LIB(inet,socket))
1023 dnl -----------------------------------------------------------
1024 dnl Check whether user wants TCP wrappers support (default off)
1025 dnl -----------------------------------------------------------
1028 AC_ARG_WITH(tcp-wrappers,
1029 AC_HELP_STRING([--with-tcp-wrappers@<:@=DIR@:>@], [enable tcpwrappers support]),
1031 if test "x$withval" != "xno" ; then
1033 LIBS="$saved_LIBS -lwrap"
1034 AC_SEARCH_LIBS(nanosleep, [rt])
1035 AC_MSG_CHECKING(for libwrap)
1038 #include <sys/types.h>
1040 int deny_severity = 0;
1041 int allow_severity = 0;
1042 struct request_info *req;
1047 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
1052 LIBS="$saved_LIBS -lwrap -lnsl"
1053 WRAPLIBS="$saved_LIBS -lwrap -lnsl"
1056 #include <sys/types.h>
1058 int deny_severity = 0;
1059 int allow_severity = 0;
1060 struct request_info *req;
1065 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
1070 AC_MSG_ERROR([*** libwrap missing])
1079 dnl -----------------------------------------------------------
1080 dnl Check whether OpenSSL is available
1081 dnl -----------------------------------------------------------
1082 AC_MSG_CHECKING([for OpenSSL])
1083 dnl The following uses quadrigraphs:
1086 AC_ARG_WITH(openssl,
1087 AC_HELP_STRING([--with-openssl@<:@=DIR@:>@], [Include OpenSSL support. DIR is the OpenSSL base]),
1089 with_openssl_directory=${withval}
1093 if test "x$with_openssl_directory" != "xno"; then
1094 OPENSSL_LIBS="-lssl -lcrypto"
1097 if test "x$with_openssl_directory" != "xyes" && test x"${with_openssl_directory}" != "x"; then
1099 # Make sure the $with_openssl_directory also makes sense
1101 if test -d "$with_openssl_directory/lib" -a -d "$with_openssl_directory/include"; then
1102 OPENSSL_LIBS="-L$with_openssl_directory/lib $OPENSSL_LIBS"
1103 OPENSSL_INC="-I$with_openssl_directory/include $OPENSSL_INC"
1107 saved_LIBS="${LIBS}"
1108 saved_CFLAGS="${CFLAGS}"
1109 LIBS="${saved_LIBS} ${OPENSSL_LIBS}"
1110 CFLAGS="${saved_CFLAGS} ${OPENSSL_INC}"
1114 #include <openssl/ssl.h>
1116 CRYPTO_set_id_callback(NULL);
1119 support_crypto="yes"
1128 #include <openssl/evp.h>
1132 ac_cv_openssl_sha2="yes"
1134 ac_cv_openssl_sha2="no"
1138 dnl Solaris disables greater than 128+ bit encryption in their OpenSSL
1139 dnl implementation, presumably for export reasons. If 192bit AES
1140 dnl is available, we assume that we're running with a 'non-export'
1141 dnl openssl library.
1144 #include <openssl/evp.h>
1148 ac_cv_openssl_export="no"
1150 ac_cv_openssl_export="yes"
1154 LIBS="${saved_LIBS}"
1155 CFLAGS="${saved_CFLAGS}"
1157 if test "$support_tls" = "yes"; then
1158 AC_DEFINE(HAVE_OPENSSL, 1, [Define if OpenSSL library is available])
1159 AC_DEFINE(HAVE_TLS, 1, [Define if TLS support should be enabled])
1160 AC_DEFINE(HAVE_CRYPTO, 1, [Define if encryption support should be enabled])
1163 if test "$ac_cv_openssl_sha2" = "yes"; then
1164 AC_DEFINE(HAVE_SHA2, 1, [Define if the SHA-2 family of digest algorithms is available])
1167 if test "$ac_cv_openssl_export" = "yes"; then
1168 AC_DEFINE(HAVE_OPENSSL_EXPORT_LIBRARY, 1, [Define if the OpenSSL library is export-contrained to 128bit ciphers])
1177 if test "$support_tls" = "no"; then
1181 if test "$support_crypto" = "no"; then
1186 AC_MSG_RESULT([$support_tls])
1187 AC_SUBST(OPENSSL_LIBS)
1188 AC_SUBST(OPENSSL_INC)
1190 dnl -----------------------------------------------------------
1191 dnl dlopen is needed for plugins
1192 dnl -----------------------------------------------------------
1193 AC_SEARCH_LIBS(dlopen, [dl])
1195 dnl ------------------------------------------
1196 dnl Where to place working dir
1197 dnl ------------------------------------------
1198 working_dir=`eval echo ${prefix}/var/bacula/working`
1199 AC_ARG_WITH(working-dir,
1200 AC_HELP_STRING([--with-working-dir=PATH], [specify path of Bacula working directory]),
1202 if test "x$withval" != "xno" ; then
1203 working_dir=$withval
1208 AC_SUBST(working_dir)
1210 dnl ------------------------------------------------------------------
1211 dnl If the user has not set archivedir, we set our default as /tmp
1212 dnl ------------------------------------------------------------------
1214 AC_ARG_WITH(archivedir,
1215 AC_HELP_STRING([--with-archivedir=PATH], [specify path of SD archive directory]),
1217 if test "x$withval" != "xno" ; then
1223 AC_SUBST(archivedir)
1225 dnl ------------------------------------------------------------------
1226 dnl Allow the user to specify the daemon resource name default hostname
1227 dnl ------------------------------------------------------------------
1229 AC_ARG_WITH(basename,
1230 AC_HELP_STRING([--with-basename=RESNAME], [specify base resource name for daemons]),
1232 if test "x$withval" != "xno" ; then
1240 dnl ------------------------------------------------------------------
1241 dnl Allow the user to override the hostname (default = machine hostname)
1242 dnl ------------------------------------------------------------------
1243 hostname=`uname -n | cut -d '.' -f 1`
1244 if test x${hostname} = x ; then
1245 hostname="localhost"
1247 AC_ARG_WITH(hostname,
1248 AC_HELP_STRING([--with-hostname=RESNAME], [specify host name for daemons]),
1250 if test "x$withval" != "xno" ; then
1259 dnl ------------------------------------------
1260 dnl Where to place scriptdir (script files)
1261 dnl ------------------------------------------
1262 scriptdir=`eval echo ${sysconfdir}`
1263 AC_ARG_WITH(scriptdir,
1264 AC_HELP_STRING([--with-scriptdir=PATH], [specify path of Bacula scripts directory]),
1266 if test "x$withval" != "xno" ; then
1275 dnl ------------------------------------------
1276 dnl Where to place bsrdir (bsr files)
1277 dnl ------------------------------------------
1280 AC_HELP_STRING([--with-bsrdir=PATH], [specify path of Bacula bsrs directory]),
1282 if test "x$withval" != "xno" ; then
1290 dnl ------------------------------------------
1291 dnl Where to place logdir (bsr files)
1292 dnl ------------------------------------------
1295 AC_HELP_STRING([--with-logdir=PATH], [specify path of Bacula logs directory]),
1297 if test "x$withval" != "xno" ; then
1306 # ------------------------------------------
1307 # Where to place plugindir (plugin files)
1308 # ------------------------------------------
1309 plugindir=`eval echo ${libdir}`
1310 AC_ARG_WITH(plugindir,
1311 AC_HELP_STRING([--with-plugindir=PATH], [specify path of Bacula plugins directory]),
1313 if test "x$withval" != "xno" ; then
1321 dnl ------------------------------------------
1322 dnl Where to send dump email
1323 dnl ------------------------------------------
1324 dump_email=root@localhost
1325 AC_ARG_WITH(dump-email,
1326 AC_HELP_STRING([--with-dump-email=EMAIL], [dump email address]),
1328 if test "x$withval" != "xno" ; then
1334 AC_SUBST(dump_email)
1336 dnl ------------------------------------------
1337 dnl Where to send job email
1338 dnl ------------------------------------------
1339 job_email=root@localhost
1340 AC_ARG_WITH(job-email,
1341 AC_HELP_STRING([--with-job-email=EMAIL], [job output email address]),
1343 if test "x$withval" != "xno" ; then
1351 dnl ------------------------------------------
1352 dnl Where to find smtp host
1353 dnl ------------------------------------------
1355 AC_ARG_WITH(smtp_host,
1356 AC_HELP_STRING([--with-smtp-host=HOST], [SMTP mail host address]),
1358 if test "x$withval" != "xno" ; then
1366 dnl ------------------------------------
1367 dnl Where to place pid files
1368 dnl ------------------------------------
1370 AC_ARG_WITH(pid-dir,
1371 AC_HELP_STRING([--with-pid-dir=PATH], [specify location of Bacula pid files]),
1373 if test "x$withval" != "xno" ; then
1379 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
1382 dnl ------------------------------------
1383 dnl Where to place subsys "lock file"
1384 dnl ------------------------------------
1385 subsysdir=/var/run/subsys
1386 if test -d /var/run/subsys; then
1387 subsysdir=/var/run/subsys
1388 elif test -d /var/lock/subsys; then
1389 subsysdir=/var/lock/subsys
1391 subsysdir=/var/run/subsys
1393 AC_ARG_WITH(subsys-dir,
1394 AC_HELP_STRING([--with-subsys-dir=PATH], [specify location of Bacula subsys file]),
1396 if test "x$withval" != "xno" ; then
1404 dnl ------------------------------------
1405 dnl Where to start assigning ports
1406 dnl ------------------------------------
1408 AC_ARG_WITH(baseport,
1409 AC_HELP_STRING([--with-baseport=PORT], [specify base port address for daemons]),
1411 if test "x$withval" != "xno" ; then
1418 dir_port=`expr $baseport`
1419 fd_port=`expr $baseport + 1`
1420 sd_port=`expr $fd_port + 1`
1426 dnl ------------------------------------------
1427 dnl Generate passwords
1428 dnl ------------------------------------------
1430 AC_ARG_WITH(dir-password,
1431 AC_HELP_STRING([--with-dir-password=PASSWORD], [specify Director's password]),
1433 if test "x$withval" != "xno" ; then
1434 dir_password=$withval
1439 if test "x$dir_password" = "x" ; then
1440 if test "x$OPENSSL" = "xnone" ; then
1441 key=`autoconf/randpass 33`
1443 key=`openssl rand -base64 33`
1449 AC_ARG_WITH(fd-password,
1450 AC_HELP_STRING([--with-fd-password=PASSWORD], [specify Client's password]),
1452 if test "x$withval" != "xno" ; then
1453 fd_password=$withval
1458 if test "x$fd_password" = "x" ; then
1459 if test "x$OPENSSL" = "xnone" ; then
1460 key=`autoconf/randpass 37`
1462 key=`openssl rand -base64 33`
1468 AC_ARG_WITH(sd-password,
1469 AC_HELP_STRING([--with-sd-password=PASSWORD], [specify Storage daemon's password]),
1471 if test "x$withval" != "xno" ; then
1472 sd_password=$withval
1477 if test "x$sd_password" = "x" ; then
1478 if test "x$OPENSSL" = "xnone" ; then
1479 key=`autoconf/randpass 41`
1481 key=`openssl rand -base64 33`
1487 AC_ARG_WITH(mon-dir-password,
1488 AC_HELP_STRING([--with-mon-dir-password=PASSWORD], [specify Director's password used by the monitor]),
1490 if test "x$withval" != "xno" ; then
1491 mon_dir_password=$withval
1496 if test "x$mon_dir_password" = "x" ; then
1497 if test "x$OPENSSL" = "xnone" ; then
1498 key=`autoconf/randpass 33`
1500 key=`openssl rand -base64 33`
1502 mon_dir_password=$key
1506 AC_ARG_WITH(mon-fd-password,
1507 AC_HELP_STRING([--with-mon-fd-password=PASSWORD], [specify Client's password used by the monitor]),
1509 if test "x$withval" != "xno" ; then
1510 mon_fd_password=$withval
1515 if test "x$mon_fd_password" = "x" ; then
1516 if test "x$OPENSSL" = "xnone" ; then
1517 key=`autoconf/randpass 37`
1519 key=`openssl rand -base64 33`
1521 mon_fd_password=$key
1525 AC_ARG_WITH(mon-sd-password,
1526 AC_HELP_STRING([--with-mon-sd-password=PASSWORD], [specify Storage daemon's password used by the monitor]),
1528 if test "x$withval" != "xno" ; then
1529 mon_sd_password=$withval
1534 if test "x$mon_sd_password" = "x" ; then
1535 if test "x$OPENSSL" = "xnone" ; then
1536 key=`autoconf/randpass 41`
1538 key=`openssl rand -base64 33`
1540 mon_sd_password=$key
1543 AC_SUBST(dir_password)
1544 AC_SUBST(fd_password)
1545 AC_SUBST(sd_password)
1546 AC_SUBST(mon_dir_password)
1547 AC_SUBST(mon_fd_password)
1548 AC_SUBST(mon_sd_password)
1551 dnl Pickup any database name
1554 AC_ARG_WITH(db_name,
1555 AC_HELP_STRING([--with-db-name=DBNAME], [specify database name @<:@default=bacula@:>@]),
1557 if test "x$withval" != "x" ; then
1565 AC_ARG_WITH(db_user,
1566 AC_HELP_STRING([--with-db-user=UNAME], [specify database user @<:@default=bacula@:>@]),
1568 if test "x$withval" != "x" ; then
1576 AC_ARG_WITH(db_password,
1577 AC_HELP_STRING([--with-db-password=PWD], [specify database password @<:@default=*none*@:>@]),
1579 if test "x$withval" != "x" ; then
1580 db_password=$withval
1584 AC_SUBST(db_password)
1587 dnl Pickup a database port
1590 AC_ARG_WITH(db_port,
1591 AC_HELP_STRING([--with-db-port=DBPORT], [specify a database port @<:@default=null@:>@]),
1593 if test "x$withval" != "x" ; then
1601 # Handle users and groups for each daemon
1604 AC_ARG_WITH(dir_user,
1605 AC_HELP_STRING([--with-dir-user=USER], [specify user for Director daemon]),
1607 if test "x$withval" != "x" ; then
1614 AC_ARG_WITH(dir_group,
1615 AC_HELP_STRING([--with-dir-group=GROUP], [specify group for Director daemon]),
1617 if test "x$withval" != "x" ; then
1624 AC_ARG_WITH(sd_user,
1625 AC_HELP_STRING([--with-sd-user=USER], [specify user for Storage daemon]),
1627 if test "x$withval" != "x" ; then
1634 AC_ARG_WITH(sd_group,
1635 AC_HELP_STRING([--with-sd-group=GROUP], [specify group for Storage daemon]),
1637 if test "x$withval" != "x" ; then
1644 AC_ARG_WITH(fd_user,
1645 AC_HELP_STRING([--with-fd-user=USER], [specify user for File daemon]),
1647 if test "x$withval" != "x" ; then
1654 AC_ARG_WITH(fd_group,
1655 AC_HELP_STRING([--with-fd-group=GROUP], [specify group for File daemon]),
1657 if test "x$withval" != "x" ; then
1671 dnl allow setting default executable permissions
1674 AC_ARG_WITH(sbin-perm,
1675 AC_HELP_STRING([--with-sbin-perm=MODE], [specify permissions for sbin binaries @<:@default=0754@:>@]),
1677 if test "x$withval" != "x" ; then
1685 dnl ------------------------------------------------
1686 dnl Bacula check for various SQL database engines
1687 dnl ------------------------------------------------
1689 BA_CHECK_POSTGRESQL_DB
1697 # BA_CHECK_SQLITE_DB
1706 dnl -------------------------------------------
1707 dnl enable batch attribute DB insert (default on)
1708 dnl -------------------------------------------
1709 support_batch_insert=no
1710 A=`test -f $SQL_LIB && nm $SQL_LIB | grep pthread_mutex_lock`
1712 if test $pkg = 0; then
1713 support_batch_insert=yes
1714 AC_ARG_ENABLE(batch-insert,
1715 AC_HELP_STRING([--enable-batch-insert], [enable the DB batch insert code @<:@default=no@:>@]),
1717 if test x$enableval = xno; then
1718 support_batch_insert=no
1720 support_batch_insert=yes
1726 dnl Check if postgresql can support batch mode
1727 if test x$DB_TYPE = xpostgresql; then
1728 AC_CHECK_LIB(pq, PQisthreadsafe, AC_DEFINE(HAVE_PQISTHREADSAFE, 1, [Set if have PQisthreadsafe]))
1729 AC_CHECK_LIB(pq, PQputCopyData, AC_DEFINE(HAVE_PQ_COPY, 1, [Set if have PQputCopyData]))
1730 if test "x$ac_cv_lib_pq_PQputCopyData" != "xyes"
1732 support_batch_insert=no
1736 if test x$DB_TYPE = xdbi; then
1740 dnl Check for batch insert
1741 if test $DB_PROG = postgresql; then
1742 AC_CHECK_LIB(pq, PQisthreadsafe, AC_DEFINE(HAVE_PQISTHREADSAFE))
1743 AC_CHECK_LIB(pq, PQputCopyData, AC_DEFINE(HAVE_PQ_COPY))
1744 test "x$ac_cv_lib_pq_PQputCopyData" != "xyes"
1748 if test $DB_PROG = mysql; then
1749 A=`test -f $SQL_LIB && nm $DB_PROG_LIB | grep pthread_mutex_lock`
1753 if test $DB_PROG = sqlite3; then
1754 A=`test -f $SQL_LIB && nm $DB_PROG_LIB | grep pthread_mutex_lock`
1758 if test $pkg = 0; then
1759 AC_ARG_ENABLE(batch-insert,
1760 AC_HELP_STRING([--enable-batch-insert], [enable the DB batch insert code @<:@default=no@:>@]),
1762 if test x$enableval = xno; then
1763 support_batch_insert=no
1765 support_batch_insert=yes
1771 dnl If dbi was not chosen, let the comment in file
1775 AC_SUBST(uncomment_dbi)
1777 if test $support_batch_insert = yes ; then
1778 AC_DEFINE(HAVE_BATCH_FILE_INSERT, 1, [Set if DB batch insert code enabled])
1781 AC_DEFINE(PROTOTYPES)
1783 dnl --------------------------------------------------------------------------
1784 dnl Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
1786 if test -z "$CFLAGS" -o "$CFLAGS" = "-g -O2"; then
1787 if test -z "$CCOPTS"; then
1788 CCOPTS='-g -O2 -Wall'
1796 dnl See if we can use 64 bit file addresses
1797 largefile_support="no"
1802 dnl --------------------------------------------------------------------------
1803 dnl CHECKING FOR HEADER FILES
1804 dnl --------------------------------------------------------------------------
1842 AC_STRUCT_ST_BLKSIZE
1846 dnl --------------------------------------------------------------------------
1847 dnl Check for utime.h structure
1848 dnl --------------------------------------------------------------------------
1849 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
1853 #include <sys/types.h>
1858 ba_cv_header_utime_h=yes
1860 ba_cv_header_utime_h=no
1865 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H, 1, [Set if utime.h exists])
1867 dnl --------------------------------------------------------------------------
1868 dnl Check for socklen_t
1869 dnl --------------------------------------------------------------------------
1870 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
1874 #include <sys/types.h>
1875 #include <sys/socket.h>
1879 ba_cv_header_socklen_t=yes
1881 ba_cv_header_socklen_t=no
1886 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T, 1, [Set if socklen_t exists])
1888 dnl --------------------------------------------------------------------------
1889 dnl Check for ioctl request type
1890 dnl --------------------------------------------------------------------------
1892 AC_CACHE_CHECK(for ioctl_req_t, ba_cv_header_ioctl_req_t,
1897 #include <sys/types.h>
1898 #include <sys/ioctl.h>
1900 int (*d_ioctl)(int fd, unsigned long int request, ...);
1903 ba_cv_header_ioctl_req_t=yes
1905 ba_cv_header_ioctl_req_t=no
1910 test $ba_cv_header_ioctl_req_t = yes && AC_DEFINE(HAVE_IOCTL_ULINT_REQUEST, 1, [Set if ioctl request is unsigned long int])
1912 dnl Note: it is more correct to use AC_LANG(C++) but some of the older
1913 dnl *BSD systems still use old style C prototypes, which are wrong with
1914 dnl compiled with a C++ compiler.
1917 dnl --------------------------------------------------------------------------
1918 dnl Check for typeof()
1919 dnl --------------------------------------------------------------------------
1921 AC_CACHE_CHECK(for typeof, ba_cv_have_typeof,
1925 main(){char *a = 0; a = (typeof a)a;}
1927 ba_cv_have_typeof=yes
1929 ba_cv_have_typeof=no
1931 ba_cv_have_typeof=no
1936 test $ba_cv_have_typeof = yes && AC_DEFINE([HAVE_TYPEOF], 1, [Defind to 1 if compiler has typeof])
1941 dnl --------------------------------------------------------------------------
1942 dnl CHECKING FOR FILESYSTEM TYPE
1943 dnl --------------------------------------------------------------------------
1944 AC_MSG_CHECKING(how to get filesystem type)
1946 # The order of these tests is important.
1949 #include <sys/statvfs.h>
1950 #include <sys/fstyp.h>
1952 AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4
1954 if test $fstype = no; then
1957 #include <sys/statfs.h>
1958 #include <sys/fstyp.h>
1960 AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3
1963 if test $fstype = no; then
1966 #include <sys/statfs.h>
1967 #include <sys/vmount.h>
1969 AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX
1972 if test $fstype = no; then
1977 AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD
1980 if test $fstype = no; then
1981 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
1983 if test $fstype = no; then
1986 #include <sys/mount.h>
1987 #include <sys/fs_types.h>
1989 AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix
1992 AC_MSG_RESULT($fstype)
1994 AC_CHECK_HEADER(sys/statvfs.h, [ AC_DEFINE(HAVE_SYS_STATVFS_H,1,[Defines if your system have the sys/statvfs.h header file])] , )
1996 dnl --------------------------------------------------------------------------
1997 dnl CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
1998 dnl --------------------------------------------------------------------------
2008 AC_CHECK_TYPE(ino_t, unsigned long)
2009 AC_CHECK_TYPE(dev_t, unsigned long)
2010 AC_CHECK_TYPE(daddr_t, long)
2011 AC_CHECK_TYPE(major_t, int)
2012 AC_CHECK_TYPE(minor_t, int)
2013 AC_CHECK_TYPE(ssize_t, int)
2019 AC_CHECK_SIZEOF(char, 1)
2020 AC_CHECK_SIZEOF(short int, 2)
2021 AC_CHECK_SIZEOF(int, 4)
2022 AC_CHECK_SIZEOF(long int, 4)
2023 AC_CHECK_SIZEOF(long long int, 8)
2024 AC_CHECK_SIZEOF(int *, 4)
2026 dnl Check for sys/types.h types
2027 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int,
2031 #include <sys/types.h>
2035 ac_cv_have_u_int="yes"
2037 ac_cv_have_u_int="no"
2042 if test "x$ac_cv_have_u_int" = "xyes" ; then
2043 AC_DEFINE(HAVE_U_INT)
2047 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t,
2051 #include <sys/types.h>
2055 ac_cv_have_intmax_t="yes"
2063 ac_cv_have_intmax_t="yes"
2065 ac_cv_have_intmax_t="no"
2072 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
2073 AC_DEFINE(HAVE_INTMAX_T)
2077 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t,
2081 #include <sys/types.h>
2083 u_intmax_t a; a = 1;
2085 ac_cv_have_u_intmax_t="yes"
2091 u_intmax_t a; a = 1;
2093 ac_cv_have_u_intmax_t="yes"
2095 ac_cv_have_u_intmax_t="no"
2102 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
2103 AC_DEFINE(HAVE_U_INTMAX_T)
2107 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t,
2111 #include <sys/types.h>
2113 int8_t a; int16_t b; int32_t c; a = b = c = 1;
2115 ac_cv_have_intxx_t="yes"
2117 ac_cv_have_intxx_t="no"
2122 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
2123 AC_DEFINE(HAVE_INTXX_T)
2127 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t,
2131 #include <sys/types.h>
2135 ac_cv_have_int64_t="yes"
2137 ac_cv_have_int64_t="no"
2142 if test "x$ac_cv_have_int64_t" = "xyes" ; then
2143 AC_DEFINE(HAVE_INT64_T)
2147 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t,
2151 #include <sys/types.h>
2153 u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;
2155 ac_cv_have_u_intxx_t="yes"
2157 ac_cv_have_u_intxx_t="no"
2162 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
2163 AC_DEFINE(HAVE_U_INTXX_T)
2167 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t,
2171 #include <sys/types.h>
2175 ac_cv_have_u_int64_t="yes"
2177 ac_cv_have_u_int64_t="no"
2182 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
2183 AC_DEFINE(HAVE_U_INT64_T)
2187 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
2188 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2190 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
2193 #include <sys/bitypes.h>
2195 int8_t a; int16_t b; int32_t c;
2196 u_int8_t e; u_int16_t f; u_int32_t g;
2197 a = b = c = e = f = g = 1;
2199 AC_DEFINE(HAVE_U_INTXX_T)
2200 AC_DEFINE(HAVE_INTXX_T)
2201 AC_DEFINE(HAVE_SYS_BITYPES_H)
2209 if test -z "$have_u_intxx_t" ; then
2210 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t,
2214 #include <sys/types.h>
2216 uint8_t a; uint16_t b;
2217 uint32_t c; a = b = c = 1;
2219 ac_cv_have_uintxx_t="yes"
2221 ac_cv_have_uintxx_t="no"
2226 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
2227 AC_DEFINE(HAVE_UINTXX_T)
2231 if (test -z "$have_u_int64_t" || test -z "$have_int64_t" && \
2232 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2234 AC_MSG_CHECKING([for int64_t and u_int64_t types in sys/bitypes.h])
2237 #include <sys/bitypes.h>
2239 int64_t a; u_int64_t b;
2242 AC_DEFINE(HAVE_U_INT64_T)
2243 AC_DEFINE(HAVE_INT64_T)
2251 if (test -z "$have_uintxx_t" && \
2252 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2254 AC_MSG_CHECKING([for uintXX_t types in sys/bitypes.h])
2257 #include <sys/bitypes.h>
2259 uint8_t a; uint16_t b;
2260 uint32_t c; a = b = c = 1;
2262 AC_DEFINE(HAVE_UINTXX_T)
2270 dnl --------------------------------------------------------------------------
2271 dnl CHECKING FOR REQUIRED LIBRARY FUNCTIONS
2272 dnl --------------------------------------------------------------------------
2288 [echo 'configure: cannot find needed function.'; exit 1]
2291 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
2292 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
2293 AC_CHECK_FUNCS(posix_fadvise)
2294 AC_CHECK_FUNCS(fdatasync)
2296 AC_CHECK_FUNCS(chflags)
2298 AC_CHECK_FUNCS(snprintf vsnprintf gethostid fseeko)
2300 AC_CACHE_CHECK(for va_copy, ba_cv_va_copy,
2305 void use_va_copy(va_list args){va_list args2; va_copy(args2,args); va_end(args2);}
2306 void call_use_va_copy(int junk,...){va_list args; va_start(args,junk); use_va_copy(args); va_end(args);}
2308 call_use_va_copy(1,2,3)
2317 test $ba_cv_va_copy = yes && AC_DEFINE(HAVE_VA_COPY, 1, [Set if va_copy exists])
2319 dnl --------------------------------------------------------------------------
2320 dnl CHECKING FOR THREAD SAFE FUNCTIONS
2321 dnl --------------------------------------------------------------------------
2322 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
2324 # If resolver functions are not in libc check for -lnsl or -lresolv.
2325 AC_CHECK_FUNC(gethostbyname_r,
2326 AC_MSG_RESULT(using libc's resolver),
2327 AC_CHECK_LIB(nsl,gethostbyname_r)
2328 AC_CHECK_LIB(resolv,gethostbyname_r))
2330 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
2331 AC_CHECK_FUNCS(inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)])
2332 AC_CHECK_FUNCS(gethostbyname2, [AC_DEFINE(HAVE_GETHOSTBYNAME2)])
2334 dnl ----------------------------
2335 dnl check sa_len of sockaddr
2336 dnl ----------------------------
2337 AC_CACHE_CHECK(for struct sockaddr has a sa_len field, ac_cv_struct_sockaddr_sa_len,
2341 #include <sys/socket.h>
2343 struct sockaddr s; s.sa_len;
2345 ac_cv_struct_sockaddr_sa_len=yes
2346 ], [ac_cv_struct_sockaddr_sa_len=no
2352 if test $ac_cv_struct_sockaddr_sa_len = yes; then
2353 AC_DEFINE(HAVE_SA_LEN, 1, [Define if sa_len field exists in struct sockaddr])
2360 AC_FUNC_CLOSEDIR_VOID
2361 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
2362 # AC_FUNC_FNMATCH dnl use local version
2364 AC_CHECK_LIB(intl, gettext, [LIBS="$LIBS -lintl"])
2366 AC_CHECK_LIB(sun, getpwnam)
2368 AC_CHECK_HEADERS(zlib.h)
2369 AC_CHECK_LIB(z, deflate, [FDLIBS="-lz"])
2371 if test x$FDLIBS = x-lz; then
2372 AC_DEFINE(HAVE_LIBZ)
2377 dnl Check for ACL support and libraries
2381 AC_HELP_STRING([--disable-acl], [disable acl support @<:@default=auto@:>@]),
2383 if test x$enableval = xyes; then
2385 elif test x$enableval = xno; then
2392 have_extended_acl=no
2393 if test x$support_acl = xyes -o x$support_acl = xauto; then
2394 AC_CHECK_HEADER(sys/acl.h, [ AC_DEFINE(HAVE_SYS_ACL_H,1,[Defines if your system have the sys/acl.h header file])] , )
2395 AC_CHECK_FUNC(acl_get_file,
2399 AC_CHECK_LIB(acl, acl_get_file,
2402 FDLIBS="-lacl $FDLIBS"
2404 AC_CHECK_LIB(pacl, acl_get_file,
2407 FDLIBS="-lpacl $FDLIBS"
2409 AC_CHECK_LIB(sec, acltotext,
2412 FDLIBS="-lsec $FDLIBS"
2414 AC_CHECK_LIB(sec, acl_totext,
2416 have_extended_acl=yes
2428 if test x$support_acl = xyes -a $have_acl != yes; then
2429 AC_MSG_ERROR([acl support explicitly enabled but no supported acl implementation found,
2430 please either load the acl libraries or rerun configure without --enable-acl])
2432 if test $have_acl = yes; then
2433 AC_DEFINE([HAVE_ACL],1,[Normal acl support])
2436 if test $have_extended_acl = yes; then
2437 AC_DEFINE([HAVE_EXTENDED_ACL],1,[Extended acl support])
2443 dnl Check for XATTR support
2446 AC_ARG_ENABLE(xattr,
2447 AC_HELP_STRING([--disable-xattr], [disable xattr support @<:@default=auto@:>@]),
2449 if test x$enableval = xyes; then
2451 elif test x$enableval = xno; then
2458 if test x$support_xattr = xyes -o x$support_xattr = xauto; then
2460 dnl First check for *BSD support
2462 AC_CHECK_HEADER(sys/extattr.h, [ AC_DEFINE(HAVE_SYS_EXTATTR_H,1,[Defines if your system have the sys/extattr.h header file])] , )
2463 AC_CHECK_HEADER(libutil.h, [ AC_DEFINE(HAVE_LIBUTIL_H,1,[Defines if your system have the libutil.h header file])] , )
2464 AC_CHECK_FUNCS(extattr_get_link extattr_set_link extattr_list_link,
2467 AC_DEFINE([HAVE_EXTATTR_GET_LINK],1,[Define to 1 if you have the 'extattr_get_link' function.])
2468 AC_DEFINE([HAVE_EXTATTR_SET_LINK],1,[Define to 1 if you have the 'extattr_set_link' function.])
2469 AC_DEFINE([HAVE_EXTATTR_LIST_LINK],1,[Define to 1 if you have the 'extattr_list_link' function.])
2473 if test $have_xattr = no; then
2474 AC_CHECK_FUNCS(extattr_get_file extattr_set_file extattr_list_file,
2477 AC_DEFINE([HAVE_EXTATTR_GET_FILE],1,[Define to 1 if you have the 'extattr_get_file' function.])
2478 AC_DEFINE([HAVE_EXTATTR_SET_FILE],1,[Define to 1 if you have the 'extattr_set_file' function.])
2479 AC_DEFINE([HAVE_EXTATTR_LIST_FILE],1,[Define to 1 if you have the 'extattr_list_file' function.])
2484 if test $have_xattr = yes; then
2485 have_extattr_string_in_libc=no
2486 AC_CHECK_FUNCS(extattr_namespace_to_string extattr_string_to_namespace,
2488 have_extattr_string_in_libc=yes
2489 AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2490 AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2495 dnl If extattr_namespace_to_string and extattr_string_to_namespace are not in libc see if they are in libutil
2497 if test $have_extattr_string_in_libc = no; then
2498 AC_CHECK_LIB(util, extattr_namespace_to_string extattr_string_to_namespace,
2500 AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2501 AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2502 FDLIBS="-lutil $FDLIBS"
2509 dnl If we failed to find *BSD support try the Linux or OSX implementation of xattr
2511 if test $have_xattr = no; then
2512 AC_CHECK_HEADER(sys/xattr.h, [ AC_DEFINE(HAVE_SYS_XATTR_H,1,[Defines if your system have the sys/xattr.h header file])] , )
2513 AC_CHECK_FUNCS(llistxattr lgetxattr lsetxattr,
2516 AC_DEFINE([HAVE_LLISTXATTR],1,[Define to 1 if you have the 'llistxattr' function.])
2517 AC_DEFINE([HAVE_LGETXATTR],1,[Define to 1 if you have the 'lgetxattr' function.])
2518 AC_DEFINE([HAVE_LSETXATTR],1,[Define to 1 if you have the 'lsetxattr' function.])
2522 if test $have_xattr = no; then
2523 AC_CHECK_FUNCS(listxattr getxattr setxattr,
2526 AC_DEFINE([HAVE_LISTXATTR],1,[Define to 1 if you have the 'listxattr' function.])
2527 AC_DEFINE([HAVE_GETXATTR],1,[Define to 1 if you have the 'getxattr' function.])
2528 AC_DEFINE([HAVE_SETXATTR],1,[Define to 1 if you have the 'setxattr' function.])
2535 dnl If we failed to find *BSD support and the Linux or OSX implementation of xattr try the Solaris xattr implementation
2537 if test $have_xattr = no; then
2538 AC_CHECK_HEADER(sys/attr.h, [ AC_DEFINE(HAVE_SYS_ATTR_H,1,[Defines if your system have the sys/attr.h header file])] , )
2539 AC_CHECK_HEADER(sys/nvpair.h, [ AC_DEFINE(HAVE_SYS_NVPAIR_H,1,[Defines if your system have the sys/nvpair.h header file])] , )
2540 AC_CHECK_HEADER(attr.h, [ AC_DEFINE(HAVE_ATTR_H,1,[Defines if your system have the attr.h header file])] , )
2542 AC_CHECK_FUNCS(openat fstatat unlinkat fchownat futimesat,
2545 AC_DEFINE([HAVE_OPENAT],1,[Define to 1 if you have the 'openat' function.])
2546 AC_DEFINE([HAVE_FSTATAT],1,[Define to 1 if you have the 'fstatat' function.])
2547 AC_DEFINE([HAVE_UNLINKAT],1,[Define to 1 if you have the 'unlinkat' function.])
2548 AC_DEFINE([HAVE_FCHOWNAT],1,[Define to 1 if you have the 'fchownat' function.])
2549 AC_DEFINE([HAVE_FUTIMESAT],1,[Define to 1 if you have the 'futimesat' function.])
2553 if test $have_xattr = yes; then
2554 AC_CHECK_LIB(nvpair, nvlist_next_nvpair,
2556 AC_DEFINE([HAVE_NVLIST_NEXT_NVPAIR],1,[Define to 1 if you have the 'nvlist_next_nvpair' function.])
2557 FDLIBS="-lnvpair $FDLIBS"
2563 if test x$support_xattr = xyes -a $have_xattr != yes; then
2564 AC_MSG_ERROR([xattr support explicitly enabled but no supported xattr implementation found,
2565 please either load the xattr libraries or rerun configure without --enable-xattr])
2567 if test $have_xattr = yes; then
2568 AC_DEFINE([HAVE_XATTR],1,[Extended Attributes support])
2574 dnl Check for pthread libraries
2577 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
2579 AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
2581 AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
2583 AC_CHECK_FUNC(pthread_create)
2592 dnl Check for headers, functions and libraries required to support
2593 dnl keeping readall capabilities
2595 AC_CHECK_HEADERS(sys/prctl.h sys/capability.h)
2596 AC_CHECK_FUNCS(prctl setreuid)
2597 AC_CHECK_LIB([cap], [cap_set_proc], [CAP_LIBS="-lcap"], [CAP_LIBS=])
2598 if test x$CAP_LIBS = x-lcap; then
2599 AC_DEFINE(HAVE_LIBCAP, 1, [Define if you have libcap])
2608 if test x$have_gcc = xyes ; then
2609 CPPFLAGS="$CPPFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
2610 CFLAGS="$CFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
2612 LDFLAGS=${LDFLAGS--O}
2613 DB_LIBS="${SQL_LFLAGS}"
2614 CPPFLAGS="$CPPFLAGS"
2627 AC_SUBST(X_EXTRA_LIBS)
2632 dnl extra configurable objects
2643 dnl Finally we set appropriate distribution specific
2644 dnl variables and defaults
2646 dnl PFILES are platform specific files
2647 PFILES="platforms/Makefile"
2652 hostname=`uname -n | cut -d '.' -f 1`
2653 if test x${hostname} = x ; then
2654 hostname="localhost"
2656 dnl Make sure hostname is resolved
2657 ping -c 1 $hostname 2>/dev/null 1>/dev/null
2658 if test ! $? = 0; then
2659 hostname="localhost"
2665 PSCMD="ps -e -o pid,comm"
2667 platforms/aix/Makefile"
2668 TAPEDRIVE="/dev/rmt0.1"
2672 PTHREAD_LIB="-lpthread -lexc"
2673 if test "${CC}" = "gcc" ; then
2680 TAPEDRIVE="/dev/nrmt0"
2683 DISTVER=`uname -a |awk '{print $3}'`
2684 TAPEDRIVE="/dev/nrmt0"
2685 PTHREAD_LIB="-pthread"
2686 CFLAGS="${CFLAGS} -pthread"
2687 PSCMD="ps -ax -o pid,command"
2691 platforms/bsdi/Makefile \
2692 platforms/bsdi/bacula-fd \
2693 platforms/bsdi/bacula-sd \
2694 platforms/bsdi/bacula-dir"
2695 largefile_support="yes"
2698 DISTVER=`uname -a |awk '{print $3}'`
2699 TAPEDRIVE="/dev/nrst0"
2702 WLDFLAGS="-mwindows"
2706 TAPEDRIVE="/dev/nst0"
2707 PSCMD="ps -e -o pid,command"
2710 platforms/darwin/Makefile"
2714 TAPEDRIVE="/dev/nst0"
2715 PSCMD="ps -e -o pid,command"
2718 platforms/osx/Makefile"
2721 if `test -f /etc/apt/sources.list && grep -q ubuntu /etc/apt/sources.list`; then
2724 DISTVER=`cat /etc/debian_version`
2725 if test -f /etc/lsb-release ; then
2727 if test "x$DISTRIB_ID" != "x" ; then
2728 DISTNAME=$DISTRIB_ID
2730 if test "x$DISTRIB_RELEASE" != "x" ; then
2731 DISTVER=$DISTRIB_RELEASE
2734 if test "$DISTNAME" = "Ubuntu" ; then
2737 TAPEDRIVE="/dev/nst0"
2738 PSCMD="ps -e -o pid,command"
2739 if test "$DISTNAME" = "ubuntu" ; then
2741 platforms/ubuntu/Makefile \
2742 platforms/ubuntu/bacula-fd \
2743 platforms/ubuntu/bacula-sd \
2744 platforms/ubuntu/bacula-dir"
2747 platforms/debian/Makefile \
2748 platforms/debian/bacula-fd \
2749 platforms/debian/bacula-sd \
2750 platforms/debian/bacula-dir"
2754 DISTVER=`uname -a |awk '{print $3}'`
2755 VER=`echo $DISTVER | cut -c 1`
2756 if test x$VER = x4 ; then
2757 PTHREAD_LIB="${PTHREAD_LIBS:--pthread}"
2758 CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS:--pthread}"
2762 TAPEDRIVE="/dev/nrsa0"
2763 PSCMD="ps -ax -o pid,command"
2765 platforms/freebsd/Makefile \
2766 platforms/freebsd/bacula-fd \
2767 platforms/freebsd/bacula-sd \
2768 platforms/freebsd/bacula-dir"
2769 largefile_support="yes"
2772 PSCMD="UNIX95=1; ps -e -o pid,comm"
2773 CFLAGS="${CFLAGS} -D_XOPEN_SOURCE_EXTENDED=1"
2775 TAPEDRIVE="/dev/rmt/0hnb"
2776 PTHREAD_LIB="-lpthread"
2777 AC_DEFINE([_INCLUDE_LONGLONG])
2781 TAPEDRIVE="/dev/rmt/0cbn"
2782 PSCMD="ps -e -o pid,comm"
2784 platforms/irix/Makefile \
2785 platforms/irix/bacula-fd \
2786 platforms/irix/bacula-sd \
2787 platforms/irix/bacula-dir"
2790 DISTVER=`uname -a |awk '{print $3}'`
2793 TAPEDRIVE="/dev/nrst0"
2794 PSCMD="ps -ax -o pid,command"
2795 PTHREAD_LIB="-pthread"
2796 CFLAGS="${CFLAGS} -pthread"
2799 DISTVER=`uname -a |awk '{print $3}'`
2802 TAPEDRIVE="/dev/nrst0"
2803 PSCMD="ps -ax -o pid,command"
2804 PTHREAD_LIB="-pthread"
2805 CFLAGS="${CFLAGS} -pthread"
2807 platforms/openbsd/Makefile \
2808 platforms/openbsd/bacula-fd \
2809 platforms/openbsd/bacula-sd \
2810 platforms/openbsd/bacula-dir"
2813 if test -f /etc/whitebox-release ; then
2814 f=/etc/whitebox-release
2816 f=/etc/redhat-release
2818 if test `cat $f | grep release |\
2819 cut -f 3 -d ' '`x = "Enterprise"x ; then
2820 DISTVER="Enterprise "`cat $f | grep release |\
2823 DISTVER=`cat /etc/redhat-release | grep release |\
2826 TAPEDRIVE="/dev/nst0"
2827 PSCMD="ps -e -o pid,command"
2829 platforms/redhat/Makefile \
2830 platforms/redhat/bacula-fd \
2831 platforms/redhat/bacula-sd \
2832 platforms/redhat/bacula-dir
2836 DISTVER=`cat /etc/mandrake-release | grep release |\
2838 TAPEDRIVE="/dev/nst0"
2839 PSCMD="ps -e -o pid,command"
2841 platforms/mandrake/Makefile \
2842 platforms/mandrake/bacula-fd \
2843 platforms/mandrake/bacula-sd \
2844 platforms/mandrake/bacula-dir \
2845 platforms/mandrake/bacula.spec \
2849 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
2850 TAPEDRIVE="/dev/nst0"
2851 PSCMD="ps -e -o pid,command"
2853 platforms/gentoo/Makefile \
2854 platforms/gentoo/bacula-init \
2855 platforms/gentoo/bacula-fd \
2856 platforms/gentoo/bacula-sd \
2857 platforms/gentoo/bacula-dir"
2860 DISTVER=`cat /etc/slackware-version`
2861 TAPEDRIVE="/dev/nst0"
2862 PSCMD="ps -e -o pid,command"
2864 platforms/slackware/Makefile \
2865 platforms/slackware/rc.bacula-fd \
2866 platforms/slackware/rc.bacula-sd \
2867 platforms/slackware/rc.bacula-dir\
2868 platforms/slackware/functions.bacula"
2872 TAPEDRIVE="/dev/rmt/0cbn"
2873 PSCMD="ps -e -o pid,comm"
2875 platforms/solaris/Makefile \
2876 platforms/solaris/bacula-fd \
2877 platforms/solaris/bacula-sd \
2878 platforms/solaris/bacula-dir"
2879 if test x$DISTVER = x5.6 ; then
2880 AC_DEFINE(HAVE_OLD_SOCKOPT)
2882 LIBS="$LIBS -lresolv"
2885 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
2887 TAPEDRIVE="/dev/nst0"
2888 PSCMD="ps -e -o pid,command"
2890 platforms/suse/Makefile \
2891 platforms/suse/bacula-fd \
2892 platforms/suse/bacula-sd \
2893 platforms/suse/bacula-dir \
2894 platforms/suse/bacula \
2895 platforms/suse/bacula.spec"
2900 TAPEDRIVE="/dev/nst0"
2901 PSCMD="ps -e -o pid,command"
2903 platforms/suse/Makefile \
2904 platforms/suse/bacula-fd \
2905 platforms/suse/bacula-sd \
2906 platforms/suse/bacula-dir"
2910 TAPEDRIVE="/dev/nst0"
2913 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
2919 LIBS="$PTHREAD_LIB $LIBS"
2921 AC_DEFINE_UNQUOTED(lld, "$lld")
2922 AC_DEFINE_UNQUOTED(llu, "$llu")
2930 dnl common parts of the Makefile
2931 MCOMMON=./autoconf/Make.common
2932 AC_SUBST_FILE(MCOMMON)
2935 if test "x${subsysdir}" = "x${sbindir}" ; then
2938 echo "You have set both --sbindir and --with-subsys-dir"
2939 echo " equal to: ${subsysdir} "
2940 echo "This is not permitted. Please reconfigure."
2942 echo "Aborting configuration ..."
2948 AC_OUTPUT([autoconf/Make.common \
2951 scripts/startmysql \
2953 scripts/btraceback \
2959 scripts/bacula-ctl-dir \
2960 scripts/bacula-ctl-fd \
2961 scripts/bacula-ctl-sd \
2962 scripts/devel_bacula \
2965 scripts/bacula.desktop.gnome1 \
2966 scripts/bacula.desktop.gnome2 \
2967 scripts/bacula.desktop.gnome1.consolehelper \
2968 scripts/bacula.desktop.gnome2.consolehelper \
2969 scripts/bacula.desktop.gnome1.xsu \
2970 scripts/bacula.desktop.gnome2.xsu \
2971 scripts/bgnome-console.console_apps \
2972 scripts/mtx-changer \
2973 scripts/disk-changer \
2974 scripts/dvd-handler \
2975 scripts/dvd-simulator \
2976 scripts/bacula-tray-monitor.desktop \
2977 scripts/logwatch/Makefile \
2978 scripts/logwatch/logfile.bacula.conf \
2979 scripts/wxconsole.console_apps \
2980 scripts/wxconsole.desktop.consolehelper \
2981 scripts/wxconsole.desktop.xsu \
2982 scripts/bat.desktop \
2983 scripts/bat.desktop.xsu \
2984 scripts/bat.desktop.consolehelper \
2985 scripts/bat.console_apps \
2988 src/console/Makefile \
2989 src/console/bconsole.conf \
2990 src/qt-console/bat.conf \
2991 src/qt-console/bat.pro \
2992 src/qt-console/bat.pro.mingw32 \
2993 src/qt-console/install_conf_file \
2994 src/wx-console/Makefile \
2995 src/wx-console/bwx-console.conf \
2996 src/tray-monitor/Makefile \
2997 src/tray-monitor/tray-monitor.conf \
2999 src/dird/bacula-dir.conf \
3001 src/stored/Makefile \
3002 src/stored/bacula-sd.conf \
3003 src/filed/Makefile \
3004 src/filed/bacula-fd.conf \
3006 src/cats/make_catalog_backup.pl \
3007 src/cats/make_catalog_backup \
3008 src/cats/delete_catalog_backup \
3009 src/cats/create_postgresql_database \
3010 src/cats/update_postgresql_tables \
3011 src/cats/make_postgresql_tables \
3012 src/cats/grant_postgresql_privileges \
3013 src/cats/drop_postgresql_tables \
3014 src/cats/drop_postgresql_database \
3015 src/cats/create_mysql_database \
3016 src/cats/update_mysql_tables \
3017 src/cats/make_mysql_tables \
3018 src/cats/grant_mysql_privileges \
3019 src/cats/drop_mysql_tables \
3020 src/cats/drop_mysql_database \
3021 src/cats/create_sqlite3_database \
3022 src/cats/update_sqlite3_tables \
3023 src/cats/make_sqlite3_tables \
3024 src/cats/grant_sqlite3_privileges \
3025 src/cats/drop_sqlite3_tables \
3026 src/cats/drop_sqlite3_database \
3027 src/cats/create_ingres_database \
3028 src/cats/update_ingres_tables \
3029 src/cats/make_ingres_tables \
3030 src/cats/grant_ingres_privileges \
3031 src/cats/drop_ingres_tables \
3032 src/cats/drop_ingres_database \
3035 src/cats/create_bdb_database \
3036 src/cats/update_bdb_tables \
3037 src/cats/make_bdb_tables \
3038 src/cats/grant_bdb_privileges \
3039 src/cats/drop_bdb_tables \
3040 src/cats/drop_bdb_database \
3041 src/cats/create_bacula_database \
3042 src/cats/update_bacula_tables \
3043 src/cats/grant_bacula_privileges \
3044 src/cats/make_bacula_tables \
3045 src/cats/drop_bacula_tables \
3046 src/cats/drop_bacula_database \
3047 src/findlib/Makefile \
3048 src/tools/Makefile \
3049 src/plugins/fd/Makefile \
3050 src/plugins/sd/Makefile \
3051 src/plugins/dir/Makefile \
3052 src/win32/Makefile.inc \
3054 updatedb/update_mysql_tables_9_to_10 \
3055 updatedb/update_sqlite3_tables_9_to_10 \
3056 updatedb/update_postgresql_tables_9_to_10 \
3057 updatedb/update_mysql_tables_10_to_11 \
3058 updatedb/update_sqlite3_tables_10_to_11 \
3059 updatedb/update_postgresql_tables_10_to_11 \
3060 examples/nagios/check_bacula/Makefile \
3065 if test "${support_bat}" = "yes" ; then
3066 if test "x$QMAKE" = "xnone" && test "x$QMAKEQT4" = "xnone"; then
3067 AC_MSG_ERROR([Could not find qmake or qmake-qt4 in $PATH. Check your Qt installation])
3072 if test "x$QMAKEQT4" != "xnone"; then
3077 echo "Creating bat Makefile"
3086 dnl if CC is gcc, we can rebuild the dependencies (since the depend rule
3087 dnl requires gcc). If it's not, don't rebuild dependencies
3089 if test X"$GCC" = "Xyes" ; then
3090 echo "Doing make of dependencies"
3091 ${MAKE:-make} depend
3095 chmod 755 install_conf_file build-depkgs-qt-console
3099 chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
3100 chmod 755 dvd-handler dvd-simulator
3101 chmod 755 bconsole gconsole mtx-changer devel_bacula logrotate
3105 chmod 755 $c/update_mysql_tables_10_to_11 $c/update_sqlite3_tables_10_to_11
3106 chmod 755 $c/update_postgresql_tables_10_to_11
3110 chmod 755 $c/create_bacula_database $c/update_bacula_tables $c/make_bacula_tables
3111 chmod 755 $c/grant_bacula_privileges $c/drop_bacula_tables $c/drop_bacula_database
3113 chmod 755 $c/create_bdb_database $c/update_bdb_tables $c/make_bdb_tables
3114 chmod 755 $c/grant_bdb_privileges $c/drop_bdb_tables $c/drop_bdb_database
3116 chmod 755 $c/create_mysql_database $c/update_mysql_tables $c/make_mysql_tables
3117 chmod 755 $c/grant_mysql_privileges $c/drop_mysql_tables $c/drop_mysql_database
3119 chmod 755 $c/create_sqlite3_database $c/update_sqlite3_tables $c/make_sqlite3_tables
3120 chmod 755 $c/grant_sqlite3_privileges $c/drop_sqlite3_tables $c/drop_sqlite3_database
3122 chmod 755 $c/create_postgresql_database $c/update_postgresql_tables $c/make_postgresql_tables
3123 chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables $c/drop_postgresql_database
3125 chmod 755 $c/create_ingres_database $c/update_ingres_tables $c/make_ingres_tables
3126 chmod 755 $c/grant_ingres_privileges $c/drop_ingres_tables $c/drop_ingres_database
3129 chmod 755 $c/make_catalog_backup $c/delete_catalog_backup $c/make_catalog_backup.pl
3133 chmod 755 src/win32/build-depkgs-mingw32
3135 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
3136 largefile_support="yes"
3139 dnl Only try to find out the version number of the compiler when we know its some kind of GCC compiler
3140 if test X"$GCC" = "Xyes" ; then
3142 dnl A whole lot of hand springs to get the compiler version.
3143 dnl This is because gcc changed the output in version 3.0
3145 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3146 if test "x${CCVERSION}" = "x" ; then
3147 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3149 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3150 if test x"${CXXVERSION}" = x ; then
3151 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3155 # clean up any old junk
3161 if test "x${db_type}" = "xInternal" ; then
3164 echo "You have not specified either --enable-client-only or one of the"
3165 echo " supported databases: MySQL, PostgreSQL, Ingres, SQLite3 or DBI."
3166 echo " This is not permitted. Please reconfigure."
3168 echo "Aborting the configuration ..."
3175 Configuration on `date`:
3177 Host: ${host}${post_host} -- ${DISTNAME} ${DISTVER}
3178 Bacula version: ${BACULA} ${VERSION} (${DATE})
3179 Source code location: ${srcdir}
3180 Install binaries: ${sbindir}
3181 Install libraries: ${libdir}
3182 Install config files: ${sysconfdir}
3183 Scripts directory: ${scriptdir}
3184 Archive directory: ${archivedir}
3185 Working directory: ${working_dir}
3186 PID directory: ${piddir}
3187 Subsys directory: ${subsysdir}
3188 Man directory: ${mandir}
3189 Data directory: ${datarootdir}
3190 Plugin directory: ${plugindir}
3191 C Compiler: ${CC} ${CCVERSION}
3192 C++ Compiler: ${CXX} ${CXXVERSION}
3193 Compiler flags: ${WCFLAGS} ${CFLAGS}
3194 Linker flags: ${WLDFLAGS} ${LDFLAGS}
3196 Statically Linked Tools: ${support_static_tools}
3197 Statically Linked FD: ${support_static_fd}
3198 Statically Linked SD: ${support_static_sd}
3199 Statically Linked DIR: ${support_static_dir}
3200 Statically Linked CONS: ${support_static_cons}
3201 Database type: ${db_type}
3202 Database port: ${db_port}
3203 Database lib: ${DB_LIBS}
3204 Database name: ${db_name}
3205 Database user: ${db_user}
3207 Job Output Email: ${job_email}
3208 Traceback Email: ${dump_email}
3209 SMTP Host Address: ${smtp_host}
3211 Director Port: ${dir_port}
3212 File daemon Port: ${fd_port}
3213 Storage daemon Port: ${sd_port}
3215 Director User: ${dir_user}
3216 Director Group: ${dir_group}
3217 Storage Daemon User: ${sd_user}
3218 Storage DaemonGroup: ${sd_group}
3219 File Daemon User: ${fd_user}
3220 File Daemon Group: ${fd_group}
3222 SQL binaries Directory ${SQL_BINDIR}
3224 Large file support: $largefile_support
3225 Bacula conio support: ${got_conio} ${CONS_LIBS}
3226 readline support: ${got_readline} ${PRTREADLINE_SRC}
3227 TCP Wrappers support: ${TCPW_MSG} ${WRAPLIBS}
3228 TLS support: ${support_tls}
3229 Encryption support: ${support_crypto}
3230 ZLIB support: ${have_zlib}
3231 enable-smartalloc: ${support_smartalloc}
3232 enable-lockmgr: ${support_lockmgr}
3233 bat support: ${support_bat}
3234 enable-gnome: ${support_gnome} ${gnome_version}
3235 enable-bwx-console: ${support_wx_console} ${wx_version}
3236 enable-tray-monitor: ${support_tray_monitor}
3237 client-only: ${build_client_only}
3238 build-dird: ${build_dird}
3239 build-stored: ${build_stored}
3240 Plugin support: ${have_plugins}
3241 ACL support: ${have_acl}
3242 XATTR support: ${have_xattr}
3243 Python support: ${support_python} ${PYTHON_LIBS}
3244 Batch insert enabled: ${support_batch_insert}
3248 # create a small shell script useful for support with
3249 # configure options and config.out info
3250 cat > scripts/bacula_config << EOF
3253 $ $0 $ac_configure_args
3255 cat config.out >> scripts/bacula_config
3256 echo __EOC__ >> scripts/bacula_config
3257 chmod 755 scripts/bacula_config
3261 # Display a warning message if postgresql client lib is <= 8.1
3262 if test x$DB_TYPE = xpostgresql -a x$ac_cv_lib_pq_PQisthreadsafe != xyes \
3263 -a x$support_batch_insert = xyes
3265 echo "WARNING: Your PostgreSQL client library is too old to detect "
3266 echo " if it was compiled with --enable-thread-safety, consider to"
3267 echo " upgrade it in order to avoid problems with Batch insert mode"