GeoIPv6 patch

Maxim Dounin mdounin at mdounin.ru
Wed Jun 22 01:45:45 MSD 2011


Hello!

On Tue, Jun 21, 2011 at 11:12:08PM +0200, Gregor Kališnik wrote:

[...]

> > Please include attached patch for configure part (on top of
> > yours).
> > 
> > It cleans up some minor things in original code (missing
> > ngx_feature_incs, extra trailing "/" in ngx_feature_path for
> > NetBSD port, missing ngx_feature_path for FreeBSD port, missing
> > CORE_INCS modification) and modifies your code to not set
> > "ngx_feature_path" and "ngx_feature_libs".  This allows correct
> > detection of ipv6 support if library was found on non-default
> > path.
> > 
> 
> I haven't found any patch that you are referring to (or did I misread your 
> comment?).

Oops, sorry, looks like I forgot to actually attach it.  Let me try 
again. :)

Maxim Dounin
-------------- next part --------------
diff --git a/auto/lib/geoip/conf b/auto/lib/geoip/conf
--- a/auto/lib/geoip/conf
+++ b/auto/lib/geoip/conf
@@ -5,7 +5,7 @@
     ngx_feature="GeoIP library"
     ngx_feature_name=
     ngx_feature_run=no
-    ngx_feature_incs=
+    ngx_feature_incs="#include <GeoIP.h>"
     ngx_feature_path=
     ngx_feature_libs="-lGeoIP"
     ngx_feature_test="GeoIP_open(NULL, 0)"
@@ -17,6 +17,7 @@ if [ $ngx_found = no ]; then
     # FreeBSD port
 
     ngx_feature="GeoIP library in /usr/local/"
+    ngx_feature_path="/usr/local/include"
 
     if [ $NGX_RPATH = YES ]; then
         ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lGeoIP"
@@ -33,7 +34,7 @@ if [ $ngx_found = no ]; then
     # NetBSD port
 
     ngx_feature="GeoIP library in /usr/pkg/"
-    ngx_feature_path="/usr/pkg/include/"
+    ngx_feature_path="/usr/pkg/include"
 
     if [ $NGX_RPATH = YES ]; then
         ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lGeoIP"
@@ -63,6 +64,8 @@ fi
 
 
 if [ $ngx_found = yes ]; then
+
+    CORE_INCS="$CORE_INCS $ngx_feature_path"
     CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
 
     if [ $NGX_IPV6 = YES ]; then
@@ -71,15 +74,9 @@ if [ $ngx_found = yes ]; then
         ngx_feature_run=no
         ngx_feature_incs="#include <stdio.h>
                           #include <GeoIP.h>"
-        ngx_feature_path=
-        ngx_feature_libs=
-        ngx_feature_test='printf("%d", GEOIP_COUNTRY_EDITION_V6);
-                          printf("%d", GEOIP_ISP_EDITION_V6);
-                          printf("%d", GEOIP_ORG_EDITION_V6);
-                          printf("%d", GEOIP_DOMAIN_EDITION_V6);
-                          printf("%d", GEOIP_ASNUM_EDITION_V6);
-                          printf("%d", GEOIP_CITY_EDITION_REV0_V6);
-                          printf("%d", GEOIP_CITY_EDITION_REV1_V6);'
+        #ngx_feature_path=
+        #ngx_feature_libs=
+        ngx_feature_test="printf(\"%d\", GEOIP_CITY_EDITION_REV0_V6);"
         . auto/feature
     fi
 
diff --git a/auto/lib/libgd/conf b/auto/lib/libgd/conf
--- a/auto/lib/libgd/conf
+++ b/auto/lib/libgd/conf
@@ -34,7 +34,7 @@ if [ $ngx_found = no ]; then
     # NetBSD port
 
     ngx_feature="GD library in /usr/pkg/"
-    ngx_feature_path="/usr/pkg/include/"
+    ngx_feature_path="/usr/pkg/include"
 
     if [ $NGX_RPATH = YES ]; then
         ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lgd"


More information about the nginx-devel mailing list