aboutsummaryrefslogtreecommitdiffstats
path: root/nt
diff options
context:
space:
mode:
authorEli Zaretskii2013-05-16 15:48:54 +0300
committerEli Zaretskii2013-05-16 15:48:54 +0300
commitdf065a0b9a1ad4be56ffd30bba934b940e85c2c3 (patch)
tree55c7ca0dd3993d45d3bb54877fb31f025b0ca0ea /nt
parentdcfda130117b8a79f4253197b48cf09ba35a3b72 (diff)
parentf1e496a5c86d88c2d6f92c5083b1a9ee11f90109 (diff)
downloademacs-df065a0b9a1ad4be56ffd30bba934b940e85c2c3.tar.gz
emacs-df065a0b9a1ad4be56ffd30bba934b940e85c2c3.zip
Support building Emacs on MS-Windows using the Posix configury.
lib/Makefile.am: If building for MS-Windows, include nt/gnulib.mk instead of lib/gnulib.mk. configure.ac: Adapt to MSYS build on MS-Windows. Makefile.in (NTDIR): New variable, for the MSYS build on MS-Windows. (SUBDIR): Add $(NTDIR). (.PHONY): Add epaths-force-w32. (msys_to_w32): New variable. (epaths-force-w32, install-nt, uninstall-nt): New targets. (lib-src src): Add $(NTLIB) to prerequisites. (lib lib-src lisp leim nt): Add 'nt'. (config.status): Use $(CFG). (.PHONY): Add install-$(NTDIR) and uninstall-$(NTDIR). (install, install-arch-dep): Add install-$(NTDIR). (uninstall): Depend on uninstall-$(NTDIR). (mostlyclean, clean, distclean, bootstrap-clean): Add 'nt'. * GNUmakefile (CFG): New variable, uses mingw-cfg.site as CONFIG_SITE for the MSYS build on MS-Windows. (Makefile): Use $(CFG). .bzrignore: Ignore *.res, *.tmp, and *.map. Remove src/emacs.res. etc/NEWS: Advertise the MSYS build on MS-Windows. leim/Makefile.in (leim-list.el, check-declare): Use reveal-filename. lib-src/update-game-score.c [WINDOWSNT]: Include "ntlib.h". lib-src/ntlib.h (sleep): Update prototype. (geteuid): Add prototype. lib-src/ntlib.c (sleep): Now returns an unsigned value. (getgid): New function. lib-src/Makefile.in (CLIENTW, LIB_WSOCK32, LIBS_ECLIENT, NTLIB) (CLIENTRES, WINDRES, NTINC, NTDEPS): New variables. (INSTALLABLES): Add $(CLIENTW). (LIBS_MOVE): Use $(LIB_WSOCK32). ($(DESTDIR)${archlibdir}): Use $(EXEEXT) on update-game-score. (test-distrib${EXEEXT}): Use $(EXEEXT) on test-distrib. (etags${EXEEXT}, ebrowse${EXEEXT}, ctags${EXEEXT}) (profile${EXEEXT}, make-docfile${EXEEXT}, movemail${EXEEXT}) (emacsclient${EXEEXT}, hexl${EXEEXT}, update-game-score${EXEEXT}): Add $(NTLIB) to prerequisites. Use $(EXEEXT). (pop.o): Add pop.h to prerequisites. (emacsclientw${EXEEXT}, ntlib.o): New targets. (emacsclient.res): New target. lisp/subr.el (reveal-filename): New function. lisp/loadup.el: Compute Emacs executable versions on MS-Windows, where executables have the .exe extension. Add a hard link emacs-XX.YY.ZZ.exe on MS-Windows. lisp/Makefile.in (XARGS_LIMIT): New variable. (custom-deps, finder-data, autoloads) ($(MH_E_DIR)/mh-loaddefs.el, $(TRAMP_DIR)/tramp-loaddefs.el) ($(CAL_DIR)/cal-loaddefs.el, $(CAL_DIR)/diary-loaddefs.el) ($(CAL_DIR)/hol-loaddefs.el): Use reveal-filename. (compile-main): Limit xargs according to $(XARGS_LIMIT). nt/msysconfig.sh: New file. nt/mingw-cfg.site: New file. nt/makefile.w32-in (LOCAL_FLAGS): Add -DOLD_PATHS=1. nt/inc/unistd.h: Include pwd.h and sys/types.h. nt/inc/sys/time.h (_TIMEVAL_DEFINED, timerisset, timercmp) (timerclear): Define. (gettimeofday): Adjust signature to be Posix compatible, by using the 'restrict' keyword. nt/inc/sys/stat.h (UTIME_NOW, UTIME_OMIT): Define. (struct _stat, struct _stati64): Define. nt/inc/sys/socket.h (timeval): Define only for MSVC. (FD_SET, FD_CLR, FD_ISSET, fd_set): Redefine only if EMACS_CONFIG_H is defined. (timeval): Undefine only for MSVC. nt/inc/ms-w32.h (HAVE___BUILTIN_UNWIND_INIT, restrict) (HAVE_WINDOW_SYSTEM, HAVE_MENUS, EMACS_CONFIGURATION) (EMACS_CONFIG_OPTIONS, HAVE_LONG_LONG_INT) (HAVE_UNSIGNED_LONG_LONG_INT): Define only if not already defined. (fileno): Move definition after including stdio.h. (sigset_t): Guard typedef by _W64. nt/gnulib.mk: New file. nt/epaths.nt: New file. nt/addpm.c [!OLD_PATHS]: Include src/epaths.h, instead of having a copy of the file names there. <env_vars> [!OLD_PATHS]: Use macros from epaths.h instead of literal strings. nt/Makefile.in: New file. nt/INSTALL.MSYS: New file. nt/INSTALL: Mention INSTALL.MSYS. src/w32.c: Include epaths.h. (init_environment): Use cmdproxy.exe without leading directories. Support emacs.exe in src; point SHELL to cmdproxy in ../nt in that case. (gettimeofday): Adjust signature and return value to Posix expectations. src/unexw32.c (open_output_file): Delete the existing emacs.exe before creating it, to break the hard link to the versioned executable. src/Makefile.in (EMACS_MANIFEST, CM_OBJ, TEMACS_POST_LINK) (ADDSECTION, EMACS_HEAPSIZE, MINGW_TEMACS_POST_LINK) (FIRSTFILE_OBJ): New variables. (W32_RES): Rename to EMACSRES. All users changed. (base_obj): Use $(CM_OBJ). (ALLOBJS): Use $(FIRSTFILE_OBJ). (emacs$(EXEEXT)): Depend on $(ADDSECTION). (temacs$(EXEEXT)): Use $(TEMACS_POST_LINK), and move $(W32_RES_LINK) before $(LIBES). (emacs.res): Depend on $(EMACS_MANIFEST). Put emacs.rc in nt.
Diffstat (limited to 'nt')
-rw-r--r--nt/ChangeLog45
-rw-r--r--nt/INSTALL10
-rw-r--r--nt/INSTALL.MSYS640
-rw-r--r--nt/Makefile.in212
-rw-r--r--nt/addpm.c17
-rw-r--r--nt/epaths.nt89
-rw-r--r--nt/gnulib.mk902
-rw-r--r--nt/inc/ms-w32.h55
-rw-r--r--nt/inc/sys/socket.h12
-rw-r--r--nt/inc/sys/stat.h36
-rw-r--r--nt/inc/sys/time.h18
-rw-r--r--nt/inc/unistd.h3
-rw-r--r--nt/makefile.w32-in2
-rw-r--r--nt/mingw-cfg.site106
-rw-r--r--nt/msysconfig.sh39
15 files changed, 2153 insertions, 33 deletions
diff --git a/nt/ChangeLog b/nt/ChangeLog
index b66871e319b..80b6390d368 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,48 @@
12013-05-16 Eli Zaretskii <eliz@gnu.org>
2
3 * msysconfig.sh: New file.
4
5 * mingw-cfg.site: New file.
6
7 * makefile.w32-in (LOCAL_FLAGS): Add -DOLD_PATHS=1.
8
9 * inc/unistd.h: Include pwd.h and sys/types.h.
10
11 * inc/sys/time.h (_TIMEVAL_DEFINED, timerisset, timercmp)
12 (timerclear): Define.
13 (gettimeofday): Adjust signature to be Posix compatible, by using
14 the 'restrict' keyword.
15
16 * inc/sys/stat.h (UTIME_NOW, UTIME_OMIT): Define.
17 (struct _stat, struct _stati64): Define.
18
19 * inc/sys/socket.h (timeval): Define only for MSVC.
20 (FD_SET, FD_CLR, FD_ISSET, fd_set): Redefine only if
21 EMACS_CONFIG_H is defined.
22 (timeval): Undefine only for MSVC.
23
24 * inc/ms-w32.h (HAVE___BUILTIN_UNWIND_INIT, restrict)
25 (HAVE_WINDOW_SYSTEM, HAVE_MENUS, EMACS_CONFIGURATION)
26 (EMACS_CONFIG_OPTIONS, HAVE_LONG_LONG_INT)
27 (HAVE_UNSIGNED_LONG_LONG_INT): Define only if not already defined.
28 (fileno): Move definition after including stdio.h.
29 (sigset_t): Guard typedef by _W64.
30
31 * gnulib.mk: New file.
32
33 * epaths.nt: New file.
34
35 * addpm.c [!OLD_PATHS]: Include src/epaths.h, instead of having a
36 copy of the file names there.
37 <env_vars> [!OLD_PATHS]: Use macros from epaths.h instead of
38 literal strings.
39
40 * Makefile.in: New file.
41
42 * INSTALL.MSYS: New file.
43
44 * INSTALL: Mention INSTALL.MSYS.
45
12013-05-15 Stefan Monnier <monnier@iro.umontreal.ca> 462013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
2 47
3 * makefile.w32-in (clean, top-distclean): DOC-X doesn't exist any more. 48 * makefile.w32-in (clean, top-distclean): DOC-X doesn't exist any more.
diff --git a/nt/INSTALL b/nt/INSTALL
index 0c4b50f0c28..8abd8aff920 100644
--- a/nt/INSTALL
+++ b/nt/INSTALL
@@ -13,9 +13,13 @@
13 Do not use this recipe with Cygwin. For building on Cygwin, 13 Do not use this recipe with Cygwin. For building on Cygwin,
14 use the normal installation instructions, ../INSTALL. 14 use the normal installation instructions, ../INSTALL.
15 15
16 If you have a Cygwin or MSYS port of Bash on your Path, you will be 16 Do not use these instructions with MSYS environment. For building
17 better off removing it from PATH. (For details, search for "MSYS 17 the native Windows binary with MinGW and MSYS, follow the
18 sh.exe" below.) 18 instructions in the file INSTALL.MSYS in this directory.
19
20 For building without MSYS, if you have a Cygwin or MSYS port of Bash
21 on your Path, you will be better off removing it from PATH. (For
22 details, search for "MSYS sh.exe" below.)
19 23
20 1. Change to the `nt' directory (the directory of this file): 24 1. Change to the `nt' directory (the directory of this file):
21 25
diff --git a/nt/INSTALL.MSYS b/nt/INSTALL.MSYS
new file mode 100644
index 00000000000..05ba6c65b22
--- /dev/null
+++ b/nt/INSTALL.MSYS
@@ -0,0 +1,640 @@
1 Building and Installing Emacs on MS-Windows
2 using the MSYS and MinGW tools
3
4 Copyright (C) 2013 Free Software Foundation, Inc.
5 See the end of the file for license conditions.
6
7The MSYS/MinGW build described here is supported on versions of
8Windows starting with Windows 2000 and newer. Windows 9X are not
9supported (but the Emacs binary produced by this build will run on
10Windows 9X as well).
11
12* For the brave (a.k.a. "impatient"):
13
14 For those who have a working MSYS/MinGW development environment and
15 are comfortable with running Posix configure scripts, here are the
16 concise instructions for configuring and building the native Windows
17 binary of Emacs with these tools.
18
19 Do not use this recipe with Cygwin. For building on Cygwin, use the
20 normal installation instructions, ../INSTALL.
21
22 Do not use these instructions if you don't have MSYS installed; for
23 that, see the file INSTALL in this directory.
24
25 0. Start the MSYS Bash window. Everything else below is done from
26 that window's Bash prompt.
27
28 0a. If you are building from the development trunk (as opposed to a
29 release tarball), produce the configure script, by typing from
30 the top-level Emacs source directory:
31
32 ./autogen.sh
33
34 1. If you want to build Emacs outside of the source tree
35 (recommended), create the build directory and chdir there.
36
37 2. Invoke the MSYS-specific configure script:
38
39 - If you are building outside the source tree:
40
41 /PATH/TO/EMACS/SOURCE/TREE/nt/msysconfig.sh --prefix=PREFIX ...
42
43 - If you are building in-place, i.e. inside the source tree:
44
45 ./nt/msysconfig.sh --prefix=PREFIX ...
46
47 It is always preferable to use --prefix to configure Emacs for
48 some specific location of its installed tree; the default
49 /usr/local is not suitable for Windows.
50
51 You can pass other options to the configure script. Here's a
52 typical example (for an in-place debug build):
53
54 CPPFLAGS='-DGLYPH_DEBUG=1' CFLAGS='-O0 -g3' ./nt/msysconfig.sh --prefix=d:/usr/emacs --enable-checking
55
56 3. After the configure script finishes, it should display the
57 resulting configuration. After that, type
58
59 make
60
61 Use "make -j N" if your MSYS Make supports parallel execution;
62 the build will take significantly less time in that case. Here N
63 is the number of simultaneous parallel jobs; use the number of
64 the cores on your system.
65
66 4. Install the produced binaries:
67
68 make install
69
70 If you want the installation tree to go to a place that is
71 different from the one specified by --prefix, say
72
73 make install prefix=/where/ever/you/want
74
75 That's it!
76
77 If these short instructions somehow fail, read the rest of this
78 file.
79
80* Installing MinGW and MSYS
81
82 Make sure you carefully read the following two sections in their
83 entirety and install/configure the various packages as instructed.
84 A correct installation makes all the rest almost trivial; a botched
85 installation will likely make you miserable for quite some time.
86
87 There are two alternative to installing MinGW + MSYS: using the GUI
88 installer, called mingw-get, provided by the MinGW project, or
89 manual installation. The next two sections describe each one of
90 these.
91
92** Installing MinGW and MSYS using mingw-get
93
94 A nice GUI installer, called mingw-get, is available for those who
95 don't like to mess with manual installations. You can download it
96 from here:
97
98 https://sourceforge.net/projects/mingw/files/Installer/mingw-get/
99
100 (This installer only supports packages downloaded from the MinGW
101 site; for the rest you will still need the manual method.)
102
103 After installing mingw-get, invoke it to install the packages that
104 are already selected by default on the "Select Components" screen of
105 its wizard.
106
107 After that, use "ming-get install PACKAGE" to install the following
108 additional packages:
109
110 . msys-base
111 . mingw-developer-toolkit
112 . msys-automake
113
114 (We recommend that you refrain from installing the MSYS Texinfo
115 package, which is part of msys-base, because it might produce mixed
116 EOL format when installing Info files. Instead, install the MinGW
117 port of Texinfo, see the ezwinports URL below.)
118
119 At this point, you should be ready to configure and build Emacs in
120 its basic configuration. Skip to the "Generating the configure
121 script" section for the build instructions. If you want to build it
122 with image support and other optional libraries, read about the
123 optional libraries near the end of this document, before you start
124 the build. Also, consider installing additional MinGW packages that
125 are required/recommended, especially if you are building from the
126 Bazaar repository, as described in the next section.
127
128** Installing MinGW and MSYS manually
129
130*** MinGW
131
132 You will need to install the MinGW port of GCC and Binutils, and the
133 MinGW runtime and Windows API distributions, to compile Emacs. You
134 can find these on the MinGW download/Base page:
135
136 https://sourceforge.net/projects/mingw/files/MinGW/Base/
137
138 In general, install the latest stable versions of the following
139 MinGW packages from that page: gcc, binutils, mingw-rt, w32api. You
140 only need the 'bin' and the 'dll' tarballs of each of the above.
141
142 MinGW packages are distributed as .tar.lzma compressed archives. To
143 install the packages manually, we recommend to use the Windows port
144 of the 'bsdtar' program to unpack the tarballs. 'bsdtar' is
145 available as part of the 'libarchive' package from here:
146
147 http://sourceforge.net/projects/ezwinports/files/
148
149 The recommended place to install these packages is a single tree
150 starting from some directory on a drive other than the system drive
151 C:. A typical example would be D:\usr, with D:\usr\bin holding the
152 binaries and DLLs (should be added to your Path environment
153 variable), D:\usr\include holding the include files, D:\usr\lib
154 holding the static and import libraries, D:\usr\share holding docs,
155 message catalogs, and package-specific subdirectories, etc.
156
157 Having all the headers and libraries in a single place will greatly
158 reduce the number of -I and -L flags you will have to pass to the
159 configure script (see below), as these files will be right where the
160 compiler expects them.
161
162 We specifically do NOT recommend installing packages below
163 "C:\Program Files" or "C:\Program Files (x86)". These directories
164 are protected on versions of Windows from Vista and on, and you will
165 have difficulties updating and maintaining your installation later,
166 due to UAC elevation prompts, file virtualization, etc. You *have*
167 been warned!
168
169 Additional MinGW packages are required/recommended, especially if
170 you are building from the Bazaar repository:
171
172 . Texinfo (needed to produce the Info manuals when building from
173 bzr, and for "make install")
174
175 Available from http://sourceforge.net/projects/ezwinports/files/.
176
177 . gzip (needed to compress files during "make install")
178
179 Available from http://gnuwin32.sourceforge.net/packages/gzip.htm.
180
181 . pkg-config (needed for building with some optional libraries,
182 such as GnuTLS and libxml2)
183
184 Available from http://www.gtk.org/download/win32.php
185
186 Each package might list other packages as prerequisites on its
187 download page (under "Runtime requirements"); download those as
188 well. (Using the GUI installer mingw-get will fetch those
189 prerequisites automatically for you.) A missing prerequisite will
190 manifest itself by the program failing to run and presenting a
191 pop-up dialog that states the missing or incompatible DLL; be sure
192 to find and install these missing DLLs.
193
194 Once you think you have MinGW installed, test the installation by
195 building a trivial "hello, world!" program, and make sure that it
196 builds without any error messages and the binary works when run.
197
198*** MSYS
199
200 You will need a reasonably full MSYS installation. MSYS is an
201 environment needed to run the Posix configure scripts and the
202 resulting Makefile's, in order to produce native Windows binaries
203 using the MinGW compiler and runtime libraries. Here's the list of
204 MSYS packages that are required:
205
206 . All the packages from the MSYS Base distribution, listed here:
207
208 https://sourceforge.net/projects/mingw/files/MSYS/Base/
209
210 . Additional packages listed below, from the MSYS Extension
211 distribution here:
212
213 https://sourceforge.net/projects/mingw/files/MSYS/Extension/
214
215 - flex
216 - bison
217 - m4
218 - perl
219 - mktemp
220
221 These should only be needed if you intend to build development
222 versions of Emacs from the Bazaar repository.
223
224 . Additional packages (needed only if building from the Bazaar
225 repository): Automake and Autoconf. They are available from
226 here:
227
228 http://sourceforge.net/projects/ezwinports/files/automake-1.11.6-msys-bin.zip/download
229 http://sourceforge.net/projects/ezwinports/files/autoconf-2.65-msys-bin.zip/download
230
231 MSYS packages are distributed as .tar.lzma compressed archives. To
232 install the packages manually, we recommend to use the Windows port
233 of the 'bsdtar' program, already mentioned above.
234
235 If/when you are confident in your MinGW/MSYS installation, and want
236 to speed up the builds, we recommend installing a pre-release
237 version of Make from here:
238
239 https://sourceforge.net/projects/mingwbuilds/files/external-binary-packages/
240
241 These are snapshot builds of many packages, but you only need
242 make.exe from there. The advantage of this make.exe is that it
243 supports parallel builds, so you can use "make -j N" to considerably
244 speed up your builds
245
246 For each of these packages, install the 'bin' and 'dll' tarballs of
247 their latest stable releases. If there's an 'ext' tarball (e.g.,
248 msysCORE and Coreutils have it), download and install those as well.
249
250 Each package might list other packages as prerequisites on its
251 download page (under "Runtime requirements"); download those as
252 well. (Using the GUI installer mingw-get will fetch those
253 prerequisites automatically for you.) A missing prerequisite will
254 manifest itself by the program failing to run and presenting a
255 pop-up dialog that states the missing or incompatible DLL; be sure
256 to find and install these missing DLLs.
257
258 MSYS packages should be installed in a separate tree from MinGW.
259 For example, use D:\MSYS or D:\usr\MSYS as the top-level directory
260 from which you unpack all of the MSYS packages.
261
262 Do NOT add the MSYS bin directory to your Windows Path! Only the
263 MinGW bin directory should be on Path. When you install MSYS, it
264 creates a shortcut on your desktop that invokes the MSYS Bash shell
265 in a Command Prompt window; that shell is already set up so that the
266 MSYS bin directory is on PATH ahead of any other directory. Thus,
267 Bash will find MSYS executables first, which is exactly what you
268 need.
269
270 At this point, you are ready to build Emacs in its basic
271 configuration. If you want to build it with image support and other
272 optional libraries, read about that near the end of this document.
273
274* Generating the configure script
275
276 If you are building a release or pretest tarball, skip this section,
277 because the configure script is already present in the tarball.
278
279 To build a development snapshot from the Emacs Bazaar repository,
280 you will first need to generate the configure script and a few other
281 auto-generated files. (If this step, described below, somehow
282 fails, you can use the files in the autogen/ directory instead, but
283 they might be outdated, and, most importantly, you are well advised
284 not to disregard any failures in your local build procedures, as
285 these are likely to be symptoms of incorrect installation that will
286 bite you down the road.)
287
288 To generate the configure script, type this at the MSYS Bash prompt
289 from the top-level directory of the Emacs tree:
290
291 ./autogen.sh
292
293 If successful, this command should produce the following output:
294
295 $ ./autogen.sh
296 Checking whether you have the necessary tools...
297 (Read INSTALL.BZR for more details on building Emacs)
298
299 Checking for autoconf (need at least version 2.65)...
300 ok
301 Checking for automake (need at least version 1.11)...
302 ok
303 Your system has the required tools, running autoreconf...
304 You can now run `./configure'.
305
306* Configuring Emacs for MinGW:
307
308 Now it's time to run the configure script. You can do that either
309 from a separate build directory that is outside of the Emacs source
310 tree (recommended), or from inside the source tree. The former is
311 recommended because it allows you to have several different builds,
312 e.g., an optimized build and an unoptimized one, of the same
313 revision of the source tree; the source tree will be left in its
314 pristine state, without any build products.
315
316 You invoke the configure script like this:
317
318 /PATH/TO/EMACS/SOURCE/TREE/nt/msysconfig.sh --prefix=PREFIX ...
319
320 or, if you are building in-place, i.e. inside the source tree:
321
322 ./nt/msysconfig.sh --prefix=PREFIX ...
323
324 Here PREFIX is the place where you eventually want to install Emacs
325 once built, e.g. d:/usr.
326
327 You can pass additional options to the configure script, for the
328 full list type
329
330 ./nt/msysconfig.sh --help
331
332 As explained in the help text, you may need to tell the script what
333 are the optional flags to invoke the compiler. This is needed if
334 some of your headers and libraries, e.g., those belonging to
335 optional image libraries, are installed in places where the compiler
336 normally doesn't look for them. (Remember that advice above to
337 avoid such situations? here's is where you will start paying for
338 disregarding that recommendation.) For example, if you have libpng
339 headers in C:\emacs\libs\libpng-1.2.37-lib\include and jpeg library
340 headers in C:\emacs\libs\jpeg-6b-4-lib\include, you will need to say
341 something like this:
342
343 CPPFLAGS='-Ic:/emacs/libs/libpng-1.2.37-lib/include -Ic:/emacs/libs/jpeg-6b-4-lib/include' ./nt/msysconfig.sh --prefix=PREFIX
344
345 which is quite a mouth-full, especially if you have more directories
346 to specify... Perhaps you may wish to revisit your installation
347 decisions now.
348
349 A few frequently used options are needed when you want to produce an
350 unoptimized binary with runtime checks enabled:
351
352 CPPFLAGS='-DGLYPH_DEBUG=1' CFLAGS='-O0 -g3' ./nt/msysconfig.sh --prefix=PREFIX --enable-checking
353
354 Once invoked, the configure script will run for some time, and, if
355 successful, will eventually produce a summary of the configuration
356 like this:
357
358 Configured for `i686-pc-mingw32'.
359
360 Where should the build process find the source code? /path/to/emacs/sources
361 What compiler should emacs be built with? gcc -std=gnu99 -O0 -g3
362 Should Emacs use the GNU version of malloc? yes
363 Should Emacs use a relocating allocator for buffers? yes
364 Should Emacs use mmap(2) for buffer allocation? no
365 What window system should Emacs use? w32
366 What toolkit should Emacs use? none
367 Where do we find X Windows header files? NONE
368 Where do we find X Windows libraries? NONE
369 Does Emacs use -lXaw3d? no
370 Does Emacs use -lXpm? yes
371 Does Emacs use -ljpeg? yes
372 Does Emacs use -ltiff? yes
373 Does Emacs use a gif library? yes
374 Does Emacs use -lpng? yes
375 Does Emacs use -lrsvg-2? no
376 Does Emacs use imagemagick? no
377 Does Emacs use -lgpm? no
378 Does Emacs use -ldbus? no
379 Does Emacs use -lgconf? no
380 Does Emacs use GSettings? no
381 Does Emacs use -lselinux? no
382 Does Emacs use -lgnutls? yes
383 Does Emacs use -lxml2? yes
384 Does Emacs use -lfreetype? no
385 Does Emacs use -lm17n-flt? no
386 Does Emacs use -lotf? no
387 Does Emacs use -lxft? no
388 Does Emacs use toolkit scroll bars? yes
389
390 You are almost there, hang on.
391
392 If the output is significantly different, or if configure finishes
393 prematurely and displays some error message, you should examine the
394 configuration log in config.log and find the reason for the failure.
395
396 Once you succeeded in configuring Emacs, and just want to rebuild it
397 after updating your local repository from the main repository, you
398 don't need to re-run the configure script manually, unless you want
399 to change the configure-time options. Just typing "make" will
400 re-run configure if necessary with the exact same options you
401 specified originally, and then go on to invoking Make, described
402 below.
403
404* Running Make.
405
406 This is simple: just type "make" and sit back, watching the fun.
407
408 If you installed a snapshot build of Make, the build will be much
409 faster if you type "make -j N" instead, where N is the number of
410 independent processing units on your machine. E.g., on a core i7
411 system try using N of 6 or even 8.
412
413 When Make finishes, you can install the produced binaries:
414
415 make install
416
417 or, if you want the installed tree to go in a place different from
418 the configured one, type
419
420 make install prefix=WHEREVER
421
422 Congrats! You have built and installed your own Emacs!
423
424* Make targets
425
426 The following make targets may be used by users building the source
427 distribution, or users who have checked out of Bazaar after
428 an initial bootstrapping.
429
430 make
431 Builds Emacs from the available sources and pre-compiled lisp files.
432
433 make install
434 Installs the built programs and the auxiliary files.
435
436 make clean
437 Removes object and executable files produced by the build process in
438 the current configuration. After "make clean", you can rebuild with
439 the same configuration using make. useful when you want to be sure
440 that all of the products are built from coherent sources.
441
442 make distclean
443 In addition to the files removed by make clean, this also removes
444 Makefiles and other generated files to get back to the state of a
445 freshly unpacked source distribution. After make distclean, it is
446 necessary to run the configure script followed by "make", in order
447 to rebuild.
448
449 The following targets are intended only for use with the Bazaar sources.
450
451 make bootstrap
452 Removes all the auto-generated files and all the *.elc byte-compiled
453 files, and builds Emacs from scratch. Useful when some change in
454 basic Emacs functionality makes byte compilation of updated files
455 fail.
456
457 make maintainer-clean
458 Removes everything that can be recreated, including compiled Lisp
459 files, to get back to the state of a fresh Bazaar tree. After make
460 maintainer-clean, it is necessary to run configure and "make" or
461 "make bootstrap" to rebuild. Occasionally it may be necessary to
462 run this target after an update.
463
464* Optional image library support
465
466 In addition to its "native" image formats (pbm and xbm), Emacs can
467 handle other image types: xpm, tiff, gif, png, jpeg and experimental
468 support for svg.
469
470 To build Emacs with support for them, the corresponding headers must
471 be in the include path and libraries should be where the linker
472 looks for them, when the configure script is run. If needed, this
473 can be set up using the CPPFLAGS and CFLAGS variable specified on
474 the configure command line. The configure script will report
475 whether it was able to detect the headers and libraries. If the
476 results of this testing appear to be incorrect, please look for
477 details in the file config.log: it will show the failed test
478 programs and compiler error messages that should explain what is
479 wrong. (Usually, any such failures happen because some headers are
480 missing due to bad packaging of the image support libraries.)
481
482 Note that any file path passed to the compiler or linker must use
483 forward slashes, or double each backslash, as that is how Bash
484 works.
485
486 If the configure script finds the necessary headers and libraries,
487 but they are for some reason incompatible, or if you want to omit
488 support for some image library that is installed on your system for
489 some other reason, use the --without-PACKAGE option to configure,
490 such as --without-gif to omit GIF, --without-tiff to omit TIFF, etc.
491 Passing the --help option to the configure script displays all of
492 the supported --without-PACKAGE options.
493
494 To use the external image support, the DLLs implementing the
495 functionality must be found when Emacs first needs them, either on the
496 PATH, or in the same directory as emacs.exe. Failure to find a
497 library is not an error; the associated image format will simply be
498 unavailable. Note that once Emacs has determined that a library can
499 not be found, there's no way to force it to try again, other than
500 restarting. See the variable `dynamic-library-alist' to configure the
501 expected names of the libraries.
502
503 Some image libraries have dependencies on one another, or on zlib.
504 For example, tiff support depends on the jpeg library. If you did not
505 compile the libraries yourself, you must make sure that any dependency
506 is in the PATH or otherwise accessible and that the binaries are
507 compatible (for example, that they were built with the same compiler).
508
509 Binaries for the image libraries (among many others) can be found at
510 the GnuWin32 project. PNG, JPEG and TIFF libraries are also
511 included with GTK, which is installed along with other Free Software
512 that requires it. Note specifically that, due to some packaging
513 snafus in the GnuWin32-supplied image libraries, you will need to
514 download _source_ packages for some of the libraries in order to get
515 the header files necessary for building Emacs with image support.
516
517 For PNG images, we recommend to use versions 1.4.x and later of
518 libpng, because previous versions had security issues. You can find
519 precompiled libraries and headers on the GTK download page for
520 Windows (http://www.gtk.org/download/win32.php).
521
522 Versions 1.4.0 and later of libpng are binary incompatible with
523 earlier versions, so Emacs will only look for libpng libraries which
524 are compatible with the version it was compiled against. That
525 version is given by the value of the Lisp variable `libpng-version';
526 e.g., 10403 means version 1.4.3. The variable `dynamic-library-alist'
527 is automatically set to name only those DLL names that are known to
528 be compatible with the version given by `libpng-version'. If PNG
529 support does not work for you even though you have the support DLL
530 installed, check the name of the installed DLL against
531 `dynamic-library-alist' and the value of `libpng-version', and
532 download compatible DLLs if needed.
533
534* Optional GnuTLS support
535
536 To compile with GnuTLS, you will need pkg-config to be installed, as
537 the configure script invokes pkg-config to find out which compiler
538 switches to use for GnuTLS. See above for the URL where you can
539 find pkg-config for Windows.
540
541 You will also need to install the p11-kit package, which is a
542 dependency of GnuTLS, and its header files are needed for
543 compilation of programs that use GnuTLS. You can find p11-kit on
544 the same site as GnuTLS, see the URL below.
545
546 If the configure script finds the GnuTLS header files and libraries
547 on your system, Emacs is built with GnuTLS support by default; to
548 avoid that you can pass the argument --without-gnutls.
549
550 In order to support GnuTLS at runtime, a GnuTLS-enabled Emacs must
551 be able to find the relevant DLLs during startup; failure to do so
552 is not an error, but GnuTLS won't be available to the running
553 session.
554
555 You can get pre-built binaries (including any required DLL and the
556 header files) at http://sourceforge.net/projects/ezwinports/files/.
557
558* Optional libxml2 support
559
560 To compile with libxml2, you will need pkg-config to be installed,
561 as the configure script invokes pkg-config to find out which
562 compiler switches to use for libxml2. See above for the URL where
563 you can find pkg-config for Windows.
564
565 If the configure script finds the libxml2 header files and libraries
566 on your system, Emacs is built with libxml2 support by default; to
567 avoid that you can pass the argument --without-libxml2.
568
569 In order to support libxml2 at runtime, a libxml2-enabled Emacs must
570 be able to find the relevant DLLs during startup; failure to do so
571 is not an error, but libxml2 features won't be available to the
572 running session.
573
574 One place where you can get pre-built Windows binaries of libxml2
575 (including any required DLL and the header files) is here:
576
577 http://sourceforge.net/projects/ezwinports/files/
578
579 For runtime support of libxml2, you will also need to install the
580 libiconv "development" tarball, because the libiconv headers need to
581 be available to the compiler when you compile with libxml2 support.
582 A MinGW port of libiconv can be found on the MinGW site:
583
584 http://sourceforge.net/projects/mingw/files/MinGW/Base/libiconv/
585
586 You need the libiconv-X.Y.Z-N-mingw32-dev.tar.lzma tarball from that
587 site.
588
589* Experimental SVG support
590
591 To compile with SVG, you will need pkg-config to be installed, as
592 the configure script invokes pkg-config to find out which compiler
593 switches to use for SVG. See above for the URL where you can find
594 pkg-config for Windows.
595
596 SVG support is currently experimental, and not built by default.
597 Specify --with-rsvg and ensure you have all the dependencies in your
598 include path. Unless you have built a minimalist librsvg yourself
599 (untested), librsvg depends on a significant chunk of GTK+ to build,
600 plus a few Gnome libraries, libxml2, libbz2 and zlib at runtime. The
601 easiest way to obtain the dependencies required for building is to
602 download a pre-bundled GTK+ development environment for Windows.
603
604 To use librsvg at runtime, ensure that librsvg and its dependencies
605 are on your PATH. If you didn't build librsvg yourself, you will
606 need to check with where you downloaded it from for the
607 dependencies, as there are different build options. If it is a
608 short list, then it most likely only lists the immediate
609 dependencies of librsvg, but the dependencies themselves have
610 dependencies - so don't download individual libraries from GTK+,
611 download and install the whole thing. If you think you've got all
612 the dependencies and SVG support is still not working, check your
613 PATH for other libraries that shadow the ones you downloaded.
614 Libraries of the same name from different sources may not be
615 compatible, this problem was encountered with libbzip2 from GnuWin32
616 with libcroco from gnome.org.
617
618 If you can see etc/images/splash.svg, then you have managed to get
619 SVG support working. Congratulations for making it through DLL hell
620 to this point. You'll probably find that some SVG images crash
621 Emacs. Problems have been observed in some images that contain
622 text, they seem to be a problem in the Windows port of Pango, or
623 maybe a problem with the way Cairo or librsvg is using it that
624 doesn't show up on other platforms.
625
626
627This file is part of GNU Emacs.
628
629GNU Emacs is free software: you can redistribute it and/or modify
630it under the terms of the GNU General Public License as published by
631the Free Software Foundation, either version 3 of the License, or
632(at your option) any later version.
633
634GNU Emacs is distributed in the hope that it will be useful,
635but WITHOUT ANY WARRANTY; without even the implied warranty of
636MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
637GNU General Public License for more details.
638
639You should have received a copy of the GNU General Public License
640along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
diff --git a/nt/Makefile.in b/nt/Makefile.in
new file mode 100644
index 00000000000..3d5e1ca084c
--- /dev/null
+++ b/nt/Makefile.in
@@ -0,0 +1,212 @@
1# nt/Makefile for GNU Emacs.
2
3# Copyright (C) 2013 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 3 of the License, or
10# (at your option) 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. If not, see <http://www.gnu.org/licenses/>.
19
20# Avoid trouble on systems where the `SHELL' variable might be
21# inherited from the environment.
22SHELL = /bin/sh
23
24# ==================== Things `configure' will edit ====================
25
26CC=@CC@
27CFLAGS=@CFLAGS@
28version=@version@
29## Used in $archlibdir.
30configuration=@configuration@
31EXEEXT=@EXEEXT@
32C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@
33C_SWITCH_MACHINE=@C_SWITCH_MACHINE@
34PROFILING_CFLAGS = @PROFILING_CFLAGS@
35WARN_CFLAGS = @WARN_CFLAGS@
36WERROR_CFLAGS = @WERROR_CFLAGS@
37
38# Program name transformation.
39TRANSFORM = @program_transform_name@
40
41# ==================== Where To Install Things ====================
42
43# The default location for installation. Everything is placed in
44# subdirectories of this directory. The default values for many of
45# the variables below are expressed in terms of this one, so you may
46# not need to change them. This is set with the --prefix option to
47# `../configure'.
48prefix=@prefix@
49
50# Like `prefix', but used for architecture-specific files. This is
51# set with the --exec-prefix option to `../configure'.
52exec_prefix=@exec_prefix@
53
54# Where to install Emacs and other binaries that people will want to
55# run directly (like etags). This is set with the --bindir option
56# to `../configure'.
57bindir=@bindir@
58
59# Where to install and expect executable files to be run by Emacs
60# rather than directly by users, and other architecture-dependent
61# data. ${archlibdir} is usually below this. This is set with the
62# --libexecdir option to `../configure'.
63libexecdir=@libexecdir@
64
65# Directory for local state files for all programs.
66localstatedir=@localstatedir@
67
68# Where to find the source code. This is set by the configure
69# script's `--srcdir' option. However, the value of ${srcdir} in
70# this makefile is not identical to what was specified with --srcdir,
71# since the variable here has `/lib-src' added at the end.
72
73# We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
74srcdir=@srcdir@
75VPATH=@srcdir@
76
77# The top-level source directory, also set by configure.
78top_srcdir=@top_srcdir@
79
80# ==================== Emacs-specific directories ====================
81
82# These variables hold the values Emacs will actually use. They are
83# based on the values of the standard Make variables above.
84
85# Where to put executables to be run by Emacs rather than the user.
86# This path usually includes the Emacs version and configuration name,
87# so that multiple configurations for multiple versions of Emacs may
88# be installed at once. This can be set with the --archlibdir option
89# to `../configure'.
90archlibdir=@archlibdir@
91
92# ==================== Utility Programs for the Build =================
93
94# ../configure figures out the correct values for these.
95INSTALL = @INSTALL@
96INSTALL_PROGRAM = @INSTALL_PROGRAM@
97INSTALL_SCRIPT = @INSTALL_SCRIPT@
98# By default, we uphold the dignity of our programs.
99INSTALL_STRIP =
100MKDIR_P = @MKDIR_P@
101
102# ========================== Lists of Files ===========================
103
104# Things that a user might actually run, which should be installed in bindir.
105INSTALLABLES = runemacs${EXEEXT} addpm${EXEEXT}
106
107# Things that Emacs runs internally, which should not be installed in bindir.
108UTILITIES = cmdproxy${EXEEXT} ddeclient${EXEEXT}
109
110# Things that Emacs runs during the build process.
111DONT_INSTALL = addsection${EXEEXT}
112
113# All files that are created by the linker, i.e., whose names end in ${EXEEXT}.
114EXE_FILES = ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL}
115
116# =========================== Configuration ===========================
117
118# MS-Windows resource files and resource compiler
119EMACSRES = @EMACSRES@
120EMACS_MANIFEST = @EMACS_MANIFEST@
121WINDRES = @WINDRES@
122
123## Extra libraries to use when linking addpm.
124LIBS_ADDPM = -lole32 -luuid
125
126## Compilation and linking flags
127BASE_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) \
128 $(WARN_CFLAGS) $(WERROR_CFLAGS) \
129 -I. -I${srcdir}
130
131ALL_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
132LINK_CFLAGS = ${BASE_CFLAGS} ${LDFLAGS} ${CFLAGS}
133CPP_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${CPPFLAGS} ${CFLAGS}
134
135all: ${EXE_FILES}
136
137.PHONY: all
138
139## Install the internal utilities. Until they are installed, we can
140## just run them directly from nt/.
141$(DESTDIR)${archlibdir}: all
142 @echo
143 @echo "Installing utilities run internally by Emacs."
144 umask 022; ${MKDIR_P} $(DESTDIR)${archlibdir}
145 if [ `cd $(DESTDIR)${archlibdir} && /bin/pwd` != `/bin/pwd` ]; then \
146 for file in ${UTILITIES}; do \
147 $(INSTALL_PROGRAM) $(INSTALL_STRIP) $$file $(DESTDIR)${archlibdir}/$$file ; \
148 done ; \
149 fi
150
151.PHONY: install uninstall mostlyclean clean distclean maintainer-clean
152.PHONY: extraclean check tags
153
154install: $(DESTDIR)${archlibdir}
155 @echo
156 @echo "Installing utilities for users to run."
157 umask 022; ${MKDIR_P} $(DESTDIR)${bindir}
158 for file in ${INSTALLABLES} ; do \
159 $(INSTALL_PROGRAM) $(INSTALL_STRIP) $${file} $(DESTDIR)${bindir}/`echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)'`${EXEEXT} ; \
160 done
161
162uninstall:
163 for file in ${INSTALLABLES}; do \
164 rm -f $(DESTDIR)${bindir}/`echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)'`${EXEEXT} ; \
165 done
166 if [ -d $(DESTDIR)${archlibdir} ]; then \
167 (cd $(DESTDIR)${archlibdir} && rm -f ${UTILITIES}) \
168 fi
169
170mostlyclean:
171 -rm -f core *.o
172
173clean: mostlyclean
174 -rm -f ${EXE_FILES}
175
176distclean: clean
177 -rm -f TAGS
178 -rm -f Makefile
179
180maintainer-clean: distclean
181 true
182
183extraclean: maintainer-clean
184 -rm -f *~ \#*
185
186## Test the contents of the directory.
187check:
188 @echo "We don't have any tests for the nt/ directory yet."
189
190tags: TAGS
191TAGS: ${EXE_FILES:${EXEEXT}=.c}
192 ../lib-src/etags *.[ch]
193
194## Build the programs
195addsection${EXEEXT}: ${srcdir}/addsection.c
196 $(CC) ${ALL_CFLAGS} ${srcdir}/addsection.c -o addsection${EXEEXT}
197
198addpm${EXEEXT}: ${srcdir}/addpm.c ../src/epaths.h
199 $(CC) ${ALL_CFLAGS} ${srcdir}/addpm.c $(LIBS_ADDPM) -o addpm${EXEEXT}
200
201ddeclient${EXEEXT}: ${srcdir}/ddeclient.c
202 $(CC) ${ALL_CFLAGS} ${srcdir}/ddeclient.c -o ddeclient${EXEEXT}
203
204cmdproxy${EXEEXT}: ${srcdir}/cmdproxy.c
205 $(CC) ${ALL_CFLAGS} ${srcdir}/cmdproxy.c -o cmdproxy${EXEEXT}
206
207runemacs${EXEEXT}: ${srcdir}/runemacs.c $(EMACSRES)
208 $(CC) ${ALL_CFLAGS} ${srcdir}/runemacs.c $(EMACSRES) -mwindows \
209 -o runemacs${EXEEXT}
210
211emacs.res: ${srcdir}/emacs.rc ${srcdir}/icons/emacs.ico ${srcdir}/$(EMACS_MANIFEST)
212 ${WINDRES} -O coff -o emacs.res ${srcdir}/emacs.rc
diff --git a/nt/addpm.c b/nt/addpm.c
index 688e0167334..48c77821c8c 100644
--- a/nt/addpm.c
+++ b/nt/addpm.c
@@ -50,6 +50,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
50#include <shlobj.h> 50#include <shlobj.h>
51#include <ddeml.h> 51#include <ddeml.h>
52 52
53#ifndef OLD_PATHS
54#include "../src/epaths.h"
55#endif
56
53HDDEDATA CALLBACK 57HDDEDATA CALLBACK
54DdeCallback (UINT uType, UINT uFmt, HCONV hconv, 58DdeCallback (UINT uType, UINT uFmt, HCONV hconv,
55 HSZ hsz1, HSZ hsz2, HDDEDATA hdata, 59 HSZ hsz1, HSZ hsz2, HDDEDATA hdata,
@@ -76,6 +80,7 @@ static struct entry
76} 80}
77env_vars[] = 81env_vars[] =
78{ 82{
83#ifdef OLD_PATHS
79 {"emacs_dir", NULL}, 84 {"emacs_dir", NULL},
80 {"EMACSLOADPATH", "%emacs_dir%/site-lisp;%emacs_dir%/../site-lisp;%emacs_dir%/lisp;%emacs_dir%/leim"}, 85 {"EMACSLOADPATH", "%emacs_dir%/site-lisp;%emacs_dir%/../site-lisp;%emacs_dir%/lisp;%emacs_dir%/leim"},
81 {"SHELL", "%emacs_dir%/bin/cmdproxy.exe"}, 86 {"SHELL", "%emacs_dir%/bin/cmdproxy.exe"},
@@ -86,6 +91,18 @@ env_vars[] =
86 /* {"INFOPATH", "%emacs_dir%/info"}, */ 91 /* {"INFOPATH", "%emacs_dir%/info"}, */
87 {"EMACSDOC", "%emacs_dir%/etc"}, 92 {"EMACSDOC", "%emacs_dir%/etc"},
88 {"TERM", "cmd"} 93 {"TERM", "cmd"}
94#else /* !OLD_PATHS */
95 {"emacs_dir", NULL},
96 {"EMACSLOADPATH", PATH_SITELOADSEARCH ";" PATH_LOADSEARCH},
97 {"SHELL", PATH_EXEC "/cmdproxy.exe"},
98 {"EMACSDATA", PATH_DATA},
99 {"EMACSPATH", PATH_EXEC},
100 /* We no longer set INFOPATH because Info-default-directory-list
101 is then ignored. */
102 /* {"INFOPATH", "%emacs_dir%/info"}, */
103 {"EMACSDOC", PATH_DOC},
104 {"TERM", "cmd"}
105#endif
89}; 106};
90 107
91BOOL 108BOOL
diff --git a/nt/epaths.nt b/nt/epaths.nt
new file mode 100644
index 00000000000..1e418550d52
--- /dev/null
+++ b/nt/epaths.nt
@@ -0,0 +1,89 @@
1/* Hey Emacs, this is -*- C -*- code! */
2/* epaths.in file for MS-Windows build that uses the configure script.
3
4 Since Emacs on Windows must be relocatable to any directory, it
5 cannot have here hard-coded directories determined at configure
6 time. Therefore, each directory must begin with %emacs_dir%, which
7 is resolved at startup to the root of the Emacs installation tree
8 (see w32.c:init_environment).
9
10 This file is edited at configure time to replace @VER@ by the Emacs
11 version being built (e.g., 25.9.77), @CFG@ by the canonical name of
12 the host system (e.g., i686-pc-mingw32), and @SRC@ by the root of
13 the Emacs source tree used to build Emacs. */
14/*
15Copyright (C) 1993, 1995, 1997, 1999, 2001-2013 Free Software
16Foundation, Inc.
17
18This file is part of GNU Emacs.
19
20GNU Emacs is free software: you can redistribute it and/or modify
21it under the terms of the GNU General Public License as published by
22the Free Software Foundation, either version 3 of the License, or
23(at your option) any later version.
24
25GNU Emacs is distributed in the hope that it will be useful,
26but WITHOUT ANY WARRANTY; without even the implied warranty of
27MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28GNU General Public License for more details.
29
30You should have received a copy of the GNU General Public License
31along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
32
33
34/* Together with PATH_SITELOADSEARCH, this gives the default value of
35 load-path, which is the search path for the Lisp function "load".
36 Configure (using "make epaths-force") sets this to
37 ${standardlisppath}, which typically has a value like:
38 <datadir>/emacs/VERSION/lisp:<datadir>/emacs/VERSION/leim
39 where datadir is eg /usr/local/share.
40*/
41#define PATH_LOADSEARCH "%emacs_dir%/share/emacs/@VER@/lisp;%emacs_dir%/share/emacs/@VER@/leim"
42
43/* Like PATH_LOADSEARCH, but contains the non-standard pieces.
44 These are the site-lisp directories, typically something like
45 <datadir>/emacs/VERSION/site-lisp:<datadir>/emacs/site-lisp
46 Configure prepends any $locallisppath, as set by the
47 --enable-locallisppath argument.
48 This is combined with PATH_LOADSEARCH to make the default load-path.
49 If the --no-site-lisp option is used, this piece is excluded.
50*/
51#define PATH_SITELOADSEARCH "%emacs_dir%/share/emacs/@VER@/site-lisp;%emacs_dir%/share/emacs/site-lisp"
52
53/* Like PATH_LOADSEARCH, but used only during the build process
54 when Emacs is dumping. Configure (using "make epaths-force") sets
55 this to $buildlisppath, which normally has the value: <srcdir>/lisp.
56*/
57#define PATH_DUMPLOADSEARCH "@SRC@/lisp"
58
59/* The extra search path for programs to invoke. This is appended to
60 whatever the PATH environment variable says to set the Lisp
61 variable exec-path and the first file name in it sets the Lisp
62 variable exec-directory. exec-directory is used for finding
63 executables and other architecture-dependent files. */
64#define PATH_EXEC "%emacs_dir%/libexec/emacs/@VER@/@CFG@"
65
66/* Where Emacs should look for its architecture-independent data
67 files, like the NEWS file. The lisp variable data-directory
68 is set to this value. */
69#define PATH_DATA "%emacs_dir%/share/emacs/@VER@/etc"
70
71/* Where Emacs should look for X bitmap files.
72 The lisp variable x-bitmap-file-path is set based on this value. */
73#define PATH_BITMAPS ""
74
75/* Where Emacs should look for its docstring file. The lisp variable
76 doc-directory is set to this value. */
77#define PATH_DOC "%emacs_dir%/share/emacs/@VER@/etc"
78
79/* Where the configuration process believes the info tree lives. The
80 lisp variable configure-info-directory gets its value from this
81 macro, and is then used to set the Info-default-directory-list. */
82#define PATH_INFO "%emacs_dir%/share/info"
83
84/* Where Emacs should store game score files. */
85#define PATH_GAME "%emacs_dir%/var/games/emacs"
86
87/* Where Emacs should look for the application default file. */
88#define PATH_X_DEFAULTS ""
89
diff --git a/nt/gnulib.mk b/nt/gnulib.mk
new file mode 100644
index 00000000000..ac4fc2768d9
--- /dev/null
+++ b/nt/gnulib.mk
@@ -0,0 +1,902 @@
1## This file is an edited copy if ../lib/gnulib.mk.
2##
3## The purpose of the edits is to avoid generating any headers
4## which would conflict with either the headers we have in nt/inc,
5## or with MinGW system headers and subsequent redirection of some
6## functions in nt/inc/ms-w32.h.
7##
8## In general, do NOT remove anything from ../lib/gnulib.mk that
9## doesn't need to be removed, to minimize the differences from
10## upstream gnulib.mk and thus make the maintenance easier. Every
11## header file whose generation is controlled by configure-time tests
12## does NOT need to be removed; instead, force the configure script to
13## accept whatever MinGW has to offer, by defining the appropriate
14## Autoconf variable in the nt/mingw-cfg.site file. Headers that are
15## generated conditionally have the tell-tale "if GL_GENERATE_foo_H"
16## condition before their Makefile snippet in this file. Likewise, do
17## NOT remove gnulib modules which introduce header files that don't
18## exist in MinGW and in nt/inc/, since they cannot possibly clash
19## with anything. Gnulib modules that introduce source *.c files also
20## need not be removed; if they define functions that could clash with
21## the w32 substitutes in Emacs, disable their compilation by defining
22## suitable variables in nt/mingw-cfg.site.
23##
24## Process this file with automake to produce Makefile.in.
25# Copyright (C) 2002-2013 Free Software Foundation, Inc.
26#
27# This file is free software; you can redistribute it and/or modify
28# it under the terms of the GNU General Public License as published by
29# the Free Software Foundation; either version 3 of the License, or
30# (at your option) any later version.
31#
32# This file is distributed in the hope that it will be useful,
33# but WITHOUT ANY WARRANTY; without even the implied warranty of
34# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
35# GNU General Public License for more details.
36#
37# You should have received a copy of the GNU General Public License
38# along with this file. If not, see <http://www.gnu.org/licenses/>.
39#
40# As a special exception to the GNU General Public License,
41# this file may be distributed as part of a program that
42# contains a configuration script generated by Autoconf, under
43# the same distribution terms as the rest of that program.
44#
45# Generated by gnulib-tool.
46# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=dup --avoid=fchdir --avoid=fcntl --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-ctype c-strcase careadlinkat close-stream crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat fcntl-h fdatasync fdopendir filemode fstatat fsync getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings memrchr mktime pselect pthread_sigmask putenv qacl readlink readlinkat sig2str socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timer-time timespec-add timespec-sub unsetenv utimens warnings
47
48
49MOSTLYCLEANFILES += core *.stackdump
50
51noinst_LIBRARIES += libgnu.a
52
53libgnu_a_SOURCES =
54libgnu_a_LIBADD = $(gl_LIBOBJS)
55libgnu_a_DEPENDENCIES = $(gl_LIBOBJS)
56EXTRA_libgnu_a_SOURCES =
57
58## begin gnulib module alloca-opt
59
60BUILT_SOURCES += $(ALLOCA_H)
61
62# We need the following in order to create <alloca.h> when the system
63# doesn't have one that works with the given compiler.
64if GL_GENERATE_ALLOCA_H
65alloca.h: alloca.in.h $(top_builddir)/config.status
66 $(AM_V_GEN)rm -f $@-t $@ && \
67 { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
68 cat $(srcdir)/alloca.in.h; \
69 } > $@-t && \
70 mv -f $@-t $@
71else
72alloca.h: $(top_builddir)/config.status
73 rm -f $@
74endif
75MOSTLYCLEANFILES += alloca.h alloca.h-t
76
77EXTRA_DIST += alloca.in.h
78
79## end gnulib module alloca-opt
80
81## begin gnulib module c-ctype
82
83libgnu_a_SOURCES += c-ctype.h c-ctype.c
84
85## end gnulib module c-ctype
86
87## begin gnulib module c-strcase
88
89libgnu_a_SOURCES += c-strcase.h c-strcasecmp.c c-strncasecmp.c
90
91## end gnulib module c-strcase
92
93## begin gnulib module close-stream
94
95libgnu_a_SOURCES += close-stream.c
96
97EXTRA_DIST += close-stream.h
98
99## end gnulib module close-stream
100
101## begin gnulib module crypto/md5
102
103libgnu_a_SOURCES += md5.c
104
105EXTRA_DIST += md5.h
106
107## end gnulib module crypto/md5
108
109## begin gnulib module crypto/sha1
110
111libgnu_a_SOURCES += sha1.c
112
113EXTRA_DIST += sha1.h
114
115## end gnulib module crypto/sha1
116
117## begin gnulib module crypto/sha256
118
119libgnu_a_SOURCES += sha256.c
120
121EXTRA_DIST += sha256.h
122
123## end gnulib module crypto/sha256
124
125## begin gnulib module crypto/sha512
126
127libgnu_a_SOURCES += sha512.c
128
129EXTRA_DIST += sha512.h
130
131## end gnulib module crypto/sha512
132
133## begin gnulib module dosname
134
135if gl_GNULIB_ENABLED_dosname
136
137endif
138EXTRA_DIST += dosname.h
139
140## end gnulib module dosname
141
142## begin gnulib module dtoastr
143
144libgnu_a_SOURCES += dtoastr.c
145
146EXTRA_DIST += ftoastr.c ftoastr.h
147
148EXTRA_libgnu_a_SOURCES += ftoastr.c
149
150## end gnulib module dtoastr
151
152## begin gnulib module dtotimespec
153
154libgnu_a_SOURCES += dtotimespec.c
155
156## end gnulib module dtotimespec
157
158## begin gnulib module dup2
159
160
161EXTRA_DIST += dup2.c
162
163EXTRA_libgnu_a_SOURCES += dup2.c
164
165## end gnulib module dup2
166
167## begin gnulib module errno
168
169BUILT_SOURCES += $(ERRNO_H)
170
171# We need the following in order to create <errno.h> when the system
172# doesn't have one that is POSIX compliant.
173if GL_GENERATE_ERRNO_H
174errno.h: errno.in.h $(top_builddir)/config.status
175 $(AM_V_GEN)rm -f $@-t $@ && \
176 { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
177 sed -e 's|@''GUARD_PREFIX''@|GL|g' \
178 -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
179 -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
180 -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
181 -e 's|@''NEXT_ERRNO_H''@|$(NEXT_ERRNO_H)|g' \
182 -e 's|@''EMULTIHOP_HIDDEN''@|$(EMULTIHOP_HIDDEN)|g' \
183 -e 's|@''EMULTIHOP_VALUE''@|$(EMULTIHOP_VALUE)|g' \
184 -e 's|@''ENOLINK_HIDDEN''@|$(ENOLINK_HIDDEN)|g' \
185 -e 's|@''ENOLINK_VALUE''@|$(ENOLINK_VALUE)|g' \
186 -e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \
187 -e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \
188 < $(srcdir)/errno.in.h; \
189 } > $@-t && \
190 mv $@-t $@
191else
192errno.h: $(top_builddir)/config.status
193 rm -f $@
194endif
195MOSTLYCLEANFILES += errno.h errno.h-t
196
197EXTRA_DIST += errno.in.h
198
199## end gnulib module errno
200
201## begin gnulib module euidaccess
202
203if gl_GNULIB_ENABLED_euidaccess
204
205endif
206EXTRA_DIST += euidaccess.c
207
208EXTRA_libgnu_a_SOURCES += euidaccess.c
209
210## end gnulib module euidaccess
211
212## begin gnulib module execinfo
213
214BUILT_SOURCES += $(EXECINFO_H)
215
216# We need the following in order to create <execinfo.h> when the system
217# doesn't have one that works.
218if GL_GENERATE_EXECINFO_H
219execinfo.h: execinfo.in.h $(top_builddir)/config.status
220 $(AM_V_GEN)rm -f $@-t $@ && \
221 { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
222 cat $(srcdir)/execinfo.in.h; \
223 } > $@-t && \
224 mv $@-t $@
225else
226execinfo.h: $(top_builddir)/config.status
227 rm -f $@
228endif
229MOSTLYCLEANFILES += execinfo.h execinfo.h-t
230
231EXTRA_DIST += execinfo.c execinfo.in.h
232
233EXTRA_libgnu_a_SOURCES += execinfo.c
234
235## end gnulib module execinfo
236
237## begin gnulib module faccessat
238
239
240EXTRA_DIST += at-func.c faccessat.c
241
242EXTRA_libgnu_a_SOURCES += at-func.c faccessat.c
243
244## end gnulib module faccessat
245
246## begin gnulib module fdatasync
247
248
249EXTRA_DIST += fdatasync.c
250
251EXTRA_libgnu_a_SOURCES += fdatasync.c
252
253## end gnulib module fdatasync
254
255## begin gnulib module fdopendir
256
257
258EXTRA_DIST += fdopendir.c
259
260EXTRA_libgnu_a_SOURCES += fdopendir.c
261
262## end gnulib module fdopendir
263
264## begin gnulib module filemode
265
266libgnu_a_SOURCES += filemode.c
267
268EXTRA_DIST += filemode.h
269
270## end gnulib module filemode
271
272## begin gnulib module fpending
273
274
275EXTRA_DIST += fpending.c fpending.h
276
277EXTRA_libgnu_a_SOURCES += fpending.c
278
279## end gnulib module fpending
280
281## begin gnulib module fstatat
282
283
284EXTRA_DIST += at-func.c fstatat.c
285
286EXTRA_libgnu_a_SOURCES += at-func.c fstatat.c
287
288## end gnulib module fstatat
289
290## begin gnulib module fsync
291
292
293EXTRA_DIST += fsync.c
294
295EXTRA_libgnu_a_SOURCES += fsync.c
296
297## end gnulib module fsync
298
299## begin gnulib module getgroups
300
301if gl_GNULIB_ENABLED_getgroups
302
303endif
304EXTRA_DIST += getgroups.c
305
306EXTRA_libgnu_a_SOURCES += getgroups.c
307
308## end gnulib module getgroups
309
310## begin gnulib module getloadavg
311
312
313EXTRA_DIST += getloadavg.c
314
315EXTRA_libgnu_a_SOURCES += getloadavg.c
316
317## end gnulib module getloadavg
318
319## begin gnulib module getopt-posix
320
321BUILT_SOURCES += $(GETOPT_H)
322
323# We need the following in order to create <getopt.h> when the system
324# doesn't have one that works with the given compiler.
325getopt.h: getopt.in.h $(top_builddir)/config.status $(ARG_NONNULL_H)
326 $(AM_V_GEN)rm -f $@-t $@ && \
327 { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
328 sed -e 's|@''GUARD_PREFIX''@|GL|g' \
329 -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \
330 -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
331 -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
332 -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
333 -e 's|@''NEXT_GETOPT_H''@|$(NEXT_GETOPT_H)|g' \
334 -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
335 < $(srcdir)/getopt.in.h; \
336 } > $@-t && \
337 mv -f $@-t $@
338MOSTLYCLEANFILES += getopt.h getopt.h-t
339
340EXTRA_DIST += getopt.c getopt.in.h getopt1.c getopt_int.h
341
342EXTRA_libgnu_a_SOURCES += getopt.c getopt1.c
343
344## end gnulib module getopt-posix
345
346## begin gnulib module gettext-h
347
348if gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36
349libgnu_a_SOURCES += gettext.h
350
351endif
352## end gnulib module gettext-h
353
354## begin gnulib module gettime
355
356libgnu_a_SOURCES += gettime.c
357
358## end gnulib module gettime
359
360## begin gnulib module gettimeofday
361
362
363EXTRA_DIST += gettimeofday.c
364
365EXTRA_libgnu_a_SOURCES += gettimeofday.c
366
367## end gnulib module gettimeofday
368
369## begin gnulib module group-member
370
371if gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1
372
373endif
374EXTRA_DIST += group-member.c
375
376EXTRA_libgnu_a_SOURCES += group-member.c
377
378## end gnulib module group-member
379
380## begin gnulib module ignore-value
381
382
383EXTRA_DIST += ignore-value.h
384
385## end gnulib module ignore-value
386
387## begin gnulib module intprops
388
389
390EXTRA_DIST += intprops.h
391
392## end gnulib module intprops
393
394## begin gnulib module lstat
395
396
397EXTRA_DIST += lstat.c
398
399EXTRA_libgnu_a_SOURCES += lstat.c
400
401## end gnulib module lstat
402
403## begin gnulib module memrchr
404
405
406EXTRA_DIST += memrchr.c
407
408EXTRA_libgnu_a_SOURCES += memrchr.c
409
410## end gnulib module memrchr
411
412## begin gnulib module mktime
413
414
415EXTRA_DIST += mktime-internal.h mktime.c
416
417EXTRA_libgnu_a_SOURCES += mktime.c
418
419## end gnulib module mktime
420
421## begin gnulib module openat-h
422
423if gl_GNULIB_ENABLED_03e0aaad4cb89ca757653bd367a6ccb7
424
425endif
426EXTRA_DIST += openat.h
427
428## end gnulib module openat-h
429
430## begin gnulib module pathmax
431
432if gl_GNULIB_ENABLED_pathmax
433
434endif
435EXTRA_DIST += pathmax.h
436
437## end gnulib module pathmax
438
439## begin gnulib module pselect
440
441
442EXTRA_DIST += pselect.c
443
444EXTRA_libgnu_a_SOURCES += pselect.c
445
446## end gnulib module pselect
447
448## begin gnulib module pthread_sigmask
449
450
451EXTRA_DIST += pthread_sigmask.c
452
453EXTRA_libgnu_a_SOURCES += pthread_sigmask.c
454
455## end gnulib module pthread_sigmask
456
457## begin gnulib module putenv
458
459
460EXTRA_DIST += putenv.c
461
462EXTRA_libgnu_a_SOURCES += putenv.c
463
464## end gnulib module putenv
465
466## begin gnulib module qacl
467
468libgnu_a_SOURCES += acl-errno-valid.c file-has-acl.c qcopy-acl.c
469
470EXTRA_DIST += acl-internal.h acl.h acl_entries.c
471
472EXTRA_libgnu_a_SOURCES += acl_entries.c
473
474## end gnulib module qacl
475
476## begin gnulib module readlink
477
478
479EXTRA_DIST += readlink.c
480
481EXTRA_libgnu_a_SOURCES += readlink.c
482
483## end gnulib module readlink
484
485## begin gnulib module readlinkat
486
487
488EXTRA_DIST += at-func.c readlinkat.c
489
490EXTRA_libgnu_a_SOURCES += at-func.c readlinkat.c
491
492## end gnulib module readlinkat
493
494## begin gnulib module root-uid
495
496if gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c
497
498endif
499EXTRA_DIST += root-uid.h
500
501## end gnulib module root-uid
502
503## begin gnulib module sig2str
504
505
506EXTRA_DIST += sig2str.c sig2str.h
507
508EXTRA_libgnu_a_SOURCES += sig2str.c
509
510## end gnulib module sig2str
511
512## begin gnulib module snippet/_Noreturn
513
514# Because this Makefile snippet defines a variable used by other
515# gnulib Makefile snippets, it must be present in all Makefile.am that
516# need it. This is ensured by the applicability 'all' defined above.
517
518_NORETURN_H=$(top_srcdir)/build-aux/snippet/_Noreturn.h
519
520EXTRA_DIST += $(top_srcdir)/build-aux/snippet/_Noreturn.h
521
522## end gnulib module snippet/_Noreturn
523
524## begin gnulib module snippet/arg-nonnull
525
526# The BUILT_SOURCES created by this Makefile snippet are not used via #include
527# statements but through direct file reference. Therefore this snippet must be
528# present in all Makefile.am that need it. This is ensured by the applicability
529# 'all' defined above.
530
531BUILT_SOURCES += arg-nonnull.h
532# The arg-nonnull.h that gets inserted into generated .h files is the same as
533# build-aux/snippet/arg-nonnull.h, except that it has the copyright header cut
534# off.
535arg-nonnull.h: $(top_srcdir)/build-aux/snippet/arg-nonnull.h
536 $(AM_V_GEN)rm -f $@-t $@ && \
537 sed -n -e '/GL_ARG_NONNULL/,$$p' \
538 < $(top_srcdir)/build-aux/snippet/arg-nonnull.h \
539 > $@-t && \
540 mv $@-t $@
541MOSTLYCLEANFILES += arg-nonnull.h arg-nonnull.h-t
542
543ARG_NONNULL_H=arg-nonnull.h
544
545EXTRA_DIST += $(top_srcdir)/build-aux/snippet/arg-nonnull.h
546
547## end gnulib module snippet/arg-nonnull
548
549## begin gnulib module snippet/c++defs
550
551# The BUILT_SOURCES created by this Makefile snippet are not used via #include
552# statements but through direct file reference. Therefore this snippet must be
553# present in all Makefile.am that need it. This is ensured by the applicability
554# 'all' defined above.
555
556BUILT_SOURCES += c++defs.h
557# The c++defs.h that gets inserted into generated .h files is the same as
558# build-aux/snippet/c++defs.h, except that it has the copyright header cut off.
559c++defs.h: $(top_srcdir)/build-aux/snippet/c++defs.h
560 $(AM_V_GEN)rm -f $@-t $@ && \
561 sed -n -e '/_GL_CXXDEFS/,$$p' \
562 < $(top_srcdir)/build-aux/snippet/c++defs.h \
563 > $@-t && \
564 mv $@-t $@
565MOSTLYCLEANFILES += c++defs.h c++defs.h-t
566
567CXXDEFS_H=c++defs.h
568
569EXTRA_DIST += $(top_srcdir)/build-aux/snippet/c++defs.h
570
571## end gnulib module snippet/c++defs
572
573## begin gnulib module snippet/warn-on-use
574
575BUILT_SOURCES += warn-on-use.h
576# The warn-on-use.h that gets inserted into generated .h files is the same as
577# build-aux/snippet/warn-on-use.h, except that it has the copyright header cut
578# off.
579warn-on-use.h: $(top_srcdir)/build-aux/snippet/warn-on-use.h
580 $(AM_V_GEN)rm -f $@-t $@ && \
581 sed -n -e '/^.ifndef/,$$p' \
582 < $(top_srcdir)/build-aux/snippet/warn-on-use.h \
583 > $@-t && \
584 mv $@-t $@
585MOSTLYCLEANFILES += warn-on-use.h warn-on-use.h-t
586
587WARN_ON_USE_H=warn-on-use.h
588
589EXTRA_DIST += $(top_srcdir)/build-aux/snippet/warn-on-use.h
590
591## end gnulib module snippet/warn-on-use
592
593## begin gnulib module stat
594
595if gl_GNULIB_ENABLED_stat
596
597endif
598EXTRA_DIST += stat.c
599
600EXTRA_libgnu_a_SOURCES += stat.c
601
602## end gnulib module stat
603
604## begin gnulib module stat-time
605
606libgnu_a_SOURCES += stat-time.c
607
608EXTRA_DIST += stat-time.h
609
610## end gnulib module stat-time
611
612## begin gnulib module stdalign
613
614BUILT_SOURCES += $(STDALIGN_H)
615
616# We need the following in order to create <stdalign.h> when the system
617# doesn't have one that works.
618if GL_GENERATE_STDALIGN_H
619stdalign.h: stdalign.in.h $(top_builddir)/config.status
620 $(AM_V_GEN)rm -f $@-t $@ && \
621 { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
622 cat $(srcdir)/stdalign.in.h; \
623 } > $@-t && \
624 mv $@-t $@
625else
626stdalign.h: $(top_builddir)/config.status
627 rm -f $@
628endif
629MOSTLYCLEANFILES += stdalign.h stdalign.h-t
630
631EXTRA_DIST += stdalign.in.h
632
633## end gnulib module stdalign
634
635## begin gnulib module stdarg
636
637BUILT_SOURCES += $(STDARG_H)
638
639# We need the following in order to create <stdarg.h> when the system
640# doesn't have one that works with the given compiler.
641if GL_GENERATE_STDARG_H
642stdarg.h: stdarg.in.h $(top_builddir)/config.status
643 $(AM_V_GEN)rm -f $@-t $@ && \
644 { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
645 sed -e 's|@''GUARD_PREFIX''@|GL|g' \
646 -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
647 -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
648 -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
649 -e 's|@''NEXT_STDARG_H''@|$(NEXT_STDARG_H)|g' \
650 < $(srcdir)/stdarg.in.h; \
651 } > $@-t && \
652 mv $@-t $@
653else
654stdarg.h: $(top_builddir)/config.status
655 rm -f $@
656endif
657MOSTLYCLEANFILES += stdarg.h stdarg.h-t
658
659EXTRA_DIST += stdarg.in.h
660
661## end gnulib module stdarg
662
663## begin gnulib module stdbool
664
665BUILT_SOURCES += $(STDBOOL_H)
666
667# We need the following in order to create <stdbool.h> when the system
668# doesn't have one that works.
669if GL_GENERATE_STDBOOL_H
670stdbool.h: stdbool.in.h $(top_builddir)/config.status
671 $(AM_V_GEN)rm -f $@-t $@ && \
672 { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
673 sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \
674 } > $@-t && \
675 mv $@-t $@
676else
677stdbool.h: $(top_builddir)/config.status
678 rm -f $@
679endif
680MOSTLYCLEANFILES += stdbool.h stdbool.h-t
681
682EXTRA_DIST += stdbool.in.h
683
684## end gnulib module stdbool
685
686## begin gnulib module stddef
687
688BUILT_SOURCES += $(STDDEF_H)
689
690# We need the following in order to create <stddef.h> when the system
691# doesn't have one that works with the given compiler.
692if GL_GENERATE_STDDEF_H
693stddef.h: stddef.in.h $(top_builddir)/config.status
694 $(AM_V_GEN)rm -f $@-t $@ && \
695 { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
696 sed -e 's|@''GUARD_PREFIX''@|GL|g' \
697 -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
698 -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
699 -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
700 -e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \
701 -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \
702 -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \
703 < $(srcdir)/stddef.in.h; \
704 } > $@-t && \
705 mv $@-t $@
706else
707stddef.h: $(top_builddir)/config.status
708 rm -f $@
709endif
710MOSTLYCLEANFILES += stddef.h stddef.h-t
711
712EXTRA_DIST += stddef.in.h
713
714## end gnulib module stddef
715
716## begin gnulib module stdint
717
718BUILT_SOURCES += $(STDINT_H)
719
720# We need the following in order to create <stdint.h> when the system
721# doesn't have one that works with the given compiler.
722if GL_GENERATE_STDINT_H
723stdint.h: stdint.in.h $(top_builddir)/config.status
724 $(AM_V_GEN)rm -f $@-t $@ && \
725 { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
726 sed -e 's|@''GUARD_PREFIX''@|GL|g' \
727 -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \
728 -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
729 -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
730 -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
731 -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \
732 -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \
733 -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
734 -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \
735 -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \
736 -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \
737 -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \
738 -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \
739 -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \
740 -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \
741 -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \
742 -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \
743 -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \
744 -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \
745 -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \
746 -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \
747 -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \
748 -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \
749 -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \
750 -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \
751 -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \
752 -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \
753 < $(srcdir)/stdint.in.h; \
754 } > $@-t && \
755 mv $@-t $@
756else
757stdint.h: $(top_builddir)/config.status
758 rm -f $@
759endif
760MOSTLYCLEANFILES += stdint.h stdint.h-t
761
762EXTRA_DIST += stdint.in.h
763
764## end gnulib module stdint
765
766## begin gnulib module strftime
767
768libgnu_a_SOURCES += strftime.c
769
770EXTRA_DIST += strftime.h
771
772## end gnulib module strftime
773
774## begin gnulib module strtoimax
775
776
777EXTRA_DIST += strtoimax.c
778
779EXTRA_libgnu_a_SOURCES += strtoimax.c
780
781## end gnulib module strtoimax
782
783## begin gnulib module strtoll
784
785if gl_GNULIB_ENABLED_strtoll
786
787endif
788EXTRA_DIST += strtol.c strtoll.c
789
790EXTRA_libgnu_a_SOURCES += strtol.c strtoll.c
791
792## end gnulib module strtoll
793
794## begin gnulib module strtoull
795
796if gl_GNULIB_ENABLED_strtoull
797
798endif
799EXTRA_DIST += strtol.c strtoul.c strtoull.c
800
801EXTRA_libgnu_a_SOURCES += strtol.c strtoul.c strtoull.c
802
803## end gnulib module strtoull
804
805## begin gnulib module strtoumax
806
807
808EXTRA_DIST += strtoimax.c strtoumax.c
809
810EXTRA_libgnu_a_SOURCES += strtoimax.c strtoumax.c
811
812## end gnulib module strtoumax
813
814## begin gnulib module symlink
815
816
817EXTRA_DIST += symlink.c
818
819EXTRA_libgnu_a_SOURCES += symlink.c
820
821## end gnulib module symlink
822
823## begin gnulib module time_r
824
825
826EXTRA_DIST += time_r.c
827
828EXTRA_libgnu_a_SOURCES += time_r.c
829
830## end gnulib module time_r
831
832## begin gnulib module timespec
833
834libgnu_a_SOURCES += timespec.c
835
836EXTRA_DIST += timespec.h
837
838## end gnulib module timespec
839
840## begin gnulib module timespec-add
841
842libgnu_a_SOURCES += timespec-add.c
843
844## end gnulib module timespec-add
845
846## begin gnulib module timespec-sub
847
848libgnu_a_SOURCES += timespec-sub.c
849
850## end gnulib module timespec-sub
851
852## begin gnulib module u64
853
854libgnu_a_SOURCES += u64.c
855
856EXTRA_DIST += u64.h
857
858## end gnulib module u64
859
860## begin gnulib module unsetenv
861
862
863EXTRA_DIST += unsetenv.c
864
865EXTRA_libgnu_a_SOURCES += unsetenv.c
866
867## end gnulib module unsetenv
868
869## begin gnulib module utimens
870
871libgnu_a_SOURCES += utimens.c
872
873EXTRA_DIST += utimens.h
874
875## end gnulib module utimens
876
877## begin gnulib module verify
878
879if gl_GNULIB_ENABLED_verify
880
881endif
882EXTRA_DIST += verify.h
883
884## end gnulib module verify
885
886## begin gnulib module xalloc-oversized
887
888if gl_GNULIB_ENABLED_682e609604ccaac6be382e4ee3a4eaec
889
890endif
891EXTRA_DIST += xalloc-oversized.h
892
893## end gnulib module xalloc-oversized
894
895
896mostlyclean-local: mostlyclean-generic
897 @for dir in '' $(MOSTLYCLEANDIRS); do \
898 if test -n "$$dir" && test -d $$dir; then \
899 echo "rmdir $$dir"; rmdir $$dir; \
900 fi; \
901 done; \
902 :
diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h
index 9ff03994be2..29c8e383893 100644
--- a/nt/inc/ms-w32.h
+++ b/nt/inc/ms-w32.h
@@ -67,7 +67,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
67#endif 67#endif
68 68
69#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)) 69#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8))
70#define HAVE___BUILTIN_UNWIND_INIT 1 70# ifndef HAVE___BUILTIN_UNWIND_INIT
71# define HAVE___BUILTIN_UNWIND_INIT 1
72# endif
71#endif 73#endif
72 74
73/* This isn't perfect, as some systems might have the page file in 75/* This isn't perfect, as some systems might have the page file in
@@ -99,8 +101,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
99#endif 101#endif
100 102
101#ifdef __GNUC__ 103#ifdef __GNUC__
102# define restrict __restrict__ 104/* config.h may have defined already. */
105# ifndef restrict
106# define restrict __restrict__
107# endif
103#else 108#else
109 /* FIXME: should we define to __restrict, which MSVC supports? */
104# define restrict 110# define restrict
105#endif 111#endif
106 112
@@ -138,9 +144,6 @@ extern char *getenv ();
138/* Make a leaner executable. */ 144/* Make a leaner executable. */
139#define WIN32_LEAN_AND_MEAN 1 145#define WIN32_LEAN_AND_MEAN 1
140 146
141#ifdef HAVE_STRINGS_H
142#include "strings.h"
143#endif
144#include <sys/types.h> 147#include <sys/types.h>
145 148
146#ifndef MAXPATHLEN 149#ifndef MAXPATHLEN
@@ -148,8 +151,12 @@ extern char *getenv ();
148#endif 151#endif
149 152
150#ifdef HAVE_NTGUI 153#ifdef HAVE_NTGUI
151#define HAVE_WINDOW_SYSTEM 1 154# ifndef HAVE_WINDOW_SYSTEM
152#define HAVE_MENUS 1 155# define HAVE_WINDOW_SYSTEM 1
156# endif
157# ifndef HAVE_MENUS
158# define HAVE_MENUS 1
159# endif
153#endif 160#endif
154 161
155/* Get some redefinitions in place. */ 162/* Get some redefinitions in place. */
@@ -248,9 +255,6 @@ extern int sys_unlink (const char *);
248#define execvp _execvp 255#define execvp _execvp
249#define fdatasync _commit 256#define fdatasync _commit
250#define fdopen _fdopen 257#define fdopen _fdopen
251#ifndef fileno
252#define fileno _fileno
253#endif
254#define fsync _commit 258#define fsync _commit
255#define ftruncate _chsize 259#define ftruncate _chsize
256#define getpid _getpid 260#define getpid _getpid
@@ -266,9 +270,6 @@ typedef int pid_t;
266#define popen _popen 270#define popen _popen
267#define pclose _pclose 271#define pclose _pclose
268#define umask _umask 272#define umask _umask
269#ifndef _MSC_VER
270#define utimbuf _utimbuf
271#endif
272#define strdup _strdup 273#define strdup _strdup
273#define strupr _strupr 274#define strupr _strupr
274#define strnicmp _strnicmp 275#define strnicmp _strnicmp
@@ -285,10 +286,6 @@ int _getpid (void);
285 array, and triggers an error message. */ 286 array, and triggers an error message. */
286#include <time.h> 287#include <time.h>
287#define tzname _tzname 288#define tzname _tzname
288#if !defined (_MSC_VER) || (_MSC_VER < 1400)
289#undef utime
290#define utime _utime
291#endif
292 289
293/* 'struct timespec' is used by time-related functions in lib/ and 290/* 'struct timespec' is used by time-related functions in lib/ and
294 elsewhere, but we don't use lib/time.h where the structure is 291 elsewhere, but we don't use lib/time.h where the structure is
@@ -327,6 +324,9 @@ extern struct tm *localtime_r (time_t const * restrict, struct tm * restrict);
327#include <io.h> 324#include <io.h>
328#include <stdio.h> 325#include <stdio.h>
329#endif /* !_MSC_VER */ 326#endif /* !_MSC_VER */
327#ifndef fileno
328#define fileno _fileno
329#endif
330 330
331/* Defines that we need that aren't in the standard signal.h. */ 331/* Defines that we need that aren't in the standard signal.h. */
332#define SIGHUP 1 /* Hang up */ 332#define SIGHUP 1 /* Hang up */
@@ -346,20 +346,21 @@ extern struct tm *localtime_r (time_t const * restrict, struct tm * restrict);
346#define ENOTSUP ENOSYS 346#define ENOTSUP ENOSYS
347#endif 347#endif
348 348
349/* WINDOWSNT <errno.h> doesn't define EOPNOTSUPP, and we don't have 349/* In case lib/errno.h is not used. */
350 'configure' working yet so we can't rely on the Gnulib replacement 350#ifndef EOPNOTSUPP
351 errno.h defining EOPNOTSUPP. Work around the problem by defining
352 it here. */
353#define EOPNOTSUPP 130 351#define EOPNOTSUPP 130
352#endif
354 353
355#ifdef _MSC_VER 354#ifdef _MSC_VER
356typedef int sigset_t; 355typedef int sigset_t;
357typedef int ssize_t; 356typedef int ssize_t;
358#endif 357#endif
359 358
360#ifndef _POSIX /* MinGW64 */ 359#ifdef _W64 /* MinGW64 */
360#ifndef _POSIX
361typedef _sigset_t sigset_t; 361typedef _sigset_t sigset_t;
362#endif 362#endif
363#endif
363 364
364typedef void (_CALLBACK_ *signal_handler) (int); 365typedef void (_CALLBACK_ *signal_handler) (int);
365extern signal_handler sys_signal (int, signal_handler); 366extern signal_handler sys_signal (int, signal_handler);
@@ -395,10 +396,12 @@ extern int sys_kill (int, int);
395#define getdefdir(_drv, _buf) _getdcwd (_drv, _buf, MAXPATHLEN) 396#define getdefdir(_drv, _buf) _getdcwd (_drv, _buf, MAXPATHLEN)
396#endif 397#endif
397 398
399#ifndef EMACS_CONFIGURATION
398extern char *get_emacs_configuration (void); 400extern char *get_emacs_configuration (void);
399extern char *get_emacs_configuration_options (void); 401extern char *get_emacs_configuration_options (void);
400#define EMACS_CONFIGURATION get_emacs_configuration () 402#define EMACS_CONFIGURATION get_emacs_configuration ()
401#define EMACS_CONFIG_OPTIONS get_emacs_configuration_options () 403#define EMACS_CONFIG_OPTIONS get_emacs_configuration_options ()
404#endif
402 405
403/* Define this so that winsock.h definitions don't get included with 406/* Define this so that winsock.h definitions don't get included with
404 windows.h. For this to have proper effect, config.h must always be 407 windows.h. For this to have proper effect, config.h must always be
@@ -452,10 +455,14 @@ extern void * memrchr (void const *, int, size_t);
452#if defined (__MINGW32__) 455#if defined (__MINGW32__)
453 456
454/* Define to 1 if the system has the type `long long int'. */ 457/* Define to 1 if the system has the type `long long int'. */
455# define HAVE_LONG_LONG_INT 1 458# ifndef HAVE_LONG_LONG_INT
459# define HAVE_LONG_LONG_INT 1
460# endif
456 461
457/* Define to 1 if the system has the type `unsigned long long int'. */ 462/* Define to 1 if the system has the type `unsigned long long int'. */
458# define HAVE_UNSIGNED_LONG_LONG_INT 1 463# ifndef HAVE_UNSIGNED_LONG_LONG_INT
464# define HAVE_UNSIGNED_LONG_LONG_INT 1
465# endif
459 466
460#endif 467#endif
461 468
diff --git a/nt/inc/sys/socket.h b/nt/inc/sys/socket.h
index 6029778394b..99227d75d28 100644
--- a/nt/inc/sys/socket.h
+++ b/nt/inc/sys/socket.h
@@ -43,8 +43,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
43#undef FD_ZERO 43#undef FD_ZERO
44#endif 44#endif
45 45
46/* avoid duplicate definition of timeval */ 46/* Avoid duplicate definition of timeval. MinGW uses _TIMEVAL_DEFINED
47#ifdef HAVE_TIMEVAL 47 in sys/time.h to avoid that. */
48#if defined (HAVE_TIMEVAL) && defined (_MSC_VER)
48#define timeval ws_timeval 49#define timeval ws_timeval
49#endif 50#endif
50 51
@@ -62,7 +63,9 @@ typedef unsigned short uint16_t;
62#undef MUST_REDEF_SELECT 63#undef MUST_REDEF_SELECT
63#endif 64#endif
64 65
65/* revert to our version of FD_SET */ 66/* Revert to our version of FD_SET, but not when included from test
67 programs run by configure. */
68#ifdef EMACS_CONFIG_H
66#undef FD_SET 69#undef FD_SET
67#undef FD_CLR 70#undef FD_CLR
68#undef FD_ISSET 71#undef FD_ISSET
@@ -71,8 +74,9 @@ typedef unsigned short uint16_t;
71/* allow us to provide our own version of fd_set */ 74/* allow us to provide our own version of fd_set */
72#define fd_set ws_fd_set 75#define fd_set ws_fd_set
73#include "w32.h" 76#include "w32.h"
77#endif /* EMACS_CONFIG_H */
74 78
75#ifdef HAVE_TIMEVAL 79#if defined (HAVE_TIMEVAL) && defined (_MSC_VER)
76#undef timeval 80#undef timeval
77#endif 81#endif
78 82
diff --git a/nt/inc/sys/stat.h b/nt/inc/sys/stat.h
index f6785c56477..f1d8341141e 100644
--- a/nt/inc/sys/stat.h
+++ b/nt/inc/sys/stat.h
@@ -83,6 +83,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
83#define S_TYPEISSHM(p) 0 83#define S_TYPEISSHM(p) 0
84#define S_TYPEISTMO(p) 0 84#define S_TYPEISTMO(p) 0
85 85
86#define UTIME_NOW (-1)
87#define UTIME_OMIT (-2)
88
86struct stat { 89struct stat {
87 unsigned __int64 st_ino; /* ino_t in sys/types.h is too narrow */ 90 unsigned __int64 st_ino; /* ino_t in sys/types.h is too narrow */
88 dev_t st_dev; 91 dev_t st_dev;
@@ -99,6 +102,39 @@ struct stat {
99 char st_gname[260]; 102 char st_gname[260];
100}; 103};
101 104
105/* These are here to avoid compiler warnings when using wchar.h. */
106struct _stat
107{
108 _dev_t st_dev; /* Equivalent to drive number 0=A 1=B ... */
109 _ino_t st_ino; /* Always zero ? */
110 _mode_t st_mode; /* See above constants */
111 short st_nlink; /* Number of links. */
112 short st_uid; /* User: Maybe significant on NT ? */
113 short st_gid; /* Group: Ditto */
114 _dev_t st_rdev; /* Seems useless (not even filled in) */
115 _off_t st_size; /* File size in bytes */
116 time_t st_atime; /* Accessed date (always 00:00 hrs local
117 * on FAT) */
118 time_t st_mtime; /* Modified time */
119 time_t st_ctime; /* Creation time */
120};
121
122#if defined (__MSVCRT__)
123struct _stati64 {
124 _dev_t st_dev;
125 _ino_t st_ino;
126 _mode_t st_mode;
127 short st_nlink;
128 short st_uid;
129 short st_gid;
130 _dev_t st_rdev;
131 __int64 st_size;
132 time_t st_atime;
133 time_t st_mtime;
134 time_t st_ctime;
135};
136#endif
137
102/* Internal variable for asking 'stat'/'lstat' to produce accurate 138/* Internal variable for asking 'stat'/'lstat' to produce accurate
103 info about owner and group of files. */ 139 info about owner and group of files. */
104extern int w32_stat_get_owner_group; 140extern int w32_stat_get_owner_group;
diff --git a/nt/inc/sys/time.h b/nt/inc/sys/time.h
index 80c725385bb..87ad9d3ff0d 100644
--- a/nt/inc/sys/time.h
+++ b/nt/inc/sys/time.h
@@ -9,12 +9,23 @@
9/* The guards are for MinGW64, which defines these structs on its 9/* The guards are for MinGW64, which defines these structs on its
10 system headers which are included by ms-w32.h. */ 10 system headers which are included by ms-w32.h. */
11#ifndef _W64 11#ifndef _W64
12/* Allow inclusion of sys/time.h and winsock2.h in any order. Needed
13 for running the configure test, which is only relevant to MinGW. */
14#ifndef _TIMEVAL_DEFINED
15#define _TIMEVAL_DEFINED
12struct timeval 16struct timeval
13{ 17{
14 long tv_sec; /* seconds */ 18 long tv_sec; /* seconds */
15 long tv_usec; /* microseconds */ 19 long tv_usec; /* microseconds */
16}; 20};
17#endif 21#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
22#define timercmp(tvp, uvp, cmp) \
23 (((tvp)->tv_sec != (uvp)->tv_sec) ? \
24 ((tvp)->tv_sec cmp (uvp)->tv_sec) : \
25 ((tvp)->tv_usec cmp (uvp)->tv_usec))
26#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
27#endif /* _TIMEVAL_DEFINED */
28#endif /* _W64 */
18 29
19#ifndef _TIMEZONE_DEFINED 30#ifndef _TIMEZONE_DEFINED
20struct timezone 31struct timezone
@@ -24,7 +35,10 @@ struct timezone
24}; 35};
25#endif 36#endif
26 37
27void gettimeofday (struct timeval *, struct timezone *); 38/* This needs to be compatible with Posix signature, in order to pass
39 the configure test for the type of the second argument. See
40 m4/gettimeofday.m4. */
41int gettimeofday (struct timeval *restrict, struct timezone *restrict);
28 42
29#define ITIMER_REAL 0 43#define ITIMER_REAL 0
30#define ITIMER_PROF 1 44#define ITIMER_PROF 1
diff --git a/nt/inc/unistd.h b/nt/inc/unistd.h
index e07c46533f7..8ad8cf213b1 100644
--- a/nt/inc/unistd.h
+++ b/nt/inc/unistd.h
@@ -3,6 +3,9 @@
3#ifndef _UNISTD_H 3#ifndef _UNISTD_H
4#define _UNISTD_H 4#define _UNISTD_H
5 5
6#include <sys/types.h>
7#include <pwd.h>
8
6/* On Microsoft platforms, <stdlib.h> declares 'environ'; on POSIX 9/* On Microsoft platforms, <stdlib.h> declares 'environ'; on POSIX
7 platforms, <unistd.h> does. Every file in Emacs that includes 10 platforms, <unistd.h> does. Every file in Emacs that includes
8 <unistd.h> also includes <stdlib.h>, so there's no need to declare 11 <unistd.h> also includes <stdlib.h>, so there's no need to declare
diff --git a/nt/makefile.w32-in b/nt/makefile.w32-in
index 4aa1ea91d44..79ca22bf44e 100644
--- a/nt/makefile.w32-in
+++ b/nt/makefile.w32-in
@@ -29,6 +29,8 @@ TMP_DIST_DIR = emacs-$(VERSION)
29TRES = $(BLD)/emacs.res 29TRES = $(BLD)/emacs.res
30CLIENTRES = $(BLD)/emacsclient.res 30CLIENTRES = $(BLD)/emacsclient.res
31 31
32LOCAL_FLAGS = -DOLD_PATHS=1
33
32XMFLAGS = 34XMFLAGS =
33 35
34ALL = $(BLD)/addpm.exe $(BLD)/ddeclient.exe $(BLD)/runemacs.exe \ 36ALL = $(BLD)/addpm.exe $(BLD)/ddeclient.exe $(BLD)/runemacs.exe \
diff --git a/nt/mingw-cfg.site b/nt/mingw-cfg.site
new file mode 100644
index 00000000000..96cda2d624a
--- /dev/null
+++ b/nt/mingw-cfg.site
@@ -0,0 +1,106 @@
1#! /bin/sh
2# Site defaults for the MinGW configuration of GNU Emacs.
3#
4# This file's purpose is to short-circuit configure-time tests for
5# which we want to provide the results instead of letting the
6# 'configure' script do that. This is mainly for features that
7# 'configure' tests that are implemented as part of Emacs sources, not
8# as part of system libraries. The idea is to set shell variables
9# that appear to the script as cached values.
10#
11# For each header file foo.h you want to supply test results, set the
12# value of a shell variable ac_cv_header_foo_h. The value should be
13# yes if the header is deemed to exist, no otherwise. Or it could be
14# something else, if the value computed by 'configure' requires that.
15# In general, since nt/msysconfig.sh instructs GCC to use header files
16# in nt/inc, you should not need to futz with header file tests. But
17# there are exceptions, like with getopt.h below (which is a MinGW
18# system header, but we do not want to use it).
19#
20# For each library function foo you want to supply test results, set
21# the value of a shell variable ac_cv_func_foo. Again, the value is
22# determined by what 'configure' expects; sometimes it could be "not
23# needed" or whatever, see the examples below. In addition, you may
24# need to set the various gl_cv_* variables for those tests that come
25# from gnulib.
26#
27# In short, examine the test in 'configure' and push the knobs that
28# are necessary to steer the test in the direction you need, by
29# judicioulsy setting variables that control the test results.
30
31# We want to use getopt.h from gnulib
32ac_cv_header_getopt_h=no
33
34# ACL functions are implemented in w32.c
35ac_cv_search_acl_get_file="none required"
36ac_cv_func_acl_get_file=yes
37ac_cv_func_acl_set_file=yes
38ac_cv_func_acl_free=yes
39ac_cv_func_acl_from_text=yes
40gl_cv_func_working_acl_get_file=yes
41# Autoconf's test program is not smart enough, and fails to detect gethostname
42ac_cv_func_gethostname=yes
43# Implemented as sys_select in w32proc.c
44ac_cv_func_select=yes
45ac_cv_func_pselect=yes
46gl_cv_sig_pselect=yes
47gl_cv_func_pselect_detects_ebadf=yes
48# Implemented as sys_shutdown in w32.c
49ac_cv_func_shutdown=yes
50# Implemented in w32proc.c
51ac_cv_func_setitimer=yes
52# Implemented as sys_sendto in w32.c
53ac_cv_func_sendto=yes
54# Implemented as sys_recvfrom in w32.c
55ac_cv_func_recvfrom=yes
56# Implemented as sys_getsockname in w32.c
57ac_cv_func_getsockname=yes
58# Implemented as sys_getpeername in w32.c
59ac_cv_func_getpeername=yes
60# Implemented as sys_socket in w32.c
61ac_cv_func_socket=yes
62# Implemented in w32.c
63ac_cv_func_readlink=yes
64ac_cv_func_symlink=yes
65# Avoid run-time tests of readlink and symlink, which will fail
66gl_cv_func_readlink_works=yes
67gl_cv_func_symlink_works=yes
68ac_cv_func_readlinkat=yes
69ac_cv_func_faccessat=yes
70# We don't need fdopendir
71ac_cv_func_fdopendir="not-needed"
72gl_cv_func_fdopendir_works="no-but-not-needed-so-yes"
73# Implemented in w32.c
74ac_cv_func_lstat=yes
75gl_cv_func_lstat_dereferences_slashed_symlink=yes
76ac_cv_func_fstatat=yes
77gl_cv_func_fstatat_zero_flag=yes
78# Aliased to _commit in ms-w32.h
79ac_cv_func_fsync=yes
80ac_cv_func_fdatasync=yes
81# Implemented in w32proc.c
82ac_cv_func_pthread_sigmask=yes
83# Avoid gnulib replacement
84gl_threads_api=posix
85gl_cv_func_pthread_sigmask_return_works=yes
86gl_cv_func_pthread_sigmask_unblock_works="not relevant"
87# Implemented in w32proc.c
88emacs_cv_langinfo_codeset=yes
89# Declared in ms-w32.h
90ac_cv_have_decl_alarm=yes
91# Avoid including the gnulib dup2 module
92gl_cv_func_dup2_works=yes
93# Defined in w32.c
94ac_cv_func_getloadavg=yes
95# Avoid compiling gnulib mktime
96gl_cv_func_working_mktime=yes
97# Implemented in w32.c
98ac_cv_have_decl_unsetenv=yes
99ac_cv_func_unsetenv=yes
100gt_cv_func_unsetenv_ret='int'
101gl_cv_func_unsetenv_works=yes
102gl_cv_func_stat_dir_slash=yes
103gl_cv_func_stat_file_slash=yes
104ac_cv_func_random=yes
105# Implemented in w32.c as sys_putenv
106gl_cv_func_svid_putenv=yes
diff --git a/nt/msysconfig.sh b/nt/msysconfig.sh
new file mode 100644
index 00000000000..95e56f64c42
--- /dev/null
+++ b/nt/msysconfig.sh
@@ -0,0 +1,39 @@
1#! /bin/sh
2### msysconfig.sh - Run the top-level 'configure' script as approriate
3### for the MinGW/MSYS build of a native MS-Windows port of Emacs.
4
5## Copyright (C) 2013 Free Software Foundation, Inc.
6
7## Author: Eli Zaretskii <eliz@gnu.org>
8
9## This file is part of GNU Emacs.
10
11## GNU Emacs is free software: you can redistribute it and/or modify
12## it under the terms of the GNU General Public License as published by
13## the Free Software Foundation, either version 3 of the License, or
14## (at your option) any later version.
15
16## GNU Emacs is distributed in the hope that it will be useful,
17## but WITHOUT ANY WARRANTY; without even the implied warranty of
18## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19## GNU General Public License for more details.
20
21## You should have received a copy of the GNU General Public License
22## along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
23
24### Commentary:
25
26## The Posix 'configure' script needs a few tweaks to produce desired
27## results when running under MSYS with the purpose of configuring
28## Emacs for the MinGW MS-Windows build. Rather than asking users to
29## type these tweaks every time they configure the package, we provide
30## this helper script which takes care of the mundane things.
31
32### Code:
33
34srcdir=`dirname "$0"`
35parent=`dirname "$srcdir"`
36
37## The nt/mingw-cfg.site file provides various autoconf variables that
38## are needed for a successful MinGW build.
39CONFIG_SITE="$srcdir/mingw-cfg.site" $parent/configure "$@"