mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-25 22:22:27 +01:00
Make binaries compilable on non-hemorrhage-edge releases. Add binaries subrepo.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user