From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from smtprelay02.ispgateway.de ([80.67.18.44]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1S1j5C-0003RK-Qz for ptxdist@pengutronix.de; Sun, 26 Feb 2012 19:44:32 +0100 Received: from [88.217.117.217] (helo=localhost) by smtprelay02.ispgateway.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1S1j5C-0005as-8o for ptxdist@pengutronix.de; Sun, 26 Feb 2012 19:44:30 +0100 From: Bernhard Walle Date: Sun, 26 Feb 2012 19:44:28 +0100 Message-Id: <1330281868-14434-1-git-send-email-bernhard@bwalle.de> Subject: [ptxdist] [PATCH] configure.ac: Check for GNU tar Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de 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 --- 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