diff options
author | lloyd <[email protected]> | 2006-09-08 09:41:19 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2006-09-08 09:41:19 +0000 |
commit | 86b3478aa84ef848411846ea8c8031c0ef4382b2 (patch) | |
tree | 8b76abe15dd858cadcd2650381323f30e3c690f5 | |
parent | 3e931e46074db75701821c2a39a98140c777d6c1 (diff) |
Integrated conflict detection into the module loader, which catches many
cases that the old check_for_conflicts() function would not.
-rwxr-xr-x | configure.pl | 68 |
1 files changed, 28 insertions, 40 deletions
diff --git a/configure.pl b/configure.pl index 45e62789c..60d26099a 100755 --- a/configure.pl +++ b/configure.pl @@ -228,12 +228,9 @@ sub main { 'make_style' => $make_style, 'gcc_bug' => $dumb_gcc, - 'prefix' => - ($prefix ne '') ? $prefix : os_install_info($os, 'install_root'), - 'libdir' => - ($lib_dir ne '') ? $lib_dir : os_install_info($os, 'lib_dir'), - 'docdir' => - ($doc_dir ne '') ? $doc_dir : os_install_info($os, 'doc_dir'), + 'prefix' => os_install_info($os, 'install_root'), + 'libdir' => os_install_info($os, 'lib_dir'), + 'docdir' => os_install_info($os, 'doc_dir'), 'includedir' => os_install_info($os, 'header_dir'), @@ -252,7 +249,10 @@ sub main { 'check_src' => { list_dir($CHECK_DIR) }, }); - check_for_conflicts(@using_mods); + $$config{'prefix'} = $prefix if($prefix ne ''); + $$config{'libdir'} = $lib_dir if($lib_dir ne ''); + $$config{'docdir'} = $doc_dir if($doc_dir ne ''); + foreach my $mod (@using_mods) { load_module($MODULES{$mod}, $config); } @@ -693,36 +693,6 @@ sub find_mp_bits { ################################################## # # ################################################## -sub check_for_conflicts { - - sub conflicts { - my ($mod, $item, $do_what, $hashref) = @_; - return if(!defined($item)); - - if(defined($$hashref{$item})) { - my $other_mod = $$hashref{$item}; - error("Both $mod and $other_mod $do_what $item"); - } - return $item; - } - - my @mods = @_; - my (%ignored, %added, %replaced, %defines); - - foreach my $mod (@mods) { - sub check_hash { - my ($mod, $do_what, $hashref) = @_; - foreach (@{ $MODULES{$mod}{$do_what} }) { - $$hashref{conflicts($mod, $_, $do_what, $hashref)} = $mod; - } - } - - check_hash($mod, 'replace', \%replaced); - check_hash($mod, 'add', \%added); - check_hash($mod, 'ignore', \%ignored); - } -} - sub realname { my $arg = $_[0]; @@ -823,9 +793,15 @@ sub add_file { my $mod_dir = File::Spec->catdir($MOD_DIR, $modname); if($file =~ /\.cpp$/ or $file =~ /\.S$/) { + error("File $file already added from ", $$config{'sources'}{$file}) + if(defined($$config{'sources'}{$file})); + $$config{'sources'}{$file} = $mod_dir; } elsif($file =~ /\.h$/) { + error("File $file already added from ", $$config{'includes'}{$file}) + if(defined($$config{'includes'}{$file})); + $$config{'includes'}{$file} = $mod_dir; } else { @@ -838,10 +814,22 @@ sub ignore_file { check_for_file(full_path($file), $modname); if($file =~ /\.cpp$/ or $file =~ /\.S$/) { - delete $$config{'sources'}{$file}; + if(defined ($$config{'sources'}{$file})) { + error("$modname - File $file modified from ", + $$config{'sources'}{$file}) + if($$config{'sources'}{$file} ne 'src'); + + delete $$config{'sources'}{$file}; + } } elsif($file =~ /\.h$/) { - delete $$config{'includes'}{$file}; + if(defined ($$config{'includes'}{$file})) { + error("$modname - File $file modified from ", + $$config{'includes'}{$file}) + if($$config{'includes'}{$file} ne 'include'); + + delete $$config{'includes'}{$file}; + } } else { error("Not sure where to put $file"); } } @@ -857,7 +845,7 @@ sub replace_file { sub check_for_file { my ($file,$mod) = @_; - error("Module $mod requires that file $file exist. This error\n", + error("Module $mod requires that file $file exist. This error\n ", "should never occur; please contact the maintainers with details.") unless(-e $file); } |