Akim Demaille writes:

> Also, it has a hidden bell: take a look at this:
> 
> | ac_ac_Sizeof=`echo "ac_cv_sizeof_$int" | $ac_tr_sh`
> | if eval "test \"\${$ac_ac_Sizeof+set}\" = set"; then
> |   echo $ECHO_N "(cached) $ECHO_C" >&6
> |   eval "$ac_ac_Sizeof=`cat conftestval`"
> |   eval "$ac_ac_Sizeof=0"
> | echo "${ECHO_T}`eval echo '${'$ac_ac_Sizeof'}'`" >&6
> | #define `echo "sizeof_$int" | $ac_tr_cpp` `eval echo '${'$ac_ac_Sizeof'}'`

Oh, you turned autoconf into an optimizing shell-script compiler!

> But I confess my cry was also due to the incredible patsusbt.

You should have seen the big patsubst while it was still in one big line :-)

> Bruno> The motivation for caching at the level of one compiler
> Bruno> invocation is that the test result may be reused by different
> Bruno> high-level tests in the same configure script. It would be very
> Bruno> annoying if AM_GNU_GETTEXT and other big tests couldn't share
> Bruno> their results with other pieces of the same script.
> 
> When the same low level test is run, it is probably the sign that the
> same high level test was run, so...

Not at all. Have you observed how often you see messages like

checking for unistd.h... yes
...
checking for unistd.h... (cached) yes

in the _same_ configure run, with no pre-existing config.cache?


Back to the main subject. Can you provide macros of the following kind
for the next autoconf? I don't really care how they are named, nor whether
the user needs to specify the cache variable by hand. But they should work
reliably when cross compiling.

-   AC_CHECK_EVAL_BOOL(INCLUDES, BOOLEAN-CONSTANT-EXPRESSION
                       [, ACTION-IF-TRUE [, ACTION-IF-FALSE]])

    Evaluates a boolean constant expression.

-   AC_CHECK_EVAL_INT(INCLUDES, INT-CONSTANT-EXPRESSION, VARIABLE)

    Evaluates an integer constant expression, and assigns the value
    (in decimal) to the shell variable VARIABLE.

-   AC_CHECK_SIZEOF(TYPE)

    No default for cross compilation needed.


Bruno

Reply via email to