1 From 994783da5c21cab81b6589ed2d4275e665a946f9 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>
26 configure.ac | 19 ++++++++++---------
27 1 file changed, 10 insertions(+), 9 deletions(-)
29 diff --git a/configure.ac b/configure.ac
30 index a189d42..0f85486 100644
33 @@ -54,6 +54,7 @@ AC_CONFIG_HEADER(pyconfig.h)
39 # pybuilddir.txt will be created by --generate-posix-vars in the Makefile
41 @@ -671,7 +672,7 @@ AC_MSG_RESULT($with_cxx_main)
46 + case "$cc_basename" in
47 gcc) AC_PATH_TOOL(CXX, [g++], [g++], [notfound]) ;;
48 cc) AC_PATH_TOOL(CXX, [c++], [c++], [notfound]) ;;
49 clang|*/clang) AC_PATH_TOOL(CXX, [clang++], [clang++], [notfound]) ;;
50 @@ -957,7 +958,7 @@ rmdir CaseSensitiveTestDir
52 case $ac_sys_system in
55 + case $cc_basename in
56 cc|*/cc) CC="$CC -Ae";;
59 @@ -1335,7 +1336,7 @@ else
62 if test "$Py_LTO" = 'true' ; then
64 + case $cc_basename in
67 AC_PATH_TOOL(LLVM_AR, llvm-ar, '', ${llvm_path})
68 @@ -1425,7 +1426,7 @@ then
75 # Any changes made here should be reflected in the GCC+Darwin case below
76 PGO_PROF_GEN_FLAG="-fprofile-instr-generate"
77 @@ -1486,7 +1487,7 @@ esac
78 # compiler and platform. BASECFLAGS tweaks need to be made even if the
86 @@ -1622,7 +1623,7 @@ yes)
88 # ICC doesn't recognize the option, but only emits a warning
89 ## XXX does it emit an unused result warning and can it be disabled?
91 + case "$cc_basename" in
93 ac_cv_disable_unused_result_warning=no
95 @@ -1943,7 +1944,7 @@ yes)
98 # ICC needs -fp-model strict or floats behave badly
100 +case "$cc_basename" in
102 CFLAGS_NODIST="$CFLAGS_NODIST -fp-model strict"
104 @@ -2711,7 +2712,7 @@ then
106 LINKFORSHARED="-Wl,--export-dynamic"
108 - SunOS/5*) case $CC in
109 + SunOS/5*) case $cc_basename in
111 if $CC -Xlinker --help 2>&1 | grep export-dynamic >/dev/null
113 @@ -5362,7 +5363,7 @@ if test "$have_gcc_asm_for_x87" = yes; then
114 # Some versions of gcc miscompile inline asm:
115 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46491
116 # http://gcc.gnu.org/ml/gcc/2010-11/msg00366.html
118 + case $cc_basename in
120 AC_MSG_CHECKING(for gcc ipa-pure-const bug)
121 saved_cflags="$CFLAGS"