Jelajahi Sumber

package/mbedtls: use pre-configure, not post-patch, hooks to configure

Currently, we use post-patch hooks to apply our configuration settings.
This works, but this is semantically wrong; post-patch hooks are there
to amend the source code to actually fix it (i.e. because it can't be
done with a patch for example).

Configuring the package, on the other hand, belong to the configure
step, and if we need to tweak the source code for configuration
purposes, this should be done in pre-configure hooks.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Yann E. MORIN 2 tahun lalu
induk
melakukan
37e2694756
1 mengubah file dengan 3 tambahan dan 3 penghapusan
  1. 3 3
      package/mbedtls/mbedtls.mk

+ 3 - 3
package/mbedtls/mbedtls.mk

@@ -25,7 +25,7 @@ define MBEDTLS_ENABLE_THREADING
 	$(SED) "s://#define MBEDTLS_THREADING_PTHREAD:#define MBEDTLS_THREADING_PTHREAD:" \
 	$(SED) "s://#define MBEDTLS_THREADING_PTHREAD:#define MBEDTLS_THREADING_PTHREAD:" \
 		$(@D)/include/mbedtls/config.h
 		$(@D)/include/mbedtls/config.h
 endef
 endef
-MBEDTLS_POST_PATCH_HOOKS += MBEDTLS_ENABLE_THREADING
+MBEDTLS_PRE_CONFIGURE_HOOKS += MBEDTLS_ENABLE_THREADING
 ifeq ($(BR2_STATIC_LIBS),y)
 ifeq ($(BR2_STATIC_LIBS),y)
 MBEDTLS_CONF_OPTS += -DLINK_WITH_PTHREAD=ON
 MBEDTLS_CONF_OPTS += -DLINK_WITH_PTHREAD=ON
 endif
 endif
@@ -49,7 +49,7 @@ define MBEDTLS_ENABLE_ZLIB
 	$(SED) "s://#define MBEDTLS_ZLIB_SUPPORT:#define MBEDTLS_ZLIB_SUPPORT:" \
 	$(SED) "s://#define MBEDTLS_ZLIB_SUPPORT:#define MBEDTLS_ZLIB_SUPPORT:" \
 		$(@D)/include/mbedtls/config.h
 		$(@D)/include/mbedtls/config.h
 endef
 endef
-MBEDTLS_POST_PATCH_HOOKS += MBEDTLS_ENABLE_ZLIB
+MBEDTLS_PRE_CONFIGURE_HOOKS += MBEDTLS_ENABLE_ZLIB
 else
 else
 MBEDTLS_CONF_OPTS += -DENABLE_ZLIB_SUPPORT=OFF
 MBEDTLS_CONF_OPTS += -DENABLE_ZLIB_SUPPORT=OFF
 endif
 endif
@@ -77,7 +77,7 @@ define MBEDTLS_ENABLE_DTLS_SRTP
 	$(SED) "s://#define MBEDTLS_SSL_DTLS_SRTP:#define MBEDTLS_SSL_DTLS_SRTP:" \
 	$(SED) "s://#define MBEDTLS_SSL_DTLS_SRTP:#define MBEDTLS_SSL_DTLS_SRTP:" \
 		$(@D)/include/mbedtls/config.h
 		$(@D)/include/mbedtls/config.h
 endef
 endef
-MBEDTLS_POST_PATCH_HOOKS += MBEDTLS_ENABLE_DTLS_SRTP
+MBEDTLS_PRE_CONFIGURE_HOOKS += MBEDTLS_ENABLE_DTLS_SRTP
 endif
 endif
 
 
 $(eval $(cmake-package))
 $(eval $(cmake-package))