2 # Copyright 1999-2007 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4 # $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/files/fix_libtool_files.sh,v 1.14 2007/09/06 11:00:44 uberlord Exp $
8 Usage
: fix_libtool_files.sh
<old-gcc-version
> [--oldarch <old-CHOST
>]
10 Where
<old-gcc-version
> is the version number of the
11 previous gcc version. For example
, if you updated to
12 gcc-3.2
.1, and you had gcc-3.2 installed
, run
:
14 # fix_libtool_files.sh 3.2
16 If you updated to gcc-3.2
.3, and the old CHOST was i586-pc-linux-gnu
17 but you now have CHOST as i686-pc-linux-gnu
, run
:
19 # fix_libtool_files.sh 3.2 --oldarch i586-pc-linux-gnu
21 Note that
if only the CHOST and not the version changed
, you can run
22 it with the current version and the
'--oldarch <old-CHOST>' arguments
,
23 and it will
do the expected
:
25 # fix_libtool_files.sh `gcc -dumpversion` --oldarch i586-pc-linux-gnu
31 if [[ $2 != "--oldarch" && $# -ne 1 ]] || \
32 [[ $2 == "--oldarch" && $# -ne 3 ]]
41 source /etc
/profile ||
exit 1
42 source /etc
/init.d
/functions.sh ||
exit 1
44 if [[ ${EUID} -ne 0 ]] ; then
45 eerror
"${0##*/}: Must be root."
49 # make sure the files come out sane
52 if [[ ${ARGV2} == "--oldarch" ]] && [[ -n ${ARGV3} ]] ; then
58 AWKDIR
="/lib/rcscripts/awk"
60 if [[ ! -r ${AWKDIR}/fixlafiles.
awk ]] ; then
61 eerror
"${0##*/}: ${AWKDIR}/fixlafiles.awk does not exist!"
67 export OLDVER OLDCHOST
69 einfo
"Scanning libtool files for hardcoded gcc library paths..."
70 gawk
-f "${AWKDIR}/fixlafiles.awk"