Skip to content

Commit

Permalink
Configure: dylibbundler check
Browse files Browse the repository at this point in the history
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 8315507).
  • Loading branch information
MartinPulec committed May 13, 2020
1 parent 7471962 commit 6eff3e8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
16 changes: 6 additions & 10 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
18 changes: 18 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
# -------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit 6eff3e8

Please sign in to comment.