mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-22 14:39:24 -05:00
Fix semantics of empty string in mkfiles.pl "!cflags".
Previously, if you tried to set the special cflags for an object file to the empty string, mkfiles.pl would normalise that to the string "1". I'm not entirely sure why - that line of code was added without explanation in commit 64150a5ef which brought in that directive in the first place - but I have to guess that it was left over from some earlier design iteration in which I hadn't quite decided whether I was going to need a string or a boolean to separate version.o from other objects. Of course, setting an object's cflags to "" is a bit of a weird thing to want to do anyway - why not just leave them unset? But in fact I've now thought of something useful for it to do: this commit arranges that setting cflags="" has the effect (in the 'am' makefile type) of separating the object out into its own little automake library but not actually giving that library any separate cflags. And the point of _that_, in turn, will be that then you can add cflags to it _conditionally_ in a "!begin am" snippet, e.g. conditionalised on something in configure.
This commit is contained in:
parent
8552f5cb9a
commit
c0a57d0b9e
14
mkfiles.pl
14
mkfiles.pl
@ -84,7 +84,15 @@ while (<IN>) {
|
|||||||
if ($_[0] eq "!specialobj" and &mfval($_[1])) { $specialobj{$_[1]}->{$_[2]} = 1; next;}
|
if ($_[0] eq "!specialobj" and &mfval($_[1])) { $specialobj{$_[1]}->{$_[2]} = 1; next;}
|
||||||
if ($_[0] eq "!cflags" and &mfval($_[1])) {
|
if ($_[0] eq "!cflags" and &mfval($_[1])) {
|
||||||
($rest = $_) =~ s/^\s*\S+\s+\S+\s+\S+\s*//; # find rest of input line
|
($rest = $_) =~ s/^\s*\S+\s+\S+\s+\S+\s*//; # find rest of input line
|
||||||
$rest = 1 if $rest eq "";
|
if ($rest eq "") {
|
||||||
|
# Make sure this file doesn't get lumped together with any
|
||||||
|
# other file's cflags.
|
||||||
|
$rest = "F" . $_[2];
|
||||||
|
} else {
|
||||||
|
# Give this file a specific set of cflags, but permit it to
|
||||||
|
# go together with other files using the same set.
|
||||||
|
$rest = "C" . $rest;
|
||||||
|
}
|
||||||
$cflags{$_[1]}->{$_[2]} = $rest;
|
$cflags{$_[1]}->{$_[2]} = $rest;
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
@ -1552,9 +1560,11 @@ if (defined $makefiles{'am'}) {
|
|||||||
|
|
||||||
%amspeciallibs = ();
|
%amspeciallibs = ();
|
||||||
foreach $obj (sort { $a cmp $b } keys %{$cflags{'am'}}) {
|
foreach $obj (sort { $a cmp $b } keys %{$cflags{'am'}}) {
|
||||||
|
my $flags = $cflags{'am'}->{$obj};
|
||||||
|
$flags = "" if $flags !~ s/^C//;
|
||||||
print "lib${obj}_a_SOURCES = ", $objtosrc{$obj}, "\n";
|
print "lib${obj}_a_SOURCES = ", $objtosrc{$obj}, "\n";
|
||||||
print &splitline(join " ", "lib${obj}_a_CFLAGS", "=", @amcflags,
|
print &splitline(join " ", "lib${obj}_a_CFLAGS", "=", @amcflags,
|
||||||
$cflags{'am'}->{$obj}), "\n";
|
$flags), "\n";
|
||||||
$amspeciallibs{$obj} = "lib${obj}.a";
|
$amspeciallibs{$obj} = "lib${obj}.a";
|
||||||
}
|
}
|
||||||
print &splitline(join " ", "noinst_LIBRARIES", "=",
|
print &splitline(join " ", "noinst_LIBRARIES", "=",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user