OLD | NEW |
1 #!/bin/sh | 1 #!/bin/sh |
2 ## | 2 ## |
3 ## Copyright (c) 2014 The WebM project authors. All Rights Reserved. | 3 ## Copyright (c) 2014 The WebM project authors. All Rights Reserved. |
4 ## | 4 ## |
5 ## Use of this source code is governed by a BSD-style license | 5 ## Use of this source code is governed by a BSD-style license |
6 ## that can be found in the LICENSE file in the root of the source | 6 ## that can be found in the LICENSE file in the root of the source |
7 ## tree. An additional intellectual property rights grant can be found | 7 ## tree. An additional intellectual property rights grant can be found |
8 ## in the file PATENTS. All contributing project authors may | 8 ## in the file PATENTS. All contributing project authors may |
9 ## be found in the AUTHORS file in the root of the source tree. | 9 ## be found in the AUTHORS file in the root of the source tree. |
10 ## | 10 ## |
11 ## | 11 ## |
12 ## This script generates 'VPX.framework'. An iOS app can encode and decode VPx | 12 ## This script generates 'VPX.framework'. An iOS app can encode and decode VPx |
13 ## video by including 'VPX.framework'. | 13 ## video by including 'VPX.framework'. |
14 ## | 14 ## |
15 ## Run iosbuild.sh to create 'VPX.framework' in the current directory. | 15 ## Run iosbuild.sh to create 'VPX.framework' in the current directory. |
16 ## | 16 ## |
17 set -e | 17 set -e |
18 devnull='> /dev/null 2>&1' | 18 devnull='> /dev/null 2>&1' |
19 | 19 |
20 BUILD_ROOT="_iosbuild" | 20 BUILD_ROOT="_iosbuild" |
| 21 CONFIGURE_ARGS="--disable-docs |
| 22 --disable-examples |
| 23 --disable-libyuv |
| 24 --disable-unit-tests" |
21 DIST_DIR="_dist" | 25 DIST_DIR="_dist" |
22 FRAMEWORK_DIR="VPX.framework" | 26 FRAMEWORK_DIR="VPX.framework" |
23 HEADER_DIR="${FRAMEWORK_DIR}/Headers/vpx" | 27 HEADER_DIR="${FRAMEWORK_DIR}/Headers/vpx" |
24 MAKE_JOBS=1 | 28 MAKE_JOBS=1 |
25 SCRIPT_DIR=$(dirname "$0") | 29 SCRIPT_DIR=$(dirname "$0") |
26 LIBVPX_SOURCE_DIR=$(cd ${SCRIPT_DIR}/../..; pwd) | 30 LIBVPX_SOURCE_DIR=$(cd ${SCRIPT_DIR}/../..; pwd) |
27 LIPO=$(xcrun -sdk iphoneos${SDK} -find lipo) | 31 LIPO=$(xcrun -sdk iphoneos${SDK} -find lipo) |
28 ORIG_PWD="$(pwd)" | 32 ORIG_PWD="$(pwd)" |
29 TARGETS="arm64-darwin-gcc | 33 TARGETS="arm64-darwin-gcc |
30 armv7-darwin-gcc | 34 armv7-darwin-gcc |
31 armv7s-darwin-gcc | 35 armv7s-darwin-gcc |
32 x86-iphonesimulator-gcc | 36 x86-iphonesimulator-gcc |
33 x86_64-iphonesimulator-gcc" | 37 x86_64-iphonesimulator-gcc" |
34 | 38 |
35 # Configures for the target specified by $1, and invokes make with the dist | 39 # Configures for the target specified by $1, and invokes make with the dist |
36 # target using $DIST_DIR as the distribution output directory. | 40 # target using $DIST_DIR as the distribution output directory. |
37 build_target() { | 41 build_target() { |
38 local target="$1" | 42 local target="$1" |
39 local old_pwd="$(pwd)" | 43 local old_pwd="$(pwd)" |
40 | 44 |
41 vlog "***Building target: ${target}***" | 45 vlog "***Building target: ${target}***" |
42 | 46 |
43 mkdir "${target}" | 47 mkdir "${target}" |
44 cd "${target}" | 48 cd "${target}" |
45 eval "${LIBVPX_SOURCE_DIR}/configure" --target="${target}" \ | 49 eval "${LIBVPX_SOURCE_DIR}/configure" --target="${target}" \ |
46 --disable-docs ${EXTRA_CONFIGURE_ARGS} ${devnull} | 50 ${CONFIGURE_ARGS} ${EXTRA_CONFIGURE_ARGS} ${devnull} |
47 export DIST_DIR | 51 export DIST_DIR |
48 eval make -j ${MAKE_JOBS} dist ${devnull} | 52 eval make -j ${MAKE_JOBS} dist ${devnull} |
49 cd "${old_pwd}" | 53 cd "${old_pwd}" |
50 | 54 |
51 vlog "***Done building target: ${target}***" | 55 vlog "***Done building target: ${target}***" |
52 } | 56 } |
53 | 57 |
54 # Returns the preprocessor symbol for the target specified by $1. | 58 # Returns the preprocessor symbol for the target specified by $1. |
55 target_to_preproc_symbol() { | 59 target_to_preproc_symbol() { |
56 target="$1" | 60 target="$1" |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 exit 1 | 249 exit 1 |
246 ;; | 250 ;; |
247 esac | 251 esac |
248 shift | 252 shift |
249 done | 253 done |
250 | 254 |
251 if [ "${VERBOSE}" = "yes" ]; then | 255 if [ "${VERBOSE}" = "yes" ]; then |
252 cat << EOF | 256 cat << EOF |
253 BUILD_ROOT=${BUILD_ROOT} | 257 BUILD_ROOT=${BUILD_ROOT} |
254 DIST_DIR=${DIST_DIR} | 258 DIST_DIR=${DIST_DIR} |
| 259 CONFIGURE_ARGS=${CONFIGURE_ARGS} |
255 EXTRA_CONFIGURE_ARGS=${EXTRA_CONFIGURE_ARGS} | 260 EXTRA_CONFIGURE_ARGS=${EXTRA_CONFIGURE_ARGS} |
256 FRAMEWORK_DIR=${FRAMEWORK_DIR} | 261 FRAMEWORK_DIR=${FRAMEWORK_DIR} |
257 HEADER_DIR=${HEADER_DIR} | 262 HEADER_DIR=${HEADER_DIR} |
258 MAKE_JOBS=${MAKE_JOBS} | 263 MAKE_JOBS=${MAKE_JOBS} |
259 PRESERVE_BUILD_OUTPUT=${PRESERVE_BUILD_OUTPUT} | 264 PRESERVE_BUILD_OUTPUT=${PRESERVE_BUILD_OUTPUT} |
260 LIBVPX_SOURCE_DIR=${LIBVPX_SOURCE_DIR} | 265 LIBVPX_SOURCE_DIR=${LIBVPX_SOURCE_DIR} |
261 LIPO=${LIPO} | 266 LIPO=${LIPO} |
262 ORIG_PWD=${ORIG_PWD} | 267 ORIG_PWD=${ORIG_PWD} |
263 TARGETS="${TARGETS}" | 268 TARGETS="${TARGETS}" |
264 EOF | 269 EOF |
265 fi | 270 fi |
266 | 271 |
267 build_framework "${TARGETS}" | 272 build_framework "${TARGETS}" |
268 echo "Successfully built '${FRAMEWORK_DIR}' for:" | 273 echo "Successfully built '${FRAMEWORK_DIR}' for:" |
269 echo " ${TARGETS}" | 274 echo " ${TARGETS}" |
OLD | NEW |