Browse Source

Full static build on Mac

tags/v0.6.1
Andrew Belt 6 years ago
parent
commit
d2d4ee99d4
2 changed files with 18 additions and 52 deletions
  1. +4
    -28
      Makefile
  2. +14
    -24
      dep/Makefile

+ 4
- 28
Makefile View File

@@ -22,8 +22,8 @@ ifeq ($(ARCH), mac)
SOURCES += dep/osdialog/osdialog_mac.m
CXXFLAGS += -stdlib=libc++
LDFLAGS += -stdlib=libc++ -lpthread -ldl \
-framework Cocoa -framework OpenGL -framework IOKit -framework CoreVideo \
-Ldep/lib -lGLEW -lglfw -ljansson -lspeexdsp -lcurl -lzip -lrtaudio -lrtmidi -lcrypto -lssl
-framework Cocoa -framework OpenGL -framework IOKit -framework CoreVideo -framework CoreAudio -framework CoreMIDI \
-Ldep/lib dep/lib/libglfw3.a dep/lib/libGLEW.a dep/lib/libjansson.a dep/lib/libspeexdsp.a dep/lib/libzip.a dep/lib/libz.a dep/lib/librtaudio.a dep/lib/librtmidi.a dep/lib/libcrypto.a dep/lib/libssl.a dep/lib/libcurl.a
TARGET := Rack
BUNDLE := dist/$(TARGET).app
endif
@@ -110,36 +110,11 @@ ifeq ($(ARCH), mac)
mkdir -p $(BUNDLE)/Contents
mkdir -p $(BUNDLE)/Contents/Resources
cp Info.plist $(BUNDLE)/Contents/
cp -R LICENSE* res $(BUNDLE)/Contents/Resources
cp -R LICENSE* icon.icns res $(BUNDLE)/Contents/Resources

mkdir -p $(BUNDLE)/Contents/MacOS
cp $(TARGET) $(BUNDLE)/Contents/MacOS/
$(STRIP) -S $(BUNDLE)/Contents/MacOS/$(TARGET)
cp icon.icns $(BUNDLE)/Contents/Resources/

otool -L $(BUNDLE)/Contents/MacOS/$(TARGET)

cp dep/lib/libGLEW.2.1.0.dylib $(BUNDLE)/Contents/MacOS/
cp dep/lib/libglfw.3.dylib $(BUNDLE)/Contents/MacOS/
cp dep/lib/libjansson.4.dylib $(BUNDLE)/Contents/MacOS/
cp dep/lib/libspeexdsp.1.dylib $(BUNDLE)/Contents/MacOS/
cp dep/lib/libcurl.4.dylib $(BUNDLE)/Contents/MacOS/
cp dep/lib/libzip.5.dylib $(BUNDLE)/Contents/MacOS/
cp dep/lib/librtaudio.dylib $(BUNDLE)/Contents/MacOS/
cp dep/lib/librtmidi.4.dylib $(BUNDLE)/Contents/MacOS/
cp dep/lib/libcrypto.1.1.dylib $(BUNDLE)/Contents/MacOS/
cp dep/lib/libssl.1.1.dylib $(BUNDLE)/Contents/MacOS/

install_name_tool -change /usr/local/lib/libGLEW.2.1.0.dylib @executable_path/libGLEW.2.1.0.dylib $(BUNDLE)/Contents/MacOS/$(TARGET)
install_name_tool -change lib/libglfw.3.dylib @executable_path/libglfw.3.dylib $(BUNDLE)/Contents/MacOS/$(TARGET)
install_name_tool -change $(PWD)/dep/lib/libjansson.4.dylib @executable_path/libjansson.4.dylib $(BUNDLE)/Contents/MacOS/$(TARGET)
install_name_tool -change $(PWD)/dep/lib/libspeexdsp.1.dylib @executable_path/libspeexdsp.1.dylib $(BUNDLE)/Contents/MacOS/$(TARGET)
install_name_tool -change $(PWD)/dep/lib/libcurl.4.dylib @executable_path/libcurl.4.dylib $(BUNDLE)/Contents/MacOS/$(TARGET)
install_name_tool -change $(PWD)/dep/lib/libzip.5.dylib @executable_path/libzip.5.dylib $(BUNDLE)/Contents/MacOS/$(TARGET)
install_name_tool -change librtaudio.dylib @executable_path/librtaudio.dylib $(BUNDLE)/Contents/MacOS/$(TARGET)
install_name_tool -change $(PWD)/dep/lib/librtmidi.4.dylib @executable_path/librtmidi.4.dylib $(BUNDLE)/Contents/MacOS/$(TARGET)
install_name_tool -change $(PWD)/dep/lib/libcrypto.1.1.dylib @executable_path/libcrypto.1.1.dylib $(BUNDLE)/Contents/MacOS/$(TARGET)
install_name_tool -change $(PWD)/dep/lib/libssl.1.1.dylib @executable_path/libssl.1.1.dylib $(BUNDLE)/Contents/MacOS/$(TARGET)

otool -L $(BUNDLE)/Contents/MacOS/$(TARGET)

@@ -186,6 +161,7 @@ ifeq ($(ARCH), lin)
cp -R LICENSE* res dist/Rack/
cp $(TARGET) dist/Rack/
$(STRIP) -s dist/Rack/$(TARGET)
ldd dist/Rack/$(TARGET)
cp plugins/Fundamental/dist/Fundamental-*.zip dist/Rack/Fundamental.zip
# Make ZIP
cd dist && zip -5 -r Rack-$(VERSION)-$(ARCH).zip Rack


+ 14
- 24
dep/Makefile View File

@@ -20,15 +20,16 @@ ifeq ($(ARCH), lin)
endif

ifeq ($(ARCH), mac)
glew = lib/libGLEW.dylib
glfw = lib/libglfw.dylib
jansson = lib/libjansson.dylib
libspeexdsp = lib/libspeexdsp.dylib
libcurl = lib/libcurl.dylib
libzip = lib/libzip.dylib
rtmidi = lib/librtmidi.dylib
rtaudio = lib/librtaudio.dylib
openssl = lib/libssl.dylib
glew = lib/libGLEW.a
glfw = lib/libglfw3.a
jansson = lib/libjansson.a
libspeexdsp = lib/libspeexdsp.a
libcurl = lib/libcurl.a
libzip = lib/libzip.a
zlib = lib/libz.a
rtmidi = lib/librtmidi.a
rtaudio = lib/librtaudio.a
openssl = lib/libssl.a
endif

ifeq ($(ARCH), win)
@@ -38,6 +39,7 @@ ifeq ($(ARCH), win)
libspeexdsp = bin/libspeexdsp-1.dll
libcurl = bin/libcurl-4.dll
libzip = bin/libzip-5.dll
zlib = lib/libz.a
rtmidi = bin/librtmidi-4.dll
rtaudio = bin/librtaudio.dll
openssl = bin/libssl-1_1-x64.dll
@@ -57,9 +59,7 @@ include $(RACK_DIR)/dep.mk
$(glew):
$(WGET) https://github.com/nigels-com/glew/releases/download/glew-2.1.0/glew-2.1.0.tgz
$(UNTAR) glew-2.1.0.tgz
$(MAKE) -C glew-2.1.0 glew.lib
# On Linux, default lib path is lib64, so change it back to lib.
$(MAKE) -C glew-2.1.0 GLEW_DEST="$(realpath $(DEP_LOCAL))" LIBDIR="$(realpath $(DEP_LOCAL))/lib" install
$(MAKE) -C glew-2.1.0 CFLAGS.EXTRA="$(CFLAGS)" LDFLAGS.EXTRA="$(LDFLAGS)" GLEW_DEST="$(realpath $(DEP_LOCAL))" LIBDIR="$(realpath $(DEP_LOCAL))/lib" install

$(glfw):
cd glfw && $(CMAKE) . \
@@ -84,14 +84,10 @@ $(libspeexdsp):
$(openssl):
$(WGET) https://www.openssl.org/source/openssl-1.1.0g.tar.gz
$(UNTAR) openssl-1.1.0g.tar.gz
cd openssl-1.1.0g && ./config --prefix="$(realpath $(DEP_LOCAL))"
# ./config ignores CFLAGS, so hack it in with CC
cd openssl-1.1.0g && CC="$(CC) $(CFLAGS)" ./config --prefix="$(realpath $(DEP_LOCAL))"
$(MAKE) -C openssl-1.1.0g
$(MAKE) -C openssl-1.1.0g install_sw
ifeq ($(ARCH),mac)
otool -L $@
install_name_tool -change $(PWD)/lib/libcrypto.1.1.dylib @loader_path/libcrypto.1.1.dylib $@
otool -L $@
endif

$(libcurl): $(openssl)
$(WGET) https://github.com/curl/curl/releases/download/curl-7_56_0/curl-7.56.0.tar.gz
@@ -102,12 +98,6 @@ $(libcurl): $(openssl)
--without-ca-bundle --with-ca-fallback --with-ssl="$(realpath $(DEP_LOCAL))"
$(MAKE) -C curl-7.56.0
$(MAKE) -C curl-7.56.0 install
ifeq ($(ARCH),mac)
otool -L $@
install_name_tool -change $(PWD)/lib/libcrypto.1.1.dylib @loader_path/libcrypto.1.1.dylib $@
install_name_tool -change $(PWD)/lib/libssl.1.1.dylib @loader_path/libssl.1.1.dylib $@
otool -L $@
endif

$(libzip): $(zlib)
$(WGET) https://nih.at/libzip/libzip-1.2.0.tar.gz


Loading…
Cancel
Save