[MPlayer-dev-eng] [PATCH] test if X11 libs can be used for linking when autodetecting

Reimar =?UTF8?Q?D=F6ffinger?= Reimar.Doeffinger at stud.uni-karlsruhe.de
Mon Jan 31 16:01:22 CET 2005


Hi,
the attached patch extends configure to not only check which lib dirs
exist but also which contains libs that can be used for linking.
See also http://bugzilla.mplayerhq.hu/show_bug.cgi?id=206
Does anything speak against this modification or can I apply?

Greetings,
Reimar D?ffinger
-------------- 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	29 Jan 2005 20:42:01 -0000
@@ -3381,7 +3385,7 @@
 fi
 
 
-echocheck "X11 libs presence"
+echocheck "working X11 libs"
 if test -z "$_ld_x11" ; then
   for I in /usr/X11R6/lib /usr/lib/X11R6 /usr/X11/lib /usr/lib32 /usr/openwin/lib /usr/X11R6/lib64 /usr/lib ; do
     if test -d "$I" && ( test -f "$I/libX11.so" || test -f "$I/libX11.a" || test -f "$I/libX11.dll.a" ) ; then
@@ -3390,8 +3394,18 @@
       else
         _ld_x11="-L$I"
       fi
+      _ld_x11="$_ld_x11 -lXext -lX11 $_ld_sock"
+      cat > $TMPC <<EOF
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
+EOF
+     if cc_check $_inc_x11 $_ld_x11 ; then
       echores "yes (using $I)"
       break;
+     else
+      _ld_x11=""
+     fi
     fi
   done
   if test -z "$_ld_x11" ; then
@@ -3400,19 +3414,14 @@
   fi
 else
   echores "yes (using $_ld_x11)"
+  _ld_x11="$_ld_x11 -lXext -lX11 $_ld_sock"
 fi
-_ld_x11="$_ld_x11 -lXext -lX11 $_ld_sock"
 
 
 echocheck "X11"
-if test "$_x11" != no ; then
-  cat > $TMPC <<EOF
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
-EOF
-  _x11=no
-  cc_check $_inc_x11 $_ld_x11 && _x11=yes
+if test "$_x11" = auto ; then
+  # X11 lib check will set to no when not working
+  _x11=yes
 fi
 if test "$_x11" = yes ; then
   _def_x11='#define HAVE_X11 1'


More information about the MPlayer-dev-eng mailing list