* use xcode-select to find correct paths for iOS build

* add iOS definitions for CMake
* ServerApplication on Android must use events instead of signals to wait for server termination.
This commit is contained in:
Rangel Reale
2012-11-11 11:59:36 -02:00
parent c867a80520
commit 141a2c152c
4 changed files with 15 additions and 3 deletions

View File

@@ -143,6 +143,11 @@ if (${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro")
add_definitions( -D_BSD_SOURCE -library=stlport4) add_definitions( -D_BSD_SOURCE -library=stlport4)
endif (${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro") endif (${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro")
# iOS
if (IOS)
add_definitions( -DPOCO_HAVE_IPv6 -DPOCO_NO_FPENVIRONMENT -DPOCO_NO_STAT64 -DPOCO_NO_SHAREDLIBS -DPOCO_NO_NET_IFTYPES )
endif(IOS)
IF (ENABLE_TESTS) IF (ENABLE_TESTS)
add_subdirectory(CppUnit) add_subdirectory(CppUnit)
ENDIF () ENDIF ()

View File

@@ -196,6 +196,9 @@ private:
void handlePidFile(const std::string& name, const std::string& value); void handlePidFile(const std::string& name, const std::string& value);
bool isDaemon(int argc, char** argv); bool isDaemon(int argc, char** argv);
void beDaemon(); void beDaemon();
#if defined(POCO_ANDROID)
static Poco::Event _terminate;
#endif
#elif defined(POCO_OS_FAMILY_WINDOWS) #elif defined(POCO_OS_FAMILY_WINDOWS)
#if !defined(_WIN32_WCE) #if !defined(_WIN32_WCE)
enum Action enum Action

View File

@@ -84,7 +84,7 @@ SERVICE_STATUS ServerApplication::_serviceStatus;
SERVICE_STATUS_HANDLE ServerApplication::_serviceStatusHandle = 0; SERVICE_STATUS_HANDLE ServerApplication::_serviceStatusHandle = 0;
#endif #endif
#endif #endif
#if defined(POCO_VXWORKS) #if defined(POCO_VXWORKS) || defined(POCO_ANDROID)
Poco::Event ServerApplication::_terminate; Poco::Event ServerApplication::_terminate;
#endif #endif
@@ -122,7 +122,7 @@ void ServerApplication::terminate()
{ {
#if defined(POCO_OS_FAMILY_WINDOWS) #if defined(POCO_OS_FAMILY_WINDOWS)
_terminate.set(); _terminate.set();
#elif defined(POCO_VXWORKS) #elif defined(POCO_VXWORKS) || defined(POCO_ANDROID)
_terminate.set(); _terminate.set();
#else #else
Poco::Process::requestTermination(Process::id()); Poco::Process::requestTermination(Process::id());
@@ -590,6 +590,7 @@ void ServerApplication::defineOptions(OptionSet& options)
// //
void ServerApplication::waitForTerminationRequest() void ServerApplication::waitForTerminationRequest()
{ {
#ifndef POCO_ANDROID
sigset_t sset; sigset_t sset;
sigemptyset(&sset); sigemptyset(&sset);
if (!std::getenv("POCO_ENABLE_DEBUGGER")) if (!std::getenv("POCO_ENABLE_DEBUGGER"))
@@ -601,6 +602,9 @@ void ServerApplication::waitForTerminationRequest()
sigprocmask(SIG_BLOCK, &sset, NULL); sigprocmask(SIG_BLOCK, &sset, NULL);
int sig; int sig;
sigwait(&sset, &sig); sigwait(&sset, &sig);
#else // POCO_ANDROID
_terminate.wait();
#endif
} }

View File

@@ -30,7 +30,7 @@ IPHONE_SDK_VERSION_MIN ?= $(patsubst %.sdk,%,$(patsubst $(IPHONE_SDK_ROOT_DIR)%,
POCO_TARGET_OSNAME ?= $(IPHONE_SDK) POCO_TARGET_OSNAME ?= $(IPHONE_SDK)
POCO_TARGET_OSARCH ?= armv6 POCO_TARGET_OSARCH ?= armv6
TOOL_PREFIX ?= /Developer/Platforms/$(IPHONE_SDK).platform/Developer/usr/bin TOOL_PREFIX ?= $(shell xcode-select -print-path)/Platforms/$(IPHONE_SDK).platform/Developer/usr/bin
OSFLAGS ?= -arch $(POCO_TARGET_OSARCH) -isysroot $(IPHONE_SDK_BASE) -mthumb -miphoneos-version-min=$(IPHONE_SDK_VERSION_MIN) OSFLAGS ?= -arch $(POCO_TARGET_OSARCH) -isysroot $(IPHONE_SDK_BASE) -mthumb -miphoneos-version-min=$(IPHONE_SDK_VERSION_MIN)
# #