aboutsummaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-11-28 19:56:27 +0000
committerJakub Jelinek <jakub@redhat.com>2005-11-28 19:56:27 +0000
commitc4bbd1638a7d623dfc4f72351bf17a4fdb96d057 (patch)
tree1b7352dc836624f189c699fdc421643e77d1c10e /libgfortran
parent38a55afe5fedb96d440e700802cbafb0f333ff5c (diff)
libfortran/24991
* acinclude.m4 (LIBGFOR_CHECK_PRAGMA_WEAK): Rename to... (LIBGFOR_GTHREAD_WEAK): ... this. Define SUPPORTS_WEAK rather than HAVE_PRAGMA_WEAK. Define GTHREAD_USE_WEAK to 0 on hosts that shouldn't use weak in gthr.h. * configure.ac: Use LIBGFOR_GTHREAD_WEAK instead of LIBGFOR_CHECK_PRAGMA_WEAK. * config.h.in: Regenerated. * configure: Regenerated. * io/io.h (SUPPORTS_WEAK): Don't define here. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_1-branch@107618 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog11
-rw-r--r--libgfortran/acinclude.m412
-rw-r--r--libgfortran/config.h.in9
-rwxr-xr-xlibgfortran/configure11
-rw-r--r--libgfortran/configure.ac2
-rw-r--r--libgfortran/io/io.h4
6 files changed, 37 insertions, 12 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 60c41dc8804..04853c1a6ef 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,5 +1,16 @@
2005-11-28 Jakub Jelinek <jakub@redhat.com>
+ libfortran/24991
+ * acinclude.m4 (LIBGFOR_CHECK_PRAGMA_WEAK): Rename to...
+ (LIBGFOR_GTHREAD_WEAK): ... this. Define SUPPORTS_WEAK rather
+ than HAVE_PRAGMA_WEAK. Define GTHREAD_USE_WEAK to 0 on hosts
+ that shouldn't use weak in gthr.h.
+ * configure.ac: Use LIBGFOR_GTHREAD_WEAK instead of
+ LIBGFOR_CHECK_PRAGMA_WEAK.
+ * config.h.in: Regenerated.
+ * configure: Regenerated.
+ * io/io.h (SUPPORTS_WEAK): Don't define here.
+
* intrinsics/ftell.c (ftell, FTELL_SUB): Add unlock_unit call.
* intrinsics/fget.c (fgetc, fputs): Likewise.
* intrinsics/tty.c (ttynam): Likewise.
diff --git a/libgfortran/acinclude.m4 b/libgfortran/acinclude.m4
index 9d06a8b84d4..3af0c0ea476 100644
--- a/libgfortran/acinclude.m4
+++ b/libgfortran/acinclude.m4
@@ -174,7 +174,7 @@ target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`])
fi])
dnl Check for pragma weak.
-AC_DEFUN([LIBGFOR_CHECK_PRAGMA_WEAK], [
+AC_DEFUN([LIBGFOR_GTHREAD_WEAK], [
AC_CACHE_CHECK([whether pragma weak works],
have_pragma_weak, [
gfor_save_CFLAGS="$CFLAGS"
@@ -183,9 +183,15 @@ AC_DEFUN([LIBGFOR_CHECK_PRAGMA_WEAK], [
#pragma weak foo], [if (foo) foo ();],
have_pragma_weak=yes, have_pragma_weak=no)])
if test $have_pragma_weak = yes; then
- AC_DEFINE(HAVE_PRAGMA_WEAK, 1,
+ AC_DEFINE(SUPPORTS_WEAK, 1,
[Define to 1 if the target supports #pragma weak])
- fi])
+ fi
+ case "$host" in
+ *-*-darwin* | *-*-hpux* | *-*-cygwin*)
+ AC_DEFINE(GTHREAD_USE_WEAK, 0,
+ [Define to 0 if the target shouldn't use #pragma weak])
+ ;;
+ esac])
dnl Check whether target can unlink a file still open.
AC_DEFUN([LIBGFOR_CHECK_UNLINK_OPEN_FILE], [
diff --git a/libgfortran/config.h.in b/libgfortran/config.h.in
index ba0ca49b455..92f088672d7 100644
--- a/libgfortran/config.h.in
+++ b/libgfortran/config.h.in
@@ -3,6 +3,9 @@
/* Does gettimeofday take a single argument */
#undef GETTIMEOFDAY_ONE_ARGUMENT
+/* Define to 0 if the target shouldn't use #pragma weak */
+#undef GTHREAD_USE_WEAK
+
/* libm includes acos */
#undef HAVE_ACOS
@@ -465,9 +468,6 @@
/* libm includes powl */
#undef HAVE_POWL
-/* Define to 1 if the target supports #pragma weak */
-#undef HAVE_PRAGMA_WEAK
-
/* libm includes round */
#undef HAVE_ROUND
@@ -684,6 +684,9 @@
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
+/* Define to 1 if the target supports #pragma weak */
+#undef SUPPORTS_WEAK
+
/* Define to 1 if the target is ILP32. */
#undef TARGET_ILP32
diff --git a/libgfortran/configure b/libgfortran/configure
index 6799fa52772..6651af413be 100755
--- a/libgfortran/configure
+++ b/libgfortran/configure
@@ -20854,10 +20854,19 @@ echo "${ECHO_T}$have_pragma_weak" >&6
if test $have_pragma_weak = yes; then
cat >>confdefs.h <<\_ACEOF
-#define HAVE_PRAGMA_WEAK 1
+#define SUPPORTS_WEAK 1
_ACEOF
fi
+ case "$host" in
+ *-*-darwin* | *-*-hpux* | *-*-cygwin*)
+
+cat >>confdefs.h <<\_ACEOF
+#define GTHREAD_USE_WEAK 0
+_ACEOF
+
+ ;;
+ esac
# Various other checks on target
diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac
index 7dc9298cfe6..cba9918ecbc 100644
--- a/libgfortran/configure.ac
+++ b/libgfortran/configure.ac
@@ -381,7 +381,7 @@ LIBGFOR_CHECK_SYNC_FETCH_AND_ADD
LIBGFOR_CHECK_GTHR_DEFAULT
# Check out #pragma weak.
-LIBGFOR_CHECK_PRAGMA_WEAK
+LIBGFOR_GTHREAD_WEAK
# Various other checks on target
LIBGFOR_CHECK_UNLINK_OPEN_FILE
diff --git a/libgfortran/io/io.h b/libgfortran/io/io.h
index e0b251a5a82..ae8115d965f 100644
--- a/libgfortran/io/io.h
+++ b/libgfortran/io/io.h
@@ -32,10 +32,6 @@ Boston, MA 02110-1301, USA. */
#include <setjmp.h>
#include "libgfortran.h"
-#ifdef HAVE_PRAGMA_WEAK
-/* Used by gthr.h. */
-#define SUPPORTS_WEAK 1
-#endif
#ifdef _AIX
#undef _LARGE_FILES