X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/8424e3686d3ce1d57a0eafdbe7aaedd7b5bb390b..02b54f9d07226e99a30271314e02617d5629b511:/Makefile.SH diff --git a/Makefile.SH b/Makefile.SH index dd5b25d..ac05dee 100755 --- a/Makefile.SH +++ b/Makefile.SH @@ -56,12 +56,6 @@ true) pldlflags="$cccdlflags" static_ldflags='' case "${osname}${osvers}" in - next4*) - ld=libtool - lddlflags="-dynamic -undefined warning -framework System \ - -compatibility_version 1 -current_version $patchlevel \ - -prebind -seg1addr 0x27000000 -install_name \$(shrpdir)/\$@" - ;; darwin*) shrpldflags="${ldflags} -dynamiclib \ -compatibility_version \ @@ -79,7 +73,7 @@ true) esac ;; cygwin*) - shrpldflags="$shrpldflags -Wl,--out-implib=libperl.dll.a -Wl,--image-base,0x52000000" + shrpldflags="$shrpldflags -Wl,--out-implib=libperl.dll.a" linklibperl="-L. -lperl" ;; sunos*) @@ -124,10 +118,15 @@ true) linklibperl="-L `pwd | sed 's/\/UU$//'` -Wl,+s -Wl,+b$archlibexp/CORE -lperl" ;; os390*) - shrpldflags='-W l,XPLINK,dll' - linklibperl='libperl.x' - DPERL_EXTERNAL_GLOB='' - ;; + case "$use64bitall" in + define|true|[yY]*) shrpldflags='-Wl,LP64,dll' + linklibperl='libperl.x' + ;; + *) shrpldflags='-Wl,XPLINK,dll' + linklibperl='libperl.x' + ;; + esac + ;; esac case "$ldlibpthname" in '') ;; @@ -182,6 +181,16 @@ EOT ;; esac +# ccdlflags, not to be confused with cccdlflags: +case "${osname}" in +aix) + # In AIX we need to change this for building Perl itself from + # the config.sh definition (which is for building external + # extensions *after* Perl has been built and installed) + ccdlflags=`echo $ccdlflags|sed -e 's@-bE:.*/perl\.exp@-bE:perl.exp@'` + ;; +esac + : is Cwd static or dynamic static_cwd='define' list_util_dep='$(PERL_EXE)' @@ -192,10 +201,12 @@ for f in $dynamic_ext; do esac done -: Prepare dependency lists for Makefile. +: Prepare dependency lists for Makefile. Non-Unix systems likely will also +: require changes in make_ext.pl dynamic_list=' ' dynamic_ext_re="lib/auto/re/re.$dlext" extra_dep=' +cpan/Pod-Simple/pm_to_blib: dist/if/pm_to_blib ext/Pod-Functions/pm_to_blib: cpan/Pod-Simple/pm_to_blib cpan/Pod-Escapes/pm_to_blib pod/perlfunc.pod cpan/IO-Compress/pm_to_blib: dist/lib/pm_to_blib ' @@ -279,6 +290,7 @@ LNS = $lns CPS = $cp RMS = rm -f ranlib = $ranlib +ECHO = $echo # The following are mentioned only to make metaconfig include the # appropriate questions in Configure. If you want to change these, @@ -302,7 +314,6 @@ DLSUFFIX = .$dlext PLDLFLAGS = $pldlflags LIBPERL = $libperl LLIBPERL= $linklibperl -LLIBPERL_NONSHR= $linklibperl_nonshr SHRPENV = $shrpenv # Static targets are ordinarily built without CCCDLFLAGS. However, @@ -330,7 +341,6 @@ HOST_EXE_EXT = $_exe EXE_EXT = $_exe LIB_EXT = $_a OBJ_EXT = $_o -PATH_SEP = $p_ # Macros to invoke a copy of miniperl during the build. Targets which # are built using these macros should depend on \$(MINIPERL_EXE) @@ -425,7 +435,7 @@ FIRSTMAKEFILE = $firstmakefile # Any special object files needed by this architecture, e.g. os2/os2.obj ARCHOBJS = $archobjs -.SUFFIXES: .c \$(OBJ_EXT) .i .s +.SUFFIXES: .c \$(OBJ_EXT) .i .s .c.depends # grrr SHELL = $sh @@ -495,6 +505,15 @@ sh = $SH shextract = $shextract !GROK!THIS! +# Source files where we build a variant for miniperl: +mini_special='op perl universal' +for file in $mini_special; do + mini_special_c="$mini_special_c ${file}mini.c" + mini_only_objs="$mini_only_objs ${file}mini\$(OBJ_EXT)" + main_only_objs="$main_only_objs ${file}\$(OBJ_EXT)" + ctags_exclude="$ctags_exclude --exclude=${file}mini.c" +done + ## In the following dollars and backticks do not need the extra backslash. $spitshell >>$Makefile <<'!NO!SUBS!' @@ -511,31 +530,48 @@ unidatadirs = lib/unicore/To lib/unicore/lib 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 hv_func.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 +h3 = pad.h patchlevel.h perl.h perlapi.h perly.h pp.h proto.h regcomp.h regcomp_internal.h h4 = regexp.h scope.h sv.h unixish.h util.h iperlsys.h thread.h 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_core.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 keywords.c -c4 = perlio.c perlapi.c numeric.c mathoms.c locale.c pp_pack.c pp_sort.c caretx.c dquote.c time64.c -c5 = $(mallocsrc) +c1 = av.c scope.c op.c peep.c doop.c doio.c dump.c gv.c hv.c mg.c reentr.c mro_core.c perl.c +c2 = perly.c pp.c pp_hot.c pp_ctl.c pp_sys.c utf8.c sv.c +c3 = taint.c toke.c util.c deb.c run.c builtin.c universal.c pad.c globals.c keywords.c +c4 = perlio.c numeric.c mathoms.c locale.c pp_pack.c pp_sort.c caretx.c dquote.c time64.c +c5 = regcomp.c regcomp_debug.c regcomp_invlist.c regcomp_study.c regcomp_trie.c regexec.c +c6 = $(mallocsrc) +c_base = $(c1) $(c2) $(c3) $(c4) $(c5) $(c6) -c = $(c1) $(c2) $(c3) $(c4) $(c5) miniperlmain.c opmini.c perlmini.c +!NO!SUBS! -obj1 = $(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_core$(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) caretx$(OBJ_EXT) dquote$(OBJ_EXT) time64$(OBJ_EXT) +$spitshell >>$Makefile <>$Makefile <<'!NO!SUBS!' + +c = $(c_base) miniperlmain.c $(mini_only_src) + +obj1 = $(mallocobj) gv$(OBJ_EXT) toke$(OBJ_EXT) perly$(OBJ_EXT) pad$(OBJ_EXT) +obj2 = regcomp$(OBJ_EXT) regcomp_debug$(OBJ_EXT) regcomp_invlist$(OBJ_EXT) regcomp_study$(OBJ_EXT) regcomp_trie$(OBJ_EXT) +obj3 = regexec$(OBJ_EXT) dump$(OBJ_EXT) util$(OBJ_EXT) mg$(OBJ_EXT) reentr$(OBJ_EXT) mro_core$(OBJ_EXT) +obj4 = keywords$(OBJ_EXT) builtin$(OBJ_EXT) +obj5 = hv$(OBJ_EXT) av$(OBJ_EXT) run$(OBJ_EXT) pp_hot$(OBJ_EXT) sv$(OBJ_EXT) pp$(OBJ_EXT) +obj6 = scope$(OBJ_EXT) pp_ctl$(OBJ_EXT) pp_sys$(OBJ_EXT) peep$(OBJ_EXT) +obj7 = doop$(OBJ_EXT) doio$(OBJ_EXT) utf8$(OBJ_EXT) taint$(OBJ_EXT) +obj8 = deb$(OBJ_EXT) globals$(OBJ_EXT) perlio$(OBJ_EXT) numeric$(OBJ_EXT) mathoms$(OBJ_EXT) +obj9 = locale$(OBJ_EXT) pp_pack$(OBJ_EXT) pp_sort$(OBJ_EXT) caretx$(OBJ_EXT) dquote$(OBJ_EXT) +obj10 = time64$(OBJ_EXT) # split the objects into 3 exclusive sets: those used by both miniperl and # perl, and those used by just one or the other. Doesn't include the # actual perl(mini)main.o, nor any dtrace objects. -common_objs = $(obj1) $(obj2) $(obj3) $(ARCHOBJS) -mini_only_objs = opmini$(OBJ_EXT) perlmini$(OBJ_EXT) -main_only_objs = op$(OBJ_EXT) perl$(OBJ_EXT) +common_objs = $(obj1) $(obj2) $(obj3) $(obj4) $(obj5) $(obj6) $(obj7) $(obj8) $(obj9) $(obj10) $(ARCHOBJS) miniperl_objs_nodt = $(mini_only_objs) $(common_objs) miniperlmain$(OBJ_EXT) perllib_objs_nodt = $(main_only_objs) $(common_objs) @@ -586,7 +622,7 @@ esac $spitshell >>$Makefile <<'!NO!SUBS!' -perltoc_pod_prereqs = extra.pods pod/perl5311delta.pod pod/perlapi.pod pod/perlintern.pod pod/perlmodlib.pod pod/perluniprops.pod +perltoc_pod_prereqs = extra.pods pod/perl5379delta.pod pod/perlapi.pod pod/perlintern.pod pod/perlmodlib.pod pod/perluniprops.pod generated_pods = pod/perltoc.pod $(perltoc_pod_prereqs) generated_headers = uudmap.h bitcount.h mg_data.h @@ -626,11 +662,11 @@ lintflags = \ @echo `$(CCCMD)` $(PLDLFLAGS) $*.c @`$(CCCMD)` $(PLDLFLAGS) $*.c -.c.i: perl.h config.h +.c.i: @echo `$(CCCMDSRC)` -E $*.c \> $*.i @`$(CCCMDSRC)` -E $*.c > $*.i -.c.s: perl.h config.h +.c.s: @echo `$(CCCMDSRC)` -S $*.c @`$(CCCMDSRC)` -S $*.c @@ -692,7 +728,7 @@ FORCE: @sh -c true !NO!SUBS! -for file in op perl; do +for file in $mini_special; do if $issymlink $file.c; then $spitshell >>$Makefile <>$Makefile <<'!NO!SUBS!' +cygwin.c: cygwin/cygwin.c + $(LNS) cygwin/cygwin.c + globals$(OBJ_EXT): $(generated_headers) uudmap.h mg_data.h: bitcount.h @@ -804,31 +843,10 @@ esac case "$osname" in aix) - $spitshell >>$Makefile <>$Makefile <<'!NO!SUBS!' -LIBPERL_NONSHR = libperl_nonshr$(LIB_EXT) -MINIPERL_NONSHR = miniperl_nonshr$(EXE_EXT) - -$(LIBPERL_NONSHR): $(perllib_objs) - $(RMS) $(LIBPERL_NONSHR) - $(AR) rc $(LIBPERL_NONSHR) $(perllib_objs) - -$(MINIPERL_NONSHR): $(LIBPERL_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) - -MINIPERLEXP = $(MINIPERL_NONSHR) - LIBPERLEXPORT = perl.exp !NO!SUBS! @@ -836,7 +854,6 @@ LIBPERLEXPORT = perl.exp ;; *) $spitshell >>$Makefile <<'!NO!SUBS!' -MINIPERLEXP = $(MINIPERL_EXE) PERLEXPORT = perl.exp @@ -844,7 +861,7 @@ PERLEXPORT = perl.exp ;; esac $spitshell >>$Makefile <<'!NO!SUBS!' -perl.exp: $(MINIPERLEXP) makedef.pl $(CONFIGPM) $(SYM) $(SYMH) +perl.exp: $(MINIPERL_EXE) makedef.pl $(CONFIGPM) $(SYM) $(SYMH) $(MINIPERL) makedef.pl --sort-fold PLATFORM=aix CC_FLAGS="$(OPTIMIZE)" > perl.exp !NO!SUBS! @@ -858,19 +875,6 @@ perl5.def: $(MINIPERLEXP) makedef.pl $(CONFIGPM) $(SYM) $(SYMH) miniperl.map !NO!SUBS! ;; -cygwin) - $spitshell >>$Makefile <<'!NO!SUBS!' -cygwin.c: cygwin/cygwin.c - $(LNS) cygwin/cygwin.c - -LIBPERL_NONSHR = libperl$(LIB_EXT) - -$(LIBPERL_NONSHR): $(perllib_objs) - $(RMS) $(LIBPERL_NONSHR) - $(AR) rc $(LIBPERL_NONSHR) $(perllib_objs) - -!NO!SUBS! - ;; esac if test -s $Makefile_s ; then @@ -969,6 +973,7 @@ $(LIBPERL): $& $(perllib_dep) $(DYNALOADER) $(LIBPERLEXPORT) # b) have the rest of the Makefile depend on the more obvious $(MINIPERL_EXE) $(MINIPERL_EXE): lib/buildcustomize.pl + @touch $(MINIPERL_EXE) !NO!SUBS! @@ -983,22 +988,6 @@ lib/buildcustomize.pl: $& $(miniperl_objs) write_buildcustomize.pl $(MINIPERL) -f write_buildcustomize.pl !NO!SUBS! ;; - aix*) - $spitshell >>$Makefile <<'!NO!SUBS!' -lib/buildcustomize.pl: $& $(miniperl_objs) - $(CC) -o $(MINIPERL_EXE) $(CLDFLAGS) $(miniperl_objs) $(libs) - $(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1' - $(MINIPERL) -f write_buildcustomize.pl -!NO!SUBS! - ;; - next4*) - $spitshell >>$Makefile <<'!NO!SUBS!' -lib/buildcustomize.pl: $& $(miniperl_objs) write ldcustomize.pl - $(CC) -o $(MINIPERL_EXE) $(miniperl_objs libs) - $(LDLIBPTH) ./miniperl$(HOST _EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1' - $(MINIPERL) -f write_buildcustomize.pl -!NO!SUBS! - ;; darwin*) case "$osvers" in [1-6].*) ;; @@ -1050,7 +1039,7 @@ $(PERL_EXE): $& $(perlmain_dep) $(LIBPERL) $(static_ext) ext.libs $(PERLEXPORT) -@rm -f miniperl.xok !NO!SUBS! - case $osname in + case "$osname" in # In AmigaOS the Perl executable needs to be linked with -ldl, # but none of the other executables should be. amigaos) $spitshell >>$Makefile <<'!NO!SUBS!' @@ -1102,7 +1091,7 @@ catamount) $spitshell >>$Makefile <>$Makefile <<'!NO!SUBS!' depend: makedepend $(DTRACE_H) $(generated_headers) sh ./makedepend MAKE="$(MAKE)" cflags +.c.c.depends: + sh ./makedepend_file $< $@ cflags + .PHONY: test check test_prep test_prep_nodll test_prep_pre \ test_prep_reonly test_tty test-tty test_notty test-notty \ test_harness test_harness_notty minitest test-reonly _test @@ -1648,21 +1642,21 @@ $spitshell >>$Makefile <<'!NO!SUBS!' # minitest can't depend on lib/Config.pm because that might be where miniperl # is crashing. -minitest_prep: +minitest_prep: $(MINIPERL_EXE) -@test -f lib/Config.pm || $(MAKE) lib/Config.pm $(unidatafiles) @echo " " @echo "You may see some irrelevant test failures if you have been unable" @echo "to build lib/Config.pm, or the Unicode data files." @echo " " - - cd t && (rm -f $(PERL_EXE); $(LNS) ../$(MINIPERL_EXE) $(PERL_EXE)) + cd t && (rm -f $(PERL_EXE); $(LNS) ../$(MINIPERL_EXE) $(PERL_EXE)) MINITEST_TESTS = base/*.t comp/*.t cmd/*.t run/*.t io/*.t re/*.t opbasic/*.t op/*.t uni/*.t perf/*.t -minitest: $(MINIPERL_EXE) minitest_prep - - cd t && $(RUN_PERL) TEST $(MINITEST_TESTS) <$(devtty) +minitest: minitest_prep + cd t && $(RUN_PERL) TEST $(MINITEST_TESTS) <$(devtty) -minitest-notty minitest_notty: $(MINIPERL_EXE) minitest_prep - - cd t && PERL_SKIP_TTY_TEST=1 $(RUN_PERL) TEST $(MINITEST_TESTS) +minitest-notty minitest_notty: minitest_prep + cd t && PERL_SKIP_TTY_TEST=1 $(RUN_PERL) TEST $(MINITEST_TESTS) # Test via harness @@ -1673,13 +1667,13 @@ test_harness_notty: test_prep HARNESS_NOTTY=1 TESTFILE=harness $(RUN_TESTS) choose test_reonly test-reonly: test_prep_reonly - TEST_ARGS='-re \bre\/' TESTFILE=harness $(RUN_TESTS) choose + TEST_ARGS='re/*.t ../ext/re/t/*.t' PERL_TEST_HARNESS_ASAP=1 TESTFILE=harness $(RUN_TESTS) choose # Porting tests (well-formedness of pod, manifest, etc) test_porting test-porting: test_prep - cd t && $(RUN_PERL) harness porting/*.t ../lib/diagnostics.t + TEST_ARGS='porting/*.t lib/diagnostics.t' TESTFILE=harness $(RUN_TESTS) choose !NO!SUBS! @@ -1737,15 +1731,18 @@ distcheck: FORCE .PHONY: ctags -TAGS: $(c1) $(c2) $(c3) $(c4) $(c5) $(h) - etags $(c1) $(c2) $(c3) $(c4) $(c5) $(h) +TAGS: $(c_base) $(h) + etags $(c_base) $(h) +!NO!SUBS! + +$spitshell >>$Makefile <