From patchwork Thu Oct 26 21:43:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Voss X-Patchwork-Id: 830950 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yNL9p5lWmz9t2Q for ; Fri, 27 Oct 2017 08:43:58 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id E8F24876DD; Thu, 26 Oct 2017 21:43:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0kTEIPIL1hSI; Thu, 26 Oct 2017 21:43:55 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 435EA873EB; Thu, 26 Oct 2017 21:43:55 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 3517A1BF238 for ; Thu, 26 Oct 2017 21:43:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 2F83E873EB for ; Thu, 26 Oct 2017 21:43:52 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DKShOeDdr03Q for ; Thu, 26 Oct 2017 21:43:48 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from da1vs03.rockwellcollins.com (da1vs03.rockwellcollins.com [205.175.227.47]) by fraxinus.osuosl.org (Postfix) with ESMTPS id C77568735C for ; Thu, 26 Oct 2017 21:43:47 +0000 (UTC) Received: from ofwda1n02.rockwellcollins.com (HELO crulimr01.rockwellcollins.com) ([205.175.227.14]) by da1vs03.rockwellcollins.com with ESMTP; 26 Oct 2017 16:43:47 -0500 X-Received: from largo.rockwellcollins.com (unknown [192.168.140.76]) by crulimr01.rockwellcollins.com (Postfix) with ESMTP id F40F66027B; Thu, 26 Oct 2017 16:43:46 -0500 (CDT) From: Sam Voss To: buildroot@buildroot.org Date: Thu, 26 Oct 2017 16:43:44 -0500 Message-Id: <1509054225-19795-1-git-send-email-sam.voss@rockwellcollins.com> X-Mailer: git-send-email 1.9.1 Cc: Sam Voss Subject: [Buildroot] [PATCH v2 1/2] package/libssh2: Add selectable crypto libraries X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Add functionality to allow crypto libraries for libssh2 to be selectable by a choice instead of a fallback that may not work in all cases. Previous fallback is maintained from within the "defaults" of the choice menu, but can be overridden by making a choice. This fixes issues where two crypto libraries are present on the system, but the fallback order picks the wrong one. Signed-off-by: Sam Voss --- package/libssh2/Config.in | 34 ++++++++++++++++++++++++++++++++++ package/libssh2/libssh2.mk | 8 ++++---- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/package/libssh2/Config.in b/package/libssh2/Config.in index 9b60823..61be054 100644 --- a/package/libssh2/Config.in +++ b/package/libssh2/Config.in @@ -8,3 +8,37 @@ config BR2_PACKAGE_LIBSSH2 SECSH-FILEXFER(06)*, SECSH-DHGEX(04), and SECSH-NUMBERS(10) http://www.libssh2.org/ + +if BR2_PACKAGE_LIBSSH2 + +choice + prompt "Crypto Library" + default BR2_PACKAGE_LIBSSH2_MBEDTLS if BR2_PACKAGE_MBEDTLS + default BR2_PACKAGE_LIBSSH2_LIBGCRYPT if BR2_PACKAGE_LIBGCRYPT + default BR2_PACKAGE_OPENSSL + help + Select crypto library to be used in libssh2. + +config BR2_PACKAGE_LIBSSH2_MBEDTLS + depends on BR2_PACKAGE_MBEDTLS + bool "mbedtls" + +comment "mbedtls not selected" + depends on !BR2_PACKAGE_MBEDTLS + +config BR2_PACKAGE_LIBSSH2_LIBGCRYPT + depends on BR2_PACKAGE_LIBGCRYPT + bool "gcrypt" + +comment "libgcrypt not selected" + depends on !BR2_PACKAGE_LIBGCRYPT + +config BR2_PACKAGE_LIBSSH2_OPENSSL + depends on BR2_PACKAGE_OPENSSL + bool "openssl" + +comment "openssl not selected" + depends on !BR2_PACKAGE_OPENSSL + +endchoice +endif diff --git a/package/libssh2/libssh2.mk b/package/libssh2/libssh2.mk index dedb890..3978698 100644 --- a/package/libssh2/libssh2.mk +++ b/package/libssh2/libssh2.mk @@ -12,20 +12,20 @@ LIBSSH2_INSTALL_STAGING = YES LIBSSH2_CONF_OPTS = --disable-examples-build # Dependency is one of mbedtls, libgcrypt or openssl, guaranteed in -# Config.in. Favour mbedtls. -ifeq ($(BR2_PACKAGE_MBEDTLS),y) +# Config.in. +ifeq ($(BR2_PACKAGE_LIBSSH2_MBEDTLS),y) LIBSSH2_DEPENDENCIES += mbedtls LIBSSH2_CONF_OPTS += --with-mbedtls=$(STAGING_DIR)/usr \ --without-openssl --without-libgcrypt LIBSSH2_CONF_ENV += ac_cv_libgcrypt=no -else ifeq ($(BR2_PACKAGE_LIBGCRYPT),y) +else ifeq ($(BR2_PACKAGE_LIBSSH2_LIBGCRYPT),y) LIBSSH2_DEPENDENCIES += libgcrypt LIBSSH2_CONF_OPTS += --with-libgcrypt=$(STAGING_DIR)/usr \ --without-openssl --without-mbedtls # configure.ac forgets to link to dependent libraries of gcrypt breaking static # linking LIBSSH2_CONF_ENV += LIBS="`$(STAGING_DIR)/usr/bin/libgcrypt-config --libs`" -else +else ifeq ($(BR2_PACKAGE_LIBSSH2_OPENSSL),y) LIBSSH2_DEPENDENCIES += openssl LIBSSH2_CONF_OPTS += --with-openssl \ --with-libssl-prefix=$(STAGING_DIR)/usr \