Debian Codegraph @

docker/images/armabuild/build_libxml2.sh

raw
1 #!/bin/bash
2
3 # usage: build_libxml2.sh <name of liblxm2 directory>, e.g. libxml2-2.9.10
4
5 set -x
6 archive=$1
7
8 # if it already exists (Steam SDK), don't bother
9 test -r /usr/lib/libxml2.a && exit 0
10 test -r /usr/lib/x86_64-linux-gnu/libxml2.a && exit 0
11
12 # remove system provided libxml2
13 rm -f /usr/lib/libxml2.so.2 /usr/lib/x86_64-linux-gnu/libxml2.so.2 /usr/lib/i386-linux-gnu/libxml2.so.2
14
15 # fetch
16 curl ftp://xmlsoft.org/libxml2/${archive}.tar.gz -o ${archive}.tar.gz || exit $?
17
18 # unpack, configure, build, install, cleanup
19 tar -xzf ${archive}.tar.gz
20 rm ${archive}.tar.gz
21 cd ${archive}
22 CFLAGS=-Os ./configure --without-icu --without-python --prefix=/usr/ || exit $?
23 make -j 5 || exit $?
24 make install || exit $?
25 cd .. && rm -rf ${archive}
26