From 7844716af5d1c655989afbfc0c3cc12665e3884b Mon Sep 17 00:00:00 2001 From: Arnaud Cornet Date: Sun, 18 Nov 2018 14:30:17 -0500 Subject: [PATCH] Fewer configure options. Use pkg-config to detect openssl. Eagerly use backtrace if provided by libc. --- configure.ac | 28 +++++++--------------------- src/util.c | 5 ++--- 2 files changed, 9 insertions(+), 24 deletions(-) diff --git a/configure.ac b/configure.ac index 07aa968..eca41e8 100644 --- a/configure.ac +++ b/configure.ac @@ -15,25 +15,8 @@ AC_PROG_YACC m4_ifndef([PKG_PROG_PKG_CONFIG], [m4_fatal([Please install pkg-config.])]) PKG_PROG_PKG_CONFIG -# Deal with parameters -AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug], [Enable debug build])) -AC_ARG_WITH([openssl], AS_HELP_STRING([--without-openssl], - [Disable SSL using OpenSSL])) AC_ARG_ENABLE([oidentd], AS_HELP_STRING([--enable-oidentd], [Enable oidentd support (bip overwrites ~/.oidentd.conf with this on!)])) -AC_ARG_ENABLE([pie], AS_HELP_STRING([--disable-pie], - [Do not build a position independent executable])) - -AM_CONDITIONAL(DEBUG, test x$enable_debug = xyes) -AS_IF([test "x$enable_debug" = "xyes"], [ - AC_CHECK_FUNC(backtrace_symbols_fd, [ - AC_DEFINE(HAVE_BACKTRACE, [], [Use glibc backtrace on fatal()]) - LDFLAGS="-rdynamic $LDFLAGS" - backtrace="(with backtrace)" - ]) -], [ - enable_debug=no -]) AM_CONDITIONAL(OIDENTD, test x$enable_identd = xyes) AS_IF([test "x$enable_oidentd" = "xyes"], [ @@ -68,14 +51,17 @@ PKG_CHECK_MODULES([CHECK], [check >= 0.9.6], [ enable_tests=yes ], [ enable_tests=no ]) +AC_CHECK_FUNC(backtrace_symbols_fd, [ + AC_DEFINE(HAVE_BACKTRACE, [], [Use glibc backtrace on fatal()]) + LDFLAGS="-rdynamic $LDFLAGS" + backtrace="(with backtrace)" +]) + AC_CONFIG_FILES([Makefile src/Makefile]) AC_OUTPUT -AS_IF([test "x$with_openssl" != "xno"], [ -echo OPENSSL: yes -]) -echo DEBUG: $enable_debug $backtrace +echo OPENSSL: $with_openssl echo OIDENTD: $enable_oidentd echo PIE: $enable_pie echo TESTS: $enable_tests diff --git a/src/util.c b/src/util.c index d8bf50d..553b746 100644 --- a/src/util.c +++ b/src/util.c @@ -210,8 +210,7 @@ void mylog(int level, char *fmt, ...) #ifdef HAVE_BACKTRACE #include - -void print_trace(void) +void dump_trace(void) { void *array[32]; size_t size; @@ -232,7 +231,7 @@ void fatal(char *fmt, ...) va_end(ap); #ifdef HAVE_BACKTRACE - print_trace(); + dump_trace(); #endif exit(200);