diff options
author | Alan Coopersmith <alan.coopersmith@sun.com> | 2010-01-16 18:34:23 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@sun.com> | 2010-01-19 10:15:55 -0800 |
commit | adda7f3215a0f749751977cbbb6cef67f7163be5 (patch) | |
tree | 020c2005d76d7a934fc20b2c74476c6af76b8dc3 /configure.ac | |
parent | aec3fe82e490efa36c432b2f43cbeebefa91e88f (diff) |
Check if gcc supports -fvisibility=hidden before adding to CFLAGS
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index d01d0f1884..f121002d4b 100644 --- a/configure.ac +++ b/configure.ac @@ -96,7 +96,14 @@ esac dnl Add flags for gcc and g++ if test "x$GCC" = xyes; then - CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -std=c99 -ffast-math -fvisibility=hidden" + CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -std=c99 -ffast-math" + + # Enable -fvisibility=hidden if using a gcc that supports it + save_CFLAGS="$CFLAGS" + AC_MSG_CHECKING([whether $(CC) supports -fvisibility=hidden]) + CFLAGS="$CFLAGS -fvisibility=hidden" + AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]), + [CFLAGS="$save_CFLAGS" ; AC_MSG_RESULT([no])]); # Work around aliasing bugs - developers should comment this out CFLAGS="$CFLAGS -fno-strict-aliasing" |