current stable: 0.99.6 unstable: cvs (0.99.7) |
|||||||||||||||||||||||||||||||||||||||||||||||||
|
BuilderFerite-c files (.fec) are compiled using a special tool, called the builder which is run on the command line. The builder is only used for the creation of native modules. It is not required in order to run pre-built native modules. Depending on your ferite installation, you may need to install a development package to have access to the builder. What does builder do? The builder reads a ferite-c file, and creates the necessary C source, header files, and automake file that will be needed to compile the module. It takes several command line parameters, only a few of which we will cover here. You can pass builder either --help or -h on the command line to see all of the available options. The switch we are currently most interested is -m. The -m switch allows you to specify the name of your module to the builder. This name will be used to determine the names of the files builder will create while reading the ferite-c file. If you do not specify a name using -m, it will default to modulename. For simplicity we will also use th -c and -f switches, which prevent the creation of a config.m4 and Makefile.am, respectively. Example of using the builder:
When you run builder, it will create several output files, named according to the module name. The main files created are:
These files will need to be compiled into a shared object or a DLL (depending on your platform, for simplicity we will simply refer to shared objects from here on, but they are interchangeable with DLL's). Both the resulting shared object and the original ferite-c file are needed for ferite to successfully import the module. You will need to place the ferite-c file in the module path, which was explained in the previous chapter. The shared object will need to be placed in the native search path. This is where ferite looks for all native modules. It is usually /usr/lib/ferite/platform, though the actual location may vary depending on the installation. (ex. /usr/lib/ferite/linux-gnu-i686) Note: If you are interested in auto generation tools for standalone modules, you will probably be interested in the generate-module utility. The builder creates input files for automake and the like specifically tailored for modules that will be included with the ferite source. The generate-module utility is geared more towards auto generation for standalone modules. We will not cover generate-module in this guide.
|
||||||||||||||||||||||||||||||||||||||||||||||||
ferite et al © 2000-2004, Chris Ross |