mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: "Andreas Bießmann" <andreas@biessmann.de>
To: PTXdist ML <ptxdist@pengutronix.de>
Cc: "Andreas Bießmann" <andreas@biessmann.de>
Subject: [ptxdist] [PATCH v3 2/4] configure.ac: add check for GNU coreutils
Date: Fri,  2 Dec 2011 00:30:27 +0100	[thread overview]
Message-ID: <1322782229-35704-3-git-send-email-andreas@biessmann.de> (raw)
In-Reply-To: <1322782229-35704-1-git-send-email-andreas@biessmann.de>
In-Reply-To: <1322181620-32914-1-git-send-email-andreas@biessmann.de>

Some scripts require GNU coreutils (especially the -- argument split is
problematical on some BSD systems).
This patch adds a macro to detect GNU coreutils version of these tools.

Signed-off-by: Andreas Bießmann <andreas@biessmann.de>
---
changes since v1:
 * add m4 macro to check for GNU coreutils
 * squash all previous checks into one patch

no changes since v2

 Makefile.in  |    9 ++++++++-
 configure.ac |   14 ++++++++++++++
 2 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 01d1a87..0014c78 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -41,12 +41,20 @@ kconfig:
 environment:
 	@echo -n "preparing PTXdist environment ..."
 	@ln -sf @SED@ $(abs_srcdir)/bin/sed
+	@ln -sf @GNU_chmod@ $(abs_srcdir)/bin/chmod
+	@ln -sf @GNU_mv@ $(abs_srcdir)/bin/mv
+	@ln -sf @GNU_rm@ $(abs_srcdir)/bin/rm
+	@ln -sf @GNU_md5sum@ $(abs_srcdir)/bin/md5sum
 	@echo " done"
 	@touch .done
 
 clean:
 	@rm -f .done
 	@rm -f $(abs_srcdir)/bin/sed
+	@rm -f $(abs_srcdir)/bin/chmod
+	@rm -f $(abs_srcdir)/bin/mv
+	@rm -f $(abs_srcdir)/bin/rm
+	@rm -f $(abs_srcdir)/bin/md5sum
 	@$(MAKE) -C "$(abs_srcdir)/scripts/kconfig" clean
 
 dirty-check:
@@ -82,7 +90,6 @@ install: all dirty-check
 		cp scripts/bash_completion "$(DESTDIR)@BASH_COMPLETION_DIR@/ptxdist"; \
 	fi
 
-
 dist: dirty-check
 	@rm -rf "$(project)"
 	@git archive "$(project)" --prefix="$(project)"/ > "${project}.tar"
diff --git a/configure.ac b/configure.ac
index 7a34e7a..3044188 100644
--- a/configure.ac
+++ b/configure.ac
@@ -133,6 +133,20 @@ case "$SED_VERSION" in
 esac
 AC_MSG_RESULT([$SED_VERSION])
 
+dnl check for gnu coreutils
+AC_DEFUN([GNU_COREUTILS],
+	[AC_CACHE_CHECK([for $1 from GNU coreutils], [ac_cv_path_gnu_$1],
+		[AC_PATH_PROGS_FEATURE_CHECK([gnu_$1], [g$1 $1.gnu $1],
+			[[out=`$ac_path_gnu_$1 --version 2>/dev/null | $SED -ne "s/.*\(GNU\) coreutils.*/\1/p"`
+				test "x$out" = xGNU && ac_cv_path_gnu_$1=$ac_path_gnu_$1 ac_path_gnu_$1_found=:]],
+			[AC_MSG_ERROR([could not find $1 from GNU coreutils])])])
+	AC_SUBST([GNU_$1], [$ac_cv_path_gnu_$1])])
+
+GNU_COREUTILS(chmod)
+GNU_COREUTILS(mv)
+GNU_COREUTILS(rm)
+GNU_COREUTILS(md5sum)
+
 dnl Check for egrep
 AC_PROG_EGREP
 
-- 
1.7.7.4


-- 
ptxdist mailing list
ptxdist@pengutronix.de

  parent reply	other threads:[~2011-12-01 23:30 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-21 19:53 [ptxdist] [PATCH 0/5] add install-environment Andreas Bießmann
2011-10-21 19:53 ` [ptxdist] [PATCH 1/5] " Andreas Bießmann
2011-10-21 19:53 ` [ptxdist] [PATCH 2/5] configure.ac: add check for chmod from GNU coreutils Andreas Bießmann
2011-10-27 15:10   ` Michael Olbrich
2011-10-21 19:53 ` [ptxdist] [PATCH 3/5] configure.ac: add check for mv " Andreas Bießmann
2011-10-21 19:53 ` [ptxdist] [PATCH 4/5] configrue.ac: add check for rm " Andreas Bießmann
2011-10-21 19:53 ` [ptxdist] [PATCH 5/5] configrue.ac: add check for md5sum " Andreas Bießmann
2011-11-25  0:40 ` [ptxdist] [PATCH v2 0/2] add install-environment Andreas Bießmann
2011-11-25  0:40   ` [ptxdist] [PATCH v2 1/2] " Andreas Bießmann
2011-12-01 18:22     ` Michael Olbrich
2011-12-01 22:11       ` Andreas Bießmann
2011-11-25  0:40   ` [ptxdist] [PATCH v2 2/2] configure.ac: add check for GNU coreutils Andreas Bießmann
2011-12-01 18:24     ` Michael Olbrich
2011-12-01 23:30   ` [ptxdist] [PATCH v3 0/4] add environment Andreas Bießmann
2011-12-02  7:51     ` [ptxdist] [PATCH v4 " Andreas Bießmann
2011-12-02 15:27       ` Michael Olbrich
2011-12-02  7:51     ` [ptxdist] [PATCH v4 1/4] add environment make target Andreas Bießmann
2011-12-02  7:51     ` [ptxdist] [PATCH v4 2/4] configure.ac: add check for GNU coreutils Andreas Bießmann
2011-12-02  7:51     ` [ptxdist] [PATCH v4 3/4] add awk to environment Andreas Bießmann
2011-12-02  7:51     ` [ptxdist] [PATCH v4 4/4] add python " Andreas Bießmann
2011-12-01 23:30   ` [ptxdist] [PATCH v3 1/4] add environment make target Andreas Bießmann
2011-12-01 23:41     ` Andreas Bießmann
2011-12-01 23:30   ` Andreas Bießmann [this message]
2011-12-01 23:30   ` [ptxdist] [PATCH v3 3/4] add awk to environment Andreas Bießmann
2011-12-01 23:30   ` [ptxdist] [PATCH v3 4/4] add python " Andreas Bießmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1322782229-35704-3-git-send-email-andreas@biessmann.de \
    --to=andreas@biessmann.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox