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