From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mediacenter.hi.pengutronix.de ([2001:6f8:1178:2::65]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1RWBJ4-000687-3W for ptxdist@pengutronix.de; Thu, 01 Dec 2011 19:24:26 +0100 Received: from mol by mediacenter.hi.pengutronix.de with local (Exim 4.72) (envelope-from ) id 1RWBJ4-0001PR-2X for ptxdist@pengutronix.de; Thu, 01 Dec 2011 19:24:26 +0100 Date: Thu, 1 Dec 2011 19:24:26 +0100 From: Michael Olbrich Message-ID: <20111201182426.GC32672@pengutronix.de> References: <1319226812-41219-1-git-send-email-andreas@biessmann.de> <1322181620-32914-1-git-send-email-andreas@biessmann.de> <1322181620-32914-3-git-send-email-andreas@biessmann.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1322181620-32914-3-git-send-email-andreas@biessmann.de> Subject: Re: [ptxdist] [PATCH v2 2/2] configure.ac: add check for GNU coreutils Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de On Fri, Nov 25, 2011 at 01:40:20AM +0100, Andreas Bie=DFmann wrote: > Some scripts require GNU coreutils (especially the -- argument split is > problematical on BSD systems). This patch adds a macro to detect GNU core= utils > version of these tools and utilizes the macro to check for the most impor= tant > tools which break the build on Mac OS X. > = > Signed-off-by: Andreas Bie=DFmann > --- > changes since v1: > * add m4 macro to check for GNU coreutils > * squash all previous checks into one patch > = > Makefile.in | 4 ++++ > configure.ac | 14 ++++++++++++++ > 2 files changed, 18 insertions(+), 0 deletions(-) > = > diff --git a/Makefile.in b/Makefile.in > index 62fabf6..ff55638 100644 > --- a/Makefile.in > +++ b/Makefile.in > @@ -78,6 +78,10 @@ install-environment: all dirty-check > @mkdir -p "$(DESTDIR)$(instdir)" > @mkdir -p $(DESTDIR)$(instdir)/bin > @ln -sf @SED@ $(DESTDIR)$(instdir)/bin/sed > + @ln -sf @GNU_chmod@ $(DESTDIR)$(instdir)/bin/chmod > + @ln -sf @GNU_mv@ $(DESTDIR)$(instdir)/bin/mv > + @ln -sf @GNU_rm@ $(DESTDIR)$(instdir)/bin/rm > + @ln -sf @GNU_md5sum@ $(DESTDIR)$(instdir)/bin/md5sum > = > dist: dirty-check > @rm -rf "$(project)" > 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=3D`$ac_path_gnu_$1 --version 2>/dev/null | $SED -ne "s/.*\(GNU\= ) coreutils.*/\1/p"` > + test "x$out" =3D xGNU && ac_cv_path_gnu_$1=3D$ac_path_gnu_$1 ac_path= _gnu_$1_found=3D:]], > + [AC_MSG_ERROR([could not find $1 from GNU coreutils])])]) > + AC_SUBST([GNU_$1], [$ac_cv_path_gnu_$1])]) I like it this way. We check for GNU coreutils, but if someone wants to force anything else, the cache variable can be used to overwrite. Michael > +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 -- = Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- = ptxdist mailing list ptxdist@pengutronix.de