nginx-0.3.54-RELEASE import

    *) Feature: nginx now logs the subrequest information to the error log.

    *) Feature: the "proxy_next_upstream", "fastcgi_next_upstream", and
       "memcached_next_upstream" directives support the "off" parameter.

    *) Feature: the "debug_connection" directive supports the CIDR address
       form.

    *) Bugfix: if a response of proxied server or FastCGI server was
       converted from UTF-8 or back, then it may be transferred incomplete.

    *) Bugfix: the $upstream_response_time variable had the time of the
       first request to a backend only.

    *) Bugfix: nginx could not be built on amd64 platform; the bug had
       appeared in 0.3.53.
diff --git a/auto/make b/auto/make
index 346770a..4a2cd0c 100644
--- a/auto/make
+++ b/auto/make
@@ -150,10 +150,10 @@
 done
 
 ngx_all_objs=`echo $ngx_all_srcs \
-    | sed -e "s/\([^ ]*\.\)cpp/$NGX_OBJS\/\1$ngx_objext/g" \
-          -e "s/\([^ ]*\.\)cc/$NGX_OBJS\/\1$ngx_objext/g" \
-          -e "s/\([^ ]*\.\)c/$NGX_OBJS\/\1$ngx_objext/g" \
-          -e "s/\([^ ]*\.\)S/$NGX_OBJS\/\1$ngx_objext/g"`
+    | sed -e "s#\([^ ]*\.\)cpp#$NGX_OBJS\/\1$ngx_objext#g" \
+          -e "s#\([^ ]*\.\)cc#$NGX_OBJS\/\1$ngx_objext#g" \
+          -e "s#\([^ ]*\.\)c#$NGX_OBJS\/\1$ngx_objext#g" \
+          -e "s#\([^ ]*\.\)S#$NGX_OBJS\/\1$ngx_objext#g"`
 
 ngx_modules_c=`echo $NGX_MODULES_C | sed -e "s/\//$ngx_regex_dirsep/g"`
 
@@ -213,10 +213,10 @@
 do
     ngx_src=`echo $ngx_src | sed -e "s/\//$ngx_regex_dirsep/g"`
     ngx_obj=`echo $ngx_src \
-        | sed -e "s/^\(.*\.\)cpp$/$ngx_objs_dir\1$ngx_objext/g" \
-              -e "s/^\(.*\.\)cc$/$ngx_objs_dir\1$ngx_objext/g" \
-              -e "s/^\(.*\.\)c$/$ngx_objs_dir\1$ngx_objext/g" \
-              -e "s/^\(.*\.\)S$/$ngx_objs_dir\1$ngx_objext/g"`
+        | sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \
+              -e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \
+              -e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \
+              -e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"`
 
     cat << END                                                >> $NGX_MAKEFILE
 
@@ -242,10 +242,10 @@
     do
         ngx_src=`echo $ngx_src | sed -e "s/\//$ngx_regex_dirsep/g"`
         ngx_obj=`echo $ngx_src \
-            | sed -e "s/^\(.*\.\)cpp$/$ngx_objs_dir\1$ngx_objext/g" \
-                  -e "s/^\(.*\.\)cc$/$ngx_objs_dir\1$ngx_objext/g" \
-                  -e "s/^\(.*\.\)c$/$ngx_objs_dir\1$ngx_objext/g" \
-                  -e "s/^\(.*\.\)S$/$ngx_objs_dir\1$ngx_objext/g"`
+            | sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \
+                  -e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \
+                  -e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \
+                  -e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"`
 
         cat << END                                            >> $NGX_MAKEFILE
 
@@ -272,10 +272,10 @@
     do
         ngx_src=`echo $ngx_src | sed -e "s/\//$ngx_regex_dirsep/g"`
         ngx_obj=`echo $ngx_src \
-            | sed -e "s/^\(.*\.\)cpp$/$ngx_objs_dir\1$ngx_objext/g" \
-                  -e "s/^\(.*\.\)cc$/$ngx_objs_dir\1$ngx_objext/g" \
-                  -e "s/^\(.*\.\)c$/$ngx_objs_dir\1$ngx_objext/g" \
-                  -e "s/^\(.*\.\)S$/$ngx_objs_dir\1$ngx_objext/g"`
+            | sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \
+                  -e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \
+                  -e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \
+                  -e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"`
 
         cat << END                                            >> $NGX_MAKEFILE
 
@@ -302,10 +302,10 @@
             | sed -e "s/\//$ngx_regex_dirsep/g"`
 
         ngx_obj=`echo $ngx_obj \
-            | sed -e "s/^\(.*\.\)cpp$/$ngx_objs_dir\1$ngx_objext/g" \
-                  -e "s/^\(.*\.\)cc$/$ngx_objs_dir\1$ngx_objext/g" \
-                  -e "s/^\(.*\.\)c$/$ngx_objs_dir\1$ngx_objext/g" \
-                  -e "s/^\(.*\.\)S$/$ngx_objs_dir\1$ngx_objext/g"`
+            | sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \
+                  -e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \
+                  -e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \
+                  -e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"`
 
         ngx_src=`echo $ngx_src | sed -e "s/\//$ngx_regex_dirsep/g"`
 
diff --git a/auto/unix b/auto/unix
index 0fe2974..1cf0dc3 100755
--- a/auto/unix
+++ b/auto/unix
@@ -21,7 +21,14 @@
 
 # POSIX types
 
-NGX_INCLUDE_AUTO_CONFIG_H="#include \"../$NGX_AUTO_CONFIG_H\""
+case "$NGX_AUTO_CONFIG_H" in
+    /*)
+        NGX_INCLUDE_AUTO_CONFIG_H="#include \"$NGX_AUTO_CONFIG_H\""
+    ;;
+    *)
+        NGX_INCLUDE_AUTO_CONFIG_H="#include \"../$NGX_AUTO_CONFIG_H\""
+    ;;
+esac
 
 ngx_type="uint64_t"; ngx_types="u_int64_t"; . auto/types/typedef