1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Fix libssh2 detection. Fixes #1058. Closes #1059

This commit is contained in:
dmiller
2017-11-01 22:55:49 +00:00
parent 41199b7eea
commit 53e4e92e32
2 changed files with 47 additions and 12 deletions

51
configure vendored
View File

@@ -5552,8 +5552,8 @@ $as_echo "no" >&6; }
if test -n "$PYTHON"; then
# If the user set $PYTHON, use it and don't search something else.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version >= 2.4" >&5
$as_echo_n "checking whether $PYTHON version >= 2.4... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version is >= 2.4" >&5
$as_echo_n "checking whether $PYTHON version is >= 2.4... " >&6; }
prog="import sys
# split strings by '.' and convert to numeric. Append some zeros
# because we need at least 4 digits for the hex conversion.
@@ -5571,7 +5571,9 @@ sys.exit(sys.hexversion < minverhex)"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
as_fn_error $? "too old" "$LINENO" 5
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
as_fn_error $? "Python interpreter is too old" "$LINENO" 5
fi
am_display_PYTHON=$PYTHON
else
@@ -5690,6 +5692,25 @@ $as_echo "$am_cv_python_platform" >&6; }
PYTHON_PLATFORM=$am_cv_python_platform
# Just factor out some code duplication.
am_python_setup_sysconfig="\
import sys
# Prefer sysconfig over distutils.sysconfig, for better compatibility
# with python 3.x. See automake bug#10227.
try:
import sysconfig
except ImportError:
can_use_sysconfig = 0
else:
can_use_sysconfig = 1
# Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs:
# <https://github.com/pypa/virtualenv/issues/118>
try:
from platform import python_implementation
if python_implementation() == 'CPython' and sys.version[:3] == '2.7':
can_use_sysconfig = 0
except ImportError:
pass"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5
@@ -5703,7 +5724,14 @@ else
else
am_py_prefix=$prefix
fi
am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null`
am_cv_python_pythondir=`$PYTHON -c "
$am_python_setup_sysconfig
if can_use_sysconfig:
sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'})
else:
from distutils import sysconfig
sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix')
sys.stdout.write(sitedir)"`
case $am_cv_python_pythondir in
$am_py_prefix*)
am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
@@ -5740,7 +5768,14 @@ else
else
am_py_exec_prefix=$exec_prefix
fi
am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null`
am_cv_python_pyexecdir=`$PYTHON -c "
$am_python_setup_sysconfig
if can_use_sysconfig:
sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'})
else:
from distutils import sysconfig
sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix')
sys.stdout.write(sitedir)"`
case $am_cv_python_pyexecdir in
$am_py_exec_prefix*)
am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
@@ -6801,8 +6836,7 @@ if test "${with_libssh2+set}" = set; then :
CPPFLAGS="-I$with_libssh2/include $CPPFLAGS"
LDFLAGS="-L$with_libssh2/lib $LDFLAGS"
ac_fn_c_check_header_compile "$LINENO" "libssh2.h" "ac_cv_header_libssh2_h" "-lm
"
ac_fn_c_check_header_mongrel "$LINENO" "libssh2.h" "ac_cv_header_libssh2_h" "$ac_includes_default"
if test "x$ac_cv_header_libssh2_h" = xyes; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libssh2_version in -lssh2" >&5
@@ -6811,7 +6845,7 @@ if ${ac_cv_lib_ssh2_libssh2_version+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lssh2 $LIBS"
LIBS="-lssh2 -lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -6847,6 +6881,7 @@ if test "x$ac_cv_lib_ssh2_libssh2_version" = xyes; then :
LIBSSH2_LIB=$with_libssh2/lib
fi
fi

View File

@@ -589,9 +589,8 @@ AC_HELP_STRING([--with-libz=included], [Always use version included with Nmap]),
AC_CHECK_LIB(z, gzread,
[have_libz=yes
ZLIB_INC=$with_libz/include
ZLIB_LIB=$with_libz/lib])
],,
)
ZLIB_LIB=$with_libz/lib],,)
])
LDFLAGS=$_ldflags
CPPFLAGS=$_cppflags
@@ -674,7 +673,8 @@ AC_HELP_STRING([--without-libssh2], [Compile without libssh2]),
AC_CHECK_LIB(ssh2, libssh2_version,
[have_libssh2=yes
LIBSSH2_INC=$with_libssh2/include
LIBSSH2_LIB=$with_libssh2/lib])],,[-lm])
LIBSSH2_LIB=$with_libssh2/lib],,[-lm])
])
LDFLAGS=$_ldflags
CPPFLAGS=$_cppflags