| OLD | NEW |
| (Empty) |
| 1 #!/bin/sh | |
| 2 | |
| 3 # Copyright (c) 2008 The Chromium Authors. All rights reserved. | |
| 4 # Use of this source code is governed by a BSD-style license that can be | |
| 5 # found in the LICENSE file. | |
| 6 | |
| 7 set -ex | |
| 8 JS_FILES="runtime.js \ | |
| 9 v8natives.js \ | |
| 10 array.js \ | |
| 11 string.js \ | |
| 12 uri.js \ | |
| 13 math.js \ | |
| 14 messages.js \ | |
| 15 apinatives.js \ | |
| 16 debug-delay.js \ | |
| 17 mirror-delay.js \ | |
| 18 date-delay.js \ | |
| 19 regexp-delay.js \ | |
| 20 macros.py" | |
| 21 | |
| 22 V8ROOT="${SRCROOT}/../v8" | |
| 23 | |
| 24 SRC_DIR="${V8ROOT}/src" | |
| 25 | |
| 26 NATIVE_JS_FILES="" | |
| 27 | |
| 28 for i in ${JS_FILES} ; do | |
| 29 NATIVE_JS_FILES+="${SRC_DIR}/${i} " | |
| 30 done | |
| 31 | |
| 32 V8_GENERATED_SOURCES_DIR="${CONFIGURATION_TEMP_DIR}/generated" | |
| 33 mkdir -p "${V8_GENERATED_SOURCES_DIR}" | |
| 34 | |
| 35 LIBRARIES_CC="${V8_GENERATED_SOURCES_DIR}/libraries.cc" | |
| 36 LIBRARIES_EMPTY_CC="${V8_GENERATED_SOURCES_DIR}/libraries-empty.cc" | |
| 37 | |
| 38 python "${V8ROOT}/tools/js2c.py" \ | |
| 39 "${LIBRARIES_CC}.new" \ | |
| 40 "${LIBRARIES_EMPTY_CC}.new" \ | |
| 41 CORE \ | |
| 42 ${NATIVE_JS_FILES} | |
| 43 | |
| 44 # Only use the new files if they're different from the existing files (if any), | |
| 45 # preserving the existing files' timestamps when there are no changes. This | |
| 46 # minimizes unnecessary build activity for a no-change build. | |
| 47 | |
| 48 if ! diff -q "${LIBRARIES_CC}.new" "${LIBRARIES_CC}" >& /dev/null | |
| 49 then | |
| 50 mv "${LIBRARIES_CC}.new" "${LIBRARIES_CC}" | |
| 51 else | |
| 52 rm "${LIBRARIES_CC}.new" | |
| 53 fi | |
| 54 | |
| 55 if ! diff -q "${LIBRARIES_EMPTY_CC}.new" "${LIBRARIES_EMPTY_CC}" >& /dev/null | |
| 56 then | |
| 57 mv "${LIBRARIES_EMPTY_CC}.new" "${LIBRARIES_EMPTY_CC}" | |
| 58 else | |
| 59 rm "${LIBRARIES_EMPTY_CC}.new" | |
| 60 fi | |
| OLD | NEW |