+2011-04-15 Ben Key <bkey76@gmail.com>
+
+ * configure.bat: 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. This
+ functionality depends on command extensions. Configure.bat now
+ attempts to enable command extensions and displays a warning
+ message if they could not be enabled. If configure.bat could
+ not enable command extensions the old parsing code is used that
+ does not support parameters that include the = character.
+
+ * INSTALL: Updated the file to describe the new functionality
+ using text provided by Eli Zaretskii.
+
2011-04-06 Eli Zaretskii <eliz@gnu.org>
* config.nt (NO_INLINE, ATTRIBUTE_FORMAT)
absolutely sure the produced binaries will never need to be run under
a debugger.
- Because of limitations of the stock Windows command shell, certain
- characters (quotes, backslashes and equal signs) can be problematic
- and should not be used in arguments to configure. That means that
- forward slashes must be used in paths passed to the compiler and
- linker via the --cflags and --ldflags options, and that it is
- currently not possible to pass a macro like -DFOO=BAR (though -DFOO
- is perfectly valid).
+ Because of limitations of the stock Windows command shells, special
+ care is needed to pass some characters in the arguments of the
+ --cflags and --ldflags options. Backslashes should not be used in
+ file names passed to the compiler and linker via these options. Use
+ forward slashes instead. If the arguments to these two options
+ include the `=' character, like when passing a -DFOO=bar preprocessor
+ option, the argument with the `=' character should be enclosed in
+ quotes, like this:
+
+ configure --cflags "-DFOO=bar"
+
+ Support for options that include the `=' character require "command
+ extensions" to be enabled. (They are enabled by default, but your
+ system administrator could have changed that. See "cmd /?" for
+ details.) If command extensions are disabled, a warning message might
+ be displayed informing you that "using parameters that include the =
+ character by enclosing them in quotes will not be supported."
N.B. It is normal to see a few error messages output while configure
is running, when gcc support is being tested. These cannot be
goto end\r
\r
:start\r
+rem ----------------------------------------------------------------------\r
+rem Attempt to enable command extensions. Set use_extensions to 1 if\r
+rem they are available and 0 if they are not available.\r
+set use_extensions=1\r
+setlocal ENABLEEXTENSIONS\r
+if "%CMDEXTVERSION%" == "" set use_extensions=0\r
+if "%use_extensions%" == "1" goto afterext\r
+\r
+echo. Command extensions are not available. Using parameters that include the =\r
+echo. character by enclosing them in quotes will not be supported.\r
+\r
+:afterext\r
+\r
rem ----------------------------------------------------------------------\r
rem Default settings.\r
set prefix=\r
echo. --without-xpm do not use XPM library even if it is installed\r
echo. --with-svg use the RSVG library (experimental)\r
echo. --distfiles path to files for make dist, e.g. libXpm.dll\r
+if "%use_extensions%" == "0" goto end\r
+echo.\r
+echo. The cflags and ldflags arguments support parameters that include the =\r
+echo. character. However, since the = character is normally treated as a\r
+echo. separator character you will need to enclose any parameter that includes\r
+echo. the = character in quotes. For example, to include\r
+echo. -DSITELOAD_PURESIZE_EXTRA=100000 as one of the cflags you would run\r
+echo. configure.bat as follows:\r
+echo. configure.bat --cflags "-DSITELOAD_PURESIZE_EXTRA=100000"\r
+echo.\r
+echo. Note that this capability of processing parameters that include the =\r
+echo. character depends on command extensions. This batch file attempts to\r
+echo. enable command extensions. If command extensions cannot be enabled, a\r
+echo. warning message will be displayed.\r
goto end\r
\r
rem ----------------------------------------------------------------------\r
rem ----------------------------------------------------------------------\r
\r
:usercflags\r
+if "%use_extensions%" == "1" goto ucflagex\r
+goto ucflagne\r
+\r
+:ucflagex\r
+shift\r
+set usercflags=%usercflags%%sep1%%~1\r
+set sep1= %nothing%\r
+shift\r
+goto again\r
+\r
+:ucflagne\r
shift\r
set usercflags=%usercflags%%sep1%%1\r
set sep1= %nothing%\r
rem ----------------------------------------------------------------------\r
\r
:userldflags\r
+if "%use_extensions%" == "1" goto ulflagex\r
+goto ulflagne\r
+\r
+:ulflagex\r
+shift\r
+set userldflags=%userldflags%%sep2%%~1\r
+set sep2= %nothing%\r
+shift\r
+goto again\r
+\r
+:ulflagne\r
shift\r
set userldflags=%userldflags%%sep2%%1\r
set sep2= %nothing%\r