summaryrefslogtreecommitdiff
path: root/binary
diff options
context:
space:
mode:
authorKris Maglione <maglione.k@gmail.com>2011-09-23 16:40:56 -0400
committerKris Maglione <maglione.k@gmail.com>2011-09-23 16:40:56 -0400
commit39ceae4f92487dc0052ace15fc1132e7465ce045 (patch)
treea322f304e215ab5ab2e0ee3486fe3bace0fbd1f5 /binary
parente1db34990b848ce5f5aa900f3d8d895ef0e262eb (diff)
downloadpentadactyl-39ceae4f92487dc0052ace15fc1132e7465ce045.tar.gz
Make binaries compilable on non-hemorrhage-edge releases. Add binaries subrepo.
Diffstat (limited to 'binary')
-rw-r--r--binary/chrome.manifest3
-rw-r--r--binary/config.mk9
-rw-r--r--binary/src/Makefile18
-rw-r--r--binary/src/mozJSLoaderUtils.cpp10
-rw-r--r--binary/src/mozJSLoaderUtils.h24
-rw-r--r--binary/src/subscriptLoader.cpp9
6 files changed, 55 insertions, 18 deletions
diff --git a/binary/chrome.manifest b/binary/chrome.manifest
index 2af7f6ad..dc53910f 100644
--- a/binary/chrome.manifest
+++ b/binary/chrome.manifest
@@ -1,5 +1,8 @@
interfaces components/dactylIUtils.xpt
+binary-component components/6.0-Linux_x86_64-gcc3/dactyl.so abi=Linux_x86_64-gcc3 appversion>=6.0 appversion<6.*
+binary-component components/7.0-Linux_x86_64-gcc3/dactyl.so abi=Linux_x86_64-gcc3 appversion>=7.0 appversion<7.*
+binary-component components/8.0-Linux_x86_64-gcc3/dactyl.so abi=Linux_x86_64-gcc3 platformversion>=8.0 platformversion<8.*
binary-component components/9.0-Linux_x86_64-gcc3/dactyl.so abi=Linux_x86_64-gcc3 platformversion>=9.0 platformversion<9.*
# vim:se tw=0 ft=cfg:
diff --git a/binary/config.mk b/binary/config.mk
index 5311c24a..aa423108 100644
--- a/binary/config.mk
+++ b/binary/config.mk
@@ -1,6 +1,11 @@
-PLATFORM = 9.0-Linux_x86_64-gcc3
-DEFINES = -DGECKO_MAJOR=9 -DGECKO_MINOR=0
+GECKO_MAJOR ?= 9
+GECKO_MINOR ?= 0
+ABI_OS ?= Linux
+ABI_ARCH ?= x86_64
+ABI_COMPILER ?= gcc3
+ABI ?= $(GECKO_MAJOR).$(GECKO_MINOR)-$(ABI_OS)_$(ABI_ARCH)-$(ABI_COMPILER)
+DEFINES = -DGECKO_MAJOR=$(GECKO_MAJOR) -DGECKO_MINOR=$(GECKO_MINOR)
SED ?= sed -r
diff --git a/binary/src/Makefile b/binary/src/Makefile
index 774135c2..e40136a7 100644
--- a/binary/src/Makefile
+++ b/binary/src/Makefile
@@ -1,8 +1,8 @@
ROOT = ..
XPTDIR = $(ROOT)/components/
-SODIR = $(ROOT)/components/$(PLATFORM)/
-OBJDIR = $(PLATFORM)/
+SODIR = $(ROOT)/components/$(ABI)/
+OBJDIR = $(ABI)/
MODULE = $(SODIR)dactyl
@@ -21,7 +21,7 @@ GECKO_CONFIG_INCLUDE = -include mozilla-config.h
GECKO_DEFINES = -DMOZILLA_STRICT_API
-GECKO_INCLUDES = -I$(PLATFORM)/ \
+GECKO_INCLUDES = -I$(ABI)/ \
-I$(GECKO_SDK_PATH) \
-I$(GECKO_SDK_PATH)/idl \
-I$(GECKO_SDK_PATH)/include
@@ -40,13 +40,13 @@ sinclude $(ROOT)/config.local.mk
XPTS = $(XPIDLSRCS:%.idl=$(XPTDIR)%.xpt)
OBJS = $(CPPSRCS:%.cpp=$(OBJDIR)%.o)
-HEADERS = $(XPIDLSRCS:%.idl=$(PLATFORM)/%.h)
+HEADERS = $(XPIDLSRCS:%.idl=$(ABI)/%.h)
all: build
$(OBJS): $(HEADERS)
-$(PLATFORM)/%.h: %.idl
+$(ABI)/%.h: %.idl
$(IDL_H) $@ $(GECKO_INCLUDES) $<
$(XPTDIR)%.xpt: %.idl
@@ -71,9 +71,15 @@ dirs: $(XPTDIR) $(SODIR) $(OBJDIR)
$(XPTDIR) $(SODIR) $(OBJDIR):
mkdir -p $@
-build: dirs $(XPTS) $(MODULE).so
+module: dirs $(MODULE).so
+
+xpts: $(XPTS)
+
+build: dirs module xpts
clean:
rm $(MODULE).so
+.PHONY: module xpts build clean all depend
+
sinclude .depend
diff --git a/binary/src/mozJSLoaderUtils.cpp b/binary/src/mozJSLoaderUtils.cpp
index 8a4c517c..94b371be 100644
--- a/binary/src/mozJSLoaderUtils.cpp
+++ b/binary/src/mozJSLoaderUtils.cpp
@@ -35,8 +35,6 @@
*
* ***** END LICENSE BLOCK ***** */
-#define JS_XDRScript JS_XDRScriptObject
-
#include "mozJSLoaderUtils.h"
#include "nsAutoPtr.h"
@@ -55,7 +53,7 @@ using namespace mozilla::scache;
static nsresult
ReadScriptFromStream(JSContext *cx, nsIObjectInputStream *stream,
- JSScript **script)
+ JSScriptType **script)
{
*script = nsnull;
@@ -110,7 +108,7 @@ ReadScriptFromStream(JSContext *cx, nsIObjectInputStream *stream,
}
static nsresult
-WriteScriptToStream(JSContext *cx, JSScript *script,
+WriteScriptToStream(JSContext *cx, JSScriptType *script,
nsIObjectOutputStream *stream)
{
JSXDRState *xdr = JS_XDRNewMem(cx, JSXDR_ENCODE);
@@ -152,7 +150,7 @@ WriteScriptToStream(JSContext *cx, JSScript *script,
}
nsresult
-ReadCachedScript(nsIStartupCache* cache, nsACString &uri, JSContext *cx, JSScript **script)
+ReadCachedScript(nsIStartupCache* cache, nsACString &uri, JSContext *cx, JSScriptType **script)
{
nsresult rv;
@@ -173,7 +171,7 @@ ReadCachedScript(nsIStartupCache* cache, nsACString &uri, JSContext *cx, JSScrip
}
nsresult
-WriteCachedScript(nsIStartupCache* cache, nsACString &uri, JSContext *cx, JSScript *script)
+WriteCachedScript(nsIStartupCache* cache, nsACString &uri, JSContext *cx, JSScriptType *script)
{
nsresult rv;
diff --git a/binary/src/mozJSLoaderUtils.h b/binary/src/mozJSLoaderUtils.h
index b56e7296..65ce94ae 100644
--- a/binary/src/mozJSLoaderUtils.h
+++ b/binary/src/mozJSLoaderUtils.h
@@ -40,6 +40,10 @@
#ifndef mozJSLoaderUtils_h
#define mozJSLoaderUtils_h
+
+#if defined(GECKO_MAJOR) && GECKO_MAJOR < 9
+#endif
+
/*
* This is evil. Very evil.
#define nsString_h___
@@ -50,6 +54,22 @@
#include "nsStringAPI.h"
#include "jsapi.h"
+#if defined(GECKO_MAJOR) && GECKO_MAJOR < 9
+#include "jsapi.h"
+# define JS_XDRScript JS_XDRScriptObject
+ typedef JSObject JSScriptType;
+
+# define NewObjectInputStreamFromBuffer NS_NewObjectInputStreamFromBuffer
+# define NewBufferFromStorageStream NS_NewBufferFromStorageStream
+# if GECKO_MAJOR > 6
+# define NewObjectOutputWrappedStorageStream NS_NewObjectOutputWrappedStorageStream
+# else
+# define NewObjectOutputWrappedStorageStream(a, b, c) NS_NewObjectOutputWrappedStorageStream((a), (b))
+# endif
+#else
+ typedef JSScript JSScriptType;
+#endif
+
class nsIURI;
namespace mozilla {
@@ -60,9 +80,9 @@ class StartupCache;
nsresult
ReadCachedScript(nsIStartupCache* cache, nsACString &uri,
- JSContext *cx, JSScript **scriptObj);
+ JSContext *cx, JSScriptType **scriptObj);
nsresult
WriteCachedScript(nsIStartupCache* cache, nsACString &uri,
- JSContext *cx, JSScript *scriptObj);
+ JSContext *cx, JSScriptType *scriptObj);
#endif /* mozJSLoaderUtils_h */
diff --git a/binary/src/subscriptLoader.cpp b/binary/src/subscriptLoader.cpp
index ac62177a..5b3aa483 100644
--- a/binary/src/subscriptLoader.cpp
+++ b/binary/src/subscriptLoader.cpp
@@ -271,7 +271,7 @@ static nsresult
ReadScript(nsIURI *uri, JSContext *cx, JSObject *target_obj,
jschar *charset, const char *uriStr,
nsIIOService *serv, nsIPrincipal *principal,
- JSScript **scriptObjp)
+ JSScriptType **scriptObjp)
{
nsCOMPtr<nsIChannel> chan;
nsCOMPtr<nsIInputStream> instream;
@@ -518,12 +518,17 @@ dactylUtils::LoadSubScript (const PRUnichar * aURL
}
bool writeScript = false;
- JSScript *scriptObj = nsnull;
+ JSScriptType *scriptObj = nsnull;
JSVersion version = cx->findVersion();
nsCAutoString cachePath;
cachePath.Append("jssubloader/");
cachePath.Append(version);
+ if (charset) {
+ cachePath.Append("/");
+ cachePath.Append(NS_ConvertUTF16toUTF8(
+ nsDependentString(reinterpret_cast<PRUnichar*>(charset))));
+ }
if (false)
// This is evil. Very evil. Unfortunately, the PathifyURI symbol is