Mercurial > emacs
annotate nt/configure.bat @ 49555:4d20af97e0f8
*** empty log message ***
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Fri, 31 Jan 2003 20:43:22 +0000 |
parents | fdc002872212 |
children | 5c18aa000ef4 |
rev | line source |
---|---|
39055 | 1 @echo off |
2 rem ---------------------------------------------------------------------- | |
49541
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
3 rem Configuration script for MS Windows 95/98/Me and NT/2000/XP |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
4 rem Copyright (C) 1999-2003 Free Software Foundation, Inc. |
39055 | 5 |
6 rem This file is part of GNU Emacs. | |
7 | |
8 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 the Free Software Foundation; either version 2, or (at your option) | |
11 rem any later version. | |
12 | |
13 rem GNU Emacs is distributed in the hope that it will be useful, | |
14 rem but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 rem GNU General Public License for more details. | |
17 | |
18 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 Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
21 rem Boston, MA 02111-1307, USA. | |
22 rem ---------------------------------------------------------------------- | |
23 rem YOU'LL NEED THE FOLLOWING UTILITIES TO MAKE EMACS: | |
24 rem | |
49541
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
25 rem + MS Windows 95/98/Me or NT/2000/XP |
39055 | 26 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 | |
28 rem | |
29 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 | |
31 rem sh.exe. | |
49484 | 32 rem |
39055 | 33 rem sh exists no sh |
34 rem cygwin b20.1 make (3.75): okay[1] fails[2] | |
35 rem MSVC compiled gmake 3.77: okay okay | |
36 rem MSVC compiled gmake 3.78.1: okay okay | |
37 rem MSVC compiled gmake 3.79.1: okay okay | |
38 rem mingw32/gcc-2.92.2 make (3.77): okay okay | |
39 rem cygwin compiled gmake 3.77: okay[1] fails[2] | |
40 rem cygwin compiled gmake 3.78.1: okay fails[2] | |
41 rem cygwin compiled gmake 3.79.1: couldn't build make[3] | |
42 rem | |
43 rem [1] doesn't cope with makefiles with DOS line endings, so must mount | |
44 rem emacs source with text!=binary. | |
45 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 cygwin provides this? | |
48 rem | |
49 | |
50 rem ---------------------------------------------------------------------- | |
51 rem See if the environment is large enough. We need 43 (?) bytes. | |
52 set $foo$=123456789_123456789_123456789_123456789_123 | |
53 if not "%$foo$%" == "123456789_123456789_123456789_123456789_123" goto SmallEnv | |
54 set $foo$= | |
55 | |
56 rem ---------------------------------------------------------------------- | |
57 rem Make sure we are running in the nt subdir | |
58 if exist configure.bat goto start | |
59 echo You must run configure from the nt subdirectory. | |
60 goto end | |
61 | |
62 :start | |
63 rem ---------------------------------------------------------------------- | |
64 rem Default settings. | |
65 set prefix= | |
66 set nodebug=N | |
67 set noopt=N | |
68 set nocygwin=N | |
69 set COMPILER= | |
70 set usercflags= | |
71 set userldflags= | |
72 set sep1= | |
73 set sep2= | |
74 | |
75 rem ---------------------------------------------------------------------- | |
76 rem Handle arguments. | |
77 :again | |
78 if "%1" == "-h" goto usage | |
79 if "%1" == "--help" goto usage | |
80 if "%1" == "--prefix" goto setprefix | |
81 if "%1" == "--with-gcc" goto withgcc | |
82 if "%1" == "--with-msvc" goto withmsvc | |
83 if "%1" == "--no-debug" goto nodebug | |
84 if "%1" == "--no-opt" goto noopt | |
85 if "%1" == "--no-cygwin" goto nocygwin | |
86 if "%1" == "--cflags" goto usercflags | |
87 if "%1" == "--ldflags" goto userldflags | |
49450
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
88 if "%1" == "--without-png" goto withoutpng |
49456
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
89 if "%1" == "--without-jpeg" goto withoutjpeg |
49541
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
90 if "%1" == "--without-gif" goto withoutgif |
49544
fdc002872212
Automatically detect tifflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49541
diff
changeset
|
91 if "%1" == "--without-tiff" goto withouttiff |
39055 | 92 if "%1" == "" goto checkutils |
93 :usage | |
94 echo Usage: configure [options] | |
95 echo Options: | |
96 echo. --prefix PREFIX install Emacs in directory PREFIX | |
97 echo. --with-gcc use GCC to compile Emacs | |
98 echo. --with-msvc use MSVC to compile Emacs | |
99 echo. --no-debug exclude debug info from executables | |
100 echo. --no-opt disable optimization | |
101 echo. --no-cygwin use -mno-cygwin option with GCC | |
102 echo. --cflags FLAG pass FLAG to compiler | |
103 echo. --ldflags FLAG pass FLAG to compiler when linking | |
49484 | 104 echo. --without-png do not use libpng even if it is installed |
105 echo. --without-jpeg do not use jpeglib even if it is installed | |
49541
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
106 echo. --without-gif do not use giflib even if it is installed |
49544
fdc002872212
Automatically detect tifflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49541
diff
changeset
|
107 echo. --without-tiff do not use tifflib even if it is installed |
39055 | 108 goto end |
109 rem ---------------------------------------------------------------------- | |
110 :setprefix | |
111 shift | |
112 set prefix=%1 | |
113 shift | |
114 goto again | |
115 rem ---------------------------------------------------------------------- | |
116 :withgcc | |
117 set COMPILER=gcc | |
118 shift | |
119 goto again | |
120 rem ---------------------------------------------------------------------- | |
121 :withmsvc | |
122 set COMPILER=cl | |
123 shift | |
124 goto again | |
125 rem ---------------------------------------------------------------------- | |
126 :nodebug | |
127 set nodebug=Y | |
128 shift | |
129 goto again | |
130 rem ---------------------------------------------------------------------- | |
131 :noopt | |
132 set noopt=Y | |
133 shift | |
134 goto again | |
135 rem ---------------------------------------------------------------------- | |
136 :nocygwin | |
137 set nocygwin=Y | |
138 shift | |
139 goto again | |
140 rem ---------------------------------------------------------------------- | |
141 :usercflags | |
142 shift | |
143 set usercflags=%usercflags%%sep1%%1 | |
144 set sep1= %nothing% | |
145 shift | |
146 goto again | |
147 rem ---------------------------------------------------------------------- | |
148 :userldflags | |
149 shift | |
150 set userldflags=%userldflags%%sep2%%1 | |
151 set sep2= %nothing% | |
152 shift | |
153 goto again | |
49450
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
154 rem ---------------------------------------------------------------------- |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
155 |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
156 :withoutpng |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
157 set pngsupport=N |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
158 set HAVE_PNG= |
49510
d717146dfad9
Avoid endless loop when configuring without image support.
Juanma Barranquero <lekktu@gmail.com>
parents:
49484
diff
changeset
|
159 shift |
49450
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
160 goto again |
39055 | 161 |
162 rem ---------------------------------------------------------------------- | |
49456
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
163 |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
164 :withoutjpeg |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
165 set jpegsupport=N |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
166 set HAVE_JPEG= |
49510
d717146dfad9
Avoid endless loop when configuring without image support.
Juanma Barranquero <lekktu@gmail.com>
parents:
49484
diff
changeset
|
167 shift |
49456
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
168 goto again |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
169 |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
170 rem ---------------------------------------------------------------------- |
49541
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
171 |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
172 :withoutgif |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
173 set gifsupport=N |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
174 set HAVE_GIF= |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
175 shift |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
176 goto again |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
177 |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
178 rem ---------------------------------------------------------------------- |
49544
fdc002872212
Automatically detect tifflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49541
diff
changeset
|
179 |
fdc002872212
Automatically detect tifflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49541
diff
changeset
|
180 :withouttiff |
fdc002872212
Automatically detect tifflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49541
diff
changeset
|
181 set tiffsupport=N |
fdc002872212
Automatically detect tifflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49541
diff
changeset
|
182 set HAVE_TIFF= |
fdc002872212
Automatically detect tifflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49541
diff
changeset
|
183 shift |
fdc002872212
Automatically detect tifflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49541
diff
changeset
|
184 goto again |
fdc002872212
Automatically detect tifflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49541
diff
changeset
|
185 |
fdc002872212
Automatically detect tifflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49541
diff
changeset
|
186 rem ---------------------------------------------------------------------- |
39055 | 187 rem Check that necessary utilities (cp and rm) are present. |
188 :checkutils | |
189 echo Checking for 'cp'... | |
190 cp configure.bat junk.bat | |
191 if not exist junk.bat goto needcp | |
192 echo Checking for 'rm'... | |
193 rm junk.bat | |
194 if exist junk.bat goto needrm | |
195 goto checkcompiler | |
196 :needcp | |
197 echo You need 'cp' (the Unix file copy program) to build Emacs. | |
198 goto end | |
199 :needrm | |
200 del junk.bat | |
201 echo You need 'rm' (the Unix file delete program) to build Emacs. | |
202 goto end | |
203 | |
204 rem ---------------------------------------------------------------------- | |
205 rem Auto-detect compiler if not specified, and validate GCC if chosen. | |
206 :checkcompiler | |
49450
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
207 if (%COMPILER%)==(cl) goto compilercheckdone |
39055 | 208 if (%COMPILER%)==(gcc) goto checkgcc |
209 | |
210 echo Checking whether 'cl' is available... | |
211 echo main(){} >junk.c | |
212 cl -nologo -c junk.c | |
213 if exist junk.obj goto clOK | |
214 | |
215 echo Checking whether 'gcc' is available... | |
216 gcc -c junk.c | |
217 if not exist junk.o goto nocompiler | |
218 del junk.o | |
219 | |
220 :checkgcc | |
221 Rem WARNING -- COMMAND.COM on some systems only looks at the first | |
222 Rem 8 characters of a label. So do NOT be tempted to change | |
223 Rem chkapi* into something fancier like checkw32api | |
224 Rem You HAVE been warned! | |
225 if (%nocygwin%) == (Y) goto chkapi | |
226 echo Checking whether gcc requires '-mno-cygwin'... | |
227 echo #include "cygwin/version.h" >junk.c | |
228 echo main(){} >>junk.c | |
229 gcc -c junk.c | |
230 if not exist junk.o goto chkapi | |
231 gcc -mno-cygwin -c junk.c | |
232 if exist junk.o set nocygwin=Y | |
233 rm -f junk.c junk.o | |
234 | |
235 :chkapi | |
236 rem ---------------------------------------------------------------------- | |
237 rem Older versions of the Windows API headers either don't have any of | |
238 rem the IMAGE_xxx definitions (the headers that come with Cygwin b20.1 | |
239 rem are like this), or have a typo in the definition of | |
240 rem IMAGE_FIRST_SECTION (the headers with gcc/mingw32 2.95 have this | |
241 rem problem). The gcc/mingw32 2.95.2 headers are okay, as are distros | |
242 rem of w32api-xxx.zip from Anders Norlander since 1999-11-18 at least. | |
243 rem | |
244 echo Checking whether W32 API headers are too old... | |
245 echo #include "windows.h" >junk.c | |
246 echo test(PIMAGE_NT_HEADERS pHeader) >>junk.c | |
247 echo {PIMAGE_SECTION_HEADER pSection = IMAGE_FIRST_SECTION(pHeader);} >>junk.c | |
248 if (%nocygwin%) == (Y) goto chkapi1 | |
249 set cf=%usercflags% | |
250 goto chkapi2 | |
251 :chkapi1 | |
252 set cf=%usercflags% -mno-cygwin | |
253 :chkapi2 | |
254 echo on | |
255 gcc %cf% -c junk.c | |
256 echo off | |
257 set cf= | |
258 if exist junk.o goto gccOk | |
259 | |
260 :nocompiler | |
261 echo. | |
262 echo Configure failed. | |
263 echo To configure Emacs for Windows, you need to have either | |
264 echo gcc-2.95 or later with Mingw32 and the W32 API headers, | |
265 echo or MSVC 2.x or later. | |
266 del junk.c | |
267 goto end | |
268 | |
269 :gccOk | |
270 set COMPILER=gcc | |
271 rm -f junk.c junk.o | |
272 echo Using 'gcc' | |
49450
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
273 goto compilercheckdone |
39055 | 274 |
275 :clOk | |
276 set COMPILER=cl | |
277 rm -f junk.c junk.obj | |
278 echo Using 'MSVC' | |
49450
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
279 |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
280 :compilercheckdone |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
281 |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
282 rem ---------------------------------------------------------------------- |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
283 rem Check for external image libraries. Since they are loaded |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
284 rem dynamically, the libraries themselves do not need to be present |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
285 rem at compile time, but the header files are required. |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
286 |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
287 if (%pngsupport%) == (N) goto pngDone |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
288 |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
289 echo Checking for libpng... |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
290 echo #include "png.h" >junk.c |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
291 echo main (){} >>junk.c |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
292 rem -o option is ignored with cl, but allows result to be consistent. |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
293 %COMPILER% %usercflags% -c junk.c -o junk.obj |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
294 if exist junk.obj goto havePng |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
295 |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
296 echo ...building without PNG support. |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
297 set HAVE_PNG= |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
298 goto :pngDone |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
299 |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
300 :havePng |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
301 echo ...PNG header available, building with PNG support. |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
302 set HAVE_PNG=1 |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
303 |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
304 :pngDone |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
305 rm -f junk.c junk.obj |
39055 | 306 |
49456
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
307 if (%jpegsupport%) == (N) goto jpegDone |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
308 |
49541
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
309 echo Checking for jpeg... |
49456
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
310 echo #include "jconfig.h" >junk.c |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
311 echo main (){} >>junk.c |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
312 rem -o option is ignored with cl, but allows result to be consistent. |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
313 %COMPILER% %usercflags% -c junk.c -o junk.obj |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
314 if exist junk.obj goto haveJpeg |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
315 |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
316 echo ...building without JPEG support. |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
317 set HAVE_JPEG= |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
318 goto :jpegDone |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
319 |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
320 :haveJpeg |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
321 echo ...JPEG header available, building with JPEG support. |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
322 set HAVE_JPEG=1 |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
323 |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
324 :jpegDone |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
325 rm -f junk.c junk.obj |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
326 |
49541
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
327 if (%gifsupport%) == (N) goto gifDone |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
328 |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
329 echo Checking for gif... |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
330 echo #include "gif_lib.h" >junk.c |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
331 echo main (){} >>junk.c |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
332 rem -o option is ignored with cl, but allows result to be consistent. |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
333 %COMPILER% %usercflags% -c junk.c -o junk.obj |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
334 if exist junk.obj goto haveGif |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
335 |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
336 echo ...building without GIF support. |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
337 set HAVE_GIF= |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
338 goto :gifDone |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
339 |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
340 :haveGif |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
341 echo ...GIF header available, building with GIF support. |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
342 set HAVE_GIF=1 |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
343 |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
344 :gifDone |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
345 rm -f junk.c junk.obj |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
346 |
49544
fdc002872212
Automatically detect tifflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49541
diff
changeset
|
347 if (%tiffsupport%) == (N) goto tiffDone |
fdc002872212
Automatically detect tifflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49541
diff
changeset
|
348 |
fdc002872212
Automatically detect tifflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49541
diff
changeset
|
349 echo Checking for tiff... |
fdc002872212
Automatically detect tifflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49541
diff
changeset
|
350 echo #include "tiffio.h" >junk.c |
fdc002872212
Automatically detect tifflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49541
diff
changeset
|
351 echo main (){} >>junk.c |
fdc002872212
Automatically detect tifflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49541
diff
changeset
|
352 rem -o option is ignored with cl, but allows result to be consistent. |
fdc002872212
Automatically detect tifflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49541
diff
changeset
|
353 %COMPILER% %usercflags% -c junk.c -o junk.obj |
fdc002872212
Automatically detect tifflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49541
diff
changeset
|
354 if exist junk.obj goto haveTiff |
fdc002872212
Automatically detect tifflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49541
diff
changeset
|
355 |
fdc002872212
Automatically detect tifflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49541
diff
changeset
|
356 echo ...building without TIFF support. |
fdc002872212
Automatically detect tifflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49541
diff
changeset
|
357 set HAVE_TIFF= |
fdc002872212
Automatically detect tifflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49541
diff
changeset
|
358 goto :tiffDone |
fdc002872212
Automatically detect tifflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49541
diff
changeset
|
359 |
fdc002872212
Automatically detect tifflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49541
diff
changeset
|
360 :haveTiff |
fdc002872212
Automatically detect tifflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49541
diff
changeset
|
361 echo ...TIFF header available, building with TIFF support. |
fdc002872212
Automatically detect tifflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49541
diff
changeset
|
362 set HAVE_TIFF=1 |
fdc002872212
Automatically detect tifflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49541
diff
changeset
|
363 |
fdc002872212
Automatically detect tifflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49541
diff
changeset
|
364 :tiffDone |
fdc002872212
Automatically detect tifflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49541
diff
changeset
|
365 rm -f junk.c junk.obj |
fdc002872212
Automatically detect tifflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49541
diff
changeset
|
366 |
39055 | 367 rem ---------------------------------------------------------------------- |
368 :genmakefiles | |
369 echo Generating makefiles | |
370 if %COMPILER% == gcc set MAKECMD=gmake | |
371 if %COMPILER% == cl set MAKECMD=nmake | |
372 | |
373 rem Pass on chosen settings to makefiles. | |
374 rem NB. Be very careful to not have a space before redirection symbols | |
375 rem except when there is a preceding digit, when a space is required. | |
376 rem | |
377 echo # Start of settings from configure.bat >config.settings | |
378 echo COMPILER=%COMPILER%>>config.settings | |
379 if (%nodebug%) == (Y) echo NODEBUG=1 >>config.settings | |
380 if (%noopt%) == (Y) echo NOOPT=1 >>config.settings | |
381 if (%nocygwin%) == (Y) echo NOCYGWIN=1 >>config.settings | |
382 if not "(%prefix%)" == "()" echo INSTALL_DIR=%prefix%>>config.settings | |
383 if not "(%usercflags%)" == "()" echo USER_CFLAGS=%usercflags%>>config.settings | |
384 if not "(%userldflags%)" == "()" echo USER_LDFLAGS=%userldflags%>>config.settings | |
385 echo # End of settings from configure.bat>>config.settings | |
386 echo. >>config.settings | |
387 | |
388 copy config.nt ..\src\config.h | |
49450
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
389 echo. >>..\src\config.h |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
390 echo /* Start of settings from configure.bat. */ >>..\src\config.h |
39055 | 391 if not "(%usercflags%)" == "()" echo #define USER_CFLAGS " %usercflags%">>..\src\config.h |
392 if not "(%userldflags%)" == "()" echo #define USER_LDFLAGS " %userldflags%">>..\src\config.h | |
49450
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
393 if not "(%HAVE_PNG%)" == "()" echo #define HAVE_PNG 1 >>..\src\config.h |
49456
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
394 if not "(%HAVE_JPEG%)" == "()" echo #define HAVE_JPEG 1 >>..\src\config.h |
49541
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
395 if not "(%HAVE_GIF%)" == "()" echo #define HAVE_GIF 1 >>..\src\config.h |
49544
fdc002872212
Automatically detect tifflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49541
diff
changeset
|
396 if not "(%HAVE_TIFF%)" == "()" echo #define HAVE_TIFF 1 >>..\src\config.h |
49450
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
397 echo /* End of settings from configure.bat. */ >>..\src\config.h |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
398 |
39055 | 399 copy paths.h ..\src\epaths.h |
400 | |
401 copy /b config.settings+%MAKECMD%.defs+..\nt\makefile.w32-in ..\nt\makefile | |
402 copy /b config.settings+%MAKECMD%.defs+..\lib-src\makefile.w32-in ..\lib-src\makefile | |
403 copy /b config.settings+%MAKECMD%.defs+..\src\makefile.w32-in ..\src\makefile | |
404 if not exist ..\lisp\Makefile.unix rename ..\lisp\Makefile.in Makefile.unix | |
405 if exist ..\lisp\makefile rm -f ../lisp/[Mm]akefile | |
406 copy /b config.settings+%MAKECMD%.defs+..\lisp\makefile.w32-in ..\lisp\makefile | |
407 rem Use the default (no-op) Makefile.in if the nt version is not present. | |
408 if exist ..\leim\makefile.w32-in copy /b config.settings+%MAKECMD%.defs+..\leim\makefile.w32-in ..\leim\makefile | |
409 if not exist ..\leim\makefile.w32-in copy /b config.settings+%MAKECMD%.defs+..\leim\Makefile.in ..\leim\makefile | |
410 del config.settings | |
411 | |
39151
9c15101341c7
Make sure ../site-lisp exists; create if necessary.
Eli Zaretskii <eliz@gnu.org>
parents:
39055
diff
changeset
|
412 Rem Some people use WinZip which doesn't create empty directories! |
9c15101341c7
Make sure ../site-lisp exists; create if necessary.
Eli Zaretskii <eliz@gnu.org>
parents:
39055
diff
changeset
|
413 if not exist ..\site-lisp\nul mkdir ..\site-lisp\ |
39055 | 414 if not exist ..\site-lisp\subdirs.el copy subdirs.el ..\site-lisp\subdirs.el |
415 | |
416 echo. | |
417 echo Emacs successfully configured. | |
418 echo Run `%MAKECMD%' to build, then run `%MAKECMD% install' to install. | |
419 goto end | |
420 | |
421 :SmallEnv | |
422 echo Your environment size is too small. Please enlarge it and rerun configure. | |
423 echo For example, type "command.com /e:2048" to have 2048 bytes available. | |
424 set $foo$= | |
425 :end | |
426 set prefix= | |
427 set nodebug= | |
428 set noopt= | |
429 set nocygwin= | |
430 set COMPILER= | |
431 set MAKECMD= | |
432 set usercflags= | |
433 set userldflags= |