Skip to content

Instantly share code, notes, and snippets.

@Mons
Created Nov 15, 2012
Embed
What would you like to do?
Remove some CFLAGS from $Config
BEGIN {
require Config;
if (tied %Config::Config) { eval {
for (keys %Config::Config) {
local *Config::STORE = sub {
my($self, $key, $value) = @_;
$value =~ s{'}{}sg;#'
my $start = index($Config::Config_SH_expanded, "\n$key=\'");
return undef if $start == -1;
$start += length($key) + 3;
substr($Config::Config_SH_expanded, $start, index($Config::Config_SH_expanded, "'\n", $start) - $start) = defined $value ? $value : 'undef';
delete $self->{$key};
};
if ($Config::Config{$_} =~ m{-Wdeclaration-after-statement}) {
$Config::Config{$_} =~ s{-Wdeclaration-after-statement }{}sg;
print "$_: $Config::Config{$_}";
}
#$cf{$_} = $Config{$_} if /flags/;
}
} }
warn if $@;
}
use ExtUtils::MakeMaker;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment