#! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for bacula 5.2.8.
+# Generated by GNU Autoconf 2.68 for bacula 5.2.9.
 #
 #
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
 # Identity of this package.
 PACKAGE_NAME='bacula'
 PACKAGE_TARNAME='bacula'
-PACKAGE_VERSION='5.2.8'
-PACKAGE_STRING='bacula 5.2.8'
+PACKAGE_VERSION='5.2.9'
+PACKAGE_STRING='bacula 5.2.9'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL=''
 
 DEBUG
 FDLIBS
 CAP_LIBS
+AFS_LIBS
+AFS_CFLAGS
 LZOLIBS
 ZLIBS
 LIBOBJS
 with_sqlite3
 enable_largefile
 with_x
+enable_afs
+with_afsdir
 enable_acl
 enable_xattr
 with_systemd
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures bacula 5.2.8 to adapt to many kinds of systems.
+\`configure' configures bacula 5.2.9 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of bacula 5.2.8:";;
+     short | recursive ) echo "Configuration of bacula 5.2.9:";;
    esac
   cat <<\_ACEOF
 
   --disable-readline      disable readline support [default=yes]
   --enable-batch-insert   enable the DB batch insert code [default=yes]
   --disable-largefile     omit support for large files
+  --disable-afs           disable afs support [default=auto]
   --disable-acl           disable acl support [default=auto]
   --disable-xattr         disable xattr support [default=auto]
 
                           install directory, default is to search through a
                           number of common places for the SQLite3 files.
   --with-x                use the X Window System
+  --with-afsdir[=DIR]     Directory holding AFS includes/libs
   --with-systemd[=UNITDIR]
                           Include systemd support. UNITDIR is where systemd
                           system .service files are located, default is to ask
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-bacula configure 5.2.8
+bacula configure 5.2.9
 generated by GNU Autoconf 2.68
 
 Copyright (C) 2010 Free Software Foundation, Inc.
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by bacula $as_me 5.2.8, which was
+It was created by bacula $as_me 5.2.9, which was
 generated by GNU Autoconf 2.68.  Invocation command line was
 
   $ $0 $@
 
 
 
+AFS_CFLAGS=""
+AFS_LIBS=""
+support_afs=auto
+# Check whether --enable-afs was given.
+if test "${enable_afs+set}" = set; then :
+  enableval=$enable_afs;
+       if test x$enableval = xyes; then
+         support_afs=yes
+       elif test x$enableval = xno; then
+         support_afs=no
+       fi
+
+
+fi
+
+
+have_afs=no
+if test x$support_afs = xyes -o x$support_afs = xauto; then
+
+# Check whether --with-afsdir was given.
+if test "${with_afsdir+set}" = set; then :
+  withval=$with_afsdir; with_afsdir=$withval
+
+fi
+
+
+            if test x$with_afsdir = x; then
+      for root in /usr /usr/local; do
+        if test -d ${root}/include/afs/ ; then
+           with_afsdir=${root}
+           break
+        fi
+        if test -d ${root}/include/openafs/afs/ ; then
+           with_afsdir=${root}
+           break
+        fi
+      done
+   fi
+
+   if test -d ${with_afsdir}/include/afs/ ; then
+      AFS_CFLAGS="-I${with_afsdir}/include"
+   else
+      if test -d ${with_afsdir}/include/openafs/afs/ ; then
+         AFS_CFLAGS="-I${with_afsdir}/include/openafs"
+      fi
+   fi
+
+   saved_CFLAGS="${CFLAGS}"
+   saved_CPPFLAGS="${CPPFLAGS}"
+   CFLAGS="${AFS_CFLAGS} ${saved_CFLAGS}"
+   CPPFLAGS="${AFS_CFLAGS} ${saved_CPPFLAGS}"
+
+   for ac_header in afs/afsint.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "afs/afsint.h" "ac_cv_header_afs_afsint_h" "$ac_includes_default"
+if test "x$ac_cv_header_afs_afsint_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_AFS_AFSINT_H 1
+_ACEOF
+
+fi
+
+done
+
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+          #include <afs/afsint.h>
+          #include <afs/venus.h>
+
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+$as_echo "#define HAVE_AFS_VENUS_H 1" >>confdefs.h
+
+
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+   CFLAGS="${saved_CFLAGS}"
+   CPPFLAGS="${saved_CPPFLAGS}"
+
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pioctl in AFS libsys" >&5
+$as_echo_n "checking for pioctl in AFS libsys... " >&6; }
+   for dir in ${with_afsdir}/lib \
+              ${with_afsdir}/lib/afs \
+              ${with_afsdir}/lib/openafs \
+              ${with_afsdir}/lib64 \
+              ${with_afsdir}/lib64/afs \
+              ${with_afsdir}/lib64/openafs
+   do
+      for arch_type in .a .so
+      do
+        A=`test -f ${dir}/libsys${arch_type} && nm ${dir}/libsys${arch_type} 2>/dev/null | grep pioctl`
+        pkg=$?
+        if test $pkg = 0; then
+           have_afs=yes
+           AFS_LIBS="-L${dir} -lsys -lrx -llwp ${dir}/util${arch_type}"
+           break
+        fi
+      done
+   done
+
+   if test $have_afs = yes; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+   else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+   fi
+
+   if test x$support_afs = xyes -a $have_afs != yes; then
+      as_fn_error $? "afs support explicitly enabled but no supported afs implementation found,
+  please either load the afs libraries or rerun configure without --enable-afs" "$LINENO" 5
+   else
+      if test $have_afs = yes; then
+
+$as_echo "#define HAVE_AFS 1" >>confdefs.h
+
+
+$as_echo "#define HAVE_AFS_ACL 1" >>confdefs.h
+
+      fi
+   fi
+fi
+
+
+
 support_acl=auto
 # Check whether --enable-acl was given.
 if test "${enable_acl+set}" = set; then :
 if test "x$ac_cv_lib_acl_acl_get_file" = xyes; then :
 
             have_acl=yes
-            FDLIBS="-lacl $FDLIBS"
+             if test $have_afs = yes; then
+                                                                if test -d /usr/lib64/; then
+                   FDLIBS="-L/usr/lib64 -lacl $FDLIBS"
+                else
+                   FDLIBS="-L/usr/lib -lacl $FDLIBS"
+                fi
+             else
+                FDLIBS="-lacl $FDLIBS"
+             fi
 
 
 fi
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by bacula $as_me 5.2.8, which was
+This file was extended by bacula $as_me 5.2.9, which was
 generated by GNU Autoconf 2.68.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-bacula config.status 5.2.8
+bacula config.status 5.2.9
 configured by $0, generated by GNU Autoconf 2.68,
   with options \\"\$ac_cs_config\\"
 
    build-dird:              ${build_dird}
    build-stored:            ${build_stored}
    Plugin support:          ${have_plugins}
+   AFS support:             ${have_afs}
    ACL support:             ${have_acl}
    XATTR support:           ${have_xattr}
    Python support:          ${support_python} ${PYTHON_LIBS}