| 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 DIST_DIR="_dist" | 21 DIST_DIR="_dist" |
| 22 FRAMEWORK_DIR="VPX.framework" | 22 FRAMEWORK_DIR="VPX.framework" |
| 23 HEADER_DIR="${FRAMEWORK_DIR}/Headers/vpx" | 23 HEADER_DIR="${FRAMEWORK_DIR}/Headers/vpx" |
| 24 MAKE_JOBS=1 | 24 MAKE_JOBS=1 |
| 25 LIBVPX_SOURCE_DIR=$(dirname "$0" | sed -e s,/build/make,,) | 25 LIBVPX_SOURCE_DIR=$(dirname "$0" | sed -e s,/build/make,,) |
| 26 LIPO=$(xcrun -sdk iphoneos${SDK} -find lipo) | 26 LIPO=$(xcrun -sdk iphoneos${SDK} -find lipo) |
| 27 ORIG_PWD="$(pwd)" | 27 ORIG_PWD="$(pwd)" |
| 28 TARGETS="armv6-darwin-gcc | 28 TARGETS="arm64-darwin-gcc |
| 29 armv6-darwin-gcc |
| 29 armv7-darwin-gcc | 30 armv7-darwin-gcc |
| 30 armv7s-darwin-gcc | 31 armv7s-darwin-gcc |
| 31 x86-iphonesimulator-gcc | 32 x86-iphonesimulator-gcc |
| 32 x86_64-iphonesimulator-gcc" | 33 x86_64-iphonesimulator-gcc" |
| 33 | 34 |
| 34 # Configures for the target specified by $1, and invokes make with the dist | 35 # Configures for the target specified by $1, and invokes make with the dist |
| 35 # target using $DIST_DIR as the distribution output directory. | 36 # target using $DIST_DIR as the distribution output directory. |
| 36 build_target() { | 37 build_target() { |
| 37 local target="$1" | 38 local target="$1" |
| 38 local old_pwd="$(pwd)" | 39 local old_pwd="$(pwd)" |
| 39 | 40 |
| 40 vlog "***Building target: ${target}***" | 41 vlog "***Building target: ${target}***" |
| 41 | 42 |
| 42 mkdir "${target}" | 43 mkdir "${target}" |
| 43 cd "${target}" | 44 cd "${target}" |
| 44 eval "../../${LIBVPX_SOURCE_DIR}/configure" --target="${target}" \ | 45 eval "../../${LIBVPX_SOURCE_DIR}/configure" --target="${target}" \ |
| 45 --disable-docs ${devnull} | 46 --disable-docs ${devnull} |
| 46 export DIST_DIR | 47 export DIST_DIR |
| 47 eval make -j ${MAKE_JOBS} dist ${devnull} | 48 eval make -j ${MAKE_JOBS} dist ${devnull} |
| 48 cd "${old_pwd}" | 49 cd "${old_pwd}" |
| 49 | 50 |
| 50 vlog "***Done building target: ${target}***" | 51 vlog "***Done building target: ${target}***" |
| 51 } | 52 } |
| 52 | 53 |
| 53 # Returns the preprocessor symbol for the target specified by $1. | 54 # Returns the preprocessor symbol for the target specified by $1. |
| 54 target_to_preproc_symbol() { | 55 target_to_preproc_symbol() { |
| 55 target="$1" | 56 target="$1" |
| 56 case "${target}" in | 57 case "${target}" in |
| 58 arm64-*) |
| 59 echo "__aarch64__" |
| 60 ;; |
| 57 armv6-*) | 61 armv6-*) |
| 58 echo "__ARM_ARCH_6__" | 62 echo "__ARM_ARCH_6__" |
| 59 ;; | 63 ;; |
| 60 armv7-*) | 64 armv7-*) |
| 61 echo "__ARM_ARCH_7__" | 65 echo "__ARM_ARCH_7__" |
| 62 ;; | 66 ;; |
| 63 armv7s-*) | 67 armv7s-*) |
| 64 echo "__ARM_ARCH_7S__" | 68 echo "__ARM_ARCH_7S__" |
| 65 ;; | 69 ;; |
| 66 x86-*) | 70 x86-*) |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 MAKE_JOBS=${MAKE_JOBS} | 239 MAKE_JOBS=${MAKE_JOBS} |
| 236 PRESERVE_BUILD_OUTPUT=${PRESERVE_BUILD_OUTPUT} | 240 PRESERVE_BUILD_OUTPUT=${PRESERVE_BUILD_OUTPUT} |
| 237 LIBVPX_SOURCE_DIR=${LIBVPX_SOURCE_DIR} | 241 LIBVPX_SOURCE_DIR=${LIBVPX_SOURCE_DIR} |
| 238 LIPO=${LIPO} | 242 LIPO=${LIPO} |
| 239 ORIG_PWD=${ORIG_PWD} | 243 ORIG_PWD=${ORIG_PWD} |
| 240 TARGETS="${TARGETS}" | 244 TARGETS="${TARGETS}" |
| 241 EOF | 245 EOF |
| 242 fi | 246 fi |
| 243 | 247 |
| 244 build_framework "${TARGETS}" | 248 build_framework "${TARGETS}" |
| OLD | NEW |