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

Gaetan Nadon memsize at videotron.ca
Wed Jun 16 06:18:10 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.

Reviewed-by: Dan Nicholson <dbn.lists at gmail.com>
Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
---
 configure.ac      |   14 +++++++++++++-
 xorg-server.pc.in |    3 ++-
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 4ada8f5..a7b2c30 100644
--- a/configure.ac
+++ b/configure.ac
@@ -793,9 +793,14 @@ WINDOWSWMPROTO="windowswmproto"
 APPLEWMPROTO="applewmproto >= 1.4"
 
 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]"
+SDK_REQUIRED_MODULES="[xproto >= 7.0.17] [randrproto >= 1.2.99.3] [renderproto >= 0.11] [xextproto >= 7.0.99.3] [inputproto >= 1.9.99.902] [kbproto >= 1.0.3] fontsproto"
+REQUIRED_MODULES="[fixesproto >= 4.1] [damageproto >= 1.1] [xcmiscproto >= 1.2.0] [xtrans >= 1.2.2] [bigreqsproto >= 1.1.0] $SDK_REQUIRED_MODULES"
 REQUIRED_LIBS="xfont xau"
 
+# Make required and optional modules available for inclusion in xorg-server.pc
+AC_SUBST(SDK_REQUIRED_MODULES)
+AC_SUBST(SDK_OPTIONAL_MODULES)
+
 dnl List of libraries that require a specific version
 LIBAPPLEWM="applewm >= 1.4"
 LIBDMX="dmx >= 1.0.99.1"
@@ -947,6 +952,7 @@ if test "x$XV" = xyes; then
 	AC_DEFINE(XV, 1, [Support Xv extension])
 	AC_DEFINE(XvExtension, 1, [Build Xv extension])
 	REQUIRED_MODULES="$REQUIRED_MODULES $VIDEOPROTO"
+	SDK_OPTIONAL_MODULES="$SDK_OPTIONAL_MODULES $VIDEOPROTO"
 else
 	XVMC=no
 fi
@@ -979,6 +985,7 @@ AM_CONDITIONAL(RECORD, [test "x$RECORD" = xyes])
 if test "x$RECORD" = xyes; then
 	AC_DEFINE(XRECORD, 1, [Support Record extension])
 	REQUIRED_MODULES="$REQUIRED_MODULES $RECORDPROTO"
+	SDK_OPTIONAL_MODULES="$SDK_OPTIONAL_MODULES $RECORDPROTO"
 	RECORD_LIB='$(top_builddir)/record/librecord.la'
 fi
 
@@ -1001,6 +1008,7 @@ if test "x$GLX" = xyes; then
 	AC_DEFINE(GLXEXT, 1, [Build GLX extension])
 	GLX_LIBS='$(top_builddir)/glx/libglx.la'
 	GLX_SYS_LIBS="$GLX_SYS_LIBS"
+	SDK_OPTIONAL_MODULES="$SDK_OPTIONAL_MODULES $GLPROTO"
 else
         GLX=no
 fi
@@ -1025,6 +1033,7 @@ if test "x$DRI" = xyes; then
 	PKG_CHECK_MODULES([DRIPROTO], [$DRIPROTO])
 	PKG_CHECK_MODULES([DRI], $GLPROTO $LIBDRI)
 	AC_SUBST(DRIPROTO_CFLAGS)
+	SDK_OPTIONAL_MODULES="$SDK_OPTIONAL_MODULES $DRIPROTO"
 fi
 
 PKG_CHECK_MODULES([DRI2PROTO], $DRI2PROTO,
@@ -1036,6 +1045,7 @@ case "$DRI2,$HAVE_DRI2PROTO" in
 	yes,yes | auto,yes)
 		AC_DEFINE(DRI2, 1, [Build DRI2 extension])
 		DRI2=yes
+		SDK_OPTIONAL_MODULES="$SDK_OPTIONAL_MODULES $DRI2PROTO"
 		;;
 esac
 AM_CONDITIONAL(DRI2, test "x$DRI2" = xyes)
@@ -1074,6 +1084,7 @@ if test "x$XINERAMA" = xyes; then
 	AC_DEFINE(XINERAMA, 1, [Support Xinerama extension])
 	AC_DEFINE(PANORAMIX, 1, [Internal define for Xinerama])
 	REQUIRED_MODULES="$REQUIRED_MODULES $XINERAMAPROTO"
+	SDK_OPTIONAL_MODULES="$SDK_OPTIONAL_MODULES $XINERAMAPROTO"
 fi
 
 AM_CONDITIONAL(XACE, [test "x$XACE" = xyes])
@@ -1744,6 +1755,7 @@ if test "x$XORG" = xyes; then
 	fi
 	if test "x$DGA" = xyes; then
 		XORG_MODULES="$XORG_MODULES $DGAPROTO"
+		SDK_OPTIONAL_MODULES="$SDK_OPTIONAL_MODULES $DGAPROTO"
 		PKG_CHECK_MODULES(DGA, $DGAPROTO)
 		AC_DEFINE(DGA, 1, [Support DGA extension])
 		AC_DEFINE(XFreeXDGA, 1, [Build XDGA support])
diff --git a/xorg-server.pc.in b/xorg-server.pc.in
index 44f886a..0b4392d 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: @SDK_REQUIRED_MODULES@ @SDK_OPTIONAL_MODULES@
 Cflags: -I${sdkdir} @symbol_visibility@
 Libs: -L${libdir}
-- 
1.6.0.4

Fifth edition.

Analysing all 55 drivers for dependencies led to the addition of:

Optional:
recordproto 	used by synaptics
xf86driproto	used by 13 drivers
xf86dgaproto	used by 8 drivers
glproto		used by 3 drivers

Not optional:
fonstproto	used by 43 drivers




More information about the xorg-devel mailing list