0.9.1 compilation failure on Nexenta 3.0.1

Igor Sysoev igor at sysoev.ru
Mon Dec 6 18:33:32 MSK 2010


On Mon, Dec 06, 2010 at 09:32:07PM +0700, Edho P Arief wrote:

> On Mon, Dec 6, 2010 at 9:10 PM, Igor Sysoev <igor at sysoev.ru> wrote:
> > As I understand it uses glibc which has sys_nerr.
> > What does
> > grep -r sys_nerr /usr/include
> > show ?
> >
> 
> I tried that yesterday, too. Also I believe it uses Solaris' libc.
> 
> Wikipedia:
> > Nexenta OS is the first distribution that combines the OpenSolaris C library and GNU userland with the OpenSolaris kernel.

Could you test the attached patch ?


-- 
Igor Sysoev
http://sysoev.ru/en/
-------------- next part --------------
Index: auto/unix
===================================================================
--- auto/unix	(revision 3131)
+++ auto/unix	(working copy)
@@ -119,18 +119,44 @@
 . auto/feature
 
 
-# Cygiwn defines _sys_nerr
-ngx_feature="_sys_nerr"
-ngx_feature_name="NGX_SYS_NERR"
-ngx_feature_run=value
-ngx_feature_incs='#include <errno.h>
-                  #include <stdio.h>'
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test='printf("%d", _sys_nerr);'
-. auto/feature
+if [ $ngx_found = no ]; then
 
+    # Cygiwn defines _sys_nerr
+    ngx_feature="_sys_nerr"
+    ngx_feature_name="NGX_SYS_NERR"
+    ngx_feature_run=value
+    ngx_feature_incs='#include <errno.h>
+                      #include <stdio.h>'
+    ngx_feature_path=
+    ngx_feature_libs=
+    ngx_feature_test='printf("%d", _sys_nerr);'
+    . auto/feature
+fi
 
+
+if [ $ngx_found = no ]; then
+
+    # Solaris has no sys_nerr
+    ngx_feature='maximum errno'
+    ngx_feature_name=NGX_SYS_NERR
+    ngx_feature_run=value
+    ngx_feature_incs='#include <errno.h>
+                      #include <stdio.h>'
+    ngx_feature_path=
+    ngx_feature_libs=
+    ngx_feature_test='int  n;
+                      for (n = 1; n < 1000; n++) {
+                          errno = 0;
+                          strerror(n);
+                          if (errno == EINVAL) {
+                              printf("%d", n);
+                              return 0;
+                          }
+                     }'
+    . auto/feature
+fi
+
+
 ngx_feature="localtime_r()"
 ngx_feature_name="NGX_HAVE_LOCALTIME_R"
 ngx_feature_run=no


More information about the nginx mailing list