From 8315507eb8910fe1d0ff65f33e6550026d6bc490 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Sat, 2 May 2020 21:19:25 +0200 Subject: [PATCH] Dylibbundler v2 updates --- Makefile.in | 13 +++++-------- configure.ac | 3 +++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Makefile.in b/Makefile.in index 6bff8548d..e7526d292 100644 --- a/Makefile.in +++ b/Makefile.in @@ -18,6 +18,7 @@ INC = -Isrc -I$(srcdir) -I$(srcdir)/src -I$(srcdir)/test -Idxt_compres @JACK_TRANS_INC@ @SPEEX_INC@ \ @CUDA_INC@ @INC@ DECKLINK_PATH = @DECKLINK_PATH@ +DYLIBBUNDLER_FLAGS = @DYLIBBUNDLER_FLAGS@ EXEEXT = @EXEEXT@ TARGET = bin/uv$(EXEEXT) PERF = bin/uv_perf @@ -578,12 +579,10 @@ $(BUNDLE): $(TARGET) $(REFLECTOR_TARGET) hd-rum-multi/hd-rum $(BUNDLE)/Contents/libs: $(BUNDLE) cp $(REFLECTOR_TARGET) $(TARGET) $(BUNDLE)/Contents/MacOS # copy new execs - repeated dylibbundler on a binary fails @if `which dylibbundler`; then set -eu; \ - export DYLD_LIBRARY_PATH=$(EXTRA_LIB_PATH); \ + dylibbundler -V >/dev/null 2>&1 || echo "WARNING: Use of dylib bundler v2 (https://github.com/SCG82/macdylibbundler) is strongly recommended over the legacy" ; \ for n in $(BUNDLE)/Contents/MacOS/*; \ - do echo quit | dylibbundler -of -p @executable_path/../libs/ -cd -b -x $$n -d $(BUNDLE)/Contents/libs/; \ + do echo quit | dylibbundler $(DYLIBBUNDLER_FLAGS) -of -p @executable_path/../libs/ -cd -b -x $$n -d $(BUNDLE)/Contents/libs/; \ done; \ - for n in $(BUNDLE)/Contents/MacOS/* $(BUNDLE)/Contents/libs/*; do echo $$n; while $$( otool -L $$n | grep -q @rpath) ; \ - do NAME=$$( otool -L $$n | grep @rpath| tail -n 1|cut -f 1 -d\ ); install_name_tool -change $$NAME $${NAME/@rpath/@executable_path\/..\/libs} $$n ; done; done ; \ else \ echo "WARNING: Cannot find dylibbundler. We cannot put libraries into a bundle so it probably won't be portable."; \ $(MKDIR_P) $(BUNDLE)/Contents/libs; \ @@ -605,10 +604,8 @@ $(GUI_BUNDLE)/Contents/libs: $(BUNDLE)/Contents/libs $(GUI_BUNDLE) rm -rf $(GUI_BUNDLE)/Contents/Frameworks $(GUI_BUNDLE)/Contents/libs $(MKDIR_P) $(GUI_BUNDLE)/Contents/Frameworks $(GUI_BUNDLE)/Contents/libs @if `which dylibbundler`; then set -eu; \ - export DYLD_LIBRARY_PATH=$(EXTRA_LIB_PATH); \ - echo quit | dylibbundler -of -p @executable_path/../libs/ -cd -b -x $(GUI_BUNDLE)/Contents/MacOS/uv-qt -d $(GUI_BUNDLE)/Contents/libs/; \ - for n in $(GUI_BUNDLE)/Contents/MacOS/uv-qt `find $(GUI_BUNDLE)/Contents/libs -type f`; do echo $$n; while $$( otool -L $$n | grep -q @rpath) ; \ - do NAME=$$( otool -L $$n | grep @rpath| tail -n 1|cut -f 1 -d\ ); install_name_tool -change $$NAME $${NAME/@rpath/@executable_path\/..\/libs} $$n ; done; done ; \ + dylibbundler -V >/dev/null 2>&1 || echo "WARNING: Use of dylib bundler v2 (https://github.com/SCG82/macdylibbundler) is strongly recommended over the legacy" ; \ + echo quit | dylibbundler $(DYLIBBUNDLER_FLAGS) -of -p @executable_path/../libs/ -cd -b -x $(GUI_BUNDLE)/Contents/MacOS/uv-qt -d $(GUI_BUNDLE)/Contents/libs/; \ else \ echo "WARNING: Cannot find dylibbundler. We cannot put libraries into a bundle so it probably won't be portable."; \ $(MKDIR_P) $(GUI_BUNDLE)/Contents/libs; \ diff --git a/configure.ac b/configure.ac index fed5c91ba..b9b8c54f5 100644 --- a/configure.ac +++ b/configure.ac @@ -2128,9 +2128,12 @@ then if test $system = MacOSX; then LDFLAGS="$LDFLAGS${LDFLAGS:+ }-rpath $CUDA_LIB_PATH" + DYLIBBUNDLER_FLAGS="-s $CUDA_LIB_PATH" fi fi +AC_SUBST(DYLIBBUNDLER_FLAGS) + # Pick compiler for cuda device code AC_ARG_WITH(cuda-compiler, AS_HELP_STRING([--with-cuda-compiler=compiler], [select compiler to compile cuda code with; suported: clang, nvcc; default: nvcc]),