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)
67 test -n "$ARFLAG" || ARFLAGS="cr"
74 AC_SUBST(LOCAL_CFLAGS)
75 AC_SUBST(LOCAL_LDFLAGS)
80 dnl --------------------------------------------------
81 dnl Bacula OP Sys determination (see aclocal.m4)
82 dnl --------------------------------------------------
85 # -----------------------------------------------------------
86 dnl Bacula OPSys Distribution determination (see aclocal.m4)
87 # ----------------------------------------------------------
88 BA_CHECK_OPSYS_DISTNAME
90 # -----------------------------------------------------------
91 dnl Check for gnome stuff for gnome-console
92 # ----------------------------------------------------------
93 AM_ACLOCAL_INCLUDE(gnome-macros)
95 # ------------------------------------------------------------------
96 # If the user has not set --prefix, we set our default to nothing.
97 # In this case, if the user has not set --sysconfdir, we set it
98 # to the package default of /etc/bacula. If either --prefix or
99 # --sysconfdir is set, we leave sysconfdir alone except to eval it.
100 # ------------------------------------------------------------------
101 if test x${prefix} = xNONE ; then
102 if test `eval echo ${sysconfdir}` = NONE/etc ; then
103 sysconfdir=/etc/bacula
107 sysconfdir=`eval echo ${sysconfdir}`
109 # -------------------------------------------------------------------------
110 # If the user has not set --exec-prefix, we default to ${prefix}
111 # -------------------------------------------------------------------------
112 if test x${exec_prefix} = xNONE ; then
113 exec_prefix=${prefix}
116 # ------------------------------------------------------------------
117 # If the user has not set --sbindir, we set our default as /sbin
118 # ------------------------------------------------------------------
119 if test x$sbindir = x'${exec_prefix}/sbin' ; then
120 sbindir=${exec_prefix}/sbin
122 sbindir=`eval echo ${sbindir}`
124 # ------------------------------------------------------------------
125 # All list of languages for which a translation exist. Each
126 # language is separated by a space.
127 # ------------------------------------------------------------------
130 AC_PATH_PROGS(MSGFMT, msgfmt, no)
131 if test "$MSGFMT" = "no"
133 echo 'msgfmt program not found, disabling NLS !'
135 USE_INCLUDED_LIBINTL=no
143 support_postgresql=no
144 support_smartalloc=yes
149 support_static_tools=no
152 support_static_dir=no
153 support_static_cons=no
159 dnl# --------------------------------------------------------------------------
160 dnl# CHECKING COMMAND LINE OPTIONS
161 dnl# --------------------------------------------------------------------------
163 # -------------------------------------------
164 # gnome (default off)
165 # -------------------------------------------
167 [ --enable-gnome enable build of gnome-console GUI [disabled]],
168 [if test x$enableval = xyes; then
173 if test x$support_gnome = xyes; then
174 abc=`$PKGCONFIG --exists libgnomeui-2.0`
176 if test $pkg = 0; then
177 GNOME_INCLUDEDIR=`pkg-config --cflags-only-I libgnomeui-2.0`
178 GNOMEUI_LIBS=`pkg-config --libs-only-l libgnomeui-2.0`
179 GNOME_LIBDIR=`pkg-config --libs libgnomeui-2.0`
180 GNOME_LIBS=`pkg-config --libs-only-l libgnomeui-2.0`
181 AC_SUBST(GNOME_INCLUDEDIR)
182 AC_SUBST(GNOMEUI_LIBS)
183 AC_SUBST(GNOME_LIBDIR)
185 GNOME_DIR=src/gnome2-console
186 gnome_version="Version 2.x"
190 GNOME_DIR=src/gnome-console
191 gnome_version="Version 1.4"
197 # -------------------------------------------
198 # smartalloc (default off)
199 # -------------------------------------------
200 AC_ARG_ENABLE(smartalloc,
201 [ --enable-smartalloc enable smartalloc debugging support [disabled]],
202 [if test x$enableval = xno; then
203 support_smartalloc=no
206 if test x$support_smartalloc = xyes; then
207 AC_DEFINE(SMARTALLOC)
210 # -------------------------------------------
211 # static-tools (default off)
212 # -------------------------------------------
213 AC_ARG_ENABLE(static-tools,
214 [ --enable-static-tools enable static tape tools [disabled]],
215 [if test x$enableval = xyes; then
216 support_static_tools=yes
220 if test x$support_static_tools = xyes; then
221 TTOOL_LDFLAGS="-static"
223 AC_SUBST(TTOOL_LDFLAGS)
225 # -------------------------------------------
226 # static-fd (default off)
227 # -------------------------------------------
228 AC_ARG_ENABLE(static-fd,
229 [ --enable-static-fd enable static File daemon [disabled]],
230 [if test x$enableval = xyes; then
231 support_static_fd=yes
235 if test x$support_static_fd = xyes; then
236 STATIC_FD="static-bacula-fd"
240 # -------------------------------------------
241 # static-sd (default off)
242 # -------------------------------------------
243 AC_ARG_ENABLE(static-sd,
244 [ --enable-static-sd enable static Storage daemon [disabled]],
245 [if test x$enableval = xyes; then
246 support_static_sd=yes
250 if test x$support_static_sd = xyes; then
251 STATIC_SD="static-bacula-sd"
255 # -------------------------------------------
256 # static-dir (default off)
257 # -------------------------------------------
258 AC_ARG_ENABLE(static-dir,
259 [ --enable-static-dir enable static Director [disabled]],
260 [if test x$enableval = xyes; then
261 support_static_dir=yes
265 if test x$support_static_dir = xyes; then
266 STATIC_DIR="static-bacula-dir"
270 # -------------------------------------------
271 # static-cons (default off)
272 # -------------------------------------------
273 AC_ARG_ENABLE(static-cons,
274 [ --enable-static-cons enable static Console [disabled]],
275 [if test x$enableval = xyes; then
276 support_static_cons=yes
281 if test x$support_static_cons = xyes; then
282 STATIC_CONS="static-bconsole"
283 STATIC_GNOME_CONS="static-gnome-console"
285 AC_SUBST(STATIC_CONS)
286 AC_SUBST(STATIC_GNOME_CONS)
288 # -------------------------------------------
289 # client_only (default off)
290 # -------------------------------------------
291 AC_ARG_ENABLE(client-only,
292 [ --enable-client-only build client (File daemon) only [disabled]],
293 [if test x$enableval = xyes; then
294 build_client_only=yes
296 if test x$build_client_only = xno; then
303 # ---------------------------------------------------
304 # Check for conio (Bacula readline substitute)(
305 # ---------------------------------------------------
306 # this allows you to turn it completely off
308 [ --disable-conio disable conio support [enabled]
310 [if test x$enableval = xno; then
315 if test x$support_conio = xyes; then
316 AC_CHECK_HEADER(termcap.h,
317 [ AC_CHECK_LIB(termcap, tgetent,
318 [ CONS_LIBS="-ltermcap"
323 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
325 [ AC_CHECK_LIB(ncurses, tgetent,
326 [ CONS_LIBS="-lncurses"
331 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
333 [ echo " "; echo "Neither termcap nor ncurses library found. CONIO turned off ..."; echo " "])
335 ],[echo " "; echo "termcap.h not found. CONIO turned off ..."; echo " "])
339 # ---------------------------------------------------
340 # Check for readline support/directory (default off)
341 # ---------------------------------------------------
342 # this allows you to turn it completely off
343 AC_ARG_ENABLE(readline,
344 [ --disable-readline disable readline support [disable]
346 [if test x$enableval = xno; then
352 if test x$support_readline = xyes; then
353 AC_ARG_WITH(readline,
354 [ --with-readline=DIR specify readline library directory],
356 case "$with_readline" in
359 if test "$with_readline" != "yes"; then
360 CONS_INC="-I${with_readline}"
361 CONS_LDFLAGS="-L$with_readline"
363 with_readline="/usr/include/readline"
365 AC_CHECK_HEADER(${with_readline}/readline.h,
366 [ AC_DEFINE(HAVE_READLINE)
367 CONS_LIBS="-lreadline -ltermcap"
370 [ AC_MSG_ERROR([*** readline library missing])
376 # check for standard readline library
377 AC_CHECK_HEADER(/usr/include/readline/readline.h,
378 [ AC_DEFINE(HAVE_READLINE)
380 CONS_INC="-I/usr/include/readline"
381 CONS_LIBS="-lreadline -ltermcap"
383 # Did not find standard library, so try Bacula's default
384 AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h,
385 [ AC_DEFINE(HAVE_READLINE)
387 CONS_INC="-I${TOP_DIR}/depkgs/readline"
388 CONS_LIBS="-lreadline -lhistory -ltermcap"
389 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
390 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
392 [ AC_MSG_ERROR([*** readline library missing])
407 AC_SUBST(CONS_LDFLAGS)
408 AC_SUBST(READLINE_SRC)
410 # Minimal stuff for readline Makefile configuration
417 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr setlocale lstat lchown)
418 AC_CHECK_FUNCS(nanosleep)
420 AC_CHECK_HEADERS(varargs.h)
422 # End of readline/conio stuff
423 # -----------------------------------------------------------------------
426 # ---------------------------------------------------
427 # Check for GMP support/directory
428 # ---------------------------------------------------
432 # [ --with-gmp[=DIR] Specify gmp library directory],
434 # case "$with_gmp" in
437 # if test "$with_gmp" != "yes"; then
438 # GMP_INC="-I$with_gmp"
440 # GMP_LDFLAGS="-L$with_gmp"
442 # with_gmp="/usr/include"
444 # AC_CHECK_HEADER($with_gmp/gmp.h,
445 # [ AC_MSG_RESULT(yes)
446 # AC_DEFINE(HAVE_GMP)
450 # [ AC_MSG_ERROR([*** gmp library missing])
456 # # check for standard gmp library
457 # AC_CHECK_HEADER(/usr/include/gmp.h,
458 # [ AC_MSG_RESULT(yes)
459 # AC_DEFINE(HAVE_GMP)
464 # # Did not find standard library, so use our own
466 # AC_DEFINE(HAVE_GMP)
469 # GMP_INC="-I${TOP_DIR}/depkgs/gmp"
471 # GMP_LDFLAGS="-L${TOP_DIR}/depkgs/gmp"
472 # GMP_SRC="${TOP_DIR}/depkgs/gmp"
478 #AC_SUBST(GMP_LDFLAGS)
482 # -----------------------------------------------------------------------
485 # ---------------------------------------------------
486 # Check for CWEB support/directory
487 # ---------------------------------------------------
492 # [ --with-cweb[=DIR] Specify cweb library directory],
494 # case "$with_cweb" in
497 # if test "$with_cweb" != "yes"; then
498 # CWEB_INC="-I$with_cweb"
500 # CWEB_LDFLAGS="-L$with_cweb"
502 # with_cweb="/usr/include"
504 # AC_CHECK_HEADER($with_cweb/cweb.h,
505 # [ AC_MSG_RESULT(yes)
506 # AC_DEFINE(HAVE_CWEB)
510 # [ AC_MSG_ERROR([*** cweb library missing])
516 # # check for standard cweb library
517 # AC_CHECK_HEADER(/usr/include/cweb.h,
518 # [ AC_MSG_RESULT(yes)
519 # AC_DEFINE(HAVE_CWEB)
524 # # Did not find starndard library, so use our own
526 # AC_DEFINE(HAVE_CWEB)
529 # CWEB=${TOP_DIR}/depkgs/cweb
530 # CWEB_INC="-I${TOP_DIR}/depkgs/cweb"
532 # CWEB_LDFLAGS="-L${TOP_DIR}/depkgs/cweb"
533 # CWEB_SRC="${TOP_DIR}/depkgs/cweb"
540 #AC_SUBST(CWEB_LDFLAGS)
544 # -----------------------------------------------------------------------
548 # -----------------------------------------------------------
549 # Check whether user wants TCP wrappers support (default off)
550 # -----------------------------------------------------------
552 AC_ARG_WITH(tcp-wrappers,
553 [ --with-tcp-wrappers=DIR enable tcpwrappers support],
555 if test "x$withval" != "xno" ; then
557 LIBS="$saved_LIBS -lwrap"
558 AC_MSG_CHECKING(for libwrap)
561 int deny_severity = 0;
562 int allow_severity = 0;
563 struct request_info *req; ],
564 [ hosts_access(req); ],
567 AC_DEFINE(HAVE_LIBWRAP)
570 LIBS="$saved_LIBS -lwrap -lnsl"
573 int deny_severity = 0;
574 int allow_severity = 0;
575 struct request_info *req; ],
576 [ hosts_access(req); ],
579 AC_DEFINE(HAVE_LIBWRAP)
582 [AC_MSG_ERROR([*** libwrap missing]) ] ]
589 # ------------------------------------------
590 # Where to place working dir
591 # ------------------------------------------
592 working_dir=`eval echo ${prefix}/var/bacula/working`
593 AC_ARG_WITH(working-dir,
594 [ --with-working-dir=PATH specify path of Bacula working directory],
596 if test "x$withval" != "xno" ; then
602 AC_SUBST(working_dir)
605 # ------------------------------------------
606 # Where to place scriptdir (script files)
607 # ------------------------------------------
608 scriptdir=`eval echo ${sysconfdir}`
609 AC_ARG_WITH(scriptdir,
610 [ --with-scriptdir=PATH specify path of Bacula scripts directory],
612 if test "x$withval" != "xno" ; then
621 # ------------------------------------------
622 # Where to send dump email
623 # ------------------------------------------
624 dump_email=root@localhost
625 AC_ARG_WITH(dump-email,
626 [ --with-dump-email=EMAIL dump email address],
628 if test "x$withval" != "xno" ; then
636 # ------------------------------------------
637 # Where to send job email
638 # ------------------------------------------
639 job_email=root@localhost
640 AC_ARG_WITH(job-email,
641 [ --with-job-email=EMAIL job output email address],
643 if test "x$withval" != "xno" ; then
651 # ------------------------------------------
652 # Where to find smtp host
653 # ------------------------------------------
655 AC_ARG_WITH(smtp_host,
656 [ --with-smtp-host=HOST SMTP mail host address],
658 if test "x$withval" != "xno" ; then
667 # ------------------------------------
668 # Where to place pid files
669 # ------------------------------------
672 [ --with-pid-dir=PATH specify location of Bacula pid files],
674 if test "x$withval" != "xno" ; then
680 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
684 # ------------------------------------
685 # Where to place subsys "lock file"
686 # ------------------------------------
687 subsysdir=/var/run/subsys
688 AC_ARG_WITH(subsys-dir,
689 [ --with-subsys-dir=PATH specify location of Bacula subsys file],
691 if test "x$withval" != "xno" ; then
701 # ------------------------------------
702 # Where to start assigning ports
703 # ------------------------------------
705 AC_ARG_WITH(baseport,
706 [ --with-baseport=PORT specify base port address for daemons],
708 if test "x$withval" != "xno" ; then
715 dir_port=`expr $baseport`
716 fd_port=`expr $baseport + 1`
717 sd_port=`expr $fd_port + 1`
724 # ------------------------------------------
726 # ------------------------------------------
728 AC_ARG_WITH(dir-password,
729 [ --with-dir-password=PASSWORD specify Director's password],
731 if test "x$withval" != "xno" ; then
732 dir_password=$withval
737 if test "x$dir_password" = "x" ; then
738 if test "x$OPENSSL" = "xnone" ; then
739 # key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" abcdefghijklmnopqrst | awk '{getline} {print} {exit}'`
740 key=`autoconf/randpass 33`
742 key=`openssl rand -base64 33`
748 AC_ARG_WITH(fd-password,
749 [ --with-fd-password=PASSWORD specify Client's password],
751 if test "x$withval" != "xno" ; then
757 if test "x$fd_password" = "x" ; then
758 if test "x$OPENSSL" = "xnone" ; then
759 # key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" tsrqponmlkjihgfedcba | awk '{getline} {print} {exit}'`
760 key=`autoconf/randpass 37`
762 key=`openssl rand -base64 33`
768 AC_ARG_WITH(sd-password,
769 [ --with-sd-password=PASSWORD specify Storage daemon's password],
771 if test "x$withval" != "xno" ; then
777 if test "x$sd_password" = "x" ; then
778 if test "x$OPENSSL" = "xnone" ; then
779 # key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" 123456789uvwxyzabcdef | awk '{getline} {print} {exit}'`
780 key=`autoconf/randpass 41`
782 key=`openssl rand -base64 33`
788 AC_SUBST(dir_password)
789 AC_SUBST(fd_password)
790 AC_SUBST(sd_password)
794 # Handle users and groups for each daemon
797 AC_ARG_WITH(dir_user,
798 [ --with-dir-user=USER specify user for Director daemon],
800 if test "x$withval" != "x" ; then
807 AC_ARG_WITH(dir_group,
808 [ --with-dir-group=GROUP specify group for Director daemon],
810 if test "x$withval" != "x" ; then
818 [ --with-sd-user=USER specify user for Storage daemon],
820 if test "x$withval" != "x" ; then
827 AC_ARG_WITH(sd_group,
828 [ --with-sd-group=GROUP specify group for Storage daemon],
830 if test "x$withval" != "x" ; then
838 [ --with-fd-user=USER specify user for File daemon],
840 if test "x$withval" != "x" ; then
847 AC_ARG_WITH(fd_group,
848 [ --with-fd-group=GROUP specify group for File daemon],
850 if test "x$withval" != "x" ; then
866 # ------------------------------------------------
867 # Bacula check for various SQL database engines
868 # ------------------------------------------------
869 BA_CHECK_POSTGRESQL_DB
878 AC_DEFINE(PROTOTYPES)
880 dnl# --------------------------------------------------------------------------
881 dnl# Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
883 if test -z "$CFLAGS"; then
884 if test -z "$CCOPTS"; then
886 dnl> if test "x$GCC" = xyes; then
887 dnl> if test x$system = xLinux; then
888 dnl> CCOPTS="$CCOPTS "'-O2 -fno-strength-reduce'
899 dnl See if we can use 64 bit file addresses
900 largefile_support="no"
906 dnl# --------------------------------------------------------------------------
907 dnl# CHECKING FOR HEADER FILES
908 dnl# --------------------------------------------------------------------------
943 dnl# --------------------------------------------------------------------------
944 dnl# Check for utime.h structure
945 dnl# --------------------------------------------------------------------------
946 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
948 #include <sys/types.h>
949 #include <utime.h>], [struct utimbuf foo],
950 ba_cv_header_utime_h=yes, ba_cv_header_utime_h=no)])
951 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H)
953 dnl# --------------------------------------------------------------------------
954 dnl# Check for socklen_t
955 dnl# --------------------------------------------------------------------------
956 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
958 #include <sys/types.h>
959 #include <sys/socket.h>],
961 ba_cv_header_socklen_t=yes, ba_cv_header_socklen_t=no)])
962 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T)
964 dnl# --------------------------------------------------------------------------
965 dnl# Check for bigendian
966 dnl# --------------------------------------------------------------------------
967 AC_CACHE_CHECK([for bigendian], ba_cv_bigendian,
969 [main(){long a=1L; char *p=(char *)&a; exit(*p);}],
970 [ba_cv_bigendian=yes],
971 [ba_cv_bigendian=no],
972 [ba_cv_bigendian=no])])
973 test $ba_cv_bigendian = yes && AC_DEFINE(HAVE_BIGENDIAN)
979 dnl# --------------------------------------------------------------------------
980 dnl# CHECKING FOR FILESYSTEM TYPE
981 dnl# --------------------------------------------------------------------------
982 AC_MSG_CHECKING(how to get filesystem type)
984 # The order of these tests is important.
985 AC_TRY_CPP([#include <sys/statvfs.h>
986 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4)
987 if test $fstype = no; then
988 AC_TRY_CPP([#include <sys/statfs.h>
989 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3)
991 if test $fstype = no; then
992 AC_TRY_CPP([#include <sys/statfs.h>
993 #include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX)
995 if test $fstype = no; then
996 AC_TRY_CPP([#include <mntent.h>], AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD)
998 if test $fstype = no; then
999 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
1001 if test $fstype = no; then
1002 AC_TRY_CPP([#include <sys/mount.h>
1003 #include <sys/fs_types.h>], AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix)
1005 AC_MSG_RESULT($fstype)
1007 dnl# --------------------------------------------------------------------------
1008 dnl# CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
1009 dnl# --------------------------------------------------------------------------
1017 AC_CHECK_TYPE(ino_t, unsigned long)
1018 AC_CHECK_TYPE(dev_t, unsigned long)
1019 AC_CHECK_TYPE(daddr_t, long)
1020 AC_CHECK_TYPE(major_t, int)
1021 AC_CHECK_TYPE(minor_t, int)
1022 AC_CHECK_TYPE(ssize_t, int)
1029 AC_CHECK_SIZEOF(char, 1)
1030 AC_CHECK_SIZEOF(short int, 2)
1031 AC_CHECK_SIZEOF(int, 4)
1032 AC_CHECK_SIZEOF(long int, 4)
1033 AC_CHECK_SIZEOF(long long int, 8)
1034 AC_CHECK_SIZEOF(int *, 4)
1036 # Check for sys/types.h types
1037 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1039 [ #include <sys/types.h> ],
1041 [ ac_cv_have_u_int="yes" ],
1042 [ ac_cv_have_u_int="no" ]
1045 if test "x$ac_cv_have_u_int" = "xyes" ; then
1046 AC_DEFINE(HAVE_U_INT)
1050 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t, [
1052 [ #include <sys/types.h> ],
1053 [ intmax_t a; a = 1;],
1054 [ ac_cv_have_intmax_t="yes" ],
1057 [ #include <stdint.h> ],
1058 [ intmax_t a; a = 1;],
1059 [ ac_cv_have_intmax_t="yes" ],
1060 [ ac_cv_have_intmax_t="no" ]
1066 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
1067 AC_DEFINE(HAVE_INTMAX_T)
1072 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t, [
1074 [ #include <sys/types.h> ],
1075 [ u_intmax_t a; a = 1;],
1076 [ ac_cv_have_u_intmax_t="yes" ],
1079 [ #include <stdint.h> ],
1080 [ u_intmax_t a; a = 1;],
1081 [ ac_cv_have_u_intmax_t="yes" ],
1082 [ ac_cv_have_u_intmax_t="no" ]
1087 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
1088 AC_DEFINE(HAVE_U_INTMAX_T)
1093 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1095 [ #include <sys/types.h> ],
1096 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1097 [ ac_cv_have_intxx_t="yes" ],
1098 [ ac_cv_have_intxx_t="no" ]
1101 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1102 AC_DEFINE(HAVE_INTXX_T)
1106 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1108 [ #include <sys/types.h> ],
1109 [ int64_t a; a = 1;],
1110 [ ac_cv_have_int64_t="yes" ],
1111 [ ac_cv_have_int64_t="no" ]
1114 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1115 AC_DEFINE(HAVE_INT64_T)
1119 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1121 [ #include <sys/types.h> ],
1122 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1123 [ ac_cv_have_u_intxx_t="yes" ],
1124 [ ac_cv_have_u_intxx_t="no" ]
1127 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1128 AC_DEFINE(HAVE_U_INTXX_T)
1132 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1134 [ #include <sys/types.h> ],
1135 [ u_int64_t a; a = 1;],
1136 [ ac_cv_have_u_int64_t="yes" ],
1137 [ ac_cv_have_u_int64_t="no" ]
1140 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1141 AC_DEFINE(HAVE_U_INT64_T)
1145 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1146 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1148 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1150 [ #include <sys/bitypes.h> ],
1151 [ int8_t a; int16_t b; int32_t c;
1152 u_int8_t e; u_int16_t f; u_int32_t g;
1153 a = b = c = e = f = g = 1; ],
1154 [ AC_DEFINE(HAVE_U_INTXX_T)
1155 AC_DEFINE(HAVE_INTXX_T)
1156 AC_DEFINE(HAVE_SYS_BITYPES_H)
1157 AC_MSG_RESULT(yes) ],
1158 [ AC_MSG_RESULT(no)]
1162 if test -z "$have_u_intxx_t" ; then
1163 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1165 [ #include <sys/types.h> ],
1166 [ uint8_t a; uint16_t b;
1167 uint32_t c; a = b = c = 1; ],
1168 [ ac_cv_have_uintxx_t="yes" ],
1169 [ ac_cv_have_uintxx_t="no" ]
1172 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1173 AC_DEFINE(HAVE_UINTXX_T)
1178 dnl# --------------------------------------------------------------------------
1179 dnl# CHECKING FOR LIBRARY FUNCTIONS
1180 dnl# --------------------------------------------------------------------------
1196 [echo 'configure: cannot find needed function.'; exit 1]
1199 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
1200 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
1202 AC_CHECK_FUNCS(chflags)
1204 AC_CHECK_FUNCS(snprintf vsnprintf gethostid getdomainname)
1206 dnl# --------------------------------------------------------------------------
1207 dnl# CHECKING FOR THREAD SAFE FUNCTIONS
1208 dnl# --------------------------------------------------------------------------
1209 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
1211 # If resolver functions are not in libc check for -lnsl or -lresolv.
1212 AC_CHECK_FUNC(gethostbyname_r,
1213 AC_MSG_RESULT(using libc's resolver),
1214 AC_CHECK_LIB(nsl,gethostbyname_r)
1215 AC_CHECK_LIB(resolv,gethostbyname_r))
1218 # Find where sockets are (especially for Solaris)
1219 AC_CHECK_FUNC(socket,
1220 AC_MSG_RESULT(using libc's socket),
1221 AC_CHECK_LIB(xnet,socket)
1222 AC_CHECK_LIB(socket,socket)
1223 AC_CHECK_LIB(inet,socket))
1225 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
1231 AC_FUNC_CLOSEDIR_VOID
1232 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
1236 dnl# FreeBSD needs to link libxpg4
1237 AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"])
1240 AC_CHECK_LIB(sun, getpwnam)
1242 AC_CHECK_HEADERS(zlib.h)
1243 AC_CHECK_LIB(z, deflate, [FDLIBS="-lz"])
1245 if test x$FDLIBS = x-lz; then
1246 AC_DEFINE(HAVE_LIBZ)
1250 dnl Check for pthread libraries
1252 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
1253 [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
1254 [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
1255 [AC_CHECK_FUNC(pthread_create)]
1265 LDFLAGS=${LDFLAGS--O}
1266 DB_LIBS="${SQL_LFLAGS}"
1268 CPPFLAGS="$CPPFLAGS"
1279 AC_SUBST(X_EXTRA_LIBS)
1283 dnl# extra configurable objects
1294 # Finally we set appropriate distribution specific
1295 # variables and defaults
1297 # PFILES are platform specific files
1298 PFILES="platforms/Makefile"
1301 hostname=`uname -n | cut -d '.' -f 1`
1305 PSCMD="ps -e -o pid,comm"
1307 platforms/aix/Makefile"
1308 TAPEDRIVE="/dev/rmt0.1"
1312 PTHREAD_LIB="-lpthread -lexc"
1313 if test "${CC}" = "gcc" ; then
1320 TAPEDRIVE="/dev/nrmt0"
1323 DISTVER=`uname -a |awk '{print $3}'`
1324 TAPEDRIVE="/dev/nrmt0"
1325 PTHREAD_LIB="-pthread"
1326 CFLAGS="${CFLAGS} -pthread"
1327 PSCMD="ps -x -o pid,command"
1331 platforms/bsdi/Makefile \
1332 platforms/bsdi/bacula-fd \
1333 platforms/bsdi/bacula-sd \
1334 platforms/bsdi/bacula-dir"
1335 largefile_support="yes"
1338 DISTVER=`uname -a |awk '{print $3}'`
1339 TAPEDRIVE="/dev/nrst0"
1342 WLDFLAGS="-mwindows"
1346 TAPEDRIVE="/dev/nst0"
1347 PSCMD="ps -e -o pid,command"
1349 platforms/darwin/Makefile"
1352 DISTVER=`cat /etc/debian_version`
1353 TAPEDRIVE="/dev/nrst0"
1354 PSCMD="ps -e -o pid,command"
1357 DISTVER=`uname -a |awk '{print $3}'`
1358 VER=`echo $DISTVER | cut -c 1`
1359 if test x$VER = x4 ; then
1360 PTHREAD_LIB="-pthread"
1361 CFLAGS="${CFLAGS} -pthread"
1365 TAPEDRIVE="/dev/nrsa0"
1366 PSCMD="ps -x -o pid,command"
1368 platforms/freebsd/Makefile \
1369 platforms/freebsd/bacula-fd \
1370 platforms/freebsd/bacula-sd \
1371 platforms/freebsd/bacula-dir"
1372 largefile_support="yes"
1375 PSCMD="UNIX95=1 ps -e -o pid,comm"
1376 CFLAGS="$(CFLAGS) -D_XOPEN_SOURCE_EXTENDED=1"
1378 TAPEDRIVE="/dev/rmt/0hnb"
1382 TAPEDRIVE="/dev/rmt/0cbn"
1383 PSCMD="ps -e -o pid,comm"
1385 platforms/irix/Makefile \
1386 platforms/irix/bacula-fd \
1387 platforms/irix/bacula-sd \
1388 platforms/irix/bacula-dir"
1391 DISTVER=`uname -a |awk '{print $3}'`
1394 TAPEDRIVE="/dev/nrst0"
1395 PSCMD="ps -a -o pid,command"
1396 PTHREAD_LIB="-pthread"
1397 CFLAGS="${CFLAGS} -pthread"
1400 DISTVER=`uname -a |awk '{print $3}'`
1403 TAPEDRIVE="/dev/nrst0"
1404 PSCMD="ps -a -o pid,command"
1405 PTHREAD_LIB="-pthread"
1406 CFLAGS="${CFLAGS} -pthread"
1408 platforms/openbsd/Makefile \
1409 platforms/openbsd/bacula-fd \
1410 platforms/openbsd/bacula-sd \
1411 platforms/openbsd/bacula-dir"
1414 if test `cat /etc/redhat-release | grep release |\
1415 cut -f 3 -d ' '`x = "Enterprise"x ; then
1416 DISTVER="Enterprise "`cat /etc/redhat-release | grep release |\
1419 DISTVER=`cat /etc/redhat-release | grep release |\
1422 TAPEDRIVE="/dev/nst0"
1423 PSCMD="ps -e -o pid,command"
1425 platforms/redhat/Makefile \
1426 platforms/redhat/bacula-fd \
1427 platforms/redhat/bacula-sd \
1428 platforms/redhat/bacula-dir \
1429 platforms/redhat/bacula.spec \
1431 hostname=`hostname -s`
1434 DISTVER=`cat /etc/mandrake-release | grep release |\
1436 TAPEDRIVE="/dev/nst0"
1437 PSCMD="ps -e -o pid,command"
1439 platforms/mandrake/Makefile \
1440 platforms/mandrake/bacula-fd \
1441 platforms/mandrake/bacula-sd \
1442 platforms/mandrake/bacula-dir \
1443 platforms/mandrake/bacula.spec \
1447 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
1448 TAPEDRIVE="/dev/nst0"
1449 PSCMD="ps -e -o pid,command"
1451 platforms/gentoo/Makefile \
1452 platforms/gentoo/bacula-fd \
1453 platforms/gentoo/bacula-sd \
1454 platforms/gentoo/bacula-dir"
1457 DISTVER=`cat /etc/slackware-version`
1458 TAPEDRIVE="/dev/nst0"
1459 PSCMD="ps -e -o pid,command"
1461 platforms/slackware/Makefile \
1462 platforms/slackware/rc.bacula-fd \
1463 platforms/slackware/rc.bacula-sd \
1464 platforms/slackware/rc.bacula-dir\
1465 platforms/slackware/functions.bacula"
1469 TAPEDRIVE="/dev/rmt/0cbn"
1470 PSCMD="ps -e -o pid,comm"
1472 platforms/solaris/Makefile \
1473 platforms/solaris/bacula-fd \
1474 platforms/solaris/bacula-sd \
1475 platforms/solaris/bacula-dir"
1476 if test x$DISTVER = x5.6 ; then
1477 AC_DEFINE(HAVE_OLD_SOCKOPT)
1481 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
1483 TAPEDRIVE="/dev/nst0"
1484 PSCMD="ps -e -o pid,command"
1486 platforms/suse/Makefile \
1487 platforms/suse/bacula-fd \
1488 platforms/suse/bacula-sd \
1489 platforms/suse/bacula-dir \
1490 platforms/suse/bacula \
1491 platforms/suse/bacula.spec"
1496 TAPEDRIVE="/dev/nst0"
1497 PSCMD="ps -e -o pid,command"
1499 platforms/suse/Makefile \
1500 platforms/suse/bacula-fd \
1501 platforms/suse/bacula-sd \
1502 platforms/suse/bacula-dir"
1506 TAPEDRIVE="/dev/nst0"
1509 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
1515 LIBS="$PTHREAD_LIB $LIBS"
1517 AC_DEFINE_UNQUOTED(lld, "$lld")
1518 AC_DEFINE_UNQUOTED(llu, "$llu")
1525 dnl# common parts of the Makefile
1526 MCOMMON=./autoconf/Make.common
1527 AC_SUBST_FILE(MCOMMON)
1530 if test "x${subsysdir}" = "x${sbindir}" ; then
1533 echo "You have set both --sbindir and --with-subsys-dir"
1534 echo " equal to: ${subsysdir} "
1535 echo "This is not permitted. Please reconfigure."
1537 echo "Aborting configuration ..."
1543 AC_OUTPUT([autoconf/Make.common \
1546 rescue/linux/Makefile \
1547 rescue/freebsd/Makefile \
1548 rescue/solaris/Makefile \
1549 scripts/startmysql \
1551 scripts/btraceback \
1557 scripts/devel_bacula \
1561 scripts/bacula.desktop.gnome1 \
1562 scripts/bacula.desktop.gnome2 \
1563 scripts/bacula.desktop.gnome1.consolehelper \
1564 scripts/bacula.desktop.gnome2.consolehelper \
1565 scripts/bacula.desktop.gnome1.xsu \
1566 scripts/bacula.desktop.gnome2.xsu \
1567 scripts/gnome-console.console_apps \
1568 scripts/mtx-changer \
1572 src/console/Makefile \
1573 src/console/bconsole.conf \
1574 src/gnome-console/Makefile \
1575 src/gnome-console/gnome-console.conf \
1576 src/gnome2-console/Makefile \
1577 src/gnome2-console/gnome-console.conf \
1578 src/tconsole/Makefile \
1580 src/dird/bacula-dir.conf \
1582 src/stored/Makefile \
1583 src/stored/bacula-sd.conf \
1584 src/filed/Makefile \
1585 src/filed/bacula-fd.conf \
1586 src/filed/win32/Makefile \
1588 src/cats/make_catalog_backup \
1589 src/cats/delete_catalog_backup \
1590 src/cats/create_postgresql_database \
1591 src/cats/update_postgresql_tables \
1592 src/cats/make_postgresql_tables \
1593 src/cats/grant_postgresql_privileges \
1594 src/cats/drop_postgresql_tables \
1595 src/cats/drop_postgresql_database \
1596 src/cats/create_mysql_database \
1597 src/cats/update_mysql_tables \
1598 src/cats/make_mysql_tables \
1599 src/cats/grant_mysql_privileges \
1600 src/cats/drop_mysql_tables \
1601 src/cats/drop_mysql_database \
1602 src/cats/create_sqlite_database \
1603 src/cats/update_sqlite_tables \
1604 src/cats/make_sqlite_tables \
1605 src/cats/grant_sqlite_privileges \
1606 src/cats/drop_sqlite_tables \
1607 src/cats/drop_sqlite_database \
1610 src/cats/create_bdb_database \
1611 src/cats/update_bdb_tables \
1612 src/cats/make_bdb_tables \
1613 src/cats/grant_bdb_privileges \
1614 src/cats/drop_bdb_tables \
1615 src/cats/drop_bdb_database \
1616 src/cats/create_bacula_database \
1617 src/cats/update_bacula_tables \
1618 src/cats/grant_bacula_privileges \
1619 src/cats/make_bacula_tables \
1620 src/cats/drop_bacula_tables \
1621 src/cats/drop_bacula_database \
1622 src/findlib/Makefile \
1623 src/tools/Makefile \
1624 src/win32/winbacula.nsi \
1625 src/win32/bacula-fd.conf \
1626 src/win32/Makefile \
1628 [(echo "Doing make of dependencies"; make depend;) ]
1632 chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
1633 chmod 755 bconsole gconsole mtx-changer devel_bacula logrotate
1638 chmod 755 $c/create_bacula_database $c/update_bacula_tables $c/make_bacula_tables
1639 chmod 755 $c/grant_bacula_privileges $c/drop_bacula_tables $c/drop_bacula_database
1641 chmod 755 $c/create_bdb_database $c/update_bdb_tables $c/make_bdb_tables
1642 chmod 755 $c/grant_bdb_privileges $c/drop_bdb_tables $c/drop_bdb_database
1644 chmod 755 $c/create_mysql_database $c/update_mysql_tables $c/make_mysql_tables
1645 chmod 755 $c/grant_mysql_privileges $c/drop_mysql_tables $c/drop_mysql_database
1647 chmod 755 $c/create_sqlite_database $c/update_sqlite_tables $c/make_sqlite_tables
1648 chmod 755 $c/grant_sqlite_privileges $c/drop_sqlite_tables $c/drop_sqlite_database
1650 chmod 755 $c/create_postgresql_database $c/update_postgresql_tables $c/make_postgresql_tables
1651 chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables $c/drop_postgresql_database
1653 chmod 755 $c/make_catalog_backup $c/delete_catalog_backup
1657 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
1658 largefile_support="yes"
1662 # A whole lot of hand springs to get the compiler version.
1663 # This is because gcc changed the output in version 3.0
1665 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
1666 if test "x${CCVERSION}" = "x" ; then
1667 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
1669 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
1670 if test x"${CXXVERSION}" = x ; then
1671 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
1674 if test "x${subsysdir}" = "x${sbindir}" ; then
1677 echo "You have set --sbindir and --with-subsys-dir"
1678 echo " both equal to: ${subsysdir} "
1679 echo " This is not permitted. Please reconfigure."
1680 echo "Aborting configuration ..."
1687 Configuration on `date`:
1689 Host: $host -- ${DISTNAME} ${DISTVER}
1690 Bacula version: ${VERSION} (${DATE})
1691 Source code location: ${srcdir}
1692 Install binaries: ${sbindir}
1693 Install config files: ${sysconfdir}
1694 Scripts directory: ${scriptdir}
1695 Working directory: ${working_dir}
1696 PID directory: ${piddir}
1697 Subsys directory: ${subsysdir}
1698 C Compiler: ${CC} ${CCVERSION}
1699 C++ Compiler: ${CXX} ${CXXVERSION}
1700 Compiler flags: ${WCFLAGS} ${CFLAGS}
1701 Linker flags: ${WLDFLAGS} ${LDFLAGS}
1703 Statically Linked Tools: ${support_static_tools}
1704 Statically Linked FD: ${support_static_fd}
1705 Statically Linked SD: ${support_static_sd}
1706 Statically Linked DIR: ${support_static_dir}
1707 Statically Linked CONS: ${support_static_cons}
1708 Database type: ${db_name}
1709 Database lib: ${DB_LIBS}
1711 Job Output Email: ${job_email}
1712 Traceback Email: ${dump_email}
1713 SMTP Host Address: ${smtp_host}
1715 Director Port: ${dir_port}
1716 File daemon Port: ${fd_port}
1717 Storage daemon Port: ${sd_port}
1719 Director User: ${dir_user}
1720 Director Group: ${dir_group}
1721 Storage Daemon User: ${sd_user}
1722 Storage DaemonGroup: ${sd_group}
1723 File Daemon User: ${fd_user}
1724 File Daemon Group: ${fd_group}
1726 SQL binaries Directory ${SQL_BINDIR}
1728 Large file support: $largefile_support
1729 Bacula conio support: ${got_conio} ${CONS_LIBS}
1730 readline support: ${got_readline} ${PRTREADLINE_SRC}
1731 TCP Wrappers support: ${TCPW_MSG}
1732 ZLIB support: ${have_zlib}
1733 enable-smartalloc: ${support_smartalloc}
1734 enable-gnome: ${support_gnome} ${gnome_version}
1735 client-only: ${build_client_only}
1742 # cweb support: ${got_cweb} ${CWEB_SRC}
1743 # gmp support: ${got_gmp} ${GMP_SRC}