From 468bdc4a88d4760b094333e4ca0e2b4efaa515b0 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Sat, 31 Aug 1996 03:34:40 +0000 Subject: [PATCH] * aclocal.m4 (DECLARE_SYS_ERRLIST): Fix up to look for sys_errlist in both errno.h and libc. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9016 dc483132-0cff-0310-8789-dd5450dbe970 --- src/ChangeLog | 5 +++++ src/aclocal.m4 | 44 +++++++++++++++++++++++++++++--------------- 2 files changed, 34 insertions(+), 15 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 63738b094..51ba42388 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +Fri Aug 30 22:58:19 1996 Tom Yu + + * aclocal.m4 (DECLARE_SYS_ERRLIST): Fix up to look for sys_errlist + in both errno.h and libc. + Thu Aug 15 17:10:58 1996 Theodore Ts'o * configure.in: Remove top-level calls to WITH_ANAME_DB and diff --git a/src/aclocal.m4 b/src/aclocal.m4 index 49a8e3de5..e12866087 100644 --- a/src/aclocal.m4 +++ b/src/aclocal.m4 @@ -83,21 +83,35 @@ WITH_NETLIB dnl KRB_INCLUDE dnl AC_ARG_PROGRAM dnl ])dnl -dnl -dnl check for sys_errlist -- DECLARE_SYS_ERRLIST -dnl -define(DECLARE_SYS_ERRLIST,[ -AC_MSG_CHECKING([for sys_errlist declaration]) -AC_CACHE_VAL(krb5_cv_decl_errlist, -[AC_TRY_LINK( -[#include -#include ], [1+sys_nerr;],dnl - krb5_cv_decl_errlist=yes, krb5_cv_decl_errlist=no)]) -AC_MSG_RESULT($krb5_cv_decl_errlist) -if test $krb5_cv_decl_errlist = no; then - AC_DEFINE(NEED_SYS_ERRLIST) -fi -])dnl + +dnl This is somewhat gross and should go away when the build system +dnl is revamped. -- tlyu +dnl DECLARE_SYS_ERRLIST - check for sys_errlist in libc +dnl +AC_DEFUN([DECLARE_SYS_ERRLIST], +[AC_CACHE_CHECK([for sys_errlist declaration], krb5_cv_decl_sys_errlist, +[AC_TRY_COMPILE([#include +#include ], [1+sys_nerr;], +krb5_cv_decl_sys_errlist=yes, krb5_cv_decl_sys_errlist=no)]) +# assume sys_nerr won't be declared w/o being in libc +if test $krb5_cv_decl_sys_errlist = yes; then + AC_DEFINE(SYS_ERRLIST_DECLARED) + AC_DEFINE(HAVE_SYS_ERRLIST) +else + # This means that sys_errlist is not declared in errno.h, but may still + # be in libc. + AC_CACHE_CHECK([for sys_errlist in libc], krb5_cv_var_sys_errlist, + [AC_TRY_LINK([extern int sys_nerr;], [1+sys_nerr;], + krb5_cv_var_sys_errlist=yes, krb5_cv_var_sys_errlist=no;)]) + if test $krb5_cv_var_sys_errlist = yes; then + AC_DEFINE(HAVE_SYS_ERRLIST) + # Do this cruft for backwards compatibility for now. + AC_DEFINE(NEED_SYS_ERRLIST) + else + AC_MSG_WARN([sys_errlist is neither in errno.h nor in libc]) + fi +fi]) + dnl dnl check for sigmask/sigprocmask -- CHECK_SIGPROCMASK dnl -- 2.26.2