Skip to content

Commit

Permalink
Fix MacOS builds
Browse files Browse the repository at this point in the history
  • Loading branch information
vp-of-awesome committed Sep 11, 2012
1 parent db720d9 commit 6686820
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions jni/GNUmakefile
Expand Up @@ -173,12 +173,12 @@ ifeq ($(OS), darwin)
ifneq ($(realpath $(wildcard /Xcode3/usr/bin/gcc)),)
XCODE=/Xcode3
else
XCODE=/Developer
XCODE=$(shell xcode-select -print-path)
endif
ifneq ($(realpath $(wildcard $(XCODE)/usr/bin/gcc-4.0)),)
CC = $(XCODE)/usr/bin/gcc-4.0
else
CC = gcc
CC = $(XCODE)/usr/bin/gcc
endif
UNIVERSAL_SDK = $(firstword $(strip $(realpath $(XCODE)/SDKs/MacOSX10.4u.sdk) $(realpath $(XCODE)/SDKs/MacOSX10.5.sdk)))
ifneq ($(UNIVERSAL_SDK),)
Expand All @@ -187,16 +187,17 @@ ifeq ($(OS), darwin)
ARCHES += ppc
endif
else
MACSDK = $(firstword $(strip $(wildcard $(XCODE)/SDKs/MacOSX10.*.sdk)))
MACSDK = $(firstword $(strip $(wildcard $(XCODE)/SDKs/MacOSX10.*.sdk)) $(strip $(wildcard $(XCODE)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.*.sdk)))
endif

CFLAGS += -isysroot $(MACSDK) -DTARGET_RT_MAC_CFM=0
CFLAGS += -I$(MACSDK)/System/Library/Frameworks/JavaVM.framework/Headers
CFLAGS += $(foreach arch, $(ARCHES),-arch $(arch))
LDFLAGS = $(foreach arch, $(ARCHES),-arch $(arch)) -dynamiclib -framework JavaVM \
-Wl,-syslibroot,$(MACSDK) -mmacosx-version-min=10.4
-Wl,-syslibroot,$(MACSDK) -mmacosx-version-min=10.6
JNIEXT = jnilib
#CFLAGS += -I$(MACSDK)/System/Library/Frameworks/Kernel.framework/Versions/A/Headers
CFLAGS += -fexceptions
FFI_CFLAGS += -isysroot $(MACSDK) -I$(MACSDK)/usr/include
PICFLAGS =
SOFLAGS =
Expand Down
6 changes: 3 additions & 3 deletions libtest/GNUmakefile
Expand Up @@ -90,12 +90,12 @@ ifeq ($(OS), darwin)
ifneq ($(realpath $(wildcard /Xcode3/usr/bin/gcc)),)
XCODE=/Xcode3
else
XCODE=/Developer
XCODE=$(shell xcode-select -print-path)
endif
ifneq ($(realpath $(wildcard $(XCODE)/usr/bin/gcc-4.0)),)
CC = $(XCODE)/usr/bin/gcc-4.0
else
CC = gcc
CC = $(XCODE)/usr/bin/gcc
endif

ifneq ($(realpath $(wildcard $(XCODE)/SDKs/MacOSX10.4?.sdk)),)
Expand All @@ -104,7 +104,7 @@ ifeq ($(OS), darwin)
ARCHES += ppc
endif
else
MACSDK = $(firstword $(strip $(wildcard $(XCODE)/SDKs/MacOSX10.*.sdk)))
MACSDK = $(firstword $(strip $(wildcard $(XCODE)/SDKs/MacOSX10.*.sdk)) $(strip $(wildcard $(XCODE)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.*.sdk)))
endif
ARCHFLAGS = $(foreach arch, $(ARCHES),-arch $(arch))
CFLAGS += $(ARCHFLAGS) -isysroot $(MACSDK) -DTARGET_RT_MAC_CFM=0
Expand Down

0 comments on commit 6686820

Please sign in to comment.