[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: function-local variables in ltmain
From: |
Gary V. Vaughan |
Subject: |
Re: function-local variables in ltmain |
Date: |
Tue, 16 Aug 2005 15:57:18 +0100 |
User-agent: |
Mozilla Thunderbird 1.0 (X11/20050305) |
Hallo Ralf,
Ralf Wildenhues wrote:
* Gary V. Vaughan wrote on Tue, Aug 16, 2005 at 04:06:38PM CEST:
Ralf Wildenhues wrote:
This breaks `eval'.
I don't see how...
func_create_old_archive ()
{
# for some reason (e.g. "interesting" archivers like `link -lib')
# we need to adapt old_deplibs, which is _LT_TAGVAR'ed.
local(old_deplibs, ...)
#...
func_execute_cmds "$old_archive_cmds" # this uses `eval'
#...
endfunc
}
Now if I understand your proposal correctly, that just won't work then.
Clear now?
Sure. Seems we are talking past each other slightly.
Here is what I mean (untested btw, so quoting is almost certainly fubar):
# func(name)
# ----------
# Define function func_name.
m4_define([func],
[m4_define([lt_fcleanup])dnl
m4_define([lt_func_enum],
[ifdef([lt_func_enum], [m4_incr(lt_func_enum)],
0)])dnl
[func_]$1[]dnl
])
# endfunc
# -------
m4_define([endfunc], [lt_fcleanup])
# local(variable, [value])
# ------------------------
# Define VARIABLE to be local to the current shell function.
m4_define([local],
[[local]]lt_func_enum[[_$1=$][$1]dnl
m4_if([$#], [2], [
$1=$2])[]dnl
m4_append([lt_fcleanup], [
$1=[$]local]lt_func_enum[_$1])dnl
])
...saving and restoring globals exactly as you propose, but using a less
verbose system of ensuring uniqueness of the place holders.
Cheers,
Gary.
--
Gary V. Vaughan ())_. address@hidden,gnu.org}
Research Scientist ( '/ http://tkd.kicks-ass.net
GNU Hacker / )= http://www.gnu.org/software/libtool
Technical Author `(_~)_ http://sources.redhat.com/autobook
signature.asc
Description: OpenPGP digital signature