[Intel-gfx] [RFC i-g-t 1/9] configure.ac: Test for libdrm_intel and build for it if present.

Robert Foss robert.foss at collabora.com
Tue May 24 14:58:45 UTC 2016



On 2016-05-23 11:03 AM, Emil Velikov wrote:
> On Saturday, May 21, 2016 08:55 BST, Chris Wilson <chris at chris-wilson.co.uk> wrote:
>> On Fri, May 20, 2016 at 06:59:25PM -0400, robert.foss at collabora.com wrote:
>>> From: Robert Foss <robert.foss at collabora.com>
>>>
>>> Test for libdrm_intel and build for it if present.
>>> Also expose the HAVE_INTEL #define to allow code to be conditionally
>>> compiled.
>>>
>>> Signed-off-by: Robert Foss <robert.foss at collabora.com>
>>> ---
>>>   configure.ac | 14 +++++++++++++-
>>>   1 file changed, 13 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/configure.ac b/configure.ac
>>> index 0589782..b6fc168 100644
>>> --- a/configure.ac
>>> +++ b/configure.ac
>>> @@ -100,7 +100,7 @@ if test "x$GCC" = "xyes"; then
>>>   fi
>>>   AC_SUBST(ASSEMBLER_WARN_CFLAGS)
>>>
>>> -PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.64 libdrm])
>>> +PKG_CHECK_MODULES(DRM, [libdrm])
>>>   PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
>>>
>>>   case "$target_cpu" in
>>> @@ -150,6 +150,18 @@ PKG_CHECK_MODULES(GLIB, glib-2.0)
>>>   # -----------------------------------------------------------------------------
>>>   #			Configuration options
>>>   # -----------------------------------------------------------------------------
>>> +AC_ARG_ENABLE(intel, AS_HELP_STRING([--disable-intel],
>>> +	      [Enable building of intel specific parts (default: auto)]),
>>> +	      [INTEL=$enableval], [INTEL=auto])
>>> +if test "x$INTEL" = xauto; then
>>> +	PKG_CHECK_EXISTS([libdrm_intel >= 2.4.64], [INTEL=yes], [INTEL=no])
>>> +fi
>>> +if test "x$INTEL" = xyes; then
>>> +	PKG_CHECK_MODULES(DRM_INTEL, [libdrm_intel >= 2.4.64])
>
>>> +	AC_DEFINE(HAVE_INTEL, 1, [Have intel support])
>>> +fi
>>> +AM_CONDITIONAL(HAVE_INTEL, [test "x$INTEL" = xyes])
>>
>> HAVE_INTEL caused quite a bit of confusion when reading the later build
>> patches.
>>
>> Please use HAVE_LIBDRM_INTEL instead
> As a counter argument, one could, should really, use --enable-intel to replace the 'x86' parts in commit bccc0ec6a3fdae880e14770c2ff5770fb86ea6fc. Perhaps HAVE_INTEL isn't that bad when we take that into consideration ?
>

The purpose of HAVE_INTEL isn't really to avoid building x86 code on 
non-x86 platforms, but rather to avoid a build dependency where it can 
be avoided.

That being said using a BUILD_X86 or something like it to avoid building 
irrelevant binaries would be very useful.

Either way, HAVE_LIBDRM_INTEL more clearly defines what the flag is about.


More information about the Intel-gfx mailing list