mirror of
https://github.com/nmap/nmap.git
synced 2026-01-03 13:19:04 +00:00
Upgrade libssh2 to 1.11.0
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
# AC_PREREQ(2.57)
|
||||
AC_INIT(libssh2, [-], libssh2-devel@cool.haxx.se)
|
||||
# AC_PREREQ(2.59)
|
||||
AC_INIT([libssh2],[-],[libssh2-devel@lists.haxx.se])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AC_CONFIG_SRCDIR([src])
|
||||
AC_CONFIG_HEADERS([src/libssh2_config.h])
|
||||
AC_REQUIRE_AUX_FILE([tap-driver.sh])
|
||||
AM_MAINTAINER_MODE
|
||||
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
||||
|
||||
@@ -33,11 +34,9 @@ AB_INIT
|
||||
AC_CANONICAL_HOST
|
||||
case "$host" in
|
||||
*-mingw*)
|
||||
CFLAGS="$CFLAGS -DLIBSSH2_WIN32"
|
||||
LIBS="$LIBS -lws2_32"
|
||||
;;
|
||||
*darwin*)
|
||||
CFLAGS="$CFLAGS -DLIBSSH2_DARWIN"
|
||||
;;
|
||||
*hpux*)
|
||||
;;
|
||||
@@ -48,12 +47,6 @@ case "$host" in
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_CHECK_TYPE(long long,
|
||||
[AC_DEFINE(HAVE_LONGLONG, 1,
|
||||
[Define to 1 if the compiler supports the 'long long' data type.])]
|
||||
longlong="yes"
|
||||
)
|
||||
|
||||
dnl Our configure and build reentrant settings
|
||||
CURL_CONFIGURE_REENTRANT
|
||||
|
||||
@@ -70,10 +63,21 @@ AC_PROG_CXX
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_MAKE_SET
|
||||
AC_PATH_PROGS(SSHD, [sshd], [],
|
||||
[$PATH$PATH_SEPARATOR/usr/libexec$PATH_SEPARATOR]dnl
|
||||
[/usr/sbin$PATH_SEPARATOR/usr/etc$PATH_SEPARATOR/etc])
|
||||
AM_CONDITIONAL(SSHD, test -n "$SSHD")
|
||||
m4_ifdef([LT_INIT],
|
||||
[dnl
|
||||
LT_INIT([win32-dll])
|
||||
],[dnl
|
||||
AC_LIBTOOL_WIN32_DLL
|
||||
AC_PROG_LIBTOOL
|
||||
])
|
||||
AC_C_BIGENDIAN
|
||||
|
||||
LT_LANG([Windows Resource])
|
||||
|
||||
dnl check for how to do large files
|
||||
AC_SYS_LARGEFILE
|
||||
|
||||
@@ -81,16 +85,16 @@ AC_SYS_LARGEFILE
|
||||
|
||||
found_crypto=none
|
||||
found_crypto_str=""
|
||||
support_clear_memory=no
|
||||
crypto_errors=""
|
||||
|
||||
m4_set_add([crypto_backends], [openssl])
|
||||
m4_set_add([crypto_backends], [libgcrypt])
|
||||
m4_set_add([crypto_backends], [mbedtls])
|
||||
m4_set_add([crypto_backends], [wincng])
|
||||
m4_set_add([crypto_backends], [wolfssl])
|
||||
|
||||
AC_ARG_WITH([crypto],
|
||||
AC_HELP_STRING([--with-crypto=auto|]m4_set_contents([crypto_backends], [|]),
|
||||
AS_HELP_STRING([--with-crypto=auto|]m4_set_contents([crypto_backends], [|]),
|
||||
[Select crypto backend (default: auto)]),
|
||||
use_crypto=$withval,
|
||||
use_crypto=auto
|
||||
@@ -110,7 +114,7 @@ esac
|
||||
|
||||
if test "$found_crypto" = "none"; then
|
||||
crypto_errors="${crypto_errors}
|
||||
Specify --with-crypto=\$backend and/or the neccessary library search prefix.
|
||||
Specify --with-crypto=\$backend and/or the necessary library search prefix.
|
||||
|
||||
Known crypto backends: auto, m4_set_contents([crypto_backends], [, ])"
|
||||
AS_MESSAGE([ERROR: ${crypto_errors}])
|
||||
@@ -118,14 +122,10 @@ else
|
||||
test "$found_crypto_str" = "" && found_crypto_str="$found_crypto"
|
||||
fi
|
||||
|
||||
m4_set_foreach([crypto_backends], [backend],
|
||||
[AM_CONDITIONAL(m4_toupper(backend), test "$found_crypto" = "backend")]
|
||||
)
|
||||
|
||||
# libz
|
||||
|
||||
AC_ARG_WITH([libz],
|
||||
AC_HELP_STRING([--with-libz],[Use libz for compression]),
|
||||
AS_HELP_STRING([--with-libz],[Use libz for compression]),
|
||||
use_libz=$withval,
|
||||
use_libz=auto)
|
||||
|
||||
@@ -155,43 +155,14 @@ AC_SUBST(LIBSREQUIRED)
|
||||
#
|
||||
# Optional Settings
|
||||
#
|
||||
AC_ARG_ENABLE(crypt-none,
|
||||
AC_HELP_STRING([--enable-crypt-none],[Permit "none" cipher -- NOT RECOMMENDED]),
|
||||
[AC_DEFINE(LIBSSH2_CRYPT_NONE, 1, [Enable "none" cipher -- NOT RECOMMENDED])])
|
||||
|
||||
AC_ARG_ENABLE(mac-none,
|
||||
AC_HELP_STRING([--enable-mac-none],[Permit "none" MAC -- NOT RECOMMENDED]),
|
||||
[AC_DEFINE(LIBSSH2_MAC_NONE, 1, [Enable "none" MAC -- NOT RECOMMENDED])])
|
||||
|
||||
AC_ARG_ENABLE(gex-new,
|
||||
AC_HELP_STRING([--disable-gex-new],[Disable "new" diffie-hellman-group-exchange-sha1 method]),
|
||||
[GEX_NEW=$enableval])
|
||||
if test "$GEX_NEW" != "no"; then
|
||||
AC_DEFINE(LIBSSH2_DH_GEX_NEW, 1, [Enable newer diffie-hellman-group-exchange-sha1 syntax])
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(clear-memory,
|
||||
AC_HELP_STRING([--disable-clear-memory],[Disable clearing of memory before being freed]),
|
||||
AS_HELP_STRING([--disable-clear-memory],[Disable clearing of memory before being freed]),
|
||||
[CLEAR_MEMORY=$enableval])
|
||||
if test "$CLEAR_MEMORY" != "no"; then
|
||||
if test "$support_clear_memory" = "yes"; then
|
||||
AC_DEFINE(LIBSSH2_CLEAR_MEMORY, 1, [Enable clearing of memory before being freed])
|
||||
enable_clear_memory=yes
|
||||
else
|
||||
if test "$CLEAR_MEMORY" = "yes"; then
|
||||
AC_MSG_ERROR([secure clearing/zeroing of memory is not supported by the selected crypto backend])
|
||||
else
|
||||
AC_MSG_WARN([secure clearing/zeroing of memory is not supported by the selected crypto backend])
|
||||
fi
|
||||
enable_clear_memory=unsupported
|
||||
fi
|
||||
if test "$CLEAR_MEMORY" = "no"; then
|
||||
AC_DEFINE(LIBSSH2_NO_CLEAR_MEMORY, 1, [Disable clearing of memory before being freed])
|
||||
enable_clear_memory=no
|
||||
else
|
||||
if test "$support_clear_memory" = "yes"; then
|
||||
enable_clear_memory=no
|
||||
else
|
||||
AC_MSG_WARN([secure clearing/zeroing of memory is not supported by the selected crypto backend])
|
||||
enable_clear_memory=unsupported
|
||||
fi
|
||||
enable_clear_memory=yes
|
||||
fi
|
||||
|
||||
dnl ************************************************************
|
||||
@@ -199,8 +170,8 @@ dnl option to switch on compiler debug options
|
||||
dnl
|
||||
AC_MSG_CHECKING([whether to enable pedantic and debug compiler options])
|
||||
AC_ARG_ENABLE(debug,
|
||||
AC_HELP_STRING([--enable-debug],[Enable pedantic and debug options])
|
||||
AC_HELP_STRING([--disable-debug],[Disable debug options]),
|
||||
AS_HELP_STRING([--enable-debug],[Enable pedantic and debug options])
|
||||
AS_HELP_STRING([--disable-debug],[Disable debug options]),
|
||||
[ case "$enable_debug" in
|
||||
no)
|
||||
AC_MSG_RESULT(no)
|
||||
@@ -228,8 +199,8 @@ dnl on gcc >= 4.0 and SunPro C.
|
||||
dnl
|
||||
AC_MSG_CHECKING([whether to enable hidden symbols in the library])
|
||||
AC_ARG_ENABLE(hidden-symbols,
|
||||
AC_HELP_STRING([--enable-hidden-symbols],[Hide internal symbols in library])
|
||||
AC_HELP_STRING([--disable-hidden-symbols],[Leave all symbols with default visibility in library]),
|
||||
AS_HELP_STRING([--enable-hidden-symbols],[Hide internal symbols in library])
|
||||
AS_HELP_STRING([--disable-hidden-symbols],[Leave all symbols with default visibility in library]),
|
||||
[ case "$enableval" in
|
||||
no)
|
||||
AC_MSG_RESULT(no)
|
||||
@@ -260,11 +231,36 @@ AC_HELP_STRING([--disable-hidden-symbols],[Leave all symbols with default visibi
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
|
||||
# Build tests?
|
||||
AC_ARG_ENABLE([tests],
|
||||
[AS_HELP_STRING([--disable-tests], [Disable tests @<:@default=enabled@:>@])],
|
||||
[
|
||||
if ! test "x${enable_tests}" = "xyes"; then
|
||||
enable_tests="no"
|
||||
fi
|
||||
],
|
||||
[enable_tests="yes"])
|
||||
AM_CONDITIONAL([ENABLE_TESTS], [test "x$enable_tests" = xyes])
|
||||
|
||||
# Run Docker tests?
|
||||
AC_ARG_ENABLE([docker-tests],
|
||||
[AS_HELP_STRING([--disable-docker-tests],
|
||||
[Do not run tests requiring Docker])],
|
||||
[run_docker_tests=no], [run_docker_tests=yes])
|
||||
AM_CONDITIONAL([RUN_DOCKER_TESTS], [test "x$run_docker_tests" != "xno"])
|
||||
|
||||
# Run sshd tests?
|
||||
AC_ARG_ENABLE([sshd-tests],
|
||||
[AS_HELP_STRING([--disable-sshd-tests],
|
||||
[Do not run tests requiring sshd])],
|
||||
[run_sshd_tests=no], [run_sshd_tests=yes])
|
||||
AM_CONDITIONAL([RUN_SSHD_TESTS], [test "x$run_sshd_tests" != "xno"])
|
||||
|
||||
# Build example applications?
|
||||
AC_MSG_CHECKING([whether to build example applications])
|
||||
AC_ARG_ENABLE([examples-build],
|
||||
AC_HELP_STRING([--enable-examples-build], [Build example applications (this is the default)])
|
||||
AC_HELP_STRING([--disable-examples-build], [Do not build example applications]),
|
||||
AS_HELP_STRING([--enable-examples-build], [Build example applications (this is the default)])
|
||||
AS_HELP_STRING([--disable-examples-build], [Do not build example applications]),
|
||||
[case "$enableval" in
|
||||
no | false)
|
||||
build_examples='no'
|
||||
@@ -292,19 +288,17 @@ AM_CONDITIONAL([USE_OSSFUZZ_STATIC], [test -f "$LIB_FUZZING_ENGINE"])
|
||||
|
||||
|
||||
# Checks for header files.
|
||||
# AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS([errno.h fcntl.h stdio.h stdlib.h unistd.h sys/uio.h])
|
||||
AC_CHECK_HEADERS([errno.h fcntl.h stdio.h unistd.h sys/param.h sys/uio.h])
|
||||
AC_CHECK_HEADERS([sys/select.h sys/socket.h sys/ioctl.h sys/time.h])
|
||||
AC_CHECK_HEADERS([arpa/inet.h netinet/in.h])
|
||||
AC_CHECK_HEADERS([sys/un.h], [have_sys_un_h=yes], [have_sys_un_h=no])
|
||||
AM_CONDITIONAL([HAVE_SYS_UN_H], test "x$have_sys_un_h" = xyes)
|
||||
AC_CHECK_HEADERS([sys/un.h])
|
||||
|
||||
case $host in
|
||||
*-*-cygwin* | *-*-cegcc*)
|
||||
# These are POSIX-like systems using BSD-like sockets API.
|
||||
;;
|
||||
*)
|
||||
AC_CHECK_HEADERS([windows.h winsock2.h ws2tcpip.h])
|
||||
AC_CHECK_HEADERS([windows.h], [have_windows_h=yes], [have_windows_h=no])
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -314,7 +308,7 @@ case $host in
|
||||
dnl Interix: "does provide poll(), but the implementing developer must
|
||||
dnl have been in a bad mood, because poll() only works on the /proc
|
||||
dnl filesystem here"
|
||||
dnl Mac OS X's poll has funny behaviors, like:
|
||||
dnl macOS poll() has funny behaviors, like:
|
||||
dnl not being able to do poll on no fildescriptors (10.3?)
|
||||
dnl not being able to poll on some files (like anything in /dev)
|
||||
dnl not having reliable timeout support
|
||||
@@ -326,21 +320,21 @@ case $host in
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_CHECK_FUNCS(gettimeofday select strtoll memset_s)
|
||||
AC_CHECK_FUNCS(gettimeofday select strtoll explicit_bzero explicit_memset memset_s snprintf)
|
||||
|
||||
dnl Check for select() into ws2_32 for Msys/Mingw
|
||||
if test "$ac_cv_func_select" != "yes"; then
|
||||
AC_MSG_CHECKING([for select in ws2_32])
|
||||
AC_TRY_LINK([
|
||||
#ifdef HAVE_WINSOCK2_H
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <winsock2.h>
|
||||
#endif
|
||||
],[
|
||||
]], [[
|
||||
select(0,(fd_set *)NULL,(fd_set *)NULL,(fd_set *)NULL,(struct timeval *)NULL);
|
||||
],[
|
||||
]])],[
|
||||
AC_MSG_RESULT([yes])
|
||||
HAVE_SELECT="1"
|
||||
AC_DEFINE_UNQUOTED(HAVE_SELECT, 1,
|
||||
@@ -374,9 +368,25 @@ if test $missing_required_deps = 1; then
|
||||
AC_MSG_ERROR([Required dependencies are missing!])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL([HAVE_WINDRES],
|
||||
[test "x$have_windows_h" = "xyes" && test "x${enable_shared}" = "xyes" && test -n "${RC}"])
|
||||
|
||||
# Configure parameters
|
||||
LIBSSH2_CHECK_OPTION_WERROR
|
||||
|
||||
# Append crypto lib
|
||||
if test "$found_crypto" = "openssl"; then
|
||||
LIBS="${LIBS} ${LTLIBSSL}"
|
||||
elif test "$found_crypto" = "wolfssl"; then
|
||||
LIBS="${LIBS} ${LTLIBWOLFSSL}"
|
||||
elif test "$found_crypto" = "libgcrypt"; then
|
||||
LIBS="${LIBS} ${LTLIBGCRYPT}"
|
||||
elif test "$found_crypto" = "wincng"; then
|
||||
LIBS="${LIBS} ${LTLIBBCRYPT}"
|
||||
elif test "$found_crypto" = "mbedtls"; then
|
||||
LIBS="${LIBS} ${LTLIBMBEDCRYPTO}"
|
||||
fi
|
||||
|
||||
AC_CONFIG_FILES([Makefile
|
||||
src/Makefile
|
||||
libssh2.pc])
|
||||
@@ -391,8 +401,11 @@ AC_MSG_NOTICE([summary of build options:
|
||||
Compiler flags: ${CFLAGS}
|
||||
Library types: Shared=${enable_shared}, Static=${enable_static}
|
||||
Crypto library: ${found_crypto_str}
|
||||
zlib compression: ${found_libz}
|
||||
Clear memory: $enable_clear_memory
|
||||
Debug build: $enable_debug
|
||||
Build examples: $build_examples
|
||||
zlib compression: ${found_libz}
|
||||
Run Docker tests: $run_docker_tests
|
||||
Run sshd tests: $run_sshd_tests
|
||||
Path to sshd: $ac_cv_path_SSHD (only for self-tests)
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user