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