* aclocal.m4 (DECLARE_SYS_ERRLIST): Fix up to look for sys_errlist
authorTom Yu <tlyu@mit.edu>
Sat, 31 Aug 1996 03:34:40 +0000 (03:34 +0000)
committerTom Yu <tlyu@mit.edu>
Sat, 31 Aug 1996 03:34:40 +0000 (03:34 +0000)
in both errno.h and libc.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9016 dc483132-0cff-0310-8789-dd5450dbe970

src/ChangeLog
src/aclocal.m4

index 63738b094797350b3a40cb323cd232e40200d995..51ba423883384957679dd4cfbcd9e37baadd2a24 100644 (file)
@@ -1,3 +1,8 @@
+Fri Aug 30 22:58:19 1996  Tom Yu  <tlyu@mit.edu>
+
+       * 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  <tytso@rsts-11.mit.edu>
 
        * configure.in: Remove top-level calls to WITH_ANAME_DB and
index 49a8e3de5b777af05d48236ce93b1b5a30127b66..e128660879dec4ae01ee5d103ebd51dc16c22db7 100644 (file)
@@ -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 <stdio.h>
-#include <errno.h>], [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 <stdio.h>
+#include <errno.h>], [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