3 if test ! -f config.sh; then
5 ln ../../config.sh . || \
6 ln ../../../config.sh . || \
7 (echo "Can't find config.sh."; exit 1)
13 */*) cd `expr X$0 : 'X\(.*\)/'` ;;
17 *define*) sln='ln -s' ;;
22 *define*) suidperl='suidperl' ;;
26 echo "Extracting Makefile (with variable substitutions)"
27 cat >Makefile <<!GROK!THIS!
28 # $Header: Makefile.SH,v 3.0.1.2 89/11/11 04:07:30 lwall Locked $
30 # $Log: Makefile.SH,v $
31 # Revision 3.0.1.2 89/11/11 04:07:30 lwall
32 # patch2: $sockethdr incorporated into $ccflags
33 # patch2: $libs now has most of the -l libraries
35 # Revision 3.0.1.1 89/10/26 23:00:38 lwall
36 # patch1: Makefile.SH needed some more .h dependecies
38 # Revision 3.0 89/10/18 15:06:43 lwall
47 CFLAGS = $ccflags $optimize
51 mallocsrc = $mallocsrc
52 mallocobj = $mallocobj
57 public = perl taintperl $suidperl
61 cat >>Makefile <<'!NO!SUBS!'
70 sh = Makefile.SH makedepend.SH
72 h1 = EXTERN.h INTERN.h arg.h array.h cmd.h config.h form.h handy.h
73 h2 = hash.h perl.h regcomp.h regexp.h spat.h stab.h str.h util.h
77 c1 = array.c cmd.c cons.c consarg.c doarg.c doio.c dolist.c dump.c
78 c2 = eval.c form.c hash.c $(mallocsrc) perly.c regcomp.c regexec.c
79 c3 = stab.c str.c toke.c util.c
83 obj1 = array.o cmd.o cons.o consarg.o doarg.o doio.o dolist.o dump.o
84 obj2 = eval.o form.o hash.o $(mallocobj) perly.o regcomp.o regexec.o
85 obj3 = stab.o str.o toke.o util.o
87 obj = $(obj1) $(obj2) $(obj3)
89 tobj1 = tarray.o tcmd.o tcons.o tconsarg.o tdoarg.o tdoio.o tdolist.o tdump.o
90 tobj2 = teval.o tform.o thash.o $(mallocobj) tregcomp.o tregexec.o
91 tobj3 = tstab.o tstr.o ttoke.o tutil.o
93 tobj = $(tobj1) $(tobj2) $(tobj3)
97 addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7
103 $(CC) -c $(CFLAGS) $(LARGE) $*.c
105 all: $(public) $(private) $(util) perl.man x2p/all
111 # This is the standard version that contains no "taint" checks and is
112 # used for all scripts that aren't set-id or running under something set-id.
115 $(CC) $(LARGE) $(LDFLAGS) $(obj) perl.o $(libs) -o perl
117 # This version, if specified in Configure, does ONLY those scripts which need
118 # set-id emulation. Suidperl must be setuid root. It contains the "taint"
119 # checks as well as the special code to validate that the script in question
120 # has been invoked correctly.
122 suidperl: tperl.o sperly.o $(tobj)
123 $(CC) $(LARGE) $(LDFLAGS) sperly.o $(tobj) tperl.o $(libs) -o suidperl
125 # This version interprets scripts that are already set-id either via a wrapper
126 # or through the kernel allowing set-id scripts (bad idea). Taintperl must
127 # NOT be setuid to root or anything else. The only difference between it
128 # and normal perl is the presence of the "taint" checks.
130 taintperl: tperl.o tperly.o $(tobj)
131 $(CC) $(LARGE) $(LDFLAGS) tperly.o $(tobj) tperl.o $(libs) -o taintperl
133 # Replicating all this junk is yucky, but I don't see a portable way to fix it.
135 tperl.o: perl.c perly.h $(h)
137 $(SLN) perl.c tperl.c
138 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tperl.c
141 tperly.o: perly.c perly.h $(h)
143 $(SLN) perly.c tperly.c
144 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tperly.c
147 sperly.o: perly.c perly.h patchlevel.h $(h)
149 $(SLN) perly.c sperly.c
150 $(CC) -c -DTAINT -DIAMSUID $(CFLAGS) $(LARGE) sperly.c
153 tarray.o: array.c $(h)
155 $(SLN) array.c tarray.c
156 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tarray.c
162 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tcmd.c
167 $(SLN) cons.c tcons.c
168 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tcons.c
171 tconsarg.o: consarg.c $(h)
172 /bin/rm -f tconsarg.c
173 $(SLN) consarg.c tconsarg.c
174 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tconsarg.c
175 /bin/rm -f tconsarg.c
177 tdoarg.o: doarg.c $(h)
179 $(SLN) doarg.c tdoarg.c
180 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdoarg.c
185 $(SLN) doio.c tdoio.c
186 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdoio.c
189 tdolist.o: dolist.c $(h)
191 $(SLN) dolist.c tdolist.c
192 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdolist.c
197 $(SLN) dump.c tdump.c
198 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdump.c
203 $(SLN) eval.c teval.c
204 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) teval.c
209 $(SLN) form.c tform.c
210 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tform.c
215 $(SLN) hash.c thash.c
216 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) thash.c
219 tregcomp.o: regcomp.c $(h)
220 /bin/rm -f tregcomp.c
221 $(SLN) regcomp.c tregcomp.c
222 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tregcomp.c
223 /bin/rm -f tregcomp.c
225 tregexec.o: regexec.c $(h)
226 /bin/rm -f tregexec.c
227 $(SLN) regexec.c tregexec.c
228 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tregexec.c
229 /bin/rm -f tregexec.c
233 $(SLN) stab.c tstab.c
234 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tstab.c
240 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tstr.c
245 $(SLN) toke.c ttoke.c
246 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) ttoke.c
251 $(SLN) util.c tutil.c
252 $(CC) -c -DTAINT $(CFLAGS) $(LARGE) tutil.c
255 perl.c perly.h: perl.y
256 @ echo Expect 25 shift/reduce errors...
261 perl.o: perl.c perly.h $(h)
262 $(CC) -c $(CFLAGS) $(LARGE) perl.c
264 perl.man: perl.man.1 perl.man.2 perl.man.3 perl.man.4 patchlevel.h perl
265 ./perl -e '($$r,$$p)=$$]=~/(\d+\.\d+).*\n\D*(\d+)/;' \
266 -e 'print ".ds RP Release $$r Patchlevel $$p\n";' >perl.man
267 cat perl.man.[1-4] >>perl.man
270 # won't work with csh
271 export PATH || exit 1
272 - rm -f $(bin)/perl.old $(bin)/suidperl $(bin)/taintperl
273 - mv $(bin)/perl $(bin)/perl.old 2>/dev/null
274 - if test `pwd` != $(bin); then cp $(public) $(bin); fi
276 for pub in $(public); do \
277 chmod +x `basename $$pub`; \
279 - chmod 755 $(bin)/taintperl 2>/dev/null
284 cat >>Makefile <<'!NO!SUBS!'
285 - chmod 4711 $(bin)/suidperl 2>/dev/null
290 cat >>Makefile <<'!NO!SUBS!'
291 - test $(bin) = /usr/bin || rm -f /usr/bin/perl
292 - test $(bin) = /usr/bin || $(SLN) $(bin)/perl /usr/bin || cp $(bin)/perl /usr/bin
293 - sh ./makedir $(privlib)
295 if test `pwd` != $(privlib); then \
296 cp $(private) lib/*.pl $(privlib); \
299 #for priv in $(private); do \
300 #chmod +x `basename $$priv`; \
302 - if test `pwd` != $(mansrc); then \
303 for page in $(manpages); do \
304 cp $$page $(mansrc)/`basename $$page .man`.$(manext); \
307 cd x2p; $(MAKE) install
310 rm -f *.o all perl taintperl perl.man
311 cd x2p; $(MAKE) clean
314 cd x2p; $(MAKE) realclean
315 rm -f perl *.orig */*.orig *~ */*~ *.o core $(addedbyconf) perl.man
316 rm -f perl.c perly.h t/perl Makefile config.h makedepend makedir
319 # The following lint has practically everything turned on. Unfortunately,
320 # you have to wade through a lot of mumbo jumbo that can't be suppressed.
321 # If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
325 lint $(lintflags) $(defs) perl.c $(c) > perl.fuzz
328 - test -f perly.h || cp /dev/null perly.h
330 - test -s perly.h || /bin/rm -f perly.h
331 cd x2p; $(MAKE) depend
334 - chmod +x t/TEST t/base.* t/comp.* t/cmd.* t/io.* t/op.*; \
335 cd t && (rm -f perl; $(SLN) ../perl .) && ./perl TEST
338 echo $(c) | tr ' ' '\012' >.clist
341 echo $(h) | tr ' ' '\012' >.hlist
344 echo $(sh) | tr ' ' '\012' >.shlist
346 # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
348 @ echo "You haven't done a "'"make depend" yet!'; exit 1
349 makedepend: makedepend.SH
350 /bin/sh makedepend.SH
356 ln Makefile ../Makefile