Next: , Up: External Calls to Funge-98   [Index]


14.2.1 Creating the Funge-98 Library

Before external calls to Funge-98 can be used, the relevant library must be compiled. (After the library has been compiled, then you will need to reinstall C-INTERCAL; however, you will not need to recompile C-INTERCAL.)

At present, only the cfunge Funge-98 interpreter (https://launchpad.net/cfunge/+index) can be converted into a library suitable for use by C-INTERCAL; also, doing this is only supported on POSIX systems (although if someone gets it to work on DOS/Windows, the author of this manual would be interested to hear about it). Also, a source-code distribution (rather than a binary distribution) is needed. One way to obtain the latest cfunge sources is via the bzr version-control system, using the following command (correct as of the time of writing, but as always, links can become dead):

bzr branch lp:cfunge

(As a licensing note, note that cfunge is licensed under the GNU General Public licence version 3, whereas C-INTERCAL is licensed under version 2 and all later versions of that licence; although these terms are obviously compatible with each other, you must ensure yourself that your program has appropriate licensing terms to allow a GPLv3 library to be linked to it.)

Once you have downloaded the cfunge sources, you need to compile them into a library suitable for use with C-INTERCAL (note that this is a somewhat different process to compiling them into a standalone Funge-98 interpreter). There is a script provided in the C-INTERCAL distribution to do this, etc/cftoec.sh. It must be run in the etc subdirectory of the C-INTERCAL distribution (i.e. the directory the script itself is in), and must be given the path to the root directory of the cfunge source distribution (that is, the directory that contains the src, lib and tools subdirectories of that distribution) as its only argument. Note that it may give some compiler warnings on compilation; my experience is that warnings about C99 inlining can be safely ignored (they reflect a deficiency in gcc itself that luckily seems to be irrelevant in this case), but other warnings may indicate problems in the exact versions of the sources that you downloaded (and errors definitely indicate such problems).

Once the library has been created, it will appear as the new file lib/libick_ecto_b98.a in the C-INTERCAL distribution (the cfunge distribution will be left unchanged); reinstalling C-INTERCAL will install this file to its proper location. (It is also in a valid location to be able to be run if you aren’t installing C-INTERCAL but instead just running it from the distribution’s directory.)


Next: , Up: External Calls to Funge-98   [Index]