Hello libtool,

  I'm currently working on implementing full (to the extent possible)
support for win32 dlls. Since ways in which I'm trying to achieve this
differ substantially from current libtool's approach and hacking 100k
shell scripts is little fun, I prototype it from scratch in Python.

  Currently, I'm doing it in the following way: I configured libtool once,
pasted config variables from it to my Python script and did proper for
Python quoting of values. Then, for each package, I configure it as
usually, and then replace libtool with mine. For the early hacking
it's ok, but to test it realistically and use for production, I need
way to convert libtool configuration automatically. I can write srcipt
which will filter config section of old libtool, then re-quote
single-line values in doublequotes, multiline in tripled doublequotes,
as Python requires. However, it will be totally adhoc script, which
yet should be run manually.

    Rather, I'd invest my time in what I'd call generalizing template
approach of libtool creation.

    The current approach to create libtool is itself adhoc:
1. There're to versions of libtool template, one in sh and one in C
(dummy).
2. Name of template to use is passed as argument to ltconfig.
3. Ltconfig in adhoc way checks what template of the two possible
languages passed, quotes variable in adhoc way for each.
4. Then, it either appends interim (full!) shell template or going to
compile C.

Instead, I propose following:

1. There's *single* template for libtool.
2. It consists of several chunks, each of which represent template for
full future libtool.
3. Each chunk has header which specifies:
   a) metachar-enabled list of target triples for which this chunk
   implements libtool
   b) arbitrary expression which must evaluate to true for this chunk
   to be selected
4. Rest of chunk is text of specific libtool, with usual template
variables @VAR@.
5. Following procedure to be used for cretaing libtool:
   a) libtool performs usual actions to infer libtool configuration
   b) libtool template is searched for first chunk matching target and
   for which enabling expression evaluated to true.
   c) on the given chunk substitution performed, replacing substrings
   '@VAR@' with value of variable VAR.
   d) libtool is ready

Benefits:
1. CLear and concise procedure
2. Easy to add new libtools implementation written for any specific
platform and in any language.
3. Even if 2 is not apply, then at least easy to hack and experiment
with new libtool implementations.

Does this sound sane?

--
Paul Sokolovsky, IT Specialist
http://www.brainbench.com/transcript.jsp?pid=11135


Reply via email to