diff options
| author | tjg <tjg> | 2000-11-27 12:51:55 +0000 |
|---|---|---|
| committer | Toby Goodwin <toby@paccrat.org> | 2015-05-16 21:23:18 +0100 |
| commit | 21703f6be477bfd95a2fd63efe2af081044babd5 (patch) | |
| tree | 48f25105094b8fc16f9e850e285e16be722119bb | |
| parent | 033d8a6834bcc51ca99052497e16701c31664441 (diff) | |
need to #include <string.h> before testing for strerror()
| -rw-r--r-- | acconfig.h | 3 | ||||
| -rw-r--r-- | acinclude.m4 | 13 | ||||
| -rw-r--r-- | configure.ac | 4 |
3 files changed, 19 insertions, 1 deletions
@@ -34,6 +34,9 @@ /* Define if you have sigsetjmp(). */ #undef HAVE_SIGSETJMP +/* Define in you have strerror(). */ +#undef HAVE_STRERROR + /* Define if you want rc to encode strange characters in the environment. */ #undef PROTECT_ENV diff --git a/acinclude.m4 b/acinclude.m4 index 697b326..7fbc6aa 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -29,6 +29,19 @@ sigsetjmp(e, 1); esac ]) +dnl Similarly, AC_CHECK_FUNCS doesn't find strerror() on NetBSD. +AC_DEFUN(RC_FUNC_STRERROR, [ + AC_CACHE_CHECK(for strerror, rc_cv_strerror, + AC_TRY_LINK([ +#include <string.h> + ], [ +strerror(0); + ], rc_cv_strerror=yes, rc_cv_strerror=no)) + case "$rc_cv_strerror" in + yes) AC_DEFINE(HAVE_STRERROR) ;; + esac +]) + dnl HPUX needs _KERNEL defined to pick up RLIMIT_foo defines. (Why?) AC_DEFUN(RC_NEED_KERNEL, [ AC_CACHE_CHECK(if _KERNEL is required for RLIMIT defines, rc_cv_kernel_rlimit, diff --git a/configure.ac b/configure.ac index b8d2341..fe9ee9f 100644 --- a/configure.ac +++ b/configure.ac @@ -38,13 +38,15 @@ AC_TYPE_SIZE_T AC_TYPE_UID_T AC_CHECK_TYPE(ssize_t, long) -AC_CHECK_FUNCS(getgroups setpgrp setrlimit strerror) +AC_CHECK_FUNCS(getgroups setpgrp setrlimit) RC_FUNC_GETGROUPS RC_FUNC_SIGSETJMP AC_FUNC_SETPGRP +RC_FUNC_STRERROR + RC_NEED_KERNEL RC_TYPE_RLIM_T |