source: project/chicken/trunk/scripts/test-dist.sh @ 13818

Last change on this file since 13818 was 13818, checked in by felix winkelmann, 11 years ago

use right chicken when building test dist

File size: 1.6 KB
Line 
1#!/bin/sh
2### test-dist.sh - test distribution tarball
3#
4# usage: test-dist.sh [-bootstrap] PLATFORM [TARBALL]
5
6set -e
7set -x
8
9pwdopts=
10bootstrap=
11
12if test "$1" == "-bootstrap"; then
13    bootstrap=1
14    shift
15fi
16
17if test $# \!= 2; then
18    echo "usage: test-dist.sh [-bootstrap] PLATFORM [TARBALL]"
19    exit 1
20fi
21
22platform="$1"
23tarball="$2"
24
25# use gmake, if available
26if test -z `which gmake`; then
27    makeprg=make
28fi
29
30# need Windows-style drive letter on mingw/msys
31if test -n "$MSYSTEM"; then
32    pwdopts=-W
33fi
34
35# bootstrap, if desired
36prefix=`pwd $pwdopts`/tmp-test-dist
37
38if test -n "$bootstrap"; then
39    $makeprg PLATFORM=$platform PREFIX=$prefix DEBUGBUILD=1 bootstrap
40    $makeprg PLATFORM=$platform PREFIX=$prefix DEBUGBUILD=1 CHICKEN=./chicken-boot confclean all install
41fi
42
43# if no tarball given, create one
44if test -z "$tarball"; then
45    $makeprg PLATFORM=$platform PREFIX=$prefix DEBUGBUILD=1 CHICKEN=$prefix/bin/chicken CSI=$prefix/bin/csi dist
46    tarball=chicken-`cat buildversion`.tar.gz
47fi
48
49# prepare testing directory
50if test -d tmp-test-dist; then
51    rm -fr tmp-test-dist/*
52fi
53
54mkdir -p tmp-test-dist
55cp "$tarball" tmp-test-dist
56
57# unpack and enter
58cd tmp-test-dist
59tar xvfz "$tarball"
60cd `basename "$tarball" .tar.gz`
61
62# build #1
63$makeprg PLATFORM=$platform PREFIX=$prefix DEBUGBUILD=1 all install
64# check #1
65$makeprg PLATFORM=$platform PREFIX=$prefix DEBUGBUILD=1 check
66# build once again with freshly built compiler
67touch *.scm
68$makeprg PLATFORM=$platform PREFIX=$prefix DEBUGBUILD=1 CHICKEN=$prefix/bin/chicken all install
69# and check...
70$makeprg PLATFORM=$platform PREFIX=$prefix DEBUGBUILD=1 check
71
72echo "looks good."
Note: See TracBrowser for help on using the repository browser.