* aclocal.m4 (libiberty_AC_DECLARE_ERRNO): New macro.
[deliverable/binutils-gdb.git] / libiberty / aclocal.m4
index b6a38d6052273f6b4e578ae0bd4f012e1f470919..b6c611e132d018f0e9dac75e5a9a4482ff24336e 100644 (file)
@@ -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
+])
This page took 0.024003 seconds and 4 git commands to generate.