From d16e2f66307ca2d90ef864c6bc3607ebf0ea513a Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Thu, 6 Feb 2020 10:12:08 +0100 Subject: [PATCH] Configure: Autodetect SPOUT wrapper + configurable location in the SPOUT wrapper build script + install the Spout DLL with the build script to /usr/local/bin --- configure.ac | 12 +++++++++--- data/scripts/build_spout64.sh | 10 ++++++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 1a86bbc77..57b31a698 100644 --- a/configure.ac +++ b/configure.ac @@ -2884,13 +2884,19 @@ fi # ------------------------------------------------------------------------------ spout=no AC_ARG_ENABLE(spout, -[ --enable-spout enables Spout support (default is disabled)] +[ --enable-spout enables Spout support (default is auto)] [ Requires: Spout], [spout_req=$enableval], - [spout_req=no] + [spout_req=auto] ) -if test $spout_req == yes +FOUND_SPOUT_WRAPPER=no +if test $system = Windows +then + AC_CHECK_LIB(spout_wrapper, spout_create_receiver, [FOUND_SPOUT_WRAPPER=yes]) +fi + +if test $spout_req != no -a $FOUND_SPOUT_WRAPPER = yes then AC_DEFINE([HAVE_SPOUT], [1], [Build with Spout support]) LIBS="$LIBS -lspout_wrapper" diff --git a/data/scripts/build_spout64.sh b/data/scripts/build_spout64.sh index 2d31cdf12..00f0b3f26 100755 --- a/data/scripts/build_spout64.sh +++ b/data/scripts/build_spout64.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -eu ####################################### # USAGE @@ -35,7 +35,13 @@ function run_vs10 run_in_vs_env VS100COMNTOOLS "$@" } -run_vs16 cl //DEXPORT_DLL_SYMBOLS src/spout_sender.cpp src/spout_receiver.cpp //LD src/SpoutSDK/Binaries/x64/Spout.lib //Fespout_wrapper +LIBDIR=${1:-src/SpoutSDK/Binaries/x64} +MSVS_PATH=`/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/Installer/vswhere.exe -latest -property installationPath` + +eval vssetup=\"$MSVS_PATH\"'\\VC\\Auxiliary\\Build\\vcvars64.bat' +cmd //Q //C call "$vssetup" "&&" cl //DEXPORT_DLL_SYMBOLS src/spout_sender.cpp src/spout_receiver.cpp //LD $LIBDIR/Spout.lib //Fespout_wrapper + cp spout_wrapper.dll /usr/local/bin cp spout_wrapper.lib /usr/local/lib +cp $LIBDIR/Spout.dll /usr/local/bin