[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: GNU enhancement -- $(xargs cmd, list)
From: |
Howard Chu |
Subject: |
RE: GNU enhancement -- $(xargs cmd, list) |
Date: |
Tue, 7 Nov 2000 01:19:26 -0800 |
I would omit the XARGS LEN. Presumably the local platform's xargs command is
already properly configured for the native system's line length limitations.
-- Howard Chu
Chief Architect, Symas Corp. Director, Highland Sun
http://www.symas.com http://highlandsun.com/hyc
> -----Original Message-----
> From: address@hidden [mailto:address@hidden Behalf Of
> Reid Madsen
> Sent: Monday, November 06, 2000 5:42 PM
> To: address@hidden
> Cc: address@hidden; address@hidden
> Subject: Re: GNU enhancement -- $(xargs cmd, list)
>
>
>
> > Date: 6 Nov 2000 16:56:30 -0600
> > From: Reid Madsen <address@hidden>
> >
> > I also thought about using the _POSIX_ARG_MAX and ARG_MAX
> symbols to determine
> > when the xargs approach was really needed. If the command
> line is within
> > limits, then
> >
> > $(xargs cmd, list)
> >
> > would expand to:
> >
> > cmd list
> >
> > Do you believe this is doable/portable?
> >
> > Reid
> >
> >
> > FYI, a quick perusal of our systems shows:
> >
> > POSIX_ARG_MAX ARG_MAX
> > ------------- -------
> > Solaris 4096 1MB
> > HP 4096 2MB
> > AIX 4096 24576 Pathetic!
> > OSF 4096 38912 Pathetic!
> > NT 4096 14500 Pathetic ** 2 !
> >
> > Gotta love those 2-4 byte per arg limits on AIX, OSF, and NT.
>
> After experimenting with this on Solaris for about 3 hours, I've
> come to the
> conclusion that this is way to complicated. The 'exec' man page
> states that
> the error E2BIG is returned when the sum of the command length
> and environment
> length exceeds ARG_MAX. So, armed with that information I when out and
> created a Makefile with enough big arguments to push it right up
> to the edge.
> Adding a single character would case make to fail with:
>
> make: execvp: num_args: Arg list too long
>
> However the 'edge' was nowhere close to the size of the command line +
> environment. It's off by about 100K. Yuck!
>
> So, instead, I've decided that in addtion to the $(XARGS) variable that
> GNUmake should also define a $(XARGS_LEN) variable. Which will be used to
> measure the length of the command line. When less the
> $(XARGS_LEN), then a
> normal command is launched, otherwise xargs is launched as"
>
> xargs -s $(XARGS_LEN) cmd << tmpfile
>
> In our build process, based on IMAKE, we can set XARGS_LEN
> differently for the
> different platforms we build on. IMO, this is probably the most flexible.
>
> If you have a better idea, I'd be glad to hear it.
>
> Reid
>
> --
> Reid Madsen address@hidden
>
> Senior Member, Tech. Staff (972) 536-3261 (Desk)
> I2 Technologies (214) 850-9613 (Cellular)
> --
> Making incrementally (without 'clean') since May 18, 2000.
> Long live incremental make!
>
> _______________________________________________
> Bug-make mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-make
>
- Re: GNU enhancement -- $(xargs cmd, list), (continued)
- Re: GNU enhancement -- $(xargs cmd, list), Reid Madsen, 2000/11/06
- RE: GNU enhancement -- $(xargs cmd, list), Howard Chu, 2000/11/06
- Re: GNU enhancement -- $(xargs cmd, list), Reid Madsen, 2000/11/06
- Re: GNU enhancement -- $(xargs cmd, list), Reid Madsen, 2000/11/06
- Re: GNU enhancement -- $(xargs cmd, list), Paul D. Smith, 2000/11/06
- Re: GNU enhancement -- $(xargs cmd, list), Reid Madsen, 2000/11/06
- Re: GNU enhancement -- $(xargs cmd, list), Paul D. Smith, 2000/11/06
- Re: GNU enhancement -- $(xargs cmd, list), Reid Madsen, 2000/11/06
- RE: GNU enhancement -- $(xargs cmd, list), Howard Chu, 2000/11/06
Re: GNU enhancement -- $(xargs cmd, list), Reid Madsen, 2000/11/06
- RE: GNU enhancement -- $(xargs cmd, list),
Howard Chu <=
Re: GNU enhancement -- $(xargs cmd, list), Reid Madsen, 2000/11/08
Re: GNU enhancement -- $(xargs cmd, list), Reid Madsen, 2000/11/08