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_ARG_VAR(WXCONFIG, [wx-config command. On some systems, you must set it to wx-config-2.6 to use wxWidgets 2.6.])
78 if test "x$WXCONFIG" = x; then
81 AC_PATH_PROG(WXCONFIG, ${WXCONFIG}, ${WXCONFIG})
82 AC_ARG_VAR(WXFLAGS, [Parameters to pass to wx-config (e.g. --unicode=no).])
83 AC_PATH_PROG(CDRECORD, cdrecord, cdrecord)
84 AC_PATH_PROG(PIDOF, pidof, pidof)
86 # Some AWK programs fail, so test it and warn the user
87 if echo xfoo | $AWK 'BEGIN { prog=ARGV[1]; ARGC=1 }
88 { if ((prog == $2) || (("(" prog ")") == $2) ||
89 (("[" prog "]") == $2) ||
90 ((prog ":") == $2)) { print $1 ; exit 0 } }' xfoo>/dev/null; then :;
92 AC_MSG_ERROR([!!!!!!!!! WARNING !!!!!!!!!!!!!!
93 The regex engine of $AWK is too broken to be used you
94 might want to install GNU AWK.
95 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!])
98 AC_PATH_PROG(AWK, $THE_AWK, $THE_AWK)
101 test -n "$ARFLAG" || ARFLAGS="cr"
108 AC_SUBST(LOCAL_CFLAGS)
109 AC_SUBST(LOCAL_LDFLAGS)
112 dnl --------------------------------------------------
113 dnl Bacula OP Sys determination (see aclocal.m4)
114 dnl --------------------------------------------------
117 # -----------------------------------------------------------
118 dnl Bacula OPSys Distribution determination (see aclocal.m4)
119 # ----------------------------------------------------------
120 BA_CHECK_OPSYS_DISTNAME
122 # --------------------------------------------------
123 # Suppport for gettext (translations)
124 # By default, $datadir is ${prefix}/share
125 # --------------------------------------------------
126 AM_GNU_GETTEXT([external])
127 if test x${prefix} = xNONE ; then
128 if test `eval echo ${datadir}` = NONE/share ; then
133 # ------------------------------------------------------------------
134 # If the user has not set --prefix, we set our default to nothing.
135 # In this case, if the user has not set --sysconfdir, we set it
136 # to the package default of /etc/bacula. If either --prefix or
137 # --sysconfdir is set, we leave sysconfdir alone except to eval it.
138 # ------------------------------------------------------------------
139 if test x${prefix} = xNONE ; then
140 if test `eval echo ${sysconfdir}` = NONE/etc ; then
141 sysconfdir=/etc/bacula
145 sysconfdir=`eval echo ${sysconfdir}`
146 datadir=`eval echo ${datadir}`
147 localedir=`eval echo ${datadir}/locale`
148 AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir")
149 AC_DEFINE_UNQUOTED(SYSCONFDIR, "$sysconfdir")
151 # -------------------------------------------------------------------------
152 # If the user has not set --exec-prefix, we default to ${prefix}
153 # -------------------------------------------------------------------------
154 if test x${exec_prefix} = xNONE ; then
155 exec_prefix=${prefix}
158 # ------------------------------------------------------------------
159 # If the user has not set --sbindir, we set our default as /sbin
160 # ------------------------------------------------------------------
161 if test x$sbindir = x'${exec_prefix}/sbin' ; then
162 sbindir=${exec_prefix}/sbin
164 sbindir=`eval echo ${sbindir}`
166 # ------------------------------------------------------------------
167 # If the user has not set --archivedir, we set our default as /tmp
168 # ------------------------------------------------------------------
169 if test x$archivedir = x'${archivedir}' ; then
170 archivedir=${archivedir}
172 archivedir=`eval echo ${archivedir}`
174 # -------------------------------------------------------------------------
175 # If the user has not set --mandir, we default to /usr/share/man
176 # -------------------------------------------------------------------------
177 if test x$mandir = x'${prefix}/man' ; then
178 mandir=/usr/share/man
182 AC_PATH_PROGS(MSGFMT, msgfmt, no)
183 if test "$MSGFMT" = "no"
185 echo 'msgfmt program not found, disabling NLS !'
187 USE_INCLUDED_LIBINTL=no
196 support_postgresql=no
197 support_smartalloc=yes
202 support_wx_console=no
207 support_static_tools=no
210 support_static_dir=no
211 support_static_cons=no
220 dnl# --------------------------------------------------------------------------
221 dnl# CHECKING COMMAND LINE OPTIONS
222 dnl# --------------------------------------------------------------------------
224 # -------------------------------------------
225 # gnome (default off)
226 # -------------------------------------------
228 [ --enable-gnome enable build of bgnome-console GUI [disabled]],
229 [if test x$enableval = xyes; then
234 if test x$support_gnome = xyes; then
235 abc=`$PKGCONFIG --exists libgnomeui-2.0`
237 if test $pkg = 0; then
238 GNOME_INCLUDEDIR=`$PKGCONFIG --cflags-only-I libgnomeui-2.0`
239 GNOMEUI_LIBS=`$PKGCONFIG --libs-only-l libgnomeui-2.0`
240 GNOME_LIBDIR=`$PKGCONFIG --libs libgnomeui-2.0`
241 GNOME_LIBS=`$PKGCONFIG --libs-only-l libgnomeui-2.0`
242 AC_SUBST(GNOME_INCLUDEDIR)
243 AC_SUBST(GNOMEUI_LIBS)
244 AC_SUBST(GNOME_LIBDIR)
246 GNOME_DIR=src/gnome2-console
247 gnome_version="Version 2.x"
249 AC_MSG_ERROR(Unable to find Gnome 2 installation)
254 # -------------------------------------------
256 # -------------------------------------------
258 [ --enable-bat enable build of bat Qt4 GUI [disabled]],
259 [if test x$enableval = xyes; then
260 AC_DEFINE(HAVE_BAT, 1, [Set if Bacula bat Qt4 GUI support enabled])
265 if test x$support_bat = xyes; then
266 abc=`$PKGCONFIG --atleast-version=4.2 QtGui`
268 if test $pkg = 0; then
269 BAT_DIR=src/qt-console
271 AC_MSG_ERROR(Unable to find Qt4 installation needed by bat)
276 # If bat is enabled, we need the qwt library
280 if test x$support_bat = xyes; then
281 AC_MSG_CHECKING(for qwt support)
283 [ --with-qwt@<:@=DIR@:>@ specify qwt library directory],
289 if test -f ${with_qwt}/include/qwt.h; then
290 QWT_INC="${with_qwt}/include"
291 QWT_LDFLAGS="-L${with_qwt}/lib"
298 # Search in standard places, or --with-qwt not specified
300 if test x$QWT_INC = x; then
301 for root in /usr /usr/local; do
302 for ver in qwt qwt5 qwt-qt4; do
303 if test -f ${root}/include/${ver}/qwt.h; then
304 QWT_INC="${root}/include/${ver}"
305 if test -d ${root}/lib64/; then
306 QWT_LDFLAGS="-L${root}/lib64"
308 QWT_LDFLAGS="-L${root}/lib"
316 if test x$QWT_INC = x; then
318 AC_MSG_ERROR(Unable to find qwt package needed by bat)
328 AC_SUBST(QWT_LDFLAGS)
331 # -------------------------------------------
332 # bwx-console (default off)
333 # -------------------------------------------
334 AC_ARG_ENABLE(bwx-console,
335 [ --enable-bwx-console enable build of wxWidgets console [disabled]],
336 [if test x$enableval = xyes; then
337 support_wx_console=yes
341 if test x$support_wx_console = xyes; then
342 abc=`$WXCONFIG $WXFLAGS --cppflags`
344 if test $pkg = 0; then
345 wx_version="wxWidgets `$WXCONFIG $WXFLAGS --release`"
346 WXCONS_CPPFLAGS=`$WXCONFIG $WXFLAGS --cppflags`
347 WXCONS_LDFLAGS=`$WXCONFIG $WXFLAGS --libs`
349 AC_SUBST(WXCONS_CPPFLAGS)
350 AC_SUBST(WXCONS_LDFLAGS)
351 WX_DIR=src/wx-console
354 echo "wx-config program not found. bwx-console disabled."
356 support_wx_console=no
362 # -------------------------------------------
363 # tray-monitor (default off)
364 # -------------------------------------------
365 AC_ARG_ENABLE(tray-monitor,
366 [ --enable-tray-monitor enable build of Gnome tray monitor (compatible with KDE) [disabled]],
367 [if test x$enableval = xyes; then
368 support_tray_monitor=yes
372 if test x$support_tray_monitor = xyes; then
373 abc=`$PKGCONFIG --exists gtk+-2.0`
375 if test $pkg = 0; then
376 TRAY_MONITOR_CPPFLAGS=`$PKGCONFIG --cflags gtk+-2.0`
377 TRAY_MONITOR_LDFLAGS=`$PKGCONFIG --libs gtk+-2.0`
378 AC_SUBST(TRAY_MONITOR_CPPFLAGS)
379 AC_SUBST(TRAY_MONITOR_LDFLAGS)
380 TRAY_MONITOR_DIR=src/tray-monitor
381 abc=`$PKGCONFIG --atleast-version=2.4 gtk+-2.0`
383 if test $pkg = 0; then
384 AC_DEFINE(HAVE_GTK_2_4, 1, [Set if you have GTK 4.2 or greater loaded])
388 AC_SUBST(TRAY_MONITOR_DIR)
390 # -------------------------------------------
391 # smartalloc (default off)
392 # -------------------------------------------
393 AC_ARG_ENABLE(smartalloc,
394 [ --enable-smartalloc enable smartalloc debugging support [disabled]],
395 [if test x$enableval = xno; then
396 support_smartalloc=no
399 if test x$support_smartalloc = xyes; then
400 AC_DEFINE(SMARTALLOC, 1, [Set if you want Smartalloc enabled])
403 # -------------------------------------------
404 # static-tools (default off)
405 # -------------------------------------------
406 AC_ARG_ENABLE(static-tools,
407 [ --enable-static-tools enable static tape tools [disabled]],
408 [if test x$enableval = xyes; then
409 support_static_tools=yes
413 if test x$support_static_tools = xyes; then
414 TTOOL_LDFLAGS="-static"
416 AC_SUBST(TTOOL_LDFLAGS)
418 # -------------------------------------------
419 # static-fd (default off)
420 # -------------------------------------------
421 AC_ARG_ENABLE(static-fd,
422 [ --enable-static-fd enable static File daemon [disabled]],
423 [if test x$enableval = xyes; then
424 support_static_fd=yes
428 if test x$support_static_fd = xyes; then
429 STATIC_FD="static-bacula-fd"
433 # -------------------------------------------
434 # static-sd (default off)
435 # -------------------------------------------
436 AC_ARG_ENABLE(static-sd,
437 [ --enable-static-sd enable static Storage daemon [disabled]],
438 [if test x$enableval = xyes; then
439 support_static_sd=yes
443 if test x$support_static_sd = xyes; then
444 STATIC_SD="static-bacula-sd"
448 # -------------------------------------------
449 # static-dir (default off)
450 # -------------------------------------------
451 AC_ARG_ENABLE(static-dir,
452 [ --enable-static-dir enable static Director [disabled]],
453 [if test x$enableval = xyes; then
454 support_static_dir=yes
458 if test x$support_static_dir = xyes; then
459 STATIC_DIR="static-bacula-dir"
463 # -------------------------------------------
464 # static-cons (default off)
465 # -------------------------------------------
466 AC_ARG_ENABLE(static-cons,
467 [ --enable-static-cons enable static Console [disabled]],
468 [if test x$enableval = xyes; then
469 support_static_cons=yes
475 if test x$support_static_cons = xyes; then
476 STATIC_CONS="static-bconsole"
477 STATIC_GNOME_CONS="static-bgnome-console"
478 STATIC_WX_CONS="static-bwx-console"
480 AC_SUBST(STATIC_CONS)
481 AC_SUBST(STATIC_GNOME_CONS)
482 AC_SUBST(STATIC_WX_CONS)
484 # -------------------------------------------
485 # client_only (default off)
486 # -------------------------------------------
487 AC_ARG_ENABLE(client-only,
488 [ --enable-client-only build client (File daemon) only [disabled]],
489 [if test x$enableval = xyes; then
490 build_client_only=yes
494 if test x$build_client_only = xno; then
501 # -------------------------------------------
502 # director (default on)
503 # -------------------------------------------
504 AC_ARG_ENABLE(build-dird,
505 [ --enable-build-dird enable building of dird (Director) [enabled]],
506 [if test x$enableval = xno; then
509 if test x$build_dird = xyes; then
514 DIR_TOOLS="NODIRTOOLS"
519 # -------------------------------------------
520 # stored (default on)
521 # -------------------------------------------
522 AC_ARG_ENABLE(build-stored,
523 [ --enable-build-stored enable building of stored (Storage daemon) [enabled]],
524 [if test x$enableval = xno; then
527 if test x$build_stored = xyes; then
528 STORED_DIR="src/stored"
534 # ---------------------------------------------------
535 # Check for conio (Bacula readline substitute)(
536 # ---------------------------------------------------
537 # this allows you to turn it completely off
539 [ --disable-conio disable conio support [enabled]
541 [if test x$enableval = xno; then
547 # ---------------------------------------------------
548 # Check for IPv6 support
549 # ---------------------------------------------------
550 # this allows you to turn it completely off
553 [ --enable-ipv6 enable ipv6 support [enabled]
555 [if test x$enableval = xno; then
560 if test x$support_ipv6 = xyes; then
561 AC_TRY_LINK([ #include <sys/types.h>
562 #include <sys/socket.h>
563 #include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;],
564 [support_ipv6=yes], [support_ipv6=no])
567 if test x$support_ipv6 = xyes; then
568 AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
574 if test x$support_conio = xyes; then
575 AC_CHECK_HEADER(termcap.h,
576 [ AC_CHECK_LIB(termcap, tgetent,
577 [ CONS_LIBS="-ltermcap"
582 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
584 [ AC_CHECK_LIB(ncurses, tgetent,
585 [ CONS_LIBS="-lncurses"
590 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
595 AC_CHECK_HEADERS(curses.h)
596 AC_CHECK_HEADER(term.h,
597 [ AC_CHECK_LIB(curses, tgetent,
598 [ CONS_LIBS="-lcurses"
603 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
606 [ echo " "; echo "Required libraries not found. CONIO turned off ..."; echo " "],
615 # ---------------------------------------------------
616 # Check for readline support/directory (default off)
617 # ---------------------------------------------------
618 # this allows you to turn it completely off
619 AC_ARG_ENABLE(readline,
620 [ --disable-readline disable readline support [disable]
622 [if test x$enableval = xno; then
628 if test x$support_readline = xyes; then
629 AC_ARG_WITH(readline,
630 [ --with-readline@<:@=DIR@:>@ specify readline library directory],
632 case "$with_readline" in
635 if test -f ${with_readline}/readline.h; then
636 CONS_INC="-I${with_readline}"
637 CONS_LDFLAGS="-L$with_readline"
638 elif test -f ${with_readline}/include/readline/readline.h; then
639 CONS_INC="-I${with_readline}/include/readline"
640 CONS_LDFLAGS="-L${with_readline}/lib"
641 with_readline="${with_readline}/include/readline"
643 with_readline="/usr/include/readline"
645 AC_CHECK_HEADER(${with_readline}/readline.h,
646 [ AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
647 CONS_LIBS="-lreadline -lhistory -ltermcap"
651 echo "readline.h not found. readline turned off ..."
658 # check for standard readline library
659 AC_CHECK_HEADER(/usr/include/readline/readline.h,
660 [ AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
662 CONS_INC="-I/usr/include/readline"
663 CONS_LIBS="-lreadline -ltermcap"
665 # Did not find standard library, so try Bacula's default
666 AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h,
667 [ AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
669 CONS_INC="-I${TOP_DIR}/depkgs/readline"
670 CONS_LIBS="-lreadline -lhistory -ltermcap"
671 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
672 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
675 echo "readline.h not found. readline turned off ..."
691 AC_SUBST(CONS_LDFLAGS)
692 AC_SUBST(READLINE_SRC)
694 # Minimal stuff for readline Makefile configuration
699 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr lstat lchown)
700 AC_CHECK_FUNCS(nanosleep nl_langinfo)
701 AC_CHECK_HEADERS(varargs.h)
703 # End of readline/conio stuff
704 # -----------------------------------------------------------------------
706 # -----------------------------------------------------------------------
707 # Check for Python support
709 AC_MSG_CHECKING(for Python support)
712 --with-python@<:@=DIR@:>@ Include Python support. DIR is the Python base
713 install directory, default is to search through
714 a number of common places for the Python files.],
718 if test "$withval" != "no"; then
719 if test "$withval" = "yes"; then
720 for python_root in /usr /usr/local /usr/sfw; do
721 for ver in python2.2 python2.3 python2.4 python2.5; do
722 if test -f $python_root/include/${ver}/Python.h; then
723 PYTHON_INCDIR=-I$python_root/include/${ver}
724 if test -d $python_root/lib64/${ver}/config; then
725 PYTHON_LIBS="-L$python_root/lib64/${ver}/config -l${ver}"
727 PYTHON_LIBS="-L$python_root/lib/${ver}/config -l${ver}"
733 if test x$PYTHON_INCDIR = x; then
734 if test -f $prefix/include/Python.h; then
735 PYTHON_INCDIR=-I$prefix/include
736 if test -d $prefix/lib64/config; then
737 PYTHON_LIBS="-L$prefix/lib64/config -lpython"
739 PYTHON_LIBS="-L$prefix/lib/config -lpython"
743 AC_MSG_ERROR(Unable to find Python.h in standard locations)
747 if test -f $withval/Python.h; then
748 PYTHON_INCDIR=-I$withval
749 PYTHON_LIBS="-L$withval/config -lpython"
750 elif test -f $withval/include/Python.h; then
751 PYTHON_INCDIR=-I$withval/include
752 if test -d $withval/lib64/config; then
753 PYTHON_LIBS="-L$withval/lib64/config -lpython"
755 PYTHON_LIBS="-L$withval/lib/config -lpython"
757 elif test -f $withval/include/python/Python.h; then
758 PYTHON_INCDIR=-I$withval/include/python
759 if test -d $withval/lib64/python/config; then
760 PYTHON_LIBS="-L$withval/lib64/python/config -lpython"
762 PYTHON_LIBS="-L$withval/lib/python/config -lpython"
766 AC_MSG_ERROR(Invalid Python directory $withval - unable to find Python.h under $withval)
769 AC_DEFINE([HAVE_PYTHON], 1)
772 AC_MSG_NOTICE(checking for more Python libs)
773 saved_LIBS="$LIBS"; LIBS=
774 AC_SEARCH_LIBS(shm_open, [rt])
775 AC_CHECK_LIB(util, openpty)
776 PYTHON_LIBS="$PYTHON_LIBS $LIBS"
784 AC_SUBST(PYTHON_LIBS)
785 AC_SUBST(PYTHON_INCDIR)
788 # Find where sockets are (especially for Solaris)
789 # Do this before the TCP Wrappers test since tcp wrappers
790 # uses the socket library and some linkers are stupid.
792 AC_CHECK_FUNC(socket,
793 AC_MSG_RESULT(using libc's socket),
794 AC_CHECK_LIB(xnet,socket)
795 AC_CHECK_LIB(socket,socket)
796 AC_CHECK_LIB(inet,socket))
799 # -----------------------------------------------------------
800 # Check whether user wants TCP wrappers support (default off)
801 # -----------------------------------------------------------
804 AC_ARG_WITH(tcp-wrappers,
805 [ --with-tcp-wrappers@<:@=DIR@:>@ enable tcpwrappers support],
807 if test "x$withval" != "xno" ; then
809 LIBS="$saved_LIBS -lwrap"
810 AC_MSG_CHECKING(for libwrap)
811 AC_SEARCH_LIBS(nanosleep, [rt])
813 [ #include <sys/types.h>
815 int deny_severity = 0;
816 int allow_severity = 0;
817 struct request_info *req; ],
818 [ hosts_access(req); ],
821 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
826 LIBS="$saved_LIBS -lwrap -lnsl"
827 WRAPLIBS="$saved_LIBS -lwrap -lnsl"
829 [ #include <sys/types.h>
831 int deny_severity = 0;
832 int allow_severity = 0;
833 struct request_info *req; ],
834 [ hosts_access(req); ],
837 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
842 [AC_MSG_ERROR([*** libwrap missing]) ] ]
849 # -----------------------------------------------------------
850 # Check whether OpenSSL is available
851 # -----------------------------------------------------------
852 AC_MSG_CHECKING([for OpenSSL])
853 dnl The following uses quadrigraphs:
857 AC_HELP_STRING([--with-openssl@<:@=DIR@:>@], [Include OpenSSL support. DIR is the OpenSSL base]),
858 [with_openssl_directory=${withval}])
860 if test "x$with_openssl_directory" != "x"; then
861 OPENSSL_LIBS="-lssl -lcrypto"
864 if test "x$with_openssl_directory" != "xyes" && test x"${with_openssl_directory}" != "x"; then
865 OPENSSL_LIBS="-L$with_openssl_directory/lib $OPENSSL_LIBS"
866 OPENSSL_INC="-I$with_openssl_directory/include $OPENSSL_INC"
870 saved_CFLAGS="${CFLAGS}"
871 LIBS="${saved_LIBS} ${OPENSSL_LIBS}"
872 CFLAGS="${saved_CFLAGS} ${OPENSSL_INC}"
874 AC_TRY_LINK([ #include <openssl/ssl.h> ],
875 [ CRYPTO_set_id_callback(NULL); ],
883 AC_TRY_LINK([ #include <openssl/evp.h> ],
885 [ ac_cv_openssl_sha2="yes" ],
886 [ ac_cv_openssl_sha2="no" ]
889 # Solaris disables greater than 128+ bit encryption in their OpenSSL
890 # implementation, presumably for export reasons. If 192bit AES
891 # is available, we assume that we're running with a 'non-export'
893 AC_TRY_LINK([ #include <openssl/evp.h> ],
894 [ EVP_aes_192_cbc(); ],
895 [ ac_cv_openssl_export="no" ],
896 [ ac_cv_openssl_export="yes" ]
900 CFLAGS="${saved_CFLAGS}"
902 if test "$support_tls" = "yes"; then
903 AC_DEFINE(HAVE_OPENSSL, 1, [Define if OpenSSL library is available])
904 AC_DEFINE(HAVE_TLS, 1, [Define if TLS support should be enabled])
905 AC_DEFINE(HAVE_CRYPTO, 1, [Define if encryption support should be enabled])
908 if test "$ac_cv_openssl_sha2" = "yes"; then
909 AC_DEFINE(HAVE_SHA2, 1, [Define if the SHA-2 family of digest algorithms is available])
912 if test "$ac_cv_openssl_export" = "yes"; then
913 AC_DEFINE(HAVE_OPENSSL_EXPORT_LIBRARY, 1, [Define if the OpenSSL library is export-contrained to 128bit ciphers])
922 AC_MSG_RESULT([$support_tls])
923 AC_SUBST(OPENSSL_LIBS)
924 AC_SUBST(OPENSSL_INC)
927 # -----------------------------------------------------------
928 # Python and OpenSSL are using dlopen
929 # -----------------------------------------------------------
931 if test "$support_python" = "yes" -o "$support_tls" = "yes"; then
932 AC_SEARCH_LIBS(dlopen, [dl])
935 # ------------------------------------------
936 # Where to place working dir
937 # ------------------------------------------
938 working_dir=`eval echo ${prefix}/var/bacula/working`
939 AC_ARG_WITH(working-dir,
940 [ --with-working-dir=PATH specify path of Bacula working directory],
942 if test "x$withval" != "xno" ; then
948 AC_SUBST(working_dir)
951 # ------------------------------------------
952 # Where to place scriptdir (script files)
953 # ------------------------------------------
954 scriptdir=`eval echo ${sysconfdir}`
955 AC_ARG_WITH(scriptdir,
956 [ --with-scriptdir=PATH specify path of Bacula scripts directory],
958 if test "x$withval" != "xno" ; then
967 # ------------------------------------------
968 # Where to send dump email
969 # ------------------------------------------
970 dump_email=root@localhost
971 AC_ARG_WITH(dump-email,
972 [ --with-dump-email=EMAIL dump email address],
974 if test "x$withval" != "xno" ; then
982 # ------------------------------------------
983 # Where to send job email
984 # ------------------------------------------
985 job_email=root@localhost
986 AC_ARG_WITH(job-email,
987 [ --with-job-email=EMAIL job output email address],
989 if test "x$withval" != "xno" ; then
997 # ------------------------------------------
998 # Where to find smtp host
999 # ------------------------------------------
1001 AC_ARG_WITH(smtp_host,
1002 [ --with-smtp-host=HOST SMTP mail host address],
1004 if test "x$withval" != "xno" ; then
1013 # ------------------------------------
1014 # Where to place pid files
1015 # ------------------------------------
1017 AC_ARG_WITH(pid-dir,
1018 [ --with-pid-dir=PATH specify location of Bacula pid files],
1020 if test "x$withval" != "xno" ; then
1026 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
1030 # ------------------------------------
1031 # Where to place subsys "lock file"
1032 # ------------------------------------
1033 subsysdir=/var/run/subsys
1034 if test -d /var/run/subsys; then
1035 subsysdir=/var/run/subsys
1036 elif test -d /var/lock/subsys; then
1037 subsysdir=/var/lock/subsys
1039 subsysdir=/var/run/subsys
1041 AC_ARG_WITH(subsys-dir,
1042 [ --with-subsys-dir=PATH specify location of Bacula subsys file],
1044 if test "x$withval" != "xno" ; then
1054 # ------------------------------------
1055 # Where to start assigning ports
1056 # ------------------------------------
1058 AC_ARG_WITH(baseport,
1059 [ --with-baseport=PORT specify base port address for daemons],
1061 if test "x$withval" != "xno" ; then
1068 dir_port=`expr $baseport`
1069 fd_port=`expr $baseport + 1`
1070 sd_port=`expr $fd_port + 1`
1077 # ------------------------------------------
1078 # Generate passwords
1079 # ------------------------------------------
1081 AC_ARG_WITH(dir-password,
1082 [ --with-dir-password=PASSWORD specify Director's password],
1084 if test "x$withval" != "xno" ; then
1085 dir_password=$withval
1090 if test "x$dir_password" = "x" ; then
1091 if test "x$OPENSSL" = "xnone" ; then
1092 key=`autoconf/randpass 33`
1094 key=`openssl rand -base64 33`
1100 AC_ARG_WITH(fd-password,
1101 [ --with-fd-password=PASSWORD specify Client's password],
1103 if test "x$withval" != "xno" ; then
1104 fd_password=$withval
1109 if test "x$fd_password" = "x" ; then
1110 if test "x$OPENSSL" = "xnone" ; then
1111 key=`autoconf/randpass 37`
1113 key=`openssl rand -base64 33`
1119 AC_ARG_WITH(sd-password,
1120 [ --with-sd-password=PASSWORD specify Storage daemon's password],
1122 if test "x$withval" != "xno" ; then
1123 sd_password=$withval
1128 if test "x$sd_password" = "x" ; then
1129 if test "x$OPENSSL" = "xnone" ; then
1130 key=`autoconf/randpass 41`
1132 key=`openssl rand -base64 33`
1138 AC_ARG_WITH(mon-dir-password,
1139 [ --with-mon-dir-password=PASSWORD specify Director's password used by the monitor],
1141 if test "x$withval" != "xno" ; then
1142 mon_dir_password=$withval
1147 if test "x$mon_dir_password" = "x" ; then
1148 if test "x$OPENSSL" = "xnone" ; then
1149 key=`autoconf/randpass 33`
1151 key=`openssl rand -base64 33`
1153 mon_dir_password=$key
1157 AC_ARG_WITH(mon-fd-password,
1158 [ --with-mon-fd-password=PASSWORD specify Client's password used by the monitor],
1160 if test "x$withval" != "xno" ; then
1161 mon_fd_password=$withval
1166 if test "x$mon_fd_password" = "x" ; then
1167 if test "x$OPENSSL" = "xnone" ; then
1168 key=`autoconf/randpass 37`
1170 key=`openssl rand -base64 33`
1172 mon_fd_password=$key
1176 AC_ARG_WITH(mon-sd-password,
1177 [ --with-mon-sd-password=PASSWORD specify Storage daemon's password used by the monitor],
1179 if test "x$withval" != "xno" ; then
1180 mon_sd_password=$withval
1185 if test "x$mon_sd_password" = "x" ; then
1186 if test "x$OPENSSL" = "xnone" ; then
1187 key=`autoconf/randpass 41`
1189 key=`openssl rand -base64 33`
1191 mon_sd_password=$key
1194 AC_SUBST(dir_password)
1195 AC_SUBST(fd_password)
1196 AC_SUBST(sd_password)
1197 AC_SUBST(mon_dir_password)
1198 AC_SUBST(mon_fd_password)
1199 AC_SUBST(mon_sd_password)
1202 # Pickup any database name
1205 AC_ARG_WITH(db_name,
1206 [ --with-db-name=DBNAME specify database name (default bacula)],
1208 if test "x$withval" != "x" ; then
1216 AC_ARG_WITH(db_user,
1217 [ --with-db-user=UNAME specify database user (default bacula)],
1219 if test "x$withval" != "x" ; then
1228 # Handle users and groups for each daemon
1231 AC_ARG_WITH(dir_user,
1232 [ --with-dir-user=USER specify user for Director daemon],
1234 if test "x$withval" != "x" ; then
1241 AC_ARG_WITH(dir_group,
1242 [ --with-dir-group=GROUP specify group for Director daemon],
1244 if test "x$withval" != "x" ; then
1251 AC_ARG_WITH(sd_user,
1252 [ --with-sd-user=USER specify user for Storage daemon],
1254 if test "x$withval" != "x" ; then
1261 AC_ARG_WITH(sd_group,
1262 [ --with-sd-group=GROUP specify group for Storage daemon],
1264 if test "x$withval" != "x" ; then
1271 AC_ARG_WITH(fd_user,
1272 [ --with-fd-user=USER specify user for File daemon],
1274 if test "x$withval" != "x" ; then
1281 AC_ARG_WITH(fd_group,
1282 [ --with-fd-group=GROUP specify group for File daemon],
1284 if test "x$withval" != "x" ; then
1298 # allow setting default executable permissions
1301 AC_ARG_WITH(sbin-perm,
1302 [ --with-sbin-perm=MODE specify permissions for sbin binaries (0754)],
1304 if test "x$withval" != "x" ; then
1312 # ------------------------------------------------
1313 # Bacula check for various SQL database engines
1314 # ------------------------------------------------
1316 BA_CHECK_POSTGRESQL_DB
1327 # -------------------------------------------
1328 # enable batch attribute DB insert (default on)
1329 # -------------------------------------------
1330 support_batch_insert=no
1331 A=`nm $SQL_LIB | grep pthread_mutex_lock`
1333 if test $pkg = 0; then
1334 support_batch_insert=yes
1335 AC_ARG_ENABLE(batch-insert,
1336 [ --enable-batch-insert enable the DB batch insert code [disabled]],
1337 [if test x$enableval = xno; then
1338 support_batch_insert=no
1340 support_batch_insert=yes
1344 # Check if postgresql support batch mode
1345 if test x$DB_TYPE = xpostgresql; then
1346 A=`nm $SQL_LIB | grep PQputCopyData`
1348 if test $pkg != 0; then
1349 support_batch_insert=no
1353 if test $support_batch_insert = yes ; then
1354 AC_DEFINE(HAVE_BATCH_FILE_INSERT, 1, [Set if DB batch insert code enabled])
1358 AC_DEFINE(PROTOTYPES)
1360 dnl# --------------------------------------------------------------------------
1361 dnl# Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
1363 if test -z "$CFLAGS" -o "$CFLAGS" = "-g -O2"; then
1364 if test -z "$CCOPTS"; then
1365 CCOPTS='-g -O2 -Wall'
1374 dnl See if we can use 64 bit file addresses
1375 largefile_support="no"
1381 dnl# --------------------------------------------------------------------------
1382 dnl# CHECKING FOR HEADER FILES
1383 dnl# --------------------------------------------------------------------------
1419 AC_STRUCT_ST_BLKSIZE
1423 dnl# --------------------------------------------------------------------------
1424 dnl# Check for utime.h structure
1425 dnl# --------------------------------------------------------------------------
1426 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
1428 #include <sys/types.h>
1429 #include <utime.h>], [struct utimbuf foo],
1430 ba_cv_header_utime_h=yes, ba_cv_header_utime_h=no)])
1431 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H, 1, [Set if utime.h exists])
1433 dnl# --------------------------------------------------------------------------
1434 dnl# Check for socklen_t
1435 dnl# --------------------------------------------------------------------------
1436 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
1438 #include <sys/types.h>
1439 #include <sys/socket.h>],
1441 ba_cv_header_socklen_t=yes, ba_cv_header_socklen_t=no)])
1442 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T)
1444 dnl# --------------------------------------------------------------------------
1445 dnl# Check for bigendian
1446 dnl# --------------------------------------------------------------------------
1447 AC_CACHE_CHECK([for bigendian], ba_cv_bigendian,
1449 [main(){long a=1L; char *p=(char *)&a; exit(*p);}],
1450 [ba_cv_bigendian=yes],
1451 [ba_cv_bigendian=no],
1452 [ba_cv_bigendian=no])])
1453 test $ba_cv_bigendian = yes && AC_DEFINE(HAVE_BIGENDIAN)
1455 dnl# --------------------------------------------------------------------------
1456 dnl# Check for typeof()
1457 dnl# --------------------------------------------------------------------------
1459 AC_CACHE_CHECK(for typeof, ba_cv_have_typeof,
1461 [main(){char *a = 0; a = (typeof a)a;}],
1462 [ba_cv_have_typeof=yes],
1463 [ba_cv_have_typeof=no],
1464 [ba_cv_have_typeof=no])])
1465 test $ba_cv_have_typeof = yes && AC_DEFINE([HAVE_TYPEOF], 1, [Defind to 1 if compiler has typeof])
1471 dnl# --------------------------------------------------------------------------
1472 dnl# CHECKING FOR FILESYSTEM TYPE
1473 dnl# --------------------------------------------------------------------------
1474 AC_MSG_CHECKING(how to get filesystem type)
1476 # The order of these tests is important.
1477 AC_TRY_CPP([#include <sys/statvfs.h>
1478 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4)
1479 if test $fstype = no; then
1480 AC_TRY_CPP([#include <sys/statfs.h>
1481 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3)
1483 if test $fstype = no; then
1484 AC_TRY_CPP([#include <sys/statfs.h>
1485 #include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX)
1487 if test $fstype = no; then
1488 AC_TRY_CPP([#include <mntent.h>], AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD)
1490 if test $fstype = no; then
1491 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
1493 if test $fstype = no; then
1494 AC_TRY_CPP([#include <sys/mount.h>
1495 #include <sys/fs_types.h>], AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix)
1497 AC_MSG_RESULT($fstype)
1499 AC_CHECK_HEADER(sys/statvfs.h, [ AC_DEFINE(HAVE_SYS_STATVFS_H,1,[Defines if your system have the sys/statvfs.h header file])] , )
1501 dnl# --------------------------------------------------------------------------
1502 dnl# CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
1503 dnl# --------------------------------------------------------------------------
1511 AC_CHECK_TYPE(ino_t, unsigned long)
1512 AC_CHECK_TYPE(dev_t, unsigned long)
1513 AC_CHECK_TYPE(daddr_t, long)
1514 AC_CHECK_TYPE(major_t, int)
1515 AC_CHECK_TYPE(minor_t, int)
1516 AC_CHECK_TYPE(ssize_t, int)
1523 AC_CHECK_SIZEOF(char, 1)
1524 AC_CHECK_SIZEOF(short int, 2)
1525 AC_CHECK_SIZEOF(int, 4)
1526 AC_CHECK_SIZEOF(long int, 4)
1527 AC_CHECK_SIZEOF(long long int, 8)
1528 AC_CHECK_SIZEOF(int *, 4)
1530 # Check for sys/types.h types
1531 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1533 [ #include <sys/types.h> ],
1535 [ ac_cv_have_u_int="yes" ],
1536 [ ac_cv_have_u_int="no" ]
1539 if test "x$ac_cv_have_u_int" = "xyes" ; then
1540 AC_DEFINE(HAVE_U_INT)
1544 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t, [
1546 [ #include <sys/types.h> ],
1547 [ intmax_t a; a = 1;],
1548 [ ac_cv_have_intmax_t="yes" ],
1551 [ #include <stdint.h> ],
1552 [ intmax_t a; a = 1;],
1553 [ ac_cv_have_intmax_t="yes" ],
1554 [ ac_cv_have_intmax_t="no" ]
1560 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
1561 AC_DEFINE(HAVE_INTMAX_T)
1566 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t, [
1568 [ #include <sys/types.h> ],
1569 [ u_intmax_t a; a = 1;],
1570 [ ac_cv_have_u_intmax_t="yes" ],
1573 [ #include <stdint.h> ],
1574 [ u_intmax_t a; a = 1;],
1575 [ ac_cv_have_u_intmax_t="yes" ],
1576 [ ac_cv_have_u_intmax_t="no" ]
1581 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
1582 AC_DEFINE(HAVE_U_INTMAX_T)
1587 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1589 [ #include <sys/types.h> ],
1590 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1591 [ ac_cv_have_intxx_t="yes" ],
1592 [ ac_cv_have_intxx_t="no" ]
1595 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1596 AC_DEFINE(HAVE_INTXX_T)
1600 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1602 [ #include <sys/types.h> ],
1603 [ int64_t a; a = 1;],
1604 [ ac_cv_have_int64_t="yes" ],
1605 [ ac_cv_have_int64_t="no" ]
1608 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1609 AC_DEFINE(HAVE_INT64_T)
1613 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1615 [ #include <sys/types.h> ],
1616 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1617 [ ac_cv_have_u_intxx_t="yes" ],
1618 [ ac_cv_have_u_intxx_t="no" ]
1621 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1622 AC_DEFINE(HAVE_U_INTXX_T)
1626 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1628 [ #include <sys/types.h> ],
1629 [ u_int64_t a; a = 1;],
1630 [ ac_cv_have_u_int64_t="yes" ],
1631 [ ac_cv_have_u_int64_t="no" ]
1634 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1635 AC_DEFINE(HAVE_U_INT64_T)
1639 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1640 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1642 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1644 [ #include <sys/bitypes.h> ],
1645 [ int8_t a; int16_t b; int32_t c;
1646 u_int8_t e; u_int16_t f; u_int32_t g;
1647 a = b = c = e = f = g = 1; ],
1648 [ AC_DEFINE(HAVE_U_INTXX_T)
1649 AC_DEFINE(HAVE_INTXX_T)
1650 AC_DEFINE(HAVE_SYS_BITYPES_H)
1651 AC_MSG_RESULT(yes) ],
1652 [ AC_MSG_RESULT(no)]
1656 if test -z "$have_u_intxx_t" ; then
1657 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1659 [ #include <sys/types.h> ],
1660 [ uint8_t a; uint16_t b;
1661 uint32_t c; a = b = c = 1; ],
1662 [ ac_cv_have_uintxx_t="yes" ],
1663 [ ac_cv_have_uintxx_t="no" ]
1666 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1667 AC_DEFINE(HAVE_UINTXX_T)
1671 if (test -z "$have_u_int64_t" || test -z "$have_int64_t" && \
1672 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1674 AC_MSG_CHECKING([for int64_t and u_int64_t types in sys/bitypes.h])
1676 [ #include <sys/bitypes.h> ],
1677 [ int64_t a; u_int64_t b;
1679 [ AC_DEFINE(HAVE_U_INT64_T)
1680 AC_DEFINE(HAVE_INT64_T)
1681 AC_MSG_RESULT(yes) ],
1682 [ AC_MSG_RESULT(no)]
1686 if (test -z "$have_uintxx_t" && \
1687 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1689 AC_MSG_CHECKING([for uintXX_t types in sys/bitypes.h])
1691 [ #include <sys/bitypes.h> ],
1692 [ uint8_t a; uint16_t b;
1693 uint32_t c; a = b = c = 1; ],
1694 [ AC_DEFINE(HAVE_UINTXX_T)
1695 AC_MSG_RESULT(yes) ],
1696 [ AC_MSG_RESULT(no)]
1704 dnl# --------------------------------------------------------------------------
1705 dnl# CHECKING FOR REQUIRED LIBRARY FUNCTIONS
1706 dnl# --------------------------------------------------------------------------
1722 [echo 'configure: cannot find needed function.'; exit 1]
1725 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
1726 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
1727 AC_CHECK_FUNCS(posix_fadvise)
1728 AC_CHECK_FUNCS(fdatasync)
1730 AC_CHECK_FUNCS(chflags)
1732 AC_CHECK_FUNCS(snprintf vsnprintf gethostid fseeko)
1734 AC_CACHE_CHECK(for va_copy, ba_cv_va_copy,
1737 void use_va_copy(va_list args){va_list args2; va_copy(args2,args); va_end(args2);}
1738 void call_use_va_copy(int junk,...){va_list args; va_start(args,junk); use_va_copy(args); va_end(args);}
1740 [call_use_va_copy(1,2,3)],
1741 ba_cv_va_copy=yes, ba_cv_va_copy=no)])
1742 test $ba_cv_va_copy = yes && AC_DEFINE(HAVE_VA_COPY, 1, [Set if va_copy exists])
1745 dnl# --------------------------------------------------------------------------
1746 dnl# CHECKING FOR THREAD SAFE FUNCTIONS
1747 dnl# --------------------------------------------------------------------------
1748 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
1750 # If resolver functions are not in libc check for -lnsl or -lresolv.
1751 AC_CHECK_FUNC(gethostbyname_r,
1752 AC_MSG_RESULT(using libc's resolver),
1753 AC_CHECK_LIB(nsl,gethostbyname_r)
1754 AC_CHECK_LIB(resolv,gethostbyname_r))
1758 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
1759 AC_CHECK_FUNCS(inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)])
1760 AC_CHECK_FUNCS(gethostbyname2, [AC_DEFINE(HAVE_GETHOSTBYNAME2)])
1762 dnl ----------------------------
1763 dnl check sa_len of sockaddr
1764 dnl ----------------------------
1765 AC_CACHE_CHECK(for struct sockaddr has a sa_len field, ac_cv_struct_sockaddr_sa_len,
1766 [AC_TRY_COMPILE([#include <sys/socket.h>], [struct sockaddr s; s.sa_len;],
1767 ac_cv_struct_sockaddr_sa_len=yes, ac_cv_struct_sockaddr_sa_len=no)])
1769 if test $ac_cv_struct_sockaddr_sa_len = yes; then
1770 AC_DEFINE(HAVE_SA_LEN, 1, [Define if sa_len field exists in struct sockaddr])
1780 AC_FUNC_CLOSEDIR_VOID
1781 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
1782 # AC_FUNC_FNMATCH dnl use local version
1785 AC_CHECK_LIB(intl, gettext, [LIBS="$LIBS -lintl"])
1788 AC_CHECK_LIB(sun, getpwnam)
1790 AC_CHECK_HEADERS(zlib.h)
1791 AC_CHECK_LIB(z, deflate, [FDLIBS="-lz"])
1793 if test x$FDLIBS = x-lz; then
1794 AC_DEFINE(HAVE_LIBZ)
1799 # Check for ACL libraries
1802 AC_CHECK_HEADER(sys/acl.h)
1803 AC_CHECK_FUNC(acl_get_file, [have_acl=yes],
1804 [AC_CHECK_LIB(acl, acl_get_file, [have_acl=yes; FDLIBS="-lacl $FDLIBS"],
1805 [AC_CHECK_LIB(sec, acltotext, [have_acl=yes; FDLIBS="-lsec $FDLIBS"])]
1808 if test $have_acl = yes; then
1812 dnl Check for pthread libraries
1814 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
1815 [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
1816 [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
1817 [AC_CHECK_FUNC(pthread_create)]
1828 if test x$have_gcc = xyes ; then
1829 CPPFLAGS="$CPPFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
1830 CFLAGS="$CFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
1832 LDFLAGS=${LDFLAGS--O}
1833 DB_LIBS="${SQL_LFLAGS}"
1834 CPPFLAGS="$CPPFLAGS"
1847 AC_SUBST(X_EXTRA_LIBS)
1852 dnl# extra configurable objects
1863 # Finally we set appropriate distribution specific
1864 # variables and defaults
1866 # PFILES are platform specific files
1867 PFILES="platforms/Makefile"
1871 hostname=`uname -n | cut -d '.' -f 1`
1872 if test x${hostname} = x ; then
1873 hostname="localhost"
1878 PSCMD="ps -e -o pid,comm"
1880 platforms/aix/Makefile"
1881 TAPEDRIVE="/dev/rmt0.1"
1885 PTHREAD_LIB="-lpthread -lexc"
1886 if test "${CC}" = "gcc" ; then
1893 TAPEDRIVE="/dev/nrmt0"
1896 DISTVER=`uname -a |awk '{print $3}'`
1897 TAPEDRIVE="/dev/nrmt0"
1898 PTHREAD_LIB="-pthread"
1899 CFLAGS="${CFLAGS} -pthread"
1900 PSCMD="ps -ax -o pid,command"
1904 platforms/bsdi/Makefile \
1905 platforms/bsdi/bacula-fd \
1906 platforms/bsdi/bacula-sd \
1907 platforms/bsdi/bacula-dir"
1908 largefile_support="yes"
1911 DISTVER=`uname -a |awk '{print $3}'`
1912 TAPEDRIVE="/dev/nrst0"
1915 WLDFLAGS="-mwindows"
1919 TAPEDRIVE="/dev/nst0"
1920 PSCMD="ps -e -o pid,command"
1923 platforms/darwin/Makefile"
1926 DISTVER=`cat /etc/debian_version`
1927 TAPEDRIVE="/dev/nrst0"
1928 PSCMD="ps -e -o pid,command"
1931 DISTVER=`uname -a |awk '{print $3}'`
1932 VER=`echo $DISTVER | cut -c 1`
1933 if test x$VER = x4 ; then
1934 PTHREAD_LIB="${PTHREAD_LIBS:--pthread}"
1935 CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS:--pthread}"
1939 TAPEDRIVE="/dev/nrsa0"
1940 PSCMD="ps -ax -o pid,command"
1942 platforms/freebsd/Makefile \
1943 platforms/freebsd/bacula-fd \
1944 platforms/freebsd/bacula-sd \
1945 platforms/freebsd/bacula-dir"
1946 largefile_support="yes"
1949 PSCMD="UNIX95=1; ps -e -o pid,comm"
1950 CFLAGS="${CFLAGS} -D_XOPEN_SOURCE_EXTENDED=1"
1952 TAPEDRIVE="/dev/rmt/0hnb"
1953 PTHREAD_LIB="-lpthread"
1954 AC_DEFINE([_INCLUDE_LONGLONG])
1958 TAPEDRIVE="/dev/rmt/0cbn"
1959 PSCMD="ps -e -o pid,comm"
1961 platforms/irix/Makefile \
1962 platforms/irix/bacula-fd \
1963 platforms/irix/bacula-sd \
1964 platforms/irix/bacula-dir"
1967 DISTVER=`uname -a |awk '{print $3}'`
1970 TAPEDRIVE="/dev/nrst0"
1971 PSCMD="ps -ax -o pid,command"
1972 PTHREAD_LIB="-pthread"
1973 CFLAGS="${CFLAGS} -pthread"
1976 DISTVER=`uname -a |awk '{print $3}'`
1979 TAPEDRIVE="/dev/nrst0"
1980 PSCMD="ps -ax -o pid,command"
1981 PTHREAD_LIB="-pthread"
1982 CFLAGS="${CFLAGS} -pthread"
1984 platforms/openbsd/Makefile \
1985 platforms/openbsd/bacula-fd \
1986 platforms/openbsd/bacula-sd \
1987 platforms/openbsd/bacula-dir"
1990 if test -f /etc/whitebox-release ; then
1991 f=/etc/whitebox-release
1993 f=/etc/redhat-release
1995 if test `cat $f | grep release |\
1996 cut -f 3 -d ' '`x = "Enterprise"x ; then
1997 DISTVER="Enterprise "`cat $f | grep release |\
2000 DISTVER=`cat /etc/redhat-release | grep release |\
2003 TAPEDRIVE="/dev/nst0"
2004 PSCMD="ps -e -o pid,command"
2006 platforms/redhat/Makefile \
2007 platforms/redhat/bacula-fd \
2008 platforms/redhat/bacula-sd \
2009 platforms/redhat/bacula-dir \
2010 platforms/redhat/bacula.spec \
2014 DISTVER=`cat /etc/mandrake-release | grep release |\
2016 TAPEDRIVE="/dev/nst0"
2017 PSCMD="ps -e -o pid,command"
2019 platforms/mandrake/Makefile \
2020 platforms/mandrake/bacula-fd \
2021 platforms/mandrake/bacula-sd \
2022 platforms/mandrake/bacula-dir \
2023 platforms/mandrake/bacula.spec \
2027 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
2028 TAPEDRIVE="/dev/nst0"
2029 PSCMD="ps -e -o pid,command"
2031 platforms/gentoo/Makefile \
2032 platforms/gentoo/bacula-init \
2033 platforms/gentoo/bacula-fd \
2034 platforms/gentoo/bacula-sd \
2035 platforms/gentoo/bacula-dir"
2038 DISTVER=`cat /etc/slackware-version`
2039 TAPEDRIVE="/dev/nst0"
2040 PSCMD="ps -e -o pid,command"
2042 platforms/slackware/Makefile \
2043 platforms/slackware/rc.bacula-fd \
2044 platforms/slackware/rc.bacula-sd \
2045 platforms/slackware/rc.bacula-dir\
2046 platforms/slackware/functions.bacula"
2050 TAPEDRIVE="/dev/rmt/0cbn"
2051 PSCMD="ps -e -o pid,comm"
2053 platforms/solaris/Makefile \
2054 platforms/solaris/bacula-fd \
2055 platforms/solaris/bacula-sd \
2056 platforms/solaris/bacula-dir"
2057 if test x$DISTVER = x5.6 ; then
2058 AC_DEFINE(HAVE_OLD_SOCKOPT)
2060 LIBS="$LIBS -lresolv"
2063 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
2065 TAPEDRIVE="/dev/nst0"
2066 PSCMD="ps -e -o pid,command"
2068 platforms/suse/Makefile \
2069 platforms/suse/bacula-fd \
2070 platforms/suse/bacula-sd \
2071 platforms/suse/bacula-dir \
2072 platforms/suse/bacula \
2073 platforms/suse/bacula.spec"
2078 TAPEDRIVE="/dev/nst0"
2079 PSCMD="ps -e -o pid,command"
2081 platforms/suse/Makefile \
2082 platforms/suse/bacula-fd \
2083 platforms/suse/bacula-sd \
2084 platforms/suse/bacula-dir"
2088 TAPEDRIVE="/dev/nst0"
2091 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
2097 LIBS="$PTHREAD_LIB $LIBS"
2099 AC_DEFINE_UNQUOTED(lld, "$lld")
2100 AC_DEFINE_UNQUOTED(llu, "$llu")
2108 dnl# common parts of the Makefile
2109 MCOMMON=./autoconf/Make.common
2110 AC_SUBST_FILE(MCOMMON)
2113 if test "x${subsysdir}" = "x${sbindir}" ; then
2116 echo "You have set both --sbindir and --with-subsys-dir"
2117 echo " equal to: ${subsysdir} "
2118 echo "This is not permitted. Please reconfigure."
2120 echo "Aborting configuration ..."
2126 AC_OUTPUT([autoconf/Make.common \
2129 scripts/startmysql \
2131 scripts/btraceback \
2137 scripts/bacula-ctl-dir \
2138 scripts/bacula-ctl-fd \
2139 scripts/bacula-ctl-sd \
2140 scripts/devel_bacula \
2143 scripts/bacula.desktop.gnome1 \
2144 scripts/bacula.desktop.gnome2 \
2145 scripts/bacula.desktop.gnome1.consolehelper \
2146 scripts/bacula.desktop.gnome2.consolehelper \
2147 scripts/bacula.desktop.gnome1.xsu \
2148 scripts/bacula.desktop.gnome2.xsu \
2149 scripts/bgnome-console.console_apps \
2150 scripts/mtx-changer \
2151 scripts/disk-changer \
2152 scripts/dvd-handler \
2153 scripts/dvd-simulator \
2154 scripts/bacula-tray-monitor.desktop \
2155 scripts/logwatch/Makefile \
2156 scripts/logwatch/logfile.bacula.conf \
2157 scripts/wxconsole.console_apps \
2158 scripts/wxconsole.desktop.consolehelper \
2159 scripts/wxconsole.desktop.xsu \
2160 scripts/bat.desktop \
2161 scripts/bat.desktop.xsu \
2162 scripts/bat.desktop.consolehelper \
2163 scripts/bat.console_apps \
2166 src/console/Makefile \
2167 src/console/bconsole.conf \
2168 src/gnome2-console/Makefile \
2169 src/gnome2-console/bgnome-console.conf \
2170 src/qt-console/bat.conf \
2171 src/qt-console/bat.pro \
2172 src/qt-console/install_conf_file \
2173 src/wx-console/Makefile \
2174 src/wx-console/bwx-console.conf \
2175 src/tray-monitor/Makefile \
2176 src/tray-monitor/tray-monitor.conf \
2178 src/dird/bacula-dir.conf \
2180 src/stored/Makefile \
2181 src/stored/bacula-sd.conf \
2182 src/filed/Makefile \
2183 src/filed/bacula-fd.conf \
2185 src/cats/make_catalog_backup \
2186 src/cats/delete_catalog_backup \
2187 src/cats/create_postgresql_database \
2188 src/cats/update_postgresql_tables \
2189 src/cats/make_postgresql_tables \
2190 src/cats/grant_postgresql_privileges \
2191 src/cats/drop_postgresql_tables \
2192 src/cats/drop_postgresql_database \
2193 src/cats/create_mysql_database \
2194 src/cats/update_mysql_tables \
2195 src/cats/make_mysql_tables \
2196 src/cats/grant_mysql_privileges \
2197 src/cats/drop_mysql_tables \
2198 src/cats/drop_mysql_database \
2199 src/cats/create_sqlite_database \
2200 src/cats/update_sqlite_tables \
2201 src/cats/make_sqlite_tables \
2202 src/cats/grant_sqlite_privileges \
2203 src/cats/drop_sqlite_tables \
2204 src/cats/drop_sqlite_database \
2205 src/cats/create_sqlite3_database \
2206 src/cats/update_sqlite3_tables \
2207 src/cats/make_sqlite3_tables \
2208 src/cats/grant_sqlite3_privileges \
2209 src/cats/drop_sqlite3_tables \
2210 src/cats/drop_sqlite3_database \
2213 src/cats/create_bdb_database \
2214 src/cats/update_bdb_tables \
2215 src/cats/make_bdb_tables \
2216 src/cats/grant_bdb_privileges \
2217 src/cats/drop_bdb_tables \
2218 src/cats/drop_bdb_database \
2219 src/cats/create_bacula_database \
2220 src/cats/update_bacula_tables \
2221 src/cats/grant_bacula_privileges \
2222 src/cats/make_bacula_tables \
2223 src/cats/drop_bacula_tables \
2224 src/cats/drop_bacula_database \
2225 src/findlib/Makefile \
2226 src/tools/Makefile \
2232 if test "${support_bat}" = "yes" ; then
2234 chmod 755 install_conf_file build-depkgs-qt-console
2235 echo "Creating bat Makefile"
2240 echo "Doing make of dependencies"
2241 ${MAKE:-make} depend
2244 chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
2245 chmod 755 dvd-handler dvd-simulator
2246 chmod 755 bconsole gconsole mtx-changer devel_bacula logrotate
2251 chmod 755 $c/create_bacula_database $c/update_bacula_tables $c/make_bacula_tables
2252 chmod 755 $c/grant_bacula_privileges $c/drop_bacula_tables $c/drop_bacula_database
2254 chmod 755 $c/create_bdb_database $c/update_bdb_tables $c/make_bdb_tables
2255 chmod 755 $c/grant_bdb_privileges $c/drop_bdb_tables $c/drop_bdb_database
2257 chmod 755 $c/create_mysql_database $c/update_mysql_tables $c/make_mysql_tables
2258 chmod 755 $c/grant_mysql_privileges $c/drop_mysql_tables $c/drop_mysql_database
2260 chmod 755 $c/create_sqlite_database $c/update_sqlite_tables $c/make_sqlite_tables
2261 chmod 755 $c/grant_sqlite_privileges $c/drop_sqlite_tables $c/drop_sqlite_database
2263 chmod 755 $c/create_sqlite3_database $c/update_sqlite3_tables $c/make_sqlite3_tables
2264 chmod 755 $c/grant_sqlite3_privileges $c/drop_sqlite3_tables $c/drop_sqlite3_database
2266 chmod 755 $c/create_postgresql_database $c/update_postgresql_tables $c/make_postgresql_tables
2267 chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables $c/drop_postgresql_database
2269 chmod 755 $c/make_catalog_backup $c/delete_catalog_backup
2273 chmod 755 src/win32/build-depkgs-mingw32
2277 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
2278 largefile_support="yes"
2282 # A whole lot of hand springs to get the compiler version.
2283 # This is because gcc changed the output in version 3.0
2285 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
2286 if test "x${CCVERSION}" = "x" ; then
2287 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
2289 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
2290 if test x"${CXXVERSION}" = x ; then
2291 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
2294 if test "x${subsysdir}" = "x${sbindir}" ; then
2297 echo "You have set --sbindir and --with-subsys-dir"
2298 echo " both equal to: ${subsysdir} "
2299 echo " This is not permitted. Please reconfigure."
2301 echo "Aborting configuration ..."
2307 if test "x${db_type}" = "xInternal" ; then
2310 echo "You have not specified either --enable-client-only or one of the"
2311 echo " supported databases: MySQL, PostgreSQL, SQLite3 or SQLite."
2312 echo " This is not permitted. Please reconfigure."
2314 echo "Aborting the configuration ..."
2321 Configuration on `date`:
2323 Host: $host -- ${DISTNAME} ${DISTVER}
2324 Bacula version: ${VERSION} (${DATE})
2325 Source code location: ${srcdir}
2326 Install binaries: ${sbindir}
2327 Install config files: ${sysconfdir}
2328 Scripts directory: ${scriptdir}
2329 Archive directory: ${archivedir}
2330 Working directory: ${working_dir}
2331 PID directory: ${piddir}
2332 Subsys directory: ${subsysdir}
2333 Man directory: ${mandir}
2334 Data directory: ${datadir}
2335 C Compiler: ${CC} ${CCVERSION}
2336 C++ Compiler: ${CXX} ${CXXVERSION}
2337 Compiler flags: ${WCFLAGS} ${CFLAGS}
2338 Linker flags: ${WLDFLAGS} ${LDFLAGS}
2340 Statically Linked Tools: ${support_static_tools}
2341 Statically Linked FD: ${support_static_fd}
2342 Statically Linked SD: ${support_static_sd}
2343 Statically Linked DIR: ${support_static_dir}
2344 Statically Linked CONS: ${support_static_cons}
2345 Database type: ${db_type}
2346 Database lib: ${DB_LIBS}
2347 Database name: ${db_name}
2348 Database user: ${db_user}
2350 Job Output Email: ${job_email}
2351 Traceback Email: ${dump_email}
2352 SMTP Host Address: ${smtp_host}
2354 Director Port: ${dir_port}
2355 File daemon Port: ${fd_port}
2356 Storage daemon Port: ${sd_port}
2358 Director User: ${dir_user}
2359 Director Group: ${dir_group}
2360 Storage Daemon User: ${sd_user}
2361 Storage DaemonGroup: ${sd_group}
2362 File Daemon User: ${fd_user}
2363 File Daemon Group: ${fd_group}
2365 SQL binaries Directory ${SQL_BINDIR}
2367 Large file support: $largefile_support
2368 Bacula conio support: ${got_conio} ${CONS_LIBS}
2369 readline support: ${got_readline} ${PRTREADLINE_SRC}
2370 TCP Wrappers support: ${TCPW_MSG} ${WRAPLIBS}
2371 TLS support: ${support_tls}
2372 Encryption support: ${support_crypto}
2373 ZLIB support: ${have_zlib}
2374 enable-smartalloc: ${support_smartalloc}
2375 bat support: ${support_bat} ${QWT_LDFLAGS}
2376 enable-gnome: ${support_gnome} ${gnome_version}
2377 enable-bwx-console: ${support_wx_console} ${wx_version}
2378 enable-tray-monitor: ${support_tray_monitor}
2379 client-only: ${build_client_only}
2380 build-dird: ${build_dird}
2381 build-stored: ${build_stored}
2382 ACL support: ${have_acl}
2383 Python support: ${support_python} ${PYTHON_LIBS}
2384 Batch insert enabled: ${support_batch_insert}