aboutsummaryrefslogtreecommitdiff
path: root/libitm/configure
diff options
context:
space:
mode:
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2011-11-21 17:03:50 +0000
committerRainer Orth <ro@gcc.gnu.org>2011-11-21 17:03:50 +0000
commitadcd36bc3fb6d707477683284024d11c179a4822 (patch)
treec02f30287a054a81055483a7e265e0d78137c81f /libitm/configure
parentd4b4b54263c81a0fbebc54580ab3ebb279d14d54 (diff)
downloadgcc-adcd36bc3fb6d707477683284024d11c179a4822.zip
gcc-adcd36bc3fb6d707477683284024d11c179a4822.tar.gz
gcc-adcd36bc3fb6d707477683284024d11c179a4822.tar.bz2
Support sun symbol versioning in libitm
libitm: * acinclude.m4 (LIBITM_CHECK_LINKER_FEATURES): Handle gold. (LIBITM_ENABLE_SYMVERS): Handle sun style. * Makefile.am: Handle sun style versioning. (libitm_la_LINK): Add $(libitm_la_LDFLAGS). * configure: Regenerate. * Makefile.in: Regenerate. contrib: * make_sunver.pl: Convert '?' in glob patterns to '.'. From-SVN: r181588
Diffstat (limited to 'libitm/configure')
-rw-r--r--libitm/configure95
1 files changed, 81 insertions, 14 deletions
diff --git a/libitm/configure b/libitm/configure
index 5fafca3..1512ad1 100644
--- a/libitm/configure
+++ b/libitm/configure
@@ -611,6 +611,10 @@ link_itm
XLDFLAGS
XCFLAGS
config_path
+LIBITM_BUILD_VERSIONED_SHLIB_SUN_FALSE
+LIBITM_BUILD_VERSIONED_SHLIB_SUN_TRUE
+LIBITM_BUILD_VERSIONED_SHLIB_GNU_FALSE
+LIBITM_BUILD_VERSIONED_SHLIB_GNU_TRUE
LIBITM_BUILD_VERSIONED_SHLIB_FALSE
LIBITM_BUILD_VERSIONED_SHLIB_TRUE
OPT_LDFLAGS
@@ -11716,7 +11720,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11719 "configure"
+#line 11723 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11822,7 +11826,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11825 "configure"
+#line 11829 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -16688,9 +16692,13 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
# Start by getting the version number. I think the libtool test already
# does some of this, but throws away the result.
+ libitm_ld_is_gold=no
+ if $LD --version 2>/dev/null | grep 'GNU gold'> /dev/null 2>&1; then
+ libitm_ld_is_gold=yes
+ fi
- ldver=`$LD --version 2>/dev/null | head -1 | \
- sed -e 's/GNU ld \(version \)\{0,1\}\(([^)]*) \)\{0,1\}\([0-9.][0-9.]*\).*/\3/'`
+ ldver=`$LD --version 2>/dev/null |
+ sed -e 's/GNU gold /GNU ld /;s/GNU ld version /GNU ld /;s/GNU ld ([^)]*) /GNU ld /;s/GNU ld \([0-9.][0-9.]*\).*/\1/; q'`
libitm_gnu_ld_version=`echo $ldver | \
$AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`
@@ -16764,7 +16772,7 @@ $as_echo "$ac_sectionLDflags" >&6; }
if test "${enable_symvers+set}" = set; then :
enableval=$enable_symvers;
case "$enableval" in
- yes|no|gnu) ;;
+ yes|no|gnu*|sun) ;;
*) as_fn_error "Unknown argument to enable/disable symvers" "$LINENO" 5 ;;
esac
@@ -16777,11 +16785,44 @@ fi
# If we never went through the LIBITM_CHECK_LINKER_FEATURES macro, then we
# don't know enough about $LD to do tricks...
-# FIXME The following test is too strict, in theory.
-if test $enable_shared = no ||
- test "x$LD" = x ||
- test x$libitm_gnu_ld_version = x; then
- enable_symvers=no
+
+# Turn a 'yes' into a suitable default.
+if test x$enable_symvers = xyes ; then
+ # FIXME The following test is too strict, in theory.
+ if test $enable_shared = no || test "x$LD" = x; then
+ enable_symvers=no
+ else
+ if test $with_gnu_ld = yes ; then
+ enable_symvers=gnu
+ else
+ case ${target_os} in
+ # Sun symbol versioning exists since Solaris 2.5.
+ solaris2.[5-9]* | solaris2.1[0-9]*)
+ enable_symvers=sun ;;
+ *)
+ enable_symvers=no ;;
+ esac
+ fi
+ fi
+fi
+
+# Check if 'sun' was requested on non-Solaris 2 platforms.
+if test x$enable_symvers = xsun ; then
+ case ${target_os} in
+ solaris2*)
+ # All fine.
+ ;;
+ *)
+ # Unlikely to work.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === You have requested Sun symbol versioning, but" >&5
+$as_echo "$as_me: WARNING: === You have requested Sun symbol versioning, but" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === you are not targetting Solaris 2." >&5
+$as_echo "$as_me: WARNING: === you are not targetting Solaris 2." >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === Symbol versioning will be disabled." >&5
+$as_echo "$as_me: WARNING: === Symbol versioning will be disabled." >&2;}
+ enable_symvers=no
+ ;;
+ esac
fi
# Check to see if libgcc_s exists, indicating that shared libgcc is possible.
@@ -16850,12 +16891,12 @@ libitm_min_gnu_ld_version=21400
# Check to see if unspecified "yes" value can win, given results above.
# Change "yes" into either "no" or a style name.
-if test $enable_symvers = yes; then
- if test $with_gnu_ld = yes &&
- test $libitm_shared_libgcc = yes;
- then
+if test $enable_symvers != no && test $libitm_shared_libgcc = yes; then
+ if test $with_gnu_ld = yes; then
if test $libitm_gnu_ld_version -ge $libitm_min_gnu_ld_version ; then
enable_symvers=gnu
+ elif test $libitm_ld_is_gold = yes ; then
+ enable_symvers=gnu
else
# The right tools, the right setup, but too old. Fallbacks?
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === Linker version $libitm_gnu_ld_version is too old for" >&5
@@ -16878,6 +16919,8 @@ $as_echo "$as_me: WARNING: === Symbol versioning will be disabled." >&2;}
enable_symvers=no
fi
fi
+ elif test $enable_symvers = sun; then
+ : All interesting versions of Sun ld support sun style symbol versioning.
else
# just fail for now
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === You have requested some kind of symbol versioning, but" >&5
@@ -16900,6 +16943,22 @@ else
LIBITM_BUILD_VERSIONED_SHLIB_FALSE=
fi
+ if test $enable_symvers = gnu; then
+ LIBITM_BUILD_VERSIONED_SHLIB_GNU_TRUE=
+ LIBITM_BUILD_VERSIONED_SHLIB_GNU_FALSE='#'
+else
+ LIBITM_BUILD_VERSIONED_SHLIB_GNU_TRUE='#'
+ LIBITM_BUILD_VERSIONED_SHLIB_GNU_FALSE=
+fi
+
+ if test $enable_symvers = sun; then
+ LIBITM_BUILD_VERSIONED_SHLIB_SUN_TRUE=
+ LIBITM_BUILD_VERSIONED_SHLIB_SUN_FALSE='#'
+else
+ LIBITM_BUILD_VERSIONED_SHLIB_SUN_TRUE='#'
+ LIBITM_BUILD_VERSIONED_SHLIB_SUN_FALSE=
+fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: versioning on shared library symbols is $enable_symvers" >&5
$as_echo "$as_me: versioning on shared library symbols is $enable_symvers" >&6;}
@@ -17424,6 +17483,14 @@ if test -z "${LIBITM_BUILD_VERSIONED_SHLIB_TRUE}" && test -z "${LIBITM_BUILD_VER
as_fn_error "conditional \"LIBITM_BUILD_VERSIONED_SHLIB\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${LIBITM_BUILD_VERSIONED_SHLIB_GNU_TRUE}" && test -z "${LIBITM_BUILD_VERSIONED_SHLIB_GNU_FALSE}"; then
+ as_fn_error "conditional \"LIBITM_BUILD_VERSIONED_SHLIB_GNU\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${LIBITM_BUILD_VERSIONED_SHLIB_SUN_TRUE}" && test -z "${LIBITM_BUILD_VERSIONED_SHLIB_SUN_FALSE}"; then
+ as_fn_error "conditional \"LIBITM_BUILD_VERSIONED_SHLIB_SUN\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${ARCH_X86_TRUE}" && test -z "${ARCH_X86_FALSE}"; then
as_fn_error "conditional \"ARCH_X86\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5