In message <[EMAIL PROTECTED]>, Earnie Boyd write
s:
>--- Olly Betts <[EMAIL PROTECTED]> wrote:
>> * "CC" is an unwise choice for DOS/Windows (not a problem if we check
>>   that the compiler groks C++ so we can ignore this)
>
>What do you mean CC is an unwise choice for DOS/Windows.  I use it all the
>time for DOS/Windows.  Check out www.mingw.org.

I've been using mingw for a couple of years now.

What I mean is that CC is probably an unwise choice when looking for a
C++ compiler.  The danger is that "CC" is the same as "cc" on a case
insensitive filing system, so this risks picking up something on the
path called cc.exe that's just a C compiler, not a C++ compiler.

Even a mingw cc.exe probably isn't a great choice for a C++ compiler -
while it can compile C++ code to objects, it probably won't link in
the right libraries for C++ (can't test mingw right now but gcc under
Linux doesn't - and after all that's what g++ is for).

At present AC_PROG_CXX checks along its list until it finds an entry,
then tests it can compile a short program which is valid C (and also
valid C++).  So at present this entry could pick a C compiler.

With my suggestions that:

(a) the test program for the C++ compiler not be a valid C program
(b) if the first entry found fails the test, keep checking down the list

this would no longer be an issue (hence my comment in brackets above).

>> * Prefer "aCC" to "CC" (appears to be safe everywhere)
>
>Can you recapsulate why?

In a nutshell, HP-UX has a CC that sucks (inability to handle inlined
functions with loops was an example I think).  If an HP-UX box has aCC
that should be used in preference.

>> * "cl" could be a lisp compiler on Unix - perhaps only check for it on
>>   DOS and Windows
>
>Why not use AC_PATH_PROGS and put cl last in the list?

I recall this "cl" being mentioned in a mail to this list a while
back.  I don't think the mail gave details, so I don't know if it's an
actual problem.

But you might not want to put cl last (since there may be worse
Windows compilers than MSVC).  And even if it is last it will get
tried on Unix if none of the other entries are found.  That's probably
OK (since it won't compile a C program) but it's possible that the
options passed might do something nasty (pure conjecture - cl might
wait for input on stdin).  Need to dig back and find who raised this
one.

But there's no reason to test for cl under Unix, so if we're putting
OS specific tweaks in AC_PROG_CXX then this is an obvious one to make.

Cheers,
Olly

Reply via email to