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