Integrate change #9530 from maintperl into mainline.
[p5sagit/p5-mst-13.2.git] / Makefile.SH
1 #! /bin/sh
2 case $CONFIGDOTSH in
3 '')
4         if test -f config.sh
5                 then TOP=.
6         else
7                 echo "Can't find config.sh."; exit 1
8         fi
9         . $TOP/config.sh
10         ;;
11 esac
12 : This forces SH files to create target in same directory as SH file.
13 : This is so that make depend always knows where to find SH derivatives.
14 case "$0" in
15 */*) cd `expr X$0 : 'X\(.*\)/'` ;;
16 esac
17
18 case "$d_dosuid" in
19 *define*) suidperl='suidperl' ;;
20 *) suidperl='';;
21 esac
22
23 linklibperl='$(LIBPERL)'
24 shrpldflags='$(LDDLFLAGS)'
25 ldlibpth=''
26 DPERL_EXTERNAL_GLOB='-DPERL_EXTERNAL_GLOB'
27 case "$useshrplib" in
28 true)
29         # Prefix all runs of 'miniperl' and 'perl' with 
30         # $ldlibpth so that ./perl finds *this* shared libperl.
31         case "$LD_LIBRARY_PATH" in
32         '')
33                 ldlibpth="LD_LIBRARY_PATH=`pwd`";;
34         *)
35                 ldlibpth="LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}";;
36         esac
37
38         pldlflags="$cccdlflags"
39         case "${osname}${osvers}" in
40         next4*)
41                 ld=libtool
42                 lddlflags="-dynamic -undefined warning -framework System \
43                 -compatibility_version 1 -current_version $patchlevel \
44                 -prebind -seg1addr 0x27000000 -install_name \$(shrpdir)/\$@"
45                 ;;
46         rhapsody*|darwin*)
47                 shrpldflags="${ldflags} -dynamiclib \
48                              -compatibility_version 1 \
49                              -current_version \
50                                 ${api_version}.${api_subversion} \
51                              -image_base 0x4be00000 \
52                              -install_name \$(shrpdir)/\$@"
53                 ;;
54         cygwin*)
55                 linklibperl="-lperl"
56                 ;;
57         sunos*)
58                 linklibperl="-lperl"
59                 ;;
60         netbsd*|freebsd[234]*|openbsd*)
61                 linklibperl="-L. -lperl"
62                 ;;
63         aix*)
64                 shrpldflags="-H512 -T512 -bhalt:4 -bM:SRE -bE:perl.exp"
65                 case "$osvers" in
66                 3*)     shrpldflags="$shrpldflags -e _nostart"
67                         ;;
68                 *)      shrpldflags="$shrpldflags -b noentry"
69                         ;;
70                 esac
71                 shrpldflags="$shrpldflags $ldflags $perllibs $cryptlib"
72                 linklibperl="-L $archlibexp/CORE -L `pwd | sed 's/\/UU$//'` -lperl"
73                 ;;
74         hpux*)
75                 linklibperl="-L `pwd | sed 's/\/UU$//'` -Wl,+s -Wl,+b$archlibexp/CORE -lperl"
76                 ;;
77         os390*)
78             shrpldflags='-W l,dll'
79             linklibperl='libperl.x'
80             DPERL_EXTERNAL_GLOB=''
81             ;;
82         esac
83         case "$ldlibpthname" in
84         '') ;;
85         *)
86             case "$osname" in
87             os2)
88                 ldlibpth=''
89                 ;;
90             *)
91                 eval "ldlibpth=\"$ldlibpthname=`pwd`:\$$ldlibpthname\""
92                 ;;
93             esac
94             # Strip off any trailing :'s
95             ldlibpth=`echo $ldlibpth | sed 's/:*$//'`
96             ;;
97         esac
98         ;;
99 *)      pldlflags=''
100         ;;
101 esac
102
103 : Prepare dependency lists for Makefile.
104 dynamic_list=' '
105 for f in $dynamic_ext; do
106     : the dependency named here will never exist
107       base=`echo "$f" | sed 's/.*\///'`
108     dynamic_list="$dynamic_list lib/auto/$f/$base.$dlext"
109 done
110
111 static_list=' '
112 for f in $static_ext; do
113         base=`echo "$f" | sed 's/.*\///'`
114         static_list="$static_list lib/auto/$f/$base\$(LIB_EXT)"
115 done
116
117 nonxs_list=' '
118 for f in $nonxs_ext; do
119     base=`echo "$f" | sed 's/.*\///'`
120     nonxs_list="$nonxs_list ext/$f/pm_to_blib"
121 done
122
123 # Handle the usage of different yaccs in posix-bc (During Configure we
124 # us yacc for perly.y and byacc for a2p.y.  The makefiles must use the
125 # same configuration for run_byacc!):
126 case "$osname" in
127     posix-bc)
128         byacc=$yacc
129         ;;
130 esac
131
132 case "$usedl" in
133 define) testreqext="$testreqext \$(DYNALOADER)" ;;
134 esac
135
136 case "$DPERL_EXTERNAL_GLOB" in
137 "") ;;
138 *) testreqext="$testreqext \$(EXTGLOB)" ;;
139 esac
140
141 echo "Extracting Makefile (with variable substitutions)"
142 $spitshell >Makefile <<!GROK!THIS!
143 # Makefile.SH
144 # This file is derived from Makefile.SH.  Any changes made here will
145 # be lost the next time you run Configure.
146 #  Makefile is used to generate $firstmakefile.  The only difference
147 #  is that $firstmakefile has the dependencies filled in at the end.
148 #
149 #
150 # I now supply perly.c with the kits, so don't remake perly.c without byacc
151 BYACC = $byacc
152 CC = $cc
153 LD = $ld
154
155 LDFLAGS = $ldflags
156 CLDFLAGS = $ldflags
157
158 mallocsrc = $mallocsrc
159 mallocobj = $mallocobj
160 LNS = $lns
161 CPS = $cp -f
162 RMS = rm -f
163 ranlib = $ranlib
164
165 # The following are mentioned only to make metaconfig include the
166 # appropriate questions in Configure.  If you want to change these,
167 # edit config.sh instead, or specify --man1dir=/wherever on
168 # installman commandline.
169 bin = $installbin
170 scriptdir = $scriptdir
171 shrpdir = $archlibexp/CORE
172 privlib = $installprivlib
173 man1dir = $man1dir
174 man1ext = $man1ext
175 man3dir = $man3dir
176 man3ext = $man3ext
177
178 # The following are used to build and install shared libraries for
179 # dynamic loading.
180 LDDLFLAGS = $lddlflags
181 SHRPLDFLAGS = $shrpldflags
182 CCDLFLAGS = $ccdlflags
183 DLSUFFIX = .$dlext
184 PLDLFLAGS = $pldlflags
185 LIBPERL = $libperl
186 LLIBPERL= $linklibperl
187 SHRPENV = $shrpenv
188
189 # The following is used to include the current directory in
190 # the dynamic loader path you are building a shared libperl.
191 LDLIBPTH = $ldlibpth
192
193 dynamic_ext = $dynamic_list
194 static_ext = $static_list
195 nonxs_ext = $nonxs_list
196 ext = \$(dynamic_ext) \$(static_ext) \$(nonxs_ext)
197 DYNALOADER = lib/auto/DynaLoader/DynaLoader\$(LIB_EXT)
198 EXTGLOB = lib/auto/File/Glob/Glob\$(DLSUFFIX)
199
200 TESTREQEXT = $testreqext
201
202 libs = $perllibs $cryptlib
203
204 public = perl $suidperl utilities translators
205
206 shellflags = $shellflags
207
208 # This is set to  MAKE=$make if your $make command doesn't
209 # do it for you.
210 $make_set_make
211
212 # These variables may need to be manually set for non-Unix systems.
213 AR = $full_ar
214 EXE_EXT = $_exe
215 LIB_EXT = $_a
216 OBJ_EXT = $_o
217 PATH_SEP = $p_
218
219 FIRSTMAKEFILE = $firstmakefile
220
221 # Any special object files needed by this architecture, e.g. os2/os2.obj
222 ARCHOBJS = $archobjs
223
224 .SUFFIXES: .c \$(OBJ_EXT)
225
226 # grrr
227 SHELL = $sh
228
229 # how to tr(anslate) newlines
230 TRNL = '$trnl'
231
232 !GROK!THIS!
233 # not used by Makefile but by installperl;
234 # mentioned here so that metaconfig picks these up
235 # $installusrbinperl
236 # $versiononly
237
238
239 ## In the following dollars and backticks do not need the extra backslash.
240 $spitshell >>Makefile <<'!NO!SUBS!'
241
242 CCCMD = `sh $(shellflags) cflags $(LIBPERL) $@`
243
244 private = preplibrary lib/ExtUtils/Miniperl.pm lib/Config.pm
245
246 # Files to be built with variable substitution before miniperl
247 # is available.
248 sh = Makefile.SH cflags.SH config_h.SH makeaperl.SH makedepend.SH \
249         makedir.SH myconfig.SH writemain.SH pod/Makefile.SH
250
251 shextract = Makefile cflags config.h makeaperl makedepend \
252         makedir myconfig writemain pod/Makefile
253
254 # Files to be built with variable substitution after miniperl is
255 # available.  Dependencies handled manually below (for now).
256
257 pl = pod/pod2html.PL pod/pod2latex.PL pod/pod2man.PL pod/pod2text.PL \
258         pod/pod2usage.PL pod/podchecker.PL pod/podselect.PL \
259         pod/buildtoc.PL
260
261 # lib/lib.pm is not listed here because it has a rule of its own.
262 plextract = pod/pod2html pod/pod2latex pod/pod2man pod/pod2text \
263         pod/pod2usage pod/podchecker pod/podselect \
264         pod/buildtoc
265
266 addedbyconf = UU $(shextract) $(plextract) lib/lib.pm pstruct
267
268 h1 = EXTERN.h INTERN.h XSUB.h av.h config.h cop.h cv.h dosish.h
269 h2 = embed.h form.h gv.h handy.h hv.h keywords.h mg.h op.h
270 h3 = opcode.h patchlevel.h perl.h perlapi.h perly.h pp.h proto.h regcomp.h
271 h4 = regexp.h scope.h sv.h unixish.h util.h iperlsys.h thread.h
272 h5 = utf8.h warnings.h
273 h = $(h1) $(h2) $(h3) $(h4) $(h5)
274
275 c1 = $(mallocsrc) av.c scope.c op.c doop.c doio.c dump.c hv.c mg.c
276 c2 = perl.c perly.c pp.c pp_hot.c pp_ctl.c pp_sys.c regcomp.c regexec.c utf8.c
277 c3 = gv.c sv.c taint.c toke.c util.c deb.c run.c universal.c xsutils.c
278 c4 = globals.c perlio.c perlapi.c
279
280 c = $(c1) $(c2) $(c3) $(c4) miniperlmain.c perlmain.c
281
282 obj1 = $(mallocobj) gv$(OBJ_EXT) toke$(OBJ_EXT) perly$(OBJ_EXT) op$(OBJ_EXT) regcomp$(OBJ_EXT) dump$(OBJ_EXT) util$(OBJ_EXT) mg$(OBJ_EXT)
283 obj2 = hv$(OBJ_EXT) av$(OBJ_EXT) run$(OBJ_EXT) pp_hot$(OBJ_EXT) sv$(OBJ_EXT) pp$(OBJ_EXT) scope$(OBJ_EXT) pp_ctl$(OBJ_EXT) pp_sys$(OBJ_EXT)
284 obj3 = doop$(OBJ_EXT) doio$(OBJ_EXT) regexec$(OBJ_EXT) utf8$(OBJ_EXT) taint$(OBJ_EXT) deb$(OBJ_EXT) universal$(OBJ_EXT) xsutils$(OBJ_EXT) globals$(OBJ_EXT) perlio$(OBJ_EXT) perlapi$(OBJ_EXT)
285
286 obj = $(obj1) $(obj2) $(obj3) $(ARCHOBJS)
287
288 # Once perl has been Configure'd and built ok you build different
289 # perl variants (Debugging, Embedded, Multiplicity etc) by saying:
290 #       make clean; make LIBPERL=libperl<type>.a
291 # where <type> is some combination of 'd' and(or) 'e' or 'm'.
292 # See cflags to understand how this works.
293 #
294 # This mechanism is getting clunky and might not even work any more.
295 # EMBEDDING is on by default, and MULTIPLICITY doesn't work.
296 #
297
298 lintflags = -hbvxac
299
300 .c$(OBJ_EXT):
301         $(CCCMD) $(PLDLFLAGS) $*.c
302
303 all: $(FIRSTMAKEFILE) miniperl extra.pods $(private) $(public) $(dynamic_ext) $(nonxs_ext)
304         @echo " ";
305         @echo " Everything is up to date. 'make test' to run test suite."
306
307 compile: all
308         echo "testing compilation" > testcompile;
309         cd utils;  $(MAKE) compile;
310         cd x2p; $(MAKE) compile; 
311         cd pod; $(MAKE) compile;
312
313 translators:    miniperl lib/Config.pm FORCE
314         @echo " "; echo "       Making x2p stuff"; cd x2p; $(LDLIBPTH) $(MAKE) all
315
316 utilities:      miniperl lib/Config.pm $(plextract) lib/lib.pm FORCE
317         @echo " "; echo "       Making utilities"; cd utils; $(LDLIBPTH) $(MAKE) all
318
319
320 # This is now done by installman only if you actually want the man pages.
321 #       @echo " "; echo "       Making docs"; cd pod; $(MAKE) all;
322
323 # Phony target to force checking subdirectories.
324 # Apparently some makes require an action for the FORCE target.
325 FORCE:
326         @sh -c true
327 !NO!SUBS!
328 $spitshell >>Makefile <<!GROK!THIS!
329
330 # We do a copy of the op.c instead of a symlink because gcc gets huffy
331 # if we have a symlink forest to another disk (it complains about too many
332 # levels of symbolic links, even if we have only two)
333
334 opmini\$(OBJ_EXT): op.c config.h
335         \$(RMS) opmini.c
336         \$(CPS) op.c opmini.c
337         \$(CCCMD) \$(PLDLFLAGS) $DPERL_EXTERNAL_GLOB opmini.c
338         \$(RMS) opmini.c
339
340 !GROK!THIS!
341 $spitshell >>Makefile <<'!NO!SUBS!'
342 miniperlmain$(OBJ_EXT): miniperlmain.c patchlevel.h
343         $(CCCMD) $(PLDLFLAGS) $*.c
344
345 perlmain.c: miniperlmain.c config.sh $(FIRSTMAKEFILE)
346         sh writemain $(DYNALOADER) $(static_ext) > writemain.tmp
347         sh mv-if-diff writemain.tmp perlmain.c
348
349 perlmain$(OBJ_EXT): perlmain.c
350         $(CCCMD) $(PLDLFLAGS) $*.c
351
352 # The file ext.libs is a list of libraries that must be linked in
353 # for static extensions, e.g. -lm -lgdbm, etc.  The individual
354 # static extension Makefile's add to it.
355 ext.libs: $(static_ext)
356         -@test -f ext.libs || touch ext.libs
357
358 !NO!SUBS!
359
360 # How to build libperl.  This is still rather convoluted.
361 # Load up custom Makefile.SH fragment for shared loading and executables:
362 case "$osname" in
363 *)
364         Makefile_s="$osname/Makefile.SHs"
365         ;;
366 esac
367
368 case "$osname" in
369 aix)
370         $spitshell >>Makefile <<!GROK!THIS!
371 LIBS                    = $perllibs
372 # In AIX we need to change this for building Perl itself from
373 # its earlier definition (which is for building external
374 # extensions *after* Perl has been built and installed)
375 CCDLFLAGS               = `echo $ccdlflags|sed -e 's@-bE:.*/perl\.exp@-bE:perl.exp@'`
376
377 !GROK!THIS!
378         case "$useshrplib" in
379         define|true|[yY]*)
380                 $spitshell >>Makefile <<'!NO!SUBS!'
381
382 LIBPERL_NONSHR          = libperl_nonshr$(LIB_EXT)
383 MINIPERL_NONSHR         = miniperl_nonshr$(EXE_EXT)
384
385 $(LIBPERL_NONSHR): perl$(OBJ_EXT) $(obj)
386         $(RMS) $(LIBPERL_NONSHR)
387         $(AR) rcu $(LIBPERL_NONSHR) perl$(OBJ_EXT) $(obj)
388
389 $(MINIPERL_NONSHR): $(LIBPERL_NONSHR) miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT)
390         $(CC) $(LDFLAGS) -o $(MINIPERL_NONSHR) miniperlmain$(OBJ_EXT) \
391             opmini$(OBJ_EXT) $(LIBPERL_NONSHR) $(LIBS)
392
393 MINIPERLEXP             = $(MINIPERL_NONSHR)
394
395 LIBPERLEXPORT           = perl.exp
396
397 !NO!SUBS!
398                 
399                 ;;
400         *)      
401                 $spitshell >>Makefile <<'!NO!SUBS!'
402 MINIPERLEXP             = miniperl$(EXE_EXT)
403
404 PERLEXPORT              = perl.exp
405
406 !NO!SUBS!
407         ;;
408         esac
409         $spitshell >>Makefile <<'!NO!SUBS!'
410 perl.exp: $(MINIPERLEXP) makedef.pl config.sh $(SYM) $(SYMH)
411         ./$(MINIPERLEXP) makedef.pl PLATFORM=aix | sort -u | sort -f > perl.exp.tmp
412         sh mv-if-diff perl.exp.tmp perl.exp
413
414 !NO!SUBS!
415         ;;
416 os2)
417         $spitshell >>Makefile <<'!NO!SUBS!'
418 MINIPERLEXP             = miniperl
419
420 perl5.def: $(MINIPERLEXP) makedef.pl config.sh $(SYM) $(SYMH) miniperl.map
421         ./$(MINIPERLEXP) makedef.pl PLATFORM=os2 -DPERL_DLL=$(PERL_DLL) > perl.exp.tmp
422         sh mv-if-diff perl.exp.tmp perl5.def
423
424 !NO!SUBS!
425         ;;
426 esac
427
428 if test -r $Makefile_s ; then
429         . $Makefile_s
430         $spitshell >>Makefile <<!GROK!THIS!
431
432 Makefile: $Makefile_s
433 !GROK!THIS!
434 else
435         $spitshell >>Makefile <<'!NO!SUBS!'
436 $(LIBPERL): $& perl$(OBJ_EXT) $(obj) $(LIBPERLEXPORT)
437 !NO!SUBS!
438         case "$useshrplib" in
439         true)
440                 $spitshell >>Makefile <<'!NO!SUBS!'
441         $(LD) -o $@ $(SHRPLDFLAGS) perl$(OBJ_EXT) $(obj)
442 !NO!SUBS!
443                 case "$osname" in
444                 aix)
445                         $spitshell >>Makefile <<'!NO!SUBS!'
446         rm -f libperl$(OBJ_EXT)
447         mv $@ libperl$(OBJ_EXT)
448         $(AR) qv $(LIBPERL) libperl$(OBJ_EXT)
449 !NO!SUBS!
450                         ;;
451                 esac
452                 ;;
453         *)
454                 $spitshell >>Makefile <<'!NO!SUBS!'
455         rm -f $(LIBPERL)
456         $(AR) rcu $(LIBPERL) perl$(OBJ_EXT) $(obj)
457         @$(ranlib) $(LIBPERL)
458 !NO!SUBS!
459                 ;;
460         esac
461         $spitshell >>Makefile <<'!NO!SUBS!'
462
463 # How to build executables.
464
465 # The $& notation tells Sequent machines that it can do a parallel make,
466 # and is harmless otherwise.
467 # The miniperl -w -MExporter line is a basic cheap test to catch errors
468 # before make goes on to run preplibrary and then MakeMaker on extensions.
469 # This is very handy because later errors are often caused by miniperl
470 # build problems but that's not obvious to the novice.
471 # The Module used here must not depend on Config or any extensions.
472
473 !NO!SUBS!
474
475         case "${osname}${osvers}" in
476         next4*)
477                 $spitshell >>Makefile <<'!NO!SUBS!'
478 miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL) opmini$(OBJ_EXT)
479         $(CC) -o miniperl `echo $(obj) | sed 's/ op$(OBJ_EXT) / /'` \
480             miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) perl$(OBJ_EXT) $(libs)
481         $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
482 !NO!SUBS!
483                 ;;
484         aix*)
485                 $spitshell >>Makefile <<'!NO!SUBS!'
486 miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL) opmini$(OBJ_EXT)
487         $(CC) -o miniperl $(CLDFLAGS) \
488             `echo $(obj) | sed 's/ op$(OBJ_EXT) / /'` \
489             miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) perl$(OBJ_EXT) $(libs)
490         $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
491 !NO!SUBS!
492                 ;;
493         *)
494                 $spitshell >>Makefile <<'!NO!SUBS!'
495 miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL) opmini$(OBJ_EXT)
496         $(LDLIBPTH) $(CC) $(CLDFLAGS) -o miniperl \
497             miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) $(LLIBPERL) $(libs)
498         $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
499 !NO!SUBS!
500                 ;;
501         esac
502
503         $spitshell >>Makefile <<'!NO!SUBS!'
504
505 perl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT)
506         $(SHRPENV) $(LDLIBPTH) $(CC) -o perl $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
507
508 # Purify/Quantify Perls.
509
510 pureperl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT)
511         $(SHRPENV) $(LDLIBPTH) purify $(CC) -o pureperl $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
512
513 purecovperl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT)
514         $(SHRPENV) $(LDLIBPTH) purecov $(CC) -o purecovperl $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
515
516 quantperl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT)
517         $(SHRPENV) $(LDLIBPTH) quantify $(CC) -o quantperl $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
518
519 # Third Degree Perl (Tru64 only)
520
521 perl.config.dashg:
522         @echo "Checking optimize='-g'..."
523         @grep "^optimize=" config.sh
524         @grep -q "^optimize='-g'" config.sh || exit 1
525
526 perl.third.config: config.sh
527         @echo "To build perl.third you must Configure -Doptimize=-g -Uusemymalloc, checking..."
528         @$(MAKE) perl.config.dashg
529         @echo "Checking usemymalloc='n'..."
530         @grep "^usemymalloc=" config.sh
531         @grep -q "^usemymalloc='n'" config.sh || exit 1
532
533 perl.third: /usr/bin/atom perl.third.config perl
534         atom -tool third -L. -all -gp -toolargs="-quiet -invalid -uninit heap+stack+partword+copy -min 0" perl
535
536 # Pixie Perls (Tru64 and IRIX only)
537
538 perl.pixie.config: config.sh
539         @echo "To build perl.pixie you must Configure -Doptimize=-g, checking..."
540         @$(MAKE) perl.config.dashg
541
542 perl.pixie.atom: /usr/bin/atom perl
543         atom -tool pixie -L. -all -toolargs="-quiet" perl
544
545 perl.pixie.irix: perl
546         pixie perl
547
548 perl.pixie: /usr/bin/pixie perl.pixie.config perl
549         if test -x /usr/bin/atom; then \
550           $(MAKE) perl.pixie.atom; \
551         else \
552           $(MAKE) perl.pixie.irix; \
553         fi
554
555 # This version, if specified in Configure, does ONLY those scripts which need
556 # set-id emulation.  Suidperl must be setuid root.  It contains the "taint"
557 # checks as well as the special code to validate that the script in question
558 # has been invoked correctly.
559
560 suidperl: $& sperl$(OBJ_EXT) perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT)
561         $(SHRPENV) $(LDLIBPTH) $(CC) -o suidperl $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) sperl$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
562
563 !NO!SUBS!
564
565 fi
566
567 $spitshell >>Makefile <<'!NO!SUBS!'
568
569 sperl$(OBJ_EXT): perl.c $(h)
570         $(RMS) sperl.c
571         $(LNS) perl.c sperl.c
572         $(CCCMD) -DIAMSUID sperl.c
573         $(RMS) sperl.c
574
575 # We have to call our ./makedir because Ultrix 4.3 make can't handle the line
576 #       test -d lib/auto || mkdir lib/auto
577 #
578 preplibrary: miniperl lib/Config.pm
579         @sh ./makedir lib/auto
580         @echo " AutoSplitting perl library"
581         $(LDLIBPTH) ./miniperl -Ilib -e 'use AutoSplit; \
582                 autosplit_lib_modules(@ARGV)' lib/*.pm lib/*/*.pm
583
584 # Take care to avoid modifying lib/Config.pm without reason
585 # (If trying to create a new port and having problems with the configpm script, 
586 # try 'make minitest' and/or commenting out the tests at the end of configpm.)
587 lib/Config.pm: config.sh miniperl configpm lib/re.pm
588         $(LDLIBPTH) ./miniperl configpm configpm.tmp
589         sh mv-if-diff configpm.tmp $@
590
591 lib/ExtUtils/Miniperl.pm: miniperlmain.c miniperl minimod.pl lib/Config.pm
592         $(LDLIBPTH) ./miniperl minimod.pl > minimod.tmp
593         sh mv-if-diff minimod.tmp $@
594
595 lib/re.pm: ext/re/re.pm
596         @-rm -f $@
597         cat ext/re/re.pm > $@
598
599 $(plextract):   miniperl lib/Config.pm
600         @-rm -f $@
601         $(LDLIBPTH) ./miniperl -Ilib $@.PL
602
603 lib/lib.pm:     miniperl lib/Config.pm
604         @-rm -f $@
605         $(LDLIBPTH) ./miniperl -Ilib lib/lib_pm.PL
606
607 extra.pods: miniperl
608         -@test -f extra.pods && rm -f `cat extra.pods`
609         -@rm -f extra.pods
610         -@for x in `grep -l '^=[a-z]' README.* | grep -v README.vms` ; do \
611             nx=`echo $$x | sed -e "s/README\.//"`; \
612             cd pod ; $(LNS) ../$$x "perl"$$nx".pod" ; cd .. ; \
613             echo "pod/perl"$$nx".pod" >> extra.pods ; \
614         done
615         -@test -f vms/perlvms.pod && cd pod && $(LNS) ../vms/perlvms.pod perlvms.pod && cd .. && echo "pod/perlvms.pod" >> extra.pods
616
617 install-strip:
618         $(MAKE) STRIPFLAGS=-s install
619
620 install:
621         $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS)
622
623 install-verbose:
624         $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-V
625
626 install-silent:
627         $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-S
628
629 no-install:
630         $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-n
631
632 install.perl:   all installperl
633         if [ -n "$(COMPILE)" ]; \
634         then \
635                 cd utils; $(MAKE) compile; \
636                 cd ../x2p; $(MAKE) compile; \
637                 cd ../pod; $(MAKE) compile; \
638         else :; \
639         fi
640         $(LDLIBPTH) ./perl installperl $(INSTALLFLAGS) $(STRIPFLAGS)
641
642 install.man:    all installman
643         $(LDLIBPTH) ./perl installman $(INSTALLFLAGS)
644
645 # XXX Experimental. Hardwired values, but useful for testing.
646 # Eventually Configure could ask for some of these values.
647 install.html: all installhtml
648         -@test -f README.vms && cd vms && $(LNS) ../README.vms README_vms.pod && cd ..
649         $(LDLIBPTH) ./perl installhtml                   \
650       --podroot=. --podpath=. --recurse  \
651       --htmldir=$(privlib)/html     \
652       --htmlroot=$(privlib)/html    \
653       --splithead=pod/perlipc     \
654       --splititem=pod/perlfunc    \
655       --libpods=perlfunc:perlguts:perlvar:perlrun:perlop \
656       --verbose
657
658
659 # I now supply perly.c with the kits, so the following section is
660 # used only if you force byacc to run by saying
661 #       make run_byacc
662 # Since we patch up the byacc output, the perly.fixer script needs
663 # to run with precisely the same version of byacc as I use.  You
664 # normally shouldn't remake perly.[ch].
665
666 run_byacc:      FORCE
667         $(BYACC) -d perly.y
668         -chmod 664 perly.c perly.h
669         sh $(shellflags) ./perly.fixer y.tab.c perly.c
670         sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \
671             -e 's/y\.tab/perly/g' perly.c >perly.tmp && mv perly.tmp perly.c
672         sed -e '/^extern YYSTYPE yy/D' y.tab.h >yh.tmp && mv yh.tmp y.tab.h
673         cmp -s y.tab.h perly.h && rm -f y.tab.h || mv y.tab.h perly.h
674         chmod 664 vms/perly_c.vms vms/perly_h.vms
675         perl vms/vms_yfix.pl perly.c perly.h vms/perly_c.vms vms/perly_h.vms
676
677 # We don't want to regenerate perly.c and perly.h, but they might
678 # appear out-of-date after a patch is applied or a new distribution is
679 # made.
680 perly.c: perly.y
681         -@sh -c true
682
683 perly.h: perly.y
684         -@sh -c true
685
686 PERLYVMS = vms/perly_c.vms vms/perly_h.vms
687
688 $(PERLYVMS):    perly.c perly.h vms/vms_yfix.pl
689         perl vms/vms_yfix.pl perly.c perly.h vms/perly_c.vms vms/perly_h.vms
690
691 # No compat3.sym here since and including the 5.004_50.
692 # No interp.sym since 5.005_03.
693 SYM  = global.sym globvar.sym perlio.sym pp.sym
694
695 SYMH = perlvars.h intrpvar.h thrdvar.h
696
697 CHMOD_W = chmod +w
698
699 # The following files are generated automatically
700 #       keywords.pl:    keywords.h
701 #       opcode.pl:      opcode.h opnames.h pp_proto.h pp.sym
702 # [* embed.pl needs pp.sym generated by opcode.pl! *]
703 #       embed.pl:       proto.h embed.h embedvar.h global.sym objXSUB.h
704 #                       perlapi.h perlapi.c pod/perlintern.pod
705 #                       pod/perlapi.pod
706 #       bytecode.pl:    ext/ByteLoader/byterun.h ext/ByteLoader/byterun.c
707 #                       ext/B/B/Asmdata.pm
708 #       regcomp.pl:     regnodes.h
709 #       warnings.pl:    warnings.h lib/warnings.pm
710 # The correct versions should be already supplied with the perl kit,
711 # in case you don't have perl available.
712 # To force them to be regenerated, type
713 #       make regen_headers
714
715 keywords.h:     keywords.pl
716         -perl keywords.pl
717
718 OPCODE_PL_OUTPUT = opcode.h opnames.h pp_proto.h pp.sym
719
720 $(OPCODE_PL_OUTPUT): opcode.pl
721         -perl opcode.pl
722
723 # Really the prerequisites for the next rule  should only be "embed.pl pp.sym"
724 # Writing it this way gives make a big hint to always run opcode.pl before
725 # embed.pl. The alternative - running embed.pl then opcode.pl causes embed.pl
726 # to be re-run next make invocation, and then all object files get recompiled.
727
728 proto.h embed.h embedvar.h global.sym objXSUB.h perlapi.h perlapi.c pod/perlintern.pod pod/perlapi.pod: embed.pl $(OPCODE_PL_OUTPUT)
729         -perl embed.pl
730
731 ext/ByteLoader/byterun.h ext/ByteLoader/byterun.c ext/B/B/Asmdata.pm: bytecode.pl
732         -perl bytecode.pl
733
734 regnodes.h:     regcomp.pl
735         -perl regcomp.pl
736
737 warnings.h lib/warnings.pm: warnings.pl
738         -perl warnings.pl
739
740 AUTOGEN_FILES = keywords.h opcode.h opnames.h pp_proto.h pp.sym proto.h \
741                 embed.h embedvar.h global.sym \
742                 pod/perlintern.pod pod/perlapi.pod \
743                 objXSUB.h perlapi.h perlapi.c ext/ByteLoader/byterun.h \
744                 ext/ByteLoader/byterun.c ext/B/B/Asmdata.pm regnodes.h \
745                 warnings.h lib/warnings.pm
746
747 regen_headers:  FORCE
748         -$(CHMOD_W) $(AUTOGEN_FILES)
749         -perl keywords.pl
750         -perl opcode.pl
751         -perl embed.pl
752         -perl bytecode.pl
753         -perl regcomp.pl
754         -perl warnings.pl
755
756 regen_pods:     FORCE
757         -cd pod; $(LDLIBPTH) make regen_pods
758
759 regen_all: $(PERLYVMS) regen_headers regen_pods
760
761 # Extensions:
762 # Names added to $(dynamic_ext) or $(static_ext) or $(nonxs_ext) will
763 # automatically get built.  There should ordinarily be no need to change
764 # any of this part of makefile.
765 #
766 # The dummy dependency is a place holder in case $(dynamic_ext) or
767 # $(static_ext) is empty.
768 #
769 # DynaLoader may be needed for extensions that use Makefile.PL.
770
771 $(DYNALOADER):  miniperl preplibrary FORCE
772         @$(LDLIBPTH) sh ext/util/make_ext static $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
773
774 d_dummy $(dynamic_ext): miniperl preplibrary $(DYNALOADER) FORCE
775         @$(LDLIBPTH) sh ext/util/make_ext dynamic $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
776
777 s_dummy $(static_ext):  miniperl preplibrary $(DYNALOADER) FORCE
778         @$(LDLIBPTH) sh ext/util/make_ext static $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
779
780 n_dummy $(nonxs_ext):   miniperl preplibrary $(DYNALOADER) FORCE
781         @$(LDLIBPTH) sh ext/util/make_ext nonxs $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
782
783 clean:          _tidy _mopup
784
785 realclean:      _realcleaner _mopup
786         @echo "Note that make realclean does not delete config.sh or Policy.sh"
787
788 _clobber:
789         rm -f config.sh cppstdin Policy.sh
790
791 clobber:        _realcleaner _mopup _clobber
792
793 distclean:      clobber
794
795 # Like distclean but also removes emacs backups and *.orig.
796 veryclean:      _verycleaner _mopup _clobber
797         -@rm -f Obsolete Wanted
798
799 # Do not 'make _mopup' directly.
800 _mopup:
801         rm -f *$(OBJ_EXT) *$(LIB_EXT) all perlmain.c
802         -@test -f extra.pods && rm -f `cat extra.pods`
803         -@test -f vms/README_vms.pod && rm -f vms/README_vms.pod
804         -rm -f perl.exp ext.libs extra.pods opmini.o
805         -rm -f perl.export perl.dll perl.libexp perl.map perl.def
806         -rm -f perl.loadmap miniperl.loadmap perl.prelmap miniperl.prelmap
807         -rm -f perl.third lib*.so.perl.third perl.3log t/perl.third t/perl.3log
808         -rm -f perl.pixie lib*.so.perl.pixie lib*.so.Addrs
809         -rm -f perl.Addrs perl.Counts t/perl.Addrs t/perl.Counts
810         rm -f perl suidperl miniperl $(LIBPERL) libperl.* microperl
811
812 # Do not 'make _tidy' directly.
813 _tidy:
814         -cd pod; $(LDLIBPTH) $(MAKE) clean
815         -cd utils; $(LDLIBPTH) $(MAKE) clean
816         -cd x2p; $(LDLIBPTH) $(MAKE) clean
817         -@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) $(nonxs_ext) ; do \
818         $(LDLIBPTH) sh ext/util/make_ext clean $$x MAKE=$(MAKE) ; \
819         done
820         rm -f testcompile compilelog
821
822 _cleaner1:
823         -cd os2; rm -f Makefile
824         -cd pod; $(LDLIBPTH) $(MAKE) $(CLEAN)
825         -cd utils; $(LDLIBPTH) $(MAKE) $(CLEAN)
826         -cd x2p; $(LDLIBPTH) $(MAKE) $(CLEAN)
827         -@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) $(nonxs_ext) ; do \
828         $(LDLIBPTH) sh ext/util/make_ext $(CLEAN) $$x MAKE=$(MAKE) ; \
829         done
830
831 _cleaner2:
832         rm -f core core.*perl.*.? *perl.core t/core t/core.perl.*.? t/*perl.core t/misctmp* t/forktmp* t/tmp* t/c t/perl t/rantests .?*.c so_locations $(LIBPERL_NONSHR) $(MINIPERL_NONSHR)
833         rm -rf $(addedbyconf)
834         rm -f $(FIRSTMAKEFILE) $(FIRSTMAKEFILE).old
835         rm -f $(private)
836         rm -rf lib/auto
837         rm -f lib/.exists lib/*/.exists lib/*/*/.exists
838         rm -f h2ph.man pstruct
839         rm -rf .config
840         rm -f testcompile compilelog
841         -rmdir lib/B lib/Data lib/Digest lib/Encode lib/MIME lib/IO/Socket lib/IO lib/Filter/Util lib/PerlIO lib/Sys lib/Thread lib/XS
842
843 _realcleaner: 
844         @$(LDLIBPTH) $(MAKE) _cleaner1 CLEAN=realclean
845         @$(LDLIBPTH) $(MAKE) _cleaner2
846
847 _verycleaner: 
848         @$(LDLIBPTH) $(MAKE) _cleaner1 CLEAN=veryclean
849         @$(LDLIBPTH) $(MAKE) _cleaner2
850         -rm -f *~ *.orig */*~ */*.orig */*/*~ */*/*.orig
851
852 # The following lint has practically everything turned on.  Unfortunately,
853 # you have to wade through a lot of mumbo jumbo that can't be suppressed.
854 # If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
855 # for that spot.
856
857 lint: $(c)
858         lint $(lintflags) $(defs) perly.c $(c) > perl.fuzz
859
860 # Need to unset during recursion to go out of loop.
861 # The README below ensures that the dependency list is never empty and
862 # that when MAKEDEPEND is empty $(FIRSTMAKEFILE) doesn't need rebuilding.
863
864 MAKEDEPEND = Makefile makedepend
865
866 $(FIRSTMAKEFILE):       README $(MAKEDEPEND)
867         $(MAKE) depend MAKEDEPEND=
868
869 config.h: config_h.SH config.sh
870         $(SHELL) config_h.SH
871
872 # When done, touch perlmain.c so that it doesn't get remade each time.
873 depend: makedepend
874         sh ./makedepend MAKE=$(MAKE)
875         - test -s perlmain.c && touch perlmain.c
876         cd x2p; $(MAKE) depend
877
878 # Cannot postpone this until $firstmakefile is ready ;-)
879 makedepend: makedepend.SH config.sh
880         sh ./makedepend.SH
881
882 # Cannot delegate rebuilding of t/perl to make
883 # to allow interlaced test and minitest
884
885 _test_prep: $(PERL)$(EXE_EXT)
886         cd t && (rm -f $(PERL)$(EXE_EXT); $(LNS) ../$(PERL)$(EXE_EXT) $(PERL)$(EXE_EXT))
887
888 test_prep: miniperl ./perl$(EXE_EXT) preplibrary utilities $(dynamic_ext) $(nonxs_ext) $(TEST_PERL_DLL)
889         PERL=./perl $(MAKE) _test_prep
890
891 _test_tty:
892         cd t && $(LDLIBPTH) $(PERL_DEBUG) $(PERL) TEST $(UTF8) </dev/tty
893
894 _test_notty:
895         cd t && $(LDLIBPTH) $(PERL_DEBUG) PERL_SKIP_TTY_TEST=1 $(PERL) TEST $(UTF8)
896
897 # The second branch is for testing without a tty or controlling terminal,
898 # see t/op/stat.t
899 _test:
900         if (true </dev/tty) >/dev/null 2>&1; then \
901           $(MAKE) _test_tty; \
902         else \
903           $(MAKE) _test_notty; \
904         fi
905         @echo "Ran tests" > t/rantests
906
907 test check: test_prep $(TESTREQEXT)
908         PERL=./perl $(MAKE) _test
909
910 test_tty: test_prep $(TESTREQEXT)
911         PERL=./perl $(MAKE) _test_tty
912
913 test_notty: test_prep $(TESTREQEXT)
914         PERL=./perl $(MAKE) _test_notty
915
916 utest ucheck: test_prep $(TESTREQEXT)
917         PERL=./perl UTF8=-utf8 $(MAKE) _test
918
919 test-prep:      test_prep
920
921 test-tty:       test_tty
922
923 test-notty:     test_notty
924
925 # Targets for Third Degree testing.
926
927 test_prep.third: test_prep perl.third
928         PERL=./perl.third $(MAKE) _test_prep
929
930 test.third check.third: test_prep.third perl.third $(TESTREQEXT)
931         PERL=./perl.third PERL_DEBUG=PERL_3LOG=1 $(MAKE) _test
932
933 utest.third ucheck.third: test_prep.third perl.third $(TESTREQEXT)
934         PERL=./perl.third PERL_DEBUG=PERL_3LOG=1UTF=-utf8 $(MAKE) _test
935
936 test_notty.third: test_prep.third perl.third $(TESTREQEXT)
937         PERL=./perl.third $(MAKE) PERL_DEBUG=PERL_3LOG=1 _test_notty
938
939 # Can't depend on lib/Config.pm because that might be where miniperl
940 # is crashing.
941 minitest: miniperl lib/re.pm
942         @echo "You may see some irrelevant test failures if you have been unable"
943         @echo "to build lib/Config.pm."
944         - cd t && (rm -f perl$(EXE_EXT); $(LNS) ../miniperl$(EXE_EXT) perl$(EXE_EXT)) \
945                 && $(LDLIBPTH) ./perl TEST base/*.t comp/*.t cmd/*.t run/*.t io/*.t op/*.t pragma/*.t </dev/tty
946
947 # Handy way to run perlbug -ok without having to install and run the
948 # installed perlbug. We don't re-run the tests here - we trust the user.
949 # Please *don't* use this unless all tests pass.
950 # If you want to report test failures, use "make nok" instead.
951 ok:     utilities
952         $(LDLIBPTH) ./perl -Ilib utils/perlbug -ok -s '(UNINSTALLED)'
953
954 okfile: utilities
955         $(LDLIBPTH) ./perl -Ilib utils/perlbug -ok -s '(UNINSTALLED)' -F perl.ok
956
957 oknack: utilities
958         $(LDLIBPTH) ./perl -Ilib utils/perlbug -ok -s '(UNINSTALLED)' -A
959
960 okfilenack:     utilities
961         $(LDLIBPTH) ./perl -Ilib utils/perlbug -ok -s '(UNINSTALLED)' -F perl.ok -A
962
963 nok:    utilities
964         $(LDLIBPTH) ./perl -Ilib utils/perlbug -nok -s '(UNINSTALLED)'
965
966 nokfile:        utilities
967         $(LDLIBPTH) ./perl -Ilib utils/perlbug -nok -s '(UNINSTALLED)' -F perl.nok
968
969 noknack:        utilities
970         $(LDLIBPTH) ./perl -Ilib utils/perlbug -nok -s '(UNINSTALLED)' -A
971
972 nokfilenack:    utilities
973         $(LDLIBPTH) ./perl -Ilib utils/perlbug -nok -s '(UNINSTALLED)' -F perl.nok -A
974
975 clist:  $(c)
976         echo $(c) | tr ' ' $(TRNL) >.clist
977
978 hlist:  $(h)
979         echo $(h) | tr ' ' $(TRNL) >.hlist
980
981 shlist: $(sh)
982         echo $(sh) | tr ' ' $(TRNL) >.shlist
983
984 pllist: $(pl)
985         echo $(pl) | tr ' ' $(TRNL) >.pllist
986
987 Makefile: Makefile.SH ./config.sh
988         $(SHELL) Makefile.SH
989
990 distcheck: FORCE
991         perl '-MExtUtils::Manifest=&fullcheck' -e 'fullcheck()'
992
993 elc:    emacs/cperl-mode.elc
994
995 emacs/cperl-mode.elc: emacs/cperl-mode.el
996         -cd emacs; emacs -batch -q -no-site-file -f batch-byte-compile cperl-mode.el
997
998 etags:  TAGS
999
1000 TAGS: emacs/cperl-mode.elc
1001         sh emacs/ptags
1002
1003 ctags:  tags
1004
1005 # Let's hope make will not go into an infinite loop on case-unsensitive systems
1006 # This may also fail if . is in the head of the path, since perl will
1007 # require -Ilib
1008 tags:   TAGS
1009         perl emacs/e2ctags.pl TAGS > tags
1010
1011 # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
1012 # If this runs make out of memory, delete /usr/include lines.
1013 !NO!SUBS!
1014
1015 $eunicefix Makefile
1016 case `pwd` in
1017 *SH)
1018     $rm -f ../Makefile
1019     $ln Makefile ../Makefile
1020     ;;
1021 esac
1022 $rm -f $firstmakefile
1023
1024 # Now do any special processing required before building.
1025
1026 case "$ebcdic" in
1027 $define)
1028     xxx=''
1029     echo "This is an EBCDIC system, checking if any parser files need regenerating." >&4
1030 case "$osname" in
1031 os390|posix-bc)
1032     rm -f y.tab.c y.tab.h
1033     # yacc must be a reentrant ("pure") Bison in BS2000 Posix!
1034     yacc -d perly.y >/dev/null 2>&1
1035     if cmp -s y.tab.c perly.c; then
1036         rm -f y.tab.c
1037     else
1038         echo "perly.y -> perly.c" >&2
1039         mv -f y.tab.c perly.c
1040         chmod u+w perly.c
1041         sed -e '/^#include "perl\.h"/a\
1042 \
1043 #define yydebug    PL_yydebug\
1044 #define yynerrs    PL_yynerrs\
1045 #define yyerrflag  PL_yyerrflag\
1046 #define yychar     PL_yychar\
1047 #define yyval      PL_yyval\
1048 #define yylval     PL_yylval'                           \
1049             -e '/YYSTYPE *yyval;/D'                     \
1050             -e '/YYSTYPE *yylval;/D'                    \
1051             -e '/int  yychar,/,/yynerrs;/D'             \
1052             -e 's/int yydebug = 0;/yydebug = 0;/'       \
1053             -e 's/[^_]realloc(/PerlMem_realloc(/g'      \
1054             -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \
1055             -e 's/y\.tab/perly/g' perly.c >perly.tmp && mv perly.tmp perly.c
1056         xxx="$xxx perly.c"
1057     fi
1058     if cmp -s y.tab.h perly.h; then
1059         rm -f y.tab.h
1060     else
1061         echo "perly.y -> perly.h" >&2
1062         mv -f y.tab.h perly.h
1063         xxx="$xxx perly.h"
1064     fi
1065     if cd x2p
1066     then
1067         rm -f y.tab.c y.tab.h
1068         case "$osname" in
1069         posix-bc)
1070            # we are using two different yaccs in BS2000 Posix!
1071            byacc a2p.y >/dev/null 2>&1
1072            ;;
1073         *) # e.g. os390
1074            yacc  a2p.y >/dev/null 2>&1
1075            ;;
1076         esac
1077         if cmp -s y.tab.c a2p.c
1078         then
1079             rm -f y.tab.c
1080         else
1081             echo "a2p.y -> a2p.c" >&2
1082             mv -f y.tab.c a2p.c
1083             chmod u+w a2p.c
1084             sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \
1085                 -e 's|^static void __YY_YACC_MAIN.*BS2000.*|/*static main deleted*/|' \
1086                 -e 's/y\.tab/a2p/g' a2p.c >a2p.tmp && mv a2p.tmp a2p.c
1087             xxx="$xxx a2p.c"
1088         fi
1089         # In case somebody yacc -d:ed the a2p.y.
1090         if test -f y.tab.h
1091         then
1092             if cmp -s y.tab.h a2p.h
1093             then
1094                 rm -f y.tab.h
1095             else
1096                 echo "a2p.h -> a2p.h" >&2
1097                 mv -f y.tab.h a2p.h
1098                 xxx="$xxx a2p.h"
1099             fi
1100         fi
1101         cd ..
1102     fi
1103     ;;
1104 vmesa)
1105     # Do nothing in VM/ESA.
1106     ;;
1107 *)
1108     echo "'$osname' is an EBCDIC system I don't know that well." >&4
1109     ;;
1110 esac
1111     case "$xxx" in
1112     '') echo "No parser files were regenerated.  That's okay." >&2 ;;
1113     esac
1114     ;;
1115 esac
1116