[webkit-dev] JSC without Dependencies

Brent Fulgham bfulgham at gmail.com
Mon Aug 17 11:04:29 PDT 2009


Hi Brian,

I just took a look to see why CoreFoundation is being used in
JavaScriptCore, and frankly am a little puzzled.

A quick check of includes of CoreFoundation shows a handful of files:

$ grep -r CoreFoundation * | grep -v ".svn" | grep "#include"
API/JSStringRefCF.h:#include <CoreFoundation/CoreFoundation.h>
runtime/DatePrototype.cpp:#include <CoreFoundation/CoreFoundation.h>
wtf/Assertions.cpp:#include <CoreFoundation/CFString.h>
wtf/CurrentTime.cpp:#include <CoreFoundation/CFDate.h>
wtf/RetainPtr.h:#include <CoreFoundation/CoreFoundation.h>
wtf/unicode/icu/CollatorICU.cpp:#include <CoreFoundation/CoreFoundation.h>

All of these are actually conditionalized on PLATFORM(MAC), except the
API/JSStringRefCF.h.

In theory, you could remove the JSStringRefCF from the set of build
files and remove the dependency on CoreFoundation/CFLite entirely.  It
doesn't even look like the JavaScriptCore.def references any of the
CFStringRef-related functions.

I am actually surprised that the date/time and Collator sources don't
use CoreFoundation on Windows.  Apple spent a bunch of time writing
these compatibility routines that provide superior formatting of
dates, handling of low-level time intervals, etc... Why are we not
using them?

Bottom line Brian, is that you should create a non-PLATFORM(CF) build
of JavaScriptCore:

1.  Duplicate the Windows vcproj.
2.  Remove the JSStringRefCF.cpp/.h files from the list of build items.
3.  Remove the CFLite.lib link command.

Voila -- you should have a CFLite-less build.

On Mon, Aug 17, 2009 at 9:19 AM, Brian Barnes<ggadwa at charter.net> wrote:

> icu*** (might not be possible, google says these are unicode tools)

The wtf/unicode things need these libraries.  I'm not sure how wise it
would be to remove them, however this is the largest single external
dependency you will have to deal with.

> pthreadVC2 (based on previous email should not be needed)

I'd like to get rid of this, too.

> 3) Compile all within VS (no makes or external calls) to eliminate any
> additional dependencies on other tools

You can already do this.  You only need cygwin to easily handle
retrieving the sources, and I think the Google/Chromium guys have been
working to remove this dependency.

-Brent


More information about the webkit-dev mailing list