Mercurial > emacs
annotate nt/configure.bat @ 49541:e20de75c7a92
Automatically detect giflib.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Fri, 31 Jan 2003 07:23:20 +0000 |
parents | d717146dfad9 |
children | fdc002872212 |
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 |
39055 | 91 if "%1" == "" goto checkutils |
92 :usage | |
93 echo Usage: configure [options] | |
94 echo Options: | |
95 echo. --prefix PREFIX install Emacs in directory PREFIX | |
96 echo. --with-gcc use GCC to compile Emacs | |
97 echo. --with-msvc use MSVC to compile Emacs | |
98 echo. --no-debug exclude debug info from executables | |
99 echo. --no-opt disable optimization | |
100 echo. --no-cygwin use -mno-cygwin option with GCC | |
101 echo. --cflags FLAG pass FLAG to compiler | |
102 echo. --ldflags FLAG pass FLAG to compiler when linking | |
49484 | 103 echo. --without-png do not use libpng even if it is installed |
104 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
|
105 echo. --without-gif do not use giflib even if it is installed |
39055 | 106 goto end |
107 rem ---------------------------------------------------------------------- | |
108 :setprefix | |
109 shift | |
110 set prefix=%1 | |
111 shift | |
112 goto again | |
113 rem ---------------------------------------------------------------------- | |
114 :withgcc | |
115 set COMPILER=gcc | |
116 shift | |
117 goto again | |
118 rem ---------------------------------------------------------------------- | |
119 :withmsvc | |
120 set COMPILER=cl | |
121 shift | |
122 goto again | |
123 rem ---------------------------------------------------------------------- | |
124 :nodebug | |
125 set nodebug=Y | |
126 shift | |
127 goto again | |
128 rem ---------------------------------------------------------------------- | |
129 :noopt | |
130 set noopt=Y | |
131 shift | |
132 goto again | |
133 rem ---------------------------------------------------------------------- | |
134 :nocygwin | |
135 set nocygwin=Y | |
136 shift | |
137 goto again | |
138 rem ---------------------------------------------------------------------- | |
139 :usercflags | |
140 shift | |
141 set usercflags=%usercflags%%sep1%%1 | |
142 set sep1= %nothing% | |
143 shift | |
144 goto again | |
145 rem ---------------------------------------------------------------------- | |
146 :userldflags | |
147 shift | |
148 set userldflags=%userldflags%%sep2%%1 | |
149 set sep2= %nothing% | |
150 shift | |
151 goto again | |
49450
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
152 rem ---------------------------------------------------------------------- |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
153 |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
154 :withoutpng |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
155 set pngsupport=N |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
156 set HAVE_PNG= |
49510
d717146dfad9
Avoid endless loop when configuring without image support.
Juanma Barranquero <lekktu@gmail.com>
parents:
49484
diff
changeset
|
157 shift |
49450
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
158 goto again |
39055 | 159 |
160 rem ---------------------------------------------------------------------- | |
49456
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
161 |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
162 :withoutjpeg |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
163 set jpegsupport=N |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
164 set HAVE_JPEG= |
49510
d717146dfad9
Avoid endless loop when configuring without image support.
Juanma Barranquero <lekktu@gmail.com>
parents:
49484
diff
changeset
|
165 shift |
49456
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
166 goto again |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
167 |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
168 rem ---------------------------------------------------------------------- |
49541
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
169 |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
170 :withoutgif |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
171 set gifsupport=N |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
172 set HAVE_GIF= |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
173 shift |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
174 goto again |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
175 |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
176 rem ---------------------------------------------------------------------- |
39055 | 177 rem Check that necessary utilities (cp and rm) are present. |
178 :checkutils | |
179 echo Checking for 'cp'... | |
180 cp configure.bat junk.bat | |
181 if not exist junk.bat goto needcp | |
182 echo Checking for 'rm'... | |
183 rm junk.bat | |
184 if exist junk.bat goto needrm | |
185 goto checkcompiler | |
186 :needcp | |
187 echo You need 'cp' (the Unix file copy program) to build Emacs. | |
188 goto end | |
189 :needrm | |
190 del junk.bat | |
191 echo You need 'rm' (the Unix file delete program) to build Emacs. | |
192 goto end | |
193 | |
194 rem ---------------------------------------------------------------------- | |
195 rem Auto-detect compiler if not specified, and validate GCC if chosen. | |
196 :checkcompiler | |
49450
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
197 if (%COMPILER%)==(cl) goto compilercheckdone |
39055 | 198 if (%COMPILER%)==(gcc) goto checkgcc |
199 | |
200 echo Checking whether 'cl' is available... | |
201 echo main(){} >junk.c | |
202 cl -nologo -c junk.c | |
203 if exist junk.obj goto clOK | |
204 | |
205 echo Checking whether 'gcc' is available... | |
206 gcc -c junk.c | |
207 if not exist junk.o goto nocompiler | |
208 del junk.o | |
209 | |
210 :checkgcc | |
211 Rem WARNING -- COMMAND.COM on some systems only looks at the first | |
212 Rem 8 characters of a label. So do NOT be tempted to change | |
213 Rem chkapi* into something fancier like checkw32api | |
214 Rem You HAVE been warned! | |
215 if (%nocygwin%) == (Y) goto chkapi | |
216 echo Checking whether gcc requires '-mno-cygwin'... | |
217 echo #include "cygwin/version.h" >junk.c | |
218 echo main(){} >>junk.c | |
219 gcc -c junk.c | |
220 if not exist junk.o goto chkapi | |
221 gcc -mno-cygwin -c junk.c | |
222 if exist junk.o set nocygwin=Y | |
223 rm -f junk.c junk.o | |
224 | |
225 :chkapi | |
226 rem ---------------------------------------------------------------------- | |
227 rem Older versions of the Windows API headers either don't have any of | |
228 rem the IMAGE_xxx definitions (the headers that come with Cygwin b20.1 | |
229 rem are like this), or have a typo in the definition of | |
230 rem IMAGE_FIRST_SECTION (the headers with gcc/mingw32 2.95 have this | |
231 rem problem). The gcc/mingw32 2.95.2 headers are okay, as are distros | |
232 rem of w32api-xxx.zip from Anders Norlander since 1999-11-18 at least. | |
233 rem | |
234 echo Checking whether W32 API headers are too old... | |
235 echo #include "windows.h" >junk.c | |
236 echo test(PIMAGE_NT_HEADERS pHeader) >>junk.c | |
237 echo {PIMAGE_SECTION_HEADER pSection = IMAGE_FIRST_SECTION(pHeader);} >>junk.c | |
238 if (%nocygwin%) == (Y) goto chkapi1 | |
239 set cf=%usercflags% | |
240 goto chkapi2 | |
241 :chkapi1 | |
242 set cf=%usercflags% -mno-cygwin | |
243 :chkapi2 | |
244 echo on | |
245 gcc %cf% -c junk.c | |
246 echo off | |
247 set cf= | |
248 if exist junk.o goto gccOk | |
249 | |
250 :nocompiler | |
251 echo. | |
252 echo Configure failed. | |
253 echo To configure Emacs for Windows, you need to have either | |
254 echo gcc-2.95 or later with Mingw32 and the W32 API headers, | |
255 echo or MSVC 2.x or later. | |
256 del junk.c | |
257 goto end | |
258 | |
259 :gccOk | |
260 set COMPILER=gcc | |
261 rm -f junk.c junk.o | |
262 echo Using 'gcc' | |
49450
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
263 goto compilercheckdone |
39055 | 264 |
265 :clOk | |
266 set COMPILER=cl | |
267 rm -f junk.c junk.obj | |
268 echo Using 'MSVC' | |
49450
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
269 |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
270 :compilercheckdone |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
271 |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
272 rem ---------------------------------------------------------------------- |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
273 rem Check for external image libraries. Since they are loaded |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
274 rem dynamically, the libraries themselves do not need to be present |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
275 rem at compile time, but the header files are required. |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
276 |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
277 if (%pngsupport%) == (N) goto pngDone |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
278 |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
279 echo Checking for libpng... |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
280 echo #include "png.h" >junk.c |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
281 echo main (){} >>junk.c |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
282 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
|
283 %COMPILER% %usercflags% -c junk.c -o junk.obj |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
284 if exist junk.obj goto havePng |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
285 |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
286 echo ...building without PNG support. |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
287 set HAVE_PNG= |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
288 goto :pngDone |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
289 |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
290 :havePng |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
291 echo ...PNG header available, building with PNG support. |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
292 set HAVE_PNG=1 |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
293 |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
294 :pngDone |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
295 rm -f junk.c junk.obj |
39055 | 296 |
49456
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
297 if (%jpegsupport%) == (N) goto jpegDone |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
298 |
49541
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
299 echo Checking for jpeg... |
49456
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
300 echo #include "jconfig.h" >junk.c |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
301 echo main (){} >>junk.c |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
302 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
|
303 %COMPILER% %usercflags% -c junk.c -o junk.obj |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
304 if exist junk.obj goto haveJpeg |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
305 |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
306 echo ...building without JPEG support. |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
307 set HAVE_JPEG= |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
308 goto :jpegDone |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
309 |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
310 :haveJpeg |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
311 echo ...JPEG header available, building with JPEG support. |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
312 set HAVE_JPEG=1 |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
313 |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
314 :jpegDone |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
315 rm -f junk.c junk.obj |
8511f51a1d4f
Automatically detect jpeglib.
Jason Rumney <jasonr@gnu.org>
parents:
49450
diff
changeset
|
316 |
49541
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
317 if (%gifsupport%) == (N) goto gifDone |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
318 |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
319 echo Checking for gif... |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
320 echo #include "gif_lib.h" >junk.c |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
321 echo main (){} >>junk.c |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
322 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
|
323 %COMPILER% %usercflags% -c junk.c -o junk.obj |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
324 if exist junk.obj goto haveGif |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
325 |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
326 echo ...building without GIF support. |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
327 set HAVE_GIF= |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
328 goto :gifDone |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
329 |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
330 :haveGif |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
331 echo ...GIF header available, building with GIF support. |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
332 set HAVE_GIF=1 |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
333 |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
334 :gifDone |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
335 rm -f junk.c junk.obj |
e20de75c7a92
Automatically detect giflib.
Juanma Barranquero <lekktu@gmail.com>
parents:
49510
diff
changeset
|
336 |
39055 | 337 rem ---------------------------------------------------------------------- |
338 :genmakefiles | |
339 echo Generating makefiles | |
340 if %COMPILER% == gcc set MAKECMD=gmake | |
341 if %COMPILER% == cl set MAKECMD=nmake | |
342 | |
343 rem Pass on chosen settings to makefiles. | |
344 rem NB. Be very careful to not have a space before redirection symbols | |
345 rem except when there is a preceding digit, when a space is required. | |
346 rem | |
347 echo # Start of settings from configure.bat >config.settings | |
348 echo COMPILER=%COMPILER%>>config.settings | |
349 if (%nodebug%) == (Y) echo NODEBUG=1 >>config.settings | |
350 if (%noopt%) == (Y) echo NOOPT=1 >>config.settings | |
351 if (%nocygwin%) == (Y) echo NOCYGWIN=1 >>config.settings | |
352 if not "(%prefix%)" == "()" echo INSTALL_DIR=%prefix%>>config.settings | |
353 if not "(%usercflags%)" == "()" echo USER_CFLAGS=%usercflags%>>config.settings | |
354 if not "(%userldflags%)" == "()" echo USER_LDFLAGS=%userldflags%>>config.settings | |
355 echo # End of settings from configure.bat>>config.settings | |
356 echo. >>config.settings | |
357 | |
358 copy config.nt ..\src\config.h | |
49450
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
359 echo. >>..\src\config.h |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
360 echo /* Start of settings from configure.bat. */ >>..\src\config.h |
39055 | 361 if not "(%usercflags%)" == "()" echo #define USER_CFLAGS " %usercflags%">>..\src\config.h |
362 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
|
363 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
|
364 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
|
365 if not "(%HAVE_GIF%)" == "()" echo #define HAVE_GIF 1 >>..\src\config.h |
49450
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
366 echo /* End of settings from configure.bat. */ >>..\src\config.h |
a2e59f9d34b1
Automatically detect libpng.
Jason Rumney <jasonr@gnu.org>
parents:
39151
diff
changeset
|
367 |
39055 | 368 copy paths.h ..\src\epaths.h |
369 | |
370 copy /b config.settings+%MAKECMD%.defs+..\nt\makefile.w32-in ..\nt\makefile | |
371 copy /b config.settings+%MAKECMD%.defs+..\lib-src\makefile.w32-in ..\lib-src\makefile | |
372 copy /b config.settings+%MAKECMD%.defs+..\src\makefile.w32-in ..\src\makefile | |
373 if not exist ..\lisp\Makefile.unix rename ..\lisp\Makefile.in Makefile.unix | |
374 if exist ..\lisp\makefile rm -f ../lisp/[Mm]akefile | |
375 copy /b config.settings+%MAKECMD%.defs+..\lisp\makefile.w32-in ..\lisp\makefile | |
376 rem Use the default (no-op) Makefile.in if the nt version is not present. | |
377 if exist ..\leim\makefile.w32-in copy /b config.settings+%MAKECMD%.defs+..\leim\makefile.w32-in ..\leim\makefile | |
378 if not exist ..\leim\makefile.w32-in copy /b config.settings+%MAKECMD%.defs+..\leim\Makefile.in ..\leim\makefile | |
379 del config.settings | |
380 | |
39151
9c15101341c7
Make sure ../site-lisp exists; create if necessary.
Eli Zaretskii <eliz@gnu.org>
parents:
39055
diff
changeset
|
381 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
|
382 if not exist ..\site-lisp\nul mkdir ..\site-lisp\ |
39055 | 383 if not exist ..\site-lisp\subdirs.el copy subdirs.el ..\site-lisp\subdirs.el |
384 | |
385 echo. | |
386 echo Emacs successfully configured. | |
387 echo Run `%MAKECMD%' to build, then run `%MAKECMD% install' to install. | |
388 goto end | |
389 | |
390 :SmallEnv | |
391 echo Your environment size is too small. Please enlarge it and rerun configure. | |
392 echo For example, type "command.com /e:2048" to have 2048 bytes available. | |
393 set $foo$= | |
394 :end | |
395 set prefix= | |
396 set nodebug= | |
397 set noopt= | |
398 set nocygwin= | |
399 set COMPILER= | |
400 set MAKECMD= | |
401 set usercflags= | |
402 set userldflags= |