summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2018-02-23 10:52:58 +0000
committerEmmanuele Bassi <ebassi@gnome.org>2018-02-23 16:05:50 +0000
commitbaa75c4a92bff37cb742a8c3ad42ab93e4f2a3d6 (patch)
treecd6b09e5268b1c8296d6544c7faaca76b1d11fd0
parentf8a7661f2a63c9ffe86151439b4243836c5cb82a (diff)
downloadlibepoxy-baa75c4a92bff37cb742a8c3ad42ab93e4f2a3d6.tar.gz
Add gl and egl private dependencies
If the system we're building Epoxy on has GL and EGL pkg-config modules, then we should add them to the Requires.private field of the pkg-config file. The Requires.private field does not contribute to the linker flags generated by pkg-config, unless we're doing a static build; it does, however, contribute to the compiler flags generated by pkg-config, which means that platforms that specify ad hoc compiler flags for their GL and EGL implementations via pkg-config will be able to propagate them through Epoxy. Closes: #139
-rw-r--r--configure.ac6
-rw-r--r--epoxy.pc.in1
-rw-r--r--src/meson.build12
3 files changed, 19 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 8a4ffea..045f920 100644
--- a/configure.ac
+++ b/configure.ac
@@ -227,6 +227,12 @@ fi
AM_CONDITIONAL(HAVE_X11, test x$x11 = xyes)
PKG_CHECK_MODULES(GL, [gl], [gl=yes], [gl=no])
+PKG_CHECK_MODULES(EGL, [egl], [egl=yes], [egl=no])
+
+GL_REQS=""
+AS_IF([test x$gl = xyes], [GL_REQS="$GL_REQS gl"])
+AS_IF([test x$build_egl = xyes && test x$egl = xyes], [GL_REQS="$GL_REQS egl"])
+AC_SUBST(GL_REQS)
# Variables for the pkg-config file; AC_SUBST does not do `test` substitutions,
# so we need to specify the boolean values here
diff --git a/epoxy.pc.in b/epoxy.pc.in
index 7828a77..cdda8d9 100644
--- a/epoxy.pc.in
+++ b/epoxy.pc.in
@@ -13,3 +13,4 @@ Version: @PACKAGE_VERSION@
Cflags: -I${includedir}
Libs: -L${libdir} -lepoxy
Libs.private: @DLOPEN_LIBS@
+Requires.private: @GL_REQS@
diff --git a/src/meson.build b/src/meson.build
index e54eed2..3401075 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -89,6 +89,17 @@ epoxy_has_glx = build_glx ? '1' : '0'
epoxy_has_egl = build_egl ? '1' : '0'
epoxy_has_wgl = build_wgl ? '1' : '0'
+# We don't want to add these dependencies to the library, as they are
+# not needed when building Epoxy; we do want to add them to the generated
+# pkg-config file, for consumers of Epoxy
+gl_reqs = []
+if gl_dep.found()
+ gl_reqs += 'gl'
+endif
+if build_egl and egl_dep.found()
+ gl_reqs += 'egl'
+endif
+
pkg = import('pkgconfig')
pkg.generate(
libraries: libepoxy,
@@ -101,4 +112,5 @@ pkg.generate(
'epoxy_has_wgl=@0@'.format(epoxy_has_wgl),
],
filebase: 'epoxy',
+ requires_private: ' '.join(gl_reqs),
)