8000 gh-108465: Use compiler basename when determining compiler flags (#10… · python/cpython@fecb9fa · GitHub
[go: up one dir, main page]

Skip to content

Commit fecb9fa

Browse files
gh-108465: Use compiler basename when determining compiler flags (#108392)
Note: GNU Autoconf discourages the use of 'basename', and recommends 'expr' instead. Co-authored-by: Erlend E. Aasland <erlend@python.org>
1 parent 38afa4a commit fecb9fa

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

configure

Lines changed: 6 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1794,7 +1794,10 @@ then
17941794
fi
17951795
fi
17961796
LLVM_PROF_ERR=no
1797-
case $CC in
1797+
1798+
# GNU Autoconf recommends the use of expr instead of basename.
1799+
AS_VAR_SET([CC_BASENAME], [$(expr "//$CC" : '.*/\(.*\)')])
1800+
case "$CC_BASENAME" in
17981801
*clang*)
17991802
# Any changes made here should be reflected in the GCC+Darwin case below
18001803
PGO_PROF_GEN_FLAG="-fprofile-instr-generate"
@@ -2225,7 +2228,7 @@ yes)
22252228

22262229
# ICC doesn't recognize the option, but only emits a warning
22272230
## XXX does it emit an unused result warning and can it be disabled?
2228-
AS_CASE([$CC],
2231+
AS_CASE(["$CC_BASENAME"],
22292232
[*icc*], [ac_cv_disable_unused_result_warning=no]
22302233
[PY_CHECK_CC_WARNING([disable], [unused-result])])
22312234
AS_VAR_IF([ac_cv_disable_unused_result_warning], [yes],
@@ -2471,7 +2474,7 @@ yes)
24712474
;;
24722475
esac
24732476

2474-
case "$CC" in
2477+
case "$CC_BASENAME" in
24752478
*mpicc*)
24762479
CFLAGS_NODIST="$CFLAGS_NODIST"
24772480
;;

0 commit comments

Comments
 (0)
0