Bug in nginx 0.7.xx ./configure procedure

Mark Alan varia at e-healthexpert.org
Tue Mar 24 00:56:45 MSK 2009


mike wrote:
> What does this do?
> 
> # ensure that there is only one -O in CFLAGS and that it is -O2

When we use --with-cc-opt= to specify any alternative -On C compiler 
optimization, there seems to be a bug (or is it a designed feature?) in 
nginx's ./configure that leads to the following line in the created 
objs/Makefile file:

CFLAGS =  -O -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter 
-Wno-unused-function -Wunused-variable -Wunused-value -Werror -g -O2


If I am not wrong, that line should only have one instance of -O:

CFLAGS = -pipe -W -Wall -Wpointer-arith -Wno-unused-parameter 
-Wno-unused-function -Wunused-variable -Wunused-value -Werror -g -O2


Hence the usage of the command sed -i '/CFLAGS/s/ \-O //g' objs/Makefile 
to clean the other instances of -O.

 From man cc:
" -O2 Optimize even more.
(...)
As compared to -O, this option increases both compilation time and the 
performance of the generated code."


M.





More information about the nginx mailing list