diff -Paur --no-dereference -- perl.upstream/Makefile perl/Makefile --- perl.upstream/Makefile +++ perl/Makefile @@ -67,7 +67,7 @@ # Original versions are not saved anymore; patch generally takes care of this, # and if that fails, reaching for the source tarball is the safest option. $(CROSSPATCHED): %.applied: %.patch - $(cpatch) -p1 -i $< && touch $@ + $(cpatch) -p1 -i $< && echo > $@ # ---[ common ]----------------------------------------------------------------- @@ -257,6 +257,7 @@ dist/lib/Makefile: dist/lib/Makefile.PL cflags config.h $(CONFIGPM) | miniperl$X $(eval top=$(shell echo $(dir $@) | sed -re 's![^/]+!..!g')) cd $(dir $@) && $(top)miniperl_top -I$(top)lib Makefile.PL \ + LINKTYPE=static \ PERL_CORE=1 LIBPERL_A=$(LIBPERL) PERL="$(top)miniperl_top" preplibrary = miniperl$X lib/re.pm lib/lib.pm @@ -265,6 +266,7 @@ $(eval top=$(shell echo $(dir $@) | sed -re 's![^/]+!..!g')) cd $(dir $@) && $(top)miniperl_top -I$(top)lib Makefile.PL \ INSTALLDIRS=perl INSTALLMAN1DIR=none INSTALLMAN3DIR=none \ + LINKTYPE=static \ PERL_CORE=1 LIBPERL_A=$(LIBPERL) PERL="$(top)miniperl_top" # Allow building modules by typing "make cpan/Module-Name" @@ -325,7 +327,7 @@ cpan/ExtUtils-ParseXS/Makefile cpan/ExtUtils-Constant/Makefile: \ %/Makefile: %/Makefile.PL cflags $(CONFIGPM) | $(preplibrary) $(eval top=$(shell echo $(dir $@) | sed -re 's![^/]+!..!g')) - cd $(dir $@) && $(top)miniperl_top Makefile.PL PERL_CORE=1 PERL=$(top)miniperl_top + cd $(dir $@) && $(top)miniperl_top Makefile.PL LINKTYPE=static PERL_CORE=1 PERL=$(top)miniperl_top cpan/List-Util/pm_to_blib: | ext/DynaLoader/pm_to_blib @@ -440,7 +442,10 @@ install.sym: # deprecated -install.man: installman pod/perltoc.pod | miniperl$X +# PATCH: Sever makefile dependency that tends to livelock make with 100% CPU +# usage after doing the static modules when building -j2 or more. +# pod/perltoc.pod and miniperl are already built by the main all target. +install.man: installman # pod/perltoc.pod | miniperl$X ./miniperl_top installman --destdir=$(DESTDIR) $(INSTALLFLAGS) # ---[ testpack ]--------------------------------------------------------------- @@ -453,9 +458,10 @@ tar -zcvf $@ -T $< # ---[ clean ]------------------------------------------------------------------ +# PATCH: make doesn't work this way when make -j. # clean-modules must go BEFORE clean-generated-files because it depends on config.h! .PHONY: clean clean-obj clean-generated-files clean-subdirs clean-modules clean-testpack -clean: clean-obj clean-modules clean-generated-files clean-subdirs clean-testpack +clean: clean-obj clean-modules clean-subdirs clean-testpack clean-obj: -test -n "$o" && rm -f *$o @@ -486,3 +492,313 @@ clean-testpack: -rm -fr TESTPACK -rm -f TESTPACK.list + +# PATCH: perl is terrible at cleaning up properly. +distclean: clean + $(MAKE) clean-generated-files # clean-modules needs config.h... + rm -f *.host.o + rm -f cflags + rm -f config.log + find cpan dist ext -name Makefile -delete + find cpan dist ext -name Makefile.old -delete + find cpan dist ext -name '*.fnm' -delete + rm -rf `grep -lr 'It will be deleted automatically by make realclean' cpan dist ext` + rm -rf `grep -lr 'This file is auto-generated by mkheader.' cpan dist | grep -E '\.h'` + rm -rf cpan/Compress-Raw-Bzip2/*.[ch] + rm -rf cpan/Compress-Raw-Zlib/*.[ch] + rm -f cpan/Compress-Raw-Bzip2/constants.xs + rm -f cpan/Compress-Raw-Zlib/constants.xs + rm -f cpan/Encode/Byte/Byte.xs + rm -f cpan/Encode/CN/CN.xs + rm -f cpan/Encode/EBCDIC/EBCDIC.xs + rm -f cpan/Encode/JP/JP.xs + rm -f cpan/Encode/KR/KR.xs + rm -f cpan/Encode/Symbol/Symbol.xs + rm -f cpan/Encode/TW/TW.xs + rm -f cpan/Pod-Checker/podchecker + rm -f cpan/Pod-Checker/podchecker.PL + rm -f cpan/podlators/scripts/pod2man + rm -f cpan/podlators/scripts/pod2text + rm -f cpan/Pod-Usage/pod2usage + rm -f cpan/Pod-Usage/pod2usage.PL + rm -f cpan/Socket/const-c.inc + rm -f cpan/Socket/const-xs.inc + rm -f cpan/Sys-Syslog/const-c.inc + rm -f cpan/Sys-Syslog/const-xs.inc + rm -rf cpan/Sys-Syslog/lib + rm -f cpan/Sys-Syslog/macros.all + rm -f dist/lib/lib.pm + rm -f dist/Time-HiRes/const-c.inc + rm -f dist/Time-HiRes/const-xs.inc + rm -f dist/Time-HiRes/xdefine + rm -f dist/Devel-PPPort/RealPPPort.xs + rm -f ext/B/const-c.inc + rm -f ext/B/const-xs.inc + rm -f ext/Errno/arch.txt + rm -f ext/Errno/Errno.pm + rm -f ext/Fcntl/const-c.inc + rm -f ext/Fcntl/const-xs.inc + rm -f ext/File-Glob/const-c.inc + rm -f ext/File-Glob/const-xs.inc + rm -f ext/I18N-Langinfo/const-c.inc + rm -f ext/I18N-Langinfo/const-xs.inc + rm -f ext/Pod-Functions/Functions.pm + rm -f ext/POSIX/const-c.inc + rm -f ext/POSIX/const-xs.inc + rm -f ext/re/dquote.c + rm -f ext/re/invlist_inline.h + rm -f ext/re/re_comp.c + rm -f ext/re/re_exec.c + rm -f ext/XS-APItest/const-c.inc + rm -f ext/XS-APItest/const-xs.inc + rm -f extra.pods + rm -f lib/.exists + rm -rf lib/App + rm -rf lib/Archive + rm -rf lib/Attribute + rm -f lib/AutoLoader.pm + rm -f lib/AutoSplit.pm + rm -f lib/B.pm + rm -f lib/B/Concise.pm + rm -f lib/B/Showlex.pm + rm -f lib/B/Terse.pm + rm -f lib/B/Xref.pm + rm -rf lib/CPAN + rm -f lib/CPAN.pm + rm -rf lib/Carp + rm -f lib/Carp.pm + rm -rf lib/Compress + rm -f lib/Config.pm + rm -f lib/Config.pod + rm -rf lib/Config/Perl + rm -f lib/Config_git.pl + rm -f lib/Config_heavy.pl + rm -f lib/Cwd.pm + rm -rf lib/Data + rm -rf lib/Devel + rm -rf lib/Digest + rm -f lib/Digest.pm + rm -f lib/Dumpvalue.pm + rm -f lib/DynaLoader.pm + rm -rf lib/Encode + rm -f lib/Encode.pm + rm -f lib/Env.pm + rm -f lib/Errno.pm + rm -rf lib/Exporter + rm -f lib/Exporter.pm + rm -f lib/ExtUtils/.exists + rm -rf lib/ExtUtils/CBuilder + rm -f lib/ExtUtils/CBuilder.pm + rm -rf lib/ExtUtils/Command + rm -f lib/ExtUtils/Command.pm + rm -rf lib/ExtUtils/Constant + rm -f lib/ExtUtils/Constant.pm + rm -f lib/ExtUtils/Install.pm + rm -f lib/ExtUtils/Installed.pm + rm -rf lib/ExtUtils/Liblist + rm -f lib/ExtUtils/Liblist.pm + rm -f lib/ExtUtils/MANIFEST.SKIP + rm -f lib/ExtUtils/MM.pm + rm -f lib/ExtUtils/MM_AIX.pm + rm -f lib/ExtUtils/MM_Any.pm + rm -f lib/ExtUtils/MM_BeOS.pm + rm -f lib/ExtUtils/MM_Cygwin.pm + rm -f lib/ExtUtils/MM_DOS.pm + rm -f lib/ExtUtils/MM_Darwin.pm + rm -f lib/ExtUtils/MM_MacOS.pm + rm -f lib/ExtUtils/MM_NW5.pm + rm -f lib/ExtUtils/MM_OS2.pm + rm -f lib/ExtUtils/MM_QNX.pm + rm -f lib/ExtUtils/MM_UWIN.pm + rm -f lib/ExtUtils/MM_Unix.pm + rm -f lib/ExtUtils/MM_VMS.pm + rm -f lib/ExtUtils/MM_VOS.pm + rm -f lib/ExtUtils/MM_Win32.pm + rm -f lib/ExtUtils/MM_Win95.pm + rm -f lib/ExtUtils/MY.pm + rm -rf lib/ExtUtils/MakeMaker + rm -f lib/ExtUtils/MakeMaker.pm + rm -f lib/ExtUtils/Manifest.pm + rm -f lib/ExtUtils/Miniperl.pm + rm -f lib/ExtUtils/Mkbootstrap.pm + rm -f lib/ExtUtils/Mksymlists.pm + rm -f lib/ExtUtils/Packlist.pm + rm -rf lib/ExtUtils/ParseXS + rm -f lib/ExtUtils/ParseXS.pm + rm -f lib/ExtUtils/ParseXS.pod + rm -rf lib/ExtUtils/Typemaps + rm -f lib/ExtUtils/Typemaps.pm + rm -f lib/ExtUtils/testlib.pm + rm -f lib/ExtUtils/xsubpp + rm -f lib/Fatal.pm + rm -f lib/Fcntl.pm + rm -f lib/File/.exists + rm -f lib/File/DosGlob.pm + rm -f lib/File/Fetch.pm + rm -f lib/File/Find.pm + rm -f lib/File/Glob.pm + rm -f lib/File/GlobMapper.pm + rm -f lib/File/Path.pm + rm -rf lib/File/Spec + rm -f lib/File/Spec.pm + rm -f lib/File/Temp.pm + rm -f lib/FileCache.pm + rm -rf lib/Filter + rm -f lib/FindBin.pm + rm -f lib/Getopt/.exists + rm -f lib/Getopt/Long.pm + rm -rf lib/HTTP + rm -rf lib/Hash + rm -rf lib/I18N + rm -rf lib/IO + rm -f lib/IO.pm + rm -rf lib/IPC + rm -rf lib/JSON + rm -rf lib/List + rm -rf lib/Locale + rm -rf lib/MIME + rm -rf lib/Math + rm -rf lib/Memoize + rm -f lib/Memoize.pm + rm -rf lib/Module + rm -f lib/NEXT.pm + rm -f lib/Net/.exists + rm -f lib/Net/Cmd.pm + rm -f lib/Net/Config.pm + rm -f lib/Net/Domain.pm + rm -rf lib/Net/FTP + rm -f lib/Net/FTP.pm + rm -f lib/Net/NNTP.pm + rm -f lib/Net/Netrc.pm + rm -f lib/Net/POP3.pm + rm -f lib/Net/Ping.pm + rm -f lib/Net/SMTP.pm + rm -f lib/Net/Time.pm + rm -f lib/Net/libnetFAQ.pod + rm -f lib/O.pm + rm -f lib/Opcode.pm + rm -f lib/POSIX.pm + rm -f lib/POSIX.pod + rm -rf lib/Params + rm -rf lib/Parse + rm -rf lib/Perl + rm -rf lib/PerlIO + rm -f lib/Pod/.exists + rm -f lib/Pod/Checker.pm + rm -f lib/Pod/Escapes.pm + rm -f lib/Pod/Functions.pm + rm -f lib/Pod/Html.pm + rm -f lib/Pod/Man.pm + rm -f lib/Pod/ParseLink.pm + rm -rf lib/Pod/Perldoc + rm -f lib/Pod/Perldoc.pm + rm -rf lib/Pod/Simple + rm -f lib/Pod/Simple.pm + rm -f lib/Pod/Simple.pod + rm -rf lib/Pod/Text + rm -f lib/Pod/Text.pm + rm -f lib/Pod/Usage.pm + rm -f lib/SDBM_File.pm + rm -f lib/Safe.pm + rm -rf lib/Scalar + rm -rf lib/Search + rm -f lib/SelfLoader.pm + rm -f lib/Socket.pm + rm -f lib/Storable.pm + rm -rf lib/Sub + rm -rf lib/Sys + rm -rf lib/TAP + rm -rf lib/Term + rm -rf lib/Test + rm -f lib/Test.pm + rm -rf lib/Test2 + rm -f lib/Test2.pm + rm -rf lib/Text + rm -rf lib/Thread + rm -f lib/Tie/.exists + rm -f lib/Tie/File.pm + rm -rf lib/Tie/Hash + rm -f lib/Tie/Memoize.pm + rm -f lib/Tie/RefHash.pm + rm -f lib/Time/.exists + rm -f lib/Time/HiRes.pm + rm -f lib/Time/Local.pm + rm -f lib/Time/Piece.pm + rm -f lib/Time/Seconds.pm + rm -f lib/Unicode/.exists + rm -rf lib/Unicode/Collate + rm -f lib/Unicode/Collate.pm + rm -f lib/Unicode/Normalize.pm + rm -rf lib/XS + rm -f lib/XSLoader.pm + rm -f lib/attributes.pm + rm -rf lib/auto + rm -rf lib/autodie + rm -f lib/autodie.pm + rm -f lib/autouse.pm + rm -f lib/base.pm + rm -f lib/bigint.pm + rm -f lib/bignum.pm + rm -f lib/bigrat.pm + rm -f lib/constant.pm + rm -rf lib/encoding + rm -f lib/encoding.pm + rm -f lib/experimental.pm + rm -f lib/fields.pm + rm -f lib/if.pm + rm -f lib/lib.pm + rm -f lib/mro.pm + rm -f lib/ok.pm + rm -f lib/ops.pm + rm -f lib/parent.pm + rm -f lib/perldoc.pod + rm -f lib/perlfaq.pm + rm -f lib/perlfaq.pod + rm -f lib/perlfaq1.pod + rm -f lib/perlfaq2.pod + rm -f lib/perlfaq3.pod + rm -f lib/perlfaq4.pod + rm -f lib/perlfaq5.pod + rm -f lib/perlfaq6.pod + rm -f lib/perlfaq7.pod + rm -f lib/perlfaq8.pod + rm -f lib/perlfaq9.pod + rm -f lib/perlglossary.pod + rm -f lib/perlxs.pod + rm -f lib/perlxstut.pod + rm -f lib/perlxstypemap.pod + rm -rf lib/threads + rm -f lib/threads.pm + rm -f lib/unicore/CombiningClass.pl + rm -f lib/unicore/Decomposition.pl + rm -f lib/unicore/Name.pl + rm -f lib/unicore/Name.pm + rm -f lib/unicore/TestProp.pl + rm -rf lib/unicore/To + rm -f lib/unicore/UCD.pl + rm -rf lib/unicore/lib + rm -f lib/unicore/mktables.lst + rm -rf lib/version + rm -f lib/version.pm + rm -f lib/version.pod + rm -f lib/ExtUtils/MM_OS390.pm + rm -f lib/ExtUtils/PL2Bat.pm + rm -f lib/Getopt/Long/Parser.pm + rm -f lib/Pod/Html/Util.pm + rm -f lib/bigfloat.pm + rm -f lib/stable.pm + rm -f libperl.a + rm -f mg_data.h + rm -f miniperl + rm -f perl + find pod -type l -delete + rm -f `grep -rl 'This file is built by' pod` + rm -f pod/perltoc.pod + rm -f pod/perluniprops.pod + rm -f pod/roffitall + rm -f try + rm -f try.c + rm -f try.h + rm -f try.out + rm -f xconfig.sh + rm -f Makefile.config config.sh diff -Paur --no-dereference -- perl.upstream/cnf/configure_args.sh perl/cnf/configure_args.sh --- perl.upstream/cnf/configure_args.sh +++ perl/cnf/configure_args.sh @@ -91,18 +91,23 @@ esac # split --set-foo and similar constructs into --set foo # and things like --prefix=/foo into --prefix and /foo + # PATCH: Fix --foo= bar being parsed as --foo bar. + split= case "$a" in set-*|use-*|include-*) k=`echo "$a" | sed -e 's/^[^-]*-//'` a=`echo "$a" | sed -e 's/-.*//'` + split=1 ;; dont-use-*|dont-include-*) k=`echo "$a" | sed -e 's/^dont-[^-]*-//'` a=`echo "$a" | sed -e 's/^\(dont-[^-]*\)-.*/\1/'` + split=1 ;; *=*) k=`echo "$a" | sed -e 's/^[^=]*=//'` a=`echo "$a" | sed -e 's/=.*//'` + split=1 ;; esac # check whether kv is required @@ -114,7 +119,7 @@ esac # fetch argument if necessary (--set foo=bar) # note that non-empty n means there must be no argument - if [ -n "$x" -a -z "$k" -a -z "$n" ]; then + if [ -z "$split" -a -n "$x" -a -z "$k" -a -z "$n" ]; then eval k="\${$i}"; i=$((i+1)) fi # split kv pair into k and v (k=foo v=bar) @@ -155,7 +160,8 @@ help) mode="help" ;; regen|regenerate) mode="regen" ;; keeplog) defuser "$a" 1 ;; - prefix|html[13]dir|libsdir) defuser $a "$v" ;; + # PATCH: At least recognize --exec-prefix even though it's ignored. + prefix|exec-prefix|html[13]dir|libsdir) defuser $a "$v" ;; man[13]dir|otherlibsdir) defuser $a "$v" ;; siteprefix|sitehtml[13]dir) defuser $a "$v" ;; siteman[13]dir|vendorman[13]dir)defuser $a "$v" ;; diff -Paur --no-dereference -- perl.upstream/cnf/configure_func.sh perl/cnf/configure_func.sh --- perl.upstream/cnf/configure_func.sh +++ perl/cnf/configure_func.sh @@ -8,7 +8,8 @@ try_add '#define _GNU_SOURCE' funcincludes "$3" "$4" "$includes" try_add "int main(void) { $2($3); return 0; }" - try_link -O0 -fno-builtin + # PATCH: Work around tests for functions without prototypes. + try_link -O0 -fno-builtin -Wno-error=implicit-function-declaration resdef $1 'found' 'missing' fi } @@ -187,7 +188,8 @@ checkfunc d_pathconf 'pathconf' 'NULL,0' 'unistd.h' checkfunc d_pause 'pause' '' 'unistd.h' checkfunc d_pipe 'pipe' 'NULL' 'fcntl.h unistd.h' -checkfunc d_pipe2 'pipe' 'NULL,0' 'fcntl.h unistd.h' +# PATCH: pipe2 accidentally checked for pipe. +checkfunc d_pipe2 'pipe2' 'NULL,0' 'fcntl.h unistd.h' checkfunc d_poll 'poll' 'NULL,0,0' 'poll.h' checkfunc d_prctl 'prctl' '0,0,0,0,0' 'sys/prctl.h' checkfunc d_pthread_atfork 'pthread_atfork' 'NULL,NULL,NULL' 'pthread.h' @@ -310,4 +312,6 @@ checkfunc d_wcsxfrm 'wcsxfrm' 'NULL,NULL,0' 'wchar.h' checkfunc d_wctomb 'wctomb' 'NULL,NULL' 'wchar.h' checkfunc d_writev 'writev' '0,NULL,0' 'sys/uio.h' +# PATCH: Add missing check for whether nanosleep exists. +checkfunc d_nanosleep 'nanosleep''NULL,NULL' 'time.h' unset includes diff -Paur --no-dereference -- perl.upstream/cnf/configure_func_ext.sh perl/cnf/configure_func_ext.sh --- perl.upstream/cnf/configure_func_ext.sh +++ perl/cnf/configure_func_ext.sh @@ -68,7 +68,8 @@ mstart "Checking FD_SET macros" if not hinted d_fd_macros 'found' 'missing'; then try_start - try_includes sys/time.h sys/types.h unistd.h + # PATCH: FD_SET is defined in . + try_includes sys/select.h sys/time.h sys/types.h unistd.h try_cat <. +checktype d_fd_set 'fd_set' 'sys/select.h' checktype d_fpos64_t 'fpos64_t' 'stdio.h' checktype d_off64_t 'off64_t' 'sys/types.h' checktype d_ptrdiff_t 'ptrdiff_t' 'stddef.h' diff -Paur --no-dereference -- perl.upstream/cnf/diffs/perl5-5.39.5/constant.applied perl/cnf/diffs/perl5-5.39.5/constant.applied --- perl.upstream/cnf/diffs/perl5-5.39.5/constant.applied +++ perl/cnf/diffs/perl5-5.39.5/constant.applied @@ -0,0 +1 @@ + diff -Paur --no-dereference -- perl.upstream/cnf/diffs/perl5-5.39.5/dynaloader.applied perl/cnf/diffs/perl5-5.39.5/dynaloader.applied --- perl.upstream/cnf/diffs/perl5-5.39.5/dynaloader.applied +++ perl/cnf/diffs/perl5-5.39.5/dynaloader.applied @@ -0,0 +1 @@ + diff -Paur --no-dereference -- perl.upstream/cnf/diffs/perl5-5.39.5/findext.applied perl/cnf/diffs/perl5-5.39.5/findext.applied --- perl.upstream/cnf/diffs/perl5-5.39.5/findext.applied +++ perl/cnf/diffs/perl5-5.39.5/findext.applied @@ -0,0 +1 @@ + diff -Paur --no-dereference -- perl.upstream/cnf/diffs/perl5-5.39.5/installscripts.applied perl/cnf/diffs/perl5-5.39.5/installscripts.applied --- perl.upstream/cnf/diffs/perl5-5.39.5/installscripts.applied +++ perl/cnf/diffs/perl5-5.39.5/installscripts.applied @@ -0,0 +1 @@ + diff -Paur --no-dereference -- perl.upstream/cnf/diffs/perl5-5.39.5/liblist.applied perl/cnf/diffs/perl5-5.39.5/liblist.applied --- perl.upstream/cnf/diffs/perl5-5.39.5/liblist.applied +++ perl/cnf/diffs/perl5-5.39.5/liblist.applied @@ -0,0 +1 @@ + diff -Paur --no-dereference -- perl.upstream/cnf/diffs/perl5-5.39.5/makemaker.applied perl/cnf/diffs/perl5-5.39.5/makemaker.applied --- perl.upstream/cnf/diffs/perl5-5.39.5/makemaker.applied +++ perl/cnf/diffs/perl5-5.39.5/makemaker.applied @@ -0,0 +1 @@ + diff -Paur --no-dereference -- perl.upstream/cnf/diffs/perl5-5.39.5/posix-makefile.applied perl/cnf/diffs/perl5-5.39.5/posix-makefile.applied --- perl.upstream/cnf/diffs/perl5-5.39.5/posix-makefile.applied +++ perl/cnf/diffs/perl5-5.39.5/posix-makefile.applied @@ -0,0 +1 @@ + diff -Paur --no-dereference -- perl.upstream/cnf/diffs/perl5-5.39.5/test-checkcase.applied perl/cnf/diffs/perl5-5.39.5/test-checkcase.applied --- perl.upstream/cnf/diffs/perl5-5.39.5/test-checkcase.applied +++ perl/cnf/diffs/perl5-5.39.5/test-checkcase.applied @@ -0,0 +1 @@ + diff -Paur --no-dereference -- perl.upstream/cnf/diffs/perl5-5.39.5/test-makemaker.applied perl/cnf/diffs/perl5-5.39.5/test-makemaker.applied --- perl.upstream/cnf/diffs/perl5-5.39.5/test-makemaker.applied +++ perl/cnf/diffs/perl5-5.39.5/test-makemaker.applied @@ -0,0 +1 @@ + diff -Paur --no-dereference -- perl.upstream/cnf/diffs/perl5-5.39.5/xconfig.applied perl/cnf/diffs/perl5-5.39.5/xconfig.applied --- perl.upstream/cnf/diffs/perl5-5.39.5/xconfig.applied +++ perl/cnf/diffs/perl5-5.39.5/xconfig.applied @@ -0,0 +1 @@ + diff -Paur --no-dereference -- perl.upstream/config_h.SH perl/config_h.SH --- perl.upstream/config_h.SH +++ perl/config_h.SH @@ -1230,6 +1230,9 @@ * function used to generate normalized random numbers. * Values include 15, 16, 31, and 48. */ +#if defined(__sortix__) && !defined(__SORTIX_HAS_DRAND48__) +double drand48(void); +#endif #define Drand01() $drand01 /**/ #define Rand_seed_t $randseedtype /**/ #define seedDrand01(x) $seedfunc((Rand_seed_t)x) /**/ diff -Paur --no-dereference -- perl.upstream/cpan/ExtUtils-Constant/t/Constant.t perl/cpan/ExtUtils-Constant/t/Constant.t --- perl.upstream/cpan/ExtUtils-Constant/t/Constant.t +++ perl/cpan/ExtUtils-Constant/t/Constant.t @@ -1,8 +1,18 @@ #!/usr/bin/perl -w use Config; +use IPC::Cmd qw(can_run); + unless ($Config{usedl}) { - print "1..0 # no usedl, skipping\n"; + print "1..0 # SKIP no usedl\n"; + exit 0; +} + +my $make = $Config{make}; +$make = $ENV{MAKE} if exists $ENV{MAKE}; + +unless ( can_run($make) ) { + print "1..0 # SKIP make not available\n"; exit 0; } @@ -34,8 +44,6 @@ # module from blib @INC = map {File::Spec->rel2abs($_)} @INC if $] < 5.007 && $] >= 5.006; -my $make = $Config{make}; -$make = $ENV{MAKE} if exists $ENV{MAKE}; if ($^O eq 'MSWin32' && $make eq 'nmake') { $make .= " -nologo"; } # VMS may be using something other than MMS/MMK diff -Paur --no-dereference -- perl.upstream/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm --- perl.upstream/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm +++ perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm @@ -20,9 +20,10 @@ use File::Spec; sub ext { - if ( $^O eq 'VMS' ) { return &_vms_ext; } - elsif ( $^O eq 'MSWin32' ) { return &_win32_ext; } - else { return &_unix_os2_ext; } + if ($Config{usemmldlt}){ return &_ld_ext; } + elsif($^O eq 'VMS') { return &_vms_ext; } + elsif($^O eq 'MSWin32') { return &_win32_ext; } + else { return &_unix_os2_ext; } } sub _unix_os2_ext { @@ -661,4 +662,51 @@ wantarray ? ( $lib, '', $ldlib, '', ( $give_libs ? \@flibs : () ) ) : $lib; } +# A direct test for -l validity. +# Because guessing real file names for -llib options when dealing +# with a cross compiler is generally a BAD IDEA^tm. +sub _ld_ext { + my($self,$potential_libs, $verbose, $give_libs) = @_; + $verbose ||= 0; + + if ($^O =~ 'os2' and $Config{perllibs}) { + # Dynamic libraries are not transitive, so we may need including + # the libraries linked against perl.dll again. + + $potential_libs .= " " if $potential_libs; + $potential_libs .= $Config{perllibs}; + } + return ("", "", "", "", ($give_libs ? [] : ())) unless $potential_libs; + warn "Potential libraries are '$potential_libs':\n" if $verbose; + + my($ld) = $Config{ld}; + my($lddlflags) = $Config{lddlflags}; + my($libs) = defined $Config{perllibs} ? $Config{perllibs} : $Config{libs}; + + my $try = 'try_mm.c'; + my $tryx = 'try_mm.x'; + open(TRY, '>', $try) || die "Can't create MakeMaker test file $try: $!\n"; + print TRY "int main(void) { return 0; }\n"; + close(TRY); + + my $testlibs = ''; + my @testlibs = (); + foreach my $thislib (split ' ', $potential_libs) { + $testlibs = join(' ', @testlibs); + if($thislib =~ /^-L/) { + push(@testlibs, $thislib); + next + }; + my $cmd = "$ld $lddlflags -o $tryx $try $testlibs $thislib >/dev/null 2>&1"; + my $ret = system($cmd); + warn "Warning (mostly harmless): " . "No library found for $thislib\n" if $ret; + next if $ret; + push @testlibs, $thislib; + } + unlink($try); + unlink($tryx); + + return (join(' ', @testlibs), '', join(' ', @testlibs), ''); +} + 1; diff -Paur --no-dereference -- perl.upstream/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm --- perl.upstream/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm +++ perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm @@ -38,7 +38,7 @@ $Is{BSD} = ($^O =~ /^(?:free|midnight|net|open)bsd$/ or grep( $^O eq $_, qw(bsdos interix dragonfly) ) ); - $Is{Android} = $^O =~ /android/; + $Is{Android} = $^O =~ /android/ || $Config{osname} eq 'android'; if ( $^O eq 'darwin' ) { my @osvers = split /\./, $Config{osvers}; if ( $^X eq '/usr/bin/perl' ) { diff -Paur --no-dereference -- perl.upstream/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Utils.pm perl/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Utils.pm --- perl.upstream/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Utils.pm +++ perl/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Utils.pm @@ -359,8 +359,6 @@ =cut sub have_compiler { - return 1 if $ENV{PERL_CORE}; - my $have_compiler = 0; in_dir(sub { diff -Paur --no-dereference -- perl.upstream/dist/Safe/Safe.pm perl/dist/Safe/Safe.pm --- perl.upstream/dist/Safe/Safe.pm +++ perl/dist/Safe/Safe.pm @@ -43,7 +43,10 @@ } } -use Opcode 1.01, qw( +# PATCH: 'use Safe;' fails with '"%.*g" is not exported by the Opcode module' +# on Sortix without floating point support when a floating point version +# number is used here. +use Opcode 1, qw( opset opset_to_ops opmask_add empty_opset full_opset invert_opset verify_opset opdesc opcodes opmask define_optag opset_to_hex diff -Paur --no-dereference -- perl.upstream/ext/DynaLoader/hints/linux.pl perl/ext/DynaLoader/hints/linux.pl --- perl.upstream/ext/DynaLoader/hints/linux.pl +++ perl/ext/DynaLoader/hints/linux.pl @@ -1,5 +1 @@ -# XXX Configure test needed. -# Some Linux releases like to hide their -$self->{CCFLAGS} = $Config{ccflags} . ' -I/usr/include/libelf' - if -f "/usr/include/libelf/nlist.h"; 1; diff -Paur --no-dereference -- perl.upstream/ext/Errno/Errno_pm.PL perl/ext/Errno/Errno_pm.PL --- perl.upstream/ext/Errno/Errno_pm.PL +++ perl/ext/Errno/Errno_pm.PL @@ -1,6 +1,9 @@ use ExtUtils::MakeMaker; use Config; use strict; + +# PATCH: Recognize the right operating system when cross-compiling. +$^O = $Config{osname}; our $VERSION = "1.38"; @@ -160,6 +163,11 @@ close(CPPI); + # PATCH: Simply process errno.c rather then the special logic below to + # locate the system headers. + push(@file, "errno.c"); + return uniq(@file); + # invoke CPP and read the output if ($IsMSWin32) { open(CPPO,"$Config{cpprun} $Config{cppflags} errno.c |") or diff -Paur --no-dereference -- perl.upstream/ext/ExtUtils-Miniperl/lib/ExtUtils/Miniperl.pm perl/ext/ExtUtils-Miniperl/lib/ExtUtils/Miniperl.pm --- perl.upstream/ext/ExtUtils-Miniperl/lib/ExtUtils/Miniperl.pm +++ perl/ext/ExtUtils-Miniperl/lib/ExtUtils/Miniperl.pm @@ -2,7 +2,9 @@ package ExtUtils::Miniperl; use strict; use Exporter 'import'; -use ExtUtils::Embed 1.31, qw(xsi_header xsi_protos xsi_body); +# PATCH: Work around missing Sortix printf floating point support causing: +# "%.*g" is not exported by the ExtUtils::Embed module +use ExtUtils::Embed 1, qw(xsi_header xsi_protos xsi_body); our @EXPORT = qw(writemain); our $VERSION = '1.14'; diff -Paur --no-dereference -- perl.upstream/ext/POSIX/Makefile.PL perl/ext/POSIX/Makefile.PL --- perl.upstream/ext/POSIX/Makefile.PL +++ perl/ext/POSIX/Makefile.PL @@ -1,4 +1,9 @@ # Expect this line to be read by t/posix.t, don't change it + +# Explicitly avoid including '.' in @INC; autoloader gets confused since it +# can find POSIX.pm, but can't find autosplit.ix. +BEGIN { pop @INC;} +# use ExtUtils::MakeMaker; use ExtUtils::Constant 0.23 'WriteConstants'; use Config; diff -Paur --no-dereference -- perl.upstream/ext/POSIX/POSIX.xs perl/ext/POSIX/POSIX.xs --- perl.upstream/ext/POSIX/POSIX.xs +++ perl/ext/POSIX/POSIX.xs @@ -1,3 +1,12 @@ +#if defined(__sortix__) && !defined(__SORTIX_HAS_PAUSE__) +#include +#include +int pause(void) +{ + return sigsuspend(NULL); +} +#endif + #define PERL_EXT_POSIX #define PERL_EXT @@ -1418,7 +1427,11 @@ # define mkfifo(a,b) not_here("mkfifo") # else /* !( defined OS2 ) */ # ifndef mkfifo +#if defined(__sortix__) && !defined(__SORTIX_HAS_MKFIFO__) +# define mkfifo(path, mode) not_here("mkfifo") +#else # define mkfifo(path, mode) (mknod((path), (mode) | S_IFIFO, 0)) +#endif # endif # endif # endif /* !HAS_MKFIFO */ @@ -3623,12 +3636,19 @@ ctermid(s = 0) char * s = 0; CODE: +/* PATCH: Sortix doesn't have ctermid at this time. */ +#ifdef L_ctermid #ifdef I_TERMIOS /* On some systems L_ctermid is a #define; but not all; this code works * for all cases (so far...) */ s = (char *) safemalloc((size_t) L_ctermid); #endif RETVAL = ctermid(s); +#else + s = (char *) safemalloc(strlen("/dev/tty")); + strcpy(s, "/dev/tty"); + RETVAL = s; +#endif OUTPUT: RETVAL CLEANUP: diff -Paur --no-dereference -- perl.upstream/installman perl/installman --- perl.upstream/installman +++ perl/installman @@ -1,8 +1,6 @@ #!./perl -w BEGIN { - @INC = qw(lib); - # This needs to be at BEGIN time, before any use of Config # install_lib itself loads and imports Config into main:: require './install_lib.pl'; diff -Paur --no-dereference -- perl.upstream/installperl perl/installperl --- perl.upstream/installperl +++ perl/installperl @@ -2,8 +2,6 @@ BEGIN { chdir '..' if !-d 'lib' and -d '../lib'; - @INC = 'lib'; - $ENV{PERL5LIB} = 'lib'; # This needs to be at BEGIN time, before any use of Config # install_lib itself loads and imports Config into main:: @@ -183,6 +181,7 @@ # Fetch some frequently-used items from %Config my $installbin = "$opts{destdir}$Config{installbin}"; +my $installlib = "$opts{destdir}$Config{installlib}"; my $installscript = "$opts{destdir}$Config{installscript}"; my $installprivlib = "$opts{destdir}$Config{installprivlib}"; my $installarchlib = "$opts{destdir}$Config{installarchlib}"; @@ -339,7 +338,8 @@ @corefiles = <*.h>; } else { # [als] hard-coded 'libperl' name... not good! - @corefiles = <*.h libperl*.* perl*$Config{lib_ext}>; + @corefiles = <*.h perl*$Config{lib_ext}>; + push(@corefiles, $Config{libperl}) if $Config{useshrplib} && !$Config{soname}; # AIX needs perl.exp installed as well. push(@corefiles,'perl.exp') if $^O eq 'aix'; @@ -366,6 +366,29 @@ chmod($NON_SO_MODE, $dest) foreach @corefiles; } +if($Config{useshrplib} && $Config{soname}) { + my $libperl = $Config{libperl}; + my $soname = $Config{soname}; + mkpath($installlib); + if (copy_if_diff($libperl, "$installlib/$libperl")) { + strip("-S", "$installlib/$libperl"); + chmod(0555, "$installlib/$libperl"); + + # Normally this should be done by ldconfig. + safe_unlink("$installlib/$soname") unless $soname eq $libperl; + safe_unlink("$installlib/libperl.so") unless $soname eq 'libperl.so'; + symlink($libperl, "$installlib/$soname") unless $soname eq $libperl; + symlink($libperl, "$installlib/libperl.so") unless $soname eq 'libperl.so'; + # using $so here instead of .so hardly makes any sense, + # all systems supporting SONAME have $so=.so + + # Backward compatibility: provide a symlink where people expect it + safe_unlink("$installarchlib/CORE/libperl.so"); + symlink("$Config{installlib}/$libperl", "$installarchlib/CORE/libperl.so"); + # ^ without destdir here! + } +} + # Install main perl executables # Make links to ordinary names if installbin directory isn't current directory. diff -Paur --no-dereference -- perl.upstream/lib/unicore/mktables perl/lib/unicore/mktables --- perl.upstream/lib/unicore/mktables +++ perl/lib/unicore/mktables @@ -12646,10 +12646,12 @@ if ( defined $nv_floating_to_rational{$float} && $nv_floating_to_rational{$float} ne $rational) { - die Carp::my_carp_bug("Both '$rational' and" - . " '$nv_floating_to_rational{$float}' evaluate to" - . " the same floating point number." - . " \$E_FLOAT_PRECISION must be increased"); + # PATCH: This test fails on native Sortix due to lack of floating + # point formatting support, but nothing is wrong. + #die Carp::my_carp_bug("Both '$rational' and" + # . " '$nv_floating_to_rational{$float}' evaluate to" + # . " the same floating point number." + # . " \$E_FLOAT_PRECISION must be increased"); } $nv_floating_to_rational{$float} = $rational; } diff -Paur --no-dereference -- perl.upstream/locale.c perl/locale.c --- perl.upstream/locale.c +++ perl/locale.c @@ -302,7 +302,12 @@ * initialization. This is done before option parsing, and before any thread * creation, so can be a file-level static. (Must come before #including * perl.h) */ -#include "config.h" +/* PATCH: Dammit this file special cases it instead of using perl.h. */ +#ifndef USE_CROSS_COMPILE +# include "config.h" +#else +# include "xconfig.h" +#endif /* Returns the Unix errno portion; ignoring any others. This is a macro here * instead of putting it into perl.h, because unclear to khw what should be diff -Paur --no-dereference -- perl.upstream/perl.h perl/perl.h --- perl.upstream/perl.h +++ perl/perl.h @@ -43,7 +43,11 @@ */ /* #define PERL_RC_STACK */ -#include "config.h" +#ifndef USE_CROSS_COMPILE +# include "config.h" +#else +# include "xconfig.h" +#endif /* This fakes up using Mingw for locale handling. In order to not define WIN32 * in this file (and hence throughout the code that isn't expecting it), this @@ -449,6 +453,8 @@ #ifdef HASATTRIBUTE_WARN_UNUSED_RESULT # define __attribute__warn_unused_result__ __attribute__((warn_unused_result)) #endif +/* PATCH: Silence annoying always_inline -Wattribute warnings. */ +#undef HASATTRIBUTE_ALWAYS_INLINE #ifdef HASATTRIBUTE_ALWAYS_INLINE /* always_inline is buggy in gcc <= 4.6 and causes compilation errors */ # if !defined(PERL_IS_GCC) || PERL_GCC_VERSION_GE(4,7,0) diff -Paur --no-dereference -- perl.upstream/perl_langinfo.h perl/perl_langinfo.h --- perl.upstream/perl_langinfo.h +++ perl/perl_langinfo.h @@ -4,7 +4,11 @@ #ifndef PERL_LANGINFO_H #define PERL_LANGINFO_H 1 +#ifdef USE_CROSS_COMPILE +#include "xconfig.h" +#else #include "config.h" +#endif #if defined(I_LANGINFO) # include diff -Paur --no-dereference -- perl.upstream/pp.c perl/pp.c --- perl.upstream/pp.c +++ perl/pp.c @@ -3196,6 +3196,13 @@ } } +#if defined(__sortix__) && !defined(__SORTIX_HAS_DRAND48__) +double drand48(void) +{ + return arc4random() / 4294967295.0; +} +#endif + /* Support Configure command-line overrides for rand() functions. After 5.005, perhaps we should replace this by Configure support for drand48(), random(), or rand(). For 5.005, though, maintain diff -Paur --no-dereference -- perl.upstream/regcomp.c perl/regcomp.c --- perl.upstream/regcomp.c +++ perl/regcomp.c @@ -145,6 +145,11 @@ #include "unicode_constants.h" #include "regcomp_internal.h" +/* PATCH: Avoid multiple definitions. */ +#ifdef PERL_EXT_RE_BUILD +#undef PERL_RE_BUILD_AUX +#endif + /* ========================================================= * BEGIN edit_distance stuff. * diff -Paur --no-dereference -- perl.upstream/t/lib/commonsense.t perl/t/lib/commonsense.t --- perl.upstream/t/lib/commonsense.t +++ perl/t/lib/commonsense.t @@ -17,7 +17,7 @@ if (($Config{'extensions'} !~ /\bIO\s/) ){ BAIL_OUT("Perl configured without IO module"); } -if (($Config{'extensions'} !~ /\bFile\/Glob\b/) ){ +if (($Config{'extensions'} !~ /\bFile.Glob\b/) ){ BAIL_OUT("Perl configured without File::Glob module"); } diff -Paur --no-dereference -- perl.upstream/t/porting/checkcase.t perl/t/porting/checkcase.t --- perl.upstream/t/porting/checkcase.t +++ perl/t/porting/checkcase.t @@ -25,6 +25,8 @@ # Special exemption for Makefile, makefile return if $name =~ m!\A[Mm]akefile\z!; + # same for Configure, configure in perl-cross + return if $name =~ m!\A[Cc]onfigure\z!; if ($name eq '.git') { # Don't scan the .git directory, as its contents are outside diff -Paur --no-dereference -- perl.upstream/util.c perl/util.c --- perl.upstream/util.c +++ perl/util.c @@ -2300,7 +2300,7 @@ * 'current' is non-null, with up to three sizes that are added together. * It handles integer overflow. */ -# ifndef HAS_SETENV +/* PATCH: Support having only setenv/unsetenv and no putenv. */ static char * S_env_alloc(void *current, Size_t l1, Size_t l2, Size_t l3, Size_t size) { @@ -2325,7 +2325,6 @@ panic: croak_memory_wrap(); } -# endif /* =for apidoc_section $utility diff -Paur --no-dereference -- perl.upstream/vutil.c perl/vutil.c --- perl.upstream/vutil.c +++ perl/vutil.c @@ -588,6 +588,7 @@ /* Macro to do the meat of getting the PV of an NV version number. This is * macroized because can be called from several places */ +/* PATCH: Work around lack of Sortix printf floating point support. */ #define GET_NUMERIC_VERSION(ver, sv, tbuf, buf, len) \ STMT_START { \ \ @@ -597,13 +598,16 @@ /* We earlier created 'sv' for very large version numbers, to rely \ * on the specialized algorithms SV code has built-in for such \ * values */ \ + double d = SvNVX(ver); \ if (sv) { \ - Perl_sv_setpvf(aTHX_ sv, "%.9" NVff, SvNVX(ver)); \ + Perl_sv_setpvf(aTHX_ sv, "%d.%09d", (int) d, \ + (int) ((long long)(d * 1000000000) % 1000000000)); \ len = SvCUR(sv); \ buf = SvPVX(sv); \ } \ else { \ - len = my_snprintf(tbuf, sizeof(tbuf), "%.9" NVff, SvNVX(ver)); \ + len = my_snprintf(tbuf, sizeof(tbuf), "%d.%09d", (int) d, \ + (int) ((long long)(d * 1000000000) % 1000000000)); \ buf = tbuf; \ } \ \ diff -Paur --no-dereference -- perl.upstream/win32/FindExt.pm perl/win32/FindExt.pm --- perl.upstream/win32/FindExt.pm +++ perl/win32/FindExt.pm @@ -115,10 +115,6 @@ $this_ext =~ s!-!/!g; $leaf =~ s/.*-//; - # List/Util.xs lives in Scalar-List-Utils, Cwd.xs lives in PathTools - $this_ext = 'List/Util' if $this_ext eq 'Scalar/List/Utils'; - $this_ext = 'Cwd' if $this_ext eq 'PathTools'; - # Temporary hack to cope with smokers that are not clearing directories: next if $ext{$this_ext};