[PATCH] Configure: postpone running the test binary

Piotr Sikora piotr.sikora at frickle.com
Thu May 2 21:33:28 UTC 2024


# HG changeset patch
# User Piotr Sikora <piotr at aviatrix.com>
# Date 1714589827 0
#      Wed May 01 18:57:07 2024 +0000
# Node ID 2d5e754e3a4e7a59eaf7f653ad4fd5346f53eab4
# Parent  49dce50fad40bf09db81ca2a35983ecd7b740e43
Configure: postpone running the test binary.

Previously, the ./configure script would attempt to execute the test
binary during the C compiler check, and it would abort with an error
saying that the compiler doesn't work if there was any issue running
the test binary (e.g. due to missing compiler and/or linker flags).

This change delays that check and runs the test binary compiled with
all provided compiler and linker flags.

Signed-off-by: Piotr Sikora <piotr at aviatrix.com>

diff -r 49dce50fad40 -r 2d5e754e3a4e auto/cc/conf
--- a/auto/cc/conf	Tue Apr 16 18:29:59 2024 +0400
+++ b/auto/cc/conf	Wed May 01 18:57:07 2024 +0000
@@ -164,6 +164,23 @@
     fi
 
 
+    ngx_feature="working test binary"
+    ngx_feature_name=
+    ngx_feature_run=yes
+    ngx_feature_incs=
+    ngx_feature_path=
+    ngx_feature_libs=
+    ngx_feature_test=
+    . auto/feature
+
+    if [ $ngx_found = no ]; then
+        echo
+        echo $0: error: cannot execute test binary
+        echo
+        exit 1
+    fi
+
+
     ngx_feature="-Wl,-E switch"
     ngx_feature_name=
     ngx_feature_run=no
diff -r 49dce50fad40 -r 2d5e754e3a4e auto/cc/name
--- a/auto/cc/name	Tue Apr 16 18:29:59 2024 +0400
+++ b/auto/cc/name	Wed May 01 18:57:07 2024 +0000
@@ -7,7 +7,7 @@
 
     ngx_feature="C compiler"
     ngx_feature_name=
-    ngx_feature_run=yes
+    ngx_feature_run=no
     ngx_feature_incs=
     ngx_feature_path=
     ngx_feature_libs=


More information about the nginx-devel mailing list