/[cmucl]/src/tools/create-target.sh
ViewVC logotype

Contents of /src/tools/create-target.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations)
Sat Oct 18 16:45:09 2003 UTC (10 years, 6 months ago) by toy
Branch: MAIN
CVS Tags: snapshot-2004-05, snapshot-2004-06, snapshot-2004-07, mod-arith-base, amd64-merge-start, prm-before-macosx-merge-tag, snapshot-2003-11, release-19a-base, snapshot-2003-12, release-19a-pre1, release-19a-pre3, release-19a-pre2, release-19a, snapshot-2004-04
Branch point for: mod-arith-branch, UNICODE-BRANCH, release-19a-branch
Changes since 1.2: +19 -9 lines
File MIME type: application/x-sh
Collect usage info into the usage function.  Give a description of
what this is supposed to do.
1 #!/bin/sh
2
3 LISP_VARIANT=
4 MOTIF_VARIANT=
5 TARGET_DIR=
6
7 usage() {
8 echo "Usage: `basename $0` target-dir [lisp-variant [motif-variant]]"
9 echo ""
10 echo "Creates a directory structure in TARGET-DIR for use in compiling"
11 echo "CMUCL. If the lisp-variant is not given, uname is used to select"
12 echo "a version, if possible. If motif-variant is not given, one is"
13 echo "determined from the lisp-variant."
14 echo ""
15 # List possible values for lisp-variant and motif-variant
16 echo "Possible lisp-variants:"
17 ( cd src/lisp/ ; ls -1 Config.* ) | sed 's;^Config[.];;g' | \
18 pr -3at -o 8
19 echo "Possible Motif-variants:"
20 ( cd src/motif/server/ ; ls -1 Config.* ) | sed 's;^Config[.];;g' | \
21 pr -3at -o 8
22 exit 1
23 }
24
25 if [ $# = 1 ]; then
26 # Only target directory given. Try to deduce the lisp-variant
27 TARGET_DIR="$1"
28 case `uname -s` in
29 SunOS) LISP_VARIANT=sun4_solaris_gcc ;;
30 Linux) LISP_VARIANT=linux_gencgc ;;
31 # Please fill in some other common systems
32 *) echo "Sorry, please specify the desired Lisp variant."
33 exit 1 ;;
34 esac
35 elif [ $# = 2 ]; then
36 # Target directory and lisp-variant given
37 TARGET_DIR="$1"
38 LISP_VARIANT="$2"
39 elif [ $# = 3 ]; then
40 # Target directory, lisp-variant, and motif variant given
41 TARGET_DIR="$1"
42 LISP_VARIANT="$2"
43 MOTIF_VARIANT="$3"
44 else
45 usage
46 fi
47
48 [ -d $1 ] && echo "Error: Directory $1 exists already!" && exit 2
49
50 TARGET="`echo $TARGET_DIR | sed 's:/*$::'`"
51
52 # Make sure the given variants exist
53 if [ ! -f src/lisp/Config.$LISP_VARIANT ]; then
54 echo "No such lisp-variant could be found: Config.$LISP_VARIANT"
55 exit 1
56 fi
57
58 # From the given variant, try to derive a motif variant
59 if [ "$MOTIF_VARIANT" = "" ]; then
60 case $LISP_VARIANT in
61 alpha_linux) MOTIF_VARIANT=alpha_linux ;;
62 alpha_osf1) MOTIF_VARIANT=alpha_osf1 ;;
63 FreeBSD*) MOTIF_VARIANT=FreeBSD ;;
64 NetBSD*) MOTIF_VARIANT=NetBSD ;;
65 OpenBSD*) MOTIF_VARIANT=OpenBSD ;;
66 sun4_solaris*) MOTIF_VARIANT=solaris ;;
67 sun4c*) MOTIF_VARIANT=sun4c_411 ;;
68 hp700*) MOTIF_VARIANT=hpux_cc ;;
69 pmax_mach) MOTIF_VARIANT=pmax_mach ;;
70 sgi*) MOTIF_VARIANT=irix ;;
71 linux*) MOTIF_VARIANT=x86 ;;
72 esac
73 elif [ ! -f src/motif/server/Config.$MOTIF_VARIANT ]; then
74 echo "No such motif-variant could be found: Config.$MOTIF_VARIANT"
75 exit 1
76 fi
77
78 # Tell user what's we've configured
79 echo "Lisp = $LISP_VARIANT"
80 echo "Motif = $MOTIF_VARIANT"
81
82 # Create a directory tree that mirrors the source directory tree
83 find src -name 'CVS' -prune -o -type d -print \
84 | sed "s:^src:$TARGET:g" | xargs mkdir
85
86 # Link Makefile and Config files
87 ( cd $TARGET/lisp ; ln -s ../../src/lisp/GNUmakefile ./Makefile )
88 ( cd $TARGET/lisp ; ln -s ../../src/lisp/Config.$LISP_VARIANT ./Config )
89
90 # Create empty initial map file
91 echo 'Map file for lisp version 0' > $TARGET/lisp/lisp.nm
92
93 # Create dummy internals.h so we get warned to recompile
94 echo '#error You need to run genesis (via build-world.sh) before compiling the startup code!' > $TARGET/lisp/internals.h
95
96 SETENV=src/tools/setenv-scripts
97
98 # Create sample setenv.lisp file
99 cat $SETENV/base-features.lisp > $TARGET/setenv.lisp
100
101 # Put in some platform specific items
102 case $LISP_VARIANT in
103 *linux*)
104 case $$LISP_VARIANT in
105 *_gencgc*) gcname=":gencgc" ;;
106 *) gcname=":cgc" ;;
107 esac
108 sed "s;@@gcname@@;$gcname;" $SETENV/linux-features.lisp >> $TARGET/setenv.lisp
109 ;;
110 *OpenBSD*)
111 case $LISP_VARIANT in
112 *_gencgc*) gcname=":gencgc" ;;
113 *) gcname=":cgc" ;;
114 esac
115 sed "s;@@gcname@@;$gcname;" $SETENV/openbsd-features.lisp >> $TARGET/setenv.lisp
116 ;;
117 *solaris*)
118 cat $SETENV/solaris-features.lisp >> $TARGET/setenv.lisp
119 ;;
120 *)
121 sed "s;@@LISP@@;$LISP_VARIANT;" $SETENV/unknown.lisp >> $TARGET/setenv.lisp
122 ;;
123 esac
124
125
126 # Do Motif setup
127 if [ "$MOTIF_VARIANT" != "" ]
128 then
129 ( cd $TARGET/motif/server ; ln -s ../../../src/motif/server/GNUmakefile ./Makefile )
130 ( cd $TARGET/motif/server ; ln -s ../../../src/motif/server/Config.$MOTIF_VARIANT ./Config )
131 fi

  ViewVC Help
Powered by ViewVC 1.1.5