forked from gluster/glusterfs-patch-acceptance-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·41 lines (36 loc) · 907 Bytes
/
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
#!/usr/bin/env bash
set -e
# needed for freebsd
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"
SRC=$(pwd);
# Get platform-specific values.
case $(uname -s) in
'Linux')
nproc=$(getconf _NPROCESSORS_ONLN)
bd="yes"
werror="-Werror"
;;
'NetBSD')
nproc=$(getconf NPROCESSORS_ONLN)
bd="no"
werror=""
;;
*)
nproc=4
bd="no"
werror=""
esac
if type rpm >/dev/null 2>&1; then
rpm -qa | grep glusterfs | xargs --no-run-if-empty rpm -e
fi
./autogen.sh;
P=/build;
rm -rf $P/scratch;
mkdir -p $P/scratch;
cd $P/scratch;
rm -rf $P/install;
$SRC/configure --prefix=$P/install --with-mountutildir=$P/install/sbin \
--with-initdir=$P/install/etc --localstatedir=/var \
--enable-bd-xlator=${bd} --enable-debug --silent
make install CFLAGS="-g -O0 -Wall ${werror}" -j ${nproc}
cd $SRC;