mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] configure.ac: Check for GNU tar
@ 2012-02-26 18:44 Bernhard Walle
  0 siblings, 0 replies; only message in thread
From: Bernhard Walle @ 2012-02-26 18:44 UTC (permalink / raw)
  To: ptxdist

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-02-26 18:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-26 18:44 [ptxdist] [PATCH] configure.ac: Check for GNU tar Bernhard Walle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox