Setting up a windows computer for wings development

These where the steps I did to get a wings system up and running on my new windows computer.

Installing emacs so we get a decent editor, to edit the files below

Download emacs and unpack it.

Installing a mingw

First install mingw-msys from: Mingw-Msys.

Create a desktop shortcut, Right-Drag C:/MinGW/msys/1.0/msys.bat to the desktop. I have added the following lines to my msys.bat file:

    SET HOMEDRIVE=C:
    SET HOMEPATH=\Users\myname
    SET HOMESHARE=\\C\Users\myname
    SET HOME=\Users\myname
  

In /c/MinGW/msys/1.0/etc/ I also added last:

    source "$HOME/.bashrc"
  

I have also installed rxvt (which gives you a better terminal), can be wider than 80 lines and have better (unix-like) cut-n-paste functionality.

  > mingw-get install msys-rxvt

Right click you msys shortcut and edit the command to run

  C:\MinGW\msys\1.0\msys.bat -rxvt

Installing Git For Windows

Download and install Git for Windows. I installed Git in C:/opt/Git Setup up the paths in your .bashrc so they can find git (and emacs): I.e. edit the file: c:/users/myname/.bashrc if you have setup HOME as above.

  export EDITOR=emacs
  alias gitk="cmd //c /c/opt/Git/cmd/gitk.cmd"
  PATH=/c/opt/Git/cmd:$PATH

  ## Let erlang find esdl, cl, and wings 
  ERL_LIBDIR=c:/src/

  ## Setup completion
  source /c/opt/Git/etc/git-completion.bash
  source /c/opt/Git/etc/git-prompt.sh

  PS1='--[\u@\h] \[\e[0;34m\]\W/\[\e[0;32m\]$(__git_ps1 " (%s)") $CC_VIEW\[\e[0;34m\]\[\e[0m\]--\n> '
  export PS1

Installing Erlang

Download erlang and run the installer.

Get esdl and libSDL

Create a user and fork esdl (from me) and wings (from me) on the github website.
Configure github and setup your ssh keys if you want to be able push patches to github and us.
Get ESDL from github, clone a copy of your fork (i.e switch dgud below with your username):

  > mdkir /c/src
  > cd /c/src
  > git clone git@github.com:dgud/esdl.git 

And get the windows developer version of SDL from libSDL-1.2. Unpack it somewhere, I've put the tools below c:/opt/.

  > cd /c/opt/
  > tar zxf SDL-devel-1.2.14-mingw32.tar.gz

Configuration

Setup up your .bashrc and .emacs files. After this step you should be able start the rxvt and run werl and the erlang window should pop up. The command which SDL.dll should return the full path to where you installed SDL.dll.

Build esdl

Build esdl:

  > cd esdl
  > ./Configure-mingw.sh
  > mingw_build.sh
  > # I also copy SDL.dll so that we can to run wings outside of mingw
  > cp `which SDL.dll` priv

Get a copy of your fork of wings and build it

  > cd /c/src/
  > git clone git@github.com:dgud/wings.git 

Build it.

  > cd wings
  > make 
  > cd plugins_src/win32_file/ && make
  > wings 

Additional components

This is not required for wings or esdl, but is good information for debugging on windows: Free MS VC++: See Visual C++ Express And remember to enable Tools/Settings/Expert Settings Start werl and os:getpid() will give you a pid. Use Debug/Attach Process and search for the pid to attach to erlang.