Skip to content

Commit

Permalink
MACOSX: Add detection of target OS version in configure
Browse files Browse the repository at this point in the history
This is used for two purposes:
1. Use the new legacy icon when targeting 10.5 or older. This fixes
bug #11261 MAC OS X: App icon doesn’t display on OS X 10.5.8.

2. Do not attempt to compile the dock plugin in 32 bits when
targeting 10.14 or newer. This fixes the bundle target as support
for compiling 32 bits binaries was removed in SDK 10.14.

This commit also removes the bundle64 target as it is no longer
needed.
  • Loading branch information
criezy committed Mar 28, 2020
1 parent b91ca4a commit 9955f72
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 13 deletions.
32 changes: 32 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -2775,6 +2775,38 @@ case $_host_os in
fi
fi

# When building for MacOS X 10.5 we need to use the legacy icon
echocheck "macOS SDK target version at least 10.6"
_macos_atleast_10_6=no
cat > $TMPC << EOF
#include "AvailabilityMacros.h"
#if !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
error
#endif
int main(int argc, char *argv[]) { return 0; }
EOF
cc_check && _macos_atleast_10_6=yes
echo ${_macos_atleast_10_6}
if test "$_macos_atleast_10_6" = no ; then
add_line_to_config_mk 'MACOSX_USE_LEGACY_ICONS = 1'
fi

# When building with SDK 10.14 or above, we cannot compile the 32 bits dock plugin
echocheck "macOS SDK target version at least 10.14"
_macos_atleast_10_14=no
cat > $TMPC << EOF
#include "AvailabilityMacros.h"
#if !defined(MAC_OS_X_VERSION_10_14) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_14
error
#endif
int main(int argc, char *argv[]) { return 0; }
EOF
cc_check && _macos_atleast_10_14=yes
echo ${_macos_atleast_10_14}
if test "$_macos_atleast_10_14" = yes ; then
add_line_to_config_mk 'MACOSX_64_BITS_ONLY = 1'
fi

# Use pandoc to generate README and NEWS file for the bundle
# Also default to HTML rather than plain text as it gives a nicer
# formating, especially for the README. We could consider using RTF
Expand Down
Binary file added icons/scummvm_legacy.icns
Binary file not shown.
23 changes: 10 additions & 13 deletions ports.mk
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,13 @@ ScummVMDockTilePlugin64.o:
ScummVMDockTilePlugin64: ScummVMDockTilePlugin64.o
$(CXX) -mmacosx-version-min=10.6 -arch x86_64 -bundle -framework Foundation -framework AppKit -fobjc-link-runtime ScummVMDockTilePlugin64.o -o ScummVMDockTilePlugin64

ifdef MACOSX_64_BITS_ONLY
ScummVMDockTilePlugin: ScummVMDockTilePlugin64
cp ScummVMDockTilePlugin64 ScummVMDockTilePlugin
else
ScummVMDockTilePlugin: ScummVMDockTilePlugin32 ScummVMDockTilePlugin64
lipo -create ScummVMDockTilePlugin32 ScummVMDockTilePlugin64 -output ScummVMDockTilePlugin
endif

scummvm.docktileplugin: ScummVMDockTilePlugin
mkdir -p scummvm.docktileplugin/Contents
Expand All @@ -91,14 +96,6 @@ scummvm.docktileplugin: ScummVMDockTilePlugin
cp ScummVMDockTilePlugin scummvm.docktileplugin/Contents/MacOS/
chmod 644 scummvm.docktileplugin/Contents/MacOS/ScummVMDockTilePlugin

scummvm.docktileplugin64: ScummVMDockTilePlugin64
mkdir -p scummvm.docktileplugin/Contents
cp $(srcdir)/dists/macosx/dockplugin/Info.plist scummvm.docktileplugin/Contents
mkdir -p scummvm.docktileplugin/Contents/MacOS
mv ScummVMDockTilePlugin64 ScummVMDockTilePlugin
cp ScummVMDockTilePlugin scummvm.docktileplugin/Contents/MacOS/
chmod 644 scummvm.docktileplugin/Contents/MacOS/ScummVMDockTilePlugin

endif

bundle_name = ScummVM.app
Expand All @@ -114,7 +111,11 @@ ifdef USE_SPARKLE
rm -rf $(bundle_name)/Contents/Frameworks/Sparkle.framework
cp -R $(SPARKLEPATH)/Sparkle.framework $(bundle_name)/Contents/Frameworks/
endif
cp $(srcdir)/icons/scummvm.icns $(bundle_name)/Contents/Resources/
ifdef MACOSX_USE_LEGACY_ICONS
cp $(srcdir)/icons/scummvm_legacy.icns $(bundle_name)/Contents/Resources/scummvm.icns
else
cp $(srcdir)/icons/scummvm.icns $(bundle_name)/Contents/Resources/scummvm.icns
endif
cp $(DIST_FILES_DOCS) $(bundle_name)/Contents/Resources/
cp $(DIST_FILES_THEMES) $(bundle_name)/Contents/Resources/
ifdef DIST_FILES_NETWORKING
Expand Down Expand Up @@ -143,12 +144,8 @@ endif

ifdef USE_DOCKTILEPLUGIN
bundle: scummvm-static scummvm.docktileplugin bundle-pack

bundle64: scummvm-static scummvm.docktileplugin64 bundle-pack
else
bundle: scummvm-static bundle-pack

bundle64: scummvm-static bundle-pack
endif

iphonebundle: iphone
Expand Down

0 comments on commit 9955f72

Please sign in to comment.