Created
June 3, 2010 17:24
-
-
Save noonat/424182 to your computer and use it in GitHub Desktop.
SpiderMonkey on iPhone
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- config/autoconf.mk.in 2010-06-05 19:06:36.000000000 -0700 | |
+++ config/autoconf.mk.in 2010-06-05 19:06:59.000000000 -0700 | |
@@ -97,7 +97,6 @@ | |
NS_TRACE_MALLOC = @NS_TRACE_MALLOC@ | |
INCREMENTAL_LINKER = @INCREMENTAL_LINKER@ | |
-MACOSX_DEPLOYMENT_TARGET = @MACOSX_DEPLOYMENT_TARGET@ | |
BUILD_STATIC_LIBS = @BUILD_STATIC_LIBS@ | |
ENABLE_TESTS = @ENABLE_TESTS@ | |
--- configure.in 2010-06-05 16:18:36.000000000 -0700 | |
+++ configure.in 2010-06-05 16:22:45.000000000 -0700 | |
@@ -1735,7 +1735,7 @@ | |
_PLATFORM_DEFAULT_TOOLKIT='cairo-cocoa' | |
MOZ_ENABLE_POSTSCRIPT= | |
TARGET_NSPR_MDCPUCFG='\"md/_darwin.cfg\"' | |
- LDFLAGS="$LDFLAGS -framework Cocoa" | |
+ LDFLAGS="$LDFLAGS" | |
# The ExceptionHandling framework is needed for Objective-C exception | |
# logging code in nsObjCExceptions.h. Currently we only use that in debug | |
# builds. | |
--- jsnum.h 2010-06-05 16:23:45.000000000 -0700 | |
+++ jsnum.h 2010-06-05 16:23:53.000000000 -0700 | |
@@ -100,7 +100,7 @@ | |
#ifdef WIN32 | |
return _finite(d); | |
#else | |
- return finite(d); | |
+ return isfinite(d); | |
#endif | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Shell script for compiling SpiderMonkey for iPhone | |
# | |
# 1) Install autoconf 2.13 if you don't have it. You can install it with | |
# port install autoconf213, or manually like so: | |
# curl -O http://ftp.gnu.org/gnu/autoconf/autoconf-2.13.tar.gz | |
# tar xzf autoconf-2.13.tar.gz | |
# cd autoconf-2.13 | |
# ./configure --program-suffix=213 --prefix=/Users/nathano/.local | |
# make install | |
# | |
# 2) Get the SpiderMonkey source: | |
# hg clone http://hg.mozilla.org/mozilla-central/ | |
# | |
# 3) Dump the files from this gist into mozilla-central/js/src | |
# | |
# 4) Run build.sh | |
if [ ! -f ./configure ]; then | |
patch -p0 -i build.patch || exit 1 | |
autoconf213 || exit 1 | |
fi | |
# Backup the environment variables | |
OLD_CC=$CC | |
OLD_CFLAGS=$CFLAGS | |
OLD_CXX=$CXX | |
OLD_CXXFLAGS=$CXXFLAGS | |
OLD_LD=$LD | |
OLD_LDFLAGS=$LD | |
OLD_AR=$AR | |
OLD_AS=$AS | |
OLD_RANLIB=$RANLIB | |
OLD_HOST_CC=$HOST_CC | |
OLD_HOST_CXX=$HOST_CXX | |
# Build for iPhone device | |
make distclean | |
rm -f libjs_static_arm.a | |
_local_cflags="-isysroot $SDKROOT -no-cpp-precomp -pipe -I$SDKROOT/usr/lib/gcc/arm-apple-darwin10/4.2.1/include/ -I$SDKROOT/usr/include/" | |
export DEVROOT=/Developer/Platforms/iPhoneOS.platform/Developer | |
export SDKROOT=$DEVROOT/SDKs/iPhoneOS3.2.sdk | |
export SDKCFLAGS="-isysroot $SDKROOT -no-cpp-precomp -pipe" | |
export CC="$DEVROOT/usr/bin/arm-apple-darwin10-gcc-4.2.1 $SDKCFLAGS" | |
export CFLAGS="" | |
export CXX="$DEVROOT/usr/bin/arm-apple-darwin10-g++-4.2.1 $SDKCFLAGS -I$SDKROOT/usr/include/c++/4.2.1/armv6-apple-darwin10/" | |
export CXXFLAGS="$CFLAGS" | |
export LD="$DEVROOT/usr/bin/ld" | |
export LDFLAGS="-L$SDKROOT/usr/lib" | |
export AR="$DEVROOT/usr/bin/ar" | |
export AS="$DEVROOT/usr/bin/as" | |
export RANLIB="$DEVROOT/usr/bin/ranlib" | |
export HOST_CC="/usr/bin/gcc" | |
export HOST_CXX="/usr/bin/g++" | |
./configure \ | |
--host=arm-apple-darwin \ | |
--disable-tracejit \ | |
--disable-shared \ | |
--enable-static || exit 1 | |
make || exit 1 | |
mv libjs_static.a libjs_static.a.arm | |
# Build for iPhone simulator | |
make distclean | |
rm -f libjs_static_i386.a | |
export DEVROOT=/Developer/Platforms/iPhoneSimulator.platform/Developer | |
export SDKROOT=$DEVROOT/SDKs/iPhoneSimulator3.2.sdk | |
export SDKCFLAGS="-isysroot $SDKROOT -mmacosx-version-min=10.5 -no-cpp-precomp -pipe" | |
export CC="$DEVROOT/usr/bin/i686-apple-darwin10-gcc-4.2.1 $SDKCFLAGS" | |
export CFLAGS="" | |
export CXX="$DEVROOT/usr/bin/i686-apple-darwin10-g++-4.2.1 $SDKCFLAGS" | |
export CXXFLAGS="$CFLAGS" | |
export LD="$DEVROOT/usr/bin/ld" | |
export LDFLAGS="-L$SDKROOT/usr/lib" | |
export AR="$DEVROOT/usr/bin/ar" | |
export AS="$DEVROOT/usr/bin/as" | |
export RANLIB="$DEVROOT/usr/bin/ranlib" | |
export HOST_CC="/usr/bin/gcc" | |
export HOST_CXX="/usr/bin/g++" | |
./configure \ | |
--disable-tracejit \ | |
--disable-shared \ | |
--enable-static || exit 1 | |
make || exit 1 | |
mv libjs_static.a libjs_static.a.i386 | |
# Make a fat library | |
lipo \ | |
-arch arm libjs_static.a.arm \ | |
-arch i386 libjs_static.a.i386 \ | |
-create -output libjs_static.a | |
# Restore the environment variables | |
export CC=$OLD_CC | |
export CFLAGS=$OLD_CFLAGS | |
export CXX=$OLD_CXX | |
export CXXFLAGS=$OLD_CXXFLAGS | |
export LD=$OLD_LD | |
export LDFLAGS=$OLD_LDFLAGS | |
export AR=$OLD_AR | |
export AS=$OLD_AS | |
export RANLIB=$OLD_RANLIB | |
export HOST_CC=$OLD_HOST_CC | |
export HOST_CXX=$OLD_HOST_CXX |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
or ,could you please send the libjs.a & headers for iPhone & siumlator for me , tracy.cpp@gmail.com . Thanks!