Installing clisp on windows

I just followed the instructions at This post is a cut-n-paste of that, with commentary. I’m using this blog as a personal notepad; if that page ever disappears, I’ll have this one. You should follow the instructions on the original page.

First, you download minGW-4.1.1.exe. I’ve always disliked the name of this, probably because “ming” in Northern Ireland is an intransitive verb meaning “to reek apallingly, to be incredibly ugly, to be superlatively bad”, e.g. it mings, it’s mingin’, she’s a minger, etc. I parse “mingw” as “ming-double-ewe”. Yuck.

Anyway, then I install MSYS-1.0.10.exe (into c:\mingw\1.0 apparently, not the default c:\msys\1.0). Answer yes to most questions, but answer “c:/mingw” when it asks where your mingw is. I’d never met msys before. It looks a bit like cygwin, only … windows-ier. Yuck, I think.

Download clisp-2.38.tar.gz, clisp-2.38.patch and libsigsegv-2.2.tar.gz into c:/mingw/1.0/. Run mingw, build it all:

export PATH=.:/bin:/usr/bin:/mingw/bin
cd /
tar -xzf clisp-2.38.tar.gz
cd clisp-2.38
cat /clisp-2.38.patch | patch -p1
CC='gcc -mno-cygwin'; export CC
mkdir tools; cd tools; prefix=`pwd`/i686-pc-mingw32
tar xfz /libsigsegv-2.2.tar.gz
cd libsigsegv-2.2
./configure --prefix=${prefix}
make check
make install
cd ../..
./configure --with-mingw \
            --without-readline \
            --with-libsigsegv-prefix=${prefix} \
            --with-module=rawsock \
            --with-module=bindings/win32 \
            --build clisp-gui

Copy /clisp-2.8/clisp-gui/full/lisp.exe and /clisp-2.38/clisp-gui/full/lispinit.mem to my “application” directory. My what now?

Now I can apparently deliver applications. Niiiice, if true.

Hmmm, if you run the lisp.exe that results, it doesn’t do anything.

But if you follow the instructions, create a file message.lisp

(use-package "FFI")
(def-call-out messagebox
              (:name "MessageBoxA") (:library "user32.dll")
              (:arguments (hwnd int) (text c-string) (capt c-string) (type uint))
              (:return-type int)
              (:language :stdc))

(defun main()
  (messagebox 0 "Hello World!" "Message" 0)

…and also build an application (from a cmd prompt)…

lisp -M lispinit.mem -x "(load \"message.lisp\")(ext:saveinitmem \"message\" :init-function #'main :executable t :norc t)"

…you do actually get an application “message.exe”. Which is nice.

I’ve put my lisp.exe and lispinit.mem in a c:\clisp\ directory.


Leave a Reply

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

You are commenting using your 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: