Compiling Nano on Cygwin

August 27, 2010 at 11:41 pm Leave a comment

Nano is an easy to use text editor.  It’s much easier than the dinosaurs, Emacs and Vi.  Unfortunately, Cygwin (as of August 2010) ships with a fairly old version of Nano, 2.0.9, that lacks many useful new Nano features.  The current version of Nano is 2.2.5.

One cool new Nano feature is the ability to remap keys.  This means you can make it behave more like a modern GUI program.  For example, instead of Nano’s odd Ctrl-O to save a file, you can remap a key and use Ctrl-S to save files, just like you do in every single other program you use. This feature is only available in Nano versions newer than 2.1.  So you can’t use it in standard Cygwin:-(

Fortunately, you can download Nano’s source code, compile it, and install it into Cygwin.  To prepare for this, I used Cygwin’s setup program to install the gcc C & C++ compilers, autoconf, automake, make, and gnutils-devel, which I thought (hoped) was all I needed.   Then I followed the simple instructions in Nano’s README file.  (There’s a helpful YouTube video showing how to do it.)  But when I followed the instructions the make step failed.  I got lots of strange errors, such as a missing confdefs.h file and many undefined constants.  I searched through the output from configure to find a clue as to what was wrong.

The cause turned out to be that Nano requires the ncurses lib that supports UTF-8.  Cygwin by default installs libncurses-devel, but not the one that handles UTF-8.  For that you need to also install libncursesw-devel via Cygwin’s setup program.  After that  configure, make,and make install all worked fine.

This was actually the first program I ever installed from source code on Cygwin.  It’s a good feeling to accomplish it.  I’m thankful to all the Unix folks who’ve streamlined the process and made a consistent way to install from source.

Advertisement

Entry filed under: cygwin, dev tools, nano, Uncategorized. Tags: .

Boycott Apple Arrogance [Boycott Finished - We won!] How to Set an HTTP Header in a Tomcat Valve

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Recent Posts

Categories


Follow

Get every new post delivered to your Inbox.