Re: [pcre-dev] [PATCH] fix cross compiling

Top Page
Delete this message
Author: Raphaël HUCK
Date:  
To: pcre-dev
Subject: Re: [pcre-dev] [PATCH] fix cross compiling
Le Wed, 2 Nov 2011 16:16:31 +0000 (GMT),
Philip Hazel <ph10@???> a écrit :

> On Wed, 2 Nov 2011, Raphaël HUCK wrote:
>
> > this patch fixes cross compiling and has been used for 6 years in
> > OpenWrt:
> >
> > https://dev.openwrt.org/browser/trunk/openwrt/package/pcre/patches/750-pcre_config_cross.patch?rev=1864
> >
> > Would you consider integrating it into PCRE?
>
> It seems that your patch removes the output -L/usr/lib from the line
> output by the command "pcre-config --libs".


Yes, as it is causing problems for cross compilation, and also on
systems with 32-bit and 64-bit libraries, as Petr said.

Anyway, it is in the default search path, so there's no need to specify
it explicitly.

> I've just looked at a
> number of x-config commands, and there doesn't seem to be any
> consistency. Some of them have -L/usr/lib and some of them do not.


I've checked on my machine, 7 of x-config commands include
-L/lib/x86_64-linux-gnu, 2 of them include -L/usr/lib and 9 of them
don't include any -L. So it's true that there doesn't seem to be any
consistency :(

> Presumably it is the presence of this that causes you trouble?
>
> Does anybody on this list care to comment as to whether it is
> currently best practice to include -L/usr/lib or to omit it?


The best practice is to use pkg-config instead of a custom x-config.

As for x-config scripts, it seems to be better to omit -L/usr/lib:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=101391

Fix freetype-config to not add -L/usr/lib

http://www.opensource.apple.com/source/X11misc/X11misc-20/pkg-config/pkg-config-0.25/ChangeLog

pkg-config.in: remove -I/usr/include and -L/usr/lib from the flags we
output

http://updates.msiu.ru/pack/changelog/others73//curl-7.10.4-1.src.rpm.txt

Stop the curl-config script from printing -I/usr/include and
-L/usr/lib (#59497)

http://opensource.apple.com/source/neon/neon-13/neon/ChangeLog.CVS

neon-config.in (libs): Don't print -L/usr/lib or -L/lib


Thanks for your quick reply!

-Raphaël