autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AC_CHECK_FUNCS(sigsetjmp)


From: Bruce Korb
Subject: Re: AC_CHECK_FUNCS(sigsetjmp)
Date: Thu, 27 Jul 2006 20:21:10 -0700
User-agent: Mozilla Thunderbird 1.0.7 (X11/20050923)

Andreas Schwab wrote:
Thomas Dickey <address@hidden> writes:


btw - does AC_CHECK_FUNCS(stat) work?  stat() is required to be a
function.


Yes, but many libcs are buggy.

"not required to be a normal function" implies that it is
common knowledge that everybody knows you have to roll your
own AC macro?  That is *precisely* the point of autoconf --
minimize the amount of esoterica that programmers have to
know to figure out how to do what they know how to do on
the canonical platform.  So, below are two macros for setjmp
and sigsetjmp along with a plea for AC_CHECK_MACROS_OR_FUNCS(...)
since I'm pretty sure I wouldn't know how to write it.


AC_DEFUN([AG_LINK_SETJMP],[
  AC_MSG_CHECKING([whether setjmp() links okay])
  AC_CACHE_VAL([ag_cv_link_setjmp],[
  AC_TRY_LINK(address@hidden:@include <setjmp.h>],
    [jmp_buf bf;
     return setjmp(&bf);],
    [ag_cv_link_setjmp=yes],[ag_cv_link_setjmp=no]
  ) # end of TRY_LINK
  ]) # end of AC_CACHE_VAL for ag_cv_link_setjmp
  AC_MSG_RESULT([${ag_cv_link_setjmp}])

  if test "X${ag_cv_link_setjmp}" != Xno
  then
    AC_DEFINE(HAVE_WORKING_SETJMP, 1, @<:@setjmp links okay@:>@)
  fi

]) # end of AC_DEFUN of AG_LINK_SETJMP


AC_DEFUN([AG_LINK_SIGSETJMP],[
  AC_MSG_CHECKING([whether sigsetjmp() links okay])
  AC_CACHE_VAL([ag_cv_link_sigsetjmp],[
  AC_TRY_LINK(address@hidden:@include <setjmp.h>],
    [sigjmp_buf bf;
     return sigsetjmp(&bf,0);],
    [ag_cv_link_sigsetjmp=yes],[ag_cv_link_sigsetjmp=no]
  ) # end of TRY_LINK
  ]) # end of AC_CACHE_VAL for ag_cv_link_sigsetjmp
  AC_MSG_RESULT([${ag_cv_link_sigsetjmp}])

  if test "X${ag_cv_link_sigsetjmp}" != Xno
  then
    AC_DEFINE(HAVE_WORKING_SIGSETJMP, 1, @<:@sigsetjmp links okay@:>@)
  fi

]) # end of AC_DEFUN of AG_LINK_SIGSETJMP




reply via email to

[Prev in Thread] Current Thread [Next in Thread]