Skip to contentSkip to conversation

configure.ac: correctly manage DRM_INTEL_{CFLAGS, LIBS}

PATCH Superseded Emil Velikov 3 participants 5 messages Oct 26, 2016 – Nov 9, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configure.ac: correctly manage DRM_INTEL_{CFLAGS, LIBS}

From: Emil Velikov <[email protected]>

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

Whereas for the CFLAGS with "enable", it's set by PKG_CHECK_MODULES and it's set locally for "disable". Yet, in either case it's not propagated through, this one can get a range of build issues regardless of the actual state of the toggle.

---
If interested, one can do a fine grained addition in the respective files, but this is the quickest fix ;-)

On a related note: seems like the nouveau and vc4 CFLAGS are _not_ propagated either. Any volunteers ?

---
 configure.ac | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
configure.ac +6 -3
index 735cfd5..1c747b3 100644
@@ -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_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
Signature · 6 lines
2.9.3

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

PATCH v2 1/1 configure.ac: correctly manage DRM_INTEL_{CFLAGS, LIBS}

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).

---
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(-)
configure.ac +7 -4
index 735cfd5..e181c83 100644
@@ -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
Signature · 6 lines
2.9.3

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

Thanks Emil!
This looks good to me.

Quoted 41 lines · Emil Velikov

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).

---
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(-)
configure.ac +1 -4
index 735cfd5..e181c83 100644
@@ -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/

configure.ac fi · line 192

Quoted 10 lines
configure.ac +6 -0
+	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

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

Tested-by on v2 1/1
#3 lore raw
In reply to Emil Velikov

Hi Emil,

Quoted 9 lines · Emil Velikov

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.

Quoted 8 lines

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

---

This fixes my include path problem, so:

Thanks very much for your help,
-Brian

Quoted 32 lines

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(-)
configure.ac +0 -0
index 735cfd5..e181c83 100644
@@ -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])
configure.ac +0 -2
-	DRM_LIBS="$DRM_LIBS $DRM_INTEL_LIBS"
-	AC_SUBST([DRM_LIBS])

else

configure.ac +2 -2
-	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

configure.ac +5 -0
+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])

Quoted 4 lines
# for dma-buf tests
Signature · 1 line
2.9.3

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