Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@senmu
Copy link

@senmu senmu commented Apr 16, 2021

In trying to improve compatibility for a SwiftUI app (XcodesOrg/XcodesApp#121), I found the steps necessary to compile for Apple's new M1 chips and created a new Makefile to target this architecture.

This is far from ideal as it would be great if a "universal" binary was the result, but I'm not so familiar with this ecosystem to figure out how to do this, or if it's possible.

Much of this was adapted from the steps outlined in #1537.

I've written out the steps I found success and included it in the top of makerelease-macOS-m1.mk:


In order to use this Makefile to build for Apple silicon, first install Xcode Command Line Tools:

$ xcode-select --install

Then install dependencies with Homebrew:

$ brew install automake
$ brew install autoconf
$ brew install libtool
$ brew install pkg-config
$ brew install docutils
$ brew install libxml2

Setup environment variables:

$ export PATH=${PATH}:/usr/local/opt/gettext/bin
$ export PKG_CONFIG_PATH="/usr/local/opt/libxml2/lib/pkgconfig"
$ export LDFLAGS="-L/usr/local/opt/libxml2/lib"
$ export CPPFLAGS="-I/usr/local/opt/libxml2/include"

Configure (differs from what's on the README to import pkg-config macros):

$ autoreconf -i -I /opt/homebrew/share/aclocal/

To use this Makefile, do something along the lines of

$ mkdir build-release
$ cd build-release
$ virtualenv .
$ . bin/activate
$ pip install sphinx-build
$ ln -s ../makerelease-os.mk Makefile
$ make

@purerosefallen
Copy link

To build a universal binary, you need a single mac computer with each arch. Then build the binary with each arch, and use lipo tool to combine them into one binary.

@PaiHL
Copy link

PaiHL commented Jan 26, 2024

sorry, my try in macos(m2) build this aria2c, but happend err.


(build-release) dev@xxx build-release % pip install sphinx-build
ERROR: Could not find a version that satisfies the requirement sphinx-build (from versions: none)
ERROR: No matching distribution found for sphinx-build

@PaiHL
Copy link

PaiHL commented Jan 26, 2024

or should use pip install Sphinx replace pip install sphinx-build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants