[PATCH] Fix PCRE detection on OSX.

Piotr Sikora piotr at cloudflare.com
Fri Dec 7 20:24:49 UTC 2012


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.

Signed-off-by: Piotr Sikora <piotr at cloudflare.com>
---
 auto/lib/pcre/conf | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/auto/lib/pcre/conf b/auto/lib/pcre/conf
index 6a8c326..bc3bc56 100644
--- a/auto/lib/pcre/conf
+++ b/auto/lib/pcre/conf
@@ -101,7 +101,12 @@ else
         ngx_feature_test="pcre *re;
                           re = pcre_compile(NULL, 0, NULL, 0, NULL);
                           if (re == NULL) return 1"
-        . auto/feature
+
+        if [ "$NGX_SYSTEM" = "Darwin" ]; then
+            ngx_found=no
+        else
+            . auto/feature
+        fi

         if [ $ngx_found = no ]; then

-- 
1.8.0.1



More information about the nginx-devel mailing list