-diff -urN lftp-2.5.0a.org/m4/va_copy.m4 lftp-2.5.0a/m4/va_copy.m4
---- lftp-2.5.0a.org/m4/va_copy.m4 Thu Jan 1 01:00:00 1970
-+++ lftp-2.5.0a/m4/va_copy.m4 Mon Mar 4 15:16:21 2002
-@@ -0,0 +1,126 @@
-+# Directly out of glib. We don't do copy-by-value and other really
-+# pessimistic tests, since just about all systems will have one of these.
-+# Add them if needed.
-+
-+AC_DEFUN(lftp_VA_COPY,
-+[
-+ AC_CACHE_CHECK([for an implementation of va_copy()],lftp_cv_va_copy,[
-+ AC_TRY_RUN([
-+ #include <stdarg.h>
-+ void f (int i, ...) {
-+ va_list args1, args2;
-+ va_start (args1, i);
-+ va_copy (args2, args1);
-+ if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
-+ exit (1);
-+ va_end (args1); va_end (args2);
-+ }
-+ int main() {
-+ f (0, 42);
-+ return 0;
-+ }],
-+ [lftp_cv_va_copy=yes],
-+ [lftp_cv_va_copy=no],
-+ [])
-+ ])
-+ if test x$lftp_cv_va_copy != xyes; then
-+ AC_CACHE_CHECK([for an implementation of __va_copy()],lftp_cv___va_copy,[
-+ AC_TRY_RUN([
-+ #include <stdarg.h>
-+ void f (int i, ...) {
-+ va_list args1, args2;
-+ va_start (args1, i);
-+ __va_copy (args2, args1);
-+ if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
-+ exit (1);
-+ va_end (args1); va_end (args2);
-+ }
-+ int main() {
-+ f (0, 42);
-+ return 0;
-+ }],
-+ [lftp_cv___va_copy=yes],
-+ [lftp_cv___va_copy=no],
-+ [])
-+ ])
-+ fi
-+
-+ if test "x$lftp_cv_va_copy" = "xyes"; then
-+ va_copy_func=va_copy
-+ elif test "x$lftp_cv___va_copy" = "xyes"; then
-+ va_copy_func=__va_copy
-+ fi
-+
-+ if test -n "$va_copy_func"; then
-+ AC_DEFINE_UNQUOTED(VA_COPY,$va_copy_func,[A 'va_copy' style function])
-+
-+ else
-+
-+ AC_CACHE_CHECK([whether va_lists can be copied by value],lftp_cv_va_val_copy,[
-+ AC_TRY_RUN([
-+ #include <stdarg.h>
-+ #include <string.h>
-+ void f (int i, ...) {
-+ va_list args1, args2;
-+ va_start (args1, i);
-+
-+ memmove(&args2, &args1, sizeof(args1));
-+ if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
-+ exit (1);
-+ va_end (args1); va_end (args2);
-+ }
-+ int main() {
-+ f (0, 42);
-+ return 0;
-+ }],
-+ [lftp_cv_va_val_copy=yes],
-+ [lftp_cv_va_val_copy=no],
-+ [lftp_cv_va_val_copy=no])
-+ ])
-+
-+ if test x$lftp_cv_va_val_copy = xyes; then
-+ AC_DEFINE(VA_VAL_COPY,1,[Define to 1 if va_lists can be copied by value])
-+ else
-+ AC_CACHE_CHECK([whether va_lists can be copied by pointer],lftp_cv_va_ptr_copy,[
-+ AC_TRY_RUN([
-+ #include <stdarg.h>
-+ void f (int i, ...) {
-+ va_list args1, args2;
-+ va_start (args1, i);
-+
-+ *args2 = *args1;
-+ if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
-+ exit (1);
-+ va_end (args1); va_end (args2);
-+ }
-+ int main() {
-+ f (0, 42);
-+ return 0;
-+ }],
-+ [lftp_cv_va_ptr_copy=yes],
-+ [lftp_cv_va_ptr_copy=no],
-+ [lftp_cv_va_ptr_copy=no])
-+ ])
-+
-+ if test x$lftp_cv_va_ptr_copy = xyes; then
-+ AC_DEFINE(VA_PTR_COPY,1,[Define to 1 if va_lists can be copied by pointer])
-+ fi
-+ fi
-+ fi
-+
-+ if test x$lftp_cv_va_val_copy != xyes -a x$lftp_cv_va_ptr_copy != xyes -a \
-+ x$lftp_cv_va_copy != xyes -a x$lftp_cv___va_copy != xyes; then
-+ AC_MSG_ERROR(Can't find a way to va_copy.)
-+ fi
-+
-+ dnl ZZZ for autoheader sorting.
-+ AH_VERBATIM([VA_ZZZ_COPY],
-+[#if !defined (VA_COPY)
-+# if defined (VA_PTR_COPY)
-+# define VA_COPY(ap1, ap2) (*(ap1) = *(ap2))
-+# elif defined (VA_VAL_COPY)
-+# include <string.h>
-+# define VA_COPY(to,from) (memcpy(&(to),&(from),sizeof((to))))
-+# endif
-+#endif /* !VA_COPY */])
-+])
+--- lftp-4.0.0/configure.ac~ 2009-09-12 19:39:22.434759846 +0200
++++ lftp-4.0.0/configure.ac 2009-09-12 19:39:56.352256686 +0200
+@@ -254,9 +254,9 @@
+
+ AC_ARG_WITH(gnutls, AS_HELP_STRING([--without-gnutls], [don't use GNUTLS library]),
+ [with_gnutls=$withval], [with_gnutls=yes])
+-AC_ARG_WITH(openssl,
+-AS_HELP_STRING([--with-openssl@<:@=/path@:>@], [use OpenSSL @<:@at /path@:>@])
+-AS_HELP_STRING([--without-openssl], [don't use OpenSSL (default)]),
++AC_ARG_WITH(openssl,[
++AS_HELP_STRING([--with-openssl@<:@=/path@:>@], [use OpenSSL @<:@at /path@:>@])
++AS_HELP_STRING([--without-openssl], [don't use OpenSSL (default)])],
+ [with_openssl=$withval], [with_openssl=no])
+ case "$with_openssl" in
+ yes) with_gnutls=no;;
+--- a/m4/ax_lib_expat.m4~ 2016-02-20 14:57:52.000000000 +0100
++++ b/m4/ax_lib_expat.m4 2016-04-08 23:01:06.084309949 +0200
+@@ -109,7 +109,6 @@ AC_DEFUN([AX_LIB_EXPAT],
+
+ if test -n "$expat_prefix"; then
+ expat_include_dir="$expat_prefix/include"
+- expat_ld_flags="-L$expat_prefix/lib"
+ expat_lib_flags="-lexpat"
+ run_expat_test="yes"
+ elif test "$expat_requested" = "yes"; then
+--- lftp-4.7.1/m4/ax_check_zlib.m4~ 2016-02-20 14:57:52.000000000 +0100
++++ lftp-4.7.1/m4/ax_check_zlib.m4 2016-04-08 23:22:04.957699442 +0200
+@@ -105,7 +105,6 @@ then
+ ZLIB_OLD_LDFLAGS=$LDFLAGS
+ ZLIB_OLD_CPPFLAGS=$CPPFLAGS
+ if test -n "${ZLIB_HOME}"; then
+- LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib"
+ CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include"
+ fi
+ AC_LANG_SAVE
+@@ -120,7 +119,6 @@ then
+ #
+ m4_ifblank([$1],[
+ CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include"
+- LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib"
+ LIBS="-lz $LIBS"
+ AC_DEFINE([HAVE_LIBZ], [1],
+ [Define to 1 if you have `z' library (-lz)])
+--- lftp-4.7.1/m4/lftp_lib_readline.m4~ 2016-02-20 14:57:52.000000000 +0100
++++ lftp-4.7.1/m4/lftp_lib_readline.m4 2016-04-08 23:22:41.891914476 +0200
+@@ -107,7 +107,6 @@ AC_DEFUN([lftp_LIB_READLINE],
+ if test -f "$readline_include_dir/readline/readline.h"; then
+ readline_include_dir="$readline_include_dir/readline"
+ fi
+- readline_ld_flags="-L$readline_prefix/lib"
+ readline_lib_flags="-lreadline"
+ run_readline_test="yes"
+ elif test "$readline_requested" = "yes"; then
+--- lftp-4.7.1/m4/ssl.m4~ 2016-02-20 14:57:52.000000000 +0100
++++ lftp-4.7.1/m4/ssl.m4 2016-04-08 23:27:39.145077021 +0200
+@@ -10,7 +10,6 @@ AC_CACHE_VAL(lftp_cv_openssl,
+ old_CPPFLAGS="$CPPFLAGS"
+ LIBS="$LIBS -lssl -lcrypto"
+ if test $loc != default; then
+- LDFLAGS="$LDFLAGS -L$loc/lib"
+ CPPFLAGS="$CPPFLAGS -I$loc/include"
+ fi
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <openssl/ssl.h>
+@@ -21,7 +20,7 @@ AC_CACHE_VAL(lftp_cv_openssl,
+ if test $found_loc != "none"; then
+ lftp_cv_openssl="OPENSSL_LIBS=\"-lssl -lcrypto\""
+ if test $found_loc != default; then
+- lftp_cv_openssl="$lftp_cv_openssl OPENSSL_LDFLAGS=\"-L$found_loc/lib -R$found_loc/lib\""
++ lftp_cv_openssl="$lftp_cv_openssl OPENSSL_LDFLAGS=\"-R$found_loc/lib\""
+ lftp_cv_openssl="$lftp_cv_openssl OPENSSL_CPPFLAGS=-I$found_loc/include"
+ fi
+ break;
+--- lftp-4.7.1/configure.ac~ 2016-04-08 23:03:03.000000000 +0200
++++ lftp-4.7.1/configure.ac 2016-04-08 23:49:53.853139448 +0200
+@@ -306,7 +306,7 @@ fi
+
+ AX_CHECK_ZLIB([
+ AC_SUBST([ZLIB],[-lz])
+- AC_SUBST([ZLIB_LDFLAGS],["-L${ZLIB_HOME}/lib"])
++ AC_SUBST([ZLIB_LDFLAGS],[""])
+ AC_SUBST([ZLIB_CPPFLAGS],["-I${ZLIB_HOME}/include"])
+ ],[
+ AC_MSG_ERROR([cannot find -lz library, install zlib-devel package])