Subject: Re: [RFC/PATCH] Update compat/regex

From: Paolo Bonzini <[email-masked]>
Date: Mon, 16 Aug 2010 14:26:55 +0200

On 08/15/2010 01:08 PM, Ævar Arnfjörð Bjarmason wrote:
> On Fri, Jul 16, 2010 at 14:17, Andreas Schwab<[email-masked]>  wrote:
>> Ævar Arnfjörð Bjarmason<[email-masked]>  writes:
>>
>>> This patch has all the glibc-specific stuff that makes it break hard
>>> if you don't have the GNU C library. Writing macros/definitions to fix all that
>>> stuff up was the "easier said than done" part I was referring to.
>>
>> You might want to try out the gnulib version instead.
>
> I fiddled a bit with gnulib for both the regex engine and libintl, but
> I can't get it to do what I want.
>
> The assumption with gnulib seems to be that you're including the
> libraries in a GNU program that only uses the autotools, it seems to
> be about as easy to just copy/paste things from glibc if you're adding
> libraries to a program like Git that uses its own build system.

Andreas is right, the glibc code is not meant to be portable.

It is really simpler if you start from the version in gnulib, which is 
the one that is included in most GNU packages nowadays.  You should 
download GNU grep 2.6.x and (starting from lib/reg*) add headers from 
its lib/ directory until it compiles.

Alternatively try out gawk, as it does not use gnulib but has the same 
set of sanitizations.

Paolo