diff options
| author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2014-03-20 22:22:17 +0100 |
|---|---|---|
| committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2014-03-20 22:26:24 +0100 |
| commit | 258e4ad850097f334beb033031b62a1039e3575b (patch) | |
| tree | 85e31c8df9f45d174cda8cc133aa698303b2aad8 /tools | |
| parent | c18908d6bd493ea11c37df20dba3bc07d04539c2 (diff) | |
| download | rockbox-258e4ad850097f334beb033031b62a1039e3575b.zip rockbox-258e4ad850097f334beb033031b62a1039e3575b.tar.gz rockbox-258e4ad850097f334beb033031b62a1039e3575b.tar.bz2 rockbox-258e4ad850097f334beb033031b62a1039e3575b.tar.xz | |
OS X: detect clang and build for x86 target only.
Newer versions of Xcode / OS X don't support PPC code anymore and replace gcc
with clang. When clang is detected assume we want to build for the default
architecture only and change the minimum OS X version to 10.5.
Change-Id: I5843fa9bb3d957ec6f0a537e857608ad99c31517
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/rbspeex/Makefile | 12 | ||||
| -rw-r--r-- | tools/ucl/src/Makefile | 12 |
2 files changed, 18 insertions, 6 deletions
diff --git a/tools/rbspeex/Makefile b/tools/rbspeex/Makefile index 785a992..89e21f8 100644 --- a/tools/rbspeex/Makefile +++ b/tools/rbspeex/Makefile @@ -35,15 +35,21 @@ COMPILETARGET = mingw else # OS X specifics. Needs to consider cross compiling for Windows. ifeq ($(findstring APPLE,$(CPPDEFINES)),APPLE) -# when building libs for OS X build for both i386 and ppc at the same time. +# When building for 10.4+ we need to use gcc. Otherwise clang is used, so use +# that to determine if we need to set arch and isysroot. +ifeq ($(findstring __clang__,$(CPPDEFINES)),__clang__) +CFLAGS += -mmacosx-version-min=10.5 +else +# when building libs for OS X 10.4+ build for both i386 and ppc at the same time. # This creates fat objects, and ar can only create the archive but not operate # on it. As a result the ar call must NOT use the u (update) flag. -ARCHFLAGS = -arch ppc -arch i386 +ARCHFLAGS += -arch ppc -arch i386 # building against SDK 10.4 is not compatible with gcc-4.2 (default on newer Xcode) # might need adjustment for older Xcode. -CC ?= gcc-4.0 +CC = gcc-4.0 CFLAGS += -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 NATIVECC ?= gcc-4.0 +endif COMPILETARGET = darwin else COMPILETARGET = posix diff --git a/tools/ucl/src/Makefile b/tools/ucl/src/Makefile index ca29d7c..a741f1e 100644 --- a/tools/ucl/src/Makefile +++ b/tools/ucl/src/Makefile @@ -32,15 +32,21 @@ COMPILETARGET = mingw else # OS X specifics. Needs to consider cross compiling for Windows. ifeq ($(findstring APPLE,$(CPPDEFINES)),APPLE) -# when building libs for OS X build for both i386 and ppc at the same time. +# When building for 10.4+ we need to use gcc. Otherwise clang is used, so use +# that to determine if we need to set arch and isysroot. +ifeq ($(findstring __clang__,$(CPPDEFINES)),__clang__) +CFLAGS += -mmacosx-version-min=10.5 +else +# when building libs for OS X 10.4+ build for both i386 and ppc at the same time. # This creates fat objects, and ar can only create the archive but not operate # on it. As a result the ar call must NOT use the u (update) flag. -ARCHFLAGS = -arch ppc -arch i386 +ARCHFLAGS += -arch ppc -arch i386 # building against SDK 10.4 is not compatible with gcc-4.2 (default on newer Xcode) # might need adjustment for older Xcode. -CC ?= gcc-4.0 +CC = gcc-4.0 CFLAGS += -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 NATIVECC ?= gcc-4.0 +endif COMPILETARGET = darwin else COMPILETARGET = posix |