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