+captive_save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $LIBXML_CFLAGS"
+have_libxml_xmlreader_h=false
+AC_CHECK_HEADERS(libxml/xmlreader.h,[ have_libxml_xmlreader_h=true ],
+ [ AC_MSG_WARN([Captive requires libxml >= 2.4.29 for --enable-install-pkg.]) ])
+AM_CONDITIONAL(HAVE_LIBXML_XMLREADER_H,[ $have_libxml_xmlreader_h ])
+CPPFLAGS="$captive_save_CPPFLAGS"
+
+have_libntfs_includes=true
+# '#include "config.h"' may be required by <ntfs/*> include files.
+# "config.h" may be already present while not yet being compilable.
+rm -f config.h-ntfs_save
+mv -f config.h config.h-ntfs_save 2>/dev/null
+touch config.h
+captive_save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS -I." # for "config.h" touched above
+AC_CHECK_HEADERS(ntfs/types.h ntfs/volume.h,,[
+ have_libntfs_includes=false
+ AC_MSG_WARN([Captive requires ntfs/* include files (of ntfsprogs-devel) for --enable-install-pkg.])
+ ])
+CPPFLAGS="$captive_save_CPPFLAGS"
+rm -f config.h
+mv -f config.h-ntfs_save config.h 2>/dev/null
+
+LIBNTFS_LIBS=""
+AC_CHECK_LIB(ntfs,ntfs_mount,[ LIBNTFS_LIBS="-lntfs" ],
+ [ AC_MSG_WARN([Captive requires libntfs (of ntfsprogs-devel) for --enable-install-pkg.]) ])
+AC_SUBST(LIBNTFS_LIBS)
+
+have_libgnomevfs_gnome_vfs_filesystem_entry_h=false
+if test x$enable_standalone = xyes;then
+ captive_save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $GNOME_VFS_MODULE_CFLAGS"
+ AC_CHECK_HEADERS(libgnomevfs/gnome-vfs-filesystem-entry.h,
+ [ have_libgnomevfs_gnome_vfs_filesystem_entry_h=true ],
+ [ AC_MSG_WARN([Captive --enable-install-pkg with --enable-standalone requires patched GnomeVFS. See:
+ http://bugzilla.gnome.org/show_bug.cgi?id=47053]) ])
+ CPPFLAGS="$captive_save_CPPFLAGS"
+fi
+
+LIBNTFS_GNOMEVFS_LIBS=""
+if test x$enable_standalone = xyes;then
+ LIBNTFS_GNOMEVFS_LIBS="-L/usr/lib/gnome-vfs-2.0/modules -lntfs-gnomevfs"
+ captive_save_CFLAGS="$CFLAGS"
+ captive_save_LIBS="$LIBS"
+ CFLAGS="$CFLAGS $GNOME_VFS_MODULE_CFLAGS"
+ LIBS=" $LIBS $GNOME_VFS_MODULE_LIBS $LIBNTFS_GNOMEVFS_LIBS"
+ AC_CHECK_FUNCS(vfs_module_init,,[
+ LIBNTFS_GNOMEVFS_LIBS=""
+ AC_MSG_WARN([Captive --enable-install-pkg with --enable-standalone requires GnomeVFS libntfs-gnomevfs.])
+ ])
+ CFLAGS="$captive_save_CFLAGS"
+ LIBS="$captive_save_LIBS"
+fi
+AC_SUBST(LIBNTFS_GNOMEVFS_LIBS)
+