aboutsummaryrefslogtreecommitdiff
path: root/libiberty/aclocal.m4
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2000-07-23 16:05:33 +0000
committerJeff Law <law@redhat.com>2000-07-23 16:05:33 +0000
commit7d3ffcaf8540b6a29edc9d24ea1fe3bddbd96004 (patch)
tree49049fbea32d1f62ae059e3ce9784f83f463cc78 /libiberty/aclocal.m4
parentb123325783561d820960dea56f33de3169e84410 (diff)
downloadfsf-binutils-gdb-7d3ffcaf8540b6a29edc9d24ea1fe3bddbd96004.zip
fsf-binutils-gdb-7d3ffcaf8540b6a29edc9d24ea1fe3bddbd96004.tar.gz
fsf-binutils-gdb-7d3ffcaf8540b6a29edc9d24ea1fe3bddbd96004.tar.bz2
* 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.
Diffstat (limited to 'libiberty/aclocal.m4')
-rw-r--r--libiberty/aclocal.m414
1 files changed, 14 insertions, 0 deletions
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 <errno.h> is included.
+AC_DEFUN(libiberty_AC_DECLARE_ERRNO,
+[AC_CACHE_CHECK(whether errno must be declared, libiberty_cv_declare_errno,
+[AC_TRY_COMPILE(
+[#include <errno.h>],
+[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 <errno.h> is included.])
+fi
+])