1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-06-19 13:38:01 -05:00

General cleanup because MrC is rather pickier than SC. Not that the PPC build

actually links, you understand, but it does most of the rest of the things it
should.

[originally from svn r130]
This commit is contained in:
Ben Harris 1999-03-27 15:39:46 +00:00
parent 43e84b26ef
commit 04aceed7bf
5 changed files with 102 additions and 26 deletions

View File

@ -1,4 +1,4 @@
# $Id: Makefile.mpw,v 1.1.2.3 1999/03/16 20:27:30 ben Exp $ # $Id: Makefile.mpw,v 1.1.2.4 1999/03/27 15:39:45 ben Exp $
# This is the Makefile for building PuTTY for the Mac OS. # This is the Makefile for building PuTTY for the Mac OS.
# Users of non-Mac systems will see some pretty strange characters around. # Users of non-Mac systems will see some pretty strange characters around.
@ -7,8 +7,11 @@ MAKEFILE = Makefile.mpw
Includes = Includes =
Sym¥68K = Sym¥68K =
ObjDir¥68K = ObjDir¥68K =
Sym¥PPC =
ObjDir¥PPC =
COptions = {Includes} {Sym¥68K} -proto strict -opt all COptions = {Includes} {Sym¥68K} -proto strict -opt all
PPCCOptions = {Includes} {Sym¥PPC} -opt size
Objects¥68K = Objects¥68K =
"{ObjDir¥68K}mac.c.o" "{ObjDir¥68K}mac.c.o"
@ -26,11 +29,44 @@ Objects
"{ObjDir¥68K}terminal.c.o" "{ObjDir¥68K}terminal.c.o"
"{ObjDir¥68K}testback.c.o" "{ObjDir¥68K}testback.c.o"
Objects¥PPC =
"{ObjDir¥PPC}mac.c.x"
"{ObjDir¥PPC}maccfg.c.x"
"{ObjDir¥PPC}macterm.c.x"
"{ObjDir¥PPC}misc.c.x"
# "{ObjDir¥PPC}ssh.c.x" ¶
# "{ObjDir¥PPC}sshcrc.c.x" ¶
# "{ObjDir¥PPC}sshdes.c.x" ¶
# "{ObjDir¥PPC}sshmd5.c.x" ¶
# "{ObjDir¥PPC}sshrand.c.x" ¶
# "{ObjDir¥PPC}sshrsa.c.x" ¶
# "{ObjDir¥PPC}sshsha.c.x" ¶
# "{ObjDir¥PPC}telnet.c.x" ¶
"{ObjDir¥PPC}terminal.c.x"
"{ObjDir¥PPC}testback.c.x"
Libs¥68K = "{CLibraries}StdCLib.o" Libs¥68K = "{CLibraries}StdCLib.o"
"{Libraries}MacRuntime.o" "{Libraries}MacRuntime.o"
"{Libraries}IntEnv.o" "{Libraries}IntEnv.o"
"{Libraries}Interface.o" "{Libraries}Interface.o"
Libs¥PPC = "{SharedLibraries}InterfaceLib"
"{SharedLibraries}StdCLib"
"{SharedLibraries}MathLib"
"{PPCLibraries}StdCRuntime.o"
"{PPCLibraries}PPCCRuntime.o"
"{PPCLibraries}PPCToolLibs.o"
PuTTY.ppc ÄÄ {¥MondoBuild¥} {Objects¥PPC}
PPCLink ¶
-o {Targ} {Sym¥PPC}
{Objects¥PPC}
-t 'APPL'
-c 'pTTY'
{Libs¥PPC}
PuTTY ÄÄ {Objects¥68K} {Libs¥68K} PuTTY ÄÄ {Objects¥68K} {Libs¥68K}
IF (`exists {Targ}.NJ`) IF (`exists {Targ}.NJ`)
ILink ¶ ILink ¶
@ -55,43 +91,72 @@ PuTTY
"{ObjDir¥68K}mac.c.o" Ä {¥MondoBuild¥} mac.c putty.h mac.h macresid.h "{ObjDir¥68K}mac.c.o" Ä {¥MondoBuild¥} mac.c putty.h mac.h macresid.h
{C} mac.c -o {Targ} {COptions} {C} mac.c -o {Targ} {COptions}
"{ObjDir¥PPC}mac.c.x" Ä {¥MondoBuild¥} mac.c putty.h mac.h macresid.h
{PPCC} mac.c -o {Targ} {PPCCOptions}
"{ObjDir¥68K}maccfg.c.o" Ä {¥MondoBuild¥} maccfg.c putty.h mac.h macresid.h "{ObjDir¥68K}maccfg.c.o" Ä {¥MondoBuild¥} maccfg.c putty.h mac.h macresid.h
{C} maccfg.c -o {Targ} {COptions} {C} maccfg.c -o {Targ} {COptions}
"{ObjDir¥PPC}maccfg.c.x" Ä {¥MondoBuild¥} maccfg.c putty.h mac.h macresid.h
{PPCC} maccfg.c -o {Targ} {PPCCoptions}
"{ObjDir¥68K}macterm.c.o" Ä {¥MondoBuild¥} macterm.c mac.h putty.h "{ObjDir¥68K}macterm.c.o" Ä {¥MondoBuild¥} macterm.c mac.h putty.h
{C} macterm.c -o {Targ} {COptions} {C} macterm.c -o {Targ} {COptions}
"{ObjDir¥PPC}macterm.c.x" Ä {¥MondoBuild¥} macterm.c mac.h putty.h
{PPCC} macterm.c -o {Targ} {PPCCoptions}
"{ObjDir¥68K}misc.c.o" Ä {¥MondoBuild¥} misc.c putty.h "{ObjDir¥68K}misc.c.o" Ä {¥MondoBuild¥} misc.c putty.h
{C} misc.c -o {Targ} {COptions} {C} misc.c -o {Targ} {COptions}
"{ObjDir¥PPC}misc.c.x" Ä {¥MondoBuild¥} misc.c putty.h
{PPCC} misc.c -o {Targ} {PPCCoptions}
"{ObjDir¥68K}ssh.c.o" Ä {¥MondoBuild¥} ssh.c "{ObjDir¥68K}ssh.c.o" Ä {¥MondoBuild¥} ssh.c
{C} ssh.c -o {Targ} {COptions} {C} ssh.c -o {Targ} {COptions}
"{ObjDir¥PPC}ssh.c.x" Ä {¥MondoBuild¥} ssh.c
{PPCC} ssh.c -o {Targ} {PPCCoptions}
"{ObjDir¥68K}sshcrc.c.o" Ä {¥MondoBuild¥} sshcrc.c "{ObjDir¥68K}sshcrc.c.o" Ä {¥MondoBuild¥} sshcrc.c
{C} sshcrc.c -o {Targ} {COptions} {C} sshcrc.c -o {Targ} {COptions}
"{ObjDir¥PPC}sshcrc.c.x" Ä {¥MondoBuild¥} sshcrc.c
{PPCC} sshcrc.c -o {Targ} {PPCCoptions}
"{ObjDir¥68K}sshdes.c.o" Ä {¥MondoBuild¥} sshdes.c "{ObjDir¥68K}sshdes.c.o" Ä {¥MondoBuild¥} sshdes.c
{C} sshdes.c -o {Targ} {COptions} {C} sshdes.c -o {Targ} {COptions}
"{ObjDir¥PPC}sshdes.c.x" Ä {¥MondoBuild¥} sshdes.c
{PPCC} sshdes.c -o {Targ} {PPCCoptions}
"{ObjDir¥68K}sshmd5.c.o" Ä {¥MondoBuild¥} sshmd5.c "{ObjDir¥68K}sshmd5.c.o" Ä {¥MondoBuild¥} sshmd5.c
{C} sshmd5.c -o {Targ} {COptions} {C} sshmd5.c -o {Targ} {COptions}
"{ObjDir¥PPC}sshmd5.c.x" Ä {¥MondoBuild¥} sshmd5.c
{PPCC} sshmd5.c -o {Targ} {PPCCoptions}
"{ObjDir¥68K}sshrand.c.o" Ä {¥MondoBuild¥} sshrand.c "{ObjDir¥68K}sshrand.c.o" Ä {¥MondoBuild¥} sshrand.c
{C} sshrand.c -o {Targ} {COptions} {C} sshrand.c -o {Targ} {COptions}
"{ObjDir¥PPC}sshrand.c.x" Ä {¥MondoBuild¥} sshrand.c
{PPCC} sshrand.c -o {Targ} {PPCCoptions}
"{ObjDir¥68K}sshrsa.c.o" Ä {¥MondoBuild¥} sshrsa.c "{ObjDir¥68K}sshrsa.c.o" Ä {¥MondoBuild¥} sshrsa.c
{C} sshrsa.c -o {Targ} {COptions} {C} sshrsa.c -o {Targ} {COptions}
"{ObjDir¥PPC}sshrsa.c.x" Ä {¥MondoBuild¥} sshrsa.c
{PPCC} sshrsa.c -o {Targ} {PPCCoptions}
"{ObjDir¥68K}sshsha.c.o" Ä {¥MondoBuild¥} sshsha.c "{ObjDir¥68K}sshsha.c.o" Ä {¥MondoBuild¥} sshsha.c
{C} sshsha.c -o {Targ} {COptions} {C} sshsha.c -o {Targ} {COptions}
"{ObjDir¥PPC}sshsha.c.x" Ä {¥MondoBuild¥} sshsha.c
{PPCC} sshsha.c -o {Targ} {PPCCoptions}
"{ObjDir¥68K}telnet.c.o" Ä {¥MondoBuild¥} telnet.c "{ObjDir¥68K}telnet.c.o" Ä {¥MondoBuild¥} telnet.c
{C} telnet.c -o {Targ} {COptions} {C} telnet.c -o {Targ} {COptions}
"{ObjDir¥PPC}telnet.c.x" Ä {¥MondoBuild¥} telnet.c
{PPCC} telnet.c -o {Targ} {PPCCoptions}
"{ObjDir¥68K}terminal.c.o" Ä {¥MondoBuild¥} terminal.c putty.h "{ObjDir¥68K}terminal.c.o" Ä {¥MondoBuild¥} terminal.c putty.h
{C} terminal.c -o {Targ} {COptions} {C} terminal.c -o {Targ} {COptions}
"{ObjDir¥PPC}terminal.c.x" Ä {¥MondoBuild¥} terminal.c putty.h
{PPCC} terminal.c -o {Targ} {PPCCoptions}
"{ObjDir¥68K}testback.c.o" Ä {¥MondoBuild¥} testback.c putty.h "{ObjDir¥68K}testback.c.o" Ä {¥MondoBuild¥} testback.c putty.h
{C} testback.c -o {Targ} {COptions} {C} testback.c -o {Targ} {COptions}
"{ObjDir¥PPC}testback.c.x" Ä {¥MondoBuild¥} testback.c putty.h
{PPCC} testback.c -o {Targ} {PPCCoptions}

9
mac.c
View File

@ -1,4 +1,4 @@
/* $Id: mac.c,v 1.1.2.17 1999/03/21 23:23:42 ben Exp $ */ /* $Id: mac.c,v 1.1.2.18 1999/03/27 15:39:45 ben Exp $ */
/* /*
* Copyright (c) 1999 Ben Harris * Copyright (c) 1999 Ben Harris
* All rights reserved. * All rights reserved.
@ -73,8 +73,6 @@ static void mac_closewindow(WindowPtr);
static void mac_zoomwindow(WindowPtr, short); static void mac_zoomwindow(WindowPtr, short);
static void mac_shutdown(void); static void mac_shutdown(void);
static void mac_newsession(void);
struct mac_windows { struct mac_windows {
WindowPtr terminal; /* XXX: Temporary */ WindowPtr terminal; /* XXX: Temporary */
WindowPtr about; WindowPtr about;
@ -118,6 +116,9 @@ static void mac_startup(void) {
/* Mac OS 8.5 Control Manager (proportional scrollbars)? */ /* Mac OS 8.5 Control Manager (proportional scrollbars)? */
if (Gestalt(gestaltControlMgrAttr, &mac_gestalts.cntlattr) != noErr) if (Gestalt(gestaltControlMgrAttr, &mac_gestalts.cntlattr) != noErr)
mac_gestalts.cntlattr = 0; mac_gestalts.cntlattr = 0;
/* Mac OS 8.5 Window Manager? */
if (Gestalt(gestaltWindowMgrAttr, &mac_gestalts.windattr) != noErr)
mac_gestalts.windattr = 0;
/* We've been tested with the Appearance Manager */ /* We've been tested with the Appearance Manager */
if (mac_gestalts.apprvers != 0) if (mac_gestalts.apprvers != 0)
@ -139,7 +140,6 @@ static void mac_startup(void) {
static void mac_eventloop(void) { static void mac_eventloop(void) {
Boolean gotevent; Boolean gotevent;
EventRecord event; EventRecord event;
int i;
RgnHandle cursrgn; RgnHandle cursrgn;
cursrgn = NewRgn(); cursrgn = NewRgn();
@ -288,7 +288,6 @@ static int mac_windowtype(WindowPtr window) {
* Handle a key press * Handle a key press
*/ */
static void mac_keypress(EventRecord *event) { static void mac_keypress(EventRecord *event) {
char key;
WindowPtr window; WindowPtr window;
if (event->what == keyDown && (event->modifiers & cmdKey)) { if (event->what == keyDown && (event->modifiers & cmdKey)) {

7
mac.h
View File

@ -15,6 +15,7 @@ struct mac_gestalts {
long qdvers; long qdvers;
long apprvers; long apprvers;
long cntlattr; long cntlattr;
long windattr;
}; };
extern struct mac_gestalts mac_gestalts; extern struct mac_gestalts mac_gestalts;
@ -33,3 +34,9 @@ extern void mac_menuterm(WindowPtr, short, short);
extern void mac_loadconfig(Config *); extern void mac_loadconfig(Config *);
#endif #endif
/*
* Local Variables:
* c-file-style: "simon"
* End:
*/

View File

@ -1,4 +1,4 @@
/* $Id: macterm.c,v 1.1.2.28 1999/03/23 00:43:46 ben Exp $ */ /* $Id: macterm.c,v 1.1.2.29 1999/03/27 15:39:45 ben Exp $ */
/* /*
* Copyright (c) 1999 Ben Harris * Copyright (c) 1999 Ben Harris
* All rights reserved. * All rights reserved.
@ -88,7 +88,7 @@ static pascal void mac_set_attr_mask(short, short, GDHandle, long);
static int mac_keytrans(struct mac_session *, EventRecord *, unsigned char *); static int mac_keytrans(struct mac_session *, EventRecord *, unsigned char *);
static void text_click(struct mac_session *, EventRecord *); static void text_click(struct mac_session *, EventRecord *);
#ifdef USES_ROUTINE_DESCRIPTORS #if TARGET_RT_MAC_CFM
static RoutineDescriptor mac_scrolltracker_upp = static RoutineDescriptor mac_scrolltracker_upp =
BUILD_ROUTINE_DESCRIPTOR(uppControlActionProcInfo, BUILD_ROUTINE_DESCRIPTOR(uppControlActionProcInfo,
(ProcPtr)mac_scrolltracker); (ProcPtr)mac_scrolltracker);
@ -98,11 +98,11 @@ static RoutineDescriptor do_text_for_device_upp =
static RoutineDescriptor mac_set_attr_mask_upp = static RoutineDescriptor mac_set_attr_mask_upp =
BUILD_ROUTINE_DESCRIPTOR(uppDeviceLoopDrawingProcInfo, BUILD_ROUTINE_DESCRIPTOR(uppDeviceLoopDrawingProcInfo,
(ProcPtr)mac_set_attr_mask); (ProcPtr)mac_set_attr_mask);
#else /* not USES_ROUTINE_DESCRIPTORS */ #else /* not TARGET_RT_MAC_CFM */
#define mac_scrolltracker_upp mac_scrolltracker #define mac_scrolltracker_upp mac_scrolltracker
#define do_text_for_device_upp do_text_for_device #define do_text_for_device_upp do_text_for_device
#define mac_set_attr_mask_upp mac_set_attr_mask #define mac_set_attr_mask_upp mac_set_attr_mask
#endif /* not USES_ROUTINE_DESCRIPTORS */ #endif /* not TARGET_RT_MAC_CFM */
/* /*
* Temporary hack till I get the terminal emulator supporting multiple * Temporary hack till I get the terminal emulator supporting multiple
@ -143,7 +143,6 @@ static void display_resource(unsigned long type, short id) {
void mac_newsession(void) { void mac_newsession(void) {
struct mac_session *s; struct mac_session *s;
int i;
UInt32 starttime; UInt32 starttime;
char msg[128]; char msg[128];
@ -225,10 +224,18 @@ static void mac_initpalette(struct mac_session *s) {
} }
/* /*
* I don't think this is (a) safe or (b) a good way to do this. * Set the background colour of the window correctly. Should be
* called whenever the default background changes.
*/ */
static void mac_adjustwinbg(struct mac_session *s) { static void mac_adjustwinbg(struct mac_session *s) {
#if 0 /* XXX doesn't link (at least for 68k) */
if (mac_gestalts.windattr & gestaltWindowMgrPresent)
SetWindowContentColor(s->window,
&(*s->palette)->pmInfo[DEFAULT_BG].ciRGB);
else
#endif
{
if (s->wctab == NULL) if (s->wctab == NULL)
s->wctab = (WCTabHandle)NewHandle(sizeof(**s->wctab)); s->wctab = (WCTabHandle)NewHandle(sizeof(**s->wctab));
if (s->wctab == NULL) if (s->wctab == NULL)
@ -239,6 +246,7 @@ static void mac_adjustwinbg(struct mac_session *s) {
(*s->wctab)->ctTable[0].value = wContentColor; (*s->wctab)->ctTable[0].value = wContentColor;
(*s->wctab)->ctTable[0].rgb = (*s->palette)->pmInfo[DEFAULT_BG].ciRGB; (*s->wctab)->ctTable[0].rgb = (*s->palette)->pmInfo[DEFAULT_BG].ciRGB;
SetWinColor(s->window, s->wctab); SetWinColor(s->window, s->wctab);
}
} }
/* /*
@ -479,7 +487,6 @@ void mac_keyterm(WindowPtr window, EventRecord *event) {
unsigned char buf[20]; unsigned char buf[20];
int len; int len;
struct mac_session *s; struct mac_session *s;
int i;
s = (struct mac_session *)GetWRefCon(window); s = (struct mac_session *)GetWRefCon(window);
len = mac_keytrans(s, event, buf); len = mac_keytrans(s, event, buf);
@ -702,8 +709,6 @@ struct do_text_args {
void do_text(struct mac_session *s, int x, int y, char *text, int len, void do_text(struct mac_session *s, int x, int y, char *text, int len,
unsigned long attr) { unsigned long attr) {
int style = 0; int style = 0;
int bgcolour, fgcolour;
RGBColor rgbfore, rgbback;
struct do_text_args a; struct do_text_args a;
RgnHandle textrgn; RgnHandle textrgn;

View File

@ -7,7 +7,7 @@ Echo "# `Date -t` ----- Build of {program}."
Echo "# `Date -t` ----- Analyzing dependencies." Echo "# `Date -t` ----- Analyzing dependencies."
Begin Begin
Echo "Set Echo 1" Echo "Set Echo 1"
Make {"Parameters"} -f "{makefile}" Make "{program}" {"Parameters"} -f "{makefile}"
End > "{program}".makeout End > "{program}".makeout
Echo "# `Date -t` ----- Executing build commands." Echo "# `Date -t` ----- Executing build commands."
"{program}".makeout "{program}".makeout