This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/52847] New: "case" shell quoting problem in top-level makefile
- From: "skunk at iskunk dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 03 Apr 2012 17:58:12 +0000
- Subject: [Bug other/52847] New: "case" shell quoting problem in top-level makefile
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52847
Bug #: 52847
Summary: "case" shell quoting problem in top-level makefile
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: other
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: skunk@iskunk.org
[Configured on AIX with CC="gcc -mminimal-toc"]
$ gmake bootstrap-lean
echo stage3 > stage_final
/opt/freeware/bin/bash: command substitution: line 1: syntax error near
unexpected token `-mminimal-toc'
/opt/freeware/bin/bash: command substitution: line 1: `case gcc -mminimal-toc
in *gcc*) echo -Wl,-bbigtoc ;; esac;'
gmake[1]: Entering directory `/tmp/gcc-4.7.0-build'
gmake[2]: Entering directory `/tmp/gcc-4.7.0-build'
gmake[2]: Leaving directory `/tmp/gcc-4.7.0-build'
gmake[2]: Entering directory `/tmp/gcc-4.7.0-build'
Configuring stage 1 in ./intl
configure: creating cache ./config.cache
checking whether gmake sets $(MAKE)... yes
[...]
The above warning comes from the below line in the top-level makefile, under
the "host and target specific makefile fragments come in here" header:
LDFLAGS = `case $(CC) in *gcc*) echo -Wl,-bbigtoc ;; esac;`
I believe this needs to be written as
LDFLAGS = `case "$(CC)" in *gcc*) echo -Wl,-bbigtoc ;; esac;`
in order to accommodate values of $(CC) which contain spaces.