diff -Nurd -x'*~' gnome-vfs-2.24.4.orig/Makefile.am gnome-vfs-2.24.4/Makefile.am
--- gnome-vfs-2.24.4.orig/Makefile.am	2010-02-09 07:16:14.000000000 -0500
+++ gnome-vfs-2.24.4/Makefile.am	2015-02-23 04:36:47.000000000 -0500
@@ -1,3 +1,4 @@
+ACLOCAL_AMFLAGS = -I m4
 SUBDIRS_GNOME=doc schemas
 
 SUBDIRS =					\
diff -Nurd -x'*~' gnome-vfs-2.24.4.orig/acinclude.m4 gnome-vfs-2.24.4/acinclude.m4
--- gnome-vfs-2.24.4.orig/acinclude.m4	2010-02-09 07:16:14.000000000 -0500
+++ gnome-vfs-2.24.4/acinclude.m4	2015-02-22 15:56:59.000000000 -0500
@@ -235,7 +235,6 @@
 AC_MSG_NOTICE([using bundled neon ($NEON_VERSION)])
 NEON_BUILD_BUNDLED="yes"
 LIBNEON_SOURCE_CHECKS
-NEON_CFLAGS="$CFLAGS -I.. -I../.. -I$srcdir/$neon_bundled_srcdir"
 NEON_NEED_XML_PARSER=yes
 neon_library_message="included libneon (${NEON_VERSION})"
 
@@ -267,8 +266,8 @@
 
 #xml parser stuff
 PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= $XML_REQUIRED)
-NEON_CFLAGS="$NEON_CFLAGS $LIBXML_CFLAGS" 
-NEON_LIBS="$NEON_LIBS $LIBXML_LIBS"
+NEON_CFLAGS="$NEON_CFLAGS $OPENSSL_CFLAGS $LIBXML_CFLAGS" 
+NEON_LIBS="$NEON_LIBS $OPENSSL_LIBS $LIBXML_LIBS"
 
 AC_DEFINE(HAVE_LIBXML, 1, [Define if you have libxml])
 
@@ -403,10 +402,11 @@
 Darwin) ne_cv_os_macosx=yes ;;
 *) ne_cv_os_macosx=no ;;
 esac])
-if test $ne_cv_os_macosx = yes; then
-  CPPFLAGS="$CPPFLAGS -no-cpp-precomp"
-  LDFLAGS="$LDFLAGS -flat_namespace"
-fi
+dnl not appropriate for modern darwin (back at least to 10.3)
+dnl if test $ne_cv_os_macosx = yes; then
+dnl   CPPFLAGS="$CPPFLAGS -no-cpp-precomp"
+dnl   LDFLAGS="$LDFLAGS -flat_namespace"
+dnl fi
 ])
 
 AC_DEFUN([NEON_FORMAT_PREP], [
diff -Nurd -x'*~' gnome-vfs-2.24.4.orig/configure.in gnome-vfs-2.24.4/configure.in
--- gnome-vfs-2.24.4.orig/configure.in	2010-07-01 11:36:09.000000000 -0400
+++ gnome-vfs-2.24.4/configure.in	2015-02-23 04:26:26.000000000 -0500
@@ -36,8 +36,7 @@
 AM_CONFIG_HEADER(config.h)
 AM_INIT_AUTOMAKE(gnome-vfs, $LIBGNOMEVFS_VERSION)
 
-dnl make sure we keep ACLOCAL_FLAGS around for maintainer builds to work
-AC_SUBST(ACLOCAL_AMFLAGS, "$ACLOCAL_FLAGS")
+AC_CONFIG_MACRO_DIR([m4])
 
 AM_MAINTAINER_MODE
 
@@ -451,8 +450,8 @@
 AC_PATH_PROG([KRB5_CONFIG], krb5-config, none, $PATH:/usr/kerberos/bin)
 					   
 if test "x$KRB5_CONFIG" != "xnone"; then
-   GSSAPI_LIBS="`${KRB5_CONFIG} --libs gssapi`"
-   GSSAPI_CFLAGS="`${KRB5_CONFIG} --cflags gssapi`"
+   GSSAPI_LIBS="`${KRB5_CONFIG} --libs gssapi | sed -e 's,-L/usr/lib,,'`"
+   GSSAPI_CFLAGS="`${KRB5_CONFIG} --cflags gssapi | sed -e 's,-L/usr/include,,'`"
    
    saved_CPPFLAGS="$CPPFLAGS"
    saved_LIBS="$LIBS"
@@ -489,7 +488,6 @@
 dnl ******************************
 dnl http-method (neon checks)
 dnl ******************************
-VFS_NEON_BUNDLED(imported/neon)
 
 AC_ARG_ENABLE(http-debug,
 	[AS_HELP_STRING([--enable-http-debug],[Enable HTTP method debugging])],
@@ -658,6 +656,10 @@
   dnl end of PKG_CHECK_MODULES(openssl)
 fi
 
+# this is patched (acinclude.m4) to slurp OPENSSL_, so must be after
+# openssl tests, cf http://bugzilla.gnome.org/show_bug.cgi?id=511189
+VFS_NEON_BUNDLED(imported/neon)
+
 dnl ****************************
 dnl GNUTLS
 dnl ****************************
@@ -1045,8 +1047,8 @@
 dnl ==============================================================================
 
 PKG_CHECK_MODULES(LIBGNOMEVFS, glib-2.0 >= $GLIB_REQUIRED gmodule-no-export-2.0 >= $GLIB_REQUIRED gthread-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GLIB_REQUIRED gconf-2.0 >= $GCONF_REQUIRED libxml-2.0 >= $XML_REQUIRED gnome-mime-data-2.0 $dbus_requirement)
-LIBGNOMEVFS_CFLAGS="$LIBGNOMEVFS_CFLAGS $OPENSSL_CFLAGS $LIBGNUTLS_CFLAGS $HOWL_CFLAGS $AVAHI_CFLAGS"
-LIBGNOMEVFS_LIBS="$LIBGNOMEVFS_LIBS $OPENSSL_LIBS $LIBGNUTLS_LIBS $HOWL_LIBS $AVAHI_LIBS $RESOLVER_LIBS"
+LIBGNOMEVFS_CFLAGS="$OPENSSL_CFLAGS $LIBGNOMEVFS_CFLAGS $LIBGNUTLS_CFLAGS $HOWL_CFLAGS $AVAHI_CFLAGS"
+LIBGNOMEVFS_LIBS="$OPENSSL_LIBS $LIBGNOMEVFS_LIBS $LIBGNUTLS_LIBS $HOWL_LIBS $AVAHI_LIBS $RESOLVER_LIBS"
 AC_SUBST(LIBGNOMEVFS_CFLAGS)
 AC_SUBST(LIBGNOMEVFS_LIBS)
 
@@ -1095,7 +1097,7 @@
 
 AC_CACHE_CHECK([for POSIX ACL], gvfs_cv_HAVE_POSIX_ACLS,[
 		acl_LIBS=$LIBS
-		LIBS="$LIBS -lacl"
+		LIBS="$LIBS $ACL_LIBS"
 		AC_TRY_LINK([#include <sys/types.h>
 #include <sys/acl.h>],
 [ acl_t acl; int entry_id; acl_entry_t *entry_p; return acl_get_entry (acl, entry_id, entry_p);],
diff -Nurd -x'*~' gnome-vfs-2.24.4.orig/imported/neon/Makefile.am gnome-vfs-2.24.4/imported/neon/Makefile.am
--- gnome-vfs-2.24.4.orig/imported/neon/Makefile.am	2010-02-09 07:16:14.000000000 -0500
+++ gnome-vfs-2.24.4/imported/neon/Makefile.am	2015-02-22 15:56:59.000000000 -0500
@@ -9,13 +9,12 @@
 INCLUDES =					\
 	-DNE_HAVE_DAV				\
 	$(SSL_DEFINES)                          \
-	$(NEON_CFLAGS)				\
-	$(LIBGNOMEVFS_CFLAGS)			\
-	$(GSSAPI_CFLAGS)			\
         -I$(top_srcdir)                         \
         -I$(top_builddir)                       \
         -I$(top_srcdir)/libgnomevfs             \
         -I$(top_builddir)/libgnomevfs           \
+	$(NEON_CFLAGS)				\
+	$(LIBGNOMEVFS_CFLAGS)			\
         $(NULL)
 
 noinst_LTLIBRARIES = libneon.la
@@ -64,6 +63,7 @@
 
 libneon_la_LIBADD =			\
 	$(NEON_LIBS) $(NEON_LTLIBS)	\
+	$(LIBGNOMEVFS_LIBS)		\
 	$(NULL)
 
 libneon_la_LDFLAGS =			\
diff -Nurd -x'*~' gnome-vfs-2.24.4.orig/libgnomevfs/Makefile.am gnome-vfs-2.24.4/libgnomevfs/Makefile.am
--- gnome-vfs-2.24.4.orig/libgnomevfs/Makefile.am	2010-02-09 07:16:14.000000000 -0500
+++ gnome-vfs-2.24.4/libgnomevfs/Makefile.am	2015-02-22 15:56:59.000000000 -0500
@@ -114,6 +114,7 @@
 	$(SOCKET_LIBS)				\
 	$(INTLLIBS)				\
 	$(SELINUX_LIBS)				\
+	-lresolv				\
 	$(NULL)
 
 libgnomevfs_2_la_LDFLAGS =			\
diff -Nurd -x'*~' gnome-vfs-2.24.4.orig/modules/Makefile.am gnome-vfs-2.24.4/modules/Makefile.am
--- gnome-vfs-2.24.4.orig/modules/Makefile.am	2010-02-09 07:16:14.000000000 -0500
+++ gnome-vfs-2.24.4/modules/Makefile.am	2015-02-22 15:56:59.000000000 -0500
@@ -204,8 +204,8 @@
 
 libhttp_la_LDFLAGS = $(module_flags)
 libhttp_la_LIBADD  = 			\
-	$(MODULES_GCONF_LIBS) 	\
 	$(OPENSSL_LIBS) \
+	$(MODULES_GCONF_LIBS) 	\
 	../imported/neon/libneon.la   \
 	../libgnomevfs/libgnomevfs-2.la
 
diff -Nurd -x'*~' gnome-vfs-2.24.4.orig/test/Makefile.am gnome-vfs-2.24.4/test/Makefile.am
--- gnome-vfs-2.24.4.orig/test/Makefile.am	2010-02-09 07:16:14.000000000 -0500
+++ gnome-vfs-2.24.4/test/Makefile.am	2015-02-23 04:21:34.000000000 -0500
@@ -65,7 +65,7 @@
 	test-async-cancel \
 	test-escape       \
 	test-uri       	  \
-	$(srcdir)/auto-test	
+	auto-test	
 
 libraries =						\
 	$(top_builddir)/libgnomevfs/libgnomevfs-2.la	\
