libssh2: Make crypto backends selectable
authorSebastian Kemper <redacted>
Sat, 3 Feb 2018 12:26:16 +0000 (13:26 +0100)
committerSebastian Kemper <redacted>
Sat, 3 Feb 2018 12:26:18 +0000 (13:26 +0100)
This adds a choice to menuselect so people can select if they would like
to compile libssh2 against mbedtls (default) or openssl.

Signed-off-by: Sebastian Kemper <redacted>
libs/libssh2/Config.in [new file with mode: 0644]
libs/libssh2/Makefile

diff --git a/libs/libssh2/Config.in b/libs/libssh2/Config.in
new file mode 100644 (file)
index 0000000..708c07b
--- /dev/null
@@ -0,0 +1,15 @@
+if PACKAGE_libssh2
+
+choice
+       prompt "Choose crypto backend"
+       default LIBSSH2_MBEDTLS
+
+       config LIBSSH2_MBEDTLS
+       bool "mbedtls"
+
+       config LIBSSH2_OPENSSL
+       bool "openssl"
+
+endchoice
+
+endif
index e996dfadff42461ec539cb6f1a2ec03857a8310e..cdb133cb5f17d4bc6876e7ee4a3c3b18c0cca2d5 100644 (file)
@@ -29,7 +29,7 @@ define Package/libssh2
   CATEGORY:=Libraries
   TITLE:=SSH2 library
   URL:=https://www.libssh2.org/
-  DEPENDS:=+libmbedtls +zlib
+  DEPENDS:=+LIBSSH2_MBEDTLS:libmbedtls +LIBSSH2_OPENSSL:libopenssl +zlib
   MAINTAINER:=Jiri Slachta <jiri@slachta.eu>
 endef
 
@@ -37,13 +37,17 @@ define Package/libssh2/description
  libssh2 is a client-side C library implementing the SSH2 protocol.
 endef
 
+define Package/libssh2/config
+       source "$(SOURCE)/Config.in"
+endef
+
 TARGET_CFLAGS += $(FPIC)
 
 CONFIGURE_ARGS += \
        --disable-examples-build \
        --disable-silent-rules \
-       --with-mbedtls \
-       --with-libmbedtls-prefix=$(STAGING_DIR)/usr \
+       $(if $(CONFIG_LIBSSH2_MBEDTLS),--with-mbedtls --with-libmbedtls-prefix=$(STAGING_DIR)/usr) \
+       $(if $(CONFIG_LIBSSH2_OPENSSL),--with-openssl --with-libssl-prefix=$(STAGING_DIR)/usr) \
        --with-libz-prefix=$(STAGING_DIR)/usr
 
 define Build/InstallDev
git clone https://git.99rst.org/PROJECT