/[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.2 - (show annotations)
Sat Oct 18 14:56:14 2003 UTC (10 years, 6 months ago) by toy
Branch: MAIN
Changes since 1.1: +71 -133 lines
File MIME type: application/x-sh
o Modified create-target.sh to try to figure out what Config to use
  based on uname -s.  Currently only supports Linux and Solaris.
o Moved all the feature frobbing stuff from this file to separate
  files in the new setenv-scripts directory.  (Should we get rid of
  these?  However, they do serve as useful documentation of what
  features might exist in a given platform.)
1 #!/bin/sh
2
3 LISP_VARIANT=
4 MOTIF_VARIANT=
5 TARGET_DIR=
6
7 if [ $# = 1 ]; then
8 # Only target directory given. Try to deduce the lisp-variant
9 TARGET_DIR="$1"
10 case `uname -s` in
11 SunOS) LISP_VARIANT=sun4_solaris_gcc ;;
12 Linux) LISP_VARIANT=linux_gencgc ;;
13 # Please fill in some other common systems
14 *) echo "Sorry, please specify the desired Lisp variant."
15 exit 1 ;;
16 esac
17 elif [ $# = 2 ]; then
18 # Target directory and lisp-variant given
19 TARGET_DIR="$1"
20 LISP_VARIANT="$2"
21 elif [ $# = 3 ]; then
22 # Target directory, lisp-variant, and motif variant given
23 TARGET_DIR="$1"
24 LISP_VARIANT="$2"
25 MOTIF_VARIANT="$3"
26 else
27 echo "Usage: $0 target-directory [lisp-variant [motif-variant]]"
28 # List the available lisp-variants
29 echo Possible lisp-variants:
30 ( cd src/lisp/ ; ls -1 Config.* ) | sed 's;^Config[.];;g' | \
31 pr -3at -o 8
32 echo Possible Motif-variants:
33 ( cd src/motif/server/ ; ls -1 Config.* ) | sed 's;^Config[.];;g' | \
34 pr -3at -o 8
35 exit 1
36 fi
37
38 [ -d $1 ] && echo "Error: Directory $1 exists already!" && exit 2
39
40 TARGET="`echo $TARGET_DIR | sed 's:/*$::'`"
41
42 # Make sure the given variants exist
43 if [ ! -f src/lisp/Config.$LISP_VARIANT ]; then
44 echo "No such lisp-variant could be found: Config.$LISP_VARIANT"
45 exit 1
46 fi
47
48 # From the given variant, try to derive a motif variant
49 if [ "$MOTIF_VARIANT" = "" ]; then
50 case $LISP_VARIANT in
51 alpha_linux) MOTIF_VARIANT=alpha_linux ;;
52 alpha_osf1) MOTIF_VARIANT=alpha_osf1 ;;
53 FreeBSD*) MOTIF_VARIANT=FreeBSD ;;
54 NetBSD*) MOTIF_VARIANT=NetBSD ;;
55 OpenBSD*) MOTIF_VARIANT=OpenBSD ;;
56 sun4_solaris*) MOTIF_VARIANT=solaris ;;
57 sun4c*) MOTIF_VARIANT=sun4c_411 ;;
58 hp700*) MOTIF_VARIANT=hpux_cc ;;
59 pmax_mach) MOTIF_VARIANT=pmax_mach ;;
60 sgi*) MOTIF_VARIANT=irix ;;
61 linux*) MOTIF_VARIANT=x86 ;;
62 esac
63 elif [ ! -f src/motif/server/Config.$MOTIF_VARIANT ]; then
64 echo "No such motif-variant could be found: Config.$MOTIF_VARIANT"
65 exit 1
66 fi
67
68 # Tell user what's we've configured
69 echo "Lisp = $LISP_VARIANT"
70 echo "Motif = $MOTIF_VARIANT"
71
72 # Create a directory tree that mirrors the source directory tree
73 find src -name 'CVS' -prune -o -type d -print \
74 | sed "s:^src:$TARGET:g" | xargs mkdir
75
76 # Link Makefile and Config files
77 ( cd $TARGET/lisp ; ln -s ../../src/lisp/GNUmakefile ./Makefile )
78 ( cd $TARGET/lisp ; ln -s ../../src/lisp/Config.$LISP_VARIANT ./Config )
79
80 # Create empty initial map file
81 echo 'Map file for lisp version 0' > $TARGET/lisp/lisp.nm
82
83 # Create dummy internals.h so we get warned to recompile
84 echo '#error You need to run genesis (via build-world.sh) before compiling the startup code!' > $TARGET/lisp/internals.h
85
86 SETENV=src/tools/setenv-scripts
87
88 # Create sample setenv.lisp file
89 cat $SETENV/base-features.lisp > $TARGET/setenv.lisp
90
91 # Put in some platform specific items
92 case $LISP_VARIANT in
93 *linux*)
94 case $$LISP_VARIANT in
95 *_gencgc*) gcname=":gencgc" ;;
96 *) gcname=":cgc" ;;
97 esac
98 sed "s;@@gcname@@;$gcname;" $SETENV/linux-features.lisp >> $TARGET/setenv.lisp
99 ;;
100 *OpenBSD*)
101 case $LISP_VARIANT in
102 *_gencgc*) gcname=":gencgc" ;;
103 *) gcname=":cgc" ;;
104 esac
105 sed "s;@@gcname@@;$gcname;" $SETENV/openbsd-features.lisp >> $TARGET/setenv.lisp
106 ;;
107 *solaris*)
108 cat $SETENV/solaris-features.lisp >> $TARGET/setenv.lisp
109 ;;
110 *)
111 sed "s;@@LISP@@;$LISP_VARIANT;" $SETENV/unknown.lisp >> $TARGET/setenv.lisp
112 ;;
113 esac
114
115
116 # Do Motif setup
117 if [ "$MOTIF_VARIANT" != "" ]
118 then
119 ( cd $TARGET/motif/server ; ln -s ../../../src/motif/server/GNUmakefile ./Makefile )
120 ( cd $TARGET/motif/server ; ln -s ../../../src/motif/server/Config.$MOTIF_VARIANT ./Config )
121 fi

  ViewVC Help
Powered by ViewVC 1.1.5