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