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}`
168 # ------------------------------------------------------------------
169 # If the user has not set --archivedir, we set our default as /tmp
170 # ------------------------------------------------------------------
171 if test x$archivedir = x'${archivedir}' ; then
172 archivedir=${archivedir}
174 archivedir=`eval echo ${archivedir}`
176 # -------------------------------------------------------------------------
177 # If the user has not set --mandir, we default to /usr/share/man
178 # -------------------------------------------------------------------------
179 if test x$mandir = x'${prefix}/man' ; then
180 mandir=/usr/share/man
184 AC_PATH_PROGS(MSGFMT, msgfmt, no)
185 if test "$MSGFMT" = "no"
187 echo 'msgfmt program not found, disabling NLS !'
189 USE_INCLUDED_LIBINTL=no
198 support_postgresql=no
199 support_smartalloc=yes
204 support_wx_console=no
209 support_static_tools=no
212 support_static_dir=no
213 support_static_cons=no
222 dnl# --------------------------------------------------------------------------
223 dnl# CHECKING COMMAND LINE OPTIONS
224 dnl# --------------------------------------------------------------------------
226 # -------------------------------------------
227 # gnome (default off)
228 # -------------------------------------------
230 [ --enable-gnome enable build of bgnome-console GUI [disabled]],
231 [if test x$enableval = xyes; then
236 if test x$support_gnome = xyes; then
237 abc=`$PKGCONFIG --exists libgnomeui-2.0`
239 if test $pkg = 0; then
240 GNOME_INCLUDEDIR=`$PKGCONFIG --cflags-only-I libgnomeui-2.0`
241 GNOMEUI_LIBS=`$PKGCONFIG --libs-only-l libgnomeui-2.0`
242 GNOME_LIBDIR=`$PKGCONFIG --libs libgnomeui-2.0`
243 GNOME_LIBS=`$PKGCONFIG --libs-only-l libgnomeui-2.0`
244 AC_SUBST(GNOME_INCLUDEDIR)
245 AC_SUBST(GNOMEUI_LIBS)
246 AC_SUBST(GNOME_LIBDIR)
248 GNOME_DIR=src/gnome2-console
249 gnome_version="Version 2.x"
251 AC_MSG_ERROR(Unable to find Gnome 2 installation)
256 # -------------------------------------------
258 # -------------------------------------------
260 [ --enable-bat enable build of bat Qt4 GUI [disabled]],
261 [if test x$enableval = xyes; then
262 AC_DEFINE(HAVE_BAT, 1, [Set if Bacula bat Qt4 GUI support enabled])
267 if test x$support_bat = xyes; then
268 abc=`$PKGCONFIG --atleast-version=4.2 QtGui`
270 if test $pkg = 0; then
271 BAT_DIR=src/qt-console
273 AC_MSG_ERROR(Unable to find Qt4 installation needed by bat)
278 # If bat is enabled, we need the qwt library
282 if test x$support_bat = xyes; then
283 AC_MSG_CHECKING(for qwt support)
285 [ --with-qwt@<:@=DIR@:>@ specify qwt library directory],
291 if test -f ${with_qwt}/include/qwt.h; then
292 QWT_INC="${with_qwt}/include"
293 QWT_LDFLAGS="-L${with_qwt}/lib"
300 # Search in standard places, or --with-qwt not specified
302 if test x$QWT_INC = x; then
303 for root in /usr /usr/local; do
304 for ver in qwt qwt5 qwt-qt4; do
305 if test -f ${root}/include/${ver}/qwt.h; then
306 QWT_INC="${root}/include/${ver}"
307 if test -d ${root}/lib64/; then
308 QWT_LDFLAGS="-L${root}/lib64"
310 QWT_LDFLAGS="-L${root}/lib"
318 if test x$QWT_INC = x; then
320 AC_MSG_ERROR(Unable to find qwt package needed by bat)
330 AC_SUBST(QWT_LDFLAGS)
333 # -------------------------------------------
334 # bwx-console (default off)
335 # -------------------------------------------
336 AC_ARG_ENABLE(bwx-console,
337 [ --enable-bwx-console enable build of wxWidgets console [disabled]],
338 [if test x$enableval = xyes; then
339 support_wx_console=yes
343 if test x$support_wx_console = xyes; then
344 abc=`$WXCONFIG $WXFLAGS --cppflags`
346 if test $pkg = 0; then
347 wx_version="wxWidgets `$WXCONFIG $WXFLAGS --release`"
348 WXCONS_CPPFLAGS=`$WXCONFIG $WXFLAGS --cppflags`
349 WXCONS_LDFLAGS=`$WXCONFIG $WXFLAGS --libs`
351 AC_SUBST(WXCONS_CPPFLAGS)
352 AC_SUBST(WXCONS_LDFLAGS)
353 WX_DIR=src/wx-console
356 echo "wx-config program not found. bwx-console disabled."
358 support_wx_console=no
364 # -------------------------------------------
365 # tray-monitor (default off)
366 # -------------------------------------------
367 AC_ARG_ENABLE(tray-monitor,
368 [ --enable-tray-monitor enable build of Gnome tray monitor (compatible with KDE) [disabled]],
369 [if test x$enableval = xyes; then
370 support_tray_monitor=yes
374 if test x$support_tray_monitor = xyes; then
375 abc=`$PKGCONFIG --exists gtk+-2.0`
377 if test $pkg = 0; then
378 TRAY_MONITOR_CPPFLAGS=`$PKGCONFIG --cflags gtk+-2.0`
379 TRAY_MONITOR_LDFLAGS=`$PKGCONFIG --libs gtk+-2.0`
380 AC_SUBST(TRAY_MONITOR_CPPFLAGS)
381 AC_SUBST(TRAY_MONITOR_LDFLAGS)
382 TRAY_MONITOR_DIR=src/tray-monitor
383 abc=`$PKGCONFIG --atleast-version=2.4 gtk+-2.0`
385 if test $pkg = 0; then
386 AC_DEFINE(HAVE_GTK_2_4, 1, [Set if you have GTK 4.2 or greater loaded])
390 AC_SUBST(TRAY_MONITOR_DIR)
392 # -------------------------------------------
393 # smartalloc (default off)
394 # -------------------------------------------
395 AC_ARG_ENABLE(smartalloc,
396 [ --enable-smartalloc enable smartalloc debugging support [disabled]],
397 [if test x$enableval = xno; then
398 support_smartalloc=no
401 if test x$support_smartalloc = xyes; then
402 AC_DEFINE(SMARTALLOC, 1, [Set if you want Smartalloc enabled])
405 # -------------------------------------------
406 # static-tools (default off)
407 # -------------------------------------------
408 AC_ARG_ENABLE(static-tools,
409 [ --enable-static-tools enable static tape tools [disabled]],
410 [if test x$enableval = xyes; then
411 support_static_tools=yes
415 if test x$support_static_tools = xyes; then
416 TTOOL_LDFLAGS="-static"
418 AC_SUBST(TTOOL_LDFLAGS)
420 # -------------------------------------------
421 # static-fd (default off)
422 # -------------------------------------------
423 AC_ARG_ENABLE(static-fd,
424 [ --enable-static-fd enable static File daemon [disabled]],
425 [if test x$enableval = xyes; then
426 support_static_fd=yes
430 if test x$support_static_fd = xyes; then
431 STATIC_FD="static-bacula-fd"
435 # -------------------------------------------
436 # static-sd (default off)
437 # -------------------------------------------
438 AC_ARG_ENABLE(static-sd,
439 [ --enable-static-sd enable static Storage daemon [disabled]],
440 [if test x$enableval = xyes; then
441 support_static_sd=yes
445 if test x$support_static_sd = xyes; then
446 STATIC_SD="static-bacula-sd"
450 # -------------------------------------------
451 # static-dir (default off)
452 # -------------------------------------------
453 AC_ARG_ENABLE(static-dir,
454 [ --enable-static-dir enable static Director [disabled]],
455 [if test x$enableval = xyes; then
456 support_static_dir=yes
460 if test x$support_static_dir = xyes; then
461 STATIC_DIR="static-bacula-dir"
465 # -------------------------------------------
466 # static-cons (default off)
467 # -------------------------------------------
468 AC_ARG_ENABLE(static-cons,
469 [ --enable-static-cons enable static Console [disabled]],
470 [if test x$enableval = xyes; then
471 support_static_cons=yes
477 if test x$support_static_cons = xyes; then
478 STATIC_CONS="static-bconsole"
479 STATIC_GNOME_CONS="static-bgnome-console"
480 STATIC_WX_CONS="static-bwx-console"
482 AC_SUBST(STATIC_CONS)
483 AC_SUBST(STATIC_GNOME_CONS)
484 AC_SUBST(STATIC_WX_CONS)
486 # -------------------------------------------
487 # client_only (default off)
488 # -------------------------------------------
489 AC_ARG_ENABLE(client-only,
490 [ --enable-client-only build client (File daemon) only [disabled]],
491 [if test x$enableval = xyes; then
492 build_client_only=yes
496 if test x$build_client_only = xno; then
503 # -------------------------------------------
504 # director (default on)
505 # -------------------------------------------
506 AC_ARG_ENABLE(build-dird,
507 [ --enable-build-dird enable building of dird (Director) [enabled]],
508 [if test x$enableval = xno; then
511 if test x$build_dird = xyes; then
516 DIR_TOOLS="NODIRTOOLS"
521 # -------------------------------------------
522 # stored (default on)
523 # -------------------------------------------
524 AC_ARG_ENABLE(build-stored,
525 [ --enable-build-stored enable building of stored (Storage daemon) [enabled]],
526 [if test x$enableval = xno; then
529 if test x$build_stored = xyes; then
530 STORED_DIR="src/stored"
536 # ---------------------------------------------------
537 # Check for conio (Bacula readline substitute)(
538 # ---------------------------------------------------
539 # this allows you to turn it completely off
541 [ --disable-conio disable conio support [enabled]
543 [if test x$enableval = xno; then
549 # ---------------------------------------------------
550 # Check for IPv6 support
551 # ---------------------------------------------------
552 # this allows you to turn it completely off
555 [ --enable-ipv6 enable ipv6 support [enabled]
557 [if test x$enableval = xno; then
562 if test x$support_ipv6 = xyes; then
563 AC_TRY_LINK([ #include <sys/types.h>
564 #include <sys/socket.h>
565 #include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;],
566 [support_ipv6=yes], [support_ipv6=no])
569 if test x$support_ipv6 = xyes; then
570 AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
576 if test x$support_conio = xyes; then
577 AC_CHECK_HEADER(termcap.h,
578 [ AC_CHECK_LIB(termcap, tgetent,
579 [ CONS_LIBS="-ltermcap"
584 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
586 [ AC_CHECK_LIB(ncurses, tgetent,
587 [ CONS_LIBS="-lncurses"
592 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
597 AC_CHECK_HEADERS(curses.h)
598 AC_CHECK_HEADER(term.h,
599 [ AC_CHECK_LIB(curses, tgetent,
600 [ CONS_LIBS="-lcurses"
605 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
608 [ echo " "; echo "Required libraries not found. CONIO turned off ..."; echo " "],
617 # ---------------------------------------------------
618 # Check for readline support/directory (default off)
619 # ---------------------------------------------------
620 # this allows you to turn it completely off
621 AC_ARG_ENABLE(readline,
622 [ --disable-readline disable readline support [disable]
624 [if test x$enableval = xno; then
630 if test x$support_readline = xyes; then
631 AC_ARG_WITH(readline,
632 [ --with-readline@<:@=DIR@:>@ specify readline library directory],
634 case "$with_readline" in
637 if test -f ${with_readline}/readline.h; then
638 CONS_INC="-I${with_readline}"
639 CONS_LDFLAGS="-L$with_readline"
640 elif test -f ${with_readline}/include/readline/readline.h; then
641 CONS_INC="-I${with_readline}/include/readline"
642 CONS_LDFLAGS="-L${with_readline}/lib"
643 with_readline="${with_readline}/include/readline"
645 with_readline="/usr/include/readline"
647 AC_CHECK_HEADER(${with_readline}/readline.h,
648 [ AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
649 CONS_LIBS="-lreadline -lhistory -ltermcap"
653 echo "readline.h not found. readline turned off ..."
660 # check for standard readline library
661 AC_CHECK_HEADER(/usr/include/readline/readline.h,
662 [ AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
664 CONS_INC="-I/usr/include/readline"
665 CONS_LIBS="-lreadline -ltermcap"
667 # Did not find standard library, so try Bacula's default
668 AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h,
669 [ AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
671 CONS_INC="-I${TOP_DIR}/depkgs/readline"
672 CONS_LIBS="-lreadline -lhistory -ltermcap"
673 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
674 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
677 echo "readline.h not found. readline turned off ..."
693 AC_SUBST(CONS_LDFLAGS)
694 AC_SUBST(READLINE_SRC)
696 # Minimal stuff for readline Makefile configuration
701 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr lstat lchown)
702 AC_CHECK_FUNCS(nanosleep nl_langinfo)
703 AC_CHECK_HEADERS(varargs.h)
705 # End of readline/conio stuff
706 # -----------------------------------------------------------------------
708 # -----------------------------------------------------------------------
709 # Check for Python support
711 AC_MSG_CHECKING(for Python support)
714 --with-python@<:@=DIR@:>@ Include Python support. DIR is the Python base
715 install directory, default is to search through
716 a number of common places for the Python files.],
720 if test "$withval" != "no"; then
721 if test "$withval" = "yes"; then
722 for python_root in /usr /usr/local /usr/sfw; do
723 for ver in python2.2 python2.3 python2.4 python2.5; do
724 if test -f $python_root/include/${ver}/Python.h; then
725 PYTHON_INCDIR=-I$python_root/include/${ver}
726 if test -d $python_root/lib64/${ver}/config; then
727 PYTHON_LIBS="-L$python_root/lib64/${ver}/config -l${ver}"
729 PYTHON_LIBS="-L$python_root/lib/${ver}/config -l${ver}"
735 if test x$PYTHON_INCDIR = x; then
736 if test -f $prefix/include/Python.h; then
737 PYTHON_INCDIR=-I$prefix/include
738 if test -d $prefix/lib64/config; then
739 PYTHON_LIBS="-L$prefix/lib64/config -lpython"
741 PYTHON_LIBS="-L$prefix/lib/config -lpython"
745 AC_MSG_ERROR(Unable to find Python.h in standard locations)
749 if test -f $withval/Python.h; then
750 PYTHON_INCDIR=-I$withval
751 PYTHON_LIBS="-L$withval/config -lpython"
752 elif test -f $withval/include/Python.h; then
753 PYTHON_INCDIR=-I$withval/include
754 if test -d $withval/lib64/config; then
755 PYTHON_LIBS="-L$withval/lib64/config -lpython"
757 PYTHON_LIBS="-L$withval/lib/config -lpython"
759 elif test -f $withval/include/python/Python.h; then
760 PYTHON_INCDIR=-I$withval/include/python
761 if test -d $withval/lib64/python/config; then
762 PYTHON_LIBS="-L$withval/lib64/python/config -lpython"
764 PYTHON_LIBS="-L$withval/lib/python/config -lpython"
768 AC_MSG_ERROR(Invalid Python directory $withval - unable to find Python.h under $withval)
771 AC_DEFINE([HAVE_PYTHON], 1)
774 AC_MSG_NOTICE(checking for more Python libs)
775 saved_LIBS="$LIBS"; LIBS=
776 AC_SEARCH_LIBS(shm_open, [rt])
777 AC_CHECK_LIB(util, openpty)
778 PYTHON_LIBS="$PYTHON_LIBS $LIBS"
786 AC_SUBST(PYTHON_LIBS)
787 AC_SUBST(PYTHON_INCDIR)
790 # Find where sockets are (especially for Solaris)
791 # Do this before the TCP Wrappers test since tcp wrappers
792 # uses the socket library and some linkers are stupid.
794 AC_CHECK_FUNC(socket,
795 AC_MSG_RESULT(using libc's socket),
796 AC_CHECK_LIB(xnet,socket)
797 AC_CHECK_LIB(socket,socket)
798 AC_CHECK_LIB(inet,socket))
801 # -----------------------------------------------------------
802 # Check whether user wants TCP wrappers support (default off)
803 # -----------------------------------------------------------
806 AC_ARG_WITH(tcp-wrappers,
807 [ --with-tcp-wrappers@<:@=DIR@:>@ enable tcpwrappers support],
809 if test "x$withval" != "xno" ; then
811 LIBS="$saved_LIBS -lwrap"
812 AC_MSG_CHECKING(for libwrap)
813 AC_SEARCH_LIBS(nanosleep, [rt])
815 [ #include <sys/types.h>
817 int deny_severity = 0;
818 int allow_severity = 0;
819 struct request_info *req; ],
820 [ hosts_access(req); ],
823 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
828 LIBS="$saved_LIBS -lwrap -lnsl"
829 WRAPLIBS="$saved_LIBS -lwrap -lnsl"
831 [ #include <sys/types.h>
833 int deny_severity = 0;
834 int allow_severity = 0;
835 struct request_info *req; ],
836 [ hosts_access(req); ],
839 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
844 [AC_MSG_ERROR([*** libwrap missing]) ] ]
851 # -----------------------------------------------------------
852 # Check whether OpenSSL is available
853 # -----------------------------------------------------------
854 AC_MSG_CHECKING([for OpenSSL])
855 dnl The following uses quadrigraphs:
859 AC_HELP_STRING([--with-openssl@<:@=DIR@:>@], [Include OpenSSL support. DIR is the OpenSSL base]),
860 [with_openssl_directory=${withval}])
862 if test "x$with_openssl_directory" != "x"; then
863 OPENSSL_LIBS="-lssl -lcrypto"
866 if test "x$with_openssl_directory" != "xyes" && test x"${with_openssl_directory}" != "x"; then
867 OPENSSL_LIBS="-L$with_openssl_directory/lib $OPENSSL_LIBS"
868 OPENSSL_INC="-I$with_openssl_directory/include $OPENSSL_INC"
872 saved_CFLAGS="${CFLAGS}"
873 LIBS="${saved_LIBS} ${OPENSSL_LIBS}"
874 CFLAGS="${saved_CFLAGS} ${OPENSSL_INC}"
876 AC_TRY_LINK([ #include <openssl/ssl.h> ],
877 [ CRYPTO_set_id_callback(NULL); ],
885 AC_TRY_LINK([ #include <openssl/evp.h> ],
887 [ ac_cv_openssl_sha2="yes" ],
888 [ ac_cv_openssl_sha2="no" ]
891 # Solaris disables greater than 128+ bit encryption in their OpenSSL
892 # implementation, presumably for export reasons. If 192bit AES
893 # is available, we assume that we're running with a 'non-export'
895 AC_TRY_LINK([ #include <openssl/evp.h> ],
896 [ EVP_aes_192_cbc(); ],
897 [ ac_cv_openssl_export="no" ],
898 [ ac_cv_openssl_export="yes" ]
902 CFLAGS="${saved_CFLAGS}"
904 if test "$support_tls" = "yes"; then
905 AC_DEFINE(HAVE_OPENSSL, 1, [Define if OpenSSL library is available])
906 AC_DEFINE(HAVE_TLS, 1, [Define if TLS support should be enabled])
907 AC_DEFINE(HAVE_CRYPTO, 1, [Define if encryption support should be enabled])
910 if test "$ac_cv_openssl_sha2" = "yes"; then
911 AC_DEFINE(HAVE_SHA2, 1, [Define if the SHA-2 family of digest algorithms is available])
914 if test "$ac_cv_openssl_export" = "yes"; then
915 AC_DEFINE(HAVE_OPENSSL_EXPORT_LIBRARY, 1, [Define if the OpenSSL library is export-contrained to 128bit ciphers])
924 AC_MSG_RESULT([$support_tls])
925 AC_SUBST(OPENSSL_LIBS)
926 AC_SUBST(OPENSSL_INC)
929 # -----------------------------------------------------------
930 # Python and OpenSSL are using dlopen
931 # -----------------------------------------------------------
933 if test "$support_python" = "yes" -o "$support_tls" = "yes"; then
934 AC_SEARCH_LIBS(dlopen, [dl])
937 # ------------------------------------------
938 # Where to place working dir
939 # ------------------------------------------
940 working_dir=`eval echo ${prefix}/var/bacula/working`
941 AC_ARG_WITH(working-dir,
942 [ --with-working-dir=PATH specify path of Bacula working directory],
944 if test "x$withval" != "xno" ; then
950 AC_SUBST(working_dir)
953 # ------------------------------------------
954 # Where to place scriptdir (script files)
955 # ------------------------------------------
956 scriptdir=`eval echo ${sysconfdir}`
957 AC_ARG_WITH(scriptdir,
958 [ --with-scriptdir=PATH specify path of Bacula scripts directory],
960 if test "x$withval" != "xno" ; then
969 # ------------------------------------------
970 # Where to send dump email
971 # ------------------------------------------
972 dump_email=root@localhost
973 AC_ARG_WITH(dump-email,
974 [ --with-dump-email=EMAIL dump email address],
976 if test "x$withval" != "xno" ; then
984 # ------------------------------------------
985 # Where to send job email
986 # ------------------------------------------
987 job_email=root@localhost
988 AC_ARG_WITH(job-email,
989 [ --with-job-email=EMAIL job output email address],
991 if test "x$withval" != "xno" ; then
999 # ------------------------------------------
1000 # Where to find smtp host
1001 # ------------------------------------------
1003 AC_ARG_WITH(smtp_host,
1004 [ --with-smtp-host=HOST SMTP mail host address],
1006 if test "x$withval" != "xno" ; then
1015 # ------------------------------------
1016 # Where to place pid files
1017 # ------------------------------------
1019 AC_ARG_WITH(pid-dir,
1020 [ --with-pid-dir=PATH specify location of Bacula pid files],
1022 if test "x$withval" != "xno" ; then
1028 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
1032 # ------------------------------------
1033 # Where to place subsys "lock file"
1034 # ------------------------------------
1035 subsysdir=/var/run/subsys
1036 if test -d /var/run/subsys; then
1037 subsysdir=/var/run/subsys
1038 elif test -d /var/lock/subsys; then
1039 subsysdir=/var/lock/subsys
1041 subsysdir=/var/run/subsys
1043 AC_ARG_WITH(subsys-dir,
1044 [ --with-subsys-dir=PATH specify location of Bacula subsys file],
1046 if test "x$withval" != "xno" ; then
1056 # ------------------------------------
1057 # Where to start assigning ports
1058 # ------------------------------------
1060 AC_ARG_WITH(baseport,
1061 [ --with-baseport=PORT specify base port address for daemons],
1063 if test "x$withval" != "xno" ; then
1070 dir_port=`expr $baseport`
1071 fd_port=`expr $baseport + 1`
1072 sd_port=`expr $fd_port + 1`
1079 # ------------------------------------------
1080 # Generate passwords
1081 # ------------------------------------------
1083 AC_ARG_WITH(dir-password,
1084 [ --with-dir-password=PASSWORD specify Director's password],
1086 if test "x$withval" != "xno" ; then
1087 dir_password=$withval
1092 if test "x$dir_password" = "x" ; then
1093 if test "x$OPENSSL" = "xnone" ; then
1094 key=`autoconf/randpass 33`
1096 key=`openssl rand -base64 33`
1102 AC_ARG_WITH(fd-password,
1103 [ --with-fd-password=PASSWORD specify Client's password],
1105 if test "x$withval" != "xno" ; then
1106 fd_password=$withval
1111 if test "x$fd_password" = "x" ; then
1112 if test "x$OPENSSL" = "xnone" ; then
1113 key=`autoconf/randpass 37`
1115 key=`openssl rand -base64 33`
1121 AC_ARG_WITH(sd-password,
1122 [ --with-sd-password=PASSWORD specify Storage daemon's password],
1124 if test "x$withval" != "xno" ; then
1125 sd_password=$withval
1130 if test "x$sd_password" = "x" ; then
1131 if test "x$OPENSSL" = "xnone" ; then
1132 key=`autoconf/randpass 41`
1134 key=`openssl rand -base64 33`
1140 AC_ARG_WITH(mon-dir-password,
1141 [ --with-mon-dir-password=PASSWORD specify Director's password used by the monitor],
1143 if test "x$withval" != "xno" ; then
1144 mon_dir_password=$withval
1149 if test "x$mon_dir_password" = "x" ; then
1150 if test "x$OPENSSL" = "xnone" ; then
1151 key=`autoconf/randpass 33`
1153 key=`openssl rand -base64 33`
1155 mon_dir_password=$key
1159 AC_ARG_WITH(mon-fd-password,
1160 [ --with-mon-fd-password=PASSWORD specify Client's password used by the monitor],
1162 if test "x$withval" != "xno" ; then
1163 mon_fd_password=$withval
1168 if test "x$mon_fd_password" = "x" ; then
1169 if test "x$OPENSSL" = "xnone" ; then
1170 key=`autoconf/randpass 37`
1172 key=`openssl rand -base64 33`
1174 mon_fd_password=$key
1178 AC_ARG_WITH(mon-sd-password,
1179 [ --with-mon-sd-password=PASSWORD specify Storage daemon's password used by the monitor],
1181 if test "x$withval" != "xno" ; then
1182 mon_sd_password=$withval
1187 if test "x$mon_sd_password" = "x" ; then
1188 if test "x$OPENSSL" = "xnone" ; then
1189 key=`autoconf/randpass 41`
1191 key=`openssl rand -base64 33`
1193 mon_sd_password=$key
1196 AC_SUBST(dir_password)
1197 AC_SUBST(fd_password)
1198 AC_SUBST(sd_password)
1199 AC_SUBST(mon_dir_password)
1200 AC_SUBST(mon_fd_password)
1201 AC_SUBST(mon_sd_password)
1204 # Pickup any database name
1207 AC_ARG_WITH(db_name,
1208 [ --with-db-name=DBNAME specify database name (default bacula)],
1210 if test "x$withval" != "x" ; then
1218 AC_ARG_WITH(db_user,
1219 [ --with-db-user=UNAME specify database user (default bacula)],
1221 if test "x$withval" != "x" ; then
1230 # Handle users and groups for each daemon
1233 AC_ARG_WITH(dir_user,
1234 [ --with-dir-user=USER specify user for Director daemon],
1236 if test "x$withval" != "x" ; then
1243 AC_ARG_WITH(dir_group,
1244 [ --with-dir-group=GROUP specify group for Director daemon],
1246 if test "x$withval" != "x" ; then
1253 AC_ARG_WITH(sd_user,
1254 [ --with-sd-user=USER specify user for Storage daemon],
1256 if test "x$withval" != "x" ; then
1263 AC_ARG_WITH(sd_group,
1264 [ --with-sd-group=GROUP specify group for Storage daemon],
1266 if test "x$withval" != "x" ; then
1273 AC_ARG_WITH(fd_user,
1274 [ --with-fd-user=USER specify user for File daemon],
1276 if test "x$withval" != "x" ; then
1283 AC_ARG_WITH(fd_group,
1284 [ --with-fd-group=GROUP specify group for File daemon],
1286 if test "x$withval" != "x" ; then
1300 # allow setting default executable permissions
1303 AC_ARG_WITH(sbin-perm,
1304 [ --with-sbin-perm=MODE specify permissions for sbin binaries (0754)],
1306 if test "x$withval" != "x" ; then
1314 # ------------------------------------------------
1315 # Bacula check for various SQL database engines
1316 # ------------------------------------------------
1318 BA_CHECK_POSTGRESQL_DB
1329 # -------------------------------------------
1330 # enable batch attribute DB insert (default on)
1331 # -------------------------------------------
1332 support_batch_insert=no
1333 A=`nm $SQL_LIB | grep pthread_mutex_lock`
1335 if test $pkg = 0; then
1336 support_batch_insert=yes
1337 AC_ARG_ENABLE(batch-insert,
1338 [ --enable-batch-insert enable the DB batch insert code [disabled]],
1339 [if test x$enableval = xno; then
1340 support_batch_insert=no
1342 support_batch_insert=yes
1346 # Check if postgresql support batch mode
1347 if test x$DB_TYPE = xpostgresql; then
1348 A=`nm $SQL_LIB | grep PQputCopyData`
1350 if test $pkg != 0; then
1351 support_batch_insert=no
1355 if test $support_batch_insert = yes ; then
1356 AC_DEFINE(HAVE_BATCH_FILE_INSERT, 1, [Set if DB batch insert code enabled])
1360 AC_DEFINE(PROTOTYPES)
1362 dnl# --------------------------------------------------------------------------
1363 dnl# Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
1365 if test -z "$CFLAGS" -o "$CFLAGS" = "-g -O2"; then
1366 if test -z "$CCOPTS"; then
1367 CCOPTS='-g -O2 -Wall'
1376 dnl See if we can use 64 bit file addresses
1377 largefile_support="no"
1383 dnl# --------------------------------------------------------------------------
1384 dnl# CHECKING FOR HEADER FILES
1385 dnl# --------------------------------------------------------------------------
1421 AC_STRUCT_ST_BLKSIZE
1425 dnl# --------------------------------------------------------------------------
1426 dnl# Check for utime.h structure
1427 dnl# --------------------------------------------------------------------------
1428 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
1430 #include <sys/types.h>
1431 #include <utime.h>], [struct utimbuf foo],
1432 ba_cv_header_utime_h=yes, ba_cv_header_utime_h=no)])
1433 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H, 1, [Set if utime.h exists])
1435 dnl# --------------------------------------------------------------------------
1436 dnl# Check for socklen_t
1437 dnl# --------------------------------------------------------------------------
1438 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
1440 #include <sys/types.h>
1441 #include <sys/socket.h>],
1443 ba_cv_header_socklen_t=yes, ba_cv_header_socklen_t=no)])
1444 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T)
1446 dnl# --------------------------------------------------------------------------
1447 dnl# Check for bigendian
1448 dnl# --------------------------------------------------------------------------
1449 AC_CACHE_CHECK([for bigendian], ba_cv_bigendian,
1451 [main(){long a=1L; char *p=(char *)&a; exit(*p);}],
1452 [ba_cv_bigendian=yes],
1453 [ba_cv_bigendian=no],
1454 [ba_cv_bigendian=no])])
1455 test $ba_cv_bigendian = yes && AC_DEFINE(HAVE_BIGENDIAN)
1457 dnl# --------------------------------------------------------------------------
1458 dnl# Check for typeof()
1459 dnl# --------------------------------------------------------------------------
1461 AC_CACHE_CHECK(for typeof, ba_cv_have_typeof,
1463 [main(){char *a = 0; a = (typeof a)a;}],
1464 [ba_cv_have_typeof=yes],
1465 [ba_cv_have_typeof=no],
1466 [ba_cv_have_typeof=no])])
1467 test $ba_cv_have_typeof = yes && AC_DEFINE([HAVE_TYPEOF], 1, [Defind to 1 if compiler has typeof])
1473 dnl# --------------------------------------------------------------------------
1474 dnl# CHECKING FOR FILESYSTEM TYPE
1475 dnl# --------------------------------------------------------------------------
1476 AC_MSG_CHECKING(how to get filesystem type)
1478 # The order of these tests is important.
1479 AC_TRY_CPP([#include <sys/statvfs.h>
1480 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4)
1481 if test $fstype = no; then
1482 AC_TRY_CPP([#include <sys/statfs.h>
1483 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3)
1485 if test $fstype = no; then
1486 AC_TRY_CPP([#include <sys/statfs.h>
1487 #include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX)
1489 if test $fstype = no; then
1490 AC_TRY_CPP([#include <mntent.h>], AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD)
1492 if test $fstype = no; then
1493 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
1495 if test $fstype = no; then
1496 AC_TRY_CPP([#include <sys/mount.h>
1497 #include <sys/fs_types.h>], AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix)
1499 AC_MSG_RESULT($fstype)
1501 AC_CHECK_HEADER(sys/statvfs.h, [ AC_DEFINE(HAVE_SYS_STATVFS_H,1,[Defines if your system have the sys/statvfs.h header file])] , )
1503 dnl# --------------------------------------------------------------------------
1504 dnl# CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
1505 dnl# --------------------------------------------------------------------------
1513 AC_CHECK_TYPE(ino_t, unsigned long)
1514 AC_CHECK_TYPE(dev_t, unsigned long)
1515 AC_CHECK_TYPE(daddr_t, long)
1516 AC_CHECK_TYPE(major_t, int)
1517 AC_CHECK_TYPE(minor_t, int)
1518 AC_CHECK_TYPE(ssize_t, int)
1525 AC_CHECK_SIZEOF(char, 1)
1526 AC_CHECK_SIZEOF(short int, 2)
1527 AC_CHECK_SIZEOF(int, 4)
1528 AC_CHECK_SIZEOF(long int, 4)
1529 AC_CHECK_SIZEOF(long long int, 8)
1530 AC_CHECK_SIZEOF(int *, 4)
1532 # Check for sys/types.h types
1533 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1535 [ #include <sys/types.h> ],
1537 [ ac_cv_have_u_int="yes" ],
1538 [ ac_cv_have_u_int="no" ]
1541 if test "x$ac_cv_have_u_int" = "xyes" ; then
1542 AC_DEFINE(HAVE_U_INT)
1546 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t, [
1548 [ #include <sys/types.h> ],
1549 [ intmax_t a; a = 1;],
1550 [ ac_cv_have_intmax_t="yes" ],
1553 [ #include <stdint.h> ],
1554 [ intmax_t a; a = 1;],
1555 [ ac_cv_have_intmax_t="yes" ],
1556 [ ac_cv_have_intmax_t="no" ]
1562 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
1563 AC_DEFINE(HAVE_INTMAX_T)
1568 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t, [
1570 [ #include <sys/types.h> ],
1571 [ u_intmax_t a; a = 1;],
1572 [ ac_cv_have_u_intmax_t="yes" ],
1575 [ #include <stdint.h> ],
1576 [ u_intmax_t a; a = 1;],
1577 [ ac_cv_have_u_intmax_t="yes" ],
1578 [ ac_cv_have_u_intmax_t="no" ]
1583 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
1584 AC_DEFINE(HAVE_U_INTMAX_T)
1589 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1591 [ #include <sys/types.h> ],
1592 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1593 [ ac_cv_have_intxx_t="yes" ],
1594 [ ac_cv_have_intxx_t="no" ]
1597 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1598 AC_DEFINE(HAVE_INTXX_T)
1602 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1604 [ #include <sys/types.h> ],
1605 [ int64_t a; a = 1;],
1606 [ ac_cv_have_int64_t="yes" ],
1607 [ ac_cv_have_int64_t="no" ]
1610 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1611 AC_DEFINE(HAVE_INT64_T)
1615 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1617 [ #include <sys/types.h> ],
1618 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1619 [ ac_cv_have_u_intxx_t="yes" ],
1620 [ ac_cv_have_u_intxx_t="no" ]
1623 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1624 AC_DEFINE(HAVE_U_INTXX_T)
1628 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1630 [ #include <sys/types.h> ],
1631 [ u_int64_t a; a = 1;],
1632 [ ac_cv_have_u_int64_t="yes" ],
1633 [ ac_cv_have_u_int64_t="no" ]
1636 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1637 AC_DEFINE(HAVE_U_INT64_T)
1641 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1642 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1644 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1646 [ #include <sys/bitypes.h> ],
1647 [ int8_t a; int16_t b; int32_t c;
1648 u_int8_t e; u_int16_t f; u_int32_t g;
1649 a = b = c = e = f = g = 1; ],
1650 [ AC_DEFINE(HAVE_U_INTXX_T)
1651 AC_DEFINE(HAVE_INTXX_T)
1652 AC_DEFINE(HAVE_SYS_BITYPES_H)
1653 AC_MSG_RESULT(yes) ],
1654 [ AC_MSG_RESULT(no)]
1658 if test -z "$have_u_intxx_t" ; then
1659 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1661 [ #include <sys/types.h> ],
1662 [ uint8_t a; uint16_t b;
1663 uint32_t c; a = b = c = 1; ],
1664 [ ac_cv_have_uintxx_t="yes" ],
1665 [ ac_cv_have_uintxx_t="no" ]
1668 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1669 AC_DEFINE(HAVE_UINTXX_T)
1673 if (test -z "$have_u_int64_t" || test -z "$have_int64_t" && \
1674 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1676 AC_MSG_CHECKING([for int64_t and u_int64_t types in sys/bitypes.h])
1678 [ #include <sys/bitypes.h> ],
1679 [ int64_t a; u_int64_t b;
1681 [ AC_DEFINE(HAVE_U_INT64_T)
1682 AC_DEFINE(HAVE_INT64_T)
1683 AC_MSG_RESULT(yes) ],
1684 [ AC_MSG_RESULT(no)]
1688 if (test -z "$have_uintxx_t" && \
1689 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1691 AC_MSG_CHECKING([for uintXX_t types in sys/bitypes.h])
1693 [ #include <sys/bitypes.h> ],
1694 [ uint8_t a; uint16_t b;
1695 uint32_t c; a = b = c = 1; ],
1696 [ AC_DEFINE(HAVE_UINTXX_T)
1697 AC_MSG_RESULT(yes) ],
1698 [ AC_MSG_RESULT(no)]
1706 dnl# --------------------------------------------------------------------------
1707 dnl# CHECKING FOR REQUIRED LIBRARY FUNCTIONS
1708 dnl# --------------------------------------------------------------------------
1724 [echo 'configure: cannot find needed function.'; exit 1]
1727 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
1728 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
1729 AC_CHECK_FUNCS(posix_fadvise)
1730 AC_CHECK_FUNCS(fdatasync)
1732 AC_CHECK_FUNCS(chflags)
1734 AC_CHECK_FUNCS(snprintf vsnprintf gethostid fseeko)
1736 AC_CACHE_CHECK(for va_copy, ba_cv_va_copy,
1739 void use_va_copy(va_list args){va_list args2; va_copy(args2,args); va_end(args2);}
1740 void call_use_va_copy(int junk,...){va_list args; va_start(args,junk); use_va_copy(args); va_end(args);}
1742 [call_use_va_copy(1,2,3)],
1743 ba_cv_va_copy=yes, ba_cv_va_copy=no)])
1744 test $ba_cv_va_copy = yes && AC_DEFINE(HAVE_VA_COPY, 1, [Set if va_copy exists])
1747 dnl# --------------------------------------------------------------------------
1748 dnl# CHECKING FOR THREAD SAFE FUNCTIONS
1749 dnl# --------------------------------------------------------------------------
1750 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
1752 # If resolver functions are not in libc check for -lnsl or -lresolv.
1753 AC_CHECK_FUNC(gethostbyname_r,
1754 AC_MSG_RESULT(using libc's resolver),
1755 AC_CHECK_LIB(nsl,gethostbyname_r)
1756 AC_CHECK_LIB(resolv,gethostbyname_r))
1760 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
1761 AC_CHECK_FUNCS(inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)])
1762 AC_CHECK_FUNCS(gethostbyname2, [AC_DEFINE(HAVE_GETHOSTBYNAME2)])
1764 dnl ----------------------------
1765 dnl check sa_len of sockaddr
1766 dnl ----------------------------
1767 AC_CACHE_CHECK(for struct sockaddr has a sa_len field, ac_cv_struct_sockaddr_sa_len,
1768 [AC_TRY_COMPILE([#include <sys/socket.h>], [struct sockaddr s; s.sa_len;],
1769 ac_cv_struct_sockaddr_sa_len=yes, ac_cv_struct_sockaddr_sa_len=no)])
1771 if test $ac_cv_struct_sockaddr_sa_len = yes; then
1772 AC_DEFINE(HAVE_SA_LEN, 1, [Define if sa_len field exists in struct sockaddr])
1782 AC_FUNC_CLOSEDIR_VOID
1783 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
1784 # AC_FUNC_FNMATCH dnl use local version
1787 AC_CHECK_LIB(intl, gettext, [LIBS="$LIBS -lintl"])
1790 AC_CHECK_LIB(sun, getpwnam)
1792 AC_CHECK_HEADERS(zlib.h)
1793 AC_CHECK_LIB(z, deflate, [FDLIBS="-lz"])
1795 if test x$FDLIBS = x-lz; then
1796 AC_DEFINE(HAVE_LIBZ)
1801 # Check for ACL libraries
1804 AC_CHECK_HEADER(sys/acl.h)
1805 AC_CHECK_FUNC(acl_get_file, [have_acl=yes],
1806 [AC_CHECK_LIB(acl, acl_get_file, [have_acl=yes; FDLIBS="-lacl $FDLIBS"],
1807 [AC_CHECK_LIB(sec, acltotext, [have_acl=yes; FDLIBS="-lsec $FDLIBS"])]
1810 if test $have_acl = yes; then
1814 dnl Check for pthread libraries
1816 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
1817 [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
1818 [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
1819 [AC_CHECK_FUNC(pthread_create)]
1830 if test x$have_gcc = xyes ; then
1831 CPPFLAGS="$CPPFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
1832 CFLAGS="$CFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
1834 LDFLAGS=${LDFLAGS--O}
1835 DB_LIBS="${SQL_LFLAGS}"
1836 CPPFLAGS="$CPPFLAGS"
1849 AC_SUBST(X_EXTRA_LIBS)
1854 dnl# extra configurable objects
1865 # Finally we set appropriate distribution specific
1866 # variables and defaults
1868 # PFILES are platform specific files
1869 PFILES="platforms/Makefile"
1873 hostname=`uname -n | cut -d '.' -f 1`
1874 if test x${hostname} = x ; then
1875 hostname="localhost"
1880 PSCMD="ps -e -o pid,comm"
1882 platforms/aix/Makefile"
1883 TAPEDRIVE="/dev/rmt0.1"
1887 PTHREAD_LIB="-lpthread -lexc"
1888 if test "${CC}" = "gcc" ; then
1895 TAPEDRIVE="/dev/nrmt0"
1898 DISTVER=`uname -a |awk '{print $3}'`
1899 TAPEDRIVE="/dev/nrmt0"
1900 PTHREAD_LIB="-pthread"
1901 CFLAGS="${CFLAGS} -pthread"
1902 PSCMD="ps -ax -o pid,command"
1906 platforms/bsdi/Makefile \
1907 platforms/bsdi/bacula-fd \
1908 platforms/bsdi/bacula-sd \
1909 platforms/bsdi/bacula-dir"
1910 largefile_support="yes"
1913 DISTVER=`uname -a |awk '{print $3}'`
1914 TAPEDRIVE="/dev/nrst0"
1917 WLDFLAGS="-mwindows"
1921 TAPEDRIVE="/dev/nst0"
1922 PSCMD="ps -e -o pid,command"
1925 platforms/darwin/Makefile"
1928 DISTVER=`cat /etc/debian_version`
1929 TAPEDRIVE="/dev/nrst0"
1930 PSCMD="ps -e -o pid,command"
1933 DISTVER=`uname -a |awk '{print $3}'`
1934 VER=`echo $DISTVER | cut -c 1`
1935 if test x$VER = x4 ; then
1936 PTHREAD_LIB="${PTHREAD_LIBS:--pthread}"
1937 CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS:--pthread}"
1941 TAPEDRIVE="/dev/nrsa0"
1942 PSCMD="ps -ax -o pid,command"
1944 platforms/freebsd/Makefile \
1945 platforms/freebsd/bacula-fd \
1946 platforms/freebsd/bacula-sd \
1947 platforms/freebsd/bacula-dir"
1948 largefile_support="yes"
1951 PSCMD="UNIX95=1; ps -e -o pid,comm"
1952 CFLAGS="${CFLAGS} -D_XOPEN_SOURCE_EXTENDED=1"
1954 TAPEDRIVE="/dev/rmt/0hnb"
1955 PTHREAD_LIB="-lpthread"
1956 AC_DEFINE([_INCLUDE_LONGLONG])
1960 TAPEDRIVE="/dev/rmt/0cbn"
1961 PSCMD="ps -e -o pid,comm"
1963 platforms/irix/Makefile \
1964 platforms/irix/bacula-fd \
1965 platforms/irix/bacula-sd \
1966 platforms/irix/bacula-dir"
1969 DISTVER=`uname -a |awk '{print $3}'`
1972 TAPEDRIVE="/dev/nrst0"
1973 PSCMD="ps -ax -o pid,command"
1974 PTHREAD_LIB="-pthread"
1975 CFLAGS="${CFLAGS} -pthread"
1978 DISTVER=`uname -a |awk '{print $3}'`
1981 TAPEDRIVE="/dev/nrst0"
1982 PSCMD="ps -ax -o pid,command"
1983 PTHREAD_LIB="-pthread"
1984 CFLAGS="${CFLAGS} -pthread"
1986 platforms/openbsd/Makefile \
1987 platforms/openbsd/bacula-fd \
1988 platforms/openbsd/bacula-sd \
1989 platforms/openbsd/bacula-dir"
1992 if test -f /etc/whitebox-release ; then
1993 f=/etc/whitebox-release
1995 f=/etc/redhat-release
1997 if test `cat $f | grep release |\
1998 cut -f 3 -d ' '`x = "Enterprise"x ; then
1999 DISTVER="Enterprise "`cat $f | grep release |\
2002 DISTVER=`cat /etc/redhat-release | grep release |\
2005 TAPEDRIVE="/dev/nst0"
2006 PSCMD="ps -e -o pid,command"
2008 platforms/redhat/Makefile \
2009 platforms/redhat/bacula-fd \
2010 platforms/redhat/bacula-sd \
2011 platforms/redhat/bacula-dir \
2012 platforms/redhat/bacula.spec \
2016 DISTVER=`cat /etc/mandrake-release | grep release |\
2018 TAPEDRIVE="/dev/nst0"
2019 PSCMD="ps -e -o pid,command"
2021 platforms/mandrake/Makefile \
2022 platforms/mandrake/bacula-fd \
2023 platforms/mandrake/bacula-sd \
2024 platforms/mandrake/bacula-dir \
2025 platforms/mandrake/bacula.spec \
2029 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
2030 TAPEDRIVE="/dev/nst0"
2031 PSCMD="ps -e -o pid,command"
2033 platforms/gentoo/Makefile \
2034 platforms/gentoo/bacula-init \
2035 platforms/gentoo/bacula-fd \
2036 platforms/gentoo/bacula-sd \
2037 platforms/gentoo/bacula-dir"
2040 DISTVER=`cat /etc/slackware-version`
2041 TAPEDRIVE="/dev/nst0"
2042 PSCMD="ps -e -o pid,command"
2044 platforms/slackware/Makefile \
2045 platforms/slackware/rc.bacula-fd \
2046 platforms/slackware/rc.bacula-sd \
2047 platforms/slackware/rc.bacula-dir\
2048 platforms/slackware/functions.bacula"
2052 TAPEDRIVE="/dev/rmt/0cbn"
2053 PSCMD="ps -e -o pid,comm"
2055 platforms/solaris/Makefile \
2056 platforms/solaris/bacula-fd \
2057 platforms/solaris/bacula-sd \
2058 platforms/solaris/bacula-dir"
2059 if test x$DISTVER = x5.6 ; then
2060 AC_DEFINE(HAVE_OLD_SOCKOPT)
2062 LIBS="$LIBS -lresolv"
2065 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
2067 TAPEDRIVE="/dev/nst0"
2068 PSCMD="ps -e -o pid,command"
2070 platforms/suse/Makefile \
2071 platforms/suse/bacula-fd \
2072 platforms/suse/bacula-sd \
2073 platforms/suse/bacula-dir \
2074 platforms/suse/bacula \
2075 platforms/suse/bacula.spec"
2080 TAPEDRIVE="/dev/nst0"
2081 PSCMD="ps -e -o pid,command"
2083 platforms/suse/Makefile \
2084 platforms/suse/bacula-fd \
2085 platforms/suse/bacula-sd \
2086 platforms/suse/bacula-dir"
2090 TAPEDRIVE="/dev/nst0"
2093 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
2099 LIBS="$PTHREAD_LIB $LIBS"
2101 AC_DEFINE_UNQUOTED(lld, "$lld")
2102 AC_DEFINE_UNQUOTED(llu, "$llu")
2110 dnl# common parts of the Makefile
2111 MCOMMON=./autoconf/Make.common
2112 AC_SUBST_FILE(MCOMMON)
2115 if test "x${subsysdir}" = "x${sbindir}" ; then
2118 echo "You have set both --sbindir and --with-subsys-dir"
2119 echo " equal to: ${subsysdir} "
2120 echo "This is not permitted. Please reconfigure."
2122 echo "Aborting configuration ..."
2128 AC_OUTPUT([autoconf/Make.common \
2131 scripts/startmysql \
2133 scripts/btraceback \
2139 scripts/bacula-ctl-dir \
2140 scripts/bacula-ctl-fd \
2141 scripts/bacula-ctl-sd \
2142 scripts/devel_bacula \
2145 scripts/bacula.desktop.gnome1 \
2146 scripts/bacula.desktop.gnome2 \
2147 scripts/bacula.desktop.gnome1.consolehelper \
2148 scripts/bacula.desktop.gnome2.consolehelper \
2149 scripts/bacula.desktop.gnome1.xsu \
2150 scripts/bacula.desktop.gnome2.xsu \
2151 scripts/bgnome-console.console_apps \
2152 scripts/mtx-changer \
2153 scripts/disk-changer \
2154 scripts/dvd-handler \
2155 scripts/dvd-simulator \
2156 scripts/bacula-tray-monitor.desktop \
2157 scripts/logwatch/Makefile \
2158 scripts/logwatch/logfile.bacula.conf \
2159 scripts/wxconsole.console_apps \
2160 scripts/wxconsole.desktop.consolehelper \
2161 scripts/wxconsole.desktop.xsu \
2162 scripts/bat.desktop \
2163 scripts/bat.desktop.xsu \
2164 scripts/bat.desktop.consolehelper \
2165 scripts/bat.console_apps \
2168 src/console/Makefile \
2169 src/console/bconsole.conf \
2170 src/gnome2-console/Makefile \
2171 src/gnome2-console/bgnome-console.conf \
2172 src/qt-console/bat.conf \
2173 src/qt-console/bat.pro \
2174 src/qt-console/install_conf_file \
2175 src/wx-console/Makefile \
2176 src/wx-console/bwx-console.conf \
2177 src/tray-monitor/Makefile \
2178 src/tray-monitor/tray-monitor.conf \
2180 src/dird/bacula-dir.conf \
2182 src/stored/Makefile \
2183 src/stored/bacula-sd.conf \
2184 src/filed/Makefile \
2185 src/filed/bacula-fd.conf \
2187 src/cats/make_catalog_backup \
2188 src/cats/delete_catalog_backup \
2189 src/cats/create_postgresql_database \
2190 src/cats/update_postgresql_tables \
2191 src/cats/make_postgresql_tables \
2192 src/cats/grant_postgresql_privileges \
2193 src/cats/drop_postgresql_tables \
2194 src/cats/drop_postgresql_database \
2195 src/cats/create_mysql_database \
2196 src/cats/update_mysql_tables \
2197 src/cats/make_mysql_tables \
2198 src/cats/grant_mysql_privileges \
2199 src/cats/drop_mysql_tables \
2200 src/cats/drop_mysql_database \
2201 src/cats/create_sqlite_database \
2202 src/cats/update_sqlite_tables \
2203 src/cats/make_sqlite_tables \
2204 src/cats/grant_sqlite_privileges \
2205 src/cats/drop_sqlite_tables \
2206 src/cats/drop_sqlite_database \
2207 src/cats/create_sqlite3_database \
2208 src/cats/update_sqlite3_tables \
2209 src/cats/make_sqlite3_tables \
2210 src/cats/grant_sqlite3_privileges \
2211 src/cats/drop_sqlite3_tables \
2212 src/cats/drop_sqlite3_database \
2215 src/cats/create_bdb_database \
2216 src/cats/update_bdb_tables \
2217 src/cats/make_bdb_tables \
2218 src/cats/grant_bdb_privileges \
2219 src/cats/drop_bdb_tables \
2220 src/cats/drop_bdb_database \
2221 src/cats/create_bacula_database \
2222 src/cats/update_bacula_tables \
2223 src/cats/grant_bacula_privileges \
2224 src/cats/make_bacula_tables \
2225 src/cats/drop_bacula_tables \
2226 src/cats/drop_bacula_database \
2227 src/findlib/Makefile \
2228 src/tools/Makefile \
2234 if test "${support_bat}" = "yes" ; then
2235 if test "x$QMAKE" = "xnone" && test "x$QMAKEQT4" = "xnone"; then
2236 echo "Could not find qmake or qmake-qt4 in $PATH. Check your Qt installation"
2242 if test "x$QMAKEQT4" != "xnone"; then
2249 chmod 755 install_conf_file build-depkgs-qt-console
2250 echo "Creating bat Makefile"
2255 echo "Doing make of dependencies"
2256 ${MAKE:-make} depend
2259 chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
2260 chmod 755 dvd-handler dvd-simulator
2261 chmod 755 bconsole gconsole mtx-changer devel_bacula logrotate
2266 chmod 755 $c/create_bacula_database $c/update_bacula_tables $c/make_bacula_tables
2267 chmod 755 $c/grant_bacula_privileges $c/drop_bacula_tables $c/drop_bacula_database
2269 chmod 755 $c/create_bdb_database $c/update_bdb_tables $c/make_bdb_tables
2270 chmod 755 $c/grant_bdb_privileges $c/drop_bdb_tables $c/drop_bdb_database
2272 chmod 755 $c/create_mysql_database $c/update_mysql_tables $c/make_mysql_tables
2273 chmod 755 $c/grant_mysql_privileges $c/drop_mysql_tables $c/drop_mysql_database
2275 chmod 755 $c/create_sqlite_database $c/update_sqlite_tables $c/make_sqlite_tables
2276 chmod 755 $c/grant_sqlite_privileges $c/drop_sqlite_tables $c/drop_sqlite_database
2278 chmod 755 $c/create_sqlite3_database $c/update_sqlite3_tables $c/make_sqlite3_tables
2279 chmod 755 $c/grant_sqlite3_privileges $c/drop_sqlite3_tables $c/drop_sqlite3_database
2281 chmod 755 $c/create_postgresql_database $c/update_postgresql_tables $c/make_postgresql_tables
2282 chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables $c/drop_postgresql_database
2284 chmod 755 $c/make_catalog_backup $c/delete_catalog_backup
2288 chmod 755 src/win32/build-depkgs-mingw32
2292 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
2293 largefile_support="yes"
2297 # A whole lot of hand springs to get the compiler version.
2298 # This is because gcc changed the output in version 3.0
2300 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
2301 if test "x${CCVERSION}" = "x" ; then
2302 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
2304 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
2305 if test x"${CXXVERSION}" = x ; then
2306 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
2309 if test "x${subsysdir}" = "x${sbindir}" ; then
2312 echo "You have set --sbindir and --with-subsys-dir"
2313 echo " both equal to: ${subsysdir} "
2314 echo " This is not permitted. Please reconfigure."
2316 echo "Aborting configuration ..."
2322 if test "x${db_type}" = "xInternal" ; then
2325 echo "You have not specified either --enable-client-only or one of the"
2326 echo " supported databases: MySQL, PostgreSQL, SQLite3 or SQLite."
2327 echo " This is not permitted. Please reconfigure."
2329 echo "Aborting the configuration ..."
2336 Configuration on `date`:
2338 Host: $host -- ${DISTNAME} ${DISTVER}
2339 Bacula version: ${VERSION} (${DATE})
2340 Source code location: ${srcdir}
2341 Install binaries: ${sbindir}
2342 Install config files: ${sysconfdir}
2343 Scripts directory: ${scriptdir}
2344 Archive directory: ${archivedir}
2345 Working directory: ${working_dir}
2346 PID directory: ${piddir}
2347 Subsys directory: ${subsysdir}
2348 Man directory: ${mandir}
2349 Data directory: ${datadir}
2350 C Compiler: ${CC} ${CCVERSION}
2351 C++ Compiler: ${CXX} ${CXXVERSION}
2352 Compiler flags: ${WCFLAGS} ${CFLAGS}
2353 Linker flags: ${WLDFLAGS} ${LDFLAGS}
2355 Statically Linked Tools: ${support_static_tools}
2356 Statically Linked FD: ${support_static_fd}
2357 Statically Linked SD: ${support_static_sd}
2358 Statically Linked DIR: ${support_static_dir}
2359 Statically Linked CONS: ${support_static_cons}
2360 Database type: ${db_type}
2361 Database lib: ${DB_LIBS}
2362 Database name: ${db_name}
2363 Database user: ${db_user}
2365 Job Output Email: ${job_email}
2366 Traceback Email: ${dump_email}
2367 SMTP Host Address: ${smtp_host}
2369 Director Port: ${dir_port}
2370 File daemon Port: ${fd_port}
2371 Storage daemon Port: ${sd_port}
2373 Director User: ${dir_user}
2374 Director Group: ${dir_group}
2375 Storage Daemon User: ${sd_user}
2376 Storage DaemonGroup: ${sd_group}
2377 File Daemon User: ${fd_user}
2378 File Daemon Group: ${fd_group}
2380 SQL binaries Directory ${SQL_BINDIR}
2382 Large file support: $largefile_support
2383 Bacula conio support: ${got_conio} ${CONS_LIBS}
2384 readline support: ${got_readline} ${PRTREADLINE_SRC}
2385 TCP Wrappers support: ${TCPW_MSG} ${WRAPLIBS}
2386 TLS support: ${support_tls}
2387 Encryption support: ${support_crypto}
2388 ZLIB support: ${have_zlib}
2389 enable-smartalloc: ${support_smartalloc}
2390 bat support: ${support_bat} ${QWT_LDFLAGS}
2391 enable-gnome: ${support_gnome} ${gnome_version}
2392 enable-bwx-console: ${support_wx_console} ${wx_version}
2393 enable-tray-monitor: ${support_tray_monitor}
2394 client-only: ${build_client_only}
2395 build-dird: ${build_dird}
2396 build-stored: ${build_stored}
2397 ACL support: ${have_acl}
2398 Python support: ${support_python} ${PYTHON_LIBS}
2399 Batch insert enabled: ${support_batch_insert}