[PATCH] Configure: fixed unexpected OpenSSL 4.1 rebuilds
Maxim Dounin
mdounin at mdounin.ru
Fri Nov 13 22:38:35 UTC 2026
# HG changeset patch
# User Maxim Dounin <mdounin at mdounin.ru>
# Date 1794424202 -10800
# Wed Nov 11 22:10:02 2026 +0300
# Node ID 46c1ed98859d6f728151052ad7d2181f497cb720
# Parent 91657301d88f6ca73abba477a0b7224002855bbb
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
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