Friday, October 21, 2011

Building Node.js 0.5.9 on Cygwin

Default build fails on compile, complaining about _SC_PAGESIZE (and a few more symbols) undefined. To fix that, edit deps/uv/src/unix/cygwin.c, add unistd.h header so it looks like this:

include "uv.h"


include <assert.h>
include <stdint.h>
include <stddef.h>
include <errno.h>
include <time.h>
include <unistd.h>

Next, it will fail when linking, like so:

collect2: ld terminated with signal 11 [Segmentation fault], core dumped
Can't open .lib file: default/libnode.dll.a
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: Can't open output def file default/libnode.def


To address that, create a directory: out/default

mkdir out/default


Now you should be able to complete the build. Enjoy using NodeJS!