296
|
1 /* system description file for cygwin32.
|
231
|
2 Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
|
|
3
|
|
4 This file is part of GNU Emacs.
|
|
5
|
|
6 GNU Emacs is free software; you can redistribute it and/or modify
|
|
7 it under the terms of the GNU General Public License as published by
|
|
8 the Free Software Foundation; either version 2, or (at your option)
|
|
9 any later version.
|
|
10
|
|
11 GNU Emacs is distributed in the hope that it will be useful,
|
|
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14 GNU General Public License for more details.
|
|
15
|
|
16 You should have received a copy of the GNU General Public License
|
|
17 along with XEmacs; see the file COPYING. If not, write to
|
|
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
19 Boston, MA 02111-1307, USA. */
|
|
20
|
239
|
21 /* Building under cygwin
|
|
22 *
|
|
23 * The approach I have taken with this port is to use primarily the UNIX
|
|
24 * code base adding stuff that is MS-Windows specific. This works quite
|
|
25 * well, and is in keeping with my perception of the cygwin philosophy.
|
|
26 * Note that if you make changes to this file you do NOT want to define
|
|
27 * WINDOWSNT, I repeat - do not define this, it will break everything
|
|
28 * horribly. What does get defined is HAVE_MS_WINDOWS, but this is
|
|
29 * done by configure and only applies to the window system.
|
|
30 *
|
388
|
31 * When building make sure your HOME path is unix style - i.e. without
|
|
32 * a drive letter.
|
259
|
33 *
|
388
|
34 * once you have done this, configure and make.
|
251
|
35 *
|
259
|
36 * windows '95 - I haven't tested this under '95, it will probably
|
|
37 * build but I konw there are some limitations with cygwin under 95 so
|
|
38 * YMMV. I build with NT4 SP3.
|
|
39 *
|
388
|
40 * Andy Piper <andy@xemacs.org> 8/1/98
|
398
|
41 * http://www.xemacs.freeserve.co.uk/ */
|
231
|
42
|
251
|
43 /* cheesy way to determine cygwin version */
|
231
|
44 #ifndef NOT_C_CODE
|
251
|
45 #include <signal.h>
|
377
|
46 #ifdef HAVE_CYGWIN_VERSION_H
|
|
47 #include <cygwin/version.h>
|
373
|
48 #else
|
251
|
49 #ifdef SIGIO
|
398
|
50 #define CYGWIN_VERSION_DLL_MAJOR 19
|
|
51 #define CYGWIN_VERSION_DLL_MINOR 0
|
251
|
52 #define CYGWIN_B19
|
|
53 #else
|
398
|
54 #define CYGWIN_VERSION_DLL_MAJOR 18
|
|
55 #define CYGWIN_VERSION_DLL_MINOR 0
|
251
|
56 #define BROKEN_CYGWIN
|
|
57 #endif
|
373
|
58 #endif
|
|
59
|
259
|
60 extern void cygwin32_win32_to_posix_path_list(const char*, char*);
|
|
61 extern int cygwin32_win32_to_posix_path_list_buf_size(const char*);
|
265
|
62 extern void cygwin32_posix_to_win32_path_list(const char*, char*);
|
|
63 extern int cygwin32_posix_to_win32_path_list_buf_size(const char*);
|
398
|
64 #if CYGWIN_VERSION_DLL_MAJOR < 20
|
263
|
65 struct timeval;
|
|
66 struct timezone;
|
278
|
67 struct itimerval;
|
|
68 struct stat;
|
263
|
69 extern int gettimeofday(struct timeval *tp, struct timezone *tzp);
|
|
70 extern int gethostname (char* name, int namelen);
|
|
71 extern char* mktemp(char *);
|
|
72 extern double logb(double);
|
|
73 extern void sync();
|
|
74 extern int ioctl(int, int, ...);
|
278
|
75 /* sys/stat.h */
|
|
76 extern int lstat(const char *path, struct stat *buf);
|
|
77 /* unistd.h */
|
|
78 extern int readlink(const char *path, void *buf, unsigned int bufsiz);
|
|
79 extern int symlink(const char *name1, const char *name2);
|
|
80 /* sys/time.h */
|
|
81 extern int setitimer(int which, const struct itimerval *value,
|
|
82 struct itimerval *ovalue);
|
|
83 extern int utimes(char *file, struct timeval *tvp);
|
|
84
|
|
85 extern int srandom( unsigned seed);
|
|
86 extern long random();
|
373
|
87
|
|
88 #define SND_ASYNC 1
|
|
89 #define SND_NODEFAULT 2
|
|
90 #define SND_MEMORY 4
|
|
91 #define SND_FILENAME 0x2000L
|
|
92 #define VK_APPS 0x5D
|
|
93 #define SIF_TRACKPOS 0x0010
|
375
|
94 #define ICC_BAR_CLASSES 4
|
|
95 #define FW_BLACK FW_HEAVY
|
|
96 #define FW_ULTRABOLD FW_EXTRABOLD
|
|
97 #define FW_DEMIBOLD FW_SEMIBOLD
|
|
98 #define FW_ULTRALIGHT FW_EXTRALIGHT
|
|
99 #define APPCMD_FILTERINITS 0x20L
|
|
100 #define CBF_FAIL_SELFCONNECTIONS 0x1000
|
|
101 #define CBF_SKIP_ALLNOTIFICATIONS 0x3C0000
|
|
102 #define CBF_FAIL_ADVISES 0x4000
|
|
103 #define CBF_FAIL_POKES 0x10000
|
|
104 #define CBF_FAIL_REQUESTS 0x20000
|
|
105 #define SZDDESYS_TOPIC "System"
|
|
106 #define JOHAB_CHARSET 130
|
|
107 #define MAC_CHARSET 77
|
|
108
|
373
|
109 #endif
|
355
|
110 #endif
|
|
111
|
398
|
112 #ifndef SPI_GETWHEELSCROLLLINES
|
|
113 #define SPI_GETWHEELSCROLLLINES 104
|
|
114 #endif
|
|
115 #ifndef WHEEL_PAGESCROLL
|
|
116 #define WHEEL_PAGESCROLL (UINT_MAX)
|
|
117 #endif
|
|
118 #ifndef WHEEL_DELTA
|
|
119 #define WHEEL_DELTA 120
|
|
120 #endif
|
|
121 #ifndef WM_MOUSEWHEEL
|
|
122 #define WM_MOUSEWHEEL 0x20A
|
|
123 #endif
|
|
124 #ifndef TCS_BOTTOM
|
|
125 #define TCS_BOTTOM 0x0002
|
|
126 #endif
|
|
127 #ifndef TCS_VERTICAL
|
|
128 #define TCS_VERTICAL 0x0080
|
|
129 #endif
|
|
130 #ifndef PHYSICALWIDTH
|
|
131 #define PHYSICALWIDTH 110
|
|
132 #endif
|
|
133 #ifndef PHYSICALHEIGHT
|
|
134 #define PHYSICALHEIGHT 111
|
|
135 #endif
|
|
136 #ifndef PHYSICALOFFSETX
|
|
137 #define PHYSICALOFFSETX 112
|
|
138 #endif
|
|
139 #ifndef PHYSICALOFFSETY
|
|
140 #define PHYSICALOFFSETY 113
|
|
141 #endif
|
|
142
|
|
143
|
388
|
144 #define PBS_SMOOTH 0x01
|
|
145
|
245
|
146 #ifdef HAVE_MS_WINDOWS
|
231
|
147 #define HAVE_NTGUI
|
239
|
148 #define HAVE_FACES
|
245
|
149 #endif
|
231
|
150
|
|
151 #ifndef ORDINARY_LINK
|
|
152 #define ORDINARY_LINK
|
|
153 #endif
|
|
154
|
278
|
155 #define C_SWITCH_SYSTEM -Wno-sign-compare -fno-caller-saves
|
265
|
156 #define LIBS_SYSTEM -lwinmm
|
231
|
157
|
245
|
158
|
|
159 #define TEXT_START -1
|
|
160 #define TEXT_END -1
|
|
161 #define DATA_END -1
|
251
|
162 #define HEAP_IN_DATA
|
245
|
163 #define UNEXEC "unexcw.o"
|
377
|
164
|
|
165 #ifdef CYGWIN_VERSION_DLL_MAJOR
|
392
|
166 #if 0
|
398
|
167 /* #### FIXME: although defining BROKEN_SIGIO is correct for proper ^G
|
392
|
168 behavior, bugs in cygwin mean that xemacs locks up frequently if
|
|
169 this is defined. */
|
377
|
170 #define BROKEN_SIGIO
|
392
|
171 #endif
|
377
|
172 #else
|
296
|
173 #define PROCESS_IO_BLOCKING
|
377
|
174 #endif
|
251
|
175 #define strnicmp strncasecmp
|
|
176 #ifndef HAVE_SOCKETS
|
|
177 #define HAVE_SOCKETS
|
|
178 #endif
|
265
|
179 #define OBJECTS_SYSTEM ntplay.o
|
|
180 #define HAVE_NATIVE_SOUND
|
251
|
181
|
231
|
182 #undef MAIL_USE_SYSTEM_LOCK
|
259
|
183 #define MAIL_USE_POP
|
231
|
184
|
|
185 /* Define NO_ARG_ARRAY if you cannot take the address of the first of a
|
|
186 * group of arguments and treat it as an array of the arguments. */
|
|
187
|
|
188 #define NO_ARG_ARRAY
|
|
189
|
|
190 /* Data type of load average, as read out of kmem. */
|
|
191
|
|
192 #define LOAD_AVE_TYPE long
|
|
193
|
|
194 /* Convert that into an integer that is 100 for a load average of 1.0 */
|
|
195
|
|
196 #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
|
|
197
|
|
198 /* Define VIRT_ADDR_VARIES if the virtual addresses of
|
|
199 pure and impure space as loaded can vary, and even their
|
|
200 relative order cannot be relied on.
|
|
201
|
|
202 Otherwise Emacs assumes that text space precedes data space,
|
|
203 numerically. */
|
|
204
|
|
205 /* Text does precede data space, but this is never a safe assumption. */
|
|
206 #define VIRT_ADDR_VARIES
|
|
207
|
|
208 /* If you are compiling with a non-C calling convention but need to
|
|
209 declare vararg routines differently, put it here */
|
|
210 #define _VARARGS_ __cdecl
|
|
211
|
|
212 /* If you are providing a function to something that will call the
|
|
213 function back (like a signal handler and signal, or main) its calling
|
|
214 convention must be whatever standard the libraries expect */
|
|
215 #define _CALLBACK_ __cdecl
|
|
216
|
|
217 /* SYSTEM_TYPE should indicate the kind of system you are using.
|
|
218 It sets the Lisp variable system-type. */
|
|
219
|
245
|
220 #define SYSTEM_TYPE "cygwin32"
|
231
|
221
|
|
222 #define NO_MATHERR
|
|
223
|
|
224 /* define MAIL_USE_FLOCK if the mailer uses flock
|
|
225 to interlock access to /usr/spool/mail/$USER.
|
|
226 The alternative is that a lock file named
|
|
227 /usr/spool/mail/$USER.lock. */
|
|
228
|
|
229 /* If the character used to separate elements of the executable path
|
|
230 is not ':', #define this to be the appropriate character constant. */
|
245
|
231 #define SEPCHAR ':'
|
231
|
232
|
|
233 /* ============================================================ */
|
|
234
|
|
235 /* Here, add any special hacks needed
|
|
236 to make Emacs work on this system. For example,
|
|
237 you might define certain system call names that don't
|
|
238 exist on your system, or that do different things on
|
|
239 your system and must be used only through an encapsulation
|
|
240 (Which you should place, by convention, in sysdep.c). */
|
|
241
|
|
242 /* Define this to be the separator between path elements */
|
|
243 /* #define DIRECTORY_SEP XINT (Vdirectory_sep_char) */
|
|
244
|
|
245 /* Define this to be the separator between devices and paths */
|
|
246 #define DEVICE_SEP ':'
|
|
247
|
|
248 /* We'll support either convention on NT. */
|
|
249 #define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\')
|
|
250 #define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_))
|
|
251 #define EXEC_SUFFIXES ".exe:.com:.bat:.cmd:"
|
|
252
|
|
253 /* We need a little extra space, see ../../lisp/loadup.el */
|
|
254 #define SYSTEM_PURESIZE_EXTRA 15000
|
|
255
|
259
|
256 #define CYGWIN_CONV_PATH(src, dst) \
|
|
257 dst = alloca (cygwin32_win32_to_posix_path_list_buf_size(src)); \
|
|
258 cygwin32_win32_to_posix_path_list(src, dst)
|
265
|
259 #define CYGWIN_WIN32_PATH(src, dst) \
|
|
260 dst = alloca (cygwin32_posix_to_win32_path_list_buf_size(src)); \
|
|
261 cygwin32_posix_to_win32_path_list(src, dst)
|
259
|
262
|
251
|
263 /*
|
|
264 * stolen from usg.
|
|
265 */
|
|
266 #define HAVE_PTYS
|
|
267 #define FIRST_PTY_LETTER 'z'
|
|
268
|
|
269 /* Pseudo-terminal support under SVR4 only loops to deal with errors. */
|
|
270
|
388
|
271 #define PTY_ITERATION for (i = 0, c = 0; i < 1; i++)
|
251
|
272
|
|
273 /* This sets the name of the master side of the PTY. */
|
|
274
|
|
275 #define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx");
|
|
276
|
|
277 /* This sets the name of the slave side of the PTY. On SysVr4,
|
|
278 grantpt(3) forks a subprocess, so keep sigchld_handler() from
|
|
279 intercepting that death. If any child but grantpt's should die
|
|
280 within, it should be caught after EMACS_UNBLOCK_SIGNAL. */
|
|
281
|
|
282 #define PTY_OPEN \
|
|
283 fd = open (pty_name, O_RDWR | O_NONBLOCK | OPEN_BINARY, 0)
|
|
284
|
|
285 #define PTY_TTY_NAME_SPRINTF \
|
|
286 { \
|
265
|
287 extern char* ptsname(int); \
|
251
|
288 char *ptyname; \
|
|
289 \
|
|
290 if (!(ptyname = ptsname (fd))) \
|
|
291 { close (fd); return -1; } \
|
|
292 strncpy (pty_name, ptyname, sizeof (pty_name)); \
|
|
293 pty_name[sizeof (pty_name) - 1] = 0; \
|
|
294 }
|
|
295
|
231
|
296 /* ============================================================ */
|
251
|
297
|