Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] Fix PCRE detection on OSX.

Matthieu Tourne
December 07, 2012 06:02PM
On Fri, Dec 7, 2012 at 2:21 PM, Ruslan Ermilov <ru@nginx.com> wrote:

> On Fri, Dec 07, 2012 at 12:24:49PM -0800, Piotr Sikora wrote:
> > Fix PCRE detection on OSX.
> >
> > OSX ships with PCRE library in /usr, but without headers for it.
> >
> > OSX default search paths includes both /usr and /usr/local, which
> > results in library (from /usr) and headers (from /usr/include)
> > mismatch when PCRE is installed via Homebrew and we try to compile
> > nginx without "-L/usr/local" parameter.
> >
> > The solution is to skip the detection using default search paths
> > on OSX and let ./configure script detect PCRE installed in /usr/local
> > or other common prefixes.
>
> OS X is known to be broken in that respect. That's why MacPorts
> installs stuff into /opt/local by default, instead of /usr/local.
>
> https://trac.macports.org/wiki/FAQ#defaultprefix
> https://trac.macports.org/wiki/FAQ#usrlocal
>
> But why should nginx care to "fix" this?


They don't, but there is already an exception line in the auto/conf for #
Macports, and adding a bit more just makes it easier for people using the
other concurrent (and newer) system of packages on Mac OS: Homebrew.

Actually it's worse than that.
When using homebrew the included pcre.h looks like it will support
PCRE_JIT, but the library used for the link doesn't export those symbols.
It results in a bad linking error, which might throw off some users that
have no idea why this is happening ..

I don't really have a way to fix Mac OS, or homebrew. But we can help
making sure Nginx will compile everywhere.

An alternative is to specifically look for PCRE_JIT functions, and test if
the linking will work (see example below), and either throw off an error at
../configure time, or add some exceptions.
And I believe this stays in the style of Nginx to handle "exotic" systems.

Regards,
Matthieu.



Config example for PCRE_JIT detection :

# Check version of PCRE to turn on PCRE_JIT

ngx_feature="PCRE_JIT capable PCRE library"
ngx_feature_name="NGX_PCRE"
ngx_feature_run=no
ngx_feature_incs="#include <pcre.h>"
ngx_feature_path=
ngx_feature_libs="-lpcre"
ngx_feature_test="
/* PCRE_JIT starts after 8.21 */
#if (PCRE_MAJOR > 8) || (PCRE_MAJOR == 8 && PCRE_MINOR >= 21)
printf(\"%p\", pcre_free_study);
#endif
"
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] Fix PCRE detection on OSX.

Piotr Sikora 1101 December 07, 2012 03:26PM

Re: [PATCH] Fix PCRE detection on OSX.

Ruslan Ermilov 437 December 07, 2012 05:22PM

Re: [PATCH] Fix PCRE detection on OSX.

Piotr Sikora 408 December 07, 2012 05:54PM

Re: [PATCH] Fix PCRE detection on OSX.

Tom van der Woerdt 498 December 07, 2012 06:06PM

Re: [PATCH] Fix PCRE detection on OSX.

Piotr Sikora 456 December 07, 2012 06:16PM

Re: [PATCH] Fix PCRE detection on OSX.

Ruslan Ermilov 416 December 08, 2012 12:26AM

Re: [PATCH] Fix PCRE detection on OSX.

Matthieu Tourne 424 December 08, 2012 01:34AM

Re: [PATCH] Fix PCRE detection on OSX.

Piotr Sikora 415 December 08, 2012 02:02AM

Re: [PATCH] Fix PCRE detection on OSX.

Maxim Dounin 756 December 09, 2012 09:38PM

Re: [PATCH] Fix PCRE detection on OSX.

Ruslan Ermilov 573 December 10, 2012 05:32AM

Re: [PATCH] Fix PCRE detection on OSX.

Maxim Dounin 456 December 10, 2012 09:52AM

Re: [PATCH] Fix PCRE detection on OSX.

Ruslan Ermilov 444 December 10, 2012 10:08AM

Re: [PATCH] Fix PCRE detection on OSX.

Piotr Sikora 424 December 11, 2012 03:20AM

Re: [PATCH] Fix PCRE detection on OSX.

Maxim Dounin 548 December 12, 2012 06:06AM

Re: [PATCH] Fix PCRE detection on OSX.

Matthieu Tourne 413 December 07, 2012 06:02PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 138
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready