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_postgresql=no
144 support_smartalloc=yes
149 support_static_tools=no
152 support_static_dir=no
153 support_static_cons=no
159 dnl# --------------------------------------------------------------------------
160 dnl# CHECKING COMMAND LINE OPTIONS
161 dnl# --------------------------------------------------------------------------
163 # -------------------------------------------
164 # gnome (default off)
165 # -------------------------------------------
167 [ --enable-gnome enable build of gnome-console GUI [disabled]],
168 [if test x$enableval = xyes; then
173 if test x$support_gnome = xyes; then
174 abc=`$PKGCONFIG --exists libgnomeui-2.0`
176 if test $pkg = 0; then
177 GNOME_INCLUDEDIR=`pkg-config --cflags-only-I libgnomeui-2.0`
178 GNOMEUI_LIBS=`pkg-config --libs-only-l libgnomeui-2.0`
179 GNOME_LIBDIR=`pkg-config --libs libgnomeui-2.0`
180 GNOME_LIBS=`pkg-config --libs-only-l libgnomeui-2.0`
181 AC_SUBST(GNOME_INCLUDEDIR)
182 AC_SUBST(GNOMEUI_LIBS)
183 AC_SUBST(GNOME_LIBDIR)
185 GNOME_DIR=src/gnome2-console
186 gnome_version="Version 2.x"
190 GNOME_DIR=src/gnome-console
191 gnome_version="Version 1.4"
197 # -------------------------------------------
198 # smartalloc (default off)
199 # -------------------------------------------
200 AC_ARG_ENABLE(smartalloc,
201 [ --enable-smartalloc enable smartalloc debugging support [disabled]],
202 [if test x$enableval = xno; then
203 support_smartalloc=no
206 if test x$support_smartalloc = xyes; then
207 AC_DEFINE(SMARTALLOC)
210 # -------------------------------------------
211 # static-tools (default off)
212 # -------------------------------------------
213 AC_ARG_ENABLE(static-tools,
214 [ --enable-static-tools enable static tape tools [disabled]],
215 [if test x$enableval = xyes; then
216 support_static_tools=yes
220 if test x$support_static_tools = xyes; then
221 TTOOL_LDFLAGS="-static"
223 AC_SUBST(TTOOL_LDFLAGS)
225 # -------------------------------------------
226 # static-fd (default off)
227 # -------------------------------------------
228 AC_ARG_ENABLE(static-fd,
229 [ --enable-static-fd enable static File daemon [disabled]],
230 [if test x$enableval = xyes; then
231 support_static_fd=yes
235 if test x$support_static_fd = xyes; then
236 STATIC_FD="static-bacula-fd"
240 # -------------------------------------------
241 # static-sd (default off)
242 # -------------------------------------------
243 AC_ARG_ENABLE(static-sd,
244 [ --enable-static-sd enable static Storage daemon [disabled]],
245 [if test x$enableval = xyes; then
246 support_static_sd=yes
250 if test x$support_static_sd = xyes; then
251 STATIC_SD="static-bacula-sd"
255 # -------------------------------------------
256 # static-dir (default off)
257 # -------------------------------------------
258 AC_ARG_ENABLE(static-dir,
259 [ --enable-static-dir enable static Director [disabled]],
260 [if test x$enableval = xyes; then
261 support_static_dir=yes
265 if test x$support_static_dir = xyes; then
266 STATIC_DIR="static-bacula-dir"
270 # -------------------------------------------
271 # static-cons (default off)
272 # -------------------------------------------
273 AC_ARG_ENABLE(static-cons,
274 [ --enable-static-cons enable static Console [disabled]],
275 [if test x$enableval = xyes; then
276 support_static_cons=yes
281 if test x$support_static_cons = xyes; then
282 STATIC_CONS="static-bconsole"
283 STATIC_GNOME_CONS="static-gnome-console"
285 AC_SUBST(STATIC_CONS)
286 AC_SUBST(STATIC_GNOME_CONS)
288 # -------------------------------------------
289 # client_only (default off)
290 # -------------------------------------------
291 AC_ARG_ENABLE(client-only,
292 [ --enable-client-only build client (File daemon) only [disabled]],
293 [if test x$enableval = xyes; then
294 build_client_only=yes
296 if test x$build_client_only = xno; then
303 # ---------------------------------------------------
304 # Check for conio (Bacula readline substitute)(
305 # ---------------------------------------------------
306 # this allows you to turn it completely off
308 [ --disable-conio disable conio support [enabled]
310 [if test x$enableval = xno; then
315 if test x$support_conio = xyes; then
319 AC_CHECK_HEADERS(termcap.h)
320 AC_CHECK_LIB(termcap, tgetent, CONS_LIBS="-ltermcap")
322 AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled])
326 # ---------------------------------------------------
327 # Check for readline support/directory (default off)
328 # ---------------------------------------------------
329 # this allows you to turn it completely off
330 AC_ARG_ENABLE(readline,
331 [ --disable-readline disable readline support [disable]
333 [if test x$enableval = xno; then
339 if test x$support_readline = xyes; then
340 AC_ARG_WITH(readline,
341 [ --with-readline=DIR specify readline library directory],
343 case "$with_readline" in
346 if test "$with_readline" != "yes"; then
347 CONS_INC="-I${with_readline}"
348 CONS_LDFLAGS="-L$with_readline"
350 with_readline="/usr/include/readline"
352 AC_CHECK_HEADER(${with_readline}/readline.h,
353 [ AC_DEFINE(HAVE_READLINE)
354 CONS_LIBS="-lreadline -ltermcap"
357 [ AC_MSG_ERROR([*** readline library missing])
363 # check for standard readline library
364 AC_CHECK_HEADER(/usr/include/readline/readline.h,
365 [ AC_DEFINE(HAVE_READLINE)
367 CONS_INC="-I/usr/include/readline"
368 CONS_LIBS="-lreadline -ltermcap"
370 # Did not find standard library, so try Bacula's default
371 AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h,
372 [ AC_DEFINE(HAVE_READLINE)
374 CONS_INC="-I${TOP_DIR}/depkgs/readline"
375 CONS_LIBS="-lreadline -lhistory -ltermcap"
376 CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
377 PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
379 [ AC_MSG_ERROR([*** readline library missing])
394 AC_SUBST(CONS_LDFLAGS)
395 AC_SUBST(READLINE_SRC)
397 # Minimal stuff for readline Makefile configuration
404 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr setlocale lstat lchown)
405 AC_CHECK_FUNCS(nanosleep)
407 AC_CHECK_HEADERS(varargs.h)
409 # End of readline/conio stuff
410 # -----------------------------------------------------------------------
413 # ---------------------------------------------------
414 # Check for GMP support/directory
415 # ---------------------------------------------------
419 # [ --with-gmp[=DIR] Specify gmp library directory],
421 # case "$with_gmp" in
424 # if test "$with_gmp" != "yes"; then
425 # GMP_INC="-I$with_gmp"
427 # GMP_LDFLAGS="-L$with_gmp"
429 # with_gmp="/usr/include"
431 # AC_CHECK_HEADER($with_gmp/gmp.h,
432 # [ AC_MSG_RESULT(yes)
433 # AC_DEFINE(HAVE_GMP)
437 # [ AC_MSG_ERROR([*** gmp library missing])
443 # # check for standard gmp library
444 # AC_CHECK_HEADER(/usr/include/gmp.h,
445 # [ AC_MSG_RESULT(yes)
446 # AC_DEFINE(HAVE_GMP)
451 # # Did not find standard library, so use our own
453 # AC_DEFINE(HAVE_GMP)
456 # GMP_INC="-I${TOP_DIR}/depkgs/gmp"
458 # GMP_LDFLAGS="-L${TOP_DIR}/depkgs/gmp"
459 # GMP_SRC="${TOP_DIR}/depkgs/gmp"
465 #AC_SUBST(GMP_LDFLAGS)
469 # -----------------------------------------------------------------------
472 # ---------------------------------------------------
473 # Check for CWEB support/directory
474 # ---------------------------------------------------
479 # [ --with-cweb[=DIR] Specify cweb library directory],
481 # case "$with_cweb" in
484 # if test "$with_cweb" != "yes"; then
485 # CWEB_INC="-I$with_cweb"
487 # CWEB_LDFLAGS="-L$with_cweb"
489 # with_cweb="/usr/include"
491 # AC_CHECK_HEADER($with_cweb/cweb.h,
492 # [ AC_MSG_RESULT(yes)
493 # AC_DEFINE(HAVE_CWEB)
497 # [ AC_MSG_ERROR([*** cweb library missing])
503 # # check for standard cweb library
504 # AC_CHECK_HEADER(/usr/include/cweb.h,
505 # [ AC_MSG_RESULT(yes)
506 # AC_DEFINE(HAVE_CWEB)
511 # # Did not find starndard library, so use our own
513 # AC_DEFINE(HAVE_CWEB)
516 # CWEB=${TOP_DIR}/depkgs/cweb
517 # CWEB_INC="-I${TOP_DIR}/depkgs/cweb"
519 # CWEB_LDFLAGS="-L${TOP_DIR}/depkgs/cweb"
520 # CWEB_SRC="${TOP_DIR}/depkgs/cweb"
527 #AC_SUBST(CWEB_LDFLAGS)
531 # -----------------------------------------------------------------------
535 # -----------------------------------------------------------
536 # Check whether user wants TCP wrappers support (default off)
537 # -----------------------------------------------------------
539 AC_ARG_WITH(tcp-wrappers,
540 [ --with-tcp-wrappers=DIR enable tcpwrappers support],
542 if test "x$withval" != "xno" ; then
544 LIBS="$saved_LIBS -lwrap"
545 AC_MSG_CHECKING(for libwrap)
548 int deny_severity = 0;
549 int allow_severity = 0;
550 struct request_info *req; ],
551 [ hosts_access(req); ],
554 AC_DEFINE(HAVE_LIBWRAP)
557 LIBS="$saved_LIBS -lwrap -lnsl"
560 int deny_severity = 0;
561 int allow_severity = 0;
562 struct request_info *req; ],
563 [ hosts_access(req); ],
566 AC_DEFINE(HAVE_LIBWRAP)
569 [AC_MSG_ERROR([*** libwrap missing]) ] ]
576 # ------------------------------------------
577 # Where to place working dir
578 # ------------------------------------------
579 working_dir=`eval echo ${prefix}/var/bacula/working`
580 AC_ARG_WITH(working-dir,
581 [ --with-working-dir=PATH specify path of Bacula working directory],
583 if test "x$withval" != "xno" ; then
589 AC_SUBST(working_dir)
592 # ------------------------------------------
593 # Where to place scriptdir (script files)
594 # ------------------------------------------
595 scriptdir=`eval echo ${sysconfdir}`
596 AC_ARG_WITH(scriptdir,
597 [ --with-scriptdir=PATH specify path of Bacula scripts directory],
599 if test "x$withval" != "xno" ; then
608 # ------------------------------------------
609 # Where to send dump email
610 # ------------------------------------------
611 dump_email=root@localhost
612 AC_ARG_WITH(dump-email,
613 [ --with-dump-email=EMAIL dump email address],
615 if test "x$withval" != "xno" ; then
623 # ------------------------------------------
624 # Where to send job email
625 # ------------------------------------------
626 job_email=root@localhost
627 AC_ARG_WITH(job-email,
628 [ --with-job-email=EMAIL job output email address],
630 if test "x$withval" != "xno" ; then
638 # ------------------------------------------
639 # Where to find smtp host
640 # ------------------------------------------
642 AC_ARG_WITH(smtp_host,
643 [ --with-smtp-host=HOST SMTP mail host address],
645 if test "x$withval" != "xno" ; then
654 # ------------------------------------
655 # Where to place pid files
656 # ------------------------------------
659 [ --with-pid-dir=PATH specify location of Bacula pid files],
661 if test "x$withval" != "xno" ; then
667 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
671 # ------------------------------------
672 # Where to place subsys "lock file"
673 # ------------------------------------
674 subsysdir=/var/run/subsys
675 AC_ARG_WITH(subsys-dir,
676 [ --with-subsys-dir=PATH specify location of Bacula subsys file],
678 if test "x$withval" != "xno" ; then
688 # ------------------------------------
689 # Where to start assigning ports
690 # ------------------------------------
692 AC_ARG_WITH(baseport,
693 [ --with-baseport=PORT specify base port address for daemons],
695 if test "x$withval" != "xno" ; then
702 dir_port=`expr $baseport`
703 fd_port=`expr $baseport + 1`
704 sd_port=`expr $fd_port + 1`
711 # ------------------------------------------
713 # ------------------------------------------
715 AC_ARG_WITH(dir-password,
716 [ --with-dir-password=PASSWORD specify Director's password],
718 if test "x$withval" != "xno" ; then
719 dir_password=$withval
724 if test "x$dir_password" = "x" ; then
725 if test "x$OPENSSL" = "xnone" ; then
726 # key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" abcdefghijklmnopqrst | awk '{getline} {print} {exit}'`
727 key=`autoconf/randpass 33`
729 key=`openssl rand -base64 33`
735 AC_ARG_WITH(fd-password,
736 [ --with-fd-password=PASSWORD specify Client's password],
738 if test "x$withval" != "xno" ; then
744 if test "x$fd_password" = "x" ; then
745 if test "x$OPENSSL" = "xnone" ; then
746 # key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" tsrqponmlkjihgfedcba | awk '{getline} {print} {exit}'`
747 key=`autoconf/randpass 37`
749 key=`openssl rand -base64 33`
755 AC_ARG_WITH(sd-password,
756 [ --with-sd-password=PASSWORD specify Storage daemon's password],
758 if test "x$withval" != "xno" ; then
764 if test "x$sd_password" = "x" ; then
765 if test "x$OPENSSL" = "xnone" ; then
766 # key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" 123456789uvwxyzabcdef | awk '{getline} {print} {exit}'`
767 key=`autoconf/randpass 41`
769 key=`openssl rand -base64 33`
775 AC_SUBST(dir_password)
776 AC_SUBST(fd_password)
777 AC_SUBST(sd_password)
781 # Handle users and groups for each daemon
784 AC_ARG_WITH(dir_user,
785 [ --with-dir-user=USER specify user for Director daemon],
787 if test "x$withval" != "x" ; then
794 AC_ARG_WITH(dir_group,
795 [ --with-dir-group=GROUP specify group for Director daemon],
797 if test "x$withval" != "x" ; then
805 [ --with-sd-user=USER specify user for Storage daemon],
807 if test "x$withval" != "x" ; then
814 AC_ARG_WITH(sd_group,
815 [ --with-sd-group=GROUP specify group for Storage daemon],
817 if test "x$withval" != "x" ; then
825 [ --with-fd-user=USER specify user for File daemon],
827 if test "x$withval" != "x" ; then
834 AC_ARG_WITH(fd_group,
835 [ --with-fd-group=GROUP specify group for File daemon],
837 if test "x$withval" != "x" ; then
853 # ------------------------------------------------
854 # Bacula check for various SQL database engines
855 # ------------------------------------------------
856 BA_CHECK_POSTGRESQL_DB
865 AC_DEFINE(PROTOTYPES)
867 dnl# --------------------------------------------------------------------------
868 dnl# Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
870 if test -z "$CFLAGS"; then
871 if test -z "$CCOPTS"; then
873 dnl> if test "x$GCC" = xyes; then
874 dnl> if test x$system = xLinux; then
875 dnl> CCOPTS="$CCOPTS "'-O2 -fno-strength-reduce'
886 dnl See if we can use 64 bit file addresses
887 largefile_support="no"
893 dnl# --------------------------------------------------------------------------
894 dnl# CHECKING FOR HEADER FILES
895 dnl# --------------------------------------------------------------------------
930 dnl# --------------------------------------------------------------------------
931 dnl# Check for utime.h structure
932 dnl# --------------------------------------------------------------------------
933 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
935 #include <sys/types.h>
936 #include <utime.h>], [struct utimbuf foo],
937 ba_cv_header_utime_h=yes, ba_cv_header_utime_h=no)])
938 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H)
940 dnl# --------------------------------------------------------------------------
941 dnl# Check for socklen_t
942 dnl# --------------------------------------------------------------------------
943 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
945 #include <sys/types.h>
946 #include <sys/socket.h>],
948 ba_cv_header_socklen_t=yes, ba_cv_header_socklen_t=no)])
949 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T)
951 dnl# --------------------------------------------------------------------------
952 dnl# Check for bigendian
953 dnl# --------------------------------------------------------------------------
954 AC_CACHE_CHECK([for bigendian], ba_cv_bigendian,
956 [main(){long a=1L; char *p=(char *)&a; exit(*p);}],
957 [ba_cv_bigendian=yes],
958 [ba_cv_bigendian=no],
959 [ba_cv_bigendian=no])])
960 test $ba_cv_bigendian = yes && AC_DEFINE(HAVE_BIGENDIAN)
966 dnl# --------------------------------------------------------------------------
967 dnl# CHECKING FOR FILESYSTEM TYPE
968 dnl# --------------------------------------------------------------------------
969 AC_MSG_CHECKING(how to get filesystem type)
971 # The order of these tests is important.
972 AC_TRY_CPP([#include <sys/statvfs.h>
973 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4)
974 if test $fstype = no; then
975 AC_TRY_CPP([#include <sys/statfs.h>
976 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3)
978 if test $fstype = no; then
979 AC_TRY_CPP([#include <sys/statfs.h>
980 #include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX)
982 if test $fstype = no; then
983 AC_TRY_CPP([#include <mntent.h>], AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD)
985 if test $fstype = no; then
986 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
988 if test $fstype = no; then
989 AC_TRY_CPP([#include <sys/mount.h>
990 #include <sys/fs_types.h>], AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix)
992 AC_MSG_RESULT($fstype)
994 dnl# --------------------------------------------------------------------------
995 dnl# CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
996 dnl# --------------------------------------------------------------------------
1004 AC_CHECK_TYPE(ino_t, unsigned long)
1005 AC_CHECK_TYPE(dev_t, unsigned long)
1006 AC_CHECK_TYPE(daddr_t, long)
1007 AC_CHECK_TYPE(major_t, int)
1008 AC_CHECK_TYPE(minor_t, int)
1009 AC_CHECK_TYPE(ssize_t, int)
1016 AC_CHECK_SIZEOF(char, 1)
1017 AC_CHECK_SIZEOF(short int, 2)
1018 AC_CHECK_SIZEOF(int, 4)
1019 AC_CHECK_SIZEOF(long int, 4)
1020 AC_CHECK_SIZEOF(long long int, 8)
1021 AC_CHECK_SIZEOF(int *, 4)
1023 # Check for sys/types.h types
1024 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1026 [ #include <sys/types.h> ],
1028 [ ac_cv_have_u_int="yes" ],
1029 [ ac_cv_have_u_int="no" ]
1032 if test "x$ac_cv_have_u_int" = "xyes" ; then
1033 AC_DEFINE(HAVE_U_INT)
1037 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t, [
1039 [ #include <sys/types.h> ],
1040 [ intmax_t a; a = 1;],
1041 [ ac_cv_have_intmax_t="yes" ],
1044 [ #include <stdint.h> ],
1045 [ intmax_t a; a = 1;],
1046 [ ac_cv_have_intmax_t="yes" ],
1047 [ ac_cv_have_intmax_t="no" ]
1053 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
1054 AC_DEFINE(HAVE_INTMAX_T)
1059 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t, [
1061 [ #include <sys/types.h> ],
1062 [ u_intmax_t a; a = 1;],
1063 [ ac_cv_have_u_intmax_t="yes" ],
1066 [ #include <stdint.h> ],
1067 [ u_intmax_t a; a = 1;],
1068 [ ac_cv_have_u_intmax_t="yes" ],
1069 [ ac_cv_have_u_intmax_t="no" ]
1074 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
1075 AC_DEFINE(HAVE_U_INTMAX_T)
1080 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1082 [ #include <sys/types.h> ],
1083 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1084 [ ac_cv_have_intxx_t="yes" ],
1085 [ ac_cv_have_intxx_t="no" ]
1088 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1089 AC_DEFINE(HAVE_INTXX_T)
1093 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1095 [ #include <sys/types.h> ],
1096 [ int64_t a; a = 1;],
1097 [ ac_cv_have_int64_t="yes" ],
1098 [ ac_cv_have_int64_t="no" ]
1101 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1102 AC_DEFINE(HAVE_INT64_T)
1106 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1108 [ #include <sys/types.h> ],
1109 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1110 [ ac_cv_have_u_intxx_t="yes" ],
1111 [ ac_cv_have_u_intxx_t="no" ]
1114 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1115 AC_DEFINE(HAVE_U_INTXX_T)
1119 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1121 [ #include <sys/types.h> ],
1122 [ u_int64_t a; a = 1;],
1123 [ ac_cv_have_u_int64_t="yes" ],
1124 [ ac_cv_have_u_int64_t="no" ]
1127 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1128 AC_DEFINE(HAVE_U_INT64_T)
1132 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1133 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1135 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1137 [ #include <sys/bitypes.h> ],
1138 [ int8_t a; int16_t b; int32_t c;
1139 u_int8_t e; u_int16_t f; u_int32_t g;
1140 a = b = c = e = f = g = 1; ],
1141 [ AC_DEFINE(HAVE_U_INTXX_T)
1142 AC_DEFINE(HAVE_INTXX_T)
1143 AC_DEFINE(HAVE_SYS_BITYPES_H)
1144 AC_MSG_RESULT(yes) ],
1145 [ AC_MSG_RESULT(no)]
1149 if test -z "$have_u_intxx_t" ; then
1150 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1152 [ #include <sys/types.h> ],
1153 [ uint8_t a; uint16_t b;
1154 uint32_t c; a = b = c = 1; ],
1155 [ ac_cv_have_uintxx_t="yes" ],
1156 [ ac_cv_have_uintxx_t="no" ]
1159 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1160 AC_DEFINE(HAVE_UINTXX_T)
1165 dnl# --------------------------------------------------------------------------
1166 dnl# CHECKING FOR LIBRARY FUNCTIONS
1167 dnl# --------------------------------------------------------------------------
1183 [echo 'configure: cannot find needed function.'; exit 1]
1186 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
1187 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
1189 AC_CHECK_FUNCS(chflags)
1191 AC_CHECK_FUNCS(snprintf vsnprintf gethostid getdomainname)
1193 dnl# --------------------------------------------------------------------------
1194 dnl# CHECKING FOR THREAD SAFE FUNCTIONS
1195 dnl# --------------------------------------------------------------------------
1196 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
1198 # If resolver functions are not in libc check for -lnsl or -lresolv.
1199 AC_CHECK_FUNC(gethostbyname_r,
1200 AC_MSG_RESULT(using libc's resolver),
1201 AC_CHECK_LIB(nsl,gethostbyname_r)
1202 AC_CHECK_LIB(resolv,gethostbyname_r))
1205 # Find where sockets are (especially for Solaris)
1206 AC_CHECK_FUNC(socket,
1207 AC_MSG_RESULT(using libc's socket),
1208 AC_CHECK_LIB(xnet,socket)
1209 AC_CHECK_LIB(socket,socket)
1210 AC_CHECK_LIB(inet,socket))
1212 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
1218 AC_FUNC_CLOSEDIR_VOID
1219 AC_FUNC_SETPGRP dnl check for BSD setpgrp.
1223 dnl# FreeBSD needs to link libxpg4
1224 AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"])
1227 AC_CHECK_LIB(sun, getpwnam)
1229 AC_CHECK_HEADERS(zlib.h)
1230 AC_CHECK_LIB(z, deflate, [FDLIBS="-lz"])
1232 if test x$FDLIBS = x-lz; then
1233 AC_DEFINE(HAVE_LIBZ)
1237 dnl Check for pthread libraries
1239 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
1240 [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
1241 [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
1242 [AC_CHECK_FUNC(pthread_create)]
1252 LDFLAGS=${LDFLAGS--O}
1253 DB_LIBS="${SQL_LFLAGS}"
1255 CPPFLAGS="$CPPFLAGS"
1266 AC_SUBST(X_EXTRA_LIBS)
1270 dnl# extra configurable objects
1281 # Finally we set appropriate distribution specific
1282 # variables and defaults
1284 # PFILES are platform specific files
1285 PFILES="platforms/Makefile"
1288 hostname=`uname -n | cut -d '.' -f 1`
1292 PSCMD="ps -e -o pid,comm"
1294 platforms/aix/Makefile"
1295 TAPEDRIVE="/dev/rmt0.1"
1299 PTHREAD_LIB="-lpthread -lexc"
1300 if test "${CC}" = "gcc" ; then
1307 TAPEDRIVE="/dev/nrmt0"
1310 DISTVER=`uname -a |awk '{print $3}'`
1311 TAPEDRIVE="/dev/nrmt0"
1312 PTHREAD_LIB="-pthread"
1313 CFLAGS="${CFLAGS} -pthread"
1314 PSCMD="ps -x -o pid,command"
1318 platforms/bsdi/Makefile \
1319 platforms/bsdi/bacula-fd \
1320 platforms/bsdi/bacula-sd \
1321 platforms/bsdi/bacula-dir"
1322 largefile_support="yes"
1325 DISTVER=`uname -a |awk '{print $3}'`
1326 TAPEDRIVE="/dev/nrst0"
1329 WLDFLAGS="-mwindows"
1333 TAPEDRIVE="/dev/nst0"
1334 PSCMD="ps -e -o pid,command"
1336 platforms/darwin/Makefile"
1339 DISTVER=`cat /etc/debian_version`
1340 TAPEDRIVE="/dev/nrst0"
1341 PSCMD="ps -e -o pid,command"
1344 DISTVER=`uname -a |awk '{print $3}'`
1345 VER=`echo $DISTVER | cut -c 1`
1346 if test x$VER = x4 ; then
1347 PTHREAD_LIB="-pthread"
1348 CFLAGS="${CFLAGS} -pthread"
1352 TAPEDRIVE="/dev/nrsa0"
1353 PSCMD="ps -x -o pid,command"
1355 platforms/freebsd/Makefile \
1356 platforms/freebsd/bacula-fd \
1357 platforms/freebsd/bacula-sd \
1358 platforms/freebsd/bacula-dir"
1359 largefile_support="yes"
1362 PSCMD="UNIX95=1 ps -e -o pid,comm"
1363 CFLAGS="$(CFLAGS) -D_XOPEN_SOURCE_EXTENDED=1"
1365 TAPEDRIVE="/dev/rmt/0hnb"
1369 TAPEDRIVE="/dev/rmt/0cbn"
1370 PSCMD="ps -e -o pid,comm"
1372 platforms/irix/Makefile \
1373 platforms/irix/bacula-fd \
1374 platforms/irix/bacula-sd \
1375 platforms/irix/bacula-dir"
1378 DISTVER=`uname -a |awk '{print $3}'`
1381 TAPEDRIVE="/dev/nrst0"
1382 PSCMD="ps -a -o pid,command"
1383 PTHREAD_LIB="-pthread"
1384 CFLAGS="${CFLAGS} -pthread"
1387 DISTVER=`uname -a |awk '{print $3}'`
1390 TAPEDRIVE="/dev/nrst0"
1391 PSCMD="ps -a -o pid,command"
1392 PTHREAD_LIB="-pthread"
1393 CFLAGS="${CFLAGS} -pthread"
1395 platforms/openbsd/Makefile \
1396 platforms/openbsd/bacula-fd \
1397 platforms/openbsd/bacula-sd \
1398 platforms/openbsd/bacula-dir"
1401 if test `cat /etc/redhat-release | grep release |\
1402 cut -f 3 -d ' '`x = "Enterprise"x ; then
1403 DISTVER="Enterprise "`cat /etc/redhat-release | grep release |\
1406 DISTVER=`cat /etc/redhat-release | grep release |\
1409 TAPEDRIVE="/dev/nst0"
1410 PSCMD="ps -e -o pid,command"
1412 platforms/redhat/Makefile \
1413 platforms/redhat/bacula-fd \
1414 platforms/redhat/bacula-sd \
1415 platforms/redhat/bacula-dir \
1416 platforms/redhat/bacula.spec \
1418 hostname=`hostname -s`
1421 DISTVER=`cat /etc/mandrake-release | grep release |\
1423 TAPEDRIVE="/dev/nst0"
1424 PSCMD="ps -e -o pid,command"
1426 platforms/mandrake/Makefile \
1427 platforms/mandrake/bacula-fd \
1428 platforms/mandrake/bacula-sd \
1429 platforms/mandrake/bacula-dir \
1430 platforms/mandrake/bacula.spec \
1434 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
1435 TAPEDRIVE="/dev/nst0"
1436 PSCMD="ps -e -o pid,command"
1438 platforms/gentoo/Makefile \
1439 platforms/gentoo/bacula-fd \
1440 platforms/gentoo/bacula-sd \
1441 platforms/gentoo/bacula-dir"
1445 DISTVER=`cat /etc/slackware-version`
1446 TAPEDRIVE="/dev/nst0"
1447 PSCMD="ps -e -o pid,command"
1451 TAPEDRIVE="/dev/rmt/0cbn"
1452 PSCMD="ps -e -o pid,comm"
1454 platforms/solaris/Makefile \
1455 platforms/solaris/bacula-fd \
1456 platforms/solaris/bacula-sd \
1457 platforms/solaris/bacula-dir"
1458 if test x$DISTVER = x5.6 ; then
1459 AC_DEFINE(HAVE_OLD_SOCKOPT)
1463 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
1465 TAPEDRIVE="/dev/nst0"
1466 PSCMD="ps -e -o pid,command"
1468 platforms/suse/Makefile \
1469 platforms/suse/bacula-fd \
1470 platforms/suse/bacula-sd \
1471 platforms/suse/bacula-dir \
1472 platforms/suse/bacula \
1473 platforms/suse/bacula.spec"
1478 TAPEDRIVE="/dev/nst0"
1479 PSCMD="ps -e -o pid,command"
1481 platforms/suse/Makefile \
1482 platforms/suse/bacula-fd \
1483 platforms/suse/bacula-sd \
1484 platforms/suse/bacula-dir"
1488 TAPEDRIVE="/dev/nst0"
1491 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
1497 LIBS="$PTHREAD_LIB $LIBS"
1499 AC_DEFINE_UNQUOTED(lld, "$lld")
1500 AC_DEFINE_UNQUOTED(llu, "$llu")
1507 dnl# common parts of the Makefile
1508 MCOMMON=./autoconf/Make.common
1509 AC_SUBST_FILE(MCOMMON)
1512 if test "x${subsysdir}" = "x${sbindir}" ; then
1515 echo "You have set both --sbindir and --with-subsys-dir"
1516 echo " equal to: ${subsysdir} "
1517 echo "This is not permitted. Please reconfigure."
1519 echo "Aborting configuration ..."
1525 AC_OUTPUT([autoconf/Make.common \
1528 rescue/linux/Makefile \
1529 rescue/freebsd/Makefile \
1530 rescue/solaris/Makefile \
1531 scripts/startmysql \
1533 scripts/btraceback \
1539 scripts/devel_bacula \
1543 scripts/bacula.desktop.gnome1 \
1544 scripts/bacula.desktop.gnome2 \
1545 scripts/mtx-changer \
1549 src/console/Makefile \
1550 src/console/bconsole.conf \
1551 src/gnome-console/Makefile \
1552 src/gnome-console/gnome-console.conf \
1553 src/gnome2-console/Makefile \
1554 src/gnome2-console/gnome-console.conf \
1555 src/tconsole/Makefile \
1557 src/dird/bacula-dir.conf \
1559 src/stored/Makefile \
1560 src/stored/bacula-sd.conf \
1561 src/filed/Makefile \
1562 src/filed/bacula-fd.conf \
1563 src/filed/win32/Makefile \
1565 src/cats/make_catalog_backup \
1566 src/cats/delete_catalog_backup \
1567 src/cats/create_postgresql_database \
1568 src/cats/update_postgresql_tables \
1569 src/cats/make_postgresql_tables \
1570 src/cats/grant_postgresql_privileges \
1571 src/cats/drop_postgresql_tables \
1572 src/cats/drop_postgresql_database \
1573 src/cats/create_mysql_database \
1574 src/cats/update_mysql_tables \
1575 src/cats/make_mysql_tables \
1576 src/cats/grant_mysql_privileges \
1577 src/cats/drop_mysql_tables \
1578 src/cats/drop_mysql_database \
1579 src/cats/create_sqlite_database \
1580 src/cats/update_sqlite_tables \
1581 src/cats/make_sqlite_tables \
1582 src/cats/grant_sqlite_privileges \
1583 src/cats/drop_sqlite_tables \
1584 src/cats/drop_sqlite_database \
1587 src/cats/create_bdb_database \
1588 src/cats/update_bdb_tables \
1589 src/cats/make_bdb_tables \
1590 src/cats/grant_bdb_privileges \
1591 src/cats/drop_bdb_tables \
1592 src/cats/drop_bdb_database \
1593 src/cats/create_bacula_database \
1594 src/cats/update_bacula_tables \
1595 src/cats/grant_bacula_privileges \
1596 src/cats/make_bacula_tables \
1597 src/cats/drop_bacula_tables \
1598 src/cats/drop_bacula_database \
1599 src/findlib/Makefile \
1600 src/tools/Makefile \
1602 [(echo "Doing make of dependencies"; make depend;) ]
1606 chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
1607 chmod 755 bconsole gconsole mtx-changer devel_bacula logrotate
1612 chmod 755 $c/create_bacula_database $c/update_bacula_tables $c/make_bacula_tables
1613 chmod 755 $c/grant_bacula_privileges $c/drop_bacula_tables $c/drop_bacula_database
1615 chmod 755 $c/create_bdb_database $c/update_bdb_tables $c/make_bdb_tables
1616 chmod 755 $c/grant_bdb_privileges $c/drop_bdb_tables $c/drop_bdb_database
1618 chmod 755 $c/create_mysql_database $c/update_mysql_tables $c/make_mysql_tables
1619 chmod 755 $c/grant_mysql_privileges $c/drop_mysql_tables $c/drop_mysql_database
1621 chmod 755 $c/create_sqlite_database $c/update_sqlite_tables $c/make_sqlite_tables
1622 chmod 755 $c/grant_sqlite_privileges $c/drop_sqlite_tables $c/drop_sqlite_database
1624 chmod 755 $c/create_postgresql_database $c/update_postgresql_tables $c/make_postgresql_tables
1625 chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables $c/drop_postgresql_database
1627 chmod 755 $c/make_catalog_backup $c/delete_catalog_backup
1631 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
1632 largefile_support="yes"
1636 # A whole lot of hand springs to get the compiler version.
1637 # This is because gcc changed the output in version 3.0
1639 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
1640 if test "x${CCVERSION}" = "x" ; then
1641 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
1643 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
1644 if test x"${CXXVERSION}" = x ; then
1645 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
1648 if test "x${subsysdir}" = "x${sbindir}" ; then
1651 echo "You have set --sbindir and --with-subsys-dir"
1652 echo " both equal to: ${subsysdir} "
1653 echo " This is not permitted. Please reconfigure."
1654 echo "Aborting configuration ..."
1661 Configuration on `date`:
1663 Host: $host -- ${DISTNAME} ${DISTVER}
1664 Bacula version: ${VERSION} (${DATE})
1665 Source code location: ${srcdir}
1666 Install binaries: ${sbindir}
1667 Install config files: ${sysconfdir}
1668 Scripts directory: ${scriptdir}
1669 Working directory: ${working_dir}
1670 PID directory: ${piddir}
1671 Subsys directory: ${subsysdir}
1672 C Compiler: ${CC} ${CCVERSION}
1673 C++ Compiler: ${CXX} ${CXXVERSION}
1674 Compiler flags: ${WCFLAGS} ${CFLAGS}
1675 Linker flags: ${WLDFLAGS} ${LDFLAGS}
1677 Statically Linked Tools: ${support_static_tools}
1678 Statically Linked FD: ${support_static_fd}
1679 Statically Linked SD: ${support_static_sd}
1680 Statically Linked DIR: ${support_static_dir}
1681 Statically Linked CONS: ${support_static_cons}
1682 Database type: ${db_name}
1683 Database lib: ${DB_LIBS}
1685 Job Output Email: ${job_email}
1686 Traceback Email: ${dump_email}
1687 SMTP Host Address: ${smtp_host}
1689 Director Port: ${dir_port}
1690 File daemon Port: ${fd_port}
1691 Storage daemon Port: ${sd_port}
1693 Director User: ${dir_user}
1694 Director Group: ${dir_group}
1695 Storage Daemon User: ${sd_user}
1696 Storage DaemonGroup: ${sd_group}
1697 File Daemon User: ${fd_user}
1698 File Daemon Group: ${fd_group}
1700 SQL binaries Directory ${SQL_BINDIR}
1702 Large file support: $largefile_support
1703 Bacula conio support: ${got_conio} ${CONS_LIBS}
1704 readline support: ${got_readline} ${PRTREADLINE_SRC}
1705 TCP Wrappers support: ${TCPW_MSG}
1706 ZLIB support: ${have_zlib}
1707 enable-smartalloc: ${support_smartalloc}
1708 enable-gnome: ${support_gnome} ${gnome_version}
1709 client-only: ${build_client_only}
1716 # cweb support: ${got_cweb} ${CWEB_SRC}
1717 # gmp support: ${got_gmp} ${GMP_SRC}