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]*DATE.*"\(.*\)"$/\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)
65 test -n "$ARFLAG" || ARFLAGS="cr"
72 AC_SUBST(LOCAL_CFLAGS)
73 AC_SUBST(LOCAL_LDFLAGS)
78 dnl --------------------------------------------------
79 dnl Bacula OP Sys determination (see aclocal.m4)
80 dnl --------------------------------------------------
83 # -----------------------------------------------------------
84 dnl Bacula OPSys Distribution determination (see aclocal.m4)
85 # ----------------------------------------------------------
86 BA_CHECK_OPSYS_DISTNAME
88 # -----------------------------------------------------------
89 dnl Check for gnome stuff for gnome-console
90 # ----------------------------------------------------------
91 AM_ACLOCAL_INCLUDE(gnome-macros)
93 # ------------------------------------------------------------------
94 # If the user has not set --prefix, we set our default to nothing.
95 # In this case, if the user has not set --sysconfdir, we set it
96 # to the package default of /etc/bacula. If either --prefix or
97 # --sysconfdir is set, we leave sysconfdir alone except to eval it.
98 # ------------------------------------------------------------------
99 if test x${prefix} = xNONE ; then
100 if test `eval echo ${sysconfdir}` = NONE/etc ; then
101 sysconfdir=/etc/bacula
105 sysconfdir=`eval echo ${sysconfdir}`
107 # -------------------------------------------------------------------------
108 # If the user has not set --exec-prefix, we default to ${prefix}
109 # -------------------------------------------------------------------------
110 if test x${exec_prefix} = xNONE ; then
111 exec_prefix=${prefix}
114 # ------------------------------------------------------------------
115 # If the user has not set --sbindir, we set our default as /sbin
116 # ------------------------------------------------------------------
117 if test x$sbindir = x'${exec_prefix}/sbin' ; then
118 sbindir=${exec_prefix}/sbin
120 sbindir=`eval echo ${sbindir}`
122 # ------------------------------------------------------------------
123 # All list of languages for which a translation exist. Each
124 # language is separated by a space.
125 # ------------------------------------------------------------------
128 AC_PATH_PROGS(MSGFMT, msgfmt, no)
129 if test "$MSGFMT" = "no"
131 echo 'msgfmt program not found, disabling NLS !'
133 USE_INCLUDED_LIBINTL=no
141 support_smartalloc=yes
144 support_static_tools=no
147 support_static_dir=no
148 support_static_cons=no
154 dnl# --------------------------------------------------------------------------
155 dnl# CHECKING COMMAND LINE OPTIONS
156 dnl# --------------------------------------------------------------------------
158 # -------------------------------------------
159 # gnome (default off)
160 # -------------------------------------------
162 [ --enable-gnome enable build of gnome-console GUI [disabled]],
163 [if test x$enableval = xyes; then
168 if test x$support_gnome = xyes; then
170 GNOME_DIR=src/gnome-console
175 # -------------------------------------------
176 # smartalloc (default off)
177 # -------------------------------------------
178 AC_ARG_ENABLE(smartalloc,
179 [ --enable-smartalloc enable smartalloc debugging support [disabled]],
180 [if test x$enableval = xno; then
181 support_smartalloc=no
184 if test x$support_smartalloc = xyes; then
185 AC_DEFINE(SMARTALLOC)
188 # -------------------------------------------
189 # static-tools (default off)
190 # -------------------------------------------
191 AC_ARG_ENABLE(static-tools,
192 [ --enable-static-tools enable static tape tools [disabled]],
193 [if test x$enableval = xyes; then
194 support_static_tools=yes
198 if test x$support_static_tools = xyes; then
199 TTOOL_LDFLAGS="-static"
201 AC_SUBST(TTOOL_LDFLAGS)
203 # -------------------------------------------
204 # static-fd (default off)
205 # -------------------------------------------
206 AC_ARG_ENABLE(static-fd,
207 [ --enable-static-fd enable static File daemon [disabled]],
208 [if test x$enableval = xyes; then
209 support_static_fd=yes
213 if test x$support_static_fd = xyes; then
214 STATIC_FD="static-bacula-fd"
218 # -------------------------------------------
219 # static-sd (default off)
220 # -------------------------------------------
221 AC_ARG_ENABLE(static-sd,
222 [ --enable-static-sd enable static Storage daemon [disabled]],
223 [if test x$enableval = xyes; then
224 support_static_sd=yes
228 if test x$support_static_sd = xyes; then
229 STATIC_SD="static-bacula-sd"
233 # -------------------------------------------
234 # static-dir (default off)
235 # -------------------------------------------
236 AC_ARG_ENABLE(static-dir,
237 [ --enable-static-dir enable static Director [disabled]],
238 [if test x$enableval = xyes; then
239 support_static_dir=yes
243 if test x$support_static_dir = xyes; then
244 STATIC_DIR="static-bacula-dir"
248 # -------------------------------------------
249 # static-cons (default off)
250 # -------------------------------------------
251 AC_ARG_ENABLE(static-cons,
252 [ --enable-static-cons enable static Console [disabled]],
253 [if test x$enableval = xyes; then
254 support_static_cons=yes
258 if test x$support_static_cons = xyes; then
259 STATIC_CONS="static-console"
261 AC_SUBST(STATIC_CONS)
263 # -------------------------------------------
264 # client_only (default off)
265 # -------------------------------------------
266 AC_ARG_ENABLE(client-only,
267 [ --enable-client-only build client (File daemon) only [disabled]],
268 [if test x$enableval = xyes; then
269 build_client_only=yes
271 if test x$build_client_only = xno; then
278 # ---------------------------------------------------
279 # Check for readline support/directory (default on)
280 # ---------------------------------------------------
281 # this allows you to turn it completely off
282 AC_ARG_ENABLE(readline,
283 [ --disable-readline disable readline support [enabled]
285 [if test x$enableval = xno; then
291 if test x$support_readline = xyes; then
292 AC_ARG_WITH(readline,
293 [ --with-readline=DIR specify readline library directory],
295 case "$with_readline" in
298 if test "$with_readline" != "yes"; then
299 CONS_INC="-I$with_readline"
300 CONS_LDFLAGS="-L$with_readline"
302 with_readline="/usr/include/readline"
304 AC_CHECK_HEADER($with_readline/readline.h,
306 AC_DEFINE(HAVE_READLINE)
307 CONS_LIBS="-lreadline -ltermcap"
310 [ AC_MSG_ERROR([*** readline library missing])
316 # check for standard readline library
317 AC_CHECK_HEADER(/usr/include/readline/readline.h,
319 AC_DEFINE(HAVE_READLINE)
321 CONS_INC="-I/usr/include/readline"
322 CONS_LIBS="-lreadline -ltermcap"
324 # Did not find starndard library, so user our own
326 AC_DEFINE(HAVE_READLINE)
328 CONS_INC="-I${TOP_DIR}/depkgs"
329 CONS_LIBS="-lreadline -lhistory -ltermcap"
330 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
331 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
338 AC_SUBST(CONS_LDFLAGS)
339 AC_SUBST(READLINE_SRC)
341 # Minimal stuff for readline Makefile configuration
348 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr setlocale lstat lchown)
350 #AC_CHECK_FUNC(getopt_long, AC_DEFINE(HAVE_GETOPT_LONG),
351 # [LIBEXTRAOBJ="$LIBEXTRAOBJ getopt.o getopt1.o"
352 # EXTRAOBJ="$EXTRAOBJ lib/getopt.o lib/getopt1.o"])
354 AC_CHECK_FUNC(getopt_long, AC_DEFINE(HAVE_GETOPT_LONG))
359 AC_CHECK_HEADERS(varargs.h \
360 sys/ptem.h sys/pte.h sys/stream.h)
362 # End of readline stuff
363 # -----------------------------------------------------------------------
366 # ---------------------------------------------------
367 # Check for GMP support/directory
368 # ---------------------------------------------------
372 # [ --with-gmp[=DIR] Specify gmp library directory],
374 # case "$with_gmp" in
377 # if test "$with_gmp" != "yes"; then
378 # GMP_INC="-I$with_gmp"
380 # GMP_LDFLAGS="-L$with_gmp"
382 # with_gmp="/usr/include"
384 # AC_CHECK_HEADER($with_gmp/gmp.h,
385 # [ AC_MSG_RESULT(yes)
386 # AC_DEFINE(HAVE_GMP)
390 # [ AC_MSG_ERROR([*** gmp library missing])
396 # # check for standard gmp library
397 # AC_CHECK_HEADER(/usr/include/gmp.h,
398 # [ AC_MSG_RESULT(yes)
399 # AC_DEFINE(HAVE_GMP)
404 # # Did not find standard library, so use our own
406 # AC_DEFINE(HAVE_GMP)
409 # GMP_INC="-I${TOP_DIR}/depkgs/gmp"
411 # GMP_LDFLAGS="-L${TOP_DIR}/depkgs/gmp"
412 # GMP_SRC="${TOP_DIR}/depkgs/gmp"
418 #AC_SUBST(GMP_LDFLAGS)
422 # -----------------------------------------------------------------------
425 # ---------------------------------------------------
426 # Check for CWEB support/directory
427 # ---------------------------------------------------
432 # [ --with-cweb[=DIR] Specify cweb library directory],
434 # case "$with_cweb" in
437 # if test "$with_cweb" != "yes"; then
438 # CWEB_INC="-I$with_cweb"
440 # CWEB_LDFLAGS="-L$with_cweb"
442 # with_cweb="/usr/include"
444 # AC_CHECK_HEADER($with_cweb/cweb.h,
445 # [ AC_MSG_RESULT(yes)
446 # AC_DEFINE(HAVE_CWEB)
450 # [ AC_MSG_ERROR([*** cweb library missing])
456 # # check for standard cweb library
457 # AC_CHECK_HEADER(/usr/include/cweb.h,
458 # [ AC_MSG_RESULT(yes)
459 # AC_DEFINE(HAVE_CWEB)
464 # # Did not find starndard library, so use our own
466 # AC_DEFINE(HAVE_CWEB)
469 # CWEB=${TOP_DIR}/depkgs/cweb
470 # CWEB_INC="-I${TOP_DIR}/depkgs/cweb"
472 # CWEB_LDFLAGS="-L${TOP_DIR}/depkgs/cweb"
473 # CWEB_SRC="${TOP_DIR}/depkgs/cweb"
480 #AC_SUBST(CWEB_LDFLAGS)
484 # -----------------------------------------------------------------------
488 # -----------------------------------------------------------
489 # Check whether user wants TCP wrappers support (default off)
490 # -----------------------------------------------------------
492 AC_ARG_WITH(tcp-wrappers,
493 [ --with-tcp-wrappers=DIR enable tcpwrappers support],
495 if test "x$withval" != "xno" ; then
497 LIBS="$LIBS -lwrap -lnsl"
498 AC_MSG_CHECKING(for libwrap)
501 int deny_severity = 0;
502 int allow_severity = 0;
503 struct request_info *req; ],
504 [ hosts_access(req); ],
507 AC_DEFINE(HAVE_LIBWRAP)
510 [AC_MSG_ERROR([*** libwrap missing]) ]
516 # ------------------------------------------
517 # Where to place working dir
518 # ------------------------------------------
519 working_dir=`eval echo ${sysconfdir}/working`
520 AC_ARG_WITH(working-dir,
521 [ --with-working-dir=PATH specify path of Bacula working directory],
523 if test "x$withval" != "xno" ; then
529 AC_SUBST(working_dir)
532 # ------------------------------------------
533 # Where to place scriptdir (script files)
534 # ------------------------------------------
535 scriptdir=`eval echo ${sysconfdir}`
536 AC_ARG_WITH(scriptdir,
537 [ --with-scriptdir=PATH specify path of Bacula scripts directory],
539 if test "x$withval" != "xno" ; then
548 # ------------------------------------------
549 # Where to send dump email
550 # ------------------------------------------
551 dump_email=root@localhost
552 AC_ARG_WITH(dump-email,
553 [ --with-dump-email=EMAIL dump email address],
555 if test "x$withval" != "xno" ; then
563 # ------------------------------------------
564 # Where to send job email
565 # ------------------------------------------
566 job_email=root@localhost
567 AC_ARG_WITH(job-email,
568 [ --with-job-email=EMAIL job output email address],
570 if test "x$withval" != "xno" ; then
578 # ------------------------------------------
579 # Where to find smtp host
580 # ------------------------------------------
582 AC_ARG_WITH(smtp_host,
583 [ --with-smtp-host=HOST SMTP mail host address],
585 if test "x$withval" != "xno" ; then
594 # ------------------------------------
595 # Where to place pid files
596 # ------------------------------------
599 [ --with-pid-dir=PATH specify location of Bacula pid files],
601 if test "x$withval" != "xno" ; then
607 # make sure the pid directory exists
608 if test ! -d $piddir ; then
609 piddir=`eval echo ${sysconfdir}`
611 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
615 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
619 # ------------------------------------
620 # Where to place subsys "lock file"
621 # ------------------------------------
622 subsysdir=/var/run/subsys
623 AC_ARG_WITH(subsys-dir,
624 [ --with-subsys-dir=PATH specify location of Bacula subsys file],
626 if test "x$withval" != "xno" ; then
632 # make sure the pid directory exists
633 if test ! -d $subsysdir ; then
634 subsysdir=`eval echo ${sysconfdir}`
636 NONE/*) subsysdir=`echo $subsysdir | sed "s~NONE~$ac_default_prefix~"` ;;
644 # ------------------------------------
645 # Where to start assigning ports
646 # ------------------------------------
648 AC_ARG_WITH(baseport,
649 [ --with-baseport=PORT specify base port address for daemons],
651 if test "x$withval" != "xno" ; then
658 dir_port=`expr $baseport`
659 fd_port=`expr $baseport + 1`
660 sd_port=`expr $fd_port + 1`
667 # ------------------------------------------
669 # ------------------------------------------
671 AC_ARG_WITH(dir-password,
672 [ --with-dir-password=PASSWORD specify Director's password],
674 if test "x$withval" != "xno" ; then
675 dir_password=$withval
680 if test "x$dir_password" = "x" ; then
681 if test "x$OPENSSL" = "xnone" ; then
682 # key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" abcdefghijklmnopqrst | awk '{getline} {print} {exit}'`
683 key=`autoconf/randpass 33`
685 key=`openssl rand -base64 33`
691 AC_ARG_WITH(fd-password,
692 [ --with-fd-password=PASSWORD specify Client's password],
694 if test "x$withval" != "xno" ; then
700 if test "x$fd_password" = "x" ; then
701 if test "x$OPENSSL" = "xnone" ; then
702 # key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" tsrqponmlkjihgfedcba | awk '{getline} {print} {exit}'`
703 key=`autoconf/randpass 37`
705 key=`openssl rand -base64 33`
711 AC_ARG_WITH(sd-password,
712 [ --with-sd-password=PASSWORD specify Storage daemon's password],
714 if test "x$withval" != "xno" ; then
720 if test "x$sd_password" = "x" ; then
721 if test "x$OPENSSL" = "xnone" ; then
722 # key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" 123456789uvwxyzabcdef | awk '{getline} {print} {exit}'`
723 key=`autocnf/randpass 41`
725 key=`openssl rand -base64 33`
731 AC_SUBST(dir_password)
732 AC_SUBST(fd_password)
733 AC_SUBST(sd_password)
738 # ------------------------------------------------
739 # Bacula check for various SQL database engines
740 # ------------------------------------------------
744 # ------------------------------------------------
745 # Bacula check for various SQL database engines
746 # ------------------------------------------------
752 AC_DEFINE(PROTOTYPES)
754 dnl# --------------------------------------------------------------------------
755 dnl# Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
757 if test -z "$CFLAGS"; then
758 if test -z "$CCOPTS"; then
760 dnl> if test "x$GCC" = xyes; then
761 dnl> if test x$system = xLinux; then
762 dnl> CCOPTS="$CCOPTS "'-O2 -fno-strength-reduce'
773 dnl See if we can use 64 bit file addresses
774 largefile_support="no"
780 dnl# --------------------------------------------------------------------------
781 dnl# CHECKING FOR HEADER FILES
782 dnl# --------------------------------------------------------------------------
811 dnl# --------------------------------------------------------------------------
812 dnl# Check for utime.h structure
813 dnl# --------------------------------------------------------------------------
814 AC_CACHE_CHECK(for utime.h, tar_cv_header_utime_h,
816 #include <sys/types.h>
817 #include <utime.h>], [struct utimbuf foo],
818 tar_cv_header_utime_h=yes, tar_cv_header_utime_h=no)])
819 test $tar_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H)
821 dnl# --------------------------------------------------------------------------
822 dnl# Check for bigendian
823 dnl# --------------------------------------------------------------------------
824 AC_CACHE_CHECK([for bigendian], ba_cv_bigendian,
826 [main(){long a=1L; char *p=(char *)&a; exit(*p);}],
827 [ba_cv_bigendian=yes],
828 [ba_cv_bigendian=no],
829 [ba_cv_bigendian=no])])
830 test $ba_cv_bigendian = yes && AC_DEFINE(HAVE_BIGENDIAN)
836 dnl# --------------------------------------------------------------------------
837 dnl# CHECKING FOR FILESYSTEM TYPE
838 dnl# --------------------------------------------------------------------------
839 AC_MSG_CHECKING(how to get filesystem type)
841 # The order of these tests is important.
842 AC_TRY_CPP([#include <sys/statvfs.h>
843 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4)
844 if test $fstype = no; then
845 AC_TRY_CPP([#include <sys/statfs.h>
846 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3)
848 if test $fstype = no; then
849 AC_TRY_CPP([#include <sys/statfs.h>
850 #include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX)
852 if test $fstype = no; then
853 AC_TRY_CPP([#include <mntent.h>], AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD)
855 if test $fstype = no; then
856 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
858 if test $fstype = no; then
859 AC_TRY_CPP([#include <sys/mount.h>
860 #include <sys/fs_types.h>], AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix)
862 AC_MSG_RESULT($fstype)
864 dnl# --------------------------------------------------------------------------
865 dnl# CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
866 dnl# --------------------------------------------------------------------------
874 AC_CHECK_TYPE(ino_t, unsigned long)
875 AC_CHECK_TYPE(dev_t, unsigned long)
876 AC_CHECK_TYPE(daddr_t, long)
877 AC_CHECK_TYPE(major_t, int)
878 AC_CHECK_TYPE(minor_t, int)
879 AC_CHECK_TYPE(ssize_t, int)
886 AC_CHECK_SIZEOF(char, 1)
887 AC_CHECK_SIZEOF(short int, 2)
888 AC_CHECK_SIZEOF(int, 4)
889 AC_CHECK_SIZEOF(long int, 4)
890 AC_CHECK_SIZEOF(long long int, 8)
891 AC_CHECK_SIZEOF(int *, 4)
893 # Check for sys/types.h types
894 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
896 [ #include <sys/types.h> ],
898 [ ac_cv_have_u_int="yes" ],
899 [ ac_cv_have_u_int="no" ]
902 if test "x$ac_cv_have_u_int" = "xyes" ; then
903 AC_DEFINE(HAVE_U_INT)
907 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t, [
909 [ #include <sys/types.h> ],
910 [ intmax_t a; a = 1;],
911 [ ac_cv_have_intmax_t="yes" ],
914 [ #include <stdint.h> ],
915 [ intmax_t a; a = 1;],
916 [ ac_cv_have_intmax_t="yes" ],
917 [ ac_cv_have_intmax_t="no" ]
923 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
924 AC_DEFINE(HAVE_INTMAX_T)
929 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t, [
931 [ #include <sys/types.h> ],
932 [ u_intmax_t a; a = 1;],
933 [ ac_cv_have_u_intmax_t="yes" ],
936 [ #include <stdint.h> ],
937 [ u_intmax_t a; a = 1;],
938 [ ac_cv_have_u_intmax_t="yes" ],
939 [ ac_cv_have_u_intmax_t="no" ]
944 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
945 AC_DEFINE(HAVE_U_INTMAX_T)
950 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
952 [ #include <sys/types.h> ],
953 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
954 [ ac_cv_have_intxx_t="yes" ],
955 [ ac_cv_have_intxx_t="no" ]
958 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
959 AC_DEFINE(HAVE_INTXX_T)
963 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
965 [ #include <sys/types.h> ],
966 [ int64_t a; a = 1;],
967 [ ac_cv_have_int64_t="yes" ],
968 [ ac_cv_have_int64_t="no" ]
971 if test "x$ac_cv_have_int64_t" = "xyes" ; then
972 AC_DEFINE(HAVE_INT64_T)
976 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
978 [ #include <sys/types.h> ],
979 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
980 [ ac_cv_have_u_intxx_t="yes" ],
981 [ ac_cv_have_u_intxx_t="no" ]
984 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
985 AC_DEFINE(HAVE_U_INTXX_T)
989 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
991 [ #include <sys/types.h> ],
992 [ u_int64_t a; a = 1;],
993 [ ac_cv_have_u_int64_t="yes" ],
994 [ ac_cv_have_u_int64_t="no" ]
997 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
998 AC_DEFINE(HAVE_U_INT64_T)
1002 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1003 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1005 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1007 [ #include <sys/bitypes.h> ],
1008 [ int8_t a; int16_t b; int32_t c;
1009 u_int8_t e; u_int16_t f; u_int32_t g;
1010 a = b = c = e = f = g = 1; ],
1011 [ AC_DEFINE(HAVE_U_INTXX_T)
1012 AC_DEFINE(HAVE_INTXX_T)
1013 AC_DEFINE(HAVE_SYS_BITYPES_H)
1014 AC_MSG_RESULT(yes) ],
1015 [ AC_MSG_RESULT(no)]
1019 if test -z "$have_u_intxx_t" ; then
1020 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1022 [ #include <sys/types.h> ],
1023 [ uint8_t a; uint16_t b;
1024 uint32_t c; a = b = c = 1; ],
1025 [ ac_cv_have_uintxx_t="yes" ],
1026 [ ac_cv_have_uintxx_t="no" ]
1029 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1030 AC_DEFINE(HAVE_UINTXX_T)
1035 dnl# --------------------------------------------------------------------------
1036 dnl# CHECKING FOR LIBRARY FUNCTIONS
1037 dnl# --------------------------------------------------------------------------
1053 [echo 'configure: cannot find needed function.'; exit 1]
1056 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
1058 AC_CHECK_FUNCS(snprintf vsnprintf gethostid getdomainname)
1060 dnl# --------------------------------------------------------------------------
1061 dnl# CHECKING FOR THREAD SAFE FUNCTIONS
1062 dnl# --------------------------------------------------------------------------
1063 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
1065 # If resolver functions are not in libc check for -lnsl or -lresolv.
1066 AC_CHECK_FUNC(gethostbyname_r,
1067 AC_MSG_RESULT(using libc's resolver),
1068 AC_CHECK_LIB(nsl,gethostbyname_r)
1069 AC_CHECK_LIB(resolv,gethostbyname_r))
1072 # Find where sockets are (especially for Solaris)
1073 AC_CHECK_FUNC(socket,
1074 AC_MSG_RESULT(using libc's socket),
1075 AC_CHECK_LIB(xnet,socket)
1076 AC_CHECK_LIB(socket,socket)
1077 AC_CHECK_LIB(inet,socket))
1079 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
1085 AC_FUNC_CLOSEDIR_VOID
1086 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
1090 dnl# FreeBSD needs to link libxpg4
1091 AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"])
1094 AC_CHECK_LIB(sun, getpwnam)
1096 AC_CHECK_HEADERS(zlib.h)
1097 AC_CHECK_LIB(z, deflate, [FDLIBS="-lz"])
1099 if test x$FDLIBS = x-lz; then
1100 AC_DEFINE(HAVE_LIBZ)
1104 dnl Check for pthread libraries
1106 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
1107 [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
1108 [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
1109 [AC_CHECK_FUNC(pthread_create)]
1119 LDFLAGS=${LDFLAGS--O}
1120 DB_LIBS="${SQL_LFLAGS}"
1122 CPPFLAGS="$CPPFLAGS"
1133 AC_SUBST(X_EXTRA_LIBS)
1135 dnl# extra configurable objects
1143 # Finally we set appropriate distribution specific
1144 # variables and defaults
1146 # PFILES are platform specific files
1147 PFILES="platforms/Makefile"
1154 PTHREAD_LIB="-lpthread -lexc"
1155 if test "${CC}" = "gcc" ; then
1162 TAPEDRIVE="/dev/nrmt0"
1165 DISTVER=`uname -a |awk '{print $3}'`
1166 TAPEDRIVE="/dev/nrst0"
1169 DISTVER=`cat /etc/.issue | grep Version | cut -f 2 -d ' '`
1170 TAPEDRIVE="/dev/nrst0"
1171 PSCMD="ps -e -o pid,command"
1172 hostname=`hostname -s`
1175 DISTVER=`uname -a |awk '{print $3}'`
1176 TAPEDRIVE="/dev/nrst0"
1178 CFLAGS="${CFLAGS} -mwindows"
1179 LDFLAGS="${LDFLAGS} -mwindows"
1182 DISTVER=`cat /etc/debian_version`
1183 TAPEDRIVE="/dev/nrst0"
1184 PSCMD="ps -e -o pid,command"
1185 hostname=`hostname -s`
1188 DISTVER=`uname -a |awk '{print $3}'`
1189 PTHREAD_LIB="-pthread"
1190 CFLAGS="${CFLAGS} -pthread"
1193 TAPEDRIVE="/dev/nrst0"
1194 PSCMD="ps -x -o pid,command"
1196 platforms/freebsd/Makefile \
1197 platforms/freebsd/bacula-fd \
1198 platforms/freebsd/bacula-sd \
1199 platforms/freebsd/bacula-dir"
1200 hostname=`hostname -s`
1201 largefile_support="yes"
1205 TAPEDRIVE="/dev/rmt/0hnb"
1209 TAPEDRIVE="/dev/rmt/0cbn"
1210 PSCMD="ps -e -o pid,comm"
1211 hostname=`/usr/bsd/hostname -s`
1213 platforms/irix/Makefile \
1214 platforms/irix/bacula-fd \
1215 platforms/irix/bacula-sd \
1216 platforms/irix/bacula-dir"
1219 DISTVER=`uname -a |awk '{print $3}'`
1222 TAPEDRIVE="/dev/nrst0"
1223 PSCMD="ps -a -o pid,command"
1224 PTHREAD_LIB="-pthread"
1225 CFLAGS="${CFLAGS} -pthread"
1228 DISTVER=`uname -a |awk '{print $3}'`
1231 TAPEDRIVE="/dev/nrst0"
1232 PSCMD="ps -a -o pid,command"
1233 PTHREAD_LIB="-pthread"
1234 CFLAGS="${CFLAGS} -pthread"
1236 platforms/openbsd/Makefile \
1237 platforms/openbsd/bacula-fd \
1238 platforms/openbsd/bacula-sd \
1239 platforms/openbsd/bacula-dir"
1242 DISTVER=`cat /etc/redhat-release | grep release |\
1244 TAPEDRIVE="/dev/nst0"
1245 PSCMD="ps -e -o pid,command"
1247 platforms/redhat/Makefile \
1248 platforms/redhat/bacula-fd \
1249 platforms/redhat/bacula-sd \
1250 platforms/redhat/bacula-dir"
1251 hostname=`hostname -s`
1254 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
1255 TAPEDRIVE="/dev/nst0"
1256 PSCMD="ps -e -o pid,command"
1258 platforms/gentoo/Makefile \
1259 platforms/gentoo/bacula-fd \
1260 platforms/gentoo/bacula-sd \
1261 platforms/gentoo/bacula-dir"
1262 hostname=`hostname -s`
1266 DISTVER=`cat /etc/slackware-version`
1267 TAPEDRIVE="/dev/nst0"
1268 PSCMD="ps -e -o pid,command"
1269 hostname=`hostname -s`
1273 TAPEDRIVE="/dev/rmt/0cbn"
1274 PSCMD="ps -e -o pid,comm"
1276 platforms/solaris/Makefile \
1277 platforms/solaris/bacula-fd \
1278 platforms/solaris/bacula-sd \
1279 platforms/solaris/bacula-dir"
1282 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
1284 TAPEDRIVE="/dev/nst0"
1285 PSCMD="ps -e -o pid,command"
1286 hostname=`hostname -s`
1291 TAPEDRIVE="/dev/nst0"
1292 PSCMD="ps -e -o pid,command"
1293 hostname=`hostname -s`
1297 TAPEDRIVE="/dev/nst0"
1300 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
1307 LIBS="$PTHREAD_LIB $LIBS"
1309 AC_DEFINE_UNQUOTED(lld, "$lld")
1310 AC_DEFINE_UNQUOTED(llu, "$llu")
1318 dnl# common parts of the Makefile
1319 MCOMMON=./autoconf/Make.common
1320 AC_SUBST_FILE(MCOMMON)
1322 AC_OUTPUT([autoconf/Make.common \
1325 rescue/linux/Makefile \
1326 rescue/freebsd/Makefile \
1327 rescue/solaris/Makefile \
1328 scripts/startmysql \
1330 scripts/btraceback \
1340 src/console/Makefile \
1341 src/console/console.conf \
1342 src/gnome-console/Makefile \
1343 src/gnome-console/gnome-console.conf \
1345 src/dird/bacula-dir.conf \
1347 src/stored/Makefile \
1348 src/stored/bacula-sd.conf \
1349 src/filed/Makefile \
1351 src/filed/bacula-fd.conf \
1352 src/filed/win32/Makefile \
1354 src/cats/make_catalog_backup \
1355 src/cats/delete_catalog_backup \
1356 src/cats/alter_mysql_tables \
1357 src/cats/make_mysql_tables \
1358 src/cats/drop_mysql_tables \
1359 src/cats/create_mysql_database \
1360 src/cats/grant_mysql_privileges \
1361 src/cats/alter_sqlite_tables \
1362 src/cats/make_sqlite_tables \
1363 src/cats/drop_sqlite_tables \
1364 src/cats/create_sqlite_database \
1367 src/cats/create_bdb_database \
1368 src/cats/make_bdb_tables \
1369 src/cats/drop_bdb_tables \
1370 src/cats/make_bacula_tables \
1371 src/cats/drop_bacula_tables \
1372 src/findlib/Makefile \
1373 src/tools/Makefile \
1375 [(echo "Doing make of dependencies"; make depend;) ]
1379 chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
1380 chmod 755 console gconsole
1382 chmod 755 src/cats/make_mysql_tables src/cats/drop_mysql_tables
1383 chmod 755 src/cats/make_test_tables src/cats/drop_test_tables
1384 chmod 755 src/cats/create_mysql_database
1385 chmod 755 src/cats/make_catalog_backup src/cats/delete_catalog_backup
1386 chmod 755 src/cats/alter_mysql_tables
1387 chmod 755 src/cats/grant_mysql_privileges
1388 chmod 755 src/cats/make_sqlite_tables src/cats/drop_sqlite_tables
1389 chmod 755 src/cats/make_bacula_tables src/cats/drop_bacula_tables
1390 chmod 755 src/cats/create_sqlite_database
1391 chmod 755 src/cats/alter_sqlite_tables
1392 chmod 755 src/cats/sqlite
1393 chmod 755 src/cats/make_bdb_tables src/cats/drop_bdb_tables
1394 chmod 755 src/cats/create_bdb_database
1396 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
1397 largefile_support="yes"
1402 Configuration on `date`:
1404 Host: $host -- ${DISTNAME} ${DISTVER}
1405 Bacula version: ${VERSION} (${DATE})
1406 Source code location: ${srcdir}
1407 Install binaries: ${sbindir}
1408 Install config files: ${sysconfdir}
1409 Scripts directory ${scriptdir}
1410 Working directory ${working_dir}
1412 C++ Compiler: ${CXX}
1413 Compiler flags: ${CFLAGS}
1414 Linker flags: ${LDFLAGS}
1416 Statically Linked Tools: ${support_static_tools}
1417 Statically Linked FD: ${support_static_fd}
1418 Statically Linked SD: ${support_static_sd}
1419 Statically Linked DIR: ${support_static_dir}
1420 Statically Linked CONS: ${support_static_cons}
1421 Database type: ${db_name}
1422 Database lib: ${DB_LIBS}
1424 Job Output Email: ${job_email}
1425 Traceback Email: ${dump_email}
1426 SMTP Host Address: ${smtp_host}
1427 Director Port ${dir_port}
1428 File daemon Port ${fd_port}
1429 Storage daemon Port ${sd_port}
1430 SQL binaries Directory ${SQL_BINDIR}
1432 Large file support: $largefile_support
1433 readline support: ${got_readline} ${PRTREADLINE_SRC}
1434 TCP Wrappers support: ${TCPW_MSG}
1435 ZLIB support: ${have_zlib}
1436 enable-smartalloc: ${support_smartalloc}
1437 enable-gnome: ${support_gnome}
1438 client-only: ${build_client_only}
1445 # cweb support: ${got_cweb} ${CWEB_SRC}
1446 # gmp support: ${got_gmp} ${GMP_SRC}