configure.ac : Add -fvisibility=hidden to OSX build.
authorErik de Castro Lopo <erikd@mega-nerd.com>
Sun, 25 May 2014 09:42:53 +0000 (19:42 +1000)
committerErik de Castro Lopo <erikd@mega-nerd.com>
Sun, 25 May 2014 09:42:57 +0000 (19:42 +1000)
Patch-from : Ozkan Sezer <sezeroz@gmail.com>

configure.ac

index 6d0fa00..d3c302a 100644 (file)
@@ -395,7 +395,6 @@ if test x$ac_cv_c_compiler_gnu = xyes ; then
        CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return -Wcast-align -Wnested-externs -Wshadow -Wundef -Wmissing-declarations -Wunreachable-code " # -Wcast-qual -Wbad-function-cast -Wwrite-strings -Winline -Wconversion
        CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wcast-align -Wshadow -Wwrite-strings -Wctor-dtor-privacy -Wnon-virtual-dtor -Wreorder -Wsign-promo -Wundef -Wunreachable-code " # -Wcast-qual -Wbad-function-cast -Wwrite-strings -Woverloaded-virtual -Wmissing-declarations
 
-
        XIPH_ADD_CFLAGS([-Wdeclaration-after-statement])
        XIPH_ADD_CFLAGS([-D_FORTIFY_SOURCE=2])
 
@@ -409,6 +408,12 @@ if test x$ac_cv_c_compiler_gnu = xyes ; then
                CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
                fi
 
+       if test "$GCC_MAJOR_VERSION" -ge 4 && test "$OBJ_FORMAT" = macho; then
+               CPPFLAGS="$CPPFLAGS -DFLAC__USE_VISIBILITY_ATTR"
+               CFLAGS="$CFLAGS -fvisibility=hidden"
+               CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
+               fi
+
        if test "x$GCC_MAJOR_VERSION$GCC_MINOR_VERSION" = "x42" ; then
                XIPH_ADD_CFLAGS([-fgnu89-inline])
                fi