Bug 7027

Summary: xdpyinfo should be buildable without dmx, dga or xinerama
Product: xorg Reporter: Ingo Bormuth <ibormuth>
Component: Build/ModularAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: high Keywords: patch
Version: 7.0 (2005.12)   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 6666    
Attachments:
Description Flags
configure.ac.patch none

Description Ingo Bormuth 2006-05-25 03:11:27 UTC
xdpyinfo's configure scripts should support --without-dmx, --without-dga and
--without-xinerama. That'd be usable for minimal/embedded installs.

Related bug: http://bugs.gentoo.org/show_bug.cgi?id=132502




--- configure.ac	2005-12-21 03:29:49.000000000 +0100
+++ xdpyinfo-configure.ac	2006-05-24 18:58:03.646296000 +0200
@@ -57,13 +57,20 @@
 	AC_CHECK_HEADERS([X11/extensions/xf86vmode.h
X11/extensions/xf86vmstr.h],,,[#include <X11/Xlib.h>])
 	CPPFLAGS="$SAVE_CPPFLAGS"],[echo "not found"])
 
-PKG_CHECK_MODULES(DPY_XF86DGA, xxf86dga, 
-	[SAVE_CPPFLAGS="$CPPFLAGS"
-	CPPFLAGS="$CPPFLAGS $DPY_XF86DGA_CFLAGS $DPY_X11_CFLAGS"
-	AC_CHECK_HEADERS([X11/extensions/xf86dga.h X11/extensions/xf86dgastr.h],,,
-			 [#include <X11/Xlib.h>
+AC_ARG_WITH(dga, AC_HELP_STRING([--without-dga],[Disable dga support.]), 
+		[USE_DGA="$withval"], [USE_DGA="yes"])
+if test "x$USE_DGA" != "xno" ; then
+	PKG_CHECK_MODULES(DPY_XF86DGA, xxf86dga, 
+		[SAVE_CPPFLAGS="$CPPFLAGS"
+		CPPFLAGS="$CPPFLAGS $DPY_XF86DGA_CFLAGS $DPY_X11_CFLAGS"
+		AC_CHECK_HEADERS([X11/extensions/xf86dga.h X11/extensions/xf86dgastr.h],,,
+				 [#include <X11/Xlib.h>
 #include <X11/Xproto.h>])
-	CPPFLAGS="$SAVE_CPPFLAGS"],[echo "not found"])
+		CPPFLAGS="$SAVE_CPPFLAGS"],[echo "not found"])
+else
+	echo "without dga"
+fi
+
 
 PKG_CHECK_MODULES(DPY_XF86MISC, xxf86misc, 
 	[SAVE_CPPFLAGS="$CPPFLAGS"
@@ -85,17 +92,29 @@
 	AC_CHECK_HEADERS([X11/extensions/Xrender.h],,,[#include <X11/Xlib.h>])
 	CPPFLAGS="$SAVE_CPPFLAGS"],[echo "not found"])
 
-PKG_CHECK_MODULES(DPY_XINERAMA, xinerama, 
-	[SAVE_CPPFLAGS="$CPPFLAGS"
-	CPPFLAGS="$CPPFLAGS $DPY_XINERAMA_CFLAGS $DPY_X11_CFLAGS"
-	AC_CHECK_HEADERS([X11/extensions/Xinerama.h],,,[#include <X11/Xlib.h>])
-	CPPFLAGS="$SAVE_CPPFLAGS"],[echo "not found"])
-
-PKG_CHECK_MODULES(DPY_DMX, dmx, 
-	[SAVE_CPPFLAGS="$CPPFLAGS"
-	CPPFLAGS="$CPPFLAGS $DPY_DMX_CFLAGS $DPY_X11_CFLAGS"
-	AC_CHECK_HEADERS([X11/extensions/dmxext.h],,,[#include <X11/Xlib.h>])
-	CPPFLAGS="$SAVE_CPPFLAGS"],[echo "not found"])
+AC_ARG_WITH(xinerama, AC_HELP_STRING([--without-xinerama],[Disable xinerama
support.]),
+		[USE_XINERAMA="$withval"], [USE_XINERAMA="yes"])
+if test "x$USE_XINERAMA" != "xno" ; then
+	PKG_CHECK_MODULES(DPY_XINERAMA, xinerama, 
+		[SAVE_CPPFLAGS="$CPPFLAGS"
+		CPPFLAGS="$CPPFLAGS $DPY_XINERAMA_CFLAGS $DPY_X11_CFLAGS"
+		AC_CHECK_HEADERS([X11/extensions/Xinerama.h],,,[#include <X11/Xlib.h>])
+		CPPFLAGS="$SAVE_CPPFLAGS"],[echo "not found"])
+else
+	echo "without xinerama"
+fi
+
+AC_ARG_WITH(dmx, AC_HELP_STRING([--without-dmx],[Disable dmx support.]),
+		[USE_DMX="$withval"], [USE_DMX="yes"])
+if test "x$USE_DMX" != "xno" ; then
+	PKG_CHECK_MODULES(DPY_DMX, dmx, 
+		[SAVE_CPPFLAGS="$CPPFLAGS"
+		CPPFLAGS="$CPPFLAGS $DPY_DMX_CFLAGS $DPY_X11_CFLAGS"
+		AC_CHECK_HEADERS([X11/extensions/dmxext.h],,,[#include <X11/Xlib.h>])
+		CPPFLAGS="$SAVE_CPPFLAGS"],[echo "not found"])
+else
+	echo "without dmx"
+fi
 
 PKG_CHECK_MODULES(DPY_XPRINT, xp, 
 	[SAVE_CPPFLAGS="$CPPFLAGS"
Comment 1 Ingo Bormuth 2006-05-25 03:13:47 UTC
Created attachment 5735 [details] [review]
configure.ac.patch

Sorry for the inlined patch.
Comment 2 Adam Jackson 2006-10-12 18:43:19 UTC
Sure, why not.
Comment 3 Daniel Stone 2007-02-27 01:32:11 UTC
Sorry about the phenomenal bug spam, guys.  Adding xorg-team@ to the QA contact so bugs don't get lost in future.
Comment 4 Alan Coopersmith 2007-03-20 09:55:52 UTC
Committed to git master repository for inclusion in xdpyinfo 1.0.2:

commit ea8455a0932c21ef29e97d469b492dadc85dabdc
Author: Ingo Bormuth <ibormuth@efil.de>
Date:   Thu May 25 03:13:00 2006 -0800

    Bug 7027: Add configure options --without-dmx --without-dga --without-xinera
    
    X.Org Bug 7027: <https://bugs.freedesktop.org/show_bug.cgi?id=7027>
    Patch #5735: <https://bugs.freedesktop.org/attachment.cgi?id=5735>
    
    From gentoo bug 132502: <http://bugs.gentoo.org/show_bug.cgi?id=132502>

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.