Building Tranalyzer2 and the plugins

building compilation t2build

Introduction

Tranalyzer2 and the plugins can be independently built. Note that if t2_aliases was not installed, t2build must be replaced with /path/to/tranalyzer/autogen.sh.

Building Tranalyzer2 and the default plugins

t2build

Building Tranalyzer2

t2build tranalyzer2

Building all the plugins

t2build -a

Building specific plugins

t2build pluginName1 pluginName2

Rebuilding Tranalyzer2 and the current plugins

t2build -R

Building specific plugins from a file

cat myplugins.txt

basicFlow
tcpFlags
txtSink

t2build -b myplugins.txt

Unloading a plugin

t2build -u pluginName1 pluginName2

Emptying the plugin folder

t2build -e -y

Are you sure you want to empty the plugin folder '/home/user/.tranalyzer/plugins' (y/N)? yes
Plugin folder emptied

Listing the plugins currently active

t2build -l

basicFlow
basicStats
connStat
icmpDecode
macRecorder
portClassifier
protoStats
tcpFlags
tcpStates
txtSink

Changing the build backend

The following build backends are available:

  • meson (default)
  • cmake
  • autotools-out-of-tree (same as autotools, except that everything happens in a build or debug folder)
  • autotools [deprecated]

Controlling which backend is being used can be achieved in any one of the following ways:

  1. Using the -B option:

    t2build -B meson

    
    'Tranalyzer2'
    Using 'meson' backend

    ...
  2. Using the T2BUILD_BACKEND environment variable on the command line:

    T2BUILD_BACKEND=cmake t2build

    
    'Tranalyzer2'
    Using 'cmake' backend

    ...
  3. To make a persistent change, the T2BUILD_BACKEND variable must be exported:

    1. Globally in your ~/.bashrc, ~/.zshrc, …

      vi ~/.bashrc

      ...
      export T2BUILD_BACKEND="meson"
      ...

      t2build

      
      'Tranalyzer2'
      Using 'meson' backend

      ...
    2. Independently for each plugin by setting T2BUILD_BACKEND in the plugin’s autogen.sh file:

      vi $T2PLHOME/arpDecode/autogen.sh

      ...
      
      T2BUILD_BACKEND="cmake"
      
      # Source the main autogen.sh
      . "$(dirname "$0")/../autogen.sh"

      t2build arpDecode

      
      
      Plugin 'arpDecode'
      
      Using 'cmake' backend
      
      ...
      

Getting help with t2build

t2build --help