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