SoapySDR: Fixed API change from version 0.7.1

This commit is contained in:
Andreas Eversberg 2021-06-22 11:16:36 +02:00
parent 24e39ae268
commit 6aa8a237db
3 changed files with 17 additions and 3 deletions

View File

@ -28,6 +28,7 @@ AC_CHECK_LIB([m], [main])
AC_CHECK_LIB([pthread], [main])
with_sdr=no
soapy_0_7_1_or_higher=
AC_ARG_WITH([alsa], [AS_HELP_STRING([--with-alsa], [compile with Alsa driver @<:@default=check@:>@]) ], [], [with_alsa="check"])
AC_ARG_WITH([uhd], [AS_HELP_STRING([--with-uhd], [compile with UHD driver @<:@default=check@:>@]) ], [], [with_uhd="check"])
AC_ARG_WITH([soapy], [AS_HELP_STRING([--with-soapy], [compile with SoapySDR driver @<:@default=check@:>@]) ], [], [with_soapy="check"])
@ -35,6 +36,7 @@ AC_ARG_WITH([imagemagick], [AS_HELP_STRING([--with-imagemagick], [compile with I
AC_ARG_WITH([fuse], [AS_HELP_STRING([--with-fuse], [compile with FUSE support @<:@default=check@:>@]) ], [], [with_fuse="check"])
AS_IF([test "x$with_alsa" != xno], [PKG_CHECK_MODULES(ALSA, alsa >= 1.0, with_alsa=yes, with_alsa=no)])
AS_IF([test "x$with_uhd" != xno], [PKG_CHECK_MODULES(UHD, uhd >= 3.0.0, with_sdr=yes with_uhd=yes, with_uhd=no)])
AS_IF([test "x$with_soapy" != xno], [PKG_CHECK_MODULES(SOAPY, SoapySDR >= 0.7.1, soapy_0_7_1_or_higher="-DSOAPY_0_7_1_OR_HIGHER", soapy_0_7_1_or_higher=)])
AS_IF([test "x$with_soapy" != xno], [PKG_CHECK_MODULES(SOAPY, SoapySDR >= 0.5.0, with_sdr=yes with_soapy=yes, with_soapy=no)])
AS_IF([test "x$with_imagemagick" != xno], [PKG_CHECK_MODULES(IMAGEMAGICK, ImageMagick >= 7.0.0, with_imagemagick=yes, with_imagemagick=no)])
AS_IF([test "x$with_fuse" != xno], with_fuse=check)
@ -56,6 +58,8 @@ AS_IF([test "x$with_fuse" == "xyes"],[AC_MSG_NOTICE( Compiling with FUSE )],[AC_
AS_IF([test "x$with_alsa" != "xyes" -a "x$with_sdr" != "xyes"],[AC_MSG_NOTICE( Without sound nor SDR support this project does not make sense. Please support sound card for analog transceivers or better SDR!" )],[])
SOAPY_CFLAGS="$soapy_0_7_1_or_higher"
AC_OUTPUT(
src/liboptions/Makefile
src/libdebug/Makefile

View File

@ -1,4 +1,4 @@
AM_CPPFLAGS = -Wall -Wextra -g $(all_includes)
AM_CPPFLAGS = -Wall -Wextra -g $(all_includes) $(SOAPY_CFLAGS)
noinst_LIBRARIES = libsdr.a

View File

@ -249,7 +249,12 @@ int soapy_open(size_t channel, const char *_device_args, const char *_stream_arg
}
/* set up streamer */
if (SoapySDRDevice_setupStream(sdr, &rxStream, SOAPY_SDR_RX, SOAPY_SDR_CF32, &channel, 1, &stream_args) != 0) {
#ifdef SOAPY_0_7_1_OR_HIGHER
if (!(rxStream = SoapySDRDevice_setupStream(sdr, SOAPY_SDR_RX, SOAPY_SDR_CF32, &channel, 1, &stream_args)))
#else
if (SoapySDRDevice_setupStream(sdr, &rxStream, SOAPY_SDR_RX, SOAPY_SDR_CF32, &channel, 1, &stream_args) != 0)
#endif
{
PDEBUG(DSOAPY, DEBUG_ERROR, "Failed to set RX streamer args\n");
soapy_close();
return -EIO;
@ -369,7 +374,12 @@ int soapy_open(size_t channel, const char *_device_args, const char *_stream_arg
}
/* set up streamer */
if (SoapySDRDevice_setupStream(sdr, &txStream, SOAPY_SDR_TX, SOAPY_SDR_CF32, &channel, 1, &stream_args) != 0) {
#ifdef SOAPY_0_7_1_OR_HIGHER
if (!(txStream = SoapySDRDevice_setupStream(sdr, SOAPY_SDR_TX, SOAPY_SDR_CF32, &channel, 1, &stream_args)))
#else
if (SoapySDRDevice_setupStream(sdr, &txStream, SOAPY_SDR_TX, SOAPY_SDR_CF32, &channel, 1, &stream_args) != 0)
#endif
{
PDEBUG(DSOAPY, DEBUG_ERROR, "Failed to set TX streamer args\n");
soapy_close();
return -EIO;