The R Project SVN R

Rev

Rev 39641 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 39641 Rev 40009
Line 34... Line 34...
34
use Text::Wrap;
34
use Text::Wrap;
35
 
35
 
36
## Don't buffer output.
36
## Don't buffer output.
37
$| = 1;
37
$| = 1;
38
 
38
 
39
my $revision = ' $Rev: 39641 $ ';
39
my $revision = ' $Rev: 40009 $ ';
40
my $version;
40
my $version;
41
my $name;
41
my $name;
42
$revision =~ / ([\d\.]*) /;
42
$revision =~ / ([\d\.]*) /;
43
$version = $1;
43
$version = $1;
44
($name = $0) =~ s|.*/||;
44
($name = $0) =~ s|.*/||;
Line 450... Line 450...
450
				"contains object files.\n");
450
				"contains object files.\n");
451
		}
451
		}
452
	    }
452
	    }
453
 
453
 
454
	    if($thispkg_src_subdir ne "no") {
454
	    if($thispkg_src_subdir ne "no") {
-
 
455
		## Recognized extensions for sources or headers.
-
 
456
		my $exts = "(" .
-
 
457
		    &make_file_exts("sources") . "|" .
-
 
458
		    &make_file_exts("headers") . ")";
455
		foreach my $dir (@dirs) {
459
		foreach my $dir (@dirs) {
456
		    if((-d &file_path($pkgdir, $dir))) {
460
		    if((-d &file_path($pkgdir, $dir))) {
457
			chdir(&file_path($pkgdir, $dir));
461
			chdir(&file_path($pkgdir, $dir));
458
			if(!(-f "Makefile") && !(-f "Makefile.win")) {
462
			if(!(-f "Makefile") && !(-f "Makefile.win")) {
459
			    opendir(DIR, ".") or die "cannot opendir $dir: $!";
463
			    opendir(DIR, ".") or die "cannot opendir $dir: $!";
460
			    @srcfiles = grep { 
464
			    @srcfiles = grep { 
461
				!(/\.([Ccfh]|cc|cpp|f90|f95)$/
-
 
462
				  || /^Makevars/ || /-win\.def$/ )
465
				!(/\.$exts$/ || /^Makevars/ || /-win\.def$/ )
463
				    && -f "$_" } readdir(DIR);
466
				    && -f "$_" } readdir(DIR);
464
			    closedir(DIR);
467
			    closedir(DIR);
465
			    if(@srcfiles) {
468
			    if(@srcfiles) {
466
				$log->warning() unless $any;
469
				$log->warning() unless $any;
467
				$any++;
470
				$any++;
Line 1116... Line 1119...
1116
    ## If there is a Makefile (or a Makefile.win), we cannot assume
1119
    ## If there is a Makefile (or a Makefile.win), we cannot assume
1117
    ## that source files have the predefined extensions.
1120
    ## that source files have the predefined extensions.
1118
    ## </NOTE>
1121
    ## </NOTE>
1119
    if( (-d "src") && !( (-f &file_path("src", "Makefile"))
1122
    if( (-d "src") && !( (-f &file_path("src", "Makefile"))
1120
			 || (-f &file_path("src", "Makefile.win")) )) {
1123
			 || (-f &file_path("src", "Makefile.win")) )) {
1121
	if( !(&list_files_with_exts("src", "([Ccf]|cc|cpp|f90|f95)"))) {
1124
	if( !(&list_files_with_type("src", "sources"))) {
1122
	    $log->warning() unless $any;
1125
	    $log->warning() unless $any;
1123
	    $any++;
1126
	    $any++;
1124
	    $log->print("Subdirectory 'src' contains no source files.\n");
1127
	    $log->print("Subdirectory 'src' contains no source files.\n");
1125
	}
1128
	}
1126
    }
1129
    }
Line 1680... Line 1683...
1680
    ## Note that we currently only check the CRLF part.
1683
    ## Note that we currently only check the CRLF part.
1681
    ## </FIXME>
1684
    ## </FIXME>
1682
 
1685
 
1683
    if(!$is_base_pkg && (-d "src")) {
1686
    if(!$is_base_pkg && (-d "src")) {
1684
	$log->checking("for CRLF line endings in C/C++/Fortran sources/headers");
1687
	$log->checking("for CRLF line endings in C/C++/Fortran sources/headers");
1685
	my @src_files = &list_files_with_exts("src", "(c|h|f|cc|cpp)");
1688
	my @src_files = &list_files_with_type("src", "src_no_CRLF");
1686
	my @bad_files = ();
1689
	my @bad_files = ();
1687
	foreach my $file (@src_files) {
1690
	foreach my $file (@src_files) {
1688
	    open(FILE, "< $file")
1691
	    open(FILE, "< $file")
1689
	      or die "Error: cannot open '$file' for reading\n";
1692
	      or die "Error: cannot open '$file' for reading\n";
1690
            binmode(FILE);	# for Windows
1693
            binmode(FILE);	# for Windows