For non-Windows builds, if the CFLAGS environment variable was unset, it was being set to an empty string when calling ./configure on libsodium. This had the effect of switching off the default -O2 flag when make was subsequently called.
This PR not only explicitly adds -O2 to the CFLAGS environment variable, but ensures that unset environment variables aren't passed down to ./configure set to empty strings.
It also takes a similar approach to the --disable-pie argument, although the only way in which this affected the build (i.e. passing an empty string as an argument to ./configure) was to cause ./configure to generate a warning in stderr.
For non-Windows builds, if the
CFLAGS
environment variable was unset, it was being set to an empty string when calling./configure
on libsodium. This had the effect of switching off the default-O2
flag whenmake
was subsequently called.This PR not only explicitly adds
-O2
to theCFLAGS
environment variable, but ensures that unset environment variables aren't passed down to./configure
set to empty strings.It also takes a similar approach to the
--disable-pie
argument, although the only way in which this affected the build (i.e. passing an empty string as an argument to./configure
) was to cause./configure
to generate a warning in stderr.