Merge "Add --enable-shared option to iosbuild.sh to build dynamic framework"
This commit is contained in:
Коммит
656f9c4126
|
@ -751,7 +751,13 @@ process_common_toolchain() {
|
||||||
enabled shared && soft_enable pic
|
enabled shared && soft_enable pic
|
||||||
|
|
||||||
# Minimum iOS version for all target platforms (darwin and iphonesimulator).
|
# Minimum iOS version for all target platforms (darwin and iphonesimulator).
|
||||||
IOS_VERSION_MIN="6.0"
|
if enabled shared; then
|
||||||
|
IOS_VERSION_OPTIONS="--enable-shared"
|
||||||
|
else
|
||||||
|
IOS_VERSION_OPTIONS=""
|
||||||
|
fi
|
||||||
|
IOS_VERSION_MIN=$("${source_path}/build/make/ios-version.sh" \
|
||||||
|
${IOS_VERSION_OPTIONS})
|
||||||
|
|
||||||
# Handle darwin variants. Newer SDKs allow targeting older
|
# Handle darwin variants. Newer SDKs allow targeting older
|
||||||
# platforms, so use the newest one available.
|
# platforms, so use the newest one available.
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
|
<string>en</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>VPX</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>org.webmproject.VPX</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>VPX</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>FMWK</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>${VERSION}</string>
|
||||||
|
<key>CFBundleSignature</key>
|
||||||
|
<string>????</string>
|
||||||
|
<key>CFBundleSupportedPlatforms</key>
|
||||||
|
<array>
|
||||||
|
<string>iPhoneOS</string>
|
||||||
|
</array>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>${VERSION}</string>
|
||||||
|
<key>MinimumOSVersion</key>
|
||||||
|
<string>${IOS_VERSION_MIN}</string>
|
||||||
|
<key>UIDeviceFamily</key>
|
||||||
|
<array>
|
||||||
|
<integer>1</integer>
|
||||||
|
<integer>2</integer>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
|
@ -0,0 +1,17 @@
|
||||||
|
#!/bin/sh
|
||||||
|
##
|
||||||
|
## Copyright (c) 2016 The WebM project authors. All Rights Reserved.
|
||||||
|
##
|
||||||
|
## Use of this source code is governed by a BSD-style license
|
||||||
|
## that can be found in the LICENSE file in the root of the source
|
||||||
|
## tree. An additional intellectual property rights grant can be found
|
||||||
|
## in the file PATENTS. All contributing project authors may
|
||||||
|
## be found in the AUTHORS file in the root of the source tree.
|
||||||
|
##
|
||||||
|
|
||||||
|
if [ "$1" = "--enable-shared" ]; then
|
||||||
|
# Shared library framework builds are only possible on iOS 8 and later.
|
||||||
|
echo "8.0"
|
||||||
|
else
|
||||||
|
echo "6.0"
|
||||||
|
fi
|
|
@ -196,7 +196,12 @@ build_framework() {
|
||||||
for target in ${targets}; do
|
for target in ${targets}; do
|
||||||
build_target "${target}"
|
build_target "${target}"
|
||||||
target_dist_dir="${BUILD_ROOT}/${target}/${DIST_DIR}"
|
target_dist_dir="${BUILD_ROOT}/${target}/${DIST_DIR}"
|
||||||
lib_list="${lib_list} ${target_dist_dir}/lib/libvpx.a"
|
if [ "${ENABLE_SHARED}" = "yes" ]; then
|
||||||
|
local suffix="dylib"
|
||||||
|
else
|
||||||
|
local suffix="a"
|
||||||
|
fi
|
||||||
|
lib_list="${lib_list} ${target_dist_dir}/lib/libvpx.${suffix}"
|
||||||
done
|
done
|
||||||
|
|
||||||
cd "${ORIG_PWD}"
|
cd "${ORIG_PWD}"
|
||||||
|
@ -215,6 +220,17 @@ build_framework() {
|
||||||
# Copy in vpx_version.h.
|
# Copy in vpx_version.h.
|
||||||
cp -p "${BUILD_ROOT}/${target}/vpx_version.h" "${HEADER_DIR}"
|
cp -p "${BUILD_ROOT}/${target}/vpx_version.h" "${HEADER_DIR}"
|
||||||
|
|
||||||
|
if [ "${ENABLE_SHARED}" = "yes" ]; then
|
||||||
|
# Adjust the dylib's name so dynamic linking in apps works as expected.
|
||||||
|
install_name_tool -id '@rpath/VPX.framework/VPX' ${FRAMEWORK_DIR}/VPX
|
||||||
|
|
||||||
|
# Copy in Info.plist.
|
||||||
|
cat "${SCRIPT_DIR}/ios-Info.plist" \
|
||||||
|
| sed "s/\${VERSION}/${VERSION}/g" \
|
||||||
|
| sed "s/\${IOS_VERSION_MIN}/${IOS_VERSION_MIN}/g" \
|
||||||
|
> "${FRAMEWORK_DIR}/Info.plist"
|
||||||
|
fi
|
||||||
|
|
||||||
# Confirm VPX.framework/VPX contains the targets requested.
|
# Confirm VPX.framework/VPX contains the targets requested.
|
||||||
verify_framework_targets ${targets}
|
verify_framework_targets ${targets}
|
||||||
|
|
||||||
|
@ -252,6 +268,7 @@ iosbuild_usage() {
|
||||||
cat << EOF
|
cat << EOF
|
||||||
Usage: ${0##*/} [arguments]
|
Usage: ${0##*/} [arguments]
|
||||||
--help: Display this message and exit.
|
--help: Display this message and exit.
|
||||||
|
--enable-shared: Build a dynamic framework for use on iOS 8 or later.
|
||||||
--extra-configure-args <args>: Extra args to pass when configuring libvpx.
|
--extra-configure-args <args>: Extra args to pass when configuring libvpx.
|
||||||
--macosx: Uses darwin15 targets instead of iphonesimulator targets for x86
|
--macosx: Uses darwin15 targets instead of iphonesimulator targets for x86
|
||||||
and x86_64. Allows linking to framework when builds target MacOSX
|
and x86_64. Allows linking to framework when builds target MacOSX
|
||||||
|
@ -290,6 +307,9 @@ while [ -n "$1" ]; do
|
||||||
iosbuild_usage
|
iosbuild_usage
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
|
--enable-shared)
|
||||||
|
ENABLE_SHARED=yes
|
||||||
|
;;
|
||||||
--preserve-build-output)
|
--preserve-build-output)
|
||||||
PRESERVE_BUILD_OUTPUT=yes
|
PRESERVE_BUILD_OUTPUT=yes
|
||||||
;;
|
;;
|
||||||
|
@ -317,6 +337,19 @@ while [ -n "$1" ]; do
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ "${ENABLE_SHARED}" = "yes" ]; then
|
||||||
|
CONFIGURE_ARGS="--enable-shared ${CONFIGURE_ARGS}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
VERSION=$("${SCRIPT_DIR}"/version.sh --bare "${LIBVPX_SOURCE_DIR}" \
|
||||||
|
| sed -E 's/^v(.*)$/\1/')
|
||||||
|
if [ "$ENABLE_SHARED" = "yes" ]; then
|
||||||
|
IOS_VERSION_OPTIONS="--enable-shared"
|
||||||
|
else
|
||||||
|
IOS_VERSION_OPTIONS=""
|
||||||
|
fi
|
||||||
|
IOS_VERSION_MIN=$("${SCRIPT_DIR}/ios-version.sh" ${IOS_VERSION_OPTIONS})
|
||||||
|
|
||||||
if [ "${VERBOSE}" = "yes" ]; then
|
if [ "${VERBOSE}" = "yes" ]; then
|
||||||
cat << EOF
|
cat << EOF
|
||||||
BUILD_ROOT=${BUILD_ROOT}
|
BUILD_ROOT=${BUILD_ROOT}
|
||||||
|
@ -332,8 +365,12 @@ cat << EOF
|
||||||
ORIG_PWD=${ORIG_PWD}
|
ORIG_PWD=${ORIG_PWD}
|
||||||
PRESERVE_BUILD_OUTPUT=${PRESERVE_BUILD_OUTPUT}
|
PRESERVE_BUILD_OUTPUT=${PRESERVE_BUILD_OUTPUT}
|
||||||
TARGETS="$(print_list "" ${TARGETS})"
|
TARGETS="$(print_list "" ${TARGETS})"
|
||||||
|
ENABLE_SHARED=${ENABLE_SHARED}
|
||||||
OSX_TARGETS="${OSX_TARGETS}"
|
OSX_TARGETS="${OSX_TARGETS}"
|
||||||
SIM_TARGETS="${SIM_TARGETS}"
|
SIM_TARGETS="${SIM_TARGETS}"
|
||||||
|
SCRIPT_DIR="${SCRIPT_DIR}"
|
||||||
|
VERSION="${VERSION}"
|
||||||
|
IOS_VERSION_MIN="${IOS_VERSION_MIN}"
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -515,13 +515,18 @@ process_detect() {
|
||||||
# Can only build shared libs on a subset of platforms. Doing this check
|
# Can only build shared libs on a subset of platforms. Doing this check
|
||||||
# here rather than at option parse time because the target auto-detect
|
# here rather than at option parse time because the target auto-detect
|
||||||
# magic happens after the command line has been parsed.
|
# magic happens after the command line has been parsed.
|
||||||
if ! enabled linux && ! enabled os2; then
|
case "${tgt_os}" in
|
||||||
|
linux|os2|darwin*|iphonesimulator*)
|
||||||
|
# Supported platforms
|
||||||
|
;;
|
||||||
|
*)
|
||||||
if enabled gnu; then
|
if enabled gnu; then
|
||||||
echo "--enable-shared is only supported on ELF; assuming this is OK"
|
echo "--enable-shared is only supported on ELF; assuming this is OK"
|
||||||
else
|
else
|
||||||
die "--enable-shared only supported on ELF and OS/2 for now"
|
die "--enable-shared only supported on ELF, OS/2, and Darwin for now"
|
||||||
fi
|
fi
|
||||||
fi
|
;;
|
||||||
|
esac
|
||||||
fi
|
fi
|
||||||
if [ -z "$CC" ] || enabled external_build; then
|
if [ -z "$CC" ] || enabled external_build; then
|
||||||
echo "Bypassing toolchain for environment detection."
|
echo "Bypassing toolchain for environment detection."
|
||||||
|
|
7
libs.mk
7
libs.mk
|
@ -273,6 +273,12 @@ EXPORT_FILE := libvpx.syms
|
||||||
LIBVPX_SO_SYMLINKS := $(addprefix $(LIBSUBDIR)/, \
|
LIBVPX_SO_SYMLINKS := $(addprefix $(LIBSUBDIR)/, \
|
||||||
libvpx.dylib )
|
libvpx.dylib )
|
||||||
else
|
else
|
||||||
|
ifeq ($(filter iphonesimulator%,$(TGT_OS)),$(TGT_OS))
|
||||||
|
LIBVPX_SO := libvpx.$(SO_VERSION_MAJOR).dylib
|
||||||
|
SHARED_LIB_SUF := .dylib
|
||||||
|
EXPORT_FILE := libvpx.syms
|
||||||
|
LIBVPX_SO_SYMLINKS := $(addprefix $(LIBSUBDIR)/, libvpx.dylib)
|
||||||
|
else
|
||||||
ifeq ($(filter os2%,$(TGT_OS)),$(TGT_OS))
|
ifeq ($(filter os2%,$(TGT_OS)),$(TGT_OS))
|
||||||
LIBVPX_SO := libvpx$(SO_VERSION_MAJOR).dll
|
LIBVPX_SO := libvpx$(SO_VERSION_MAJOR).dll
|
||||||
SHARED_LIB_SUF := _dll.a
|
SHARED_LIB_SUF := _dll.a
|
||||||
|
@ -288,6 +294,7 @@ LIBVPX_SO_SYMLINKS := $(addprefix $(LIBSUBDIR)/, \
|
||||||
libvpx.so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR))
|
libvpx.so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR))
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
LIBS-$(CONFIG_SHARED) += $(BUILD_PFX)$(LIBVPX_SO)\
|
LIBS-$(CONFIG_SHARED) += $(BUILD_PFX)$(LIBVPX_SO)\
|
||||||
$(notdir $(LIBVPX_SO_SYMLINKS)) \
|
$(notdir $(LIBVPX_SO_SYMLINKS)) \
|
||||||
|
|
Загрузка…
Ссылка в новой задаче