pcre.BUILD 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. licenses(["notice"]) # BSD
  2. exports_files(["LICENCE"])
  3. cc_library(
  4. name = "pcre",
  5. srcs = [
  6. "pcre_byte_order.c",
  7. "pcre_chartables.c",
  8. "pcre_compile.c",
  9. "pcre_config.c",
  10. "pcre_dfa_exec.c",
  11. "pcre_exec.c",
  12. "pcre_fullinfo.c",
  13. "pcre_get.c",
  14. "pcre_globals.c",
  15. "pcre_internal.h",
  16. "pcre_jit_compile.c",
  17. "pcre_maketables.c",
  18. "pcre_newline.c",
  19. "pcre_ord2utf8.c",
  20. "pcre_refcount.c",
  21. "pcre_string_utils.c",
  22. "pcre_study.c",
  23. "pcre_tables.c",
  24. "pcre_ucd.c",
  25. "pcre_valid_utf8.c",
  26. "pcre_version.c",
  27. "pcre_xclass.c",
  28. "ucp.h",
  29. ],
  30. hdrs = [
  31. "pcre.h",
  32. "pcreposix.h",
  33. ],
  34. copts = [
  35. "-DHAVE_BCOPY=1",
  36. "-DHAVE_INTTYPES_H=1",
  37. "-DHAVE_MEMMOVE=1",
  38. "-DHAVE_STDINT_H=1",
  39. "-DHAVE_STRERROR=1",
  40. "-DHAVE_SYS_STAT_H=1",
  41. "-DHAVE_SYS_TYPES_H=1",
  42. "-DHAVE_UNISTD_H=1",
  43. "-DLINK_SIZE=2",
  44. "-DMATCH_LIMIT=10000000",
  45. "-DMATCH_LIMIT_RECURSION=1000",
  46. "-DMAX_NAME_COUNT=10000",
  47. "-DMAX_NAME_SIZE=32",
  48. "-DNEWLINE=10",
  49. "-DNO_RECURSE",
  50. "-DPARENS_NEST_LIMIT=50",
  51. "-DPOSIX_MALLOC_THRESHOLD=10",
  52. "-DSTDC_HEADERS=1",
  53. "-DSUPPORT_UCP",
  54. "-DSUPPORT_UTF",
  55. ],
  56. defines = ["PCRE_STATIC=1"],
  57. includes = ["."],
  58. visibility = ["//visibility:public"], # Please use RE2
  59. alwayslink = 1,
  60. )
  61. genrule(
  62. name = "pcre_h",
  63. srcs = ["pcre.h.in"],
  64. outs = ["pcre.h"],
  65. cmd = "sed -e s/@PCRE_MAJOR@/8/" +
  66. " -e s/@PCRE_MINOR@/39/" +
  67. " -e s/@PCRE_PRERELEASE@//" +
  68. " -e s/@PCRE_DATE@/redacted/" +
  69. " $< >$@",
  70. )
  71. genrule(
  72. name = "pcre_chartables_c",
  73. srcs = ["pcre_chartables.c.dist"],
  74. outs = ["pcre_chartables.c"],
  75. cmd = "cp $< $@",
  76. )