bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 'Argument list too long' in non-recursive setup


From: Paolo Bonzini
Subject: Re: 'Argument list too long' in non-recursive setup
Date: Thu, 30 Jul 2009 08:41:52 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Lightning/1.0pre Thunderbird/3.0b2

I'll take this up with bug-make.  Thank you again for bringing it up.

GCC has this:

# write_entries_to_file - writes each entry in a list
# to the specified file.  Entries are written in chunks of
# $(write_entries_to_file_split) to accomodate systems with
# severe command-line-length limitations.
# Parameters:
# $(1): variable containing entries to iterate over
# $(2): output file
write_entries_to_file_split = 50
write_entries_to_file = $(shell rm -f $(2) || :) $(shell touch $(2)) \
  $(foreach range, \
   $(shell i=1; while test $$i -le $(words $(1)); do \
     echo $$i; i=`expr $$i + $(write_entries_to_file_split)`; done), \
   $(shell echo $(wordlist $(range), \
    $(shell expr $(range) + $(write_entries_to_file_split) - 1), $(1)) \
     | tr ' ' '\n' >> $(2)))


Maybe you can unfunctionize it and do something like

write_entries_to_file = echo $(DISTFILES) | tr ' ' '\n' > DISTFILES.list

write_entries_to_file_split = 50
write_entries_to_file_gnu = $(shell :>dist.lst) \
  $(foreach range, \
   $(shell i=1; while test $$i -le $(words $(DISTFILES)); do \
     echo $$i; i=`expr $$i + $(write_entries_to_file_split)`; done), \
   $(shell echo $(wordlist $(range), \
    $(shell expr $(range) + $(write_entries_to_file_split) - 1),
    $(DISTFILES)) \
     | tr ' ' '\n' >> dist.lst))

# Hoping non-GNU make does nothing with this???  Surely GNU make
# expands unknown function to nothing...
$(eval write_entries_to_file = $$(write_entries_to_file_gnu))

distdir: $(DISTFILES) dist.lst
        ...
        dist_files=`cat dist.lst`
        ...

DISTFILES.list: Makefile
        $(write_entries_to_file)

?

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]