summaryrefslogtreecommitdiffstats
path: root/package/liblog4c-localtime/0003-Fix-debug-mode-build-with-uClibc.patch
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2014-10-26 12:17:29 +0100
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2014-10-26 12:33:54 +0100
commitf97702e8f42bdd8fd30e1ef53fe195887c3670c7 (patch)
tree35440d33b7d53e7843a6b45a73c2cec20dc7972b /package/liblog4c-localtime/0003-Fix-debug-mode-build-with-uClibc.patch
parent84a9c4b72fb53abe4865a2202536c737aac29238 (diff)
downloadbuildroot-f97702e8f42bdd8fd30e1ef53fe195887c3670c7.tar.gz
buildroot-f97702e8f42bdd8fd30e1ef53fe195887c3670c7.zip
liblog4c-localtime: fix build issue on uClibc with --enable-debug
When --enable-debug is used, liblog4c-localtime wants to use <mcheck.h> if __GLIBC__ is defined. Unfortunately, uClibc defines __GLIBC__ but does not provides mcheck.h. Therefore, this commit introduces a patch (0003) that checks if mcheck.h is available or not. However, this patch requires autoreconfiguring the package, which is currently broken. Therefore, the two other patches (0004 and 0005) are meant to fix autoreconfiguration of the package. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/liblog4c-localtime/0003-Fix-debug-mode-build-with-uClibc.patch')
-rw-r--r--package/liblog4c-localtime/0003-Fix-debug-mode-build-with-uClibc.patch67
1 files changed, 67 insertions, 0 deletions
diff --git a/package/liblog4c-localtime/0003-Fix-debug-mode-build-with-uClibc.patch b/package/liblog4c-localtime/0003-Fix-debug-mode-build-with-uClibc.patch
new file mode 100644
index 0000000000..812af9eef1
--- /dev/null
+++ b/package/liblog4c-localtime/0003-Fix-debug-mode-build-with-uClibc.patch
@@ -0,0 +1,67 @@
+From acbaee34bcb1881db97969dd2c411446f32ca4cc Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Sat, 25 Oct 2014 19:45:33 +0200
+Subject: [PATCH 3/5] Fix debug mode build with uClibc
+
+When --enable-debug is passed, liblog4c-localtime wants to use
+<mcheck.h>. It takes the precaution of testing if __GLIBC__ is
+defined. But unfortunately, the uClibc C library pretends to be
+compatible with glibc by defining __GLIBC__, but it doesn't provide
+mcheck.h.
+
+To better support this situation, we add an AC_CHECK_HEADERS() check
+on mcheck.h, and then use HAVE_MCHECK_H were appropriate.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ configure.in | 2 +-
+ src/log4c/init.c | 6 +++---
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index 612ccbe..dbf11e9 100644
+--- a/configure.in
++++ b/configure.in
+@@ -115,7 +115,7 @@ AM_CONDITIONAL(TEST, test x$enable_test = xyes)
+ AC_HEADER_STDC
+ AC_CHECK_HEADERS([fcntl.h inttypes.h langinfo.h limits.h stddef.h stdint.h \
+ stdlib.h string.h sys/time.h syslog.h unistd.h stdarg.h varargs.h getopt.h \
+-pthread.h])
++pthread.h mcheck.h])
+
+ # Checks for typedefs, structures, and compiler characteristics.
+ AC_C_CONST
+diff --git a/src/log4c/init.c b/src/log4c/init.c
+index 7dd9eb4..4b88210 100644
+--- a/src/log4c/init.c
++++ b/src/log4c/init.c
+@@ -35,7 +35,7 @@ static const char version[] = "$Id$";
+ #include <layout_type_basic_r.h>
+ #include <layout_type_dated_r.h>
+
+-#if defined(__LOG4C_DEBUG__) && defined(__GLIBC__)
++#if defined(__LOG4C_DEBUG__) && defined(HAVE_MCHECK_H)
+ #include <mcheck.h>
+ #endif
+
+@@ -100,7 +100,7 @@ extern int log4c_init(void)
+ sd_debug("log4c_init[");
+
+ /* activate GLIBC allocation debugging */
+-#if defined(__LOG4C_DEBUG__) && defined(__GLIBC__)
++#if defined(__LOG4C_DEBUG__) && defined(HAVE_MCHECK_H)
+ mtrace();
+ #endif
+
+@@ -280,7 +280,7 @@ extern int log4c_fini(void)
+ log4c_dump_all_instances(stderr);
+ }
+ #endif
+-#if defined(__LOG4C_DEBUG__) && defined(__GLIBC__)
++#if defined(__LOG4C_DEBUG__) && defined(HAVE_MCHECK_H)
+ muntrace();
+ #endif
+
+--
+2.0.0
+
OpenPOWER on IntegriCloud