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
276 if test x$support_bat = xyes; then
278 [ --with-qwt@<:@=DIR@:>@ specify qwt library directory],
283 if test -f ${with_qwt}/include/qwt.h; then
284 QWT_INC="${with_qwt}/include"
285 QWT_LDFLAGS="-L${with_qwt}/lib"
288 echo "qwt.h not found. bat turned off ..."
301 AC_SUBST(QWT_LDFLAGS)
304 # -------------------------------------------
305 # bwx-console (default off)
306 # -------------------------------------------
307 AC_ARG_ENABLE(bwx-console,
308 [ --enable-bwx-console enable build of wxWidgets console [disabled]],
309 [if test x$enableval = xyes; then
310 support_wx_console=yes
314 if test x$support_wx_console = xyes; then
315 abc=`$WXCONFIG $WXFLAGS --cppflags`
317 if test $pkg = 0; then
318 wx_version="wxWidgets `$WXCONFIG $WXFLAGS --release`"
319 WXCONS_CPPFLAGS=`$WXCONFIG $WXFLAGS --cppflags`
320 WXCONS_LDFLAGS=`$WXCONFIG $WXFLAGS --libs`
322 AC_SUBST(WXCONS_CPPFLAGS)
323 AC_SUBST(WXCONS_LDFLAGS)
324 WX_DIR=src/wx-console
327 echo "wx-config program not found. bwx-console disabled."
329 support_wx_console=no
335 # -------------------------------------------
336 # tray-monitor (default off)
337 # -------------------------------------------
338 AC_ARG_ENABLE(tray-monitor,
339 [ --enable-tray-monitor enable build of Gnome tray monitor (compatible with KDE) [disabled]],
340 [if test x$enableval = xyes; then
341 support_tray_monitor=yes
345 if test x$support_tray_monitor = xyes; then
346 abc=`$PKGCONFIG --exists gtk+-2.0`
348 if test $pkg = 0; then
349 TRAY_MONITOR_CPPFLAGS=`$PKGCONFIG --cflags gtk+-2.0`
350 TRAY_MONITOR_LDFLAGS=`$PKGCONFIG --libs gtk+-2.0`
351 AC_SUBST(TRAY_MONITOR_CPPFLAGS)
352 AC_SUBST(TRAY_MONITOR_LDFLAGS)
353 TRAY_MONITOR_DIR=src/tray-monitor
354 abc=`$PKGCONFIG --atleast-version=2.4 gtk+-2.0`
356 if test $pkg = 0; then
357 AC_DEFINE(HAVE_GTK_2_4)
361 AC_SUBST(TRAY_MONITOR_DIR)
363 # -------------------------------------------
364 # smartalloc (default off)
365 # -------------------------------------------
366 AC_ARG_ENABLE(smartalloc,
367 [ --enable-smartalloc enable smartalloc debugging support [disabled]],
368 [if test x$enableval = xno; then
369 support_smartalloc=no
372 if test x$support_smartalloc = xyes; then
373 AC_DEFINE(SMARTALLOC)
376 # -------------------------------------------
377 # static-tools (default off)
378 # -------------------------------------------
379 AC_ARG_ENABLE(static-tools,
380 [ --enable-static-tools enable static tape tools [disabled]],
381 [if test x$enableval = xyes; then
382 support_static_tools=yes
386 if test x$support_static_tools = xyes; then
387 TTOOL_LDFLAGS="-static"
389 AC_SUBST(TTOOL_LDFLAGS)
391 # -------------------------------------------
392 # static-fd (default off)
393 # -------------------------------------------
394 AC_ARG_ENABLE(static-fd,
395 [ --enable-static-fd enable static File daemon [disabled]],
396 [if test x$enableval = xyes; then
397 support_static_fd=yes
401 if test x$support_static_fd = xyes; then
402 STATIC_FD="static-bacula-fd"
406 # -------------------------------------------
407 # static-sd (default off)
408 # -------------------------------------------
409 AC_ARG_ENABLE(static-sd,
410 [ --enable-static-sd enable static Storage daemon [disabled]],
411 [if test x$enableval = xyes; then
412 support_static_sd=yes
416 if test x$support_static_sd = xyes; then
417 STATIC_SD="static-bacula-sd"
421 # -------------------------------------------
422 # static-dir (default off)
423 # -------------------------------------------
424 AC_ARG_ENABLE(static-dir,
425 [ --enable-static-dir enable static Director [disabled]],
426 [if test x$enableval = xyes; then
427 support_static_dir=yes
431 if test x$support_static_dir = xyes; then
432 STATIC_DIR="static-bacula-dir"
436 # -------------------------------------------
437 # static-cons (default off)
438 # -------------------------------------------
439 AC_ARG_ENABLE(static-cons,
440 [ --enable-static-cons enable static Console [disabled]],
441 [if test x$enableval = xyes; then
442 support_static_cons=yes
448 if test x$support_static_cons = xyes; then
449 STATIC_CONS="static-bconsole"
450 STATIC_GNOME_CONS="static-bgnome-console"
451 STATIC_WX_CONS="static-bwx-console"
453 AC_SUBST(STATIC_CONS)
454 AC_SUBST(STATIC_GNOME_CONS)
455 AC_SUBST(STATIC_WX_CONS)
457 # -------------------------------------------
458 # client_only (default off)
459 # -------------------------------------------
460 AC_ARG_ENABLE(client-only,
461 [ --enable-client-only build client (File daemon) only [disabled]],
462 [if test x$enableval = xyes; then
463 build_client_only=yes
467 if test x$build_client_only = xno; then
474 # -------------------------------------------
475 # director (default on)
476 # -------------------------------------------
477 AC_ARG_ENABLE(build-dird,
478 [ --enable-build-dird enable building of dird (Director) [enabled]],
479 [if test x$enableval = xno; then
482 if test x$build_dird = xyes; then
487 DIR_TOOLS="NODIRTOOLS"
492 # -------------------------------------------
493 # stored (default on)
494 # -------------------------------------------
495 AC_ARG_ENABLE(build-stored,
496 [ --enable-build-stored enable building of stored (Storage daemon) [enabled]],
497 [if test x$enableval = xno; then
500 if test x$build_stored = xyes; then
501 STORED_DIR="src/stored"
507 # ---------------------------------------------------
508 # Check for conio (Bacula readline substitute)(
509 # ---------------------------------------------------
510 # this allows you to turn it completely off
512 [ --disable-conio disable conio support [enabled]
514 [if test x$enableval = xno; then
520 # ---------------------------------------------------
521 # Check for IPv6 support
522 # ---------------------------------------------------
523 # this allows you to turn it completely off
526 [ --enable-ipv6 enable ipv6 support [enabled]
528 [if test x$enableval = xno; then
533 if test x$support_ipv6 = xyes; then
534 AC_TRY_LINK([ #include <sys/types.h>
535 #include <sys/socket.h>
536 #include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;],
537 [support_ipv6=yes], [support_ipv6=no])
540 if test x$support_ipv6 = xyes; then
541 AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
547 if test x$support_conio = xyes; then
548 AC_CHECK_HEADER(termcap.h,
549 [ AC_CHECK_LIB(termcap, tgetent,
550 [ CONS_LIBS="-ltermcap"
555 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
557 [ AC_CHECK_LIB(ncurses, tgetent,
558 [ CONS_LIBS="-lncurses"
563 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
568 AC_CHECK_HEADERS(curses.h)
569 AC_CHECK_HEADER(term.h,
570 [ AC_CHECK_LIB(curses, tgetent,
571 [ CONS_LIBS="-lcurses"
576 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
579 [ echo " "; echo "Required libraries not found. CONIO turned off ..."; echo " "],
588 # ---------------------------------------------------
589 # Check for readline support/directory (default off)
590 # ---------------------------------------------------
591 # this allows you to turn it completely off
592 AC_ARG_ENABLE(readline,
593 [ --disable-readline disable readline support [disable]
595 [if test x$enableval = xno; then
601 if test x$support_readline = xyes; then
602 AC_ARG_WITH(readline,
603 [ --with-readline@<:@=DIR@:>@ specify readline library directory],
605 case "$with_readline" in
608 if test -f ${with_readline}/readline.h; then
609 CONS_INC="-I${with_readline}"
610 CONS_LDFLAGS="-L$with_readline"
611 elif test -f ${with_readline}/include/readline/readline.h; then
612 CONS_INC="-I${with_readline}/include/readline"
613 CONS_LDFLAGS="-L${with_readline}/lib"
614 with_readline="${with_readline}/include/readline"
616 with_readline="/usr/include/readline"
618 AC_CHECK_HEADER(${with_readline}/readline.h,
619 [ AC_DEFINE(HAVE_READLINE)
620 CONS_LIBS="-lreadline -lhistory -ltermcap"
624 echo "readline.h not found. readline turned off ..."
631 # check for standard readline library
632 AC_CHECK_HEADER(/usr/include/readline/readline.h,
633 [ AC_DEFINE(HAVE_READLINE)
635 CONS_INC="-I/usr/include/readline"
636 CONS_LIBS="-lreadline -ltermcap"
638 # Did not find standard library, so try Bacula's default
639 AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h,
640 [ AC_DEFINE(HAVE_READLINE)
642 CONS_INC="-I${TOP_DIR}/depkgs/readline"
643 CONS_LIBS="-lreadline -lhistory -ltermcap"
644 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
645 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
648 echo "readline.h not found. readline turned off ..."
664 AC_SUBST(CONS_LDFLAGS)
665 AC_SUBST(READLINE_SRC)
667 # Minimal stuff for readline Makefile configuration
672 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr lstat lchown)
673 AC_CHECK_FUNCS(nanosleep nl_langinfo)
674 AC_CHECK_HEADERS(varargs.h)
676 # End of readline/conio stuff
677 # -----------------------------------------------------------------------
679 # -----------------------------------------------------------------------
680 # Check for Python support
682 AC_MSG_CHECKING(for Python support)
685 --with-python@<:@=DIR@:>@ Include Python support. DIR is the Python base
686 install directory, default is to search through
687 a number of common places for the Python files.],
691 if test "$withval" != "no"; then
692 if test "$withval" = "yes"; then
693 for python_root in /usr /usr/local /usr/sfw; do
694 for ver in python2.2 python2.3 python2.4 python2.5; do
695 if test -f $python_root/include/${ver}/Python.h; then
696 PYTHON_INCDIR=-I$python_root/include/${ver}
697 if test -d $python_root/lib64/${ver}/config; then
698 PYTHON_LIBS="-L$python_root/lib64/${ver}/config -l${ver}"
700 PYTHON_LIBS="-L$python_root/lib/${ver}/config -l${ver}"
706 if test x$PYTHON_INCDIR = x; then
707 if test -f $prefix/include/Python.h; then
708 PYTHON_INCDIR=-I$prefix/include
709 if test -d $prefix/lib64/config; then
710 PYTHON_LIBS="-L$prefix/lib64/config -lpython"
712 PYTHON_LIBS="-L$prefix/lib/config -lpython"
716 AC_MSG_ERROR(Unable to find Python.h in standard locations)
720 if test -f $withval/Python.h; then
721 PYTHON_INCDIR=-I$withval
722 PYTHON_LIBS="-L$withval/config -lpython"
723 elif test -f $withval/include/Python.h; then
724 PYTHON_INCDIR=-I$withval/include
725 if test -d $withval/lib64/config; then
726 PYTHON_LIBS="-L$withval/lib64/config -lpython"
728 PYTHON_LIBS="-L$withval/lib/config -lpython"
730 elif test -f $withval/include/python/Python.h; then
731 PYTHON_INCDIR=-I$withval/include/python
732 if test -d $withval/lib64/python/config; then
733 PYTHON_LIBS="-L$withval/lib64/python/config -lpython"
735 PYTHON_LIBS="-L$withval/lib/python/config -lpython"
739 AC_MSG_ERROR(Invalid Python directory $withval - unable to find Python.h under $withval)
742 AC_DEFINE([HAVE_PYTHON], 1)
745 AC_MSG_NOTICE(checking for more Python libs)
746 saved_LIBS="$LIBS"; LIBS=
747 AC_SEARCH_LIBS(shm_open, [rt])
748 AC_CHECK_LIB(util, openpty)
749 PYTHON_LIBS="$PYTHON_LIBS $LIBS"
757 AC_SUBST(PYTHON_LIBS)
758 AC_SUBST(PYTHON_INCDIR)
761 # Find where sockets are (especially for Solaris)
762 # Do this before the TCP Wrappers test since tcp wrappers
763 # uses the socket library and some linkers are stupid.
765 AC_CHECK_FUNC(socket,
766 AC_MSG_RESULT(using libc's socket),
767 AC_CHECK_LIB(xnet,socket)
768 AC_CHECK_LIB(socket,socket)
769 AC_CHECK_LIB(inet,socket))
772 # -----------------------------------------------------------
773 # Check whether user wants TCP wrappers support (default off)
774 # -----------------------------------------------------------
777 AC_ARG_WITH(tcp-wrappers,
778 [ --with-tcp-wrappers@<:@=DIR@:>@ enable tcpwrappers support],
780 if test "x$withval" != "xno" ; then
782 LIBS="$saved_LIBS -lwrap"
783 AC_MSG_CHECKING(for libwrap)
784 AC_SEARCH_LIBS(nanosleep, [rt])
786 [ #include <sys/types.h>
788 int deny_severity = 0;
789 int allow_severity = 0;
790 struct request_info *req; ],
791 [ hosts_access(req); ],
794 AC_DEFINE(HAVE_LIBWRAP)
799 LIBS="$saved_LIBS -lwrap -lnsl"
800 WRAPLIBS="$saved_LIBS -lwrap -lnsl"
802 [ #include <sys/types.h>
804 int deny_severity = 0;
805 int allow_severity = 0;
806 struct request_info *req; ],
807 [ hosts_access(req); ],
810 AC_DEFINE(HAVE_LIBWRAP)
815 [AC_MSG_ERROR([*** libwrap missing]) ] ]
822 # -----------------------------------------------------------
823 # Check whether OpenSSL is available
824 # -----------------------------------------------------------
825 AC_MSG_CHECKING([for OpenSSL])
826 dnl The following uses quadrigraphs:
830 AC_HELP_STRING([--with-openssl@<:@=DIR@:>@], [Include OpenSSL support. DIR is the OpenSSL base]),
831 [with_openssl_directory=${withval}])
833 if test "x$with_openssl_directory" != "x"; then
834 OPENSSL_LIBS="-lssl -lcrypto"
837 if test "x$with_openssl_directory" != "xyes" && test x"${with_openssl_directory}" != "x"; then
838 OPENSSL_LIBS="-L$with_openssl_directory/lib $OPENSSL_LIBS"
839 OPENSSL_INC="-I$with_openssl_directory/include $OPENSSL_INC"
843 saved_CFLAGS="${CFLAGS}"
844 LIBS="${saved_LIBS} ${OPENSSL_LIBS}"
845 CFLAGS="${saved_CFLAGS} ${OPENSSL_INC}"
847 AC_TRY_LINK([ #include <openssl/ssl.h> ],
848 [ CRYPTO_set_id_callback(NULL); ],
856 AC_TRY_LINK([ #include <openssl/evp.h> ],
858 [ ac_cv_openssl_sha2="yes" ],
859 [ ac_cv_openssl_sha2="no" ]
862 # Solaris disables greater than 128+ bit encryption in their OpenSSL
863 # implementation, presumably for export reasons. If 192bit AES
864 # is available, we assume that we're running with a 'non-export'
866 AC_TRY_LINK([ #include <openssl/evp.h> ],
867 [ EVP_aes_192_cbc(); ],
868 [ ac_cv_openssl_export="no" ],
869 [ ac_cv_openssl_export="yes" ]
873 CFLAGS="${saved_CFLAGS}"
875 if test "$support_tls" = "yes"; then
876 AC_DEFINE(HAVE_OPENSSL, 1, [Define if OpenSSL library is available])
877 AC_DEFINE(HAVE_TLS, 1, [Define if TLS support should be enabled])
878 AC_DEFINE(HAVE_CRYPTO, 1, [Define if encryption support should be enabled])
881 if test "$ac_cv_openssl_sha2" = "yes"; then
882 AC_DEFINE(HAVE_SHA2, 1, [Define if the SHA-2 family of digest algorithms is available])
885 if test "$ac_cv_openssl_export" = "yes"; then
886 AC_DEFINE(HAVE_OPENSSL_EXPORT_LIBRARY, 1, [Define if the OpenSSL library is export-contrained to 128bit ciphers])
895 AC_MSG_RESULT([$support_tls])
896 AC_SUBST(OPENSSL_LIBS)
897 AC_SUBST(OPENSSL_INC)
900 # -----------------------------------------------------------
901 # Python and OpenSSL are using dlopen
902 # -----------------------------------------------------------
904 if test "$support_python" = "yes" -o "$support_tls" = "yes"; then
905 AC_SEARCH_LIBS(dlopen, [dl])
908 # ------------------------------------------
909 # Where to place working dir
910 # ------------------------------------------
911 working_dir=`eval echo ${prefix}/var/bacula/working`
912 AC_ARG_WITH(working-dir,
913 [ --with-working-dir=PATH specify path of Bacula working directory],
915 if test "x$withval" != "xno" ; then
921 AC_SUBST(working_dir)
924 # ------------------------------------------
925 # Where to place scriptdir (script files)
926 # ------------------------------------------
927 scriptdir=`eval echo ${sysconfdir}`
928 AC_ARG_WITH(scriptdir,
929 [ --with-scriptdir=PATH specify path of Bacula scripts directory],
931 if test "x$withval" != "xno" ; then
940 # ------------------------------------------
941 # Where to send dump email
942 # ------------------------------------------
943 dump_email=root@localhost
944 AC_ARG_WITH(dump-email,
945 [ --with-dump-email=EMAIL dump email address],
947 if test "x$withval" != "xno" ; then
955 # ------------------------------------------
956 # Where to send job email
957 # ------------------------------------------
958 job_email=root@localhost
959 AC_ARG_WITH(job-email,
960 [ --with-job-email=EMAIL job output email address],
962 if test "x$withval" != "xno" ; then
970 # ------------------------------------------
971 # Where to find smtp host
972 # ------------------------------------------
974 AC_ARG_WITH(smtp_host,
975 [ --with-smtp-host=HOST SMTP mail host address],
977 if test "x$withval" != "xno" ; then
986 # ------------------------------------
987 # Where to place pid files
988 # ------------------------------------
991 [ --with-pid-dir=PATH specify location of Bacula pid files],
993 if test "x$withval" != "xno" ; then
999 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
1003 # ------------------------------------
1004 # Where to place subsys "lock file"
1005 # ------------------------------------
1006 ubsysdir=/var/run/subsys
1007 if test -d /var/run/subsys; then
1008 subsysdir=/var/run/subsys
1009 elif test -d /var/lock/subsys; then
1010 subsysdir=/var/lock/subsys
1012 subsysdir=/var/run/subsys
1014 AC_ARG_WITH(subsys-dir,
1015 [ --with-subsys-dir=PATH specify location of Bacula subsys file],
1017 if test "x$withval" != "xno" ; then
1027 # ------------------------------------
1028 # Where to start assigning ports
1029 # ------------------------------------
1031 AC_ARG_WITH(baseport,
1032 [ --with-baseport=PORT specify base port address for daemons],
1034 if test "x$withval" != "xno" ; then
1041 dir_port=`expr $baseport`
1042 fd_port=`expr $baseport + 1`
1043 sd_port=`expr $fd_port + 1`
1050 # ------------------------------------------
1051 # Generate passwords
1052 # ------------------------------------------
1054 AC_ARG_WITH(dir-password,
1055 [ --with-dir-password=PASSWORD specify Director's password],
1057 if test "x$withval" != "xno" ; then
1058 dir_password=$withval
1063 if test "x$dir_password" = "x" ; then
1064 if test "x$OPENSSL" = "xnone" ; then
1065 key=`autoconf/randpass 33`
1067 key=`openssl rand -base64 33`
1073 AC_ARG_WITH(fd-password,
1074 [ --with-fd-password=PASSWORD specify Client's password],
1076 if test "x$withval" != "xno" ; then
1077 fd_password=$withval
1082 if test "x$fd_password" = "x" ; then
1083 if test "x$OPENSSL" = "xnone" ; then
1084 key=`autoconf/randpass 37`
1086 key=`openssl rand -base64 33`
1092 AC_ARG_WITH(sd-password,
1093 [ --with-sd-password=PASSWORD specify Storage daemon's password],
1095 if test "x$withval" != "xno" ; then
1096 sd_password=$withval
1101 if test "x$sd_password" = "x" ; then
1102 if test "x$OPENSSL" = "xnone" ; then
1103 key=`autoconf/randpass 41`
1105 key=`openssl rand -base64 33`
1111 AC_ARG_WITH(mon-dir-password,
1112 [ --with-mon-dir-password=PASSWORD specify Director's password used by the monitor],
1114 if test "x$withval" != "xno" ; then
1115 mon_dir_password=$withval
1120 if test "x$mon_dir_password" = "x" ; then
1121 if test "x$OPENSSL" = "xnone" ; then
1122 key=`autoconf/randpass 33`
1124 key=`openssl rand -base64 33`
1126 mon_dir_password=$key
1130 AC_ARG_WITH(mon-fd-password,
1131 [ --with-mon-fd-password=PASSWORD specify Client's password used by the monitor],
1133 if test "x$withval" != "xno" ; then
1134 mon_fd_password=$withval
1139 if test "x$mon_fd_password" = "x" ; then
1140 if test "x$OPENSSL" = "xnone" ; then
1141 key=`autoconf/randpass 37`
1143 key=`openssl rand -base64 33`
1145 mon_fd_password=$key
1149 AC_ARG_WITH(mon-sd-password,
1150 [ --with-mon-sd-password=PASSWORD specify Storage daemon's password used by the monitor],
1152 if test "x$withval" != "xno" ; then
1153 mon_sd_password=$withval
1158 if test "x$mon_sd_password" = "x" ; then
1159 if test "x$OPENSSL" = "xnone" ; then
1160 key=`autoconf/randpass 41`
1162 key=`openssl rand -base64 33`
1164 mon_sd_password=$key
1167 AC_SUBST(dir_password)
1168 AC_SUBST(fd_password)
1169 AC_SUBST(sd_password)
1170 AC_SUBST(mon_dir_password)
1171 AC_SUBST(mon_fd_password)
1172 AC_SUBST(mon_sd_password)
1175 # Pickup any database name
1178 AC_ARG_WITH(db_name,
1179 [ --with-db-name=DBNAME specify database name (default bacula)],
1181 if test "x$withval" != "x" ; then
1189 AC_ARG_WITH(db_user,
1190 [ --with-db-user=UNAME specify database user (default bacula)],
1192 if test "x$withval" != "x" ; then
1201 # Handle users and groups for each daemon
1204 AC_ARG_WITH(dir_user,
1205 [ --with-dir-user=USER specify user for Director daemon],
1207 if test "x$withval" != "x" ; then
1214 AC_ARG_WITH(dir_group,
1215 [ --with-dir-group=GROUP specify group for Director daemon],
1217 if test "x$withval" != "x" ; then
1224 AC_ARG_WITH(sd_user,
1225 [ --with-sd-user=USER specify user for Storage daemon],
1227 if test "x$withval" != "x" ; then
1234 AC_ARG_WITH(sd_group,
1235 [ --with-sd-group=GROUP specify group for Storage daemon],
1237 if test "x$withval" != "x" ; then
1244 AC_ARG_WITH(fd_user,
1245 [ --with-fd-user=USER specify user for File daemon],
1247 if test "x$withval" != "x" ; then
1254 AC_ARG_WITH(fd_group,
1255 [ --with-fd-group=GROUP specify group for File daemon],
1257 if test "x$withval" != "x" ; then
1271 # allow setting default executable permissions
1274 AC_ARG_WITH(sbin-perm,
1275 [ --with-sbin-perm=MODE specify permissions for sbin binaries (0754)],
1277 if test "x$withval" != "x" ; then
1285 # ------------------------------------------------
1286 # Bacula check for various SQL database engines
1287 # ------------------------------------------------
1289 BA_CHECK_POSTGRESQL_DB
1300 # -------------------------------------------
1301 # enable batch attribute DB insert (default on)
1302 # -------------------------------------------
1303 support_batch_insert=no
1304 A=`nm $SQL_LIB | grep pthread_mutex_lock`
1306 if test $pkg = 0; then
1307 support_batch_insert=yes
1308 AC_ARG_ENABLE(batch-insert,
1309 [ --enable-batch-insert enable the DB batch insert code [disabled]],
1310 [if test x$enableval = xno; then
1311 support_batch_insert=no
1313 support_batch_insert=yes
1317 if test $support_batch_insert = yes ; then
1318 AC_DEFINE(HAVE_BATCH_FILE_INSERT, 1, [Set if DB batch insert code enabled])
1322 AC_DEFINE(PROTOTYPES)
1324 dnl# --------------------------------------------------------------------------
1325 dnl# Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
1327 if test -z "$CFLAGS" -o "$CFLAGS" = "-g -O2"; then
1328 if test -z "$CCOPTS"; then
1329 CCOPTS='-g -O2 -Wall'
1338 dnl See if we can use 64 bit file addresses
1339 largefile_support="no"
1345 dnl# --------------------------------------------------------------------------
1346 dnl# CHECKING FOR HEADER FILES
1347 dnl# --------------------------------------------------------------------------
1383 AC_STRUCT_ST_BLKSIZE
1387 dnl# --------------------------------------------------------------------------
1388 dnl# Check for utime.h structure
1389 dnl# --------------------------------------------------------------------------
1390 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
1392 #include <sys/types.h>
1393 #include <utime.h>], [struct utimbuf foo],
1394 ba_cv_header_utime_h=yes, ba_cv_header_utime_h=no)])
1395 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H)
1397 dnl# --------------------------------------------------------------------------
1398 dnl# Check for socklen_t
1399 dnl# --------------------------------------------------------------------------
1400 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
1402 #include <sys/types.h>
1403 #include <sys/socket.h>],
1405 ba_cv_header_socklen_t=yes, ba_cv_header_socklen_t=no)])
1406 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T)
1408 dnl# --------------------------------------------------------------------------
1409 dnl# Check for bigendian
1410 dnl# --------------------------------------------------------------------------
1411 AC_CACHE_CHECK([for bigendian], ba_cv_bigendian,
1413 [main(){long a=1L; char *p=(char *)&a; exit(*p);}],
1414 [ba_cv_bigendian=yes],
1415 [ba_cv_bigendian=no],
1416 [ba_cv_bigendian=no])])
1417 test $ba_cv_bigendian = yes && AC_DEFINE(HAVE_BIGENDIAN)
1419 dnl# --------------------------------------------------------------------------
1420 dnl# Check for typeof()
1421 dnl# --------------------------------------------------------------------------
1423 AC_CACHE_CHECK(for typeof, ba_cv_have_typeof,
1425 [main(){char *a = 0; a = (typeof a)a;}],
1426 [ba_cv_have_typeof=yes],
1427 [ba_cv_have_typeof=no],
1428 [ba_cv_have_typeof=no])])
1429 test $ba_cv_have_typeof = yes && AC_DEFINE([HAVE_TYPEOF], 1, [Defind to 1 if compiler has typeof])
1435 dnl# --------------------------------------------------------------------------
1436 dnl# CHECKING FOR FILESYSTEM TYPE
1437 dnl# --------------------------------------------------------------------------
1438 AC_MSG_CHECKING(how to get filesystem type)
1440 # The order of these tests is important.
1441 AC_TRY_CPP([#include <sys/statvfs.h>
1442 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4)
1443 if test $fstype = no; then
1444 AC_TRY_CPP([#include <sys/statfs.h>
1445 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3)
1447 if test $fstype = no; then
1448 AC_TRY_CPP([#include <sys/statfs.h>
1449 #include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX)
1451 if test $fstype = no; then
1452 AC_TRY_CPP([#include <mntent.h>], AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD)
1454 if test $fstype = no; then
1455 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
1457 if test $fstype = no; then
1458 AC_TRY_CPP([#include <sys/mount.h>
1459 #include <sys/fs_types.h>], AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix)
1461 AC_MSG_RESULT($fstype)
1463 AC_CHECK_HEADER(sys/statvfs.h, [ AC_DEFINE(HAVE_SYS_STATVFS_H,1,[Defines if your system have the sys/statvfs.h header file])] , )
1465 dnl# --------------------------------------------------------------------------
1466 dnl# CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
1467 dnl# --------------------------------------------------------------------------
1475 AC_CHECK_TYPE(ino_t, unsigned long)
1476 AC_CHECK_TYPE(dev_t, unsigned long)
1477 AC_CHECK_TYPE(daddr_t, long)
1478 AC_CHECK_TYPE(major_t, int)
1479 AC_CHECK_TYPE(minor_t, int)
1480 AC_CHECK_TYPE(ssize_t, int)
1487 AC_CHECK_SIZEOF(char, 1)
1488 AC_CHECK_SIZEOF(short int, 2)
1489 AC_CHECK_SIZEOF(int, 4)
1490 AC_CHECK_SIZEOF(long int, 4)
1491 AC_CHECK_SIZEOF(long long int, 8)
1492 AC_CHECK_SIZEOF(int *, 4)
1494 # Check for sys/types.h types
1495 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1497 [ #include <sys/types.h> ],
1499 [ ac_cv_have_u_int="yes" ],
1500 [ ac_cv_have_u_int="no" ]
1503 if test "x$ac_cv_have_u_int" = "xyes" ; then
1504 AC_DEFINE(HAVE_U_INT)
1508 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t, [
1510 [ #include <sys/types.h> ],
1511 [ intmax_t a; a = 1;],
1512 [ ac_cv_have_intmax_t="yes" ],
1515 [ #include <stdint.h> ],
1516 [ intmax_t a; a = 1;],
1517 [ ac_cv_have_intmax_t="yes" ],
1518 [ ac_cv_have_intmax_t="no" ]
1524 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
1525 AC_DEFINE(HAVE_INTMAX_T)
1530 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t, [
1532 [ #include <sys/types.h> ],
1533 [ u_intmax_t a; a = 1;],
1534 [ ac_cv_have_u_intmax_t="yes" ],
1537 [ #include <stdint.h> ],
1538 [ u_intmax_t a; a = 1;],
1539 [ ac_cv_have_u_intmax_t="yes" ],
1540 [ ac_cv_have_u_intmax_t="no" ]
1545 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
1546 AC_DEFINE(HAVE_U_INTMAX_T)
1551 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1553 [ #include <sys/types.h> ],
1554 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1555 [ ac_cv_have_intxx_t="yes" ],
1556 [ ac_cv_have_intxx_t="no" ]
1559 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1560 AC_DEFINE(HAVE_INTXX_T)
1564 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1566 [ #include <sys/types.h> ],
1567 [ int64_t a; a = 1;],
1568 [ ac_cv_have_int64_t="yes" ],
1569 [ ac_cv_have_int64_t="no" ]
1572 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1573 AC_DEFINE(HAVE_INT64_T)
1577 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1579 [ #include <sys/types.h> ],
1580 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1581 [ ac_cv_have_u_intxx_t="yes" ],
1582 [ ac_cv_have_u_intxx_t="no" ]
1585 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1586 AC_DEFINE(HAVE_U_INTXX_T)
1590 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1592 [ #include <sys/types.h> ],
1593 [ u_int64_t a; a = 1;],
1594 [ ac_cv_have_u_int64_t="yes" ],
1595 [ ac_cv_have_u_int64_t="no" ]
1598 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1599 AC_DEFINE(HAVE_U_INT64_T)
1603 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1604 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1606 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1608 [ #include <sys/bitypes.h> ],
1609 [ int8_t a; int16_t b; int32_t c;
1610 u_int8_t e; u_int16_t f; u_int32_t g;
1611 a = b = c = e = f = g = 1; ],
1612 [ AC_DEFINE(HAVE_U_INTXX_T)
1613 AC_DEFINE(HAVE_INTXX_T)
1614 AC_DEFINE(HAVE_SYS_BITYPES_H)
1615 AC_MSG_RESULT(yes) ],
1616 [ AC_MSG_RESULT(no)]
1620 if test -z "$have_u_intxx_t" ; then
1621 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1623 [ #include <sys/types.h> ],
1624 [ uint8_t a; uint16_t b;
1625 uint32_t c; a = b = c = 1; ],
1626 [ ac_cv_have_uintxx_t="yes" ],
1627 [ ac_cv_have_uintxx_t="no" ]
1630 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1631 AC_DEFINE(HAVE_UINTXX_T)
1635 if (test -z "$have_u_int64_t" || test -z "$have_int64_t" && \
1636 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1638 AC_MSG_CHECKING([for int64_t and u_int64_t types in sys/bitypes.h])
1640 [ #include <sys/bitypes.h> ],
1641 [ int64_t a; u_int64_t b;
1643 [ AC_DEFINE(HAVE_U_INT64_T)
1644 AC_DEFINE(HAVE_INT64_T)
1645 AC_MSG_RESULT(yes) ],
1646 [ AC_MSG_RESULT(no)]
1650 if (test -z "$have_uintxx_t" && \
1651 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1653 AC_MSG_CHECKING([for uintXX_t types in sys/bitypes.h])
1655 [ #include <sys/bitypes.h> ],
1656 [ uint8_t a; uint16_t b;
1657 uint32_t c; a = b = c = 1; ],
1658 [ AC_DEFINE(HAVE_UINTXX_T)
1659 AC_MSG_RESULT(yes) ],
1660 [ AC_MSG_RESULT(no)]
1668 dnl# --------------------------------------------------------------------------
1669 dnl# CHECKING FOR REQUIRED LIBRARY FUNCTIONS
1670 dnl# --------------------------------------------------------------------------
1686 [echo 'configure: cannot find needed function.'; exit 1]
1689 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
1690 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
1691 AC_CHECK_FUNCS(posix_fadvise)
1692 AC_CHECK_FUNCS(fdatasync)
1694 AC_CHECK_FUNCS(chflags)
1696 AC_CHECK_FUNCS(snprintf vsnprintf gethostid fseeko)
1698 dnl# --------------------------------------------------------------------------
1699 dnl# CHECKING FOR THREAD SAFE FUNCTIONS
1700 dnl# --------------------------------------------------------------------------
1701 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
1703 # If resolver functions are not in libc check for -lnsl or -lresolv.
1704 AC_CHECK_FUNC(gethostbyname_r,
1705 AC_MSG_RESULT(using libc's resolver),
1706 AC_CHECK_LIB(nsl,gethostbyname_r)
1707 AC_CHECK_LIB(resolv,gethostbyname_r))
1711 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
1712 AC_CHECK_FUNCS(inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)])
1713 AC_CHECK_FUNCS(gethostbyname2, [AC_DEFINE(HAVE_GETHOSTBYNAME2)])
1715 dnl ----------------------------
1716 dnl check sa_len of sockaddr
1717 dnl ----------------------------
1718 AC_CACHE_CHECK(for struct sockaddr has a sa_len field, ac_cv_struct_sockaddr_sa_len,
1719 [AC_TRY_COMPILE([#include <sys/socket.h>], [struct sockaddr s; s.sa_len;],
1720 ac_cv_struct_sockaddr_sa_len=yes, ac_cv_struct_sockaddr_sa_len=no)])
1722 if test $ac_cv_struct_sockaddr_sa_len = yes; then
1723 AC_DEFINE(HAVE_SA_LEN, 1, [Define if sa_len field exists in struct sockaddr])
1733 AC_FUNC_CLOSEDIR_VOID
1734 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
1735 # AC_FUNC_FNMATCH dnl use local version
1738 AC_CHECK_LIB(intl, gettext, [LIBS="$LIBS -lintl"])
1741 AC_CHECK_LIB(sun, getpwnam)
1743 AC_CHECK_HEADERS(zlib.h)
1744 AC_CHECK_LIB(z, deflate, [FDLIBS="-lz"])
1746 if test x$FDLIBS = x-lz; then
1747 AC_DEFINE(HAVE_LIBZ)
1752 # Check for ACL libraries
1755 AC_CHECK_HEADER(sys/acl.h)
1756 AC_CHECK_FUNC(acl_get_file, [have_acl=yes],
1757 [AC_CHECK_LIB(acl, acl_get_file, [have_acl=yes; FDLIBS="-lacl $FDLIBS"],
1758 [AC_CHECK_LIB(sec, acltotext, [have_acl=yes; FDLIBS="-lsec $FDLIBS"])]
1761 if test $have_acl = yes; then
1765 dnl Check for pthread libraries
1767 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
1768 [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
1769 [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
1770 [AC_CHECK_FUNC(pthread_create)]
1781 if test x$have_gcc = xyes ; then
1782 CPPFLAGS="$CPPFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
1783 CFLAGS="$CFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
1785 LDFLAGS=${LDFLAGS--O}
1786 DB_LIBS="${SQL_LFLAGS}"
1787 CPPFLAGS="$CPPFLAGS"
1800 AC_SUBST(X_EXTRA_LIBS)
1805 dnl# extra configurable objects
1816 # Finally we set appropriate distribution specific
1817 # variables and defaults
1819 # PFILES are platform specific files
1820 PFILES="platforms/Makefile"
1824 hostname=`uname -n | cut -d '.' -f 1`
1825 if test x${hostname} = x ; then
1826 hostname="localhost"
1831 PSCMD="ps -e -o pid,comm"
1833 platforms/aix/Makefile"
1834 TAPEDRIVE="/dev/rmt0.1"
1838 PTHREAD_LIB="-lpthread -lexc"
1839 if test "${CC}" = "gcc" ; then
1846 TAPEDRIVE="/dev/nrmt0"
1849 DISTVER=`uname -a |awk '{print $3}'`
1850 TAPEDRIVE="/dev/nrmt0"
1851 PTHREAD_LIB="-pthread"
1852 CFLAGS="${CFLAGS} -pthread"
1853 PSCMD="ps -ax -o pid,command"
1857 platforms/bsdi/Makefile \
1858 platforms/bsdi/bacula-fd \
1859 platforms/bsdi/bacula-sd \
1860 platforms/bsdi/bacula-dir"
1861 largefile_support="yes"
1864 DISTVER=`uname -a |awk '{print $3}'`
1865 TAPEDRIVE="/dev/nrst0"
1868 WLDFLAGS="-mwindows"
1872 TAPEDRIVE="/dev/nst0"
1873 PSCMD="ps -e -o pid,command"
1876 platforms/darwin/Makefile"
1879 DISTVER=`cat /etc/debian_version`
1880 TAPEDRIVE="/dev/nrst0"
1881 PSCMD="ps -e -o pid,command"
1884 DISTVER=`uname -a |awk '{print $3}'`
1885 VER=`echo $DISTVER | cut -c 1`
1886 if test x$VER = x4 ; then
1887 PTHREAD_LIB="${PTHREAD_LIBS:--pthread}"
1888 CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS:--pthread}"
1892 TAPEDRIVE="/dev/nrsa0"
1893 PSCMD="ps -ax -o pid,command"
1895 platforms/freebsd/Makefile \
1896 platforms/freebsd/bacula-fd \
1897 platforms/freebsd/bacula-sd \
1898 platforms/freebsd/bacula-dir"
1899 largefile_support="yes"
1902 PSCMD="UNIX95=1; ps -e -o pid,comm"
1903 CFLAGS="${CFLAGS} -D_XOPEN_SOURCE_EXTENDED=1"
1905 TAPEDRIVE="/dev/rmt/0hnb"
1906 PTHREAD_LIB="-lpthread"
1907 AC_DEFINE([_INCLUDE_LONGLONG])
1911 TAPEDRIVE="/dev/rmt/0cbn"
1912 PSCMD="ps -e -o pid,comm"
1914 platforms/irix/Makefile \
1915 platforms/irix/bacula-fd \
1916 platforms/irix/bacula-sd \
1917 platforms/irix/bacula-dir"
1920 DISTVER=`uname -a |awk '{print $3}'`
1923 TAPEDRIVE="/dev/nrst0"
1924 PSCMD="ps -ax -o pid,command"
1925 PTHREAD_LIB="-pthread"
1926 CFLAGS="${CFLAGS} -pthread"
1929 DISTVER=`uname -a |awk '{print $3}'`
1932 TAPEDRIVE="/dev/nrst0"
1933 PSCMD="ps -ax -o pid,command"
1934 PTHREAD_LIB="-pthread"
1935 CFLAGS="${CFLAGS} -pthread"
1937 platforms/openbsd/Makefile \
1938 platforms/openbsd/bacula-fd \
1939 platforms/openbsd/bacula-sd \
1940 platforms/openbsd/bacula-dir"
1943 if test -f /etc/whitebox-release ; then
1944 f=/etc/whitebox-release
1946 f=/etc/redhat-release
1948 if test `cat $f | grep release |\
1949 cut -f 3 -d ' '`x = "Enterprise"x ; then
1950 DISTVER="Enterprise "`cat $f | grep release |\
1953 DISTVER=`cat /etc/redhat-release | grep release |\
1956 TAPEDRIVE="/dev/nst0"
1957 PSCMD="ps -e -o pid,command"
1959 platforms/redhat/Makefile \
1960 platforms/redhat/bacula-fd \
1961 platforms/redhat/bacula-sd \
1962 platforms/redhat/bacula-dir \
1963 platforms/redhat/bacula.spec \
1967 DISTVER=`cat /etc/mandrake-release | grep release |\
1969 TAPEDRIVE="/dev/nst0"
1970 PSCMD="ps -e -o pid,command"
1972 platforms/mandrake/Makefile \
1973 platforms/mandrake/bacula-fd \
1974 platforms/mandrake/bacula-sd \
1975 platforms/mandrake/bacula-dir \
1976 platforms/mandrake/bacula.spec \
1980 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
1981 TAPEDRIVE="/dev/nst0"
1982 PSCMD="ps -e -o pid,command"
1984 platforms/gentoo/Makefile \
1985 platforms/gentoo/bacula-init \
1986 platforms/gentoo/bacula-fd \
1987 platforms/gentoo/bacula-sd \
1988 platforms/gentoo/bacula-dir"
1991 DISTVER=`cat /etc/slackware-version`
1992 TAPEDRIVE="/dev/nst0"
1993 PSCMD="ps -e -o pid,command"
1995 platforms/slackware/Makefile \
1996 platforms/slackware/rc.bacula-fd \
1997 platforms/slackware/rc.bacula-sd \
1998 platforms/slackware/rc.bacula-dir\
1999 platforms/slackware/functions.bacula"
2003 TAPEDRIVE="/dev/rmt/0cbn"
2004 PSCMD="ps -e -o pid,comm"
2006 platforms/solaris/Makefile \
2007 platforms/solaris/bacula-fd \
2008 platforms/solaris/bacula-sd \
2009 platforms/solaris/bacula-dir"
2010 if test x$DISTVER = x5.6 ; then
2011 AC_DEFINE(HAVE_OLD_SOCKOPT)
2013 LIBS="$LIBS -lresolv"
2016 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
2018 TAPEDRIVE="/dev/nst0"
2019 PSCMD="ps -e -o pid,command"
2021 platforms/suse/Makefile \
2022 platforms/suse/bacula-fd \
2023 platforms/suse/bacula-sd \
2024 platforms/suse/bacula-dir \
2025 platforms/suse/bacula \
2026 platforms/suse/bacula.spec"
2031 TAPEDRIVE="/dev/nst0"
2032 PSCMD="ps -e -o pid,command"
2034 platforms/suse/Makefile \
2035 platforms/suse/bacula-fd \
2036 platforms/suse/bacula-sd \
2037 platforms/suse/bacula-dir"
2041 TAPEDRIVE="/dev/nst0"
2044 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
2050 LIBS="$PTHREAD_LIB $LIBS"
2052 AC_DEFINE_UNQUOTED(lld, "$lld")
2053 AC_DEFINE_UNQUOTED(llu, "$llu")
2061 dnl# common parts of the Makefile
2062 MCOMMON=./autoconf/Make.common
2063 AC_SUBST_FILE(MCOMMON)
2066 if test "x${subsysdir}" = "x${sbindir}" ; then
2069 echo "You have set both --sbindir and --with-subsys-dir"
2070 echo " equal to: ${subsysdir} "
2071 echo "This is not permitted. Please reconfigure."
2073 echo "Aborting configuration ..."
2079 AC_OUTPUT([autoconf/Make.common \
2082 scripts/startmysql \
2084 scripts/btraceback \
2090 scripts/bacula-ctl-dir \
2091 scripts/bacula-ctl-fd \
2092 scripts/bacula-ctl-sd \
2093 scripts/devel_bacula \
2096 scripts/bacula.desktop.gnome1 \
2097 scripts/bacula.desktop.gnome2 \
2098 scripts/bacula.desktop.gnome1.consolehelper \
2099 scripts/bacula.desktop.gnome2.consolehelper \
2100 scripts/bacula.desktop.gnome1.xsu \
2101 scripts/bacula.desktop.gnome2.xsu \
2102 scripts/bgnome-console.console_apps \
2103 scripts/mtx-changer \
2104 scripts/disk-changer \
2105 scripts/dvd-handler \
2106 scripts/dvd-simulator \
2107 scripts/bacula-tray-monitor.desktop \
2108 scripts/logwatch/Makefile \
2109 scripts/logwatch/logfile.bacula.conf \
2110 scripts/wxconsole.console_apps \
2111 scripts/wxconsole.desktop.consolehelper \
2112 scripts/wxconsole.desktop.xsu \
2113 scripts/bat.desktop \
2114 scripts/bat.desktop.xsu \
2115 scripts/bat.desktop.consolehelper \
2116 scripts/bat.console_apps \
2119 src/console/Makefile \
2120 src/console/bconsole.conf \
2121 src/gnome2-console/Makefile \
2122 src/gnome2-console/bgnome-console.conf \
2123 src/qt-console/bat.conf \
2124 src/qt-console/bat.pro \
2125 src/qt-console/install_conf_file \
2126 src/wx-console/Makefile \
2127 src/wx-console/bwx-console.conf \
2128 src/tray-monitor/Makefile \
2129 src/tray-monitor/tray-monitor.conf \
2131 src/dird/bacula-dir.conf \
2133 src/stored/Makefile \
2134 src/stored/bacula-sd.conf \
2135 src/filed/Makefile \
2136 src/filed/bacula-fd.conf \
2138 src/cats/make_catalog_backup \
2139 src/cats/delete_catalog_backup \
2140 src/cats/create_postgresql_database \
2141 src/cats/update_postgresql_tables \
2142 src/cats/make_postgresql_tables \
2143 src/cats/grant_postgresql_privileges \
2144 src/cats/drop_postgresql_tables \
2145 src/cats/drop_postgresql_database \
2146 src/cats/create_mysql_database \
2147 src/cats/update_mysql_tables \
2148 src/cats/make_mysql_tables \
2149 src/cats/grant_mysql_privileges \
2150 src/cats/drop_mysql_tables \
2151 src/cats/drop_mysql_database \
2152 src/cats/create_sqlite_database \
2153 src/cats/update_sqlite_tables \
2154 src/cats/make_sqlite_tables \
2155 src/cats/grant_sqlite_privileges \
2156 src/cats/drop_sqlite_tables \
2157 src/cats/drop_sqlite_database \
2158 src/cats/create_sqlite3_database \
2159 src/cats/update_sqlite3_tables \
2160 src/cats/make_sqlite3_tables \
2161 src/cats/grant_sqlite3_privileges \
2162 src/cats/drop_sqlite3_tables \
2163 src/cats/drop_sqlite3_database \
2166 src/cats/create_bdb_database \
2167 src/cats/update_bdb_tables \
2168 src/cats/make_bdb_tables \
2169 src/cats/grant_bdb_privileges \
2170 src/cats/drop_bdb_tables \
2171 src/cats/drop_bdb_database \
2172 src/cats/create_bacula_database \
2173 src/cats/update_bacula_tables \
2174 src/cats/grant_bacula_privileges \
2175 src/cats/make_bacula_tables \
2176 src/cats/drop_bacula_tables \
2177 src/cats/drop_bacula_database \
2178 src/findlib/Makefile \
2179 src/tools/Makefile \
2182 [(echo "Doing make of dependencies"; ${MAKE:-make} depend;) ]
2186 chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
2187 chmod 755 dvd-handler dvd-simulator
2188 chmod 755 bconsole gconsole mtx-changer devel_bacula logrotate
2193 chmod 755 $c/create_bacula_database $c/update_bacula_tables $c/make_bacula_tables
2194 chmod 755 $c/grant_bacula_privileges $c/drop_bacula_tables $c/drop_bacula_database
2196 chmod 755 $c/create_bdb_database $c/update_bdb_tables $c/make_bdb_tables
2197 chmod 755 $c/grant_bdb_privileges $c/drop_bdb_tables $c/drop_bdb_database
2199 chmod 755 $c/create_mysql_database $c/update_mysql_tables $c/make_mysql_tables
2200 chmod 755 $c/grant_mysql_privileges $c/drop_mysql_tables $c/drop_mysql_database
2202 chmod 755 $c/create_sqlite_database $c/update_sqlite_tables $c/make_sqlite_tables
2203 chmod 755 $c/grant_sqlite_privileges $c/drop_sqlite_tables $c/drop_sqlite_database
2205 chmod 755 $c/create_sqlite3_database $c/update_sqlite3_tables $c/make_sqlite3_tables
2206 chmod 755 $c/grant_sqlite3_privileges $c/drop_sqlite3_tables $c/drop_sqlite3_database
2208 chmod 755 $c/create_postgresql_database $c/update_postgresql_tables $c/make_postgresql_tables
2209 chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables $c/drop_postgresql_database
2211 chmod 755 $c/make_catalog_backup $c/delete_catalog_backup
2215 chmod 755 src/win32/build-depkgs-mingw32
2217 if test "${support_bat}" = "yes" ; then
2220 chmod 755 install_conf_file build-depkgs-qt-console
2221 echo "Creating bat Makefile"
2226 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
2227 largefile_support="yes"
2231 # A whole lot of hand springs to get the compiler version.
2232 # This is because gcc changed the output in version 3.0
2234 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
2235 if test "x${CCVERSION}" = "x" ; then
2236 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
2238 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
2239 if test x"${CXXVERSION}" = x ; then
2240 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
2243 if test "x${subsysdir}" = "x${sbindir}" ; then
2246 echo "You have set --sbindir and --with-subsys-dir"
2247 echo " both equal to: ${subsysdir} "
2248 echo " This is not permitted. Please reconfigure."
2250 echo "Aborting configuration ..."
2256 if test "x${db_type}" = "xInternal" ; then
2259 echo "You have not specified either --enable-client-only or one of the"
2260 echo " supported databases: MySQL, PostgreSQL, SQLite3 or SQLite."
2261 echo " This is not permitted. Please reconfigure."
2263 echo "Aborting the configuration ..."
2270 Configuration on `date`:
2272 Host: $host -- ${DISTNAME} ${DISTVER}
2273 Bacula version: ${VERSION} (${DATE})
2274 Source code location: ${srcdir}
2275 Install binaries: ${sbindir}
2276 Install config files: ${sysconfdir}
2277 Scripts directory: ${scriptdir}
2278 Working directory: ${working_dir}
2279 PID directory: ${piddir}
2280 Subsys directory: ${subsysdir}
2281 Man directory: ${mandir}
2282 Data directory: ${datadir}
2283 C Compiler: ${CC} ${CCVERSION}
2284 C++ Compiler: ${CXX} ${CXXVERSION}
2285 Compiler flags: ${WCFLAGS} ${CFLAGS}
2286 Linker flags: ${WLDFLAGS} ${LDFLAGS}
2288 Statically Linked Tools: ${support_static_tools}
2289 Statically Linked FD: ${support_static_fd}
2290 Statically Linked SD: ${support_static_sd}
2291 Statically Linked DIR: ${support_static_dir}
2292 Statically Linked CONS: ${support_static_cons}
2293 Database type: ${db_type}
2294 Database lib: ${DB_LIBS}
2295 Database name: ${db_name}
2296 Database user: ${db_user}
2298 Job Output Email: ${job_email}
2299 Traceback Email: ${dump_email}
2300 SMTP Host Address: ${smtp_host}
2302 Director Port: ${dir_port}
2303 File daemon Port: ${fd_port}
2304 Storage daemon Port: ${sd_port}
2306 Director User: ${dir_user}
2307 Director Group: ${dir_group}
2308 Storage Daemon User: ${sd_user}
2309 Storage DaemonGroup: ${sd_group}
2310 File Daemon User: ${fd_user}
2311 File Daemon Group: ${fd_group}
2313 SQL binaries Directory ${SQL_BINDIR}
2315 Large file support: $largefile_support
2316 Bacula conio support: ${got_conio} ${CONS_LIBS}
2317 readline support: ${got_readline} ${PRTREADLINE_SRC}
2318 TCP Wrappers support: ${TCPW_MSG} ${WRAPLIBS}
2319 TLS support: ${support_tls}
2320 Encryption support: ${support_crypto}
2321 ZLIB support: ${have_zlib}
2322 enable-smartalloc: ${support_smartalloc}
2323 enable-bat: ${support_bat}
2324 enable-gnome: ${support_gnome} ${gnome_version}
2325 enable-bwx-console: ${support_wx_console} ${wx_version}
2326 enable-tray-monitor: ${support_tray_monitor}
2327 client-only: ${build_client_only}
2328 build-dird: ${build_dird}
2329 build-stored: ${build_stored}
2330 ACL support: ${have_acl}
2331 Python support: ${support_python} ${PYTHON_LIBS}
2332 Batch insert enabled: ${support_batch_insert}