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