1 From acbaee34bcb1881db97969dd2c411446f32ca4cc Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Sat, 25 Oct 2014 19:45:33 +0200
4 Subject: [PATCH 3/5] Fix debug mode build with uClibc
6 When --enable-debug is passed, liblog4c-localtime wants to use
7 <mcheck.h>. It takes the precaution of testing if __GLIBC__ is
8 defined. But unfortunately, the uClibc C library pretends to be
9 compatible with glibc by defining __GLIBC__, but it doesn't provide
12 To better support this situation, we add an AC_CHECK_HEADERS() check
13 on mcheck.h, and then use HAVE_MCHECK_H were appropriate.
15 Submitted upstream: https://github.com/rcmadruga/log4c-localtime/pull/1
17 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
20 src/log4c/init.c | 6 +++---
21 2 files changed, 4 insertions(+), 4 deletions(-)
23 diff --git a/configure.in b/configure.in
24 index 612ccbe..dbf11e9 100644
27 @@ -115,7 +115,7 @@ AM_CONDITIONAL(TEST, test x$enable_test = xyes)
29 AC_CHECK_HEADERS([fcntl.h inttypes.h langinfo.h limits.h stddef.h stdint.h \
30 stdlib.h string.h sys/time.h syslog.h unistd.h stdarg.h varargs.h getopt.h \
34 # Checks for typedefs, structures, and compiler characteristics.
36 diff --git a/src/log4c/init.c b/src/log4c/init.c
37 index 7dd9eb4..4b88210 100644
38 --- a/src/log4c/init.c
39 +++ b/src/log4c/init.c
40 @@ -35,7 +35,7 @@ static const char version[] = "$Id$";
41 #include <layout_type_basic_r.h>
42 #include <layout_type_dated_r.h>
44 -#if defined(__LOG4C_DEBUG__) && defined(__GLIBC__)
45 +#if defined(__LOG4C_DEBUG__) && defined(HAVE_MCHECK_H)
49 @@ -100,7 +100,7 @@ extern int log4c_init(void)
50 sd_debug("log4c_init[");
52 /* activate GLIBC allocation debugging */
53 -#if defined(__LOG4C_DEBUG__) && defined(__GLIBC__)
54 +#if defined(__LOG4C_DEBUG__) && defined(HAVE_MCHECK_H)
58 @@ -280,7 +280,7 @@ extern int log4c_fini(void)
59 log4c_dump_all_instances(stderr);
62 -#if defined(__LOG4C_DEBUG__) && defined(__GLIBC__)
63 +#if defined(__LOG4C_DEBUG__) && defined(HAVE_MCHECK_H)