Welcome! Log In Create A New Profile

Advanced

[PATCH] Configure: always respect C compiler options

Piotr Sikora
November 06, 2015 09:44PM
# HG changeset patch
# User Piotr Sikora <piotrsikora@google.com>
# Date 1446864006 28800
# Fri Nov 06 18:40:06 2015 -0800
# Node ID 22f0e600de213b579ca921cce8f1a50b0a5c454e
# Parent 909b5b191f25d0f9e03667a10d23f6ef27d014a3
Configure: always respect C compiler options.

Previously, auto/cc/* and auto/include didn't respect C compiler options
provided via --with-cc-opt and/or CFLAGS, which resulted in bogus errors
when path to system headers and libraries was defined via --sysroot.

While there, retain working GCC's -pipe for autotests.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

diff -r 909b5b191f25 -r 22f0e600de21 auto/cc/acc
--- a/auto/cc/acc
+++ b/auto/cc/acc
@@ -8,7 +8,7 @@
# C89 mode

CFLAGS="$CFLAGS -Ae"
-CC_TEST_FLAGS="-Ae"
+CC_TEST_FLAGS="$CC_TEST_FLAGS -Ae"

PCRE_OPT="$PCRE_OPT -Ae"
ZLIB_OPT="$ZLIB_OPT -Ae"
diff -r 909b5b191f25 -r 22f0e600de21 auto/cc/clang
--- a/auto/cc/clang
+++ b/auto/cc/clang
@@ -13,7 +13,7 @@ echo " + clang version: $NGX_CLANG_VER"
have=NGX_COMPILER value="\"clang $NGX_CLANG_VER\"" . auto/define


-CC_TEST_FLAGS="-pipe"
+CC_TEST_FLAGS="$CC_TEST_FLAGS -pipe"


# optimizations
diff -r 909b5b191f25 -r 22f0e600de21 auto/cc/conf
--- a/auto/cc/conf
+++ b/auto/cc/conf
@@ -29,12 +29,12 @@ ngx_spacer=
ngx_long_regex_cont=$ngx_regex_cont
ngx_long_cont=$ngx_cont

+CC_TEST_FLAGS="$CFLAGS $NGX_CC_OPT"
+
. auto/cc/name

if test -n "$CFLAGS"; then

- CC_TEST_FLAGS="$CFLAGS $NGX_CC_OPT"
-
case $NGX_CC_NAME in

ccc)
@@ -129,8 +129,6 @@ else

esac

- CC_TEST_FLAGS="$CC_TEST_FLAGS $NGX_CC_OPT"
-
fi

CFLAGS="$CFLAGS $NGX_CC_OPT"
diff -r 909b5b191f25 -r 22f0e600de21 auto/cc/gcc
--- a/auto/cc/gcc
+++ b/auto/cc/gcc
@@ -18,7 +18,7 @@ have=NGX_COMPILER value="\"gcc $NGX_GCC_

# Solaris 7's /usr/ccs/bin/as does not support "-pipe"

-CC_TEST_FLAGS="-pipe"
+CC_TEST_FLAGS="$CC_TEST_FLAGS -pipe"

ngx_feature="gcc -pipe switch"
ngx_feature_name=
@@ -29,10 +29,10 @@ ngx_feature_libs=
ngx_feature_test=
. auto/feature

-CC_TEST_FLAGS=
-
if [ $ngx_found = yes ]; then
PIPE="-pipe"
+else
+ CC_TEST_FLAGS="$CFLAGS $NGX_CC_OPT"
fi


diff -r 909b5b191f25 -r 22f0e600de21 auto/include
--- a/auto/include
+++ b/auto/include
@@ -27,7 +27,8 @@ int main() {
END


-ngx_test="$CC -o $NGX_AUTOTEST $NGX_AUTOTEST.c"
+ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
+ -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT"

eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"


_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] Configure: always respect C compiler options

Piotr Sikora 418 November 06, 2015 09:44PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 234
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready