From 6eff3e803dca4224076411b67e1cc84378ab55ef Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 5 May 2020 09:29:11 +0200 Subject: [PATCH] Configure: dylibbundler check Do the check in configure, not Makefile. + allow DYLIBBUNDLER_FLAGS to contain additional search paths (with the '-s' parameter). This should replace the EXTRA_LIB_PATH variable not supported by dylib bundler v2 (and removed with commit 8315507e). --- Makefile.in | 16 ++++++---------- configure.ac | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/Makefile.in b/Makefile.in index e8dea6b83..36479b500 100644 --- a/Makefile.in +++ b/Makefile.in @@ -18,7 +18,8 @@ INC = -Isrc -I$(srcdir) -I$(srcdir)/src -I$(srcdir)/test -Idxt_compres @JACK_TRANS_INC@ @SPEEX_INC@ \ @CURSES_CFLAGS@ @CUDA_INC@ @INC@ DECKLINK_PATH = @DECKLINK_PATH@ -DYLIBBUNDLER_FLAGS = @DYLIBBUNDLER_FLAGS@ +DYLIBBUNDLER = @DYLIBBUNDLER@ +DYLIBBUNDLER_FLAGS += @DYLIBBUNDLER_FLAGS@ EXEEXT = @EXEEXT@ TARGET = bin/uv$(EXEEXT) IMPORT_C_TARGET = bin/import_control_keyboard$(EXEEXT) @@ -505,15 +506,10 @@ bundle-nolib: all # adds libraries to the bundle bundle: bundle-nolib - @if `which dylibbundler`; then set -eu; \ - 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 $(DYLIBBUNDLER_FLAGS) -of -p @executable_path/../libs/ -cd -b -x $$n -d $(BUNDLE)/Contents/libs/; \ - 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; \ - fi + $(MKDIR_P) $(BUNDLE)/Contents/libs + for n in $(BUNDLE)/Contents/MacOS/*; \ + do echo quit | $(DYLIBBUNDLER) $(DYLIBBUNDLER_FLAGS) -of -p @executable_path/../libs/ -cd -b -x $$n -d $(BUNDLE)/Contents/libs/; \ + done $(MKDIR_P) $(BUNDLE)/Contents/Frameworks $(CP) -r redists/VideoMasterHD.framework $(BUNDLE)/Contents/Frameworks $(CP) -r redists/VideoMasterHD_Audio.framework $(BUNDLE)/Contents/Frameworks diff --git a/configure.ac b/configure.ac index 2664d0520..6cbe56e4d 100644 --- a/configure.ac +++ b/configure.ac @@ -256,6 +256,24 @@ $TARGET: "$2" $4 ]) ]) +# --------------------------------------------------------------------- +# Dylib bundler +# --------------------------------------------------------------------- +AC_PATH_PROGS(DYLIBBUNDLER, dylibbundler, [true]) +if test "$DYLIBBUNDLER" = true -a $system = MacOSX; then + AC_MSG_WARN([*** echo "WARNING: Cannot find dylibbundler. We cannot put libraries into a bundle so it probably won't be portable."]) +else + AC_MSG_CHECKING([dylibbundler version]) + dyl_ver=$($DYLIBBUNDLER -V >/dev/null 2>&1 && dylibbundler -V | cut -d\ -f2 || echo unknown) + AC_MSG_RESULT($dyl_ver); + + if test $dyl_ver = unknown || expr "$dyl_ver" \<= 2 >/dev/null; then + AC_MSG_WARN([*** Original dylib bundler detected, recommending v2 instead (https://github.com/SCG82/macdylibbundler)]) + fi +fi + +AC_SUBST(DYLIBBUNDLER) + # ------------------------------------------------------------------------------------------------- # Additional macros # -------------------------------------------------------------------------------------------------