-
Notifications
You must be signed in to change notification settings - Fork 2
/
BUILD.sh
executable file
·57 lines (45 loc) · 1.2 KB
/
BUILD.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
#!/bin/bash
echo "Building pyzabbix environment"
export XML2_INC=`xml2-config --cflags`
if [ -z $XML2_INC ]; then
echo "xml2-devel package not installed"
exit 1
fi
export PY_INC=`python-config --includes`
if [ -z "$PY_INC" ]; then
echo "python-devel package not installed"
exit 1
fi
export PY_LIB=`python-config --libs`
if [ -z "$PY_LIB" ]; then
echo "python-devel package not installed"
exit 1
fi
export ZBX_DIR=`find ../.. -type d -name zabbix-*|head -1`
if [ -z "$ZBX_DIR" ]; then
echo "No Zabbix source tree found in $HOME"
exit 1
else
echo "Will compile against Zabbix from $ZBX_DIR"
fi
echo "Checking if Sorce tree was configured"
if [ -f $ZBX_DIR/include/config.h ]; then
echo "Zabbix source tree already configured" ;
else
echo "Configuring Zabbix "; (cd $ZBX_DIR; ./configure --quiet --enable-agent; cd -);
fi
echo -n "Building python.cfg "
echo -n "PYTHONPATH=" > python.cfg
python -c "import sys; print ':'.join(sys.path)" >> python.cfg
echo -n "PYTHONLIB=" >> python.cfg
ldd `type -p python`|grep python|cut -f 3 -d " " >> python.cfg
if [ -s python.cfg ]; then
echo " ok"
else
echo "fail"
exit 1
fi
echo "Building python.so"
set -x
make -e all
set +x