This is the mail archive of the
cygwin-apps@cygwin.com
mailing list for the Cygwin project.
Re: mknetrel issues
- From: Igor Pechtchanski <pechtcha at cs dot nyu dot edu>
- To: cygwin-apps at cygwin dot com
- Date: Sat, 14 Jun 2003 19:50:22 -0400 (EDT)
- Subject: Re: mknetrel issues
- Reply-to: cygwin-apps at cygwin dot com
On Sat, 14 Jun 2003, Igor Pechtchanski wrote:
> On Sat, 14 Jun 2003, Max Bowsher wrote:
>
> > I've been trying to use mknetrel (natively on Cygwin) to build myself a
> > gcc-3.3.
> >
> > I ran into a variety of small issues:
> >
> > 1) This line:
> > sedit 's/^gcc_version_trigger[ ]*=.*$//' Makefile '*' :
> > contains whitespace in the sed pattern. It's quoted here, but by the time it
> > is actually used, the quotes have been lost by passing it to a shell
> > function, producing the error "unterminated 's' command".
> >
> > 2) Use of $(BASE_FLAGS_TO_PASS) and $(EXTRA_HOST_FLAGS)
> > I'm guessing these are intended to be make variables, but the quotes are
> > getting lost prematurely, and they are being interpreted by bash as $()
> > command interpolation.
> >
> > 3) There seems to be a bug in extra/gcc: The addmakeflags GCJ=... GCJH=...
> > does not take account of the fact that addmakeflags removes whitespace
> > between its arguments, leading to the single flag of GCJ=...GCJH=... being
> > added.
> >
> > I'm a little confused why all this is going wrong for me - given that
> > mknetrel must obviously get regular use. On the other hand, I don't see what
> > could be odd about my system to cause this.
> >
> > Can anyone (well, cgf, probably) explain any of this?
> > Thanks,
> > Max
>
> Max,
>
> Did you try a simple script with the same quoting? The one below seems to
> work for me:
>
> sedit() {
> echo "Testing
> gcc_version_trigger = BLAH
> Testing" | sed "$1"
> }
> sedit 's/^gcc_version_trigger[ ]*=.*$//'
>
> Further, mknetrel is a bash script. AFAIK, bash inherits the environment
> variables and some aliases/shell functions from the parent shell. If you
> compared the values of the environment variables and exported aliases for
> your shell with those for cgf's (who runs mknetrel regularly, apparently
> with no such problems), you might see some clues...
>
> One thing I thought of right away was whether "sed" was an exported shell
> function in your environment. I got the same results as you did by doing
>
> sed() {
> /usr/bin/sed $*
> }
> export -f sed
>
> and then running the script above. FWIW, quoting the arguments to sed
> above (i.e., using '"$@"' instead of '$*') fixes the problem. However,
> mknetrel defines its own sed() function, so I'm not sure how this relates.
>
> I'm also not sure why you'd lose the quoting in case 2 above, but it may
> be related to a similar problem. Perhaps running mknetrel with "bash -p"
> would help.
> Igor
Actually, I've just had another look at this, and it seems that the
unquoting is due to the "eval" in the sudo() function. I was able to
reproduce Max's problem. Removing the "eval" call (using just "$@" as the
command) works for me, i.e.:
sudo() {
"$@"
}
produces the expected results.
Igor
--
http://cs.nyu.edu/~pechtcha/
|\ _,,,---,,_ pechtcha@cs.nyu.edu
ZZZzz /,`.-'`' -. ;-;;,_ igor@watson.ibm.com
|,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D.
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!
"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster." -- Patrick Naughton