autoconf
[Top][All Lists]
Advanced

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

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


From: Benoit Sigoure
Subject: Re: autoconf-2.61's AC_LINK_IFELSE with MinGW cross-compilers
Date: Sun, 01 Apr 2007 21:32:54 +0200
User-agent: Internet Messaging Program (IMP) H3 (4.0.2)

Quoting Keith Marshall <address@hidden>:
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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]