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

Initial checkin of a native Mac OS X port, sharing most of its code

with the Unix port and layering a Cocoa GUI on top. The basics all
work: there's a configuration panel and a terminal window, the
timing interface works and the select interface functions. The same
application can run both SSH (or other network) connections and
local pty sessions, and multiple sessions in the same process are
fully supported.

However, it's horribly unfinished in a wide variety of other ways;
anyone interested is invited to read README.OSX and wince at the
length and content of its `unfinished' list.

[originally from svn r5308]
This commit is contained in:
Simon Tatham 2005-02-15 21:45:50 +00:00
parent 0fb46d3a0a
commit 46bfde32e8
12 changed files with 5113 additions and 32 deletions

20
Recipe
View File

@ -19,11 +19,13 @@
!makefile lcc windows/Makefile.lcc
!makefile gtk unix/Makefile.gtk
!makefile mpw mac/Makefile.mpw
!makefile osx macosx/Makefile
# Source directories.
!srcdir charset/
!srcdir windows/
!srcdir unix/
!srcdir mac/
!srcdir macosx/
# Help text added to the top of each Makefile, with /D converted
# into -D as appropriate for the particular Makefile.
@ -174,6 +176,9 @@ install:
install-strip:
$(MAKE) install INSTALL_PROGRAM="$(INSTALL_PROGRAM) -s"
!end
!begin osx
CFLAGS += -DMACOSX
!end
# ------------------------------------------------------------
# Definitions of object groups. A group name, followed by an =,
@ -190,8 +195,9 @@ GUITERM = TERMINAL window windlg winctrls sizetip winucs winprint
+ winutils wincfg
# Same thing on Unix.
UXTERM = TERMINAL gtkwin gtkdlg gtkcols gtkpanel gtkcfg uxcfg uxucs uxprint
+ xkeysym timing
UXTERM = TERMINAL uxcfg uxucs uxprint timing
GTKTERM = UXTERM gtkwin gtkcfg gtkdlg gtkcols gtkpanel xkeysym
OSXTERM = UXTERM osxwin osxdlg osxctrls
# Non-SSH back ends (putty, puttytel, plink).
NONSSH = telnet raw rlogin ldisc pinger
@ -212,6 +218,7 @@ SFTP = sftp int64 logging
MISC = timing misc version settings tree234 proxy
WINMISC = MISC winstore winnet cmdline windefs winmisc pproxy wintime
UXMISC = MISC uxstore uxsel uxnet cmdline uxmisc uxproxy time
OSXMISC = MISC uxstore uxsel osxsel uxnet uxmisc uxproxy time
MACMISC = MISC macstore macnet mtcpnet otnet macmisc macabout pproxy
# Character set library, for use in pterm.
@ -251,11 +258,11 @@ puttygen : [G] winpgen sshrsag sshdssg sshprime sshdes sshbn sshmd5 version
+ sshpubk sshaes sshsh512 import winutils puttygen.res tree234
+ notiming LIBS wintime
pterm : [X] UXTERM uxmisc misc ldisc settings uxpty uxsel BE_NONE uxstore
pterm : [X] GTKTERM uxmisc misc ldisc settings uxpty uxsel BE_NONE uxstore
+ uxsignal CHARSET cmdline uxpterm version time
putty : [X] UXTERM uxmisc misc ldisc settings uxsel BE_ALL uxstore
putty : [X] GTKTERM uxmisc misc ldisc settings uxsel BE_ALL uxstore
+ uxsignal CHARSET uxputty NONSSH UXSSH UXMISC ux_x11
puttytel : [X] UXTERM uxmisc misc ldisc settings uxsel BE_NOSSH
puttytel : [X] GTKTERM uxmisc misc ldisc settings uxsel BE_NOSSH
+ uxstore uxsignal CHARSET uxputty NONSSH UXMISC
plink : [U] uxplink uxcons NONSSH UXSSH BE_ALL logging UXMISC uxsignal ux_x11
@ -277,3 +284,6 @@ PuTTYtel : [M] terminal wcwidth ldiscucs logging BE_NOSSH mac macdlg
PuTTYgen : [M] macpgen sshrsag sshdssg sshprime sshdes sshbn sshmd5 version
+ sshrand macnoise sshsha macstore misc sshrsa sshdss macmisc sshpubk
+ sshaes sshsh512 import macpgen.rsrc macpgkey macabout
PuTTY : [MX] osxmain OSXTERM OSXMISC CHARSET BE_ALL NONSSH UXSSH
+ ux_x11 uxpty uxsignal testback

789
macosx/Makefile Normal file
View File

@ -0,0 +1,789 @@
# Makefile for putty under Mac OS X.
#
# This file was created by `mkfiles.pl' from the `Recipe' file.
# DO NOT EDIT THIS FILE DIRECTLY; edit Recipe or mkfiles.pl instead.
#
# Extra options you can set:
#
# - VER=-DSNAPSHOT=1999-01-25
# Generates executables whose About box report them as being a
# development snapshot.
#
# - VER=-DRELEASE=0.43
# Generates executables whose About box report them as being a
# release version.
#
# - COMPAT=-DAUTO_WINSOCK
# Causes PuTTY to assume that <windows.h> includes its own WinSock
# header file, so that it won't try to include <winsock.h>.
#
# - COMPAT=-DWINSOCK_TWO
# Causes the PuTTY utilities to include <winsock2.h> instead of
# <winsock.h>, except Plink which _needs_ WinSock 2 so it already
# does this.
#
# - COMPAT=-DNO_SECURITY
# Disables Pageant's use of <aclapi.h>, which is not available
# with some development environments (such as older versions of
# the Cygwin/mingw GNU toolchain). This means that Pageant
# won't care about the local user ID of processes accessing it; a
# version of Pageant built with this option will therefore refuse
# to run under NT-series OSes on security grounds (although it
# will run fine on Win95-series OSes where there is no access
# control anyway).
#
# - COMPAT=-DNO_MULTIMON
# Disables PuTTY's use of <multimon.h>, which is not available
# with some development environments. This means that PuTTY's
# full-screen mode (configurable to work on Alt-Enter) will
# not behave usefully in a multi-monitor environment.
#
# Note that this definition is always enabled in the Cygwin
# build, since at the time of writing this <multimon.h> is
# known not to be available in Cygwin.
#
# - COMPAT=-DNO_IPV6
# Disables PuTTY's ability to make IPv6 connections, enabling
# it to compile under development environments which do not
# support IPv6 in their header files.
#
# - COMPAT=-DMSVC4
# - RCFL=-DMSVC4
# Makes a couple of minor changes so that PuTTY compiles using
# MSVC 4. You will also need /DNO_SECURITY and /DNO_MULTIMON.
#
# - RCFL=-DASCIICTLS
# Uses ASCII rather than Unicode to specify the tab control in
# the resource file. Probably most useful when compiling with
# Cygnus/mingw32, whose resource compiler may have less of a
# problem with it.
#
# - XFLAGS=-DTELNET_DEFAULT
# Causes PuTTY to default to the Telnet protocol (in the absence
# of Default Settings and so on to the contrary). Normally PuTTY
# will default to SSH.
#
# - XFLAGS=-DDEBUG
# Causes PuTTY to enable internal debugging.
#
# - XFLAGS=-DMALLOC_LOG
# Causes PuTTY to emit a file called putty_mem.log, logging every
# memory allocation and free, so you can track memory leaks.
#
# - XFLAGS=-DMINEFIELD
# Causes PuTTY to use a custom memory allocator, similar in
# concept to Electric Fence, in place of regular malloc(). Wastes
# huge amounts of RAM, but should cause heap-corruption bugs to
# show up as GPFs at the point of failure rather than appearing
# later on as second-level damage.
#
CC = $(TOOLPATH)gcc
CFLAGS = -O2 -Wall -Werror -g -I.././ -I../charset/ -I../windows/ -I../unix/ \
-I../mac/ -I../macosx/
MLDFLAGS = -framework Cocoa
ULDFLAGS =
all: PuTTY plink pscp psftp puttygen
CFLAGS += -DMACOSX
PuTTY.app:
mkdir -p $@
PuTTY.app/Contents: PuTTY.app
mkdir -p $@
PuTTY.app/Contents/MacOS: PuTTY.app/Contents
mkdir -p $@
PuTTY: PuTTY.app/Contents/MacOS/PuTTY $(PuTTY_extra)
PuTTY.app/Contents/MacOS/PuTTY: PuTTY.app/Contents/MacOS be_all.o config.o \
cproxy.o dialog.o fromucs.o ldisc.o ldiscucs.o localenc.o \
logging.o macenc.o mimeenc.o minibidi.o misc.o osxctrls.o \
osxdlg.o osxmain.o osxsel.o osxwin.o pinger.o portfwd.o \
proxy.o raw.o rlogin.o sbcs.o sbcsdat.o settings.o slookup.o \
ssh.o sshaes.o sshblowf.o sshbn.o sshcrc.o sshcrcda.o \
sshdes.o sshdh.o sshdss.o sshmd5.o sshpubk.o sshrand.o \
sshrsa.o sshsh512.o sshsha.o sshzlib.o telnet.o terminal.o \
testback.o time.o timing.o toucs.o tree234.o utf8.o ux_x11.o \
uxagentc.o uxcfg.o uxmisc.o uxnet.o uxnoise.o uxprint.o \
uxproxy.o uxpty.o uxsel.o uxsignal.o uxstore.o uxucs.o \
version.o wcwidth.o wildcard.o x11fwd.o xenc.o
$(CC) $(MLDFLAGS) -o $@ be_all.o config.o cproxy.o dialog.o \
fromucs.o ldisc.o ldiscucs.o localenc.o logging.o macenc.o \
mimeenc.o minibidi.o misc.o osxctrls.o osxdlg.o osxmain.o \
osxsel.o osxwin.o pinger.o portfwd.o proxy.o raw.o rlogin.o \
sbcs.o sbcsdat.o settings.o slookup.o ssh.o sshaes.o \
sshblowf.o sshbn.o sshcrc.o sshcrcda.o sshdes.o sshdh.o \
sshdss.o sshmd5.o sshpubk.o sshrand.o sshrsa.o sshsh512.o \
sshsha.o sshzlib.o telnet.o terminal.o testback.o time.o \
timing.o toucs.o tree234.o utf8.o ux_x11.o uxagentc.o \
uxcfg.o uxmisc.o uxnet.o uxnoise.o uxprint.o uxproxy.o \
uxpty.o uxsel.o uxsignal.o uxstore.o uxucs.o version.o \
wcwidth.o wildcard.o x11fwd.o xenc.o
plink: be_all.o cmdline.o cproxy.o ldisc.o logging.o misc.o pinger.o \
portfwd.o proxy.o raw.o rlogin.o settings.o ssh.o sshaes.o \
sshblowf.o sshbn.o sshcrc.o sshcrcda.o sshdes.o sshdh.o \
sshdss.o sshmd5.o sshpubk.o sshrand.o sshrsa.o sshsh512.o \
sshsha.o sshzlib.o telnet.o time.o timing.o tree234.o \
ux_x11.o uxagentc.o uxcons.o uxmisc.o uxnet.o uxnoise.o \
uxplink.o uxproxy.o uxsel.o uxsignal.o uxstore.o version.o \
wildcard.o x11fwd.o
$(CC) $(ULDFLAGS) -o $@ be_all.o cmdline.o cproxy.o ldisc.o \
logging.o misc.o pinger.o portfwd.o proxy.o raw.o rlogin.o \
settings.o ssh.o sshaes.o sshblowf.o sshbn.o sshcrc.o \
sshcrcda.o sshdes.o sshdh.o sshdss.o sshmd5.o sshpubk.o \
sshrand.o sshrsa.o sshsh512.o sshsha.o sshzlib.o telnet.o \
time.o timing.o tree234.o ux_x11.o uxagentc.o uxcons.o \
uxmisc.o uxnet.o uxnoise.o uxplink.o uxproxy.o uxsel.o \
uxsignal.o uxstore.o version.o wildcard.o x11fwd.o
pscp: be_none.o cmdline.o cproxy.o int64.o logging.o misc.o pinger.o \
portfwd.o proxy.o pscp.o settings.o sftp.o ssh.o sshaes.o \
sshblowf.o sshbn.o sshcrc.o sshcrcda.o sshdes.o sshdh.o \
sshdss.o sshmd5.o sshpubk.o sshrand.o sshrsa.o sshsh512.o \
sshsha.o sshzlib.o time.o timing.o tree234.o uxagentc.o \
uxcons.o uxmisc.o uxnet.o uxnoise.o uxproxy.o uxsel.o \
uxsftp.o uxstore.o version.o wildcard.o x11fwd.o
$(CC) $(ULDFLAGS) -o $@ be_none.o cmdline.o cproxy.o int64.o \
logging.o misc.o pinger.o portfwd.o proxy.o pscp.o \
settings.o sftp.o ssh.o sshaes.o sshblowf.o sshbn.o sshcrc.o \
sshcrcda.o sshdes.o sshdh.o sshdss.o sshmd5.o sshpubk.o \
sshrand.o sshrsa.o sshsh512.o sshsha.o sshzlib.o time.o \
timing.o tree234.o uxagentc.o uxcons.o uxmisc.o uxnet.o \
uxnoise.o uxproxy.o uxsel.o uxsftp.o uxstore.o version.o \
wildcard.o x11fwd.o
psftp: be_none.o cmdline.o cproxy.o int64.o logging.o misc.o pinger.o \
portfwd.o proxy.o psftp.o settings.o sftp.o ssh.o sshaes.o \
sshblowf.o sshbn.o sshcrc.o sshcrcda.o sshdes.o sshdh.o \
sshdss.o sshmd5.o sshpubk.o sshrand.o sshrsa.o sshsh512.o \
sshsha.o sshzlib.o time.o timing.o tree234.o uxagentc.o \
uxcons.o uxmisc.o uxnet.o uxnoise.o uxproxy.o uxsel.o \
uxsftp.o uxstore.o version.o wildcard.o x11fwd.o
$(CC) $(ULDFLAGS) -o $@ be_none.o cmdline.o cproxy.o int64.o \
logging.o misc.o pinger.o portfwd.o proxy.o psftp.o \
settings.o sftp.o ssh.o sshaes.o sshblowf.o sshbn.o sshcrc.o \
sshcrcda.o sshdes.o sshdh.o sshdss.o sshmd5.o sshpubk.o \
sshrand.o sshrsa.o sshsh512.o sshsha.o sshzlib.o time.o \
timing.o tree234.o uxagentc.o uxcons.o uxmisc.o uxnet.o \
uxnoise.o uxproxy.o uxsel.o uxsftp.o uxstore.o version.o \
wildcard.o x11fwd.o
puttygen: cmdgen.o import.o misc.o notiming.o sshaes.o sshbn.o sshdes.o \
sshdss.o sshdssg.o sshmd5.o sshprime.o sshpubk.o sshrand.o \
sshrsa.o sshrsag.o sshsh512.o sshsha.o time.o tree234.o \
uxcons.o uxgen.o uxmisc.o uxnoise.o uxstore.o version.o
$(CC) $(ULDFLAGS) -o $@ cmdgen.o import.o misc.o notiming.o sshaes.o \
sshbn.o sshdes.o sshdss.o sshdssg.o sshmd5.o sshprime.o \
sshpubk.o sshrand.o sshrsa.o sshrsag.o sshsh512.o sshsha.o \
time.o tree234.o uxcons.o uxgen.o uxmisc.o uxnoise.o \
uxstore.o version.o
be_all.o: ../be_all.c ../putty.h ../puttyps.h ../network.h ../misc.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../puttymem.h ../tree234.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
be_none.o: ../be_none.c ../putty.h ../puttyps.h ../network.h ../misc.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../puttymem.h ../tree234.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
be_nossh.o: ../be_nossh.c ../putty.h ../puttyps.h ../network.h ../misc.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../puttymem.h ../tree234.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
cmdgen.o: ../cmdgen.c ../putty.h ../ssh.h ../puttyps.h ../network.h \
../misc.h ../puttymem.h ../int64.h ../windows/winstuff.h \
../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \
../tree234.h ../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
cmdline.o: ../cmdline.c ../putty.h ../puttyps.h ../network.h ../misc.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../puttymem.h ../tree234.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
config.o: ../config.c ../putty.h ../dialog.h ../storage.h ../puttyps.h \
../network.h ../misc.h ../windows/winstuff.h \
../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \
../puttymem.h ../tree234.h ../windows/winhelp.h \
../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
cproxy.o: ../cproxy.c ../putty.h ../ssh.h ../network.h ../proxy.h \
../puttyps.h ../misc.h ../puttymem.h ../int64.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../tree234.h ../windows/winhelp.h \
../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
dialog.o: ../dialog.c ../putty.h ../dialog.h ../puttyps.h ../network.h \
../misc.h ../windows/winstuff.h ../mac/macstuff.h \
../macosx/osx.h ../unix/unix.h ../puttymem.h ../tree234.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
fromucs.o: ../charset/fromucs.c ../charset/charset.h ../charset/internal.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
gtkcfg.o: ../unix/gtkcfg.c ../putty.h ../dialog.h ../storage.h ../puttyps.h \
../network.h ../misc.h ../windows/winstuff.h \
../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \
../puttymem.h ../tree234.h ../windows/winhelp.h \
../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
gtkcols.o: ../unix/gtkcols.c ../unix/gtkcols.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
gtkdlg.o: ../unix/gtkdlg.c ../unix/gtkcols.h ../unix/gtkpanel.h ../putty.h \
../storage.h ../dialog.h ../tree234.h ../puttyps.h \
../network.h ../misc.h ../windows/winstuff.h \
../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \
../puttymem.h ../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
gtkpanel.o: ../unix/gtkpanel.c ../unix/gtkpanel.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
gtkwin.o: ../unix/gtkwin.c ../putty.h ../terminal.h ../puttyps.h \
../network.h ../misc.h ../tree234.h ../windows/winstuff.h \
../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \
../puttymem.h ../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
import.o: ../import.c ../putty.h ../ssh.h ../misc.h ../puttyps.h \
../network.h ../puttymem.h ../int64.h ../windows/winstuff.h \
../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \
../tree234.h ../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
int64.o: ../int64.c ../int64.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
ldisc.o: ../ldisc.c ../putty.h ../terminal.h ../ldisc.h ../puttyps.h \
../network.h ../misc.h ../tree234.h ../windows/winstuff.h \
../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \
../puttymem.h ../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
ldiscucs.o: ../ldiscucs.c ../putty.h ../terminal.h ../ldisc.h ../puttyps.h \
../network.h ../misc.h ../tree234.h ../windows/winstuff.h \
../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \
../puttymem.h ../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
localenc.o: ../charset/localenc.c ../charset/charset.h ../charset/internal.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
logging.o: ../logging.c ../putty.h ../puttyps.h ../network.h ../misc.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../puttymem.h ../tree234.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
mac.o: ../mac/mac.c ../mac/macresid.h ../putty.h ../ssh.h ../terminal.h \
../mac/mac.h ../puttyps.h ../network.h ../misc.h \
../puttymem.h ../int64.h ../tree234.h ../charset/charset.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../windows/winhelp.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
macabout.o: ../mac/macabout.c ../putty.h ../mac/mac.h ../mac/macresid.h \
../puttyps.h ../network.h ../misc.h ../charset/charset.h \
../tree234.h ../windows/winstuff.h ../mac/macstuff.h \
../macosx/osx.h ../unix/unix.h ../puttymem.h \
../windows/winhelp.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
macctrls.o: ../mac/macctrls.c ../putty.h ../mac/mac.h ../mac/macresid.h \
../dialog.h ../tree234.h ../puttyps.h ../network.h ../misc.h \
../charset/charset.h ../windows/winstuff.h ../mac/macstuff.h \
../macosx/osx.h ../unix/unix.h ../puttymem.h \
../windows/winhelp.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
macdlg.o: ../mac/macdlg.c ../putty.h ../dialog.h ../mac/mac.h \
../mac/macresid.h ../storage.h ../puttyps.h ../network.h \
../misc.h ../charset/charset.h ../tree234.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../puttymem.h ../windows/winhelp.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
macenc.o: ../charset/macenc.c ../charset/charset.h ../charset/internal.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
macevlog.o: ../mac/macevlog.c ../putty.h ../mac/mac.h ../mac/macresid.h \
../terminal.h ../puttyps.h ../network.h ../misc.h \
../charset/charset.h ../tree234.h ../windows/winstuff.h \
../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \
../puttymem.h ../windows/winhelp.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
macmisc.o: ../mac/macmisc.c ../putty.h ../mac/mac.h ../ssh.h ../puttyps.h \
../network.h ../misc.h ../charset/charset.h ../tree234.h \
../puttymem.h ../int64.h ../windows/winstuff.h \
../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \
../windows/winhelp.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
macnet.o: ../mac/macnet.c ../putty.h ../network.h ../mac/mac.h ../ssh.h \
../puttyps.h ../misc.h ../charset/charset.h ../tree234.h \
../puttymem.h ../int64.h ../windows/winstuff.h \
../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \
../windows/winhelp.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
macnoise.o: ../mac/macnoise.c ../putty.h ../ssh.h ../storage.h ../puttyps.h \
../network.h ../misc.h ../puttymem.h ../int64.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../tree234.h ../windows/winhelp.h \
../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
macpgen.o: ../mac/macpgen.c ../mac/macpgrid.h ../putty.h ../ssh.h \
../mac/mac.h ../puttyps.h ../network.h ../misc.h \
../puttymem.h ../int64.h ../charset/charset.h ../tree234.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../windows/winhelp.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
macpgkey.o: ../mac/macpgkey.c ../putty.h ../mac/mac.h ../mac/macpgrid.h \
../ssh.h ../puttyps.h ../network.h ../misc.h \
../charset/charset.h ../tree234.h ../puttymem.h ../int64.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../windows/winhelp.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
macstore.o: ../mac/macstore.c ../putty.h ../storage.h ../mac/mac.h \
../mac/macresid.h ../puttyps.h ../network.h ../misc.h \
../charset/charset.h ../tree234.h ../windows/winstuff.h \
../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \
../puttymem.h ../windows/winhelp.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
macterm.o: ../mac/macterm.c ../mac/macresid.h ../putty.h \
../charset/charset.h ../mac/mac.h ../terminal.h ../puttyps.h \
../network.h ../misc.h ../tree234.h ../windows/winstuff.h \
../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \
../puttymem.h ../windows/winhelp.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
macucs.o: ../mac/macucs.c ../putty.h ../terminal.h ../misc.h ../mac/mac.h \
../puttyps.h ../network.h ../tree234.h ../puttymem.h \
../charset/charset.h ../windows/winstuff.h ../mac/macstuff.h \
../macosx/osx.h ../unix/unix.h ../windows/winhelp.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
mimeenc.o: ../charset/mimeenc.c ../charset/charset.h ../charset/internal.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
minibidi.o: ../minibidi.c ../misc.h ../puttymem.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
misc.o: ../misc.c ../putty.h ../puttyps.h ../network.h ../misc.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../puttymem.h ../tree234.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
mtcpnet.o: ../mac/mtcpnet.c ../putty.h ../network.h ../mac/mac.h \
../puttyps.h ../misc.h ../charset/charset.h ../tree234.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../puttymem.h ../windows/winhelp.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
nocproxy.o: ../nocproxy.c ../putty.h ../network.h ../proxy.h ../puttyps.h \
../misc.h ../windows/winstuff.h ../mac/macstuff.h \
../macosx/osx.h ../unix/unix.h ../puttymem.h ../tree234.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
notiming.o: ../notiming.c ../putty.h ../puttyps.h ../network.h ../misc.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../puttymem.h ../tree234.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
osxctrls.o: ../macosx/osxctrls.m ../putty.h ../dialog.h ../macosx/osxclass.h \
../tree234.h ../puttyps.h ../network.h ../misc.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../puttymem.h ../windows/winhelp.h \
../charset/charset.h
$(CC) -x objective-c $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
osxdlg.o: ../macosx/osxdlg.m ../putty.h ../storage.h ../dialog.h \
../macosx/osxclass.h ../puttyps.h ../network.h ../misc.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../puttymem.h ../tree234.h \
../windows/winhelp.h ../charset/charset.h
$(CC) -x objective-c $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
osxmain.o: ../macosx/osxmain.m ../putty.h ../macosx/osxclass.h ../puttyps.h \
../network.h ../misc.h ../windows/winstuff.h \
../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \
../puttymem.h ../tree234.h ../windows/winhelp.h \
../charset/charset.h
$(CC) -x objective-c $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
osxsel.o: ../macosx/osxsel.m ../putty.h ../macosx/osxclass.h ../puttyps.h \
../network.h ../misc.h ../windows/winstuff.h \
../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \
../puttymem.h ../tree234.h ../windows/winhelp.h \
../charset/charset.h
$(CC) -x objective-c $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
osxwin.o: ../macosx/osxwin.m ../putty.h ../terminal.h ../macosx/osxclass.h \
../puttyps.h ../network.h ../misc.h ../tree234.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../puttymem.h ../windows/winhelp.h \
../charset/charset.h
$(CC) -x objective-c $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
otnet.o: ../mac/otnet.c ../putty.h ../network.h ../mac/mac.h ../puttyps.h \
../misc.h ../charset/charset.h ../tree234.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../puttymem.h ../windows/winhelp.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
pinger.o: ../pinger.c ../putty.h ../puttyps.h ../network.h ../misc.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../puttymem.h ../tree234.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
portfwd.o: ../portfwd.c ../putty.h ../ssh.h ../puttyps.h ../network.h \
../misc.h ../puttymem.h ../int64.h ../windows/winstuff.h \
../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \
../tree234.h ../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
pproxy.o: ../pproxy.c ../putty.h ../network.h ../proxy.h ../puttyps.h \
../misc.h ../windows/winstuff.h ../mac/macstuff.h \
../macosx/osx.h ../unix/unix.h ../puttymem.h ../tree234.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
proxy.o: ../proxy.c ../putty.h ../network.h ../proxy.h ../puttyps.h \
../misc.h ../windows/winstuff.h ../mac/macstuff.h \
../macosx/osx.h ../unix/unix.h ../puttymem.h ../tree234.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
pscp.o: ../pscp.c ../putty.h ../psftp.h ../ssh.h ../sftp.h ../storage.h \
../puttyps.h ../network.h ../misc.h ../puttymem.h ../int64.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../tree234.h ../windows/winhelp.h \
../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
psftp.o: ../psftp.c ../putty.h ../psftp.h ../storage.h ../ssh.h ../sftp.h \
../int64.h ../puttyps.h ../network.h ../misc.h ../puttymem.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../tree234.h ../windows/winhelp.h \
../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
raw.o: ../raw.c ../putty.h ../puttyps.h ../network.h ../misc.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../puttymem.h ../tree234.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
rlogin.o: ../rlogin.c ../putty.h ../puttyps.h ../network.h ../misc.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../puttymem.h ../tree234.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
sbcs.o: ../charset/sbcs.c ../charset/charset.h ../charset/internal.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
sbcsdat.o: ../charset/sbcsdat.c ../charset/charset.h ../charset/internal.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
settings.o: ../settings.c ../putty.h ../storage.h ../puttyps.h ../network.h \
../misc.h ../windows/winstuff.h ../mac/macstuff.h \
../macosx/osx.h ../unix/unix.h ../puttymem.h ../tree234.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
sftp.o: ../sftp.c ../misc.h ../int64.h ../tree234.h ../sftp.h ../puttymem.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
sizetip.o: ../windows/sizetip.c ../putty.h ../puttyps.h ../network.h \
../misc.h ../windows/winstuff.h ../mac/macstuff.h \
../macosx/osx.h ../unix/unix.h ../puttymem.h ../tree234.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
slookup.o: ../charset/slookup.c ../charset/charset.h ../charset/internal.h \
../charset/enum.c ../charset/sbcsdat.c ../charset/utf8.c
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
ssh.o: ../ssh.c ../putty.h ../tree234.h ../ssh.h ../puttyps.h ../network.h \
../misc.h ../puttymem.h ../int64.h ../windows/winstuff.h \
../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
sshaes.o: ../sshaes.c ../ssh.h ../puttymem.h ../network.h ../int64.h \
../misc.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
sshblowf.o: ../sshblowf.c ../ssh.h ../puttymem.h ../network.h ../int64.h \
../misc.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
sshbn.o: ../sshbn.c ../misc.h ../ssh.h ../puttymem.h ../network.h ../int64.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
sshcrc.o: ../sshcrc.c ../ssh.h ../puttymem.h ../network.h ../int64.h \
../misc.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
sshcrcda.o: ../sshcrcda.c ../misc.h ../ssh.h ../puttymem.h ../network.h \
../int64.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
sshdes.o: ../sshdes.c ../ssh.h ../puttymem.h ../network.h ../int64.h \
../misc.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
sshdh.o: ../sshdh.c ../ssh.h ../puttymem.h ../network.h ../int64.h ../misc.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
sshdss.o: ../sshdss.c ../ssh.h ../misc.h ../puttymem.h ../network.h \
../int64.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
sshdssg.o: ../sshdssg.c ../misc.h ../ssh.h ../puttymem.h ../network.h \
../int64.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
sshmd5.o: ../sshmd5.c ../ssh.h ../puttymem.h ../network.h ../int64.h \
../misc.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
sshprime.o: ../sshprime.c ../ssh.h ../puttymem.h ../network.h ../int64.h \
../misc.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
sshpubk.o: ../sshpubk.c ../putty.h ../ssh.h ../misc.h ../puttyps.h \
../network.h ../puttymem.h ../int64.h ../windows/winstuff.h \
../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \
../tree234.h ../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
sshrand.o: ../sshrand.c ../putty.h ../ssh.h ../puttyps.h ../network.h \
../misc.h ../puttymem.h ../int64.h ../windows/winstuff.h \
../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \
../tree234.h ../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
sshrsa.o: ../sshrsa.c ../ssh.h ../misc.h ../puttymem.h ../network.h \
../int64.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
sshrsag.o: ../sshrsag.c ../ssh.h ../puttymem.h ../network.h ../int64.h \
../misc.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
sshsh512.o: ../sshsh512.c ../ssh.h ../puttymem.h ../network.h ../int64.h \
../misc.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
sshsha.o: ../sshsha.c ../ssh.h ../puttymem.h ../network.h ../int64.h \
../misc.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
sshzlib.o: ../sshzlib.c ../ssh.h ../puttymem.h ../network.h ../int64.h \
../misc.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
stricmp.o: ../mac/stricmp.c ../putty.h ../puttyps.h ../network.h ../misc.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../puttymem.h ../tree234.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
telnet.o: ../telnet.c ../putty.h ../puttyps.h ../network.h ../misc.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../puttymem.h ../tree234.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
terminal.o: ../terminal.c ../putty.h ../terminal.h ../puttyps.h ../network.h \
../misc.h ../tree234.h ../windows/winstuff.h \
../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \
../puttymem.h ../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
testback.o: ../testback.c ../putty.h ../puttyps.h ../network.h ../misc.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../puttymem.h ../tree234.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
time.o: ../time.c
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
timing.o: ../timing.c ../putty.h ../tree234.h ../puttyps.h ../network.h \
../misc.h ../windows/winstuff.h ../mac/macstuff.h \
../macosx/osx.h ../unix/unix.h ../puttymem.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
toucs.o: ../charset/toucs.c ../charset/charset.h ../charset/internal.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
tree234.o: ../tree234.c ../puttymem.h ../tree234.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
utf8.o: ../charset/utf8.c ../charset/charset.h ../charset/internal.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
ux_x11.o: ../unix/ux_x11.c ../putty.h ../ssh.h ../puttyps.h ../network.h \
../misc.h ../puttymem.h ../int64.h ../windows/winstuff.h \
../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \
../tree234.h ../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
uxagentc.o: ../unix/uxagentc.c ../putty.h ../misc.h ../tree234.h \
../puttymem.h ../puttyps.h ../network.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
uxcfg.o: ../unix/uxcfg.c ../putty.h ../dialog.h ../storage.h ../puttyps.h \
../network.h ../misc.h ../windows/winstuff.h \
../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \
../puttymem.h ../tree234.h ../windows/winhelp.h \
../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
uxcons.o: ../unix/uxcons.c ../putty.h ../storage.h ../ssh.h ../puttyps.h \
../network.h ../misc.h ../puttymem.h ../int64.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../tree234.h ../windows/winhelp.h \
../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
uxgen.o: ../unix/uxgen.c ../putty.h ../puttyps.h ../network.h ../misc.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../puttymem.h ../tree234.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
uxmisc.o: ../unix/uxmisc.c ../putty.h ../puttyps.h ../network.h ../misc.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../puttymem.h ../tree234.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
uxnet.o: ../unix/uxnet.c ../putty.h ../network.h ../tree234.h ../puttyps.h \
../misc.h ../windows/winstuff.h ../mac/macstuff.h \
../macosx/osx.h ../unix/unix.h ../puttymem.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
uxnoise.o: ../unix/uxnoise.c ../putty.h ../ssh.h ../storage.h ../puttyps.h \
../network.h ../misc.h ../puttymem.h ../int64.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../tree234.h ../windows/winhelp.h \
../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
uxplink.o: ../unix/uxplink.c ../putty.h ../storage.h ../tree234.h \
../puttyps.h ../network.h ../misc.h ../windows/winstuff.h \
../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \
../puttymem.h ../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
uxprint.o: ../unix/uxprint.c ../putty.h ../puttyps.h ../network.h ../misc.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../puttymem.h ../tree234.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
uxproxy.o: ../unix/uxproxy.c ../tree234.h ../putty.h ../network.h ../proxy.h \
../puttyps.h ../misc.h ../windows/winstuff.h \
../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \
../puttymem.h ../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
uxpterm.o: ../unix/uxpterm.c ../putty.h ../puttyps.h ../network.h ../misc.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../puttymem.h ../tree234.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
uxpty.o: ../unix/uxpty.c ../putty.h ../tree234.h ../puttyps.h ../network.h \
../misc.h ../windows/winstuff.h ../mac/macstuff.h \
../macosx/osx.h ../unix/unix.h ../puttymem.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
uxputty.o: ../unix/uxputty.c ../putty.h ../storage.h ../puttyps.h \
../network.h ../misc.h ../windows/winstuff.h \
../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \
../puttymem.h ../tree234.h ../windows/winhelp.h \
../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
uxsel.o: ../unix/uxsel.c ../putty.h ../tree234.h ../puttyps.h ../network.h \
../misc.h ../windows/winstuff.h ../mac/macstuff.h \
../macosx/osx.h ../unix/unix.h ../puttymem.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
uxsftp.o: ../unix/uxsftp.c ../putty.h ../psftp.h ../puttyps.h ../network.h \
../misc.h ../windows/winstuff.h ../mac/macstuff.h \
../macosx/osx.h ../unix/unix.h ../puttymem.h ../tree234.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
uxsignal.o: ../unix/uxsignal.c
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
uxstore.o: ../unix/uxstore.c ../putty.h ../storage.h ../tree234.h \
../puttyps.h ../network.h ../misc.h ../windows/winstuff.h \
../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \
../puttymem.h ../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
uxucs.o: ../unix/uxucs.c ../putty.h ../charset/charset.h ../terminal.h \
../misc.h ../puttyps.h ../network.h ../tree234.h \
../puttymem.h ../windows/winstuff.h ../mac/macstuff.h \
../macosx/osx.h ../unix/unix.h ../windows/winhelp.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
version.o: ../version.c
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
vsnprint.o: ../mac/vsnprint.c ../putty.h ../puttyps.h ../network.h ../misc.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../puttymem.h ../tree234.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
wcwidth.o: ../wcwidth.c ../putty.h ../puttyps.h ../network.h ../misc.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../puttymem.h ../tree234.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
wildcard.o: ../wildcard.c ../putty.h ../puttyps.h ../network.h ../misc.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../puttymem.h ../tree234.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
wincfg.o: ../windows/wincfg.c ../putty.h ../dialog.h ../storage.h \
../puttyps.h ../network.h ../misc.h ../windows/winstuff.h \
../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \
../puttymem.h ../tree234.h ../windows/winhelp.h \
../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
wincons.o: ../windows/wincons.c ../putty.h ../storage.h ../ssh.h \
../puttyps.h ../network.h ../misc.h ../puttymem.h ../int64.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../tree234.h ../windows/winhelp.h \
../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
winctrls.o: ../windows/winctrls.c ../putty.h ../misc.h ../dialog.h \
../puttyps.h ../network.h ../puttymem.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../tree234.h ../windows/winhelp.h \
../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
windefs.o: ../windows/windefs.c ../putty.h ../puttyps.h ../network.h \
../misc.h ../windows/winstuff.h ../mac/macstuff.h \
../macosx/osx.h ../unix/unix.h ../puttymem.h ../tree234.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
windlg.o: ../windows/windlg.c ../putty.h ../ssh.h ../windows/win_res.h \
../storage.h ../dialog.h ../puttyps.h ../network.h ../misc.h \
../puttymem.h ../int64.h ../windows/winstuff.h \
../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \
../tree234.h ../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
window.o: ../windows/window.c ../putty.h ../terminal.h ../storage.h \
../windows/win_res.h ../puttyps.h ../network.h ../misc.h \
../tree234.h ../windows/winstuff.h ../mac/macstuff.h \
../macosx/osx.h ../unix/unix.h ../puttymem.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
winmisc.o: ../windows/winmisc.c ../putty.h ../puttyps.h ../network.h \
../misc.h ../windows/winstuff.h ../mac/macstuff.h \
../macosx/osx.h ../unix/unix.h ../puttymem.h ../tree234.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
winnet.o: ../windows/winnet.c ../putty.h ../network.h ../tree234.h \
../puttyps.h ../misc.h ../windows/winstuff.h \
../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \
../puttymem.h ../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
winnoise.o: ../windows/winnoise.c ../putty.h ../ssh.h ../storage.h \
../puttyps.h ../network.h ../misc.h ../puttymem.h ../int64.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../tree234.h ../windows/winhelp.h \
../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
winpgen.o: ../windows/winpgen.c ../putty.h ../ssh.h ../puttyps.h \
../network.h ../misc.h ../puttymem.h ../int64.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../tree234.h ../windows/winhelp.h \
../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
winpgnt.o: ../windows/winpgnt.c ../putty.h ../ssh.h ../misc.h ../tree234.h \
../puttyps.h ../network.h ../puttymem.h ../int64.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
winpgntc.o: ../windows/winpgntc.c ../putty.h ../puttyps.h ../network.h \
../misc.h ../windows/winstuff.h ../mac/macstuff.h \
../macosx/osx.h ../unix/unix.h ../puttymem.h ../tree234.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
winplink.o: ../windows/winplink.c ../putty.h ../storage.h ../tree234.h \
../puttyps.h ../network.h ../misc.h ../windows/winstuff.h \
../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \
../puttymem.h ../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
winprint.o: ../windows/winprint.c ../putty.h ../puttyps.h ../network.h \
../misc.h ../windows/winstuff.h ../mac/macstuff.h \
../macosx/osx.h ../unix/unix.h ../puttymem.h ../tree234.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
winsftp.o: ../windows/winsftp.c ../putty.h ../psftp.h ../puttyps.h \
../network.h ../misc.h ../windows/winstuff.h \
../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \
../puttymem.h ../tree234.h ../windows/winhelp.h \
../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
winstore.o: ../windows/winstore.c ../putty.h ../storage.h ../puttyps.h \
../network.h ../misc.h ../windows/winstuff.h \
../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \
../puttymem.h ../tree234.h ../windows/winhelp.h \
../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
wintime.o: ../windows/wintime.c ../putty.h ../puttyps.h ../network.h \
../misc.h ../windows/winstuff.h ../mac/macstuff.h \
../macosx/osx.h ../unix/unix.h ../puttymem.h ../tree234.h \
../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
winucs.o: ../windows/winucs.c ../putty.h ../terminal.h ../misc.h \
../puttyps.h ../network.h ../tree234.h ../puttymem.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
winutils.o: ../windows/winutils.c ../misc.h ../puttymem.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
x11fwd.o: ../x11fwd.c ../putty.h ../ssh.h ../tree234.h ../puttyps.h \
../network.h ../misc.h ../puttymem.h ../int64.h \
../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \
../unix/unix.h ../windows/winhelp.h ../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
xenc.o: ../charset/xenc.c ../charset/charset.h ../charset/internal.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
xkeysym.o: ../unix/xkeysym.c ../misc.h ../puttymem.h
$(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $<
clean:
rm -f *.o *.dmg
rm -rf *.app

78
macosx/README.OSX Normal file
View File

@ -0,0 +1,78 @@
This directory contains a Mac OS X port of PuTTY/pterm, running as a
native Aqua GUI application.
THIS PORT IS CURRENTLY UNFINISHED AND EXPERIMENTAL. You are welcome
to use it, but don't be surprised at unexpected behaviour. I'm not
kidding.
In particular, I have not yet decided where OS X PuTTY should store
its configuration data. Options include storing it in ~/.putty to be
compatible with Unix PuTTY, storing it wherever is compatible with
Mac Classic PuTTY, storing it in a natively OS X location, or
sorting out the `config-locations' wishlist item and doing all
three. Therefore, if you start using this port and create a whole
load of saved sessions, you should not be surprised if a future
version of the port decides to look somewhere completely different
for the data and therefore loses them all. If that happens, don't
say you weren't warned!
Even more importantly, the alert box that confirms host keys is not
yet implemented, and the application will bomb out and exit if it
should be needed. This means you cannot make an SSH connection to a
new host using the GUI PuTTY in this port: you must first run
`plink' (which should be exactly identical to the version in the
Unix port) and tell it to confirm the host key.
Other ways in which the port is currently unfinished include:
- terminal display is horribly slow
- fatal errors are currently output via printf, which is obviously
wrong for a GUI application
- fonts aren't configurable
- several features are unimplemented in the terminal display:
underlining, non-solid-block cursors, double-width and
double-height line attributes, bold as font rather than as
colour, wide (CJK) characters, combining characters.
- there's no scrollbar
- terminal window resizing isn't implemented yet
- proper window placement (cascading down and right from the
starting position, plus remembering previous window positions per
the Apple HIG) is not implemented
- close-on-exit isn't implemented
- warn-on-close isn't implemented
- SessionWindow's dealloc method does nothing yet, so leaks memory
- use of Alt+numberpad to enter arbitrary numeric character codes
is not yet supported
- cut and paste isn't supported
- there's no Meta key yet. (I think it will have to be Command
rather than Option since the latter is necessary to send some
characters, including the rather important # on Apple UK
keyboards; but trapping Command-<key> and sending it to the
window rather than the application menu requires me to make a
positive effort of some sort and I haven't got round to it yet.)
- there's no specials menu
- currently no support for server-side window management requests
(i.e. escape sequences to minimise or maximise the window,
request or change its position and size, change its title etc)
- window title is currently fixed
- no Event Log
- no mid-session Change Settings
- no icon (surprisingly important in an OS X app!)

34
macosx/osx.h Normal file
View File

@ -0,0 +1,34 @@
#ifndef PUTTY_OSX_H
#define PUTTY_OSX_H
/*
* Cocoa defines `FontSpec' itself, so we must change its name.
* (Arrgh.)
*/
#define FontSpec FontSpec_OSX_Proof
/*
* Define the various compatibility symbols to make uxpty.c compile
* correctly on OS X.
*/
#define BSD_PTYS
#define OMIT_UTMP
#define HAVE_NO_SETRESUID
#define NOT_X_WINDOWS
/*
* OS X is largely just Unix, so we can include most of this
* unchanged.
*/
#include "unix.h"
/*
* Functions exported by osxsel.m. (Both of these functions are
* expected to be called in the _main_ thread: the select subthread
* is an implementation detail of osxsel.m and ideally should not
* be visible at all outside it.)
*/
void osxsel_init(void); /* call this to kick things off */
void osxsel_process_results(void); /* call this on receipt of a netevent */
#endif

86
macosx/osxclass.h Normal file
View File

@ -0,0 +1,86 @@
/*
* Header file for the Objective-C parts of Mac OS X PuTTY. This
* file contains the class definitions, which would cause compile
* failures in the pure C modules if they appeared in osx.h.
*/
#ifndef PUTTY_OSXCLASS_H
#define PUTTY_OSXCLASS_H
#include "putty.h"
/*
* The application controller class, defined in osxmain.m.
*/
@interface AppController : NSObject
{
NSTimer *timer;
}
- (void)newSessionConfig:(id)sender;
- (void)newTerminal:(id)sender;
- (void)newSessionWithConfig:(id)cfg;
- (void)setTimer:(long)next;
@end
extern AppController *controller;
/*
* The SessionWindow class, defined in osxwin.m.
*/
@class SessionWindow;
@class TerminalView;
@interface SessionWindow : NSWindow
{
Terminal *term;
TerminalView *termview;
struct unicode_data ucsdata;
void *logctx;
Config cfg;
void *ldisc;
Backend *back;
void *backhandle;
}
- (id)initWithConfig:(Config)cfg;
- (void)drawStartFinish:(BOOL)start;
- (void)setColour:(int)n r:(float)r g:(float)g b:(float)b;
- (Config *)cfg;
- (void)doText:(wchar_t *)text len:(int)len x:(int)x y:(int)y
attr:(unsigned long)attr lattr:(int)lattr;
- (int)fromBackend:(const char *)data len:(int)len isStderr:(int)is_stderr;
@end
/*
* The ConfigWindow class, defined in osxdlg.m.
*/
@class ConfigWindow;
@interface ConfigWindow : NSWindow
{
NSOutlineView *treeview;
struct controlbox *ctrlbox;
struct sesslist sl;
void *dv;
Config cfg;
}
- (id)initWithConfig:(Config)cfg;
@end
/*
* Functions exported by osxctrls.m. (They have to go in this
* header file and not osx.h, because some of them have Cocoa class
* types in their prototypes.)
*/
#define HSPACING 12 /* needed in osxdlg.m and osxctrls.m */
#define VSPACING 8
void *fe_dlg_init(void *data, NSWindow *window, NSObject *target, SEL action);
void fe_dlg_free(void *dv);
void create_ctrls(void *dv, NSView *parent, struct controlset *s,
int *minw, int *minh);
int place_ctrls(void *dv, struct controlset *s, int leftx, int topy,
int width); /* returns height used */
void select_panel(void *dv, struct controlbox *b, const char *name);
#endif /* PUTTY_OSXCLASS_H */

1804
macosx/osxctrls.m Normal file

File diff suppressed because it is too large Load Diff

367
macosx/osxdlg.m Normal file
View File

@ -0,0 +1,367 @@
/*
* osxdlg.m: various PuTTY dialog boxes for OS X.
*/
#import <Cocoa/Cocoa.h>
#include "putty.h"
#include "storage.h"
#include "dialog.h"
#include "osxclass.h"
/*
* The `ConfigWindow' class is used to start up a new PuTTY
* session.
*/
@class ConfigTree;
@interface ConfigTree : NSObject
{
NSString **paths;
int *levels;
int nitems, itemsize;
}
- (void)addPath:(char *)path;
@end
@implementation ConfigTree
- (id)init
{
self = [super init];
paths = NULL;
levels = NULL;
nitems = itemsize = 0;
return self;
}
- (void)addPath:(char *)path
{
if (nitems >= itemsize) {
itemsize += 32;
paths = sresize(paths, itemsize, NSString *);
levels = sresize(levels, itemsize, int);
}
paths[nitems] = [[NSString stringWithCString:path] retain];
levels[nitems] = ctrl_path_elements(path) - 1;
nitems++;
}
- (void)dealloc
{
int i;
for (i = 0; i < nitems; i++)
[paths[i] release];
sfree(paths);
sfree(levels);
[super dealloc];
}
- (id)iterateChildren:(int)index ofItem:(id)item count:(int *)count
{
int i, plevel;
if (item) {
for (i = 0; i < nitems; i++)
if (paths[i] == item)
break;
assert(i < nitems);
plevel = levels[i];
i++;
} else {
i = 0;
plevel = -1;
}
if (count)
*count = 0;
while (index > 0) {
if (i >= nitems || levels[i] != plevel+1)
return nil;
if (count)
(*count)++;
do {
i++;
} while (i < nitems && levels[i] > plevel+1);
index--;
}
return paths[i];
}
- (id)outlineView:(NSOutlineView *)outlineView child:(int)index ofItem:(id)item
{
return [self iterateChildren:index ofItem:item count:NULL];
}
- (int)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item
{
int count = 0;
/* pass nitems+1 to ensure we run off the end */
[self iterateChildren:nitems+1 ofItem:item count:&count];
return count;
}
- (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item
{
return [self outlineView:outlineView numberOfChildrenOfItem:item] > 0;
}
- (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item
{
/*
* Trim off all path elements except the last one.
*/
NSArray *components = [item componentsSeparatedByString:@"/"];
return [components objectAtIndex:[components count]-1];
}
@end
@implementation ConfigWindow
- (id)initWithConfig:(Config)aCfg
{
NSScrollView *scrollview;
NSTableColumn *col;
ConfigTree *treedata;
int by = 0, mby = 0;
int wmin = 0;
int hmin = 0;
int panelht = 0;
get_sesslist(&sl, TRUE);
ctrlbox = ctrl_new_box();
setup_config_box(ctrlbox, &sl, FALSE /*midsession*/, aCfg.protocol,
0 /* protcfginfo */);
unix_setup_config_box(ctrlbox, FALSE /*midsession*/);
cfg = aCfg; /* structure copy */
self = [super initWithContentRect:NSMakeRect(0,0,300,300)
styleMask:(NSTitledWindowMask | NSMiniaturizableWindowMask |
NSClosableWindowMask)
backing:NSBackingStoreBuffered
defer:YES];
[self setTitle:@"PuTTY Configuration"];
[self setIgnoresMouseEvents:NO];
dv = fe_dlg_init(&cfg, self, self, @selector(configBoxFinished:));
scrollview = [[NSScrollView alloc] initWithFrame:NSMakeRect(20,20,10,10)];
treeview = [[NSOutlineView alloc] initWithFrame:[scrollview frame]];
[scrollview setBorderType:NSLineBorder];
[scrollview setDocumentView:treeview];
[[self contentView] addSubview:scrollview];
[scrollview setHasVerticalScroller:YES];
[scrollview setAutohidesScrollers:YES];
/* FIXME: the below is untested. Test it then remove this notice. */
[treeview setAllowsColumnReordering:NO];
[treeview setAllowsColumnResizing:NO];
[treeview setAllowsMultipleSelection:NO];
[treeview setAllowsEmptySelection:NO];
[treeview setAllowsColumnSelection:YES];
treedata = [[[ConfigTree alloc] init] retain];
col = [[NSTableColumn alloc] initWithIdentifier:nil];
[treeview addTableColumn:col];
[treeview setOutlineTableColumn:col];
[[treeview headerView] setFrame:NSMakeRect(0,0,0,0)];
/*
* Create the controls.
*/
{
int i;
char *path = NULL;
for (i = 0; i < ctrlbox->nctrlsets; i++) {
struct controlset *s = ctrlbox->ctrlsets[i];
int mw, mh;
if (!*s->pathname) {
create_ctrls(dv, [self contentView], s, &mw, &mh);
by += 20 + mh;
if (wmin < mw + 40)
wmin = mw + 40;
} else {
int j = path ? ctrl_path_compare(s->pathname, path) : 0;
if (j != INT_MAX) { /* add to treeview, start new panel */
char *c;
/*
* We expect never to find an implicit path
* component. For example, we expect never to
* see A/B/C followed by A/D/E, because that
* would _implicitly_ create A/D. All our path
* prefixes are expected to contain actual
* controls and be selectable in the treeview;
* so we would expect to see A/D _explicitly_
* before encountering A/D/E.
*/
assert(j == ctrl_path_elements(s->pathname) - 1);
c = strrchr(s->pathname, '/');
if (!c)
c = s->pathname;
else
c++;
[treedata addPath:s->pathname];
path = s->pathname;
panelht = 0;
}
create_ctrls(dv, [self contentView], s, &mw, &mh);
if (wmin < mw + 3*20+150)
wmin = mw + 3*20+150;
panelht += mh + 20;
if (hmin < panelht - 20)
hmin = panelht - 20;
}
}
}
{
int i;
NSRect r;
[treeview setDataSource:treedata];
for (i = [treeview numberOfRows]; i-- ;)
[treeview expandItem:[treeview itemAtRow:i] expandChildren:YES];
[treeview sizeToFit];
r = [treeview frame];
if (hmin < r.size.height)
hmin = r.size.height;
}
[self setContentSize:NSMakeSize(wmin, hmin+60+by)];
[scrollview setFrame:NSMakeRect(20, 40+by, 150, hmin)];
[treeview setDelegate:self];
mby = by;
/*
* Now place the controls.
*/
{
int i;
char *path = NULL;
panelht = 0;
for (i = 0; i < ctrlbox->nctrlsets; i++) {
struct controlset *s = ctrlbox->ctrlsets[i];
if (!*s->pathname) {
by -= VSPACING + place_ctrls(dv, s, 20, by, wmin-40);
} else {
if (!path || strcmp(s->pathname, path))
panelht = 0;
panelht += VSPACING + place_ctrls(dv, s, 2*20+150,
40+mby+hmin-panelht,
wmin - (3*20+150));
path = s->pathname;
}
}
}
select_panel(dv, ctrlbox, [[treeview itemAtRow:0] cString]);
[treeview reloadData];
dlg_refresh(NULL, dv);
[self center]; /* :-) */
return self;
}
- (void)configBoxFinished:(id)object
{
int ret = [object intValue]; /* it'll be an NSNumber */
if (ret) {
[controller performSelectorOnMainThread:
@selector(newSessionWithConfig:)
withObject:[NSData dataWithBytes:&cfg length:sizeof(cfg)]
waitUntilDone:NO];
}
[self close];
}
- (void)outlineViewSelectionDidChange:(NSNotification *)notification
{
const char *path = [[treeview itemAtRow:[treeview selectedRow]] cString];
select_panel(dv, ctrlbox, path);
}
- (BOOL)outlineView:(NSOutlineView *)outlineView
shouldEditTableColumn:(NSTableColumn *)tableColumn item:(id)item
{
return NO; /* no editing! */
}
@end
/* ----------------------------------------------------------------------
* Various special-purpose dialog boxes.
*/
int askappend(void *frontend, Filename filename)
{
return 0; /* FIXME */
}
void askalg(void *frontend, const char *algtype, const char *algname)
{
fatalbox("Cipher algorithm dialog box not supported yet");
return; /* FIXME */
}
void verify_ssh_host_key(void *frontend, char *host, int port, char *keytype,
char *keystr, char *fingerprint)
{
int ret;
/*
* Verify the key.
*/
ret = verify_host_key(host, port, keytype, keystr);
if (ret == 0)
return;
/*
* FIXME FIXME FIXME. I currently lack any sensible means of
* asking the user for a verification non-application-modally,
* _or_ any means of closing just this connection if the answer
* is no (the Unix and Windows ports just exit() in this
* situation since they're one-connection-per-process).
*
* What I need to do is to make this function optionally-
* asynchronous, much like the interface to agent_query(). It
* can either run modally and return a result directly, _or_ it
* can kick off a non-modal dialog, return a `please wait'
* status, and the dialog can call the backend back when the
* result comes in. Also, in either case, the aye/nay result
* wants to be passed to the backend so that it can tear down
* the connection if the answer was nay.
*
* For the moment, I simply bomb out if we have an unrecognised
* host key. This makes this port safe but not very useful: you
* can only use it at all if you already have a host key cache
* set up by running the Unix port.
*/
fatalbox("Host key dialog box not supported yet");
}
void old_keyfile_warning(void)
{
/*
* This should never happen on OS X. We hope.
*/
}
void about_box(void *window)
{
/* FIXME */
}

391
macosx/osxmain.m Normal file
View File

@ -0,0 +1,391 @@
/*
* osxmain.m: main-program file of Mac OS X PuTTY.
*/
#import <Cocoa/Cocoa.h>
#define PUTTY_DO_GLOBALS /* actually _define_ globals */
#include "putty.h"
#include "osxclass.h"
/* ----------------------------------------------------------------------
* Global variables.
*/
AppController *controller;
/* ----------------------------------------------------------------------
* Miscellaneous elements of the interface to the cross-platform
* and Unix PuTTY code.
*/
const char platform_x11_best_transport[] = "unix";
char *platform_get_x_display(void) {
return NULL;
}
FontSpec platform_default_fontspec(const char *name)
{
FontSpec ret;
/* FIXME */
return ret;
}
Filename platform_default_filename(const char *name)
{
Filename ret;
if (!strcmp(name, "LogFileName"))
strcpy(ret.path, "putty.log");
else
*ret.path = '\0';
return ret;
}
char *platform_default_s(const char *name)
{
return NULL;
}
int platform_default_i(const char *name, int def)
{
if (!strcmp(name, "CloseOnExit"))
return 2; /* maps to FORCE_ON after painful rearrangement :-( */
return def;
}
char *x_get_default(const char *key)
{
return NULL; /* this is a stub */
}
void modalfatalbox(char *p, ...)
{
/* FIXME: proper OS X GUI stuff */
va_list ap;
fprintf(stderr, "FATAL ERROR: ");
va_start(ap, p);
vfprintf(stderr, p, ap);
va_end(ap);
fputc('\n', stderr);
exit(1);
}
void fatalbox(char *p, ...)
{
/* FIXME: proper OS X GUI stuff */
va_list ap;
fprintf(stderr, "FATAL ERROR: ");
va_start(ap, p);
vfprintf(stderr, p, ap);
va_end(ap);
fputc('\n', stderr);
exit(1);
}
void cmdline_error(char *p, ...)
{
va_list ap;
fprintf(stderr, "%s: ", appname);
va_start(ap, p);
vfprintf(stderr, p, ap);
va_end(ap);
fputc('\n', stderr);
exit(1);
}
/*
* Clean up and exit.
*/
void cleanup_exit(int code)
{
/*
* Clean up.
*/
sk_cleanup();
random_save_seed();
exit(code);
}
/* ----------------------------------------------------------------------
* Tiny extension to NSMenuItem which carries a payload of a `void
* *', allowing several menu items to invoke the same message but
* pass different data through it.
*/
@interface DataMenuItem : NSMenuItem
{
void *payload;
}
- (void)setPayload:(void *)d;
- (void *)getPayload;
@end
@implementation DataMenuItem
- (void)setPayload:(void *)d
{
payload = d;
}
- (void *)getPayload
{
return payload;
}
@end
/* ----------------------------------------------------------------------
* Utility routines for constructing OS X menus.
*/
NSMenu *newmenu(const char *title)
{
return [[[NSMenu allocWithZone:[NSMenu menuZone]]
initWithTitle:[NSString stringWithCString:title]]
autorelease];
}
NSMenu *newsubmenu(NSMenu *parent, const char *title)
{
NSMenuItem *item;
NSMenu *child;
item = [[[NSMenuItem allocWithZone:[NSMenu menuZone]]
initWithTitle:[NSString stringWithCString:title]
action:NULL
keyEquivalent:@""]
autorelease];
child = newmenu(title);
[item setEnabled:YES];
[item setSubmenu:child];
[parent addItem:item];
return child;
}
id initnewitem(NSMenuItem *item, NSMenu *parent, const char *title,
const char *key, id target, SEL action)
{
unsigned mask = NSCommandKeyMask;
if (key[strcspn(key, "-")]) {
while (*key && *key != '-') {
int c = tolower((unsigned char)*key);
if (c == 's') {
mask |= NSShiftKeyMask;
} else if (c == 'o' || c == 'a') {
mask |= NSAlternateKeyMask;
}
key++;
}
if (*key)
key++;
}
item = [[item initWithTitle:[NSString stringWithCString:title]
action:NULL
keyEquivalent:[NSString stringWithCString:key]]
autorelease];
if (*key)
[item setKeyEquivalentModifierMask: mask];
[item setEnabled:YES];
[item setTarget:target];
[item setAction:action];
[parent addItem:item];
return item;
}
NSMenuItem *newitem(NSMenu *parent, char *title, char *key,
id target, SEL action)
{
return initnewitem([NSMenuItem allocWithZone:[NSMenu menuZone]],
parent, title, key, target, action);
}
/* ----------------------------------------------------------------------
* AppController: the object which receives the messages from all
* menu selections that aren't standard OS X functions.
*/
@implementation AppController
- (id)init
{
self = [super init];
timer = NULL;
return self;
}
- (void)newTerminal:(id)sender
{
id win;
Config cfg;
do_defaults(NULL, &cfg);
cfg.protocol = -1; /* PROT_TERMINAL */
win = [[SessionWindow alloc] initWithConfig:cfg];
[win makeKeyAndOrderFront:self];
}
- (void)newSessionConfig:(id)sender
{
id win;
Config cfg;
do_defaults(NULL, &cfg);
win = [[ConfigWindow alloc] initWithConfig:cfg];
[win makeKeyAndOrderFront:self];
}
- (void)newSessionWithConfig:(id)vdata
{
id win;
Config cfg;
NSData *data = (NSData *)vdata;
assert([data length] == sizeof(cfg));
[data getBytes:&cfg];
win = [[SessionWindow alloc] initWithConfig:cfg];
[win makeKeyAndOrderFront:self];
}
- (NSMenu *)applicationDockMenu:(NSApplication *)sender
{
NSMenu *menu = newmenu("Dock Menu");
/*
* FIXME: Add some useful things to this, probably including
* the saved session list.
*/
return menu;
}
- (void)timerFired:(id)sender
{
long now, next;
assert(sender == timer);
/* `sender' is the timer itself, so its userInfo is an NSNumber. */
now = [(NSNumber *)[sender userInfo] longValue];
[sender invalidate];
timer = NULL;
if (run_timers(now, &next))
[self setTimer:next];
}
- (void)setTimer:(long)next
{
long interval = next - GETTICKCOUNT();
float finterval;
if (interval <= 0)
interval = 1; /* just in case */
finterval = interval / (float)TICKSPERSEC;
if (timer) {
[timer invalidate];
}
timer = [NSTimer scheduledTimerWithTimeInterval:finterval
target:self selector:@selector(timerFired:)
userInfo:[NSNumber numberWithLong:next] repeats:NO];
}
@end
void timer_change_notify(long next)
{
[controller setTimer:next];
}
/* ----------------------------------------------------------------------
* Annoyingly, it looks as if I have to actually subclass
* NSApplication if I want to catch NSApplicationDefined events. So
* here goes.
*/
@interface MyApplication : NSApplication
{
}
@end
@implementation MyApplication
- (void)sendEvent:(NSEvent *)ev
{
if ([ev type] == NSApplicationDefined)
osxsel_process_results();
[super sendEvent:ev];
}
@end
/* ----------------------------------------------------------------------
* Main program. Constructs the menus and runs the application.
*/
int main(int argc, char **argv)
{
NSAutoreleasePool *pool;
NSMenu *menu;
NSMenuItem *item;
NSImage *icon;
pool = [[NSAutoreleasePool alloc] init];
icon = [NSImage imageNamed:@"NSApplicationIcon"];
[MyApplication sharedApplication];
[NSApp setApplicationIconImage:icon];
controller = [[[AppController alloc] init] autorelease];
[NSApp setDelegate:controller];
[NSApp setMainMenu: newmenu("Main Menu")];
menu = newsubmenu([NSApp mainMenu], "Apple Menu");
[NSApp setServicesMenu:newsubmenu(menu, "Services")];
[menu addItem:[NSMenuItem separatorItem]];
item = newitem(menu, "Hide PuTTY", "h", NSApp, @selector(hide:));
item = newitem(menu, "Hide Others", "o-h", NSApp, @selector(hideOtherApplications:));
item = newitem(menu, "Show All", "", NSApp, @selector(unhideAllApplications:));
[menu addItem:[NSMenuItem separatorItem]];
item = newitem(menu, "Quit", "q", NSApp, @selector(terminate:));
[NSApp setAppleMenu: menu];
menu = newsubmenu([NSApp mainMenu], "File");
item = newitem(menu, "New", "n", NULL, @selector(newSessionConfig:));
item = newitem(menu, "New Terminal", "t", NULL, @selector(newTerminal:));
item = newitem(menu, "Close", "w", NULL, @selector(performClose:));
menu = newsubmenu([NSApp mainMenu], "Window");
[NSApp setWindowsMenu: menu];
item = newitem(menu, "Minimise Window", "m", NULL, @selector(performMiniaturize:));
// menu = newsubmenu([NSApp mainMenu], "Help");
// item = newitem(menu, "PuTTY Help", "?", NSApp, @selector(showHelp:));
/*
* Start up the sub-thread doing select().
*/
osxsel_init();
/*
* Start up networking.
*/
sk_init();
/*
* FIXME: To make initial debugging more convenient I'm going
* to start by opening a session window unconditionally. This
* will probably change later on.
*/
[controller newSessionConfig:nil];
[NSApp run];
[pool release];
return 0;
}

308
macosx/osxsel.m Normal file
View File

@ -0,0 +1,308 @@
/*
* osxsel.m: OS X implementation of the front end interface to uxsel.
*/
#import <Cocoa/Cocoa.h>
#include <unistd.h>
#include "putty.h"
#include "osxclass.h"
/*
* The unofficial Cocoa FAQ at
*
* http://www.alastairs-place.net/cocoa/faq.txt
*
* says that Cocoa has the native ability to be given an fd and
* tell you when it becomes readable, but cannot tell you when it
* becomes _writable_. This is unacceptable to PuTTY, which depends
* for correct functioning on being told both. Therefore, I can't
* use the Cocoa native mechanism.
*
* Instead, I'm going to resort to threads. I start a second thread
* whose job is to do selects. At the termination of every select,
* it posts a Cocoa event into the main thread's event queue, so
* that the main thread gets select results interleaved with other
* GUI operations. Communication from the main thread _to_ the
* select thread is performed by writing to a pipe whose other end
* is one of the file descriptors being selected on. (This is the
* only sensible way, because we have to be able to interrupt a
* select in order to provide a new fd list.)
*/
/*
* In more detail, the select thread must:
*
* - start off by listening to _just_ the pipe, waiting to be told
* to begin a select.
*
* - when it receives the `start' command, it should read the
* shared uxsel data (which is protected by a mutex), set up its
* select, and begin it.
*
* - when the select terminates, it should write the results
* (perhaps minus the inter-thread pipe if it's there) into
* shared memory and dispatch a GUI event to let the main thread
* know.
*
* - the main thread will then think about it, do some processing,
* and _then_ send a command saying `now restart select'. Before
* sending that command it might easily have tinkered with the
* uxsel structures, which is why it waited before sending it.
*
* - EOF on the inter-thread pipe, of course, means the process
* has finished completely, so the select thread terminates.
*
* - The main thread may wish to adjust the uxsel settings in the
* middle of a select. In this situation it first writes the new
* data to the shared memory area, then notifies the select
* thread by writing to the inter-thread pipe.
*
* So the upshot is that the sequence of operations performed in
* the select thread must be:
*
* - read a byte from the pipe (which may block)
*
* - read the shared uxsel data and perform a select
*
* - notify the main thread of interesting select results (if any)
*
* - loop round again from the top.
*
* This is sufficient. Notifying the select thread asynchronously
* by writing to the pipe will cause its select to terminate and
* another to begin immediately without blocking. If the select
* thread's select terminates due to network data, its subsequent
* pipe read will block until the main thread is ready to let it
* loose again.
*/
static int osxsel_pipe[2];
static NSLock *osxsel_inlock;
static fd_set osxsel_rfds_in;
static fd_set osxsel_wfds_in;
static fd_set osxsel_xfds_in;
static int osxsel_inmax;
static NSLock *osxsel_outlock;
static fd_set osxsel_rfds_out;
static fd_set osxsel_wfds_out;
static fd_set osxsel_xfds_out;
static int osxsel_outmax;
static int inhibit_start_select;
/*
* NSThread requires an object method as its thread procedure, so
* here I define a trivial holding class.
*/
@class OSXSel;
@interface OSXSel : NSObject
{
}
- (void)runThread:(id)arg;
@end
@implementation OSXSel
- (void)runThread:(id)arg
{
char c;
fd_set r, w, x;
int n, ret;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
while (1) {
/*
* Read one byte from the pipe.
*/
ret = read(osxsel_pipe[0], &c, 1);
if (ret <= 0)
return; /* terminate the thread */
/*
* Now set up the select data.
*/
[osxsel_inlock lock];
memcpy(&r, &osxsel_rfds_in, sizeof(fd_set));
memcpy(&w, &osxsel_wfds_in, sizeof(fd_set));
memcpy(&x, &osxsel_xfds_in, sizeof(fd_set));
n = osxsel_inmax;
[osxsel_inlock unlock];
FD_SET(osxsel_pipe[0], &r);
if (n < osxsel_pipe[0]+1)
n = osxsel_pipe[0]+1;
/*
* Perform the select.
*/
ret = select(n, &r, &w, &x, NULL);
/*
* Detect the one special case in which the only
* interesting fd was the inter-thread pipe. In that
* situation only we are interested - the main thread will
* not be!
*/
if (ret == 1 && FD_ISSET(osxsel_pipe[0], &r))
continue; /* just loop round again */
/*
* Write the select results to shared data.
*
* I _think_ we don't need this data to be lock-protected:
* it won't be read by the main thread until after we send
* a message indicating that we've finished writing it, and
* we won't start another select (hence potentially writing
* it again) until the main thread notifies us in return.
*
* However, I'm scared of multithreading and not totally
* convinced of my reasoning, so I'm going to lock it
* anyway.
*/
[osxsel_outlock lock];
memcpy(&osxsel_rfds_out, &r, sizeof(fd_set));
memcpy(&osxsel_wfds_out, &w, sizeof(fd_set));
memcpy(&osxsel_xfds_out, &x, sizeof(fd_set));
osxsel_outmax = n;
[osxsel_outlock unlock];
/*
* Post a message to the main thread's message queue
* telling it that select data is available.
*/
[NSApp postEvent:[NSEvent otherEventWithType:NSApplicationDefined
location:NSMakePoint(0,0)
modifierFlags:0
timestamp:0
windowNumber:0
context:nil
subtype:0
data1:0
data2:0]
atStart:NO];
}
[pool release];
}
@end
void osxsel_init(void)
{
uxsel_init();
if (pipe(osxsel_pipe) < 0) {
fatalbox("Unable to set up inter-thread pipe for select");
}
[NSThread detachNewThreadSelector:@selector(runThread:)
toTarget:[[[OSXSel alloc] init] retain] withObject:nil];
/*
* Also initialise (i.e. clear) the input fd_sets. Need not
* start a select just yet - the select thread will block until
* we have at least one fd for it!
*/
FD_ZERO(&osxsel_rfds_in);
FD_ZERO(&osxsel_wfds_in);
FD_ZERO(&osxsel_xfds_in);
osxsel_inmax = 0;
/*
* Initialise the mutex locks used to protect the data passed
* between threads.
*/
osxsel_inlock = [[[NSLock alloc] init] retain];
osxsel_outlock = [[[NSLock alloc] init] retain];
}
static void osxsel_start_select(void)
{
char c = 'g'; /* for `Go!' :-) but it's never used */
if (!inhibit_start_select)
write(osxsel_pipe[1], &c, 1);
}
int uxsel_input_add(int fd, int rwx)
{
/*
* Add the new fd to the appropriate input fd_sets, then write
* to the inter-thread pipe.
*/
[osxsel_inlock lock];
if (rwx & 1)
FD_SET(fd, &osxsel_rfds_in);
else
FD_CLR(fd, &osxsel_rfds_in);
if (rwx & 2)
FD_SET(fd, &osxsel_wfds_in);
else
FD_CLR(fd, &osxsel_wfds_in);
if (rwx & 4)
FD_SET(fd, &osxsel_xfds_in);
else
FD_CLR(fd, &osxsel_xfds_in);
if (osxsel_inmax < fd+1)
osxsel_inmax = fd+1;
[osxsel_inlock unlock];
osxsel_start_select();
/*
* We must return an `id' which will be passed back to us at
* the time of uxsel_input_remove. Since we have no need to
* store ids in that sense, we might as well go with the fd
* itself.
*/
return fd;
}
void uxsel_input_remove(int id)
{
/*
* Remove the fd from all the input fd_sets. In this
* implementation, the simplest way to do that is to call
* uxsel_input_add with rwx==0!
*/
uxsel_input_add(id, 0);
}
/*
* Function called in the main thread to process results. It will
* have to read the output fd_sets, go through them, call back to
* uxsel with the results, and then write to the inter-thread pipe.
*
* This function will have to be called from an event handler in
* osxmain.m, which will therefore necessarily contain a small part
* of this mechanism (along with calling osxsel_init).
*/
void osxsel_process_results(void)
{
int i;
/*
* We must write to the pipe to start a fresh select _even if_
* there were no changes. So for efficiency, we set a flag here
* which inhibits uxsel_input_{add,remove} from writing to the
* pipe; then once we finish processing, we clear the flag
* again and write a single byte ourselves. It's cleaner,
* because it wakes up the select thread fewer times.
*/
inhibit_start_select = TRUE;
[osxsel_outlock lock];
for (i = 0; i < osxsel_outmax; i++) {
if (FD_ISSET(i, &osxsel_xfds_out))
select_result(i, 4);
}
for (i = 0; i < osxsel_outmax; i++) {
if (FD_ISSET(i, &osxsel_rfds_out))
select_result(i, 1);
}
for (i = 0; i < osxsel_outmax; i++) {
if (FD_ISSET(i, &osxsel_wfds_out))
select_result(i, 2);
}
[osxsel_outlock unlock];
inhibit_start_select = FALSE;
osxsel_start_select();
}

1122
macosx/osxwin.m Normal file

File diff suppressed because it is too large Load Diff

View File

@ -92,8 +92,8 @@ while (<IN>) {
if ($groups{$i}) {
foreach $j (@{$groups{$i}}) { unshift @objs, $j; }
} elsif (($i eq "[G]" or $i eq "[C]" or $i eq "[M]" or
$i eq "[X]" or $i eq "[U]") and defined $prog) {
$type = substr($i,1,1);
$i eq "[X]" or $i eq "[U]" or $i eq "[MX]") and defined $prog) {
$type = substr($i,1,(length $i)-2);
} else {
push @$listref, $i;
}
@ -122,7 +122,8 @@ foreach $i (@prognames) {
sort @{$programs{$i}};
$programs{$i} = [@list];
foreach $j (@list) {
# Dependencies for "x" start with "x.c".
# Dependencies for "x" start with "x.c" or "x.m" (depending on
# which one exists).
# 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.
@ -135,10 +136,9 @@ foreach $i (@prognames) {
$file = "$1.r";
$depends{$j} = [$file];
push @scanlist, $file;
} elsif ($j =~ /\.lib$/) {
# libraries don't have dependencies
} else {
} elsif ($j !~ /\./) {
$file = "$j.c";
$file = "$j.m" unless &findfile($file);
$depends{$j} = [$file];
push @scanlist, $file;
}
@ -209,7 +209,7 @@ sub mfval($) {
# Returns true if the argument is a known makefile type. Otherwise,
# prints a warning and returns false;
if (grep { $type eq $_ }
("vc","vcproj","cygwin","borland","lcc","gtk","mpw")) {
("vc","vcproj","cygwin","borland","lcc","gtk","mpw","osx")) {
return 1;
}
warn "$.:unknown makefile type '$type'\n";
@ -237,7 +237,9 @@ sub dirpfx {
sub findfile {
my ($name) = @_;
my $dir, $i, $outdir = "";
my $dir;
my $i;
my $outdir = undef;
unless (defined $findfilecache{$name}) {
$i = 0;
foreach $dir (@srcdirs) {
@ -245,7 +247,7 @@ sub findfile {
$outdir=~s/^\.\///;
}
die "multiple instances of source file $name\n" if $i > 1;
$findfilecache{$name} = $outdir . $name;
$findfilecache{$name} = (defined $outdir ? $outdir . $name : undef);
}
return $findfilecache{$name};
}
@ -263,7 +265,7 @@ sub objects {
} elsif ($i =~ /^(.*)\.lib/) {
$y = $1;
($x = $ltmpl) =~ s/X/$y/;
} else {
} elsif ($i !~ /\./) {
($x = $otmpl) =~ s/X/$i/;
}
push @ret, $x if $x ne "";
@ -271,6 +273,19 @@ sub objects {
return join " ", @ret;
}
sub special {
my ($prog, $suffix) = @_;
my @ret;
my ($i, $x, $y);
@ret = ();
foreach $i (@{$programs{$prog}}) {
if (substr($i, (length $i) - (length $suffix)) eq $suffix) {
push @ret, $i;
}
}
return (scalar @ret) ? (join " ", @ret) : undef;
}
sub splitline {
my ($line, $width, $splitchar) = @_;
my ($result, $len);
@ -318,7 +333,7 @@ sub prognames {
@ret = ();
foreach $n (@prognames) {
($prog, $type) = split ",", $n;
push @ret, $n if index($types, $type) >= 0;
push @ret, $n if index(":$types:", ":$type:") >= 0;
}
return @ret;
}
@ -330,7 +345,7 @@ sub progrealnames {
@ret = ();
foreach $n (@prognames) {
($prog, $type) = split ",", $n;
push @ret, $prog if index($types, $type) >= 0;
push @ret, $prog if index(":$types:", ":$type:") >= 0;
}
return @ret;
}
@ -339,7 +354,7 @@ sub manpages {
my ($types,$suffix) = @_;
# assume that all UNIX programs have a man page
if($suffix eq "1" && $types =~ /X/) {
if($suffix eq "1" && $types =~ /:X:/) {
return map("$_.1", &progrealnames($types));
}
return ();
@ -382,9 +397,9 @@ if (defined $makefiles{'cygwin'}) {
"\n".
".SUFFIXES:\n".
"\n";
print &splitline("all:" . join "", map { " $_.exe" } &progrealnames("GC"));
print &splitline("all:" . join "", map { " $_.exe" } &progrealnames("G:C"));
print "\n\n";
foreach $p (&prognames("GC")) {
foreach $p (&prognames("G:C")) {
($prog, $type) = split ",", $p;
$objstr = &objects($p, "X.o", "X.res.o", undef);
print &splitline($prog . ".exe: " . $objstr), "\n";
@ -459,16 +474,16 @@ if (defined $makefiles{'borland'}) {
&splitline("\tbrcc32 \$(RCFL) -i \$(BCB)\\include -r".
" -DNO_WINRESRC_H -DWIN32 -D_WIN32 -DWINVER=0x0401 \$*.rc",69)."\n".
"\n";
print &splitline("all:" . join "", map { " $_.exe" } &progrealnames("GC"));
print &splitline("all:" . join "", map { " $_.exe" } &progrealnames("G:C"));
print "\n\n";
foreach $p (&prognames("GC")) {
foreach $p (&prognames("G:C")) {
($prog, $type) = split ",", $p;
$objstr = &objects($p, "X.obj", "X.res", undef);
print &splitline("$prog.exe: " . $objstr . " $prog.rsp"), "\n";
my $ap = ($type eq "G") ? "-aa" : "-ap";
print "\tilink32 $ap -Gn -L\$(BCB)\\lib \@$prog.rsp\n\n";
}
foreach $p (&prognames("GC")) {
foreach $p (&prognames("G:C")) {
($prog, $type) = split ",", $p;
print $prog, ".rsp: \$(MAKEFILE)\n";
$objstr = &objects($p, "X.obj", undef, undef);
@ -539,15 +554,15 @@ if (defined $makefiles{'vc'}) {
"LFLAGS = /incremental:no /fixed\n".
"\n".
"\n";
print &splitline("all:" . join "", map { " $_.exe" } &progrealnames("GC"));
print &splitline("all:" . join "", map { " $_.exe" } &progrealnames("G:C"));
print "\n\n";
foreach $p (&prognames("GC")) {
foreach $p (&prognames("G:C")) {
($prog, $type) = split ",", $p;
$objstr = &objects($p, "X.obj", "X.res", undef);
print &splitline("$prog.exe: " . $objstr . " $prog.rsp"), "\n";
print "\tlink \$(LFLAGS) -out:$prog.exe -map:$prog.map \@$prog.rsp\n\n";
}
foreach $p (&prognames("GC")) {
foreach $p (&prognames("G:C")) {
($prog, $type) = split ",", $p;
print $prog, ".rsp: \$(MAKEFILE)\n";
$objstr = &objects($p, "X.obj", "X.res", "X.lib");
@ -620,7 +635,7 @@ if (defined $makefiles{'vcproj'}) {
%all_object_deps = map {$_->{obj} => $_->{deps}} @deps;
# Create the project files
# Get names of all Windows projects (GUI and console)
my @prognames = &prognames("GC");
my @prognames = &prognames("G:C");
foreach $progname (@prognames) {
create_project(\%all_object_deps, $progname);
}
@ -897,9 +912,9 @@ if (defined $makefiles{'gtk'}) {
".SUFFIXES:\n".
"\n".
"\n";
print &splitline("all:" . join "", map { " $_" } &progrealnames("XU"));
print &splitline("all:" . join "", map { " $_" } &progrealnames("X:U"));
print "\n\n";
foreach $p (&prognames("XU")) {
foreach $p (&prognames("X:U")) {
($prog, $type) = split ",", $p;
$objstr = &objects($p, "X.o", undef, undef);
print &splitline($prog . ": " . $objstr), "\n";
@ -915,7 +930,7 @@ if (defined $makefiles{'gtk'}) {
print "\n";
print $makefile_extra{'gtk'};
print "\nclean:\n".
"\trm -f *.o". (join "", map { " $_" } &progrealnames("XU")) . "\n";
"\trm -f *.o". (join "", map { " $_" } &progrealnames("X:U")) . "\n";
select STDOUT; close OUT;
}
@ -1084,9 +1099,9 @@ if (defined $makefiles{'lcc'}) {
"\n".
"# Get include directory for resource compiler\n".
"\n";
print &splitline("all:" . join "", map { " $_.exe" } &progrealnames("GC"));
print &splitline("all:" . join "", map { " $_.exe" } &progrealnames("G:C"));
print "\n\n";
foreach $p (&prognames("GC")) {
foreach $p (&prognames("G:C")) {
($prog, $type) = split ",", $p;
$objstr = &objects($p, "X.obj", "X.res", undef);
print &splitline("$prog.exe: " . $objstr ), "\n";
@ -1116,3 +1131,76 @@ if (defined $makefiles{'lcc'}) {
select STDOUT; close OUT;
}
if (defined $makefiles{'osx'}) {
$dirpfx = &dirpfx($makefiles{'osx'}, "/");
##-- Mac OS X makefile
open OUT, ">$makefiles{'osx'}"; select OUT;
print
"# Makefile for $project_name under Mac OS X.\n".
"#\n# This file was created by `mkfiles.pl' from the `Recipe' file.\n".
"# DO NOT EDIT THIS FILE DIRECTLY; edit Recipe or mkfiles.pl instead.\n";
# gcc command line option is -D not /D
($_ = $help) =~ s/=\/D/=-D/gs;
print $_;
print
"CC = \$(TOOLPATH)gcc\n".
"\n".
&splitline("CFLAGS = -O2 -Wall -Werror -g " .
(join " ", map {"-I$dirpfx$_"} @srcdirs))."\n".
"MLDFLAGS = -framework Cocoa\n".
"ULDFLAGS =\n".
&splitline("all:" . join "", map { " $_" } &progrealnames("MX:U")) .
"\n" .
$makefile_extra{'osx'} .
"\n";
foreach $p (&prognames("MX")) {
($prog, $type) = split ",", $p;
$objstr = &objects($p, "X.o", undef, undef);
$icon = &special($p, ".icns");
$infoplist = &special($p, "info.plist");
print "${prog}.app:\n\tmkdir -p \$\@\n";
print "${prog}.app/Contents: ${prog}.app\n\tmkdir -p \$\@\n";
print "${prog}.app/Contents/MacOS: ${prog}.app/Contents\n\tmkdir -p \$\@\n";
$targets = "${prog}.app/Contents/MacOS/$prog";
if (defined $icon) {
print "${prog}.app/Contents/Resources: ${prog}.app/Contents\n\tmkdir -p \$\@\n";
print "${prog}.app/Contents/Resources/${prog}.icns: ${prog}.app/Contents/Resources $icon\n\tcp $icon \$\@\n";
$targets .= " ${prog}.app/Contents/Resources/${prog}.icns";
}
if (defined $infoplist) {
print "${prog}.app/Contents/Info.plist: ${prog}.app/Contents/Resources $infoplist\n\tcp $infoplist \$\@\n";
$targets .= " ${prog}.app/Contents/Info.plist";
}
$targets .= " \$(${prog}_extra)";
print &splitline("${prog}: $targets", 69) . "\n\n";
print &splitline("${prog}.app/Contents/MacOS/$prog: ".
"${prog}.app/Contents/MacOS " . $objstr), "\n";
$libstr = &objects($p, undef, undef, "-lX");
print &splitline("\t\$(CC)" . $mw . " \$(MLDFLAGS) -o \$@ " .
$objstr . " $libstr", 69), "\n\n";
}
foreach $p (&prognames("U")) {
($prog, $type) = split ",", $p;
$objstr = &objects($p, "X.o", undef, undef);
print &splitline($prog . ": " . $objstr), "\n";
$libstr = &objects($p, undef, undef, "-lX");
print &splitline("\t\$(CC)" . $mw . " \$(ULDFLAGS) -o \$@ " .
$objstr . " $libstr", 69), "\n\n";
}
foreach $d (&deps("X.o", undef, $dirpfx, "/")) {
print &splitline(sprintf("%s: %s", $d->{obj}, join " ", @{$d->{deps}})),
"\n";
$firstdep = $d->{deps}->[0];
if ($firstdep =~ /\.c$/) {
print "\t\$(CC) \$(COMPAT) \$(FWHACK) \$(XFLAGS) \$(CFLAGS) -c \$<\n";
} elsif ($firstdep =~ /\.m$/) {
print "\t\$(CC) -x objective-c \$(COMPAT) \$(FWHACK) \$(XFLAGS) \$(CFLAGS) -c \$<\n";
}
}
print "\nclean:\n".
"\trm -f *.o *.dmg\n".
"\trm -rf *.app\n";
select STDOUT; close OUT;
}

View File

@ -9,6 +9,10 @@
#include "macstuff.h"
#elif defined(MACOSX)
#include "osx.h"
#else
#include "unix.h"