mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-17 11:05:03 +02:00
FreeBSD build and threading
This commit is contained in:
@@ -8,9 +8,12 @@
|
|||||||
|
|
||||||
include $(POCO_BASE)/build/rules/global
|
include $(POCO_BASE)/build/rules/global
|
||||||
|
|
||||||
# Note: linking order is important, do not change it.
|
# Note: linking order is important, do not change it.
|
||||||
|
ifeq ($(POCO_CONFIG),FreeBSD)
|
||||||
|
SYSLIBS += -lssl -lcrypto -lz
|
||||||
|
else
|
||||||
SYSLIBS += -lssl -lcrypto -lz -ldl
|
SYSLIBS += -lssl -lcrypto -lz -ldl
|
||||||
|
endif
|
||||||
objects = genrsakey
|
objects = genrsakey
|
||||||
|
|
||||||
target = genrsakey
|
target = genrsakey
|
||||||
|
@@ -160,7 +160,7 @@ void ThreadImpl::setStackSizeImpl(int size)
|
|||||||
#else
|
#else
|
||||||
if (size != 0)
|
if (size != 0)
|
||||||
{
|
{
|
||||||
#if defined(__APPLE__)
|
#if defined(POCO_OS_FAMILY_BSD)
|
||||||
// we must round up to a multiple of the memory page size
|
// we must round up to a multiple of the memory page size
|
||||||
const int PAGE_SIZE = 4096;
|
const int PAGE_SIZE = 4096;
|
||||||
size = ((size + PAGE_SIZE - 1)/PAGE_SIZE)*PAGE_SIZE;
|
size = ((size + PAGE_SIZE - 1)/PAGE_SIZE)*PAGE_SIZE;
|
||||||
|
@@ -56,9 +56,6 @@ ThreadPoolTest::~ThreadPoolTest()
|
|||||||
|
|
||||||
void ThreadPoolTest::testThreadPool()
|
void ThreadPoolTest::testThreadPool()
|
||||||
{
|
{
|
||||||
#if (POCO_OS == POCO_OS_FREE_BSD)
|
|
||||||
fail ("TODO! - segfaults on FreeBSD");
|
|
||||||
#else
|
|
||||||
ThreadPool pool(2, 3, 3);
|
ThreadPool pool(2, 3, 3);
|
||||||
pool.setStackSize(1);
|
pool.setStackSize(1);
|
||||||
|
|
||||||
@@ -150,7 +147,6 @@ void ThreadPoolTest::testThreadPool()
|
|||||||
assert (pool.used() == 0);
|
assert (pool.used() == 0);
|
||||||
assert (pool.capacity() == 4);
|
assert (pool.capacity() == 4);
|
||||||
assert (pool.available() == 4);
|
assert (pool.available() == 4);
|
||||||
#endif // POCO_OS_FREE_BSD
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -39,7 +39,7 @@
|
|||||||
#include "Poco/Event.h"
|
#include "Poco/Event.h"
|
||||||
#include "Poco/Timestamp.h"
|
#include "Poco/Timestamp.h"
|
||||||
#include "Poco/Timespan.h"
|
#include "Poco/Timespan.h"
|
||||||
#include <iostream>
|
//#include <iostream>
|
||||||
#if defined(__sun) && defined(__SVR4) && !defined(__EXTENSIONS__)
|
#if defined(__sun) && defined(__SVR4) && !defined(__EXTENSIONS__)
|
||||||
#define __EXTENSIONS__
|
#define __EXTENSIONS__
|
||||||
#endif
|
#endif
|
||||||
@@ -273,6 +273,7 @@ void ThreadTest::testThreadStackSize()
|
|||||||
int stackSize = 50000000;
|
int stackSize = 50000000;
|
||||||
|
|
||||||
Thread thread;
|
Thread thread;
|
||||||
|
|
||||||
assert (0 == thread.getStackSize());
|
assert (0 == thread.getStackSize());
|
||||||
thread.setStackSize(stackSize);
|
thread.setStackSize(stackSize);
|
||||||
assert (stackSize <= thread.getStackSize());
|
assert (stackSize <= thread.getStackSize());
|
||||||
@@ -283,21 +284,21 @@ void ThreadTest::testThreadStackSize()
|
|||||||
|
|
||||||
stackSize = 1;
|
stackSize = 1;
|
||||||
thread.setStackSize(stackSize);
|
thread.setStackSize(stackSize);
|
||||||
#ifdef PTHREAD_STACK_MIN
|
|
||||||
assert (PTHREAD_STACK_MIN == thread.getStackSize());
|
#if !defined(POCO_OS_FAMILY_BSD) // on BSD family, stack size is rounded
|
||||||
#else
|
#ifdef PTHREAD_STACK_MIN
|
||||||
assert (stackSize >= thread.getStackSize());
|
assert (PTHREAD_STACK_MIN == thread.getStackSize());
|
||||||
|
#else
|
||||||
|
assert (stackSize >= thread.getStackSize());
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
tmp = MyRunnable::_staticVar;
|
tmp = MyRunnable::_staticVar;
|
||||||
#if POCO_OS == POCO_OS_FREE_BSD
|
|
||||||
fail ("FreeBSD segfaults - TODO!");
|
|
||||||
#else
|
|
||||||
thread.start(freeFunc, &tmp);
|
thread.start(freeFunc, &tmp);
|
||||||
thread.join();
|
thread.join();
|
||||||
assert (tmp * 2 == MyRunnable::_staticVar);
|
assert (tmp * 2 == MyRunnable::_staticVar);
|
||||||
#endif
|
|
||||||
thread.setStackSize(0);
|
|
||||||
|
|
||||||
|
thread.setStackSize(0);
|
||||||
assert (0 == thread.getStackSize());
|
assert (0 == thread.getStackSize());
|
||||||
tmp = MyRunnable::_staticVar;
|
tmp = MyRunnable::_staticVar;
|
||||||
thread.start(freeFunc, &tmp);
|
thread.start(freeFunc, &tmp);
|
||||||
|
@@ -96,9 +96,6 @@ void DatagramSocketTest::testSendToReceiveFrom()
|
|||||||
|
|
||||||
void DatagramSocketTest::testBroadcast()
|
void DatagramSocketTest::testBroadcast()
|
||||||
{
|
{
|
||||||
#if (POCO_OS == POCO_OS_FREE_BSD)
|
|
||||||
fail ("TODO! hangs on FreeBSD");
|
|
||||||
#else
|
|
||||||
UDPEchoServer echoServer;
|
UDPEchoServer echoServer;
|
||||||
DatagramSocket ss(IPAddress::IPv4);
|
DatagramSocket ss(IPAddress::IPv4);
|
||||||
SocketAddress sa("255.255.255.255", echoServer.port());
|
SocketAddress sa("255.255.255.255", echoServer.port());
|
||||||
@@ -119,7 +116,6 @@ void DatagramSocketTest::testBroadcast()
|
|||||||
assert (n == 5);
|
assert (n == 5);
|
||||||
assert (std::string(buffer, n) == "hello");
|
assert (std::string(buffer, n) == "hello");
|
||||||
ss.close();
|
ss.close();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -9,7 +9,11 @@
|
|||||||
include $(POCO_BASE)/build/rules/global
|
include $(POCO_BASE)/build/rules/global
|
||||||
|
|
||||||
# Note: linking order is important, do not change it.
|
# Note: linking order is important, do not change it.
|
||||||
|
ifeq ($(POCO_CONFIG),FreeBSD)
|
||||||
|
SYSLIBS += -lssl -lcrypto -lz
|
||||||
|
else
|
||||||
SYSLIBS += -lssl -lcrypto -lz -ldl
|
SYSLIBS += -lssl -lcrypto -lz -ldl
|
||||||
|
endif
|
||||||
|
|
||||||
objects = HTTPSTimeServer
|
objects = HTTPSTimeServer
|
||||||
|
|
||||||
|
@@ -9,7 +9,11 @@
|
|||||||
include $(POCO_BASE)/build/rules/global
|
include $(POCO_BASE)/build/rules/global
|
||||||
|
|
||||||
# Note: linking order is important, do not change it.
|
# Note: linking order is important, do not change it.
|
||||||
|
ifeq ($(POCO_CONFIG),FreeBSD)
|
||||||
|
SYSLIBS += -lssl -lcrypto -lz
|
||||||
|
else
|
||||||
SYSLIBS += -lssl -lcrypto -lz -ldl
|
SYSLIBS += -lssl -lcrypto -lz -ldl
|
||||||
|
endif
|
||||||
|
|
||||||
objects = Mail
|
objects = Mail
|
||||||
|
|
||||||
|
@@ -9,7 +9,11 @@
|
|||||||
include $(POCO_BASE)/build/rules/global
|
include $(POCO_BASE)/build/rules/global
|
||||||
|
|
||||||
# Note: linking order is important, do not change it.
|
# Note: linking order is important, do not change it.
|
||||||
|
ifeq ($(POCO_CONFIG),FreeBSD)
|
||||||
|
SYSLIBS += -lssl -lcrypto -lz
|
||||||
|
else
|
||||||
SYSLIBS += -lssl -lcrypto -lz -ldl
|
SYSLIBS += -lssl -lcrypto -lz -ldl
|
||||||
|
endif
|
||||||
|
|
||||||
objects = download
|
objects = download
|
||||||
|
|
||||||
|
@@ -54,10 +54,10 @@ export POCO_BUILD
|
|||||||
cwd = $(shell pwd)
|
cwd = $(shell pwd)
|
||||||
inpoco = $(shell echo | awk '{print index("$(cwd)","$(POCO_BASE)")}')
|
inpoco = $(shell echo | awk '{print index("$(cwd)","$(POCO_BASE)")}')
|
||||||
inproj = $(shell echo | awk '{print index("$(cwd)","$(PROJECT_BASE)")}')
|
inproj = $(shell echo | awk '{print index("$(cwd)","$(PROJECT_BASE)")}')
|
||||||
ifeq ($(inpoco),1)
|
ifneq ($(inpoco),0)
|
||||||
PROJECT_BASE = $(POCO_BASE)
|
PROJECT_BASE = $(POCO_BASE)
|
||||||
else
|
else
|
||||||
ifeq ($(inproj),1)
|
ifneq ($(inproj),0)
|
||||||
else
|
else
|
||||||
$(error Current working directory not under $$PROJECT_BASE)
|
$(error Current working directory not under $$PROJECT_BASE)
|
||||||
endif
|
endif
|
||||||
|
Reference in New Issue
Block a user