diff options
author | fxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-08-31 14:02:43 +0000 |
---|---|---|
committer | fxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-08-31 14:02:43 +0000 |
commit | 04c14146262ba17dae8b499cf2985283a059a018 (patch) | |
tree | c9054c51386948d792f44e8f5e9259a9285492d3 /libgfortran/acinclude.m4 | |
parent | 06e4870e3d20bb71848afa16d4e9fac4224fa7ba (diff) | |
download | gcc-04c14146262ba17dae8b499cf2985283a059a018.tar.gz |
PR libfortran/47571
* acinclude.m4 (LIBGFOR_GTHREAD_WEAK): Reinstate.
* configure.ac: Call LIBGFOR_GTHREAD_WEAK again.
* config.h.in: Regenerate.
* configure: Regenerate.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227347 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/acinclude.m4')
-rw-r--r-- | libgfortran/acinclude.m4 | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libgfortran/acinclude.m4 b/libgfortran/acinclude.m4 index fab29e424bf..7280bc37a0b 100644 --- a/libgfortran/acinclude.m4 +++ b/libgfortran/acinclude.m4 @@ -69,6 +69,28 @@ if (foovar > 10) return __sync_add_and_fetch (&foovar, -1);]])], [Define to 1 if the target supports __sync_fetch_and_add]) fi]) +dnl Check for pragma weak. +AC_DEFUN([LIBGFOR_GTHREAD_WEAK], [ + AC_CACHE_CHECK([whether pragma weak works], + libgfor_cv_have_pragma_weak, [ + gfor_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Wunknown-pragmas" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +void foo (void); +#pragma weak foo +]], [[if (foo) foo ();]])], + libgfor_cv_have_pragma_weak=yes, libgfor_cv_have_pragma_weak=no)]) + if test $libgfor_cv_have_pragma_weak = yes; then + AC_DEFINE(SUPPORTS_WEAK, 1, + [Define to 1 if the target supports #pragma weak]) + fi + case "$host" in + *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | *-*-musl* ) + AC_DEFINE(GTHREAD_USE_WEAK, 0, + [Define to 0 if the target shouldn't use #pragma weak]) + ;; + esac]) + dnl Check whether target effectively supports weakref AC_DEFUN([LIBGFOR_CHECK_WEAKREF], [ AC_CACHE_CHECK([whether the target supports weakref], |