1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-06-19 05:33:47 -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.
# Users of non-Mac systems will see some pretty strange characters around.
@ -7,8 +7,11 @@ MAKEFILE = Makefile.mpw
Includes =
Sym¥68K =
ObjDir¥68K =
Sym¥PPC =
ObjDir¥PPC =
COptions = {Includes} {Sym¥68K} -proto strict -opt all
PPCCOptions = {Includes} {Sym¥PPC} -opt size
Objects¥68K =
"{ObjDir¥68K}mac.c.o"
@ -26,11 +29,44 @@ Objects
"{ObjDir¥68K}terminal.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"
"{Libraries}MacRuntime.o"
"{Libraries}IntEnv.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}
IF (`exists {Targ}.NJ`)
ILink ¶
@ -55,43 +91,72 @@ PuTTY
"{ObjDir¥68K}mac.c.o" Ä {¥MondoBuild¥} mac.c putty.h mac.h macresid.h
{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
{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
{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
{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
{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
{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
{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
{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
{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
{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
{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
{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
{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
{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
* All rights reserved.
@ -73,8 +73,6 @@ static void mac_closewindow(WindowPtr);
static void mac_zoomwindow(WindowPtr, short);
static void mac_shutdown(void);
static void mac_newsession(void);
struct mac_windows {
WindowPtr terminal; /* XXX: Temporary */
WindowPtr about;
@ -118,6 +116,9 @@ static void mac_startup(void) {
/* Mac OS 8.5 Control Manager (proportional scrollbars)? */
if (Gestalt(gestaltControlMgrAttr, &mac_gestalts.cntlattr) != noErr)
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 */
if (mac_gestalts.apprvers != 0)
@ -139,7 +140,6 @@ static void mac_startup(void) {
static void mac_eventloop(void) {
Boolean gotevent;
EventRecord event;
int i;
RgnHandle cursrgn;
cursrgn = NewRgn();
@ -288,7 +288,6 @@ static int mac_windowtype(WindowPtr window) {
* Handle a key press
*/
static void mac_keypress(EventRecord *event) {
char key;
WindowPtr window;
if (event->what == keyDown && (event->modifiers & cmdKey)) {

7
mac.h
View File

@ -15,6 +15,7 @@ struct mac_gestalts {
long qdvers;
long apprvers;
long cntlattr;
long windattr;
};
extern struct mac_gestalts mac_gestalts;
@ -33,3 +34,9 @@ extern void mac_menuterm(WindowPtr, short, short);
extern void mac_loadconfig(Config *);
#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
* 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 void text_click(struct mac_session *, EventRecord *);
#ifdef USES_ROUTINE_DESCRIPTORS
#if TARGET_RT_MAC_CFM
static RoutineDescriptor mac_scrolltracker_upp =
BUILD_ROUTINE_DESCRIPTOR(uppControlActionProcInfo,
(ProcPtr)mac_scrolltracker);
@ -98,11 +98,11 @@ static RoutineDescriptor do_text_for_device_upp =
static RoutineDescriptor mac_set_attr_mask_upp =
BUILD_ROUTINE_DESCRIPTOR(uppDeviceLoopDrawingProcInfo,
(ProcPtr)mac_set_attr_mask);
#else /* not USES_ROUTINE_DESCRIPTORS */
#else /* not TARGET_RT_MAC_CFM */
#define mac_scrolltracker_upp mac_scrolltracker
#define do_text_for_device_upp do_text_for_device
#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
@ -143,7 +143,6 @@ static void display_resource(unsigned long type, short id) {
void mac_newsession(void) {
struct mac_session *s;
int i;
UInt32 starttime;
char msg[128];
@ -225,20 +224,29 @@ 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) {
if (s->wctab == NULL)
s->wctab = (WCTabHandle)NewHandle(sizeof(**s->wctab));
if (s->wctab == NULL)
return; /* do without */
(*s->wctab)->wCSeed = 0;
(*s->wctab)->wCReserved = 0;
(*s->wctab)->ctSize = 0;
(*s->wctab)->ctTable[0].value = wContentColor;
(*s->wctab)->ctTable[0].rgb = (*s->palette)->pmInfo[DEFAULT_BG].ciRGB;
SetWinColor(s->window, s->wctab);
#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)
s->wctab = (WCTabHandle)NewHandle(sizeof(**s->wctab));
if (s->wctab == NULL)
return; /* do without */
(*s->wctab)->wCSeed = 0;
(*s->wctab)->wCReserved = 0;
(*s->wctab)->ctSize = 0;
(*s->wctab)->ctTable[0].value = wContentColor;
(*s->wctab)->ctTable[0].rgb = (*s->palette)->pmInfo[DEFAULT_BG].ciRGB;
SetWinColor(s->window, s->wctab);
}
}
/*
@ -479,7 +487,6 @@ void mac_keyterm(WindowPtr window, EventRecord *event) {
unsigned char buf[20];
int len;
struct mac_session *s;
int i;
s = (struct mac_session *)GetWRefCon(window);
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,
unsigned long attr) {
int style = 0;
int bgcolour, fgcolour;
RGBColor rgbfore, rgbback;
struct do_text_args a;
RgnHandle textrgn;

View File

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