3 dnl# Process this file with autoconf to produce a configure script.
12 AC_CONFIG_AUX_DIR(${BUILD_DIR}/autoconf)
13 AC_CONFIG_HEADER(src/config.h:autoconf/config.h.in)
15 dnl require a recent autoconf
19 dnl search for true and false programs.
20 AC_PATH_PROGS(TRUEPRG, true, :)
21 AC_PATH_PROGS(FALSEPRG, false, :)
25 VERSION=`sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
26 DATE=`sed -n -e 's/^.*[ \t]*BDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
27 LSMDATE=`sed -n -e 's/^.*LSMDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
31 echo "configuring for bacula $VERSION ($DATE)"
34 dnl -------------------------------------------------------
35 dnl# Check for compiler.
36 dnl ------------------------------------------------------
40 AC_PROG_CC_C_O dnl Determine if C compiler support -c -o.
41 AC_PROG_GCC_TRADITIONAL dnl Determine if ioctl() need -traditional.
45 if test "x$BASECC" = xgcc; then
49 AC_PATH_PROG(CXX, $CXX, $CXX)
50 if test ! -e $CXX; then
51 AC_MSG_ERROR(Unable to find C++ compiler)
54 dnl -------------------------------------------------------
55 dnl# Check for programs.
56 dnl ------------------------------------------------------
59 AC_PATH_PROG(MV, mv, mv)
60 AC_PATH_PROG(RM, rm, rm)
61 AC_PATH_PROG(CP, cp, cp)
62 AC_PATH_PROG(SED, sed, sed)
63 AC_PATH_PROG(ECHO, echo, echo)
64 AC_PATH_PROG(CMP, cmp, cmp)
65 AC_PATH_PROG(TBL, tbl, tbl)
66 AC_PATH_PROG(AR, ar, ar)
67 dnl AC_PATH_PROG(RANLIB, ranlib, ranlib)
68 AC_PATH_PROG(OPENSSL, openssl, none)
69 AC_PATH_PROG(MTX, mtx, mtx)
70 AC_PATH_PROG(DD, dd, dd)
71 AC_PATH_PROG(MKISOFS, mkisofs, mkisofs)
72 AC_PATH_PROG(PYTHON, python, python)
73 AC_PATH_PROG(GROWISOFS, growisofs, growisofs)
74 AC_PATH_PROG(DVDRWMEDIAINFO, dvd+rw-mediainfo, dvd+rw-mediainfo)
75 AC_PATH_PROG(DVDRWFORMAT, dvd+rw-format, dvd+rw-format)
76 AC_PATH_PROG(PKGCONFIG, pkg-config, pkg-config)
77 AC_PATH_PROG(QMAKE, qmake, none)
78 AC_PATH_PROG(QMAKEQT4, qmake-qt4, none)
79 AC_ARG_VAR(WXCONFIG, [wx-config command. On some systems, you must set it to wx-config-2.6 to use wxWidgets 2.6.])
80 if test "x$WXCONFIG" = x; then
83 AC_PATH_PROG(WXCONFIG, ${WXCONFIG}, ${WXCONFIG})
84 AC_ARG_VAR(WXFLAGS, [Parameters to pass to wx-config (e.g. --unicode=no).])
85 AC_PATH_PROG(CDRECORD, cdrecord, cdrecord)
86 AC_PATH_PROG(PIDOF, pidof, pidof)
88 # Some AWK programs fail, so test it and warn the user
89 if echo xfoo | $AWK 'BEGIN { prog=ARGV[1]; ARGC=1 }
90 { if ((prog == $2) || (("(" prog ")") == $2) ||
91 (("[" prog "]") == $2) ||
92 ((prog ":") == $2)) { print $1 ; exit 0 } }' xfoo>/dev/null; then :;
94 AC_MSG_ERROR([!!!!!!!!! WARNING !!!!!!!!!!!!!!
95 The regex engine of $AWK is too broken to be used you
96 might want to install GNU AWK.
97 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!])
100 AC_PATH_PROG(AWK, $THE_AWK, $THE_AWK)
103 test -n "$ARFLAG" || ARFLAGS="cr"
110 AC_SUBST(LOCAL_CFLAGS)
111 AC_SUBST(LOCAL_LDFLAGS)
114 dnl --------------------------------------------------
115 dnl Bacula OP Sys determination (see aclocal.m4)
116 dnl --------------------------------------------------
119 # -----------------------------------------------------------
120 dnl Bacula OPSys Distribution determination (see aclocal.m4)
121 # ----------------------------------------------------------
122 BA_CHECK_OPSYS_DISTNAME
124 # --------------------------------------------------
125 # Suppport for gettext (translations)
126 # By default, $datadir is ${prefix}/share
127 # --------------------------------------------------
128 AM_GNU_GETTEXT([external])
129 if test x${prefix} = xNONE ; then
130 if test `eval echo ${datadir}` = NONE/share ; then
135 # ------------------------------------------------------------------
136 # If the user has not set --prefix, we set our default to nothing.
137 # In this case, if the user has not set --sysconfdir, we set it
138 # to the package default of /etc/bacula. If either --prefix or
139 # --sysconfdir is set, we leave sysconfdir alone except to eval it.
140 # ------------------------------------------------------------------
141 if test x${prefix} = xNONE ; then
142 if test `eval echo ${sysconfdir}` = NONE/etc ; then
143 sysconfdir=/etc/bacula
147 sysconfdir=`eval echo ${sysconfdir}`
148 datadir=`eval echo ${datadir}`
149 localedir=`eval echo ${datadir}/locale`
150 AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir")
151 AC_DEFINE_UNQUOTED(SYSCONFDIR, "$sysconfdir")
153 # -------------------------------------------------------------------------
154 # If the user has not set --exec-prefix, we default to ${prefix}
155 # -------------------------------------------------------------------------
156 if test x${exec_prefix} = xNONE ; then
157 exec_prefix=${prefix}
160 # ------------------------------------------------------------------
161 # If the user has not set --sbindir, we set our default as /sbin
162 # ------------------------------------------------------------------
163 if test x$sbindir = x'${exec_prefix}/sbin' ; then
164 sbindir=${exec_prefix}/sbin
166 sbindir=`eval echo ${sbindir}`
169 # -------------------------------------------------------------------------
170 # If the user has not set --mandir, we default to /usr/share/man
171 # -------------------------------------------------------------------------
172 if test x$mandir = x'${prefix}/man' ; then
173 mandir=/usr/share/man
177 AC_PATH_PROGS(MSGFMT, msgfmt, no)
178 if test "$MSGFMT" = "no"
180 echo 'msgfmt program not found, disabling NLS !'
182 USE_INCLUDED_LIBINTL=no
191 support_postgresql=no
192 support_smartalloc=yes
197 support_wx_console=no
202 support_static_tools=no
205 support_static_dir=no
206 support_static_cons=no
215 dnl# --------------------------------------------------------------------------
216 dnl# CHECKING COMMAND LINE OPTIONS
217 dnl# --------------------------------------------------------------------------
219 # -------------------------------------------
220 # gnome (default off)
221 # -------------------------------------------
223 [ --enable-gnome enable build of bgnome-console GUI [disabled]],
224 [if test x$enableval = xyes; then
229 if test x$support_gnome = xyes; then
230 abc=`$PKGCONFIG --exists libgnomeui-2.0`
232 if test $pkg = 0; then
233 GNOME_INCLUDEDIR=`$PKGCONFIG --cflags-only-I libgnomeui-2.0`
234 GNOMEUI_LIBS=`$PKGCONFIG --libs-only-l libgnomeui-2.0`
235 GNOME_LIBDIR=`$PKGCONFIG --libs libgnomeui-2.0`
236 GNOME_LIBS=`$PKGCONFIG --libs-only-l libgnomeui-2.0`
237 AC_SUBST(GNOME_INCLUDEDIR)
238 AC_SUBST(GNOMEUI_LIBS)
239 AC_SUBST(GNOME_LIBDIR)
241 GNOME_DIR=src/gnome2-console
242 gnome_version="Version 2.x"
244 AC_MSG_ERROR(Unable to find Gnome 2 installation)
249 # -------------------------------------------
251 # -------------------------------------------
253 [ --enable-bat enable build of bat Qt4 GUI [disabled]],
254 [if test x$enableval = xyes; then
255 AC_DEFINE(HAVE_BAT, 1, [Set if Bacula bat Qt4 GUI support enabled])
260 if test x$support_bat = xyes; then
261 abc=`$PKGCONFIG --atleast-version=4.2 QtGui`
263 if test $pkg = 0; then
264 BAT_DIR=src/qt-console
266 AC_MSG_ERROR(Unable to find Qt4 installation needed by bat)
271 # If bat is enabled, we need the qwt library
275 if test x$support_bat = xyes; then
276 AC_MSG_CHECKING(for qwt support)
278 [ --with-qwt@<:@=DIR@:>@ specify qwt library directory],
284 if test -f ${with_qwt}/include/qwt.h; then
285 QWT_INC="${with_qwt}/include"
286 QWT_LDFLAGS="-L${with_qwt}/lib"
293 # Search in standard places, or --with-qwt not specified
295 if test x$QWT_INC = x; then
296 for root in /usr /usr/local; do
297 for ver in qwt qwt5 qwt-qt4; do
298 if test -f ${root}/include/${ver}/qwt.h; then
299 QWT_INC="${root}/include/${ver}"
300 if test -d ${root}/lib64/; then
301 QWT_LDFLAGS="-L${root}/lib64"
303 QWT_LDFLAGS="-L${root}/lib"
311 if test x$QWT_INC = x; then
313 AC_MSG_ERROR(Unable to find qwt package needed by bat)
323 AC_SUBST(QWT_LDFLAGS)
326 # -------------------------------------------
327 # bwx-console (default off)
328 # -------------------------------------------
329 AC_ARG_ENABLE(bwx-console,
330 [ --enable-bwx-console enable build of wxWidgets console [disabled]],
331 [if test x$enableval = xyes; then
332 support_wx_console=yes
336 if test x$support_wx_console = xyes; then
337 abc=`$WXCONFIG $WXFLAGS --cppflags`
339 if test $pkg = 0; then
340 wx_version="wxWidgets `$WXCONFIG $WXFLAGS --release`"
341 WXCONS_CPPFLAGS=`$WXCONFIG $WXFLAGS --cppflags`
342 WXCONS_LDFLAGS=`$WXCONFIG $WXFLAGS --libs`
344 AC_SUBST(WXCONS_CPPFLAGS)
345 AC_SUBST(WXCONS_LDFLAGS)
346 WX_DIR=src/wx-console
349 echo "wx-config program not found. bwx-console disabled."
351 support_wx_console=no
357 # -------------------------------------------
358 # tray-monitor (default off)
359 # -------------------------------------------
360 AC_ARG_ENABLE(tray-monitor,
361 [ --enable-tray-monitor enable build of Gnome tray monitor (compatible with KDE) [disabled]],
362 [if test x$enableval = xyes; then
363 support_tray_monitor=yes
367 if test x$support_tray_monitor = xyes; then
368 abc=`$PKGCONFIG --exists gtk+-2.0`
370 if test $pkg = 0; then
371 TRAY_MONITOR_CPPFLAGS=`$PKGCONFIG --cflags gtk+-2.0`
372 TRAY_MONITOR_LDFLAGS=`$PKGCONFIG --libs gtk+-2.0`
373 AC_SUBST(TRAY_MONITOR_CPPFLAGS)
374 AC_SUBST(TRAY_MONITOR_LDFLAGS)
375 TRAY_MONITOR_DIR=src/tray-monitor
376 abc=`$PKGCONFIG --atleast-version=2.4 gtk+-2.0`
378 if test $pkg = 0; then
379 AC_DEFINE(HAVE_GTK_2_4, 1, [Set if you have GTK 4.2 or greater loaded])
383 AC_SUBST(TRAY_MONITOR_DIR)
385 # -------------------------------------------
386 # smartalloc (default off)
387 # -------------------------------------------
388 AC_ARG_ENABLE(smartalloc,
389 [ --enable-smartalloc enable smartalloc debugging support [disabled]],
390 [if test x$enableval = xno; then
391 support_smartalloc=no
394 if test x$support_smartalloc = xyes; then
395 AC_DEFINE(SMARTALLOC, 1, [Set if you want Smartalloc enabled])
398 # -------------------------------------------
399 # static-tools (default off)
400 # -------------------------------------------
401 AC_ARG_ENABLE(static-tools,
402 [ --enable-static-tools enable static tape tools [disabled]],
403 [if test x$enableval = xyes; then
404 support_static_tools=yes
408 if test x$support_static_tools = xyes; then
409 TTOOL_LDFLAGS="-static"
411 AC_SUBST(TTOOL_LDFLAGS)
413 # -------------------------------------------
414 # static-fd (default off)
415 # -------------------------------------------
416 AC_ARG_ENABLE(static-fd,
417 [ --enable-static-fd enable static File daemon [disabled]],
418 [if test x$enableval = xyes; then
419 support_static_fd=yes
423 if test x$support_static_fd = xyes; then
424 STATIC_FD="static-bacula-fd"
428 # -------------------------------------------
429 # static-sd (default off)
430 # -------------------------------------------
431 AC_ARG_ENABLE(static-sd,
432 [ --enable-static-sd enable static Storage daemon [disabled]],
433 [if test x$enableval = xyes; then
434 support_static_sd=yes
438 if test x$support_static_sd = xyes; then
439 STATIC_SD="static-bacula-sd"
443 # -------------------------------------------
444 # static-dir (default off)
445 # -------------------------------------------
446 AC_ARG_ENABLE(static-dir,
447 [ --enable-static-dir enable static Director [disabled]],
448 [if test x$enableval = xyes; then
449 support_static_dir=yes
453 if test x$support_static_dir = xyes; then
454 STATIC_DIR="static-bacula-dir"
458 # -------------------------------------------
459 # static-cons (default off)
460 # -------------------------------------------
461 AC_ARG_ENABLE(static-cons,
462 [ --enable-static-cons enable static Console [disabled]],
463 [if test x$enableval = xyes; then
464 support_static_cons=yes
470 if test x$support_static_cons = xyes; then
471 STATIC_CONS="static-bconsole"
472 STATIC_GNOME_CONS="static-bgnome-console"
473 STATIC_WX_CONS="static-bwx-console"
475 AC_SUBST(STATIC_CONS)
476 AC_SUBST(STATIC_GNOME_CONS)
477 AC_SUBST(STATIC_WX_CONS)
479 # -------------------------------------------
480 # client_only (default off)
481 # -------------------------------------------
482 AC_ARG_ENABLE(client-only,
483 [ --enable-client-only build client (File daemon) only [disabled]],
484 [if test x$enableval = xyes; then
485 build_client_only=yes
489 if test x$build_client_only = xno; then
496 # -------------------------------------------
497 # director (default on)
498 # -------------------------------------------
499 AC_ARG_ENABLE(build-dird,
500 [ --enable-build-dird enable building of dird (Director) [enabled]],
501 [if test x$enableval = xno; then
504 if test x$build_dird = xyes; then
509 DIR_TOOLS="NODIRTOOLS"
514 # -------------------------------------------
515 # stored (default on)
516 # -------------------------------------------
517 AC_ARG_ENABLE(build-stored,
518 [ --enable-build-stored enable building of stored (Storage daemon) [enabled]],
519 [if test x$enableval = xno; then
522 if test x$build_stored = xyes; then
523 STORED_DIR="src/stored"
529 # ---------------------------------------------------
530 # Check for conio (Bacula readline substitute)(
531 # ---------------------------------------------------
532 # this allows you to turn it completely off
534 [ --disable-conio disable conio support [enabled]
536 [if test x$enableval = xno; then
542 # ---------------------------------------------------
543 # Check for IPv6 support
544 # ---------------------------------------------------
545 # this allows you to turn it completely off
548 [ --enable-ipv6 enable ipv6 support [enabled]
550 [if test x$enableval = xno; then
555 if test x$support_ipv6 = xyes; then
556 AC_TRY_LINK([ #include <sys/types.h>
557 #include <sys/socket.h>
558 #include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;],
559 [support_ipv6=yes], [support_ipv6=no])
562 if test x$support_ipv6 = xyes; then
563 AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
569 if test x$support_conio = xyes; then
570 AC_CHECK_HEADER(termcap.h,
571 [ AC_CHECK_LIB(termcap, tgetent,
572 [ CONS_LIBS="-ltermcap"
577 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
579 [ AC_CHECK_LIB(ncurses, tgetent,
580 [ CONS_LIBS="-lncurses"
585 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
590 AC_CHECK_HEADERS(curses.h)
591 AC_CHECK_HEADER(term.h,
592 [ AC_CHECK_LIB(curses, tgetent,
593 [ CONS_LIBS="-lcurses"
598 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
601 [ echo " "; echo "Required libraries not found. CONIO turned off ..."; echo " "],
610 # ---------------------------------------------------
611 # Check for readline support/directory (default off)
612 # ---------------------------------------------------
613 # this allows you to turn it completely off
614 AC_ARG_ENABLE(readline,
615 [ --disable-readline disable readline support [disable]
617 [if test x$enableval = xno; then
623 if test x$support_readline = xyes; then
624 AC_ARG_WITH(readline,
625 [ --with-readline@<:@=DIR@:>@ specify readline library directory],
627 case "$with_readline" in
630 if test -f ${with_readline}/readline.h; then
631 CONS_INC="-I${with_readline}"
632 CONS_LDFLAGS="-L$with_readline"
633 elif test -f ${with_readline}/include/readline/readline.h; then
634 CONS_INC="-I${with_readline}/include/readline"
635 CONS_LDFLAGS="-L${with_readline}/lib"
636 with_readline="${with_readline}/include/readline"
638 with_readline="/usr/include/readline"
640 AC_CHECK_HEADER(${with_readline}/readline.h,
641 [ AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
642 CONS_LIBS="-lreadline -lhistory -ltermcap"
646 echo "readline.h not found. readline turned off ..."
653 # check for standard readline library
654 AC_CHECK_HEADER(/usr/include/readline/readline.h,
655 [ AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
657 CONS_INC="-I/usr/include/readline"
658 CONS_LIBS="-lreadline -ltermcap"
660 # Did not find standard library, so try Bacula's default
661 AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h,
662 [ AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
664 CONS_INC="-I${TOP_DIR}/depkgs/readline"
665 CONS_LIBS="-lreadline -lhistory -ltermcap"
666 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
667 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
670 echo "readline.h not found. readline turned off ..."
686 AC_SUBST(CONS_LDFLAGS)
687 AC_SUBST(READLINE_SRC)
689 # Minimal stuff for readline Makefile configuration
694 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr lstat lchown)
695 AC_CHECK_FUNCS(nanosleep nl_langinfo)
696 AC_CHECK_HEADERS(varargs.h)
698 # End of readline/conio stuff
699 # -----------------------------------------------------------------------
701 # -----------------------------------------------------------------------
702 # Check for Python support
704 AC_MSG_CHECKING(for Python support)
707 --with-python@<:@=DIR@:>@ Include Python support. DIR is the Python base
708 install directory, default is to search through
709 a number of common places for the Python files.],
713 if test "$withval" != "no"; then
714 if test "$withval" = "yes"; then
715 for python_root in /usr /usr/local /usr/sfw; do
716 for ver in python2.2 python2.3 python2.4 python2.5; do
717 if test -f $python_root/include/${ver}/Python.h; then
718 PYTHON_INCDIR=-I$python_root/include/${ver}
719 if test -d $python_root/lib64/${ver}/config; then
720 PYTHON_LIBS="-L$python_root/lib64/${ver}/config -l${ver}"
722 PYTHON_LIBS="-L$python_root/lib/${ver}/config -l${ver}"
728 if test x$PYTHON_INCDIR = x; then
729 if test -f $prefix/include/Python.h; then
730 PYTHON_INCDIR=-I$prefix/include
731 if test -d $prefix/lib64/config; then
732 PYTHON_LIBS="-L$prefix/lib64/config -lpython"
734 PYTHON_LIBS="-L$prefix/lib/config -lpython"
738 AC_MSG_ERROR(Unable to find Python.h in standard locations)
742 if test -f $withval/Python.h; then
743 PYTHON_INCDIR=-I$withval
744 PYTHON_LIBS="-L$withval/config -lpython"
745 elif test -f $withval/include/Python.h; then
746 PYTHON_INCDIR=-I$withval/include
747 if test -d $withval/lib64/config; then
748 PYTHON_LIBS="-L$withval/lib64/config -lpython"
750 PYTHON_LIBS="-L$withval/lib/config -lpython"
752 elif test -f $withval/include/python/Python.h; then
753 PYTHON_INCDIR=-I$withval/include/python
754 if test -d $withval/lib64/python/config; then
755 PYTHON_LIBS="-L$withval/lib64/python/config -lpython"
757 PYTHON_LIBS="-L$withval/lib/python/config -lpython"
761 AC_MSG_ERROR(Invalid Python directory $withval - unable to find Python.h under $withval)
764 AC_DEFINE([HAVE_PYTHON], 1)
767 AC_MSG_NOTICE(checking for more Python libs)
768 saved_LIBS="$LIBS"; LIBS=
769 AC_SEARCH_LIBS(shm_open, [rt])
770 AC_CHECK_LIB(util, openpty)
771 PYTHON_LIBS="$PYTHON_LIBS $LIBS"
779 AC_SUBST(PYTHON_LIBS)
780 AC_SUBST(PYTHON_INCDIR)
783 # Find where sockets are (especially for Solaris)
784 # Do this before the TCP Wrappers test since tcp wrappers
785 # uses the socket library and some linkers are stupid.
787 AC_CHECK_FUNC(socket,
788 AC_MSG_RESULT(using libc's socket),
789 AC_CHECK_LIB(xnet,socket)
790 AC_CHECK_LIB(socket,socket)
791 AC_CHECK_LIB(inet,socket))
794 # -----------------------------------------------------------
795 # Check whether user wants TCP wrappers support (default off)
796 # -----------------------------------------------------------
799 AC_ARG_WITH(tcp-wrappers,
800 [ --with-tcp-wrappers@<:@=DIR@:>@ enable tcpwrappers support],
802 if test "x$withval" != "xno" ; then
804 LIBS="$saved_LIBS -lwrap"
805 AC_MSG_CHECKING(for libwrap)
806 AC_SEARCH_LIBS(nanosleep, [rt])
808 [ #include <sys/types.h>
810 int deny_severity = 0;
811 int allow_severity = 0;
812 struct request_info *req; ],
813 [ hosts_access(req); ],
816 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
821 LIBS="$saved_LIBS -lwrap -lnsl"
822 WRAPLIBS="$saved_LIBS -lwrap -lnsl"
824 [ #include <sys/types.h>
826 int deny_severity = 0;
827 int allow_severity = 0;
828 struct request_info *req; ],
829 [ hosts_access(req); ],
832 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
837 [AC_MSG_ERROR([*** libwrap missing]) ] ]
844 # -----------------------------------------------------------
845 # Check whether OpenSSL is available
846 # -----------------------------------------------------------
847 AC_MSG_CHECKING([for OpenSSL])
848 dnl The following uses quadrigraphs:
852 AC_HELP_STRING([--with-openssl@<:@=DIR@:>@], [Include OpenSSL support. DIR is the OpenSSL base]),
853 [with_openssl_directory=${withval}])
855 if test "x$with_openssl_directory" != "x"; then
856 OPENSSL_LIBS="-lssl -lcrypto"
859 if test "x$with_openssl_directory" != "xyes" && test x"${with_openssl_directory}" != "x"; then
860 OPENSSL_LIBS="-L$with_openssl_directory/lib $OPENSSL_LIBS"
861 OPENSSL_INC="-I$with_openssl_directory/include $OPENSSL_INC"
865 saved_CFLAGS="${CFLAGS}"
866 LIBS="${saved_LIBS} ${OPENSSL_LIBS}"
867 CFLAGS="${saved_CFLAGS} ${OPENSSL_INC}"
869 AC_TRY_LINK([ #include <openssl/ssl.h> ],
870 [ CRYPTO_set_id_callback(NULL); ],
878 AC_TRY_LINK([ #include <openssl/evp.h> ],
880 [ ac_cv_openssl_sha2="yes" ],
881 [ ac_cv_openssl_sha2="no" ]
884 # Solaris disables greater than 128+ bit encryption in their OpenSSL
885 # implementation, presumably for export reasons. If 192bit AES
886 # is available, we assume that we're running with a 'non-export'
888 AC_TRY_LINK([ #include <openssl/evp.h> ],
889 [ EVP_aes_192_cbc(); ],
890 [ ac_cv_openssl_export="no" ],
891 [ ac_cv_openssl_export="yes" ]
895 CFLAGS="${saved_CFLAGS}"
897 if test "$support_tls" = "yes"; then
898 AC_DEFINE(HAVE_OPENSSL, 1, [Define if OpenSSL library is available])
899 AC_DEFINE(HAVE_TLS, 1, [Define if TLS support should be enabled])
900 AC_DEFINE(HAVE_CRYPTO, 1, [Define if encryption support should be enabled])
903 if test "$ac_cv_openssl_sha2" = "yes"; then
904 AC_DEFINE(HAVE_SHA2, 1, [Define if the SHA-2 family of digest algorithms is available])
907 if test "$ac_cv_openssl_export" = "yes"; then
908 AC_DEFINE(HAVE_OPENSSL_EXPORT_LIBRARY, 1, [Define if the OpenSSL library is export-contrained to 128bit ciphers])
917 AC_MSG_RESULT([$support_tls])
918 AC_SUBST(OPENSSL_LIBS)
919 AC_SUBST(OPENSSL_INC)
922 # -----------------------------------------------------------
923 # Python and OpenSSL are using dlopen
924 # -----------------------------------------------------------
926 if test "$support_python" = "yes" -o "$support_tls" = "yes"; then
927 AC_SEARCH_LIBS(dlopen, [dl])
930 # ------------------------------------------
931 # Where to place working dir
932 # ------------------------------------------
933 working_dir=`eval echo ${prefix}/var/bacula/working`
934 AC_ARG_WITH(working-dir,
935 [ --with-working-dir=PATH specify path of Bacula working directory],
937 if test "x$withval" != "xno" ; then
943 AC_SUBST(working_dir)
945 # ------------------------------------------------------------------
946 # If the user has not set archivedir, we set our default as /tmp
947 # ------------------------------------------------------------------
949 AC_ARG_WITH(archivedir,
950 [ --with-archivedir=PATH specify path of SD archive directory],
952 if test "x$withval" != "xno" ; then
962 # ------------------------------------------
963 # Where to place scriptdir (script files)
964 # ------------------------------------------
965 scriptdir=`eval echo ${sysconfdir}`
966 AC_ARG_WITH(scriptdir,
967 [ --with-scriptdir=PATH specify path of Bacula scripts directory],
969 if test "x$withval" != "xno" ; then
978 # ------------------------------------------
979 # Where to send dump email
980 # ------------------------------------------
981 dump_email=root@localhost
982 AC_ARG_WITH(dump-email,
983 [ --with-dump-email=EMAIL dump email address],
985 if test "x$withval" != "xno" ; then
993 # ------------------------------------------
994 # Where to send job email
995 # ------------------------------------------
996 job_email=root@localhost
997 AC_ARG_WITH(job-email,
998 [ --with-job-email=EMAIL job output email address],
1000 if test "x$withval" != "xno" ; then
1008 # ------------------------------------------
1009 # Where to find smtp host
1010 # ------------------------------------------
1012 AC_ARG_WITH(smtp_host,
1013 [ --with-smtp-host=HOST SMTP mail host address],
1015 if test "x$withval" != "xno" ; then
1024 # ------------------------------------
1025 # Where to place pid files
1026 # ------------------------------------
1028 AC_ARG_WITH(pid-dir,
1029 [ --with-pid-dir=PATH specify location of Bacula pid files],
1031 if test "x$withval" != "xno" ; then
1037 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
1041 # ------------------------------------
1042 # Where to place subsys "lock file"
1043 # ------------------------------------
1044 subsysdir=/var/run/subsys
1045 if test -d /var/run/subsys; then
1046 subsysdir=/var/run/subsys
1047 elif test -d /var/lock/subsys; then
1048 subsysdir=/var/lock/subsys
1050 subsysdir=/var/run/subsys
1052 AC_ARG_WITH(subsys-dir,
1053 [ --with-subsys-dir=PATH specify location of Bacula subsys file],
1055 if test "x$withval" != "xno" ; then
1065 # ------------------------------------
1066 # Where to start assigning ports
1067 # ------------------------------------
1069 AC_ARG_WITH(baseport,
1070 [ --with-baseport=PORT specify base port address for daemons],
1072 if test "x$withval" != "xno" ; then
1079 dir_port=`expr $baseport`
1080 fd_port=`expr $baseport + 1`
1081 sd_port=`expr $fd_port + 1`
1088 # ------------------------------------------
1089 # Generate passwords
1090 # ------------------------------------------
1092 AC_ARG_WITH(dir-password,
1093 [ --with-dir-password=PASSWORD specify Director's password],
1095 if test "x$withval" != "xno" ; then
1096 dir_password=$withval
1101 if test "x$dir_password" = "x" ; then
1102 if test "x$OPENSSL" = "xnone" ; then
1103 key=`autoconf/randpass 33`
1105 key=`openssl rand -base64 33`
1111 AC_ARG_WITH(fd-password,
1112 [ --with-fd-password=PASSWORD specify Client's password],
1114 if test "x$withval" != "xno" ; then
1115 fd_password=$withval
1120 if test "x$fd_password" = "x" ; then
1121 if test "x$OPENSSL" = "xnone" ; then
1122 key=`autoconf/randpass 37`
1124 key=`openssl rand -base64 33`
1130 AC_ARG_WITH(sd-password,
1131 [ --with-sd-password=PASSWORD specify Storage daemon's password],
1133 if test "x$withval" != "xno" ; then
1134 sd_password=$withval
1139 if test "x$sd_password" = "x" ; then
1140 if test "x$OPENSSL" = "xnone" ; then
1141 key=`autoconf/randpass 41`
1143 key=`openssl rand -base64 33`
1149 AC_ARG_WITH(mon-dir-password,
1150 [ --with-mon-dir-password=PASSWORD specify Director's password used by the monitor],
1152 if test "x$withval" != "xno" ; then
1153 mon_dir_password=$withval
1158 if test "x$mon_dir_password" = "x" ; then
1159 if test "x$OPENSSL" = "xnone" ; then
1160 key=`autoconf/randpass 33`
1162 key=`openssl rand -base64 33`
1164 mon_dir_password=$key
1168 AC_ARG_WITH(mon-fd-password,
1169 [ --with-mon-fd-password=PASSWORD specify Client's password used by the monitor],
1171 if test "x$withval" != "xno" ; then
1172 mon_fd_password=$withval
1177 if test "x$mon_fd_password" = "x" ; then
1178 if test "x$OPENSSL" = "xnone" ; then
1179 key=`autoconf/randpass 37`
1181 key=`openssl rand -base64 33`
1183 mon_fd_password=$key
1187 AC_ARG_WITH(mon-sd-password,
1188 [ --with-mon-sd-password=PASSWORD specify Storage daemon's password used by the monitor],
1190 if test "x$withval" != "xno" ; then
1191 mon_sd_password=$withval
1196 if test "x$mon_sd_password" = "x" ; then
1197 if test "x$OPENSSL" = "xnone" ; then
1198 key=`autoconf/randpass 41`
1200 key=`openssl rand -base64 33`
1202 mon_sd_password=$key
1205 AC_SUBST(dir_password)
1206 AC_SUBST(fd_password)
1207 AC_SUBST(sd_password)
1208 AC_SUBST(mon_dir_password)
1209 AC_SUBST(mon_fd_password)
1210 AC_SUBST(mon_sd_password)
1213 # Pickup any database name
1216 AC_ARG_WITH(db_name,
1217 [ --with-db-name=DBNAME specify database name (default bacula)],
1219 if test "x$withval" != "x" ; then
1227 AC_ARG_WITH(db_user,
1228 [ --with-db-user=UNAME specify database user (default bacula)],
1230 if test "x$withval" != "x" ; then
1239 # Handle users and groups for each daemon
1242 AC_ARG_WITH(dir_user,
1243 [ --with-dir-user=USER specify user for Director daemon],
1245 if test "x$withval" != "x" ; then
1252 AC_ARG_WITH(dir_group,
1253 [ --with-dir-group=GROUP specify group for Director daemon],
1255 if test "x$withval" != "x" ; then
1262 AC_ARG_WITH(sd_user,
1263 [ --with-sd-user=USER specify user for Storage daemon],
1265 if test "x$withval" != "x" ; then
1272 AC_ARG_WITH(sd_group,
1273 [ --with-sd-group=GROUP specify group for Storage daemon],
1275 if test "x$withval" != "x" ; then
1282 AC_ARG_WITH(fd_user,
1283 [ --with-fd-user=USER specify user for File daemon],
1285 if test "x$withval" != "x" ; then
1292 AC_ARG_WITH(fd_group,
1293 [ --with-fd-group=GROUP specify group for File daemon],
1295 if test "x$withval" != "x" ; then
1309 # allow setting default executable permissions
1312 AC_ARG_WITH(sbin-perm,
1313 [ --with-sbin-perm=MODE specify permissions for sbin binaries (0754)],
1315 if test "x$withval" != "x" ; then
1323 # ------------------------------------------------
1324 # Bacula check for various SQL database engines
1325 # ------------------------------------------------
1327 BA_CHECK_POSTGRESQL_DB
1338 # -------------------------------------------
1339 # enable batch attribute DB insert (default on)
1340 # -------------------------------------------
1341 support_batch_insert=no
1342 A=`nm $SQL_LIB | grep pthread_mutex_lock`
1344 if test $pkg = 0; then
1345 support_batch_insert=yes
1346 AC_ARG_ENABLE(batch-insert,
1347 [ --enable-batch-insert enable the DB batch insert code [disabled]],
1348 [if test x$enableval = xno; then
1349 support_batch_insert=no
1351 support_batch_insert=yes
1355 # Check if postgresql support batch mode
1356 if test x$DB_TYPE = xpostgresql; then
1357 A=`nm $SQL_LIB | grep PQputCopyData`
1359 if test $pkg != 0; then
1360 support_batch_insert=no
1364 if test $support_batch_insert = yes ; then
1365 AC_DEFINE(HAVE_BATCH_FILE_INSERT, 1, [Set if DB batch insert code enabled])
1369 AC_DEFINE(PROTOTYPES)
1371 dnl# --------------------------------------------------------------------------
1372 dnl# Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
1374 if test -z "$CFLAGS" -o "$CFLAGS" = "-g -O2"; then
1375 if test -z "$CCOPTS"; then
1376 CCOPTS='-g -O2 -Wall'
1385 dnl See if we can use 64 bit file addresses
1386 largefile_support="no"
1392 dnl# --------------------------------------------------------------------------
1393 dnl# CHECKING FOR HEADER FILES
1394 dnl# --------------------------------------------------------------------------
1433 AC_STRUCT_ST_BLKSIZE
1437 dnl# --------------------------------------------------------------------------
1438 dnl# Check for utime.h structure
1439 dnl# --------------------------------------------------------------------------
1440 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
1442 #include <sys/types.h>
1443 #include <utime.h>], [struct utimbuf foo],
1444 ba_cv_header_utime_h=yes, ba_cv_header_utime_h=no)])
1445 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H, 1, [Set if utime.h exists])
1447 dnl# --------------------------------------------------------------------------
1448 dnl# Check for socklen_t
1449 dnl# --------------------------------------------------------------------------
1450 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
1452 #include <sys/types.h>
1453 #include <sys/socket.h>],
1455 ba_cv_header_socklen_t=yes, ba_cv_header_socklen_t=no)])
1456 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T)
1458 dnl# --------------------------------------------------------------------------
1459 dnl# Check for bigendian
1460 dnl# --------------------------------------------------------------------------
1461 AC_CACHE_CHECK([for bigendian], ba_cv_bigendian,
1463 [main(){long a=1L; char *p=(char *)&a; exit(*p);}],
1464 [ba_cv_bigendian=yes],
1465 [ba_cv_bigendian=no],
1466 [ba_cv_bigendian=no])])
1467 test $ba_cv_bigendian = yes && AC_DEFINE(HAVE_BIGENDIAN)
1469 dnl# --------------------------------------------------------------------------
1470 dnl# Check for typeof()
1471 dnl# --------------------------------------------------------------------------
1473 AC_CACHE_CHECK(for typeof, ba_cv_have_typeof,
1475 [main(){char *a = 0; a = (typeof a)a;}],
1476 [ba_cv_have_typeof=yes],
1477 [ba_cv_have_typeof=no],
1478 [ba_cv_have_typeof=no])])
1479 test $ba_cv_have_typeof = yes && AC_DEFINE([HAVE_TYPEOF], 1, [Defind to 1 if compiler has typeof])
1485 dnl# --------------------------------------------------------------------------
1486 dnl# CHECKING FOR FILESYSTEM TYPE
1487 dnl# --------------------------------------------------------------------------
1488 AC_MSG_CHECKING(how to get filesystem type)
1490 # The order of these tests is important.
1491 AC_TRY_CPP([#include <sys/statvfs.h>
1492 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4)
1493 if test $fstype = no; then
1494 AC_TRY_CPP([#include <sys/statfs.h>
1495 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3)
1497 if test $fstype = no; then
1498 AC_TRY_CPP([#include <sys/statfs.h>
1499 #include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX)
1501 if test $fstype = no; then
1502 AC_TRY_CPP([#include <mntent.h>], AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD)
1504 if test $fstype = no; then
1505 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
1507 if test $fstype = no; then
1508 AC_TRY_CPP([#include <sys/mount.h>
1509 #include <sys/fs_types.h>], AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix)
1511 AC_MSG_RESULT($fstype)
1513 AC_CHECK_HEADER(sys/statvfs.h, [ AC_DEFINE(HAVE_SYS_STATVFS_H,1,[Defines if your system have the sys/statvfs.h header file])] , )
1515 dnl# --------------------------------------------------------------------------
1516 dnl# CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
1517 dnl# --------------------------------------------------------------------------
1525 AC_CHECK_TYPE(ino_t, unsigned long)
1526 AC_CHECK_TYPE(dev_t, unsigned long)
1527 AC_CHECK_TYPE(daddr_t, long)
1528 AC_CHECK_TYPE(major_t, int)
1529 AC_CHECK_TYPE(minor_t, int)
1530 AC_CHECK_TYPE(ssize_t, int)
1537 AC_CHECK_SIZEOF(char, 1)
1538 AC_CHECK_SIZEOF(short int, 2)
1539 AC_CHECK_SIZEOF(int, 4)
1540 AC_CHECK_SIZEOF(long int, 4)
1541 AC_CHECK_SIZEOF(long long int, 8)
1542 AC_CHECK_SIZEOF(int *, 4)
1544 # Check for sys/types.h types
1545 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1547 [ #include <sys/types.h> ],
1549 [ ac_cv_have_u_int="yes" ],
1550 [ ac_cv_have_u_int="no" ]
1553 if test "x$ac_cv_have_u_int" = "xyes" ; then
1554 AC_DEFINE(HAVE_U_INT)
1558 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t, [
1560 [ #include <sys/types.h> ],
1561 [ intmax_t a; a = 1;],
1562 [ ac_cv_have_intmax_t="yes" ],
1565 [ #include <stdint.h> ],
1566 [ intmax_t a; a = 1;],
1567 [ ac_cv_have_intmax_t="yes" ],
1568 [ ac_cv_have_intmax_t="no" ]
1574 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
1575 AC_DEFINE(HAVE_INTMAX_T)
1580 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t, [
1582 [ #include <sys/types.h> ],
1583 [ u_intmax_t a; a = 1;],
1584 [ ac_cv_have_u_intmax_t="yes" ],
1587 [ #include <stdint.h> ],
1588 [ u_intmax_t a; a = 1;],
1589 [ ac_cv_have_u_intmax_t="yes" ],
1590 [ ac_cv_have_u_intmax_t="no" ]
1595 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
1596 AC_DEFINE(HAVE_U_INTMAX_T)
1601 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1603 [ #include <sys/types.h> ],
1604 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1605 [ ac_cv_have_intxx_t="yes" ],
1606 [ ac_cv_have_intxx_t="no" ]
1609 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1610 AC_DEFINE(HAVE_INTXX_T)
1614 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1616 [ #include <sys/types.h> ],
1617 [ int64_t a; a = 1;],
1618 [ ac_cv_have_int64_t="yes" ],
1619 [ ac_cv_have_int64_t="no" ]
1622 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1623 AC_DEFINE(HAVE_INT64_T)
1627 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1629 [ #include <sys/types.h> ],
1630 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1631 [ ac_cv_have_u_intxx_t="yes" ],
1632 [ ac_cv_have_u_intxx_t="no" ]
1635 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1636 AC_DEFINE(HAVE_U_INTXX_T)
1640 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1642 [ #include <sys/types.h> ],
1643 [ u_int64_t a; a = 1;],
1644 [ ac_cv_have_u_int64_t="yes" ],
1645 [ ac_cv_have_u_int64_t="no" ]
1648 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1649 AC_DEFINE(HAVE_U_INT64_T)
1653 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1654 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1656 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1658 [ #include <sys/bitypes.h> ],
1659 [ int8_t a; int16_t b; int32_t c;
1660 u_int8_t e; u_int16_t f; u_int32_t g;
1661 a = b = c = e = f = g = 1; ],
1662 [ AC_DEFINE(HAVE_U_INTXX_T)
1663 AC_DEFINE(HAVE_INTXX_T)
1664 AC_DEFINE(HAVE_SYS_BITYPES_H)
1665 AC_MSG_RESULT(yes) ],
1666 [ AC_MSG_RESULT(no)]
1670 if test -z "$have_u_intxx_t" ; then
1671 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1673 [ #include <sys/types.h> ],
1674 [ uint8_t a; uint16_t b;
1675 uint32_t c; a = b = c = 1; ],
1676 [ ac_cv_have_uintxx_t="yes" ],
1677 [ ac_cv_have_uintxx_t="no" ]
1680 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1681 AC_DEFINE(HAVE_UINTXX_T)
1685 if (test -z "$have_u_int64_t" || test -z "$have_int64_t" && \
1686 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1688 AC_MSG_CHECKING([for int64_t and u_int64_t types in sys/bitypes.h])
1690 [ #include <sys/bitypes.h> ],
1691 [ int64_t a; u_int64_t b;
1693 [ AC_DEFINE(HAVE_U_INT64_T)
1694 AC_DEFINE(HAVE_INT64_T)
1695 AC_MSG_RESULT(yes) ],
1696 [ AC_MSG_RESULT(no)]
1700 if (test -z "$have_uintxx_t" && \
1701 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1703 AC_MSG_CHECKING([for uintXX_t types in sys/bitypes.h])
1705 [ #include <sys/bitypes.h> ],
1706 [ uint8_t a; uint16_t b;
1707 uint32_t c; a = b = c = 1; ],
1708 [ AC_DEFINE(HAVE_UINTXX_T)
1709 AC_MSG_RESULT(yes) ],
1710 [ AC_MSG_RESULT(no)]
1718 dnl# --------------------------------------------------------------------------
1719 dnl# CHECKING FOR REQUIRED LIBRARY FUNCTIONS
1720 dnl# --------------------------------------------------------------------------
1736 [echo 'configure: cannot find needed function.'; exit 1]
1739 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
1740 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
1741 AC_CHECK_FUNCS(posix_fadvise)
1742 AC_CHECK_FUNCS(fdatasync)
1744 AC_CHECK_FUNCS(chflags)
1746 AC_CHECK_FUNCS(snprintf vsnprintf gethostid fseeko)
1748 AC_CACHE_CHECK(for va_copy, ba_cv_va_copy,
1751 void use_va_copy(va_list args){va_list args2; va_copy(args2,args); va_end(args2);}
1752 void call_use_va_copy(int junk,...){va_list args; va_start(args,junk); use_va_copy(args); va_end(args);}
1754 [call_use_va_copy(1,2,3)],
1755 ba_cv_va_copy=yes, ba_cv_va_copy=no)])
1756 test $ba_cv_va_copy = yes && AC_DEFINE(HAVE_VA_COPY, 1, [Set if va_copy exists])
1759 dnl# --------------------------------------------------------------------------
1760 dnl# CHECKING FOR THREAD SAFE FUNCTIONS
1761 dnl# --------------------------------------------------------------------------
1762 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
1764 # If resolver functions are not in libc check for -lnsl or -lresolv.
1765 AC_CHECK_FUNC(gethostbyname_r,
1766 AC_MSG_RESULT(using libc's resolver),
1767 AC_CHECK_LIB(nsl,gethostbyname_r)
1768 AC_CHECK_LIB(resolv,gethostbyname_r))
1772 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
1773 AC_CHECK_FUNCS(inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)])
1774 AC_CHECK_FUNCS(gethostbyname2, [AC_DEFINE(HAVE_GETHOSTBYNAME2)])
1776 dnl ----------------------------
1777 dnl check sa_len of sockaddr
1778 dnl ----------------------------
1779 AC_CACHE_CHECK(for struct sockaddr has a sa_len field, ac_cv_struct_sockaddr_sa_len,
1780 [AC_TRY_COMPILE([#include <sys/socket.h>], [struct sockaddr s; s.sa_len;],
1781 ac_cv_struct_sockaddr_sa_len=yes, ac_cv_struct_sockaddr_sa_len=no)])
1783 if test $ac_cv_struct_sockaddr_sa_len = yes; then
1784 AC_DEFINE(HAVE_SA_LEN, 1, [Define if sa_len field exists in struct sockaddr])
1794 AC_FUNC_CLOSEDIR_VOID
1795 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
1796 # AC_FUNC_FNMATCH dnl use local version
1799 AC_CHECK_LIB(intl, gettext, [LIBS="$LIBS -lintl"])
1802 AC_CHECK_LIB(sun, getpwnam)
1804 AC_CHECK_HEADERS(zlib.h)
1805 AC_CHECK_LIB(z, deflate, [FDLIBS="-lz"])
1807 if test x$FDLIBS = x-lz; then
1808 AC_DEFINE(HAVE_LIBZ)
1813 # Check for ACL libraries
1816 AC_CHECK_HEADER(sys/acl.h)
1817 AC_CHECK_FUNC(acl_get_file, [have_acl=yes],
1818 [AC_CHECK_LIB(acl, acl_get_file, [have_acl=yes; FDLIBS="-lacl $FDLIBS"],
1819 [AC_CHECK_LIB(sec, acltotext, [have_acl=yes; FDLIBS="-lsec $FDLIBS"])]
1822 if test $have_acl = yes; then
1826 dnl Check for pthread libraries
1828 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
1829 [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
1830 [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
1831 [AC_CHECK_FUNC(pthread_create)]
1842 if test x$have_gcc = xyes ; then
1843 CPPFLAGS="$CPPFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
1844 CFLAGS="$CFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
1846 LDFLAGS=${LDFLAGS--O}
1847 DB_LIBS="${SQL_LFLAGS}"
1848 CPPFLAGS="$CPPFLAGS"
1861 AC_SUBST(X_EXTRA_LIBS)
1866 dnl# extra configurable objects
1877 # Finally we set appropriate distribution specific
1878 # variables and defaults
1880 # PFILES are platform specific files
1881 PFILES="platforms/Makefile"
1885 hostname=`uname -n | cut -d '.' -f 1`
1886 if test x${hostname} = x ; then
1887 hostname="localhost"
1892 PSCMD="ps -e -o pid,comm"
1894 platforms/aix/Makefile"
1895 TAPEDRIVE="/dev/rmt0.1"
1899 PTHREAD_LIB="-lpthread -lexc"
1900 if test "${CC}" = "gcc" ; then
1907 TAPEDRIVE="/dev/nrmt0"
1910 DISTVER=`uname -a |awk '{print $3}'`
1911 TAPEDRIVE="/dev/nrmt0"
1912 PTHREAD_LIB="-pthread"
1913 CFLAGS="${CFLAGS} -pthread"
1914 PSCMD="ps -ax -o pid,command"
1918 platforms/bsdi/Makefile \
1919 platforms/bsdi/bacula-fd \
1920 platforms/bsdi/bacula-sd \
1921 platforms/bsdi/bacula-dir"
1922 largefile_support="yes"
1925 DISTVER=`uname -a |awk '{print $3}'`
1926 TAPEDRIVE="/dev/nrst0"
1929 WLDFLAGS="-mwindows"
1933 TAPEDRIVE="/dev/nst0"
1934 PSCMD="ps -e -o pid,command"
1937 platforms/darwin/Makefile"
1940 DISTVER=`cat /etc/debian_version`
1941 TAPEDRIVE="/dev/nrst0"
1942 PSCMD="ps -e -o pid,command"
1945 DISTVER=`uname -a |awk '{print $3}'`
1946 VER=`echo $DISTVER | cut -c 1`
1947 if test x$VER = x4 ; then
1948 PTHREAD_LIB="${PTHREAD_LIBS:--pthread}"
1949 CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS:--pthread}"
1953 TAPEDRIVE="/dev/nrsa0"
1954 PSCMD="ps -ax -o pid,command"
1956 platforms/freebsd/Makefile \
1957 platforms/freebsd/bacula-fd \
1958 platforms/freebsd/bacula-sd \
1959 platforms/freebsd/bacula-dir"
1960 largefile_support="yes"
1963 PSCMD="UNIX95=1; ps -e -o pid,comm"
1964 CFLAGS="${CFLAGS} -D_XOPEN_SOURCE_EXTENDED=1"
1966 TAPEDRIVE="/dev/rmt/0hnb"
1967 PTHREAD_LIB="-lpthread"
1968 AC_DEFINE([_INCLUDE_LONGLONG])
1972 TAPEDRIVE="/dev/rmt/0cbn"
1973 PSCMD="ps -e -o pid,comm"
1975 platforms/irix/Makefile \
1976 platforms/irix/bacula-fd \
1977 platforms/irix/bacula-sd \
1978 platforms/irix/bacula-dir"
1981 DISTVER=`uname -a |awk '{print $3}'`
1984 TAPEDRIVE="/dev/nrst0"
1985 PSCMD="ps -ax -o pid,command"
1986 PTHREAD_LIB="-pthread"
1987 CFLAGS="${CFLAGS} -pthread"
1990 DISTVER=`uname -a |awk '{print $3}'`
1993 TAPEDRIVE="/dev/nrst0"
1994 PSCMD="ps -ax -o pid,command"
1995 PTHREAD_LIB="-pthread"
1996 CFLAGS="${CFLAGS} -pthread"
1998 platforms/openbsd/Makefile \
1999 platforms/openbsd/bacula-fd \
2000 platforms/openbsd/bacula-sd \
2001 platforms/openbsd/bacula-dir"
2004 if test -f /etc/whitebox-release ; then
2005 f=/etc/whitebox-release
2007 f=/etc/redhat-release
2009 if test `cat $f | grep release |\
2010 cut -f 3 -d ' '`x = "Enterprise"x ; then
2011 DISTVER="Enterprise "`cat $f | grep release |\
2014 DISTVER=`cat /etc/redhat-release | grep release |\
2017 TAPEDRIVE="/dev/nst0"
2018 PSCMD="ps -e -o pid,command"
2020 platforms/redhat/Makefile \
2021 platforms/redhat/bacula-fd \
2022 platforms/redhat/bacula-sd \
2023 platforms/redhat/bacula-dir \
2024 platforms/redhat/bacula.spec \
2028 DISTVER=`cat /etc/mandrake-release | grep release |\
2030 TAPEDRIVE="/dev/nst0"
2031 PSCMD="ps -e -o pid,command"
2033 platforms/mandrake/Makefile \
2034 platforms/mandrake/bacula-fd \
2035 platforms/mandrake/bacula-sd \
2036 platforms/mandrake/bacula-dir \
2037 platforms/mandrake/bacula.spec \
2041 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
2042 TAPEDRIVE="/dev/nst0"
2043 PSCMD="ps -e -o pid,command"
2045 platforms/gentoo/Makefile \
2046 platforms/gentoo/bacula-init \
2047 platforms/gentoo/bacula-fd \
2048 platforms/gentoo/bacula-sd \
2049 platforms/gentoo/bacula-dir"
2052 DISTVER=`cat /etc/slackware-version`
2053 TAPEDRIVE="/dev/nst0"
2054 PSCMD="ps -e -o pid,command"
2056 platforms/slackware/Makefile \
2057 platforms/slackware/rc.bacula-fd \
2058 platforms/slackware/rc.bacula-sd \
2059 platforms/slackware/rc.bacula-dir\
2060 platforms/slackware/functions.bacula"
2064 TAPEDRIVE="/dev/rmt/0cbn"
2065 PSCMD="ps -e -o pid,comm"
2067 platforms/solaris/Makefile \
2068 platforms/solaris/bacula-fd \
2069 platforms/solaris/bacula-sd \
2070 platforms/solaris/bacula-dir"
2071 if test x$DISTVER = x5.6 ; then
2072 AC_DEFINE(HAVE_OLD_SOCKOPT)
2074 LIBS="$LIBS -lresolv"
2077 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
2079 TAPEDRIVE="/dev/nst0"
2080 PSCMD="ps -e -o pid,command"
2082 platforms/suse/Makefile \
2083 platforms/suse/bacula-fd \
2084 platforms/suse/bacula-sd \
2085 platforms/suse/bacula-dir \
2086 platforms/suse/bacula \
2087 platforms/suse/bacula.spec"
2092 TAPEDRIVE="/dev/nst0"
2093 PSCMD="ps -e -o pid,command"
2095 platforms/suse/Makefile \
2096 platforms/suse/bacula-fd \
2097 platforms/suse/bacula-sd \
2098 platforms/suse/bacula-dir"
2102 TAPEDRIVE="/dev/nst0"
2105 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
2111 LIBS="$PTHREAD_LIB $LIBS"
2113 AC_DEFINE_UNQUOTED(lld, "$lld")
2114 AC_DEFINE_UNQUOTED(llu, "$llu")
2122 dnl# common parts of the Makefile
2123 MCOMMON=./autoconf/Make.common
2124 AC_SUBST_FILE(MCOMMON)
2127 if test "x${subsysdir}" = "x${sbindir}" ; then
2130 echo "You have set both --sbindir and --with-subsys-dir"
2131 echo " equal to: ${subsysdir} "
2132 echo "This is not permitted. Please reconfigure."
2134 echo "Aborting configuration ..."
2140 AC_OUTPUT([autoconf/Make.common \
2143 scripts/startmysql \
2145 scripts/btraceback \
2151 scripts/bacula-ctl-dir \
2152 scripts/bacula-ctl-fd \
2153 scripts/bacula-ctl-sd \
2154 scripts/devel_bacula \
2157 scripts/bacula.desktop.gnome1 \
2158 scripts/bacula.desktop.gnome2 \
2159 scripts/bacula.desktop.gnome1.consolehelper \
2160 scripts/bacula.desktop.gnome2.consolehelper \
2161 scripts/bacula.desktop.gnome1.xsu \
2162 scripts/bacula.desktop.gnome2.xsu \
2163 scripts/bgnome-console.console_apps \
2164 scripts/mtx-changer \
2165 scripts/disk-changer \
2166 scripts/dvd-handler \
2167 scripts/dvd-simulator \
2168 scripts/bacula-tray-monitor.desktop \
2169 scripts/logwatch/Makefile \
2170 scripts/logwatch/logfile.bacula.conf \
2171 scripts/wxconsole.console_apps \
2172 scripts/wxconsole.desktop.consolehelper \
2173 scripts/wxconsole.desktop.xsu \
2174 scripts/bat.desktop \
2175 scripts/bat.desktop.xsu \
2176 scripts/bat.desktop.consolehelper \
2177 scripts/bat.console_apps \
2180 src/console/Makefile \
2181 src/console/bconsole.conf \
2182 src/gnome2-console/Makefile \
2183 src/gnome2-console/bgnome-console.conf \
2184 src/qt-console/bat.conf \
2185 src/qt-console/bat.pro \
2186 src/qt-console/install_conf_file \
2187 src/wx-console/Makefile \
2188 src/wx-console/bwx-console.conf \
2189 src/tray-monitor/Makefile \
2190 src/tray-monitor/tray-monitor.conf \
2192 src/dird/bacula-dir.conf \
2194 src/stored/Makefile \
2195 src/stored/bacula-sd.conf \
2196 src/filed/Makefile \
2197 src/filed/bacula-fd.conf \
2199 src/cats/make_catalog_backup \
2200 src/cats/delete_catalog_backup \
2201 src/cats/create_postgresql_database \
2202 src/cats/update_postgresql_tables \
2203 src/cats/make_postgresql_tables \
2204 src/cats/grant_postgresql_privileges \
2205 src/cats/drop_postgresql_tables \
2206 src/cats/drop_postgresql_database \
2207 src/cats/create_mysql_database \
2208 src/cats/update_mysql_tables \
2209 src/cats/make_mysql_tables \
2210 src/cats/grant_mysql_privileges \
2211 src/cats/drop_mysql_tables \
2212 src/cats/drop_mysql_database \
2213 src/cats/create_sqlite_database \
2214 src/cats/update_sqlite_tables \
2215 src/cats/make_sqlite_tables \
2216 src/cats/grant_sqlite_privileges \
2217 src/cats/drop_sqlite_tables \
2218 src/cats/drop_sqlite_database \
2219 src/cats/create_sqlite3_database \
2220 src/cats/update_sqlite3_tables \
2221 src/cats/make_sqlite3_tables \
2222 src/cats/grant_sqlite3_privileges \
2223 src/cats/drop_sqlite3_tables \
2224 src/cats/drop_sqlite3_database \
2227 src/cats/create_bdb_database \
2228 src/cats/update_bdb_tables \
2229 src/cats/make_bdb_tables \
2230 src/cats/grant_bdb_privileges \
2231 src/cats/drop_bdb_tables \
2232 src/cats/drop_bdb_database \
2233 src/cats/create_bacula_database \
2234 src/cats/update_bacula_tables \
2235 src/cats/grant_bacula_privileges \
2236 src/cats/make_bacula_tables \
2237 src/cats/drop_bacula_tables \
2238 src/cats/drop_bacula_database \
2239 src/findlib/Makefile \
2240 src/tools/Makefile \
2246 if test "${support_bat}" = "yes" ; then
2247 if test "x$QMAKE" = "xnone" && test "x$QMAKEQT4" = "xnone"; then
2248 echo "Could not find qmake or qmake-qt4 in $PATH. Check your Qt installation"
2254 if test "x$QMAKEQT4" != "xnone"; then
2261 chmod 755 install_conf_file build-depkgs-qt-console
2262 echo "Creating bat Makefile"
2267 echo "Doing make of dependencies"
2268 ${MAKE:-make} depend
2271 chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
2272 chmod 755 dvd-handler dvd-simulator
2273 chmod 755 bconsole gconsole mtx-changer devel_bacula logrotate
2278 chmod 755 $c/create_bacula_database $c/update_bacula_tables $c/make_bacula_tables
2279 chmod 755 $c/grant_bacula_privileges $c/drop_bacula_tables $c/drop_bacula_database
2281 chmod 755 $c/create_bdb_database $c/update_bdb_tables $c/make_bdb_tables
2282 chmod 755 $c/grant_bdb_privileges $c/drop_bdb_tables $c/drop_bdb_database
2284 chmod 755 $c/create_mysql_database $c/update_mysql_tables $c/make_mysql_tables
2285 chmod 755 $c/grant_mysql_privileges $c/drop_mysql_tables $c/drop_mysql_database
2287 chmod 755 $c/create_sqlite_database $c/update_sqlite_tables $c/make_sqlite_tables
2288 chmod 755 $c/grant_sqlite_privileges $c/drop_sqlite_tables $c/drop_sqlite_database
2290 chmod 755 $c/create_sqlite3_database $c/update_sqlite3_tables $c/make_sqlite3_tables
2291 chmod 755 $c/grant_sqlite3_privileges $c/drop_sqlite3_tables $c/drop_sqlite3_database
2293 chmod 755 $c/create_postgresql_database $c/update_postgresql_tables $c/make_postgresql_tables
2294 chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables $c/drop_postgresql_database
2296 chmod 755 $c/make_catalog_backup $c/delete_catalog_backup
2300 chmod 755 src/win32/build-depkgs-mingw32
2304 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
2305 largefile_support="yes"
2309 # A whole lot of hand springs to get the compiler version.
2310 # This is because gcc changed the output in version 3.0
2312 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
2313 if test "x${CCVERSION}" = "x" ; then
2314 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
2316 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
2317 if test x"${CXXVERSION}" = x ; then
2318 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
2321 if test "x${subsysdir}" = "x${sbindir}" ; then
2324 echo "You have set --sbindir and --with-subsys-dir"
2325 echo " both equal to: ${subsysdir} "
2326 echo " This is not permitted. Please reconfigure."
2328 echo "Aborting configuration ..."
2334 if test "x${db_type}" = "xInternal" ; then
2337 echo "You have not specified either --enable-client-only or one of the"
2338 echo " supported databases: MySQL, PostgreSQL, SQLite3 or SQLite."
2339 echo " This is not permitted. Please reconfigure."
2341 echo "Aborting the configuration ..."
2348 Configuration on `date`:
2350 Host: $host -- ${DISTNAME} ${DISTVER}
2351 Bacula version: ${VERSION} (${DATE})
2352 Source code location: ${srcdir}
2353 Install binaries: ${sbindir}
2354 Install config files: ${sysconfdir}
2355 Scripts directory: ${scriptdir}
2356 Archive directory: ${archivedir}
2357 Working directory: ${working_dir}
2358 PID directory: ${piddir}
2359 Subsys directory: ${subsysdir}
2360 Man directory: ${mandir}
2361 Data directory: ${datadir}
2362 C Compiler: ${CC} ${CCVERSION}
2363 C++ Compiler: ${CXX} ${CXXVERSION}
2364 Compiler flags: ${WCFLAGS} ${CFLAGS}
2365 Linker flags: ${WLDFLAGS} ${LDFLAGS}
2367 Statically Linked Tools: ${support_static_tools}
2368 Statically Linked FD: ${support_static_fd}
2369 Statically Linked SD: ${support_static_sd}
2370 Statically Linked DIR: ${support_static_dir}
2371 Statically Linked CONS: ${support_static_cons}
2372 Database type: ${db_type}
2373 Database lib: ${DB_LIBS}
2374 Database name: ${db_name}
2375 Database user: ${db_user}
2377 Job Output Email: ${job_email}
2378 Traceback Email: ${dump_email}
2379 SMTP Host Address: ${smtp_host}
2381 Director Port: ${dir_port}
2382 File daemon Port: ${fd_port}
2383 Storage daemon Port: ${sd_port}
2385 Director User: ${dir_user}
2386 Director Group: ${dir_group}
2387 Storage Daemon User: ${sd_user}
2388 Storage DaemonGroup: ${sd_group}
2389 File Daemon User: ${fd_user}
2390 File Daemon Group: ${fd_group}
2392 SQL binaries Directory ${SQL_BINDIR}
2394 Large file support: $largefile_support
2395 Bacula conio support: ${got_conio} ${CONS_LIBS}
2396 readline support: ${got_readline} ${PRTREADLINE_SRC}
2397 TCP Wrappers support: ${TCPW_MSG} ${WRAPLIBS}
2398 TLS support: ${support_tls}
2399 Encryption support: ${support_crypto}
2400 ZLIB support: ${have_zlib}
2401 enable-smartalloc: ${support_smartalloc}
2402 bat support: ${support_bat} ${QWT_LDFLAGS}
2403 enable-gnome: ${support_gnome} ${gnome_version}
2404 enable-bwx-console: ${support_wx_console} ${wx_version}
2405 enable-tray-monitor: ${support_tray_monitor}
2406 client-only: ${build_client_only}
2407 build-dird: ${build_dird}
2408 build-stored: ${build_stored}
2409 ACL support: ${have_acl}
2410 Python support: ${support_python} ${PYTHON_LIBS}
2411 Batch insert enabled: ${support_batch_insert}