From patchwork Mon Jun 11 13:47:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ga=C3=ABl_PORTAY?= X-Patchwork-Id: 927674 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=savoirfairelinux.com Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 414DqQ4Bd6z9rxs for ; Mon, 11 Jun 2018 23:48:01 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 678E28914D; Mon, 11 Jun 2018 13:47:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yTzqZP3arlJu; Mon, 11 Jun 2018 13:47:59 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id EA7C9890D4; Mon, 11 Jun 2018 13:47:58 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 4D6671C2197 for ; Mon, 11 Jun 2018 13:47:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 4AECB890D4 for ; Mon, 11 Jun 2018 13:47:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vZY+JW4JIH0M for ; Mon, 11 Jun 2018 13:47:55 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by hemlock.osuosl.org (Postfix) with ESMTPS id 45A8B88D19 for ; Mon, 11 Jun 2018 13:47:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 5E6D49C1B84; Mon, 11 Jun 2018 09:47:53 -0400 (EDT) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id Lr6GxfpFqKJx; Mon, 11 Jun 2018 09:47:52 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 7E6DF9C3016; Mon, 11 Jun 2018 09:47:52 -0400 (EDT) X-Virus-Scanned: amavisd-new at mail.savoirfairelinux.com Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id c0TPvgWYQ0Ax; Mon, 11 Jun 2018 09:47:52 -0400 (EDT) Received: from t1000.mtl.sfl (unknown [192.168.50.190]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 5860B9C1B84; Mon, 11 Jun 2018 09:47:52 -0400 (EDT) From: =?utf-8?q?Ga=C3=ABl_PORTAY?= To: buildroot@buildroot.org Date: Mon, 11 Jun 2018 09:47:50 -0400 Message-Id: <20180611134750.27627-1-gael.portay@savoirfairelinux.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v3] libusb: add an option to compile examples X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Ga=C3=ABl_PORTAY?= Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Gaƫl PORTAY --- Changes since v1: - remove presence check. Changes since v2: - fix typo in list of examples package/libusb/Config.in | 7 +++++++ package/libusb/libusb.mk | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/package/libusb/Config.in b/package/libusb/Config.in index 5238588aa8..d31a717fdf 100644 --- a/package/libusb/Config.in +++ b/package/libusb/Config.in @@ -6,5 +6,12 @@ config BR2_PACKAGE_LIBUSB http://libusb.info/ +if BR2_PACKAGE_LIBUSB + +config BR2_PACKAGE_LIBUSB_EXAMPLES + bool "build libusb examples" + +endif + comment "libusb needs a toolchain w/ threads" depends on !BR2_TOOLCHAIN_HAS_THREADS diff --git a/package/libusb/libusb.mk b/package/libusb/libusb.mk index aee3622f8d..32f15c9612 100644 --- a/package/libusb/libusb.mk +++ b/package/libusb/libusb.mk @@ -25,5 +25,15 @@ else LIBUSB_CONF_OPTS += --disable-udev endif +ifeq ($(BR2_PACKAGE_LIBUSB_EXAMPLES),y) +LIBUSB_CONF_OPTS += --enable-examples-build +define LIBUSB_INSTALL_TARGET_EXAMPLES + for example in listdevs xusb fxload hotplugtest testlibusb dpfp dpfp_threaded sam3u_benchmark ; do \ + cp -dpfr $(@D)/examples/$${example} $(TARGET_DIR)/usr/bin; \ + done +endef +LIBUSB_POST_INSTALL_TARGET_HOOKS += LIBUSB_INSTALL_TARGET_EXAMPLES +endif + $(eval $(autotools-package)) $(eval $(host-autotools-package))