aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/pcre.BUILD
diff options
context:
space:
mode:
authorGravatar Justine Tunney <jart@google.com>2016-10-20 16:48:45 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-10-20 18:04:26 -0700
commit1dba78b997dc49df9df663a838e0bacd6602f5b8 (patch)
treeadb3cfe86b348eb81210291f7ebe431dce971915 /third_party/pcre.BUILD
parent2da2ae76cfa782474e8662234f89ddeecd080e05 (diff)
Automatically build SWIG from source
This change allows Bazel to fetch and build SWIG rather than getting it from the system. This change also improves the i/o performance of the SWIG build, makes it hermetically sealed, and ensures tf_py_wrap_cc() can function correctly across Bazel repositories. CC: #4983 Change: 136783531
Diffstat (limited to 'third_party/pcre.BUILD')
-rw-r--r--third_party/pcre.BUILD80
1 files changed, 80 insertions, 0 deletions
diff --git a/third_party/pcre.BUILD b/third_party/pcre.BUILD
new file mode 100644
index 0000000000..d9ef246672
--- /dev/null
+++ b/third_party/pcre.BUILD
@@ -0,0 +1,80 @@
+licenses(["notice"]) # BSD
+
+exports_files(["LICENSE"])
+
+cc_library(
+ name = "pcre",
+ srcs = [
+ "pcre_byte_order.c",
+ "pcre_chartables.c",
+ "pcre_compile.c",
+ "pcre_config.c",
+ "pcre_dfa_exec.c",
+ "pcre_exec.c",
+ "pcre_fullinfo.c",
+ "pcre_get.c",
+ "pcre_globals.c",
+ "pcre_internal.h",
+ "pcre_jit_compile.c",
+ "pcre_maketables.c",
+ "pcre_newline.c",
+ "pcre_ord2utf8.c",
+ "pcre_refcount.c",
+ "pcre_string_utils.c",
+ "pcre_study.c",
+ "pcre_tables.c",
+ "pcre_ucd.c",
+ "pcre_valid_utf8.c",
+ "pcre_version.c",
+ "pcre_xclass.c",
+ "ucp.h",
+ ],
+ hdrs = [
+ "pcre.h",
+ "pcreposix.h",
+ ],
+ copts = [
+ "-DHAVE_BCOPY=1",
+ "-DHAVE_INTTYPES_H=1",
+ "-DHAVE_MEMMOVE=1",
+ "-DHAVE_STDINT_H=1",
+ "-DHAVE_STRERROR=1",
+ "-DHAVE_SYS_STAT_H=1",
+ "-DHAVE_SYS_TYPES_H=1",
+ "-DHAVE_UNISTD_H=1",
+ "-DLINK_SIZE=2",
+ "-DMATCH_LIMIT=10000000",
+ "-DMATCH_LIMIT_RECURSION=1000",
+ "-DMAX_NAME_COUNT=10000",
+ "-DMAX_NAME_SIZE=32",
+ "-DNEWLINE=10",
+ "-DNO_RECURSE",
+ "-DPARENS_NEST_LIMIT=50",
+ "-DPCRE_STATIC=1",
+ "-DPOSIX_MALLOC_THRESHOLD=10",
+ "-DSTDC_HEADERS=1",
+ "-DSUPPORT_UCP",
+ "-DSUPPORT_UTF",
+ ],
+ includes = ["."],
+ visibility = ["@swig//:__pkg__"], # Please use RE2
+ alwayslink = 1,
+)
+
+genrule(
+ name = "pcre_h",
+ srcs = ["pcre.h.in"],
+ outs = ["pcre.h"],
+ cmd = "sed -e s/@PCRE_MAJOR@/8/" +
+ " -e s/@PCRE_MINOR@/39/" +
+ " -e s/@PCRE_PRERELEASE@//" +
+ " -e s/@PCRE_DATE@/redacted/" +
+ " $< >$@",
+)
+
+genrule(
+ name = "pcre_chartables_c",
+ srcs = ["pcre_chartables.c.dist"],
+ outs = ["pcre_chartables.c"],
+ cmd = "cp $< $@",
+)