Step by step instructions

Here is a simple 4-step instruction on how to make your own module for Pike in C.

1. Get the skeleton

For simplicity, get the skeleton files and install them in your Pike-source/modules/ dir. When unpacking the file, you should end up with a new directory called skeleton. You might also want to download and install the Hello World example which compiles out-of-the-box.

2. Decide on a name

Now it is time to decide on a good name for your module. Rename the skeleton directory to that name. Within the skeleton directory, there are several files. Go thru each of them and change all references from "skeleton" to something that reflects the name of your module.

3. Test your setup

Before you start developing anything, make sure your initial code compiles. To do the initial compilation, do the following:

cd src
cd ..
make depend

To save some time, make sure that you have a directory called build/modules/<your module name> before executing make to compile Pike, since compilation may take a long time. If everything compiles, you can try executing bin/pike and a dummy version of your module should be present within Hilfe.

4. Extend your module

Now you should add code to your module...

Remember that when you introduce dependencies on external libraries, you should add detection code for them in so that the module isn't built unless all needed libraries are present. If you have modified the, you need to create a new configure script by running autoheader in you module source directory.