Changeset 16115 in project for chicken


Ignore:
Timestamp:
10/01/09 11:59:26 (10 years ago)
Author:
felix
Message:

tweaks in chicken-scheme script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chicken/trunk/scripts/chicken-scheme

    r16091 r16115  
    11#!/bin/bash
    2 ### usage: chicken-scheme FILENAME
     2### usage: chicken-scheme [-h] [FILENAME]
    33#
    44# variables:
    55#
    66# CHICKEN_SCHEME_DEBUG
     7# CHICKEN_SCHEME_HOOK
    78
    89
    9 #XXX change this on installation:
    10 chickenprefix=$HOME
     10#XXX change these on installation:
     11chickenprefix=${HOME}
     12cscprogram=csc
     13csiprogram=csi
    1114
    1215dbgoption=-S
    13 cache=$HOME/.chicken-scheme.cache
     16cache=${HOME}/.chicken-scheme.cache
    1417uname=`uname`
    1518wd=`pwd`
     19
     20if test "$1" == "-h"; then
     21    echo "usage: chicken-scheme [-h] [FILENAME]"
     22    exit 0
     23fi
    1624
    1725if test -n "$CHICKEN_SCHEME_DEBUG"; then
     
    2028fi
    2129
    22 if test "$#" == 0; then
    23     exec csi
     30if test $# == 0; then
     31    exec "${chickenprefix}/bin/${csiprogram}"
    2432else
    2533    prg="$1"
    2634fi
    2735
    28 if test ${uname} = "Darwin"; then
     36if test "${uname}" = "Darwin"; then
    2937    prgh=`md5 -q ${prg}`
    3038else
     
    3442compile_log="${cache}/${prgh}.compile"
    3543
    36 if test \! -d ${cache}; then
    37     mkdir -p ${cache}
     44if test \! -d "${cache}"; then
     45    mkdir -p "${cache}"
    3846fi
    3947
    4048if test "${prg}" -nt "${cache}/${prgh}"; then
    41     if ${chickenprefix}/bin/csc ${dbgoption} "${prg}" -o "${cache}/${prgh}" > "${compile_log}" 2>&1; then :
     49    if test -n "${CHICKEN_SCHEME_HOOK}"; then
     50        ${CHICKEN_SCHEME_HOOK} "${prg}" "${cache}/${prgh}"
     51    fi
     52    if "${chickenprefix}/bin/${cscprogram}" ${dbgoption} "${prg}" -o "${cache}/${prgh}" > "${compile_log}" 2>&1; then :
    4253    else
    4354        cat "${compile_log}"
     55        rm -f "${compile_log}"
    4456        exit 1
    4557    fi
    4658fi
     59
     60rm -f "${compile_log}"
    4761
    4862if test -x "${cache}/${prgh}"; then
     
    5064    exec "${cache}/${prgh}" "$@"
    5165else
    52     echo "can not run $1"
     66    echo "can not run ${prg}"
    5367fi
Note: See TracChangeset for help on using the changeset viewer.