I experience a problem with MSYS.
Background:
I'm trying to build some projects under MSYS. Currently, I've checked out GNU config (http://savannah.gnu.org/projects/config) and try to make check. All tests are failed.
Tester creates a faked uname in current directory, which should provide test samples. Current directory is added to PATH.
Problem:
Running uname, config.guess should pick up that one from current directory. However, this doesn't happen, and standard MSYS's uname is executed.
If I rename uname in current directory to uname.exe, MSYS recognizes it, but can't execute, since it expects different format.
I've also tried to play with PATHEXT environment variable, but it looks like MSYS doesn't use it at all.
And, then, I can't understand how MSYS's own scripts named without extensions (for example, automake) are executed? Is this behavior immutably encoded in source?
Is there any acceptable workaround besides compilation of tests to executable files?
That's because any .exe file (by name) is expected to be in pe-coff format, and is invoked via the native windows loader; when the format isn't pe-coff, that loader will choke.
Your uname is, I guess, a script. Does it have a valid shebang line? With a valid interpreter path name? That's what MSYS uses to identify scripts that it can process directly, using the specified interpreter.
This doesn't come into play, until MSYS has given up on identifying the command file type, and punts it to the native $COMSPEC interpreter.
Nope. It simply relies on the script having a valid shebang.
Bourne shell scripts should be fine, as long as they have valid shebangs.
Also, make sure that . is the first item of $PATH; which is the default for MSYS if you installed it correctly or haven't modified it in your ~/.profile file or elsewhere.
Thank all of you for fast answer.
I haven't ever thought about shebang line. Valid shebang has solved a problem.
I just wonder how it could be workable in Linux without shebang line.
Please close this issue as solved.
With Linux you can mark the script executable and the default /bin/sh kicks in. With MSYS the #! on line 1 column 1 is the indicator for an executable script since the chmod semantics doesn't really work with the underlying OS except for read and write.