summaryrefslogtreecommitdiff
path: root/drv/mi/gen_mi_files
blob: ecfd2b93b218fd1a032f0ce9636cc616c148897e (plain)
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
47
48
#! /bin/sh

for i in `cat $1`
do
	cp ../../mi/$i drv$i
	OBJ=../../mi/.libs/`basename $i .c`.o
	if [ -e $OBJ ]; then
	    nm --defined-only --format=posix $OBJ | grep " T" | cut -f1 -d' ' >> mi-exported-syms.txt
	fi
done

sort mi-exported-syms.txt | uniq > mi-sorted-exported-syms.txt
mv mi-sorted-exported-syms.txt mi-exported-syms.txt

# generate a sed script
echo "" > mi.sed

for i in `cat mi-exported-syms.txt`
do
    echo "s/"$i"/drv"$i"/g" >> mi.sed
done
cat ../dix.sed >> mi.sed
for i in `cat ../dix-symbols.txt`
do
    echo "s/"$i"/drv"$i"/g" >> mi.sed
done

echo "s/mi\.h/drv_mi.h/g" >> mi.sed
echo "s/miClearDrawable/drvClearPixmap/g" >> mi.sed
echo "s/miZeroArcRec/drvmiZeroArcRec/g" >> mi.sed
echo "s/miZeroArcPtRec/drvmiZeroArcPtRec/g" >> mi.sed
echo "s/miGetZeroLineBias/drvmiGetZeroLineBias/g" >> mi.sed
echo "s/miCanZeroArc/drvmiCanZeroArc/g" >> mi.sed
echo "s/miGlyphs/drvmiGlyphs/g" >> mi.sed
echo "s/midrv/mi/g" >> mi.sed

for i in `cat $1 | grep \.h$`
do
    echo "s/"$i"/drv"$i"/g" >> mi.sed
done
#sed -i -e's/^mi/drvmi/' mi-exported-syms.txt

for j in `cat $1`
do
    sed -f mi.sed -i drv$j
done