Cross compiling for Xming.exe since Mesa merge

Colin Harrison colin.harrison at virgin.net
Thu Aug 25 08:50:25 PDT 2005


Hi,

Things have moved on. Here is my latest solution.

To cross compile Xming.exe using the xorg/xc CVS tree:-
make World CROSSCOMPILEDIR=/usr/local/cross-tools/i386-mingw32msvc/bin
LOCAL_LDFLAGS=-mwindows
(requires pthreads library to be compiled by Mingw first, see below)

The following three patches are required:-

--- ./extras/Mesa/include/GL/save_glxext.h      2005-08-11
23:44:06.000000000 +0100
+++ ./extras/Mesa/include/GL/glxext.h   2005-08-11 23:51:36.000000000 +0100
@@ -347,6 +347,8 @@
 #include <inttypes.h>
 #elif defined(__SCO__) || defined(__USLC__)
 #include <stdint.h>
+#elif defined(WIN32) && defined(__GNUC__)
+#include <stdint.h>
 #endif

 #ifndef GLX_VERSION_1_3

--- ./extras/Mesa/src/glx/x11/save_indirect_size.h      2005-08-24
12:04:24.000000000 +0100
+++ ./extras/Mesa/src/glx/x11/indirect_size.h   2005-08-24
12:06:01.000000000 +0100
@@ -61,6 +61,15 @@
 #    define INTERNAL
 #  endif

+#  ifdef __MINGW32__
+#    undef PURE
+#    undef FASTCALL
+#    undef INTERNAL
+#    define PURE
+#    define FASTCALL
+#    define INTERNAL
+#  endif
+
 extern INTERNAL PURE FASTCALL GLint __glCallLists_size(GLenum);
 extern INTERNAL PURE FASTCALL GLint __glFogfv_size(GLenum);
 extern INTERNAL PURE FASTCALL GLint __glFogiv_size(GLenum);

--- ./extras/Mesa/src/glx/x11/save_indirect_size.c      2005-08-24
12:04:17.000000000 +0100
+++ ./extras/Mesa/src/glx/x11/indirect_size.c   2005-08-24
12:05:16.000000000 +0100
@@ -59,6 +59,16 @@
 #    define INTERNAL
 #  endif

+#  ifdef __MINGW32__
+#    undef HAVE_ALIAS
+#    undef PURE
+#    undef FASTCALL
+#    undef INTERNAL
+#    define PURE
+#    define FASTCALL
+#    define INTERNAL
+#  endif
+
 #ifdef HAVE_ALIAS
 #  define ALIAS2(from,to) \
     INTERNAL PURE FASTCALL GLint __gl ## from ## _size( GLenum e ) \


The xkbcomp.exe and Xming.exe will then work on windows if pthreads has been
compiled into mingw first:-

export PATH=/usr/local/cross-tools/bin:$PATH
make  CROSS=i386-mingw32msvc- clean GC
cp sched.h semaphore.h pthread.h
/usr/local/cross-tools/i386-mingw32msvc/include
cp libpthreadGC2.a /usr/local/cross-tools/i386-mingw32msvc/lib
cp pthreadGC2.dll /usr/local/cross-tools/i386-mingw32msvc/bin

(adjust the paths for your Mingw installation)


Colin Harrison
















More information about the xorg mailing list