+PKG_CHECK_MODULES(GNOME_VFS,gnome-vfs-2.0)
+GNOME_VFS_CFLAGS="$GNOME_VFS_CFLAGS -DCAPTIVE_USE_GNOME_VFS=1"
+AC_SUBST(GNOME_VFS_CFLAGS)
+AC_SUBST(GNOME_VFS_LIBS)
+
+# AC_ARG_ENABLE(bug-replay,[--enable-bug-replay=[no/yes/auto]],,enable_bug_replay=auto)
+dnl Check for 2.5.9 for: http://bugzilla.gnome.org/show_bug.cgi?id=117702
+dnl Check the version - impossible to reliably check the missing feature.
+PKG_CHECK_MODULES(LIBXML,libxml-2.0 >= 2.5.9,[ have_libxml_buffering=true ],[
+ dnl Disable bug-replay(1) build if not met; --bug-pathname would be still OK.
+ PKG_CHECK_MODULES(LIBXML,libxml-2.0,[ have_libxml_buffering=false ])
+ ])
+dnl We also condition 'HAVE_LIBXML_XMLREADER_H' by 'HAVE_LIBXML_BUFFERING'
+dnl as we have no use for xmlreader without working libxml buffering of 2.5.9.
+AM_CONDITIONAL(ENABLE_BUG_REPLAY,[$have_libxml_buffering && test x$enable_bug_replay != xno])
+if $have_libxml_buffering;then
+ AC_DEFINE(HAVE_LIBXML_BUFFERING,,[libxml2 correctly reads textnodes by its xmlTextReader.])
+else
+ if test x$enable_bug_replay = xyes;then
+ AC_MSG_ERROR([captive require libxml2 at least 2.5.9 for --enable-bug-replay feature.])
+ elif test x$enable_bug_replay != xno;then
+ AC_MSG_WARN([libxml2 at least 2.5.9 required --enable-bug-replay feature; disabled now.])
+ fi
+fi
+AC_SUBST(LIBXML_CFLAGS)
+AC_SUBST(LIBXML_LIBS)
+
+PKG_CHECK_MODULES(OPENSSL,openssl,,[
+ dnl At least Debian-3.0r1 has openssl but without its .pc module.
+ AC_CHECK_LIB(crypto,MD5,[
+ OPENSSL_CFLAGS=""
+ OPENSSL_LIBS="-lcrypto"
+ ],[AC_MSG_ERROR([Captive requires crypto library (of openssl).])])
+ ])
+AC_SUBST(OPENSSL_CFLAGS)
+AC_SUBST(OPENSSL_LIBS)
+
+# AC_ARG_ENABLE(lufs,[--enable-lufs=[no/yes/auto]],,enable_lufs=auto)
+if test x$enable_lufs != no;then
+ have_lufs_includes=true
+ dnl If ACTION-IF-NOT-FOUND is given, it is executed when one of the header
+ dnl files is not found.
+ AC_CHECK_HEADERS(lufs/fs.h lufs/proto.h,,[ have_lufs_includes=false ])
+ if test x$have_lufs_includes = xfalse;then
+ if test x$enable_lufs = xyes;then
+ AC_MSG_ERROR([LUFS client was requested (--enable-lufs) but no LUFS include files were found. Install 'lufs-*-*captive*' package.])
+ else
+ AC_MSG_WARN([LUFS client not being compiled as no LUFS include files were found. Install 'lufs-*-*captive*' package.])
+ fi
+ fi
+ AC_CHECK_TYPES([struct lufs_sbattr],,[
+ dnl FIXME: Include 'lufs' version when 'lufs_sbattr' gets integrated:
+ if $have_lufs_includes && test x$enable_lufs = xyes;then
+ AC_MSG_ERROR([Although LUFS include files were found they are too old. You may also use --enable-lufs=auto.])
+ else
+ AC_MSG_WARN([Although LUFS include files were found they are too old. df(1) will not show available NTFS disk space.])
+ fi
+ ],[#include <lufs/proto.h>])
+fi
+AM_CONDITIONAL(ENABLE_LUFS,[ $have_lufs_includes && test x$enable_lufs != no ])
+
+dnl for $(top_srcdir)/src/libcaptive/sandbox/split-sandbox.c
+AM_PATH_LINC(,,[AC_MSG_ERROR([Captive requires linc library used by ORBit.])])
+
+dnl for $(top_srcdir)/src/libcaptive/client/
+dnl Do not use '[client server]' as $4 to prevent: configure: test: too many arguments
+dnl - currently this argument is not used by 'orbit2-config' in any way anyway
+AM_PATH_ORBIT2(,,[AC_MSG_ERROR([Captive requires ORBit library.])])
+
+# AC_ARG_ENABLE(install-pkg,[--enable-install-pkg=[no/yes/auto]],,enable_install_pkg=auto)
+GLADE_W_INIT([
+ ./src/install/acquire/ui-gnome-interface.c
+ ./src/install/acquire/ui-gnome-interface.h
+ ./src/install/acquire/ui-gnome-callbacks.h
+ ./src/install/acquire/ui-gnome-support.c
+ ./src/install/acquire/ui-gnome-support.h
+ ],[$enable_install_pkg],[
+ AC_CHECK_LIB(ntfs,ntfs_mount,[
+ LIBNTFS_LIBS="-lntfs"
+
+ captive_save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $LIBXML_CFLAGS"
+ AC_CHECK_HEADERS(libxml/xmlreader.h,
+ [ glade_addon=yes ],
+ [ AC_MSG_WARN([Captive requires libxml >= 2.4.29 for --enable-install-pkg.]) ])
+ CPPFLAGS="$captive_save_CPPFLAGS"
+ ])
+ ])
+AC_SUBST(GNOMEUI_CFLAGS)
+AC_SUBST(GNOMEUI_LIBS)
+AC_SUBST(LIBNTFS_LIBS)
+dnl Do not: AM_CONDITIONAL(HAVE_LIBNTFS,[ test -n "$LIBNTFS_LIBS" ])
+dnl as we do not need it as we are conditioned by ENABLE_INSTALL_PKG
+AM_CONDITIONAL(HAVE_GLADE_WRITESOURCE,[ test "x$PATH_GLADE" != "x" ])
+dnl Do not: AM_CONDITIONAL(BUILD_GLADESRC,[ test "xyes" = "x$BUILD_GLADESRC" ])
+dnl as we do not need it as we are conditioned by ENABLE_INSTALL_PKG
+GNOME_ADDON_LIBS=""
+if test "x$BUILD_GLADESRC_TRUE" = "x"
+then
+ AC_CHECK_LIB(Xi,XOpenDevice,GNOME_ADDON_LIBS="$GNOME_ADDON_LIBS -lXi")
+fi
+AC_SUBST(GNOME_ADDON_LIBS)
+dnl $BUILD_GLADESRC is already conditioned by $enable_install_pkg by GLADE_W_INIT()
+AM_CONDITIONAL(ENABLE_INSTALL_PKG,[ test "xyes" = "x$BUILD_GLADESRC" ])