[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.

Cheers,
  Peter


-----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
>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>
>
>_______________________________________________
>Mono-devel-list mailing list
>Mono-devel-list at lists.ximian.com
>http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
> 




More information about the Mono-devel-list mailing list