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