From 7d3ffcaf8540b6a29edc9d24ea1fe3bddbd96004 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Sun, 23 Jul 2000 16:05:33 +0000 Subject: * aclocal.m4 (libiberty_AC_DECLARE_ERRNO): New macro. * configure.in (libiberty_AC_DECLARE_ERRNO): Add check. * configure, config.in: Regenerate. * pexecute.c, strtol.c, strtoul.c: Declare errno if necessary. --- libiberty/aclocal.m4 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'libiberty/aclocal.m4') diff --git a/libiberty/aclocal.m4 b/libiberty/aclocal.m4 index b6a38d6..b6c611e 100644 --- a/libiberty/aclocal.m4 +++ b/libiberty/aclocal.m4 @@ -69,3 +69,17 @@ if test $ac_cv_func_strncmp_works = no ; then LIBOBJS="$LIBOBJS strncmp.o" fi ]) + +dnl See if errno must be declared even when is included. +AC_DEFUN(libiberty_AC_DECLARE_ERRNO, +[AC_CACHE_CHECK(whether errno must be declared, libiberty_cv_declare_errno, +[AC_TRY_COMPILE( +[#include ], +[int x = errno;], +libiberty_cv_declare_errno=no, +libiberty_cv_declare_errno=yes)]) +if test $libiberty_cv_declare_errno = yes +then AC_DEFINE(NEED_DECLARATION_ERRNO, 1, + [Define if errno must be declared even when is included.]) +fi +]) -- cgit v1.1