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