Lines 6-29
Link Here
|
6 |
|
6 |
|
7 |
usage() { |
7 |
usage() { |
8 |
cat << "USAGE_END" |
8 |
cat << "USAGE_END" |
9 |
Usage: fix_libtool_files.sh <old-gcc-version> [--oldarch <old-CHOST>] |
9 |
Usage: fix_libtool_files.sh [--help] [--oldarch <old-CHOST>] |
10 |
|
10 |
|
11 |
Where <old-gcc-version> is the version number of the |
11 |
This program will update all the references to a version of |
12 |
previous gcc version. For example, if you updated to |
12 |
gcc to the curently used one. |
13 |
gcc-3.2.1, and you had gcc-3.2 installed, run: |
13 |
For example, if you updated to gcc-3.2.1, and you had gcc-3.2 installed, run: |
14 |
|
14 |
|
15 |
# fix_libtool_files.sh 3.2 |
15 |
# fix_libtool_files.sh |
16 |
|
16 |
|
17 |
If you updated to gcc-3.2.3, and the old CHOST was i586-pc-linux-gnu |
17 |
If also you CHOST has changed, you have to specify the old one. |
18 |
but you now have CHOST as i686-pc-linux-gnu, run: |
18 |
For example, if you updated to gcc-3.2.3, and the old CHOST was |
|
|
19 |
i586-pc-linux-gnu but you now have CHOST as i686-pc-linux-gnu, run: |
19 |
|
20 |
|
20 |
# fix_libtool_files.sh 3.2 --oldarch i586-pc-linux-gnu |
21 |
# fix_libtool_files.sh --oldarch i586-pc-linux-gnu |
21 |
|
22 |
|
22 |
Note that if only the CHOST and not the version changed, you can run |
|
|
23 |
it with the current version and the '--oldarch <old-CHOST>' arguments, |
24 |
and it will do the expected: |
25 |
|
26 |
# fix_libtool_files.sh `gcc -dumpversion` --oldarch i586-pc-linux-gnu |
27 |
|
23 |
|
28 |
|
24 |
|
29 |
USAGE_END |
25 |
USAGE_END |
Lines 31-45
Link Here
|
31 |
exit 1 |
27 |
exit 1 |
32 |
} |
28 |
} |
33 |
|
29 |
|
34 |
if [ "$2" != "--oldarch" -a "$#" -ne 1 ] || \ |
30 |
if [ "$1" = "--help" ] || \ |
35 |
[ "$2" = "--oldarch" -a "$#" -ne 3 ] |
31 |
[ "$1" = "--oldarch" -a "$#" -ne 2 ] |
36 |
then |
32 |
then |
37 |
usage |
33 |
usage |
38 |
fi |
34 |
fi |
39 |
|
35 |
|
40 |
ARGV1="$1" |
36 |
ARGV1="$1" |
41 |
ARGV2="$2" |
37 |
ARGV2="$2" |
42 |
ARGV3="$3" |
|
|
43 |
|
38 |
|
44 |
source /etc/profile |
39 |
source /etc/profile |
45 |
source /sbin/functions.sh |
40 |
source /sbin/functions.sh |
Lines 50-76
Link Here
|
50 |
exit 1 |
45 |
exit 1 |
51 |
fi |
46 |
fi |
52 |
|
47 |
|
53 |
if [ "${ARGV2}" = "--oldarch" -a "x${ARGV3}" != "x" ] |
48 |
if [ "${ARGV1}" = "--oldarch" -a "x${ARGV2}" != "x" ] |
54 |
then |
49 |
then |
55 |
OLDCHOST="${ARGV3}" |
50 |
OLDCHOST="${ARGV2}" |
56 |
else |
51 |
else |
57 |
OLDCHOST= |
52 |
OLDCHOST= |
58 |
fi |
53 |
fi |
59 |
|
54 |
|
60 |
AWKDIR="/lib/rcscripts/awk" |
55 |
PORTAGEBINDIR="/usr/lib/portage/bin" |
61 |
|
56 |
|
62 |
if [ ! -r "${AWKDIR}/fixlafiles.awk" ] |
57 |
if [ ! -r "${PORTAGEBINDIR}/fixlafiles.py" ] |
63 |
then |
58 |
then |
64 |
eerror "${0##*/}: ${AWKDIR}/fixlafiles.awk does not exist!" |
59 |
eerror "${0##*/}: ${PORTAGEBINDIR}/fixlafiles.py does not exist!" |
65 |
exit 1 |
60 |
exit 1 |
66 |
fi |
61 |
fi |
67 |
|
62 |
|
68 |
OLDVER="${ARGV1}" |
63 |
export OLDCHOST |
69 |
|
|
|
70 |
export OLDVER OLDCHOST |
71 |
|
64 |
|
72 |
einfo "Scanning libtool files for hardcoded gcc library paths..." |
65 |
einfo "Scanning libtool files for hardcoded gcc library paths..." |
73 |
/bin/gawk -f "${AWKDIR}/fixlafiles.awk" |
66 |
${PORTAGEBINDIR}/fixlafiles.py |
74 |
|
67 |
|
75 |
|
68 |
|
76 |
# vim:ts=4 |
69 |
# vim:ts=4 |