mirror of
https://github.com/libssh2/libssh2.git
synced 2025-07-29 13:01:14 +03:00
build: more fixes and tidy-up (mostly for Windows)
- cmake: always link `ws2_32` on Windows. Also add it to `libssh2.pc`. Fixes #745 - agent: fix gcc compiler warning: `src/agent.c:296:35: warning: 'snprintf' output truncated before the last format character [-Wformat-truncation=]` - autotools: fix `EVP_aes_128_ctr` detection with binutils `ld` The prerequisite for a successful detection is setting `LIBS=-lbcrypt` if the chosen openssl-compatible library requires it, e.g. libressl, or quictls/openssl built with `-DUSE_BCRYPTGENRANDOM`. With llvm `lld`, detection works out of the box. With binutils `ld`, it does not. The reason is `ld`s world-famous pickiness with lib order. To fix it, we pass all custom libs before and after the TLS libs. This ugly hack makes `ld` happy and detection succeed. - agent: fix Windows-specific warning: `src/agent.c:318:10: warning: implicit conversion loses integer precision: 'LRESULT' (aka 'long long') to 'int' [-Wshorten-64-to-32]` - src: fix llvm/clang compiler warning: `src/libssh2_priv.h:987:28: warning: variadic macros are a C99 feature [-Wvariadic-macros]` - src: support `inline` with `__GNUC__` (llvm/clang and gcc), fixing: ``` src/libssh2_priv.h:990:8: warning: extension used [-Wlanguage-extension-token] static inline void ^ ``` - blowfish: support `inline` keyword with MSVC. Also switch to `__inline__` (from `__inline`) for `__GNUC__`: https://gcc.gnu.org/onlinedocs/gcc/Inline.html https://clang.llvm.org/docs/UsersManual.html#differences-between-various-standard-modes - example/test: fix MSVC compiler warnings: - `example\direct_tcpip.c(209): warning C4244: 'function': conversion from 'unsigned int' to 'u_short', possible loss of data` - `tests\session_fixture.c(96): warning C4013: 'getcwd' undefined; assuming extern returning int` - `tests\session_fixture.c(100): warning C4013: 'chdir' undefined; assuming extern returning int` - delete unused macros: - `HAVE_SOCKET` - `HAVE_INET_ADDR` - `NEED_LIB_NSL` - `NEED_LIB_SOCKET` - `HAVE_NTSTATUS_H` - `HAVE_NTDEF_H` - build: delete stale zlib/openssl version numbers from path defaults. - cmake: convert tabs to spaces, add newline at EOFs. Closes #811
This commit is contained in:
@ -79,6 +79,10 @@ install(
|
|||||||
include(max_warnings)
|
include(max_warnings)
|
||||||
include(FeatureSummary)
|
include(FeatureSummary)
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
list(APPEND LIBRARIES ws2_32)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
|
||||||
option(BUILD_EXAMPLES "Build libssh2 examples" ON)
|
option(BUILD_EXAMPLES "Build libssh2 examples" ON)
|
||||||
|
@ -422,7 +422,9 @@ m4_case([$1],
|
|||||||
|
|
||||||
# Not all OpenSSL have AES-CTR functions.
|
# Not all OpenSSL have AES-CTR functions.
|
||||||
libssh2_save_LIBS="$LIBS"
|
libssh2_save_LIBS="$LIBS"
|
||||||
LIBS="$LIBS $LIBSSL"
|
# Duplicate $LIBS to make binutils ld (known to be fatally
|
||||||
|
# sensitive to lib order) happy.
|
||||||
|
LIBS="$LIBS $LIBSSL $LIBS"
|
||||||
AC_CHECK_FUNCS(EVP_aes_128_ctr)
|
AC_CHECK_FUNCS(EVP_aes_128_ctr)
|
||||||
LIBS="$libssh2_save_LIBS"
|
LIBS="$libssh2_save_LIBS"
|
||||||
|
|
||||||
@ -462,8 +464,6 @@ m4_case([$1],
|
|||||||
[wincng], [
|
[wincng], [
|
||||||
# Look for Windows Cryptography API: Next Generation
|
# Look for Windows Cryptography API: Next Generation
|
||||||
|
|
||||||
AC_CHECK_HEADERS([ntdef.h ntstatus.h], [], [], [#include <windows.h>])
|
|
||||||
|
|
||||||
LIBSSH2_LIB_HAVE_LINKFLAGS([crypt32], [], [
|
LIBSSH2_LIB_HAVE_LINKFLAGS([crypt32], [], [
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <wincrypt.h>
|
#include <wincrypt.h>
|
||||||
|
@ -1,64 +0,0 @@
|
|||||||
# Copyright (c) 2014 Alexander Lamaison <alexander.lamaison@gmail.com>
|
|
||||||
#
|
|
||||||
# Redistribution and use in source and binary forms,
|
|
||||||
# with or without modification, are permitted provided
|
|
||||||
# that the following conditions are met:
|
|
||||||
#
|
|
||||||
# Redistributions of source code must retain the above
|
|
||||||
# copyright notice, this list of conditions and the
|
|
||||||
# following disclaimer.
|
|
||||||
#
|
|
||||||
# Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following
|
|
||||||
# disclaimer in the documentation and/or other materials
|
|
||||||
# provided with the distribution.
|
|
||||||
#
|
|
||||||
# Neither the name of the copyright holder nor the names
|
|
||||||
# of any other contributors may be used to endorse or
|
|
||||||
# promote products derived from this software without
|
|
||||||
# specific prior written permission.
|
|
||||||
#
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
|
|
||||||
# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
|
||||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
||||||
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
||||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
||||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
||||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
||||||
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
||||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
|
||||||
# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
# OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
# Some systems have their socket functions in a library.
|
|
||||||
# (Solaris -lsocket/-lnsl, Windows -lws2_32). This macro appends those
|
|
||||||
# libraries to the given list
|
|
||||||
macro(append_needed_socket_libraries LIBRARIES_LIST)
|
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Windows" AND CMAKE_SIZEOF_VOID_P EQUAL 4)
|
|
||||||
# x86 Windows uses STDCALL for these functions, so their names are mangled,
|
|
||||||
# meaning the platform checks don't work. Hardcoding these until we get
|
|
||||||
# a better solution.
|
|
||||||
set(HAVE_SOCKET 1)
|
|
||||||
set(HAVE_SELECT 1)
|
|
||||||
set(HAVE_INET_ADDR 1)
|
|
||||||
set(NEED_LIB_WS2_32 1)
|
|
||||||
else()
|
|
||||||
check_function_exists_may_need_library(socket HAVE_SOCKET socket ws2_32)
|
|
||||||
check_function_exists_may_need_library(select HAVE_SELECT ws2_32)
|
|
||||||
check_function_exists_may_need_library(inet_addr HAVE_INET_ADDR nsl ws2_32)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NEED_LIB_SOCKET)
|
|
||||||
list(APPEND ${LIBRARIES_LIST} socket)
|
|
||||||
endif()
|
|
||||||
if(NEED_LIB_NSL)
|
|
||||||
list(APPEND ${LIBRARIES_LIST} nsl)
|
|
||||||
endif()
|
|
||||||
if(NEED_LIB_WS2_32)
|
|
||||||
list(APPEND ${LIBRARIES_LIST} ws2_32)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
endmacro()
|
|
@ -36,7 +36,6 @@
|
|||||||
include(CheckIncludeFiles)
|
include(CheckIncludeFiles)
|
||||||
include(CheckSymbolExists)
|
include(CheckSymbolExists)
|
||||||
include(CopyRuntimeDependencies)
|
include(CopyRuntimeDependencies)
|
||||||
include(SocketLibraries)
|
|
||||||
|
|
||||||
set(EXAMPLES
|
set(EXAMPLES
|
||||||
direct_tcpip
|
direct_tcpip
|
||||||
@ -63,8 +62,6 @@ set(EXAMPLES
|
|||||||
subsystem_netconf
|
subsystem_netconf
|
||||||
tcpip-forward)
|
tcpip-forward)
|
||||||
|
|
||||||
append_needed_socket_libraries(LIBRARIES)
|
|
||||||
|
|
||||||
foreach(example ${EXAMPLES})
|
foreach(example ${EXAMPLES})
|
||||||
add_executable(example-${example} ${example}.c)
|
add_executable(example-${example} ${example}.c)
|
||||||
list(APPEND EXAMPLE_TARGETS example-${example})
|
list(APPEND EXAMPLE_TARGETS example-${example})
|
||||||
|
@ -206,7 +206,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
sin.sin_family = AF_INET;
|
sin.sin_family = AF_INET;
|
||||||
sin.sin_port = htons(local_listenport);
|
sin.sin_port = htons((unsigned short)local_listenport);
|
||||||
sin.sin_addr.s_addr = inet_addr(local_listenip);
|
sin.sin_addr.s_addr = inet_addr(local_listenip);
|
||||||
if(INADDR_NONE == sin.sin_addr.s_addr) {
|
if(INADDR_NONE == sin.sin_addr.s_addr) {
|
||||||
perror("inet_addr");
|
perror("inet_addr");
|
||||||
|
@ -229,7 +229,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
sin.sin_family = AF_INET;
|
sin.sin_family = AF_INET;
|
||||||
sin.sin_port = htons(local_destport);
|
sin.sin_port = htons((unsigned short)local_destport);
|
||||||
sin.sin_addr.s_addr = inet_addr(local_destip);
|
sin.sin_addr.s_addr = inet_addr(local_destip);
|
||||||
if(INADDR_NONE == sin.sin_addr.s_addr) {
|
if(INADDR_NONE == sin.sin_addr.s_addr) {
|
||||||
perror("inet_addr");
|
perror("inet_addr");
|
||||||
|
@ -14,12 +14,12 @@ endif
|
|||||||
|
|
||||||
# Edit the path below to point to the base of your Zlib sources.
|
# Edit the path below to point to the base of your Zlib sources.
|
||||||
ifndef ZLIB_PATH
|
ifndef ZLIB_PATH
|
||||||
ZLIB_PATH = ../../zlib-1.2.8
|
ZLIB_PATH = ../../zlib
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Edit the path below to point to the base of your OpenSSL package.
|
# Edit the path below to point to the base of your OpenSSL package.
|
||||||
ifndef OPENSSL_PATH
|
ifndef OPENSSL_PATH
|
||||||
OPENSSL_PATH = ../../openssl-0.9.8zc
|
OPENSSL_PATH = ../../openssl
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Edit the path below to point to your Distribution folder.
|
# Edit the path below to point to your Distribution folder.
|
||||||
@ -436,7 +436,6 @@ endif
|
|||||||
@echo $(DL)#define HAVE_GETHOSTBYNAME 1$(DL) >> $@
|
@echo $(DL)#define HAVE_GETHOSTBYNAME 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_GETPROTOBYNAME 1$(DL) >> $@
|
@echo $(DL)#define HAVE_GETPROTOBYNAME 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_GMTIME_R 1$(DL) >> $@
|
@echo $(DL)#define HAVE_GMTIME_R 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_INET_ADDR 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_INET_NTOA 1$(DL) >> $@
|
@echo $(DL)#define HAVE_INET_NTOA 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_LL 1$(DL) >> $@
|
@echo $(DL)#define HAVE_LL 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_LOCALTIME_R 1$(DL) >> $@
|
@echo $(DL)#define HAVE_LOCALTIME_R 1$(DL) >> $@
|
||||||
@ -447,7 +446,6 @@ endif
|
|||||||
@echo $(DL)#define HAVE_SIGNAL 1$(DL) >> $@
|
@echo $(DL)#define HAVE_SIGNAL 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_SIGNAL_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_SIGNAL_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_SIG_ATOMIC_T 1$(DL) >> $@
|
@echo $(DL)#define HAVE_SIG_ATOMIC_T 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_SOCKET 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_STDLIB_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_STDLIB_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_STRDUP 1$(DL) >> $@
|
@echo $(DL)#define HAVE_STRDUP 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_STRFTIME 1$(DL) >> $@
|
@echo $(DL)#define HAVE_STRFTIME 1$(DL) >> $@
|
||||||
@ -627,5 +625,3 @@ endif
|
|||||||
@echo $(DL)$(MAKE) objclean$(DL)
|
@echo $(DL)$(MAKE) objclean$(DL)
|
||||||
@echo $(DL)$(MAKE) test$(DL)
|
@echo $(DL)$(MAKE) test$(DL)
|
||||||
@echo $(DL)===========================================================$(DL)
|
@echo $(DL)===========================================================$(DL)
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,12 +13,12 @@ endif
|
|||||||
|
|
||||||
# Edit the path below to point to the base of your Zlib sources.
|
# Edit the path below to point to the base of your Zlib sources.
|
||||||
ifndef ZLIB_PATH
|
ifndef ZLIB_PATH
|
||||||
ZLIB_PATH = ../../../zlib-1.2.8
|
ZLIB_PATH = ../../../zlib
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Edit the path below to point to the base of your OpenSSL package.
|
# Edit the path below to point to the base of your OpenSSL package.
|
||||||
ifndef OPENSSL_PATH
|
ifndef OPENSSL_PATH
|
||||||
OPENSSL_PATH = ../../../openssl-0.9.8zc
|
OPENSSL_PATH = ../../../openssl
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Edit the var below to enable static linking of libssh2 and libz
|
# Edit the var below to enable static linking of libssh2 and libz
|
||||||
@ -308,4 +308,3 @@ ifdef LDLIBS
|
|||||||
endif
|
endif
|
||||||
@echo $(DL)output $(notdir $(@:.def=.nlm))$(DL) >> $@
|
@echo $(DL)output $(notdir $(@:.def=.nlm))$(DL) >> $@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -113,12 +113,6 @@
|
|||||||
/* Define to 1 if you have the <netinet/in.h> header file. */
|
/* Define to 1 if you have the <netinet/in.h> header file. */
|
||||||
#define HAVE_NETINET_IN_H 1
|
#define HAVE_NETINET_IN_H 1
|
||||||
|
|
||||||
/* Define to 1 if you have the <ntdef.h> header file. */
|
|
||||||
#undef HAVE_NTDEF_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <ntstatus.h> header file. */
|
|
||||||
#undef HAVE_NTSTATUS_H
|
|
||||||
|
|
||||||
/* use O_NONBLOCK for non-blocking sockets */
|
/* use O_NONBLOCK for non-blocking sockets */
|
||||||
#define HAVE_O_NONBLOCK 1
|
#define HAVE_O_NONBLOCK 1
|
||||||
|
|
||||||
|
@ -40,7 +40,6 @@ include(CheckIncludeFiles)
|
|||||||
include(CheckTypeSize)
|
include(CheckTypeSize)
|
||||||
include(CheckSymbolExists)
|
include(CheckSymbolExists)
|
||||||
include(CheckNonblockingSocketSupport)
|
include(CheckNonblockingSocketSupport)
|
||||||
include(SocketLibraries)
|
|
||||||
|
|
||||||
## Cryptography backend choice
|
## Cryptography backend choice
|
||||||
|
|
||||||
@ -139,9 +138,6 @@ if(CRYPTO_BACKEND STREQUAL "WinCNG" OR NOT CRYPTO_BACKEND)
|
|||||||
list(APPEND LIBRARIES bcrypt)
|
list(APPEND LIBRARIES bcrypt)
|
||||||
list(APPEND PC_LIBS -lbcrypt)
|
list(APPEND PC_LIBS -lbcrypt)
|
||||||
|
|
||||||
check_include_files(ntdef.h HAVE_NTDEF_H)
|
|
||||||
check_include_files(ntstatus.h HAVE_NTSTATUS_H)
|
|
||||||
|
|
||||||
# Reading keys from files is optional and depends on Wincrypt
|
# Reading keys from files is optional and depends on Wincrypt
|
||||||
check_include_files("windows.h;wincrypt.h" HAVE_WINCRYPT_H)
|
check_include_files("windows.h;wincrypt.h" HAVE_WINCRYPT_H)
|
||||||
|
|
||||||
@ -342,7 +338,10 @@ else()
|
|||||||
check_function_exists(poll HAVE_POLL)
|
check_function_exists(poll HAVE_POLL)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
append_needed_socket_libraries(LIBRARIES)
|
if(WIN32)
|
||||||
|
set(HAVE_SELECT 1)
|
||||||
|
list(APPEND PC_LIBS -lws2_32)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Non-blocking socket support tests. Must be after library tests to
|
# Non-blocking socket support tests. Must be after library tests to
|
||||||
# link correctly
|
# link correctly
|
||||||
|
@ -279,7 +279,7 @@ agent_transact_pageant(LIBSSH2_AGENT *agent, agent_transaction_ctx_t transctx)
|
|||||||
HANDLE filemap;
|
HANDLE filemap;
|
||||||
unsigned char *p;
|
unsigned char *p;
|
||||||
unsigned char *p2;
|
unsigned char *p2;
|
||||||
int id;
|
LRESULT id;
|
||||||
COPYDATASTRUCT cds;
|
COPYDATASTRUCT cds;
|
||||||
|
|
||||||
if(!transctx || 4 + transctx->request_len > PAGEANT_MAX_MSGLEN)
|
if(!transctx || 4 + transctx->request_len > PAGEANT_MAX_MSGLEN)
|
||||||
@ -292,7 +292,7 @@ agent_transact_pageant(LIBSSH2_AGENT *agent, agent_transaction_ctx_t transctx)
|
|||||||
"found no pageant");
|
"found no pageant");
|
||||||
|
|
||||||
snprintf(mapname, sizeof(mapname),
|
snprintf(mapname, sizeof(mapname),
|
||||||
"PageantRequest%08x%c", (unsigned)GetCurrentThreadId(), '\0');
|
"PageantRequest%08x", (unsigned)GetCurrentThreadId());
|
||||||
filemap = CreateFileMappingA(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE,
|
filemap = CreateFileMappingA(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE,
|
||||||
0, PAGEANT_MAX_MSGLEN, mapname);
|
0, PAGEANT_MAX_MSGLEN, mapname);
|
||||||
|
|
||||||
|
@ -53,10 +53,12 @@
|
|||||||
|
|
||||||
#undef inline
|
#undef inline
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
|
#define inline __inline__
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
#define inline __inline
|
#define inline __inline
|
||||||
#else /* !__GNUC__ */
|
#else
|
||||||
#define inline
|
#define inline
|
||||||
#endif /* !__GNUC__ */
|
#endif
|
||||||
|
|
||||||
/* Function for Feistel Networks */
|
/* Function for Feistel Networks */
|
||||||
|
|
||||||
|
@ -47,8 +47,6 @@
|
|||||||
#cmakedefine HAVE_SYS_UN_H
|
#cmakedefine HAVE_SYS_UN_H
|
||||||
#cmakedefine HAVE_WS2TCPIP_H
|
#cmakedefine HAVE_WS2TCPIP_H
|
||||||
#cmakedefine HAVE_WINSOCK2_H
|
#cmakedefine HAVE_WINSOCK2_H
|
||||||
#cmakedefine HAVE_NTDEF_H
|
|
||||||
#cmakedefine HAVE_NTSTATUS_H
|
|
||||||
|
|
||||||
/* Libraries */
|
/* Libraries */
|
||||||
#cmakedefine HAVE_LIBCRYPT32
|
#cmakedefine HAVE_LIBCRYPT32
|
||||||
@ -58,10 +56,8 @@
|
|||||||
|
|
||||||
/* Functions */
|
/* Functions */
|
||||||
#cmakedefine HAVE_GETTIMEOFDAY
|
#cmakedefine HAVE_GETTIMEOFDAY
|
||||||
#cmakedefine HAVE_INET_ADDR
|
|
||||||
#cmakedefine HAVE_POLL
|
#cmakedefine HAVE_POLL
|
||||||
#cmakedefine HAVE_SELECT
|
#cmakedefine HAVE_SELECT
|
||||||
#cmakedefine HAVE_SOCKET
|
|
||||||
#cmakedefine HAVE_STRTOLL
|
#cmakedefine HAVE_STRTOLL
|
||||||
#cmakedefine HAVE_STRTOI64
|
#cmakedefine HAVE_STRTOI64
|
||||||
#cmakedefine HAVE_SNPRINTF
|
#cmakedefine HAVE_SNPRINTF
|
||||||
|
@ -121,8 +121,10 @@
|
|||||||
#define snprintf _libssh2_snprintf
|
#define snprintf _libssh2_snprintf
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
/* "inline" keyword is valid only with C++ engine! */
|
/* "inline" keyword is valid only with C++ engine! */
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#define inline __inline__
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
#define inline __inline
|
#define inline __inline
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -977,7 +979,7 @@ void _libssh2_debug(LIBSSH2_SESSION * session, int context, const char *format,
|
|||||||
...);
|
...);
|
||||||
#else
|
#else
|
||||||
#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \
|
#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \
|
||||||
defined(__GNUC__)
|
(defined(__GNUC__) && !defined(__clang__))
|
||||||
/* C99 supported and also by older GCC */
|
/* C99 supported and also by older GCC */
|
||||||
#define _libssh2_debug(x,y,...) do {} while (0)
|
#define _libssh2_debug(x,y,...) do {} while (0)
|
||||||
#else
|
#else
|
||||||
|
@ -37,7 +37,6 @@ include(CheckIncludeFiles)
|
|||||||
include(CheckFunctionExists)
|
include(CheckFunctionExists)
|
||||||
include(CheckSymbolExists)
|
include(CheckSymbolExists)
|
||||||
include(CopyRuntimeDependencies)
|
include(CopyRuntimeDependencies)
|
||||||
include(SocketLibraries)
|
|
||||||
|
|
||||||
## Platform checks
|
## Platform checks
|
||||||
check_include_files(inttypes.h HAVE_INTTYPES_H)
|
check_include_files(inttypes.h HAVE_INTTYPES_H)
|
||||||
@ -50,7 +49,6 @@ check_include_files(netinet/in.h HAVE_NETINET_IN_H)
|
|||||||
configure_file(
|
configure_file(
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/libssh2_config_cmake.h.in"
|
"${CMAKE_CURRENT_SOURCE_DIR}/libssh2_config_cmake.h.in"
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/libssh2_config.h")
|
"${CMAKE_CURRENT_BINARY_DIR}/libssh2_config.h")
|
||||||
append_needed_socket_libraries(LIBRARIES)
|
|
||||||
|
|
||||||
## Cryptography backend choice
|
## Cryptography backend choice
|
||||||
|
|
||||||
|
@ -47,6 +47,11 @@
|
|||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#include <direct.h>
|
||||||
|
#define getcwd _getcwd
|
||||||
|
#define chdir _chdir
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_WINSOCK2_H
|
#ifdef HAVE_WINSOCK2_H
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
|
@ -9,12 +9,12 @@
|
|||||||
|
|
||||||
# Edit the path below to point to the base of your Zlib sources.
|
# Edit the path below to point to the base of your Zlib sources.
|
||||||
ifndef ZLIB_PATH
|
ifndef ZLIB_PATH
|
||||||
ZLIB_PATH = ../../zlib-1.2.8
|
ZLIB_PATH = ../../zlib
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Edit the path below to point to the base of your OpenSSL package.
|
# Edit the path below to point to the base of your OpenSSL package.
|
||||||
ifndef OPENSSL_PATH
|
ifndef OPENSSL_PATH
|
||||||
OPENSSL_PATH = ../../openssl-1.0.2d
|
OPENSSL_PATH = ../../openssl
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Edit the path below to point to your Distribution folder.
|
# Edit the path below to point to your Distribution folder.
|
||||||
|
@ -64,13 +64,13 @@ CFLAGS += -d_WIN32_WINNT=0x0501 -dENABLE_IPV6
|
|||||||
!ifdef %zlib_root
|
!ifdef %zlib_root
|
||||||
ZLIB_ROOT = $(%zlib_root)
|
ZLIB_ROOT = $(%zlib_root)
|
||||||
!else
|
!else
|
||||||
ZLIB_ROOT = ..\..\zlib-1.2.8
|
ZLIB_ROOT = ..\..\zlib
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
!ifdef %openssl_root
|
!ifdef %openssl_root
|
||||||
OPENSSL_ROOT = $(%openssl_root)
|
OPENSSL_ROOT = $(%openssl_root)
|
||||||
!else
|
!else
|
||||||
OPENSSL_ROOT = ..\..\openssl-0.9.8zc
|
OPENSSL_ROOT = ..\..\openssl
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
!ifdef %use_zlib
|
!ifdef %use_zlib
|
||||||
@ -186,5 +186,3 @@ $(LINK_ARG): $(__MAKEFILES__)
|
|||||||
$(LIB_ARG): $(__MAKEFILES__)
|
$(LIB_ARG): $(__MAKEFILES__)
|
||||||
%create $^@
|
%create $^@
|
||||||
@for %f in ($(OBJS_STAT)) do @%append $^@ +- %f
|
@for %f in ($(OBJS_STAT)) do @%append $^@ +- %f
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
# Tweak these for your system
|
# Tweak these for your system
|
||||||
!if "$(OPENSSLINC)" == ""
|
!if "$(OPENSSLINC)" == ""
|
||||||
OPENSSLINC=..\openssl-0.9.8zc\inc32
|
OPENSSLINC=..\openssl\include
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
!if "$(OPENSSLLIB)" == ""
|
!if "$(OPENSSLLIB)" == ""
|
||||||
OPENSSLLIB=..\openssl-0.9.8zc\out32dll
|
OPENSSLLIB=..\openssl\lib
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
!if "$(ZLIBINC)" == ""
|
!if "$(ZLIBINC)" == ""
|
||||||
ZLIBINC=..\zlib-1.2.8
|
ZLIBINC=..\zlib
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
!if "$(ZLIBLIB)" == ""
|
!if "$(ZLIBLIB)" == ""
|
||||||
ZLIBLIB=..\zlib-1.2.8
|
ZLIBLIB=..\zlib
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
!if "$(TARGET)" == ""
|
!if "$(TARGET)" == ""
|
||||||
|
@ -9,12 +9,12 @@
|
|||||||
|
|
||||||
# Edit the path below to point to the base of your Zlib sources.
|
# Edit the path below to point to the base of your Zlib sources.
|
||||||
ifndef ZLIB_PATH
|
ifndef ZLIB_PATH
|
||||||
ZLIB_PATH = ../../../zlib-1.2.8
|
ZLIB_PATH = ../../../zlib
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Edit the path below to point to the base of your OpenSSL package.
|
# Edit the path below to point to the base of your OpenSSL package.
|
||||||
ifndef OPENSSL_PATH
|
ifndef OPENSSL_PATH
|
||||||
OPENSSL_PATH = ../../../openssl-0.9.8zc
|
OPENSSL_PATH = ../../../openssl
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Project root
|
# Project root
|
||||||
|
Reference in New Issue
Block a user