aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2021-06-22 11:16:36 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2021-06-23 16:06:36 +0200
commit6aa8a237db63f510f1d50fd8afc8ba50652d53cc (patch)
treeb6090c185d34d8a2443fa37498b234f9c08041ef
parent24e39ae268a6dab71a943d4e3077f89543edd732 (diff)
SoapySDR: Fixed API change from version 0.7.1
-rw-r--r--configure.ac4
-rw-r--r--src/libsdr/Makefile.am2
-rw-r--r--src/libsdr/soapy.c14
3 files changed, 17 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 65ccdc2..16f631f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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
diff --git a/src/libsdr/Makefile.am b/src/libsdr/Makefile.am
index 1d9f4fc..2050a17 100644
--- a/src/libsdr/Makefile.am
+++ b/src/libsdr/Makefile.am
@@ -1,4 +1,4 @@
-AM_CPPFLAGS = -Wall -Wextra -g $(all_includes)
+AM_CPPFLAGS = -Wall -Wextra -g $(all_includes) $(SOAPY_CFLAGS)
noinst_LIBRARIES = libsdr.a
diff --git a/src/libsdr/soapy.c b/src/libsdr/soapy.c
index c681e2f..48f75b1 100644
--- a/src/libsdr/soapy.c
+++ b/src/libsdr/soapy.c
@@ -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;