[PATCH] Fix flag detection on MinGW

Orgad Shaneh orgads at gmail.com
Wed Jul 5 08:51:06 UTC 2017


---
 auto/cc/conf | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/auto/cc/conf b/auto/cc/conf
index afbca62b..2d062c31 100644
--- a/auto/cc/conf
+++ b/auto/cc/conf
@@ -144,7 +144,7 @@ fi
 CFLAGS="$CFLAGS $NGX_CC_OPT"
 NGX_TEST_LD_OPT="$NGX_LD_OPT"

-if [ "$NGX_PLATFORM" != win32 ]; then
+if [ "$NGX_PLATFORM" != win32 -o "$NGX_CC_NAME" = "gcc" -o
"$NGX_CC_NAME" = "clang" ]; then

     if test -n "$NGX_LD_OPT"; then
         ngx_feature=--with-ld-opt=\"$NGX_LD_OPT\"
@@ -164,17 +164,19 @@ if [ "$NGX_PLATFORM" != win32 ]; then
     fi


-    ngx_feature="-Wl,-E switch"
-    ngx_feature_name=
-    ngx_feature_run=no
-    ngx_feature_incs=
-    ngx_feature_path=
-    ngx_feature_libs=-Wl,-E
-    ngx_feature_test=
-    . auto/feature
+    if [ "$NGX_PLATFORM" != win32 ]; then
+        ngx_feature="-Wl,-E switch"
+        ngx_feature_name=
+        ngx_feature_run=no
+        ngx_feature_incs=
+        ngx_feature_path=
+        ngx_feature_libs=-Wl,-E
+        ngx_feature_test=
+        . auto/feature

-    if [ $ngx_found = yes ]; then
-        MAIN_LINK="-Wl,-E"
+        if [ $ngx_found = yes ]; then
+            MAIN_LINK="-Wl,-E"
+        fi
     fi


-- 
2.13.1.windows.2.4.g8d91d34115


More information about the nginx-devel mailing list