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