Mercurial > hg > CbC > CbC_gcc
comparison gcc/config/print-sysroot-suffix.sh @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | 77e2b8dfacca |
children | 84e7813d76e9 |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 #! /bin/sh | 1 #! /bin/sh |
2 # Script to generate SYSROOT_SUFFIX_SPEC equivalent to MULTILIB_OSDIRNAMES | 2 # Script to generate SYSROOT_SUFFIX_SPEC equivalent to MULTILIB_OSDIRNAMES |
3 # Arguments are MULTILIB_OSDIRNAMES, MULTILIB_OPTIONS and MULTILIB_MATCHES. | 3 # Arguments are MULTILIB_OSDIRNAMES, MULTILIB_OPTIONS, MULTILIB_MATCHES, |
4 # and MULTILIB_REUSE. | |
4 | 5 |
5 # Copyright (C) 2009 Free Software Foundation, Inc. | 6 # Copyright (C) 2009-2017 Free Software Foundation, Inc. |
6 | 7 |
7 # This file is part of GCC. | 8 # This file is part of GCC. |
8 | 9 |
9 # GCC is free software; you can redistribute it and/or modify it under | 10 # GCC is free software; you can redistribute it and/or modify it under |
10 # the terms of the GNU General Public License as published by the Free | 11 # the terms of the GNU General Public License as published by the Free |
27 # Invocation: | 28 # Invocation: |
28 # print-sysroot-suffix.sh \ | 29 # print-sysroot-suffix.sh \ |
29 # MULTILIB_OSDIRNAMES \ | 30 # MULTILIB_OSDIRNAMES \ |
30 # MULTILIB_OPTIONS \ | 31 # MULTILIB_OPTIONS \ |
31 # MULTILIB_MATCHES \ | 32 # MULTILIB_MATCHES \ |
33 # MULTILIB_REUSE | |
32 # > t-sysroot-suffix.h | 34 # > t-sysroot-suffix.h |
33 | 35 |
34 # The three options exactly correspond to the variables of the same | 36 # The four options exactly correspond to the variables of the same |
35 # names defined in the tmake_file fragments. | 37 # names defined in the t-sysroot-suffix tmake_file fragment. |
36 | 38 |
37 # Example: | 39 # Example: |
38 # sh ./gcc/config/print-sysroot-suffix.sh "a=A" "a b/c/d" "" | 40 # sh ./gcc/config/print-sysroot-suffix.sh "a=A" "a b/c/d" "" |
39 # => | 41 # => |
40 # #undef SYSROOT_SUFFIX_SPEC | 42 # #undef SYSROOT_SUFFIX_SPEC |
52 set -e | 54 set -e |
53 | 55 |
54 dirnames="$1" | 56 dirnames="$1" |
55 options="$2" | 57 options="$2" |
56 matches="$3" | 58 matches="$3" |
59 reuse="$4" | |
57 | 60 |
58 cat > print-sysroot-suffix3.sh <<\EOF | 61 cat > print-sysroot-suffix3.sh <<\EOF |
59 #! /bin/sh | 62 #! /bin/sh |
60 # Print all the multilib matches for this option | 63 # Print all the multilib matches for this option |
61 result="$1" | 64 result="$1" |
78 optstring="$2" | 81 optstring="$2" |
79 shift 2 | 82 shift 2 |
80 n="\" \\ | 83 n="\" \\ |
81 $padding\"" | 84 $padding\"" |
82 if [ $# = 0 ]; then | 85 if [ $# = 0 ]; then |
86 case $optstring in | |
83 EOF | 87 EOF |
88 for x in $reuse; do | |
89 l=`echo $x | sed -e 's/=.*$//' -e 's/\./=/g'` | |
90 r=`echo $x | sed -e 's/^.*=//' -e 's/\./=/g'` | |
91 echo "/$r/) optstring=\"/$l/\" ;;" >> print-sysroot-suffix2.sh | |
92 done | |
93 echo " esac" >> print-sysroot-suffix2.sh | |
84 | 94 |
85 pat= | 95 pat= |
86 for x in $dirnames; do | 96 for x in $dirnames; do |
87 p=`echo $x | sed -e 's,=!,/$=/,'` | 97 p=`echo $x | sed -e 's,=!,/$=/,'` |
88 pat="$pat -e 's=^//$p='" | 98 pat="$pat -e 's=^//$p='" |