build failed on Linux with x32 ABI

Maxim Dounin mdounin at mdounin.ru
Tue Jun 25 19:21:01 UTC 2013


Hello!

On Tue, Jun 25, 2013 at 07:32:04PM +0300, Serguei I. Ivantsov wrote:

> >> +#if (NGX_HAVE_RTSIG)
> >> +#include <sys/sysctl.h>
> >> +#endif
> >> +
> >>
> >>  #if (NGX_HAVE_POSIX_SEM)
> >>  #include <semaphore.h>
> 
> >This probably needs to be moved to other event method related
> >conditional includes
> 
> I did not find an example how and where conditionally include system
> header. BTW, I just make the same way I found in ngx_linux_config.h :
> 
> #if (NGX_HAVE_POLL || NGX_HAVE_RTSIG)
> #include <poll.h>
> #endif

Yes, that's fine.  But you placed the include added before 
semaphore.h instead of adding it to other event method related 
includes.  I mean to do something like this: 

--- a/src/os/unix/ngx_linux_config.h
+++ b/src/os/unix/ngx_linux_config.h
@@ -51,7 +51,6 @@
 #include <malloc.h>             /* memalign() */
 #include <limits.h>             /* IOV_MAX */
 #include <sys/ioctl.h>
-#include <sys/sysctl.h>
 #include <crypt.h>
 #include <sys/utsname.h>        /* uname() */
 
@@ -77,6 +76,11 @@ extern ssize_t sendfile(int s, int fd,
 #endif
 
 
+#if (NGX_HAVE_RTSIG)
+#include <sys/sysctl.h>
+#endif
+
+
 #if (NGX_HAVE_POLL || NGX_HAVE_RTSIG)
 #include <poll.h>
 #endif


-- 
Maxim Dounin
http://nginx.org/en/donation.html



More information about the nginx-devel mailing list