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