Skip to content

Commit 90a8e85

Browse files
committed
- SF #3552774: Don't hide default target in subordinate makefile
- 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))
1 parent 06204c4 commit 90a8e85

13 files changed

Lines changed: 123 additions & 59 deletions

File tree

‎CHANGELOG‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ Release 1.5.0 (2012-08-??)
2929
- fixed SF# 3012166: IPv6 patch
3030
- added SF# 3558085: Add formatter to MACAddress object
3131
- fixed SF# 3535990: POCO_HAVE_IPv6 without POCO_WIN32_UTF8 conflict
32+
- fixed SF #3552774: Don't hide default target in subordinate makefile
33+
- fixed SF #3534307: Building IPv6 for Linux by default
34+
- fixed SF #3516844: poco missing symbols with external >=lipcre-8.13
3235

3336
Release 1.4.4 (2012-08-??)
3437
==========================

‎Data/ODBC/Makefile‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,14 @@
1414

1515
include $(POCO_BASE)/build/rules/global
1616

17-
# adjust for the target system (usually '/usr/lib' or '/usr/local/lib')
18-
ODBCLIBDIR = /usr/lib$(LIB64SUFFIX)
1917
ifeq ($(LINKMODE),STATIC)
2018
LIBLINKEXT = $(STATICLIBLINKEXT)
2119
else
2220
LIBLINKEXT = $(SHAREDLIBLINKEXT)
2321
endif
2422

25-
INCLUDE += -I/usr/local/include -I/usr/include -I/usr/include/odbc -I/usr/local/include/odbc
26-
SYSLIBS += -L/usr/lib$(LIB64SUFFIX) -L/usr/local/lib$(LIB64SUFFIX) -L/usr/lib$(LIB64SUFFIX)/odbc -L/usr/local/lib$(LIB64SUFFIX)/odbc
23+
INCLUDE += $(POCO_ODBC_INCLUDE)
24+
SYSLIBS += $(POCO_ODBC_LIBRARY)
2725

2826
ifeq ($(POCO_CONFIG),MinGW)
2927
# -DODBCVER=0x0300: SQLHandle declaration issue
@@ -36,23 +34,25 @@ CXXFLAGS += -DODBCVER=0x0300 -DNOMINMAX
3634
# CYGWIN platform has its own ODBC library in /lib/w32api
3735
SYSLIBS += -L/lib/w32api -lodbc32 -lodbccp32
3836
else
39-
ifeq (0, $(shell test -e $(ODBCLIBDIR)/libodbc$(LIBLINKEXT); echo $$?))
37+
ifeq (0, $(shell test -e $(POCO_ODBC_LIBRARY)/libodbc$(LIBLINKEXT); echo $$?))
4038
SYSLIBS += -lodbc -lodbcinst
4139
COMMONFLAGS += -DPOCO_UNIXODBC
4240
else
43-
ifeq (0, $(shell test -h $(ODBCLIBDIR)/libodbc$(LIBLINKEXT); echo $$?))
41+
ifeq (0, $(shell test -h $(POCO_ODBC_LIBRARY)/libodbc$(LIBLINKEXT); echo $$?))
4442
SYSLIBS += -lodbc -lodbcinst
4543
COMMONFLAGS += -DPOCO_UNIXODBC
4644
else
47-
ifeq (0, $(shell test -e $(ODBCLIBDIR)/libiodbc$(LIBLINKEXT); echo $$?))
45+
ifeq (0, $(shell test -e $(POCO_ODBC_LIBRARY)/libiodbc$(LIBLINKEXT); echo $$?))
4846
SYSLIBS += -liodbc -liodbcinst
4947
COMMONFLAGS += -DPOCO_IODBC -I/usr/include/iodbc
5048
else
51-
ifeq (0, $(shell test -h $(ODBCLIBDIR)/libiodbc$(LIBLINKEXT); echo $$?))
49+
ifeq (0, $(shell test -h $(POCO_ODBC_LIBRARY)/libiodbc$(LIBLINKEXT); echo $$?))
5250
SYSLIBS += -liodbc -liodbcinst -I/usr/include/iodbc
5351
COMMONFLAGS += -DPOCO_IODBC
5452
else
55-
$(error No ODBC library found. Please install unixODBC or iODBC and try again)
53+
ifndef (POCO_NO_ODBC)
54+
$(warning No ODBC library found. Please install unixODBC or iODBC.)
55+
endif
5656
endif
5757
endif
5858
endif

‎Data/ODBC/testsuite/Makefile‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,14 @@
1414

1515
include $(POCO_BASE)/build/rules/global
1616

17-
# adjust for the target system (usually '/usr/lib' or '/usr/local/lib')
18-
ODBCLIBDIR = /usr/lib$(LIB64SUFFIX)
1917
ifeq ($(LINKMODE),STATIC)
2018
LIBLINKEXT = $(STATICLIBLINKEXT)
2119
else
2220
LIBLINKEXT = $(SHAREDLIBLINKEXT)
2321
endif
2422

25-
INCLUDE += -I/usr/local/include -I/usr/include -I/usr/include/odbc -I/usr/local/include/odbc
26-
SYSLIBS += -L/usr/lib$(LIB64SUFFIX) -L/usr/local/lib$(LIB64SUFFIX) -L/usr/lib$(LIB64SUFFIX)/odbc -L/usr/local/lib$(LIB64SUFFIX)/odbc
23+
INCLUDE += $(POCO_ODBC_INCLUDE)
24+
SYSLIBS += $(POCO_ODBC_LIBRARY)
2725

2826
ifeq ($(POCO_CONFIG),MinGW)
2927
# -DODBCVER=0x0300: SQLHandle declaration issue
@@ -33,26 +31,28 @@ else ifeq ($(POCO_CONFIG),CYGWIN)
3331
# -DODBCVER=0x0300: SQLHandle declaration issue
3432
# -DNOMINMAX : MIN/MAX macros defined in windows conflict with libstdc++
3533
CXXFLAGS += -DODBCVER=0x0300 -DNOMINMAX
36-
# CYGWIN platform has its own ODBC library in /lib/w32api
34+
# CYGWIN platform has its own ODBC library in /lib/w32api
3735
SYSLIBS += -L/lib/w32api -lodbc32 -lodbccp32
3836
else
39-
ifeq (0, $(shell test -e $(ODBCLIBDIR)/libodbc$(LIBLINKEXT); echo $$?))
37+
ifeq (0, $(shell test -e $(POCO_ODBC_LIBRARY)/libodbc$(LIBLINKEXT); echo $$?))
4038
SYSLIBS += -lodbc -lodbcinst
4139
COMMONFLAGS += -DPOCO_UNIXODBC
4240
else
43-
ifeq (0, $(shell test -h $(ODBCLIBDIR)/libodbc$(LIBLINKEXT); echo $$?))
41+
ifeq (0, $(shell test -h $(POCO_ODBC_LIBRARY)/libodbc$(LIBLINKEXT); echo $$?))
4442
SYSLIBS += -lodbc -lodbcinst
4543
COMMONFLAGS += -DPOCO_UNIXODBC
4644
else
47-
ifeq (0, $(shell test -e $(ODBCLIBDIR)/libiodbc$(LIBLINKEXT); echo $$?))
45+
ifeq (0, $(shell test -e $(POCO_ODBC_LIBRARY)/libiodbc$(LIBLINKEXT); echo $$?))
4846
SYSLIBS += -liodbc -liodbcinst
4947
COMMONFLAGS += -DPOCO_IODBC -I/usr/include/iodbc
5048
else
51-
ifeq (0, $(shell test -h $(ODBCLIBDIR)/libiodbc$(LIBLINKEXT); echo $$?))
49+
ifeq (0, $(shell test -h $(POCO_ODBC_LIBRARY)/libiodbc$(LIBLINKEXT); echo $$?))
5250
SYSLIBS += -liodbc -liodbcinst -I/usr/include/iodbc
5351
COMMONFLAGS += -DPOCO_IODBC
5452
else
55-
$(error No ODBC library found. Please install unixODBC or iODBC and try again)
53+
ifndef (POCO_NO_ODBC)
54+
$(warning No ODBC library found. Please install unixODBC or iODBC.)
55+
endif
5656
endif
5757
endif
5858
endif

‎Foundation/Makefile‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,11 @@ pcre_objects = pcre_chartables pcre_compile pcre_globals pcre_maketables \
4343

4444
pcre_utf8_objects = pcre_ucd pcre_tables
4545

46+
ifndef POCO_UNBUNDLED
47+
$(warning POCO_NO_ODBC NOT defined)
48+
endif
49+
4650
ifdef POCO_UNBUNDLED
47-
objects += $(pcre_utf8_objects)
4851
SYSLIBS += -lpcre -lz
4952
else
5053
objects += $(zlib_objects) $(pcre_objects) $(pcre_utf8_objects)

‎Foundation/include/Poco/Config.h‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,9 @@
121121
// #define POCO_UTIL_NO_XMLCONFIGURATION
122122

123123

124+
// No IPv6 support
125+
// Define to disable IPv6
126+
// #define POCO_NET_NO_IPv6
127+
128+
124129
#endif // Foundation_Config_INCLUDED

‎Makefile‎

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#
66

77
sinclude config.make
8+
sinclude config.build
89

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

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

2931
all: libexecs tests samples
3032

@@ -53,6 +55,7 @@ libexecs = Foundation-libexec XML-libexec JSON-libexec Util-libexec Net-libexec
5355
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
5456
samples = Foundation-samples XML-samples JSON-samples Util-samples Net-samples Crypto-samples NetSSL_OpenSSL-samples Data-samples Zip-samples PageCompiler-samples PDF-samples
5557

58+
.PHONY: poco all libexecs cppunit tests samples clean distclean install
5659
.PHONY: $(libexecs)
5760
.PHONY: $(tests)
5861
.PHONY: $(samples)
@@ -66,7 +69,7 @@ Foundation-libexec:
6669

6770
Foundation-tests: Foundation-libexec cppunit
6871
$(MAKE) -C $(POCO_BASE)/Foundation/testsuite
69-
72+
7073
Foundation-samples: Foundation-libexec
7174
$(MAKE) -C $(POCO_BASE)/Foundation/samples
7275

@@ -75,7 +78,7 @@ XML-libexec: Foundation-libexec
7578

7679
XML-tests: XML-libexec cppunit
7780
$(MAKE) -C $(POCO_BASE)/XML/testsuite
78-
81+
7982
XML-samples: XML-libexec
8083
$(MAKE) -C $(POCO_BASE)/XML/samples
8184

@@ -84,7 +87,7 @@ JSON-libexec: Foundation-libexec
8487

8588
JSON-tests: JSON-libexec cppunit
8689
$(MAKE) -C $(POCO_BASE)/JSON/testsuite
87-
90+
8891
JSON-samples: JSON-libexec
8992
$(MAKE) -C $(POCO_BASE)/JSON/samples
9093

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

9497
Util-tests: Util-libexec cppunit
9598
$(MAKE) -C $(POCO_BASE)/Util/testsuite
96-
99+
97100
Util-samples: Util-libexec
98101
$(MAKE) -C $(POCO_BASE)/Util/samples
99102

@@ -102,7 +105,7 @@ Net-libexec: Foundation-libexec
102105

103106
Net-tests: Net-libexec cppunit
104107
$(MAKE) -C $(POCO_BASE)/Net/testsuite
105-
108+
106109
Net-samples: Net-libexec Foundation-libexec XML-libexec Util-libexec
107110
$(MAKE) -C $(POCO_BASE)/Net/samples
108111

@@ -111,7 +114,7 @@ Crypto-libexec: Foundation-libexec
111114

112115
Crypto-tests: Crypto-libexec cppunit
113116
$(MAKE) -C $(POCO_BASE)/Crypto/testsuite
114-
117+
115118
Crypto-samples: Crypto-libexec Foundation-libexec Util-libexec
116119
$(MAKE) -C $(POCO_BASE)/Crypto/samples
117120

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

121124
NetSSL_OpenSSL-tests: NetSSL_OpenSSL-libexec cppunit
122125
$(MAKE) -C $(POCO_BASE)/NetSSL_OpenSSL/testsuite
123-
126+
124127
NetSSL_OpenSSL-samples: NetSSL_OpenSSL-libexec
125128
$(MAKE) -C $(POCO_BASE)/NetSSL_OpenSSL/samples
126129

@@ -129,7 +132,7 @@ Data-libexec: Foundation-libexec
129132

130133
Data-tests: Data-libexec cppunit
131134
$(MAKE) -C $(POCO_BASE)/Data/testsuite
132-
135+
133136
Data-samples: Data-libexec Data-libexec Data/SQLite-libexec
134137
$(MAKE) -C $(POCO_BASE)/Data/samples
135138

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

157160
Zip-tests: Zip-libexec cppunit
158161
$(MAKE) -C $(POCO_BASE)/Zip/testsuite
159-
162+
160163
Zip-samples: Zip-libexec
161164
$(MAKE) -C $(POCO_BASE)/Zip/samples
162165

163166
PageCompiler-libexec: Net-libexec Util-libexec XML-libexec Foundation-libexec
164167
$(MAKE) -C $(POCO_BASE)/PageCompiler
165-
168+
166169
PageCompiler-samples: PageCompiler-libexec
167170
$(MAKE) -C $(POCO_BASE)/PageCompiler/samples
168171

@@ -174,7 +177,7 @@ PDF-libexec: Foundation-libexec
174177

175178
PDF-tests: PDF-libexec cppunit
176179
$(MAKE) -C $(POCO_BASE)/PDF/testsuite
177-
180+
178181
PDF-samples: PDF-libexec
179182
$(MAKE) -C $(POCO_BASE)/PDF/samples
180183

‎Net/include/Poco/Net/IPAddress.h‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,10 @@ class Net_API IPAddress
8080
enum Family
8181
/// Possible address families for IP addresses.
8282
{
83-
IPv4,
84-
IPv6
83+
IPv4
84+
#ifdef POCO_HAVE_IPv6
85+
,IPv6
86+
#endif
8587
};
8688

8789
IPAddress();

‎Net/include/Poco/Net/Net.h‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,13 @@ void Net_API uninitializeNetwork();
9696
} } // namespace Poco::Net
9797

9898

99-
// Define to enable IPv6 support
100-
#if !defined (POCO_HAVE_IPv6)
99+
// Default to enabled IPv6 support if not explicitly disabled
100+
#if !defined(POCO_NET_NO_IPv6) && !defined (POCO_HAVE_IPv6)
101101
#define POCO_HAVE_IPv6
102-
#endif // POCO_HAVE_IPv6
102+
#elif defined(POCO_NET_NO_IPv6) && defined (POCO_HAVE_IPv6)
103+
#undef POCO_HAVE_IPv6
104+
#endif // POCO_NET_NO_IPv6, POCO_HAVE_IPv6
105+
103106

104107
#if !defined(s6_addr16)
105108
#if defined(POCO_OS_FAMILY_WINDOWS)

‎Net/src/NetworkInterface.cpp‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,14 +280,15 @@ bool NetworkInterfaceImpl::supportsIPv4() const
280280

281281
bool NetworkInterfaceImpl::supportsIPv6() const
282282
{
283+
#ifdef POCO_HAVE_IPv6
283284
AddressList::const_iterator it = _addressList.begin();
284285
AddressList::const_iterator end = _addressList.end();
285286
for (; it != end; ++it)
286287
{
287288
if (IPAddress::IPv6 == it->get<NetworkInterface::IP_ADDRESS>().family())
288289
return true;
289290
}
290-
291+
#endif
291292
return false;
292293
}
293294

@@ -1241,7 +1242,11 @@ NetworkInterface::Map NetworkInterface::map(bool ipOnly, bool upOnly)
12411242
continue;
12421243
}
12431244

1244-
if (family == AF_INET || family == AF_INET6)
1245+
if (family == AF_INET
1246+
#ifdef POCO_HAVE_IPv6
1247+
|| family == AF_INET6
1248+
#endif
1249+
)
12451250
{
12461251
intf = NetworkInterface(std::string(currIface->ifa_name), address, subnetMask, broadcastAddress, ifIndex);
12471252
if ((upOnly && intf.isUp()) || !upOnly)

‎Net/src/SocketAddress.cpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,11 +358,13 @@ int SocketAddress::af() const
358358
std::string SocketAddress::toString() const
359359
{
360360
std::string result;
361+
#if defined(POCO_HAVE_IPv6)
361362
if (host().family() == IPAddress::IPv6)
362363
result.append("[");
363364
result.append(host().toString());
364365
if (host().family() == IPAddress::IPv6)
365366
result.append("]");
367+
#endif
366368
result.append(":");
367369
NumberFormatter::append(result, port());
368370
return result;

0 commit comments

Comments
 (0)