-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuildlib.sh
executable file
·48 lines (43 loc) · 1.17 KB
/
buildlib.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
#!/bin/bash
if [ ! -d include ]; then mkdir include ; fi
if [ ! -d lib ]; then mkdir lib; fi
T=$PWD
if [ ! -e lib/libuseful.a ]; then
echo "building: libuseful.a"
cd ngtemplate/lib/libuseful/src
for f in *.c; do
gcc -Os -Iinclude -c $f
done
ar cr libuseful.a *.o
cp include/*.h $T/include
mv libuseful.a $T/lib
rm *.o
cd $T
fi
if [ ! -e lib/libngtemplate.a ]; then
echo "building: libngtemplate.a"
cd ngtemplate/src
for f in *.c; do
gcc -Os -Iinclude -I../../include -c $f
done
ar cr libngtemplate.a *.o
rm *.o
cp include/*.h $T/include
mv libngtemplate.a $T/lib
cd $T
fi
ld -lzzip 2>/dev/null
if [ $? -eq 1 ]; then
echo "building: libzzip"
wget -O zziplib-0.13.58.tar.bz2 http://sourceforge.net/projects/zziplib/files/zziplib13/0.13.58/zziplib-0.13.58.tar.bz2/download
tar jxf zziplib-0.13.58.tar.bz2
D=zziplib-0.13.58
(cd $D && ./configure && make) >/dev/null 2>&1
mkdir include/zzip
cp $D/zzip/zzip.h include
cp $D/zzip/*.h include/zzip
cp $D/Linux_*/zzip/_config.h include/zzip
cp $D/Linux_*/zzip/.libs/libzzip.a lib
rm -rf $D zziplib-*.tar.bz2
fi
rm -f a.out