]> git.sur5r.net Git - bacula/bacula/blob - bacula/autoconf/configure.in
29Jul05
[bacula/bacula] / bacula / autoconf / configure.in
1 lal#
2 dnl#
3 dnl# Process this file with autoconf to produce a configure script.
4 dnl#
5 AC_INIT(src/version.h)
6 BUILD_DIR=`pwd`
7 cd ..
8 TOP_DIR=`pwd`
9 cd ${BUILD_DIR}
10 AC_SUBST(BUILD_DIR)
11 AC_CONFIG_AUX_DIR(${BUILD_DIR}/autoconf)
12 AC_CONFIG_HEADER(src/config.h:autoconf/config.h.in)
13
14 dnl require a recent autoconf
15 AC_PREREQ(2.13)
16
17
18 dnl search for true and false programs.
19 AC_PATH_PROGS(TRUEPRG, true, :)
20 AC_PATH_PROGS(FALSEPRG, false, :)
21
22 #AC_CANONICAL_HOST
23
24 dnl bacula version
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`
28 AC_SUBST(VERSION)dnl 
29 AC_SUBST(DATE)dnl 
30 AC_SUBST(LSMDATE)dnl 
31 echo "configuring for bacula $VERSION ($DATE)"
32
33
34 dnl -------------------------------------------------------
35 dnl# Check for compiler.
36 dnl ------------------------------------------------------
37
38 AC_PROG_CC
39 AC_PROG_CXX
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.
42
43 if test "x$CC" = xgcc; then
44    AC_DEFINE(HAVE_GCC)
45 fi
46 AC_PATH_PROG(CXX, $CXX, $CXX)
47 if test ! -e $CXX; then
48    AC_MSG_ERROR(Unable to find C++ compiler)
49 fi
50
51 dnl -------------------------------------------------------
52 dnl# Check for programs.
53 dnl ------------------------------------------------------
54 AC_PROG_INSTALL
55 AC_PROG_RANLIB
56 AC_PATH_PROG(MV, mv, mv)
57 AC_PATH_PROG(RM, rm, rm)
58 AC_PATH_PROG(CP, cp, cp)
59 AC_PATH_PROG(SED, sed, sed)
60 AC_PATH_PROG(ECHO, echo, echo)
61 AC_PATH_PROG(CMP, cmp, cmp)
62 AC_PATH_PROG(TBL, tbl, tbl)
63 AC_PATH_PROG(AR, ar, ar)
64 dnl AC_PATH_PROG(RANLIB, ranlib, ranlib)
65 AC_PATH_PROG(OPENSSL, openssl, none)
66 AC_PATH_PROG(MTX, mtx, mtx)
67 AC_PATH_PROG(DF, df, df)
68 AC_PATH_PROG(MKISOFS, mkisofs, mkisofs)
69 AC_PATH_PROG(PYTHON, python, python)
70 AC_PATH_PROG(GROWISOFS, growisofs, growisofs)
71 AC_PATH_PROG(DVDRWMEDIAINFO, dvd+rw-mediainfo, dvd+rw-mediainfo)
72 AC_PATH_PROG(PKGCONFIG, pkg-config, pkg-config)
73 AC_ARG_VAR(WXCONFIG, [wx-config command. On some systems, you must set it to wx-config-2.6 to use wxWidgets 2.6.])
74 if test "x$WXCONFIG" = x; then
75   WXCONFIG=wx-config
76 fi
77 AC_PATH_PROG(WXCONFIG, ${WXCONFIG}, ${WXCONFIG})
78 AC_ARG_VAR(WXFLAGS, [Parameters to pass to wx-config (e.g. --unicode=no).])
79 AC_PATH_PROG(CDRECORD, cdrecord, cdrecord)
80 AC_PATH_PROG(PIDOF, pidof, pidof)
81 AC_PROG_AWK
82 # Some AWK programs fail, so test it and warn the user
83 if echo xfoo | $AWK 'BEGIN { prog=ARGV[1]; ARGC=1 } 
84       { if ((prog == $2) || (("(" prog ")") == $2) ||
85            (("[" prog "]") == $2) ||
86            ((prog ":") == $2)) { print $1 ; exit 0 } }' xfoo>/dev/null; then :;
87 else
88   AC_MSG_ERROR([!!!!!!!!! WARNING !!!!!!!!!!!!!!
89    The regex engine of $AWK is too broken to be used you 
90    might want to install GNU AWK.
91    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!])
92 fi
93 THE_AWK=$AWK
94 AC_PATH_PROG(AWK, $THE_AWK, $THE_AWK)
95
96 test -n "$ARFLAG" || ARFLAGS="cr"
97 AC_SUBST(ARFLAGS)
98
99 MAKE_SHELL=/bin/sh
100 AC_SUBST(MAKE_SHELL)
101
102 AC_SUBST(LOCAL_LIBS)
103 AC_SUBST(LOCAL_CFLAGS)
104 AC_SUBST(LOCAL_LDFLAGS)
105 AC_SUBST(LOCAL_DEFS)
106
107
108
109 dnl --------------------------------------------------
110 dnl Bacula OP Sys determination (see aclocal.m4)
111 dnl --------------------------------------------------
112 BA_CHECK_OPSYS
113
114 # -----------------------------------------------------------
115 dnl Bacula OPSys Distribution determination (see aclocal.m4)
116 # ----------------------------------------------------------
117 BA_CHECK_OPSYS_DISTNAME
118
119 # -----------------------------------------------------------
120 dnl Check for gnome stuff for gnome-console
121 # ----------------------------------------------------------
122 AM_ACLOCAL_INCLUDE(gnome-macros)
123
124 # ------------------------------------------------------------------
125 #  If the user has not set --prefix, we set our default to nothing.
126 #  In this case, if the user has not set --sysconfdir, we set it
127 #  to the package default of /etc/bacula.  If either --prefix or
128 #  --sysconfdir is set, we leave sysconfdir alone except to eval it.
129 # ------------------------------------------------------------------
130 if test x${prefix} = xNONE ; then
131     if test `eval echo ${sysconfdir}` = NONE/etc ; then
132         sysconfdir=/etc/bacula
133     fi
134     prefix=
135 fi
136 sysconfdir=`eval echo ${sysconfdir}`
137
138 # -------------------------------------------------------------------------
139 #  If the user has not set --exec-prefix, we default to ${prefix}
140 # -------------------------------------------------------------------------
141 if test x${exec_prefix} = xNONE ; then
142     exec_prefix=${prefix}
143 fi
144
145 # ------------------------------------------------------------------
146 # If the user has not set --sbindir, we set our default as /sbin
147 # ------------------------------------------------------------------
148 if test x$sbindir = x'${exec_prefix}/sbin' ; then
149     sbindir=${exec_prefix}/sbin
150 fi
151 sbindir=`eval echo ${sbindir}`
152
153 # -------------------------------------------------------------------------
154 #  If the user has not set --mandir, we default to /usr/share/man
155 # -------------------------------------------------------------------------
156 if test x$mandir = x'${prefix}/man' ; then
157    mandir=/usr/share/man
158 fi
159
160                       
161 # ------------------------------------------------------------------
162 # All list of languages for which a translation exist. Each
163 #  language is separated by a space.
164 # ------------------------------------------------------------------
165 ALL_LINGUAS=""
166
167 AC_PATH_PROGS(MSGFMT, msgfmt, no)
168 if test "$MSGFMT" = "no"
169 then
170    echo 'msgfmt program not found, disabling NLS !'
171    USE_NLS=no
172    USE_INCLUDED_LIBINTL=no
173 #else
174 #   AM_GNU_GETTEXT
175 fi
176
177
178 support_mysql=no
179 support_sqlite=no
180 support_sqlite3=no
181 support_postgresql=no
182 support_smartalloc=yes
183 support_readline=yes
184 support_conio=yes
185 support_gnome=no
186 support_wx_console=no
187 support_tls=no
188 gnome_version=
189 wx_version=
190 support_static_tools=no
191 support_static_fd=no
192 support_static_sd=no
193 support_static_dir=no
194 support_static_cons=no
195 support_python=no
196 build_client_only=no
197 cats=
198 db_name=Internal
199 DB_NAME=bdb
200
201 dnl# --------------------------------------------------------------------------
202 dnl# CHECKING COMMAND LINE OPTIONS
203 dnl# --------------------------------------------------------------------------
204
205 # -------------------------------------------
206 # gnome (default off)
207 # -------------------------------------------
208 AC_ARG_ENABLE(gnome,
209   [  --enable-gnome       enable build of gnome-console GUI [disabled]],
210   [if test x$enableval = xyes; then
211     support_gnome=yes
212   fi])
213
214 GNOME_DIR=
215 if test x$support_gnome = xyes; then
216   abc=`$PKGCONFIG --exists libgnomeui-2.0`
217   pkg=$?
218   if test $pkg = 0; then
219      GNOME_INCLUDEDIR=`$PKGCONFIG --cflags-only-I libgnomeui-2.0`
220      GNOMEUI_LIBS=`$PKGCONFIG --libs-only-l libgnomeui-2.0`
221      GNOME_LIBDIR=`$PKGCONFIG --libs libgnomeui-2.0`
222      GNOME_LIBS=`$PKGCONFIG --libs-only-l libgnomeui-2.0`
223      AC_SUBST(GNOME_INCLUDEDIR)
224      AC_SUBST(GNOMEUI_LIBS)
225      AC_SUBST(GNOME_LIBDIR)
226      AC_SUBST(GNOME_LIBS)
227      GNOME_DIR=src/gnome2-console
228      gnome_version="Version 2.x"
229   else
230      AC_MSG_ERROR(Unable to find Gnome 2 installation)
231   fi
232 fi
233 AC_SUBST(GNOME_DIR)
234
235
236 # -------------------------------------------
237 # wx-console (default off)
238 # -------------------------------------------
239 AC_ARG_ENABLE(wx-console,
240   [  --enable-wx-console     enable build of wxWidgets console [disabled]],
241   [if test x$enableval = xyes; then
242     support_wx_console=yes
243   fi])
244
245 WX_DIR=
246 if test x$support_wx_console = xyes; then
247   abc=`$WXCONFIG $WXFLAGS --cppflags`
248   pkg=$?
249   if test $pkg = 0; then
250      wx_version="wxWidgets `$WXCONFIG $WXFLAGS --release`"
251      WXCONS_CPPFLAGS=`$WXCONFIG $WXFLAGS --cppflags`
252      WXCONS_LDFLAGS=`$WXCONFIG $WXFLAGS --libs`
253
254      AC_SUBST(WXCONS_CPPFLAGS)
255      AC_SUBST(WXCONS_LDFLAGS)
256      WX_DIR=src/wx-console
257   else
258      echo " "
259      echo "wx-config program not found. wx-console disabled."
260      echo " "
261      support_wx_console=no
262   fi
263 fi
264 AC_SUBST(WX_DIR)
265
266
267 # -------------------------------------------
268 # tray-monitor (default off)
269 # -------------------------------------------
270 AC_ARG_ENABLE(tray-monitor,
271   [  --enable-tray-monitor   enable build of Gnome tray monitor (compatible with KDE) [disabled]],
272   [if test x$enableval = xyes; then
273     support_tray_monitor=yes
274   fi])
275
276 TRAY_MONITOR_DIR=
277 if test x$support_tray_monitor = xyes; then
278   abc=`$PKGCONFIG --exists gtk+-2.0`
279   pkg=$?
280   if test $pkg = 0; then
281      TRAY_MONITOR_CPPFLAGS=`$PKGCONFIG --cflags gtk+-2.0`
282      TRAY_MONITOR_LDFLAGS=`$PKGCONFIG --libs gtk+-2.0`
283      AC_SUBST(TRAY_MONITOR_CPPFLAGS)
284      AC_SUBST(TRAY_MONITOR_LDFLAGS)
285      TRAY_MONITOR_DIR=src/tray-monitor
286      abc=`$PKGCONFIG --atleast-version=2.4 gtk+-2.0`
287      pkg=$?
288      if test $pkg = 0; then
289         AC_DEFINE(HAVE_GTK_2_4)
290      fi
291   fi
292 fi
293 AC_SUBST(TRAY_MONITOR_DIR)
294
295 # -------------------------------------------
296 # smartalloc (default off)
297 # -------------------------------------------
298 AC_ARG_ENABLE(smartalloc,
299   [  --enable-smartalloc     enable smartalloc debugging support [disabled]],
300   [if test x$enableval = xno; then
301     support_smartalloc=no
302   fi])
303
304 if test x$support_smartalloc = xyes; then
305    AC_DEFINE(SMARTALLOC)
306 fi
307
308 # -------------------------------------------
309 # static-tools (default off)
310 # -------------------------------------------
311 AC_ARG_ENABLE(static-tools,
312    [  --enable-static-tools   enable static tape tools [disabled]],
313    [if test x$enableval = xyes; then
314      support_static_tools=yes
315    fi])
316
317 TTOOL_LDFLAGS=
318 if test x$support_static_tools = xyes; then
319    TTOOL_LDFLAGS="-static"
320 fi
321 AC_SUBST(TTOOL_LDFLAGS)
322
323 # -------------------------------------------
324 # static-fd    (default off)
325 # -------------------------------------------
326 AC_ARG_ENABLE(static-fd,
327    [  --enable-static-fd      enable static File daemon [disabled]],
328    [if test x$enableval = xyes; then
329      support_static_fd=yes
330    fi])
331
332 STATIC_FD=
333 if test x$support_static_fd = xyes; then
334    STATIC_FD="static-bacula-fd"
335 fi
336 AC_SUBST(STATIC_FD)
337
338 # -------------------------------------------
339 # static-sd    (default off)
340 # -------------------------------------------
341 AC_ARG_ENABLE(static-sd,
342    [  --enable-static-sd      enable static Storage daemon [disabled]],
343    [if test x$enableval = xyes; then
344      support_static_sd=yes
345    fi])
346
347 STATIC_SD=
348 if test x$support_static_sd = xyes; then
349    STATIC_SD="static-bacula-sd"
350 fi
351 AC_SUBST(STATIC_SD)
352
353 # -------------------------------------------
354 # static-dir   (default off)
355 # -------------------------------------------
356 AC_ARG_ENABLE(static-dir,
357    [  --enable-static-dir     enable static Director [disabled]],
358    [if test x$enableval = xyes; then
359      support_static_dir=yes
360    fi])
361
362 STATIC_DIR=
363 if test x$support_static_dir = xyes; then
364    STATIC_DIR="static-bacula-dir"
365 fi
366 AC_SUBST(STATIC_DIR)
367
368 # -------------------------------------------
369 # static-cons  (default off)
370 # -------------------------------------------
371 AC_ARG_ENABLE(static-cons,
372    [  --enable-static-cons    enable static Console [disabled]],
373    [if test x$enableval = xyes; then
374      support_static_cons=yes
375    fi])
376
377 STATIC_CONS=
378 STATIC_GNOME_CONS=
379 STATIC_WX_CONS=
380 if test x$support_static_cons = xyes; then
381    STATIC_CONS="static-bconsole"
382    STATIC_GNOME_CONS="static-gnome-console"
383    STATIC_WX_CONS="static-wx-console"
384 fi
385 AC_SUBST(STATIC_CONS)
386 AC_SUBST(STATIC_GNOME_CONS)
387 AC_SUBST(STATIC_WX_CONS)
388
389 # -------------------------------------------
390 # client_only  (default off)
391 # -------------------------------------------
392 AC_ARG_ENABLE(client-only,
393    [  --enable-client-only    build client (File daemon) only [disabled]],
394    [if test x$enableval = xyes; then
395      build_client_only=yes
396     db_name=None
397     DB_NAME=none
398    fi])
399 if test x$build_client_only = xno; then
400    ALL_DIRS="subdirs"
401 else
402    ALL_DIRS=""
403 fi
404 AC_SUBST(ALL_DIRS)
405
406 # ---------------------------------------------------
407 # Check for conio (Bacula readline substitute)(
408 # ---------------------------------------------------
409 # this allows you to turn it completely off
410 AC_ARG_ENABLE(conio,   
411   [  --disable-conio         disable conio support [enabled]
412                                                       ],
413   [if test x$enableval = xno; then
414     support_conio=no
415   fi])
416
417 got_conio="no"
418 if test x$support_conio = xyes; then
419    AC_CHECK_HEADER(termcap.h, 
420      [ AC_CHECK_LIB(termcap, tgetent, 
421        [ CONS_LIBS="-ltermcap"
422          CONS_OBJ="conio.o"
423          CONS_SRC="conio.c"
424          got_conio="yes"
425          support_readline=no
426          AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled]) 
427        ],   
428        [ AC_CHECK_LIB(ncurses, tgetent,
429          [ CONS_LIBS="-lncurses"
430            CONS_OBJ="conio.o"
431            CONS_SRC="conio.c"
432            got_conio="yes"
433            support_readline=no
434            AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled]) 
435          ])
436        ])
437      ],
438      [
439          AC_CHECK_HEADERS(curses.h)
440          AC_CHECK_HEADER(term.h,
441                [ AC_CHECK_LIB(curses, tgetent, 
442                  [ CONS_LIBS="-lcurses"
443                    CONS_OBJ="conio.o"
444                    CONS_SRC="conio.c"
445                    got_conio="yes"
446                    support_readline=no
447                    AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled]) 
448                  ])
449                ],
450                [ echo " "; echo "Required libraries not found. CONIO turned off ..."; echo " "],
451 [#if HAVE_CURSES_H
452 #include <curses.h>
453 #endif
454 ])
455      ])
456 fi
457
458
459 # ---------------------------------------------------
460 # Check for readline support/directory (default off)
461 # ---------------------------------------------------
462 # this allows you to turn it completely off
463 AC_ARG_ENABLE(readline,
464   [  --disable-readline      disable readline support [disable]
465                                                       ],
466   [if test x$enableval = xno; then
467     support_readline=no
468   fi])
469
470 got_readline="no"
471 READLINE_SRC=
472 if test x$support_readline = xyes; then
473    AC_ARG_WITH(readline,
474      [ --with-readline=DIR               specify readline library directory],
475      [
476         case "$with_readline" in
477         no) : ;;
478         yes|*)
479           if test "$with_readline" != "yes"; then
480             CONS_INC="-I${with_readline}"
481             CONS_LDFLAGS="-L$with_readline"
482           else
483              with_readline="/usr/include/readline" 
484           fi
485           AC_CHECK_HEADER(${with_readline}/readline.h, 
486              [ AC_DEFINE(HAVE_READLINE) 
487                CONS_LIBS="-lreadline -ltermcap"
488                got_readline="yes"   
489              ],
490              [ echo " "
491                echo "readline.h not found. readline turned off ..."
492                echo " "
493              ]
494           )
495           ;;
496         esac
497      ],[
498        # check for standard readline library
499        AC_CHECK_HEADER(/usr/include/readline/readline.h, 
500          [ AC_DEFINE(HAVE_READLINE)
501            got_readline="yes"
502            CONS_INC="-I/usr/include/readline"
503            CONS_LIBS="-lreadline -ltermcap"
504          ], [
505            # Did not find standard library, so try Bacula's default
506             AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h, 
507               [ AC_DEFINE(HAVE_READLINE) 
508                  got_readline="yes"   
509                  CONS_INC="-I${TOP_DIR}/depkgs/readline"
510                  CONS_LIBS="-lreadline -lhistory -ltermcap"
511                  CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
512                  PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
513               ],
514               [ echo " "
515                 echo "readline.h not found. readline turned off ..."
516                 echo " "
517               ]
518             )
519          ]
520        )
521      ]   
522    )
523 fi
524
525
526
527 AC_SUBST(CONS_INC)
528 AC_SUBST(CONS_OBJ)
529 AC_SUBST(CONS_SRC)
530 AC_SUBST(CONS_LIBS)
531 AC_SUBST(CONS_LDFLAGS)
532 AC_SUBST(READLINE_SRC)
533
534 # Minimal stuff for readline Makefile configuration
535 MAKE_SHELL=/bin/sh
536 AC_SUBST(MAKE_SHELL)
537 AC_HEADER_STAT
538 AC_HEADER_DIRENT
539 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr setlocale lstat lchown)
540 AC_CHECK_FUNCS(nanosleep nl_langinfo)
541 AC_CHECK_HEADERS(varargs.h)
542
543 # End of readline/conio stuff
544 # -----------------------------------------------------------------------
545
546 # -----------------------------------------------------------------------
547 #  Check for Python support
548 #
549 AC_MSG_CHECKING(for Python support)
550 AC_ARG_WITH(python,
551 [
552   --with-python[=DIR]     Include Python support.  DIR is the Python base
553                           install directory, default is to search through
554                           a number of common places for the Python files.],
555 [
556   PYTHON_INCDIR= 
557   PYTHON_LIBS=
558   if test "$withval" != "no"; then
559      if test "$withval" = "yes"; then
560         for python_root in /usr /usr/local; do
561           if test -f $python_root/include/python2.2/Python.h; then
562              PYTHON_INCDIR=-I$python_root/include/python2.2
563              PYTHON_LIBS="-L$python_root/lib/python2.2/config -lpython2.2 -lutil"
564              break
565           elif test -f $python_root/include/python2.3/Python.h; then
566              PYTHON_INCDIR=-I$python_root/include/python2.3
567              PYTHON_LIBS="-L$python_root/lib/python2.3/config -lpython2.3 -lutil"
568              break
569           elif test -f $python_root/include/python2.4/Python.h; then
570              PYTHON_INCDIR=-I$python_root/include/python2.4
571              PYTHON_LIBS="-L$python_root/lib/python2.4/config -lpython2.4 -lutil"
572              break
573           fi
574         done
575         if test x$PYTHON_INCDIR = x; then
576           if test -f $prefix/include/Python.h; then
577              PYTHON_INCDIR=-I$prefix/include
578              PYTHON_LIBS="-L$prefix/lib/config -lpython -lutil"
579           else
580            AC_MSG_RESULT(no)
581            AC_MSG_ERROR(Unable to find Python.h in standard locations)
582           fi
583         fi
584      else
585         if test -f $withval/Python.h; then
586            PYTHON_INCDIR=-I$withval
587            PYTHON_LIBS="-L$withval/config -lpython -lutil"
588         elif test -f $withval/include/Python.h; then
589            PYTHON_INCDIR=-I$withval/include
590            PYTHON_LIBS="-L$withval/lib/config -lpython -lutil"
591         else
592            AC_MSG_RESULT(no)
593            AC_MSG_ERROR(Invalid Python directory $withval - unable to find Python.h under $withval)
594         fi
595      fi
596      AC_DEFINE([HAVE_PYTHON], 1)
597      AC_MSG_RESULT(yes)
598      support_python=yes
599
600   else
601      AC_MSG_RESULT(no)
602   fi
603 ],[
604   AC_MSG_RESULT(no)
605 ])
606 AC_SUBST(PYTHON_LIBS)
607 AC_SUBST(PYTHON_INCDIR)
608   
609
610 #
611 # Find where sockets are (especially for Solaris)
612 # Do this before the TCP Wrappers test since tcp wrappers
613 # uses the socket library and some linkers are stupid.
614 #
615 AC_CHECK_FUNC(socket,
616     AC_MSG_RESULT(using libc's socket),
617     AC_CHECK_LIB(xnet,socket)
618     AC_CHECK_LIB(socket,socket)
619     AC_CHECK_LIB(inet,socket))
620
621
622 # -----------------------------------------------------------
623 # Check whether user wants TCP wrappers support (default off)
624 # -----------------------------------------------------------
625 TCPW_MSG="no" 
626 AC_ARG_WITH(tcp-wrappers,
627   [  --with-tcp-wrappers=DIR     enable tcpwrappers support],
628   [
629     if test "x$withval" != "xno" ; then
630        saved_LIBS="$LIBS"
631        LIBS="$saved_LIBS -lwrap"
632        AC_MSG_CHECKING(for libwrap)
633        AC_TRY_LINK(
634           [ #include <tcpd.h>
635              int deny_severity = 0;
636              int allow_severity = 0;
637              struct request_info *req; ],
638           [ hosts_access(req); ],
639           [
640             AC_MSG_RESULT(yes)
641             AC_DEFINE(HAVE_LIBWRAP)
642             TCPW_MSG="yes" 
643           ], [
644             LIBS="$saved_LIBS -lwrap -lnsl"
645             AC_TRY_LINK(
646               [ #include <tcpd.h>
647                  int deny_severity = 0;
648                  int allow_severity = 0;
649                  struct request_info *req; ],
650               [ hosts_access(req); ],
651               [
652                  AC_MSG_RESULT(yes)
653                  AC_DEFINE(HAVE_LIBWRAP)
654                  TCPW_MSG="yes" 
655               ],
656               [AC_MSG_ERROR([*** libwrap missing]) ] ]
657             )
658        )
659     fi
660   ]
661 )
662
663 # -----------------------------------------------------------
664 # Check whether OpenSSL is available
665 # -----------------------------------------------------------
666 AC_MSG_CHECKING([for OpenSSL])
667 dnl The following uses quadrigraphs:
668 dnl '@<:@' = '['
669 dnl '@:>@' = ']'
670 AC_ARG_WITH(openssl,
671         AC_HELP_STRING([--with-openssl@<:@=DIR@:>@], [Include OpenSSL support. DIR is the OpenSSL base]),
672         [with_openssl_directory=${withval}])
673
674 if test "x$with_openssl_directory" != "x"; then
675         OPENSSL_LIBS="-lssl -lcrypto"
676         OPENSSL_INC=""
677
678         if test "x$with_openssl_directory" != "xyes" && test x"${with_openssl_directory}" != "x"; then
679                 OPENSSL_LIBS="-L$with_openssl_directory/lib $OPENSSL_LIBS"
680                 OPENSSL_INC="-I$with_openssl_directory/include $OPENSSL_INC"
681         fi
682
683         saved_LIBS="$LIBS"
684         saved_CFLAGS="$CFLAGS"
685         LIBS="$saved_LIBS $OPENSSL_LIBS"
686         CFLAGS="$saved_CFLAGS $OPENSSL_INC"
687
688         AC_TRY_LINK([ #include <openssl/ssl.h> ],
689                 [ CRYPTO_set_id_callback(NULL); ],
690                 [ support_tls="yes" ],
691                 [ support_tls="no" ]
692         )
693
694         LIBS="$saved_LIBS"
695         CFLAGS="$saved_CFLAGS"
696
697         if test "$support_tls" = "yes"; then
698                 AC_DEFINE(HAVE_OPENSSL, 1, [Define if OpenSSL library is available])
699                 AC_DEFINE(HAVE_TLS, 1, [Define if TLS support should be enabled])
700         fi
701 else
702         support_tls="no"
703         OPENSSL_LIBS=""
704         OPENSSL_INC=""
705 fi
706
707 AC_MSG_RESULT([$support_tls])
708 AC_SUBST(OPENSSL_LIBS)
709 AC_SUBST(OPENSSL_INC)
710
711
712
713 # ------------------------------------------
714 # Where to place working dir
715 # ------------------------------------------
716 working_dir=`eval echo ${prefix}/var/bacula/working`
717 AC_ARG_WITH(working-dir,
718    [  --with-working-dir=PATH    specify path of Bacula working directory],
719    [
720        if test "x$withval" != "xno" ; then     
721               working_dir=$withval
722        fi
723    ]
724 )
725
726 AC_SUBST(working_dir)
727
728
729 # ------------------------------------------
730 # Where to place scriptdir (script files)
731 # ------------------------------------------
732 scriptdir=`eval echo ${sysconfdir}`
733 AC_ARG_WITH(scriptdir,
734    [  --with-scriptdir=PATH    specify path of Bacula scripts directory],
735    [
736        if test "x$withval" != "xno" ; then     
737               scriptdir=$withval
738        fi
739    ]
740 )
741
742 AC_SUBST(scriptdir)
743
744
745 # ------------------------------------------
746 # Where to send dump email
747 # ------------------------------------------
748 dump_email=root@localhost
749 AC_ARG_WITH(dump-email,
750    [  --with-dump-email=EMAIL    dump email address],
751    [
752        if test "x$withval" != "xno" ; then     
753               dump_email=$withval
754        fi
755    ]
756 )
757
758 AC_SUBST(dump_email)
759
760 # ------------------------------------------
761 # Where to send job email
762 # ------------------------------------------
763 job_email=root@localhost
764 AC_ARG_WITH(job-email,
765    [  --with-job-email=EMAIL     job output email address],
766    [
767        if test "x$withval" != "xno" ; then     
768               job_email=$withval
769        fi
770    ]
771 )
772
773 AC_SUBST(job_email)
774
775 # ------------------------------------------
776 # Where to find smtp host
777 # ------------------------------------------
778 smtp_host=localhost
779 AC_ARG_WITH(smtp_host,
780    [  --with-smtp-host=HOST              SMTP mail host address],
781    [
782        if test "x$withval" != "xno" ; then     
783               smtp_host=$withval
784        fi
785    ]
786 )
787
788 AC_SUBST(smtp_host)
789
790
791 # ------------------------------------
792 # Where to place pid files
793 # ------------------------------------
794 piddir=/var/run
795 AC_ARG_WITH(pid-dir,
796     [  --with-pid-dir=PATH               specify location of Bacula pid files],
797     [
798         if test "x$withval" != "xno" ; then     
799             piddir=$withval
800         fi
801     ]
802 )
803
804 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
805 AC_SUBST(piddir)
806
807
808 # ------------------------------------
809 # Where to place subsys "lock file"
810 # ------------------------------------
811 subsysdir=/var/run/subsys
812 AC_ARG_WITH(subsys-dir,
813     [  --with-subsys-dir=PATH    specify location of Bacula subsys file],
814     [
815         if test "x$withval" != "xno" ; then     
816             subsysdir=$withval
817         fi
818     ]
819 )
820
821 AC_SUBST(subsysdir)
822
823
824
825 # ------------------------------------
826 # Where to start assigning ports
827 # ------------------------------------
828 baseport=9101
829 AC_ARG_WITH(baseport,
830     [  --with-baseport=PORT              specify base port address for daemons],
831     [
832         if test "x$withval" != "xno" ; then     
833              baseport=$withval
834         fi
835     ]
836 )
837
838 AC_SUBST(baseport)
839 dir_port=`expr $baseport`
840 fd_port=`expr $baseport + 1`
841 sd_port=`expr $fd_port + 1`
842
843 AC_SUBST(dir_port)
844 AC_SUBST(fd_port)
845 AC_SUBST(sd_port)
846
847
848 # ------------------------------------------
849 # Generate passwords
850 # ------------------------------------------
851 dir_password=
852 AC_ARG_WITH(dir-password,
853    [  --with-dir-password=PASSWORD   specify Director's password],
854    [
855        if test "x$withval" != "xno" ; then     
856            dir_password=$withval
857        fi
858    ]
859 )
860
861 if test "x$dir_password" = "x" ; then
862    if test "x$OPENSSL" = "xnone" ; then
863       key=`autoconf/randpass 33`
864    else
865       key=`openssl rand -base64 33`
866    fi
867    dir_password=$key
868 fi
869
870 fd_password=
871 AC_ARG_WITH(fd-password,
872    [  --with-fd-password=PASSWORD    specify Client's password],
873    [
874        if test "x$withval" != "xno" ; then     
875            fd_password=$withval
876        fi
877    ]
878 )
879
880 if test "x$fd_password" = "x" ; then
881    if test "x$OPENSSL" = "xnone" ; then
882       key=`autoconf/randpass 37`
883    else
884       key=`openssl rand -base64 33`
885    fi
886    fd_password=$key
887 fi
888
889 sd_password=
890 AC_ARG_WITH(sd-password,
891    [  --with-sd-password=PASSWORD    specify Storage daemon's password],
892    [
893        if test "x$withval" != "xno" ; then     
894            sd_password=$withval
895        fi
896    ]
897 )
898
899 if test "x$sd_password" = "x" ; then
900    if test "x$OPENSSL" = "xnone" ; then
901       key=`autoconf/randpass 41`
902    else
903       key=`openssl rand -base64 33`
904    fi
905    sd_password=$key
906 fi
907
908 mon_dir_password=
909 AC_ARG_WITH(mon-dir-password,
910    [  --with-mon-dir-password=PASSWORD   specify Director's password used by the monitor],
911    [
912        if test "x$withval" != "xno" ; then     
913            mon_dir_password=$withval
914        fi
915    ]
916 )
917
918 if test "x$mon_dir_password" = "x" ; then
919    if test "x$OPENSSL" = "xnone" ; then
920       key=`autoconf/randpass 33`
921    else
922       key=`openssl rand -base64 33`
923    fi
924    mon_dir_password=$key
925 fi
926
927 mon_fd_password=
928 AC_ARG_WITH(mon-fd-password,
929    [  --with-mon-fd-password=PASSWORD    specify Client's password used by the monitor],
930    [
931        if test "x$withval" != "xno" ; then     
932            mon_fd_password=$withval
933        fi
934    ]
935 )
936
937 if test "x$mon_fd_password" = "x" ; then
938    if test "x$OPENSSL" = "xnone" ; then
939       key=`autoconf/randpass 37`
940    else
941       key=`openssl rand -base64 33`
942    fi
943    mon_fd_password=$key
944 fi
945
946 mon_sd_password=
947 AC_ARG_WITH(mon-sd-password,
948    [  --with-mon-sd-password=PASSWORD    specify Storage daemon's password used by the monitor],
949    [
950        if test "x$withval" != "xno" ; then     
951            mon_sd_password=$withval
952        fi
953    ]
954 )
955
956 if test "x$mon_sd_password" = "x" ; then
957    if test "x$OPENSSL" = "xnone" ; then
958       key=`autoconf/randpass 41`
959    else
960       key=`openssl rand -base64 33`
961    fi
962    mon_sd_password=$key
963 fi
964
965 AC_SUBST(dir_password)
966 AC_SUBST(fd_password)
967 AC_SUBST(sd_password)
968 AC_SUBST(mon_dir_password)
969 AC_SUBST(mon_fd_password)
970 AC_SUBST(mon_sd_password)
971
972
973 #
974 # Handle users and groups for each daemon
975 #
976 dir_user=
977 AC_ARG_WITH(dir_user,
978     [  --with-dir-user=USER              specify user for Director daemon],
979     [
980         if test "x$withval" != "x" ; then       
981              dir_user=$withval
982         fi
983     ]
984 )
985
986 dir_group=
987 AC_ARG_WITH(dir_group,
988     [  --with-dir-group=GROUP            specify group for Director daemon],
989     [
990         if test "x$withval" != "x" ; then       
991              dir_group=$withval
992         fi
993     ]
994 )
995
996 sd_user=
997 AC_ARG_WITH(sd_user,
998     [  --with-sd-user=USER               specify user for Storage daemon],
999     [
1000         if test "x$withval" != "x" ; then       
1001              sd_user=$withval
1002         fi
1003     ]
1004 )
1005
1006 sd_group=
1007 AC_ARG_WITH(sd_group,
1008     [  --with-sd-group=GROUP             specify group for Storage daemon],
1009     [
1010         if test "x$withval" != "x" ; then       
1011              sd_group=$withval
1012         fi
1013     ]
1014 )
1015
1016 fd_user=
1017 AC_ARG_WITH(fd_user,
1018     [  --with-fd-user=USER               specify user for File daemon],
1019     [
1020         if test "x$withval" != "x" ; then       
1021              fd_user=$withval
1022         fi
1023     ]
1024 )
1025
1026 fd_group=
1027 AC_ARG_WITH(fd_group,
1028     [  --with-fd-group=GROUP             specify group for File daemon],
1029     [
1030         if test "x$withval" != "x" ; then       
1031              fd_group=$withval
1032         fi
1033     ]
1034 )
1035
1036
1037
1038
1039 AC_SUBST(dir_user)
1040 AC_SUBST(dir_group)
1041 AC_SUBST(sd_user)
1042 AC_SUBST(sd_group)
1043 AC_SUBST(fd_user)
1044 AC_SUBST(fd_group)
1045
1046 #
1047 # allow setting default executable permissions
1048 #
1049 SBINPERM=0754
1050 AC_ARG_WITH(sbin-perm,
1051     [  --with-sbin-perm=MODE             specify permissions for sbin binaries (0754)],
1052     [
1053         if test "x$withval" != "x" ; then       
1054             SBINPERM=$withval
1055         fi
1056     ]
1057 )
1058
1059 AC_SUBST(SBINPERM)
1060
1061 # ------------------------------------------------
1062 # Bacula check for various SQL database engines
1063 # ------------------------------------------------
1064 BA_CHECK_POSTGRESQL_DB
1065
1066 BA_CHECK_MYSQL_DB
1067
1068 BA_CHECK_SQLITE3_DB
1069
1070 BA_CHECK_SQLITE_DB
1071
1072 AC_SUBST(cats)
1073 AC_SUBST(DB_NAME)
1074
1075 AC_DEFINE(PROTOTYPES)
1076
1077 dnl# --------------------------------------------------------------------------
1078 dnl# Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
1079 dnl#
1080 if test -z "$CFLAGS" -o "$CFLAGS" = "-g -O2"; then
1081     if test -z "$CCOPTS"; then
1082         CCOPTS='-g -O2 -Wall'
1083     fi
1084     CFLAGS="$CCOPTS"
1085 fi
1086
1087
1088 dnl A few others 
1089 AC_EXEEXT
1090
1091 dnl See if we can use 64 bit file addresses
1092 largefile_support="no"
1093 AC_BAC_LARGEFILE
1094
1095
1096 AC_PATH_XTRA
1097
1098 dnl# --------------------------------------------------------------------------
1099 dnl# CHECKING FOR HEADER FILES
1100 dnl# --------------------------------------------------------------------------
1101 AC_CHECK_HEADERS( \
1102         assert.h \
1103         fcntl.h \
1104         grp.h \
1105         pwd.h \
1106         libc.h \
1107         limits.h \
1108         stdarg.h \
1109         stdlib.h \
1110         stdint.h \
1111         string.h \
1112         termios.h \
1113         termcap.h \
1114         term.h \
1115         unistd.h \
1116         sys/bitypes.h \
1117         sys/byteorder.h \
1118         sys/ioctl.h \
1119         sys/select.h \
1120         sys/sockio.h \
1121         sys/time.h \
1122         sys/socket.h \
1123         arpa/nameser.h \
1124         resolv.h \
1125         mtio.h \
1126         sys/mtio.h \
1127         sys/tape.h \
1128         regex.h \
1129 )
1130 AC_HEADER_STDC
1131 AC_HEADER_MAJOR
1132 AC_HEADER_DIRENT
1133 AC_HEADER_STAT
1134 AC_HEADER_SYS_WAIT
1135 AC_HEADER_TIME
1136 AC_STRUCT_ST_BLKSIZE
1137 AC_STRUCT_ST_BLOCKS
1138 AC_STRUCT_TIMEZONE
1139
1140 dnl# --------------------------------------------------------------------------
1141 dnl# Check for utime.h structure 
1142 dnl# --------------------------------------------------------------------------
1143 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
1144   [AC_TRY_COMPILE([
1145 #include <sys/types.h>
1146 #include <utime.h>], [struct utimbuf foo],
1147   ba_cv_header_utime_h=yes, ba_cv_header_utime_h=no)])
1148 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H)
1149
1150 dnl# --------------------------------------------------------------------------
1151 dnl# Check for socklen_t
1152 dnl# --------------------------------------------------------------------------
1153 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
1154   [AC_TRY_COMPILE([
1155 #include <sys/types.h>
1156 #include <sys/socket.h>],
1157   [socklen_t x],
1158   ba_cv_header_socklen_t=yes, ba_cv_header_socklen_t=no)])
1159 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T)
1160
1161 dnl# --------------------------------------------------------------------------
1162 dnl# Check for bigendian
1163 dnl# --------------------------------------------------------------------------
1164 AC_CACHE_CHECK([for bigendian], ba_cv_bigendian,
1165   [AC_TRY_RUN(
1166     [main(){long a=1L; char *p=(char *)&a; exit(*p);}],
1167     [ba_cv_bigendian=yes], 
1168     [ba_cv_bigendian=no], 
1169     [ba_cv_bigendian=no])])
1170 test $ba_cv_bigendian = yes && AC_DEFINE(HAVE_BIGENDIAN)
1171
1172
1173 AC_C_CONST
1174
1175
1176 dnl# --------------------------------------------------------------------------
1177 dnl# CHECKING FOR FILESYSTEM TYPE
1178 dnl# --------------------------------------------------------------------------
1179 AC_MSG_CHECKING(how to get filesystem type)
1180 fstype=no
1181 # The order of these tests is important.
1182 AC_TRY_CPP([#include <sys/statvfs.h>
1183 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4)
1184 if test $fstype = no; then
1185 AC_TRY_CPP([#include <sys/statfs.h>
1186 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3)
1187 fi
1188 if test $fstype = no; then
1189 AC_TRY_CPP([#include <sys/statfs.h>
1190 #include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX)
1191 fi
1192 if test $fstype = no; then  
1193 AC_TRY_CPP([#include <mntent.h>], AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD)
1194 fi
1195 if test $fstype = no; then  
1196 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
1197 fi
1198 if test $fstype = no; then  
1199 AC_TRY_CPP([#include <sys/mount.h>
1200 #include <sys/fs_types.h>], AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix)
1201 fi
1202 AC_MSG_RESULT($fstype)
1203
1204 dnl# --------------------------------------------------------------------------
1205 dnl# CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
1206 dnl# --------------------------------------------------------------------------
1207 AC_TYPE_SIGNAL
1208 SIGNAL_CHECK
1209 AC_TYPE_MODE_T
1210 AC_TYPE_UID_T
1211 AC_TYPE_SIZE_T
1212 AC_TYPE_PID_T
1213 AC_TYPE_OFF_T
1214 AC_CHECK_TYPE(ino_t, unsigned long)
1215 AC_CHECK_TYPE(dev_t, unsigned long)
1216 AC_CHECK_TYPE(daddr_t, long)
1217 AC_CHECK_TYPE(major_t, int)
1218 AC_CHECK_TYPE(minor_t, int)
1219 AC_CHECK_TYPE(ssize_t, int)
1220 AC_STRUCT_ST_BLOCKS
1221 AC_STRUCT_ST_RDEV
1222 AC_STRUCT_TM
1223 AC_C_CONST
1224
1225
1226 AC_CHECK_SIZEOF(char, 1)
1227 AC_CHECK_SIZEOF(short int, 2)
1228 AC_CHECK_SIZEOF(int, 4)
1229 AC_CHECK_SIZEOF(long int, 4)
1230 AC_CHECK_SIZEOF(long long int, 8)
1231 AC_CHECK_SIZEOF(int *, 4)
1232
1233 # Check for sys/types.h types
1234 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1235     AC_TRY_COMPILE(
1236         [ #include <sys/types.h> ], 
1237         [ u_int a; a = 1;], 
1238         [ ac_cv_have_u_int="yes" ],
1239         [ ac_cv_have_u_int="no" ]
1240     )
1241 ])
1242 if test "x$ac_cv_have_u_int" = "xyes" ; then
1243    AC_DEFINE(HAVE_U_INT)
1244    have_u_int=1
1245 fi
1246
1247 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t, [
1248    AC_TRY_COMPILE(
1249       [ #include <sys/types.h> ], 
1250       [ intmax_t a; a = 1;], 
1251       [ ac_cv_have_intmax_t="yes" ],
1252       [ 
1253          AC_TRY_COMPILE(
1254             [ #include <stdint.h> ], 
1255             [ intmax_t a; a = 1;], 
1256             [ ac_cv_have_intmax_t="yes" ],
1257             [ ac_cv_have_intmax_t="no" ]
1258          )
1259       ]
1260    )        
1261
1262 ])
1263 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
1264    AC_DEFINE(HAVE_INTMAX_T)
1265    have_intmax_t=1
1266 fi
1267
1268
1269 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t, [
1270    AC_TRY_COMPILE(
1271       [ #include <sys/types.h> ], 
1272       [ u_intmax_t a; a = 1;], 
1273       [ ac_cv_have_u_intmax_t="yes" ],
1274       [ 
1275          AC_TRY_COMPILE(
1276             [ #include <stdint.h> ], 
1277             [ u_intmax_t a; a = 1;], 
1278             [ ac_cv_have_u_intmax_t="yes" ],
1279             [ ac_cv_have_u_intmax_t="no" ]
1280          )
1281       ]
1282    )
1283 ])
1284 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
1285    AC_DEFINE(HAVE_U_INTMAX_T)
1286    have_u_intmax_t=1
1287 fi
1288
1289
1290 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1291    AC_TRY_COMPILE(
1292       [ #include <sys/types.h> ], 
1293       [ int8_t a; int16_t b; int32_t c; a = b = c = 1;], 
1294       [ ac_cv_have_intxx_t="yes" ],
1295       [ ac_cv_have_intxx_t="no" ]
1296    )
1297 ])
1298 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1299    AC_DEFINE(HAVE_INTXX_T)
1300    have_intxx_t=1
1301 fi
1302         
1303 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1304    AC_TRY_COMPILE(
1305       [ #include <sys/types.h> ], 
1306       [ int64_t a; a = 1;], 
1307       [ ac_cv_have_int64_t="yes" ],
1308       [ ac_cv_have_int64_t="no" ]
1309    )
1310 ])
1311 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1312    AC_DEFINE(HAVE_INT64_T)
1313    have_int64_t=1
1314 fi
1315         
1316 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1317    AC_TRY_COMPILE(
1318       [ #include <sys/types.h> ], 
1319       [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;], 
1320       [ ac_cv_have_u_intxx_t="yes" ],
1321       [ ac_cv_have_u_intxx_t="no" ]
1322    )
1323 ])
1324 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1325    AC_DEFINE(HAVE_U_INTXX_T)
1326    have_u_intxx_t=1
1327 fi
1328
1329 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1330    AC_TRY_COMPILE(
1331       [ #include <sys/types.h> ], 
1332       [ u_int64_t a; a = 1;], 
1333       [ ac_cv_have_u_int64_t="yes" ],
1334       [ ac_cv_have_u_int64_t="no" ]
1335    )
1336 ])
1337 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1338    AC_DEFINE(HAVE_U_INT64_T)
1339    have_u_int64_t=1
1340 fi
1341
1342 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1343            test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1344 then
1345    AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1346    AC_TRY_COMPILE(
1347       [ #include <sys/bitypes.h>  ], 
1348       [ int8_t a; int16_t b; int32_t c;
1349         u_int8_t e; u_int16_t f; u_int32_t g;
1350         a = b = c = e = f = g = 1;  ], 
1351       [ AC_DEFINE(HAVE_U_INTXX_T)
1352         AC_DEFINE(HAVE_INTXX_T)
1353         AC_DEFINE(HAVE_SYS_BITYPES_H)
1354         AC_MSG_RESULT(yes) ],
1355       [ AC_MSG_RESULT(no)]
1356    ) 
1357 fi
1358
1359 if test -z "$have_u_intxx_t" ; then
1360    AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1361       AC_TRY_COMPILE(
1362          [ #include <sys/types.h> ], 
1363          [ uint8_t a; uint16_t b; 
1364            uint32_t c; a = b = c = 1; ], 
1365          [ ac_cv_have_uintxx_t="yes" ],
1366          [ ac_cv_have_uintxx_t="no" ]
1367       )
1368    ])
1369    if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1370       AC_DEFINE(HAVE_UINTXX_T)
1371    fi
1372 fi
1373
1374 if (test -z "$have_u_int64_t" || test -z "$have_int64_t" && \
1375           test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1376 then
1377    AC_MSG_CHECKING([for int64_t and u_int64_t types in sys/bitypes.h])
1378    AC_TRY_COMPILE(
1379       [ #include <sys/bitypes.h>  ], 
1380       [ int64_t a; u_int64_t b; 
1381        a = b = 1;  ], 
1382       [ AC_DEFINE(HAVE_U_INT64_T)
1383        AC_DEFINE(HAVE_INT64_T)
1384        AC_MSG_RESULT(yes) ],
1385       [ AC_MSG_RESULT(no)]
1386    ) 
1387 fi
1388
1389 if (test -z "$have_uintxx_t" && \
1390           test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1391 then
1392    AC_MSG_CHECKING([for uintXX_t types in sys/bitypes.h])
1393    AC_TRY_COMPILE(
1394       [ #include <sys/bitypes.h>  ], 
1395         [ uint8_t a; uint16_t b; 
1396           uint32_t c; a = b = c = 1; ], 
1397       [ AC_DEFINE(HAVE_UINTXX_T)
1398        AC_MSG_RESULT(yes) ],
1399       [ AC_MSG_RESULT(no)]
1400    ) 
1401
1402 fi
1403
1404
1405
1406
1407 dnl# --------------------------------------------------------------------------
1408 dnl# CHECKING FOR REQUIRED LIBRARY FUNCTIONS
1409 dnl# --------------------------------------------------------------------------
1410 AC_CHECK_FUNCS( \
1411         fork \
1412         getcwd \
1413         gethostname \
1414         getpid \
1415         gettimeofday \
1416         setpgid \
1417         setpgrp \
1418         setsid \
1419         signal \
1420         strerror \
1421         strncmp \
1422         strncpy \
1423         vfprintf \
1424         ,,
1425         [echo 'configure: cannot find needed function.'; exit 1]
1426 )
1427
1428 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
1429 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
1430
1431 AC_CHECK_FUNCS(chflags) 
1432
1433 AC_CHECK_FUNCS(snprintf vsnprintf gethostid fseeko)
1434
1435 dnl# --------------------------------------------------------------------------
1436 dnl# CHECKING FOR THREAD SAFE FUNCTIONS
1437 dnl# --------------------------------------------------------------------------
1438 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
1439
1440 # If resolver functions are not in libc check for -lnsl or -lresolv.
1441 AC_CHECK_FUNC(gethostbyname_r,
1442     AC_MSG_RESULT(using libc's resolver),
1443     AC_CHECK_LIB(nsl,gethostbyname_r)
1444     AC_CHECK_LIB(resolv,gethostbyname_r))
1445
1446
1447
1448 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
1449 AC_CHECK_FUNCS(inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)])
1450 AC_CHECK_FUNCS(gethostbyname2, [AC_DEFINE(HAVE_GETHOSTBYNAME2)])
1451
1452 dnl ----------------------------
1453 dnl check sa_len of sockaddr
1454 dnl ----------------------------
1455 AC_CACHE_CHECK(for struct sockaddr has a sa_len field, ac_cv_struct_sockaddr_sa_len,
1456   [AC_TRY_COMPILE([#include <sys/socket.h>], [struct sockaddr s; s.sa_len;],
1457   ac_cv_struct_sockaddr_sa_len=yes, ac_cv_struct_sockaddr_sa_len=no)])
1458
1459  if test $ac_cv_struct_sockaddr_sa_len = yes; then
1460   AC_DEFINE(HAVE_SA_LEN, 1, [Define if sa_len field exists in struct sockaddr])
1461  fi
1462
1463
1464 dnl Check for IPv6 support
1465 AC_CACHE_CHECK([for IPv6 support], ac_cv_ipv6_support,
1466 [AC_TRY_LINK([ #include <sys/types.h>
1467 #include <sys/socket.h>
1468 #include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] =
1469  0;],
1470   [ac_cv_ipv6_support=yes], [ac_cv_ipv6_support=no])])
1471
1472 if test "$ac_cv_ipv6_support" = yes; then
1473   AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
1474 fi
1475
1476
1477
1478 AC_FUNC_STRFTIME
1479 AC_FUNC_VPRINTF
1480 AC_FUNC_ALLOCA
1481 AC_FUNC_GETMNTENT
1482 AC_FUNC_CLOSEDIR_VOID
1483 AC_FUNC_SETPGRP                       dnl check for BSD setpgrp.
1484 # AC_FUNC_FNMATCH    dnl use local version
1485
1486
1487 dnl# FreeBSD needs to link libxpg4
1488 AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"])
1489
1490
1491 AC_CHECK_LIB(sun, getpwnam)
1492
1493 AC_CHECK_HEADERS(zlib.h)
1494 AC_CHECK_LIB(z, deflate, [FDLIBS="-lz"])
1495 have_zlib=no
1496 if test x$FDLIBS = x-lz; then
1497   AC_DEFINE(HAVE_LIBZ)
1498   have_zlib=yes
1499 fi
1500
1501 AC_CHECK_HEADER(sys/acl.h)
1502 AC_CHECK_LIB(acl, acl_get_file, [FDLIBS="-lacl $FDLIBS"])
1503 have_acl=no
1504 if test $ac_cv_lib_acl_acl_get_file = yes; then
1505    AC_DEFINE(HAVE_ACL)
1506    have_acl=yes
1507 fi
1508
1509 dnl Check for pthread libraries
1510 PTHREAD_LIB=""
1511 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
1512         [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
1513             [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
1514                 [AC_CHECK_FUNC(pthread_create)]
1515             )]
1516         )]
1517 )
1518
1519 AC_SUBST(FDLIBS)
1520 AC_DEFINE(FDLIBS)
1521
1522
1523 CFLAGS=${CFLAGS--O}
1524 LDFLAGS=${LDFLAGS--O}
1525 DB_LIBS="${SQL_LFLAGS}"
1526
1527 CPPFLAGS="$CPPFLAGS"
1528 AC_SUBST(DEBUG)
1529 AC_SUBST(DINCLUDE)
1530 AC_SUBST(CFLAGS)
1531 AC_SUBST(CPPFLAGS)
1532 AC_SUBST(LDFLAGS)
1533 AC_SUBST(X_CFLAGS)
1534 AC_SUBST(LIBS)
1535 AC_SUBST(DLIB)
1536 AC_SUBST(DB_LIBS)
1537 AC_SUBST(X_LIBS)
1538 AC_SUBST(X_EXTRA_LIBS)
1539 AC_SUBST(WCFLAGS)
1540 AC_SUBST(WLDFLAGS)
1541
1542 dnl# extra configurable objects
1543 OBJLIST=
1544 AC_SUBST(OBJLIST)
1545
1546 lld="lld"
1547 llu="llu"
1548
1549 WCFLAGS=
1550 WLDFLAGS=
1551
1552 #
1553 # Finally we set appropriate distribution specific
1554 #  variables and defaults
1555 #
1556 # PFILES are platform specific files
1557 PFILES="platforms/Makefile"
1558 PSCMD="ps -e"
1559 WIN32=
1560 MACOSX=
1561 PYTHON_LIBS_EXTRAS="-ldl"
1562 hostname=`uname -n | cut -d '.' -f 1`
1563 case "$DISTNAME" in
1564 aix)
1565         DISTVER=`uname -r`
1566         PSCMD="ps -e -o pid,comm"
1567         PFILES="${PFILES} \
1568            platforms/aix/Makefile"
1569         TAPEDRIVE="/dev/rmt0.1" 
1570   ;;      
1571 alpha)
1572         DISTVER=`uname -r`
1573         PTHREAD_LIB="-lpthread -lexc"
1574         if test "${CC}" = "gcc" ; then
1575            lld="lld"
1576            llu="llu"
1577         else
1578            lld="ld"
1579            llu="lu"
1580         fi
1581         TAPEDRIVE="/dev/nrmt0"
1582   ;;
1583 bsdi)
1584         DISTVER=`uname -a |awk '{print $3}'`
1585         TAPEDRIVE="/dev/nrmt0"
1586         PTHREAD_LIB="-pthread"
1587         CFLAGS="${CFLAGS} -pthread"
1588         PSCMD="ps -ax -o pid,command"
1589         lld="qd"
1590         llu="qu"
1591         PFILES="${PFILES} \
1592             platforms/bsdi/Makefile \
1593             platforms/bsdi/bacula-fd \
1594             platforms/bsdi/bacula-sd \
1595             platforms/bsdi/bacula-dir"
1596         largefile_support="yes"
1597   ;;
1598 cygwin)
1599         DISTVER=`uname -a |awk '{print $3}'`
1600         TAPEDRIVE="/dev/nrst0"
1601         WIN32=win32
1602         WCFLAGS="-mwindows"
1603         WLDFLAGS="-mwindows"
1604   ;;
1605 darwin)
1606         DISTVER=`uname -r`
1607         TAPEDRIVE="/dev/nst0"
1608         PSCMD="ps -e -o pid,command"
1609         MACOSX=macosx
1610         PFILES="${PFILES} \
1611            platforms/darwin/Makefile"
1612   ;;
1613 debian)
1614         DISTVER=`cat /etc/debian_version`
1615         TAPEDRIVE="/dev/nrst0"
1616         PSCMD="ps -e -o pid,command"
1617   ;;
1618 freebsd)
1619         DISTVER=`uname -a |awk '{print $3}'`
1620         VER=`echo $DISTVER | cut -c 1`
1621         if test x$VER = x4 ; then
1622            PTHREAD_LIB="-pthread"
1623            CFLAGS="${CFLAGS} -pthread"
1624         fi
1625         lld="qd"
1626         llu="qu"
1627         TAPEDRIVE="/dev/nrsa0"
1628         PSCMD="ps -ax -o pid,command"
1629         PFILES="${PFILES} \
1630             platforms/freebsd/Makefile \
1631             platforms/freebsd/bacula-fd \
1632             platforms/freebsd/bacula-sd \
1633             platforms/freebsd/bacula-dir"
1634         largefile_support="yes"
1635         PYTHON_LIBS_EXTRAS=
1636   ;;
1637 hpux)
1638         PSCMD="UNIX95=1 ps -e -o pid,comm"
1639         CFLAGS="$(CFLAGS) -D_XOPEN_SOURCE_EXTENDED=1"
1640         DISTVER=`uname -r`
1641         TAPEDRIVE="/dev/rmt/0hnb"
1642         PTHREAD_LIB="-lpthread"
1643         AC_DEFINE([_INCLUDE_LONGLONG])
1644   ;;
1645 irix)
1646         DISTVER=`uname -r`
1647         TAPEDRIVE="/dev/rmt/0cbn"
1648         PSCMD="ps -e -o pid,comm"
1649         PFILES="${PFILES} \
1650             platforms/irix/Makefile \
1651             platforms/irix/bacula-fd \
1652             platforms/irix/bacula-sd \
1653             platforms/irix/bacula-dir"
1654   ;;
1655 netbsd)
1656         DISTVER=`uname -a |awk '{print $3}'`
1657         lld="qd"
1658         llu="qu"
1659         TAPEDRIVE="/dev/nrst0"
1660         PSCMD="ps -ax -o pid,command"
1661         PTHREAD_LIB="-pthread"
1662         CFLAGS="${CFLAGS} -pthread"
1663   ;;
1664 openbsd)
1665         DISTVER=`uname -a |awk '{print $3}'`
1666         lld="qd"
1667         llu="qu"
1668         TAPEDRIVE="/dev/nrst0"
1669         PSCMD="ps -ax -o pid,command"
1670         PTHREAD_LIB="-pthread"
1671         CFLAGS="${CFLAGS} -pthread"
1672         PFILES="${PFILES} \
1673             platforms/openbsd/Makefile \
1674             platforms/openbsd/bacula-fd \
1675             platforms/openbsd/bacula-sd \
1676             platforms/openbsd/bacula-dir"
1677   ;;
1678 redhat)
1679         if test -f /etc/whitebox-release ; then
1680            f=/etc/whitebox-release
1681         else
1682            f=/etc/redhat-release
1683         fi
1684         if test `cat $f | grep release |\
1685                    cut -f 3 -d ' '`x = "Enterprise"x ; then
1686            DISTVER="Enterprise "`cat $f | grep release |\
1687                     cut -f 6 -d ' '`
1688         else
1689             DISTVER=`cat /etc/redhat-release | grep release |\
1690                      cut -f 5 -d ' '`
1691         fi
1692         TAPEDRIVE="/dev/nst0"
1693         PSCMD="ps -e -o pid,command"
1694         PFILES="${PFILES} \
1695             platforms/redhat/Makefile \
1696             platforms/redhat/bacula-fd \
1697             platforms/redhat/bacula-sd \
1698             platforms/redhat/bacula-dir \
1699             platforms/redhat/bacula.spec \
1700             "
1701         hostname=`hostname -s`
1702   ;;
1703 mandrake)
1704         DISTVER=`cat /etc/mandrake-release | grep release |\
1705            cut -f 5 -d ' '`
1706         TAPEDRIVE="/dev/nst0"
1707         PSCMD="ps -e -o pid,command"
1708         PFILES="${PFILES} \
1709             platforms/mandrake/Makefile \
1710             platforms/mandrake/bacula-fd \
1711             platforms/mandrake/bacula-sd \
1712             platforms/mandrake/bacula-dir \
1713             platforms/mandrake/bacula.spec \
1714             "
1715   ;;
1716 gentoo)
1717         DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
1718         TAPEDRIVE="/dev/nst0"
1719         PSCMD="ps -e -o pid,command"
1720         PFILES="${PFILES} \
1721             platforms/gentoo/Makefile \
1722          platforms/gentoo/bacula-init \
1723             platforms/gentoo/bacula-fd \
1724             platforms/gentoo/bacula-sd \
1725             platforms/gentoo/bacula-dir"
1726   ;;
1727 slackware)
1728         DISTVER=`cat /etc/slackware-version`
1729         TAPEDRIVE="/dev/nst0"
1730         PSCMD="ps -e -o pid,command"
1731         PFILES="${PFILES} \
1732             platforms/slackware/Makefile \
1733             platforms/slackware/rc.bacula-fd \
1734             platforms/slackware/rc.bacula-sd \
1735             platforms/slackware/rc.bacula-dir\
1736             platforms/slackware/functions.bacula"
1737   ;;
1738 solaris)
1739         DISTVER=`uname -r`
1740         TAPEDRIVE="/dev/rmt/0cbn"
1741         PSCMD="ps -e -o pid,comm"
1742         PFILES="${PFILES} \
1743             platforms/solaris/Makefile \
1744             platforms/solaris/bacula-fd \
1745             platforms/solaris/bacula-sd \
1746             platforms/solaris/bacula-dir"
1747         if test x$DISTVER = x5.6 ; then
1748             AC_DEFINE(HAVE_OLD_SOCKOPT)
1749         fi
1750         LIBS="$LIBS -lresolv"
1751   ;;
1752 suse)
1753         DISTVER=`cat /etc/SuSE-release |grep VERSION|\
1754             cut -f 3 -d ' '`
1755         TAPEDRIVE="/dev/nst0"
1756         PSCMD="ps -e -o pid,command"
1757         PFILES="${PFILES} \
1758             platforms/suse/Makefile \
1759             platforms/suse/bacula-fd \
1760             platforms/suse/bacula-sd \
1761             platforms/suse/bacula-dir \
1762             platforms/suse/bacula \
1763             platforms/suse/bacula.spec"
1764   ;;
1765 suse5)
1766         DISTNAME=suse
1767         DISTVER=5.x
1768         TAPEDRIVE="/dev/nst0"
1769         PSCMD="ps -e -o pid,command"
1770         PFILES="${PFILES} \
1771             platforms/suse/Makefile \
1772             platforms/suse/bacula-fd \
1773             platforms/suse/bacula-sd \
1774             platforms/suse/bacula-dir"
1775   ;;
1776 unknown)
1777         DISTVER=unknown
1778         TAPEDRIVE="/dev/nst0"
1779   ;;
1780 *)
1781   echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
1782   ;;
1783 esac  
1784
1785 AC_SUBST(hostname)
1786
1787 LIBS="$PTHREAD_LIB $LIBS"
1788 if test "x$PYTHON_LIBS" != x -a "x$PYTHON_LIBS_EXTRAS" != x; then
1789   PYTHON_LIBS="$PYTHON_LIBS $PYTHON_LIBS_EXTRAS"
1790 fi
1791
1792 AC_DEFINE_UNQUOTED(lld, "$lld")
1793 AC_DEFINE_UNQUOTED(llu, "$llu")
1794 AC_SUBST(TAPEDRIVE)
1795 AC_SUBST(PSCMD)
1796 AC_SUBST(WIN32)
1797 AC_SUBST(MACOSX)
1798 AC_SUBST(DISTNAME)
1799 AC_SUBST(DISTVER)
1800
1801 dnl# common parts of the Makefile
1802 MCOMMON=./autoconf/Make.common
1803 AC_SUBST_FILE(MCOMMON)
1804
1805 dnl# Insanity check
1806 if test "x${subsysdir}" = "x${sbindir}" ; then
1807    echo " "
1808    echo " "
1809    echo "You have set both --sbindir and --with-subsys-dir"
1810    echo "  equal to: ${subsysdir} "
1811    echo "This is not permitted. Please reconfigure."
1812    echo " "
1813    echo "Aborting configuration ..."
1814    echo " "
1815    echo " "
1816    exit 1
1817 fi 
1818
1819 AC_OUTPUT([autoconf/Make.common \
1820            Makefile \
1821            scripts/startmysql \
1822            scripts/stopmysql \
1823            scripts/btraceback \
1824            scripts/startit \
1825            scripts/stopit \
1826            scripts/bconsole \
1827            scripts/gconsole \
1828            scripts/bacula \
1829            scripts/devel_bacula \
1830            scripts/Makefile \
1831            scripts/logrotate \
1832            scripts/bacula.desktop.gnome1 \
1833            scripts/bacula.desktop.gnome2 \
1834            scripts/bacula.desktop.gnome1.consolehelper \
1835            scripts/bacula.desktop.gnome2.consolehelper \
1836            scripts/bacula.desktop.gnome1.xsu \
1837            scripts/bacula.desktop.gnome2.xsu \
1838            scripts/gnome-console.console_apps \
1839            scripts/mtx-changer \
1840            scripts/dvd-writepart \
1841            scripts/dvd-freespace \
1842            scripts/bacula-tray-monitor.desktop \
1843            scripts/logwatch/Makefile \
1844            scripts/logwatch/logfile.bacula.conf \
1845            src/Makefile \
1846            src/host.h \
1847            src/console/Makefile \
1848            src/console/bconsole.conf \
1849            src/gnome2-console/Makefile \
1850            src/gnome2-console/gnome-console.conf \
1851            src/wx-console/Makefile \
1852            src/wx-console/wx-console.conf \
1853            src/tray-monitor/Makefile \
1854            src/tray-monitor/tray-monitor.conf \
1855            src/dird/Makefile \
1856            src/dird/bacula-dir.conf \
1857            src/lib/Makefile \
1858            src/stored/Makefile \
1859            src/stored/bacula-sd.conf \
1860            src/filed/Makefile \
1861            src/filed/bacula-fd.conf \
1862            src/filed/win32/Makefile \
1863            src/cats/Makefile \
1864            src/cats/make_catalog_backup \
1865            src/cats/delete_catalog_backup \
1866            src/cats/create_postgresql_database \
1867            src/cats/update_postgresql_tables \
1868            src/cats/make_postgresql_tables \
1869            src/cats/grant_postgresql_privileges \
1870            src/cats/drop_postgresql_tables \
1871            src/cats/drop_postgresql_database \
1872            src/cats/create_mysql_database \
1873            src/cats/update_mysql_tables \
1874            src/cats/make_mysql_tables \
1875            src/cats/grant_mysql_privileges \
1876            src/cats/drop_mysql_tables \
1877            src/cats/drop_mysql_database \
1878            src/cats/create_sqlite_database \
1879            src/cats/update_sqlite_tables \
1880            src/cats/make_sqlite_tables \
1881            src/cats/grant_sqlite_privileges \
1882            src/cats/drop_sqlite_tables \
1883            src/cats/drop_sqlite_database \
1884            src/cats/create_sqlite3_database \
1885            src/cats/update_sqlite3_tables \
1886            src/cats/make_sqlite3_tables \
1887            src/cats/grant_sqlite3_privileges \
1888            src/cats/drop_sqlite3_tables \
1889            src/cats/drop_sqlite3_database \
1890            src/cats/sqlite \
1891            src/cats/mysql \
1892            src/cats/create_bdb_database \
1893            src/cats/update_bdb_tables \
1894            src/cats/make_bdb_tables \
1895            src/cats/grant_bdb_privileges \
1896            src/cats/drop_bdb_tables \
1897            src/cats/drop_bdb_database \
1898            src/cats/create_bacula_database \
1899            src/cats/update_bacula_tables \
1900            src/cats/grant_bacula_privileges \
1901            src/cats/make_bacula_tables \
1902            src/cats/drop_bacula_tables \
1903            src/cats/drop_bacula_database \
1904            src/findlib/Makefile \
1905            src/tools/Makefile \
1906            src/win32/winbacula.nsi \
1907            src/win32/baculafd/bacula-fd.conf \
1908            src/win32/Makefile \
1909            src/win32/console/bconsole.conf \
1910            src/win32/wx-console/wx-console.conf \
1911            src/win32/pebuilder/Makefile \
1912            $PFILES ],  
1913           [(echo "Doing make of dependencies"; ${MAKE:-make} depend;) ]
1914 )
1915
1916 cd scripts
1917 chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
1918 chmod 755 dvd-writepart dvd-freespace
1919 chmod 755 bconsole gconsole mtx-changer devel_bacula logrotate
1920 cd ..
1921
1922 c=src/cats
1923
1924 chmod 755 $c/create_bacula_database   $c/update_bacula_tables  $c/make_bacula_tables
1925 chmod 755 $c/grant_bacula_privileges  $c/drop_bacula_tables    $c/drop_bacula_database
1926
1927 chmod 755 $c/create_bdb_database      $c/update_bdb_tables     $c/make_bdb_tables
1928 chmod 755 $c/grant_bdb_privileges     $c/drop_bdb_tables       $c/drop_bdb_database
1929
1930 chmod 755 $c/create_mysql_database    $c/update_mysql_tables   $c/make_mysql_tables
1931 chmod 755 $c/grant_mysql_privileges   $c/drop_mysql_tables     $c/drop_mysql_database
1932
1933 chmod 755 $c/create_sqlite_database   $c/update_sqlite_tables  $c/make_sqlite_tables
1934 chmod 755 $c/grant_sqlite_privileges  $c/drop_sqlite_tables    $c/drop_sqlite_database
1935
1936 chmod 755 $c/create_postgresql_database  $c/update_postgresql_tables $c/make_postgresql_tables
1937 chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables   $c/drop_postgresql_database
1938
1939 chmod 755 $c/make_catalog_backup $c/delete_catalog_backup
1940 chmod 755 $c/sqlite
1941 chmod 755 $c/mysql
1942
1943 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
1944    largefile_support="yes"
1945 fi
1946
1947 #
1948 # A whole lot of hand springs to get the compiler version.
1949 #  This is because gcc changed the output in version 3.0
1950 #
1951 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
1952 if test "x${CCVERSION}" = "x" ; then
1953   CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
1954 fi
1955 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
1956 if test x"${CXXVERSION}" = x ; then
1957   CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
1958 fi
1959
1960 if test "x${subsysdir}" = "x${sbindir}" ; then
1961    echo " "
1962    echo " "
1963    echo "You have set --sbindir and --with-subsys-dir"
1964    echo "  both equal to: ${subsysdir} "
1965    echo "  This is not permitted. Please reconfigure."
1966    echo " "
1967    echo "Aborting configuration ..."
1968    echo " "
1969    echo " "
1970    exit 1
1971 fi 
1972
1973 if test "x${db_name}" = "xInternal" ; then
1974    echo " "
1975    echo " "
1976    echo "You have not specified either --enable-client-only or one of the"
1977    echo "  supported databases: MySQL, PostgreSQL, SQLite3 or SQLite."
1978    echo "  This is not permitted. Please reconfigure."
1979    echo " "
1980    echo "Aborting the configuration ..."
1981    echo " "
1982    echo " "
1983    exit 1
1984 fi
1985
1986 echo "
1987 Configuration on `date`:
1988
1989   Host:                       $host -- ${DISTNAME} ${DISTVER}
1990   Bacula version:             ${VERSION} (${DATE})
1991   Source code location:       ${srcdir}
1992   Install binaries:           ${sbindir}
1993   Install config files:       ${sysconfdir}
1994   Scripts directory:          ${scriptdir}
1995   Working directory:          ${working_dir}
1996   PID directory:              ${piddir}
1997   Subsys directory:           ${subsysdir}
1998   Man directory:              ${mandir}
1999   C Compiler:                 ${CC} ${CCVERSION}
2000   C++ Compiler:               ${CXX} ${CXXVERSION}
2001   Compiler flags:             ${WCFLAGS} ${CFLAGS} 
2002   Linker flags:               ${WLDFLAGS} ${LDFLAGS}
2003   Libraries:                  ${LIBS}
2004   Statically Linked Tools:    ${support_static_tools}
2005   Statically Linked FD:       ${support_static_fd}
2006   Statically Linked SD:       ${support_static_sd}
2007   Statically Linked DIR:      ${support_static_dir}
2008   Statically Linked CONS:     ${support_static_cons}
2009   Database type:              ${db_name}
2010   Database lib:               ${DB_LIBS}
2011
2012   Job Output Email:           ${job_email}
2013   Traceback Email:            ${dump_email}
2014   SMTP Host Address:          ${smtp_host}
2015
2016   Director Port:              ${dir_port}
2017   File daemon Port:           ${fd_port}
2018   Storage daemon Port:        ${sd_port}
2019
2020   Director User:              ${dir_user}
2021   Director Group:             ${dir_group}
2022   Storage Daemon User:        ${sd_user}
2023   Storage DaemonGroup:        ${sd_group}
2024   File Daemon User:           ${fd_user}
2025   File Daemon Group:          ${fd_group}
2026
2027   SQL binaries Directory      ${SQL_BINDIR}
2028
2029   Large file support:         $largefile_support
2030   Bacula conio support:       ${got_conio} ${CONS_LIBS}
2031   readline support:           ${got_readline} ${PRTREADLINE_SRC}
2032   TCP Wrappers support:       ${TCPW_MSG}
2033   TLS support:                ${support_tls}
2034   ZLIB support:               ${have_zlib}
2035   enable-smartalloc:          ${support_smartalloc} 
2036   enable-gnome:               ${support_gnome} ${gnome_version}
2037   enable-wx-console:          ${support_wx_console} ${wx_version}
2038   enable-tray-monitor:        ${support_tray_monitor}
2039   client-only:                ${build_client_only}
2040   ACL support:                ${have_acl}
2041   Python support:             ${support_python} ${PYTHON_LIBS}
2042
2043   " > config.out
2044
2045 cat config.out