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_smartalloc=yes
146 support_static_tools=no
149 support_static_dir=no
150 support_static_cons=no
156 dnl# --------------------------------------------------------------------------
157 dnl# CHECKING COMMAND LINE OPTIONS
158 dnl# --------------------------------------------------------------------------
160 # -------------------------------------------
161 # gnome (default off)
162 # -------------------------------------------
164 [ --enable-gnome enable build of gnome-console GUI [disabled]],
165 [if test x$enableval = xyes; then
170 if test x$support_gnome = xyes; then
171 abc=`$PKGCONFIG --exists libgnomeui-2.0`
173 if test $pkg = 0; then
174 GNOME_INCLUDEDIR=`pkg-config --cflags-only-I libgnomeui-2.0`
175 GNOMEUI_LIBS=`pkg-config --libs-only-l libgnomeui-2.0`
176 GNOME_LIBDIR=`pkg-config --libs libgnomeui-2.0`
177 GNOME_LIBS=`pkg-config --libs-only-l libgnomeui-2.0`
178 AC_SUBST(GNOME_INCLUDEDIR)
179 AC_SUBST(GNOMEUI_LIBS)
180 AC_SUBST(GNOME_LIBDIR)
182 GNOME_DIR=src/gnome2-console
183 gnome_version="version 2.x"
187 GNOME_DIR=src/gnome-console
188 gnome_version="version 1.4"
194 # -------------------------------------------
195 # smartalloc (default off)
196 # -------------------------------------------
197 AC_ARG_ENABLE(smartalloc,
198 [ --enable-smartalloc enable smartalloc debugging support [disabled]],
199 [if test x$enableval = xno; then
200 support_smartalloc=no
203 if test x$support_smartalloc = xyes; then
204 AC_DEFINE(SMARTALLOC)
207 # -------------------------------------------
208 # static-tools (default off)
209 # -------------------------------------------
210 AC_ARG_ENABLE(static-tools,
211 [ --enable-static-tools enable static tape tools [disabled]],
212 [if test x$enableval = xyes; then
213 support_static_tools=yes
217 if test x$support_static_tools = xyes; then
218 TTOOL_LDFLAGS="-static"
220 AC_SUBST(TTOOL_LDFLAGS)
222 # -------------------------------------------
223 # static-fd (default off)
224 # -------------------------------------------
225 AC_ARG_ENABLE(static-fd,
226 [ --enable-static-fd enable static File daemon [disabled]],
227 [if test x$enableval = xyes; then
228 support_static_fd=yes
232 if test x$support_static_fd = xyes; then
233 STATIC_FD="static-bacula-fd"
237 # -------------------------------------------
238 # static-sd (default off)
239 # -------------------------------------------
240 AC_ARG_ENABLE(static-sd,
241 [ --enable-static-sd enable static Storage daemon [disabled]],
242 [if test x$enableval = xyes; then
243 support_static_sd=yes
247 if test x$support_static_sd = xyes; then
248 STATIC_SD="static-bacula-sd"
252 # -------------------------------------------
253 # static-dir (default off)
254 # -------------------------------------------
255 AC_ARG_ENABLE(static-dir,
256 [ --enable-static-dir enable static Director [disabled]],
257 [if test x$enableval = xyes; then
258 support_static_dir=yes
262 if test x$support_static_dir = xyes; then
263 STATIC_DIR="static-bacula-dir"
267 # -------------------------------------------
268 # static-cons (default off)
269 # -------------------------------------------
270 AC_ARG_ENABLE(static-cons,
271 [ --enable-static-cons enable static Console [disabled]],
272 [if test x$enableval = xyes; then
273 support_static_cons=yes
278 if test x$support_static_cons = xyes; then
279 STATIC_CONS="static-console"
280 STATIC_GNOME_CONS="static-gnome-console"
282 AC_SUBST(STATIC_CONS)
283 AC_SUBST(STATIC_GNOME_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 readline support/directory (default on)
302 # ---------------------------------------------------
303 # this allows you to turn it completely off
304 AC_ARG_ENABLE(readline,
305 [ --disable-readline disable readline support [enabled]
307 [if test x$enableval = xno; then
313 if test x$support_readline = xyes; then
314 AC_ARG_WITH(readline,
315 [ --with-readline=DIR specify readline library directory],
317 case "$with_readline" in
320 if test "$with_readline" != "yes"; then
321 CONS_INC="-I${with_readline}"
322 CONS_LDFLAGS="-L$with_readline"
324 with_readline="/usr/include/readline"
326 AC_CHECK_HEADER(${with_readline}/readline.h,
327 [ AC_DEFINE(HAVE_READLINE)
328 CONS_LIBS="-lreadline -ltermcap"
331 [ AC_MSG_ERROR([*** readline library missing])
337 # check for standard readline library
338 AC_CHECK_HEADER(/usr/include/readline/readline.h,
339 [ AC_DEFINE(HAVE_READLINE)
341 CONS_INC="-I/usr/include/readline"
342 CONS_LIBS="-lreadline -ltermcap"
344 # Did not find standard library, so try Bacula's default
345 AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h,
346 [ AC_DEFINE(HAVE_READLINE)
348 CONS_INC="-I${TOP_DIR}/depkgs/readline"
349 CONS_LIBS="-lreadline -lhistory -ltermcap"
350 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
351 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
353 [ AC_MSG_ERROR([*** readline library missing])
363 AC_SUBST(CONS_LDFLAGS)
364 AC_SUBST(READLINE_SRC)
366 # Minimal stuff for readline Makefile configuration
373 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr setlocale lstat lchown)
374 AC_CHECK_FUNCS(nanosleep)
376 AC_CHECK_HEADERS(varargs.h)
378 # End of readline stuff
379 # -----------------------------------------------------------------------
382 # ---------------------------------------------------
383 # Check for GMP support/directory
384 # ---------------------------------------------------
388 # [ --with-gmp[=DIR] Specify gmp library directory],
390 # case "$with_gmp" in
393 # if test "$with_gmp" != "yes"; then
394 # GMP_INC="-I$with_gmp"
396 # GMP_LDFLAGS="-L$with_gmp"
398 # with_gmp="/usr/include"
400 # AC_CHECK_HEADER($with_gmp/gmp.h,
401 # [ AC_MSG_RESULT(yes)
402 # AC_DEFINE(HAVE_GMP)
406 # [ AC_MSG_ERROR([*** gmp library missing])
412 # # check for standard gmp library
413 # AC_CHECK_HEADER(/usr/include/gmp.h,
414 # [ AC_MSG_RESULT(yes)
415 # AC_DEFINE(HAVE_GMP)
420 # # Did not find standard library, so use our own
422 # AC_DEFINE(HAVE_GMP)
425 # GMP_INC="-I${TOP_DIR}/depkgs/gmp"
427 # GMP_LDFLAGS="-L${TOP_DIR}/depkgs/gmp"
428 # GMP_SRC="${TOP_DIR}/depkgs/gmp"
434 #AC_SUBST(GMP_LDFLAGS)
438 # -----------------------------------------------------------------------
441 # ---------------------------------------------------
442 # Check for CWEB support/directory
443 # ---------------------------------------------------
448 # [ --with-cweb[=DIR] Specify cweb library directory],
450 # case "$with_cweb" in
453 # if test "$with_cweb" != "yes"; then
454 # CWEB_INC="-I$with_cweb"
456 # CWEB_LDFLAGS="-L$with_cweb"
458 # with_cweb="/usr/include"
460 # AC_CHECK_HEADER($with_cweb/cweb.h,
461 # [ AC_MSG_RESULT(yes)
462 # AC_DEFINE(HAVE_CWEB)
466 # [ AC_MSG_ERROR([*** cweb library missing])
472 # # check for standard cweb library
473 # AC_CHECK_HEADER(/usr/include/cweb.h,
474 # [ AC_MSG_RESULT(yes)
475 # AC_DEFINE(HAVE_CWEB)
480 # # Did not find starndard library, so use our own
482 # AC_DEFINE(HAVE_CWEB)
485 # CWEB=${TOP_DIR}/depkgs/cweb
486 # CWEB_INC="-I${TOP_DIR}/depkgs/cweb"
488 # CWEB_LDFLAGS="-L${TOP_DIR}/depkgs/cweb"
489 # CWEB_SRC="${TOP_DIR}/depkgs/cweb"
496 #AC_SUBST(CWEB_LDFLAGS)
500 # -----------------------------------------------------------------------
504 # -----------------------------------------------------------
505 # Check whether user wants TCP wrappers support (default off)
506 # -----------------------------------------------------------
508 AC_ARG_WITH(tcp-wrappers,
509 [ --with-tcp-wrappers=DIR enable tcpwrappers support],
511 if test "x$withval" != "xno" ; then
513 LIBS="$saved_LIBS -lwrap"
514 AC_MSG_CHECKING(for libwrap)
517 int deny_severity = 0;
518 int allow_severity = 0;
519 struct request_info *req; ],
520 [ hosts_access(req); ],
523 AC_DEFINE(HAVE_LIBWRAP)
526 LIBS="$saved_LIBS -lwrap -lnsl"
529 int deny_severity = 0;
530 int allow_severity = 0;
531 struct request_info *req; ],
532 [ hosts_access(req); ],
535 AC_DEFINE(HAVE_LIBWRAP)
538 [AC_MSG_ERROR([*** libwrap missing]) ] ]
545 # ------------------------------------------
546 # Where to place working dir
547 # ------------------------------------------
548 working_dir=`eval echo ${sysconfdir}/working`
549 AC_ARG_WITH(working-dir,
550 [ --with-working-dir=PATH specify path of Bacula working directory],
552 if test "x$withval" != "xno" ; then
558 AC_SUBST(working_dir)
561 # ------------------------------------------
562 # Where to place scriptdir (script files)
563 # ------------------------------------------
564 scriptdir=`eval echo ${sysconfdir}`
565 AC_ARG_WITH(scriptdir,
566 [ --with-scriptdir=PATH specify path of Bacula scripts directory],
568 if test "x$withval" != "xno" ; then
577 # ------------------------------------------
578 # Where to send dump email
579 # ------------------------------------------
580 dump_email=root@localhost
581 AC_ARG_WITH(dump-email,
582 [ --with-dump-email=EMAIL dump email address],
584 if test "x$withval" != "xno" ; then
592 # ------------------------------------------
593 # Where to send job email
594 # ------------------------------------------
595 job_email=root@localhost
596 AC_ARG_WITH(job-email,
597 [ --with-job-email=EMAIL job output email address],
599 if test "x$withval" != "xno" ; then
607 # ------------------------------------------
608 # Where to find smtp host
609 # ------------------------------------------
611 AC_ARG_WITH(smtp_host,
612 [ --with-smtp-host=HOST SMTP mail host address],
614 if test "x$withval" != "xno" ; then
623 # ------------------------------------
624 # Where to place pid files
625 # ------------------------------------
628 [ --with-pid-dir=PATH specify location of Bacula pid files],
630 if test "x$withval" != "xno" ; then
636 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
640 # ------------------------------------
641 # Where to place subsys "lock file"
642 # ------------------------------------
643 subsysdir=/var/run/subsys
644 AC_ARG_WITH(subsys-dir,
645 [ --with-subsys-dir=PATH specify location of Bacula subsys file],
647 if test "x$withval" != "xno" ; then
657 # ------------------------------------
658 # Where to start assigning ports
659 # ------------------------------------
661 AC_ARG_WITH(baseport,
662 [ --with-baseport=PORT specify base port address for daemons],
664 if test "x$withval" != "xno" ; then
671 dir_port=`expr $baseport`
672 fd_port=`expr $baseport + 1`
673 sd_port=`expr $fd_port + 1`
680 # ------------------------------------------
682 # ------------------------------------------
684 AC_ARG_WITH(dir-password,
685 [ --with-dir-password=PASSWORD specify Director's password],
687 if test "x$withval" != "xno" ; then
688 dir_password=$withval
693 if test "x$dir_password" = "x" ; then
694 if test "x$OPENSSL" = "xnone" ; then
695 # key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" abcdefghijklmnopqrst | awk '{getline} {print} {exit}'`
696 key=`autoconf/randpass 33`
698 key=`openssl rand -base64 33`
704 AC_ARG_WITH(fd-password,
705 [ --with-fd-password=PASSWORD specify Client's password],
707 if test "x$withval" != "xno" ; then
713 if test "x$fd_password" = "x" ; then
714 if test "x$OPENSSL" = "xnone" ; then
715 # key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" tsrqponmlkjihgfedcba | awk '{getline} {print} {exit}'`
716 key=`autoconf/randpass 37`
718 key=`openssl rand -base64 33`
724 AC_ARG_WITH(sd-password,
725 [ --with-sd-password=PASSWORD specify Storage daemon's password],
727 if test "x$withval" != "xno" ; then
733 if test "x$sd_password" = "x" ; then
734 if test "x$OPENSSL" = "xnone" ; then
735 # key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" 123456789uvwxyzabcdef | awk '{getline} {print} {exit}'`
736 key=`autoconf/randpass 41`
738 key=`openssl rand -base64 33`
744 AC_SUBST(dir_password)
745 AC_SUBST(fd_password)
746 AC_SUBST(sd_password)
750 # Handle users and groups for each daemon
753 AC_ARG_WITH(dir_user,
754 [ --with-dir-user=USER specify user for Director daemon],
756 if test "x$withval" != "x" ; then
763 AC_ARG_WITH(dir_group,
764 [ --with-dir-group=GROUP specify group for Director daemon],
766 if test "x$withval" != "x" ; then
774 [ --with-sd-user=USER specify user for Storage daemon],
776 if test "x$withval" != "x" ; then
783 AC_ARG_WITH(sd_group,
784 [ --with-sd-group=GROUP specify group for Storage daemon],
786 if test "x$withval" != "x" ; then
794 [ --with-fd-user=USER specify user for File daemon],
796 if test "x$withval" != "x" ; then
803 AC_ARG_WITH(fd_group,
804 [ --with-fd-group=GROUP specify group for File daemon],
806 if test "x$withval" != "x" ; then
822 # ------------------------------------------------
823 # Bacula check for various SQL database engines
824 # ------------------------------------------------
828 # ------------------------------------------------
829 # Bacula check for various SQL database engines
830 # ------------------------------------------------
836 AC_DEFINE(PROTOTYPES)
838 dnl# --------------------------------------------------------------------------
839 dnl# Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
841 if test -z "$CFLAGS"; then
842 if test -z "$CCOPTS"; then
844 dnl> if test "x$GCC" = xyes; then
845 dnl> if test x$system = xLinux; then
846 dnl> CCOPTS="$CCOPTS "'-O2 -fno-strength-reduce'
857 dnl See if we can use 64 bit file addresses
858 largefile_support="no"
864 dnl# --------------------------------------------------------------------------
865 dnl# CHECKING FOR HEADER FILES
866 dnl# --------------------------------------------------------------------------
901 dnl# --------------------------------------------------------------------------
902 dnl# Check for utime.h structure
903 dnl# --------------------------------------------------------------------------
904 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
906 #include <sys/types.h>
907 #include <utime.h>], [struct utimbuf foo],
908 ba_cv_header_utime_h=yes, ba_cv_header_utime_h=no)])
909 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H)
911 dnl# --------------------------------------------------------------------------
912 dnl# Check for socklen_t
913 dnl# --------------------------------------------------------------------------
914 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
916 #include <sys/types.h>
917 #include <sys/socket.h>],
919 ba_cv_header_socklen_t=yes, ba_cv_header_socklen_t=no)])
920 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T)
922 dnl# --------------------------------------------------------------------------
923 dnl# Check for bigendian
924 dnl# --------------------------------------------------------------------------
925 AC_CACHE_CHECK([for bigendian], ba_cv_bigendian,
927 [main(){long a=1L; char *p=(char *)&a; exit(*p);}],
928 [ba_cv_bigendian=yes],
929 [ba_cv_bigendian=no],
930 [ba_cv_bigendian=no])])
931 test $ba_cv_bigendian = yes && AC_DEFINE(HAVE_BIGENDIAN)
937 dnl# --------------------------------------------------------------------------
938 dnl# CHECKING FOR FILESYSTEM TYPE
939 dnl# --------------------------------------------------------------------------
940 AC_MSG_CHECKING(how to get filesystem type)
942 # The order of these tests is important.
943 AC_TRY_CPP([#include <sys/statvfs.h>
944 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4)
945 if test $fstype = no; then
946 AC_TRY_CPP([#include <sys/statfs.h>
947 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3)
949 if test $fstype = no; then
950 AC_TRY_CPP([#include <sys/statfs.h>
951 #include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX)
953 if test $fstype = no; then
954 AC_TRY_CPP([#include <mntent.h>], AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD)
956 if test $fstype = no; then
957 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
959 if test $fstype = no; then
960 AC_TRY_CPP([#include <sys/mount.h>
961 #include <sys/fs_types.h>], AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix)
963 AC_MSG_RESULT($fstype)
965 dnl# --------------------------------------------------------------------------
966 dnl# CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
967 dnl# --------------------------------------------------------------------------
975 AC_CHECK_TYPE(ino_t, unsigned long)
976 AC_CHECK_TYPE(dev_t, unsigned long)
977 AC_CHECK_TYPE(daddr_t, long)
978 AC_CHECK_TYPE(major_t, int)
979 AC_CHECK_TYPE(minor_t, int)
980 AC_CHECK_TYPE(ssize_t, int)
987 AC_CHECK_SIZEOF(char, 1)
988 AC_CHECK_SIZEOF(short int, 2)
989 AC_CHECK_SIZEOF(int, 4)
990 AC_CHECK_SIZEOF(long int, 4)
991 AC_CHECK_SIZEOF(long long int, 8)
992 AC_CHECK_SIZEOF(int *, 4)
994 # Check for sys/types.h types
995 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
997 [ #include <sys/types.h> ],
999 [ ac_cv_have_u_int="yes" ],
1000 [ ac_cv_have_u_int="no" ]
1003 if test "x$ac_cv_have_u_int" = "xyes" ; then
1004 AC_DEFINE(HAVE_U_INT)
1008 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t, [
1010 [ #include <sys/types.h> ],
1011 [ intmax_t a; a = 1;],
1012 [ ac_cv_have_intmax_t="yes" ],
1015 [ #include <stdint.h> ],
1016 [ intmax_t a; a = 1;],
1017 [ ac_cv_have_intmax_t="yes" ],
1018 [ ac_cv_have_intmax_t="no" ]
1024 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
1025 AC_DEFINE(HAVE_INTMAX_T)
1030 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t, [
1032 [ #include <sys/types.h> ],
1033 [ u_intmax_t a; a = 1;],
1034 [ ac_cv_have_u_intmax_t="yes" ],
1037 [ #include <stdint.h> ],
1038 [ u_intmax_t a; a = 1;],
1039 [ ac_cv_have_u_intmax_t="yes" ],
1040 [ ac_cv_have_u_intmax_t="no" ]
1045 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
1046 AC_DEFINE(HAVE_U_INTMAX_T)
1051 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1053 [ #include <sys/types.h> ],
1054 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1055 [ ac_cv_have_intxx_t="yes" ],
1056 [ ac_cv_have_intxx_t="no" ]
1059 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1060 AC_DEFINE(HAVE_INTXX_T)
1064 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1066 [ #include <sys/types.h> ],
1067 [ int64_t a; a = 1;],
1068 [ ac_cv_have_int64_t="yes" ],
1069 [ ac_cv_have_int64_t="no" ]
1072 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1073 AC_DEFINE(HAVE_INT64_T)
1077 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1079 [ #include <sys/types.h> ],
1080 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1081 [ ac_cv_have_u_intxx_t="yes" ],
1082 [ ac_cv_have_u_intxx_t="no" ]
1085 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1086 AC_DEFINE(HAVE_U_INTXX_T)
1090 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1092 [ #include <sys/types.h> ],
1093 [ u_int64_t a; a = 1;],
1094 [ ac_cv_have_u_int64_t="yes" ],
1095 [ ac_cv_have_u_int64_t="no" ]
1098 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1099 AC_DEFINE(HAVE_U_INT64_T)
1103 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1104 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1106 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1108 [ #include <sys/bitypes.h> ],
1109 [ int8_t a; int16_t b; int32_t c;
1110 u_int8_t e; u_int16_t f; u_int32_t g;
1111 a = b = c = e = f = g = 1; ],
1112 [ AC_DEFINE(HAVE_U_INTXX_T)
1113 AC_DEFINE(HAVE_INTXX_T)
1114 AC_DEFINE(HAVE_SYS_BITYPES_H)
1115 AC_MSG_RESULT(yes) ],
1116 [ AC_MSG_RESULT(no)]
1120 if test -z "$have_u_intxx_t" ; then
1121 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1123 [ #include <sys/types.h> ],
1124 [ uint8_t a; uint16_t b;
1125 uint32_t c; a = b = c = 1; ],
1126 [ ac_cv_have_uintxx_t="yes" ],
1127 [ ac_cv_have_uintxx_t="no" ]
1130 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1131 AC_DEFINE(HAVE_UINTXX_T)
1136 dnl# --------------------------------------------------------------------------
1137 dnl# CHECKING FOR LIBRARY FUNCTIONS
1138 dnl# --------------------------------------------------------------------------
1154 [echo 'configure: cannot find needed function.'; exit 1]
1157 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
1158 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
1160 AC_CHECK_FUNCS(chflags)
1162 AC_CHECK_FUNCS(snprintf vsnprintf gethostid getdomainname)
1164 dnl# --------------------------------------------------------------------------
1165 dnl# CHECKING FOR THREAD SAFE FUNCTIONS
1166 dnl# --------------------------------------------------------------------------
1167 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
1169 # If resolver functions are not in libc check for -lnsl or -lresolv.
1170 AC_CHECK_FUNC(gethostbyname_r,
1171 AC_MSG_RESULT(using libc's resolver),
1172 AC_CHECK_LIB(nsl,gethostbyname_r)
1173 AC_CHECK_LIB(resolv,gethostbyname_r))
1176 # Find where sockets are (especially for Solaris)
1177 AC_CHECK_FUNC(socket,
1178 AC_MSG_RESULT(using libc's socket),
1179 AC_CHECK_LIB(xnet,socket)
1180 AC_CHECK_LIB(socket,socket)
1181 AC_CHECK_LIB(inet,socket))
1183 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
1189 AC_FUNC_CLOSEDIR_VOID
1190 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
1194 dnl# FreeBSD needs to link libxpg4
1195 AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"])
1198 AC_CHECK_LIB(sun, getpwnam)
1200 AC_CHECK_HEADERS(zlib.h)
1201 AC_CHECK_LIB(z, deflate, [FDLIBS="-lz"])
1203 if test x$FDLIBS = x-lz; then
1204 AC_DEFINE(HAVE_LIBZ)
1208 dnl Check for pthread libraries
1210 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
1211 [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
1212 [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
1213 [AC_CHECK_FUNC(pthread_create)]
1223 LDFLAGS=${LDFLAGS--O}
1224 DB_LIBS="${SQL_LFLAGS}"
1226 CPPFLAGS="$CPPFLAGS"
1237 AC_SUBST(X_EXTRA_LIBS)
1241 dnl# extra configurable objects
1252 # Finally we set appropriate distribution specific
1253 # variables and defaults
1255 # PFILES are platform specific files
1256 PFILES="platforms/Makefile"
1263 PSCMD="ps -e -o pid,comm"
1265 platforms/aix/Makefile"
1266 TAPEDRIVE="/dev/rmt0.1"
1270 PTHREAD_LIB="-lpthread -lexc"
1271 if test "${CC}" = "gcc" ; then
1278 TAPEDRIVE="/dev/nrmt0"
1281 DISTVER=`uname -a |awk '{print $3}'`
1282 TAPEDRIVE="/dev/nrmt0"
1283 PTHREAD_LIB="-pthread"
1284 CFLAGS="${CFLAGS} -pthread"
1285 PSCMD="ps -x -o pid,command"
1289 platforms/bsdi/Makefile \
1290 platforms/bsdi/bacula-fd \
1291 platforms/bsdi/bacula-sd \
1292 platforms/bsdi/bacula-dir"
1293 hostname=`hostname -s`
1294 largefile_support="yes"
1297 DISTVER=`uname -a |awk '{print $3}'`
1298 TAPEDRIVE="/dev/nrst0"
1301 WLDFLAGS="-mwindows"
1305 TAPEDRIVE="/dev/nst0"
1306 PSCMD="ps -e -o pid,command"
1307 hostname=`hostname -s`
1309 platforms/darwin/Makefile"
1312 DISTVER=`cat /etc/debian_version`
1313 TAPEDRIVE="/dev/nrst0"
1314 PSCMD="ps -e -o pid,command"
1315 hostname=`hostname -s`
1318 DISTVER=`uname -a |awk '{print $3}'`
1319 VER=`echo $DISTVER | cut -c 1`
1320 if test x$VER = x4 ; then
1321 PTHREAD_LIB="-pthread"
1322 CFLAGS="${CFLAGS} -pthread"
1326 TAPEDRIVE="/dev/nrsa0"
1327 PSCMD="ps -x -o pid,command"
1329 platforms/freebsd/Makefile \
1330 platforms/freebsd/bacula-fd \
1331 platforms/freebsd/bacula-sd \
1332 platforms/freebsd/bacula-dir"
1333 hostname=`hostname -s`
1334 largefile_support="yes"
1338 TAPEDRIVE="/dev/rmt/0hnb"
1342 TAPEDRIVE="/dev/rmt/0cbn"
1343 PSCMD="ps -e -o pid,comm"
1345 platforms/irix/Makefile \
1346 platforms/irix/bacula-fd \
1347 platforms/irix/bacula-sd \
1348 platforms/irix/bacula-dir"
1351 DISTVER=`uname -a |awk '{print $3}'`
1354 TAPEDRIVE="/dev/nrst0"
1355 PSCMD="ps -a -o pid,command"
1356 PTHREAD_LIB="-pthread"
1357 CFLAGS="${CFLAGS} -pthread"
1360 DISTVER=`uname -a |awk '{print $3}'`
1363 TAPEDRIVE="/dev/nrst0"
1364 PSCMD="ps -a -o pid,command"
1365 PTHREAD_LIB="-pthread"
1366 CFLAGS="${CFLAGS} -pthread"
1368 platforms/openbsd/Makefile \
1369 platforms/openbsd/bacula-fd \
1370 platforms/openbsd/bacula-sd \
1371 platforms/openbsd/bacula-dir"
1374 DISTVER=`cat /etc/redhat-release | grep release |\
1376 TAPEDRIVE="/dev/nst0"
1377 PSCMD="ps -e -o pid,command"
1379 platforms/redhat/Makefile \
1380 platforms/redhat/bacula-fd \
1381 platforms/redhat/bacula-sd \
1382 platforms/redhat/bacula-dir \
1383 platforms/redhat/bacula.spec \
1385 hostname=`hostname -s`
1388 DISTVER=`cat /etc/mandrake-release | grep release |\
1390 TAPEDRIVE="/dev/nst0"
1391 PSCMD="ps -e -o pid,command"
1393 platforms/mandrake/Makefile \
1394 platforms/mandrake/bacula-fd \
1395 platforms/mandrake/bacula-sd \
1396 platforms/mandrake/bacula-dir \
1397 platforms/mandrake/bacula.spec \
1399 hostname=`hostname -s`
1402 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
1403 TAPEDRIVE="/dev/nst0"
1404 PSCMD="ps -e -o pid,command"
1406 platforms/gentoo/Makefile \
1407 platforms/gentoo/bacula-fd \
1408 platforms/gentoo/bacula-sd \
1409 platforms/gentoo/bacula-dir"
1410 hostname=`hostname -s`
1414 DISTVER=`cat /etc/slackware-version`
1415 TAPEDRIVE="/dev/nst0"
1416 PSCMD="ps -e -o pid,command"
1417 hostname=`hostname -s`
1421 TAPEDRIVE="/dev/rmt/0cbn"
1422 PSCMD="ps -e -o pid,comm"
1424 platforms/solaris/Makefile \
1425 platforms/solaris/bacula-fd \
1426 platforms/solaris/bacula-sd \
1427 platforms/solaris/bacula-dir"
1428 if test x$DISTVER = x5.6 ; then
1429 AC_DEFINE(HAVE_OLD_SOCKOPT)
1433 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
1435 TAPEDRIVE="/dev/nst0"
1436 PSCMD="ps -e -o pid,command"
1437 hostname=`hostname -s`
1439 platforms/suse/Makefile \
1440 platforms/suse/bacula-fd \
1441 platforms/suse/bacula-sd \
1442 platforms/suse/bacula-dir"
1447 TAPEDRIVE="/dev/nst0"
1448 PSCMD="ps -e -o pid,command"
1449 hostname=`hostname -s`
1451 platforms/suse/Makefile \
1452 platforms/suse/bacula-fd \
1453 platforms/suse/bacula-sd \
1454 platforms/suse/bacula-dir"
1458 TAPEDRIVE="/dev/nst0"
1461 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
1467 LIBS="$PTHREAD_LIB $LIBS"
1469 AC_DEFINE_UNQUOTED(lld, "$lld")
1470 AC_DEFINE_UNQUOTED(llu, "$llu")
1477 dnl# common parts of the Makefile
1478 MCOMMON=./autoconf/Make.common
1479 AC_SUBST_FILE(MCOMMON)
1482 if test "x${subsysdir}" = "x${sbindir}" ; then
1485 echo "You have set both --sbindir and --with-subsys-dir"
1486 echo " equal to: ${subsysdir} "
1487 echo "This is not permitted. Please reconfigure."
1489 echo "Aborting configuration ..."
1495 AC_OUTPUT([autoconf/Make.common \
1498 rescue/linux/Makefile \
1499 rescue/freebsd/Makefile \
1500 rescue/solaris/Makefile \
1501 scripts/startmysql \
1503 scripts/btraceback \
1512 scripts/bacula.desktop.gnome1 \
1513 scripts/bacula.desktop.gnome2 \
1514 scripts/mtx-changer \
1518 src/console/Makefile \
1519 src/console/console.conf \
1520 src/gnome-console/Makefile \
1521 src/gnome-console/gnome-console.conf \
1522 src/gnome2-console/Makefile \
1523 src/gnome2-console/gnome-console.conf \
1524 src/tconsole/Makefile \
1526 src/dird/bacula-dir.conf \
1528 src/stored/Makefile \
1529 src/stored/bacula-sd.conf \
1530 src/filed/Makefile \
1531 src/filed/bacula-fd.conf \
1532 src/filed/win32/Makefile \
1534 src/cats/make_catalog_backup \
1535 src/cats/delete_catalog_backup \
1536 src/cats/make_mysql_tables \
1537 src/cats/drop_mysql_tables \
1538 src/cats/update_mysql_tables \
1539 src/cats/create_mysql_database \
1540 src/cats/grant_mysql_privileges \
1541 src/cats/make_sqlite_tables \
1542 src/cats/drop_sqlite_tables \
1543 src/cats/update_sqlite_tables \
1544 src/cats/create_sqlite_database \
1547 src/cats/create_bdb_database \
1548 src/cats/make_bdb_tables \
1549 src/cats/drop_bdb_tables \
1550 src/cats/make_bacula_tables \
1551 src/cats/drop_bacula_tables \
1552 src/cats/update_bacula_tables \
1553 src/findlib/Makefile \
1554 src/tools/Makefile \
1556 [(echo "Doing make of dependencies"; make depend;) ]
1560 chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
1561 chmod 755 console gconsole mtx-changer
1563 chmod 755 src/cats/make_mysql_tables src/cats/drop_mysql_tables
1564 chmod 755 src/cats/make_test_tables src/cats/drop_test_tables
1565 chmod 755 src/cats/create_mysql_database
1566 chmod 755 src/cats/make_catalog_backup src/cats/delete_catalog_backup
1567 chmod 755 src/cats/grant_mysql_privileges
1568 chmod 755 src/cats/make_sqlite_tables src/cats/drop_sqlite_tables
1569 chmod 755 src/cats/update_sqlite_tables
1570 chmod 755 src/cats/make_bacula_tables src/cats/drop_bacula_tables
1571 chmod 755 src/cats/update_mysql_tables
1572 chmod 755 src/cats/update_bacula_tables src/cats/update_mysql_tables
1573 chmod 755 src/cats/create_sqlite_database
1574 chmod 755 src/cats/sqlite
1575 chmod 755 src/cats/make_bdb_tables src/cats/drop_bdb_tables
1576 chmod 755 src/cats/create_bdb_database
1578 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
1579 largefile_support="yes"
1583 # A whole lot of hand springs to get the compiler version.
1584 # This is because gcc changed the output in version 3.0
1586 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
1587 if test "x${CCVERSION}" = "x" ; then
1588 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
1590 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
1591 if test x"${CXXVERSION}" = x ; then
1592 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
1595 if test "x${subsysdir}" = "x${sbindir}" ; then
1598 echo "You have set --sbindir and --with-subsys-dir"
1599 echo " both equal to: ${subsysdir} "
1600 echo " This is not permitted. Please reconfigure."
1601 echo "Aborting configuration ..."
1608 Configuration on `date`:
1610 Host: $host -- ${DISTNAME} ${DISTVER}
1611 Bacula version: ${VERSION} (${DATE})
1612 Source code location: ${srcdir}
1613 Install binaries: ${sbindir}
1614 Install config files: ${sysconfdir}
1615 Scripts directory: ${scriptdir}
1616 Working directory: ${working_dir}
1617 PID directory: ${piddir}
1618 Subsys directory: ${subsysdir}
1619 C Compiler: ${CC} ${CCVERSION}
1620 C++ Compiler: ${CXX} ${CXXVERSION}
1621 Compiler flags: ${WCFLAGS} ${CFLAGS}
1622 Linker flags: ${WLDFLAGS} ${LDFLAGS}
1624 Statically Linked Tools: ${support_static_tools}
1625 Statically Linked FD: ${support_static_fd}
1626 Statically Linked SD: ${support_static_sd}
1627 Statically Linked DIR: ${support_static_dir}
1628 Statically Linked CONS: ${support_static_cons}
1629 Database type: ${db_name}
1630 Database lib: ${DB_LIBS}
1632 Job Output Email: ${job_email}
1633 Traceback Email: ${dump_email}
1634 SMTP Host Address: ${smtp_host}
1636 Director Port: ${dir_port}
1637 File daemon Port: ${fd_port}
1638 Storage daemon Port: ${sd_port}
1640 Director User: ${dir_user}
1641 Director Group: ${dir_group}
1642 Storage Daemon User: ${dir_user}
1643 Storage DaemonGroup: ${dir_group}
1644 File Daemon User: ${dir_user}
1645 File Daemon Group: ${dir_group}
1647 SQL binaries Directory ${SQL_BINDIR}
1649 Large file support: $largefile_support
1650 readline support: ${got_readline} ${PRTREADLINE_SRC}
1651 TCP Wrappers support: ${TCPW_MSG}
1652 ZLIB support: ${have_zlib}
1653 enable-smartalloc: ${support_smartalloc}
1654 enable-gnome: ${support_gnome} ${gnome_version}
1655 client-only: ${build_client_only}
1662 # cweb support: ${got_cweb} ${CWEB_SRC}
1663 # gmp support: ${got_gmp} ${GMP_SRC}