ps3dev / ps3toolchain

A script to autobuild an open source toolchain for the PS3.
BSD 2-Clause "Simplified" License
280 stars 92 forks source link

Add lib paths on Apple M1 (arm64) #113

Closed bucanero closed 2 years ago

bucanero commented 2 years ago

This PR updates the checks to build the ps3 toolchain on macOS w/ Apple M1 processors.

Note: Homebrew package manager install libs on /opt/homebrew/ when running on Apple M1 (arm64)

zeldin commented 2 years ago

Hm, I'm thinking maybe instead of adding more OS-specific paths to this list, we should just check with pkg-config as well?

mikan:~% uname -a
Darwin mikan.mc.pp.se 20.6.0 Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:20 PDT 2021; root:xnu-7195.141.6~3/RELEASE_ARM64_T8101 arm64
mikan:~% pkg-config --exists gmp && echo "yes"
yes
mikan:~% pkg-config --exists libelf && echo "yes"
yes
mikan:~% pkg-config --exists ncurses && echo "yes"
yes
mikan:~% pkg-config --exists zlib && echo "yes" 
yes
mikan:~% 
bucanero commented 2 years ago

Hm, I'm thinking maybe instead of adding more OS-specific paths to this list, we should just check with pkg-config as well?

For sure, it looks like a more elegant (and future-proof) solution. I'm not an expert on scripting but I can try to upgrade these scripts to pkg-config and update the PR.

bucanero commented 2 years ago

I have upgraded the scripts using pkg-config. Please take a look when you have a chance.

zeldin commented 2 years ago
  1. To make sure there are no regressions, I wouldn't remove the old tests, just add the pkg-config check instead of adding a new path test for homebrew
  2. The is no need for any parentheses around the pkg-config command. The old things that have parentheses is because it's using a single redirection clause to redirect the output from multiple commands. But the pkg-config command is just one command and does not use any redirection anyway.
bucanero commented 2 years ago
  1. To make sure there are no regressions, I wouldn't remove the old tests, just add the pkg-config check instead of adding a new path test for homebrew

I updated the scripts, keeping the old tests, and adding the pkg-config check.

Btw, I added some notes about building the ps3 toolchain on M1 in #114 . I'm not sure how to include those fixes properly.

zeldin commented 2 years ago

LGTM.