Closed Bug 75136 Opened 23 years ago Closed 23 years ago

CodeWarrior 6 needs Carbonized RunTSScript Compiler for Mac OS X

Categories

(SeaMonkey :: Build Config, defect)

PowerPC
macOS
defect
Not set
blocker

Tracking

(Not tracked)

VERIFIED DUPLICATE of bug 40013

People

(Reporter: lordpixel, Assigned: jj.enser)

References

Details

We need a Carbon version of the RunTSScript CodeWarrior compiler, as its required 
by NSStdLib to make the 'Stubs' target. Currently this compiler is in CVS at 
mozilla/build/mac/RunTSScript.

Did Netscape develop this? Where does it come from, how do I get the source to be 
able to carbonise it?
Blocks: 53682
Mac.
Assignee: cls → jj
Was talking to Patrick Beard about this. Since all we do with RunTS (and indeed
with ToolServer) is run the MakeStub tool in MPW to make the Stub library
required to compile everything else, it might be easier to replace MakeStub and
thus eliminate ToolServer altogether!

As Patrick explained to me what MakeStub does isn't complex. It takes a list of
SYMBOLS in a .exp file, and converts it to a .c file, with lines of the form
exten void $SYMBOL() =0;

Compile this .c and you have your stubs library.

There are 2 possible ways to replace this - either do it in Perl (and run it in
MacPerl on MacOS9 and X or using OS X's command line perl), or do it in C and
make a plugin CodeWarrior compiler 'MozMakeStub'.

Digging around on the net I came accross this on a BeOS mailing list. The author
said he just typed it into the email so it probably doesn't compile, but it
shows how simple the code is... there's a sample plugins folder in the
CodeWarrior SDK which for 6 allows you to build Classic and Carbon CodeWarrior
plugins. Should be a snap to adapt this code:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int nfuncs;
char * funcs[4096];

int
main(
int argc,
char * argv[])
{
int ix;
for (ix=1; ix<argc; ix++) {
FILE * f = fopen(argv[ix], "r");
if (!f) {
perror(argv[ix]);
}
else {
char * ptr;
char line[1024];
while (1) {
line[0] = 0;
fgets(line, 1024, f);
if (!line[0]) {
break;
}
if (line[0] == '#') {
continue;
}
ptr = &line[strlen(line)-1];
*ptr = 0; /* nuke NL */
funcs[nfuncs] = strdup(line);
nfuncs++;
}
}
}
printf("#pragma export on\n");
for (ix=0; ix<nfuncs; ix++) {
printf("extern \"C\" void %s(void);\n", funcs[ix]);
}
printf("#pragma export reset\n");
for (ix=0; ix<nfuncs; ix++) {
printf("void %s(void) {}\n", funcs[ix]);
}
return 0;
}
scc wrote RunTSScript. But I think we should eliminate the ToolServer dependency 
altogether; see bug 40013
Ok, let's dupe this onto that, since that's a better solution than fixing this
and it'll remove the need to fix this.

*** This bug has been marked as a duplicate of 40013 ***
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
verified.
Status: RESOLVED → VERIFIED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.