Lisp Logo

Building a Windows CLISP version

First install a "Full installation" of MinGW-4.1.1.exe with all default settings. Then install MSYS-1.0.10.exe. Use "C:\mingw\1.0" as the installation directory. Use these answers for the post-installation process:

Do you wish to continue with the post install? [yn ] -> y
Do you have MinGW installed? [yn ] -> y
Where is your MinGW installation? -> c:/MinGW

Save clisp-2.38.tar.gz, clisp-2.38.patch and libsigsegv-2.2.tar.gz in the directory C:\mingw\1.0 (note: Internet Explorer wants to change the name "libsigsegv-2.2.tar.gz" to "libsigsegv-2.2.tar.tar", change this to "libsigsegv-2.2.tar.gz"), start MinGW (Start Menu->MinGW->MSYS->msys) and build it. To avoid problems with other applications which have the same name as MinGW programs, we set the path first (you can use your middle mouse button, or shift and left button, for pasting text into the MinGW shell window):

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

The build fails at the first "test" call, if you applied the patch, because the console-less application doesn't print values to stdout, but the build of the program istself is completed.

Note: if you don't care that a console window is created whenever you start a delivered application (see next chapter), you don't need to build your own Lisp version, but you can download just the official CLISP release for Windows.

Delivering applications

Then copy the files /clisp-2.38/clisp-gui/full/lisp.exe and /clisp-2.38/clisp-gui/full/lispinit.mem to your application directory. Create a "hello world" application in your application directory and save it as 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 now create a standalone GUI application. Start a DOS command prompt and execute these commands (you can save it to a BAT or CMD file, too, e.g. deliver.cmd) :

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

All files in one archive, which you need to buid your own exe-files. The message program itself is 1.2 mb zipped and can be started standalone, without a DOS console, on every Windows (I have tested it on Windows 98 and Windows XP). This is the result:

30. April 2006, Frank Buß