component.mk 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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/ed25519 \
  17. $(LSRC)/crypto_core/ed25519/ref10 \
  18. $(LSRC)/crypto_core/hchacha20 \
  19. $(LSRC)/crypto_core/hsalsa20/ref2 \
  20. $(LSRC)/crypto_core/hsalsa20 \
  21. $(LSRC)/crypto_core/salsa/ref \
  22. $(LSRC)/crypto_generichash \
  23. $(LSRC)/crypto_generichash/blake2b \
  24. $(LSRC)/crypto_generichash/blake2b/ref \
  25. $(LSRC)/crypto_hash \
  26. $(LSRC)/crypto_hash/sha256 \
  27. $(LSRC)/crypto_hash/sha512 \
  28. $(LSRC)/crypto_kdf/blake2b \
  29. $(LSRC)/crypto_kdf \
  30. $(LSRC)/crypto_kx \
  31. $(LSRC)/crypto_onetimeauth \
  32. $(LSRC)/crypto_onetimeauth/poly1305 \
  33. $(LSRC)/crypto_onetimeauth/poly1305/donna \
  34. $(LSRC)/crypto_pwhash/argon2 \
  35. $(LSRC)/crypto_pwhash \
  36. $(LSRC)/crypto_pwhash/scryptsalsa208sha256 \
  37. $(LSRC)/crypto_pwhash/scryptsalsa208sha256/nosse \
  38. $(LSRC)/crypto_scalarmult \
  39. $(LSRC)/crypto_scalarmult/curve25519 \
  40. $(LSRC)/crypto_scalarmult/curve25519/ref10 \
  41. $(LSRC)/crypto_scalarmult/curve25519/sandy2x \
  42. $(LSRC)/crypto_scalarmult/ed25519/ref10 \
  43. $(LSRC)/crypto_scalarmult/ristretto255/ref10 \
  44. $(LSRC)/crypto_secretbox \
  45. $(LSRC)/crypto_secretbox/xsalsa20poly1305 \
  46. $(LSRC)/crypto_shorthash \
  47. $(LSRC)/crypto_shorthash/siphash24 \
  48. $(LSRC)/crypto_shorthash/siphash24/ref \
  49. $(LSRC)/crypto_sign \
  50. $(LSRC)/crypto_sign/ed25519 \
  51. $(LSRC)/crypto_sign/ed25519/ref10 \
  52. $(LSRC)/crypto_stream/chacha20 \
  53. $(LSRC)/crypto_stream/chacha20/ref \
  54. $(LSRC)/crypto_stream \
  55. $(LSRC)/crypto_stream/salsa20 \
  56. $(LSRC)/crypto_stream/salsa20/ref \
  57. $(LSRC)/crypto_stream/xsalsa20 \
  58. $(LSRC)/crypto_verify/sodium \
  59. $(LSRC)/randombytes \
  60. $(LSRC)/sodium
  61. ifdef CONFIG_LIBSODIUM_USE_MBEDTLS_SHA
  62. COMPONENT_SRCDIRS += port/crypto_hash_mbedtls
  63. else
  64. COMPONENT_SRCDIRS += \
  65. $(LSRC)/crypto_hash/sha256/cp \
  66. $(LSRC)/crypto_hash/sha512/cp
  67. endif
  68. # Fix some warnings in current libsodium source files
  69. # (not applied to whole component as we compile some of our own files, also.)
  70. $(LSRC)/crypto_pwhash/argon2/argon2-fill-block-ref.o: CFLAGS += -Wno-unknown-pragmas
  71. $(LSRC)/crypto_pwhash/argon2/pwhash_argon2i.o: CFLAGS += -Wno-type-limits
  72. $(LSRC)/crypto_pwhash/argon2/pwhash_argon2id.o: CFLAGS += -Wno-type-limits
  73. $(LSRC)/crypto_pwhash/argon2/argon2-core.o: CFLAGS += -Wno-type-limits
  74. $(LSRC)/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.o: CFLAGS += -Wno-type-limits
  75. $(LSRC)/sodium/utils.o: CFLAGS += -Wno-unused-variable
  76. COMPONENT_ADD_INCLUDEDIRS := $(LSRC)/include port_include
  77. COMPONENT_PRIV_INCLUDEDIRS := $(LSRC)/include/sodium port_include/sodium port
  78. # Not using autoconf, but this needs to be set
  79. CFLAGS += -DCONFIGURED -Wno-unused-function
  80. # Add the options from configure.ac (this needs checking if new versions are added )
  81. CFLAGS += -DNATIVE_LITTLE_ENDIAN -DHAVE_WEAK_SYMBOLS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS
  82. # randombytes.c needs to pull in platform-specific implementation
  83. $(LSRC)/randombytes/randombytes.o: CFLAGS+=-DRANDOMBYTES_DEFAULT_IMPLEMENTATION
  84. # Temporary suppress "fallthrough" warnings until they are fixed in libsodium repo
  85. $(LSRC)/crypto_shorthash/siphash24/ref/shorthash_siphashx24_ref.o: CFLAGS += -Wno-implicit-fallthrough
  86. $(LSRC)/crypto_shorthash/siphash24/ref/shorthash_siphash24_ref.o: CFLAGS += -Wno-implicit-fallthrough