mongodb.mk 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. ################################################################################
  2. #
  3. # mongodb
  4. #
  5. ################################################################################
  6. MONGODB_VERSION_BASE = 4.0.12
  7. MONGODB_VERSION = r$(MONGODB_VERSION_BASE)
  8. MONGODB_SITE = $(call github,mongodb,mongo,$(MONGODB_VERSION))
  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-python-cheetah \
  14. host-python-pyyaml \
  15. host-python-typing \
  16. host-scons \
  17. pcre \
  18. snappy \
  19. sqlite \
  20. yaml-cpp \
  21. zlib
  22. MONGODB_SCONS_TARGETS = mongod mongos
  23. MONGODB_SCONS_ENV = CC="$(TARGET_CC)" CXX="$(TARGET_CXX)" \
  24. -j"$(PARALLEL_JOBS)"
  25. MONGODB_SCONS_OPTS = \
  26. --disable-warnings-as-errors \
  27. --use-system-boost \
  28. --use-system-pcre \
  29. --use-system-snappy \
  30. --use-system-sqlite \
  31. --use-system-yaml \
  32. --use-system-zlib
  33. # need to pass mongo version when not building from git repo
  34. MONGODB_SCONS_OPTS += MONGO_VERSION=$(MONGODB_VERSION_BASE)-
  35. # WiredTiger database storage engine only supported on 64 bits
  36. ifeq ($(BR2_ARCH_IS_64),y)
  37. MONGODB_SCONS_OPTS += --wiredtiger=on
  38. else
  39. MONGODB_SCONS_OPTS += --wiredtiger=off
  40. endif
  41. # JavaScript scripting engine and tcmalloc supported only on
  42. # x86/x86-64 systems. Mongo target is a shell interface that
  43. # depends on the javascript engine, so it will also only be
  44. # built on x86/x86-64 systems.
  45. ifeq ($(BR2_i386)$(BR2_x86_64),y)
  46. MONGODB_SCONS_OPTS += --js-engine=mozjs --allocator=tcmalloc
  47. MONGODB_SCONS_TARGETS += mongo
  48. else
  49. MONGODB_SCONS_OPTS += --js-engine=none --allocator=system
  50. endif
  51. ifeq ($(BR2_PACKAGE_LIBCURL),y)
  52. MONGODB_DEPENDENCIES += libcurl
  53. MONGODB_SCONS_OPTS += --enable-free-mon=on
  54. else
  55. MONGODB_SCONS_OPTS += --enable-free-mon=off
  56. endif
  57. ifeq ($(BR2_PACKAGE_OPENSSL),y)
  58. MONGODB_DEPENDENCIES += openssl
  59. MONGODB_SCONS_OPTS += \
  60. --ssl \
  61. --ssl-provider=openssl
  62. endif
  63. define MONGODB_BUILD_CMDS
  64. (cd $(@D); \
  65. $(HOST_DIR)/bin/python $(SCONS) \
  66. $(MONGODB_SCONS_ENV) \
  67. $(MONGODB_SCONS_OPTS) \
  68. $(MONGODB_SCONS_TARGETS))
  69. endef
  70. define MONGODB_INSTALL_TARGET_CMDS
  71. (cd $(@D); \
  72. $(HOST_DIR)/bin/python $(SCONS) \
  73. $(MONGODB_SCONS_ENV) \
  74. $(MONGODB_SCONS_OPTS) \
  75. --prefix=$(TARGET_DIR)/usr \
  76. install)
  77. endef
  78. $(eval $(generic-package))