aboutsummaryrefslogtreecommitdiffstats
path: root/nt
diff options
context:
space:
mode:
Diffstat (limited to 'nt')
-rw-r--r--nt/ChangeLog41
-rw-r--r--nt/INSTALL42
-rw-r--r--nt/addsection.c31
-rwxr-xr-xnt/configure.bat101
-rw-r--r--nt/gmake.defs2
-rw-r--r--nt/inc/pwd.h4
-rw-r--r--nt/inc/sys/socket.h2
7 files changed, 183 insertions, 40 deletions
diff --git a/nt/ChangeLog b/nt/ChangeLog
index 33507ef581d..66e1ea15438 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,44 @@
12005-06-11 Eli Zaretskii <eliz@gnu.org>
2
3 * configure.bat: If their fc.exe returns a meaningful exit status,
4 don't overwrite src/config.h and src/epaths.h with identical
5 copies.
6
7 * INSTALL: Warn about using "cvs up -kb" if one intends to commit
8 changes. Add a pointer to another site with detailed configure
9 and build instructions. Suggest to look at config.log when
10 configure fails. Add MinGW Make 3.80 to the list of successful
11 combinations.
12
13 * gmake.defs (ARCH_CFLAGS): Use $(MCPU_FLAG) instead of a literal
14 "-mcpu=i686".
15
16 * configure.bat: Update copyright years.
17 Delete config.log before doing anything else.
18 Write additional diagnostics to config.log in case of failures to
19 compile test programs, including the failed test program itself.
20 Add a test for support of -mtune=pentium4 switch to GCC; if it is
21 supported, set up MCPU_FLAG variable on the various Makefiles to
22 use that switch during compilations. (This avoids GCC warning
23 about -mcpu being deprecated.)
24
252005-06-10 Eli Zaretskii <eliz@gnu.org>
26
27 * addsection.c (copy_executable_and_add_section): Pass non-zero
28 `verbose' arg to COPY_CHUNK only if DEBUG_DUMP is defined in the
29 environment. Print section names with %.8s.
30 (COPY_CHUNK): New 4th arg `verbose'; print diagnostic messages
31 only if non-zero. All callers changed.
32
332005-06-05 Eli Zaretskii <eliz@gnu.org>
34
35 * inc/sys/socket.h: Change arg 4 of sys_setsockopt to
36 `const void *', for consistency with Posix.
37
382005-06-04 Eli Zaretskii <eliz@gnu.org>
39
40 * inc/pwd.h (getpwnam, getpwuid): Add prototypes.
41
12005-05-24 Juanma Barranquero <lekktu@gmail.com> 422005-05-24 Juanma Barranquero <lekktu@gmail.com>
2 43
3 * INSTALL: Add more pointers to ports of Unix tools to Windows, 44 * INSTALL: Add more pointers to ports of Unix tools to Windows,
diff --git a/nt/INSTALL b/nt/INSTALL
index e133d65e0d3..214caf7dd80 100644
--- a/nt/INSTALL
+++ b/nt/INSTALL
@@ -15,10 +15,20 @@
15 (.bat files, nmake.defs and makefile.w32-in) may need the line-ends 15 (.bat files, nmake.defs and makefile.w32-in) may need the line-ends
16 fixing first. The easiest way to do this and avoid future conflicts 16 fixing first. The easiest way to do this and avoid future conflicts
17 is to run the following command in this (emacs/nt) directory: 17 is to run the following command in this (emacs/nt) directory:
18
18 cvs update -kb 19 cvs update -kb
20
21 (WARNING: Do NOT use this suggestion if you have write access to the
22 Emacs CVS tree and intend to commit changes to CVS. This is because -kb
23 is sticky: it will be used in all future CVS operations on the files you
24 check out like this.) Alternatively, use programs that convert
25 end-of-line format, such as dos2unix and unix2dos available from
26 GnuWin32 or dtou and utod from the DJGPP project.
27
19 In addition to this file, you should also read INSTALL.CVS in the 28 In addition to this file, you should also read INSTALL.CVS in the
20 parent directory, and make sure that you have a version of "touch.exe" 29 parent directory, and make sure that you have a version of
21 in your path, and that it will create files that do not yet exist. 30 "touch.exe" in your path, and that it will create files that do not
31 yet exist.
22 32
23 To compile Emacs, you will need either Microsoft Visual C++ 2.0 or 33 To compile Emacs, you will need either Microsoft Visual C++ 2.0 or
24 later and nmake, or a Windows port of GCC 2.95 or later with MinGW 34 later and nmake, or a Windows port of GCC 2.95 or later with MinGW
@@ -51,6 +61,10 @@
51 61
52 http://www.emacswiki.org/cgi-bin/wiki/WThirtyTwoInstallationKit 62 http://www.emacswiki.org/cgi-bin/wiki/WThirtyTwoInstallationKit
53 63
64 and at this URL:
65
66 http://ourcomments.org/Emacs/EmacsW32.html
67
54 For reference, here is a list of which builds of GNU make are known 68 For reference, here is a list of which builds of GNU make are known
55 to work or not, and whether they work in the presence and/or absence 69 to work or not, and whether they work in the presence and/or absence
56 of sh.exe, the Cygwin port of Bash. Note that any version of make 70 of sh.exe, the Cygwin port of Bash. Note that any version of make
@@ -77,6 +91,7 @@
77 cygwin compiled make 3.78.1: fails[5] fails[2, 5] 91 cygwin compiled make 3.78.1: fails[5] fails[2, 5]
78 cygwin compiled make 3.79.1: fails[3, 5] fails[2?, 5] 92 cygwin compiled make 3.79.1: fails[3, 5] fails[2?, 5]
79 mingw32 compiled make 3.79.1: okay okay 93 mingw32 compiled make 3.79.1: okay okay
94 mingw32 compiled make 3.80: okay unknown[6]
80 95
81 Notes: 96 Notes:
82 97
@@ -88,6 +103,7 @@
88 [4] may fail on Windows 9X and Windows ME; if so, install Bash. 103 [4] may fail on Windows 9X and Windows ME; if so, install Bash.
89 [5] fails when building leim due to the use of cygwin style paths. 104 [5] fails when building leim due to the use of cygwin style paths.
90 May work if building emacs without leim. 105 May work if building emacs without leim.
106 [6] please report if you try this combination.
91 107
92* Configuring 108* Configuring
93 109
@@ -105,6 +121,12 @@
105 is running, when gcc support is being tested. These cannot be 121 is running, when gcc support is being tested. These cannot be
106 surpressed because of limitations in the Windows 9x command.com shell. 122 surpressed because of limitations in the Windows 9x command.com shell.
107 123
124 You are encouraged to look at the file config.log which shows details
125 for failed tests, after configure.bat finishes. Any unexplained failure
126 should be investigated and perhaps reported as a bug (see the section
127 about reporting bugs in the file README in this directory and in the
128 Emacs manual).
129
108* Optional image library support 130* Optional image library support
109 131
110 In addition to its "native" image formats (pbm and xbm), Emacs can 132 In addition to its "native" image formats (pbm and xbm), Emacs can
@@ -114,7 +136,11 @@
114 configure script is run. This can be setup using environment 136 configure script is run. This can be setup using environment
115 variables, or by specifying --cflags -I... options on the command-line 137 variables, or by specifying --cflags -I... options on the command-line
116 to configure.bat. The configure script will report whether it was 138 to configure.bat. The configure script will report whether it was
117 able to detect the headers. 139 able to detect the headers. If the results of this testing appear to be
140 incorrect, please look for details in the file config.log: it will show
141 the failed test programs and compiler error messages that should explain
142 what is wrong. (Usually, any such failures happen because some headers
143 are missing due to bad packaging of the image support libraries.)
118 144
119 To use the external image support, the DLLs implementing the 145 To use the external image support, the DLLs implementing the
120 functionality must be found when Emacs first needs them, either on the 146 functionality must be found when Emacs first needs them, either on the
@@ -133,7 +159,9 @@
133 159
134 Binaries for the image libraries (among many others) can be found at 160 Binaries for the image libraries (among many others) can be found at
135 the GnuWin32 project. These are built with MinGW, but they can be 161 the GnuWin32 project. These are built with MinGW, but they can be
136 used with both GCC/MinGW and MSVC builds of Emacs. 162 used with both GCC/MinGW and MSVC builds of Emacs. See the info on
163 http://ourcomments.org/Emacs/EmacsW32.html for more details about
164 installing image support libraries.
137 165
138* Building 166* Building
139 167
@@ -187,6 +215,12 @@
187 addsection.c relies on. Versions of w32api-xxx.zip from at least 215 addsection.c relies on. Versions of w32api-xxx.zip from at least
188 1999-11-18 onwards are okay. 216 1999-11-18 onwards are okay.
189 217
218 When in doubt about correctness of what configure did, look at the file
219 config.log, which shows all the failed test programs and compiler
220 messages associated with the failures. If that doesn't give a clue,
221 please report the problems, together with the relevant fragments from
222 config.log, as bugs.
223
190 If configure succeeds, but make fails, install the Cygwin port of 224 If configure succeeds, but make fails, install the Cygwin port of
191 Bash, even if the table above indicates that Emacs should be able to 225 Bash, even if the table above indicates that Emacs should be able to
192 build without sh.exe. (Some versions of Windows shells are too dumb 226 build without sh.exe. (Some versions of Windows shells are too dumb
diff --git a/nt/addsection.c b/nt/addsection.c
index ae44c7f943c..8fbe8c38050 100644
--- a/nt/addsection.c
+++ b/nt/addsection.c
@@ -1,5 +1,5 @@
1/* Add an uninitialized data section to an executable. 1/* Add an uninitialized data section to an executable.
2 Copyright (C) 1999 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
@@ -283,15 +283,19 @@ copy_executable_and_add_section (file_data *p_infile,
283 PIMAGE_SECTION_HEADER dst_section; 283 PIMAGE_SECTION_HEADER dst_section;
284 DWORD offset; 284 DWORD offset;
285 int i; 285 int i;
286 int be_verbose = GetEnvironmentVariable ("DEBUG_DUMP", NULL, 0) > 0;
286 287
287#define COPY_CHUNK(message, src, size) \ 288#define COPY_CHUNK(message, src, size, verbose) \
288 do { \ 289 do { \
289 unsigned char *s = (void *)(src); \ 290 unsigned char *s = (void *)(src); \
290 unsigned long count = (size); \ 291 unsigned long count = (size); \
291 printf ("%s\n", (message)); \ 292 if (verbose) \
292 printf ("\t0x%08x Offset in input file.\n", s - p_infile->file_base); \ 293 { \
293 printf ("\t0x%08x Offset in output file.\n", dst - p_outfile->file_base); \ 294 printf ("%s\n", (message)); \
294 printf ("\t0x%08x Size in bytes.\n", count); \ 295 printf ("\t0x%08x Offset in input file.\n", s - p_infile->file_base); \
296 printf ("\t0x%08x Offset in output file.\n", dst - p_outfile->file_base); \
297 printf ("\t0x%08x Size in bytes.\n", count); \
298 } \
295 memcpy (dst, s, count); \ 299 memcpy (dst, s, count); \
296 dst += count; \ 300 dst += count; \
297 } while (0) 301 } while (0)
@@ -321,13 +325,14 @@ copy_executable_and_add_section (file_data *p_infile,
321 dst = (unsigned char *) p_outfile->file_base; 325 dst = (unsigned char *) p_outfile->file_base;
322 326
323 COPY_CHUNK ("Copying DOS header...", dos_header, 327 COPY_CHUNK ("Copying DOS header...", dos_header,
324 (DWORD) nt_header - (DWORD) dos_header); 328 (DWORD) nt_header - (DWORD) dos_header, be_verbose);
325 dst_nt_header = (PIMAGE_NT_HEADERS) dst; 329 dst_nt_header = (PIMAGE_NT_HEADERS) dst;
326 COPY_CHUNK ("Copying NT header...", nt_header, 330 COPY_CHUNK ("Copying NT header...", nt_header,
327 (DWORD) section - (DWORD) nt_header); 331 (DWORD) section - (DWORD) nt_header, be_verbose);
328 dst_section = (PIMAGE_SECTION_HEADER) dst; 332 dst_section = (PIMAGE_SECTION_HEADER) dst;
329 COPY_CHUNK ("Copying section table...", section, 333 COPY_CHUNK ("Copying section table...", section,
330 nt_header->FileHeader.NumberOfSections * sizeof (*section)); 334 nt_header->FileHeader.NumberOfSections * sizeof (*section),
335 be_verbose);
331 336
332 /* To improve the efficiency of demand loading, make the file 337 /* To improve the efficiency of demand loading, make the file
333 alignment match the section alignment (VC++ 6.0 does this by 338 alignment match the section alignment (VC++ 6.0 does this by
@@ -351,7 +356,9 @@ copy_executable_and_add_section (file_data *p_infile,
351 for (i = 0; i < nt_header->FileHeader.NumberOfSections; i++) 356 for (i = 0; i < nt_header->FileHeader.NumberOfSections; i++)
352 { 357 {
353 char msg[100]; 358 char msg[100];
354 sprintf (msg, "Copying raw data for %s...", section->Name); 359 /* Windows section names are fixed 8-char strings, only
360 zero-terminated if the name is shorter than 8 characters. */
361 sprintf (msg, "Copying raw data for %.8s...", section->Name);
355 362
356 /* Update the file-relative offset for this section's raw data (if 363 /* Update the file-relative offset for this section's raw data (if
357 it has any) in case things have been relocated; we will update 364 it has any) in case things have been relocated; we will update
@@ -362,7 +369,7 @@ copy_executable_and_add_section (file_data *p_infile,
362 /* Can always copy the original raw data. */ 369 /* Can always copy the original raw data. */
363 COPY_CHUNK 370 COPY_CHUNK
364 (msg, OFFSET_TO_PTR (section->PointerToRawData, p_infile), 371 (msg, OFFSET_TO_PTR (section->PointerToRawData, p_infile),
365 section->SizeOfRawData); 372 section->SizeOfRawData, be_verbose);
366 373
367 /* Round up the raw data size to the new alignment. */ 374 /* Round up the raw data size to the new alignment. */
368 dst_section->SizeOfRawData = 375 dst_section->SizeOfRawData =
@@ -402,7 +409,7 @@ copy_executable_and_add_section (file_data *p_infile,
402 COPY_CHUNK 409 COPY_CHUNK
403 ("Copying remainder of executable...", 410 ("Copying remainder of executable...",
404 OFFSET_TO_PTR (offset, p_infile), 411 OFFSET_TO_PTR (offset, p_infile),
405 p_infile->size - offset); 412 p_infile->size - offset, be_verbose);
406 413
407 /* Final size for new image. */ 414 /* Final size for new image. */
408 p_outfile->size = DST_TO_OFFSET (); 415 p_outfile->size = DST_TO_OFFSET ();
diff --git a/nt/configure.bat b/nt/configure.bat
index 216420873c7..8433cacc317 100755
--- a/nt/configure.bat
+++ b/nt/configure.bat
@@ -1,7 +1,8 @@
1@echo off 1@echo off
2rem ---------------------------------------------------------------------- 2rem ----------------------------------------------------------------------
3rem Configuration script for MS Windows 95/98/Me and NT/2000/XP 3rem Configuration script for MS Windows 95/98/Me and NT/2000/XP
4rem Copyright (C) 1999-2003 Free Software Foundation, Inc. 4rem Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
5rem Free Software Foundation, Inc.
5 6
6rem This file is part of GNU Emacs. 7rem This file is part of GNU Emacs.
7 8
@@ -47,6 +48,8 @@ rem [3] requires LC_MESSAGES support to build; maybe 2.95.x update to
47rem cygwin provides this? 48rem cygwin provides this?
48rem 49rem
49 50
51if exist config.log del config.log
52
50rem ---------------------------------------------------------------------- 53rem ----------------------------------------------------------------------
51rem See if the environment is large enough. We need 43 (?) bytes. 54rem See if the environment is large enough. We need 43 (?) bytes.
52set $foo$=123456789_123456789_123456789_123456789_123 55set $foo$=123456789_123456789_123456789_123456789_123
@@ -236,13 +239,17 @@ if (%nocygwin%) == (Y) goto chkapi
236echo Checking whether gcc requires '-mno-cygwin'... 239echo Checking whether gcc requires '-mno-cygwin'...
237echo #include "cygwin/version.h" >junk.c 240echo #include "cygwin/version.h" >junk.c
238echo main(){} >>junk.c 241echo main(){} >>junk.c
239gcc -c junk.c 242echo gcc -c junk.c >>config.log
243gcc -c junk.c >>config.log 2>&1
240if not exist junk.o goto chkapi 244if not exist junk.o goto chkapi
241gcc -mno-cygwin -c junk.c 245echo gcc -mno-cygwin -c junk.c >>config.log
246gcc -mno-cygwin -c junk.c >>config.log 2>&1
242if exist junk.o set nocygwin=Y 247if exist junk.o set nocygwin=Y
243rm -f junk.c junk.o 248rm -f junk.c junk.o
244 249
245:chkapi 250:chkapi
251echo The failed program was: >>config.log
252type junk.c >>config.log
246rem ---------------------------------------------------------------------- 253rem ----------------------------------------------------------------------
247rem Older versions of the Windows API headers either don't have any of 254rem Older versions of the Windows API headers either don't have any of
248rem the IMAGE_xxx definitions (the headers that come with Cygwin b20.1 255rem the IMAGE_xxx definitions (the headers that come with Cygwin b20.1
@@ -263,9 +270,13 @@ set cf=%usercflags% -mno-cygwin
263:chkapi2 270:chkapi2
264echo on 271echo on
265gcc %cf% -c junk.c 272gcc %cf% -c junk.c
266echo off 273@echo off
274@echo gcc %cf% -c junk.c >>config.log
275gcc %cf% -c junk.c >>config.log 2>&1
267set cf= 276set cf=
268if exist junk.o goto gccOk 277if exist junk.o goto gccOk
278echo The failed program was: >>config.log
279type junk.c >>config.log
269 280
270:nocompiler 281:nocompiler
271echo. 282echo.
@@ -278,8 +289,23 @@ goto end
278 289
279:gccOk 290:gccOk
280set COMPILER=gcc 291set COMPILER=gcc
281rm -f junk.c junk.o
282echo Using 'gcc' 292echo Using 'gcc'
293rm -f junk.c junk.o
294Rem It is not clear what GCC version began supporting -mtune
295Rem and pentium4 on x86, so check this explicitly.
296echo main(){} >junk.c
297echo gcc -c -O2 -mtune=pentium4 junk.c >>config.log
298gcc -c -O2 -mtune=pentium4 junk.c >>config.log 2>&1
299if not errorlevel 1 goto gccMtuneOk
300echo The failed program was: >>config.log
301type junk.c >>config.log
302set mf=-mcpu=i686
303rm -f junk.c junk.o
304goto compilercheckdone
305:gccMtuneOk
306echo GCC supports -mtune=pentium4 >>config.log
307set mf=-mtune=pentium4
308rm -f junk.c junk.o
283goto compilercheckdone 309goto compilercheckdone
284 310
285:clOk 311:clOk
@@ -307,10 +333,13 @@ echo Checking for libpng...
307echo #include "png.h" >junk.c 333echo #include "png.h" >junk.c
308echo main (){} >>junk.c 334echo main (){} >>junk.c
309rem -o option is ignored with cl, but allows result to be consistent. 335rem -o option is ignored with cl, but allows result to be consistent.
310%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>junk.err 336echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log
337%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log
311if exist junk.obj goto havePng 338if exist junk.obj goto havePng
312 339
313echo ...png.h not found, building without PNG support. 340echo ...png.h not found, building without PNG support.
341echo The failed program was: >>config.log
342type junk.c >>config.log
314set HAVE_PNG= 343set HAVE_PNG=
315goto :pngDone 344goto :pngDone
316 345
@@ -327,10 +356,13 @@ echo Checking for jpeg-6b...
327echo #include "jconfig.h" >junk.c 356echo #include "jconfig.h" >junk.c
328echo main (){} >>junk.c 357echo main (){} >>junk.c
329rem -o option is ignored with cl, but allows result to be consistent. 358rem -o option is ignored with cl, but allows result to be consistent.
330%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>junk.err 359echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log
360%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log
331if exist junk.obj goto haveJpeg 361if exist junk.obj goto haveJpeg
332 362
333echo ...jconfig.h not found, building without JPEG support. 363echo ...jconfig.h not found, building without JPEG support.
364echo The failed program was: >>config.log
365type junk.c >>config.log
334set HAVE_JPEG= 366set HAVE_JPEG=
335goto :jpegDone 367goto :jpegDone
336 368
@@ -347,10 +379,13 @@ echo Checking for libgif...
347echo #include "gif_lib.h" >junk.c 379echo #include "gif_lib.h" >junk.c
348echo main (){} >>junk.c 380echo main (){} >>junk.c
349rem -o option is ignored with cl, but allows result to be consistent. 381rem -o option is ignored with cl, but allows result to be consistent.
350%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>junk.err 382echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log
383%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log
351if exist junk.obj goto haveGif 384if exist junk.obj goto haveGif
352 385
353echo ...gif_lib.h not found, building without GIF support. 386echo ...gif_lib.h not found, building without GIF support.
387echo The failed program was: >>config.log
388type junk.c >>config.log
354set HAVE_GIF= 389set HAVE_GIF=
355goto :gifDone 390goto :gifDone
356 391
@@ -367,10 +402,13 @@ echo Checking for tiff...
367echo #include "tiffio.h" >junk.c 402echo #include "tiffio.h" >junk.c
368echo main (){} >>junk.c 403echo main (){} >>junk.c
369rem -o option is ignored with cl, but allows result to be consistent. 404rem -o option is ignored with cl, but allows result to be consistent.
370%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>junk.err 405echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log
406%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log
371if exist junk.obj goto haveTiff 407if exist junk.obj goto haveTiff
372 408
373echo ...tiffio.h not found, building without TIFF support. 409echo ...tiffio.h not found, building without TIFF support.
410echo The failed program was: >>config.log
411type junk.c >>config.log
374set HAVE_TIFF= 412set HAVE_TIFF=
375goto :tiffDone 413goto :tiffDone
376 414
@@ -388,10 +426,13 @@ echo #define FOR_MSW 1 >junk.c
388echo #include "X11/xpm.h" >>junk.c 426echo #include "X11/xpm.h" >>junk.c
389echo main (){} >>junk.c 427echo main (){} >>junk.c
390rem -o option is ignored with cl, but allows result to be consistent. 428rem -o option is ignored with cl, but allows result to be consistent.
391%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>junk.err 429echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log
430%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log
392if exist junk.obj goto haveXpm 431if exist junk.obj goto haveXpm
393 432
394echo ...X11/xpm.h not found, building without XPM support. 433echo ...X11/xpm.h not found, building without XPM support.
434echo The failed program was: >>config.log
435type junk.c >>config.log
395set HAVE_XPM= 436set HAVE_XPM=
396goto :xpmDone 437goto :xpmDone
397 438
@@ -414,6 +455,7 @@ rem except when there is a preceding digit, when a space is required.
414rem 455rem
415echo # Start of settings from configure.bat >config.settings 456echo # Start of settings from configure.bat >config.settings
416echo COMPILER=%COMPILER%>>config.settings 457echo COMPILER=%COMPILER%>>config.settings
458if not "(%mf%)" == "()" echo MCPU_FLAG=%mf%>>config.settings
417if (%nodebug%) == (Y) echo NODEBUG=1 >>config.settings 459if (%nodebug%) == (Y) echo NODEBUG=1 >>config.settings
418if (%noopt%) == (Y) echo NOOPT=1 >>config.settings 460if (%noopt%) == (Y) echo NOOPT=1 >>config.settings
419if (%nocygwin%) == (Y) echo NOCYGWIN=1 >>config.settings 461if (%nocygwin%) == (Y) echo NOCYGWIN=1 >>config.settings
@@ -423,20 +465,34 @@ if not "(%userldflags%)" == "()" echo USER_LDFLAGS=%userldflags%>>config.setting
423echo # End of settings from configure.bat>>config.settings 465echo # End of settings from configure.bat>>config.settings
424echo. >>config.settings 466echo. >>config.settings
425 467
426copy config.nt ..\src\config.h 468copy config.nt config.tmp
427echo. >>..\src\config.h 469echo. >>config.tmp
428echo /* Start of settings from configure.bat. */ >>..\src\config.h 470echo /* Start of settings from configure.bat. */ >>config.tmp
429if not "(%usercflags%)" == "()" echo #define USER_CFLAGS " %usercflags%">>..\src\config.h 471if not "(%usercflags%)" == "()" echo #define USER_CFLAGS " %usercflags%">>config.tmp
430if not "(%userldflags%)" == "()" echo #define USER_LDFLAGS " %userldflags%">>..\src\config.h 472if not "(%userldflags%)" == "()" echo #define USER_LDFLAGS " %userldflags%">>config.tmp
431if not "(%HAVE_PNG%)" == "()" echo #define HAVE_PNG 1 >>..\src\config.h 473if not "(%HAVE_PNG%)" == "()" echo #define HAVE_PNG 1 >>config.tmp
432if not "(%HAVE_JPEG%)" == "()" echo #define HAVE_JPEG 1 >>..\src\config.h 474if not "(%HAVE_JPEG%)" == "()" echo #define HAVE_JPEG 1 >>config.tmp
433if not "(%HAVE_GIF%)" == "()" echo #define HAVE_GIF 1 >>..\src\config.h 475if not "(%HAVE_GIF%)" == "()" echo #define HAVE_GIF 1 >>config.tmp
434if not "(%HAVE_TIFF%)" == "()" echo #define HAVE_TIFF 1 >>..\src\config.h 476if not "(%HAVE_TIFF%)" == "()" echo #define HAVE_TIFF 1 >>config.tmp
435if not "(%HAVE_XPM%)" == "()" echo #define HAVE_XPM 1 >>..\src\config.h 477if not "(%HAVE_XPM%)" == "()" echo #define HAVE_XPM 1 >>config.tmp
436echo /* End of settings from configure.bat. */ >>..\src\config.h 478echo /* End of settings from configure.bat. */ >>config.tmp
437 479
480Rem See if fc.exe returns a meaningful exit status. If it does, we
481Rem might as well avoid unnecessary overwriting of config.h and epaths.h,
482Rem since this forces recompilation of every source file.
483if exist foo.bar del foo.bar
484fc /b foo.bar foo.bar >nul 2>&1
485if not errorlevel 2 goto doCopy
486fc /b config.tmp ..\src\config.h >nul 2>&1
487if errorlevel 1 goto doCopy
488fc /b paths.h ..\src\epaths.h >nul 2>&1
489if errorlevel 0 goto dontCopy
490:doCopy
491copy config.tmp ..\src\config.h
438copy paths.h ..\src\epaths.h 492copy paths.h ..\src\epaths.h
439 493
494:dontCopy
495if exist config.tmp del config.tmp
440copy /b config.settings+%MAKECMD%.defs+..\nt\makefile.w32-in ..\nt\makefile 496copy /b config.settings+%MAKECMD%.defs+..\nt\makefile.w32-in ..\nt\makefile
441copy /b config.settings+%MAKECMD%.defs+..\lib-src\makefile.w32-in ..\lib-src\makefile 497copy /b config.settings+%MAKECMD%.defs+..\lib-src\makefile.w32-in ..\lib-src\makefile
442copy /b config.settings+%MAKECMD%.defs+..\src\makefile.w32-in ..\src\makefile 498copy /b config.settings+%MAKECMD%.defs+..\src\makefile.w32-in ..\src\makefile
@@ -474,6 +530,7 @@ set MAKECMD=
474set usercflags= 530set usercflags=
475set userldflags= 531set userldflags=
476set mingwflag= 532set mingwflag=
533set mf=
477 534
478goto skipArchTag 535goto skipArchTag
479 arch-tag: 300d20a4-1675-4e75-b615-7ce1a8c5376c 536 arch-tag: 300d20a4-1675-4e75-b615-7ce1a8c5376c
diff --git a/nt/gmake.defs b/nt/gmake.defs
index bd201cd3314..23d3dac3719 100644
--- a/nt/gmake.defs
+++ b/nt/gmake.defs
@@ -253,7 +253,7 @@ ifeq "$(ARCH)" "i386"
253ifdef NOOPT 253ifdef NOOPT
254ARCH_CFLAGS = -D_X86_=1 -c $(DEBUG_FLAG) $(NOCYGWIN) 254ARCH_CFLAGS = -D_X86_=1 -c $(DEBUG_FLAG) $(NOCYGWIN)
255else 255else
256ARCH_CFLAGS = -D_X86_=1 -c $(DEBUG_FLAG) $(NOCYGWIN) -mcpu=i686 -O2 \ 256ARCH_CFLAGS = -D_X86_=1 -c $(DEBUG_FLAG) $(NOCYGWIN) $(MCPU_FLAG) -O2 \
257 # -fbuiltin \ 257 # -fbuiltin \
258 # -finline-functions \ 258 # -finline-functions \
259 # -fomit-frame-pointer 259 # -fomit-frame-pointer
diff --git a/nt/inc/pwd.h b/nt/inc/pwd.h
index 11f5669b0f0..31c0df7ec30 100644
--- a/nt/inc/pwd.h
+++ b/nt/inc/pwd.h
@@ -18,6 +18,10 @@ struct passwd {
18typedef int uid_t; 18typedef int uid_t;
19typedef uid_t gid_t; 19typedef uid_t gid_t;
20 20
21struct passwd * getpwnam (char *);
22struct passwd * getpwuid (int);
23
24
21#endif /* _PWD_H_ */ 25#endif /* _PWD_H_ */
22 26
23/* arch-tag: 68308424-cb2b-49ed-bb52-b347fee416bf 27/* arch-tag: 68308424-cb2b-49ed-bb52-b347fee416bf
diff --git a/nt/inc/sys/socket.h b/nt/inc/sys/socket.h
index 422a27d1b52..d3936da2a4d 100644
--- a/nt/inc/sys/socket.h
+++ b/nt/inc/sys/socket.h
@@ -102,7 +102,7 @@ struct hostent * sys_gethostbyname (const char * name);
102struct servent * sys_getservbyname (const char * name, const char * proto); 102struct servent * sys_getservbyname (const char * name, const char * proto);
103int sys_getpeername (int s, struct sockaddr *addr, int * namelen); 103int sys_getpeername (int s, struct sockaddr *addr, int * namelen);
104int sys_shutdown (int socket, int how); 104int sys_shutdown (int socket, int how);
105int sys_setsockopt (int s, int level, int oname, const char * oval, int olen); 105int sys_setsockopt (int s, int level, int oname, const void * oval, int olen);
106int sys_listen (int s, int backlog); 106int sys_listen (int s, int backlog);
107int sys_getsockname (int s, struct sockaddr * name, int * namelen); 107int sys_getsockname (int s, struct sockaddr * name, int * namelen);
108int sys_accept (int s, struct sockaddr *addr, int *addrlen); 108int sys_accept (int s, struct sockaddr *addr, int *addrlen);