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