nginx-nasxi: new package
[buildroot-gz.git] / package / libiio / libiio.mk
blob3cbfdd63f9755554ec99d45f150b2edef6274b6d
1 ################################################################################
3 # libiio
5 ################################################################################
7 LIBIIO_VERSION = 0.7
8 LIBIIO_SITE = $(call github,analogdevicesinc,libiio,v$(LIBIIO_VERSION))
9 LIBIIO_INSTALL_STAGING = YES
10 LIBIIO_LICENSE = LGPLv2.1+
11 LIBIIO_LICENSE_FILES = COPYING.txt
13 LIBIIO_CONF_OPTS = -DENABLE_IPV6=ON \
14 -DWITH_LOCAL_BACKEND=$(if $(BR2_PACKAGE_LIBIIO_LOCAL_BACKEND),ON,OFF) \
15 -DWITH_NETWORK_BACKEND=$(if $(BR2_PACKAGE_LIBIIO_NETWORK_BACKEND),ON,OFF) \
16 -DWITH_TESTS=$(if $(BR2_PACKAGE_LIBIIO_TESTS),ON,OFF) \
17 -DWITH_DOC=OFF
19 ifeq ($(BR2_PACKAGE_LIBIIO_XML_BACKEND),y)
20 LIBIIO_DEPENDENCIES += libxml2
21 LIBIIO_CONF_OPTS += -DWITH_XML_BACKEND=ON
22 else
23 LIBIIO_CONF_OPTS += -DWITH_XML_BACKEND=OFF
24 endif
26 ifeq ($(BR2_PACKAGE_LIBIIO_USB_BACKEND),y)
27 LIBIIO_DEPENDENCIES += libusb
28 LIBIIO_CONF_OPTS += -DWITH_USB_BACKEND=ON
29 else
30 LIBIIO_CONF_OPTS += -DWITH_USB_BACKEND=OFF
31 endif
33 ifeq ($(BR2_PACKAGE_LIBIIO_SERIAL_BACKEND),y)
34 LIBIIO_DEPENDENCIES += libserialport
35 LIBIIO_CONF_OPTS += -DWITH_SERIAL_BACKEND=ON
36 else
37 LIBIIO_CONF_OPTS += -DWITH_SERIAL_BACKEND=OFF
38 endif
40 ifeq ($(BR2_PACKAGE_LIBIIO_IIOD),y)
41 LIBIIO_DEPENDENCIES += host-flex host-bison
42 LIBIIO_CONF_OPTS += -DWITH_IIOD=ON
43 else
44 LIBIIO_CONF_OPTS += -DWITH_IIOD=OFF
45 endif
47 # Avahi support in libiio requires avahi-client, which needs avahi-daemon
48 ifeq ($(BR2_PACKAGE_AVAHI)$(BR2_PACKAGE_AVAHI_DAEMON),yy)
49 LIBIIO_DEPENDENCIES += avahi
50 endif
52 ifeq ($(BR2_PACKAGE_LIBIIO_BINDINGS_PYTHON),y)
53 LIBIIO_DEPENDENCIES += python
54 LIBIIO_CONF_OPTS += -DPYTHON_BINDINGS=ON
55 else
56 LIBIIO_CONF_OPTS += -DPYTHON_BINDINGS=OFF
57 endif
59 ifeq ($(BR2_PACKAGE_LIBIIO_BINDINGS_CSHARP),y)
60 define LIBIIO_INSTALL_CSHARP_BINDINGS_TO_TARGET
61 rm $(TARGET_DIR)/usr/lib/cli/libiio-sharp-$(LIBIIO_VERSION)/libiio-sharp.dll.mdb
62 $(HOST_DIR)/usr/bin/gacutil -root $(TARGET_DIR)/usr/lib -i \
63 $(TARGET_DIR)/usr/lib/cli/libiio-sharp-$(LIBIIO_VERSION)/libiio-sharp.dll
64 endef
65 define LIBIIO_INSTALL_CSHARP_BINDINGS_TO_STAGING
66 $(HOST_DIR)/usr/bin/gacutil -root $(STAGING_DIR)/usr/lib -i \
67 $(STAGING_DIR)/usr/lib/cli/libiio-sharp-$(LIBIIO_VERSION)/libiio-sharp.dll
68 endef
69 LIBIIO_POST_INSTALL_TARGET_HOOKS += LIBIIO_INSTALL_CSHARP_BINDINGS_TO_TARGET
70 LIBIIO_POST_INSTALL_STAGING_HOOKS += LIBIIO_INSTALL_CSHARP_BINDINGS_TO_STAGING
71 LIBIIO_DEPENDENCIES += mono
72 LIBIIO_CONF_OPTS += -DCSHARP_BINDINGS=ON
73 else
74 LIBIIO_CONF_OPTS += -DCSHARP_BINDINGS=OFF
75 endif
77 ifeq ($(BR2_PACKAGE_LIBIIO_IIOD),y)
78 define LIBIIO_INSTALL_INIT_SYSV
79 $(INSTALL) -D -m 0755 package/libiio/S99iiod \
80 $(TARGET_DIR)/etc/init.d/S99iiod
81 endef
82 define LIBIIO_INSTALL_INIT_SYSTEMD
83 $(INSTALL) -d $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
84 $(INSTALL) -D -m 0644 $(@D)/debian/iiod.service \
85 $(TARGET_DIR)/usr/lib/systemd/system/iiod.service
86 ln -fs ../../../../usr/lib/systemd/system/iiod.service \
87 $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/iiod.service
88 endef
89 endif
91 $(eval $(cmake-package))