OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 # Creates a stripped copy of a library and a link to the unstripped copy. | 6 # Creates a stripped copy of a library for inclusion in an apk. |
7 # The stripped copy is included in the apk and the link is needed for the crash | |
8 # stack annotation tool. | |
9 | 7 |
10 if [[ $# -ne 4 ]] | 8 if [[ $# -ne 3 ]] |
11 then | 9 then |
12 echo "Usage: prepare_library_for_apk android_strip path/to/library stripped/li
brary/output/path link/output/path" | 10 echo "Usage: prepare_library_for_apk android_strip path/to/library stripped/li
brary/output/path" |
13 exit 1 | 11 exit 1 |
14 fi | 12 fi |
15 | 13 |
16 ANDROID_STRIP=$1 | 14 ANDROID_STRIP=$1 |
17 LIBRARY=$2 | 15 LIBRARY=$2 |
18 STRIPPED=$3 | 16 STRIPPED=$3 |
19 LINK=$4 | |
20 | 17 |
21 set -x | 18 set -ex |
22 mkdir -p $LINK | |
23 $ANDROID_STRIP --strip-unneeded $LIBRARY -o $STRIPPED | 19 $ANDROID_STRIP --strip-unneeded $LIBRARY -o $STRIPPED |
24 ln -f $LIBRARY $LINK | |
OLD | NEW |