build: add --disable-crashtrace option

Disables GNU backtrace extensions.
This commit is contained in:
David Rothlisberger 2011-10-05 16:51:29 -05:00 committed by Dan Williams
parent 5bbafdc632
commit bcef119ffd
2 changed files with 13 additions and 1 deletions

View file

@ -611,6 +611,13 @@ fi
AC_DEFINE_UNQUOTED(KERNEL_FIRMWARE_DIR, "$KERNEL_FIRMWARE_DIR", [Define to path of the kernel firmware directory])
AC_SUBST(KERNEL_FIRMWARE_DIR)
AC_ARG_ENABLE(crashtrace,
AS_HELP_STRING([--disable-crashtrace], [Disable GNU backtrace extensions]),
[enable_crashtrace=${enableval}], [enable_crashtrace=yes])
if test x"$enable_crashtrace" = xyes; then
AC_DEFINE(ENABLE_CRASHTRACE, 1, [Define if you have GNU backtrace extensions])
fi
NM_COMPILER_WARNINGS
GTK_DOC_CHECK(1.0)

View file

@ -30,10 +30,13 @@
#include <errno.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <execinfo.h>
#include <strings.h>
#include <string.h>
#ifdef ENABLE_CRASHTRACE
#include <execinfo.h>
#endif
#include <glib/gi18n.h>
#include "nm-logging.h"
@ -262,6 +265,7 @@ _nm_log (const char *loc,
static void
fallback_get_backtrace (void)
{
#ifdef ENABLE_CRASHTRACE
void *frames[64];
Dl_info info;
size_t size;
@ -289,6 +293,7 @@ fallback_get_backtrace (void)
}
}
syslog (LOG_CRIT, "******************* END **********************************");
#endif /* ENABLE_CRASHTRACE */
}