diff options
author | Stuart Henderson <sthen@cvs.openbsd.org> | 2013-03-25 20:20:36 +0000 |
---|---|---|
committer | Stuart Henderson <sthen@cvs.openbsd.org> | 2013-03-25 20:20:36 +0000 |
commit | d1c8ee75d47cf5a62474f9f0b243dc5a4276a755 (patch) | |
tree | 724c776807fcee355d5daceec259ccc8ae7b36b9 | |
parent | b4e3ef6f520b53eafa91905a28167d0a51ce8559 (diff) |
merge 5.16.3 / link main binary with pthread
-rw-r--r-- | gnu/usr.bin/perl/Makefile.SH | 423 |
1 files changed, 230 insertions, 193 deletions
diff --git a/gnu/usr.bin/perl/Makefile.SH b/gnu/usr.bin/perl/Makefile.SH index 131401a60f5..7266d82bfb1 100644 --- a/gnu/usr.bin/perl/Makefile.SH +++ b/gnu/usr.bin/perl/Makefile.SH @@ -20,20 +20,6 @@ case $CROSS_NAME in ;; esac -# H.Merijn Brand [17 Feb 2004] -# This comment is just to ensure that Configure will find variables that -# are removed/replaced in patches on blead, but are still needed in the -# 5.8.x, 5.6.x and 5.005.x maintainance tracks. -# metaconfig -m will scan all .SH files on this level (not deeper), and -# not in x2p and other subfolders. This file is as good as any .SH -# patch references -# #22227 $baserev -# #22302 $yacc $byacc - -# H.Merijn Brand [30 Oct 2004] -# Mentioned for the same reason for future reference -# #23434 $d_strlcat $d_strlcpy - : This forces SH files to create target in same directory as SH file. : This is so that make depend always knows where to find SH derivatives. case "$0" in @@ -178,10 +164,22 @@ EOT ;; esac +: is Cwd static or dynamic +static_cwd='define' +list_util_dep='$(PERL_EXE)' +for f in $dynamic_ext; do + case $f in + Cwd) static_cwd='undef' ;; + List/Util) list_util_dep=lib/auto/List/Util/Util.$dlext + esac +done + : Prepare dependency lists for Makefile. dynamic_list=' ' dynamic_ext_re="lib/auto/re/re.$dlext" -extra_dep='' +extra_dep=' +ext/Pod-Functions/pm_to_blib: cpan/Pod-Simple/pm_to_blib pod/perlfunc.pod +' for f in $dynamic_ext; do : the dependency named here will never exist base=`echo "$f" | sed 's/.*\///'` @@ -190,14 +188,10 @@ for f in $dynamic_ext; do : Parallel makes reveal that we have some interdependencies case $f in - Encode|POSIX|SDBM_File) extra_dep="$extra_dep -$this_target: lib/auto/Cwd/Cwd.$dlext" ;; Math/BigInt/FastCalc|Devel/NYTProf) extra_dep="$extra_dep -$this_target: lib/auto/List/Util/Util.$dlext" ;; +$this_target: $list_util_dep" ;; Unicode/Normalize) extra_dep="$extra_dep $this_target: uni.data" ;; - Text/ParseWords) extra_dep="$extra_dep -$this_target: lib/auto/Scalar/Util.$dlext" ;; esac done @@ -227,11 +221,13 @@ done dtrace_h='' dtrace_o='' +minidtrace_o='' case "$usedtrace" in define|true) dtrace_h='perldtrace.h' $dtrace -G -s perldtrace.d -o perldtrace.tmp >/dev/null 2>&1 \ - && rm -f perldtrace.tmp && dtrace_o='perldtrace$(OBJ_EXT)' + && rm -f perldtrace.tmp && dtrace_o='perldtrace$(OBJ_EXT)' \ + && minidtrace_o='miniperldtrace$(OBJ_EXT)' ;; esac @@ -337,13 +333,25 @@ $make_set_make # Mention $gmake here so it gets probed for by Configure. +!GROK!THIS! + +case "${osname}" in +linux*|darwin) +$spitshell >>$Makefile <<!GROK!THIS! # If you're going to use valgrind and it can't be invoked as plain valgrind # then you'll need to change this, or override it on the make command line. -VALGRIND=valgrind +VALGRIND ?= valgrind +VG_TEST ?= ./perl -e 1 2>/dev/null + +!GROK!THIS! + ;; +esac +$spitshell >>$Makefile <<!GROK!THIS! DTRACE = $dtrace DTRACE_H = $dtrace_h DTRACE_O = $dtrace_o +MINIDTRACE_O = $minidtrace_o FIRSTMAKEFILE = $firstmakefile @@ -396,7 +404,7 @@ CCCMD = `sh $(shellflags) cflags "optimize='$(OPTIMIZE)'" $@` CCCMDSRC = `sh $(shellflags) cflags "optimize='$(OPTIMIZE)'" $<` CONFIGPM_FROM_CONFIG_SH = lib/Config.pm lib/Config_heavy.pl -CONFIGPM = $(CONFIGPM_FROM_CONFIG_SH) +CONFIGPM = $(CONFIGPM_FROM_CONFIG_SH) lib/Config_git.pl CONFIGPOD = lib/Config.pod @@ -428,30 +436,20 @@ esac ## In the following dollars and backticks do not need the extra backslash. $spitshell >>$Makefile <<'!NO!SUBS!' -private = preplibrary $(CONFIGPM) $(CONFIGPOD) lib/ExtUtils/Miniperl.pm +private = preplibrary $(CONFIGPM) $(CONFIGPOD) lib/ExtUtils/Miniperl.pm git_version.h lib/buildcustomize.pl # Files to be built with variable substitution before miniperl # is available. -sh = Makefile.SH cflags.SH config_h.SH makeaperl.SH makedepend.SH \ - myconfig.SH writemain.SH pod/Makefile.SH - -shextract = Makefile cflags config.h makeaperl makedepend \ - makedir myconfig writemain pod/Makefile - -# Files to be built with variable substitution after miniperl is -# available. Dependencies handled manually below (for now). +sh = Makefile.SH cflags.SH config_h.SH makedepend.SH myconfig.SH pod/Makefile.SH -pl = pod/pod2html.PL pod/pod2latex.PL pod/pod2man.PL pod/pod2text.PL \ - pod/pod2usage.PL pod/podchecker.PL pod/podselect.PL +shextract = Makefile cflags config.h makedepend makedir myconfig pod/Makefile -plextract = pod/pod2html pod/pod2latex pod/pod2man pod/pod2text \ - pod/pod2usage pod/podchecker pod/podselect - -addedbyconf = UU $(shextract) $(plextract) pstruct +addedbyconf = UU $(shextract) pstruct # Unicode data files generated by mktables unidatafiles = lib/unicore/Decomposition.pl lib/unicore/TestProp.pl \ lib/unicore/CombiningClass.pl lib/unicore/Name.pl \ + lib/unicore/UCD.pl lib/unicore/Name.pm \ lib/unicore/Heavy.pl lib/unicore/mktables.lst # Directories of Unicode data files generated by mktables @@ -461,30 +459,34 @@ h1 = EXTERN.h INTERN.h XSUB.h av.h $(CONFIGH) cop.h cv.h dosish.h h2 = embed.h form.h gv.h handy.h hv.h keywords.h mg.h op.h opcode.h h3 = pad.h patchlevel.h perl.h perlapi.h perly.h pp.h proto.h regcomp.h h4 = regexp.h scope.h sv.h unixish.h util.h iperlsys.h thread.h -h5 = utf8.h warnings.h mydtrace.h -h = $(h1) $(h2) $(h3) $(h4) $(h5) +h5 = utf8.h warnings.h mydtrace.h op_reg_common.h l1_char_class_tab.h +h6 = charclass_invlists.h +h = $(h1) $(h2) $(h3) $(h4) $(h5) $(h6) c1 = av.c scope.c op.c doop.c doio.c dump.c gv.c hv.c mg.c reentr.c mro.c perl.c c2 = perly.c pp.c pp_hot.c pp_ctl.c pp_sys.c regcomp.c regexec.c utf8.c sv.c -c3 = taint.c toke.c util.c deb.c run.c universal.c pad.c globals.c +c3 = taint.c toke.c util.c deb.c run.c universal.c pad.c globals.c keywords.c c4 = perlio.c perlapi.c numeric.c mathoms.c locale.c pp_pack.c pp_sort.c c5 = $(madlysrc) $(mallocsrc) -c = $(c1) $(c2) $(c3) $(c4) $(c5) miniperlmain.c perlmain.c opmini.c perlmini.c +c = $(c1) $(c2) $(c3) $(c4) $(c5) miniperlmain.c opmini.c perlmini.c obj0 = op$(OBJ_EXT) perl$(OBJ_EXT) -obj1 = $(madlyobj) $(mallocobj) gv$(OBJ_EXT) toke$(OBJ_EXT) perly$(OBJ_EXT) pad$(OBJ_EXT) regcomp$(OBJ_EXT) dump$(OBJ_EXT) util$(OBJ_EXT) mg$(OBJ_EXT) reentr$(OBJ_EXT) mro$(OBJ_EXT) +obj0mini = perlmini$(OBJ_EXT) opmini$(OBJ_EXT) miniperlmain$(OBJ_EXT) +obj1 = $(madlyobj) $(mallocobj) gv$(OBJ_EXT) toke$(OBJ_EXT) perly$(OBJ_EXT) pad$(OBJ_EXT) regcomp$(OBJ_EXT) dump$(OBJ_EXT) util$(OBJ_EXT) mg$(OBJ_EXT) reentr$(OBJ_EXT) mro$(OBJ_EXT) keywords$(OBJ_EXT) 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) obj3 = doop$(OBJ_EXT) doio$(OBJ_EXT) regexec$(OBJ_EXT) utf8$(OBJ_EXT) taint$(OBJ_EXT) deb$(OBJ_EXT) universal$(OBJ_EXT) globals$(OBJ_EXT) perlio$(OBJ_EXT) perlapi$(OBJ_EXT) numeric$(OBJ_EXT) mathoms$(OBJ_EXT) locale$(OBJ_EXT) pp_pack$(OBJ_EXT) pp_sort$(OBJ_EXT) -mini_obj = $(obj1) $(obj2) $(obj3) $(ARCHOBJS) $(DTRACE_O) +minindt_obj = $(obj0mini) $(obj1) $(obj2) $(obj3) $(ARCHOBJS) +mini_obj = $(minindt_obj) $(MINIDTRACE_O) ndt_obj = $(obj0) $(obj1) $(obj2) $(obj3) $(ARCHOBJS) obj = $(ndt_obj) $(DTRACE_O) -perltoc_pod_prereqs = extra.pods pod/perlapi.pod pod/perldelta.pod pod/perlintern.pod pod/perlmodlib.pod pod/perluniprops.pod +perltoc_pod_prereqs = extra.pods pod/perl5163delta.pod pod/perlapi.pod pod/perlintern.pod pod/perlmodlib.pod generated_pods = pod/perltoc.pod $(perltoc_pod_prereqs) +generated_headers = uudmap.h bitcount.h mg_data.h -Icwd = -Icpan/Cwd -Icpan/Cwd/lib +Icwd = -Idist/Cwd -Idist/Cwd/lib -Idist/Carp/lib lintflags = \ -b \ @@ -553,29 +555,57 @@ splintfiles = $(c1) .c.s: $(CCCMDSRC) -S $*.c -all: $(FIRSTMAKEFILE) $(MINIPERL_EXE) miniperl $(generated_pods) $(private) $(unidatafiles) $(public) $(dynamic_ext) $(nonxs_ext) extras.make +all: $(FIRSTMAKEFILE) $(MINIPERL_EXE) $(generated_pods) $(private) $(unidatafiles) $(public) $(dynamic_ext) $(nonxs_ext) extras.make @echo " "; @echo " Everything is up to date. Type '$(MAKE) test' to run test suite." .PHONY: all translators utilities -# OpenBSD uses pre-generated lib/Config_git.pl and git_version.h files # Both git_version.h and lib/Config_git.pl are built # by make_patchnum.pl. -#git_version.h: lib/Config_git.pl -# -#lib/Config_git.pl: $(MINIPERL_EXE) make_patchnum.pl -# $(MINIPERL) make_patchnum.pl +git_version.h: lib/Config_git.pl + +lib/Config_git.pl: $(MINIPERL_EXE) make_patchnum.pl + $(MINIPERL) make_patchnum.pl # make sure that we recompile perl.c if the git version changes perl$(OBJ_EXT): git_version.h -translators: $(MINIPERL_EXE) $(CONFIGPM) $(dynamic_ext) FORCE - @echo " "; echo " Making x2p stuff"; cd x2p; $(LDLIBPTH) $(MAKE) all +!NO!SUBS! + +# Making utilities and translators require Cwd. If we have dynamic +# loading, we only need miniperl and Cwd.$dlext. If we have static +# loading, we need to build perl first. +case "$usedl$static_cwd" in +defineundef) + util_deps='$(MINIPERL_EXE) $(CONFIGPM) lib/auto/Cwd/Cwd$(DLSUFFIX) FORCE' + x2p_deps='$(MINIPERL_EXE) $(CONFIGPM) $(dynamic_ext) FORCE' + ;; +definedefine) + util_deps='$(PERL_EXE) $(CONFIGPM) FORCE' + x2p_deps='$(PERL_EXE) $(CONFIGPM) $(dynamic_ext) FORCE' + ;; +*) util_deps='$(PERL_EXE) $(CONFIGPM) FORCE' + x2p_deps='$(PERL_EXE) $(CONFIGPM) FORCE' + ;; +esac + +$spitshell >>$Makefile <<!GROK!THIS! +translators: $x2p_deps + @echo " "; echo " Making x2p stuff"; cd x2p; \$(LDLIBPTH) \$(MAKE) all + +x2p/s2p: $x2p_deps + cd x2p; \$(LDLIBPTH) \$(MAKE) s2p + +x2p/find2perl: $x2p_deps + cd x2p; \$(LDLIBPTH) \$(MAKE) find2perl -utilities: $(MINIPERL_EXE) $(CONFIGPM) $(plextract) FORCE - @echo " "; echo " Making utilities"; cd utils; $(LDLIBPTH) $(MAKE) all +utilities: $util_deps + @echo " "; echo " Making utilities"; cd utils; \$(LDLIBPTH) \$(MAKE) all + +!GROK!THIS! +$spitshell >>$Makefile <<'!NO!SUBS!' # This is now done by installman only if you actually want the man pages. # @echo " "; echo " Making docs"; cd pod; $(MAKE) all; @@ -586,43 +616,54 @@ utilities: $(MINIPERL_EXE) $(CONFIGPM) $(plextract) FORCE FORCE: @sh -c true !NO!SUBS! -$spitshell >>$Makefile <<!GROK!THIS! -# We do a copy of the op.c instead of a symlink because gcc gets huffy +for file in op perl; do + if $issymlink $file.c; then + $spitshell >>$Makefile <<!GROK!THIS! + +# We do a copy of the $file.c instead of a symlink because gcc gets huffy # if we have a symlink forest to another disk (it complains about too many # levels of symbolic links, even if we have only two) -opmini.c: op.c - \$(RMS) opmini.c - \$(CPS) op.c opmini.c +${file}mini.c: $file.c + \$(RMS) ${file}mini.c + \$(CPS) ${file}.c ${file}mini.c +!GROK!THIS! + else + $spitshell >>$Makefile <<!GROK!THIS! -opmini\$(OBJ_EXT): opmini.c - \$(CCCMD) \$(PLDLFLAGS) $DPERL_EXTERNAL_GLOB opmini.c +${file}mini.c: $file.c + \$(RMS) ${file}mini.c + \$(LNS) ${file}.c ${file}mini.c +!GROK!THIS! + fi -perlmini.c: perl.c - \$(RMS) perlmini.c - \$(CPS) perl.c perlmini.c + $spitshell >>$Makefile <<!GROK!THIS! -perlmini\$(OBJ_EXT): perlmini.c - \$(CCCMD) \$(PLDLFLAGS) $DPERL_IS_MINIPERL perlmini.c +${file}mini\$(OBJ_EXT): ${file}mini.c + \$(CCCMD) \$(PLDLFLAGS) $DPERL_IS_MINIPERL $DPERL_EXTERNAL_GLOB ${file}mini.c +!GROK!THIS! +done -globals\$(OBJ_EXT): uudmap.h bitcount.h +$spitshell >>$Makefile <<'!NO!SUBS!' -uudmap.h: bitcount.h +globals$(OBJ_EXT): $(generated_headers) -bitcount.h: generate_uudmap\$(HOST_EXE_EXT) - \$(RUN) ./generate_uudmap\$(HOST_EXE_EXT) uudmap.h bitcount.h +uudmap.h mg_data.h: bitcount.h -generate_uudmap\$(HOST_EXE_EXT): generate_uudmap\$(OBJ_EXT) - \$(CC) -o generate_uudmap\$(EXE_EXT) \$(LDFLAGS) generate_uudmap\$(OBJ_EXT) \$(libs) +bitcount.h: generate_uudmap$(HOST_EXE_EXT) + $(RUN) ./generate_uudmap$(HOST_EXE_EXT) $(generated_headers) + +generate_uudmap$(OBJ_EXT): mg_raw.h + +generate_uudmap$(HOST_EXE_EXT): generate_uudmap$(OBJ_EXT) + $(CC) -o generate_uudmap$(EXE_EXT) $(LDFLAGS) generate_uudmap$(OBJ_EXT) $(libs) -!GROK!THIS! -$spitshell >>$Makefile <<'!NO!SUBS!' miniperlmain$(OBJ_EXT): miniperlmain.c patchlevel.h $(CCCMD) $(PLDLFLAGS) $*.c -perlmain.c: miniperlmain.c config.sh $(FIRSTMAKEFILE) - sh writemain $(DYNALOADER) $(static_ext) > perlmain.c +perlmain.c: $(MINIPERL_EXE) lib/ExtUtils/Miniperl.pm + $(MINIPERL) -Ilib -MExtUtils::Miniperl -e 'writemain(@ARGV)' DynaLoader $(static_ext) > perlmain.c perlmain$(OBJ_EXT): perlmain.c $(CCCMD) $(PLDLFLAGS) $*.c @@ -644,6 +685,14 @@ case "$osname" in esac case "$osname" in +openbsd) + $spitshell >>$Makefile <<!GROK!THIS! +# When building Perl itself, link with the thread library, +# so that extensions can use thread functions even though Perl +# is not threaded. +CCDLFLAGS = $ccdlflags -lpthread +!GROK!THIS! + ;; aix) $spitshell >>$Makefile <<!GROK!THIS! LIBS = $perllibs @@ -664,7 +713,7 @@ MINIPERL_NONSHR = miniperl_nonshr$(EXE_EXT) # $(RMS) $(LIBPERL_NONSHR) # $(AR) rcu $(LIBPERL_NONSHR) $(obj) -$(MINIPERL_NONSHR): $(LIBPERL_NONSHR) miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) perlmini$(OBJ_EXT) +$(MINIPERL_NONSHR): miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) perlmini$(OBJ_EXT) $(CC) $(LDFLAGS) -o $(MINIPERL_NONSHR) miniperlmain$(OBJ_EXT) \ opmini$(OBJ_EXT) perlmini$(OBJ_EXT) $(LIBPERL_NONSHR) $(LIBS) @@ -685,8 +734,8 @@ PERLEXPORT = perl.exp ;; esac $spitshell >>$Makefile <<'!NO!SUBS!' -perl.exp: $(MINIPERLEXP) makedef.pl config.sh $(SYM) $(SYMH) - ./$(MINIPERLEXP) makedef.pl PLATFORM=aix CC_FLAGS="$(OPTIMIZE)" | sort -u | sort -f > perl.exp +perl.exp: $(MINIPERLEXP) makedef.pl $(CONFIGPM) $(SYM) $(SYMH) + ./$(MINIPERLEXP) makedef.pl --sort-fold PLATFORM=aix CC_FLAGS="$(OPTIMIZE)" > perl.exp !NO!SUBS! ;; @@ -694,7 +743,7 @@ os2) $spitshell >>$Makefile <<'!NO!SUBS!' MINIPERLEXP = miniperl -perl5.def: $(MINIPERLEXP) makedef.pl config.sh $(SYM) $(SYMH) miniperl.map +perl5.def: $(MINIPERLEXP) makedef.pl $(CONFIGPM) $(SYM) $(SYMH) miniperl.map ./$(MINIPERLEXP) makedef.pl PLATFORM=os2 -DPERL_DLL=$(PERL_DLL) CC_FLAGS="$(OPTIMIZE)" > perl5.def !NO!SUBS! @@ -724,8 +773,11 @@ else case "$dtrace_h" in ?*) $spitshell >>$Makefile <<'!NO!SUBS!' +# dtrace dicards const qualifiers from arguments, put them back $(DTRACE_H): perldtrace.d - $(DTRACE) -h -s perldtrace.d -o $(DTRACE_H) + $(DTRACE) -h -s perldtrace.d -o $(DTRACE_H).in + sed -e '/const/!s/char \*/const char */g' $(DTRACE_H).in >$(DTRACE_H) + $(RMS) $(DTRACE_H).in mydtrace.h: $(DTRACE_H) @@ -735,9 +787,12 @@ mydtrace.h: $(DTRACE_H) case "$dtrace_o" in ?*) $spitshell >>$Makefile <<'!NO!SUBS!' -$(DTRACE_O): perldtrace.d +$(DTRACE_O): perldtrace.d $(ndt_obj) $(DTRACE) -G -s perldtrace.d -o $(DTRACE_O) $(ndt_obj) +$(MINIDTRACE_O): perldtrace.d $(minindt_obj) perlmini$(OBJ_EXT) + $(DTRACE) -G -s perldtrace.d -o $(MINIDTRACE_O) $(minindt_obj) perlmini$(OBJ_EXT) + !NO!SUBS! ;; esac @@ -785,18 +840,15 @@ $(DTRACE_O): perldtrace.d case "${osname}${osvers}" in aix*|beos*) $spitshell >>$Makefile <<'!NO!SUBS!' -$(MINIPERL_EXE): $& miniperlmain$(OBJ_EXT) $(mini_obj) opmini$(OBJ_EXT) perlmini$(OBJ_EXT) - $(CC) -o $(MINIPERL_EXE) $(CLDFLAGS) \ - $(mini_obj) \ - miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) perlmini$(OBJ_EXT) $(libs) +$(MINIPERL_EXE): $& $(mini_obj) + $(CC) -o $(MINIPERL_EXE) $(CLDFLAGS) $(mini_obj) $(libs) $(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest !NO!SUBS! ;; next4*) $spitshell >>$Makefile <<'!NO!SUBS!' -$(MINIPERL_EXE): $& miniperlmain$(OBJ_EXT) $(mini_obj) perlmini$(OBJ_EXT) opmini$(OBJ_EXT) - $(CC) -o $(MINIPERL_EXE) $(mini_obj) \ - miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) perlmini$(OBJ_EXT) $(libs) +$(MINIPERL_EXE): $& $(mini_obj) + $(CC) -o $(MINIPERL_EXE) $(mini_obj) $(libs) $(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest !NO!SUBS! ;; @@ -814,21 +866,19 @@ NAMESPACEFLAGS = -force_flat_namespace ;; esac $spitshell >>$Makefile <<'!NO!SUBS!' -$(MINIPERL_EXE): $& miniperlmain$(OBJ_EXT) $(mini_obj) opmini$(OBJ_EXT) perlmini$(OBJ_EXT) +$(MINIPERL_EXE): $& $(mini_obj) -@rm -f miniperl.xok $(CC) $(CLDFLAGS) $(NAMESPACEFLAGS) -o $(MINIPERL_EXE) \ - $(mini_obj) \ - miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) perlmini$(OBJ_EXT) $(libs) + $(mini_obj) $(libs) $(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest !NO!SUBS! ;; *) $spitshell >>$Makefile <<'!NO!SUBS!' -$(MINIPERL_EXE): $& miniperlmain$(OBJ_EXT) $(mini_obj) opmini$(OBJ_EXT) perlmini$(OBJ_EXT) +$(MINIPERL_EXE): $& $(mini_obj) -@rm -f miniperl.xok $(LDLIBPTH) $(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \ - $(mini_obj) \ - miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) perlmini$(OBJ_EXT) $(libs) + $(mini_obj) $(libs) $(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest !NO!SUBS! ;; @@ -836,22 +886,27 @@ $(MINIPERL_EXE): $& miniperlmain$(OBJ_EXT) $(mini_obj) opmini$(OBJ_EXT) perlmini $spitshell >>$Makefile <<'!NO!SUBS!' -$(PERL_EXE): $& perlmain$(OBJ_EXT) $(LIBPERL) $(static_ext) ext.libs $(PERLEXPORT) +$(PERL_EXE): $& perlmain$(OBJ_EXT) $(static_ext) ext.libs $(PERLEXPORT) -@rm -f miniperl.xok $(SHRPENV) $(LDLIBPTH) $(CC) -o perl$(PERL_SUFFIX) $(PERL_PROFILE_LDFLAGS) $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs) # Purify/Quantify Perls. -pure$(PERL_EXE): $& perlmain$(OBJ_EXT) $(LIBPERL) $(static_ext) ext.libs $(PERLEXPORT) +pure$(PERL_EXE): $& perlmain$(OBJ_EXT) $(static_ext) ext.libs $(PERLEXPORT) $(SHRPENV) $(LDLIBPTH) purify $(CC) -o pureperl $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs) -purecov$(PERL_EXE): $& perlmain$(OBJ_EXT) $(LIBPERL) $(static_ext) ext.libs $(PERLEXPORT) +purecov$(PERL_EXE): $& perlmain$(OBJ_EXT) $(static_ext) ext.libs $(PERLEXPORT) $(SHRPENV) $(LDLIBPTH) purecov $(CC) -o purecovperl $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs) -quant$(PERL_EXE): $& perlmain$(OBJ_EXT) $(LIBPERL) $(static_ext) ext.libs $(PERLEXPORT) +quant$(PERL_EXE): $& perlmain$(OBJ_EXT) $(static_ext) ext.libs $(PERLEXPORT) $(SHRPENV) $(LDLIBPTH) quantify $(CC) -o quantperl $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs) -# Valgrind perl (currently Linux only) +!NO!SUBS! + +case "${osname}${osvers}" in +linux*|darwin*) + $spitshell >>$Makefile <<'!NO!SUBS!' +# Valgrind perl (currently Linux, Darwin only) perl.valgrind.config: config.sh @echo "To build perl.valgrind you must Configure -Doptimize=-g -Uusemymalloc, checking..." @@ -860,7 +915,12 @@ perl.valgrind.config: config.sh @grep "^usemymalloc=" config.sh @grep "^usemymalloc='n'" config.sh >/dev/null || exit 1 @echo "And of course you have to have valgrind..." - $(VALGRIND) ./perl -e 1 2>/dev/null || exit 1 + $(VALGRIND) $(VG_TEST) || exit 1 +!NO!SUBS! + ;; +esac + +$spitshell >>$Makefile <<'!NO!SUBS!' # Third Degree Perl (Tru64 only) @@ -971,7 +1031,7 @@ esac $spitshell >>$Makefile <<'!NO!SUBS!' .PHONY: preplibrary -preplibrary: $(MINIPERL_EXE) $(CONFIGPM) lib/re.pm $(PREPLIBRARY_LIBPERL) +preplibrary: $(MINIPERL_EXE) $(CONFIGPM) $(PREPLIBRARY_LIBPERL) $(CONFIGPM_FROM_CONFIG_SH): $(CONFIGPOD) @@ -981,16 +1041,8 @@ $(CONFIGPOD): config.sh $(MINIPERL_EXE) configpm Porting/Glossary lib/Config_git lib/ExtUtils/Miniperl.pm: miniperlmain.c $(MINIPERL_EXE) minimod.pl $(CONFIGPM) $(MINIPERL) minimod.pl > lib/ExtUtils/Miniperl.pm -lib/re.pm: ext/re/re.pm - @-rm -f $@ - cp ext/re/re.pm lib/re.pm - -$(plextract): $(MINIPERL_EXE) $(CONFIGPM) x2p/s2p $(dynamic_ext) - @-rm -f $@ - $(MINIPERL) $@.PL - -x2p/s2p: $(MINIPERL_EXE) $(CONFIGPM) $(dynamic_ext) x2p/s2p.PL - cd x2p; $(LDLIBPTH) $(MAKE) s2p +lib/buildcustomize.pl: $(MINIPERL_EXE) write_buildcustomize.pl + $(MINIPERL) write_buildcustomize.pl >lib/buildcustomize.pl unidatafiles $(unidatafiles) pod/perluniprops.pod: uni.data @@ -1002,7 +1054,7 @@ uni.data: $(MINIPERL_EXE) $(CONFIGPM) lib/unicore/mktables $(nonxs_ext) # But also this ensures that all extensions are built before we try to scan # them, which picks up Devel::PPPort's documentation. pod/perltoc.pod: $(perltoc_pod_prereqs) $(PERL_EXE) $(ext) pod/buildtoc - $(RUN_PERL) -f -Ilib pod/buildtoc --build-toc -q + $(RUN_PERL) -f -Ilib pod/buildtoc -q pod/perlapi.pod: pod/perlintern.pod @@ -1012,8 +1064,8 @@ pod/perlintern.pod: $(MINIPERL_EXE) autodoc.pl embed.fnc pod/perlmodlib.pod: $(MINIPERL_EXE) pod/perlmodlib.PL MANIFEST $(MINIPERL) $(Icwd) pod/perlmodlib.PL -q -pod/perldelta.pod: pod/perl5122delta.pod - $(LNS) perl5122delta.pod pod/perldelta.pod +pod/perl5163delta.pod: pod/perldelta.pod + $(LNS) perldelta.pod pod/perl5163delta.pod extra.pods: $(MINIPERL_EXE) -@test ! -f extra.pods || rm -f `cat extra.pods` @@ -1036,22 +1088,19 @@ extras.install: $(PERL_EXE) .PHONY: install install-strip install-all install-verbose install-silent \ no-install install.perl install.man install.html -META.yml: Porting/makemeta Porting/Maintainers.pl Porting/Maintainers.pm - PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -Ilib Porting/makemeta - -install-strip: +install_strip install-strip: $(MAKE) STRIPFLAGS=-s install DESTDIR="$(DESTDIR)" -install install-all: +install install_all install-all: $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) DESTDIR="$(DESTDIR)" -install-verbose: +install_verbose install-verbose: $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-V DESTDIR="$(DESTDIR)" -install-silent: +install_silent install-silent: $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-S DESTDIR="$(DESTDIR)" -no-install: +no_install no-install: $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-n DESTDIR="$(DESTDIR)" # Set this to an empty string to avoid an attempt of rebuild before install @@ -1074,7 +1123,6 @@ install.html: all installhtml --htmlroot=$(privlib)/html \ --splithead=pod/perlipc \ --splititem=pod/perlfunc \ - --libpods=perlfunc:perlguts:perlvar:perlrun:perlop \ --ignore=Porting/Maintainers.pm,Porting/pumpkin.pod,Porting/repository.pod \ --verbose @@ -1086,11 +1134,11 @@ install.html: all installhtml .PHONY: regen_perly -run_byacc: +run_byacc run-byacc: @echo "run_byacc is obsolete; try 'make regen_perly' instead" # this outputs perly.h, perly.act and perly.tab -regen_perly: +regen_perly regen-perly: perl regen_perly.pl # We don't want to regenerate perly.c and perly.h, but they might @@ -1102,22 +1150,18 @@ perly.c: perly.y perly.h: perly.y -@sh -c true -# No compat3.sym here since and including the 5.004_50. -# No interp.sym since 5.005_03. -SYM = global.sym globvar.sym perlio.sym pp.sym +SYM = globvar.sym perlio.sym SYMH = perlvars.h intrpvar.h CHMOD_W = chmod +w # The following files are generated automatically -# embed.pl: proto.h embed.h embedvar.h global.sym -# perlapi.h perlapi.c -# [* embed.pl needs pp.sym generated by opcode.pl! *] -# keywords.pl: keywords.h -# opcode.pl: opcode.h opnames.h pp_proto.h pp.sym +# embed.pl: proto.h embed.h embedvar.h perlapi.h perlapi.c +# opcode.pl: opcode.h opnames.h pp_proto.h # regcomp.pl: regnodes.h # warnings.pl: warnings.h lib/warnings.pm +# feature.pl: feature.h lib/feature.pm # The correct versions should be already supplied with the perl kit, # in case you don't have perl available. # To force them to be regenerated, run @@ -1125,20 +1169,27 @@ CHMOD_W = chmod +w # with your existing copy of perl # (make regen_headers is kept for backwards compatibility) -AUTOGEN_FILES = keywords.h opcode.h opnames.h pp_proto.h pp.sym proto.h \ - embed.h embedvar.h global.sym \ - perlapi.h perlapi.c regnodes.h \ - warnings.h lib/warnings.pm +AUTOGEN_FILES = opcode.h opnames.h pp_proto.h proto.h embed.h embedvar.h \ + perlapi.h perlapi.c regnodes.h warnings.h lib/warnings.pm \ + lib/feature.pm feature.h .PHONY: regen_headers regen_all regen: FORCE -perl regen.pl + -perl regen/uconfig_h.pl -regen_headers: FORCE +regen_headers regen-headers: FORCE -perl regen.pl -v + -perl regen/uconfig_h.pl -v -regen_all: regen +regen_meta regen-meta: META.yml + +META.yml: FORCE + PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -Ilib Porting/makemeta + + +regen_all regen-all: regen regen_meta .PHONY: manisort manicheck @@ -1159,16 +1210,16 @@ manicheck: FORCE # # DynaLoader may be needed for extensions that use Makefile.PL. -$(DYNALOADER): $(MINIPERL_EXE) preplibrary FORCE $(nonxs_ext) +$(DYNALOADER): $(MINIPERL_EXE) lib/buildcustomize.pl preplibrary FORCE $(nonxs_ext) $(MINIPERL) make_ext.pl $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) LINKTYPE=static $(STATIC_LDFLAGS) -d_dummy $(dynamic_ext): $(MINIPERL_EXE) preplibrary makeppport $(DYNALOADER) FORCE $(PERLEXPORT) +d_dummy $(dynamic_ext): $(MINIPERL_EXE) lib/buildcustomize.pl preplibrary makeppport $(DYNALOADER) FORCE $(PERLEXPORT) $(MINIPERL) make_ext.pl $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) LINKTYPE=dynamic -s_dummy $(static_ext): $(MINIPERL_EXE) preplibrary makeppport $(DYNALOADER) FORCE +s_dummy $(static_ext): $(MINIPERL_EXE) lib/buildcustomize.pl preplibrary makeppport $(DYNALOADER) FORCE $(MINIPERL) make_ext.pl $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) LINKTYPE=static $(STATIC_LDFLAGS) -n_dummy $(nonxs_ext): $(MINIPERL_EXE) preplibrary FORCE +n_dummy $(nonxs_ext): $(MINIPERL_EXE) lib/buildcustomize.pl preplibrary FORCE $(MINIPERL) make_ext.pl $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) !NO!SUBS! @@ -1206,11 +1257,11 @@ veryclean: _verycleaner _mopup _clobber # Do not 'make _mopup' directly. _mopup: - rm -f *$(OBJ_EXT) *$(LIB_EXT) all perlmain.c opmini.c perlmini.c uudmap.h generate_uudmap$(EXE_EXT) bitcount.h + rm -f *$(OBJ_EXT) *$(LIB_EXT) all perlmain.c opmini.c perlmini.c generate_uudmap$(EXE_EXT) $(generated_headers) -rmdir .depending -@test -f extra.pods && rm -f `cat extra.pods` -@test -f vms/README_vms.pod && rm -f vms/README_vms.pod - -rm -f perl.exp ext.libs $(generated_pods) uni.data opmini.o perlmini.o + -rm -f perl.exp ext.libs $(generated_pods) uni.data opmini.o perlmini.o pod/roffitall -rm -f perl.export perl.dll perl.libexp perl.map perl.def -rm -f perl.loadmap miniperl.loadmap perl.prelmap miniperl.prelmap -rm -f perl.third lib*.so.perl.third perl.3log t/perl.third t/perl.3log @@ -1218,7 +1269,6 @@ _mopup: -rm -f perl.Addrs perl.Counts t/perl.Addrs t/perl.Counts *perl.xok -rm -f cygwin.c libperl*.def libperl*.dll cygperl*.dll *.exe.stackdump -rm -f $(PERL_EXE) $(MINIPERL_EXE) $(LIBPERL) libperl.* microperl - -rm -f opcode.h-old opnames.h-old pp.sym-old pp_proto.h-old -rm -f $(DTRACE_H) runtests # Do not 'make _tidy' directly. @@ -1252,7 +1302,8 @@ _cleaner1: _cleaner2: -rm -f core.*perl.*.? t/core.perl.*.? .?*.c rm -f core *perl.core t/core t/*perl.core core.* t/core.* - rm -f t/misctmp* t/forktmp* t/tmp* t/c t/$(PERL_EXE) t/rantests + rm -f t/$(PERL_EXE) t/rantests + rm -rf t/tmp* rm -f so_locations $(LIBPERL_NONSHR) $(MINIPERL_NONSHR) rm -rf $(addedbyconf) rm -f $(FIRSTMAKEFILE) $(FIRSTMAKEFILE).old makefile.old @@ -1262,7 +1313,7 @@ _cleaner2: rm -f lib/.exists lib/*/.exists lib/*/*/.exists rm -f h2ph.man pstruct rm -rf .config - rm -f preload lib/re.pm + rm -f preload rm -rf lib/Encode lib/Compress lib/Hash lib/re rm -rf lib/TAP lib/Module/Pluggable lib/App rm -rf lib/mro @@ -1273,10 +1324,12 @@ _cleaner2: rm -fr lib/B rm -fr lib/CPAN lib/CPANPLUS rm -fr lib/ExtUtils/CBuilder + rm -f pod2htmd.tmp + rm -rf pod/perlfunc pod/perlipc -rmdir cpan/CPANPLUS-Dist-Build/t/dummy-cpanplus cpan/CPANPLUS/t/dummy-cpanplus cpan/CPANPLUS/t/dummy-localmirror -rmdir ext/B/lib -rmdir lib/Archive/Tar lib/Archive lib/Attribute - -rmdir lib/CGI + -rmdir lib/CGI lib/Carp -rmdir lib/Data lib/Devel lib/Digest -rmdir lib/ExtUtils/Command lib/ExtUtils/Constant lib/ExtUtils/Liblist lib/ExtUtils/MakeMaker -rmdir lib/File/Spec lib/Filter/Util lib/Filter @@ -1293,7 +1346,7 @@ _cleaner2: -rmdir lib/Package lib/Params -rmdir lib/Pod/Perldoc lib/Pod/Simple lib/Pod/Text -rmdir lib/Sys lib/Scalar/Util lib/Scalar - -rmdir lib/Term/UI lib/Thread + -rmdir lib/Term/UI lib/Thread lib/Tie/Hash -rmdir lib/Test/Builder/Tester lib/Test/Builder lib/Test -rmdir lib/Unicode/Collate -rmdir lib/XS/APItest lib/XS @@ -1332,11 +1385,9 @@ $(FIRSTMAKEFILE): README $(MAKEDEPEND) config.h: config_h.SH config.sh $(SHELL) config_h.SH -# When done, touch perlmain.c so that it doesn't get remade each time. .PHONY: depend depend: makedepend sh ./makedepend MAKE=$(MAKE) - - test -s perlmain.c && touch perlmain.c cd x2p; $(MAKE) depend # Cannot postpone this until $firstmakefile is ready ;-) @@ -1365,7 +1416,9 @@ _test: test_prep_pre: preplibrary utilities $(nonxs_ext) -test_prep: test_prep_pre $(MINIPERL_EXE) $(unidatafiles) $(PERL_EXE) $(dynamic_ext) $(TEST_PERL_DLL) runtests +test_prep test-prep: test_prep_pre $(MINIPERL_EXE) $(unidatafiles) $(PERL_EXE) \ + $(dynamic_ext) $(TEST_PERL_DLL) runtests x2p/s2p x2p/find2perl \ + $(generated_pods) cd t && (rm -f $(PERL_EXE); $(LNS) ../$(PERL_EXE) $(PERL_EXE)) test_prep_reonly: $(MINIPERL_EXE) $(PERL_EXE) $(dynamic_ext_re) $(TEST_PERL_DLL) @@ -1375,10 +1428,10 @@ test_prep_reonly: $(MINIPERL_EXE) $(PERL_EXE) $(dynamic_ext_re) $(TEST_PERL_DLL) test check: test_prep $(RUN_TESTS) choose -test_tty: test_prep +test_tty test-tty: test_prep $(RUN_TESTS) tty -test_notty: test_prep +test_notty test-notty: test_prep $(RUN_TESTS) no-tty utest ucheck test.utf8 check.utf8: test_prep @@ -1387,12 +1440,6 @@ utest ucheck test.utf8 check.utf8: test_prep coretest: test_prep TEST_ARGS=-core $(RUN_TESTS) choose -test-prep: test_prep - -test-tty: test_tty - -test-notty: test_notty - # Torture testing test.torture torturetest: test_prep @@ -1402,7 +1449,7 @@ test.torture torturetest: test_prep minitest.utf16: minitest.prep - cd t && (rm -f $(PERL_EXE); $(LNS) ../$(MINIPERL_EXE) $(PERL_EXE)) \ - && $(RUN_PERL) TEST -minitest -utf16 base/*.t comp/*.t cmd/*.t run/*.t io/*.t op/*.t uni/*.t </dev/tty + && $(RUN_PERL) TEST -utf16 base/*.t comp/*.t cmd/*.t run/*.t io/*.t op/*.t uni/*.t </dev/tty test.utf16 check.utf16: test_prep TEST_ARGS=-utf16 $(RUN_TESTS) choose @@ -1410,6 +1457,11 @@ test.utf16 check.utf16: test_prep utest.utf16 ucheck.utf16: test_prep TEST_ARGS="-utf8 -utf16" $(RUN_TESTS) choose +!NO!SUBS! + +case "${osname}${osvers}" in +linux*|darwin*) + $spitshell >>$Makefile <<'!NO!SUBS!' # Targets for valgrind testing: test_prep.valgrind: test_prep perl.valgrind @@ -1422,6 +1474,11 @@ utest.valgrind ucheck.valgrind: test_prep.valgrind perl.valgrind.config test_notty.valgrind: test_prep.valgrind perl.valgrind.config PERL_VALGRIND=1 $(RUN_TESTS) no-tty +!NO!SUBS! + ;; +esac + +$spitshell >>$Makefile <<'!NO!SUBS!' # Targets for Third Degree testing. @@ -1459,26 +1516,26 @@ minitest.prep: # Can't depend on lib/Config.pm because that might be where miniperl # is crashing. -minitest: $(MINIPERL_EXE) lib/re.pm minitest.prep +minitest: $(MINIPERL_EXE) minitest.prep - cd t && (rm -f $(PERL_EXE); $(LNS) ../$(MINIPERL_EXE) $(PERL_EXE)) \ - && $(RUN_PERL) TEST -minitest base/*.t comp/*.t cmd/*.t run/*.t io/*.t re/*.t op/*.t uni/*.t </dev/tty + && $(RUN_PERL) TEST base/*.t comp/*.t cmd/*.t run/*.t io/*.t re/*.t op/*.t uni/*.t </dev/tty # Test via harness -test_harness: test_prep +test_harness test-harness: test_prep TESTFILE=harness $(RUN_TESTS) choose test_harness_notty: test_prep HARNESS_NOTTY=1 TESTFILE=harness $(RUN_TESTS) choose -test-reonly: test_prep_reonly +test_reonly test-reonly: test_prep_reonly TEST_ARGS='-re \bre\/' TESTFILE=harness $(RUN_TESTS) choose # Porting tests (well-formedness of pod, manifest, etc) -test_porting: test_prep - cd t && $(RUN_PERL) harness porting/*.t +test_porting test-porting: test_prep + cd t && $(RUN_PERL) harness porting/*.t ../lib/diagnostics.t # Handy way to run perlbug -ok without having to install and run the # installed perlbug. We don't re-run the tests here - we trust the user. @@ -1511,7 +1568,7 @@ noknack: utilities nokfilenack: utilities $(RUN_PERL) -Ilib utils/perlbug -nok -s '(UNINSTALLED)' -F perl.nok -A -.PHONY: clist hlist shlist pllist +.PHONY: clist hlist shlist clist: $(c) echo $(c) | tr ' ' $(TRNL) >.clist @@ -1522,9 +1579,6 @@ hlist: $(h) shlist: $(sh) echo $(sh) | tr ' ' $(TRNL) >.shlist -pllist: $(pl) - echo $(pl) | tr ' ' $(TRNL) >.pllist - Makefile: Makefile.SH ./config.sh $(SHELL) Makefile.SH @@ -1532,24 +1586,7 @@ Makefile: Makefile.SH ./config.sh distcheck: FORCE perl '-MExtUtils::Manifest=&fullcheck' -e 'fullcheck()' -.PHONY: elc -elc: emacs/cperl-mode.elc - -emacs/cperl-mode.elc: emacs/cperl-mode.el - -cd emacs; emacs -batch -q -no-site-file -f batch-byte-compile cperl-mode.el - -.PHONY: etags ctags tags - -etags: TAGS - -TAGS: emacs/cperl-mode.elc - sh emacs/ptags - -# Let's hope make will not go into an infinite loop on case-unsensitive systems -# This may also fail if . is in the head of the path, since perl will -# require -Ilib -tags: TAGS - perl emacs/e2ctags.pl TAGS > tags +.PHONY: ctags ctags: ctags -f Tags -N --totals --languages=c --langmap=c:+.h --exclude=opmini.c --exclude=perlmini.c *.c *.h |