[Freeswitch-svn] [commit] r13117 - freeswitch/trunk/libs/speex
FreeSWITCH SVN
stkn at freeswitch.org
Wed Apr 22 10:44:35 PDT 2009
Author: stkn
Date: Wed Apr 22 12:44:35 2009
New Revision: 13117
Log:
Add visibility support for suncc on solaris
Modified:
freeswitch/trunk/libs/speex/acinclude.m4
freeswitch/trunk/libs/speex/configure.ac
Modified: freeswitch/trunk/libs/speex/acinclude.m4
==============================================================================
--- freeswitch/trunk/libs/speex/acinclude.m4 (original)
+++ freeswitch/trunk/libs/speex/acinclude.m4 Wed Apr 22 12:44:35 2009
@@ -100,3 +100,20 @@
AC_SUBST(OGG_LIBS)
rm -f conf.oggtest
])
+
+
+AC_DEFUN([AX_COMPILER_VENDOR],
+[
+AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor,
+ [ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=unknown
+ # note: don't check for gcc first since some other compilers define __GNUC__
+ for ventest in intel:__ICC,__ECC,__INTEL_COMPILER ibm:__xlc__,__xlC__,__IBMC__,__IBMCPP__ gnu:__GNUC__ sun:__SUNPRO_C,__SUNPRO_CC hp:__HP_cc,__HP_aCC dec:__DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland:__BORLANDC__,__TURBOC__ comeau:__COMO__ cray:_CRAYC kai:__KCC lcc:__LCC__ metrowerks:__MWERKS__ sgi:__sgi,sgi microsoft:_MSC_VER watcom:__WATCOMC__ portland:__PGI; do
+ vencpp="defined("`echo $ventest | cut -d: -f2 | sed 's/,/) || defined(/g'`")"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[
+#if !($vencpp)
+ thisisanerror;
+#endif
+])], [ax_cv_]_AC_LANG_ABBREV[_compiler_vendor=`echo $ventest | cut -d: -f1`; break])
+ done
+ ])
+])
Modified: freeswitch/trunk/libs/speex/configure.ac
==============================================================================
--- freeswitch/trunk/libs/speex/configure.ac (original)
+++ freeswitch/trunk/libs/speex/configure.ac Wed Apr 22 12:44:35 2009
@@ -38,6 +38,7 @@
AC_C_INLINE
AC_C_RESTRICT
+AX_COMPILER_VENDOR
AC_MSG_CHECKING(for C99 variable-size arrays)
AC_TRY_COMPILE( , [
@@ -89,25 +90,52 @@
)
AC_MSG_RESULT($has_sse)
-SAVE_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -fvisibility=hidden"
AC_MSG_CHECKING(for ELF visibility)
-AC_COMPILE_IFELSE([
-AC_LANG_PROGRAM([[
-#pragma GCC visibility push(hidden)
-__attribute__((visibility("default")))
-int var=10;
-]])],
-[
-has_visibility=yes
-AC_DEFINE([EXPORT], [__attribute__((visibility("default")))], [Symbol visibility prefix])
-],
-[
-has_visibility=no
-AC_DEFINE([EXPORT], [], [Symbol visibility prefix])
-CFLAGS="$SAVE_CFLAGS"
-]
-)
+case "$ax_cv_c_compiler_vendor" in
+gnu)
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -fvisibility=hidden"
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([[
+ #pragma GCC visibility push(hidden)
+ __attribute__((visibility("default")))
+ int var=10;
+ ]])],
+ [
+ has_visibility=yes
+ AC_DEFINE([EXPORT], [__attribute__((visibility("default")))], [Symbol visibility prefix])
+ ],
+ [
+ has_visibility=no
+ AC_DEFINE([EXPORT], [], [Symbol visibility prefix])
+ CFLAGS="$SAVE_CFLAGS"
+ ]
+ )
+ ;;
+sun)
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -xldscope=hidden"
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([[
+ __attribute__((visibility("default")))
+ int var=10;
+ ]])],
+ [
+ has_visibility=yes
+ AC_DEFINE([EXPORT], [__attribute__((visibility("default")))], [Symbol visibility prefix])
+ ],
+ [
+ has_visibility=no
+ AC_DEFINE([EXPORT], [], [Symbol visibility prefix])
+ CFLAGS="$SAVE_CFLAGS"
+ ]
+ )
+ ;;
+*)
+ has_visibility=no
+ AC_DEFINE([EXPORT], [], [Symbol visibility prefix])
+ ;;
+esac
AC_MSG_RESULT($has_visibility)
AC_CHECK_HEADERS(sys/soundcard.h sys/audioio.h)
More information about the Freeswitch-svn
mailing list