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