1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit eutils multilib libtool flag-o-matic toolchain-funcs multilib-minimal
8 DESCRIPTION="Perl-compatible regular expression library"
9 HOMEPAGE="http://www.pcre.org/"
10 MY_P="pcre-${PV/_rc/-RC}"
11 if [[ ${PV} != *_rc* ]] ; then
12 # Only the final releases are available here.
13 SRC_URI="mirror://sourceforge/pcre/${MY_P}.tar.bz2
14 ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/${MY_P}.tar.bz2"
16 SRC_URI="ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/Testing/${MY_P}.tar.bz2"
21 KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
22 IUSE="bzip2 +cxx +jit libedit pcre16 pcre32 +readline +recursion-limit static-libs unicode zlib"
23 REQUIRED_USE="readline? ( !libedit )
24 libedit? ( !readline )"
27 bzip2? ( app-arch/bzip2 )
28 zlib? ( sys-libs/zlib )
29 libedit? ( dev-libs/libedit )
30 readline? ( sys-libs/readline:0= )
39 !<=app-emulation/emul-linux-x86-baselibs-20131008-r2
40 !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
44 S="${WORKDIR}/${MY_P}"
46 MULTILIB_CHOST_TOOLS=(
51 "${FILESDIR}"/${PN}-8.41-sljit_mips-label-statement-fix.patch
55 epatch "${PATCHES[@]}"
56 sed -i -e "s:-lpcre ::" libpcrecpp.pc.in || die
60 multilib_src_configure() {
62 --with-match-limit-recursion=$(usex recursion-limit 8192 MATCH_LIMIT)
63 $(multilib_native_use_enable bzip2 pcregrep-libbz2)
65 $(use_enable jit) $(use_enable jit pcregrep-jit)
68 $(multilib_native_use_enable libedit pcretest-libedit)
69 $(multilib_native_use_enable readline pcretest-libreadline)
70 $(use_enable static-libs static)
71 $(use_enable unicode utf) $(use_enable unicode unicode-properties)
72 $(multilib_native_use_enable zlib pcregrep-libz)
75 --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html
76 --docdir="${EPREFIX}"/usr/share/doc/${PF}
78 ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
81 multilib_src_compile() {
82 emake V=1 $(multilib_is_native_abi || echo "bin_PROGRAMS=")
85 multilib_src_install() {
88 $(multilib_is_native_abi || echo "bin_PROGRAMS= dist_html_DATA=") \
90 gen_usr_ldscript -a pcre
93 multilib_src_install_all() {
98 preserve_old_lib /$(get_libdir)/libpcre.so.0
102 preserve_old_lib_notify /$(get_libdir)/libpcre.so.0