component.mk 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. COMPONENT_SUBMODULES += libsodium
  2. # Common root directory for all source directories
  3. LSRC := libsodium/src/libsodium
  4. COMPONENT_SRCDIRS := port
  5. # Derived from libsodium/src/libsodium/Makefile.am
  6. # (ignoring the !MINIMAL set)
  7. COMPONENT_SRCDIRS += \
  8. $(LSRC)/crypto_aead/chacha20poly1305/sodium \
  9. $(LSRC)/crypto_aead/xchacha20poly1305/sodium \
  10. $(LSRC)/crypto_auth \
  11. $(LSRC)/crypto_auth/hmacsha256 \
  12. $(LSRC)/crypto_auth/hmacsha512 \
  13. $(LSRC)/crypto_auth/hmacsha512256 \
  14. $(LSRC)/crypto_box \
  15. $(LSRC)/crypto_box/curve25519xsalsa20poly1305 \
  16. $(LSRC)/crypto_core/curve25519/ref10 \
  17. $(LSRC)/crypto_core/hchacha20 \
  18. $(LSRC)/crypto_core/hsalsa20/ref2 \
  19. $(LSRC)/crypto_core/hsalsa20 \
  20. $(LSRC)/crypto_core/salsa/ref \
  21. $(LSRC)/crypto_generichash \
  22. $(LSRC)/crypto_generichash/blake2b \
  23. $(LSRC)/crypto_generichash/blake2b/ref \
  24. $(LSRC)/crypto_hash \
  25. $(LSRC)/crypto_hash/sha256 \
  26. $(LSRC)/crypto_hash/sha512 \
  27. $(LSRC)/crypto_kdf/blake2b \
  28. $(LSRC)/crypto_kdf \
  29. $(LSRC)/crypto_kx \
  30. $(LSRC)/crypto_onetimeauth \
  31. $(LSRC)/crypto_onetimeauth/poly1305 \
  32. $(LSRC)/crypto_onetimeauth/poly1305/donna \
  33. $(LSRC)/crypto_pwhash/argon2 \
  34. $(LSRC)/crypto_pwhash \
  35. $(LSRC)/crypto_pwhash/scryptsalsa208sha256 \
  36. $(LSRC)/crypto_pwhash/scryptsalsa208sha256/nosse \
  37. $(LSRC)/crypto_scalarmult \
  38. $(LSRC)/crypto_scalarmult/curve25519 \
  39. $(LSRC)/crypto_scalarmult/curve25519/ref10 \
  40. $(LSRC)/crypto_secretbox \
  41. $(LSRC)/crypto_secretbox/xsalsa20poly1305 \
  42. $(LSRC)/crypto_shorthash \
  43. $(LSRC)/crypto_shorthash/siphash24 \
  44. $(LSRC)/crypto_shorthash/siphash24/ref \
  45. $(LSRC)/crypto_sign \
  46. $(LSRC)/crypto_sign/ed25519 \
  47. $(LSRC)/crypto_sign/ed25519/ref10 \
  48. $(LSRC)/crypto_stream/chacha20 \
  49. $(LSRC)/crypto_stream/chacha20/ref \
  50. $(LSRC)/crypto_stream \
  51. $(LSRC)/crypto_stream/salsa20 \
  52. $(LSRC)/crypto_stream/salsa20/ref \
  53. $(LSRC)/crypto_stream/xsalsa20 \
  54. $(LSRC)/crypto_verify/sodium \
  55. $(LSRC)/randombytes \
  56. $(LSRC)/sodium
  57. ifdef CONFIG_LIBSODIUM_USE_MBEDTLS_SHA
  58. COMPONENT_SRCDIRS += port/crypto_hash_mbedtls
  59. else
  60. COMPONENT_SRCDIRS += \
  61. $(LSRC)/crypto_hash/sha256/cp \
  62. $(LSRC)/crypto_hash/sha512/cp
  63. endif
  64. # Fix some warnings in current libsodium source files
  65. # (not applied to whole component as we compile some of our own files, also.)
  66. $(LSRC)/crypto_pwhash/argon2/argon2-fill-block-ref.o: CFLAGS += -Wno-unknown-pragmas
  67. $(LSRC)/crypto_pwhash/argon2/pwhash_argon2i.o: CFLAGS += -Wno-type-limits
  68. $(LSRC)/crypto_pwhash/argon2/argon2-core.o: CFLAGS += -Wno-type-limits
  69. $(LSRC)/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.o: CFLAGS += -Wno-type-limits
  70. $(LSRC)/sodium/utils.o: CFLAGS += -Wno-unused-variable
  71. COMPONENT_ADD_INCLUDEDIRS := $(LSRC)/include port_include
  72. COMPONENT_PRIV_INCLUDEDIRS := $(LSRC)/include/sodium port_include/sodium port
  73. # Not using autoconf, but this needs to be set
  74. CFLAGS += -DCONFIGURED
  75. # Add the options from configure.ac (this needs checking if new versions are added )
  76. CFLAGS += -DNATIVE_LITTLE_ENDIAN -DHAVE_WEAK_SYMBOLS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS
  77. # randombytes.c needs to pull in platform-specific implementation
  78. $(LSRC)/randombytes/randombytes.o: CFLAGS+=-DRANDOMBYTES_DEFAULT_IMPLEMENTATION
  79. ifeq ($(GCC_NOT_5_2_0), 1)
  80. # Temporary suppress "fallthrough" warnings until they are fixed in libsodium repo
  81. $(LSRC)/crypto_shorthash/siphash24/ref/shorthash_siphashx24_ref.o: CFLAGS += -Wno-implicit-fallthrough
  82. $(LSRC)/crypto_shorthash/siphash24/ref/shorthash_siphash24_ref.o: CFLAGS += -Wno-implicit-fallthrough
  83. endif