/[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.5 - (show annotations)
Tue Jun 22 15:27:40 2010 UTC (3 years, 9 months ago) by rtoy
Branch: MAIN
CVS Tags: sparc-tramp-assem-base, snapshot-2010-07
Branch point for: sparc-tramp-assem-branch
Changes since 1.4: +1 -0 lines
File MIME type: application/x-sh
Install the _ reader when cross-compiling.
1 #!/bin/sh
2
3 usage() {
4 echo "cross-build-world.sh [-crl] target-dir cross-dir cross-compiler-script [build-binary [flags]]"
5 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 }
10
11 while getopts "crlB:" arg
12 do
13 case $arg in
14 c) CLEAN_DIR=yes ;;
15 r) BUILD_RUNTIME=yes ;;
16 l) LOAD_KERNEL=yes ;;
17 B) BOOTSTRAP=$OPTARG ;;
18 h | \?) usage; exit 1 ;;
19 esac
20 done
21
22 shift `expr $OPTIND - 1`
23
24 if [ "$1" = "" -o "$2" = "" ]
25 then
26 usage
27 exit 1
28 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
52 if [ -z "$BOOTSTRAP" ]; then
53 CROSSBOOT="$TARGET/cross-boootstrap.lisp"
54 else
55 CROSSBOOT=$BOOTSTRAP
56 fi
57
58 if [ $# -ge 4 ]
59 then
60 shift 4
61 else
62 shift 3
63 fi
64
65 if [ "$CLEAN_DIR" = "yes" ]; then
66 echo "Cleaning directories: $TARGET $CROSS"
67 src/tools/clean-target.sh $TARGET $CROSS
68 fi
69
70 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 echo cross boot = $CROSSBOOT
78 $LISP "$@" -noinit -nositeinit <<EOF
79 (in-package :cl-user)
80
81 (setf lisp::*enable-package-locked-errors* nil)
82
83 (intl::install)
84 (setf (ext:search-list "target:")
85 '("$CROSS/" "src/"))
86
87 (print "$CROSSBOOT")
88 (load "$CROSSBOOT" :if-does-not-exist nil)
89
90 (load "target:code/exports")
91 (load "target:tools/setup" :if-source-newer :load-source)
92 (comf "target:tools/setup" :load t)
93
94 (setq *gc-verbose* nil *interactive* nil)
95
96 (load "$SCRIPT")
97
98 (pushnew :bootstrap *features*)
99
100 (setf (ext:search-list "target:")
101 '("$TARGET/" "src/"))
102
103 (when (probe-file "target:bootstrap.lisp")
104 (load "target:bootstrap.lisp"))
105
106 (load "target:setenv")
107
108 (pushnew :no-pcl *features*)
109 (pushnew :no-clx *features*)
110 (pushnew :no-clm *features*)
111 (pushnew :no-hemlock *features*)
112
113 (load "target:tools/worldcom")
114 #-(or no-compiler runtime) (load "target:tools/comcom")
115 ;; Compile at least new-genesis, so that genesis doesn't take ages
116 #+(or no-compiler runtime) (comf "target:compiler/generic/new-genesis")
117 #-(or no-pcl runtime) (load "target:tools/pclcom")
118
119 (setq *gc-verbose* t *interactive* t)
120
121 (load "target:tools/worldbuild")
122 (ext:quit)
123 EOF
124
125 if [ "$BUILD_RUNTIME" = "yes" ]; then
126 echo Building runtime
127 (cd $TARGET/lisp; make)
128 fi
129
130 if [ "$LOAD_KERNEL" = "yes" ]; then
131 echo Load kernel.core
132 src/tools/load-world.sh -p $TARGET cross-compiled
133 fi

  ViewVC Help
Powered by ViewVC 1.1.5