cygwin build_alias issue (and a possible workaround...)

Bogdan Vacaliuc bvacaliuc at ngit.com
Sat Sep 4 18:18:29 UTC 2004


Scott,

> The tail end of the expr.log file:

Alright, lets see:

> expr xrtemsbsp :
.*[^-_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789] result
0 status !0

So the expected exit status for this expression is 1.  (I'm going to start
abbreviating that $as_cr_alnum expression)

[linux:~] expr xrtemsbsp : ".*[^-_xrtemsbp]" > /dev/null
[linux:~] echo $status
1

So our log was faithful, however, in the ~rtems-4.6.1/cpukit/configure:

    # Reject names that are not valid shell variable names.
    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
   { (exit 1); exit 1; }; }
   
And from the bash manpage:

       The  control operators && and || denote AND lists and OR lists,
respec-
       tively.  An AND list has the form

              command1 && command2

       command2 is executed if, and only if, command1 returns an  exit
status
       of zero.

Yet in our case, the correct exit status is 1 and is observed in the
expr.log as well.  Which would prevent the error exit.

So for $64,000, how did the exit status (which was clearly 1) in the script
change from 1 to 0 when it got back to the configure script?


Um, did anyone notice that the shell used for the configure scripts is
/bin/sh?  And on cygwin:

[/tmp] ls -al /bin/sh
-rwxrwxrwx    1 Administ Users       74240 Jan 27  2004 /bin/sh*
[/tmp] ls -al `which bash`
-rwxrwxrwx    1 Administ Users      527360 Oct 20  2003 /usr/bin/bash*

And a 'man sh' leads on to think that the 'sh' implemented is ash?

Just out of crazy curiosity, what happens if you put /bin/sh aside and
replace it with bash?  I'll try this now too..

-bogdan




More information about the users mailing list