1#!/bin/sh
2
3# Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
4#
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
7# tree. An additional intellectual property rights grant can be found
8# in the file PATENTS.  All contributing project authors may
9# be found in the AUTHORS file in the root of the source tree.
10set -e
11
12# TODO(sjlee): remove this whole script file.
13# (https://code.google.com/p/webrtc/issues/detail?id=2028)
14function build_project() {
15  # make the target string
16  local target_string=""
17  if [[ -n "$2" ]]; then
18    target_string="-target $2"
19  fi
20
21  xcodebuild -project "$1" -sdk iphoneos -arch armv7 \
22    -configuration ${CONFIGURATION} \
23    -CONFIGURATION_BUILD_DIR=${CONFIGURATION_BUILD_DIR} $target_string
24}
25
26# change the working directory to trunk
27cd "$( dirname "$0" )/../.."
28
29# build setting
30CONFIGURATION_BUILD_DIR=./xcodebuild
31CONFIGURATION=Debug
32export GYP_DEFINES="OS=ios target_arch=arm armv7=1 arm_neon=1"
33# TODO(sjlee): remove this script.
34# (https://webrtc-codereview.appspot.com/1874005)
35
36# update gyp settings
37echo '[Updating gyp settings...]'
38gclient runhooks
39./build/gyp_chromium --depth=. \
40webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_components.gyp
41./build/gyp_chromium --depth=. \
42webrtc/modules/video_coding/utility/video_coding_utility.gyp
43./build/gyp_chromium --depth=. third_party/opus/opus.gyp
44./build/gyp_chromium --depth=. third_party/libyuv/libyuv.gyp
45./build/gyp_chromium --depth=. third_party/libjpeg/libjpeg.gyp
46
47# build the xcode projects
48echo '[Building xcode projects...]'
49
50build_project "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_components.xcodeproj"
51build_project "webrtc/modules/video_coding/utility/video_coding_utility.xcodeproj"
52build_project "third_party/opus/opus.xcodeproj" "opus"
53build_project "third_party/libjpeg/libjpeg.xcodeproj"
54build_project "third_party/libyuv/libyuv.xcodeproj"
55
56# build the libvpx
57cd third_party/libvpx/source/libvpx
58
59./configure --target=armv7-darwin-gcc --disable-vp9 \
60  --libc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk
61
62make
63
64cd -
65
66cp third_party/libvpx/source/libvpx/libvpx.a \
67  ${CONFIGURATION_BUILD_DIR}/${CONFIGURATION}-iphoneos
68
69echo "[Building xcode projects is success...]\n"
70