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
202 support_static_tools=no
205 support_static_dir=no
206 support_static_cons=no
215 dnl# --------------------------------------------------------------------------
216 dnl# CHECKING COMMAND LINE OPTIONS
217 dnl# --------------------------------------------------------------------------
219 # -------------------------------------------
220 # gnome (default off)
221 # -------------------------------------------
223 [ --enable-gnome enable build of bgnome-console GUI [disabled]],
224 [if test x$enableval = xyes; then
229 if test x$support_gnome = xyes; then
230 abc=`$PKGCONFIG --exists libgnomeui-2.0`
232 if test $pkg = 0; then
233 GNOME_INCLUDEDIR=`$PKGCONFIG --cflags-only-I libgnomeui-2.0`
234 GNOMEUI_LIBS=`$PKGCONFIG --libs-only-l libgnomeui-2.0`
235 GNOME_LIBDIR=`$PKGCONFIG --libs libgnomeui-2.0`
236 GNOME_LIBS=`$PKGCONFIG --libs-only-l libgnomeui-2.0`
237 AC_SUBST(GNOME_INCLUDEDIR)
238 AC_SUBST(GNOMEUI_LIBS)
239 AC_SUBST(GNOME_LIBDIR)
241 GNOME_DIR=src/gnome2-console
242 gnome_version="Version 2.x"
244 AC_MSG_ERROR(Unable to find Gnome 2 installation)
249 # -------------------------------------------
251 # -------------------------------------------
253 [ --enable-bat enable build of bat Qt4 GUI [disabled]],
254 [if test x$enableval = xyes; then
255 AC_DEFINE(HAVE_BAT, 1, [Set if Bacula bat Qt4 GUI support enabled])
260 if test x$support_bat = xyes; then
261 abc=`$PKGCONFIG --atleast-version=4.2 QtGui`
263 if test $pkg = 0; then
264 BAT_DIR=src/qt-console
266 AC_MSG_ERROR(Unable to find Qt4 installation needed by bat)
271 # If bat is enabled, we need the qwt library
278 if test x$support_bat = xyes; then
279 AC_MSG_CHECKING(for qwt support)
281 [ --with-qwt@<:@=DIR@:>@ specify qwt library directory],
288 if test -f ${with_qwt}/include/qwt.h; then
289 QWT_INC="${with_qwt}/include"
290 QWT_LDFLAGS="-L${with_qwt}/lib"
299 # Search in standard places, or --with-qwt not specified
301 if test $no_qwt = no; then
302 if test x$QWT_INC = x; then
303 for root in /usr /usr/local; do
304 for ver in qwt qwt5 qwt-qt4; do
305 if test -f ${root}/include/${ver}/qwt.h; then
306 QWT_INC="${root}/include/${ver}"
307 if test -d ${root}/lib64/; then
308 QWT_LDFLAGS="-L${root}/lib64"
310 QWT_LDFLAGS="-L${root}/lib"
321 if test x$QWT_INC = x; then
324 AC_DEFINE(HAVE_QWT, 1, [Set if bat QWT library found])
331 AC_SUBST(QWT_LDFLAGS)
336 # -------------------------------------------
337 # bwx-console (default off)
338 # -------------------------------------------
339 AC_ARG_ENABLE(bwx-console,
340 [ --enable-bwx-console enable build of wxWidgets console [disabled]],
341 [if test x$enableval = xyes; then
342 support_wx_console=yes
346 if test x$support_wx_console = xyes; then
347 abc=`$WXCONFIG $WXFLAGS --cppflags`
349 if test $pkg = 0; then
350 wx_version="wxWidgets `$WXCONFIG $WXFLAGS --release`"
351 WXCONS_CPPFLAGS=`$WXCONFIG $WXFLAGS --cppflags`
352 WXCONS_LDFLAGS=`$WXCONFIG $WXFLAGS --libs`
354 AC_SUBST(WXCONS_CPPFLAGS)
355 AC_SUBST(WXCONS_LDFLAGS)
356 WX_DIR=src/wx-console
359 echo "wx-config program not found. bwx-console disabled."
361 support_wx_console=no
367 # -------------------------------------------
368 # tray-monitor (default off)
369 # -------------------------------------------
370 AC_ARG_ENABLE(tray-monitor,
371 [ --enable-tray-monitor enable build of Gnome tray monitor (compatible with KDE) [disabled]],
372 [if test x$enableval = xyes; then
373 support_tray_monitor=yes
377 if test x$support_tray_monitor = xyes; then
378 abc=`$PKGCONFIG --exists gtk+-2.0`
380 if test $pkg = 0; then
381 TRAY_MONITOR_CPPFLAGS=`$PKGCONFIG --cflags gtk+-2.0`
382 TRAY_MONITOR_LDFLAGS=`$PKGCONFIG --libs gtk+-2.0`
383 AC_SUBST(TRAY_MONITOR_CPPFLAGS)
384 AC_SUBST(TRAY_MONITOR_LDFLAGS)
385 TRAY_MONITOR_DIR=src/tray-monitor
386 abc=`$PKGCONFIG --atleast-version=2.4 gtk+-2.0`
388 if test $pkg = 0; then
389 AC_DEFINE(HAVE_GTK_2_4, 1, [Set if you have GTK 4.2 or greater loaded])
393 AC_SUBST(TRAY_MONITOR_DIR)
395 # -------------------------------------------
396 # smartalloc (default off)
397 # -------------------------------------------
398 AC_ARG_ENABLE(smartalloc,
399 [ --enable-smartalloc enable smartalloc debugging support [disabled]],
400 [if test x$enableval = xno; then
401 support_smartalloc=no
404 if test x$support_smartalloc = xyes; then
405 AC_DEFINE(SMARTALLOC, 1, [Set if you want Smartalloc enabled])
408 # -------------------------------------------
409 # static-tools (default off)
410 # -------------------------------------------
411 AC_ARG_ENABLE(static-tools,
412 [ --enable-static-tools enable static tape tools [disabled]],
413 [if test x$enableval = xyes; then
414 support_static_tools=yes
418 if test x$support_static_tools = xyes; then
419 TTOOL_LDFLAGS="-static"
421 AC_SUBST(TTOOL_LDFLAGS)
423 # -------------------------------------------
424 # static-fd (default off)
425 # -------------------------------------------
426 AC_ARG_ENABLE(static-fd,
427 [ --enable-static-fd enable static File daemon [disabled]],
428 [if test x$enableval = xyes; then
429 support_static_fd=yes
433 if test x$support_static_fd = xyes; then
434 STATIC_FD="static-bacula-fd"
438 # -------------------------------------------
439 # static-sd (default off)
440 # -------------------------------------------
441 AC_ARG_ENABLE(static-sd,
442 [ --enable-static-sd enable static Storage daemon [disabled]],
443 [if test x$enableval = xyes; then
444 support_static_sd=yes
448 if test x$support_static_sd = xyes; then
449 STATIC_SD="static-bacula-sd"
453 # -------------------------------------------
454 # static-dir (default off)
455 # -------------------------------------------
456 AC_ARG_ENABLE(static-dir,
457 [ --enable-static-dir enable static Director [disabled]],
458 [if test x$enableval = xyes; then
459 support_static_dir=yes
463 if test x$support_static_dir = xyes; then
464 STATIC_DIR="static-bacula-dir"
468 # -------------------------------------------
469 # static-cons (default off)
470 # -------------------------------------------
471 AC_ARG_ENABLE(static-cons,
472 [ --enable-static-cons enable static Console [disabled]],
473 [if test x$enableval = xyes; then
474 support_static_cons=yes
480 if test x$support_static_cons = xyes; then
481 STATIC_CONS="static-bconsole"
482 STATIC_GNOME_CONS="static-bgnome-console"
483 STATIC_WX_CONS="static-bwx-console"
485 AC_SUBST(STATIC_CONS)
486 AC_SUBST(STATIC_GNOME_CONS)
487 AC_SUBST(STATIC_WX_CONS)
489 # -------------------------------------------
490 # client_only (default off)
491 # -------------------------------------------
492 AC_ARG_ENABLE(client-only,
493 [ --enable-client-only build client (File daemon) only [disabled]],
494 [if test x$enableval = xyes; then
495 build_client_only=yes
499 if test x$build_client_only = xno; then
506 # -------------------------------------------
507 # director (default on)
508 # -------------------------------------------
509 AC_ARG_ENABLE(build-dird,
510 [ --enable-build-dird enable building of dird (Director) [enabled]],
511 [if test x$enableval = xno; then
514 if test x$build_dird = xyes; then
519 DIR_TOOLS="NODIRTOOLS"
524 # -------------------------------------------
525 # stored (default on)
526 # -------------------------------------------
527 AC_ARG_ENABLE(build-stored,
528 [ --enable-build-stored enable building of stored (Storage daemon) [enabled]],
529 [if test x$enableval = xno; then
532 if test x$build_stored = xyes; then
533 STORED_DIR="src/stored"
539 # ---------------------------------------------------
540 # Check for conio (Bacula readline substitute)(
541 # ---------------------------------------------------
542 # this allows you to turn it completely off
544 [ --disable-conio disable conio support [enabled]
546 [if test x$enableval = xno; then
552 # ---------------------------------------------------
553 # Check for IPv6 support
554 # ---------------------------------------------------
555 # this allows you to turn it completely off
558 [ --enable-ipv6 enable ipv6 support [enabled]
560 [if test x$enableval = xno; then
565 if test x$support_ipv6 = xyes; then
566 AC_TRY_LINK([ #include <sys/types.h>
567 #include <sys/socket.h>
568 #include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;],
569 [support_ipv6=yes], [support_ipv6=no])
572 if test x$support_ipv6 = xyes; then
573 AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
579 if test x$support_conio = xyes; then
580 AC_CHECK_HEADER(termcap.h,
581 [ AC_CHECK_LIB(termcap, tgetent,
582 [ CONS_LIBS="-ltermcap"
587 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
589 [ AC_CHECK_LIB(ncurses, tgetent,
590 [ CONS_LIBS="-lncurses"
595 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
600 AC_CHECK_HEADERS(curses.h)
601 AC_CHECK_HEADER(term.h,
602 [ AC_CHECK_LIB(curses, tgetent,
603 [ CONS_LIBS="-lcurses"
608 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
611 [ echo " "; echo "Required libraries not found. CONIO turned off ..."; echo " "],
620 # ---------------------------------------------------
621 # Check for readline support/directory (default off)
622 # ---------------------------------------------------
623 # this allows you to turn it completely off
624 AC_ARG_ENABLE(readline,
625 [ --disable-readline disable readline support [disable]
627 [if test x$enableval = xno; then
633 if test x$support_readline = xyes; then
634 AC_ARG_WITH(readline,
635 [ --with-readline@<:@=DIR@:>@ specify readline library directory],
637 case "$with_readline" in
640 if test -f ${with_readline}/readline.h; then
641 CONS_INC="-I${with_readline}"
642 CONS_LDFLAGS="-L$with_readline"
643 elif test -f ${with_readline}/include/readline/readline.h; then
644 CONS_INC="-I${with_readline}/include/readline"
645 CONS_LDFLAGS="-L${with_readline}/lib"
646 with_readline="${with_readline}/include/readline"
648 with_readline="/usr/include/readline"
650 AC_CHECK_HEADER(${with_readline}/readline.h,
651 [ AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
652 CONS_LIBS="-lreadline -lhistory -ltermcap"
656 echo "readline.h not found. readline turned off ..."
663 # check for standard readline library
664 AC_CHECK_HEADER(/usr/include/readline/readline.h,
665 [ AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
667 CONS_INC="-I/usr/include/readline"
668 CONS_LIBS="-lreadline -ltermcap"
670 # Did not find standard library, so try Bacula's default
671 AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h,
672 [ AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
674 CONS_INC="-I${TOP_DIR}/depkgs/readline"
675 CONS_LIBS="-lreadline -lhistory -ltermcap"
676 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
677 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
680 echo "readline.h not found. readline turned off ..."
696 AC_SUBST(CONS_LDFLAGS)
697 AC_SUBST(READLINE_SRC)
699 # Minimal stuff for readline Makefile configuration
704 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr lstat lchown)
705 AC_CHECK_FUNCS(nanosleep nl_langinfo)
706 AC_CHECK_HEADERS(varargs.h)
708 # End of readline/conio stuff
709 # -----------------------------------------------------------------------
711 # -----------------------------------------------------------------------
712 # Check for Python support
714 AC_MSG_CHECKING(for Python support)
717 --with-python@<:@=DIR@:>@ Include Python support. DIR is the Python base
718 install directory, default is to search through
719 a number of common places for the Python files.],
723 if test "$withval" != "no"; then
724 if test "$withval" = "yes"; then
725 for python_root in /usr /usr/local /usr/sfw; do
726 for ver in python2.2 python2.3 python2.4 python2.5; do
727 if test -f $python_root/include/${ver}/Python.h; then
728 PYTHON_INCDIR=-I$python_root/include/${ver}
729 if test -d $python_root/lib64/${ver}/config; then
730 PYTHON_LIBS="-L$python_root/lib64/${ver}/config -l${ver}"
732 PYTHON_LIBS="-L$python_root/lib/${ver}/config -l${ver}"
738 if test x$PYTHON_INCDIR = x; then
739 if test -f $prefix/include/Python.h; then
740 PYTHON_INCDIR=-I$prefix/include
741 if test -d $prefix/lib64/config; then
742 PYTHON_LIBS="-L$prefix/lib64/config -lpython"
744 PYTHON_LIBS="-L$prefix/lib/config -lpython"
748 AC_MSG_ERROR(Unable to find Python.h in standard locations)
752 if test -f $withval/Python.h; then
753 PYTHON_INCDIR=-I$withval
754 PYTHON_LIBS="-L$withval/config -lpython"
755 elif test -f $withval/include/Python.h; then
756 PYTHON_INCDIR=-I$withval/include
757 if test -d $withval/lib64/config; then
758 PYTHON_LIBS="-L$withval/lib64/config -lpython"
760 PYTHON_LIBS="-L$withval/lib/config -lpython"
762 elif test -f $withval/include/python/Python.h; then
763 PYTHON_INCDIR=-I$withval/include/python
764 if test -d $withval/lib64/python/config; then
765 PYTHON_LIBS="-L$withval/lib64/python/config -lpython"
767 PYTHON_LIBS="-L$withval/lib/python/config -lpython"
771 AC_MSG_ERROR(Invalid Python directory $withval - unable to find Python.h under $withval)
774 AC_DEFINE([HAVE_PYTHON], 1)
777 AC_MSG_NOTICE(checking for more Python libs)
778 saved_LIBS="$LIBS"; LIBS=
779 AC_SEARCH_LIBS(shm_open, [rt])
780 AC_CHECK_LIB(util, openpty)
781 PYTHON_LIBS="$PYTHON_LIBS $LIBS"
789 AC_SUBST(PYTHON_LIBS)
790 AC_SUBST(PYTHON_INCDIR)
793 # Find where sockets are (especially for Solaris)
794 # Do this before the TCP Wrappers test since tcp wrappers
795 # uses the socket library and some linkers are stupid.
797 AC_CHECK_FUNC(socket,
798 AC_MSG_RESULT(using libc's socket),
799 AC_CHECK_LIB(xnet,socket)
800 AC_CHECK_LIB(socket,socket)
801 AC_CHECK_LIB(inet,socket))
804 # -----------------------------------------------------------
805 # Check whether user wants TCP wrappers support (default off)
806 # -----------------------------------------------------------
809 AC_ARG_WITH(tcp-wrappers,
810 [ --with-tcp-wrappers@<:@=DIR@:>@ enable tcpwrappers support],
812 if test "x$withval" != "xno" ; then
814 LIBS="$saved_LIBS -lwrap"
815 AC_MSG_CHECKING(for libwrap)
816 AC_SEARCH_LIBS(nanosleep, [rt])
818 [ #include <sys/types.h>
820 int deny_severity = 0;
821 int allow_severity = 0;
822 struct request_info *req; ],
823 [ hosts_access(req); ],
826 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
831 LIBS="$saved_LIBS -lwrap -lnsl"
832 WRAPLIBS="$saved_LIBS -lwrap -lnsl"
834 [ #include <sys/types.h>
836 int deny_severity = 0;
837 int allow_severity = 0;
838 struct request_info *req; ],
839 [ hosts_access(req); ],
842 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
847 [AC_MSG_ERROR([*** libwrap missing]) ] ]
854 # -----------------------------------------------------------
855 # Check whether OpenSSL is available
856 # -----------------------------------------------------------
857 AC_MSG_CHECKING([for OpenSSL])
858 dnl The following uses quadrigraphs:
862 AC_HELP_STRING([--with-openssl@<:@=DIR@:>@], [Include OpenSSL support. DIR is the OpenSSL base]),
863 [with_openssl_directory=${withval}])
865 if test "x$with_openssl_directory" != "x"; then
866 OPENSSL_LIBS="-lssl -lcrypto"
869 if test "x$with_openssl_directory" != "xyes" && test x"${with_openssl_directory}" != "x"; then
870 OPENSSL_LIBS="-L$with_openssl_directory/lib $OPENSSL_LIBS"
871 OPENSSL_INC="-I$with_openssl_directory/include $OPENSSL_INC"
875 saved_CFLAGS="${CFLAGS}"
876 LIBS="${saved_LIBS} ${OPENSSL_LIBS}"
877 CFLAGS="${saved_CFLAGS} ${OPENSSL_INC}"
879 AC_TRY_LINK([ #include <openssl/ssl.h> ],
880 [ CRYPTO_set_id_callback(NULL); ],
888 AC_TRY_LINK([ #include <openssl/evp.h> ],
890 [ ac_cv_openssl_sha2="yes" ],
891 [ ac_cv_openssl_sha2="no" ]
894 # Solaris disables greater than 128+ bit encryption in their OpenSSL
895 # implementation, presumably for export reasons. If 192bit AES
896 # is available, we assume that we're running with a 'non-export'
898 AC_TRY_LINK([ #include <openssl/evp.h> ],
899 [ EVP_aes_192_cbc(); ],
900 [ ac_cv_openssl_export="no" ],
901 [ ac_cv_openssl_export="yes" ]
905 CFLAGS="${saved_CFLAGS}"
907 if test "$support_tls" = "yes"; then
908 AC_DEFINE(HAVE_OPENSSL, 1, [Define if OpenSSL library is available])
909 AC_DEFINE(HAVE_TLS, 1, [Define if TLS support should be enabled])
910 AC_DEFINE(HAVE_CRYPTO, 1, [Define if encryption support should be enabled])
913 if test "$ac_cv_openssl_sha2" = "yes"; then
914 AC_DEFINE(HAVE_SHA2, 1, [Define if the SHA-2 family of digest algorithms is available])
917 if test "$ac_cv_openssl_export" = "yes"; then
918 AC_DEFINE(HAVE_OPENSSL_EXPORT_LIBRARY, 1, [Define if the OpenSSL library is export-contrained to 128bit ciphers])
927 AC_MSG_RESULT([$support_tls])
928 AC_SUBST(OPENSSL_LIBS)
929 AC_SUBST(OPENSSL_INC)
932 # -----------------------------------------------------------
933 # dlopen is needed for plugins
934 # -----------------------------------------------------------
935 AC_SEARCH_LIBS(dlopen, [dl])
937 # ------------------------------------------
938 # Where to place working dir
939 # ------------------------------------------
940 working_dir=`eval echo ${prefix}/var/bacula/working`
941 AC_ARG_WITH(working-dir,
942 [ --with-working-dir=PATH specify path of Bacula working directory],
944 if test "x$withval" != "xno" ; then
950 AC_SUBST(working_dir)
952 # ------------------------------------------------------------------
953 # If the user has not set archivedir, we set our default as /tmp
954 # ------------------------------------------------------------------
956 AC_ARG_WITH(archivedir,
957 [ --with-archivedir=PATH specify path of SD archive directory],
959 if test "x$withval" != "xno" ; then
969 # ------------------------------------------
970 # Where to place scriptdir (script files)
971 # ------------------------------------------
972 scriptdir=`eval echo ${sysconfdir}`
973 AC_ARG_WITH(scriptdir,
974 [ --with-scriptdir=PATH specify path of Bacula scripts directory],
976 if test "x$withval" != "xno" ; then
985 # ------------------------------------------
986 # Where to send dump email
987 # ------------------------------------------
988 dump_email=root@localhost
989 AC_ARG_WITH(dump-email,
990 [ --with-dump-email=EMAIL dump email address],
992 if test "x$withval" != "xno" ; then
1000 # ------------------------------------------
1001 # Where to send job email
1002 # ------------------------------------------
1003 job_email=root@localhost
1004 AC_ARG_WITH(job-email,
1005 [ --with-job-email=EMAIL job output email address],
1007 if test "x$withval" != "xno" ; then
1015 # ------------------------------------------
1016 # Where to find smtp host
1017 # ------------------------------------------
1019 AC_ARG_WITH(smtp_host,
1020 [ --with-smtp-host=HOST SMTP mail host address],
1022 if test "x$withval" != "xno" ; then
1031 # ------------------------------------
1032 # Where to place pid files
1033 # ------------------------------------
1035 AC_ARG_WITH(pid-dir,
1036 [ --with-pid-dir=PATH specify location of Bacula pid files],
1038 if test "x$withval" != "xno" ; then
1044 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
1048 # ------------------------------------
1049 # Where to place subsys "lock file"
1050 # ------------------------------------
1051 subsysdir=/var/run/subsys
1052 if test -d /var/run/subsys; then
1053 subsysdir=/var/run/subsys
1054 elif test -d /var/lock/subsys; then
1055 subsysdir=/var/lock/subsys
1057 subsysdir=/var/run/subsys
1059 AC_ARG_WITH(subsys-dir,
1060 [ --with-subsys-dir=PATH specify location of Bacula subsys file],
1062 if test "x$withval" != "xno" ; then
1072 # ------------------------------------
1073 # Where to start assigning ports
1074 # ------------------------------------
1076 AC_ARG_WITH(baseport,
1077 [ --with-baseport=PORT specify base port address for daemons],
1079 if test "x$withval" != "xno" ; then
1086 dir_port=`expr $baseport`
1087 fd_port=`expr $baseport + 1`
1088 sd_port=`expr $fd_port + 1`
1095 # ------------------------------------------
1096 # Generate passwords
1097 # ------------------------------------------
1099 AC_ARG_WITH(dir-password,
1100 [ --with-dir-password=PASSWORD specify Director's password],
1102 if test "x$withval" != "xno" ; then
1103 dir_password=$withval
1108 if test "x$dir_password" = "x" ; then
1109 if test "x$OPENSSL" = "xnone" ; then
1110 key=`autoconf/randpass 33`
1112 key=`openssl rand -base64 33`
1118 AC_ARG_WITH(fd-password,
1119 [ --with-fd-password=PASSWORD specify Client's password],
1121 if test "x$withval" != "xno" ; then
1122 fd_password=$withval
1127 if test "x$fd_password" = "x" ; then
1128 if test "x$OPENSSL" = "xnone" ; then
1129 key=`autoconf/randpass 37`
1131 key=`openssl rand -base64 33`
1137 AC_ARG_WITH(sd-password,
1138 [ --with-sd-password=PASSWORD specify Storage daemon's password],
1140 if test "x$withval" != "xno" ; then
1141 sd_password=$withval
1146 if test "x$sd_password" = "x" ; then
1147 if test "x$OPENSSL" = "xnone" ; then
1148 key=`autoconf/randpass 41`
1150 key=`openssl rand -base64 33`
1156 AC_ARG_WITH(mon-dir-password,
1157 [ --with-mon-dir-password=PASSWORD specify Director's password used by the monitor],
1159 if test "x$withval" != "xno" ; then
1160 mon_dir_password=$withval
1165 if test "x$mon_dir_password" = "x" ; then
1166 if test "x$OPENSSL" = "xnone" ; then
1167 key=`autoconf/randpass 33`
1169 key=`openssl rand -base64 33`
1171 mon_dir_password=$key
1175 AC_ARG_WITH(mon-fd-password,
1176 [ --with-mon-fd-password=PASSWORD specify Client's password used by the monitor],
1178 if test "x$withval" != "xno" ; then
1179 mon_fd_password=$withval
1184 if test "x$mon_fd_password" = "x" ; then
1185 if test "x$OPENSSL" = "xnone" ; then
1186 key=`autoconf/randpass 37`
1188 key=`openssl rand -base64 33`
1190 mon_fd_password=$key
1194 AC_ARG_WITH(mon-sd-password,
1195 [ --with-mon-sd-password=PASSWORD specify Storage daemon's password used by the monitor],
1197 if test "x$withval" != "xno" ; then
1198 mon_sd_password=$withval
1203 if test "x$mon_sd_password" = "x" ; then
1204 if test "x$OPENSSL" = "xnone" ; then
1205 key=`autoconf/randpass 41`
1207 key=`openssl rand -base64 33`
1209 mon_sd_password=$key
1212 AC_SUBST(dir_password)
1213 AC_SUBST(fd_password)
1214 AC_SUBST(sd_password)
1215 AC_SUBST(mon_dir_password)
1216 AC_SUBST(mon_fd_password)
1217 AC_SUBST(mon_sd_password)
1220 # Pickup any database name
1223 AC_ARG_WITH(db_name,
1224 [ --with-db-name=DBNAME specify database name (default bacula)],
1226 if test "x$withval" != "x" ; then
1234 AC_ARG_WITH(db_user,
1235 [ --with-db-user=UNAME specify database user (default bacula)],
1237 if test "x$withval" != "x" ; then
1245 AC_ARG_WITH(db_password,
1246 [ --with-db-password=UNAME specify database password (default *none*)],
1248 if test "x$withval" != "x" ; then
1249 db_password=$withval
1253 AC_SUBST(db_password)
1256 # Handle users and groups for each daemon
1259 AC_ARG_WITH(dir_user,
1260 [ --with-dir-user=USER specify user for Director daemon],
1262 if test "x$withval" != "x" ; then
1269 AC_ARG_WITH(dir_group,
1270 [ --with-dir-group=GROUP specify group for Director daemon],
1272 if test "x$withval" != "x" ; then
1279 AC_ARG_WITH(sd_user,
1280 [ --with-sd-user=USER specify user for Storage daemon],
1282 if test "x$withval" != "x" ; then
1289 AC_ARG_WITH(sd_group,
1290 [ --with-sd-group=GROUP specify group for Storage daemon],
1292 if test "x$withval" != "x" ; then
1299 AC_ARG_WITH(fd_user,
1300 [ --with-fd-user=USER specify user for File daemon],
1302 if test "x$withval" != "x" ; then
1309 AC_ARG_WITH(fd_group,
1310 [ --with-fd-group=GROUP specify group for File daemon],
1312 if test "x$withval" != "x" ; then
1326 # allow setting default executable permissions
1329 AC_ARG_WITH(sbin-perm,
1330 [ --with-sbin-perm=MODE specify permissions for sbin binaries (0754)],
1332 if test "x$withval" != "x" ; then
1340 # ------------------------------------------------
1341 # Bacula check for various SQL database engines
1342 # ------------------------------------------------
1344 BA_CHECK_POSTGRESQL_DB
1359 # -------------------------------------------
1360 # enable batch attribute DB insert (default on)
1361 # -------------------------------------------
1362 support_batch_insert=no
1363 A=`nm $SQL_LIB | grep pthread_mutex_lock`
1365 if test $pkg = 0; then
1366 support_batch_insert=yes
1367 AC_ARG_ENABLE(batch-insert,
1368 [ --enable-batch-insert enable the DB batch insert code [disabled]],
1369 [if test x$enableval = xno; then
1370 support_batch_insert=no
1372 support_batch_insert=yes
1376 # Check if postgresql support batch mode
1377 if test x$DB_TYPE = xpostgresql; then
1378 A=`nm $SQL_LIB | grep PQputCopyData`
1380 if test $pkg != 0; then
1381 support_batch_insert=no
1385 if test x$DB_TYPE = xdbi; then
1389 # Check for batch insert
1390 if test $DB_PROG = postgresql; then
1391 A=`nm $DB_PROG_LIB | grep PQputCopyData`
1395 if test $DB_PROG = mysql; then
1396 A=`nm $DB_PROG_LIB | grep pthread_mutex_lock`
1400 if test $pkg = 0; then
1401 AC_ARG_ENABLE(batch-insert,
1402 [ --enable-batch-insert enable the DB batch insert code [disabled]],
1403 [if test x$enableval = xno; then
1404 support_batch_insert=no
1406 support_batch_insert=yes
1411 if test $support_batch_insert = yes ; then
1412 AC_DEFINE(HAVE_BATCH_FILE_INSERT, 1, [Set if DB batch insert code enabled])
1416 AC_DEFINE(PROTOTYPES)
1418 dnl# --------------------------------------------------------------------------
1419 dnl# Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
1421 if test -z "$CFLAGS" -o "$CFLAGS" = "-g -O2"; then
1422 if test -z "$CCOPTS"; then
1423 CCOPTS='-g -O2 -Wall'
1432 dnl See if we can use 64 bit file addresses
1433 largefile_support="no"
1439 dnl# --------------------------------------------------------------------------
1440 dnl# CHECKING FOR HEADER FILES
1441 dnl# --------------------------------------------------------------------------
1480 AC_STRUCT_ST_BLKSIZE
1484 dnl# --------------------------------------------------------------------------
1485 dnl# Check for utime.h structure
1486 dnl# --------------------------------------------------------------------------
1487 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
1489 #include <sys/types.h>
1490 #include <utime.h>], [struct utimbuf foo],
1491 ba_cv_header_utime_h=yes, ba_cv_header_utime_h=no)])
1492 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H, 1, [Set if utime.h exists])
1494 dnl# --------------------------------------------------------------------------
1495 dnl# Check for socklen_t
1496 dnl# --------------------------------------------------------------------------
1497 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
1499 #include <sys/types.h>
1500 #include <sys/socket.h>],
1502 ba_cv_header_socklen_t=yes, ba_cv_header_socklen_t=no)])
1503 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T)
1505 dnl# --------------------------------------------------------------------------
1506 dnl# Check for bigendian
1507 dnl# --------------------------------------------------------------------------
1508 AC_CACHE_CHECK([for bigendian], ba_cv_bigendian,
1510 [main(){long a=1L; char *p=(char *)&a; exit(*p);}],
1511 [ba_cv_bigendian=yes],
1512 [ba_cv_bigendian=no],
1513 [ba_cv_bigendian=no])])
1514 test $ba_cv_bigendian = yes && AC_DEFINE(HAVE_BIGENDIAN)
1516 dnl# --------------------------------------------------------------------------
1517 dnl# Check for typeof()
1518 dnl# --------------------------------------------------------------------------
1520 AC_CACHE_CHECK(for typeof, ba_cv_have_typeof,
1522 [main(){char *a = 0; a = (typeof a)a;}],
1523 [ba_cv_have_typeof=yes],
1524 [ba_cv_have_typeof=no],
1525 [ba_cv_have_typeof=no])])
1526 test $ba_cv_have_typeof = yes && AC_DEFINE([HAVE_TYPEOF], 1, [Defind to 1 if compiler has typeof])
1532 dnl# --------------------------------------------------------------------------
1533 dnl# CHECKING FOR FILESYSTEM TYPE
1534 dnl# --------------------------------------------------------------------------
1535 AC_MSG_CHECKING(how to get filesystem type)
1537 # The order of these tests is important.
1538 AC_TRY_CPP([#include <sys/statvfs.h>
1539 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4)
1540 if test $fstype = no; then
1541 AC_TRY_CPP([#include <sys/statfs.h>
1542 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3)
1544 if test $fstype = no; then
1545 AC_TRY_CPP([#include <sys/statfs.h>
1546 #include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX)
1548 if test $fstype = no; then
1549 AC_TRY_CPP([#include <mntent.h>], AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD)
1551 if test $fstype = no; then
1552 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
1554 if test $fstype = no; then
1555 AC_TRY_CPP([#include <sys/mount.h>
1556 #include <sys/fs_types.h>], AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix)
1558 AC_MSG_RESULT($fstype)
1560 AC_CHECK_HEADER(sys/statvfs.h, [ AC_DEFINE(HAVE_SYS_STATVFS_H,1,[Defines if your system have the sys/statvfs.h header file])] , )
1562 dnl# --------------------------------------------------------------------------
1563 dnl# CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
1564 dnl# --------------------------------------------------------------------------
1572 AC_CHECK_TYPE(ino_t, unsigned long)
1573 AC_CHECK_TYPE(dev_t, unsigned long)
1574 AC_CHECK_TYPE(daddr_t, long)
1575 AC_CHECK_TYPE(major_t, int)
1576 AC_CHECK_TYPE(minor_t, int)
1577 AC_CHECK_TYPE(ssize_t, int)
1584 AC_CHECK_SIZEOF(char, 1)
1585 AC_CHECK_SIZEOF(short int, 2)
1586 AC_CHECK_SIZEOF(int, 4)
1587 AC_CHECK_SIZEOF(long int, 4)
1588 AC_CHECK_SIZEOF(long long int, 8)
1589 AC_CHECK_SIZEOF(int *, 4)
1591 # Check for sys/types.h types
1592 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1594 [ #include <sys/types.h> ],
1596 [ ac_cv_have_u_int="yes" ],
1597 [ ac_cv_have_u_int="no" ]
1600 if test "x$ac_cv_have_u_int" = "xyes" ; then
1601 AC_DEFINE(HAVE_U_INT)
1605 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t, [
1607 [ #include <sys/types.h> ],
1608 [ intmax_t a; a = 1;],
1609 [ ac_cv_have_intmax_t="yes" ],
1612 [ #include <stdint.h> ],
1613 [ intmax_t a; a = 1;],
1614 [ ac_cv_have_intmax_t="yes" ],
1615 [ ac_cv_have_intmax_t="no" ]
1621 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
1622 AC_DEFINE(HAVE_INTMAX_T)
1627 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t, [
1629 [ #include <sys/types.h> ],
1630 [ u_intmax_t a; a = 1;],
1631 [ ac_cv_have_u_intmax_t="yes" ],
1634 [ #include <stdint.h> ],
1635 [ u_intmax_t a; a = 1;],
1636 [ ac_cv_have_u_intmax_t="yes" ],
1637 [ ac_cv_have_u_intmax_t="no" ]
1642 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
1643 AC_DEFINE(HAVE_U_INTMAX_T)
1648 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1650 [ #include <sys/types.h> ],
1651 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1652 [ ac_cv_have_intxx_t="yes" ],
1653 [ ac_cv_have_intxx_t="no" ]
1656 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1657 AC_DEFINE(HAVE_INTXX_T)
1661 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1663 [ #include <sys/types.h> ],
1664 [ int64_t a; a = 1;],
1665 [ ac_cv_have_int64_t="yes" ],
1666 [ ac_cv_have_int64_t="no" ]
1669 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1670 AC_DEFINE(HAVE_INT64_T)
1674 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1676 [ #include <sys/types.h> ],
1677 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1678 [ ac_cv_have_u_intxx_t="yes" ],
1679 [ ac_cv_have_u_intxx_t="no" ]
1682 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1683 AC_DEFINE(HAVE_U_INTXX_T)
1687 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1689 [ #include <sys/types.h> ],
1690 [ u_int64_t a; a = 1;],
1691 [ ac_cv_have_u_int64_t="yes" ],
1692 [ ac_cv_have_u_int64_t="no" ]
1695 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1696 AC_DEFINE(HAVE_U_INT64_T)
1700 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1701 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1703 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1705 [ #include <sys/bitypes.h> ],
1706 [ int8_t a; int16_t b; int32_t c;
1707 u_int8_t e; u_int16_t f; u_int32_t g;
1708 a = b = c = e = f = g = 1; ],
1709 [ AC_DEFINE(HAVE_U_INTXX_T)
1710 AC_DEFINE(HAVE_INTXX_T)
1711 AC_DEFINE(HAVE_SYS_BITYPES_H)
1712 AC_MSG_RESULT(yes) ],
1713 [ AC_MSG_RESULT(no)]
1717 if test -z "$have_u_intxx_t" ; then
1718 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1720 [ #include <sys/types.h> ],
1721 [ uint8_t a; uint16_t b;
1722 uint32_t c; a = b = c = 1; ],
1723 [ ac_cv_have_uintxx_t="yes" ],
1724 [ ac_cv_have_uintxx_t="no" ]
1727 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1728 AC_DEFINE(HAVE_UINTXX_T)
1732 if (test -z "$have_u_int64_t" || test -z "$have_int64_t" && \
1733 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1735 AC_MSG_CHECKING([for int64_t and u_int64_t types in sys/bitypes.h])
1737 [ #include <sys/bitypes.h> ],
1738 [ int64_t a; u_int64_t b;
1740 [ AC_DEFINE(HAVE_U_INT64_T)
1741 AC_DEFINE(HAVE_INT64_T)
1742 AC_MSG_RESULT(yes) ],
1743 [ AC_MSG_RESULT(no)]
1747 if (test -z "$have_uintxx_t" && \
1748 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1750 AC_MSG_CHECKING([for uintXX_t types in sys/bitypes.h])
1752 [ #include <sys/bitypes.h> ],
1753 [ uint8_t a; uint16_t b;
1754 uint32_t c; a = b = c = 1; ],
1755 [ AC_DEFINE(HAVE_UINTXX_T)
1756 AC_MSG_RESULT(yes) ],
1757 [ AC_MSG_RESULT(no)]
1765 dnl# --------------------------------------------------------------------------
1766 dnl# CHECKING FOR REQUIRED LIBRARY FUNCTIONS
1767 dnl# --------------------------------------------------------------------------
1783 [echo 'configure: cannot find needed function.'; exit 1]
1786 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
1787 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
1788 AC_CHECK_FUNCS(posix_fadvise)
1789 AC_CHECK_FUNCS(fdatasync)
1791 AC_CHECK_FUNCS(chflags)
1793 AC_CHECK_FUNCS(snprintf vsnprintf gethostid fseeko)
1795 AC_CACHE_CHECK(for va_copy, ba_cv_va_copy,
1798 void use_va_copy(va_list args){va_list args2; va_copy(args2,args); va_end(args2);}
1799 void call_use_va_copy(int junk,...){va_list args; va_start(args,junk); use_va_copy(args); va_end(args);}
1801 [call_use_va_copy(1,2,3)],
1802 ba_cv_va_copy=yes, ba_cv_va_copy=no)])
1803 test $ba_cv_va_copy = yes && AC_DEFINE(HAVE_VA_COPY, 1, [Set if va_copy exists])
1806 dnl# --------------------------------------------------------------------------
1807 dnl# CHECKING FOR THREAD SAFE FUNCTIONS
1808 dnl# --------------------------------------------------------------------------
1809 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
1811 # If resolver functions are not in libc check for -lnsl or -lresolv.
1812 AC_CHECK_FUNC(gethostbyname_r,
1813 AC_MSG_RESULT(using libc's resolver),
1814 AC_CHECK_LIB(nsl,gethostbyname_r)
1815 AC_CHECK_LIB(resolv,gethostbyname_r))
1819 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
1820 AC_CHECK_FUNCS(inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)])
1821 AC_CHECK_FUNCS(gethostbyname2, [AC_DEFINE(HAVE_GETHOSTBYNAME2)])
1823 dnl ----------------------------
1824 dnl check sa_len of sockaddr
1825 dnl ----------------------------
1826 AC_CACHE_CHECK(for struct sockaddr has a sa_len field, ac_cv_struct_sockaddr_sa_len,
1827 [AC_TRY_COMPILE([#include <sys/socket.h>], [struct sockaddr s; s.sa_len;],
1828 ac_cv_struct_sockaddr_sa_len=yes, ac_cv_struct_sockaddr_sa_len=no)])
1830 if test $ac_cv_struct_sockaddr_sa_len = yes; then
1831 AC_DEFINE(HAVE_SA_LEN, 1, [Define if sa_len field exists in struct sockaddr])
1841 AC_FUNC_CLOSEDIR_VOID
1842 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
1843 # AC_FUNC_FNMATCH dnl use local version
1846 AC_CHECK_LIB(intl, gettext, [LIBS="$LIBS -lintl"])
1849 AC_CHECK_LIB(sun, getpwnam)
1851 AC_CHECK_HEADERS(zlib.h)
1852 AC_CHECK_LIB(z, deflate, [FDLIBS="-lz"])
1854 if test x$FDLIBS = x-lz; then
1855 AC_DEFINE(HAVE_LIBZ)
1860 # Check for ACL libraries
1863 AC_CHECK_HEADER(sys/acl.h)
1864 AC_CHECK_FUNC(acl_get_file, [have_acl=yes],
1865 [AC_CHECK_LIB(acl, acl_get_file, [have_acl=yes; FDLIBS="-lacl $FDLIBS"],
1866 [AC_CHECK_LIB(sec, acltotext, [have_acl=yes; FDLIBS="-lsec $FDLIBS"])]
1869 if test $have_acl = yes; then
1873 dnl Check for pthread libraries
1875 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
1876 [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
1877 [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
1878 [AC_CHECK_FUNC(pthread_create)]
1889 if test x$have_gcc = xyes ; then
1890 CPPFLAGS="$CPPFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
1891 CFLAGS="$CFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
1893 LDFLAGS=${LDFLAGS--O}
1894 DB_LIBS="${SQL_LFLAGS}"
1895 CPPFLAGS="$CPPFLAGS"
1908 AC_SUBST(X_EXTRA_LIBS)
1913 dnl# extra configurable objects
1924 # Finally we set appropriate distribution specific
1925 # variables and defaults
1927 # PFILES are platform specific files
1928 PFILES="platforms/Makefile"
1932 hostname=`uname -n | cut -d '.' -f 1`
1933 if test x${hostname} = x ; then
1934 hostname="localhost"
1939 PSCMD="ps -e -o pid,comm"
1941 platforms/aix/Makefile"
1942 TAPEDRIVE="/dev/rmt0.1"
1946 PTHREAD_LIB="-lpthread -lexc"
1947 if test "${CC}" = "gcc" ; then
1954 TAPEDRIVE="/dev/nrmt0"
1957 DISTVER=`uname -a |awk '{print $3}'`
1958 TAPEDRIVE="/dev/nrmt0"
1959 PTHREAD_LIB="-pthread"
1960 CFLAGS="${CFLAGS} -pthread"
1961 PSCMD="ps -ax -o pid,command"
1965 platforms/bsdi/Makefile \
1966 platforms/bsdi/bacula-fd \
1967 platforms/bsdi/bacula-sd \
1968 platforms/bsdi/bacula-dir"
1969 largefile_support="yes"
1972 DISTVER=`uname -a |awk '{print $3}'`
1973 TAPEDRIVE="/dev/nrst0"
1976 WLDFLAGS="-mwindows"
1980 TAPEDRIVE="/dev/nst0"
1981 PSCMD="ps -e -o pid,command"
1984 platforms/darwin/Makefile"
1987 if `grep -q ubuntu /etc/apt/sources.list`; then
1990 DISTVER=`cat /etc/debian_version`
1991 if test -f /etc/lsb-release ; then
1993 if test "x$DISTRIB_ID" != "x" ; then
1994 DISTNAME=$DISTRIB_ID
1996 if test "x$DISTRIB_RELEASE" != "x" ; then
1997 DISTVER=$DISTRIB_RELEASE
2000 if test "$DISTNAME" = "Ubuntu" ; then
2003 TAPEDRIVE="/dev/nst0"
2004 PSCMD="ps -e -o pid,command"
2005 if test "$DISTNAME" = "ubuntu" ; then
2007 platforms/ubuntu/Makefile \
2008 platforms/ubuntu/bacula-fd \
2009 platforms/ubuntu/bacula-sd \
2010 platforms/ubuntu/bacula-dir"
2013 platforms/debian/Makefile \
2014 platforms/debian/bacula-fd \
2015 platforms/debian/bacula-sd \
2016 platforms/debian/bacula-dir"
2020 DISTVER=`uname -a |awk '{print $3}'`
2021 VER=`echo $DISTVER | cut -c 1`
2022 if test x$VER = x4 ; then
2023 PTHREAD_LIB="${PTHREAD_LIBS:--pthread}"
2024 CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS:--pthread}"
2028 TAPEDRIVE="/dev/nrsa0"
2029 PSCMD="ps -ax -o pid,command"
2031 platforms/freebsd/Makefile \
2032 platforms/freebsd/bacula-fd \
2033 platforms/freebsd/bacula-sd \
2034 platforms/freebsd/bacula-dir"
2035 largefile_support="yes"
2038 PSCMD="UNIX95=1; ps -e -o pid,comm"
2039 CFLAGS="${CFLAGS} -D_XOPEN_SOURCE_EXTENDED=1"
2041 TAPEDRIVE="/dev/rmt/0hnb"
2042 PTHREAD_LIB="-lpthread"
2043 AC_DEFINE([_INCLUDE_LONGLONG])
2047 TAPEDRIVE="/dev/rmt/0cbn"
2048 PSCMD="ps -e -o pid,comm"
2050 platforms/irix/Makefile \
2051 platforms/irix/bacula-fd \
2052 platforms/irix/bacula-sd \
2053 platforms/irix/bacula-dir"
2056 DISTVER=`uname -a |awk '{print $3}'`
2059 TAPEDRIVE="/dev/nrst0"
2060 PSCMD="ps -ax -o pid,command"
2061 PTHREAD_LIB="-pthread"
2062 CFLAGS="${CFLAGS} -pthread"
2065 DISTVER=`uname -a |awk '{print $3}'`
2068 TAPEDRIVE="/dev/nrst0"
2069 PSCMD="ps -ax -o pid,command"
2070 PTHREAD_LIB="-pthread"
2071 CFLAGS="${CFLAGS} -pthread"
2073 platforms/openbsd/Makefile \
2074 platforms/openbsd/bacula-fd \
2075 platforms/openbsd/bacula-sd \
2076 platforms/openbsd/bacula-dir"
2079 if test -f /etc/whitebox-release ; then
2080 f=/etc/whitebox-release
2082 f=/etc/redhat-release
2084 if test `cat $f | grep release |\
2085 cut -f 3 -d ' '`x = "Enterprise"x ; then
2086 DISTVER="Enterprise "`cat $f | grep release |\
2089 DISTVER=`cat /etc/redhat-release | grep release |\
2092 TAPEDRIVE="/dev/nst0"
2093 PSCMD="ps -e -o pid,command"
2095 platforms/redhat/Makefile \
2096 platforms/redhat/bacula-fd \
2097 platforms/redhat/bacula-sd \
2098 platforms/redhat/bacula-dir \
2099 platforms/redhat/bacula.spec \
2103 DISTVER=`cat /etc/mandrake-release | grep release |\
2105 TAPEDRIVE="/dev/nst0"
2106 PSCMD="ps -e -o pid,command"
2108 platforms/mandrake/Makefile \
2109 platforms/mandrake/bacula-fd \
2110 platforms/mandrake/bacula-sd \
2111 platforms/mandrake/bacula-dir \
2112 platforms/mandrake/bacula.spec \
2116 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
2117 TAPEDRIVE="/dev/nst0"
2118 PSCMD="ps -e -o pid,command"
2120 platforms/gentoo/Makefile \
2121 platforms/gentoo/bacula-init \
2122 platforms/gentoo/bacula-fd \
2123 platforms/gentoo/bacula-sd \
2124 platforms/gentoo/bacula-dir"
2127 DISTVER=`cat /etc/slackware-version`
2128 TAPEDRIVE="/dev/nst0"
2129 PSCMD="ps -e -o pid,command"
2131 platforms/slackware/Makefile \
2132 platforms/slackware/rc.bacula-fd \
2133 platforms/slackware/rc.bacula-sd \
2134 platforms/slackware/rc.bacula-dir\
2135 platforms/slackware/functions.bacula"
2139 TAPEDRIVE="/dev/rmt/0cbn"
2140 PSCMD="ps -e -o pid,comm"
2142 platforms/solaris/Makefile \
2143 platforms/solaris/bacula-fd \
2144 platforms/solaris/bacula-sd \
2145 platforms/solaris/bacula-dir"
2146 if test x$DISTVER = x5.6 ; then
2147 AC_DEFINE(HAVE_OLD_SOCKOPT)
2149 LIBS="$LIBS -lresolv"
2152 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
2154 TAPEDRIVE="/dev/nst0"
2155 PSCMD="ps -e -o pid,command"
2157 platforms/suse/Makefile \
2158 platforms/suse/bacula-fd \
2159 platforms/suse/bacula-sd \
2160 platforms/suse/bacula-dir \
2161 platforms/suse/bacula \
2162 platforms/suse/bacula.spec"
2167 TAPEDRIVE="/dev/nst0"
2168 PSCMD="ps -e -o pid,command"
2170 platforms/suse/Makefile \
2171 platforms/suse/bacula-fd \
2172 platforms/suse/bacula-sd \
2173 platforms/suse/bacula-dir"
2177 TAPEDRIVE="/dev/nst0"
2180 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
2186 LIBS="$PTHREAD_LIB $LIBS"
2188 AC_DEFINE_UNQUOTED(lld, "$lld")
2189 AC_DEFINE_UNQUOTED(llu, "$llu")
2197 dnl# common parts of the Makefile
2198 MCOMMON=./autoconf/Make.common
2199 AC_SUBST_FILE(MCOMMON)
2202 if test "x${subsysdir}" = "x${sbindir}" ; then
2205 echo "You have set both --sbindir and --with-subsys-dir"
2206 echo " equal to: ${subsysdir} "
2207 echo "This is not permitted. Please reconfigure."
2209 echo "Aborting configuration ..."
2215 AC_OUTPUT([autoconf/Make.common \
2218 scripts/startmysql \
2220 scripts/btraceback \
2226 scripts/bacula-ctl-dir \
2227 scripts/bacula-ctl-fd \
2228 scripts/bacula-ctl-sd \
2229 scripts/devel_bacula \
2232 scripts/bacula.desktop.gnome1 \
2233 scripts/bacula.desktop.gnome2 \
2234 scripts/bacula.desktop.gnome1.consolehelper \
2235 scripts/bacula.desktop.gnome2.consolehelper \
2236 scripts/bacula.desktop.gnome1.xsu \
2237 scripts/bacula.desktop.gnome2.xsu \
2238 scripts/bgnome-console.console_apps \
2239 scripts/mtx-changer \
2240 scripts/disk-changer \
2241 scripts/dvd-handler \
2242 scripts/dvd-simulator \
2243 scripts/bacula-tray-monitor.desktop \
2244 scripts/logwatch/Makefile \
2245 scripts/logwatch/logfile.bacula.conf \
2246 scripts/wxconsole.console_apps \
2247 scripts/wxconsole.desktop.consolehelper \
2248 scripts/wxconsole.desktop.xsu \
2249 scripts/bat.desktop \
2250 scripts/bat.desktop.xsu \
2251 scripts/bat.desktop.consolehelper \
2252 scripts/bat.console_apps \
2255 src/console/Makefile \
2256 src/console/bconsole.conf \
2257 src/gnome2-console/Makefile \
2258 src/gnome2-console/bgnome-console.conf \
2259 src/qt-console/bat.conf \
2260 src/qt-console/bat.pro \
2261 src/qt-console/install_conf_file \
2262 src/wx-console/Makefile \
2263 src/wx-console/bwx-console.conf \
2264 src/tray-monitor/Makefile \
2265 src/tray-monitor/tray-monitor.conf \
2267 src/dird/bacula-dir.conf \
2269 src/stored/Makefile \
2270 src/stored/bacula-sd.conf \
2271 src/filed/Makefile \
2272 src/filed/bacula-fd.conf \
2274 src/cats/make_catalog_backup \
2275 src/cats/delete_catalog_backup \
2276 src/cats/create_postgresql_database \
2277 src/cats/update_postgresql_tables \
2278 src/cats/make_postgresql_tables \
2279 src/cats/grant_postgresql_privileges \
2280 src/cats/drop_postgresql_tables \
2281 src/cats/drop_postgresql_database \
2282 src/cats/create_mysql_database \
2283 src/cats/update_mysql_tables \
2284 src/cats/make_mysql_tables \
2285 src/cats/grant_mysql_privileges \
2286 src/cats/drop_mysql_tables \
2287 src/cats/drop_mysql_database \
2288 src/cats/create_sqlite_database \
2289 src/cats/update_sqlite_tables \
2290 src/cats/make_sqlite_tables \
2291 src/cats/grant_sqlite_privileges \
2292 src/cats/drop_sqlite_tables \
2293 src/cats/drop_sqlite_database \
2294 src/cats/create_sqlite3_database \
2295 src/cats/update_sqlite3_tables \
2296 src/cats/make_sqlite3_tables \
2297 src/cats/grant_sqlite3_privileges \
2298 src/cats/drop_sqlite3_tables \
2299 src/cats/drop_sqlite3_database \
2302 src/cats/create_bdb_database \
2303 src/cats/update_bdb_tables \
2304 src/cats/make_bdb_tables \
2305 src/cats/grant_bdb_privileges \
2306 src/cats/drop_bdb_tables \
2307 src/cats/drop_bdb_database \
2308 src/cats/create_bacula_database \
2309 src/cats/update_bacula_tables \
2310 src/cats/grant_bacula_privileges \
2311 src/cats/make_bacula_tables \
2312 src/cats/drop_bacula_tables \
2313 src/cats/drop_bacula_database \
2314 src/findlib/Makefile \
2315 src/tools/Makefile \
2317 updatedb/update_mysql_tables_10_to_11 \
2318 updatedb/update_sqlite3_tables_10_to_11 \
2319 updatedb/update_postgresql_tables_10_to_11 \
2320 updatedb/update_sqlite_tables_10_to_11 \
2325 if test "${support_bat}" = "yes" ; then
2326 if test "x$QMAKE" = "xnone" && test "x$QMAKEQT4" = "xnone"; then
2327 echo "Could not find qmake or qmake-qt4 in $PATH. Check your Qt installation"
2333 if test "x$QMAKEQT4" != "xnone"; then
2338 chmod 755 install_conf_file build-depkgs-qt-console
2339 echo "Creating bat Makefile"
2345 # configure and prepare libtokyodbm for bacula
2346 pushd src/lib/tokyocabinet > /dev/null
2348 if test x$largefile_support = xyes; then
2349 tcdbm_opt=--enable-off64
2351 ./configure $tcdbm_opt
2353 # need tokyo header files for "make depend"
2354 cp src/lib/tokyocabinet/t*.h src/lib
2356 echo "Doing make of dependencies"
2357 ${MAKE:-make} depend
2360 chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
2361 chmod 755 dvd-handler dvd-simulator
2362 chmod 755 bconsole gconsole mtx-changer devel_bacula logrotate
2366 chmod 755 $c/update_mysql_tables_10_to_11 $c/update_sqlite3_tables_10_to_11
2367 chmod 755 $c/update_postgresql_tables_10_to_11 $c/update_sqlite_tables_10_to_11
2371 chmod 755 $c/create_bacula_database $c/update_bacula_tables $c/make_bacula_tables
2372 chmod 755 $c/grant_bacula_privileges $c/drop_bacula_tables $c/drop_bacula_database
2374 chmod 755 $c/create_bdb_database $c/update_bdb_tables $c/make_bdb_tables
2375 chmod 755 $c/grant_bdb_privileges $c/drop_bdb_tables $c/drop_bdb_database
2377 chmod 755 $c/create_mysql_database $c/update_mysql_tables $c/make_mysql_tables
2378 chmod 755 $c/grant_mysql_privileges $c/drop_mysql_tables $c/drop_mysql_database
2380 chmod 755 $c/create_sqlite_database $c/update_sqlite_tables $c/make_sqlite_tables
2381 chmod 755 $c/grant_sqlite_privileges $c/drop_sqlite_tables $c/drop_sqlite_database
2383 chmod 755 $c/create_sqlite3_database $c/update_sqlite3_tables $c/make_sqlite3_tables
2384 chmod 755 $c/grant_sqlite3_privileges $c/drop_sqlite3_tables $c/drop_sqlite3_database
2386 chmod 755 $c/create_postgresql_database $c/update_postgresql_tables $c/make_postgresql_tables
2387 chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables $c/drop_postgresql_database
2389 chmod 755 $c/make_catalog_backup $c/delete_catalog_backup
2393 chmod 755 src/win32/build-depkgs-mingw32
2397 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
2398 largefile_support="yes"
2402 # A whole lot of hand springs to get the compiler version.
2403 # This is because gcc changed the output in version 3.0
2405 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
2406 if test "x${CCVERSION}" = "x" ; then
2407 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
2409 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
2410 if test x"${CXXVERSION}" = x ; then
2411 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
2414 if test "x${subsysdir}" = "x${sbindir}" ; then
2417 echo "You have set --sbindir and --with-subsys-dir"
2418 echo " both equal to: ${subsysdir} "
2419 echo " This is not permitted. Please reconfigure."
2421 echo "Aborting configuration ..."
2427 if test "x${db_type}" = "xInternal" ; then
2430 echo "You have not specified either --enable-client-only or one of the"
2431 echo " supported databases: MySQL, PostgreSQL, SQLite3, SQLite or DBI."
2432 echo " This is not permitted. Please reconfigure."
2434 echo "Aborting the configuration ..."
2441 Configuration on `date`:
2443 Host: $host -- ${DISTNAME} ${DISTVER}
2444 Bacula version: ${VERSION} (${DATE})
2445 Source code location: ${srcdir}
2446 Install binaries: ${sbindir}
2447 Install config files: ${sysconfdir}
2448 Scripts directory: ${scriptdir}
2449 Archive directory: ${archivedir}
2450 Working directory: ${working_dir}
2451 PID directory: ${piddir}
2452 Subsys directory: ${subsysdir}
2453 Man directory: ${mandir}
2454 Data directory: ${datadir}
2455 C Compiler: ${CC} ${CCVERSION}
2456 C++ Compiler: ${CXX} ${CXXVERSION}
2457 Compiler flags: ${WCFLAGS} ${CFLAGS}
2458 Linker flags: ${WLDFLAGS} ${LDFLAGS}
2460 Statically Linked Tools: ${support_static_tools}
2461 Statically Linked FD: ${support_static_fd}
2462 Statically Linked SD: ${support_static_sd}
2463 Statically Linked DIR: ${support_static_dir}
2464 Statically Linked CONS: ${support_static_cons}
2465 Database type: ${db_type}
2466 Database lib: ${DB_LIBS}
2467 Database name: ${db_name}
2468 Database user: ${db_user}
2470 Job Output Email: ${job_email}
2471 Traceback Email: ${dump_email}
2472 SMTP Host Address: ${smtp_host}
2474 Director Port: ${dir_port}
2475 File daemon Port: ${fd_port}
2476 Storage daemon Port: ${sd_port}
2478 Director User: ${dir_user}
2479 Director Group: ${dir_group}
2480 Storage Daemon User: ${sd_user}
2481 Storage DaemonGroup: ${sd_group}
2482 File Daemon User: ${fd_user}
2483 File Daemon Group: ${fd_group}
2485 SQL binaries Directory ${SQL_BINDIR}
2487 Large file support: $largefile_support
2488 Bacula conio support: ${got_conio} ${CONS_LIBS}
2489 readline support: ${got_readline} ${PRTREADLINE_SRC}
2490 TCP Wrappers support: ${TCPW_MSG} ${WRAPLIBS}
2491 TLS support: ${support_tls}
2492 Encryption support: ${support_crypto}
2493 ZLIB support: ${have_zlib}
2494 enable-smartalloc: ${support_smartalloc}
2495 bat support: ${support_bat} ${QWT_LDFLAGS}
2496 enable-gnome: ${support_gnome} ${gnome_version}
2497 enable-bwx-console: ${support_wx_console} ${wx_version}
2498 enable-tray-monitor: ${support_tray_monitor}
2499 client-only: ${build_client_only}
2500 build-dird: ${build_dird}
2501 build-stored: ${build_stored}
2502 ACL support: ${have_acl}
2503 Python support: ${support_python} ${PYTHON_LIBS}
2504 Batch insert enabled: ${support_batch_insert}