From patchwork Tue Sep 2 12:08:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 385121 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 52BC714017C for ; Tue, 2 Sep 2014 22:24:22 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 37A2B9A1B2; Tue, 2 Sep 2014 12:24:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GyXhmBP449Fp; Tue, 2 Sep 2014 12:24:21 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 7A2A18B781; Tue, 2 Sep 2014 12:24:21 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 48D721C21D1 for ; Tue, 2 Sep 2014 12:24:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 426F08D269 for ; Tue, 2 Sep 2014 12:24:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xx2k+LfBvs+Q for ; Tue, 2 Sep 2014 12:24:19 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2lp0244.outbound.protection.outlook.com [207.46.163.244]) by whitealder.osuosl.org (Postfix) with ESMTPS id 249E38CD98 for ; Tue, 2 Sep 2014 12:24:19 +0000 (UTC) Received: from BN3PR0301CA0008.namprd03.prod.outlook.com (25.160.180.146) by CH1PR03MB598.namprd03.prod.outlook.com (10.255.156.163) with Microsoft SMTP Server (TLS) id 15.0.1015.19; Tue, 2 Sep 2014 12:09:23 +0000 Received: from BL2FFO11FD025.protection.gbl (2a01:111:f400:7c09::131) by BN3PR0301CA0008.outlook.office365.com (2a01:111:e400:4000::18) with Microsoft SMTP Server (TLS) id 15.0.1019.16 via Frontend Transport; Tue, 2 Sep 2014 12:09:23 +0000 Received: from nwd2mta1.analog.com (137.71.25.55) by BL2FFO11FD025.mail.protection.outlook.com (10.173.161.104) with Microsoft SMTP Server (TLS) id 15.0.1010.11 via Frontend Transport; Tue, 2 Sep 2014 12:09:23 +0000 Received: from NWD2HUBCAS8.ad.analog.com (nwd2hubcas8.ad.analog.com [10.64.72.141]) by nwd2mta1.analog.com (8.13.8/8.13.8) with ESMTP id s82C8jdP029789 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL) for ; Tue, 2 Sep 2014 05:08:46 -0700 Received: from zeus.spd.analog.com (10.64.82.11) by NWD2HUBCAS8.ad.analog.com (10.64.72.141) with Microsoft SMTP Server id 14.3.158.1; Tue, 2 Sep 2014 08:08:42 -0400 Received: from carl.analog.com ([10.44.2.210]) by zeus.spd.analog.com (8.14.6/8.14.6) with ESMTP id s82C8ehH023163; Tue, 2 Sep 2014 08:08:40 -0400 From: Paul Cercueil To: Date: Tue, 2 Sep 2014 14:08:27 +0200 Message-ID: <1409659707-5297-1-git-send-email-paul.cercueil@analog.com> X-Mailer: git-send-email 2.1.0 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:137.71.25.55; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(6009001)(189002)(199003)(106466001)(6806004)(95666004)(110136001)(33646002)(20776003)(85306004)(62966002)(21056001)(105606002)(99396002)(102836001)(31966008)(47776003)(46102001)(83322001)(53416004)(50986999)(64706001)(77156001)(19580395003)(50466002)(88136002)(77982001)(92566001)(36756003)(87936001)(93916002)(85852003)(229853001)(4396001)(48376002)(80022001)(107046002)(81542001)(50226001)(89996001)(81342001)(74502001)(15975445006)(15202345003)(79102001)(19580405001)(104166001)(86362001)(87286001)(2351001)(74662001)(90102001)(83072002)(92726001)(76482001)(44976005); DIR:OUT; SFP:; SCL:1; SRVR:CH1PR03MB598; H:nwd2mta1.analog.com; FPR:; MLV:sfv; PTR:nwd2mail10.analog.com; MX:1; A:1; LANG:en; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;UriScan:; X-Forefront-PRVS: 0322B4EDE1 Received-SPF: Fail (protection.outlook.com: domain of analog.com does not designate 137.71.25.55 as permitted sender) receiver=protection.outlook.com; client-ip=137.71.25.55; helo=nwd2mta1.analog.com; Authentication-Results: spf=fail (sender IP is 137.71.25.55) smtp.mailfrom=Paul.Cercueil@analog.com; X-OriginatorOrg: analog.com Cc: Paul Cercueil Subject: [Buildroot] [PATCH] libiio: Added package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Libiio is a library to ease the development of software interfacing Linux Industrial I/O (IIO) devices. http://wiki.analog.com/resources/tools-software/linux-software/libiio Signed-off-by: Paul Cercueil --- package/Config.in | 1 + package/libiio/Config.in | 41 +++++++++++++++++++++++++ package/libiio/libiio.mk | 79 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 121 insertions(+) create mode 100644 package/libiio/Config.in create mode 100644 package/libiio/libiio.mk diff --git a/package/Config.in b/package/Config.in index 883dd66..b67d95d 100644 --- a/package/Config.in +++ b/package/Config.in @@ -664,6 +664,7 @@ menu "Hardware handling" source "package/libfreefare/Config.in" source "package/libftdi/Config.in" source "package/libhid/Config.in" + source "package/libiio/Config.in" source "package/libinput/Config.in" source "package/libiqrf/Config.in" source "package/libllcp/Config.in" diff --git a/package/libiio/Config.in b/package/libiio/Config.in new file mode 100644 index 0000000..347269c --- /dev/null +++ b/package/libiio/Config.in @@ -0,0 +1,41 @@ +config BR2_PACKAGE_LIBIIO + bool "libiio" + help + Libiio is a library to ease the development of software interfacing + Linux Industrial I/O (IIO) devices. + + http://wiki.analog.com/resources/tools-software/linux-software/libiio + +if BR2_PACKAGE_LIBIIO + config BR2_PACKAGE_LIBIIO_LOCAL_BACKEND + bool "Local backend" + default y + help + Enable the local backend of the library. + + config BR2_PACKAGE_LIBIIO_NETWORK_BACKEND + bool "Network backend" + select BR2_PACKAGE_LIBXML2 + default y + help + Enable the network backend of the library. + + config BR2_PACKAGE_LIBIIO_IIOD + bool "IIO Daemon" + select BR2_PACKAGE_LIBIIO_LOCAL_BACKEND + depends on BR2_TOOLCHAIN_HAS_THREADS + default y + help + Install the IIO Daemon. + + comment "IIO Daemon needs a toolchain w/ threads" + depends on !BR2_TOOLCHAIN_HAS_THREADS + + config BR2_PACKAGE_LIBIIO_TESTS + bool "Install test programs" + select BR2_PACKAGE_LIBIIO_LOCAL_BACKEND + select BR2_PACKAGE_LIBIIO_NETWORK_BACKEND + default n + help + Install the test programs (iio_info, iio_genxml, iio_readdev). +endif diff --git a/package/libiio/libiio.mk b/package/libiio/libiio.mk new file mode 100644 index 0000000..7ea9c25 --- /dev/null +++ b/package/libiio/libiio.mk @@ -0,0 +1,79 @@ +################################################################################ +# +# libiio +# +################################################################################ + +LIBIIO_VERSION = 2014_R1 +LIBIIO_SITE = $(call github,analogdevicesinc,libiio,$(LIBIIO_VERSION)) +LIBIIO_INSTALL_STAGING = YES +LIBIIO_LICENSE = LGPLv2 +LIBIIO_LICENSE_FILES = COPYING + +LIBIIO_CONFIGURE_OPTS = CROSS_COMPILE=$(TARGET_CROSS) \ + VERSION_GIT=$(LIBIIO_VERSION) + +# Avahi support in libiio requires avahi-client, +# which needs avahi-daemon and dbus +ifeq ($(BR2_PACKAGE_AVAHI)$(BR2_PACKAGE_AVAHI_DAEMON)$(BR2_PACKAGE_DBUS),yyy) + LIBIIO_DEPENDENCIES += avahi +else + LIBIIO_CONFIGURE_OPTS += WITH_AVAHI=no +endif + +ifneq ($(BR2_PACKAGE_LIBIIO_LOCAL_BACKEND),y) + LIBIIO_CONFIGURE_OPTS += WITH_LOCAL_BACKEND=no +endif + +ifeq ($(BR2_PACKAGE_LIBIIO_NETWORK_BACKEND),y) + LIBIIO_DEPENDENCIES += libxml2 +else + LIBIIO_CONFIGURE_OPTS += WITH_NETWORK_BACKEND=no +endif + +# Libiio can run without threads +ifneq ($(BR2_TOOLCHAIN_HAS_THREADS),y) + LIBIIO_CONFIGURE_OPTS += WITH_PTHREAD=no +endif + +ifeq ($(BR2_PACKAGE_LIBIIO_IIOD),y) +define LIBIIO_BUILD_IIOD + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/iiod $(LIBIIO_CONFIGURE_OPTS) +endef + LIBIIO_POST_BUILD_HOOKS += LIBIIO_BUILD_IIOD + +define LIBIIO_INSTALL_IIOD + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/iiod install \ + $(LIBIIO_CONFIGURE_OPTS) DESTDIR=$(TARGET_DIR) +endef + LIBIIO_POST_INSTALL_TARGET_HOOKS += LIBIIO_INSTALL_IIOD +endif + +ifeq ($(BR2_PACKAGE_LIBIIO_TESTS),y) +define LIBIIO_BUILD_TESTS + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/tests $(LIBIIO_CONFIGURE_OPTS) +endef + LIBIIO_POST_BUILD_HOOKS += LIBIIO_BUILD_TESTS + +define LIBIIO_INSTALL_TESTS + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/tests install \ + $(LIBIIO_CONFIGURE_OPTS) DESTDIR=$(TARGET_DIR) +endef + LIBIIO_POST_INSTALL_TARGET_HOOKS += LIBIIO_INSTALL_TESTS +endif + +define LIBIIO_BUILD_CMDS + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) libiio $(LIBIIO_CONFIGURE_OPTS) +endef + +define LIBIIO_INSTALL_STAGING_CMDS + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install-sysroot \ + $(LIBIIO_CONFIGURE_OPTS) DESTDIR=$(STAGING_DIR) +endef + +define LIBIIO_INSTALL_TARGET_CMDS + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install-lib \ + $(LIBIIO_CONFIGURE_OPTS) DESTDIR=$(TARGET_DIR) +endef + +$(eval $(generic-package))