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 echo "$included_files" | grep -qs ^/ |
50 for inc_file in $included_files; do | 50 if [ $? -eq 0 ]; then |
51 echo $inc_file | grep -qs ^/ | 51 if ls $root$included_files >/dev/null 2>&1 ; then |
52 if [ $? -eq 0 ]; then | 52 for inc_file in $root$included_files; do |
53 process_ld_so_conf "$root" "$root$inc_file" | 53 process_ld_so_conf "$root" "$inc_file" |
54 else | 54 done |
55 process_ld_so_conf "$root" "$(pwd)/$inc_file" | 55 fi |
56 fi | 56 else |
57 done | 57 if ls $(pwd)/$included_files >/dev/null 2>&1 ; then |
| 58 for inc_file in $(pwd)/$included_files; do |
| 59 process_ld_so_conf "$root" "$inc_file" |
| 60 done |
| 61 fi |
58 fi | 62 fi |
59 continue | 63 continue |
60 fi | 64 fi |
61 | 65 |
62 echo "$ENTRY" | grep -qs ^/ | 66 echo "$ENTRY" | grep -qs ^/ |
63 if [ $? -eq 0 ]; then | 67 if [ $? -eq 0 ]; then |
64 process_entry "$root" "$ENTRY" | 68 process_entry "$root" "$ENTRY" |
65 fi | 69 fi |
66 done | 70 done |
67 | 71 |
(...skipping 19 matching lines...) Expand all Loading... |
87 if [ -e "$LD_SO_CONF" ]; then | 91 if [ -e "$LD_SO_CONF" ]; then |
88 process_ld_so_conf "$1" "$LD_SO_CONF" | xargs echo | 92 process_ld_so_conf "$1" "$LD_SO_CONF" | xargs echo |
89 elif [ -e "$LD_SO_CONF_D" ]; then | 93 elif [ -e "$LD_SO_CONF_D" ]; then |
90 find "$LD_SO_CONF_D" -maxdepth 1 -name '*.conf' -print -quit > /dev/null | 94 find "$LD_SO_CONF_D" -maxdepth 1 -name '*.conf' -print -quit > /dev/null |
91 if [ $? -eq 0 ]; then | 95 if [ $? -eq 0 ]; then |
92 for entry in $LD_SO_CONF_D/*.conf; do | 96 for entry in $LD_SO_CONF_D/*.conf; do |
93 process_ld_so_conf "$1" "$entry" | 97 process_ld_so_conf "$1" "$entry" |
94 done | xargs echo | 98 done | xargs echo |
95 fi | 99 fi |
96 fi | 100 fi |
OLD | NEW |