[Mesa-dev] [PATCH 1/4] gbm: Add Android build support

Rob Herring robh at kernel.org
Thu Apr 28 13:34:30 UTC 2016


On Fri, Apr 22, 2016 at 5:57 PM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> Hi Rob,
>
> On 22 April 2016 at 16:50, Rob Herring <robh at kernel.org> wrote:
>
>> --- /dev/null
>> +++ b/src/gbm/Android.mk
>
>> +LOCAL_EXPORT_C_INCLUDE_DIRS := \
>> +       $(LOCAL_PATH)/main
>> +
> You don't need this.
>
>> +LOCAL_C_INCLUDES := \
>> +       $(LOCAL_PATH)/main
>> +
>> +ifeq ($(MESA_LOLLIPOP_BUILD),true)
>> +LOCAL_CFLAGS_32 := -DDEFAULT_DRIVER_DIR=\"/system/lib/$(MESA_DRI_MODULE_REL_PATH)\"
>> +LOCAL_CFLAGS_64 := -DDEFAULT_DRIVER_DIR=\"/system/lib64/$(MESA_DRI_MODULE_REL_PATH)\"
>> +else
>> +LOCAL_CFLAGS += -DDEFAULT_DRIVER_DIR=\"/system/lib/$(MESA_DRI_MODULE_REL_PATH)\"
>> +endif
>> +
> Can you factor out the existing copy from src/egl/Android.mk to
> $(top)/Android.mk.
> The following should work ... I think.

It doesn't. AFAICT, defines can either be rules to run or return a
value for assignment. The only way to do this that I can see is
including a makefile as $(CLEAR_VARS) is done. I don't think that's
really worth it. Really, I think the dynamic linker should be fixed
handle the path difference.

I could just set this for the whole build in Android.common.mk. The
define would be set everywhere, but that shouldn't really matter.

> define set-default-driver-dir
>    ifeq ($(MESA_LOLLIPOP_BUILD),true)
>    LOCAL_CFLAGS_32 :=
> -DDEFAULT_DRIVER_DIR=\"/system/lib/$(MESA_DRI_MODULE_REL_PATH)\"
>    LOCAL_CFLAGS_64 :=
> -DDEFAULT_DRIVER_DIR=\"/system/lib64/$(MESA_DRI_MODULE_REL_PATH)\"
>    else
>    LOCAL_CFLAGS +=
> -DDEFAULT_DRIVER_DIR=\"/system/lib/$(MESA_DRI_MODULE_REL_PATH)\"
>   endif
>
> To use it
> $(call set-default-driver-dir)


More information about the mesa-dev mailing list