1 dnl --------------------------------------------------------------------
2 dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus
8 dnl $3 = action to perform if option is not default
9 dnl $4 = action if perform if option is default
10 dnl $5 = default option value (either 'yes' or 'no')
11 AC_DEFUN([CF_ARG_OPTION],
12 [AC_ARG_ENABLE($1,[$2],[test "$enableval" != ifelse($5,no,yes,no) && enableval=ifelse($5,no,no,yes)
13 if test "$enableval" != "$5" ; then
18 fi],[enableval=$5 ifelse($4,,,[
22 dnl --------------------------------------------------------------------
23 dnl Check for declaration of sys_errlist in one of stdio.h and errno.h.
24 dnl Declaration of sys_errlist on BSD4.4 interferes with our declaration.
25 dnl Reported by Keith Bostic.
26 AC_DEFUN([CF_SYS_ERRLIST],
28 AC_MSG_CHECKING([declaration of sys_errlist])
29 AC_CACHE_VAL(cf_cv_dcl_sys_errlist,[
32 #include <sys/types.h>
34 [char *c = (char *) *sys_errlist],
35 [cf_cv_dcl_sys_errlist=yes],
36 [cf_cv_dcl_sys_errlist=no])])
37 AC_MSG_RESULT($cf_cv_dcl_sys_errlist)
39 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
40 if test $cf_cv_dcl_sys_errlist = no ; then
41 AC_DEFINE(DECL_SYS_ERRLIST)
42 AC_MSG_CHECKING([existence of sys_errlist])
43 AC_CACHE_VAL(cf_cv_have_sys_errlist,[
44 AC_TRY_LINK([#include <errno.h>],
45 [char *c = (char *) *sys_errlist],
46 [cf_cv_have_sys_errlist=yes],
47 [cf_cv_have_sys_errlist=no])])
48 AC_MSG_RESULT($cf_cv_have_sys_errlist)