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