Hacking on Near Field Communication manager
*******************************************


Build tools requirements
========================

Required packages and tools:
  autoconf
  autoconf-archive
  automake
  dbus
  gcc/clang
  glib 2.0
  libtool
  libnl-3
  libnl-genl-3
  make
  pkg-config

See also installation scripts for different systems in ci/ directory.


Working with the source code repository
=======================================

The repository contains two extra scripts that accomplish the bootstrap
process. One is called "bootstrap" which is the basic scripts that uses the
autotools scripts to create the needed files for building and installing.
It makes sure to call the right programs depending on the usage of shared or
static libraries or translations etc.

The second program is called "bootstrap-configure". This program will make
sure to properly clean the repository, call the "bootstrap" script and then
call configure with proper settings for development. It will use the best
options and pass them over to configure. These options normally include
the enabling the maintainer mode and the debugging features.

So while in a normal source project the call "./configure ..." is used to
configure the project with its settings like prefix and extra options. In
case of bare repositories call "./bootstrap-configure" and it will bootstrap
the repository and calls configure with all the correct options to make
development easier.

In case of preparing for a release with "make distcheck", don't use
bootstrap-configure since it could export development specific settings.

So the normal steps to checkout, build and install such a repository is
like this:

  Checkout repository
    # git clone git://git.kernel.org/pub/scm/network/.../neard.git
    # cd neard

  Configure (choose only one)
    # ./bootstrap-configure
    # ./bootstrap-configure --enable-asan --enable-lsan --enable-ubsan

  Build
    # make

  Check installation
    # make install DESTDIR=$PWD/x
    # find x
    # rm -rf x

  Check distribution
    # make distcheck

  Final installation
    # sudo make install

  Remove autogenerated files
    # make maintainer-clean


Running from within the source code repository
==============================================

When using "./configure --enable-maintainer-mode" the automake scripts will
use the plugins directly from within the repository. This removes the need
to use "make install" when testing "neard". The "bootstrap-configure"
automatically includes this option.

  Run daemon in foreground with debugging
    # ./src/neard -n -d 'src/*'

For production installations or distribution packaging it is important that
the "--enable-maintainer-mode" option is NOT used.

The debugging option -d takes an argument. This argument can be a comma
separated list of file names like 'src/main.c,src/manager.c' to enable debugs
in these files. Simple glob style pattern matching is supported in this list.
