package/uhd: add missing support
authorGwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
Mon, 8 Feb 2021 15:19:14 +0000 (16:19 +0100)
committerPeter Korsgaard <peter@korsgaard.com>
Tue, 9 Feb 2021 21:36:17 +0000 (22:36 +0100)
Complete uhd package with the rest of USRP, octoclock and python support.

Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/uhd/Config.in
package/uhd/uhd.mk

index 6715f1f10b42bfc5d2ba8cc1854b6ce68a656019..fae0887509022f3263d9010c2e2b74d342f46f18 100644 (file)
@@ -75,6 +75,43 @@ config BR2_PACKAGE_UHD_MPMD
        help
          enable MPMD support
 
+config BR2_PACKAGE_UHD_N230
+       bool "N230 support"
+       help
+         enable N230 support
+
+config BR2_PACKAGE_UHD_N300
+       bool "N300 support"
+       select BR2_PACKAGE_UHD_MPMD
+       help
+         enable N300 support
+
+config BR2_PACKAGE_UHD_N320
+       bool "N320 support"
+       select BR2_PACKAGE_UHD_MPMD
+       help
+         enable N320 support
+
+config BR2_PACKAGE_UHD_OCTOCLOCK
+       bool "OctoClock support"
+       help
+         enable OctoClock support
+
+comment "uhd python API needs python3 and a toolchain w/ glibc or musl"
+       depends on !BR2_PACKAGE_PYTHON3
+       depends on !BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS
+       depends on !(BR2_TOOLCHAIN_USES_GLIBC && BR2_TOOLCHAIN_USES_MUSL) # python-numpy
+
+config BR2_PACKAGE_UHD_PYTHON
+       bool "python API support"
+       depends on BR2_PACKAGE_PYTHON3
+       depends on BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS
+       depends on BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_MUSL # python-numpy
+       select BR2_PACKAGE_PYTHON_NUMPY
+       select BR2_PACKAGE_PYTHON_REQUESTS
+       help
+         enable python API support
+
 config BR2_PACKAGE_UHD_RFNOC
        bool "RFNoC support"
        help
@@ -90,4 +127,30 @@ config BR2_PACKAGE_UHD_USB
 comment "USB support needs a toolchain w/ gcc >= 4.9"
        depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
 
+config BR2_PACKAGE_UHD_USRP1
+       bool "USRP1 support"
+       select BR2_PACKAGE_UHD_USB
+       help
+         enable USRP1 support
+
+config BR2_PACKAGE_UHD_USRP2
+       bool "USRP2 support"
+       help
+         enable USRP2 support
+
+comment "uhd utils depends on python API support"
+       depends on !BR2_PACKAGE_UHD_PYTHON
+
+config BR2_PACKAGE_UHD_UTILS
+       bool "uhd-utils"
+       depends on BR2_PACKAGE_UHD_PYTHON
+       select BR2_PACKAGE_PYTHON_SIX
+       help
+         uhd-utils
+
+config BR2_PACKAGE_UHD_X300
+       bool "X300 support"
+       help
+         enable X300 support
+
 endif
index 2a40efdd2339326b1cb07d4312bd02bb2ef4deaa..a8001dfd7488a9811a846eedf47fabc5efd10d49 100644 (file)
@@ -25,18 +25,9 @@ UHD_CONF_OPTS = \
        -DENABLE_DOXYGEN=OFF \
        -DENABLE_DPDK=OFF \
        -DENABLE_LIBUHD=ON \
-       -DENABLE_N230=OFF \
-       -DENABLE_N300=OFF \
-       -DENABLE_N320=OFF \
        -DENABLE_MANUAL=OFF \
        -DENABLE_MAN_PAGES=OFF \
-       -DENABLE_OCTOCLOCK=OFF \
-       -DENABLE_PYTHON_API=OFF \
-       -DENABLE_TESTS=OFF \
-       -DENABLE_USRP1=OFF \
-       -DENABLE_USRP2=OFF \
-       -DENABLE_UTILS=OFF \
-       -DENABLE_X300=OFF
+       -DENABLE_TESTS=OFF
 
 # As soon as architecture is ARM, uhd will try to use NEON.
 # But not all ARM cores have NEON support.
@@ -89,12 +80,44 @@ else
 UHD_CONF_OPTS += -DENABLE_MPMD=OFF
 endif
 
+ifeq ($(BR2_PACKAGE_UHD_N230),y)
+UHD_CONF_OPTS += -DENABLE_N230=ON
+else
+UHD_CONF_OPTS += -DENABLE_N230=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_UHD_N300),y)
+UHD_CONF_OPTS += -DENABLE_N300=ON
+else
+UHD_CONF_OPTS += -DENABLE_N300=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_UHD_N320),y)
+UHD_CONF_OPTS += -DENABLE_N320=ON
+else
+UHD_CONF_OPTS += -DENABLE_N320=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_UHD_OCTOCLOCK),y)
+UHD_CONF_OPTS += -DENABLE_OCTOCLOCK=ON
+else
+UHD_CONF_OPTS += -DENABLE_OCTOCLOCK=OFF
+endif
+
 ifeq ($(BR2_PACKAGE_UHD_RFNOC),y)
 UHD_CONF_OPTS += -DENABLE_RFNOC=ON
 else
 UHD_CONF_OPTS += -DENABLE_RFNOC=OFF
 endif
 
+ifeq ($(BR2_PACKAGE_UHD_PYTHON),y)
+UHD_DEPENDENCIES += host-python-numpy host-python3-requests \
+       python-numpy python-requests
+UHD_CONF_OPTS += -DENABLE_PYTHON_API=ON
+else
+UHD_CONF_OPTS += -DENABLE_PYTHON_API=OFF
+endif
+
 ifeq ($(BR2_PACKAGE_UHD_USB),y)
 UHD_DEPENDENCIES += libusb
 UHD_CONF_OPTS += -DENABLE_USB=ON
@@ -102,4 +125,29 @@ else
 UHD_CONF_OPTS += -DENABLE_USB=OFF
 endif
 
+ifeq ($(BR2_PACKAGE_UHD_USRP1),y)
+UHD_CONF_OPTS += -DENABLE_USRP1=ON
+else
+UHD_CONF_OPTS += -DENABLE_USRP1=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_UHD_USRP2),y)
+UHD_CONF_OPTS += -DENABLE_USRP2=ON
+else
+UHD_CONF_OPTS += -DENABLE_USRP2=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_UHD_UTILS),y)
+UHD_DEPENDENCIES += python-six
+UHD_CONF_OPTS += -DENABLE_UTILS=ON
+else
+UHD_CONF_OPTS += -DENABLE_UTILS=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_UHD_X300),y)
+UHD_CONF_OPTS += -DENABLE_X300=ON
+else
+UHD_CONF_OPTS += -DENABLE_X300=OFF
+endif
+
 $(eval $(cmake-package))