<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>George Wright's Blog: Compiling NXWin on Windows/Cygwin</title>
    <link>http://blog.gwright.org.uk/articles/2008/01/27/compiling-nxwin-on-windows-cygwin</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Random bloggings of a clearly disturbed KDE geek</description>
    <item>
      <title>Compiling NXWin on Windows/Cygwin</title>
      <description>&lt;p&gt;&lt;b&gt;Edit&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;i&gt;These instructions have been confirmed not to work. While they may allow NXWin to compile, the buildsystem fails with lots of linker errors&amp;#8230; Still scratching my head about how to fix this, but for now I&amp;#8217;ve contacted NoMachine about it.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;&lt;strike&gt;It turns out NXWin isn&amp;#8217;t set to compile by default on Cygwin. Anyway, I finally managed to get it to compile inside the nx-X11 tree with a little patching to the source code, and I figured I&amp;#8217;d better blog about it for anyone else who is interested in this, and also so that in the inevitable outcome where I forget how I did it, I can fall back on this blog.&lt;/p&gt;

&lt;p&gt;First off, you need to edit &lt;code&gt;config/cf/host.def&lt;/code&gt; and set the following:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;
#define NXWinServer YES&lt;br /&gt;
#define XWinServer YES
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The XWinServer define is probably not needed, but as this machine&amp;#8217;s quite a slow compiler I&amp;#8217;m not going to change it and see, as contrary to popular belief I don&amp;#8217;t like sitting around watching stuff compile.&lt;/p&gt;

&lt;p&gt;However, the real fun starts when trying to compile NXWin itself. Turns out it&amp;#8217;s broken - I have no idea why, or even how NoMachine themselves compile it, but I had to patch a few lines in various files before it would compile.&lt;/p&gt;

&lt;p&gt;The following are the changes I made in &lt;code&gt;programs/Xserver/hw/nxwin&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;NXwindow.c:3537&lt;/code&gt;
&lt;br /&gt;Line should be:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;code&gt;pWin = SaveSetWindow(client-&gt;saveSet[j]);&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;NXdispatch.c:228-229&lt;/code&gt;
&lt;br /&gt;Lines should be:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;code&gt;volatile char dispatchException = 0;&lt;/code&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;code&gt;volatile char isItTimeToYield;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;NXdispatch.c:871&lt;/code&gt;
&lt;br /&gt;Line should be:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;code&gt;result = AlterSaveSetForChildren(client, pWin, stuff-&gt;mode, FALSE, TRUE);&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;NXevent.c:215&lt;/code&gt;
&lt;br /&gt;Comment out the struct for HotSpot&lt;/p&gt;

&lt;p&gt;&lt;code&gt;winmsg.h:74&lt;/code&gt;
&lt;br /&gt;Comment out the enum for MessageType&lt;/p&gt;

&lt;p&gt;You can then just go ahead and compile with &lt;code&gt;make World&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Most of the inspiration for these little patches were taken from the dix/ server.&lt;/p&gt;

&lt;p&gt;This, obviously, isn&amp;#8217;t ideal, but there&amp;#8217;s a &lt;i&gt;dire&lt;/i&gt; lack of any documentation for NX on Windows. I know that NoMachine use Cygwin to compile their stuff, but it all seems very hacky (which, to be honest, is the general impression I get of Cygwin) and unpolished.&lt;/strike&gt;&lt;/p&gt;

&lt;p&gt;If anybody who actually knows how to build the NX packages on Windows is reading this, if they could contact me and let me know what the preferred method of compiling NX&amp;#8217;s open source components is I&amp;#8217;d be most grateful.&lt;/p&gt;</description>
      <pubDate>Sun, 27 Jan 2008 00:08:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:7fcf8875-fbf4-458c-9fac-683c51550419</guid>
      <author>gwright@kde.org (George Wright)</author>
      <link>http://blog.gwright.org.uk/articles/2008/01/27/compiling-nxwin-on-windows-cygwin</link>
      <category>NX</category>
    </item>
    <item>
      <title>"Compiling NXWin on Windows/Cygwin" by Ryan Pavlik</title>
      <description>&lt;p&gt;I have no experience in particular with NX, but a fair amount with Unixy compiling on Windows.  Your description of Cygwin as hacky is correct - it provides basically a Unix compatibility layer, cygwin1.dll, that is needed by everything compiled using the cygwin compiler.  (There are ways to use just the shell, make, etc, and use, say, the MS Visual C++ compiler, but I don&amp;#8217;t do that so I don&amp;#8217;t have more info - maybe see &lt;a href="http://www.abisource.com" rel="nofollow"&gt;www.abisource.com&lt;/a&gt; and the old Windows build docs for info on that.)&lt;/p&gt;

&lt;p&gt;If you want to make an honest-to-goodness, real Windows binary, your best bet is MinGW (a native Windows GCC) and MSYS (a corresponding unixish environment to compile in).  There are several (many?) projects who produce their Windows binaries this way, since it allows you to use the tools you&amp;#8217;re used to (make, auto*, pkg-config) yet still end up with a real Windows binary, not a pseudo-Unix binary with a clumsy dependency.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;ve got build instructions for some common FOSS libraries and such on my web site - I do the building for AbiWord so have to build some of its deps too.  Might be worth a look.&lt;/p&gt;

&lt;p&gt;Good luck!&lt;/p&gt;</description>
      <pubDate>Sun, 27 Jan 2008 00:47:03 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:f0ce6290-9cf8-4e07-81c1-96cb39f6ccd8</guid>
      <link>http://blog.gwright.org.uk/articles/2008/01/27/compiling-nxwin-on-windows-cygwin#comment-398</link>
    </item>
  </channel>
</rss>
