summaryrefslogtreecommitdiff
blob: 43b2d66dde9eea28a7c41fea3c3d557f6318b90a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
Index: ocs/doc/minitutorial/SysDefs
===================================================================
--- ocs.orig/doc/minitutorial/SysDefs
+++ ocs/doc/minitutorial/SysDefs
@@ -13,7 +13,7 @@ NODENAME = minitutorial
 DOCNAME = minitutorial
 
 HTMLS = minitutorial.html mintut_genlb.html \
-	  mintut_index.html mintut_opener.html \
+	  mintut_index.html mintut_opener.html mintut_oasys.html \
 	  mintut_prep.html mintut_start.html mintut_uselb.html \
 	  mintut_doc.html ocs.html mintut_prop.html
 
Index: ocs/doc/dosfopman/SysDefs
===================================================================
--- ocs.orig/doc/dosfopman/SysDefs
+++ ocs/doc/dosfopman/SysDefs
@@ -70,7 +70,7 @@ TEXI2DVI = TEXINPUTS=$(DOSFOP)/tex:$(TEX
 %.html %_toc.html %_body.html %_indices.html %_title.html: %.expanded
 	mv $*.texi $*.texi.old
 	cp $*.expanded $*.texi
-	$(PERL) $(DOSFOP)/bin/texi2html -menu  -toc_name "Table of Contents" -verbose $*.texi
+	$(TEXI2HTML_RUN) $*.texi
 	mv $*.texi.old $*.texi
 
 %.ps: %.dvi
Index: ocs/doc/hcguide/SysDefs
===================================================================
--- ocs.orig/doc/hcguide/SysDefs
+++ ocs/doc/hcguide/SysDefs
@@ -65,7 +65,7 @@ TEXI2DVI = MAKEINFO='$(PERL) $(DOSFOP)/b
 %.html %_toc.html %_body.html %_indices.html %_title.html: %.expanded
 	mv $*.texi $*.texi.old
 	cp $*.expanded $*.texi
-	$(PERL) $(DOSFOP)/bin/texi2html -menu  -toc_name "Table of Contents" -verbose $*.texi
+	$(TEXI2HTML_RUN) $*.texi
 	mv $*.texi.old $*.texi
 
 %.ps: %.dvi
Index: ocs/doc/oasysman/SysDefs
===================================================================
--- ocs.orig/doc/oasysman/SysDefs
+++ ocs/doc/oasysman/SysDefs
@@ -73,7 +73,7 @@ TEXI2DVI = MAKEINFO=$(DOSFOP)/bin/dosfop
 %.html %_toc.html %_body.html %_indices.html %_title.html: %.expanded
 	mv $*.texi $*.texi.old
 	cp $*.expanded $*.texi
-	$(PERL) $(DOSFOP)/bin/texi2html -menu  -toc_name "Table of Contents" -verbose $*.texi
+	$(TEXI2HTML_RUN) $*.texi
 	mv $*.texi.old $*.texi
 
 %.ps: %.dvi
Index: ocs/doc/install/SysDefs
===================================================================
--- ocs.orig/doc/install/SysDefs
+++ ocs/doc/install/SysDefs
@@ -65,7 +65,7 @@ TEXI2DVI = MAKEINFO='$(PERL) $(DOSFOP)/b
 %.html %_toc.html %_body.html %_indices.html %_title.html: %.expanded
 	mv $*.texi $*.texi.old
 	cp $*.expanded $*.texi
-	$(PERL) $(DOSFOP)/bin/texi2html -menu  -toc_name "Table of Contents" -verbose $*.texi
+	$(TEXI2HTML_RUN) $*.texi
 	mv $*.texi.old $*.texi
 
 %.ps: %.dvi
Index: ocs/doc/bibopalicaman/DOSFOP/JavaCheck.structures.names
===================================================================
--- ocs.orig/doc/bibopalicaman/DOSFOP/JavaCheck.structures.names
+++ /dev/null
@@ -1,4 +0,0 @@
-JavaCatch
-JavaCheck
-JavaNull
-JavaNullArray
Index: ocs/doc/bibopalicaman/DOSFOP/JavaVM.structures.names
===================================================================
--- ocs.orig/doc/bibopalicaman/DOSFOP/JavaVM.structures.names
+++ /dev/null
@@ -1,4 +0,0 @@
-Byte
-JavaVM
-Long
-Short
\ Kein Zeilenumbruch am Dateiende.
Index: ocs/doc/bibopalica/SysDefs
===================================================================
--- ocs.orig/doc/bibopalica/SysDefs
+++ ocs/doc/bibopalica/SysDefs
@@ -70,7 +70,7 @@ TEXI2DVI = MAKEINFO='$(PERL) $(DOSFOP)/b
 %.html %_toc.html %_body.html %_indices.html %_title.html: %.expanded
 	mv $*.texi $*.texi.old
 	cp $*.expanded $*.texi
-	$(PERL) $(DOSFOP)/bin/texi2html -menu  -toc_name "Table of Contents" -verbose $*.texi
+	$(TEXI2HTML_RUN) $*.texi
 	mv $*.texi.old $*.texi
 
 %.ps: %.dvi
Index: ocs/src/om/make/GlobalRules.top
===================================================================
--- ocs.orig/src/om/make/GlobalRules.top
+++ ocs/src/om/make/GlobalRules.top
@@ -69,7 +69,7 @@ endif
 
 $(TOPCOM):  $(OS) $(OCSDIR)/_$(TOPSTRUCT)_$(TOPCOM).o \
 	    $(SYS_LDLIBDEPS) $(LDLIBDEPS)
-	@$(ECHO) "Linking $(TOPCOM) ..." ; \
+	$(ECHO) "Linking $(TOPCOM) ..." ; \
 	$(LD) $(LDFLAGS) $(SYS_LDFLAGS) -o $(TOPCOM) \
 	$(OCSDIR)/_$(TOPSTRUCT)_$(TOPCOM).o $(OS) \
 	$(SYS_LDLIBPATH) $(LDLIBPATH) $(RLDLIBPATH) \
Index: ocs/src/om/specs/Specs.basic.in
===================================================================
--- ocs.orig/src/om/specs/Specs.basic.in
+++ ocs/src/om/specs/Specs.basic.in
@@ -49,7 +49,8 @@ DEBUG_CC	= @ocs_cv_flag_cc_debug@
 PROFILE_CC	= @ocs_cv_flag_cc_profile@
 
 # The linker and its initial arguments
-OCSLIBPATH = ${OCS}/lib/${OSARCH} 
+#OCSLIBPATH = $(echo ${OCS}/lib/${OSARCH} | sed -e 's:'${DESTDIR}'\('.*'\):\1:g')
+OCSLIBPATH = ${OCS}/lib/${OSARCH}
 
 LD	= @ocs_LD@
 
@@ -118,12 +119,6 @@ XDVI		= @ac_cv_path_XDVI@
 # force TEXINPUTS to be defined (fixes a bug in dosfop)
 TEXINPUTS	:= ${TEXINPUTS}
 
-
-# --- Info related
-
-TEXINDEX	= @ac_cv_path_TEXINDEX@
-MAKEINFO	= @ac_cv_path_MAKEINFO@
-
 # --- Interpreters
 
 # perl 4 or perl 5
@@ -132,6 +127,15 @@ PERL		= @ac_cv_path_PERL@
 # Tcl/Tk 
 WISH		= @ac_cv_path_WISH@
 
+# --- Info related
+
+TEXINDEX	= @ac_cv_path_TEXINDEX@
+MAKEINFO	= @ac_cv_path_MAKEINFO@
+
+# Added for Debian packaging.
+TEXI2HTML	= ${PERL} ${DOSFOP}/bin/texi2html
+TEXI2HTML_RUN	= ${TEXI2HTML} -menu  -toc_name Table\ of\ Contents -verbose
+
 # ---- Java related
 # Java VM
 JAVA            = @ac_cv_path_JAVA@
Index: ocs/src/om/specs/Specs.lib.opal_java
===================================================================
--- ocs.orig/src/om/specs/Specs.lib.opal_java
+++ ocs/src/om/specs/Specs.lib.opal_java
@@ -12,11 +12,11 @@
 
 # The variable below needs to be configured depending on how Java 
 #   is linked on the platform
-JAVALINK = -L/usr/lib/java/lib/i686/green_threads -Wl,-rpath,/usr/lib/java/lib/i686/green_threads -ljava
+JAVALINK = -L/usr/lib/kaffe/jre/lib/i386 -lkaffevm -lkaffeverifier -lkaffegc -lffi -lpthread
 
 # The variable below needs to be configured depending on how Java headers
 #   are included on the platform (only for source distributions)
-JAVAINCLUDE = -I/usr/lib/java/include -I/usr/lib/java/include/genunix -I/usr/lib/java/include/linux
+JAVAINCLUDE = -I/usr/lib/kaffe/include
 
 
 ## packages which must be installed before (no need for transitive closure)
Index: ocs/configure.in
===================================================================
--- ocs.orig/configure.in
+++ ocs/configure.in
@@ -1613,8 +1613,9 @@ then
       ocs_save_LIBS="$LIBS"
       LIBS="$LIBS $ocs_cv_with_java_lib"
       unset ac_cv_lib_java_JNI_CreateJavaVM
-      AC_CHECK_LIB(JNI_CreateJavaVM,ocs_lib_java=$ocs_cv_with_java_lib)
-      LIBS="$ocs_save_LIBS"
+      AC_CHECK_FUNC(JNI_CreateJavaVM, ocs_lib_java="$ocs_cv_with_java_lib")
+      # AC_CHECK_LIB($ocs_cv_with_java_lib, JNI_CreateJavaVM, ocs_lib_java="$ocs_cv_with_java_lib")
+      # LIBS="$ocs_save_LIBS"
     fi
   fi
   if test -z "$ocs_lib_java"
Index: ocs/Makefile.in
===================================================================
--- ocs.orig/Makefile.in
+++ ocs/Makefile.in
@@ -9,6 +9,7 @@
 
 default: usage
 
+DESTDIR=
 srcdir=@srcdir@
 bindir=@bindir@
 prefix=@prefix@
@@ -21,7 +22,7 @@ OCSSRC=@ocs_abssrcdir@/src
 OCSPROJECT=@ocs_abssrcdir@/ProjectDefs
 #.. Path to the place where the distribution is to be installed
 OCSHDIR=ocs-$(VERSION)
-OCSHOME=@prefix@/$(OCSHDIR)
+OCSHOME=$(prefix)/$(OCSHDIR)
 #.. Description of your system 
 OSARCH=@host_os@-@host_cpu@
 #.. Path to the GNU sed program
@@ -54,7 +55,7 @@ EXTRAS=
 LOCALLINKS=@ocs_cv_feature_locallinks@
 
 ifeq ($(LOCALLINKS),yes)
-EXTRAS:=$(EXTRAS) $(addprefix @bindir@/,btrace dosfop javabind oasys oasyspc ocs ordinatrice pureDosfop tivi2)
+EXTRAS:=$(EXTRAS) $(addprefix $(DESTDIR)@bindir@/,btrace dosfop javabind oasys oasyspc ocs ordinatrice pureDosfop tivi2)
 endif
 
 #.. name of the distribution archives
@@ -69,18 +70,19 @@ MINPACKAGES = pkg.opalimports lib.opal_b
 MINSRCPACKAGES	=	pkg.examples
 PACKAGES = $(MINPACKAGES) $(STDPACKAGES)
 
-OCSADMIN=OCSPROJECT=$(OCSPROJECT) $(OCSHOME)/bin/ocsadmin -ocshome $(OCSHOME) -ocssrc $(OCSSRC) -ocsspecs $(OCSSRC)/om/specs
-OCSADMININIT=OCSPROJECT=$(OCSPROJECT) $(OCSSRC)/om/scripts/ocsadmin -ocssrc $(OCSSRC) -ocshome $(OCSHOME) -ocsspecs $(OCSSRC)/om/specs
+OCSADMIN=OCSPROJECT=$(OCSPROJECT) $(DESTDIR)$(OCSHOME)/bin/ocsadmin -ocshome $(DESTDIR)$(OCSHOME) -ocssrc $(OCSSRC) -ocsspecs $(OCSSRC)/om/specs
+OCSADMININIT=OCSPROJECT=$(OCSPROJECT) $(OCSSRC)/om/scripts/ocsadmin -ocssrc $(OCSSRC) -ocshome $(DESTDIR)$(OCSHOME) -ocsspecs $(OCSSRC)/om/specs
+OCS_BIN=ocs
 
 install: init $(PACKAGES) $(EXTRAS)
 	$(OCSADMIN) install $(MINSRCPACKAGES)
-	chmod -R a+r @prefix@/ocs-$(VERSION)/*
-	chmod a+x @prefix@/ocs-$(VERSION)/bin/*
+	chmod -R a+r $(DESTDIR)$(prefix)/ocs-$(VERSION)/*
+	chmod a+x $(DESTDIR)$(prefix)/ocs-$(VERSION)/bin/*
 
 reinstall: reinit $(PACKAGES) $(EXTRAS)
 	$(OCSADMIN) install $(MINSRCPACKAGES)
-	chmod -R a+r @prefix@/ocs-$(VERSION)/*
-	chmod a+x @prefix@/ocs-$(VERSION)/bin/*
+	chmod -R a+r $(DESTDIR)$(prefix)/ocs-$(VERSION)/*
+	chmod a+x $(DESTDIR)$(prefix)/ocs-$(VERSION)/bin/*
 
 init:
 	$(OCSADMININIT) init -sed $(SED) "$(LONGVERSION)"
@@ -112,54 +114,70 @@ complete: $(STDPACKAGES)
 #	$(OCSADMININIT) ocs -command cleanall $(MINSRCPACKAGES) $(STDPACKAGES)
 
 distclean:
-	(cd $(OCSSRC)/om; ocs cleanobjall)
-	(cd $(OCSSRC)/oc; ocs cleanobjall)
-	(cd $(OCSSRC)/lib; ocs cleanobjall)
-	(cd $(OCSSRC)/oc/dynamite; ocs cleanall)
-	(cd $(OCSSRC)/oc/reflections; ocs cleanall)
-	(cd $(OCSSRC)/oc/oc5; ocs cleanall)
-	(cd $(OCSSRC)/lib/Tools/OpalWin; ocs cleanall)
-	(cd $(OCSSRC)/lib/Tools/OpalWinAdditions; ocs cleanall)
-	(cd $(OCSSRC)/lib/Tools/ParserLight; ocs cleanall)
-	(cd $(OCSSRC)/lib/Tools/Readline; ocs cleanall)
-	(cd $(OCSSRC)/lib/Tools/Tcl; ocs cleanall)
-	(cd $(OCSSRC)/lib/Tools/Tk; ocs cleanall)
-	(cd $(OCSSRC)/lib/Tools/Java; ocs cleanall)
-	(cd $(OCSSRC)/lib/Tools/Java/JavaBase; ocs cleanall)
-	(cd $(OCSSRC)/lib/Tools/Java/JavaCheck; ocs cleanall)
-	(cd $(OCSSRC)/browser; ocs cleanall)
-	(cd $(OCSSRC)/dosfop; ocs -P $(OCSSRC)/dosfop/ProjectDefs.dosfop cleanall)
-	(cd $(OCSSRC)/emacs; ocs cleanall)
-	(cd $(OCSSRC)/oasys; ocs cleanall)
-	(cd $(OCSSRC)/ordinatrice; ocs cleanall)
-	(cd $(OCSSRC)/tivi2; ocs cleanall)
-	(cd $(OCSSRC)/../doc; ocs cleanall)
-	(cd $(OCSSRC)/../examples; ocs cleanall; cd ProofChecker; ocs cleanall)
-	(cd $(OCSSRC)/proofchecker/oasyspc/libPlus; ocs cleanall)
-	(cd $(OCSSRC)/proofchecker/oasyspc/oasysPlus; ocs cleanall)
-	(cd $(OCSSRC)/proofchecker/oasyspc/derivations; ocs cleanall)
-	(cd $(OCSSRC)/proofchecker/oasyspc/proofscript; ocs cleanall)
-	(cd $(OCSSRC)/proofchecker/oasyspc/pcheck; ocs cleanall)
-	(cd $(OCSSRC)/proofchecker/oasyspc/pdriver; ocs cleanall)
-	(cd $(OCSSRC)/proofchecker/prooflib; ocs cleanall)
+	(cd $(OCSSRC)/om; $(OCS_BIN) cleanobjall)
+	(cd $(OCSSRC)/oc; $(OCS_BIN) cleanobjall)
+	(cd $(OCSSRC)/lib; $(OCS_BIN) cleanobjall)
+	(cd $(OCSSRC)/oc/dynamite; $(OCS_BIN) cleanall)
+	(cd $(OCSSRC)/oc/reflections; $(OCS_BIN) cleanall)
+	(cd $(OCSSRC)/oc/oc5; $(OCS_BIN) cleanall)
+	(cd $(OCSSRC)/lib/Tools/OpalWin; $(OCS_BIN) cleanall)
+	(cd $(OCSSRC)/lib/Tools/OpalWinAdditions; $(OCS_BIN) cleanall)
+	(cd $(OCSSRC)/lib/Tools/ParserLight; $(OCS_BIN) cleanall)
+	(cd $(OCSSRC)/lib/Tools/Readline; $(OCS_BIN) cleanall)
+	(cd $(OCSSRC)/lib/Tools/Tcl; $(OCS_BIN) cleanall)
+	(cd $(OCSSRC)/lib/Tools/Tk; $(OCS_BIN) cleanall)
+	(cd $(OCSSRC)/lib/Tools/Java; $(OCS_BIN) cleanall)
+	(cd $(OCSSRC)/lib/Tools/Java/JavaBase; $(OCS_BIN) cleanall)
+	(cd $(OCSSRC)/lib/Tools/Java/JavaCheck; $(OCS_BIN) cleanall)
+	(cd $(OCSSRC)/browser; $(OCS_BIN) cleanall)
+	(cd $(OCSSRC)/dosfop; $(OCS_BIN) -P $(OCSSRC)/dosfop/ProjectDefs.dosfop cleanall)
+	(cd $(OCSSRC)/emacs; $(OCS_BIN) cleanall)
+	(cd $(OCSSRC)/oasys; $(OCS_BIN) cleanall)
+	(cd $(OCSSRC)/ordinatrice; $(OCS_BIN) cleanall)
+	(cd $(OCSSRC)/tivi2; $(OCS_BIN) cleanall)
+	(cd $(OCSSRC)/../doc; $(OCS_BIN) cleanall)
+	(cd $(OCSSRC)/../examples; $(OCS_BIN) cleanall; cd ProofChecker; $(OCS_BIN) cleanall)
+	(cd $(OCSSRC)/proofchecker/oasyspc/libPlus; $(OCS_BIN) cleanall)
+	(cd $(OCSSRC)/proofchecker/oasyspc/oasysPlus; $(OCS_BIN) cleanall)
+	(cd $(OCSSRC)/proofchecker/oasyspc/derivations; $(OCS_BIN) cleanall)
+	(cd $(OCSSRC)/proofchecker/oasyspc/proofscript; $(OCS_BIN) cleanall)
+	(cd $(OCSSRC)/proofchecker/oasyspc/pcheck; $(OCS_BIN) cleanall)
+	(cd $(OCSSRC)/proofchecker/oasyspc/pdriver; $(OCS_BIN) cleanall)
+	(cd $(OCSSRC)/proofchecker/prooflib; $(OCS_BIN) cleanall)
 	rm -f opalconfig.last opalconfig.makeTargets
 
+# Special target for generating Debian .diff files. Use with care! This might
+# render the source tree "unbuildable".
+mrproper:
+	(cd $(OCSSRC)/../doc; $(OCS_BIN) cleanall)
+	(cd $(OCSSRC); $(OCS_BIN) cleanall)
+	rm -f config.status config.sub config.guess config.log Makefile
+	rm -f src/oc/reflections/InterOpalTools.impl \
+	      src/oc/dynamite/InterOpalTools.impl \
+	      src/om/specs/Specs.basic \
+	      src/om/specs/Specs.pkg.oasys \
+	      src/om/specs/Specs.lib.opal_readline \
+	      src/om/specs/Specs.lib.opal_tk \
+	      src/om/specs/ShSpecs.basic \
+	      src/om/specs/Specs.lib.opal_tcl \
+	      src/lib/Internal/Compiler/unixconfig.h
+
 preparedist:
-	cd $(OCSSRC)/lib; ocs cleanall; OCSSRC=$(OCSSRC); export OCSSRC; ocs -P $(OCSSRC)/ProjectDefs.bootstrap
-	cd $(OCSSRC)/om; ocs cleanall; OCSSRC=$(OCSSRC); export OCSSRC; ocs -P $(OCSSRC)/ProjectDefs.bootstrap
-	cd $(OCSSRC)/oc; ocs cleanall; OCSSRC=$(OCSSRC); export OCSSRC; ocs -P $(OCSSRC)/ProjectDefs.bootstrap
-	cd $(OCSSRC)/../doc/install; OCSSRC=$(OCSSRC); export OCSSRC; ocs 
+	cd $(OCSSRC)/lib; $(OCS_BIN) cleanall; OCSSRC=$(OCSSRC); export OCSSRC; $(OCS_BIN) -P $(OCSSRC)/ProjectDefs.bootstrap
+	cd $(OCSSRC)/om; $(OCS_BIN) cleanall; OCSSRC=$(OCSSRC); export OCSSRC; $(OCS_BIN) -P $(OCSSRC)/ProjectDefs.bootstrap
+	cd $(OCSSRC)/oc; $(OCS_BIN) cleanall; OCSSRC=$(OCSSRC); export OCSSRC; $(OCS_BIN) -P $(OCSSRC)/ProjectDefs.bootstrap
+	cd $(OCSSRC)/../doc/install; OCSSRC=$(OCSSRC); export OCSSRC; $(OCS_BIN) 
 	cp $(OCSSRC)/../doc/install/*.html .
 
 prepareoc:
-	cd $(OCSSRC)/oc; ocs cleanall; OCSSRC=$(OCSSRC); export OCSSRC; ocs -P $(OCSSRC)/ProjectDefs.bootstrap
+	cd $(OCSSRC)/oc; $(OCS_BIN) cleanall; OCSSRC=$(OCSSRC); export OCSSRC; $(OCS_BIN) -P $(OCSSRC)/ProjectDefs.bootstrap
 
 preparedoc: 
-	cd $(OCSSRC)/../doc; OCSSRC=$(OCSSRC); export OCSSRC; ocs 
+	cd $(OCSSRC)/../doc; OCSSRC=$(OCSSRC); export OCSSRC; $(OCS_BIN) 
 	cp $(OCSSRC)/../doc/install/*.html .
 
 prepareom:
-	cd $(OCSSRC)/om; ocs cleanall; OCSSRC=$(OCSSRC); export OCSSRC; ocs -P $(OCSSRC)/ProjectDefs.bootstrap
+	cd $(OCSSRC)/om; $(OCS_BIN) cleanall; OCSSRC=$(OCSSRC); export OCSSRC; $(OCS_BIN) -P $(OCSSRC)/ProjectDefs.bootstrap
 
 sourcedistr: ocs-version
 	cp -f ignore1  /tmp; cp -f ignore2  /tmp; \
@@ -196,14 +214,14 @@ config.status: configure
 
 ### generate links in /usr/local/bin
 
-@bindir@/% : 
+$(DESTDIR)@bindir@/% : 
 	if test -f $(OCSHOME)/bin/$* ; then \
 		echo "#! /bin/sh" > $@ ;\
 		echo "# generated by OCS" >> $@ ; \
 		echo "OCS=$(prefix)/ocs" >> $@ ; \
 		echo "export OCS" >> $@ ; \
 		echo "$(prefix)/ocs/bin/$* \$$*" >> $@ ; \
-		chmod a+x $(prefix)/bin/$* ; \
-		echo "rm -f $@" >> $(OCSHOME)/etc/uninstall-locallinks ; \
+		chmod a+x $(DESTDIR)$(prefix)/bin/$* ; \
+		echo "rm -f $(prefix)/bin/$*" >> $(DESTDIR)$(OCSHOME)/etc/uninstall-locallinks ; \
         fi