[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 >=] [renderproto >= 0.11] [fixesproto >= 4.1] [damageproto >= 1.1] [xcmiscproto >= 1.2.0] [xextproto >=] [xproto >= 7.0.17] [xtrans >= 1.2.2] [bigreqsproto >= 1.1.0] fontsproto [inputproto >=] [kbproto >= 1.0.3]"
 REQUIRED_LIBS="xfont xau"
+# Make REQUIRED_MODULES available for inclusion in xorg-server.pc
 dnl List of libraries that require a specific version
 LIBAPPLEWM="applewm >= 1.4"
 LIBDMX="dmx >="
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
-Requires: pixman-1 pciaccess xproto >= 7.0.17
+Requires: pixman-1 pciaccess
+Requires.private: @REQUIRED_MODULES@
 Cflags: -I${sdkdir} @symbol_visibility@
 Libs: -L${libdir}

Third edition.

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

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