/[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 - (hide 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 toy 1.1 #!/bin/sh
2    
3 toy 1.2 LISP_VARIANT=
4     MOTIF_VARIANT=
5     TARGET_DIR=
6    
7 toy 1.3 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 toy 1.2 if [ $# = 1 ]; then
26     # Only target directory given. Try to deduce the lisp-variant
27     TARGET_DIR="$1"
28     case `uname -s` in
29 rtoy 1.12 SunOS) LISP_VARIANT=sparc_gcc ;;
30 rtoy 1.10 Linux) LISP_VARIANT=x86_linux ;;
31 cshapiro 1.7 Darwin) case `uname -m` in
32     ppc) LISP_VARIANT=ppc_darwin ;;
33     i386) LISP_VARIANT=x86_darwin ;;
34     esac
35     ;;
36 agoncharov 1.8 FreeBSD|freebsd) LISP_VARIANT=x86_freebsd ;;
37 toy 1.2 # 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 toy 1.3 usage
52 toy 1.1 fi
53    
54 toy 1.2 [ -d $1 ] && echo "Error: Directory $1 exists already!" && exit 2
55 toy 1.1
56 toy 1.2 TARGET="`echo $TARGET_DIR | sed 's:/*$::'`"
57 toy 1.1
58     # Make sure the given variants exist
59 toy 1.2 if [ ! -f src/lisp/Config.$LISP_VARIANT ]; then
60     echo "No such lisp-variant could be found: Config.$LISP_VARIANT"
61 toy 1.1 exit 1
62     fi
63    
64     # From the given variant, try to derive a motif variant
65 toy 1.2 if [ "$MOTIF_VARIANT" = "" ]; then
66     case $LISP_VARIANT in
67     alpha_linux) MOTIF_VARIANT=alpha_linux ;;
68     alpha_osf1) MOTIF_VARIANT=alpha_osf1 ;;
69 rtoy 1.10 x86_freebsd|FreeBSD*|freebsd*) MOTIF_VARIANT=FreeBSD ;;
70 toy 1.2 NetBSD*) MOTIF_VARIANT=NetBSD ;;
71     OpenBSD*) MOTIF_VARIANT=OpenBSD ;;
72 pmai 1.4 *_darwin) MOTIF_VARIANT=Darwin ;;
73 rtoy 1.13 sun4_solaris_gcc|sparc_gcc) MOTIF_VARIANT=solaris ;;
74     sun4_solaris_sunc|sparc_sunc) MOTIF_VARIANT=solaris_sunc ;;
75 toy 1.2 sun4c*) MOTIF_VARIANT=sun4c_411 ;;
76     hp700*) MOTIF_VARIANT=hpux_cc ;;
77     pmax_mach) MOTIF_VARIANT=pmax_mach ;;
78     sgi*) MOTIF_VARIANT=irix ;;
79 rtoy 1.10 x86_linux|linux*) MOTIF_VARIANT=x86 ;;
80 toy 1.1 esac
81 toy 1.2 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 toy 1.1 fi
85    
86 toy 1.2 # Tell user what's we've configured
87     echo "Lisp = $LISP_VARIANT"
88     echo "Motif = $MOTIF_VARIANT"
89    
90 toy 1.1 # 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 agoncharov 1.8
96 rtoy 1.9 (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 toy 1.1
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 toy 1.2 SETENV=src/tools/setenv-scripts
108    
109 toy 1.1 # Create sample setenv.lisp file
110 toy 1.2 cat $SETENV/base-features.lisp > $TARGET/setenv.lisp
111 toy 1.1
112     # Put in some platform specific items
113 toy 1.2 case $LISP_VARIANT in
114 toy 1.1 *linux*)
115 rtoy 1.11 gcname=":gencgc"
116 toy 1.2 sed "s;@@gcname@@;$gcname;" $SETENV/linux-features.lisp >> $TARGET/setenv.lisp
117 toy 1.1 ;;
118     *OpenBSD*)
119 toy 1.2 case $LISP_VARIANT in
120 toy 1.1 *_gencgc*) gcname=":gencgc" ;;
121     *) gcname=":cgc" ;;
122     esac
123 toy 1.2 sed "s;@@gcname@@;$gcname;" $SETENV/openbsd-features.lisp >> $TARGET/setenv.lisp
124 toy 1.1 ;;
125 agoncharov 1.8 *FreeBSD*|*freebsd*)
126 rtoy 1.11 gcname=":gencgc"
127     sed "s;@@gcname@@;$gcname;" $SETENV/freebsd-features.lisp >> $TARGET/setenv.lisp
128 rtoy 1.6 ;;
129 toy 1.1 *solaris*)
130 toy 1.2 cat $SETENV/solaris-features.lisp >> $TARGET/setenv.lisp
131 toy 1.1 ;;
132     *)
133 toy 1.2 sed "s;@@LISP@@;$LISP_VARIANT;" $SETENV/unknown.lisp >> $TARGET/setenv.lisp
134 toy 1.1 ;;
135     esac
136    
137    
138     # Do Motif setup
139 toy 1.2 if [ "$MOTIF_VARIANT" != "" ]
140 toy 1.1 then
141 toy 1.2 ( 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 toy 1.1 fi

  ViewVC Help
Powered by ViewVC 1.1.5