Using libnetdude

Table of Contents
Building libnetdude
Installation Layout
Building Applications with libnetdude
libnetdude's Testsuite

This chapter explains how to build libnetdude, what parts of libnetdude end up where on your system when you install it, and how to build other programs that use libnetdude.


Building libnetdude

Building libnetdude will hopefully be easy. libnetdude has two dependencies, make sure these are installed before you try to build your copy:

The build itself is made using the common ./configure && make && make install sequence. Check ./configure --help for a list of available options, particularly the --with-pcapnav... options to specify a libpcapnav that's installed in an unusual location.


Installation Layout

The installation places files in the following locations (the full path depends on what --prefix option you passed to configure. The default value is /usr/local):


Building Applications with libnetdude

If you are using the autoconf/automake tools to configure your package, consider using the following check to detect libnetdude:
dnl ##################################################
dnl # Check for libnetdude
dnl ##################################################
AC_ARG_WITH(libnetdude,
    AC_HELP_STRING([--with-libnetdude-config=DIR], [Use given libnetdude-config]),
    [ LIBNETDUDE_LIBS=`$withval --libs`
      LIBNETDUDE_CFLAGS=`$withval --cflags`
      libndcfg="$withval"
    ],
    [ AC_PATH_GENERIC(libnetdude,,
          libndcfg="libnetdude-config",
          AC_MSG_ERROR(Cannot find libnetdude: Is libnetdude-config in path?)) ])

AC_SUBST(LIBNETDUDE_LIBS)
AC_SUBST(LIBNETDUDE_CFLAGS)
        
You can then use the compiler/linker flags that the library requires in your Makefile.am using @LIBNETDUDE_CFLAGS@ and @LIBNETDUDE_LIBS@.

Note

Using the output of libnetdude-config provides all the compiler/linker flags you need to pull in the dependencies (libpcapnav and glib). You do not need to add extra checks and flags for those in your build scripts. Have a look at libnetdude-config --help for the various options.


libnetdude's Testsuite

Should you decide to delve into hacking libnetdude itself (yay!), you'll want to have a look at the contents of the test directory in the source tree. It contains a few programs that can be built using make tests and that are not installed. These programs are: