All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/mbedtls: custom configuration file
@ 2020-09-28  9:29 Pieter De Gendt
  2020-09-30 19:57 ` Thomas Petazzoni
  0 siblings, 1 reply; 6+ messages in thread
From: Pieter De Gendt @ 2020-09-28  9:29 UTC (permalink / raw)
  To: buildroot

mbedlts is customizable with a single configuration header file.
Instead of altering the existing config.h file based on the selection
of packages, we can simply replace it.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
---
 package/mbedtls/Config.in  | 12 ++++++++++++
 package/mbedtls/mbedtls.mk |  8 ++++++++
 2 files changed, 20 insertions(+)

diff --git a/package/mbedtls/Config.in b/package/mbedtls/Config.in
index a39ba65d98..b5000f422d 100644
--- a/package/mbedtls/Config.in
+++ b/package/mbedtls/Config.in
@@ -29,4 +29,16 @@ config BR2_PACKAGE_MBEDTLS_COMPRESSION
 	  sure CRIME and similar attacks are not applicable to your
 	  particular situation.
 
+config BR2_PACKAGE_MBEDTLS_CUSTOM_CONFIG
+	string "mbedtls custom configuration"
+	help
+	  Mbed TLS should build out-of-the box on a large variety of
+	  platforms. However, you may need to adjust a few platform-
+	  specific settings or want to customize the set of features
+	  that will be built. You can do all of this in a single
+	  configuration file.
+
+	  Provide the location of the custom configuration file or
+	  leave this empty to keep the default.
+
 endif
diff --git a/package/mbedtls/mbedtls.mk b/package/mbedtls/mbedtls.mk
index 5094434e6c..fa74197004 100644
--- a/package/mbedtls/mbedtls.mk
+++ b/package/mbedtls/mbedtls.mk
@@ -68,4 +68,12 @@ else ifeq ($(BR2_microblaze)$(BR2_MIPS_CPU_MIPS32R6)$(BR2_MIPS_CPU_MIPS64R6),y)
 MBEDTLS_POST_CONFIGURE_HOOKS += MBEDTLS_DISABLE_ASM
 endif
 
+define MBEDTLS_OVERRIDE_CONFIG
+	cp $(BR2_PACKAGE_MBEDTLS_CUSTOM_CONFIG) $(@D)/include/mbedtls/config.h
+endef
+
+ifneq ($(call qstrip,$(BR2_PACKAGE_MBEDTLS_CUSTOM_CONFIG)),)
+MBEDTLS_POST_CONFIGURE_HOOKS += MBEDTLS_OVERRIDE_CONFIG
+endif
+
 $(eval $(cmake-package))
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-10-04 19:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-28  9:29 [Buildroot] [PATCH 1/1] package/mbedtls: custom configuration file Pieter De Gendt
2020-09-30 19:57 ` Thomas Petazzoni
2020-10-01  7:29   ` Pieter De Gendt
2020-10-01 19:31     ` Yann E. MORIN
2020-10-02  7:16       ` Pieter De Gendt
2020-10-04 19:43         ` Yann E. MORIN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.