[PATCH v3 xserver] config: declare xserver private dependencies in xorg-server.pc

Gaetan Nadon memsize at videotron.ca
Tue Jun 15 08:52:37 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.

Now that xproto is included in Requires.private it is removed from Requires.
All the cflags from both Requires and Requires.private are returned
to caller to pkg-config.

Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
---
 configure.ac      |    3 +++
 xorg-server.pc.in |    3 ++-
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index 4ada8f5..cfe8041 100644
--- a/configure.ac
+++ b/configure.ac
@@ -796,6 +796,9 @@ dnl Core modules for most extensions, et al.
 REQUIRED_MODULES="[randrproto >= 1.2.99.3] [renderproto >= 0.11] [fixesproto >= 4.1] [damageproto >= 1.1] [xcmiscproto >= 1.2.0] [xextproto >= 7.0.99.3] [xproto >= 7.0.17] [xtrans >= 1.2.2] [bigreqsproto >= 1.1.0] fontsproto [inputproto >= 1.9.99.902] [kbproto >= 1.0.3]"
 REQUIRED_LIBS="xfont xau"
 
+# Make REQUIRED_MODULES available for inclusion in xorg-server.pc
+AC_SUBST(REQUIRED_MODULES)
+
 dnl List of libraries that require a specific version
 LIBAPPLEWM="applewm >= 1.4"
 LIBDMX="dmx >= 1.0.99.1"
diff --git a/xorg-server.pc.in b/xorg-server.pc.in
index 44f886a..e0bd256 100644
--- a/xorg-server.pc.in
+++ b/xorg-server.pc.in
@@ -15,6 +15,7 @@ abi_extension=@abi_extension@
 Name: xorg-server
 Description: Modular X.Org X Server
 Version: @PACKAGE_VERSION@
-Requires: pixman-1 pciaccess xproto >= 7.0.17
+Requires: pixman-1 pciaccess
+Requires.private: @REQUIRED_MODULES@
 Cflags: -I${sdkdir} @symbol_visibility@
 Libs: -L${libdir}
-- 
1.6.0.4

Third edition.

There is a side-effect, some compiler flags are added due to xtrans:
-D_BSD_SOURCE -DHAS_FCHOWN -DHAS_STICKY_DIR_BIT

Given that the drivers are part of the server and the the server code is compiled
with these flags, there should be no issue. A driver can always append a flag to correct
any situation.





More information about the xorg-devel mailing list