source: branches/1.1.x/build-from-lisp.sh

Last change on this file was 14375, checked in by Mark Evenson, 12 years ago

Backport r14366 | ehuelsmann | 2013-02-11 20:05:51 +0100 (Mon, 11 Feb 2013) | 1 line

Patch by ASau on freenode/#abcl: allow more casing variations.

  • Property svn:eol-style set to LF
  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 2.5 KB
Line 
1#!/bin/bash
2# $Id: build-from-lisp.sh 14375 2013-02-13 19:39:04Z mevenson $
3#
4# Build ABCL from a supported Lisp
5
6usage()
7{
8   echo "$0 <implementation> [[ --clean=T | --full=T | --batch=NIL ]]"
9}
10
11if [ -z "$1" ]; then
12    usage
13    exit 1
14fi
15
16check_boolean()
17{
18    case "$1" in
19        [Tt]|[Nn][Ii][Ll])
20            :;;
21        *)
22            usage
23            echo "Error: Argument \`$1' is neither \"nil\" nor \"t\"."
24            exit 1
25            ;;
26    esac
27}
28
29IMPL="$1"
30TEMP=$(getopt --long clean:,full:,batch: -n "$0" -- "$@") 
31
32if [ $? != 0 ] ; then 
33    usage
34    exit 1
35fi
36eval set -- "$TEMP"
37
38CLEAN="t"
39FULL="t"
40BATCH="t"
41
42while true ; do
43    case "$1" in
44        --clean) 
45            check_boolean "$2"
46            CLEAN="$2" 
47            shift 2 
48            ;;
49        --full) 
50            check_boolean "$2"
51            FULL="$2"
52            shift 2 
53            ;;
54        --batch) 
55            check_boolean "$2"
56            BATCH="$2" 
57            shift 2 
58            ;;
59        --) shift; break ;;
60        *)  echo "Internal error!" ; exit 1 ;;
61        esac
62done
63
64FORM="(build-abcl:build-abcl :clean $CLEAN :full $FULL :batch $BATCH)"
65FILE="build-abcl.lisp"
66
67
68abcl()
69{
70    exec "$1" --load "$2" --eval "(progn $3 (ext:quit))"
71}
72
73ecl()
74{
75    exec "$1" -norc -load "$2" -eval "(progn $3 (ext:quit))"
76}
77
78clisp()
79{ 
80    exec "$1" -ansi -q -norc -i "$2" -x "(progn $3 (ext:quit))"
81}
82
83sbcl()
84{
85    exec "$1" --no-userinit --load "$2" --eval "(progn $3 (sb-ext:quit))"
86}
87
88cmucl()
89{
90    exec "$1" -noinit -load "$2" -eval '(setq *load-verbose* nil)' \
91                                 -eval "(progn $3 (ext:quit))"
92}
93
94ccl()
95{
96    exec "$1" -Q --no-init --load "$2" --eval "(progn $3 (ccl:quit))"
97}
98
99notimplemented()
100{
101    usage
102    echo "Error: The build script does not currently support $1."
103    echo "It's easy to change, though. Look at $0, and send a patch!"
104    exit 1
105}
106
107
108
109# We pass along and execute "$1" so users can pass "sbcl-cvs"
110# etc. instead of "sbcl".
111
112case "$IMPL" in
113    abcl*)
114        abcl  "$IMPL" "$FILE" "$FORM"          ;;
115    clisp*)
116        clisp "$IMPL" "$FILE" "$FORM"          ;;
117    sbcl*)
118        sbcl  "$IMPL" "$FILE" "$FORM"          ;;
119    lisp)
120        cmucl "$IMPL" "$FILE" "$FORM"          ;;   
121    ccl*)
122        ccl   "$IMPL" "$FILE" "$FORM"          ;;
123    gcl*)
124        notimplemented "$IMPL" "$FILE" "$FORM" ;;
125    ecl*)
126        ecl   "$IMPL" "$FILE" "$FORM"          ;;
127    alisp*)
128        notimplemented "$IMPL" "$FILE" "$FORM" ;;
129    *)
130        usage; 
131        echo "Error: Unrecognized implementation: $IMPL"
132        exit 1 
133        ;;
134esac
Note: See TracBrowser for help on using the repository browser.