/[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 - (show annotations)
Thu Jun 11 16:04:02 2009 UTC (4 years, 10 months ago) by rtoy
Branch: MAIN
CVS Tags: merged-unicode-utf16-extfmt-2009-06-11, release-20a-base, portable-clx-import-2009-06-16, portable-clx-base, snapshot-2009-08, snapshot-2009-07
Branch point for: portable-clx-branch, RELEASE-20A-BRANCH
Changes since 1.2: +37 -2 lines
File MIME type: application/x-sh
Merge Unicode work to trunk.  From label
unicode-utf16-extfmt-2009-06-11.
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 }
9
10 while getopts "crl" arg
11 do
12 case $arg in
13 c) CLEAN_DIR=yes ;;
14 r) BUILD_RUNTIME=yes ;;
15 l) LOAD_KERNEL=yes ;;
16 h | \?) usage; exit 1 ;;
17 esac
18 done
19
20 shift `expr $OPTIND - 1`
21
22 if [ "$1" = "" -o "$2" = "" ]
23 then
24 usage
25 exit 1
26 fi
27
28 if [ ! -d "$1" ]
29 then
30 echo "$1 isn't a directory"
31 exit 2
32 fi
33
34 if [ -f "$2" ]
35 then
36 echo "$2 exists but isn't a directory"
37 exit 2
38 fi
39
40 if [ ! -f "$3" ]
41 then
42 echo "$3 doesn't exist, or isn't a normal file"
43 fi
44
45 TARGET="`echo $1 | sed 's:/*$::'`"
46 CROSS="`echo $2 | sed 's:/*$::'`"
47 SCRIPT="$3"
48 LISP="${4:-lisp}"
49
50 if [ $# -ge 4 ]
51 then
52 shift 4
53 else
54 shift 3
55 fi
56
57 if [ "$CLEAN_DIR" = "yes" ]; then
58 echo "Cleaning directories: $TARGET $CROSS"
59 src/tools/clean-target.sh $TARGET $CROSS
60 fi
61
62 if [ ! -d "$CROSS" ]
63 then
64 # Create a directory tree that mirrors the source directory tree
65 find src -name 'CVS' -prune -o -type d -print | \
66 sed "s:^src:$CROSS:g" | xargs mkdir
67 fi
68
69 $LISP "$@" -noinit -nositeinit <<EOF
70 (in-package :cl-user)
71
72 (setf lisp::*enable-package-locked-errors* nil)
73
74 (setf (ext:search-list "target:")
75 '("$CROSS/" "src/"))
76
77 (when (probe-file "$TARGET/cross-bootstrap.lisp")
78 (load "$TARGET/cross-bootstrap.lisp"))
79
80 (load "target:code/exports")
81 (load "target:tools/setup" :if-source-newer :load-source)
82 (comf "target:tools/setup" :load t)
83
84 (setq *gc-verbose* nil *interactive* nil)
85
86 (load "$SCRIPT")
87
88 (pushnew :bootstrap *features*)
89
90 (setf (ext:search-list "target:")
91 '("$TARGET/" "src/"))
92
93 (when (probe-file "target:bootstrap.lisp")
94 (load "target:bootstrap.lisp"))
95
96 (load "target:setenv")
97
98 (pushnew :no-pcl *features*)
99 (pushnew :no-clx *features*)
100 (pushnew :no-clm *features*)
101 (pushnew :no-hemlock *features*)
102
103 (load "target:tools/worldcom")
104 #-(or no-compiler runtime) (load "target:tools/comcom")
105 ;; Compile at least new-genesis, so that genesis doesn't take ages
106 #+(or no-compiler runtime) (comf "target:compiler/generic/new-genesis")
107 #-(or no-pcl runtime) (load "target:tools/pclcom")
108
109 (setq *gc-verbose* t *interactive* t)
110
111 (load "target:tools/worldbuild")
112 (ext:quit)
113 EOF
114
115 if [ "$BUILD_RUNTIME" = "yes" ]; then
116 echo Building runtime
117 (cd $TARGET/lisp; make)
118 fi
119
120 if [ "$LOAD_KERNEL" = "yes" ]; then
121 echo Load kernel.core
122 src/tools/load-world.sh -p $TARGET cross-compiled
123 fi

  ViewVC Help
Powered by ViewVC 1.1.5