Bug 30083 - double quotes in Makefile confuse solaris /bin/sh
Summary: double quotes in Makefile confuse solaris /bin/sh
Status: RESOLVED DUPLICATE of bug 27843
Alias: None
Product: gcc
Classification: Unclassified
Component: other (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-06 13:46 UTC by Marc Glisse
Modified: 2008-11-12 16:30 UTC (History)
5 users (show)

See Also:
Host: i386-pc-solaris2.10
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Glisse 2006-12-06 13:46:18 UTC
Hello,

gmake install currently fails for me on mainline on solaris 10 if I use the default /bin/sh shell. The problem is with this line of gcc/Makefile.in:

SYSTEM_HEADER_DIR = `echo @SYSTEM_HEADER_DIR@ | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`

this variable is used inside double quotes, and solaris /bin/sh parses "`""`" as two strings containing a backquote (or something else, but not what you would expect anyway). I believe using single quotes in this line would help (I did not redo the whole configure+bootstrap, but I checked that solaris sh understood the modified line).
Comment 1 Marc Glisse 2006-12-06 18:01:44 UTC
Actually, the problem seems to be caused by the '^' character, which is the equivalent of '|' for this shell. The solution is still the same, have single quotes (or protect the '^' with '\'). There seems to be two other occurences of an unprotected '^' line 3246 and 3856 in the same file, don't know if it may cause problems as well, but it would be safer to modify those too.
Comment 2 Andrew Pinski 2006-12-06 23:05:51 UTC
Solaris's /bin/sh is not a POSIX shell, please read http://gcc.gnu.org/install/ and try again.
Comment 3 Marc Glisse 2006-12-07 11:04:10 UTC
Sure, it works with a posix shell. But it would not hurt to use single quotes around the constant string passed as an argument to sed, as is done in the rest of the file, if only for consistancy. It seems to be the only thing that fails now with this /bin/sh, and it used to work with it.
Comment 4 Andrew Pinski 2006-12-08 05:00:51 UTC
(In reply to comment #3)
> Sure, it works with a posix shell. 

Except you did not read instructions so what is the difference?
Comment 5 Marc Glisse 2006-12-08 12:19:24 UTC
(In reply to comment #4)
> Except you did not read instructions so what is the difference?

Ok say you forget I mentionned solaris /bin/sh. I just believe it would be more consistant to use single quotes instead of double quotes everywhere a constant string is passed to sed (now it is done everywhere except in 3 places) in this file. The fact that it makes solaris /bin/sh work is a mere coincidence. It is just code cleanup.
Comment 6 Ralf Wildenhues 2007-02-16 17:40:10 UTC
This is a duplicate of 27843 (Solaris and Tru64 /bin/sh share the same issue),
which has been resolved as fixed.  :-)

Someone empowered enough please reflect this in the settings, thank you!
Comment 7 James Coleman 2007-02-20 13:08:50 UTC
This happened me on solaris 10 (even with reading the manual!) make install had worked for me previously on solais without having to set CONFIG_SHELL so it is something that might trip people up.
I agree that this is a duplicate of 27843.
Comment 8 Marc Glisse 2008-11-12 16:30:27 UTC
The comments already say this bug is a duplicate (of a now fixed bug), I am just marking it for cleanup. Hope that is the right thing to do...

*** This bug has been marked as a duplicate of 27843 ***