[8c5326]: build-util.sh Maximize Restore History

Download this file

build-util.sh    74 lines (66 with data), 1.4 kB

 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
61
62
63
64
65
66
67
68
69
70
71
72
73
download_file(){
cd "$SRCDIR"
if test ! -f $3 && test ! -f $2; then
echo "Downloading $1"
curl -L "$1" -o $2
if test ! -f $2 ; then
echo "Could not download $2"
exit 1
fi
else
echo "Found $2 in the srcdir $SRCDIR"
fi
cd "$TOPDIR"
}
gunzip_file(){
# unzip_file $1 $2 gunzip
cd "$SRCDIR"
if test -f $1 && test ! -f $2; then
echo "gunzip $1"
gunzip "$1"
fi
cd "$TOPDIR"
}
bunzip_file(){
# unzip_file $1 $2 bunzip2
cd "$SRCDIR"
if test -f $1 && test ! -f $2; then
echo "bunzip2 $1"
bunzip2 "$1"
fi
cd "$TOPDIR"
}
untar_file(){
cd "$SRCDIR"
if test -f $1 && test ! -L $3 ; then
echo "UnTar $1"
tar -xf "$1"
DIR=`basename $2`
ln -s $DIR $3
echo $DIR
fi
cd "$TOPDIR"
}
configure_file(){
cd "$SRCDIR/$1"
echo "Configuring $1"
"./configure" --prefix="$SRCDIR/$BUILDDIR/$1" --enable-shared --disable-static $2 > configure-$1.log
cd "$TOPDIR"
}
build_file(){
cd "$SRCDIR/$1"
echo "Building $1"
make install > make-$1.log
if test $? -ne 0; then
echo "make failed - log available: $1/make-$1.log"
exit 1
fi
cd "$TOPDIR"
}
rename_file(){
cd $SRCDIR/$BUILDDIR/$1
if test -f $2.a ; then
mv $2.a $2.lib
fi
cd "$TOPDIR"
}