X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=libitm%2Fconfigure;h=30d2f73b0c909506d41ea16c232061b4c1926915;hb=257278ce24d0d3498754fc30ed0d5d2d3690f4d8;hp=0f0ec1fc77a0cd4e60d1a557f9c4a2ff5a17fe82;hpb=67ba1f57ef6bafdcc0d5e43dbe5793367622977b;p=pf3gnuchains%2Fgcc-fork.git diff --git a/libitm/configure b/libitm/configure index 0f0ec1fc77a..30d2f73b0c9 100644 --- a/libitm/configure +++ b/libitm/configure @@ -603,16 +603,27 @@ LTLIBOBJS LIBOBJS ARCH_FUTEX_FALSE ARCH_FUTEX_TRUE +ARCH_X86_AVX_FALSE +ARCH_X86_AVX_TRUE ARCH_X86_FALSE ARCH_X86_TRUE +ARCH_ARM_FALSE +ARCH_ARM_TRUE 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 SECTION_LDFLAGS +HAVE_HWCAP_FALSE +HAVE_HWCAP_TRUE +HWCAP_LDFLAGS libtool_VERSION MAINT MAINTAINER_MODE_FALSE @@ -2217,6 +2228,51 @@ rm -f conftest.val return $ac_retval } # ac_fn_c_compute_int + +# ac_fn_c_check_decl LINENO SYMBOL VAR +# ------------------------------------ +# Tests whether SYMBOL is declared, setting cache variable VAR accordingly. +ac_fn_c_check_decl () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + as_decl_name=`echo $2|sed 's/ *(.*//'` + as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +$as_echo_n "checking whether $as_decl_name is declared... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_decl cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. @@ -2788,6 +2844,7 @@ target_alias=${target_alias-$host_alias} # no-define: PACKAGE and VERSION will not be #define'd in config.h (a bunch # of other PACKAGE_* variables will, however, and there's nothing # we can do about that; they come from AC_INIT). +# no-dist: we don't want 'dist' and related rules. # foreign: we don't follow the normal rules for GNU packages (no COPYING # file in the top srcdir, etc, etc), so stop complaining. # -Wall: turns on all automake warnings... @@ -9949,7 +10006,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) + freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes @@ -10862,7 +10919,7 @@ freebsd* | dragonfly*) objformat=`/usr/bin/objformat` else case $host_os in - freebsd[123]*) objformat=aout ;; + freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi @@ -10880,7 +10937,7 @@ freebsd* | dragonfly*) esac shlibpath_var=LD_LIBRARY_PATH case $host_os in - freebsd2*) + freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) @@ -11714,7 +11771,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11717 "configure" +#line 11774 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11820,7 +11877,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11823 "configure" +#line 11880 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12746,7 +12803,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi esac ;; - freebsd[12]*) + freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF ld_shlibs_CXX=no @@ -14521,7 +14578,7 @@ freebsd* | dragonfly*) objformat=`/usr/bin/objformat` else case $host_os in - freebsd[123]*) objformat=aout ;; + freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi @@ -14539,7 +14596,7 @@ freebsd* | dragonfly*) esac shlibpath_var=LD_LIBRARY_PATH case $host_os in - freebsd2*) + freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) @@ -16444,7 +16501,7 @@ $as_echo "#define HAVE_TLS 1" >>confdefs.h fi -# See what sort of export controls are availible. +# See what sort of export controls are available. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target supports hidden visibility" >&5 $as_echo_n "checking whether the target supports hidden visibility... " >&6; } @@ -16551,6 +16608,8 @@ $as_echo "#define HAVE_ATTRIBUTE_ALIAS 1" >>confdefs.h fi +# Check linker hardware capability support. + # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : @@ -16661,6 +16720,59 @@ with_gnu_ld=$lt_cv_prog_gnu_ld + test -z "$HWCAP_LDFLAGS" && HWCAP_LDFLAGS='' + + + ac_save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LFLAGS -Wl,-M,$srcdir/clearcap.map" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld that supports -Wl,-M,mapfile" >&5 +$as_echo_n "checking for ld that supports -Wl,-M,mapfile... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_hwcap_ldflags=yes +else + ac_hwcap_ldflags=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$ac_hwcap_ldflags" = "yes"; then + HWCAP_LDFLAGS="-Wl,-M,$srcdir/clearcap.map $HWCAP_LDFLAGS" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_hwcap_ldflags" >&5 +$as_echo "$ac_hwcap_ldflags" >&6; } + + LDFLAGS="$ac_save_LDFLAGS" + + + + if test $ac_hwcap_ldflags != no; then + HAVE_HWCAP_TRUE= + HAVE_HWCAP_FALSE='#' +else + HAVE_HWCAP_TRUE='#' + HAVE_HWCAP_FALSE= +fi + + +# If defaulting to -mavx, don't clear hwcaps. +ac_fn_c_check_decl "$LINENO" "__AVX__" "ac_cv_have_decl___AVX__" "$ac_includes_default" +if test "x$ac_cv_have_decl___AVX__" = x""yes; then : + HWCAP_LDFLAGS='' +fi + + + # If we're not using GNU ld, then there's no point in even trying these # tests. Check for that first. We should have already tested for gld # by now (in libtool), but require it now just to be safe... @@ -16686,9 +16798,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 }'` @@ -16762,7 +16878,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 @@ -16775,11 +16891,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. @@ -16848,12 +16997,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 @@ -16876,6 +17025,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 @@ -16898,10 +17049,25 @@ 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;} - if test $enable_symvers = gnu; then $as_echo "#define LIBITM_GNU_SYMBOL_VERSIONING 1" >>confdefs.h @@ -17115,6 +17281,94 @@ $as_echo "#define HAVE_64BIT_SYNC_BUILTINS 1" >>confdefs.h fi +case "${target_cpu}" in +i[34567]86 | x86_64) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the assembler supports AVX" >&5 +$as_echo_n "checking if the assembler supports AVX... " >&6; } +if test "${libitm_cv_as_avx+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +asm("vzeroupper"); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + libitm_cv_as_avx=yes +else + libitm_cv_as_avx=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libitm_cv_as_avx" >&5 +$as_echo "$libitm_cv_as_avx" >&6; } + if test x$libitm_cv_as_avx = xyes; then + +$as_echo "#define HAVE_AS_AVX 1" >>confdefs.h + + fi + ;; +esac + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether weak refs work like ELF" >&5 +$as_echo_n "checking whether weak refs work like ELF... " >&6; } +if test "${ac_cv_have_elf_style_weakref+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + weakref_m4_saved_CFLAGS="$CFLAGS" + case "${host}" in + *-apple-darwin*) CFLAGS="$CFLAGS -Wl,-undefined,dynamic_lookup" ;; + *) ;; + esac + if test "$cross_compiling" = yes; then : + +case "${host}" in + alpha*-dec-osf*) ac_cv_have_elf_style_weakref=no ;; + *-apple-darwin[89]*) ac_cv_have_elf_style_weakref=no ;; + *) ac_cv_have_elf_style_weakref=yes;; +esac +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +extern void fNotToBeFound(void) __attribute__((weak)); +int main () +{ + if (fNotToBeFound) + return 1; + else + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_have_elf_style_weakref=yes +else + ac_cv_have_elf_style_weakref=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +CFLAGS="$weakref_m4_saved_CFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_elf_style_weakref" >&5 +$as_echo "$ac_cv_have_elf_style_weakref" >&6; } +if test x"$ac_cv_have_elf_style_weakref" = xyes; then + +$as_echo "#define HAVE_ELF_STYLE_WEAKREF 1" >>confdefs.h + +fi + # Cleanup and exit. CFLAGS="$save_CFLAGS" cat >confcache <<\_ACEOF @@ -17210,7 +17464,7 @@ else fi # Set up the set of libraries that we need to link against for libitm. -# Note that the GOMP_SELF_SPEC in gcc.c will force -pthread for -fopenmp, +# Note that the GTM_SELF_SPECS in gcc.c will force -pthread for -fgnu-tm, # which will force linkage against -lpthread (or equivalent for the system). # That's not 100% ideal, but about the best we can do easily. if test $enable_shared = yes; then @@ -17220,6 +17474,14 @@ else fi + if test "$ARCH" = arm; then + ARCH_ARM_TRUE= + ARCH_ARM_FALSE='#' +else + ARCH_ARM_TRUE='#' + ARCH_ARM_FALSE= +fi + if test "$ARCH" = x86; then ARCH_X86_TRUE= ARCH_X86_FALSE='#' @@ -17228,6 +17490,14 @@ else ARCH_X86_FALSE= fi + if test "$libitm_cv_as_avx" = yes; then + ARCH_X86_AVX_TRUE= + ARCH_X86_AVX_FALSE='#' +else + ARCH_X86_AVX_TRUE='#' + ARCH_X86_AVX_FALSE= +fi + if test $enable_linux_futex = yes; then ARCH_FUTEX_TRUE= ARCH_FUTEX_FALSE='#' @@ -17373,14 +17643,34 @@ if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${HAVE_HWCAP_TRUE}" && test -z "${HAVE_HWCAP_FALSE}"; then + as_fn_error "conditional \"HAVE_HWCAP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${LIBITM_BUILD_VERSIONED_SHLIB_TRUE}" && test -z "${LIBITM_BUILD_VERSIONED_SHLIB_FALSE}"; then 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_ARM_TRUE}" && test -z "${ARCH_ARM_FALSE}"; then + as_fn_error "conditional \"ARCH_ARM\" 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 fi +if test -z "${ARCH_X86_AVX_TRUE}" && test -z "${ARCH_X86_AVX_FALSE}"; then + as_fn_error "conditional \"ARCH_X86_AVX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${ARCH_FUTEX_TRUE}" && test -z "${ARCH_FUTEX_FALSE}"; then as_fn_error "conditional \"ARCH_FUTEX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5