From aa9dea6475cb6a6ab8b02a26bc931f72a92c35f7 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 20 Oct 2007 12:37:09 +0000 Subject: [PATCH] (docflags, doldflags): New variables. (genmakefiles): Use them to work around problems with whitespace in arguments of the `if' command. --- nt/ChangeLog | 6 ++++++ nt/configure.bat | 14 ++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/nt/ChangeLog b/nt/ChangeLog index 88cddd2643e..aeb8068325d 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,3 +1,9 @@ +2007-10-20 Eli Zaretskii + + * configure.bat (docflags, doldflags): New variables. + (genmakefiles): Use them to work around problems with whitespace + in arguments of the `if' command. + 2007-10-18 Jason Rumney * makefile.w32-in (install): Install COPYING in top-level and bin dirs. diff --git a/nt/configure.bat b/nt/configure.bat index 5ff084832dd..2ea58ecf933 100755 --- a/nt/configure.bat +++ b/nt/configure.bat @@ -84,7 +84,9 @@ set noopt=N set nocygwin=N set COMPILER= set usercflags= +set docflags= set userldflags= +set doldflags= set sep1= set sep2= @@ -473,16 +475,20 @@ if (%nodebug%) == (Y) echo NODEBUG=1 >>config.settings 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 -- 2.39.2