[Mono-dev] drop X11 dependency in libgdiplus

Peter Dennis Bartok peter at novonyx.com
Sat May 27 21:34:54 EDT 2006

You should never be building libgdiplus on win32. Also, we do our own X11 
calls in libgdiplus, too, and need the -lx11 link instruction.
Check out general.c, gdip_get_display_dpi(), where we call XOpenDisplay and 
XGetDefault. And that is not wrapped inside #CAIRO_HAS_XLIB_SURFACE.


-----Original Message-----
From: "Zac Bowling" <zac at zacbowling.com>
To: "Mono-Devel-List" <mono-devel-list at lists.ximian.com>
Date: Saturday, 27 May, 2006 17:07
Subject: [Mono-dev] drop X11 dependency in libgdiplus

>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
>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
>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")
>+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
>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>
>Zac Bowling <zac at zacbowling.com>
>Mono-devel-list mailing list
>Mono-devel-list at lists.ximian.com

More information about the Mono-devel-list mailing list