]> git.sur5r.net Git - bacula/bacula/blob - bacula/autoconf/configure.in
Misc -- see kes-1.30
[bacula/bacula] / bacula / autoconf / configure.in
1 dnl#
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 AC_PATH_PROG(RANLIB, ranlib, ranlib)
63 AC_PATH_PROG(OPENSSL, openssl, none)
64
65 test -n "$ARFLAG" || ARFLAGS="cr"
66 AC_SUBST(ARFLAGS)
67
68 MAKE_SHELL=/bin/sh
69 AC_SUBST(MAKE_SHELL)
70
71 AC_SUBST(LOCAL_LIBS)
72 AC_SUBST(LOCAL_CFLAGS)
73 AC_SUBST(LOCAL_LDFLAGS)
74 AC_SUBST(LOCAL_DEFS)
75
76
77
78 dnl --------------------------------------------------
79 dnl Bacula OP Sys determination (see aclocal.m4)
80 dnl --------------------------------------------------
81 BA_CHECK_OPSYS
82
83 # -----------------------------------------------------------
84 dnl Bacula OPSys Distribution determination (see aclocal.m4)
85 # ----------------------------------------------------------
86 BA_CHECK_OPSYS_DISTNAME
87
88 # -----------------------------------------------------------
89 dnl Check for gnome stuff for gnome-console
90 # ----------------------------------------------------------
91 AM_ACLOCAL_INCLUDE(gnome-macros)
92
93 # ------------------------------------------------------------------
94 #  If the user has not set --prefix, we set our default to nothing.
95 #  In this case, if the user has not set --sysconfdir, we set it
96 #  to the package default of /etc/bacula.  If either --prefix or
97 #  --sysconfdir is set, we leave sysconfdir alone except to eval it.
98 # ------------------------------------------------------------------
99 if test x${prefix} = xNONE ; then
100     if test `eval echo ${sysconfdir}` = NONE/etc ; then
101         sysconfdir=/etc/bacula
102     fi
103     prefix=
104 fi
105 sysconfdir=`eval echo ${sysconfdir}`
106
107 # -------------------------------------------------------------------------
108 #  If the user has not set --exec-prefix, we default to ${prefix}
109 # -------------------------------------------------------------------------
110 if test x${exec_prefix} = xNONE ; then
111     exec_prefix=${prefix}
112 fi
113
114 # ------------------------------------------------------------------
115 # If the user has not set --sbindir, we set our default as /sbin
116 # ------------------------------------------------------------------
117 if test x$sbindir = x'${exec_prefix}/sbin' ; then
118     sbindir=${exec_prefix}/sbin
119 fi
120 sbindir=`eval echo ${sbindir}`
121                       
122 # ------------------------------------------------------------------
123 # All list of languages for which a translation exist. Each
124 #  language is separated by a space.
125 # ------------------------------------------------------------------
126 ALL_LINGUAS=""
127
128 AC_PATH_PROGS(MSGFMT, msgfmt, no)
129 if test "$MSGFMT" = "no"
130 then
131    echo 'msgfmt program not found, disabling NLS !'
132    USE_NLS=no
133    USE_INCLUDED_LIBINTL=no
134 #else
135 #   AM_GNU_GETTEXT
136 fi
137
138
139 support_mysql=no
140 support_sqlite=no
141 support_smartalloc=yes
142 support_readline=yes
143 support_gnome=no
144 support_static_tools=no
145 support_static_fd=no
146 support_static_sd=no
147 support_static_dir=no
148 support_static_cons=no
149 build_client_only=no
150 cats=
151 db_name=Internal
152 DB_NAME=bdb
153
154 dnl# --------------------------------------------------------------------------
155 dnl# CHECKING COMMAND LINE OPTIONS
156 dnl# --------------------------------------------------------------------------
157
158 # -------------------------------------------
159 # gnome (default off)
160 # -------------------------------------------
161 AC_ARG_ENABLE(gnome,
162   [  --enable-gnome       enable build of gnome-console GUI [disabled]],
163   [if test x$enableval = xyes; then
164     support_gnome=yes
165   fi])
166
167 GNOME_DIR=
168 if test x$support_gnome = xyes; then
169     GNOME_INIT
170     GNOME_DIR=src/gnome-console
171 fi
172 AC_SUBST(GNOME_DIR)
173
174
175 # -------------------------------------------
176 # smartalloc (default off)
177 # -------------------------------------------
178 AC_ARG_ENABLE(smartalloc,
179   [  --enable-smartalloc     enable smartalloc debugging support [disabled]],
180   [if test x$enableval = xno; then
181     support_smartalloc=no
182   fi])
183
184 if test x$support_smartalloc = xyes; then
185    AC_DEFINE(SMARTALLOC)
186 fi
187
188 # -------------------------------------------
189 # static-tools (default off)
190 # -------------------------------------------
191 AC_ARG_ENABLE(static-tools,
192    [  --enable-static-tools   enable static tape tools [disabled]],
193    [if test x$enableval = xyes; then
194      support_static_tools=yes
195    fi])
196
197 TTOOL_LDFLAGS=
198 if test x$support_static_tools = xyes; then
199    TTOOL_LDFLAGS="-static"
200 fi
201 AC_SUBST(TTOOL_LDFLAGS)
202
203 # -------------------------------------------
204 # static-fd    (default off)
205 # -------------------------------------------
206 AC_ARG_ENABLE(static-fd,
207    [  --enable-static-fd      enable static File daemon [disabled]],
208    [if test x$enableval = xyes; then
209      support_static_fd=yes
210    fi])
211
212 STATIC_FD=
213 if test x$support_static_fd = xyes; then
214    STATIC_FD="static-bacula-fd"
215 fi
216 AC_SUBST(STATIC_FD)
217
218 # -------------------------------------------
219 # static-sd    (default off)
220 # -------------------------------------------
221 AC_ARG_ENABLE(static-sd,
222    [  --enable-static-sd      enable static Storage daemon [disabled]],
223    [if test x$enableval = xyes; then
224      support_static_sd=yes
225    fi])
226
227 STATIC_SD=
228 if test x$support_static_sd = xyes; then
229    STATIC_SD="static-bacula-sd"
230 fi
231 AC_SUBST(STATIC_SD)
232
233 # -------------------------------------------
234 # static-dir   (default off)
235 # -------------------------------------------
236 AC_ARG_ENABLE(static-dir,
237    [  --enable-static-dir     enable static Director [disabled]],
238    [if test x$enableval = xyes; then
239      support_static_dir=yes
240    fi])
241
242 STATIC_DIR=
243 if test x$support_static_dir = xyes; then
244    STATIC_DIR="static-bacula-dir"
245 fi
246 AC_SUBST(STATIC_DIR)
247
248 # -------------------------------------------
249 # static-cons  (default off)
250 # -------------------------------------------
251 AC_ARG_ENABLE(static-cons,
252    [  --enable-static-cons    enable static Console [disabled]],
253    [if test x$enableval = xyes; then
254      support_static_cons=yes
255    fi])
256
257 STATIC_CONS=
258 if test x$support_static_cons = xyes; then
259    STATIC_CONS="static-console"
260 fi
261 AC_SUBST(STATIC_CONS)
262
263 # -------------------------------------------
264 # client_only  (default off)
265 # -------------------------------------------
266 AC_ARG_ENABLE(client-only,
267    [  --enable-client-only    build client (File daemon) only [disabled]],
268    [if test x$enableval = xyes; then
269      build_client_only=yes
270    fi])
271 if test x$build_client_only = xno; then
272    ALL_DIRS="subdirs"
273 else
274    ALL_DIRS=""
275 fi
276 AC_SUBST(ALL_DIRS)
277
278 # ---------------------------------------------------
279 # Check for readline support/directory (default on)
280 # ---------------------------------------------------
281 # this allows you to turn it completely off
282 AC_ARG_ENABLE(readline,
283   [  --disable-readline      disable readline support [enabled]
284                                                       ],
285   [if test x$enableval = xno; then
286     support_readline=no
287   fi])
288
289 got_readline="no"
290 READLINE_SRC=
291 if test x$support_readline = xyes; then
292    AC_ARG_WITH(readline,
293      [ --with-readline=DIR               specify readline library directory],
294      [
295         case "$with_readline" in
296         no) : ;;
297         yes|*)
298           if test "$with_readline" != "yes"; then
299             CONS_INC="-I$with_readline"
300             CONS_LDFLAGS="-L$with_readline"
301           else
302              with_readline="/usr/include/readline" 
303           fi
304           AC_CHECK_HEADER($with_readline/readline.h, 
305              [ AC_MSG_RESULT(yes)
306                AC_DEFINE(HAVE_READLINE) 
307                CONS_LIBS="-lreadline -ltermcap"
308                got_readline="yes"   
309              ],
310              [ AC_MSG_ERROR([*** readline library missing]) 
311              ]
312           )
313           ;;
314         esac
315      ],[
316        # check for standard readline library
317        AC_CHECK_HEADER(/usr/include/readline/readline.h, 
318        [ AC_MSG_RESULT(yes)
319          AC_DEFINE(HAVE_READLINE)
320          got_readline="yes"
321          CONS_INC="-I/usr/include/readline"
322          CONS_LIBS="-lreadline -ltermcap"
323        ], [
324          # Did not find starndard library, so user our own
325          AC_MSG_RESULT(yes)
326          AC_DEFINE(HAVE_READLINE)
327          got_readline="yes"
328          CONS_INC="-I${TOP_DIR}/depkgs"
329          CONS_LIBS="-lreadline -lhistory -ltermcap"
330          CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
331          PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
332        ])
333      ]   
334    )
335 fi
336 AC_SUBST(CONS_INC)
337 AC_SUBST(CONS_LIBS)
338 AC_SUBST(CONS_LDFLAGS)
339 AC_SUBST(READLINE_SRC)
340
341 # Minimal stuff for readline Makefile configuration
342 MAKE_SHELL=/bin/sh
343 AC_SUBST(MAKE_SHELL)
344
345 AC_HEADER_STAT
346 AC_HEADER_DIRENT
347
348 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr setlocale lstat lchown)
349
350 #AC_CHECK_FUNC(getopt_long, AC_DEFINE(HAVE_GETOPT_LONG),
351 #   [LIBEXTRAOBJ="$LIBEXTRAOBJ getopt.o getopt1.o"
352 #    EXTRAOBJ="$EXTRAOBJ lib/getopt.o lib/getopt1.o"])
353
354 AC_CHECK_FUNC(getopt_long, AC_DEFINE(HAVE_GETOPT_LONG))
355
356
357 AC_FUNC_STRCOLL
358
359 AC_CHECK_HEADERS(varargs.h \
360                 sys/ptem.h sys/pte.h sys/stream.h)      
361
362 # End of readline stuff
363 # -----------------------------------------------------------------------
364
365
366 # ---------------------------------------------------
367 # Check for GMP support/directory
368 # ---------------------------------------------------
369 #GMP_SRC=
370 #local_gmp="no"
371 #AC_ARG_WITH(gmp,
372 #  [  --with-gmp[=DIR]   Specify gmp library directory],
373 #  [
374 #     case "$with_gmp" in
375 #     no) : ;;
376 #     yes|*)
377 #       if test "$with_gmp" != "yes"; then
378 #         GMP_INC="-I$with_gmp"
379 #         GMP_LIBS="-lgmp"
380 #         GMP_LDFLAGS="-L$with_gmp"
381 #       else
382 #          with_gmp="/usr/include" 
383 #       fi
384 #       AC_CHECK_HEADER($with_gmp/gmp.h, 
385 #          [ AC_MSG_RESULT(yes)
386 #            AC_DEFINE(HAVE_GMP) 
387 #            GMP_LIBS="-lgmp"
388 #            got_gmp="yes"   
389 #          ],
390 #          [ AC_MSG_ERROR([*** gmp library missing]) 
391 #          ]
392 #       )
393 #       ;;
394 #     esac
395 #  ],[
396 #    # check for standard gmp library
397 #    AC_CHECK_HEADER(/usr/include/gmp.h,
398 #    [ AC_MSG_RESULT(yes)
399 #      AC_DEFINE(HAVE_GMP)
400 #      got_gmp="yes"
401 #      GMP_INC=
402 #      GMP_LIBS="-lgmp"
403 #    ], [
404 #      # Did not find standard library, so use our own
405 #      AC_MSG_RESULT(yes)
406 #      AC_DEFINE(HAVE_GMP)
407 #      got_gmp="yes"
408 #      local_gmp="yes"
409 #      GMP_INC="-I${TOP_DIR}/depkgs/gmp"
410 #      GMP_LIBS="-lgmp"
411 #      GMP_LDFLAGS="-L${TOP_DIR}/depkgs/gmp"
412 #      GMP_SRC="${TOP_DIR}/depkgs/gmp"
413 #    ])
414 #  ]   
415 #)
416 #AC_SUBST(GMP_INC)
417 #AC_SUBST(GMP_LIBS)
418 #AC_SUBST(GMP_LDFLAGS)
419 #AC_SUBST(GMP_SRC)
420
421 # End of GMP stuff
422 # -----------------------------------------------------------------------
423
424
425 # ---------------------------------------------------
426 # Check for CWEB support/directory
427 # ---------------------------------------------------
428 #CWEB_SRC=
429 #CWEB=/bin
430 #local_cweb="no"
431 #AC_ARG_WITH(cweb,
432 #  [  --with-cweb[=DIR]   Specify cweb library directory],
433 #  [
434 #     case "$with_cweb" in
435 #     no) : ;;
436 #     yes|*)
437 #       if test "$with_cweb" != "yes"; then
438 #         CWEB_INC="-I$with_cweb"
439 #         CWEB_LIBS="-lcweb"
440 #         CWEB_LDFLAGS="-L$with_cweb"
441 #       else
442 #          with_cweb="/usr/include" 
443 #       fi
444 #       AC_CHECK_HEADER($with_cweb/cweb.h, 
445 #          [ AC_MSG_RESULT(yes)
446 #            AC_DEFINE(HAVE_CWEB) 
447 #            CWEB_LIBS="-lcweb"
448 #            got_cweb="yes"   
449 #          ],
450 #          [ AC_MSG_ERROR([*** cweb library missing]) 
451 #          ]
452 #       )
453 #       ;;
454 #     esac
455 #  ],[
456 #    # check for standard cweb library
457 #    AC_CHECK_HEADER(/usr/include/cweb.h,
458 #    [ AC_MSG_RESULT(yes)
459 #      AC_DEFINE(HAVE_CWEB)
460 #      got_cweb="yes"
461 #      CWEB_INC=
462 #      CWEB_LIBS="-lcweb"
463 #    ], [
464 #      # Did not find starndard library, so use our own
465 #      AC_MSG_RESULT(yes)
466 #      AC_DEFINE(HAVE_CWEB)
467 #      got_cweb="yes"
468 #      local_cweb="yes"
469 #      CWEB=${TOP_DIR}/depkgs/cweb
470 #      CWEB_INC="-I${TOP_DIR}/depkgs/cweb"
471 #      CWEB_LIBS="-lcweb"
472 #      CWEB_LDFLAGS="-L${TOP_DIR}/depkgs/cweb"
473 #      CWEB_SRC="${TOP_DIR}/depkgs/cweb"
474 #    ])
475 #  ]   
476 #)
477 #AC_SUBST(CWEB)
478 #AC_SUBST(CWEB_INC)
479 #AC_SUBST(CWEB_LIBS)
480 #AC_SUBST(CWEB_LDFLAGS)
481 #AC_SUBST(CWEB_SRC)
482
483 # End of CWEB stuff
484 # -----------------------------------------------------------------------
485
486
487
488 # -----------------------------------------------------------
489 # Check whether user wants TCP wrappers support (default off)
490 # -----------------------------------------------------------
491 TCPW_MSG="no" 
492 AC_ARG_WITH(tcp-wrappers,
493   [  --with-tcp-wrappers=DIR     enable tcpwrappers support],
494   [
495     if test "x$withval" != "xno" ; then
496        saved_LIBS="$LIBS"
497        LIBS="$LIBS -lwrap -lnsl"
498        AC_MSG_CHECKING(for libwrap)
499        AC_TRY_LINK(
500           [ #include <tcpd.h>
501              int deny_severity = 0;
502              int allow_severity = 0;
503              struct request_info *req; ],
504           [ hosts_access(req); ],
505           [
506             AC_MSG_RESULT(yes)
507             AC_DEFINE(HAVE_LIBWRAP)
508             TCPW_MSG="yes" 
509           ],
510           [AC_MSG_ERROR([*** libwrap missing]) ]
511        )
512     fi
513   ]
514 )
515
516 # ------------------------------------------
517 # Where to place working dir
518 # ------------------------------------------
519 working_dir=`eval echo ${sysconfdir}/working`
520 AC_ARG_WITH(working-dir,
521    [  --with-working-dir=PATH    specify path of Bacula working directory],
522    [
523        if test "x$withval" != "xno" ; then     
524               working_dir=$withval
525        fi
526    ]
527 )
528
529 AC_SUBST(working_dir)
530
531
532 # ------------------------------------------
533 # Where to place scriptdir (script files)
534 # ------------------------------------------
535 scriptdir=`eval echo ${sysconfdir}`
536 AC_ARG_WITH(scriptdir,
537    [  --with-scriptdir=PATH    specify path of Bacula scripts directory],
538    [
539        if test "x$withval" != "xno" ; then     
540               scriptdir=$withval
541        fi
542    ]
543 )
544
545 AC_SUBST(scriptdir)
546
547
548 # ------------------------------------------
549 # Where to send dump email
550 # ------------------------------------------
551 dump_email=root@localhost
552 AC_ARG_WITH(dump-email,
553    [  --with-dump-email=EMAIL    dump email address],
554    [
555        if test "x$withval" != "xno" ; then     
556               dump_email=$withval
557        fi
558    ]
559 )
560
561 AC_SUBST(dump_email)
562
563 # ------------------------------------------
564 # Where to send job email
565 # ------------------------------------------
566 job_email=root@localhost
567 AC_ARG_WITH(job-email,
568    [  --with-job-email=EMAIL     job output email address],
569    [
570        if test "x$withval" != "xno" ; then     
571               job_email=$withval
572        fi
573    ]
574 )
575
576 AC_SUBST(job_email)
577
578 # ------------------------------------------
579 # Where to find smtp host
580 # ------------------------------------------
581 smtp_host=localhost
582 AC_ARG_WITH(smtp_host,
583    [  --with-smtp-host=HOST              SMTP mail host address],
584    [
585        if test "x$withval" != "xno" ; then     
586               smtp_host=$withval
587        fi
588    ]
589 )
590
591 AC_SUBST(smtp_host)
592
593
594 # ------------------------------------
595 # Where to place pid files
596 # ------------------------------------
597 piddir=/var/run
598 AC_ARG_WITH(pid-dir,
599     [  --with-pid-dir=PATH               specify location of Bacula pid files],
600     [
601         if test "x$withval" != "xno" ; then     
602             piddir=$withval
603         fi
604     ]
605 )
606
607 # make sure the pid directory exists
608 if test ! -d $piddir ; then     
609     piddir=`eval echo ${sysconfdir}`
610     case $piddir in
611           NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
612     esac
613 fi
614
615 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
616 AC_SUBST(piddir)
617
618
619 # ------------------------------------
620 # Where to place subsys "lock file"
621 # ------------------------------------
622 subsysdir=/var/run/subsys
623 AC_ARG_WITH(subsys-dir,
624     [  --with-subsys-dir=PATH    specify location of Bacula subsys file],
625     [
626         if test "x$withval" != "xno" ; then     
627             subsysdir=$withval
628         fi
629     ]
630 )
631
632 # make sure the pid directory exists
633 if test ! -d $subsysdir ; then     
634     subsysdir=`eval echo ${sysconfdir}`
635     case $subsysdir in
636         NONE/*) subsysdir=`echo $subsysdir | sed "s~NONE~$ac_default_prefix~"` ;;
637     esac
638 fi
639
640 AC_SUBST(subsysdir)
641
642
643
644 # ------------------------------------
645 # Where to start assigning ports
646 # ------------------------------------
647 baseport=9101
648 AC_ARG_WITH(baseport,
649     [  --with-baseport=PORT              specify base port address for daemons],
650     [
651         if test "x$withval" != "xno" ; then     
652              baseport=$withval
653         fi
654     ]
655 )
656
657 AC_SUBST(baseport)
658 dir_port=`expr $baseport`
659 fd_port=`expr $baseport + 1`
660 sd_port=`expr $fd_port + 1`
661
662 AC_SUBST(dir_port)
663 AC_SUBST(fd_port)
664 AC_SUBST(sd_port)
665
666
667 # ------------------------------------------
668 # Generate passwords
669 # ------------------------------------------
670 dir_password=
671 AC_ARG_WITH(dir-password,
672    [  --with-dir-password=PASSWORD   specify Director's password],
673    [
674        if test "x$withval" != "xno" ; then     
675            dir_password=$withval
676        fi
677    ]
678 )
679
680 if test "x$dir_password" = "x" ; then
681    if test "x$OPENSSL" = "xnone" ; then
682 #     key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" abcdefghijklmnopqrst | awk '{getline} {print} {exit}'`
683       key=`autoconf/randpass 33`
684    else
685       key=`openssl rand -base64 33`
686    fi
687    dir_password=$key
688 fi
689
690 fd_password=
691 AC_ARG_WITH(fd-password,
692    [  --with-fd-password=PASSWORD    specify Client's password],
693    [
694        if test "x$withval" != "xno" ; then     
695            fd_password=$withval
696        fi
697    ]
698 )
699
700 if test "x$fd_password" = "x" ; then
701    if test "x$OPENSSL" = "xnone" ; then
702 #     key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" tsrqponmlkjihgfedcba | awk '{getline} {print} {exit}'`
703       key=`autoconf/randpass 37`
704    else
705       key=`openssl rand -base64 33`
706    fi
707    fd_password=$key
708 fi
709
710 sd_password=
711 AC_ARG_WITH(sd-password,
712    [  --with-sd-password=PASSWORD    specify Storage daemon's password],
713    [
714        if test "x$withval" != "xno" ; then     
715            sd_password=$withval
716        fi
717    ]
718 )
719
720 if test "x$sd_password" = "x" ; then
721    if test "x$OPENSSL" = "xnone" ; then
722 #     key=`date | uuencode /dev/stdout | tr "\"@\\\`\\ \\=\\,\\(\\)\\#\\.\\!\\-$'" 123456789uvwxyzabcdef | awk '{getline} {print} {exit}'`
723       key=`autocnf/randpass 41`
724    else
725       key=`openssl rand -base64 33`
726    fi
727    sd_password=$key
728 fi
729
730
731 AC_SUBST(dir_password)
732 AC_SUBST(fd_password)
733 AC_SUBST(sd_password)
734
735
736
737
738 # ------------------------------------------------
739 # Bacula check for various SQL database engines
740 # ------------------------------------------------
741 BA_CHECK_MYSQL_DB
742
743
744 # ------------------------------------------------
745 # Bacula check for various SQL database engines
746 # ------------------------------------------------
747 BA_CHECK_SQLITE_DB
748
749 AC_SUBST(cats)
750 AC_SUBST(DB_NAME)
751
752 AC_DEFINE(PROTOTYPES)
753
754 dnl# --------------------------------------------------------------------------
755 dnl# Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
756 dnl#
757 if test -z "$CFLAGS"; then
758     if test -z "$CCOPTS"; then
759         CCOPTS='-g -O2'
760 dnl>    if test "x$GCC" = xyes; then
761 dnl>        if test x$system = xLinux; then
762 dnl>            CCOPTS="$CCOPTS "'-O2 -fno-strength-reduce'
763 dnl>        fi
764 dnl>    fi
765     fi
766     CFLAGS="$CCOPTS"
767 fi
768
769
770 dnl A few others 
771 AC_EXEEXT
772
773 dnl See if we can use 64 bit file addresses
774 largefile_support="no"
775 AC_SYS_LARGEFILE
776
777
778 AC_PATH_XTRA
779
780 dnl# --------------------------------------------------------------------------
781 dnl# CHECKING FOR HEADER FILES
782 dnl# --------------------------------------------------------------------------
783 AC_CHECK_HEADERS( \
784         assert.h \
785         fcntl.h \
786         grp.h \
787         libc.h \
788         limits.h \
789         stdarg.h \
790         stdlib.h \
791         stdint.h \
792         string.h \
793         termios.h \
794         unistd.h \
795         sys/byteorder.h \
796         sys/ioctl.h \
797         sys/select.h \
798         sys/sockio.h \
799         sys/time.h \
800 )
801 AC_HEADER_STDC
802 AC_HEADER_MAJOR
803 AC_HEADER_DIRENT
804 AC_HEADER_STAT
805 AC_HEADER_SYS_WAIT
806 AC_HEADER_TIME
807 AC_STRUCT_ST_BLKSIZE
808 AC_STRUCT_ST_BLOCKS
809 AC_STRUCT_TIMEZONE
810
811 dnl# --------------------------------------------------------------------------
812 dnl# Check for utime.h structure 
813 dnl# --------------------------------------------------------------------------
814 AC_CACHE_CHECK(for utime.h, tar_cv_header_utime_h,
815   [AC_TRY_COMPILE([
816 #include <sys/types.h>
817 #include <utime.h>], [struct utimbuf foo],
818   tar_cv_header_utime_h=yes, tar_cv_header_utime_h=no)])
819 test $tar_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H)
820
821 dnl# --------------------------------------------------------------------------
822 dnl# Check for bigendian
823 dnl# --------------------------------------------------------------------------
824 AC_CACHE_CHECK([for bigendian], ba_cv_bigendian,
825   [AC_TRY_RUN(
826     [main(){long a=1L; char *p=(char *)&a; exit(*p);}],
827     [ba_cv_bigendian=yes], 
828     [ba_cv_bigendian=no], 
829     [ba_cv_bigendian=no])])
830 test $ba_cv_bigendian = yes && AC_DEFINE(HAVE_BIGENDIAN)
831
832
833 AC_C_CONST
834
835
836 dnl# --------------------------------------------------------------------------
837 dnl# CHECKING FOR FILESYSTEM TYPE
838 dnl# --------------------------------------------------------------------------
839 AC_MSG_CHECKING(how to get filesystem type)
840 fstype=no
841 # The order of these tests is important.
842 AC_TRY_CPP([#include <sys/statvfs.h>
843 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4)
844 if test $fstype = no; then
845 AC_TRY_CPP([#include <sys/statfs.h>
846 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3)
847 fi
848 if test $fstype = no; then
849 AC_TRY_CPP([#include <sys/statfs.h>
850 #include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX)
851 fi
852 if test $fstype = no; then  
853 AC_TRY_CPP([#include <mntent.h>], AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD)
854 fi
855 if test $fstype = no; then  
856 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
857 fi
858 if test $fstype = no; then  
859 AC_TRY_CPP([#include <sys/mount.h>
860 #include <sys/fs_types.h>], AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix)
861 fi
862 AC_MSG_RESULT($fstype)
863
864 dnl# --------------------------------------------------------------------------
865 dnl# CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
866 dnl# --------------------------------------------------------------------------
867 AC_TYPE_SIGNAL
868 SIGNAL_CHECK
869 AC_TYPE_MODE_T
870 AC_TYPE_UID_T
871 AC_TYPE_SIZE_T
872 AC_TYPE_PID_T
873 AC_TYPE_OFF_T
874 AC_CHECK_TYPE(ino_t, unsigned long)
875 AC_CHECK_TYPE(dev_t, unsigned long)
876 AC_CHECK_TYPE(daddr_t, long)
877 AC_CHECK_TYPE(major_t, int)
878 AC_CHECK_TYPE(minor_t, int)
879 AC_CHECK_TYPE(ssize_t, int)
880 AC_STRUCT_ST_BLOCKS
881 AC_STRUCT_ST_RDEV
882 AC_STRUCT_TM
883 AC_C_CONST
884
885
886 AC_CHECK_SIZEOF(char, 1)
887 AC_CHECK_SIZEOF(short int, 2)
888 AC_CHECK_SIZEOF(int, 4)
889 AC_CHECK_SIZEOF(long int, 4)
890 AC_CHECK_SIZEOF(long long int, 8)
891 AC_CHECK_SIZEOF(int *, 4)
892
893 # Check for sys/types.h types
894 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
895     AC_TRY_COMPILE(
896         [ #include <sys/types.h> ], 
897         [ u_int a; a = 1;], 
898         [ ac_cv_have_u_int="yes" ],
899         [ ac_cv_have_u_int="no" ]
900     )
901 ])
902 if test "x$ac_cv_have_u_int" = "xyes" ; then
903    AC_DEFINE(HAVE_U_INT)
904    have_u_int=1
905 fi
906
907 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t, [
908    AC_TRY_COMPILE(
909       [ #include <sys/types.h> ], 
910       [ intmax_t a; a = 1;], 
911       [ ac_cv_have_intmax_t="yes" ],
912       [ 
913          AC_TRY_COMPILE(
914             [ #include <stdint.h> ], 
915             [ intmax_t a; a = 1;], 
916             [ ac_cv_have_intmax_t="yes" ],
917             [ ac_cv_have_intmax_t="no" ]
918          )
919       ]
920    )        
921
922 ])
923 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
924    AC_DEFINE(HAVE_INTMAX_T)
925    have_intmax_t=1
926 fi
927
928
929 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t, [
930    AC_TRY_COMPILE(
931       [ #include <sys/types.h> ], 
932       [ u_intmax_t a; a = 1;], 
933       [ ac_cv_have_u_intmax_t="yes" ],
934       [ 
935          AC_TRY_COMPILE(
936             [ #include <stdint.h> ], 
937             [ u_intmax_t a; a = 1;], 
938             [ ac_cv_have_u_intmax_t="yes" ],
939             [ ac_cv_have_u_intmax_t="no" ]
940          )
941       ]
942    )
943 ])
944 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
945    AC_DEFINE(HAVE_U_INTMAX_T)
946    have_u_intmax_t=1
947 fi
948
949
950 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
951    AC_TRY_COMPILE(
952       [ #include <sys/types.h> ], 
953       [ int8_t a; int16_t b; int32_t c; a = b = c = 1;], 
954       [ ac_cv_have_intxx_t="yes" ],
955       [ ac_cv_have_intxx_t="no" ]
956    )
957 ])
958 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
959    AC_DEFINE(HAVE_INTXX_T)
960    have_intxx_t=1
961 fi
962         
963 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
964    AC_TRY_COMPILE(
965       [ #include <sys/types.h> ], 
966       [ int64_t a; a = 1;], 
967       [ ac_cv_have_int64_t="yes" ],
968       [ ac_cv_have_int64_t="no" ]
969    )
970 ])
971 if test "x$ac_cv_have_int64_t" = "xyes" ; then
972    AC_DEFINE(HAVE_INT64_T)
973    have_int64_t=1
974 fi
975         
976 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
977    AC_TRY_COMPILE(
978       [ #include <sys/types.h> ], 
979       [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;], 
980       [ ac_cv_have_u_intxx_t="yes" ],
981       [ ac_cv_have_u_intxx_t="no" ]
982    )
983 ])
984 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
985    AC_DEFINE(HAVE_U_INTXX_T)
986    have_u_intxx_t=1
987 fi
988
989 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
990    AC_TRY_COMPILE(
991       [ #include <sys/types.h> ], 
992       [ u_int64_t a; a = 1;], 
993       [ ac_cv_have_u_int64_t="yes" ],
994       [ ac_cv_have_u_int64_t="no" ]
995    )
996 ])
997 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
998    AC_DEFINE(HAVE_U_INT64_T)
999    have_u_int64_t=1
1000 fi
1001
1002 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1003            test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1004 then
1005    AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1006    AC_TRY_COMPILE(
1007       [ #include <sys/bitypes.h>  ], 
1008       [ int8_t a; int16_t b; int32_t c;
1009         u_int8_t e; u_int16_t f; u_int32_t g;
1010         a = b = c = e = f = g = 1;  ], 
1011       [ AC_DEFINE(HAVE_U_INTXX_T)
1012         AC_DEFINE(HAVE_INTXX_T)
1013         AC_DEFINE(HAVE_SYS_BITYPES_H)
1014         AC_MSG_RESULT(yes) ],
1015       [ AC_MSG_RESULT(no)]
1016    ) 
1017 fi
1018
1019 if test -z "$have_u_intxx_t" ; then
1020    AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1021       AC_TRY_COMPILE(
1022          [ #include <sys/types.h> ], 
1023          [ uint8_t a; uint16_t b; 
1024            uint32_t c; a = b = c = 1; ], 
1025          [ ac_cv_have_uintxx_t="yes" ],
1026          [ ac_cv_have_uintxx_t="no" ]
1027       )
1028    ])
1029    if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1030       AC_DEFINE(HAVE_UINTXX_T)
1031    fi
1032 fi
1033
1034
1035 dnl# --------------------------------------------------------------------------
1036 dnl# CHECKING FOR LIBRARY FUNCTIONS
1037 dnl# --------------------------------------------------------------------------
1038 AC_CHECK_FUNCS( \
1039         fork \
1040         getcwd \
1041         gethostname \
1042         getpid \
1043         gettimeofday \
1044         setpgid \
1045         setpgrp \
1046         setsid \
1047         signal \
1048         strerror \
1049         strncmp \
1050         strncpy \
1051         vfprintf \
1052         ,,
1053         [echo 'configure: cannot find needed function.'; exit 1]
1054 )
1055
1056 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
1057
1058 AC_CHECK_FUNCS(snprintf vsnprintf gethostid getdomainname)
1059
1060 dnl# --------------------------------------------------------------------------
1061 dnl# CHECKING FOR THREAD SAFE FUNCTIONS
1062 dnl# --------------------------------------------------------------------------
1063 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
1064
1065 # If resolver functions are not in libc check for -lnsl or -lresolv.
1066 AC_CHECK_FUNC(gethostbyname_r,
1067     AC_MSG_RESULT(using libc's resolver),
1068     AC_CHECK_LIB(nsl,gethostbyname_r)
1069     AC_CHECK_LIB(resolv,gethostbyname_r))
1070
1071
1072 # Find where sockets are (especially for Solaris)
1073 AC_CHECK_FUNC(socket,
1074     AC_MSG_RESULT(using libc's socket),
1075     AC_CHECK_LIB(xnet,socket)
1076     AC_CHECK_LIB(socket,socket)
1077     AC_CHECK_LIB(inet,socket))
1078
1079 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
1080
1081 AC_FUNC_STRFTIME
1082 AC_FUNC_VPRINTF
1083 AC_FUNC_ALLOCA
1084 AC_FUNC_GETMNTENT
1085 AC_FUNC_CLOSEDIR_VOID
1086 AC_FUNC_SETPGRP                       dnl check for BSD setpgrp.
1087 AC_FUNC_FNMATCH
1088
1089
1090 dnl# FreeBSD needs to link libxpg4
1091 AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"])
1092
1093
1094 AC_CHECK_LIB(sun, getpwnam)
1095
1096 AC_CHECK_HEADERS(zlib.h)
1097 AC_CHECK_LIB(z, deflate, [FDLIBS="-lz"])
1098 have_zlib=no
1099 if test x$FDLIBS = x-lz; then
1100   AC_DEFINE(HAVE_LIBZ)
1101   have_zlib=yes
1102 fi
1103
1104 dnl Check for pthread libraries
1105 PTHREAD_LIB=""
1106 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
1107         [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
1108             [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
1109                 [AC_CHECK_FUNC(pthread_create)]
1110             )]
1111         )]
1112 )
1113
1114 AC_SUBST(FDLIBS)
1115 AC_DEFINE(FDLIBS)
1116
1117
1118 CFLAGS=${CFLAGS--O}
1119 LDFLAGS=${LDFLAGS--O}
1120 DB_LIBS="${SQL_LFLAGS}"
1121
1122 CPPFLAGS="$CPPFLAGS"
1123 AC_SUBST(DEBUG)
1124 AC_SUBST(DINCLUDE)
1125 AC_SUBST(CFLAGS)
1126 AC_SUBST(CPPFLAGS)
1127 AC_SUBST(LDFLAGS)
1128 AC_SUBST(X_CFLAGS)
1129 AC_SUBST(LIBS)
1130 AC_SUBST(DLIB)
1131 AC_SUBST(DB_LIBS)
1132 AC_SUBST(X_LIBS)
1133 AC_SUBST(X_EXTRA_LIBS)
1134
1135 dnl# extra configurable objects
1136 OBJLIST=
1137 AC_SUBST(OBJLIST)
1138
1139 lld="lld"
1140 llu="llu"
1141
1142 #
1143 # Finally we set appropriate distribution specific
1144 #  variables and defaults
1145 #
1146 # PFILES are platform specific files
1147 PFILES="platforms/Makefile"
1148 PSCMD="ps -e"
1149 WIN32=
1150 hostname=`hostname`
1151 case "$DISTNAME" in
1152 alpha)
1153         DISTVER=`uname -r`
1154         PTHREAD_LIB="-lpthread -lexc"
1155         if test "${CC}" = "gcc" ; then
1156            lld="lld"
1157            llu="llu"
1158         else
1159            lld="ld"
1160            llu="lu"
1161         fi
1162         TAPEDRIVE="/dev/nrmt0"
1163   ;;
1164 bsdi)
1165         DISTVER=`uname -a |awk '{print $3}'`
1166         TAPEDRIVE="/dev/nrst0"
1167   ;;
1168 caldera)
1169         DISTVER=`cat /etc/.issue | grep Version | cut -f 2 -d ' '`
1170         TAPEDRIVE="/dev/nrst0"
1171         PSCMD="ps -e -o pid,command"
1172         hostname=`hostname -s`
1173   ;;
1174 cygwin)
1175         DISTVER=`uname -a |awk '{print $3}'`
1176         TAPEDRIVE="/dev/nrst0"
1177         WIN32=win32
1178         CFLAGS="${CFLAGS} -mwindows"
1179         LDFLAGS="${LDFLAGS} -mwindows"
1180   ;;
1181 darwin)
1182         DISTVER=`uname -r`
1183         TAPEDRIVE="/dev/nst0"
1184         PSCMD="ps -e -o pid,command"
1185         hostname=`hostname -s`
1186         PFILES="${PFILES} \
1187            platforms/darwin/Makefile"
1188   ;;
1189 debian)
1190         DISTVER=`cat /etc/debian_version`
1191         TAPEDRIVE="/dev/nrst0"
1192         PSCMD="ps -e -o pid,command"
1193         hostname=`hostname -s`
1194   ;;
1195 freebsd)
1196         DISTVER=`uname -a |awk '{print $3}'`
1197         PTHREAD_LIB="-pthread"
1198         CFLAGS="${CFLAGS} -pthread"
1199         lld="qd"
1200         llu="qu"
1201         TAPEDRIVE="/dev/nrst0"
1202         PSCMD="ps -x -o pid,command"
1203         PFILES="${PFILES} \
1204             platforms/freebsd/Makefile \
1205             platforms/freebsd/bacula-fd \
1206             platforms/freebsd/bacula-sd \
1207             platforms/freebsd/bacula-dir"
1208         hostname=`hostname -s`
1209         largefile_support="yes"
1210   ;;
1211 hpux)
1212         DISTVER=`uname -r`
1213         TAPEDRIVE="/dev/rmt/0hnb"
1214   ;;
1215 irix)
1216         DISTVER=`uname -r`
1217         TAPEDRIVE="/dev/rmt/0cbn"
1218         PSCMD="ps -e -o pid,comm"
1219         hostname=`/usr/bsd/hostname -s`
1220         PFILES="${PFILES} \
1221             platforms/irix/Makefile \
1222             platforms/irix/bacula-fd \
1223             platforms/irix/bacula-sd \
1224             platforms/irix/bacula-dir"
1225   ;;
1226 netbsd)
1227         DISTVER=`uname -a |awk '{print $3}'`
1228         lld="qd"
1229         llu="qu"
1230         TAPEDRIVE="/dev/nrst0"
1231         PSCMD="ps -a -o pid,command"
1232         PTHREAD_LIB="-pthread"
1233         CFLAGS="${CFLAGS} -pthread"
1234   ;;
1235 openbsd)
1236         DISTVER=`uname -a |awk '{print $3}'`
1237         lld="qd"
1238         llu="qu"
1239         TAPEDRIVE="/dev/nrst0"
1240         PSCMD="ps -a -o pid,command"
1241         PTHREAD_LIB="-pthread"
1242         CFLAGS="${CFLAGS} -pthread"
1243         PFILES="${PFILES} \
1244             platforms/openbsd/Makefile \
1245             platforms/openbsd/bacula-fd \
1246             platforms/openbsd/bacula-sd \
1247             platforms/openbsd/bacula-dir"
1248   ;;
1249 redhat)
1250         DISTVER=`cat /etc/redhat-release | grep release |\
1251                                 cut -f 5 -d ' '`
1252         TAPEDRIVE="/dev/nst0"
1253         PSCMD="ps -e -o pid,command"
1254         PFILES="${PFILES} \
1255             platforms/redhat/Makefile \
1256             platforms/redhat/bacula-fd \
1257             platforms/redhat/bacula-sd \
1258             platforms/redhat/bacula-dir"
1259         hostname=`hostname -s`
1260   ;;
1261 gentoo)
1262         DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
1263         TAPEDRIVE="/dev/nst0"
1264         PSCMD="ps -e -o pid,command"
1265         PFILES="${PFILES} \
1266             platforms/gentoo/Makefile \
1267             platforms/gentoo/bacula-fd \
1268             platforms/gentoo/bacula-sd \
1269             platforms/gentoo/bacula-dir"
1270         hostname=`hostname -s`
1271   ;;
1272
1273 slackware)
1274         DISTVER=`cat /etc/slackware-version`
1275         TAPEDRIVE="/dev/nst0"
1276         PSCMD="ps -e -o pid,command"
1277         hostname=`hostname -s`
1278   ;;
1279 solaris)
1280         DISTVER=Solaris
1281         TAPEDRIVE="/dev/rmt/0cbn"
1282         PSCMD="ps -e -o pid,comm"
1283         PFILES="${PFILES} \
1284             platforms/solaris/Makefile \
1285             platforms/solaris/bacula-fd \
1286             platforms/solaris/bacula-sd \
1287             platforms/solaris/bacula-dir"
1288   ;;
1289 suse)
1290         DISTVER=`cat /etc/SuSE-release |grep VERSION|\
1291                                 cut -f 3 -d ' '`
1292         TAPEDRIVE="/dev/nst0"
1293         PSCMD="ps -e -o pid,command"
1294         hostname=`hostname -s`
1295   ;;
1296 suse5)
1297         DISTNAME=suse
1298         DISTVER=5.x
1299         TAPEDRIVE="/dev/nst0"
1300         PSCMD="ps -e -o pid,command"
1301         hostname=`hostname -s`
1302   ;;
1303 unknown)
1304         DISTVER=unknown
1305         TAPEDRIVE="/dev/nst0"
1306   ;;
1307 *)
1308   echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
1309   ;;
1310 esac  
1311
1312 AC_SUBST(hostname)
1313
1314
1315 LIBS="$PTHREAD_LIB $LIBS"
1316
1317 AC_DEFINE_UNQUOTED(lld, "$lld")
1318 AC_DEFINE_UNQUOTED(llu, "$llu")
1319 AC_SUBST(TAPEDRIVE)
1320 AC_SUBST(PSCMD)
1321 AC_SUBST(WIN32)
1322 AC_SUBST(DISTNAME)
1323 AC_SUBST(DISTVER)
1324
1325
1326 dnl# common parts of the Makefile
1327 MCOMMON=./autoconf/Make.common
1328 AC_SUBST_FILE(MCOMMON)
1329
1330 AC_OUTPUT([autoconf/Make.common \
1331            Makefile \
1332            rescue/Makefile \
1333            rescue/linux/Makefile \
1334            rescue/freebsd/Makefile \
1335            rescue/solaris/Makefile \
1336            scripts/startmysql \
1337            scripts/stopmysql \
1338            scripts/btraceback \
1339            scripts/startit \
1340            scripts/stopit \
1341            scripts/console \
1342            scripts/gconsole \
1343            scripts/bacula \
1344            scripts/fd \
1345            scripts/Makefile \
1346            scripts/logrotate \
1347            doc/Makefile \
1348            src/Makefile \
1349            src/console/Makefile \
1350            src/console/console.conf \
1351            src/gnome-console/Makefile \
1352            src/gnome-console/gnome-console.conf \
1353            src/tconsole/Makefile \
1354            src/dird/Makefile \
1355            src/dird/bacula-dir.conf \
1356            src/lib/Makefile \
1357            src/stored/Makefile \
1358            src/stored/bacula-sd.conf \
1359            src/filed/Makefile \
1360            src/filed/host.h \
1361            src/filed/bacula-fd.conf \
1362            src/filed/win32/Makefile \
1363            src/cats/Makefile \
1364            src/cats/make_catalog_backup \
1365            src/cats/delete_catalog_backup \
1366            src/cats/alter_mysql_tables \
1367            src/cats/make_mysql_tables \
1368            src/cats/drop_mysql_tables \
1369            src/cats/create_mysql_database \
1370            src/cats/grant_mysql_privileges \
1371            src/cats/alter_sqlite_tables \
1372            src/cats/make_sqlite_tables \
1373            src/cats/drop_sqlite_tables \
1374            src/cats/create_sqlite_database \
1375            src/cats/sqlite \
1376            src/cats/mysql \
1377            src/cats/create_bdb_database \
1378            src/cats/make_bdb_tables \
1379            src/cats/drop_bdb_tables \
1380            src/cats/make_bacula_tables \
1381            src/cats/drop_bacula_tables \
1382            src/findlib/Makefile \
1383            src/tools/Makefile \
1384            $PFILES ],  
1385           [(echo "Doing make of dependencies"; make depend;) ]
1386 )
1387
1388 cd scripts
1389 chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
1390 chmod 755 console gconsole
1391 cd ..
1392 chmod 755 src/cats/make_mysql_tables src/cats/drop_mysql_tables
1393 chmod 755 src/cats/make_test_tables src/cats/drop_test_tables
1394 chmod 755 src/cats/create_mysql_database 
1395 chmod 755 src/cats/make_catalog_backup src/cats/delete_catalog_backup
1396 chmod 755 src/cats/alter_mysql_tables
1397 chmod 755 src/cats/grant_mysql_privileges
1398 chmod 755 src/cats/make_sqlite_tables src/cats/drop_sqlite_tables 
1399 chmod 755 src/cats/make_bacula_tables src/cats/drop_bacula_tables 
1400 chmod 755 src/cats/create_sqlite_database
1401 chmod 755 src/cats/alter_sqlite_tables
1402 chmod 755 src/cats/sqlite
1403 chmod 755 src/cats/make_bdb_tables src/cats/drop_bdb_tables 
1404 chmod 755 src/cats/create_bdb_database
1405
1406 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
1407    largefile_support="yes"
1408 fi
1409
1410
1411 echo "
1412 Configuration on `date`:
1413
1414   Host:                       $host -- ${DISTNAME} ${DISTVER}
1415   Bacula version:             ${VERSION} (${DATE})
1416   Source code location:       ${srcdir}
1417   Install binaries:           ${sbindir}
1418   Install config files:       ${sysconfdir}
1419   Scripts directory           ${scriptdir}
1420   Working directory           ${working_dir}
1421   C Compiler:                 ${CC}
1422   C++ Compiler:               ${CXX}
1423   Compiler flags:             ${CFLAGS} 
1424   Linker flags:               ${LDFLAGS}
1425   Libraries:                  ${LIBS}
1426   Statically Linked Tools:    ${support_static_tools}
1427   Statically Linked FD:       ${support_static_fd}
1428   Statically Linked SD:       ${support_static_sd}
1429   Statically Linked DIR:      ${support_static_dir}
1430   Statically Linked CONS:     ${support_static_cons}
1431   Database type:              ${db_name}
1432   Database lib:               ${DB_LIBS}
1433
1434   Job Output Email:           ${job_email}
1435   Traceback Email:            ${dump_email}
1436   SMTP Host Address:          ${smtp_host}
1437   Director Port               ${dir_port}
1438   File daemon Port            ${fd_port}
1439   Storage daemon Port         ${sd_port}
1440   SQL binaries Directory      ${SQL_BINDIR}
1441
1442   Large file support:         $largefile_support
1443   readline support:           ${got_readline} ${PRTREADLINE_SRC}
1444   TCP Wrappers support:       ${TCPW_MSG}
1445   ZLIB support:               ${have_zlib}
1446   enable-smartalloc:          ${support_smartalloc} 
1447   enable-gnome:               ${support_gnome}
1448   client-only:                ${build_client_only}
1449
1450   " > config.out
1451
1452 cat config.out
1453
1454 # old stuff
1455 # cweb support:               ${got_cweb} ${CWEB_SRC}
1456 # gmp support:                ${got_gmp} ${GMP_SRC}