1 | case $CONFIG in |
---|
2 | '') |
---|
3 | if test ! -f config.sh; then |
---|
4 | ln ../config.sh . || \ |
---|
5 | ln ../../config.sh . || \ |
---|
6 | ln ../../../config.sh . || \ |
---|
7 | (echo "Can't find config.sh."; exit 1) |
---|
8 | fi 2>/dev/null |
---|
9 | . ./config.sh |
---|
10 | ;; |
---|
11 | esac |
---|
12 | case "$0" in |
---|
13 | */*) cd `expr X$0 : 'X\(.*\)/'` ;; |
---|
14 | esac |
---|
15 | |
---|
16 | case "$d_symlink" in |
---|
17 | *define*) sln='ln -s' ;; |
---|
18 | *) sln='ln';; |
---|
19 | esac |
---|
20 | |
---|
21 | case "$d_dosuid" in |
---|
22 | *define*) suidperl='suidperl' ;; |
---|
23 | *) suidperl='';; |
---|
24 | esac |
---|
25 | |
---|
26 | echo "Extracting Makefile (with variable substitutions)" |
---|
27 | rm -f Makefile |
---|
28 | cat >Makefile <<!GROK!THIS! |
---|
29 | # $RCSfile: Makefile.SH,v $$Revision: 1.2 $$Date: 1996-10-05 18:28:05 $ |
---|
30 | # |
---|
31 | # $Log: not supported by cvs2svn $ |
---|
32 | # Revision 1.1.1.1 1996/10/02 06:39:56 ghudson |
---|
33 | # Import of perl 4.036 |
---|
34 | # |
---|
35 | # Revision 4.0.1.4 92/06/08 11:40:43 lwall |
---|
36 | # patch20: cray didn't give enough memory to /bin/sh |
---|
37 | # patch20: various and sundry fixes |
---|
38 | # |
---|
39 | # Revision 4.0.1.3 91/11/05 15:48:11 lwall |
---|
40 | # patch11: saberized perl |
---|
41 | # patch11: added support for dbz |
---|
42 | # |
---|
43 | # Revision 4.0.1.2 91/06/07 10:14:43 lwall |
---|
44 | # patch4: cflags now emits entire cc command except for the filename |
---|
45 | # patch4: alternate make programs are now semi-supported |
---|
46 | # patch4: uperl.o no longer tries to link in libraries prematurely |
---|
47 | # patch4: installperl now installs x2p stuff too |
---|
48 | # |
---|
49 | # Revision 4.0.1.1 91/04/11 17:30:39 lwall |
---|
50 | # patch1: C flags are now settable on a per-file basis |
---|
51 | # |
---|
52 | # Revision 4.0 91/03/20 00:58:54 lwall |
---|
53 | # 4.0 baseline. |
---|
54 | # |
---|
55 | # |
---|
56 | |
---|
57 | CC = $cc |
---|
58 | YACC = $yacc |
---|
59 | bin = $installbin |
---|
60 | scriptdir = $scriptdir |
---|
61 | privlib = $installprivlib |
---|
62 | mansrc = $mansrc |
---|
63 | manext = $manext |
---|
64 | LDFLAGS = $ldflags |
---|
65 | CLDFLAGS = $ldflags |
---|
66 | SMALL = $small |
---|
67 | LARGE = $large $split |
---|
68 | mallocsrc = $mallocsrc |
---|
69 | mallocobj = $mallocobj |
---|
70 | SLN = $sln |
---|
71 | RMS = rm -f |
---|
72 | |
---|
73 | libs = $libs $cryptlib |
---|
74 | |
---|
75 | public = perl taintperl $suidperl |
---|
76 | |
---|
77 | shellflags = $shellflags |
---|
78 | |
---|
79 | # To use an alternate make, set $altmake in config.sh. |
---|
80 | MAKE = ${altmake-make} |
---|
81 | |
---|
82 | !GROK!THIS! |
---|
83 | |
---|
84 | cat >>Makefile <<'!NO!SUBS!' |
---|
85 | |
---|
86 | CCCMD = `sh $(shellflags) cflags $@` |
---|
87 | |
---|
88 | private = |
---|
89 | |
---|
90 | scripts = h2ph |
---|
91 | |
---|
92 | manpages = perl.man h2ph.man |
---|
93 | |
---|
94 | util = |
---|
95 | |
---|
96 | sh = Makefile.SH makedepend.SH h2ph.SH |
---|
97 | |
---|
98 | h1 = EXTERN.h INTERN.h arg.h array.h cmd.h config.h form.h handy.h |
---|
99 | h2 = hash.h perl.h regcomp.h regexp.h spat.h stab.h str.h util.h |
---|
100 | |
---|
101 | h = $(h1) $(h2) |
---|
102 | |
---|
103 | c1 = array.c cmd.c cons.c consarg.c doarg.c doio.c dolist.c dump.c |
---|
104 | c2 = eval.c form.c hash.c $(mallocsrc) perl.c regcomp.c regexec.c |
---|
105 | c3 = stab.c str.c toke.c util.c usersub.c |
---|
106 | |
---|
107 | c = $(c1) $(c2) $(c3) |
---|
108 | |
---|
109 | s1 = array.c cmd.c cons.c consarg.c doarg.c doio.c dolist.c dump.c |
---|
110 | s2 = eval.c form.c hash.c perl.c regcomp.c regexec.c |
---|
111 | s3 = stab.c str.c toke.c util.c usersub.c perly.c |
---|
112 | |
---|
113 | saber = $(s1) $(s2) $(s3) |
---|
114 | |
---|
115 | obj1 = array.o cmd.o cons.o consarg.o doarg.o doio.o dolist.o dump.o |
---|
116 | obj2 = eval.o form.o $(mallocobj) perl.o regcomp.o regexec.o |
---|
117 | obj3 = stab.o str.o toke.o util.o |
---|
118 | |
---|
119 | obj = $(obj1) $(obj2) $(obj3) |
---|
120 | |
---|
121 | tobj1 = tarray.o tcmd.o tcons.o tconsarg.o tdoarg.o tdoio.o tdolist.o tdump.o |
---|
122 | tobj2 = teval.o tform.o thash.o $(mallocobj) tregcomp.o tregexec.o |
---|
123 | tobj3 = tstab.o tstr.o ttoke.o tutil.o |
---|
124 | |
---|
125 | tobj = $(tobj1) $(tobj2) $(tobj3) |
---|
126 | |
---|
127 | lintflags = -hbvxac |
---|
128 | |
---|
129 | addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7 |
---|
130 | |
---|
131 | # grrr |
---|
132 | SHELL = /bin/sh |
---|
133 | |
---|
134 | .c.o: |
---|
135 | $(CCCMD) $*.c |
---|
136 | |
---|
137 | all: $(public) $(private) $(util) uperl.o $(scripts) |
---|
138 | cd x2p; $(MAKE) all |
---|
139 | touch all |
---|
140 | |
---|
141 | # This is the standard version that contains no "taint" checks and is |
---|
142 | # used for all scripts that aren't set-id or running under something set-id. |
---|
143 | # The $& notation is tells Sequent machines that it can do a parallel make, |
---|
144 | # and is harmless otherwise. |
---|
145 | |
---|
146 | perl: $& perly.o $(obj) hash.o usersub.o |
---|
147 | $(CC) $(LARGE) $(CLDFLAGS) $(obj) hash.o perly.o usersub.o $(libs) -o perl |
---|
148 | |
---|
149 | # This command assumes that /usr/include/dbz.h and /usr/lib/dbz.o exist. |
---|
150 | |
---|
151 | dbzperl: $& perly.o $(obj) zhash.o usersub.o |
---|
152 | $(CC) $(LARGE) $(CLDFLAGS) $(obj) zhash.o /usr/lib/dbz.o perly.o usersub.o $(libs) -o dbzperl |
---|
153 | |
---|
154 | zhash.o: hash.c $(h) |
---|
155 | $(RMS) zhash.c |
---|
156 | $(SLN) hash.c zhash.c |
---|
157 | $(CCCMD) -DWANT_DBZ zhash.c |
---|
158 | $(RMS) zhash.c |
---|
159 | |
---|
160 | uperl.o: $& perly.o $(obj) hash.o |
---|
161 | -ld $(LARGE) $(LDFLAGS) -r $(obj) hash.o perly.o -o uperl.o |
---|
162 | |
---|
163 | saber: $(saber) |
---|
164 | # load $(saber) |
---|
165 | # load /lib/libm.a |
---|
166 | |
---|
167 | # This version, if specified in Configure, does ONLY those scripts which need |
---|
168 | # set-id emulation. Suidperl must be setuid root. It contains the "taint" |
---|
169 | # checks as well as the special code to validate that the script in question |
---|
170 | # has been invoked correctly. |
---|
171 | |
---|
172 | suidperl: $& tperly.o sperl.o $(tobj) usersub.o |
---|
173 | $(CC) $(LARGE) $(CLDFLAGS) sperl.o $(tobj) tperly.o usersub.o $(libs) \ |
---|
174 | -o suidperl |
---|
175 | |
---|
176 | # This version interprets scripts that are already set-id either via a wrapper |
---|
177 | # or through the kernel allowing set-id scripts (bad idea). Taintperl must |
---|
178 | # NOT be setuid to root or anything else. The only difference between it |
---|
179 | # and normal perl is the presence of the "taint" checks. |
---|
180 | |
---|
181 | taintperl: $& tperly.o tperl.o $(tobj) usersub.o |
---|
182 | $(CC) $(LARGE) $(CLDFLAGS) tperl.o $(tobj) tperly.o usersub.o $(libs) \ |
---|
183 | -o taintperl |
---|
184 | |
---|
185 | # Replicating all this junk is yucky, but I don't see a portable way to fix it. |
---|
186 | |
---|
187 | tperly.o: perly.c perly.h $(h) |
---|
188 | $(RMS) tperly.c |
---|
189 | $(SLN) perly.c tperly.c |
---|
190 | $(CCCMD) -DTAINT tperly.c |
---|
191 | $(RMS) tperly.c |
---|
192 | |
---|
193 | tperl.o: perl.c perly.h patchlevel.h perl.h $(h) |
---|
194 | $(RMS) tperl.c |
---|
195 | $(SLN) perl.c tperl.c |
---|
196 | $(CCCMD) -DTAINT tperl.c |
---|
197 | $(RMS) tperl.c |
---|
198 | |
---|
199 | sperl.o: perl.c perly.h patchlevel.h $(h) |
---|
200 | $(RMS) sperl.c |
---|
201 | $(SLN) perl.c sperl.c |
---|
202 | $(CCCMD) -DTAINT -DIAMSUID sperl.c |
---|
203 | $(RMS) sperl.c |
---|
204 | |
---|
205 | tarray.o: array.c $(h) |
---|
206 | $(RMS) tarray.c |
---|
207 | $(SLN) array.c tarray.c |
---|
208 | $(CCCMD) -DTAINT tarray.c |
---|
209 | $(RMS) tarray.c |
---|
210 | |
---|
211 | tcmd.o: cmd.c $(h) |
---|
212 | $(RMS) tcmd.c |
---|
213 | $(SLN) cmd.c tcmd.c |
---|
214 | $(CCCMD) -DTAINT tcmd.c |
---|
215 | $(RMS) tcmd.c |
---|
216 | |
---|
217 | tcons.o: cons.c $(h) perly.h |
---|
218 | $(RMS) tcons.c |
---|
219 | $(SLN) cons.c tcons.c |
---|
220 | $(CCCMD) -DTAINT tcons.c |
---|
221 | $(RMS) tcons.c |
---|
222 | |
---|
223 | tconsarg.o: consarg.c $(h) |
---|
224 | $(RMS) tconsarg.c |
---|
225 | $(SLN) consarg.c tconsarg.c |
---|
226 | $(CCCMD) -DTAINT tconsarg.c |
---|
227 | $(RMS) tconsarg.c |
---|
228 | |
---|
229 | tdoarg.o: doarg.c $(h) |
---|
230 | $(RMS) tdoarg.c |
---|
231 | $(SLN) doarg.c tdoarg.c |
---|
232 | $(CCCMD) -DTAINT tdoarg.c |
---|
233 | $(RMS) tdoarg.c |
---|
234 | |
---|
235 | tdoio.o: doio.c $(h) |
---|
236 | $(RMS) tdoio.c |
---|
237 | $(SLN) doio.c tdoio.c |
---|
238 | $(CCCMD) -DTAINT tdoio.c |
---|
239 | $(RMS) tdoio.c |
---|
240 | |
---|
241 | tdolist.o: dolist.c $(h) |
---|
242 | $(RMS) tdolist.c |
---|
243 | $(SLN) dolist.c tdolist.c |
---|
244 | $(CCCMD) -DTAINT tdolist.c |
---|
245 | $(RMS) tdolist.c |
---|
246 | |
---|
247 | tdump.o: dump.c $(h) |
---|
248 | $(RMS) tdump.c |
---|
249 | $(SLN) dump.c tdump.c |
---|
250 | $(CCCMD) -DTAINT tdump.c |
---|
251 | $(RMS) tdump.c |
---|
252 | |
---|
253 | teval.o: eval.c $(h) |
---|
254 | $(RMS) teval.c |
---|
255 | $(SLN) eval.c teval.c |
---|
256 | $(CCCMD) -DTAINT teval.c |
---|
257 | $(RMS) teval.c |
---|
258 | |
---|
259 | tform.o: form.c $(h) |
---|
260 | $(RMS) tform.c |
---|
261 | $(SLN) form.c tform.c |
---|
262 | $(CCCMD) -DTAINT tform.c |
---|
263 | $(RMS) tform.c |
---|
264 | |
---|
265 | thash.o: hash.c $(h) |
---|
266 | $(RMS) thash.c |
---|
267 | $(SLN) hash.c thash.c |
---|
268 | $(CCCMD) -DTAINT thash.c |
---|
269 | $(RMS) thash.c |
---|
270 | |
---|
271 | tregcomp.o: regcomp.c $(h) |
---|
272 | $(RMS) tregcomp.c |
---|
273 | $(SLN) regcomp.c tregcomp.c |
---|
274 | $(CCCMD) -DTAINT tregcomp.c |
---|
275 | $(RMS) tregcomp.c |
---|
276 | |
---|
277 | tregexec.o: regexec.c $(h) |
---|
278 | $(RMS) tregexec.c |
---|
279 | $(SLN) regexec.c tregexec.c |
---|
280 | $(CCCMD) -DTAINT tregexec.c |
---|
281 | $(RMS) tregexec.c |
---|
282 | |
---|
283 | tstab.o: stab.c $(h) |
---|
284 | $(RMS) tstab.c |
---|
285 | $(SLN) stab.c tstab.c |
---|
286 | $(CCCMD) -DTAINT tstab.c |
---|
287 | $(RMS) tstab.c |
---|
288 | |
---|
289 | tstr.o: str.c $(h) perly.h |
---|
290 | $(RMS) tstr.c |
---|
291 | $(SLN) str.c tstr.c |
---|
292 | $(CCCMD) -DTAINT tstr.c |
---|
293 | $(RMS) tstr.c |
---|
294 | |
---|
295 | ttoke.o: toke.c $(h) perly.h |
---|
296 | $(RMS) ttoke.c |
---|
297 | $(SLN) toke.c ttoke.c |
---|
298 | $(CCCMD) -DTAINT ttoke.c |
---|
299 | $(RMS) ttoke.c |
---|
300 | |
---|
301 | tutil.o: util.c $(h) |
---|
302 | $(RMS) tutil.c |
---|
303 | $(SLN) util.c tutil.c |
---|
304 | $(CCCMD) -DTAINT tutil.c |
---|
305 | $(RMS) tutil.c |
---|
306 | |
---|
307 | perly.h: perly.c |
---|
308 | @ echo Dummy dependency for dumb parallel make |
---|
309 | touch perly.h |
---|
310 | |
---|
311 | perly.c: perly.y perly.fixer |
---|
312 | @ \ |
---|
313 | case "$(YACC)" in \ |
---|
314 | *bison*) echo 'Expect' 25 shift/reduce and 59 reduce/reduce conflicts;; \ |
---|
315 | *) echo 'Expect' 27 shift/reduce and 57 reduce/reduce conflicts;; \ |
---|
316 | esac |
---|
317 | $(YACC) -d perly.y |
---|
318 | sh $(shellflags) ./perly.fixer y.tab.c perly.c |
---|
319 | mv y.tab.h perly.h |
---|
320 | echo 'extern YYSTYPE yylval;' >>perly.h |
---|
321 | |
---|
322 | perly.o: perly.c perly.h $(h) |
---|
323 | $(CCCMD) perly.c |
---|
324 | |
---|
325 | install: all |
---|
326 | DESTDIR=${DESTDIR} ./perl installperl |
---|
327 | |
---|
328 | clean: |
---|
329 | rm -f *.o all perl taintperl suidperl perly.c |
---|
330 | cd x2p; $(MAKE) clean |
---|
331 | |
---|
332 | realclean: clean |
---|
333 | cd x2p; $(MAKE) realclean |
---|
334 | rm -f *.orig */*.orig *~ */*~ core $(addedbyconf) h2ph h2ph.man |
---|
335 | rm -f perly.c perly.h t/perl Makefile config.h makedepend makedir |
---|
336 | rm -f makefile x2p/Makefile x2p/makefile cflags x2p/cflags |
---|
337 | rm -f c2ph pstruct |
---|
338 | |
---|
339 | # The following lint has practically everything turned on. Unfortunately, |
---|
340 | # you have to wade through a lot of mumbo jumbo that can't be suppressed. |
---|
341 | # If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message |
---|
342 | # for that spot. |
---|
343 | |
---|
344 | lint: perly.c $(c) |
---|
345 | lint $(lintflags) $(defs) perly.c $(c) > perl.fuzz |
---|
346 | |
---|
347 | depend: makedepend |
---|
348 | - test -f perly.h || cp /dev/null perly.h |
---|
349 | ./makedepend |
---|
350 | - test -s perly.h || /bin/rm -f perly.h |
---|
351 | cd x2p; $(MAKE) depend |
---|
352 | |
---|
353 | test: perl |
---|
354 | - cd t && chmod +x TEST */*.t |
---|
355 | - cd t && (rm -f perl; $(SLN) ../perl perl) && ./perl TEST </dev/tty |
---|
356 | |
---|
357 | clist: |
---|
358 | echo $(c) | tr ' ' '\012' >.clist |
---|
359 | |
---|
360 | hlist: |
---|
361 | echo $(h) | tr ' ' '\012' >.hlist |
---|
362 | |
---|
363 | shlist: |
---|
364 | echo $(sh) | tr ' ' '\012' >.shlist |
---|
365 | |
---|
366 | # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE |
---|
367 | $(obj) hash.o: |
---|
368 | @ echo "You haven't done a "'"make depend" yet!'; exit 1 |
---|
369 | makedepend: makedepend.SH |
---|
370 | /bin/sh $(shellflags) makedepend.SH |
---|
371 | !NO!SUBS! |
---|
372 | $eunicefix Makefile |
---|
373 | case `pwd` in |
---|
374 | *SH) |
---|
375 | $rm -f ../Makefile |
---|
376 | ln Makefile ../Makefile |
---|
377 | ;; |
---|
378 | esac |
---|
379 | rm -f makefile |
---|