OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
| 2 |
| 3 # Copyright 2015 The WebRTC project authors. All Rights Reserved. |
2 # | 4 # |
3 # libjingle | 5 # Use of this source code is governed by a BSD-style license |
4 # Copyright 2015 Google Inc. | 6 # that can be found in the LICENSE file in the root of the source |
5 # | 7 # tree. An additional intellectual property rights grant can be found |
6 # Redistribution and use in source and binary forms, with or without | 8 # in the file PATENTS. All contributing project authors may |
7 # modification, are permitted provided that the following conditions are met: | 9 # be found in the AUTHORS file in the root of the source tree. |
8 # | |
9 # 1. Redistributions of source code must retain the above copyright notice, | |
10 # this list of conditions and the following disclaimer. | |
11 # 2. Redistributions in binary form must reproduce the above copyright notice, | |
12 # this list of conditions and the following disclaimer in the documentation | |
13 # and/or other materials provided with the distribution. | |
14 # 3. The name of the author may not be used to endorse or promote products | |
15 # derived from this software without specific prior written permission. | |
16 # | |
17 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED | |
18 # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | |
19 # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO | |
20 # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
21 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | |
22 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | |
23 # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | |
24 # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | |
25 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | |
26 # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
27 | 10 |
28 # Generates static FAT libraries for ios in out_ios_libs. | 11 # Generates static FAT libraries for ios in out_ios_libs. |
29 | 12 |
30 # Flag to build the new or legacy version of the API. | 13 # Flag to build the new or legacy version of the API. |
31 USE_LEGACY_API=1 | 14 USE_LEGACY_API=0 |
32 | 15 |
33 # Check for Darwin. | 16 # Check for Darwin. |
34 if [[ ! $(uname) = "Darwin" ]]; then | 17 if [[ ! $(uname) = "Darwin" ]]; then |
35 echo "OS/X required." >&2 | 18 echo "OS/X required." >&2 |
36 fi | 19 fi |
37 | 20 |
38 # Check for libtool. | 21 # Check for libtool. |
39 if [[ -z $(which libtool) ]]; then | 22 if [[ -z $(which libtool) ]]; then |
40 echo "Missing libtool binary." >&2 | 23 echo "Missing libtool binary." >&2 |
41 fi | 24 fi |
42 | 25 |
43 # Check for GYP generator. | 26 # Check for GYP generator. |
44 SCRIPT_DIR=$(dirname $0) | 27 SCRIPT_DIR=$(dirname $0) |
45 WEBRTC_BASE_DIR=${SCRIPT_DIR}/../.. | 28 WEBRTC_BASE_DIR=${SCRIPT_DIR}/../../.. |
46 GYP_WEBRTC_SCRIPT=${WEBRTC_BASE_DIR}/webrtc/build/gyp_webrtc | 29 GYP_WEBRTC_SCRIPT=${WEBRTC_BASE_DIR}/webrtc/build/gyp_webrtc |
47 if [[ ! -x ${GYP_WEBRTC_SCRIPT} ]]; then | 30 if [[ ! -x ${GYP_WEBRTC_SCRIPT} ]]; then |
48 echo "Failed to find gyp generator." >&2 | 31 echo "Failed to find gyp generator." >&2 |
49 exit 1 | 32 exit 1 |
50 fi | 33 fi |
51 # Check for export headers script. | 34 # Check for export headers script. |
52 EXPORT_HEADERS_SCRIPT=${SCRIPT_DIR}/export_headers | 35 EXPORT_HEADERS_SCRIPT=${SCRIPT_DIR}/export_headers |
53 if [[ ! -x ${EXPORT_HEADERS_SCRIPT} ]]; then | 36 if [[ ! -x ${EXPORT_HEADERS_SCRIPT} ]]; then |
54 echo "Failed to find export headers script." >&2 | 37 echo "Failed to find export headers script." >&2 |
55 exit 1 | 38 exit 1 |
(...skipping 14 matching lines...) Expand all Loading... |
70 TARGET_ARCH=$3 | 53 TARGET_ARCH=$3 |
71 if [[ ${TARGET_ARCH} = 'arm' || ${TARGET_ARCH} = 'arm64' ]]; then | 54 if [[ ${TARGET_ARCH} = 'arm' || ${TARGET_ARCH} = 'arm64' ]]; then |
72 FLAVOR="${FLAVOR}-iphoneos" | 55 FLAVOR="${FLAVOR}-iphoneos" |
73 else | 56 else |
74 FLAVOR="${FLAVOR}-iphonesimulator" | 57 FLAVOR="${FLAVOR}-iphonesimulator" |
75 fi | 58 fi |
76 export GYP_DEFINES="OS=ios target_arch=${TARGET_ARCH} use_objc_h264=1 \ | 59 export GYP_DEFINES="OS=ios target_arch=${TARGET_ARCH} use_objc_h264=1 \ |
77 clang_xcode=1" | 60 clang_xcode=1" |
78 export GYP_GENERATORS="ninja" | 61 export GYP_GENERATORS="ninja" |
79 export GYP_GENERATOR_FLAGS="output_dir=${OUTPUT_DIR}" | 62 export GYP_GENERATOR_FLAGS="output_dir=${OUTPUT_DIR}" |
80 webrtc/build/gyp_webrtc talk/build/merge_ios_libs.gyp | 63 webrtc/build/gyp_webrtc webrtc/build/ios/merge_ios_libs.gyp |
81 if [[ ${USE_LEGACY_API} -eq 1 ]]; then | 64 if [[ ${USE_LEGACY_API} -eq 1 ]]; then |
82 ninja -C ${OUTPUT_DIR}/${FLAVOR} libjingle_peerconnection_objc_no_op | 65 ninja -C ${OUTPUT_DIR}/${FLAVOR} libjingle_peerconnection_objc_no_op |
83 else | 66 else |
84 ninja -C ${OUTPUT_DIR}/${FLAVOR} webrtc_api_objc_no_op | 67 ninja -C ${OUTPUT_DIR}/${FLAVOR} webrtc_api_objc_no_op |
85 fi | 68 fi |
86 mkdir -p ${LIBRARY_BASE_DIR}/${TARGET_ARCH} | 69 mkdir -p ${LIBRARY_BASE_DIR}/${TARGET_ARCH} |
87 mv ${OUTPUT_DIR}/${FLAVOR}/*.a ${LIBRARY_BASE_DIR}/${TARGET_ARCH} | 70 mv ${OUTPUT_DIR}/${FLAVOR}/*.a ${LIBRARY_BASE_DIR}/${TARGET_ARCH} |
88 } | 71 } |
89 | 72 |
90 # Build all the common architectures. | 73 # Build all the common architectures. |
91 build_webrtc "out_ios_arm" "Release" "arm" | 74 build_webrtc "out_ios_arm" "Release" "arm" |
92 build_webrtc "out_ios_arm64" "Release" "arm64" | 75 build_webrtc "out_ios_arm64" "Release" "arm64" |
93 build_webrtc "out_ios_ia32" "Release" "ia32" | 76 build_webrtc "out_ios_ia32" "Release" "ia32" |
94 build_webrtc "out_ios_x86_64" "Release" "x64" | 77 build_webrtc "out_ios_x86_64" "Release" "x64" |
95 | 78 |
96 popd | 79 popd |
97 | 80 |
98 # Export header files. | 81 # Export header files. |
99 ${EXPORT_HEADERS_SCRIPT} ${WEBRTC_BASE_DIR}/${LIBRARY_BASE_DIR} \ | 82 ${EXPORT_HEADERS_SCRIPT} ${WEBRTC_BASE_DIR}/${LIBRARY_BASE_DIR} \ |
100 ${USE_LEGACY_API} | 83 ${USE_LEGACY_API} |
101 | 84 |
102 # Merge the libraries together. | 85 # Merge the libraries together. |
103 ${MERGE_SCRIPT} ${WEBRTC_BASE_DIR}/${LIBRARY_BASE_DIR} | 86 ${MERGE_SCRIPT} ${WEBRTC_BASE_DIR}/${LIBRARY_BASE_DIR} |
OLD | NEW |