Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/bin/sh | 1 #!/bin/sh |
| 2 | 2 |
| 3 # Copyright 2014 Google Inc. | 3 # Copyright 2014 Google Inc. |
| 4 # | 4 # |
| 5 # Use of this source code is governed by a BSD-style license that can be | 5 # Use of this source code is governed by a BSD-style license that can be |
| 6 # found in the LICENSE file. | 6 # found in the LICENSE file. |
| 7 | 7 |
| 8 set -e # When any command fails, the shell will immediately exit. | |
| 9 | |
| 10 if echo $- | grep -q 'x'; then | |
| 11 # Debug mode | |
| 12 trap 'echo exit status = $?' EXIT | |
| 13 fi | |
| 14 | |
| 8 usage() { | 15 usage() { |
| 9 cat >&2 <<EOF | 16 cat >&2 <<EOF |
| 10 barelinux_make - this script builds a version of skia that does not | 17 barelinux_make - this script builds a version of skia that does not |
| 11 depend on external libraries, perfect for putting in an embedded | 18 depend on external libraries, perfect for putting in an embedded |
| 12 system running Linux. | 19 system running Linux. |
| 13 | 20 |
| 14 Assumes that you have already run the download_deps script. | 21 Assumes that you have already run the download_deps script. |
| 15 | 22 |
| 16 Usage: | 23 Usage: |
| 17 $0 \\ | 24 $0 \\ |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 45 usage || exit;; | 52 usage || exit;; |
| 46 esac | 53 esac |
| 47 done | 54 done |
| 48 # Append exra arguments to GYP_DEFINES variable. | 55 # Append exra arguments to GYP_DEFINES variable. |
| 49 shift $(( $OPTIND - 1 )) | 56 shift $(( $OPTIND - 1 )) |
| 50 GYP_DEFINES="${GYP_DEFINES} $*" | 57 GYP_DEFINES="${GYP_DEFINES} $*" |
| 51 | 58 |
| 52 # If you move this script, this must be changed. | 59 # If you move this script, this must be changed. |
| 53 SKIA_SRC_DIR="$(cd "$(dirname "$0")/../../.."; pwd)" | 60 SKIA_SRC_DIR="$(cd "$(dirname "$0")/../../.."; pwd)" |
| 54 | 61 |
| 55 try() { | |
| 56 # exit shell script on nonzero return code | |
| 57 "$@" | |
| 58 local ret=$? | |
| 59 if [ $ret != 0 ] ; then | |
| 60 echo "'$@' failed and returned ${ret}." >&2 | |
| 61 return $ret | |
| 62 fi | |
| 63 } | |
| 64 is_set() { | |
| 65 test "$1" && test "$(eval echo \${$1})"; | |
| 66 } | |
| 67 | |
| 68 # Set a reasonable default. | 62 # Set a reasonable default. |
| 69 is_set SKIA_OUT || export SKIA_OUT="${SKIA_SRC_DIR}/out/barelinux" | 63 if ! test "$SKIA_OUT"; then |
|
mtklein
2014/04/02 20:05:32
export SKIA_OUT=${SKIA_OUT-"${SKIA_SRC_DIR}/out/ba
hal.canary
2014/04/02 20:07:20
Done.
| |
| 64 export SKIA_OUT="${SKIA_SRC_DIR}/out/barelinux" | |
| 65 fi | |
| 70 | 66 |
| 71 # Assume ninja is in your path | 67 # Assume ninja is in your path |
|
mtklein
2014/04/02 20:05:32
Assume -> check?
Or given that everything going t
hal.canary
2014/04/02 20:07:20
It doesn't cost much to test this early. I'm goin
| |
| 72 try command -v ninja > /dev/null || exit | 68 command -v ninja > /dev/null |
| 73 | 69 |
| 74 try test -x "${SKIA_SRC_DIR}/gyp_skia" || exit | 70 test -x "${SKIA_SRC_DIR}/gyp_skia" |
| 75 try mkdir -p "$SKIA_OUT" || exit | 71 |
| 72 mkdir -p "$SKIA_OUT" | |
| 76 | 73 |
| 77 export GYP_GENERATORS="ninja" | 74 export GYP_GENERATORS="ninja" |
| 78 export GYP_GENERATOR_FLAGS="" | 75 export GYP_GENERATOR_FLAGS="" |
| 79 export GYP_DEFINES="${GYP_DEFINES} \ | 76 export GYP_DEFINES="${GYP_DEFINES} \ |
| 80 skia_warnings_as_errors=0 \ | 77 skia_warnings_as_errors=0 \ |
| 81 skia_giflib_static=1 \ | 78 skia_giflib_static=1 \ |
| 82 skia_libpng_static=1 \ | 79 skia_libpng_static=1 \ |
| 83 skia_zlib_static=1 \ | 80 skia_zlib_static=1 \ |
| 84 skia_freetype_static=1 \ | 81 skia_freetype_static=1 \ |
| 85 skia_no_fontconfig=1 \ | 82 skia_no_fontconfig=1 \ |
| 86 skia_poppler_enabled=0 \ | 83 skia_poppler_enabled=0 \ |
| 87 skia_skip_gui=1 \ | 84 skia_skip_gui=1 \ |
| 88 " | 85 " |
| 89 | 86 |
| 90 try "${SKIA_SRC_DIR}/gyp_skia" || exit | 87 "${SKIA_SRC_DIR}/gyp_skia" |
| 91 | 88 |
| 92 try test -d "${SKIA_OUT}/${BUILD_TYPE}" || exit | 89 test -d "${SKIA_OUT}/${BUILD_TYPE}" |
| 93 | 90 |
| 94 try ninja -C "${SKIA_OUT}/${BUILD_TYPE}" || exit | 91 ninja -C "${SKIA_OUT}/${BUILD_TYPE}" |
| 95 | 92 |
| OLD | NEW |