Configuring and Managing MPE/iX Internet Services (July 2001)

176 Chapter9
Apache for MPE/iX
Major Components
Tools
There are a number of options available when choosing tools to build an
Apache module for MPE/iX. Some of these tools are open source tools
from the GNU Project, a provider of free software. The GNU tools are
used on many operating system platforms for development of open
source code, including MPE/iX.
Module compilations on MPE/iX can be done with the GNU C compiler,
gcc, or with the MPE/iX POSIX compiler, c89. HP recommends using
gcc for compiling open source modules since most open source code is
designed for compilation by gcc. For example, Apache for MPE/iX is
compiled with gcc. Use c89 when calling MPE/iX intrinsics or using
long pointers.
When using a Makefile to build a module, it canbe executed with GNU
make or with the MPE/iX POSIX make. GNU make is recommended
for executing a Makefile created by apxs since this file is generated by
open source code. The GNU tools’ installation script installs GNU
make in /usr/local/bin/make. MPE/iX make resides in /bin/make.
Modules can be lined with GNU ld or with the MPE/iX LinkEditor.
HP recommends using LinkEditor for linking Apache modules since
the LinkEditor creates shared libraries that work well with dynamic
loading.
Make, gcc, and ld are part of the GNU tools which are downloadable
from http://jazz.external.hp.com/src/gnu/gnuframe.html.
Support contracts for gcc are available from
http://www.gccsupport.html. LinkEditor, c89 and /bin/make are
supported by HP.
The Apache C header files are required when compiling an Apache
module. These header files are distributed with the Apache product and
reside in /APACHE/PUB/include.
Module Creation Using a Template
Any existing Apache module can be used as a template for a new
module. Mod_example.c is distributed with Apache in
/APACHE/PUB/libexec and makes a useful template for a simple
module. When compiled and linked as the shared library (NMXL)
mod_example.so, this module is a fully working DSO.
Libexec/mod_example.so has already been pre-built.
For a more functional module, try a different module as your template.
For instance, to create a new module that does authentication, starting
with one of Apache’s authentication modules may be more appropriate.
If you want to create a module that has its own configuration directives,
start with another module that already does this.