update build configs - add support for Apple Silicon

This commit is contained in:
Günter Obiltschnig 2021-06-14 18:33:56 +02:00
parent ce781efd73
commit 0d621635b0
11 changed files with 28 additions and 147 deletions

View File

@ -1,7 +1,7 @@
# #
# Darwin # Darwin
# #
# Build settings for Mac OS X 10.9 (clang++, libc++, x86_64) # Build settings for Mac OS X 10.11 (clang++, libc++, x86_64)
# The build settings defined in this file are compatible # The build settings defined in this file are compatible
# with XCode C++ projects. # with XCode C++ projects.
# #

View File

@ -1,79 +1,10 @@
# #
# Darwin-clang # Darwin-clang
# #
# Build settings for Mac OS X 10.7 (clang, libstdc++, x86_64) # Build settings for Mac OS X 10.11 (clang, libstdc++, x86_64)
# #
# NOTE: This build configuration will build 64-bit binaries. # NOTE: This build configuration will build 64-bit binaries.
# Use the Darwin32-clang build configuration to build 32-bit binaries. # Use the Darwin32-clang build configuration to build 32-bit binaries.
# #
# include $(POCO_BASE)/build/config/Darwin-clang-libc++
# General Settings
#
LINKMODE ?= SHARED
POCO_TARGET_OSARCH ?= x86_64
POCO_HOST_OSARCH := $(POCO_TARGET_OSARCH)
ARCHFLAGS ?= -arch $(POCO_TARGET_OSARCH)
OSFLAGS ?= -mmacosx-version-min=10.7
OPENSSL_DIR ?= /usr/local/opt/openssl
ifeq ($(POCO_TARGET_OSARCH),i386)
RORELOCS = -read_only_relocs suppress
endif
#
# Tools
#
CC = $(shell xcrun -find clang)
CXX = $(shell xcrun -find clang++)
LINK = $(CXX) -bind_at_load
LIB = libtool -static -o
RANLIB = ranlib
SHLIB = $(CXX) -dynamiclib -Wl,-install_name,$(POCO_LIB_INSTALLDIR)/$(notdir \$@) -o $@
DYLIB = $(CXX) -dynamic -bundle $(RORELOCS) -Wl,-bind_at_load -o $@
SHLIBLN = $(POCO_BASE)/build/script/shlibln
STRIP =
DEP = $(POCO_BASE)/build/script/makedepend.clang
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 = $(ARCHFLAGS) $(OSFLAGS) -std=c99
CXXFLAGS = $(ARCHFLAGS) $(OSFLAGS) -std=c++03 -stdlib=libstdc++ -Wall -Wno-sign-compare -Wno-unused-variable -Wno-unused-function -Wno-unneeded-internal-declaration
LINKFLAGS = $(ARCHFLAGS) $(OSFLAGS) -stdlib=libstdc++
SHLIBFLAGS = $(ARCHFLAGS) $(OSFLAGS) -stdlib=libstdc++
DYLIBFLAGS = $(ARCHFLAGS) $(OSFLAGS) -stdlib=libstdc++
STATICOPT_CC =
STATICOPT_CXX =
STATICOPT_LINK =
SHAREDOPT_CC = -fPIC
SHAREDOPT_CXX = -fPIC
SHAREDOPT_LINK =
DEBUGOPT_CC = -O0 -g -gdwarf-2 -fasm-blocks -D_DEBUG=$(DEBUGLEVEL)
DEBUGOPT_CXX = -O0 -g -gdwarf-2 -fasm-blocks -D_DEBUG=$(DEBUGLEVEL)
DEBUGOPT_LINK =
RELEASEOPT_CC = -DNDEBUG -Os -fasm-blocks
RELEASEOPT_CXX = -DNDEBUG -O2 -fasm-blocks
RELEASEOPT_LINK =
#
# System Specific Flags
#
SYSFLAGS = -DPOCO_HAVE_IPv6 -DPOCO_NO_STAT64 -I$(OPENSSL_DIR)/include
#
# System Specific Libraries
#
SYSLIBS = -L$(OPENSSL_DIR)/lib -ldl

View File

@ -1,30 +1,21 @@
# #
# Darwin-clang-libc++ # Darwin-clang-libc++
# #
# Build settings for Mac OS X 10.9 (clang, libc++, x86_64) # Build settings for Mac OS X 10.11 and later (clang, libc++, x86_64/arm64)
# The build settings defined in this file are compatible # The build settings defined in this file are compatible
# with XCode C++ projects. # with XCode C++ projects.
# #
# NOTE: This build configuration will build 64-bit binaries.
# Use the Darwin32-clang-libc++ build configuration to build 32-bit binaries.
#
# #
# General Settings # General Settings
# #
LINKMODE ?= SHARED LINKMODE ?= SHARED
POCO_TARGET_OSARCH ?= x86_64 ARCHFLAGS ?= -arch $(OSARCH)
POCO_HOST_OSARCH := $(POCO_TARGET_OSARCH) OSFLAGS ?= -mmacosx-version-min=10.11 -isysroot $(shell xcrun --show-sdk-path)
ARCHFLAGS ?= -arch $(POCO_TARGET_OSARCH)
OSFLAGS ?= -mmacosx-version-min=10.9 -isysroot $(shell xcrun --show-sdk-path)
OPENSSL_DIR ?= /usr/local/opt/openssl OPENSSL_DIR ?= /usr/local/opt/openssl
ifeq ($(POCO_TARGET_OSARCH),i386)
RORELOCS = -read_only_relocs suppress
endif
# #
# Tools # Tools
# #

View File

@ -1,12 +0,0 @@
#
# Darwin32
#
# Build settings for Mac OS X 10.9 (clang, libc++, i386)
# The build settings defined in this file are compatible
# with XCode C++ projects.
#
ARCHFLAGS = -arch i386
POCO_TARGET_OSARCH = i386
include $(POCO_BASE)/build/config/Darwin-clang-libc++

View File

@ -1,10 +0,0 @@
#
# Darwin32-clang
#
# Build settings for Mac OS X 10.7 (clang, libstdc++, i386)
#
ARCHFLAGS = -arch i386
POCO_TARGET_OSARCH = i386
include $(POCO_BASE)/build/config/Darwin-clang

View File

@ -1,12 +0,0 @@
#
# Darwin32-clang-libc++
#
# Build settings for Mac OS X 10.9 (clang, libc++, i386)
# The build settings defined in this file are compatible
# with XCode C++ projects.
#
ARCHFLAGS = -arch i386
POCO_TARGET_OSARCH = i386
include $(POCO_BASE)/build/config/Darwin-clang-libc++

View File

@ -1,12 +1,9 @@
# #
# Darwin64 # Darwin64
# #
# Build settings for Mac OS X 10.9 (clang, libc++, x86_64) # Build settings for Mac OS X 10.11 and later (clang, libc++, x86_64/arm64)
# The build settings defined in this file are compatible # The build settings defined in this file are compatible
# with XCode C++ projects. # with XCode C++ projects.
# #
ARCHFLAGS = -arch x86_64
POCO_TARGET_OSARCH = x86_64
include $(POCO_BASE)/build/config/Darwin-clang-libc++ include $(POCO_BASE)/build/config/Darwin-clang-libc++

View File

@ -1,10 +1,9 @@
# #
# Darwin64-clang # Darwin64-clang
# #
# Build settings for Mac OS X 10.7 (clang, libstdc++, x86_64) # Build settings for Mac OS X 10.11 and later (clang, libc++, x86_64/arm64)
# The build settings defined in this file are compatible
# with XCode C++ projects.
# #
ARCHFLAGS = -arch x86_64
POCO_TARGET_OSARCH = x86_64
include $(POCO_BASE)/build/config/Darwin-clang include $(POCO_BASE)/build/config/Darwin-clang

View File

@ -1,12 +1,9 @@
# #
# Darwin64-clang-libc++ # Darwin64-clang-libc++
# #
# Build settings for Mac OS X 10.9 (clang, libc++, x86_64) # Build settings for Mac OS X 10.11 and later (clang, libc++, x86_64/arm64)
# The build settings defined in this file are compatible # The build settings defined in this file are compatible
# with XCode C++ projects. # with XCode C++ projects.
# #
ARCHFLAGS = -arch x86_64
POCO_TARGET_OSARCH = x86_64
include $(POCO_BASE)/build/config/Darwin-clang-libc++ include $(POCO_BASE)/build/config/Darwin-clang-libc++

View File

@ -39,7 +39,7 @@ SHAREDLIBLINKEXT = .so
CFLAGS = -std=c99 CFLAGS = -std=c99
CFLAGS32 = CFLAGS32 =
CFLAGS64 = CFLAGS64 =
CXXFLAGS = -Wall -Wno-sign-compare CXXFLAGS = -std=c++14 -Wall -Wno-sign-compare
CXXFLAGS32 = CXXFLAGS32 =
CXXFLAGS64 = CXXFLAGS64 =
LINKFLAGS = LINKFLAGS =

View File

@ -66,7 +66,7 @@ SHAREDLIBLINKEXT = .dylib
CFLAGS = $(OSFLAGS) -std=gnu99 CFLAGS = $(OSFLAGS) -std=gnu99
CFLAGS32 = CFLAGS32 =
CFLAGS64 = CFLAGS64 =
CXXFLAGS = $(OSFLAGS) -std=gnu++11 -stdlib=libc++ -Wall -Wno-sign-compare CXXFLAGS = $(OSFLAGS) -std=gnu++14 -stdlib=libc++ -Wall -Wno-sign-compare
CXXFLAGS32 = CXXFLAGS32 =
CXXFLAGS64 = CXXFLAGS64 =
LINKFLAGS = $(OSFLAGS) -stdlib=libc++ LINKFLAGS = $(OSFLAGS) -stdlib=libc++