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