3 dnl# Process this file with autoconf to produce a configure script.
11 AC_CONFIG_AUX_DIR(${BUILD_DIR}/autoconf)
12 AC_CONFIG_HEADER(src/config.h:autoconf/config.h.in)
14 dnl require a recent autoconf
18 dnl search for true and false programs.
19 AC_PATH_PROGS(TRUEPRG, true, :)
20 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.
48 dnl -------------------------------------------------------
49 dnl# Check for programs.
50 dnl ------------------------------------------------------
53 AC_PATH_PROG(MV, mv, mv)
54 AC_PATH_PROG(RM, rm, rm)
55 AC_PATH_PROG(CP, cp, cp)
56 AC_PATH_PROG(SED, sed, sed)
57 AC_PATH_PROG(AWK, awk, awk)
58 AC_PATH_PROG(ECHO, echo, echo)
59 AC_PATH_PROG(CMP, cmp, cmp)
60 AC_PATH_PROG(TBL, tbl, tbl)
61 AC_PATH_PROG(AR, ar, ar)
62 AC_PATH_PROG(RANLIB, ranlib, ranlib)
63 AC_PATH_PROG(OPENSSL, openssl, none)
64 AC_PATH_PROG(MTX, mtx, mtx)
65 AC_PATH_PROG(PKGCONFIG, pkg-config, pkg-config)
66 AC_PATH_PROG(WXCONFIG, wx-config, wx-config)
68 test -n "$ARFLAG" || ARFLAGS="cr"
75 AC_SUBST(LOCAL_CFLAGS)
76 AC_SUBST(LOCAL_LDFLAGS)
81 dnl --------------------------------------------------
82 dnl Bacula OP Sys determination (see aclocal.m4)
83 dnl --------------------------------------------------
86 # -----------------------------------------------------------
87 dnl Bacula OPSys Distribution determination (see aclocal.m4)
88 # ----------------------------------------------------------
89 BA_CHECK_OPSYS_DISTNAME
91 # -----------------------------------------------------------
92 dnl Check for gnome stuff for gnome-console
93 # ----------------------------------------------------------
94 AM_ACLOCAL_INCLUDE(gnome-macros)
96 # ------------------------------------------------------------------
97 # If the user has not set --prefix, we set our default to nothing.
98 # In this case, if the user has not set --sysconfdir, we set it
99 # to the package default of /etc/bacula. If either --prefix or
100 # --sysconfdir is set, we leave sysconfdir alone except to eval it.
101 # ------------------------------------------------------------------
102 if test x${prefix} = xNONE ; then
103 if test `eval echo ${sysconfdir}` = NONE/etc ; then
104 sysconfdir=/etc/bacula
108 sysconfdir=`eval echo ${sysconfdir}`
110 # -------------------------------------------------------------------------
111 # If the user has not set --exec-prefix, we default to ${prefix}
112 # -------------------------------------------------------------------------
113 if test x${exec_prefix} = xNONE ; then
114 exec_prefix=${prefix}
117 # ------------------------------------------------------------------
118 # If the user has not set --sbindir, we set our default as /sbin
119 # ------------------------------------------------------------------
120 if test x$sbindir = x'${exec_prefix}/sbin' ; then
121 sbindir=${exec_prefix}/sbin
123 sbindir=`eval echo ${sbindir}`
125 # ------------------------------------------------------------------
126 # All list of languages for which a translation exist. Each
127 # language is separated by a space.
128 # ------------------------------------------------------------------
131 AC_PATH_PROGS(MSGFMT, msgfmt, no)
132 if test "$MSGFMT" = "no"
134 echo 'msgfmt program not found, disabling NLS !'
136 USE_INCLUDED_LIBINTL=no
144 support_postgresql=no
145 support_smartalloc=yes
149 support_wx_console=no
151 support_static_tools=no
154 support_static_dir=no
155 support_static_cons=no
161 dnl# --------------------------------------------------------------------------
162 dnl# CHECKING COMMAND LINE OPTIONS
163 dnl# --------------------------------------------------------------------------
165 # -------------------------------------------
166 # gnome (default off)
167 # -------------------------------------------
169 [ --enable-gnome enable build of gnome-console GUI [disabled]],
170 [if test x$enableval = xyes; then
175 if test x$support_gnome = xyes; then
176 abc=`$PKGCONFIG --exists libgnomeui-2.0`
178 if test $pkg = 0; then
179 GNOME_INCLUDEDIR=`$PKGCONFIG --cflags-only-I libgnomeui-2.0`
180 GNOMEUI_LIBS=`$PKGCONFIG --libs-only-l libgnomeui-2.0`
181 GNOME_LIBDIR=`$PKGCONFIG --libs libgnomeui-2.0`
182 GNOME_LIBS=`$PKGCONFIG --libs-only-l libgnomeui-2.0`
183 AC_SUBST(GNOME_INCLUDEDIR)
184 AC_SUBST(GNOMEUI_LIBS)
185 AC_SUBST(GNOME_LIBDIR)
187 GNOME_DIR=src/gnome2-console
188 gnome_version="Version 2.x"
192 GNOME_DIR=src/gnome-console
193 gnome_version="Version 1.4"
199 # -------------------------------------------
200 # wx-console (default off)
201 # -------------------------------------------
202 AC_ARG_ENABLE(wx-console,
203 [ --enable-wx-console enable build of wxWidgets console [disabled]],
204 [if test x$enableval = xyes; then
205 support_wx_console=yes
209 if test x$support_wx_console = xyes; then
210 abc=`$WXCONFIG --cppflags`
212 if test $pkg = 0; then
213 WXCONS_CPPFLAGS=`$WXCONFIG --cppflags`
214 WXCONS_LDFLAGS=`$WXCONFIG --libs`
215 AC_SUBST(WXCONS_CPPFLAGS)
216 AC_SUBST(WXCONS_LDFLAGS)
217 WX_DIR=src/wx-console
220 echo "wx-config program not found. wx-console disabled."
222 support_wx_console=no
229 # -------------------------------------------
230 # smartalloc (default off)
231 # -------------------------------------------
232 AC_ARG_ENABLE(smartalloc,
233 [ --enable-smartalloc enable smartalloc debugging support [disabled]],
234 [if test x$enableval = xno; then
235 support_smartalloc=no
238 if test x$support_smartalloc = xyes; then
239 AC_DEFINE(SMARTALLOC)
242 # -------------------------------------------
243 # static-tools (default off)
244 # -------------------------------------------
245 AC_ARG_ENABLE(static-tools,
246 [ --enable-static-tools enable static tape tools [disabled]],
247 [if test x$enableval = xyes; then
248 support_static_tools=yes
252 if test x$support_static_tools = xyes; then
253 TTOOL_LDFLAGS="-static"
255 AC_SUBST(TTOOL_LDFLAGS)
257 # -------------------------------------------
258 # static-fd (default off)
259 # -------------------------------------------
260 AC_ARG_ENABLE(static-fd,
261 [ --enable-static-fd enable static File daemon [disabled]],
262 [if test x$enableval = xyes; then
263 support_static_fd=yes
267 if test x$support_static_fd = xyes; then
268 STATIC_FD="static-bacula-fd"
272 # -------------------------------------------
273 # static-sd (default off)
274 # -------------------------------------------
275 AC_ARG_ENABLE(static-sd,
276 [ --enable-static-sd enable static Storage daemon [disabled]],
277 [if test x$enableval = xyes; then
278 support_static_sd=yes
282 if test x$support_static_sd = xyes; then
283 STATIC_SD="static-bacula-sd"
287 # -------------------------------------------
288 # static-dir (default off)
289 # -------------------------------------------
290 AC_ARG_ENABLE(static-dir,
291 [ --enable-static-dir enable static Director [disabled]],
292 [if test x$enableval = xyes; then
293 support_static_dir=yes
297 if test x$support_static_dir = xyes; then
298 STATIC_DIR="static-bacula-dir"
302 # -------------------------------------------
303 # static-cons (default off)
304 # -------------------------------------------
305 AC_ARG_ENABLE(static-cons,
306 [ --enable-static-cons enable static Console [disabled]],
307 [if test x$enableval = xyes; then
308 support_static_cons=yes
314 if test x$support_static_cons = xyes; then
315 STATIC_CONS="static-bconsole"
316 STATIC_GNOME_CONS="static-gnome-console"
317 STATIC_WX_CONS="static-wx-console"
319 AC_SUBST(STATIC_CONS)
320 AC_SUBST(STATIC_GNOME_CONS)
321 AC_SUBST(STATIC_WX_CONS)
323 # -------------------------------------------
324 # client_only (default off)
325 # -------------------------------------------
326 AC_ARG_ENABLE(client-only,
327 [ --enable-client-only build client (File daemon) only [disabled]],
328 [if test x$enableval = xyes; then
329 build_client_only=yes
331 if test x$build_client_only = xno; then
338 # ---------------------------------------------------
339 # Check for conio (Bacula readline substitute)(
340 # ---------------------------------------------------
341 # this allows you to turn it completely off
343 [ --disable-conio disable conio support [enabled]
345 [if test x$enableval = xno; then
350 if test x$support_conio = xyes; then
351 AC_CHECK_HEADER(termcap.h,
352 [ AC_CHECK_LIB(termcap, tgetent,
353 [ CONS_LIBS="-ltermcap"
358 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
360 [ AC_CHECK_LIB(ncurses, tgetent,
361 [ CONS_LIBS="-lncurses"
366 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
368 [ echo " "; echo "Neither termcap nor ncurses library found. CONIO turned off ..."; echo " "])
370 ],[echo " "; echo "termcap.h not found. CONIO turned off ..."; echo " "])
374 # ---------------------------------------------------
375 # Check for readline support/directory (default off)
376 # ---------------------------------------------------
377 # this allows you to turn it completely off
378 AC_ARG_ENABLE(readline,
379 [ --disable-readline disable readline support [disable]
381 [if test x$enableval = xno; then
387 if test x$support_readline = xyes; then
388 AC_ARG_WITH(readline,
389 [ --with-readline=DIR specify readline library directory],
391 case "$with_readline" in
394 if test "$with_readline" != "yes"; then
395 CONS_INC="-I${with_readline}"
396 CONS_LDFLAGS="-L$with_readline"
398 with_readline="/usr/include/readline"
400 AC_CHECK_HEADER(${with_readline}/readline.h,
401 [ AC_DEFINE(HAVE_READLINE)
402 CONS_LIBS="-lreadline -ltermcap"
406 echo "readline.h not found. readline turned off ..."
413 # check for standard readline library
414 AC_CHECK_HEADER(/usr/include/readline/readline.h,
415 [ AC_DEFINE(HAVE_READLINE)
417 CONS_INC="-I/usr/include/readline"
418 CONS_LIBS="-lreadline -ltermcap"
420 # Did not find standard library, so try Bacula's default
421 AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h,
422 [ AC_DEFINE(HAVE_READLINE)
424 CONS_INC="-I${TOP_DIR}/depkgs/readline"
425 CONS_LIBS="-lreadline -lhistory -ltermcap"
426 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
427 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
430 echo "readline.h not found. readline turned off ..."
446 AC_SUBST(CONS_LDFLAGS)
447 AC_SUBST(READLINE_SRC)
449 # Minimal stuff for readline Makefile configuration
456 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr setlocale lstat lchown)
457 AC_CHECK_FUNCS(nanosleep)
459 AC_CHECK_HEADERS(varargs.h)
461 # End of readline/conio stuff
462 # -----------------------------------------------------------------------
465 # ---------------------------------------------------
466 # Check for GMP support/directory
467 # ---------------------------------------------------
471 # [ --with-gmp[=DIR] Specify gmp library directory],
473 # case "$with_gmp" in
476 # if test "$with_gmp" != "yes"; then
477 # GMP_INC="-I$with_gmp"
479 # GMP_LDFLAGS="-L$with_gmp"
481 # with_gmp="/usr/include"
483 # AC_CHECK_HEADER($with_gmp/gmp.h,
484 # [ AC_MSG_RESULT(yes)
485 # AC_DEFINE(HAVE_GMP)
489 # [ AC_MSG_ERROR([*** gmp library missing])
495 # # check for standard gmp library
496 # AC_CHECK_HEADER(/usr/include/gmp.h,
497 # [ AC_MSG_RESULT(yes)
498 # AC_DEFINE(HAVE_GMP)
503 # # Did not find standard library, so use our own
505 # AC_DEFINE(HAVE_GMP)
508 # GMP_INC="-I${TOP_DIR}/depkgs/gmp"
510 # GMP_LDFLAGS="-L${TOP_DIR}/depkgs/gmp"
511 # GMP_SRC="${TOP_DIR}/depkgs/gmp"
517 #AC_SUBST(GMP_LDFLAGS)
521 # -----------------------------------------------------------------------
524 # ---------------------------------------------------
525 # Check for CWEB support/directory
526 # ---------------------------------------------------
531 # [ --with-cweb[=DIR] Specify cweb library directory],
533 # case "$with_cweb" in
536 # if test "$with_cweb" != "yes"; then
537 # CWEB_INC="-I$with_cweb"
539 # CWEB_LDFLAGS="-L$with_cweb"
541 # with_cweb="/usr/include"
543 # AC_CHECK_HEADER($with_cweb/cweb.h,
544 # [ AC_MSG_RESULT(yes)
545 # AC_DEFINE(HAVE_CWEB)
549 # [ AC_MSG_ERROR([*** cweb library missing])
555 # # check for standard cweb library
556 # AC_CHECK_HEADER(/usr/include/cweb.h,
557 # [ AC_MSG_RESULT(yes)
558 # AC_DEFINE(HAVE_CWEB)
563 # # Did not find starndard library, so use our own
565 # AC_DEFINE(HAVE_CWEB)
568 # CWEB=${TOP_DIR}/depkgs/cweb
569 # CWEB_INC="-I${TOP_DIR}/depkgs/cweb"
571 # CWEB_LDFLAGS="-L${TOP_DIR}/depkgs/cweb"
572 # CWEB_SRC="${TOP_DIR}/depkgs/cweb"
579 #AC_SUBST(CWEB_LDFLAGS)
583 # -----------------------------------------------------------------------
587 # -----------------------------------------------------------
588 # Check whether user wants TCP wrappers support (default off)
589 # -----------------------------------------------------------
591 AC_ARG_WITH(tcp-wrappers,
592 [ --with-tcp-wrappers=DIR enable tcpwrappers support],
594 if test "x$withval" != "xno" ; then
596 LIBS="$saved_LIBS -lwrap"
597 AC_MSG_CHECKING(for libwrap)
600 int deny_severity = 0;
601 int allow_severity = 0;
602 struct request_info *req; ],
603 [ hosts_access(req); ],
606 AC_DEFINE(HAVE_LIBWRAP)
609 LIBS="$saved_LIBS -lwrap -lnsl"
612 int deny_severity = 0;
613 int allow_severity = 0;
614 struct request_info *req; ],
615 [ hosts_access(req); ],
618 AC_DEFINE(HAVE_LIBWRAP)
621 [AC_MSG_ERROR([*** libwrap missing]) ] ]
628 # ------------------------------------------
629 # Where to place working dir
630 # ------------------------------------------
631 working_dir=`eval echo ${prefix}/var/bacula/working`
632 AC_ARG_WITH(working-dir,
633 [ --with-working-dir=PATH specify path of Bacula working directory],
635 if test "x$withval" != "xno" ; then
641 AC_SUBST(working_dir)
644 # ------------------------------------------
645 # Where to place scriptdir (script files)
646 # ------------------------------------------
647 scriptdir=`eval echo ${sysconfdir}`
648 AC_ARG_WITH(scriptdir,
649 [ --with-scriptdir=PATH specify path of Bacula scripts directory],
651 if test "x$withval" != "xno" ; then
660 # ------------------------------------------
661 # Where to send dump email
662 # ------------------------------------------
663 dump_email=root@localhost
664 AC_ARG_WITH(dump-email,
665 [ --with-dump-email=EMAIL dump email address],
667 if test "x$withval" != "xno" ; then
675 # ------------------------------------------
676 # Where to send job email
677 # ------------------------------------------
678 job_email=root@localhost
679 AC_ARG_WITH(job-email,
680 [ --with-job-email=EMAIL job output email address],
682 if test "x$withval" != "xno" ; then
690 # ------------------------------------------
691 # Where to find smtp host
692 # ------------------------------------------
694 AC_ARG_WITH(smtp_host,
695 [ --with-smtp-host=HOST SMTP mail host address],
697 if test "x$withval" != "xno" ; then
706 # ------------------------------------
707 # Where to place pid files
708 # ------------------------------------
711 [ --with-pid-dir=PATH specify location of Bacula pid files],
713 if test "x$withval" != "xno" ; then
719 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
723 # ------------------------------------
724 # Where to place subsys "lock file"
725 # ------------------------------------
726 subsysdir=/var/run/subsys
727 AC_ARG_WITH(subsys-dir,
728 [ --with-subsys-dir=PATH specify location of Bacula subsys file],
730 if test "x$withval" != "xno" ; then
740 # ------------------------------------
741 # Where to start assigning ports
742 # ------------------------------------
744 AC_ARG_WITH(baseport,
745 [ --with-baseport=PORT specify base port address for daemons],
747 if test "x$withval" != "xno" ; then
754 dir_port=`expr $baseport`
755 fd_port=`expr $baseport + 1`
756 sd_port=`expr $fd_port + 1`
763 # ------------------------------------------
765 # ------------------------------------------
767 AC_ARG_WITH(dir-password,
768 [ --with-dir-password=PASSWORD specify Director's password],
770 if test "x$withval" != "xno" ; then
771 dir_password=$withval
776 if test "x$dir_password" = "x" ; then
777 if test "x$OPENSSL" = "xnone" ; then
778 # key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" abcdefghijklmnopqrst | awk '{getline} {print} {exit}'`
779 key=`autoconf/randpass 33`
781 key=`openssl rand -base64 33`
787 AC_ARG_WITH(fd-password,
788 [ --with-fd-password=PASSWORD specify Client's password],
790 if test "x$withval" != "xno" ; then
796 if test "x$fd_password" = "x" ; then
797 if test "x$OPENSSL" = "xnone" ; then
798 # key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" tsrqponmlkjihgfedcba | awk '{getline} {print} {exit}'`
799 key=`autoconf/randpass 37`
801 key=`openssl rand -base64 33`
807 AC_ARG_WITH(sd-password,
808 [ --with-sd-password=PASSWORD specify Storage daemon's password],
810 if test "x$withval" != "xno" ; then
816 if test "x$sd_password" = "x" ; then
817 if test "x$OPENSSL" = "xnone" ; then
818 # key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" 123456789uvwxyzabcdef | awk '{getline} {print} {exit}'`
819 key=`autoconf/randpass 41`
821 key=`openssl rand -base64 33`
827 AC_SUBST(dir_password)
828 AC_SUBST(fd_password)
829 AC_SUBST(sd_password)
833 # Handle users and groups for each daemon
836 AC_ARG_WITH(dir_user,
837 [ --with-dir-user=USER specify user for Director daemon],
839 if test "x$withval" != "x" ; then
846 AC_ARG_WITH(dir_group,
847 [ --with-dir-group=GROUP specify group for Director daemon],
849 if test "x$withval" != "x" ; then
857 [ --with-sd-user=USER specify user for Storage daemon],
859 if test "x$withval" != "x" ; then
866 AC_ARG_WITH(sd_group,
867 [ --with-sd-group=GROUP specify group for Storage daemon],
869 if test "x$withval" != "x" ; then
877 [ --with-fd-user=USER specify user for File daemon],
879 if test "x$withval" != "x" ; then
886 AC_ARG_WITH(fd_group,
887 [ --with-fd-group=GROUP specify group for File daemon],
889 if test "x$withval" != "x" ; then
905 # ------------------------------------------------
906 # Bacula check for various SQL database engines
907 # ------------------------------------------------
908 BA_CHECK_POSTGRESQL_DB
917 AC_DEFINE(PROTOTYPES)
919 dnl# --------------------------------------------------------------------------
920 dnl# Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
922 if test -z "$CFLAGS"; then
923 if test -z "$CCOPTS"; then
925 dnl> if test "x$GCC" = xyes; then
926 dnl> if test x$system = xLinux; then
927 dnl> CCOPTS="$CCOPTS "'-O2 -fno-strength-reduce'
938 dnl See if we can use 64 bit file addresses
939 largefile_support="no"
945 dnl# --------------------------------------------------------------------------
946 dnl# CHECKING FOR HEADER FILES
947 dnl# --------------------------------------------------------------------------
982 dnl# --------------------------------------------------------------------------
983 dnl# Check for utime.h structure
984 dnl# --------------------------------------------------------------------------
985 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
987 #include <sys/types.h>
988 #include <utime.h>], [struct utimbuf foo],
989 ba_cv_header_utime_h=yes, ba_cv_header_utime_h=no)])
990 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H)
992 dnl# --------------------------------------------------------------------------
993 dnl# Check for socklen_t
994 dnl# --------------------------------------------------------------------------
995 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
997 #include <sys/types.h>
998 #include <sys/socket.h>],
1000 ba_cv_header_socklen_t=yes, ba_cv_header_socklen_t=no)])
1001 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T)
1003 dnl# --------------------------------------------------------------------------
1004 dnl# Check for bigendian
1005 dnl# --------------------------------------------------------------------------
1006 AC_CACHE_CHECK([for bigendian], ba_cv_bigendian,
1008 [main(){long a=1L; char *p=(char *)&a; exit(*p);}],
1009 [ba_cv_bigendian=yes],
1010 [ba_cv_bigendian=no],
1011 [ba_cv_bigendian=no])])
1012 test $ba_cv_bigendian = yes && AC_DEFINE(HAVE_BIGENDIAN)
1018 dnl# --------------------------------------------------------------------------
1019 dnl# CHECKING FOR FILESYSTEM TYPE
1020 dnl# --------------------------------------------------------------------------
1021 AC_MSG_CHECKING(how to get filesystem type)
1023 # The order of these tests is important.
1024 AC_TRY_CPP([#include <sys/statvfs.h>
1025 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4)
1026 if test $fstype = no; then
1027 AC_TRY_CPP([#include <sys/statfs.h>
1028 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3)
1030 if test $fstype = no; then
1031 AC_TRY_CPP([#include <sys/statfs.h>
1032 #include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX)
1034 if test $fstype = no; then
1035 AC_TRY_CPP([#include <mntent.h>], AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD)
1037 if test $fstype = no; then
1038 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
1040 if test $fstype = no; then
1041 AC_TRY_CPP([#include <sys/mount.h>
1042 #include <sys/fs_types.h>], AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix)
1044 AC_MSG_RESULT($fstype)
1046 dnl# --------------------------------------------------------------------------
1047 dnl# CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
1048 dnl# --------------------------------------------------------------------------
1056 AC_CHECK_TYPE(ino_t, unsigned long)
1057 AC_CHECK_TYPE(dev_t, unsigned long)
1058 AC_CHECK_TYPE(daddr_t, long)
1059 AC_CHECK_TYPE(major_t, int)
1060 AC_CHECK_TYPE(minor_t, int)
1061 AC_CHECK_TYPE(ssize_t, int)
1068 AC_CHECK_SIZEOF(char, 1)
1069 AC_CHECK_SIZEOF(short int, 2)
1070 AC_CHECK_SIZEOF(int, 4)
1071 AC_CHECK_SIZEOF(long int, 4)
1072 AC_CHECK_SIZEOF(long long int, 8)
1073 AC_CHECK_SIZEOF(int *, 4)
1075 # Check for sys/types.h types
1076 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1078 [ #include <sys/types.h> ],
1080 [ ac_cv_have_u_int="yes" ],
1081 [ ac_cv_have_u_int="no" ]
1084 if test "x$ac_cv_have_u_int" = "xyes" ; then
1085 AC_DEFINE(HAVE_U_INT)
1089 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t, [
1091 [ #include <sys/types.h> ],
1092 [ intmax_t a; a = 1;],
1093 [ ac_cv_have_intmax_t="yes" ],
1096 [ #include <stdint.h> ],
1097 [ intmax_t a; a = 1;],
1098 [ ac_cv_have_intmax_t="yes" ],
1099 [ ac_cv_have_intmax_t="no" ]
1105 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
1106 AC_DEFINE(HAVE_INTMAX_T)
1111 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t, [
1113 [ #include <sys/types.h> ],
1114 [ u_intmax_t a; a = 1;],
1115 [ ac_cv_have_u_intmax_t="yes" ],
1118 [ #include <stdint.h> ],
1119 [ u_intmax_t a; a = 1;],
1120 [ ac_cv_have_u_intmax_t="yes" ],
1121 [ ac_cv_have_u_intmax_t="no" ]
1126 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
1127 AC_DEFINE(HAVE_U_INTMAX_T)
1132 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1134 [ #include <sys/types.h> ],
1135 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1136 [ ac_cv_have_intxx_t="yes" ],
1137 [ ac_cv_have_intxx_t="no" ]
1140 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1141 AC_DEFINE(HAVE_INTXX_T)
1145 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1147 [ #include <sys/types.h> ],
1148 [ int64_t a; a = 1;],
1149 [ ac_cv_have_int64_t="yes" ],
1150 [ ac_cv_have_int64_t="no" ]
1153 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1154 AC_DEFINE(HAVE_INT64_T)
1158 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1160 [ #include <sys/types.h> ],
1161 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1162 [ ac_cv_have_u_intxx_t="yes" ],
1163 [ ac_cv_have_u_intxx_t="no" ]
1166 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1167 AC_DEFINE(HAVE_U_INTXX_T)
1171 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1173 [ #include <sys/types.h> ],
1174 [ u_int64_t a; a = 1;],
1175 [ ac_cv_have_u_int64_t="yes" ],
1176 [ ac_cv_have_u_int64_t="no" ]
1179 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1180 AC_DEFINE(HAVE_U_INT64_T)
1184 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1185 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1187 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1189 [ #include <sys/bitypes.h> ],
1190 [ int8_t a; int16_t b; int32_t c;
1191 u_int8_t e; u_int16_t f; u_int32_t g;
1192 a = b = c = e = f = g = 1; ],
1193 [ AC_DEFINE(HAVE_U_INTXX_T)
1194 AC_DEFINE(HAVE_INTXX_T)
1195 AC_DEFINE(HAVE_SYS_BITYPES_H)
1196 AC_MSG_RESULT(yes) ],
1197 [ AC_MSG_RESULT(no)]
1201 if test -z "$have_u_intxx_t" ; then
1202 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1204 [ #include <sys/types.h> ],
1205 [ uint8_t a; uint16_t b;
1206 uint32_t c; a = b = c = 1; ],
1207 [ ac_cv_have_uintxx_t="yes" ],
1208 [ ac_cv_have_uintxx_t="no" ]
1211 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1212 AC_DEFINE(HAVE_UINTXX_T)
1217 dnl# --------------------------------------------------------------------------
1218 dnl# CHECKING FOR LIBRARY FUNCTIONS
1219 dnl# --------------------------------------------------------------------------
1235 [echo 'configure: cannot find needed function.'; exit 1]
1238 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
1239 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
1241 AC_CHECK_FUNCS(chflags)
1243 AC_CHECK_FUNCS(snprintf vsnprintf gethostid getdomainname)
1245 dnl# --------------------------------------------------------------------------
1246 dnl# CHECKING FOR THREAD SAFE FUNCTIONS
1247 dnl# --------------------------------------------------------------------------
1248 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
1250 # If resolver functions are not in libc check for -lnsl or -lresolv.
1251 AC_CHECK_FUNC(gethostbyname_r,
1252 AC_MSG_RESULT(using libc's resolver),
1253 AC_CHECK_LIB(nsl,gethostbyname_r)
1254 AC_CHECK_LIB(resolv,gethostbyname_r))
1257 # Find where sockets are (especially for Solaris)
1258 AC_CHECK_FUNC(socket,
1259 AC_MSG_RESULT(using libc's socket),
1260 AC_CHECK_LIB(xnet,socket)
1261 AC_CHECK_LIB(socket,socket)
1262 AC_CHECK_LIB(inet,socket))
1264 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
1270 AC_FUNC_CLOSEDIR_VOID
1271 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
1275 dnl# FreeBSD needs to link libxpg4
1276 AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"])
1279 AC_CHECK_LIB(sun, getpwnam)
1281 AC_CHECK_HEADERS(zlib.h)
1282 AC_CHECK_LIB(z, deflate, [FDLIBS="-lz"])
1284 if test x$FDLIBS = x-lz; then
1285 AC_DEFINE(HAVE_LIBZ)
1289 dnl Check for pthread libraries
1291 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
1292 [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
1293 [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
1294 [AC_CHECK_FUNC(pthread_create)]
1304 LDFLAGS=${LDFLAGS--O}
1305 DB_LIBS="${SQL_LFLAGS}"
1307 CPPFLAGS="$CPPFLAGS"
1318 AC_SUBST(X_EXTRA_LIBS)
1322 dnl# extra configurable objects
1333 # Finally we set appropriate distribution specific
1334 # variables and defaults
1336 # PFILES are platform specific files
1337 PFILES="platforms/Makefile"
1340 hostname=`uname -n | cut -d '.' -f 1`
1344 PSCMD="ps -e -o pid,comm"
1346 platforms/aix/Makefile"
1347 TAPEDRIVE="/dev/rmt0.1"
1351 PTHREAD_LIB="-lpthread -lexc"
1352 if test "${CC}" = "gcc" ; then
1359 TAPEDRIVE="/dev/nrmt0"
1362 DISTVER=`uname -a |awk '{print $3}'`
1363 TAPEDRIVE="/dev/nrmt0"
1364 PTHREAD_LIB="-pthread"
1365 CFLAGS="${CFLAGS} -pthread"
1366 PSCMD="ps -x -o pid,command"
1370 platforms/bsdi/Makefile \
1371 platforms/bsdi/bacula-fd \
1372 platforms/bsdi/bacula-sd \
1373 platforms/bsdi/bacula-dir"
1374 largefile_support="yes"
1377 DISTVER=`uname -a |awk '{print $3}'`
1378 TAPEDRIVE="/dev/nrst0"
1381 WLDFLAGS="-mwindows"
1385 TAPEDRIVE="/dev/nst0"
1386 PSCMD="ps -e -o pid,command"
1388 platforms/darwin/Makefile"
1391 DISTVER=`cat /etc/debian_version`
1392 TAPEDRIVE="/dev/nrst0"
1393 PSCMD="ps -e -o pid,command"
1396 DISTVER=`uname -a |awk '{print $3}'`
1397 VER=`echo $DISTVER | cut -c 1`
1398 if test x$VER = x4 ; then
1399 PTHREAD_LIB="-pthread"
1400 CFLAGS="${CFLAGS} -pthread"
1404 TAPEDRIVE="/dev/nrsa0"
1405 PSCMD="ps -x -o pid,command"
1407 platforms/freebsd/Makefile \
1408 platforms/freebsd/bacula-fd \
1409 platforms/freebsd/bacula-sd \
1410 platforms/freebsd/bacula-dir"
1411 largefile_support="yes"
1414 PSCMD="UNIX95=1 ps -e -o pid,comm"
1415 CFLAGS="$(CFLAGS) -D_XOPEN_SOURCE_EXTENDED=1"
1417 TAPEDRIVE="/dev/rmt/0hnb"
1421 TAPEDRIVE="/dev/rmt/0cbn"
1422 PSCMD="ps -e -o pid,comm"
1424 platforms/irix/Makefile \
1425 platforms/irix/bacula-fd \
1426 platforms/irix/bacula-sd \
1427 platforms/irix/bacula-dir"
1430 DISTVER=`uname -a |awk '{print $3}'`
1433 TAPEDRIVE="/dev/nrst0"
1434 PSCMD="ps -a -o pid,command"
1435 PTHREAD_LIB="-pthread"
1436 CFLAGS="${CFLAGS} -pthread"
1439 DISTVER=`uname -a |awk '{print $3}'`
1442 TAPEDRIVE="/dev/nrst0"
1443 PSCMD="ps -a -o pid,command"
1444 PTHREAD_LIB="-pthread"
1445 CFLAGS="${CFLAGS} -pthread"
1447 platforms/openbsd/Makefile \
1448 platforms/openbsd/bacula-fd \
1449 platforms/openbsd/bacula-sd \
1450 platforms/openbsd/bacula-dir"
1453 if test `cat /etc/redhat-release | grep release |\
1454 cut -f 3 -d ' '`x = "Enterprise"x ; then
1455 DISTVER="Enterprise "`cat /etc/redhat-release | grep release |\
1458 DISTVER=`cat /etc/redhat-release | grep release |\
1461 TAPEDRIVE="/dev/nst0"
1462 PSCMD="ps -e -o pid,command"
1464 platforms/redhat/Makefile \
1465 platforms/redhat/bacula-fd \
1466 platforms/redhat/bacula-sd \
1467 platforms/redhat/bacula-dir \
1468 platforms/redhat/bacula.spec \
1470 hostname=`hostname -s`
1473 DISTVER=`cat /etc/mandrake-release | grep release |\
1475 TAPEDRIVE="/dev/nst0"
1476 PSCMD="ps -e -o pid,command"
1478 platforms/mandrake/Makefile \
1479 platforms/mandrake/bacula-fd \
1480 platforms/mandrake/bacula-sd \
1481 platforms/mandrake/bacula-dir \
1482 platforms/mandrake/bacula.spec \
1486 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
1487 TAPEDRIVE="/dev/nst0"
1488 PSCMD="ps -e -o pid,command"
1490 platforms/gentoo/Makefile \
1491 platforms/gentoo/bacula-fd \
1492 platforms/gentoo/bacula-sd \
1493 platforms/gentoo/bacula-dir"
1496 DISTVER=`cat /etc/slackware-version`
1497 TAPEDRIVE="/dev/nst0"
1498 PSCMD="ps -e -o pid,command"
1500 platforms/slackware/Makefile \
1501 platforms/slackware/rc.bacula-fd \
1502 platforms/slackware/rc.bacula-sd \
1503 platforms/slackware/rc.bacula-dir\
1504 platforms/slackware/functions.bacula"
1508 TAPEDRIVE="/dev/rmt/0cbn"
1509 PSCMD="ps -e -o pid,comm"
1511 platforms/solaris/Makefile \
1512 platforms/solaris/bacula-fd \
1513 platforms/solaris/bacula-sd \
1514 platforms/solaris/bacula-dir"
1515 if test x$DISTVER = x5.6 ; then
1516 AC_DEFINE(HAVE_OLD_SOCKOPT)
1520 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
1522 TAPEDRIVE="/dev/nst0"
1523 PSCMD="ps -e -o pid,command"
1525 platforms/suse/Makefile \
1526 platforms/suse/bacula-fd \
1527 platforms/suse/bacula-sd \
1528 platforms/suse/bacula-dir \
1529 platforms/suse/bacula \
1530 platforms/suse/bacula.spec"
1535 TAPEDRIVE="/dev/nst0"
1536 PSCMD="ps -e -o pid,command"
1538 platforms/suse/Makefile \
1539 platforms/suse/bacula-fd \
1540 platforms/suse/bacula-sd \
1541 platforms/suse/bacula-dir"
1545 TAPEDRIVE="/dev/nst0"
1548 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
1554 LIBS="$PTHREAD_LIB $LIBS"
1556 AC_DEFINE_UNQUOTED(lld, "$lld")
1557 AC_DEFINE_UNQUOTED(llu, "$llu")
1564 dnl# common parts of the Makefile
1565 MCOMMON=./autoconf/Make.common
1566 AC_SUBST_FILE(MCOMMON)
1569 if test "x${subsysdir}" = "x${sbindir}" ; then
1572 echo "You have set both --sbindir and --with-subsys-dir"
1573 echo " equal to: ${subsysdir} "
1574 echo "This is not permitted. Please reconfigure."
1576 echo "Aborting configuration ..."
1582 AC_OUTPUT([autoconf/Make.common \
1585 rescue/linux/Makefile \
1586 rescue/freebsd/Makefile \
1587 rescue/solaris/Makefile \
1588 scripts/startmysql \
1590 scripts/btraceback \
1596 scripts/devel_bacula \
1600 scripts/bacula.desktop.gnome1 \
1601 scripts/bacula.desktop.gnome2 \
1602 scripts/bacula.desktop.gnome1.consolehelper \
1603 scripts/bacula.desktop.gnome2.consolehelper \
1604 scripts/bacula.desktop.gnome1.xsu \
1605 scripts/bacula.desktop.gnome2.xsu \
1606 scripts/gnome-console.console_apps \
1607 scripts/mtx-changer \
1611 src/console/Makefile \
1612 src/console/bconsole.conf \
1613 src/gnome-console/Makefile \
1614 src/gnome-console/gnome-console.conf \
1615 src/gnome2-console/Makefile \
1616 src/gnome2-console/gnome-console.conf \
1617 src/wx-console/Makefile \
1618 src/tconsole/Makefile \
1620 src/dird/bacula-dir.conf \
1622 src/stored/Makefile \
1623 src/stored/bacula-sd.conf \
1624 src/filed/Makefile \
1625 src/filed/bacula-fd.conf \
1626 src/filed/win32/Makefile \
1628 src/cats/make_catalog_backup \
1629 src/cats/delete_catalog_backup \
1630 src/cats/create_postgresql_database \
1631 src/cats/update_postgresql_tables \
1632 src/cats/make_postgresql_tables \
1633 src/cats/grant_postgresql_privileges \
1634 src/cats/drop_postgresql_tables \
1635 src/cats/drop_postgresql_database \
1636 src/cats/create_mysql_database \
1637 src/cats/update_mysql_tables \
1638 src/cats/make_mysql_tables \
1639 src/cats/grant_mysql_privileges \
1640 src/cats/drop_mysql_tables \
1641 src/cats/drop_mysql_database \
1642 src/cats/create_sqlite_database \
1643 src/cats/update_sqlite_tables \
1644 src/cats/make_sqlite_tables \
1645 src/cats/grant_sqlite_privileges \
1646 src/cats/drop_sqlite_tables \
1647 src/cats/drop_sqlite_database \
1650 src/cats/create_bdb_database \
1651 src/cats/update_bdb_tables \
1652 src/cats/make_bdb_tables \
1653 src/cats/grant_bdb_privileges \
1654 src/cats/drop_bdb_tables \
1655 src/cats/drop_bdb_database \
1656 src/cats/create_bacula_database \
1657 src/cats/update_bacula_tables \
1658 src/cats/grant_bacula_privileges \
1659 src/cats/make_bacula_tables \
1660 src/cats/drop_bacula_tables \
1661 src/cats/drop_bacula_database \
1662 src/findlib/Makefile \
1663 src/tools/Makefile \
1664 src/win32/winbacula.nsi \
1665 src/win32/bacula-fd.conf \
1666 src/win32/Makefile \
1668 [(echo "Doing make of dependencies"; make depend;) ]
1672 chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
1673 chmod 755 bconsole gconsole mtx-changer devel_bacula logrotate
1678 chmod 755 $c/create_bacula_database $c/update_bacula_tables $c/make_bacula_tables
1679 chmod 755 $c/grant_bacula_privileges $c/drop_bacula_tables $c/drop_bacula_database
1681 chmod 755 $c/create_bdb_database $c/update_bdb_tables $c/make_bdb_tables
1682 chmod 755 $c/grant_bdb_privileges $c/drop_bdb_tables $c/drop_bdb_database
1684 chmod 755 $c/create_mysql_database $c/update_mysql_tables $c/make_mysql_tables
1685 chmod 755 $c/grant_mysql_privileges $c/drop_mysql_tables $c/drop_mysql_database
1687 chmod 755 $c/create_sqlite_database $c/update_sqlite_tables $c/make_sqlite_tables
1688 chmod 755 $c/grant_sqlite_privileges $c/drop_sqlite_tables $c/drop_sqlite_database
1690 chmod 755 $c/create_postgresql_database $c/update_postgresql_tables $c/make_postgresql_tables
1691 chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables $c/drop_postgresql_database
1693 chmod 755 $c/make_catalog_backup $c/delete_catalog_backup
1697 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
1698 largefile_support="yes"
1702 # A whole lot of hand springs to get the compiler version.
1703 # This is because gcc changed the output in version 3.0
1705 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
1706 if test "x${CCVERSION}" = "x" ; then
1707 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
1709 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
1710 if test x"${CXXVERSION}" = x ; then
1711 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
1714 if test "x${subsysdir}" = "x${sbindir}" ; then
1717 echo "You have set --sbindir and --with-subsys-dir"
1718 echo " both equal to: ${subsysdir} "
1719 echo " This is not permitted. Please reconfigure."
1720 echo "Aborting configuration ..."
1727 Configuration on `date`:
1729 Host: $host -- ${DISTNAME} ${DISTVER}
1730 Bacula version: ${VERSION} (${DATE})
1731 Source code location: ${srcdir}
1732 Install binaries: ${sbindir}
1733 Install config files: ${sysconfdir}
1734 Scripts directory: ${scriptdir}
1735 Working directory: ${working_dir}
1736 PID directory: ${piddir}
1737 Subsys directory: ${subsysdir}
1738 C Compiler: ${CC} ${CCVERSION}
1739 C++ Compiler: ${CXX} ${CXXVERSION}
1740 Compiler flags: ${WCFLAGS} ${CFLAGS}
1741 Linker flags: ${WLDFLAGS} ${LDFLAGS}
1743 Statically Linked Tools: ${support_static_tools}
1744 Statically Linked FD: ${support_static_fd}
1745 Statically Linked SD: ${support_static_sd}
1746 Statically Linked DIR: ${support_static_dir}
1747 Statically Linked CONS: ${support_static_cons}
1748 Database type: ${db_name}
1749 Database lib: ${DB_LIBS}
1751 Job Output Email: ${job_email}
1752 Traceback Email: ${dump_email}
1753 SMTP Host Address: ${smtp_host}
1755 Director Port: ${dir_port}
1756 File daemon Port: ${fd_port}
1757 Storage daemon Port: ${sd_port}
1759 Director User: ${dir_user}
1760 Director Group: ${dir_group}
1761 Storage Daemon User: ${sd_user}
1762 Storage DaemonGroup: ${sd_group}
1763 File Daemon User: ${fd_user}
1764 File Daemon Group: ${fd_group}
1766 SQL binaries Directory ${SQL_BINDIR}
1768 Large file support: $largefile_support
1769 Bacula conio support: ${got_conio} ${CONS_LIBS}
1770 readline support: ${got_readline} ${PRTREADLINE_SRC}
1771 TCP Wrappers support: ${TCPW_MSG}
1772 ZLIB support: ${have_zlib}
1773 enable-smartalloc: ${support_smartalloc}
1774 enable-gnome: ${support_gnome} ${gnome_version}
1775 enable-wx-console: ${support_wx_console}
1776 client-only: ${build_client_only}
1783 # cweb support: ${got_cweb} ${CWEB_SRC}
1784 # gmp support: ${got_gmp} ${GMP_SRC}