blob: 4b3bda9cb20750b1e17d023631db7acb1732330b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
#! /bin/sh
if [ $# != 2 ]
then
echo 'usage: libconvert from.a to.a'
exit 1
fi
fromlib=$1
tolib=$2
#
# Convert coff libc to a coff-encapsulated libc
# suitable for linking with the GNU linker.
#
# Extract all members of /lib/libc.a (using coff ar).
# Convert each using robotussin.
# Create new libc (using gnu ar) with members in the same order as coff libc.
# set -e makes this script exit if any command gets an error
set -e
case $fromlib in
/*) rel_fromlib=$fromlib ;;
*) rel_fromlib=../$fromlib ;;
esac
case $tolib in
/*) rel_tolib=$tolib ;;
*) rel_tolib=../$tolib ;;
esac
rm -rf libconvert-tmp
mkdir libconvert-tmp
cd libconvert-tmp
/bin/ar x $rel_fromlib
for i in *
do
echo $i
../robotussin $i x
mv x $i
done
rm -f $rel_tolib
../ar rs $rel_tolib `/bin/ar t $rel_fromlib`
cd ..
rm -rf libconvert-tmp
|