Skip to content

Instantly share code, notes, and snippets.

@adammw
Created July 3, 2011 19:23
Show Gist options
  • Select an option

  • Save adammw/1062521 to your computer and use it in GitHub Desktop.

Select an option

Save adammw/1062521 to your computer and use it in GitHub Desktop.
Compile Node.js v0.4 for Windows (32-bit) using Ubuntu 11.04 (x86_64)

HOWTO: Compile Node.js v0.4 for Windows (32-bit) using Ubuntu 11.04 (x86_64)

  1. Install mingw32 compilation tools

    sudo apt-get install mingw32

  2. Download and extract latest pthreads-win32 (pthreads-w32-2---release.tar.gz)

    wget -o - ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-8-0-release.tar.gz | tar xfz

  3. Compile pthreads dll and library

    cd pthreads-w32-2-8-0-release/ make GC CROSS=i586-mingw32msvc-

  4. Create a mingw32 directory to hold our stuff

    mkdir -p $HOME/mingw32/include mkdir -p $HOME/mingw32/lib

  5. Copy libpthreadGC.a & pthreadGC.dll to $HOME/mingw32/lib

    cp pthreads-w32-2-8-0-release/libpthreadGC.a $HOME/mingw32/lib/ cp pthreads-w32-2-8-0-release/pthreadGC.dll $HOME/mingw32/lib/

  6. Copy headers

    cp pthreads-w32-2-8-0-release/*.h $HOME/mingw32/include/

  7. Make symlinks to work with -lpthread and -lpthread.dll

    ln -s libpthreadGC2.a $HOME/mingw32/lib/libpthread.a ln -s libpthread.a $HOME/mingw32/lib/libpthread.dll.a ln -s pthreadGC.dll $HOME/mingw32/lib/pthread.dll

  8. Checkout node (v0.4)

    git clone git://github.com/joyent/node.git git checkout v0.4 #OPTIONAL: Use tab completion to find the latest stable branch

  9. Apply patches to fix (#1264, #1265, #1266)

  10. Download helper script

    wget https://gist.github.com/raw/1062306/mingw32-node-configure chmod +x mingw32-node-configure

  11. Configure with helper script

    ./mingw32-node-configure

  12. Compile node and dependincies

    make

This file has been truncated, but you can view the full file.
View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment