aboutsummaryrefslogtreecommitdiff
path: root/ares/m4/cares-compilers.m4
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2009-10-31 04:16:40 +0000
committerYang Tse <yangsita@gmail.com>2009-10-31 04:16:40 +0000
commitce6731baf186807eb8012afeb26c8a304ab8e3ad (patch)
treec64c07507f2395d1190f09d641ce41332b2468df /ares/m4/cares-compilers.m4
parent2c0b65d37b62e4a089d1816197126f5a3f36a09a (diff)
Symbol hiding configure options renamed to the hopefully less ambiguous
--enable-symbol-hiding and --disable-symbol-hiding as well as related macro names and some internal variables used for them. Related configuration file preprocessor symbols named to CARES_SYMBOL_HIDING and CARES_SYMBOL_SCOPE_EXTERN.
Diffstat (limited to 'ares/m4/cares-compilers.m4')
-rw-r--r--ares/m4/cares-compilers.m4179
1 files changed, 86 insertions, 93 deletions
diff --git a/ares/m4/cares-compilers.m4 b/ares/m4/cares-compilers.m4
index a8f1cd58a..68f47efd8 100644
--- a/ares/m4/cares-compilers.m4
+++ b/ares/m4/cares-compilers.m4
@@ -16,7 +16,7 @@
#***************************************************************************
# File version for 'aclocal' use. Keep it a single number.
-# serial 60
+# serial 61
dnl CARES_CHECK_COMPILER
@@ -1249,98 +1249,6 @@ AC_DEFUN([CARES_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE], [
])
-dnl CARES_CHECK_COMPILER_HIDDEN_SYMBOLS
-dnl -------------------------------------------------
-dnl Verify if compiler supports hiding library internal symbols, setting
-dnl shell variable hidden_symbols_supported value as appropriate, as well as
-dnl variables hidden_symbols_CFLAGS and hidden_symbols_extern when supported.
-
-AC_DEFUN([CARES_CHECK_COMPILER_HIDDEN_SYMBOLS], [
- AC_REQUIRE([CARES_CHECK_COMPILER])dnl
- AC_BEFORE([$0],[CARES_CONFIGURE_HIDDEN_SYMBOLS])dnl
- AC_MSG_CHECKING([if compiler supports hiding library internal symbols])
- hidden_symbols_supported="no"
- hidden_symbols_CFLAGS=""
- hidden_symbols_extern=""
- tmp_CFLAGS=""
- tmp_extern=""
- case "$compiler_id" in
- GNU_C)
- dnl Only gcc 3.4 or later
- if test "$compiler_num" -ge "304"; then
- if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ; then
- tmp_extern="__attribute__ ((visibility (\"default\")))"
- tmp_CFLAGS="-fvisibility=hidden"
- hidden_symbols_supported="yes"
- echo " " >&6
- echo "debug: should work with this compiler and version" >&6
- echo " " >&6
- fi
- fi
- ;;
- INTEL_UNIX_C)
- dnl Only icc 9.0 or later
- if test "$compiler_num" -ge "900"; then
- if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ; then
- tmp_extern="__attribute__ ((visibility (\"default\")))"
- tmp_CFLAGS="-fvisibility=hidden"
- hidden_symbols_supported="yes"
- echo " " >&6
- echo "debug: should work with this compiler and version" >&6
- echo " " >&6
- fi
- fi
- ;;
- SUNPRO_C)
- if $CC 2>&1 | grep flags >/dev/null && $CC -flags | grep xldscope= >/dev/null ; then
- tmp_extern="__global"
- tmp_CFLAGS="-xldscope=hidden"
- hidden_symbols_supported="yes"
- echo " " >&6
- echo "debug: should work with this compiler and version" >&6
- echo " " >&6
- fi
- ;;
- esac
- if test "$hidden_symbols_supported" = "yes"; then
- tmp_save_CFLAGS="$CFLAGS"
- CFLAGS="$tmp_save_CFLAGS $tmp_CFLAGS"
- squeeze CFLAGS
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([[
- $tmp_extern char *dummy(char *buff);
- char *dummy(char *buff)
- {
- if(buff)
- return ++buff;
- else
- return buff;
- }
- ]],[[
- char b[16];
- char *r = dummy(&b);
- if(r)
- return (int)*r;
- ]])
- ],[
- hidden_symbols_supported="yes"
- ],[
- hidden_symbols_supported="no"
- sed 's/^/cc-src: /' conftest.$ac_ext >&6
- sed 's/^/cc-err: /' conftest.err >&6
- ])
- CFLAGS="$tmp_save_CFLAGS"
- fi
- if test "$hidden_symbols_supported" = "yes"; then
- AC_MSG_RESULT([yes])
- hidden_symbols_CFLAGS="$tmp_CFLAGS"
- hidden_symbols_extern="$tmp_extern"
- else
- AC_MSG_RESULT([no])
- fi
-])
-
-
dnl CARES_CHECK_COMPILER_STRUCT_MEMBER_SIZE
dnl -------------------------------------------------
dnl Verifies if the compiler is capable of handling the
@@ -1403,6 +1311,91 @@ AC_DEFUN([CARES_CHECK_COMPILER_STRUCT_MEMBER_SIZE], [
])
+dnl CARES_CHECK_COMPILER_SYMBOL_HIDING
+dnl -------------------------------------------------
+dnl Verify if compiler supports hiding library internal symbols, setting
+dnl shell variable supports_symbol_hiding value as appropriate, as well as
+dnl variables symbol_hiding_CFLAGS and symbol_hiding_EXTERN when supported.
+
+AC_DEFUN([CARES_CHECK_COMPILER_SYMBOL_HIDING], [
+ AC_REQUIRE([CARES_CHECK_COMPILER])dnl
+ AC_BEFORE([$0],[CARES_CONFIGURE_SYMBOL_HIDING])dnl
+ AC_MSG_CHECKING([if compiler supports hiding library internal symbols])
+ supports_symbol_hiding="no"
+ symbol_hiding_CFLAGS=""
+ symbol_hiding_EXTERN=""
+ tmp_CFLAGS=""
+ tmp_EXTERN=""
+ case "$compiler_id" in
+ GNU_C)
+ dnl Only gcc 3.4 or later
+ if test "$compiler_num" -ge "304"; then
+ if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ; then
+ tmp_EXTERN="__attribute__ ((visibility (\"default\")))"
+ tmp_CFLAGS="-fvisibility=hidden"
+ supports_symbol_hiding="yes"
+ fi
+ fi
+ ;;
+ INTEL_UNIX_C)
+ dnl Only icc 9.0 or later
+ if test "$compiler_num" -ge "900"; then
+ if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ; then
+ tmp_EXTERN="__attribute__ ((visibility (\"default\")))"
+ tmp_CFLAGS="-fvisibility=hidden"
+ supports_symbol_hiding="yes"
+ fi
+ fi
+ ;;
+ SUNPRO_C)
+ if $CC 2>&1 | grep flags >/dev/null && $CC -flags | grep xldscope= >/dev/null ; then
+ tmp_EXTERN="__global"
+ tmp_CFLAGS="-xldscope=hidden"
+ supports_symbol_hiding="yes"
+ fi
+ ;;
+ esac
+ if test "$supports_symbol_hiding" = "yes"; then
+ tmp_save_CFLAGS="$CFLAGS"
+ CFLAGS="$tmp_save_CFLAGS $tmp_CFLAGS"
+ squeeze CFLAGS
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([[
+ $tmp_EXTERN char *dummy(char *buff);
+ char *dummy(char *buff)
+ {
+ if(buff)
+ return ++buff;
+ else
+ return buff;
+ }
+ ]],[[
+ char b[16];
+ char *r = dummy(&b);
+ if(r)
+ return (int)*r;
+ ]])
+ ],[
+ supports_symbol_hiding="yes"
+ ],[
+ supports_symbol_hiding="no"
+ echo " " >&6
+ sed 's/^/cc-src: /' conftest.$ac_ext >&6
+ sed 's/^/cc-err: /' conftest.err >&6
+ echo " " >&6
+ ])
+ CFLAGS="$tmp_save_CFLAGS"
+ fi
+ if test "$supports_symbol_hiding" = "yes"; then
+ AC_MSG_RESULT([yes])
+ symbol_hiding_CFLAGS="$tmp_CFLAGS"
+ symbol_hiding_EXTERN="$tmp_EXTERN"
+ else
+ AC_MSG_RESULT([no])
+ fi
+])
+
+
dnl CARES_VAR_MATCH (VARNAME, VALUE)
dnl -------------------------------------------------
dnl Verifies if shell variable VARNAME contains VALUE.