mongodb.mk 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. ################################################################################
  2. #
  3. # mongodb
  4. #
  5. ################################################################################
  6. MONGODB_VERSION = 4.2.10
  7. MONGODB_SITE = https://fastdl.mongodb.org/src
  8. MONGODB_SOURCE = mongodb-src-r$(MONGODB_VERSION).tar.gz
  9. MONGODB_LICENSE = Apache-2.0 (drivers), SSPL (database)
  10. MONGODB_LICENSE_FILES = APACHE-2.0.txt LICENSE-Community.txt
  11. MONGODB_DEPENDENCIES = \
  12. boost \
  13. host-python3-cheetah \
  14. host-python3-psutil \
  15. host-python3-pyyaml \
  16. host-python3-regex \
  17. host-python3-requests \
  18. host-scons \
  19. pcre \
  20. snappy \
  21. sqlite \
  22. yaml-cpp \
  23. zlib
  24. MONGODB_SCONS_TARGETS = mongod mongos
  25. MONGODB_SCONS_ENV = CC="$(TARGET_CC)" CXX="$(TARGET_CXX)" \
  26. -j"$(PARALLEL_JOBS)"
  27. MONGODB_SCONS_OPTS = \
  28. --disable-minimum-compiler-version-enforcement \
  29. --disable-warnings-as-errors \
  30. --use-system-boost \
  31. --use-system-pcre \
  32. --use-system-snappy \
  33. --use-system-sqlite \
  34. --use-system-yaml \
  35. --use-system-zlib
  36. # need to pass mongo version when not building from git repo
  37. MONGODB_SCONS_OPTS += MONGO_VERSION=$(MONGODB_VERSION)-
  38. # WiredTiger database storage engine only supported on 64 bits
  39. ifeq ($(BR2_ARCH_IS_64),y)
  40. MONGODB_SCONS_OPTS += --wiredtiger=on
  41. else
  42. MONGODB_SCONS_OPTS += --wiredtiger=off
  43. endif
  44. # JavaScript scripting engine and tcmalloc supported only on
  45. # x86/x86-64 systems. Mongo target is a shell interface that
  46. # depends on the javascript engine, so it will also only be
  47. # built on x86/x86-64 systems.
  48. ifeq ($(BR2_i386)$(BR2_x86_64),y)
  49. MONGODB_SCONS_OPTS += --js-engine=mozjs --allocator=tcmalloc
  50. MONGODB_SCONS_TARGETS += mongo
  51. else
  52. MONGODB_SCONS_OPTS += --js-engine=none --allocator=system
  53. endif
  54. ifeq ($(BR2_PACKAGE_LIBCURL),y)
  55. MONGODB_DEPENDENCIES += libcurl
  56. MONGODB_SCONS_OPTS += \
  57. --enable-free-mon=on \
  58. --enable-http-client=on
  59. else
  60. MONGODB_SCONS_OPTS += \
  61. --enable-free-mon=off \
  62. --enable-http-client=off
  63. endif
  64. ifeq ($(BR2_PACKAGE_OPENSSL),y)
  65. MONGODB_DEPENDENCIES += openssl
  66. MONGODB_SCONS_OPTS += \
  67. --ssl=on \
  68. --ssl-provider=openssl
  69. else
  70. MONGODB_SCONS_OPTS += --ssl=off
  71. endif
  72. define MONGODB_BUILD_CMDS
  73. (cd $(@D); \
  74. $(HOST_DIR)/bin/python3 $(SCONS) \
  75. $(MONGODB_SCONS_ENV) \
  76. $(MONGODB_SCONS_OPTS) \
  77. $(MONGODB_SCONS_TARGETS))
  78. endef
  79. define MONGODB_INSTALL_TARGET_CMDS
  80. (cd $(@D); \
  81. $(HOST_DIR)/bin/python3 $(SCONS) \
  82. $(MONGODB_SCONS_ENV) \
  83. $(MONGODB_SCONS_OPTS) \
  84. --prefix=$(TARGET_DIR)/usr \
  85. install)
  86. endef
  87. $(eval $(generic-package))