log4c.m4: fix "underquoted definition of AM_PATH_LOG4C" warning

When autoreconfiguring liblog4c-localtime, there is a warning from
autoconf caused by an underquoted definition of AM_PATH_LOG4C. This
patch fixes this warning.

Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Fix linking error without pthread

The rollingfile functionality only gets built if pthread support is
available, but a call to these functions from log4c_fini() was outside
the #if WITH_ROLLINGFILE conditional, causing linker errors when the
library is used.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
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>
Add AC_CONFIG_MACRO_DIR to configure.in

Without AC_CONFIG_MACRO_DIR, when autoreconfiguring the package, it
cannot find AM_PATH_EXPAT which is defined in config/expat.m4.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Fix C++ support

Autoreconf fails with the following message:

tests/log4c/Makefile.am: error: C++ source seen but 'CXX' is undefined

So this commit adds the AC_PROG_CXX macro to configure.in, and ensures
that the C++ test is only built if a C++ compiler is available.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Merge pull request #1 from tpetazzoni/build-fixes

Various build system fixes