Expand config.pl's notion of "full"

Make sure bugs in PLATFORM_xxx_ALT are catched
This commit is contained in:
Manuel Pégourié-Gonnard 2015-06-03 09:59:06 +01:00
parent f2ec505c34
commit b752715893

View file

@ -36,6 +36,11 @@ POLARSSL_PKCS11_C
_ALT\s*$ _ALT\s*$
); );
# Things that should be enabled in "full" even if they match @excluded
my @non_excluded = qw(
PLATFORM_[A-Z0-9]+_ALT
);
my $config_file = "include/polarssl/config.h"; my $config_file = "include/polarssl/config.h";
# get -f option # get -f option
@ -76,6 +81,7 @@ my @config_lines = <$config_read>;
close $config_read; close $config_read;
my $exclude_re = join '|', @excluded; my $exclude_re = join '|', @excluded;
my $no_exclude_re = join '|', @non_excluded;
open my $config_write, '>', $config_file or die "write $config_file: $!\n"; open my $config_write, '>', $config_file or die "write $config_file: $!\n";
@ -86,7 +92,8 @@ for my $line (@config_lines) {
$done = 1; $done = 1;
} }
if (!$done && $line =~ m!^//\s?#define! && $line !~ /$exclude_re/) { if (!$done && $line =~ m!^//\s?#define! &&
( $line !~ /$exclude_re/ || $line =~ /$no_exclude_re/ ) ) {
$line =~ s!^//!!; $line =~ s!^//!!;
} }
} elsif ($action eq "unset") { } elsif ($action eq "unset") {