Replace string-to-int with string-to-number.
[bpt/emacs.git] / nt / configure.bat
index ea0486c..2164208 100755 (executable)
@@ -1,7 +1,7 @@
 @echo off\r
 rem   ----------------------------------------------------------------------\r
-rem   Configuration script for MS Windows 95/98 and NT/2000\r
-rem   Copyright (C) 1999-2001 Free Software Foundation, Inc.\r
+rem   Configuration script for MS Windows 95/98/Me and NT/2000/XP\r
+rem   Copyright (C) 1999-2003 Free Software Foundation, Inc.\r
 \r
 rem   This file is part of GNU Emacs.\r
 \r
@@ -22,7 +22,7 @@ rem   Boston, MA 02111-1307, USA.
 rem   ----------------------------------------------------------------------\r
 rem   YOU'LL NEED THE FOLLOWING UTILITIES TO MAKE EMACS:\r
 rem\r
-rem   + MS Windows 95/98 or NT/2000\r
+rem   + MS Windows 95/98/Me or NT/2000/XP\r
 rem   + either MSVC 2.x or later, or gcc-2.95 or later (with gmake 3.75\r
 rem     or later) and the Mingw32 and W32 API headers and libraries\r
 rem\r
@@ -87,6 +87,9 @@ if "%1" == "--cflags" goto usercflags
 if "%1" == "--ldflags" goto userldflags\r
 if "%1" == "--without-png" goto withoutpng\r
 if "%1" == "--without-jpeg" goto withoutjpeg\r
+if "%1" == "--without-gif" goto withoutgif\r
+if "%1" == "--without-tiff" goto withouttiff\r
+if "%1" == "--without-xpm" goto withoutxpm\r
 if "%1" == "" goto checkutils\r
 :usage\r
 echo Usage: configure [options]\r
@@ -100,7 +103,10 @@ echo.   --no-cygwin             use -mno-cygwin option with GCC
 echo.   --cflags FLAG           pass FLAG to compiler\r
 echo.   --ldflags FLAG          pass FLAG to compiler when linking\r
 echo.   --without-png           do not use libpng even if it is installed\r
-echo.   --without-jpeg          do not use jpeglib even if it is installed\r
+echo.   --without-jpeg          do not use jpeg-6b even if it is installed\r
+echo.   --without-gif           do not use libungif even if it is installed\r
+echo.   --without-tiff          do not use libtiff even if it is installed\r
+echo.   --without-xpm           do not use libXpm even if it is installed\r
 goto end\r
 rem ----------------------------------------------------------------------\r
 :setprefix\r
@@ -163,6 +169,30 @@ set HAVE_JPEG=
 shift\r
 goto again\r
 \r
+rem ----------------------------------------------------------------------\r
+\r
+:withoutgif\r
+set gifsupport=N\r
+set HAVE_GIF=\r
+shift\r
+goto again\r
+\r
+rem ----------------------------------------------------------------------\r
+\r
+:withouttiff\r
+set tiffsupport=N\r
+set HAVE_TIFF=\r
+shift\r
+goto again\r
+\r
+rem ----------------------------------------------------------------------\r
+\r
+:withoutxpm\r
+set xpmsupport=N\r
+set HAVE_XPM=\r
+shift\r
+goto again\r
+\r
 rem ----------------------------------------------------------------------\r
 rem    Check that necessary utilities (cp and rm) are present.\r
 :checkutils\r
@@ -264,16 +294,23 @@ rem   Check for external image libraries. Since they are loaded
 rem   dynamically, the libraries themselves do not need to be present\r
 rem   at compile time, but the header files are required.\r
 \r
+set mingwflag=\r
+\r
+if (%nocygwin%) == (N) goto flagsOK\r
+set mingwflag=-mno-cygwin\r
+\r
+:flagsOK\r
+\r
 if (%pngsupport%) == (N) goto pngDone\r
 \r
 echo Checking for libpng...\r
 echo #include "png.h" >junk.c\r
 echo main (){} >>junk.c\r
 rem   -o option is ignored with cl, but allows result to be consistent.\r
-%COMPILER% %usercflags% -c junk.c -o junk.obj\r
+%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>junk.err\r
 if exist junk.obj goto havePng\r
 \r
-echo ...building without PNG support.\r
+echo ...png.h not found, building without PNG support.\r
 set HAVE_PNG=\r
 goto :pngDone\r
 \r
@@ -286,14 +323,14 @@ rm -f junk.c junk.obj
 \r
 if (%jpegsupport%) == (N) goto jpegDone\r
 \r
-echo Checking for jpeg ...\r
+echo Checking for jpeg-6b...\r
 echo #include "jconfig.h" >junk.c\r
 echo main (){} >>junk.c\r
 rem   -o option is ignored with cl, but allows result to be consistent.\r
-%COMPILER% %usercflags% -c junk.c -o junk.obj\r
+%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>junk.err\r
 if exist junk.obj goto haveJpeg\r
 \r
-echo ...building without JPEG support.\r
+echo ...jconfig.h not found, building without JPEG support.\r
 set HAVE_JPEG=\r
 goto :jpegDone\r
 \r
@@ -304,6 +341,67 @@ set HAVE_JPEG=1
 :jpegDone\r
 rm -f junk.c junk.obj\r
 \r
+if (%gifsupport%) == (N) goto gifDone\r
+\r
+echo Checking for libgif...\r
+echo #include "gif_lib.h" >junk.c\r
+echo main (){} >>junk.c\r
+rem   -o option is ignored with cl, but allows result to be consistent.\r
+%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>junk.err\r
+if exist junk.obj goto haveGif\r
+\r
+echo ...gif_lib.h not found, building without GIF support.\r
+set HAVE_GIF=\r
+goto :gifDone\r
+\r
+:haveGif\r
+echo ...GIF header available, building with GIF support.\r
+set HAVE_GIF=1\r
+\r
+:gifDone\r
+rm -f junk.c junk.obj\r
+\r
+if (%tiffsupport%) == (N) goto tiffDone\r
+\r
+echo Checking for tiff...\r
+echo #include "tiffio.h" >junk.c\r
+echo main (){} >>junk.c\r
+rem   -o option is ignored with cl, but allows result to be consistent.\r
+%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>junk.err\r
+if exist junk.obj goto haveTiff\r
+\r
+echo ...tiffio.h not found, building without TIFF support.\r
+set HAVE_TIFF=\r
+goto :tiffDone\r
+\r
+:haveTiff\r
+echo ...TIFF header available, building with TIFF support.\r
+set HAVE_TIFF=1\r
+\r
+:tiffDone\r
+rm -f junk.c junk.obj\r
+\r
+if (%xpmsupport%) == (N) goto xpmDone\r
+\r
+echo Checking for libXpm...\r
+echo #define FOR_MSW 1 >junk.c\r
+echo #include "X11/xpm.h" >>junk.c\r
+echo main (){} >>junk.c\r
+rem   -o option is ignored with cl, but allows result to be consistent.\r
+%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>junk.err\r
+if exist junk.obj goto haveXpm\r
+\r
+echo ...X11/xpm.h not found, building without XPM support.\r
+set HAVE_XPM=\r
+goto :xpmDone\r
+\r
+:haveXpm\r
+echo ...XPM header available, building with XPM support.\r
+set HAVE_XPM=1\r
+\r
+:xpmDone\r
+rm -f junk.c junk.obj junk.err junk.out\r
+\r
 rem ----------------------------------------------------------------------\r
 :genmakefiles\r
 echo Generating makefiles\r
@@ -332,6 +430,9 @@ if not "(%usercflags%)" == "()" echo #define USER_CFLAGS " %usercflags%">>..\src
 if not "(%userldflags%)" == "()" echo #define USER_LDFLAGS " %userldflags%">>..\src\config.h\r
 if not "(%HAVE_PNG%)" == "()" echo #define HAVE_PNG 1 >>..\src\config.h\r
 if not "(%HAVE_JPEG%)" == "()" echo #define HAVE_JPEG 1 >>..\src\config.h\r
+if not "(%HAVE_GIF%)" == "()" echo #define HAVE_GIF 1 >>..\src\config.h\r
+if not "(%HAVE_TIFF%)" == "()" echo #define HAVE_TIFF 1 >>..\src\config.h\r
+if not "(%HAVE_XPM%)" == "()" echo #define HAVE_XPM 1 >>..\src\config.h\r
 echo /* End of settings from configure.bat.  */ >>..\src\config.h\r
 \r
 copy paths.h ..\src\epaths.h\r
@@ -339,6 +440,9 @@ copy paths.h ..\src\epaths.h
 copy /b config.settings+%MAKECMD%.defs+..\nt\makefile.w32-in ..\nt\makefile\r
 copy /b config.settings+%MAKECMD%.defs+..\lib-src\makefile.w32-in ..\lib-src\makefile\r
 copy /b config.settings+%MAKECMD%.defs+..\src\makefile.w32-in ..\src\makefile\r
+copy /b config.settings+%MAKECMD%.defs+..\man\makefile.w32-in ..\man\makefile\r
+copy /b config.settings+%MAKECMD%.defs+..\lispref\makefile.w32-in ..\lispref\makefile\r
+copy /b config.settings+%MAKECMD%.defs+..\lispintro\makefile.w32-in ..\lispintro\makefile\r
 if not exist ..\lisp\Makefile.unix rename ..\lisp\Makefile.in Makefile.unix\r
 if exist ..\lisp\makefile rm -f ../lisp/[Mm]akefile\r
 copy /b config.settings+%MAKECMD%.defs+..\lisp\makefile.w32-in ..\lisp\makefile\r
@@ -369,3 +473,8 @@ set COMPILER=
 set MAKECMD=\r
 set usercflags=\r
 set userldflags=\r
+set mingwflag=\r
+\r
+goto skipArchTag\r
+   arch-tag: 300d20a4-1675-4e75-b615-7ce1a8c5376c\r
+:skipArchTag\r