forked from flipperdevices/flipperzero-firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mbedtls.scons
58 lines (51 loc) · 1.66 KB
/
mbedtls.scons
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Import("env")
env.Append(
CPPPATH=[
# "#/lib/mbedtls",
"#/lib/mbedtls/include",
],
SDK_HEADERS=[
File("mbedtls/include/mbedtls/des.h"),
File("mbedtls/include/mbedtls/sha1.h"),
File("mbedtls/include/mbedtls/sha256.h"),
File("mbedtls/include/mbedtls/md5.h"),
File("mbedtls/include/mbedtls/md.h"),
File("mbedtls/include/mbedtls/ecdsa.h"),
File("mbedtls/include/mbedtls/ecdh.h"),
File("mbedtls/include/mbedtls/ecp.h"),
# File("mbedtls/include/mbedtls/sha1.h"),
],
CPPDEFINES=[("MBEDTLS_CONFIG_FILE", '\\"mbedtls_cfg.h\\"')],
)
libenv = env.Clone(FW_LIB_NAME="mbedtls")
libenv.ApplyLibFlags()
libenv.AppendUnique(
CCFLAGS=[
# Required for lib to be linkable with .faps
"-mword-relocations",
"-mlong-calls",
# Crappy code :)
"-Wno-redundant-decls",
],
)
# If we were to build full mbedtls, we would need to use this:
# sources = libenv.GlobRecursive("*.c*", "mbedtls/library")
# Otherwise, we can just use the files we need:
sources = [
File("mbedtls/library/bignum.c"),
File("mbedtls/library/bignum_core.c"),
File("mbedtls/library/ecdsa.c"),
File("mbedtls/library/ecp.c"),
File("mbedtls/library/ecp_curves.c"),
File("mbedtls/library/md.c"),
File("mbedtls/library/md5.c"),
File("mbedtls/library/platform_util.c"),
File("mbedtls/library/ripemd160.c"),
File("mbedtls/library/sha1.c"),
File("mbedtls/library/sha256.c"),
File("mbedtls/library/des.c"),
]
Depends(sources, File("mbedtls_cfg.h"))
lib = libenv.StaticLibrary("${FW_LIB_NAME}", sources)
libenv.Install("${LIB_DIST_DIR}", lib)
Return("lib")