aboutsummaryrefslogtreecommitdiffstats
path: root/configure.pl
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-09-04 15:57:48 +0000
committerlloyd <[email protected]>2006-09-04 15:57:48 +0000
commit3ce6fec889ba559cef3324d2d577942795bd0a01 (patch)
treecac0622619a88d8cde2edd348cdac22454c9ad08 /configure.pl
parentaa38b1961cbd6b4219f6979e80f30a79f38c9441 (diff)
Rename some internally-used variables so I can use set_if_any for some
of the module info variables.
Diffstat (limited to 'configure.pl')
-rwxr-xr-xconfigure.pl59
1 files changed, 26 insertions, 33 deletions
diff --git a/configure.pl b/configure.pl
index 84ab4985e..78101bc85 100755
--- a/configure.pl
+++ b/configure.pl
@@ -299,7 +299,7 @@ exit;
sub make_reader {
my $filename = $_[0];
open FILE, "<$filename" or
- die "Couldn't read from $filename ($!)\n";
+ die "(error): Couldn't read $filename ($!)\n";
return sub {
my $line = '';
@@ -612,10 +612,10 @@ sub load_module {
handle_files($modname, $module{'ignore'}, \&ignore_file);
handle_files($modname, $module{'add'}, \&add_file);
- if(defined($module{'notes'}))
+ if(defined($module{'note'}))
{
- my $realname = $module{'name'};
- my $note = $module{'notes'};
+ my $realname = $module{'realname'};
+ my $note = $module{'note'};
print STDERR "(note): $modname (\"$realname\"): $note\n";
}
}
@@ -1662,28 +1662,21 @@ sub set_if_any {
sub get_module_info {
my ($name, $dir) = @_;
- my %info;
-
- my $desc_file = File::Spec->catfile($dir, $name, 'modinfo.txt');
- die "(error): Module $name does not seem to have a description file\n"
- unless(-e $desc_file);
- my $reader = make_reader($desc_file);
+ my $reader = make_reader(File::Spec->catfile($dir, $name, 'modinfo.txt'));
+ my %info;
$info{'libs'} = {};
-
$info{'add'} = {};
$info{'replace'} = {};
$info{'ignore'} = {};
-
$info{'define'} = {};
$info{'define_base'} = {};
$info{'external_libs'} = 0;
while($_ = &$reader()) {
- set_if_quoted($_, 'realname', \$info{'name'});
- set_if_quoted($_, 'note', \$info{'notes'});
+ set_if_any(\&set_if_quoted, $_, \%info, 'realname:note');
$info{'define'}{$1} = undef if(/^define (\w*)/);
$info{'define_base'}{$1} = undef if(/^define_base (\w*)/);
@@ -1691,27 +1684,8 @@ sub get_module_info {
$info{'external_libs'} = 1 if(/^uses_external_libs/);
- if(/^require_version /) {
- if(/^require_version (\d+)\.(\d+)\.(\d+)$/) {
- my $version = "$1.$2.$3";
- my $needed_version = 100*$1 + 10*$2 + $3;
-
- my $have_version =
- 100*$MAJOR_VERSION + 10*$MINOR_VERSION + $PATCH_VERSION;
-
- if($needed_version > $have_version) {
- warn "Module $name requires Botan version $version\n";
- return ();
- }
- }
- else {
- warn "In module $name, bad version code in require_version\n";
- }
- }
-
sub read_and_set_undef {
my ($line,$reader,$hash,$key) = @_;
-
my @lst;
read_hash($line, $reader, $key, list_push(\@lst));
foreach my $elem (@lst) { $$hash{$key}{$elem} = undef; }
@@ -1730,6 +1704,25 @@ sub get_module_info {
$line =~ m/^([\w!,]*) -> ([\w,-]*)$/;
$info{'libs'}{$1} = $2;
});
+
+ if(/^require_version /) {
+ if(/^require_version (\d+)\.(\d+)\.(\d+)$/) {
+ my $version = "$1.$2.$3";
+ my $needed_version = 100*$1 + 10*$2 + $3;
+
+ my $have_version =
+ 100*$MAJOR_VERSION + 10*$MINOR_VERSION + $PATCH_VERSION;
+
+ if($needed_version > $have_version) {
+ warn "Module $name requires Botan version $version\n";
+ return ();
+ }
+ }
+ else {
+ warn "In module $name, bad version code in require_version\n";
+ }
+ }
+
}
return %info;