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
macos/v1.5.9
Emmanuele Bassi 7 years ago
parent f8a7661f2a
commit baa75c4a92
  1. 6
      configure.ac
  2. 1
      epoxy.pc.in
  3. 12
      src/meson.build

@ -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

@ -13,3 +13,4 @@ Version: @PACKAGE_VERSION@
Cflags: -I${includedir}
Libs: -L${libdir} -lepoxy
Libs.private: @DLOPEN_LIBS@
Requires.private: @GL_REQS@

@ -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),
)

Loading…
Cancel
Save