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
152 dnl# --------------------------------------------------------------------------
153 dnl# CHECKING COMMAND LINE OPTIONS
154 dnl# --------------------------------------------------------------------------
155 AC_ARG_ENABLE(everything,
156 [ --enable-everything enable standard non-multichoice features: marked *],
157 [if test x$enableval = xyes; then
158 support_smartalloc=yes
161 # -------------------------------------------
162 # gnome (default off)
163 # -------------------------------------------
165 [ --enable-gnome enable build of gnome-console GUI *],
166 [if test x$enableval = xyes; then
171 if test x$support_gnome = xyes; then
173 GNOME_DIR=src/gnome-console
178 # -------------------------------------------
179 # smartalloc (default off)
180 # -------------------------------------------
181 AC_ARG_ENABLE(smartalloc,
182 [ --enable-smartalloc enable smartalloc debugging support *],
183 [if test x$enableval = xno; then
184 support_smartalloc=no
187 if test x$support_smartalloc = xyes; then
188 AC_DEFINE(SMARTALLOC)
191 # -------------------------------------------
192 # static-tools (default off)
193 # -------------------------------------------
194 AC_ARG_ENABLE(static-tools,
195 [ --enable-static-tools enable static tape tools *],
196 [if test x$enableval = xyes; then
197 support_static_tools=yes
201 if test x$support_static_tools = xyes; then
202 TTOOL_LDFLAGS="-static"
204 AC_SUBST(TTOOL_LDFLAGS)
206 # -------------------------------------------
207 # static-fd (default off)
208 # -------------------------------------------
209 AC_ARG_ENABLE(static-fd,
210 [ --enable-static-fd enable static File daemon *],
211 [if test x$enableval = xyes; then
212 support_static_fd=yes
216 if test x$support_static_fd = xyes; then
221 # -------------------------------------------
222 # static-sd (default off)
223 # -------------------------------------------
224 AC_ARG_ENABLE(static-sd,
225 [ --enable-static-sd enable static Storage daemon *],
226 [if test x$enableval = xyes; then
227 support_static_sd=yes
231 if test x$support_static_sd = xyes; then
236 # -------------------------------------------
237 # static-dir (default off)
238 # -------------------------------------------
239 AC_ARG_ENABLE(static-dir,
240 [ --enable-static-dir enable static Director *],
241 [if test x$enableval = xyes; then
242 support_static_dir=yes
246 if test x$support_static_dir = xyes; then
247 DIR_LDFLAGS="-static"
249 AC_SUBST(DIR_LDFLAGS)
256 # ---------------------------------------------------
257 # Check for readline support/directory (default on)
258 # ---------------------------------------------------
259 # this allows you to turn it completely off
260 AC_ARG_ENABLE(readline,
261 [ --disable-readline disable readline support ],
262 [if test x$enableval = xno; then
268 if test x$support_readline = xyes; then
269 AC_ARG_WITH(readline,
270 [ --with-readline[=DIR] Specify readline library directory],
272 case "$with_readline" in
275 if test "$with_readline" != "yes"; then
276 CONS_INC="-I$with_readline"
277 CONS_LDFLAGS="-L$with_readline"
279 with_readline="/usr/include/readline"
281 AC_CHECK_HEADER($with_readline/readline.h,
283 AC_DEFINE(HAVE_READLINE)
284 CONS_LIBS="-lreadline -ltermcap"
287 [ AC_MSG_ERROR([*** readline library missing])
293 # check for standard readline library
294 AC_CHECK_HEADER(/usr/include/readline/readline.h,
296 AC_DEFINE(HAVE_READLINE)
298 CONS_INC="-I/usr/include/readline"
299 CONS_LIBS="-lreadline -ltermcap"
301 # Did not find starndard library, so user our own
303 AC_DEFINE(HAVE_READLINE)
305 CONS_INC="-I${TOP_DIR}/depkgs"
306 CONS_LIBS="-lreadline -lhistory -ltermcap"
307 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
308 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
315 AC_SUBST(CONS_LDFLAGS)
316 AC_SUBST(READLINE_SRC)
318 # Minimal stuff for readline Makefile configuration
325 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr setlocale lstat lchown)
327 #AC_CHECK_FUNC(getopt_long, AC_DEFINE(HAVE_GETOPT_LONG),
328 # [LIBEXTRAOBJ="$LIBEXTRAOBJ getopt.o getopt1.o"
329 # EXTRAOBJ="$EXTRAOBJ lib/getopt.o lib/getopt1.o"])
331 AC_CHECK_FUNC(getopt_long, AC_DEFINE(HAVE_GETOPT_LONG))
336 AC_CHECK_HEADERS(varargs.h \
337 sys/ptem.h sys/pte.h sys/stream.h)
339 # End of readline stuff
340 # -----------------------------------------------------------------------
343 # ---------------------------------------------------
344 # Check for GMP support/directory
345 # ---------------------------------------------------
349 # [ --with-gmp[=DIR] Specify gmp library directory],
351 # case "$with_gmp" in
354 # if test "$with_gmp" != "yes"; then
355 # GMP_INC="-I$with_gmp"
357 # GMP_LDFLAGS="-L$with_gmp"
359 # with_gmp="/usr/include"
361 # AC_CHECK_HEADER($with_gmp/gmp.h,
362 # [ AC_MSG_RESULT(yes)
363 # AC_DEFINE(HAVE_GMP)
367 # [ AC_MSG_ERROR([*** gmp library missing])
373 # # check for standard gmp library
374 # AC_CHECK_HEADER(/usr/include/gmp.h,
375 # [ AC_MSG_RESULT(yes)
376 # AC_DEFINE(HAVE_GMP)
381 # # Did not find standard library, so use our own
383 # AC_DEFINE(HAVE_GMP)
386 # GMP_INC="-I${TOP_DIR}/depkgs/gmp"
388 # GMP_LDFLAGS="-L${TOP_DIR}/depkgs/gmp"
389 # GMP_SRC="${TOP_DIR}/depkgs/gmp"
395 #AC_SUBST(GMP_LDFLAGS)
399 # -----------------------------------------------------------------------
402 # ---------------------------------------------------
403 # Check for CWEB support/directory
404 # ---------------------------------------------------
409 # [ --with-cweb[=DIR] Specify cweb library directory],
411 # case "$with_cweb" in
414 # if test "$with_cweb" != "yes"; then
415 # CWEB_INC="-I$with_cweb"
417 # CWEB_LDFLAGS="-L$with_cweb"
419 # with_cweb="/usr/include"
421 # AC_CHECK_HEADER($with_cweb/cweb.h,
422 # [ AC_MSG_RESULT(yes)
423 # AC_DEFINE(HAVE_CWEB)
427 # [ AC_MSG_ERROR([*** cweb library missing])
433 # # check for standard cweb library
434 # AC_CHECK_HEADER(/usr/include/cweb.h,
435 # [ AC_MSG_RESULT(yes)
436 # AC_DEFINE(HAVE_CWEB)
441 # # Did not find starndard library, so use our own
443 # AC_DEFINE(HAVE_CWEB)
446 # CWEB=${TOP_DIR}/depkgs/cweb
447 # CWEB_INC="-I${TOP_DIR}/depkgs/cweb"
449 # CWEB_LDFLAGS="-L${TOP_DIR}/depkgs/cweb"
450 # CWEB_SRC="${TOP_DIR}/depkgs/cweb"
457 #AC_SUBST(CWEB_LDFLAGS)
461 # -----------------------------------------------------------------------
465 # -----------------------------------------------------------
466 # Check whether user wants TCP wrappers support (default off)
467 # -----------------------------------------------------------
469 AC_ARG_WITH(tcp-wrappers,
470 [ --with-tcp-wrappers=DIR Enable tcpwrappers support],
472 if test "x$withval" != "xno" ; then
474 LIBS="$LIBS -lwrap -lnsl"
475 AC_MSG_CHECKING(for libwrap)
478 int deny_severity = 0;
479 int allow_severity = 0;
480 struct request_info *req; ],
481 [ hosts_access(req); ],
484 AC_DEFINE(HAVE_LIBWRAP)
487 [AC_MSG_ERROR([*** libwrap missing]) ]
493 # ------------------------------------------
494 # Where to place working dir
495 # ------------------------------------------
496 working_dir=`eval echo ${sysconfdir}/working`
497 AC_ARG_WITH(working-dir,
498 [ --with-working-dir=PATH Specify location of Bacula working files],
500 if test "x$withval" != "xno" ; then
506 AC_SUBST(working_dir)
508 # ------------------------------------------
509 # Where to send dump email
510 # ------------------------------------------
511 dump_email=root@localhost
512 AC_ARG_WITH(dump-email,
513 [ --with-dump-email=Dump email address],
515 if test "x$withval" != "xno" ; then
523 # ------------------------------------------
524 # Where to send job email
525 # ------------------------------------------
526 job_email=root@localhost
527 AC_ARG_WITH(job-email,
528 [ --with-job-email=Job output email address],
530 if test "x$withval" != "xno" ; then
538 # ------------------------------------------
539 # Where to find smtp host
540 # ------------------------------------------
542 AC_ARG_WITH(smtp_host,
543 [ --with-smtp-host=SMTP mail host address],
545 if test "x$withval" != "xno" ; then
554 # ------------------------------------
555 # Where to place pid files
556 # ------------------------------------
559 [ --with-pid-dir=PATH Specify location of Bacula pid files],
561 if test "x$withval" != "xno" ; then
567 # make sure the pid directory exists
568 if test ! -d $piddir ; then
569 piddir=`eval echo ${sysconfdir}`
571 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
575 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
579 # ------------------------------------
580 # Where to place subsys "lock file"
581 # ------------------------------------
582 subsysdir=/var/run/subsys
583 AC_ARG_WITH(subsys-dir,
584 [ --with-subsys-dir=PATH Specify location of Bacula subsys file],
586 if test "x$withval" != "xno" ; then
592 # make sure the pid directory exists
593 if test ! -d $subsysdir ; then
594 subsysdir=`eval echo ${sysconfdir}`
596 NONE/*) subsysdir=`echo $subsysdir | sed "s~NONE~$ac_default_prefix~"` ;;
604 # ------------------------------------
605 # Where to start assigning ports
606 # ------------------------------------
608 AC_ARG_WITH(baseport,
609 [ --with-baseport=PORT Specify base port address for daemons],
611 if test "x$withval" != "xno" ; then
618 dir_port=`expr $baseport`
619 fd_port=`expr $baseport + 1`
620 sd_port=`expr $fd_port + 1`
627 # ------------------------------------------
629 # ------------------------------------------
631 AC_ARG_WITH(dir-password,
632 [ --with-dir-password=PASSWORD Specify Director's password],
634 if test "x$withval" != "xno" ; then
635 dir_password=$withval
640 if test "x$dir_password" = "x" ; then
641 if test "x$OPENSSL" = "xnone" ; then
642 # key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" abcdefghijklmnopqrst | awk '{getline} {print} {exit}'`
643 key=`autoconf/randpass 33`
645 key=`openssl rand -base64 33`
651 AC_ARG_WITH(fd-password,
652 [ --with-fd-password=PASSWORD Specify Client's password],
654 if test "x$withval" != "xno" ; then
660 if test "x$fd_password" = "x" ; then
661 if test "x$OPENSSL" = "xnone" ; then
662 # key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" tsrqponmlkjihgfedcba | awk '{getline} {print} {exit}'`
663 key=`autoconf/randpass 37`
665 key=`openssl rand -base64 33`
671 AC_ARG_WITH(sd-password,
672 [ --with-sd-password=PASSWORD Specify Storage daemon's password],
674 if test "x$withval" != "xno" ; then
680 if test "x$sd_password" = "x" ; then
681 if test "x$OPENSSL" = "xnone" ; then
682 # key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" 123456789uvwxyzabcdef | awk '{getline} {print} {exit}'`
683 key=`autocnf/randpass 41`
685 key=`openssl rand -base64 33`
691 AC_SUBST(dir_password)
692 AC_SUBST(fd_password)
693 AC_SUBST(sd_password)
698 # ------------------------------------------------
699 # Bacula check for various SQL database engines
700 # ------------------------------------------------
704 # ------------------------------------------------
705 # Bacula check for various SQL database engines
706 # ------------------------------------------------
712 AC_DEFINE(PROTOTYPES)
714 dnl# --------------------------------------------------------------------------
715 dnl# Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
717 if test -z "$CFLAGS"; then
718 if test -z "$CCOPTS"; then
720 dnl> if test "x$GCC" = xyes; then
721 dnl> if test x$system = xLinux; then
722 dnl> CCOPTS="$CCOPTS "'-O2 -fno-strength-reduce'
733 dnl See if we can use 64 bit file addresses
734 largefile_support="no"
740 dnl# --------------------------------------------------------------------------
741 dnl# CHECKING FOR HEADER FILES
742 dnl# --------------------------------------------------------------------------
771 # It seems that that many machines where <utime.h> seems to be
772 # broken just require something like -D_XXX_SOURCE, where XXX might
773 # be POSIX, POSIX_C, ALL, HPUX or whatever, depending on the machine.
775 AC_CACHE_CHECK(for utime.h, tar_cv_header_utime_h,
777 #include <sys/types.h>
778 #include <utime.h>], [struct utimbuf foo],
779 tar_cv_header_utime_h=yes, tar_cv_header_utime_h=no)])
780 test $tar_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H)
785 dnl# --------------------------------------------------------------------------
786 dnl# CHECKING FOR FILESYSTEM TYPE
787 dnl# --------------------------------------------------------------------------
788 AC_MSG_CHECKING(how to get filesystem type)
790 # The order of these tests is important.
791 AC_TRY_CPP([#include <sys/statvfs.h>
792 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4)
793 if test $fstype = no; then
794 AC_TRY_CPP([#include <sys/statfs.h>
795 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3)
797 if test $fstype = no; then
798 AC_TRY_CPP([#include <sys/statfs.h>
799 #include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX)
801 if test $fstype = no; then
802 AC_TRY_CPP([#include <mntent.h>], AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD)
804 if test $fstype = no; then
805 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
807 if test $fstype = no; then
808 AC_TRY_CPP([#include <sys/mount.h>
809 #include <sys/fs_types.h>], AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix)
811 AC_MSG_RESULT($fstype)
813 dnl# --------------------------------------------------------------------------
814 dnl# CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
815 dnl# --------------------------------------------------------------------------
823 AC_CHECK_TYPE(ino_t, unsigned long)
824 AC_CHECK_TYPE(dev_t, unsigned long)
825 AC_CHECK_TYPE(daddr_t, long)
826 AC_CHECK_TYPE(major_t, int)
827 AC_CHECK_TYPE(minor_t, int)
828 AC_CHECK_TYPE(ssize_t, int)
835 AC_CHECK_SIZEOF(char, 1)
836 AC_CHECK_SIZEOF(short int, 2)
837 AC_CHECK_SIZEOF(int, 4)
838 AC_CHECK_SIZEOF(long int, 4)
839 AC_CHECK_SIZEOF(long long int, 8)
840 AC_CHECK_SIZEOF(int *, 4)
842 # Check for sys/types.h types
843 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
845 [ #include <sys/types.h> ],
847 [ ac_cv_have_u_int="yes" ],
848 [ ac_cv_have_u_int="no" ]
851 if test "x$ac_cv_have_u_int" = "xyes" ; then
852 AC_DEFINE(HAVE_U_INT)
856 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t, [
858 [ #include <sys/types.h> ],
859 [ intmax_t a; a = 1;],
860 [ ac_cv_have_intmax_t="yes" ],
863 [ #include <stdint.h> ],
864 [ intmax_t a; a = 1;],
865 [ ac_cv_have_intmax_t="yes" ],
866 [ ac_cv_have_intmax_t="no" ]
872 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
873 AC_DEFINE(HAVE_INTMAX_T)
878 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t, [
880 [ #include <sys/types.h> ],
881 [ u_intmax_t a; a = 1;],
882 [ ac_cv_have_u_intmax_t="yes" ],
885 [ #include <stdint.h> ],
886 [ u_intmax_t a; a = 1;],
887 [ ac_cv_have_u_intmax_t="yes" ],
888 [ ac_cv_have_u_intmax_t="no" ]
893 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
894 AC_DEFINE(HAVE_U_INTMAX_T)
899 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
901 [ #include <sys/types.h> ],
902 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
903 [ ac_cv_have_intxx_t="yes" ],
904 [ ac_cv_have_intxx_t="no" ]
907 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
908 AC_DEFINE(HAVE_INTXX_T)
912 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
914 [ #include <sys/types.h> ],
915 [ int64_t a; a = 1;],
916 [ ac_cv_have_int64_t="yes" ],
917 [ ac_cv_have_int64_t="no" ]
920 if test "x$ac_cv_have_int64_t" = "xyes" ; then
921 AC_DEFINE(HAVE_INT64_T)
925 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
927 [ #include <sys/types.h> ],
928 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
929 [ ac_cv_have_u_intxx_t="yes" ],
930 [ ac_cv_have_u_intxx_t="no" ]
933 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
934 AC_DEFINE(HAVE_U_INTXX_T)
938 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
940 [ #include <sys/types.h> ],
941 [ u_int64_t a; a = 1;],
942 [ ac_cv_have_u_int64_t="yes" ],
943 [ ac_cv_have_u_int64_t="no" ]
946 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
947 AC_DEFINE(HAVE_U_INT64_T)
951 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
952 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
954 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
956 [ #include <sys/bitypes.h> ],
957 [ int8_t a; int16_t b; int32_t c;
958 u_int8_t e; u_int16_t f; u_int32_t g;
959 a = b = c = e = f = g = 1; ],
960 [ AC_DEFINE(HAVE_U_INTXX_T)
961 AC_DEFINE(HAVE_INTXX_T)
962 AC_DEFINE(HAVE_SYS_BITYPES_H)
963 AC_MSG_RESULT(yes) ],
968 if test -z "$have_u_intxx_t" ; then
969 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
971 [ #include <sys/types.h> ],
972 [ uint8_t a; uint16_t b;
973 uint32_t c; a = b = c = 1; ],
974 [ ac_cv_have_uintxx_t="yes" ],
975 [ ac_cv_have_uintxx_t="no" ]
978 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
979 AC_DEFINE(HAVE_UINTXX_T)
984 dnl# --------------------------------------------------------------------------
985 dnl# CHECKING FOR LIBRARY FUNCTIONS
986 dnl# --------------------------------------------------------------------------
1002 [echo 'configure: cannot find needed function.'; exit 1]
1005 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
1007 AC_CHECK_FUNCS(snprintf vsnprintf gethostid getdomainname)
1009 dnl# --------------------------------------------------------------------------
1010 dnl# CHECKING FOR THREAD SAFE FUNCTIONS
1011 dnl# --------------------------------------------------------------------------
1012 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
1014 # If resolver functions are not in libc check for -lnsl or -lresolv.
1015 AC_CHECK_FUNC(gethostbyname_r,
1016 AC_MSG_RESULT(using libc's resolver),
1017 AC_CHECK_LIB(nsl,gethostbyname_r)
1018 AC_CHECK_LIB(resolv,gethostbyname_r))
1021 # Find where sockets are (especially for Solaris)
1022 AC_CHECK_FUNC(socket,
1023 AC_MSG_RESULT(using libc's socket),
1024 AC_CHECK_LIB(xnet,socket)
1025 AC_CHECK_LIB(socket,socket)
1026 AC_CHECK_LIB(inet,socket))
1028 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
1034 AC_FUNC_CLOSEDIR_VOID
1035 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
1039 dnl# FreeBSD needs to link libxpg4
1040 AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"])
1043 AC_CHECK_LIB(sun, getpwnam)
1045 AC_CHECK_HEADERS(zlib.h)
1046 AC_CHECK_LIB(z, deflate, [FDLIBS="-lz"])
1048 if test x$FDLIBS = x-lz; then
1049 AC_DEFINE(HAVE_LIBZ)
1053 dnl Check for pthread libraries
1055 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
1056 [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
1057 [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
1058 [AC_CHECK_FUNC(pthread_create)]
1068 LDFLAGS=${LDFLAGS--O}
1069 DB_LIBS="${SQL_LFLAGS}"
1071 CPPFLAGS="$CPPFLAGS"
1082 AC_SUBST(X_EXTRA_LIBS)
1084 dnl# extra configurable objects
1092 # Finally we set appropriate distribution specific
1093 # variables and defaults
1095 # PFILES are platform specific files
1096 PFILES="platforms/Makefile"
1103 PTHREAD_LIB="-lpthread -lexc"
1104 if test "${CC}" = "gcc" ; then
1111 TAPEDRIVE="/dev/nrmt0"
1114 DISTVER=`uname -a |awk '{print $3}'`
1115 TAPEDRIVE="/dev/nrst0"
1118 DISTVER=`cat /etc/.issue | grep Version | cut -f 2 -d ' '`
1119 TAPEDRIVE="/dev/nrst0"
1120 PSCMD="ps -e -o pid,command"
1121 hostname=`hostname -s`
1124 DISTVER=`uname -a |awk '{print $3}'`
1125 TAPEDRIVE="/dev/nrst0"
1127 CFLAGS="${CFLAGS} -mwindows"
1128 LDFLAGS="${LDFLAGS} -mwindows"
1131 DISTVER=`cat /etc/debian_version`
1132 TAPEDRIVE="/dev/nrst0"
1133 PSCMD="ps -e -o pid,command"
1134 hostname=`hostname -s`
1137 DISTVER=`uname -a |awk '{print $3}'`
1138 PTHREAD_LIB="-pthread"
1139 CFLAGS="${CFLAGS} -pthread"
1142 TAPEDRIVE="/dev/nrst0"
1143 PSCMD="ps -x -o pid,command"
1145 platforms/freebsd/Makefile \
1146 platforms/freebsd/bacula-fd \
1147 platforms/freebsd/bacula-sd \
1148 platforms/freebsd/bacula-dir"
1149 hostname=`hostname -s`
1150 largefile_support="yes"
1154 TAPEDRIVE="/dev/rmt/0hnb"
1158 TAPEDRIVE="/dev/rmt/0cbn"
1159 PSCMD="ps -e -o pid,comm"
1160 hostname=`/usr/bsd/hostname -s`
1162 platforms/irix/Makefile \
1163 platforms/irix/bacula-fd \
1164 platforms/irix/bacula-sd \
1165 platforms/irix/bacula-dir"
1168 DISTVER=`uname -a |awk '{print $3}'`
1171 TAPEDRIVE="/dev/nrst0"
1172 PSCMD="ps -a -o pid,command"
1173 PTHREAD_LIB="-pthread"
1174 CFLAGS="${CFLAGS} -pthread"
1177 DISTVER=`uname -a |awk '{print $3}'`
1180 TAPEDRIVE="/dev/nrst0"
1181 PSCMD="ps -a -o pid,command"
1182 PTHREAD_LIB="-pthread"
1183 CFLAGS="${CFLAGS} -pthread"
1185 platforms/openbsd/Makefile \
1186 platforms/openbsd/bacula-fd \
1187 platforms/openbsd/bacula-sd \
1188 platforms/openbsd/bacula-dir"
1191 DISTVER=`cat /etc/redhat-release | grep release |\
1193 TAPEDRIVE="/dev/nst0"
1194 PSCMD="ps -e -o pid,command"
1196 platforms/redhat/Makefile \
1197 platforms/redhat/bacula-fd \
1198 platforms/redhat/bacula-sd \
1199 platforms/redhat/bacula-dir"
1200 hostname=`hostname -s`
1203 DISTVER=`cat /etc/slackware-version`
1204 TAPEDRIVE="/dev/nst0"
1205 PSCMD="ps -e -o pid,command"
1206 hostname=`hostname -s`
1210 TAPEDRIVE="/dev/rmt/0cbn"
1211 PSCMD="ps -e -o pid,comm"
1213 platforms/solaris/Makefile \
1214 platforms/solaris/bacula-fd \
1215 platforms/solaris/bacula-sd \
1216 platforms/solaris/bacula-dir"
1219 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
1221 TAPEDRIVE="/dev/nst0"
1222 PSCMD="ps -e -o pid,command"
1223 hostname=`hostname -s`
1228 TAPEDRIVE="/dev/nst0"
1229 PSCMD="ps -e -o pid,command"
1230 hostname=`hostname -s`
1234 TAPEDRIVE="/dev/nst0"
1237 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
1244 LIBS="$PTHREAD_LIB $LIBS"
1246 AC_DEFINE_UNQUOTED(lld, "$lld")
1247 AC_DEFINE_UNQUOTED(llu, "$llu")
1255 dnl# common parts of the Makefile
1256 MCOMMON=./autoconf/Make.common
1257 AC_SUBST_FILE(MCOMMON)
1259 AC_OUTPUT([autoconf/Make.common \
1262 rescue/linux/Makefile \
1263 rescue/freebsd/Makefile \
1264 scripts/startmysql \
1266 scripts/btraceback \
1276 src/console/Makefile \
1277 src/console/console.conf \
1278 src/gnome-console/Makefile \
1279 src/gnome-console/gnome-console.conf \
1281 src/dird/bacula-dir.conf \
1283 src/stored/Makefile \
1284 src/stored/bacula-sd.conf \
1285 src/filed/Makefile \
1287 src/filed/bacula-fd.conf \
1288 src/filed/win32/Makefile \
1290 src/cats/alter_mysql_tables \
1291 src/cats/make_mysql_tables \
1292 src/cats/drop_mysql_tables \
1293 src/cats/create_mysql_database \
1294 src/cats/grant_mysql_privileges \
1295 src/cats/alter_sqlite_tables \
1296 src/cats/make_sqlite_tables \
1297 src/cats/drop_sqlite_tables \
1298 src/cats/create_sqlite_database \
1301 src/cats/create_bdb_database \
1302 src/cats/make_bdb_tables \
1303 src/cats/drop_bdb_tables \
1304 src/cats/make_bacula_tables \
1305 src/cats/drop_bacula_tables \
1306 src/findlib/Makefile \
1307 src/tools/Makefile \
1309 [(echo "Doing make of dependencies"; make depend;) ]
1313 chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
1314 chmod 755 console gconsole
1316 chmod 755 src/cats/make_mysql_tables src/cats/drop_mysql_tables
1317 chmod 755 src/cats/make_test_tables src/cats/drop_test_tables
1318 chmod 755 src/cats/create_mysql_database
1319 chmod 755 src/cats/alter_mysql_tables
1320 chmod 755 src/cats/grant_mysql_privileges
1321 chmod 755 src/cats/make_sqlite_tables src/cats/drop_sqlite_tables
1322 chmod 755 src/cats/make_bacula_tables src/cats/drop_bacula_tables
1323 chmod 755 src/cats/create_sqlite_database
1324 chmod 755 src/cats/alter_sqlite_tables
1325 chmod 755 src/cats/sqlite
1326 chmod 755 src/cats/make_bdb_tables src/cats/drop_bdb_tables
1327 chmod 755 src/cats/create_bdb_database
1329 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
1330 largefile_support="yes"
1335 Configuration on `date`:
1337 Host: $host -- ${DISTNAME} ${DISTVER}
1338 Bacula version: ${VERSION} (${DATE})
1339 Source code location: ${srcdir}
1340 Install binaries: ${sbindir}
1341 Install config files: ${sysconfdir}
1343 C++ Compiler: ${CXX}
1344 Compiler flags: ${CFLAGS}
1345 Linker flags: ${LDFLAGS}
1347 Statically Linked Tools: ${support_static_tools}
1348 Statically Linked FD: ${support_static_fd}
1349 Database type: ${db_name}
1350 Database lib: ${DB_LIBS}
1352 Job Output Email: ${job_email}
1353 Traceback Email: ${dump_email}
1354 SMTP Host Address: ${smtp_host}
1355 Director Port ${dir_port}
1356 File daemon Port ${fd_port}
1357 Storage daemon Port ${sd_port}
1358 Working directory ${working_dir}
1359 SQL binaries Directory ${SQL_BINDIR}
1361 Large file support: $largefile_support
1362 readline support: ${got_readline} ${PRTREADLINE_SRC}
1363 TCP Wrappers support: ${TCPW_MSG}
1364 ZLIB support: ${have_zlib}
1365 enable-smartalloc: ${support_smartalloc}
1366 enable-gnome: ${support_gnome}
1373 # cweb support: ${got_cweb} ${CWEB_SRC}
1374 # gmp support: ${got_gmp} ${GMP_SRC}