/sox

SoX, Swiss Army knife of sound processing

Primary LanguageCOtherNOASSERTION

HOW TO CREATE A STATIC LINKED BINARY ON MACOS?

In theory this should not be possible like explained here: https://developer.apple.com/library/archive/qa/qa1118/_index.html

In practice there's a workaround:

1- Copy all static dependencies libs (*.a files in /usr/local/lib) to a folder like "/staticlibs"
2- Hide shared libs:
	python ./hide-shared-libs.py -d /usr/local --hide
3- Compile SoX :

autoreconf -i
./configure LDFLAGS='-L/staticlibs' --enable-static --disable-shared --with-distro='macOS 10.14 Mojave'
make

4- Restore shared libs:
	pyhton ./hide-shared-libs.py -d /usr/local --restore
5- Profit!


Credits: Thanks todd for the python script: https://dropline.net/2015/10/static-linking-on-mac-os-x/