Re: [pcre-dev] Are there any examples of minimal embedded pc…

Top Page

Reply to this message
Author: Ævar Arnfjörð Bjarmason
Date:  
To: pcre-dev, Philip Hazel
Subject: Re: [pcre-dev] Are there any examples of minimal embedded pcre (v2)?
On Sat, May 6, 2017 at 7:33 PM, <ph10@???> wrote:
> On Fri, 5 May 2017, Ævar Arnfjörð Bjarmason via Pcre-dev wrote:
>
>> I'm looking into copying the pcre v2 sources into git.git as a way to
>> appease people that mind the dependency, i.e. having to package pcre
>> v2 themselves. They could then build with GIMME_YOUR_LIBPCRE2=Y or
>> something.
>
>> The only project doing that which I could think of was php, but they
>> copy the entire pcre sources, I was hoping for something more minimal.
>> I.e. just a copy of the relevant *.[ch] files with a minimal config.h.
>
> A comment:
>
> I originally wrote PCRE for use with Exim, and in the early days it was
> bundled with Exim in exactly the way you describe. However, after some
> years PCRE became pretty standard in many distributions, and maintaining
> the relevant files and keeping up with PCRE changes was just too much of
> a chore, so we stopped doing it. This was all a long time ago, because
> it's now nearly 10 years since I retired and gave up working on Exim
> altogether.
>
> PCRE2 has been out for over 2 years now, and it is finding its way into
> the distributions, but I don't know how widespread it is yet (it's in
> Arch Linux, which I use).
>
> But it's your call, of course!


I'm still linking to the system-installed library as the primary
option, I just wanted to give users who are on odd systems that don't
have that package the chance to just set a flag & have PCRE be built
as part of the program.

I hacked up a small shellscript to copy over the relevant pcre sources:

https://github.com/avar/git/blob/tag-avar/grep-and-pcre-and-more-sent-to-pcre-dev-ml/compat/pcre2/get-pcre2.sh#L1

And then manually defined the config.h content I needed:

https://github.com/avar/git/blob/tag-avar/grep-and-pcre-and-more-sent-to-pcre-dev-ml/Makefile#L1509

Mainly posting this in case anyone else has the same issue in the
future & wants to re-use this.