[PATCH] Fix ./configure script for less error-forgiving compilers

Maxim Dounin mdounin at mdounin.ru
Thu Mar 15 18:04:39 UTC 2012


Hello!

On Tue, Mar 06, 2012 at 12:45:03PM +0400, Ruslan Ermilov wrote:

> On Mon, Mar 05, 2012 at 10:37:31PM +0100, Piotr Sikora wrote:
> > --- auto/types/uintptr_t.orig	Sun Jul 29 18:24:53 2007
> > +++ auto/types/uintptr_t	Tue Aug 24 19:38:17 2010
> > @@ -14,7 +14,8 @@
> >  $NGX_INTTYPES_H
> >  
> >  int main() {
> > -    uintptr_t i = 0;
> > +    uintptr_t i;
> > +    i = 0;
> >      return 0;
> >  }
> 
> The way this script is written, -Wall -Werror were not passed
> to the compiler.  I've fixed this, and it made your change
> obviously required.

Another obvious test is to use CFLAGS="-Wall -Werror" ./configure.

> > --- auto/unix.orig	Thu Aug 12 04:33:51 2010
> > +++ auto/unix	Thu Aug 12 04:34:20 2010
> > @@ -82,7 +82,7 @@
> >  ngx_feature="setproctitle()"
> >  ngx_feature_name="NGX_HAVE_SETPROCTITLE"
> >  ngx_feature_run=no
> > -ngx_feature_incs=
> > +ngx_feature_incs="#include <stdlib.h>"
> >  ngx_feature_path=
> >  ngx_feature_libs=$NGX_SETPROCTITLE_LIB
> >  ngx_feature_test="setproctitle(\"test\");"
> 
> setproctitle() is in <unistd.h> on FreeBSD, and the latter
> is always included when available.  This change isn't needed.

As already clarified by Piotr, this is needed for OpenBSD / 
NetBSD.

> I've also fixed configure errors on Linux when configured
> with --with-cc=gcc --with-cc-opt="-Wall -Werror".

I don't really think we support --with-cc-opt="-Wall -Werror", it 
will fail on compilation anyway as we really need 
"-Wno-unused-parameter".

But it doesn't hurt to keep configure clean, please restore 
Piotr's setproctitle() change and commit.

[...]

> @@ -585,7 +585,8 @@
>  ngx_feature="memalign()"
>  ngx_feature_name="NGX_HAVE_MEMALIGN"
>  ngx_feature_run=no
> -ngx_feature_incs="#include <stdlib.h>"
> +ngx_feature_incs="#include <stdlib.h>
> +                  #include <malloc.h>"
>  ngx_feature_path=
>  ngx_feature_libs=
>  ngx_feature_test="void *p; p = memalign(4096, 4096)"

Just a side note: this probably should be run only if 
posix_memalign() isn't found.  The same applies to gcc variadic 
macros test, which is redundant in case of C99 variadic macros 
found.

Maxim Dounin



More information about the nginx-devel mailing list