From: Jarkko Hietaniemi Date: Sat, 15 Sep 2007 20:47:57 +0000 (-0400) Subject: Re: [PATCH] Cray XT4/Catamount build X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6d4b7d88eed49936ae16ecf02d5eb5b2cc716ea1;p=p5sagit%2Fp5-mst-13.2.git Re: [PATCH] Cray XT4/Catamount build Message-ID: <46EC7D3D.5010604@iki.fi> p4raw-id: //depot/perl@31878 --- diff --git a/MANIFEST b/MANIFEST index 1d2a90b..172d580 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3933,7 +3933,7 @@ utils/h2xs.PL Program to make .xs files from C header files utils/instmodsh.PL Give information about installed extensions utils/libnetcfg.PL libnet utils.lst Lists utilities bundled with Perl -utils/Makefile Extract the utility scripts +utils/Makefile.SH Extract the utility scripts utils/perlbug.PL A simple tool to submit a bug report utils/perldoc.PL A simple tool to find & display perl's documentation utils/perlivp.PL installation verification procedure diff --git a/Makefile.SH b/Makefile.SH index cbe1127..208160d 100644 --- a/Makefile.SH +++ b/Makefile.SH @@ -798,6 +798,29 @@ suidperl$(EXE_EXT): $& sperl$(OBJ_EXT) perlmain$(OBJ_EXT) $(LIBPERL) $(static_ex fi +# Some environment have no system(), which mkpport uses. +# Let's try running the commands with shell. +case "${osname}" in +catamount) +$spitshell >>Makefile <>Makefile <<'!NO!SUBS!' +.PHONY: makeppport +makeppport: miniperl$(EXE_EXT) $(CONFIGPM) + $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib mkppport + +!NO!SUBS! +;; +esac + $spitshell >>Makefile <<'!NO!SUBS!' sperl$(OBJ_EXT): perl.c $(h) @@ -820,10 +843,6 @@ preplibrary: miniperl$(EXE_EXT) $(CONFIGPM) lib/lib.pm $(PREPLIBRARY_LIBPERL) autosplit_lib_modules(@ARGV)' lib/*/*.pm $(MAKE) lib/re.pm -.PHONY: makeppport -makeppport: miniperl$(EXE_EXT) $(CONFIGPM) - $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib mkppport - lib/Config.pod: config.sh miniperl$(EXE_EXT) configpm Porting/Glossary $(LDLIBPTH) $(RUN) ./miniperl -Ilib configpm @@ -867,13 +886,13 @@ extra.pods: miniperl$(EXE_EXT) -@test -f pod/perl595delta.pod && cd pod && $(LNS) perl595delta.pod perldelta.pod && cd .. && echo "pod/perldelta.pod" >> extra.pods # See buildtoc extras.make: perl$(EXE_EXT) - -@test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(LDLIBPTH) ./perl -Ilib -MCPAN -e '@ARGV&&make(@ARGV)' `cat extras.lst` + -@test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(LDLIBPTH) $(RUN) ./perl -Ilib -MCPAN -e '@ARGV&&make(@ARGV)' `cat extras.lst` extras.test: perl$(EXE_EXT) - -@test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(LDLIBPTH) ./perl -Ilib -MCPAN -e '@ARGV&&test(@ARGV)' `cat extras.lst` + -@test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(LDLIBPTH) $(RUN) ./perl -Ilib -MCPAN -e '@ARGV&&test(@ARGV)' `cat extras.lst` extras.install: perl$(EXE_EXT) - -@test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(LDLIBPTH) ./perl -Ilib -MCPAN -e '@ARGV&&install(@ARGV)' `cat extras.lst` + -@test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(LDLIBPTH) $(RUN) ./perl -Ilib -MCPAN -e '@ARGV&&install(@ARGV)' `cat extras.lst` .PHONY: install install-strip install-all install-verbose install-silent \ no-install install.perl install.man install.html @@ -900,17 +919,17 @@ no-install: INSTALL_DEPENDENCE = all install.perl: $(INSTALL_DEPENDENCE) installperl - $(LDLIBPTH) ./perl installperl --destdir=$(DESTDIR) $(INSTALLFLAGS) $(STRIPFLAGS) + $(LDLIBPTH) $(RUN) ./perl installperl --destdir=$(DESTDIR) $(INSTALLFLAGS) $(STRIPFLAGS) -@test ! -s extras.lst || $(MAKE) extras.install install.man: all installman - $(LDLIBPTH) ./perl installman --destdir=$(DESTDIR) $(INSTALLFLAGS) + $(LDLIBPTH) $(RUN) ./perl installman --destdir=$(DESTDIR) $(INSTALLFLAGS) # XXX Experimental. Hardwired values, but useful for testing. # Eventually Configure could ask for some of these values. install.html: all installhtml -@test -f README.vms && cd vms && $(LNS) ../README.vms README_vms.pod && cd .. - $(LDLIBPTH) ./perl installhtml \ + $(LDLIBPTH) $(RUN) ./perl installhtml \ --podroot=. --podpath=. --recurse \ --htmldir=$(privlib)/html \ --htmlroot=$(privlib)/html \ @@ -1024,7 +1043,7 @@ $spitshell >>Makefile <<'!NO!SUBS!' .PHONY: printconfig printconfig: - @eval `$(LDLIBPTH) ./perl -Ilib -V:$(CONFIGVAR)`; echo $$$(CONFIGVAR) + @eval `$(LDLIBPTH) $(RUN) ./perl -Ilib -V:$(CONFIGVAR)`; echo $$$(CONFIGVAR) .PHONY: clean _tidy _mopup _cleaner1 _cleaner2 \ realclean _realcleaner clobber _clobber \ @@ -1230,7 +1249,7 @@ test.torture torturetest: test_prep minitest.utf16: minitest.prep - cd t && (rm -f perl$(EXE_EXT); $(LNS) ../miniperl$(EXE_EXT) perl$(EXE_EXT)) \ - && $(LDLIBPTH) ./perl TEST -minitest -utf16 base/*.t comp/*.t cmd/*.t run/*.t io/*.t op/*.t uni/*.t &4 <<__EOF1__ __EOF1__ archname='x86_64-catamount' -archobjs='cata.o' +archobjs='catalib.o' d_mmap='undef' d_setlocale='undef' # There is setlocale() but no locales. d_vprintf='define' @@ -59,10 +89,11 @@ incpth=' ' installusrbinperl='undef' libswanted="m crypt c" libpth=' ' -locincpth='' -onlyextensions='Fcntl' # Not that we can build this, really. +locincpth=' ' +nonxs_ext=' ' osname='catamount' procselfexe='undef' +static_ext=' ' usedl='undef' useithreads='undef' uselargefiles='define' @@ -107,7 +138,7 @@ cat > $cc <<__EOF3a__ # This is essentially a frontend driver for the Catamount cc. # We arrange for (1) the main(), exit(), _exit() being wrapped (cpp-defined) # catamain(), cataexit(), and _cataexit() (2) the actual main() etc. are in -# cata.c, and cata.o is linked in when needed (3) signals being caught +# cata.c, and cata*.o are linked in when needed (3) signals being caught # All this mostly for being able to catch the exit status (or crash cause). # argv='' @@ -121,17 +152,19 @@ __EOF3a__ cat >> $cc <<'__EOF3b__' case "$1" in --cata_o) ;; -*) if test ! -f cata.o +*) if test ! -f catalib.o then - if test ! -f cata.c + if test ! -f catalib.c then - if test -f ../cata.c # If compiling in UU during Configure. + if test -f ../catalib.c # If compiling in UU during Configure. then - cp ../cata.c cata.c + cp ../catalib.c catalib.c + cp ../catamain.c catamain.c cp ../cata.h cata.h fi fi - $0 --cata_o -c cata.c || exit 1 + $0 --cata_o -c catalib.c || exit 1 + $0 --cata_o -c catamain.c || exit 1 fi ;; esac @@ -200,8 +233,12 @@ done case "$exe" in '') ;; *) case "$argv" in - *cata.o*) ;; - *) argv="$argv cata.o" ;; + *catalib.o*|*" perlmain.o "*) ;; + *) argv="$argv catalib.o" ;; + esac + case "$argv" in + *catamain.o*) ;; + *) argv="$argv catamain.o" ;; esac ;; esac @@ -244,9 +281,14 @@ int main(int argc, char **argv, char **env); #endif #endif #endif +#ifdef argv0 +#define ARGV0 STRINGIFY(argv0) +#else +#define ARGV0 argv0 +#endif __EOF6__ -cat >cata.c<<__EOF7__ +cat >catalib.c<<__EOF7__ #include #include #undef printf @@ -254,15 +296,7 @@ cat >cata.c<<__EOF7__ #undef exit #undef _exit #include "cata.h" -#ifndef STRINGIFY -#define STRINGIFY(a) #a -#endif -#ifdef argv0 -#define ARGV0 STRINGIFY(argv0) -#else -static char* argv0; -#define ARGV0 argv0 -#endif +char* argv0; void cataexit(int status) { printf("cata: exe %s pid %d exit %d\n", ARGV0, getpid(), status); exit(status); @@ -324,6 +358,16 @@ void catasigsetup() { signal(SIGPWR, catasighandle); signal(SIGSYS, catasighandle); } +void boot_DynaLoader (void* cv) { } +__EOF7__ +cat >catamain.c<<__EOF8__ +#include +#undef printf +#undef main +#undef exit +#undef _exit +#include "cata.h" +extern char* argv0; int main(int argc, char *argv[], char *envv[]) { int status; #ifndef argv0 @@ -343,7 +387,7 @@ int main(int argc, char *argv[], char *envv[]) { printf("cata: exe %s pid %d main %d\n", ARGV0, getpid(), status); return status; } -__EOF7__ +__EOF8__ echo "Faking DynaLoader" touch DynaLoader.o # Oh, the agony. diff --git a/utils/Makefile b/utils/Makefile deleted file mode 100644 index 3a96c9e..0000000 --- a/utils/Makefile +++ /dev/null @@ -1,76 +0,0 @@ - -PERL = ../miniperl -REALPERL = ../perl - -# Files to be built with variable substitution after miniperl is -# available. Dependencies handled manually below (for now). - -pl = c2ph.PL config_data.PL corelist.PL cpan.PL h2ph.PL h2xs.PL instmodsh.PL perlbug.PL perldoc.PL perlivp.PL pl2pm.PL prove.PL ptar.PL ptardiff.PL cpanp-run-perl.PL cpanp.PL cpan2dist.PL shasum.PL splain.PL dprofpp.PL libnetcfg.PL piconv.PL enc2xs.PL xsubpp.PL -plextract = c2ph config_data corelist cpan h2ph h2xs instmodsh perlbug perldoc perlivp pl2pm prove ptar ptardiff cpanp-run-perl cpanp cpan2dist shasum splain dprofpp libnetcfg piconv enc2xs xsubpp -plextractexe = ./c2ph ./config_data ./corelist ./cpan ./h2ph ./h2xs ./instmodsh ./perlbug ./perldoc ./perlivp ./pl2pm ./prove ./ptar ./ptardiff ./cpanp-run-perl ./cpanp ./cpan2dist ./shasum ./splain ./dprofpp ./libnetcfg ./piconv ./enc2xs ./xsubpp - -all: $(plextract) - -$(plextract): - $(PERL) -I../lib $@.PL - -c2ph: c2ph.PL ../config.sh - -cpan: cpan.PL ../config.sh - -config_data: config_data.PL ../config.sh - -corelist: corelist.PL ../config.sh - -h2ph: h2ph.PL ../config.sh - -h2xs: h2xs.PL ../config.sh - -instmodsh: instmodsh.PL ../config.sh - -perlbug: perlbug.PL ../config.sh ../patchlevel.h - -perldoc: perldoc.PL ../config.sh - -perlivp: perlivp.PL ../config.sh - -prove: prove.PL ../config.sh - -ptar: ptar.PL ../config.sh - -ptardiff: ptardiff.PL ../config.sh - -cpanp-run-perl: cpanp-run-perl.PL ../config.sh - -cpanp: cpanp.PL ../config.sh - -cpan2dist: cpan2dist.PL ../config.sh - -pl2pm: pl2pm.PL ../config.sh - -shasum: shasum.PL ../config.sh - -splain: splain.PL ../config.sh ../lib/diagnostics.pm - -dprofpp: dprofpp.PL ../config.sh - -libnetcfg: libnetcfg.PL ../config.sh - -piconv: piconv.PL ../config.sh - -enc2xs: enc2xs.PL ../config.sh - -xsubpp: xsubpp.PL ../config.sh - -clean: - -realclean: - rm -rf $(plextract) pstruct $(plextractexe) - rm -f ../t/_h2ph_pre.ph - -clobber: realclean - -distclean: clobber - -veryclean: distclean - -rm -f *~ *.org diff --git a/utils/Makefile.SH b/utils/Makefile.SH new file mode 100644 index 0000000..42a274c --- /dev/null +++ b/utils/Makefile.SH @@ -0,0 +1,119 @@ +case $PERL_CONFIG_SH in +'') + if test -f config.sh; then TOP=.; + elif test -f ../config.sh; then TOP=..; + elif test -f ../../config.sh; then TOP=../..; + elif test -f ../../../config.sh; then TOP=../../..; + elif test -f ../../../../config.sh; then TOP=../../../..; + else + echo "Can't find config.sh."; exit 1 + fi + . $TOP/config.sh + ;; +esac +: 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 +*/Makefile.SH) cd `expr X$0 : 'X\(.*\)/'` ;; +Makefile.SH) ;; +*) case `pwd` in + */utils) ;; + *) if test -d utils; then cd utils + else echo "Can't figure out where to write output."; exit 1 + fi;; + esac;; +esac + +echo "Extracting utils/Makefile (with variable substitutions)" +rm -f Makefile +cat >Makefile <>Makefile <<'!NO!SUBS!' + +# Files to be built with variable substitution after miniperl is +# available. Dependencies handled manually below (for now). + +pl = c2ph.PL config_data.PL corelist.PL cpan.PL h2ph.PL h2xs.PL instmodsh.PL perlbug.PL perldoc.PL perlivp.PL pl2pm.PL prove.PL ptar.PL ptardiff.PL cpanp-run-perl.PL cpanp.PL cpan2dist.PL shasum.PL splain.PL dprofpp.PL libnetcfg.PL piconv.PL enc2xs.PL xsubpp.PL +plextract = c2ph config_data corelist cpan h2ph h2xs instmodsh perlbug perldoc perlivp pl2pm prove ptar ptardiff cpanp-run-perl cpanp cpan2dist shasum splain dprofpp libnetcfg piconv enc2xs xsubpp +plextractexe = ./c2ph ./config_data ./corelist ./cpan ./h2ph ./h2xs ./instmodsh ./perlbug ./perldoc ./perlivp ./pl2pm ./prove ./ptar ./ptardiff ./cpanp-run-perl ./cpanp ./cpan2dist ./shasum ./splain ./dprofpp ./libnetcfg ./piconv ./enc2xs ./xsubpp + +all: $(plextract) + +$(plextract): + $(RUN) $(PERL) -I../lib $@.PL + +c2ph: c2ph.PL ../config.sh + +cpan: cpan.PL ../config.sh + +config_data: config_data.PL ../config.sh + +corelist: corelist.PL ../config.sh + +h2ph: h2ph.PL ../config.sh + +h2xs: h2xs.PL ../config.sh + +instmodsh: instmodsh.PL ../config.sh + +perlbug: perlbug.PL ../config.sh ../patchlevel.h + +perldoc: perldoc.PL ../config.sh + +perlivp: perlivp.PL ../config.sh + +prove: prove.PL ../config.sh + +ptar: ptar.PL ../config.sh + +ptardiff: ptardiff.PL ../config.sh + +cpanp-run-perl: cpanp-run-perl.PL ../config.sh + +cpanp: cpanp.PL ../config.sh + +cpan2dist: cpan2dist.PL ../config.sh + +pl2pm: pl2pm.PL ../config.sh + +shasum: shasum.PL ../config.sh + +splain: splain.PL ../config.sh ../lib/diagnostics.pm + +dprofpp: dprofpp.PL ../config.sh + +libnetcfg: libnetcfg.PL ../config.sh + +piconv: piconv.PL ../config.sh + +enc2xs: enc2xs.PL ../config.sh + +xsubpp: xsubpp.PL ../config.sh + +clean: + +realclean: + rm -rf $(plextract) pstruct $(plextractexe) + rm -f ../t/_h2ph_pre.ph + +clobber: realclean + +distclean: clobber + +veryclean: distclean + -rm -f *~ *.org +!NO!SUBS! +$eunicefix Makefile +case `pwd` in +*SH) + $rm -f ../Makefile + $ln Makefile ../Makefile + ;; +esac +rm -f $firstmakefile diff --git a/x2p/Makefile.SH b/x2p/Makefile.SH index 921e1b0..b4c3058 100755 --- a/x2p/Makefile.SH +++ b/x2p/Makefile.SH @@ -62,6 +62,8 @@ OPTIMIZE = $optimize .SUFFIXES: .c \$(OBJ_EXT) +RUN = $run + !GROK!THIS! cat >>Makefile <<'!NO!SUBS!' @@ -169,7 +171,7 @@ shlist: # These should be automatically generated $(plextract): - ../miniperl -I../lib $@.PL + $(RUN) ../miniperl -I../lib $@.PL find2perl: find2perl.PL