a prelimiary IPv6 support, HTTP listen
diff --git a/auto/options b/auto/options
index 9e6e1a2..fabd5d0 100644
--- a/auto/options
+++ b/auto/options
@@ -43,6 +43,8 @@
 
 USE_THREADS=NO
 
+NGX_IPV6=NO
+
 HTTP=YES
 
 NGX_HTTP_LOG_PATH=
@@ -160,6 +162,8 @@
         #--with-threads=*)                USE_THREADS="$value"       ;;
         #--with-threads)                  USE_THREADS="pthreads"     ;;
 
+        --with-ipv6)                     NGX_IPV6=YES               ;;
+
         --without-http)                  HTTP=NO                    ;;
         --http-log-path=*)               NGX_HTTP_LOG_PATH="$value" ;;
         --http-client-body-temp-path=*)  NGX_HTTP_CLIENT_TEMP_PATH="$value" ;;
@@ -285,6 +289,8 @@
   --with-poll_module                 enable poll module
   --without-poll_module              disable poll module
 
+  --with-ipv6                        enable ipv6 support
+
   --with-http_ssl_module             enable ngx_http_ssl_module
   --with-http_realip_module          enable ngx_http_realip_module
   --with-http_addition_module        enable ngx_http_addition_module
diff --git a/auto/unix b/auto/unix
index 245d4f7..7d6e480 100755
--- a/auto/unix
+++ b/auto/unix
@@ -64,6 +64,21 @@
 # syscalls, libc calls and some features
 
 
+if [ $NGX_IPV6 = YES ]; then
+    ngx_feature="AF_INET6"
+    ngx_feature_name="NGX_HAVE_INET6"
+    ngx_feature_run=no
+    ngx_feature_incs="#include <sys/socket.h>
+                      #include <netinet/in.h>
+                      #include <arpa/inet.h>"
+    ngx_feature_path=
+    ngx_feature_libs=
+    ngx_feature_test="struct sockaddr_in6  sin6;
+                      sin6.sin6_family = AF_INET6;"
+    . auto/feature
+fi
+
+
 ngx_feature="setproctitle()"
 ngx_feature_name="NGX_HAVE_SETPROCTITLE"
 ngx_feature_run=no