Blame configure.ac

Packit Service a2489d
dnl Process this file with autoconf to produce a configure script.
Packit Service a2489d
AC_PREREQ([2.60])
Packit Service a2489d
AC_INIT([lftp],m4_esyscmd([build-aux/git-version-gen .tarball-version]),[lftp-bugs@lftp.yar.ru])
Packit Service a2489d
AC_CONFIG_AUX_DIR([build-aux])
Packit Service a2489d
AC_CONFIG_MACRO_DIR([m4])
Packit Service a2489d
AC_CONFIG_LIBOBJ_DIR([lib])
Packit Service a2489d
AC_CONFIG_SRCDIR([src/ftpclass.cc])
Packit Service a2489d
AM_CONFIG_HEADER([lib/config.h])
Packit Service a2489d
AM_INIT_AUTOMAKE
Packit Service a2489d
Packit Service a2489d
dnl This doesn't *require* GNU extensions; it merely enables them if
Packit Service a2489d
dnl they're there.
Packit Service a2489d
AC_USE_SYSTEM_EXTENSIONS
Packit Service a2489d
Packit Service a2489d
test -z "$CXX"	     && DEFAULT_CXX=yes
Packit Service a2489d
test -z "$CFLAGS"    && DEFAULT_CFLAGS=yes
Packit Service a2489d
test -z "$CXXFLAGS"  && DEFAULT_CXXFLAGS=yes
Packit Service a2489d
test -z "$LDFLAGS"   && DEFAULT_LDFLAGS=yes
Packit Service a2489d
Packit Service a2489d
dnl Checks for programs.
Packit Service a2489d
AC_PROG_CC
Packit Service a2489d
gl_EARLY
Packit Service a2489d
AC_PROG_CXX
Packit Service a2489d
Packit Service a2489d
AC_PROG_YACC
Packit Service a2489d
if test x$ac_cv_lib_fl_yywrap = xno; then
Packit Service a2489d
   AC_DEFINE(NEED_YYWRAP, 1, [need yywrap]) dnl ?
Packit Service a2489d
fi
Packit Service a2489d
Packit Service a2489d
dnl POSIXCHECK is worthwhile for maintainers, but adds several seconds
Packit Service a2489d
dnl (more than 10% execution time) to ./configure, with no benefit for
Packit Service a2489d
dnl most users.  Using it to look for bugs requires:
Packit Service a2489d
dnl   GNULIB_POSIXCHECK=1 autoreconf -f
Packit Service a2489d
dnl   ./configure
Packit Service a2489d
dnl   make
Packit Service a2489d
dnl   make -C src clean
Packit Service a2489d
dnl   make CFLAGS=-DGNULIB_POSIXCHECK=1
Packit Service a2489d
m4_syscmd([test "${GNULIB_POSIXCHECK+set}" = set])
Packit Service a2489d
m4_if(m4_sysval, [0], [], [dnl
Packit Service a2489d
gl_ASSERT_NO_GNULIB_POSIXCHECK])
Packit Service a2489d
Packit Service a2489d
AC_SYS_LARGEFILE
Packit Service a2489d
Packit Service a2489d
AC_ARG_WITH(debug,
Packit Service a2489d
   AS_HELP_STRING([--with-debug], [enable debug info]),
Packit Service a2489d
[   with_debug=$withval;   ],
Packit Service a2489d
[   with_debug=no;	   ])
Packit Service a2489d
Packit Service a2489d
AC_ARG_WITH(profiling,
Packit Service a2489d
   AS_HELP_STRING([--with-profiling], [enable profiling]),
Packit Service a2489d
[   with_profiling=$withval;   ],
Packit Service a2489d
[   with_profiling=no;	   ])
Packit Service a2489d
Packit Service a2489d
AC_ARG_ENABLE([packager-mode],
Packit Service a2489d
              AS_HELP_STRING([--enable-packager-mode],
Packit Service a2489d
                             [Change configuration behavior
Packit Service a2489d
                              to ease packaging]),
Packit Service a2489d
              [if test x"${enableval}" = xyes
Packit Service a2489d
               then
Packit Service a2489d
				   DEFAULT_CXX=no
Packit Service a2489d
				   DEFAULT_CFLAGS=no
Packit Service a2489d
				   DEFAULT_CXXFLAGS=no
Packit Service a2489d
				   DEFAULT_LDFLAGS=no
Packit Service a2489d
               fi])
Packit Service a2489d
Packit Service a2489d
if test x$with_debug = xno; then
Packit Service a2489d
   if test x$DEFAULT_CFLAGS = xyes; then
Packit Service a2489d
      CFLAGS="`echo $CFLAGS | sed 's/-g//'`"
Packit Service a2489d
      if test -z "$CFLAGS"; then
Packit Service a2489d
	 CFLAGS=-O
Packit Service a2489d
      fi
Packit Service a2489d
   fi
Packit Service a2489d
   if test x$DEFAULT_CXXFLAGS = xyes; then
Packit Service a2489d
      CXXFLAGS="`echo $CXXFLAGS | sed 's/-g//'`"
Packit Service a2489d
      if test -z "$CXXFLAGS"; then
Packit Service a2489d
	 CXXFLAGS=-O
Packit Service a2489d
      fi
Packit Service a2489d
   fi
Packit Service a2489d
   # don't strip when profiling
Packit Service a2489d
   if test x$DEFAULT_LDFLAGS = xyes -a x$with_profiling != xyes; then
Packit Service a2489d
      case "`uname -s`" in
Packit Service a2489d
      Darwin)  ;;
Packit Service a2489d
      *)       LDFLAGS="$LDFLAGS -s";;
Packit Service a2489d
      esac
Packit Service a2489d
   fi
Packit Service a2489d
fi
Packit Service a2489d
Packit Service a2489d
if test x$with_debug = xyes; then
Packit Service a2489d
   dnl m4 will mangle brackets
Packit Service a2489d
   if test x$DEFAULT_CFLAGS = xyes; then
Packit Service a2489d
      CFLAGS="`echo $CFLAGS | sed 's/-O@<:@0-9@:>@\?//'`"
Packit Service a2489d
   fi
Packit Service a2489d
   if test x$DEFAULT_CXXFLAGS = xyes; then
Packit Service a2489d
      CXXFLAGS="`echo $CXXFLAGS | sed 's/-O@<:@0-9@:>@\?//'`"
Packit Service a2489d
   fi
Packit Service a2489d
fi
Packit Service a2489d
Packit Service a2489d
if test x$with_profiling = xyes; then
Packit Service a2489d
   CFLAGS="$CFLAGS -pg"
Packit Service a2489d
   CXXFLAGS="$CXXFLAGS -pg"
Packit Service a2489d
   # profiling requires debugging, too, but don't nuke -O
Packit Service a2489d
#   if test x$with_debug != xyes; then
Packit Service a2489d
#      CFLAGS="$CFLAGS -g"
Packit Service a2489d
#      CXXFLAGS="$CXXFLAGS -g"
Packit Service a2489d
#   fi
Packit Service a2489d
fi
Packit Service a2489d
Packit Service a2489d
if test x$GCC = xyes; then
Packit Service a2489d
   CFLAGS="$CFLAGS -Wall"
Packit Service a2489d
fi
Packit Service a2489d
if test x$GXX = xyes; then
Packit Service a2489d
   CXXFLAGS="$CXXFLAGS -Wall -Wwrite-strings -Woverloaded-virtual"
Packit Service a2489d
   # save some bytes
Packit Service a2489d
   LFTP_CHECK_CXX_FLAGS([-fno-exceptions -fno-rtti])
Packit Service a2489d
   # check for -fno-implement-inline (doesn't work without -O in gcc 2.95.4; functions are never inlined)
Packit Service a2489d
   if test x$with_debug = xno; then
Packit Service a2489d
      LFTP_NOIMPLEMENTINLINE
Packit Service a2489d
   fi
Packit Service a2489d
fi
Packit Service a2489d
Packit Service a2489d
dnl Make sure C++ build environment is sane.
Packit Service a2489d
LFTP_CXX_TEST
Packit Service a2489d
CXX_DYNAMIC_INITIALIZERS
Packit Service a2489d
LFTP_CXX_BOOL
Packit Service a2489d
LFTP_CXX__BOOL
Packit Service a2489d
LFTP_CXX_ANSI_SCOPE
Packit Service a2489d
LFTP_CXX_STDC_LIMIT_MACROS
Packit Service a2489d
Packit Service a2489d
AC_SEARCH_LIBS([strerror],[cposix])
Packit Service a2489d
Packit Service a2489d
case "`uname -sr`" in
Packit Service a2489d
# Linux-2.2.x and older don't support fcntl64.
Packit Service a2489d
Linux\ 2.[012].*) enable_largefile=no;;
Packit Service a2489d
esac
Packit Service a2489d
Packit Service a2489d
dnl ** LFTP needs iconv, call the test explicitly (even if --disable-nls)
Packit Service a2489d
AM_ICONV
Packit Service a2489d
Packit Service a2489d
ALL_LINGUAS="de es fr it ja ko pl pt_BR ru uk zh_CN zh_TW zh_HK cs"
Packit Service a2489d
AM_GNU_GETTEXT([external])
Packit Service a2489d
AM_GNU_GETTEXT_VERSION([0.15])
Packit Service a2489d
test "$MSGFMT"  = "no" && MSGFMT  ="$missing_dir/missing msgfmt"
Packit Service a2489d
test "$GMSGFMT" = "no" && GMSGFMT ="$missing_dir/missing msgfmt"
Packit Service a2489d
test "$XGETTEXT" = ":" && XGETTEXT="$missing_dir/missing xgettext"
Packit Service a2489d
Packit Service a2489d
if test x$gt_cv_func_gettext_libintl = xyes; then
Packit Service a2489d
   case "$LIBS" in
Packit Service a2489d
   *-lintl*)   ;;
Packit Service a2489d
   *)	       LIBS="$LIBS -lintl";;
Packit Service a2489d
   esac
Packit Service a2489d
fi
Packit Service a2489d
Packit Service a2489d
AC_ARG_WITH(pager,
Packit Service a2489d
   AS_HELP_STRING([--with-pager=/path], [use specified pager by default]),
Packit Service a2489d
[  with_pager=$withval;	   ],
Packit Service a2489d
[  with_pager="exec more"; ])
Packit Service a2489d
AC_DEFINE_UNQUOTED([DEFAULT_PAGER], "$with_pager", [Default pager command])
Packit Service a2489d
Packit Service a2489d
AC_ARG_WITH(socks,
Packit Service a2489d
   AS_HELP_STRING([--with-socks@<:@=/path@:>@], [build with SOCKSv4 library]),
Packit Service a2489d
[  with_socks=$withval;	],
Packit Service a2489d
[  with_socks=no;	])
Packit Service a2489d
AC_ARG_WITH(socks5,
Packit Service a2489d
   AS_HELP_STRING([--with-socks5@<:@=/path@:>@], [build with SOCKSv5 library]),
Packit Service a2489d
[  with_socks5=$withval;],
Packit Service a2489d
[  with_socks5=no;	])
Packit Service a2489d
AC_ARG_WITH(socksdante,
Packit Service a2489d
   AS_HELP_STRING([--with-socksdante@<:@=/path@:>@], [build with SOCKS-Dante library]),
Packit Service a2489d
[  with_socksdante=$withval;],
Packit Service a2489d
[  with_socksdante=no;	])
Packit Service a2489d
Packit Service a2489d
case "$with_socks" in
Packit Service a2489d
yes|no|"") ;;
Packit Service a2489d
*)	 socks_loc=$with_socks
Packit Service a2489d
	 with_socks=yes;;
Packit Service a2489d
esac
Packit Service a2489d
case "$with_socks5" in
Packit Service a2489d
yes|no|"") ;;
Packit Service a2489d
*)	 socks_loc=$with_socks5
Packit Service a2489d
	 with_socks5=yes;;
Packit Service a2489d
esac
Packit Service a2489d
case "$with_socksdante" in
Packit Service a2489d
yes|no|"") ;;
Packit Service a2489d
*)	 socks_loc=$with_socksdante
Packit Service a2489d
	 with_socksdante=yes;;
Packit Service a2489d
esac
Packit Service a2489d
Packit Service a2489d
if test x$socks_loc != x; then
Packit Service a2489d
   LDFLAGS="$LDFLAGS -L$socks_loc/lib"
Packit Service a2489d
   CPPFLAGS="$CPPFLAGS -I$socks_loc/include"
Packit Service a2489d
fi
Packit Service a2489d
Packit Service a2489d
if test x$with_socks = xyes; then
Packit Service a2489d
   AC_DEFINE(SOCKS4, 1, [define if you are building with SOCKS support])
Packit Service a2489d
   AC_CHECK_LIB(socks, main, [SOCKSLIBS=-lsocks],
Packit Service a2489d
      [AC_MSG_ERROR([cannot find -lsocks library])])
Packit Service a2489d
fi
Packit Service a2489d
if test x$with_socks5 = xyes; then
Packit Service a2489d
   AC_DEFINE(SOCKS5, 1, [define if you are building with SOCKSv5 support])
Packit Service a2489d
   AC_CHECK_LIB(socks5, main, [SOCKSLIBS=-lsocks5],
Packit Service a2489d
      [AC_MSG_ERROR([cannot find -lsocks5 library])])
Packit Service a2489d
fi
Packit Service a2489d
if test x$with_socksdante = xyes; then
Packit Service a2489d
   AC_DEFINE(SOCKS_DANTE, 1, [define if you are building with SOCKS-Dante support])
Packit Service a2489d
   AC_CHECK_LIB(socks, main, [SOCKSLIBS=-lsocks],
Packit Service a2489d
      [AC_MSG_ERROR([cannot find -lsocks library])])
Packit Service a2489d
fi
Packit Service a2489d
Packit Service a2489d
AC_SUBST(SOCKSLIBS)
Packit Service a2489d
if test -n "$SOCKSLIBS"; then
Packit Service a2489d
   old_LIBS="$LIBS"
Packit Service a2489d
   LIBS="$LIBS $SOCKSLIBS"
Packit Service a2489d
   AC_CHECK_FUNCS([Rpoll])
Packit Service a2489d
   if test "$ac_cv_func_Rpoll" != yes; then
Packit Service a2489d
      gl_cv_func_poll=no
Packit Service a2489d
   fi
Packit Service a2489d
   LIBS="$old_LIBS"
Packit Service a2489d
fi
Packit Service a2489d
Packit Service a2489d
AC_ARG_WITH(modules,
Packit Service a2489d
   AS_HELP_STRING([--with-modules], [build modular lftp (protocols become dll's)]),
Packit Service a2489d
[  with_modules=$withval;  ],
Packit Service a2489d
[  with_modules=no;	   ])
Packit Service a2489d
Packit Service a2489d
AM_CONDITIONAL([WITH_MODULES], [test "$with_modules" = yes])
Packit Service a2489d
if test "$with_modules" = yes; then
Packit Service a2489d
   enable_static=no
Packit Service a2489d
   enable_shared=yes
Packit Service a2489d
   AC_DEFINE(WITH_MODULES, 1, [build modular lftp])
Packit Service a2489d
else
Packit Service a2489d
   enable_static=yes
Packit Service a2489d
   enable_shared=no
Packit Service a2489d
fi
Packit Service a2489d
Packit Service a2489d
#test -z "$enable_static" && enable_static=no
Packit Service a2489d
LT_INIT([dlopen])
Packit Service a2489d
LIBTOOL="$LIBTOOL --silent"
Packit Service a2489d
Packit Service a2489d
gl_INIT
Packit Service a2489d
Packit Service a2489d
if test x$ac_cv_func_wcwidth != xyes || test x$REPLACE_WCWIDTH = x1; then
Packit Service a2489d
   gl_LIBOBJ([wcwidth])
Packit Service a2489d
   AC_DEFINE([REPLACE_WCWIDTH], 1, [Define when using wcwidth replacement])
Packit Service a2489d
fi
Packit Service a2489d
Packit Service a2489d
dnl Checks for libraries.
Packit Service a2489d
dnl LFTP_CHECK_LIBM
Packit Service a2489d
AC_SEARCH_LIBS([socket],[socket])
Packit Service a2489d
AC_SEARCH_LIBS([gethostbyname],[nsl])
Packit Service a2489d
AC_SEARCH_LIBS([dlopen],[dl],[AC_DEFINE(HAVE_DLOPEN, 1, [have dlopen])])
Packit Service a2489d
AC_SEARCH_LIBS([res_9_search],[resolv],[AC_DEFINE(HAVE_RES_9_SEARCH, 1, [have res_9_search])])
Packit Service a2489d
AC_SEARCH_LIBS([res_search],[resolv bind],[AC_DEFINE(HAVE_RES_SEARCH, 1, [have res_search])])
Packit Service a2489d
AC_CHECK_DECLS([res_search],,, [
Packit Service a2489d
     #include <stdio.h>
Packit Service a2489d
     #include <sys/types.h>
Packit Service a2489d
     #include <netinet/in.h>
Packit Service a2489d
     #include <arpa/nameser.h>
Packit Service a2489d
     #include <resolv.h>
Packit Service a2489d
])
Packit Service a2489d
Packit Service a2489d
AC_ARG_ENABLE([ipv6],
Packit Service a2489d
	AS_HELP_STRING([--disable-ipv6],[disable IPv6 code]),
Packit Service a2489d
        [
Packit Service a2489d
		if test x$enableval = xno; then
Packit Service a2489d
			AC_DEFINE([DISABLE_IPV6],[1],[Disable IPv6 code])
Packit Service a2489d
		fi
Packit Service a2489d
	]
Packit Service a2489d
)
Packit Service a2489d
Packit Service a2489d
AC_ARG_WITH(libresolv, AS_HELP_STRING([--without-libresolv], [don't use libresolv]),
Packit Service a2489d
      [with_libresolv=$withval], [with_libresolv=yes])
Packit Service a2489d
if test x$with_libresolv = xyes; then
Packit Service a2489d
   AC_SEARCH_LIBS(hstrerror, resolv)
Packit Service a2489d
fi
Packit Service a2489d
Packit Service a2489d
lftp_TERMINFO
Packit Service a2489d
lftp_LIB_READLINE([5.0])
Packit Service a2489d
if test "$HAVE_READLINE" != "yes"; then
Packit Service a2489d
   AC_MSG_ERROR([cannot find readline library, install readline-devel package])
Packit Service a2489d
fi
Packit Service a2489d
Packit Service a2489d
AC_ARG_WITH(gnutls, AS_HELP_STRING([--without-gnutls], [don't use GNUTLS library]),
Packit Service a2489d
      [with_gnutls=$withval], [with_gnutls=yes])
Packit Service a2489d
AC_ARG_WITH(openssl,
Packit Service a2489d
AS_HELP_STRING([--with-openssl@<:@=/path@:>@], [use OpenSSL @<:@at /path@:>@])
Packit Service a2489d
AS_HELP_STRING([--without-openssl], [don't use OpenSSL (default)]),
Packit Service a2489d
      [with_openssl=$withval], [with_openssl=no])
Packit Service a2489d
case "$with_openssl" in
Packit Service a2489d
	yes)		with_gnutls=no;;
Packit Service a2489d
	""|no)		: ;;
Packit Service a2489d
	*)		openssl_loc=$with_openssl
Packit Service a2489d
			with_openssl=yes
Packit Service a2489d
			with_gnutls=no;;
Packit Service a2489d
esac
Packit Service a2489d
if test x$with_gnutls = xyes; then
Packit Service a2489d
   PKG_PROG_PKG_CONFIG
Packit Service a2489d
   PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 1.0.0], [
Packit Service a2489d
      AC_DEFINE([USE_GNUTLS], 1, [Define to 1 when using GNU TLS library])
Packit Service a2489d
      gnutls_version_code=`$PKG_CONFIG --modversion gnutls | $AWK -F. '{ printf "0x%02X%02X%02X\n",$1,$2,$3 }'`
Packit Service a2489d
      AC_DEFINE_UNQUOTED([LFTP_LIBGNUTLS_VERSION_CODE], $gnutls_version_code, [Define to libgnutls version, e.g. 0x010203 for 1.2.3])
Packit Service a2489d
   ])
Packit Service a2489d
fi
Packit Service a2489d
if test x$with_openssl = xyes -a x"$LIBGNUTLS_LIBS" = x; then
Packit Service a2489d
   LFTP_OPENSSL_CHECK
Packit Service a2489d
fi
Packit Service a2489d
Packit Service a2489d
AX_CHECK_ZLIB([
Packit Service a2489d
   AC_SUBST([ZLIB],[-lz])
Packit Service a2489d
   r=""; test "$enable_rpath" = yes -a "$ZLIB_HOME" != /usr && r=" -R${ZLIB_HOME}/lib"
Packit Service a2489d
   AC_SUBST([ZLIB_LDFLAGS],["-L${ZLIB_HOME}/lib$r"])
Packit Service a2489d
   AC_SUBST([ZLIB_CPPFLAGS],["-I${ZLIB_HOME}/include"])
Packit Service a2489d
],[
Packit Service a2489d
   AC_MSG_ERROR([cannot find -lz library, install zlib-devel package])
Packit Service a2489d
])
Packit Service a2489d
Packit Service a2489d
AX_LIB_EXPAT
Packit Service a2489d
if test "x$HAVE_EXPAT" = xyes; then
Packit Service a2489d
   AC_DEFINE(HAVE_LIBEXPAT, 1, [Define if you have expat library])
Packit Service a2489d
fi
Packit Service a2489d
Packit Service a2489d
# Check whether user wants DNSSEC local validation support
Packit Service a2489d
AC_ARG_WITH(dnssec-local-validation,
Packit Service a2489d
        [  --with-dnssec-local-validation Enable local DNSSEC validation using libval (default=no)], want_dnssec=$withval, want_dnssec=no)
Packit Service a2489d
if test "x$want_dnssec" = "xyes"; then
Packit Service a2489d
    AC_CHECK_HEADERS(validator/validator.h)
Packit Service a2489d
    if test "$ac_cv_header_validator_validator_h" != yes; then
Packit Service a2489d
        AC_MSG_ERROR([Can't find validator.h (from dnssec-tools)])
Packit Service a2489d
    fi
Packit Service a2489d
    AC_SEARCH_LIBS([SHA1_Init], [crypto ssl])
Packit Service a2489d
    AC_CHECK_LIB(sres, query_send)
Packit Service a2489d
    if test "$ac_cv_lib_sres_query_send" != yes; then
Packit Service a2489d
        AC_MSG_ERROR([Can't find libsres (from dnssec-tools)])
Packit Service a2489d
    fi
Packit Service a2489d
    AC_CHECK_LIB(val, p_val_status,[LIBS="$LIBS -lval"])
Packit Service a2489d
    if test "x$ac_cv_lib_val_p_val_status" = "xno"; then
Packit Service a2489d
        AC_CHECK_LIB(pthread, pthread_rwlock_init)
Packit Service a2489d
	AC_CHECK_LIB(val-threads, p_val_status,
Packit Service a2489d
                [LIBS="$LIBS -lval-threads -lpthread" LIBVAL_SUFFIX="-threads"],
Packit Service a2489d
                AC_MSG_ERROR([Can't find libval or libval-threads (from dnssec-tools)]))
Packit Service a2489d
    fi
Packit Service a2489d
    if test "x$ac_cv_lib_val_p_val_status" = "xyes" -o "x$ac_cv_lib_val_threads_p_val_status" = "xyes"; then
Packit Service a2489d
        AC_DEFINE(DNSSEC_LOCAL_VALIDATION, 1,
Packit Service a2489d
              [Define if you want local DNSSEC validation support])
Packit Service a2489d
    fi
Packit Service a2489d
fi
Packit Service a2489d
Packit Service a2489d
LFTP_PTY_CHECK
Packit Service a2489d
LFTP_POSIX_FALLOCATE_CHECK
Packit Service a2489d
LFTP_POSIX_FADVISE_CHECK
Packit Service a2489d
LFTP_LIBIDN2_CHECK
Packit Service a2489d
Packit Service a2489d
dnl Checks for header files.
Packit Service a2489d
AC_HEADER_DIRENT
Packit Service a2489d
AC_HEADER_STDC
Packit Service a2489d
AC_HEADER_SYS_WAIT
Packit Service a2489d
AC_HEADER_TIME
Packit Service a2489d
AC_CHECK_HEADERS(libintl.h fcntl.h sys/time.h errno.h stdlib.h varargs.h dirent.h\
Packit Service a2489d
 termios.h termio.h sys/select.h sys/stropts.h string.h memory.h\
Packit Service a2489d
 strings.h sys/ioctl.h dlfcn.h arpa/inet.h arpa/nameser.h netinet/in.h netinet/tcp.h\
Packit Service a2489d
 netinet/in_systm.h netinet/ip.h termcap.h sys/statfs.h ifaddrs.h\
Packit Service a2489d
 resolv.h langinfo.h endian.h locale.h expat.h linux/magic.h socks.h,,,[
Packit Service a2489d
#include <sys/types.h>
Packit Service a2489d
#ifdef HAVE_ARPA_NAMESER_H
Packit Service a2489d
# include <arpa/nameser.h>
Packit Service a2489d
#endif
Packit Service a2489d
#ifdef HAVE_NETINET_IN_H
Packit Service a2489d
# include <netinet/in.h>
Packit Service a2489d
#endif
Packit Service a2489d
#ifdef HAVE_NETINET_IN_SYSTM_H
Packit Service a2489d
# include <netinet/in_systm.h>
Packit Service a2489d
#endif
Packit Service a2489d
])
Packit Service a2489d
Packit Service a2489d
LFTP_NEED_TRIO
Packit Service a2489d
Packit Service a2489d
# See if we have h_errno (the test is here so we can use -lresolv if necessary).
Packit Service a2489d
AC_CACHE_CHECK([for h_errno], inetutils_cv_var_h_errno,
Packit Service a2489d
  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]], [[ #ifndef h_errno
Packit Service a2489d
      extern int h_errno;
Packit Service a2489d
      #endif
Packit Service a2489d
      int iu_x = h_errno; ]])],[inetutils_cv_var_h_errno=yes],[inetutils_cv_var_h_errno=no]))
Packit Service a2489d
if test "$inetutils_cv_var_h_errno" = yes; then
Packit Service a2489d
  AC_DEFINE([HAVE_H_ERRNO], 1, [system has h_errno])
Packit Service a2489d
  AC_CHECK_DECLS([h_errno],,, [#include <netdb.h>])
Packit Service a2489d
fi
Packit Service a2489d
Packit Service a2489d
# See if the system has hstrerror, and replace it if not
Packit Service a2489d
AC_CHECK_FUNC(hstrerror, , [gl_LIBOBJ(hstrerror)])
Packit Service a2489d
if test "$ac_cv_func_hstrerror" = yes; then
Packit Service a2489d
  AC_CHECK_DECLS([hstrerror],,, [#include <netdb.h>])
Packit Service a2489d
else
Packit Service a2489d
  # No hstrerror, so see if the H_ERRLIST variable can be used by ours
Packit Service a2489d
  AC_CHECK_FUNC([h_errlist],
Packit Service a2489d
    AC_CHECK_DECLS([h_errlist],,, [#include <netdb.h>]))
Packit Service a2489d
fi
Packit Service a2489d
if test "$ac_cv_func_hstrerror" = yes -o "$ac_cv_func_h_errlist" = yes; then
Packit Service a2489d
  # If there's a system hstrerror, or we can reasonably replace it, say so.
Packit Service a2489d
  # We still provide some definition, regardless, but this allows people to use
Packit Service a2489d
  # a reasonable alternative if the situation allows, rather than using a
Packit Service a2489d
  # degenerate version that only says `Host lookup error N'.
Packit Service a2489d
  AC_DEFINE(HAVE_HSTRERROR, 1, [System has usable hstrerror])
Packit Service a2489d
fi
Packit Service a2489d
Packit Service a2489d
dnl Checks for typedefs, structures, and compiler characteristics.
Packit Service a2489d
AC_TYPE_PID_T
Packit Service a2489d
AC_C_CONST
Packit Service a2489d
AC_C_INLINE
Packit Service a2489d
AC_TYPE_OFF_T
Packit Service a2489d
AC_TYPE_SIZE_T
Packit Service a2489d
if test x$ac_cv_header_endian_h = xno; then
Packit Service a2489d
   AC_C_BIGENDIAN
Packit Service a2489d
fi
Packit Service a2489d
AC_CHECK_MEMBERS([struct sockaddr.sa_len],,,
Packit Service a2489d
                 [#include <sys/types.h>
Packit Service a2489d
                  #include <sys/socket.h>])
Packit Service a2489d
AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id],,,
Packit Service a2489d
                 [#include <sys/types.h>
Packit Service a2489d
                  #include <sys/socket.h>
Packit Service a2489d
		  #include <netinet/in.h>])
Packit Service a2489d
AC_STRUCT_TIMEZONE
Packit Service a2489d
AC_STRUCT_TM
Packit Service a2489d
Packit Service a2489d
dnl Checks for library functions.
Packit Service a2489d
AC_FUNC_UTIME_NULL
Packit Service a2489d
AC_FUNC_GETPGRP
Packit Service a2489d
AC_FUNC_VPRINTF
Packit Service a2489d
AC_HEADER_STAT
Packit Service a2489d
LFTP_FUNC_SSCANF_CONST
Packit Service a2489d
AC_CHECK_FUNCS([statfs\
Packit Service a2489d
 killpg setpgid tcgetattr vsnprintf snprintf sscanf \
Packit Service a2489d
 gethostbyname2 getipnodebyname getaddrinfo getnameinfo setsid random\
Packit Service a2489d
 inet_aton setlocale dn_expand socketpair fallocate])
Packit Service a2489d
lftp_VA_COPY
Packit Service a2489d
LFTP_ENVIRON_CHECK
Packit Service a2489d
AC_CHECK_DECLS([vsnprintf,snprintf,unsetenv,random,inet_aton,strptime,strtok_r,dn_expand,memmem],,,[
Packit Service a2489d
#include <sys/types.h>
Packit Service a2489d
#include <sys/socket.h>
Packit Service a2489d
#include <stdio.h>
Packit Service a2489d
#include <stdlib.h>
Packit Service a2489d
#include <time.h>
Packit Service a2489d
#if STDC_HEADERS || HAVE_STRING_H
Packit Service a2489d
# include <string.h>
Packit Service a2489d
# if !STDC_HEADERS && HAVE_MEMORY_H
Packit Service a2489d
#  include <memory.h>
Packit Service a2489d
# endif
Packit Service a2489d
#else
Packit Service a2489d
# include <strings.h>
Packit Service a2489d
#endif
Packit Service a2489d
#ifdef HAVE_NETINET_IN_H
Packit Service a2489d
# include <netinet/in.h>
Packit Service a2489d
#endif
Packit Service a2489d
#ifdef HAVE_ARPA_INET_H
Packit Service a2489d
# include <arpa/inet.h>
Packit Service a2489d
#endif
Packit Service a2489d
#ifdef HAVE_RESOLV_H
Packit Service a2489d
# include <resolv.h>
Packit Service a2489d
#endif
Packit Service a2489d
])
Packit Service a2489d
Packit Service a2489d
if test "$prefix" = /usr -a "$sysconfdir" = '${prefix}/etc'; then
Packit Service a2489d
   sysconfdir=/etc
Packit Service a2489d
fi
Packit Service a2489d
Packit Service a2489d
AH_TOP([
Packit Service a2489d
#ifndef CONFIG_H
Packit Service a2489d
#define CONFIG_H
Packit Service a2489d
])
Packit Service a2489d
Packit Service a2489d
AH_BOTTOM([
Packit Service a2489d
#if defined(__cplusplus) && defined(inline)
Packit Service a2489d
# undef /**/ inline
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#if !defined(HAVE_SETPGID) && !defined(SETPGRP_VOID)
Packit Service a2489d
# define setpgid(pid, pgrp)  setpgrp((pid),(pgrp))
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#ifdef __cplusplus
Packit Service a2489d
# define CDECL extern "C"
Packit Service a2489d
# define CDECL_BEGIN CDECL {
Packit Service a2489d
# define CDECL_END   }
Packit Service a2489d
template<typename T>
Packit Service a2489d
static inline T replace_value(T &var,T new_value)
Packit Service a2489d
{
Packit Service a2489d
   T tmp=var;
Packit Service a2489d
   var=new_value;
Packit Service a2489d
   return tmp;
Packit Service a2489d
}
Packit Service a2489d
#else
Packit Service a2489d
# define CDECL
Packit Service a2489d
# define CDECL_BEGIN
Packit Service a2489d
# define CDECL_END
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
/* should be included before any real code. */
Packit Service a2489d
#include <alloca.h>
Packit Service a2489d
Packit Service a2489d
#include "gettext.h"
Packit Service a2489d
#define _(msgid) gettext (msgid)
Packit Service a2489d
#define N_(msgid) msgid
Packit Service a2489d
Packit Service a2489d
#ifndef PARAMS
Packit Service a2489d
# if defined __STDC__ || defined __cplusplus
Packit Service a2489d
#  define PARAMS(x) x
Packit Service a2489d
# else
Packit Service a2489d
#  define PARAMS(x) ()
Packit Service a2489d
# endif
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#define INET6 (!defined(DISABLE_IPV6) \
Packit Service a2489d
		&& defined(HAVE_IPV6) \
Packit Service a2489d
		&& defined(HAVE_GETNAMEINFO) \
Packit Service a2489d
		&& defined(HAVE_GETADDRINFO))
Packit Service a2489d
Packit Service a2489d
#define USE_EXPAT (defined(HAVE_EXPAT_H) && defined(HAVE_LIBEXPAT))
Packit Service a2489d
Packit Service a2489d
#if defined(SOCKS4) || defined(SOCKS5) || defined(SOCKS_DANTE)
Packit Service a2489d
# define SOCKS 1
Packit Service a2489d
#endif
Packit Service a2489d
#ifdef SOCKS
Packit Service a2489d
# if defined(HAVE_SOCKS_H)
Packit Service a2489d
CDECL_BEGIN
Packit Service a2489d
#  include <socks.h>
Packit Service a2489d
CDECL_END
Packit Service a2489d
#  undef /**/ getc /* fix a problem with redefined getc */
Packit Service a2489d
# else // !HAVE_SOCKS_H
Packit Service a2489d
#  if defined(SOCKS4) || defined(SOCKS_DANTE)
Packit Service a2489d
#   define connect     Rconnect
Packit Service a2489d
#   define getsockname Rgetsockname
Packit Service a2489d
#   define bind	     Rbind
Packit Service a2489d
#   define accept	     Raccept
Packit Service a2489d
#   define listen	     Rlisten
Packit Service a2489d
#   define select	     Rselect
Packit Service a2489d
#   ifdef HAVE_RPOLL
Packit Service a2489d
#    define poll	     Rpoll
Packit Service a2489d
#   endif
Packit Service a2489d
CDECL int SOCKSinit(const char *);
Packit Service a2489d
#  endif
Packit Service a2489d
#  ifdef SOCKS_DANTE
Packit Service a2489d
#   define rresvport Rrresvport
Packit Service a2489d
#   define bindresvport Rbindresvport
Packit Service a2489d
#   define gethostbyname Rgethostbyname
Packit Service a2489d
#   define gethostbyname2 Rgethostbyname2
Packit Service a2489d
#   define sendto Rsendto
Packit Service a2489d
#   define recvfrom Rrecvfrom
Packit Service a2489d
#   define recvfrom Rrecvfrom
Packit Service a2489d
#   define write Rwrite
Packit Service a2489d
#   define writev Rwritev
Packit Service a2489d
#   define send Rsend
Packit Service a2489d
#   define sendmsg Rsendmsg
Packit Service a2489d
#   define read Rread
Packit Service a2489d
#   define readv Rreadv
Packit Service a2489d
#   define recv Rrecv
Packit Service a2489d
#   define recvmsg Rrecvmsg
Packit Service a2489d
#  endif
Packit Service a2489d
# endif // !HAVE_SOCKS_H
Packit Service a2489d
#endif // SOCKS
Packit Service a2489d
Packit Service a2489d
#if defined __MSDOS__ || defined __CYGWIN32__
Packit Service a2489d
# define NATIVE_CRLF 1
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#define E_RETRY(e) ((e)==EAGAIN || (e)==EWOULDBLOCK || (e)==EINTR)
Packit Service a2489d
#define E_LOCK_IGNORE(e) ((e)==EINVAL || (e)==ENOLCK)
Packit Service a2489d
Packit Service a2489d
#ifndef HAVE_RANDOM
Packit Service a2489d
#define srandom(x) srand((x))
Packit Service a2489d
#define random() ((long)(rand()/(RAND_MAX+1.0)*2147483648.0))
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
/* Tell the compiler when a conditional or integer expression is
Packit Service a2489d
   almost always true or almost always false.  */
Packit Service a2489d
#ifndef HAVE_BUILTIN_EXPECT
Packit Service a2489d
# define __builtin_expect(expr, val) (expr)
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#ifdef __GNUC__
Packit Service a2489d
# define PRINTF_LIKE(n,m) __attribute__((format(__printf__,n,m)))
Packit Service a2489d
#else
Packit Service a2489d
# define PRINTF_LIKE(n,m)
Packit Service a2489d
# define __attribute__(x)
Packit Service a2489d
#endif
Packit Service a2489d
/* Attribute `sentinel' was valid as of gcc 3.5.  */
Packit Service a2489d
#if defined(__GNUC__) && \
Packit Service a2489d
    (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 5))
Packit Service a2489d
# define ATTRIBUTE_SENTINEL __attribute__ ((__sentinel__))
Packit Service a2489d
#else
Packit Service a2489d
# define ATTRIBUTE_SENTINEL
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#ifdef TRIO_REPLACE_STDIO
Packit Service a2489d
/* replace all the functions */
Packit Service a2489d
# undef /**/ HAVE_PRINTF
Packit Service a2489d
# undef /**/ HAVE_VPRINTF
Packit Service a2489d
# undef /**/ HAVE_FPRINTF
Packit Service a2489d
# undef /**/ HAVE_VFPRINTF
Packit Service a2489d
# undef /**/ HAVE_SPRINTF
Packit Service a2489d
# undef /**/ HAVE_VSPRINTF
Packit Service a2489d
# undef /**/ HAVE_SNPRINTF
Packit Service a2489d
# undef /**/ HAVE_VSNPRINTF
Packit Service a2489d
# undef /**/ HAVE_SCANF
Packit Service a2489d
# undef /**/ HAVE_VSCANF
Packit Service a2489d
# undef /**/ HAVE_FSCANF
Packit Service a2489d
# undef /**/ HAVE_VFSCANF
Packit Service a2489d
# undef /**/ HAVE_SSCANF
Packit Service a2489d
# undef /**/ HAVE_VSSCANF
Packit Service a2489d
# include "trio.h"
Packit Service a2489d
#endif
Packit Service a2489d
Packit Service a2489d
#define USE_SSL (defined(USE_GNUTLS) || defined(USE_OPENSSL))
Packit Service a2489d
Packit Service a2489d
#endif /* CONFIG_H */
Packit Service a2489d
])
Packit Service a2489d
Packit Service a2489d
AC_CONFIG_FILES([Makefile])
Packit Service a2489d
AC_CONFIG_FILES([src/Makefile])
Packit Service a2489d
AC_CONFIG_FILES([lib/Makefile])
Packit Service a2489d
AC_CONFIG_FILES([doc/Makefile])
Packit Service a2489d
AC_CONFIG_FILES([po/Makefile.in])
Packit Service a2489d
AC_CONFIG_FILES([m4/Makefile])
Packit Service a2489d
AC_CONFIG_FILES([trio/Makefile])
Packit Service a2489d
AC_CONFIG_FILES([contrib/Makefile])
Packit Service a2489d
AC_CONFIG_FILES([tests/Makefile])
Packit Service a2489d
AC_CONFIG_FILES([lftp.spec])
Packit Service a2489d
Packit Service a2489d
AC_OUTPUT