diff options
author | shinyquagsire23 <mtinc2@gmail.com> | 2021-11-05 19:58:55 -0700 |
---|---|---|
committer | shinyquagsire23 <mtinc2@gmail.com> | 2021-11-05 19:58:55 -0700 |
commit | ba7202457fec51d31da4d23a1840813952f30f31 (patch) | |
tree | 95cd38dba1187d007a51dca7f455d7b6541d5110 | |
parent | 1b75688d9a3cd9828f556e7c68bc65bb0268a68f (diff) |
Update build scripts for MacOS Monterey; Use pkg-config on all platforms; MacOS no longer needs static libc++fs; Use gsed on MacOS
-rw-r--r-- | .github/workflows/build.yml | 2 | ||||
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | INSTALL.md | 23 | ||||
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | tools/knarc/Makefile | 2 | ||||
-rw-r--r-- | tools/mwasmarm_patcher/Makefile | 2 | ||||
-rw-r--r-- | tools/nitrobanner/Makefile | 3 | ||||
-rw-r--r-- | tools/nitrogfx/Makefile | 4 |
8 files changed, 24 insertions, 17 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index af5b3cfd..48cc5d37 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: run: | sudo apt update sudo ACCEPT_EULA=Y apt -y --fix-missing --allow-downgrades upgrade - sudo apt -y --allow-downgrades install g++-8-multilib linux-libc-dev binutils-arm-none-eabi p7zip-full + sudo apt -y --allow-downgrades install g++-8-multilib linux-libc-dev binutils-arm-none-eabi p7zip-full pkg-config sudo dpkg --add-architecture i386 wget -qO - https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add - sudo add-apt-repository ppa:cybermax-dexter/sdl2-backport @@ -50,3 +50,6 @@ symbols.csv files/**/*.c *.o *.naix + +# MacOS garbage +.DS_Store @@ -21,6 +21,7 @@ Building the ROM requires the following packages: * wine (to run the mwcc executables) * python3 (for asm preprocessor) * libpng-devel (libpng-dev on Ubuntu) +* pkg-config NOTE: If you are using Arch/Manjaro or Void you will only need base-devel instead of build-essentials or make or git. You will still need wine. @@ -48,6 +49,7 @@ You will still require the following packages: * git * build-essentials * libpng-devel +* pkg-config Install them using either the Cygwin package manager or using pacman on Msys2. @@ -55,24 +57,25 @@ Install them using either the Cygwin package manager or using pacman on Msys2. #### macOS -**macOS 10.14 Mojave or older is required**. macOS 10.15 Catalina is not supported due to missing support for 32-bit binaries (thus making wine emulation unfeasible). You will also require the following packages: +macOS 10.15 Catalina and later is supported on Intel and ARM64 hardware configurations. On ARM64, Rosetta 2 must be installed, as well as the following dependencies: +* GNU coreutils * GNU make -* LLVM 8 clang compiler -* gcc@5 (for mwasmarm_patcher) +* GNU sed +* LLVM clang compiler * arm-gcc-bin * git * libpng -* wine-stable and xquartz dependency +* pkg-config +* wine-crossover (includes wine32on64, required on Catalina and later to run 32-bit x86 EXEs) They can be installed with the following commands: ```console $ brew tap osx-cross/homebrew-arm -$ brew tap homebrew/cask-versions -$ brew install make llvm@8 gcc@5 arm-gcc-bin libpng git -$ brew install --cask xquartz -$ brew install --cask --no-quarantine wine-stable +$ brew tap gcenx/wine +$ brew install coreutils make gnu-sed llvm arm-gcc-bin libpng git pkg-config +$ brew install wine-crossover ``` ### 4. Build ROM @@ -99,9 +102,9 @@ Note: Docker may not run at a full performance if its underlying Linux kernel is #### macOS -To avoid issues run the build as shown below. This avoids issues with missing features (i.e. "introduced in macOS 10.15" errors) and Apple's make not following standards. +To avoid issues, you will need to run the build as shown below. This avoids issues with missing features (i.e. "introduced in macOS 10.15" errors) and Apple's `make` being an older version. ```console -$ export PATH=/usr/local/opt/llvm@8/bin:$PATH CC=clang CXX=clang++ +$ export PATH=${HOMEBREW_PREFIX}/opt/llvm/bin:$PATH CC=clang CXX=clang++ $ gmake ``` @@ -41,7 +41,7 @@ WINE := wine UNAME_S := $(shell uname -s) ifeq ($(UNAME_S),Darwin) GREP := grep -E -SED := perl -p -e +SED := gsed -r else GREP := grep -P SED := sed -r diff --git a/tools/knarc/Makefile b/tools/knarc/Makefile index 0e0a0920..24e0de7d 100644 --- a/tools/knarc/Makefile +++ b/tools/knarc/Makefile @@ -8,7 +8,7 @@ else C_SRCS := UNAME_S := $(shell uname -s) ifeq ($(UNAME_S),Darwin) -LDFLAGS += -lstdc++ -lc++ -lc /usr/local/opt/llvm@8/lib/libc++fs.a +LDFLAGS += -lstdc++ -lc++ -lc -D_LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_FILESYSTEM else LDFLAGS += -lstdc++fs endif diff --git a/tools/mwasmarm_patcher/Makefile b/tools/mwasmarm_patcher/Makefile index 26df548c..bff3a677 100644 --- a/tools/mwasmarm_patcher/Makefile +++ b/tools/mwasmarm_patcher/Makefile @@ -2,7 +2,7 @@ UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
-CC := gcc-5
+CC := clang
else
CC := gcc
endif
diff --git a/tools/nitrobanner/Makefile b/tools/nitrobanner/Makefile index 322525bd..9b751776 100644 --- a/tools/nitrobanner/Makefile +++ b/tools/nitrobanner/Makefile @@ -5,7 +5,8 @@ LDFLAGS += -lstdc++fs else UNAME_S := $(shell uname -s) ifeq ($(UNAME_S),Darwin) -LDFLAGS += -lstdc++ -lc++ -lc /usr/local/opt/llvm@8/lib/libc++fs.a +CXXFLAGS += -D_LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_FILESYSTEM +LDFLAGS += -lstdc++ -lc++ -lc else LDFLAGS += -lstdc++fs endif diff --git a/tools/nitrogfx/Makefile b/tools/nitrogfx/Makefile index 18ecdbba..16b2632d 100644 --- a/tools/nitrogfx/Makefile +++ b/tools/nitrogfx/Makefile @@ -1,8 +1,8 @@ CC = gcc -CFLAGS = -Wall -Wextra -Werror -Wno-sign-compare -std=c11 -O2 -DPNG_SKIP_SETJMP_CHECK -D_CRT_SECURE_NO_WARNINGS +CFLAGS = -Wall -Wextra -Werror -Wno-sign-compare -std=c11 -O2 -DPNG_SKIP_SETJMP_CHECK $(shell pkg-config --cflags libpng) -LIBS = -lpng -lz +LIBS = $(shell pkg-config --libs libpng) SRCS = main.c convert_png.c gfx.c jasc_pal.c lz.c rl.c util.c font.c huff.c json.c cJSON.c |