fluent-bit.mk 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. ################################################################################
  2. #
  3. # fluent-bit
  4. #
  5. ################################################################################
  6. FLUENT_BIT_VERSION = 2.1.7
  7. FLUENT_BIT_SITE = $(call github,fluent,fluent-bit,v$(FLUENT_BIT_VERSION))
  8. FLUENT_BIT_LICENSE = Apache-2.0
  9. FLUENT_BIT_LICENSE_FILES = LICENSE
  10. FLUENT_BIT_CPE_ID_VENDOR = treasuredata
  11. FLUENT_BIT_CPE_ID_PRODUCT = fluent_bit
  12. FLUENT_BIT_DEPENDENCIES = host-bison host-flex libyaml openssl
  13. FLUENT_BIT_CFLAGS = $(TARGET_CFLAGS)
  14. FLUENT_BIT_CONF_OPTS += \
  15. -DFLB_DEBUG=No \
  16. -DFLB_RELEASE=Yes \
  17. -DFLB_EXAMPLES=No \
  18. -DFLB_CHUNK_TRACE=No \
  19. -DFLB_PREFER_SYSTEM_LIBS=Yes \
  20. -DFLB_BACKTRACE=No
  21. ifeq ($(BR2_PACKAGE_FLUENT_BIT_WASM),y)
  22. FLUENT_BIT_CONF_OPTS += -DFLB_WASM=Yes
  23. else
  24. FLUENT_BIT_CONF_OPTS += -DFLB_WASM=No
  25. endif
  26. ifeq ($(BR2_PACKAGE_LUAJIT),y)
  27. FLUENT_BIT_CONF_OPTS += -DFLB_LUAJIT=Yes
  28. FLUENT_BIT_DEPENDENCIES += luajit
  29. else
  30. FLUENT_BIT_CONF_OPTS += -DFLB_LUAJIT=No
  31. endif
  32. # Force bundled miniz to be linked statically.
  33. # https://github.com/fluent/fluent-bit/issues/6711
  34. FLUENT_BIT_CONF_OPTS += \
  35. -DBUILD_SHARED_LIBS=OFF
  36. # Move the config files from /usr/etc/ to /etc/.
  37. # https://github.com/fluent/fluent-bit/issues/6619
  38. FLUENT_BIT_CONF_OPTS += \
  39. -DCMAKE_INSTALL_SYSCONFDIR="/etc/"
  40. # Fix multiple definition of `mk_tls_*'.
  41. # https://github.com/fluent/fluent-bit/issues/5537
  42. FLUENT_BIT_CFLAGS += -fcommon
  43. # Undefining _FILE_OFFSET_BITS here because of a "bug" with glibc fts.h
  44. # large file support.
  45. # https://bugzilla.redhat.com/show_bug.cgi?id=574992
  46. FLUENT_BIT_CFLAGS += -U_FILE_OFFSET_BITS
  47. ifeq ($(BR2_PACKAGE_LIBEXECINFO),y)
  48. FLUENT_BIT_DEPENDENCIES += libexecinfo
  49. FLUENT_BIT_LDFLAGS += -lexecinfo
  50. endif
  51. ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),)
  52. FLUENT_BIT_DEPENDENCIES += musl-fts
  53. FLUENT_BIT_LDFLAGS += -lfts
  54. endif
  55. # Uses __atomic_compare_exchange_8
  56. ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
  57. FLUENT_BIT_LDFLAGS += -latomic
  58. endif
  59. FLUENT_BIT_CONF_OPTS += \
  60. -DCMAKE_EXE_LINKER_FLAGS="$(FLUENT_BIT_LDFLAGS)" \
  61. -DCMAKE_C_FLAGS="$(FLUENT_BIT_CFLAGS)"
  62. define FLUENT_BIT_INSTALL_INIT_SYSV
  63. $(INSTALL) -D -m 0755 package/fluent-bit/S99fluent-bit \
  64. $(TARGET_DIR)/etc/init.d/S99fluent-bit
  65. endef
  66. $(eval $(cmake-package))