# Process this file with autoreconf to produce a configure script.
-# Copyright (C) 2011 Free Software Foundation, Inc.
+# Copyright (C) 2011, 2012 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# See if we support thread-local storage.
GCC_CHECK_TLS
-# See what sort of export controls are availible.
+# See what sort of export controls are available.
LIBITM_CHECK_ATTRIBUTE_VISIBILITY
LIBITM_CHECK_ATTRIBUTE_DLLEXPORT
LIBITM_CHECK_ATTRIBUTE_ALIAS
-LIBITM_ENABLE_SYMVERS
+# Check linker hardware capability support.
+LIBITM_CHECK_LINKER_HWCAP
+# If defaulting to -mavx, don't clear hwcaps.
+AC_CHECK_DECL([__AVX__], [HWCAP_LDFLAGS=''])
+
+LIBITM_ENABLE_SYMVERS
if test $enable_symvers = gnu; then
AC_DEFINE(LIBITM_GNU_SYMBOL_VERSIONING, 1,
[Define to 1 if GNU symbol versioning is used for libitm.])
fi
+# See if we can emit unwind info in the sjlj stub.
+GCC_AS_CFI_PSEUDO_OP
+
# Determine the proper ABI type for size_t.
LIBITM_CHECK_SIZE_T_MANGLING
# Get target configury.
. ${srcdir}/configure.tgt
+if test -n "$UNSUPPORTED"; then
+ AC_MSG_ERROR([Configuration ${target} is unsupported.])
+fi
+
CFLAGS="$save_CFLAGS $XCFLAGS"
# Check for __sync_val_compare_and_swap, but only after the target has
# had a chance to set XCFLAGS.
LIBITM_CHECK_SYNC_BUILTINS
LIBITM_CHECK_64BIT_SYNC_BUILTINS
+LIBITM_CHECK_AS_AVX
+
+GCC_CHECK_ELF_STYLE_WEAKREF
# Cleanup and exit.
CFLAGS="$save_CFLAGS"
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
fi
AC_SUBST(link_itm)
+AM_CONDITIONAL([ARCH_ARM], [test "$ARCH" = arm])
AM_CONDITIONAL([ARCH_X86], [test "$ARCH" = x86])
+AM_CONDITIONAL([ARCH_X86_AVX], [test "$libitm_cv_as_avx" = yes])
AM_CONDITIONAL([ARCH_FUTEX], [test $enable_linux_futex = yes])
AC_CONFIG_FILES(Makefile testsuite/Makefile libitm.spec)