summaryrefslogtreecommitdiffstats
path: root/package/log4cxx
diff options
context:
space:
mode:
Diffstat (limited to 'package/log4cxx')
-rw-r--r--package/log4cxx/Config.in15
-rw-r--r--package/log4cxx/log4cxx-0001-charset-fixes.patch43
-rw-r--r--package/log4cxx/log4cxx-0002-missing-includes.patch44
-rw-r--r--package/log4cxx/log4cxx-0003-missing-includes.patch21
-rw-r--r--package/log4cxx/log4cxx.mk20
5 files changed, 143 insertions, 0 deletions
diff --git a/package/log4cxx/Config.in b/package/log4cxx/Config.in
new file mode 100644
index 000000000..e98aedc46
--- /dev/null
+++ b/package/log4cxx/Config.in
@@ -0,0 +1,15 @@
+config BR2_PACKAGE_LOG4CXX
+ bool "log4cxx"
+ select BR2_PACKAGE_APR
+ select BR2_PACKAGE_APR_UTIL
+ # apr really needs shared library support
+ depends on !BR2_PREFER_STATIC_LIB
+ depends on BR2_INSTALL_LIBSTDCPP
+ help
+ Apache log4cxx is a logging framework for C++ patterned
+ after Apache log4j.
+
+ http://apache.linux-mirror.org/logging/log4cxx/0.10.0
+
+comment "log4cxx requires C++ support in toolchain"
+ depends on !BR2_INSTALL_LIBSTDCPP
diff --git a/package/log4cxx/log4cxx-0001-charset-fixes.patch b/package/log4cxx/log4cxx-0001-charset-fixes.patch
new file mode 100644
index 000000000..75567fdad
--- /dev/null
+++ b/package/log4cxx/log4cxx-0001-charset-fixes.patch
@@ -0,0 +1,43 @@
+Fix build when iconv support is not available
+
+When iconv support is not available, the apr-util library does not
+provide character set conversion features, and therefore APR_HAS_XLATE
+is false.
+
+However, on Linux !defined(_WIN32) is always true, but the part of the
+code that defines the APRCharsetDecoder and APRCharsetEncoder are only
+enclosed in a #if APR_HAS_XLATE, without the "|| defined(_WIN32)"
+which leads to build failures: the APRCharsetEncoder and
+APRCharsetDecoder classes are used without being defined.
+
+This patch removes the || !defined(_WIN32) so that when iconv support
+is not here, we fall back to raising an exception at runtime.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
+Index: b/src/main/cpp/charsetdecoder.cpp
+===================================================================
+--- a/src/main/cpp/charsetdecoder.cpp
++++ b/src/main/cpp/charsetdecoder.cpp
+@@ -476,7 +476,7 @@
+ StringHelper::equalsIgnoreCase(charset, LOG4CXX_STR("ISO-LATIN-1"), LOG4CXX_STR("iso-latin-1"))) {
+ return new ISOLatinCharsetDecoder();
+ }
+-#if APR_HAS_XLATE || !defined(_WIN32)
++#if APR_HAS_XLATE
+ return new APRCharsetDecoder(charset);
+ #else
+ throw IllegalArgumentException(charset);
+Index: b/src/main/cpp/charsetencoder.cpp
+===================================================================
+--- a/src/main/cpp/charsetencoder.cpp
++++ b/src/main/cpp/charsetencoder.cpp
+@@ -484,7 +484,7 @@
+ } else if (StringHelper::equalsIgnoreCase(charset, LOG4CXX_STR("UTF-16LE"), LOG4CXX_STR("utf-16le"))) {
+ return new UTF16LECharsetEncoder();
+ }
+-#if APR_HAS_XLATE || !defined(_WIN32)
++#if APR_HAS_XLATE
+ return new APRCharsetEncoder(charset);
+ #else
+ throw IllegalArgumentException(charset);
diff --git a/package/log4cxx/log4cxx-0002-missing-includes.patch b/package/log4cxx/log4cxx-0002-missing-includes.patch
new file mode 100644
index 000000000..dd4da1161
--- /dev/null
+++ b/package/log4cxx/log4cxx-0002-missing-includes.patch
@@ -0,0 +1,44 @@
+commit bcaf1f8a682d641cee325142099c371464fd5946
+Author: Curtis William Arnold <carnold@apache.org>
+Date: Tue May 20 16:05:37 2008 +0000
+
+ LOGCXX-286: gcc 4.3 requires #include <cstring>
+
+ git-svn-id: https://svn.apache.org/repos/asf/logging/log4cxx/trunk@658304 13f79535-47bb-0310-9956-ffa450edef68
+
+diff --git a/src/examples/cpp/console.cpp b/src/examples/cpp/console.cpp
+index 6a01d8a..a673a10 100755
+--- a/src/examples/cpp/console.cpp
++++ b/src/examples/cpp/console.cpp
+@@ -22,6 +22,7 @@
+ #include <log4cxx/logmanager.h>
+ #include <iostream>
+ #include <locale.h>
++#include <cstring>
+
+ using namespace log4cxx;
+ using namespace log4cxx::helpers;
+diff --git a/src/main/cpp/inputstreamreader.cpp b/src/main/cpp/inputstreamreader.cpp
+index 52b1c0a..cb45181 100644
+--- a/src/main/cpp/inputstreamreader.cpp
++++ b/src/main/cpp/inputstreamreader.cpp
+@@ -20,6 +20,7 @@
+ #include <log4cxx/helpers/exception.h>
+ #include <log4cxx/helpers/pool.h>
+ #include <log4cxx/helpers/bytebuffer.h>
++#include <cstring>
+
+ using namespace log4cxx;
+ using namespace log4cxx::helpers;
+diff --git a/src/main/cpp/socketoutputstream.cpp b/src/main/cpp/socketoutputstream.cpp
+index 185f835..c61eb11 100644
+--- a/src/main/cpp/socketoutputstream.cpp
++++ b/src/main/cpp/socketoutputstream.cpp
+@@ -19,6 +19,7 @@
+ #include <log4cxx/helpers/socketoutputstream.h>
+ #include <log4cxx/helpers/socket.h>
+ #include <log4cxx/helpers/bytebuffer.h>
++#include <cstring>
+
+ using namespace log4cxx;
+ using namespace log4cxx::helpers;
diff --git a/package/log4cxx/log4cxx-0003-missing-includes.patch b/package/log4cxx/log4cxx-0003-missing-includes.patch
new file mode 100644
index 000000000..cd21bbab3
--- /dev/null
+++ b/package/log4cxx/log4cxx-0003-missing-includes.patch
@@ -0,0 +1,21 @@
+commit ce62c00ea5f9bf2f0740ecde5b245c9b7edc80ff
+Author: Curtis William Arnold <carnold@apache.org>
+Date: Mon Apr 27 03:53:50 2009 +0000
+
+ LOGCXX-332: fails to build with gcc 4.4
+
+ git-svn-id: https://svn.apache.org/repos/asf/logging/log4cxx/trunk@768863 13f79535-47bb-0310-9956-ffa450edef68
+
+diff --git a/src/examples/cpp/console.cpp b/src/examples/cpp/console.cpp
+index a673a10..f44c944 100755
+--- a/src/examples/cpp/console.cpp
++++ b/src/examples/cpp/console.cpp
+@@ -23,6 +23,8 @@
+ #include <iostream>
+ #include <locale.h>
+ #include <cstring>
++#include <cstdio>
++#include <stdint.h>
+
+ using namespace log4cxx;
+ using namespace log4cxx::helpers;
diff --git a/package/log4cxx/log4cxx.mk b/package/log4cxx/log4cxx.mk
new file mode 100644
index 000000000..83afded9c
--- /dev/null
+++ b/package/log4cxx/log4cxx.mk
@@ -0,0 +1,20 @@
+#############################################################
+#
+# log4cxx
+#
+#############################################################
+
+LOG4CXX_VERSION = 0.10.0
+LOG4CXX_SITE = http://archive.apache.org/dist/logging/log4cxx/$(LOG4CXX_VERSION)
+LOG4CXX_SOURCE = apache-log4cxx-$(LOG4CXX_VERSION).tar.gz
+LOG4CXX_INSTALL_STAGING = YES
+LOG4CXX_LICENSE = Apache-2.0
+LOG4CXX_LICENSE_FILES = LICENSE
+
+LOG4CXX_CONF_OPT = \
+ --with-apr=$(STAGING_DIR)/usr/bin/apr-1-config \
+ --with-apr-util=$(STAGING_DIR)/usr/bin/apu-1-config
+
+LOG4CXX_DEPENDENCIES = apr apr-util
+
+$(eval $(autotools-package))