Skip to content

Commit 5640a8e

Browse files
committed
lib: onigmo: new library as regex engine
Signed-off-by: Eduardo Silva <eduardo@treasure-data.com>
1 parent 898f36d commit 5640a8e

File tree

143 files changed

+160502
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+160502
-0
lines changed

CMakeLists.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ set(FLB_VERSION_STR "${FLB_VERSION_MAJOR}.${FLB_VERSION_MINOR}.${FLB_VERSION_PAT
2828
option(FLB_ALL "Enable all features" No)
2929
option(FLB_DEBUG "Build with debug symbols" No)
3030
option(FLB_JEMALLOC "Build with Jemalloc support" No)
31+
option(FLB_REGEX "Build wiht Regex support" Yes)
3132
option(FLB_TLS "Build with SSL/TLS support" No)
3233
option(FLB_HTTP "Enable build-in HTTP Server" No)
3334
option(FLB_WITHOUT_BIN "Do not build executable" No)
@@ -348,6 +349,23 @@ else()
348349
FLB_OPTION(FLB_JEMALLOC OFF)
349350
endif()
350351

352+
# Onigmo (Regex Engine)
353+
# =====================
354+
if(FLB_REGEX)
355+
ExternalProject_Add(onigmo
356+
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/onigmo
357+
CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/lib/onigmo/configure --with-pic --disable-shared --enable-static --prefix=<INSTALL_DIR>
358+
CFLAGS=-std=gnu99\ -Wall\ -pipe\ -g3\ -O3\ -funroll-loops
359+
BUILD_COMMAND ${MAKE}
360+
INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/
361+
INSTALL_COMMAND $(MAKE) install)
362+
add_library(libonigmo STATIC IMPORTED GLOBAL)
363+
set_target_properties(libonigmo PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/lib/libonigmo.a")
364+
add_dependencies(libonigmo onigmo)
365+
include_directories("${CMAKE_CURRENT_BINARY_DIR}/include/")
366+
FLB_DEFINITION(FLB_HAVE_REGEX)
367+
endif()
368+
351369
# Pthread Local Storage
352370
# =====================
353371
# By default we expect the compiler already support thread local storage

lib/onigmo/.editorconfig

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
; see: http://editorconfig.org/
2+
3+
root = true
4+
5+
[*]
6+
end_of_line = lf
7+
insert_final_newline = true
8+
trim_trailing_whitespace = true
9+
10+
[**.[ch]]
11+
indent_style = tab
12+
indent_size = 2
13+
tab_width = 8
14+
15+
[st.[ch]]
16+
indent_style = tab
17+
indent_size = 4
18+
tab_width = 8
19+
20+
[**.py]
21+
indent_style = space
22+
indent_size = 4
23+
24+
[**.rb]
25+
indent_style = space
26+
indent_size = 2
27+
28+
[**.yml]
29+
indent_style = space
30+
indent_size = 2
31+
32+
[HISTORY]
33+
indent_style = space
34+
35+
[doc/*]
36+
indent_style = space
37+
38+
[win32/*]
39+
end_of_line = crlf
40+
41+
[win32/*.py]
42+
end_of_line = lf

lib/onigmo/.travis.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
language: c
2+
3+
branches:
4+
except:
5+
- ruby-2.x
6+
7+
compiler:
8+
- gcc
9+
- clang
10+
11+
env:
12+
- CFLAGS=--coverage CONFOPT=
13+
14+
sudo: false
15+
16+
addons:
17+
apt:
18+
packages:
19+
- lcov
20+
#- python3
21+
22+
before_install:
23+
- gem install lcoveralls
24+
25+
before_script:
26+
- ./configure $CONFOPT && make
27+
28+
script:
29+
- make test
30+
31+
after_success:
32+
- lcov -c -d .libs -o coverage.info
33+
- lcoveralls --retry-count 5 coverage.info

lib/onigmo/AUTHORS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
kentkt AT csc DOT jp (K.Takata)
2+
sndgk393 AT ybb DOT ne DOT jp (K.Kosako)

lib/onigmo/COPYING

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
Onigmo (Oniguruma-mod) LICENSE
2+
------------------------------
3+
4+
/*-
5+
* Copyright (c) 2002-2009 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
6+
* Copyright (c) 2011-2014 K.Takata <kentkt AT csc DOT jp>
7+
* All rights reserved.
8+
*
9+
* Redistribution and use in source and binary forms, with or without
10+
* modification, are permitted provided that the following conditions
11+
* are met:
12+
* 1. Redistributions of source code must retain the above copyright
13+
* notice, this list of conditions and the following disclaimer.
14+
* 2. Redistributions in binary form must reproduce the above copyright
15+
* notice, this list of conditions and the following disclaimer in the
16+
* documentation and/or other materials provided with the distribution.
17+
*
18+
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21+
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24+
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27+
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28+
* SUCH DAMAGE.
29+
*/
30+
31+
32+
33+
Oniguruma LICENSE
34+
-----------------
35+
36+
/*-
37+
* Copyright (c) 2002-2009 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
38+
* All rights reserved.
39+
*
40+
* Redistribution and use in source and binary forms, with or without
41+
* modification, are permitted provided that the following conditions
42+
* are met:
43+
* 1. Redistributions of source code must retain the above copyright
44+
* notice, this list of conditions and the following disclaimer.
45+
* 2. Redistributions in binary form must reproduce the above copyright
46+
* notice, this list of conditions and the following disclaimer in the
47+
* documentation and/or other materials provided with the distribution.
48+
*
49+
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
50+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
51+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
52+
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
53+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
54+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
55+
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
56+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
57+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
58+
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
59+
* SUCH DAMAGE.
60+
*/
61+
62+
63+
64+
Ruby BSDL
65+
---------
66+
Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved.
67+
68+
Redistribution and use in source and binary forms, with or without
69+
modification, are permitted provided that the following conditions
70+
are met:
71+
1. Redistributions of source code must retain the above copyright
72+
notice, this list of conditions and the following disclaimer.
73+
2. Redistributions in binary form must reproduce the above copyright
74+
notice, this list of conditions and the following disclaimer in the
75+
documentation and/or other materials provided with the distribution.
76+
77+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
78+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
79+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
80+
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
81+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
82+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
83+
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
84+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
85+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
86+
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
87+
SUCH DAMAGE.

0 commit comments

Comments
 (0)