Date: Tue, 4 Apr 2000 16:34:04 +0200 (MET DST)
   From: Peter Eisentraut <[EMAIL PROTECTED]>

   What I would like is a general solution that tells me what compiler I'm
   using so I can add custom options. For example, the project I contribute
   to needs the option '-Olimit 2000' on OSF/1 for reasons beyond me.... We
   currently have code that pretty much infers the compiler vendor from the
   system triple and [ $GCC != "yes ] but that doesn't suffice because
   vendors change their compilers over time.

The autoconf philosophy is that you shouldn't test for compiler or OS
version; you should test for specific features.  For example, if a
compiler needs the option "-Olimit 2000" for some reason, then you
should write a test case that exposes the need for this option, have
configure try to compile the test case, and have it append the
"-Olimit 2000" option only if the compilation fails without the option
and succeeds with the option.  This should insulate you from compiler
changes without your having to maintain a database of which compiler
versions have which bugs.

I realize that it's not always possible to use the autoconf approach
for pragmatic reasons (certainly I've strayed from the approach myself
:-), but in my experience for most configuration problems the autoconf
approach is the best way in the long run.

Reply via email to