autoconf-archive-maintainers | |
[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [patch #7596] Autoconf macro to detect comiler flags for building ru
From: |
Maarten Bosmans |
Subject: |
Re: [patch #7596] Autoconf macro to detect comiler flags for building ruby extensions |
Date: |
Sat, 20 Aug 2011 11:06:25 +0200 |
2011/8/20 Stanislav Sedov <address@hidden>:
> On Sun, 14 Aug 2011 20:50:16 +0200
> Maarten Bosmans <address@hidden> mentioned:
>
>> Wouldn't this be a good macro to define using AC_DEFUN_ONCE?
>>
>> Also, it would be nice to take the effort to add proper caching, for
>> this macro and also the perl one.
>>
>
> Hi, Maarten!
>
> Sorry for the delay! I'm not sure that these macros should be AC_DEFUN_ONCE,
> because potentially they could be called several times with different values
> of $PERL/$RUBY to find values for different kinds of interpreter. But I don't
> have a strong position on this point. Do you think that I better maker them
> one-shot?
No, I was just pointing out the other possibility. They are your
macros, I probably will never use the directly, so you get to decide
if you want to support multiple interpreters.
> As for the caching -- do you have any pointers on how to implement a proper
> caching? I can certainly use AC_CACHE_VAL, but then if the value of $RUBY
> changes between runs it will pick up wrong values? Or will the cache be
> discarded automatically in this case?
Or better yet, AC_CACHE_CHECK, if that fits your case.
If you want to take care of changes in the interpreter, you should
make that part of the cache variable name. To properly use a variable
with the contents of a shell variable in its name, use AS_VAR_PUSHDEF
and AS_VAR_POPDEF. Also use AS_VAR_SET and AS_VAR_GET as, for example,
illustrated in
http://git.savannah.gnu.org/cgit/autoconf-archive.git/tree/m4/ax_check_compile_flag.m4
Maarten
> Thanks!
>
> --
> Stanislav Sedov
> ST4096-RIPE
>
> () ascii ribbon campaign - against html e-mail
> /\ www.asciiribbon.org - against proprietary attachments
>