build: expose LuaJIT library
@@ -47,6 +47,7 @@ option(FLB_WITHOUT_INOTIFY "Disable inotify support" No)
option(FLB_SQLDB "Enable SQL embedded DB" No)
option(FLB_HTTP_SERVER "Enable HTTP Server" No)
option(FLB_BACKTRACE "Enable stacktrace support" Yes)
+option(FLB_LUAJIT "Enable Lua Scripting support" Yes)
# Metrics: Experimental Feature, disabled by default on 0.12 series
# but enabled in the upcoming 0.13 release. Note that development
@@ -117,6 +118,7 @@ option(FLB_FILTER_PARSER "Enable parser filter" Yes)
option(FLB_FILTER_KUBERNETES "Enable kubernetes filter" Yes)
option(FLB_FILTER_THROTTLE "Enable throttle filter" Yes)
option(FLB_FILTER_RECORD_MODIFIER "Enable record_modifier filter" Yes)
+option(FLB_FILTER_LUA "Enable Lua scripting filter" Yes)
# Enable all features
if(FLB_ALL)
@@ -185,6 +187,7 @@ include_directories(
lib/flb_libco
lib/sha1
lib/msgpack-2.1.3/include
+ lib/luajit-2.0.5/src/
${MONKEY_INCLUDE_DIR}
)
@@ -420,6 +423,22 @@ if(FLB_REGEX)
FLB_DEFINITION(FLB_HAVE_REGEX)
endif()
+# LuaJIT (Scripting Support)
+# ==========================
+if(FLB_LUAJIT)
+ set(LUA_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib/luajit-2.0.5)
+ ExternalProject_Add(luajit
+ SOURCE_DIR ${LUA_PATH}
+ CONFIGURE_COMMAND export "CFLAGS=-g -fPIC" #${LUA_PATH}/configure
+ BUILD_COMMAND make -C ${LUA_PATH}
+ INSTALL_COMMAND cp ${LUA_PATH}/src/libluajit.a "${CMAKE_CURRENT_BINARY_DIR}/lib/libluajit.a")
+ add_library(libluajit STATIC IMPORTED GLOBAL)
+ set_target_properties(libluajit PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/lib/libluajit.a")
+ add_dependencies(libluajit luajit)
+ include_directories("${CMAKE_CURRENT_BINARY_DIR}/include/")
+ FLB_DEFINITION(FLB_HAVE_LUAJIT)
+endif()
+
# Pthread Local Storage
# =====================
# By default we expect the compiler already support thread local storage
