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(QMAKEQT4, qmake-qt4, none)
94 AC_PATH_PROG(GMAKE, gmake, none)
95 AC_ARG_VAR(WXCONFIG, [wx-config command. On some systems, you must set it to wx-config-2.6 to use wxWidgets 2.6.])
96 if test "x$WXCONFIG" = x; then
99 AC_PATH_PROG(WXCONFIG, ${WXCONFIG}, ${WXCONFIG})
100 AC_ARG_VAR(WXFLAGS, [Parameters to pass to wx-config (e.g. --unicode=no).])
101 AC_PATH_PROG(CDRECORD, cdrecord, cdrecord)
102 AC_PATH_PROG(PIDOF, pidof, pidof)
104 # Some AWK programs fail, so test it and warn the user
105 if echo xfoo | $AWK 'BEGIN { prog=ARGV[1]; ARGC=1 }
106 { if ((prog == $2) || (("(" prog ")") == $2) ||
107 (("[" prog "]") == $2) ||
108 ((prog ":") == $2)) { print $1 ; exit 0 } }' xfoo>/dev/null; then :;
110 AC_MSG_ERROR([!!!!!!!!! WARNING !!!!!!!!!!!!!!
111 The regex engine of $AWK is too broken to be used you
112 might want to install GNU AWK.
113 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!])
116 AC_PATH_PROG(AWK, $THE_AWK, $THE_AWK)
119 test -n "$ARFLAG" || ARFLAGS="cr"
126 AC_SUBST(LOCAL_CFLAGS)
127 AC_SUBST(LOCAL_LDFLAGS)
130 dnl --------------------------------------------------
132 dnl --------------------------------------------------
134 AC_ARG_ENABLE(libtool,
135 AC_HELP_STRING([--enable-libtool], [enable building using GNU libtool @<:@default=yes@:>@]),
137 if test x$enableval = xno; then
142 LT_INIT([shared disable-static])
145 if test x$use_libtool != xno; then
146 DEFAULT_OBJECT_TYPE=".lo"
147 DEFAULT_ARCHIVE_TYPE=".la"
148 DEFAULT_SHARED_OBJECT_TYPE=".la"
149 LIBTOOL="\$(LIBTOOL)"
150 LIBTOOL_INSTALL_TARGET="libtool-install"
151 LIBTOOL_UNINSTALL_TARGET="libtool-uninstall"
152 LIBTOOL_CLEAN_TARGET="libtool-clean"
153 QMAKE_LIBTOOL="${BUILD_DIR}/libtool"
154 FD_PLUGIN_DIR="src/plugins/fd"
157 DEFAULT_OBJECT_TYPE=".o"
158 DEFAULT_ARCHIVE_TYPE=".a"
159 DEFAULT_SHARED_OBJECT_TYPE=".so"
160 LIBTOOL="# \$(LIBTOOL)"
161 LIBTOOL_INSTALL_TARGET=""
162 LIBTOOL_UNINSTALL_TARGET=""
163 LIBTOOL_CLEAN_TARGET=""
164 QMAKE_LIBTOOL="# ${BUILD_DIR}/libtool"
169 AC_SUBST(DEFAULT_OBJECT_TYPE)
170 AC_SUBST(DEFAULT_ARCHIVE_TYPE)
171 AC_SUBST(DEFAULT_SHARED_OBJECT_TYPE)
173 AC_SUBST(LIBTOOL_INSTALL_TARGET)
174 AC_SUBST(LIBTOOL_UNINSTALL_TARGET)
175 AC_SUBST(LIBTOOL_CLEAN_TARGET)
176 AC_SUBST(QMAKE_LIBTOOL)
177 AC_SUBST(FD_PLUGIN_DIR)
179 dnl --------------------------------------------------
180 dnl Include file handling
181 dnl --------------------------------------------------
182 AC_ARG_ENABLE(includes,
183 AC_HELP_STRING([--enable-includes], [enable installing of include files @<:@default=no@:>@]),
185 if test x$enableval = xyes; then
191 dnl It only makes sense to install include files when you install libraries which only happens when
192 dnl libtool is enabled
194 if test x$use_libtool != xno -a x$install_includes = xyes; then
195 INCLUDE_INSTALL_TARGET="install-includes"
196 INCLUDE_UNINSTALL_TARGET="uninstall-includes"
198 INCLUDE_INSTALL_TARGET=""
199 INCLUDE_UNINSTALL_TARGET=""
201 AC_SUBST(INCLUDE_INSTALL_TARGET)
202 AC_SUBST(INCLUDE_UNINSTALL_TARGET)
204 dnl --------------------------------------------------
205 dnl Bacula OP Sys determination (see aclocal.m4)
206 dnl --------------------------------------------------
209 dnl -----------------------------------------------------------
210 dnl Bacula OPSys Distribution determination (see aclocal.m4)
211 dnl ----------------------------------------------------------
212 BA_CHECK_OPSYS_DISTNAME
214 dnl --------------------------------------------------
215 dnl Suppport for gettext (translations)
216 dnl By default, $datarootdir is ${prefix}/share
217 dnl --------------------------------------------------
218 AM_GNU_GETTEXT([external])
220 dnl ------------------------------------------------------------------
221 dnl If the user has not set --prefix, we set our default to nothing.
222 dnl In this case, if the user has not set --sysconfdir, we set it
223 dnl to the package default of /etc/bacula. If either --prefix or
224 dnl --sysconfdir is set, we leave sysconfdir alone except to eval it.
225 dnl If the user has not set --libdir, we set it to the package
226 dnl default of /usr/lib. If either --prefix or --libdir is set,
227 dnl we leave libdir alone except to eval it. If the user has not set
228 dnl --includedir, we set it to the package default of /usr/include.
229 dnl If either --prefix or --includedir is set, we leave includedir
230 dnl alone except to eval it
231 dnl ------------------------------------------------------------------
232 os_name=`uname -s 2>/dev/null`
233 if test x${prefix} = xNONE ; then
234 if test `eval echo ${sysconfdir}` = NONE/etc ; then
235 sysconfdir=/etc/bacula
238 if test `eval echo ${libdir}` = NONE/lib ; then
241 os_processor=`uname -p 2>/dev/null`
242 case ${os_processor} in
257 if test `eval echo ${includedir}` = NONE/include ; then
258 includedir=/usr/include
261 if test `eval echo ${datarootdir}` = NONE/share ; then
262 datarootdir=/usr/share
267 dnl -------------------------------------------------------------------------
268 dnl If the user has not set --exec-prefix, we default to ${prefix}
269 dnl -------------------------------------------------------------------------
270 if test x${exec_prefix} = xNONE ; then
271 exec_prefix=${prefix}
274 sysconfdir=`eval echo ${sysconfdir}`
275 datarootdir=`eval echo ${datarootdir}`
276 docdir=`eval echo ${docdir}`
277 htmldir=`eval echo ${htmldir}`
278 libdir=`eval echo ${libdir}`
279 includedir=`eval echo ${includedir}`
280 localedir=`eval echo ${datarootdir}/locale`
281 AC_DEFINE_UNQUOTED(SYSCONFDIR, "$sysconfdir")
282 AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir")
284 dnl ------------------------------------------------------------------
285 dnl If the user has not set --sbindir, we set our default as /sbin
286 dnl ------------------------------------------------------------------
287 if test x$sbindir = x'${exec_prefix}/sbin' ; then
288 sbindir=${exec_prefix}/sbin
290 sbindir=`eval echo ${sbindir}`
292 dnl -------------------------------------------------------------------------
293 dnl If the user has not set --mandir, we default to /usr/share/man
294 dnl -------------------------------------------------------------------------
295 if test x$mandir = x'${prefix}/man' ; then
296 mandir=/usr/share/man
299 dnl -------------------------------------------------------------------------
300 dnl If the user has not set --htmldir, we default to /usr/share/doc/bacula/html
301 dnl -------------------------------------------------------------------------
302 if test x$htmldir = x${docdir} ; then
303 htmldir=`eval echo ${docdir}bacula/html`
306 dnl -------------------------------------------------------------------------
307 dnl If the user has not set --docdir, we default to /usr/share/doc/
308 dnl -------------------------------------------------------------------------
309 if test x$docdir = x'/usr/share/doc/' ; then
310 docdir=`eval echo ${docdir}bacula`
314 AC_PATH_PROGS(MSGFMT, msgfmt, no)
315 if test "$MSGFMT" = "no"
317 echo 'msgfmt program not found, disabling NLS !'
319 USE_INCLUDED_LIBINTL=no
327 support_postgresql=no
330 support_smartalloc=yes
335 support_wx_console=no
336 support_tray_monitor=no
341 support_static_tools=no
344 support_static_dir=no
345 support_static_cons=no
355 dnl --------------------------------------------------------------------------
356 dnl CHECKING COMMAND LINE OPTIONS
357 dnl --------------------------------------------------------------------------
359 dnl -------------------------------------------
360 dnl gnome (default off)
361 dnl -------------------------------------------
363 AC_HELP_STRING([--enable-gnome], [enable build of bgnome-console GUI @<:@default=no@:>@]),
365 if test x$enableval = xyes; then
372 if test x$support_gnome = xyes; then
373 AC_MSG_ERROR(bgnome-console no longer supported)
374 AC_MSG_ERROR(--enable-gnome option no longer supported)
376 # AC_SUBST(GNOME_DIR)
378 dnl -------------------------------------------
379 dnl bat (default off)
380 dnl -------------------------------------------
382 AC_HELP_STRING([--enable-bat], [enable build of bat Qt4 GUI @<:@default=no@:>@]),
384 if test x$enableval = xyes; then
385 AC_DEFINE(HAVE_BAT, 1, [Set if Bacula bat Qt4 GUI support enabled])
392 if test x$support_bat = xyes; then
393 abc=`$PKGCONFIG --atleast-version=4.2 QtGui`
395 if test $pkg = 0; then
396 BAT_DIR=src/qt-console
398 AC_MSG_ERROR(Unable to find Qt4 installation needed by bat)
403 dnl The qwt library was used with bat, but that is no longer the case
411 dnl if test x$support_bat = xyes; then
412 dnl AC_MSG_CHECKING(for qwt support)
414 dnl AC_HELP_STRING([--with-qwt@<:@=DIR@:>@], [specify qwt library directory]),
416 dnl case "$with_qwt" in
421 dnl if test -f ${with_qwt}/include/qwt.h; then
422 dnl QWT_INC="${with_qwt}/include"
423 dnl QWT_LDFLAGS="-L${with_qwt}/lib"
433 dnl dnl Search in standard places, or --with-qwt not specified
435 dnl if test $no_qwt = no; then
436 dnl if test x$QWT_INC = x; then
437 dnl for root in /usr /usr/local; do
438 dnl for ver in qwt qwt5 qwt-qt4; do
439 dnl if test -f ${root}/include/${ver}/qwt.h; then
440 dnl QWT_INC="${root}/include/${ver}"
441 dnl if test -d ${root}/lib64/; then
442 dnl QWT_LDFLAGS="-L${root}/lib64"
443 dnl elif test -d ${root}/lib/64/; then
444 dnl QWT_LDFLAGS="-L${root}/64"
446 dnl QWT_LDFLAGS="-L${root}/lib"
457 dnl if test x$QWT_INC = x; then
458 dnl AC_MSG_RESULT(no)
460 dnl AC_DEFINE(HAVE_QWT, 1, [Set if bat QWT library found])
461 dnl AC_MSG_RESULT(yes)
467 AC_SUBST(QWT_LDFLAGS)
471 dnl -------------------------------------------
472 dnl bwx-console (default off)
473 dnl -------------------------------------------
474 AC_ARG_ENABLE(bwx-console,
475 AC_HELP_STRING([--enable-bwx-console], [enable build of wxWidgets console @<:@default=no@:>@]),
477 if test x$enableval = xyes; then
478 support_wx_console=yes
484 if test x$support_wx_console = xyes; then
485 abc=`$WXCONFIG $WXFLAGS --cppflags`
487 if test $pkg = 0; then
488 wx_version="wxWidgets `$WXCONFIG $WXFLAGS --release`"
489 WXCONS_CPPFLAGS=`$WXCONFIG $WXFLAGS --cppflags`
490 WXCONS_LDFLAGS=`$WXCONFIG $WXFLAGS --libs`
492 AC_SUBST(WXCONS_CPPFLAGS)
493 AC_SUBST(WXCONS_LDFLAGS)
494 WX_DIR="src/wx-console"
497 echo "wx-config program not found. bwx-console disabled."
499 support_wx_console=no
504 dnl -------------------------------------------
505 dnl tray-monitor (default off)
506 dnl -------------------------------------------
507 AC_ARG_ENABLE(tray-monitor,
508 AC_HELP_STRING([--enable-tray-monitor], [enable build of Gnome tray monitor (compatible with KDE @<:@default=no@:>@]),
510 if test x$enableval = xyes; then
511 support_tray_monitor=yes
517 if test x$support_tray_monitor = xyes; then
518 abc=`$PKGCONFIG --exists gtk+-2.0`
520 if test $pkg = 0; then
521 TRAY_MONITOR_CPPFLAGS=`$PKGCONFIG --cflags gtk+-2.0`
522 TRAY_MONITOR_LDFLAGS=`$PKGCONFIG --libs gtk+-2.0`
523 AC_SUBST(TRAY_MONITOR_CPPFLAGS)
524 AC_SUBST(TRAY_MONITOR_LDFLAGS)
525 TRAY_MONITOR_DIR=src/tray-monitor
526 abc=`$PKGCONFIG --atleast-version=2.4 gtk+-2.0`
528 if test $pkg = 0; then
529 AC_DEFINE(HAVE_GTK_2_4, 1, [Set if you have GTK 4.2 or greater loaded])
533 AC_SUBST(TRAY_MONITOR_DIR)
535 dnl -------------------------------------------
536 dnl smartalloc (default off)
537 dnl -------------------------------------------
538 AC_ARG_ENABLE(smartalloc,
539 AC_HELP_STRING([--enable-smartalloc], [enable smartalloc debugging support @<:@default=no@:>@]),
541 if test x$enableval = xno; then
542 support_smartalloc=no
547 if test x$support_smartalloc = xyes; then
548 AC_DEFINE(SMARTALLOC, 1, [Set if you want Smartalloc enabled])
551 dnl -------------------------------------------
552 dnl Lock Manager (default off)
553 dnl -------------------------------------------
554 AC_ARG_ENABLE(lockmgr,
555 AC_HELP_STRING([--enable-lockmgr], [enable lock manager support @<:@default=no@:>@]),
557 if test x$enableval = xyes; then
563 if test x$support_lockmgr = xyes; then
564 AC_DEFINE(_USE_LOCKMGR, 1, [Set if you want Lock Manager enabled])
568 dnl -------------------------------------------
569 dnl static-tools (default off)
570 dnl -------------------------------------------
571 AC_ARG_ENABLE(static-tools,
572 AC_HELP_STRING([--enable-static-tools], [enable static tape tools @<:@default=no@:>@]),
574 if test x$enableval = xyes; then
575 if test x$use_libtool = xyes; then
576 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
577 please rerun configure with --disable-libtool])
579 support_static_tools=yes
585 if test x$support_static_tools = xyes; then
586 TTOOL_LDFLAGS="-static"
588 AC_SUBST(TTOOL_LDFLAGS)
590 dnl -------------------------------------------
591 dnl static-fd (default off)
592 dnl -------------------------------------------
593 AC_ARG_ENABLE(static-fd,
594 AC_HELP_STRING([--enable-static-fd], [enable static File daemon @<:@default=no@:>@]),
596 if test x$enableval = xyes; then
597 if test x$use_libtool = xyes; then
598 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
599 please rerun configure with --disable-libtool])
601 support_static_fd=yes
607 if test x$support_static_fd = xyes; then
608 STATIC_FD="static-bacula-fd"
612 dnl -------------------------------------------
613 dnl static-sd (default off)
614 dnl -------------------------------------------
615 AC_ARG_ENABLE(static-sd,
616 AC_HELP_STRING([--enable-static-sd], [enable static Storage daemon @<:@default=no@:>@]),
618 if test x$enableval = xyes; then
619 if test x$use_libtool = xyes; then
620 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
621 please rerun configure with --disable-libtool])
623 support_static_sd=yes
629 if test x$support_static_sd = xyes; then
630 STATIC_SD="static-bacula-sd"
634 dnl -------------------------------------------
635 dnl static-dir (default off)
636 dnl -------------------------------------------
637 AC_ARG_ENABLE(static-dir,
638 AC_HELP_STRING([--enable-static-dir], [enable static Director @<:@default=no@:>@]),
640 if test x$enableval = xyes; then
641 if test x$use_libtool = xyes; then
642 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
643 please rerun configure with --disable-libtool])
645 support_static_dir=yes
651 if test x$support_static_dir = xyes; then
652 STATIC_DIR="static-bacula-dir"
656 dnl -------------------------------------------
657 dnl static-cons (default off)
658 dnl -------------------------------------------
659 AC_ARG_ENABLE(static-cons,
660 AC_HELP_STRING([--enable-static-cons], [enable static Console @<:@default=no@:>@]),
662 if test x$enableval = xyes; then
663 if test x$use_libtool = xyes; then
664 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
665 please rerun configure with --disable-libtool])
667 support_static_cons=yes
675 if test x$support_static_cons = xyes; then
676 STATIC_CONS="static-bconsole"
677 STATIC_GNOME_CONS="static-bgnome-console"
678 STATIC_WX_CONS="static-bwx-console"
680 AC_SUBST(STATIC_CONS)
681 AC_SUBST(STATIC_GNOME_CONS)
682 AC_SUBST(STATIC_WX_CONS)
684 dnl -------------------------------------------
685 dnl client_only (default off)
686 dnl -------------------------------------------
687 AC_ARG_ENABLE(client-only,
688 AC_HELP_STRING([--enable-client-only], [build client (File daemon) only @<:@default=no@:>@]),
690 if test x$enableval = xyes; then
691 build_client_only=yes
697 if test x$build_client_only = xno; then
704 dnl -------------------------------------------
705 dnl director (default on)
706 dnl -------------------------------------------
707 AC_ARG_ENABLE(build-dird,
708 AC_HELP_STRING([--enable-build-dird], [enable building of dird (Director) @<:@default=yes@:>@]),
710 if test x$enableval = xno; then
715 if test x$build_dird = xyes; then
720 DIR_TOOLS="NODIRTOOLS"
725 dnl -------------------------------------------
726 dnl stored (default on)
727 dnl -------------------------------------------
728 AC_ARG_ENABLE(build-stored,
729 AC_HELP_STRING([--enable-build-stored], [enable building of stored (Storage daemon) @<:@default=yes@:>@]),
731 if test x$enableval = xno; then
736 if test x$build_stored = xyes; then
737 STORED_DIR="src/stored"
743 dnl ---------------------------------------------------
744 dnl Check for conio (Bacula readline substitute)(
745 dnl ---------------------------------------------------
746 dnl this allows you to turn it completely off
748 AC_HELP_STRING([--disable-conio], [disable conio support @<:@default=no@:>@]),
750 if test x$enableval = xno; then
757 dnl ---------------------------------------------------
758 dnl Check for IPv6 support
759 dnl ---------------------------------------------------
760 dnl this allows you to turn it completely off
763 AC_HELP_STRING([--enable-ipv6], [enable ipv6 support @<:@default=yes@:>@]),
765 if test x$enableval = xno; then
771 if test x$support_ipv6 = xyes; then
772 AC_TRY_LINK([ #include <sys/types.h>
773 #include <sys/socket.h>
774 #include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;],
775 [support_ipv6=yes], [support_ipv6=no])
778 if test x$support_ipv6 = xyes; then
779 AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
783 if test x$support_conio = xyes; then
784 AC_CHECK_HEADER(termcap.h,
785 [ AC_CHECK_LIB(termcap, tgetent,
786 [ CONS_LIBS="-ltermcap"
791 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
793 [ AC_CHECK_LIB(ncurses, tgetent,
794 [ CONS_LIBS="-lncurses"
799 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
804 AC_CHECK_HEADERS(curses.h)
805 AC_CHECK_HEADER(term.h,
806 [ AC_CHECK_LIB(curses, tgetent,
807 [ CONS_LIBS="-lcurses"
812 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
815 [ echo " "; echo "Required libraries not found. CONIO turned off ..."; echo " "],
824 dnl ---------------------------------------------------
825 dnl Check for readline support/directory (default off)
826 dnl ---------------------------------------------------
827 dnl this allows you to turn it completely off
828 AC_ARG_ENABLE(readline,
829 AC_HELP_STRING([--disable-readline], [disable readline support @<:@default=yes@:>@]),
831 if test x$enableval = xno; then
839 if test x$support_readline = xyes; then
840 AC_ARG_WITH(readline,
841 AC_HELP_STRING([--with-readline@<:@=DIR@:>@], [specify readline library directory]),
843 case "$with_readline" in
848 if test -f ${with_readline}/readline.h; then
849 CONS_INC="-I${with_readline}"
850 CONS_LDFLAGS="-L$with_readline"
851 elif test -f ${with_readline}/include/readline/readline.h; then
852 CONS_INC="-I${with_readline}/include/readline"
853 CONS_LDFLAGS="-L${with_readline}/lib"
854 with_readline="${with_readline}/include/readline"
856 with_readline="/usr/include/readline"
859 AC_CHECK_HEADER(${with_readline}/readline.h,
861 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
862 CONS_LIBS="-lreadline -lhistory -ltermcap"
866 echo "readline.h not found. readline turned off ..."
873 dnl check for standard readline library
874 AC_CHECK_HEADER(/usr/include/readline/readline.h,
876 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
878 CONS_INC="-I/usr/include/readline"
879 CONS_LIBS="-lreadline -ltermcap"
881 dnl Did not find standard library, so try Bacula's default
882 AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h,
884 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
886 CONS_INC="-I${TOP_DIR}/depkgs/readline"
887 CONS_LIBS="-lreadline -lhistory -ltermcap"
888 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
889 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
892 echo "readline.h not found. readline turned off ..."
906 AC_SUBST(CONS_LDFLAGS)
907 AC_SUBST(READLINE_SRC)
909 dnl Minimal stuff for readline Makefile configuration
914 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr lstat lchown)
915 AC_CHECK_FUNCS(nanosleep nl_langinfo)
916 AC_CHECK_HEADERS(varargs.h)
918 dnl End of readline/conio stuff
919 dnl -----------------------------------------------------------------------
921 dnl -----------------------------------------------------------------------
922 dnl Check for Python support
924 AC_MSG_CHECKING(for Python support)
926 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.]),
930 if test "$withval" != "no"; then
931 if test "$withval" = "yes"; then
932 if test -e /usr/bin/python-config ; then
933 PYTHON_INCDIR=`/usr/bin/python-config --includes`
934 PYTHON_LIBS=`/usr/bin/python-config --libs`
936 for python_root in /usr /usr/local /usr/sfw; do
937 for ver in python2.2 python2.3 python2.4 python2.5 python2.6 python3; do
938 if test -f $python_root/include/${ver}/Python.h; then
939 PYTHON_INCDIR=-I$python_root/include/${ver}
940 if test -d $python_root/lib64/${ver}/config; then
941 PYTHON_LIBS="-L$python_root/lib64/${ver}/config -l${ver}"
943 PYTHON_LIBS="-L$python_root/lib/${ver}/config -l${ver}"
950 if test x$PYTHON_INCDIR = x; then
951 if test -f $prefix/include/Python.h; then
952 PYTHON_INCDIR=-I$prefix/include
953 if test -d $prefix/lib64/config; then
954 PYTHON_LIBS="-L$prefix/lib64/config -lpython"
956 PYTHON_LIBS="-L$prefix/lib/config -lpython"
960 AC_MSG_ERROR(Unable to find Python.h in standard locations)
965 if test -e $withval/bin/python-config ; then
966 PYTHON_INCDIR=`$withval/bin/python-config --includes`
967 PYTHON_LIBS=`$withval/bin/python-config --libs`
968 elif test -f $withval/Python.h; then
969 PYTHON_INCDIR=-I$withval
970 PYTHON_LIBS="-L$withval/config -lpython"
971 elif test -f $withval/include/Python.h; then
972 PYTHON_INCDIR=-I$withval/include
973 if test -d $withval/lib64/config; then
974 PYTHON_LIBS="-L$withval/lib64/config -lpython"
976 PYTHON_LIBS="-L$withval/lib/config -lpython"
978 elif test -f $withval/include/python/Python.h; then
979 PYTHON_INCDIR=-I$withval/include/python
980 if test -d $withval/lib64/python/config; then
981 PYTHON_LIBS="-L$withval/lib64/python/config -lpython"
983 PYTHON_LIBS="-L$withval/lib/python/config -lpython"
987 AC_MSG_ERROR(Invalid Python directory $withval - unable to find Python.h under $withval)
991 AC_DEFINE([HAVE_PYTHON], 1)
994 AC_MSG_NOTICE(checking for more Python libs)
995 saved_LIBS="$LIBS"; LIBS=
996 AC_SEARCH_LIBS(shm_open, [rt])
997 AC_CHECK_LIB(util, openpty)
998 PYTHON_LIBS="$PYTHON_LIBS $LIBS"
1007 AC_SUBST(PYTHON_LIBS)
1008 AC_SUBST(PYTHON_INCDIR)
1011 dnl Find where sockets are (especially for Solaris)
1012 dnl Do this before the TCP Wrappers test since tcp wrappers
1013 dnl uses the socket library and some linkers are stupid.
1015 AC_CHECK_FUNC(socket,
1016 AC_MSG_RESULT(using libc's socket),
1017 AC_CHECK_LIB(xnet,socket)
1018 AC_CHECK_LIB(socket,socket)
1019 AC_CHECK_LIB(inet,socket))
1021 dnl -----------------------------------------------------------
1022 dnl Check whether user wants TCP wrappers support (default off)
1023 dnl -----------------------------------------------------------
1026 AC_ARG_WITH(tcp-wrappers,
1027 AC_HELP_STRING([--with-tcp-wrappers@<:@=DIR@:>@], [enable tcpwrappers support]),
1029 if test "x$withval" != "xno" ; then
1031 LIBS="$saved_LIBS -lwrap"
1032 AC_SEARCH_LIBS(nanosleep, [rt])
1033 AC_MSG_CHECKING(for libwrap)
1036 #include <sys/types.h>
1038 int deny_severity = 0;
1039 int allow_severity = 0;
1040 struct request_info *req;
1045 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
1050 LIBS="$saved_LIBS -lwrap -lnsl"
1051 WRAPLIBS="$saved_LIBS -lwrap -lnsl"
1054 #include <sys/types.h>
1056 int deny_severity = 0;
1057 int allow_severity = 0;
1058 struct request_info *req;
1063 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
1068 AC_MSG_ERROR([*** libwrap missing])
1077 dnl -----------------------------------------------------------
1078 dnl Check whether OpenSSL is available
1079 dnl -----------------------------------------------------------
1080 AC_MSG_CHECKING([for OpenSSL])
1081 dnl The following uses quadrigraphs:
1084 AC_ARG_WITH(openssl,
1085 AC_HELP_STRING([--with-openssl@<:@=DIR@:>@], [Include OpenSSL support. DIR is the OpenSSL base]),
1087 with_openssl_directory=${withval}
1091 if test "x$with_openssl_directory" != "xno"; then
1092 OPENSSL_LIBS="-lssl -lcrypto"
1095 if test "x$with_openssl_directory" != "xyes" && test x"${with_openssl_directory}" != "x"; then
1097 # Make sure the $with_openssl_directory also makes sense
1099 if test -d "$with_openssl_directory/lib" -a -d "$with_openssl_directory/include"; then
1100 OPENSSL_LIBS="-L$with_openssl_directory/lib $OPENSSL_LIBS"
1101 OPENSSL_INC="-I$with_openssl_directory/include $OPENSSL_INC"
1105 saved_LIBS="${LIBS}"
1106 saved_CFLAGS="${CFLAGS}"
1107 LIBS="${saved_LIBS} ${OPENSSL_LIBS}"
1108 CFLAGS="${saved_CFLAGS} ${OPENSSL_INC}"
1112 #include <openssl/ssl.h>
1114 CRYPTO_set_id_callback(NULL);
1117 support_crypto="yes"
1126 #include <openssl/evp.h>
1130 ac_cv_openssl_sha2="yes"
1132 ac_cv_openssl_sha2="no"
1136 dnl Solaris disables greater than 128+ bit encryption in their OpenSSL
1137 dnl implementation, presumably for export reasons. If 192bit AES
1138 dnl is available, we assume that we're running with a 'non-export'
1139 dnl openssl library.
1142 #include <openssl/evp.h>
1146 ac_cv_openssl_export="no"
1148 ac_cv_openssl_export="yes"
1152 LIBS="${saved_LIBS}"
1153 CFLAGS="${saved_CFLAGS}"
1155 if test "$support_tls" = "yes"; then
1156 AC_DEFINE(HAVE_OPENSSL, 1, [Define if OpenSSL library is available])
1157 AC_DEFINE(HAVE_TLS, 1, [Define if TLS support should be enabled])
1158 AC_DEFINE(HAVE_CRYPTO, 1, [Define if encryption support should be enabled])
1161 if test "$ac_cv_openssl_sha2" = "yes"; then
1162 AC_DEFINE(HAVE_SHA2, 1, [Define if the SHA-2 family of digest algorithms is available])
1165 if test "$ac_cv_openssl_export" = "yes"; then
1166 AC_DEFINE(HAVE_OPENSSL_EXPORT_LIBRARY, 1, [Define if the OpenSSL library is export-contrained to 128bit ciphers])
1175 if test "$support_tls" = "no"; then
1179 if test "$support_crypto" = "no"; then
1184 AC_MSG_RESULT([$support_tls])
1185 AC_SUBST(OPENSSL_LIBS)
1186 AC_SUBST(OPENSSL_INC)
1188 dnl -----------------------------------------------------------
1189 dnl dlopen is needed for plugins
1190 dnl -----------------------------------------------------------
1191 AC_SEARCH_LIBS(dlopen, [dl])
1193 dnl ------------------------------------------
1194 dnl Where to place working dir
1195 dnl ------------------------------------------
1196 working_dir=`eval echo ${prefix}/var/bacula/working`
1197 AC_ARG_WITH(working-dir,
1198 AC_HELP_STRING([--with-working-dir=PATH], [specify path of Bacula working directory]),
1200 if test "x$withval" != "xno" ; then
1201 working_dir=$withval
1206 AC_SUBST(working_dir)
1208 dnl ------------------------------------------------------------------
1209 dnl If the user has not set archivedir, we set our default as /tmp
1210 dnl ------------------------------------------------------------------
1212 AC_ARG_WITH(archivedir,
1213 AC_HELP_STRING([--with-archivedir=PATH], [specify path of SD archive directory]),
1215 if test "x$withval" != "xno" ; then
1221 AC_SUBST(archivedir)
1223 dnl ------------------------------------------------------------------
1224 dnl Allow the user to specify the daemon resource name default hostname
1225 dnl ------------------------------------------------------------------
1227 AC_ARG_WITH(basename,
1228 AC_HELP_STRING([--with-basename=RESNAME], [specify base resource name for daemons]),
1230 if test "x$withval" != "xno" ; then
1238 dnl ------------------------------------------------------------------
1239 dnl Allow the user to override the hostname (default = machine hostname)
1240 dnl ------------------------------------------------------------------
1241 hostname=`uname -n | cut -d '.' -f 1`
1242 if test x${hostname} = x ; then
1243 hostname="localhost"
1245 AC_ARG_WITH(hostname,
1246 AC_HELP_STRING([--with-hostname=RESNAME], [specify host name for daemons]),
1248 if test "x$withval" != "xno" ; then
1257 dnl ------------------------------------------
1258 dnl Where to place scriptdir (script files)
1259 dnl ------------------------------------------
1260 scriptdir=`eval echo ${sysconfdir}`
1261 AC_ARG_WITH(scriptdir,
1262 AC_HELP_STRING([--with-scriptdir=PATH], [specify path of Bacula scripts directory]),
1264 if test "x$withval" != "xno" ; then
1273 dnl ------------------------------------------
1274 dnl Where to place bsrdir (bsr files)
1275 dnl ------------------------------------------
1278 AC_HELP_STRING([--with-bsrdir=PATH], [specify path of Bacula bsrs directory]),
1280 if test "x$withval" != "xno" ; then
1288 dnl ------------------------------------------
1289 dnl Where to place logdir (bsr files)
1290 dnl ------------------------------------------
1293 AC_HELP_STRING([--with-logdir=PATH], [specify path of Bacula logs directory]),
1295 if test "x$withval" != "xno" ; then
1304 # ------------------------------------------
1305 # Where to place plugindir (plugin files)
1306 # ------------------------------------------
1307 plugindir=`eval echo ${libdir}`
1308 AC_ARG_WITH(plugindir,
1309 AC_HELP_STRING([--with-plugindir=PATH], [specify path of Bacula plugins directory]),
1311 if test "x$withval" != "xno" ; then
1319 dnl ------------------------------------------
1320 dnl Where to send dump email
1321 dnl ------------------------------------------
1322 dump_email=root@localhost
1323 AC_ARG_WITH(dump-email,
1324 AC_HELP_STRING([--with-dump-email=EMAIL], [dump email address]),
1326 if test "x$withval" != "xno" ; then
1332 AC_SUBST(dump_email)
1334 dnl ------------------------------------------
1335 dnl Where to send job email
1336 dnl ------------------------------------------
1337 job_email=root@localhost
1338 AC_ARG_WITH(job-email,
1339 AC_HELP_STRING([--with-job-email=EMAIL], [job output email address]),
1341 if test "x$withval" != "xno" ; then
1349 dnl ------------------------------------------
1350 dnl Where to find smtp host
1351 dnl ------------------------------------------
1353 AC_ARG_WITH(smtp_host,
1354 AC_HELP_STRING([--with-smtp-host=HOST], [SMTP mail host address]),
1356 if test "x$withval" != "xno" ; then
1364 dnl ------------------------------------
1365 dnl Where to place pid files
1366 dnl ------------------------------------
1368 AC_ARG_WITH(pid-dir,
1369 AC_HELP_STRING([--with-pid-dir=PATH], [specify location of Bacula pid files]),
1371 if test "x$withval" != "xno" ; then
1377 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
1380 dnl ------------------------------------
1381 dnl Where to place subsys "lock file"
1382 dnl ------------------------------------
1383 subsysdir=/var/run/subsys
1384 if test -d /var/run/subsys; then
1385 subsysdir=/var/run/subsys
1386 elif test -d /var/lock/subsys; then
1387 subsysdir=/var/lock/subsys
1389 subsysdir=/var/run/subsys
1391 AC_ARG_WITH(subsys-dir,
1392 AC_HELP_STRING([--with-subsys-dir=PATH], [specify location of Bacula subsys file]),
1394 if test "x$withval" != "xno" ; then
1402 dnl ------------------------------------
1403 dnl Where to start assigning ports
1404 dnl ------------------------------------
1406 AC_ARG_WITH(baseport,
1407 AC_HELP_STRING([--with-baseport=PORT], [specify base port address for daemons]),
1409 if test "x$withval" != "xno" ; then
1416 dir_port=`expr $baseport`
1417 fd_port=`expr $baseport + 1`
1418 sd_port=`expr $fd_port + 1`
1424 dnl ------------------------------------------
1425 dnl Generate passwords
1426 dnl ------------------------------------------
1428 AC_ARG_WITH(dir-password,
1429 AC_HELP_STRING([--with-dir-password=PASSWORD], [specify Director's password]),
1431 if test "x$withval" != "xno" ; then
1432 dir_password=$withval
1437 if test "x$dir_password" = "x" ; then
1438 if test "x$OPENSSL" = "xnone" ; then
1439 key=`autoconf/randpass 33`
1441 key=`openssl rand -base64 33`
1447 AC_ARG_WITH(fd-password,
1448 AC_HELP_STRING([--with-fd-password=PASSWORD], [specify Client's password]),
1450 if test "x$withval" != "xno" ; then
1451 fd_password=$withval
1456 if test "x$fd_password" = "x" ; then
1457 if test "x$OPENSSL" = "xnone" ; then
1458 key=`autoconf/randpass 37`
1460 key=`openssl rand -base64 33`
1466 AC_ARG_WITH(sd-password,
1467 AC_HELP_STRING([--with-sd-password=PASSWORD], [specify Storage daemon's password]),
1469 if test "x$withval" != "xno" ; then
1470 sd_password=$withval
1475 if test "x$sd_password" = "x" ; then
1476 if test "x$OPENSSL" = "xnone" ; then
1477 key=`autoconf/randpass 41`
1479 key=`openssl rand -base64 33`
1485 AC_ARG_WITH(mon-dir-password,
1486 AC_HELP_STRING([--with-mon-dir-password=PASSWORD], [specify Director's password used by the monitor]),
1488 if test "x$withval" != "xno" ; then
1489 mon_dir_password=$withval
1494 if test "x$mon_dir_password" = "x" ; then
1495 if test "x$OPENSSL" = "xnone" ; then
1496 key=`autoconf/randpass 33`
1498 key=`openssl rand -base64 33`
1500 mon_dir_password=$key
1504 AC_ARG_WITH(mon-fd-password,
1505 AC_HELP_STRING([--with-mon-fd-password=PASSWORD], [specify Client's password used by the monitor]),
1507 if test "x$withval" != "xno" ; then
1508 mon_fd_password=$withval
1513 if test "x$mon_fd_password" = "x" ; then
1514 if test "x$OPENSSL" = "xnone" ; then
1515 key=`autoconf/randpass 37`
1517 key=`openssl rand -base64 33`
1519 mon_fd_password=$key
1523 AC_ARG_WITH(mon-sd-password,
1524 AC_HELP_STRING([--with-mon-sd-password=PASSWORD], [specify Storage daemon's password used by the monitor]),
1526 if test "x$withval" != "xno" ; then
1527 mon_sd_password=$withval
1532 if test "x$mon_sd_password" = "x" ; then
1533 if test "x$OPENSSL" = "xnone" ; then
1534 key=`autoconf/randpass 41`
1536 key=`openssl rand -base64 33`
1538 mon_sd_password=$key
1541 AC_SUBST(dir_password)
1542 AC_SUBST(fd_password)
1543 AC_SUBST(sd_password)
1544 AC_SUBST(mon_dir_password)
1545 AC_SUBST(mon_fd_password)
1546 AC_SUBST(mon_sd_password)
1549 dnl Pickup any database name
1552 AC_ARG_WITH(db_name,
1553 AC_HELP_STRING([--with-db-name=DBNAME], [specify database name @<:@default=bacula@:>@]),
1555 if test "x$withval" != "x" ; then
1563 AC_ARG_WITH(db_user,
1564 AC_HELP_STRING([--with-db-user=UNAME], [specify database user @<:@default=bacula@:>@]),
1566 if test "x$withval" != "x" ; then
1574 AC_ARG_WITH(db_password,
1575 AC_HELP_STRING([--with-db-password=PWD], [specify database password @<:@default=*none*@:>@]),
1577 if test "x$withval" != "x" ; then
1578 db_password=$withval
1582 AC_SUBST(db_password)
1585 dnl Pickup a database port
1588 AC_ARG_WITH(db_port,
1589 AC_HELP_STRING([--with-db-port=DBPORT], [specify a database port @<:@default=null@:>@]),
1591 if test "x$withval" != "x" ; then
1599 # Handle users and groups for each daemon
1602 AC_ARG_WITH(dir_user,
1603 AC_HELP_STRING([--with-dir-user=USER], [specify user for Director daemon]),
1605 if test "x$withval" != "x" ; then
1612 AC_ARG_WITH(dir_group,
1613 AC_HELP_STRING([--with-dir-group=GROUP], [specify group for Director daemon]),
1615 if test "x$withval" != "x" ; then
1622 AC_ARG_WITH(sd_user,
1623 AC_HELP_STRING([--with-sd-user=USER], [specify user for Storage daemon]),
1625 if test "x$withval" != "x" ; then
1632 AC_ARG_WITH(sd_group,
1633 AC_HELP_STRING([--with-sd-group=GROUP], [specify group for Storage daemon]),
1635 if test "x$withval" != "x" ; then
1642 AC_ARG_WITH(fd_user,
1643 AC_HELP_STRING([--with-fd-user=USER], [specify user for File daemon]),
1645 if test "x$withval" != "x" ; then
1652 AC_ARG_WITH(fd_group,
1653 AC_HELP_STRING([--with-fd-group=GROUP], [specify group for File daemon]),
1655 if test "x$withval" != "x" ; then
1669 dnl allow setting default executable permissions
1672 AC_ARG_WITH(sbin-perm,
1673 AC_HELP_STRING([--with-sbin-perm=MODE], [specify permissions for sbin binaries @<:@default=0754@:>@]),
1675 if test "x$withval" != "x" ; then
1683 dnl ------------------------------------------------
1684 dnl Bacula check for various SQL database engines
1685 dnl ------------------------------------------------
1687 BA_CHECK_POSTGRESQL_DB
1695 # BA_CHECK_SQLITE_DB
1704 dnl -------------------------------------------
1705 dnl enable batch attribute DB insert (default on)
1706 dnl -------------------------------------------
1707 support_batch_insert=no
1708 A=`test -f $SQL_LIB && nm $SQL_LIB | grep pthread_mutex_lock`
1710 if test $pkg = 0; then
1711 support_batch_insert=yes
1712 AC_ARG_ENABLE(batch-insert,
1713 AC_HELP_STRING([--enable-batch-insert], [enable the DB batch insert code @<:@default=no@:>@]),
1715 if test x$enableval = xno; then
1716 support_batch_insert=no
1718 support_batch_insert=yes
1724 dnl Check if postgresql can support batch mode
1725 if test x$DB_TYPE = xpostgresql; then
1726 AC_CHECK_LIB(pq, PQisthreadsafe, AC_DEFINE(HAVE_PQISTHREADSAFE, 1, [Set if have PQisthreadsafe]))
1727 AC_CHECK_LIB(pq, PQputCopyData, AC_DEFINE(HAVE_PQ_COPY, 1, [Set if have PQputCopyData]))
1728 if test "x$ac_cv_lib_pq_PQputCopyData" != "xyes"
1730 support_batch_insert=no
1734 if test x$DB_TYPE = xdbi; then
1738 dnl Check for batch insert
1739 if test $DB_PROG = postgresql; then
1740 AC_CHECK_LIB(pq, PQisthreadsafe, AC_DEFINE(HAVE_PQISTHREADSAFE))
1741 AC_CHECK_LIB(pq, PQputCopyData, AC_DEFINE(HAVE_PQ_COPY))
1742 test "x$ac_cv_lib_pq_PQputCopyData" != "xyes"
1746 if test $DB_PROG = mysql; then
1747 A=`test -f $SQL_LIB && nm $DB_PROG_LIB | grep pthread_mutex_lock`
1751 if test $DB_PROG = sqlite3; then
1752 A=`test -f $SQL_LIB && nm $DB_PROG_LIB | grep pthread_mutex_lock`
1756 if test $pkg = 0; then
1757 AC_ARG_ENABLE(batch-insert,
1758 AC_HELP_STRING([--enable-batch-insert], [enable the DB batch insert code @<:@default=no@:>@]),
1760 if test x$enableval = xno; then
1761 support_batch_insert=no
1763 support_batch_insert=yes
1769 dnl If dbi was not chosen, let the comment in file
1773 AC_SUBST(uncomment_dbi)
1775 if test $support_batch_insert = yes ; then
1776 AC_DEFINE(HAVE_BATCH_FILE_INSERT, 1, [Set if DB batch insert code enabled])
1779 AC_DEFINE(PROTOTYPES)
1781 dnl --------------------------------------------------------------------------
1782 dnl Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
1784 if test -z "$CFLAGS" -o "$CFLAGS" = "-g -O2"; then
1785 if test -z "$CCOPTS"; then
1786 CCOPTS='-g -O2 -Wall'
1794 dnl See if we can use 64 bit file addresses
1795 largefile_support="no"
1800 dnl --------------------------------------------------------------------------
1801 dnl CHECKING FOR HEADER FILES
1802 dnl --------------------------------------------------------------------------
1840 AC_STRUCT_ST_BLKSIZE
1844 dnl --------------------------------------------------------------------------
1845 dnl Check for utime.h structure
1846 dnl --------------------------------------------------------------------------
1847 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
1851 #include <sys/types.h>
1856 ba_cv_header_utime_h=yes
1858 ba_cv_header_utime_h=no
1863 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H, 1, [Set if utime.h exists])
1865 dnl --------------------------------------------------------------------------
1866 dnl Check for socklen_t
1867 dnl --------------------------------------------------------------------------
1868 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
1872 #include <sys/types.h>
1873 #include <sys/socket.h>
1877 ba_cv_header_socklen_t=yes
1879 ba_cv_header_socklen_t=no
1884 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T, 1, [Set if socklen_t exists])
1886 dnl --------------------------------------------------------------------------
1887 dnl Check for ioctl request type
1888 dnl --------------------------------------------------------------------------
1890 AC_CACHE_CHECK(for ioctl_req_t, ba_cv_header_ioctl_req_t,
1895 #include <sys/types.h>
1896 #include <sys/ioctl.h>
1898 int (*d_ioctl)(int fd, unsigned long int request, ...);
1901 ba_cv_header_ioctl_req_t=yes
1903 ba_cv_header_ioctl_req_t=no
1908 test $ba_cv_header_ioctl_req_t = yes && AC_DEFINE(HAVE_IOCTL_ULINT_REQUEST, 1, [Set if ioctl request is unsigned long int])
1910 dnl Note: it is more correct to use AC_LANG(C++) but some of the older
1911 dnl *BSD systems still use old style C prototypes, which are wrong with
1912 dnl compiled with a C++ compiler.
1915 dnl --------------------------------------------------------------------------
1916 dnl Check for typeof()
1917 dnl --------------------------------------------------------------------------
1919 AC_CACHE_CHECK(for typeof, ba_cv_have_typeof,
1923 main(){char *a = 0; a = (typeof a)a;}
1925 ba_cv_have_typeof=yes
1927 ba_cv_have_typeof=no
1929 ba_cv_have_typeof=no
1934 test $ba_cv_have_typeof = yes && AC_DEFINE([HAVE_TYPEOF], 1, [Defind to 1 if compiler has typeof])
1939 dnl --------------------------------------------------------------------------
1940 dnl CHECKING FOR FILESYSTEM TYPE
1941 dnl --------------------------------------------------------------------------
1942 AC_MSG_CHECKING(how to get filesystem type)
1944 # The order of these tests is important.
1947 #include <sys/statvfs.h>
1948 #include <sys/fstyp.h>
1950 AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4
1952 if test $fstype = no; then
1955 #include <sys/statfs.h>
1956 #include <sys/fstyp.h>
1958 AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3
1961 if test $fstype = no; then
1964 #include <sys/statfs.h>
1965 #include <sys/vmount.h>
1967 AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX
1970 if test $fstype = no; then
1975 AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD
1978 if test $fstype = no; then
1979 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
1981 if test $fstype = no; then
1984 #include <sys/mount.h>
1985 #include <sys/fs_types.h>
1987 AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix
1990 AC_MSG_RESULT($fstype)
1992 AC_CHECK_HEADER(sys/statvfs.h, [ AC_DEFINE(HAVE_SYS_STATVFS_H,1,[Defines if your system have the sys/statvfs.h header file])] , )
1994 dnl --------------------------------------------------------------------------
1995 dnl CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
1996 dnl --------------------------------------------------------------------------
2006 AC_CHECK_TYPE(ino_t, unsigned long)
2007 AC_CHECK_TYPE(dev_t, unsigned long)
2008 AC_CHECK_TYPE(daddr_t, long)
2009 AC_CHECK_TYPE(major_t, int)
2010 AC_CHECK_TYPE(minor_t, int)
2011 AC_CHECK_TYPE(ssize_t, int)
2017 AC_CHECK_SIZEOF(char, 1)
2018 AC_CHECK_SIZEOF(short int, 2)
2019 AC_CHECK_SIZEOF(int, 4)
2020 AC_CHECK_SIZEOF(long int, 4)
2021 AC_CHECK_SIZEOF(long long int, 8)
2022 AC_CHECK_SIZEOF(int *, 4)
2024 dnl Check for sys/types.h types
2025 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int,
2029 #include <sys/types.h>
2033 ac_cv_have_u_int="yes"
2035 ac_cv_have_u_int="no"
2040 if test "x$ac_cv_have_u_int" = "xyes" ; then
2041 AC_DEFINE(HAVE_U_INT)
2045 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t,
2049 #include <sys/types.h>
2053 ac_cv_have_intmax_t="yes"
2061 ac_cv_have_intmax_t="yes"
2063 ac_cv_have_intmax_t="no"
2070 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
2071 AC_DEFINE(HAVE_INTMAX_T)
2075 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t,
2079 #include <sys/types.h>
2081 u_intmax_t a; a = 1;
2083 ac_cv_have_u_intmax_t="yes"
2089 u_intmax_t a; a = 1;
2091 ac_cv_have_u_intmax_t="yes"
2093 ac_cv_have_u_intmax_t="no"
2100 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
2101 AC_DEFINE(HAVE_U_INTMAX_T)
2105 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t,
2109 #include <sys/types.h>
2111 int8_t a; int16_t b; int32_t c; a = b = c = 1;
2113 ac_cv_have_intxx_t="yes"
2115 ac_cv_have_intxx_t="no"
2120 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
2121 AC_DEFINE(HAVE_INTXX_T)
2125 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t,
2129 #include <sys/types.h>
2133 ac_cv_have_int64_t="yes"
2135 ac_cv_have_int64_t="no"
2140 if test "x$ac_cv_have_int64_t" = "xyes" ; then
2141 AC_DEFINE(HAVE_INT64_T)
2145 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t,
2149 #include <sys/types.h>
2151 u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;
2153 ac_cv_have_u_intxx_t="yes"
2155 ac_cv_have_u_intxx_t="no"
2160 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
2161 AC_DEFINE(HAVE_U_INTXX_T)
2165 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t,
2169 #include <sys/types.h>
2173 ac_cv_have_u_int64_t="yes"
2175 ac_cv_have_u_int64_t="no"
2180 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
2181 AC_DEFINE(HAVE_U_INT64_T)
2185 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
2186 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2188 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
2191 #include <sys/bitypes.h>
2193 int8_t a; int16_t b; int32_t c;
2194 u_int8_t e; u_int16_t f; u_int32_t g;
2195 a = b = c = e = f = g = 1;
2197 AC_DEFINE(HAVE_U_INTXX_T)
2198 AC_DEFINE(HAVE_INTXX_T)
2199 AC_DEFINE(HAVE_SYS_BITYPES_H)
2207 if test -z "$have_u_intxx_t" ; then
2208 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t,
2212 #include <sys/types.h>
2214 uint8_t a; uint16_t b;
2215 uint32_t c; a = b = c = 1;
2217 ac_cv_have_uintxx_t="yes"
2219 ac_cv_have_uintxx_t="no"
2224 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
2225 AC_DEFINE(HAVE_UINTXX_T)
2229 if (test -z "$have_u_int64_t" || test -z "$have_int64_t" && \
2230 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2232 AC_MSG_CHECKING([for int64_t and u_int64_t types in sys/bitypes.h])
2235 #include <sys/bitypes.h>
2237 int64_t a; u_int64_t b;
2240 AC_DEFINE(HAVE_U_INT64_T)
2241 AC_DEFINE(HAVE_INT64_T)
2249 if (test -z "$have_uintxx_t" && \
2250 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2252 AC_MSG_CHECKING([for uintXX_t types in sys/bitypes.h])
2255 #include <sys/bitypes.h>
2257 uint8_t a; uint16_t b;
2258 uint32_t c; a = b = c = 1;
2260 AC_DEFINE(HAVE_UINTXX_T)
2268 dnl --------------------------------------------------------------------------
2269 dnl CHECKING FOR REQUIRED LIBRARY FUNCTIONS
2270 dnl --------------------------------------------------------------------------
2286 [echo 'configure: cannot find needed function.'; exit 1]
2289 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
2290 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
2291 AC_CHECK_FUNCS(posix_fadvise)
2292 AC_CHECK_FUNCS(fdatasync)
2294 AC_CHECK_FUNCS(chflags)
2296 AC_CHECK_FUNCS(snprintf vsnprintf gethostid fseeko)
2298 AC_CACHE_CHECK(for va_copy, ba_cv_va_copy,
2303 void use_va_copy(va_list args){va_list args2; va_copy(args2,args); va_end(args2);}
2304 void call_use_va_copy(int junk,...){va_list args; va_start(args,junk); use_va_copy(args); va_end(args);}
2306 call_use_va_copy(1,2,3)
2315 test $ba_cv_va_copy = yes && AC_DEFINE(HAVE_VA_COPY, 1, [Set if va_copy exists])
2317 dnl --------------------------------------------------------------------------
2318 dnl CHECKING FOR THREAD SAFE FUNCTIONS
2319 dnl --------------------------------------------------------------------------
2320 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
2322 # If resolver functions are not in libc check for -lnsl or -lresolv.
2323 AC_CHECK_FUNC(gethostbyname_r,
2324 AC_MSG_RESULT(using libc's resolver),
2325 AC_CHECK_LIB(nsl,gethostbyname_r)
2326 AC_CHECK_LIB(resolv,gethostbyname_r))
2328 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
2329 AC_CHECK_FUNCS(inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)])
2330 AC_CHECK_FUNCS(gethostbyname2, [AC_DEFINE(HAVE_GETHOSTBYNAME2)])
2332 dnl ----------------------------
2333 dnl check sa_len of sockaddr
2334 dnl ----------------------------
2335 AC_CACHE_CHECK(for struct sockaddr has a sa_len field, ac_cv_struct_sockaddr_sa_len,
2339 #include <sys/socket.h>
2341 struct sockaddr s; s.sa_len;
2343 ac_cv_struct_sockaddr_sa_len=yes
2344 ], [ac_cv_struct_sockaddr_sa_len=no
2350 if test $ac_cv_struct_sockaddr_sa_len = yes; then
2351 AC_DEFINE(HAVE_SA_LEN, 1, [Define if sa_len field exists in struct sockaddr])
2358 AC_FUNC_CLOSEDIR_VOID
2359 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
2360 # AC_FUNC_FNMATCH dnl use local version
2362 AC_CHECK_LIB(intl, gettext, [LIBS="$LIBS -lintl"])
2364 AC_CHECK_LIB(sun, getpwnam)
2366 AC_CHECK_HEADERS(zlib.h)
2367 AC_CHECK_LIB(z, deflate, [FDLIBS="-lz"])
2369 if test x$FDLIBS = x-lz; then
2370 AC_DEFINE(HAVE_LIBZ)
2375 dnl Check for ACL support and libraries
2379 AC_HELP_STRING([--disable-acl], [disable acl support @<:@default=auto@:>@]),
2381 if test x$enableval = xyes; then
2383 elif test x$enableval = xno; then
2390 have_extended_acl=no
2391 if test x$support_acl = xyes -o x$support_acl = xauto; then
2392 AC_CHECK_HEADER(sys/acl.h, [ AC_DEFINE(HAVE_SYS_ACL_H,1,[Defines if your system have the sys/acl.h header file])] , )
2393 AC_CHECK_FUNC(acl_get_file,
2397 AC_CHECK_LIB(acl, acl_get_file,
2400 FDLIBS="-lacl $FDLIBS"
2402 AC_CHECK_LIB(pacl, acl_get_file,
2405 FDLIBS="-lpacl $FDLIBS"
2407 AC_CHECK_LIB(sec, acltotext,
2410 FDLIBS="-lsec $FDLIBS"
2412 AC_CHECK_LIB(sec, acl_totext,
2414 have_extended_acl=yes
2426 if test x$support_acl = xyes -a $have_acl != yes; then
2427 AC_MSG_ERROR([acl support explicitly enabled but no supported acl implementation found,
2428 please either load the acl libraries or rerun configure without --enable-acl])
2430 if test $have_acl = yes; then
2431 AC_DEFINE([HAVE_ACL],1,[Normal acl support])
2434 if test $have_extended_acl = yes; then
2435 AC_DEFINE([HAVE_EXTENDED_ACL],1,[Extended acl support])
2441 dnl Check for XATTR support
2444 AC_ARG_ENABLE(xattr,
2445 AC_HELP_STRING([--disable-xattr], [disable xattr support @<:@default=auto@:>@]),
2447 if test x$enableval = xyes; then
2449 elif test x$enableval = xno; then
2456 if test x$support_xattr = xyes -o x$support_xattr = xauto; then
2458 dnl First check for *BSD support
2460 AC_CHECK_HEADER(sys/extattr.h, [ AC_DEFINE(HAVE_SYS_EXTATTR_H,1,[Defines if your system have the sys/extattr.h header file])] , )
2461 AC_CHECK_HEADER(libutil.h, [ AC_DEFINE(HAVE_LIBUTIL_H,1,[Defines if your system have the libutil.h header file])] , )
2462 AC_CHECK_FUNCS(extattr_get_link extattr_set_link extattr_list_link,
2465 AC_DEFINE([HAVE_EXTATTR_GET_LINK],1,[Define to 1 if you have the 'extattr_get_link' function.])
2466 AC_DEFINE([HAVE_EXTATTR_SET_LINK],1,[Define to 1 if you have the 'extattr_set_link' function.])
2467 AC_DEFINE([HAVE_EXTATTR_LIST_LINK],1,[Define to 1 if you have the 'extattr_list_link' function.])
2471 if test $have_xattr = no; then
2472 AC_CHECK_FUNCS(extattr_get_file extattr_set_file extattr_list_file,
2475 AC_DEFINE([HAVE_EXTATTR_GET_FILE],1,[Define to 1 if you have the 'extattr_get_file' function.])
2476 AC_DEFINE([HAVE_EXTATTR_SET_FILE],1,[Define to 1 if you have the 'extattr_set_file' function.])
2477 AC_DEFINE([HAVE_EXTATTR_LIST_FILE],1,[Define to 1 if you have the 'extattr_list_file' function.])
2482 if test $have_xattr = yes; then
2483 have_extattr_string_in_libc=no
2484 AC_CHECK_FUNCS(extattr_namespace_to_string extattr_string_to_namespace,
2486 have_extattr_string_in_libc=yes
2487 AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2488 AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2493 dnl If extattr_namespace_to_string and extattr_string_to_namespace are not in libc see if they are in libutil
2495 if test $have_extattr_string_in_libc = no; then
2496 AC_CHECK_LIB(util, extattr_namespace_to_string extattr_string_to_namespace,
2498 AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2499 AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2500 FDLIBS="-lutil $FDLIBS"
2507 dnl If we failed to find *BSD support try the Linux or OSX implementation of xattr
2509 if test $have_xattr = no; then
2510 AC_CHECK_HEADER(sys/xattr.h, [ AC_DEFINE(HAVE_SYS_XATTR_H,1,[Defines if your system have the sys/xattr.h header file])] , )
2511 AC_CHECK_FUNCS(llistxattr lgetxattr lsetxattr,
2514 AC_DEFINE([HAVE_LLISTXATTR],1,[Define to 1 if you have the 'llistxattr' function.])
2515 AC_DEFINE([HAVE_LGETXATTR],1,[Define to 1 if you have the 'lgetxattr' function.])
2516 AC_DEFINE([HAVE_LSETXATTR],1,[Define to 1 if you have the 'lsetxattr' function.])
2520 if test $have_xattr = no; then
2521 AC_CHECK_FUNCS(listxattr getxattr setxattr,
2524 AC_DEFINE([HAVE_LISTXATTR],1,[Define to 1 if you have the 'listxattr' function.])
2525 AC_DEFINE([HAVE_GETXATTR],1,[Define to 1 if you have the 'getxattr' function.])
2526 AC_DEFINE([HAVE_SETXATTR],1,[Define to 1 if you have the 'setxattr' function.])
2533 dnl If we failed to find *BSD support and the Linux or OSX implementation of xattr try the Solaris xattr implementation
2535 if test $have_xattr = no; then
2536 AC_CHECK_HEADER(sys/attr.h, [ AC_DEFINE(HAVE_SYS_ATTR_H,1,[Defines if your system have the sys/attr.h header file])] , )
2537 AC_CHECK_HEADER(sys/nvpair.h, [ AC_DEFINE(HAVE_SYS_NVPAIR_H,1,[Defines if your system have the sys/nvpair.h header file])] , )
2538 AC_CHECK_HEADER(attr.h, [ AC_DEFINE(HAVE_ATTR_H,1,[Defines if your system have the attr.h header file])] , )
2540 AC_CHECK_FUNCS(openat fstatat unlinkat fchownat futimesat,
2543 AC_DEFINE([HAVE_OPENAT],1,[Define to 1 if you have the 'openat' function.])
2544 AC_DEFINE([HAVE_FSTATAT],1,[Define to 1 if you have the 'fstatat' function.])
2545 AC_DEFINE([HAVE_UNLINKAT],1,[Define to 1 if you have the 'unlinkat' function.])
2546 AC_DEFINE([HAVE_FCHOWNAT],1,[Define to 1 if you have the 'fchownat' function.])
2547 AC_DEFINE([HAVE_FUTIMESAT],1,[Define to 1 if you have the 'futimesat' function.])
2551 if test $have_xattr = yes; then
2552 AC_CHECK_LIB(nvpair, nvlist_next_nvpair,
2554 AC_DEFINE([HAVE_NVLIST_NEXT_NVPAIR],1,[Define to 1 if you have the 'nvlist_next_nvpair' function.])
2555 FDLIBS="-lnvpair $FDLIBS"
2561 if test x$support_xattr = xyes -a $have_xattr != yes; then
2562 AC_MSG_ERROR([xattr support explicitly enabled but no supported xattr implementation found,
2563 please either load the xattr libraries or rerun configure without --enable-xattr])
2565 if test $have_xattr = yes; then
2566 AC_DEFINE([HAVE_XATTR],1,[Extended Attributes support])
2572 dnl Check for pthread libraries
2575 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
2577 AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
2579 AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
2581 AC_CHECK_FUNC(pthread_create)
2590 dnl Check for headers, functions and libraries required to support
2591 dnl keeping readall capabilities
2593 AC_CHECK_HEADERS(sys/prctl.h sys/capability.h)
2594 AC_CHECK_FUNCS(prctl setreuid)
2595 AC_CHECK_LIB([cap], [cap_set_proc], [CAP_LIBS="-lcap"], [CAP_LIBS=])
2596 if test x$CAP_LIBS = x-lcap; then
2597 AC_DEFINE(HAVE_LIBCAP, 1, [Define if you have libcap])
2606 if test x$have_gcc = xyes ; then
2607 CPPFLAGS="$CPPFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
2608 CFLAGS="$CFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
2610 LDFLAGS=${LDFLAGS--O}
2611 DB_LIBS="${SQL_LFLAGS}"
2612 CPPFLAGS="$CPPFLAGS"
2625 AC_SUBST(X_EXTRA_LIBS)
2630 dnl extra configurable objects
2641 dnl Finally we set appropriate distribution specific
2642 dnl variables and defaults
2644 dnl PFILES are platform specific files
2645 PFILES="platforms/Makefile"
2650 hostname=`uname -n | cut -d '.' -f 1`
2651 if test x${hostname} = x ; then
2652 hostname="localhost"
2654 dnl Make sure hostname is resolved
2655 ping -c 1 $hostname 2>/dev/null 1>/dev/null
2656 if test ! $? = 0; then
2657 hostname="localhost"
2663 PSCMD="ps -e -o pid,comm"
2665 platforms/aix/Makefile"
2666 TAPEDRIVE="/dev/rmt0.1"
2670 PTHREAD_LIB="-lpthread -lexc"
2671 if test "${CC}" = "gcc" ; then
2678 TAPEDRIVE="/dev/nrmt0"
2681 DISTVER=`uname -a |awk '{print $3}'`
2682 TAPEDRIVE="/dev/nrmt0"
2683 PTHREAD_LIB="-pthread"
2684 CFLAGS="${CFLAGS} -pthread"
2685 PSCMD="ps -ax -o pid,command"
2689 platforms/bsdi/Makefile \
2690 platforms/bsdi/bacula-fd \
2691 platforms/bsdi/bacula-sd \
2692 platforms/bsdi/bacula-dir"
2693 largefile_support="yes"
2696 DISTVER=`uname -a |awk '{print $3}'`
2697 TAPEDRIVE="/dev/nrst0"
2700 WLDFLAGS="-mwindows"
2704 TAPEDRIVE="/dev/nst0"
2705 PSCMD="ps -e -o pid,command"
2708 platforms/darwin/Makefile"
2712 TAPEDRIVE="/dev/nst0"
2713 PSCMD="ps -e -o pid,command"
2716 platforms/osx/Makefile"
2719 if `test -f /etc/apt/sources.list && grep -q ubuntu /etc/apt/sources.list`; then
2722 DISTVER=`cat /etc/debian_version`
2723 if test -f /etc/lsb-release ; then
2725 if test "x$DISTRIB_ID" != "x" ; then
2726 DISTNAME=$DISTRIB_ID
2728 if test "x$DISTRIB_RELEASE" != "x" ; then
2729 DISTVER=$DISTRIB_RELEASE
2732 if test "$DISTNAME" = "Ubuntu" ; then
2735 TAPEDRIVE="/dev/nst0"
2736 PSCMD="ps -e -o pid,command"
2737 if test "$DISTNAME" = "ubuntu" ; then
2739 platforms/ubuntu/Makefile \
2740 platforms/ubuntu/bacula-fd \
2741 platforms/ubuntu/bacula-sd \
2742 platforms/ubuntu/bacula-dir"
2745 platforms/debian/Makefile \
2746 platforms/debian/bacula-fd \
2747 platforms/debian/bacula-sd \
2748 platforms/debian/bacula-dir"
2752 DISTVER=`uname -a |awk '{print $3}'`
2753 VER=`echo $DISTVER | cut -c 1`
2754 if test x$VER = x4 ; then
2755 PTHREAD_LIB="${PTHREAD_LIBS:--pthread}"
2756 CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS:--pthread}"
2760 TAPEDRIVE="/dev/nrsa0"
2761 PSCMD="ps -ax -o pid,command"
2763 platforms/freebsd/Makefile \
2764 platforms/freebsd/bacula-fd \
2765 platforms/freebsd/bacula-sd \
2766 platforms/freebsd/bacula-dir"
2767 largefile_support="yes"
2770 PSCMD="UNIX95=1; ps -e -o pid,comm"
2771 CFLAGS="${CFLAGS} -D_XOPEN_SOURCE_EXTENDED=1"
2773 TAPEDRIVE="/dev/rmt/0hnb"
2774 PTHREAD_LIB="-lpthread"
2775 AC_DEFINE([_INCLUDE_LONGLONG])
2779 TAPEDRIVE="/dev/rmt/0cbn"
2780 PSCMD="ps -e -o pid,comm"
2782 platforms/irix/Makefile \
2783 platforms/irix/bacula-fd \
2784 platforms/irix/bacula-sd \
2785 platforms/irix/bacula-dir"
2788 DISTVER=`uname -a |awk '{print $3}'`
2791 TAPEDRIVE="/dev/nrst0"
2792 PSCMD="ps -ax -o pid,command"
2793 PTHREAD_LIB="-pthread"
2794 CFLAGS="${CFLAGS} -pthread"
2797 DISTVER=`uname -a |awk '{print $3}'`
2800 TAPEDRIVE="/dev/nrst0"
2801 PSCMD="ps -ax -o pid,command"
2802 PTHREAD_LIB="-pthread"
2803 CFLAGS="${CFLAGS} -pthread"
2805 platforms/openbsd/Makefile \
2806 platforms/openbsd/bacula-fd \
2807 platforms/openbsd/bacula-sd \
2808 platforms/openbsd/bacula-dir"
2811 if test -f /etc/whitebox-release ; then
2812 f=/etc/whitebox-release
2814 f=/etc/redhat-release
2816 if test `cat $f | grep release |\
2817 cut -f 3 -d ' '`x = "Enterprise"x ; then
2818 DISTVER="Enterprise "`cat $f | grep release |\
2821 DISTVER=`cat /etc/redhat-release | grep release |\
2824 TAPEDRIVE="/dev/nst0"
2825 PSCMD="ps -e -o pid,command"
2827 platforms/redhat/Makefile \
2828 platforms/redhat/bacula-fd \
2829 platforms/redhat/bacula-sd \
2830 platforms/redhat/bacula-dir
2834 DISTVER=`cat /etc/mandrake-release | grep release |\
2836 TAPEDRIVE="/dev/nst0"
2837 PSCMD="ps -e -o pid,command"
2839 platforms/mandrake/Makefile \
2840 platforms/mandrake/bacula-fd \
2841 platforms/mandrake/bacula-sd \
2842 platforms/mandrake/bacula-dir \
2843 platforms/mandrake/bacula.spec \
2847 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
2848 TAPEDRIVE="/dev/nst0"
2849 PSCMD="ps -e -o pid,command"
2851 platforms/gentoo/Makefile \
2852 platforms/gentoo/bacula-init \
2853 platforms/gentoo/bacula-fd \
2854 platforms/gentoo/bacula-sd \
2855 platforms/gentoo/bacula-dir"
2858 DISTVER=`cat /etc/slackware-version`
2859 TAPEDRIVE="/dev/nst0"
2860 PSCMD="ps -e -o pid,command"
2862 platforms/slackware/Makefile \
2863 platforms/slackware/rc.bacula-fd \
2864 platforms/slackware/rc.bacula-sd \
2865 platforms/slackware/rc.bacula-dir\
2866 platforms/slackware/functions.bacula"
2870 TAPEDRIVE="/dev/rmt/0cbn"
2871 PSCMD="ps -e -o pid,comm"
2873 platforms/solaris/Makefile \
2874 platforms/solaris/bacula-fd \
2875 platforms/solaris/bacula-sd \
2876 platforms/solaris/bacula-dir"
2877 if test x$DISTVER = x5.6 ; then
2878 AC_DEFINE(HAVE_OLD_SOCKOPT)
2880 LIBS="$LIBS -lresolv"
2883 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
2885 TAPEDRIVE="/dev/nst0"
2886 PSCMD="ps -e -o pid,command"
2888 platforms/suse/Makefile \
2889 platforms/suse/bacula-fd \
2890 platforms/suse/bacula-sd \
2891 platforms/suse/bacula-dir \
2892 platforms/suse/bacula \
2893 platforms/suse/bacula.spec"
2898 TAPEDRIVE="/dev/nst0"
2899 PSCMD="ps -e -o pid,command"
2901 platforms/suse/Makefile \
2902 platforms/suse/bacula-fd \
2903 platforms/suse/bacula-sd \
2904 platforms/suse/bacula-dir"
2908 TAPEDRIVE="/dev/nst0"
2911 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
2917 LIBS="$PTHREAD_LIB $LIBS"
2919 AC_DEFINE_UNQUOTED(lld, "$lld")
2920 AC_DEFINE_UNQUOTED(llu, "$llu")
2928 dnl common parts of the Makefile
2929 MCOMMON=./autoconf/Make.common
2930 AC_SUBST_FILE(MCOMMON)
2933 if test "x${subsysdir}" = "x${sbindir}" ; then
2936 echo "You have set both --sbindir and --with-subsys-dir"
2937 echo " equal to: ${subsysdir} "
2938 echo "This is not permitted. Please reconfigure."
2940 echo "Aborting configuration ..."
2946 AC_OUTPUT([autoconf/Make.common \
2949 scripts/startmysql \
2951 scripts/btraceback \
2957 scripts/bacula-ctl-dir \
2958 scripts/bacula-ctl-fd \
2959 scripts/bacula-ctl-sd \
2960 scripts/devel_bacula \
2963 scripts/bacula.desktop.gnome1 \
2964 scripts/bacula.desktop.gnome2 \
2965 scripts/bacula.desktop.gnome1.consolehelper \
2966 scripts/bacula.desktop.gnome2.consolehelper \
2967 scripts/bacula.desktop.gnome1.xsu \
2968 scripts/bacula.desktop.gnome2.xsu \
2969 scripts/bgnome-console.console_apps \
2970 scripts/mtx-changer \
2971 scripts/disk-changer \
2972 scripts/dvd-handler \
2973 scripts/dvd-simulator \
2974 scripts/bacula-tray-monitor.desktop \
2975 scripts/logwatch/Makefile \
2976 scripts/logwatch/logfile.bacula.conf \
2977 scripts/wxconsole.console_apps \
2978 scripts/wxconsole.desktop.consolehelper \
2979 scripts/wxconsole.desktop.xsu \
2980 scripts/bat.desktop \
2981 scripts/bat.desktop.xsu \
2982 scripts/bat.desktop.consolehelper \
2983 scripts/bat.console_apps \
2986 src/console/Makefile \
2987 src/console/bconsole.conf \
2988 src/qt-console/bat.conf \
2989 src/qt-console/bat.pro \
2990 src/qt-console/bat.pro.mingw32 \
2991 src/qt-console/install_conf_file \
2992 src/wx-console/Makefile \
2993 src/wx-console/bwx-console.conf \
2994 src/tray-monitor/Makefile \
2995 src/tray-monitor/tray-monitor.conf \
2997 src/dird/bacula-dir.conf \
2999 src/stored/Makefile \
3000 src/stored/bacula-sd.conf \
3001 src/filed/Makefile \
3002 src/filed/bacula-fd.conf \
3004 src/cats/make_catalog_backup.pl \
3005 src/cats/make_catalog_backup \
3006 src/cats/delete_catalog_backup \
3007 src/cats/create_postgresql_database \
3008 src/cats/update_postgresql_tables \
3009 src/cats/make_postgresql_tables \
3010 src/cats/grant_postgresql_privileges \
3011 src/cats/drop_postgresql_tables \
3012 src/cats/drop_postgresql_database \
3013 src/cats/create_mysql_database \
3014 src/cats/update_mysql_tables \
3015 src/cats/make_mysql_tables \
3016 src/cats/grant_mysql_privileges \
3017 src/cats/drop_mysql_tables \
3018 src/cats/drop_mysql_database \
3019 src/cats/create_sqlite3_database \
3020 src/cats/update_sqlite3_tables \
3021 src/cats/make_sqlite3_tables \
3022 src/cats/grant_sqlite3_privileges \
3023 src/cats/drop_sqlite3_tables \
3024 src/cats/drop_sqlite3_database \
3025 src/cats/create_ingres_database \
3026 src/cats/update_ingres_tables \
3027 src/cats/make_ingres_tables \
3028 src/cats/grant_ingres_privileges \
3029 src/cats/drop_ingres_tables \
3030 src/cats/drop_ingres_database \
3033 src/cats/create_bdb_database \
3034 src/cats/update_bdb_tables \
3035 src/cats/make_bdb_tables \
3036 src/cats/grant_bdb_privileges \
3037 src/cats/drop_bdb_tables \
3038 src/cats/drop_bdb_database \
3039 src/cats/create_bacula_database \
3040 src/cats/update_bacula_tables \
3041 src/cats/grant_bacula_privileges \
3042 src/cats/make_bacula_tables \
3043 src/cats/drop_bacula_tables \
3044 src/cats/drop_bacula_database \
3045 src/findlib/Makefile \
3046 src/tools/Makefile \
3047 src/plugins/fd/Makefile \
3048 src/plugins/sd/Makefile \
3049 src/plugins/dir/Makefile \
3050 src/win32/Makefile.inc \
3052 updatedb/update_mysql_tables_9_to_10 \
3053 updatedb/update_sqlite3_tables_9_to_10 \
3054 updatedb/update_postgresql_tables_9_to_10 \
3055 updatedb/update_mysql_tables_10_to_11 \
3056 updatedb/update_sqlite3_tables_10_to_11 \
3057 updatedb/update_postgresql_tables_10_to_11 \
3058 examples/nagios/check_bacula/Makefile \
3063 if test "${support_bat}" = "yes" ; then
3064 if test "x$QMAKE" = "xnone" && test "x$QMAKEQT4" = "xnone"; then
3065 AC_MSG_ERROR([Could not find qmake or qmake-qt4 in $PATH. Check your Qt installation])
3070 if test "x$QMAKEQT4" != "xnone"; then
3075 echo "Creating bat Makefile"
3084 dnl if CC is gcc, we can rebuild the dependencies (since the depend rule
3085 dnl requires gcc). If it's not, don't rebuild dependencies
3087 if test X"$GCC" = "Xyes" ; then
3088 echo "Doing make of dependencies"
3089 ${MAKE:-make} depend
3093 chmod 755 install_conf_file build-depkgs-qt-console
3097 chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
3098 chmod 755 dvd-handler dvd-simulator
3099 chmod 755 bconsole gconsole mtx-changer devel_bacula logrotate
3103 chmod 755 $c/update_mysql_tables_10_to_11 $c/update_sqlite3_tables_10_to_11
3104 chmod 755 $c/update_postgresql_tables_10_to_11
3108 chmod 755 $c/create_bacula_database $c/update_bacula_tables $c/make_bacula_tables
3109 chmod 755 $c/grant_bacula_privileges $c/drop_bacula_tables $c/drop_bacula_database
3111 chmod 755 $c/create_bdb_database $c/update_bdb_tables $c/make_bdb_tables
3112 chmod 755 $c/grant_bdb_privileges $c/drop_bdb_tables $c/drop_bdb_database
3114 chmod 755 $c/create_mysql_database $c/update_mysql_tables $c/make_mysql_tables
3115 chmod 755 $c/grant_mysql_privileges $c/drop_mysql_tables $c/drop_mysql_database
3117 chmod 755 $c/create_sqlite3_database $c/update_sqlite3_tables $c/make_sqlite3_tables
3118 chmod 755 $c/grant_sqlite3_privileges $c/drop_sqlite3_tables $c/drop_sqlite3_database
3120 chmod 755 $c/create_postgresql_database $c/update_postgresql_tables $c/make_postgresql_tables
3121 chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables $c/drop_postgresql_database
3123 chmod 755 $c/create_ingres_database $c/update_ingres_tables $c/make_ingres_tables
3124 chmod 755 $c/grant_ingres_privileges $c/drop_ingres_tables $c/drop_ingres_database
3127 chmod 755 $c/make_catalog_backup $c/delete_catalog_backup $c/make_catalog_backup.pl
3131 chmod 755 src/win32/build-depkgs-mingw32
3133 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
3134 largefile_support="yes"
3137 dnl Only try to find out the version number of the compiler when we know its some kind of GCC compiler
3138 if test X"$GCC" = "Xyes" ; then
3140 dnl A whole lot of hand springs to get the compiler version.
3141 dnl This is because gcc changed the output in version 3.0
3143 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3144 if test "x${CCVERSION}" = "x" ; then
3145 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3147 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3148 if test x"${CXXVERSION}" = x ; then
3149 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3153 # clean up any old junk
3159 if test "x${db_type}" = "xInternal" ; then
3162 echo "You have not specified either --enable-client-only or one of the"
3163 echo " supported databases: MySQL, PostgreSQL, Ingres, SQLite3 or DBI."
3164 echo " This is not permitted. Please reconfigure."
3166 echo "Aborting the configuration ..."
3173 Configuration on `date`:
3175 Host: ${host}${post_host} -- ${DISTNAME} ${DISTVER}
3176 Bacula version: ${BACULA} ${VERSION} (${DATE})
3177 Source code location: ${srcdir}
3178 Install binaries: ${sbindir}
3179 Install libraries: ${libdir}
3180 Install config files: ${sysconfdir}
3181 Scripts directory: ${scriptdir}
3182 Archive directory: ${archivedir}
3183 Working directory: ${working_dir}
3184 PID directory: ${piddir}
3185 Subsys directory: ${subsysdir}
3186 Man directory: ${mandir}
3187 Data directory: ${datarootdir}
3188 Plugin directory: ${plugindir}
3189 C Compiler: ${CC} ${CCVERSION}
3190 C++ Compiler: ${CXX} ${CXXVERSION}
3191 Compiler flags: ${WCFLAGS} ${CFLAGS}
3192 Linker flags: ${WLDFLAGS} ${LDFLAGS}
3194 Statically Linked Tools: ${support_static_tools}
3195 Statically Linked FD: ${support_static_fd}
3196 Statically Linked SD: ${support_static_sd}
3197 Statically Linked DIR: ${support_static_dir}
3198 Statically Linked CONS: ${support_static_cons}
3199 Database type: ${db_type}
3200 Database port: ${db_port}
3201 Database lib: ${DB_LIBS}
3202 Database name: ${db_name}
3203 Database user: ${db_user}
3205 Job Output Email: ${job_email}
3206 Traceback Email: ${dump_email}
3207 SMTP Host Address: ${smtp_host}
3209 Director Port: ${dir_port}
3210 File daemon Port: ${fd_port}
3211 Storage daemon Port: ${sd_port}
3213 Director User: ${dir_user}
3214 Director Group: ${dir_group}
3215 Storage Daemon User: ${sd_user}
3216 Storage DaemonGroup: ${sd_group}
3217 File Daemon User: ${fd_user}
3218 File Daemon Group: ${fd_group}
3220 SQL binaries Directory ${SQL_BINDIR}
3222 Large file support: $largefile_support
3223 Bacula conio support: ${got_conio} ${CONS_LIBS}
3224 readline support: ${got_readline} ${PRTREADLINE_SRC}
3225 TCP Wrappers support: ${TCPW_MSG} ${WRAPLIBS}
3226 TLS support: ${support_tls}
3227 Encryption support: ${support_crypto}
3228 ZLIB support: ${have_zlib}
3229 enable-smartalloc: ${support_smartalloc}
3230 enable-lockmgr: ${support_lockmgr}
3231 bat support: ${support_bat}
3232 enable-gnome: ${support_gnome} ${gnome_version}
3233 enable-bwx-console: ${support_wx_console} ${wx_version}
3234 enable-tray-monitor: ${support_tray_monitor}
3235 client-only: ${build_client_only}
3236 build-dird: ${build_dird}
3237 build-stored: ${build_stored}
3238 Plugin support: ${have_plugins}
3239 ACL support: ${have_acl}
3240 XATTR support: ${have_xattr}
3241 Python support: ${support_python} ${PYTHON_LIBS}
3242 Batch insert enabled: ${support_batch_insert}
3246 # create a small shell script useful for support with
3247 # configure options and config.out info
3248 cat > scripts/bacula_config << EOF
3251 $ $0 $ac_configure_args
3253 cat config.out >> scripts/bacula_config
3254 echo __EOC__ >> scripts/bacula_config
3255 chmod 755 scripts/bacula_config
3259 # Display a warning message if postgresql client lib is <= 8.1
3260 if test x$DB_TYPE = xpostgresql -a x$ac_cv_lib_pq_PQisthreadsafe != xyes \
3261 -a x$support_batch_insert = xyes
3263 echo "WARNING: Your PostgreSQL client library is too old to detect "
3264 echo " if it was compiled with --enable-thread-safety, consider to"
3265 echo " upgrade it in order to avoid problems with Batch insert mode"