In article <[EMAIL PROTECTED]>, Morten Eriksen wrote:
>[EMAIL PROTECTED] (Olly Betts) writes:
>> Also might it not be better to try each compiler in the list which
>> exists in turn and using the first working one, rather than just
>> trying the first compiler which exists?
>
>The problem with this is that "working" can have a _lot_ of different
>meanings when it comes to C++ compilers. :^/
Sadly true. Also how "working" a C++ compiler is needed varies by
project too. But "can produce executables and isn't actually just a C
compiler" is the minimum any project must need.
Perhaps you'd want to specify what C++ features a project needs and
check for these when probing for a good compiler. But we have to draw
the line somewhere, and we can get most of this if we list our
candidate compilers in order of decreasing "featured-ness".
>> Also, CC is in the list. Under DOS or Windows this risks picking up
>> a "cc.exe" which (chances are) is a C compiler. [...]
>
>There are similar problems on other platforms, CC being tested before
>aCC (if Ossama's latest patch makes it into the Autoconf distribution)
>being one of them.
>
>To sort this out, I would like to be able to 1) grab the default list
>of compilers from Autoconf (call the macro providing this
>functionality AC_CXX_DEFAULT_LIST or something like that), 2) add my
>own "picks" at the front (dependant on what platform I'm on) within
>confiure.in, 3) pass this list back to AC_PROG_CXX.
This seems appealing, but I worry that this is really just providing a
way for the user to work around deficiencies in AC_PROG_CXX's list.
One big advantage of autoconf is you can reuse the accumulated wisdom
of others. Unless different projects will really prefer compilers in
a different order, there's no reason why AC_PROG_CXX can't encapsulate
this platform specific knowledge.
But the problem with saying "oh just fix AC_PROG_CXX" is that autoconf
releases don't occur regularly enough for people to get the fix
without going to the CVS version.
I hesitate to criticise the valiant efforts of the maintainers, but
this does appear to be a general problem with autoconf. I don't feel
I'm using autoconf in advanced ways, but I seem to end up having to
use CVS versions most of the time. Perhaps minor releases with just
bug fixes would help here?
>(Additionally, gradually migrating the knowledge about
>platform-specific checking order into the AC_PROG_CXX macro would
>perhaps be a good thing?)
If I'm going to rewrite it (nobody's objected yet, so I guess I will),
I can incorporate this knowledge. So far I think we have:
* "CC" is an unwise choice for DOS/Windows (not a problem if we check
that the compiler groks C++ so we can ignore this)
* Prefer "aCC" to "CC" (appears to be safe everywhere)
* "cl" could be a lisp compiler on Unix - perhaps only check for it on
DOS and Windows
That all make sense? Any others?
>> Thoughts? I'm happy to do the work, but I'd rather not spend time
>> on it and then get told it's not useful.
>
>I'd love to see this, and would happily do some auditing and testing
>for you.
Great.
Cheers,
Olly