netsnmp: handle libnl dependency properly
[buildroot-gz.git] / package / mbedtls / mbedtls.mk
bloba8bd61f129a8730ae7b5e834f8217267db7a4568
1 ################################################################################
3 # mbedtls
5 ################################################################################
7 MBEDTLS_SITE = https://tls.mbed.org/code/releases
8 MBEDTLS_VERSION = 2.4.0
9 MBEDTLS_SOURCE = mbedtls-$(MBEDTLS_VERSION)-apache.tgz
10 MBEDTLS_CONF_OPTS = \
11 -DENABLE_PROGRAMS=$(if $(BR2_PACKAGE_MBEDTLS_PROGRAMS),ON,OFF) \
12 -DENABLE_TESTING=OFF
13 MBEDTLS_INSTALL_STAGING = YES
14 MBEDTLS_LICENSE = Apache-2.0
15 MBEDTLS_LICENSE_FILES = apache-2.0.txt
17 # This is mandatory for hiawatha
18 ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
19 define MBEDTLS_ENABLE_THREADING
20 $(SED) "s://#define MBEDTLS_THREADING_C:#define MBEDTLS_THREADING_C:" \
21 $(@D)/include/mbedtls/config.h
22 $(SED) "s://#define MBEDTLS_THREADING_PTHREAD:#define MBEDTLS_THREADING_PTHREAD:" \
23 $(@D)/include/mbedtls/config.h
24 endef
25 MBEDTLS_POST_PATCH_HOOKS += MBEDTLS_ENABLE_THREADING
26 ifeq ($(BR2_STATIC_LIBS),y)
27 MBEDTLS_CONF_OPTS += -DLINK_WITH_PTHREAD=ON
28 endif
29 endif
31 ifeq ($(BR2_STATIC_LIBS),y)
32 MBEDTLS_CONF_OPTS += \
33 -DUSE_SHARED_MBEDTLS_LIBRARY=OFF -DUSE_STATIC_MBEDTLS_LIBRARY=ON
34 else ifeq ($(BR2_SHARED_STATIC_LIBS),y)
35 MBEDTLS_CONF_OPTS += \
36 -DUSE_SHARED_MBEDTLS_LIBRARY=ON -DUSE_STATIC_MBEDTLS_LIBRARY=ON
37 else ifeq ($(BR2_SHARED_LIBS),y)
38 MBEDTLS_CONF_OPTS += \
39 -DUSE_SHARED_MBEDTLS_LIBRARY=ON -DUSE_STATIC_MBEDTLS_LIBRARY=OFF
40 endif
42 ifeq ($(BR2_PACKAGE_ZLIB),y)
43 MBEDTLS_CONF_OPTS += -DENABLE_ZLIB_SUPPORT=ON
44 MBEDTLS_DEPENDENCIES += zlib
45 else
46 MBEDTLS_CONF_OPTS += -DENABLE_ZLIB_SUPPORT=OFF
47 endif
49 define MBEDTLS_DISABLE_ASM
50 $(SED) '/^#define MBEDTLS_AESNI_C/d' \
51 $(@D)/include/mbedtls/config.h
52 $(SED) '/^#define MBEDTLS_HAVE_ASM/d' \
53 $(@D)/include/mbedtls/config.h
54 $(SED) '/^#define MBEDTLS_PADLOCK_C/d' \
55 $(@D)/include/mbedtls/config.h
56 endef
58 # ARM in thumb mode breaks debugging with asm optimizations
59 # Microblaze asm optimizations are broken in general
60 # MIPS R6 asm is not yet supported
61 ifeq ($(BR2_ENABLE_DEBUG)$(BR2_ARM_INSTRUCTIONS_THUMB)$(BR2_ARM_INSTRUCTIONS_THUMB2),yy)
62 MBEDTLS_POST_CONFIGURE_HOOKS += MBEDTLS_DISABLE_ASM
63 else ifeq ($(BR2_microblaze)$(BR2_MIPS_CPU_MIPS32R6)$(BR2_MIPS_CPU_MIPS64R6),y)
64 MBEDTLS_POST_CONFIGURE_HOOKS += MBEDTLS_DISABLE_ASM
65 endif
67 $(eval $(cmake-package))