[PATCH] Fix PCRE detection on OSX.

Ruslan Ermilov ru at nginx.com
Fri Dec 7 22:21:29 UTC 2012

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.


But why should nginx care to "fix" this?

I think
    configure --with-cc-opt="-L/usr/local/lib -I/usr/local/include"
should help survive with broken build tools even if you install
your stuff into /usr/local.

More information about the nginx-devel mailing list