summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gardiner <paul.gardiner@artifex.com>2013-11-28 16:24:54 +0000
committerPaul Gardiner <paul.gardiner@artifex.com>2013-12-16 17:33:14 +0000
commitad83e625f89b4b7ab09cf85d11d6bca60c2b0e48 (patch)
treed7743e1ba427b2fca2cf3338f2bdcca32941c417
parent193060841a2669adcf905907581d2c701f0d02f4 (diff)
downloadmupdf-ad83e625f89b4b7ab09cf85d11d6bca60c2b0e48.tar.xz
iOS: add javascript support
-rw-r--r--Makefile9
-rw-r--r--platform/ios/MuPDF.xcodeproj/project.pbxproj14
-rw-r--r--platform/ios/build_libs.sh2
3 files changed, 18 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 0eb0da3b..d94d6b69 100644
--- a/Makefile
+++ b/Makefile
@@ -93,6 +93,7 @@ XPS_OBJ := $(subst source/, $(OUT)/, $(addsuffix .o, $(basename $(XPS_SRC))))
CBZ_OBJ := $(subst source/, $(OUT)/, $(addsuffix .o, $(basename $(CBZ_SRC))))
IMG_OBJ := $(subst source/, $(OUT)/, $(addsuffix .o, $(basename $(IMG_SRC))))
+PDF_JS_JSCORE_OBJ := $(OUT)/pdf/js/pdf-js.o $(OUT)/pdf/js/pdf-jsimp-jscore.o
PDF_JS_V8_OBJ := $(OUT)/pdf/js/pdf-js.o $(OUT)/pdf/js/pdf-jsimp-cpp.o $(OUT)/pdf/js/pdf-jsimp-v8.o
PDF_JS_NONE_OBJ := $(OUT)/pdf/js/pdf-js-none.o
@@ -102,6 +103,7 @@ $(XPS_OBJ) : $(FITZ_HDR) $(XPS_HDR) $(XPS_SRC_HDR)
$(CBZ_OBJ) : $(FITZ_HDR) $(CBZ_HDR) $(CBZ_SRC_HDR)
$(IMG_OBJ) : $(FITZ_HDR) $(IMG_HDR) $(IMG_SRC_HDR)
+$(PDF_JS_JSCORE_OBJ) : $(FITZ_HDR) $(PDF_HDR) $(PDF_SRC_HDR)
$(PDF_JS_V8_OBJ) : $(FITZ_HDR) $(PDF_HDR) $(PDF_SRC_HDR)
$(PDF_JS_NONE_OBJ) := $(FITZ_HDR) $(PDF_HDR) $(PDF_SRC_HDR)
@@ -118,7 +120,12 @@ MUPDF_JS_V8_LIB := $(OUT)/libmupdf-js-v8.a
$(MUPDF_JS_V8_LIB) : $(PDF_JS_V8_OBJ)
endif
-INSTALL_LIBS := $(MUPDF_LIB) $(MUPDF_JS_NONE_LIB) $(MUPDF_JS_V8_LIB)
+ifeq "$(JSCORE_PRESENT)" "yes"
+MUPDF_JS_JSCORE_LIB := $(OUT)/libmupdf-js-jscore.a
+$(MUPDF_JS_JSCORE_LIB) : $(PDF_JS_JSCORE_OBJ)
+endif
+
+INSTALL_LIBS := $(MUPDF_LIB) $(MUPDF_JS_NONE_LIB) $(MUPDF_JS_V8_LIB) $(MUPDF_JS_JSCORE_LIB)
# --- Rules ---
diff --git a/platform/ios/MuPDF.xcodeproj/project.pbxproj b/platform/ios/MuPDF.xcodeproj/project.pbxproj
index 54b78264..efcd02c8 100644
--- a/platform/ios/MuPDF.xcodeproj/project.pbxproj
+++ b/platform/ios/MuPDF.xcodeproj/project.pbxproj
@@ -17,7 +17,7 @@
96C8ED181779A9AE00A30AF4 /* libfreetype.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 96C8ED111779A9AE00A30AF4 /* libfreetype.a */; };
96C8ED191779A9AE00A30AF4 /* libjbig2dec.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 96C8ED121779A9AE00A30AF4 /* libjbig2dec.a */; };
96C8ED1A1779A9AF00A30AF4 /* libjpeg.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 96C8ED131779A9AE00A30AF4 /* libjpeg.a */; };
- 96C8ED1B1779A9AF00A30AF4 /* libmupdf-js-none.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 96C8ED141779A9AE00A30AF4 /* libmupdf-js-none.a */; };
+ 96C8ED1B1779A9AF00A30AF4 /* libmupdf-js-jscore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 96C8ED141779A9AE00A30AF4 /* libmupdf-js-jscore.a */; };
96C8ED1C1779A9AF00A30AF4 /* libmupdf.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 96C8ED151779A9AE00A30AF4 /* libmupdf.a */; };
96C8ED1D1779A9AF00A30AF4 /* libopenjpeg.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 96C8ED161779A9AE00A30AF4 /* libopenjpeg.a */; };
96C8ED1E1779A9AF00A30AF4 /* libz.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 96C8ED171779A9AE00A30AF4 /* libz.a */; };
@@ -35,6 +35,7 @@
DA1C68B317E86A500061F586 /* MuDocumentController.m in Sources */ = {isa = PBXBuildFile; fileRef = DA1C68A717E864180061F586 /* MuDocumentController.m */; };
DA1C68B517E86A500061F586 /* MuAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = DA1C68A917E864CB0061F586 /* MuAppDelegate.m */; };
DA1C68C417E8969C0061F586 /* common.m in Sources */ = {isa = PBXBuildFile; fileRef = DA1C68C317E8969C0061F586 /* common.m */; };
+ DA300CA41847A64C004F92BB /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA300CA31847A64C004F92BB /* JavaScriptCore.framework */; };
DA442E2D183B796F008EF49B /* ic_pen.png in Resources */ = {isa = PBXBuildFile; fileRef = DA442E2C183B796F008EF49B /* ic_pen.png */; };
DA442E30183B9F13008EF49B /* MuInkView.m in Sources */ = {isa = PBXBuildFile; fileRef = DA442E2F183B9F13008EF49B /* MuInkView.m */; };
DAA6E56F17F03F96002B1E4E /* MuPageViewReflow.m in Sources */ = {isa = PBXBuildFile; fileRef = DAA6E56E17F03AAE002B1E4E /* MuPageViewReflow.m */; };
@@ -86,7 +87,7 @@
96C8ED111779A9AE00A30AF4 /* libfreetype.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libfreetype.a; sourceTree = BUILT_PRODUCTS_DIR; };
96C8ED121779A9AE00A30AF4 /* libjbig2dec.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libjbig2dec.a; sourceTree = BUILT_PRODUCTS_DIR; };
96C8ED131779A9AE00A30AF4 /* libjpeg.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libjpeg.a; sourceTree = BUILT_PRODUCTS_DIR; };
- 96C8ED141779A9AE00A30AF4 /* libmupdf-js-none.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libmupdf-js-none.a"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 96C8ED141779A9AE00A30AF4 /* libmupdf-js-jscore.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libmupdf-js-jscore.a"; sourceTree = BUILT_PRODUCTS_DIR; };
96C8ED151779A9AE00A30AF4 /* libmupdf.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libmupdf.a; sourceTree = BUILT_PRODUCTS_DIR; };
96C8ED161779A9AE00A30AF4 /* libopenjpeg.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libopenjpeg.a; sourceTree = BUILT_PRODUCTS_DIR; };
96C8ED171779A9AE00A30AF4 /* libz.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libz.a; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -111,6 +112,7 @@
DA1C68A917E864CB0061F586 /* MuAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MuAppDelegate.m; path = Classes/MuAppDelegate.m; sourceTree = "<group>"; };
DA1C68C217E8968C0061F586 /* common.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = common.h; sourceTree = "<group>"; };
DA1C68C317E8969C0061F586 /* common.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = common.m; sourceTree = "<group>"; };
+ DA300CA31847A64C004F92BB /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; };
DA442E2C183B796F008EF49B /* ic_pen.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ic_pen.png; path = "../android/res/drawable-ldpi/ic_pen.png"; sourceTree = "<group>"; };
DA442E2E183B9F13008EF49B /* MuInkView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MuInkView.h; path = Classes/MuInkView.h; sourceTree = "<group>"; };
DA442E2F183B9F13008EF49B /* MuInkView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MuInkView.m; path = Classes/MuInkView.m; sourceTree = "<group>"; };
@@ -157,10 +159,11 @@
buildActionMask = 2147483647;
files = (
968E1E411779A54F0050CEA3 /* UIKit.framework in Frameworks */,
+ DA300CA41847A64C004F92BB /* JavaScriptCore.framework in Frameworks */,
968E1E431779A54F0050CEA3 /* Foundation.framework in Frameworks */,
968E1E451779A54F0050CEA3 /* CoreGraphics.framework in Frameworks */,
96C8ED1C1779A9AF00A30AF4 /* libmupdf.a in Frameworks */,
- 96C8ED1B1779A9AF00A30AF4 /* libmupdf-js-none.a in Frameworks */,
+ 96C8ED1B1779A9AF00A30AF4 /* libmupdf-js-jscore.a in Frameworks */,
96C8ED181779A9AE00A30AF4 /* libfreetype.a in Frameworks */,
96C8ED191779A9AE00A30AF4 /* libjbig2dec.a in Frameworks */,
96C8ED1A1779A9AF00A30AF4 /* libjpeg.a in Frameworks */,
@@ -190,7 +193,7 @@
children = (
968E1E3D1779A54F0050CEA3 /* MuPDF.app */,
96C8ED151779A9AE00A30AF4 /* libmupdf.a */,
- 96C8ED141779A9AE00A30AF4 /* libmupdf-js-none.a */,
+ 96C8ED141779A9AE00A30AF4 /* libmupdf-js-jscore.a */,
96C8ED111779A9AE00A30AF4 /* libfreetype.a */,
96C8ED121779A9AE00A30AF4 /* libjbig2dec.a */,
96C8ED131779A9AE00A30AF4 /* libjpeg.a */,
@@ -203,6 +206,7 @@
968E1E3F1779A54F0050CEA3 /* Frameworks */ = {
isa = PBXGroup;
children = (
+ DA300CA31847A64C004F92BB /* JavaScriptCore.framework */,
968E1E401779A54F0050CEA3 /* UIKit.framework */,
968E1E421779A54F0050CEA3 /* Foundation.framework */,
968E1E441779A54F0050CEA3 /* CoreGraphics.framework */,
@@ -403,7 +407,7 @@
);
outputPaths = (
"$(DERIVED_FILE_DIR)/libmupdf.a",
- "$(DERIVED_FILE_DIR)/libmupdf-js-none.a",
+ "$(DERIVED_FILE_DIR)/libmupdf-js-jscore.a",
"$(DERIVED_FILE_DIR)/libfreetype.a",
"$(DERIVED_FILE_DIR)/libjbig2dec.a",
"$(DERIVED_FILE_DIR)/libjpeg.a",
diff --git a/platform/ios/build_libs.sh b/platform/ios/build_libs.sh
index d78a36cf..5b0c4d0e 100644
--- a/platform/ios/build_libs.sh
+++ b/platform/ios/build_libs.sh
@@ -23,7 +23,7 @@ done
OUT=build/$build-$OS-$(echo $ARCHS | tr ' ' '-')
echo Compiling libraries for $ARCHS.
-make -j4 -C ../.. OUT=$OUT XCFLAGS="$FLAGS" XLDFLAGS="$FLAGS" third libs || exit 1
+make -j4 -C ../.. OUT=$OUT XCFLAGS="$FLAGS" XLDFLAGS="$FLAGS" JSCORE_PRESENT="yes" third libs || exit 1
echo Copying library to $TARGET_BUILD_DIR/.
mkdir -p "$TARGET_BUILD_DIR"