| OLD | NEW |
| 1 function exportVar { | 1 function exportVar { |
| 2 NAME=$1 | 2 NAME=$1 |
| 3 VALUE=$2 | 3 VALUE=$2 |
| 4 echo export $NAME=\"$VALUE\" | 4 echo export $NAME=\"$VALUE\" |
| 5 export $NAME="$VALUE" | 5 export $NAME="$VALUE" |
| 6 } | 6 } |
| 7 | 7 |
| 8 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | 8 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" |
| 9 | 9 |
| 10 # A valid Android SDK installation is required to build the sample app. | 10 # A valid Android SDK installation is required to build the sample app. |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 exportVar STRIP "$ANDROID_TOOLCHAIN_PREFIX-strip" | 119 exportVar STRIP "$ANDROID_TOOLCHAIN_PREFIX-strip" |
| 120 | 120 |
| 121 # Helper function to configure the GYP defines to the appropriate values | 121 # Helper function to configure the GYP defines to the appropriate values |
| 122 # based on the target device. | 122 # based on the target device. |
| 123 setup_device() { | 123 setup_device() { |
| 124 DEFINES="OS=android" | 124 DEFINES="OS=android" |
| 125 DEFINES="${DEFINES} host_os=$(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/'
)" | 125 DEFINES="${DEFINES} host_os=$(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/'
)" |
| 126 DEFINES="${DEFINES} skia_os=android" | 126 DEFINES="${DEFINES} skia_os=android" |
| 127 DEFINES="${DEFINES} android_base=${SCRIPT_DIR}/.." | 127 DEFINES="${DEFINES} android_base=${SCRIPT_DIR}/.." |
| 128 DEFINES="${DEFINES} android_toolchain=${TOOLCHAIN_TYPE}" | 128 DEFINES="${DEFINES} android_toolchain=${TOOLCHAIN_TYPE}" |
| 129 DEFINES="${DEFINES} skia_shared_lib=1" |
| 129 | 130 |
| 130 # Setup the build variation depending on the target device | 131 # Setup the build variation depending on the target device |
| 131 TARGET_DEVICE="$1" | 132 TARGET_DEVICE="$1" |
| 132 | 133 |
| 133 if [ -z "$TARGET_DEVICE" ]; then | 134 if [ -z "$TARGET_DEVICE" ]; then |
| 134 echo "INFO: no target device type was specified so using the default 'arm_v7
'" | 135 echo "INFO: no target device type was specified so using the default 'arm_v7
'" |
| 135 TARGET_DEVICE="arm_v7" | 136 TARGET_DEVICE="arm_v7" |
| 136 fi | 137 fi |
| 137 | 138 |
| 138 case $TARGET_DEVICE in | 139 case $TARGET_DEVICE in |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 # Use the "android" flavor of the Makefile generator for both Linux and OS X. | 193 # Use the "android" flavor of the Makefile generator for both Linux and OS X. |
| 193 exportVar GYP_GENERATORS "make-android" | 194 exportVar GYP_GENERATORS "make-android" |
| 194 | 195 |
| 195 # Helper function so that when we run "make" to build for clank it exports | 196 # Helper function so that when we run "make" to build for clank it exports |
| 196 # the toolchain variables to make. | 197 # the toolchain variables to make. |
| 197 #make_android() { | 198 #make_android() { |
| 198 # CC="$CROSS_CC" CXX="$CROSS_CXX" LINK="$CROSS_LINK" \ | 199 # CC="$CROSS_CC" CXX="$CROSS_CXX" LINK="$CROSS_LINK" \ |
| 199 # AR="$CROSS_AR" RANLIB="$CROSS_RANLIB" \ | 200 # AR="$CROSS_AR" RANLIB="$CROSS_RANLIB" \ |
| 200 # command make $* | 201 # command make $* |
| 201 #} | 202 #} |
| OLD | NEW |