aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorRichard M. Stallman1994-11-01 10:27:02 +0000
committerRichard M. Stallman1994-11-01 10:27:02 +0000
commit95ed00257adf283a2740cb3e4feb83c075620ef8 (patch)
tree8e82b5c8eae9e2d8d991c77cd52b06285be9b5c9 /lib-src
parentb0bfea296d4127efcfe8da3f2dfdddb7324e57ee (diff)
downloademacs-95ed00257adf283a2740cb3e4feb83c075620ef8.tar.gz
emacs-95ed00257adf283a2740cb3e4feb83c075620ef8.zip
Initial revision
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/makefile.nt326
-rw-r--r--lib-src/ntlib.c90
2 files changed, 416 insertions, 0 deletions
diff --git a/lib-src/makefile.nt b/lib-src/makefile.nt
new file mode 100644
index 00000000000..68239dd9a4d
--- /dev/null
+++ b/lib-src/makefile.nt
@@ -0,0 +1,326 @@
1# Makefile for GNU Emacs lib-src directory.
2# Geoff Voelker (voelker@cs.washington.edu)
3# Copyright (C) 1994 Free Software Foundation, Inc.
4#
5# This file is part of GNU Emacs.
6#
7# GNU Emacs is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2, or (at your option)
10# any later version.
11#
12# GNU Emacs is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with GNU Emacs; see the file COPYING. If not, write to
19# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
20#
21
22#
23# Sets up the system dependent macros.
24#
25!include ..\nt\makefile.def
26
27LOCAL_FLAGS = -DWINDOWSNT -DDOS_NT -DSTDC_HEADERS=1 -DNO_LDAV=1 -DNO_ARCHIVES=1 -I..\src
28OBJDIR = obj
29BLD = $(OBJDIR)\$(ARCH)
30
31LINK_FLAGS = $(ARCH_LDFLAGS) -debug:PARTIAL -machine:$(ARCH) -subsystem:console -entry:mainCRTStartup
32
33ALL = $(BLD)\make-docfile.exe \
34 $(BLD)\hexl.exe \
35 $(BLD)\wakeup.exe \
36 $(BLD)\ctags.exe \
37 $(BLD)\etags.exe
38
39
40# don't know what (if) to do with these yet...
41#
42# $(BLD)\sorted-doc.exe \
43# $(BLD)\env.exe \
44# $(BLD)\server.exe \
45# $(BLD)\emacstool.exe \
46# $(BLD)\fakemail.exe \
47# $(BLD)\leditcfns.exe \
48# $(BLD)\movemail.exe \
49# $(BLD)\emacsclient.exe \
50# $(BLD)\cvtmail.exe \
51# $(BLD)\digest-doc.exe \
52# $(BLD)\test-distrib.exe \
53
54
55LIBS = $(SYS_LIB_DIR)\setargv.obj \
56 $(SYS_LIB_DIR)\kernel32.lib \
57 $(SYS_LIB_DIR)\libc.lib
58
59# $(SYS_LIB_DIR)\advapi32.lib \
60
61$(BLD)\make-docfile.exe: $(LIBS) $(BLD)\make-docfile.obj
62$(BLD)\hexl.exe: $(LIBS) $(BLD)\hexl.obj
63$(BLD)\ctags.exe: $(BLD)\etags.exe
64 copy $(BLD)\etags.exe $(BLD)\ctags.exe
65$(BLD)\wakeup.exe: $(LIBS) $(BLD)\wakeup.obj $(BLD)\ntlib.obj
66 $(LINK) -out:$@ $(LINK_FLAGS) $(BLD)\wakeup.obj $(BLD)\ntlib.obj $(LIBS)
67
68make-docfile: $(BLD)\make-docfile.exe
69wakeup: $(BLD)\wakeup.exe
70etags: $(BLD)\etags.exe
71hexl: $(BLD)\hexl.exe
72
73ETAGSOBJ = $(BLD)\etags.obj \
74 $(BLD)\getopt.obj \
75 $(BLD)\getopt1.obj \
76 $(BLD)\ntlib.obj
77
78$(BLD)\etags.exe: $(LIBS) $(ETAGSOBJ)
79 link32 -out:$@ -debug:PARTIAL -machine:$(ARCH) -align:0x1000 -subsystem:console -entry:mainCRTStartup $(ETAGSOBJ) $(LIBS)
80
81#
82# don't know what to do with these yet...
83#
84# $(BLD)\sorted-doc.exe: $(LIBS) $(BLD)\sorted-doc.obj
85# $(BLD)\yow.exe: $(LIBS) $(BLD)\yow.obj
86# $(BLD)\emacstool.exe: $(LIBS) $(BLD)\emacstool.obj
87# $(BLD)\env.exe: $(LIBS) $(BLD)\env.obj
88# $(BLD)\fakemail.exe: $(LIBS) $(BLD)\fakemail.obj
89# $(BLD)\leditcfns.exe: $(LIBS) $(BLD)\leditcfns.obj
90# $(BLD)\server.exe: $(LIBS) $(BLD)\server.obj
91# $(BLD)\wakeup.exe: $(LIBS) $(BLD)\wakeup.obj
92# $(BLD)\movemail.exe: $(LIBS) $(BLD)\movemail.obj
93# $(BLD)\cvtmail.exe: $(LIBS) $(BLD)\cvtmail.obj
94# $(BLD)\digest-doc.exe: $(LIBS) $(BLD)\digest-doc.obj
95# $(BLD)\emacsclient.exe: $(LIBS) $(BLD)\emacsclient.obj
96# $(BLD)\qsort.exe: $(LIBS) $(BLD)\qsort.obj
97# $(BLD)\test-distrib.exe: $(LIBS) $(BLD)\test-distrib.obj
98
99#
100# From ..\makefile.nt, with .obj changed to .o
101#
102obj = abbrev.o alloc.o alloca.o buffer.o bytecode.o callint.o callproc.o casefiddle.o cm.o cmds.o data.o dired.o dispnew.o doc.o doprnt.o editfns.o eval.o fileio.o filelock.o filemode.o fns.o indent.o insdel.o keyboard.o keymap.o lastfile.o lread.o macros.o marker.o minibuf.o xfaces.o mocklisp.o nt.o ntheap.o ntinevt.o ntproc.o ntterm.o print.o process.o regex.o scroll.o search.o syntax.o sysdep.o term.o termcap.o tparam.o undo.o unexnt.o window.o xdisp.o casetab.o floatfns.o frame.o gmalloc.o intervals.o ralloc.o textprop.o vm-limit.o
103
104lispdir = ..\lisp
105
106#
107# These are the lisp files that are loaded up in loadup.el
108#
109lisp= \
110 $(lispdir)\subr.elc \
111 $(lispdir)\byte-run.elc \
112 $(lispdir)\map-ynp.elc \
113 $(lispdir)\loaddefs.el \
114 $(lispdir)\simple.elc \
115 $(lispdir)\help.elc \
116 $(lispdir)\files.elc \
117 $(lispdir)\indent.elc \
118 $(lispdir)\window.elc \
119 $(lispdir)\frame.elc \
120 $(lispdir)\mouse.elc \
121 $(lispdir)\menu-bar.elc \
122 $(lispdir)\scroll-bar.elc \
123 $(lispdir)\select.elc \
124 $(lispdir)\paths.el \
125 $(lispdir)\startup.elc \
126 $(lispdir)\lisp.elc \
127 $(lispdir)\page.elc \
128 $(lispdir)\register.elc \
129 $(lispdir)\paragraphs.elc \
130 $(lispdir)\lisp-mode.elc \
131 $(lispdir)\text-mode.elc \
132 $(lispdir)\fill.elc \
133 $(lispdir)\c-mode.elc \
134 $(lispdir)\isearch.elc \
135 $(lispdir)\replace.elc \
136 $(lispdir)\abbrev.elc \
137 $(lispdir)\buff-menu.elc \
138 $(lispdir)\winnt.elc \
139 $(lispdir)\float-sup.elc \
140 $(lispdir)\vc-hooks.elc \
141 $(lispdir)\version.el
142
143DOC = DOC
144$(DOC): $(BLD)\make-docfile.exe
145 - rm -f $(DOC)
146 $(BLD)\make-docfile -d ..\src $(obj) > $(DOC)
147 $(BLD)\make-docfile -d ..\src $(lisp) >> $(DOC)
148 $(CP) $(DOC) ..\etc
149 - mkdir ..\src\$(OBJDIR)
150 - mkdir ..\src\$(OBJDIR)\etc
151 $(CP) $(DOC) ..\src\$(OBJDIR)\etc
152
153{$(BLD)}.obj{$(BLD)}.exe:
154 $(LINK) -out:$@ $(LINK_FLAGS) $*.obj $(LIBS)
155
156.c{$(BLD)}.obj:
157 $(CC) $(CFLAGS) -Fo$@ $<
158
159#
160# Build the executables
161#
162all: $(BLD) $(ALL) $(DOC)
163
164#
165# Assuming INSTALL_DIR is defined, build and install emacs in it.
166#
167INSTALL_FILES = $(ALL)
168install: $(INSTALL_FILES)
169 - mkdir $(INSTALL_DIR)\bin
170 $(CP) $(BLD)\etags.exe $(INSTALL_DIR)\bin
171 $(CP) $(BLD)\ctags.exe $(INSTALL_DIR)\bin
172 $(CP) $(BLD)\hexl.exe $(INSTALL_DIR)\bin
173 $(CP) $(BLD)\wakeup.exe $(INSTALL_DIR)\bin\wakeup
174 - mkdir $(INSTALL_DIR)\etc
175 $(CP) $(DOC) $(INSTALL_DIR)\etc
176
177#
178# Maintenance
179#
180clean:; - del /q *~
181 - delnode /q deleted
182 - delnode /q obj
183 - del /q DOC
184
185#
186# Headers we would preprocess if we could.
187#
188..\src\config.h: ..\nt\src\config.h
189 cp ..\nt\src\config.h ..\src\config.h
190..\src\paths.h: ..\nt\src\paths.h
191 cp ..\nt\src\paths.h ..\src\paths.h
192
193### DEPENDENCIES ###
194
195EMACS_ROOT = ..
196SRC = .
197
198$(BLD)\alloca.obj : \
199 $(SRC)\alloca.c \
200 $(EMACS_ROOT)\src\s\s-windowsnt.h \
201 $(EMACS_ROOT)\src\m\m-windowsnt.h \
202 $(EMACS_ROOT)\src\config.h \
203 $(EMACS_ROOT)\src\blockinput.h
204
205$(BLD)\b2m.obj : \
206 $(SRC)\b2m.c \
207 $(EMACS_ROOT)\src\s\s-windowsnt.h \
208 $(EMACS_ROOT)\src\m\m-windowsnt.h \
209 $(EMACS_ROOT)\lib-src\..\src\config.h
210
211$(BLD)\cvtmail.obj : \
212 $(SRC)\cvtmail.c
213
214$(BLD)\digest-doc.obj : \
215 $(SRC)\digest-doc.c
216
217$(BLD)\emacsclient.obj : \
218 $(SRC)\emacsclient.c \
219 $(EMACS_ROOT)\src\s\s-windowsnt.h \
220 $(EMACS_ROOT)\src\m\m-windowsnt.h \
221 $(EMACS_ROOT)\lib-src\..\src\config.h
222
223$(BLD)\emacsserver.obj : \
224 $(SRC)\emacsserver.c \
225 $(EMACS_ROOT)\src\s\s-windowsnt.h \
226 $(EMACS_ROOT)\src\m\m-windowsnt.h \
227 $(EMACS_ROOT)\lib-src\..\src\config.h \
228 $(EMACS_ROOT)\nt\inc\sys\file.h
229
230$(BLD)\emacstool.obj : \
231 $(SRC)\emacstool.c \
232 $(EMACS_ROOT)\nt\inc\sys\file.h
233
234$(BLD)\etags.obj : \
235 $(SRC)\etags.c \
236 $(EMACS_ROOT)\nt\inc\sys\param.h \
237 $(EMACS_ROOT)\src\s\s-windowsnt.h \
238 $(EMACS_ROOT)\src\m\m-windowsnt.h \
239 $(EMACS_ROOT)\lib-src\..\src\config.h \
240 $(SRC)\getopt.h
241
242$(BLD)\fakemail.obj : \
243 $(SRC)\fakemail.c \
244 $(EMACS_ROOT)\src\s\s-windowsnt.h \
245 $(EMACS_ROOT)\src\m\m-windowsnt.h \
246 $(EMACS_ROOT)\lib-src\..\src\config.h \
247 $(EMACS_ROOT)\nt\inc\pwd.h
248
249$(BLD)\getdate.obj : \
250 $(SRC)\getdate.c \
251 $(EMACS_ROOT)\src\s\s-windowsnt.h \
252 $(EMACS_ROOT)\src\m\m-windowsnt.h \
253 $(EMACS_ROOT)\src\config.h \
254 $(MSTOOLS_SYS)\types.h
255
256$(BLD)\getopt.obj : \
257 $(SRC)\getopt.c \
258 $(EMACS_ROOT)\src\s\s-windowsnt.h \
259 $(EMACS_ROOT)\src\m\m-windowsnt.h \
260 $(EMACS_ROOT)\src\config.h \
261 $(SRC)\getopt.h
262
263$(BLD)\getopt1.obj : \
264 $(SRC)\getopt1.c \
265 $(EMACS_ROOT)\src\s\s-windowsnt.h \
266 $(EMACS_ROOT)\src\m\m-windowsnt.h \
267 $(EMACS_ROOT)\src\config.h \
268 $(SRC)\getopt.h
269
270$(BLD)\hexl.obj : \
271 $(SRC)\hexl.c
272
273$(BLD)\leditcfns.obj : \
274 $(SRC)\leditcfns.c
275
276$(BLD)\make-docfile.obj : \
277 $(SRC)\make-docfile.c
278
279$(BLD)\make-path.obj : \
280 $(SRC)\make-path.c
281
282$(BLD)\movemail.obj : \
283 $(SRC)\movemail.c \
284 $(EMACS_ROOT)\src\s\s-windowsnt.h \
285 $(EMACS_ROOT)\src\m\m-windowsnt.h \
286 $(EMACS_ROOT)\lib-src\..\src\config.h \
287 $(EMACS_ROOT)\nt\inc\sys\file.h \
288 $(EMACS_ROOT)\src\vmsproc.h \
289 $(EMACS_ROOT)\lib-src\..\src\syswait.h \
290 $(EMACS_ROOT)\nt\inc\pwd.h
291
292$(BLD)\profile.obj : \
293 $(SRC)\profile.c \
294 $(EMACS_ROOT)\src\s\s-windowsnt.h \
295 $(EMACS_ROOT)\src\m\m-windowsnt.h \
296 $(EMACS_ROOT)\lib-src\..\src\config.h \
297 $(EMACS_ROOT)\src\vmstime.h \
298 $(EMACS_ROOT)\lib-src\..\src\systime.h
299
300$(BLD)\qsort.obj : \
301 $(SRC)\qsort.c
302
303$(BLD)\sorted-doc.obj : \
304 $(SRC)\sorted-doc.c
305
306$(BLD)\tcp.obj : \
307 $(SRC)\tcp.c
308
309$(BLD)\test-distrib.obj : \
310 $(SRC)\test-distrib.c
311
312$(BLD)\timer.obj : \
313 $(SRC)\timer.c \
314 $(EMACS_ROOT)\src\s\s-windowsnt.h \
315 $(EMACS_ROOT)\src\m\m-windowsnt.h \
316 $(EMACS_ROOT)\lib-src\..\src\config.h
317
318$(BLD)\wakeup.obj : \
319 $(SRC)\wakeup.c \
320 $(EMACS_ROOT)\src\s\s-windowsnt.h \
321 $(EMACS_ROOT)\src\m\m-windowsnt.h \
322 $(EMACS_ROOT)\src\config.h
323
324$(BLD)\yow.obj : \
325 $(SRC)\yow.c \
326 $(EMACS_ROOT)\lib-src\..\src\paths.h
diff --git a/lib-src/ntlib.c b/lib-src/ntlib.c
new file mode 100644
index 00000000000..1e1fc86798f
--- /dev/null
+++ b/lib-src/ntlib.c
@@ -0,0 +1,90 @@
1/* Utility and Unix shadow routines for GNU Emacs support programs on NT.
2 Copyright (C) 1994 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 it
7 under the terms of the GNU General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any later
9 version.
10
11 GNU Emacs is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 more details.
15
16 You should have received a copy of the GNU General Public License along
17 with GNU Emacs; see the file COPYING. If not, write to the Free Software
18 Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19
20 Geoff Voelker (voelker@cs.washington.edu) 10-8-94
21*/
22
23#include <windows.h>
24#include <stdlib.h>
25#include <stdio.h>
26
27#define MAXPATHLEN _MAX_PATH
28
29/* Emulate sleep...we could have done this with a define, but that
30 would necessitate including windows.h in the files that used it.
31 This is much easier. */
32void
33nt_sleep(int seconds)
34{
35 Sleep (seconds * 1000);
36}
37
38/* Get the current working directory. */
39int
40getwd (char *dir)
41{
42 return GetCurrentDirectory (MAXPATHLEN, dir);
43}
44
45static HANDLE getppid_parent;
46static int getppid_ppid;
47
48int
49getppid(void)
50{
51 char *ppid;
52 DWORD result;
53
54 ppid = getenv ("__PARENT_PROCESS_ID");
55 if (!ppid)
56 {
57 printf("no pid.\n");
58 return 0;
59 }
60 else
61 {
62 getppid_ppid = atoi (ppid);
63 }
64
65 if (!getppid_parent)
66 {
67 getppid_parent = OpenProcess (SYNCHRONIZE, FALSE, atoi(ppid));
68 if (!getppid_parent)
69 {
70 printf ("Failed to open handle to parent process: %d\n",
71 GetLastError());
72 exit (1);
73 }
74 }
75
76 result = WaitForSingleObject (getppid_parent, 0);
77 switch (result)
78 {
79 case WAIT_TIMEOUT:
80 /* The parent is still alive. */
81 return getppid_ppid;
82 case WAIT_OBJECT_0:
83 /* The parent is gone. Return the pid of Unix init (1). */
84 return 1;
85 case WAIT_FAILED:
86 default:
87 printf ("Checking parent status failed: %d\n", GetLastError());
88 exit (1);
89 }
90}