Modified the code that parses the --cflags and --ldflags options to support parameter...
[bpt/emacs.git] / nt / configure.bat
index 1450650..699a33b 100755 (executable)
@@ -74,6 +74,19 @@ echo You must run configure from the nt subdirectory.
 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
@@ -136,6 +149,20 @@ echo.   --without-tiff          do not use TIFF library even if it is installed
 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
@@ -198,6 +225,17 @@ goto again
 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
@@ -207,6 +245,17 @@ goto again
 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