Re: Expansion of $source (bcc static lib support)

Bram Moolenaar <[email protected]> Tue, 11 May 2004 13:24:53 +0200
Newsgroups gmane.comp.tools.aap.user
Message-ID <[email protected]>
Fred Schoenahl wrote:

> I have posted some times ago for a bcc support of static library build.
> I have had now some time to try to implement and use it, I face one
> problem - as the building path is build-nt/..., the commandline refuses
> it so, that afaik I have to write the tlib.exe command like that : 
> 
> tlib lib\mylib.lib, "build-nt\...\file1.obj", "build-nt\...\file2.obj"
> 
> to have the right expansion, I have the following statement : 
> 
> ":sys $AR $target, $source"
> 
> and I transform it into 
> 
> ":sys $AR $target ,\"$*source\" "
> 
> to get it into quotes. It doesn't work and I get something like 
> 
> tlib lib\mylib.lib ", build-nt\...\file1.obj" ", build-nt\...\file2.obj"
> 
> I have tried some other combinations without success. Is it possible?

Not that simple.  I think this requires a bit of Python code:

        @l = var2list(source)
        @for i in range(0, len(l) - 1):
        @       l[i] = '"' + l[i] + '"' + ','
        @l[len(l) - 1] = '"' + l[len(l) - 1] + '"'
        res = `l`
        :print :sys tlib $target, $=res


Using "$=res" is required to avoid that Aap thinks the double quotes are
to be escaped again with single quotes.

You can see I never thought of using commas here.

-- 
hundred-and-one symptoms of being an internet addict:
238. You think faxes are old-fashioned.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
 \\\  Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///


-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver
higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3