1 From 2645317fef09afe31b01bb2c1d4fe5b9afdbb11a 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 | 19 ++++++++++---------
26 1 file changed, 10 insertions(+), 9 deletions(-)
28 diff --git a/configure.ac b/configure.ac
29 index a7de901..4a3681f 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 @@ -695,7 +696,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 @@ -979,7 +980,7 @@ rmdir CaseSensitiveTestDir
51 case $ac_sys_system in
54 + case $cc_basename in
55 cc|*/cc) CC="$CC -Ae";;
58 @@ -1336,7 +1337,7 @@ else
61 if test "$Py_LTO" = 'true' ; then
63 + case $cc_basename in
66 AC_PATH_TARGET_TOOL(LLVM_AR, llvm-ar, '', ${llvm_path})
67 @@ -1426,7 +1427,7 @@ then
74 # Any changes made here should be reflected in the GCC+Darwin case below
75 PGO_PROF_GEN_FLAG="-fprofile-instr-generate"
76 @@ -1500,7 +1501,7 @@ then
81 + case $cc_basename in
85 @@ -1623,7 +1624,7 @@ yes)
87 # ICC doesn't recognize the option, but only emits a warning
88 ## XXX does it emit an unused result warning and can it be disabled?
90 + case "$cc_basename" in
92 ac_cv_disable_unused_result_warning=no
94 @@ -1965,7 +1966,7 @@ yes)
97 # ICC needs -fp-model strict or floats behave badly
99 +case "$cc_basename" in
101 CFLAGS_NODIST="$CFLAGS_NODIST -fp-model strict"
103 @@ -2727,7 +2728,7 @@ then
105 LINKFORSHARED="-Wl,--export-dynamic"
107 - SunOS/5*) case $CC in
108 + SunOS/5*) case $cc_basename in
110 if $CC -Xlinker --help 2>&1 | grep export-dynamic >/dev/null
112 @@ -5429,7 +5430,7 @@ if test "$have_gcc_asm_for_x87" = yes; then
113 # Some versions of gcc miscompile inline asm:
114 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46491
115 # http://gcc.gnu.org/ml/gcc/2010-11/msg00366.html
117 + case $cc_basename in
119 AC_MSG_CHECKING(for gcc ipa-pure-const bug)
120 saved_cflags="$CFLAGS"