[Top][All Lists]

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

Re: Testing for compiler capabilities

From: David Fang
Subject: Re: Testing for compiler capabilities
Date: Tue, 22 Aug 2006 14:00:02 -0400 (EDT)

> is there a simple macro that will test for a specific compiler flag and set
> a variable in both Makefile and config.h?
> I am looking for an easy way to test for GCC's -fvisibility=hidden and
> have an indicator whether or not it is available in said files.

        Here's (attached) a test for visibility attributes instead of
visibility flags, which might give the same effect.  It defines the
HAVE_ATTRIBUTE_VISIBILITY_DEFAULT if the respective attributes are
understood.  You can easily add an AM_CONDITIONAL to it as well.  This
particular test runs in C++ mode.  I had to temporarily add the -Werror
flag to the compile flags to make the compiler reject warnings about
unsupported attributes.  Feedback is welcome.


Attachment: visibility.m4
Description: Text document

reply via email to

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