aboutsummaryrefslogtreecommitdiffstats
path: root/configure.pl
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-09-28 16:04:33 +0000
committerlloyd <[email protected]>2008-09-28 16:04:33 +0000
commit4a04f965bd43bd591c8973ed025dc312823f1607 (patch)
tree30016b6e1ff6188dbcc0e183a7ae53b60051c960 /configure.pl
parent6edc83ddef93bddf70f1b259d80b104bf14524c2 (diff)
Modularize the Adler32 checksum in checksums/adler32
Add a new option --disable-modules which allows for disabling any set of modules that normally would be autoloaded. Rename the Botan feature test macros from BOTAN_EXT_BLAH to BOTAN_HAS_BLAH, which will be much more sensible especially when everything is done in this fashion (eg, BOTAN_HAS_BLOWFISH or BOTAN_HAS_RSA, etc)
Diffstat (limited to 'configure.pl')
-rwxr-xr-xconfigure.pl42
1 files changed, 35 insertions, 7 deletions
diff --git a/configure.pl b/configure.pl
index a3d7181a6..b35349304 100755
--- a/configure.pl
+++ b/configure.pl
@@ -275,6 +275,8 @@ To change what modules to use:
--modules=
[$modules]
+ --disable-modules=module1[,module2[...]]
+
To add a set of modules:
--module-set=[$sets]
@@ -420,8 +422,17 @@ sub autoload_modules {
my $realname = $modinfo{'realname'};
if(defined($$config{'modules'}{$mod})) {
- autoconfig("$mod ($realname): loading by user request");
- next;
+
+ my $n = $$config{'modules'}{$mod};
+
+ if($n < 0) {
+ autoconfig("$mod ($realname): disabled by user request");
+ next;
+ }
+ else {
+ autoconfig("$mod ($realname): loading by user request");
+ next;
+ }
}
my @arch_list = @{ $modinfo{'arch'} };
@@ -518,7 +529,17 @@ sub get_options {
my ($config,$mods) = @_;
foreach my $mod (split(/,/, $mods)) {
- $$config{'modules'}{$mod} = 1;
+ # -1 means disabled by user, do not load
+ $$config{'modules'}{$mod} = 1 unless($$config{'modules'}{$mod} == -1);
+ }
+ }
+
+ sub disable_modules {
+ my ($config,$mods) = @_;
+
+ foreach my $mod (split(/,/, $mods)) {
+ # -1 means disabled by user, do not load
+ $$config{'modules'}{$mod} = -1;
}
}
@@ -526,14 +547,14 @@ sub get_options {
my ($config,$sets) = @_;
foreach my $set (split(/,/, $sets)) {
- for my $name (sort keys %MODULES) {
- my %info = %{$MODULES{$name}};
+ for my $mod (sort keys %MODULES) {
+ my %info = %{$MODULES{$mod}};
next unless (defined($info{'modset'}));
for my $s (split(/,/, $info{'modset'})) {
if($s eq $set) {
- $$config{'modules'}{$name} = 1;
+ $$config{'modules'}{$mod} = 1 unless($$config{'modules'}{$mod} == -1);
}
}
}
@@ -569,6 +590,8 @@ sub get_options {
'module-set=s' => sub { add_module_sets($config, $_[1]); },
'module-sets=s' => sub { add_module_sets($config, $_[1]); },
+ 'disable-modules=s' => sub { disable_modules($config, $_[1]); },
+
'trace' => sub { $TRACING = 1; },
'debug' => sub { &$save_option($_[0], 1); },
'no-shared' => sub { $$config{'shared'} = 'no'; },
@@ -961,6 +984,9 @@ sub load_modules {
my @mod_names;
foreach my $mod (sort keys %{$$config{'modules'}}) {
+
+ next unless($$config{'modules'}{$mod} > 0);
+
load_module($config, $mod);
foreach my $req_mod (@{$MODULES{$mod}{'requires'}}) {
@@ -1044,6 +1070,8 @@ sub load_modules {
my @defarray;
foreach my $mod (sort keys %{$$config{'modules'}}) {
+ next unless $$config{'modules'}{$mod} > 0;
+
my $defs = $MODULES{$mod}{'define'};
next unless $defs;
@@ -1054,7 +1082,7 @@ sub load_modules {
foreach (sort @defarray) {
die unless(defined $_ and $_ ne '');
- $defines .= "#define BOTAN_EXT_$_\n";
+ $defines .= "#define BOTAN_HAS_$_\n";
}
chomp($defines);
return $defines;