Translating speyes to Eiffel

Installing CIL (if not yet done):
git clone git://cil.git.sourceforge.net/gitroot/cil/cil; cd cil
./configure
make
export PATH=$PATH:`pwd`/bin

1. CIL preprocessing

  1. Downloading it:
    wget http://okb-1.org/speyes/speyes-1.2.0.tar.gz
  2. Extracting it:
    tar xfz speyes-1.2.0.tar.gz; cd speyes-1.2.0
  3. Creating the Makefile:
    xmkmf
  4. Removing gcc optimization flags (results in more readable code):
    sed -i "s/ -O2 / /" Makefile
  5. [speyes specific] Removing unnecessary files:
    rm getopt*; sed -i "s/ getopt.o getopt1.o//" Makefile
  6. [speyes specific] Add missing include:
    sed -i "s/#include <sys\/time.h>/#include <sys\/time.h>\n#include <time.h>/" speyes.c
  7. Building it:
    make CC="cilly --merge --save-temps"
This created the merged C file speyes.cil.c.

2. C2Eif

Start C2Eif, select the created speyes.cil.c, an output directory, -lXmu; -lXpm; -lm for the required libraries, and press Compile.

3. EiffelStudio

Start EiffelStudio and open speyes.ecf from the previously specified output directory. This will already compile it, all you have to do is press Run and enjoy speyes running in Eiffel :-)