]> git.sur5r.net Git - bacula/bacula/blob - bacula/autoconf/configure.in
Don't use uname -i but uname -p
[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_SUBST(TOP_DIR)
12 AC_CONFIG_AUX_DIR(${BUILD_DIR}/autoconf)
13 AC_CONFIG_HEADER(src/config.h:autoconf/config.h.in)
14
15 dnl minimal Win32 stuff for "make clean"
16 WIN32BUILDDIR=${BUILD_DIR}/src/win32
17 WIN32MAINDIR=${BUILD_DIR}
18 WIN32TOPDIR=${TOP_DIR}    
19 AC_SUBST(WIN32BUILDDIR)
20 AC_SUBST(WIN32MAINDIR)
21 AC_SUBST(WIN32TOPDIR)
22
23 dnl require a recent autoconf
24 AC_PREREQ(2.61)
25
26
27 dnl search for true and false programs.
28 AC_PATH_PROGS(TRUEPRG, true, :)
29 AC_PATH_PROGS(FALSEPRG, false, :)
30
31
32 dnl bacula version
33 post_host=
34 if test "x$BACULA" != x; then
35    post_host=`echo -${BACULA} | tr 'A-Z ' 'a-z-'`
36 fi
37 BACULA=${BACULA:-Bacula}
38 VERSION=`sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
39 DATE=`sed -n -e 's/^.*[ \t]*BDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
40 LSMDATE=`sed -n -e 's/^.*LSMDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
41 AC_SUBST(VERSION)dnl 
42 AC_SUBST(DATE)dnl 
43 AC_SUBST(LSMDATE)dnl 
44 AC_SUBST(BACULA)dnl
45 AC_SUBST(post_host)dnl
46 echo "configuring for ${BACULA} $VERSION ($DATE)"
47
48 dnl -------------------------------------------------------
49 dnl Check for compiler.
50 dnl ------------------------------------------------------
51
52 AC_PROG_CC
53 AC_PROG_CXX
54 AC_PROG_CC_C_O         dnl Determine if C compiler support -c -o.
55 AC_PROG_GCC_TRADITIONAL    dnl Determine if ioctl() need -traditional.
56
57 BASECC=`basename $CC`
58 have_gcc=no
59 if test "x$BASECC" = xgcc; then
60    AC_DEFINE(HAVE_GCC)
61    have_gcc=yes
62 fi
63 AC_PATH_PROG(CXX, $CXX, $CXX)
64 if test ! -e $CXX; then
65    AC_MSG_ERROR(Unable to find C++ compiler)
66 fi
67
68 dnl -------------------------------------------------------
69 dnl Check for programs.
70 dnl ------------------------------------------------------
71 AC_PROG_INSTALL
72 AC_PATH_PROG(MV, mv, mv)
73 dnl Alert !!!
74 dnl If we name the variable RM it will shadow the RM variable in the configure script and we overwrite the
75 dnl value with the name of the rm command and not rm -f which is its normal content. This gives all kind
76 dnl of strange output of the configure script (like things don't exist etc.).
77 dnl So we name it REMOVE (more software has run into this problem)
78 AC_PATH_PROG(REMOVE, rm, rm)
79 AC_PATH_PROG(CP, cp, cp)
80 AC_PATH_PROG(SED, sed, sed)
81 AC_PATH_PROG(ECHO, echo, echo)
82 AC_PATH_PROG(CMP, cmp, cmp)
83 AC_PATH_PROG(TBL, tbl, tbl)
84 AC_PATH_PROG(AR, ar, ar)
85 AC_PATH_PROG(OPENSSL, openssl, none)
86 AC_PATH_PROG(MTX, mtx, mtx)
87 AC_PATH_PROG(DD, dd, dd)
88 AC_PATH_PROG(MKISOFS, mkisofs, mkisofs)
89 AC_PATH_PROG(PYTHON, python, python)
90 AC_PATH_PROG(GROWISOFS, growisofs, growisofs)
91 AC_PATH_PROG(DVDRWMEDIAINFO, dvd+rw-mediainfo, dvd+rw-mediainfo)
92 AC_PATH_PROG(DVDRWFORMAT, dvd+rw-format, dvd+rw-format)
93 AC_PATH_PROG(PKGCONFIG, pkg-config, pkg-config)
94 AC_PATH_PROG(QMAKE, qmake, none)
95 AC_PATH_PROG(QMAKEQT4, qmake-qt4, none)
96 AC_PATH_PROG(GMAKE, gmake, none)
97 AC_ARG_VAR(WXCONFIG, [wx-config command. On some systems, you must set it to wx-config-2.6 to use wxWidgets 2.6.])
98 if test "x$WXCONFIG" = x; then
99    WXCONFIG=wx-config
100 fi
101 AC_PATH_PROG(WXCONFIG, ${WXCONFIG}, ${WXCONFIG})
102 AC_ARG_VAR(WXFLAGS, [Parameters to pass to wx-config (e.g. --unicode=no).])
103 AC_PATH_PROG(CDRECORD, cdrecord, cdrecord)
104 AC_PATH_PROG(PIDOF, pidof, pidof)
105 AC_PROG_AWK
106 # Some AWK programs fail, so test it and warn the user
107 if echo xfoo | $AWK 'BEGIN { prog=ARGV[1]; ARGC=1 } 
108       { if ((prog == $2) || (("(" prog ")") == $2) ||
109       (("[" prog "]") == $2) ||
110       ((prog ":") == $2)) { print $1 ; exit 0 } }' xfoo>/dev/null; then :;
111 else
112   AC_MSG_ERROR([!!!!!!!!! WARNING !!!!!!!!!!!!!!
113    The regex engine of $AWK is too broken to be used you 
114    might want to install GNU AWK.
115    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!])
116 fi
117 THE_AWK=$AWK
118 AC_PATH_PROG(AWK, $THE_AWK, $THE_AWK)
119
120
121 test -n "$ARFLAG" || ARFLAGS="cr"
122 AC_SUBST(ARFLAGS)
123
124 MAKE_SHELL=/bin/sh
125 AC_SUBST(MAKE_SHELL)
126
127 AC_SUBST(LOCAL_LIBS)
128 AC_SUBST(LOCAL_CFLAGS)
129 AC_SUBST(LOCAL_LDFLAGS)
130 AC_SUBST(LOCAL_DEFS)
131
132 dnl --------------------------------------------------
133 dnl Libtool config
134 dnl --------------------------------------------------
135 AC_ARG_ENABLE(libtool,
136    AC_HELP_STRING([--enable-libtool], [enable building using GNU libtool @<:@default=yes@:>@]),
137    [
138        if test x$enableval = xno; then
139           use_libtool=no
140        fi
141    ]
142 )
143 LT_INIT([shared disable-static])
144 LT_LANG([C++])
145
146 if test x$use_libtool != xno; then
147    DEFAULT_OBJECT_TYPE=".lo"
148    DEFAULT_ARCHIVE_TYPE=".la"
149    DEFAULT_SHARED_OBJECT_TYPE=".la"
150    LIBTOOL="\$(LIBTOOL)"
151    LIBTOOL_INSTALL_TARGET="libtool-install"
152    LIBTOOL_UNINSTALL_TARGET="libtool-uninstall"
153    LIBTOOL_CLEAN_TARGET="libtool-clean"
154    QMAKE_LIBTOOL="${BUILD_DIR}/libtool"
155 else
156    DEFAULT_OBJECT_TYPE=".o"
157    DEFAULT_ARCHIVE_TYPE=".a"
158    DEFAULT_SHARED_OBJECT_TYPE=".so"
159    LIBTOOL="# \$(LIBTOOL)"
160    LIBTOOL_INSTALL_TARGET=""
161    LIBTOOL_UNINSTALL_TARGET=""
162    LIBTOOL_CLEAN_TARGET=""
163    QMAKE_LIBTOOL="# ${BUILD_DIR}/libtool"
164 fi
165
166 AC_SUBST(DEFAULT_OBJECT_TYPE)
167 AC_SUBST(DEFAULT_ARCHIVE_TYPE)
168 AC_SUBST(DEFAULT_SHARED_OBJECT_TYPE)
169 AC_SUBST(LIBTOOL)
170 AC_SUBST(LIBTOOL_INSTALL_TARGET)
171 AC_SUBST(LIBTOOL_UNINSTALL_TARGET)
172 AC_SUBST(LIBTOOL_CLEAN_TARGET)
173 AC_SUBST(QMAKE_LIBTOOL)
174
175 dnl --------------------------------------------------
176 dnl Include file handling
177 dnl --------------------------------------------------
178 AC_ARG_ENABLE(includes,
179    AC_HELP_STRING([--enable-includes], [enable installing of include files @<:@default=no@:>@]),
180    [
181        if test x$enableval = xyes; then
182           install_includes=yes
183        fi
184    ]
185 )
186
187 dnl It only makes sense to install include files when you install libraries which only happens when
188 dnl libtool is enabled
189
190 if test x$use_libtool != xno -a x$install_includes = xyes; then
191    INCLUDE_INSTALL_TARGET="install-includes"
192    INCLUDE_UNINSTALL_TARGET="uninstall-includes"
193 else
194    INCLUDE_INSTALL_TARGET=""
195    INCLUDE_UNINSTALL_TARGET=""
196 fi
197 AC_SUBST(INCLUDE_INSTALL_TARGET)
198 AC_SUBST(INCLUDE_UNINSTALL_TARGET)
199
200 dnl --------------------------------------------------
201 dnl Bacula OP Sys determination (see aclocal.m4)
202 dnl --------------------------------------------------
203 BA_CHECK_OPSYS
204
205 dnl -----------------------------------------------------------
206 dnl Bacula OPSys Distribution determination (see aclocal.m4)
207 dnl ----------------------------------------------------------
208 BA_CHECK_OPSYS_DISTNAME
209
210 dnl --------------------------------------------------
211 dnl Suppport for gettext (translations)
212 dnl By default, $datarootdir is ${prefix}/share
213 dnl --------------------------------------------------
214 AM_GNU_GETTEXT([external])
215
216 dnl ------------------------------------------------------------------
217 dnl If the user has not set --prefix, we set our default to nothing.
218 dnl In this case, if the user has not set --sysconfdir, we set it
219 dnl to the package default of /etc/bacula.  If either --prefix or
220 dnl --sysconfdir is set, we leave sysconfdir alone except to eval it.
221 dnl If the user has not set --libdir, we set it to the package
222 dnl default of /usr/lib. If either --prefix or --libdir is set,
223 dnl we leave libdir alone except to eval it. If the user has not set
224 dnl --includedir, we set it to the package default of /usr/include.
225 dnl If either --prefix or --includedir is set, we leave includedir
226 dnl alone except to eval it
227 dnl ------------------------------------------------------------------
228 os_name=`uname -s`
229 os_processor=`uname -p`
230 if test x${prefix} = xNONE ; then
231    if test `eval echo ${sysconfdir}` = NONE/etc ; then
232       sysconfdir=/etc/bacula
233    fi
234
235    if test `eval echo ${libdir}` = NONE/lib ; then
236       case ${os_name} in
237       Linux)
238          case ${os_processor} in
239          x86_64)
240             libdir=/usr/lib64
241             ;;
242          *)
243             libdir=/usr/lib
244             ;;
245          esac
246          ;;
247       *)
248          libdir=/usr/lib
249          ;;
250       esac
251    fi
252
253    if test `eval echo ${includedir}` = NONE/include ; then
254       includedir=/usr/include
255    fi
256
257    if test `eval echo ${datarootdir}` = NONE/share ; then
258       datarootdir=/usr/share
259    fi
260    prefix=
261 fi
262
263 dnl -------------------------------------------------------------------------
264 dnl  If the user has not set --exec-prefix, we default to ${prefix}
265 dnl -------------------------------------------------------------------------
266 if test x${exec_prefix} = xNONE ; then
267    exec_prefix=${prefix}
268 fi
269
270 sysconfdir=`eval echo ${sysconfdir}`
271 datarootdir=`eval echo ${datarootdir}`
272 docdir=`eval echo ${docdir}`
273 htmldir=`eval echo ${htmldir}`
274 libdir=`eval echo ${libdir}`
275 includedir=`eval echo ${includedir}`
276 localedir=`eval echo ${datarootdir}/locale`
277 AC_DEFINE_UNQUOTED(SYSCONFDIR, "$sysconfdir")
278 AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir") 
279
280 dnl ------------------------------------------------------------------
281 dnl If the user has not set --sbindir, we set our default as /sbin
282 dnl ------------------------------------------------------------------
283 if test x$sbindir = x'${exec_prefix}/sbin' ; then
284    sbindir=${exec_prefix}/sbin
285 fi
286 sbindir=`eval echo ${sbindir}`
287
288 dnl -------------------------------------------------------------------------
289 dnl  If the user has not set --mandir, we default to /usr/share/man
290 dnl -------------------------------------------------------------------------
291 if test x$mandir = x'${prefix}/man' ; then
292    mandir=/usr/share/man
293 fi
294
295 dnl -------------------------------------------------------------------------
296 dnl  If the user has not set --htmldir, we default to /usr/share/doc/bacula/html
297 dnl -------------------------------------------------------------------------
298 if test x$htmldir = x${docdir} ; then
299    htmldir=`eval echo ${docdir}bacula/html`
300 fi
301
302 dnl -------------------------------------------------------------------------
303 dnl  If the user has not set --docdir, we default to /usr/share/doc/
304 dnl -------------------------------------------------------------------------
305 if test x$docdir = x'/usr/share/doc/' ; then
306    docdir=`eval echo ${docdir}bacula`
307 fi
308
309             
310 AC_PATH_PROGS(MSGFMT, msgfmt, no)
311 if test "$MSGFMT" = "no"
312 then
313    echo 'msgfmt program not found, disabling NLS !'
314    USE_NLS=no
315    USE_INCLUDED_LIBINTL=no
316 #else
317    AM_GNU_GETTEXT
318 fi
319
320 support_mysql=no
321 support_sqlite=no
322 support_sqlite3=no
323 support_postgresql=no
324 support_dbi=no
325 support_smartalloc=yes
326 support_readline=yes
327 support_conio=yes
328 support_gnome=no
329 support_bat=no
330 support_wx_console=no
331 support_tray_monitor=no
332 support_tls=no
333 support_crypto=no
334 gnome_version=
335 wx_version=
336 support_static_tools=no
337 support_static_fd=no
338 support_static_sd=no
339 support_static_dir=no
340 support_static_cons=no
341 support_python=no
342 build_client_only=no
343 build_dird=yes
344 build_stored=yes
345 cats=
346 db_type=Internal
347 support_lockmgr=no
348 DB_TYPE=bdb
349
350 dnl --------------------------------------------------------------------------
351 dnl CHECKING COMMAND LINE OPTIONS
352 dnl --------------------------------------------------------------------------
353
354 dnl -------------------------------------------
355 dnl gnome (default off)
356 dnl -------------------------------------------
357 AC_ARG_ENABLE(gnome,
358    AC_HELP_STRING([--enable-gnome], [enable build of bgnome-console GUI @<:@default=no@:>@]),
359    [
360        if test x$enableval = xyes; then
361           support_gnome=yes
362        fi
363    ]
364 )
365
366 GNOME_DIR=
367 if test x$support_gnome = xyes; then
368    AC_MSG_ERROR(bgnome-console no longer supported)
369    AC_MSG_ERROR(--enable-gnome option no longer supported)
370 fi
371 # AC_SUBST(GNOME_DIR)
372
373 dnl -------------------------------------------
374 dnl bat (default off)
375 dnl -------------------------------------------
376 AC_ARG_ENABLE(bat,
377    AC_HELP_STRING([--enable-bat], [enable build of bat Qt4 GUI @<:@default=no@:>@]),
378    [
379        if test x$enableval = xyes; then
380           AC_DEFINE(HAVE_BAT, 1, [Set if Bacula bat Qt4 GUI support enabled]) 
381           support_bat=yes
382        fi
383    ]
384 )
385
386 BAT_DIR=
387 if test x$support_bat = xyes; then
388    abc=`$PKGCONFIG --atleast-version=4.2 QtGui`
389    pkg=$?
390    if test $pkg = 0; then
391       BAT_DIR=src/qt-console
392    else
393       AC_MSG_ERROR(Unable to find Qt4 installation needed by bat)
394    fi
395 fi
396
397 dnl 
398 dnl  If bat is enabled, we need the qwt library
399 dnl 
400 got_qwt=no
401 QWT_INC=
402 QWT_LDFLAGS=
403 QWT_LIB=
404 QWT=
405 no_qwt=no
406 if test x$support_bat = xyes; then
407    AC_MSG_CHECKING(for qwt support)
408    AC_ARG_WITH(qwt,
409       AC_HELP_STRING([--with-qwt@<:@=DIR@:>@], [specify qwt library directory]),
410       [
411           case "$with_qwt" in
412           no)
413              no_qwt=yes
414              ;;
415           yes|*)
416              if test -f ${with_qwt}/include/qwt.h; then
417                 QWT_INC="${with_qwt}/include"
418                 QWT_LDFLAGS="-L${with_qwt}/lib"
419                 QWT_LIB="-lqwt"
420                 QWT="qwt"
421              fi
422              ;;
423           esac
424       ]    
425    )
426
427    dnl
428    dnl Search in standard places, or --with-qwt not specified
429    dnl
430    if test $no_qwt = no; then 
431       if test x$QWT_INC = x; then
432          for root in /usr /usr/local; do
433             for ver in qwt qwt5 qwt-qt4; do
434                if test -f ${root}/include/${ver}/qwt.h; then
435                   QWT_INC="${root}/include/${ver}"
436                   if test -d ${root}/lib64/; then
437                      QWT_LDFLAGS="-L${root}/lib64"
438                   elif test -d ${root}/lib/64/; then
439                      QWT_LDFLAGS="-L${root}/64"
440                   else
441                      QWT_LDFLAGS="-L${root}/lib"
442                   fi
443                   QWT_LIB="-lqwt"
444                   QWT="qwt"
445                   got_qwt=yes
446                   break;
447                fi
448             done
449          done
450       fi
451    fi
452    if test x$QWT_INC = x; then
453       AC_MSG_RESULT(no)
454    else
455       AC_DEFINE(HAVE_QWT, 1, [Set if bat QWT library found])
456       AC_MSG_RESULT(yes)
457    fi
458 fi
459
460 AC_SUBST(BAT_DIR)
461 AC_SUBST(QWT_INC)
462 AC_SUBST(QWT_LDFLAGS)
463 AC_SUBST(QWT_LIB)
464 AC_SUBST(QWT)
465
466 dnl -------------------------------------------
467 dnl bwx-console (default off)
468 dnl -------------------------------------------
469 AC_ARG_ENABLE(bwx-console,
470    AC_HELP_STRING([--enable-bwx-console], [enable build of wxWidgets console @<:@default=no@:>@]),
471    [
472        if test x$enableval = xyes; then
473           support_wx_console=yes
474        fi
475    ]
476 )
477
478 WX_DIR=
479 if test x$support_wx_console = xyes; then
480    abc=`$WXCONFIG $WXFLAGS --cppflags`
481    pkg=$?
482    if test $pkg = 0; then
483       wx_version="wxWidgets `$WXCONFIG $WXFLAGS --release`"
484       WXCONS_CPPFLAGS=`$WXCONFIG $WXFLAGS --cppflags`
485       WXCONS_LDFLAGS=`$WXCONFIG $WXFLAGS --libs`
486
487       AC_SUBST(WXCONS_CPPFLAGS)
488       AC_SUBST(WXCONS_LDFLAGS)
489       WX_DIR="src/wx-console"
490    else
491       echo " "
492       echo "wx-config program not found. bwx-console disabled."
493       echo " "
494       support_wx_console=no
495    fi
496 fi
497 AC_SUBST(WX_DIR)
498
499 dnl -------------------------------------------
500 dnl tray-monitor (default off)
501 dnl -------------------------------------------
502 AC_ARG_ENABLE(tray-monitor,
503    AC_HELP_STRING([--enable-tray-monitor], [enable build of Gnome tray monitor (compatible with KDE @<:@default=no@:>@]),
504    [
505        if test x$enableval = xyes; then
506           support_tray_monitor=yes
507        fi
508    ]
509 )
510
511 TRAY_MONITOR_DIR=
512 if test x$support_tray_monitor = xyes; then
513    abc=`$PKGCONFIG --exists gtk+-2.0`
514    pkg=$?
515    if test $pkg = 0; then
516       TRAY_MONITOR_CPPFLAGS=`$PKGCONFIG --cflags gtk+-2.0`
517       TRAY_MONITOR_LDFLAGS=`$PKGCONFIG --libs gtk+-2.0`
518       AC_SUBST(TRAY_MONITOR_CPPFLAGS)
519       AC_SUBST(TRAY_MONITOR_LDFLAGS)
520       TRAY_MONITOR_DIR=src/tray-monitor
521       abc=`$PKGCONFIG --atleast-version=2.4 gtk+-2.0`
522       pkg=$?
523       if test $pkg = 0; then
524          AC_DEFINE(HAVE_GTK_2_4, 1, [Set if you have GTK 4.2 or greater loaded])
525       fi
526    fi
527 fi
528 AC_SUBST(TRAY_MONITOR_DIR)
529
530 dnl -------------------------------------------
531 dnl smartalloc (default off)
532 dnl -------------------------------------------
533 AC_ARG_ENABLE(smartalloc,
534    AC_HELP_STRING([--enable-smartalloc], [enable smartalloc debugging support @<:@default=no@:>@]),
535    [
536        if test x$enableval = xno; then
537           support_smartalloc=no
538        fi
539    ]
540 )
541
542 if test x$support_smartalloc = xyes; then
543    AC_DEFINE(SMARTALLOC, 1, [Set if you want Smartalloc enabled])
544 fi
545
546 dnl -------------------------------------------
547 dnl Lock Manager (default off)
548 dnl -------------------------------------------
549 AC_ARG_ENABLE(lockmgr,
550    AC_HELP_STRING([--enable-lockmgr], [enable lock manager support @<:@default=no@:>@]),
551    [
552        if test x$enableval = xyes; then
553           support_lockmgr=yes
554        fi
555    ]
556 )
557
558 if test x$support_lockmgr = xyes; then
559    AC_DEFINE(_USE_LOCKMGR, 1, [Set if you want Lock Manager enabled])
560 fi
561
562
563 dnl -------------------------------------------
564 dnl static-tools (default off)
565 dnl -------------------------------------------
566 AC_ARG_ENABLE(static-tools,
567    AC_HELP_STRING([--enable-static-tools], [enable static tape tools @<:@default=no@:>@]),
568    [
569        if test x$enableval = xyes; then
570           if test x$use_libtool = xyes; then
571              AC_MSG_ERROR([Libtool is enabled, not compatible with static tools, 
572   please rerun configure with --disable-libtool])
573           fi
574           support_static_tools=yes
575        fi
576    ]
577 )
578
579 TTOOL_LDFLAGS=
580 if test x$support_static_tools = xyes; then
581    TTOOL_LDFLAGS="-static"
582 fi
583 AC_SUBST(TTOOL_LDFLAGS)
584
585 dnl -------------------------------------------
586 dnl static-fd    (default off)
587 dnl -------------------------------------------
588 AC_ARG_ENABLE(static-fd,
589    AC_HELP_STRING([--enable-static-fd], [enable static File daemon @<:@default=no@:>@]),
590    [
591        if test x$enableval = xyes; then
592           if test x$use_libtool = xyes; then
593              AC_MSG_ERROR([Libtool is enabled, not compatible with static tools, 
594   please rerun configure with --disable-libtool])
595           fi
596           support_static_fd=yes
597        fi
598    ]
599 )
600
601 STATIC_FD=
602 if test x$support_static_fd = xyes; then
603    STATIC_FD="static-bacula-fd"
604 fi
605 AC_SUBST(STATIC_FD)
606
607 dnl -------------------------------------------
608 dnl static-sd    (default off)
609 dnl -------------------------------------------
610 AC_ARG_ENABLE(static-sd,
611    AC_HELP_STRING([--enable-static-sd], [enable static Storage daemon @<:@default=no@:>@]),
612    [
613        if test x$enableval = xyes; then
614           if test x$use_libtool = xyes; then
615              AC_MSG_ERROR([Libtool is enabled, not compatible with static tools, 
616   please rerun configure with --disable-libtool])
617           fi
618           support_static_sd=yes
619        fi
620    ]
621 )
622
623 STATIC_SD=
624 if test x$support_static_sd = xyes; then
625    STATIC_SD="static-bacula-sd"
626 fi
627 AC_SUBST(STATIC_SD)
628
629 dnl -------------------------------------------
630 dnl static-dir   (default off)
631 dnl -------------------------------------------
632 AC_ARG_ENABLE(static-dir,
633    AC_HELP_STRING([--enable-static-dir], [enable static Director @<:@default=no@:>@]),
634    [
635        if test x$enableval = xyes; then
636           if test x$use_libtool = xyes; then
637              AC_MSG_ERROR([Libtool is enabled, not compatible with static tools, 
638   please rerun configure with --disable-libtool])
639           fi
640           support_static_dir=yes
641        fi
642    ]
643 )
644
645 STATIC_DIR=
646 if test x$support_static_dir = xyes; then
647    STATIC_DIR="static-bacula-dir"
648 fi
649 AC_SUBST(STATIC_DIR)
650
651 dnl -------------------------------------------
652 dnl static-cons  (default off)
653 dnl -------------------------------------------
654 AC_ARG_ENABLE(static-cons,
655    AC_HELP_STRING([--enable-static-cons], [enable static Console @<:@default=no@:>@]),
656    [
657        if test x$enableval = xyes; then
658           if test x$use_libtool = xyes; then
659              AC_MSG_ERROR([Libtool is enabled, not compatible with static tools, 
660   please rerun configure with --disable-libtool])
661           fi
662           support_static_cons=yes
663        fi
664    ]
665 )
666
667 STATIC_CONS=
668 STATIC_GNOME_CONS=
669 STATIC_WX_CONS=
670 if test x$support_static_cons = xyes; then
671    STATIC_CONS="static-bconsole"
672    STATIC_GNOME_CONS="static-bgnome-console"
673    STATIC_WX_CONS="static-bwx-console"
674 fi
675 AC_SUBST(STATIC_CONS)
676 AC_SUBST(STATIC_GNOME_CONS)
677 AC_SUBST(STATIC_WX_CONS)
678
679 dnl -------------------------------------------
680 dnl client_only  (default off)
681 dnl -------------------------------------------
682 AC_ARG_ENABLE(client-only,
683    AC_HELP_STRING([--enable-client-only], [build client (File daemon) only @<:@default=no@:>@]),
684    [
685        if test x$enableval = xyes; then
686           build_client_only=yes
687           db_type=None
688           DB_TYPE=none
689        fi
690    ]
691 )
692 if test x$build_client_only = xno; then
693    ALL_DIRS="subdirs"
694 else
695    ALL_DIRS=""
696 fi
697 AC_SUBST(ALL_DIRS)
698
699 dnl -------------------------------------------
700 dnl director  (default on)
701 dnl -------------------------------------------
702 AC_ARG_ENABLE(build-dird,
703    AC_HELP_STRING([--enable-build-dird], [enable building of dird (Director) @<:@default=yes@:>@]),
704    [
705        if test x$enableval = xno; then
706           build_dird=no
707        fi
708    ]
709 )
710 if test x$build_dird = xyes; then
711    DIRD_DIR="src/dird"
712    DIR_TOOLS="DIRTOOLS"
713 else
714    DIRD_DIR=""
715    DIR_TOOLS="NODIRTOOLS"
716 fi
717 AC_SUBST(DIRD_DIR)
718 AC_SUBST(DIR_TOOLS)
719
720 dnl -------------------------------------------
721 dnl stored  (default on)
722 dnl -------------------------------------------
723 AC_ARG_ENABLE(build-stored,
724    AC_HELP_STRING([--enable-build-stored], [enable building of stored (Storage daemon) @<:@default=yes@:>@]),
725    [
726       if test x$enableval = xno; then
727          build_stored=no
728       fi
729    ]
730 )
731 if test x$build_stored = xyes; then
732    STORED_DIR="src/stored"
733 else
734    STORED_DIR=""
735 fi
736 AC_SUBST(STORED_DIR)
737
738 dnl ---------------------------------------------------
739 dnl Check for conio (Bacula readline substitute)(
740 dnl ---------------------------------------------------
741 dnl this allows you to turn it completely off
742 AC_ARG_ENABLE(conio,
743    AC_HELP_STRING([--disable-conio], [disable conio support @<:@default=no@:>@]),
744    [
745        if test x$enableval = xno; then
746           support_conio=no
747        fi
748    ]
749 )
750   
751
752 dnl ---------------------------------------------------
753 dnl Check for IPv6 support
754 dnl ---------------------------------------------------
755 dnl this allows you to turn it completely off
756 support_ipv6=yes
757 AC_ARG_ENABLE(ipv6,   
758    AC_HELP_STRING([--enable-ipv6], [enable ipv6 support @<:@default=yes@:>@]),
759    [
760        if test x$enableval = xno; then
761           support_ipv6=no  
762        fi
763    ]
764 )
765
766 if test x$support_ipv6 = xyes; then
767     AC_TRY_LINK([ #include <sys/types.h>
768 #include <sys/socket.h>
769 #include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;],
770       [support_ipv6=yes], [support_ipv6=no])
771 fi
772
773 if test x$support_ipv6 = xyes; then
774    AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
775 fi
776
777 got_conio="no"
778 if test x$support_conio = xyes; then
779    AC_CHECK_HEADER(termcap.h, 
780      [ AC_CHECK_LIB(termcap, tgetent, 
781        [ CONS_LIBS="-ltermcap"
782     CONS_OBJ="conio.o"
783     CONS_SRC="conio.c"
784     got_conio="yes"
785     support_readline=no
786     AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled]) 
787        ],   
788        [ AC_CHECK_LIB(ncurses, tgetent,
789     [ CONS_LIBS="-lncurses"
790       CONS_OBJ="conio.o"
791       CONS_SRC="conio.c"
792       got_conio="yes"
793       support_readline=no
794       AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled]) 
795     ])
796        ])
797      ],
798      [
799     AC_CHECK_HEADERS(curses.h)
800     AC_CHECK_HEADER(term.h,
801           [ AC_CHECK_LIB(curses, tgetent, 
802        [ CONS_LIBS="-lcurses"
803          CONS_OBJ="conio.o"
804          CONS_SRC="conio.c"
805          got_conio="yes"
806          support_readline=no
807          AC_DEFINE(HAVE_CONIO, 1, [Set if Bacula conio support enabled]) 
808        ])
809           ],
810           [ echo " "; echo "Required libraries not found. CONIO turned off ..."; echo " "],
811 [#if HAVE_CURSES_H
812 #include <curses.h>
813 #endif
814 ])
815      ])
816 fi
817
818
819 dnl ---------------------------------------------------
820 dnl Check for readline support/directory (default off)
821 dnl ---------------------------------------------------
822 dnl this allows you to turn it completely off
823 AC_ARG_ENABLE(readline,
824    AC_HELP_STRING([--disable-readline], [disable readline support @<:@default=yes@:>@]),
825    [
826        if test x$enableval = xno; then
827           support_readline=no
828        fi
829    ]
830 )
831
832 got_readline="no"
833 READLINE_SRC=
834 if test x$support_readline = xyes; then
835    AC_ARG_WITH(readline,
836       AC_HELP_STRING([--with-readline@<:@=DIR@:>@], [specify readline library directory]),
837       [
838           case "$with_readline" in
839           no)
840              :
841              ;;
842           yes|*)
843              if test -f ${with_readline}/readline.h; then
844                 CONS_INC="-I${with_readline}"
845                 CONS_LDFLAGS="-L$with_readline"
846              elif test -f ${with_readline}/include/readline/readline.h; then
847                 CONS_INC="-I${with_readline}/include/readline"
848                 CONS_LDFLAGS="-L${with_readline}/lib"
849                 with_readline="${with_readline}/include/readline"
850              else
851                 with_readline="/usr/include/readline" 
852              fi
853
854              AC_CHECK_HEADER(${with_readline}/readline.h, 
855                 [
856                     AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
857                     CONS_LIBS="-lreadline -lhistory -ltermcap"
858                     got_readline="yes"   
859                 ], [
860                     echo " "
861                     echo "readline.h not found. readline turned off ..."
862                     echo " "
863                 ]
864              )
865              ;;
866           esac
867       ],[
868          dnl check for standard readline library
869          AC_CHECK_HEADER(/usr/include/readline/readline.h, 
870             [
871                 AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
872                 got_readline="yes"
873                 CONS_INC="-I/usr/include/readline"
874                 CONS_LIBS="-lreadline -ltermcap"
875             ], [
876                 dnl Did not find standard library, so try Bacula's default
877                 AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h, 
878                     [
879                         AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support])
880                         got_readline="yes"   
881                         CONS_INC="-I${TOP_DIR}/depkgs/readline"
882                         CONS_LIBS="-lreadline -lhistory -ltermcap"
883                         CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline"
884                         PRTREADLINE_SRC="${TOP_DIR}/depkgs/readline"
885                     ], [
886                         echo " "
887                         echo "readline.h not found. readline turned off ..."
888                         echo " "
889                     ]
890                 )
891             ]
892          )
893       ]    
894    )
895 fi
896
897 AC_SUBST(CONS_INC)
898 AC_SUBST(CONS_OBJ)
899 AC_SUBST(CONS_SRC)
900 AC_SUBST(CONS_LIBS)
901 AC_SUBST(CONS_LDFLAGS)
902 AC_SUBST(READLINE_SRC)
903
904 dnl Minimal stuff for readline Makefile configuration
905 MAKE_SHELL=/bin/sh
906 AC_SUBST(MAKE_SHELL)
907 AC_HEADER_STAT
908 AC_HEADER_DIRENT
909 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr lstat lchown)
910 AC_CHECK_FUNCS(nanosleep nl_langinfo)
911 AC_CHECK_HEADERS(varargs.h)
912
913 dnl End of readline/conio stuff
914 dnl -----------------------------------------------------------------------
915
916 dnl -----------------------------------------------------------------------
917 dnl  Check for Python support
918 dnl
919 AC_MSG_CHECKING(for Python support)
920 AC_ARG_WITH(python,
921    AC_HELP_STRING([--with-python@<:@=DIR@:>@], [Include Python support. DIR is the Python base install directory, default is to search through a number of common places for the Python files.]),
922    [
923        PYTHON_INCDIR= 
924        PYTHON_LIBS=
925        if test "$withval" != "no"; then
926           if test "$withval" = "yes"; then
927              if test -e /usr/bin/python-config ; then
928                 PYTHON_INCDIR=`/usr/bin/python-config --includes`
929                 PYTHON_LIBS=`/usr/bin/python-config --libs`
930              else
931                 for python_root in /usr /usr/local /usr/sfw; do
932                    for ver in python2.2 python2.3 python2.4 python2.5 python2.6 python3; do
933                       if test -f $python_root/include/${ver}/Python.h; then
934                          PYTHON_INCDIR=-I$python_root/include/${ver}
935                          if test -d $python_root/lib64/${ver}/config; then
936                             PYTHON_LIBS="-L$python_root/lib64/${ver}/config -l${ver}"
937                          else
938                             PYTHON_LIBS="-L$python_root/lib/${ver}/config -l${ver}"
939                          fi
940                          break 
941                       fi
942                    done
943                 done
944
945                 if test x$PYTHON_INCDIR = x; then
946                    if test -f $prefix/include/Python.h; then
947                       PYTHON_INCDIR=-I$prefix/include
948                       if test -d $prefix/lib64/config; then
949                          PYTHON_LIBS="-L$prefix/lib64/config -lpython"
950                       else
951                          PYTHON_LIBS="-L$prefix/lib/config -lpython"
952                       fi
953                    else
954                       AC_MSG_RESULT(no)
955                       AC_MSG_ERROR(Unable to find Python.h in standard locations)
956                    fi
957                 fi
958              fi
959           else
960              if test -e $withval/bin/python-config ; then
961                 PYTHON_INCDIR=`$withval/bin/python-config --includes`
962                 PYTHON_LIBS=`$withval/bin/python-config --libs`
963              elif test -f $withval/Python.h; then
964                 PYTHON_INCDIR=-I$withval
965                 PYTHON_LIBS="-L$withval/config -lpython"
966              elif test -f $withval/include/Python.h; then
967                 PYTHON_INCDIR=-I$withval/include
968                 if test -d $withval/lib64/config; then
969                    PYTHON_LIBS="-L$withval/lib64/config -lpython"
970                 else
971                    PYTHON_LIBS="-L$withval/lib/config -lpython"
972                 fi
973              elif test -f $withval/include/python/Python.h; then
974                 PYTHON_INCDIR=-I$withval/include/python
975                 if test -d $withval/lib64/python/config; then
976                    PYTHON_LIBS="-L$withval/lib64/python/config -lpython"
977                 else
978                    PYTHON_LIBS="-L$withval/lib/python/config -lpython"
979                 fi
980              else
981                 AC_MSG_RESULT(no)
982                 AC_MSG_ERROR(Invalid Python directory $withval - unable to find Python.h under $withval)
983              fi
984           fi
985
986           AC_DEFINE([HAVE_PYTHON], 1)
987           AC_MSG_RESULT(yes)
988           support_python=yes
989           AC_MSG_NOTICE(checking for more Python libs)
990           saved_LIBS="$LIBS"; LIBS=
991           AC_SEARCH_LIBS(shm_open, [rt])
992           AC_CHECK_LIB(util, openpty)
993           PYTHON_LIBS="$PYTHON_LIBS $LIBS"
994           LIBS="$saved_LIBS"
995        else
996           AC_MSG_RESULT(no)
997        fi
998    ],[
999        AC_MSG_RESULT(no)
1000    ]
1001 )
1002 AC_SUBST(PYTHON_LIBS)
1003 AC_SUBST(PYTHON_INCDIR)
1004
1005 dnl
1006 dnl Find where sockets are (especially for Solaris)
1007 dnl Do this before the TCP Wrappers test since tcp wrappers
1008 dnl uses the socket library and some linkers are stupid.
1009 dnl
1010 AC_CHECK_FUNC(socket,
1011     AC_MSG_RESULT(using libc's socket),
1012     AC_CHECK_LIB(xnet,socket)
1013     AC_CHECK_LIB(socket,socket)
1014     AC_CHECK_LIB(inet,socket))
1015
1016 dnl -----------------------------------------------------------
1017 dnl Check whether user wants TCP wrappers support (default off)
1018 dnl -----------------------------------------------------------
1019 TCPW_MSG="no" 
1020 WRAPLIBS=""
1021 AC_ARG_WITH(tcp-wrappers,
1022    AC_HELP_STRING([--with-tcp-wrappers@<:@=DIR@:>@], [enable tcpwrappers support]),
1023    [
1024        if test "x$withval" != "xno" ; then
1025           saved_LIBS="$LIBS"
1026           LIBS="$saved_LIBS -lwrap"
1027           AC_SEARCH_LIBS(nanosleep, [rt])
1028           AC_MSG_CHECKING(for libwrap)
1029           AC_TRY_LINK(
1030              [ 
1031                #include <sys/types.h>
1032                #include <tcpd.h>
1033                int deny_severity = 0;
1034                int allow_severity = 0;
1035                struct request_info *req;
1036              ], [
1037                 hosts_access(req);
1038              ], [
1039                  AC_MSG_RESULT(yes)
1040                  AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
1041                  TCPW_MSG="yes" 
1042                  LIBS="$saved_LIBS"
1043                  WRAPLIBS="-lwrap"
1044              ], [
1045                  LIBS="$saved_LIBS -lwrap -lnsl"
1046                  WRAPLIBS="$saved_LIBS -lwrap -lnsl"
1047                  AC_TRY_LINK(
1048                    [
1049                        #include <sys/types.h>
1050                        #include <tcpd.h>
1051                        int deny_severity = 0;
1052                        int allow_severity = 0;
1053                        struct request_info *req;
1054                    ], [
1055                        hosts_access(req);
1056                    ], [
1057                       AC_MSG_RESULT(yes)
1058                       AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support])
1059                       TCPW_MSG="yes" 
1060                       LIBS="$saved_LIBS"
1061                       WRAPLIBS="-lwrap"
1062                    ], [
1063                       AC_MSG_ERROR([*** libwrap missing])
1064                    ]
1065                 )
1066              ]
1067           )
1068        fi
1069    ]
1070 )
1071
1072 dnl -----------------------------------------------------------
1073 dnl Check whether OpenSSL is available
1074 dnl -----------------------------------------------------------
1075 AC_MSG_CHECKING([for OpenSSL])
1076 dnl The following uses quadrigraphs:
1077 dnl '@<:@' = '['
1078 dnl '@:>@' = ']'
1079 AC_ARG_WITH(openssl,
1080     AC_HELP_STRING([--with-openssl@<:@=DIR@:>@], [Include OpenSSL support. DIR is the OpenSSL base]),
1081     [
1082         with_openssl_directory=${withval}
1083     ]
1084 )
1085
1086 if test "x$with_openssl_directory" != "xno"; then
1087    OPENSSL_LIBS="-lssl -lcrypto"
1088    OPENSSL_INC=""
1089
1090    if test "x$with_openssl_directory" != "xyes" && test x"${with_openssl_directory}" != "x"; then
1091       #
1092       # Make sure the $with_openssl_directory also makes sense
1093       #
1094       if test -d "$with_openssl_directory/lib" -a -d "$with_openssl_directory/include"; then
1095          OPENSSL_LIBS="-L$with_openssl_directory/lib $OPENSSL_LIBS"
1096          OPENSSL_INC="-I$with_openssl_directory/include $OPENSSL_INC"
1097       fi
1098    fi
1099
1100    saved_LIBS="${LIBS}"
1101    saved_CFLAGS="${CFLAGS}"
1102    LIBS="${saved_LIBS} ${OPENSSL_LIBS}"
1103    CFLAGS="${saved_CFLAGS} ${OPENSSL_INC}"
1104
1105    AC_TRY_LINK(
1106       [
1107           #include <openssl/ssl.h>
1108       ], [
1109            CRYPTO_set_id_callback(NULL);
1110       ], [
1111           support_tls="yes"
1112           support_crypto="yes"
1113       ], [
1114           support_tls="no"
1115       ]
1116    )
1117
1118    AC_TRY_LINK(
1119       [
1120           #include <openssl/evp.h>
1121       ], [
1122           EVP_sha512();
1123       ], [
1124           ac_cv_openssl_sha2="yes"
1125       ], [
1126           ac_cv_openssl_sha2="no"
1127       ]
1128    )
1129
1130    dnl Solaris disables greater than 128+ bit encryption in their OpenSSL
1131    dnl implementation, presumably for export reasons. If 192bit AES
1132    dnl is available, we assume that we're running with a 'non-export'
1133    dnl openssl library.
1134    AC_TRY_LINK(
1135       [
1136           #include <openssl/evp.h>
1137       ], [
1138           EVP_aes_192_cbc();
1139       ], [
1140           ac_cv_openssl_export="no"
1141       ], [
1142           ac_cv_openssl_export="yes"
1143       ]
1144    )
1145
1146    LIBS="${saved_LIBS}"
1147    CFLAGS="${saved_CFLAGS}"
1148
1149    if test "$support_tls" = "yes"; then
1150       AC_DEFINE(HAVE_OPENSSL, 1, [Define if OpenSSL library is available])
1151       AC_DEFINE(HAVE_TLS, 1, [Define if TLS support should be enabled])
1152       AC_DEFINE(HAVE_CRYPTO, 1, [Define if encryption support should be enabled])
1153    fi
1154
1155    if test "$ac_cv_openssl_sha2" = "yes"; then
1156       AC_DEFINE(HAVE_SHA2, 1, [Define if the SHA-2 family of digest algorithms is available])
1157    fi
1158
1159    if test "$ac_cv_openssl_export" = "yes"; then
1160       AC_DEFINE(HAVE_OPENSSL_EXPORT_LIBRARY, 1, [Define if the OpenSSL library is export-contrained to 128bit ciphers])
1161    fi
1162 else
1163    support_tls="no"
1164    support_crypto="no"
1165    OPENSSL_LIBS=""
1166    OPENSSL_INC=""
1167 fi
1168
1169 if test "$support_tls" = "no"; then
1170    OPENSSL_LIBS=""
1171    OPENSSL_INC=""
1172 fi  
1173
1174 AC_MSG_RESULT([$support_tls])
1175 AC_SUBST(OPENSSL_LIBS)
1176 AC_SUBST(OPENSSL_INC)
1177
1178 dnl -----------------------------------------------------------
1179 dnl dlopen is needed for plugins
1180 dnl -----------------------------------------------------------
1181 AC_SEARCH_LIBS(dlopen, [dl])
1182
1183 dnl ------------------------------------------
1184 dnl Where to place working dir
1185 dnl ------------------------------------------
1186 working_dir=`eval echo ${prefix}/var/bacula/working`
1187 AC_ARG_WITH(working-dir,
1188    AC_HELP_STRING([--with-working-dir=PATH], [specify path of Bacula working directory]),
1189    [
1190        if test "x$withval" != "xno" ; then     
1191          working_dir=$withval
1192        fi
1193    ]
1194 )
1195
1196 AC_SUBST(working_dir)
1197
1198 dnl ------------------------------------------------------------------
1199 dnl If the user has not set archivedir, we set our default as /tmp
1200 dnl ------------------------------------------------------------------
1201 archivedir=/tmp
1202 AC_ARG_WITH(archivedir,
1203    AC_HELP_STRING([--with-archivedir=PATH], [specify path of SD archive directory]),
1204    [
1205        if test "x$withval" != "xno" ; then     
1206           archivedir=$withval
1207        fi
1208    ]
1209 )
1210
1211 AC_SUBST(archivedir)
1212
1213 dnl ------------------------------------------------------------------
1214 dnl Allow the user to specify the daemon resource name default hostname
1215 dnl ------------------------------------------------------------------
1216 basename=`hostname`
1217 AC_ARG_WITH(basename,
1218    AC_HELP_STRING([--with-basename=RESNAME], [specify base resource name for daemons]),
1219    [
1220        if test "x$withval" != "xno" ; then     
1221           basename=$withval
1222        fi
1223    ]
1224 )
1225
1226 AC_SUBST(basename)
1227
1228 dnl ------------------------------------------------------------------
1229 dnl Allow the user to override the hostname (default = machine hostname)
1230 dnl ------------------------------------------------------------------
1231 hostname=`uname -n | cut -d '.' -f 1`
1232 if test x${hostname} = x ; then
1233   hostname="localhost"
1234 fi
1235 AC_ARG_WITH(hostname,
1236    AC_HELP_STRING([--with-hostname=RESNAME], [specify host name for daemons]),
1237    [
1238        if test "x$withval" != "xno" ; then
1239          hostname=$withval
1240        fi
1241    ]
1242 )
1243
1244 AC_SUBST(hostname)
1245
1246
1247 dnl ------------------------------------------
1248 dnl Where to place scriptdir (script files)
1249 dnl ------------------------------------------
1250 scriptdir=`eval echo ${sysconfdir}`
1251 AC_ARG_WITH(scriptdir,
1252    AC_HELP_STRING([--with-scriptdir=PATH], [specify path of Bacula scripts directory]),
1253    [
1254        if test "x$withval" != "xno" ; then     
1255           scriptdir=$withval
1256        fi
1257    ]
1258 )
1259
1260 AC_SUBST(scriptdir)
1261
1262
1263 dnl ------------------------------------------
1264 dnl Where to place bsrdir (bsr files)
1265 dnl ------------------------------------------
1266 bsrdir=/tmp
1267 AC_ARG_WITH(bsrdir,
1268    AC_HELP_STRING([--with-bsrdir=PATH], [specify path of Bacula bsrs directory]),
1269    [
1270        if test "x$withval" != "xno" ; then     
1271           bsrdir=$withval
1272        fi
1273    ]
1274 )
1275
1276 AC_SUBST(bsrdir)
1277
1278 dnl ------------------------------------------
1279 dnl Where to place logdir (bsr files)
1280 dnl ------------------------------------------
1281 logdir=/tmp
1282 AC_ARG_WITH(logdir,
1283    AC_HELP_STRING([--with-logdir=PATH], [specify path of Bacula logs directory]),
1284    [
1285        if test "x$withval" != "xno" ; then     
1286           logdir=$withval
1287        fi
1288    ]
1289 )
1290
1291 AC_SUBST(logdir)
1292
1293
1294 # ------------------------------------------
1295 # Where to place plugindir (plugin files)
1296 # ------------------------------------------
1297 plugindir=`eval echo ${libdir}`
1298 AC_ARG_WITH(plugindir,
1299    AC_HELP_STRING([--with-plugindir=PATH], [specify path of Bacula plugins directory]),
1300    [
1301        if test "x$withval" != "xno" ; then     
1302           plugindir=$withval
1303        fi
1304    ]
1305 )
1306
1307 AC_SUBST(plugindir)
1308
1309 dnl ------------------------------------------
1310 dnl Where to send dump email
1311 dnl ------------------------------------------
1312 dump_email=root@localhost
1313 AC_ARG_WITH(dump-email,
1314    AC_HELP_STRING([--with-dump-email=EMAIL], [dump email address]),
1315    [
1316        if test "x$withval" != "xno" ; then     
1317           dump_email=$withval
1318        fi
1319    ]
1320 )
1321
1322 AC_SUBST(dump_email)
1323
1324 dnl ------------------------------------------
1325 dnl Where to send job email
1326 dnl ------------------------------------------
1327 job_email=root@localhost
1328 AC_ARG_WITH(job-email,
1329    AC_HELP_STRING([--with-job-email=EMAIL], [job output email address]),
1330    [
1331        if test "x$withval" != "xno" ; then     
1332           job_email=$withval
1333        fi
1334    ]
1335 )
1336
1337 AC_SUBST(job_email)
1338
1339 dnl ------------------------------------------
1340 dnl Where to find smtp host
1341 dnl ------------------------------------------
1342 smtp_host=localhost
1343 AC_ARG_WITH(smtp_host,
1344    AC_HELP_STRING([--with-smtp-host=HOST], [SMTP mail host address]),
1345    [
1346        if test "x$withval" != "xno" ; then     
1347           smtp_host=$withval
1348        fi
1349    ]
1350 )
1351
1352 AC_SUBST(smtp_host)
1353
1354 dnl ------------------------------------
1355 dnl Where to place pid files
1356 dnl ------------------------------------
1357 piddir=/var/run
1358 AC_ARG_WITH(pid-dir,
1359    AC_HELP_STRING([--with-pid-dir=PATH], [specify location of Bacula pid files]),
1360    [
1361        if test "x$withval" != "xno" ; then   
1362           piddir=$withval
1363        fi
1364    ]
1365 )
1366
1367 AC_DEFINE_UNQUOTED(_PATH_BACULA_PIDDIR, "$piddir")
1368 AC_SUBST(piddir)
1369
1370 dnl ------------------------------------
1371 dnl Where to place subsys "lock file"
1372 dnl ------------------------------------
1373 subsysdir=/var/run/subsys
1374 if test -d /var/run/subsys; then
1375    subsysdir=/var/run/subsys
1376 elif test -d /var/lock/subsys; then
1377    subsysdir=/var/lock/subsys
1378 else
1379    subsysdir=/var/run/subsys
1380 fi
1381 AC_ARG_WITH(subsys-dir,
1382    AC_HELP_STRING([--with-subsys-dir=PATH], [specify location of Bacula subsys file]),
1383    [
1384        if test "x$withval" != "xno" ; then   
1385           subsysdir=$withval
1386        fi
1387    ]
1388 )
1389
1390 AC_SUBST(subsysdir)
1391
1392 dnl ------------------------------------
1393 dnl Where to start assigning ports
1394 dnl ------------------------------------
1395 baseport=9101
1396 AC_ARG_WITH(baseport,
1397    AC_HELP_STRING([--with-baseport=PORT], [specify base port address for daemons]),
1398    [
1399        if test "x$withval" != "xno" ; then   
1400           baseport=$withval
1401        fi
1402    ]
1403 )
1404
1405 AC_SUBST(baseport)
1406 dir_port=`expr $baseport`
1407 fd_port=`expr $baseport + 1`
1408 sd_port=`expr $fd_port + 1`
1409
1410 AC_SUBST(dir_port)
1411 AC_SUBST(fd_port)
1412 AC_SUBST(sd_port)
1413
1414 dnl ------------------------------------------
1415 dnl Generate passwords
1416 dnl ------------------------------------------
1417 dir_password=
1418 AC_ARG_WITH(dir-password,
1419    AC_HELP_STRING([--with-dir-password=PASSWORD], [specify Director's password]),
1420    [
1421        if test "x$withval" != "xno" ; then     
1422           dir_password=$withval
1423        fi
1424    ]
1425 )
1426
1427 if test "x$dir_password" = "x" ; then
1428    if test "x$OPENSSL" = "xnone" ; then
1429       key=`autoconf/randpass 33`
1430    else
1431       key=`openssl rand -base64 33`
1432    fi
1433    dir_password=$key
1434 fi
1435
1436 fd_password=
1437 AC_ARG_WITH(fd-password,
1438    AC_HELP_STRING([--with-fd-password=PASSWORD], [specify Client's password]),
1439    [
1440        if test "x$withval" != "xno" ; then     
1441           fd_password=$withval
1442        fi
1443    ]
1444 )
1445
1446 if test "x$fd_password" = "x" ; then
1447    if test "x$OPENSSL" = "xnone" ; then
1448       key=`autoconf/randpass 37`
1449    else
1450       key=`openssl rand -base64 33`
1451    fi
1452    fd_password=$key
1453 fi
1454
1455 sd_password=
1456 AC_ARG_WITH(sd-password,
1457    AC_HELP_STRING([--with-sd-password=PASSWORD], [specify Storage daemon's password]),
1458    [
1459        if test "x$withval" != "xno" ; then     
1460           sd_password=$withval
1461        fi
1462    ]
1463 )
1464
1465 if test "x$sd_password" = "x" ; then
1466    if test "x$OPENSSL" = "xnone" ; then
1467       key=`autoconf/randpass 41`
1468    else
1469       key=`openssl rand -base64 33`
1470    fi
1471    sd_password=$key
1472 fi
1473
1474 mon_dir_password=
1475 AC_ARG_WITH(mon-dir-password,
1476    AC_HELP_STRING([--with-mon-dir-password=PASSWORD], [specify Director's password used by the monitor]),
1477    [
1478        if test "x$withval" != "xno" ; then     
1479           mon_dir_password=$withval
1480        fi
1481    ]
1482 )
1483
1484 if test "x$mon_dir_password" = "x" ; then
1485    if test "x$OPENSSL" = "xnone" ; then
1486       key=`autoconf/randpass 33`
1487    else
1488       key=`openssl rand -base64 33`
1489    fi
1490    mon_dir_password=$key
1491 fi
1492
1493 mon_fd_password=
1494 AC_ARG_WITH(mon-fd-password,
1495    AC_HELP_STRING([--with-mon-fd-password=PASSWORD], [specify Client's password used by the monitor]),
1496    [
1497        if test "x$withval" != "xno" ; then     
1498           mon_fd_password=$withval
1499        fi
1500    ]
1501 )
1502
1503 if test "x$mon_fd_password" = "x" ; then
1504    if test "x$OPENSSL" = "xnone" ; then
1505       key=`autoconf/randpass 37`
1506    else
1507       key=`openssl rand -base64 33`
1508    fi
1509    mon_fd_password=$key
1510 fi
1511
1512 mon_sd_password=
1513 AC_ARG_WITH(mon-sd-password,
1514    AC_HELP_STRING([--with-mon-sd-password=PASSWORD], [specify Storage daemon's password used by the monitor]),
1515    [
1516        if test "x$withval" != "xno" ; then     
1517           mon_sd_password=$withval
1518        fi
1519    ]
1520 )
1521
1522 if test "x$mon_sd_password" = "x" ; then
1523    if test "x$OPENSSL" = "xnone" ; then
1524       key=`autoconf/randpass 41`
1525    else
1526       key=`openssl rand -base64 33`
1527    fi
1528    mon_sd_password=$key
1529 fi
1530
1531 AC_SUBST(dir_password)
1532 AC_SUBST(fd_password)
1533 AC_SUBST(sd_password)
1534 AC_SUBST(mon_dir_password)
1535 AC_SUBST(mon_fd_password)
1536 AC_SUBST(mon_sd_password)
1537
1538 dnl
1539 dnl Pickup any database name
1540 dnl
1541 db_name=bacula
1542 AC_ARG_WITH(db_name,
1543    AC_HELP_STRING([--with-db-name=DBNAME], [specify database name @<:@default=bacula@:>@]),
1544    [
1545        if test "x$withval" != "x" ; then   
1546           db_name=$withval
1547        fi
1548    ]
1549 )
1550 AC_SUBST(db_name)
1551
1552 db_user=bacula
1553 AC_ARG_WITH(db_user,
1554    AC_HELP_STRING([--with-db-user=UNAME], [specify database user @<:@default=bacula@:>@]),
1555    [
1556        if test "x$withval" != "x" ; then   
1557           db_user=$withval
1558        fi
1559    ]
1560 )
1561 AC_SUBST(db_user)
1562
1563 db_password=
1564 AC_ARG_WITH(db_password,
1565    AC_HELP_STRING([--with-db-password=PWD], [specify database password @<:@default=*none*@:>@]),
1566    [
1567        if test "x$withval" != "x" ; then   
1568           db_password=$withval
1569        fi
1570    ]
1571 )
1572 AC_SUBST(db_password)
1573
1574 dnl
1575 dnl Pickup a database port
1576 dnl
1577 db_port=" "
1578 AC_ARG_WITH(db_port,
1579    AC_HELP_STRING([--with-db-port=DBPORT], [specify a database port @<:@default=null@:>@]),
1580    [
1581        if test "x$withval" != "x" ; then
1582           db_port=$withval
1583        fi
1584    ]
1585 )
1586 AC_SUBST(db_port)
1587
1588 #
1589 # Handle users and groups for each daemon
1590 #
1591 dir_user=
1592 AC_ARG_WITH(dir_user,
1593    AC_HELP_STRING([--with-dir-user=USER], [specify user for Director daemon]),
1594    [
1595        if test "x$withval" != "x" ; then   
1596            dir_user=$withval
1597        fi
1598    ]
1599 )
1600
1601 dir_group=
1602 AC_ARG_WITH(dir_group,
1603    AC_HELP_STRING([--with-dir-group=GROUP], [specify group for Director daemon]),
1604    [
1605        if test "x$withval" != "x" ; then   
1606           dir_group=$withval
1607        fi
1608    ]
1609 )
1610
1611 sd_user=
1612 AC_ARG_WITH(sd_user,
1613    AC_HELP_STRING([--with-sd-user=USER], [specify user for Storage daemon]),
1614    [
1615        if test "x$withval" != "x" ; then   
1616           sd_user=$withval
1617        fi
1618    ]
1619 )
1620
1621 sd_group=
1622 AC_ARG_WITH(sd_group,
1623    AC_HELP_STRING([--with-sd-group=GROUP], [specify group for Storage daemon]),
1624    [
1625        if test "x$withval" != "x" ; then   
1626           sd_group=$withval
1627        fi
1628    ]
1629 )
1630
1631 fd_user=
1632 AC_ARG_WITH(fd_user,
1633    AC_HELP_STRING([--with-fd-user=USER], [specify user for File daemon]),
1634    [
1635        if test "x$withval" != "x" ; then   
1636           fd_user=$withval
1637        fi
1638    ]
1639 )
1640
1641 fd_group=
1642 AC_ARG_WITH(fd_group,
1643    AC_HELP_STRING([--with-fd-group=GROUP], [specify group for File daemon]),
1644    [
1645        if test "x$withval" != "x" ; then   
1646           fd_group=$withval
1647        fi
1648    ]
1649 )
1650
1651 AC_SUBST(dir_user)
1652 AC_SUBST(dir_group)
1653 AC_SUBST(sd_user)
1654 AC_SUBST(sd_group)
1655 AC_SUBST(fd_user)
1656 AC_SUBST(fd_group)
1657
1658 dnl
1659 dnl allow setting default executable permissions
1660 dnl
1661 SBINPERM=0754
1662 AC_ARG_WITH(sbin-perm,
1663    AC_HELP_STRING([--with-sbin-perm=MODE], [specify permissions for sbin binaries @<:@default=0754@:>@]),
1664    [
1665        if test "x$withval" != "x" ; then   
1666           SBINPERM=$withval
1667        fi
1668    ]
1669 )
1670
1671 AC_SUBST(SBINPERM)
1672
1673 dnl ------------------------------------------------
1674 dnl Bacula check for various SQL database engines
1675 dnl ------------------------------------------------
1676 SQL_LIB=
1677 BA_CHECK_POSTGRESQL_DB
1678
1679 BA_CHECK_MYSQL_DB
1680
1681 BA_CHECK_SQLITE3_DB
1682
1683 BA_CHECK_SQLITE_DB
1684
1685 BA_CHECK_DBI_DB
1686
1687 BA_CHECK_DBI_DRIVER
1688
1689 AC_SUBST(cats)
1690 AC_SUBST(DB_TYPE)
1691
1692 dnl -------------------------------------------
1693 dnl enable batch attribute DB insert (default on)
1694 dnl -------------------------------------------
1695 support_batch_insert=no
1696 A=`test -f $SQL_LIB && nm $SQL_LIB | grep pthread_mutex_lock`
1697 pkg=$?
1698 if test $pkg = 0; then
1699    support_batch_insert=yes
1700    AC_ARG_ENABLE(batch-insert,
1701       AC_HELP_STRING([--enable-batch-insert], [enable the DB batch insert code @<:@default=no@:>@]),
1702       [
1703           if test x$enableval = xno; then
1704              support_batch_insert=no
1705           else
1706              support_batch_insert=yes
1707           fi
1708       ]
1709    )
1710 fi
1711    
1712 dnl Check if postgresql support batch mode   
1713 if test x$DB_TYPE = xpostgresql; then
1714    A=`test -f $SQL_LIB && nm $SQL_LIB | grep PQputCopyData`
1715    pkg=$?
1716    if test $pkg != 0; then
1717       support_batch_insert=no
1718    fi
1719 fi
1720
1721 if test x$DB_TYPE = xdbi; then
1722    DB_TYPE=$DB_PROG
1723    db_type=$DB_PROG
1724    pkg=1
1725    dnl Check for batch insert
1726    if test $DB_PROG = postgresql; then
1727       A=`test -f $SQL_LIB && nm $SQL_LIB | grep PQputCopyData`
1728       pkg=$?
1729    fi
1730
1731    if test $DB_PROG = mysql; then
1732       A=`test -f $SQL_LIB && nm $DB_PROG_LIB | grep pthread_mutex_lock`
1733       pkg=$?    
1734    fi
1735
1736    if test $DB_PROG = sqlite3; then
1737       A=`test -f $SQL_LIB && nm $DB_PROG_LIB | grep pthread_mutex_lock`
1738       pkg=$?
1739    fi
1740
1741    if test $pkg = 0; then
1742       AC_ARG_ENABLE(batch-insert,
1743          AC_HELP_STRING([--enable-batch-insert], [enable the DB batch insert code @<:@default=no@:>@]),
1744          [
1745              if test x$enableval = xno; then
1746                 support_batch_insert=no
1747              else
1748                 support_batch_insert=yes
1749              fi
1750          ]
1751       )
1752    fi
1753 else 
1754    dnl If dbi was not chosen, let the comment in file
1755    uncomment_dbi="#"  
1756 fi
1757
1758 AC_SUBST(uncomment_dbi)
1759
1760 if test $support_batch_insert = yes ; then
1761    AC_DEFINE(HAVE_BATCH_FILE_INSERT, 1, [Set if DB batch insert code enabled])
1762 fi
1763
1764 AC_DEFINE(PROTOTYPES)
1765
1766 dnl --------------------------------------------------------------------------
1767 dnl Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
1768 dnl
1769 if test -z "$CFLAGS" -o "$CFLAGS" = "-g -O2"; then
1770    if test -z "$CCOPTS"; then
1771       CCOPTS='-g -O2 -Wall'
1772    fi
1773    CFLAGS="$CCOPTS"
1774 fi
1775
1776 dnl A few others 
1777 AC_EXEEXT
1778
1779 dnl See if we can use 64 bit file addresses
1780 largefile_support="no"
1781 AC_BAC_LARGEFILE
1782
1783 AC_PATH_XTRA
1784
1785 dnl --------------------------------------------------------------------------
1786 dnl CHECKING FOR HEADER FILES
1787 dnl --------------------------------------------------------------------------
1788 AC_CHECK_HEADERS( \
1789    assert.h \
1790    fcntl.h \
1791    grp.h \
1792    pwd.h \
1793    libc.h \
1794    limits.h \
1795    stdarg.h \
1796    stdlib.h \
1797    stdint.h \
1798    string.h \
1799    strings.h \
1800    termios.h \
1801    termcap.h \
1802    term.h \
1803    unistd.h \
1804    sys/bitypes.h \
1805    sys/byteorder.h \
1806    sys/ioctl.h \
1807    sys/select.h \
1808    sys/socket.h \
1809    sys/sockio.h \
1810    sys/stat.h \
1811    sys/time.h \
1812    sys/types.h \
1813    arpa/nameser.h \
1814    mtio.h \
1815    sys/mtio.h \
1816    sys/tape.h \
1817    regex.h \
1818 )
1819 AC_HEADER_STDC
1820 AC_HEADER_MAJOR
1821 AC_HEADER_DIRENT
1822 AC_HEADER_STAT
1823 AC_HEADER_SYS_WAIT
1824 AC_HEADER_TIME
1825 AC_STRUCT_ST_BLKSIZE
1826 AC_STRUCT_ST_BLOCKS
1827 AC_STRUCT_TIMEZONE
1828
1829 dnl --------------------------------------------------------------------------
1830 dnl Check for utime.h structure 
1831 dnl --------------------------------------------------------------------------
1832 AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h,
1833    [
1834        AC_TRY_COMPILE(
1835           [
1836               #include <sys/types.h>
1837               #include <utime.h>
1838           ], [
1839               struct utimbuf foo
1840           ], [
1841               ba_cv_header_utime_h=yes
1842           ], [
1843               ba_cv_header_utime_h=no
1844           ]
1845        )
1846    ]
1847 )
1848 test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H, 1, [Set if utime.h exists])
1849
1850 dnl --------------------------------------------------------------------------
1851 dnl Check for socklen_t
1852 dnl --------------------------------------------------------------------------
1853 AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
1854    [
1855        AC_TRY_COMPILE(
1856           [
1857               #include <sys/types.h>
1858               #include <sys/socket.h>
1859           ], [
1860               socklen_t x
1861           ], [
1862              ba_cv_header_socklen_t=yes
1863           ], [
1864              ba_cv_header_socklen_t=no
1865           ]
1866        )
1867    ]
1868 )
1869 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T)
1870
1871 dnl --------------------------------------------------------------------------
1872 dnl Check for typeof()
1873 dnl --------------------------------------------------------------------------
1874 AC_LANG_PUSH(C++)
1875 AC_CACHE_CHECK(for typeof, ba_cv_have_typeof,
1876    [
1877        AC_TRY_RUN(
1878           [
1879               main(){char *a = 0; a = (typeof a)a;}
1880           ], [
1881               ba_cv_have_typeof=yes
1882           ], [
1883               ba_cv_have_typeof=no
1884           ], [
1885               ba_cv_have_typeof=no
1886           ]
1887        )
1888    ]
1889 )
1890 test $ba_cv_have_typeof = yes && AC_DEFINE([HAVE_TYPEOF], 1, [Defind to 1 if compiler has typeof])
1891 AC_LANG_POP(C++)
1892
1893 AC_C_CONST
1894
1895 dnl --------------------------------------------------------------------------
1896 dnl CHECKING FOR FILESYSTEM TYPE
1897 dnl --------------------------------------------------------------------------
1898 AC_MSG_CHECKING(how to get filesystem type)
1899 fstype=no
1900 # The order of these tests is important.
1901 AC_TRY_CPP(
1902    [
1903        #include <sys/statvfs.h>
1904        #include <sys/fstyp.h>
1905    ],
1906    AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4
1907 )
1908 if test $fstype = no; then
1909    AC_TRY_CPP(
1910       [
1911           #include <sys/statfs.h>
1912           #include <sys/fstyp.h>
1913       ],
1914       AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3
1915    )
1916 fi
1917 if test $fstype = no; then
1918    AC_TRY_CPP(
1919       [
1920           #include <sys/statfs.h>
1921           #include <sys/vmount.h>
1922       ],
1923       AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX
1924    )
1925 fi
1926 if test $fstype = no; then  
1927    AC_TRY_CPP(
1928       [
1929           #include <mntent.h>
1930       ],
1931       AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD
1932    )
1933 fi
1934 if test $fstype = no; then  
1935    AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF1)
1936 fi
1937 if test $fstype = no; then  
1938    AC_TRY_CPP(
1939       [
1940           #include <sys/mount.h>
1941           #include <sys/fs_types.h>
1942       ],
1943       AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix
1944    )
1945 fi
1946 AC_MSG_RESULT($fstype)
1947
1948 AC_CHECK_HEADER(sys/statvfs.h, [ AC_DEFINE(HAVE_SYS_STATVFS_H,1,[Defines if your system have the sys/statvfs.h header file])] , )
1949
1950 dnl --------------------------------------------------------------------------
1951 dnl CHECKING FOR TYPEDEFS, STRUCTURES, AND COMPILER CHARACTERISTICS.
1952 dnl --------------------------------------------------------------------------
1953 AC_TYPE_SIGNAL
1954 SIGNAL_CHECK
1955 AC_TYPE_MODE_T
1956 AC_TYPE_UID_T
1957 AC_TYPE_SIZE_T
1958 AC_TYPE_PID_T
1959 AC_TYPE_OFF_T
1960 AC_TYPE_INTPTR_T
1961 AC_TYPE_UINTPTR_T
1962 AC_CHECK_TYPE(ino_t, unsigned long)
1963 AC_CHECK_TYPE(dev_t, unsigned long)
1964 AC_CHECK_TYPE(daddr_t, long)
1965 AC_CHECK_TYPE(major_t, int)
1966 AC_CHECK_TYPE(minor_t, int)
1967 AC_CHECK_TYPE(ssize_t, int)
1968 AC_STRUCT_ST_BLOCKS
1969 AC_STRUCT_ST_RDEV
1970 AC_STRUCT_TM
1971 AC_C_CONST
1972
1973 AC_CHECK_SIZEOF(char, 1)
1974 AC_CHECK_SIZEOF(short int, 2)
1975 AC_CHECK_SIZEOF(int, 4)
1976 AC_CHECK_SIZEOF(long int, 4)
1977 AC_CHECK_SIZEOF(long long int, 8)
1978 AC_CHECK_SIZEOF(int *, 4)
1979
1980 dnl Check for sys/types.h types
1981 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int,
1982    [
1983        AC_TRY_COMPILE(
1984           [
1985               #include <sys/types.h>
1986           ], [
1987               u_int a; a = 1;
1988           ], [
1989               ac_cv_have_u_int="yes"
1990           ], [
1991               ac_cv_have_u_int="no"
1992           ]
1993        )
1994    ]
1995 )
1996 if test "x$ac_cv_have_u_int" = "xyes" ; then
1997    AC_DEFINE(HAVE_U_INT)
1998    have_u_int=1
1999 fi
2000
2001 AC_CACHE_CHECK([for intmax_t type], ac_cv_have_intmax_t,
2002    [
2003        AC_TRY_COMPILE(
2004           [
2005               #include <sys/types.h>
2006           ], [
2007               intmax_t a; a = 1;
2008           ], [
2009               ac_cv_have_intmax_t="yes"
2010           ], [ 
2011               AC_TRY_COMPILE(
2012                  [
2013                      #include <stdint.h>
2014                  ], [
2015                      intmax_t a; a = 1;
2016                  ], [
2017                      ac_cv_have_intmax_t="yes"
2018                  ], [
2019                      ac_cv_have_intmax_t="no"
2020                  ]
2021               )
2022           ]
2023        )       
2024    ]
2025 )
2026 if test "x$ac_cv_have_intmax_t" = "xyes" ; then
2027    AC_DEFINE(HAVE_INTMAX_T)
2028    have_intmax_t=1
2029 fi
2030
2031 AC_CACHE_CHECK([for u_intmax_t type], ac_cv_have_u_intmax_t,
2032    [
2033        AC_TRY_COMPILE(
2034           [
2035               #include <sys/types.h>
2036           ], [
2037               u_intmax_t a; a = 1;
2038           ], [
2039               ac_cv_have_u_intmax_t="yes"
2040           ], [ 
2041               AC_TRY_COMPILE(
2042                  [
2043                      #include <stdint.h>
2044                  ], [
2045                     u_intmax_t a; a = 1;
2046                  ], [
2047                     ac_cv_have_u_intmax_t="yes"
2048                  ], [
2049                     ac_cv_have_u_intmax_t="no"
2050                  ]
2051               )
2052           ]
2053        )
2054    ]
2055 )
2056 if test "x$ac_cv_have_u_intmax_t" = "xyes" ; then
2057    AC_DEFINE(HAVE_U_INTMAX_T)
2058    have_u_intmax_t=1
2059 fi
2060
2061 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t,
2062    [
2063        AC_TRY_COMPILE(
2064           [
2065               #include <sys/types.h>
2066           ], [
2067               int8_t a; int16_t b; int32_t c; a = b = c = 1;
2068           ], [
2069               ac_cv_have_intxx_t="yes"
2070           ], [
2071               ac_cv_have_intxx_t="no"
2072           ]
2073        )
2074    ]
2075 )
2076 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
2077    AC_DEFINE(HAVE_INTXX_T)
2078    have_intxx_t=1
2079 fi
2080    
2081 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t,
2082    [
2083        AC_TRY_COMPILE(
2084           [
2085               #include <sys/types.h>
2086           ], [
2087               int64_t a; a = 1;
2088           ], [
2089               ac_cv_have_int64_t="yes"
2090           ], [
2091               ac_cv_have_int64_t="no"
2092           ]
2093        )
2094    ]
2095 )
2096 if test "x$ac_cv_have_int64_t" = "xyes" ; then
2097    AC_DEFINE(HAVE_INT64_T)
2098    have_int64_t=1
2099 fi
2100    
2101 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t,
2102    [
2103        AC_TRY_COMPILE(
2104           [
2105               #include <sys/types.h>
2106           ], [
2107               u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;
2108           ], [
2109              ac_cv_have_u_intxx_t="yes"
2110           ], [
2111              ac_cv_have_u_intxx_t="no"
2112           ]
2113        )
2114    ]
2115 )
2116 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
2117    AC_DEFINE(HAVE_U_INTXX_T)
2118    have_u_intxx_t=1
2119 fi
2120
2121 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t,
2122    [
2123        AC_TRY_COMPILE(
2124           [
2125               #include <sys/types.h>
2126           ], [
2127               u_int64_t a; a = 1;
2128           ], [
2129              ac_cv_have_u_int64_t="yes"
2130           ], [
2131              ac_cv_have_u_int64_t="no"
2132           ]
2133        )
2134    ]
2135 )
2136 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
2137    AC_DEFINE(HAVE_U_INT64_T)
2138    have_u_int64_t=1
2139 fi
2140
2141 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
2142     test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2143 then
2144    AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
2145    AC_TRY_COMPILE(
2146       [
2147           #include <sys/bitypes.h>
2148       ], [
2149           int8_t a; int16_t b; int32_t c;
2150           u_int8_t e; u_int16_t f; u_int32_t g;
2151           a = b = c = e = f = g = 1;
2152       ], [
2153           AC_DEFINE(HAVE_U_INTXX_T)
2154           AC_DEFINE(HAVE_INTXX_T)
2155           AC_DEFINE(HAVE_SYS_BITYPES_H)
2156           AC_MSG_RESULT(yes)
2157       ], [
2158           AC_MSG_RESULT(no)
2159       ]
2160    ) 
2161 fi
2162
2163 if test -z "$have_u_intxx_t" ; then
2164    AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t,
2165       [
2166           AC_TRY_COMPILE(
2167              [
2168                  #include <sys/types.h>
2169              ], [
2170                  uint8_t a; uint16_t b; 
2171                  uint32_t c; a = b = c = 1;
2172              ], [
2173                 ac_cv_have_uintxx_t="yes"
2174              ], [
2175                 ac_cv_have_uintxx_t="no"
2176              ]
2177           )
2178       ]
2179    )
2180    if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
2181       AC_DEFINE(HAVE_UINTXX_T)
2182    fi
2183 fi
2184
2185 if (test -z "$have_u_int64_t" || test -z "$have_int64_t" && \
2186     test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2187 then
2188    AC_MSG_CHECKING([for int64_t and u_int64_t types in sys/bitypes.h])
2189    AC_TRY_COMPILE(
2190       [
2191           #include <sys/bitypes.h>
2192       ], [
2193           int64_t a; u_int64_t b; 
2194           a = b = 1;
2195       ], [
2196           AC_DEFINE(HAVE_U_INT64_T)
2197           AC_DEFINE(HAVE_INT64_T)
2198           AC_MSG_RESULT(yes)
2199       ], [
2200           AC_MSG_RESULT(no)
2201       ]
2202    ) 
2203 fi
2204
2205 if (test -z "$have_uintxx_t" && \
2206     test "x$ac_cv_header_sys_bitypes_h" = "xyes")
2207 then
2208    AC_MSG_CHECKING([for uintXX_t types in sys/bitypes.h])
2209    AC_TRY_COMPILE(
2210       [
2211           #include <sys/bitypes.h>
2212       ], [
2213           uint8_t a; uint16_t b; 
2214           uint32_t c; a = b = c = 1;
2215       ], [
2216           AC_DEFINE(HAVE_UINTXX_T)
2217           AC_MSG_RESULT(yes)
2218       ], [
2219           AC_MSG_RESULT(no)
2220       ]
2221    ) 
2222 fi
2223
2224 dnl --------------------------------------------------------------------------
2225 dnl CHECKING FOR REQUIRED LIBRARY FUNCTIONS
2226 dnl --------------------------------------------------------------------------
2227 AC_CHECK_FUNCS( \
2228    fork \
2229    getcwd \
2230    gethostname \
2231    getpid \
2232    gettimeofday \
2233    setpgid \
2234    setpgrp \
2235    setsid \
2236    signal \
2237    strerror \
2238    strncmp \
2239    strncpy \
2240    vfprintf \
2241    ,,
2242    [echo 'configure: cannot find needed function.'; exit 1]
2243 )
2244
2245 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
2246 AC_CHECK_FUNCS(strtoll, [AC_DEFINE(HAVE_STRTOLL)])
2247 AC_CHECK_FUNCS(posix_fadvise)
2248 AC_CHECK_FUNCS(fdatasync)
2249
2250 AC_CHECK_FUNCS(chflags) 
2251
2252 AC_CHECK_FUNCS(snprintf vsnprintf gethostid fseeko)
2253
2254 AC_CACHE_CHECK(for va_copy, ba_cv_va_copy,
2255    [
2256        AC_TRY_LINK(
2257           [
2258               #include <stdarg.h>
2259               void use_va_copy(va_list args){va_list args2; va_copy(args2,args); va_end(args2);}
2260               void call_use_va_copy(int junk,...){va_list args; va_start(args,junk); use_va_copy(args); va_end(args);}
2261           ], [
2262               call_use_va_copy(1,2,3)
2263           ], [
2264               ba_cv_va_copy=yes,
2265           ], [
2266               ba_cv_va_copy=no
2267           ]
2268        )
2269    ]
2270 )
2271 test $ba_cv_va_copy = yes && AC_DEFINE(HAVE_VA_COPY, 1, [Set if va_copy exists])
2272
2273 dnl --------------------------------------------------------------------------
2274 dnl CHECKING FOR THREAD SAFE FUNCTIONS
2275 dnl --------------------------------------------------------------------------
2276 AC_CHECK_FUNCS(localtime_r readdir_r strerror_r gethostbyname_r)
2277
2278 # If resolver functions are not in libc check for -lnsl or -lresolv.
2279 AC_CHECK_FUNC(gethostbyname_r,
2280     AC_MSG_RESULT(using libc's resolver),
2281     AC_CHECK_LIB(nsl,gethostbyname_r)
2282     AC_CHECK_LIB(resolv,gethostbyname_r))
2283
2284 AC_CHECK_FUNCS(inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
2285 AC_CHECK_FUNCS(inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)])
2286 AC_CHECK_FUNCS(gethostbyname2, [AC_DEFINE(HAVE_GETHOSTBYNAME2)])
2287
2288 dnl ----------------------------
2289 dnl check sa_len of sockaddr
2290 dnl ----------------------------
2291 AC_CACHE_CHECK(for struct sockaddr has a sa_len field, ac_cv_struct_sockaddr_sa_len,
2292    [
2293        AC_TRY_COMPILE(
2294           [
2295               #include <sys/socket.h>
2296           ], [
2297               struct sockaddr s; s.sa_len;
2298           ], [
2299              ac_cv_struct_sockaddr_sa_len=yes
2300           ], [ac_cv_struct_sockaddr_sa_len=no
2301           ]
2302        )
2303    ]
2304 )
2305
2306 if test $ac_cv_struct_sockaddr_sa_len = yes; then
2307   AC_DEFINE(HAVE_SA_LEN, 1, [Define if sa_len field exists in struct sockaddr])
2308 fi
2309
2310 AC_FUNC_STRFTIME
2311 AC_FUNC_VPRINTF
2312 AC_FUNC_ALLOCA
2313 AC_FUNC_GETMNTENT
2314 AC_FUNC_CLOSEDIR_VOID
2315 AC_FUNC_SETPGRP             dnl check for BSD setpgrp.
2316 # AC_FUNC_FNMATCH    dnl use local version
2317
2318 AC_CHECK_LIB(intl, gettext, [LIBS="$LIBS -lintl"])
2319
2320 AC_CHECK_LIB(sun, getpwnam)
2321
2322 AC_CHECK_HEADERS(zlib.h)
2323 AC_CHECK_LIB(z, deflate, [FDLIBS="-lz"])
2324 have_zlib=no
2325 if test x$FDLIBS = x-lz; then
2326    AC_DEFINE(HAVE_LIBZ)
2327    have_zlib=yes
2328 fi
2329
2330 dnl
2331 dnl Check for ACL support and libraries
2332 dnl
2333 support_acl=auto
2334 AC_ARG_ENABLE(acl,
2335    AC_HELP_STRING([--disable-acl], [disable acl support @<:@default=auto@:>@]),
2336    [
2337        if test x$enableval = xyes; then
2338           support_acl=yes
2339        elif test x$enableval = xno; then
2340           support_acl=no
2341        fi
2342    ]
2343 )
2344
2345 have_acl=no
2346 have_extended_acl=no
2347 if test x$support_acl = xyes -o x$support_acl = xauto; then
2348    AC_CHECK_HEADER(sys/acl.h, [ AC_DEFINE(HAVE_SYS_ACL_H,1,[Defines if your system have the sys/acl.h header file])] , )
2349    AC_CHECK_FUNC(acl_get_file,
2350       [
2351           have_acl=yes
2352       ], [
2353           AC_CHECK_LIB(acl, acl_get_file,
2354              [
2355                  have_acl=yes;
2356                  FDLIBS="-lacl $FDLIBS"
2357              ], [
2358                  AC_CHECK_LIB(pacl, acl_get_file,
2359                     [
2360                         have_acl=yes;
2361                         FDLIBS="-lpacl $FDLIBS"
2362                     ], [
2363                         AC_CHECK_LIB(sec, acltotext,
2364                            [
2365                                have_acl=yes;
2366                                FDLIBS="-lsec $FDLIBS"
2367
2368                                AC_CHECK_LIB(sec, acl_totext,
2369                                   [
2370                                       have_extended_acl=yes
2371                                   ]
2372                                )
2373                            ]
2374                         )
2375                     ]
2376                  )
2377              ]
2378           )
2379       ]
2380    )
2381
2382    if test x$support_acl = xyes -a $have_acl != yes; then
2383       AC_MSG_ERROR([acl support explicitly enabled but no supported acl implementation found, 
2384   please either load the acl libraries or rerun configure without --enable-acl])
2385    else
2386       if test $have_acl = yes; then
2387          AC_DEFINE([HAVE_ACL],1,[Normal acl support])
2388       fi
2389
2390       if test $have_extended_acl = yes; then
2391          AC_DEFINE([HAVE_EXTENDED_ACL],1,[Extended acl support])
2392       fi
2393    fi
2394 fi
2395
2396 dnl
2397 dnl Check for XATTR support
2398 dnl
2399 support_xattr=auto
2400 AC_ARG_ENABLE(xattr,
2401    AC_HELP_STRING([--disable-xattr], [disable xattr support @<:@default=auto@:>@]),
2402    [
2403        if test x$enableval = xyes; then
2404           support_xattr=yes
2405        elif test x$enableval = xno; then
2406           support_xattr=no
2407        fi
2408    ]
2409 )
2410
2411 have_xattr=no
2412 if test x$support_xattr = xyes -o x$support_xattr = xauto; then
2413    dnl
2414    dnl First check for *BSD support
2415    dnl
2416    AC_CHECK_HEADER(sys/extattr.h, [ AC_DEFINE(HAVE_SYS_EXTATTR_H,1,[Defines if your system have the sys/extattr.h header file])] , )
2417    AC_CHECK_HEADER(libutil.h, [ AC_DEFINE(HAVE_LIBUTIL_H,1,[Defines if your system have the libutil.h header file])] , )
2418    AC_CHECK_FUNCS(extattr_get_link extattr_set_link extattr_list_link,
2419       [
2420           have_xattr=yes
2421           AC_DEFINE([HAVE_EXTATTR_GET_LINK],1,[Define to 1 if you have the 'extattr_get_link' function.])
2422           AC_DEFINE([HAVE_EXTATTR_SET_LINK],1,[Define to 1 if you have the 'extattr_set_link' function.])
2423           AC_DEFINE([HAVE_EXTATTR_LIST_LINK],1,[Define to 1 if you have the 'extattr_list_link' function.])
2424       ]
2425    )
2426    
2427    if test $have_xattr = no; then
2428       AC_CHECK_FUNCS(extattr_get_file extattr_set_file extattr_list_file,
2429          [
2430              have_xattr=yes
2431              AC_DEFINE([HAVE_EXTATTR_GET_FILE],1,[Define to 1 if you have the 'extattr_get_file' function.])
2432              AC_DEFINE([HAVE_EXTATTR_SET_FILE],1,[Define to 1 if you have the 'extattr_set_file' function.])
2433              AC_DEFINE([HAVE_EXTATTR_LIST_FILE],1,[Define to 1 if you have the 'extattr_list_file' function.])
2434          ]
2435       )
2436    fi
2437    
2438    if test $have_xattr = yes; then
2439       have_extattr_string_in_libc=no
2440       AC_CHECK_FUNCS(extattr_namespace_to_string extattr_string_to_namespace,
2441          [
2442              have_extattr_string_in_libc=yes
2443              AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2444              AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2445          ]
2446       )
2447
2448       dnl
2449       dnl If extattr_namespace_to_string and extattr_string_to_namespace are not in libc see if they are in libutil
2450       dnl
2451       if test $have_extattr_string_in_libc = no; then
2452          AC_CHECK_LIB(util, extattr_namespace_to_string extattr_string_to_namespace,
2453             [
2454                 AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
2455                 AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
2456                 FDLIBS="-lutil $FDLIBS"
2457             ]
2458          )
2459       fi
2460    fi
2461
2462    dnl
2463    dnl If we failed to find *BSD support try the Linux or OSX implementation of xattr
2464    dnl
2465    if test $have_xattr = no; then
2466       AC_CHECK_HEADER(sys/xattr.h, [ AC_DEFINE(HAVE_SYS_XATTR_H,1,[Defines if your system have the sys/xattr.h header file])] , )
2467       AC_CHECK_FUNCS(llistxattr lgetxattr lsetxattr,
2468          [
2469              have_xattr=yes
2470              AC_DEFINE([HAVE_LLISTXATTR],1,[Define to 1 if you have the 'llistxattr' function.])
2471              AC_DEFINE([HAVE_LGETXATTR],1,[Define to 1 if you have the 'lgetxattr' function.])
2472              AC_DEFINE([HAVE_LSETXATTR],1,[Define to 1 if you have the 'lsetxattr' function.])
2473          ]
2474       )
2475
2476       if test $have_xattr = no; then
2477          AC_CHECK_FUNCS(listxattr getxattr setxattr,
2478             [
2479                 have_xattr=yes
2480                 AC_DEFINE([HAVE_LISTXATTR],1,[Define to 1 if you have the 'listxattr' function.])
2481                 AC_DEFINE([HAVE_GETXATTR],1,[Define to 1 if you have the 'getxattr' function.])
2482                 AC_DEFINE([HAVE_SETXATTR],1,[Define to 1 if you have the 'setxattr' function.])
2483             ]
2484          )
2485       fi
2486    fi
2487
2488    dnl
2489    dnl If we failed to find *BSD support and the Linux or OSX implementation of xattr try the Solaris xattr implementation
2490    dnl
2491    if test $have_xattr = no; then
2492       AC_CHECK_HEADER(sys/attr.h, [ AC_DEFINE(HAVE_SYS_ATTR_H,1,[Defines if your system have the sys/attr.h header file])] , )
2493       AC_CHECK_HEADER(sys/nvpair.h, [ AC_DEFINE(HAVE_SYS_NVPAIR_H,1,[Defines if your system have the sys/nvpair.h header file])] , )
2494       AC_CHECK_HEADER(attr.h, [ AC_DEFINE(HAVE_ATTR_H,1,[Defines if your system have the attr.h header file])] , )
2495
2496       AC_CHECK_FUNCS(openat fstatat unlinkat fchownat futimesat,
2497          [
2498              have_xattr=yes
2499              AC_DEFINE([HAVE_OPENAT],1,[Define to 1 if you have the 'openat' function.])
2500              AC_DEFINE([HAVE_FSTATAT],1,[Define to 1 if you have the 'fstatat' function.])
2501              AC_DEFINE([HAVE_UNLINKAT],1,[Define to 1 if you have the 'unlinkat' function.])
2502              AC_DEFINE([HAVE_FCHOWNAT],1,[Define to 1 if you have the 'fchownat' function.])
2503              AC_DEFINE([HAVE_FUTIMESAT],1,[Define to 1 if you have the 'futimesat' function.])
2504          ]
2505       )
2506
2507       if test $have_xattr = yes; then
2508          AC_CHECK_LIB(nvpair, nvlist_next_nvpair,
2509             [
2510                 AC_DEFINE([HAVE_NVLIST_NEXT_NVPAIR],1,[Define to 1 if you have the 'nvlist_next_nvpair' function.])
2511                 FDLIBS="-lnvpair $FDLIBS"
2512             ]
2513          )
2514       fi
2515    fi
2516
2517    if test x$support_xattr = xyes -a $have_xattr != yes; then
2518       AC_MSG_ERROR([xattr support explicitly enabled but no supported xattr implementation found, 
2519   please either load the xattr libraries or rerun configure without --enable-xattr])
2520    else
2521       if test $have_xattr = yes; then
2522          AC_DEFINE([HAVE_XATTR],1,[Extended Attributes support])
2523       fi
2524    fi
2525 fi
2526
2527 dnl
2528 dnl Check for pthread libraries
2529 dnl
2530 PTHREAD_LIB=""
2531 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
2532    [
2533        AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
2534           [
2535               AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
2536                  [
2537                      AC_CHECK_FUNC(pthread_create)
2538                  ]
2539               )
2540           ]
2541        )
2542    ]
2543 )
2544
2545 dnl
2546 dnl Check for headers, functions and libraries required to support
2547 dnl keeping readall capabilities
2548 dnl
2549 AC_CHECK_HEADERS(sys/prctl.h sys/capability.h)
2550 AC_CHECK_FUNCS(prctl setreuid)
2551 AC_CHECK_LIB([cap], [cap_set_proc], [CAP_LIBS="-lcap"], [CAP_LIBS=])
2552 if test x$CAP_LIBS = x-lcap; then
2553    AC_DEFINE(HAVE_LIBCAP, 1, [Define if you have libcap])
2554 fi
2555 AC_SUBST(CAP_LIBS)
2556
2557 AC_SUBST(FDLIBS)
2558 AC_DEFINE(FDLIBS)
2559
2560 CFLAGS=${CFLAGS--O}
2561
2562 if test x$have_gcc = xyes ; then
2563    CPPFLAGS="$CPPFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
2564    CFLAGS="$CFLAGS -fno-strict-aliasing -fno-exceptions -fno-rtti"
2565 fi
2566 LDFLAGS=${LDFLAGS--O}
2567 DB_LIBS="${SQL_LFLAGS}"
2568 CPPFLAGS="$CPPFLAGS"
2569 CFLAGS="$CFLAGS"
2570 AC_SUBST(DEBUG)
2571 AC_SUBST(DINCLUDE)
2572 AC_SUBST(CFLAGS)
2573 AC_SUBST(CPPFLAGS)
2574 AC_SUBST(LDFLAGS)
2575 AC_SUBST(X_CFLAGS)
2576 AC_SUBST(DEFS)
2577 AC_SUBST(LIBS)
2578 AC_SUBST(DLIB)
2579 AC_SUBST(DB_LIBS)
2580 AC_SUBST(X_LIBS)
2581 AC_SUBST(X_EXTRA_LIBS)
2582 AC_SUBST(WCFLAGS)
2583 AC_SUBST(WLDFLAGS)
2584 AC_SUBST(WRAPLIBS)
2585
2586 dnl extra configurable objects
2587 OBJLIST=
2588 AC_SUBST(OBJLIST)
2589
2590 lld="lld"
2591 llu="llu"
2592
2593 WCFLAGS=
2594 WLDFLAGS=
2595
2596 dnl
2597 dnl Finally we set appropriate distribution specific
2598 dnl  variables and defaults
2599 dnl
2600 dnl PFILES are platform specific files
2601 PFILES="platforms/Makefile"
2602 PSCMD="ps -e"
2603 WIN32=
2604 MACOSX=
2605
2606 hostname=`uname -n | cut -d '.' -f 1`
2607 if test x${hostname} = x ; then
2608    hostname="localhost"
2609 fi
2610 dnl Make sure hostname is resolved
2611 ping -c 1 $hostname 2>/dev/null 1>/dev/null
2612 if test ! $? = 0; then
2613   hostname="localhost"
2614 fi
2615
2616 case "$DISTNAME" in
2617 aix)
2618    DISTVER=`uname -r`
2619    PSCMD="ps -e -o pid,comm"
2620    PFILES="${PFILES} \
2621       platforms/aix/Makefile"
2622    TAPEDRIVE="/dev/rmt0.1" 
2623   ;;     
2624 alpha)
2625    DISTVER=`uname -r`
2626    PTHREAD_LIB="-lpthread -lexc"
2627    if test "${CC}" = "gcc" ; then
2628       lld="lld"
2629       llu="llu"
2630    else
2631       lld="ld"
2632       llu="lu"
2633    fi
2634    TAPEDRIVE="/dev/nrmt0"
2635   ;;
2636 bsdi)
2637    DISTVER=`uname -a |awk '{print $3}'`
2638    TAPEDRIVE="/dev/nrmt0"
2639    PTHREAD_LIB="-pthread"
2640    CFLAGS="${CFLAGS} -pthread"
2641    PSCMD="ps -ax -o pid,command"
2642    lld="qd"
2643    llu="qu"
2644    PFILES="${PFILES} \
2645        platforms/bsdi/Makefile \
2646        platforms/bsdi/bacula-fd \
2647        platforms/bsdi/bacula-sd \
2648        platforms/bsdi/bacula-dir"
2649    largefile_support="yes"
2650   ;;
2651 cygwin)
2652    DISTVER=`uname -a |awk '{print $3}'`
2653    TAPEDRIVE="/dev/nrst0"
2654    WIN32=win32
2655    WCFLAGS="-mwindows"
2656    WLDFLAGS="-mwindows"
2657   ;;
2658 darwin)
2659    DISTVER=`uname -r`
2660    TAPEDRIVE="/dev/nst0"
2661    PSCMD="ps -e -o pid,command"
2662    MACOSX=macosx
2663    PFILES="${PFILES} \
2664       platforms/darwin/Makefile"
2665   ;;
2666 osx)
2667    DISTVER=`uname -r`
2668    TAPEDRIVE="/dev/nst0"
2669    PSCMD="ps -e -o pid,command"
2670    MACOSX=macosx
2671    PFILES="${PFILES} \
2672       platforms/osx/Makefile"
2673   ;;
2674 debian)
2675    if `test -f /etc/apt/sources.list && grep -q ubuntu /etc/apt/sources.list`; then
2676       DISTNAME="ubuntu"
2677    fi
2678    DISTVER=`cat /etc/debian_version`
2679    if test -f /etc/lsb-release ; then
2680       . /etc/lsb-release
2681       if test "x$DISTRIB_ID" != "x" ; then
2682          DISTNAME=$DISTRIB_ID
2683       fi
2684       if test "x$DISTRIB_RELEASE" != "x" ; then
2685          DISTVER=$DISTRIB_RELEASE
2686       fi
2687    fi
2688    if test "$DISTNAME" = "Ubuntu" ; then
2689       DISTNAME="ubuntu"
2690    fi
2691    TAPEDRIVE="/dev/nst0"
2692    PSCMD="ps -e -o pid,command"
2693    if test "$DISTNAME" = "ubuntu" ; then
2694       PFILES="${PFILES} \
2695          platforms/ubuntu/Makefile \
2696          platforms/ubuntu/bacula-fd \
2697          platforms/ubuntu/bacula-sd \
2698          platforms/ubuntu/bacula-dir"
2699    else 
2700       PFILES="${PFILES} \
2701          platforms/debian/Makefile \
2702          platforms/debian/bacula-fd \
2703          platforms/debian/bacula-sd \
2704          platforms/debian/bacula-dir"
2705    fi
2706   ;;
2707 freebsd)
2708    DISTVER=`uname -a |awk '{print $3}'`
2709    VER=`echo $DISTVER | cut -c 1`
2710    if test x$VER = x4 ; then
2711       PTHREAD_LIB="${PTHREAD_LIBS:--pthread}"
2712       CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS:--pthread}"
2713    fi
2714    lld="qd"
2715    llu="qu"
2716    TAPEDRIVE="/dev/nrsa0"
2717    PSCMD="ps -ax -o pid,command"
2718    PFILES="${PFILES} \
2719        platforms/freebsd/Makefile \
2720        platforms/freebsd/bacula-fd \
2721        platforms/freebsd/bacula-sd \
2722        platforms/freebsd/bacula-dir"
2723    largefile_support="yes"
2724   ;;
2725 hpux)
2726    PSCMD="UNIX95=1; ps -e -o pid,comm"
2727    CFLAGS="${CFLAGS} -D_XOPEN_SOURCE_EXTENDED=1"
2728    DISTVER=`uname -r`
2729    TAPEDRIVE="/dev/rmt/0hnb"
2730    PTHREAD_LIB="-lpthread"
2731    AC_DEFINE([_INCLUDE_LONGLONG])
2732   ;;
2733 irix)
2734    DISTVER=`uname -r`
2735    TAPEDRIVE="/dev/rmt/0cbn"
2736    PSCMD="ps -e -o pid,comm"
2737    PFILES="${PFILES} \
2738        platforms/irix/Makefile \
2739        platforms/irix/bacula-fd \
2740        platforms/irix/bacula-sd \
2741        platforms/irix/bacula-dir"
2742   ;;
2743 netbsd)
2744    DISTVER=`uname -a |awk '{print $3}'`
2745    lld="qd"
2746    llu="qu"
2747    TAPEDRIVE="/dev/nrst0"
2748    PSCMD="ps -ax -o pid,command"
2749    PTHREAD_LIB="-pthread"
2750    CFLAGS="${CFLAGS} -pthread"
2751   ;;
2752 openbsd)
2753    DISTVER=`uname -a |awk '{print $3}'`
2754    lld="qd"
2755    llu="qu"
2756    TAPEDRIVE="/dev/nrst0"
2757    PSCMD="ps -ax -o pid,command"
2758    PTHREAD_LIB="-pthread"
2759    CFLAGS="${CFLAGS} -pthread"
2760    PFILES="${PFILES} \
2761        platforms/openbsd/Makefile \
2762        platforms/openbsd/bacula-fd \
2763        platforms/openbsd/bacula-sd \
2764        platforms/openbsd/bacula-dir"
2765   ;;
2766 redhat)
2767    if test -f /etc/whitebox-release ; then
2768       f=/etc/whitebox-release
2769    else
2770       f=/etc/redhat-release
2771    fi
2772    if test `cat $f | grep release |\
2773          cut -f 3 -d ' '`x = "Enterprise"x ; then
2774       DISTVER="Enterprise "`cat $f | grep release |\
2775           cut -f 6 -d ' '`
2776    else
2777        DISTVER=`cat /etc/redhat-release | grep release |\
2778            cut -f 5 -d ' '`
2779    fi
2780    TAPEDRIVE="/dev/nst0"
2781    PSCMD="ps -e -o pid,command"
2782    PFILES="${PFILES} \
2783        platforms/redhat/Makefile \
2784        platforms/redhat/bacula-fd \
2785        platforms/redhat/bacula-sd \
2786        platforms/redhat/bacula-dir
2787        "
2788   ;;
2789 mandrake)
2790    DISTVER=`cat /etc/mandrake-release | grep release |\
2791       cut -f 5 -d ' '`
2792    TAPEDRIVE="/dev/nst0"
2793    PSCMD="ps -e -o pid,command"
2794    PFILES="${PFILES} \
2795        platforms/mandrake/Makefile \
2796        platforms/mandrake/bacula-fd \
2797        platforms/mandrake/bacula-sd \
2798        platforms/mandrake/bacula-dir \
2799        platforms/mandrake/bacula.spec \
2800        "
2801   ;;
2802 gentoo)
2803    DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
2804    TAPEDRIVE="/dev/nst0"
2805    PSCMD="ps -e -o pid,command"
2806    PFILES="${PFILES} \
2807        platforms/gentoo/Makefile \
2808     platforms/gentoo/bacula-init \
2809        platforms/gentoo/bacula-fd \
2810        platforms/gentoo/bacula-sd \
2811        platforms/gentoo/bacula-dir"
2812   ;;
2813 slackware)
2814    DISTVER=`cat /etc/slackware-version`
2815    TAPEDRIVE="/dev/nst0"
2816    PSCMD="ps -e -o pid,command"
2817    PFILES="${PFILES} \
2818        platforms/slackware/Makefile \
2819        platforms/slackware/rc.bacula-fd \
2820        platforms/slackware/rc.bacula-sd \
2821        platforms/slackware/rc.bacula-dir\
2822        platforms/slackware/functions.bacula"
2823   ;;
2824 solaris)
2825    DISTVER=`uname -r`
2826    TAPEDRIVE="/dev/rmt/0cbn"
2827    PSCMD="ps -e -o pid,comm"
2828    PFILES="${PFILES} \
2829        platforms/solaris/Makefile \
2830        platforms/solaris/bacula-fd \
2831        platforms/solaris/bacula-sd \
2832        platforms/solaris/bacula-dir"
2833    if test x$DISTVER = x5.6 ; then
2834        AC_DEFINE(HAVE_OLD_SOCKOPT)
2835    fi
2836    LIBS="$LIBS -lresolv"
2837   ;;
2838 suse)
2839    DISTVER=`cat /etc/SuSE-release |grep VERSION|\
2840        cut -f 3 -d ' '`
2841    TAPEDRIVE="/dev/nst0"
2842    PSCMD="ps -e -o pid,command"
2843    PFILES="${PFILES} \
2844        platforms/suse/Makefile \
2845        platforms/suse/bacula-fd \
2846        platforms/suse/bacula-sd \
2847        platforms/suse/bacula-dir \
2848        platforms/suse/bacula \
2849        platforms/suse/bacula.spec"
2850   ;;
2851 suse5)
2852    DISTNAME=suse
2853    DISTVER=5.x
2854    TAPEDRIVE="/dev/nst0"
2855    PSCMD="ps -e -o pid,command"
2856    PFILES="${PFILES} \
2857        platforms/suse/Makefile \
2858        platforms/suse/bacula-fd \
2859        platforms/suse/bacula-sd \
2860        platforms/suse/bacula-dir"
2861   ;;
2862 unknown)
2863    DISTVER=unknown
2864    TAPEDRIVE="/dev/nst0"
2865   ;;
2866 *)
2867   echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
2868   ;;
2869 esac  
2870
2871 AC_SUBST(hostname)
2872
2873 LIBS="$PTHREAD_LIB $LIBS"
2874
2875 AC_DEFINE_UNQUOTED(lld, "$lld")
2876 AC_DEFINE_UNQUOTED(llu, "$llu")
2877 AC_SUBST(TAPEDRIVE)
2878 AC_SUBST(PSCMD)
2879 AC_SUBST(WIN32)
2880 AC_SUBST(MACOSX)
2881 AC_SUBST(DISTNAME)
2882 AC_SUBST(DISTVER)
2883
2884 dnl common parts of the Makefile
2885 MCOMMON=./autoconf/Make.common
2886 AC_SUBST_FILE(MCOMMON)
2887
2888 dnl Insanity check
2889 if test "x${subsysdir}" = "x${sbindir}" ; then
2890    echo " "
2891    echo " "
2892    echo "You have set both --sbindir and --with-subsys-dir"
2893    echo "  equal to: ${subsysdir} "
2894    echo "This is not permitted. Please reconfigure."
2895    echo " "
2896    echo "Aborting configuration ..."
2897    echo " "
2898    echo " "
2899    exit 1
2900 fi 
2901
2902 AC_OUTPUT([autoconf/Make.common \
2903            Makefile \
2904            manpages/Makefile \
2905            scripts/startmysql \
2906            scripts/stopmysql \
2907            scripts/btraceback \
2908            scripts/startit \
2909            scripts/stopit \
2910            scripts/bconsole \
2911            scripts/gconsole \
2912            scripts/bacula \
2913            scripts/bacula-ctl-dir \
2914            scripts/bacula-ctl-fd \
2915            scripts/bacula-ctl-sd \
2916            scripts/devel_bacula \
2917            scripts/Makefile \
2918            scripts/logrotate \
2919            scripts/bacula.desktop.gnome1 \
2920            scripts/bacula.desktop.gnome2 \
2921            scripts/bacula.desktop.gnome1.consolehelper \
2922            scripts/bacula.desktop.gnome2.consolehelper \
2923            scripts/bacula.desktop.gnome1.xsu \
2924            scripts/bacula.desktop.gnome2.xsu \
2925            scripts/bgnome-console.console_apps \
2926            scripts/mtx-changer \
2927            scripts/disk-changer \
2928            scripts/dvd-handler \
2929            scripts/dvd-simulator \
2930            scripts/bacula-tray-monitor.desktop \
2931            scripts/logwatch/Makefile \
2932            scripts/logwatch/logfile.bacula.conf \
2933            scripts/wxconsole.console_apps \
2934            scripts/wxconsole.desktop.consolehelper \
2935            scripts/wxconsole.desktop.xsu \
2936            scripts/bat.desktop \
2937            scripts/bat.desktop.xsu \
2938            scripts/bat.desktop.consolehelper \
2939            scripts/bat.console_apps \
2940            src/Makefile \
2941            src/host.h \
2942            src/console/Makefile \
2943            src/console/bconsole.conf \
2944            src/qt-console/bat.conf \
2945            src/qt-console/bat.pro \
2946            src/qt-console/bat.pro.mingw32 \
2947            src/qt-console/install_conf_file \
2948            src/wx-console/Makefile \
2949            src/wx-console/bwx-console.conf \
2950            src/tray-monitor/Makefile \
2951            src/tray-monitor/tray-monitor.conf \
2952            src/dird/Makefile \
2953            src/dird/bacula-dir.conf \
2954            src/lib/Makefile \
2955            src/stored/Makefile \
2956            src/stored/bacula-sd.conf \
2957            src/filed/Makefile \
2958            src/filed/bacula-fd.conf \
2959            src/cats/Makefile \
2960            src/cats/make_catalog_backup \
2961            src/cats/delete_catalog_backup \
2962            src/cats/create_postgresql_database \
2963            src/cats/update_postgresql_tables \
2964            src/cats/make_postgresql_tables \
2965            src/cats/grant_postgresql_privileges \
2966            src/cats/drop_postgresql_tables \
2967            src/cats/drop_postgresql_database \
2968            src/cats/create_mysql_database \
2969            src/cats/update_mysql_tables \
2970            src/cats/make_mysql_tables \
2971            src/cats/grant_mysql_privileges \
2972            src/cats/drop_mysql_tables \
2973            src/cats/drop_mysql_database \
2974            src/cats/create_sqlite_database \
2975            src/cats/update_sqlite_tables \
2976            src/cats/make_sqlite_tables \
2977            src/cats/grant_sqlite_privileges \
2978            src/cats/drop_sqlite_tables \
2979            src/cats/drop_sqlite_database \
2980            src/cats/create_sqlite3_database \
2981            src/cats/update_sqlite3_tables \
2982            src/cats/make_sqlite3_tables \
2983            src/cats/grant_sqlite3_privileges \
2984            src/cats/drop_sqlite3_tables \
2985            src/cats/drop_sqlite3_database \
2986            src/cats/sqlite \
2987            src/cats/mysql \
2988            src/cats/create_bdb_database \
2989            src/cats/update_bdb_tables \
2990            src/cats/make_bdb_tables \
2991            src/cats/grant_bdb_privileges \
2992            src/cats/drop_bdb_tables \
2993            src/cats/drop_bdb_database \
2994            src/cats/create_bacula_database \
2995            src/cats/update_bacula_tables \
2996            src/cats/grant_bacula_privileges \
2997            src/cats/make_bacula_tables \
2998            src/cats/drop_bacula_tables \
2999            src/cats/drop_bacula_database \
3000            src/findlib/Makefile \
3001            src/tools/Makefile \
3002            src/plugins/fd/Makefile \
3003            src/plugins/sd/Makefile \
3004            src/plugins/dir/Makefile \
3005            src/win32/Makefile.inc \
3006            po/Makefile.in \
3007            updatedb/update_mysql_tables_9_to_10 \
3008            updatedb/update_sqlite3_tables_9_to_10 \
3009            updatedb/update_postgresql_tables_9_to_10 \
3010            updatedb/update_sqlite_tables_9_to_10 \
3011            updatedb/update_mysql_tables_10_to_11 \
3012            updatedb/update_sqlite3_tables_10_to_11 \
3013            updatedb/update_postgresql_tables_10_to_11 \
3014            updatedb/update_sqlite_tables_10_to_11 \
3015            $PFILES ],  
3016      [ ]
3017 )
3018
3019 if test "${support_bat}" = "yes" ; then
3020    if test "x$QMAKE" = "xnone" && test "x$QMAKEQT4" = "xnone"; then
3021       AC_MSG_ERROR([Could not find qmake or qmake-qt4 in $PATH. Check your Qt installation])
3022    fi
3023
3024    QMAKEBIN="qmake"
3025
3026    if test "x$QMAKEQT4" != "xnone"; then
3027        QMAKEBIN=qmake-qt4
3028    fi
3029   
3030    cd src/qt-console
3031    echo "Creating bat Makefile"
3032    touch bat
3033    chmod 755 bat
3034    $QMAKEBIN
3035    ${MAKE:-make} clean
3036    cd ${BUILD_DIR}
3037 fi
3038
3039 dnl
3040 dnl if CC is gcc, we can rebuild the dependencies (since the depend rule
3041 dnl requires gcc).  If it's not, don't rebuild dependencies
3042 dnl
3043 if test X"$GCC" = "Xyes" ; then
3044   echo "Doing make of dependencies"
3045   ${MAKE:-make} depend
3046 fi
3047
3048 cd src/qt-console
3049 chmod 755 install_conf_file build-depkgs-qt-console
3050 cd ${BUILD_DIR}
3051
3052 cd scripts
3053 chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
3054 chmod 755 dvd-handler dvd-simulator
3055 chmod 755 bconsole gconsole mtx-changer devel_bacula logrotate
3056 cd ..
3057
3058 c=updatedb
3059 chmod 755 $c/update_mysql_tables_10_to_11   $c/update_sqlite3_tables_10_to_11
3060 chmod 755 $c/update_postgresql_tables_10_to_11   $c/update_sqlite_tables_10_to_11
3061
3062 c=src/cats
3063
3064 chmod 755 $c/create_bacula_database   $c/update_bacula_tables  $c/make_bacula_tables
3065 chmod 755 $c/grant_bacula_privileges  $c/drop_bacula_tables    $c/drop_bacula_database
3066
3067 chmod 755 $c/create_bdb_database      $c/update_bdb_tables     $c/make_bdb_tables
3068 chmod 755 $c/grant_bdb_privileges     $c/drop_bdb_tables       $c/drop_bdb_database
3069
3070 chmod 755 $c/create_mysql_database    $c/update_mysql_tables   $c/make_mysql_tables
3071 chmod 755 $c/grant_mysql_privileges   $c/drop_mysql_tables     $c/drop_mysql_database
3072
3073 chmod 755 $c/create_sqlite_database   $c/update_sqlite_tables  $c/make_sqlite_tables
3074 chmod 755 $c/grant_sqlite_privileges  $c/drop_sqlite_tables    $c/drop_sqlite_database
3075
3076 chmod 755 $c/create_sqlite3_database   $c/update_sqlite3_tables  $c/make_sqlite3_tables
3077 chmod 755 $c/grant_sqlite3_privileges  $c/drop_sqlite3_tables    $c/drop_sqlite3_database
3078
3079 chmod 755 $c/create_postgresql_database  $c/update_postgresql_tables $c/make_postgresql_tables
3080 chmod 755 $c/grant_postgresql_privileges $c/drop_postgresql_tables   $c/drop_postgresql_database
3081
3082 chmod 755 $c/make_catalog_backup $c/delete_catalog_backup
3083 chmod 755 $c/sqlite
3084 chmod 755 $c/mysql
3085
3086 chmod 755 src/win32/build-depkgs-mingw32
3087
3088 if test "x$ac_cv_sys_largefile_CFLAGS" != "xno" ; then
3089    largefile_support="yes"
3090 fi
3091
3092 dnl Only try to find out the version number of the compiler when we know its some kind of GCC compiler
3093 if test X"$GCC" = "Xyes" ; then
3094    dnl
3095    dnl A whole lot of hand springs to get the compiler version.
3096    dnl  This is because gcc changed the output in version 3.0
3097    dnl
3098    CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3099    if test "x${CCVERSION}" = "x" ; then
3100       CCVERSION=`${CC} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3101    fi
3102    CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 3 -d ' '`
3103    if test x"${CXXVERSION}" = x ; then
3104       CXXVERSION=`${CXX} --version | tr '\n' ' ' | cut -f 1 -d ' '`
3105    fi
3106 fi
3107
3108 # clean up any old junk
3109 echo " "
3110 echo "Cleaning up"
3111 echo " "
3112 ${MAKE:-make} clean
3113
3114 if test "x${db_type}" = "xInternal" ; then
3115    echo " "
3116    echo " "
3117    echo "You have not specified either --enable-client-only or one of the"
3118    echo "  supported databases: MySQL, PostgreSQL, SQLite3, SQLite or DBI."
3119    echo "  This is not permitted. Please reconfigure."
3120    echo " "
3121    echo "Aborting the configuration ..."
3122    echo " "
3123    echo " "
3124    exit 1
3125 fi
3126
3127 echo "
3128 Configuration on `date`:
3129
3130    Host:                    ${host}${post_host} -- ${DISTNAME} ${DISTVER}
3131    Bacula version:          ${BACULA} ${VERSION} (${DATE})
3132    Source code location:    ${srcdir}
3133    Install binaries:        ${sbindir}
3134    Install libraries:       ${libdir}
3135    Install config files:    ${sysconfdir}
3136    Scripts directory:       ${scriptdir}
3137    Archive directory:       ${archivedir}
3138    Working directory:       ${working_dir}
3139    PID directory:           ${piddir}
3140    Subsys directory:        ${subsysdir}
3141    Man directory:           ${mandir}
3142    Data directory:          ${datarootdir}
3143    Plugin directory:        ${plugindir}
3144    C Compiler:              ${CC} ${CCVERSION}
3145    C++ Compiler:            ${CXX} ${CXXVERSION}
3146    Compiler flags:          ${WCFLAGS} ${CFLAGS} 
3147    Linker flags:            ${WLDFLAGS} ${LDFLAGS}
3148    Libraries:               ${LIBS}
3149    Statically Linked Tools: ${support_static_tools}
3150    Statically Linked FD:    ${support_static_fd}
3151    Statically Linked SD:    ${support_static_sd}
3152    Statically Linked DIR:   ${support_static_dir}
3153    Statically Linked CONS:  ${support_static_cons}
3154    Database type:           ${db_type}
3155    Database port:           ${db_port}
3156    Database lib:            ${DB_LIBS}
3157    Database name:           ${db_name}
3158    Database user:           ${db_user}
3159  
3160    Job Output Email:        ${job_email}
3161    Traceback Email:         ${dump_email}
3162    SMTP Host Address:       ${smtp_host}
3163  
3164    Director Port:           ${dir_port}
3165    File daemon Port:        ${fd_port}
3166    Storage daemon Port:     ${sd_port}
3167  
3168    Director User:           ${dir_user}
3169    Director Group:          ${dir_group}
3170    Storage Daemon User:     ${sd_user}
3171    Storage DaemonGroup:     ${sd_group}
3172    File Daemon User:        ${fd_user}
3173    File Daemon Group:       ${fd_group}
3174  
3175    SQL binaries Directory   ${SQL_BINDIR}
3176  
3177    Large file support:      $largefile_support
3178    Bacula conio support:    ${got_conio} ${CONS_LIBS}
3179    readline support:        ${got_readline} ${PRTREADLINE_SRC}
3180    TCP Wrappers support:    ${TCPW_MSG} ${WRAPLIBS}
3181    TLS support:             ${support_tls}
3182    Encryption support:      ${support_crypto} 
3183    ZLIB support:            ${have_zlib}
3184    enable-smartalloc:       ${support_smartalloc} 
3185    enable-lockmgr:          ${support_lockmgr}
3186    bat support:             ${support_bat} ${QWT_LDFLAGS}
3187    enable-gnome:            ${support_gnome} ${gnome_version}
3188    enable-bwx-console:      ${support_wx_console} ${wx_version}
3189    enable-tray-monitor:     ${support_tray_monitor}
3190    client-only:             ${build_client_only}
3191    build-dird:              ${build_dird}
3192    build-stored:            ${build_stored}
3193    ACL support:             ${have_acl}
3194    XATTR support:           ${have_xattr}
3195    Python support:          ${support_python} ${PYTHON_LIBS}
3196    Batch insert enabled:    ${support_batch_insert}
3197
3198   " > config.out
3199
3200 cat config.out