[Mesa-dev] [PATCH] android: intel/genxml: add rules to generate xml headers

Jason Ekstrand jason at jlekstrand.net
Mon Oct 10 03:45:05 UTC 2016


On Sun, Oct 9, 2016 at 3:13 AM, Mauro Rossi <issor.oruam at gmail.com> wrote:

> Hi Jason,
>
> I'm sending a patch to add rules for Android,
> even if those headers are not yet used there
> they are inducing a minor building error on Android.
>

These XML includes shouldn't be used for anything in the Anrdoid build as
Aubinator isn't really useful to be building for Android.  Does this fix an
actual build problem or is it just in case we ever need them?  I doubt
we'll be using the XML headers in driver code any time soon, but I'm happy
to add rules for them if you'd like.

--Jason


> Cheers and congratulations for your nice presentation on vulkan at XDC2016
> Mauro
>
> From 52c9b2d9a7d7fc962d7a8c30fc412387a74bf554 Mon Sep 17 00:00:00 2001
> From: Mauro Rossi <issor.oruam at gmail.com>
> Date: Sun, 9 Oct 2016 11:40:42 +0200
> Subject: [PATCH] android: intel/genxml: add rules to generate xml headers
>
> New generated headers were introduced by commit 63a366a
> "intel: aubinator: generate a standalone binary"
>
> Once the generated files are listed in Makefile.sources variables,
> Android build system requires rules to avoid building error.
>
> New macro xml-header-gen is basically a copy&paste of automake rules,
> but xxd is invoked directly, as Android build systems stops and shows the
> error
> in case of xxd missing.
>
> Existing macro header-gen is renamed to pack-header-gen as a refinement.
> ---
>  src/intel/Android.genxml.mk | 42 ++++++++++++++++++++++++++++++
> +++---------
>  1 file changed, 33 insertions(+), 9 deletions(-)
>
> diff --git a/src/intel/Android.genxml.mk b/src/intel/Android.genxml.mk
> index 79de784..8991563 100644
> --- a/src/intel/Android.genxml.mk
> +++ b/src/intel/Android.genxml.mk
> @@ -43,7 +43,7 @@ $(intermediates)/dummy.c:
>  # This is the list of auto-generated files headers
>  LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/,
> $(GENXML_GENERATED_FILES))
>
> -define header-gen
> +define pack-header-gen
>   @mkdir -p $(dir $@)
>   @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
>   $(hide) $(PRIVATE_SCRIPT) $(PRIVATE_XML) > $@
> @@ -52,42 +52,66 @@ endef
>  $(intermediates)/genxml/gen4_pack.h: PRIVATE_SCRIPT :=
> $(MESA_PYTHON2) $(LOCAL_PATH)/genxml/gen_pack_header.py
>  $(intermediates)/genxml/gen4_pack.h: PRIVATE_XML :=
> $(LOCAL_PATH)/genxml/gen4.xml
>  $(intermediates)/genxml/gen4_pack.h: $(LOCAL_PATH)/genxml/gen4.xml
> $(LOCAL_PATH)/genxml/gen_pack_header.py
> - $(call header-gen)
> + $(call pack-header-gen)
>
>  $(intermediates)/genxml/gen45_pack.h: PRIVATE_SCRIPT :=
> $(MESA_PYTHON2) $(LOCAL_PATH)/genxml/gen_pack_header.py
>  $(intermediates)/genxml/gen45_pack.h: PRIVATE_XML :=
> $(LOCAL_PATH)/genxml/gen45.xml
>  $(intermediates)/genxml/gen45_pack.h: $(LOCAL_PATH)/genxml/gen45.xml
> $(LOCAL_PATH)/genxml/gen_pack_header.py
> - $(call header-gen)
> + $(call pack-header-gen)
>
>  $(intermediates)/genxml/gen5_pack.h: PRIVATE_SCRIPT :=
> $(MESA_PYTHON2) $(LOCAL_PATH)/genxml/gen_pack_header.py
>  $(intermediates)/genxml/gen5_pack.h: PRIVATE_XML :=
> $(LOCAL_PATH)/genxml/gen5.xml
>  $(intermediates)/genxml/gen5_pack.h: $(LOCAL_PATH)/genxml/gen5.xml
> $(LOCAL_PATH)/genxml/gen_pack_header.py
> - $(call header-gen)
> + $(call pack-header-gen)
>
>  $(intermediates)/genxml/gen6_pack.h: PRIVATE_SCRIPT :=
> $(MESA_PYTHON2) $(LOCAL_PATH)/genxml/gen_pack_header.py
>  $(intermediates)/genxml/gen6_pack.h: PRIVATE_XML :=
> $(LOCAL_PATH)/genxml/gen6.xml
>  $(intermediates)/genxml/gen6_pack.h: $(LOCAL_PATH)/genxml/gen6.xml
> $(LOCAL_PATH)/genxml/gen_pack_header.py
> - $(call header-gen)
> + $(call pack-header-gen)
>
>  $(intermediates)/genxml/gen7_pack.h: PRIVATE_SCRIPT :=
> $(MESA_PYTHON2) $(LOCAL_PATH)/genxml/gen_pack_header.py
>  $(intermediates)/genxml/gen7_pack.h: PRIVATE_XML :=
> $(LOCAL_PATH)/genxml/gen7.xml
>  $(intermediates)/genxml/gen7_pack.h: $(LOCAL_PATH)/genxml/gen7.xml
> $(LOCAL_PATH)/genxml/gen_pack_header.py
> - $(call header-gen)
> + $(call pack-header-gen)
>
>  $(intermediates)/genxml/gen75_pack.h: PRIVATE_SCRIPT :=
> $(MESA_PYTHON2) $(LOCAL_PATH)/genxml/gen_pack_header.py
>  $(intermediates)/genxml/gen75_pack.h: PRIVATE_XML :=
> $(LOCAL_PATH)/genxml/gen75.xml
>  $(intermediates)/genxml/gen75_pack.h: $(LOCAL_PATH)/genxml/gen75.xml
> $(LOCAL_PATH)/genxml/gen_pack_header.py
> - $(call header-gen)
> + $(call pack-header-gen)
>
>  $(intermediates)/genxml/gen8_pack.h: PRIVATE_SCRIPT :=
> $(MESA_PYTHON2) $(LOCAL_PATH)/genxml/gen_pack_header.py
>  $(intermediates)/genxml/gen8_pack.h: PRIVATE_XML :=
> $(LOCAL_PATH)/genxml/gen8.xml
>  $(intermediates)/genxml/gen8_pack.h: $(LOCAL_PATH)/genxml/gen8.xml
> $(LOCAL_PATH)/genxml/gen_pack_header.py
> - $(call header-gen)
> + $(call pack-header-gen)
>
>  $(intermediates)/genxml/gen9_pack.h: PRIVATE_SCRIPT :=
> $(MESA_PYTHON2) $(LOCAL_PATH)/genxml/gen_pack_header.py
>  $(intermediates)/genxml/gen9_pack.h: PRIVATE_XML :=
> $(LOCAL_PATH)/genxml/gen9.xml
>  $(intermediates)/genxml/gen9_pack.h: $(LOCAL_PATH)/genxml/gen9.xml
> $(LOCAL_PATH)/genxml/gen_pack_header.py
> - $(call header-gen)
> + $(call pack-header-gen)
> +
> +define xml-header-gen
> + @mkdir -p $(dir $@)
> + @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
> + $(hide) echo -n "static const uint8_t " > $@; \
> + sed -e 's,_xml.h,,' <<< "`basename $@`_xml[] = {" >> $@; \
> + cat $< | xxd -i >> $@; \
> + echo "};" >> $@
> +endef
> +
> +$(intermediates)/genxml/gen6_xml.h: $(LOCAL_PATH)/genxml/gen6.xml
> + $(call xml-header-gen)
> +
> +$(intermediates)/genxml/gen7_xml.h: $(LOCAL_PATH)/genxml/gen7.xml
> + $(call xml-header-gen)
> +
> +$(intermediates)/genxml/gen75_xml.h: $(LOCAL_PATH)/genxml/gen75.xml
> + $(call xml-header-gen)
> +
> +$(intermediates)/genxml/gen8_xml.h: $(LOCAL_PATH)/genxml/gen8.xml
> + $(call xml-header-gen)
> +
> +$(intermediates)/genxml/gen9_xml.h: $(LOCAL_PATH)/genxml/gen9.xml
> + $(call xml-header-gen)
>
>  LOCAL_EXPORT_C_INCLUDE_DIRS := \
>   $(MESA_TOP)/src/intel \
> --
> 2.9.3
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20161009/e1cd91af/attachment-0001.html>


More information about the mesa-dev mailing list