From: Emil Velikov <[email protected]>

Currently the latter is only set when using --enable-intel.

Whereas for the CFLAGS: if we "enable" PKG_CHECK_MODULES sets the
variable, while for "disable" we do it locally. In either case the
CFLAGS is not propagated through, this one can get build issues
regardless of the actual state of the toggle.

v2: Add -I for the include directive and correctly propagate
$(top_srcdir).

Cc: Brian Starkey <[email protected]>
Cc: Robert Foss <[email protected]>
Reported-by: Brian Starkey <[email protected]>
Signed-off-by: Emil Velikov <[email protected]>
---
This time fully tested:
 - enable/disable/auto with and w/o libdrm_intel :-)

Did not see much point in splitting the v2 only changes to 1/2 and keep
this as 2/2. I don't mind either way though :-)
---
 configure.ac | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index 735cfd5..e181c83 100644
--- a/configure.ac
+++ b/configure.ac
@@ -178,12 +178,15 @@ fi
 if test "x$INTEL" = xyes; then
        PKG_CHECK_MODULES(DRM_INTEL, [libdrm_intel >= 2.4.64])
        AC_DEFINE(HAVE_LIBDRM_INTEL, 1, [Have intel support])
-       DRM_LIBS="$DRM_LIBS $DRM_INTEL_LIBS"
-       AC_SUBST([DRM_LIBS])
 else
-       DRM_INTEL_CFLAGS=$(top_srcdir)/lib/stubs/drm/
-       AC_SUBST([DRM_INTEL_CFLAGS])
+       DRM_INTEL_CFLAGS=-I$\(top_srcdir\)/lib/stubs/drm/
+       DRM_INTEL_LIBS=
 fi
+DRM_CFLAGS="$DRM_CFLAGS $DRM_INTEL_CFLAGS"
+DRM_LIBS="$DRM_LIBS $DRM_INTEL_LIBS"
+AC_SUBST([DRM_CFLAGS])
+AC_SUBST([DRM_LIBS])
+
 AM_CONDITIONAL(HAVE_LIBDRM_INTEL, [test "x$INTEL" = xyes])
 
 # for dma-buf tests
-- 
2.9.3

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to