Ticket #1263: patch-vnc.darwin

File patch-vnc.darwin, 9.8 KB (added by sandy@…, 20 years ago)

a new patch file, tested on Jaguar and Panther

Line 
1diff -r -c -N vnc-3.3.7-unixsrc/Xvnc/config/cf/Imake.cf patched/vnc-3.3.7-unixsrc/Xvnc/config/cf/Imake.cf
2*** vnc-3.3.7-unixsrc/Xvnc/config/cf/Imake.cf   Sat May 11 06:57:05 2002
3--- patched/vnc-3.3.7-unixsrc/Xvnc/config/cf/Imake.cf   Tue Feb  3 22:17:11 2004
4***************
5*** 19,24 ****
6--- 19,39 ----
7   *     4.  Create a .cf file with the name given by MacroFile.
8   */
9 
10+ #if defined(__APPLE__)
11+ # undef __APPLE__
12+ # define MacroIncludeFile <darwin.cf>
13+ # define MacroFile darwin.cf
14+ # define DarwinArchitecture
15+ # ifdef __ppc__
16+ #  define PpcDarwinArchitecture
17+ #  undef __ppc__
18+ # endif
19+ # ifdef __i386__
20+ #  define i386DarwinArchitecture
21+ #  undef __i386__
22+ # endif
23+ #endif
24+
25  #if defined(clipper) || defined(__clipper__)
26  # undef clipper
27  # define MacroIncludeFile <ingr.cf>
28diff -r -c -N vnc-3.3.7-unixsrc/Xvnc/config/cf/darwin.cf patched/vnc-3.3.7-unixsrc/Xvnc/config/cf/darwin.cf
29*** vnc-3.3.7-unixsrc/Xvnc/config/cf/darwin.cf  Wed Dec 31 19:00:00 1969
30--- patched/vnc-3.3.7-unixsrc/Xvnc/config/cf/darwin.cf  Tue Feb  3 22:18:54 2004
31***************
32*** 0 ****
33--- 1,115 ----
34+ /* Darwin / Mac OS X configuration by John Carmack <johnc@idsoftware.com> */
35+
36+ /* imake determines the default values by parsing uname */
37+ #define OSName                  DefaultOSName
38+ #define OSMajorVersion          DefaultOSMajorVersion
39+ #define OSMinorVersion          DefaultOSMinorVersion
40+ #define OSTeenyVersion          DefaultOSTeenyVersion
41+
42+ XCOMM operating system:  OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVersion)
43+
44+ /*
45+  * Define the operating system's capabilities
46+  */
47+ #define HasSnprintf             YES
48+ #define HasPutenv               YES
49+ #define HasBSD44Sockets         YES
50+ #define HasUsableFileMmap       YES
51+ #define HasZlib                 YES
52+ #ifndef HasShm
53+ # define HasShm                 YES
54+ #endif
55+ #define HasNdbm                 YES
56+
57+ #ifndef HasGroff
58+ # define HasGroff               YES
59+ #endif
60+
61+ /* Libtool on Darwin always uses minor numbers */
62+ #define LibtoolMinorVersions  YES
63+
64+ /* The most common file system, HFS+, is not case sensitive. */
65+ #ifndef CaseSensitiveFileSystem
66+ # define CaseSensitiveFileSystem NO
67+ #endif
68+
69+ /* we don't need -lm */
70+ #define MathLibrary             /**/
71+
72+ /* we don't have a termcap library */
73+ #define TermcapLibrary          /**/
74+
75+ /* we don't have a dbm library */
76+ #define DBMLibrary              /**/
77+
78+ #define MkdirHierCmd            mkdir -p
79+
80+ /* our cpp isn't in /lib/cpp and it doesn't like -undef */
81+ #define CppCmd                  cpp
82+ #define RawCppCmd               CppCmd
83+
84+ /* we have a gcc compatible compiler, but its not called gcc */
85+ #define CcCmd                   cc
86+ #define CplusplusCmd            c++
87+
88+ /* default flags to pass to cc */
89+ # define DefaultCCOptions       -Wpointer-arith -no-cpp-precomp
90+
91+ /* flags to pass to cc when building libraries */
92+ #ifndef LibraryCCOptions
93+ # define LibraryCCOptions       DefaultCCOptions -fno-common
94+ #endif
95+
96+ #ifdef PpcDarwinArchitecture
97+ # define DarwinMachineDefines   -D__powerpc__
98+ # define OptimizedCDebugFlags   -O2
99+ # define ByteOrder              X_BIG_ENDIAN
100+ #endif /* PpcDarwinArchitecture */
101+
102+ #ifdef i386DarwinArchitecture
103+ # define DarwinMachineDefines   -D__i386__
104+ # define OptimizedCDebugFlags   -O2 -fno-strength-reduce
105+ # define ByteOrder              X_LITTLE_ENDIAN
106+ #endif /* i386DarwinArchitecture */
107+
108+ /*
109+  * __DARWIN__ will be used for platform specific #ifdefs that can't
110+  * be handled by existing X defines.
111+  *
112+  * Darwin's alloca() seg faults (rather than returning NULL) on failed
113+  * allocations, so we can't use it.
114+  *
115+  * Darwin's setlocale() doesn't work properly, so use X11's instead.
116+  */
117+ #define StandardDefines         DarwinMachineDefines -D__DARWIN__ \
118+                                 -DNO_ALLOCA -DX_LOCALE
119+
120+ /*
121+  * Set this to NO to just build the client libs, which should work without
122+  * having to write any platform specific code.
123+  */
124+ #define BuildServer             YES
125+
126+ /* our custom X server */
127+ #define XDarwinServer           YES
128+
129+ #define UsrLibDir               /usr/X11R6/lib
130+ /* Thanks to the IOKit, the X server does not have to be SetUID. */
131+ #ifndef InstallXserverSetUID
132+ # define InstallXserverSetUID   NO
133+ #endif
134+
135+ /* no direct graphics extension */
136+ #define BuildXF86DGA            NO
137+
138+ /* no server support for extra tablets and weird input devices */
139+ #define BuildXInputExt          NO
140+ #define BuildXInputLib          YES
141+
142+ /* no Display Power Management extension */
143+ #define BuildDPMSExt            NO
144+
145+ #define BuildLibPathVar         DYLD_LIBRARY_PATH
146+
147+ /* include all the XFree86 rules */
148+ #include <xfree86.cf>
149diff -r -c -N vnc-3.3.7-unixsrc/Xvnc/config/imake/imakemdep.h patched/vnc-3.3.7-unixsrc/Xvnc/config/imake/imakemdep.h
150*** vnc-3.3.7-unixsrc/Xvnc/config/imake/imakemdep.h     Sat May 11 06:57:05 2002
151--- patched/vnc-3.3.7-unixsrc/Xvnc/config/imake/imakemdep.h     Tue Feb  3 22:20:18 2004
152***************
153*** 269,274 ****
154--- 269,277 ----
155  /* expects cpp in PATH */
156  #define DEFAULT_CPP "cpp"
157  #endif
158+ #if defined(__APPLE__)
159+ #define DEFAULT_CPP "cpp"
160+ #endif
161 
162  /*
163   * Step 5:  cpp_argv
164***************
165*** 537,542 ****
166--- 540,548 ----
167        "-traditional",
168        "-Demxos2",
169  #endif
170+ #if defined(__APPLE__)
171+         "-D__APPLE__",
172+ #endif
173 
174  };
175 
176***************
177*** 596,601 ****
178--- 602,613 ----
179  # define DEFAULT_OS_MINOR_REV "r %*d.%[0-9]"
180  # define DEFAULT_OS_TEENY_REV "r %*d.%*d.%[0-9]"
181  # define DEFAULT_OS_NAME      "srm %[^\n]"
182+ #elif defined(__APPLE__)     
183+ /* uname -v returns "x.yz" or "x.y.z", e.g. "2.02" or "2.1.2". */
184+ # define DEFAULT_OS_MAJOR_REV "r %[0-9]"
185+ # define DEFAULT_OS_MINOR_REV "r %*d.%[0-9]"
186+ # define DEFAULT_OS_TEENY_REV "r %*d.%*d.%[0-9]" /* this will just get 0 */
187+ # define DEFAULT_OS_NAME      "s %[^\n]"
188  #elif defined(ISC)
189  /* ISC all Versions ? */
190  /* uname -r returns "x.y", e.g. "3.2" ,uname -v returns "x" e.g. "2" */
191***************
192*** 904,909 ****
193--- 916,927 ----
194  #endif
195  #ifdef __EMX__
196        {"__EMX__", "1"},
197+ #endif
198+ #if defined(__ppc__)
199+         {"__ppc__", "1"},
200+ #endif
201+ #if defined(__BIG_ENDIAN__)
202+       {"__BIG_ENDIAN__", "1"},
203  #endif
204        /* add any additional symbols before this line */
205        {NULL, NULL}
206diff -r -c -N vnc-3.3.7-unixsrc/Xvnc/programs/Xserver/hw/vnc/zrle.cc patched/vnc-3.3.7-unixsrc/Xvnc/programs/Xserver/hw/vnc/zrle.cc
207*** vnc-3.3.7-unixsrc/Xvnc/programs/Xserver/hw/vnc/zrle.cc      Sun Sep  1 11:58:21 2002
208--- patched/vnc-3.3.7-unixsrc/Xvnc/programs/Xserver/hw/vnc/zrle.cc      Tue Feb  3 22:47:35 2004
209***************
210*** 24,29 ****
211--- 24,30 ----
212  //
213 
214  #include <stdio.h>
215+ #include <assert.h>
216  extern "C" {
217  #include "rfb.h"
218  }
219diff -r -c -N vnc-3.3.7-unixsrc/Xvnc/programs/Xserver/include/servermd.h patched/vnc-3.3.7-unixsrc/Xvnc/programs/Xserver/include/servermd.h
220*** vnc-3.3.7-unixsrc/Xvnc/programs/Xserver/include/servermd.h  Sat May 11 06:57:06 2002
221--- patched/vnc-3.3.7-unixsrc/Xvnc/programs/Xserver/include/servermd.h  Tue Feb  3 22:21:00 2004
222***************
223*** 132,137 ****
224--- 132,154 ----
225 
226  #endif /* vax */
227 
228+ #ifdef __DARWIN__
229+
230+ #define IMAGE_BYTE_ORDER        MSBFirst
231+ #define BITMAP_BIT_ORDER        MSBFirst
232+ #define GLYPHPADBYTES           4
233+ #define GETLEFTBITS_ALIGNMENT   1
234+
235+ #define LARGE_INSTRUCTION_CACHE
236+ #define FAST_CONSTANT_OFFSET_MODE
237+ #define PLENTIFUL_REGISTERS
238+ #define AVOID_MEMORY_READ
239+
240+ #define FAST_MEMCPY
241+
242+ #endif /* __DARWIN__ */
243+
244+
245  #if (defined(Lynx) && defined(__powerpc__))
246 
247  /* For now this is for Xvfb only */
248diff -r -c -N vnc-3.3.7-unixsrc/Xvnc/programs/Xserver/os/access.c patched/vnc-3.3.7-unixsrc/Xvnc/programs/Xserver/os/access.c
249*** vnc-3.3.7-unixsrc/Xvnc/programs/Xserver/os/access.c Sat May 11 06:57:06 2002
250--- patched/vnc-3.3.7-unixsrc/Xvnc/programs/Xserver/os/access.c Tue Feb  3 22:21:43 2004
251***************
252*** 103,109 ****
253  #endif
254 
255  #if !defined(AMOEBA)
256! #ifdef hpux
257  # include <sys/utsname.h>
258  # ifdef HAS_IFREQ
259  #  include <net/if.h>
260--- 103,109 ----
261  #endif
262 
263  #if !defined(AMOEBA)
264! #if defined(hpux) || defined(__DARWIN__)
265  # include <sys/utsname.h>
266  # ifdef HAS_IFREQ
267  #  include <net/if.h>
268***************
269*** 480,486 ****
270 
271  #else /* WINTCP */
272 
273! #if !defined(SIOCGIFCONF) || (defined (hpux) && ! defined (HAS_IFREQ))
274  void
275  DefineSelf (fd)
276      int fd;
277--- 480,486 ----
278 
279  #else /* WINTCP */
280 
281! #if !defined(SIOCGIFCONF) || (defined (hpux) && ! defined (HAS_IFREQ)) || defined(__DARWIN__)
282  void
283  DefineSelf (fd)
284      int fd;
285diff -r -c -N vnc-3.3.7-unixsrc/rfb/zrleEncode.h patched/vnc-3.3.7-unixsrc/rfb/zrleEncode.h
286*** vnc-3.3.7-unixsrc/rfb/zrleEncode.h  Sun Sep  1 11:58:21 2002
287--- patched/vnc-3.3.7-unixsrc/rfb/zrleEncode.h  Tue Feb  3 22:38:03 2004
288***************
289*** 32,38 ****
290  //
291 
292  #include <rdr/OutStream.h>
293- #include <assert.h>
294 
295  using namespace rdr;
296 
297--- 32,37 ----
298diff -r -c -N vnc-3.3.7-unixsrc/vncserver patched/vnc-3.3.7-unixsrc/vncserver
299*** vnc-3.3.7-unixsrc/vncserver Wed Oct 30 05:21:33 2002
300--- patched/vnc-3.3.7-unixsrc/vncserver Tue Feb  3 22:22:29 2004
301***************
302*** 37,45 ****
303  $depth = 16;
304  $desktopName = "X";
305  $vncClasses = (((-d "/usr/share/vnc/classes") && "/usr/share/vnc/classes") ||
306!                ((-d "/usr/local/vnc/classes") && "/usr/local/vnc/classes"));
307  $vncUserDir = "$ENV{HOME}/.vnc";
308! $xauthorityFile = "$ENV{XAUTHORITY}" || "$ENV{HOME}/.Xauthority";
309 
310  $defaultXStartup
311      = ("#!/bin/sh\n\n".
312--- 37,46 ----
313  $depth = 16;
314  $desktopName = "X";
315  $vncClasses = (((-d "/usr/share/vnc/classes") && "/usr/share/vnc/classes") ||
316!                ((-d "/usr/local/vnc/classes") && "/usr/local/vnc/classes") ||
317!                ((-d "@PREFIX@/share/vnc/classes") && "@PREFIX@/share/vnc/classes"));
318  $vncUserDir = "$ENV{HOME}/.vnc";
319! $xauthorityFile = "$ENV{XAUTHORITY}" || "$ENV{HOME}/.Xauthority" || "$vncUserDir/.XAuthority";
320 
321  $defaultXStartup
322      = ("#!/bin/sh\n\n".