-
Notifications
You must be signed in to change notification settings - Fork 23
/
build.sh
executable file
·47 lines (40 loc) · 1.48 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
#!/bin/sh -e
# This script runs one build with the setup environment variable CC (usually
# "gcc" or "clang").
: "${CC:=gcc}"
: "${TCPSLICE_TAINTED:=no}"
: "${MAKE_BIN:=make}"
# At least one OS (AIX 7) where this software can build does not have at least
# one command (mktemp) required for a successful run of "make releasetar".
: "${TEST_RELEASETAR:=yes}"
. ./build_common.sh
# Install directory prefix
if [ -z "$PREFIX" ]; then
PREFIX=`mktempdir tcpslice_build`
echo "PREFIX set to '$PREFIX'"
DELETE_PREFIX=yes
fi
print_cc_version
run_after_echo ./autogen.sh
run_after_echo ./configure --prefix="$PREFIX"
run_after_echo "$MAKE_BIN" -s clean
# If necessary, set TCPSLICE_TAINTED here to exempt particular builds from
# warnings. Use as specific terms as possible (e.g. some specific compiler and
# some specific OS).
[ "$TCPSLICE_TAINTED" != yes ] && CFLAGS=`cc_werr_cflags`
case `cc_id`/`os_id` in
clang-*/SunOS-5.11)
# Work around https://www.illumos.org/issues/16369
[ "`uname -o`" = illumos ] && grep -Fq OpenIndiana /etc/release && CFLAGS="-Wno-fuse-ld-path${CFLAGS:+ $CFLAGS}"
;;
esac
run_after_echo "$MAKE_BIN" -s ${CFLAGS:+CFLAGS="$CFLAGS"}
print_so_deps tcpslice
run_after_echo ./tcpslice -h
run_after_echo "$MAKE_BIN" install
[ "$TEST_RELEASETAR" = yes ] && run_after_echo "$MAKE_BIN" releasetar
handle_matrix_debug
if [ "$DELETE_PREFIX" = yes ]; then
run_after_echo rm -rf "$PREFIX"
fi
# vi: set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab autoindent :