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