[MPlayer-dev-eng] check for XFree86-VidModeExtension broken for xfree 3.3.x

Trent Piepho xyzzy at speakeasy.org
Tue Feb 1 23:26:53 CET 2005


On Tue, 1 Feb 2005, Diego Biurrun wrote:
> > > You add a check so you should also add --disable and --enable options
> > > to configure.
> > 
> > Ok, here is an updated patch.  IMHO, the multi-media keyboard support is such
> > a minor thing it's not really worth the clutter of another configure option.
> 
> You could argue that, but I think we should be consistent.

There are dozens of checks for header files that lack enable and disable
options, so it's not totally inconsistent.

> > +if test "$_x11" = yes && test "$_xk" != no ; then
> 
> This will run autodetection when _xk is set to "yes" or "auto".  It
> should only run autodetection in the "auto" case, "yes" is for
> overriding autodetection.

I was copying how some other checks work:

if test "$_x11" != no ; then
if test "$_x11" = yes && test "$_xv" != no ; then
if test "$_nas" = auto || test "$_nas" = yes ; then
if (test "$_x11" = yes || win32) && test "$_gl" != no ; then
if test "$_x11" = yes && test "$_vm" != no ; then
if test "$_x11" = yes && test "$_xinerama" != no ; then
if test "$_alsa" != no ; then
if test "$_xvid" != no && cc_check $_inc_xvid $_ld_xvid ; then
if test "$_x264" != no && cc_check $_inc_x264 $_ld_x264 ; then
if test "$_divx4linux" != no && cc_check $_ld_lm -ldivxdecore ; then
if test "$_i18n" != no ; then

There are many more checks where 'yes' will cause auto-detection to be
skipped, but I only looked at the _vm check I was trying to fix, and
duplicated how it worked, as opposed to surveying every check that supports
auto-detection, as I have now done.

This patch allows auto-detection to be overridden for the _xf86xk check and
for the _vm check too.  If someone wants to fix the other unrelated checks
that don't override, I've listed them for you.
-------------- next part --------------
Index: configure
===================================================================
RCS file: /cvsroot/mplayer/main/configure,v
retrieving revision 1.957
diff -u -r1.957 configure
--- configure	22 Jan 2005 18:30:23 -0000	1.957
+++ configure	1 Feb 2005 22:10:26 -0000
@@ -161,6 +161,7 @@
   --enable-lirc          enable LIRC (remote control) support [autodetect]
   --enable-lircc         enable LIRCCD (LIRC client daemon) input [autodetect]
   --enable-joystick      enable joystick support [disable]
+  --disable-xf86xk       disable support for 'multimedia' keys [autodetect]
   --disable-tv           disable TV Interface (tv/dvb grabbers) [enable]
   --disable-tv-v4l       disable Video4Linux TV Interface support [autodetect]
   --disable-tv-v4l2      disable Video4Linux2 TV Interface support [autodetect]
@@ -1341,6 +1342,7 @@
 _mga=auto
 _xmga=auto
 _vm=auto
+_xf86xk=auto
 _mlib=auto
 _sgiaudio=auto
 _sunaudio=auto
@@ -1547,6 +1549,8 @@
   --disable-xmga)	_xmga=no	;;
   --enable-vm)		_vm=yes		;;
   --disable-vm)		_vm=no		;;
+  --enable-xf86xk)	_xf86xk=yes	;;
+  --disable-xf86xk)	_xf86xk=no	;;
   --enable-mlib)	_mlib=yes	;;
   --disable-mlib)	_mlib=no	;;
   --enable-sunaudio)	_sunaudio=yes	;;
@@ -3546,17 +3550,16 @@
 # This check may be useful for future mplayer versions (to change resolution)
 # If you run into problems, remove '-lXxf86vm'.
 echocheck "Xxf86vm"
-if test "$_x11" = yes && test "$_vm" != no ; then
-  cat > $TMPC <<EOF
+if test "$_vm" = auto ; then
+  _vm=no
+  if test "$_x11" = yes ; then
+    cat > $TMPC <<EOF
 #include <X11/Xlib.h>
 #include <X11/extensions/xf86vmode.h>
-#include <X11/XF86keysym.h>
 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
 EOF
-  _vm=no
-  cc_check $_inc_x11 -lXxf86vm $_ld_x11 && _vm=yes
-else
-  _vm=no
+    cc_check $_inc_x11 -lXxf86vm $_ld_x11 && _vm=yes
+  fi
 fi
 if test "$_vm" = yes ; then
   _def_vm='#define HAVE_XF86VM 1'
@@ -3566,6 +3569,28 @@
 fi
 echores "$_vm"
 
+# Check for the presence of special keycodes, like audio control buttons
+# that XFree86 might have.  Used to be bundled with the xf86vm check, but
+# has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT 
+# have these new keycodes
+echocheck "XF86keysym"
+if test "$_xf86xk" = auto; then
+  _xf86xk=no
+  if test "$_x11" = yes ; then
+    cat > $TMPC <<EOF
+#include <X11/Xlib.h>
+#include <X11/XF86keysym.h>
+int main(void) { return XF86XK_AudioPause; }
+EOF
+    cc_check $_inc_x11 $_ld_x11 && _xf86xk=yes
+  fi
+fi
+if test "$_xf86xk" = yes ; then
+  _def_xf86xk='#define HAVE_XF86XK 1'
+else
+  _def_xf86xk='#undef HAVE_XF86XK'
+fi
+echores "$_xf86xk"
 
 echocheck "DGA"
 # Version 2 is preferred to version 1 if available
@@ -7391,6 +7416,7 @@
 $_def_xv
 $_def_xvmc
 $_def_vm
+$_def_xf86xk
 $_def_xinerama
 $_def_gl
 $_def_gl_win32
Index: libvo/x11_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/x11_common.c,v
retrieving revision 1.186
diff -u -r1.186 x11_common.c
--- libvo/x11_common.c	27 Dec 2004 11:09:49 -0000	1.186
+++ libvo/x11_common.c	1 Feb 2005 22:10:27 -0000
@@ -37,6 +37,9 @@
 
 #ifdef HAVE_XF86VM
 #include <X11/extensions/xf86vmode.h>
+#endif
+
+#ifdef HAVE_XF86XK
 #include <X11/XF86keysym.h>
 #endif
 


More information about the MPlayer-dev-eng mailing list