]> git.sur5r.net Git - bacula/bacula/blob - bacula/autoconf/configure.in
ebl Pemit to mark version as Beta in some ouputs
[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_SUBST(TOP_DIR)
12 AC_CONFIG_AUX_DIR(${BUILD_DIR}/autoconf)
13 AC_CONFIG_HEADER(src/config.h:autoconf/config.h.in)
14
15 dnl require a recent autoconf
16 AC_PREREQ(2.59)
17
18
19 dnl search for true and false programs.
20 AC_PATH_PROGS(TRUEPRG, true, :)
21 AC_PATH_PROGS(FALSEPRG, false, :)
22
23
24 dnl bacula version
25 post_host=
26 if test "x$BACULA" != x; then
27    post_host=`echo -${BACULA} | tr 'A-Z ' 'a-z-'`
28 fi
29 BACULA=${BACULA-Bacula}
30 VERSION=`sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
31 DATE=`sed -n -e 's/^.*[ \t]*BDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
32 LSMDATE=`sed -n -e 's/^.*LSMDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
33 AC_SUBST(VERSION)dnl 
34 AC_SUBST(DATE)dnl 
35 AC_SUBST(LSMDATE)dnl 
36 AC_SUBST(BACULA)dnl
37 AC_SUBST(post_host)dnl
38 echo "configuring for ${BACULA} $VERSION ($DATE)"
39
40
41 dnl -------------------------------------------------------
42 dnl# Check for compiler.
43 dnl ------------------------------------------------------
44
45 AC_PROG_CC
46 AC_PROG_CXX
47 AC_PROG_CC_C_O                  dnl Determine if C compiler support -c -o.
48 AC_PROG_GCC_TRADITIONAL         dnl Determine if ioctl() need -traditional.
49
50 BASECC=`basename $CC`
51 have_gcc=no
52 if test "x$BASECC" = xgcc; then
53    AC_DEFINE(HAVE_GCC)
54    have_gcc=yes
55 fi
56 AC_PATH_PROG(CXX, $CXX, $CXX)
57 if test ! -e $CXX; then
58    AC_MSG_ERROR(Unable to find C++ compiler)
59 fi
60
61 dnl -------------------------------------------------------
62 dnl# Check for programs.
63 dnl ------------------------------------------------------
64 AC_PROG_INSTALL
65 AC_PROG_RANLIB
66 AC_PATH_PROG(MV, mv, mv)
67 AC_PATH_PROG(RM, rm, rm)
68 AC_PATH_PROG(CP, cp, cp)
69 AC_PATH_PROG(SED, sed, sed)
70 AC_PATH_PROG(ECHO, echo, echo)
71 AC_PATH_PROG(CMP, cmp, cmp)
72 AC_PATH_PROG(TBL, tbl, tbl)
73 AC_PATH_PROG(AR, ar, ar)
74 dnl AC_PATH_PROG(RANLIB, ranlib, ranlib)
75 AC_PATH_PROG(OPENSSL, openssl, none)
76 AC_PATH_PROG(MTX, mtx, mtx)
77 AC_PATH_PROG(DD, dd, dd)
78 AC_PATH_PROG(MKISOFS, mkisofs, mkisofs)
79 AC_PATH_PROG(PYTHON, python, python)
80 AC_PATH_PROG(GROWISOFS, growisofs, growisofs)
81 AC_PATH_PROG(DVDRWMEDIAINFO, dvd+rw-mediainfo, dvd+rw-mediainfo)
82 AC_PATH_PROG(DVDRWFORMAT, dvd+rw-format, dvd+rw-format)
83 AC_PATH_PROG(PKGCONFIG, pkg-config, pkg-config)
84 AC_PATH_PROG(QMAKE, qmake, none)
85 AC_PATH_PROG(QMAKEQT4, qmake-qt4, none)
86 AC_ARG_VAR(WXCONFIG, [wx-config command. On some systems, you must set it to wx-config-2.6 to use wxWidgets 2.6.])
87 if test "x$WXCONFIG" = x; then
88   WXCONFIG=wx-config
89 fi
90 AC_PATH_PROG(WXCONFIG, ${WXCONFIG}, ${WXCONFIG})
91 AC_ARG_VAR(WXFLAGS, [Parameters to pass to wx-config (e.g. --unicode=no).])
92 AC_PATH_PROG(CDRECORD, cdrecord, cdrecord)
93 AC_PATH_PROG(PIDOF, pidof, pidof)
94 AC_PROG_AWK
95 # Some AWK programs fail, so test it and warn the user
96 if echo xfoo | $AWK 'BEGIN { prog=ARGV[1]; ARGC=1 } 
97       { if ((prog == $2) || (("(" prog ")") == $2) ||
98            (("[" prog "]") == $2) ||
99            ((prog ":") == $2)) { print $1 ; exit 0 } }' xfoo>/dev/null; then :;
100 else
101   AC_MSG_ERROR([!!!!!!!!! WARNING !!!!!!!!!!!!!!
102    The regex engine of $AWK is too broken to be used you 
103    might want to install GNU AWK.
104    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!])
105 fi
106 THE_AWK=$AWK
107 AC_PATH_PROG(AWK, $THE_AWK, $THE_AWK)
108
109
110 test -n "$ARFLAG" || ARFLAGS="cr"
111 AC_SUBST(ARFLAGS)
112
113 MAKE_SHELL=/bin/sh
114 AC_SUBST(MAKE_SHELL)
115
116 AC_SUBST(LOCAL_LIBS)
117 AC_SUBST(LOCAL_CFLAGS)
118 AC_SUBST(LOCAL_LDFLAGS)
119 AC_SUBST(LOCAL_DEFS)
120
121 dnl --------------------------------------------------
122 dnl Bacula OP Sys determination (see aclocal.m4)
123 dnl --------------------------------------------------
124 BA_CHECK_OPSYS
125
126 # -----------------------------------------------------------
127 dnl Bacula OPSys Distribution determination (see aclocal.m4)
128 # ----------------------------------------------------------
129 BA_CHECK_OPSYS_DISTNAME
130
131 # --------------------------------------------------
132 # Suppport for gettext (translations)
133 # By default, $datadir is ${prefix}/share
134 # --------------------------------------------------
135 AM_GNU_GETTEXT([external])
136 if test x${prefix} = xNONE ; then
137    if test `eval echo ${datadir}` = NONE/share ; then
138       datadir=/usr/share
139    fi
140 fi
141
142 # ------------------------------------------------------------------
143 #  If the user has not set --prefix, we set our default to nothing.
144 #  In this case, if the user has not set --sysconfdir, we set it
145 #  to the package default of /etc/bacula.  If either --prefix or
146 #  --sysconfdir is set, we leave sysconfdir alone except to eval it.
147 # ------------------------------------------------------------------
148 if test x${prefix} = xNONE ; then
149     if test `eval echo ${sysconfdir}` = NONE/etc ; then
150         sysconfdir=/etc/bacula
151     fi
152     prefix=
153 fi
154 sysconfdir=`eval echo ${sysconfdir}`
155 datadir=`eval echo ${datadir}`
156 localedir=`eval echo ${datadir}/locale`
157 AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir") 
158 AC_DEFINE_UNQUOTED(SYSCONFDIR, "$sysconfdir")
159
160 # -------------------------------------------------------------------------
161 #  If the user has not set --exec-prefix, we default to ${prefix}
162 # -------------------------------------------------------------------------
163 if test x${exec_prefix} = xNONE ; then
164     exec_prefix=${prefix}
165 fi
166
167 # ------------------------------------------------------------------
168 # If the user has not set --sbindir, we set our default as /sbin
169 # ------------------------------------------------------------------
170 if test x$sbindir = x'${exec_prefix}/sbin' ; then
171     sbindir=${exec_prefix}/sbin
172 fi
173 sbindir=`eval echo ${sbindir}`
174
175
176 # -------------------------------------------------------------------------
177 #  If the user has not set --mandir, we default to /usr/share/man
178 # -------------------------------------------------------------------------
179 if test x$mandir = x'${prefix}/man' ; then
180    mandir=/usr/share/man
181 fi
182
183                       
184 AC_PATH_PROGS(MSGFMT, msgfmt, no)
185 if test "$MSGFMT" = "no"
186 then
187    echo 'msgfmt program not found, disabling NLS !'
188    USE_NLS=no
189    USE_INCLUDED_LIBINTL=no
190 #else
191     AM_GNU_GETTEXT
192 fi
193
194 support_mysql=no
195 support_sqlite=no
196 support_sqlite3=no
197 support_postgresql=no
198 support_dbi=no
199 support_smartalloc=yes
200 support_readline=yes
201 support_conio=yes
202 support_gnome=no
203 support_bat=no
204 support_wx_console=no
205 support_tls=no
206 support_crypto=no
207 gnome_version=
208 wx_version=
209 support_static_tools=no
210 support_static_fd=no
211 support_static_sd=no
212 support_static_dir=no
213 support_static_cons=no
214 support_python=no
215 build_client_only=no
216 build_dird=yes
217 build_stored=yes
218 cats=
219 db_type=Internal
220 DB_TYPE=bdb
221
222 dnl# --------------------------------------------------------------------------
223 dnl# CHECKING COMMAND LINE OPTIONS
224 dnl# --------------------------------------------------------------------------
225
226 # -------------------------------------------
227 # gnome (default off)
228 # -------------------------------------------
229 AC_ARG_ENABLE(gnome,
230   [  --enable-gnome       enable build of bgnome-console GUI [disabled]],
231   [if test x$enableval = xyes; then
232     support_gnome=yes
233   fi])
234
235 GNOME_DIR=
236 if test x$support_gnome = xyes; then
237   abc=`$PKGCONFIG --exists libgnomeui-2.0`
238   pkg=$?
239   if test $pkg = 0; then
240      GNOME_INCLUDEDIR=`$PKGCONFIG --cflags-only-I libgnomeui-2.0`
241      GNOMEUI_LIBS=`$PKGCONFIG --libs-only-l libgnomeui-2.0`
242      GNOME_LIBDIR=`$PKGCONFIG --libs libgnomeui-2.0`
243      GNOME_LIBS=`$PKGCONFIG --libs-only-l libgnomeui-2.0`
244      AC_SUBST(GNOME_INCLUDEDIR)
245      AC_SUBST(GNOMEUI_LIBS)
246      AC_SUBST(GNOME_LIBDIR)
247      AC_SUBST(GNOME_LIBS)
248      GNOME_DIR=src/gnome2-console
249      gnome_version="Version 2.x"
250   else
251      AC_MSG_ERROR(Unable to find Gnome 2 installation)
252   fi
253 fi
254 AC_SUBST(GNOME_DIR)
255
256 # -------------------------------------------
257 # bat (default off)
258 # -------------------------------------------
259 AC_ARG_ENABLE(bat,
260   [  --enable-bat       enable build of bat Qt4 GUI [disabled]],
261   [if test x$enableval = xyes; then
262     AC_DEFINE(HAVE_BAT, 1, [Set if Bacula bat Qt4 GUI support enabled]) 
263     support_bat=yes
264   fi])
265
266 BAT_DIR=
267 if test x$support_bat = xyes; then
268   abc=`$PKGCONFIG --atleast-version=4.2 QtGui`
269   pkg=$?
270   if test $pkg = 0; then
271      BAT_DIR=src/qt-console
272   else
273      AC_MSG_ERROR(Unable to find Qt4 installation needed by bat)
274   fi
275 fi
276
277
278 #  If bat is enabled, we need the qwt library
279 got_qwt=no
280 QWT_INC=
281 QWT_LDFLAGS=
282 QWT_LIB=
283 QWT=
284 no_qwt=no
285 if test x$support_bat = xyes; then
286    AC_MSG_CHECKING(for qwt support)
287    AC_ARG_WITH(qwt,
288      [ --with-qwt@<:@=DIR@:>@             specify qwt library directory],
289      [
290         case "$with_qwt" in
291         no)
292            no_qwt=yes
293           ;;
294         yes|*)
295           if test -f ${with_qwt}/include/qwt.h; then
296              QWT_INC="${with_qwt}/include"
297              QWT_LDFLAGS="-L${with_qwt}/lib"
298              QWT_LIB="-lqwt"
299              QWT="qwt"
300           fi
301           ;;
302         esac
303      ]   
304    )
305 #
306 # Search in standard places, or --with-qwt not specified
307 #
308    if test $no_qwt = no; then 
309     if test x$QWT_INC = x; then
310       for root in /usr /usr/local; do
311          for ver in qwt qwt5 qwt-qt4; do
312             if test -f ${root}/include/${ver}/qwt.h; then
313                QWT_INC="${root}/include/${ver}"
314                if test -d ${root}/lib64/; then
315                   QWT_LDFLAGS="-L${root}/lib64"
316                else
317                   QWT_LDFLAGS="-L${root}/lib"
318                fi
319                QWT_LIB="-lqwt"
320                QWT="qwt"
321                got_qwt=yes
322                break;
323             fi
324          done
325       done
326     fi
327    fi
328    if test x$QWT_INC = x; then
329       AC_MSG_RESULT(no)
330    else
331       AC_DEFINE(HAVE_QWT, 1, [Set if bat QWT library found])
332       AC_MSG_RESULT(yes)
333    fi
334 fi
335
336 AC_SUBST(BAT_DIR)
337 AC_SUBST(QWT_INC)
338 AC_SUBST(QWT_LDFLAGS)
339 AC_SUBST(QWT_LIB)
340 AC_SUBST(QWT)
341
342
343 # -------------------------------------------
344 # bwx-console (default off)
345 # -------------------------------------------
346 AC_ARG_ENABLE(bwx-console,
347   [  --enable-bwx-console     enable build of wxWidgets console [disabled]],
348   [if test x$enableval = xyes; then
349     support_wx_console=yes
350   fi])
351
352 WX_DIR=
353 if test x$support_wx_console = xyes; then
354   abc=`$WXCONFIG $WXFLAGS --cppflags`
355   pkg=$?
356   if test $pkg = 0; then
357      wx_version="wxWidgets `$WXCONFIG $WXFLAGS --release`"
358      WXCONS_CPPFLAGS=`$WXCONFIG $WXFLAGS --cppflags`
359      WXCONS_LDFLAGS=`$WXCONFIG $WXFLAGS --libs`
360
361      AC_SUBST(WXCONS_CPPFLAGS)
362      AC_SUBST(WXCONS_LDFLAGS)
363      WX_DIR=src/wx-console
364   else
365      echo " "
366      echo "wx-config program not found. bwx-console disabled."
367      echo " "
368      support_wx_console=no
369   fi
370 fi
371 AC_SUBST(WX_DIR)
372
373
374 # -------------------------------------------
375 # tray-monitor (default off)
376 # -------------------------------------------
377 AC_ARG_ENABLE(tray-monitor,
378   [  --enable-tray-monitor   enable build of Gnome tray monitor (compatible with KDE) [disabled]],
379   [if test x$enableval = xyes; then
380     support_tray_monitor=yes
381   fi])
382
383 TRAY_MONITOR_DIR=
384 if test x$support_tray_monitor = xyes; then
385   abc=`$PKGCONFIG --exists gtk+-2.0`
386   pkg=$?
387   if test $pkg = 0; then
388      TRAY_MONITOR_CPPFLAGS=`$PKGCONFIG --cflags gtk+-2.0`
389      TRAY_MONITOR_LDFLAGS=`$PKGCONFIG --libs gtk+-2.0`
390      AC_SUBST(TRAY_MONITOR_CPPFLAGS)
391      AC_SUBST(TRAY_MONITOR_LDFLAGS)
392      TRAY_MONITOR_DIR=src/tray-monitor
393      abc=`$PKGCONFIG --atleast-version=2.4 gtk+-2.0`
394      pkg=$?
395      if test $pkg = 0; then
396         AC_DEFINE(HAVE_GTK_2_4, 1, [Set if you have GTK 4.2 or greater loaded])
397      fi
398   fi
399 fi
400 AC_SUBST(TRAY_MONITOR_DIR)
401
402 # -------------------------------------------
403 # smartalloc (default off)
404 # -------------------------------------------
405 AC_ARG_ENABLE(smartalloc,
406   [  --enable-smartalloc     enable smartalloc debugging support [disabled]],
407   [if test x$enableval = xno; then
408     support_smartalloc=no
409   fi])
410
411 if test x$support_smartalloc = xyes; then
412    AC_DEFINE(SMARTALLOC, 1, [Set if you want Smartalloc enabled])
413 fi
414
415 # -------------------------------------------
416 # static-tools (default off)
417 # -------------------------------------------
418 AC_ARG_ENABLE(static-tools,
419    [  --enable-static-tools   enable static tape tools [disabled]],
420    [if test x$enableval = xyes; then
421      support_static_tools=yes
422    fi])
423
424 TTOOL_LDFLAGS=
425 if test x$support_static_tools = xyes; then
426    TTOOL_LDFLAGS="-static"
427 fi
428 AC_SUBST(TTOOL_LDFLAGS)
429
430 # -------------------------------------------
431 # static-fd    (default off)
432 # -------------------------------------------
433 AC_ARG_ENABLE(static-fd,
434    [  --enable-static-fd      enable static File daemon [disabled]],
435    [if test x$enableval = xyes; then
436      support_static_fd=yes
437    fi])
438
439 STATIC_FD=
440 if test x$support_static_fd = xyes; then
441    STATIC_FD="static-bacula-fd"
442 fi
443 AC_SUBST(STATIC_FD)
444
445 # -------------------------------------------
446 # static-sd    (default off)
447 # -------------------------------------------
448 AC_ARG_ENABLE(static-sd,
449    [  --enable-static-sd      enable static Storage daemon [disabled]],
450    [if test x$enableval = xyes; then
451      support_static_sd=yes
452    fi])
453
454 STATIC_SD=
455 if test x$support_static_sd = xyes; then
456    STATIC_SD="static-bacula-sd"
457 fi
458 AC_SUBST(STATIC_SD)
459
460 # -------------------------------------------
461 # static-dir   (default off)
462 # -------------------------------------------
463 AC_ARG_ENABLE(static-dir,
464    [  --enable-static-dir     enable static Director [disabled]],
465    [if test x$enableval = xyes; then
466      support_static_dir=yes
467    fi])
468
469 STATIC_DIR=
470 if test x$support_static_dir = xyes; then
471    STATIC_DIR="static-bacula-dir"
472 fi
473 AC_SUBST(STATIC_DIR)
474
475 # -------------------------------------------
476 # static-cons  (default off)
477 # -------------------------------------------
478 AC_ARG_ENABLE(static-cons,
479    [  --enable-static-cons    enable static Console [disabled]],
480    [if test x$enableval = xyes; then
481      support_static_cons=yes
482    fi])
483
484 STATIC_CONS=
485 STATIC_GNOME_CONS=
486 STATIC_WX_CONS=
487 if test x$support_static_cons = xyes; then
488    STATIC_CONS="static-bconsole"
489    STATIC_GNOME_CONS="static-bgnome-console"
490    STATIC_WX_CONS="static-bwx-console"
491 fi
492 AC_SUBST(STATIC_CONS)
493 AC_SUBST(STATIC_GNOME_CONS)
494 AC_SUBST(STATIC_WX_CONS)
495
496 # -------------------------------------------
497 # client_only  (default off)
498 # -------------------------------------------
499 AC_ARG_ENABLE(client-only,
500    [  --enable-client-only    build client (File daemon) only [disabled]],
501    [if test x$enableval = xyes; then
502       build_client_only=yes
503       db_type=None
504       DB_TYPE=none
505    fi])
506 if test x$build_client_only = xno; then
507    ALL_DIRS="subdirs"
508 else
509    ALL_DIRS=""
510 fi
511 AC_SUBST(ALL_DIRS)
512
513 # -------------------------------------------
514 # director  (default on)
515 # -------------------------------------------
516 AC_ARG_ENABLE(build-dird,
517    [  --enable-build-dird     enable building of dird (Director) [enabled]],
518    [if test x$enableval = xno; then
519       build_dird=no
520    fi])
521 if test x$build_dird = xyes; then
522    DIRD_DIR="src/dird"
523    DIR_TOOLS="DIRTOOLS"
524 else
525    DIRD_DIR=""
526    DIR_TOOLS="NODIRTOOLS"
527 fi
528 AC_SUBST(DIRD_DIR)
529 AC_SUBST(DIR_TOOLS)
530
531 # -------------------------------------------
532 # stored  (default on)
533 # -------------------------------------------
534 AC_ARG_ENABLE(build-stored,
535    [  --enable-build-stored   enable building of stored (Storage daemon) [enabled]],
536    [if test x$enableval = xno; then
537       build_stored=no
538    fi])
539 if test x$build_stored = xyes; then
540    STORED_DIR="src/stored"
541 else
542    STORED_DIR=""
543 fi
544 AC_SUBST(STORED_DIR)
545
546 # ---------------------------------------------------
547 # Check for conio (Bacula readline substitute)(
548 # ---------------------------------------------------
549 # this allows you to turn it completely off
550 AC_ARG_ENABLE(conio,
551   [ --disable-conio disable conio support [enabled]
552                                               ],
553   [if test x$enableval = xno; then
554      support_conio=no
555   fi]
556 )
557   
558
559 # ---------------------------------------------------
560 # Check for IPv6 support
561 # ---------------------------------------------------
562 # this allows you to turn it completely off
563 support_ipv6=yes
564 AC_ARG_ENABLE(ipv6,   
565   [  --enable-ipv6                  enable ipv6 support [enabled]
566                                                       ],
567   [if test x$enableval = xno; then
568      support_ipv6=no  
569   fi]
570 )
571
572 if test x$support_ipv6 = xyes; then
573     AC_TRY_LINK([ #include <sys/types.h>
574 #include <sys/socket.h>
575 #include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;],
576       [support_ipv6=yes], [support_ipv6=no])
577 fi
578
579 if test x$support_ipv6 = xyes; then
580    AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
581 fi
582
583
584
585 got_conio="no"
586 if test x$support_conio = xyes; then
587    AC_CHECK_HEADER(termcap.h, 
588      [ AC_CHECK_LIB(termcap, tgetent, 
589        [ CONS_LIBS="-ltermcap"
590          CONS_OBJ="conio.o"
591          CONS_SRC="conio.c"
592          got_conio="yes"
593          support_readline=no
594          AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled]) 
595        ],   
596        [ AC_CHECK_LIB(ncurses, tgetent,
597          [ CONS_LIBS="-lncurses"
598            CONS_OBJ="conio.o"
599            CONS_SRC="conio.c"
600            got_conio="yes"
601            support_readline=no
602            AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled]) 
603          ])
604        ])
605      ],
606      [
607          AC_CHECK_HEADERS(curses.h)
608          AC_CHECK_HEADER(term.h,
609                [ AC_CHECK_LIB(curses, tgetent, 
610                  [ CONS_LIBS="-lcurses"
611                    CONS_OBJ="conio.o"
612                    CONS_SRC="conio.c"
613                    got_conio="yes"
614                    support_readline=no
615                    AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled]) 
616                  ])
617                ],
618                [ echo " "; echo "Required libraries not found. CONIO turned off ..."; echo " "],
619 [#if HAVE_CURSES_H
620 #include <curses.h>
621 #endif
622 ])
623      ])
624 fi
625
626
627 # ---------------------------------------------------
628 # Check for readline support/directory (default off)
629 # ---------------------------------------------------
630 # this allows you to turn it completely off
631 AC_ARG_ENABLE(readline,
632   [  --disable-readline      disable readline support [disable]
633                                                       ],
634   [if test x$enableval = xno; then
635     support_readline=no
636   fi])
637
638 got_readline="no"
639 READLINE_SRC=
640 if test x$support_readline = xyes; then
641    AC_ARG_WITH(readline,
642      [ --with-readline@<:@=DIR@:>@             specify readline library directory],
643      [
644         case "$with_readline" in
645         no) : ;;
646         yes|*)
647           if test -f ${with_readline}/readline.h; then
648              CONS_INC="-I${with_readline}"
649              CONS_LDFLAGS="-L$with_readline"
650           elif test -f ${with_readline}/include/readline/readline.h; then
651              CONS_INC="-I${with_readline}/include/readline"
652              CONS_LDFLAGS="-L${with_readline}/lib"
653              with_readline="${with_readline}/include/readline"
654           else
655              with_readline="/usr/include/readline" 
656           fi
657           AC_CHECK_HEADER(${with_readline}/readline.h, 
658              [ AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
659                CONS_LIBS="-lreadline -lhistory -ltermcap"
660                got_readline="yes"   
661              ],
662              [ echo " "
663                echo "readline.h not found. readline turned off ..."
664                echo " "
665              ]
666           )
667           ;;
668         esac
669      ],[
670        # check for standard readline library
671        AC_CHECK_HEADER(/usr/include/readline/readline.h, 
672          [ AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
673            got_readline="yes"
674            CONS_INC="-I/usr/include/readline"
675            CONS_LIBS="-lreadline -ltermcap"
676          ], [
677            # Did not find standard library, so try Bacula's default
678             AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h, 
679               [ AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
680                  got_readline="yes"   
681                  CONS_INC="-I${TOP_DIR}/depkgs/readline"
682                  CONS_LIBS="-lreadline -lhistory -ltermcap"
683                  CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
684                  PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
685               ],
686               [ echo " "
687                 echo "readline.h not found. readline turned off ..."
688                 echo " "
689               ]
690             )
691          ]
692        )
693      ]   
694    )
695 fi
696
697
698
699 AC_SUBST(CONS_INC)
700 AC_SUBST(CONS_OBJ)
701 AC_SUBST(CONS_SRC)
702 AC_SUBST(CONS_LIBS)
703 AC_SUBST(CONS_LDFLAGS)
704 AC_SUBST(READLINE_SRC)
705
706 # Minimal stuff for readline Makefile configuration
707 MAKE_SHELL=/bin/sh
708 AC_SUBST(MAKE_SHELL)
709 AC_HEADER_STAT
710 AC_HEADER_DIRENT
711 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr lstat lchown)
712 AC_CHECK_FUNCS(nanosleep nl_langinfo)
713 AC_CHECK_HEADERS(varargs.h)
714
715 # End of readline/conio stuff
716 # -----------------------------------------------------------------------
717
718 # -----------------------------------------------------------------------
719 #  Check for Python support
720 #
721 AC_MSG_CHECKING(for Python support)
722 AC_ARG_WITH(python,
723 [
724   --with-python@<:@=DIR@:>@     Include Python support.  DIR is the Python base
725                           install directory, default is to search through
726                           a number of common places for the Python files.],
727 [
728   PYTHON_INCDIR= 
729   PYTHON_LIBS=
730   if test "$withval" != "no"; then
731      if test "$withval" = "yes"; then
732         for python_root in /usr /usr/local /usr/sfw; do
733           for ver in python2.2 python2.3 python2.4 python2.5; do
734              if test -f $python_root/include/${ver}/Python.h; then
735                 PYTHON_INCDIR=-I$python_root/include/${ver}
736                 if test -d $python_root/lib64/${ver}/config; then
737                    PYTHON_LIBS="-L$python_root/lib64/${ver}/config -l${ver}"
738                 else
739                    PYTHON_LIBS="-L$python_root/lib/${ver}/config -l${ver}"
740                 fi
741                 break 
742              fi
743           done
744         done
745         if test x$PYTHON_INCDIR = x; then
746           if test -f $prefix/include/Python.h; then
747              PYTHON_INCDIR=-I$prefix/include
748              if test -d $prefix/lib64/config; then
749                 PYTHON_LIBS="-L$prefix/lib64/config -lpython"
750              else
751                 PYTHON_LIBS="-L$prefix/lib/config -lpython"
752              fi
753           else
754            AC_MSG_RESULT(no)
755            AC_MSG_ERROR(Unable to find Python.h in standard locations)
756           fi
757         fi
758      else
759         if test -f $withval/Python.h; then
760            PYTHON_INCDIR=-I$withval
761            PYTHON_LIBS="-L$withval/config -lpython"
762         elif test -f $withval/include/Python.h; then
763            PYTHON_INCDIR=-I$withval/include
764            if test -d $withval/lib64/config; then
765               PYTHON_LIBS="-L$withval/lib64/config -lpython"
766            else
767               PYTHON_LIBS="-L$withval/lib/config -lpython"
768            fi
769         elif test -f $withval/include/python/Python.h; then
770            PYTHON_INCDIR=-I$withval/include/python
771            if test -d $withval/lib64/python/config; then
772               PYTHON_LIBS="-L$withval/lib64/python/config -lpython"
773            else
774               PYTHON_LIBS="-L$withval/lib/python/config -lpython"
775            fi
776         else
777            AC_MSG_RESULT(no)
778            AC_MSG_ERROR(Invalid Python directory $withval - unable to find Python.h under $withval)
779         fi
780      fi
781      AC_DEFINE([HAVE_PYTHON], 1)
782      AC_MSG_RESULT(yes)
783      support_python=yes
784      AC_MSG_NOTICE(checking for more Python libs)
785      saved_LIBS="$LIBS"; LIBS=
786      AC_SEARCH_LIBS(shm_open, [rt])
787      AC_CHECK_LIB(util, openpty)
788      PYTHON_LIBS="$PYTHON_LIBS $LIBS"
789      LIBS="$saved_LIBS"
790   else
791      AC_MSG_RESULT(no)
792   fi
793 ],[
794   AC_MSG_RESULT(no)
795 ])
796 AC_SUBST(PYTHON_LIBS)
797 AC_SUBST(PYTHON_INCDIR)
798
799 #
800 # Find where sockets are (especially for Solaris)
801 # Do this before the TCP Wrappers test since tcp wrappers
802 # uses the socket library and some linkers are stupid.
803 #
804 AC_CHECK_FUNC(socket,
805     AC_MSG_RESULT(using libc's socket),
806     AC_CHECK_LIB(xnet,socket)
807     AC_CHECK_LIB(socket,socket)
808     AC_CHECK_LIB(inet,socket))
809
810
811 # -----------------------------------------------------------
812 # Check whether user wants TCP wrappers support (default off)
813 # -----------------------------------------------------------
814 TCPW_MSG="no" 
815 WRAPLIBS=""
816 AC_ARG_WITH(tcp-wrappers,
817   [  --with-tcp-wrappers@<:@=DIR@:>@   enable tcpwrappers support],
818   [
819     if test "x$withval" != "xno" ; then
820        saved_LIBS="$LIBS"
821        LIBS="$saved_LIBS -lwrap"
822        AC_MSG_CHECKING(for libwrap)
823        AC_SEARCH_LIBS(nanosleep, [rt])
824        AC_TRY_LINK(
825           [ #include <sys/types.h>
826             #include <tcpd.h>
827              int deny_severity = 0;
828              int allow_severity = 0;
829              struct request_info *req; ],
830           [ hosts_access(req); ],
831           [
832             AC_MSG_RESULT(yes)
833             AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
834             TCPW_MSG="yes" 
835             LIBS="$saved_LIBS"
836             WRAPLIBS="-lwrap"
837           ], [
838             LIBS="$saved_LIBS -lwrap -lnsl"
839             WRAPLIBS="$saved_LIBS -lwrap -lnsl"
840             AC_TRY_LINK(
841               [ #include <sys/types.h>
842                  #include <tcpd.h>
843                  int deny_severity = 0;
844                  int allow_severity = 0;
845                  struct request_info *req; ],
846               [ hosts_access(req); ],
847               [
848                  AC_MSG_RESULT(yes)
849                  AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
850                  TCPW_MSG="yes" 
851                  LIBS="$saved_LIBS"
852                  WRAPLIBS="-lwrap"
853               ],
854               [AC_MSG_ERROR([*** libwrap missing]) ] ]
855             )
856        )
857     fi
858   ]
859 )
860
861 # -----------------------------------------------------------
862 # Check whether OpenSSL is available
863 # -----------------------------------------------------------
864 AC_MSG_CHECKING([for OpenSSL])
865 dnl The following uses quadrigraphs:
866 dnl '@<:@' = '['
867 dnl '@:>@' = ']'
868 AC_ARG_WITH(openssl,
869         AC_HELP_STRING([--with-openssl@<:@=DIR@:>@], [Include OpenSSL support. DIR is the OpenSSL base]),
870         [with_openssl_directory=${withval}])
871
872 if test "x$with_openssl_directory" != "x"; then
873         OPENSSL_LIBS="-lssl -lcrypto"
874         OPENSSL_INC=""
875
876         if test "x$with_openssl_directory" != "xyes" && test x"${with_openssl_directory}" != "x"; then
877                 OPENSSL_LIBS="-L$with_openssl_directory/lib $OPENSSL_LIBS"
878                 OPENSSL_INC="-I$with_openssl_directory/include $OPENSSL_INC"
879         fi
880
881         saved_LIBS="${LIBS}"
882         saved_CFLAGS="${CFLAGS}"
883         LIBS="${saved_LIBS} ${OPENSSL_LIBS}"
884         CFLAGS="${saved_CFLAGS} ${OPENSSL_INC}"
885
886         AC_TRY_LINK([ #include <openssl/ssl.h> ],
887                 [ CRYPTO_set_id_callback(NULL); ],
888                 [
889                         support_tls="yes"
890                         support_crypto="yes"
891                 ],
892                 [ support_tls="no" ]
893         )
894
895         AC_TRY_LINK([ #include <openssl/evp.h> ],
896                 [ EVP_sha512(); ],
897                 [ ac_cv_openssl_sha2="yes" ],
898                 [ ac_cv_openssl_sha2="no" ]
899         )
900
901         # Solaris disables greater than 128+ bit encryption in their OpenSSL
902         # implementation, presumably for export reasons. If 192bit AES
903         # is available, we assume that we're running with a 'non-export'
904         # openssl library.
905         AC_TRY_LINK([ #include <openssl/evp.h> ],
906                 [ EVP_aes_192_cbc(); ],
907                 [ ac_cv_openssl_export="no" ],
908                 [ ac_cv_openssl_export="yes" ]
909         )
910
911         LIBS="${saved_LIBS}"
912         CFLAGS="${saved_CFLAGS}"
913
914         if test "$support_tls" = "yes"; then
915                 AC_DEFINE(HAVE_OPENSSL, 1, [Define if OpenSSL library is available])
916                 AC_DEFINE(HAVE_TLS, 1, [Define if TLS support should be enabled])
917                 AC_DEFINE(HAVE_CRYPTO, 1, [Define if encryption support should be enabled])
918         fi
919
920         if test "$ac_cv_openssl_sha2" = "yes"; then
921                 AC_DEFINE(HAVE_SHA2, 1, [Define if the SHA-2 family of digest algorithms is available])
922         fi
923
924         if test "$ac_cv_openssl_export" = "yes"; then
925                 AC_DEFINE(HAVE_OPENSSL_EXPORT_LIBRARY, 1, [Define if the OpenSSL library is export-contrained to 128bit ciphers])
926         fi
927 else
928         support_tls="no"
929         support_crypto="no"
930         OPENSSL_LIBS=""
931         OPENSSL_INC=""
932 fi
933
934 AC_MSG_RESULT([$support_tls])
935 AC_SUBST(OPENSSL_LIBS)
936 AC_SUBST(OPENSSL_INC)
937
938
939 # -----------------------------------------------------------
940 # dlopen is needed for plugins
941 # -----------------------------------------------------------
942 AC_SEARCH_LIBS(dlopen, [dl])
943
944 # ------------------------------------------
945 # Where to place working dir
946 # ------------------------------------------
947 working_dir=`eval echo ${prefix}/var/bacula/working`
948 AC_ARG_WITH(working-dir,
949    [  --with-working-dir=PATH    specify path of Bacula working directory],
950    [
951        if test "x$withval" != "xno" ; then     
952               working_dir=$withval
953        fi
954    ]
955 )
956
957 AC_SUBST(working_dir)
958
959 # ------------------------------------------------------------------
960 # If the user has not set archivedir, we set our default as /tmp
961 # ------------------------------------------------------------------
962 archive_dir=/tmp
963 AC_ARG_WITH(archivedir,
964    [  --with-archivedir=PATH    specify path of SD archive directory],
965    [
966        if test "x$withval" != "xno" ; then     
967               archivedir=$withval
968        fi
969    ]
970 )
971
972 AC_SUBST(archivedir)
973
974
975
976 # ------------------------------------------
977 # Where to place scriptdir (script files)
978 # ------------------------------------------
979 scriptdir=`eval echo ${sysconfdir}`
980 AC_ARG_WITH(scriptdir,
981    [  --with-scriptdir=PATH    specify path of Bacula scripts directory],
982    [
983        if test "x$withval" != "xno" ; then     
984               scriptdir=$withval
985        fi
986    ]
987 )
988
989 AC_SUBST(scriptdir)
990
991
992 # ------------------------------------------
993 # Where to place plugindir (script files)
994 # ------------------------------------------
995 plugindir=`eval echo ${sysconfdir}`
996 AC_ARG_WITH(plugindir,
997    [  --with-plugindir=PATH    specify path of Bacula plugins directory],
998    [
999        if test "x$withval" != "xno" ; then     
1000               plugindir=$withval
1001        fi
1002    ]
1003 )
1004
1005 AC_SUBST(plugindir)
1006
1007
1008 # ------------------------------------------
1009 # Where to send dump email
1010 # ------------------------------------------
1011 dump_email=root@localhost
1012 AC_ARG_WITH(dump-email,
1013    [  --with-dump-email=EMAIL    dump email address],
1014    [
1015        if test "x$withval" != "xno" ; then     
1016               dump_email=$withval
1017        fi
1018    ]
1019 )
1020
1021 AC_SUBST(dump_email)
1022
1023 # ------------------------------------------
1024 # Where to send job email
1025 # ------------------------------------------
1026 job_email=root@localhost
1027 AC_ARG_WITH(job-email,
1028    [  --with-job-email=EMAIL     job output email address],
1029    [
1030        if test "x$withval" != "xno" ; then     
1031               job_email=$withval
1032        fi
1033    ]
1034 )
1035
1036 AC_SUBST(job_email)
1037
1038 # ------------------------------------------
1039 # Where to find smtp host
1040 # ------------------------------------------
1041 smtp_host=localhost
1042 AC_ARG_WITH(smtp_host,
1043    [  --with-smtp-host=HOST              SMTP mail host address],
1044    [
1045        if test "x$withval" != "xno" ; then     
1046               smtp_host=$withval
1047        fi
1048    ]
1049 )
1050
1051 AC_SUBST(smtp_host)
1052
1053
1054 # ------------------------------------
1055 # Where to place pid files
1056 # ------------------------------------
1057 piddir=/var/run
1058 AC_ARG_WITH(pid-dir,
1059     [  --with-pid-dir=PATH               specify location of Bacula pid files],
1060     [
1061         if test "x$withval" != "xno" ; then     
1062             piddir=$withval
1063         fi
1064     ]
1065 )
1066
1067 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
1068 AC_SUBST(piddir)
1069
1070
1071 # ------------------------------------
1072 # Where to place subsys "lock file"
1073 # ------------------------------------
1074 subsysdir=/var/run/subsys
1075 if test -d /var/run/subsys; then
1076    subsysdir=/var/run/subsys
1077 elif test -d /var/lock/subsys; then
1078    subsysdir=/var/lock/subsys
1079 else
1080    subsysdir=/var/run/subsys
1081 fi
1082 AC_ARG_WITH(subsys-dir,
1083     [  --with-subsys-dir=PATH    specify location of Bacula subsys file],
1084     [
1085         if test "x$withval" != "xno" ; then     
1086             subsysdir=$withval
1087         fi
1088     ]
1089 )
1090
1091 AC_SUBST(subsysdir)
1092
1093
1094
1095 # ------------------------------------
1096 # Where to start assigning ports
1097 # ------------------------------------
1098 baseport=9101
1099 AC_ARG_WITH(baseport,
1100     [  --with-baseport=PORT              specify base port address for daemons],
1101     [
1102         if test "x$withval" != "xno" ; then     
1103              baseport=$withval
1104         fi
1105     ]
1106 )
1107
1108 AC_SUBST(baseport)
1109 dir_port=`expr $baseport`
1110 fd_port=`expr $baseport + 1`
1111 sd_port=`expr $fd_port + 1`
1112
1113 AC_SUBST(dir_port)
1114 AC_SUBST(fd_port)
1115 AC_SUBST(sd_port)
1116
1117
1118 # ------------------------------------------
1119 # Generate passwords
1120 # ------------------------------------------
1121 dir_password=
1122 AC_ARG_WITH(dir-password,
1123    [  --with-dir-password=PASSWORD   specify Director's password],
1124    [
1125        if test "x$withval" != "xno" ; then     
1126            dir_password=$withval
1127        fi
1128    ]
1129 )
1130
1131 if test "x$dir_password" = "x" ; then
1132    if test "x$OPENSSL" = "xnone" ; then
1133       key=`autoconf/randpass 33`
1134    else
1135       key=`openssl rand -base64 33`
1136    fi
1137    dir_password=$key
1138 fi
1139
1140 fd_password=
1141 AC_ARG_WITH(fd-password,
1142    [  --with-fd-password=PASSWORD    specify Client's password],
1143    [
1144        if test "x$withval" != "xno" ; then     
1145            fd_password=$withval
1146        fi
1147    ]
1148 )
1149
1150 if test "x$fd_password" = "x" ; then
1151    if test "x$OPENSSL" = "xnone" ; then
1152       key=`autoconf/randpass 37`
1153    else
1154       key=`openssl rand -base64 33`
1155    fi
1156    fd_password=$key
1157 fi
1158
1159 sd_password=
1160 AC_ARG_WITH(sd-password,
1161    [  --with-sd-password=PASSWORD    specify Storage daemon's password],
1162    [
1163        if test "x$withval" != "xno" ; then     
1164            sd_password=$withval
1165        fi
1166    ]
1167 )
1168
1169 if test "x$sd_password" = "x" ; then
1170    if test "x$OPENSSL" = "xnone" ; then
1171       key=`autoconf/randpass 41`
1172    else
1173       key=`openssl rand -base64 33`
1174    fi
1175    sd_password=$key
1176 fi
1177
1178 mon_dir_password=
1179 AC_ARG_WITH(mon-dir-password,
1180    [  --with-mon-dir-password=PASSWORD   specify Director's password used by the monitor],
1181    [
1182        if test "x$withval" != "xno" ; then     
1183            mon_dir_password=$withval
1184        fi
1185    ]
1186 )
1187
1188 if test "x$mon_dir_password" = "x" ; then
1189    if test "x$OPENSSL" = "xnone" ; then
1190       key=`autoconf/randpass 33`
1191    else
1192       key=`openssl rand -base64 33`
1193    fi
1194    mon_dir_password=$key
1195 fi
1196
1197 mon_fd_password=
1198 AC_ARG_WITH(mon-fd-password,
1199    [  --with-mon-fd-password=PASSWORD    specify Client's password used by the monitor],
1200    [
1201        if test "x$withval" != "xno" ; then     
1202            mon_fd_password=$withval
1203        fi
1204    ]
1205 )
1206
1207 if test "x$mon_fd_password" = "x" ; then
1208    if test "x$OPENSSL" = "xnone" ; then
1209       key=`autoconf/randpass 37`
1210    else
1211       key=`openssl rand -base64 33`
1212    fi
1213    mon_fd_password=$key
1214 fi
1215
1216 mon_sd_password=
1217 AC_ARG_WITH(mon-sd-password,
1218    [  --with-mon-sd-password=PASSWORD    specify Storage daemon's password used by the monitor],
1219    [
1220        if test "x$withval" != "xno" ; then     
1221            mon_sd_password=$withval
1222        fi
1223    ]
1224 )
1225
1226 if test "x$mon_sd_password" = "x" ; then
1227    if test "x$OPENSSL" = "xnone" ; then
1228       key=`autoconf/randpass 41`
1229    else
1230       key=`openssl rand -base64 33`
1231    fi
1232    mon_sd_password=$key
1233 fi
1234
1235 AC_SUBST(dir_password)
1236 AC_SUBST(fd_password)
1237 AC_SUBST(sd_password)
1238 AC_SUBST(mon_dir_password)
1239 AC_SUBST(mon_fd_password)
1240 AC_SUBST(mon_sd_password)
1241
1242 #
1243 # Pickup any database name
1244 #
1245 db_name=bacula
1246 AC_ARG_WITH(db_name,
1247     [  --with-db-name=DBNAME           specify database name (default bacula)],
1248     [
1249         if test "x$withval" != "x" ; then       
1250              db_name=$withval
1251         fi
1252     ]
1253 )
1254 AC_SUBST(db_name)
1255
1256 db_user=bacula
1257 AC_ARG_WITH(db_user,
1258     [  --with-db-user=UNAME            specify database user (default bacula)],
1259     [
1260         if test "x$withval" != "x" ; then       
1261              db_user=$withval
1262         fi
1263     ]
1264 )
1265 AC_SUBST(db_user)
1266
1267 db_password=
1268 AC_ARG_WITH(db_password,
1269     [  --with-db-password=UNAME            specify database password (default *none*)],
1270     [
1271         if test "x$withval" != "x" ; then       
1272              db_password=$withval
1273         fi
1274     ]
1275 )
1276 AC_SUBST(db_password)
1277
1278 #
1279 # Pickup a database port
1280 #
1281 db_port=" "
1282 AC_ARG_WITH(db_port,
1283     [  --with-db-port=DBPORT            specify a database port (default null)],
1284     [
1285         if test "x$withval" != "x" ; then
1286              db_port=$withval
1287         fi
1288     ]
1289 )
1290 AC_SUBST(db_port)
1291
1292 #
1293 # Handle users and groups for each daemon
1294 #
1295 dir_user=
1296 AC_ARG_WITH(dir_user,
1297     [  --with-dir-user=USER              specify user for Director daemon],
1298     [
1299         if test "x$withval" != "x" ; then       
1300              dir_user=$withval
1301         fi
1302     ]
1303 )
1304
1305 dir_group=
1306 AC_ARG_WITH(dir_group,
1307     [  --with-dir-group=GROUP            specify group for Director daemon],
1308     [
1309         if test "x$withval" != "x" ; then       
1310              dir_group=$withval
1311         fi
1312     ]
1313 )
1314
1315 sd_user=
1316 AC_ARG_WITH(sd_user,
1317     [  --with-sd-user=USER               specify user for Storage daemon],
1318     [
1319         if test "x$withval" != "x" ; then       
1320              sd_user=$withval
1321         fi
1322     ]
1323 )
1324
1325 sd_group=
1326 AC_ARG_WITH(sd_group,
1327     [  --with-sd-group=GROUP             specify group for Storage daemon],
1328     [
1329         if test "x$withval" != "x" ; then       
1330              sd_group=$withval
1331         fi
1332     ]
1333 )
1334
1335 fd_user=
1336 AC_ARG_WITH(fd_user,
1337     [  --with-fd-user=USER               specify user for File daemon],
1338     [
1339         if test "x$withval" != "x" ; then       
1340              fd_user=$withval
1341         fi
1342     ]
1343 )
1344
1345 fd_group=
1346 AC_ARG_WITH(fd_group,
1347     [  --with-fd-group=GROUP             specify group for File daemon],
1348     [
1349         if test "x$withval" != "x" ; then       
1350              fd_group=$withval
1351         fi
1352     ]
1353 )
1354
1355 AC_SUBST(dir_user)
1356 AC_SUBST(dir_group)
1357 AC_SUBST(sd_user)
1358 AC_SUBST(sd_group)
1359 AC_SUBST(fd_user)
1360 AC_SUBST(fd_group)
1361
1362 #
1363 # allow setting default executable permissions
1364 #
1365 SBINPERM=0754
1366 AC_ARG_WITH(sbin-perm,
1367     [  --with-sbin-perm=MODE             specify permissions for sbin binaries (0754)],
1368     [
1369         if test "x$withval" != "x" ; then       
1370             SBINPERM=$withval
1371         fi
1372     ]
1373 )
1374
1375 AC_SUBST(SBINPERM)
1376
1377 # ------------------------------------------------
1378 # Bacula check for various SQL database engines
1379 # ------------------------------------------------
1380 SQL_LIB=
1381 BA_CHECK_POSTGRESQL_DB
1382
1383 BA_CHECK_MYSQL_DB
1384
1385 BA_CHECK_SQLITE3_DB
1386
1387 BA_CHECK_SQLITE_DB
1388
1389 BA_CHECK_DBI_DB
1390
1391 BA_CHECK_DBI_DRIVER
1392
1393 AC_SUBST(cats)
1394 AC_SUBST(DB_TYPE)
1395
1396 # -------------------------------------------
1397 # enable batch attribute DB insert (default on)
1398 # -------------------------------------------
1399 support_batch_insert=no
1400 A=`nm $SQL_LIB | grep pthread_mutex_lock`
1401 pkg=$?
1402 if test $pkg = 0; then
1403    support_batch_insert=yes
1404    AC_ARG_ENABLE(batch-insert,
1405      [  --enable-batch-insert       enable the DB batch insert code [disabled]],
1406      [if test x$enableval = xno; then
1407        support_batch_insert=no
1408       else
1409        support_batch_insert=yes
1410      fi])
1411 fi
1412         
1413 # Check if postgresql support batch mode        
1414 if test x$DB_TYPE = xpostgresql; then
1415    A=`nm $SQL_LIB | grep PQputCopyData`
1416    pkg=$?
1417    if test $pkg != 0; then
1418       support_batch_insert=no
1419    fi
1420 fi
1421
1422 if test x$DB_TYPE = xdbi; then
1423    DB_TYPE=$DB_PROG
1424    db_type=$DB_PROG
1425    pkg=1
1426    # Check for batch insert
1427    if test $DB_PROG = postgresql; then
1428       A=`nm $DB_PROG_LIB | grep PQputCopyData`
1429       pkg=$?
1430    fi
1431
1432    if test $DB_PROG = mysql; then
1433       A=`nm $DB_PROG_LIB | grep pthread_mutex_lock`
1434       pkg=$?     
1435    fi
1436
1437    if test $DB_PROG = sqlite3; then
1438       A=`nm $DB_PROG_LIB | grep pthread_mutex_lock`
1439       pkg=$?
1440    fi
1441
1442    if test $pkg = 0; then
1443       AC_ARG_ENABLE(batch-insert,
1444       [ --enable-batch-insert       enable the DB batch insert code [disabled]],
1445       [if test x$enableval = xno; then
1446          support_batch_insert=no
1447        else
1448          support_batch_insert=yes
1449       fi])
1450    fi
1451 else 
1452 # If dbi was not chosen, let the comment in file
1453 uncomment_dbi="#"  
1454 fi
1455
1456 AC_SUBST(uncomment_dbi)
1457
1458 if test $support_batch_insert = yes ; then
1459    AC_DEFINE(HAVE_BATCH_FILE_INSERT, 1, [Set if DB batch insert code enabled])
1460 fi
1461
1462
1463 AC_DEFINE(PROTOTYPES)
1464
1465 dnl# --------------------------------------------------------------------------
1466 dnl# Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
1467 dnl#
1468 if test -z "$CFLAGS" -o "$CFLAGS" = "-g -O2"; then
1469     if test -z "$CCOPTS"; then
1470         CCOPTS='-g -O2 -Wall'
1471     fi
1472     CFLAGS="$CCOPTS"
1473 fi
1474
1475
1476 dnl A few others 
1477 AC_EXEEXT
1478
1479 dnl See if we can use 64 bit file addresses
1480 largefile_support="no"
1481 AC_BAC_LARGEFILE
1482
1483
1484 AC_PATH_XTRA
1485
1486 dnl# --------------------------------------------------------------------------
1487 dnl# CHECKING FOR HEADER FILES
1488 dnl# --------------------------------------------------------------------------
1489 AC_CHECK_HEADERS( \
1490         assert.h \
1491         fcntl.h \
1492         grp.h \
1493         pwd.h \
1494         libc.h \
1495         limits.h \
1496         stdarg.h \
1497         stdlib.h \
1498         stdint.h \
1499         string.h \
1500         strings.h \
1501         termios.h \
1502         termcap.h \
1503         term.h \
1504         unistd.h \
1505         sys/bitypes.h \
1506         sys/byteorder.h \
1507         sys/ioctl.h \
1508         sys/select.h \
1509         sys/socket.h \
1510         sys/sockio.h \
1511         sys/stat.h \
1512         sys/time.h \
1513         sys/types.h \
1514         arpa/nameser.h \
1515         resolv.h \
1516         mtio.h \
1517         sys/mtio.h \
1518         sys/tape.h \
1519         regex.h \
1520 )
1521 AC_HEADER_STDC
1522 AC_HEADER_MAJOR
1523 AC_HEADER_DIRENT
1524 AC_HEADER_STAT
1525 AC_HEADER_SYS_WAIT
1526 AC_HEADER_TIME
1527 AC_STRUCT_ST_BLKSIZE
1528 AC_STRUCT_ST_BLOCKS
1529 AC_STRUCT_TIMEZONE
1530
1531 dnl# --------------------------------------------------------------------------
1532 dnl# Check for utime.h structure 
1533 dnl# --------------------------------------------------------------------------
1534 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
1535   [AC_TRY_COMPILE([
1536 #include <sys/types.h>
1537 #include <utime.h>], [struct utimbuf foo],
1538   ba_cv_header_utime_h=yes, ba_cv_header_utime_h=no)])
1539 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H, 1, [Set if utime.h exists])
1540
1541 dnl# --------------------------------------------------------------------------
1542 dnl# Check for socklen_t
1543 dnl# --------------------------------------------------------------------------
1544 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
1545   [AC_TRY_COMPILE([
1546 #include <sys/types.h>
1547 #include <sys/socket.h>],
1548   [socklen_t x],
1549   ba_cv_header_socklen_t=yes, ba_cv_header_socklen_t=no)])
1550 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T)
1551
1552 dnl# --------------------------------------------------------------------------
1553 dnl# Check for bigendian
1554 dnl# --------------------------------------------------------------------------
1555 AC_CACHE_CHECK([for bigendian], ba_cv_bigendian,
1556   [AC_TRY_RUN(
1557     [main(){long a=1L; char *p=(char *)&a; exit(*p);}],
1558     [ba_cv_bigendian=yes], 
1559     [ba_cv_bigendian=no], 
1560     [ba_cv_bigendian=no])])
1561 test $ba_cv_bigendian = yes && AC_DEFINE(HAVE_BIGENDIAN)
1562
1563 dnl# --------------------------------------------------------------------------
1564 dnl# Check for typeof()
1565 dnl# --------------------------------------------------------------------------
1566 AC_LANG_PUSH(C++)
1567 AC_CACHE_CHECK(for typeof, ba_cv_have_typeof,
1568   [AC_TRY_RUN(
1569     [main(){char *a = 0; a = (typeof a)a;}],
1570     [ba_cv_have_typeof=yes],
1571     [ba_cv_have_typeof=no],
1572     [ba_cv_have_typeof=no])])
1573 test $ba_cv_have_typeof = yes && AC_DEFINE([HAVE_TYPEOF], 1, [Defind to 1 if compiler has typeof])
1574 AC_LANG_POP(C++)
1575
1576 AC_C_CONST
1577
1578
1579 dnl# --------------------------------------------------------------------------
1580 dnl# CHECKING FOR FILESYSTEM TYPE
1581 dnl# --------------------------------------------------------------------------
1582 AC_MSG_CHECKING(how to get filesystem type)
1583 fstype=no
1584 # The order of these tests is important.
1585 AC_TRY_CPP([#include <sys/statvfs.h>
1586 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4)
1587 if test $fstype = no; then
1588 AC_TRY_CPP([#include <sys/statfs.h>
1589 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3)
1590 fi
1591 if test $fstype = no; then
1592 AC_TRY_CPP([#include <sys/statfs.h>
1593 #include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX)
1594 fi
1595 if test $fstype = no; then  
1596 AC_TRY_CPP([#include <mntent.h>], AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD)
1597 fi
1598 if test $fstype = no; then  
1599 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
1600 fi
1601 if test $fstype = no; then  
1602 AC_TRY_CPP([#include <sys/mount.h>
1603 #include <sys/fs_types.h>], AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix)
1604 fi
1605 AC_MSG_RESULT($fstype)
1606
1607 AC_CHECK_HEADER(sys/statvfs.h, [ AC_DEFINE(HAVE_SYS_STATVFS_H,1,[Defines if your system have the sys/statvfs.h header file])] , )
1608
1609 dnl# --------------------------------------------------------------------------
1610 dnl# CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
1611 dnl# --------------------------------------------------------------------------
1612 AC_TYPE_SIGNAL
1613 SIGNAL_CHECK
1614 AC_TYPE_MODE_T
1615 AC_TYPE_UID_T
1616 AC_TYPE_SIZE_T
1617 AC_TYPE_PID_T
1618 AC_TYPE_OFF_T
1619 AC_CHECK_TYPE(ino_t, unsigned long)
1620 AC_CHECK_TYPE(dev_t, unsigned long)
1621 AC_CHECK_TYPE(daddr_t, long)
1622 AC_CHECK_TYPE(major_t, int)
1623 AC_CHECK_TYPE(minor_t, int)
1624 AC_CHECK_TYPE(ssize_t, int)
1625 AC_STRUCT_ST_BLOCKS
1626 AC_STRUCT_ST_RDEV
1627 AC_STRUCT_TM
1628 AC_C_CONST
1629
1630
1631 AC_CHECK_SIZEOF(char, 1)
1632 AC_CHECK_SIZEOF(short int, 2)
1633 AC_CHECK_SIZEOF(int, 4)
1634 AC_CHECK_SIZEOF(long int, 4)
1635 AC_CHECK_SIZEOF(long long int, 8)
1636 AC_CHECK_SIZEOF(int *, 4)
1637
1638 # Check for sys/types.h types
1639 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1640     AC_TRY_COMPILE(
1641         [ #include <sys/types.h> ], 
1642         [ u_int a; a = 1;], 
1643         [ ac_cv_have_u_int="yes" ],
1644         [ ac_cv_have_u_int="no" ]
1645     )
1646 ])
1647 if test "x$ac_cv_have_u_int" = "xyes" ; then
1648    AC_DEFINE(HAVE_U_INT)
1649    have_u_int=1
1650 fi
1651
1652 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t, [
1653    AC_TRY_COMPILE(
1654       [ #include <sys/types.h> ], 
1655       [ intmax_t a; a = 1;], 
1656       [ ac_cv_have_intmax_t="yes" ],
1657       [ 
1658          AC_TRY_COMPILE(
1659             [ #include <stdint.h> ], 
1660             [ intmax_t a; a = 1;], 
1661             [ ac_cv_have_intmax_t="yes" ],
1662             [ ac_cv_have_intmax_t="no" ]
1663          )
1664       ]
1665    )        
1666
1667 ])
1668 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
1669    AC_DEFINE(HAVE_INTMAX_T)
1670    have_intmax_t=1
1671 fi
1672
1673
1674 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t, [
1675    AC_TRY_COMPILE(
1676       [ #include <sys/types.h> ], 
1677       [ u_intmax_t a; a = 1;], 
1678       [ ac_cv_have_u_intmax_t="yes" ],
1679       [ 
1680          AC_TRY_COMPILE(
1681             [ #include <stdint.h> ], 
1682             [ u_intmax_t a; a = 1;], 
1683             [ ac_cv_have_u_intmax_t="yes" ],
1684             [ ac_cv_have_u_intmax_t="no" ]
1685          )
1686       ]
1687    )
1688 ])
1689 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
1690    AC_DEFINE(HAVE_U_INTMAX_T)
1691    have_u_intmax_t=1
1692 fi
1693
1694
1695 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1696    AC_TRY_COMPILE(
1697       [ #include <sys/types.h> ], 
1698       [ int8_t a; int16_t b; int32_t c; a = b = c = 1;], 
1699       [ ac_cv_have_intxx_t="yes" ],
1700       [ ac_cv_have_intxx_t="no" ]
1701    )
1702 ])
1703 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1704    AC_DEFINE(HAVE_INTXX_T)
1705    have_intxx_t=1
1706 fi
1707         
1708 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1709    AC_TRY_COMPILE(
1710       [ #include <sys/types.h> ], 
1711       [ int64_t a; a = 1;], 
1712       [ ac_cv_have_int64_t="yes" ],
1713       [ ac_cv_have_int64_t="no" ]
1714    )
1715 ])
1716 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1717    AC_DEFINE(HAVE_INT64_T)
1718    have_int64_t=1
1719 fi
1720         
1721 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1722    AC_TRY_COMPILE(
1723       [ #include <sys/types.h> ], 
1724       [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;], 
1725       [ ac_cv_have_u_intxx_t="yes" ],
1726       [ ac_cv_have_u_intxx_t="no" ]
1727    )
1728 ])
1729 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1730    AC_DEFINE(HAVE_U_INTXX_T)
1731    have_u_intxx_t=1
1732 fi
1733
1734 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1735    AC_TRY_COMPILE(
1736       [ #include <sys/types.h> ], 
1737       [ u_int64_t a; a = 1;], 
1738       [ ac_cv_have_u_int64_t="yes" ],
1739       [ ac_cv_have_u_int64_t="no" ]
1740    )
1741 ])
1742 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1743    AC_DEFINE(HAVE_U_INT64_T)
1744    have_u_int64_t=1
1745 fi
1746
1747 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1748            test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1749 then
1750    AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1751    AC_TRY_COMPILE(
1752       [ #include <sys/bitypes.h>  ], 
1753       [ int8_t a; int16_t b; int32_t c;
1754         u_int8_t e; u_int16_t f; u_int32_t g;
1755         a = b = c = e = f = g = 1;  ], 
1756       [ AC_DEFINE(HAVE_U_INTXX_T)
1757         AC_DEFINE(HAVE_INTXX_T)
1758         AC_DEFINE(HAVE_SYS_BITYPES_H)
1759         AC_MSG_RESULT(yes) ],
1760       [ AC_MSG_RESULT(no)]
1761    ) 
1762 fi
1763
1764 if test -z "$have_u_intxx_t" ; then
1765    AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1766       AC_TRY_COMPILE(
1767          [ #include <sys/types.h> ], 
1768          [ uint8_t a; uint16_t b; 
1769            uint32_t c; a = b = c = 1; ], 
1770          [ ac_cv_have_uintxx_t="yes" ],
1771          [ ac_cv_have_uintxx_t="no" ]
1772       )
1773    ])
1774    if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1775       AC_DEFINE(HAVE_UINTXX_T)
1776    fi
1777 fi
1778
1779 if (test -z "$have_u_int64_t" || test -z "$have_int64_t" && \
1780           test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1781 then
1782    AC_MSG_CHECKING([for int64_t and u_int64_t types in sys/bitypes.h])
1783    AC_TRY_COMPILE(
1784       [ #include <sys/bitypes.h>  ], 
1785       [ int64_t a; u_int64_t b; 
1786        a = b = 1;  ], 
1787       [ AC_DEFINE(HAVE_U_INT64_T)
1788        AC_DEFINE(HAVE_INT64_T)
1789        AC_MSG_RESULT(yes) ],
1790       [ AC_MSG_RESULT(no)]
1791    ) 
1792 fi
1793
1794 if (test -z "$have_uintxx_t" && \
1795           test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1796 then
1797    AC_MSG_CHECKING([for uintXX_t types in sys/bitypes.h])
1798    AC_TRY_COMPILE(
1799       [ #include <sys/bitypes.h>  ], 
1800         [ uint8_t a; uint16_t b; 
1801           uint32_t c; a = b = c = 1; ], 
1802       [ AC_DEFINE(HAVE_UINTXX_T)
1803        AC_MSG_RESULT(yes) ],
1804       [ AC_MSG_RESULT(no)]
1805    ) 
1806
1807 fi
1808
1809
1810
1811
1812 dnl# --------------------------------------------------------------------------
1813 dnl# CHECKING FOR REQUIRED LIBRARY FUNCTIONS
1814 dnl# --------------------------------------------------------------------------
1815 AC_CHECK_FUNCS( \
1816         fork \
1817         getcwd \
1818         gethostname \
1819         getpid \
1820         gettimeofday \
1821         setpgid \
1822         setpgrp \
1823         setsid \
1824         signal \
1825         strerror \
1826         strncmp \
1827         strncpy \
1828         vfprintf \
1829         ,,
1830         [echo 'configure: cannot find needed function.'; exit 1]
1831 )
1832
1833 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
1834 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
1835 AC_CHECK_FUNCS(posix_fadvise)
1836 AC_CHECK_FUNCS(fdatasync)
1837
1838 AC_CHECK_FUNCS(chflags) 
1839
1840 AC_CHECK_FUNCS(snprintf vsnprintf gethostid fseeko)
1841
1842 AC_CACHE_CHECK(for va_copy, ba_cv_va_copy,
1843   [AC_TRY_LINK([
1844 #include <stdarg.h>
1845 void use_va_copy(va_list args){va_list args2; va_copy(args2,args); va_end(args2);}
1846 void call_use_va_copy(int junk,...){va_list args; va_start(args,junk); use_va_copy(args); va_end(args);}
1847 ],
1848   [call_use_va_copy(1,2,3)],
1849   ba_cv_va_copy=yes, ba_cv_va_copy=no)])
1850 test $ba_cv_va_copy = yes && AC_DEFINE(HAVE_VA_COPY, 1, [Set if va_copy exists])
1851
1852
1853 dnl# --------------------------------------------------------------------------
1854 dnl# CHECKING FOR THREAD SAFE FUNCTIONS
1855 dnl# --------------------------------------------------------------------------
1856 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
1857
1858 # If resolver functions are not in libc check for -lnsl or -lresolv.
1859 AC_CHECK_FUNC(gethostbyname_r,
1860     AC_MSG_RESULT(using libc's resolver),
1861     AC_CHECK_LIB(nsl,gethostbyname_r)
1862     AC_CHECK_LIB(resolv,gethostbyname_r))
1863
1864
1865
1866 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
1867 AC_CHECK_FUNCS(inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)])
1868 AC_CHECK_FUNCS(gethostbyname2, [AC_DEFINE(HAVE_GETHOSTBYNAME2)])
1869
1870 dnl ----------------------------
1871 dnl check sa_len of sockaddr
1872 dnl ----------------------------
1873 AC_CACHE_CHECK(for struct sockaddr has a sa_len field, ac_cv_struct_sockaddr_sa_len,
1874   [AC_TRY_COMPILE([#include <sys/socket.h>], [struct sockaddr s; s.sa_len;],
1875   ac_cv_struct_sockaddr_sa_len=yes, ac_cv_struct_sockaddr_sa_len=no)])
1876
1877  if test $ac_cv_struct_sockaddr_sa_len = yes; then
1878   AC_DEFINE(HAVE_SA_LEN, 1, [Define if sa_len field exists in struct sockaddr])
1879  fi
1880
1881
1882
1883
1884 AC_FUNC_STRFTIME
1885 AC_FUNC_VPRINTF
1886 AC_FUNC_ALLOCA
1887 AC_FUNC_GETMNTENT
1888 AC_FUNC_CLOSEDIR_VOID
1889 AC_FUNC_SETPGRP                       dnl check for BSD setpgrp.
1890 # AC_FUNC_FNMATCH    dnl use local version
1891
1892
1893 AC_CHECK_LIB(intl, gettext, [LIBS="$LIBS -lintl"])
1894
1895
1896 AC_CHECK_LIB(sun, getpwnam)
1897
1898 AC_CHECK_HEADERS(zlib.h)
1899 AC_CHECK_LIB(z, deflate, [FDLIBS="-lz"])
1900 have_zlib=no
1901 if test x$FDLIBS = x-lz; then
1902   AC_DEFINE(HAVE_LIBZ)
1903   have_zlib=yes
1904 fi
1905
1906 #
1907 # Check for ACL libraries
1908 #
1909 have_acl=no
1910 AC_CHECK_HEADER(sys/acl.h)
1911 AC_CHECK_FUNC(acl_get_file, [have_acl=yes],
1912    [AC_CHECK_LIB(acl, acl_get_file, [have_acl=yes; FDLIBS="-lacl $FDLIBS"], 
1913       [AC_CHECK_LIB(sec, acltotext, [have_acl=yes; FDLIBS="-lsec $FDLIBS"])]
1914     )]
1915 )
1916 if test $have_acl = yes; then
1917    AC_DEFINE(HAVE_ACL)
1918 fi
1919
1920 dnl Check for pthread libraries
1921 PTHREAD_LIB=""
1922 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
1923    [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
1924       [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
1925             [AC_CHECK_FUNC(pthread_create)]
1926        )]
1927     )]
1928 )
1929
1930 AC_SUBST(FDLIBS)
1931 AC_DEFINE(FDLIBS)
1932
1933
1934 CFLAGS=${CFLAGS--O}
1935
1936 if test x$have_gcc = xyes ; then
1937    CPPFLAGS="$CPPFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
1938    CFLAGS="$CFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
1939 fi
1940 LDFLAGS=${LDFLAGS--O}
1941 DB_LIBS="${SQL_LFLAGS}"
1942 CPPFLAGS="$CPPFLAGS"
1943 CFLAGS="$CFLAGS"
1944 AC_SUBST(DEBUG)
1945 AC_SUBST(DINCLUDE)
1946 AC_SUBST(CFLAGS)
1947 AC_SUBST(CPPFLAGS)
1948 AC_SUBST(LDFLAGS)
1949 AC_SUBST(X_CFLAGS)
1950 AC_SUBST(DEFS)
1951 AC_SUBST(LIBS)
1952 AC_SUBST(DLIB)
1953 AC_SUBST(DB_LIBS)
1954 AC_SUBST(X_LIBS)
1955 AC_SUBST(X_EXTRA_LIBS)
1956 AC_SUBST(WCFLAGS)
1957 AC_SUBST(WLDFLAGS)
1958 AC_SUBST(WRAPLIBS)
1959
1960 dnl# extra configurable objects
1961 OBJLIST=
1962 AC_SUBST(OBJLIST)
1963
1964 lld="lld"
1965 llu="llu"
1966
1967 WCFLAGS=
1968 WLDFLAGS=
1969
1970 #
1971 # Finally we set appropriate distribution specific
1972 #  variables and defaults
1973 #
1974 # PFILES are platform specific files
1975 PFILES="platforms/Makefile"
1976 PSCMD="ps -e"
1977 WIN32=
1978 MACOSX=
1979 hostname=`uname -n | cut -d '.' -f 1`
1980 if test x${hostname} = x ; then
1981   hostname="localhost"
1982 fi
1983 case "$DISTNAME" in
1984 aix)
1985         DISTVER=`uname -r`
1986         PSCMD="ps -e -o pid,comm"
1987         PFILES="${PFILES} \
1988            platforms/aix/Makefile"
1989         TAPEDRIVE="/dev/rmt0.1" 
1990   ;;      
1991 alpha)
1992         DISTVER=`uname -r`
1993         PTHREAD_LIB="-lpthread -lexc"
1994         if test "${CC}" = "gcc" ; then
1995            lld="lld"
1996            llu="llu"
1997         else
1998            lld="ld"
1999            llu="lu"
2000         fi
2001         TAPEDRIVE="/dev/nrmt0"
2002   ;;
2003 bsdi)
2004         DISTVER=`uname -a |awk '{print $3}'`
2005         TAPEDRIVE="/dev/nrmt0"
2006         PTHREAD_LIB="-pthread"
2007         CFLAGS="${CFLAGS} -pthread"
2008         PSCMD="ps -ax -o pid,command"
2009         lld="qd"
2010         llu="qu"
2011         PFILES="${PFILES} \
2012             platforms/bsdi/Makefile \
2013             platforms/bsdi/bacula-fd \
2014             platforms/bsdi/bacula-sd \
2015             platforms/bsdi/bacula-dir"
2016         largefile_support="yes"
2017   ;;
2018 cygwin)
2019         DISTVER=`uname -a |awk '{print $3}'`
2020         TAPEDRIVE="/dev/nrst0"
2021         WIN32=win32
2022         WCFLAGS="-mwindows"
2023         WLDFLAGS="-mwindows"
2024   ;;
2025 darwin)
2026         DISTVER=`uname -r`
2027         TAPEDRIVE="/dev/nst0"
2028         PSCMD="ps -e -o pid,command"
2029         MACOSX=macosx
2030         PFILES="${PFILES} \
2031            platforms/darwin/Makefile"
2032   ;;
2033 debian)
2034 #       Make sure hostname is resolved
2035         ping -c 1 $hostname 2>&1 1>/dev/null
2036         if test ! $? = 0; then
2037            hostname="localhost"
2038         fi
2039         if `grep -q ubuntu /etc/apt/sources.list`; then
2040            DISTNAME="ubuntu"
2041         fi
2042         DISTVER=`cat /etc/debian_version`
2043         if test -f /etc/lsb-release ; then
2044            . /etc/lsb-release
2045            if test "x$DISTRIB_ID" != "x" ; then
2046               DISTNAME=$DISTRIB_ID
2047            fi
2048            if test "x$DISTRIB_RELEASE" != "x" ; then
2049               DISTVER=$DISTRIB_RELEASE
2050            fi
2051         fi
2052         if test "$DISTNAME" = "Ubuntu" ; then
2053            DISTNAME="ubuntu"
2054         fi
2055         TAPEDRIVE="/dev/nst0"
2056         PSCMD="ps -e -o pid,command"
2057         if test "$DISTNAME" = "ubuntu" ; then
2058            PFILES="${PFILES} \
2059               platforms/ubuntu/Makefile \
2060               platforms/ubuntu/bacula-fd \
2061               platforms/ubuntu/bacula-sd \
2062               platforms/ubuntu/bacula-dir"
2063         else 
2064            PFILES="${PFILES} \
2065               platforms/debian/Makefile \
2066               platforms/debian/bacula-fd \
2067               platforms/debian/bacula-sd \
2068               platforms/debian/bacula-dir"
2069         fi
2070   ;;
2071 freebsd)
2072 #       Make sure hostname is resolved
2073         ping -c 1 $hostname 2>&1 1>/dev/null
2074         if test ! $? = 0; then
2075            hostname="localhost"
2076         fi
2077         DISTVER=`uname -a |awk '{print $3}'`
2078         VER=`echo $DISTVER | cut -c 1`
2079         if test x$VER = x4 ; then
2080            PTHREAD_LIB="${PTHREAD_LIBS:--pthread}"
2081            CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS:--pthread}"
2082         fi
2083         lld="qd"
2084         llu="qu"
2085         TAPEDRIVE="/dev/nrsa0"
2086         PSCMD="ps -ax -o pid,command"
2087         PFILES="${PFILES} \
2088             platforms/freebsd/Makefile \
2089             platforms/freebsd/bacula-fd \
2090             platforms/freebsd/bacula-sd \
2091             platforms/freebsd/bacula-dir"
2092         largefile_support="yes"
2093   ;;
2094 hpux)
2095         PSCMD="UNIX95=1; ps -e -o pid,comm"
2096         CFLAGS="${CFLAGS} -D_XOPEN_SOURCE_EXTENDED=1"
2097         DISTVER=`uname -r`
2098         TAPEDRIVE="/dev/rmt/0hnb"
2099         PTHREAD_LIB="-lpthread"
2100         AC_DEFINE([_INCLUDE_LONGLONG])
2101   ;;
2102 irix)
2103         DISTVER=`uname -r`
2104         TAPEDRIVE="/dev/rmt/0cbn"
2105         PSCMD="ps -e -o pid,comm"
2106         PFILES="${PFILES} \
2107             platforms/irix/Makefile \
2108             platforms/irix/bacula-fd \
2109             platforms/irix/bacula-sd \
2110             platforms/irix/bacula-dir"
2111   ;;
2112 netbsd)
2113         DISTVER=`uname -a |awk '{print $3}'`
2114         lld="qd"
2115         llu="qu"
2116         TAPEDRIVE="/dev/nrst0"
2117         PSCMD="ps -ax -o pid,command"
2118         PTHREAD_LIB="-pthread"
2119         CFLAGS="${CFLAGS} -pthread"
2120   ;;
2121 openbsd)
2122         DISTVER=`uname -a |awk '{print $3}'`
2123         lld="qd"
2124         llu="qu"
2125         TAPEDRIVE="/dev/nrst0"
2126         PSCMD="ps -ax -o pid,command"
2127         PTHREAD_LIB="-pthread"
2128         CFLAGS="${CFLAGS} -pthread"
2129         PFILES="${PFILES} \
2130             platforms/openbsd/Makefile \
2131             platforms/openbsd/bacula-fd \
2132             platforms/openbsd/bacula-sd \
2133             platforms/openbsd/bacula-dir"
2134   ;;
2135 redhat)
2136 #       Make sure hostname is resolved
2137         ping -c 1 $hostname 2>&1 1>/dev/null
2138         if test ! $? = 0; then
2139            hostname="localhost"
2140         fi
2141         if test -f /etc/whitebox-release ; then
2142            f=/etc/whitebox-release
2143         else
2144            f=/etc/redhat-release
2145         fi
2146         if test `cat $f | grep release |\
2147                    cut -f 3 -d ' '`x = "Enterprise"x ; then
2148            DISTVER="Enterprise "`cat $f | grep release |\
2149                     cut -f 6 -d ' '`
2150         else
2151             DISTVER=`cat /etc/redhat-release | grep release |\
2152                      cut -f 5 -d ' '`
2153         fi
2154         TAPEDRIVE="/dev/nst0"
2155         PSCMD="ps -e -o pid,command"
2156         PFILES="${PFILES} \
2157             platforms/redhat/Makefile \
2158             platforms/redhat/bacula-fd \
2159             platforms/redhat/bacula-sd \
2160             platforms/redhat/bacula-dir \
2161             platforms/redhat/bacula.spec \
2162             "
2163   ;;
2164 mandrake)
2165 #       Make sure hostname is resolved
2166         ping -c 1 $hostname 2>&1 1>/dev/null
2167         if test ! $? = 0; then
2168            hostname="localhost"
2169         fi
2170         DISTVER=`cat /etc/mandrake-release | grep release |\
2171            cut -f 5 -d ' '`
2172         TAPEDRIVE="/dev/nst0"
2173         PSCMD="ps -e -o pid,command"
2174         PFILES="${PFILES} \
2175             platforms/mandrake/Makefile \
2176             platforms/mandrake/bacula-fd \
2177             platforms/mandrake/bacula-sd \
2178             platforms/mandrake/bacula-dir \
2179             platforms/mandrake/bacula.spec \
2180             "
2181   ;;
2182 gentoo)
2183 #       Make sure hostname is resolved
2184         ping -c 1 $hostname 2>&1 1>/dev/null
2185         if test ! $? = 0; then
2186            hostname="localhost"
2187         fi
2188         DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
2189         TAPEDRIVE="/dev/nst0"
2190         PSCMD="ps -e -o pid,command"
2191         PFILES="${PFILES} \
2192             platforms/gentoo/Makefile \
2193          platforms/gentoo/bacula-init \
2194             platforms/gentoo/bacula-fd \
2195             platforms/gentoo/bacula-sd \
2196             platforms/gentoo/bacula-dir"
2197   ;;
2198 slackware)
2199 #       Make sure hostname is resolved
2200         ping -c 1 $hostname 2>&1 1>/dev/null
2201         if test ! $? = 0; then
2202            hostname="localhost"
2203         fi
2204         DISTVER=`cat /etc/slackware-version`
2205         TAPEDRIVE="/dev/nst0"
2206         PSCMD="ps -e -o pid,command"
2207         PFILES="${PFILES} \
2208             platforms/slackware/Makefile \
2209             platforms/slackware/rc.bacula-fd \
2210             platforms/slackware/rc.bacula-sd \
2211             platforms/slackware/rc.bacula-dir\
2212             platforms/slackware/functions.bacula"
2213   ;;
2214 solaris)
2215         DISTVER=`uname -r`
2216         TAPEDRIVE="/dev/rmt/0cbn"
2217         PSCMD="ps -e -o pid,comm"
2218         PFILES="${PFILES} \
2219             platforms/solaris/Makefile \
2220             platforms/solaris/bacula-fd \
2221             platforms/solaris/bacula-sd \
2222             platforms/solaris/bacula-dir"
2223         if test x$DISTVER = x5.6 ; then
2224             AC_DEFINE(HAVE_OLD_SOCKOPT)
2225         fi
2226         LIBS="$LIBS -lresolv"
2227   ;;
2228 suse)
2229 #       Make sure hostname is resolved
2230         ping -c 1 $hostname 2>&1 1>/dev/null
2231         if test ! $? = 0; then
2232            hostname="localhost"
2233         fi
2234         DISTVER=`cat /etc/SuSE-release |grep VERSION|\
2235             cut -f 3 -d ' '`
2236         TAPEDRIVE="/dev/nst0"
2237         PSCMD="ps -e -o pid,command"
2238         PFILES="${PFILES} \
2239             platforms/suse/Makefile \
2240             platforms/suse/bacula-fd \
2241             platforms/suse/bacula-sd \
2242             platforms/suse/bacula-dir \
2243             platforms/suse/bacula \
2244             platforms/suse/bacula.spec"
2245   ;;
2246 suse5)
2247 #       Make sure hostname is resolved
2248         ping -c 1 $hostname 2>&1 1>/dev/null
2249         if test ! $? = 0; then
2250            hostname="localhost"
2251         fi
2252         DISTNAME=suse
2253         DISTVER=5.x
2254         TAPEDRIVE="/dev/nst0"
2255         PSCMD="ps -e -o pid,command"
2256         PFILES="${PFILES} \
2257             platforms/suse/Makefile \
2258             platforms/suse/bacula-fd \
2259             platforms/suse/bacula-sd \
2260             platforms/suse/bacula-dir"
2261   ;;
2262 unknown)
2263         DISTVER=unknown
2264         TAPEDRIVE="/dev/nst0"
2265   ;;
2266 *)
2267   echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
2268   ;;
2269 esac  
2270
2271 AC_SUBST(hostname)
2272
2273 LIBS="$PTHREAD_LIB $LIBS"
2274
2275 AC_DEFINE_UNQUOTED(lld, "$lld")
2276 AC_DEFINE_UNQUOTED(llu, "$llu")
2277 AC_SUBST(TAPEDRIVE)
2278 AC_SUBST(PSCMD)
2279 AC_SUBST(WIN32)
2280 AC_SUBST(MACOSX)
2281 AC_SUBST(DISTNAME)
2282 AC_SUBST(DISTVER)
2283
2284 dnl# common parts of the Makefile
2285 MCOMMON=./autoconf/Make.common
2286 AC_SUBST_FILE(MCOMMON)
2287
2288 dnl# Insanity check
2289 if test "x${subsysdir}" = "x${sbindir}" ; then
2290    echo " "
2291    echo " "
2292    echo "You have set both --sbindir and --with-subsys-dir"
2293    echo "  equal to: ${subsysdir} "
2294    echo "This is not permitted. Please reconfigure."
2295    echo " "
2296    echo "Aborting configuration ..."
2297    echo " "
2298    echo " "
2299    exit 1
2300 fi 
2301
2302 AC_OUTPUT([autoconf/Make.common \
2303            Makefile \
2304            manpages/Makefile \
2305            scripts/startmysql \
2306            scripts/stopmysql \
2307            scripts/btraceback \
2308            scripts/startit \
2309            scripts/stopit \
2310            scripts/bconsole \
2311            scripts/gconsole \
2312            scripts/bacula \
2313            scripts/bacula-ctl-dir \
2314            scripts/bacula-ctl-fd \
2315            scripts/bacula-ctl-sd \
2316            scripts/devel_bacula \
2317            scripts/Makefile \
2318            scripts/logrotate \
2319            scripts/bacula.desktop.gnome1 \
2320            scripts/bacula.desktop.gnome2 \
2321            scripts/bacula.desktop.gnome1.consolehelper \
2322            scripts/bacula.desktop.gnome2.consolehelper \
2323            scripts/bacula.desktop.gnome1.xsu \
2324            scripts/bacula.desktop.gnome2.xsu \
2325            scripts/bgnome-console.console_apps \
2326            scripts/mtx-changer \
2327            scripts/disk-changer \
2328            scripts/dvd-handler \
2329            scripts/dvd-simulator \
2330            scripts/bacula-tray-monitor.desktop \
2331            scripts/logwatch/Makefile \
2332            scripts/logwatch/logfile.bacula.conf \
2333            scripts/wxconsole.console_apps \
2334            scripts/wxconsole.desktop.consolehelper \
2335            scripts/wxconsole.desktop.xsu \
2336            scripts/bat.desktop \
2337            scripts/bat.desktop.xsu \
2338            scripts/bat.desktop.consolehelper \
2339            scripts/bat.console_apps \
2340            src/Makefile \
2341            src/host.h \
2342            src/console/Makefile \
2343            src/console/bconsole.conf \
2344            src/gnome2-console/Makefile \
2345            src/gnome2-console/bgnome-console.conf \
2346            src/qt-console/bat.conf \
2347            src/qt-console/bat.pro \
2348            src/qt-console/bat.pro.mingw32 \
2349            src/qt-console/install_conf_file \
2350            src/wx-console/Makefile \
2351            src/wx-console/bwx-console.conf \
2352            src/tray-monitor/Makefile \
2353            src/tray-monitor/tray-monitor.conf \
2354            src/dird/Makefile \
2355            src/dird/bacula-dir.conf \
2356            src/lib/Makefile \
2357            src/stored/Makefile \
2358            src/stored/bacula-sd.conf \
2359            src/filed/Makefile \
2360            src/filed/bacula-fd.conf \
2361            src/cats/Makefile \
2362            src/cats/make_catalog_backup \
2363            src/cats/delete_catalog_backup \
2364            src/cats/create_postgresql_database \
2365            src/cats/update_postgresql_tables \
2366            src/cats/make_postgresql_tables \
2367            src/cats/grant_postgresql_privileges \
2368            src/cats/drop_postgresql_tables \
2369            src/cats/drop_postgresql_database \
2370            src/cats/create_mysql_database \
2371            src/cats/update_mysql_tables \
2372            src/cats/make_mysql_tables \
2373            src/cats/grant_mysql_privileges \
2374            src/cats/drop_mysql_tables \
2375            src/cats/drop_mysql_database \
2376            src/cats/create_sqlite_database \
2377            src/cats/update_sqlite_tables \
2378            src/cats/make_sqlite_tables \
2379            src/cats/grant_sqlite_privileges \
2380            src/cats/drop_sqlite_tables \
2381            src/cats/drop_sqlite_database \
2382            src/cats/create_sqlite3_database \
2383            src/cats/update_sqlite3_tables \
2384            src/cats/make_sqlite3_tables \
2385            src/cats/grant_sqlite3_privileges \
2386            src/cats/drop_sqlite3_tables \
2387            src/cats/drop_sqlite3_database \
2388            src/cats/sqlite \
2389            src/cats/mysql \
2390            src/cats/create_bdb_database \
2391            src/cats/update_bdb_tables \
2392            src/cats/make_bdb_tables \
2393            src/cats/grant_bdb_privileges \
2394            src/cats/drop_bdb_tables \
2395            src/cats/drop_bdb_database \
2396            src/cats/create_bacula_database \
2397            src/cats/update_bacula_tables \
2398            src/cats/grant_bacula_privileges \
2399            src/cats/make_bacula_tables \
2400            src/cats/drop_bacula_tables \
2401            src/cats/drop_bacula_database \
2402            src/findlib/Makefile \
2403            src/tools/Makefile \
2404            src/plugins/fd/Makefile \
2405            po/Makefile.in \
2406            updatedb/update_mysql_tables_10_to_11 \
2407            updatedb/update_sqlite3_tables_10_to_11 \
2408            updatedb/update_postgresql_tables_10_to_11 \
2409            updatedb/update_sqlite_tables_10_to_11 \
2410            $PFILES ],  
2411           [ ]
2412 )
2413
2414 if test "${support_bat}" = "yes" ; then
2415   if test "x$QMAKE" = "xnone" && test "x$QMAKEQT4" = "xnone"; then
2416   echo "Could not find qmake or qmake-qt4 in $PATH. Check your Qt installation"
2417   exit 1
2418   fi
2419
2420   QMAKEBIN="qmake"
2421
2422   if test "x$QMAKEQT4" != "xnone"; then
2423     QMAKEBIN=qmake-qt4
2424   fi
2425   
2426   cd src/qt-console
2427   chmod 755 install_conf_file build-depkgs-qt-console
2428   echo "Creating bat Makefile"
2429   $QMAKEBIN
2430   make clean
2431   cd ${BUILD_DIR}
2432 fi
2433
2434 echo "Doing make of dependencies"
2435 ${MAKE:-make} depend
2436
2437 cd scripts
2438 chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
2439 chmod 755 dvd-handler dvd-simulator
2440 chmod 755 bconsole gconsole mtx-changer devel_bacula logrotate
2441 cd ..
2442
2443 c=updatedb
2444 chmod 755 $c/update_mysql_tables_10_to_11       $c/update_sqlite3_tables_10_to_11
2445 chmod 755 $c/update_postgresql_tables_10_to_11  $c/update_sqlite_tables_10_to_11
2446
2447 c=src/cats
2448
2449 chmod 755 $c/create_bacula_database   $c/update_bacula_tables  $c/make_bacula_tables
2450 chmod 755 $c/grant_bacula_privileges  $c/drop_bacula_tables    $c/drop_bacula_database
2451
2452 chmod 755 $c/create_bdb_database      $c/update_bdb_tables     $c/make_bdb_tables
2453 chmod 755 $c/grant_bdb_privileges     $c/drop_bdb_tables       $c/drop_bdb_database
2454
2455 chmod 755 $c/create_mysql_database    $c/update_mysql_tables   $c/make_mysql_tables
2456 chmod 755 $c/grant_mysql_privileges   $c/drop_mysql_tables     $c/drop_mysql_database
2457
2458 chmod 755 $c/create_sqlite_database   $c/update_sqlite_tables  $c/make_sqlite_tables
2459 chmod 755 $c/grant_sqlite_privileges  $c/drop_sqlite_tables    $c/drop_sqlite_database
2460
2461 chmod 755 $c/create_sqlite3_database   $c/update_sqlite3_tables  $c/make_sqlite3_tables
2462 chmod 755 $c/grant_sqlite3_privileges  $c/drop_sqlite3_tables    $c/drop_sqlite3_database
2463
2464 chmod 755 $c/create_postgresql_database  $c/update_postgresql_tables $c/make_postgresql_tables
2465 chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables   $c/drop_postgresql_database
2466
2467 chmod 755 $c/make_catalog_backup $c/delete_catalog_backup
2468 chmod 755 $c/sqlite
2469 chmod 755 $c/mysql
2470
2471 chmod 755 src/win32/build-depkgs-mingw32
2472
2473
2474
2475 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
2476    largefile_support="yes"
2477 fi
2478
2479 #
2480 # A whole lot of hand springs to get the compiler version.
2481 #  This is because gcc changed the output in version 3.0
2482 #
2483 CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
2484 if test "x${CCVERSION}" = "x" ; then
2485   CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
2486 fi
2487 CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
2488 if test x"${CXXVERSION}" = x ; then
2489   CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
2490 fi
2491
2492 if test "x${subsysdir}" = "x${sbindir}" ; then
2493    echo " "
2494    echo " "
2495    echo "You have set --sbindir and --with-subsys-dir"
2496    echo "  both equal to: ${subsysdir} "
2497    echo "  This is not permitted. Please reconfigure."
2498    echo " "
2499    echo "Aborting configuration ..."
2500    echo " "
2501    echo " "
2502    exit 1
2503 fi 
2504
2505 if test "x${db_type}" = "xInternal" ; then
2506    echo " "
2507    echo " "
2508    echo "You have not specified either --enable-client-only or one of the"
2509    echo "  supported databases: MySQL, PostgreSQL, SQLite3, SQLite or DBI."
2510    echo "  This is not permitted. Please reconfigure."
2511    echo " "
2512    echo "Aborting the configuration ..."
2513    echo " "
2514    echo " "
2515    exit 1
2516 fi
2517
2518 echo "
2519 Configuration on `date`:
2520
2521   Host:                       ${host}${post_host} -- ${DISTNAME} ${DISTVER}
2522   Bacula version:             ${BACULA} ${VERSION} (${DATE})
2523   Source code location:       ${srcdir}
2524   Install binaries:           ${sbindir}
2525   Install config files:       ${sysconfdir}
2526   Scripts directory:          ${scriptdir}
2527   Archive directory:          ${archivedir}
2528   Working directory:          ${working_dir}
2529   PID directory:              ${piddir}
2530   Subsys directory:           ${subsysdir}
2531   Man directory:              ${mandir}
2532   Data directory:             ${datadir}
2533   C Compiler:                 ${CC} ${CCVERSION}
2534   C++ Compiler:               ${CXX} ${CXXVERSION}
2535   Compiler flags:             ${WCFLAGS} ${CFLAGS} 
2536   Linker flags:               ${WLDFLAGS} ${LDFLAGS}
2537   Libraries:                  ${LIBS}
2538   Statically Linked Tools:    ${support_static_tools}
2539   Statically Linked FD:       ${support_static_fd}
2540   Statically Linked SD:       ${support_static_sd}
2541   Statically Linked DIR:      ${support_static_dir}
2542   Statically Linked CONS:     ${support_static_cons}
2543   Database type:              ${db_type}
2544   Database port:              ${db_port}
2545   Database lib:               ${DB_LIBS}
2546   Database name:              ${db_name}
2547   Database user:              ${db_user}
2548
2549   Job Output Email:           ${job_email}
2550   Traceback Email:            ${dump_email}
2551   SMTP Host Address:          ${smtp_host}
2552
2553   Director Port:              ${dir_port}
2554   File daemon Port:           ${fd_port}
2555   Storage daemon Port:        ${sd_port}
2556
2557   Director User:              ${dir_user}
2558   Director Group:             ${dir_group}
2559   Storage Daemon User:        ${sd_user}
2560   Storage DaemonGroup:        ${sd_group}
2561   File Daemon User:           ${fd_user}
2562   File Daemon Group:          ${fd_group}
2563
2564   SQL binaries Directory      ${SQL_BINDIR}
2565
2566   Large file support:         $largefile_support
2567   Bacula conio support:       ${got_conio} ${CONS_LIBS}
2568   readline support:           ${got_readline} ${PRTREADLINE_SRC}
2569   TCP Wrappers support:       ${TCPW_MSG} ${WRAPLIBS}
2570   TLS support:                ${support_tls}
2571   Encryption support:         ${support_crypto} 
2572   ZLIB support:               ${have_zlib}
2573   enable-smartalloc:          ${support_smartalloc} 
2574   bat support:                ${support_bat} ${QWT_LDFLAGS}
2575   enable-gnome:               ${support_gnome} ${gnome_version}
2576   enable-bwx-console:         ${support_wx_console} ${wx_version}
2577   enable-tray-monitor:        ${support_tray_monitor}
2578   client-only:                ${build_client_only}
2579   build-dird:                 ${build_dird}
2580   build-stored:               ${build_stored}
2581   ACL support:                ${have_acl}
2582   Python support:             ${support_python} ${PYTHON_LIBS}
2583   Batch insert enabled:       ${support_batch_insert}
2584
2585   " > config.out
2586
2587 cat config.out