plug-ins/common: Allow arbitrary CFLAGS in mkgen.pl

Don't require a plug-in to specify a *FLAGS* variable in
plugin-defs.pl, to make it possible to for example add

  cflags => '-fno-strict-aliasing'

directly.
This commit is contained in:
Martin Nordholts 2010-09-04 13:36:36 +02:00
parent 92b1d80e0c
commit 27471e1f7c
1 changed files with 2 additions and 4 deletions

View File

@ -118,9 +118,7 @@ EOT
foreach (sort keys %plugins) {
my $makename = $_;
my $MAKENAME;
$makename =~ s/-/_/g;
$MAKENAME = "\U$makename";
my $libgimp = "";
@ -154,11 +152,11 @@ foreach (sort keys %plugins) {
if (exists $plugins{$_}->{cflags}) {
my $cflags = $plugins{$_}->{cflags};
my $optflags = $cflags =~ /FLAGS/ ? $cflags : "$MAKENAME\E_CFLAGS";
my $cflagsvalue = $cflags =~ /FLAGS/ ? "\$($cflags)" : $cflags;
print MK <<EOT;
${makename}_CFLAGS = \$($optflags)
${makename}_CFLAGS = $cflagsvalue
EOT
}