diff --git a/binary/chrome.manifest b/binary/chrome.manifest index 88d0daaf..a0ef59eb 100644 --- a/binary/chrome.manifest +++ b/binary/chrome.manifest @@ -11,4 +11,9 @@ binary-component components/7.0-Darwin_x86_64-gcc3/dactyl.so abi=Darwin_x86_64-g binary-component components/8.0-Darwin_x86_64-gcc3/dactyl.so abi=Darwin_x86_64-gcc3 platformversion>=8.0 platformversion<8.* binary-component components/9.0-Darwin_x86_64-gcc3/dactyl.so abi=Darwin_x86_64-gcc3 platformversion>=9.0 platformversion<9.* +binary-component components/6.0-WINNT_x86-msvc/dactyl.dll abi=WINNT_x86-msvc appversion>=6.0 appversion<6.* +binary-component components/7.0-WINNT_x86-msvc/dactyl.dll abi=WINNT_x86-msvc appversion>=7.0 appversion<7.* +binary-component components/8.0-WINNT_x86-msvc/dactyl.dll abi=WINNT_x86-msvc platformversion>=8.0 platformversion<8.* +binary-component components/9.0-WINNT_x86-msvc/dactyl.dll abi=WINNT_x86-msvc platformversion>=9.0 platformversion<9.* + # vim:se tw=0 ft=cfg: diff --git a/binary/config.mk b/binary/config.mk index 96e0f425..de675d25 100644 --- a/binary/config.mk +++ b/binary/config.mk @@ -12,15 +12,17 @@ SED := $(shell if [ "xoo" = x$$(echo foo | sed -E 's/f(o)/\1/' 2>/dev/null) ]; \ fi) -GECKO_SDK_PATH := $(shell pkg-config --libs libxul | $(SED) 's,([^-]|-[^L])*-L([^ ]+)/lib.*,\2,') +PKGCONFIG ?= pkg-config +GECKO_SDK_PATH := $(shell $(PKGCONFIG) --libs libxul | $(SED) 's,([^-]|-[^L])*-L([^ ]+)/lib.*,\2,') -CXX ?= c++ +CXX ?= c++ -o +LINK ?= c++ MKDEP ?= $(CXX) -M PYTHON ?= python2 -CPPFLAGS += -fno-rtti \ +EXCPPFLAGS = -fno-rtti \ -fno-exceptions \ -fshort-wchar \ -fPIC \ diff --git a/binary/install.rdf b/binary/install.rdf index 4fc8e5ad..77b40589 100644 --- a/binary/install.rdf +++ b/binary/install.rdf @@ -6,7 +6,8 @@ em:type="2" em:name="Dactyl Binary Utils" em:version="0.1" - em:description="Binary utilities for dactyl add-ons"> + em:description="Binary utilities for dactyl add-ons" + em:unpack="true"> .depend $(MODULE).so: $(OBJS) - $(CXX) -o $@ $(OBJS) $(LDFLAGS) $(GECKO_LDFLAGS) + $(LINK) -o $@ $(OBJS) $(LDFLAGS) $(GECKO_LDFLAGS) chmod +x $@ $(MODULE).dll: $(OBJS) - $(CXX) -o $@ $(OBJS) $(GECKO_LDFLAGS) + $(LINK)$@ $(GECKO_LDFLAGS) $(OBJS) $(XPTDIR) $(SODIR) $(OBJDIR): mkdir -p $@ diff --git a/binary/src/config.h b/binary/src/config.h new file mode 100644 index 00000000..2d46cdbc --- /dev/null +++ b/binary/src/config.h @@ -0,0 +1,2 @@ +#pragma once +#include "mozilla-config.h" diff --git a/binary/src/dactylUtils.cpp b/binary/src/dactylUtils.cpp index 03c8f67a..958b267d 100644 --- a/binary/src/dactylUtils.cpp +++ b/binary/src/dactylUtils.cpp @@ -168,6 +168,7 @@ dactylUtils::CreateGlobal(JSContext *cx, jsval *out) NS_ERROR_FAILURE); *out = OBJECT_TO_JSVAL(global); + return NS_OK; } NS_IMETHODIMP @@ -281,7 +282,9 @@ dactylUtils::GetGlobalForObject(const jsval &aObject, NS_ERROR_XPC_BAD_CONVERT_JS); JSObject *obj = JSVAL_TO_OBJECT(aObject); +#ifndef WIN32 /* Why? No idea. */ if (obj->isProxy()) +#endif obj = obj->unwrap(); JSObject *global = JS_GetGlobalForObject(cx, obj); diff --git a/binary/src/dactylUtils.h b/binary/src/dactylUtils.h index fd918497..d0146c57 100644 --- a/binary/src/dactylUtils.h +++ b/binary/src/dactylUtils.h @@ -1,6 +1,7 @@ #pragma once +#include "config.h" #include "dactylIUtils.h" #include "nsISupports.h" diff --git a/binary/src/mozJSLoaderUtils.h b/binary/src/mozJSLoaderUtils.h index 65ce94ae..372fdb23 100644 --- a/binary/src/mozJSLoaderUtils.h +++ b/binary/src/mozJSLoaderUtils.h @@ -40,9 +40,7 @@ #ifndef mozJSLoaderUtils_h #define mozJSLoaderUtils_h - -#if defined(GECKO_MAJOR) && GECKO_MAJOR < 9 -#endif +#include "config.h" /* * This is evil. Very evil. @@ -59,12 +57,14 @@ # define JS_XDRScript JS_XDRScriptObject typedef JSObject JSScriptType; +# if GECKO_MAJOR < 8 # 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)) +# if GECKO_MAJOR > 6 +# define NewObjectOutputWrappedStorageStream NS_NewObjectOutputWrappedStorageStream +# else +# define NewObjectOutputWrappedStorageStream(a, b, c) NS_NewObjectOutputWrappedStorageStream((a), (b)) +# endif # endif #else typedef JSScript JSScriptType;