root/trunk/nt/configure.meadow.bat

Revision 4068, 12.5 kB (checked in by miyoshi, 2 years ago)

* mw32term.h: Include <imm.h> explicitly.
Consider HAVE_RECONVERTSTRING' to define RECONVERTSTRING'.

* configure.meadow.bat: Check if the platform has
`RECONVERTSTRING'.

  • Property svn:eol-style set to CRLF
  • Property svn:executable set to
Line 
1 @echo off
2 rem   ----------------------------------------------------------------------
3 rem   Configuration script for MS Windows 95/98/Me and NT/2000/XP
4 rem   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
5 rem      Free Software Foundation, Inc.
6
7 rem   This file is part of GNU Emacs.
8
9 rem   GNU Emacs is free software; you can redistribute it and/or modify
10 rem   it under the terms of the GNU General Public License as published by
11 rem   the Free Software Foundation; either version 2, or (at your option)
12 rem   any later version.
13
14 rem   GNU Emacs is distributed in the hope that it will be useful,
15 rem   but WITHOUT ANY WARRANTY; without even the implied warranty of
16 rem   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 rem   GNU General Public License for more details.
18
19 rem   You should have received a copy of the GNU General Public License
20 rem   along with GNU Emacs; see the file COPYING.  If not, write to the
21 rem   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 rem   Boston, MA 02111-1307, USA.
23 rem   ----------------------------------------------------------------------
24 rem   YOU'LL NEED THE FOLLOWING UTILITIES TO MAKE EMACS:
25 rem
26 rem   + MS Windows 95/98 or NT/2000
27 rem   + either MSVC 2.x or later, or gcc-2.95 or later (with gmake 3.75
28 rem     or later) and the Mingw32 and W32 API headers and libraries
29 rem
30 rem For reference, here is a list of which builds of gmake are known to
31 rem work or not, and whether they work in the presence and/or absence of
32 rem sh.exe.
33 rem 
34 rem                                       sh exists     no sh
35 rem  cygwin b20.1 make (3.75):            okay[1]       fails[2]
36 rem  MSVC compiled gmake 3.77:            okay          okay
37 rem  MSVC compiled gmake 3.78.1:          okay          okay
38 rem  MSVC compiled gmake 3.79.1:          okay          okay
39 rem  mingw32/gcc-2.92.2 make (3.77):      okay          okay
40 rem  cygwin compiled gmake 3.77:          okay[1]       fails[2]
41 rem  cygwin compiled gmake 3.78.1:        okay          fails[2]
42 rem  cygwin compiled gmake 3.79.1:        couldn't build make[3]
43 rem
44 rem [1] doesn't cope with makefiles with DOS line endings, so must mount
45 rem     emacs source with text!=binary.
46 rem [2] fails when needs to invoke shell commands; okay invoking gcc etc.
47 rem [3] requires LC_MESSAGES support to build; maybe 2.95.x update to
48 rem     cygwin provides this?
49 rem
50
51 rem ----------------------------------------------------------------------
52 rem   See if the environment is large enough.  We need 43 (?) bytes.
53 set $foo$=123456789_123456789_123456789_123456789_123
54 if not "%$foo$%" == "123456789_123456789_123456789_123456789_123" goto SmallEnv
55 set $foo$=
56
57 rem ----------------------------------------------------------------------
58 rem   Make sure we are running in the nt subdir
59 if exist configure.bat goto start
60 echo You must run configure from the nt subdirectory.
61 goto end
62
63 :start
64 rem ----------------------------------------------------------------------
65 rem   Default settings.
66 set prefix=
67 set nodebug=N
68 set noopt=N
69 set nocygwin=N
70 set COMPILER=
71 set usercflags=
72 set userldflags=
73 set sep1=
74 set sep2=
75
76 rem ----------------------------------------------------------------------
77 rem   Handle arguments.
78 :again
79 if "%1" == "-h" goto usage
80 if "%1" == "--help" goto usage
81 if "%1" == "--prefix" goto setprefix
82 if "%1" == "--with-gcc" goto withgcc
83 if "%1" == "--with-msvc" goto withmsvc
84 if "%1" == "--no-debug" goto nodebug
85 if "%1" == "--no-opt" goto noopt
86 if "%1" == "--no-cygwin" goto nocygwin
87 if "%1" == "--cflags" goto usercflags
88 if "%1" == "--ldflags" goto userldflags
89 if "%1" == "" goto checkutils
90 :usage
91 echo Usage: configure [options]
92 echo Options:
93 echo.   --prefix PREFIX         install Emacs in directory PREFIX
94 echo.   --with-gcc              use GCC to compile Emacs
95 echo.   --with-msvc             use MSVC to compile Emacs
96 echo.   --no-debug              exclude debug info from executables
97 echo.   --no-opt                disable optimization
98 echo.   --no-cygwin             use -mno-cygwin option with GCC
99 echo.   --cflags FLAG           pass FLAG to compiler
100 echo.   --ldflags FLAG          pass FLAG to compiler when linking
101 goto end
102 rem ----------------------------------------------------------------------
103 :setprefix
104 shift
105 set prefix=%1
106 shift
107 goto again
108 rem ----------------------------------------------------------------------
109 :withgcc
110 set COMPILER=gcc
111 shift
112 goto again
113 rem ----------------------------------------------------------------------
114 :withmsvc
115 set COMPILER=cl
116 shift
117 goto again
118 rem ----------------------------------------------------------------------
119 :nodebug
120 set nodebug=Y
121 shift
122 goto again
123 rem ----------------------------------------------------------------------
124 :noopt
125 set noopt=Y
126 shift
127 goto again
128 rem ----------------------------------------------------------------------
129 :nocygwin
130 set nocygwin=Y
131 shift
132 goto again
133 rem ----------------------------------------------------------------------
134 :usercflags
135 shift
136 set usercflags=%usercflags%%sep1%%1
137 set sep1= %nothing%
138 shift
139 goto again
140 rem ----------------------------------------------------------------------
141 :userldflags
142 shift
143 set userldflags=%userldflags%%sep2%%1
144 set sep2= %nothing%
145 shift
146 goto again
147
148 rem ----------------------------------------------------------------------
149 rem    Check that necessary utilities (cp and rm) are present.
150 :checkutils
151 rem In case of cl and nmake, cp and rm are not required.
152 rem So this test is skipped.
153 if (%COMPILER%)==(cl) goto checkcompiler
154 echo Checking for 'cp'...
155 cp configure.bat junk.bat
156 if not exist junk.bat goto needcp
157 echo Checking for 'rm'...
158 rm junk.bat
159 if exist junk.bat goto needrm
160 goto checkcompiler
161 :needcp
162 echo You need 'cp' (the Unix file copy program) to build Emacs.
163 goto end
164 :needrm
165 del junk.bat
166 echo You need 'rm' (the Unix file delete program) to build Emacs.
167 goto end
168
169 rem ----------------------------------------------------------------------
170 rem   Auto-detect compiler if not specified, and validate GCC if chosen.
171 :checkcompiler
172 if (%COMPILER%)==(cl) goto genmakefiles
173 if (%COMPILER%)==(gcc) goto checkgcc
174
175 echo Checking whether 'cl' is available...
176 echo main(){} >junk.c
177 cl -nologo -c junk.c
178 if exist junk.obj goto clOK
179
180 echo Checking whether 'gcc' is available...
181 gcc -c junk.c
182 if not exist junk.o goto nocompiler
183 del junk.o
184
185 :checkgcc
186 Rem WARNING -- COMMAND.COM on some systems only looks at the first
187 Rem            8 characters of a label.  So do NOT be tempted to change
188 Rem            chkapi* into something fancier like checkw32api
189 Rem You HAVE been warned!
190 if (%nocygwin%) == (Y) goto chkapi
191 echo Checking whether gcc requires '-mno-cygwin'...
192 echo #include "cygwin/version.h" >junk.c
193 echo main(){} >>junk.c
194 gcc -c junk.c
195 if not exist junk.o goto chkapi
196 gcc -mno-cygwin -c junk.c
197 if exist junk.o set nocygwin=Y
198 rm -f junk.c junk.o
199
200 :chkapi
201 rem ----------------------------------------------------------------------
202 rem   Older versions of the Windows API headers either don't have any of
203 rem   the IMAGE_xxx definitions (the headers that come with Cygwin b20.1
204 rem   are like this), or have a typo in the definition of
205 rem   IMAGE_FIRST_SECTION (the headers with gcc/mingw32 2.95 have this
206 rem   problem).  The gcc/mingw32 2.95.2 headers are okay, as are distros
207 rem   of w32api-xxx.zip from Anders Norlander since 1999-11-18 at least.
208 rem
209 echo Checking whether W32 API headers are too old...
210 echo #include "windows.h" >junk.c
211 echo test(PIMAGE_NT_HEADERS pHeader) >>junk.c
212 echo {PIMAGE_SECTION_HEADER pSection = IMAGE_FIRST_SECTION(pHeader);} >>junk.c
213 if (%nocygwin%) == (Y) goto chkapi1
214 set cf=%usercflags%
215 goto chkapi2
216 :chkapi1
217 set cf=%usercflags% -mno-cygwin
218 :chkapi2
219 echo on
220 gcc %cf% -c junk.c
221 @echo off
222 set cf=
223 if exist junk.o goto gccOk
224
225 :nocompiler
226 echo.
227 echo Configure failed.
228 echo To configure Emacs for Windows, you need to have either
229 echo gcc-2.95 or later with Mingw32 and the W32 API headers,
230 echo or MSVC 2.x or later.
231 del junk.c
232 goto end
233
234 :gccOk
235 set COMPILER=gcc
236 echo Using 'gcc'
237 rm -f junk.c junk.o
238 Rem It is not clear what GCC version began supporting -mtune
239 Rem and i686 on x86, so check this explicitly.
240 echo main(){} >junk.c
241 gcc -c -O2 -mtune=i686 junk.c
242 if not errorlevel 1 goto gccMtuneOk
243 set mf=-mcpu=i686
244 rm -f junk.c junk.o
245 goto genmakefiles
246 :gccMtuneOk
247 echo GCC supports -mtune=i686
248 set mf=-mtune=i686
249 rm -f junk.c junk.o
250 goto genmakefiles
251
252 :clOk
253 set COMPILER=cl
254 rm -f junk.c junk.obj
255 echo Using 'MSVC'
256 goto genmakefiles
257
258 rem ----------------------------------------------------------------------
259 :genmakefiles
260 echo Generating makefiles
261 if %COMPILER% == gcc set MAKECMD=gmake
262 if %COMPILER% == cl set MAKECMD=nmake
263
264 rem   Pass on chosen settings to makefiles.
265 rem   NB. Be very careful to not have a space before redirection symbols
266 rem   except when there is a preceding digit, when a space is required.
267 rem
268 echo # Start of settings from configure.bat >config.settings
269 echo COMPILER=%COMPILER%>>config.settings
270 if not "(%mf%)" == "()" echo MCPU_FLAG=%mf%>>config.settings
271 if (%nodebug%) == (Y) echo NODEBUG=1 >>config.settings
272 if (%noopt%) == (Y) echo NOOPT=1 >>config.settings
273 if (%nocygwin%) == (Y) echo NOCYGWIN=1 >>config.settings
274 if not "(%prefix%)" == "()" echo INSTALL_DIR=%prefix%>>config.settings
275 if not "(%usercflags%)" == "()" echo USER_CFLAGS=%usercflags%>>config.settings
276 if not "(%userldflags%)" == "()" echo USER_LDFLAGS=%userldflags%>>config.settings
277 echo # End of settings from configure.bat>>config.settings
278 echo. >>config.settings
279
280 copy config.nt ..\src\config.h
281 if not "(%usercflags%)" == "()" echo #define USER_CFLAGS " %usercflags%">>..\src\config.h
282 if not "(%userldflags%)" == "()" echo #define USER_LDFLAGS " %userldflags%">>..\src\config.h
283 copy paths.h ..\src\epaths.h
284
285 copy /b config.settings+%MAKECMD%.mw32.defs+..\nt\makefile.mw32-in ..\nt\makefile
286 copy /b config.settings+%MAKECMD%.mw32.defs+..\lib-src\makefile.mw32-in ..\lib-src\makefile
287 copy /b config.settings+%MAKECMD%.mw32.defs+..\src\makefile.mw32-in ..\src\makefile
288 copy /b config.settings+%MAKECMD%.mw32.defs+..\man\makefile.w32-in ..\man\makefile
289 copy /b config.settings+%MAKECMD%.mw32.defs+..\lispref\makefile.w32-in ..\lispref\makefile
290 copy /b config.settings+%MAKECMD%.mw32.defs+..\lispintro\makefile.w32-in ..\lispintro\makefile
291 if exist ..\lisp\makefile rm -f ../lisp/[Mm]akefile
292 copy /b config.settings+%MAKECMD%.mw32.defs+..\lisp\makefile.mw32-in ..\lisp\makefile
293 rem   Use the default (no-op) Makefile.in if the nt version is not present.
294 if exist ..\leim\makefile.mw32-in copy /b config.settings+%MAKECMD%.mw32.defs+..\leim\makefile.mw32-in ..\leim\makefile
295 if not exist ..\leim\makefile.mw32-in copy /b config.settings+%MAKECMD%.mw32.defs+..\leim\Makefile.in ..\leim\makefile
296
297 del config.settings
298
299 rem
300 rem check for capabilities of the platform
301 rem
302
303 echo.>>..\src\config.h
304 echo /* Start of settings from configure.bat.  */>>..\src\config.h
305 echo.>>..\src\config.h
306
307 rem for gcc
308 set JUNK_SRC=junk.c
309 set CC_OPT=-DWINVER=0x0400
310 set JUNK_OBJ=junk.o
311
312 if %COMPILER%==gcc goto check_capability
313 rem for VC
314 set JUNK_OBJ=junk.obj
315 set CC_OPT=-nologo %CC_OPT%
316
317 :check_capability
318
319 rem
320 rem check for RECONVERTSTRING
321 rem
322
323 set TARGET=HAVE_RECONVERTSTRING
324 echo checking for RECONVERTSTRING
325
326 echo #include "windows.h" >junk.c
327 echo #include "imm.h" >>junk.c
328 echo main(){RECONVERTSTRING x;} >>junk.c
329
330 %COMPILER% %CC_OPT% -c %JUNK_SRC% >config.capability 2>&1
331 if exist %JUNK_OBJ% goto RECONVERTSTRING_yes
332 echo ...no
333 echo #undef %TARGET% >>..\src\config.h
334 goto RECONVERTSTRING_cnt
335
336 :RECONVERTSTRING_yes
337 echo ...yes
338 echo #define %TARGET% >>..\src\config.h
339
340 :RECONVERTSTRING_cnt
341 rm -f %JUNK_SRC% %JUNK_OBJ%
342
343 echo.>>..\src\config.h
344 echo /* End of settings from configure.bat.  */>>..\src\config.h
345
346 rm config.capability
347
348 rem
349 rem end of checking for capabilities
350 rem
351
352 Rem Some people use WinZip which doesn't create empty directories!
353 if not exist ..\site-lisp\nul mkdir ..\site-lisp\
354 if not exist ..\site-lisp\subdirs.el copy subdirs.el ..\site-lisp\subdirs.el
355
356
357 echo.
358 echo Emacs successfully configured.
359 echo Run `%MAKECMD% bootstrap' and '%MAKECMD% all' to build,
360 echo then run `%MAKECMD% install INSTALL_DIR=X:/...' to install.
361 goto end
362
363 :SmallEnv
364 echo Your environment size is too small.  Please enlarge it and rerun configure.
365 echo For example, type "command.com /e:2048" to have 2048 bytes available.
366 set $foo$=
367 :end
368 set prefix=
369 set nodebug=
370 set noopt=
371 set nocygwin=
372 set COMPILER=
373 set MAKECMD=
374 set usercflags=
375 set userldflags=
Note: See TracBrowser for help on using the browser.