xref: /OK3568_Linux_fs/buildroot/package/libssh2/libssh2.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1################################################################################
2#
3# libssh2
4#
5################################################################################
6
7LIBSSH2_VERSION = 1.10.0
8LIBSSH2_SITE = https://www.libssh2.org/download
9LIBSSH2_LICENSE = BSD
10LIBSSH2_LICENSE_FILES = COPYING
11LIBSSH2_CPE_ID_VENDOR = libssh2
12LIBSSH2_INSTALL_STAGING = YES
13LIBSSH2_CONF_OPTS = --disable-examples-build
14
15ifeq ($(BR2_PACKAGE_LIBSSH2_MBEDTLS),y)
16LIBSSH2_DEPENDENCIES += mbedtls
17LIBSSH2_CONF_OPTS += --with-libmbedcrypto-prefix=$(STAGING_DIR)/usr \
18	--with-crypto=mbedtls
19else ifeq ($(BR2_PACKAGE_LIBSSH2_LIBGCRYPT),y)
20LIBSSH2_DEPENDENCIES += libgcrypt
21LIBSSH2_CONF_OPTS += --with-libgcrypt-prefix=$(STAGING_DIR)/usr \
22	--with-crypto=libgcrypt
23# configure.ac forgets to link to dependent libraries of gcrypt breaking static
24# linking
25LIBSSH2_CONF_ENV += LIBS="`$(STAGING_DIR)/usr/bin/libgcrypt-config --libs`"
26else ifeq ($(BR2_PACKAGE_LIBSSH2_OPENSSL),y)
27LIBSSH2_DEPENDENCIES += host-pkgconf openssl
28LIBSSH2_CONF_OPTS += --with-libssl-prefix=$(STAGING_DIR)/usr \
29	--with-crypto=openssl
30# configure.ac forgets to link to dependent libraries of openssl breaking static
31# linking
32LIBSSH2_CONF_ENV += LIBS=`$(PKG_CONFIG_HOST_BINARY) --libs openssl`
33endif
34
35# Add zlib support if enabled
36ifeq ($(BR2_PACKAGE_ZLIB),y)
37LIBSSH2_DEPENDENCIES += zlib
38LIBSSH2_CONF_OPTS += --with-libz \
39	--with-libz-prefix=$(STAGING_DIR)/usr
40else
41LIBSSH2_CONF_OPTS += --without-libz
42endif
43
44HOST_LIBSSH2_DEPENDENCIES += host-openssl
45HOST_LIBSSH2_CONF_OPTS += --with-openssl \
46	--with-libssl-prefix=$(HOST_DIR) \
47	--without-libgcrypt
48
49$(eval $(autotools-package))
50$(eval $(host-autotools-package))
51