target.h (GTM_longjmp): Correct .cfi directives.
[gcc.git] / libitm / configure.ac
index 7f35b154529f70dbf4f10fdff64349795216fc2c..2cce2b102f55bb5454acef70669086842717d861 100644 (file)
@@ -1,5 +1,5 @@
 # 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
@@ -208,28 +208,43 @@ GCC_LINUX_FUTEX(:)
 # 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"
@@ -253,7 +268,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
@@ -263,7 +278,9 @@ else
 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)