Pull lpeg and build it

This commit is contained in:
Henri DF
2016-03-04 17:52:01 -08:00
parent 9bbe692137
commit cc4837312e
3 changed files with 20 additions and 1 deletions

2
.gitignore vendored
View File

@@ -1 +1 @@
build*
/build*

View File

@@ -40,6 +40,16 @@ set(LUAJIT_INCLUDE_DIR "${sysdig_BINARY_DIR}/luajit-prefix/src/luajit/src")
message(STATUS "Using bundled curl in '${CURL_BUNDLE_DIR}'")
message(STATUS "Using SSL for curl in '${CURL_SSL_OPTION}'")
include(ExternalProject)
ExternalProject_Add(lpeg
URL "https://s3.amazonaws.com/download.draios.com/dependencies/lpeg-1.0.0.tar.gz"
URL_MD5 "0aec64ccd13996202ad0c099e2877ece"
BUILD_COMMAND LUA_INCLUDE=/sysdig/digwatch/build-ubuntu/sysdig/luajit-prefix/src/luajit/src ${PROJECT_SOURCE_DIR}/scripts/build-lpeg.sh
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ""
INSTALL_COMMAND cp lpeg.so re.lua ${PROJECT_SOURCE_DIR}/userspace/digwatch/lua)
add_subdirectory(userspace/digwatch)

9
scripts/build-lpeg.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/sh
gcc -O2 -fPIC -I$LUA_INCLUDE -c lpcap.c -o lpcap.o
gcc -O2 -fPIC -I$LUA_INCLUDE -c lpcode.c -o lpcode.o
gcc -O2 -fPIC -I$LUA_INCLUDE -c lpprint.c -o lpprint.o
gcc -O2 -fPIC -I$LUA_INCLUDE -c lptree.c -o lptree.o
gcc -O2 -fPIC -I$LUA_INCLUDE -c lpvm.c -o lpvm.o
gcc -shared -o lpeg.so -L/usr/local/lib lpcap.o lpcode.o lpprint.o lptree.o lpvm.o