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