Skip to content

Instantly share code, notes, and snippets.

@msepcot
Last active September 21, 2015 19:34
Show Gist options
  • Save msepcot/b28e1fe836705d19f58e to your computer and use it in GitHub Desktop.
Save msepcot/b28e1fe836705d19f58e to your computer and use it in GitHub Desktop.
AppleTV and AppleTVSimulator config settings for poco.
#
# $Id: //poco/1.4/build/config/AppleTV#2 $
#
# AppleTV
#
# Build settings for tvOS, using Apple's tvOS SDK
#
#
# General Settings
#
# APPLETV OS does not allow dynamic linking to user libraries
#
LINKMODE ?= STATIC
#
# If the SDK is defined use it
# Otherwise find the latest version installed
#
# APPLETV_SDK_VERSION = 9.0
# if APPLETV_SDK_VERSION_MIN is defined use that
# Otherwise use the version found.
APPLETV_SDK ?= AppleTVOS
APPLETV_SDK_ROOT ?= /Applications/Xcode-beta.app/Contents/Developer/Platforms/$(APPLETV_SDK).platform/Developer/SDKs
APPLETV_SDK_ROOT_DIR = $(APPLETV_SDK_ROOT)/$(APPLETV_SDK)
APPLETV_SDK_BASE = $(shell ls -d $(APPLETV_SDK_ROOT_DIR)$(APPLETV_SDK_VERSION)*.sdk | tail -1)
APPLETV_SDK_VERSION_MIN ?= $(patsubst %.sdk,%,$(patsubst $(APPLETV_SDK_ROOT_DIR)%,%,$(APPLETV_SDK_BASE)))
POCO_TARGET_OSNAME ?= $(APPLETV_SDK)
POCO_TARGET_OSARCH ?= arm64
TOOL_PREFIX ?= /Applications/Xcode-beta.app/Contents/Developer/Platforms/$(APPLETV_SDK).platform/Developer/usr/bin
ifneq ($(POCO_TARGET_OSARCH),arm64)
THUMB = -mthumb
endif
OSFLAGS ?= -arch $(POCO_TARGET_OSARCH) -isysroot $(APPLETV_SDK_BASE) $(THUMB) -mtvos-version-min=$(APPLETV_SDK_VERSION_MIN) -fembed-bitcode -flto
#
# Tools
#
# If GCC_VER is defined then use it.
# Otherwise select the latest version
#
CC = /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
CXX = /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
LINK = $(CXX) -v -fembed-bitcode
LIB = libtool -v -static -o
RANLIB = ranlib
SHLIB = $(CXX) $(OSFLAGS) -dynamiclib -Wl,-install_name,$@ -o $@
DYLIB = $(CXX) $(OSFLAGS) -dynamic -bundle -read_only_relocs suppress -Wl -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
#
# System Specific Libraries
#
SYSLIBS = -ldl
#
# $Id: //poco/1.4/build/config/AppleTVSimulator#1 $
#
# AppleTVSimulator
#
# Build settings for AppleTV Simulator, using Apple's AppleTV SDK
#
APPLETV_SDK = AppleTVSimulator
POCO_TARGET_OSARCH = x86_64
OSFLAGS = -arch $(POCO_TARGET_OSARCH) -isysroot $(APPLETV_SDK_BASE) -mtvos-version-min=$(APPLETV_SDK_VERSION_MIN) -fembed-bitcode -flto
include $(POCO_BASE)/build/config/AppleTV
@msepcot
Copy link
Author

msepcot commented Sep 21, 2015

./configure --config=AppleTV --static --no-tests --no-samples --omit=Data/ODBC,Data/MySQL --include-path=/usr/local/opt/openssl/include

make -s -j4
In file included from src/Process.cpp:71:
src/Process_UNIX.cpp:167:12: error: call to unavailable function 'fork': not available on tvOS
        int pid = fork();
                  ^~~~
/Applications/Xcode-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk/usr/include/unistd.h:446:8: note: candidate function has been explicitly made unavailable
pid_t    fork(void) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
         ^
In file included from src/Process.cpp:71:
src/Process_UNIX.cpp:208:3: error: call to unavailable function 'execvp': not available on tvOS
                execvp(argv[0], &argv[0]);
                ^~~~~~
/Applications/Xcode-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk/usr/include/unistd.h:445:6: note: candidate function has been explicitly made unavailable
int      execvp(const char *, char * const *) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
         ^
2 errors generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment