changeset 79160:1df46ee4de10

(docflags, doldflags): New variables. (genmakefiles): Use them to work around problems with whitespace in arguments of the `if' command.
author Eli Zaretskii <eliz@gnu.org>
date Sat, 20 Oct 2007 12:36:40 +0000
parents a4b157788804
children ff6a2b38e5fe
files nt/configure.bat
diffstat 1 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/nt/configure.bat	Sat Oct 20 03:53:59 2007 +0000
+++ b/nt/configure.bat	Sat Oct 20 12:36:40 2007 +0000
@@ -84,7 +84,9 @@
 set nocygwin=N
 set COMPILER=
 set usercflags=
+set docflags=
 set userldflags=
+set doldflags=
 set sep1=
 set sep2=
 
@@ -473,16 +475,20 @@
 if (%noopt%) == (Y) echo NOOPT=1 >>config.settings
 if (%nocygwin%) == (Y) echo NOCYGWIN=1 >>config.settings
 if not "(%prefix%)" == "()" echo INSTALL_DIR=%prefix%>>config.settings
-if not "(%usercflags%)" == "()" echo USER_CFLAGS=%usercflags%>>config.settings
-if not "(%userldflags%)" == "()" echo USER_LDFLAGS=%userldflags%>>config.settings
+rem We go thru docflags because usercflags could be "-DFOO=bar" -something
+rem and the if command cannot cope with this
+for %%v in (%usercflags%) do if not (%%v)==() set docflags=Y
+if (%docflags%)==(Y) echo USER_CFLAGS=%usercflags%>>config.settings
+for %%v in (%userldflags%) do if not (%%v)==() set doldflags=Y
+if (%doldflags%)==(Y) echo USER_LDFLAGS=%userldflags%>>config.settings
 echo # End of settings from configure.bat>>config.settings
 echo. >>config.settings
 
 copy config.nt config.tmp
 echo. >>config.tmp
 echo /* Start of settings from configure.bat.  */ >>config.tmp
-if not "(%usercflags%)" == "()" echo #define USER_CFLAGS " %usercflags%">>config.tmp
-if not "(%userldflags%)" == "()" echo #define USER_LDFLAGS " %userldflags%">>config.tmp
+if (%docflags%) == (Y) echo #define USER_CFLAGS " %usercflags%">>config.tmp
+if (%doldflags%) == (Y) echo #define USER_LDFLAGS " %userldflags%">>config.tmp
 if not "(%HAVE_PNG%)" == "()" echo #define HAVE_PNG 1 >>config.tmp
 if not "(%HAVE_JPEG%)" == "()" echo #define HAVE_JPEG 1 >>config.tmp
 if not "(%HAVE_GIF%)" == "()" echo #define HAVE_GIF 1 >>config.tmp