comparison nt/configure.bat @ 88155:d7ddb3e565de

sync with trunk
author Henrik Enberg <henrik.enberg@telia.com>
date Mon, 16 Jan 2006 00:03:54 +0000
parents dad6f3184ccd
children
comparison
equal deleted inserted replaced
88154:8ce476d3ba36 88155:d7ddb3e565de
1 @echo off 1 @echo off
2 rem ---------------------------------------------------------------------- 2 rem ----------------------------------------------------------------------
3 rem Configuration script for MS Windows 95/98/Me and NT/2000/XP 3 rem Configuration script for MS Windows 95/98/Me and NT/2000/XP
4 rem Copyright (C) 1999-2003 Free Software Foundation, Inc. 4 rem Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
5 rem Free Software Foundation, Inc.
5 6
6 rem This file is part of GNU Emacs. 7 rem This file is part of GNU Emacs.
7 8
8 rem GNU Emacs is free software; you can redistribute it and/or modify 9 rem GNU Emacs is free software; you can redistribute it and/or modify
9 rem it under the terms of the GNU General Public License as published by 10 rem it under the terms of the GNU General Public License as published by
15 rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 rem GNU General Public License for more details. 17 rem GNU General Public License for more details.
17 18
18 rem You should have received a copy of the GNU General Public License 19 rem You should have received a copy of the GNU General Public License
19 rem along with GNU Emacs; see the file COPYING. If not, write to the 20 rem along with GNU Emacs; see the file COPYING. If not, write to the
20 rem Free Software Foundation, Inc., 59 Temple Place - Suite 330, 21 rem Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 rem Boston, MA 02111-1307, USA. 22 rem Boston, MA 02110-1301, USA.
22 rem ---------------------------------------------------------------------- 23 rem ----------------------------------------------------------------------
23 rem YOU'LL NEED THE FOLLOWING UTILITIES TO MAKE EMACS: 24 rem YOU'LL NEED THE FOLLOWING UTILITIES TO MAKE EMACS:
24 rem 25 rem
25 rem + MS Windows 95/98/Me or NT/2000/XP 26 rem + MS Windows 95/98/Me or NT/2000/XP
26 rem + either MSVC 2.x or later, or gcc-2.95 or later (with gmake 3.75 27 rem + either MSVC 2.x or later, or gcc-2.95 or later (with gmake 3.75
44 rem emacs source with text!=binary. 45 rem emacs source with text!=binary.
45 rem [2] fails when needs to invoke shell commands; okay invoking gcc etc. 46 rem [2] fails when needs to invoke shell commands; okay invoking gcc etc.
46 rem [3] requires LC_MESSAGES support to build; maybe 2.95.x update to 47 rem [3] requires LC_MESSAGES support to build; maybe 2.95.x update to
47 rem cygwin provides this? 48 rem cygwin provides this?
48 rem 49 rem
50
51 if exist config.log del config.log
49 52
50 rem ---------------------------------------------------------------------- 53 rem ----------------------------------------------------------------------
51 rem See if the environment is large enough. We need 43 (?) bytes. 54 rem See if the environment is large enough. We need 43 (?) bytes.
52 set $foo$=123456789_123456789_123456789_123456789_123 55 set $foo$=123456789_123456789_123456789_123456789_123
53 if not "%$foo$%" == "123456789_123456789_123456789_123456789_123" goto SmallEnv 56 if not "%$foo$%" == "123456789_123456789_123456789_123456789_123" goto SmallEnv
234 Rem You HAVE been warned! 237 Rem You HAVE been warned!
235 if (%nocygwin%) == (Y) goto chkapi 238 if (%nocygwin%) == (Y) goto chkapi
236 echo Checking whether gcc requires '-mno-cygwin'... 239 echo Checking whether gcc requires '-mno-cygwin'...
237 echo #include "cygwin/version.h" >junk.c 240 echo #include "cygwin/version.h" >junk.c
238 echo main(){} >>junk.c 241 echo main(){} >>junk.c
239 gcc -c junk.c 242 echo gcc -c junk.c >>config.log
243 gcc -c junk.c >>config.log 2>&1
240 if not exist junk.o goto chkapi 244 if not exist junk.o goto chkapi
241 gcc -mno-cygwin -c junk.c 245 echo gcc -mno-cygwin -c junk.c >>config.log
246 gcc -mno-cygwin -c junk.c >>config.log 2>&1
242 if exist junk.o set nocygwin=Y 247 if exist junk.o set nocygwin=Y
243 rm -f junk.c junk.o 248 rm -f junk.c junk.o
244 249
245 :chkapi 250 :chkapi
251 echo The failed program was: >>config.log
252 type junk.c >>config.log
246 rem ---------------------------------------------------------------------- 253 rem ----------------------------------------------------------------------
247 rem Older versions of the Windows API headers either don't have any of 254 rem Older versions of the Windows API headers either don't have any of
248 rem the IMAGE_xxx definitions (the headers that come with Cygwin b20.1 255 rem the IMAGE_xxx definitions (the headers that come with Cygwin b20.1
249 rem are like this), or have a typo in the definition of 256 rem are like this), or have a typo in the definition of
250 rem IMAGE_FIRST_SECTION (the headers with gcc/mingw32 2.95 have this 257 rem IMAGE_FIRST_SECTION (the headers with gcc/mingw32 2.95 have this
261 :chkapi1 268 :chkapi1
262 set cf=%usercflags% -mno-cygwin 269 set cf=%usercflags% -mno-cygwin
263 :chkapi2 270 :chkapi2
264 echo on 271 echo on
265 gcc %cf% -c junk.c 272 gcc %cf% -c junk.c
266 echo off 273 @echo off
274 @echo gcc %cf% -c junk.c >>config.log
275 gcc %cf% -c junk.c >>config.log 2>&1
267 set cf= 276 set cf=
268 if exist junk.o goto gccOk 277 if exist junk.o goto gccOk
278 echo The failed program was: >>config.log
279 type junk.c >>config.log
269 280
270 :nocompiler 281 :nocompiler
271 echo. 282 echo.
272 echo Configure failed. 283 echo Configure failed.
273 echo To configure Emacs for Windows, you need to have either 284 echo To configure Emacs for Windows, you need to have either
276 del junk.c 287 del junk.c
277 goto end 288 goto end
278 289
279 :gccOk 290 :gccOk
280 set COMPILER=gcc 291 set COMPILER=gcc
292 echo Using 'gcc'
281 rm -f junk.c junk.o 293 rm -f junk.c junk.o
282 echo Using 'gcc' 294 Rem It is not clear what GCC version began supporting -mtune
295 Rem and pentium4 on x86, so check this explicitly.
296 echo main(){} >junk.c
297 echo gcc -c -O2 -mtune=pentium4 junk.c >>config.log
298 gcc -c -O2 -mtune=pentium4 junk.c >>config.log 2>&1
299 if not errorlevel 1 goto gccMtuneOk
300 echo The failed program was: >>config.log
301 type junk.c >>config.log
302 set mf=-mcpu=i686
303 rm -f junk.c junk.o
304 goto compilercheckdone
305 :gccMtuneOk
306 echo GCC supports -mtune=pentium4 >>config.log
307 set mf=-mtune=pentium4
308 rm -f junk.c junk.o
283 goto compilercheckdone 309 goto compilercheckdone
284 310
285 :clOk 311 :clOk
286 set COMPILER=cl 312 set COMPILER=cl
287 rm -f junk.c junk.obj 313 rm -f junk.c junk.obj
292 rem ---------------------------------------------------------------------- 318 rem ----------------------------------------------------------------------
293 rem Check for external image libraries. Since they are loaded 319 rem Check for external image libraries. Since they are loaded
294 rem dynamically, the libraries themselves do not need to be present 320 rem dynamically, the libraries themselves do not need to be present
295 rem at compile time, but the header files are required. 321 rem at compile time, but the header files are required.
296 322
323 set mingwflag=
324
325 if (%nocygwin%) == (N) goto flagsOK
326 set mingwflag=-mno-cygwin
327
328 :flagsOK
329
297 if (%pngsupport%) == (N) goto pngDone 330 if (%pngsupport%) == (N) goto pngDone
298 331
299 echo Checking for libpng... 332 echo Checking for libpng...
300 echo #include "png.h" >junk.c 333 echo #include "png.h" >junk.c
301 echo main (){} >>junk.c 334 echo main (){} >>junk.c
302 rem -o option is ignored with cl, but allows result to be consistent. 335 rem -o option is ignored with cl, but allows result to be consistent.
303 %COMPILER% %usercflags% -c junk.c -o junk.obj >junk.out 2>junk.err 336 echo %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
304 if exist junk.obj goto havePng 338 if exist junk.obj goto havePng
305 339
306 echo ...png.h not found, building without PNG support. 340 echo ...png.h not found, building without PNG support.
341 echo The failed program was: >>config.log
342 type junk.c >>config.log
307 set HAVE_PNG= 343 set HAVE_PNG=
308 goto :pngDone 344 goto :pngDone
309 345
310 :havePng 346 :havePng
311 echo ...PNG header available, building with PNG support. 347 echo ...PNG header available, building with PNG support.
318 354
319 echo Checking for jpeg-6b... 355 echo Checking for jpeg-6b...
320 echo #include "jconfig.h" >junk.c 356 echo #include "jconfig.h" >junk.c
321 echo main (){} >>junk.c 357 echo main (){} >>junk.c
322 rem -o option is ignored with cl, but allows result to be consistent. 358 rem -o option is ignored with cl, but allows result to be consistent.
323 %COMPILER% %usercflags% -c junk.c -o junk.obj >junk.out 2>junk.err 359 echo %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
324 if exist junk.obj goto haveJpeg 361 if exist junk.obj goto haveJpeg
325 362
326 echo ...jconfig.h not found, building without JPEG support. 363 echo ...jconfig.h not found, building without JPEG support.
364 echo The failed program was: >>config.log
365 type junk.c >>config.log
327 set HAVE_JPEG= 366 set HAVE_JPEG=
328 goto :jpegDone 367 goto :jpegDone
329 368
330 :haveJpeg 369 :haveJpeg
331 echo ...JPEG header available, building with JPEG support. 370 echo ...JPEG header available, building with JPEG support.
338 377
339 echo Checking for libgif... 378 echo Checking for libgif...
340 echo #include "gif_lib.h" >junk.c 379 echo #include "gif_lib.h" >junk.c
341 echo main (){} >>junk.c 380 echo main (){} >>junk.c
342 rem -o option is ignored with cl, but allows result to be consistent. 381 rem -o option is ignored with cl, but allows result to be consistent.
343 %COMPILER% %usercflags% -c junk.c -o junk.obj >junk.out 2>junk.err 382 echo %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
344 if exist junk.obj goto haveGif 384 if exist junk.obj goto haveGif
345 385
346 echo ...gif_lib.h not found, building without GIF support. 386 echo ...gif_lib.h not found, building without GIF support.
387 echo The failed program was: >>config.log
388 type junk.c >>config.log
347 set HAVE_GIF= 389 set HAVE_GIF=
348 goto :gifDone 390 goto :gifDone
349 391
350 :haveGif 392 :haveGif
351 echo ...GIF header available, building with GIF support. 393 echo ...GIF header available, building with GIF support.
358 400
359 echo Checking for tiff... 401 echo Checking for tiff...
360 echo #include "tiffio.h" >junk.c 402 echo #include "tiffio.h" >junk.c
361 echo main (){} >>junk.c 403 echo main (){} >>junk.c
362 rem -o option is ignored with cl, but allows result to be consistent. 404 rem -o option is ignored with cl, but allows result to be consistent.
363 %COMPILER% %usercflags% -c junk.c -o junk.obj >junk.out 2>junk.err 405 echo %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
364 if exist junk.obj goto haveTiff 407 if exist junk.obj goto haveTiff
365 408
366 echo ...tiffio.h not found, building without TIFF support. 409 echo ...tiffio.h not found, building without TIFF support.
410 echo The failed program was: >>config.log
411 type junk.c >>config.log
367 set HAVE_TIFF= 412 set HAVE_TIFF=
368 goto :tiffDone 413 goto :tiffDone
369 414
370 :haveTiff 415 :haveTiff
371 echo ...TIFF header available, building with TIFF support. 416 echo ...TIFF header available, building with TIFF support.
379 echo Checking for libXpm... 424 echo Checking for libXpm...
380 echo #define FOR_MSW 1 >junk.c 425 echo #define FOR_MSW 1 >junk.c
381 echo #include "X11/xpm.h" >>junk.c 426 echo #include "X11/xpm.h" >>junk.c
382 echo main (){} >>junk.c 427 echo main (){} >>junk.c
383 rem -o option is ignored with cl, but allows result to be consistent. 428 rem -o option is ignored with cl, but allows result to be consistent.
384 %COMPILER% %usercflags% -c junk.c -o junk.obj >junk.out 2>junk.err 429 echo %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
385 if exist junk.obj goto haveXpm 431 if exist junk.obj goto haveXpm
386 432
387 echo ...X11/xpm.h not found, building without XPM support. 433 echo ...X11/xpm.h not found, building without XPM support.
434 echo The failed program was: >>config.log
435 type junk.c >>config.log
388 set HAVE_XPM= 436 set HAVE_XPM=
389 goto :xpmDone 437 goto :xpmDone
390 438
391 :haveXpm 439 :haveXpm
392 echo ...XPM header available, building with XPM support. 440 echo ...XPM header available, building with XPM support.
405 rem NB. Be very careful to not have a space before redirection symbols 453 rem NB. Be very careful to not have a space before redirection symbols
406 rem except when there is a preceding digit, when a space is required. 454 rem except when there is a preceding digit, when a space is required.
407 rem 455 rem
408 echo # Start of settings from configure.bat >config.settings 456 echo # Start of settings from configure.bat >config.settings
409 echo COMPILER=%COMPILER%>>config.settings 457 echo COMPILER=%COMPILER%>>config.settings
458 if not "(%mf%)" == "()" echo MCPU_FLAG=%mf%>>config.settings
410 if (%nodebug%) == (Y) echo NODEBUG=1 >>config.settings 459 if (%nodebug%) == (Y) echo NODEBUG=1 >>config.settings
411 if (%noopt%) == (Y) echo NOOPT=1 >>config.settings 460 if (%noopt%) == (Y) echo NOOPT=1 >>config.settings
412 if (%nocygwin%) == (Y) echo NOCYGWIN=1 >>config.settings 461 if (%nocygwin%) == (Y) echo NOCYGWIN=1 >>config.settings
413 if not "(%prefix%)" == "()" echo INSTALL_DIR=%prefix%>>config.settings 462 if not "(%prefix%)" == "()" echo INSTALL_DIR=%prefix%>>config.settings
414 if not "(%usercflags%)" == "()" echo USER_CFLAGS=%usercflags%>>config.settings 463 if not "(%usercflags%)" == "()" echo USER_CFLAGS=%usercflags%>>config.settings
415 if not "(%userldflags%)" == "()" echo USER_LDFLAGS=%userldflags%>>config.settings 464 if not "(%userldflags%)" == "()" echo USER_LDFLAGS=%userldflags%>>config.settings
416 echo # End of settings from configure.bat>>config.settings 465 echo # End of settings from configure.bat>>config.settings
417 echo. >>config.settings 466 echo. >>config.settings
418 467
419 copy config.nt ..\src\config.h 468 copy config.nt config.tmp
420 echo. >>..\src\config.h 469 echo. >>config.tmp
421 echo /* Start of settings from configure.bat. */ >>..\src\config.h 470 echo /* Start of settings from configure.bat. */ >>config.tmp
422 if not "(%usercflags%)" == "()" echo #define USER_CFLAGS " %usercflags%">>..\src\config.h 471 if not "(%usercflags%)" == "()" echo #define USER_CFLAGS " %usercflags%">>config.tmp
423 if not "(%userldflags%)" == "()" echo #define USER_LDFLAGS " %userldflags%">>..\src\config.h 472 if not "(%userldflags%)" == "()" echo #define USER_LDFLAGS " %userldflags%">>config.tmp
424 if not "(%HAVE_PNG%)" == "()" echo #define HAVE_PNG 1 >>..\src\config.h 473 if not "(%HAVE_PNG%)" == "()" echo #define HAVE_PNG 1 >>config.tmp
425 if not "(%HAVE_JPEG%)" == "()" echo #define HAVE_JPEG 1 >>..\src\config.h 474 if not "(%HAVE_JPEG%)" == "()" echo #define HAVE_JPEG 1 >>config.tmp
426 if not "(%HAVE_GIF%)" == "()" echo #define HAVE_GIF 1 >>..\src\config.h 475 if not "(%HAVE_GIF%)" == "()" echo #define HAVE_GIF 1 >>config.tmp
427 if not "(%HAVE_TIFF%)" == "()" echo #define HAVE_TIFF 1 >>..\src\config.h 476 if not "(%HAVE_TIFF%)" == "()" echo #define HAVE_TIFF 1 >>config.tmp
428 if not "(%HAVE_XPM%)" == "()" echo #define HAVE_XPM 1 >>..\src\config.h 477 if not "(%HAVE_XPM%)" == "()" echo #define HAVE_XPM 1 >>config.tmp
429 echo /* End of settings from configure.bat. */ >>..\src\config.h 478 echo /* End of settings from configure.bat. */ >>config.tmp
430 479
480 Rem See if fc.exe returns a meaningful exit status. If it does, we
481 Rem might as well avoid unnecessary overwriting of config.h and epaths.h,
482 Rem since this forces recompilation of every source file.
483 if exist foo.bar del foo.bar
484 fc /b foo.bar foo.bar >nul 2>&1
485 if not errorlevel 2 goto doCopy
486 fc /b config.tmp ..\src\config.h >nul 2>&1
487 if errorlevel 1 goto doCopy
488 fc /b paths.h ..\src\epaths.h >nul 2>&1
489 if errorlevel 0 goto dontCopy
490 :doCopy
491 copy config.tmp ..\src\config.h
431 copy paths.h ..\src\epaths.h 492 copy paths.h ..\src\epaths.h
432 493
494 :dontCopy
495 if exist config.tmp del config.tmp
433 copy /b config.settings+%MAKECMD%.defs+..\nt\makefile.w32-in ..\nt\makefile 496 copy /b config.settings+%MAKECMD%.defs+..\nt\makefile.w32-in ..\nt\makefile
434 copy /b config.settings+%MAKECMD%.defs+..\lib-src\makefile.w32-in ..\lib-src\makefile 497 copy /b config.settings+%MAKECMD%.defs+..\lib-src\makefile.w32-in ..\lib-src\makefile
435 copy /b config.settings+%MAKECMD%.defs+..\src\makefile.w32-in ..\src\makefile 498 copy /b config.settings+%MAKECMD%.defs+..\src\makefile.w32-in ..\src\makefile
436 if not exist ..\lisp\Makefile.unix rename ..\lisp\Makefile.in Makefile.unix 499 copy /b config.settings+%MAKECMD%.defs+..\man\makefile.w32-in ..\man\makefile
500 copy /b config.settings+%MAKECMD%.defs+..\lispref\makefile.w32-in ..\lispref\makefile
501 copy /b config.settings+%MAKECMD%.defs+..\lispintro\makefile.w32-in ..\lispintro\makefile
437 if exist ..\lisp\makefile rm -f ../lisp/[Mm]akefile 502 if exist ..\lisp\makefile rm -f ../lisp/[Mm]akefile
438 copy /b config.settings+%MAKECMD%.defs+..\lisp\makefile.w32-in ..\lisp\makefile 503 copy /b config.settings+%MAKECMD%.defs+..\lisp\makefile.w32-in ..\lisp\makefile
439 rem Use the default (no-op) Makefile.in if the nt version is not present. 504 rem Use the default (no-op) Makefile.in if the nt version is not present.
440 if exist ..\leim\makefile.w32-in copy /b config.settings+%MAKECMD%.defs+..\leim\makefile.w32-in ..\leim\makefile 505 if exist ..\leim\makefile.w32-in copy /b config.settings+%MAKECMD%.defs+..\leim\makefile.w32-in ..\leim\makefile
441 if not exist ..\leim\makefile.w32-in copy /b config.settings+%MAKECMD%.defs+..\leim\Makefile.in ..\leim\makefile 506 if not exist ..\leim\makefile.w32-in copy /b config.settings+%MAKECMD%.defs+..\leim\Makefile.in ..\leim\makefile
445 if not exist ..\site-lisp\nul mkdir ..\site-lisp\ 510 if not exist ..\site-lisp\nul mkdir ..\site-lisp\
446 if not exist ..\site-lisp\subdirs.el copy subdirs.el ..\site-lisp\subdirs.el 511 if not exist ..\site-lisp\subdirs.el copy subdirs.el ..\site-lisp\subdirs.el
447 512
448 echo. 513 echo.
449 echo Emacs successfully configured. 514 echo Emacs successfully configured.
515 echo Emacs successfully configured. >>config.log
450 echo Run `%MAKECMD%' to build, then run `%MAKECMD% install' to install. 516 echo Run `%MAKECMD%' to build, then run `%MAKECMD% install' to install.
451 goto end 517 goto end
452 518
453 :SmallEnv 519 :SmallEnv
454 echo Your environment size is too small. Please enlarge it and rerun configure. 520 echo Your environment size is too small. Please enlarge it and rerun configure.
461 set nocygwin= 527 set nocygwin=
462 set COMPILER= 528 set COMPILER=
463 set MAKECMD= 529 set MAKECMD=
464 set usercflags= 530 set usercflags=
465 set userldflags= 531 set userldflags=
532 set mingwflag=
533 set mf=
534
535 goto skipArchTag
536 arch-tag: 300d20a4-1675-4e75-b615-7ce1a8c5376c
537 :skipArchTag