Encode Epoxy capabilities into the pkg-config file

Since Epoxy can be built with different platform-specific API, having a
way for dependent projects to discover those capabilities without
necessarily crashing the minute they attempt to use them is a good
feature to have.

We strongly direct library and application developers to use pkg-config
in order to use Epoxy, so it makes sense to add variables to the
epoxy.pc file that can be easily extracted at configuration time.
macos/v1.5.9
Emmanuele Bassi 8 years ago
parent 2b6f01b008
commit 7b52d33d86
  1. 9
      configure.ac
  2. 4
      epoxy.pc.in
  3. 3
      meson.build

@ -205,6 +205,15 @@ AM_CONDITIONAL(HAVE_X11, test x$x11 = xyes)
PKG_CHECK_MODULES(GL, [gl], [gl=yes], [gl=no])
# Variables for the pkg-config file; AC_SUBST does not do `test` substitutions,
# so we need to specify the boolean values here
AS_IF([test x$build_glx = xyes], [epoxy_has_glx=1], [epoxy_has_glx=0])
AS_IF([test x$build_egl = xyes], [epoxy_has_egl=1], [epoxy_has_egl=0])
AS_IF([test x$build_wgl = xyes], [epoxy_has_wgl=1], [epoxy_has_wgl=0])
AC_SUBST(epoxy_has_glx)
AC_SUBST(epoxy_has_egl)
AC_SUBST(epoxy_has_wgl)
AC_CONFIG_FILES([
epoxy.pc
Makefile

@ -3,6 +3,10 @@ exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
epoxy_has_glx=@epoxy_has_glx@
epoxy_has_egl=@epoxy_has_egl@
epoxy_has_wgl=@epoxy_has_wgl@
Name: epoxy
Description: epoxy GL dispatch Library
Version: @PACKAGE_VERSION@

@ -160,6 +160,9 @@ pkgconf.set('prefix', epoxy_prefix)
pkgconf.set('exec_prefix', epoxy_prefix)
pkgconf.set('libdir', epoxy_libdir)
pkgconf.set('includedir', epoxy_includedir)
pkgconf.set10('epoxy_has_glx', build_glx)
pkgconf.set10('epoxy_has_egl', build_egl)
pkgconf.set10('epoxy_has_wgl', build_wgl)
pkgconf.set('PACKAGE_VERSION', meson.project_version())
if dl_dep.found()
pkgconf.set('DLOPEN_LIBS', '-ldl')

Loading…
Cancel
Save