Building the Inform5 compiler

Prompted by Iam Curio’s post about writing Inform5 code, I downloaded the source code and tried to get the compiler built. It seems to be missing “kernel.h”. Does anyone know where this file can be found? I’ve checked the 5.5 tree and the 5.4 zip in the IF Archive.

That’s not part of the Inform source. It’s probably an OS header from Windows (or Acorn OS?) which got added to make it compile. Try knocking it out and getting the source to compile with POSIX C headers.

Success! It builds with several warnings, but it builds. If anyone is interested, I put up something for Unix users at Comments, suggestions, etc are welcome.

Thank you, frotz.

$ automake --version automake (GNU automake) 1.10.1 $ gcc --version gcc (Debian 4.4.5-8) 4.4.5
Compiles fine.

I configured it with --prefix=$HOME/opt/i5, make and make install.

demos/hellow.inf compiles OK but demos/shell.inf can’t find the includes:

line 10: Fatal error: Couldn't open input file "Parser"


If I copy lib/*h into the same directory of the .inf and modify the include lines to match the case and use the .h… it works. (I have to raise MAX_BANK_SIZE and MAX_SYMBOLS, by the way).

Is this the correct way to handle the includes?

I see that $PREFIX/share/inform and subdirs had no files inside. Is this correct?

I don’t know frotz has configured the automake script. (Inform did not originally ship with one.) The normal syntax for specifying an include directory is

inform +$HOME/opt/i5 shell.inf

Also, the library files may need to have or to omit the .h suffix. Try both ways, if necessary.

Inform5 doesn’t have a built-in library path. It must be specified on the command line with +directory. Read what is printed when you invoke inform5 without any options or filenames.

That $PREFIX/share/inform stuff is left over from the Inform6unix package stuff that I appropriated for Inform5. I’m not sure if it should be there or not.

Now, knowing (and using) the +directory [optional] option… I manually copy lib/*h (after make, because that creates some symlinks I missed last time, because I copied from the original repo) into:

$ ls /home/dddddd/opt/i5/share/inform grammar.h Grammar.h module parser.h Parser.h verblib.h Verblib.h VerbLib.h

Again, trying to compile the shell.inf demo.

If I left the line as is Include "Parser"; the compiler complains with Couldn't open input file "/home/dddddd/opt/i5/share/inform/Parser" It seems the compiler is not adding automatically the .h.

If i put the .h in the include line Include "Parser.h"; Couldn't open input file "Parser.h" Notice it’s a relative filename, although I used the +directory this time too. So, it seems the compiler interprets dot h files as relative to $PWD.

Hope I’m not making any stupid mistake.

I can workaround this, but I think it’s worth tell you.

You could remove the .h’s from all the library files.