8 MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/${PORTVERSION} \
9 ftp://ftp.csx.cam.ac.uk/pub/software/programming/${PORTNAME}/ \
10 ftp://ftp.fu-berlin.de/unix/misc/${PORTNAME}/ \
11 ftp://ftp.tin.org/pub/libs/${PORTNAME}/
13 MAINTAINER= bf@FreeBSD.org
14 COMMENT= Perl Compatible Regular Expressions library
17 LICENSE_FILE= ${WRKSRC}/LICENCE
20 USES= libtool pathfix tar:bzip2
22 CONFIGURE_ARGS= --enable-utf --enable-unicode-properties \
23 --enable-pcre8 --enable-pcre16 --enable-pcre32
24 INSTALL_TARGET= install-strip
26 OPTIONS_DEFINE= DOCS STACK_RECURSION
27 OPTIONS_DEFAULT= STACK_RECURSION
29 OPTIONS_RADIO_CLI= LIBEDIT READLINE
31 STACK_RECURSION_DESC= Use the stack for recursion during matching
33 LIBEDIT_CONFIGURE_ENABLE= pcretest-libedit
36 READLINE_USES= readline
37 READLINE_CONFIGURE_ENABLE= pcretest-libreadline
39 .include <bsd.port.options.mk>
41 .if ${ARCH} != "sparc64" && ${ARCH} != "ia64" && ${ARCH:Mmips64*} == ""
42 CONFIGURE_ARGS+= --enable-jit
44 CONFIGURE_ARGS+= --disable-jit
47 .if ${PORT_OPTIONS:MDOCS}
51 # Using the heap rather than the stack for recursion is slower but less
52 # prone to segfaults from stack exhaustion when matching certain patterns
53 .if !${PORT_OPTIONS:MSTACK_RECURSION}
54 CONFIGURE_ARGS+= --disable-stack-for-recursion
57 # Optional knobs that accept positive integer parameters (see pcrebuild(3)):
59 # Allow the use of very large patterns (> 64K) with the 8- and 16-bit
60 # libraries, at the expense of longer load times (possible values:
61 # 2 (default), 3, and 4):
62 .if defined(WITH_LINK_SIZE)
63 CONFIGURE_ARGS+= --with-link-size=${WITH_LINK_SIZE}
66 # Control PCRE resource use by limiting the default number of times pcre_exec()
67 # can call match() during a single operation (default: 10 million):
68 .if defined(WITH_MATCH_LIMIT)
69 CONFIGURE_ARGS+= --with-match-limit=${WITH_MATCH_LIMIT}
72 # Control PCRE resource use by limiting the default number of times pcre_exec()
73 # can call match() recursively during a single operation (default: 10 million):
74 .if defined(WITH_MATCH_LIMIT_RECURSION)
75 CONFIGURE_ARGS+= --with-match-limit-recursion=${WITH_MATCH_LIMIT_RECURSION}
78 # Control PCRE resource use by limiting the nesting depth of parentheses in
79 # patterns compiled with pcre_compile() (default: 250):
80 .if defined(WITH_PARENS_NEST_LIMIT)
81 CONFIGURE_ARGS+= --with-parens-nest-limit=${WITH_PARENS_NEST_LIMIT}
84 # Adjust the default maximum number of substrings that will be stored on the stack
85 # when the 8-bit library is called via the POSIX interface (default: 10):
86 .if defined(WITH_POSIX_MALLOC_THRESHOLD)
87 CONFIGURE_ARGS+= --with-posix-malloc-threshold=${WITH_POSIX_MALLOC_THRESHOLD}
91 @${REINPLACE_CMD} -e "/^\.rs/d" ${WRKSRC}/doc/*.3 ${WRKSRC}/doc/*.1
92 @${REINPLACE_CMD} -e "s/£//g" ${WRKSRC}/doc/pcre_compile2.3
93 .if !${PORT_OPTIONS:MDOCS}
94 @${REINPLACE_CMD} -E -e '/^install-data-am/,/^$$/ s,install-(dist_doc|dist_html|html)DATA,,g' \
98 #prevent regression test coredumps from causing failures on the
99 #package-building cluster:
100 .ifndef(MAINTAINER_MODE)
101 CORELIMIT?= /usr/bin/limits -Sc 0
103 TESTLOGS?= RunGrepTest RunTest pcre_jit_test pcre_scanner_unittest \
104 pcre_stringpiece_unittest pcrecpp_unittest
107 ${LN} -s libpcre.so.1 ${STAGEDIR}${PREFIX}/lib/libpcre.so.3
109 check regression-test test: build
111 ${SETENV} ${MAKE_ENV} ${CORELIMIT} ${MAKE_CMD} ${MAKE_ARGS} check ; \
112 for _l in ${TESTLOGS} ; do if ${TEST} -f $${_l}.log ; then \
113 ${PRINTF} "\n\n$${_l}.log\n\n\n" ; ${CAT} $${_l}.log ; fi ; done
115 .include <bsd.port.mk>