HPlogo STREAMS/UX for the HP 9000 Reference Manual > Chapter 5 How to Compile and Link STREAMS/UX Drivers, Modules, and Applications

Compiling STREAMS/UX Drivers and Modules

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

The steps for compiling STREAMS/UX drivers and modules follow.

  1. Include the appropriate STREAMS/UX include files in the driver and module sources. Table 5-1 “STREAMS/UX and TPI Include Files” describes the files. Drivers and modules are compiled in the /usr/conf directory. They contain include statements with relative path names. The table shows the path names.

    Table 5-1 STREAMS/UX and TPI Include Files

    Include File

    Use

    "../h/stream.h"

    Needed by all drivers and modules.

    "../h/stropts.h"

    Needed by all drivers and modules.

    "../h/strlog.h"

    Needed by drivers and modules that call strlog. Note that log.h and syslog.h are not needed. STREAMS/UX does not support priority and facility codes.

    "../h/strstat.h"

    Needed by drivers and modules that use the qi_mstat field of the qinit structure to maintain statistics.

    "../h/strenv.h"

    Needed by drivers and modules that use DKI functions.

    "../h/cmn_err.h"

    Needed by drivers and modules that use cmn_err().

    "../h/tihdr.h"

    Needed by drivers and modules that use TPI.

     

  2. If you are only adding modules, you will need to archive those modules into a library.

  3. Compile the sources in /usr/conf with the appropriate options. Create a directory under /etc/conf and place your source files in this directory. Use the following command line with appropriate substitutions to compile your source code.

    @${CC}  -I.  -c  ${CFLAGS}  ${NOGLOOPTS}  $(your_file).c

    Compile each of your modules and archive the object files into a library using the ar command. It is best to place all of your driver and module code into the same library. In the example below, libexample1.a is the name of the library and obj*.o are the object files:

    rm -f libexample1.a
    ar -r libexample1.a ojb1.o obj2.o ... objn.o
© 1995 Hewlett-Packard Development Company, L.P.