[Mesa-dev] [PATCH 05/14] autotools, android: Use meson layout (including .gmo)
Dylan Baker
dylan at pnwbakers.com
Fri Oct 26 17:23:34 UTC 2018
This will allow autotools, meson, and android to use the same layout and
options in the gen_xmlpool script. Scons doesn't care because windows
doesn't support translations.
v2: - Add this commit
---
src/util/Android.mk | 6 +++---
src/util/xmlpool/Makefile.am | 12 +++++++-----
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/src/util/Android.mk b/src/util/Android.mk
index e463b63e101..6c4c90e951d 100644
--- a/src/util/Android.mk
+++ b/src/util/Android.mk
@@ -87,13 +87,13 @@ $(MESA_DRI_OPTIONS_LANGS:%=$(intermediates)/xmlpool/%.po): $(intermediates)/xmlp
PRIVATE_SCRIPT := $(LOCAL_PATH)/xmlpool/gen_xmlpool.py
PRIVATE_LOCALEDIR := $(intermediates)/xmlpool
PRIVATE_TEMPLATE_HEADER := $(LOCAL_PATH)/xmlpool/t_options.h
-PRIVATE_MO_FILES := $(MESA_DRI_OPTIONS_LANGS:%=$(intermediates)/xmlpool/%/LC_MESSAGES/options.mo)
+PRIVATE_MO_FILES := $(MESA_DRI_OPTIONS_LANGS:%=$(intermediates)/xmlpool/%.gmo)
LOCAL_GENERATED_SOURCES += $(PRIVATE_MO_FILES)
$(LOCAL_GENERATED_SOURCES): PRIVATE_PYTHON := $(MESA_PYTHON2)
-$(PRIVATE_MO_FILES): $(intermediates)/xmlpool/%/LC_MESSAGES/options.mo: $(intermediates)/xmlpool/%.po
+$(PRIVATE_MO_FILES): $(intermediates)/xmlpool/%.gmo: $(intermediates)/xmlpool/%.po
mkdir -p $(dir $@)
msgfmt -o $@ $<
@@ -102,7 +102,7 @@ $(UTIL_GENERATED_SOURCES): $(intermediates)/%.c: $(LOCAL_PATH)/%.py
$(transform-generated-source)
$(MESA_DRI_OPTIONS_H): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PYTHON) $< $(PRIVATE_TEMPLATE_HEADER) \
- $(PRIVATE_LOCALEDIR) $(MESA_DRI_OPTIONS_LANGS) > $@
+ $(PRIVATE_LOCALEDIR) $(MESA_DRI_OPTIONS_LANGS) --meson > $@
$(MESA_DRI_OPTIONS_H): $(PRIVATE_SCRIPT) $(PRIVATE_TEMPLATE_HEADER) $(PRIVATE_MO_FILES)
$(transform-generated-source)
diff --git a/src/util/xmlpool/Makefile.am b/src/util/xmlpool/Makefile.am
index 78a08fab4b1..2227f57369e 100644
--- a/src/util/xmlpool/Makefile.am
+++ b/src/util/xmlpool/Makefile.am
@@ -47,10 +47,10 @@ POS=ca.po de.po es.po nl.po fr.po sv.po
# Don't change anything below, unless you know what you're doing.
#
LANGS=$(POS:%.po=%)
-MOS=$(POS:%.po=%/LC_MESSAGES/options.mo)
+MOS=$(POS:%.po=%.gmo)
POT=xmlpool.pot
-.PHONY: all clean pot po mo
+.PHONY: all clean clean-local pot po mo
EXTRA_DIST = \
gen_xmlpool.py \
@@ -69,17 +69,19 @@ CLEANFILES = \
$(POS) \
$(MOS)
+clean-local:
+ rm -f $(MOS)
+
# Default target options.h
LOCALEDIR := .
options.h: t_options.h $(MOS)
- $(AM_V_GEN) $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/gen_xmlpool.py $(srcdir)/t_options.h $(LOCALEDIR) $(LANGS) > options.h
+ $(AM_V_GEN) $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/gen_xmlpool.py --meson $(srcdir)/t_options.h $(LOCALEDIR) $(LANGS) > options.h
# Update .mo files from the corresponding .po files.
-%/LC_MESSAGES/options.mo: %.po
+%.gmo: %.po
@mo="$@"; \
lang=$${mo%%/*}; \
echo "Updating ($$lang) $@ from $?."; \
- $(MKDIR_P) $$lang/LC_MESSAGES; \
msgfmt -o $@ $?
# Use this target to create or update .po files with new messages in
--
2.19.1
More information about the mesa-dev
mailing list