This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: mknetrel issues

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".
> 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


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.
      |\      _,,,---,,_
ZZZzz /,`.-'`'    -.  ;-;;,_
     |,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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]