tvOS support

This commit is contained in:
Guenter Obiltschnig
2015-09-29 14:25:54 +02:00
parent 06ab1e9820
commit 5184a8526f
3 changed files with 115 additions and 0 deletions

View File

@@ -150,6 +150,7 @@ ProcessHandleImpl* ProcessImpl::launchImpl(const std::string& command, const Arg
ProcessHandleImpl* ProcessImpl::launchByForkExecImpl(const std::string& command, const ArgsImpl& args, const std::string& initialDirectory, Pipe* inPipe, Pipe* outPipe, Pipe* errPipe, const EnvImpl& env) ProcessHandleImpl* ProcessImpl::launchByForkExecImpl(const std::string& command, const ArgsImpl& args, const std::string& initialDirectory, Pipe* inPipe, Pipe* outPipe, Pipe* errPipe, const EnvImpl& env)
{ {
#if !defined(POCO_NO_FORK_EXEC)
// We must not allocated memory after fork(), // We must not allocated memory after fork(),
// therefore allocate all required buffers first. // therefore allocate all required buffers first.
std::vector<char> envChars = getEnvironmentVariablesBuffer(env); std::vector<char> envChars = getEnvironmentVariablesBuffer(env);
@@ -213,6 +214,9 @@ ProcessHandleImpl* ProcessImpl::launchByForkExecImpl(const std::string& command,
if (outPipe) outPipe->close(Pipe::CLOSE_WRITE); if (outPipe) outPipe->close(Pipe::CLOSE_WRITE);
if (errPipe) errPipe->close(Pipe::CLOSE_WRITE); if (errPipe) errPipe->close(Pipe::CLOSE_WRITE);
return new ProcessHandleImpl(pid); return new ProcessHandleImpl(pid);
#else
throw Poco::NotImplementedException("platform does not allow fork/exec");
#endif
} }

98
build/config/AppleTV Normal file
View File

@@ -0,0 +1,98 @@
#
# $Id$
#
# AppleTV
#
# Build settings for tvOS 9.0 and newer
#
#
# General Settings
#
# tvOS does not allow dynamic linking to user libraries
#
LINKMODE ?= STATIC
#
# If the SDK is defined use it
# Otherwise find the latest version installed
#
# TVOS_SDK_VERSION = 9.0
# if TVOS_SDK_VERSION_MIN is defined use that
# Otherwise use the version found.
TVOS_SDK ?= AppleTVOS
TVOS_SDK_ROOT ?= $(shell xcode-select -print-path)/Platforms/$(TVOS_SDK).platform/Developer/SDKs
TVOS_SDK_ROOT_DIR = $(TVOS_SDK_ROOT)/$(TVOS_SDK)
TVOS_SDK_BASE = $(shell ls -d $(TVOS_SDK_ROOT_DIR)$(TVOS_SDK_VERSION)*.sdk | tail -1)
TVOS_SDK_VERSION_MIN ?= $(patsubst %.sdk,%,$(patsubst $(TVOS_SDK_ROOT_DIR)%,%,$(TVOS_SDK_BASE)))
POCO_TARGET_OSNAME ?= $(TVOS_SDK)
POCO_TARGET_OSARCH ?= arm64
TOOL_PREFIX ?= $(shell xcode-select -print-path)/Platforms/$(TVOS_SDK).platform/Developer/usr/bin
OSFLAGS ?= -arch $(POCO_TARGET_OSARCH) -isysroot $(TVOS_SDK_BASE) -mtvos-version-min=$(TVOS_SDK_VERSION_MIN)
#
# Tools
#
# If GCC_VER is defined then use it.
# Otherwise select the latest version
#
CC = $(shell xcrun -find clang)
CXX = $(shell xcrun -find clang++)
LINK = $(CXX) -bind_at_load
LIB = libtool -static -o
RANLIB = ranlib
SHLIB = $(CXX) $(OSFLAGS) -dynamiclib -Wl,-install_name,$@ -o $@
DYLIB = $(CXX) $(OSFLAGS) -dynamic -bundle -read_only_relocs suppress -Wl,-bind_at_load -o $@
SHLIBLN = $(POCO_BASE)/build/script/shlibln
STRIP =
DEP = $(POCO_BASE)/build/script/makedepend.gcc
SHELL = sh
RM = rm -rf
CP = cp
MKDIR = mkdir -p
#
# Extension for Shared Libraries
#
SHAREDLIBEXT = .$(target_version).dylib
SHAREDLIBLINKEXT = .dylib
#
# Compiler and Linker Flags
#
CFLAGS = $(OSFLAGS)
CFLAGS32 =
CFLAGS64 =
CXXFLAGS = $(OSFLAGS) -std=c++11 -stdlib=libc++ -Wall -Wno-sign-compare
CXXFLAGS32 =
CXXFLAGS64 =
LINKFLAGS = $(OSFLAGS) -stdlib=libc++
LINKFLAGS32 =
LINKFLAGS64 =
STATICOPT_CC =
STATICOPT_CXX =
STATICOPT_LINK =
SHAREDOPT_CC = -fPIC
SHAREDOPT_CXX = -fPIC
SHAREDOPT_LINK =
DEBUGOPT_CC = -g -D_DEBUG=$(DEBUGLEVEL)
DEBUGOPT_CXX = -g -D_DEBUG=$(DEBUGLEVEL)
DEBUGOPT_LINK =
RELEASEOPT_CC = -DNDEBUG -O2
RELEASEOPT_CXX = -DNDEBUG -O
RELEASEOPT_LINK =
#
# System Specific Flags
#
SYSFLAGS = -DPOCO_HAVE_IPv6 -DPOCO_NO_FPENVIRONMENT -DPOCO_NO_STAT64 -DPOCO_NO_SHAREDLIBS -DPOCO_NO_NET_IFTYPES -DPOCO_NO_FORK_EXEC
#
# System Specific Libraries
#
SYSLIBS = -ldl

View File

@@ -0,0 +1,13 @@
#
# $Id$
#
# AppleTVSimulator
#
# Build settings for tvOS 9.0 Simulator
#
TVOS_SDK = AppleTVSimulator
POCO_TARGET_OSARCH = x86_64
OSFLAGS = -arch $(POCO_TARGET_OSARCH) -isysroot $(TVOS_SDK_BASE) -mtvos-version-min=$(TVOS_SDK_VERSION_MIN)
include $(POCO_BASE)/build/config/AppleTV