From patchwork Thu Sep 3 04:10:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baruch Siach X-Patchwork-Id: 513795 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id F01A8140082 for ; Thu, 3 Sep 2015 14:11:45 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 4CE1A33678; Thu, 3 Sep 2015 04:11:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fxDiFowV1-8l; Thu, 3 Sep 2015 04:11:35 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 1BAAC33610; Thu, 3 Sep 2015 04:11:34 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 0E4D01C1EA2 for ; Thu, 3 Sep 2015 04:11:31 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 092D1915FC for ; Thu, 3 Sep 2015 04:11:31 +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 D90VQjM7KmaM for ; Thu, 3 Sep 2015 04:11:28 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx.tkos.co.il (guitar.tcltek.co.il [192.115.133.116]) by whitealder.osuosl.org (Postfix) with ESMTPS id 7622391693 for ; Thu, 3 Sep 2015 04:11:28 +0000 (UTC) Received: from tarshish.tkos.co.il (unknown [10.0.8.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mx.tkos.co.il (Postfix) with ESMTPSA id 880E5440861; Thu, 3 Sep 2015 07:11:25 +0300 (IDT) From: Baruch Siach To: buildroot@busybox.net Date: Thu, 3 Sep 2015 07:10:50 +0300 Message-Id: <35a5aad580e5c2cae7eb79522f11a1aded941caf.1441253454.git.baruch@tkos.co.il> X-Mailer: git-send-email 2.5.0 Cc: James Knight Subject: [Buildroot] [PATCH v3 1/5] dos2unix: add target support X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: James Knight Allow the `dos2unix` utility to be built and installed on the target system. [baruch: properly handle target gettext] Signed-off-by: James Knight Signed-off-by: Baruch Siach Reviewed-by: Vicente Olivert Riera Tested-by: Vicente Olivert Riera --- v3: * Show only if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS is enabled (Peter) * Add busybox to _DEPENDENCIES v2: * Fix static build with gettext * Support build without locale support --- package/Config.in | 1 + package/dos2unix/Config.in | 11 +++++++++++ package/dos2unix/dos2unix.mk | 25 ++++++++++++++++++++++--- 3 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 package/dos2unix/Config.in diff --git a/package/Config.in b/package/Config.in index 6ba21a1aace8..2c1325af31c5 100644 --- a/package/Config.in +++ b/package/Config.in @@ -115,6 +115,7 @@ menu "Development tools" source "package/cvs/Config.in" if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS source "package/diffutils/Config.in" + source "package/dos2unix/Config.in" source "package/findutils/Config.in" endif source "package/flex/Config.in" diff --git a/package/dos2unix/Config.in b/package/dos2unix/Config.in new file mode 100644 index 000000000000..fdcd0700509b --- /dev/null +++ b/package/dos2unix/Config.in @@ -0,0 +1,11 @@ +config BR2_PACKAGE_DOS2UNIX + select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE + depends on BR2_USE_WCHAR # gettext + bool "dos2unix" + help + dos2unix converts text file line endings between CRLF and LF + + http://freshmeat.net/projects/dos2unix + +comment "dos2unix needs a toolchain w/ wchar" + depends on !BR2_USE_WCHAR diff --git a/package/dos2unix/dos2unix.mk b/package/dos2unix/dos2unix.mk index 2d7fcbbc6958..b1d21f27364d 100644 --- a/package/dos2unix/dos2unix.mk +++ b/package/dos2unix/dos2unix.mk @@ -6,17 +6,36 @@ DOS2UNIX_VERSION = 7.0 DOS2UNIX_SITE = http://waterlan.home.xs4all.nl/dos2unix -DOS2UNIX_DEPENDENCIES = host-gettext DOS2UNIX_LICENSE = BSD-2c DOS2UNIX_LICENSE_FILES = COPYING.txt +DOS2UNIX_DEPENDENCIES = $(if $(BR2_PACKAGE_BUSYBOX),busybox) +HOST_DOS2UNIX_DEPENDENCIES = host-gettext + +ifeq ($(BR2_ENABLE_LOCALE),) +DOS2UNIX_MAKE_OPTS += ENABLE_NLS= +endif + +ifeq ($(BR2_NEEDS_GETTEXT_IF_LOCALE),y) +DOS2UNIX_DEPENDENCIES += gettext +DOS2UNIX_MAKE_OPTS += LIBS_EXTRA=-lintl +endif + +define DOS2UNIX_BUILD_CMDS + $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) $(DOS2UNIX_MAKE_OPTS) +endef + +define DOS2UNIX_INSTALL_TARGET_CMDS + $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) \ + $(DOS2UNIX_MAKE_OPTS) install +endef define HOST_DOS2UNIX_BUILD_CMDS $(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) endef define HOST_DOS2UNIX_INSTALL_CMDS - $(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) \ - install DESTDIR=$(HOST_DIR) + $(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) DESTDIR=$(HOST_DIR) install endef +$(eval $(generic-package)) $(eval $(host-generic-package))