ref: 07bc7e0766f50b34c4b2ba2a84cffda841e65651
parent: 3943119a68f716ddd69087e4301beb52a716c8ab
parent: 70360cb11e609cb4e4dadc6078813460d89086cb
author: Licai Guo <[email protected]>
date: Fri Feb 28 11:44:37 EST 2014
Merge pull request #364 from mstorsjo/build-ios-make Decouple architecture (x86) from platforms in the make build system
--- a/build/mktargets.py
+++ b/build/mktargets.py
@@ -113,11 +113,13 @@
if len(asm) > 0:
f.write("ifeq ($(USE_ASM), Yes)\n")
+ f.write("ifeq ($(ASM_ARCH), x86)\n")
f.write("%s_ASM_SRCS=\\\n"%(PREFIX))
for c in asm:
f.write("\t$(%s_SRCDIR)/%s\\\n"%(PREFIX, c))
f.write("\n")
f.write("%s_OBJS += $(%s_ASM_SRCS:.asm=.o)\n"%(PREFIX, PREFIX))
+ f.write("endif\n")
f.write("endif\n\n")
f.write("OBJS += $(%s_OBJS)\n"%PREFIX)
--- a/build/platform-android.mk
+++ b/build/platform-android.mk
@@ -1,4 +1,3 @@
-USE_ASM = No
ARCH = arm
SHAREDLIBSUFFIX = so
GCCVERSION = 4.8
@@ -9,11 +8,11 @@
GCCPATHPREFIX = arm-linux-androideabi
GCCPREFIX = arm-linux-androideabi
CFLAGS += -march=armv7-a -mfloat-abi=softfp
-ifeq (Yes, $(HAVE_NEON))
+ ifeq (Yes, $(HAVE_NEON))
CFLAGS += -mfpu=neon
-else
+ else
CFLAGS += -mfpu=vfpv3-d16
-endif
+ endif
LDFLAGS += -march=armv7-a -Wl,--fix-cortex-a8
APP_ABI = armeabi-v7a
else
@@ -20,12 +19,11 @@
GCCPATHPREFIX = x86
GCCPREFIX = i686-linux-android
APP_ABI = x86
- USE_ASM = Yes
-ifeq (Yes, $(USE_ASM))
- ASM = nasm
+ ifeq (Yes, $(USE_ASM))
+ ASM_ARCH = x86
CFLAGS += -DX86_ASM
ASMFLAGS += -DNOPREFIX -f elf32 -DX86_32
-endif
+ endif
endif
ifndef NDKROOT
--- /dev/null
+++ b/build/platform-arch.mk
@@ -1,0 +1,3 @@
+ifneq ($(filter %86 x86_64, $(ARCH)),)
+include build/platform-x86-common.mk
+endif
--- a/build/platform-darwin.mk
+++ b/build/platform-darwin.mk
@@ -1,9 +1,9 @@
-include build/platform-x86-common.mk
-ASM = nasm
+include build/platform-arch.mk
SHAREDLIBSUFFIX = dylib
SHARED = -dynamiclib
CFLAGS += -Werror -fPIC -DMACOS -DMT_ENABLED -MMD -MP
LDFLAGS += -lpthread
+ifeq ($(ASM_ARCH), x86)
ASMFLAGS += --prefix _ -DNOPREFIX
ifeq ($(ENABLE64BIT), Yes)
ASMFLAGS += -f macho64
@@ -10,5 +10,6 @@
else
ASMFLAGS += -f macho
LDFLAGS += -read_only_relocs suppress
+endif
endif
--- a/build/platform-freebsd.mk
+++ b/build/platform-freebsd.mk
@@ -1,5 +1,4 @@
-include build/platform-x86-common.mk
-ASM = nasm
+include build/platform-arch.mk
SHAREDLIBSUFFIX = so
CFLAGS += -fPIC -DMT_ENABLED
LDFLAGS += -lpthread
--- /dev/null
+++ b/build/platform-ios.mk
@@ -1,0 +1,15 @@
+include build/platform-darwin.mk
+CXX = clang++
+CC = clang
+SDK = 7.0
+ifneq ($(filter %86 x86_64, $(ARCH)),)
+SDKTYPE = iPhoneSimulator
+else
+SDKTYPE = iPhoneOS
+endif
+SDK_MIN = 5.1
+
+SDKROOT = /Applications/Xcode.app/Contents/Developer/Platforms/$(SDKTYPE).platform/Developer/SDKs/$(SDKTYPE)$(SDK).sdk
+CFLAGS += -arch $(ARCH) -isysroot $(SDKROOT) -miphoneos-version-min=$(SDK_MIN)
+LDFLAGS += -arch $(ARCH) -isysroot $(SDKROOT) -miphoneos-version-min=$(SDK_MIN)
+
--- a/build/platform-linux.mk
+++ b/build/platform-linux.mk
@@ -1,5 +1,4 @@
-include build/platform-x86-common.mk
-ASM = nasm
+include build/platform-arch.mk
SHAREDLIBSUFFIX = so
CFLAGS += -Werror -fPIC -DLINUX -DMT_ENABLED -MMD -MP
LDFLAGS += -lpthread
--- a/build/platform-mingw_nt.mk
+++ b/build/platform-mingw_nt.mk
@@ -1,5 +1,4 @@
include build/platform-x86-common.mk
-ASM = nasm
SHAREDLIBSUFFIX = dll
CFLAGS += -DMT_ENABLED -MMD -MP
LDFLAGS +=
--- a/build/platform-msvc.mk
+++ b/build/platform-msvc.mk
@@ -1,6 +1,5 @@
include build/platform-x86-common.mk
include build/platform-msvc-common.mk
-ASM = nasm
CFLAGS += -DMT_ENABLED
LDFLAGS += user32.lib
ifeq ($(ENABLE64BIT), Yes)
--- a/build/platform-x86-common.mk
+++ b/build/platform-x86-common.mk
@@ -16,5 +16,7 @@
endif
ifeq ($(USE_ASM),Yes)
CFLAGS += -DX86_ASM
+ASM_ARCH = x86
endif
+ASM = nasm
ASMFLAGS += $(ASMFLAGS_PLATFORM) -DNO_DYNAMIC_VP
--- a/codec/common/targets.mk
+++ b/codec/common/targets.mk
@@ -9,6 +9,7 @@
COMMON_OBJS += $(COMMON_CPP_SRCS:.cpp=.o)
ifeq ($(USE_ASM), Yes)
+ifeq ($(ASM_ARCH), x86)
COMMON_ASM_SRCS=\
$(COMMON_SRCDIR)/asm_inc.asm\
$(COMMON_SRCDIR)/cpuid.asm\
@@ -21,6 +22,7 @@
$(COMMON_SRCDIR)/vaa.asm\
COMMON_OBJS += $(COMMON_ASM_SRCS:.asm=.o)
+endif
endif
OBJS += $(COMMON_OBJS)
--- a/codec/decoder/targets.mk
+++ b/codec/decoder/targets.mk
@@ -26,6 +26,7 @@
DECODER_OBJS += $(DECODER_CPP_SRCS:.cpp=.o)
ifeq ($(USE_ASM), Yes)
+ifeq ($(ASM_ARCH), x86)
DECODER_ASM_SRCS=\
$(DECODER_SRCDIR)/core/asm/block_add.asm\
$(DECODER_SRCDIR)/core/asm/dct.asm\
@@ -32,6 +33,7 @@
$(DECODER_SRCDIR)/core/asm/intra_pred.asm\
DECODER_OBJS += $(DECODER_ASM_SRCS:.asm=.o)
+endif
endif
OBJS += $(DECODER_OBJS)
--- a/codec/encoder/targets.mk
+++ b/codec/encoder/targets.mk
@@ -36,6 +36,7 @@
ENCODER_OBJS += $(ENCODER_CPP_SRCS:.cpp=.o)
ifeq ($(USE_ASM), Yes)
+ifeq ($(ASM_ARCH), x86)
ENCODER_ASM_SRCS=\
$(ENCODER_SRCDIR)/core/asm/coeff.asm\
$(ENCODER_SRCDIR)/core/asm/dct.asm\
@@ -45,6 +46,7 @@
$(ENCODER_SRCDIR)/core/asm/score.asm\
ENCODER_OBJS += $(ENCODER_ASM_SRCS:.asm=.o)
+endif
endif
OBJS += $(ENCODER_OBJS)
--- a/codec/processing/targets.mk
+++ b/codec/processing/targets.mk
@@ -21,6 +21,7 @@
PROCESSING_OBJS += $(PROCESSING_CPP_SRCS:.cpp=.o)
ifeq ($(USE_ASM), Yes)
+ifeq ($(ASM_ARCH), x86)
PROCESSING_ASM_SRCS=\
$(PROCESSING_SRCDIR)/src/asm/denoisefilter.asm\
$(PROCESSING_SRCDIR)/src/asm/downsample_bilinear.asm\
@@ -27,6 +28,7 @@
$(PROCESSING_SRCDIR)/src/asm/vaa.asm\
PROCESSING_OBJS += $(PROCESSING_ASM_SRCS:.asm=.o)
+endif
endif
OBJS += $(PROCESSING_OBJS)