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
191 support_postgresql=no
193 support_smartalloc=yes
198 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 # gnome (default off)
222 # -------------------------------------------
224 [ --enable-gnome enable build of bgnome-console GUI [disabled]],
225 [if test x$enableval = xyes; then
230 if test x$support_gnome = xyes; then
231 abc=`$PKGCONFIG --exists libgnomeui-2.0`
233 if test $pkg = 0; then
234 GNOME_INCLUDEDIR=`$PKGCONFIG --cflags-only-I libgnomeui-2.0`
235 GNOMEUI_LIBS=`$PKGCONFIG --libs-only-l libgnomeui-2.0`
236 GNOME_LIBDIR=`$PKGCONFIG --libs libgnomeui-2.0`
237 GNOME_LIBS=`$PKGCONFIG --libs-only-l libgnomeui-2.0`
238 AC_SUBST(GNOME_INCLUDEDIR)
239 AC_SUBST(GNOMEUI_LIBS)
240 AC_SUBST(GNOME_LIBDIR)
242 GNOME_DIR=src/gnome2-console
243 gnome_version="Version 2.x"
245 AC_MSG_ERROR(Unable to find Gnome 2 installation)
250 # -------------------------------------------
252 # -------------------------------------------
254 [ --enable-bat enable build of bat Qt4 GUI [disabled]],
255 [if test x$enableval = xyes; then
256 AC_DEFINE(HAVE_BAT, 1, [Set if Bacula bat Qt4 GUI support enabled])
261 if test x$support_bat = xyes; then
262 abc=`$PKGCONFIG --atleast-version=4.2 QtGui`
264 if test $pkg = 0; then
265 BAT_DIR=src/qt-console
267 AC_MSG_ERROR(Unable to find Qt4 installation needed by bat)
272 # If bat is enabled, we need the qwt library
276 if test x$support_bat = xyes; then
277 AC_MSG_CHECKING(for qwt support)
279 [ --with-qwt@<:@=DIR@:>@ specify qwt library directory],
285 if test -f ${with_qwt}/include/qwt.h; then
286 QWT_INC="${with_qwt}/include"
287 QWT_LDFLAGS="-L${with_qwt}/lib"
294 # Search in standard places, or --with-qwt not specified
296 if test x$QWT_INC = x; then
297 for root in /usr /usr/local; do
298 for ver in qwt qwt5 qwt-qt4; do
299 if test -f ${root}/include/${ver}/qwt.h; then
300 QWT_INC="${root}/include/${ver}"
301 if test -d ${root}/lib64/; then
302 QWT_LDFLAGS="-L${root}/lib64"
304 QWT_LDFLAGS="-L${root}/lib"
312 if test x$QWT_INC = x; then
314 AC_MSG_ERROR(Unable to find qwt package needed by bat)
324 AC_SUBST(QWT_LDFLAGS)
327 # -------------------------------------------
328 # bwx-console (default off)
329 # -------------------------------------------
330 AC_ARG_ENABLE(bwx-console,
331 [ --enable-bwx-console enable build of wxWidgets console [disabled]],
332 [if test x$enableval = xyes; then
333 support_wx_console=yes
337 if test x$support_wx_console = xyes; then
338 abc=`$WXCONFIG $WXFLAGS --cppflags`
340 if test $pkg = 0; then
341 wx_version="wxWidgets `$WXCONFIG $WXFLAGS --release`"
342 WXCONS_CPPFLAGS=`$WXCONFIG $WXFLAGS --cppflags`
343 WXCONS_LDFLAGS=`$WXCONFIG $WXFLAGS --libs`
345 AC_SUBST(WXCONS_CPPFLAGS)
346 AC_SUBST(WXCONS_LDFLAGS)
347 WX_DIR=src/wx-console
350 echo "wx-config program not found. bwx-console disabled."
352 support_wx_console=no
358 # -------------------------------------------
359 # tray-monitor (default off)
360 # -------------------------------------------
361 AC_ARG_ENABLE(tray-monitor,
362 [ --enable-tray-monitor enable build of Gnome tray monitor (compatible with KDE) [disabled]],
363 [if test x$enableval = xyes; then
364 support_tray_monitor=yes
368 if test x$support_tray_monitor = xyes; then
369 abc=`$PKGCONFIG --exists gtk+-2.0`
371 if test $pkg = 0; then
372 TRAY_MONITOR_CPPFLAGS=`$PKGCONFIG --cflags gtk+-2.0`
373 TRAY_MONITOR_LDFLAGS=`$PKGCONFIG --libs gtk+-2.0`
374 AC_SUBST(TRAY_MONITOR_CPPFLAGS)
375 AC_SUBST(TRAY_MONITOR_LDFLAGS)
376 TRAY_MONITOR_DIR=src/tray-monitor
377 abc=`$PKGCONFIG --atleast-version=2.4 gtk+-2.0`
379 if test $pkg = 0; then
380 AC_DEFINE(HAVE_GTK_2_4, 1, [Set if you have GTK 4.2 or greater loaded])
384 AC_SUBST(TRAY_MONITOR_DIR)
386 # -------------------------------------------
387 # smartalloc (default off)
388 # -------------------------------------------
389 AC_ARG_ENABLE(smartalloc,
390 [ --enable-smartalloc enable smartalloc debugging support [disabled]],
391 [if test x$enableval = xno; then
392 support_smartalloc=no
395 if test x$support_smartalloc = xyes; then
396 AC_DEFINE(SMARTALLOC, 1, [Set if you want Smartalloc enabled])
399 # -------------------------------------------
400 # static-tools (default off)
401 # -------------------------------------------
402 AC_ARG_ENABLE(static-tools,
403 [ --enable-static-tools enable static tape tools [disabled]],
404 [if test x$enableval = xyes; then
405 support_static_tools=yes
409 if test x$support_static_tools = xyes; then
410 TTOOL_LDFLAGS="-static"
412 AC_SUBST(TTOOL_LDFLAGS)
414 # -------------------------------------------
415 # static-fd (default off)
416 # -------------------------------------------
417 AC_ARG_ENABLE(static-fd,
418 [ --enable-static-fd enable static File daemon [disabled]],
419 [if test x$enableval = xyes; then
420 support_static_fd=yes
424 if test x$support_static_fd = xyes; then
425 STATIC_FD="static-bacula-fd"
429 # -------------------------------------------
430 # static-sd (default off)
431 # -------------------------------------------
432 AC_ARG_ENABLE(static-sd,
433 [ --enable-static-sd enable static Storage daemon [disabled]],
434 [if test x$enableval = xyes; then
435 support_static_sd=yes
439 if test x$support_static_sd = xyes; then
440 STATIC_SD="static-bacula-sd"
444 # -------------------------------------------
445 # static-dir (default off)
446 # -------------------------------------------
447 AC_ARG_ENABLE(static-dir,
448 [ --enable-static-dir enable static Director [disabled]],
449 [if test x$enableval = xyes; then
450 support_static_dir=yes
454 if test x$support_static_dir = xyes; then
455 STATIC_DIR="static-bacula-dir"
459 # -------------------------------------------
460 # static-cons (default off)
461 # -------------------------------------------
462 AC_ARG_ENABLE(static-cons,
463 [ --enable-static-cons enable static Console [disabled]],
464 [if test x$enableval = xyes; then
465 support_static_cons=yes
471 if test x$support_static_cons = xyes; then
472 STATIC_CONS="static-bconsole"
473 STATIC_GNOME_CONS="static-bgnome-console"
474 STATIC_WX_CONS="static-bwx-console"
476 AC_SUBST(STATIC_CONS)
477 AC_SUBST(STATIC_GNOME_CONS)
478 AC_SUBST(STATIC_WX_CONS)
480 # -------------------------------------------
481 # client_only (default off)
482 # -------------------------------------------
483 AC_ARG_ENABLE(client-only,
484 [ --enable-client-only build client (File daemon) only [disabled]],
485 [if test x$enableval = xyes; then
486 build_client_only=yes
490 if test x$build_client_only = xno; then
497 # -------------------------------------------
498 # director (default on)
499 # -------------------------------------------
500 AC_ARG_ENABLE(build-dird,
501 [ --enable-build-dird enable building of dird (Director) [enabled]],
502 [if test x$enableval = xno; then
505 if test x$build_dird = xyes; then
510 DIR_TOOLS="NODIRTOOLS"
515 # -------------------------------------------
516 # stored (default on)
517 # -------------------------------------------
518 AC_ARG_ENABLE(build-stored,
519 [ --enable-build-stored enable building of stored (Storage daemon) [enabled]],
520 [if test x$enableval = xno; then
523 if test x$build_stored = xyes; then
524 STORED_DIR="src/stored"
530 # ---------------------------------------------------
531 # Check for conio (Bacula readline substitute)(
532 # ---------------------------------------------------
533 # this allows you to turn it completely off
535 [ --disable-conio disable conio support [enabled]
537 [if test x$enableval = xno; then
543 # ---------------------------------------------------
544 # Check for IPv6 support
545 # ---------------------------------------------------
546 # this allows you to turn it completely off
549 [ --enable-ipv6 enable ipv6 support [enabled]
551 [if test x$enableval = xno; then
556 if test x$support_ipv6 = xyes; then
557 AC_TRY_LINK([ #include <sys/types.h>
558 #include <sys/socket.h>
559 #include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;],
560 [support_ipv6=yes], [support_ipv6=no])
563 if test x$support_ipv6 = xyes; then
564 AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
570 if test x$support_conio = xyes; then
571 AC_CHECK_HEADER(termcap.h,
572 [ AC_CHECK_LIB(termcap, tgetent,
573 [ CONS_LIBS="-ltermcap"
578 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
580 [ AC_CHECK_LIB(ncurses, tgetent,
581 [ CONS_LIBS="-lncurses"
586 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
591 AC_CHECK_HEADERS(curses.h)
592 AC_CHECK_HEADER(term.h,
593 [ AC_CHECK_LIB(curses, tgetent,
594 [ CONS_LIBS="-lcurses"
599 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
602 [ echo " "; echo "Required libraries not found. CONIO turned off ..."; echo " "],
611 # ---------------------------------------------------
612 # Check for readline support/directory (default off)
613 # ---------------------------------------------------
614 # this allows you to turn it completely off
615 AC_ARG_ENABLE(readline,
616 [ --disable-readline disable readline support [disable]
618 [if test x$enableval = xno; then
624 if test x$support_readline = xyes; then
625 AC_ARG_WITH(readline,
626 [ --with-readline@<:@=DIR@:>@ specify readline library directory],
628 case "$with_readline" in
631 if test -f ${with_readline}/readline.h; then
632 CONS_INC="-I${with_readline}"
633 CONS_LDFLAGS="-L$with_readline"
634 elif test -f ${with_readline}/include/readline/readline.h; then
635 CONS_INC="-I${with_readline}/include/readline"
636 CONS_LDFLAGS="-L${with_readline}/lib"
637 with_readline="${with_readline}/include/readline"
639 with_readline="/usr/include/readline"
641 AC_CHECK_HEADER(${with_readline}/readline.h,
642 [ AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
643 CONS_LIBS="-lreadline -lhistory -ltermcap"
647 echo "readline.h not found. readline turned off ..."
654 # check for standard readline library
655 AC_CHECK_HEADER(/usr/include/readline/readline.h,
656 [ AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
658 CONS_INC="-I/usr/include/readline"
659 CONS_LIBS="-lreadline -ltermcap"
661 # Did not find standard library, so try Bacula's default
662 AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h,
663 [ AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
665 CONS_INC="-I${TOP_DIR}/depkgs/readline"
666 CONS_LIBS="-lreadline -lhistory -ltermcap"
667 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
668 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
671 echo "readline.h not found. readline turned off ..."
687 AC_SUBST(CONS_LDFLAGS)
688 AC_SUBST(READLINE_SRC)
690 # Minimal stuff for readline Makefile configuration
695 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr lstat lchown)
696 AC_CHECK_FUNCS(nanosleep nl_langinfo)
697 AC_CHECK_HEADERS(varargs.h)
699 # End of readline/conio stuff
700 # -----------------------------------------------------------------------
702 # -----------------------------------------------------------------------
703 # Check for Python support
705 AC_MSG_CHECKING(for Python support)
708 --with-python@<:@=DIR@:>@ Include Python support. DIR is the Python base
709 install directory, default is to search through
710 a number of common places for the Python files.],
714 if test "$withval" != "no"; then
715 if test "$withval" = "yes"; then
716 for python_root in /usr /usr/local /usr/sfw; do
717 for ver in python2.2 python2.3 python2.4 python2.5; do
718 if test -f $python_root/include/${ver}/Python.h; then
719 PYTHON_INCDIR=-I$python_root/include/${ver}
720 if test -d $python_root/lib64/${ver}/config; then
721 PYTHON_LIBS="-L$python_root/lib64/${ver}/config -l${ver}"
723 PYTHON_LIBS="-L$python_root/lib/${ver}/config -l${ver}"
729 if test x$PYTHON_INCDIR = x; then
730 if test -f $prefix/include/Python.h; then
731 PYTHON_INCDIR=-I$prefix/include
732 if test -d $prefix/lib64/config; then
733 PYTHON_LIBS="-L$prefix/lib64/config -lpython"
735 PYTHON_LIBS="-L$prefix/lib/config -lpython"
739 AC_MSG_ERROR(Unable to find Python.h in standard locations)
743 if test -f $withval/Python.h; then
744 PYTHON_INCDIR=-I$withval
745 PYTHON_LIBS="-L$withval/config -lpython"
746 elif test -f $withval/include/Python.h; then
747 PYTHON_INCDIR=-I$withval/include
748 if test -d $withval/lib64/config; then
749 PYTHON_LIBS="-L$withval/lib64/config -lpython"
751 PYTHON_LIBS="-L$withval/lib/config -lpython"
753 elif test -f $withval/include/python/Python.h; then
754 PYTHON_INCDIR=-I$withval/include/python
755 if test -d $withval/lib64/python/config; then
756 PYTHON_LIBS="-L$withval/lib64/python/config -lpython"
758 PYTHON_LIBS="-L$withval/lib/python/config -lpython"
762 AC_MSG_ERROR(Invalid Python directory $withval - unable to find Python.h under $withval)
765 AC_DEFINE([HAVE_PYTHON], 1)
768 AC_MSG_NOTICE(checking for more Python libs)
769 saved_LIBS="$LIBS"; LIBS=
770 AC_SEARCH_LIBS(shm_open, [rt])
771 AC_CHECK_LIB(util, openpty)
772 PYTHON_LIBS="$PYTHON_LIBS $LIBS"
780 AC_SUBST(PYTHON_LIBS)
781 AC_SUBST(PYTHON_INCDIR)
784 # Find where sockets are (especially for Solaris)
785 # Do this before the TCP Wrappers test since tcp wrappers
786 # uses the socket library and some linkers are stupid.
788 AC_CHECK_FUNC(socket,
789 AC_MSG_RESULT(using libc's socket),
790 AC_CHECK_LIB(xnet,socket)
791 AC_CHECK_LIB(socket,socket)
792 AC_CHECK_LIB(inet,socket))
795 # -----------------------------------------------------------
796 # Check whether user wants TCP wrappers support (default off)
797 # -----------------------------------------------------------
800 AC_ARG_WITH(tcp-wrappers,
801 [ --with-tcp-wrappers@<:@=DIR@:>@ enable tcpwrappers support],
803 if test "x$withval" != "xno" ; then
805 LIBS="$saved_LIBS -lwrap"
806 AC_MSG_CHECKING(for libwrap)
807 AC_SEARCH_LIBS(nanosleep, [rt])
809 [ #include <sys/types.h>
811 int deny_severity = 0;
812 int allow_severity = 0;
813 struct request_info *req; ],
814 [ hosts_access(req); ],
817 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
822 LIBS="$saved_LIBS -lwrap -lnsl"
823 WRAPLIBS="$saved_LIBS -lwrap -lnsl"
825 [ #include <sys/types.h>
827 int deny_severity = 0;
828 int allow_severity = 0;
829 struct request_info *req; ],
830 [ hosts_access(req); ],
833 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
838 [AC_MSG_ERROR([*** libwrap missing]) ] ]
845 # -----------------------------------------------------------
846 # Check whether OpenSSL is available
847 # -----------------------------------------------------------
848 AC_MSG_CHECKING([for OpenSSL])
849 dnl The following uses quadrigraphs:
853 AC_HELP_STRING([--with-openssl@<:@=DIR@:>@], [Include OpenSSL support. DIR is the OpenSSL base]),
854 [with_openssl_directory=${withval}])
856 if test "x$with_openssl_directory" != "x"; then
857 OPENSSL_LIBS="-lssl -lcrypto"
860 if test "x$with_openssl_directory" != "xyes" && test x"${with_openssl_directory}" != "x"; then
861 OPENSSL_LIBS="-L$with_openssl_directory/lib $OPENSSL_LIBS"
862 OPENSSL_INC="-I$with_openssl_directory/include $OPENSSL_INC"
866 saved_CFLAGS="${CFLAGS}"
867 LIBS="${saved_LIBS} ${OPENSSL_LIBS}"
868 CFLAGS="${saved_CFLAGS} ${OPENSSL_INC}"
870 AC_TRY_LINK([ #include <openssl/ssl.h> ],
871 [ CRYPTO_set_id_callback(NULL); ],
879 AC_TRY_LINK([ #include <openssl/evp.h> ],
881 [ ac_cv_openssl_sha2="yes" ],
882 [ ac_cv_openssl_sha2="no" ]
885 # Solaris disables greater than 128+ bit encryption in their OpenSSL
886 # implementation, presumably for export reasons. If 192bit AES
887 # is available, we assume that we're running with a 'non-export'
889 AC_TRY_LINK([ #include <openssl/evp.h> ],
890 [ EVP_aes_192_cbc(); ],
891 [ ac_cv_openssl_export="no" ],
892 [ ac_cv_openssl_export="yes" ]
896 CFLAGS="${saved_CFLAGS}"
898 if test "$support_tls" = "yes"; then
899 AC_DEFINE(HAVE_OPENSSL, 1, [Define if OpenSSL library is available])
900 AC_DEFINE(HAVE_TLS, 1, [Define if TLS support should be enabled])
901 AC_DEFINE(HAVE_CRYPTO, 1, [Define if encryption support should be enabled])
904 if test "$ac_cv_openssl_sha2" = "yes"; then
905 AC_DEFINE(HAVE_SHA2, 1, [Define if the SHA-2 family of digest algorithms is available])
908 if test "$ac_cv_openssl_export" = "yes"; then
909 AC_DEFINE(HAVE_OPENSSL_EXPORT_LIBRARY, 1, [Define if the OpenSSL library is export-contrained to 128bit ciphers])
918 AC_MSG_RESULT([$support_tls])
919 AC_SUBST(OPENSSL_LIBS)
920 AC_SUBST(OPENSSL_INC)
923 # -----------------------------------------------------------
924 # dlopen is needed for plugins
925 # -----------------------------------------------------------
926 AC_SEARCH_LIBS(dlopen, [dl])
928 # ------------------------------------------
929 # Where to place working dir
930 # ------------------------------------------
931 working_dir=`eval echo ${prefix}/var/bacula/working`
932 AC_ARG_WITH(working-dir,
933 [ --with-working-dir=PATH specify path of Bacula working directory],
935 if test "x$withval" != "xno" ; then
941 AC_SUBST(working_dir)
943 # ------------------------------------------------------------------
944 # If the user has not set archivedir, we set our default as /tmp
945 # ------------------------------------------------------------------
947 AC_ARG_WITH(archivedir,
948 [ --with-archivedir=PATH specify path of SD archive directory],
950 if test "x$withval" != "xno" ; then
960 # ------------------------------------------
961 # Where to place scriptdir (script files)
962 # ------------------------------------------
963 scriptdir=`eval echo ${sysconfdir}`
964 AC_ARG_WITH(scriptdir,
965 [ --with-scriptdir=PATH specify path of Bacula scripts directory],
967 if test "x$withval" != "xno" ; then
976 # ------------------------------------------
977 # Where to send dump email
978 # ------------------------------------------
979 dump_email=root@localhost
980 AC_ARG_WITH(dump-email,
981 [ --with-dump-email=EMAIL dump email address],
983 if test "x$withval" != "xno" ; then
991 # ------------------------------------------
992 # Where to send job email
993 # ------------------------------------------
994 job_email=root@localhost
995 AC_ARG_WITH(job-email,
996 [ --with-job-email=EMAIL job output email address],
998 if test "x$withval" != "xno" ; then
1006 # ------------------------------------------
1007 # Where to find smtp host
1008 # ------------------------------------------
1010 AC_ARG_WITH(smtp_host,
1011 [ --with-smtp-host=HOST SMTP mail host address],
1013 if test "x$withval" != "xno" ; then
1022 # ------------------------------------
1023 # Where to place pid files
1024 # ------------------------------------
1026 AC_ARG_WITH(pid-dir,
1027 [ --with-pid-dir=PATH specify location of Bacula pid files],
1029 if test "x$withval" != "xno" ; then
1035 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
1039 # ------------------------------------
1040 # Where to place subsys "lock file"
1041 # ------------------------------------
1042 subsysdir=/var/run/subsys
1043 if test -d /var/run/subsys; then
1044 subsysdir=/var/run/subsys
1045 elif test -d /var/lock/subsys; then
1046 subsysdir=/var/lock/subsys
1048 subsysdir=/var/run/subsys
1050 AC_ARG_WITH(subsys-dir,
1051 [ --with-subsys-dir=PATH specify location of Bacula subsys file],
1053 if test "x$withval" != "xno" ; then
1063 # ------------------------------------
1064 # Where to start assigning ports
1065 # ------------------------------------
1067 AC_ARG_WITH(baseport,
1068 [ --with-baseport=PORT specify base port address for daemons],
1070 if test "x$withval" != "xno" ; then
1077 dir_port=`expr $baseport`
1078 fd_port=`expr $baseport + 1`
1079 sd_port=`expr $fd_port + 1`
1086 # ------------------------------------------
1087 # Generate passwords
1088 # ------------------------------------------
1090 AC_ARG_WITH(dir-password,
1091 [ --with-dir-password=PASSWORD specify Director's password],
1093 if test "x$withval" != "xno" ; then
1094 dir_password=$withval
1099 if test "x$dir_password" = "x" ; then
1100 if test "x$OPENSSL" = "xnone" ; then
1101 key=`autoconf/randpass 33`
1103 key=`openssl rand -base64 33`
1109 AC_ARG_WITH(fd-password,
1110 [ --with-fd-password=PASSWORD specify Client's password],
1112 if test "x$withval" != "xno" ; then
1113 fd_password=$withval
1118 if test "x$fd_password" = "x" ; then
1119 if test "x$OPENSSL" = "xnone" ; then
1120 key=`autoconf/randpass 37`
1122 key=`openssl rand -base64 33`
1128 AC_ARG_WITH(sd-password,
1129 [ --with-sd-password=PASSWORD specify Storage daemon's password],
1131 if test "x$withval" != "xno" ; then
1132 sd_password=$withval
1137 if test "x$sd_password" = "x" ; then
1138 if test "x$OPENSSL" = "xnone" ; then
1139 key=`autoconf/randpass 41`
1141 key=`openssl rand -base64 33`
1147 AC_ARG_WITH(mon-dir-password,
1148 [ --with-mon-dir-password=PASSWORD specify Director's password used by the monitor],
1150 if test "x$withval" != "xno" ; then
1151 mon_dir_password=$withval
1156 if test "x$mon_dir_password" = "x" ; then
1157 if test "x$OPENSSL" = "xnone" ; then
1158 key=`autoconf/randpass 33`
1160 key=`openssl rand -base64 33`
1162 mon_dir_password=$key
1166 AC_ARG_WITH(mon-fd-password,
1167 [ --with-mon-fd-password=PASSWORD specify Client's password used by the monitor],
1169 if test "x$withval" != "xno" ; then
1170 mon_fd_password=$withval
1175 if test "x$mon_fd_password" = "x" ; then
1176 if test "x$OPENSSL" = "xnone" ; then
1177 key=`autoconf/randpass 37`
1179 key=`openssl rand -base64 33`
1181 mon_fd_password=$key
1185 AC_ARG_WITH(mon-sd-password,
1186 [ --with-mon-sd-password=PASSWORD specify Storage daemon's password used by the monitor],
1188 if test "x$withval" != "xno" ; then
1189 mon_sd_password=$withval
1194 if test "x$mon_sd_password" = "x" ; then
1195 if test "x$OPENSSL" = "xnone" ; then
1196 key=`autoconf/randpass 41`
1198 key=`openssl rand -base64 33`
1200 mon_sd_password=$key
1203 AC_SUBST(dir_password)
1204 AC_SUBST(fd_password)
1205 AC_SUBST(sd_password)
1206 AC_SUBST(mon_dir_password)
1207 AC_SUBST(mon_fd_password)
1208 AC_SUBST(mon_sd_password)
1211 # Pickup any database name
1214 AC_ARG_WITH(db_name,
1215 [ --with-db-name=DBNAME specify database name (default bacula)],
1217 if test "x$withval" != "x" ; then
1225 AC_ARG_WITH(db_user,
1226 [ --with-db-user=UNAME specify database user (default bacula)],
1228 if test "x$withval" != "x" ; then
1237 # Handle users and groups for each daemon
1240 AC_ARG_WITH(dir_user,
1241 [ --with-dir-user=USER specify user for Director daemon],
1243 if test "x$withval" != "x" ; then
1250 AC_ARG_WITH(dir_group,
1251 [ --with-dir-group=GROUP specify group for Director daemon],
1253 if test "x$withval" != "x" ; then
1260 AC_ARG_WITH(sd_user,
1261 [ --with-sd-user=USER specify user for Storage daemon],
1263 if test "x$withval" != "x" ; then
1270 AC_ARG_WITH(sd_group,
1271 [ --with-sd-group=GROUP specify group for Storage daemon],
1273 if test "x$withval" != "x" ; then
1280 AC_ARG_WITH(fd_user,
1281 [ --with-fd-user=USER specify user for File daemon],
1283 if test "x$withval" != "x" ; then
1290 AC_ARG_WITH(fd_group,
1291 [ --with-fd-group=GROUP specify group for File daemon],
1293 if test "x$withval" != "x" ; then
1307 # allow setting default executable permissions
1310 AC_ARG_WITH(sbin-perm,
1311 [ --with-sbin-perm=MODE specify permissions for sbin binaries (0754)],
1313 if test "x$withval" != "x" ; then
1321 # ------------------------------------------------
1322 # Bacula check for various SQL database engines
1323 # ------------------------------------------------
1325 BA_CHECK_POSTGRESQL_DB
1340 # -------------------------------------------
1341 # enable batch attribute DB insert (default on)
1342 # -------------------------------------------
1343 support_batch_insert=no
1344 A=`nm $SQL_LIB | grep pthread_mutex_lock`
1346 if test $pkg = 0; then
1347 support_batch_insert=yes
1348 AC_ARG_ENABLE(batch-insert,
1349 [ --enable-batch-insert enable the DB batch insert code [disabled]],
1350 [if test x$enableval = xno; then
1351 support_batch_insert=no
1353 support_batch_insert=yes
1357 # Check if postgresql support batch mode
1358 if test x$DB_TYPE = xpostgresql; then
1359 A=`nm $SQL_LIB | grep PQputCopyData`
1361 if test $pkg != 0; then
1362 support_batch_insert=no
1366 if test x$DB_TYPE = xdbi; then
1371 if test $support_batch_insert = yes ; then
1372 AC_DEFINE(HAVE_BATCH_FILE_INSERT, 1, [Set if DB batch insert code enabled])
1376 AC_DEFINE(PROTOTYPES)
1378 dnl# --------------------------------------------------------------------------
1379 dnl# Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
1381 if test -z "$CFLAGS" -o "$CFLAGS" = "-g -O2"; then
1382 if test -z "$CCOPTS"; then
1383 CCOPTS='-g -O2 -Wall'
1392 dnl See if we can use 64 bit file addresses
1393 largefile_support="no"
1399 dnl# --------------------------------------------------------------------------
1400 dnl# CHECKING FOR HEADER FILES
1401 dnl# --------------------------------------------------------------------------
1440 AC_STRUCT_ST_BLKSIZE
1444 dnl# --------------------------------------------------------------------------
1445 dnl# Check for utime.h structure
1446 dnl# --------------------------------------------------------------------------
1447 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
1449 #include <sys/types.h>
1450 #include <utime.h>], [struct utimbuf foo],
1451 ba_cv_header_utime_h=yes, ba_cv_header_utime_h=no)])
1452 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H, 1, [Set if utime.h exists])
1454 dnl# --------------------------------------------------------------------------
1455 dnl# Check for socklen_t
1456 dnl# --------------------------------------------------------------------------
1457 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
1459 #include <sys/types.h>
1460 #include <sys/socket.h>],
1462 ba_cv_header_socklen_t=yes, ba_cv_header_socklen_t=no)])
1463 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T)
1465 dnl# --------------------------------------------------------------------------
1466 dnl# Check for bigendian
1467 dnl# --------------------------------------------------------------------------
1468 AC_CACHE_CHECK([for bigendian], ba_cv_bigendian,
1470 [main(){long a=1L; char *p=(char *)&a; exit(*p);}],
1471 [ba_cv_bigendian=yes],
1472 [ba_cv_bigendian=no],
1473 [ba_cv_bigendian=no])])
1474 test $ba_cv_bigendian = yes && AC_DEFINE(HAVE_BIGENDIAN)
1476 dnl# --------------------------------------------------------------------------
1477 dnl# Check for typeof()
1478 dnl# --------------------------------------------------------------------------
1480 AC_CACHE_CHECK(for typeof, ba_cv_have_typeof,
1482 [main(){char *a = 0; a = (typeof a)a;}],
1483 [ba_cv_have_typeof=yes],
1484 [ba_cv_have_typeof=no],
1485 [ba_cv_have_typeof=no])])
1486 test $ba_cv_have_typeof = yes && AC_DEFINE([HAVE_TYPEOF], 1, [Defind to 1 if compiler has typeof])
1492 dnl# --------------------------------------------------------------------------
1493 dnl# CHECKING FOR FILESYSTEM TYPE
1494 dnl# --------------------------------------------------------------------------
1495 AC_MSG_CHECKING(how to get filesystem type)
1497 # The order of these tests is important.
1498 AC_TRY_CPP([#include <sys/statvfs.h>
1499 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4)
1500 if test $fstype = no; then
1501 AC_TRY_CPP([#include <sys/statfs.h>
1502 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3)
1504 if test $fstype = no; then
1505 AC_TRY_CPP([#include <sys/statfs.h>
1506 #include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX)
1508 if test $fstype = no; then
1509 AC_TRY_CPP([#include <mntent.h>], AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD)
1511 if test $fstype = no; then
1512 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
1514 if test $fstype = no; then
1515 AC_TRY_CPP([#include <sys/mount.h>
1516 #include <sys/fs_types.h>], AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix)
1518 AC_MSG_RESULT($fstype)
1520 AC_CHECK_HEADER(sys/statvfs.h, [ AC_DEFINE(HAVE_SYS_STATVFS_H,1,[Defines if your system have the sys/statvfs.h header file])] , )
1522 dnl# --------------------------------------------------------------------------
1523 dnl# CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
1524 dnl# --------------------------------------------------------------------------
1532 AC_CHECK_TYPE(ino_t, unsigned long)
1533 AC_CHECK_TYPE(dev_t, unsigned long)
1534 AC_CHECK_TYPE(daddr_t, long)
1535 AC_CHECK_TYPE(major_t, int)
1536 AC_CHECK_TYPE(minor_t, int)
1537 AC_CHECK_TYPE(ssize_t, int)
1544 AC_CHECK_SIZEOF(char, 1)
1545 AC_CHECK_SIZEOF(short int, 2)
1546 AC_CHECK_SIZEOF(int, 4)
1547 AC_CHECK_SIZEOF(long int, 4)
1548 AC_CHECK_SIZEOF(long long int, 8)
1549 AC_CHECK_SIZEOF(int *, 4)
1551 # Check for sys/types.h types
1552 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1554 [ #include <sys/types.h> ],
1556 [ ac_cv_have_u_int="yes" ],
1557 [ ac_cv_have_u_int="no" ]
1560 if test "x$ac_cv_have_u_int" = "xyes" ; then
1561 AC_DEFINE(HAVE_U_INT)
1565 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t, [
1567 [ #include <sys/types.h> ],
1568 [ intmax_t a; a = 1;],
1569 [ ac_cv_have_intmax_t="yes" ],
1572 [ #include <stdint.h> ],
1573 [ intmax_t a; a = 1;],
1574 [ ac_cv_have_intmax_t="yes" ],
1575 [ ac_cv_have_intmax_t="no" ]
1581 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
1582 AC_DEFINE(HAVE_INTMAX_T)
1587 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t, [
1589 [ #include <sys/types.h> ],
1590 [ u_intmax_t a; a = 1;],
1591 [ ac_cv_have_u_intmax_t="yes" ],
1594 [ #include <stdint.h> ],
1595 [ u_intmax_t a; a = 1;],
1596 [ ac_cv_have_u_intmax_t="yes" ],
1597 [ ac_cv_have_u_intmax_t="no" ]
1602 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
1603 AC_DEFINE(HAVE_U_INTMAX_T)
1608 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1610 [ #include <sys/types.h> ],
1611 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1612 [ ac_cv_have_intxx_t="yes" ],
1613 [ ac_cv_have_intxx_t="no" ]
1616 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1617 AC_DEFINE(HAVE_INTXX_T)
1621 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1623 [ #include <sys/types.h> ],
1624 [ int64_t a; a = 1;],
1625 [ ac_cv_have_int64_t="yes" ],
1626 [ ac_cv_have_int64_t="no" ]
1629 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1630 AC_DEFINE(HAVE_INT64_T)
1634 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1636 [ #include <sys/types.h> ],
1637 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1638 [ ac_cv_have_u_intxx_t="yes" ],
1639 [ ac_cv_have_u_intxx_t="no" ]
1642 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1643 AC_DEFINE(HAVE_U_INTXX_T)
1647 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1649 [ #include <sys/types.h> ],
1650 [ u_int64_t a; a = 1;],
1651 [ ac_cv_have_u_int64_t="yes" ],
1652 [ ac_cv_have_u_int64_t="no" ]
1655 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1656 AC_DEFINE(HAVE_U_INT64_T)
1660 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1661 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1663 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1665 [ #include <sys/bitypes.h> ],
1666 [ int8_t a; int16_t b; int32_t c;
1667 u_int8_t e; u_int16_t f; u_int32_t g;
1668 a = b = c = e = f = g = 1; ],
1669 [ AC_DEFINE(HAVE_U_INTXX_T)
1670 AC_DEFINE(HAVE_INTXX_T)
1671 AC_DEFINE(HAVE_SYS_BITYPES_H)
1672 AC_MSG_RESULT(yes) ],
1673 [ AC_MSG_RESULT(no)]
1677 if test -z "$have_u_intxx_t" ; then
1678 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1680 [ #include <sys/types.h> ],
1681 [ uint8_t a; uint16_t b;
1682 uint32_t c; a = b = c = 1; ],
1683 [ ac_cv_have_uintxx_t="yes" ],
1684 [ ac_cv_have_uintxx_t="no" ]
1687 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1688 AC_DEFINE(HAVE_UINTXX_T)
1692 if (test -z "$have_u_int64_t" || test -z "$have_int64_t" && \
1693 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1695 AC_MSG_CHECKING([for int64_t and u_int64_t types in sys/bitypes.h])
1697 [ #include <sys/bitypes.h> ],
1698 [ int64_t a; u_int64_t b;
1700 [ AC_DEFINE(HAVE_U_INT64_T)
1701 AC_DEFINE(HAVE_INT64_T)
1702 AC_MSG_RESULT(yes) ],
1703 [ AC_MSG_RESULT(no)]
1707 if (test -z "$have_uintxx_t" && \
1708 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1710 AC_MSG_CHECKING([for uintXX_t types in sys/bitypes.h])
1712 [ #include <sys/bitypes.h> ],
1713 [ uint8_t a; uint16_t b;
1714 uint32_t c; a = b = c = 1; ],
1715 [ AC_DEFINE(HAVE_UINTXX_T)
1716 AC_MSG_RESULT(yes) ],
1717 [ AC_MSG_RESULT(no)]
1725 dnl# --------------------------------------------------------------------------
1726 dnl# CHECKING FOR REQUIRED LIBRARY FUNCTIONS
1727 dnl# --------------------------------------------------------------------------
1743 [echo 'configure: cannot find needed function.'; exit 1]
1746 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
1747 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
1748 AC_CHECK_FUNCS(posix_fadvise)
1749 AC_CHECK_FUNCS(fdatasync)
1751 AC_CHECK_FUNCS(chflags)
1753 AC_CHECK_FUNCS(snprintf vsnprintf gethostid fseeko)
1755 AC_CACHE_CHECK(for va_copy, ba_cv_va_copy,
1758 void use_va_copy(va_list args){va_list args2; va_copy(args2,args); va_end(args2);}
1759 void call_use_va_copy(int junk,...){va_list args; va_start(args,junk); use_va_copy(args); va_end(args);}
1761 [call_use_va_copy(1,2,3)],
1762 ba_cv_va_copy=yes, ba_cv_va_copy=no)])
1763 test $ba_cv_va_copy = yes && AC_DEFINE(HAVE_VA_COPY, 1, [Set if va_copy exists])
1766 dnl# --------------------------------------------------------------------------
1767 dnl# CHECKING FOR THREAD SAFE FUNCTIONS
1768 dnl# --------------------------------------------------------------------------
1769 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
1771 # If resolver functions are not in libc check for -lnsl or -lresolv.
1772 AC_CHECK_FUNC(gethostbyname_r,
1773 AC_MSG_RESULT(using libc's resolver),
1774 AC_CHECK_LIB(nsl,gethostbyname_r)
1775 AC_CHECK_LIB(resolv,gethostbyname_r))
1779 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
1780 AC_CHECK_FUNCS(inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)])
1781 AC_CHECK_FUNCS(gethostbyname2, [AC_DEFINE(HAVE_GETHOSTBYNAME2)])
1783 dnl ----------------------------
1784 dnl check sa_len of sockaddr
1785 dnl ----------------------------
1786 AC_CACHE_CHECK(for struct sockaddr has a sa_len field, ac_cv_struct_sockaddr_sa_len,
1787 [AC_TRY_COMPILE([#include <sys/socket.h>], [struct sockaddr s; s.sa_len;],
1788 ac_cv_struct_sockaddr_sa_len=yes, ac_cv_struct_sockaddr_sa_len=no)])
1790 if test $ac_cv_struct_sockaddr_sa_len = yes; then
1791 AC_DEFINE(HAVE_SA_LEN, 1, [Define if sa_len field exists in struct sockaddr])
1801 AC_FUNC_CLOSEDIR_VOID
1802 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
1803 # AC_FUNC_FNMATCH dnl use local version
1806 AC_CHECK_LIB(intl, gettext, [LIBS="$LIBS -lintl"])
1809 AC_CHECK_LIB(sun, getpwnam)
1811 AC_CHECK_HEADERS(zlib.h)
1812 AC_CHECK_LIB(z, deflate, [FDLIBS="-lz"])
1814 if test x$FDLIBS = x-lz; then
1815 AC_DEFINE(HAVE_LIBZ)
1820 # Check for ACL libraries
1823 AC_CHECK_HEADER(sys/acl.h)
1824 AC_CHECK_FUNC(acl_get_file, [have_acl=yes],
1825 [AC_CHECK_LIB(acl, acl_get_file, [have_acl=yes; FDLIBS="-lacl $FDLIBS"],
1826 [AC_CHECK_LIB(sec, acltotext, [have_acl=yes; FDLIBS="-lsec $FDLIBS"])]
1829 if test $have_acl = yes; then
1833 dnl Check for pthread libraries
1835 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
1836 [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
1837 [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
1838 [AC_CHECK_FUNC(pthread_create)]
1849 if test x$have_gcc = xyes ; then
1850 CPPFLAGS="$CPPFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
1851 CFLAGS="$CFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
1853 LDFLAGS=${LDFLAGS--O}
1854 DB_LIBS="${SQL_LFLAGS}"
1855 CPPFLAGS="$CPPFLAGS"
1868 AC_SUBST(X_EXTRA_LIBS)
1873 dnl# extra configurable objects
1884 # Finally we set appropriate distribution specific
1885 # variables and defaults
1887 # PFILES are platform specific files
1888 PFILES="platforms/Makefile"
1892 hostname=`uname -n | cut -d '.' -f 1`
1893 if test x${hostname} = x ; then
1894 hostname="localhost"
1899 PSCMD="ps -e -o pid,comm"
1901 platforms/aix/Makefile"
1902 TAPEDRIVE="/dev/rmt0.1"
1906 PTHREAD_LIB="-lpthread -lexc"
1907 if test "${CC}" = "gcc" ; then
1914 TAPEDRIVE="/dev/nrmt0"
1917 DISTVER=`uname -a |awk '{print $3}'`
1918 TAPEDRIVE="/dev/nrmt0"
1919 PTHREAD_LIB="-pthread"
1920 CFLAGS="${CFLAGS} -pthread"
1921 PSCMD="ps -ax -o pid,command"
1925 platforms/bsdi/Makefile \
1926 platforms/bsdi/bacula-fd \
1927 platforms/bsdi/bacula-sd \
1928 platforms/bsdi/bacula-dir"
1929 largefile_support="yes"
1932 DISTVER=`uname -a |awk '{print $3}'`
1933 TAPEDRIVE="/dev/nrst0"
1936 WLDFLAGS="-mwindows"
1940 TAPEDRIVE="/dev/nst0"
1941 PSCMD="ps -e -o pid,command"
1944 platforms/darwin/Makefile"
1947 if `grep -q ubuntu /etc/apt/sources.list`; then
1950 DISTVER=`cat /etc/debian_version`
1951 if test -f /etc/lsb-release ; then
1953 if test "x$DISTRIB_ID" != "x" ; then
1954 DISTNAME=$DISTRIB_ID
1956 if test "x$DISTRIB_RELEASE" != "x" ; then
1957 DISTVER=$DISTRIB_RELEASE
1960 if test "$DISTNAME" = "Ubuntu" ; then
1963 TAPEDRIVE="/dev/nst0"
1964 PSCMD="ps -e -o pid,command"
1965 if test "$DISTNAME" = "ubuntu" ; then
1967 platforms/ubuntu/Makefile \
1968 platforms/ubuntu/bacula-fd \
1969 platforms/ubuntu/bacula-sd \
1970 platforms/ubuntu/bacula-dir"
1973 platforms/debian/Makefile \
1974 platforms/debian/bacula-fd \
1975 platforms/debian/bacula-sd \
1976 platforms/debian/bacula-dir"
1980 DISTVER=`uname -a |awk '{print $3}'`
1981 VER=`echo $DISTVER | cut -c 1`
1982 if test x$VER = x4 ; then
1983 PTHREAD_LIB="${PTHREAD_LIBS:--pthread}"
1984 CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS:--pthread}"
1988 TAPEDRIVE="/dev/nrsa0"
1989 PSCMD="ps -ax -o pid,command"
1991 platforms/freebsd/Makefile \
1992 platforms/freebsd/bacula-fd \
1993 platforms/freebsd/bacula-sd \
1994 platforms/freebsd/bacula-dir"
1995 largefile_support="yes"
1998 PSCMD="UNIX95=1; ps -e -o pid,comm"
1999 CFLAGS="${CFLAGS} -D_XOPEN_SOURCE_EXTENDED=1"
2001 TAPEDRIVE="/dev/rmt/0hnb"
2002 PTHREAD_LIB="-lpthread"
2003 AC_DEFINE([_INCLUDE_LONGLONG])
2007 TAPEDRIVE="/dev/rmt/0cbn"
2008 PSCMD="ps -e -o pid,comm"
2010 platforms/irix/Makefile \
2011 platforms/irix/bacula-fd \
2012 platforms/irix/bacula-sd \
2013 platforms/irix/bacula-dir"
2016 DISTVER=`uname -a |awk '{print $3}'`
2019 TAPEDRIVE="/dev/nrst0"
2020 PSCMD="ps -ax -o pid,command"
2021 PTHREAD_LIB="-pthread"
2022 CFLAGS="${CFLAGS} -pthread"
2025 DISTVER=`uname -a |awk '{print $3}'`
2028 TAPEDRIVE="/dev/nrst0"
2029 PSCMD="ps -ax -o pid,command"
2030 PTHREAD_LIB="-pthread"
2031 CFLAGS="${CFLAGS} -pthread"
2033 platforms/openbsd/Makefile \
2034 platforms/openbsd/bacula-fd \
2035 platforms/openbsd/bacula-sd \
2036 platforms/openbsd/bacula-dir"
2039 if test -f /etc/whitebox-release ; then
2040 f=/etc/whitebox-release
2042 f=/etc/redhat-release
2044 if test `cat $f | grep release |\
2045 cut -f 3 -d ' '`x = "Enterprise"x ; then
2046 DISTVER="Enterprise "`cat $f | grep release |\
2049 DISTVER=`cat /etc/redhat-release | grep release |\
2052 TAPEDRIVE="/dev/nst0"
2053 PSCMD="ps -e -o pid,command"
2055 platforms/redhat/Makefile \
2056 platforms/redhat/bacula-fd \
2057 platforms/redhat/bacula-sd \
2058 platforms/redhat/bacula-dir \
2059 platforms/redhat/bacula.spec \
2063 DISTVER=`cat /etc/mandrake-release | grep release |\
2065 TAPEDRIVE="/dev/nst0"
2066 PSCMD="ps -e -o pid,command"
2068 platforms/mandrake/Makefile \
2069 platforms/mandrake/bacula-fd \
2070 platforms/mandrake/bacula-sd \
2071 platforms/mandrake/bacula-dir \
2072 platforms/mandrake/bacula.spec \
2076 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
2077 TAPEDRIVE="/dev/nst0"
2078 PSCMD="ps -e -o pid,command"
2080 platforms/gentoo/Makefile \
2081 platforms/gentoo/bacula-init \
2082 platforms/gentoo/bacula-fd \
2083 platforms/gentoo/bacula-sd \
2084 platforms/gentoo/bacula-dir"
2087 DISTVER=`cat /etc/slackware-version`
2088 TAPEDRIVE="/dev/nst0"
2089 PSCMD="ps -e -o pid,command"
2091 platforms/slackware/Makefile \
2092 platforms/slackware/rc.bacula-fd \
2093 platforms/slackware/rc.bacula-sd \
2094 platforms/slackware/rc.bacula-dir\
2095 platforms/slackware/functions.bacula"
2099 TAPEDRIVE="/dev/rmt/0cbn"
2100 PSCMD="ps -e -o pid,comm"
2102 platforms/solaris/Makefile \
2103 platforms/solaris/bacula-fd \
2104 platforms/solaris/bacula-sd \
2105 platforms/solaris/bacula-dir"
2106 if test x$DISTVER = x5.6 ; then
2107 AC_DEFINE(HAVE_OLD_SOCKOPT)
2109 LIBS="$LIBS -lresolv"
2112 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
2114 TAPEDRIVE="/dev/nst0"
2115 PSCMD="ps -e -o pid,command"
2117 platforms/suse/Makefile \
2118 platforms/suse/bacula-fd \
2119 platforms/suse/bacula-sd \
2120 platforms/suse/bacula-dir \
2121 platforms/suse/bacula \
2122 platforms/suse/bacula.spec"
2127 TAPEDRIVE="/dev/nst0"
2128 PSCMD="ps -e -o pid,command"
2130 platforms/suse/Makefile \
2131 platforms/suse/bacula-fd \
2132 platforms/suse/bacula-sd \
2133 platforms/suse/bacula-dir"
2137 TAPEDRIVE="/dev/nst0"
2140 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
2146 LIBS="$PTHREAD_LIB $LIBS"
2148 AC_DEFINE_UNQUOTED(lld, "$lld")
2149 AC_DEFINE_UNQUOTED(llu, "$llu")
2157 dnl# common parts of the Makefile
2158 MCOMMON=./autoconf/Make.common
2159 AC_SUBST_FILE(MCOMMON)
2162 if test "x${subsysdir}" = "x${sbindir}" ; then
2165 echo "You have set both --sbindir and --with-subsys-dir"
2166 echo " equal to: ${subsysdir} "
2167 echo "This is not permitted. Please reconfigure."
2169 echo "Aborting configuration ..."
2175 AC_OUTPUT([autoconf/Make.common \
2178 scripts/startmysql \
2180 scripts/btraceback \
2186 scripts/bacula-ctl-dir \
2187 scripts/bacula-ctl-fd \
2188 scripts/bacula-ctl-sd \
2189 scripts/devel_bacula \
2192 scripts/bacula.desktop.gnome1 \
2193 scripts/bacula.desktop.gnome2 \
2194 scripts/bacula.desktop.gnome1.consolehelper \
2195 scripts/bacula.desktop.gnome2.consolehelper \
2196 scripts/bacula.desktop.gnome1.xsu \
2197 scripts/bacula.desktop.gnome2.xsu \
2198 scripts/bgnome-console.console_apps \
2199 scripts/mtx-changer \
2200 scripts/disk-changer \
2201 scripts/dvd-handler \
2202 scripts/dvd-simulator \
2203 scripts/bacula-tray-monitor.desktop \
2204 scripts/logwatch/Makefile \
2205 scripts/logwatch/logfile.bacula.conf \
2206 scripts/wxconsole.console_apps \
2207 scripts/wxconsole.desktop.consolehelper \
2208 scripts/wxconsole.desktop.xsu \
2209 scripts/bat.desktop \
2210 scripts/bat.desktop.xsu \
2211 scripts/bat.desktop.consolehelper \
2212 scripts/bat.console_apps \
2215 src/console/Makefile \
2216 src/console/bconsole.conf \
2217 src/gnome2-console/Makefile \
2218 src/gnome2-console/bgnome-console.conf \
2219 src/qt-console/bat.conf \
2220 src/qt-console/bat.pro \
2221 src/qt-console/install_conf_file \
2222 src/wx-console/Makefile \
2223 src/wx-console/bwx-console.conf \
2224 src/tray-monitor/Makefile \
2225 src/tray-monitor/tray-monitor.conf \
2227 src/dird/bacula-dir.conf \
2229 src/stored/Makefile \
2230 src/stored/bacula-sd.conf \
2231 src/filed/Makefile \
2232 src/filed/bacula-fd.conf \
2234 src/cats/make_catalog_backup \
2235 src/cats/delete_catalog_backup \
2236 src/cats/create_postgresql_database \
2237 src/cats/update_postgresql_tables \
2238 src/cats/make_postgresql_tables \
2239 src/cats/grant_postgresql_privileges \
2240 src/cats/drop_postgresql_tables \
2241 src/cats/drop_postgresql_database \
2242 src/cats/create_mysql_database \
2243 src/cats/update_mysql_tables \
2244 src/cats/make_mysql_tables \
2245 src/cats/grant_mysql_privileges \
2246 src/cats/drop_mysql_tables \
2247 src/cats/drop_mysql_database \
2248 src/cats/create_sqlite_database \
2249 src/cats/update_sqlite_tables \
2250 src/cats/make_sqlite_tables \
2251 src/cats/grant_sqlite_privileges \
2252 src/cats/drop_sqlite_tables \
2253 src/cats/drop_sqlite_database \
2254 src/cats/create_sqlite3_database \
2255 src/cats/update_sqlite3_tables \
2256 src/cats/make_sqlite3_tables \
2257 src/cats/grant_sqlite3_privileges \
2258 src/cats/drop_sqlite3_tables \
2259 src/cats/drop_sqlite3_database \
2262 src/cats/create_bdb_database \
2263 src/cats/update_bdb_tables \
2264 src/cats/make_bdb_tables \
2265 src/cats/grant_bdb_privileges \
2266 src/cats/drop_bdb_tables \
2267 src/cats/drop_bdb_database \
2268 src/cats/create_bacula_database \
2269 src/cats/update_bacula_tables \
2270 src/cats/grant_bacula_privileges \
2271 src/cats/make_bacula_tables \
2272 src/cats/drop_bacula_tables \
2273 src/cats/drop_bacula_database \
2274 src/findlib/Makefile \
2275 src/tools/Makefile \
2277 updatedb/update_mysql_tables_10_to_11 \
2278 updatedb/update_sqlite3_tables_10_to_11 \
2279 updatedb/update_postgresql_tables_10_to_11 \
2280 updatedb/update_sqlite_tables_10_to_11 \
2285 if test "${support_bat}" = "yes" ; then
2286 if test "x$QMAKE" = "xnone" && test "x$QMAKEQT4" = "xnone"; then
2287 echo "Could not find qmake or qmake-qt4 in $PATH. Check your Qt installation"
2293 if test "x$QMAKEQT4" != "xnone"; then
2300 chmod 755 install_conf_file build-depkgs-qt-console
2301 echo "Creating bat Makefile"
2306 echo "Doing make of dependencies"
2307 ${MAKE:-make} depend
2310 chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
2311 chmod 755 dvd-handler dvd-simulator
2312 chmod 755 bconsole gconsole mtx-changer devel_bacula logrotate
2316 chmod 755 $c/update_mysql_tables_10_to_11 $c/update_sqlite3_tables_10_to_11
2317 chmod 755 $c/update_postgresql_tables_10_to_11 $c/update_sqlite_tables_10_to_11
2321 chmod 755 $c/create_bacula_database $c/update_bacula_tables $c/make_bacula_tables
2322 chmod 755 $c/grant_bacula_privileges $c/drop_bacula_tables $c/drop_bacula_database
2324 chmod 755 $c/create_bdb_database $c/update_bdb_tables $c/make_bdb_tables
2325 chmod 755 $c/grant_bdb_privileges $c/drop_bdb_tables $c/drop_bdb_database
2327 chmod 755 $c/create_mysql_database $c/update_mysql_tables $c/make_mysql_tables
2328 chmod 755 $c/grant_mysql_privileges $c/drop_mysql_tables $c/drop_mysql_database
2330 chmod 755 $c/create_sqlite_database $c/update_sqlite_tables $c/make_sqlite_tables
2331 chmod 755 $c/grant_sqlite_privileges $c/drop_sqlite_tables $c/drop_sqlite_database
2333 chmod 755 $c/create_sqlite3_database $c/update_sqlite3_tables $c/make_sqlite3_tables
2334 chmod 755 $c/grant_sqlite3_privileges $c/drop_sqlite3_tables $c/drop_sqlite3_database
2336 chmod 755 $c/create_postgresql_database $c/update_postgresql_tables $c/make_postgresql_tables
2337 chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables $c/drop_postgresql_database
2339 chmod 755 $c/make_catalog_backup $c/delete_catalog_backup
2343 chmod 755 src/win32/build-depkgs-mingw32
2347 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
2348 largefile_support="yes"
2352 # A whole lot of hand springs to get the compiler version.
2353 # This is because gcc changed the output in version 3.0
2355 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
2356 if test "x${CCVERSION}" = "x" ; then
2357 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
2359 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
2360 if test x"${CXXVERSION}" = x ; then
2361 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
2364 if test "x${subsysdir}" = "x${sbindir}" ; then
2367 echo "You have set --sbindir and --with-subsys-dir"
2368 echo " both equal to: ${subsysdir} "
2369 echo " This is not permitted. Please reconfigure."
2371 echo "Aborting configuration ..."
2377 if test "x${db_type}" = "xInternal" ; then
2380 echo "You have not specified either --enable-client-only or one of the"
2381 echo " supported databases: MySQL, PostgreSQL, SQLite3, SQLite or DBI."
2382 echo " This is not permitted. Please reconfigure."
2384 echo "Aborting the configuration ..."
2391 Configuration on `date`:
2393 Host: $host -- ${DISTNAME} ${DISTVER}
2394 Bacula version: ${VERSION} (${DATE})
2395 Source code location: ${srcdir}
2396 Install binaries: ${sbindir}
2397 Install config files: ${sysconfdir}
2398 Scripts directory: ${scriptdir}
2399 Archive directory: ${archivedir}
2400 Working directory: ${working_dir}
2401 PID directory: ${piddir}
2402 Subsys directory: ${subsysdir}
2403 Man directory: ${mandir}
2404 Data directory: ${datadir}
2405 C Compiler: ${CC} ${CCVERSION}
2406 C++ Compiler: ${CXX} ${CXXVERSION}
2407 Compiler flags: ${WCFLAGS} ${CFLAGS}
2408 Linker flags: ${WLDFLAGS} ${LDFLAGS}
2410 Statically Linked Tools: ${support_static_tools}
2411 Statically Linked FD: ${support_static_fd}
2412 Statically Linked SD: ${support_static_sd}
2413 Statically Linked DIR: ${support_static_dir}
2414 Statically Linked CONS: ${support_static_cons}
2415 Database type: ${db_type}
2416 Database lib: ${DB_LIBS}
2417 Database name: ${db_name}
2418 Database user: ${db_user}
2420 Job Output Email: ${job_email}
2421 Traceback Email: ${dump_email}
2422 SMTP Host Address: ${smtp_host}
2424 Director Port: ${dir_port}
2425 File daemon Port: ${fd_port}
2426 Storage daemon Port: ${sd_port}
2428 Director User: ${dir_user}
2429 Director Group: ${dir_group}
2430 Storage Daemon User: ${sd_user}
2431 Storage DaemonGroup: ${sd_group}
2432 File Daemon User: ${fd_user}
2433 File Daemon Group: ${fd_group}
2435 SQL binaries Directory ${SQL_BINDIR}
2437 Large file support: $largefile_support
2438 Bacula conio support: ${got_conio} ${CONS_LIBS}
2439 readline support: ${got_readline} ${PRTREADLINE_SRC}
2440 TCP Wrappers support: ${TCPW_MSG} ${WRAPLIBS}
2441 TLS support: ${support_tls}
2442 Encryption support: ${support_crypto}
2443 ZLIB support: ${have_zlib}
2444 enable-smartalloc: ${support_smartalloc}
2445 bat support: ${support_bat} ${QWT_LDFLAGS}
2446 enable-gnome: ${support_gnome} ${gnome_version}
2447 enable-bwx-console: ${support_wx_console} ${wx_version}
2448 enable-tray-monitor: ${support_tray_monitor}
2449 client-only: ${build_client_only}
2450 build-dird: ${build_dird}
2451 build-stored: ${build_stored}
2452 ACL support: ${have_acl}
2453 Python support: ${support_python} ${PYTHON_LIBS}
2454 Batch insert enabled: ${support_batch_insert}