nginx-0.0.3-2004-04-08-19:58:25 import
diff --git a/auto/lib/md5/conf b/auto/lib/md5/conf
index d5b2a0a..8871038 100644
--- a/auto/lib/md5/conf
+++ b/auto/lib/md5/conf
@@ -40,57 +40,59 @@
 
 else
 
-ngx_lib_inc="#include <sys/types.h>
+    if [ $PLATFORM != win32 ]; then
+            MD5=NO
+
+            # Solaris 8/9
+
+            ngx_lib_inc="#include <sys/types.h>
 #include <md5.h>"
-
-    MD5=NO
-
-    # Solaris 8/9
-
-    ngx_lib="rsaref md5"
-    ngx_lib_test="MD5_CTX md5; MD5Init(&md5)"
-    ngx_libs=-lmd5
-    . auto/lib/test
+            ngx_lib="rsaref md5 library"
+            ngx_lib_test="MD5_CTX md5; MD5Init(&md5)"
+            ngx_libs=-lmd5
+            . auto/lib/test
 
 
-    if [ $ngx_found = yes ]; then
-        CORE_LIBS="$CORE_LIBS $ngx_libs"
-        MD5=YES
-        MD5_LIB=md5
-        ngx_found=no
+        if [ $ngx_found = yes ]; then
+            CORE_LIBS="$CORE_LIBS $ngx_libs"
+            MD5=YES
+            MD5_LIB=md5
+            ngx_found=no
 
-    else
-        # FreeBSD
+        else
+            # FreeBSD
 
-        ngx_lib="rsaref md"
-        ngx_lib_test="MD5_CTX md5; MD5Init(&md5)"
-        ngx_libs=-lmd
-        . auto/lib/test
+            ngx_lib="rsaref md library"
+            ngx_lib_test="MD5_CTX md5; MD5Init(&md5)"
+            ngx_libs=-lmd
+            . auto/lib/test
+        fi
+
+
+        if [ $ngx_found = yes ]; then
+            CORE_LIBS="$CORE_LIBS $ngx_libs"
+            MD5=YES
+            MD5_LIB=md
+            ngx_found=no
+
+        else
+            # OpenSSL crypto library
+
+            ngx_inc="#include <openssl/md5.h>"
+            ngx_lib="OpenSSL md5 crypto library"
+            ngx_lib_test="MD5_CTX md5; MD5_Init(&md5)"
+            ngx_libs=-lcrypto
+            . auto/lib/test
+        fi
+
+
+        if [ $ngx_found = yes ]; then
+            have=HAVE_OPENSSL_MD5 . auto/have
+            have=HAVE_OPENSSL_MD5_H . auto/have
+            CORE_LIBS="$CORE_LIBS $ngx_libs"
+            MD5=YES
+            MD5_LIB=crypto
+        fi
     fi
 
-
-    if [ $ngx_found = yes ]; then
-        CORE_LIBS="$CORE_LIBS $ngx_libs"
-        MD5=YES
-        MD5_LIB=md
-        ngx_found=no
-
-    else
-        # OpenSSL crypto library
-
-        ngx_inc="#include <openssl/md5.h>"
-        ngx_lib="OpenSSL md5 crypto"
-        ngx_lib_test="MD5_CTX md5; MD5_Init(&md5)"
-        ngx_libs=-lcrypto
-        . auto/lib/test
-    fi
-
-
-    if [ $ngx_found = yes ]; then
-        have=HAVE_OPENSSL_MD5 . auto/have
-        have=HAVE_OPENSSL_MD5_H . auto/have
-        CORE_LIBS="$CORE_LIBS $ngx_libs"
-        MD5=YES
-        MD5_LIB=crypto
-    fi
 fi
diff --git a/auto/lib/pcre/conf b/auto/lib/pcre/conf
index fa50c24..a907e8b 100644
--- a/auto/lib/pcre/conf
+++ b/auto/lib/pcre/conf
@@ -40,24 +40,38 @@
 else
 
     if [ $PLATFORM != win32 ]; then
-        ngx_lib_inc="#include <pcre.h>"
+            PCRE=NO
 
-        ngx_lib="PCRE"
-        ngx_lib_test="pcre *re; pcre_compile(re, 0, NULL, 0, NULL)"
-        ngx_libs=-lpcre
-        . auto/lib/test
+            ngx_lib_inc="#include <pcre.h>"
+            ngx_lib="PCRE library"
+            ngx_lib_test="pcre *re; pcre_compile(re, 0, NULL, 0, NULL)"
+            ngx_libs=-lpcre
+            . auto/lib/test
 
 
         if [ $ngx_found = yes ]; then
             have=HAVE_PCRE . auto/have
-
             CORE_DEPS="$CORE_DEPS $REGEX_DEPS"
             CORE_SRCS="$CORE_SRCS $REGEX_SRCS"
             CORE_LIBS="$CORE_LIBS $ngx_libs"
-
             PCRE=YES
+
         else
-            PCRE=NO
+            # FreeBSD PCRE port.
+
+            ngx_lib="PCRE library in /usr/local/"
+            ngx_lib_cflags="-I /usr/local/include"
+            . auto/lib/test
+        fi
+
+
+        if [ $ngx_found = yes ]; then
+            have=HAVE_PCRE . auto/have
+            CORE_DEPS="$CORE_DEPS $REGEX_DEPS"
+            CORE_INCS="$CORE_INCS /usr/local/include"
+            CORE_SRCS="$CORE_SRCS $REGEX_SRCS"
+            CORE_LIBS="$CORE_LIBS $ngx_libs"
+            PCRE=YES
         fi
     fi
 
diff --git a/auto/lib/test b/auto/lib/test
index d030655..3519a6c 100644
--- a/auto/lib/test
+++ b/auto/lib/test
@@ -1,5 +1,5 @@
 
-echo $ngx_n "checking for $ngx_lib library ..." $ngx_c
+echo $ngx_n "checking for $ngx_lib ..." $ngx_c
 echo >> $NGX_ERR
 echo "checking for $ngx_lib library" >> $NGX_ERR
 
@@ -8,7 +8,8 @@
 echo "$ngx_lib_inc" > $NGX_AUTOTEST.c
 echo "int main() { $ngx_lib_test; return 0; }" >> $NGX_AUTOTEST.c
 
-eval "$CC $cc_test_flags -o $NGX_AUTOTEST $NGX_AUTOTEST.c $ngx_libs \
+eval "$CC $cc_test_flags $ngx_lib_cflags \
+     -o $NGX_AUTOTEST $NGX_AUTOTEST.c $ngx_libs \
      >> $NGX_ERR 2>&1"
 
 if [ -x $NGX_AUTOTEST ]; then
diff --git a/auto/lib/zlib/conf b/auto/lib/zlib/conf
index 7376abd..9c2178f 100644
--- a/auto/lib/zlib/conf
+++ b/auto/lib/zlib/conf
@@ -34,19 +34,21 @@
 
 else
 
-    ngx_lib_inc="#include <zlib.h>"
+    if [ $PLATFORM != win32 ]; then
+        ngx_lib_inc="#include <zlib.h>"
 
-    ngx_lib="zlib"
-    ngx_lib_test="z_stream z; deflate(&z, Z_NO_FLUSH)"
-    ngx_libs=-lz
-    . auto/lib/test
+        ngx_lib="zlib library"
+        ngx_lib_test="z_stream z; deflate(&z, Z_NO_FLUSH)"
+        ngx_libs=-lz
+        . auto/lib/test
 
 
-    if [ $ngx_found = yes ]; then
-        CORE_LIBS="$CORE_LIBS $ngx_libs"
-        ZLIB=YES
-    else
-        ZLIB=NO
+        if [ $ngx_found = yes ]; then
+            CORE_LIBS="$CORE_LIBS $ngx_libs"
+            ZLIB=YES
+        else
+            ZLIB=NO
+        fi
     fi
 
 fi