[virglrenderer-devel] [PATCH v2] configure: check for -lgbm

Michal Privoznik mprivozn at redhat.com
Thu Feb 25 06:14:26 UTC 2016


We use the library unconditionally, however not check it in
configure phase. Let's produce an error there and not at
compilation phase.
And while at it, drop -ldl from LDFLAGS too. I suspect it's
coming from the same source because in the gbm pkg-config file
private libs are to be linked with dl. But not only we are not a
gbm private library, we don't use dl*() anywhere.

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---

diff to v1:
- use PKG_CHECK_MODULES instead of AC_CHECK_LIB

 configure.ac    | 1 +
 src/Makefile.am | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 325e8b9..0a1799d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -83,6 +83,7 @@ LIBDRM_REQUIRED=2.4.50
 
 PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED])
 PKG_CHECK_MODULES([EPOXY], [epoxy])
+PKG_CHECK_MODULES([GBM], [gbm])
 
 AC_SUBST([DEFINES])
 AC_CONFIG_FILES([
diff --git a/src/Makefile.am b/src/Makefile.am
index df59fc7..9128ec5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,5 +1,6 @@
 SUBDIRS := gallium/auxiliary
-AM_LDFLAGS = -lgbm -lm -ldl \
+AM_LDFLAGS = -lm \
+	$(GBM_LIBS) \
 	$(EPOXY_LIBS) \
 	$(CODE_COVERAGE_LDFLAGS)
 
@@ -9,6 +10,7 @@ AM_CFLAGS = \
 	$(DEFINES) \
 	$(PIC_FLAGS) \
 	$(LIBDRM_CFLAGS) \
+	$(GBM_CFLAGS) \
 	$(EPOXY_CFLAGS) \
 	$(VISIBILITY_CFLAGS) \
 	$(CODE_COVERAGE_CFLAGS)
-- 
2.4.10



More information about the virglrenderer-devel mailing list