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

Contents of /meta-cvs/F-156CAB88D4EEE783E8C4B4146B5094E2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.16 - (show annotations)
Tue Jan 14 05:46:15 2003 UTC (11 years, 3 months ago) by kaz
Branch: MAIN
CVS Tags: mcvs-1-0-3
Changes since 1.15: +4 -10 lines
Merging from mcvs-1-0-branch.

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

  ViewVC Help
Powered by ViewVC 1.1.5