I'm never planning on doing that.
I will be installing software using modules, and the dependency stuff must
use the modules framework for seeing what is available.
So in my case I need to do a suitable "module avail gmake" and see if there
is at least 3.79 available.
H
--
> Parsing the output of 'gmake --version' isn't going to be easy if Mr Stallman
> keeps changing the format of the version blurb. You could change the regexp t
> o
>
> /gnu make (?:version )?(\S+)/i
>
> To solve the version numbering scheme problem, you can use the 'v' notation a
> nd
> string comparisons. example:
>
> $v = eval "v$1"; die if (($v cmp v3.78.6) < 0);
>
>
> (of course, double up the $ if you put this in a makefile)
>
> The "v" notation is only available in perl 5.6.0 and after. It creates a stri
> ng
> of bytes (so it won't be useful for TeX's version counting...). It is useful
> for generating IPv4 addresses too.
>
> -Mark
>
>
> Mark Lakata, Staff Engineer 1225 Charleston Road voice 650-567-5170
> MIPS Technologies Mountain View CA 94043 fax 650-567-5002
>
> On Thu, 5 Jun 2003, Ted Stern wrote:
>
> > On 4 Jun 2003, Mark Lakata wrote:
> > >
> > > Makefile.versiondep: FORCE
> > > @(perl -e '($$v) = `gmake --version` =~/version (\S+),/; die "old
> > > make detected, found $v, need 3.78\n" if $$v < 3.78' && touch $@ ) || ( r
> m
> > > -f $@; false )
> >
> > The perl arithmetic comparison is fragile -- what about GNU make version li
> nes
> > that return as follows?
> >
> > GNU make 3.80
> > GNU Make version 3.79.1
> >
> > Ted
> > --
> > Ted Stern Applications Group
> > Cray Inc. office: 206-701-2182
> > 411 First Avenue South, Suite 600 cell: 206-383-1049
> > Seattle, WA 98104-2860 FAX: 206-701-2500
> >
> > Frango ut patefaciam -- I break that I may reveal
> > (The Paleontological Society motto, equally apropos for debugging)
> >
|