-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathbuild-all
executable file
·110 lines (93 loc) · 3.74 KB
/
build-all
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#! /bin/sh
# Copyright (C) 2004,2005,2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
set -e
BDIR=Build-$(hostname)
J=-j8
confflags="-C --enable-maintainer-mode --prefix=/usr --sysconfdir=/etc --localstatedir=/var $CONFIGURE_FLAGS"
configure="`pwd`/configure $confflags"
make=eval\ "${CLEAN:+make $J silent.clean;} \
echo -e \"== executing 'make all'...\" && \
make $J ${SILENT:+-s silent.}all && \
echo -e \"\n== executing 'make check'...\" && \
make $J ${SILENT:+-s silent.}check"
LANG=C
case $(arch) in
(x86_64) ARCH_CFLAGS=' -m64';;
(i?86) ARCH_CFLAGS=' -m32';;
esac
CPPFLAGS=-D_FORTIFY_SOURCE=99$ARCH_CFLAGS
## Usage: xtermTitle <title>
function xtermTitle
{
tty -s || return 0
echo -ne "\e]0;$@\007"
}
## Usage: operate <dir> <configure-opts>*
function operate()
{
d=$1
shift
echo "******************"
echo $"** Operating in directory '$d'..."
xtermTitle "Operating in directory '$d'... ($@)"
mkdir -p $d && cd $d
test -z "$CLEAN" || rm -f config.cache
test -e Makefile -a -z "$CONFIGURE_FLAGS"|| CCACHE_DISABLE=1 $configure "$@"
$make
cd -
}
case "$1" in
dist)
test -e Makefile || \
env \
CFLAGS="-O0 -g3$ARCH_CFLAGS" \
CXXFLAGS="-O0 -g3$ARCH_CFLAGS" \
CPPFLAGS="$CPPFLAGS" \
./configure $confflags
$make
exit
;;
debian-woody|debian-sarge|fc-1-90|fc-1|fc-2|fc-3)
cat util-vserver-"$2".tar.bz2 | \
ssh $1 "cd /tmp && rm -rf /tmp/util-vserver-* && \
tar xjf - && cd util-vserver-$2 && \
export PATH=/usr/lib/ccache:/usr/lib/ccache/bin:\$PATH && \
./configure && \
make ${SILENT:+-s silent.}all && \
echo -e '\n\n\n' &&
make ${SILENT:+-s silent.}check"
exit
;;
*) test -z "$1" || {
echo $"Unknown option '$1'" >&2
exit 1
}
esac
test -d "$BDIR" || {
d=$(mktemp -t -d build-ensc.XXXXXX)
rm -f $BDIR
ln -sf $d $BDIR
}
noopt_flags=-O0\ -g3\ -U_FORTIFY_SOURCE
opt_flags=-O2\ -g
ldflags=$ARCH_CFLAGS
operate $BDIR/diet-noopt CPPFLAGS="$CPPFLAGS" CFLAGS="$noopt_flags" CXXFLAGS="$noopt_flags" LDFLAGS="$ldflags"
operate $BDIR/diet-opt --enable-release CPPFLAGS="$CPPFLAGS" CFLAGS="$opt_flags" CXXFLAGS="$opt_flags" LDFLAGS="$ldflags"
operate $BDIR/nodiet-noopt --disable-dietlibc CPPFLAGS="$CPPFLAGS" CFLAGS="$noopt_flags" CXXFLAGS="$noopt_flags" LDFLAGS="$ldflags"
operate $BDIR/nodiet-opt --enable-release --disable-dietlibc CPPFLAGS="$CPPFLAGS" CFLAGS="$opt_flags" CXXFLAGS="$opt_flags" LDFLAGS="$ldflags"
#operate $BDIR/gcc32-opt --enable-release --disable-dietlibc CPPFLAGS="$CPPFLAGS" CC='ccache gcc32' CXX='ccache g++' CFLAGS="$opt_flags" CXXFLAGS="$opt_flags" LDFLAGS="$ldflags"
operate $BDIR/diet-opt-api --enable-release --enable-apis=NOLEGACY CPPFLAGS="$CPPFLAGS" CFLAGS="$opt_flags" CXXFLAGS="$opt_flags" LDFLAGS="$ldflags"
operate $BDIR/nodiet-opt-api --enable-release --enable-apis=NOLEGACY --disable-dietlibc CPPFLAGS="$CPPFLAGS" CFLAGS="$opt_flags" CXXFLAGS="$opt_flags" LDFLAGS="$ldflags"