/[cmucl]/src/tools/cross-build-world.sh
ViewVC logotype

Contents of /src/tools/cross-build-world.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3.4.1 - (hide annotations)
Sat Aug 29 01:42:24 2009 UTC (4 years, 7 months ago) by rtoy
Branch: RELEASE-20A-BRANCH
CVS Tags: RELEASE_20a, release-20a-pre1
Changes since 1.3: +15 -6 lines
File MIME type: application/x-sh
Add -B option to allow the user to specify a cross-bootstrap.lisp file.
1 toy 1.1 #!/bin/sh
2    
3 rtoy 1.3 usage() {
4     echo "cross-build-world.sh [-crl] target-dir cross-dir cross-compiler-script [build-binary [flags]]"
5 rtoy 1.3.4.1 echo " -c Clean target and cross directories before compiling"
6     echo " -r Recompile lisp runtime"
7     echo " -l Load cross-compiled kernel to make a new lisp kernel"
8     echo " -B file Use this as the cross bootstrap file."
9 rtoy 1.3 }
10    
11 rtoy 1.3.4.1 while getopts "crlB:" arg
12 rtoy 1.3 do
13     case $arg in
14     c) CLEAN_DIR=yes ;;
15     r) BUILD_RUNTIME=yes ;;
16     l) LOAD_KERNEL=yes ;;
17 rtoy 1.3.4.1 B) BOOTSTRAP=$OPTARG ;;
18 rtoy 1.3 h | \?) usage; exit 1 ;;
19     esac
20     done
21    
22     shift `expr $OPTIND - 1`
23    
24 toy 1.1 if [ "$1" = "" -o "$2" = "" ]
25     then
26 rtoy 1.3 usage
27     exit 1
28 toy 1.1 fi
29    
30     if [ ! -d "$1" ]
31     then
32     echo "$1 isn't a directory"
33     exit 2
34     fi
35    
36     if [ -f "$2" ]
37     then
38     echo "$2 exists but isn't a directory"
39     exit 2
40     fi
41    
42     if [ ! -f "$3" ]
43     then
44     echo "$3 doesn't exist, or isn't a normal file"
45     fi
46    
47     TARGET="`echo $1 | sed 's:/*$::'`"
48     CROSS="`echo $2 | sed 's:/*$::'`"
49     SCRIPT="$3"
50     LISP="${4:-lisp}"
51 rtoy 1.3
52 rtoy 1.3.4.1 if [ -z "$BOOTSTRAP" ]; then
53     CROSSBOOT="$TARGET/cross-boootstrap.lisp"
54     else
55     CROSSBOOT=$BOOTSTRAP
56     fi
57    
58 toy 1.1 if [ $# -ge 4 ]
59     then
60     shift 4
61     else
62     shift 3
63     fi
64    
65 rtoy 1.3 if [ "$CLEAN_DIR" = "yes" ]; then
66     echo "Cleaning directories: $TARGET $CROSS"
67     src/tools/clean-target.sh $TARGET $CROSS
68     fi
69    
70 toy 1.1 if [ ! -d "$CROSS" ]
71     then
72     # Create a directory tree that mirrors the source directory tree
73     find src -name 'CVS' -prune -o -type d -print | \
74     sed "s:^src:$CROSS:g" | xargs mkdir
75     fi
76    
77 rtoy 1.3.4.1 echo cross boot = $CROSSBOOT
78 toy 1.1 $LISP "$@" -noinit -nositeinit <<EOF
79     (in-package :cl-user)
80    
81 toy 1.2 (setf lisp::*enable-package-locked-errors* nil)
82 toy 1.1
83     (setf (ext:search-list "target:")
84     '("$CROSS/" "src/"))
85    
86 rtoy 1.3.4.1 (print "$CROSSBOOT")
87     (load "$CROSSBOOT" :if-does-not-exist nil)
88 toy 1.1
89     (load "target:code/exports")
90     (load "target:tools/setup" :if-source-newer :load-source)
91     (comf "target:tools/setup" :load t)
92    
93     (setq *gc-verbose* nil *interactive* nil)
94    
95     (load "$SCRIPT")
96    
97     (pushnew :bootstrap *features*)
98    
99     (setf (ext:search-list "target:")
100     '("$TARGET/" "src/"))
101    
102     (when (probe-file "target:bootstrap.lisp")
103     (load "target:bootstrap.lisp"))
104    
105     (load "target:setenv")
106    
107     (pushnew :no-pcl *features*)
108     (pushnew :no-clx *features*)
109     (pushnew :no-clm *features*)
110     (pushnew :no-hemlock *features*)
111    
112     (load "target:tools/worldcom")
113     #-(or no-compiler runtime) (load "target:tools/comcom")
114     ;; Compile at least new-genesis, so that genesis doesn't take ages
115     #+(or no-compiler runtime) (comf "target:compiler/generic/new-genesis")
116     #-(or no-pcl runtime) (load "target:tools/pclcom")
117    
118     (setq *gc-verbose* t *interactive* t)
119    
120     (load "target:tools/worldbuild")
121     (ext:quit)
122     EOF
123 rtoy 1.3
124     if [ "$BUILD_RUNTIME" = "yes" ]; then
125     echo Building runtime
126     (cd $TARGET/lisp; make)
127     fi
128    
129     if [ "$LOAD_KERNEL" = "yes" ]; then
130     echo Load kernel.core
131     src/tools/load-world.sh -p $TARGET cross-compiled
132     fi

  ViewVC Help
Powered by ViewVC 1.1.5