-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathcompile_libvirt-git-snapshot.sh
65 lines (50 loc) · 1.39 KB
/
compile_libvirt-git-snapshot.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
61
62
63
64
65
#!/bin/sh -ex
. utilslib.sh
basedir=/src/libvirt
baseurl=http://libvirt.org/sources
tarball=libvirt-git-snapshot.tar.gz
directory=libvirt-git-snapshot
patch=libvirt-git-snapshot-mingw.patch
mkdir -p $basedir
pushd $basedir
utilslib_download $baseurl $tarball
if [ ! -d $directory ]
then
echo unpacking $tarball ...
mkdir -p $directory
tar -xvf $tarball -C $directory --strip-components=1
fi
pushd $directory
if [ ! -f mingw.patch.applied ]
then
echo patching ...
patch -p1 < ../../$patch
echo applied > mingw.patch.applied
fi
if [ -d /include/libvirt ]
then
# remove previously installed libvirt header files. specifying -I/include
# makes the build pickup the old headers instead of it's own files.
# removing the old header files is a simple workaround for this problem.
rm -r /include/libvirt
fi
if [ ! -f configure.done ]
then
CFLAGS=-I/include\ -g\ -ggdb\ -O0\ -march=i686 \
LDFLAGS=-L/lib \
./configure --prefix= \
--enable-debug=yes \
--without-xen \
--without-libvirtd \
--without-openvz \
--without-lxc \
--without-phyp \
--with-python
echo done > configure.done
fi
make
make install
# copy libvirtmod.dll to the correct place so python will find it
cp /python/Lib/site-packages/libvirtmod.dll /python/DLLs/libvirtmod.pyd
popd
popd