3 dnl# Process this file with autoconf to produce a configure script.
12 AC_CONFIG_AUX_DIR(${BUILD_DIR}/autoconf)
13 AC_CONFIG_HEADER(src/config.h:autoconf/config.h.in)
15 dnl require a recent autoconf
19 dnl search for true and false programs.
20 AC_PATH_PROGS(TRUEPRG, true, :)
21 AC_PATH_PROGS(FALSEPRG, false, :)
25 VERSION=`sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
26 DATE=`sed -n -e 's/^.*[ \t]*BDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
27 LSMDATE=`sed -n -e 's/^.*LSMDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
31 echo "configuring for bacula $VERSION ($DATE)"
34 dnl -------------------------------------------------------
35 dnl# Check for compiler.
36 dnl ------------------------------------------------------
40 AC_PROG_CC_C_O dnl Determine if C compiler support -c -o.
41 AC_PROG_GCC_TRADITIONAL dnl Determine if ioctl() need -traditional.
45 if test "x$BASECC" = xgcc; then
49 AC_PATH_PROG(CXX, $CXX, $CXX)
50 if test ! -e $CXX; then
51 AC_MSG_ERROR(Unable to find C++ compiler)
54 dnl -------------------------------------------------------
55 dnl# Check for programs.
56 dnl ------------------------------------------------------
59 AC_PATH_PROG(MV, mv, mv)
60 AC_PATH_PROG(RM, rm, rm)
61 AC_PATH_PROG(CP, cp, cp)
62 AC_PATH_PROG(SED, sed, sed)
63 AC_PATH_PROG(ECHO, echo, echo)
64 AC_PATH_PROG(CMP, cmp, cmp)
65 AC_PATH_PROG(TBL, tbl, tbl)
66 AC_PATH_PROG(AR, ar, ar)
67 dnl AC_PATH_PROG(RANLIB, ranlib, ranlib)
68 AC_PATH_PROG(OPENSSL, openssl, none)
69 AC_PATH_PROG(MTX, mtx, mtx)
70 AC_PATH_PROG(DD, dd, dd)
71 AC_PATH_PROG(MKISOFS, mkisofs, mkisofs)
72 AC_PATH_PROG(PYTHON, python, python)
73 AC_PATH_PROG(GROWISOFS, growisofs, growisofs)
74 AC_PATH_PROG(DVDRWMEDIAINFO, dvd+rw-mediainfo, dvd+rw-mediainfo)
75 AC_PATH_PROG(DVDRWFORMAT, dvd+rw-format, dvd+rw-format)
76 AC_PATH_PROG(PKGCONFIG, pkg-config, pkg-config)
77 AC_ARG_VAR(WXCONFIG, [wx-config command. On some systems, you must set it to wx-config-2.6 to use wxWidgets 2.6.])
78 if test "x$WXCONFIG" = x; then
81 AC_PATH_PROG(WXCONFIG, ${WXCONFIG}, ${WXCONFIG})
82 AC_ARG_VAR(WXFLAGS, [Parameters to pass to wx-config (e.g. --unicode=no).])
83 AC_PATH_PROG(CDRECORD, cdrecord, cdrecord)
84 AC_PATH_PROG(PIDOF, pidof, pidof)
86 # Some AWK programs fail, so test it and warn the user
87 if echo xfoo | $AWK 'BEGIN { prog=ARGV[1]; ARGC=1 }
88 { if ((prog == $2) || (("(" prog ")") == $2) ||
89 (("[" prog "]") == $2) ||
90 ((prog ":") == $2)) { print $1 ; exit 0 } }' xfoo>/dev/null; then :;
92 AC_MSG_ERROR([!!!!!!!!! WARNING !!!!!!!!!!!!!!
93 The regex engine of $AWK is too broken to be used you
94 might want to install GNU AWK.
95 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!])
98 AC_PATH_PROG(AWK, $THE_AWK, $THE_AWK)
101 test -n "$ARFLAG" || ARFLAGS="cr"
108 AC_SUBST(LOCAL_CFLAGS)
109 AC_SUBST(LOCAL_LDFLAGS)
112 dnl --------------------------------------------------
113 dnl Bacula OP Sys determination (see aclocal.m4)
114 dnl --------------------------------------------------
117 # -----------------------------------------------------------
118 dnl Bacula OPSys Distribution determination (see aclocal.m4)
119 # ----------------------------------------------------------
120 BA_CHECK_OPSYS_DISTNAME
122 # --------------------------------------------------
123 # Suppport for gettext (translations)
124 # By default, $datadir is ${prefix}/share
125 # --------------------------------------------------
126 AM_GNU_GETTEXT([external])
127 if test x${prefix} = xNONE ; then
128 if test `eval echo ${datadir}` = NONE/share ; then
133 # ------------------------------------------------------------------
134 # If the user has not set --prefix, we set our default to nothing.
135 # In this case, if the user has not set --sysconfdir, we set it
136 # to the package default of /etc/bacula. If either --prefix or
137 # --sysconfdir is set, we leave sysconfdir alone except to eval it.
138 # ------------------------------------------------------------------
139 if test x${prefix} = xNONE ; then
140 if test `eval echo ${sysconfdir}` = NONE/etc ; then
141 sysconfdir=/etc/bacula
145 sysconfdir=`eval echo ${sysconfdir}`
146 datadir=`eval echo ${datadir}`
147 localedir=`eval echo ${datadir}/locale`
148 AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir")
149 AC_DEFINE_UNQUOTED(SYSCONFDIR, "$sysconfdir")
151 # -------------------------------------------------------------------------
152 # If the user has not set --exec-prefix, we default to ${prefix}
153 # -------------------------------------------------------------------------
154 if test x${exec_prefix} = xNONE ; then
155 exec_prefix=${prefix}
158 # ------------------------------------------------------------------
159 # If the user has not set --sbindir, we set our default as /sbin
160 # ------------------------------------------------------------------
161 if test x$sbindir = x'${exec_prefix}/sbin' ; then
162 sbindir=${exec_prefix}/sbin
164 sbindir=`eval echo ${sbindir}`
166 # -------------------------------------------------------------------------
167 # If the user has not set --mandir, we default to /usr/share/man
168 # -------------------------------------------------------------------------
169 if test x$mandir = x'${prefix}/man' ; then
170 mandir=/usr/share/man
174 AC_PATH_PROGS(MSGFMT, msgfmt, no)
175 if test "$MSGFMT" = "no"
177 echo 'msgfmt program not found, disabling NLS !'
179 USE_INCLUDED_LIBINTL=no
188 support_postgresql=no
189 support_smartalloc=yes
194 support_wx_console=no
199 support_static_tools=no
202 support_static_dir=no
203 support_static_cons=no
212 dnl# --------------------------------------------------------------------------
213 dnl# CHECKING COMMAND LINE OPTIONS
214 dnl# --------------------------------------------------------------------------
216 # -------------------------------------------
217 # gnome (default off)
218 # -------------------------------------------
220 [ --enable-gnome enable build of bgnome-console GUI [disabled]],
221 [if test x$enableval = xyes; then
226 if test x$support_gnome = xyes; then
227 abc=`$PKGCONFIG --exists libgnomeui-2.0`
229 if test $pkg = 0; then
230 GNOME_INCLUDEDIR=`$PKGCONFIG --cflags-only-I libgnomeui-2.0`
231 GNOMEUI_LIBS=`$PKGCONFIG --libs-only-l libgnomeui-2.0`
232 GNOME_LIBDIR=`$PKGCONFIG --libs libgnomeui-2.0`
233 GNOME_LIBS=`$PKGCONFIG --libs-only-l libgnomeui-2.0`
234 AC_SUBST(GNOME_INCLUDEDIR)
235 AC_SUBST(GNOMEUI_LIBS)
236 AC_SUBST(GNOME_LIBDIR)
238 GNOME_DIR=src/gnome2-console
239 gnome_version="Version 2.x"
241 AC_MSG_ERROR(Unable to find Gnome 2 installation)
246 # -------------------------------------------
248 # -------------------------------------------
250 [ --enable-bat enable build of bat Qt4 GUI [disabled]],
251 [if test x$enableval = xyes; then
252 AC_DEFINE(HAVE_BAT, 1, [Set if Bacula bat Qt4 GUI support enabled])
257 if test x$support_bat = xyes; then
258 abc=`$PKGCONFIG --atleast-version=4.2 QtGui`
260 if test $pkg = 0; then
261 BAT_DIR=src/qt-console
263 AC_MSG_ERROR(Unable to find Qt4 installation needed by bat)
268 # If bat is enabled, we need the qwt library
272 if test x$support_bat = xyes; then
273 AC_MSG_CHECKING(for qwt support)
275 [ --with-qwt@<:@=DIR@:>@ specify qwt library directory],
281 if test -f ${with_qwt}/include/qwt.h; then
282 QWT_INC="${with_qwt}/include"
283 QWT_LDFLAGS="-L${with_qwt}/lib"
290 # Search in standard places, or --with-qwt not specified
292 if test x$QWT_INC = x; then
293 for root in /usr /usr/local; do
294 for ver in qwt qwt5; do
295 if test -f ${root}/include/${ver}/qwt.h; then
296 QWT_INC="${root}/include/${ver}"
297 if test -d ${root}/lib64/; then
298 QWT_LDFLAGS="-L${root}/lib64"
300 QWT_LDFLAGS="-L${root}/lib"
308 if test x$QWT_INC = x; then
310 AC_MSG_ERROR(Unable to find qwt package needed by bat)
320 AC_SUBST(QWT_LDFLAGS)
323 # -------------------------------------------
324 # bwx-console (default off)
325 # -------------------------------------------
326 AC_ARG_ENABLE(bwx-console,
327 [ --enable-bwx-console enable build of wxWidgets console [disabled]],
328 [if test x$enableval = xyes; then
329 support_wx_console=yes
333 if test x$support_wx_console = xyes; then
334 abc=`$WXCONFIG $WXFLAGS --cppflags`
336 if test $pkg = 0; then
337 wx_version="wxWidgets `$WXCONFIG $WXFLAGS --release`"
338 WXCONS_CPPFLAGS=`$WXCONFIG $WXFLAGS --cppflags`
339 WXCONS_LDFLAGS=`$WXCONFIG $WXFLAGS --libs`
341 AC_SUBST(WXCONS_CPPFLAGS)
342 AC_SUBST(WXCONS_LDFLAGS)
343 WX_DIR=src/wx-console
346 echo "wx-config program not found. bwx-console disabled."
348 support_wx_console=no
354 # -------------------------------------------
355 # tray-monitor (default off)
356 # -------------------------------------------
357 AC_ARG_ENABLE(tray-monitor,
358 [ --enable-tray-monitor enable build of Gnome tray monitor (compatible with KDE) [disabled]],
359 [if test x$enableval = xyes; then
360 support_tray_monitor=yes
364 if test x$support_tray_monitor = xyes; then
365 abc=`$PKGCONFIG --exists gtk+-2.0`
367 if test $pkg = 0; then
368 TRAY_MONITOR_CPPFLAGS=`$PKGCONFIG --cflags gtk+-2.0`
369 TRAY_MONITOR_LDFLAGS=`$PKGCONFIG --libs gtk+-2.0`
370 AC_SUBST(TRAY_MONITOR_CPPFLAGS)
371 AC_SUBST(TRAY_MONITOR_LDFLAGS)
372 TRAY_MONITOR_DIR=src/tray-monitor
373 abc=`$PKGCONFIG --atleast-version=2.4 gtk+-2.0`
375 if test $pkg = 0; then
376 AC_DEFINE(HAVE_GTK_2_4, 1, [Set if you have GTK 4.2 or greater loaded])
380 AC_SUBST(TRAY_MONITOR_DIR)
382 # -------------------------------------------
383 # smartalloc (default off)
384 # -------------------------------------------
385 AC_ARG_ENABLE(smartalloc,
386 [ --enable-smartalloc enable smartalloc debugging support [disabled]],
387 [if test x$enableval = xno; then
388 support_smartalloc=no
391 if test x$support_smartalloc = xyes; then
392 AC_DEFINE(SMARTALLOC, 1, [Set if you want Smartalloc enabled])
395 # -------------------------------------------
396 # static-tools (default off)
397 # -------------------------------------------
398 AC_ARG_ENABLE(static-tools,
399 [ --enable-static-tools enable static tape tools [disabled]],
400 [if test x$enableval = xyes; then
401 support_static_tools=yes
405 if test x$support_static_tools = xyes; then
406 TTOOL_LDFLAGS="-static"
408 AC_SUBST(TTOOL_LDFLAGS)
410 # -------------------------------------------
411 # static-fd (default off)
412 # -------------------------------------------
413 AC_ARG_ENABLE(static-fd,
414 [ --enable-static-fd enable static File daemon [disabled]],
415 [if test x$enableval = xyes; then
416 support_static_fd=yes
420 if test x$support_static_fd = xyes; then
421 STATIC_FD="static-bacula-fd"
425 # -------------------------------------------
426 # static-sd (default off)
427 # -------------------------------------------
428 AC_ARG_ENABLE(static-sd,
429 [ --enable-static-sd enable static Storage daemon [disabled]],
430 [if test x$enableval = xyes; then
431 support_static_sd=yes
435 if test x$support_static_sd = xyes; then
436 STATIC_SD="static-bacula-sd"
440 # -------------------------------------------
441 # static-dir (default off)
442 # -------------------------------------------
443 AC_ARG_ENABLE(static-dir,
444 [ --enable-static-dir enable static Director [disabled]],
445 [if test x$enableval = xyes; then
446 support_static_dir=yes
450 if test x$support_static_dir = xyes; then
451 STATIC_DIR="static-bacula-dir"
455 # -------------------------------------------
456 # static-cons (default off)
457 # -------------------------------------------
458 AC_ARG_ENABLE(static-cons,
459 [ --enable-static-cons enable static Console [disabled]],
460 [if test x$enableval = xyes; then
461 support_static_cons=yes
467 if test x$support_static_cons = xyes; then
468 STATIC_CONS="static-bconsole"
469 STATIC_GNOME_CONS="static-bgnome-console"
470 STATIC_WX_CONS="static-bwx-console"
472 AC_SUBST(STATIC_CONS)
473 AC_SUBST(STATIC_GNOME_CONS)
474 AC_SUBST(STATIC_WX_CONS)
476 # -------------------------------------------
477 # client_only (default off)
478 # -------------------------------------------
479 AC_ARG_ENABLE(client-only,
480 [ --enable-client-only build client (File daemon) only [disabled]],
481 [if test x$enableval = xyes; then
482 build_client_only=yes
486 if test x$build_client_only = xno; then
493 # -------------------------------------------
494 # director (default on)
495 # -------------------------------------------
496 AC_ARG_ENABLE(build-dird,
497 [ --enable-build-dird enable building of dird (Director) [enabled]],
498 [if test x$enableval = xno; then
501 if test x$build_dird = xyes; then
506 DIR_TOOLS="NODIRTOOLS"
511 # -------------------------------------------
512 # stored (default on)
513 # -------------------------------------------
514 AC_ARG_ENABLE(build-stored,
515 [ --enable-build-stored enable building of stored (Storage daemon) [enabled]],
516 [if test x$enableval = xno; then
519 if test x$build_stored = xyes; then
520 STORED_DIR="src/stored"
526 # ---------------------------------------------------
527 # Check for conio (Bacula readline substitute)(
528 # ---------------------------------------------------
529 # this allows you to turn it completely off
531 [ --disable-conio disable conio support [enabled]
533 [if test x$enableval = xno; then
539 # ---------------------------------------------------
540 # Check for IPv6 support
541 # ---------------------------------------------------
542 # this allows you to turn it completely off
545 [ --enable-ipv6 enable ipv6 support [enabled]
547 [if test x$enableval = xno; then
552 if test x$support_ipv6 = xyes; then
553 AC_TRY_LINK([ #include <sys/types.h>
554 #include <sys/socket.h>
555 #include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;],
556 [support_ipv6=yes], [support_ipv6=no])
559 if test x$support_ipv6 = xyes; then
560 AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
566 if test x$support_conio = xyes; then
567 AC_CHECK_HEADER(termcap.h,
568 [ AC_CHECK_LIB(termcap, tgetent,
569 [ CONS_LIBS="-ltermcap"
574 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
576 [ AC_CHECK_LIB(ncurses, tgetent,
577 [ CONS_LIBS="-lncurses"
582 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
587 AC_CHECK_HEADERS(curses.h)
588 AC_CHECK_HEADER(term.h,
589 [ AC_CHECK_LIB(curses, tgetent,
590 [ CONS_LIBS="-lcurses"
595 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
598 [ echo " "; echo "Required libraries not found. CONIO turned off ..."; echo " "],
607 # ---------------------------------------------------
608 # Check for readline support/directory (default off)
609 # ---------------------------------------------------
610 # this allows you to turn it completely off
611 AC_ARG_ENABLE(readline,
612 [ --disable-readline disable readline support [disable]
614 [if test x$enableval = xno; then
620 if test x$support_readline = xyes; then
621 AC_ARG_WITH(readline,
622 [ --with-readline@<:@=DIR@:>@ specify readline library directory],
624 case "$with_readline" in
627 if test -f ${with_readline}/readline.h; then
628 CONS_INC="-I${with_readline}"
629 CONS_LDFLAGS="-L$with_readline"
630 elif test -f ${with_readline}/include/readline/readline.h; then
631 CONS_INC="-I${with_readline}/include/readline"
632 CONS_LDFLAGS="-L${with_readline}/lib"
633 with_readline="${with_readline}/include/readline"
635 with_readline="/usr/include/readline"
637 AC_CHECK_HEADER(${with_readline}/readline.h,
638 [ AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
639 CONS_LIBS="-lreadline -lhistory -ltermcap"
643 echo "readline.h not found. readline turned off ..."
650 # check for standard readline library
651 AC_CHECK_HEADER(/usr/include/readline/readline.h,
652 [ AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
654 CONS_INC="-I/usr/include/readline"
655 CONS_LIBS="-lreadline -ltermcap"
657 # Did not find standard library, so try Bacula's default
658 AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h,
659 [ AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
661 CONS_INC="-I${TOP_DIR}/depkgs/readline"
662 CONS_LIBS="-lreadline -lhistory -ltermcap"
663 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
664 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
667 echo "readline.h not found. readline turned off ..."
683 AC_SUBST(CONS_LDFLAGS)
684 AC_SUBST(READLINE_SRC)
686 # Minimal stuff for readline Makefile configuration
691 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr lstat lchown)
692 AC_CHECK_FUNCS(nanosleep nl_langinfo)
693 AC_CHECK_HEADERS(varargs.h)
695 # End of readline/conio stuff
696 # -----------------------------------------------------------------------
698 # -----------------------------------------------------------------------
699 # Check for Python support
701 AC_MSG_CHECKING(for Python support)
704 --with-python@<:@=DIR@:>@ Include Python support. DIR is the Python base
705 install directory, default is to search through
706 a number of common places for the Python files.],
710 if test "$withval" != "no"; then
711 if test "$withval" = "yes"; then
712 for python_root in /usr /usr/local /usr/sfw; do
713 for ver in python2.2 python2.3 python2.4 python2.5; do
714 if test -f $python_root/include/${ver}/Python.h; then
715 PYTHON_INCDIR=-I$python_root/include/${ver}
716 if test -d $python_root/lib64/${ver}/config; then
717 PYTHON_LIBS="-L$python_root/lib64/${ver}/config -l${ver}"
719 PYTHON_LIBS="-L$python_root/lib/${ver}/config -l${ver}"
725 if test x$PYTHON_INCDIR = x; then
726 if test -f $prefix/include/Python.h; then
727 PYTHON_INCDIR=-I$prefix/include
728 if test -d $prefix/lib64/config; then
729 PYTHON_LIBS="-L$prefix/lib64/config -lpython"
731 PYTHON_LIBS="-L$prefix/lib/config -lpython"
735 AC_MSG_ERROR(Unable to find Python.h in standard locations)
739 if test -f $withval/Python.h; then
740 PYTHON_INCDIR=-I$withval
741 PYTHON_LIBS="-L$withval/config -lpython"
742 elif test -f $withval/include/Python.h; then
743 PYTHON_INCDIR=-I$withval/include
744 if test -d $withval/lib64/config; then
745 PYTHON_LIBS="-L$withval/lib64/config -lpython"
747 PYTHON_LIBS="-L$withval/lib/config -lpython"
749 elif test -f $withval/include/python/Python.h; then
750 PYTHON_INCDIR=-I$withval/include/python
751 if test -d $withval/lib64/python/config; then
752 PYTHON_LIBS="-L$withval/lib64/python/config -lpython"
754 PYTHON_LIBS="-L$withval/lib/python/config -lpython"
758 AC_MSG_ERROR(Invalid Python directory $withval - unable to find Python.h under $withval)
761 AC_DEFINE([HAVE_PYTHON], 1)
764 AC_MSG_NOTICE(checking for more Python libs)
765 saved_LIBS="$LIBS"; LIBS=
766 AC_SEARCH_LIBS(shm_open, [rt])
767 AC_CHECK_LIB(util, openpty)
768 PYTHON_LIBS="$PYTHON_LIBS $LIBS"
776 AC_SUBST(PYTHON_LIBS)
777 AC_SUBST(PYTHON_INCDIR)
780 # Find where sockets are (especially for Solaris)
781 # Do this before the TCP Wrappers test since tcp wrappers
782 # uses the socket library and some linkers are stupid.
784 AC_CHECK_FUNC(socket,
785 AC_MSG_RESULT(using libc's socket),
786 AC_CHECK_LIB(xnet,socket)
787 AC_CHECK_LIB(socket,socket)
788 AC_CHECK_LIB(inet,socket))
791 # -----------------------------------------------------------
792 # Check whether user wants TCP wrappers support (default off)
793 # -----------------------------------------------------------
796 AC_ARG_WITH(tcp-wrappers,
797 [ --with-tcp-wrappers@<:@=DIR@:>@ enable tcpwrappers support],
799 if test "x$withval" != "xno" ; then
801 LIBS="$saved_LIBS -lwrap"
802 AC_MSG_CHECKING(for libwrap)
803 AC_SEARCH_LIBS(nanosleep, [rt])
805 [ #include <sys/types.h>
807 int deny_severity = 0;
808 int allow_severity = 0;
809 struct request_info *req; ],
810 [ hosts_access(req); ],
813 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
818 LIBS="$saved_LIBS -lwrap -lnsl"
819 WRAPLIBS="$saved_LIBS -lwrap -lnsl"
821 [ #include <sys/types.h>
823 int deny_severity = 0;
824 int allow_severity = 0;
825 struct request_info *req; ],
826 [ hosts_access(req); ],
829 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
834 [AC_MSG_ERROR([*** libwrap missing]) ] ]
841 # -----------------------------------------------------------
842 # Check whether OpenSSL is available
843 # -----------------------------------------------------------
844 AC_MSG_CHECKING([for OpenSSL])
845 dnl The following uses quadrigraphs:
849 AC_HELP_STRING([--with-openssl@<:@=DIR@:>@], [Include OpenSSL support. DIR is the OpenSSL base]),
850 [with_openssl_directory=${withval}])
852 if test "x$with_openssl_directory" != "x"; then
853 OPENSSL_LIBS="-lssl -lcrypto"
856 if test "x$with_openssl_directory" != "xyes" && test x"${with_openssl_directory}" != "x"; then
857 OPENSSL_LIBS="-L$with_openssl_directory/lib $OPENSSL_LIBS"
858 OPENSSL_INC="-I$with_openssl_directory/include $OPENSSL_INC"
862 saved_CFLAGS="${CFLAGS}"
863 LIBS="${saved_LIBS} ${OPENSSL_LIBS}"
864 CFLAGS="${saved_CFLAGS} ${OPENSSL_INC}"
866 AC_TRY_LINK([ #include <openssl/ssl.h> ],
867 [ CRYPTO_set_id_callback(NULL); ],
875 AC_TRY_LINK([ #include <openssl/evp.h> ],
877 [ ac_cv_openssl_sha2="yes" ],
878 [ ac_cv_openssl_sha2="no" ]
881 # Solaris disables greater than 128+ bit encryption in their OpenSSL
882 # implementation, presumably for export reasons. If 192bit AES
883 # is available, we assume that we're running with a 'non-export'
885 AC_TRY_LINK([ #include <openssl/evp.h> ],
886 [ EVP_aes_192_cbc(); ],
887 [ ac_cv_openssl_export="no" ],
888 [ ac_cv_openssl_export="yes" ]
892 CFLAGS="${saved_CFLAGS}"
894 if test "$support_tls" = "yes"; then
895 AC_DEFINE(HAVE_OPENSSL, 1, [Define if OpenSSL library is available])
896 AC_DEFINE(HAVE_TLS, 1, [Define if TLS support should be enabled])
897 AC_DEFINE(HAVE_CRYPTO, 1, [Define if encryption support should be enabled])
900 if test "$ac_cv_openssl_sha2" = "yes"; then
901 AC_DEFINE(HAVE_SHA2, 1, [Define if the SHA-2 family of digest algorithms is available])
904 if test "$ac_cv_openssl_export" = "yes"; then
905 AC_DEFINE(HAVE_OPENSSL_EXPORT_LIBRARY, 1, [Define if the OpenSSL library is export-contrained to 128bit ciphers])
914 AC_MSG_RESULT([$support_tls])
915 AC_SUBST(OPENSSL_LIBS)
916 AC_SUBST(OPENSSL_INC)
919 # -----------------------------------------------------------
920 # Python and OpenSSL are using dlopen
921 # -----------------------------------------------------------
923 if test "$support_python" = "yes" -o "$support_tls" = "yes"; then
924 AC_SEARCH_LIBS(dlopen, [dl])
927 # ------------------------------------------
928 # Where to place working dir
929 # ------------------------------------------
930 working_dir=`eval echo ${prefix}/var/bacula/working`
931 AC_ARG_WITH(working-dir,
932 [ --with-working-dir=PATH specify path of Bacula working directory],
934 if test "x$withval" != "xno" ; then
940 AC_SUBST(working_dir)
943 # ------------------------------------------
944 # Where to place scriptdir (script files)
945 # ------------------------------------------
946 scriptdir=`eval echo ${sysconfdir}`
947 AC_ARG_WITH(scriptdir,
948 [ --with-scriptdir=PATH specify path of Bacula scripts directory],
950 if test "x$withval" != "xno" ; then
959 # ------------------------------------------
960 # Where to send dump email
961 # ------------------------------------------
962 dump_email=root@localhost
963 AC_ARG_WITH(dump-email,
964 [ --with-dump-email=EMAIL dump email address],
966 if test "x$withval" != "xno" ; then
974 # ------------------------------------------
975 # Where to send job email
976 # ------------------------------------------
977 job_email=root@localhost
978 AC_ARG_WITH(job-email,
979 [ --with-job-email=EMAIL job output email address],
981 if test "x$withval" != "xno" ; then
989 # ------------------------------------------
990 # Where to find smtp host
991 # ------------------------------------------
993 AC_ARG_WITH(smtp_host,
994 [ --with-smtp-host=HOST SMTP mail host address],
996 if test "x$withval" != "xno" ; then
1005 # ------------------------------------
1006 # Where to place pid files
1007 # ------------------------------------
1009 AC_ARG_WITH(pid-dir,
1010 [ --with-pid-dir=PATH specify location of Bacula pid files],
1012 if test "x$withval" != "xno" ; then
1018 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
1022 # ------------------------------------
1023 # Where to place subsys "lock file"
1024 # ------------------------------------
1025 subsysdir=/var/run/subsys
1026 if test -d /var/run/subsys; then
1027 subsysdir=/var/run/subsys
1028 elif test -d /var/lock/subsys; then
1029 subsysdir=/var/lock/subsys
1031 subsysdir=/var/run/subsys
1033 AC_ARG_WITH(subsys-dir,
1034 [ --with-subsys-dir=PATH specify location of Bacula subsys file],
1036 if test "x$withval" != "xno" ; then
1046 # ------------------------------------
1047 # Where to start assigning ports
1048 # ------------------------------------
1050 AC_ARG_WITH(baseport,
1051 [ --with-baseport=PORT specify base port address for daemons],
1053 if test "x$withval" != "xno" ; then
1060 dir_port=`expr $baseport`
1061 fd_port=`expr $baseport + 1`
1062 sd_port=`expr $fd_port + 1`
1069 # ------------------------------------------
1070 # Generate passwords
1071 # ------------------------------------------
1073 AC_ARG_WITH(dir-password,
1074 [ --with-dir-password=PASSWORD specify Director's password],
1076 if test "x$withval" != "xno" ; then
1077 dir_password=$withval
1082 if test "x$dir_password" = "x" ; then
1083 if test "x$OPENSSL" = "xnone" ; then
1084 key=`autoconf/randpass 33`
1086 key=`openssl rand -base64 33`
1092 AC_ARG_WITH(fd-password,
1093 [ --with-fd-password=PASSWORD specify Client's password],
1095 if test "x$withval" != "xno" ; then
1096 fd_password=$withval
1101 if test "x$fd_password" = "x" ; then
1102 if test "x$OPENSSL" = "xnone" ; then
1103 key=`autoconf/randpass 37`
1105 key=`openssl rand -base64 33`
1111 AC_ARG_WITH(sd-password,
1112 [ --with-sd-password=PASSWORD specify Storage daemon's password],
1114 if test "x$withval" != "xno" ; then
1115 sd_password=$withval
1120 if test "x$sd_password" = "x" ; then
1121 if test "x$OPENSSL" = "xnone" ; then
1122 key=`autoconf/randpass 41`
1124 key=`openssl rand -base64 33`
1130 AC_ARG_WITH(mon-dir-password,
1131 [ --with-mon-dir-password=PASSWORD specify Director's password used by the monitor],
1133 if test "x$withval" != "xno" ; then
1134 mon_dir_password=$withval
1139 if test "x$mon_dir_password" = "x" ; then
1140 if test "x$OPENSSL" = "xnone" ; then
1141 key=`autoconf/randpass 33`
1143 key=`openssl rand -base64 33`
1145 mon_dir_password=$key
1149 AC_ARG_WITH(mon-fd-password,
1150 [ --with-mon-fd-password=PASSWORD specify Client's password used by the monitor],
1152 if test "x$withval" != "xno" ; then
1153 mon_fd_password=$withval
1158 if test "x$mon_fd_password" = "x" ; then
1159 if test "x$OPENSSL" = "xnone" ; then
1160 key=`autoconf/randpass 37`
1162 key=`openssl rand -base64 33`
1164 mon_fd_password=$key
1168 AC_ARG_WITH(mon-sd-password,
1169 [ --with-mon-sd-password=PASSWORD specify Storage daemon's password used by the monitor],
1171 if test "x$withval" != "xno" ; then
1172 mon_sd_password=$withval
1177 if test "x$mon_sd_password" = "x" ; then
1178 if test "x$OPENSSL" = "xnone" ; then
1179 key=`autoconf/randpass 41`
1181 key=`openssl rand -base64 33`
1183 mon_sd_password=$key
1186 AC_SUBST(dir_password)
1187 AC_SUBST(fd_password)
1188 AC_SUBST(sd_password)
1189 AC_SUBST(mon_dir_password)
1190 AC_SUBST(mon_fd_password)
1191 AC_SUBST(mon_sd_password)
1194 # Pickup any database name
1197 AC_ARG_WITH(db_name,
1198 [ --with-db-name=DBNAME specify database name (default bacula)],
1200 if test "x$withval" != "x" ; then
1208 AC_ARG_WITH(db_user,
1209 [ --with-db-user=UNAME specify database user (default bacula)],
1211 if test "x$withval" != "x" ; then
1220 # Handle users and groups for each daemon
1223 AC_ARG_WITH(dir_user,
1224 [ --with-dir-user=USER specify user for Director daemon],
1226 if test "x$withval" != "x" ; then
1233 AC_ARG_WITH(dir_group,
1234 [ --with-dir-group=GROUP specify group for Director daemon],
1236 if test "x$withval" != "x" ; then
1243 AC_ARG_WITH(sd_user,
1244 [ --with-sd-user=USER specify user for Storage daemon],
1246 if test "x$withval" != "x" ; then
1253 AC_ARG_WITH(sd_group,
1254 [ --with-sd-group=GROUP specify group for Storage daemon],
1256 if test "x$withval" != "x" ; then
1263 AC_ARG_WITH(fd_user,
1264 [ --with-fd-user=USER specify user for File daemon],
1266 if test "x$withval" != "x" ; then
1273 AC_ARG_WITH(fd_group,
1274 [ --with-fd-group=GROUP specify group for File daemon],
1276 if test "x$withval" != "x" ; then
1290 # allow setting default executable permissions
1293 AC_ARG_WITH(sbin-perm,
1294 [ --with-sbin-perm=MODE specify permissions for sbin binaries (0754)],
1296 if test "x$withval" != "x" ; then
1304 # ------------------------------------------------
1305 # Bacula check for various SQL database engines
1306 # ------------------------------------------------
1308 BA_CHECK_POSTGRESQL_DB
1319 # -------------------------------------------
1320 # enable batch attribute DB insert (default on)
1321 # -------------------------------------------
1322 support_batch_insert=no
1323 A=`nm $SQL_LIB | grep pthread_mutex_lock`
1325 if test $pkg = 0; then
1326 support_batch_insert=yes
1327 AC_ARG_ENABLE(batch-insert,
1328 [ --enable-batch-insert enable the DB batch insert code [disabled]],
1329 [if test x$enableval = xno; then
1330 support_batch_insert=no
1332 support_batch_insert=yes
1336 if test $support_batch_insert = yes ; then
1337 AC_DEFINE(HAVE_BATCH_FILE_INSERT, 1, [Set if DB batch insert code enabled])
1341 AC_DEFINE(PROTOTYPES)
1343 dnl# --------------------------------------------------------------------------
1344 dnl# Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
1346 if test -z "$CFLAGS" -o "$CFLAGS" = "-g -O2"; then
1347 if test -z "$CCOPTS"; then
1348 CCOPTS='-g -O2 -Wall'
1357 dnl See if we can use 64 bit file addresses
1358 largefile_support="no"
1364 dnl# --------------------------------------------------------------------------
1365 dnl# CHECKING FOR HEADER FILES
1366 dnl# --------------------------------------------------------------------------
1402 AC_STRUCT_ST_BLKSIZE
1406 dnl# --------------------------------------------------------------------------
1407 dnl# Check for utime.h structure
1408 dnl# --------------------------------------------------------------------------
1409 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
1411 #include <sys/types.h>
1412 #include <utime.h>], [struct utimbuf foo],
1413 ba_cv_header_utime_h=yes, ba_cv_header_utime_h=no)])
1414 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H, 1, [Set if utime.h exists])
1416 dnl# --------------------------------------------------------------------------
1417 dnl# Check for socklen_t
1418 dnl# --------------------------------------------------------------------------
1419 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
1421 #include <sys/types.h>
1422 #include <sys/socket.h>],
1424 ba_cv_header_socklen_t=yes, ba_cv_header_socklen_t=no)])
1425 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T)
1427 dnl# --------------------------------------------------------------------------
1428 dnl# Check for bigendian
1429 dnl# --------------------------------------------------------------------------
1430 AC_CACHE_CHECK([for bigendian], ba_cv_bigendian,
1432 [main(){long a=1L; char *p=(char *)&a; exit(*p);}],
1433 [ba_cv_bigendian=yes],
1434 [ba_cv_bigendian=no],
1435 [ba_cv_bigendian=no])])
1436 test $ba_cv_bigendian = yes && AC_DEFINE(HAVE_BIGENDIAN)
1438 dnl# --------------------------------------------------------------------------
1439 dnl# Check for typeof()
1440 dnl# --------------------------------------------------------------------------
1442 AC_CACHE_CHECK(for typeof, ba_cv_have_typeof,
1444 [main(){char *a = 0; a = (typeof a)a;}],
1445 [ba_cv_have_typeof=yes],
1446 [ba_cv_have_typeof=no],
1447 [ba_cv_have_typeof=no])])
1448 test $ba_cv_have_typeof = yes && AC_DEFINE([HAVE_TYPEOF], 1, [Defind to 1 if compiler has typeof])
1454 dnl# --------------------------------------------------------------------------
1455 dnl# CHECKING FOR FILESYSTEM TYPE
1456 dnl# --------------------------------------------------------------------------
1457 AC_MSG_CHECKING(how to get filesystem type)
1459 # The order of these tests is important.
1460 AC_TRY_CPP([#include <sys/statvfs.h>
1461 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4)
1462 if test $fstype = no; then
1463 AC_TRY_CPP([#include <sys/statfs.h>
1464 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3)
1466 if test $fstype = no; then
1467 AC_TRY_CPP([#include <sys/statfs.h>
1468 #include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX)
1470 if test $fstype = no; then
1471 AC_TRY_CPP([#include <mntent.h>], AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD)
1473 if test $fstype = no; then
1474 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
1476 if test $fstype = no; then
1477 AC_TRY_CPP([#include <sys/mount.h>
1478 #include <sys/fs_types.h>], AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix)
1480 AC_MSG_RESULT($fstype)
1482 AC_CHECK_HEADER(sys/statvfs.h, [ AC_DEFINE(HAVE_SYS_STATVFS_H,1,[Defines if your system have the sys/statvfs.h header file])] , )
1484 dnl# --------------------------------------------------------------------------
1485 dnl# CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
1486 dnl# --------------------------------------------------------------------------
1494 AC_CHECK_TYPE(ino_t, unsigned long)
1495 AC_CHECK_TYPE(dev_t, unsigned long)
1496 AC_CHECK_TYPE(daddr_t, long)
1497 AC_CHECK_TYPE(major_t, int)
1498 AC_CHECK_TYPE(minor_t, int)
1499 AC_CHECK_TYPE(ssize_t, int)
1506 AC_CHECK_SIZEOF(char, 1)
1507 AC_CHECK_SIZEOF(short int, 2)
1508 AC_CHECK_SIZEOF(int, 4)
1509 AC_CHECK_SIZEOF(long int, 4)
1510 AC_CHECK_SIZEOF(long long int, 8)
1511 AC_CHECK_SIZEOF(int *, 4)
1513 # Check for sys/types.h types
1514 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1516 [ #include <sys/types.h> ],
1518 [ ac_cv_have_u_int="yes" ],
1519 [ ac_cv_have_u_int="no" ]
1522 if test "x$ac_cv_have_u_int" = "xyes" ; then
1523 AC_DEFINE(HAVE_U_INT)
1527 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t, [
1529 [ #include <sys/types.h> ],
1530 [ intmax_t a; a = 1;],
1531 [ ac_cv_have_intmax_t="yes" ],
1534 [ #include <stdint.h> ],
1535 [ intmax_t a; a = 1;],
1536 [ ac_cv_have_intmax_t="yes" ],
1537 [ ac_cv_have_intmax_t="no" ]
1543 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
1544 AC_DEFINE(HAVE_INTMAX_T)
1549 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t, [
1551 [ #include <sys/types.h> ],
1552 [ u_intmax_t a; a = 1;],
1553 [ ac_cv_have_u_intmax_t="yes" ],
1556 [ #include <stdint.h> ],
1557 [ u_intmax_t a; a = 1;],
1558 [ ac_cv_have_u_intmax_t="yes" ],
1559 [ ac_cv_have_u_intmax_t="no" ]
1564 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
1565 AC_DEFINE(HAVE_U_INTMAX_T)
1570 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1572 [ #include <sys/types.h> ],
1573 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1574 [ ac_cv_have_intxx_t="yes" ],
1575 [ ac_cv_have_intxx_t="no" ]
1578 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1579 AC_DEFINE(HAVE_INTXX_T)
1583 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1585 [ #include <sys/types.h> ],
1586 [ int64_t a; a = 1;],
1587 [ ac_cv_have_int64_t="yes" ],
1588 [ ac_cv_have_int64_t="no" ]
1591 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1592 AC_DEFINE(HAVE_INT64_T)
1596 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1598 [ #include <sys/types.h> ],
1599 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1600 [ ac_cv_have_u_intxx_t="yes" ],
1601 [ ac_cv_have_u_intxx_t="no" ]
1604 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1605 AC_DEFINE(HAVE_U_INTXX_T)
1609 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1611 [ #include <sys/types.h> ],
1612 [ u_int64_t a; a = 1;],
1613 [ ac_cv_have_u_int64_t="yes" ],
1614 [ ac_cv_have_u_int64_t="no" ]
1617 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1618 AC_DEFINE(HAVE_U_INT64_T)
1622 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1623 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1625 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1627 [ #include <sys/bitypes.h> ],
1628 [ int8_t a; int16_t b; int32_t c;
1629 u_int8_t e; u_int16_t f; u_int32_t g;
1630 a = b = c = e = f = g = 1; ],
1631 [ AC_DEFINE(HAVE_U_INTXX_T)
1632 AC_DEFINE(HAVE_INTXX_T)
1633 AC_DEFINE(HAVE_SYS_BITYPES_H)
1634 AC_MSG_RESULT(yes) ],
1635 [ AC_MSG_RESULT(no)]
1639 if test -z "$have_u_intxx_t" ; then
1640 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1642 [ #include <sys/types.h> ],
1643 [ uint8_t a; uint16_t b;
1644 uint32_t c; a = b = c = 1; ],
1645 [ ac_cv_have_uintxx_t="yes" ],
1646 [ ac_cv_have_uintxx_t="no" ]
1649 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1650 AC_DEFINE(HAVE_UINTXX_T)
1654 if (test -z "$have_u_int64_t" || test -z "$have_int64_t" && \
1655 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1657 AC_MSG_CHECKING([for int64_t and u_int64_t types in sys/bitypes.h])
1659 [ #include <sys/bitypes.h> ],
1660 [ int64_t a; u_int64_t b;
1662 [ AC_DEFINE(HAVE_U_INT64_T)
1663 AC_DEFINE(HAVE_INT64_T)
1664 AC_MSG_RESULT(yes) ],
1665 [ AC_MSG_RESULT(no)]
1669 if (test -z "$have_uintxx_t" && \
1670 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1672 AC_MSG_CHECKING([for uintXX_t types in sys/bitypes.h])
1674 [ #include <sys/bitypes.h> ],
1675 [ uint8_t a; uint16_t b;
1676 uint32_t c; a = b = c = 1; ],
1677 [ AC_DEFINE(HAVE_UINTXX_T)
1678 AC_MSG_RESULT(yes) ],
1679 [ AC_MSG_RESULT(no)]
1687 dnl# --------------------------------------------------------------------------
1688 dnl# CHECKING FOR REQUIRED LIBRARY FUNCTIONS
1689 dnl# --------------------------------------------------------------------------
1705 [echo 'configure: cannot find needed function.'; exit 1]
1708 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
1709 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
1710 AC_CHECK_FUNCS(posix_fadvise)
1711 AC_CHECK_FUNCS(fdatasync)
1713 AC_CHECK_FUNCS(chflags)
1715 AC_CHECK_FUNCS(snprintf vsnprintf gethostid fseeko)
1717 AC_CACHE_CHECK(for va_copy, ba_cv_va_copy,
1720 void use_va_copy(va_list args){va_list args2; va_copy(args2,args); va_end(args2);}
1721 void call_use_va_copy(int junk,...){va_list args; va_start(args,junk); use_va_copy(args); va_end(args);}
1723 [call_use_va_copy(1,2,3)],
1724 ba_cv_va_copy=yes, ba_cv_va_copy=no)])
1725 test $ba_cv_va_copy = yes && AC_DEFINE(HAVE_VA_COPY, 1, [Set if va_copy exists])
1728 dnl# --------------------------------------------------------------------------
1729 dnl# CHECKING FOR THREAD SAFE FUNCTIONS
1730 dnl# --------------------------------------------------------------------------
1731 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
1733 # If resolver functions are not in libc check for -lnsl or -lresolv.
1734 AC_CHECK_FUNC(gethostbyname_r,
1735 AC_MSG_RESULT(using libc's resolver),
1736 AC_CHECK_LIB(nsl,gethostbyname_r)
1737 AC_CHECK_LIB(resolv,gethostbyname_r))
1741 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
1742 AC_CHECK_FUNCS(inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)])
1743 AC_CHECK_FUNCS(gethostbyname2, [AC_DEFINE(HAVE_GETHOSTBYNAME2)])
1745 dnl ----------------------------
1746 dnl check sa_len of sockaddr
1747 dnl ----------------------------
1748 AC_CACHE_CHECK(for struct sockaddr has a sa_len field, ac_cv_struct_sockaddr_sa_len,
1749 [AC_TRY_COMPILE([#include <sys/socket.h>], [struct sockaddr s; s.sa_len;],
1750 ac_cv_struct_sockaddr_sa_len=yes, ac_cv_struct_sockaddr_sa_len=no)])
1752 if test $ac_cv_struct_sockaddr_sa_len = yes; then
1753 AC_DEFINE(HAVE_SA_LEN, 1, [Define if sa_len field exists in struct sockaddr])
1763 AC_FUNC_CLOSEDIR_VOID
1764 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
1765 # AC_FUNC_FNMATCH dnl use local version
1768 AC_CHECK_LIB(intl, gettext, [LIBS="$LIBS -lintl"])
1771 AC_CHECK_LIB(sun, getpwnam)
1773 AC_CHECK_HEADERS(zlib.h)
1774 AC_CHECK_LIB(z, deflate, [FDLIBS="-lz"])
1776 if test x$FDLIBS = x-lz; then
1777 AC_DEFINE(HAVE_LIBZ)
1782 # Check for ACL libraries
1785 AC_CHECK_HEADER(sys/acl.h)
1786 AC_CHECK_FUNC(acl_get_file, [have_acl=yes],
1787 [AC_CHECK_LIB(acl, acl_get_file, [have_acl=yes; FDLIBS="-lacl $FDLIBS"],
1788 [AC_CHECK_LIB(sec, acltotext, [have_acl=yes; FDLIBS="-lsec $FDLIBS"])]
1791 if test $have_acl = yes; then
1795 dnl Check for pthread libraries
1797 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
1798 [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
1799 [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
1800 [AC_CHECK_FUNC(pthread_create)]
1811 if test x$have_gcc = xyes ; then
1812 CPPFLAGS="$CPPFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
1813 CFLAGS="$CFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
1815 LDFLAGS=${LDFLAGS--O}
1816 DB_LIBS="${SQL_LFLAGS}"
1817 CPPFLAGS="$CPPFLAGS"
1830 AC_SUBST(X_EXTRA_LIBS)
1835 dnl# extra configurable objects
1846 # Finally we set appropriate distribution specific
1847 # variables and defaults
1849 # PFILES are platform specific files
1850 PFILES="platforms/Makefile"
1854 hostname=`uname -n | cut -d '.' -f 1`
1855 if test x${hostname} = x ; then
1856 hostname="localhost"
1861 PSCMD="ps -e -o pid,comm"
1863 platforms/aix/Makefile"
1864 TAPEDRIVE="/dev/rmt0.1"
1868 PTHREAD_LIB="-lpthread -lexc"
1869 if test "${CC}" = "gcc" ; then
1876 TAPEDRIVE="/dev/nrmt0"
1879 DISTVER=`uname -a |awk '{print $3}'`
1880 TAPEDRIVE="/dev/nrmt0"
1881 PTHREAD_LIB="-pthread"
1882 CFLAGS="${CFLAGS} -pthread"
1883 PSCMD="ps -ax -o pid,command"
1887 platforms/bsdi/Makefile \
1888 platforms/bsdi/bacula-fd \
1889 platforms/bsdi/bacula-sd \
1890 platforms/bsdi/bacula-dir"
1891 largefile_support="yes"
1894 DISTVER=`uname -a |awk '{print $3}'`
1895 TAPEDRIVE="/dev/nrst0"
1898 WLDFLAGS="-mwindows"
1902 TAPEDRIVE="/dev/nst0"
1903 PSCMD="ps -e -o pid,command"
1906 platforms/darwin/Makefile"
1909 DISTVER=`cat /etc/debian_version`
1910 TAPEDRIVE="/dev/nrst0"
1911 PSCMD="ps -e -o pid,command"
1914 DISTVER=`uname -a |awk '{print $3}'`
1915 VER=`echo $DISTVER | cut -c 1`
1916 if test x$VER = x4 ; then
1917 PTHREAD_LIB="${PTHREAD_LIBS:--pthread}"
1918 CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS:--pthread}"
1922 TAPEDRIVE="/dev/nrsa0"
1923 PSCMD="ps -ax -o pid,command"
1925 platforms/freebsd/Makefile \
1926 platforms/freebsd/bacula-fd \
1927 platforms/freebsd/bacula-sd \
1928 platforms/freebsd/bacula-dir"
1929 largefile_support="yes"
1932 PSCMD="UNIX95=1; ps -e -o pid,comm"
1933 CFLAGS="${CFLAGS} -D_XOPEN_SOURCE_EXTENDED=1"
1935 TAPEDRIVE="/dev/rmt/0hnb"
1936 PTHREAD_LIB="-lpthread"
1937 AC_DEFINE([_INCLUDE_LONGLONG])
1941 TAPEDRIVE="/dev/rmt/0cbn"
1942 PSCMD="ps -e -o pid,comm"
1944 platforms/irix/Makefile \
1945 platforms/irix/bacula-fd \
1946 platforms/irix/bacula-sd \
1947 platforms/irix/bacula-dir"
1950 DISTVER=`uname -a |awk '{print $3}'`
1953 TAPEDRIVE="/dev/nrst0"
1954 PSCMD="ps -ax -o pid,command"
1955 PTHREAD_LIB="-pthread"
1956 CFLAGS="${CFLAGS} -pthread"
1959 DISTVER=`uname -a |awk '{print $3}'`
1962 TAPEDRIVE="/dev/nrst0"
1963 PSCMD="ps -ax -o pid,command"
1964 PTHREAD_LIB="-pthread"
1965 CFLAGS="${CFLAGS} -pthread"
1967 platforms/openbsd/Makefile \
1968 platforms/openbsd/bacula-fd \
1969 platforms/openbsd/bacula-sd \
1970 platforms/openbsd/bacula-dir"
1973 if test -f /etc/whitebox-release ; then
1974 f=/etc/whitebox-release
1976 f=/etc/redhat-release
1978 if test `cat $f | grep release |\
1979 cut -f 3 -d ' '`x = "Enterprise"x ; then
1980 DISTVER="Enterprise "`cat $f | grep release |\
1983 DISTVER=`cat /etc/redhat-release | grep release |\
1986 TAPEDRIVE="/dev/nst0"
1987 PSCMD="ps -e -o pid,command"
1989 platforms/redhat/Makefile \
1990 platforms/redhat/bacula-fd \
1991 platforms/redhat/bacula-sd \
1992 platforms/redhat/bacula-dir \
1993 platforms/redhat/bacula.spec \
1997 DISTVER=`cat /etc/mandrake-release | grep release |\
1999 TAPEDRIVE="/dev/nst0"
2000 PSCMD="ps -e -o pid,command"
2002 platforms/mandrake/Makefile \
2003 platforms/mandrake/bacula-fd \
2004 platforms/mandrake/bacula-sd \
2005 platforms/mandrake/bacula-dir \
2006 platforms/mandrake/bacula.spec \
2010 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
2011 TAPEDRIVE="/dev/nst0"
2012 PSCMD="ps -e -o pid,command"
2014 platforms/gentoo/Makefile \
2015 platforms/gentoo/bacula-init \
2016 platforms/gentoo/bacula-fd \
2017 platforms/gentoo/bacula-sd \
2018 platforms/gentoo/bacula-dir"
2021 DISTVER=`cat /etc/slackware-version`
2022 TAPEDRIVE="/dev/nst0"
2023 PSCMD="ps -e -o pid,command"
2025 platforms/slackware/Makefile \
2026 platforms/slackware/rc.bacula-fd \
2027 platforms/slackware/rc.bacula-sd \
2028 platforms/slackware/rc.bacula-dir\
2029 platforms/slackware/functions.bacula"
2033 TAPEDRIVE="/dev/rmt/0cbn"
2034 PSCMD="ps -e -o pid,comm"
2036 platforms/solaris/Makefile \
2037 platforms/solaris/bacula-fd \
2038 platforms/solaris/bacula-sd \
2039 platforms/solaris/bacula-dir"
2040 if test x$DISTVER = x5.6 ; then
2041 AC_DEFINE(HAVE_OLD_SOCKOPT)
2043 LIBS="$LIBS -lresolv"
2046 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
2048 TAPEDRIVE="/dev/nst0"
2049 PSCMD="ps -e -o pid,command"
2051 platforms/suse/Makefile \
2052 platforms/suse/bacula-fd \
2053 platforms/suse/bacula-sd \
2054 platforms/suse/bacula-dir \
2055 platforms/suse/bacula \
2056 platforms/suse/bacula.spec"
2061 TAPEDRIVE="/dev/nst0"
2062 PSCMD="ps -e -o pid,command"
2064 platforms/suse/Makefile \
2065 platforms/suse/bacula-fd \
2066 platforms/suse/bacula-sd \
2067 platforms/suse/bacula-dir"
2071 TAPEDRIVE="/dev/nst0"
2074 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
2080 LIBS="$PTHREAD_LIB $LIBS"
2082 AC_DEFINE_UNQUOTED(lld, "$lld")
2083 AC_DEFINE_UNQUOTED(llu, "$llu")
2091 dnl# common parts of the Makefile
2092 MCOMMON=./autoconf/Make.common
2093 AC_SUBST_FILE(MCOMMON)
2096 if test "x${subsysdir}" = "x${sbindir}" ; then
2099 echo "You have set both --sbindir and --with-subsys-dir"
2100 echo " equal to: ${subsysdir} "
2101 echo "This is not permitted. Please reconfigure."
2103 echo "Aborting configuration ..."
2109 AC_OUTPUT([autoconf/Make.common \
2112 scripts/startmysql \
2114 scripts/btraceback \
2120 scripts/bacula-ctl-dir \
2121 scripts/bacula-ctl-fd \
2122 scripts/bacula-ctl-sd \
2123 scripts/devel_bacula \
2126 scripts/bacula.desktop.gnome1 \
2127 scripts/bacula.desktop.gnome2 \
2128 scripts/bacula.desktop.gnome1.consolehelper \
2129 scripts/bacula.desktop.gnome2.consolehelper \
2130 scripts/bacula.desktop.gnome1.xsu \
2131 scripts/bacula.desktop.gnome2.xsu \
2132 scripts/bgnome-console.console_apps \
2133 scripts/mtx-changer \
2134 scripts/disk-changer \
2135 scripts/dvd-handler \
2136 scripts/dvd-simulator \
2137 scripts/bacula-tray-monitor.desktop \
2138 scripts/logwatch/Makefile \
2139 scripts/logwatch/logfile.bacula.conf \
2140 scripts/wxconsole.console_apps \
2141 scripts/wxconsole.desktop.consolehelper \
2142 scripts/wxconsole.desktop.xsu \
2143 scripts/bat.desktop \
2144 scripts/bat.desktop.xsu \
2145 scripts/bat.desktop.consolehelper \
2146 scripts/bat.console_apps \
2149 src/console/Makefile \
2150 src/console/bconsole.conf \
2151 src/gnome2-console/Makefile \
2152 src/gnome2-console/bgnome-console.conf \
2153 src/qt-console/bat.conf \
2154 src/qt-console/bat.pro \
2155 src/qt-console/install_conf_file \
2156 src/wx-console/Makefile \
2157 src/wx-console/bwx-console.conf \
2158 src/tray-monitor/Makefile \
2159 src/tray-monitor/tray-monitor.conf \
2161 src/dird/bacula-dir.conf \
2163 src/stored/Makefile \
2164 src/stored/bacula-sd.conf \
2165 src/filed/Makefile \
2166 src/filed/bacula-fd.conf \
2168 src/cats/make_catalog_backup \
2169 src/cats/delete_catalog_backup \
2170 src/cats/create_postgresql_database \
2171 src/cats/update_postgresql_tables \
2172 src/cats/make_postgresql_tables \
2173 src/cats/grant_postgresql_privileges \
2174 src/cats/drop_postgresql_tables \
2175 src/cats/drop_postgresql_database \
2176 src/cats/create_mysql_database \
2177 src/cats/update_mysql_tables \
2178 src/cats/make_mysql_tables \
2179 src/cats/grant_mysql_privileges \
2180 src/cats/drop_mysql_tables \
2181 src/cats/drop_mysql_database \
2182 src/cats/create_sqlite_database \
2183 src/cats/update_sqlite_tables \
2184 src/cats/make_sqlite_tables \
2185 src/cats/grant_sqlite_privileges \
2186 src/cats/drop_sqlite_tables \
2187 src/cats/drop_sqlite_database \
2188 src/cats/create_sqlite3_database \
2189 src/cats/update_sqlite3_tables \
2190 src/cats/make_sqlite3_tables \
2191 src/cats/grant_sqlite3_privileges \
2192 src/cats/drop_sqlite3_tables \
2193 src/cats/drop_sqlite3_database \
2196 src/cats/create_bdb_database \
2197 src/cats/update_bdb_tables \
2198 src/cats/make_bdb_tables \
2199 src/cats/grant_bdb_privileges \
2200 src/cats/drop_bdb_tables \
2201 src/cats/drop_bdb_database \
2202 src/cats/create_bacula_database \
2203 src/cats/update_bacula_tables \
2204 src/cats/grant_bacula_privileges \
2205 src/cats/make_bacula_tables \
2206 src/cats/drop_bacula_tables \
2207 src/cats/drop_bacula_database \
2208 src/findlib/Makefile \
2209 src/tools/Makefile \
2215 if test "${support_bat}" = "yes" ; then
2217 chmod 755 install_conf_file build-depkgs-qt-console
2218 echo "Creating bat Makefile"
2223 echo "Doing make of dependencies"
2224 ${MAKE:-make} depend
2227 chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
2228 chmod 755 dvd-handler dvd-simulator
2229 chmod 755 bconsole gconsole mtx-changer devel_bacula logrotate
2234 chmod 755 $c/create_bacula_database $c/update_bacula_tables $c/make_bacula_tables
2235 chmod 755 $c/grant_bacula_privileges $c/drop_bacula_tables $c/drop_bacula_database
2237 chmod 755 $c/create_bdb_database $c/update_bdb_tables $c/make_bdb_tables
2238 chmod 755 $c/grant_bdb_privileges $c/drop_bdb_tables $c/drop_bdb_database
2240 chmod 755 $c/create_mysql_database $c/update_mysql_tables $c/make_mysql_tables
2241 chmod 755 $c/grant_mysql_privileges $c/drop_mysql_tables $c/drop_mysql_database
2243 chmod 755 $c/create_sqlite_database $c/update_sqlite_tables $c/make_sqlite_tables
2244 chmod 755 $c/grant_sqlite_privileges $c/drop_sqlite_tables $c/drop_sqlite_database
2246 chmod 755 $c/create_sqlite3_database $c/update_sqlite3_tables $c/make_sqlite3_tables
2247 chmod 755 $c/grant_sqlite3_privileges $c/drop_sqlite3_tables $c/drop_sqlite3_database
2249 chmod 755 $c/create_postgresql_database $c/update_postgresql_tables $c/make_postgresql_tables
2250 chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables $c/drop_postgresql_database
2252 chmod 755 $c/make_catalog_backup $c/delete_catalog_backup
2256 chmod 755 src/win32/build-depkgs-mingw32
2260 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
2261 largefile_support="yes"
2265 # A whole lot of hand springs to get the compiler version.
2266 # This is because gcc changed the output in version 3.0
2268 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
2269 if test "x${CCVERSION}" = "x" ; then
2270 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
2272 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
2273 if test x"${CXXVERSION}" = x ; then
2274 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
2277 if test "x${subsysdir}" = "x${sbindir}" ; then
2280 echo "You have set --sbindir and --with-subsys-dir"
2281 echo " both equal to: ${subsysdir} "
2282 echo " This is not permitted. Please reconfigure."
2284 echo "Aborting configuration ..."
2290 if test "x${db_type}" = "xInternal" ; then
2293 echo "You have not specified either --enable-client-only or one of the"
2294 echo " supported databases: MySQL, PostgreSQL, SQLite3 or SQLite."
2295 echo " This is not permitted. Please reconfigure."
2297 echo "Aborting the configuration ..."
2304 Configuration on `date`:
2306 Host: $host -- ${DISTNAME} ${DISTVER}
2307 Bacula version: ${VERSION} (${DATE})
2308 Source code location: ${srcdir}
2309 Install binaries: ${sbindir}
2310 Install config files: ${sysconfdir}
2311 Scripts directory: ${scriptdir}
2312 Working directory: ${working_dir}
2313 PID directory: ${piddir}
2314 Subsys directory: ${subsysdir}
2315 Man directory: ${mandir}
2316 Data directory: ${datadir}
2317 C Compiler: ${CC} ${CCVERSION}
2318 C++ Compiler: ${CXX} ${CXXVERSION}
2319 Compiler flags: ${WCFLAGS} ${CFLAGS}
2320 Linker flags: ${WLDFLAGS} ${LDFLAGS}
2322 Statically Linked Tools: ${support_static_tools}
2323 Statically Linked FD: ${support_static_fd}
2324 Statically Linked SD: ${support_static_sd}
2325 Statically Linked DIR: ${support_static_dir}
2326 Statically Linked CONS: ${support_static_cons}
2327 Database type: ${db_type}
2328 Database lib: ${DB_LIBS}
2329 Database name: ${db_name}
2330 Database user: ${db_user}
2332 Job Output Email: ${job_email}
2333 Traceback Email: ${dump_email}
2334 SMTP Host Address: ${smtp_host}
2336 Director Port: ${dir_port}
2337 File daemon Port: ${fd_port}
2338 Storage daemon Port: ${sd_port}
2340 Director User: ${dir_user}
2341 Director Group: ${dir_group}
2342 Storage Daemon User: ${sd_user}
2343 Storage DaemonGroup: ${sd_group}
2344 File Daemon User: ${fd_user}
2345 File Daemon Group: ${fd_group}
2347 SQL binaries Directory ${SQL_BINDIR}
2349 Large file support: $largefile_support
2350 Bacula conio support: ${got_conio} ${CONS_LIBS}
2351 readline support: ${got_readline} ${PRTREADLINE_SRC}
2352 TCP Wrappers support: ${TCPW_MSG} ${WRAPLIBS}
2353 TLS support: ${support_tls}
2354 Encryption support: ${support_crypto}
2355 ZLIB support: ${have_zlib}
2356 enable-smartalloc: ${support_smartalloc}
2357 bat support: ${support_bat} ${QWT_LDFLAGS}
2358 enable-gnome: ${support_gnome} ${gnome_version}
2359 enable-bwx-console: ${support_wx_console} ${wx_version}
2360 enable-tray-monitor: ${support_tray_monitor}
2361 client-only: ${build_client_only}
2362 build-dird: ${build_dird}
2363 build-stored: ${build_stored}
2364 ACL support: ${have_acl}
2365 Python support: ${support_python} ${PYTHON_LIBS}
2366 Batch insert enabled: ${support_batch_insert}