/[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.5 - (hide annotations)
Fri Jul 1 13:12:02 2005 UTC (8 years, 9 months ago) by rtoy
Branch: MAIN
CVS Tags: snapshot-2005-07
Changes since 1.4: +1 -0 lines
File MIME type: application/x-sh
FreeBSD patches from Eduardo Munoz:

tools/build.sh:
o If gmake exists, assume it is GNU make and use it instead of make.

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

  ViewVC Help
Powered by ViewVC 1.1.5