[Mesa-dev] [PATCH] XXXgallium/common_dri: fix the scons build

Emil Velikov emil.l.velikov at gmail.com
Mon Sep 30 10:26:35 PDT 2013


On 30/09/13 17:06, Eric Anholt wrote:
> Emil Velikov <emil.l.velikov at gmail.com> writes:
> 
>> On 28/09/13 01:41, Eric Anholt wrote:
>>> Emil Velikov <emil.l.velikov at gmail.com> writes:
>>>
>>>> * clone the drienv to driswenv and adjust approapriately
>>>> * export driswenv and use it in dri-swrast
>>>> * ensure __NOT_HAVE_DRM_H is defined for drisw, similar
>>>> to all other common_drisw users
>>>
>>> I'm confused where __NOT_HAVE_DRM_H comes from.  I don't see any
>>> references to it in the tree until your patch.
>>>
>> Yes that one did my head in a bit, here is what I've gathered
>>
>> If you decide to omit it, build will fail due to missing drm.h in the
>> include path, coming from dri_interface.h.
>>
>> Take a look at dri_interface.h, it has a very interesting heuristics -
>> #if def __APPLE__ || __CYGWIN__ || __GNU__
>> #ifndef __NOT_HAVE_DRM_H
>> #define __NOT_HAVE_DRM_H
>> #endif
>>
>> Thus the obvious question, why did it work before and not after - I'm
>> assuming that scons plays "nicely" with the __GNU__ define.
>>
>> The last one is only speculation as I've ran out of patience at that
>> moment :\ Although the following info wrt __NOT_HAVE_DRM_H is quite
>> interesting.
>>
>> Three out of four automake swrast providers define it
>> * src/mesa/drivers/dri/swrast/Makefile.am
>> * src/gallium/targets/dri-swrast/Makefile.am
>> * src/gallium/state_trackers/dri/sw/Makefile.am (swrast libGL.so)
>>
>> and only one Scons target provides is
>> * src/gallium/state_trackers/dri/sw/SConscript
>> env.Append(CPPDEFINES = [('__NOT_HAVE_DRM_H', '1')])
>>
>> Note #ifdef __NOT_HAVE_DRM_H vs #if __NOT_HAVE_DRM_H
> 
> Not sure what I did before to fail at grep, but yeah, it's obviously in
> the tree.  I've squashed your patch into mine -- sound good?
> 
Hold the presses I've found a silly the scons which with combination of
this patch will result in a broken(failed build), patch will follow
shortly. Which of course you're more than welcome to squash if it looks
ok with you.

~Emil


More information about the mesa-dev mailing list