1 ################################################################################
5 ################################################################################
7 MBEDTLS_SITE
= https
://tls.mbed.org
/code
/releases
8 MBEDTLS_VERSION
= 2.4.0
9 MBEDTLS_SOURCE
= mbedtls-
$(MBEDTLS_VERSION
)-apache.tgz
11 -DENABLE_PROGRAMS
=$(if
$(BR2_PACKAGE_MBEDTLS_PROGRAMS
),ON
,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
25 MBEDTLS_POST_PATCH_HOOKS
+= MBEDTLS_ENABLE_THREADING
26 ifeq ($(BR2_STATIC_LIBS
),y
)
27 MBEDTLS_CONF_OPTS
+= -DLINK_WITH_PTHREAD
=ON
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
42 ifeq ($(BR2_PACKAGE_ZLIB
),y
)
43 MBEDTLS_CONF_OPTS
+= -DENABLE_ZLIB_SUPPORT
=ON
44 MBEDTLS_DEPENDENCIES
+= zlib
45 define MBEDTLS_ENABLE_ZLIB
46 $(SED
) "s://#define MBEDTLS_ZLIB_SUPPORT:#define MBEDTLS_ZLIB_SUPPORT:" \
47 $(@D
)/include/mbedtls
/config.h
49 MBEDTLS_POST_PATCH_HOOKS
+= MBEDTLS_ENABLE_ZLIB
51 MBEDTLS_CONF_OPTS
+= -DENABLE_ZLIB_SUPPORT
=OFF
54 define MBEDTLS_DISABLE_ASM
55 $(SED
) '/^#define MBEDTLS_AESNI_C/d' \
56 $(@D
)/include/mbedtls
/config.h
57 $(SED
) '/^#define MBEDTLS_HAVE_ASM/d' \
58 $(@D
)/include/mbedtls
/config.h
59 $(SED
) '/^#define MBEDTLS_PADLOCK_C/d' \
60 $(@D
)/include/mbedtls
/config.h
63 # ARM in thumb mode breaks debugging with asm optimizations
64 # Microblaze asm optimizations are broken in general
65 # MIPS R6 asm is not yet supported
66 ifeq ($(BR2_ENABLE_DEBUG
)$(BR2_ARM_INSTRUCTIONS_THUMB
)$(BR2_ARM_INSTRUCTIONS_THUMB2
),yy
)
67 MBEDTLS_POST_CONFIGURE_HOOKS
+= MBEDTLS_DISABLE_ASM
68 else ifeq ($(BR2_microblaze
)$(BR2_MIPS_CPU_MIPS32R6
)$(BR2_MIPS_CPU_MIPS64R6
),y
)
69 MBEDTLS_POST_CONFIGURE_HOOKS
+= MBEDTLS_DISABLE_ASM
72 $(eval
$(cmake-package
))