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