github的一些开源项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

967 lines
29 KiB

  1. ## Process this file with automake to produce Makefile.in.
  2. AUTOMAKE_OPTIONS = subdir-objects
  3. ACLOCAL_AMFLAGS = -I m4
  4. ## This seems to have become necessary for building in non-source directory.
  5. AM_CPPFLAGS="-I$(srcdir)/src"
  6. ## Specify the documentation files that are distributed.
  7. dist_doc_DATA = \
  8. AUTHORS \
  9. COPYING \
  10. ChangeLog \
  11. LICENCE \
  12. NEWS \
  13. README \
  14. doc/pcre2.txt \
  15. doc/pcre2-config.txt \
  16. doc/pcre2grep.txt \
  17. doc/pcre2test.txt
  18. dist_html_DATA = \
  19. doc/html/NON-AUTOTOOLS-BUILD.txt \
  20. doc/html/README.txt \
  21. doc/html/index.html \
  22. doc/html/pcre2-config.html \
  23. doc/html/pcre2.html \
  24. doc/html/pcre2_callout_enumerate.html \
  25. doc/html/pcre2_code_copy.html \
  26. doc/html/pcre2_code_copy_with_tables.html \
  27. doc/html/pcre2_code_free.html \
  28. doc/html/pcre2_compile.html \
  29. doc/html/pcre2_compile_context_copy.html \
  30. doc/html/pcre2_compile_context_create.html \
  31. doc/html/pcre2_compile_context_free.html \
  32. doc/html/pcre2_config.html \
  33. doc/html/pcre2_convert_context_copy.html \
  34. doc/html/pcre2_convert_context_create.html \
  35. doc/html/pcre2_convert_context_free.html \
  36. doc/html/pcre2_converted_pattern_free.html \
  37. doc/html/pcre2_dfa_match.html \
  38. doc/html/pcre2_general_context_copy.html \
  39. doc/html/pcre2_general_context_create.html \
  40. doc/html/pcre2_general_context_free.html \
  41. doc/html/pcre2_get_error_message.html \
  42. doc/html/pcre2_get_mark.html \
  43. doc/html/pcre2_get_match_data_heapframes_size.html \
  44. doc/html/pcre2_get_match_data_size.html \
  45. doc/html/pcre2_get_ovector_count.html \
  46. doc/html/pcre2_get_ovector_pointer.html \
  47. doc/html/pcre2_get_startchar.html \
  48. doc/html/pcre2_jit_compile.html \
  49. doc/html/pcre2_jit_free_unused_memory.html \
  50. doc/html/pcre2_jit_match.html \
  51. doc/html/pcre2_jit_stack_assign.html \
  52. doc/html/pcre2_jit_stack_create.html \
  53. doc/html/pcre2_jit_stack_free.html \
  54. doc/html/pcre2_maketables.html \
  55. doc/html/pcre2_maketables_free.html \
  56. doc/html/pcre2_match.html \
  57. doc/html/pcre2_match_context_copy.html \
  58. doc/html/pcre2_match_context_create.html \
  59. doc/html/pcre2_match_context_free.html \
  60. doc/html/pcre2_match_data_create.html \
  61. doc/html/pcre2_match_data_create_from_pattern.html \
  62. doc/html/pcre2_match_data_free.html \
  63. doc/html/pcre2_pattern_convert.html \
  64. doc/html/pcre2_pattern_info.html \
  65. doc/html/pcre2_serialize_decode.html \
  66. doc/html/pcre2_serialize_encode.html \
  67. doc/html/pcre2_serialize_free.html \
  68. doc/html/pcre2_serialize_get_number_of_codes.html \
  69. doc/html/pcre2_set_bsr.html \
  70. doc/html/pcre2_set_callout.html \
  71. doc/html/pcre2_set_character_tables.html \
  72. doc/html/pcre2_set_compile_extra_options.html \
  73. doc/html/pcre2_set_compile_recursion_guard.html \
  74. doc/html/pcre2_set_depth_limit.html \
  75. doc/html/pcre2_set_glob_escape.html \
  76. doc/html/pcre2_set_glob_separator.html \
  77. doc/html/pcre2_set_heap_limit.html \
  78. doc/html/pcre2_set_match_limit.html \
  79. doc/html/pcre2_set_max_pattern_compiled_length.html \
  80. doc/html/pcre2_set_max_pattern_length.html \
  81. doc/html/pcre2_set_max_varlookbehind.html \
  82. doc/html/pcre2_set_offset_limit.html \
  83. doc/html/pcre2_set_newline.html \
  84. doc/html/pcre2_set_parens_nest_limit.html \
  85. doc/html/pcre2_set_recursion_limit.html \
  86. doc/html/pcre2_set_recursion_memory_management.html \
  87. doc/html/pcre2_set_substitute_callout.html \
  88. doc/html/pcre2_substitute.html \
  89. doc/html/pcre2_substring_copy_byname.html \
  90. doc/html/pcre2_substring_copy_bynumber.html \
  91. doc/html/pcre2_substring_free.html \
  92. doc/html/pcre2_substring_get_byname.html \
  93. doc/html/pcre2_substring_get_bynumber.html \
  94. doc/html/pcre2_substring_length_byname.html \
  95. doc/html/pcre2_substring_length_bynumber.html \
  96. doc/html/pcre2_substring_list_free.html \
  97. doc/html/pcre2_substring_list_get.html \
  98. doc/html/pcre2_substring_nametable_scan.html \
  99. doc/html/pcre2_substring_number_from_name.html \
  100. doc/html/pcre2api.html \
  101. doc/html/pcre2build.html \
  102. doc/html/pcre2callout.html \
  103. doc/html/pcre2compat.html \
  104. doc/html/pcre2convert.html \
  105. doc/html/pcre2demo.html \
  106. doc/html/pcre2grep.html \
  107. doc/html/pcre2jit.html \
  108. doc/html/pcre2limits.html \
  109. doc/html/pcre2matching.html \
  110. doc/html/pcre2partial.html \
  111. doc/html/pcre2pattern.html \
  112. doc/html/pcre2perform.html \
  113. doc/html/pcre2posix.html \
  114. doc/html/pcre2sample.html \
  115. doc/html/pcre2serialize.html \
  116. doc/html/pcre2syntax.html \
  117. doc/html/pcre2test.html \
  118. doc/html/pcre2unicode.html
  119. dist_man_MANS = \
  120. doc/pcre2-config.1 \
  121. doc/pcre2.3 \
  122. doc/pcre2_callout_enumerate.3 \
  123. doc/pcre2_code_copy.3 \
  124. doc/pcre2_code_copy_with_tables.3 \
  125. doc/pcre2_code_free.3 \
  126. doc/pcre2_compile.3 \
  127. doc/pcre2_compile_context_copy.3 \
  128. doc/pcre2_compile_context_create.3 \
  129. doc/pcre2_compile_context_free.3 \
  130. doc/pcre2_config.3 \
  131. doc/pcre2_convert_context_copy.3 \
  132. doc/pcre2_convert_context_create.3 \
  133. doc/pcre2_convert_context_free.3 \
  134. doc/pcre2_converted_pattern_free.3 \
  135. doc/pcre2_dfa_match.3 \
  136. doc/pcre2_general_context_copy.3 \
  137. doc/pcre2_general_context_create.3 \
  138. doc/pcre2_general_context_free.3 \
  139. doc/pcre2_get_error_message.3 \
  140. doc/pcre2_get_mark.3 \
  141. doc/pcre2_get_match_data_heapframes_size.3 \
  142. doc/pcre2_get_match_data_size.3 \
  143. doc/pcre2_get_ovector_count.3 \
  144. doc/pcre2_get_ovector_pointer.3 \
  145. doc/pcre2_get_startchar.3 \
  146. doc/pcre2_jit_compile.3 \
  147. doc/pcre2_jit_free_unused_memory.3 \
  148. doc/pcre2_jit_match.3 \
  149. doc/pcre2_jit_stack_assign.3 \
  150. doc/pcre2_jit_stack_create.3 \
  151. doc/pcre2_jit_stack_free.3 \
  152. doc/pcre2_maketables.3 \
  153. doc/pcre2_maketables_free.3 \
  154. doc/pcre2_match.3 \
  155. doc/pcre2_match_context_copy.3 \
  156. doc/pcre2_match_context_create.3 \
  157. doc/pcre2_match_context_free.3 \
  158. doc/pcre2_match_data_create.3 \
  159. doc/pcre2_match_data_create_from_pattern.3 \
  160. doc/pcre2_match_data_free.3 \
  161. doc/pcre2_pattern_convert.3 \
  162. doc/pcre2_pattern_info.3 \
  163. doc/pcre2_serialize_decode.3 \
  164. doc/pcre2_serialize_encode.3 \
  165. doc/pcre2_serialize_free.3 \
  166. doc/pcre2_serialize_get_number_of_codes.3 \
  167. doc/pcre2_set_bsr.3 \
  168. doc/pcre2_set_callout.3 \
  169. doc/pcre2_set_character_tables.3 \
  170. doc/pcre2_set_compile_extra_options.3 \
  171. doc/pcre2_set_compile_recursion_guard.3 \
  172. doc/pcre2_set_depth_limit.3 \
  173. doc/pcre2_set_glob_escape.3 \
  174. doc/pcre2_set_glob_separator.3 \
  175. doc/pcre2_set_heap_limit.3 \
  176. doc/pcre2_set_match_limit.3 \
  177. doc/pcre2_set_max_pattern_compiled_length.3 \
  178. doc/pcre2_set_max_pattern_length.3 \
  179. doc/pcre2_set_max_varlookbehind.3 \
  180. doc/pcre2_set_offset_limit.3 \
  181. doc/pcre2_set_newline.3 \
  182. doc/pcre2_set_parens_nest_limit.3 \
  183. doc/pcre2_set_recursion_limit.3 \
  184. doc/pcre2_set_recursion_memory_management.3 \
  185. doc/pcre2_set_substitute_callout.3 \
  186. doc/pcre2_substitute.3 \
  187. doc/pcre2_substring_copy_byname.3 \
  188. doc/pcre2_substring_copy_bynumber.3 \
  189. doc/pcre2_substring_free.3 \
  190. doc/pcre2_substring_get_byname.3 \
  191. doc/pcre2_substring_get_bynumber.3 \
  192. doc/pcre2_substring_length_byname.3 \
  193. doc/pcre2_substring_length_bynumber.3 \
  194. doc/pcre2_substring_list_free.3 \
  195. doc/pcre2_substring_list_get.3 \
  196. doc/pcre2_substring_nametable_scan.3 \
  197. doc/pcre2_substring_number_from_name.3 \
  198. doc/pcre2api.3 \
  199. doc/pcre2build.3 \
  200. doc/pcre2callout.3 \
  201. doc/pcre2compat.3 \
  202. doc/pcre2convert.3 \
  203. doc/pcre2demo.3 \
  204. doc/pcre2grep.1 \
  205. doc/pcre2jit.3 \
  206. doc/pcre2limits.3 \
  207. doc/pcre2matching.3 \
  208. doc/pcre2partial.3 \
  209. doc/pcre2pattern.3 \
  210. doc/pcre2perform.3 \
  211. doc/pcre2posix.3 \
  212. doc/pcre2sample.3 \
  213. doc/pcre2serialize.3 \
  214. doc/pcre2syntax.3 \
  215. doc/pcre2test.1 \
  216. doc/pcre2unicode.3
  217. # The Libtool libraries to install. We'll add to this later.
  218. lib_LTLIBRARIES =
  219. # Unit tests you want to run when people type 'make check'.
  220. # TESTS is for binary unit tests, check_SCRIPTS for script-based tests
  221. TESTS =
  222. check_SCRIPTS =
  223. dist_noinst_SCRIPTS =
  224. # Some of the binaries we make are to be installed, and others are
  225. # (non-user-visible) helper programs needed to build the libraries.
  226. bin_PROGRAMS =
  227. noinst_PROGRAMS =
  228. # Additional files to delete on 'make clean', 'make distclean',
  229. # and 'make maintainer-clean'. It turns out that the default is to delete only
  230. # those binaries that *this* configuration has created. If the configuration
  231. # has been changed, some binaries may not get automatically deleted. Therefore
  232. # we list them here.
  233. CLEANFILES = \
  234. pcre2_dftables \
  235. pcre2_jit_test \
  236. pcre2fuzzcheck-8 \
  237. pcre2fuzzcheck-16 \
  238. pcre2fuzzcheck-32 \
  239. pcre2demo
  240. DISTCLEANFILES = src/config.h.in~
  241. MAINTAINERCLEANFILES =
  242. # Additional files to bundle with the distribution, over and above what
  243. # the Autotools include by default.
  244. EXTRA_DIST =
  245. # These files contain additional m4 macros that are used by autoconf.
  246. EXTRA_DIST += \
  247. m4/ax_pthread.m4 m4/pcre2_visibility.m4
  248. # These files contain maintenance information
  249. EXTRA_DIST += \
  250. NON-AUTOTOOLS-BUILD \
  251. HACKING
  252. # These are support files for building under VMS
  253. EXTRA_DIST += \
  254. vms/configure.com \
  255. vms/openvms_readme.txt \
  256. vms/pcre2.h_patch \
  257. vms/stdint.h
  258. # These files are used in the preparation of a release
  259. EXTRA_DIST += \
  260. PrepareRelease \
  261. CheckMan \
  262. CleanTxt \
  263. Detrail \
  264. 132html \
  265. doc/index.html.src
  266. # These files are usable versions of pcre2.h and config.h that are distributed
  267. # for the benefit of people who are building PCRE2 manually, without the
  268. # Autotools support.
  269. EXTRA_DIST += \
  270. src/pcre2.h.generic \
  271. src/config.h.generic
  272. # The only difference between pcre2.h.in and pcre2.h is the setting of the PCRE
  273. # version number. Therefore, we can create the generic version just by copying.
  274. src/pcre2.h.generic: src/pcre2.h.in configure.ac
  275. rm -f $@
  276. cp -p src/pcre2.h $@
  277. # It is more complicated for config.h.generic. We need the version that results
  278. # from a default configuration so as to get all the default values for PCRE
  279. # configuration macros such as MATCH_LIMIT and NEWLINE. We can get this by
  280. # doing a configure in a temporary directory. However, some trickery is needed,
  281. # because the source directory may already be configured. If you just try
  282. # running configure in a new directory, it complains. For this reason, we move
  283. # config.status out of the way while doing the default configuration. The
  284. # resulting config.h is munged by perl to put #ifdefs round any #defines for
  285. # macros with values, and to #undef all boolean macros such as HAVE_xxx and
  286. # SUPPORT_xxx. We also get rid of any gcc-specific visibility settings.
  287. src/config.h.generic: configure.ac
  288. rm -rf $@ _generic
  289. mkdir _generic
  290. cs=$(srcdir)/config.status; test ! -f $$cs || mv -f $$cs $$cs.aside
  291. cd _generic && $(abs_top_srcdir)/configure || :
  292. cs=$(srcdir)/config.status; test ! -f $$cs.aside || mv -f $$cs.aside $$cs
  293. test -f _generic/src/config.h
  294. perl -n \
  295. -e 'BEGIN{$$blank=0;}' \
  296. -e 'if(/(.+?)\s*__attribute__ \(\(visibility/){print"$$1\n";$$blank=0;next;}' \
  297. -e 'if(/LT_OBJDIR/){print"/* This is ignored unless you are using libtool. */\n";}' \
  298. -e 'if(/^#define\s((?:HAVE|SUPPORT|STDC)_\w+)/){print"/* #undef $$1 */\n";$$blank=0;next;}' \
  299. -e 'if(/^#define\s(?!PACKAGE|VERSION)(\w+)/){print"#ifndef $$1\n$$_#endif\n";$$blank=0;next;}' \
  300. -e 'if(/^\s*$$/){print unless $$blank; $$blank=1;} else{print;$$blank=0;}' \
  301. _generic/src/config.h >$@
  302. rm -rf _generic
  303. MAINTAINERCLEANFILES += src/pcre2.h.generic src/config.h.generic
  304. # These are the header files we'll install. We do not distribute pcre2.h
  305. # because it is generated from pcre2.h.in.
  306. nodist_include_HEADERS = src/pcre2.h
  307. include_HEADERS = src/pcre2posix.h
  308. # This is the "config" script.
  309. bin_SCRIPTS = pcre2-config
  310. ## ---------------------------------------------------------------
  311. ## The pcre2_dftables program is used to rebuild character tables before
  312. ## compiling PCRE2, if --enable-rebuild-chartables is specified. It is not an
  313. ## installed program. The default (when --enable-rebuild-chartables is not
  314. ## specified) is to copy a distributed set of tables that are defined for ASCII
  315. ## code. In this case, pcre2_dftables is not needed.
  316. if WITH_REBUILD_CHARTABLES
  317. noinst_PROGRAMS += pcre2_dftables
  318. pcre2_dftables_SOURCES = src/pcre2_dftables.c
  319. src/pcre2_chartables.c: pcre2_dftables$(EXEEXT)
  320. rm -f $@
  321. ./pcre2_dftables$(EXEEXT) $@
  322. else
  323. src/pcre2_chartables.c: $(srcdir)/src/pcre2_chartables.c.dist
  324. rm -f $@
  325. $(LN_S) $(abs_srcdir)/src/pcre2_chartables.c.dist $(abs_builddir)/src/pcre2_chartables.c
  326. endif # WITH_REBUILD_CHARTABLES
  327. BUILT_SOURCES = src/pcre2_chartables.c
  328. NODIST_SOURCES = src/pcre2_chartables.c
  329. ## Define the list of common sources, then arrange to build whichever of the
  330. ## 8-, 16-, or 32-bit libraries are configured.
  331. COMMON_SOURCES = \
  332. src/pcre2_auto_possess.c \
  333. src/pcre2_chkdint.c \
  334. src/pcre2_compile.c \
  335. src/pcre2_config.c \
  336. src/pcre2_context.c \
  337. src/pcre2_convert.c \
  338. src/pcre2_dfa_match.c \
  339. src/pcre2_error.c \
  340. src/pcre2_extuni.c \
  341. src/pcre2_find_bracket.c \
  342. src/pcre2_internal.h \
  343. src/pcre2_intmodedep.h \
  344. src/pcre2_jit_compile.c \
  345. src/pcre2_jit_neon_inc.h \
  346. src/pcre2_jit_simd_inc.h \
  347. src/pcre2_maketables.c \
  348. src/pcre2_match.c \
  349. src/pcre2_match_data.c \
  350. src/pcre2_newline.c \
  351. src/pcre2_ord2utf.c \
  352. src/pcre2_pattern_info.c \
  353. src/pcre2_script_run.c \
  354. src/pcre2_serialize.c \
  355. src/pcre2_string_utils.c \
  356. src/pcre2_study.c \
  357. src/pcre2_substitute.c \
  358. src/pcre2_substring.c \
  359. src/pcre2_tables.c \
  360. src/pcre2_ucd.c \
  361. src/pcre2_ucp.h \
  362. src/pcre2_valid_utf.c \
  363. src/pcre2_xclass.c
  364. # The pcre2_ucptables.c file is #included by pcre2_tables.c
  365. EXTRA_DIST += src/pcre2_ucptables.c
  366. if WITH_PCRE2_8
  367. lib_LTLIBRARIES += libpcre2-8.la
  368. libpcre2_8_la_SOURCES = \
  369. $(COMMON_SOURCES)
  370. nodist_libpcre2_8_la_SOURCES = \
  371. $(NODIST_SOURCES)
  372. libpcre2_8_la_CFLAGS = \
  373. -DPCRE2_CODE_UNIT_WIDTH=8 \
  374. $(VISIBILITY_CFLAGS) \
  375. $(CET_CFLAGS) \
  376. $(AM_CFLAGS)
  377. libpcre2_8_la_LIBADD =
  378. endif # WITH_PCRE2_8
  379. if WITH_PCRE2_16
  380. lib_LTLIBRARIES += libpcre2-16.la
  381. libpcre2_16_la_SOURCES = \
  382. $(COMMON_SOURCES)
  383. nodist_libpcre2_16_la_SOURCES = \
  384. $(NODIST_SOURCES)
  385. libpcre2_16_la_CFLAGS = \
  386. -DPCRE2_CODE_UNIT_WIDTH=16 \
  387. $(VISIBILITY_CFLAGS) \
  388. $(CET_CFLAGS) \
  389. $(AM_CFLAGS)
  390. libpcre2_16_la_LIBADD =
  391. endif # WITH_PCRE2_16
  392. if WITH_PCRE2_32
  393. lib_LTLIBRARIES += libpcre2-32.la
  394. libpcre2_32_la_SOURCES = \
  395. $(COMMON_SOURCES)
  396. nodist_libpcre2_32_la_SOURCES = \
  397. $(NODIST_SOURCES)
  398. libpcre2_32_la_CFLAGS = \
  399. -DPCRE2_CODE_UNIT_WIDTH=32 \
  400. $(VISIBILITY_CFLAGS) \
  401. $(CET_CFLAGS) \
  402. $(AM_CFLAGS)
  403. libpcre2_32_la_LIBADD =
  404. endif # WITH_PCRE2_32
  405. # The pcre2_chartables.c.dist file is the default version of
  406. # pcre2_chartables.c, used unless --enable-rebuild-chartables is specified.
  407. EXTRA_DIST += src/pcre2_chartables.c.dist
  408. CLEANFILES += src/pcre2_chartables.c
  409. # The JIT compiler lives in a separate directory, but its files are #included
  410. # when pcre2_jit_compile.c is processed, so they must be distributed.
  411. EXTRA_DIST += \
  412. src/sljit/sljitConfig.h \
  413. src/sljit/sljitConfigCPU.h \
  414. src/sljit/sljitConfigInternal.h \
  415. src/sljit/sljitLir.c \
  416. src/sljit/sljitLir.h \
  417. src/sljit/sljitNativeARM_32.c \
  418. src/sljit/sljitNativeARM_64.c \
  419. src/sljit/sljitNativeARM_T2_32.c \
  420. src/sljit/sljitNativeLOONGARCH_64.c \
  421. src/sljit/sljitNativeMIPS_32.c \
  422. src/sljit/sljitNativeMIPS_64.c \
  423. src/sljit/sljitNativeMIPS_common.c \
  424. src/sljit/sljitNativePPC_32.c \
  425. src/sljit/sljitNativePPC_64.c \
  426. src/sljit/sljitNativePPC_common.c \
  427. src/sljit/sljitNativeRISCV_32.c \
  428. src/sljit/sljitNativeRISCV_64.c \
  429. src/sljit/sljitNativeRISCV_common.c \
  430. src/sljit/sljitNativeS390X.c \
  431. src/sljit/sljitNativeX86_32.c \
  432. src/sljit/sljitNativeX86_64.c \
  433. src/sljit/sljitNativeX86_common.c \
  434. src/sljit/sljitSerialize.c \
  435. src/sljit/sljitUtils.c \
  436. src/sljit/allocator_src/sljitExecAllocatorApple.c \
  437. src/sljit/allocator_src/sljitExecAllocatorCore.c \
  438. src/sljit/allocator_src/sljitExecAllocatorFreeBSD.c \
  439. src/sljit/allocator_src/sljitExecAllocatorPosix.c \
  440. src/sljit/allocator_src/sljitExecAllocatorWindows.c \
  441. src/sljit/allocator_src/sljitProtExecAllocatorNetBSD.c \
  442. src/sljit/allocator_src/sljitProtExecAllocatorPosix.c \
  443. src/sljit/allocator_src/sljitWXExecAllocatorPosix.c \
  444. src/sljit/allocator_src/sljitWXExecAllocatorWindows.c
  445. # Some of the JIT sources are also in separate files that are #included.
  446. EXTRA_DIST += \
  447. src/pcre2_jit_match.c \
  448. src/pcre2_jit_misc.c
  449. if WITH_PCRE2_8
  450. libpcre2_8_la_LDFLAGS = $(EXTRA_LIBPCRE2_8_LDFLAGS)
  451. endif # WITH_PCRE2_8
  452. if WITH_PCRE2_16
  453. libpcre2_16_la_LDFLAGS = $(EXTRA_LIBPCRE2_16_LDFLAGS)
  454. endif # WITH_PCRE2_16
  455. if WITH_PCRE2_32
  456. libpcre2_32_la_LDFLAGS = $(EXTRA_LIBPCRE2_32_LDFLAGS)
  457. endif # WITH_PCRE2_32
  458. if WITH_VALGRIND
  459. if WITH_PCRE2_8
  460. libpcre2_8_la_CFLAGS += $(VALGRIND_CFLAGS)
  461. endif # WITH_PCRE2_8
  462. if WITH_PCRE2_16
  463. libpcre2_16_la_CFLAGS += $(VALGRIND_CFLAGS)
  464. endif # WITH_PCRE2_16
  465. if WITH_PCRE2_32
  466. libpcre2_32_la_CFLAGS += $(VALGRIND_CFLAGS)
  467. endif # WITH_PCRE2_32
  468. endif # WITH_VALGRIND
  469. if WITH_GCOV
  470. if WITH_PCRE2_8
  471. libpcre2_8_la_CFLAGS += $(GCOV_CFLAGS)
  472. endif # WITH_PCRE2_8
  473. if WITH_PCRE2_16
  474. libpcre2_16_la_CFLAGS += $(GCOV_CFLAGS)
  475. endif # WITH_PCRE2_16
  476. if WITH_PCRE2_32
  477. libpcre2_32_la_CFLAGS += $(GCOV_CFLAGS)
  478. endif # WITH_PCRE2_32
  479. endif # WITH_GCOV
  480. ## A version of the 8-bit library that has a POSIX API.
  481. if WITH_PCRE2_8
  482. lib_LTLIBRARIES += libpcre2-posix.la
  483. libpcre2_posix_la_SOURCES = src/pcre2posix.c
  484. libpcre2_posix_la_CFLAGS = \
  485. -DPCRE2_CODE_UNIT_WIDTH=8 @PCRE2POSIX_CFLAG@ \
  486. $(VISIBILITY_CFLAGS) $(AM_CFLAGS)
  487. libpcre2_posix_la_LDFLAGS = $(EXTRA_LIBPCRE2_POSIX_LDFLAGS)
  488. libpcre2_posix_la_LIBADD = libpcre2-8.la
  489. if WITH_GCOV
  490. libpcre2_posix_la_CFLAGS += $(GCOV_CFLAGS)
  491. endif # WITH_GCOV
  492. endif # WITH_PCRE2_8
  493. ## Build pcre2grep and optional fuzzer stuff if the 8-bit library is enabled
  494. if WITH_PCRE2_8
  495. bin_PROGRAMS += pcre2grep
  496. pcre2grep_SOURCES = src/pcre2grep.c
  497. pcre2grep_CFLAGS = $(AM_CFLAGS)
  498. pcre2grep_LDADD = $(LIBZ) $(LIBBZ2)
  499. pcre2grep_LDADD += libpcre2-8.la
  500. if WITH_GCOV
  501. pcre2grep_CFLAGS += $(GCOV_CFLAGS)
  502. pcre2grep_LDADD += $(GCOV_LIBS)
  503. endif # WITH_GCOV
  504. endif # WITH_PCRE2_8
  505. ## If fuzzer support is enabled, build a non-distributed library containing the
  506. ## fuzzing function. Also build the standalone checking binary from the same
  507. ## source but using -DSTANDALONE.
  508. if WITH_FUZZ_SUPPORT
  509. noinst_LIBRARIES =
  510. if WITH_PCRE2_8
  511. noinst_LIBRARIES += .libs/libpcre2-fuzzsupport.a
  512. _libs_libpcre2_fuzzsupport_a_SOURCES = src/pcre2_fuzzsupport.c
  513. _libs_libpcre2_fuzzsupport_a_CFLAGS = $(AM_CFLAGS)
  514. _libs_libpcre2_fuzzsupport_a_LIBADD =
  515. noinst_PROGRAMS += pcre2fuzzcheck-8
  516. pcre2fuzzcheck_8_SOURCES = src/pcre2_fuzzsupport.c
  517. pcre2fuzzcheck_8_CFLAGS = -DSTANDALONE $(AM_CFLAGS)
  518. pcre2fuzzcheck_8_LDADD = libpcre2-8.la
  519. if WITH_GCOV
  520. pcre2fuzzcheck_8_CFLAGS += $(GCOV_CFLAGS)
  521. pcre2fuzzcheck_8_LDADD += $(GCOV_LIBS)
  522. endif # WITH_GCOV
  523. endif # WITH_PCRE2_8
  524. if WITH_PCRE2_16
  525. noinst_LIBRARIES += .libs/libpcre2-fuzzsupport-16.a
  526. _libs_libpcre2_fuzzsupport_16_a_SOURCES = src/pcre2_fuzzsupport.c
  527. _libs_libpcre2_fuzzsupport_16_a_CFLAGS = $(AM_CFLAGS) -DPCRE2_CODE_UNIT_WIDTH=16
  528. _libs_libpcre2_fuzzsupport_16_a_LIBADD =
  529. noinst_PROGRAMS += pcre2fuzzcheck-16
  530. pcre2fuzzcheck_16_SOURCES = src/pcre2_fuzzsupport.c
  531. pcre2fuzzcheck_16_CFLAGS = -DSTANDALONE $(AM_CFLAGS) -DPCRE2_CODE_UNIT_WIDTH=16
  532. pcre2fuzzcheck_16_LDADD = libpcre2-16.la
  533. if WITH_GCOV
  534. pcre2fuzzcheck_16_CFLAGS += $(GCOV_CFLAGS)
  535. pcre2fuzzcheck_16_LDADD += $(GCOV_LIBS)
  536. endif # WITH_GCOV
  537. endif # WITH_PCRE2_16
  538. if WITH_PCRE2_32
  539. noinst_LIBRARIES += .libs/libpcre2-fuzzsupport-32.a
  540. _libs_libpcre2_fuzzsupport_32_a_SOURCES = src/pcre2_fuzzsupport.c
  541. _libs_libpcre2_fuzzsupport_32_a_CFLAGS = $(AM_CFLAGS) -DPCRE2_CODE_UNIT_WIDTH=32
  542. _libs_libpcre2_fuzzsupport_32_a_LIBADD =
  543. noinst_PROGRAMS += pcre2fuzzcheck-32
  544. pcre2fuzzcheck_32_SOURCES = src/pcre2_fuzzsupport.c
  545. pcre2fuzzcheck_32_CFLAGS = -DSTANDALONE $(AM_CFLAGS) -DPCRE2_CODE_UNIT_WIDTH=32
  546. pcre2fuzzcheck_32_LDADD = libpcre2-32.la
  547. if WITH_GCOV
  548. pcre2fuzzcheck_32_CFLAGS += $(GCOV_CFLAGS)
  549. pcre2fuzzcheck_32_LDADD += $(GCOV_LIBS)
  550. endif # WITH_GCOV
  551. endif # WITH_PCRE2_32
  552. endif # WITH_FUZZ_SUPPORT
  553. ## -------- Testing ----------
  554. ## If the 8-bit library is enabled, build the POSIX wrapper test program and
  555. ## arrange for it to run.
  556. if WITH_PCRE2_8
  557. TESTS += pcre2posix_test
  558. noinst_PROGRAMS += pcre2posix_test
  559. pcre2posix_test_SOURCES = src/pcre2posix_test.c
  560. pcre2posix_test_CFLAGS = $(AM_CFLAGS) @PCRE2POSIX_CFLAG@
  561. pcre2posix_test_LDADD = libpcre2-posix.la libpcre2-8.la
  562. endif # WITH_PCRE2_8
  563. ## If JIT support is enabled, arrange for the JIT test program to run.
  564. if WITH_JIT
  565. TESTS += pcre2_jit_test
  566. noinst_PROGRAMS += pcre2_jit_test
  567. pcre2_jit_test_SOURCES = src/pcre2_jit_test.c
  568. pcre2_jit_test_CFLAGS = $(AM_CFLAGS)
  569. pcre2_jit_test_LDADD =
  570. if WITH_PCRE2_8
  571. pcre2_jit_test_LDADD += libpcre2-8.la
  572. endif # WITH_PCRE2_8
  573. if WITH_PCRE2_16
  574. pcre2_jit_test_LDADD += libpcre2-16.la
  575. endif # WITH_PCRE2_16
  576. if WITH_PCRE2_32
  577. pcre2_jit_test_LDADD += libpcre2-32.la
  578. endif # WITH_PCRE2_32
  579. if WITH_GCOV
  580. pcre2_jit_test_CFLAGS += $(GCOV_CFLAGS)
  581. pcre2_jit_test_LDADD += $(GCOV_LIBS)
  582. endif # WITH_GCOV
  583. endif # WITH_JIT
  584. # Build the general pcre2test program. The file src/pcre2_printint.c is
  585. # #included by pcre2test as many times as needed, at different code unit
  586. # widths.
  587. bin_PROGRAMS += pcre2test
  588. EXTRA_DIST += src/pcre2_printint.c
  589. pcre2test_SOURCES = src/pcre2test.c
  590. pcre2test_CFLAGS = $(AM_CFLAGS)
  591. pcre2test_LDADD = $(LIBREADLINE)
  592. if WITH_PCRE2_8
  593. pcre2test_LDADD += libpcre2-8.la libpcre2-posix.la
  594. endif # WITH_PCRE2_8
  595. if WITH_PCRE2_16
  596. pcre2test_LDADD += libpcre2-16.la
  597. endif # WITH_PCRE2_16
  598. if WITH_PCRE2_32
  599. pcre2test_LDADD += libpcre2-32.la
  600. endif # WITH_PCRE2_32
  601. if WITH_VALGRIND
  602. pcre2test_CFLAGS += $(VALGRIND_CFLAGS)
  603. endif # WITH_VALGRIND
  604. if WITH_GCOV
  605. pcre2test_CFLAGS += $(GCOV_CFLAGS)
  606. pcre2test_LDADD += $(GCOV_LIBS)
  607. endif # WITH_GCOV
  608. ## The main library tests. Each test is a binary plus a script that runs that
  609. ## binary in various ways. We install these test binaries in case folks find it
  610. ## helpful. The two .bat files are for running the tests under Windows.
  611. TESTS += RunTest
  612. EXTRA_DIST += RunTest.bat
  613. dist_noinst_SCRIPTS += RunTest
  614. ## When the 8-bit library is configured, pcre2grep will have been built.
  615. if WITH_PCRE2_8
  616. TESTS += RunGrepTest
  617. EXTRA_DIST += RunGrepTest.bat
  618. dist_noinst_SCRIPTS += RunGrepTest
  619. endif # WITH_PCRE2_8
  620. ## Distribute all the test data files
  621. EXTRA_DIST += \
  622. testdata/grepbinary \
  623. testdata/grepfilelist \
  624. testdata/grepinput \
  625. testdata/grepinput3 \
  626. testdata/grepinput8 \
  627. testdata/grepinputC.bz2 \
  628. testdata/grepinputC.gz \
  629. testdata/grepinputM \
  630. testdata/grepinputv \
  631. testdata/grepinputx \
  632. testdata/greplist \
  633. testdata/grepnot.bz2 \
  634. testdata/grepoutput \
  635. testdata/grepoutput8 \
  636. testdata/grepoutputC \
  637. testdata/grepoutputCN \
  638. testdata/grepoutputCNU \
  639. testdata/grepoutputCU \
  640. testdata/grepoutputCbz2 \
  641. testdata/grepoutputCgz \
  642. testdata/grepoutputN \
  643. testdata/grepoutputUN \
  644. testdata/greppatN4 \
  645. testdata/testbtables \
  646. testdata/testinput1 \
  647. testdata/testinput2 \
  648. testdata/testinput3 \
  649. testdata/testinput4 \
  650. testdata/testinput5 \
  651. testdata/testinput6 \
  652. testdata/testinput7 \
  653. testdata/testinput8 \
  654. testdata/testinput9 \
  655. testdata/testinput10 \
  656. testdata/testinput11 \
  657. testdata/testinput12 \
  658. testdata/testinput13 \
  659. testdata/testinput14 \
  660. testdata/testinput15 \
  661. testdata/testinput16 \
  662. testdata/testinput17 \
  663. testdata/testinput18 \
  664. testdata/testinput19 \
  665. testdata/testinput20 \
  666. testdata/testinput21 \
  667. testdata/testinput22 \
  668. testdata/testinput23 \
  669. testdata/testinput24 \
  670. testdata/testinput25 \
  671. testdata/testinput26 \
  672. testdata/testinputEBC \
  673. testdata/testinputheap \
  674. testdata/testoutput1 \
  675. testdata/testoutput2 \
  676. testdata/testoutput3 \
  677. testdata/testoutput3A \
  678. testdata/testoutput3B \
  679. testdata/testoutput4 \
  680. testdata/testoutput5 \
  681. testdata/testoutput6 \
  682. testdata/testoutput7 \
  683. testdata/testoutput8-16-2 \
  684. testdata/testoutput8-16-3 \
  685. testdata/testoutput8-16-4 \
  686. testdata/testoutput8-32-2 \
  687. testdata/testoutput8-32-3 \
  688. testdata/testoutput8-32-4 \
  689. testdata/testoutput8-8-2 \
  690. testdata/testoutput8-8-3 \
  691. testdata/testoutput8-8-4 \
  692. testdata/testoutput9 \
  693. testdata/testoutput10 \
  694. testdata/testoutput11-16 \
  695. testdata/testoutput11-32 \
  696. testdata/testoutput12-16 \
  697. testdata/testoutput12-32 \
  698. testdata/testoutput13 \
  699. testdata/testoutput14-16 \
  700. testdata/testoutput14-32 \
  701. testdata/testoutput14-8 \
  702. testdata/testoutput15 \
  703. testdata/testoutput16 \
  704. testdata/testoutput17 \
  705. testdata/testoutput18 \
  706. testdata/testoutput19 \
  707. testdata/testoutput20 \
  708. testdata/testoutput21 \
  709. testdata/testoutput22-16 \
  710. testdata/testoutput22-32 \
  711. testdata/testoutput22-8 \
  712. testdata/testoutput23 \
  713. testdata/testoutput24 \
  714. testdata/testoutput25 \
  715. testdata/testoutput26 \
  716. testdata/testoutputEBC \
  717. testdata/testoutputheap-16 \
  718. testdata/testoutputheap-32 \
  719. testdata/testoutputheap-8 \
  720. testdata/valgrind-jit.supp \
  721. testdata/wintestinput3 \
  722. testdata/wintestoutput3 \
  723. perltest.sh
  724. # RunTest and RunGrepTest should clean up after themselves, but just in case
  725. # they don't, add their working files to CLEANFILES.
  726. CLEANFILES += \
  727. testSinput \
  728. test3input \
  729. test3output \
  730. test3outputA \
  731. test3outputB \
  732. testtry \
  733. teststdout \
  734. teststderr \
  735. teststderrgrep \
  736. testtemp1grep \
  737. testtemp2grep \
  738. testtrygrep \
  739. testNinputgrep
  740. ## ------------ End of testing -------------
  741. # PCRE2 demonstration program. Not built automatically. The point is that the
  742. # users should build it themselves. So just distribute the source.
  743. EXTRA_DIST += src/pcre2demo.c
  744. # We have .pc files for pkg-config users.
  745. pkgconfigdir = $(libdir)/pkgconfig
  746. pkgconfig_DATA =
  747. if WITH_PCRE2_8
  748. pkgconfig_DATA += libpcre2-8.pc libpcre2-posix.pc
  749. endif
  750. if WITH_PCRE2_16
  751. pkgconfig_DATA += libpcre2-16.pc
  752. endif
  753. if WITH_PCRE2_32
  754. pkgconfig_DATA += libpcre2-32.pc
  755. endif
  756. # gcov/lcov code coverage reporting
  757. #
  758. # Coverage reporting targets:
  759. #
  760. # coverage: Create a coverage report from 'make check'
  761. # coverage-baseline: Capture baseline coverage information
  762. # coverage-reset: This zeros the coverage counters only
  763. # coverage-report: This creates the coverage report only
  764. # coverage-clean-report: This removes the generated coverage report
  765. # without cleaning the coverage data itself
  766. # coverage-clean-data: This removes the captured coverage data without
  767. # removing the coverage files created at compile time (*.gcno)
  768. # coverage-clean: This cleans all coverage data including the generated
  769. # coverage report.
  770. if WITH_GCOV
  771. COVERAGE_TEST_NAME = $(PACKAGE)
  772. COVERAGE_NAME = $(PACKAGE)-$(VERSION)
  773. COVERAGE_OUTPUT_FILE = $(COVERAGE_NAME)-coverage.info
  774. COVERAGE_OUTPUT_DIR = $(COVERAGE_NAME)-coverage
  775. COVERAGE_LCOV_EXTRA_FLAGS =
  776. COVERAGE_GENHTML_EXTRA_FLAGS =
  777. coverage_quiet = $(coverage_quiet_$(V))
  778. coverage_quiet_ = $(coverage_quiet_$(AM_DEFAULT_VERBOSITY))
  779. coverage_quiet_0 = --quiet
  780. coverage-check: all
  781. -$(MAKE) $(AM_MAKEFLAGS) -k check
  782. coverage-baseline:
  783. $(LCOV) $(coverage_quiet) \
  784. --directory $(top_builddir) \
  785. --output-file "$(COVERAGE_OUTPUT_FILE)" \
  786. --capture \
  787. --initial
  788. coverage-report:
  789. $(LCOV) $(coverage_quiet) \
  790. --directory $(top_builddir) \
  791. --capture \
  792. --output-file "$(COVERAGE_OUTPUT_FILE).tmp" \
  793. --test-name "$(COVERAGE_TEST_NAME)" \
  794. --no-checksum \
  795. --compat-libtool \
  796. $(COVERAGE_LCOV_EXTRA_FLAGS)
  797. $(LCOV) $(coverage_quiet) \
  798. --directory $(top_builddir) \
  799. --output-file "$(COVERAGE_OUTPUT_FILE)" \
  800. --remove "$(COVERAGE_OUTPUT_FILE).tmp" \
  801. "/tmp/*" \
  802. "/usr/include/*" \
  803. "$(includedir)/*"
  804. -@rm -f "$(COVERAGE_OUTPUT_FILE).tmp"
  805. LANG=C $(GENHTML) $(coverage_quiet) \
  806. --prefix $(top_builddir) \
  807. --output-directory "$(COVERAGE_OUTPUT_DIR)" \
  808. --title "$(PACKAGE) $(VERSION) Code Coverage Report" \
  809. --show-details "$(COVERAGE_OUTPUT_FILE)" \
  810. --legend \
  811. $(COVERAGE_GENHTML_EXTRA_FLAGS)
  812. @echo "Code coverage report written to file://$(abs_builddir)/$(COVERAGE_OUTPUT_DIR)/index.html"
  813. coverage-reset:
  814. -$(LCOV) $(coverage_quiet) --zerocounters --directory $(top_builddir)
  815. coverage-clean-report:
  816. -rm -f "$(COVERAGE_OUTPUT_FILE)" "$(COVERAGE_OUTPUT_FILE).tmp"
  817. -rm -rf "$(COVERAGE_OUTPUT_DIR)"
  818. coverage-clean-data:
  819. -find $(top_builddir) -name "*.gcda" -delete
  820. coverage-clean: coverage-reset coverage-clean-report coverage-clean-data
  821. -find $(top_builddir) -name "*.gcno" -delete
  822. coverage-distclean: coverage-clean
  823. coverage: coverage-reset coverage-baseline coverage-check coverage-report
  824. clean-local: coverage-clean
  825. distclean-local: coverage-distclean
  826. .PHONY: coverage coverage-baseline coverage-check coverage-report coverage-reset coverage-clean-report coverage-clean-data coverage-clean coverage-distclean
  827. # Without coverage support, still arrange for 'make distclean' to get rid of
  828. # any coverage files that may have been left from a different configuration.
  829. else
  830. coverage:
  831. @echo "Configuring with --enable-coverage is required to generate code coverage report."
  832. DISTCLEANFILES += src/*.gcda src/*.gcno
  833. distclean-local:
  834. rm -rf $(PACKAGE)-$(VERSION)-coverage*
  835. endif # WITH_GCOV
  836. ## CMake support
  837. EXTRA_DIST += \
  838. cmake/COPYING-CMAKE-SCRIPTS \
  839. cmake/FindEditline.cmake \
  840. cmake/FindPackageHandleStandardArgs.cmake \
  841. cmake/FindReadline.cmake \
  842. cmake/pcre2-config-version.cmake.in \
  843. cmake/pcre2-config.cmake.in \
  844. CMakeLists.txt \
  845. config-cmake.h.in
  846. ## end Makefile.am