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

Last change on this file since 13857 was 13857, checked in by felix winkelmann, 12 years ago

minor fixes

File size: 1.7 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
17case $# in
18    1|2) ;;
19    *) 
20        echo "usage: test-dist.sh [-bootstrap] PLATFORM [TARBALL]"
21        exit 1;;
22esac
23
24platform="$1"
25tarball="$2"
26makeprg=gmake
27
28# use gmake, if available
29if test -z `which gmake`; then
30    makeprg=make
31fi
32
33# need Windows-style drive letter on mingw/msys
34if test -n "$MSYSTEM"; then
35    pwdopts=-W
36fi
37
38# bootstrap, if desired
39prefix=`pwd $pwdopts`/tmp-test-dist
40
41if test -n "$bootstrap"; then
42    $makeprg PLATFORM=$platform PREFIX=$prefix DEBUGBUILD=1 bootstrap
43    $makeprg PLATFORM=$platform PREFIX=$prefix DEBUGBUILD=1 CHICKEN=./chicken-boot confclean all install
44fi
45
46# if no tarball given, create one
47if test -z "$tarball"; then
48    $prefix/bin/csi -s scripts/makedist.scm --make=$makeprg --platform=$platform
49    tarball=chicken-`cat buildversion`.tar.gz
50fi
51
52# prepare testing directory
53if test -d tmp-test-dist; then
54    rm -fr tmp-test-dist/*
55fi
56
57mkdir -p tmp-test-dist
58cp "$tarball" tmp-test-dist
59
60# unpack and enter
61cd tmp-test-dist
62tar xvfz "$tarball"
63cd `basename "$tarball" .tar.gz`
64
65# build #1
66$makeprg PLATFORM=$platform PREFIX=$prefix DEBUGBUILD=1 all install
67# check #1
68$makeprg PLATFORM=$platform PREFIX=$prefix DEBUGBUILD=1 check
69# build once again with freshly built compiler
70touch *.scm
71$makeprg PLATFORM=$platform PREFIX=$prefix DEBUGBUILD=1 CHICKEN=$prefix/bin/chicken all install
72# and check...
73$makeprg PLATFORM=$platform PREFIX=$prefix DEBUGBUILD=1 check
74
75# Install a few eggs
76$prefix/bin/chicken-install opengl
77
78echo "looks good."
Note: See TracBrowser for help on using the repository browser.