summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2022-10-19 10:18:07 +0200
committerStephan Bergmann <sbergman@redhat.com>2022-10-19 13:07:38 +0200
commite74d0f01504c61917d8ff9e7538a0017b6212ff5 (patch)
treee24bacd0950c7a99a4ddecd41e5bc09639bde95f /solenv
parentadd110bad816fadeb96e7af0d4689389c04c263e (diff)
Make MSVC -showIncludes processing more reliable
With the Windows display language set to "Portuguès (Brasil)" (and the corresponding Visual Studio language pack installed), configure.ac detected SHOWINCLUDES_PREFIX to have the value "Observação: incluindo arquivo:" in UTF-8 (i.e., with bytes ... C3 A7 C3 A3 ...). However, for whatever reason filter-showIncludes.awk apparently didn't manage to match the input it receives against the value of that environment variable, and the Cygwin terminal contained output lines starting with either > Observa□ao: incluindo arquivo: (with toplevel plain `make`, plain `make` in a module, and `make -O` in a module) or > Observaçao: incluindo arquivo: (with toplevel `make -O`). (Note how "ç" is either garbled as "□" or shown correctly, and "ã" is always shown as plain "a".) It's not quite clear to me where exactly this garbling happens, and why the behavior is apparently different in configure.ac vs. make. The most reliable way to avoid these issues altogether is to force MSVC to emit English diagnostics, via VSLANG=1033, as explained at <https://stackoverflow.com/questions/2286216/how-to-change-msbuild-error-message-language>. (I didn't find any official documentation of that environment variable on MSDN though. Thanks to Mike Kaganski for providing that Stack Overflow link.) dfbce2a556972f552d194d2358c170077915d776 "gbuild: try to run filter-showIncludes.awk in C locale" had started to call that AWK script with LC_ALL=C (and subsequent commits had copied that LC_ALL=C in calls to similar AWK scripts). But that appears to neither be sufficient (see above) nor necessary now, so I removed all those LC_ALL=C settings. (There is a gawk --characters-as-bytes option, but trying that out didn't make a difference for this issue.) clang-cl doesn't support VSLANG, nor does it generate localized diagnostics in the first place, but lets consistently add VSLANG=1033 when determining LO_CLANG_SHOWINCLUDES_PREFIX in configure.ac, too. (The way VSLANG=1033 is set in gb_CObject__compiler in com_MSC_class.mk, it affects all kinds of MSVC and clang-cl invocations, whether or not they actually honour that environment variable.) Change-Id: I52d0e842d200ed256a44d6cc5de1b3868c0acc71 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141524 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'solenv')
-rw-r--r--solenv/gbuild/platform/com_MSC_class.mk3
-rw-r--r--solenv/gbuild/platform/com_MSC_defs.mk4
2 files changed, 4 insertions, 3 deletions
diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk
index 06d21ecd474a..f1affe79e905 100644
--- a/solenv/gbuild/platform/com_MSC_class.mk
+++ b/solenv/gbuild/platform/com_MSC_class.mk
@@ -36,6 +36,7 @@ endef
# $(call gb_CObject__compiler,flags,source,compiler)
define gb_CObject__compiler
+ VSLANG=1033 \
$(if $(filter YES,$(LIBRARY_X64)), $(CXX_X64_BINARY), \
$(if $(filter YES,$(PE_X86)), $(CXX_X86_BINARY), \
$(if $(filter %.c,$(2)), \
@@ -291,7 +292,7 @@ $(call gb_Helper_abbreviate_dirs,\
-manifestfile:$(WORKDIR)/LinkTarget/$(2).manifest \
-pdb:$(call gb_LinkTarget__get_pdb_filename,$(WORKDIR)/LinkTarget/$(2))) \
$(if $(ILIBTARGET),-out:$(1) -implib:$(ILIBTARGET),-out:$(1)) \
- | LC_ALL=C $(GBUILDDIR)/platform/filter-creatingLibrary.awk; RC=$${PIPESTATUS[0]}; rm $${RESPONSEFILE} \
+ | $(GBUILDDIR)/platform/filter-creatingLibrary.awk; RC=$${PIPESTATUS[0]}; rm $${RESPONSEFILE} \
$(if $(filter Library,$(TARGETTYPE)),; if [ ! -f $(ILIBTARGET) ]; then rm -f $(1); exit 42; fi) \
$(if $(filter Library,$(TARGETTYPE)),&& if [ -f $(WORKDIR)/LinkTarget/$(2).manifest ]; then mt.exe $(MTFLAGS) -nologo -manifest $(WORKDIR)/LinkTarget/$(2).manifest $(SRCDIR)/solenv/gbuild/platform/win_compatibility.manifest -outputresource:$(1)\;2 && touch -r $(1) $(WORKDIR)/LinkTarget/$(2).manifest $(ILIBTARGET); fi) \
$(if $(filter Executable,$(TARGETTYPE)),&& if [ -f $(WORKDIR)/LinkTarget/$(2).manifest ]; then mt.exe $(MTFLAGS) -nologo -manifest $(WORKDIR)/LinkTarget/$(2).manifest $(SRCDIR)/solenv/gbuild/platform/win_compatibility.manifest -outputresource:$(1)\;1 && touch -r $(1) $(WORKDIR)/LinkTarget/$(2).manifest; fi) \
diff --git a/solenv/gbuild/platform/com_MSC_defs.mk b/solenv/gbuild/platform/com_MSC_defs.mk
index 364c0011f38a..5b6094b560cf 100644
--- a/solenv/gbuild/platform/com_MSC_defs.mk
+++ b/solenv/gbuild/platform/com_MSC_defs.mk
@@ -251,12 +251,12 @@ gb_COMPILERDEBUGOPTFLAGS :=
ifeq ($(gb_FULLDEPS),$(true))
gb_COMPILERDEPFLAGS := -showIncludes
define gb_create_deps
-| LC_ALL=C $(GBUILDDIR)/platform/filter-showIncludes.awk -vdepfile=$(1) -vobjectfile=$(2) -vsourcefile=$(3); exit $${PIPESTATUS[0]}
+| $(GBUILDDIR)/platform/filter-showIncludes.awk -vdepfile=$(1) -vobjectfile=$(2) -vsourcefile=$(3); exit $${PIPESTATUS[0]}
endef
else
gb_COMPILERDEPFLAGS :=
define gb_create_deps
-| LC_ALL=C $(GBUILDDIR)/platform/filter-sourceName.awk; exit $${PIPESTATUS[0]}
+| $(GBUILDDIR)/platform/filter-sourceName.awk; exit $${PIPESTATUS[0]}
endef
endif