2008-01-15 Alp Toker <alp@atoker.com>
authoralp@webkit.org <alp@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Jan 2008 21:47:25 +0000 (21:47 +0000)
committeralp@webkit.org <alp@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Jan 2008 21:47:25 +0000 (21:47 +0000)
        GTK+/autotools build fix for GCC < 4. Use the -fvisibility compiler
        flags only when they're available.

        Additionally, use -fvisibility-inlines-hidden in both debug and
        release builds when available to match the Mac build.

        * GNUmakefile.am:
        * configure.ac:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@29494 268f45cc-cd09-0410-ab3c-d52691b4dbfc

ChangeLog
GNUmakefile.am
configure.ac

index 4c4ed82..6cd8246 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2008-01-15  Alp Toker  <alp@atoker.com>
+
+        GTK+/autotools build fix for GCC < 4. Use the -fvisibility compiler
+        flags only when they're available.
+
+        Additionally, use -fvisibility-inlines-hidden in both debug and
+        release builds when available to match the Mac build.
+
+        * GNUmakefile.am:
+        * configure.ac:
+
 2008-01-12  Alp Toker  <alp@atoker.com>
 
         Reviewed by Mark Rowe.
index 7df3d57..463aeba 100644 (file)
@@ -61,12 +61,12 @@ global_cflags := \
        -Wall -W -Wcast-align -Wchar-subscripts -Wreturn-type \
        -Wformat -Wformat-security -Wno-format-y2k -Wundef \
        -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings \
-       -Wno-unused-parameter
+       -Wno-unused-parameter $(SYMBOL_VISIBILITY_INLINES)
 
 if !ENABLE_DEBUG
 global_cflags += \
        -fno-rtti -fno-exceptions \
-       -fvisibility=hidden -fvisibility-inlines-hidden
+       $(SYMBOL_VISIBILITY)
 endif
 
 # Shared libraries
index 74ac277..5743d7a 100644 (file)
@@ -53,6 +53,18 @@ AM_PROG_CC_STDC
 AC_PROG_CXX
 AM_PROG_CC_C_O
 
+# check for -fvisibility=hidden compiler support (GCC >= 4)    
+saved_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
+AC_MSG_CHECKING([if ${CXX} supports -fvisibility=hidden -fvisibility-inlines-hidden])
+AC_COMPILE_IFELSE([char foo;],
+      [ AC_MSG_RESULT([yes])
+        SYMBOL_VISIBILITY="-fvisibility=hidden" SYMBOL_VISIBILITY_INLINES="-fvisibility-inlines-hidden" ],
+        AC_MSG_RESULT([no]))
+CFLAGS="$saved_CFLAGS"
+AC_SUBST(SYMBOL_VISIBILITY)
+AC_SUBST(SYMBOL_VISIBILITY_INLINES)
+
 AC_PATH_PROG(PERL, perl)
 if test -z "$PERL"; then
    AC_MSG_ERROR([You need 'perl' to compile WebKit])