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 minimal Win32 stuff for "make clean"
16 WIN32BUILDDIR=${BUILD_DIR}/src/win32
17 WIN32MAINDIR=${BUILD_DIR}
18 WIN32TOPDIR=${TOP_DIR}
19 AC_SUBST(WIN32BUILDDIR)
20 AC_SUBST(WIN32MAINDIR)
23 dnl require a recent autoconf
27 dnl search for true and false programs.
28 AC_PATH_PROGS(TRUEPRG, true, :)
29 AC_PATH_PROGS(FALSEPRG, false, :)
34 if test "x$BACULA" != x; then
35 post_host=`echo -${BACULA} | tr 'A-Z ' 'a-z-'`
37 BACULA=${BACULA:-Bacula}
38 VERSION=`sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
39 DATE=`sed -n -e 's/^.*[ \t]*BDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
40 LSMDATE=`sed -n -e 's/^.*LSMDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
45 AC_SUBST(post_host)dnl
46 echo "configuring for ${BACULA} $VERSION ($DATE)"
48 dnl -------------------------------------------------------
49 dnl Check for compiler.
50 dnl ------------------------------------------------------
54 AC_PROG_CC_C_O dnl Determine if C compiler support -c -o.
55 AC_PROG_GCC_TRADITIONAL dnl Determine if ioctl() need -traditional.
59 if test "x$BASECC" = xgcc; then
63 AC_PATH_PROG(CXX, $CXX, $CXX)
64 if test ! -e $CXX; then
65 AC_MSG_ERROR(Unable to find C++ compiler)
70 dnl -------------------------------------------------------
71 dnl Check for programs.
72 dnl ------------------------------------------------------
74 AC_PATH_PROG(MV, mv, mv)
76 dnl If we name the variable RM it will shadow the RM variable in the configure script and we overwrite the
77 dnl value with the name of the rm command and not rm -f which is its normal content. This gives all kind
78 dnl of strange output of the configure script (like things don't exist etc.).
79 dnl So we name it REMOVE (more software has run into this problem)
80 AC_PATH_PROG(REMOVE, rm, rm)
81 AC_PATH_PROG(CP, cp, cp)
82 AC_PATH_PROG(SED, sed, sed)
83 AC_PATH_PROG(ECHO, echo, echo)
84 AC_PATH_PROG(CMP, cmp, cmp)
85 AC_PATH_PROG(TBL, tbl, tbl)
86 AC_PATH_PROG(AR, ar, ar)
87 AC_PATH_PROG(OPENSSL, openssl, none)
88 AC_PATH_PROG(MTX, mtx, mtx)
89 AC_PATH_PROG(DD, dd, dd)
90 AC_PATH_PROG(MKISOFS, mkisofs, mkisofs)
91 AC_PATH_PROG(PYTHON, python, python)
92 AC_PATH_PROG(GROWISOFS, growisofs, growisofs)
93 AC_PATH_PROG(DVDRWMEDIAINFO, dvd+rw-mediainfo, dvd+rw-mediainfo)
94 AC_PATH_PROG(DVDRWFORMAT, dvd+rw-format, dvd+rw-format)
95 AC_PATH_PROG(PKGCONFIG, pkg-config, pkg-config)
96 AC_PATH_PROG(QMAKE, qmake, none)
97 AC_PATH_PROG(QMAKEQT4, qmake-qt4, none)
98 AC_PATH_PROG(GMAKE, gmake, none)
99 AC_ARG_VAR(WXCONFIG, [wx-config command. On some systems, you must set it to wx-config-2.6 to use wxWidgets 2.6.])
100 if test "x$WXCONFIG" = x; then
103 AC_PATH_PROG(WXCONFIG, ${WXCONFIG}, ${WXCONFIG})
104 AC_ARG_VAR(WXFLAGS, [Parameters to pass to wx-config (e.g. --unicode=no).])
105 AC_PATH_PROG(CDRECORD, cdrecord, cdrecord)
106 AC_PATH_PROG(PIDOF, pidof, pidof)
108 # Some AWK programs fail, so test it and warn the user
109 if echo xfoo | $AWK 'BEGIN { prog=ARGV[1]; ARGC=1 }
110 { if ((prog == $2) || (("(" prog ")") == $2) ||
111 (("[" prog "]") == $2) ||
112 ((prog ":") == $2)) { print $1 ; exit 0 } }' xfoo>/dev/null; then :;
114 AC_MSG_ERROR([!!!!!!!!! WARNING !!!!!!!!!!!!!!
115 The regex engine of $AWK is too broken to be used you
116 might want to install GNU AWK.
117 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!])
120 AC_PATH_PROG(AWK, $THE_AWK, $THE_AWK)
123 test -n "$ARFLAG" || ARFLAGS="cr"
130 AC_SUBST(LOCAL_CFLAGS)
131 AC_SUBST(LOCAL_LDFLAGS)
134 dnl --------------------------------------------------
136 dnl --------------------------------------------------
138 AC_ARG_ENABLE(libtool,
139 AC_HELP_STRING([--enable-libtool], [enable building using GNU libtool @<:@default=yes@:>@]),
141 if test x$enableval = xno; then
146 LT_INIT([shared disable-static])
149 if test x$use_libtool != xno; then
150 DEFAULT_OBJECT_TYPE=".lo"
151 DEFAULT_ARCHIVE_TYPE=".la"
152 DEFAULT_SHARED_OBJECT_TYPE=".la"
153 LIBTOOL="\$(LIBTOOL)"
154 LIBTOOL_INSTALL_TARGET="libtool-install"
155 LIBTOOL_UNINSTALL_TARGET="libtool-uninstall"
156 LIBTOOL_CLEAN_TARGET="libtool-clean"
157 QMAKE_LIBTOOL="${BUILD_DIR}/libtool"
158 FD_PLUGIN_DIR="src/plugins/fd"
161 DEFAULT_OBJECT_TYPE=".o"
162 DEFAULT_ARCHIVE_TYPE=".a"
163 DEFAULT_SHARED_OBJECT_TYPE=".so"
164 LIBTOOL="# \$(LIBTOOL)"
165 LIBTOOL_INSTALL_TARGET=""
166 LIBTOOL_UNINSTALL_TARGET=""
167 LIBTOOL_CLEAN_TARGET=""
168 QMAKE_LIBTOOL="# ${BUILD_DIR}/libtool"
173 AC_SUBST(DEFAULT_OBJECT_TYPE)
174 AC_SUBST(DEFAULT_ARCHIVE_TYPE)
175 AC_SUBST(DEFAULT_SHARED_OBJECT_TYPE)
177 AC_SUBST(LIBTOOL_INSTALL_TARGET)
178 AC_SUBST(LIBTOOL_UNINSTALL_TARGET)
179 AC_SUBST(LIBTOOL_CLEAN_TARGET)
180 AC_SUBST(QMAKE_LIBTOOL)
181 AC_SUBST(FD_PLUGIN_DIR)
183 dnl --------------------------------------------------
184 dnl Include file handling
185 dnl --------------------------------------------------
186 AC_ARG_ENABLE(includes,
187 AC_HELP_STRING([--enable-includes], [enable installing of include files @<:@default=no@:>@]),
189 if test x$enableval = xyes; then
195 dnl It only makes sense to install include files when you install libraries which only happens when
196 dnl libtool is enabled
198 if test x$use_libtool != xno -a x$install_includes = xyes; then
199 INCLUDE_INSTALL_TARGET="install-includes"
200 INCLUDE_UNINSTALL_TARGET="uninstall-includes"
202 INCLUDE_INSTALL_TARGET=""
203 INCLUDE_UNINSTALL_TARGET=""
205 AC_SUBST(INCLUDE_INSTALL_TARGET)
206 AC_SUBST(INCLUDE_UNINSTALL_TARGET)
208 dnl --------------------------------------------------
209 dnl Bacula OP Sys determination (see aclocal.m4)
210 dnl --------------------------------------------------
213 dnl -----------------------------------------------------------
214 dnl Bacula OPSys Distribution determination (see aclocal.m4)
215 dnl ----------------------------------------------------------
216 BA_CHECK_OPSYS_DISTNAME
218 dnl --------------------------------------------------
219 dnl Suppport for gettext (translations)
220 dnl By default, $datarootdir is ${prefix}/share
221 dnl --------------------------------------------------
222 AM_GNU_GETTEXT([external])
224 dnl ------------------------------------------------------------------
225 dnl If the user has not set --prefix, we set our default to nothing.
226 dnl In this case, if the user has not set --sysconfdir, we set it
227 dnl to the package default of /etc/bacula. If either --prefix or
228 dnl --sysconfdir is set, we leave sysconfdir alone except to eval it.
229 dnl If the user has not set --libdir, we set it to the package
230 dnl default of /usr/lib. If either --prefix or --libdir is set,
231 dnl we leave libdir alone except to eval it. If the user has not set
232 dnl --includedir, we set it to the package default of /usr/include.
233 dnl If either --prefix or --includedir is set, we leave includedir
234 dnl alone except to eval it
235 dnl ------------------------------------------------------------------
236 os_name=`uname -s 2>/dev/null`
237 if test x${prefix} = xNONE ; then
238 if test `eval echo ${sysconfdir}` = NONE/etc ; then
239 sysconfdir=/etc/bacula
242 if test `eval echo ${libdir}` = NONE/lib ; then
245 os_processor=`uname -p 2>/dev/null`
246 case ${os_processor} in
261 if test `eval echo ${includedir}` = NONE/include ; then
262 includedir=/usr/include
265 if test `eval echo ${datarootdir}` = NONE/share ; then
266 datarootdir=/usr/share
271 dnl -------------------------------------------------------------------------
272 dnl If the user has not set --exec-prefix, we default to ${prefix}
273 dnl -------------------------------------------------------------------------
274 if test x${exec_prefix} = xNONE ; then
275 exec_prefix=${prefix}
278 sysconfdir=`eval echo ${sysconfdir}`
279 datarootdir=`eval echo ${datarootdir}`
280 docdir=`eval echo ${docdir}`
281 htmldir=`eval echo ${htmldir}`
282 libdir=`eval echo ${libdir}`
283 includedir=`eval echo ${includedir}`
284 localedir=`eval echo ${datarootdir}/locale`
285 AC_DEFINE_UNQUOTED(SYSCONFDIR, "$sysconfdir")
286 AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir")
288 dnl ------------------------------------------------------------------
289 dnl If the user has not set --sbindir, we set our default as /sbin
290 dnl ------------------------------------------------------------------
291 if test x$sbindir = x'${exec_prefix}/sbin' ; then
292 sbindir=${exec_prefix}/sbin
294 sbindir=`eval echo ${sbindir}`
296 dnl -------------------------------------------------------------------------
297 dnl If the user has not set --mandir, we default to /usr/share/man
298 dnl -------------------------------------------------------------------------
299 if test x$mandir = x'${prefix}/man' ; then
300 mandir=/usr/share/man
303 dnl -------------------------------------------------------------------------
304 dnl If the user has not set --htmldir, we default to /usr/share/doc/bacula/html
305 dnl -------------------------------------------------------------------------
306 if test x$htmldir = x${docdir} ; then
307 htmldir=`eval echo ${docdir}bacula/html`
310 dnl -------------------------------------------------------------------------
311 dnl If the user has not set --docdir, we default to /usr/share/doc/
312 dnl -------------------------------------------------------------------------
313 if test x$docdir = x'/usr/share/doc/' ; then
314 docdir=`eval echo ${docdir}bacula`
318 AC_PATH_PROGS(MSGFMT, msgfmt, no)
319 if test "$MSGFMT" = "no"
321 echo 'msgfmt program not found, disabling NLS !'
323 USE_INCLUDED_LIBINTL=no
331 support_postgresql=no
333 support_smartalloc=yes
338 support_wx_console=no
339 support_tray_monitor=no
344 support_static_tools=no
347 support_static_dir=no
348 support_static_cons=no
358 dnl --------------------------------------------------------------------------
359 dnl CHECKING COMMAND LINE OPTIONS
360 dnl --------------------------------------------------------------------------
362 dnl -------------------------------------------
363 dnl gnome (default off)
364 dnl -------------------------------------------
366 AC_HELP_STRING([--enable-gnome], [enable build of bgnome-console GUI @<:@default=no@:>@]),
368 if test x$enableval = xyes; then
375 if test x$support_gnome = xyes; then
376 AC_MSG_ERROR(bgnome-console no longer supported)
377 AC_MSG_ERROR(--enable-gnome option no longer supported)
379 # AC_SUBST(GNOME_DIR)
381 dnl -------------------------------------------
382 dnl bat (default off)
383 dnl -------------------------------------------
385 AC_HELP_STRING([--enable-bat], [enable build of bat Qt4 GUI @<:@default=no@:>@]),
387 if test x$enableval = xyes; then
388 AC_DEFINE(HAVE_BAT, 1, [Set if Bacula bat Qt4 GUI support enabled])
395 if test x$support_bat = xyes; then
396 abc=`$PKGCONFIG --atleast-version=4.2 QtGui`
398 if test $pkg = 0; then
399 BAT_DIR=src/qt-console
401 AC_MSG_ERROR(Unable to find Qt4 installation needed by bat)
406 dnl If bat is enabled, we need the qwt library
414 if test x$support_bat = xyes; then
415 AC_MSG_CHECKING(for qwt support)
417 AC_HELP_STRING([--with-qwt@<:@=DIR@:>@], [specify qwt library directory]),
424 if test -f ${with_qwt}/include/qwt.h; then
425 QWT_INC="${with_qwt}/include"
426 QWT_LDFLAGS="-L${with_qwt}/lib"
436 dnl Search in standard places, or --with-qwt not specified
438 if test $no_qwt = no; then
439 if test x$QWT_INC = x; then
440 for root in /usr /usr/local; do
441 for ver in qwt qwt5 qwt-qt4; do
442 if test -f ${root}/include/${ver}/qwt.h; then
443 QWT_INC="${root}/include/${ver}"
444 if test -d ${root}/lib64/; then
445 QWT_LDFLAGS="-L${root}/lib64"
446 elif test -d ${root}/lib/64/; then
447 QWT_LDFLAGS="-L${root}/64"
449 QWT_LDFLAGS="-L${root}/lib"
460 if test x$QWT_INC = x; then
463 AC_DEFINE(HAVE_QWT, 1, [Set if bat QWT library found])
470 AC_SUBST(QWT_LDFLAGS)
474 dnl -------------------------------------------
475 dnl bwx-console (default off)
476 dnl -------------------------------------------
477 AC_ARG_ENABLE(bwx-console,
478 AC_HELP_STRING([--enable-bwx-console], [enable build of wxWidgets console @<:@default=no@:>@]),
480 if test x$enableval = xyes; then
481 support_wx_console=yes
487 if test x$support_wx_console = xyes; then
488 abc=`$WXCONFIG $WXFLAGS --cppflags`
490 if test $pkg = 0; then
491 wx_version="wxWidgets `$WXCONFIG $WXFLAGS --release`"
492 WXCONS_CPPFLAGS=`$WXCONFIG $WXFLAGS --cppflags`
493 WXCONS_LDFLAGS=`$WXCONFIG $WXFLAGS --libs`
495 AC_SUBST(WXCONS_CPPFLAGS)
496 AC_SUBST(WXCONS_LDFLAGS)
497 WX_DIR="src/wx-console"
500 echo "wx-config program not found. bwx-console disabled."
502 support_wx_console=no
507 dnl -------------------------------------------
508 dnl tray-monitor (default off)
509 dnl -------------------------------------------
510 AC_ARG_ENABLE(tray-monitor,
511 AC_HELP_STRING([--enable-tray-monitor], [enable build of Gnome tray monitor (compatible with KDE @<:@default=no@:>@]),
513 if test x$enableval = xyes; then
514 support_tray_monitor=yes
520 if test x$support_tray_monitor = xyes; then
521 abc=`$PKGCONFIG --exists gtk+-2.0`
523 if test $pkg = 0; then
524 TRAY_MONITOR_CPPFLAGS=`$PKGCONFIG --cflags gtk+-2.0`
525 TRAY_MONITOR_LDFLAGS=`$PKGCONFIG --libs gtk+-2.0`
526 AC_SUBST(TRAY_MONITOR_CPPFLAGS)
527 AC_SUBST(TRAY_MONITOR_LDFLAGS)
528 TRAY_MONITOR_DIR=src/tray-monitor
529 abc=`$PKGCONFIG --atleast-version=2.4 gtk+-2.0`
531 if test $pkg = 0; then
532 AC_DEFINE(HAVE_GTK_2_4, 1, [Set if you have GTK 4.2 or greater loaded])
536 AC_SUBST(TRAY_MONITOR_DIR)
538 dnl -------------------------------------------
539 dnl smartalloc (default off)
540 dnl -------------------------------------------
541 AC_ARG_ENABLE(smartalloc,
542 AC_HELP_STRING([--enable-smartalloc], [enable smartalloc debugging support @<:@default=no@:>@]),
544 if test x$enableval = xno; then
545 support_smartalloc=no
550 if test x$support_smartalloc = xyes; then
551 AC_DEFINE(SMARTALLOC, 1, [Set if you want Smartalloc enabled])
554 dnl -------------------------------------------
555 dnl Lock Manager (default off)
556 dnl -------------------------------------------
557 AC_ARG_ENABLE(lockmgr,
558 AC_HELP_STRING([--enable-lockmgr], [enable lock manager support @<:@default=no@:>@]),
560 if test x$enableval = xyes; then
566 if test x$support_lockmgr = xyes; then
567 AC_DEFINE(_USE_LOCKMGR, 1, [Set if you want Lock Manager enabled])
571 dnl -------------------------------------------
572 dnl static-tools (default off)
573 dnl -------------------------------------------
574 AC_ARG_ENABLE(static-tools,
575 AC_HELP_STRING([--enable-static-tools], [enable static tape tools @<:@default=no@:>@]),
577 if test x$enableval = xyes; then
578 if test x$use_libtool = xyes; then
579 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
580 please rerun configure with --disable-libtool])
582 support_static_tools=yes
588 if test x$support_static_tools = xyes; then
589 TTOOL_LDFLAGS="-static"
591 AC_SUBST(TTOOL_LDFLAGS)
593 dnl -------------------------------------------
594 dnl static-fd (default off)
595 dnl -------------------------------------------
596 AC_ARG_ENABLE(static-fd,
597 AC_HELP_STRING([--enable-static-fd], [enable static File daemon @<:@default=no@:>@]),
599 if test x$enableval = xyes; then
600 if test x$use_libtool = xyes; then
601 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
602 please rerun configure with --disable-libtool])
604 support_static_fd=yes
610 if test x$support_static_fd = xyes; then
611 STATIC_FD="static-bacula-fd"
615 dnl -------------------------------------------
616 dnl static-sd (default off)
617 dnl -------------------------------------------
618 AC_ARG_ENABLE(static-sd,
619 AC_HELP_STRING([--enable-static-sd], [enable static Storage daemon @<:@default=no@:>@]),
621 if test x$enableval = xyes; then
622 if test x$use_libtool = xyes; then
623 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
624 please rerun configure with --disable-libtool])
626 support_static_sd=yes
632 if test x$support_static_sd = xyes; then
633 STATIC_SD="static-bacula-sd"
637 dnl -------------------------------------------
638 dnl static-dir (default off)
639 dnl -------------------------------------------
640 AC_ARG_ENABLE(static-dir,
641 AC_HELP_STRING([--enable-static-dir], [enable static Director @<:@default=no@:>@]),
643 if test x$enableval = xyes; then
644 if test x$use_libtool = xyes; then
645 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
646 please rerun configure with --disable-libtool])
648 support_static_dir=yes
654 if test x$support_static_dir = xyes; then
655 STATIC_DIR="static-bacula-dir"
659 dnl -------------------------------------------
660 dnl static-cons (default off)
661 dnl -------------------------------------------
662 AC_ARG_ENABLE(static-cons,
663 AC_HELP_STRING([--enable-static-cons], [enable static Console @<:@default=no@:>@]),
665 if test x$enableval = xyes; then
666 if test x$use_libtool = xyes; then
667 AC_MSG_ERROR([Libtool is enabled, not compatible with static tools,
668 please rerun configure with --disable-libtool])
670 support_static_cons=yes
678 if test x$support_static_cons = xyes; then
679 STATIC_CONS="static-bconsole"
680 STATIC_GNOME_CONS="static-bgnome-console"
681 STATIC_WX_CONS="static-bwx-console"
683 AC_SUBST(STATIC_CONS)
684 AC_SUBST(STATIC_GNOME_CONS)
685 AC_SUBST(STATIC_WX_CONS)
687 dnl -------------------------------------------
688 dnl client_only (default off)
689 dnl -------------------------------------------
690 AC_ARG_ENABLE(client-only,
691 AC_HELP_STRING([--enable-client-only], [build client (File daemon) only @<:@default=no@:>@]),
693 if test x$enableval = xyes; then
694 build_client_only=yes
700 if test x$build_client_only = xno; then
707 dnl -------------------------------------------
708 dnl director (default on)
709 dnl -------------------------------------------
710 AC_ARG_ENABLE(build-dird,
711 AC_HELP_STRING([--enable-build-dird], [enable building of dird (Director) @<:@default=yes@:>@]),
713 if test x$enableval = xno; then
718 if test x$build_dird = xyes; then
723 DIR_TOOLS="NODIRTOOLS"
728 dnl -------------------------------------------
729 dnl stored (default on)
730 dnl -------------------------------------------
731 AC_ARG_ENABLE(build-stored,
732 AC_HELP_STRING([--enable-build-stored], [enable building of stored (Storage daemon) @<:@default=yes@:>@]),
734 if test x$enableval = xno; then
739 if test x$build_stored = xyes; then
740 STORED_DIR="src/stored"
746 dnl ---------------------------------------------------
747 dnl Check for conio (Bacula readline substitute)(
748 dnl ---------------------------------------------------
749 dnl this allows you to turn it completely off
751 AC_HELP_STRING([--disable-conio], [disable conio support @<:@default=no@:>@]),
753 if test x$enableval = xno; then
760 dnl ---------------------------------------------------
761 dnl Check for IPv6 support
762 dnl ---------------------------------------------------
763 dnl this allows you to turn it completely off
766 AC_HELP_STRING([--enable-ipv6], [enable ipv6 support @<:@default=yes@:>@]),
768 if test x$enableval = xno; then
774 if test x$support_ipv6 = xyes; then
775 AC_TRY_LINK([ #include <sys/types.h>
776 #include <sys/socket.h>
777 #include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;],
778 [support_ipv6=yes], [support_ipv6=no])
781 if test x$support_ipv6 = xyes; then
782 AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
786 if test x$support_conio = xyes; then
787 AC_CHECK_HEADER(termcap.h,
788 [ AC_CHECK_LIB(termcap, tgetent,
789 [ CONS_LIBS="-ltermcap"
794 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
796 [ AC_CHECK_LIB(ncurses, tgetent,
797 [ CONS_LIBS="-lncurses"
802 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
807 AC_CHECK_HEADERS(curses.h)
808 AC_CHECK_HEADER(term.h,
809 [ AC_CHECK_LIB(curses, tgetent,
810 [ CONS_LIBS="-lcurses"
815 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
818 [ echo " "; echo "Required libraries not found. CONIO turned off ..."; echo " "],
827 dnl ---------------------------------------------------
828 dnl Check for readline support/directory (default off)
829 dnl ---------------------------------------------------
830 dnl this allows you to turn it completely off
831 AC_ARG_ENABLE(readline,
832 AC_HELP_STRING([--disable-readline], [disable readline support @<:@default=yes@:>@]),
834 if test x$enableval = xno; then
842 if test x$support_readline = xyes; then
843 AC_ARG_WITH(readline,
844 AC_HELP_STRING([--with-readline@<:@=DIR@:>@], [specify readline library directory]),
846 case "$with_readline" in
851 if test -f ${with_readline}/readline.h; then
852 CONS_INC="-I${with_readline}"
853 CONS_LDFLAGS="-L$with_readline"
854 elif test -f ${with_readline}/include/readline/readline.h; then
855 CONS_INC="-I${with_readline}/include/readline"
856 CONS_LDFLAGS="-L${with_readline}/lib"
857 with_readline="${with_readline}/include/readline"
859 with_readline="/usr/include/readline"
862 AC_CHECK_HEADER(${with_readline}/readline.h,
864 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
865 CONS_LIBS="-lreadline -lhistory -ltermcap"
869 echo "readline.h not found. readline turned off ..."
876 dnl check for standard readline library
877 AC_CHECK_HEADER(/usr/include/readline/readline.h,
879 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
881 CONS_INC="-I/usr/include/readline"
882 CONS_LIBS="-lreadline -ltermcap"
884 dnl Did not find standard library, so try Bacula's default
885 AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h,
887 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
889 CONS_INC="-I${TOP_DIR}/depkgs/readline"
890 CONS_LIBS="-lreadline -lhistory -ltermcap"
891 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
892 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
895 echo "readline.h not found. readline turned off ..."
909 AC_SUBST(CONS_LDFLAGS)
910 AC_SUBST(READLINE_SRC)
912 dnl Minimal stuff for readline Makefile configuration
917 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr lstat lchown)
918 AC_CHECK_FUNCS(nanosleep nl_langinfo)
919 AC_CHECK_HEADERS(varargs.h)
921 dnl End of readline/conio stuff
922 dnl -----------------------------------------------------------------------
924 dnl -----------------------------------------------------------------------
925 dnl Check for Python support
927 AC_MSG_CHECKING(for Python support)
929 AC_HELP_STRING([--with-python@<:@=DIR@:>@], [Include Python support. DIR is the Python base install directory, default is to search through a number of common places for the Python files.]),
933 if test "$withval" != "no"; then
934 if test "$withval" = "yes"; then
935 if test -e /usr/bin/python-config ; then
936 PYTHON_INCDIR=`/usr/bin/python-config --includes`
937 PYTHON_LIBS=`/usr/bin/python-config --libs`
939 for python_root in /usr /usr/local /usr/sfw; do
940 for ver in python2.2 python2.3 python2.4 python2.5 python2.6 python3; do
941 if test -f $python_root/include/${ver}/Python.h; then
942 PYTHON_INCDIR=-I$python_root/include/${ver}
943 if test -d $python_root/lib64/${ver}/config; then
944 PYTHON_LIBS="-L$python_root/lib64/${ver}/config -l${ver}"
946 PYTHON_LIBS="-L$python_root/lib/${ver}/config -l${ver}"
953 if test x$PYTHON_INCDIR = x; then
954 if test -f $prefix/include/Python.h; then
955 PYTHON_INCDIR=-I$prefix/include
956 if test -d $prefix/lib64/config; then
957 PYTHON_LIBS="-L$prefix/lib64/config -lpython"
959 PYTHON_LIBS="-L$prefix/lib/config -lpython"
963 AC_MSG_ERROR(Unable to find Python.h in standard locations)
968 if test -e $withval/bin/python-config ; then
969 PYTHON_INCDIR=`$withval/bin/python-config --includes`
970 PYTHON_LIBS=`$withval/bin/python-config --libs`
971 elif test -f $withval/Python.h; then
972 PYTHON_INCDIR=-I$withval
973 PYTHON_LIBS="-L$withval/config -lpython"
974 elif test -f $withval/include/Python.h; then
975 PYTHON_INCDIR=-I$withval/include
976 if test -d $withval/lib64/config; then
977 PYTHON_LIBS="-L$withval/lib64/config -lpython"
979 PYTHON_LIBS="-L$withval/lib/config -lpython"
981 elif test -f $withval/include/python/Python.h; then
982 PYTHON_INCDIR=-I$withval/include/python
983 if test -d $withval/lib64/python/config; then
984 PYTHON_LIBS="-L$withval/lib64/python/config -lpython"
986 PYTHON_LIBS="-L$withval/lib/python/config -lpython"
990 AC_MSG_ERROR(Invalid Python directory $withval - unable to find Python.h under $withval)
994 AC_DEFINE([HAVE_PYTHON], 1)
997 AC_MSG_NOTICE(checking for more Python libs)
998 saved_LIBS="$LIBS"; LIBS=
999 AC_SEARCH_LIBS(shm_open, [rt])
1000 AC_CHECK_LIB(util, openpty)
1001 PYTHON_LIBS="$PYTHON_LIBS $LIBS"
1010 AC_SUBST(PYTHON_LIBS)
1011 AC_SUBST(PYTHON_INCDIR)
1014 dnl Find where sockets are (especially for Solaris)
1015 dnl Do this before the TCP Wrappers test since tcp wrappers
1016 dnl uses the socket library and some linkers are stupid.
1018 AC_CHECK_FUNC(socket,
1019 AC_MSG_RESULT(using libc's socket),
1020 AC_CHECK_LIB(xnet,socket)
1021 AC_CHECK_LIB(socket,socket)
1022 AC_CHECK_LIB(inet,socket))
1024 dnl -----------------------------------------------------------
1025 dnl Check whether user wants TCP wrappers support (default off)
1026 dnl -----------------------------------------------------------
1029 AC_ARG_WITH(tcp-wrappers,
1030 AC_HELP_STRING([--with-tcp-wrappers@<:@=DIR@:>@], [enable tcpwrappers support]),
1032 if test "x$withval" != "xno" ; then
1034 LIBS="$saved_LIBS -lwrap"
1035 AC_SEARCH_LIBS(nanosleep, [rt])
1036 AC_MSG_CHECKING(for libwrap)
1039 #include <sys/types.h>
1041 int deny_severity = 0;
1042 int allow_severity = 0;
1043 struct request_info *req;
1048 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
1053 LIBS="$saved_LIBS -lwrap -lnsl"
1054 WRAPLIBS="$saved_LIBS -lwrap -lnsl"
1057 #include <sys/types.h>
1059 int deny_severity = 0;
1060 int allow_severity = 0;
1061 struct request_info *req;
1066 AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
1071 AC_MSG_ERROR([*** libwrap missing])
1080 dnl -----------------------------------------------------------
1081 dnl Check whether OpenSSL is available
1082 dnl -----------------------------------------------------------
1083 AC_MSG_CHECKING([for OpenSSL])
1084 dnl The following uses quadrigraphs:
1087 AC_ARG_WITH(openssl,
1088 AC_HELP_STRING([--with-openssl@<:@=DIR@:>@], [Include OpenSSL support. DIR is the OpenSSL base]),
1090 with_openssl_directory=${withval}
1094 if test "x$with_openssl_directory" != "xno"; then
1095 OPENSSL_LIBS="-lssl -lcrypto"
1098 if test "x$with_openssl_directory" != "xyes" && test x"${with_openssl_directory}" != "x"; then
1100 # Make sure the $with_openssl_directory also makes sense
1102 if test -d "$with_openssl_directory/lib" -a -d "$with_openssl_directory/include"; then
1103 OPENSSL_LIBS="-L$with_openssl_directory/lib $OPENSSL_LIBS"
1104 OPENSSL_INC="-I$with_openssl_directory/include $OPENSSL_INC"
1108 saved_LIBS="${LIBS}"
1109 saved_CFLAGS="${CFLAGS}"
1110 LIBS="${saved_LIBS} ${OPENSSL_LIBS}"
1111 CFLAGS="${saved_CFLAGS} ${OPENSSL_INC}"
1115 #include <openssl/ssl.h>
1117 CRYPTO_set_id_callback(NULL);
1120 support_crypto="yes"
1128 #include <openssl/evp.h>
1132 ac_cv_openssl_sha2="yes"
1134 ac_cv_openssl_sha2="no"
1138 dnl Solaris disables greater than 128+ bit encryption in their OpenSSL
1139 dnl implementation, presumably for export reasons. If 192bit AES
1140 dnl is available, we assume that we're running with a 'non-export'
1141 dnl openssl library.
1144 #include <openssl/evp.h>
1148 ac_cv_openssl_export="no"
1150 ac_cv_openssl_export="yes"
1154 LIBS="${saved_LIBS}"
1155 CFLAGS="${saved_CFLAGS}"
1157 if test "$support_tls" = "yes"; then
1158 AC_DEFINE(HAVE_OPENSSL, 1, [Define if OpenSSL library is available])
1159 AC_DEFINE(HAVE_TLS, 1, [Define if TLS support should be enabled])
1160 AC_DEFINE(HAVE_CRYPTO, 1, [Define if encryption support should be enabled])
1163 if test "$ac_cv_openssl_sha2" = "yes"; then
1164 AC_DEFINE(HAVE_SHA2, 1, [Define if the SHA-2 family of digest algorithms is available])
1167 if test "$ac_cv_openssl_export" = "yes"; then
1168 AC_DEFINE(HAVE_OPENSSL_EXPORT_LIBRARY, 1, [Define if the OpenSSL library is export-contrained to 128bit ciphers])
1177 if test "$support_tls" = "no"; then
1182 AC_MSG_RESULT([$support_tls])
1183 AC_SUBST(OPENSSL_LIBS)
1184 AC_SUBST(OPENSSL_INC)
1186 dnl -----------------------------------------------------------
1187 dnl dlopen is needed for plugins
1188 dnl -----------------------------------------------------------
1189 AC_SEARCH_LIBS(dlopen, [dl])
1191 dnl ------------------------------------------
1192 dnl Where to place working dir
1193 dnl ------------------------------------------
1194 working_dir=`eval echo ${prefix}/var/bacula/working`
1195 AC_ARG_WITH(working-dir,
1196 AC_HELP_STRING([--with-working-dir=PATH], [specify path of Bacula working directory]),
1198 if test "x$withval" != "xno" ; then
1199 working_dir=$withval
1204 AC_SUBST(working_dir)
1206 dnl ------------------------------------------------------------------
1207 dnl If the user has not set archivedir, we set our default as /tmp
1208 dnl ------------------------------------------------------------------
1210 AC_ARG_WITH(archivedir,
1211 AC_HELP_STRING([--with-archivedir=PATH], [specify path of SD archive directory]),
1213 if test "x$withval" != "xno" ; then
1219 AC_SUBST(archivedir)
1221 dnl ------------------------------------------------------------------
1222 dnl Allow the user to specify the daemon resource name default hostname
1223 dnl ------------------------------------------------------------------
1225 AC_ARG_WITH(basename,
1226 AC_HELP_STRING([--with-basename=RESNAME], [specify base resource name for daemons]),
1228 if test "x$withval" != "xno" ; then
1236 dnl ------------------------------------------------------------------
1237 dnl Allow the user to override the hostname (default = machine hostname)
1238 dnl ------------------------------------------------------------------
1239 hostname=`uname -n | cut -d '.' -f 1`
1240 if test x${hostname} = x ; then
1241 hostname="localhost"
1243 AC_ARG_WITH(hostname,
1244 AC_HELP_STRING([--with-hostname=RESNAME], [specify host name for daemons]),
1246 if test "x$withval" != "xno" ; then
1255 dnl ------------------------------------------
1256 dnl Where to place scriptdir (script files)
1257 dnl ------------------------------------------
1258 scriptdir=`eval echo ${sysconfdir}`
1259 AC_ARG_WITH(scriptdir,
1260 AC_HELP_STRING([--with-scriptdir=PATH], [specify path of Bacula scripts directory]),
1262 if test "x$withval" != "xno" ; then
1271 dnl ------------------------------------------
1272 dnl Where to place bsrdir (bsr files)
1273 dnl ------------------------------------------
1276 AC_HELP_STRING([--with-bsrdir=PATH], [specify path of Bacula bsrs directory]),
1278 if test "x$withval" != "xno" ; then
1286 dnl ------------------------------------------
1287 dnl Where to place logdir (bsr files)
1288 dnl ------------------------------------------
1291 AC_HELP_STRING([--with-logdir=PATH], [specify path of Bacula logs directory]),
1293 if test "x$withval" != "xno" ; then
1302 # ------------------------------------------
1303 # Where to place plugindir (plugin files)
1304 # ------------------------------------------
1305 plugindir=`eval echo ${libdir}`
1306 AC_ARG_WITH(plugindir,
1307 AC_HELP_STRING([--with-plugindir=PATH], [specify path of Bacula plugins directory]),
1309 if test "x$withval" != "xno" ; then
1317 dnl ------------------------------------------
1318 dnl Where to send dump email
1319 dnl ------------------------------------------
1320 dump_email=root@localhost
1321 AC_ARG_WITH(dump-email,
1322 AC_HELP_STRING([--with-dump-email=EMAIL], [dump email address]),
1324 if test "x$withval" != "xno" ; then
1330 AC_SUBST(dump_email)
1332 dnl ------------------------------------------
1333 dnl Where to send job email
1334 dnl ------------------------------------------
1335 job_email=root@localhost
1336 AC_ARG_WITH(job-email,
1337 AC_HELP_STRING([--with-job-email=EMAIL], [job output email address]),
1339 if test "x$withval" != "xno" ; then
1347 dnl ------------------------------------------
1348 dnl Where to find smtp host
1349 dnl ------------------------------------------
1351 AC_ARG_WITH(smtp_host,
1352 AC_HELP_STRING([--with-smtp-host=HOST], [SMTP mail host address]),
1354 if test "x$withval" != "xno" ; then
1362 dnl ------------------------------------
1363 dnl Where to place pid files
1364 dnl ------------------------------------
1366 AC_ARG_WITH(pid-dir,
1367 AC_HELP_STRING([--with-pid-dir=PATH], [specify location of Bacula pid files]),
1369 if test "x$withval" != "xno" ; then
1375 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
1378 dnl ------------------------------------
1379 dnl Where to place subsys "lock file"
1380 dnl ------------------------------------
1381 subsysdir=/var/run/subsys
1382 if test -d /var/run/subsys; then
1383 subsysdir=/var/run/subsys
1384 elif test -d /var/lock/subsys; then
1385 subsysdir=/var/lock/subsys
1387 subsysdir=/var/run/subsys
1389 AC_ARG_WITH(subsys-dir,
1390 AC_HELP_STRING([--with-subsys-dir=PATH], [specify location of Bacula subsys file]),
1392 if test "x$withval" != "xno" ; then
1400 dnl ------------------------------------
1401 dnl Where to start assigning ports
1402 dnl ------------------------------------
1404 AC_ARG_WITH(baseport,
1405 AC_HELP_STRING([--with-baseport=PORT], [specify base port address for daemons]),
1407 if test "x$withval" != "xno" ; then
1414 dir_port=`expr $baseport`
1415 fd_port=`expr $baseport + 1`
1416 sd_port=`expr $fd_port + 1`
1422 dnl ------------------------------------------
1423 dnl Generate passwords
1424 dnl ------------------------------------------
1426 AC_ARG_WITH(dir-password,
1427 AC_HELP_STRING([--with-dir-password=PASSWORD], [specify Director's password]),
1429 if test "x$withval" != "xno" ; then
1430 dir_password=$withval
1435 if test "x$dir_password" = "x" ; then
1436 if test "x$OPENSSL" = "xnone" ; then
1437 key=`autoconf/randpass 33`
1439 key=`openssl rand -base64 33`
1445 AC_ARG_WITH(fd-password,
1446 AC_HELP_STRING([--with-fd-password=PASSWORD], [specify Client's password]),
1448 if test "x$withval" != "xno" ; then
1449 fd_password=$withval
1454 if test "x$fd_password" = "x" ; then
1455 if test "x$OPENSSL" = "xnone" ; then
1456 key=`autoconf/randpass 37`
1458 key=`openssl rand -base64 33`
1464 AC_ARG_WITH(sd-password,
1465 AC_HELP_STRING([--with-sd-password=PASSWORD], [specify Storage daemon's password]),
1467 if test "x$withval" != "xno" ; then
1468 sd_password=$withval
1473 if test "x$sd_password" = "x" ; then
1474 if test "x$OPENSSL" = "xnone" ; then
1475 key=`autoconf/randpass 41`
1477 key=`openssl rand -base64 33`
1483 AC_ARG_WITH(mon-dir-password,
1484 AC_HELP_STRING([--with-mon-dir-password=PASSWORD], [specify Director's password used by the monitor]),
1486 if test "x$withval" != "xno" ; then
1487 mon_dir_password=$withval
1492 if test "x$mon_dir_password" = "x" ; then
1493 if test "x$OPENSSL" = "xnone" ; then
1494 key=`autoconf/randpass 33`
1496 key=`openssl rand -base64 33`
1498 mon_dir_password=$key
1502 AC_ARG_WITH(mon-fd-password,
1503 AC_HELP_STRING([--with-mon-fd-password=PASSWORD], [specify Client's password used by the monitor]),
1505 if test "x$withval" != "xno" ; then
1506 mon_fd_password=$withval
1511 if test "x$mon_fd_password" = "x" ; then
1512 if test "x$OPENSSL" = "xnone" ; then
1513 key=`autoconf/randpass 37`
1515 key=`openssl rand -base64 33`
1517 mon_fd_password=$key
1521 AC_ARG_WITH(mon-sd-password,
1522 AC_HELP_STRING([--with-mon-sd-password=PASSWORD], [specify Storage daemon's password used by the monitor]),
1524 if test "x$withval" != "xno" ; then
1525 mon_sd_password=$withval
1530 if test "x$mon_sd_password" = "x" ; then
1531 if test "x$OPENSSL" = "xnone" ; then
1532 key=`autoconf/randpass 41`
1534 key=`openssl rand -base64 33`
1536 mon_sd_password=$key
1539 AC_SUBST(dir_password)
1540 AC_SUBST(fd_password)
1541 AC_SUBST(sd_password)
1542 AC_SUBST(mon_dir_password)
1543 AC_SUBST(mon_fd_password)
1544 AC_SUBST(mon_sd_password)
1547 dnl Pickup any database name
1550 AC_ARG_WITH(db_name,
1551 AC_HELP_STRING([--with-db-name=DBNAME], [specify database name @<:@default=bacula@:>@]),
1553 if test "x$withval" != "x" ; then
1561 AC_ARG_WITH(db_user,
1562 AC_HELP_STRING([--with-db-user=UNAME], [specify database user @<:@default=bacula@:>@]),
1564 if test "x$withval" != "x" ; then
1572 AC_ARG_WITH(db_password,
1573 AC_HELP_STRING([--with-db-password=PWD], [specify database password @<:@default=*none*@:>@]),
1575 if test "x$withval" != "x" ; then
1576 db_password=$withval
1580 AC_SUBST(db_password)
1583 dnl Pickup a database port
1586 AC_ARG_WITH(db_port,
1587 AC_HELP_STRING([--with-db-port=DBPORT], [specify a database port @<:@default=null@:>@]),
1589 if test "x$withval" != "x" ; then
1597 # Handle users and groups for each daemon
1600 AC_ARG_WITH(dir_user,
1601 AC_HELP_STRING([--with-dir-user=USER], [specify user for Director daemon]),
1603 if test "x$withval" != "x" ; then
1610 AC_ARG_WITH(dir_group,
1611 AC_HELP_STRING([--with-dir-group=GROUP], [specify group for Director daemon]),
1613 if test "x$withval" != "x" ; then
1620 AC_ARG_WITH(sd_user,
1621 AC_HELP_STRING([--with-sd-user=USER], [specify user for Storage daemon]),
1623 if test "x$withval" != "x" ; then
1630 AC_ARG_WITH(sd_group,
1631 AC_HELP_STRING([--with-sd-group=GROUP], [specify group for Storage daemon]),
1633 if test "x$withval" != "x" ; then
1640 AC_ARG_WITH(fd_user,
1641 AC_HELP_STRING([--with-fd-user=USER], [specify user for File daemon]),
1643 if test "x$withval" != "x" ; then
1650 AC_ARG_WITH(fd_group,
1651 AC_HELP_STRING([--with-fd-group=GROUP], [specify group for File daemon]),
1653 if test "x$withval" != "x" ; then
1667 dnl allow setting default executable permissions
1670 AC_ARG_WITH(sbin-perm,
1671 AC_HELP_STRING([--with-sbin-perm=MODE], [specify permissions for sbin binaries @<:@default=0754@:>@]),
1673 if test "x$withval" != "x" ; then
1681 dnl ------------------------------------------------
1682 dnl Bacula check for various SQL database engines
1683 dnl ------------------------------------------------
1685 BA_CHECK_POSTGRESQL_DB
1691 # BA_CHECK_SQLITE_DB
1700 dnl -------------------------------------------
1701 dnl enable batch attribute DB insert (default on)
1702 dnl -------------------------------------------
1703 support_batch_insert=no
1704 A=`test -f $SQL_LIB && nm $SQL_LIB | grep pthread_mutex_lock`
1706 if test $pkg = 0; then
1707 support_batch_insert=yes
1708 AC_ARG_ENABLE(batch-insert,
1709 AC_HELP_STRING([--enable-batch-insert], [enable the DB batch insert code @<:@default=no@:>@]),
1711 if test x$enableval = xno; then
1712 support_batch_insert=no
1714 support_batch_insert=yes
1720 dnl Check if postgresql can support batch mode
1721 if test x$DB_TYPE = xpostgresql; then
1722 AC_CHECK_LIB(pq, PQisthreadsafe, AC_DEFINE(HAVE_PQISTHREADSAFE, 1, [Set if have PQisthreadsafe]))
1723 AC_CHECK_LIB(pq, PQputCopyData, AC_DEFINE(HAVE_PQ_COPY, 1, [Set if have PQputCopyData]))
1724 if test "x$ac_cv_lib_pq_PQputCopyData" != "xyes"
1726 support_batch_insert=no
1730 if test x$DB_TYPE = xdbi; then
1734 dnl Check for batch insert
1735 if test $DB_PROG = postgresql; then
1736 AC_CHECK_LIB(pq, PQisthreadsafe, AC_DEFINE(HAVE_PQISTHREADSAFE))
1737 AC_CHECK_LIB(pq, PQputCopyData, AC_DEFINE(HAVE_PQ_COPY))
1738 test "x$ac_cv_lib_pq_PQputCopyData" != "xyes"
1742 if test $DB_PROG = mysql; then
1743 A=`test -f $SQL_LIB && nm $DB_PROG_LIB | grep pthread_mutex_lock`
1747 if test $DB_PROG = sqlite3; then
1748 A=`test -f $SQL_LIB && nm $DB_PROG_LIB | grep pthread_mutex_lock`
1752 if test $pkg = 0; then
1753 AC_ARG_ENABLE(batch-insert,
1754 AC_HELP_STRING([--enable-batch-insert], [enable the DB batch insert code @<:@default=no@:>@]),
1756 if test x$enableval = xno; then
1757 support_batch_insert=no
1759 support_batch_insert=yes
1765 dnl If dbi was not chosen, let the comment in file
1769 AC_SUBST(uncomment_dbi)
1771 if test $support_batch_insert = yes ; then
1772 AC_DEFINE(HAVE_BATCH_FILE_INSERT, 1, [Set if DB batch insert code enabled])
1775 AC_DEFINE(PROTOTYPES)
1777 dnl --------------------------------------------------------------------------
1778 dnl Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
1780 if test -z "$CFLAGS" -o "$CFLAGS" = "-g -O2"; then
1781 if test -z "$CCOPTS"; then
1782 CCOPTS='-g -O2 -Wall'
1790 dnl See if we can use 64 bit file addresses
1791 largefile_support="no"
1796 dnl --------------------------------------------------------------------------
1797 dnl CHECKING FOR HEADER FILES
1798 dnl --------------------------------------------------------------------------
1836 AC_STRUCT_ST_BLKSIZE
1840 dnl --------------------------------------------------------------------------
1841 dnl Check for utime.h structure
1842 dnl --------------------------------------------------------------------------
1843 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
1847 #include <sys/types.h>
1852 ba_cv_header_utime_h=yes
1854 ba_cv_header_utime_h=no
1859 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H, 1, [Set if utime.h exists])
1861 dnl --------------------------------------------------------------------------
1862 dnl Check for socklen_t
1863 dnl --------------------------------------------------------------------------
1864 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
1868 #include <sys/types.h>
1869 #include <sys/socket.h>
1873 ba_cv_header_socklen_t=yes
1875 ba_cv_header_socklen_t=no
1880 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T, 1, [Set if socklen_t exists])
1882 dnl --------------------------------------------------------------------------
1883 dnl Check for ioctl request type
1884 dnl --------------------------------------------------------------------------
1885 AC_CACHE_CHECK(for ioctl_req_t, ba_cv_header_ioctl_req_t,
1890 #include <sys/types.h>
1891 #include <sys/ioctl.h>
1893 int (*d_ioctl)(int fd, unsigned long int request, ...);
1896 ba_cv_header_ioctl_req_t=yes
1898 ba_cv_header_ioct_req_t_t=no
1903 test $ba_cv_header_ioctl_req_t = yes && AC_DEFINE(HAVE_IOCTL_ULINT_REQUEST, 1, [Set if ioctl request is unsigned long int])
1906 dnl --------------------------------------------------------------------------
1907 dnl Check for typeof()
1908 dnl --------------------------------------------------------------------------
1910 AC_CACHE_CHECK(for typeof, ba_cv_have_typeof,
1914 main(){char *a = 0; a = (typeof a)a;}
1916 ba_cv_have_typeof=yes
1918 ba_cv_have_typeof=no
1920 ba_cv_have_typeof=no
1925 test $ba_cv_have_typeof = yes && AC_DEFINE([HAVE_TYPEOF], 1, [Defind to 1 if compiler has typeof])
1930 dnl --------------------------------------------------------------------------
1931 dnl CHECKING FOR FILESYSTEM TYPE
1932 dnl --------------------------------------------------------------------------
1933 AC_MSG_CHECKING(how to get filesystem type)
1935 # The order of these tests is important.
1938 #include <sys/statvfs.h>
1939 #include <sys/fstyp.h>
1941 AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4
1943 if test $fstype = no; then
1946 #include <sys/statfs.h>
1947 #include <sys/fstyp.h>
1949 AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3
1952 if test $fstype = no; then
1955 #include <sys/statfs.h>
1956 #include <sys/vmount.h>
1958 AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX
1961 if test $fstype = no; then
1966 AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD
1969 if test $fstype = no; then
1970 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
1972 if test $fstype = no; then
1975 #include <sys/mount.h>
1976 #include <sys/fs_types.h>
1978 AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix
1981 AC_MSG_RESULT($fstype)
1983 AC_CHECK_HEADER(sys/statvfs.h, [ AC_DEFINE(HAVE_SYS_STATVFS_H,1,[Defines if your system have the sys/statvfs.h header file])] , )
1985 dnl --------------------------------------------------------------------------
1986 dnl CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
1987 dnl --------------------------------------------------------------------------
1997 AC_CHECK_TYPE(ino_t, unsigned long)
1998 AC_CHECK_TYPE(dev_t, unsigned long)
1999 AC_CHECK_TYPE(daddr_t, long)
2000 AC_CHECK_TYPE(major_t, int)
2001 AC_CHECK_TYPE(minor_t, int)
2002 AC_CHECK_TYPE(ssize_t, int)
2008 AC_CHECK_SIZEOF(char, 1)
2009 AC_CHECK_SIZEOF(short int, 2)
2010 AC_CHECK_SIZEOF(int, 4)
2011 AC_CHECK_SIZEOF(long int, 4)
2012 AC_CHECK_SIZEOF(long long int, 8)
2013 AC_CHECK_SIZEOF(int *, 4)
2015 dnl Check for sys/types.h types
2016 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int,
2020 #include <sys/types.h>
2024 ac_cv_have_u_int="yes"
2026 ac_cv_have_u_int="no"
2031 if test "x$ac_cv_have_u_int" = "xyes" ; then
2032 AC_DEFINE(HAVE_U_INT)
2036 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t,
2040 #include <sys/types.h>
2044 ac_cv_have_intmax_t="yes"
2052 ac_cv_have_intmax_t="yes"
2054 ac_cv_have_intmax_t="no"
2061 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
2062 AC_DEFINE(HAVE_INTMAX_T)
2066 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t,
2070 #include <sys/types.h>
2072 u_intmax_t a; a = 1;
2074 ac_cv_have_u_intmax_t="yes"
2080 u_intmax_t a; a = 1;
2082 ac_cv_have_u_intmax_t="yes"
2084 ac_cv_have_u_intmax_t="no"
2091 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
2092 AC_DEFINE(HAVE_U_INTMAX_T)
2096 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t,
2100 #include <sys/types.h>
2102 int8_t a; int16_t b; int32_t c; a = b = c = 1;
2104 ac_cv_have_intxx_t="yes"
2106 ac_cv_have_intxx_t="no"
2111 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
2112 AC_DEFINE(HAVE_INTXX_T)
2116 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t,
2120 #include <sys/types.h>
2124 ac_cv_have_int64_t="yes"
2126 ac_cv_have_int64_t="no"
2131 if test "x$ac_cv_have_int64_t" = "xyes" ; then
2132 AC_DEFINE(HAVE_INT64_T)
2136 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t,
2140 #include <sys/types.h>
2142 u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;
2144 ac_cv_have_u_intxx_t="yes"
2146 ac_cv_have_u_intxx_t="no"
2151 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
2152 AC_DEFINE(HAVE_U_INTXX_T)
2156 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t,
2160 #include <sys/types.h>
2164 ac_cv_have_u_int64_t="yes"
2166 ac_cv_have_u_int64_t="no"
2171 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
2172 AC_DEFINE(HAVE_U_INT64_T)
2176 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
2177 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2179 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
2182 #include <sys/bitypes.h>
2184 int8_t a; int16_t b; int32_t c;
2185 u_int8_t e; u_int16_t f; u_int32_t g;
2186 a = b = c = e = f = g = 1;
2188 AC_DEFINE(HAVE_U_INTXX_T)
2189 AC_DEFINE(HAVE_INTXX_T)
2190 AC_DEFINE(HAVE_SYS_BITYPES_H)
2198 if test -z "$have_u_intxx_t" ; then
2199 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t,
2203 #include <sys/types.h>
2205 uint8_t a; uint16_t b;
2206 uint32_t c; a = b = c = 1;
2208 ac_cv_have_uintxx_t="yes"
2210 ac_cv_have_uintxx_t="no"
2215 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
2216 AC_DEFINE(HAVE_UINTXX_T)
2220 if (test -z "$have_u_int64_t" || test -z "$have_int64_t" && \
2221 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2223 AC_MSG_CHECKING([for int64_t and u_int64_t types in sys/bitypes.h])
2226 #include <sys/bitypes.h>
2228 int64_t a; u_int64_t b;
2231 AC_DEFINE(HAVE_U_INT64_T)
2232 AC_DEFINE(HAVE_INT64_T)
2240 if (test -z "$have_uintxx_t" && \
2241 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2243 AC_MSG_CHECKING([for uintXX_t types in sys/bitypes.h])
2246 #include <sys/bitypes.h>
2248 uint8_t a; uint16_t b;
2249 uint32_t c; a = b = c = 1;
2251 AC_DEFINE(HAVE_UINTXX_T)
2259 dnl --------------------------------------------------------------------------
2260 dnl CHECKING FOR REQUIRED LIBRARY FUNCTIONS
2261 dnl --------------------------------------------------------------------------
2277 [echo 'configure: cannot find needed function.'; exit 1]
2280 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
2281 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
2282 AC_CHECK_FUNCS(posix_fadvise)
2283 AC_CHECK_FUNCS(fdatasync)
2285 AC_CHECK_FUNCS(chflags)
2287 AC_CHECK_FUNCS(snprintf vsnprintf gethostid fseeko)
2289 AC_CACHE_CHECK(for va_copy, ba_cv_va_copy,
2294 void use_va_copy(va_list args){va_list args2; va_copy(args2,args); va_end(args2);}
2295 void call_use_va_copy(int junk,...){va_list args; va_start(args,junk); use_va_copy(args); va_end(args);}
2297 call_use_va_copy(1,2,3)
2306 test $ba_cv_va_copy = yes && AC_DEFINE(HAVE_VA_COPY, 1, [Set if va_copy exists])
2308 dnl --------------------------------------------------------------------------
2309 dnl CHECKING FOR THREAD SAFE FUNCTIONS
2310 dnl --------------------------------------------------------------------------
2311 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
2313 # If resolver functions are not in libc check for -lnsl or -lresolv.
2314 AC_CHECK_FUNC(gethostbyname_r,
2315 AC_MSG_RESULT(using libc's resolver),
2316 AC_CHECK_LIB(nsl,gethostbyname_r)
2317 AC_CHECK_LIB(resolv,gethostbyname_r))
2319 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
2320 AC_CHECK_FUNCS(inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)])
2321 AC_CHECK_FUNCS(gethostbyname2, [AC_DEFINE(HAVE_GETHOSTBYNAME2)])
2323 dnl ----------------------------
2324 dnl check sa_len of sockaddr
2325 dnl ----------------------------
2326 AC_CACHE_CHECK(for struct sockaddr has a sa_len field, ac_cv_struct_sockaddr_sa_len,
2330 #include <sys/socket.h>
2332 struct sockaddr s; s.sa_len;
2334 ac_cv_struct_sockaddr_sa_len=yes
2335 ], [ac_cv_struct_sockaddr_sa_len=no
2341 if test $ac_cv_struct_sockaddr_sa_len = yes; then
2342 AC_DEFINE(HAVE_SA_LEN, 1, [Define if sa_len field exists in struct sockaddr])
2349 AC_FUNC_CLOSEDIR_VOID
2350 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
2351 # AC_FUNC_FNMATCH dnl use local version
2353 AC_CHECK_LIB(intl, gettext, [LIBS="$LIBS -lintl"])
2355 AC_CHECK_LIB(sun, getpwnam)
2357 AC_CHECK_HEADERS(zlib.h)
2358 AC_CHECK_LIB(z, deflate, [FDLIBS="-lz"])
2360 if test x$FDLIBS = x-lz; then
2361 AC_DEFINE(HAVE_LIBZ)
2366 dnl Check for ACL support and libraries
2370 AC_HELP_STRING([--disable-acl], [disable acl support @<:@default=auto@:>@]),
2372 if test x$enableval = xyes; then
2374 elif test x$enableval = xno; then
2381 have_extended_acl=no
2382 if test x$support_acl = xyes -o x$support_acl = xauto; then
2383 AC_CHECK_HEADER(sys/acl.h, [ AC_DEFINE(HAVE_SYS_ACL_H,1,[Defines if your system have the sys/acl.h header file])] , )
2384 AC_CHECK_FUNC(acl_get_file,
2388 AC_CHECK_LIB(acl, acl_get_file,
2391 FDLIBS="-lacl $FDLIBS"
2393 AC_CHECK_LIB(pacl, acl_get_file,
2396 FDLIBS="-lpacl $FDLIBS"
2398 AC_CHECK_LIB(sec, acltotext,
2401 FDLIBS="-lsec $FDLIBS"
2403 AC_CHECK_LIB(sec, acl_totext,
2405 have_extended_acl=yes
2417 if test x$support_acl = xyes -a $have_acl != yes; then
2418 AC_MSG_ERROR([acl support explicitly enabled but no supported acl implementation found,
2419 please either load the acl libraries or rerun configure without --enable-acl])
2421 if test $have_acl = yes; then
2422 AC_DEFINE([HAVE_ACL],1,[Normal acl support])
2425 if test $have_extended_acl = yes; then
2426 AC_DEFINE([HAVE_EXTENDED_ACL],1,[Extended acl support])
2432 dnl Check for XATTR support
2435 AC_ARG_ENABLE(xattr,
2436 AC_HELP_STRING([--disable-xattr], [disable xattr support @<:@default=auto@:>@]),
2438 if test x$enableval = xyes; then
2440 elif test x$enableval = xno; then
2447 if test x$support_xattr = xyes -o x$support_xattr = xauto; then
2449 dnl First check for *BSD support
2451 AC_CHECK_HEADER(sys/extattr.h, [ AC_DEFINE(HAVE_SYS_EXTATTR_H,1,[Defines if your system have the sys/extattr.h header file])] , )
2452 AC_CHECK_HEADER(libutil.h, [ AC_DEFINE(HAVE_LIBUTIL_H,1,[Defines if your system have the libutil.h header file])] , )
2453 AC_CHECK_FUNCS(extattr_get_link extattr_set_link extattr_list_link,
2456 AC_DEFINE([HAVE_EXTATTR_GET_LINK],1,[Define to 1 if you have the 'extattr_get_link' function.])
2457 AC_DEFINE([HAVE_EXTATTR_SET_LINK],1,[Define to 1 if you have the 'extattr_set_link' function.])
2458 AC_DEFINE([HAVE_EXTATTR_LIST_LINK],1,[Define to 1 if you have the 'extattr_list_link' function.])
2462 if test $have_xattr = no; then
2463 AC_CHECK_FUNCS(extattr_get_file extattr_set_file extattr_list_file,
2466 AC_DEFINE([HAVE_EXTATTR_GET_FILE],1,[Define to 1 if you have the 'extattr_get_file' function.])
2467 AC_DEFINE([HAVE_EXTATTR_SET_FILE],1,[Define to 1 if you have the 'extattr_set_file' function.])
2468 AC_DEFINE([HAVE_EXTATTR_LIST_FILE],1,[Define to 1 if you have the 'extattr_list_file' function.])
2473 if test $have_xattr = yes; then
2474 have_extattr_string_in_libc=no
2475 AC_CHECK_FUNCS(extattr_namespace_to_string extattr_string_to_namespace,
2477 have_extattr_string_in_libc=yes
2478 AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2479 AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2484 dnl If extattr_namespace_to_string and extattr_string_to_namespace are not in libc see if they are in libutil
2486 if test $have_extattr_string_in_libc = no; then
2487 AC_CHECK_LIB(util, extattr_namespace_to_string extattr_string_to_namespace,
2489 AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2490 AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2491 FDLIBS="-lutil $FDLIBS"
2498 dnl If we failed to find *BSD support try the Linux or OSX implementation of xattr
2500 if test $have_xattr = no; then
2501 AC_CHECK_HEADER(sys/xattr.h, [ AC_DEFINE(HAVE_SYS_XATTR_H,1,[Defines if your system have the sys/xattr.h header file])] , )
2502 AC_CHECK_FUNCS(llistxattr lgetxattr lsetxattr,
2505 AC_DEFINE([HAVE_LLISTXATTR],1,[Define to 1 if you have the 'llistxattr' function.])
2506 AC_DEFINE([HAVE_LGETXATTR],1,[Define to 1 if you have the 'lgetxattr' function.])
2507 AC_DEFINE([HAVE_LSETXATTR],1,[Define to 1 if you have the 'lsetxattr' function.])
2511 if test $have_xattr = no; then
2512 AC_CHECK_FUNCS(listxattr getxattr setxattr,
2515 AC_DEFINE([HAVE_LISTXATTR],1,[Define to 1 if you have the 'listxattr' function.])
2516 AC_DEFINE([HAVE_GETXATTR],1,[Define to 1 if you have the 'getxattr' function.])
2517 AC_DEFINE([HAVE_SETXATTR],1,[Define to 1 if you have the 'setxattr' function.])
2524 dnl If we failed to find *BSD support and the Linux or OSX implementation of xattr try the Solaris xattr implementation
2526 if test $have_xattr = no; then
2527 AC_CHECK_HEADER(sys/attr.h, [ AC_DEFINE(HAVE_SYS_ATTR_H,1,[Defines if your system have the sys/attr.h header file])] , )
2528 AC_CHECK_HEADER(sys/nvpair.h, [ AC_DEFINE(HAVE_SYS_NVPAIR_H,1,[Defines if your system have the sys/nvpair.h header file])] , )
2529 AC_CHECK_HEADER(attr.h, [ AC_DEFINE(HAVE_ATTR_H,1,[Defines if your system have the attr.h header file])] , )
2531 AC_CHECK_FUNCS(openat fstatat unlinkat fchownat futimesat,
2534 AC_DEFINE([HAVE_OPENAT],1,[Define to 1 if you have the 'openat' function.])
2535 AC_DEFINE([HAVE_FSTATAT],1,[Define to 1 if you have the 'fstatat' function.])
2536 AC_DEFINE([HAVE_UNLINKAT],1,[Define to 1 if you have the 'unlinkat' function.])
2537 AC_DEFINE([HAVE_FCHOWNAT],1,[Define to 1 if you have the 'fchownat' function.])
2538 AC_DEFINE([HAVE_FUTIMESAT],1,[Define to 1 if you have the 'futimesat' function.])
2542 if test $have_xattr = yes; then
2543 AC_CHECK_LIB(nvpair, nvlist_next_nvpair,
2545 AC_DEFINE([HAVE_NVLIST_NEXT_NVPAIR],1,[Define to 1 if you have the 'nvlist_next_nvpair' function.])
2546 FDLIBS="-lnvpair $FDLIBS"
2552 if test x$support_xattr = xyes -a $have_xattr != yes; then
2553 AC_MSG_ERROR([xattr support explicitly enabled but no supported xattr implementation found,
2554 please either load the xattr libraries or rerun configure without --enable-xattr])
2556 if test $have_xattr = yes; then
2557 AC_DEFINE([HAVE_XATTR],1,[Extended Attributes support])
2563 dnl Check for pthread libraries
2566 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
2568 AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
2570 AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
2572 AC_CHECK_FUNC(pthread_create)
2581 dnl Check for headers, functions and libraries required to support
2582 dnl keeping readall capabilities
2584 AC_CHECK_HEADERS(sys/prctl.h sys/capability.h)
2585 AC_CHECK_FUNCS(prctl setreuid)
2586 AC_CHECK_LIB([cap], [cap_set_proc], [CAP_LIBS="-lcap"], [CAP_LIBS=])
2587 if test x$CAP_LIBS = x-lcap; then
2588 AC_DEFINE(HAVE_LIBCAP, 1, [Define if you have libcap])
2597 if test x$have_gcc = xyes ; then
2598 CPPFLAGS="$CPPFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
2599 CFLAGS="$CFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
2601 LDFLAGS=${LDFLAGS--O}
2602 DB_LIBS="${SQL_LFLAGS}"
2603 CPPFLAGS="$CPPFLAGS"
2616 AC_SUBST(X_EXTRA_LIBS)
2621 dnl extra configurable objects
2632 dnl Finally we set appropriate distribution specific
2633 dnl variables and defaults
2635 dnl PFILES are platform specific files
2636 PFILES="platforms/Makefile"
2641 hostname=`uname -n | cut -d '.' -f 1`
2642 if test x${hostname} = x ; then
2643 hostname="localhost"
2645 dnl Make sure hostname is resolved
2646 ping -c 1 $hostname 2>/dev/null 1>/dev/null
2647 if test ! $? = 0; then
2648 hostname="localhost"
2654 PSCMD="ps -e -o pid,comm"
2656 platforms/aix/Makefile"
2657 TAPEDRIVE="/dev/rmt0.1"
2661 PTHREAD_LIB="-lpthread -lexc"
2662 if test "${CC}" = "gcc" ; then
2669 TAPEDRIVE="/dev/nrmt0"
2672 DISTVER=`uname -a |awk '{print $3}'`
2673 TAPEDRIVE="/dev/nrmt0"
2674 PTHREAD_LIB="-pthread"
2675 CFLAGS="${CFLAGS} -pthread"
2676 PSCMD="ps -ax -o pid,command"
2680 platforms/bsdi/Makefile \
2681 platforms/bsdi/bacula-fd \
2682 platforms/bsdi/bacula-sd \
2683 platforms/bsdi/bacula-dir"
2684 largefile_support="yes"
2687 DISTVER=`uname -a |awk '{print $3}'`
2688 TAPEDRIVE="/dev/nrst0"
2691 WLDFLAGS="-mwindows"
2695 TAPEDRIVE="/dev/nst0"
2696 PSCMD="ps -e -o pid,command"
2699 platforms/darwin/Makefile"
2703 TAPEDRIVE="/dev/nst0"
2704 PSCMD="ps -e -o pid,command"
2707 platforms/osx/Makefile"
2710 if `test -f /etc/apt/sources.list && grep -q ubuntu /etc/apt/sources.list`; then
2713 DISTVER=`cat /etc/debian_version`
2714 if test -f /etc/lsb-release ; then
2716 if test "x$DISTRIB_ID" != "x" ; then
2717 DISTNAME=$DISTRIB_ID
2719 if test "x$DISTRIB_RELEASE" != "x" ; then
2720 DISTVER=$DISTRIB_RELEASE
2723 if test "$DISTNAME" = "Ubuntu" ; then
2726 TAPEDRIVE="/dev/nst0"
2727 PSCMD="ps -e -o pid,command"
2728 if test "$DISTNAME" = "ubuntu" ; then
2730 platforms/ubuntu/Makefile \
2731 platforms/ubuntu/bacula-fd \
2732 platforms/ubuntu/bacula-sd \
2733 platforms/ubuntu/bacula-dir"
2736 platforms/debian/Makefile \
2737 platforms/debian/bacula-fd \
2738 platforms/debian/bacula-sd \
2739 platforms/debian/bacula-dir"
2743 DISTVER=`uname -a |awk '{print $3}'`
2744 VER=`echo $DISTVER | cut -c 1`
2745 if test x$VER = x4 ; then
2746 PTHREAD_LIB="${PTHREAD_LIBS:--pthread}"
2747 CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS:--pthread}"
2751 TAPEDRIVE="/dev/nrsa0"
2752 PSCMD="ps -ax -o pid,command"
2754 platforms/freebsd/Makefile \
2755 platforms/freebsd/bacula-fd \
2756 platforms/freebsd/bacula-sd \
2757 platforms/freebsd/bacula-dir"
2758 largefile_support="yes"
2761 PSCMD="UNIX95=1; ps -e -o pid,comm"
2762 CFLAGS="${CFLAGS} -D_XOPEN_SOURCE_EXTENDED=1"
2764 TAPEDRIVE="/dev/rmt/0hnb"
2765 PTHREAD_LIB="-lpthread"
2766 AC_DEFINE([_INCLUDE_LONGLONG])
2770 TAPEDRIVE="/dev/rmt/0cbn"
2771 PSCMD="ps -e -o pid,comm"
2773 platforms/irix/Makefile \
2774 platforms/irix/bacula-fd \
2775 platforms/irix/bacula-sd \
2776 platforms/irix/bacula-dir"
2779 DISTVER=`uname -a |awk '{print $3}'`
2782 TAPEDRIVE="/dev/nrst0"
2783 PSCMD="ps -ax -o pid,command"
2784 PTHREAD_LIB="-pthread"
2785 CFLAGS="${CFLAGS} -pthread"
2788 DISTVER=`uname -a |awk '{print $3}'`
2791 TAPEDRIVE="/dev/nrst0"
2792 PSCMD="ps -ax -o pid,command"
2793 PTHREAD_LIB="-pthread"
2794 CFLAGS="${CFLAGS} -pthread"
2796 platforms/openbsd/Makefile \
2797 platforms/openbsd/bacula-fd \
2798 platforms/openbsd/bacula-sd \
2799 platforms/openbsd/bacula-dir"
2802 if test -f /etc/whitebox-release ; then
2803 f=/etc/whitebox-release
2805 f=/etc/redhat-release
2807 if test `cat $f | grep release |\
2808 cut -f 3 -d ' '`x = "Enterprise"x ; then
2809 DISTVER="Enterprise "`cat $f | grep release |\
2812 DISTVER=`cat /etc/redhat-release | grep release |\
2815 TAPEDRIVE="/dev/nst0"
2816 PSCMD="ps -e -o pid,command"
2818 platforms/redhat/Makefile \
2819 platforms/redhat/bacula-fd \
2820 platforms/redhat/bacula-sd \
2821 platforms/redhat/bacula-dir
2825 DISTVER=`cat /etc/mandrake-release | grep release |\
2827 TAPEDRIVE="/dev/nst0"
2828 PSCMD="ps -e -o pid,command"
2830 platforms/mandrake/Makefile \
2831 platforms/mandrake/bacula-fd \
2832 platforms/mandrake/bacula-sd \
2833 platforms/mandrake/bacula-dir \
2834 platforms/mandrake/bacula.spec \
2838 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
2839 TAPEDRIVE="/dev/nst0"
2840 PSCMD="ps -e -o pid,command"
2842 platforms/gentoo/Makefile \
2843 platforms/gentoo/bacula-init \
2844 platforms/gentoo/bacula-fd \
2845 platforms/gentoo/bacula-sd \
2846 platforms/gentoo/bacula-dir"
2849 DISTVER=`cat /etc/slackware-version`
2850 TAPEDRIVE="/dev/nst0"
2851 PSCMD="ps -e -o pid,command"
2853 platforms/slackware/Makefile \
2854 platforms/slackware/rc.bacula-fd \
2855 platforms/slackware/rc.bacula-sd \
2856 platforms/slackware/rc.bacula-dir\
2857 platforms/slackware/functions.bacula"
2861 TAPEDRIVE="/dev/rmt/0cbn"
2862 PSCMD="ps -e -o pid,comm"
2864 platforms/solaris/Makefile \
2865 platforms/solaris/bacula-fd \
2866 platforms/solaris/bacula-sd \
2867 platforms/solaris/bacula-dir"
2868 if test x$DISTVER = x5.6 ; then
2869 AC_DEFINE(HAVE_OLD_SOCKOPT)
2871 LIBS="$LIBS -lresolv"
2874 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
2876 TAPEDRIVE="/dev/nst0"
2877 PSCMD="ps -e -o pid,command"
2879 platforms/suse/Makefile \
2880 platforms/suse/bacula-fd \
2881 platforms/suse/bacula-sd \
2882 platforms/suse/bacula-dir \
2883 platforms/suse/bacula \
2884 platforms/suse/bacula.spec"
2889 TAPEDRIVE="/dev/nst0"
2890 PSCMD="ps -e -o pid,command"
2892 platforms/suse/Makefile \
2893 platforms/suse/bacula-fd \
2894 platforms/suse/bacula-sd \
2895 platforms/suse/bacula-dir"
2899 TAPEDRIVE="/dev/nst0"
2902 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
2908 LIBS="$PTHREAD_LIB $LIBS"
2910 AC_DEFINE_UNQUOTED(lld, "$lld")
2911 AC_DEFINE_UNQUOTED(llu, "$llu")
2919 dnl common parts of the Makefile
2920 MCOMMON=./autoconf/Make.common
2921 AC_SUBST_FILE(MCOMMON)
2924 if test "x${subsysdir}" = "x${sbindir}" ; then
2927 echo "You have set both --sbindir and --with-subsys-dir"
2928 echo " equal to: ${subsysdir} "
2929 echo "This is not permitted. Please reconfigure."
2931 echo "Aborting configuration ..."
2937 AC_OUTPUT([autoconf/Make.common \
2940 scripts/startmysql \
2942 scripts/btraceback \
2948 scripts/bacula-ctl-dir \
2949 scripts/bacula-ctl-fd \
2950 scripts/bacula-ctl-sd \
2951 scripts/devel_bacula \
2954 scripts/bacula.desktop.gnome1 \
2955 scripts/bacula.desktop.gnome2 \
2956 scripts/bacula.desktop.gnome1.consolehelper \
2957 scripts/bacula.desktop.gnome2.consolehelper \
2958 scripts/bacula.desktop.gnome1.xsu \
2959 scripts/bacula.desktop.gnome2.xsu \
2960 scripts/bgnome-console.console_apps \
2961 scripts/mtx-changer \
2962 scripts/disk-changer \
2963 scripts/dvd-handler \
2964 scripts/dvd-simulator \
2965 scripts/bacula-tray-monitor.desktop \
2966 scripts/logwatch/Makefile \
2967 scripts/logwatch/logfile.bacula.conf \
2968 scripts/wxconsole.console_apps \
2969 scripts/wxconsole.desktop.consolehelper \
2970 scripts/wxconsole.desktop.xsu \
2971 scripts/bat.desktop \
2972 scripts/bat.desktop.xsu \
2973 scripts/bat.desktop.consolehelper \
2974 scripts/bat.console_apps \
2977 src/console/Makefile \
2978 src/console/bconsole.conf \
2979 src/qt-console/bat.conf \
2980 src/qt-console/bat.pro \
2981 src/qt-console/bat.pro.mingw32 \
2982 src/qt-console/install_conf_file \
2983 src/wx-console/Makefile \
2984 src/wx-console/bwx-console.conf \
2985 src/tray-monitor/Makefile \
2986 src/tray-monitor/tray-monitor.conf \
2988 src/dird/bacula-dir.conf \
2990 src/stored/Makefile \
2991 src/stored/bacula-sd.conf \
2992 src/filed/Makefile \
2993 src/filed/bacula-fd.conf \
2995 src/cats/make_catalog_backup \
2996 src/cats/delete_catalog_backup \
2997 src/cats/create_postgresql_database \
2998 src/cats/update_postgresql_tables \
2999 src/cats/make_postgresql_tables \
3000 src/cats/grant_postgresql_privileges \
3001 src/cats/drop_postgresql_tables \
3002 src/cats/drop_postgresql_database \
3003 src/cats/create_mysql_database \
3004 src/cats/update_mysql_tables \
3005 src/cats/make_mysql_tables \
3006 src/cats/grant_mysql_privileges \
3007 src/cats/drop_mysql_tables \
3008 src/cats/drop_mysql_database \
3009 src/cats/create_sqlite3_database \
3010 src/cats/update_sqlite3_tables \
3011 src/cats/make_sqlite3_tables \
3012 src/cats/grant_sqlite3_privileges \
3013 src/cats/drop_sqlite3_tables \
3014 src/cats/drop_sqlite3_database \
3017 src/cats/create_bdb_database \
3018 src/cats/update_bdb_tables \
3019 src/cats/make_bdb_tables \
3020 src/cats/grant_bdb_privileges \
3021 src/cats/drop_bdb_tables \
3022 src/cats/drop_bdb_database \
3023 src/cats/create_bacula_database \
3024 src/cats/update_bacula_tables \
3025 src/cats/grant_bacula_privileges \
3026 src/cats/make_bacula_tables \
3027 src/cats/drop_bacula_tables \
3028 src/cats/drop_bacula_database \
3029 src/findlib/Makefile \
3030 src/tools/Makefile \
3031 src/plugins/fd/Makefile \
3032 src/plugins/sd/Makefile \
3033 src/plugins/dir/Makefile \
3034 src/win32/Makefile.inc \
3036 updatedb/update_mysql_tables_9_to_10 \
3037 updatedb/update_sqlite3_tables_9_to_10 \
3038 updatedb/update_postgresql_tables_9_to_10 \
3039 updatedb/update_mysql_tables_10_to_11 \
3040 updatedb/update_sqlite3_tables_10_to_11 \
3041 updatedb/update_postgresql_tables_10_to_11 \
3042 examples/nagios/check_bacula/Makefile \
3047 if test "${support_bat}" = "yes" ; then
3048 if test "x$QMAKE" = "xnone" && test "x$QMAKEQT4" = "xnone"; then
3049 AC_MSG_ERROR([Could not find qmake or qmake-qt4 in $PATH. Check your Qt installation])
3054 if test "x$QMAKEQT4" != "xnone"; then
3059 echo "Creating bat Makefile"
3068 dnl if CC is gcc, we can rebuild the dependencies (since the depend rule
3069 dnl requires gcc). If it's not, don't rebuild dependencies
3071 if test X"$GCC" = "Xyes" ; then
3072 echo "Doing make of dependencies"
3073 ${MAKE:-make} depend
3077 chmod 755 install_conf_file build-depkgs-qt-console
3081 chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
3082 chmod 755 dvd-handler dvd-simulator breload make_catalog_backup.pl
3083 chmod 755 bconsole gconsole mtx-changer devel_bacula logrotate
3087 chmod 755 $c/update_mysql_tables_10_to_11 $c/update_sqlite3_tables_10_to_11
3088 chmod 755 $c/update_postgresql_tables_10_to_11
3092 chmod 755 $c/create_bacula_database $c/update_bacula_tables $c/make_bacula_tables
3093 chmod 755 $c/grant_bacula_privileges $c/drop_bacula_tables $c/drop_bacula_database
3095 chmod 755 $c/create_bdb_database $c/update_bdb_tables $c/make_bdb_tables
3096 chmod 755 $c/grant_bdb_privileges $c/drop_bdb_tables $c/drop_bdb_database
3098 chmod 755 $c/create_mysql_database $c/update_mysql_tables $c/make_mysql_tables
3099 chmod 755 $c/grant_mysql_privileges $c/drop_mysql_tables $c/drop_mysql_database
3101 chmod 755 $c/create_sqlite3_database $c/update_sqlite3_tables $c/make_sqlite3_tables
3102 chmod 755 $c/grant_sqlite3_privileges $c/drop_sqlite3_tables $c/drop_sqlite3_database
3104 chmod 755 $c/create_postgresql_database $c/update_postgresql_tables $c/make_postgresql_tables
3105 chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables $c/drop_postgresql_database
3107 chmod 755 $c/make_catalog_backup $c/delete_catalog_backup
3111 chmod 755 src/win32/build-depkgs-mingw32
3113 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
3114 largefile_support="yes"
3117 dnl Only try to find out the version number of the compiler when we know its some kind of GCC compiler
3118 if test X"$GCC" = "Xyes" ; then
3120 dnl A whole lot of hand springs to get the compiler version.
3121 dnl This is because gcc changed the output in version 3.0
3123 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3124 if test "x${CCVERSION}" = "x" ; then
3125 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3127 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3128 if test x"${CXXVERSION}" = x ; then
3129 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3133 # clean up any old junk
3139 if test "x${db_type}" = "xInternal" ; then
3142 echo "You have not specified either --enable-client-only or one of the"
3143 echo " supported databases: MySQL, PostgreSQL, SQLite3, SQLite or DBI."
3144 echo " This is not permitted. Please reconfigure."
3146 echo "Aborting the configuration ..."
3153 Configuration on `date`:
3155 Host: ${host}${post_host} -- ${DISTNAME} ${DISTVER}
3156 Bacula version: ${BACULA} ${VERSION} (${DATE})
3157 Source code location: ${srcdir}
3158 Install binaries: ${sbindir}
3159 Install libraries: ${libdir}
3160 Install config files: ${sysconfdir}
3161 Scripts directory: ${scriptdir}
3162 Archive directory: ${archivedir}
3163 Working directory: ${working_dir}
3164 PID directory: ${piddir}
3165 Subsys directory: ${subsysdir}
3166 Man directory: ${mandir}
3167 Data directory: ${datarootdir}
3168 Plugin directory: ${plugindir}
3169 C Compiler: ${CC} ${CCVERSION}
3170 C++ Compiler: ${CXX} ${CXXVERSION}
3171 Compiler flags: ${WCFLAGS} ${CFLAGS}
3172 Linker flags: ${WLDFLAGS} ${LDFLAGS}
3174 Statically Linked Tools: ${support_static_tools}
3175 Statically Linked FD: ${support_static_fd}
3176 Statically Linked SD: ${support_static_sd}
3177 Statically Linked DIR: ${support_static_dir}
3178 Statically Linked CONS: ${support_static_cons}
3179 Database type: ${db_type}
3180 Database port: ${db_port}
3181 Database lib: ${DB_LIBS}
3182 Database name: ${db_name}
3183 Database user: ${db_user}
3185 Job Output Email: ${job_email}
3186 Traceback Email: ${dump_email}
3187 SMTP Host Address: ${smtp_host}
3189 Director Port: ${dir_port}
3190 File daemon Port: ${fd_port}
3191 Storage daemon Port: ${sd_port}
3193 Director User: ${dir_user}
3194 Director Group: ${dir_group}
3195 Storage Daemon User: ${sd_user}
3196 Storage DaemonGroup: ${sd_group}
3197 File Daemon User: ${fd_user}
3198 File Daemon Group: ${fd_group}
3200 SQL binaries Directory ${SQL_BINDIR}
3202 Large file support: $largefile_support
3203 Bacula conio support: ${got_conio} ${CONS_LIBS}
3204 readline support: ${got_readline} ${PRTREADLINE_SRC}
3205 TCP Wrappers support: ${TCPW_MSG} ${WRAPLIBS}
3206 TLS support: ${support_tls}
3207 Encryption support: ${support_crypto}
3208 ZLIB support: ${have_zlib}
3209 enable-smartalloc: ${support_smartalloc}
3210 enable-lockmgr: ${support_lockmgr}
3211 bat support: ${support_bat} ${QWT_LDFLAGS}
3212 enable-gnome: ${support_gnome} ${gnome_version}
3213 enable-bwx-console: ${support_wx_console} ${wx_version}
3214 enable-tray-monitor: ${support_tray_monitor}
3215 client-only: ${build_client_only}
3216 build-dird: ${build_dird}
3217 build-stored: ${build_stored}
3218 Plugin support: ${have_plugins}
3219 ACL support: ${have_acl}
3220 XATTR support: ${have_xattr}
3221 Python support: ${support_python} ${PYTHON_LIBS}
3222 Batch insert enabled: ${support_batch_insert}
3226 # create a small shell script useful for support with
3227 # configure options and config.out info
3228 cat > scripts/bacula_config << EOF
3231 $ $0 $ac_configure_args
3233 cat config.out >> scripts/bacula_config
3234 echo __EOC__ >> scripts/bacula_config
3235 chmod 755 scripts/bacula_config
3239 # Display a warning message if postgresql client lib is <= 8.1
3240 if test x$DB_TYPE = xpostgresql -a x$ac_cv_lib_pq_PQisthreadsafe != xyes \
3241 -a x$support_batch_insert = xyes
3243 echo "WARNING: Your PostgreSQL client library is too old to detect "
3244 echo " if it was compiled with --enable-thread-safety, consider to"
3245 echo " upgrade it in order to avoid problems with Batch insert mode"