source: project/chicken/trunk/scripts/chicken-scheme @ 16091

Last change on this file since 16091 was 16091, checked in by felix winkelmann, 10 years ago

added sv2git script; improvements in chicken-scheme script, fixed rename in manifest

  • Property svn:executable set to *
File size: 909 bytes
Line 
1#!/bin/bash
2### usage: chicken-scheme FILENAME
3#
4# variables:
5#
6# CHICKEN_SCHEME_DEBUG
7
8
9#XXX change this on installation:
10chickenprefix=$HOME
11
12dbgoption=-S
13cache=$HOME/.chicken-scheme.cache
14uname=`uname`
15wd=`pwd`
16
17if test -n "$CHICKEN_SCHEME_DEBUG"; then
18    set -x
19    dbgoption="${dbgoption} -v2"
20fi
21
22if test "$#" == 0; then
23    exec csi
24else
25    prg="$1"
26fi
27
28if test ${uname} = "Darwin"; then
29    prgh=`md5 -q ${prg}`
30else
31    prgh=`md5sum ${prg} | sed -n -e 's/\([^[:space:]]*\).*/\1/p'`
32fi
33
34compile_log="${cache}/${prgh}.compile"
35
36if test \! -d ${cache}; then
37    mkdir -p ${cache}
38fi
39
40if test "${prg}" -nt "${cache}/${prgh}"; then
41    if ${chickenprefix}/bin/csc ${dbgoption} "${prg}" -o "${cache}/${prgh}" > "${compile_log}" 2>&1; then :
42    else
43        cat "${compile_log}"
44        exit 1
45    fi
46fi
47
48if test -x "${cache}/${prgh}"; then
49    shift
50    exec "${cache}/${prgh}" "$@"
51else
52    echo "can not run $1"
53fi
Note: See TracBrowser for help on using the repository browser.