forked from haojiangwang/tcltk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compile-performance.sh
executable file
·60 lines (50 loc) · 1.46 KB
/
compile-performance.sh
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
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash -e
## module
MODULE=performance
## load defaults
. ./common.sh
## print
echo "** Compiling $MODULE"
## delete whole compile sources and start from new
if [ -n "$SW_CLEANUP" ]; then
echo -n "Deleting old sources ... "
rm -rf $COMPILEDIR/$MODULE
echo done
fi
## copy source to temp compile path
if [ ! -d $COMPILEDIR/$MODULE ] || [ -n "$SW_FORCECOPY" ]; then
echo -n "Copying new sources ... "
rsync -a $INTSRCDIR/$MODULE $COMPILEDIR/
echo done
fi
## change to compile dir
cd $COMPILEDIR/$MODULE
## configure and make
export INSTALLDIR
if [ -z "$WINDIR" ]; then
make -f Makefile.lin.release
else
make -f Makefile.win.release
fi
## get version number of module
echo -n "Loading $MODULE package ... "
cd $COMPILEDIR/$MODULE/$OUTDIR
echo "load [file join [pwd] libperformance$LIBEXT]" > version.tcl
echo "puts [package re Performance]" >> version.tcl
echo "exit" >> version.tcl
VERSION=$($INSTALLDIR/bin/$WISH version.tcl)
rm ./version.tcl
echo done
## install module
echo -n "Installing ... "
mkdir -p $INSTALLDIR/lib/performance$VERSION
cd $INSTALLDIR/lib/performance$VERSION
echo "package ifneeded Performance $VERSION [list load [file join \$dir libperformance$LIBEXT] performance]" > pkgIndex.tcl
cp $COMPILEDIR/$MODULE/$OUTDIR/libperformance$LIBEXT .
echo done
## copy licence file
echo -n "Copying extras ... "
rsync -a $INTSRCDIR/$MODULE/licence.txt $iLICENCEDIR/$MODULE.licence
echo done
## fini
echo "** Finished compile-$MODULE."