I'm an autoconf newbie. I have a few working autoconf macros that I
tried to add caching support for, on the model of code from the Vaughan
et al. autobook.
Caching sort of works: I can see the proper value set in config.cache,
and on the first clean run the appropriate #define gets set in
config.h. On subsequent runs, the config.h value remains commented
out. Here's one of my macros, to check for SysV IPC headers:
AC_DEFUN([ETR_SYSV_IPC],
[ AC_CACHE_CHECK([for System V IPC headers], ac_cv_sysv_ipc, [
AC_TRY_COMPILE(
[
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <sys/sem.h>
#include <sys/shm.h>
],, ac_cv_sysv_ipc=yes, ac_cv_sysv_ipc=no)
if test x"$ac_cv_sysv_ipc" = "xyes"
then
AC_DEFINE(HAVE_SYSV_IPC, 1, [ Define if you have System V IPC])
fi
])]) dnl ETR_SYSV_IPC
If I remove the AC_CACHE_CHECK wrapper, config.h is always correct, but
that's not the right solution. I think the problem is that autoconf
isn't understanding the relationship between ac_cv_sysv_ipc and
HAVE_SYSV_IPC.
Clues, please?
--
= Warren -- ICBM Address: 36.8274040 N, 108.0204086 W, alt. 1714m