February 25, 2008

Compiling mrxvt under SUA

The last time I talked about the problems with porting mrxvt to SUA, I had a lot of problems getting SUA installed and working properly.  On top of that, was the problem of porting mrxvt, but now that I've got it working under Vista, I'll document what I did incase anyone else wants to do the same thing I did.

My original intent to use SUA was that I wanted a good tabbed terminal under Windows.  Although I love PuTTY, it has served me nicely throughout the years, and still do, but it lacks one thing I use the most, tabs.  The only way I can get this is to port mrxvt over to Windows.  Of course, one of my previous posts explained why I prefer SUA over Cygwin, so I wont go over that anymore, but the simple explanation is that it is faster.

Anyway, back to the concern of this post, and that's to port mrxvt over to Windows Vista SUA (Subsystem for Unix Applications).  This post assumes that you've installed the GNU utilities, and all the the utilities required to compiled.  In general, I did a pkg_update -L on xrender, wget, and libxml2.  Once you've got these installed, we can do the configure command.  Since SUA does not support UTMP, we needed to disable utmp during configuration,

./configure –disable-utmp

After a successful configure, you cannot start compilation right away.  A couple of things needed to be changed for you to be able to compile.  First off is to change all occurrences of wcrtomb() to wcstombs().  In my files, there's only one occurrence of wcrtomb() inside of src/strings.c on line 48.  Now, make should work, but the resulting compiled mrxvt will segfault.  I've spent many nights tracing through the code, editing, compile, test, nothing works!  Then I read somewhere that you should remove the flags -fPIC from the make files.

fPIC stands for Position-Independent Code, apparently, it will not work if you leave this tag in (although your mileage may vary).  So, after so many sleepless nights trying to trace through the code, it was something so simple.  So, I went through the file src/Makefile and removed -fPIC from the CFLAGS (line 128 for me).  After these two changes, issue the command,

make
make install

You should now be able to use mrxvt in Windows vista.  Now, you would need to install some sort of X11 sever on your windows.  I am using Xming, although there are some bugs, but most of the times, it works quite well.  You can use some sort of commercial software like XManager, which have less bugs.  The decision is yours, but I have used both Xming and XManager, I find that XManager works better.  Of course, for my own personal computer, I can only afford the free version of Xming.  I wish you luck with your porting!

Filed under Software by A.K.

Spread the Word!

Permalink Print Comment

Leave a Comment