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
280 if test x$support_static_cons = xyes; then
281 STATIC_CONS="static-bconsole"
283 AC_SUBST(STATIC_CONS)
285 # -------------------------------------------
286 # client_only (default off)
287 # -------------------------------------------
288 AC_ARG_ENABLE(client-only,
289 [ --enable-client-only build client (File daemon) only [disabled]],
290 [if test x$enableval = xyes; then
291 build_client_only=yes
293 if test x$build_client_only = xno; then
300 # ---------------------------------------------------
301 # Check for conio (Bacula readline substitute)(
302 # ---------------------------------------------------
303 # this allows you to turn it completely off
305 [ --disable-conio disable conio support [enabled]
307 [if test x$enableval = xno; then
312 if test x$support_conio = xyes; then
316 AC_CHECK_HEADERS(termcap.h)
317 AC_CHECK_LIB(termcap, tgetent, CONS_LIBS="-ltermcap")
319 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
323 # ---------------------------------------------------
324 # Check for readline support/directory (default off)
325 # ---------------------------------------------------
326 # this allows you to turn it completely off
327 AC_ARG_ENABLE(readline,
328 [ --disable-readline disable readline support [disable]
330 [if test x$enableval = xno; then
336 if test x$support_readline = xyes; then
337 AC_ARG_WITH(readline,
338 [ --with-readline=DIR specify readline library directory],
340 case "$with_readline" in
343 if test "$with_readline" != "yes"; then
344 CONS_INC="-I${with_readline}"
345 CONS_LDFLAGS="-L$with_readline"
347 with_readline="/usr/include/readline"
349 AC_CHECK_HEADER(${with_readline}/readline.h,
350 [ AC_DEFINE(HAVE_READLINE)
351 CONS_LIBS="-lreadline -ltermcap"
354 [ AC_MSG_ERROR([*** readline library missing])
360 # check for standard readline library
361 AC_CHECK_HEADER(/usr/include/readline/readline.h,
362 [ AC_DEFINE(HAVE_READLINE)
364 CONS_INC="-I/usr/include/readline"
365 CONS_LIBS="-lreadline -ltermcap"
367 # Did not find standard library, so try Bacula's default
368 AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h,
369 [ AC_DEFINE(HAVE_READLINE)
371 CONS_INC="-I${TOP_DIR}/depkgs/readline"
372 CONS_LIBS="-lreadline -lhistory -ltermcap"
373 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
374 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
376 [ AC_MSG_ERROR([*** readline library missing])
391 AC_SUBST(CONS_LDFLAGS)
392 AC_SUBST(READLINE_SRC)
394 # Minimal stuff for readline Makefile configuration
401 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr setlocale lstat lchown)
402 AC_CHECK_FUNCS(nanosleep)
404 AC_CHECK_HEADERS(varargs.h)
406 # End of readline/conio stuff
407 # -----------------------------------------------------------------------
410 # ---------------------------------------------------
411 # Check for GMP support/directory
412 # ---------------------------------------------------
416 # [ --with-gmp[=DIR] Specify gmp library directory],
418 # case "$with_gmp" in
421 # if test "$with_gmp" != "yes"; then
422 # GMP_INC="-I$with_gmp"
424 # GMP_LDFLAGS="-L$with_gmp"
426 # with_gmp="/usr/include"
428 # AC_CHECK_HEADER($with_gmp/gmp.h,
429 # [ AC_MSG_RESULT(yes)
430 # AC_DEFINE(HAVE_GMP)
434 # [ AC_MSG_ERROR([*** gmp library missing])
440 # # check for standard gmp library
441 # AC_CHECK_HEADER(/usr/include/gmp.h,
442 # [ AC_MSG_RESULT(yes)
443 # AC_DEFINE(HAVE_GMP)
448 # # Did not find standard library, so use our own
450 # AC_DEFINE(HAVE_GMP)
453 # GMP_INC="-I${TOP_DIR}/depkgs/gmp"
455 # GMP_LDFLAGS="-L${TOP_DIR}/depkgs/gmp"
456 # GMP_SRC="${TOP_DIR}/depkgs/gmp"
462 #AC_SUBST(GMP_LDFLAGS)
466 # -----------------------------------------------------------------------
469 # ---------------------------------------------------
470 # Check for CWEB support/directory
471 # ---------------------------------------------------
476 # [ --with-cweb[=DIR] Specify cweb library directory],
478 # case "$with_cweb" in
481 # if test "$with_cweb" != "yes"; then
482 # CWEB_INC="-I$with_cweb"
484 # CWEB_LDFLAGS="-L$with_cweb"
486 # with_cweb="/usr/include"
488 # AC_CHECK_HEADER($with_cweb/cweb.h,
489 # [ AC_MSG_RESULT(yes)
490 # AC_DEFINE(HAVE_CWEB)
494 # [ AC_MSG_ERROR([*** cweb library missing])
500 # # check for standard cweb library
501 # AC_CHECK_HEADER(/usr/include/cweb.h,
502 # [ AC_MSG_RESULT(yes)
503 # AC_DEFINE(HAVE_CWEB)
508 # # Did not find starndard library, so use our own
510 # AC_DEFINE(HAVE_CWEB)
513 # CWEB=${TOP_DIR}/depkgs/cweb
514 # CWEB_INC="-I${TOP_DIR}/depkgs/cweb"
516 # CWEB_LDFLAGS="-L${TOP_DIR}/depkgs/cweb"
517 # CWEB_SRC="${TOP_DIR}/depkgs/cweb"
524 #AC_SUBST(CWEB_LDFLAGS)
528 # -----------------------------------------------------------------------
532 # -----------------------------------------------------------
533 # Check whether user wants TCP wrappers support (default off)
534 # -----------------------------------------------------------
536 AC_ARG_WITH(tcp-wrappers,
537 [ --with-tcp-wrappers=DIR enable tcpwrappers support],
539 if test "x$withval" != "xno" ; then
541 LIBS="$saved_LIBS -lwrap"
542 AC_MSG_CHECKING(for libwrap)
545 int deny_severity = 0;
546 int allow_severity = 0;
547 struct request_info *req; ],
548 [ hosts_access(req); ],
551 AC_DEFINE(HAVE_LIBWRAP)
554 LIBS="$saved_LIBS -lwrap -lnsl"
557 int deny_severity = 0;
558 int allow_severity = 0;
559 struct request_info *req; ],
560 [ hosts_access(req); ],
563 AC_DEFINE(HAVE_LIBWRAP)
566 [AC_MSG_ERROR([*** libwrap missing]) ] ]
573 # ------------------------------------------
574 # Where to place working dir
575 # ------------------------------------------
576 working_dir=`eval echo ${sysconfdir}/working`
577 AC_ARG_WITH(working-dir,
578 [ --with-working-dir=PATH specify path of Bacula working directory],
580 if test "x$withval" != "xno" ; then
586 AC_SUBST(working_dir)
589 # ------------------------------------------
590 # Where to place scriptdir (script files)
591 # ------------------------------------------
592 scriptdir=`eval echo ${sysconfdir}`
593 AC_ARG_WITH(scriptdir,
594 [ --with-scriptdir=PATH specify path of Bacula scripts directory],
596 if test "x$withval" != "xno" ; then
605 # ------------------------------------------
606 # Where to send dump email
607 # ------------------------------------------
608 dump_email=root@localhost
609 AC_ARG_WITH(dump-email,
610 [ --with-dump-email=EMAIL dump email address],
612 if test "x$withval" != "xno" ; then
620 # ------------------------------------------
621 # Where to send job email
622 # ------------------------------------------
623 job_email=root@localhost
624 AC_ARG_WITH(job-email,
625 [ --with-job-email=EMAIL job output email address],
627 if test "x$withval" != "xno" ; then
635 # ------------------------------------------
636 # Where to find smtp host
637 # ------------------------------------------
639 AC_ARG_WITH(smtp_host,
640 [ --with-smtp-host=HOST SMTP mail host address],
642 if test "x$withval" != "xno" ; then
651 # ------------------------------------
652 # Where to place pid files
653 # ------------------------------------
656 [ --with-pid-dir=PATH specify location of Bacula pid files],
658 if test "x$withval" != "xno" ; then
664 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
668 # ------------------------------------
669 # Where to place subsys "lock file"
670 # ------------------------------------
671 subsysdir=/var/run/subsys
672 AC_ARG_WITH(subsys-dir,
673 [ --with-subsys-dir=PATH specify location of Bacula subsys file],
675 if test "x$withval" != "xno" ; then
685 # ------------------------------------
686 # Where to start assigning ports
687 # ------------------------------------
689 AC_ARG_WITH(baseport,
690 [ --with-baseport=PORT specify base port address for daemons],
692 if test "x$withval" != "xno" ; then
699 dir_port=`expr $baseport`
700 fd_port=`expr $baseport + 1`
701 sd_port=`expr $fd_port + 1`
708 # ------------------------------------------
710 # ------------------------------------------
712 AC_ARG_WITH(dir-password,
713 [ --with-dir-password=PASSWORD specify Director's password],
715 if test "x$withval" != "xno" ; then
716 dir_password=$withval
721 if test "x$dir_password" = "x" ; then
722 if test "x$OPENSSL" = "xnone" ; then
723 # key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" abcdefghijklmnopqrst | awk '{getline} {print} {exit}'`
724 key=`autoconf/randpass 33`
726 key=`openssl rand -base64 33`
732 AC_ARG_WITH(fd-password,
733 [ --with-fd-password=PASSWORD specify Client's password],
735 if test "x$withval" != "xno" ; then
741 if test "x$fd_password" = "x" ; then
742 if test "x$OPENSSL" = "xnone" ; then
743 # key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" tsrqponmlkjihgfedcba | awk '{getline} {print} {exit}'`
744 key=`autoconf/randpass 37`
746 key=`openssl rand -base64 33`
752 AC_ARG_WITH(sd-password,
753 [ --with-sd-password=PASSWORD specify Storage daemon's password],
755 if test "x$withval" != "xno" ; then
761 if test "x$sd_password" = "x" ; then
762 if test "x$OPENSSL" = "xnone" ; then
763 # key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" 123456789uvwxyzabcdef | awk '{getline} {print} {exit}'`
764 key=`autoconf/randpass 41`
766 key=`openssl rand -base64 33`
772 AC_SUBST(dir_password)
773 AC_SUBST(fd_password)
774 AC_SUBST(sd_password)
778 # Handle users and groups for each daemon
781 AC_ARG_WITH(dir_user,
782 [ --with-dir-user=USER specify user for Director daemon],
784 if test "x$withval" != "x" ; then
791 AC_ARG_WITH(dir_group,
792 [ --with-dir-group=GROUP specify group for Director daemon],
794 if test "x$withval" != "x" ; then
802 [ --with-sd-user=USER specify user for Storage daemon],
804 if test "x$withval" != "x" ; then
811 AC_ARG_WITH(sd_group,
812 [ --with-sd-group=GROUP specify group for Storage daemon],
814 if test "x$withval" != "x" ; then
822 [ --with-fd-user=USER specify user for File daemon],
824 if test "x$withval" != "x" ; then
831 AC_ARG_WITH(fd_group,
832 [ --with-fd-group=GROUP specify group for File daemon],
834 if test "x$withval" != "x" ; then
850 # ------------------------------------------------
851 # Bacula check for various SQL database engines
852 # ------------------------------------------------
853 BA_CHECK_POSTGRESQL_DB
862 AC_DEFINE(PROTOTYPES)
864 dnl# --------------------------------------------------------------------------
865 dnl# Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
867 if test -z "$CFLAGS"; then
868 if test -z "$CCOPTS"; then
870 dnl> if test "x$GCC" = xyes; then
871 dnl> if test x$system = xLinux; then
872 dnl> CCOPTS="$CCOPTS "'-O2 -fno-strength-reduce'
883 dnl See if we can use 64 bit file addresses
884 largefile_support="no"
890 dnl# --------------------------------------------------------------------------
891 dnl# CHECKING FOR HEADER FILES
892 dnl# --------------------------------------------------------------------------
927 dnl# --------------------------------------------------------------------------
928 dnl# Check for utime.h structure
929 dnl# --------------------------------------------------------------------------
930 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
932 #include <sys/types.h>
933 #include <utime.h>], [struct utimbuf foo],
934 ba_cv_header_utime_h=yes, ba_cv_header_utime_h=no)])
935 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H)
937 dnl# --------------------------------------------------------------------------
938 dnl# Check for socklen_t
939 dnl# --------------------------------------------------------------------------
940 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
942 #include <sys/types.h>
943 #include <sys/socket.h>],
945 ba_cv_header_socklen_t=yes, ba_cv_header_socklen_t=no)])
946 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T)
948 dnl# --------------------------------------------------------------------------
949 dnl# Check for bigendian
950 dnl# --------------------------------------------------------------------------
951 AC_CACHE_CHECK([for bigendian], ba_cv_bigendian,
953 [main(){long a=1L; char *p=(char *)&a; exit(*p);}],
954 [ba_cv_bigendian=yes],
955 [ba_cv_bigendian=no],
956 [ba_cv_bigendian=no])])
957 test $ba_cv_bigendian = yes && AC_DEFINE(HAVE_BIGENDIAN)
963 dnl# --------------------------------------------------------------------------
964 dnl# CHECKING FOR FILESYSTEM TYPE
965 dnl# --------------------------------------------------------------------------
966 AC_MSG_CHECKING(how to get filesystem type)
968 # The order of these tests is important.
969 AC_TRY_CPP([#include <sys/statvfs.h>
970 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4)
971 if test $fstype = no; then
972 AC_TRY_CPP([#include <sys/statfs.h>
973 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3)
975 if test $fstype = no; then
976 AC_TRY_CPP([#include <sys/statfs.h>
977 #include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX)
979 if test $fstype = no; then
980 AC_TRY_CPP([#include <mntent.h>], AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD)
982 if test $fstype = no; then
983 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
985 if test $fstype = no; then
986 AC_TRY_CPP([#include <sys/mount.h>
987 #include <sys/fs_types.h>], AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix)
989 AC_MSG_RESULT($fstype)
991 dnl# --------------------------------------------------------------------------
992 dnl# CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
993 dnl# --------------------------------------------------------------------------
1001 AC_CHECK_TYPE(ino_t, unsigned long)
1002 AC_CHECK_TYPE(dev_t, unsigned long)
1003 AC_CHECK_TYPE(daddr_t, long)
1004 AC_CHECK_TYPE(major_t, int)
1005 AC_CHECK_TYPE(minor_t, int)
1006 AC_CHECK_TYPE(ssize_t, int)
1013 AC_CHECK_SIZEOF(char, 1)
1014 AC_CHECK_SIZEOF(short int, 2)
1015 AC_CHECK_SIZEOF(int, 4)
1016 AC_CHECK_SIZEOF(long int, 4)
1017 AC_CHECK_SIZEOF(long long int, 8)
1018 AC_CHECK_SIZEOF(int *, 4)
1020 # Check for sys/types.h types
1021 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1023 [ #include <sys/types.h> ],
1025 [ ac_cv_have_u_int="yes" ],
1026 [ ac_cv_have_u_int="no" ]
1029 if test "x$ac_cv_have_u_int" = "xyes" ; then
1030 AC_DEFINE(HAVE_U_INT)
1034 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t, [
1036 [ #include <sys/types.h> ],
1037 [ intmax_t a; a = 1;],
1038 [ ac_cv_have_intmax_t="yes" ],
1041 [ #include <stdint.h> ],
1042 [ intmax_t a; a = 1;],
1043 [ ac_cv_have_intmax_t="yes" ],
1044 [ ac_cv_have_intmax_t="no" ]
1050 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
1051 AC_DEFINE(HAVE_INTMAX_T)
1056 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t, [
1058 [ #include <sys/types.h> ],
1059 [ u_intmax_t a; a = 1;],
1060 [ ac_cv_have_u_intmax_t="yes" ],
1063 [ #include <stdint.h> ],
1064 [ u_intmax_t a; a = 1;],
1065 [ ac_cv_have_u_intmax_t="yes" ],
1066 [ ac_cv_have_u_intmax_t="no" ]
1071 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
1072 AC_DEFINE(HAVE_U_INTMAX_T)
1077 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1079 [ #include <sys/types.h> ],
1080 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1081 [ ac_cv_have_intxx_t="yes" ],
1082 [ ac_cv_have_intxx_t="no" ]
1085 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1086 AC_DEFINE(HAVE_INTXX_T)
1090 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1092 [ #include <sys/types.h> ],
1093 [ int64_t a; a = 1;],
1094 [ ac_cv_have_int64_t="yes" ],
1095 [ ac_cv_have_int64_t="no" ]
1098 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1099 AC_DEFINE(HAVE_INT64_T)
1103 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1105 [ #include <sys/types.h> ],
1106 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1107 [ ac_cv_have_u_intxx_t="yes" ],
1108 [ ac_cv_have_u_intxx_t="no" ]
1111 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1112 AC_DEFINE(HAVE_U_INTXX_T)
1116 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1118 [ #include <sys/types.h> ],
1119 [ u_int64_t a; a = 1;],
1120 [ ac_cv_have_u_int64_t="yes" ],
1121 [ ac_cv_have_u_int64_t="no" ]
1124 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1125 AC_DEFINE(HAVE_U_INT64_T)
1129 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1130 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1132 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1134 [ #include <sys/bitypes.h> ],
1135 [ int8_t a; int16_t b; int32_t c;
1136 u_int8_t e; u_int16_t f; u_int32_t g;
1137 a = b = c = e = f = g = 1; ],
1138 [ AC_DEFINE(HAVE_U_INTXX_T)
1139 AC_DEFINE(HAVE_INTXX_T)
1140 AC_DEFINE(HAVE_SYS_BITYPES_H)
1141 AC_MSG_RESULT(yes) ],
1142 [ AC_MSG_RESULT(no)]
1146 if test -z "$have_u_intxx_t" ; then
1147 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1149 [ #include <sys/types.h> ],
1150 [ uint8_t a; uint16_t b;
1151 uint32_t c; a = b = c = 1; ],
1152 [ ac_cv_have_uintxx_t="yes" ],
1153 [ ac_cv_have_uintxx_t="no" ]
1156 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1157 AC_DEFINE(HAVE_UINTXX_T)
1162 dnl# --------------------------------------------------------------------------
1163 dnl# CHECKING FOR LIBRARY FUNCTIONS
1164 dnl# --------------------------------------------------------------------------
1180 [echo 'configure: cannot find needed function.'; exit 1]
1183 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
1184 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
1186 AC_CHECK_FUNCS(chflags)
1188 AC_CHECK_FUNCS(snprintf vsnprintf gethostid getdomainname)
1190 dnl# --------------------------------------------------------------------------
1191 dnl# CHECKING FOR THREAD SAFE FUNCTIONS
1192 dnl# --------------------------------------------------------------------------
1193 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
1195 # If resolver functions are not in libc check for -lnsl or -lresolv.
1196 AC_CHECK_FUNC(gethostbyname_r,
1197 AC_MSG_RESULT(using libc's resolver),
1198 AC_CHECK_LIB(nsl,gethostbyname_r)
1199 AC_CHECK_LIB(resolv,gethostbyname_r))
1202 # Find where sockets are (especially for Solaris)
1203 AC_CHECK_FUNC(socket,
1204 AC_MSG_RESULT(using libc's socket),
1205 AC_CHECK_LIB(xnet,socket)
1206 AC_CHECK_LIB(socket,socket)
1207 AC_CHECK_LIB(inet,socket))
1209 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
1215 AC_FUNC_CLOSEDIR_VOID
1216 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
1220 dnl# FreeBSD needs to link libxpg4
1221 AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"])
1224 AC_CHECK_LIB(sun, getpwnam)
1226 AC_CHECK_HEADERS(zlib.h)
1227 AC_CHECK_LIB(z, deflate, [FDLIBS="-lz"])
1229 if test x$FDLIBS = x-lz; then
1230 AC_DEFINE(HAVE_LIBZ)
1234 dnl Check for pthread libraries
1236 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
1237 [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
1238 [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
1239 [AC_CHECK_FUNC(pthread_create)]
1249 LDFLAGS=${LDFLAGS--O}
1250 DB_LIBS="${SQL_LFLAGS}"
1252 CPPFLAGS="$CPPFLAGS"
1263 AC_SUBST(X_EXTRA_LIBS)
1267 dnl# extra configurable objects
1278 # Finally we set appropriate distribution specific
1279 # variables and defaults
1281 # PFILES are platform specific files
1282 PFILES="platforms/Makefile"
1289 PSCMD="ps -e -o pid,comm"
1291 platforms/aix/Makefile"
1292 TAPEDRIVE="/dev/rmt0.1"
1296 PTHREAD_LIB="-lpthread -lexc"
1297 if test "${CC}" = "gcc" ; then
1304 TAPEDRIVE="/dev/nrmt0"
1307 DISTVER=`uname -a |awk '{print $3}'`
1308 TAPEDRIVE="/dev/nrmt0"
1309 PTHREAD_LIB="-pthread"
1310 CFLAGS="${CFLAGS} -pthread"
1311 PSCMD="ps -x -o pid,command"
1315 platforms/bsdi/Makefile \
1316 platforms/bsdi/bacula-fd \
1317 platforms/bsdi/bacula-sd \
1318 platforms/bsdi/bacula-dir"
1319 hostname=`hostname -s`
1320 largefile_support="yes"
1323 DISTVER=`uname -a |awk '{print $3}'`
1324 TAPEDRIVE="/dev/nrst0"
1327 WLDFLAGS="-mwindows"
1331 TAPEDRIVE="/dev/nst0"
1332 PSCMD="ps -e -o pid,command"
1333 hostname=`hostname -s`
1335 platforms/darwin/Makefile"
1338 DISTVER=`cat /etc/debian_version`
1339 TAPEDRIVE="/dev/nrst0"
1340 PSCMD="ps -e -o pid,command"
1341 hostname=`hostname -s`
1344 DISTVER=`uname -a |awk '{print $3}'`
1345 VER=`echo $DISTVER | cut -c 1`
1346 if test x$VER = x4 ; then
1347 PTHREAD_LIB="-pthread"
1348 CFLAGS="${CFLAGS} -pthread"
1352 TAPEDRIVE="/dev/nrsa0"
1353 PSCMD="ps -x -o pid,command"
1355 platforms/freebsd/Makefile \
1356 platforms/freebsd/bacula-fd \
1357 platforms/freebsd/bacula-sd \
1358 platforms/freebsd/bacula-dir"
1359 hostname=`hostname -s`
1360 largefile_support="yes"
1364 TAPEDRIVE="/dev/rmt/0hnb"
1368 TAPEDRIVE="/dev/rmt/0cbn"
1369 PSCMD="ps -e -o pid,comm"
1371 platforms/irix/Makefile \
1372 platforms/irix/bacula-fd \
1373 platforms/irix/bacula-sd \
1374 platforms/irix/bacula-dir"
1377 DISTVER=`uname -a |awk '{print $3}'`
1380 TAPEDRIVE="/dev/nrst0"
1381 PSCMD="ps -a -o pid,command"
1382 PTHREAD_LIB="-pthread"
1383 CFLAGS="${CFLAGS} -pthread"
1386 DISTVER=`uname -a |awk '{print $3}'`
1389 TAPEDRIVE="/dev/nrst0"
1390 PSCMD="ps -a -o pid,command"
1391 PTHREAD_LIB="-pthread"
1392 CFLAGS="${CFLAGS} -pthread"
1394 platforms/openbsd/Makefile \
1395 platforms/openbsd/bacula-fd \
1396 platforms/openbsd/bacula-sd \
1397 platforms/openbsd/bacula-dir"
1400 DISTVER=`cat /etc/redhat-release | grep release |\
1402 TAPEDRIVE="/dev/nst0"
1403 PSCMD="ps -e -o pid,command"
1405 platforms/redhat/Makefile \
1406 platforms/redhat/bacula-fd \
1407 platforms/redhat/bacula-sd \
1408 platforms/redhat/bacula-dir \
1409 platforms/redhat/bacula.spec \
1411 hostname=`hostname -s`
1414 DISTVER=`cat /etc/mandrake-release | grep release |\
1416 TAPEDRIVE="/dev/nst0"
1417 PSCMD="ps -e -o pid,command"
1419 platforms/mandrake/Makefile \
1420 platforms/mandrake/bacula-fd \
1421 platforms/mandrake/bacula-sd \
1422 platforms/mandrake/bacula-dir \
1423 platforms/mandrake/bacula.spec \
1425 hostname=`hostname -s`
1428 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
1429 TAPEDRIVE="/dev/nst0"
1430 PSCMD="ps -e -o pid,command"
1432 platforms/gentoo/Makefile \
1433 platforms/gentoo/bacula-fd \
1434 platforms/gentoo/bacula-sd \
1435 platforms/gentoo/bacula-dir"
1436 hostname=`hostname -s`
1440 DISTVER=`cat /etc/slackware-version`
1441 TAPEDRIVE="/dev/nst0"
1442 PSCMD="ps -e -o pid,command"
1443 hostname=`hostname -s`
1447 TAPEDRIVE="/dev/rmt/0cbn"
1448 PSCMD="ps -e -o pid,comm"
1450 platforms/solaris/Makefile \
1451 platforms/solaris/bacula-fd \
1452 platforms/solaris/bacula-sd \
1453 platforms/solaris/bacula-dir"
1454 if test x$DISTVER = x5.6 ; then
1455 AC_DEFINE(HAVE_OLD_SOCKOPT)
1459 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
1461 TAPEDRIVE="/dev/nst0"
1462 PSCMD="ps -e -o pid,command"
1463 hostname=`hostname -s`
1465 platforms/suse/Makefile \
1466 platforms/suse/bacula-fd \
1467 platforms/suse/bacula-sd \
1468 platforms/suse/bacula-dir"
1473 TAPEDRIVE="/dev/nst0"
1474 PSCMD="ps -e -o pid,command"
1475 hostname=`hostname -s`
1477 platforms/suse/Makefile \
1478 platforms/suse/bacula-fd \
1479 platforms/suse/bacula-sd \
1480 platforms/suse/bacula-dir"
1484 TAPEDRIVE="/dev/nst0"
1487 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
1493 LIBS="$PTHREAD_LIB $LIBS"
1495 AC_DEFINE_UNQUOTED(lld, "$lld")
1496 AC_DEFINE_UNQUOTED(llu, "$llu")
1503 dnl# common parts of the Makefile
1504 MCOMMON=./autoconf/Make.common
1505 AC_SUBST_FILE(MCOMMON)
1508 if test "x${subsysdir}" = "x${sbindir}" ; then
1511 echo "You have set both --sbindir and --with-subsys-dir"
1512 echo " equal to: ${subsysdir} "
1513 echo "This is not permitted. Please reconfigure."
1515 echo "Aborting configuration ..."
1521 AC_OUTPUT([autoconf/Make.common \
1524 rescue/linux/Makefile \
1525 rescue/freebsd/Makefile \
1526 rescue/solaris/Makefile \
1527 scripts/startmysql \
1529 scripts/btraceback \
1538 scripts/bacula.desktop.gnome1 \
1539 scripts/bacula.desktop.gnome2 \
1540 scripts/mtx-changer \
1544 src/console/Makefile \
1545 src/console/bconsole.conf \
1546 src/gnome-console/Makefile \
1547 src/gnome-console/gnome-console.conf \
1548 src/gnome2-console/Makefile \
1549 src/gnome2-console/gnome-console.conf \
1550 src/tconsole/Makefile \
1552 src/dird/bacula-dir.conf \
1554 src/stored/Makefile \
1555 src/stored/bacula-sd.conf \
1556 src/filed/Makefile \
1557 src/filed/bacula-fd.conf \
1558 src/filed/win32/Makefile \
1560 src/cats/make_catalog_backup \
1561 src/cats/delete_catalog_backup \
1562 src/cats/create_postgresql_database \
1563 src/cats/update_postgresql_tables \
1564 src/cats/make_postgresql_tables \
1565 src/cats/grant_postgresql_privileges \
1566 src/cats/drop_postgresql_tables \
1567 src/cats/drop_postgresql_database \
1568 src/cats/create_mysql_database \
1569 src/cats/update_mysql_tables \
1570 src/cats/make_mysql_tables \
1571 src/cats/grant_mysql_privileges \
1572 src/cats/drop_mysql_tables \
1573 src/cats/drop_mysql_database \
1574 src/cats/create_sqlite_database \
1575 src/cats/update_sqlite_tables \
1576 src/cats/make_sqlite_tables \
1577 src/cats/grant_sqlite_privileges \
1578 src/cats/drop_sqlite_tables \
1579 src/cats/drop_sqlite_database \
1582 src/cats/create_bdb_database \
1583 src/cats/update_bdb_tables \
1584 src/cats/make_bdb_tables \
1585 src/cats/grant_bdb_privileges \
1586 src/cats/drop_bdb_tables \
1587 src/cats/drop_bdb_database \
1588 src/cats/create_bacula_database \
1589 src/cats/update_bacula_tables \
1590 src/cats/grant_bacula_privileges \
1591 src/cats/make_bacula_tables \
1592 src/cats/drop_bacula_tables \
1593 src/cats/drop_bacula_database \
1594 src/findlib/Makefile \
1595 src/tools/Makefile \
1597 [(echo "Doing make of dependencies"; make depend;) ]
1601 chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
1602 chmod 755 bconsole gconsole mtx-changer
1605 chmod 755 create_bacula_database update_bacula_tables make_bacula_tables
1606 chmod 755 grant_bacula_privileges drop_bacula_tables drop_bacula_database
1608 chmod 755 create_bdb_database update_bdb_tables make_bdb_tables
1609 chmod 755 grant_bdb_privileges drop_bdb_tables drop_bdb_database
1611 chmod 755 create_mysql_database update_mysql_tables make_mysql_tables
1612 chmod 755 grant_mysql_privileges drop_mysql_tables drop_mysql_database
1614 chmod 755 create_postgresql_database update_postgresql_tables make_postgresql_tables
1615 chmod 755 grant_postgresql_privileges drop_postgresql_tables drop_postgresql_database
1617 chmod 755 create_sqlite_database update_sqlite_tables make_sqlite_tables
1618 chmod 755 grant_sqlite_privileges drop_sqlite_tables drop_sqlite_database
1620 chmod 755 src/cats/make_catalog_backup src/cats/delete_catalog_backup
1621 chmod 755 src/cats/sqlite
1622 chmod 755 src/cats/mysql
1624 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
1625 largefile_support="yes"
1629 # A whole lot of hand springs to get the compiler version.
1630 # This is because gcc changed the output in version 3.0
1632 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
1633 if test "x${CCVERSION}" = "x" ; then
1634 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
1636 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
1637 if test x"${CXXVERSION}" = x ; then
1638 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
1641 if test "x${subsysdir}" = "x${sbindir}" ; then
1644 echo "You have set --sbindir and --with-subsys-dir"
1645 echo " both equal to: ${subsysdir} "
1646 echo " This is not permitted. Please reconfigure."
1647 echo "Aborting configuration ..."
1654 Configuration on `date`:
1656 Host: $host -- ${DISTNAME} ${DISTVER}
1657 Bacula version: ${VERSION} (${DATE})
1658 Source code location: ${srcdir}
1659 Install binaries: ${sbindir}
1660 Install config files: ${sysconfdir}
1661 Scripts directory: ${scriptdir}
1662 Working directory: ${working_dir}
1663 PID directory: ${piddir}
1664 Subsys directory: ${subsysdir}
1665 C Compiler: ${CC} ${CCVERSION}
1666 C++ Compiler: ${CXX} ${CXXVERSION}
1667 Compiler flags: ${WCFLAGS} ${CFLAGS}
1668 Linker flags: ${WLDFLAGS} ${LDFLAGS}
1670 Statically Linked Tools: ${support_static_tools}
1671 Statically Linked FD: ${support_static_fd}
1672 Statically Linked SD: ${support_static_sd}
1673 Statically Linked DIR: ${support_static_dir}
1674 Statically Linked CONS: ${support_static_cons}
1675 Database type: ${db_name}
1676 Database lib: ${DB_LIBS}
1678 Job Output Email: ${job_email}
1679 Traceback Email: ${dump_email}
1680 SMTP Host Address: ${smtp_host}
1682 Director Port: ${dir_port}
1683 File daemon Port: ${fd_port}
1684 Storage daemon Port: ${sd_port}
1686 Director User: ${dir_user}
1687 Director Group: ${dir_group}
1688 Storage Daemon User: ${dir_user}
1689 Storage DaemonGroup: ${dir_group}
1690 File Daemon User: ${dir_user}
1691 File Daemon Group: ${dir_group}
1693 SQL binaries Directory ${SQL_BINDIR}
1695 Large file support: $largefile_support
1696 Bacula conio support: ${got_conio} ${CONS_LIBS}
1697 readline support: ${got_readline} ${PRTREADLINE_SRC}
1698 TCP Wrappers support: ${TCPW_MSG}
1699 ZLIB support: ${have_zlib}
1700 enable-smartalloc: ${support_smartalloc}
1701 enable-gnome: ${support_gnome} ${gnome_version}
1702 client-only: ${build_client_only}
1709 # cweb support: ${got_cweb} ${CWEB_SRC}
1710 # gmp support: ${got_gmp} ${GMP_SRC}