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 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 $lddlflags = $Config{lddlflags};

if ( -d ".svn" ) {
$ccflags .= " -ansi -Wall -Wextra" if $Config{cc} =~ /gcc/;
if ( -d '.svn' or -d '.git' ) {
$ccflags .= ' -ansi -Wall -Wextra' if $Config{cc} =~ /gcc/;
}
if ($] < 5.007) {
# 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 Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
and worked quite fine with Perl 5.6 and 5.8

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::
and values which are also stashes to avoid a second walker
besides savecv, and thus unneeded territory; B::STASHGV (46)
New -fno-stash with -O2 to omit stashes, which are rarely needed
* 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
%main:: stash) to cover issue 79.
use Exporter; print q(ok) if %main::Exporter::
Expand Down
1 change: 0 additions & 1 deletion MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ C.xs
Changes
Copying
MANIFEST
META.yml
Makefile.PL
NOTES
README
Expand Down
7 changes: 4 additions & 3 deletions Makefile.PL
Original file line number 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
# 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).
# 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.
Expand Down Expand Up @@ -165,7 +166,7 @@ package MY;

sub libscan {
# 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
# 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.
Expand Down Expand Up @@ -195,7 +196,7 @@ sub ccflags {
my $ccflags = shift->SUPER::ccflags(@_);
$ccflags .= " -DHAVE_INDEPENDENT_COMALLOC" if $have_independent_comalloc;
$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
# -ansi -pedantic -Wall -W -Wconversion -Wshadow -Wcast-qual -Wwrite-strings (-W => -WExtra)
$ccflags .= " -ansi -pedantic -Wall -Wextra -Wconversion -Wshadow -Wcast-qual -Wwrite-strings"
Expand Down
14 changes: 7 additions & 7 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
Homepage: http://www.perl-compiler.org/
Releases: http://search.cpan.org/dist/B-C/
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

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
test suite.

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

Since compiled executables need linking with libperl, you
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 Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

Releases are at http://search.cpan.org/dist/B-C/
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

Expand Down
5 changes: 4 additions & 1 deletion perloptree.pod
Original file line number 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.

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
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
Expand All @@ -1392,7 +1395,7 @@ pdf L<http://scratchcomputing.com/developers/perl_guts_tour.pdf>

This text was created in this wiki article:
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

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

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

sub is_subset {
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 {
Expand Down
7 changes: 7 additions & 0 deletions t/modules.t
Original file line number 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`;
chomp $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("perlversion = $perlversion");
Expand Down
2 changes: 1 addition & 1 deletion t/test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ sub run_c_tests {
my @skip = @{$_[2]};

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_fail = 1; # keep on failures

Expand Down

0 comments on commit c99dcdb

Please sign in to comment.