1 From 564a5cc634028970dc2f9d8ecc0e464a4fb1dcb6 Mon Sep 17 00:00:00 2001
2 From: Changqing Li <changqing.li@windriver.com>
3 Date: Mon, 22 Oct 2018 15:19:51 +0800
4 Subject: [PATCH] python3: use cc_basename to replace CC for checking compiler
6 When working path contains "clang"/"gcc"/"icc", it might be part of $CC
7 because of the "--sysroot" parameter. That could cause judgement error
8 about clang/gcc/icc compilers. e.g.
9 When "icc" is containded in working path, below errors are reported when
11 x86_64-wrs-linux-gcc: error: strict: No such file or directory
12 x86_64-wrs-linux-gcc: error: unrecognized command line option '-fp-model'
14 Here use cc_basename to replace CC for checking compiler to avoid such
17 Upstream-Status: Pending
19 Signed-off-by: Li Zhou <li.zhou@windriver.com>
21 patch originally from Li Zhou, I just rework it to new version
23 Signed-off-by: Changqing Li <changqing.li@windriver.com>
25 configure.ac | 23 ++++++++++++-----------
26 1 file changed, 12 insertions(+), 11 deletions(-)
28 diff --git a/configure.ac b/configure.ac
29 index 95c98d1..1b9589e 100644
32 @@ -54,6 +54,7 @@ AC_CONFIG_HEADER(pyconfig.h)
38 # pybuilddir.txt will be created by --generate-posix-vars in the Makefile
40 @@ -716,7 +717,7 @@ AC_MSG_RESULT($with_cxx_main)
45 + case "$cc_basename" in
46 gcc) AC_PATH_TOOL(CXX, [g++], [g++], [notfound]) ;;
47 cc) AC_PATH_TOOL(CXX, [c++], [c++], [notfound]) ;;
48 clang|*/clang) AC_PATH_TOOL(CXX, [clang++], [clang++], [notfound]) ;;
49 @@ -978,14 +979,14 @@ rmdir CaseSensitiveTestDir
54 + case $cc_basename in
55 gcc) CC="$CC -D_HAVE_BSDI";;
59 case $ac_sys_system in
62 + case $cc_basename in
63 cc|*/cc) CC="$CC -Ae";;
66 @@ -1310,7 +1311,7 @@ else
69 if test "$Py_LTO" = 'true' ; then
71 + case $cc_basename in
73 # Any changes made here should be reflected in the GCC+Darwin case below
75 @@ -1374,7 +1375,7 @@ then
82 # Any changes made here should be reflected in the GCC+Darwin case below
83 PGO_PROF_GEN_FLAG="-fprofile-instr-generate"
84 @@ -1451,7 +1452,7 @@ then
89 + case $cc_basename in
93 @@ -1553,7 +1554,7 @@ yes)
95 # ICC doesn't recognize the option, but only emits a warning
96 ## XXX does it emit an unused result warning and can it be disabled?
98 + case "$cc_basename" in
100 ac_cv_disable_unused_result_warning=no
102 @@ -1808,7 +1809,7 @@ yes)
105 # ICC needs -fp-model strict or floats behave badly
107 +case "$cc_basename" in
109 CFLAGS_NODIST="$CFLAGS_NODIST -fp-model strict"
111 @@ -2574,7 +2575,7 @@ then
112 then CCSHARED="-fPIC"
113 else CCSHARED="-Kpic -belf"
115 - IRIX*/6*) case $CC in
116 + IRIX*/6*) case $cc_basename in
117 *gcc*) CCSHARED="-shared";;
120 @@ -2615,7 +2616,7 @@ then
122 LINKFORSHARED="-Wl,--export-dynamic"
124 - SunOS/5*) case $CC in
125 + SunOS/5*) case $cc_basename in
127 if $CC -Xlinker --help 2>&1 | grep export-dynamic >/dev/null
129 @@ -5187,7 +5188,7 @@ if test "$have_gcc_asm_for_x87" = yes; then
130 # Some versions of gcc miscompile inline asm:
131 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46491
132 # http://gcc.gnu.org/ml/gcc/2010-11/msg00366.html
134 + case $cc_basename in
136 AC_MSG_CHECKING(for gcc ipa-pure-const bug)
137 saved_cflags="$CFLAGS"