/[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.12 - (show annotations)
Tue Jul 7 17:14:13 2009 UTC (4 years, 9 months ago) by rtoy
Branch: MAIN
CVS Tags: unicode-string-buffer-impl-base, unicode-string-buffer-base, amd64-dd-start, release-20a-base, snapshot-2010-01, snapshot-2010-02, RELEASE_20a, release-20a-pre1, snapshot-2009-11, snapshot-2009-12, snapshot-2009-08
Branch point for: unicode-string-buffer-branch, RELEASE-20A-BRANCH, amd64-dd-branch, unicode-string-buffer-impl-branch
Changes since 1.11: +2 -2 lines
File MIME type: application/x-sh
Add new config for sparc/solaris, matching what was done for x86.  The
sun4_solaris_gcc and sun4_solaris_sunc configs are now obsolete, but
we leave the around for now.

Tested both configs and they work.

lisp/Config.sparc_common:
o New file for common config for gcc and Sun C builds on Solaris

lisp/Config.sparc_gcc:
o New file for building on sparc/solaris with gcc

lisp/Config.sparc_sunc:
o New file for building on sparc/solaris with Sun C

tools/create-target.sh:
o Change default from sun4_solaris_gcc to sparc_gcc to use new
  configuration.
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=sparc_gcc ;;
30 Linux) LISP_VARIANT=x86_linux ;;
31 Darwin) case `uname -m` in
32 ppc) LISP_VARIANT=ppc_darwin ;;
33 i386) LISP_VARIANT=x86_darwin ;;
34 esac
35 ;;
36 FreeBSD|freebsd) LISP_VARIANT=x86_freebsd ;;
37 # Please fill in some other common systems
38 *) echo "Sorry, please specify the desired Lisp variant."
39 exit 1 ;;
40 esac
41 elif [ $# = 2 ]; then
42 # Target directory and lisp-variant given
43 TARGET_DIR="$1"
44 LISP_VARIANT="$2"
45 elif [ $# = 3 ]; then
46 # Target directory, lisp-variant, and motif variant given
47 TARGET_DIR="$1"
48 LISP_VARIANT="$2"
49 MOTIF_VARIANT="$3"
50 else
51 usage
52 fi
53
54 [ -d $1 ] && echo "Error: Directory $1 exists already!" && exit 2
55
56 TARGET="`echo $TARGET_DIR | sed 's:/*$::'`"
57
58 # Make sure the given variants exist
59 if [ ! -f src/lisp/Config.$LISP_VARIANT ]; then
60 echo "No such lisp-variant could be found: Config.$LISP_VARIANT"
61 exit 1
62 fi
63
64 # From the given variant, try to derive a motif variant
65 if [ "$MOTIF_VARIANT" = "" ]; then
66 case $LISP_VARIANT in
67 alpha_linux) MOTIF_VARIANT=alpha_linux ;;
68 alpha_osf1) MOTIF_VARIANT=alpha_osf1 ;;
69 x86_freebsd|FreeBSD*|freebsd*) MOTIF_VARIANT=FreeBSD ;;
70 NetBSD*) MOTIF_VARIANT=NetBSD ;;
71 OpenBSD*) MOTIF_VARIANT=OpenBSD ;;
72 *_darwin) MOTIF_VARIANT=Darwin ;;
73 sun4_solaris*|sparc*) MOTIF_VARIANT=solaris ;;
74 sun4c*) MOTIF_VARIANT=sun4c_411 ;;
75 hp700*) MOTIF_VARIANT=hpux_cc ;;
76 pmax_mach) MOTIF_VARIANT=pmax_mach ;;
77 sgi*) MOTIF_VARIANT=irix ;;
78 x86_linux|linux*) MOTIF_VARIANT=x86 ;;
79 esac
80 elif [ ! -f src/motif/server/Config.$MOTIF_VARIANT ]; then
81 echo "No such motif-variant could be found: Config.$MOTIF_VARIANT"
82 exit 1
83 fi
84
85 # Tell user what's we've configured
86 echo "Lisp = $LISP_VARIANT"
87 echo "Motif = $MOTIF_VARIANT"
88
89 # Create a directory tree that mirrors the source directory tree
90 find src -name 'CVS' -prune -o -type d -print \
91 | sed "s:^src:$TARGET:g" | xargs mkdir
92
93 # Link Makefile and Config files
94
95 (cd $TARGET/lisp
96 ln -s ../../src/lisp/GNUmakefile ../../src/lisp/Config.$LISP_VARIANT ../../src/lisp/Config.*_common .
97 ln -s Config.$LISP_VARIANT Config
98 )
99
100 # Create empty initial map file
101 echo 'Map file for lisp version 0' > $TARGET/lisp/lisp.nm
102
103 # Create dummy internals.h so we get warned to recompile
104 echo '#error You need to run genesis (via build-world.sh) before compiling the startup code!' > $TARGET/lisp/internals.h
105
106 SETENV=src/tools/setenv-scripts
107
108 # Create sample setenv.lisp file
109 cat $SETENV/base-features.lisp > $TARGET/setenv.lisp
110
111 # Put in some platform specific items
112 case $LISP_VARIANT in
113 *linux*)
114 gcname=":gencgc"
115 sed "s;@@gcname@@;$gcname;" $SETENV/linux-features.lisp >> $TARGET/setenv.lisp
116 ;;
117 *OpenBSD*)
118 case $LISP_VARIANT in
119 *_gencgc*) gcname=":gencgc" ;;
120 *) gcname=":cgc" ;;
121 esac
122 sed "s;@@gcname@@;$gcname;" $SETENV/openbsd-features.lisp >> $TARGET/setenv.lisp
123 ;;
124 *FreeBSD*|*freebsd*)
125 gcname=":gencgc"
126 sed "s;@@gcname@@;$gcname;" $SETENV/freebsd-features.lisp >> $TARGET/setenv.lisp
127 ;;
128 *solaris*)
129 cat $SETENV/solaris-features.lisp >> $TARGET/setenv.lisp
130 ;;
131 *)
132 sed "s;@@LISP@@;$LISP_VARIANT;" $SETENV/unknown.lisp >> $TARGET/setenv.lisp
133 ;;
134 esac
135
136
137 # Do Motif setup
138 if [ "$MOTIF_VARIANT" != "" ]
139 then
140 ( cd $TARGET/motif/server ; ln -s ../../../src/motif/server/GNUmakefile ./Makefile )
141 ( cd $TARGET/motif/server ; ln -s ../../../src/motif/server/Config.$MOTIF_VARIANT ./Config )
142 fi

  ViewVC Help
Powered by ViewVC 1.1.5