OLD | NEW |
---|---|
1 #!/bin/sh | 1 #!/bin/sh |
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 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 # Reads etc/ld.so.conf and/or etc/ld.so.conf.d/*.conf and returns the | 6 # Reads etc/ld.so.conf and/or etc/ld.so.conf.d/*.conf and returns the |
7 # appropriate linker flags. | 7 # appropriate linker flags. |
8 # | 8 # |
9 # sysroot_ld_path.sh /abspath/to/sysroot | 9 # sysroot_ld_path.sh /abspath/to/sysroot |
10 # | 10 # |
(...skipping 28 matching lines...) Expand all Loading... | |
39 | 39 |
40 # ld.so.conf may include relative include paths. pushd is a bashism. | 40 # ld.so.conf may include relative include paths. pushd is a bashism. |
41 local saved_pwd=$(pwd) | 41 local saved_pwd=$(pwd) |
42 cd $(dirname "$ld_so_conf") | 42 cd $(dirname "$ld_so_conf") |
43 | 43 |
44 cat "$ld_so_conf" | \ | 44 cat "$ld_so_conf" | \ |
45 while read ENTRY; do | 45 while read ENTRY; do |
46 echo "$ENTRY" | grep -qs ^include | 46 echo "$ENTRY" | grep -qs ^include |
47 if [ $? -eq 0 ]; then | 47 if [ $? -eq 0 ]; then |
48 local included_files=$(echo "$ENTRY" | sed 's/^include //') | 48 local included_files=$(echo "$ENTRY" | sed 's/^include //') |
49 if ls $included_files >/dev/null 2>&1 ; then | 49 if ls $root$included_files >/dev/null 2>&1 ; then |
Lei Zhang
2014/02/13 09:26:19
In the absolute case, $included_files = /foo/*, we
| |
50 for inc_file in $included_files; do | 50 for inc_file in $root$included_files; do |
51 echo $inc_file | grep -qs ^/ | 51 echo $inc_file | grep -qs ^/ |
52 if [ $? -eq 0 ]; then | 52 if [ $? -eq 0 ]; then |
53 process_ld_so_conf "$root" "$root$inc_file" | 53 process_ld_so_conf "$root" "$inc_file" |
54 else | 54 else |
55 process_ld_so_conf "$root" "$(pwd)/$inc_file" | 55 process_ld_so_conf "$root" "$(pwd)/$inc_file" |
56 fi | 56 fi |
57 done | 57 done |
58 fi | 58 fi |
59 continue | 59 continue |
60 fi | 60 fi |
61 | 61 |
62 echo "$ENTRY" | grep -qs ^/ | 62 echo "$ENTRY" | grep -qs ^/ |
63 if [ $? -eq 0 ]; then | 63 if [ $? -eq 0 ]; then |
(...skipping 23 matching lines...) Expand all Loading... | |
87 if [ -e "$LD_SO_CONF" ]; then | 87 if [ -e "$LD_SO_CONF" ]; then |
88 process_ld_so_conf "$1" "$LD_SO_CONF" | xargs echo | 88 process_ld_so_conf "$1" "$LD_SO_CONF" | xargs echo |
89 elif [ -e "$LD_SO_CONF_D" ]; then | 89 elif [ -e "$LD_SO_CONF_D" ]; then |
90 find "$LD_SO_CONF_D" -maxdepth 1 -name '*.conf' -print -quit > /dev/null | 90 find "$LD_SO_CONF_D" -maxdepth 1 -name '*.conf' -print -quit > /dev/null |
91 if [ $? -eq 0 ]; then | 91 if [ $? -eq 0 ]; then |
92 for entry in $LD_SO_CONF_D/*.conf; do | 92 for entry in $LD_SO_CONF_D/*.conf; do |
93 process_ld_so_conf "$1" "$entry" | 93 process_ld_so_conf "$1" "$entry" |
94 done | xargs echo | 94 done | xargs echo |
95 fi | 95 fi |
96 fi | 96 fi |
OLD | NEW |