# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_c___attribute__.html
+# https://www.gnu.org/software/autoconf-archive/ax_c___attribute__.html
# ===========================================================================
#
# SYNOPSIS
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
-# with this program. If not, see <http://www.gnu.org/licenses/>.
+# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
-#serial 8
+#serial 9
AC_DEFUN([AX_C___ATTRIBUTE__], [
AC_CACHE_CHECK([for __attribute__], [ax_cv___attribute__],
# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_pthread.html
+# https://www.gnu.org/software/autoconf-archive/ax_pthread.html
# ===========================================================================
#
# SYNOPSIS
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
-# with this program. If not, see <http://www.gnu.org/licenses/>.
+# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
-#serial 23
+#serial 25
AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
AC_DEFUN([AX_PTHREAD], [
AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
[ax_cv_PTHREAD_PRIO_INHERIT],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
- [[int i = PTHREAD_PRIO_INHERIT;]])],
+ [[int i = PTHREAD_PRIO_INHERIT;
+ return i;]])],
[ax_cv_PTHREAD_PRIO_INHERIT=yes],
[ax_cv_PTHREAD_PRIO_INHERIT=no])
])
# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_tls.html
+# https://www.gnu.org/software/autoconf-archive/ax_tls.html
# ===========================================================================
#
# SYNOPSIS
# DESCRIPTION
#
# Provides a test for the compiler support of thread local storage (TLS)
-# extensions. Defines TLS if it is found. Currently knows about GCC/ICC
-# and MSVC. I think SunPro uses the same as GCC, and Borland apparently
-# supports either.
+# extensions. Defines TLS if it is found. Currently knows about C++11,
+# GCC/ICC, and MSVC. I think SunPro uses the same as GCC, and Borland
+# apparently supports either.
#
# LICENSE
#
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
-# with this program. If not, see <http://www.gnu.org/licenses/>.
+# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
-#serial 11
-
-# Define m4_ifblank and m4_ifnblank macros from introduced in
-# autotools 2.64 m4sugar.m4 if using an earlier autotools.
-
-ifdef([m4_ifblank], [], [
-m4_define([m4_ifblank],
-[m4_if(m4_translit([[$1]], [ ][ ][
-]), [], [$2], [$3])])
-])
-
-
-ifdef([m4_ifnblank], [], [
-m4_define([m4_ifnblank],
-[m4_if(m4_translit([[$1]], [ ][ ][
-]), [], [$3], [$2])])
-])
+#serial 14
AC_DEFUN([AX_TLS], [
- AC_MSG_CHECKING(for thread local storage (TLS) class)
- AC_CACHE_VAL(ac_cv_tls, [
- ax_tls_keywords="__thread __declspec(thread) none"
- for ax_tls_keyword in $ax_tls_keywords; do
+ AC_MSG_CHECKING([for thread local storage (TLS) class])
+ AC_CACHE_VAL([ac_cv_tls],
+ [for ax_tls_keyword in thread_local _Thread_local __thread '__declspec(thread)' none; do
AS_CASE([$ax_tls_keyword],
[none], [ac_cv_tls=none ; break],
- [AC_TRY_LINK(
- [$ax_tls_keyword int foo;],
- [++foo;],
+ [AC_TRY_COMPILE(
+ [#include <stdlib.h>
+ static void
+ foo(void) {
+ static ] $ax_tls_keyword [ int bar;
+ exit(1);
+ }],
+ [],
[ac_cv_tls=$ax_tls_keyword ; break],
- [ac_cv_tls=none]
+ ac_cv_tls=none
)])
done
])
- AC_MSG_RESULT($ac_cv_tls)
+ AC_MSG_RESULT([$ac_cv_tls])
AS_IF([test "$ac_cv_tls" != "none"],
- AC_DEFINE_UNQUOTED([TLS], $ac_cv_tls, [If the compiler supports a TLS storage class define it to that here])
- m4_ifnblank([$1], [$1]),
- m4_ifnblank([$2], [$2])
- )
+ [AC_DEFINE_UNQUOTED([TLS],[$ac_cv_tls],[If the compiler supports a TLS storage class define it to that here])
+ m4_ifnblank([$1],[$1])],
+ [m4_ifnblank([$2],[$2])])
])