aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-07-21 05:19:45 +0000
committerlloyd <[email protected]>2009-07-21 05:19:45 +0000
commit753291a8c2c533f666abf111f3988ed0bb283281 (patch)
treee4b25d802ea97103f5ff22f35990e84c12c69a35
parent26fa46ce690011c2e1bf032db0ef6606d1a3b2f6 (diff)
Fix ticket 46
Previous behavior was that if a module was explicitly disabled, the libraries that module used would still be linked in. So for instance configure.pl --disable-modules=pthreads --without-openssl would cause libpthread and libcrypto to be included in the final link! This bug only affected the Perl configure
-rwxr-xr-xconfigure.pl21
1 files changed, 13 insertions, 8 deletions
diff --git a/configure.pl b/configure.pl
index 85b1508b8..275f40d09 100755
--- a/configure.pl
+++ b/configure.pl
@@ -161,8 +161,7 @@ sub main {
File::Spec->catdir($$config{'build_dir'}, 'include', 'botan'),
'mp_bits' => find_mp_bits($config),
- 'mod_libs' =>
- [ using_libs($os, sort keys %{$$config{'modules'}}) ],
+ 'mod_libs' => [ using_libs($config) ],
'sources' => { },
'includes' => { },
@@ -939,24 +938,30 @@ sub mach_opt {
# #
##################################################
sub using_libs {
- my ($os,@using) = @_;
+ my ($config) = @_;
+
+ my $os = $$config{'os'};
my %libs;
- foreach my $mod (@using) {
+ foreach my $mod (sort keys %{$$config{'modules'}}) {
+ next if ${$$config{'modules'}}{$mod} < 0;
+
my %MOD_LIBS = %{ $MODULES{$mod}{'libs'} };
- foreach my $mod_os (keys %MOD_LIBS) {
+
+ foreach my $mod_os (keys %MOD_LIBS)
+ {
next if($mod_os =~ /^all!$os$/);
next if($mod_os =~ /^all!$os,/);
- next if($mod_os =~ /^all!.*,${os}$/);
+ #next if($mod_os =~ /^all!.*,${os}$/);
next if($mod_os =~ /^all!.*,$os,.*/);
next unless($mod_os eq $os or ($mod_os =~ /^all.*/));
my @liblist = split(/,/, $MOD_LIBS{$mod_os});
foreach my $lib (@liblist) { $libs{$lib} = 1; }
- }
}
+ }
return sort keys %libs;
- }
+}
sub libs {
my ($prefix,$suffix,@libs) = @_;