]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/autoconf/configure.in
bat: Display a nice graphic on media usage depending on the average
[bacula/bacula] / bacula / autoconf / configure.in
index 34d2d8982b8e7d374593073c7ce9d275c20d01a3..2f1a7fe0b109b8794853516391c9bbca03054c45 100644 (file)
@@ -1,4 +1,4 @@
-lal
+dnl
 dnl
 dnl Process this file with autoconf to produce a configure script.
 dnl
@@ -12,19 +12,29 @@ AC_SUBST(TOP_DIR)
 AC_CONFIG_AUX_DIR(${BUILD_DIR}/autoconf)
 AC_CONFIG_HEADER(src/config.h:autoconf/config.h.in)
 
+dnl minimal Win32 stuff for "make clean"
+WIN32BUILDDIR=${BUILD_DIR}/src/win32
+WIN32MAINDIR=${BUILD_DIR}
+WIN32TOPDIR=${TOP_DIR}   
+AC_SUBST(WIN32BUILDDIR)
+AC_SUBST(WIN32MAINDIR)
+AC_SUBST(WIN32TOPDIR)
+
 dnl require a recent autoconf
 AC_PREREQ(2.61)
 
+
 dnl search for true and false programs.
 AC_PATH_PROGS(TRUEPRG, true, :)
 AC_PATH_PROGS(FALSEPRG, false, :)
 
+
 dnl bacula version
 post_host=
 if test "x$BACULA" != x; then
    post_host=`echo -${BACULA} | tr 'A-Z ' 'a-z-'`
 fi
-BACULA=${BACULA-Bacula}
+BACULA=${BACULA:-Bacula}
 VERSION=`sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
 DATE=`sed -n -e 's/^.*[ \t]*BDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
 LSMDATE=`sed -n -e 's/^.*LSMDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
@@ -83,6 +93,7 @@ AC_PATH_PROG(DVDRWFORMAT, dvd+rw-format, dvd+rw-format)
 AC_PATH_PROG(PKGCONFIG, pkg-config, pkg-config)
 AC_PATH_PROG(QMAKE, qmake, none)
 AC_PATH_PROG(QMAKEQT4, qmake-qt4, none)
+AC_PATH_PROG(GMAKE, gmake, none)
 AC_ARG_VAR(WXCONFIG, [wx-config command. On some systems, you must set it to wx-config-2.6 to use wxWidgets 2.6.])
 if test "x$WXCONFIG" = x; then
    WXCONFIG=wx-config
@@ -165,26 +176,24 @@ dnl --------------------------------------------------
 dnl Include file handling
 dnl --------------------------------------------------
 AC_ARG_ENABLE(includes,
-   AC_HELP_STRING([--enable-includes], [enable installing of include files @<:@default=yes@:>@]),
+   AC_HELP_STRING([--enable-includes], [enable installing of include files @<:@default=no@:>@]),
    [
-       if test x$enableval = xno; then
-         install_includes=no
+       if test x$enableval = xyes; then
+         install_includes=yes
        fi
    ]
 )
 
-dnl It only makes sense to install include files when you install libraries which only happens when libtool is enabled
+dnl It only makes sense to install include files when you install libraries which only happens when
+dnl libtool is enabled
 
-if test x$use_libtool != xno -a x$install_includes != no; then
+if test x$use_libtool != xno -a x$install_includes = xyes; then
    INCLUDE_INSTALL_TARGET="install-includes"
    INCLUDE_UNINSTALL_TARGET="uninstall-includes"
 else
    INCLUDE_INSTALL_TARGET=""
    INCLUDE_UNINSTALL_TARGET=""
 fi
-# Turn off install of includes
-INCLUDE_INSTALL_TARGET=""
-INCLUDE_UNINSTALL_TARGET=""
 AC_SUBST(INCLUDE_INSTALL_TARGET)
 AC_SUBST(INCLUDE_UNINSTALL_TARGET)
 
@@ -203,11 +212,6 @@ dnl Suppport for gettext (translations)
 dnl By default, $datarootdir is ${prefix}/share
 dnl --------------------------------------------------
 AM_GNU_GETTEXT([external])
-if test x${prefix} = xNONE ; then
-   if test `eval echo ${datarootdir}` = NONE/share ; then
-      datarootdir=/usr/share
-   fi
-fi
 
 dnl ------------------------------------------------------------------
 dnl If the user has not set --prefix, we set our default to nothing.
@@ -221,28 +225,40 @@ dnl --includedir, we set it to the package default of /usr/include.
 dnl If either --prefix or --includedir is set, we leave includedir
 dnl alone except to eval it
 dnl ------------------------------------------------------------------
+os_name=`uname -s 2>/dev/null`
 if test x${prefix} = xNONE ; then
    if test `eval echo ${sysconfdir}` = NONE/etc ; then
       sysconfdir=/etc/bacula
    fi
 
    if test `eval echo ${libdir}` = NONE/lib ; then
-      libdir=/usr/lib
+      case ${os_name} in
+      Linux)
+         os_processor=`uname -p 2>/dev/null`
+         case ${os_processor} in
+         x86_64)
+            libdir=/usr/lib64
+            ;;
+         *)
+            libdir=/usr/lib
+            ;;
+         esac
+         ;;
+      *)
+         libdir=/usr/lib
+         ;;
+      esac
    fi
 
    if test `eval echo ${includedir}` = NONE/include ; then
       includedir=/usr/include
    fi
 
+   if test `eval echo ${datarootdir}` = NONE/share ; then
+      datarootdir=/usr/share
+   fi
    prefix=
 fi
-sysconfdir=`eval echo ${sysconfdir}`
-datarootdir=`eval echo ${datarootdir}`
-libdir=`eval echo ${libdir}`
-includedir=`eval echo ${includedir}'
-localedir=`eval echo ${datarootdir}/locale`
-AC_DEFINE_UNQUOTED(SYSCONFDIR, "$sysconfdir")
-AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir") 
 
 dnl -------------------------------------------------------------------------
 dnl  If the user has not set --exec-prefix, we default to ${prefix}
@@ -251,6 +267,16 @@ if test x${exec_prefix} = xNONE ; then
    exec_prefix=${prefix}
 fi
 
+sysconfdir=`eval echo ${sysconfdir}`
+datarootdir=`eval echo ${datarootdir}`
+docdir=`eval echo ${docdir}`
+htmldir=`eval echo ${htmldir}`
+libdir=`eval echo ${libdir}`
+includedir=`eval echo ${includedir}`
+localedir=`eval echo ${datarootdir}/locale`
+AC_DEFINE_UNQUOTED(SYSCONFDIR, "$sysconfdir")
+AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir") 
+
 dnl ------------------------------------------------------------------
 dnl If the user has not set --sbindir, we set our default as /sbin
 dnl ------------------------------------------------------------------
@@ -265,6 +291,21 @@ dnl -------------------------------------------------------------------------
 if test x$mandir = x'${prefix}/man' ; then
    mandir=/usr/share/man
 fi
+
+dnl -------------------------------------------------------------------------
+dnl  If the user has not set --htmldir, we default to /usr/share/doc/bacula/html
+dnl -------------------------------------------------------------------------
+if test x$htmldir = x${docdir} ; then
+   htmldir=`eval echo ${docdir}bacula/html`
+fi
+
+dnl -------------------------------------------------------------------------
+dnl  If the user has not set --docdir, we default to /usr/share/doc/
+dnl -------------------------------------------------------------------------
+if test x$docdir = x'/usr/share/doc/' ; then
+   docdir=`eval echo ${docdir}bacula`
+fi
+
            
 AC_PATH_PROGS(MSGFMT, msgfmt, no)
 if test "$MSGFMT" = "no"
@@ -287,6 +328,7 @@ support_conio=yes
 support_gnome=no
 support_bat=no
 support_wx_console=no
+support_tray_monitor=no
 support_tls=no
 support_crypto=no
 gnome_version=
@@ -302,6 +344,7 @@ build_dird=yes
 build_stored=yes
 cats=
 db_type=Internal
+support_lockmgr=no
 DB_TYPE=bdb
 
 dnl --------------------------------------------------------------------------
@@ -322,24 +365,10 @@ AC_ARG_ENABLE(gnome,
 
 GNOME_DIR=
 if test x$support_gnome = xyes; then
-   abc=`$PKGCONFIG --exists libgnomeui-2.0`
-   pkg=$?
-   if test $pkg = 0; then
-      GNOME_INCLUDEDIR=`$PKGCONFIG --cflags-only-I libgnomeui-2.0`
-      GNOMEUI_LIBS=`$PKGCONFIG --libs-only-l libgnomeui-2.0`
-      GNOME_LIBDIR=`$PKGCONFIG --libs libgnomeui-2.0`
-      GNOME_LIBS=`$PKGCONFIG --libs-only-l libgnomeui-2.0`
-      AC_SUBST(GNOME_INCLUDEDIR)
-      AC_SUBST(GNOMEUI_LIBS)
-      AC_SUBST(GNOME_LIBDIR)
-      AC_SUBST(GNOME_LIBS)
-      GNOME_DIR=src/gnome2-console
-      gnome_version="Version 2.x"
-   else
-      AC_MSG_ERROR(Unable to find Gnome 2 installation)
-   fi
+   AC_MSG_ERROR(bgnome-console no longer supported)
+   AC_MSG_ERROR(--enable-gnome option no longer supported)
 fi
-AC_SUBST(GNOME_DIR)
+AC_SUBST(GNOME_DIR)
 
 dnl -------------------------------------------
 dnl bat (default off)
@@ -457,7 +486,7 @@ if test x$support_wx_console = xyes; then
 
       AC_SUBST(WXCONS_CPPFLAGS)
       AC_SUBST(WXCONS_LDFLAGS)
-      WX_DIR=src/wx-console
+      WX_DIR="src/wx-console"
    else
       echo " "
       echo "wx-config program not found. bwx-console disabled."
@@ -514,6 +543,23 @@ if test x$support_smartalloc = xyes; then
    AC_DEFINE(SMARTALLOC, 1, [Set if you want Smartalloc enabled])
 fi
 
+dnl -------------------------------------------
+dnl Lock Manager (default off)
+dnl -------------------------------------------
+AC_ARG_ENABLE(lockmgr,
+   AC_HELP_STRING([--enable-lockmgr], [enable lock manager support @<:@default=no@:>@]),
+   [
+       if test x$enableval = xyes; then
+         support_lockmgr=yes
+       fi
+   ]
+)
+
+if test x$support_lockmgr = xyes; then
+   AC_DEFINE(_USE_LOCKMGR, 1, [Set if you want Lock Manager enabled])
+fi
+
+
 dnl -------------------------------------------
 dnl static-tools (default off)
 dnl -------------------------------------------
@@ -521,6 +567,10 @@ AC_ARG_ENABLE(static-tools,
    AC_HELP_STRING([--enable-static-tools], [enable static tape tools @<:@default=no@:>@]),
    [
        if test x$enableval = xyes; then
+         if test x$use_libtool = xyes; then
+            AC_MSG_ERROR([Libtool is enabled, not compatible with static tools, 
+  please rerun configure with --disable-libtool])
+         fi
          support_static_tools=yes
        fi
    ]
@@ -539,6 +589,10 @@ AC_ARG_ENABLE(static-fd,
    AC_HELP_STRING([--enable-static-fd], [enable static File daemon @<:@default=no@:>@]),
    [
        if test x$enableval = xyes; then
+         if test x$use_libtool = xyes; then
+            AC_MSG_ERROR([Libtool is enabled, not compatible with static tools, 
+  please rerun configure with --disable-libtool])
+         fi
          support_static_fd=yes
        fi
    ]
@@ -557,6 +611,10 @@ AC_ARG_ENABLE(static-sd,
    AC_HELP_STRING([--enable-static-sd], [enable static Storage daemon @<:@default=no@:>@]),
    [
        if test x$enableval = xyes; then
+         if test x$use_libtool = xyes; then
+            AC_MSG_ERROR([Libtool is enabled, not compatible with static tools, 
+  please rerun configure with --disable-libtool])
+         fi
          support_static_sd=yes
        fi
    ]
@@ -575,6 +633,10 @@ AC_ARG_ENABLE(static-dir,
    AC_HELP_STRING([--enable-static-dir], [enable static Director @<:@default=no@:>@]),
    [
        if test x$enableval = xyes; then
+         if test x$use_libtool = xyes; then
+            AC_MSG_ERROR([Libtool is enabled, not compatible with static tools, 
+  please rerun configure with --disable-libtool])
+         fi
          support_static_dir=yes
        fi
    ]
@@ -593,6 +655,10 @@ AC_ARG_ENABLE(static-cons,
    AC_HELP_STRING([--enable-static-cons], [enable static Console @<:@default=no@:>@]),
    [
        if test x$enableval = xyes; then
+         if test x$use_libtool = xyes; then
+            AC_MSG_ERROR([Libtool is enabled, not compatible with static tools, 
+  please rerun configure with --disable-libtool])
+         fi
          support_static_cons=yes
        fi
    ]
@@ -858,35 +924,43 @@ AC_ARG_WITH(python,
        PYTHON_LIBS=
        if test "$withval" != "no"; then
          if test "$withval" = "yes"; then
-            for python_root in /usr /usr/local /usr/sfw; do
-               for ver in python2.2 python2.3 python2.4 python2.5; do
-                  if test -f $python_root/include/${ver}/Python.h; then
-                     PYTHON_INCDIR=-I$python_root/include/${ver}
-                     if test -d $python_root/lib64/${ver}/config; then
-                        PYTHON_LIBS="-L$python_root/lib64/${ver}/config -l${ver}"
-                     else
-                        PYTHON_LIBS="-L$python_root/lib/${ver}/config -l${ver}"
+            if test -e /usr/bin/python-config ; then
+               PYTHON_INCDIR=`/usr/bin/python-config --includes`
+               PYTHON_LIBS=`/usr/bin/python-config --libs`
+            else
+               for python_root in /usr /usr/local /usr/sfw; do
+                  for ver in python2.2 python2.3 python2.4 python2.5 python2.6 python3; do
+                     if test -f $python_root/include/${ver}/Python.h; then
+                        PYTHON_INCDIR=-I$python_root/include/${ver}
+                        if test -d $python_root/lib64/${ver}/config; then
+                           PYTHON_LIBS="-L$python_root/lib64/${ver}/config -l${ver}"
+                        else
+                           PYTHON_LIBS="-L$python_root/lib/${ver}/config -l${ver}"
+                        fi
+                        break 
                      fi
-                     break 
-                  fi
+                  done
                done
-            done
 
-            if test x$PYTHON_INCDIR = x; then
-               if test -f $prefix/include/Python.h; then
-                  PYTHON_INCDIR=-I$prefix/include
-                  if test -d $prefix/lib64/config; then
-                     PYTHON_LIBS="-L$prefix/lib64/config -lpython"
+               if test x$PYTHON_INCDIR = x; then
+                  if test -f $prefix/include/Python.h; then
+                     PYTHON_INCDIR=-I$prefix/include
+                     if test -d $prefix/lib64/config; then
+                        PYTHON_LIBS="-L$prefix/lib64/config -lpython"
+                     else
+                        PYTHON_LIBS="-L$prefix/lib/config -lpython"
+                     fi
                   else
-                     PYTHON_LIBS="-L$prefix/lib/config -lpython"
+                     AC_MSG_RESULT(no)
+                     AC_MSG_ERROR(Unable to find Python.h in standard locations)
                   fi
-               else
-                  AC_MSG_RESULT(no)
-                  AC_MSG_ERROR(Unable to find Python.h in standard locations)
                fi
             fi
          else
-            if test -f $withval/Python.h; then
+            if test -e $withval/bin/python-config ; then
+               PYTHON_INCDIR=`$withval/bin/python-config --includes`
+               PYTHON_LIBS=`$withval/bin/python-config --libs`
+            elif test -f $withval/Python.h; then
                PYTHON_INCDIR=-I$withval
                PYTHON_LIBS="-L$withval/config -lpython"
             elif test -f $withval/include/Python.h; then
@@ -950,8 +1024,8 @@ AC_ARG_WITH(tcp-wrappers,
        if test "x$withval" != "xno" ; then
          saved_LIBS="$LIBS"
          LIBS="$saved_LIBS -lwrap"
-         AC_MSG_CHECKING(for libwrap)
          AC_SEARCH_LIBS(nanosleep, [rt])
+         AC_MSG_CHECKING(for libwrap)
          AC_TRY_LINK(
             [ 
               #include <sys/types.h>
@@ -1092,6 +1166,11 @@ else
    OPENSSL_INC=""
 fi
 
+if test "$support_tls" = "no"; then
+   OPENSSL_LIBS=""
+   OPENSSL_INC=""
+fi  
+
 AC_MSG_RESULT([$support_tls])
 AC_SUBST(OPENSSL_LIBS)
 AC_SUBST(OPENSSL_INC)
@@ -1119,7 +1198,7 @@ AC_SUBST(working_dir)
 dnl ------------------------------------------------------------------
 dnl If the user has not set archivedir, we set our default as /tmp
 dnl ------------------------------------------------------------------
-archive_dir=/tmp
+archivedir=/tmp
 AC_ARG_WITH(archivedir,
    AC_HELP_STRING([--with-archivedir=PATH], [specify path of SD archive directory]),
    [
@@ -1131,6 +1210,40 @@ AC_ARG_WITH(archivedir,
 
 AC_SUBST(archivedir)
 
+dnl ------------------------------------------------------------------
+dnl Allow the user to specify the daemon resource name default hostname
+dnl ------------------------------------------------------------------
+basename=`hostname`
+AC_ARG_WITH(basename,
+   AC_HELP_STRING([--with-basename=RESNAME], [specify base resource name for daemons]),
+   [
+       if test "x$withval" != "xno" ; then     
+         basename=$withval
+       fi
+   ]
+)
+
+AC_SUBST(basename)
+
+dnl ------------------------------------------------------------------
+dnl Allow the user to override the hostname (default = machine hostname)
+dnl ------------------------------------------------------------------
+hostname=`uname -n | cut -d '.' -f 1`
+if test x${hostname} = x ; then
+  hostname="localhost"
+fi
+AC_ARG_WITH(hostname,
+   AC_HELP_STRING([--with-hostname=RESNAME], [specify host name for daemons]),
+   [
+       if test "x$withval" != "xno" ; then
+        hostname=$withval
+       fi
+   ]
+)
+
+AC_SUBST(hostname)
+
+
 dnl ------------------------------------------
 dnl Where to place scriptdir (script files)
 dnl ------------------------------------------
@@ -1146,10 +1259,42 @@ AC_ARG_WITH(scriptdir,
 
 AC_SUBST(scriptdir)
 
+
+dnl ------------------------------------------
+dnl Where to place bsrdir (bsr files)
+dnl ------------------------------------------
+bsrdir=/tmp
+AC_ARG_WITH(bsrdir,
+   AC_HELP_STRING([--with-bsrdir=PATH], [specify path of Bacula bsrs directory]),
+   [
+       if test "x$withval" != "xno" ; then     
+         bsrdir=$withval
+       fi
+   ]
+)
+
+AC_SUBST(bsrdir)
+
+dnl ------------------------------------------
+dnl Where to place logdir (bsr files)
+dnl ------------------------------------------
+logdir=/tmp
+AC_ARG_WITH(logdir,
+   AC_HELP_STRING([--with-logdir=PATH], [specify path of Bacula logs directory]),
+   [
+       if test "x$withval" != "xno" ; then     
+         logdir=$withval
+       fi
+   ]
+)
+
+AC_SUBST(logdir)
+
+
 # ------------------------------------------
-# Where to place plugindir (script files)
+# Where to place plugindir (plugin files)
 # ------------------------------------------
-plugindir=`eval echo ${sysconfdir}`
+plugindir=`eval echo ${libdir}`
 AC_ARG_WITH(plugindir,
    AC_HELP_STRING([--with-plugindir=PATH], [specify path of Bacula plugins directory]),
    [
@@ -1666,7 +1811,6 @@ AC_CHECK_HEADERS( \
    sys/time.h \
    sys/types.h \
    arpa/nameser.h \
-   resolv.h \
    mtio.h \
    sys/mtio.h \
    sys/tape.h \
@@ -1724,26 +1868,6 @@ AC_CACHE_CHECK(for socklen_t, ba_cv_header_socklen_t,
 )
 test $ba_cv_header_socklen_t = yes && AC_DEFINE(HAVE_SOCKLEN_T)
 
-dnl --------------------------------------------------------------------------
-dnl Check for bigendian
-dnl --------------------------------------------------------------------------
-AC_CACHE_CHECK([for bigendian], ba_cv_bigendian,
-   [
-       AC_TRY_RUN(
-         [
-             main(){long a=1L; char *p=(char *)&a; exit(*p);}
-         ], [
-            ba_cv_bigendian=yes
-         ], [
-            ba_cv_bigendian=no
-         ], [
-            ba_cv_bigendian=no
-         ]
-       )
-   ]
-)
-test $ba_cv_bigendian = yes && AC_DEFINE(HAVE_BIGENDIAN)
-
 dnl --------------------------------------------------------------------------
 dnl Check for typeof()
 dnl --------------------------------------------------------------------------
@@ -1833,6 +1957,8 @@ AC_TYPE_UID_T
 AC_TYPE_SIZE_T
 AC_TYPE_PID_T
 AC_TYPE_OFF_T
+AC_TYPE_INTPTR_T
+AC_TYPE_UINTPTR_T
 AC_CHECK_TYPE(ino_t, unsigned long)
 AC_CHECK_TYPE(dev_t, unsigned long)
 AC_CHECK_TYPE(daddr_t, long)
@@ -2202,32 +2328,205 @@ if test x$FDLIBS = x-lz; then
 fi
 
 dnl
-dnl Check for ACL libraries
+dnl Check for ACL support and libraries
 dnl
+support_acl=auto
+AC_ARG_ENABLE(acl,
+   AC_HELP_STRING([--disable-acl], [disable acl support @<:@default=auto@:>@]),
+   [
+       if test x$enableval = xyes; then
+         support_acl=yes
+       elif test x$enableval = xno; then
+         support_acl=no
+       fi
+   ]
+)
+
 have_acl=no
-AC_CHECK_HEADER(sys/acl.h)
-AC_CHECK_FUNC(acl_get_file, [have_acl=yes],
+have_extended_acl=no
+if test x$support_acl = xyes -o x$support_acl = xauto; then
+   AC_CHECK_HEADER(sys/acl.h, [ AC_DEFINE(HAVE_SYS_ACL_H,1,[Defines if your system have the sys/acl.h header file])] , )
+   AC_CHECK_FUNC(acl_get_file,
+      [
+         have_acl=yes
+      ], [
+         AC_CHECK_LIB(acl, acl_get_file,
+            [
+                have_acl=yes;
+                FDLIBS="-lacl $FDLIBS"
+            ], [
+                AC_CHECK_LIB(pacl, acl_get_file,
+                   [
+                       have_acl=yes;
+                       FDLIBS="-lpacl $FDLIBS"
+                   ], [
+                       AC_CHECK_LIB(sec, acltotext,
+                          [
+                              have_acl=yes;
+                              FDLIBS="-lsec $FDLIBS"
+
+                              AC_CHECK_LIB(sec, acl_totext,
+                                 [
+                                     have_extended_acl=yes
+                                 ]
+                              )
+                          ]
+                       )
+                   ]
+                )
+            ]
+         )
+      ]
+   )
+
+   if test x$support_acl = xyes -a $have_acl != yes; then
+      AC_MSG_ERROR([acl support explicitly enabled but no supported acl implementation found, 
+  please either load the acl libraries or rerun configure without --enable-acl])
+   else
+      if test $have_acl = yes; then
+        AC_DEFINE([HAVE_ACL],1,[Normal acl support])
+      fi
+
+      if test $have_extended_acl = yes; then
+        AC_DEFINE([HAVE_EXTENDED_ACL],1,[Extended acl support])
+      fi
+   fi
+fi
+
+dnl
+dnl Check for XATTR support
+dnl
+support_xattr=auto
+AC_ARG_ENABLE(xattr,
+   AC_HELP_STRING([--disable-xattr], [disable xattr support @<:@default=auto@:>@]),
    [
-       AC_CHECK_LIB(acl, acl_get_file,
-         [
-             have_acl=yes;
-             FDLIBS="-lacl $FDLIBS"
-         ], [
-             AC_CHECK_LIB(sec, acltotext,
-                [
-                    have_acl=yes;
-                    FDLIBS="-lsec $FDLIBS"
-                ]
-             )
-         ]
-       )
+       if test x$enableval = xyes; then
+         support_xattr=yes
+       elif test x$enableval = xno; then
+         support_xattr=no
+       fi
    ]
 )
-if test $have_acl = yes; then
-   AC_DEFINE(HAVE_ACL)
+
+have_xattr=no
+if test x$support_xattr = xyes -o x$support_xattr = xauto; then
+   dnl
+   dnl First check for *BSD support
+   dnl
+   AC_CHECK_HEADER(sys/extattr.h, [ AC_DEFINE(HAVE_SYS_EXTATTR_H,1,[Defines if your system have the sys/extattr.h header file])] , )
+   AC_CHECK_HEADER(libutil.h, [ AC_DEFINE(HAVE_LIBUTIL_H,1,[Defines if your system have the libutil.h header file])] , )
+   AC_CHECK_FUNCS(extattr_get_link extattr_set_link extattr_list_link,
+      [
+         have_xattr=yes
+         AC_DEFINE([HAVE_EXTATTR_GET_LINK],1,[Define to 1 if you have the 'extattr_get_link' function.])
+         AC_DEFINE([HAVE_EXTATTR_SET_LINK],1,[Define to 1 if you have the 'extattr_set_link' function.])
+         AC_DEFINE([HAVE_EXTATTR_LIST_LINK],1,[Define to 1 if you have the 'extattr_list_link' function.])
+      ]
+   )
+   
+   if test $have_xattr = no; then
+      AC_CHECK_FUNCS(extattr_get_file extattr_set_file extattr_list_file,
+         [
+            have_xattr=yes
+            AC_DEFINE([HAVE_EXTATTR_GET_FILE],1,[Define to 1 if you have the 'extattr_get_file' function.])
+            AC_DEFINE([HAVE_EXTATTR_SET_FILE],1,[Define to 1 if you have the 'extattr_set_file' function.])
+            AC_DEFINE([HAVE_EXTATTR_LIST_FILE],1,[Define to 1 if you have the 'extattr_list_file' function.])
+         ]
+      )
+   fi
+   
+   if test $have_xattr = yes; then
+      have_extattr_string_in_libc=no
+      AC_CHECK_FUNCS(extattr_namespace_to_string extattr_string_to_namespace,
+         [
+             have_extattr_string_in_libc=yes
+            AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
+            AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
+         ]
+      )
+
+      dnl
+      dnl If extattr_namespace_to_string and extattr_string_to_namespace are not in libc see if they are in libutil
+      dnl
+      if test $have_extattr_string_in_libc = no; then
+         AC_CHECK_LIB(util, extattr_namespace_to_string extattr_string_to_namespace,
+            [
+               AC_DEFINE([HAVE_EXTATTR_NAMESPACE_TO_STRING],1,[Define to 1 if you have the 'extattr_namespace_to_string' function.])
+               AC_DEFINE([HAVE_EXTATTR_STRING_TO_NAMESPACE],1,[Define to 1 if you have the 'extattr_string_to_namespace' function.])
+                FDLIBS="-lutil $FDLIBS"
+            ]
+         )
+      fi
+   fi
+
+   dnl
+   dnl If we failed to find *BSD support try the Linux or OSX implementation of xattr
+   dnl
+   if test $have_xattr = no; then
+      AC_CHECK_HEADER(sys/xattr.h, [ AC_DEFINE(HAVE_SYS_XATTR_H,1,[Defines if your system have the sys/xattr.h header file])] , )
+      AC_CHECK_FUNCS(llistxattr lgetxattr lsetxattr,
+         [
+            have_xattr=yes
+            AC_DEFINE([HAVE_LLISTXATTR],1,[Define to 1 if you have the 'llistxattr' function.])
+            AC_DEFINE([HAVE_LGETXATTR],1,[Define to 1 if you have the 'lgetxattr' function.])
+            AC_DEFINE([HAVE_LSETXATTR],1,[Define to 1 if you have the 'lsetxattr' function.])
+         ]
+      )
+
+      if test $have_xattr = no; then
+         AC_CHECK_FUNCS(listxattr getxattr setxattr,
+           [
+               have_xattr=yes
+               AC_DEFINE([HAVE_LISTXATTR],1,[Define to 1 if you have the 'listxattr' function.])
+               AC_DEFINE([HAVE_GETXATTR],1,[Define to 1 if you have the 'getxattr' function.])
+               AC_DEFINE([HAVE_SETXATTR],1,[Define to 1 if you have the 'setxattr' function.])
+           ]
+         )
+      fi
+   fi
+
+   dnl
+   dnl If we failed to find *BSD support and the Linux or OSX implementation of xattr try the Solaris xattr implementation
+   dnl
+   if test $have_xattr = no; then
+      AC_CHECK_HEADER(sys/attr.h, [ AC_DEFINE(HAVE_SYS_ATTR_H,1,[Defines if your system have the sys/attr.h header file])] , )
+      AC_CHECK_HEADER(sys/nvpair.h, [ AC_DEFINE(HAVE_SYS_NVPAIR_H,1,[Defines if your system have the sys/nvpair.h header file])] , )
+      AC_CHECK_HEADER(attr.h, [ AC_DEFINE(HAVE_ATTR_H,1,[Defines if your system have the attr.h header file])] , )
+
+      AC_CHECK_FUNCS(openat fstatat unlinkat fchownat futimesat,
+        [
+            have_xattr=yes
+             AC_DEFINE([HAVE_OPENAT],1,[Define to 1 if you have the 'openat' function.])
+             AC_DEFINE([HAVE_FSTATAT],1,[Define to 1 if you have the 'fstatat' function.])
+             AC_DEFINE([HAVE_UNLINKAT],1,[Define to 1 if you have the 'unlinkat' function.])
+             AC_DEFINE([HAVE_FCHOWNAT],1,[Define to 1 if you have the 'fchownat' function.])
+             AC_DEFINE([HAVE_FUTIMESAT],1,[Define to 1 if you have the 'futimesat' function.])
+        ]
+      )
+
+      if test $have_xattr = yes; then
+        AC_CHECK_LIB(nvpair, nvlist_next_nvpair,
+           [
+                AC_DEFINE([HAVE_NVLIST_NEXT_NVPAIR],1,[Define to 1 if you have the 'nvlist_next_nvpair' function.])
+               FDLIBS="-lnvpair $FDLIBS"
+           ]
+        )
+      fi
+   fi
+
+   if test x$support_xattr = xyes -a $have_xattr != yes; then
+      AC_MSG_ERROR([xattr support explicitly enabled but no supported xattr implementation found, 
+  please either load the xattr libraries or rerun configure without --enable-xattr])
+   else
+      if test $have_xattr = yes; then
+         AC_DEFINE([HAVE_XATTR],1,[Extended Attributes support])
+      fi
+   fi
 fi
 
+dnl
 dnl Check for pthread libraries
+dnl
 PTHREAD_LIB=""
 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
    [
@@ -2243,6 +2542,18 @@ AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
    ]
 )
 
+dnl
+dnl Check for headers, functions and libraries required to support
+dnl keeping readall capabilities
+dnl
+AC_CHECK_HEADERS(sys/prctl.h sys/capability.h)
+AC_CHECK_FUNCS(prctl setreuid)
+AC_CHECK_LIB([cap], [cap_set_proc], [CAP_LIBS="-lcap"], [CAP_LIBS=])
+if test x$CAP_LIBS = x-lcap; then
+   AC_DEFINE(HAVE_LIBCAP, 1, [Define if you have libcap])
+fi
+AC_SUBST(CAP_LIBS)
+
 AC_SUBST(FDLIBS)
 AC_DEFINE(FDLIBS)
 
@@ -2291,10 +2602,17 @@ PFILES="platforms/Makefile"
 PSCMD="ps -e"
 WIN32=
 MACOSX=
+
 hostname=`uname -n | cut -d '.' -f 1`
 if test x${hostname} = x ; then
    hostname="localhost"
 fi
+dnl Make sure hostname is resolved
+ping -c 1 $hostname 2>/dev/null 1>/dev/null
+if test ! $? = 0; then
+  hostname="localhost"
+fi
+
 case "$DISTNAME" in
 aix)
    DISTVER=`uname -r`
@@ -2345,12 +2663,15 @@ darwin)
    PFILES="${PFILES} \
       platforms/darwin/Makefile"
   ;;
+osx)
+   DISTVER=`uname -r`
+   TAPEDRIVE="/dev/nst0"
+   PSCMD="ps -e -o pid,command"
+   MACOSX=macosx
+   PFILES="${PFILES} \
+      platforms/osx/Makefile"
+  ;;
 debian)
-   dnl Make sure hostname is resolved
-   ping -c 1 $hostname 2>&1 1>/dev/null
-   if test ! $? = 0; then
-      hostname="localhost"
-   fi
    if `test -f /etc/apt/sources.list && grep -q ubuntu /etc/apt/sources.list`; then
       DISTNAME="ubuntu"
    fi
@@ -2384,11 +2705,6 @@ debian)
    fi
   ;;
 freebsd)
-   dnl Make sure hostname is resolved
-   ping -c 1 $hostname 2>&1 1>/dev/null
-   if test ! $? = 0; then
-      hostname="localhost"
-   fi
    DISTVER=`uname -a |awk '{print $3}'`
    VER=`echo $DISTVER | cut -c 1`
    if test x$VER = x4 ; then
@@ -2448,11 +2764,6 @@ openbsd)
        platforms/openbsd/bacula-dir"
   ;;
 redhat)
-   dnl Make sure hostname is resolved
-   ping -c 1 $hostname 2>&1 1>/dev/null
-   if test ! $? = 0; then
-      hostname="localhost"
-   fi
    if test -f /etc/whitebox-release ; then
       f=/etc/whitebox-release
    else
@@ -2472,16 +2783,10 @@ redhat)
        platforms/redhat/Makefile \
        platforms/redhat/bacula-fd \
        platforms/redhat/bacula-sd \
-       platforms/redhat/bacula-dir \
-       platforms/redhat/bacula.spec \
+       platforms/redhat/bacula-dir
        "
   ;;
 mandrake)
-   dnl Make sure hostname is resolved
-   ping -c 1 $hostname 2>&1 1>/dev/null
-   if test ! $? = 0; then
-      hostname="localhost"
-   fi
    DISTVER=`cat /etc/mandrake-release | grep release |\
       cut -f 5 -d ' '`
    TAPEDRIVE="/dev/nst0"
@@ -2495,11 +2800,6 @@ mandrake)
        "
   ;;
 gentoo)
-   dnl Make sure hostname is resolved
-   ping -c 1 $hostname 2>&1 1>/dev/null
-   if test ! $? = 0; then
-      hostname="localhost"
-   fi
    DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
    TAPEDRIVE="/dev/nst0"
    PSCMD="ps -e -o pid,command"
@@ -2511,11 +2811,6 @@ gentoo)
        platforms/gentoo/bacula-dir"
   ;;
 slackware)
-   dnl Make sure hostname is resolved
-   ping -c 1 $hostname 2>&1 1>/dev/null
-   if test ! $? = 0; then
-      hostname="localhost"
-   fi
    DISTVER=`cat /etc/slackware-version`
    TAPEDRIVE="/dev/nst0"
    PSCMD="ps -e -o pid,command"
@@ -2541,11 +2836,6 @@ solaris)
    LIBS="$LIBS -lresolv"
   ;;
 suse)
-   dnl Make sure hostname is resolved
-   ping -c 1 $hostname 2>&1 1>/dev/null
-   if test ! $? = 0; then
-      hostname="localhost"
-   fi
    DISTVER=`cat /etc/SuSE-release |grep VERSION|\
        cut -f 3 -d ' '`
    TAPEDRIVE="/dev/nst0"
@@ -2559,11 +2849,6 @@ suse)
        platforms/suse/bacula.spec"
   ;;
 suse5)
-   dnl Make sure hostname is resolved
-   ping -c 1 $hostname 2>&1 1>/dev/null
-   if test ! $? = 0; then
-      hostname="localhost"
-   fi
    DISTNAME=suse
    DISTVER=5.x
    TAPEDRIVE="/dev/nst0"
@@ -2656,8 +2941,6 @@ AC_OUTPUT([autoconf/Make.common \
           src/host.h \
           src/console/Makefile \
           src/console/bconsole.conf \
-          src/gnome2-console/Makefile \
-          src/gnome2-console/bgnome-console.conf \
           src/qt-console/bat.conf \
           src/qt-console/bat.pro \
           src/qt-console/bat.pro.mingw32 \
@@ -2717,7 +3000,14 @@ AC_OUTPUT([autoconf/Make.common \
           src/findlib/Makefile \
           src/tools/Makefile \
           src/plugins/fd/Makefile \
+          src/plugins/sd/Makefile \
+          src/plugins/dir/Makefile \
+          src/win32/Makefile.inc \
           po/Makefile.in \
+          updatedb/update_mysql_tables_9_to_10 \
+          updatedb/update_sqlite3_tables_9_to_10 \
+          updatedb/update_postgresql_tables_9_to_10 \
+          updatedb/update_sqlite_tables_9_to_10 \
           updatedb/update_mysql_tables_10_to_11 \
           updatedb/update_sqlite3_tables_10_to_11 \
           updatedb/update_postgresql_tables_10_to_11 \
@@ -2728,8 +3018,7 @@ AC_OUTPUT([autoconf/Make.common \
 
 if test "${support_bat}" = "yes" ; then
    if test "x$QMAKE" = "xnone" && test "x$QMAKEQT4" = "xnone"; then
-      echo "Could not find qmake or qmake-qt4 in $PATH. Check your Qt installation"
-      exit 1
+      AC_MSG_ERROR([Could not find qmake or qmake-qt4 in $PATH. Check your Qt installation])
    fi
 
    QMAKEBIN="qmake"
@@ -2739,10 +3028,11 @@ if test "${support_bat}" = "yes" ; then
    fi
   
    cd src/qt-console
-   chmod 755 install_conf_file build-depkgs-qt-console
    echo "Creating bat Makefile"
+   touch bat
+   chmod 755 bat
    $QMAKEBIN
-   make clean
+   ${MAKE:-make} clean
    cd ${BUILD_DIR}
 fi
 
@@ -2755,6 +3045,10 @@ if test X"$GCC" = "Xyes" ; then
   ${MAKE:-make} depend
 fi
 
+cd src/qt-console
+chmod 755 install_conf_file build-depkgs-qt-console
+cd ${BUILD_DIR}
+
 cd scripts
 chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
 chmod 755 dvd-handler dvd-simulator
@@ -2811,6 +3105,12 @@ if test X"$GCC" = "Xyes" ; then
    fi
 fi
 
+# clean up any old junk
+echo " "
+echo "Cleaning up"
+echo " "
+${MAKE:-make} clean
+
 if test "x${db_type}" = "xInternal" ; then
    echo " "
    echo " "
@@ -2840,6 +3140,7 @@ Configuration on `date`:
    Subsys directory:       ${subsysdir}
    Man directory:          ${mandir}
    Data directory:         ${datarootdir}
+   Plugin directory:       ${plugindir}
    C Compiler:             ${CC} ${CCVERSION}
    C++ Compiler:           ${CXX} ${CXXVERSION}
    Compiler flags:         ${WCFLAGS} ${CFLAGS} 
@@ -2881,6 +3182,7 @@ Configuration on `date`:
    Encryption support:     ${support_crypto} 
    ZLIB support:           ${have_zlib}
    enable-smartalloc:      ${support_smartalloc} 
+   enable-lockmgr:         ${support_lockmgr}
    bat support:            ${support_bat} ${QWT_LDFLAGS}
    enable-gnome:           ${support_gnome} ${gnome_version}
    enable-bwx-console:     ${support_wx_console} ${wx_version}
@@ -2889,6 +3191,7 @@ Configuration on `date`:
    build-dird:             ${build_dird}
    build-stored:           ${build_stored}
    ACL support:            ${have_acl}
+   XATTR support:          ${have_xattr}
    Python support:         ${support_python} ${PYTHON_LIBS}
    Batch insert enabled:    ${support_batch_insert}