-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
195 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
# | ||
# Windows (x86/amd64/aarch64) | ||
# Windows CE/Mobile (arm) | ||
# Darwin/OS X (i386/x86_64/ppc) | ||
# Darwin/OS X (i386/x86-64/ppc/aarch64) | ||
# Linux (i386/amd64/ppc/arm) | ||
# Solaris (i386/amd64/sparc/sparcv9) | ||
# AIX (ppc/ppc64) | ||
|
@@ -392,44 +392,56 @@ endif | |
|
||
|
||
ifeq ($(OS),darwin) | ||
XCODE_VERSION=$(shell xcodebuild -version | grep Xcode | sed 's/^Xcode \([1-9]\).*/\1/g') | ||
JAVA_INCLUDES+=-I/System/Library/Frameworks/JavaVM.framework/Headers | ||
DEFAULT_ARCH=$(shell arch) | ||
ARCH=$(shell arch) | ||
HOST_CONFIG=--host $(ARCH)-apple-darwin | ||
FFI_ENV += CC="$(CC)" CFLAGS="-arch $(ARCH) $(ISYSROOT) $(COPT) $(CDEBUG)" CPPFLAGS="$(CDEFINES)" LD="$(LD) -arch $(ARCH)" | ||
ALT_ARCHS= | ||
ifneq ($(ARCH),i386) | ||
ALT_ARCHS+=i386 | ||
|
||
DARWIN_ARCH=$(ARCH) | ||
ifeq ($(ARCH),aarch64) | ||
DARWIN_ARCH=arm64 | ||
else | ||
ifeq ($(ARCH),x86-64) | ||
DARWIN_ARCH=x86_64 | ||
else | ||
ifeq ($(ARCH),x86) | ||
DARWIN_ARCH=x86 | ||
else | ||
endif | ||
ifneq ($(ARCH),x86_64) | ||
ALT_ARCHS+=x86_64 | ||
endif | ||
endif | ||
|
||
XCODE_VERSION=$(shell xcodebuild -version | grep Xcode | sed 's/^Xcode \([1-9][0-9]*\).*/\1/g') | ||
MACOS_VERSION_MAJOR=$(shell sw_vers -productVersion | cut -d. -f 1) | ||
MACOS_VERSION_MINOR=$(shell sw_vers -productVersion | cut -d. -f 2) | ||
JAVA_INCLUDES+=-I/System/Library/Frameworks/JavaVM.framework/Headers | ||
DEFAULT_ARCH=$(shell arch) | ||
HOST_CONFIG=--host $(DARWIN_ARCH)-apple-darwin | ||
FFI_ENV += CC="$(CC)" CFLAGS="-arch $(DARWIN_ARCH) $(ISYSROOT) $(COPT) $(CDEBUG)" CPPFLAGS="$(CDEFINES)" LD="$(LD) -arch $(DARWIN_ARCH)" | ||
LIBSFX=.dylib | ||
JNISFX=-$(ARCH).jnilib | ||
# JAWT no longer supported on OSX | ||
CDEFINES+=-DTARGET_RT_MAC_CFM=0 -DFFI_MMAP_EXEC_WRIT -DNO_JAWT | ||
|
||
ifneq ($(ARCH),ppc) | ||
ifeq ($(XCODE_VERSION),3) | ||
# Xcode 3 options | ||
# not supported on XCode 4+ | ||
ALT_ARCHS+=ppc | ||
else | ||
ifneq ($(XCODE_VERSION),3) | ||
# Xcode 4+ options | ||
NO_COMPACT_UNWIND=-Wl,-no_compact_unwind | ||
endif | ||
endif | ||
LIBSFX=.dylib | ||
JNISFX=.jnilib | ||
ifneq ($(SDKROOT),) | ||
SYSLIBROOT=-Wl,-syslibroot,$(SDKROOT) | ||
ISYSROOT=-isysroot $(SDKROOT) | ||
ARCHFLAGS=-arch i386 -arch x86_64 | ||
ifeq ($(XCODE_VERSION),3) | ||
ARCHFLAGS+=-arch ppc | ||
endif | ||
ARCHFLAGS+=-arch $(DARWIN_ARCH) | ||
endif | ||
|
||
PCFLAGS+=$(ISYSROOT) -x objective-c | ||
# JAWT no longer supported on OSX | ||
CDEFINES+=-DTARGET_RT_MAC_CFM=0 -DFFI_MMAP_EXEC_WRIT -DNO_JAWT | ||
LDFLAGS=$(ARCHFLAGS) -dynamiclib -o $@ -framework JavaVM \ | ||
|
||
# MAJOR < 10 || (MAJOR = 10 && MINOR < 7) | ||
MACOS_LT_10_7 = $(shell [ ${MACOS_VERSION_MAJOR} -lt 10 -o ${MACOS_VERSION_MAJOR} -eq 10 -a ${MACOS_VERSION_MINOR} -lt 7 ] && echo true) | ||
|
||
# JavaVM.framwork is "Deprecated in OS X v10.7." | ||
ifeq ($(MACOS_LT_10_7),true) | ||
FRAMEWORK=-framework JavaVM | ||
endif | ||
|
||
LDFLAGS=$(ARCHFLAGS) -dynamiclib -o $@ $(FRAMEWORK) \ | ||
-compatibility_version $(shell echo ${JNA_JNI_VERSION}|sed 's/^\([0-9][0-9]*\).*/\1/g') \ | ||
-current_version $(JNA_JNI_VERSION) \ | ||
-mmacosx-version-min=10.3 \ | ||
|
@@ -447,11 +459,7 @@ endif | |
$(BUILD)/%.o : %.c dispatch.h protect.h $(FFI_LIB) | ||
@mkdir -p $(BUILD) | ||
ifneq ($(SDKROOT),) | ||
$(CC) $(LOC_CC_OPTS) -arch $(ARCH) $(CFLAGS) -c $< -o $@.$(ARCH) | ||
for arch in $(ALT_ARCHS); do \ | ||
$(CC) $(LOC_CC_OPTS) -arch $$arch -I$(BUILD)/libffi.$$arch/include $(CFLAGS) -c $< -o $@.$$arch; \ | ||
done | ||
lipo -create -output $@ $@.* | ||
$(CC) $(LOC_CC_OPTS) -arch $(DARWIN_ARCH) $(CFLAGS) -c $< -o $@ | ||
else | ||
$(CC) $(CFLAGS) $(LOC_CC_OPTS) -c $< $(COUT) | ||
endif | ||
|
@@ -507,25 +515,6 @@ $(FFI_LIB): | |
&& $(FFI_ENV) $(FFI_SRC)/configure $(FFI_CONFIG) $(HOST_CONFIG)); \ | ||
fi | ||
$(MAKE) -C $(FFI_BUILD) | ||
ifneq ($(SDKROOT),) | ||
@for arch in $(ALT_ARCHS); do \ | ||
mkdir -p $(BUILD)/libffi.$$arch; \ | ||
if [ ! -f $(BUILD)/libffi.$$arch/Makefile ]; then \ | ||
echo "Configuring libffi ($$arch)"; \ | ||
(cd $(BUILD)/libffi.$$arch \ | ||
&& CC="$(CC)" CFLAGS="-arch $$arch $(ISYSROOT) $(COPT) $(CDEBUG)" CPPFLAGS="$(CDEFINES)" \ | ||
LDFLAGS="-arch $$arch" \ | ||
$(FFI_SRC)/configure $(FFI_CONFIG) --host=$$arch-apple-darwin --disable-dependency-tracking); \ | ||
fi; \ | ||
$(MAKE) -C $(BUILD)/libffi.$$arch; \ | ||
done | ||
ifneq ($(ALT_ARCHS),) | ||
/usr/bin/libtool -static -o [email protected] $(FFI_BUILD)/.libs/${@F} $(BUILD)/libffi.*/.libs/${@F} | ||
else | ||
/usr/bin/libtool -static -o [email protected] $(FFI_BUILD)/.libs/${@F} | ||
endif | ||
mv [email protected] $@ | ||
endif | ||
endif | ||
|
||
clean: | ||
|
Oops, something went wrong.