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-other 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/gnome-console
186 GNOME_DIR=src/gnome-console
192 # -------------------------------------------
193 # smartalloc (default off)
194 # -------------------------------------------
195 AC_ARG_ENABLE(smartalloc,
196 [ --enable-smartalloc enable smartalloc debugging support [disabled]],
197 [if test x$enableval = xno; then
198 support_smartalloc=no
201 if test x$support_smartalloc = xyes; then
202 AC_DEFINE(SMARTALLOC)
205 # -------------------------------------------
206 # static-tools (default off)
207 # -------------------------------------------
208 AC_ARG_ENABLE(static-tools,
209 [ --enable-static-tools enable static tape tools [disabled]],
210 [if test x$enableval = xyes; then
211 support_static_tools=yes
215 if test x$support_static_tools = xyes; then
216 TTOOL_LDFLAGS="-static"
218 AC_SUBST(TTOOL_LDFLAGS)
220 # -------------------------------------------
221 # static-fd (default off)
222 # -------------------------------------------
223 AC_ARG_ENABLE(static-fd,
224 [ --enable-static-fd enable static File daemon [disabled]],
225 [if test x$enableval = xyes; then
226 support_static_fd=yes
230 if test x$support_static_fd = xyes; then
231 STATIC_FD="static-bacula-fd"
235 # -------------------------------------------
236 # static-sd (default off)
237 # -------------------------------------------
238 AC_ARG_ENABLE(static-sd,
239 [ --enable-static-sd enable static Storage daemon [disabled]],
240 [if test x$enableval = xyes; then
241 support_static_sd=yes
245 if test x$support_static_sd = xyes; then
246 STATIC_SD="static-bacula-sd"
250 # -------------------------------------------
251 # static-dir (default off)
252 # -------------------------------------------
253 AC_ARG_ENABLE(static-dir,
254 [ --enable-static-dir enable static Director [disabled]],
255 [if test x$enableval = xyes; then
256 support_static_dir=yes
260 if test x$support_static_dir = xyes; then
261 STATIC_DIR="static-bacula-dir"
265 # -------------------------------------------
266 # static-cons (default off)
267 # -------------------------------------------
268 AC_ARG_ENABLE(static-cons,
269 [ --enable-static-cons enable static Console [disabled]],
270 [if test x$enableval = xyes; then
271 support_static_cons=yes
275 if test x$support_static_cons = xyes; then
276 STATIC_CONS="static-console"
278 AC_SUBST(STATIC_CONS)
280 # -------------------------------------------
281 # client_only (default off)
282 # -------------------------------------------
283 AC_ARG_ENABLE(client-only,
284 [ --enable-client-only build client (File daemon) only [disabled]],
285 [if test x$enableval = xyes; then
286 build_client_only=yes
288 if test x$build_client_only = xno; then
295 # ---------------------------------------------------
296 # Check for readline support/directory (default on)
297 # ---------------------------------------------------
298 # this allows you to turn it completely off
299 AC_ARG_ENABLE(readline,
300 [ --disable-readline disable readline support [enabled]
302 [if test x$enableval = xno; then
308 if test x$support_readline = xyes; then
309 AC_ARG_WITH(readline,
310 [ --with-readline=DIR specify readline library directory],
312 case "$with_readline" in
315 if test "$with_readline" != "yes"; then
316 CONS_INC="-I${with_readline}"
317 CONS_LDFLAGS="-L$with_readline"
319 with_readline="/usr/include/readline"
321 AC_CHECK_HEADER(${with_readline}/readline.h,
322 [ AC_DEFINE(HAVE_READLINE)
323 CONS_LIBS="-lreadline -ltermcap"
326 [ AC_MSG_ERROR([*** readline library missing])
332 # check for standard readline library
333 AC_CHECK_HEADER(/usr/include/readline/readline.h,
334 [ AC_DEFINE(HAVE_READLINE)
336 CONS_INC="-I/usr/include/readline"
337 CONS_LIBS="-lreadline -ltermcap"
339 # Did not find standard library, so try Bacula's default
340 AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h,
341 [ AC_DEFINE(HAVE_READLINE)
343 CONS_INC="-I${TOP_DIR}/depkgs/readline"
344 CONS_LIBS="-lreadline -lhistory -ltermcap"
345 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
346 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
348 [ AC_MSG_ERROR([*** readline library missing])
358 AC_SUBST(CONS_LDFLAGS)
359 AC_SUBST(READLINE_SRC)
361 # Minimal stuff for readline Makefile configuration
368 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr setlocale lstat lchown)
369 AC_CHECK_FUNCS(nanosleep)
371 AC_CHECK_HEADERS(varargs.h)
373 # End of readline stuff
374 # -----------------------------------------------------------------------
377 # ---------------------------------------------------
378 # Check for GMP support/directory
379 # ---------------------------------------------------
383 # [ --with-gmp[=DIR] Specify gmp library directory],
385 # case "$with_gmp" in
388 # if test "$with_gmp" != "yes"; then
389 # GMP_INC="-I$with_gmp"
391 # GMP_LDFLAGS="-L$with_gmp"
393 # with_gmp="/usr/include"
395 # AC_CHECK_HEADER($with_gmp/gmp.h,
396 # [ AC_MSG_RESULT(yes)
397 # AC_DEFINE(HAVE_GMP)
401 # [ AC_MSG_ERROR([*** gmp library missing])
407 # # check for standard gmp library
408 # AC_CHECK_HEADER(/usr/include/gmp.h,
409 # [ AC_MSG_RESULT(yes)
410 # AC_DEFINE(HAVE_GMP)
415 # # Did not find standard library, so use our own
417 # AC_DEFINE(HAVE_GMP)
420 # GMP_INC="-I${TOP_DIR}/depkgs/gmp"
422 # GMP_LDFLAGS="-L${TOP_DIR}/depkgs/gmp"
423 # GMP_SRC="${TOP_DIR}/depkgs/gmp"
429 #AC_SUBST(GMP_LDFLAGS)
433 # -----------------------------------------------------------------------
436 # ---------------------------------------------------
437 # Check for CWEB support/directory
438 # ---------------------------------------------------
443 # [ --with-cweb[=DIR] Specify cweb library directory],
445 # case "$with_cweb" in
448 # if test "$with_cweb" != "yes"; then
449 # CWEB_INC="-I$with_cweb"
451 # CWEB_LDFLAGS="-L$with_cweb"
453 # with_cweb="/usr/include"
455 # AC_CHECK_HEADER($with_cweb/cweb.h,
456 # [ AC_MSG_RESULT(yes)
457 # AC_DEFINE(HAVE_CWEB)
461 # [ AC_MSG_ERROR([*** cweb library missing])
467 # # check for standard cweb library
468 # AC_CHECK_HEADER(/usr/include/cweb.h,
469 # [ AC_MSG_RESULT(yes)
470 # AC_DEFINE(HAVE_CWEB)
475 # # Did not find starndard library, so use our own
477 # AC_DEFINE(HAVE_CWEB)
480 # CWEB=${TOP_DIR}/depkgs/cweb
481 # CWEB_INC="-I${TOP_DIR}/depkgs/cweb"
483 # CWEB_LDFLAGS="-L${TOP_DIR}/depkgs/cweb"
484 # CWEB_SRC="${TOP_DIR}/depkgs/cweb"
491 #AC_SUBST(CWEB_LDFLAGS)
495 # -----------------------------------------------------------------------
499 # -----------------------------------------------------------
500 # Check whether user wants TCP wrappers support (default off)
501 # -----------------------------------------------------------
503 AC_ARG_WITH(tcp-wrappers,
504 [ --with-tcp-wrappers=DIR enable tcpwrappers support],
506 if test "x$withval" != "xno" ; then
508 LIBS="$LIBS -lwrap -lnsl"
509 AC_MSG_CHECKING(for libwrap)
512 int deny_severity = 0;
513 int allow_severity = 0;
514 struct request_info *req; ],
515 [ hosts_access(req); ],
518 AC_DEFINE(HAVE_LIBWRAP)
521 [AC_MSG_ERROR([*** libwrap missing]) ]
527 # ------------------------------------------
528 # Where to place working dir
529 # ------------------------------------------
530 working_dir=`eval echo ${sysconfdir}/working`
531 AC_ARG_WITH(working-dir,
532 [ --with-working-dir=PATH specify path of Bacula working directory],
534 if test "x$withval" != "xno" ; then
540 AC_SUBST(working_dir)
543 # ------------------------------------------
544 # Where to place scriptdir (script files)
545 # ------------------------------------------
546 scriptdir=`eval echo ${sysconfdir}`
547 AC_ARG_WITH(scriptdir,
548 [ --with-scriptdir=PATH specify path of Bacula scripts directory],
550 if test "x$withval" != "xno" ; then
559 # ------------------------------------------
560 # Where to send dump email
561 # ------------------------------------------
562 dump_email=root@localhost
563 AC_ARG_WITH(dump-email,
564 [ --with-dump-email=EMAIL dump email address],
566 if test "x$withval" != "xno" ; then
574 # ------------------------------------------
575 # Where to send job email
576 # ------------------------------------------
577 job_email=root@localhost
578 AC_ARG_WITH(job-email,
579 [ --with-job-email=EMAIL job output email address],
581 if test "x$withval" != "xno" ; then
589 # ------------------------------------------
590 # Where to find smtp host
591 # ------------------------------------------
593 AC_ARG_WITH(smtp_host,
594 [ --with-smtp-host=HOST SMTP mail host address],
596 if test "x$withval" != "xno" ; then
605 # ------------------------------------
606 # Where to place pid files
607 # ------------------------------------
610 [ --with-pid-dir=PATH specify location of Bacula pid files],
612 if test "x$withval" != "xno" ; then
618 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
622 # ------------------------------------
623 # Where to place subsys "lock file"
624 # ------------------------------------
625 subsysdir=/var/run/subsys
626 AC_ARG_WITH(subsys-dir,
627 [ --with-subsys-dir=PATH specify location of Bacula subsys file],
629 if test "x$withval" != "xno" ; then
639 # ------------------------------------
640 # Where to start assigning ports
641 # ------------------------------------
643 AC_ARG_WITH(baseport,
644 [ --with-baseport=PORT specify base port address for daemons],
646 if test "x$withval" != "xno" ; then
653 dir_port=`expr $baseport`
654 fd_port=`expr $baseport + 1`
655 sd_port=`expr $fd_port + 1`
662 # ------------------------------------------
664 # ------------------------------------------
666 AC_ARG_WITH(dir-password,
667 [ --with-dir-password=PASSWORD specify Director's password],
669 if test "x$withval" != "xno" ; then
670 dir_password=$withval
675 if test "x$dir_password" = "x" ; then
676 if test "x$OPENSSL" = "xnone" ; then
677 # key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" abcdefghijklmnopqrst | awk '{getline} {print} {exit}'`
678 key=`autoconf/randpass 33`
680 key=`openssl rand -base64 33`
686 AC_ARG_WITH(fd-password,
687 [ --with-fd-password=PASSWORD specify Client's password],
689 if test "x$withval" != "xno" ; then
695 if test "x$fd_password" = "x" ; then
696 if test "x$OPENSSL" = "xnone" ; then
697 # key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" tsrqponmlkjihgfedcba | awk '{getline} {print} {exit}'`
698 key=`autoconf/randpass 37`
700 key=`openssl rand -base64 33`
706 AC_ARG_WITH(sd-password,
707 [ --with-sd-password=PASSWORD specify Storage daemon's password],
709 if test "x$withval" != "xno" ; then
715 if test "x$sd_password" = "x" ; then
716 if test "x$OPENSSL" = "xnone" ; then
717 # key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" 123456789uvwxyzabcdef | awk '{getline} {print} {exit}'`
718 key=`autoconf/randpass 41`
720 key=`openssl rand -base64 33`
726 AC_SUBST(dir_password)
727 AC_SUBST(fd_password)
728 AC_SUBST(sd_password)
733 # ------------------------------------------------
734 # Bacula check for various SQL database engines
735 # ------------------------------------------------
739 # ------------------------------------------------
740 # Bacula check for various SQL database engines
741 # ------------------------------------------------
747 AC_DEFINE(PROTOTYPES)
749 dnl# --------------------------------------------------------------------------
750 dnl# Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
752 if test -z "$CFLAGS"; then
753 if test -z "$CCOPTS"; then
755 dnl> if test "x$GCC" = xyes; then
756 dnl> if test x$system = xLinux; then
757 dnl> CCOPTS="$CCOPTS "'-O2 -fno-strength-reduce'
768 dnl See if we can use 64 bit file addresses
769 largefile_support="no"
775 dnl# --------------------------------------------------------------------------
776 dnl# CHECKING FOR HEADER FILES
777 dnl# --------------------------------------------------------------------------
812 dnl# --------------------------------------------------------------------------
813 dnl# Check for utime.h structure
814 dnl# --------------------------------------------------------------------------
815 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
817 #include <sys/types.h>
818 #include <utime.h>], [struct utimbuf foo],
819 ba_cv_header_utime_h=yes, ba_cv_header_utime_h=no)])
820 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H)
822 dnl# --------------------------------------------------------------------------
823 dnl# Check for socklen_t
824 dnl# --------------------------------------------------------------------------
825 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
827 #include <sys/types.h>
828 #include <sys/socket.h>],
830 ba_cv_header_socklen_t=yes, ba_cv_header_socklen_t=no)])
831 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T)
833 dnl# --------------------------------------------------------------------------
834 dnl# Check for bigendian
835 dnl# --------------------------------------------------------------------------
836 AC_CACHE_CHECK([for bigendian], ba_cv_bigendian,
838 [main(){long a=1L; char *p=(char *)&a; exit(*p);}],
839 [ba_cv_bigendian=yes],
840 [ba_cv_bigendian=no],
841 [ba_cv_bigendian=no])])
842 test $ba_cv_bigendian = yes && AC_DEFINE(HAVE_BIGENDIAN)
848 dnl# --------------------------------------------------------------------------
849 dnl# CHECKING FOR FILESYSTEM TYPE
850 dnl# --------------------------------------------------------------------------
851 AC_MSG_CHECKING(how to get filesystem type)
853 # The order of these tests is important.
854 AC_TRY_CPP([#include <sys/statvfs.h>
855 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4)
856 if test $fstype = no; then
857 AC_TRY_CPP([#include <sys/statfs.h>
858 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3)
860 if test $fstype = no; then
861 AC_TRY_CPP([#include <sys/statfs.h>
862 #include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX)
864 if test $fstype = no; then
865 AC_TRY_CPP([#include <mntent.h>], AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD)
867 if test $fstype = no; then
868 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
870 if test $fstype = no; then
871 AC_TRY_CPP([#include <sys/mount.h>
872 #include <sys/fs_types.h>], AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix)
874 AC_MSG_RESULT($fstype)
876 dnl# --------------------------------------------------------------------------
877 dnl# CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
878 dnl# --------------------------------------------------------------------------
886 AC_CHECK_TYPE(ino_t, unsigned long)
887 AC_CHECK_TYPE(dev_t, unsigned long)
888 AC_CHECK_TYPE(daddr_t, long)
889 AC_CHECK_TYPE(major_t, int)
890 AC_CHECK_TYPE(minor_t, int)
891 AC_CHECK_TYPE(ssize_t, int)
898 AC_CHECK_SIZEOF(char, 1)
899 AC_CHECK_SIZEOF(short int, 2)
900 AC_CHECK_SIZEOF(int, 4)
901 AC_CHECK_SIZEOF(long int, 4)
902 AC_CHECK_SIZEOF(long long int, 8)
903 AC_CHECK_SIZEOF(int *, 4)
905 # Check for sys/types.h types
906 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
908 [ #include <sys/types.h> ],
910 [ ac_cv_have_u_int="yes" ],
911 [ ac_cv_have_u_int="no" ]
914 if test "x$ac_cv_have_u_int" = "xyes" ; then
915 AC_DEFINE(HAVE_U_INT)
919 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t, [
921 [ #include <sys/types.h> ],
922 [ intmax_t a; a = 1;],
923 [ ac_cv_have_intmax_t="yes" ],
926 [ #include <stdint.h> ],
927 [ intmax_t a; a = 1;],
928 [ ac_cv_have_intmax_t="yes" ],
929 [ ac_cv_have_intmax_t="no" ]
935 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
936 AC_DEFINE(HAVE_INTMAX_T)
941 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t, [
943 [ #include <sys/types.h> ],
944 [ u_intmax_t a; a = 1;],
945 [ ac_cv_have_u_intmax_t="yes" ],
948 [ #include <stdint.h> ],
949 [ u_intmax_t a; a = 1;],
950 [ ac_cv_have_u_intmax_t="yes" ],
951 [ ac_cv_have_u_intmax_t="no" ]
956 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
957 AC_DEFINE(HAVE_U_INTMAX_T)
962 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
964 [ #include <sys/types.h> ],
965 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
966 [ ac_cv_have_intxx_t="yes" ],
967 [ ac_cv_have_intxx_t="no" ]
970 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
971 AC_DEFINE(HAVE_INTXX_T)
975 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
977 [ #include <sys/types.h> ],
978 [ int64_t a; a = 1;],
979 [ ac_cv_have_int64_t="yes" ],
980 [ ac_cv_have_int64_t="no" ]
983 if test "x$ac_cv_have_int64_t" = "xyes" ; then
984 AC_DEFINE(HAVE_INT64_T)
988 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
990 [ #include <sys/types.h> ],
991 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
992 [ ac_cv_have_u_intxx_t="yes" ],
993 [ ac_cv_have_u_intxx_t="no" ]
996 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
997 AC_DEFINE(HAVE_U_INTXX_T)
1001 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1003 [ #include <sys/types.h> ],
1004 [ u_int64_t a; a = 1;],
1005 [ ac_cv_have_u_int64_t="yes" ],
1006 [ ac_cv_have_u_int64_t="no" ]
1009 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1010 AC_DEFINE(HAVE_U_INT64_T)
1014 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1015 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1017 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1019 [ #include <sys/bitypes.h> ],
1020 [ int8_t a; int16_t b; int32_t c;
1021 u_int8_t e; u_int16_t f; u_int32_t g;
1022 a = b = c = e = f = g = 1; ],
1023 [ AC_DEFINE(HAVE_U_INTXX_T)
1024 AC_DEFINE(HAVE_INTXX_T)
1025 AC_DEFINE(HAVE_SYS_BITYPES_H)
1026 AC_MSG_RESULT(yes) ],
1027 [ AC_MSG_RESULT(no)]
1031 if test -z "$have_u_intxx_t" ; then
1032 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1034 [ #include <sys/types.h> ],
1035 [ uint8_t a; uint16_t b;
1036 uint32_t c; a = b = c = 1; ],
1037 [ ac_cv_have_uintxx_t="yes" ],
1038 [ ac_cv_have_uintxx_t="no" ]
1041 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1042 AC_DEFINE(HAVE_UINTXX_T)
1047 dnl# --------------------------------------------------------------------------
1048 dnl# CHECKING FOR LIBRARY FUNCTIONS
1049 dnl# --------------------------------------------------------------------------
1065 [echo 'configure: cannot find needed function.'; exit 1]
1068 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
1069 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
1071 AC_CHECK_FUNCS(chflags)
1073 AC_CHECK_FUNCS(snprintf vsnprintf gethostid getdomainname)
1075 dnl# --------------------------------------------------------------------------
1076 dnl# CHECKING FOR THREAD SAFE FUNCTIONS
1077 dnl# --------------------------------------------------------------------------
1078 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
1080 # If resolver functions are not in libc check for -lnsl or -lresolv.
1081 AC_CHECK_FUNC(gethostbyname_r,
1082 AC_MSG_RESULT(using libc's resolver),
1083 AC_CHECK_LIB(nsl,gethostbyname_r)
1084 AC_CHECK_LIB(resolv,gethostbyname_r))
1087 # Find where sockets are (especially for Solaris)
1088 AC_CHECK_FUNC(socket,
1089 AC_MSG_RESULT(using libc's socket),
1090 AC_CHECK_LIB(xnet,socket)
1091 AC_CHECK_LIB(socket,socket)
1092 AC_CHECK_LIB(inet,socket))
1094 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
1100 AC_FUNC_CLOSEDIR_VOID
1101 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
1105 dnl# FreeBSD needs to link libxpg4
1106 AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"])
1109 AC_CHECK_LIB(sun, getpwnam)
1111 AC_CHECK_HEADERS(zlib.h)
1112 AC_CHECK_LIB(z, deflate, [FDLIBS="-lz"])
1114 if test x$FDLIBS = x-lz; then
1115 AC_DEFINE(HAVE_LIBZ)
1119 dnl Check for pthread libraries
1121 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
1122 [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
1123 [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
1124 [AC_CHECK_FUNC(pthread_create)]
1134 LDFLAGS=${LDFLAGS--O}
1135 DB_LIBS="${SQL_LFLAGS}"
1137 CPPFLAGS="$CPPFLAGS"
1148 AC_SUBST(X_EXTRA_LIBS)
1152 dnl# extra configurable objects
1163 # Finally we set appropriate distribution specific
1164 # variables and defaults
1166 # PFILES are platform specific files
1167 PFILES="platforms/Makefile"
1174 PSCMD="ps -e -o pid,comm"
1176 platforms/aix/Makefile"
1177 TAPEDRIVE="/dev/rmt0.1"
1181 PTHREAD_LIB="-lpthread -lexc"
1182 if test "${CC}" = "gcc" ; then
1189 TAPEDRIVE="/dev/nrmt0"
1192 DISTVER=`uname -a |awk '{print $3}'`
1193 TAPEDRIVE="/dev/nrmt0"
1194 PTHREAD_LIB="-pthread"
1195 CFLAGS="${CFLAGS} -pthread"
1196 PSCMD="ps -x -o pid,command"
1200 platforms/bsdi/Makefile \
1201 platforms/bsdi/bacula-fd \
1202 platforms/bsdi/bacula-sd \
1203 platforms/bsdi/bacula-dir"
1204 hostname=`hostname -s`
1205 largefile_support="yes"
1208 DISTVER=`uname -a |awk '{print $3}'`
1209 TAPEDRIVE="/dev/nrst0"
1212 WLDFLAGS="-mwindows"
1216 TAPEDRIVE="/dev/nst0"
1217 PSCMD="ps -e -o pid,command"
1218 hostname=`hostname -s`
1220 platforms/darwin/Makefile"
1223 DISTVER=`cat /etc/debian_version`
1224 TAPEDRIVE="/dev/nrst0"
1225 PSCMD="ps -e -o pid,command"
1226 hostname=`hostname -s`
1229 DISTVER=`uname -a |awk '{print $3}'`
1230 VER=`echo $DISTVER | cut -c 1`
1231 if test x$VER = x4 ; then
1232 PTHREAD_LIB="-pthread"
1233 CFLAGS="${CFLAGS} -pthread"
1237 TAPEDRIVE="/dev/nrsa0"
1238 PSCMD="ps -x -o pid,command"
1240 platforms/freebsd/Makefile \
1241 platforms/freebsd/bacula-fd \
1242 platforms/freebsd/bacula-sd \
1243 platforms/freebsd/bacula-dir"
1244 hostname=`hostname -s`
1245 largefile_support="yes"
1249 TAPEDRIVE="/dev/rmt/0hnb"
1253 TAPEDRIVE="/dev/rmt/0cbn"
1254 PSCMD="ps -e -o pid,comm"
1256 platforms/irix/Makefile \
1257 platforms/irix/bacula-fd \
1258 platforms/irix/bacula-sd \
1259 platforms/irix/bacula-dir"
1262 DISTVER=`uname -a |awk '{print $3}'`
1265 TAPEDRIVE="/dev/nrst0"
1266 PSCMD="ps -a -o pid,command"
1267 PTHREAD_LIB="-pthread"
1268 CFLAGS="${CFLAGS} -pthread"
1271 DISTVER=`uname -a |awk '{print $3}'`
1274 TAPEDRIVE="/dev/nrst0"
1275 PSCMD="ps -a -o pid,command"
1276 PTHREAD_LIB="-pthread"
1277 CFLAGS="${CFLAGS} -pthread"
1279 platforms/openbsd/Makefile \
1280 platforms/openbsd/bacula-fd \
1281 platforms/openbsd/bacula-sd \
1282 platforms/openbsd/bacula-dir"
1285 DISTVER=`cat /etc/redhat-release | grep release |\
1287 TAPEDRIVE="/dev/nst0"
1288 PSCMD="ps -e -o pid,command"
1290 platforms/redhat/Makefile \
1291 platforms/redhat/bacula-fd \
1292 platforms/redhat/bacula-sd \
1293 platforms/redhat/bacula-dir \
1294 platforms/redhat/bacula.spec \
1296 hostname=`hostname -s`
1299 DISTVER=`cat /etc/mandrake-release | grep release |\
1301 TAPEDRIVE="/dev/nst0"
1302 PSCMD="ps -e -o pid,command"
1304 platforms/mandrake/Makefile \
1305 platforms/mandrake/bacula-fd \
1306 platforms/mandrake/bacula-sd \
1307 platforms/mandrake/bacula-dir \
1308 platforms/mandrake/bacula.spec \
1310 hostname=`hostname -s`
1313 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
1314 TAPEDRIVE="/dev/nst0"
1315 PSCMD="ps -e -o pid,command"
1317 platforms/gentoo/Makefile \
1318 platforms/gentoo/bacula-fd \
1319 platforms/gentoo/bacula-sd \
1320 platforms/gentoo/bacula-dir"
1321 hostname=`hostname -s`
1325 DISTVER=`cat /etc/slackware-version`
1326 TAPEDRIVE="/dev/nst0"
1327 PSCMD="ps -e -o pid,command"
1328 hostname=`hostname -s`
1332 TAPEDRIVE="/dev/rmt/0cbn"
1333 PSCMD="ps -e -o pid,comm"
1335 platforms/solaris/Makefile \
1336 platforms/solaris/bacula-fd \
1337 platforms/solaris/bacula-sd \
1338 platforms/solaris/bacula-dir"
1339 if test x$DISTVER = x5.6 ; then
1340 AC_DEFINE(HAVE_OLD_SOCKOPT)
1344 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
1346 TAPEDRIVE="/dev/nst0"
1347 PSCMD="ps -e -o pid,command"
1348 hostname=`hostname -s`
1353 TAPEDRIVE="/dev/nst0"
1354 PSCMD="ps -e -o pid,command"
1355 hostname=`hostname -s`
1359 TAPEDRIVE="/dev/nst0"
1362 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
1368 LIBS="$PTHREAD_LIB $LIBS"
1370 AC_DEFINE_UNQUOTED(lld, "$lld")
1371 AC_DEFINE_UNQUOTED(llu, "$llu")
1378 dnl# common parts of the Makefile
1379 MCOMMON=./autoconf/Make.common
1380 AC_SUBST_FILE(MCOMMON)
1383 if test "x${subsysdir}" = "x${sbindir}" ; then
1386 echo "You have set both --sbindir and --with-subsys-dir"
1387 echo " equal to: ${subsysdir} "
1388 echo "This is not permitted. Please reconfigure."
1390 echo "Aborting configuration ..."
1396 AC_OUTPUT([autoconf/Make.common \
1399 rescue/linux/Makefile \
1400 rescue/freebsd/Makefile \
1401 rescue/solaris/Makefile \
1402 scripts/startmysql \
1404 scripts/btraceback \
1413 scripts/bacula.desktop.gnome1 \
1414 scripts/bacula.desktop.gnome2 \
1415 scripts/mtx-changer \
1419 src/console/Makefile \
1420 src/console/console.conf \
1421 src/gnome-console/Makefile \
1422 src/gnome-console/gnome-console.conf \
1423 src/tconsole/Makefile \
1425 src/dird/bacula-dir.conf \
1427 src/stored/Makefile \
1428 src/stored/bacula-sd.conf \
1429 src/filed/Makefile \
1430 src/filed/bacula-fd.conf \
1431 src/filed/win32/Makefile \
1433 src/cats/make_catalog_backup \
1434 src/cats/delete_catalog_backup \
1435 src/cats/alter_mysql_tables \
1436 src/cats/make_mysql_tables \
1437 src/cats/drop_mysql_tables \
1438 src/cats/create_mysql_database \
1439 src/cats/grant_mysql_privileges \
1440 src/cats/alter_sqlite_tables \
1441 src/cats/make_sqlite_tables \
1442 src/cats/drop_sqlite_tables \
1443 src/cats/create_sqlite_database \
1446 src/cats/create_bdb_database \
1447 src/cats/make_bdb_tables \
1448 src/cats/drop_bdb_tables \
1449 src/cats/make_bacula_tables \
1450 src/cats/drop_bacula_tables \
1451 src/findlib/Makefile \
1452 src/tools/Makefile \
1454 [(echo "Doing make of dependencies"; make depend;) ]
1458 chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
1459 chmod 755 console gconsole mtx-changer
1461 chmod 755 src/cats/make_mysql_tables src/cats/drop_mysql_tables
1462 chmod 755 src/cats/make_test_tables src/cats/drop_test_tables
1463 chmod 755 src/cats/create_mysql_database
1464 chmod 755 src/cats/make_catalog_backup src/cats/delete_catalog_backup
1465 chmod 755 src/cats/alter_mysql_tables
1466 chmod 755 src/cats/grant_mysql_privileges
1467 chmod 755 src/cats/make_sqlite_tables src/cats/drop_sqlite_tables
1468 chmod 755 src/cats/make_bacula_tables src/cats/drop_bacula_tables
1469 chmod 755 src/cats/create_sqlite_database
1470 chmod 755 src/cats/alter_sqlite_tables
1471 chmod 755 src/cats/sqlite
1472 chmod 755 src/cats/make_bdb_tables src/cats/drop_bdb_tables
1473 chmod 755 src/cats/create_bdb_database
1475 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
1476 largefile_support="yes"
1480 # A whole lot of hand springs to get the compiler version.
1481 # This is because gcc changed the output in version 3.0
1483 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
1484 if test "x${CCVERSION}" = "x" ; then
1485 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
1487 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
1488 if test x"${CXXVERSION}" = x ; then
1489 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
1492 if test "x${subsysdir}" = "x${sbindir}" ; then
1495 echo "You have set --sbindir and --with-subsys-dir"
1496 echo " both equal to: ${subsysdir} "
1497 echo " This is not permitted. Please reconfigure."
1498 echo "Aborting configuration ..."
1505 Configuration on `date`:
1507 Host: $host -- ${DISTNAME} ${DISTVER}
1508 Bacula version: ${VERSION} (${DATE})
1509 Source code location: ${srcdir}
1510 Install binaries: ${sbindir}
1511 Install config files: ${sysconfdir}
1512 Scripts directory: ${scriptdir}
1513 Working directory: ${working_dir}
1514 PID directory: ${piddir}
1515 Subsys directory: ${subsysdir}
1516 C Compiler: ${CC} ${CCVERSION}
1517 C++ Compiler: ${CXX} ${CXXVERSION}
1518 Compiler flags: ${WCFLAGS} ${CFLAGS}
1519 Linker flags: ${WLDFLAGS} ${LDFLAGS}
1521 Statically Linked Tools: ${support_static_tools}
1522 Statically Linked FD: ${support_static_fd}
1523 Statically Linked SD: ${support_static_sd}
1524 Statically Linked DIR: ${support_static_dir}
1525 Statically Linked CONS: ${support_static_cons}
1526 Database type: ${db_name}
1527 Database lib: ${DB_LIBS}
1529 Job Output Email: ${job_email}
1530 Traceback Email: ${dump_email}
1531 SMTP Host Address: ${smtp_host}
1532 Director Port ${dir_port}
1533 File daemon Port ${fd_port}
1534 Storage daemon Port ${sd_port}
1535 SQL binaries Directory ${SQL_BINDIR}
1537 Large file support: $largefile_support
1538 readline support: ${got_readline} ${PRTREADLINE_SRC}
1539 TCP Wrappers support: ${TCPW_MSG}
1540 ZLIB support: ${have_zlib}
1541 enable-smartalloc: ${support_smartalloc}
1542 enable-gnome: ${support_gnome}
1543 client-only: ${build_client_only}
1550 # cweb support: ${got_cweb} ${CWEB_SRC}
1551 # gmp support: ${got_gmp} ${GMP_SRC}