HPlogo Sendmail 8.13.3 Programmer's Guide: HP-UX 11i v1 and HP-UX 11i v2 > Chapter 4 Configuring and Compiling Milter APIs

Compiling and Installing Your Filter

» 

Technical documentation

Complete book in PDF

 » Table of Contents

To compile a filter, you must complete the following steps:

  1. Insert the include and Sendmail directories in your include path. For example, -I/path/to/include -I path/to/sendmail.

  2. Ensure that the libmilter.a file is in your library path and link your filter application with this file. For example, you can use the -lmilter option to link your the filter application with this file.

  3. Compile with pthreads either by using -pthread for gcc or by linking with a pthreads support library (-lpthread).

Following is an example of a command to compile a filter application:

# cc -I/path/to/include -I/path/to/sendmail -c myfile.c

where:

myfile.c specifies the name of the Milter program.

Following is an example of a command to link the filter application:

# cc -o myfilter [object-files] -L[library-location] -lmilter -pthread