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 require a recent autoconf
19 dnl search for true and false programs.
20 AC_PATH_PROGS(TRUEPRG, true, :)
21 AC_PATH_PROGS(FALSEPRG, false, :)
25 VERSION=`sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
26 DATE=`sed -n -e 's/^.*[ \t]*BDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
27 LSMDATE=`sed -n -e 's/^.*LSMDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
31 echo "configuring for bacula $VERSION ($DATE)"
34 dnl -------------------------------------------------------
35 dnl# Check for compiler.
36 dnl ------------------------------------------------------
40 AC_PROG_CC_C_O dnl Determine if C compiler support -c -o.
41 AC_PROG_GCC_TRADITIONAL dnl Determine if ioctl() need -traditional.
45 if test "x$BASECC" = xgcc; then
49 AC_PATH_PROG(CXX, $CXX, $CXX)
50 if test ! -e $CXX; then
51 AC_MSG_ERROR(Unable to find C++ compiler)
54 dnl -------------------------------------------------------
55 dnl# Check for programs.
56 dnl ------------------------------------------------------
59 AC_PATH_PROG(MV, mv, mv)
60 AC_PATH_PROG(RM, rm, rm)
61 AC_PATH_PROG(CP, cp, cp)
62 AC_PATH_PROG(SED, sed, sed)
63 AC_PATH_PROG(ECHO, echo, echo)
64 AC_PATH_PROG(CMP, cmp, cmp)
65 AC_PATH_PROG(TBL, tbl, tbl)
66 AC_PATH_PROG(AR, ar, ar)
67 dnl AC_PATH_PROG(RANLIB, ranlib, ranlib)
68 AC_PATH_PROG(OPENSSL, openssl, none)
69 AC_PATH_PROG(MTX, mtx, mtx)
70 AC_PATH_PROG(DD, dd, dd)
71 AC_PATH_PROG(MKISOFS, mkisofs, mkisofs)
72 AC_PATH_PROG(PYTHON, python, python)
73 AC_PATH_PROG(GROWISOFS, growisofs, growisofs)
74 AC_PATH_PROG(DVDRWMEDIAINFO, dvd+rw-mediainfo, dvd+rw-mediainfo)
75 AC_PATH_PROG(DVDRWFORMAT, dvd+rw-format, dvd+rw-format)
76 AC_PATH_PROG(PKGCONFIG, pkg-config, pkg-config)
77 AC_PATH_PROG(QMAKE, qmake, none)
78 AC_PATH_PROG(QMAKEQT4, qmake-qt4, none)
79 AC_ARG_VAR(WXCONFIG, [wx-config command. On some systems, you must set it to wx-config-2.6 to use wxWidgets 2.6.])
80 if test "x$WXCONFIG" = x; then
83 AC_PATH_PROG(WXCONFIG, ${WXCONFIG}, ${WXCONFIG})
84 AC_ARG_VAR(WXFLAGS, [Parameters to pass to wx-config (e.g. --unicode=no).])
85 AC_PATH_PROG(CDRECORD, cdrecord, cdrecord)
86 AC_PATH_PROG(PIDOF, pidof, pidof)
88 # Some AWK programs fail, so test it and warn the user
89 if echo xfoo | $AWK 'BEGIN { prog=ARGV[1]; ARGC=1 }
90 { if ((prog == $2) || (("(" prog ")") == $2) ||
91 (("[" prog "]") == $2) ||
92 ((prog ":") == $2)) { print $1 ; exit 0 } }' xfoo>/dev/null; then :;
94 AC_MSG_ERROR([!!!!!!!!! WARNING !!!!!!!!!!!!!!
95 The regex engine of $AWK is too broken to be used you
96 might want to install GNU AWK.
97 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!])
100 AC_PATH_PROG(AWK, $THE_AWK, $THE_AWK)
103 test -n "$ARFLAG" || ARFLAGS="cr"
110 AC_SUBST(LOCAL_CFLAGS)
111 AC_SUBST(LOCAL_LDFLAGS)
114 dnl --------------------------------------------------
115 dnl Bacula OP Sys determination (see aclocal.m4)
116 dnl --------------------------------------------------
119 # -----------------------------------------------------------
120 dnl Bacula OPSys Distribution determination (see aclocal.m4)
121 # ----------------------------------------------------------
122 BA_CHECK_OPSYS_DISTNAME
124 # --------------------------------------------------
125 # Suppport for gettext (translations)
126 # By default, $datadir is ${prefix}/share
127 # --------------------------------------------------
128 AM_GNU_GETTEXT([external])
129 if test x${prefix} = xNONE ; then
130 if test `eval echo ${datadir}` = NONE/share ; then
135 # ------------------------------------------------------------------
136 # If the user has not set --prefix, we set our default to nothing.
137 # In this case, if the user has not set --sysconfdir, we set it
138 # to the package default of /etc/bacula. If either --prefix or
139 # --sysconfdir is set, we leave sysconfdir alone except to eval it.
140 # ------------------------------------------------------------------
141 if test x${prefix} = xNONE ; then
142 if test `eval echo ${sysconfdir}` = NONE/etc ; then
143 sysconfdir=/etc/bacula
147 sysconfdir=`eval echo ${sysconfdir}`
148 datadir=`eval echo ${datadir}`
149 localedir=`eval echo ${datadir}/locale`
150 AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir")
151 AC_DEFINE_UNQUOTED(SYSCONFDIR, "$sysconfdir")
153 # -------------------------------------------------------------------------
154 # If the user has not set --exec-prefix, we default to ${prefix}
155 # -------------------------------------------------------------------------
156 if test x${exec_prefix} = xNONE ; then
157 exec_prefix=${prefix}
160 # ------------------------------------------------------------------
161 # If the user has not set --sbindir, we set our default as /sbin
162 # ------------------------------------------------------------------
163 if test x$sbindir = x'${exec_prefix}/sbin' ; then
164 sbindir=${exec_prefix}/sbin
166 sbindir=`eval echo ${sbindir}`
169 # -------------------------------------------------------------------------
170 # If the user has not set --mandir, we default to /usr/share/man
171 # -------------------------------------------------------------------------
172 if test x$mandir = x'${prefix}/man' ; then
173 mandir=/usr/share/man
177 AC_PATH_PROGS(MSGFMT, msgfmt, no)
178 if test "$MSGFMT" = "no"
180 echo 'msgfmt program not found, disabling NLS !'
182 USE_INCLUDED_LIBINTL=no
190 support_postgresql=no
192 support_smartalloc=yes
197 support_wx_console=no
203 support_static_tools=no
206 support_static_dir=no
207 support_static_cons=no
216 dnl# --------------------------------------------------------------------------
217 dnl# CHECKING COMMAND LINE OPTIONS
218 dnl# --------------------------------------------------------------------------
220 # -------------------------------------------
221 # Berkeley DB (default off)
222 # -------------------------------------------
225 [ --disable-libdb disable build of accurate mode with libdb],
226 [if test x$enableval = xno; then
230 if test x$support_libdb = xyes; then
237 if test x$support_libdb = xyes; then
238 AC_DEFINE(USE_DB, 1, [Set if DB Berkeley is used for accurate backup])
239 AC_SUBST(BDB_CPPFLAGS)
243 # -------------------------------------------
244 # gnome (default off)
245 # -------------------------------------------
247 [ --enable-gnome enable build of bgnome-console GUI [disabled]],
248 [if test x$enableval = xyes; then
253 if test x$support_gnome = xyes; then
254 abc=`$PKGCONFIG --exists libgnomeui-2.0`
256 if test $pkg = 0; then
257 GNOME_INCLUDEDIR=`$PKGCONFIG --cflags-only-I libgnomeui-2.0`
258 GNOMEUI_LIBS=`$PKGCONFIG --libs-only-l libgnomeui-2.0`
259 GNOME_LIBDIR=`$PKGCONFIG --libs libgnomeui-2.0`
260 GNOME_LIBS=`$PKGCONFIG --libs-only-l libgnomeui-2.0`
261 AC_SUBST(GNOME_INCLUDEDIR)
262 AC_SUBST(GNOMEUI_LIBS)
263 AC_SUBST(GNOME_LIBDIR)
265 GNOME_DIR=src/gnome2-console
266 gnome_version="Version 2.x"
268 AC_MSG_ERROR(Unable to find Gnome 2 installation)
273 # -------------------------------------------
275 # -------------------------------------------
277 [ --enable-bat enable build of bat Qt4 GUI [disabled]],
278 [if test x$enableval = xyes; then
279 AC_DEFINE(HAVE_BAT, 1, [Set if Bacula bat Qt4 GUI support enabled])
284 if test x$support_bat = xyes; then
285 abc=`$PKGCONFIG --atleast-version=4.2 QtGui`
287 if test $pkg = 0; then
288 BAT_DIR=src/qt-console
290 AC_MSG_ERROR(Unable to find Qt4 installation needed by bat)
295 # If bat is enabled, we need the qwt library
302 if test x$support_bat = xyes; then
303 AC_MSG_CHECKING(for qwt support)
305 [ --with-qwt@<:@=DIR@:>@ specify qwt library directory],
312 if test -f ${with_qwt}/include/qwt.h; then
313 QWT_INC="${with_qwt}/include"
314 QWT_LDFLAGS="-L${with_qwt}/lib"
323 # Search in standard places, or --with-qwt not specified
325 if test $no_qwt = no; then
326 if test x$QWT_INC = x; then
327 for root in /usr /usr/local; do
328 for ver in qwt qwt5 qwt-qt4; do
329 if test -f ${root}/include/${ver}/qwt.h; then
330 QWT_INC="${root}/include/${ver}"
331 if test -d ${root}/lib64/; then
332 QWT_LDFLAGS="-L${root}/lib64"
334 QWT_LDFLAGS="-L${root}/lib"
345 if test x$QWT_INC = x; then
348 AC_DEFINE(HAVE_QWT, 1, [Set if bat QWT library found])
355 AC_SUBST(QWT_LDFLAGS)
360 # -------------------------------------------
361 # bwx-console (default off)
362 # -------------------------------------------
363 AC_ARG_ENABLE(bwx-console,
364 [ --enable-bwx-console enable build of wxWidgets console [disabled]],
365 [if test x$enableval = xyes; then
366 support_wx_console=yes
370 if test x$support_wx_console = xyes; then
371 abc=`$WXCONFIG $WXFLAGS --cppflags`
373 if test $pkg = 0; then
374 wx_version="wxWidgets `$WXCONFIG $WXFLAGS --release`"
375 WXCONS_CPPFLAGS=`$WXCONFIG $WXFLAGS --cppflags`
376 WXCONS_LDFLAGS=`$WXCONFIG $WXFLAGS --libs`
378 AC_SUBST(WXCONS_CPPFLAGS)
379 AC_SUBST(WXCONS_LDFLAGS)
380 WX_DIR=src/wx-console
383 echo "wx-config program not found. bwx-console disabled."
385 support_wx_console=no
391 # -------------------------------------------
392 # tray-monitor (default off)
393 # -------------------------------------------
394 AC_ARG_ENABLE(tray-monitor,
395 [ --enable-tray-monitor enable build of Gnome tray monitor (compatible with KDE) [disabled]],
396 [if test x$enableval = xyes; then
397 support_tray_monitor=yes
401 if test x$support_tray_monitor = xyes; then
402 abc=`$PKGCONFIG --exists gtk+-2.0`
404 if test $pkg = 0; then
405 TRAY_MONITOR_CPPFLAGS=`$PKGCONFIG --cflags gtk+-2.0`
406 TRAY_MONITOR_LDFLAGS=`$PKGCONFIG --libs gtk+-2.0`
407 AC_SUBST(TRAY_MONITOR_CPPFLAGS)
408 AC_SUBST(TRAY_MONITOR_LDFLAGS)
409 TRAY_MONITOR_DIR=src/tray-monitor
410 abc=`$PKGCONFIG --atleast-version=2.4 gtk+-2.0`
412 if test $pkg = 0; then
413 AC_DEFINE(HAVE_GTK_2_4, 1, [Set if you have GTK 4.2 or greater loaded])
417 AC_SUBST(TRAY_MONITOR_DIR)
419 # -------------------------------------------
420 # smartalloc (default off)
421 # -------------------------------------------
422 AC_ARG_ENABLE(smartalloc,
423 [ --enable-smartalloc enable smartalloc debugging support [disabled]],
424 [if test x$enableval = xno; then
425 support_smartalloc=no
428 if test x$support_smartalloc = xyes; then
429 AC_DEFINE(SMARTALLOC, 1, [Set if you want Smartalloc enabled])
432 # -------------------------------------------
433 # static-tools (default off)
434 # -------------------------------------------
435 AC_ARG_ENABLE(static-tools,
436 [ --enable-static-tools enable static tape tools [disabled]],
437 [if test x$enableval = xyes; then
438 support_static_tools=yes
442 if test x$support_static_tools = xyes; then
443 TTOOL_LDFLAGS="-static"
445 AC_SUBST(TTOOL_LDFLAGS)
447 # -------------------------------------------
448 # static-fd (default off)
449 # -------------------------------------------
450 AC_ARG_ENABLE(static-fd,
451 [ --enable-static-fd enable static File daemon [disabled]],
452 [if test x$enableval = xyes; then
453 support_static_fd=yes
457 if test x$support_static_fd = xyes; then
458 STATIC_FD="static-bacula-fd"
462 # -------------------------------------------
463 # static-sd (default off)
464 # -------------------------------------------
465 AC_ARG_ENABLE(static-sd,
466 [ --enable-static-sd enable static Storage daemon [disabled]],
467 [if test x$enableval = xyes; then
468 support_static_sd=yes
472 if test x$support_static_sd = xyes; then
473 STATIC_SD="static-bacula-sd"
477 # -------------------------------------------
478 # static-dir (default off)
479 # -------------------------------------------
480 AC_ARG_ENABLE(static-dir,
481 [ --enable-static-dir enable static Director [disabled]],
482 [if test x$enableval = xyes; then
483 support_static_dir=yes
487 if test x$support_static_dir = xyes; then
488 STATIC_DIR="static-bacula-dir"
492 # -------------------------------------------
493 # static-cons (default off)
494 # -------------------------------------------
495 AC_ARG_ENABLE(static-cons,
496 [ --enable-static-cons enable static Console [disabled]],
497 [if test x$enableval = xyes; then
498 support_static_cons=yes
504 if test x$support_static_cons = xyes; then
505 STATIC_CONS="static-bconsole"
506 STATIC_GNOME_CONS="static-bgnome-console"
507 STATIC_WX_CONS="static-bwx-console"
509 AC_SUBST(STATIC_CONS)
510 AC_SUBST(STATIC_GNOME_CONS)
511 AC_SUBST(STATIC_WX_CONS)
513 # -------------------------------------------
514 # client_only (default off)
515 # -------------------------------------------
516 AC_ARG_ENABLE(client-only,
517 [ --enable-client-only build client (File daemon) only [disabled]],
518 [if test x$enableval = xyes; then
519 build_client_only=yes
523 if test x$build_client_only = xno; then
530 # -------------------------------------------
531 # director (default on)
532 # -------------------------------------------
533 AC_ARG_ENABLE(build-dird,
534 [ --enable-build-dird enable building of dird (Director) [enabled]],
535 [if test x$enableval = xno; then
538 if test x$build_dird = xyes; then
543 DIR_TOOLS="NODIRTOOLS"
548 # -------------------------------------------
549 # stored (default on)
550 # -------------------------------------------
551 AC_ARG_ENABLE(build-stored,
552 [ --enable-build-stored enable building of stored (Storage daemon) [enabled]],
553 [if test x$enableval = xno; then
556 if test x$build_stored = xyes; then
557 STORED_DIR="src/stored"
563 # ---------------------------------------------------
564 # Check for conio (Bacula readline substitute)(
565 # ---------------------------------------------------
566 # this allows you to turn it completely off
568 [ --disable-conio disable conio support [enabled]
570 [if test x$enableval = xno; then
576 # ---------------------------------------------------
577 # Check for IPv6 support
578 # ---------------------------------------------------
579 # this allows you to turn it completely off
582 [ --enable-ipv6 enable ipv6 support [enabled]
584 [if test x$enableval = xno; then
589 if test x$support_ipv6 = xyes; then
590 AC_TRY_LINK([ #include <sys/types.h>
591 #include <sys/socket.h>
592 #include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;],
593 [support_ipv6=yes], [support_ipv6=no])
596 if test x$support_ipv6 = xyes; then
597 AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
603 if test x$support_conio = xyes; then
604 AC_CHECK_HEADER(termcap.h,
605 [ AC_CHECK_LIB(termcap, tgetent,
606 [ CONS_LIBS="-ltermcap"
611 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
613 [ AC_CHECK_LIB(ncurses, tgetent,
614 [ CONS_LIBS="-lncurses"
619 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
624 AC_CHECK_HEADERS(curses.h)
625 AC_CHECK_HEADER(term.h,
626 [ AC_CHECK_LIB(curses, tgetent,
627 [ CONS_LIBS="-lcurses"
632 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
635 [ echo " "; echo "Required libraries not found. CONIO turned off ..."; echo " "],
644 # ---------------------------------------------------
645 # Check for readline support/directory (default off)
646 # ---------------------------------------------------
647 # this allows you to turn it completely off
648 AC_ARG_ENABLE(readline,
649 [ --disable-readline disable readline support [disable]
651 [if test x$enableval = xno; then
657 if test x$support_readline = xyes; then
658 AC_ARG_WITH(readline,
659 [ --with-readline@<:@=DIR@:>@ specify readline library directory],
661 case "$with_readline" in
664 if test -f ${with_readline}/readline.h; then
665 CONS_INC="-I${with_readline}"
666 CONS_LDFLAGS="-L$with_readline"
667 elif test -f ${with_readline}/include/readline/readline.h; then
668 CONS_INC="-I${with_readline}/include/readline"
669 CONS_LDFLAGS="-L${with_readline}/lib"
670 with_readline="${with_readline}/include/readline"
672 with_readline="/usr/include/readline"
674 AC_CHECK_HEADER(${with_readline}/readline.h,
675 [ AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
676 CONS_LIBS="-lreadline -lhistory -ltermcap"
680 echo "readline.h not found. readline turned off ..."
687 # check for standard readline library
688 AC_CHECK_HEADER(/usr/include/readline/readline.h,
689 [ AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
691 CONS_INC="-I/usr/include/readline"
692 CONS_LIBS="-lreadline -ltermcap"
694 # Did not find standard library, so try Bacula's default
695 AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h,
696 [ AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
698 CONS_INC="-I${TOP_DIR}/depkgs/readline"
699 CONS_LIBS="-lreadline -lhistory -ltermcap"
700 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
701 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
704 echo "readline.h not found. readline turned off ..."
720 AC_SUBST(CONS_LDFLAGS)
721 AC_SUBST(READLINE_SRC)
723 # Minimal stuff for readline Makefile configuration
728 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr lstat lchown)
729 AC_CHECK_FUNCS(nanosleep nl_langinfo)
730 AC_CHECK_HEADERS(varargs.h)
732 # End of readline/conio stuff
733 # -----------------------------------------------------------------------
735 # -----------------------------------------------------------------------
736 # Check for Python support
738 AC_MSG_CHECKING(for Python support)
741 --with-python@<:@=DIR@:>@ Include Python support. DIR is the Python base
742 install directory, default is to search through
743 a number of common places for the Python files.],
747 if test "$withval" != "no"; then
748 if test "$withval" = "yes"; then
749 for python_root in /usr /usr/local /usr/sfw; do
750 for ver in python2.2 python2.3 python2.4 python2.5; do
751 if test -f $python_root/include/${ver}/Python.h; then
752 PYTHON_INCDIR=-I$python_root/include/${ver}
753 if test -d $python_root/lib64/${ver}/config; then
754 PYTHON_LIBS="-L$python_root/lib64/${ver}/config -l${ver}"
756 PYTHON_LIBS="-L$python_root/lib/${ver}/config -l${ver}"
762 if test x$PYTHON_INCDIR = x; then
763 if test -f $prefix/include/Python.h; then
764 PYTHON_INCDIR=-I$prefix/include
765 if test -d $prefix/lib64/config; then
766 PYTHON_LIBS="-L$prefix/lib64/config -lpython"
768 PYTHON_LIBS="-L$prefix/lib/config -lpython"
772 AC_MSG_ERROR(Unable to find Python.h in standard locations)
776 if test -f $withval/Python.h; then
777 PYTHON_INCDIR=-I$withval
778 PYTHON_LIBS="-L$withval/config -lpython"
779 elif test -f $withval/include/Python.h; then
780 PYTHON_INCDIR=-I$withval/include
781 if test -d $withval/lib64/config; then
782 PYTHON_LIBS="-L$withval/lib64/config -lpython"
784 PYTHON_LIBS="-L$withval/lib/config -lpython"
786 elif test -f $withval/include/python/Python.h; then
787 PYTHON_INCDIR=-I$withval/include/python
788 if test -d $withval/lib64/python/config; then
789 PYTHON_LIBS="-L$withval/lib64/python/config -lpython"
791 PYTHON_LIBS="-L$withval/lib/python/config -lpython"
795 AC_MSG_ERROR(Invalid Python directory $withval - unable to find Python.h under $withval)
798 AC_DEFINE([HAVE_PYTHON], 1)
801 AC_MSG_NOTICE(checking for more Python libs)
802 saved_LIBS="$LIBS"; LIBS=
803 AC_SEARCH_LIBS(shm_open, [rt])
804 AC_CHECK_LIB(util, openpty)
805 PYTHON_LIBS="$PYTHON_LIBS $LIBS"
813 AC_SUBST(PYTHON_LIBS)
814 AC_SUBST(PYTHON_INCDIR)
817 # Find where sockets are (especially for Solaris)
818 # Do this before the TCP Wrappers test since tcp wrappers
819 # uses the socket library and some linkers are stupid.
821 AC_CHECK_FUNC(socket,
822 AC_MSG_RESULT(using libc's socket),
823 AC_CHECK_LIB(xnet,socket)
824 AC_CHECK_LIB(socket,socket)
825 AC_CHECK_LIB(inet,socket))
828 # -----------------------------------------------------------
829 # Check whether user wants TCP wrappers support (default off)
830 # -----------------------------------------------------------
833 AC_ARG_WITH(tcp-wrappers,
834 [ --with-tcp-wrappers@<:@=DIR@:>@ enable tcpwrappers support],
836 if test "x$withval" != "xno" ; then
838 LIBS="$saved_LIBS -lwrap"
839 AC_MSG_CHECKING(for libwrap)
840 AC_SEARCH_LIBS(nanosleep, [rt])
842 [ #include <sys/types.h>
844 int deny_severity = 0;
845 int allow_severity = 0;
846 struct request_info *req; ],
847 [ hosts_access(req); ],
850 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
855 LIBS="$saved_LIBS -lwrap -lnsl"
856 WRAPLIBS="$saved_LIBS -lwrap -lnsl"
858 [ #include <sys/types.h>
860 int deny_severity = 0;
861 int allow_severity = 0;
862 struct request_info *req; ],
863 [ hosts_access(req); ],
866 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
871 [AC_MSG_ERROR([*** libwrap missing]) ] ]
878 # -----------------------------------------------------------
879 # Check whether OpenSSL is available
880 # -----------------------------------------------------------
881 AC_MSG_CHECKING([for OpenSSL])
882 dnl The following uses quadrigraphs:
886 AC_HELP_STRING([--with-openssl@<:@=DIR@:>@], [Include OpenSSL support. DIR is the OpenSSL base]),
887 [with_openssl_directory=${withval}])
889 if test "x$with_openssl_directory" != "x"; then
890 OPENSSL_LIBS="-lssl -lcrypto"
893 if test "x$with_openssl_directory" != "xyes" && test x"${with_openssl_directory}" != "x"; then
894 OPENSSL_LIBS="-L$with_openssl_directory/lib $OPENSSL_LIBS"
895 OPENSSL_INC="-I$with_openssl_directory/include $OPENSSL_INC"
899 saved_CFLAGS="${CFLAGS}"
900 LIBS="${saved_LIBS} ${OPENSSL_LIBS}"
901 CFLAGS="${saved_CFLAGS} ${OPENSSL_INC}"
903 AC_TRY_LINK([ #include <openssl/ssl.h> ],
904 [ CRYPTO_set_id_callback(NULL); ],
912 AC_TRY_LINK([ #include <openssl/evp.h> ],
914 [ ac_cv_openssl_sha2="yes" ],
915 [ ac_cv_openssl_sha2="no" ]
918 # Solaris disables greater than 128+ bit encryption in their OpenSSL
919 # implementation, presumably for export reasons. If 192bit AES
920 # is available, we assume that we're running with a 'non-export'
922 AC_TRY_LINK([ #include <openssl/evp.h> ],
923 [ EVP_aes_192_cbc(); ],
924 [ ac_cv_openssl_export="no" ],
925 [ ac_cv_openssl_export="yes" ]
929 CFLAGS="${saved_CFLAGS}"
931 if test "$support_tls" = "yes"; then
932 AC_DEFINE(HAVE_OPENSSL, 1, [Define if OpenSSL library is available])
933 AC_DEFINE(HAVE_TLS, 1, [Define if TLS support should be enabled])
934 AC_DEFINE(HAVE_CRYPTO, 1, [Define if encryption support should be enabled])
937 if test "$ac_cv_openssl_sha2" = "yes"; then
938 AC_DEFINE(HAVE_SHA2, 1, [Define if the SHA-2 family of digest algorithms is available])
941 if test "$ac_cv_openssl_export" = "yes"; then
942 AC_DEFINE(HAVE_OPENSSL_EXPORT_LIBRARY, 1, [Define if the OpenSSL library is export-contrained to 128bit ciphers])
951 AC_MSG_RESULT([$support_tls])
952 AC_SUBST(OPENSSL_LIBS)
953 AC_SUBST(OPENSSL_INC)
956 # -----------------------------------------------------------
957 # dlopen is needed for plugins
958 # -----------------------------------------------------------
959 AC_SEARCH_LIBS(dlopen, [dl])
961 # ------------------------------------------
962 # Where to place working dir
963 # ------------------------------------------
964 working_dir=`eval echo ${prefix}/var/bacula/working`
965 AC_ARG_WITH(working-dir,
966 [ --with-working-dir=PATH specify path of Bacula working directory],
968 if test "x$withval" != "xno" ; then
974 AC_SUBST(working_dir)
976 # ------------------------------------------------------------------
977 # If the user has not set archivedir, we set our default as /tmp
978 # ------------------------------------------------------------------
980 AC_ARG_WITH(archivedir,
981 [ --with-archivedir=PATH specify path of SD archive directory],
983 if test "x$withval" != "xno" ; then
993 # ------------------------------------------
994 # Where to place scriptdir (script files)
995 # ------------------------------------------
996 scriptdir=`eval echo ${sysconfdir}`
997 AC_ARG_WITH(scriptdir,
998 [ --with-scriptdir=PATH specify path of Bacula scripts directory],
1000 if test "x$withval" != "xno" ; then
1009 # ------------------------------------------
1010 # Where to place plugindir (script files)
1011 # ------------------------------------------
1012 plugindir=`eval echo ${sysconfdir}`
1013 AC_ARG_WITH(plugindir,
1014 [ --with-plugindir=PATH specify path of Bacula plugins directory],
1016 if test "x$withval" != "xno" ; then
1025 # ------------------------------------------
1026 # Where to send dump email
1027 # ------------------------------------------
1028 dump_email=root@localhost
1029 AC_ARG_WITH(dump-email,
1030 [ --with-dump-email=EMAIL dump email address],
1032 if test "x$withval" != "xno" ; then
1038 AC_SUBST(dump_email)
1040 # ------------------------------------------
1041 # Where to send job email
1042 # ------------------------------------------
1043 job_email=root@localhost
1044 AC_ARG_WITH(job-email,
1045 [ --with-job-email=EMAIL job output email address],
1047 if test "x$withval" != "xno" ; then
1055 # ------------------------------------------
1056 # Where to find smtp host
1057 # ------------------------------------------
1059 AC_ARG_WITH(smtp_host,
1060 [ --with-smtp-host=HOST SMTP mail host address],
1062 if test "x$withval" != "xno" ; then
1071 # ------------------------------------
1072 # Where to place pid files
1073 # ------------------------------------
1075 AC_ARG_WITH(pid-dir,
1076 [ --with-pid-dir=PATH specify location of Bacula pid files],
1078 if test "x$withval" != "xno" ; then
1084 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
1088 # ------------------------------------
1089 # Where to place subsys "lock file"
1090 # ------------------------------------
1091 subsysdir=/var/run/subsys
1092 if test -d /var/run/subsys; then
1093 subsysdir=/var/run/subsys
1094 elif test -d /var/lock/subsys; then
1095 subsysdir=/var/lock/subsys
1097 subsysdir=/var/run/subsys
1099 AC_ARG_WITH(subsys-dir,
1100 [ --with-subsys-dir=PATH specify location of Bacula subsys file],
1102 if test "x$withval" != "xno" ; then
1112 # ------------------------------------
1113 # Where to start assigning ports
1114 # ------------------------------------
1116 AC_ARG_WITH(baseport,
1117 [ --with-baseport=PORT specify base port address for daemons],
1119 if test "x$withval" != "xno" ; then
1126 dir_port=`expr $baseport`
1127 fd_port=`expr $baseport + 1`
1128 sd_port=`expr $fd_port + 1`
1135 # ------------------------------------------
1136 # Generate passwords
1137 # ------------------------------------------
1139 AC_ARG_WITH(dir-password,
1140 [ --with-dir-password=PASSWORD specify Director's password],
1142 if test "x$withval" != "xno" ; then
1143 dir_password=$withval
1148 if test "x$dir_password" = "x" ; then
1149 if test "x$OPENSSL" = "xnone" ; then
1150 key=`autoconf/randpass 33`
1152 key=`openssl rand -base64 33`
1158 AC_ARG_WITH(fd-password,
1159 [ --with-fd-password=PASSWORD specify Client's password],
1161 if test "x$withval" != "xno" ; then
1162 fd_password=$withval
1167 if test "x$fd_password" = "x" ; then
1168 if test "x$OPENSSL" = "xnone" ; then
1169 key=`autoconf/randpass 37`
1171 key=`openssl rand -base64 33`
1177 AC_ARG_WITH(sd-password,
1178 [ --with-sd-password=PASSWORD specify Storage daemon's password],
1180 if test "x$withval" != "xno" ; then
1181 sd_password=$withval
1186 if test "x$sd_password" = "x" ; then
1187 if test "x$OPENSSL" = "xnone" ; then
1188 key=`autoconf/randpass 41`
1190 key=`openssl rand -base64 33`
1196 AC_ARG_WITH(mon-dir-password,
1197 [ --with-mon-dir-password=PASSWORD specify Director's password used by the monitor],
1199 if test "x$withval" != "xno" ; then
1200 mon_dir_password=$withval
1205 if test "x$mon_dir_password" = "x" ; then
1206 if test "x$OPENSSL" = "xnone" ; then
1207 key=`autoconf/randpass 33`
1209 key=`openssl rand -base64 33`
1211 mon_dir_password=$key
1215 AC_ARG_WITH(mon-fd-password,
1216 [ --with-mon-fd-password=PASSWORD specify Client's password used by the monitor],
1218 if test "x$withval" != "xno" ; then
1219 mon_fd_password=$withval
1224 if test "x$mon_fd_password" = "x" ; then
1225 if test "x$OPENSSL" = "xnone" ; then
1226 key=`autoconf/randpass 37`
1228 key=`openssl rand -base64 33`
1230 mon_fd_password=$key
1234 AC_ARG_WITH(mon-sd-password,
1235 [ --with-mon-sd-password=PASSWORD specify Storage daemon's password used by the monitor],
1237 if test "x$withval" != "xno" ; then
1238 mon_sd_password=$withval
1243 if test "x$mon_sd_password" = "x" ; then
1244 if test "x$OPENSSL" = "xnone" ; then
1245 key=`autoconf/randpass 41`
1247 key=`openssl rand -base64 33`
1249 mon_sd_password=$key
1252 AC_SUBST(dir_password)
1253 AC_SUBST(fd_password)
1254 AC_SUBST(sd_password)
1255 AC_SUBST(mon_dir_password)
1256 AC_SUBST(mon_fd_password)
1257 AC_SUBST(mon_sd_password)
1260 # Pickup any database name
1263 AC_ARG_WITH(db_name,
1264 [ --with-db-name=DBNAME specify database name (default bacula)],
1266 if test "x$withval" != "x" ; then
1274 AC_ARG_WITH(db_user,
1275 [ --with-db-user=UNAME specify database user (default bacula)],
1277 if test "x$withval" != "x" ; then
1285 AC_ARG_WITH(db_password,
1286 [ --with-db-password=UNAME specify database password (default *none*)],
1288 if test "x$withval" != "x" ; then
1289 db_password=$withval
1293 AC_SUBST(db_password)
1296 # Pickup a database port
1299 AC_ARG_WITH(db_port,
1300 [ --with-db-port=DBPORT specify a database port (default null)],
1302 if test "x$withval" != "x" ; then
1310 # Handle users and groups for each daemon
1313 AC_ARG_WITH(dir_user,
1314 [ --with-dir-user=USER specify user for Director daemon],
1316 if test "x$withval" != "x" ; then
1323 AC_ARG_WITH(dir_group,
1324 [ --with-dir-group=GROUP specify group for Director daemon],
1326 if test "x$withval" != "x" ; then
1333 AC_ARG_WITH(sd_user,
1334 [ --with-sd-user=USER specify user for Storage daemon],
1336 if test "x$withval" != "x" ; then
1343 AC_ARG_WITH(sd_group,
1344 [ --with-sd-group=GROUP specify group for Storage daemon],
1346 if test "x$withval" != "x" ; then
1353 AC_ARG_WITH(fd_user,
1354 [ --with-fd-user=USER specify user for File daemon],
1356 if test "x$withval" != "x" ; then
1363 AC_ARG_WITH(fd_group,
1364 [ --with-fd-group=GROUP specify group for File daemon],
1366 if test "x$withval" != "x" ; then
1380 # allow setting default executable permissions
1383 AC_ARG_WITH(sbin-perm,
1384 [ --with-sbin-perm=MODE specify permissions for sbin binaries (0754)],
1386 if test "x$withval" != "x" ; then
1394 # ------------------------------------------------
1395 # Bacula check for various SQL database engines
1396 # ------------------------------------------------
1398 BA_CHECK_POSTGRESQL_DB
1413 # -------------------------------------------
1414 # enable batch attribute DB insert (default on)
1415 # -------------------------------------------
1416 support_batch_insert=no
1417 A=`nm $SQL_LIB | grep pthread_mutex_lock`
1419 if test $pkg = 0; then
1420 support_batch_insert=yes
1421 AC_ARG_ENABLE(batch-insert,
1422 [ --enable-batch-insert enable the DB batch insert code [disabled]],
1423 [if test x$enableval = xno; then
1424 support_batch_insert=no
1426 support_batch_insert=yes
1430 # Check if postgresql support batch mode
1431 if test x$DB_TYPE = xpostgresql; then
1432 A=`nm $SQL_LIB | grep PQputCopyData`
1434 if test $pkg != 0; then
1435 support_batch_insert=no
1439 if test x$DB_TYPE = xdbi; then
1443 # Check for batch insert
1444 if test $DB_PROG = postgresql; then
1445 A=`nm $DB_PROG_LIB | grep PQputCopyData`
1449 if test $DB_PROG = mysql; then
1450 A=`nm $DB_PROG_LIB | grep pthread_mutex_lock`
1454 if test $pkg = 0; then
1455 AC_ARG_ENABLE(batch-insert,
1456 [ --enable-batch-insert enable the DB batch insert code [disabled]],
1457 [if test x$enableval = xno; then
1458 support_batch_insert=no
1460 support_batch_insert=yes
1464 # If dbi was not chosen, let the comment in file
1468 AC_SUBST(uncomment_dbi)
1470 if test $support_batch_insert = yes ; then
1471 AC_DEFINE(HAVE_BATCH_FILE_INSERT, 1, [Set if DB batch insert code enabled])
1475 AC_DEFINE(PROTOTYPES)
1477 dnl# --------------------------------------------------------------------------
1478 dnl# Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
1480 if test -z "$CFLAGS" -o "$CFLAGS" = "-g -O2"; then
1481 if test -z "$CCOPTS"; then
1482 CCOPTS='-g -O2 -Wall'
1491 dnl See if we can use 64 bit file addresses
1492 largefile_support="no"
1498 dnl# --------------------------------------------------------------------------
1499 dnl# CHECKING FOR HEADER FILES
1500 dnl# --------------------------------------------------------------------------
1539 AC_STRUCT_ST_BLKSIZE
1543 dnl# --------------------------------------------------------------------------
1544 dnl# Check for utime.h structure
1545 dnl# --------------------------------------------------------------------------
1546 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
1548 #include <sys/types.h>
1549 #include <utime.h>], [struct utimbuf foo],
1550 ba_cv_header_utime_h=yes, ba_cv_header_utime_h=no)])
1551 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H, 1, [Set if utime.h exists])
1553 dnl# --------------------------------------------------------------------------
1554 dnl# Check for socklen_t
1555 dnl# --------------------------------------------------------------------------
1556 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
1558 #include <sys/types.h>
1559 #include <sys/socket.h>],
1561 ba_cv_header_socklen_t=yes, ba_cv_header_socklen_t=no)])
1562 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T)
1564 dnl# --------------------------------------------------------------------------
1565 dnl# Check for bigendian
1566 dnl# --------------------------------------------------------------------------
1567 AC_CACHE_CHECK([for bigendian], ba_cv_bigendian,
1569 [main(){long a=1L; char *p=(char *)&a; exit(*p);}],
1570 [ba_cv_bigendian=yes],
1571 [ba_cv_bigendian=no],
1572 [ba_cv_bigendian=no])])
1573 test $ba_cv_bigendian = yes && AC_DEFINE(HAVE_BIGENDIAN)
1575 dnl# --------------------------------------------------------------------------
1576 dnl# Check for typeof()
1577 dnl# --------------------------------------------------------------------------
1579 AC_CACHE_CHECK(for typeof, ba_cv_have_typeof,
1581 [main(){char *a = 0; a = (typeof a)a;}],
1582 [ba_cv_have_typeof=yes],
1583 [ba_cv_have_typeof=no],
1584 [ba_cv_have_typeof=no])])
1585 test $ba_cv_have_typeof = yes && AC_DEFINE([HAVE_TYPEOF], 1, [Defind to 1 if compiler has typeof])
1591 dnl# --------------------------------------------------------------------------
1592 dnl# CHECKING FOR FILESYSTEM TYPE
1593 dnl# --------------------------------------------------------------------------
1594 AC_MSG_CHECKING(how to get filesystem type)
1596 # The order of these tests is important.
1597 AC_TRY_CPP([#include <sys/statvfs.h>
1598 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4)
1599 if test $fstype = no; then
1600 AC_TRY_CPP([#include <sys/statfs.h>
1601 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3)
1603 if test $fstype = no; then
1604 AC_TRY_CPP([#include <sys/statfs.h>
1605 #include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX)
1607 if test $fstype = no; then
1608 AC_TRY_CPP([#include <mntent.h>], AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD)
1610 if test $fstype = no; then
1611 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
1613 if test $fstype = no; then
1614 AC_TRY_CPP([#include <sys/mount.h>
1615 #include <sys/fs_types.h>], AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix)
1617 AC_MSG_RESULT($fstype)
1619 AC_CHECK_HEADER(sys/statvfs.h, [ AC_DEFINE(HAVE_SYS_STATVFS_H,1,[Defines if your system have the sys/statvfs.h header file])] , )
1621 dnl# --------------------------------------------------------------------------
1622 dnl# CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
1623 dnl# --------------------------------------------------------------------------
1631 AC_CHECK_TYPE(ino_t, unsigned long)
1632 AC_CHECK_TYPE(dev_t, unsigned long)
1633 AC_CHECK_TYPE(daddr_t, long)
1634 AC_CHECK_TYPE(major_t, int)
1635 AC_CHECK_TYPE(minor_t, int)
1636 AC_CHECK_TYPE(ssize_t, int)
1643 AC_CHECK_SIZEOF(char, 1)
1644 AC_CHECK_SIZEOF(short int, 2)
1645 AC_CHECK_SIZEOF(int, 4)
1646 AC_CHECK_SIZEOF(long int, 4)
1647 AC_CHECK_SIZEOF(long long int, 8)
1648 AC_CHECK_SIZEOF(int *, 4)
1650 # Check for sys/types.h types
1651 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1653 [ #include <sys/types.h> ],
1655 [ ac_cv_have_u_int="yes" ],
1656 [ ac_cv_have_u_int="no" ]
1659 if test "x$ac_cv_have_u_int" = "xyes" ; then
1660 AC_DEFINE(HAVE_U_INT)
1664 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t, [
1666 [ #include <sys/types.h> ],
1667 [ intmax_t a; a = 1;],
1668 [ ac_cv_have_intmax_t="yes" ],
1671 [ #include <stdint.h> ],
1672 [ intmax_t a; a = 1;],
1673 [ ac_cv_have_intmax_t="yes" ],
1674 [ ac_cv_have_intmax_t="no" ]
1680 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
1681 AC_DEFINE(HAVE_INTMAX_T)
1686 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t, [
1688 [ #include <sys/types.h> ],
1689 [ u_intmax_t a; a = 1;],
1690 [ ac_cv_have_u_intmax_t="yes" ],
1693 [ #include <stdint.h> ],
1694 [ u_intmax_t a; a = 1;],
1695 [ ac_cv_have_u_intmax_t="yes" ],
1696 [ ac_cv_have_u_intmax_t="no" ]
1701 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
1702 AC_DEFINE(HAVE_U_INTMAX_T)
1707 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1709 [ #include <sys/types.h> ],
1710 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1711 [ ac_cv_have_intxx_t="yes" ],
1712 [ ac_cv_have_intxx_t="no" ]
1715 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1716 AC_DEFINE(HAVE_INTXX_T)
1720 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1722 [ #include <sys/types.h> ],
1723 [ int64_t a; a = 1;],
1724 [ ac_cv_have_int64_t="yes" ],
1725 [ ac_cv_have_int64_t="no" ]
1728 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1729 AC_DEFINE(HAVE_INT64_T)
1733 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1735 [ #include <sys/types.h> ],
1736 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1737 [ ac_cv_have_u_intxx_t="yes" ],
1738 [ ac_cv_have_u_intxx_t="no" ]
1741 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1742 AC_DEFINE(HAVE_U_INTXX_T)
1746 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1748 [ #include <sys/types.h> ],
1749 [ u_int64_t a; a = 1;],
1750 [ ac_cv_have_u_int64_t="yes" ],
1751 [ ac_cv_have_u_int64_t="no" ]
1754 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1755 AC_DEFINE(HAVE_U_INT64_T)
1759 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1760 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1762 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1764 [ #include <sys/bitypes.h> ],
1765 [ int8_t a; int16_t b; int32_t c;
1766 u_int8_t e; u_int16_t f; u_int32_t g;
1767 a = b = c = e = f = g = 1; ],
1768 [ AC_DEFINE(HAVE_U_INTXX_T)
1769 AC_DEFINE(HAVE_INTXX_T)
1770 AC_DEFINE(HAVE_SYS_BITYPES_H)
1771 AC_MSG_RESULT(yes) ],
1772 [ AC_MSG_RESULT(no)]
1776 if test -z "$have_u_intxx_t" ; then
1777 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1779 [ #include <sys/types.h> ],
1780 [ uint8_t a; uint16_t b;
1781 uint32_t c; a = b = c = 1; ],
1782 [ ac_cv_have_uintxx_t="yes" ],
1783 [ ac_cv_have_uintxx_t="no" ]
1786 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1787 AC_DEFINE(HAVE_UINTXX_T)
1791 if (test -z "$have_u_int64_t" || test -z "$have_int64_t" && \
1792 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1794 AC_MSG_CHECKING([for int64_t and u_int64_t types in sys/bitypes.h])
1796 [ #include <sys/bitypes.h> ],
1797 [ int64_t a; u_int64_t b;
1799 [ AC_DEFINE(HAVE_U_INT64_T)
1800 AC_DEFINE(HAVE_INT64_T)
1801 AC_MSG_RESULT(yes) ],
1802 [ AC_MSG_RESULT(no)]
1806 if (test -z "$have_uintxx_t" && \
1807 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1809 AC_MSG_CHECKING([for uintXX_t types in sys/bitypes.h])
1811 [ #include <sys/bitypes.h> ],
1812 [ uint8_t a; uint16_t b;
1813 uint32_t c; a = b = c = 1; ],
1814 [ AC_DEFINE(HAVE_UINTXX_T)
1815 AC_MSG_RESULT(yes) ],
1816 [ AC_MSG_RESULT(no)]
1824 dnl# --------------------------------------------------------------------------
1825 dnl# CHECKING FOR REQUIRED LIBRARY FUNCTIONS
1826 dnl# --------------------------------------------------------------------------
1842 [echo 'configure: cannot find needed function.'; exit 1]
1845 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
1846 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
1847 AC_CHECK_FUNCS(posix_fadvise)
1848 AC_CHECK_FUNCS(fdatasync)
1850 AC_CHECK_FUNCS(chflags)
1852 AC_CHECK_FUNCS(snprintf vsnprintf gethostid fseeko)
1854 AC_CACHE_CHECK(for va_copy, ba_cv_va_copy,
1857 void use_va_copy(va_list args){va_list args2; va_copy(args2,args); va_end(args2);}
1858 void call_use_va_copy(int junk,...){va_list args; va_start(args,junk); use_va_copy(args); va_end(args);}
1860 [call_use_va_copy(1,2,3)],
1861 ba_cv_va_copy=yes, ba_cv_va_copy=no)])
1862 test $ba_cv_va_copy = yes && AC_DEFINE(HAVE_VA_COPY, 1, [Set if va_copy exists])
1865 dnl# --------------------------------------------------------------------------
1866 dnl# CHECKING FOR THREAD SAFE FUNCTIONS
1867 dnl# --------------------------------------------------------------------------
1868 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
1870 # If resolver functions are not in libc check for -lnsl or -lresolv.
1871 AC_CHECK_FUNC(gethostbyname_r,
1872 AC_MSG_RESULT(using libc's resolver),
1873 AC_CHECK_LIB(nsl,gethostbyname_r)
1874 AC_CHECK_LIB(resolv,gethostbyname_r))
1878 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
1879 AC_CHECK_FUNCS(inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)])
1880 AC_CHECK_FUNCS(gethostbyname2, [AC_DEFINE(HAVE_GETHOSTBYNAME2)])
1882 dnl ----------------------------
1883 dnl check sa_len of sockaddr
1884 dnl ----------------------------
1885 AC_CACHE_CHECK(for struct sockaddr has a sa_len field, ac_cv_struct_sockaddr_sa_len,
1886 [AC_TRY_COMPILE([#include <sys/socket.h>], [struct sockaddr s; s.sa_len;],
1887 ac_cv_struct_sockaddr_sa_len=yes, ac_cv_struct_sockaddr_sa_len=no)])
1889 if test $ac_cv_struct_sockaddr_sa_len = yes; then
1890 AC_DEFINE(HAVE_SA_LEN, 1, [Define if sa_len field exists in struct sockaddr])
1900 AC_FUNC_CLOSEDIR_VOID
1901 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
1902 # AC_FUNC_FNMATCH dnl use local version
1905 AC_CHECK_LIB(intl, gettext, [LIBS="$LIBS -lintl"])
1908 AC_CHECK_LIB(sun, getpwnam)
1910 AC_CHECK_HEADERS(zlib.h)
1911 AC_CHECK_LIB(z, deflate, [FDLIBS="-lz"])
1913 if test x$FDLIBS = x-lz; then
1914 AC_DEFINE(HAVE_LIBZ)
1919 # Check for ACL libraries
1922 AC_CHECK_HEADER(sys/acl.h)
1923 AC_CHECK_FUNC(acl_get_file, [have_acl=yes],
1924 [AC_CHECK_LIB(acl, acl_get_file, [have_acl=yes; FDLIBS="-lacl $FDLIBS"],
1925 [AC_CHECK_LIB(sec, acltotext, [have_acl=yes; FDLIBS="-lsec $FDLIBS"])]
1928 if test $have_acl = yes; then
1932 dnl Check for pthread libraries
1934 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
1935 [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
1936 [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
1937 [AC_CHECK_FUNC(pthread_create)]
1948 if test x$have_gcc = xyes ; then
1949 CPPFLAGS="$CPPFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
1950 CFLAGS="$CFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
1952 LDFLAGS=${LDFLAGS--O}
1953 DB_LIBS="${SQL_LFLAGS}"
1954 CPPFLAGS="$CPPFLAGS"
1967 AC_SUBST(X_EXTRA_LIBS)
1972 dnl# extra configurable objects
1983 # Finally we set appropriate distribution specific
1984 # variables and defaults
1986 # PFILES are platform specific files
1987 PFILES="platforms/Makefile"
1991 hostname=`uname -n | cut -d '.' -f 1`
1992 if test x${hostname} = x ; then
1993 hostname="localhost"
1998 PSCMD="ps -e -o pid,comm"
2000 platforms/aix/Makefile"
2001 TAPEDRIVE="/dev/rmt0.1"
2005 PTHREAD_LIB="-lpthread -lexc"
2006 if test "${CC}" = "gcc" ; then
2013 TAPEDRIVE="/dev/nrmt0"
2016 DISTVER=`uname -a |awk '{print $3}'`
2017 TAPEDRIVE="/dev/nrmt0"
2018 PTHREAD_LIB="-pthread"
2019 CFLAGS="${CFLAGS} -pthread"
2020 PSCMD="ps -ax -o pid,command"
2024 platforms/bsdi/Makefile \
2025 platforms/bsdi/bacula-fd \
2026 platforms/bsdi/bacula-sd \
2027 platforms/bsdi/bacula-dir"
2028 largefile_support="yes"
2031 DISTVER=`uname -a |awk '{print $3}'`
2032 TAPEDRIVE="/dev/nrst0"
2035 WLDFLAGS="-mwindows"
2039 TAPEDRIVE="/dev/nst0"
2040 PSCMD="ps -e -o pid,command"
2043 platforms/darwin/Makefile"
2046 if `grep -q ubuntu /etc/apt/sources.list`; then
2049 DISTVER=`cat /etc/debian_version`
2050 if test -f /etc/lsb-release ; then
2052 if test "x$DISTRIB_ID" != "x" ; then
2053 DISTNAME=$DISTRIB_ID
2055 if test "x$DISTRIB_RELEASE" != "x" ; then
2056 DISTVER=$DISTRIB_RELEASE
2059 if test "$DISTNAME" = "Ubuntu" ; then
2062 TAPEDRIVE="/dev/nst0"
2063 PSCMD="ps -e -o pid,command"
2064 if test "$DISTNAME" = "ubuntu" ; then
2066 platforms/ubuntu/Makefile \
2067 platforms/ubuntu/bacula-fd \
2068 platforms/ubuntu/bacula-sd \
2069 platforms/ubuntu/bacula-dir"
2072 platforms/debian/Makefile \
2073 platforms/debian/bacula-fd \
2074 platforms/debian/bacula-sd \
2075 platforms/debian/bacula-dir"
2079 DISTVER=`uname -a |awk '{print $3}'`
2080 VER=`echo $DISTVER | cut -c 1`
2081 if test x$VER = x4 ; then
2082 PTHREAD_LIB="${PTHREAD_LIBS:--pthread}"
2083 CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS:--pthread}"
2087 TAPEDRIVE="/dev/nrsa0"
2088 PSCMD="ps -ax -o pid,command"
2090 platforms/freebsd/Makefile \
2091 platforms/freebsd/bacula-fd \
2092 platforms/freebsd/bacula-sd \
2093 platforms/freebsd/bacula-dir"
2094 largefile_support="yes"
2097 PSCMD="UNIX95=1; ps -e -o pid,comm"
2098 CFLAGS="${CFLAGS} -D_XOPEN_SOURCE_EXTENDED=1"
2100 TAPEDRIVE="/dev/rmt/0hnb"
2101 PTHREAD_LIB="-lpthread"
2102 AC_DEFINE([_INCLUDE_LONGLONG])
2106 TAPEDRIVE="/dev/rmt/0cbn"
2107 PSCMD="ps -e -o pid,comm"
2109 platforms/irix/Makefile \
2110 platforms/irix/bacula-fd \
2111 platforms/irix/bacula-sd \
2112 platforms/irix/bacula-dir"
2115 DISTVER=`uname -a |awk '{print $3}'`
2118 TAPEDRIVE="/dev/nrst0"
2119 PSCMD="ps -ax -o pid,command"
2120 PTHREAD_LIB="-pthread"
2121 CFLAGS="${CFLAGS} -pthread"
2124 DISTVER=`uname -a |awk '{print $3}'`
2127 TAPEDRIVE="/dev/nrst0"
2128 PSCMD="ps -ax -o pid,command"
2129 PTHREAD_LIB="-pthread"
2130 CFLAGS="${CFLAGS} -pthread"
2132 platforms/openbsd/Makefile \
2133 platforms/openbsd/bacula-fd \
2134 platforms/openbsd/bacula-sd \
2135 platforms/openbsd/bacula-dir"
2138 if test -f /etc/whitebox-release ; then
2139 f=/etc/whitebox-release
2141 f=/etc/redhat-release
2143 if test `cat $f | grep release |\
2144 cut -f 3 -d ' '`x = "Enterprise"x ; then
2145 DISTVER="Enterprise "`cat $f | grep release |\
2148 DISTVER=`cat /etc/redhat-release | grep release |\
2151 TAPEDRIVE="/dev/nst0"
2152 PSCMD="ps -e -o pid,command"
2154 platforms/redhat/Makefile \
2155 platforms/redhat/bacula-fd \
2156 platforms/redhat/bacula-sd \
2157 platforms/redhat/bacula-dir \
2158 platforms/redhat/bacula.spec \
2162 DISTVER=`cat /etc/mandrake-release | grep release |\
2164 TAPEDRIVE="/dev/nst0"
2165 PSCMD="ps -e -o pid,command"
2167 platforms/mandrake/Makefile \
2168 platforms/mandrake/bacula-fd \
2169 platforms/mandrake/bacula-sd \
2170 platforms/mandrake/bacula-dir \
2171 platforms/mandrake/bacula.spec \
2175 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
2176 TAPEDRIVE="/dev/nst0"
2177 PSCMD="ps -e -o pid,command"
2179 platforms/gentoo/Makefile \
2180 platforms/gentoo/bacula-init \
2181 platforms/gentoo/bacula-fd \
2182 platforms/gentoo/bacula-sd \
2183 platforms/gentoo/bacula-dir"
2186 DISTVER=`cat /etc/slackware-version`
2187 TAPEDRIVE="/dev/nst0"
2188 PSCMD="ps -e -o pid,command"
2190 platforms/slackware/Makefile \
2191 platforms/slackware/rc.bacula-fd \
2192 platforms/slackware/rc.bacula-sd \
2193 platforms/slackware/rc.bacula-dir\
2194 platforms/slackware/functions.bacula"
2198 TAPEDRIVE="/dev/rmt/0cbn"
2199 PSCMD="ps -e -o pid,comm"
2201 platforms/solaris/Makefile \
2202 platforms/solaris/bacula-fd \
2203 platforms/solaris/bacula-sd \
2204 platforms/solaris/bacula-dir"
2205 if test x$DISTVER = x5.6 ; then
2206 AC_DEFINE(HAVE_OLD_SOCKOPT)
2208 LIBS="$LIBS -lresolv"
2211 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
2213 TAPEDRIVE="/dev/nst0"
2214 PSCMD="ps -e -o pid,command"
2216 platforms/suse/Makefile \
2217 platforms/suse/bacula-fd \
2218 platforms/suse/bacula-sd \
2219 platforms/suse/bacula-dir \
2220 platforms/suse/bacula \
2221 platforms/suse/bacula.spec"
2226 TAPEDRIVE="/dev/nst0"
2227 PSCMD="ps -e -o pid,command"
2229 platforms/suse/Makefile \
2230 platforms/suse/bacula-fd \
2231 platforms/suse/bacula-sd \
2232 platforms/suse/bacula-dir"
2236 TAPEDRIVE="/dev/nst0"
2239 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
2245 LIBS="$PTHREAD_LIB $LIBS"
2247 AC_DEFINE_UNQUOTED(lld, "$lld")
2248 AC_DEFINE_UNQUOTED(llu, "$llu")
2256 dnl# common parts of the Makefile
2257 MCOMMON=./autoconf/Make.common
2258 AC_SUBST_FILE(MCOMMON)
2261 if test "x${subsysdir}" = "x${sbindir}" ; then
2264 echo "You have set both --sbindir and --with-subsys-dir"
2265 echo " equal to: ${subsysdir} "
2266 echo "This is not permitted. Please reconfigure."
2268 echo "Aborting configuration ..."
2274 AC_OUTPUT([autoconf/Make.common \
2277 scripts/startmysql \
2279 scripts/btraceback \
2285 scripts/bacula-ctl-dir \
2286 scripts/bacula-ctl-fd \
2287 scripts/bacula-ctl-sd \
2288 scripts/devel_bacula \
2291 scripts/bacula.desktop.gnome1 \
2292 scripts/bacula.desktop.gnome2 \
2293 scripts/bacula.desktop.gnome1.consolehelper \
2294 scripts/bacula.desktop.gnome2.consolehelper \
2295 scripts/bacula.desktop.gnome1.xsu \
2296 scripts/bacula.desktop.gnome2.xsu \
2297 scripts/bgnome-console.console_apps \
2298 scripts/mtx-changer \
2299 scripts/disk-changer \
2300 scripts/dvd-handler \
2301 scripts/dvd-simulator \
2302 scripts/bacula-tray-monitor.desktop \
2303 scripts/logwatch/Makefile \
2304 scripts/logwatch/logfile.bacula.conf \
2305 scripts/wxconsole.console_apps \
2306 scripts/wxconsole.desktop.consolehelper \
2307 scripts/wxconsole.desktop.xsu \
2308 scripts/bat.desktop \
2309 scripts/bat.desktop.xsu \
2310 scripts/bat.desktop.consolehelper \
2311 scripts/bat.console_apps \
2314 src/console/Makefile \
2315 src/console/bconsole.conf \
2316 src/gnome2-console/Makefile \
2317 src/gnome2-console/bgnome-console.conf \
2318 src/qt-console/bat.conf \
2319 src/qt-console/bat.pro \
2320 src/qt-console/install_conf_file \
2321 src/wx-console/Makefile \
2322 src/wx-console/bwx-console.conf \
2323 src/tray-monitor/Makefile \
2324 src/tray-monitor/tray-monitor.conf \
2326 src/dird/bacula-dir.conf \
2328 src/stored/Makefile \
2329 src/stored/bacula-sd.conf \
2330 src/filed/Makefile \
2331 src/filed/bacula-fd.conf \
2333 src/cats/make_catalog_backup \
2334 src/cats/delete_catalog_backup \
2335 src/cats/create_postgresql_database \
2336 src/cats/update_postgresql_tables \
2337 src/cats/make_postgresql_tables \
2338 src/cats/grant_postgresql_privileges \
2339 src/cats/drop_postgresql_tables \
2340 src/cats/drop_postgresql_database \
2341 src/cats/create_mysql_database \
2342 src/cats/update_mysql_tables \
2343 src/cats/make_mysql_tables \
2344 src/cats/grant_mysql_privileges \
2345 src/cats/drop_mysql_tables \
2346 src/cats/drop_mysql_database \
2347 src/cats/create_sqlite_database \
2348 src/cats/update_sqlite_tables \
2349 src/cats/make_sqlite_tables \
2350 src/cats/grant_sqlite_privileges \
2351 src/cats/drop_sqlite_tables \
2352 src/cats/drop_sqlite_database \
2353 src/cats/create_sqlite3_database \
2354 src/cats/update_sqlite3_tables \
2355 src/cats/make_sqlite3_tables \
2356 src/cats/grant_sqlite3_privileges \
2357 src/cats/drop_sqlite3_tables \
2358 src/cats/drop_sqlite3_database \
2361 src/cats/create_bdb_database \
2362 src/cats/update_bdb_tables \
2363 src/cats/make_bdb_tables \
2364 src/cats/grant_bdb_privileges \
2365 src/cats/drop_bdb_tables \
2366 src/cats/drop_bdb_database \
2367 src/cats/create_bacula_database \
2368 src/cats/update_bacula_tables \
2369 src/cats/grant_bacula_privileges \
2370 src/cats/make_bacula_tables \
2371 src/cats/drop_bacula_tables \
2372 src/cats/drop_bacula_database \
2373 src/findlib/Makefile \
2374 src/tools/Makefile \
2375 src/plugins/fd/Makefile \
2377 updatedb/update_mysql_tables_10_to_11 \
2378 updatedb/update_sqlite3_tables_10_to_11 \
2379 updatedb/update_postgresql_tables_10_to_11 \
2380 updatedb/update_sqlite_tables_10_to_11 \
2385 if test "${support_bat}" = "yes" ; then
2386 if test "x$QMAKE" = "xnone" && test "x$QMAKEQT4" = "xnone"; then
2387 echo "Could not find qmake or qmake-qt4 in $PATH. Check your Qt installation"
2393 if test "x$QMAKEQT4" != "xnone"; then
2398 chmod 755 install_conf_file build-depkgs-qt-console
2399 echo "Creating bat Makefile"
2405 echo "Doing make of dependencies"
2406 ${MAKE:-make} depend
2409 chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
2410 chmod 755 dvd-handler dvd-simulator
2411 chmod 755 bconsole gconsole mtx-changer devel_bacula logrotate
2415 chmod 755 $c/update_mysql_tables_10_to_11 $c/update_sqlite3_tables_10_to_11
2416 chmod 755 $c/update_postgresql_tables_10_to_11 $c/update_sqlite_tables_10_to_11
2420 chmod 755 $c/create_bacula_database $c/update_bacula_tables $c/make_bacula_tables
2421 chmod 755 $c/grant_bacula_privileges $c/drop_bacula_tables $c/drop_bacula_database
2423 chmod 755 $c/create_bdb_database $c/update_bdb_tables $c/make_bdb_tables
2424 chmod 755 $c/grant_bdb_privileges $c/drop_bdb_tables $c/drop_bdb_database
2426 chmod 755 $c/create_mysql_database $c/update_mysql_tables $c/make_mysql_tables
2427 chmod 755 $c/grant_mysql_privileges $c/drop_mysql_tables $c/drop_mysql_database
2429 chmod 755 $c/create_sqlite_database $c/update_sqlite_tables $c/make_sqlite_tables
2430 chmod 755 $c/grant_sqlite_privileges $c/drop_sqlite_tables $c/drop_sqlite_database
2432 chmod 755 $c/create_sqlite3_database $c/update_sqlite3_tables $c/make_sqlite3_tables
2433 chmod 755 $c/grant_sqlite3_privileges $c/drop_sqlite3_tables $c/drop_sqlite3_database
2435 chmod 755 $c/create_postgresql_database $c/update_postgresql_tables $c/make_postgresql_tables
2436 chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables $c/drop_postgresql_database
2438 chmod 755 $c/make_catalog_backup $c/delete_catalog_backup
2442 chmod 755 src/win32/build-depkgs-mingw32
2446 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
2447 largefile_support="yes"
2451 # A whole lot of hand springs to get the compiler version.
2452 # This is because gcc changed the output in version 3.0
2454 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
2455 if test "x${CCVERSION}" = "x" ; then
2456 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
2458 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
2459 if test x"${CXXVERSION}" = x ; then
2460 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
2463 if test "x${subsysdir}" = "x${sbindir}" ; then
2466 echo "You have set --sbindir and --with-subsys-dir"
2467 echo " both equal to: ${subsysdir} "
2468 echo " This is not permitted. Please reconfigure."
2470 echo "Aborting configuration ..."
2476 if test "x${db_type}" = "xInternal" ; then
2479 echo "You have not specified either --enable-client-only or one of the"
2480 echo " supported databases: MySQL, PostgreSQL, SQLite3, SQLite or DBI."
2481 echo " This is not permitted. Please reconfigure."
2483 echo "Aborting the configuration ..."
2490 Configuration on `date`:
2492 Host: $host -- ${DISTNAME} ${DISTVER}
2493 Bacula version: ${VERSION} (${DATE})
2494 Source code location: ${srcdir}
2495 Install binaries: ${sbindir}
2496 Install config files: ${sysconfdir}
2497 Scripts directory: ${scriptdir}
2498 Archive directory: ${archivedir}
2499 Working directory: ${working_dir}
2500 PID directory: ${piddir}
2501 Subsys directory: ${subsysdir}
2502 Man directory: ${mandir}
2503 Data directory: ${datadir}
2504 C Compiler: ${CC} ${CCVERSION}
2505 C++ Compiler: ${CXX} ${CXXVERSION}
2506 Compiler flags: ${WCFLAGS} ${CFLAGS}
2507 Linker flags: ${WLDFLAGS} ${LDFLAGS}
2509 Statically Linked Tools: ${support_static_tools}
2510 Statically Linked FD: ${support_static_fd}
2511 Statically Linked SD: ${support_static_sd}
2512 Statically Linked DIR: ${support_static_dir}
2513 Statically Linked CONS: ${support_static_cons}
2514 Database type: ${db_type}
2515 Database port: ${db_port}
2516 Database lib: ${DB_LIBS}
2517 Database name: ${db_name}
2518 Database user: ${db_user}
2520 Job Output Email: ${job_email}
2521 Traceback Email: ${dump_email}
2522 SMTP Host Address: ${smtp_host}
2524 Director Port: ${dir_port}
2525 File daemon Port: ${fd_port}
2526 Storage daemon Port: ${sd_port}
2528 Director User: ${dir_user}
2529 Director Group: ${dir_group}
2530 Storage Daemon User: ${sd_user}
2531 Storage DaemonGroup: ${sd_group}
2532 File Daemon User: ${fd_user}
2533 File Daemon Group: ${fd_group}
2535 SQL binaries Directory ${SQL_BINDIR}
2537 Large file support: $largefile_support
2538 Bacula conio support: ${got_conio} ${CONS_LIBS}
2539 readline support: ${got_readline} ${PRTREADLINE_SRC}
2540 TCP Wrappers support: ${TCPW_MSG} ${WRAPLIBS}
2541 TLS support: ${support_tls}
2542 Encryption support: ${support_crypto}
2543 ZLIB support: ${have_zlib}
2544 enable-smartalloc: ${support_smartalloc}
2545 bat support: ${support_bat} ${QWT_LDFLAGS}
2546 enable-gnome: ${support_gnome} ${gnome_version}
2547 enable-bwx-console: ${support_wx_console} ${wx_version}
2548 enable-tray-monitor: ${support_tray_monitor}
2549 client-only: ${build_client_only}
2550 build-dird: ${build_dird}
2551 build-stored: ${build_stored}
2552 ACL support: ${have_acl}
2553 Python support: ${support_python} ${PYTHON_LIBS}
2554 Batch insert enabled: ${support_batch_insert}
2555 Berkeley DB support: ${support_libdb} ${BDB_LIBS}