aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Key2011-04-15 17:48:00 -0500
committerBen Key2011-04-15 17:48:00 -0500
commit4a1a6b5b7d2208cf504cf38e548d3c562f6cfbb3 (patch)
treeeb9b18d15d8b7b6b4ecc961ff8bd0495ffebfb54
parentba3bd5b6c3771010fa37ec48170eee8323b55bf1 (diff)
downloademacs-4a1a6b5b7d2208cf504cf38e548d3c562f6cfbb3.tar.gz
emacs-4a1a6b5b7d2208cf504cf38e548d3c562f6cfbb3.zip
Modified the code that parses the --cflags and --ldflags options to support parameters that include the = character as long as they are enclosed in quotes.
-rw-r--r--nt/ChangeLog14
-rw-r--r--nt/INSTALL24
-rwxr-xr-xnt/configure.bat49
3 files changed, 80 insertions, 7 deletions
diff --git a/nt/ChangeLog b/nt/ChangeLog
index 155ee41d9da..19f71ba0af3 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,17 @@
12011-04-15 Ben Key <bkey76@gmail.com>
2
3 * configure.bat: Modified the code that parses the --cflags and
4 --ldflags options to support parameters that include the =
5 character as long as they are enclosed in quotes. This
6 functionality depends on command extensions. Configure.bat now
7 attempts to enable command extensions and displays a warning
8 message if they could not be enabled. If configure.bat could
9 not enable command extensions the old parsing code is used that
10 does not support parameters that include the = character.
11
12 * INSTALL: Updated the file to describe the new functionality
13 using text provided by Eli Zaretskii.
14
12011-04-06 Eli Zaretskii <eliz@gnu.org> 152011-04-06 Eli Zaretskii <eliz@gnu.org>
2 16
3 * config.nt (NO_INLINE, ATTRIBUTE_FORMAT) 17 * config.nt (NO_INLINE, ATTRIBUTE_FORMAT)
diff --git a/nt/INSTALL b/nt/INSTALL
index a0ca4a1ebb5..dfcfa8a205a 100644
--- a/nt/INSTALL
+++ b/nt/INSTALL
@@ -220,13 +220,23 @@
220 absolutely sure the produced binaries will never need to be run under 220 absolutely sure the produced binaries will never need to be run under
221 a debugger. 221 a debugger.
222 222
223 Because of limitations of the stock Windows command shell, certain 223 Because of limitations of the stock Windows command shells, special
224 characters (quotes, backslashes and equal signs) can be problematic 224 care is needed to pass some characters in the arguments of the
225 and should not be used in arguments to configure. That means that 225 --cflags and --ldflags options. Backslashes should not be used in
226 forward slashes must be used in paths passed to the compiler and 226 file names passed to the compiler and linker via these options. Use
227 linker via the --cflags and --ldflags options, and that it is 227 forward slashes instead. If the arguments to these two options
228 currently not possible to pass a macro like -DFOO=BAR (though -DFOO 228 include the `=' character, like when passing a -DFOO=bar preprocessor
229 is perfectly valid). 229 option, the argument with the `=' character should be enclosed in
230 quotes, like this:
231
232 configure --cflags "-DFOO=bar"
233
234 Support for options that include the `=' character require "command
235 extensions" to be enabled. (They are enabled by default, but your
236 system administrator could have changed that. See "cmd /?" for
237 details.) If command extensions are disabled, a warning message might
238 be displayed informing you that "using parameters that include the =
239 character by enclosing them in quotes will not be supported."
230 240
231 N.B. It is normal to see a few error messages output while configure 241 N.B. It is normal to see a few error messages output while configure
232 is running, when gcc support is being tested. These cannot be 242 is running, when gcc support is being tested. These cannot be
diff --git a/nt/configure.bat b/nt/configure.bat
index 1450650304d..699a33bc2eb 100755
--- a/nt/configure.bat
+++ b/nt/configure.bat
@@ -75,6 +75,19 @@ goto end
75 75
76:start 76:start
77rem ---------------------------------------------------------------------- 77rem ----------------------------------------------------------------------
78rem Attempt to enable command extensions. Set use_extensions to 1 if
79rem they are available and 0 if they are not available.
80set use_extensions=1
81setlocal ENABLEEXTENSIONS
82if "%CMDEXTVERSION%" == "" set use_extensions=0
83if "%use_extensions%" == "1" goto afterext
84
85echo. Command extensions are not available. Using parameters that include the =
86echo. character by enclosing them in quotes will not be supported.
87
88:afterext
89
90rem ----------------------------------------------------------------------
78rem Default settings. 91rem Default settings.
79set prefix= 92set prefix=
80set nodebug=N 93set nodebug=N
@@ -136,6 +149,20 @@ echo. --without-tiff do not use TIFF library even if it is installed
136echo. --without-xpm do not use XPM library even if it is installed 149echo. --without-xpm do not use XPM library even if it is installed
137echo. --with-svg use the RSVG library (experimental) 150echo. --with-svg use the RSVG library (experimental)
138echo. --distfiles path to files for make dist, e.g. libXpm.dll 151echo. --distfiles path to files for make dist, e.g. libXpm.dll
152if "%use_extensions%" == "0" goto end
153echo.
154echo. The cflags and ldflags arguments support parameters that include the =
155echo. character. However, since the = character is normally treated as a
156echo. separator character you will need to enclose any parameter that includes
157echo. the = character in quotes. For example, to include
158echo. -DSITELOAD_PURESIZE_EXTRA=100000 as one of the cflags you would run
159echo. configure.bat as follows:
160echo. configure.bat --cflags "-DSITELOAD_PURESIZE_EXTRA=100000"
161echo.
162echo. Note that this capability of processing parameters that include the =
163echo. character depends on command extensions. This batch file attempts to
164echo. enable command extensions. If command extensions cannot be enabled, a
165echo. warning message will be displayed.
139goto end 166goto end
140 167
141rem ---------------------------------------------------------------------- 168rem ----------------------------------------------------------------------
@@ -198,6 +225,17 @@ goto again
198rem ---------------------------------------------------------------------- 225rem ----------------------------------------------------------------------
199 226
200:usercflags 227:usercflags
228if "%use_extensions%" == "1" goto ucflagex
229goto ucflagne
230
231:ucflagex
232shift
233set usercflags=%usercflags%%sep1%%~1
234set sep1= %nothing%
235shift
236goto again
237
238:ucflagne
201shift 239shift
202set usercflags=%usercflags%%sep1%%1 240set usercflags=%usercflags%%sep1%%1
203set sep1= %nothing% 241set sep1= %nothing%
@@ -207,6 +245,17 @@ goto again
207rem ---------------------------------------------------------------------- 245rem ----------------------------------------------------------------------
208 246
209:userldflags 247:userldflags
248if "%use_extensions%" == "1" goto ulflagex
249goto ulflagne
250
251:ulflagex
252shift
253set userldflags=%userldflags%%sep2%%~1
254set sep2= %nothing%
255shift
256goto again
257
258:ulflagne
210shift 259shift
211set userldflags=%userldflags%%sep2%%1 260set userldflags=%userldflags%%sep2%%1
212set sep2= %nothing% 261set sep2= %nothing%