Re: autoconf-2.61's AC_LINK_IFELSE with MinGW cross-compilers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Keith Marshall <keith.d.marshall@xxxxxxxxxxxx>:
On Sunday 01 April 2007 18:23, Paul Eggert wrote:
For example, will this test work?  If not, why not?

    test -x / && { { test -x /bin/sh && test ! -f /bin/sh.exe; } ||
test ! -f /bin/sh; }

It might.  I don't have a Win32 box here, so can't verify this until I
return to work in the morning, but I'm fairly confident that:--

 test -x /            --> true
 test -x /bin/sh      --> true, because /bin/sh.exe exists and MSYS
                          appends the registered executable file type
                          extensions, when matching bare file names
 test -f /bin/sh.exe  --> true

I'm less certain, but I also believe that:--

 test -f /bin/sh      --> true, because /bin/sh.exe exists, and causes
                          /bin/sh to *appear* to exist as an executable
                          file, although its real name is /bin/sh.exe

Thus, because of the negation in the final two tests, I would expect the
proposed expression to evaluate as false on MSYS, and I suspect also on
Cygwin.  Is that what you want to achieve?


On cygwin, with /bin/sh:
$ set -x; test -x / && { { test -x /bin/sh && test ! -f /bin/sh.exe; } || test !
-f /bin/sh; }; echo $?
+ test -x /
+ test -x /bin/sh
+ test '!' -f /bin/sh.exe
+ test '!' -f /bin/sh
+ echo 1
1

On MSYS, with /bin/sh:
$ set -x; test -x / && { { test -x /bin/sh && test ! -f /bin/sh.exe; } || test !
-f /bin/sh; }; echo $?
+ test -x /
+ test -x /bin/sh
+ test '!' -f /bin/sh.exe
+ test '!' -f /bin/sh
+ echo 1
1

Cheers,

--
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory



_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf


[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux