OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 # | 2 # |
3 # android_setup.sh: Sets environment variables used by other Android scripts. | 3 # android_setup.sh: Sets environment variables used by other Android scripts. |
4 | 4 |
5 # Parse the arguments for a DEVICE_ID. | 5 # Parse the arguments for a DEVICE_ID. |
6 DEVICE_ID="" | 6 DEVICE_ID="" |
7 DEVICE_SERIAL="" | 7 DEVICE_SERIAL="" |
8 while (( "$#" )); do | 8 while (( "$#" )); do |
9 if [[ $(echo "$1" | grep "^-d$") != "" ]]; | 9 if [[ $(echo "$1" | grep "^-d$") != "" ]]; |
10 then | 10 then |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 export STRIP="$ANDROID_TOOLCHAIN_PREFIX-strip" | 154 export STRIP="$ANDROID_TOOLCHAIN_PREFIX-strip" |
155 } | 155 } |
156 | 156 |
157 # Helper function to configure the GYP defines to the appropriate values | 157 # Helper function to configure the GYP defines to the appropriate values |
158 # based on the target device. | 158 # based on the target device. |
159 setup_device() { | 159 setup_device() { |
160 DEFINES="OS=android" | 160 DEFINES="OS=android" |
161 DEFINES="${DEFINES} host_os=$(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/'
)" | 161 DEFINES="${DEFINES} host_os=$(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/'
)" |
162 DEFINES="${DEFINES} skia_os=android" | 162 DEFINES="${DEFINES} skia_os=android" |
163 DEFINES="${DEFINES} android_base=${SCRIPT_DIR}/.." | 163 DEFINES="${DEFINES} android_base=${SCRIPT_DIR}/.." |
164 DEFINES="${DEFINES} skia_shared_lib=1" | 164 if [[ "$GYP_DEFINES" != *skia_shared_lib=* ]]; then |
| 165 DEFINES="${DEFINES} skia_shared_lib=1" |
| 166 fi |
165 | 167 |
166 # Setup the build variation depending on the target device | 168 # Setup the build variation depending on the target device |
167 TARGET_DEVICE="$1" | 169 TARGET_DEVICE="$1" |
168 | 170 |
169 if [ -z "$TARGET_DEVICE" ]; then | 171 if [ -z "$TARGET_DEVICE" ]; then |
170 if [ -f .android_config ]; then | 172 if [ -f .android_config ]; then |
171 TARGET_DEVICE=$(cat .android_config) | 173 TARGET_DEVICE=$(cat .android_config) |
172 verbose "INFO: no target device was specified so using the device (${TARGE
T_DEVICE}) from the most recent build" | 174 verbose "INFO: no target device was specified so using the device (${TARGE
T_DEVICE}) from the most recent build" |
173 else | 175 else |
174 TARGET_DEVICE="arm_v7_thumb" | 176 TARGET_DEVICE="arm_v7_thumb" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 else | 325 else |
324 $ADB $DEVICE_SERIAL push $HOST_SRC $ANDROID_DST | 326 $ADB $DEVICE_SERIAL push $HOST_SRC $ANDROID_DST |
325 fi | 327 fi |
326 } | 328 } |
327 | 329 |
328 # Set up the device. | 330 # Set up the device. |
329 setup_device "${DEVICE_ID}" | 331 setup_device "${DEVICE_ID}" |
330 if [[ "$?" != "0" ]]; then | 332 if [[ "$?" != "0" ]]; then |
331 exit 1 | 333 exit 1 |
332 fi | 334 fi |
OLD | NEW |