Skip to content
This repository was archived by the owner on Jan 26, 2026. It is now read-only.

Commit a2b338a

Browse files
committed
Merge commit 'e949e135b62a4a84677598d8e616b7ae0bd73bce'
2 parents aabdd57 + e949e13 commit a2b338a

16 files changed

Lines changed: 137 additions & 90 deletions

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.2.0)
22
cmake_policy(SET CMP0048 NEW)
33

4-
project(libssh VERSION 0.8.0 LANGUAGES C)
4+
project(libssh VERSION 0.8.1 LANGUAGES C)
55

66
# global needed variable
77
set(APPLICATION_NAME ${PROJECT_NAME})
@@ -13,7 +13,7 @@ set(APPLICATION_NAME ${PROJECT_NAME})
1313
# Increment AGE. Set REVISION to 0
1414
# If the source code was changed, but there were no interface changes:
1515
# Increment REVISION.
16-
set(LIBRARY_VERSION "4.5.0")
16+
set(LIBRARY_VERSION "4.5.1")
1717
set(LIBRARY_SOVERSION "4")
1818

1919
# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked

CPackConfig.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
1010

1111
# SOURCE GENERATOR
1212
set(CPACK_SOURCE_GENERATOR "TXZ")
13-
set(CPACK_SOURCE_IGNORE_FILES "~$;[.]swp$;/[.]git/;.gitignore;build;obj*;tags;cscope.*")
13+
set(CPACK_SOURCE_IGNORE_FILES "~$;[.]swp$;/[.]git/;.gitignore;/build*;/obj*;tags;cscope.*")
1414
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
1515

1616
### NSIS INSTALLER

ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
ChangeLog
22
==========
33

4+
version 0.8.1 (released 2018-08-13)
5+
* Fixed version number in the header
6+
* Fixed version number in pkg-config and cmake config
7+
* Fixed library initialization
8+
* Fixed attribute detection
9+
410
version 0.8.0 (released 2018-08-10)
511
* Removed support for deprecated SSHv1 protocol
612
* Added new connector API for clients

ConfigureChecks.cmake

Lines changed: 46 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ include(CheckTypeSize)
77
include(CheckCXXSourceCompiles)
88
include(TestBigEndian)
99

10-
set(PACKAGE ${APPLICATION_NAME})
11-
set(VERSION ${APPLICATION_VERSION})
10+
set(PACKAGE ${PROJECT_NAME})
11+
set(VERSION ${PROJECT_VERSION})
1212
set(DATADIR ${DATA_INSTALL_DIR})
1313
set(LIBDIR ${LIB_INSTALL_DIR})
1414
set(PLUGINDIR "${PLUGIN_INSTALL_DIR}-${LIBRARY_SOVERSION}")
@@ -267,25 +267,47 @@ int main(void) {
267267
return 0;
268268
}" HAVE_MSC_THREAD_LOCAL_STORAGE)
269269

270+
###########################################################
271+
# For detecting attributes we need to treat warnings as
272+
# errors
273+
if (UNIX)
274+
set(CMAKE_REQUIRED_FLAGS "-Werror")
275+
endif (UNIX)
276+
270277
check_c_source_compiles("
271-
#define FALL_THROUGH __attribute__((fallthrough))
278+
void test_constructor_attribute(void) __attribute__ ((constructor));
272279
273-
enum direction_e {
274-
UP = 0,
275-
DOWN,
276-
};
280+
void test_constructor_attribute(void)
281+
{
282+
return;
283+
}
277284
278285
int main(void) {
279-
enum direction_e key = UP;
280-
int i = 10;
281-
int j = 0;
286+
return 0;
287+
}" HAVE_CONSTRUCTOR_ATTRIBUTE)
282288

283-
switch (key) {
284-
case UP:
285-
i = 5;
289+
check_c_source_compiles("
290+
void test_destructor_attribute(void) __attribute__ ((destructor));
291+
292+
void test_destructor_attribute(void)
293+
{
294+
return;
295+
}
296+
297+
int main(void) {
298+
return 0;
299+
}" HAVE_DESTRUCTOR_ATTRIBUTE)
300+
301+
check_c_source_compiles("
302+
#define FALL_THROUGH __attribute__((fallthrough))
303+
304+
int main(void) {
305+
int i = 2;
306+
307+
switch (i) {
308+
case 0:
286309
FALL_THROUGH;
287-
case DOWN:
288-
j = i * 2;
310+
case 1:
289311
break;
290312
default:
291313
break;
@@ -332,11 +354,17 @@ int main(void) {
332354
return 0;
333355
}" HAVE_COMPILER__FUNCTION__)
334356

357+
# Stop treating warnings as errors
358+
unset(CMAKE_REQUIRED_FLAGS)
335359

336360
check_c_source_compiles("
337-
void chacha_keysetup(struct chacha_ctx *x, const u_char *k, u_int kbits)
338-
__attribute__((__bounded__(__minbytes__, 2, CHACHA_MINKEYLEN)));
339-
int main(void) { return 0; }" HAVE_GCC_BOUNDED_ATTRIBUTE)
361+
#define ARRAY_LEN 16
362+
void test_attr(const unsigned char *k)
363+
__attribute__((__bounded__(__minbytes__, 2, 16)));
364+
365+
int main(void) {
366+
return 0;
367+
}" HAVE_GCC_BOUNDED_ATTRIBUTE)
340368

341369
if (WITH_DEBUG_CRYPTO)
342370
set(DEBUG_CRYPTO 1)

DefineOptions.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,12 @@ if(WITH_BENCHMARKS)
2929
set(UNIT_TESTING ON)
3030
endif(WITH_BENCHMARKS)
3131

32+
if (WITH_STATIC_LIB)
33+
set(BUILD_STATIC_LIB ON)
34+
endif (WITH_STATIC_LIB)
35+
3236
if (UNIT_TESTING)
33-
set(WITH_STATIC_LIB ON)
37+
set(BUILD_STATIC_LIB ON)
3438
endif (UNIT_TESTING)
3539

3640
if (WITH_NACL)

cmake/Modules/FindNSIS.cmake

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,16 @@
2121
#
2222

2323
if (WIN32)
24-
set(_NSIS_ROOT_HINTS
25-
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\NSIS;Default]")
24+
set(_x86 "(x86)")
2625

2726
set(_NSIS_ROOT_PATHS
28-
$ENV{PROGRAMFILES}/NSIS)
27+
"$ENV{ProgramFiles}/NSIS"
28+
"$ENV{ProgramFiles${_x86}}/NSIS"
29+
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\NSIS;Default]")
2930

3031
find_path(NSIS_ROOT_PATH
3132
NAMES
3233
Include/Library.nsh
33-
HINTS
34-
${_NSIS_ROOT_HINTS}
3534
PATHS
3635
${_NSIS_ROOT_PATHS}
3736
)

config.h.cmake

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* Name of package */
2-
#cmakedefine PACKAGE "${APPLICATION_NAME}"
2+
#cmakedefine PACKAGE "${PROJECT_NAME}"
33

44
/* Version number of package */
5-
#cmakedefine VERSION "${APPLICATION_VERSION}"
5+
#cmakedefine VERSION "${PROJECT_VERSION}"
66

77
#cmakedefine LOCALEDIR "${LOCALE_INSTALL_DIR}"
88
#cmakedefine DATADIR "${DATADIR}"
@@ -193,6 +193,9 @@
193193

194194
#cmakedefine HAVE_FALLTHROUGH_ATTRIBUTE 1
195195

196+
#cmakedefine HAVE_CONSTRUCTOR_ATTRIBUTE 1
197+
#cmakedefine HAVE_DESTRUCTOR_ATTRIBUTE 1
198+
196199
#cmakedefine HAVE_GCC_VOLATILE_MEMORY_PROTECTION 1
197200
#cmakedefine HAVE_GCC_NARG_MACRO 1
198201

include/libssh/libssh.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@
7878

7979
/* libssh version */
8080
#define LIBSSH_VERSION_MAJOR 0
81-
#define LIBSSH_VERSION_MINOR 7
82-
#define LIBSSH_VERSION_MICRO 90
81+
#define LIBSSH_VERSION_MINOR 8
82+
#define LIBSSH_VERSION_MICRO 1
8383

8484
#define LIBSSH_VERSION_INT SSH_VERSION_INT(LIBSSH_VERSION_MAJOR, \
8585
LIBSSH_VERSION_MINOR, \

include/libssh/threads.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include <pthread.h>
3030
#define SSH_MUTEX pthread_mutex_t
3131

32-
#if defined _GNU_SOURCE
32+
#if defined(PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP)
3333
#define SSH_MUTEX_STATIC_INIT PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
3434
#else
3535
#define SSH_MUTEX_STATIC_INIT PTHREAD_MUTEX_INITIALIZER

libssh-config-version.cmake.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
set(PACKAGE_VERSION @APPLICATION_VERSION@)
1+
set(PACKAGE_VERSION @PROJECT_VERSION@)
22

33
# Check whether the requested PACKAGE_FIND_VERSION is compatible
44
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")

0 commit comments

Comments
 (0)