Quick start
===========

git
---

If you obtained the source code from git, then first run `./autogen.sh`.

If you (are going to) use cmake then there is no need to run aclocal,
autoheader, etc. You can suppress that by setting the environment variable
`export AUTOGEN_CMAKE_ONLY=1`.

If you want to use autotools you should configure with --enable-maintainer-mode
if you obtained the sources from git. Note that then ./autogen.sh needs
to be rerun after running `make maintainer-clean`.

cmake
-----

cmake -DCMAKE_INSTALL_PREFIX="/usr/local" -S . -B build
cd build
make
sudo make install

This method only builds libcwd_r, the multi-threaded version of libcwd.

autotools
---------

./configure --prefix="/usr/local" [--enable-maintainer-mode]
make
sudo make install


Options
=======

cmake
-----

The following boolean variables can be set to ON or OFF on the command line,

   EnableGlibCxxDebug   : Compile libcwd with -D_GLIBCXX_DEBUG.
                          See http://gcc.gnu.org/onlinedocs/libstdc++/debug.html.
   EnableLibcwdAlloc    : Enable memory allocation debugging support.
   EnableLibcwdMagic    : Enable magic numbers in memory allocation debugging.
   EnableLibcwdMarker   : Enable memory allocation markers.
   EnableLibcwdLocation : Enable the ability to lookup source file and line
                          number, you might need this on a non-ELF system.
(you do not want to use these):
   EnableLibcwdDebug    : Enable debugging of libcwd itself.
   EnableLibcwdDebugOutput : Enable debug output of EnableLibcwdDebug.
   EnableLibcwdDebugm   : Enable debugging of memory allocation debugging code in libcwd itself.
   EnableLibcwdDebugt   : Enable debugging of threading debugging code in libcwd itself.

When running `cmake` each option and its value is printed (unless forced to OFF);
often a value is forced or has a default. Recommended is to only set an option if
you're not happy with the default.

For example,
cmake -DCMAKE_INSTALL_PREFIX="/usr/local" -DEnableLibcwdAlloc=OFF -S . -B build

autotools
---------

The following configure options are available,

  --enable-glibcxx_debug  compile libcwd with -D_GLIBCXX_DEBUG.
                          See http://gcc.gnu.org/onlinedocs/libstdc++/debug.html.
  --disable-alloc         disable memory allocation debugging support.
  --disable-magic         disable magic numbers in memory allocation debugging.
  --disable-marker        disable memory allocation markers.
  --disable-location      disable the ability to lookup source file and line
                          number, you might need this on a non-ELF32 system.
  --enable-debug          enable debugging of libcwd itself.
  --disable-debug-output  disable debug output of --enable-debug.
  --enable-debugm         enable debugging of memory allocation debugging code
                          in libcwd itself.
  --disable-threading     don't compile libcwd_r, the thread-safe version of
                          libcwd.
  --disable-nonthreading  don't compile libcwd, the thread-unsafe version of
                          libcwd.
  --enable-debugt         enable debugging of threading debugging code
                          in libcwd itself.

Additional configure options are available too. Use `./configure --help` to get
the full list.


Trouble
=======

If you run into problems, mail carlo@alinoe.com (include as many details as possible).
Please use a very clear subject so that I can see it isn't spam in under 0.2 seconds.
