1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

Finally add support for building Mac resource forks. This adds a new kind

of compiled resource file, .rsrc, which is built from .r, and adds mechanisms
to the MPW makefile generator to handle this.

[originally from svn r2385]
This commit is contained in:
Ben Harris 2002-12-30 14:20:25 +00:00
parent 6ca089d035
commit 672404dc4e
2 changed files with 30 additions and 10 deletions

3
Recipe
View File

@ -142,4 +142,5 @@ pterm : [X] pterm terminal wcwidth uxucs uxmisc tree234 misc ldisc ldiscucs
plink : [U] uxplink uxcons NONSSH UXSSH be_all logging UXMISC
PuTTY : [M] terminal wcwidth tree234 misc ldisc ldiscucs
+ logging settings be_none mac macstore macterm macucs testback
+ logging settings be_none mac macstore macterm macucs mac_res.rsrc
+ testback

View File

@ -90,12 +90,17 @@ foreach $i (@prognames) {
foreach $j (@list) {
# Dependencies for "x" start with "x.c".
# Dependencies for "x.res" start with "x.rc".
# Dependencies for "x.rsrc" start with "x.r".
# Both types of file are pushed on the list of files to scan.
# Libraries (.lib) don't have dependencies at all.
if ($j =~ /^(.*)\.res$/) {
$file = "$1.rc";
$depends{$j} = [$file];
push @scanlist, $file;
} elsif ($j =~ /^(.*)\.rsrc$/) {
$file = "$1.r";
$depends{$j} = [$file];
push @scanlist, $file;
} elsif ($j =~ /\.lib$/) {
# libraries don't have dependencies
} else {
@ -183,7 +188,7 @@ sub objects {
@ret = ();
foreach $i (@{$programs{$prog}}) {
$x = "";
if ($i =~ /^(.*)\.res/) {
if ($i =~ /^(.*)\.(res|rsrc)/) {
$y = $1;
($x = $rtmpl) =~ s/X/$y/;
} elsif ($i =~ /^(.*)\.lib/) {
@ -218,7 +223,7 @@ sub deps {
@ret = ();
$depchar ||= ':';
foreach $i (sort keys %depends) {
if ($i =~ /^(.*)\.res/) {
if ($i =~ /^(.*)\.(res|rsrc)/) {
next if !defined $rtmpl;
$y = $1;
($x = $rtmpl) =~ s/X/$y/;
@ -634,35 +639,49 @@ foreach $p (&prognames("M")) {
print &splitline("$prog \xc4 $prog.68k $prog.cfm68k $prog.ppc",
undef, "\xb6"), "\n\n";
$objstr = &objects($p, "X.68k.o", undef, undef);
print &splitline("$prog.68k \xc4 $objstr", undef, "\xb6"), "\n";
$rsrc = &objects($p, "", "X.rsrc", undef);
$objstr = &objects($p, "X.68k.o", "", undef);
print &splitline("$prog.68k \xc4 $objstr $rsrc", undef, "\xb6"), "\n";
print &splitline("\tDuplicate -y $rsrc {Targ}", 69, "\xb6"), "\n";
print &splitline("\tILink -o {Targ} {LinkOptions_68K} " .
$objstr . " {Libs_68K}", 69, "\xb6"), "\n";
print &splitline("\tSetFile -a BM {Targ}", 69, "\xb6"), "\n\n";
$objstr = &objects($p, "X.cfm68k.o", undef, undef);
$objstr = &objects($p, "X.cfm68k.o", "", undef);
print &splitline("$prog.cfm68k \xc4 $objstr", undef, "\xb6"), "\n";
print &splitline("\tDuplicate -y $rsrc {Targ}", 69, "\xb6"), "\n";
print &splitline("\tILink -o {Targ} {LinkOptions_CFM68K} " .
$objstr . " {Libs_CFM68K}", 69, "\xb6"), "\n";
print &splitline("\tSetFile -a BM {Targ}", 69, "\xb6"), "\n\n";
$objstr = &objects($p, "X.ppc.o", undef, undef);
$objstr = &objects($p, "X.ppc.o", "", undef);
print &splitline("$prog.ppc \xc4 $objstr", undef, "\xb6"), "\n";
print &splitline("\tDuplicate -y $rsrc {Targ}", 69, "\xb6"), "\n";
print &splitline("\tPPCLink -o {Targ} {LinkOptions_PPC} " .
$objstr . " {Libs_PPC}", 69, "\xb6"), "\n";
print &splitline("\tSetFile -a BM {Targ}", 69, "\xb6"), "\n\n";
}
foreach $d (&deps("X.68k.o", undef, "::", ":")) {
foreach $d (&deps("", "X.rsrc", "::", ":")) {
next unless $d->{obj};
print &splitline(sprintf("%s \xc4 %s", $d->{obj}, join " ", @{$d->{deps}}),
undef, "\xb6"), "\n";
print "\tRez ", $d->{deps}->[0], " -o {Targ} {ROptions}\n\n";
}
foreach $d (&deps("X.68k.o", "", "::", ":")) {
next unless $d->{obj};
print &splitline(sprintf("%s \xc4 %s", $d->{obj}, join " ", @{$d->{deps}}),
undef, "\xb6"), "\n";
print "\t{C} ", $d->{deps}->[0], " -o {Targ} {COptions_68K}\n\n";
}
foreach $d (&deps("X.cfm68k.o", undef, "::", ":")) {
foreach $d (&deps("X.cfm68k.o", "", "::", ":")) {
next unless $d->{obj};
print &splitline(sprintf("%s \xc4 %s", $d->{obj}, join " ", @{$d->{deps}}),
undef, "\xb6"), "\n";
print "\t{C} ", $d->{deps}->[0], " -o {Targ} {COptions_CFM68K}\n\n";
}
foreach $d (&deps("X.ppc.o", undef, "::", ":")) {
foreach $d (&deps("X.ppc.o", "", "::", ":")) {
next unless $d->{obj};
print &splitline(sprintf("%s \xc4 %s", $d->{obj}, join " ", @{$d->{deps}}),
undef, "\xb6"), "\n";
# The odd stuff here seems to stop afpd getting confused.