From d7c6dc62355e7170879c7bd435e5941e2f4eb554 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 1 Jul 2020 18:31:11 +0200 Subject: [PATCH 1/3] Default to building wxOSX, not wxiOS, under Apple ARM platforms Now that desktop Macs using ARM exist, we should default to building the normal, macOS-targeting, port on them and not wxiOS any more. This is a backwards incompatible change, but it shouldn't affect many people, so should hopefully be fine. --- configure | 12 +----------- configure.in | 12 ++---------- docs/changes.txt | 4 ++++ 3 files changed, 7 insertions(+), 21 deletions(-) diff --git a/configure b/configure index 56fe391b27..9625b7d470 100755 --- a/configure +++ b/configure @@ -4015,18 +4015,8 @@ case "${host}" in DEFAULT_DEFAULT_wxUSE_MSW=1 ;; - arm-apple-darwin*) - USE_BSD=1 - USE_DARWIN=1 - $as_echo "#define __BSD__ 1" >>confdefs.h - - $as_echo "#define __DARWIN__ 1" >>confdefs.h - - DEFAULT_DEFAULT_wxUSE_OSX_IPHONE=1 - ;; - *-*-darwin* ) - USE_BSD=1 + USE_BSD=1 USE_DARWIN=1 $as_echo "#define __BSD__ 1" >>confdefs.h diff --git a/configure.in b/configure.in index afbe54eacb..3add79588d 100644 --- a/configure.in +++ b/configure.in @@ -282,17 +282,9 @@ case "${host}" in DEFAULT_DEFAULT_wxUSE_MSW=1 ;; - arm-apple-darwin*) - dnl iPhone - USE_BSD=1 - USE_DARWIN=1 - AC_DEFINE(__BSD__) - AC_DEFINE(__DARWIN__) - DEFAULT_DEFAULT_wxUSE_OSX_IPHONE=1 - ;; - *-*-darwin* ) - dnl Darwin based distributions (including Mac OS X) + dnl Some platform using Darwin, i.e. one of the Apple OS: we target macOS + dnl by default on them, use --with-osx_iphone explicitly for iOS. USE_BSD=1 USE_DARWIN=1 AC_DEFINE(__BSD__) diff --git a/docs/changes.txt b/docs/changes.txt index 91e460d770..6bdb254eb6 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -189,6 +189,10 @@ INCOMPATIBLE CHANGES SINCE 3.1.3: aliases for the libraries have been added using the 'wx::' namespace. For example, the core library is now named wxcore and has alias wx::core. +- Building on ARM Apple platforms using configure now targets macOS by + default, and not iOS. Please use --with-osx_iphone explicitly if you need + the latter. + 3.1.3: (released 2019-10-28) ---------------------------- From 103daf60d43495be5ac3738ead4c1c673c870aab Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 1 Jul 2020 18:45:11 +0200 Subject: [PATCH 2/3] Don't remove multiple -arch flags from configure flags neither The changes of 273e2e7343 (Remove duplicated flags from {C,CPP,CXX,LD}FLAGS in configure, 2020-02-12) took care to leave multiple -framework flags in LDFLAGS because removing them would be wrong, but we also need to avoid removing -arch flags, that can possibly appear multiple times (when using universal binaries) as well. Change dedup_flags() itself to keep a list of exceptions to pass through without checking that they're unique. If this list becomes longer in the future, we could use an array and use "$0 in array" instead of multiple "==" checks, but for now keep things simple. --- configure | 6 ++---- configure.in | 12 +++++------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/configure b/configure index 9625b7d470..501e726ab3 100755 --- a/configure +++ b/configure @@ -40295,14 +40295,12 @@ case "${host}" in ;; esac -dedup_flags () { printf %s "$@" | awk -v RS=' +' -v ORS=' ' '!seen[$0]++'; } +dedup_flags () { printf %s "$@" | awk -v RS=' +' -v ORS=' ' '$0=="-arch" || $0=="-framework" || !seen[$0]++'; } WX_CPPFLAGS=`dedup_flags "$CPPFLAGS"` WX_CFLAGS=`dedup_flags "$CFLAGS"` WX_CXXFLAGS=`dedup_flags "$CXXFLAGS"` - -LDFLAGS=`printf %s "$LDFLAGS" | sed 's/-framework */-framework_/g'` -WX_LDFLAGS=`dedup_flags "$LDFLAGS" | sed 's/-framework_/-framework /g'` +WX_LDFLAGS=`dedup_flags "$LDFLAGS"` CPPFLAGS=$USER_CPPFLAGS CFLAGS=$USER_CFLAGS diff --git a/configure.in b/configure.in index 3add79588d..196b3b61d9 100644 --- a/configure.in +++ b/configure.in @@ -8249,17 +8249,15 @@ dnl Set the flags to be used for the library build itself using the flag names dnl used everywhere above. dnl dnl Also get rid of duplicates in the flags, which results in dramatically -dnl shorter build logs and so is well worth it. -dedup_flags () { printf %s "$@" | awk -v RS=' +' -v ORS=' ' '!seen[[$0]]++'; } +dnl shorter build logs and so is well worth it (but preserve some special +dnl flags which are explicitly allowed to occur multiple times, as all their +dnl occurrences must be preserved). +dedup_flags () { printf %s "$@" | awk -v RS=' +' -v ORS=' ' '$0=="-arch" || $0=="-framework" || !seen[[$0]]++'; } WX_CPPFLAGS=`dedup_flags "$CPPFLAGS"` WX_CFLAGS=`dedup_flags "$CFLAGS"` WX_CXXFLAGS=`dedup_flags "$CXXFLAGS"` - -dnl For link flags we can use "-framework" multiple times and all of their -dnl occurrences need to be preserved, so add extra pre/post-processing. -LDFLAGS=`printf %s "$LDFLAGS" | sed 's/-framework */-framework_/g'` -WX_LDFLAGS=`dedup_flags "$LDFLAGS" | sed 's/-framework_/-framework /g'` +WX_LDFLAGS=`dedup_flags "$LDFLAGS"` dnl Restore the original user-specified flags values, we won't run any tests dnl using them any more. From d91d97dfa9cb319200698525d0d7a84c6f77253c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 1 Jul 2020 22:39:13 +0200 Subject: [PATCH 3/3] Update Catch submodule to use correct ARM break instruction This is required for unit tests under macOS on ARM. --- 3rdparty/catch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3rdparty/catch b/3rdparty/catch index b46f260f81..ee4acb6ae6 160000 --- a/3rdparty/catch +++ b/3rdparty/catch @@ -1 +1 @@ -Subproject commit b46f260f810bb693825c026269636e82b0a50722 +Subproject commit ee4acb6ae6e32a02bc012d197aa82b1ca7a493ab