automake
[Top][All Lists]
Advanced

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

Re: Sun compiler and /usr/local/include


From: Dave Hart
Subject: Re: Sun compiler and /usr/local/include
Date: Fri, 5 Mar 2010 20:31:41 +0000

On Fri, Mar 5, 2010 at 19:25 UTC, Charles Brown wrote:
>
> Very new to automake, and can't find an answer to this; What would be put in
> configure.ac to determine whether the detected preprocessor/compiler
> automatically supplies -I/usr/local/include (for example, g++ does, but sun
> CC does not), and if not, how to add it to some CFLAGS variable?

To expand on a point Ralf touched on, the typical Autoconf approach is
to predict as little as possible, and test for exactly what you need.
So I would ask you, when your package in built with Sun cc and fails
for lack of -I/usr/local/include, which header file in
/usr/local/include causes the break?  It should be in the compiler's
error message.  And I would suggest you then consider using a
configure.ac test for that specific header file, assuming your code
#includes it, or for the header file your project #includes which
triggers the inclusion of the wrong/missing header.  That test would
then result in the addition of -I/usr/local/include on your Sun cc
configuration.  At the same time, you could easily expand it later if
another system has that header file in a different directory, by
searching a list of directories for the needed .h, rather than simply
/usr/local/include.

Instead of "my project needs -I/foo/include on system bar", I suggest
"my project needs to find the correct foo.h on all systems".

Cheers,
Dave Hart




reply via email to

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