From: Anatol Belski Date: Fri, 14 Nov 2014 16:38:03 +0000 (+0100) Subject: less spaces in the makefile generated commands X-Git-Tag: POST_NATIVE_TLS_MERGE^2~46^2~30 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1ae7743a079e8c7afa7b7d2da465a8445c4cb226;p=php less spaces in the makefile generated commands --- diff --git a/win32/build/confutils.js b/win32/build/confutils.js index bcf0d1dac9..7d02f99ad6 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -1999,8 +1999,9 @@ function generate_makefile() // that is part of the build dir flags (CFLAGS_BD_XXX) from being // seen as a line continuation character MF.WriteLine(keys[i] + "=" + - //word_wrap_and_indent(1, configure_subst.Item(keys[i]), ' \\', '\t') + " " - configure_subst.Item(keys[i]) + " " + /* \s+\/ eliminates extra whitespace caused when using \ for string continuation, + whereby \/ is the start of the next compiler switch */ + trim(configure_subst.Item(keys[i])).replace(/\s+\//gm, " /") + " " ); MF.WriteBlankLines(1); } @@ -2067,7 +2068,7 @@ function ADD_FLAG(name, flags, target) if (target != null) { name = target.toUpperCase() + "_" + name; } - flags = flags.replace(/^\s+/, "").replace(/\s+$/, ""); + flags = trim(flags); if (configure_subst.Exists(name)) { var curr_flags = configure_subst.Item(name); @@ -2798,3 +2799,8 @@ function add_extra_dirs() } +function trim(s) +{ + return s.replace(/^\s+/, "").replace(/\s+$/, ""); +} +