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