Skip to content

Instantly share code, notes, and snippets.

@Mons
Created November 15, 2012 08:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mons/4077485 to your computer and use it in GitHub Desktop.
Save Mons/4077485 to your computer and use it in GitHub Desktop.
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