Thanks Jakob, that makes sense. I've confirmed that by linking to those 
libraries it works. I may have been thrown off initially by the fact that 
the .a files are buried so deep in the build output, basically had to grep. 
I did look at the d8 build before, but it of course just says v8.gyp is a 
dependency it *just works*, linking to it externally wasn't as clear.

Sorry for the confusion,
Jeff


On Monday, 5 March 2012 05:28:42 UTC-5, Jakob Kummerow wrote:
>
> (inline)
>
> On Sat, Mar 3, 2012 at 07:21, Jeff Rogers <[email protected]> wrote:
>
>> I was wondering if it is possible to build v8 as a static library 
>> (libv8.a) on Mac or Linux using the GYP build? Looking at the gyp files, it 
>> seems like the new build system will only build shell executables and 
>> smaller component libraries (libv8_base, libv8_nosnapshot, 
>> libpreprocessor_lib), or a shared library when component=shared_library.
>>
>
> Yep, that seems to be the case, and it is sufficient for all clients of V8 
> that I know of.
>  
>
>> Specifying component=static_library or library=static as was supported in 
>> the Scons build does not generate libv8.a. 
>>
>
> There's no need to explicitly specify it as it's the default behavior 
> anyway.
>  
>
>> In particular the v8.gyp sets the type to none unless shared is specified 
>> so I'm guessing that has something to do with it. I cannot get it to work 
>> so far.
>>
>
> Why do you need libv8.a in the first place? Look at d8.gyp for an example 
> how you can statically link against V8. It "just works". Generally 
> speaking, if you have a choice at all, you should opt for dynamic linking 
> (i.e. shared libraries).
>
> If the current capabilities of the GYP build don't fit your needs, we'd be 
> happy to accept patches (as long as they don't break other build scenarios, 
> of course). If you help me understand your requirements, I might even look 
> into it myself eventually, but it this point I can't promise anything.
>
>

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to