1 |
@echo off |
@echo off |
2 |
rem ---------------------------------------------------------------------- |
rem ---------------------------------------------------------------------- |
3 |
rem Configuration script for MS Windows 95/98 and NT/2000 |
rem Configuration script for MS Windows 95/98/Me and NT/2000/XP |
4 |
rem Copyright (C) 1999-2001 Free Software Foundation, Inc. |
rem Copyright (C) 1999-2003 Free Software Foundation, Inc. |
5 |
|
|
6 |
rem This file is part of GNU Emacs. |
rem This file is part of GNU Emacs. |
7 |
|
|
22 |
rem ---------------------------------------------------------------------- |
rem ---------------------------------------------------------------------- |
23 |
rem YOU'LL NEED THE FOLLOWING UTILITIES TO MAKE EMACS: |
rem YOU'LL NEED THE FOLLOWING UTILITIES TO MAKE EMACS: |
24 |
rem |
rem |
25 |
rem + MS Windows 95/98 or NT/2000 |
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 |
rem + either MSVC 2.x or later, or gcc-2.95 or later (with gmake 3.75 |
27 |
rem or later) and the Mingw32 and W32 API headers and libraries |
rem or later) and the Mingw32 and W32 API headers and libraries |
28 |
rem |
rem |
29 |
rem For reference, here is a list of which builds of gmake are known to |
rem For reference, here is a list of which builds of gmake are known to |
30 |
rem work or not, and whether they work in the presence and/or absence of |
rem work or not, and whether they work in the presence and/or absence of |
31 |
rem sh.exe. |
rem sh.exe. |
32 |
rem |
rem |
33 |
rem sh exists no sh |
rem sh exists no sh |
34 |
rem cygwin b20.1 make (3.75): okay[1] fails[2] |
rem cygwin b20.1 make (3.75): okay[1] fails[2] |
35 |
rem MSVC compiled gmake 3.77: okay okay |
rem MSVC compiled gmake 3.77: okay okay |
85 |
if "%1" == "--no-cygwin" goto nocygwin |
if "%1" == "--no-cygwin" goto nocygwin |
86 |
if "%1" == "--cflags" goto usercflags |
if "%1" == "--cflags" goto usercflags |
87 |
if "%1" == "--ldflags" goto userldflags |
if "%1" == "--ldflags" goto userldflags |
88 |
|
if "%1" == "--without-png" goto withoutpng |
89 |
|
if "%1" == "--without-jpeg" goto withoutjpeg |
90 |
|
if "%1" == "--without-gif" goto withoutgif |
91 |
|
if "%1" == "--without-tiff" goto withouttiff |
92 |
|
if "%1" == "--without-xpm" goto withoutxpm |
93 |
if "%1" == "" goto checkutils |
if "%1" == "" goto checkutils |
94 |
:usage |
:usage |
95 |
echo Usage: configure [options] |
echo Usage: configure [options] |
102 |
echo. --no-cygwin use -mno-cygwin option with GCC |
echo. --no-cygwin use -mno-cygwin option with GCC |
103 |
echo. --cflags FLAG pass FLAG to compiler |
echo. --cflags FLAG pass FLAG to compiler |
104 |
echo. --ldflags FLAG pass FLAG to compiler when linking |
echo. --ldflags FLAG pass FLAG to compiler when linking |
105 |
|
echo. --without-png do not use libpng even if it is installed |
106 |
|
echo. --without-jpeg do not use jpeg-6b even if it is installed |
107 |
|
echo. --without-gif do not use libungif even if it is installed |
108 |
|
echo. --without-tiff do not use libtiff even if it is installed |
109 |
|
echo. --without-xpm do not use libXpm even if it is installed |
110 |
goto end |
goto end |
111 |
rem ---------------------------------------------------------------------- |
rem ---------------------------------------------------------------------- |
112 |
:setprefix |
:setprefix |
153 |
set sep2= %nothing% |
set sep2= %nothing% |
154 |
shift |
shift |
155 |
goto again |
goto again |
156 |
|
rem ---------------------------------------------------------------------- |
157 |
|
|
158 |
|
:withoutpng |
159 |
|
set pngsupport=N |
160 |
|
set HAVE_PNG= |
161 |
|
shift |
162 |
|
goto again |
163 |
|
|
164 |
|
rem ---------------------------------------------------------------------- |
165 |
|
|
166 |
|
:withoutjpeg |
167 |
|
set jpegsupport=N |
168 |
|
set HAVE_JPEG= |
169 |
|
shift |
170 |
|
goto again |
171 |
|
|
172 |
|
rem ---------------------------------------------------------------------- |
173 |
|
|
174 |
|
:withoutgif |
175 |
|
set gifsupport=N |
176 |
|
set HAVE_GIF= |
177 |
|
shift |
178 |
|
goto again |
179 |
|
|
180 |
|
rem ---------------------------------------------------------------------- |
181 |
|
|
182 |
|
:withouttiff |
183 |
|
set tiffsupport=N |
184 |
|
set HAVE_TIFF= |
185 |
|
shift |
186 |
|
goto again |
187 |
|
|
188 |
|
rem ---------------------------------------------------------------------- |
189 |
|
|
190 |
|
:withoutxpm |
191 |
|
set xpmsupport=N |
192 |
|
set HAVE_XPM= |
193 |
|
shift |
194 |
|
goto again |
195 |
|
|
196 |
rem ---------------------------------------------------------------------- |
rem ---------------------------------------------------------------------- |
197 |
rem Check that necessary utilities (cp and rm) are present. |
rem Check that necessary utilities (cp and rm) are present. |
214 |
rem ---------------------------------------------------------------------- |
rem ---------------------------------------------------------------------- |
215 |
rem Auto-detect compiler if not specified, and validate GCC if chosen. |
rem Auto-detect compiler if not specified, and validate GCC if chosen. |
216 |
:checkcompiler |
:checkcompiler |
217 |
if (%COMPILER%)==(cl) goto genmakefiles |
if (%COMPILER%)==(cl) goto compilercheckdone |
218 |
if (%COMPILER%)==(gcc) goto checkgcc |
if (%COMPILER%)==(gcc) goto checkgcc |
219 |
|
|
220 |
echo Checking whether 'cl' is available... |
echo Checking whether 'cl' is available... |
280 |
set COMPILER=gcc |
set COMPILER=gcc |
281 |
rm -f junk.c junk.o |
rm -f junk.c junk.o |
282 |
echo Using 'gcc' |
echo Using 'gcc' |
283 |
goto genmakefiles |
goto compilercheckdone |
284 |
|
|
285 |
:clOk |
:clOk |
286 |
set COMPILER=cl |
set COMPILER=cl |
287 |
rm -f junk.c junk.obj |
rm -f junk.c junk.obj |
288 |
echo Using 'MSVC' |
echo Using 'MSVC' |
289 |
goto genmakefiles |
|
290 |
|
:compilercheckdone |
291 |
|
|
292 |
|
rem ---------------------------------------------------------------------- |
293 |
|
rem Check for external image libraries. Since they are loaded |
294 |
|
rem dynamically, the libraries themselves do not need to be present |
295 |
|
rem at compile time, but the header files are required. |
296 |
|
|
297 |
|
if (%pngsupport%) == (N) goto pngDone |
298 |
|
|
299 |
|
echo Checking for libpng... |
300 |
|
echo #include "png.h" >junk.c |
301 |
|
echo main (){} >>junk.c |
302 |
|
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 |
304 |
|
if exist junk.obj goto havePng |
305 |
|
|
306 |
|
echo ...png.h not found, building without PNG support. |
307 |
|
set HAVE_PNG= |
308 |
|
goto :pngDone |
309 |
|
|
310 |
|
:havePng |
311 |
|
echo ...PNG header available, building with PNG support. |
312 |
|
set HAVE_PNG=1 |
313 |
|
|
314 |
|
:pngDone |
315 |
|
rm -f junk.c junk.obj |
316 |
|
|
317 |
|
if (%jpegsupport%) == (N) goto jpegDone |
318 |
|
|
319 |
|
echo Checking for jpeg-6b... |
320 |
|
echo #include "jconfig.h" >junk.c |
321 |
|
echo main (){} >>junk.c |
322 |
|
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 |
324 |
|
if exist junk.obj goto haveJpeg |
325 |
|
|
326 |
|
echo ...jconfig.h not found, building without JPEG support. |
327 |
|
set HAVE_JPEG= |
328 |
|
goto :jpegDone |
329 |
|
|
330 |
|
:haveJpeg |
331 |
|
echo ...JPEG header available, building with JPEG support. |
332 |
|
set HAVE_JPEG=1 |
333 |
|
|
334 |
|
:jpegDone |
335 |
|
rm -f junk.c junk.obj |
336 |
|
|
337 |
|
if (%gifsupport%) == (N) goto gifDone |
338 |
|
|
339 |
|
echo Checking for libgif... |
340 |
|
echo #include "gif_lib.h" >junk.c |
341 |
|
echo main (){} >>junk.c |
342 |
|
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 |
344 |
|
if exist junk.obj goto haveGif |
345 |
|
|
346 |
|
echo ...gif_lib.h not found, building without GIF support. |
347 |
|
set HAVE_GIF= |
348 |
|
goto :gifDone |
349 |
|
|
350 |
|
:haveGif |
351 |
|
echo ...GIF header available, building with GIF support. |
352 |
|
set HAVE_GIF=1 |
353 |
|
|
354 |
|
:gifDone |
355 |
|
rm -f junk.c junk.obj |
356 |
|
|
357 |
|
if (%tiffsupport%) == (N) goto tiffDone |
358 |
|
|
359 |
|
echo Checking for tiff... |
360 |
|
echo #include "tiffio.h" >junk.c |
361 |
|
echo main (){} >>junk.c |
362 |
|
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 |
364 |
|
if exist junk.obj goto haveTiff |
365 |
|
|
366 |
|
echo ...tiffio.h not found, building without TIFF support. |
367 |
|
set HAVE_TIFF= |
368 |
|
goto :tiffDone |
369 |
|
|
370 |
|
:haveTiff |
371 |
|
echo ...TIFF header available, building with TIFF support. |
372 |
|
set HAVE_TIFF=1 |
373 |
|
|
374 |
|
:tiffDone |
375 |
|
rm -f junk.c junk.obj |
376 |
|
|
377 |
|
if (%xpmsupport%) == (N) goto xpmDone |
378 |
|
|
379 |
|
echo Checking for libXpm... |
380 |
|
echo #define FOR_MSW 1 >junk.c |
381 |
|
echo #include "X11/xpm.h" >>junk.c |
382 |
|
echo main (){} >>junk.c |
383 |
|
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 |
385 |
|
if exist junk.obj goto haveXpm |
386 |
|
|
387 |
|
echo ...X11/xpm.h not found, building without XPM support. |
388 |
|
set HAVE_XPM= |
389 |
|
goto :xpmDone |
390 |
|
|
391 |
|
:haveXpm |
392 |
|
echo ...XPM header available, building with XPM support. |
393 |
|
set HAVE_XPM=1 |
394 |
|
|
395 |
|
:xpmDone |
396 |
|
rm -f junk.c junk.obj junk.err junk.out |
397 |
|
|
398 |
rem ---------------------------------------------------------------------- |
rem ---------------------------------------------------------------------- |
399 |
:genmakefiles |
:genmakefiles |
417 |
echo. >>config.settings |
echo. >>config.settings |
418 |
|
|
419 |
copy config.nt ..\src\config.h |
copy config.nt ..\src\config.h |
420 |
|
echo. >>..\src\config.h |
421 |
|
echo /* Start of settings from configure.bat. */ >>..\src\config.h |
422 |
if not "(%usercflags%)" == "()" echo #define USER_CFLAGS " %usercflags%">>..\src\config.h |
if not "(%usercflags%)" == "()" echo #define USER_CFLAGS " %usercflags%">>..\src\config.h |
423 |
if not "(%userldflags%)" == "()" echo #define USER_LDFLAGS " %userldflags%">>..\src\config.h |
if not "(%userldflags%)" == "()" echo #define USER_LDFLAGS " %userldflags%">>..\src\config.h |
424 |
|
if not "(%HAVE_PNG%)" == "()" echo #define HAVE_PNG 1 >>..\src\config.h |
425 |
|
if not "(%HAVE_JPEG%)" == "()" echo #define HAVE_JPEG 1 >>..\src\config.h |
426 |
|
if not "(%HAVE_GIF%)" == "()" echo #define HAVE_GIF 1 >>..\src\config.h |
427 |
|
if not "(%HAVE_TIFF%)" == "()" echo #define HAVE_TIFF 1 >>..\src\config.h |
428 |
|
if not "(%HAVE_XPM%)" == "()" echo #define HAVE_XPM 1 >>..\src\config.h |
429 |
|
echo /* End of settings from configure.bat. */ >>..\src\config.h |
430 |
|
|
431 |
copy paths.h ..\src\epaths.h |
copy paths.h ..\src\epaths.h |
432 |
|
|
433 |
copy /b config.settings+%MAKECMD%.defs+..\nt\makefile.w32-in ..\nt\makefile |
copy /b config.settings+%MAKECMD%.defs+..\nt\makefile.w32-in ..\nt\makefile |