autoconf
[Top][All Lists]
Advanced

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

Re: conditionally compiling C++ code


From: Ronald Landheer-Cieslak
Subject: Re: conditionally compiling C++ code
Date: Tue, 29 Apr 2003 09:49:05 +0200 (CEST)

On Mon, 28 Apr 2003, Thomas Dickey wrote:
> On Mon, Apr 28, 2003 at 11:00:47PM +0200, Peter Eisentraut wrote:
>> Steve M. Robbins writes:
>>> But this third way doesn't work!  AC_PROG_CXX fails if there is no C++
>>> compiler and configure aborts.
>>> The lack of a nonfatal check for C++ is the cause of my complaint,
>>> too.
>> I would advise against writing configure scripts that check whether some
>> library or program exists, and if not, automatically disable some feature
>> of the package altogether.  This leads to tons of problems downstream.
>> 
>> Example: For years, we shipped a configure script with the logic that if
> bad example: if the configure script cannot find readline, the program
> can't use it.
> try to think of a plausible example (if you're able).
Simple: same scenario (readline not installed in default location, program 
needs it with the current configuration (the one the user asked for)).

If readline is not found, display instructions on
1. how to tell the configure script where readline is if it is installed
2. how to disable readline support (command-line option to the configury)
and exit.

Note that for this:
1. the macro that looks for the feature most not exit the script when the 
   feature is not found (else the script can't display its messages and 
   thus quit more gracefully)
2. the user must have the option to not use a macro (thus the macro must 
   be able to be run optionally)
3. the programmer of the configure.ac script must handle the results of 
   the macros
1 and 2 are *not* OK for AC_PROG_CXX (and hence 3 is impossible).

rlc






reply via email to

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