autoconf-patches
[Top][All Lists]
Advanced

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

RE: AC_CYGWIN etc. (Was: AC_OBJEXT again)


From: Bernard Dautrevaux
Subject: RE: AC_CYGWIN etc. (Was: AC_OBJEXT again)
Date: Thu, 14 Dec 2000 11:04:58 +0100

> -----Original Message-----
> From: Alexandre Oliva [mailto:address@hidden
> Sent: Thursday, December 14, 2000 4:40 AM
> To: Mo DeJong
> Cc: address@hidden; address@hidden
> Subject: Re: AC_CYGWIN etc. (Was: AC_OBJEXT again)
> 
> 
> On Dec 14, 2000, Mo DeJong <address@hidden> wrote:
> 
> > I am at a loss to explain that one. I would think that a
> > Linux cross mingw compiler would need to output a .exe
> > file, but it does not.
> 
> Well, then I think it's a bug in the cross compiler.  

No so much ;-(

Don't forget we look at the output of
        $(CC) -o conftest conftest.c

It's arguably a well defined and documented feature of almost all compilers
that the generated output file will be named "conftest".

In fact we are just tricked by some cygwin/mingw compilers that try to be
smart enough to allow people NOT using autotools to not bother with the
'.exe' HOST requirement.

It coudl well be argued that this is a bug in the cygwin/mingw compilers
(I'm not even sure that its documented that '-o conftest' will generate '-o
conftest.exe'. Note that this open a new category of questions:

gcc -o conftest.x conftest.c    ---> conftest.x or conftest.x.exe or
conftest.exe ???
gcc -o conftest.o -c conftest.c ---> conftest.o (NOT conftest.o.exe I
hope...)

I think a well behaved compiler just obey what the user asks for, so "gcc -o
conftest conftest.c" should create "conftest"; if I generate for Win32, it's
a host characteristics that say that the exe MUST be called "conftest.exe",
so it's the role of autotools to generate the proper "gcc -o conftest.exe
conftest.c" rule :-)

Note that in fact all this thread is about AC_EXEEXT, not AC_OBJEXT. The two
are quite different and AC_OBJEXT does not cause ANY problem: it's a
characteristic of th ehost-compiler when run on the build machine, so trying
to compile and looking at the gernerated suffix is OK and could only fail if
we can't find a (cross) compiler.

> Incidentally, I
> do have a patch for GCC that fixed the extension conventions, but it
> can't be applied because it breaks the build because of
> autoconf-related issues.  Catch 22 :-(

Anyway, being clever in gcc only simplify the life of people compiling by
hand; once using autoconf and the like, it's the role of autoconf HOST
definition to cure that. 

> 
> I guess we'll have to retain the host checking of Cygwin, Mingw and
> OS2 and explicitly set EXEEXT to .exe if host is any of these :-(
> 
> Too bad...

Not too bad, just needed. 

We can't expect ALL cross-compilers be smart enough to not trust their user;
we may even find some that *refuse* a "$(CC) -o conftest conftest.c"
command, just because they *know* you should have given them the ".exe"
suffix and want to be sure you do not use the cross-compiler accidently
while wanting to use the native one...

Just my 2 cents

        Bernard

--------------------------------------------
Bernard Dautrevaux
Microprocess Ingenierie
97 bis, rue de Colombes
92400 COURBEVOIE
FRANCE
Tel:    +33 (0) 1 47 68 80 80
Fax:    +33 (0) 1 47 88 97 85
e-mail: address@hidden
                address@hidden
-------------------------------------------- 



reply via email to

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