/[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.13 - (show annotations)
Tue Feb 2 02:45:54 2010 UTC (4 years, 2 months ago) by rtoy
Branch: MAIN
CVS Tags: sparc-tramp-assem-base, post-merge-intl-branch, intl-branch-working-2010-02-19-1000, release-20b-pre1, release-20b-pre2, sparc-tramp-assem-2010-07-19, intl-2-branch-base, intl-branch-working-2010-02-11-1000, RELEASE_20b, cross-sol-x86-base, snapshot-2010-12, snapshot-2010-11, pre-merge-intl-branch, snapshot-2010-05, snapshot-2010-04, snapshot-2010-07, snapshot-2010-06, snapshot-2010-03, snapshot-2010-08, intl-branch-2010-03-18-1300, cross-sparc-branch-base, intl-branch-base
Branch point for: cross-sparc-branch, RELEASE-20B-BRANCH, sparc-tramp-assem-branch, intl-branch, cross-sol-x86-branch, intl-2-branch
Changes since 1.12: +2 -1 lines
File MIME type: application/x-sh
Ticket #22

tools/create-target.sh:
o If lisp variant is solaris using Sun C, setup default motif config
  to use Sun C too.

motif/server/Config.solaris_sunc:
o New config file for building motifd using Sun C.
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_gcc|sparc_gcc) MOTIF_VARIANT=solaris ;;
74 sun4_solaris_sunc|sparc_sunc) MOTIF_VARIANT=solaris_sunc ;;
75 sun4c*) MOTIF_VARIANT=sun4c_411 ;;
76 hp700*) MOTIF_VARIANT=hpux_cc ;;
77 pmax_mach) MOTIF_VARIANT=pmax_mach ;;
78 sgi*) MOTIF_VARIANT=irix ;;
79 x86_linux|linux*) MOTIF_VARIANT=x86 ;;
80 esac
81 elif [ ! -f src/motif/server/Config.$MOTIF_VARIANT ]; then
82 echo "No such motif-variant could be found: Config.$MOTIF_VARIANT"
83 exit 1
84 fi
85
86 # Tell user what's we've configured
87 echo "Lisp = $LISP_VARIANT"
88 echo "Motif = $MOTIF_VARIANT"
89
90 # Create a directory tree that mirrors the source directory tree
91 find src -name 'CVS' -prune -o -type d -print \
92 | sed "s:^src:$TARGET:g" | xargs mkdir
93
94 # Link Makefile and Config files
95
96 (cd $TARGET/lisp
97 ln -s ../../src/lisp/GNUmakefile ../../src/lisp/Config.$LISP_VARIANT ../../src/lisp/Config.*_common .
98 ln -s Config.$LISP_VARIANT Config
99 )
100
101 # Create empty initial map file
102 echo 'Map file for lisp version 0' > $TARGET/lisp/lisp.nm
103
104 # Create dummy internals.h so we get warned to recompile
105 echo '#error You need to run genesis (via build-world.sh) before compiling the startup code!' > $TARGET/lisp/internals.h
106
107 SETENV=src/tools/setenv-scripts
108
109 # Create sample setenv.lisp file
110 cat $SETENV/base-features.lisp > $TARGET/setenv.lisp
111
112 # Put in some platform specific items
113 case $LISP_VARIANT in
114 *linux*)
115 gcname=":gencgc"
116 sed "s;@@gcname@@;$gcname;" $SETENV/linux-features.lisp >> $TARGET/setenv.lisp
117 ;;
118 *OpenBSD*)
119 case $LISP_VARIANT in
120 *_gencgc*) gcname=":gencgc" ;;
121 *) gcname=":cgc" ;;
122 esac
123 sed "s;@@gcname@@;$gcname;" $SETENV/openbsd-features.lisp >> $TARGET/setenv.lisp
124 ;;
125 *FreeBSD*|*freebsd*)
126 gcname=":gencgc"
127 sed "s;@@gcname@@;$gcname;" $SETENV/freebsd-features.lisp >> $TARGET/setenv.lisp
128 ;;
129 *solaris*)
130 cat $SETENV/solaris-features.lisp >> $TARGET/setenv.lisp
131 ;;
132 *)
133 sed "s;@@LISP@@;$LISP_VARIANT;" $SETENV/unknown.lisp >> $TARGET/setenv.lisp
134 ;;
135 esac
136
137
138 # Do Motif setup
139 if [ "$MOTIF_VARIANT" != "" ]
140 then
141 ( cd $TARGET/motif/server ; ln -s ../../../src/motif/server/GNUmakefile ./Makefile )
142 ( cd $TARGET/motif/server ; ln -s ../../../src/motif/server/Config.$MOTIF_VARIANT ./Config )
143 fi

  ViewVC Help
Powered by ViewVC 1.1.5