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