[nginx] Configure: fixed unexpected OpenSSL 4.1 rebuilds.

Maxim Dounin mdounin at mdounin.ru
Sun Nov 15 22:35:13 UTC 2026


details:   http://freenginx.org/hg/nginx/rev/146c43e035ac
branches:  
changeset: 9605:146c43e035ac
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Mon Nov 16 01:34:12 2026 +0300
description:
Configure: fixed unexpected OpenSSL 4.1 rebuilds.

OpenSSL 4.1 no longer reinstalls header files on Unix systems if they
weren't changed:

https://github.com/openssl/openssl/commit/274cc16ec3eca1c89807de99130c6649b53dc063

This results in unexpected OpenSSL rebuilds if configure with a path to
OpenSSL library sources was called again after a previous OpenSSL build,
since subsequent OpenSSL builds do not change ssl.h modification time,
and objs/Makefile remains newer.

The fix is to remove ssl.h in advance when building OpenSSL, so building
OpenSSL always updates it.

The change in OpenSSL currently affects Unix systems only.  However, it
might be later extended to win32 builds, hence the relevant MSVC
makefile was updated as well.

Reported by nisbet-hubbard,
https://github.com/freenginx/nginx/pull/40

diffstat:

 auto/lib/openssl/make          |  1 +
 auto/lib/openssl/makefile.msvc |  2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)

diffs (23 lines):

diff --git a/auto/lib/openssl/make b/auto/lib/openssl/make
--- a/auto/lib/openssl/make
+++ b/auto/lib/openssl/make
@@ -63,6 +63,7 @@ END
 
 $OPENSSL/.openssl/include/openssl/ssl.h:	$NGX_MAKEFILE
 	cd $OPENSSL \\
+	&& rm -rf .openssl/include/openssl/ssl.h \\
 	&& if [ -f Makefile ]; then \$(MAKE) clean; fi \\
 	&& ./config --prefix=$ngx_prefix no-shared no-threads $OPENSSL_OPT \\
 	&& \$(MAKE) \\
diff --git a/auto/lib/openssl/makefile.msvc b/auto/lib/openssl/makefile.msvc
--- a/auto/lib/openssl/makefile.msvc
+++ b/auto/lib/openssl/makefile.msvc
@@ -6,6 +6,8 @@
 all:
 	cd $(OPENSSL)
 
+	del /q /f openssl\include\openssl\ssl.h
+
 	perl Configure $(OPENSSL_TARGET) no-shared no-threads		\
 		--prefix="%cd%/openssl" 				\
 		--openssldir="%cd%/openssl/ssl" 			\


More information about the nginx-devel mailing list