[Mono-dev] drop X11 dependency in libgdiplus

Zac Bowling zac at zacbowling.com
Sat May 27 19:06:34 EDT 2006


Hey guys,

I noticed this and it has been bothering me to high heaven. The
packaging tools for debian and rpm see Xib reference in the configure.in
and add deps to x11-common. Makes it annoying when you want to use
System.Drawing in xsp on a server. 

I checked it out, and it looks like the only Xlib functions we call are
all in "#if CAIRO_HAS_XLIB_SURFACE" blocks. If CAIRO_HAS_XLIB_SURFACE is
defined then we include cairo-xlib.h which has a reference to X11/Xlib.h
already so really don't one ourselves that. Another option is just to
include the include to X11/Xlib.h in its own "#if
CAIRO_HAS_XLIB_SURFACE" block. 

I'm not sure if we still even use our libgdiplus on win32 much anymore
(it's been a while since I built it) but I think its just been compiling
on win32 because X11/Xlib.h does exist in most cygwin installs but we
just don't link xlib on win32.


Anyways here is a simple patch remove the dependencies:

Index: configure.in
===================================================================
--- configure.in        (revision 61143)
+++ configure.in        (working copy)
@@ -273,11 +273,11 @@
 dnl
 dnl Produce a diagnostic, to reduce support time
 dnl
-AC_TRY_COMPILE([#include <X11/Xlib.h>],
-                        [],[x11_failed=false],[x11_failed=true])
-if $x11_failed; then
-   AC_ERROR("Failed to compile with X11/Xlib.h include.  You must fix
your compiler paths")
-fi
+dnl AC_TRY_COMPILE([#include <X11/Xlib.h>],
+dnl                     [],[x11_failed=false],[x11_failed=true])
+dnl if $x11_failed; then
+dnl   AC_ERROR("Failed to compile with X11/Xlib.h include.  You must
fix your compiler paths")
+dnl fi

 AC_SUBST(GDIPLUS_LIBS)
 AC_SUBST(GDIPLUS_CFLAGS)
Index: src/gdip.h
===================================================================
--- src/gdip.h  (revision 61143)
+++ src/gdip.h  (working copy)
@@ -31,7 +31,7 @@
 #else
 #include <cairo/cairo.h>
 #endif
-#include <X11/Xlib.h>
+//#include <X11/Xlib.h>

 #ifdef CAIRO_HAS_FT_FONT
 #ifdef USE_INCLUDED_CAIRO



-- 
Zac Bowling <zac at zacbowling.com>




More information about the Mono-devel-list mailing list