mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Bernhard Walle <bernhard@bwalle.de>
To: ptxdist@pengutronix.de
Subject: [ptxdist] [PATCH] configure.ac: Check for GNU tar
Date: Sun, 26 Feb 2012 19:44:28 +0100	[thread overview]
Message-ID: <1330281868-14434-1-git-send-email-bernhard@bwalle.de> (raw)

ptxd_make_world_extract uses the option --remove-files which is a GNU
extension to tar.

Because GNU tar is not in GNU coreutils, I changed the GNU_COREUTILS
macro to GNU_TOOL and added a second parameter: the package where the
tool is found. I think that's better than providing a new macro just for
GNU tar.

Signed-off-by: Bernhard Walle <bernhard@bwalle.de>
---
 Makefile.in  |    2 +-
 configure.ac |   41 +++++++++++++++++++----------------------
 2 files changed, 20 insertions(+), 23 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 0c05294..b976a3f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -53,9 +53,9 @@ environment:
 	@ln -sf @GNU_install@ "$(abs_srcdir)/bin/install"
 	@ln -sf @GNU_stat@ "$(abs_srcdir)/bin/stat"
 	@ln -sf @GNU_mknod@ "$(abs_srcdir)/bin/mknod"
+	@ln -sf @GNU_tar@ "$(abs_srcdir)/bin/tar"
 	@ln -sf @PYTHON@ "$(abs_srcdir)/bin/python"
 	@ln -sf @SED@ "$(abs_srcdir)/bin/sed"
-	@ln -sf @TAR@ "$(abs_srcdir)/bin/tar"
 	@echo " done"
 
 clean:
diff --git a/configure.ac b/configure.ac
index ca06879..37a01ae 100644
--- a/configure.ac
+++ b/configure.ac
@@ -133,26 +133,29 @@ 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],
+dnl check for gnu tools
+dnl   $1: tool to search for
+dnl   $2: package where the tool is (e.g. 'coreutils')
+AC_DEFUN([GNU_TOOL],
+	[AC_CACHE_CHECK([for GNU $1], [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"`
+			[[out=`$ac_path_gnu_$1 --version 2>/dev/null | $SED -ne "s/.*\(GNU\) $2.*/\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_MSG_ERROR([could not find GNU $1])])])
 	AC_SUBST([GNU_$1], [$ac_cv_path_gnu_$1])])
 
-GNU_COREUTILS(chmod)
-GNU_COREUTILS(chown)
-GNU_COREUTILS(mv)
-GNU_COREUTILS(cp)
-GNU_COREUTILS(rm)
-GNU_COREUTILS(rmdir)
-GNU_COREUTILS(md5sum)
-GNU_COREUTILS(mkdir)
-GNU_COREUTILS(install)
-GNU_COREUTILS(stat)
-GNU_COREUTILS(mknod)
+GNU_TOOL(chmod, coreutils)
+GNU_TOOL(chown, coreutils)
+GNU_TOOL(mv, coreutils)
+GNU_TOOL(cp, coreutils)
+GNU_TOOL(rm, coreutils)
+GNU_TOOL(rmdir, coreutils)
+GNU_TOOL(md5sum, coreutils)
+GNU_TOOL(mkdir, coreutils)
+GNU_TOOL(install, coreutils)
+GNU_TOOL(stat, coreutils)
+GNU_TOOL(mknod, coreutils)
+GNU_TOOL(tar, tar)
 
 dnl Check for egrep
 AC_PROG_EGREP
@@ -261,12 +264,6 @@ if test -z "$WGET"; then
 	AC_MSG_ERROR([wget could not be found, please install])
 fi
 
-dnl Check for tar
-AC_PATH_PROGS(TAR, tar,, $PATH)
-if test -z "$TAR"; then
-	AC_MSG_ERROR([tar could not be found, please install])
-fi
-
 dnl Check for dirname
 AC_PATH_PROGS(DIRNAME, dirname,, $PATH)
 if test -z "$DIRNAME"; then
-- 
1.7.9


-- 
ptxdist mailing list
ptxdist@pengutronix.de

                 reply	other threads:[~2012-02-26 18:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1330281868-14434-1-git-send-email-bernhard@bwalle.de \
    --to=bernhard@bwalle.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