[dfa/Cursor] Implement backslash escapes for character classes
[pugs.git] / util / src_to_blib.pl
blobb0d9c700c67db75af52d65e4cfae709c901d8810
1 #!/usr/bin/perl
3 # Copy all of the source, header, object and intermediate files in `src`
4 # to the blib6 archlib, so that it will all get installed. This is
5 # needed to be able to build Haskell based Perl6 extensions outside of
6 # the pugs tree.
8 use Config;
9 use File::Copy qw(copy);
10 use File::Path qw(mkpath);
12 my @pmc_files;
15 # copy_all('src', 'blib6/arch/CORE/pugs');
16 copy_all("$_/blib/", 'blib6/pugs/perl5') for <perl5/*>;
17 copy_all("$_/blib6/", 'blib6/pugs/perl6') for <perl5/*>;
18 copy_all("$_/blibjs/", 'blib6/pugs/js') for <perl5/*>;
20 sleep 1;
21 utime undef, undef, @pmc_files;
23 print "*** Successfully built! Type '$Config{make} install' to install.\n";
25 # make an educated guess of whether we'll need root permission.
26 print " (You may need to do that as the 'root' user.)\n"
27 unless -w $Config{sitelib};
29 sub copy_all {
30 my ($src, $dest) = @_;
31 mkpath($dest);
32 local *DIR;
33 opendir(DIR, $src) or warn "opendir failed for $src: $!", return;
34 my @nodes = readdir(DIR);
35 foreach my $node (sort @nodes) {
36 next if $node =~ /^(\.|\.\.|\.svn|t)$/;
37 my $src_path = "$src/$node";
38 my $dest_path = "$dest/$node";
39 if (-f $src_path) {
40 copy($src_path, $dest_path);
42 if (-d $src_path) {
43 copy_all($src_path, $dest_path);
45 push @pmc_files, $dest_path if $node =~ m/\.pmc$/;