mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-08-24 07:43:44 +02:00
Streamline dependency building on macOS
This commit is contained in:
parent
cc337afb81
commit
a7331517c3
5 changed files with 34 additions and 36 deletions
|
@ -87,7 +87,7 @@ sigcxx: init_dirs $(LIBDIR)/libsigc-2.0.a
|
||||||
|
|
||||||
$(LIBDIR)/libsigc-2.0.a: $(DOWNLOADS)/sigcxx/Makefile
|
$(LIBDIR)/libsigc-2.0.a: $(DOWNLOADS)/sigcxx/Makefile
|
||||||
cd $(DOWNLOADS)/sigcxx; \
|
cd $(DOWNLOADS)/sigcxx; \
|
||||||
make; make install
|
$(CONFIGURE_ENV) make; $(CONFIGURE_ENV) make install
|
||||||
|
|
||||||
$(DOWNLOADS)/sigcxx/Makefile: $(DOWNLOADS)/sigcxx/autogen.sh
|
$(DOWNLOADS)/sigcxx/Makefile: $(DOWNLOADS)/sigcxx/autogen.sh
|
||||||
cd $(DOWNLOADS)/sigcxx; \
|
cd $(DOWNLOADS)/sigcxx; \
|
||||||
|
@ -262,11 +262,11 @@ $(DOWNLOADS)/openssl/Configure:
|
||||||
cd $(DOWNLOADS)/openssl; git checkout OpenSSL_1_1_1i
|
cd $(DOWNLOADS)/openssl; git checkout OpenSSL_1_1_1i
|
||||||
|
|
||||||
# Standard ruby
|
# Standard ruby
|
||||||
ruby: init_dirs $(LIBDIR)/libruby.3.0.dylib openssl
|
ruby: init_dirs openssl $(LIBDIR)/libruby.3.0.dylib
|
||||||
|
|
||||||
$(LIBDIR)/libruby.3.0.dylib: $(DOWNLOADS)/ruby/Makefile
|
$(LIBDIR)/libruby.3.0.dylib: $(DOWNLOADS)/ruby/Makefile
|
||||||
cd $(DOWNLOADS)/ruby; \
|
cd $(DOWNLOADS)/ruby; \
|
||||||
make -j$(NPROC); make install
|
$(CONFIGURE_ENV) make -j$(NPROC); $(CONFIGURE_ENV) make install
|
||||||
# Make the dylib relative
|
# Make the dylib relative
|
||||||
install_name_tool -id @rpath/libruby.3.0.dylib $(LIBDIR)/libruby.3.0.dylib
|
install_name_tool -id @rpath/libruby.3.0.dylib $(LIBDIR)/libruby.3.0.dylib
|
||||||
|
|
||||||
|
|
21
macos/Dependencies/setup
Executable file
21
macos/Dependencies/setup
Executable file
|
@ -0,0 +1,21 @@
|
||||||
|
#!/usr/bin/env ruby
|
||||||
|
|
||||||
|
HOST = `clang -dumpmachine`.strip
|
||||||
|
ARCH = HOST[/x86_64|arm64/]
|
||||||
|
|
||||||
|
def run_build(arch)
|
||||||
|
case arch
|
||||||
|
when "x86_64"
|
||||||
|
return system("make everything -f .Intel")
|
||||||
|
when "arm64"
|
||||||
|
code = system("make everything -f .AppleSilicon")
|
||||||
|
return code if !code
|
||||||
|
code = (system("arch -x86_64 make everything -f .Intel"))
|
||||||
|
return code if !code
|
||||||
|
return system("./make_macuniversal")
|
||||||
|
else
|
||||||
|
raise "Unsupported architecture"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
exit(run_build(ARCH) ? 0 : 1)
|
|
@ -1,34 +1,4 @@
|
||||||
This folder contains an experimental Xcode project that will build mkxp-z and all of its dependencies.
|
Currently, building the Apple Silicon and Universal schemes requires an ARM Mac on hand.
|
||||||
|
|
||||||
Currently, building mkxp-z for ARM requires an ARM Mac on hand.
|
To get all dependencies, all you need to do is run `setup.command`.
|
||||||
This is primarily because libsigc++ doesn't properly cross-compile when you ask it to.
|
Then you can open the Xcode project and build it.
|
||||||
|
|
||||||
To get all dependencies, cd to the `Dependencies` folder and run:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
# This will download all the required tools
|
|
||||||
# for building the dependencies
|
|
||||||
brew bundle
|
|
||||||
|
|
||||||
# Intel Macs
|
|
||||||
make everything -f .Intel
|
|
||||||
|
|
||||||
# ARM Macs
|
|
||||||
make everything -f .AppleSilicon
|
|
||||||
|
|
||||||
# Create universal libraries (For the universal build)
|
|
||||||
make everything -f .AppleSilicon
|
|
||||||
arch -x86_64 make everything -f .Intel
|
|
||||||
./make_macuniversal.command
|
|
||||||
|
|
||||||
# Use your own Ruby, and build everything else (for Intel Macs)
|
|
||||||
make custom-ruby -f .Intel RUBY_PATH="Path to Ruby" RUBY_FLAGS="extra configure arguments"
|
|
||||||
make deps-core -f .Intel
|
|
||||||
```
|
|
||||||
|
|
||||||
Afterwards, simply open the Xcode project, select the scheme you'd like to use
|
|
||||||
and hit Command+B.
|
|
||||||
|
|
||||||
If you built a version of ruby >= 2, change the MRI_VERSION build setting to match.
|
|
||||||
|
|
||||||
If you built 1.8, select the PlayerLegacy scheme.
|
|
7
macos/setup.command
Executable file
7
macos/setup.command
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# https://stackoverflow.com/questions/59895/how-to-get-the-source-directory-of-a-bash-script-from-within-the-script-itself
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||||
|
|
||||||
|
cd "$DIR/Dependencies"
|
||||||
|
./setup
|
Loading…
Add table
Reference in a new issue