From 4c2a7d11a3bc74b04978bc50444c676832f49bb6 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Tue, 8 Dec 2009 20:21:51 +0000 Subject: [PATCH] Attempting to abstract 64-bit Mac. --- Darwin-i386.mk | 7 +++++++ Darwin.mk | 10 ---------- FreeBSD.mk | 2 +- Linux.mk | 2 +- PkgConfig.mk => WebKit.mk | 0 makefile | 6 ++++++ 6 files changed, 15 insertions(+), 12 deletions(-) create mode 100644 Darwin-i386.mk rename PkgConfig.mk => WebKit.mk (100%) diff --git a/Darwin-i386.mk b/Darwin-i386.mk new file mode 100644 index 0000000..aa233eb --- /dev/null +++ b/Darwin-i386.mk @@ -0,0 +1,7 @@ +flags += -DCY_ATTACH +code += Handler.o +inject += Mach/Inject.o +Mach/Inject.o: Trampoline.t.hpp Baton.hpp + +%.t.hpp: %.t.cpp + $(target)gcc -c -fno-exceptions -Iinclude -o $*.t.o $< && { file=($$($(target)otool -l $*.t.o | sed -e 'x; /^1/ { x; /^ *filesize / { s/^.* //; p; }; /^ *fileoff / { s/^.* //; p; }; x; }; x; /^ *cmd LC_SEGMENT$$/ { s/.*/1/; x; }; d;')); od -t x1 -j $${file[0]} -N $${file[1]} $*.t.o | sed -e 's/^[^ ]*//' | tr $$'\n' ' ' | sed -e 's/ */ /g;s/^ *//;s/ $$//;s/ /,/g;s/\([^,][^,]\)/0x\1/g' | sed -e 's/^/static const char $*_[] = {/;s/$$/};/' && echo && echo "/*" && $(target)otool -vVt $*.t.o && echo "*/"; } >$@ && rm -f $*.t.o diff --git a/Darwin.mk b/Darwin.mk index d55abb2..fa26d52 100644 --- a/Darwin.mk +++ b/Darwin.mk @@ -1,5 +1,3 @@ -# XXX: objective-c exists on non-Darwin - dll := dylib link += -lobjc -framework CoreFoundation console += -framework Foundation @@ -10,13 +8,5 @@ library += -framework JavaScriptCore library += -framework WebKit library += -liconv -flags += -DCY_ATTACH -code += Handler.o -inject += Mach/Inject.o -Mach/Inject.o: Trampoline.t.hpp Baton.hpp - -%.t.hpp: %.t.cpp - $(target)gcc -c -fno-exceptions -Iinclude -o $*.t.o $< && { file=($$($(target)otool -l $*.t.o | sed -e 'x; /^1/ { x; /^ *filesize / { s/^.* //; p; }; /^ *fileoff / { s/^.* //; p; }; x; }; x; /^ *cmd LC_SEGMENT$$/ { s/.*/1/; x; }; d;')); od -t x1 -j $${file[0]} -N $${file[1]} $*.t.o | sed -e 's/^[^ ]*//' | tr $$'\n' ' ' | sed -e 's/ */ /g;s/^ *//;s/ $$//;s/ /,/g;s/\([^,][^,]\)/0x\1/g' | sed -e 's/^/static const char $*_[] = {/;s/$$/};/' && echo && echo "/*" && $(target)otool -vVt $*.t.o && echo "*/"; } >$@ && rm -f $*.t.o - include Execute.mk include ObjectiveC.mk diff --git a/FreeBSD.mk b/FreeBSD.mk index 0584b3d..35ab90b 100644 --- a/FreeBSD.mk +++ b/FreeBSD.mk @@ -1,4 +1,4 @@ export PATH := /usr/local/bin:/usr/local/GNUstep/System/Tools:$(PATH) gcc := g++42 flags += -fPIC -include PkgConfig.mk +include WebKit.mk diff --git a/Linux.mk b/Linux.mk index 0f8c8ce..eaaa9b0 100644 --- a/Linux.mk +++ b/Linux.mk @@ -1,2 +1,2 @@ flags += -fPIC -include PkgConfig.mk +include WebKit.mk diff --git a/PkgConfig.mk b/WebKit.mk similarity index 100% rename from PkgConfig.mk rename to WebKit.mk diff --git a/makefile b/makefile index 792f14c..7711fbd 100644 --- a/makefile +++ b/makefile @@ -46,9 +46,15 @@ depends := restart ?= $(MAKE) uname_s ?= $(shell uname -s) uname_p ?= $(shell uname -p) +uname_m ?= $(shell uname -m) -include $(uname_s).mk -include $(uname_s)-$(uname_p).mk +-include $(uname_s)-$(uname_m).mk + +ifneq ($(shell pkg-config libffi --modversion 2>/dev/null),) +flags += $(shell pkg-config --cflags libffi) +endif ifdef CY_EXECUTE ifeq ($(filter ObjectiveC,$(filters)),) -- 2.47.2