From patchwork Tue Jul 28 09:53:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamel BOUHARA X-Patchwork-Id: 1337723 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=bootlin.com Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BGBpJ53Cqz9sSd for ; Tue, 28 Jul 2020 19:53:58 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 00304883E6; Tue, 28 Jul 2020 09:53:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id A04sJMydLEiV; Tue, 28 Jul 2020 09:53:55 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 0A1CC883A3; Tue, 28 Jul 2020 09:53:55 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id CEB091BF477 for ; Tue, 28 Jul 2020 09:53:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id C5DCE87F7C for ; Tue, 28 Jul 2020 09:53:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Oz8cqDt8uiNA for ; Tue, 28 Jul 2020 09:53:52 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by whitealder.osuosl.org (Postfix) with ESMTPS id C7FA887F74 for ; Tue, 28 Jul 2020 09:53:51 +0000 (UTC) X-Originating-IP: 86.202.118.225 Received: from localhost (lfbn-lyo-1-23-225.w86-202.abo.wanadoo.fr [86.202.118.225]) (Authenticated sender: kamel.bouhara@bootlin.com) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 6DF521BF21A; Tue, 28 Jul 2020 09:53:48 +0000 (UTC) From: Kamel Bouhara To: buildroot@buildroot.org Date: Tue, 28 Jul 2020 11:53:46 +0200 Message-Id: <20200728095346.2103418-1-kamel.bouhara@bootlin.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v3] package/cryptopp: add a target build configuration X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kamel Bouhara , Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Currently only a host build is supported for cryptopp, this add a new configuration and build support for the make target. Signed-off-by: Kamel Bouhara --- Changes in v3: - Added explicit configuration with LDCONF=/bin/true to make sure symlink will exist on both target and host. - Improved patch commit description Changes in v2: - Fixed indentations issue - Removed unrequired Config.in.host - Added a depends on !BR2_STATIC_LIBS to build only in dynamic configuration. - Fixed inconsistency between TARGET_INSTALL and STAGING_INSTALL --- package/Config.in | 1 + ...ied-SONAME-to-shared-object-for-Linu.patch | 30 +++++++++++++++++++ package/cryptopp/Config.in | 8 +++++ package/cryptopp/cryptopp.mk | 26 +++++++++++++++- 4 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 package/cryptopp/0001-Add-fully-qualified-SONAME-to-shared-object-for-Linu.patch create mode 100644 package/cryptopp/Config.in -- 2.27.0 diff --git a/package/Config.in b/package/Config.in index 9c4843be07..014f57a54a 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1279,6 +1279,7 @@ menu "Crypto" source "package/botan/Config.in" source "package/ca-certificates/Config.in" source "package/cryptodev/Config.in" + source "package/cryptopp/Config.in" source "package/gcr/Config.in" source "package/gnutls/Config.in" source "package/libargon2/Config.in" diff --git a/package/cryptopp/0001-Add-fully-qualified-SONAME-to-shared-object-for-Linu.patch b/package/cryptopp/0001-Add-fully-qualified-SONAME-to-shared-object-for-Linu.patch new file mode 100644 index 0000000000..11f3090767 --- /dev/null +++ b/package/cryptopp/0001-Add-fully-qualified-SONAME-to-shared-object-for-Linu.patch @@ -0,0 +1,30 @@ +From 78eb43f50978ffd780cf31b1cea6736dadc6b155 Mon Sep 17 00:00:00 2001 +From: Kamel Bouhara +Date: Mon, 6 Jul 2020 17:10:55 +0200 +Subject: [PATCH] Add fully-qualified SONAME to shared object for Linux + +From: http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html + +Add SONAME libcryptopp.so.8 required for library runtime and application +linking. + +Signed-off-by: Kamel Bouhara +--- + GNUmakefile | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/GNUmakefile b/GNUmakefile +index e7b7b3a6..730e2a6f 100755 +--- a/GNUmakefile ++++ b/GNUmakefile +@@ -1256,6 +1256,7 @@ ifneq ($(wildcard libcryptopp.so$(SOLIB_VERSION_SUFFIX)),) + $(CHMOD) 0755 $(DESTDIR)$(LIBDIR)/libcryptopp.so$(SOLIB_VERSION_SUFFIX) + ifeq ($(HAS_SOLIB_VERSION),1) + -$(LN) libcryptopp.so$(SOLIB_VERSION_SUFFIX) $(DESTDIR)$(LIBDIR)/libcryptopp.so ++ -$(LN) libcryptopp.so$(SOLIB_VERSION_SUFFIX) $(DESTDIR)$(LIBDIR)/libcryptopp.so$(SOLIB_COMPAT_SUFFIX) + $(LDCONF) $(DESTDIR)$(LIBDIR) + endif + endif +-- +2.26.2 + diff --git a/package/cryptopp/Config.in b/package/cryptopp/Config.in new file mode 100644 index 0000000000..4ead5339ab --- /dev/null +++ b/package/cryptopp/Config.in @@ -0,0 +1,8 @@ +config BR2_PACKAGE_CRYPTOPP + bool "cryptopp" + depends on !BR2_STATIC_LIBS + help + A free C++ class library of cryptographic schemes + +comment "cryptopp needs a toolchain w/ dynamic library" + depends on BR2_STATIC_LIBS diff --git a/package/cryptopp/cryptopp.mk b/package/cryptopp/cryptopp.mk index f1d19386ab..e77287467d 100644 --- a/package/cryptopp/cryptopp.mk +++ b/package/cryptopp/cryptopp.mk @@ -31,7 +31,31 @@ define HOST_CRYPTOPP_BUILD_CMDS endef define HOST_CRYPTOPP_INSTALL_CMDS - $(HOST_MAKE_ENV) $(MAKE) -C $(@D) PREFIX=$(HOST_DIR) install-lib + $(HOST_MAKE_ENV) $(MAKE) -C $(@D) PREFIX="$(HOST_DIR)" LDCONFIG=/bin/true install-lib endef +define CRYPTOPP_EXTRACT_CMDS + $(UNZIP) $(CRYPTOPP_DL_DIR)/$(CRYPTOPP_SOURCE) -d $(@D) +endef + +CRYPTOPP_CXXFLAGS = $(TARGET_CFLAGS) -fPIC + +CRYPTOPP_MAKE_OPTS = \ + $(TARGET_CONFIGURE_OPTS) \ + CXXFLAGS="$(CRYPTOPP_CXXFLAGS)" + +define CRYPTOPP_BUILD_CMDS + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(CRYPTOPP_MAKE_OPTS) shared +endef + +define CRYPTOPP_INSTALL_TARGET_CMDS + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) PREFIX="$(TARGET_DIR)" LDCONFIG=/bin/true install-lib +endef + +define CRYPTOPP_INSTALL_STAGING_CMDS + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) PREFIX="$(STAGING_DIR)" libcryptopp.pc + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) PREFIX="$(STAGING_DIR)" LDCONFIG=/bin/true install-lib +endef + +$(eval $(generic-package)) $(eval $(host-generic-package))