[Mesa-dev] [PATCH 1/2] Fix config check that claims to test if CXX supports -fvisibility=hidden option to actually test the C++ compiler.
Dan Nicholson
dbn.lists at gmail.com
Wed Apr 27 03:32:57 PDT 2011
On Tue, Apr 26, 2011 at 5:00 AM, Jon TURNEY <jon.turney at dronecode.org.uk> wrote:
> Looking at this bit of autofoolery, I notice that at the moment it is just
> checking if CC supports -fvisibility=hidden twice
>
> Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
> ---
> configure.ac | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 3b05ca3..37ea5e7 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -170,8 +170,10 @@ if test "x$GXX" = xyes; then
> AC_MSG_CHECKING([whether $CXX supports -fvisibility=hidden])
> VISIBILITY_CXXFLAGS="-fvisibility=hidden"
> CXXFLAGS="$CXXFLAGS $VISIBILITY_CXXFLAGS"
> + AC_LANG_PUSH([C++])
> AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
> [VISIBILITY_CXXFLAGS="" ; AC_MSG_RESULT([no])]);
> + AC_LANG_POP([C++])
>
> # Restore CXXFLAGS; VISIBILITY_CXXFLAGS are added to it where needed.
> CXXFLAGS=$save_CXXFLAGS
I'm not super familiar with how AC_LANG_PROGRAM works, but this seems
right as it should use whatever AC_LANG is.
http://www.gnu.org/software/autoconf/manual/autoconf.html#Language-Choice
http://www.gnu.org/software/autoconf/manual/autoconf.html#Writing-Test-Programs
--
Dan
More information about the mesa-dev
mailing list