| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 | 2 |
| 3 # Copyright (c) 2008 The Chromium Authors. All rights reserved. | 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 | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 # This is a handy wrapper script that figures out how to call the strip | 7 # This is a handy wrapper script that figures out how to call the strip |
| 8 # utility (strip_save_dsym in this case), if it even needs to be called at all, | 8 # utility (strip_save_dsym in this case), if it even needs to be called at all, |
| 9 # and then does it. This script should be called by a post-link phase in | 9 # and then does it. This script should be called by a post-link phase in |
| 10 # targets that might generate Mach-O executables, dynamic libraries, or | 10 # targets that might generate Mach-O executables, dynamic libraries, or |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 declare -a FLAGS | 22 declare -a FLAGS |
| 23 | 23 |
| 24 # MACH_O_TYPE is not set for a command-line tool, so check PRODUCT_TYPE too. | 24 # MACH_O_TYPE is not set for a command-line tool, so check PRODUCT_TYPE too. |
| 25 # Weird. | 25 # Weird. |
| 26 if [ "${MACH_O_TYPE}" = "mh_execute" ] || \ | 26 if [ "${MACH_O_TYPE}" = "mh_execute" ] || \ |
| 27 [ "${PRODUCT_TYPE}" = "com.apple.product-type.tool" ] ; then | 27 [ "${PRODUCT_TYPE}" = "com.apple.product-type.tool" ] ; then |
| 28 # Strip everything (no special flags). No-op. | 28 # Strip everything (no special flags). No-op. |
| 29 true | 29 true |
| 30 elif [ "${MACH_O_TYPE}" = "mh_dylib" ] || \ | 30 elif [ "${MACH_O_TYPE}" = "mh_dylib" ] || \ |
| 31 "${MACH_O_TYPE}" = "mh_bundle" ]; then | 31 [ "${MACH_O_TYPE}" = "mh_bundle" ]; then |
| 32 # Strip debugging symbols and local symbols | 32 # Strip debugging symbols and local symbols |
| 33 FLAGS[${#FLAGS[@]}]=-S | 33 FLAGS[${#FLAGS[@]}]=-S |
| 34 FLAGS[${#FLAGS[@]}]=-x | 34 FLAGS[${#FLAGS[@]}]=-x |
| 35 elif [ "${MACH_O_TYPE}" = "staticlib" ] ; then | 35 elif [ "${MACH_O_TYPE}" = "staticlib" ] ; then |
| 36 # Don't strip static libraries. | 36 # Don't strip static libraries. |
| 37 exit 0 | 37 exit 0 |
| 38 else | 38 else |
| 39 # Warn, but don't treat this as an error. | 39 # Warn, but don't treat this as an error. |
| 40 echo $0: warning: unrecognized MACH_O_TYPE ${MACH_O_TYPE} | 40 echo $0: warning: unrecognized MACH_O_TYPE ${MACH_O_TYPE} |
| 41 exit 0 | 41 exit 0 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 53 # An Xcode project can communicate a file listing symbols to saved in this | 53 # An Xcode project can communicate a file listing symbols to saved in this |
| 54 # environment variable by setting it as a build setting. This isn't a | 54 # environment variable by setting it as a build setting. This isn't a |
| 55 # standard Xcode setting. It's used in preference to STRIPFLAGS to | 55 # standard Xcode setting. It's used in preference to STRIPFLAGS to |
| 56 # eliminate quoting ambiguity concerns. | 56 # eliminate quoting ambiguity concerns. |
| 57 FLAGS[${#FLAGS[@]}]=-s | 57 FLAGS[${#FLAGS[@]}]=-s |
| 58 FLAGS[${#FLAGS[@]}]="${CHROMIUM_STRIP_SAVE_FILE}" | 58 FLAGS[${#FLAGS[@]}]="${CHROMIUM_STRIP_SAVE_FILE}" |
| 59 fi | 59 fi |
| 60 | 60 |
| 61 exec "$(dirname ${0})/strip_save_dsym" "${FLAGS[@]}" \ | 61 exec "$(dirname ${0})/strip_save_dsym" "${FLAGS[@]}" \ |
| 62 "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" | 62 "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" |
| OLD | NEW |