The JavaScriptCore library is part of the WebKit project and thus Open Source. However, in the sources you get from the WebKit SVN, the XCode project files are curiously missing an iOS compile target. You can't compile it for iOS. The sources you get from opensource.apple.com are missing the project files altogether. You can't compile it all. That's quite the Open Source spirit, Apple!
This repo aims to re-produce the missing iOS targets while staying on a somewhat up-to-date version.
Currently, the Safari 6.0.2 release is used as the basis. With the current settings, the WTF and JavaScriptCore libraries can be compiled for armv7 and x86 (for the iOS simulator). It will be compiled without Unicode collation support, because Apple claims ICU is a private framework on iOS. It should be AppStore compatible this way.
This branch enables support for JavaScript's Typed Arrays which are normally a part of WebKit, not of JavaScriptCore.
The compiled .idl files of the WebCore project were adapted to work directly in JavaScriptCore; all DOM references were removed or replaced. As far as I can tell everything works. However, I took some shortcuts for defining the Array's prototypes and constructors: they're all shared across all JSC Contexts - so it will probably explode in your face when you use several Contexts and modify the prototypes in JavaScript.
I also wrote some new API methods to work with Typed Arrays in native code. Have a lookt at the API/JSTypedArray.h, it declares three new API functions. The documentation for these functoins can be found in this header file as well.
A binary version of the libJavaScriptCore.a that includes Typed Array support can be found here; don't expect this to be up to date, though:
http://phoboslab.org/crap/libJavaScriptCore-TypedArrays.zip
-
Create a
Build/directory in the top level of this repo. The combinedlibWTF.aandJavaScriptCore.awill be placed here -
Open the
WTF/WTF.xcodeprojfile and compile the "WTF iOS" target once for "iOS Device" and once for "iPhone Simulator". Compile the release version (Shift+Command+I). -
Compile the "Combine iOS lib" target. This will execute a script that will combine the device and simulator libraries into one and place it in your
Build/directory. -
Open the
JavaScriptCore/JavaScriptCore.xcodeprojfile and compile the "JavaScriptCore iOS" target once for "iOS Device" and once for "iPhone Simulator". Compile the release version (Shift+Command+I). -
Compile the "Combine iOS lib" target. This will execute a script that will combine the device and simulator libraries into one and place it in your
Build/directory.