]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
mbedtls: restore previous configuration behavior 19495/head
authorTianling Shen <cnsztl@immortalwrt.org>
Tue, 22 Jul 2025 15:35:49 +0000 (23:35 +0800)
committerHauke Mehrtens <hauke@hauke-m.de>
Wed, 23 Jul 2025 22:30:05 +0000 (00:30 +0200)
Fallback to default mbedtls configurations in case of the package is
not configured. It is possible for some reasons it get built even if
it's unselected because of build system bugs or other build-only
dependencies. In this case current behavior will comment out all
necessary configurations and lead build errors.

Fixes: 5359639c2b74 ("mbedtls: Apply configuration in Configure instead of Prepare")
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/19495
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
package/libs/mbedtls/Makefile

index 655526eecbee2cd34b0a03a586c55743986e2b28..1533cff519e42947c3e55ff5745c69e3167b073f 100644 (file)
@@ -138,11 +138,13 @@ CMAKE_OPTIONS += \
        -DENABLE_PROGRAMS:Bool=ON
 
 define Build/Configure
-       $(call Build/Configure/Default,)
-       $(foreach opt,$(MBEDTLS_BUILD_OPTS),
-       $(PKG_BUILD_DIR)/scripts/config.py \
-               -f $(PKG_BUILD_DIR)/include/mbedtls/mbedtls_config.h \
-               $(if $($(opt)),set,unset) $(patsubst CONFIG_%,%,$(opt)))
+       $(call Build/Configure/Default)
+
+       $(if $(strip $(foreach opt,$(MBEDTLS_BUILD_OPTS),$($(opt)))),
+               $(foreach opt,$(MBEDTLS_BUILD_OPTS),
+                       $(PKG_BUILD_DIR)/scripts/config.py \
+                       -f $(PKG_BUILD_DIR)/include/mbedtls/mbedtls_config.h \
+                       $(if $($(opt)),set,unset) $(patsubst CONFIG_%,%,$(opt))),)
 endef
 
 define Build/InstallDev