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, :)
26 VERSION=`sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
27 DATE=`sed -n -e 's/^.*[ \t]*BDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
28 LSMDATE=`sed -n -e 's/^.*LSMDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
32 echo "configuring for bacula $VERSION ($DATE)"
35 dnl -------------------------------------------------------
36 dnl# Check for compiler.
37 dnl ------------------------------------------------------
41 AC_PROG_CC_C_O dnl Determine if C compiler support -c -o.
42 AC_PROG_GCC_TRADITIONAL dnl Determine if ioctl() need -traditional.
46 if test "x$BASECC" = xgcc; then
50 AC_PATH_PROG(CXX, $CXX, $CXX)
51 if test ! -e $CXX; then
52 AC_MSG_ERROR(Unable to find C++ compiler)
55 dnl -------------------------------------------------------
56 dnl# Check for programs.
57 dnl ------------------------------------------------------
60 AC_PATH_PROG(MV, mv, mv)
61 AC_PATH_PROG(RM, rm, rm)
62 AC_PATH_PROG(CP, cp, cp)
63 AC_PATH_PROG(SED, sed, sed)
64 AC_PATH_PROG(ECHO, echo, echo)
65 AC_PATH_PROG(CMP, cmp, cmp)
66 AC_PATH_PROG(TBL, tbl, tbl)
67 AC_PATH_PROG(AR, ar, ar)
68 dnl AC_PATH_PROG(RANLIB, ranlib, ranlib)
69 AC_PATH_PROG(OPENSSL, openssl, none)
70 AC_PATH_PROG(MTX, mtx, mtx)
71 AC_PATH_PROG(DD, dd, dd)
72 AC_PATH_PROG(MKISOFS, mkisofs, mkisofs)
73 AC_PATH_PROG(PYTHON, python, python)
74 AC_PATH_PROG(GROWISOFS, growisofs, growisofs)
75 AC_PATH_PROG(DVDRWMEDIAINFO, dvd+rw-mediainfo, dvd+rw-mediainfo)
76 AC_PATH_PROG(DVDRWFORMAT, dvd+rw-format, dvd+rw-format)
77 AC_PATH_PROG(PKGCONFIG, pkg-config, pkg-config)
78 AC_ARG_VAR(WXCONFIG, [wx-config command. On some systems, you must set it to wx-config-2.6 to use wxWidgets 2.6.])
79 if test "x$WXCONFIG" = x; then
82 AC_PATH_PROG(WXCONFIG, ${WXCONFIG}, ${WXCONFIG})
83 AC_ARG_VAR(WXFLAGS, [Parameters to pass to wx-config (e.g. --unicode=no).])
84 AC_PATH_PROG(CDRECORD, cdrecord, cdrecord)
85 AC_PATH_PROG(PIDOF, pidof, pidof)
87 # Some AWK programs fail, so test it and warn the user
88 if echo xfoo | $AWK 'BEGIN { prog=ARGV[1]; ARGC=1 }
89 { if ((prog == $2) || (("(" prog ")") == $2) ||
90 (("[" prog "]") == $2) ||
91 ((prog ":") == $2)) { print $1 ; exit 0 } }' xfoo>/dev/null; then :;
93 AC_MSG_ERROR([!!!!!!!!! WARNING !!!!!!!!!!!!!!
94 The regex engine of $AWK is too broken to be used you
95 might want to install GNU AWK.
96 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!])
99 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 --mandir, we default to /usr/share/man
168 # -------------------------------------------------------------------------
169 if test x$mandir = x'${prefix}/man' ; then
170 mandir=/usr/share/man
174 # ------------------------------------------------------------------
175 # All list of languages for which a translation exist. Each
176 # language is separated by a space.
177 # ------------------------------------------------------------------
180 AC_PATH_PROGS(MSGFMT, msgfmt, no)
181 if test "$MSGFMT" = "no"
183 echo 'msgfmt program not found, disabling NLS !'
185 USE_INCLUDED_LIBINTL=no
194 support_postgresql=no
195 support_smartalloc=yes
200 support_wx_console=no
205 support_static_tools=no
208 support_static_dir=no
209 support_static_cons=no
218 dnl# --------------------------------------------------------------------------
219 dnl# CHECKING COMMAND LINE OPTIONS
220 dnl# --------------------------------------------------------------------------
222 # -------------------------------------------
223 # gnome (default off)
224 # -------------------------------------------
226 [ --enable-gnome enable build of bgnome-console GUI [disabled]],
227 [if test x$enableval = xyes; then
232 if test x$support_gnome = xyes; then
233 abc=`$PKGCONFIG --exists libgnomeui-2.0`
235 if test $pkg = 0; then
236 GNOME_INCLUDEDIR=`$PKGCONFIG --cflags-only-I libgnomeui-2.0`
237 GNOMEUI_LIBS=`$PKGCONFIG --libs-only-l libgnomeui-2.0`
238 GNOME_LIBDIR=`$PKGCONFIG --libs libgnomeui-2.0`
239 GNOME_LIBS=`$PKGCONFIG --libs-only-l libgnomeui-2.0`
240 AC_SUBST(GNOME_INCLUDEDIR)
241 AC_SUBST(GNOMEUI_LIBS)
242 AC_SUBST(GNOME_LIBDIR)
244 GNOME_DIR=src/gnome2-console
245 gnome_version="Version 2.x"
247 AC_MSG_ERROR(Unable to find Gnome 2 installation)
252 # -------------------------------------------
254 # -------------------------------------------
256 [ --enable-bat enable build of bat Qt4 GUI [disabled]],
257 [if test x$enableval = xyes; then
258 AC_DEFINE(HAVE_BAT, 1, [Set if Bacula bat Qt4 GUI support enabled])
263 if test x$support_bat = xyes; then
264 abc=`$PKGCONFIG --atleast-version=4.2 QtGui`
266 if test $pkg = 0; then
267 BAT_DIR=src/qt-console
269 AC_MSG_ERROR(Unable to find Qt4 installation needed by bat)
274 # If bat is enabled, we need the qwt library
278 if test x$support_bat = xyes; then
279 AC_MSG_CHECKING(for qwt support)
281 [ --with-qwt@<:@=DIR@:>@ specify qwt library directory],
287 if test -f ${with_qwt}/include/qwt.h; then
288 QWT_INC="${with_qwt}/include"
289 QWT_LDFLAGS="-L${with_qwt}/lib"
296 # Search in standard places, or --with-qwt not specified
298 if test x$QWT_INC = x; then
299 for root in /usr /usr/local; do
300 for ver in qwt qwt5; do
301 if test -f ${root}/include/${ver}/qwt.h; then
302 QWT_INC="${root}/include/${ver}"
303 if test -d ${root}/lib64/; then
304 QWT_LDFLAGS="-L${root}/lib64"
306 QWT_LDFLAGS="-L${root}/lib"
314 if test x$QWT_INC = x; then
316 AC_MSG_ERROR(Unable to find qwt package needed by bat)
326 AC_SUBST(QWT_LDFLAGS)
329 # -------------------------------------------
330 # bwx-console (default off)
331 # -------------------------------------------
332 AC_ARG_ENABLE(bwx-console,
333 [ --enable-bwx-console enable build of wxWidgets console [disabled]],
334 [if test x$enableval = xyes; then
335 support_wx_console=yes
339 if test x$support_wx_console = xyes; then
340 abc=`$WXCONFIG $WXFLAGS --cppflags`
342 if test $pkg = 0; then
343 wx_version="wxWidgets `$WXCONFIG $WXFLAGS --release`"
344 WXCONS_CPPFLAGS=`$WXCONFIG $WXFLAGS --cppflags`
345 WXCONS_LDFLAGS=`$WXCONFIG $WXFLAGS --libs`
347 AC_SUBST(WXCONS_CPPFLAGS)
348 AC_SUBST(WXCONS_LDFLAGS)
349 WX_DIR=src/wx-console
352 echo "wx-config program not found. bwx-console disabled."
354 support_wx_console=no
360 # -------------------------------------------
361 # tray-monitor (default off)
362 # -------------------------------------------
363 AC_ARG_ENABLE(tray-monitor,
364 [ --enable-tray-monitor enable build of Gnome tray monitor (compatible with KDE) [disabled]],
365 [if test x$enableval = xyes; then
366 support_tray_monitor=yes
370 if test x$support_tray_monitor = xyes; then
371 abc=`$PKGCONFIG --exists gtk+-2.0`
373 if test $pkg = 0; then
374 TRAY_MONITOR_CPPFLAGS=`$PKGCONFIG --cflags gtk+-2.0`
375 TRAY_MONITOR_LDFLAGS=`$PKGCONFIG --libs gtk+-2.0`
376 AC_SUBST(TRAY_MONITOR_CPPFLAGS)
377 AC_SUBST(TRAY_MONITOR_LDFLAGS)
378 TRAY_MONITOR_DIR=src/tray-monitor
379 abc=`$PKGCONFIG --atleast-version=2.4 gtk+-2.0`
381 if test $pkg = 0; then
382 AC_DEFINE(HAVE_GTK_2_4)
386 AC_SUBST(TRAY_MONITOR_DIR)
388 # -------------------------------------------
389 # smartalloc (default off)
390 # -------------------------------------------
391 AC_ARG_ENABLE(smartalloc,
392 [ --enable-smartalloc enable smartalloc debugging support [disabled]],
393 [if test x$enableval = xno; then
394 support_smartalloc=no
397 if test x$support_smartalloc = xyes; then
398 AC_DEFINE(SMARTALLOC)
401 # -------------------------------------------
402 # static-tools (default off)
403 # -------------------------------------------
404 AC_ARG_ENABLE(static-tools,
405 [ --enable-static-tools enable static tape tools [disabled]],
406 [if test x$enableval = xyes; then
407 support_static_tools=yes
411 if test x$support_static_tools = xyes; then
412 TTOOL_LDFLAGS="-static"
414 AC_SUBST(TTOOL_LDFLAGS)
416 # -------------------------------------------
417 # static-fd (default off)
418 # -------------------------------------------
419 AC_ARG_ENABLE(static-fd,
420 [ --enable-static-fd enable static File daemon [disabled]],
421 [if test x$enableval = xyes; then
422 support_static_fd=yes
426 if test x$support_static_fd = xyes; then
427 STATIC_FD="static-bacula-fd"
431 # -------------------------------------------
432 # static-sd (default off)
433 # -------------------------------------------
434 AC_ARG_ENABLE(static-sd,
435 [ --enable-static-sd enable static Storage daemon [disabled]],
436 [if test x$enableval = xyes; then
437 support_static_sd=yes
441 if test x$support_static_sd = xyes; then
442 STATIC_SD="static-bacula-sd"
446 # -------------------------------------------
447 # static-dir (default off)
448 # -------------------------------------------
449 AC_ARG_ENABLE(static-dir,
450 [ --enable-static-dir enable static Director [disabled]],
451 [if test x$enableval = xyes; then
452 support_static_dir=yes
456 if test x$support_static_dir = xyes; then
457 STATIC_DIR="static-bacula-dir"
461 # -------------------------------------------
462 # static-cons (default off)
463 # -------------------------------------------
464 AC_ARG_ENABLE(static-cons,
465 [ --enable-static-cons enable static Console [disabled]],
466 [if test x$enableval = xyes; then
467 support_static_cons=yes
473 if test x$support_static_cons = xyes; then
474 STATIC_CONS="static-bconsole"
475 STATIC_GNOME_CONS="static-bgnome-console"
476 STATIC_WX_CONS="static-bwx-console"
478 AC_SUBST(STATIC_CONS)
479 AC_SUBST(STATIC_GNOME_CONS)
480 AC_SUBST(STATIC_WX_CONS)
482 # -------------------------------------------
483 # client_only (default off)
484 # -------------------------------------------
485 AC_ARG_ENABLE(client-only,
486 [ --enable-client-only build client (File daemon) only [disabled]],
487 [if test x$enableval = xyes; then
488 build_client_only=yes
492 if test x$build_client_only = xno; then
499 # -------------------------------------------
500 # director (default on)
501 # -------------------------------------------
502 AC_ARG_ENABLE(build-dird,
503 [ --enable-build-dird enable building of dird (Director) [enabled]],
504 [if test x$enableval = xno; then
507 if test x$build_dird = xyes; then
512 DIR_TOOLS="NODIRTOOLS"
517 # -------------------------------------------
518 # stored (default on)
519 # -------------------------------------------
520 AC_ARG_ENABLE(build-stored,
521 [ --enable-build-stored enable building of stored (Storage daemon) [enabled]],
522 [if test x$enableval = xno; then
525 if test x$build_stored = xyes; then
526 STORED_DIR="src/stored"
532 # ---------------------------------------------------
533 # Check for conio (Bacula readline substitute)(
534 # ---------------------------------------------------
535 # this allows you to turn it completely off
537 [ --disable-conio disable conio support [enabled]
539 [if test x$enableval = xno; then
545 # ---------------------------------------------------
546 # Check for IPv6 support
547 # ---------------------------------------------------
548 # this allows you to turn it completely off
551 [ --enable-ipv6 enable ipv6 support [enabled]
553 [if test x$enableval = xno; then
558 if test x$support_ipv6 = xyes; then
559 AC_TRY_LINK([ #include <sys/types.h>
560 #include <sys/socket.h>
561 #include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;],
562 [support_ipv6=yes], [support_ipv6=no])
565 if test x$support_ipv6 = xyes; then
566 AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
572 if test x$support_conio = xyes; then
573 AC_CHECK_HEADER(termcap.h,
574 [ AC_CHECK_LIB(termcap, tgetent,
575 [ CONS_LIBS="-ltermcap"
580 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
582 [ AC_CHECK_LIB(ncurses, tgetent,
583 [ CONS_LIBS="-lncurses"
588 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
593 AC_CHECK_HEADERS(curses.h)
594 AC_CHECK_HEADER(term.h,
595 [ AC_CHECK_LIB(curses, tgetent,
596 [ CONS_LIBS="-lcurses"
601 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
604 [ echo " "; echo "Required libraries not found. CONIO turned off ..."; echo " "],
613 # ---------------------------------------------------
614 # Check for readline support/directory (default off)
615 # ---------------------------------------------------
616 # this allows you to turn it completely off
617 AC_ARG_ENABLE(readline,
618 [ --disable-readline disable readline support [disable]
620 [if test x$enableval = xno; then
626 if test x$support_readline = xyes; then
627 AC_ARG_WITH(readline,
628 [ --with-readline@<:@=DIR@:>@ specify readline library directory],
630 case "$with_readline" in
633 if test -f ${with_readline}/readline.h; then
634 CONS_INC="-I${with_readline}"
635 CONS_LDFLAGS="-L$with_readline"
636 elif test -f ${with_readline}/include/readline/readline.h; then
637 CONS_INC="-I${with_readline}/include/readline"
638 CONS_LDFLAGS="-L${with_readline}/lib"
639 with_readline="${with_readline}/include/readline"
641 with_readline="/usr/include/readline"
643 AC_CHECK_HEADER(${with_readline}/readline.h,
644 [ AC_DEFINE(HAVE_READLINE)
645 CONS_LIBS="-lreadline -lhistory -ltermcap"
649 echo "readline.h not found. readline turned off ..."
656 # check for standard readline library
657 AC_CHECK_HEADER(/usr/include/readline/readline.h,
658 [ AC_DEFINE(HAVE_READLINE)
660 CONS_INC="-I/usr/include/readline"
661 CONS_LIBS="-lreadline -ltermcap"
663 # Did not find standard library, so try Bacula's default
664 AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h,
665 [ AC_DEFINE(HAVE_READLINE)
667 CONS_INC="-I${TOP_DIR}/depkgs/readline"
668 CONS_LIBS="-lreadline -lhistory -ltermcap"
669 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
670 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
673 echo "readline.h not found. readline turned off ..."
689 AC_SUBST(CONS_LDFLAGS)
690 AC_SUBST(READLINE_SRC)
692 # Minimal stuff for readline Makefile configuration
697 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr lstat lchown)
698 AC_CHECK_FUNCS(nanosleep nl_langinfo)
699 AC_CHECK_HEADERS(varargs.h)
701 # End of readline/conio stuff
702 # -----------------------------------------------------------------------
704 # -----------------------------------------------------------------------
705 # Check for Python support
707 AC_MSG_CHECKING(for Python support)
710 --with-python@<:@=DIR@:>@ Include Python support. DIR is the Python base
711 install directory, default is to search through
712 a number of common places for the Python files.],
716 if test "$withval" != "no"; then
717 if test "$withval" = "yes"; then
718 for python_root in /usr /usr/local /usr/sfw; do
719 for ver in python2.2 python2.3 python2.4 python2.5; do
720 if test -f $python_root/include/${ver}/Python.h; then
721 PYTHON_INCDIR=-I$python_root/include/${ver}
722 if test -d $python_root/lib64/${ver}/config; then
723 PYTHON_LIBS="-L$python_root/lib64/${ver}/config -l${ver}"
725 PYTHON_LIBS="-L$python_root/lib/${ver}/config -l${ver}"
731 if test x$PYTHON_INCDIR = x; then
732 if test -f $prefix/include/Python.h; then
733 PYTHON_INCDIR=-I$prefix/include
734 if test -d $prefix/lib64/config; then
735 PYTHON_LIBS="-L$prefix/lib64/config -lpython"
737 PYTHON_LIBS="-L$prefix/lib/config -lpython"
741 AC_MSG_ERROR(Unable to find Python.h in standard locations)
745 if test -f $withval/Python.h; then
746 PYTHON_INCDIR=-I$withval
747 PYTHON_LIBS="-L$withval/config -lpython"
748 elif test -f $withval/include/Python.h; then
749 PYTHON_INCDIR=-I$withval/include
750 if test -d $withval/lib64/config; then
751 PYTHON_LIBS="-L$withval/lib64/config -lpython"
753 PYTHON_LIBS="-L$withval/lib/config -lpython"
755 elif test -f $withval/include/python/Python.h; then
756 PYTHON_INCDIR=-I$withval/include/python
757 if test -d $withval/lib64/python/config; then
758 PYTHON_LIBS="-L$withval/lib64/python/config -lpython"
760 PYTHON_LIBS="-L$withval/lib/python/config -lpython"
764 AC_MSG_ERROR(Invalid Python directory $withval - unable to find Python.h under $withval)
767 AC_DEFINE([HAVE_PYTHON], 1)
770 AC_MSG_NOTICE(checking for more Python libs)
771 saved_LIBS="$LIBS"; LIBS=
772 AC_SEARCH_LIBS(shm_open, [rt])
773 AC_CHECK_LIB(util, openpty)
774 PYTHON_LIBS="$PYTHON_LIBS $LIBS"
782 AC_SUBST(PYTHON_LIBS)
783 AC_SUBST(PYTHON_INCDIR)
786 # Find where sockets are (especially for Solaris)
787 # Do this before the TCP Wrappers test since tcp wrappers
788 # uses the socket library and some linkers are stupid.
790 AC_CHECK_FUNC(socket,
791 AC_MSG_RESULT(using libc's socket),
792 AC_CHECK_LIB(xnet,socket)
793 AC_CHECK_LIB(socket,socket)
794 AC_CHECK_LIB(inet,socket))
797 # -----------------------------------------------------------
798 # Check whether user wants TCP wrappers support (default off)
799 # -----------------------------------------------------------
802 AC_ARG_WITH(tcp-wrappers,
803 [ --with-tcp-wrappers@<:@=DIR@:>@ enable tcpwrappers support],
805 if test "x$withval" != "xno" ; then
807 LIBS="$saved_LIBS -lwrap"
808 AC_MSG_CHECKING(for libwrap)
809 AC_SEARCH_LIBS(nanosleep, [rt])
811 [ #include <sys/types.h>
813 int deny_severity = 0;
814 int allow_severity = 0;
815 struct request_info *req; ],
816 [ hosts_access(req); ],
819 AC_DEFINE(HAVE_LIBWRAP)
824 LIBS="$saved_LIBS -lwrap -lnsl"
825 WRAPLIBS="$saved_LIBS -lwrap -lnsl"
827 [ #include <sys/types.h>
829 int deny_severity = 0;
830 int allow_severity = 0;
831 struct request_info *req; ],
832 [ hosts_access(req); ],
835 AC_DEFINE(HAVE_LIBWRAP)
840 [AC_MSG_ERROR([*** libwrap missing]) ] ]
847 # -----------------------------------------------------------
848 # Check whether OpenSSL is available
849 # -----------------------------------------------------------
850 AC_MSG_CHECKING([for OpenSSL])
851 dnl The following uses quadrigraphs:
855 AC_HELP_STRING([--with-openssl@<:@=DIR@:>@], [Include OpenSSL support. DIR is the OpenSSL base]),
856 [with_openssl_directory=${withval}])
858 if test "x$with_openssl_directory" != "x"; then
859 OPENSSL_LIBS="-lssl -lcrypto"
862 if test "x$with_openssl_directory" != "xyes" && test x"${with_openssl_directory}" != "x"; then
863 OPENSSL_LIBS="-L$with_openssl_directory/lib $OPENSSL_LIBS"
864 OPENSSL_INC="-I$with_openssl_directory/include $OPENSSL_INC"
868 saved_CFLAGS="${CFLAGS}"
869 LIBS="${saved_LIBS} ${OPENSSL_LIBS}"
870 CFLAGS="${saved_CFLAGS} ${OPENSSL_INC}"
872 AC_TRY_LINK([ #include <openssl/ssl.h> ],
873 [ CRYPTO_set_id_callback(NULL); ],
881 AC_TRY_LINK([ #include <openssl/evp.h> ],
883 [ ac_cv_openssl_sha2="yes" ],
884 [ ac_cv_openssl_sha2="no" ]
887 # Solaris disables greater than 128+ bit encryption in their OpenSSL
888 # implementation, presumably for export reasons. If 192bit AES
889 # is available, we assume that we're running with a 'non-export'
891 AC_TRY_LINK([ #include <openssl/evp.h> ],
892 [ EVP_aes_192_cbc(); ],
893 [ ac_cv_openssl_export="no" ],
894 [ ac_cv_openssl_export="yes" ]
898 CFLAGS="${saved_CFLAGS}"
900 if test "$support_tls" = "yes"; then
901 AC_DEFINE(HAVE_OPENSSL, 1, [Define if OpenSSL library is available])
902 AC_DEFINE(HAVE_TLS, 1, [Define if TLS support should be enabled])
903 AC_DEFINE(HAVE_CRYPTO, 1, [Define if encryption support should be enabled])
906 if test "$ac_cv_openssl_sha2" = "yes"; then
907 AC_DEFINE(HAVE_SHA2, 1, [Define if the SHA-2 family of digest algorithms is available])
910 if test "$ac_cv_openssl_export" = "yes"; then
911 AC_DEFINE(HAVE_OPENSSL_EXPORT_LIBRARY, 1, [Define if the OpenSSL library is export-contrained to 128bit ciphers])
920 AC_MSG_RESULT([$support_tls])
921 AC_SUBST(OPENSSL_LIBS)
922 AC_SUBST(OPENSSL_INC)
925 # -----------------------------------------------------------
926 # Python and OpenSSL are using dlopen
927 # -----------------------------------------------------------
929 if test "$support_python" = "yes" -o "$support_tls" = "yes"; then
930 AC_SEARCH_LIBS(dlopen, [dl])
933 # ------------------------------------------
934 # Where to place working dir
935 # ------------------------------------------
936 working_dir=`eval echo ${prefix}/var/bacula/working`
937 AC_ARG_WITH(working-dir,
938 [ --with-working-dir=PATH specify path of Bacula working directory],
940 if test "x$withval" != "xno" ; then
946 AC_SUBST(working_dir)
949 # ------------------------------------------
950 # Where to place scriptdir (script files)
951 # ------------------------------------------
952 scriptdir=`eval echo ${sysconfdir}`
953 AC_ARG_WITH(scriptdir,
954 [ --with-scriptdir=PATH specify path of Bacula scripts directory],
956 if test "x$withval" != "xno" ; then
965 # ------------------------------------------
966 # Where to send dump email
967 # ------------------------------------------
968 dump_email=root@localhost
969 AC_ARG_WITH(dump-email,
970 [ --with-dump-email=EMAIL dump email address],
972 if test "x$withval" != "xno" ; then
980 # ------------------------------------------
981 # Where to send job email
982 # ------------------------------------------
983 job_email=root@localhost
984 AC_ARG_WITH(job-email,
985 [ --with-job-email=EMAIL job output email address],
987 if test "x$withval" != "xno" ; then
995 # ------------------------------------------
996 # Where to find smtp host
997 # ------------------------------------------
999 AC_ARG_WITH(smtp_host,
1000 [ --with-smtp-host=HOST SMTP mail host address],
1002 if test "x$withval" != "xno" ; then
1011 # ------------------------------------
1012 # Where to place pid files
1013 # ------------------------------------
1015 AC_ARG_WITH(pid-dir,
1016 [ --with-pid-dir=PATH specify location of Bacula pid files],
1018 if test "x$withval" != "xno" ; then
1024 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
1028 # ------------------------------------
1029 # Where to place subsys "lock file"
1030 # ------------------------------------
1031 subsysdir=/var/run/subsys
1032 if test -d /var/run/subsys; then
1033 subsysdir=/var/run/subsys
1034 elif test -d /var/lock/subsys; then
1035 subsysdir=/var/lock/subsys
1037 subsysdir=/var/run/subsys
1039 AC_ARG_WITH(subsys-dir,
1040 [ --with-subsys-dir=PATH specify location of Bacula subsys file],
1042 if test "x$withval" != "xno" ; then
1052 # ------------------------------------
1053 # Where to start assigning ports
1054 # ------------------------------------
1056 AC_ARG_WITH(baseport,
1057 [ --with-baseport=PORT specify base port address for daemons],
1059 if test "x$withval" != "xno" ; then
1066 dir_port=`expr $baseport`
1067 fd_port=`expr $baseport + 1`
1068 sd_port=`expr $fd_port + 1`
1075 # ------------------------------------------
1076 # Generate passwords
1077 # ------------------------------------------
1079 AC_ARG_WITH(dir-password,
1080 [ --with-dir-password=PASSWORD specify Director's password],
1082 if test "x$withval" != "xno" ; then
1083 dir_password=$withval
1088 if test "x$dir_password" = "x" ; then
1089 if test "x$OPENSSL" = "xnone" ; then
1090 key=`autoconf/randpass 33`
1092 key=`openssl rand -base64 33`
1098 AC_ARG_WITH(fd-password,
1099 [ --with-fd-password=PASSWORD specify Client's password],
1101 if test "x$withval" != "xno" ; then
1102 fd_password=$withval
1107 if test "x$fd_password" = "x" ; then
1108 if test "x$OPENSSL" = "xnone" ; then
1109 key=`autoconf/randpass 37`
1111 key=`openssl rand -base64 33`
1117 AC_ARG_WITH(sd-password,
1118 [ --with-sd-password=PASSWORD specify Storage daemon's password],
1120 if test "x$withval" != "xno" ; then
1121 sd_password=$withval
1126 if test "x$sd_password" = "x" ; then
1127 if test "x$OPENSSL" = "xnone" ; then
1128 key=`autoconf/randpass 41`
1130 key=`openssl rand -base64 33`
1136 AC_ARG_WITH(mon-dir-password,
1137 [ --with-mon-dir-password=PASSWORD specify Director's password used by the monitor],
1139 if test "x$withval" != "xno" ; then
1140 mon_dir_password=$withval
1145 if test "x$mon_dir_password" = "x" ; then
1146 if test "x$OPENSSL" = "xnone" ; then
1147 key=`autoconf/randpass 33`
1149 key=`openssl rand -base64 33`
1151 mon_dir_password=$key
1155 AC_ARG_WITH(mon-fd-password,
1156 [ --with-mon-fd-password=PASSWORD specify Client's password used by the monitor],
1158 if test "x$withval" != "xno" ; then
1159 mon_fd_password=$withval
1164 if test "x$mon_fd_password" = "x" ; then
1165 if test "x$OPENSSL" = "xnone" ; then
1166 key=`autoconf/randpass 37`
1168 key=`openssl rand -base64 33`
1170 mon_fd_password=$key
1174 AC_ARG_WITH(mon-sd-password,
1175 [ --with-mon-sd-password=PASSWORD specify Storage daemon's password used by the monitor],
1177 if test "x$withval" != "xno" ; then
1178 mon_sd_password=$withval
1183 if test "x$mon_sd_password" = "x" ; then
1184 if test "x$OPENSSL" = "xnone" ; then
1185 key=`autoconf/randpass 41`
1187 key=`openssl rand -base64 33`
1189 mon_sd_password=$key
1192 AC_SUBST(dir_password)
1193 AC_SUBST(fd_password)
1194 AC_SUBST(sd_password)
1195 AC_SUBST(mon_dir_password)
1196 AC_SUBST(mon_fd_password)
1197 AC_SUBST(mon_sd_password)
1200 # Pickup any database name
1203 AC_ARG_WITH(db_name,
1204 [ --with-db-name=DBNAME specify database name (default bacula)],
1206 if test "x$withval" != "x" ; then
1214 AC_ARG_WITH(db_user,
1215 [ --with-db-user=UNAME specify database user (default bacula)],
1217 if test "x$withval" != "x" ; then
1226 # Handle users and groups for each daemon
1229 AC_ARG_WITH(dir_user,
1230 [ --with-dir-user=USER specify user for Director daemon],
1232 if test "x$withval" != "x" ; then
1239 AC_ARG_WITH(dir_group,
1240 [ --with-dir-group=GROUP specify group for Director daemon],
1242 if test "x$withval" != "x" ; then
1249 AC_ARG_WITH(sd_user,
1250 [ --with-sd-user=USER specify user for Storage daemon],
1252 if test "x$withval" != "x" ; then
1259 AC_ARG_WITH(sd_group,
1260 [ --with-sd-group=GROUP specify group for Storage daemon],
1262 if test "x$withval" != "x" ; then
1269 AC_ARG_WITH(fd_user,
1270 [ --with-fd-user=USER specify user for File daemon],
1272 if test "x$withval" != "x" ; then
1279 AC_ARG_WITH(fd_group,
1280 [ --with-fd-group=GROUP specify group for File daemon],
1282 if test "x$withval" != "x" ; then
1296 # allow setting default executable permissions
1299 AC_ARG_WITH(sbin-perm,
1300 [ --with-sbin-perm=MODE specify permissions for sbin binaries (0754)],
1302 if test "x$withval" != "x" ; then
1310 # ------------------------------------------------
1311 # Bacula check for various SQL database engines
1312 # ------------------------------------------------
1314 BA_CHECK_POSTGRESQL_DB
1325 # -------------------------------------------
1326 # enable batch attribute DB insert (default on)
1327 # -------------------------------------------
1328 support_batch_insert=no
1329 A=`nm $SQL_LIB | grep pthread_mutex_lock`
1331 if test $pkg = 0; then
1332 support_batch_insert=yes
1333 AC_ARG_ENABLE(batch-insert,
1334 [ --enable-batch-insert enable the DB batch insert code [disabled]],
1335 [if test x$enableval = xno; then
1336 support_batch_insert=no
1338 support_batch_insert=yes
1342 if test $support_batch_insert = yes ; then
1343 AC_DEFINE(HAVE_BATCH_FILE_INSERT, 1, [Set if DB batch insert code enabled])
1347 AC_DEFINE(PROTOTYPES)
1349 dnl# --------------------------------------------------------------------------
1350 dnl# Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
1352 if test -z "$CFLAGS" -o "$CFLAGS" = "-g -O2"; then
1353 if test -z "$CCOPTS"; then
1354 CCOPTS='-g -O2 -Wall'
1363 dnl See if we can use 64 bit file addresses
1364 largefile_support="no"
1370 dnl# --------------------------------------------------------------------------
1371 dnl# CHECKING FOR HEADER FILES
1372 dnl# --------------------------------------------------------------------------
1408 AC_STRUCT_ST_BLKSIZE
1412 dnl# --------------------------------------------------------------------------
1413 dnl# Check for utime.h structure
1414 dnl# --------------------------------------------------------------------------
1415 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
1417 #include <sys/types.h>
1418 #include <utime.h>], [struct utimbuf foo],
1419 ba_cv_header_utime_h=yes, ba_cv_header_utime_h=no)])
1420 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H)
1422 dnl# --------------------------------------------------------------------------
1423 dnl# Check for socklen_t
1424 dnl# --------------------------------------------------------------------------
1425 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
1427 #include <sys/types.h>
1428 #include <sys/socket.h>],
1430 ba_cv_header_socklen_t=yes, ba_cv_header_socklen_t=no)])
1431 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T)
1433 dnl# --------------------------------------------------------------------------
1434 dnl# Check for bigendian
1435 dnl# --------------------------------------------------------------------------
1436 AC_CACHE_CHECK([for bigendian], ba_cv_bigendian,
1438 [main(){long a=1L; char *p=(char *)&a; exit(*p);}],
1439 [ba_cv_bigendian=yes],
1440 [ba_cv_bigendian=no],
1441 [ba_cv_bigendian=no])])
1442 test $ba_cv_bigendian = yes && AC_DEFINE(HAVE_BIGENDIAN)
1444 dnl# --------------------------------------------------------------------------
1445 dnl# Check for typeof()
1446 dnl# --------------------------------------------------------------------------
1448 AC_CACHE_CHECK(for typeof, ba_cv_have_typeof,
1450 [main(){char *a = 0; a = (typeof a)a;}],
1451 [ba_cv_have_typeof=yes],
1452 [ba_cv_have_typeof=no],
1453 [ba_cv_have_typeof=no])])
1454 test $ba_cv_have_typeof = yes && AC_DEFINE([HAVE_TYPEOF], 1, [Defind to 1 if compiler has typeof])
1460 dnl# --------------------------------------------------------------------------
1461 dnl# CHECKING FOR FILESYSTEM TYPE
1462 dnl# --------------------------------------------------------------------------
1463 AC_MSG_CHECKING(how to get filesystem type)
1465 # The order of these tests is important.
1466 AC_TRY_CPP([#include <sys/statvfs.h>
1467 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4)
1468 if test $fstype = no; then
1469 AC_TRY_CPP([#include <sys/statfs.h>
1470 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3)
1472 if test $fstype = no; then
1473 AC_TRY_CPP([#include <sys/statfs.h>
1474 #include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX)
1476 if test $fstype = no; then
1477 AC_TRY_CPP([#include <mntent.h>], AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD)
1479 if test $fstype = no; then
1480 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
1482 if test $fstype = no; then
1483 AC_TRY_CPP([#include <sys/mount.h>
1484 #include <sys/fs_types.h>], AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix)
1486 AC_MSG_RESULT($fstype)
1488 AC_CHECK_HEADER(sys/statvfs.h, [ AC_DEFINE(HAVE_SYS_STATVFS_H,1,[Defines if your system have the sys/statvfs.h header file])] , )
1490 dnl# --------------------------------------------------------------------------
1491 dnl# CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
1492 dnl# --------------------------------------------------------------------------
1500 AC_CHECK_TYPE(ino_t, unsigned long)
1501 AC_CHECK_TYPE(dev_t, unsigned long)
1502 AC_CHECK_TYPE(daddr_t, long)
1503 AC_CHECK_TYPE(major_t, int)
1504 AC_CHECK_TYPE(minor_t, int)
1505 AC_CHECK_TYPE(ssize_t, int)
1512 AC_CHECK_SIZEOF(char, 1)
1513 AC_CHECK_SIZEOF(short int, 2)
1514 AC_CHECK_SIZEOF(int, 4)
1515 AC_CHECK_SIZEOF(long int, 4)
1516 AC_CHECK_SIZEOF(long long int, 8)
1517 AC_CHECK_SIZEOF(int *, 4)
1519 # Check for sys/types.h types
1520 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1522 [ #include <sys/types.h> ],
1524 [ ac_cv_have_u_int="yes" ],
1525 [ ac_cv_have_u_int="no" ]
1528 if test "x$ac_cv_have_u_int" = "xyes" ; then
1529 AC_DEFINE(HAVE_U_INT)
1533 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t, [
1535 [ #include <sys/types.h> ],
1536 [ intmax_t a; a = 1;],
1537 [ ac_cv_have_intmax_t="yes" ],
1540 [ #include <stdint.h> ],
1541 [ intmax_t a; a = 1;],
1542 [ ac_cv_have_intmax_t="yes" ],
1543 [ ac_cv_have_intmax_t="no" ]
1549 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
1550 AC_DEFINE(HAVE_INTMAX_T)
1555 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t, [
1557 [ #include <sys/types.h> ],
1558 [ u_intmax_t a; a = 1;],
1559 [ ac_cv_have_u_intmax_t="yes" ],
1562 [ #include <stdint.h> ],
1563 [ u_intmax_t a; a = 1;],
1564 [ ac_cv_have_u_intmax_t="yes" ],
1565 [ ac_cv_have_u_intmax_t="no" ]
1570 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
1571 AC_DEFINE(HAVE_U_INTMAX_T)
1576 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1578 [ #include <sys/types.h> ],
1579 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1580 [ ac_cv_have_intxx_t="yes" ],
1581 [ ac_cv_have_intxx_t="no" ]
1584 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1585 AC_DEFINE(HAVE_INTXX_T)
1589 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1591 [ #include <sys/types.h> ],
1592 [ int64_t a; a = 1;],
1593 [ ac_cv_have_int64_t="yes" ],
1594 [ ac_cv_have_int64_t="no" ]
1597 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1598 AC_DEFINE(HAVE_INT64_T)
1602 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1604 [ #include <sys/types.h> ],
1605 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1606 [ ac_cv_have_u_intxx_t="yes" ],
1607 [ ac_cv_have_u_intxx_t="no" ]
1610 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1611 AC_DEFINE(HAVE_U_INTXX_T)
1615 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1617 [ #include <sys/types.h> ],
1618 [ u_int64_t a; a = 1;],
1619 [ ac_cv_have_u_int64_t="yes" ],
1620 [ ac_cv_have_u_int64_t="no" ]
1623 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1624 AC_DEFINE(HAVE_U_INT64_T)
1628 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1629 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1631 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1633 [ #include <sys/bitypes.h> ],
1634 [ int8_t a; int16_t b; int32_t c;
1635 u_int8_t e; u_int16_t f; u_int32_t g;
1636 a = b = c = e = f = g = 1; ],
1637 [ AC_DEFINE(HAVE_U_INTXX_T)
1638 AC_DEFINE(HAVE_INTXX_T)
1639 AC_DEFINE(HAVE_SYS_BITYPES_H)
1640 AC_MSG_RESULT(yes) ],
1641 [ AC_MSG_RESULT(no)]
1645 if test -z "$have_u_intxx_t" ; then
1646 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1648 [ #include <sys/types.h> ],
1649 [ uint8_t a; uint16_t b;
1650 uint32_t c; a = b = c = 1; ],
1651 [ ac_cv_have_uintxx_t="yes" ],
1652 [ ac_cv_have_uintxx_t="no" ]
1655 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1656 AC_DEFINE(HAVE_UINTXX_T)
1660 if (test -z "$have_u_int64_t" || test -z "$have_int64_t" && \
1661 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1663 AC_MSG_CHECKING([for int64_t and u_int64_t types in sys/bitypes.h])
1665 [ #include <sys/bitypes.h> ],
1666 [ int64_t a; u_int64_t b;
1668 [ AC_DEFINE(HAVE_U_INT64_T)
1669 AC_DEFINE(HAVE_INT64_T)
1670 AC_MSG_RESULT(yes) ],
1671 [ AC_MSG_RESULT(no)]
1675 if (test -z "$have_uintxx_t" && \
1676 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1678 AC_MSG_CHECKING([for uintXX_t types in sys/bitypes.h])
1680 [ #include <sys/bitypes.h> ],
1681 [ uint8_t a; uint16_t b;
1682 uint32_t c; a = b = c = 1; ],
1683 [ AC_DEFINE(HAVE_UINTXX_T)
1684 AC_MSG_RESULT(yes) ],
1685 [ AC_MSG_RESULT(no)]
1693 dnl# --------------------------------------------------------------------------
1694 dnl# CHECKING FOR REQUIRED LIBRARY FUNCTIONS
1695 dnl# --------------------------------------------------------------------------
1711 [echo 'configure: cannot find needed function.'; exit 1]
1714 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
1715 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
1716 AC_CHECK_FUNCS(posix_fadvise)
1717 AC_CHECK_FUNCS(fdatasync)
1719 AC_CHECK_FUNCS(chflags)
1721 AC_CHECK_FUNCS(snprintf vsnprintf gethostid fseeko)
1723 dnl# --------------------------------------------------------------------------
1724 dnl# CHECKING FOR THREAD SAFE FUNCTIONS
1725 dnl# --------------------------------------------------------------------------
1726 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
1728 # If resolver functions are not in libc check for -lnsl or -lresolv.
1729 AC_CHECK_FUNC(gethostbyname_r,
1730 AC_MSG_RESULT(using libc's resolver),
1731 AC_CHECK_LIB(nsl,gethostbyname_r)
1732 AC_CHECK_LIB(resolv,gethostbyname_r))
1736 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
1737 AC_CHECK_FUNCS(inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)])
1738 AC_CHECK_FUNCS(gethostbyname2, [AC_DEFINE(HAVE_GETHOSTBYNAME2)])
1740 dnl ----------------------------
1741 dnl check sa_len of sockaddr
1742 dnl ----------------------------
1743 AC_CACHE_CHECK(for struct sockaddr has a sa_len field, ac_cv_struct_sockaddr_sa_len,
1744 [AC_TRY_COMPILE([#include <sys/socket.h>], [struct sockaddr s; s.sa_len;],
1745 ac_cv_struct_sockaddr_sa_len=yes, ac_cv_struct_sockaddr_sa_len=no)])
1747 if test $ac_cv_struct_sockaddr_sa_len = yes; then
1748 AC_DEFINE(HAVE_SA_LEN, 1, [Define if sa_len field exists in struct sockaddr])
1758 AC_FUNC_CLOSEDIR_VOID
1759 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
1760 # AC_FUNC_FNMATCH dnl use local version
1763 AC_CHECK_LIB(intl, gettext, [LIBS="$LIBS -lintl"])
1766 AC_CHECK_LIB(sun, getpwnam)
1768 AC_CHECK_HEADERS(zlib.h)
1769 AC_CHECK_LIB(z, deflate, [FDLIBS="-lz"])
1771 if test x$FDLIBS = x-lz; then
1772 AC_DEFINE(HAVE_LIBZ)
1777 # Check for ACL libraries
1780 AC_CHECK_HEADER(sys/acl.h)
1781 AC_CHECK_FUNC(acl_get_file, [have_acl=yes],
1782 [AC_CHECK_LIB(acl, acl_get_file, [have_acl=yes; FDLIBS="-lacl $FDLIBS"],
1783 [AC_CHECK_LIB(sec, acltotext, [have_acl=yes; FDLIBS="-lsec $FDLIBS"])]
1786 if test $have_acl = yes; then
1790 dnl Check for pthread libraries
1792 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
1793 [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
1794 [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
1795 [AC_CHECK_FUNC(pthread_create)]
1806 if test x$have_gcc = xyes ; then
1807 CPPFLAGS="$CPPFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
1808 CFLAGS="$CFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
1810 LDFLAGS=${LDFLAGS--O}
1811 DB_LIBS="${SQL_LFLAGS}"
1812 CPPFLAGS="$CPPFLAGS"
1825 AC_SUBST(X_EXTRA_LIBS)
1830 dnl# extra configurable objects
1841 # Finally we set appropriate distribution specific
1842 # variables and defaults
1844 # PFILES are platform specific files
1845 PFILES="platforms/Makefile"
1849 hostname=`uname -n | cut -d '.' -f 1`
1850 if test x${hostname} = x ; then
1851 hostname="localhost"
1856 PSCMD="ps -e -o pid,comm"
1858 platforms/aix/Makefile"
1859 TAPEDRIVE="/dev/rmt0.1"
1863 PTHREAD_LIB="-lpthread -lexc"
1864 if test "${CC}" = "gcc" ; then
1871 TAPEDRIVE="/dev/nrmt0"
1874 DISTVER=`uname -a |awk '{print $3}'`
1875 TAPEDRIVE="/dev/nrmt0"
1876 PTHREAD_LIB="-pthread"
1877 CFLAGS="${CFLAGS} -pthread"
1878 PSCMD="ps -ax -o pid,command"
1882 platforms/bsdi/Makefile \
1883 platforms/bsdi/bacula-fd \
1884 platforms/bsdi/bacula-sd \
1885 platforms/bsdi/bacula-dir"
1886 largefile_support="yes"
1889 DISTVER=`uname -a |awk '{print $3}'`
1890 TAPEDRIVE="/dev/nrst0"
1893 WLDFLAGS="-mwindows"
1897 TAPEDRIVE="/dev/nst0"
1898 PSCMD="ps -e -o pid,command"
1901 platforms/darwin/Makefile"
1904 DISTVER=`cat /etc/debian_version`
1905 TAPEDRIVE="/dev/nrst0"
1906 PSCMD="ps -e -o pid,command"
1909 DISTVER=`uname -a |awk '{print $3}'`
1910 VER=`echo $DISTVER | cut -c 1`
1911 if test x$VER = x4 ; then
1912 PTHREAD_LIB="${PTHREAD_LIBS:--pthread}"
1913 CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS:--pthread}"
1917 TAPEDRIVE="/dev/nrsa0"
1918 PSCMD="ps -ax -o pid,command"
1920 platforms/freebsd/Makefile \
1921 platforms/freebsd/bacula-fd \
1922 platforms/freebsd/bacula-sd \
1923 platforms/freebsd/bacula-dir"
1924 largefile_support="yes"
1927 PSCMD="UNIX95=1; ps -e -o pid,comm"
1928 CFLAGS="${CFLAGS} -D_XOPEN_SOURCE_EXTENDED=1"
1930 TAPEDRIVE="/dev/rmt/0hnb"
1931 PTHREAD_LIB="-lpthread"
1932 AC_DEFINE([_INCLUDE_LONGLONG])
1936 TAPEDRIVE="/dev/rmt/0cbn"
1937 PSCMD="ps -e -o pid,comm"
1939 platforms/irix/Makefile \
1940 platforms/irix/bacula-fd \
1941 platforms/irix/bacula-sd \
1942 platforms/irix/bacula-dir"
1945 DISTVER=`uname -a |awk '{print $3}'`
1948 TAPEDRIVE="/dev/nrst0"
1949 PSCMD="ps -ax -o pid,command"
1950 PTHREAD_LIB="-pthread"
1951 CFLAGS="${CFLAGS} -pthread"
1954 DISTVER=`uname -a |awk '{print $3}'`
1957 TAPEDRIVE="/dev/nrst0"
1958 PSCMD="ps -ax -o pid,command"
1959 PTHREAD_LIB="-pthread"
1960 CFLAGS="${CFLAGS} -pthread"
1962 platforms/openbsd/Makefile \
1963 platforms/openbsd/bacula-fd \
1964 platforms/openbsd/bacula-sd \
1965 platforms/openbsd/bacula-dir"
1968 if test -f /etc/whitebox-release ; then
1969 f=/etc/whitebox-release
1971 f=/etc/redhat-release
1973 if test `cat $f | grep release |\
1974 cut -f 3 -d ' '`x = "Enterprise"x ; then
1975 DISTVER="Enterprise "`cat $f | grep release |\
1978 DISTVER=`cat /etc/redhat-release | grep release |\
1981 TAPEDRIVE="/dev/nst0"
1982 PSCMD="ps -e -o pid,command"
1984 platforms/redhat/Makefile \
1985 platforms/redhat/bacula-fd \
1986 platforms/redhat/bacula-sd \
1987 platforms/redhat/bacula-dir \
1988 platforms/redhat/bacula.spec \
1992 DISTVER=`cat /etc/mandrake-release | grep release |\
1994 TAPEDRIVE="/dev/nst0"
1995 PSCMD="ps -e -o pid,command"
1997 platforms/mandrake/Makefile \
1998 platforms/mandrake/bacula-fd \
1999 platforms/mandrake/bacula-sd \
2000 platforms/mandrake/bacula-dir \
2001 platforms/mandrake/bacula.spec \
2005 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
2006 TAPEDRIVE="/dev/nst0"
2007 PSCMD="ps -e -o pid,command"
2009 platforms/gentoo/Makefile \
2010 platforms/gentoo/bacula-init \
2011 platforms/gentoo/bacula-fd \
2012 platforms/gentoo/bacula-sd \
2013 platforms/gentoo/bacula-dir"
2016 DISTVER=`cat /etc/slackware-version`
2017 TAPEDRIVE="/dev/nst0"
2018 PSCMD="ps -e -o pid,command"
2020 platforms/slackware/Makefile \
2021 platforms/slackware/rc.bacula-fd \
2022 platforms/slackware/rc.bacula-sd \
2023 platforms/slackware/rc.bacula-dir\
2024 platforms/slackware/functions.bacula"
2028 TAPEDRIVE="/dev/rmt/0cbn"
2029 PSCMD="ps -e -o pid,comm"
2031 platforms/solaris/Makefile \
2032 platforms/solaris/bacula-fd \
2033 platforms/solaris/bacula-sd \
2034 platforms/solaris/bacula-dir"
2035 if test x$DISTVER = x5.6 ; then
2036 AC_DEFINE(HAVE_OLD_SOCKOPT)
2038 LIBS="$LIBS -lresolv"
2041 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
2043 TAPEDRIVE="/dev/nst0"
2044 PSCMD="ps -e -o pid,command"
2046 platforms/suse/Makefile \
2047 platforms/suse/bacula-fd \
2048 platforms/suse/bacula-sd \
2049 platforms/suse/bacula-dir \
2050 platforms/suse/bacula \
2051 platforms/suse/bacula.spec"
2056 TAPEDRIVE="/dev/nst0"
2057 PSCMD="ps -e -o pid,command"
2059 platforms/suse/Makefile \
2060 platforms/suse/bacula-fd \
2061 platforms/suse/bacula-sd \
2062 platforms/suse/bacula-dir"
2066 TAPEDRIVE="/dev/nst0"
2069 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
2075 LIBS="$PTHREAD_LIB $LIBS"
2077 AC_DEFINE_UNQUOTED(lld, "$lld")
2078 AC_DEFINE_UNQUOTED(llu, "$llu")
2086 dnl# common parts of the Makefile
2087 MCOMMON=./autoconf/Make.common
2088 AC_SUBST_FILE(MCOMMON)
2091 if test "x${subsysdir}" = "x${sbindir}" ; then
2094 echo "You have set both --sbindir and --with-subsys-dir"
2095 echo " equal to: ${subsysdir} "
2096 echo "This is not permitted. Please reconfigure."
2098 echo "Aborting configuration ..."
2104 AC_OUTPUT([autoconf/Make.common \
2107 scripts/startmysql \
2109 scripts/btraceback \
2115 scripts/bacula-ctl-dir \
2116 scripts/bacula-ctl-fd \
2117 scripts/bacula-ctl-sd \
2118 scripts/devel_bacula \
2121 scripts/bacula.desktop.gnome1 \
2122 scripts/bacula.desktop.gnome2 \
2123 scripts/bacula.desktop.gnome1.consolehelper \
2124 scripts/bacula.desktop.gnome2.consolehelper \
2125 scripts/bacula.desktop.gnome1.xsu \
2126 scripts/bacula.desktop.gnome2.xsu \
2127 scripts/bgnome-console.console_apps \
2128 scripts/mtx-changer \
2129 scripts/disk-changer \
2130 scripts/dvd-handler \
2131 scripts/dvd-simulator \
2132 scripts/bacula-tray-monitor.desktop \
2133 scripts/logwatch/Makefile \
2134 scripts/logwatch/logfile.bacula.conf \
2135 scripts/wxconsole.console_apps \
2136 scripts/wxconsole.desktop.consolehelper \
2137 scripts/wxconsole.desktop.xsu \
2138 scripts/bat.desktop \
2139 scripts/bat.desktop.xsu \
2140 scripts/bat.desktop.consolehelper \
2141 scripts/bat.console_apps \
2144 src/console/Makefile \
2145 src/console/bconsole.conf \
2146 src/gnome2-console/Makefile \
2147 src/gnome2-console/bgnome-console.conf \
2148 src/qt-console/bat.conf \
2149 src/qt-console/bat.pro \
2150 src/qt-console/install_conf_file \
2151 src/wx-console/Makefile \
2152 src/wx-console/bwx-console.conf \
2153 src/tray-monitor/Makefile \
2154 src/tray-monitor/tray-monitor.conf \
2156 src/dird/bacula-dir.conf \
2158 src/stored/Makefile \
2159 src/stored/bacula-sd.conf \
2160 src/filed/Makefile \
2161 src/filed/bacula-fd.conf \
2163 src/cats/make_catalog_backup \
2164 src/cats/delete_catalog_backup \
2165 src/cats/create_postgresql_database \
2166 src/cats/update_postgresql_tables \
2167 src/cats/make_postgresql_tables \
2168 src/cats/grant_postgresql_privileges \
2169 src/cats/drop_postgresql_tables \
2170 src/cats/drop_postgresql_database \
2171 src/cats/create_mysql_database \
2172 src/cats/update_mysql_tables \
2173 src/cats/make_mysql_tables \
2174 src/cats/grant_mysql_privileges \
2175 src/cats/drop_mysql_tables \
2176 src/cats/drop_mysql_database \
2177 src/cats/create_sqlite_database \
2178 src/cats/update_sqlite_tables \
2179 src/cats/make_sqlite_tables \
2180 src/cats/grant_sqlite_privileges \
2181 src/cats/drop_sqlite_tables \
2182 src/cats/drop_sqlite_database \
2183 src/cats/create_sqlite3_database \
2184 src/cats/update_sqlite3_tables \
2185 src/cats/make_sqlite3_tables \
2186 src/cats/grant_sqlite3_privileges \
2187 src/cats/drop_sqlite3_tables \
2188 src/cats/drop_sqlite3_database \
2191 src/cats/create_bdb_database \
2192 src/cats/update_bdb_tables \
2193 src/cats/make_bdb_tables \
2194 src/cats/grant_bdb_privileges \
2195 src/cats/drop_bdb_tables \
2196 src/cats/drop_bdb_database \
2197 src/cats/create_bacula_database \
2198 src/cats/update_bacula_tables \
2199 src/cats/grant_bacula_privileges \
2200 src/cats/make_bacula_tables \
2201 src/cats/drop_bacula_tables \
2202 src/cats/drop_bacula_database \
2203 src/findlib/Makefile \
2204 src/tools/Makefile \
2207 [(echo "Doing make of dependencies"; ${MAKE:-make} depend;) ]
2211 chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
2212 chmod 755 dvd-handler dvd-simulator
2213 chmod 755 bconsole gconsole mtx-changer devel_bacula logrotate
2218 chmod 755 $c/create_bacula_database $c/update_bacula_tables $c/make_bacula_tables
2219 chmod 755 $c/grant_bacula_privileges $c/drop_bacula_tables $c/drop_bacula_database
2221 chmod 755 $c/create_bdb_database $c/update_bdb_tables $c/make_bdb_tables
2222 chmod 755 $c/grant_bdb_privileges $c/drop_bdb_tables $c/drop_bdb_database
2224 chmod 755 $c/create_mysql_database $c/update_mysql_tables $c/make_mysql_tables
2225 chmod 755 $c/grant_mysql_privileges $c/drop_mysql_tables $c/drop_mysql_database
2227 chmod 755 $c/create_sqlite_database $c/update_sqlite_tables $c/make_sqlite_tables
2228 chmod 755 $c/grant_sqlite_privileges $c/drop_sqlite_tables $c/drop_sqlite_database
2230 chmod 755 $c/create_sqlite3_database $c/update_sqlite3_tables $c/make_sqlite3_tables
2231 chmod 755 $c/grant_sqlite3_privileges $c/drop_sqlite3_tables $c/drop_sqlite3_database
2233 chmod 755 $c/create_postgresql_database $c/update_postgresql_tables $c/make_postgresql_tables
2234 chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables $c/drop_postgresql_database
2236 chmod 755 $c/make_catalog_backup $c/delete_catalog_backup
2240 chmod 755 src/win32/build-depkgs-mingw32
2242 if test "${support_bat}" = "yes" ; then
2244 chmod 755 install_conf_file build-depkgs-qt-console
2245 echo "Creating bat Makefile"
2251 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
2252 largefile_support="yes"
2256 # A whole lot of hand springs to get the compiler version.
2257 # This is because gcc changed the output in version 3.0
2259 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
2260 if test "x${CCVERSION}" = "x" ; then
2261 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
2263 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
2264 if test x"${CXXVERSION}" = x ; then
2265 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
2268 if test "x${subsysdir}" = "x${sbindir}" ; then
2271 echo "You have set --sbindir and --with-subsys-dir"
2272 echo " both equal to: ${subsysdir} "
2273 echo " This is not permitted. Please reconfigure."
2275 echo "Aborting configuration ..."
2281 if test "x${db_type}" = "xInternal" ; then
2284 echo "You have not specified either --enable-client-only or one of the"
2285 echo " supported databases: MySQL, PostgreSQL, SQLite3 or SQLite."
2286 echo " This is not permitted. Please reconfigure."
2288 echo "Aborting the configuration ..."
2295 Configuration on `date`:
2297 Host: $host -- ${DISTNAME} ${DISTVER}
2298 Bacula version: ${VERSION} (${DATE})
2299 Source code location: ${srcdir}
2300 Install binaries: ${sbindir}
2301 Install config files: ${sysconfdir}
2302 Scripts directory: ${scriptdir}
2303 Working directory: ${working_dir}
2304 PID directory: ${piddir}
2305 Subsys directory: ${subsysdir}
2306 Man directory: ${mandir}
2307 Data directory: ${datadir}
2308 C Compiler: ${CC} ${CCVERSION}
2309 C++ Compiler: ${CXX} ${CXXVERSION}
2310 Compiler flags: ${WCFLAGS} ${CFLAGS}
2311 Linker flags: ${WLDFLAGS} ${LDFLAGS}
2313 Statically Linked Tools: ${support_static_tools}
2314 Statically Linked FD: ${support_static_fd}
2315 Statically Linked SD: ${support_static_sd}
2316 Statically Linked DIR: ${support_static_dir}
2317 Statically Linked CONS: ${support_static_cons}
2318 Database type: ${db_type}
2319 Database lib: ${DB_LIBS}
2320 Database name: ${db_name}
2321 Database user: ${db_user}
2323 Job Output Email: ${job_email}
2324 Traceback Email: ${dump_email}
2325 SMTP Host Address: ${smtp_host}
2327 Director Port: ${dir_port}
2328 File daemon Port: ${fd_port}
2329 Storage daemon Port: ${sd_port}
2331 Director User: ${dir_user}
2332 Director Group: ${dir_group}
2333 Storage Daemon User: ${sd_user}
2334 Storage DaemonGroup: ${sd_group}
2335 File Daemon User: ${fd_user}
2336 File Daemon Group: ${fd_group}
2338 SQL binaries Directory ${SQL_BINDIR}
2340 Large file support: $largefile_support
2341 Bacula conio support: ${got_conio} ${CONS_LIBS}
2342 readline support: ${got_readline} ${PRTREADLINE_SRC}
2343 TCP Wrappers support: ${TCPW_MSG} ${WRAPLIBS}
2344 TLS support: ${support_tls}
2345 Encryption support: ${support_crypto}
2346 ZLIB support: ${have_zlib}
2347 enable-smartalloc: ${support_smartalloc}
2348 bat support: ${support_bat} ${QWT_LDFLAGS}
2349 enable-gnome: ${support_gnome} ${gnome_version}
2350 enable-bwx-console: ${support_wx_console} ${wx_version}
2351 enable-tray-monitor: ${support_tray_monitor}
2352 client-only: ${build_client_only}
2353 build-dird: ${build_dird}
2354 build-stored: ${build_stored}
2355 ACL support: ${have_acl}
2356 Python support: ${support_python} ${PYTHON_LIBS}
2357 Batch insert enabled: ${support_batch_insert}