use $(LIBENSCVECTOR) instead of libensc_vector.a
[util-vserver.git] / util-vserver / build-all
1 #! /bin/sh
2
3 # Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
4 #  
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; version 2 of the License.
8 #  
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 #  
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
18 set -e
19
20 confflags="-C --enable-maintainer-mode --prefix=/usr --sysconfdir=/etc --localstatedir=/var"
21 configure="`pwd`/configure $confflags"
22 make=eval\ "${CLEAN:+make -j2 silent.clean;} \
23             echo -e \"== executing 'make all'...\" && \
24             make -j2 ${SILENT:+-s silent.}all && \
25             echo -e \"\n== executing 'make check'...\" && \
26             make -j2 ${SILENT:+-s silent.}check"
27
28 LANG=C
29 CPPFLAGS='-D_FORTIFY_SOURCE=99'
30
31 ## Usage: xtermTitle <title>
32 function xtermTitle
33 {
34     tty -s || return 0
35     echo -ne "\e]0;$@\007"
36 }
37
38 ## Usage: operate <dir> <configure-opts>*
39 function operate()
40 {
41     d=$1
42     shift
43     
44     echo  "******************"
45     echo $"** Operating in directory '$d'..."
46     xtermTitle "Operating in directory '$d'... ($@)"
47     
48     mkdir -p $d && cd $d
49
50     test -e Makefile || $configure "$@"
51     $make
52     cd -
53 }
54
55 case "$1" in
56     dist)
57         test -e Makefile || \
58             CFLAGS='-O0 -g3' CXXFLAGS='-O0 -g3' CPPFLAGS=$CPPFLAGS \
59             ./configure $confflags
60         $make
61         exit
62         ;;
63     debian-woody|debian-sarge|fc-1-90|fc-1|fc-2|fc-3)
64         cat util-vserver-"$2".tar.bz2 | \
65             ssh $1 "cd /tmp && rm -rf /tmp/util-vserver-* && \
66                     tar xjf - && cd util-vserver-$2 && \
67                     export PATH=/usr/lib/ccache:/usr/lib/ccache/bin:\$PATH && \
68                         ./configure && \
69                     make ${SILENT:+-s silent.}all && \
70                     echo -e '\n\n\n' &&
71                     make ${SILENT:+-s silent.}check"
72         exit
73         ;;
74     *)  test -z "$1" || {
75             echo $"Unknown option '$1'" >&2
76             exit 1
77         }
78 esac
79
80 test -d "Build" || {
81     d=$(mktemp -d /tmp/build-ensc.XXXXXX)
82     rm -f Build
83     ln -sf $d Build
84 }
85
86 operate Build/diet-noopt                                       CPPFLAGS=$CPPFLAGS CFLAGS='-O0 -g3' CXXFLAGS='-O0 -g3'
87 operate Build/diet-opt     --enable-release                    CPPFLAGS=$CPPFLAGS
88 operate Build/nodiet-noopt --disable-dietlibc                  CPPFLAGS=$CPPFLAGS CFLAGS='-O0 -g3' CXXFLAGS='-O0 -g3' 
89 operate Build/nodiet-opt   --enable-release --disable-dietlibc CPPFLAGS=$CPPFLAGS
90 operate Build/gcc32-opt    --enable-release --disable-dietlibc CPPFLAGS=$CPPFLAGS CC='ccache gcc32'  CXX='ccache g++'
91 operate Build/gcc33-opt    --enable-release --disable-dietlibc CPPFLAGS=$CPPFLAGS CC='ccache gcc33'  CXX='ccache g++33'