[956] in Kerberos-V5-bugs

home help back first fref pref prev next nref lref last post

Changes for caching to aclocal.m4

daemon@ATHENA.MIT.EDU (epeisach@MIT.EDU)
Sat Nov 12 13:35:07 1994

From: epeisach@MIT.EDU
Date: Sat, 12 Nov 1994 13:35:00 -0500
To: krb5-bugs@MIT.EDU


Tired of those warnings about AC_COMPILE_CHECK when running autoconf, I
decided to fix the problems and add caching to the variables in use. 

Future patche that I send in will include caching changes and sometimes
adding a new function to aclocal.m4 (when the same query is handled in
two configure.in files...)

All cache variables start with krb5 to ensure uniqueness...



===================================================================
RCS file: /mit/krb5/.cvsroot/src/aclocal.m4,v
retrieving revision 1.36
diff -c -r1.36 aclocal.m4
*** 1.36	1994/11/08 02:29:39
--- aclocal.m4	1994/11/12 18:25:31
***************
*** 144,155 ****
  [
  SHELL=/bin/sh
  
! Makefile: $(srcdir)/Makefile.in config.status
  	$(SHELL) config.status
  config.status: $(srcdir)/configure
  	$(SHELL) config.status --recheck
! configure: $(srcdir)/configure.in
! 	cd $(srcdir); autoconf
  ]
  AC_DIVERT_POP()dnl
  ])dnl
--- 144,155 ----
  [
  SHELL=/bin/sh
  
! Makefile: $(srcdir)/Makefile.in config.status $(SRCTOP)/config/pre.in $(SRCTOP)/config/post.in
  	$(SHELL) config.status
  config.status: $(srcdir)/configure
  	$(SHELL) config.status --recheck
! $(srcdir)/configure: $(srcdir)/configure.in $(SRCTOP)/aclocal.m4
! 	cd $(srcdir); autoconf --localdir=$(BUILDTOP) --macrodir=$(BUILDTOP)/util/autoconf
  ]
  AC_DIVERT_POP()dnl
  ])dnl
***************
*** 157,174 ****
  dnl check for sys_errlist -- DECLARE_SYS_ERRLIST
  dnl
  define(DECLARE_SYS_ERRLIST,[
! AC_COMPILE_CHECK([sys_errlist declaration],
  [#include <stdio.h>
! #include <errno.h>], [sys_nerr;], , AC_DEFINE(NEED_SYS_ERRLIST))])dnl
  dnl
  dnl check for sigmask/sigprocmask -- CHECK_SIGPROCMASK
  dnl
  define(CHECK_SIGPROCMASK,[
! AC_COMPILE_CHECK([sigmask],
! [#include <signal.h>], [sigmask(1);], ,
!  AC_COMPILE_CHECK([sigprocmask],
!  [#include <signal.h>], [sigprocmask(SIG_SETMASK,0,0);],
!  AC_DEFINE(USE_SIGPROCMASK),))])dnl
  dnl
  dnl check for <stdarg.h> -- CHECK_STDARG
  dnl (name used for consistency with krb5/config.h)
--- 157,189 ----
  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>], [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 check for sigmask/sigprocmask -- CHECK_SIGPROCMASK
  dnl
  define(CHECK_SIGPROCMASK,[
! AC_MSG_CHECKING([for use of sigprocmask])
! AC_CACHE_VAL(krb5_cv_func_sigprocmask_use,
! [AC_TRY_LINK(
! [#include <signal.h>], [sigmask(1);], 
!  krb5_cv_func_sigprocmask_use=no,
! AC_TRY_LINK([#include <signal.h>], [sigprocmask(SIG_SETMASK,0,0);],
!  krb5_cv_func_sigprocmask_use=yes, krb5_cv_func_sigprocmask_use=no))])
! AC_MSG_RESULT($krb5_cv_func_sigprocmask_use)
! if test $krb5_cv_func_sigprocmask_use = yes; then
!  AC_DEFINE(USE_SIGPROCMASK)
! fi
! ])dnl
  dnl
  dnl check for <stdarg.h> -- CHECK_STDARG
  dnl (name used for consistency with krb5/config.h)
***************
*** 186,192 ****
  AC_DIVERT_PUSH(AC_DIVERSION_MAKEFILE)dnl
  [
  
- SRCTOP=$(srcdir)/$(BUILDTOP)
  ### /* these are invoked as $(...) foo.et, which works, but could be better */
  COMPILE_ET_H= $(AWK) -f $(SRCTOP)/util/et/et_h.awk outfile=$@
  COMPILE_ET_C= $(AWK) -f $(SRCTOP)/util/et/et_c.awk outfile=$@
--- 201,206 ----
***************
*** 233,272 ****
  dnl check if sys/fcntl.h is needed for O_* -- CHECK_FCNTL
  dnl
  define(CHECK_FCNTL,[
! AC_COMPILE_CHECK([O_RDONLY from sys/file.h],
  [#include <sys/param.h>
  #include <sys/types.h>
  #include <sys/file.h>],
! [O_RDONLY;], ,AC_COMPILE_CHECK([O_RDONLY from sys/fcntl.h],
! [#include <sys/param.h>
  #include <sys/types.h>
  #include <sys/file.h>
  #include <sys/fcntl.h>],
! [O_RDONLY;],AC_DEFINE(NEED_SYS_FCNTL_H)))])dnl
  dnl
  dnl check if union wait is defined, or if WAIT_USES_INT -- CHECK_WAIT_TYPE
  dnl
  define(CHECK_WAIT_TYPE,[
! AC_COMPILE_CHECK([union wait],
! [#include <sys/wait.h>], [union wait i;], , AC_DEFINE(WAIT_USES_INT))])dnl
  dnl
  dnl check for POSIX signal handling -- CHECK_SIGNALS
  dnl
  define(CHECK_SIGNALS,[
  AC_FUNC_CHECK(sigprocmask,
! AC_COMPILE_CHECK([sigset_t],
  [#include <signal.h>],
  [sigset_t x],
! AC_DEFINE(POSIX_SIGNALS)))])dnl
  dnl
  dnl check for POSIX setjmp/longjmp -- CHECK_SETJMP
  dnl
  define(CHECK_SETJMP,[
  AC_FUNC_CHECK(sigsetjmp,
! AC_COMPILE_CHECK([sigjmp_buf],
  [#include <setjmp.h>],
  [sigjmp_buf x],
! AC_DEFINE(POSIX_SETJMP)))])dnl
  dnl
  dnl set $(KRB5ROOT) from --with-krb5-root=value -- WITH_KRB5ROOT
  dnl
--- 247,315 ----
  dnl check if sys/fcntl.h is needed for O_* -- CHECK_FCNTL
  dnl
  define(CHECK_FCNTL,[
! AC_MSG_CHECKING([if O_RDONLY is needed from sys/fcntl.h])
! AC_CACHE_VAL(krb5_cv_decl_fcntl_ordonly,
! [AC_TRY_LINK(
  [#include <sys/param.h>
  #include <sys/types.h>
  #include <sys/file.h>],
! [O_RDONLY;], krb5_cv_decl_fcntl_ordonly=no,
! AC_TRY_LINK([#include <sys/param.h>
  #include <sys/types.h>
  #include <sys/file.h>
  #include <sys/fcntl.h>],
! [O_RDONLY;],krb5_cv_decl_fcntl_ordonly=yes,krb5_cv_decl_fcntl_ordonly=no))])
! AC_MSG_RESULT($krb5_cv_decl_fcntl_ordonly)
! if test $krb5_cv_decl_fcntl_ordonly = yes; then
!   AC_DEFINE(NEED_SYS_FCNTL_H)
! fi
! ])dnl
  dnl
  dnl check if union wait is defined, or if WAIT_USES_INT -- CHECK_WAIT_TYPE
  dnl
  define(CHECK_WAIT_TYPE,[
! AC_MSG_CHECKING([for union wait])
! AC_CACHE_VAL(krb5_cv_struct_wait,
! [AC_TRY_LINK(
! [#include <sys/wait.h>], [union wait i;], 
! 	krb5_cv_struct_wait=yes, krb5_cv_struct_wait=no)])
! AC_MSG_RESULT($krb5_cv_struct_wait)
! if test $krb5_cv_struct_wait = no; then
! 	AC_DEFINE(WAIT_USES_INT)
! fi
! ])
  dnl
  dnl check for POSIX signal handling -- CHECK_SIGNALS
  dnl
  define(CHECK_SIGNALS,[
  AC_FUNC_CHECK(sigprocmask,
! AC_MSG_CHECKING(for sigset_t and POSIX_SIGNALS)
! AC_CACHE_VAL(krb5_cv_type_sigset_t,
! [AC_TRY_LINK(
  [#include <signal.h>],
  [sigset_t x],
! krb5_cv_type_sigset_t=yes, krb5_cv_type_sigset_t=no)])
! AC_MSG_RESULT($krb5_cv_type_sigset_t)
! if test $krb5_cv_type_sigset_t = yes; then
!   AC_DEFINE(POSIX_SIGNALS)
! fi
! )])dnl
  dnl
  dnl check for POSIX setjmp/longjmp -- CHECK_SETJMP
  dnl
  define(CHECK_SETJMP,[
  AC_FUNC_CHECK(sigsetjmp,
! AC_MSG_CHECKING(for sigjmp_buf)
! AC_CACHE_VAL(krb5_cv_struct_sigjmp_buf,
! [AC_TRY_LINK(
  [#include <setjmp.h>],
  [sigjmp_buf x],
! krb5_cv_struct_sigjmp_buf=yes,krb5_cv_struct_sigjmp_buf=no)])
! AC_MSG_RESULT($krb5_cv_struct_sigjmp_buf)
! if test $krb5_cv_struct_sigjmp_buf = yes; then
!   AC_DEFINE(POSIX_SETJMP)
! fi
! )])dnl
  dnl
  dnl set $(KRB5ROOT) from --with-krb5-root=value -- WITH_KRB5ROOT
  dnl
***************
*** 388,393 ****
--- 431,439 ----
  		(set -x; [$](RM) $2/$1;	[$](CP) $(srcdir)/$1 $2/$1) \
  	fi
  
+ clean::
+ 	$(RM) $2/$1
+ 
  AC_DIVERT_POP()dnl
  ])dnl
  dnl
***************
*** 446,461 ****
  dnl
  define(HAVE_YYLINENO,[dnl
  AC_REQUIRE_CPP()AC_REQUIRE([AC_PROG_LEX])dnl
! AC_CHECKING(for yylineno declaration)
  # some systems have yylineno, others don't...
    echo '%%
  %%' | ${LEX} -t > conftest.out
    if egrep yylineno conftest.out >/dev/null 2>&1; then
! 	:
    else
  	AC_DEFINE([NO_YYLINENO])
    fi
-   rm -f conftest.out
  ])dnl
  dnl
  dnl fix AC_PROG_LEX
--- 492,512 ----
  dnl
  define(HAVE_YYLINENO,[dnl
  AC_REQUIRE_CPP()AC_REQUIRE([AC_PROG_LEX])dnl
! AC_MSG_CHECKING([for yylineno declaration])
! AC_CACHE_VAL(krb5_cv_type_yylineno,
  # some systems have yylineno, others don't...
    echo '%%
  %%' | ${LEX} -t > conftest.out
    if egrep yylineno conftest.out >/dev/null 2>&1; then
! 	krb5_cv_type_yylineno=yes
    else
+ 	krb5_cv_type_yylineno=no
+   fi
+   rm -f conftest.out)
+   AC_MSG_RESULT($krb5_cv_type_yylineno)
+   if test $krb5_cv_type_yylineno = no; then
  	AC_DEFINE([NO_YYLINENO])
    fi
  ])dnl
  dnl
  dnl fix AC_PROG_LEX

home help back first fref pref prev next nref lref last post