[PATCH xserver] config: declare xserver private dependencies in xorg-server.pc
Gaetan Nadon
memsize at videotron.ca
Thu Jun 10 05:54:38 PDT 2010
Any module (drivers) depending on xserver also depends on some of the
server private dependencies. Any driver including xf86.h depends on
xext, kbproto, inputproto and randr.
These dependencies are in separate packages, so anything can happen,
removal, wrong version, etc... and the driver fails during compilation.
Having the private dependencies declared will ensure all packages the
server depends on are present and at the correct version.
Currently each module attempts to check for server dependencies with
various degrees of accuracy. With this patch, the driver will only need
to check for its own explicit dependencies.
Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
---
configure.ac | 3 +++
xorg-server.pc.in | 1 +
2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/configure.ac b/configure.ac
index c8b49de..a6bc475 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1438,6 +1438,9 @@ AC_SUBST(SHA1_CFLAGS)
PKG_CHECK_MODULES([XSERVERCFLAGS], [$REQUIRED_MODULES $REQUIRED_LIBS])
PKG_CHECK_MODULES([XSERVERLIBS], [$REQUIRED_LIBS])
+# Make REQUIRED_MODULES available for inclusion in xorg-server.pc
+AC_SUBST(REQUIRED_MODULES)
+
# Autotools has some unfortunate issues with library handling. In order to
# get a server to rebuild when a dependency in the tree is changed, it must
# be listed in SERVERNAME_DEPENDENCIES. However, no system libraries may be
diff --git a/xorg-server.pc.in b/xorg-server.pc.in
index 44f886a..898bed2 100644
--- a/xorg-server.pc.in
+++ b/xorg-server.pc.in
@@ -16,5 +16,6 @@ Name: xorg-server
Description: Modular X.Org X Server
Version: @PACKAGE_VERSION@
Requires: pixman-1 pciaccess xproto >= 7.0.17
+Requires.private: @REQUIRED_MODULES@
Cflags: -I${sdkdir} @symbol_visibility@
Libs: -L${libdir}
--
1.6.0.4
Example: input driver evdev will not compile if randr or xext proto package is missing,
althought it does not include any header from these packages. (Comes from xf86.h)
With the patch, "PKG_CHECK_MODULES(XORG, xorg-server xproto inputproto)" will be sufficient.
Question: many drivers require xextproto >= 7.0.99.1 while xserver requires 7.0.99.3.
Is it by design or has the version not been updated?
Thanks to Julien for the suggestion.
More information about the xorg-devel
mailing list