MAP calls SB-SEQUENCE:MAP for extended sequences
[sbcl.git] / make-target-contrib.sh
blobaf9df82b255ebdcef112588d4c44891cddbb5024
1 #!/bin/sh
2 set -e
4 # This is a script to be run as part of make.sh. The only time you'd
5 # probably want to run it by itself is if you're cross-compiling the
6 # system or doing some kind of troubleshooting.
8 # This software is part of the SBCL system. See the README file for
9 # more information.
11 # This software is derived from the CMU CL system, which was
12 # written at Carnegie Mellon University and released into the
13 # public domain. The software is in the public domain and is
14 # provided with absolutely no warranty. See the COPYING and CREDITS
15 # files for more information.
17 echo //entering make-target-contrib.sh
19 LANG=C
20 LC_ALL=C
22 # Just doing CC=${CC:-cc} may be enough, but it needs to be checked
23 # that cc is available on all platforms.
24 if [ -z $CC ]; then
25 if [ -x "`which cc`" ]; then
26 CC=cc
27 else
28 CC=gcc
31 export CC LANG LC_ALL
33 # Load our build configuration
34 . output/build-config
36 . ./sbcl-pwd.sh
37 sbcl_pwd
39 SBCL_HOME="$SBCL_PWD/obj/sbcl-home"
40 export SBCL_HOME SBCL_PWD
41 if [ "$OSTYPE" = "cygwin" ] ; then
42 SBCL_PWD=`echo $SBCL_PWD | sed s/\ /\\\\\\\\\ /g`
45 SBCL="$SBCL_PWD/src/runtime/sbcl --noinform --core $SBCL_PWD/output/sbcl.core \
46 --lose-on-corruption --disable-debugger --no-sysinit --no-userinit"
47 SBCL_BUILDING_CONTRIB=1
48 export SBCL SBCL_BUILDING_CONTRIB
50 # deleting things here lets us not worry about interaction with stale
51 # fasls. This is not good, but is better than :FORCE on each asdf
52 # operation, because that causes multiple builds of base systems such
53 # as SB-RT and SB-GROVEL, but FIXME: there's probably a better
54 # solution. -- CSR, 2003-05-30
55 if [ -z "$DONT_CLEAN_SBCL_CONTRIB" ] ; then
56 find contrib/ obj/asdf-cache/ obj/sbcl-home/contrib/ \
57 \( -name '*.fasl' -o \
58 -name '*.FASL' -o \
59 -name 'foo.c' -o \
60 -name 'FOO.C' -o \
61 -name 'a.out' -o \
62 -name 'A.OUT' -o \
63 -name 'alien.so' -o \
64 -name 'ALIEN.SO' -o \
65 -name '*.o' -o \
66 -name '*.O' \) \
67 -print | xargs rm -f
70 find output -name 'building-contrib.*' -print | xargs rm -f
72 # Ignore all source registries.
73 if [ -z "$*" ]; then
74 contribs_to_build="`cd contrib ; echo *`"
75 else
76 contribs_to_build="$*"
79 for i in $contribs_to_build; do
80 test -d contrib/$i && test -f contrib/$i/Makefile || continue;
81 test -f contrib/$i/test-passed && rm contrib/$i/test-passed # remove old convention
82 test -f obj/asdf-cache/$i/test-passed.test-report && rm obj/asdf-cache/$i/test-passed.test-report
83 mkdir -p obj/asdf-cache/$i/
84 # hack to get exit codes right.
85 if $GNUMAKE -C contrib/$i test < /dev/null 2>&1 && touch obj/asdf-cache/$i/test-passed.test-report ; then
87 else
88 exit $?
89 fi | tee output/building-contrib.`basename $i`
90 done
92 # Otherwise report expected failures:
93 HEADER_HAS_BEEN_PRINTED=false
94 for dir in `cd obj/asdf-cache/ ; echo *`; do
95 f="obj/asdf-cache/$dir/test-passed.test-report"
96 if test -f "$f" && grep -i fail "$f" >/dev/null; then
97 if ! $HEADER_HAS_BEEN_PRINTED; then
98 cat <<EOF
100 Note: Test suite failures which are expected for this combination of
101 platform and features have been ignored:
103 HEADER_HAS_BEEN_PRINTED=true
105 echo " contrib/$dir"
106 (unset IFS; while read line; do echo " $line"; done <"$f")
108 done
110 # Sometimes people used to see the "No tests failed." output from the last
111 # DEFTEST in contrib self-tests and think that's all that is. So...
112 HEADER_HAS_BEEN_PRINTED=false
113 for dir in `cd contrib ; echo *`
115 if [ -d "contrib/$dir" -a -f "contrib/$dir/Makefile" -a ! -f "obj/asdf-cache/$dir/test-passed.test-report" ]; then
116 if $HEADER_HAS_BEEN_PRINTED; then
117 echo > /dev/null
118 else
119 cat <<EOF
121 WARNING! Some of the contrib modules did not build successfully or pass
122 their self-tests. Failed contribs:"
124 HEADER_HAS_BEEN_PRINTED=true
126 echo " $dir"
128 done
130 if [ $HEADER_HAS_BEEN_PRINTED = true ]; then
131 exit 1