-----------------------------------------------------------------------------
macOS builds require that Xcode command line tools and Homebrew be installed:
-----------------------------------------------------------------------------

#
# Install Xcode from the app store, and make sure Xcode CLI tools
# are installed and licenses agreed.
#

xcode-select --install
sudo xcodebuild -license accept

#
# Install Homebrew if not already installed, see https://brew.sh but if you are lazy:
#

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

#
# Optional - if you want to build vice.pdf or binary distributions
#

brew cask install basictex


-------------------------
Configure without OpenGL:
-------------------------

brew install autoconf automake pkg-config texinfo xa lame
brew install gtk+3 librsvg adwaita-icon-theme

source /etc/profile
./autogen.sh
./configure --enable-native-gtk3ui --disable-hwscale

#
# Continue with 'Build' section below
#


----------------------
Configure with OpenGL:
----------------------

#
# You can choose to build with OpenGL support, although as at Gtk 3.24.8, the
# Gtk3 macOS OpenGL support "is still very much unstable and experimental; it
# has only recently been added, and requires more debugging from somebody who
# is familiar with both GL and Darwin/CoreGraphics."
#
# In practice this means that whilst scaling is hardware accelerated, the result
# is pulled back to the system memory and then re-rendered using old 2D API which
# is slow AF, possibly slower than software scaling on some systems.
#

brew install autoconf automake pkg-config texinfo xa lame
brew install gtk+3 librsvg adwaita-icon-theme glew

source /etc/profile
./autogen.sh
./configure --enable-native-gtk3ui

#
# Continue with 'Build' section below
#


------
Build:
------

make -j
make install

#
# At this point you have x64sc, x128 etc. binaries in /usr/local/bin.
#
# If you link in /usr/local/lib you can also run the local copies:
#

ln -s /usr/local/lib
./src/x64sc
