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