aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/acinclude.m4
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2012-05-23 10:34:06 +0200
committerTobias Burnus <burnus@gcc.gnu.org>2012-05-23 10:34:06 +0200
commit4179e59afafbe4c5eb00b0a82da11db7cc5a1a8c (patch)
treed08f712df5fe7cd79a42d70f17fd6a12386816f3 /libgfortran/acinclude.m4
parentf883872b10c06e67e59d3e0f192b804dc5ec3121 (diff)
downloadgcc-4179e59afafbe4c5eb00b0a82da11db7cc5a1a8c.zip
gcc-4179e59afafbe4c5eb00b0a82da11db7cc5a1a8c.tar.gz
gcc-4179e59afafbe4c5eb00b0a82da11db7cc5a1a8c.tar.bz2
re PR libfortran/53444 (Accommodate non-compliant strerror_r() on VxWorks.)
2012-05-23 Tobias Burnus <burnus@net-b.de> PR libfortran/53444 * acinclude.m4 (LIBGFOR_CHECK_STRERROR_R): Add configure checks * for two- and three-argument versions of strerror_r. * configure.ac (LIBGFOR_CHECK_STRERROR_R): Use it. * runtime/error.c (gf_strerror): Handle two-argument version of strerror_r. * config.h.in: Regenerate. * configure: Regenerate. From-SVN: r187796
Diffstat (limited to 'libgfortran/acinclude.m4')
-rw-r--r--libgfortran/acinclude.m426
1 files changed, 26 insertions, 0 deletions
diff --git a/libgfortran/acinclude.m4 b/libgfortran/acinclude.m4
index 1b11e6a..d101261 100644
--- a/libgfortran/acinclude.m4
+++ b/libgfortran/acinclude.m4
@@ -362,3 +362,29 @@ AC_DEFUN([LIBGFOR_CHECK_FLOAT128], [
dnl We need a conditional for the Makefile
AM_CONDITIONAL(LIBGFOR_BUILD_QUAD, [test "x$libgfor_cv_have_float128" = xyes])
])
+
+
+dnl Check whether we have strerror_r
+AC_DEFUN([LIBGFOR_CHECK_STRERROR_R], [
+ dnl Check for three-argument POSIX version of strerror_r
+ ac_save_CFLAGS="$CFLAGS"
+ CFLAGS="-Wimplicit-function-declaration -Werror"
+ AC_TRY_COMPILE([#define _GNU_SOURCE 1
+ #include <string.h>
+ #include <locale.h>],
+ [char s[128]; strerror_r(5, s, 128);],
+ AC_DEFINE(HAVE_STRERROR_R, 1,
+ [Define if strerror_r is available in <string.h>.]),)
+ CFLAGS="$ac_save_CFLAGS"
+
+ dnl Check for two-argument version of strerror_r (e.g. for VxWorks)
+ ac_save_CFLAGS="$CFLAGS"
+ CFLAGS="-Wimplicit-function-declaration -Werror"
+ AC_TRY_COMPILE([#define _GNU_SOURCE 1
+ #include <string.h>
+ #include <locale.h>],
+ [char s[128]; strerror_r(5, s);],
+ AC_DEFINE(HAVE_STRERROR_R_2ARGS, 1,
+ [Define if strerror_r takes two arguments and is available in <string.h>.]),)
+ CFLAGS="$ac_save_CFLAGS"
+])