Skip to content

Commit

Permalink
- SF #3552774: Don't hide default target in subordinate makefile
Browse files Browse the repository at this point in the history
- SF #3534307: Building IPv6 for Linux by default
- SF #3516844: poco missing symbols with external >=lipcre-8.13 
- fix of rev. 1952 fix (porting rev.1913 from 1.4.4 (fixed SF# 3550553))
  • Loading branch information
aleks-f committed Aug 20, 2012
1 parent 06204c4 commit 90a8e85
Show file tree
Hide file tree
Showing 13 changed files with 123 additions and 59 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ Release 1.5.0 (2012-08-??)
- fixed SF# 3012166: IPv6 patch
- added SF# 3558085: Add formatter to MACAddress object
- fixed SF# 3535990: POCO_HAVE_IPv6 without POCO_WIN32_UTF8 conflict
- fixed SF #3552774: Don't hide default target in subordinate makefile
- fixed SF #3534307: Building IPv6 for Linux by default
- fixed SF #3516844: poco missing symbols with external >=lipcre-8.13

Release 1.4.4 (2012-08-??)
==========================
Expand Down
18 changes: 9 additions & 9 deletions Data/ODBC/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,14 @@

include $(POCO_BASE)/build/rules/global

# adjust for the target system (usually '/usr/lib' or '/usr/local/lib')
ODBCLIBDIR = /usr/lib$(LIB64SUFFIX)
ifeq ($(LINKMODE),STATIC)
LIBLINKEXT = $(STATICLIBLINKEXT)
else
LIBLINKEXT = $(SHAREDLIBLINKEXT)
endif

INCLUDE += -I/usr/local/include -I/usr/include -I/usr/include/odbc -I/usr/local/include/odbc
SYSLIBS += -L/usr/lib$(LIB64SUFFIX) -L/usr/local/lib$(LIB64SUFFIX) -L/usr/lib$(LIB64SUFFIX)/odbc -L/usr/local/lib$(LIB64SUFFIX)/odbc
INCLUDE += $(POCO_ODBC_INCLUDE)
SYSLIBS += $(POCO_ODBC_LIBRARY)

ifeq ($(POCO_CONFIG),MinGW)
# -DODBCVER=0x0300: SQLHandle declaration issue
Expand All @@ -36,23 +34,25 @@ CXXFLAGS += -DODBCVER=0x0300 -DNOMINMAX
# CYGWIN platform has its own ODBC library in /lib/w32api
SYSLIBS += -L/lib/w32api -lodbc32 -lodbccp32
else
ifeq (0, $(shell test -e $(ODBCLIBDIR)/libodbc$(LIBLINKEXT); echo $$?))
ifeq (0, $(shell test -e $(POCO_ODBC_LIBRARY)/libodbc$(LIBLINKEXT); echo $$?))
SYSLIBS += -lodbc -lodbcinst
COMMONFLAGS += -DPOCO_UNIXODBC
else
ifeq (0, $(shell test -h $(ODBCLIBDIR)/libodbc$(LIBLINKEXT); echo $$?))
ifeq (0, $(shell test -h $(POCO_ODBC_LIBRARY)/libodbc$(LIBLINKEXT); echo $$?))
SYSLIBS += -lodbc -lodbcinst
COMMONFLAGS += -DPOCO_UNIXODBC
else
ifeq (0, $(shell test -e $(ODBCLIBDIR)/libiodbc$(LIBLINKEXT); echo $$?))
ifeq (0, $(shell test -e $(POCO_ODBC_LIBRARY)/libiodbc$(LIBLINKEXT); echo $$?))
SYSLIBS += -liodbc -liodbcinst
COMMONFLAGS += -DPOCO_IODBC -I/usr/include/iodbc
else
ifeq (0, $(shell test -h $(ODBCLIBDIR)/libiodbc$(LIBLINKEXT); echo $$?))
ifeq (0, $(shell test -h $(POCO_ODBC_LIBRARY)/libiodbc$(LIBLINKEXT); echo $$?))
SYSLIBS += -liodbc -liodbcinst -I/usr/include/iodbc
COMMONFLAGS += -DPOCO_IODBC
else
$(error No ODBC library found. Please install unixODBC or iODBC and try again)
ifndef (POCO_NO_ODBC)
$(warning No ODBC library found. Please install unixODBC or iODBC.)
endif
endif
endif
endif
Expand Down
20 changes: 10 additions & 10 deletions Data/ODBC/testsuite/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,14 @@

include $(POCO_BASE)/build/rules/global

# adjust for the target system (usually '/usr/lib' or '/usr/local/lib')
ODBCLIBDIR = /usr/lib$(LIB64SUFFIX)
ifeq ($(LINKMODE),STATIC)
LIBLINKEXT = $(STATICLIBLINKEXT)
else
LIBLINKEXT = $(SHAREDLIBLINKEXT)
endif

INCLUDE += -I/usr/local/include -I/usr/include -I/usr/include/odbc -I/usr/local/include/odbc
SYSLIBS += -L/usr/lib$(LIB64SUFFIX) -L/usr/local/lib$(LIB64SUFFIX) -L/usr/lib$(LIB64SUFFIX)/odbc -L/usr/local/lib$(LIB64SUFFIX)/odbc
INCLUDE += $(POCO_ODBC_INCLUDE)
SYSLIBS += $(POCO_ODBC_LIBRARY)

ifeq ($(POCO_CONFIG),MinGW)
# -DODBCVER=0x0300: SQLHandle declaration issue
Expand All @@ -33,26 +31,28 @@ else ifeq ($(POCO_CONFIG),CYGWIN)
# -DODBCVER=0x0300: SQLHandle declaration issue
# -DNOMINMAX : MIN/MAX macros defined in windows conflict with libstdc++
CXXFLAGS += -DODBCVER=0x0300 -DNOMINMAX
# CYGWIN platform has its own ODBC library in /lib/w32api
# CYGWIN platform has its own ODBC library in /lib/w32api
SYSLIBS += -L/lib/w32api -lodbc32 -lodbccp32
else
ifeq (0, $(shell test -e $(ODBCLIBDIR)/libodbc$(LIBLINKEXT); echo $$?))
ifeq (0, $(shell test -e $(POCO_ODBC_LIBRARY)/libodbc$(LIBLINKEXT); echo $$?))
SYSLIBS += -lodbc -lodbcinst
COMMONFLAGS += -DPOCO_UNIXODBC
else
ifeq (0, $(shell test -h $(ODBCLIBDIR)/libodbc$(LIBLINKEXT); echo $$?))
ifeq (0, $(shell test -h $(POCO_ODBC_LIBRARY)/libodbc$(LIBLINKEXT); echo $$?))
SYSLIBS += -lodbc -lodbcinst
COMMONFLAGS += -DPOCO_UNIXODBC
else
ifeq (0, $(shell test -e $(ODBCLIBDIR)/libiodbc$(LIBLINKEXT); echo $$?))
ifeq (0, $(shell test -e $(POCO_ODBC_LIBRARY)/libiodbc$(LIBLINKEXT); echo $$?))
SYSLIBS += -liodbc -liodbcinst
COMMONFLAGS += -DPOCO_IODBC -I/usr/include/iodbc
else
ifeq (0, $(shell test -h $(ODBCLIBDIR)/libiodbc$(LIBLINKEXT); echo $$?))
ifeq (0, $(shell test -h $(POCO_ODBC_LIBRARY)/libiodbc$(LIBLINKEXT); echo $$?))
SYSLIBS += -liodbc -liodbcinst -I/usr/include/iodbc
COMMONFLAGS += -DPOCO_IODBC
else
$(error No ODBC library found. Please install unixODBC or iODBC and try again)
ifndef (POCO_NO_ODBC)
$(warning No ODBC library found. Please install unixODBC or iODBC.)
endif
endif
endif
endif
Expand Down
5 changes: 4 additions & 1 deletion Foundation/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,11 @@ pcre_objects = pcre_chartables pcre_compile pcre_globals pcre_maketables \

pcre_utf8_objects = pcre_ucd pcre_tables

ifndef POCO_UNBUNDLED
$(warning POCO_NO_ODBC NOT defined)
endif

ifdef POCO_UNBUNDLED
objects += $(pcre_utf8_objects)
SYSLIBS += -lpcre -lz
else
objects += $(zlib_objects) $(pcre_objects) $(pcre_utf8_objects)
Expand Down
5 changes: 5 additions & 0 deletions Foundation/include/Poco/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,9 @@
// #define POCO_UTIL_NO_XMLCONFIGURATION


// No IPv6 support
// Define to disable IPv6
// #define POCO_NET_NO_IPv6


#endif // Foundation_Config_INCLUDED
27 changes: 15 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#

sinclude config.make
sinclude config.build

ifndef POCO_BASE
$(warning WARNING: POCO_BASE is not defined. Assuming current directory.)
Expand All @@ -24,7 +25,8 @@ ifeq ($(LINKMODE),BOTH)
SHAREDONLY='(' -name static -prune ')' -o
endif

.PHONY: all libexecs cppunit tests samples clean distclean install
# TESTS and SAMPLES are set by confgure script in config.make
poco: libexecs $(if $(TESTS),tests) $(if $(SAMPLES),samples)

all: libexecs tests samples

Expand Down Expand Up @@ -53,6 +55,7 @@ libexecs = Foundation-libexec XML-libexec JSON-libexec Util-libexec Net-libexec
tests = Foundation-tests XML-tests JSON-tests Util-tests Net-tests Crypto-tests NetSSL_OpenSSL-tests Data-tests Data/SQLite-tests Data/ODBC-tests Data/MySQL-tests Zip-tests PDF-tests CppParser-tests
samples = Foundation-samples XML-samples JSON-samples Util-samples Net-samples Crypto-samples NetSSL_OpenSSL-samples Data-samples Zip-samples PageCompiler-samples PDF-samples

.PHONY: poco all libexecs cppunit tests samples clean distclean install
.PHONY: $(libexecs)
.PHONY: $(tests)
.PHONY: $(samples)
Expand All @@ -66,7 +69,7 @@ Foundation-libexec:

Foundation-tests: Foundation-libexec cppunit
$(MAKE) -C $(POCO_BASE)/Foundation/testsuite

Foundation-samples: Foundation-libexec
$(MAKE) -C $(POCO_BASE)/Foundation/samples

Expand All @@ -75,7 +78,7 @@ XML-libexec: Foundation-libexec

XML-tests: XML-libexec cppunit
$(MAKE) -C $(POCO_BASE)/XML/testsuite

XML-samples: XML-libexec
$(MAKE) -C $(POCO_BASE)/XML/samples

Expand All @@ -84,7 +87,7 @@ JSON-libexec: Foundation-libexec

JSON-tests: JSON-libexec cppunit
$(MAKE) -C $(POCO_BASE)/JSON/testsuite

JSON-samples: JSON-libexec
$(MAKE) -C $(POCO_BASE)/JSON/samples

Expand All @@ -93,7 +96,7 @@ Util-libexec: Foundation-libexec XML-libexec

Util-tests: Util-libexec cppunit
$(MAKE) -C $(POCO_BASE)/Util/testsuite

Util-samples: Util-libexec
$(MAKE) -C $(POCO_BASE)/Util/samples

Expand All @@ -102,7 +105,7 @@ Net-libexec: Foundation-libexec

Net-tests: Net-libexec cppunit
$(MAKE) -C $(POCO_BASE)/Net/testsuite

Net-samples: Net-libexec Foundation-libexec XML-libexec Util-libexec
$(MAKE) -C $(POCO_BASE)/Net/samples

Expand All @@ -111,7 +114,7 @@ Crypto-libexec: Foundation-libexec

Crypto-tests: Crypto-libexec cppunit
$(MAKE) -C $(POCO_BASE)/Crypto/testsuite

Crypto-samples: Crypto-libexec Foundation-libexec Util-libexec
$(MAKE) -C $(POCO_BASE)/Crypto/samples

Expand All @@ -120,7 +123,7 @@ NetSSL_OpenSSL-libexec: Foundation-libexec Net-libexec Util-libexec Crypto-libe

NetSSL_OpenSSL-tests: NetSSL_OpenSSL-libexec cppunit
$(MAKE) -C $(POCO_BASE)/NetSSL_OpenSSL/testsuite

NetSSL_OpenSSL-samples: NetSSL_OpenSSL-libexec
$(MAKE) -C $(POCO_BASE)/NetSSL_OpenSSL/samples

Expand All @@ -129,7 +132,7 @@ Data-libexec: Foundation-libexec

Data-tests: Data-libexec cppunit
$(MAKE) -C $(POCO_BASE)/Data/testsuite

Data-samples: Data-libexec Data-libexec Data/SQLite-libexec
$(MAKE) -C $(POCO_BASE)/Data/samples

Expand All @@ -156,13 +159,13 @@ Zip-libexec: Foundation-libexec Net-libexec Util-libexec XML-libexec

Zip-tests: Zip-libexec cppunit
$(MAKE) -C $(POCO_BASE)/Zip/testsuite

Zip-samples: Zip-libexec
$(MAKE) -C $(POCO_BASE)/Zip/samples

PageCompiler-libexec: Net-libexec Util-libexec XML-libexec Foundation-libexec
$(MAKE) -C $(POCO_BASE)/PageCompiler

PageCompiler-samples: PageCompiler-libexec
$(MAKE) -C $(POCO_BASE)/PageCompiler/samples

Expand All @@ -174,7 +177,7 @@ PDF-libexec: Foundation-libexec

PDF-tests: PDF-libexec cppunit
$(MAKE) -C $(POCO_BASE)/PDF/testsuite

PDF-samples: PDF-libexec
$(MAKE) -C $(POCO_BASE)/PDF/samples

Expand Down
6 changes: 4 additions & 2 deletions Net/include/Poco/Net/IPAddress.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@ class Net_API IPAddress
enum Family
/// Possible address families for IP addresses.
{
IPv4,
IPv6
IPv4
#ifdef POCO_HAVE_IPv6
,IPv6
#endif
};

IPAddress();
Expand Down
9 changes: 6 additions & 3 deletions Net/include/Poco/Net/Net.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,13 @@ void Net_API uninitializeNetwork();
} } // namespace Poco::Net


// Define to enable IPv6 support
#if !defined (POCO_HAVE_IPv6)
// Default to enabled IPv6 support if not explicitly disabled
#if !defined(POCO_NET_NO_IPv6) && !defined (POCO_HAVE_IPv6)
#define POCO_HAVE_IPv6
#endif // POCO_HAVE_IPv6
#elif defined(POCO_NET_NO_IPv6) && defined (POCO_HAVE_IPv6)
#undef POCO_HAVE_IPv6
#endif // POCO_NET_NO_IPv6, POCO_HAVE_IPv6


#if !defined(s6_addr16)
#if defined(POCO_OS_FAMILY_WINDOWS)
Expand Down
9 changes: 7 additions & 2 deletions Net/src/NetworkInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,14 +280,15 @@ bool NetworkInterfaceImpl::supportsIPv4() const

bool NetworkInterfaceImpl::supportsIPv6() const
{
#ifdef POCO_HAVE_IPv6
AddressList::const_iterator it = _addressList.begin();
AddressList::const_iterator end = _addressList.end();
for (; it != end; ++it)
{
if (IPAddress::IPv6 == it->get<NetworkInterface::IP_ADDRESS>().family())
return true;
}

#endif
return false;
}

Expand Down Expand Up @@ -1241,7 +1242,11 @@ NetworkInterface::Map NetworkInterface::map(bool ipOnly, bool upOnly)
continue;
}

if (family == AF_INET || family == AF_INET6)
if (family == AF_INET
#ifdef POCO_HAVE_IPv6
|| family == AF_INET6
#endif
)
{
intf = NetworkInterface(std::string(currIface->ifa_name), address, subnetMask, broadcastAddress, ifIndex);
if ((upOnly && intf.isUp()) || !upOnly)
Expand Down
2 changes: 2 additions & 0 deletions Net/src/SocketAddress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,11 +358,13 @@ int SocketAddress::af() const
std::string SocketAddress::toString() const
{
std::string result;
#if defined(POCO_HAVE_IPv6)
if (host().family() == IPAddress::IPv6)
result.append("[");
result.append(host().toString());
if (host().family() == IPAddress::IPv6)
result.append("]");
#endif
result.append(":");
NumberFormatter::append(result, port());
return result;
Expand Down
13 changes: 6 additions & 7 deletions NetSSL_OpenSSL/src/SecureSocketImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,13 @@ void SecureSocketImpl::connect(const SocketAddress& address, const Poco::Timespa
poco_assert (!_pSSL);

_pSocket->connect(address, timeout);
Poco::Timespan receiveTimeout = _pSocket->getReceiveTimeout();
Poco::Timespan sendTimeout = _pSocket->getSendTimeout();
_pSocket->setReceiveTimeout(timeout);
_pSocket->setSendTimeout(timeout);
connectSSL(performHandshake);
_pSocket->setReceiveTimeout(receiveTimeout);
_pSocket->setSendTimeout(sendTimeout);
}


Expand All @@ -149,15 +155,8 @@ void SecureSocketImpl::connectNB(const SocketAddress& address)
if (_pSSL) reset();

poco_assert (!_pSSL);

_pSocket->connectNB(address);
Poco::Timespan receiveTimeout = _pSocket->getReceiveTimeout();
Poco::Timespan sendTimeout = _pSocket->getSendTimeout();
_pSocket->setReceiveTimeout(timeout);
_pSocket->setSendTimeout(timeout);
connectSSL(false);
_pSocket->setReceiveTimeout(receiveTimeout);
_pSocket->setSendTimeout(sendTimeout);
}


Expand Down
Loading

0 comments on commit 90a8e85

Please sign in to comment.