/[meta-cvs]/meta-cvs/F-156CAB88D4EEE783E8C4B4146B5094E2
ViewVC logotype

Contents of /meta-cvs/F-156CAB88D4EEE783E8C4B4146B5094E2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.15 - (hide annotations)
Sat Dec 14 05:35:06 2002 UTC (11 years, 4 months ago) by kaz
Branch: MAIN
Changes since 1.14: +15 -3 lines
Merging from mcvs-1-0-branch.

* code/install.sh: Now works under CLISP installations which
call the CLISP executable lisp.exe rather than lisp.run.
This is the case under Cygwin as of CLISP 2.30 or so.
1 kaz 1.1 #!/bin/sh
2    
3 kaz 1.7 if ! CLISP_PATH="$(which clisp)" ; then
4     echo clisp command not found
5     exit 1
6     fi
7    
8     CLISP_ROOT=$(dirname $(dirname "$CLISP_PATH"))
9     CLISP_LIB="$CLISP_ROOT/lib/clisp"
10    
11 kaz 1.5 LINKSET=unix-bindings-linking-set
12    
13 kaz 1.1 if [ $# != 1 ] ; then
14 kaz 1.5 echo
15     echo "Meta-CVS Installer"
16     echo
17     echo "Please specify the target prefix, as a full absolute path."
18     echo "For example, specifying /usr/local will place files under"
19     echo "/usr/local/bin and /usr/local/lib."
20     echo
21 kaz 1.1 exit 1
22     else
23 kaz 1.8 TARGET="$1"
24 kaz 1.1 fi
25    
26 kaz 1.12 space_check()
27 kaz 1.8 {
28     if [ $# -gt 1 ] ; then
29 kaz 1.9 echo "The path \"$*\" contains whitespace."
30 kaz 1.8 exit 1
31     fi
32     }
33    
34 kaz 1.12 dash_check()
35 kaz 1.10 {
36     case $1 in
37     -* )
38     echo "The path $1 looks like a command line option."
39     exit 1
40     ;;
41     esac
42     }
43    
44 kaz 1.8 space_check $TARGET
45 kaz 1.10 dash_check $TARGET
46 kaz 1.8
47     TARGET_LIB=$TARGET/lib/clisp/meta-cvs
48     TARGET_BIN=$TARGET/bin
49 kaz 1.5
50     if ! mkdir -p $TARGET_LIB ; then
51     echo "Unable to create $TARGET_LIB directory."
52     exit 1
53     fi
54    
55     if ! mkdir -p $TARGET_BIN ; then
56     echo "Unable to create $TARGET_BIN directory."
57     exit 1
58     fi
59    
60     if [ ! -e $LINKSET ] ; then
61 kaz 1.7 export CLISP_LINKKIT="$CLISP_LIB/linkkit"
62     sh "$CLISP_LIB/clisp-link" add-module-set unix-bindings \
63     "$CLISP_LIB/base" $LINKSET
64 kaz 1.5 fi
65    
66 kaz 1.15 LISPRUN=$LINKSET/lisp
67    
68     if [ -f $LISPRUN.run ] ; then
69     LISPRUN=$LISPRUN.run
70     LISPEXE=.run
71     elif [ -f $LISPRUN.exe ] ; then
72     LISPRUN=$LISPRUN.exe
73     LISPEXE=.exe
74     else
75     echo "linking set failed to build."
76     exit 1
77     fi
78    
79 kaz 1.11 if ! $LISPRUN -M $LINKSET/lispinit.mem -q -c mcvs-main ; then
80 kaz 1.3 echo "There were compilation errors."
81     exit 1
82     fi
83    
84 kaz 1.11 $LISPRUN -M $LINKSET/lispinit.mem -q -i mcvs-main -x '(ext:saveinitmem "mcvs.mem" :quiet t)'
85 kaz 1.5
86 kaz 1.8 if ! cp mcvs.mem $TARGET_LIB/lispinit.mem; then
87 kaz 1.9 echo "Unable to copy to $TARGET_LIB."
88 kaz 1.5 exit 1
89     fi
90 kaz 1.1
91 kaz 1.15 if ! cp $LISPRUN $TARGET_LIB; then
92 kaz 1.9 echo "Unable to copy to $TARGET_LIB."
93 kaz 1.1 exit 1
94     fi
95    
96 kaz 1.8 if ! cat > $TARGET_BIN/mcvs <<END
97 kaz 1.15 #!$TARGET_LIB/lisp$LISPEXE -M$TARGET_LIB/lispinit.mem
98 kaz 1.14 (meta-cvs:main)
99 kaz 1.1 END
100     then
101 kaz 1.9 echo "Could not create mcvs script in $TARGET."
102 kaz 1.1 exit 1
103     fi
104    
105 kaz 1.5 if ! chmod a+x "$TARGET_BIN/mcvs" ; then
106 kaz 1.9 echo "Could not set permissions of mcvs script in $TARGET."
107 kaz 1.1 exit 1
108     fi
109    
110 kaz 1.13 if ! cat > $TARGET_BIN/mcvs-upgrade <<END
111     #!/bin/sh
112     TARGET_LIB="$TARGET_LIB"
113     LISPRUN="\$TARGET_LIB/lisp.run -M \$TARGET_LIB/lispinit.mem"
114    
115     if [ \$# != 1 ] ; then
116     echo
117     echo "Syntax:"
118     echo
119     echo " mcvs-upgrade <path-to-source>"
120     echo
121     echo "The path specifies the directory which holds unpacked Meta-CVS source,"
122     echo "the place where the file mcvs-main.lisp is located."
123     echo
124     echo "This upgrade mechanism is intended to make it possible to use a"
125     echo "newer version of Meta-CVS without having to obtain a complete binary"
126     echo "distribution that includes the Lisp executable, and without having"
127     echo "to install the Lisp development environment to build the sources."
128     echo
129     echo "Note that it's not possible to upgrade if the newer Meta-CVS sources"
130     echo "rely on new C functions being linked into the Lisp system; get a"
131     echo "new binary distribution, or set up CLISP and compile Meta-CVS from"
132     echo "the sources using its install.sh script"
133     echo
134     echo "Ignore the copious compiler warnings about objects and functions"
135     echo "being redefined; this is what we want."
136     echo
137     exit 1
138     fi
139    
140     SOURCE_PATH="\$1"
141    
142     if ! cd "\$SOURCE_PATH" ; then
143     echo "unable to change to \$SOURCE_PATH"
144     exit 1
145     fi
146    
147     if ! \$LISPRUN -c mcvs-main ; then
148     echo "unable to compile"
149     exit 1
150     fi
151    
152     if ! \$LISPRUN -q -i mcvs-main -x '(ext:saveinitmem "mcvs.mem" :quiet t)' ; then
153     echo "unable to load and generate memory image"
154     exit 1
155     fi
156    
157     if ! cp mcvs.mem \$TARGET_LIB/lispinit.mem ; then
158     echo "unable to copy new Meta-CVS image to \$TARGET_LIB directory."
159     exit 1
160     fi
161    
162     echo
163     echo "It appears that Meta-CVS has been re-generated from the given sources."
164     echo
165    
166     END
167     then
168     echo "Could not create mcvs script in $TARGET."
169     exit 1
170     fi
171    
172     if ! chmod a+x "$TARGET_BIN/mcvs-upgrade" ; then
173     echo "Could not set permissions of mcvs script in $TARGET."
174     exit 1
175     fi
176    
177 kaz 1.1 exit 0

  ViewVC Help
Powered by ViewVC 1.1.5