build: improve backtrace support/detection
libexecinfo is used to provide backtrace() on *BSD. The API is
compatible with glibc's, so this is a "free" improvement.
To improve configure behaviour, the following configure options are
modified/introduced:
* --enable-gcc-rdynamic now defaults to "on" if the compiler is gcc.
(I sadly wasn't able to find any documentation on the availability of
this option for llvm, even though at least the version I have
installed does support it)
* --enable-backtrace has been added. This behaves as off/auto/on
switch, i.e. giving either {dis,en}able will result in the requested
behaviour (or an error if support wasn't found)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
diff --git a/doc/install.texi b/doc/install.texi
index 0f8f65f..1e8d965 100644
--- a/doc/install.texi
+++ b/doc/install.texi
@@ -96,6 +96,16 @@
minimally decrease compile time and overhead. They can always be built and
executed at a later time by running @command{make check} in the @file{tests/}
subdirectory, even if they're excluded from build.
+@item --enable-gcc-rdynamic
+Pass the @command{-rdynamic} option to the linker driver. This is in most
+cases neccessary for getting usable backtraces. This option defaults to on
+if the compiler is detected as gcc, but giving an explicit enable/disable is
+suggested.
+@item --enable-backtrace
+Controls backtrace support for the crash handlers. This is autodetected by
+default. Using the switch will enforce the requested behaviour, failing with
+an error if support is requested but not available. On BSD systems, this
+needs libexecinfo, while on glibc support for this is part of libc itself.
@end table
You may specify any combination of the above options to the configure