[Xorp-hackers] Doubts on compiling routing process

Pavlin Radoslavov pavlin@icir.org
Tue, 16 Nov 2004 11:45:32 -0800


Rafael,

> As you know from previous emails, I am trying to migrate a routing 
> process into XORP. I partially integrated it to XORP but I am little 
> lost with respect to its compilation. Let me explain what I have done so 
> far, and what I don't know how to do.
> 
> 1) I have create a example.tgt file for my routing process and it does 
> implement only the common interface. I used the command line below to 
> generate  the example.xrls, example_base.cc and example_base.hh:
> cpp -I ../interfaces example.tgt |../scripts/tgt-gen
> (There is a directory under targets called .deps, should there be an 
> example_base.Po file there? How this is done? What should I change in 
> the Makefiles)

In general, I'd recommend that you check the following document:
xorp/docs/xorpdev_101/
Currently, it is available only from the CVS repository, so you have
to use the anon CVS, and then use the following commands to generate
the document (note that you must have Latex installed to do so):
cd xorp; ./configure
cd docs/xorpdev_101
gmake

Alternatively, you can get the document from the following temporary
URL: http://nrg.cs.ucl.ac.uk/mjh/tmp/xorpdev101.pdf

Section 4.2 describes what to do to generate stub code for the
target and what to add to file xorp/xrl/targets/Makefile.am
If you add your own foo.xif XRL interface, then you need to edit
file xorp/xrl/interfaces/Makefile.am

After you have edited the appropriate Makefile.am files, then you
need to do the following from the top-level XORP directory:
./bootstrap

Note that to run ./bootstrap you must have installed the appropriate
autoconf/automake versions as specified in xorp/README file:
    - autoconf version 2.53
    - automake version 1.5
    - libtool version 1.3.4
[Slightly older or slightly newer versions may still be working,
but we cannot make any guarantees about that]

Running the above shell script will invoke the appropriate
autoconf/automake commands to generate the Makefile.in files, etc.
After that run ./configure as usual to generate the final Makefile
files. As part of that process the .deps stuff is generated as
necessary so you don't have to do it explicitly.
Note that if you use the Makefile.am files, then you don't have to
run the "cpp" command above, because all XRL-related auto-generation
will happen once you run "gmake".
 
> 2) The only change I have made so far in the original routing process is 
> to add/remove routes through XORP. This means that, in fact, it is 
> something like the static routes, but routes are not received by XRL, 
> instead it is computed by the routing process. In a second step I will 
> migrate the sending and reception of control packets. The whole code is 
> place into xorp-1.0/example. How do I compile it together with XORP? How 
> do I generate its Makefile?

Once you have placed your code in your own directory, you have to
modify the following files to add your directory to the compilation
process:

* Edit xorp/configure.in and add the following line as one of the
  arguments to AC_OUTPUT:

    example/Makefile

* Edit xorp/Makefile.am and add your own "example" directory to
  SUBDIRS. Note that the sub-directories are visited in the order
  they are listed, hence don't add your directory before any of the
  libraries you may use.

After you edit those two files, run ./bootstrap and ./configure as I've
described previously. In general, every time you edit configure.in
or any of the Makefile.am files you must run ./bootstrap
Also, every time you run ./bootstrap to generate new ./configure
or Makefile.in files, you must run ./configure before you run
"gmake".

Hope that helps,
Pavlin