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

Emil Velikov emil.l.velikov at gmail.com
Fri Sep 27 18:07:37 PDT 2013


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

none of the Android targets have it

The build systems are interesting, that's why I've been obsessed with
them lately :P

Cheers
Emil


More information about the mesa-dev mailing list