Parallel automake execution: AUTOMAKE_JOBS.
commit937775c8efa56c28891748aa75ab540a7a884315
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 26 Oct 2008 18:29:25 +0000 (26 19:29 +0100)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 26 Oct 2008 18:35:07 +0000 (26 19:35 +0100)
tree254db483a73695dafc72fa661469af14060845f7
parent2b85923e0b06f7f633b7f9f18bdec2b16ec5d958
Parallel automake execution: AUTOMAKE_JOBS.

* lib/Automake/Config.in (perl_threads): New global.
* automake.in: Use it.  If the perl supports interpreter-based
threading, then use `threads' and `Thread::Queue'.
(handle_makefile, handle_makefiles_serial): New functions,
factored out from main.
(get_number_of_threads): New function, compute number of threads
to use, based on environment variable `AUTOMAKE_JOBS' and number
of independent makefiles.
(handle_makefiles_threaded): New function.  Spawn threads, use
thread queue to distribute handling the different makefiles.
Collect $exit_code values from threads.
(main): Use new functions.
* aclocal.in: No threads here.
* configure.ac: Substitute PERL_THREADS; enabled with perl >=
5.7.2 and when ithreads are available.
* bootstrap (dosubst): Likewise.
* Makefile.am (do_subst): Likewise.
* lib/Automake/Makefile.am (do_subst): Likewise.
* lib/Automake/ChannelDefs.pm: Use `Automake::Config' and
`threads'.
(verb): Prepend thread ID (tid) to verbose messages.
* lib/Automake/Channels.pm (msg): Before exiting, flush stderr,
needed for worker threads.
* lib/Automake/tests/Makefile.am (TESTS_ENVIRONMENT): Also
include the build tree path, so Config.pm is found.
* tests/parallel-am.test: New test.
* tests/Makefile.am: Update.
* doc/automake.texi (Invoking Automake): Document AUTOMAKE_JOBS.
* NEWS, THANKS: Update.
Report about long execution times by Joakim Tjernlund and others.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
25 files changed:
ChangeLog
Makefile.am
Makefile.in
NEWS
THANKS
aclocal.in
automake.in
bootstrap
configure
configure.ac
doc/Makefile.in
doc/automake.texi
lib/Automake/ChannelDefs.pm
lib/Automake/Channels.pm
lib/Automake/Config.in
lib/Automake/Makefile.am
lib/Automake/Makefile.in
lib/Automake/tests/Makefile.am
lib/Automake/tests/Makefile.in
lib/Makefile.in
lib/am/Makefile.in
m4/Makefile.in
tests/Makefile.am
tests/Makefile.in
tests/parallel-am.test [new file with mode: 0755]