Fewer configure options.
Use pkg-config to detect openssl. Eagerly use backtrace if provided by libc.
This commit is contained in:
parent
87f3415330
commit
7844716af5
28
configure.ac
28
configure.ac
@ -15,25 +15,8 @@ AC_PROG_YACC
|
|||||||
m4_ifndef([PKG_PROG_PKG_CONFIG], [m4_fatal([Please install pkg-config.])])
|
m4_ifndef([PKG_PROG_PKG_CONFIG], [m4_fatal([Please install pkg-config.])])
|
||||||
PKG_PROG_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],
|
AC_ARG_ENABLE([oidentd], AS_HELP_STRING([--enable-oidentd],
|
||||||
[Enable oidentd support (bip overwrites ~/.oidentd.conf with this on!)]))
|
[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)
|
AM_CONDITIONAL(OIDENTD, test x$enable_identd = xyes)
|
||||||
AS_IF([test "x$enable_oidentd" = "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=yes
|
||||||
], [ enable_tests=no ])
|
], [ 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_CONFIG_FILES([Makefile src/Makefile])
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
||||||
AS_IF([test "x$with_openssl" != "xno"], [
|
echo OPENSSL: $with_openssl
|
||||||
echo OPENSSL: yes
|
|
||||||
])
|
|
||||||
echo DEBUG: $enable_debug $backtrace
|
|
||||||
echo OIDENTD: $enable_oidentd
|
echo OIDENTD: $enable_oidentd
|
||||||
echo PIE: $enable_pie
|
echo PIE: $enable_pie
|
||||||
echo TESTS: $enable_tests
|
echo TESTS: $enable_tests
|
||||||
|
@ -210,8 +210,7 @@ void mylog(int level, char *fmt, ...)
|
|||||||
|
|
||||||
#ifdef HAVE_BACKTRACE
|
#ifdef HAVE_BACKTRACE
|
||||||
#include <execinfo.h>
|
#include <execinfo.h>
|
||||||
|
void dump_trace(void)
|
||||||
void print_trace(void)
|
|
||||||
{
|
{
|
||||||
void *array[32];
|
void *array[32];
|
||||||
size_t size;
|
size_t size;
|
||||||
@ -232,7 +231,7 @@ void fatal(char *fmt, ...)
|
|||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
#ifdef HAVE_BACKTRACE
|
#ifdef HAVE_BACKTRACE
|
||||||
print_trace();
|
dump_trace();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
exit(200);
|
exit(200);
|
||||||
|
Loading…
Reference in New Issue
Block a user