
To use PROTOLIB with ns, you will need to at least
modify the ns "Makefile.in" to build the PROTOLIB
code into ns.  To do this, use the following steps:


1)  Make a link to the PROTOLIB source directory in the
    ns source directory.  (I use "protean" for the link 
    name in the steps below). 

2)  Provide paths to the PROTOLIB include files by setting

    PROTEAN_INCLUDES = -Iprotean/common -Iprotean/ns

    and adding $(PROTEAN_INCLUDES) to the "INCLUDES" macro
    already defined in the  ns "Makefile.in" 

3)  Define compile-time CFLAGS needed for the PROTOLIB code
    by setting

    PROTEAN_FLAGS = -DUNIX -DNS2 -DPROTO_DEBUG -DHAVE_ASSERT

    and adding $(PROTEAN_FLAGS) to the "CFLAGS" macro already
    defined in the ns "Makefile.in"

4)  Add the list of PROTOLIB object files to get compiled and linked
    during the ns build.  For example, set

    OBJ_PROTEAN_CPP = \
            protean/ns/nsProtoAgent.o protean/common/protoSim.o \
            protean/common/networkAddress.o protean/common/protocolTimer.o \
            mdp/common/debug.o

    and then add $(OBJ_PROTEAN_CPP) to the list in the "OBJ" macro already
    defined in the ns "Makefile.in"

    Note: "nsProtoAgent.cpp" contains an start ns agent which uses the
    PROTOLIB ProtocolTimer and UdpSocket classes.

5)  Run "./configure" in the ns source directory to create a new
    Makefile and  then type "make ns" to rebuild ns.
    
    
Brian Adamson
<mailto://adamson@itd.nrl.navy.mil>
18 December 2001
