[Freeswitch-branches] [commit] r1804 - in freeswitch/branches/stkn: . src/include

Freeswitch SVN stkn at freeswitch.org
Mon Jul 10 00:36:42 EDT 2006


Author: stkn
Date: Mon Jul 10 00:36:39 2006
New Revision: 1804

Modified:
   freeswitch/branches/stkn/Makefile.am
   freeswitch/branches/stkn/Makefile.in
   freeswitch/branches/stkn/configure
   freeswitch/branches/stkn/configure.in
   freeswitch/branches/stkn/src/include/switch_platform.h

Log:
Add basic support for -fvisibility support with gcc-4.x (and higher) (linux only)

Modified: freeswitch/branches/stkn/Makefile.am
==============================================================================
--- freeswitch/branches/stkn/Makefile.am	(original)
+++ freeswitch/branches/stkn/Makefile.am	Mon Jul 10 00:36:39 2006
@@ -24,6 +24,10 @@
 AM_CFLAGS += -fsigned-char
 endif
 endif
+
+if USE_GCCVISIBILITY
+AM_CFLAGS += -fvisibility=hidden
+endif
 endif
 
 if CRASHPROT

Modified: freeswitch/branches/stkn/Makefile.in
==============================================================================
--- freeswitch/branches/stkn/Makefile.in	(original)
+++ freeswitch/branches/stkn/Makefile.in	Mon Jul 10 00:36:39 2006
@@ -41,10 +41,11 @@
 host_triplet = @host@
 @ISLINUX_TRUE at am__append_1 = -Wl,-E
 @ISGCC_TRUE@@ISLINUX_TRUE@@ISPPC_TRUE at am__append_2 = -fsigned-char
- at CRASHPROT_TRUE@am__append_3 = -DCRASH_PROT
- at IS64BITLINUX_TRUE@am__append_4 = -m64 -march=k8 -fPIC -D_64BIT_MACHINE_
- at IS64BITLINUX_TRUE@am__append_5 = --enable-64bit
- at ISMAC_TRUE@am__append_6 = -DMACOSX
+ at ISLINUX_TRUE@@USE_GCCVISIBILITY_TRUE at am__append_3 = -fvisibility=hidden
+ at CRASHPROT_TRUE@am__append_4 = -DCRASH_PROT
+ at IS64BITLINUX_TRUE@am__append_5 = -m64 -march=k8 -fPIC -D_64BIT_MACHINE_
+ at IS64BITLINUX_TRUE@am__append_6 = --enable-64bit
+ at ISMAC_TRUE@am__append_7 = -DMACOSX
 bin_PROGRAMS = freeswitch$(EXEEXT)
 DIST_COMMON = README $(am__configure_deps) $(library_include_HEADERS) \
 	$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
@@ -199,6 +200,8 @@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
+USE_GCCVISIBILITY_FALSE = @USE_GCCVISIBILITY_FALSE@
+USE_GCCVISIBILITY_TRUE = @USE_GCCVISIBILITY_TRUE@
 VERSION = @VERSION@
 ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
@@ -255,7 +258,7 @@
 AM_CFLAGS = -I$(PREFIX)/include $(shell $(APR_CONFIG) --cflags \
 	--cppflags --includes) -I${prefix}/include/srtp $(shell \
 	$(APU_CONFIG) --includes) $(am__append_2) $(am__append_3) \
-	$(am__append_4) $(am__append_6) -fPIC -Wall \
+	$(am__append_4) $(am__append_5) $(am__append_7) -fPIC -Wall \
 	-I$(PWD)/src/sqlite -I$(PWD) -I$(PWD)/src/include \
 	-I$(PREFIX)/include -DSWITCH_MOD_DIR=\"$(PREFIX)/mod\" \
 	-DSWITCH_PREFIX_DIR=\"$(PREFIX)\" \
@@ -268,7 +271,7 @@
 	$(shell $(APU_CONFIG) --link-ld --libs ) -lm \
 	-L/usr/local/lib/db42 -L/usr/local/lib $(am__append_1)
 OSARCH = $(shell uname -s)
-AM_CFGARGS = $(am__append_5)
+AM_CFGARGS = $(am__append_6)
 @ISMAC_FALSE at SOLINK = -shared -Xlinker -x
 
 #put elsif win here

Modified: freeswitch/branches/stkn/configure
==============================================================================
--- freeswitch/branches/stkn/configure	(original)
+++ freeswitch/branches/stkn/configure	Mon Jul 10 00:36:39 2006
@@ -466,7 +466,7 @@
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE build build_cpu build_vendor build_os host host_cpu host_vendor host_os EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LIBOBJS CRASHPROT_TRUE CRASHPROT_FALSE ISLINUX_TRUE ISLINUX_FALSE ISMAC_TRUE ISMAC_FALSE IS64BITLINUX_TRUE IS64BITLINUX_FALSE ISPPC_TRUE ISPPC_FALSE ISGCC_TRUE ISGCC_FALSE LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE build build_cpu build_vendor build_os host host_cpu host_vendor host_os EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LIBOBJS CRASHPROT_TRUE CRASHPROT_FALSE ISLINUX_TRUE ISLINUX_FALSE ISMAC_TRUE ISMAC_FALSE IS64BITLINUX_TRUE IS64BITLINUX_FALSE ISPPC_TRUE ISPPC_FALSE ISGCC_TRUE ISGCC_FALSE USE_GCCVISIBILITY_TRUE USE_GCCVISIBILITY_FALSE LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -1038,6 +1038,8 @@
                           optimize for fast installation [default=yes]
   --disable-libtool-lock  avoid locking (might break parallel builds)
   --enable-crash-protection         Compile with CRASH Protection
+  --enable-visibility     Enable -fvisibility=hidden on Linux systems with GCC
+                          4.0 and higher
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -3827,7 +3829,7 @@
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 3830 "configure"' > conftest.$ac_ext
+  echo '#line 3832 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -5426,7 +5428,7 @@
 
 
 # Provide some information about the compiler.
-echo "$as_me:5429:" \
+echo "$as_me:5431:" \
      "checking for Fortran 77 compiler version" >&5
 ac_compiler=`set X $ac_compile; echo $2`
 { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
@@ -6550,11 +6552,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6553: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6555: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:6557: \$? = $ac_status" >&5
+   echo "$as_me:6559: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -6818,11 +6820,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6821: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6823: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:6825: \$? = $ac_status" >&5
+   echo "$as_me:6827: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -6922,11 +6924,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6925: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6927: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:6929: \$? = $ac_status" >&5
+   echo "$as_me:6931: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -9304,7 +9306,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 9307 "configure"
+#line 9309 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -9404,7 +9406,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 9407 "configure"
+#line 9409 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11744,11 +11746,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:11747: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:11749: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:11751: \$? = $ac_status" >&5
+   echo "$as_me:11753: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -11848,11 +11850,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:11851: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:11853: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:11855: \$? = $ac_status" >&5
+   echo "$as_me:11857: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -13455,11 +13457,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13458: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13460: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:13462: \$? = $ac_status" >&5
+   echo "$as_me:13464: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -13559,11 +13561,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13562: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13564: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:13566: \$? = $ac_status" >&5
+   echo "$as_me:13568: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -15799,11 +15801,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15802: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15804: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:15806: \$? = $ac_status" >&5
+   echo "$as_me:15808: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -16067,11 +16069,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16070: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16072: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:16074: \$? = $ac_status" >&5
+   echo "$as_me:16076: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -16171,11 +16173,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16174: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16176: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:16178: \$? = $ac_status" >&5
+   echo "$as_me:16180: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -20863,6 +20865,38 @@
 fi
 
 
+#
+# check for gcc -fvisibility support
+#
+# Check whether --enable-visibility or --disable-visibility was given.
+if test "${enable_visibility+set}" = set; then
+  enableval="$enable_visibility"
+
+else
+  enable_visibility="no"
+fi;
+
+GCC_VER=0
+if test "x$GCC" = "xyes" && test "x$enable_visibility" = "xyes"
+then
+	# check gcc version
+	echo "$as_me:$LINENO: checking GCC Version" >&5
+echo $ECHO_N "checking GCC Version... $ECHO_C" >&6
+	GCC_VER=`echo | $CC -E -dM - | $AWK '/__GNUC__/{ print $3 }'`
+	echo "$as_me:$LINENO: result: $GCC_VER" >&5
+echo "${ECHO_T}$GCC_VER" >&6
+fi
+
+
+if test $GCC_VER -ge 4; then
+  USE_GCCVISIBILITY_TRUE=
+  USE_GCCVISIBILITY_FALSE='#'
+else
+  USE_GCCVISIBILITY_TRUE='#'
+  USE_GCCVISIBILITY_FALSE=
+fi
+
+
           ac_config_files="$ac_config_files src/include/switch_version.h"
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -21018,6 +21052,13 @@
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
+if test -z "${USE_GCCVISIBILITY_TRUE}" && test -z "${USE_GCCVISIBILITY_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"USE_GCCVISIBILITY\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"USE_GCCVISIBILITY\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
 
 : ${CONFIG_STATUS=./config.status}
 ac_clean_files_save=$ac_clean_files
@@ -21629,6 +21670,8 @@
 s, at ISPPC_FALSE@,$ISPPC_FALSE,;t t
 s, at ISGCC_TRUE@,$ISGCC_TRUE,;t t
 s, at ISGCC_FALSE@,$ISGCC_FALSE,;t t
+s, at USE_GCCVISIBILITY_TRUE@,$USE_GCCVISIBILITY_TRUE,;t t
+s, at USE_GCCVISIBILITY_FALSE@,$USE_GCCVISIBILITY_FALSE,;t t
 s, at LTLIBOBJS@,$LTLIBOBJS,;t t
 CEOF
 

Modified: freeswitch/branches/stkn/configure.in
==============================================================================
--- freeswitch/branches/stkn/configure.in	(original)
+++ freeswitch/branches/stkn/configure.in	Mon Jul 10 00:36:39 2006
@@ -66,4 +66,21 @@
 AM_CONDITIONAL(ISPPC, [test "$MACHINE" = "ppc"])
 AM_CONDITIONAL(ISGCC, [test "$GCC" = "yes"])
 
+#
+# check for gcc -fvisibility support
+#
+AC_ARG_ENABLE([visibility],
+		[AC_HELP_STRING([--enable-visibility],
+				[Enable -fvisibility=hidden on Linux systems with GCC 4.0 and higher])],,[enable_visibility="no"])
+
+GCC_VER=0
+if test "x$GCC" = "xyes" && test "x$enable_visibility" = "xyes"
+then
+	# check gcc version
+	AC_MSG_CHECKING([GCC Version])
+	GCC_VER=`echo | $CC -E -dM - | $AWK '/__GNUC__/{ print $3 }'`
+	AC_MSG_RESULT([$GCC_VER])
+fi
+AM_CONDITIONAL(USE_GCCVISIBILITY, [test $GCC_VER -ge 4])
+
 AC_OUTPUT([src/include/switch_version.h])

Modified: freeswitch/branches/stkn/src/include/switch_platform.h
==============================================================================
--- freeswitch/branches/stkn/src/include/switch_platform.h	(original)
+++ freeswitch/branches/stkn/src/include/switch_platform.h	Mon Jul 10 00:36:39 2006
@@ -139,7 +139,14 @@
 #define SWITCH_MOD_DECLARE(type)		__declspec(dllimport) type __cdecl
 #endif
 #define SIGHUP SIGTERM
-#else //not win32
+
+#elif defined(__linux__) && defined(__GNUC__) && __GNUC__ >= 4
+#define SWITCH_DECLARE(type)			__attribute__ ((visibility("default"))) type
+#define SWITCH_DECLARE_NONSTD(type)		__attribute__ ((visibility("default"))) type
+#define SWITCH_MOD_DECLARE(type)		__attribute__ ((visibility("default"))) type
+#define SWITCH_DECLARE_DATA			__attribute__ ((visibility("default")))
+
+#else //not win32 or linux w/ >=gcc-4.0
 #define SWITCH_DECLARE(type) type
 #define SWITCH_DECLARE_NONSTD(type) type
 #define SWITCH_MOD_DECLARE(type) type



More information about the Freeswitch-branches mailing list