summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBarry Wardell <rockbox@barrywardell.net>2009-10-30 13:31:04 +0000
committerBarry Wardell <rockbox@barrywardell.net>2009-10-30 13:31:04 +0000
commit304fcbe6330aa913d02155df0f1425cee8da6593 (patch)
tree2868564dc3c1373ee6f58320aa2aa278ee88148b
parenta521c5fc67a9ef6730496153a8c289c4fee78d01 (diff)
downloadrockbox-304fcbe6330aa913d02155df0f1425cee8da6593.tar.gz
rockbox-304fcbe6330aa913d02155df0f1425cee8da6593.zip
Get beastpatcher working on OSX.
I don't know why we need to split the compiling and linking steps on OSX, but this was the only way I could get static linking against libusb and libmtp to work. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23418 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--utils/MTP/beastpatcher/Makefile15
-rw-r--r--utils/MTP/beastpatcher/README26
2 files changed, 31 insertions, 10 deletions
diff --git a/utils/MTP/beastpatcher/Makefile b/utils/MTP/beastpatcher/Makefile
index bb908532c2..fad6a161e4 100644
--- a/utils/MTP/beastpatcher/Makefile
+++ b/utils/MTP/beastpatcher/Makefile
@@ -32,6 +32,7 @@ all: $(OUTPUT)
32 32
33SOURCES = beastpatcher.c bootimg.c mknkboot.c main.c 33SOURCES = beastpatcher.c bootimg.c mknkboot.c main.c
34HEADERS = beastpatcher.h mtp_common.h bootimg.h mknkboot.h 34HEADERS = beastpatcher.h mtp_common.h bootimg.h mknkboot.h
35OBJS = beastpatcher.o bootimg.o mknkboot.o main.o mtp_libmtp.o
35MTPSRCS_W32 = mtp_win32.c 36MTPSRCS_W32 = mtp_win32.c
36MTPSRCS_MTP = mtp_libmtp.c 37MTPSRCS_MTP = mtp_libmtp.c
37 38
@@ -46,12 +47,14 @@ beastpatcher.exe: $(SOURCES) $(HEADERS) $(MTPSRCS_W32) $(WINLIBS)
46beastpatcher-mac: beastpatcher-i386 beastpatcher-ppc 47beastpatcher-mac: beastpatcher-i386 beastpatcher-ppc
47 lipo -create beastpatcher-ppc beastpatcher-i386 -output beastpatcher-mac 48 lipo -create beastpatcher-ppc beastpatcher-i386 -output beastpatcher-mac
48 49
49beastpatcher-i386: beastpatcher.c bootimg.c usb.h main.c libusb-i386.a 50beastpatcher-i386: $(SOURCES) $(HEADERS) $(MTPSRCS_MTP) usb.h libmtp.h libusb-i386.a libmtp-i386.a
50 $(CC) -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -framework iokit -framework coreservices -arch i386 $(CFLAGS) -o beastpatcher-i386 beastpatcher.c bootimg.c -I. libusb-i386.a 51 gcc -c -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch i386 $(CFLAGS) -I. -DBEASTPATCHER $(SOURCES) $(MTPSRCS_MTP)
52 gcc -framework iokit -framework coreservices -arch i386 -o beastpatcher-i386 $(OBJS) libusb-i386.a libmtp-i386.a -liconv
51 strip beastpatcher-i386 53 strip beastpatcher-i386
52 54
53beastpatcher-ppc: beastpatcher.c bootimg.c usb.h main.c libusb-ppc.a 55beastpatcher-ppc: $(SOURCES) $(HEADERS) $(MTPSRCS_MTP) usb.h libmtp.h libusb-ppc.a libmtp-ppc.a
54 $(CC) -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -framework iokit -framework coreservices -arch ppc $(CFLAGS) -o beastpatcher-ppc beastpatcher.c bootimg.c -I. libusb-ppc.a 56 gcc -c -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch ppc $(CFLAGS) -I. -DBEASTPATCHER $(SOURCES) $(MTPSRCS_MTP)
57 gcc -framework iokit -framework coreservices -arch ppc -o beastpatcher-ppc $(OBJS) libusb-ppc.a libmtp-ppc.a -liconv
55 strip beastpatcher-ppc 58 strip beastpatcher-ppc
56 59
57bin2c: ../../../rbutil/tools/bin2c.c 60bin2c: ../../../rbutil/tools/bin2c.c
@@ -63,4 +66,4 @@ bootimg.c: bootloader.bin bin2c
63mknkboot: mknkboot.c 66mknkboot: mknkboot.c
64 $(SILENT)$(NATIVECC) $(CFLAGS) $+ -o $@ 67 $(SILENT)$(NATIVECC) $(CFLAGS) $+ -o $@
65clean: 68clean:
66 rm -f beastpatcher.exe beastpatcher-mac beastpatcher-i386 beastpatcher-ppc beastpatcher bin2c bootimg.c bootimg.h mknkboot *~ 69 rm -f beastpatcher.exe beastpatcher-mac beastpatcher-i386 beastpatcher-ppc beastpatcher bin2c bootimg.c bootimg.h mknkboot *~ *.o
diff --git a/utils/MTP/beastpatcher/README b/utils/MTP/beastpatcher/README
index a7ddc753d0..d52dfc355b 100644
--- a/utils/MTP/beastpatcher/README
+++ b/utils/MTP/beastpatcher/README
@@ -41,10 +41,28 @@ After this, just type "make" to get a
41OS X 41OS X
42---- 42----
43 43
44[Not yet implemented] 44The OS X build is a universal binary statically linked with libusb and libmtp.
45 45It has been tested with libusb version 0.1.12 and libmtp version 1.0.1.
46The OS X build is a universal binary statically linked with libusb and libmtp. 46
47 47The following files are expected the beaspatcher source directory:
48
49Intel:
50 libusb: usb.h libusb-i386.a
51 libmtp: libmtp.h libmtp-i386.a
52
53PowerPC:
54 libusb: usb.h libusb-ppc.a
55 libmtp: libmtp.h libmtp-ppc.a
56
57These are easily compiled from source using the standard
58'./configure && make'. Look in .libs for libusb.a and src/.libs for libmtp.a,
59and make sure to rename them to their -i386/-ppc filenames when copying into
60the beastpatcher directory.
61
62After this, just type "make beastpatcher-mac" to get a universal binary. If you
63only want a binary for a particular architecture, you can use
64"make beastpatcher-i386" or "make beastpatcher-ppc" instead. In this case, you
65only need the libusb and libmtp library for your desired architecture.
48 66
49 67
50Windows 68Windows