]> arthur.barton.de Git - bup.git/commitdiff
Fix building on MacOS X on PowerPC.
authorAndrew Schleifer <me@andrewschleifer.name>
Wed, 10 Feb 2010 20:40:46 +0000 (15:40 -0500)
committerAvery Pennarun <apenwarr@gmail.com>
Wed, 10 Feb 2010 20:40:46 +0000 (15:40 -0500)
bup failed to build on one of my machines, an older iMac; make
died ~40 lines in with "gcc-4.0: Invalid arch name : Power".

On PPC machines, uname -m returns the helpfully descriptive
"Power Macintosh", which gcc doesn't recognize. Some googling
revealed e.g.
http://www.opensource.apple.com/source/ld64/ld64-95.2.12/unit-tests/include/common.makefile
where they use $(shell arch) to get the necessary info.

With that little change, bup built on ppc and i386 machines for
me, and passed all tests.

Makefile

index fc415de00b7b96d788991a8e041df16c6b7e4c64..8793cb7109fae52e6114ffb9b1145f8b25de7a4d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,4 @@
 OS:=$(shell uname | sed 's/[-_].*//')
-MACHINE:=$(shell uname -m)
 CFLAGS=-Wall -g -O2 -Werror $(PYINCLUDE) -g
 ifneq ($(OS),CYGWIN)
   CFLAGS += -fPIC
@@ -8,6 +7,7 @@ SHARED=-shared
 SOEXT:=.so
 
 ifeq (${OS},Darwin)
+  MACHINE:=$(shell arch)
   CFLAGS += -arch $(MACHINE)
   SHARED = -dynamiclib
 endif