Commit 400ff06d authored by Tristan Matthews's avatar Tristan Matthews Committed by Jean-Baptiste Kempf

contrib: aom: use CMake build system

The custom "configure" build system is slated to be dropped.
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 40c9a15f
......@@ -24,107 +24,31 @@ aom: aom-$(AOM_VERSION).tar.gz .sum-aom
DEPS_aom =
ifdef HAVE_CROSS_COMPILE
AOM_CROSS := $(HOST)-
else
AOM_CROSS :=
endif
AOM_LDFLAGS := $(LDFLAGS)
ifeq ($(ARCH),arm)
AOM_ARCH := armv7
else ifeq ($(ARCH),i386)
AOM_ARCH := x86
else ifeq ($(ARCH),mips)
AOM_ARCH := mips32
else ifeq ($(ARCH),ppc)
AOM_ARCH := ppc32
else ifeq ($(ARCH),ppc64)
AOM_ARCH := ppc64
else ifeq ($(ARCH),sparc)
AOM_ARCH := sparc
else ifeq ($(ARCH),x86_64)
AOM_ARCH := x86_64
endif
ifdef HAVE_ANDROID
AOM_OS := android
else ifdef HAVE_LINUX
AOM_OS := linux
else ifdef HAVE_MACOSX
ifeq ($(OSX_VERSION),10.5)
AOM_OS := darwin9
else
AOM_OS := darwin10
endif
else ifdef HAVE_IOS
AOM_OS := darwin11
else ifdef HAVE_SOLARIS
AOM_OS := solaris
else ifdef HAVE_WIN64 # must be before WIN32
AOM_OS := win64
else ifdef HAVE_WIN32
AOM_OS := win32
else ifdef HAVE_BSD
AOM_OS := linux
endif
AOM_TARGET := generic-gnu
ifdef AOM_ARCH
ifdef AOM_OS
AOM_TARGET := $(AOM_ARCH)-$(AOM_OS)-gcc
endif
endif
AOM_CONF := \
--enable-runtime-cpu-detect \
--disable-docs \
--disable-examples \
--disable-unit-tests \
--disable-install-bins \
--disable-install-docs \
--disable-dependency-tracking
-DCONFIG_RUNTIME_CPU_DETECT=1 \
-DENABLE_DOCS=OFF \
-DENABLE_EXAMPLES=OFF \
-DENABLE_TOOLS=OFF \
-DCONFIG_UNIT_TESTS=0 \
-DCONFIG_INSTALL_BINS=0 \
-DCONFIG_INSTALL_DOCS=0 \
-DCONFIG_DEPENDENCY_TRACKING=0
ifndef BUILD_ENCODERS
AOM_CONF += --disable-av1-encoder
AOM_CONF += -DCONFIG_AV1_ENCODER=0
endif
ifndef HAVE_WIN32
AOM_CONF += --enable-pic
endif
ifdef HAVE_MACOSX
AOM_CONF += --sdk-path=$(MACOSX_SDK)
endif
ifdef HAVE_IOS
AOM_CONF += --sdk-path=$(IOS_SDK)
ifdef HAVE_TVOS
AOM_LDFLAGS := -L$(IOS_SDK)/usr/lib -isysroot $(IOS_SDK) -mtvos-version-min=9.0
else
AOM_LDFLAGS := -L$(IOS_SDK)/usr/lib -isysroot $(IOS_SDK) -miphoneos-version-min=6.1
endif
ifeq ($(ARCH),aarch64)
AOM_LDFLAGS += -arch arm64
else
AOM_LDFLAGS += -arch $(ARCH)
endif
endif
ifdef HAVE_ANDROID
# vpx configure.sh overrides our sysroot and it looks for it itself, and
# uses that path to look for the compiler (which we already know)
AOM_CONF += --sdk-path=$(shell dirname $(shell which $(HOST)-gcc))
# put sysroot
AOM_CONF += --libc=$(ANDROID_NDK)/platforms/$(ANDROID_API)/arch-$(PLATFORM_SHORT_ARCH)
endif
ifndef WITH_OPTIMIZATION
AOM_CONF += --enable-debug --disable-optimizations
AOM_CONF += -DCONFIG_PIC=1
endif
.aom: aom
cd $< && LDFLAGS="$(AOM_LDFLAGS)" CROSS=$(AOM_CROSS) ./configure --target=$(AOM_TARGET) \
$(AOM_CONF) --prefix=$(PREFIX)
cd $< && $(MAKE)
cd $< && ../../../contrib/src/pkg-static.sh aom.pc
cd $< && $(MAKE) install
# libaom doesn't allow in-tree builds
.aom: aom toolchain.cmake
cd $< && mkdir -p aom_build
cd $</aom_build && LDFLAGS="$(AOM_LDFLAGS)" $(HOSTVARS) $(CMAKE) ../ $(AOM_CONF)
cd $</aom_build && $(MAKE)
cd $</aom_build && ../../../../contrib/src/pkg-static.sh aom.pc
cd $</aom_build && $(MAKE) install
touch $@
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment