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)
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)
349 AC_CHECK_FUNCS(nanosleep)
351 #AC_CHECK_FUNC(getopt_long, AC_DEFINE(HAVE_GETOPT_LONG),
352 # [LIBEXTRAOBJ="$LIBEXTRAOBJ getopt.o getopt1.o"
353 # EXTRAOBJ="$EXTRAOBJ lib/getopt.o lib/getopt1.o"])
355 AC_CHECK_FUNC(getopt_long, AC_DEFINE(HAVE_GETOPT_LONG))
360 AC_CHECK_HEADERS(varargs.h \
361 sys/ptem.h sys/pte.h sys/stream.h)
363 # End of readline stuff
364 # -----------------------------------------------------------------------
367 # ---------------------------------------------------
368 # Check for GMP support/directory
369 # ---------------------------------------------------
373 # [ --with-gmp[=DIR] Specify gmp library directory],
375 # case "$with_gmp" in
378 # if test "$with_gmp" != "yes"; then
379 # GMP_INC="-I$with_gmp"
381 # GMP_LDFLAGS="-L$with_gmp"
383 # with_gmp="/usr/include"
385 # AC_CHECK_HEADER($with_gmp/gmp.h,
386 # [ AC_MSG_RESULT(yes)
387 # AC_DEFINE(HAVE_GMP)
391 # [ AC_MSG_ERROR([*** gmp library missing])
397 # # check for standard gmp library
398 # AC_CHECK_HEADER(/usr/include/gmp.h,
399 # [ AC_MSG_RESULT(yes)
400 # AC_DEFINE(HAVE_GMP)
405 # # Did not find standard library, so use our own
407 # AC_DEFINE(HAVE_GMP)
410 # GMP_INC="-I${TOP_DIR}/depkgs/gmp"
412 # GMP_LDFLAGS="-L${TOP_DIR}/depkgs/gmp"
413 # GMP_SRC="${TOP_DIR}/depkgs/gmp"
419 #AC_SUBST(GMP_LDFLAGS)
423 # -----------------------------------------------------------------------
426 # ---------------------------------------------------
427 # Check for CWEB support/directory
428 # ---------------------------------------------------
433 # [ --with-cweb[=DIR] Specify cweb library directory],
435 # case "$with_cweb" in
438 # if test "$with_cweb" != "yes"; then
439 # CWEB_INC="-I$with_cweb"
441 # CWEB_LDFLAGS="-L$with_cweb"
443 # with_cweb="/usr/include"
445 # AC_CHECK_HEADER($with_cweb/cweb.h,
446 # [ AC_MSG_RESULT(yes)
447 # AC_DEFINE(HAVE_CWEB)
451 # [ AC_MSG_ERROR([*** cweb library missing])
457 # # check for standard cweb library
458 # AC_CHECK_HEADER(/usr/include/cweb.h,
459 # [ AC_MSG_RESULT(yes)
460 # AC_DEFINE(HAVE_CWEB)
465 # # Did not find starndard library, so use our own
467 # AC_DEFINE(HAVE_CWEB)
470 # CWEB=${TOP_DIR}/depkgs/cweb
471 # CWEB_INC="-I${TOP_DIR}/depkgs/cweb"
473 # CWEB_LDFLAGS="-L${TOP_DIR}/depkgs/cweb"
474 # CWEB_SRC="${TOP_DIR}/depkgs/cweb"
481 #AC_SUBST(CWEB_LDFLAGS)
485 # -----------------------------------------------------------------------
489 # -----------------------------------------------------------
490 # Check whether user wants TCP wrappers support (default off)
491 # -----------------------------------------------------------
493 AC_ARG_WITH(tcp-wrappers,
494 [ --with-tcp-wrappers=DIR enable tcpwrappers support],
496 if test "x$withval" != "xno" ; then
498 LIBS="$LIBS -lwrap -lnsl"
499 AC_MSG_CHECKING(for libwrap)
502 int deny_severity = 0;
503 int allow_severity = 0;
504 struct request_info *req; ],
505 [ hosts_access(req); ],
508 AC_DEFINE(HAVE_LIBWRAP)
511 [AC_MSG_ERROR([*** libwrap missing]) ]
517 # ------------------------------------------
518 # Where to place working dir
519 # ------------------------------------------
520 working_dir=`eval echo ${sysconfdir}/working`
521 AC_ARG_WITH(working-dir,
522 [ --with-working-dir=PATH specify path of Bacula working directory],
524 if test "x$withval" != "xno" ; then
530 AC_SUBST(working_dir)
533 # ------------------------------------------
534 # Where to place scriptdir (script files)
535 # ------------------------------------------
536 scriptdir=`eval echo ${sysconfdir}`
537 AC_ARG_WITH(scriptdir,
538 [ --with-scriptdir=PATH specify path of Bacula scripts directory],
540 if test "x$withval" != "xno" ; then
549 # ------------------------------------------
550 # Where to send dump email
551 # ------------------------------------------
552 dump_email=root@localhost
553 AC_ARG_WITH(dump-email,
554 [ --with-dump-email=EMAIL dump email address],
556 if test "x$withval" != "xno" ; then
564 # ------------------------------------------
565 # Where to send job email
566 # ------------------------------------------
567 job_email=root@localhost
568 AC_ARG_WITH(job-email,
569 [ --with-job-email=EMAIL job output email address],
571 if test "x$withval" != "xno" ; then
579 # ------------------------------------------
580 # Where to find smtp host
581 # ------------------------------------------
583 AC_ARG_WITH(smtp_host,
584 [ --with-smtp-host=HOST SMTP mail host address],
586 if test "x$withval" != "xno" ; then
595 # ------------------------------------
596 # Where to place pid files
597 # ------------------------------------
600 [ --with-pid-dir=PATH specify location of Bacula pid files],
602 if test "x$withval" != "xno" ; then
608 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
612 # ------------------------------------
613 # Where to place subsys "lock file"
614 # ------------------------------------
615 subsysdir=/var/run/subsys
616 AC_ARG_WITH(subsys-dir,
617 [ --with-subsys-dir=PATH specify location of Bacula subsys file],
619 if test "x$withval" != "xno" ; then
629 # ------------------------------------
630 # Where to start assigning ports
631 # ------------------------------------
633 AC_ARG_WITH(baseport,
634 [ --with-baseport=PORT specify base port address for daemons],
636 if test "x$withval" != "xno" ; then
643 dir_port=`expr $baseport`
644 fd_port=`expr $baseport + 1`
645 sd_port=`expr $fd_port + 1`
652 # ------------------------------------------
654 # ------------------------------------------
656 AC_ARG_WITH(dir-password,
657 [ --with-dir-password=PASSWORD specify Director's password],
659 if test "x$withval" != "xno" ; then
660 dir_password=$withval
665 if test "x$dir_password" = "x" ; then
666 if test "x$OPENSSL" = "xnone" ; then
667 # key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" abcdefghijklmnopqrst | awk '{getline} {print} {exit}'`
668 key=`autoconf/randpass 33`
670 key=`openssl rand -base64 33`
676 AC_ARG_WITH(fd-password,
677 [ --with-fd-password=PASSWORD specify Client's password],
679 if test "x$withval" != "xno" ; then
685 if test "x$fd_password" = "x" ; then
686 if test "x$OPENSSL" = "xnone" ; then
687 # key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" tsrqponmlkjihgfedcba | awk '{getline} {print} {exit}'`
688 key=`autoconf/randpass 37`
690 key=`openssl rand -base64 33`
696 AC_ARG_WITH(sd-password,
697 [ --with-sd-password=PASSWORD specify Storage daemon's password],
699 if test "x$withval" != "xno" ; then
705 if test "x$sd_password" = "x" ; then
706 if test "x$OPENSSL" = "xnone" ; then
707 # key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" 123456789uvwxyzabcdef | awk '{getline} {print} {exit}'`
708 key=`autocnf/randpass 41`
710 key=`openssl rand -base64 33`
716 AC_SUBST(dir_password)
717 AC_SUBST(fd_password)
718 AC_SUBST(sd_password)
723 # ------------------------------------------------
724 # Bacula check for various SQL database engines
725 # ------------------------------------------------
729 # ------------------------------------------------
730 # Bacula check for various SQL database engines
731 # ------------------------------------------------
737 AC_DEFINE(PROTOTYPES)
739 dnl# --------------------------------------------------------------------------
740 dnl# Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
742 if test -z "$CFLAGS"; then
743 if test -z "$CCOPTS"; then
745 dnl> if test "x$GCC" = xyes; then
746 dnl> if test x$system = xLinux; then
747 dnl> CCOPTS="$CCOPTS "'-O2 -fno-strength-reduce'
758 dnl See if we can use 64 bit file addresses
759 largefile_support="no"
765 dnl# --------------------------------------------------------------------------
766 dnl# CHECKING FOR HEADER FILES
767 dnl# --------------------------------------------------------------------------
802 dnl# --------------------------------------------------------------------------
803 dnl# Check for utime.h structure
804 dnl# --------------------------------------------------------------------------
805 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
807 #include <sys/types.h>
808 #include <utime.h>], [struct utimbuf foo],
809 ba_cv_header_utime_h=yes, ba_cv_header_utime_h=no)])
810 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H)
812 dnl# --------------------------------------------------------------------------
813 dnl# Check for socklen_t
814 dnl# --------------------------------------------------------------------------
815 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
817 #include <sys/types.h>
818 #include <sys/socket.h>],
820 ba_cv_header_socklen_t=yes, ba_cv_header_socklen_t=no)])
821 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T)
823 dnl# --------------------------------------------------------------------------
824 dnl# Check for bigendian
825 dnl# --------------------------------------------------------------------------
826 AC_CACHE_CHECK([for bigendian], ba_cv_bigendian,
828 [main(){long a=1L; char *p=(char *)&a; exit(*p);}],
829 [ba_cv_bigendian=yes],
830 [ba_cv_bigendian=no],
831 [ba_cv_bigendian=no])])
832 test $ba_cv_bigendian = yes && AC_DEFINE(HAVE_BIGENDIAN)
838 dnl# --------------------------------------------------------------------------
839 dnl# CHECKING FOR FILESYSTEM TYPE
840 dnl# --------------------------------------------------------------------------
841 AC_MSG_CHECKING(how to get filesystem type)
843 # The order of these tests is important.
844 AC_TRY_CPP([#include <sys/statvfs.h>
845 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4)
846 if test $fstype = no; then
847 AC_TRY_CPP([#include <sys/statfs.h>
848 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3)
850 if test $fstype = no; then
851 AC_TRY_CPP([#include <sys/statfs.h>
852 #include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX)
854 if test $fstype = no; then
855 AC_TRY_CPP([#include <mntent.h>], AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD)
857 if test $fstype = no; then
858 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
860 if test $fstype = no; then
861 AC_TRY_CPP([#include <sys/mount.h>
862 #include <sys/fs_types.h>], AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix)
864 AC_MSG_RESULT($fstype)
866 dnl# --------------------------------------------------------------------------
867 dnl# CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
868 dnl# --------------------------------------------------------------------------
876 AC_CHECK_TYPE(ino_t, unsigned long)
877 AC_CHECK_TYPE(dev_t, unsigned long)
878 AC_CHECK_TYPE(daddr_t, long)
879 AC_CHECK_TYPE(major_t, int)
880 AC_CHECK_TYPE(minor_t, int)
881 AC_CHECK_TYPE(ssize_t, int)
888 AC_CHECK_SIZEOF(char, 1)
889 AC_CHECK_SIZEOF(short int, 2)
890 AC_CHECK_SIZEOF(int, 4)
891 AC_CHECK_SIZEOF(long int, 4)
892 AC_CHECK_SIZEOF(long long int, 8)
893 AC_CHECK_SIZEOF(int *, 4)
895 # Check for sys/types.h types
896 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
898 [ #include <sys/types.h> ],
900 [ ac_cv_have_u_int="yes" ],
901 [ ac_cv_have_u_int="no" ]
904 if test "x$ac_cv_have_u_int" = "xyes" ; then
905 AC_DEFINE(HAVE_U_INT)
909 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t, [
911 [ #include <sys/types.h> ],
912 [ intmax_t a; a = 1;],
913 [ ac_cv_have_intmax_t="yes" ],
916 [ #include <stdint.h> ],
917 [ intmax_t a; a = 1;],
918 [ ac_cv_have_intmax_t="yes" ],
919 [ ac_cv_have_intmax_t="no" ]
925 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
926 AC_DEFINE(HAVE_INTMAX_T)
931 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t, [
933 [ #include <sys/types.h> ],
934 [ u_intmax_t a; a = 1;],
935 [ ac_cv_have_u_intmax_t="yes" ],
938 [ #include <stdint.h> ],
939 [ u_intmax_t a; a = 1;],
940 [ ac_cv_have_u_intmax_t="yes" ],
941 [ ac_cv_have_u_intmax_t="no" ]
946 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
947 AC_DEFINE(HAVE_U_INTMAX_T)
952 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
954 [ #include <sys/types.h> ],
955 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
956 [ ac_cv_have_intxx_t="yes" ],
957 [ ac_cv_have_intxx_t="no" ]
960 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
961 AC_DEFINE(HAVE_INTXX_T)
965 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
967 [ #include <sys/types.h> ],
968 [ int64_t a; a = 1;],
969 [ ac_cv_have_int64_t="yes" ],
970 [ ac_cv_have_int64_t="no" ]
973 if test "x$ac_cv_have_int64_t" = "xyes" ; then
974 AC_DEFINE(HAVE_INT64_T)
978 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
980 [ #include <sys/types.h> ],
981 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
982 [ ac_cv_have_u_intxx_t="yes" ],
983 [ ac_cv_have_u_intxx_t="no" ]
986 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
987 AC_DEFINE(HAVE_U_INTXX_T)
991 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
993 [ #include <sys/types.h> ],
994 [ u_int64_t a; a = 1;],
995 [ ac_cv_have_u_int64_t="yes" ],
996 [ ac_cv_have_u_int64_t="no" ]
999 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1000 AC_DEFINE(HAVE_U_INT64_T)
1004 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1005 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1007 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1009 [ #include <sys/bitypes.h> ],
1010 [ int8_t a; int16_t b; int32_t c;
1011 u_int8_t e; u_int16_t f; u_int32_t g;
1012 a = b = c = e = f = g = 1; ],
1013 [ AC_DEFINE(HAVE_U_INTXX_T)
1014 AC_DEFINE(HAVE_INTXX_T)
1015 AC_DEFINE(HAVE_SYS_BITYPES_H)
1016 AC_MSG_RESULT(yes) ],
1017 [ AC_MSG_RESULT(no)]
1021 if test -z "$have_u_intxx_t" ; then
1022 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1024 [ #include <sys/types.h> ],
1025 [ uint8_t a; uint16_t b;
1026 uint32_t c; a = b = c = 1; ],
1027 [ ac_cv_have_uintxx_t="yes" ],
1028 [ ac_cv_have_uintxx_t="no" ]
1031 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1032 AC_DEFINE(HAVE_UINTXX_T)
1037 dnl# --------------------------------------------------------------------------
1038 dnl# CHECKING FOR LIBRARY FUNCTIONS
1039 dnl# --------------------------------------------------------------------------
1055 [echo 'configure: cannot find needed function.'; exit 1]
1058 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
1060 AC_CHECK_FUNCS(chflags)
1062 AC_CHECK_FUNCS(snprintf vsnprintf gethostid getdomainname)
1064 dnl# --------------------------------------------------------------------------
1065 dnl# CHECKING FOR THREAD SAFE FUNCTIONS
1066 dnl# --------------------------------------------------------------------------
1067 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
1069 # If resolver functions are not in libc check for -lnsl or -lresolv.
1070 AC_CHECK_FUNC(gethostbyname_r,
1071 AC_MSG_RESULT(using libc's resolver),
1072 AC_CHECK_LIB(nsl,gethostbyname_r)
1073 AC_CHECK_LIB(resolv,gethostbyname_r))
1076 # Find where sockets are (especially for Solaris)
1077 AC_CHECK_FUNC(socket,
1078 AC_MSG_RESULT(using libc's socket),
1079 AC_CHECK_LIB(xnet,socket)
1080 AC_CHECK_LIB(socket,socket)
1081 AC_CHECK_LIB(inet,socket))
1083 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
1089 AC_FUNC_CLOSEDIR_VOID
1090 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
1094 dnl# FreeBSD needs to link libxpg4
1095 AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"])
1098 AC_CHECK_LIB(sun, getpwnam)
1100 AC_CHECK_HEADERS(zlib.h)
1101 AC_CHECK_LIB(z, deflate, [FDLIBS="-lz"])
1103 if test x$FDLIBS = x-lz; then
1104 AC_DEFINE(HAVE_LIBZ)
1108 dnl Check for pthread libraries
1110 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
1111 [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
1112 [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
1113 [AC_CHECK_FUNC(pthread_create)]
1123 LDFLAGS=${LDFLAGS--O}
1124 DB_LIBS="${SQL_LFLAGS}"
1126 CPPFLAGS="$CPPFLAGS"
1137 AC_SUBST(X_EXTRA_LIBS)
1141 dnl# extra configurable objects
1152 # Finally we set appropriate distribution specific
1153 # variables and defaults
1155 # PFILES are platform specific files
1156 PFILES="platforms/Makefile"
1163 PSCMD="ps -e -o pid,comm"
1165 platforms/aix/Makefile"
1169 PTHREAD_LIB="-lpthread -lexc"
1170 if test "${CC}" = "gcc" ; then
1177 TAPEDRIVE="/dev/nrmt0"
1180 DISTVER=`uname -a |awk '{print $3}'`
1181 TAPEDRIVE="/dev/nrst0"
1184 DISTVER=`cat /etc/.issue | grep Version | cut -f 2 -d ' '`
1185 TAPEDRIVE="/dev/nrst0"
1186 PSCMD="ps -e -o pid,command"
1187 hostname=`hostname -s`
1190 DISTVER=`uname -a |awk '{print $3}'`
1191 TAPEDRIVE="/dev/nrst0"
1194 WLDFLAGS="-mwindows"
1198 TAPEDRIVE="/dev/nst0"
1199 PSCMD="ps -e -o pid,command"
1200 hostname=`hostname -s`
1202 platforms/darwin/Makefile"
1205 DISTVER=`cat /etc/debian_version`
1206 TAPEDRIVE="/dev/nrst0"
1207 PSCMD="ps -e -o pid,command"
1208 hostname=`hostname -s`
1211 DISTVER=`uname -a |awk '{print $3}'`
1212 PTHREAD_LIB="-pthread"
1213 CFLAGS="${CFLAGS} -pthread"
1216 TAPEDRIVE="/dev/nrst0"
1217 PSCMD="ps -x -o pid,command"
1219 platforms/freebsd/Makefile \
1220 platforms/freebsd/bacula-fd \
1221 platforms/freebsd/bacula-sd \
1222 platforms/freebsd/bacula-dir"
1223 hostname=`hostname -s`
1224 largefile_support="yes"
1228 TAPEDRIVE="/dev/rmt/0hnb"
1232 TAPEDRIVE="/dev/rmt/0cbn"
1233 PSCMD="ps -e -o pid,comm"
1235 platforms/irix/Makefile \
1236 platforms/irix/bacula-fd \
1237 platforms/irix/bacula-sd \
1238 platforms/irix/bacula-dir"
1241 DISTVER=`uname -a |awk '{print $3}'`
1244 TAPEDRIVE="/dev/nrst0"
1245 PSCMD="ps -a -o pid,command"
1246 PTHREAD_LIB="-pthread"
1247 CFLAGS="${CFLAGS} -pthread"
1250 DISTVER=`uname -a |awk '{print $3}'`
1253 TAPEDRIVE="/dev/nrst0"
1254 PSCMD="ps -a -o pid,command"
1255 PTHREAD_LIB="-pthread"
1256 CFLAGS="${CFLAGS} -pthread"
1258 platforms/openbsd/Makefile \
1259 platforms/openbsd/bacula-fd \
1260 platforms/openbsd/bacula-sd \
1261 platforms/openbsd/bacula-dir"
1264 DISTVER=`cat /etc/redhat-release | grep release |\
1266 TAPEDRIVE="/dev/nst0"
1267 PSCMD="ps -e -o pid,command"
1269 platforms/redhat/Makefile \
1270 platforms/redhat/bacula-fd \
1271 platforms/redhat/bacula-sd \
1272 platforms/redhat/bacula-dir \
1273 platforms/redhat/bacula.mysql.rh8.spec \
1274 platforms/redhat/bacula.sqlite.rh8.spec"
1275 hostname=`hostname -s`
1278 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
1279 TAPEDRIVE="/dev/nst0"
1280 PSCMD="ps -e -o pid,command"
1282 platforms/gentoo/Makefile \
1283 platforms/gentoo/bacula-fd \
1284 platforms/gentoo/bacula-sd \
1285 platforms/gentoo/bacula-dir"
1286 hostname=`hostname -s`
1290 DISTVER=`cat /etc/slackware-version`
1291 TAPEDRIVE="/dev/nst0"
1292 PSCMD="ps -e -o pid,command"
1293 hostname=`hostname -s`
1297 TAPEDRIVE="/dev/rmt/0cbn"
1298 PSCMD="ps -e -o pid,comm"
1300 platforms/solaris/Makefile \
1301 platforms/solaris/bacula-fd \
1302 platforms/solaris/bacula-sd \
1303 platforms/solaris/bacula-dir"
1304 if test x$DISTVER = x5.6 ; then
1305 AC_DEFINE(HAVE_OLD_SOCKOPT)
1309 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
1311 TAPEDRIVE="/dev/nst0"
1312 PSCMD="ps -e -o pid,command"
1313 hostname=`hostname -s`
1318 TAPEDRIVE="/dev/nst0"
1319 PSCMD="ps -e -o pid,command"
1320 hostname=`hostname -s`
1324 TAPEDRIVE="/dev/nst0"
1327 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
1333 LIBS="$PTHREAD_LIB $LIBS"
1335 AC_DEFINE_UNQUOTED(lld, "$lld")
1336 AC_DEFINE_UNQUOTED(llu, "$llu")
1343 dnl# common parts of the Makefile
1344 MCOMMON=./autoconf/Make.common
1345 AC_SUBST_FILE(MCOMMON)
1348 if test "x${subsysdir}" = "x${sbindir}" ; then
1351 echo "You have set both --sbindir and --with-subsys-dir"
1352 echo " equal to: ${subsysdir} "
1353 echo "This is not permitted. Please reconfigure."
1355 echo "Aborting configuration ..."
1361 AC_OUTPUT([autoconf/Make.common \
1364 rescue/linux/Makefile \
1365 rescue/freebsd/Makefile \
1366 rescue/solaris/Makefile \
1367 scripts/startmysql \
1369 scripts/btraceback \
1378 scripts/bacula.desktop \
1381 src/console/Makefile \
1382 src/console/console.conf \
1383 src/gnome-console/Makefile \
1384 src/gnome-console/gnome-console.conf \
1385 src/tconsole/Makefile \
1387 src/dird/bacula-dir.conf \
1389 src/stored/Makefile \
1390 src/stored/bacula-sd.conf \
1391 src/filed/Makefile \
1393 src/filed/bacula-fd.conf \
1394 src/filed/win32/Makefile \
1396 src/cats/make_catalog_backup \
1397 src/cats/delete_catalog_backup \
1398 src/cats/alter_mysql_tables \
1399 src/cats/make_mysql_tables \
1400 src/cats/drop_mysql_tables \
1401 src/cats/create_mysql_database \
1402 src/cats/grant_mysql_privileges \
1403 src/cats/alter_sqlite_tables \
1404 src/cats/make_sqlite_tables \
1405 src/cats/drop_sqlite_tables \
1406 src/cats/create_sqlite_database \
1409 src/cats/create_bdb_database \
1410 src/cats/make_bdb_tables \
1411 src/cats/drop_bdb_tables \
1412 src/cats/make_bacula_tables \
1413 src/cats/drop_bacula_tables \
1414 src/findlib/Makefile \
1415 src/tools/Makefile \
1417 [(echo "Doing make of dependencies"; make depend;) ]
1421 chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
1422 chmod 755 console gconsole
1424 chmod 755 src/cats/make_mysql_tables src/cats/drop_mysql_tables
1425 chmod 755 src/cats/make_test_tables src/cats/drop_test_tables
1426 chmod 755 src/cats/create_mysql_database
1427 chmod 755 src/cats/make_catalog_backup src/cats/delete_catalog_backup
1428 chmod 755 src/cats/alter_mysql_tables
1429 chmod 755 src/cats/grant_mysql_privileges
1430 chmod 755 src/cats/make_sqlite_tables src/cats/drop_sqlite_tables
1431 chmod 755 src/cats/make_bacula_tables src/cats/drop_bacula_tables
1432 chmod 755 src/cats/create_sqlite_database
1433 chmod 755 src/cats/alter_sqlite_tables
1434 chmod 755 src/cats/sqlite
1435 chmod 755 src/cats/make_bdb_tables src/cats/drop_bdb_tables
1436 chmod 755 src/cats/create_bdb_database
1438 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
1439 largefile_support="yes"
1442 CCVERSION=`${CC} --version | cut -b-15`
1443 CXXVERSION=`${CXX} --version | cut -b-15`
1445 if test "x${subsysdir}" = "x${sbindir}" ; then
1448 echo "You have set --sbindir and --with-subsys-dir"
1449 echo " both equal to: ${subsysdir} "
1450 echo " This is not permitted. Please reconfigure."
1451 echo "Aborting configuration ..."
1458 Configuration on `date`:
1460 Host: $host -- ${DISTNAME} ${DISTVER}
1461 Bacula version: ${VERSION} (${DATE})
1462 Source code location: ${srcdir}
1463 Install binaries: ${sbindir}
1464 Install config files: ${sysconfdir}
1465 Scripts directory: ${scriptdir}
1466 Working directory: ${working_dir}
1467 PID directory: ${piddir}
1468 Subsys directory: ${subsysdir}
1469 C Compiler: ${CC} ${CCVERSION}
1470 C++ Compiler: ${CXX} ${CXXVERSION}
1471 Compiler flags: ${WCFLAGS} ${CFLAGS}
1472 Linker flags: ${WLDFLAGS} ${LDFLAGS}
1474 Statically Linked Tools: ${support_static_tools}
1475 Statically Linked FD: ${support_static_fd}
1476 Statically Linked SD: ${support_static_sd}
1477 Statically Linked DIR: ${support_static_dir}
1478 Statically Linked CONS: ${support_static_cons}
1479 Database type: ${db_name}
1480 Database lib: ${DB_LIBS}
1482 Job Output Email: ${job_email}
1483 Traceback Email: ${dump_email}
1484 SMTP Host Address: ${smtp_host}
1485 Director Port ${dir_port}
1486 File daemon Port ${fd_port}
1487 Storage daemon Port ${sd_port}
1488 SQL binaries Directory ${SQL_BINDIR}
1490 Large file support: $largefile_support
1491 readline support: ${got_readline} ${PRTREADLINE_SRC}
1492 TCP Wrappers support: ${TCPW_MSG}
1493 ZLIB support: ${have_zlib}
1494 enable-smartalloc: ${support_smartalloc}
1495 enable-gnome: ${support_gnome}
1496 client-only: ${build_client_only}
1503 # cweb support: ${got_cweb} ${CWEB_SRC}
1504 # gmp support: ${got_gmp} ${GMP_SRC}