Skip to content
Newer
Older
100755 92 lines (83 sloc) 2.26 KB
89c1570 @mwh Bump known-good
authored Jun 23, 2011
1 #!/bin/bash
2
3 set -e
4 COMMIT=$1
5 ARCH=$2
2ab09bc @mwh Allow make-known-good to generate old-style too
authored Mar 26, 2012
6 FORM=$3
89c1570 @mwh Bump known-good
authored Jun 23, 2011
7
5c80a81 @mwh Update configure for Cygwin/--as-needed after bump
authored May 22, 2012
8 if [ "$COMMIT" = 33ff5ca19bfc5542fed0f22072676862660bf315 ]
9 then
10 echo -n "Checking for default -Wl,--as-needed... "
11 cat <<EOT >configure-$$.c
12 #include <dlfcn.h>
13
14 int main() {
15 dlopen(0, 0);
16 return 0;
17 }
18 EOT
19 if ! gcc -o configure-$$.x -ldl configure-$$.c >/dev/null 2>&1
20 then
21 echo "yes."
22 echo "Your system defaults to using -Wl,--as-needed. These systems"
23 echo "must bootstrap from a tarball."
24 echo "Use the tools/tarball-bootstrap script to do this."
25 rm -f configure-$$.*
26 exit 1
27 else
28 echo "no."
29 fi
30 echo -n "Checking for Cygwin..."
31 if uname | grep -qi CYGWIN
32 then
33 echo "yes."
34 echo "Cygwin systems must bootstrap from a tarball."
35 echo "Use the tools/tarball-bootstrap script to do this."
489ad2d @mwh Terminate make-known-good when Cygwin check says
authored May 22, 2012
36 exit 1
5c80a81 @mwh Update configure for Cygwin/--as-needed after bump
authored May 22, 2012
37 else
38 echo "no."
39 fi
40 fi
41
c1dc42e @mwh Fix systems without a gmake
authored Jun 23, 2011
42 if which gmake >/dev/null 2>&1
43 then
44 MAKE=gmake
45 else
46 MAKE=make
47 fi
48
89c1570 @mwh Bump known-good
authored Jun 23, 2011
49 cat >EXCLUDE <<EOT
50 pax_global_header
51 known-good
52 tests
53 EOT
54
a0c9ddd @mwh Allow static known-good
authored May 16, 2012
55 STATIC_BUILD=$(grep UNICODE_MODULE "$(git rev-parse --show-toplevel)/Makefile.conf" | grep gcn ; true)
c837336 @mwh Always cd to root in make-known-good
authored Mar 7, 2012
56 ( cd $(git rev-parse --show-toplevel) && git archive --prefix=tmp-$$/ $COMMIT ) | tar xf - -X EXCLUDE
89c1570 @mwh Bump known-good
authored Jun 23, 2011
57 cd tmp-$$
58 ln -s .. known-good
cc96b84 @mwh Make known-good include generation number
authored Apr 27, 2012
59 GEN=$( ( cd $(git rev-parse --show-toplevel) && tools/git-calculate-generation "$COMMIT" ) )
9b5cfaf @mwh Make known-good buildinfos public too
authored Jul 30, 2012
60 echo "#pragma DefaultVisibility=public" > buildinfo.gc
61 echo "method gitrevision() { \"$COMMIT\" }" >> buildinfo.gc
f7befb8 @mwh Don't clobber buildinfo in mkg
authored May 1, 2012
62 echo "method gitgeneration() { \"$GEN\" }" >> buildinfo.gc
1325ddf @mwh Rename files .gc->.grace
authored Jul 21, 2011
63 cp buildinfo.gc buildinfo.grace
a0c9ddd @mwh Allow static known-good
authored May 16, 2012
64 ./configure ${STATIC_BUILD:+--static}
c1dc42e @mwh Fix systems without a gmake
authored Jun 23, 2011
65 $MAKE l2/minigrace
89c1570 @mwh Bump known-good
authored Jun 23, 2011
66 cd ..
67
2ab09bc @mwh Allow make-known-good to generate old-style too
authored Mar 26, 2012
68 if [ "$FORM" = "hyphenated" ]
69 then
70 mkdir -p "$ARCH"
71 mv tmp-$$/l2/minigrace $ARCH/minigrace-$COMMIT
72 cp tmp-$$/l2/gracelib.o $ARCH/gracelib-$COMMIT.o
73 cp tmp-$$/l2/gracelib.h $ARCH/gracelib-$COMMIT.h
74 else
75 mkdir -p "$ARCH/$COMMIT"
76 mv tmp-$$/l2/minigrace $ARCH/$COMMIT
77 cp tmp-$$/l2/gracelib.o $ARCH/$COMMIT/gracelib.o
78 cp tmp-$$/l2/gracelib.h $ARCH/$COMMIT/gracelib.h
0b1b056 @mwh Pass other dynamic modules (mirrors) through MKG
authored Jul 30, 2012
79 for x in gracelib.a unicode.gso unicode.gcn mirrors.gso
a0c9ddd @mwh Allow static known-good
authored May 16, 2012
80 do
81 [ -e tmp-$$/l2/$x ] && cp tmp-$$/l2/$x $ARCH/$COMMIT/$x
82 done
2ab09bc @mwh Allow make-known-good to generate old-style too
authored Mar 26, 2012
83 fi
1cded08 @mwh Bump known-good
authored Dec 18, 2011
84 for x in tmp-$$/l2/*.c
89c1570 @mwh Bump known-good
authored Jun 23, 2011
85 do
86 nm=$(basename "$x")
87 nm=$(cut -d. -f1 <<<"$nm")
1cded08 @mwh Bump known-good
authored Dec 18, 2011
88 mv $x independent/$nm-$COMMIT.c
89c1570 @mwh Bump known-good
authored Jun 23, 2011
89 done
90
91 rm -rf tmp-$$ EXCLUDE
Something went wrong with that request. Please try again.