diff --git a/binary/chrome.manifest b/binary/chrome.manifest index dc53910f..88d0daaf 100644 --- a/binary/chrome.manifest +++ b/binary/chrome.manifest @@ -1,8 +1,14 @@ 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.* +binary-component components/6.0-Darwin_x86_64-gcc3/dactyl.so abi=Darwin_x86_64-gcc3 appversion>=6.0 appversion<6.* +binary-component components/7.0-Darwin_x86_64-gcc3/dactyl.so abi=Darwin_x86_64-gcc3 appversion>=7.0 appversion<7.* +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.* + # vim:se tw=0 ft=cfg: diff --git a/binary/config.mk b/binary/config.mk index aa423108..96e0f425 100644 --- a/binary/config.mk +++ b/binary/config.mk @@ -1,13 +1,16 @@ GECKO_MAJOR ?= 9 GECKO_MINOR ?= 0 -ABI_OS ?= Linux -ABI_ARCH ?= x86_64 -ABI_COMPILER ?= gcc3 +ABI_OS := $(shell uname -s) +ABI_ARCH := $(shell uname -m) +ABI_COMPILER := gcc3 ABI ?= $(GECKO_MAJOR).$(GECKO_MINOR)-$(ABI_OS)_$(ABI_ARCH)-$(ABI_COMPILER) -DEFINES = -DGECKO_MAJOR=$(GECKO_MAJOR) -DGECKO_MINOR=$(GECKO_MINOR) +DEFINES = -DGECKO_MAJOR=$(GECKO_MAJOR) -DGECKO_MINOR=$(GECKO_MINOR) + +SED := $(shell if [ "xoo" = x$$(echo foo | sed -E 's/f(o)/\1/' 2>/dev/null) ]; \ + then echo sed -E; else echo sed -r; \ + fi) -SED ?= sed -r GECKO_SDK_PATH := $(shell pkg-config --libs libxul | $(SED) 's,([^-]|-[^L])*-L([^ ]+)/lib.*,\2,') diff --git a/binary/src/Makefile b/binary/src/Makefile index e40136a7..960fbaad 100644 --- a/binary/src/Makefile +++ b/binary/src/Makefile @@ -29,12 +29,15 @@ GECKO_INCLUDES = -I$(ABI)/ \ GECKO_LDFLAGS = -L$(GECKO_SDK_PATH)/bin \ -L$(GECKO_SDK_PATH)/lib \ -lxpcomglue_s \ + -lxpcom \ -lnspr4 \ - -lplds4 \ - -lxul \ -shared \ $(NULL) +ifeq "$(shell uname -s)" "Darwin" + GECKO_LDFLAGS += -undefined dynamic_lookup +endif + include $(ROOT)/config.mk sinclude $(ROOT)/config.local.mk @@ -42,8 +45,25 @@ XPTS = $(XPIDLSRCS:%.idl=$(XPTDIR)%.xpt) OBJS = $(CPPSRCS:%.cpp=$(OBJDIR)%.o) HEADERS = $(XPIDLSRCS:%.idl=$(ABI)/%.h) + all: build +dirs: $(XPTDIR) $(SODIR) $(OBJDIR) + +depend: .depend + +module: dirs $(MODULE).so + +dll: dirs $(MODULE).dll + +xpts: $(XPTS) + +build: dirs module xpts + +clean: + rm $(MODULE).so + + $(OBJS): $(HEADERS) $(ABI)/%.h: %.idl @@ -52,8 +72,6 @@ $(ABI)/%.h: %.idl $(XPTDIR)%.xpt: %.idl $(IDL_XPT) $@ $(GECKO_INCLUDES) $< -depend: .depend - _CPPFLAGS = $(CPPFLAGS) $(CXXFLAGS) $(GECKO_CONFIG_INCLUDE) $(GECKO_DEFINES) $(GECKO_INCLUDES) $(DEFINES) $(OBJDIR)%.o: %.cpp Makefile @@ -63,23 +81,14 @@ $(OBJDIR)%.o: %.cpp Makefile $(MKDEP) $(_CPPFLAGS) $(CPPSRCS) | $(SED) 's;^[^ ];$(OBJDIR)&;' >.depend $(MODULE).so: $(OBJS) - $(CXX) -o $@ -Wl,-soname=$(MODULE).so $(OBJS) $(GECKO_LDFLAGS) + $(CXX) -o $@ $(OBJS) $(LDFLAGS) $(GECKO_LDFLAGS) chmod +x $@ -dirs: $(XPTDIR) $(SODIR) $(OBJDIR) +$(MODULE).dll: $(OBJS) + $(CXX) -o $@ $(OBJS) $(GECKO_LDFLAGS) $(XPTDIR) $(SODIR) $(OBJDIR): mkdir -p $@ - -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/common/Makefile b/common/Makefile index 1c563678..1d28b14f 100644 --- a/common/Makefile +++ b/common/Makefile @@ -142,14 +142,20 @@ install: exit 1; \ fi; \ \ - ext="$$profile/extensions/$(UUID)"; \ - mkdir -p "$$(dirname "$$ext")"; \ - rm -rf "$$ext.xpi" "$$ext"; \ - echo "Installing to $$ext"; \ - if which cygpath >/dev/null 2>&1; \ - then cygpath -wa .; \ - else pwd; \ - fi >"$$ext" + install() { \ + ext="$$profile/extensions/$$2"; \ + mkdir -p "$$(dirname "$$ext")"; \ + rm -rf "$$ext.xpi" "$$ext"; \ + \ + echo "Installing $$2 to $$ext"; \ + if which cygpath >/dev/null 2>&1; \ + then cygpath -wa $$1; \ + else (cd $$1; pwd); \ + fi >"$$ext"; \ + }; \ + install . $(UUID); \ + install ../binary binary@dactyl.googlecode.com; \ + installxpi: xpi $(HOSTAPP) $(XPI)