From 30159aea4b3f6421da9d74a8bf22aad6d3bf26b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Krause?= Date: Mon, 4 Apr 2016 20:48:43 +0200 Subject: [PATCH 1/4] GNU version of strerror_r not available on musl The GNU version of glibc' `strerror_r` is non-portable. When the POSIX and GNU API collides musl always provides the POSIX API. That being the case for `strerror_r` musl does only support the POSIX version, despite of `_GNU_SOURCE`. --- Foundation/src/Error.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Foundation/src/Error.cpp b/Foundation/src/Error.cpp index 6a8afb705..00991fc0b 100644 --- a/Foundation/src/Error.cpp +++ b/Foundation/src/Error.cpp @@ -69,7 +69,10 @@ namespace Poco { without -D_GNU_SOURCE is needed, otherwise the GNU version is preferred. */ -#if defined _GNU_SOURCE && !POCO_ANDROID + /* The GNU version of strerror_r is non-portable and not + available on the musl C library. + */ +#if (defined __GLIBC__ || defined __UCLIBC__) && defined _GNU_SOURCE && !POCO_ANDROID char errmsg[256] = ""; return std::string(strerror_r(errorCode, errmsg, 256)); #elif (_XOPEN_SOURCE >= 600) || POCO_ANDROID From 3c735ff6b0d3ddd9b740f1f9d45bbe5290e00e8c Mon Sep 17 00:00:00 2001 From: Aleksandar Fabijanic Date: Mon, 4 Apr 2016 20:17:52 -0500 Subject: [PATCH 2/4] remove comment --- Foundation/src/Error.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/Foundation/src/Error.cpp b/Foundation/src/Error.cpp index 00991fc0b..4980a84ce 100644 --- a/Foundation/src/Error.cpp +++ b/Foundation/src/Error.cpp @@ -69,9 +69,6 @@ namespace Poco { without -D_GNU_SOURCE is needed, otherwise the GNU version is preferred. */ - /* The GNU version of strerror_r is non-portable and not - available on the musl C library. - */ #if (defined __GLIBC__ || defined __UCLIBC__) && defined _GNU_SOURCE && !POCO_ANDROID char errmsg[256] = ""; return std::string(strerror_r(errorCode, errmsg, 256)); From 299c75a99350ed565af8c41356204c4565fba162 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 5 Apr 2016 10:40:52 +0200 Subject: [PATCH 3/4] GH #1050 XML-tests: fix gcc -Wshadow warnings --- XML/testsuite/src/AttributesImplTest.cpp | 2 +- XML/testsuite/src/ChildNodesTest.cpp | 2 +- XML/testsuite/src/DocumentTest.cpp | 2 +- XML/testsuite/src/DocumentTypeTest.cpp | 2 +- XML/testsuite/src/ElementTest.cpp | 2 +- XML/testsuite/src/EventTest.cpp | 2 +- XML/testsuite/src/NamePoolTest.cpp | 8 ++++---- XML/testsuite/src/NameTest.cpp | 22 +++++++++++----------- XML/testsuite/src/NamespaceSupportTest.cpp | 2 +- XML/testsuite/src/NodeAppenderTest.cpp | 2 +- XML/testsuite/src/NodeIteratorTest.cpp | 2 +- XML/testsuite/src/NodeTest.cpp | 2 +- XML/testsuite/src/ParserWriterTest.cpp | 2 +- XML/testsuite/src/SAXParserTest.cpp | 2 +- XML/testsuite/src/TextTest.cpp | 2 +- XML/testsuite/src/TreeWalkerTest.cpp | 2 +- XML/testsuite/src/XMLStreamParserTest.cpp | 4 ++-- XML/testsuite/src/XMLWriterTest.cpp | 2 +- 18 files changed, 32 insertions(+), 32 deletions(-) diff --git a/XML/testsuite/src/AttributesImplTest.cpp b/XML/testsuite/src/AttributesImplTest.cpp index 3becee606..0e748b45c 100644 --- a/XML/testsuite/src/AttributesImplTest.cpp +++ b/XML/testsuite/src/AttributesImplTest.cpp @@ -19,7 +19,7 @@ using Poco::XML::AttributesImpl; -AttributesImplTest::AttributesImplTest(const std::string& name): CppUnit::TestCase(name) +AttributesImplTest::AttributesImplTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/XML/testsuite/src/ChildNodesTest.cpp b/XML/testsuite/src/ChildNodesTest.cpp index cbf301a12..c0c3e73a7 100644 --- a/XML/testsuite/src/ChildNodesTest.cpp +++ b/XML/testsuite/src/ChildNodesTest.cpp @@ -26,7 +26,7 @@ using Poco::XML::Node; using Poco::XML::AutoPtr; -ChildNodesTest::ChildNodesTest(const std::string& name): CppUnit::TestCase(name) +ChildNodesTest::ChildNodesTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/XML/testsuite/src/DocumentTest.cpp b/XML/testsuite/src/DocumentTest.cpp index 7cf529098..b34c351e8 100644 --- a/XML/testsuite/src/DocumentTest.cpp +++ b/XML/testsuite/src/DocumentTest.cpp @@ -31,7 +31,7 @@ using Poco::XML::XMLString; using Poco::XML::DOMException; -DocumentTest::DocumentTest(const std::string& name): CppUnit::TestCase(name) +DocumentTest::DocumentTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/XML/testsuite/src/DocumentTypeTest.cpp b/XML/testsuite/src/DocumentTypeTest.cpp index 0cb830bea..28458046c 100644 --- a/XML/testsuite/src/DocumentTypeTest.cpp +++ b/XML/testsuite/src/DocumentTypeTest.cpp @@ -31,7 +31,7 @@ using Poco::XML::NamedNodeMap; using Poco::XML::AutoPtr; -DocumentTypeTest::DocumentTypeTest(const std::string& name): CppUnit::TestCase(name) +DocumentTypeTest::DocumentTypeTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/XML/testsuite/src/ElementTest.cpp b/XML/testsuite/src/ElementTest.cpp index f62aa1c62..3b923168a 100644 --- a/XML/testsuite/src/ElementTest.cpp +++ b/XML/testsuite/src/ElementTest.cpp @@ -33,7 +33,7 @@ using Poco::XML::AutoPtr; using Poco::XML::XMLString; -ElementTest::ElementTest(const std::string& name): CppUnit::TestCase(name) +ElementTest::ElementTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/XML/testsuite/src/EventTest.cpp b/XML/testsuite/src/EventTest.cpp index 2b654c579..1128b1dc5 100644 --- a/XML/testsuite/src/EventTest.cpp +++ b/XML/testsuite/src/EventTest.cpp @@ -133,7 +133,7 @@ private: XMLString TestEventListener::_log; -EventTest::EventTest(const std::string& name): CppUnit::TestCase(name) +EventTest::EventTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/XML/testsuite/src/NamePoolTest.cpp b/XML/testsuite/src/NamePoolTest.cpp index 2ef21927e..776794ee7 100644 --- a/XML/testsuite/src/NamePoolTest.cpp +++ b/XML/testsuite/src/NamePoolTest.cpp @@ -23,7 +23,7 @@ using Poco::XML::Name; using Poco::XML::AutoPtr; -NamePoolTest::NamePoolTest(const std::string& name): CppUnit::TestCase(name) +NamePoolTest::NamePoolTest(const std::string& rName): CppUnit::TestCase(rName) { } @@ -37,16 +37,16 @@ void NamePoolTest::testNamePool() { AutoPtr pool = new NamePool; const Name* pName = 0; - Name name("pre:local", "http://www.appinf.com"); + Name xmlName("pre:local", "http://www.appinf.com"); - pName = &pool->insert(name); + pName = &pool->insert(xmlName); const Name* pName2 = &pool->insert("pre:local", "http://www.appinf.com", "local"); assert (pName == pName2); pName2 = &pool->insert("pre:local2", "http://www.appinf.com", "local2"); assert (pName2 != pName); - pName2 = &pool->insert(name); + pName2 = &pool->insert(xmlName); assert (pName2 == pName); pName2 = &pool->insert(*pName); diff --git a/XML/testsuite/src/NameTest.cpp b/XML/testsuite/src/NameTest.cpp index e611fbcb0..dac17ca50 100644 --- a/XML/testsuite/src/NameTest.cpp +++ b/XML/testsuite/src/NameTest.cpp @@ -19,7 +19,7 @@ using Poco::XML::Name; -NameTest::NameTest(const std::string& name): CppUnit::TestCase(name) +NameTest::NameTest(const std::string& rName): CppUnit::TestCase(rName) { } @@ -81,18 +81,18 @@ void NameTest::testPrefix() void NameTest::testName() { std::string qname = "name"; - Name name(qname); - assert (name.qname() == "name"); - assert (name.prefix().empty()); - assert (name.namespaceURI().empty()); - assert (name.localName().empty()); + Name xmlName(qname); + assert (xmlName.qname() == "name"); + assert (xmlName.prefix().empty()); + assert (xmlName.namespaceURI().empty()); + assert (xmlName.localName().empty()); qname.clear(); - name.assign(qname, "http://www.appinf.com/", "local"); - assert (name.qname().empty()); - assert (name.prefix().empty()); - assert (name.namespaceURI() == "http://www.appinf.com/"); - assert (name.localName() == "local"); + xmlName.assign(qname, "http://www.appinf.com/", "local"); + assert (xmlName.qname().empty()); + assert (xmlName.prefix().empty()); + assert (xmlName.namespaceURI() == "http://www.appinf.com/"); + assert (xmlName.localName() == "local"); Name name2("pre:local", "http://www.appinf.com/"); assert (name2.qname() == "pre:local"); diff --git a/XML/testsuite/src/NamespaceSupportTest.cpp b/XML/testsuite/src/NamespaceSupportTest.cpp index 7111448b4..0ffd7c31e 100644 --- a/XML/testsuite/src/NamespaceSupportTest.cpp +++ b/XML/testsuite/src/NamespaceSupportTest.cpp @@ -19,7 +19,7 @@ using Poco::XML::NamespaceSupport; -NamespaceSupportTest::NamespaceSupportTest(const std::string& name): CppUnit::TestCase(name) +NamespaceSupportTest::NamespaceSupportTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/XML/testsuite/src/NodeAppenderTest.cpp b/XML/testsuite/src/NodeAppenderTest.cpp index fce137d57..64464cbeb 100644 --- a/XML/testsuite/src/NodeAppenderTest.cpp +++ b/XML/testsuite/src/NodeAppenderTest.cpp @@ -28,7 +28,7 @@ using Poco::XML::AutoPtr; using Poco::XML::XMLString; -NodeAppenderTest::NodeAppenderTest(const std::string& name): CppUnit::TestCase(name) +NodeAppenderTest::NodeAppenderTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/XML/testsuite/src/NodeIteratorTest.cpp b/XML/testsuite/src/NodeIteratorTest.cpp index 8584fa174..89145a72a 100644 --- a/XML/testsuite/src/NodeIteratorTest.cpp +++ b/XML/testsuite/src/NodeIteratorTest.cpp @@ -46,7 +46,7 @@ namespace } -NodeIteratorTest::NodeIteratorTest(const std::string& name): CppUnit::TestCase(name) +NodeIteratorTest::NodeIteratorTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/XML/testsuite/src/NodeTest.cpp b/XML/testsuite/src/NodeTest.cpp index 0a774fba7..d131e003d 100644 --- a/XML/testsuite/src/NodeTest.cpp +++ b/XML/testsuite/src/NodeTest.cpp @@ -26,7 +26,7 @@ using Poco::XML::Node; using Poco::XML::AutoPtr; -NodeTest::NodeTest(const std::string& name): CppUnit::TestCase(name) +NodeTest::NodeTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/XML/testsuite/src/ParserWriterTest.cpp b/XML/testsuite/src/ParserWriterTest.cpp index c2702a890..9c64615b7 100644 --- a/XML/testsuite/src/ParserWriterTest.cpp +++ b/XML/testsuite/src/ParserWriterTest.cpp @@ -32,7 +32,7 @@ using Poco::XML::AutoPtr; using Poco::XML::InputSource; -ParserWriterTest::ParserWriterTest(const std::string& name): CppUnit::TestCase(name) +ParserWriterTest::ParserWriterTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/XML/testsuite/src/SAXParserTest.cpp b/XML/testsuite/src/SAXParserTest.cpp index 24a3063ed..cd4a4cfa7 100644 --- a/XML/testsuite/src/SAXParserTest.cpp +++ b/XML/testsuite/src/SAXParserTest.cpp @@ -64,7 +64,7 @@ public: }; -SAXParserTest::SAXParserTest(const std::string& name): CppUnit::TestCase(name) +SAXParserTest::SAXParserTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/XML/testsuite/src/TextTest.cpp b/XML/testsuite/src/TextTest.cpp index 713032eef..90e17c01c 100644 --- a/XML/testsuite/src/TextTest.cpp +++ b/XML/testsuite/src/TextTest.cpp @@ -28,7 +28,7 @@ using Poco::XML::AutoPtr; using Poco::XML::XMLString; -TextTest::TextTest(const std::string& name): CppUnit::TestCase(name) +TextTest::TextTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/XML/testsuite/src/TreeWalkerTest.cpp b/XML/testsuite/src/TreeWalkerTest.cpp index d7dbe28e5..f5a696c7b 100644 --- a/XML/testsuite/src/TreeWalkerTest.cpp +++ b/XML/testsuite/src/TreeWalkerTest.cpp @@ -57,7 +57,7 @@ namespace } -TreeWalkerTest::TreeWalkerTest(const std::string& name): CppUnit::TestCase(name) +TreeWalkerTest::TreeWalkerTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/XML/testsuite/src/XMLStreamParserTest.cpp b/XML/testsuite/src/XMLStreamParserTest.cpp index 058687573..c3120f3ea 100644 --- a/XML/testsuite/src/XMLStreamParserTest.cpp +++ b/XML/testsuite/src/XMLStreamParserTest.cpp @@ -23,8 +23,8 @@ using namespace Poco::XML; -XMLStreamParserTest::XMLStreamParserTest(const std::string& name): - CppUnit::TestCase(name) +XMLStreamParserTest::XMLStreamParserTest(const std::string& rName): + CppUnit::TestCase(rName) { } diff --git a/XML/testsuite/src/XMLWriterTest.cpp b/XML/testsuite/src/XMLWriterTest.cpp index 1a4c79078..6fe08b608 100644 --- a/XML/testsuite/src/XMLWriterTest.cpp +++ b/XML/testsuite/src/XMLWriterTest.cpp @@ -23,7 +23,7 @@ using Poco::XML::XMLWriter; using Poco::XML::AttributesImpl; -XMLWriterTest::XMLWriterTest(const std::string& name): CppUnit::TestCase(name) +XMLWriterTest::XMLWriterTest(const std::string& rName): CppUnit::TestCase(rName) { } From 55d22512fc68f4ef13c56f315fc083ced81c3504 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Krause?= Date: Mon, 4 Apr 2016 21:49:36 +0200 Subject: [PATCH 4/4] MySQL: allow to override search path The default search pathes for the MySQL library and header files are for hosts only and do not allow cross-compilation of poco against a target MySQL. Allow to pass the pathes through the build environment by setting MYSQL_LIBDIR and MYSQL_INCDIR. --- Data/MySQL/Makefile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Data/MySQL/Makefile b/Data/MySQL/Makefile index 0b18ca555..09f7ff5ea 100644 --- a/Data/MySQL/Makefile +++ b/Data/MySQL/Makefile @@ -8,8 +8,18 @@ include $(POCO_BASE)/build/rules/global -SYSLIBS += -L/usr/local/lib$(LIB64SUFFIX)/mysql -L/usr/lib$(LIB64SUFFIX)/mysql -L/usr/mysql/lib$(LIB64SUFFIX) -L/usr/mysql/lib$(LIB64SUFFIX)/mysql -L/usr/local/mysql/lib$(LIB64SUFFIX) -lmysqlclient -INCLUDE += -I/usr/local/include/mysql/ -I/usr/include/mysql/ -I/usr/mysql/include/mysql -I/usr/local/mysql/include +MYSQL_LIBDIR ?= /usr/local/lib$(LIB64SUFFIX)/mysql \ + /usr/lib$(LIB64SUFFIX)/mysql \ + /usr/mysql/lib$(LIB64SUFFIX) \ + /usr/mysql/lib$(LIB64SUFFIX)/mysql \ + /usr/local/mysql/lib$(LIB64SUFFIX) +MYSQL_INCDIR ?= /usr/local/include/mysql/ \ + /usr/include/mysql/ \ + /usr/mysql/include/mysql \ + /usr/local/mysql/include + +SYSLIBS += $(foreach dir,$(MYSQL_LIBDIR),-L$(dir)) -lmysqlclient +INCLUDE += $(foreach dir,$(MYSQL_INCDIR),-I$(dir)) SYSFLAGS += -DTHREADSAFE -DNO_TCL objects = Binder Extractor SessionImpl Connector \