Skip to content

Commit

Permalink
treat .git as .svn (author, bla...)
Browse files Browse the repository at this point in the history
  • Loading branch information
Reini Urban committed Oct 24, 2011
1 parent 843aec5 commit c99dcdb
Show file tree
Hide file tree
Showing 16 changed files with 40 additions and 29 deletions.
4 changes: 2 additions & 2 deletions ByteLoader/Makefile.PL
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ my $core = grep { $_ eq 'PERL_CORE=1' } @ARGV;
my $ccflags = $Config{ccflags}; my $ccflags = $Config{ccflags};
my $lddlflags = $Config{lddlflags}; my $lddlflags = $Config{lddlflags};


if ( -d ".svn" ) { if ( -d '.svn' or -d '.git' ) {
$ccflags .= " -ansi -Wall -Wextra" if $Config{cc} =~ /gcc/; $ccflags .= ' -ansi -Wall -Wextra' if $Config{cc} =~ /gcc/;
} }
if ($] < 5.007) { if ($] < 5.007) {
# We are not called by ../Makefile.PL, but be sure about that for now. # We are not called by ../Makefile.PL, but be sure about that for now.
Expand Down
4 changes: 3 additions & 1 deletion Changes
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
and worked quite fine with Perl 5.6 and 5.8 and worked quite fine with Perl 5.6 and 5.8


1.37 2011-xx-xx rurban 1.37 2011-xx-xx rurban
Save %main:: stashes Save %main:: stashes. Switched to git, added github mirror
* C: issue79: save stashes also, but only directly under %main:: * C: issue79: save stashes also, but only directly under %main::
and values which are also stashes to avoid a second walker and values which are also stashes to avoid a second walker
besides savecv, and thus unneeded territory; B::STASHGV (46) besides savecv, and thus unneeded territory; B::STASHGV (46)
New -fno-stash with -O2 to omit stashes, which are rarely needed New -fno-stash with -O2 to omit stashes, which are rarely needed
* CC (1.12) allow overriding of -f<opt> B::C flags * CC (1.12) allow overriding of -f<opt> B::C flags
* META.yml: remove from MANIFEST and repo, let make dist
autogenerate it
* t/TESTS: changed test 46 (Exporter:: and other stashes in * t/TESTS: changed test 46 (Exporter:: and other stashes in
%main:: stash) to cover issue 79. %main:: stash) to cover issue 79.
use Exporter; print q(ok) if %main::Exporter:: use Exporter; print q(ok) if %main::Exporter::
Expand Down
1 change: 0 additions & 1 deletion MANIFEST
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ C.xs
Changes Changes
Copying Copying
MANIFEST MANIFEST
META.yml
Makefile.PL Makefile.PL
NOTES NOTES
README README
Expand Down
7 changes: 4 additions & 3 deletions Makefile.PL
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ sub headerpath {
} }


# Check for Doug Lea's dlmalloc version, or ptmalloc2 included in glibc # Check for Doug Lea's dlmalloc version, or ptmalloc2 included in glibc
# or an extra ptmalloc3. # or the best: ptmalloc3 with independent_comalloc().
# http://www.malloc.de/malloc/ptmalloc3-current.tar.gz
# This improves -fav-init startup speed dramatically (18% tested). # This improves -fav-init startup speed dramatically (18% tested).
# ptmalloc3 needs #include <malloc-2.8.3.h>, but we don't want to clash # ptmalloc3 needs #include <malloc-2.8.3.h>, but we don't want to clash
# with an existing malloc.h from perl.h, so we declare it by ourselves. # with an existing malloc.h from perl.h, so we declare it by ourselves.
Expand Down Expand Up @@ -165,7 +166,7 @@ package MY;


sub libscan { sub libscan {
# Ignore temp testing files # Ignore temp testing files
return 0 if $_[1] =~ /^(.svn|jit.*|i386|.*\.orig|bytecode.*\.pl|c?ccode.*|regen_lib\.pl)$/; return 0 if $_[1] =~ /^(\.git|\.svn|jit.*|i386|.*\.orig|bytecode.*\.pl|c?ccode.*|regen_lib\.pl)$/;
return 0 if $_[1] =~ /\.svn|~/; # needed for msys perl5.6 return 0 if $_[1] =~ /\.svn|~/; # needed for msys perl5.6
# Ignore Bytecode on 5.6 for now. The 5.6 CORE module produces better code (until fixed :) # Ignore Bytecode on 5.6 for now. The 5.6 CORE module produces better code (until fixed :)
# Not even the Byteloader works for 5.6 assembled code. The Disassembler does not stop at ret. # Not even the Byteloader works for 5.6 assembled code. The Disassembler does not stop at ret.
Expand Down Expand Up @@ -195,7 +196,7 @@ sub ccflags {
my $ccflags = shift->SUPER::ccflags(@_); my $ccflags = shift->SUPER::ccflags(@_);
$ccflags .= " -DHAVE_INDEPENDENT_COMALLOC" if $have_independent_comalloc; $ccflags .= " -DHAVE_INDEPENDENT_COMALLOC" if $have_independent_comalloc;
$ccflags .= $extra_cflags if $extra_cflags; $ccflags .= $extra_cflags if $extra_cflags;
return $ccflags unless -d ".svn"; return $ccflags unless -d ".svn" or -d ".git";
# Recommended by http://www.network-theory.co.uk/docs/gccintro/gccintro_32.html # Recommended by http://www.network-theory.co.uk/docs/gccintro/gccintro_32.html
# -ansi -pedantic -Wall -W -Wconversion -Wshadow -Wcast-qual -Wwrite-strings (-W => -WExtra) # -ansi -pedantic -Wall -W -Wconversion -Wshadow -Wcast-qual -Wwrite-strings (-W => -WExtra)
$ccflags .= " -ansi -pedantic -Wall -Wextra -Wconversion -Wshadow -Wcast-qual -Wwrite-strings" $ccflags .= " -ansi -pedantic -Wall -Wextra -Wconversion -Wshadow -Wcast-qual -Wwrite-strings"
Expand Down
14 changes: 7 additions & 7 deletions README
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
Homepage: http://www.perl-compiler.org/ Homepage: http://www.perl-compiler.org/
Releases: http://search.cpan.org/dist/B-C/ Releases: http://search.cpan.org/dist/B-C/
Code: http://code.google.com/p/perl-compiler/ Code: http://code.google.com/p/perl-compiler/
git clone https://code.google.com/p/perl-compiler/
was previously:
svn checkout http://perl-compiler.googlecode.com/svn/trunk/ perl-compiler svn checkout http://perl-compiler.googlecode.com/svn/trunk/ perl-compiler


INSTALL INSTALL
Expand Down Expand Up @@ -94,13 +96,11 @@ fail in mysterious ways and give wrong answers rather than just crash
in boring ways. CC is still on the experimental level. Please use your in boring ways. CC is still on the experimental level. Please use your
test suite. test suite.


If your program uses classes which define methods (or other If your program uses classes which define methods (or other subs which
subs which are not exported and not apparently used until are not exported and not apparently used until runtime) then you'll
runtime) then you'll need to use -u compile-time options need to use -u compile-time options (see the NOTES file) to force the
(see the NOTES file) to force the subs to be subs to be compiled. Future releases will probably default the other
compiled. Future releases will probably default the other way, do more auto-detection and provide more fine-grained control.
way, do more auto-detection and provide more fine-grained
control.


Since compiled executables need linking with libperl, you Since compiled executables need linking with libperl, you
may want to turn libperl.a into a shared library if your may want to turn libperl.a into a shared library if your
Expand Down
1 change: 0 additions & 1 deletion README.alpha
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@


Releases are at http://search.cpan.org/dist/B-C/ Releases are at http://search.cpan.org/dist/B-C/
Code is now at http://code.google.com/p/perl-compiler/ Code is now at http://code.google.com/p/perl-compiler/
svn checkout http://perl-compiler.googlecode.com/svn/trunk/ perl-compiler-read-only


CHANGES CHANGES


Expand Down
5 changes: 4 additions & 1 deletion perloptree.pod
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1370,6 +1370,9 @@ is working on L<Jit>.


The best source of information is the source. It is very well documented. The best source of information is the source. It is very well documented.


There are some pod files from talks and workshops in F<ramblings/>.
From YAPC EU 2010 there is a good screencast at L<http://vimeo.com/14058377>.

Simon Cozens has posted the course material to NetThink's Simon Cozens has posted the course material to NetThink's
L<http://books.simon-cozens.org/index.php/Perl_5_Internals#The_Lexer_and_the_Parser> L<http://books.simon-cozens.org/index.php/Perl_5_Internals#The_Lexer_and_the_Parser>
training course. This is the currently best available description on training course. This is the currently best available description on
Expand All @@ -1392,7 +1395,7 @@ pdf L<http://scratchcomputing.com/developers/perl_guts_tour.pdf>


This text was created in this wiki article: This text was created in this wiki article:
L<http://www.perlfoundation.org/perl5/index.cgi?optree_guts> L<http://www.perlfoundation.org/perl5/index.cgi?optree_guts>
The svn version should be more actual. The with B::C released version should be more actual.


=head1 Conclusion =head1 Conclusion


Expand Down
2 changes: 1 addition & 1 deletion t/bytecode.t
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ my $PERL56 = ( $] < 5.008001 );
my $DEBUGGING = ($Config{ccflags} =~ m/-DDEBUGGING/); my $DEBUGGING = ($Config{ccflags} =~ m/-DDEBUGGING/);
my $ITHREADS = $Config{useithreads}; my $ITHREADS = $Config{useithreads};
my $MULTI = $Config{usemultiplicity}; my $MULTI = $Config{usemultiplicity};
my $AUTHOR = -d ".svn"; my $AUTHOR = -d '.svn' or -d '.git';


my @tests = tests(); my @tests = tests();
my $numtests = $#tests+1; my $numtests = $#tests+1;
Expand Down
4 changes: 2 additions & 2 deletions t/c_o2.t
Original file line number Original file line Diff line number Diff line change
@@ -1,8 +1,8 @@
#! /usr/bin/env perl #! /usr/bin/env perl
# better use testc.sh -O2 for debugging # better use testc.sh -O2 for debugging
BEGIN { BEGIN {
#unless (-d ".svn") { #unless (-d ".svn" or -d '.git') {
# print "1..0 #SKIP Only if -d .svn\n"; # print "1..0 #SKIP Only if -d .svn|.git\n";
# exit; # exit;
#} #}
if ($ENV{PERL_CORE}){ if ($ENV{PERL_CORE}){
Expand Down
4 changes: 2 additions & 2 deletions t/c_o3.t
Original file line number Original file line Diff line number Diff line change
@@ -1,8 +1,8 @@
#! /usr/bin/env perl #! /usr/bin/env perl
# better use testc.sh -O3 for debugging # better use testc.sh -O3 for debugging
BEGIN { BEGIN {
unless (-d ".svn") { unless (-d ".svn" or -d '.git') {
print "1..0 #SKIP Only if -d .svn\n"; print "1..0 #SKIP Only if -d .svn|.git\n";
exit; exit;
} }
if ($ENV{PERL_CORE}){ if ($ENV{PERL_CORE}){
Expand Down
4 changes: 2 additions & 2 deletions t/c_o4.t
Original file line number Original file line Diff line number Diff line change
@@ -1,8 +1,8 @@
#! /usr/bin/env perl #! /usr/bin/env perl
# better use testc.sh -O4 for debugging # better use testc.sh -O4 for debugging
BEGIN { BEGIN {
unless (-d ".svn") { unless (-d ".svn" or -d '.git') {
print "1..0 #SKIP Only if -d .svn\n"; print "1..0 #SKIP Only if -d .svn|.git\n";
exit; exit;
} }
if ($ENV{PERL_CORE}){ if ($ENV{PERL_CORE}){
Expand Down
4 changes: 2 additions & 2 deletions t/cc_o1.t
Original file line number Original file line Diff line number Diff line change
@@ -1,8 +1,8 @@
#! /usr/bin/env perl #! /usr/bin/env perl
# better use testcc.sh -O1 for debugging # better use testcc.sh -O1 for debugging
BEGIN { BEGIN {
unless (-d ".svn") { unless (-d ".svn" or -d '.git') {
print "1..0 #SKIP Only if -d .svn\n"; print "1..0 #SKIP Only if -d .svn|.git\n";
exit; exit;
} }
if ($ENV{PERL_CORE}){ if ($ENV{PERL_CORE}){
Expand Down
4 changes: 2 additions & 2 deletions t/cc_o2.t
Original file line number Original file line Diff line number Diff line change
@@ -1,8 +1,8 @@
#! /usr/bin/env perl #! /usr/bin/env perl
# better use testcc.sh -O2 for debugging # better use testcc.sh -O2 for debugging
BEGIN { BEGIN {
unless (-d ".svn") { unless (-d ".svn" or -d '.git') {
print "1..0 #SKIP Only if -d .svn\n"; print "1..0 #SKIP Only if -d .svn|.git\n";
exit; exit;
} }
if ($ENV{PERL_CORE}){ if ($ENV{PERL_CORE}){
Expand Down
2 changes: 1 addition & 1 deletion t/modules.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ sub log_err {


sub is_subset { sub is_subset {
return 0 if grep /^-no-subset$/, @ARGV; return 0 if grep /^-no-subset$/, @ARGV;
return ! -d '.svn' || grep /^-subset$/, @ARGV; return ! (-d '.svn' or -d'.git') || grep /^-subset$/, @ARGV;
} }


sub get_module_list { sub get_module_list {
Expand Down
7 changes: 7 additions & 0 deletions t/modules.t
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ unless (is_subset) {
my $svnstat = `svn status lib/B/C.pm t/test.pl t/*.t`; my $svnstat = `svn status lib/B/C.pm t/test.pl t/*.t`;
chomp $svnstat; chomp $svnstat;
$svnrev .= " M" if $svnstat; $svnrev .= " M" if $svnstat;
} elsif (-d '.git') {
local $ENV{LC_MESSAGES} = "C";
$svnrev = `git log -1 --pretty=format:"%h %ad | %s" --date=short`;
chomp $svnrev;
my $gitdiff = `git diff lib/B/C.pm t/test.pl t/*.t`;
chomp $gitdiff;
$svnrev .= " M" if $gitdiff;
} }
log_diag("B::C::VERSION = $B::C::VERSION $svnrev"); log_diag("B::C::VERSION = $B::C::VERSION $svnrev");
log_diag("perlversion = $perlversion"); log_diag("perlversion = $perlversion");
Expand Down
2 changes: 1 addition & 1 deletion t/test.pl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ sub run_c_tests {
my @skip = @{$_[2]}; my @skip = @{$_[2]};


use Config; use Config;
my $AUTHOR = -d ".svn"; my $AUTHOR = -d ".svn" or -d ".git";
my $keep_c = 0; # set it to keep the pl, c and exe files my $keep_c = 0; # set it to keep the pl, c and exe files
my $keep_c_fail = 1; # keep on failures my $keep_c_fail = 1; # keep on failures


Expand Down

0 comments on commit c99dcdb

Please sign in to comment.