From 937775c8efa56c28891748aa75ab540a7a884315 Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Sun, 26 Oct 2008 19:29:25 +0100 Subject: 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 --- bootstrap | 2 ++ 1 file changed, 2 insertions(+) (limited to 'bootstrap') diff --git a/bootstrap b/bootstrap index aa50f5d14..8437d116d 100755 --- a/bootstrap +++ b/bootstrap @@ -56,6 +56,7 @@ fi VERSION=`sed -ne '/AC_INIT/s/^[^[]*\[[^[]*\[\([^]]*\)\].*$/\1/p' configure.ac` PACKAGE=automake datadir=. +PERL_THREADS=0 # Override SHELL. This is required on DJGPP so that Perl's system() # uses bash, not COMMAND.COM which doesn't quote arguments properly. @@ -100,6 +101,7 @@ dosubst () sed -e "s%@APIVERSION@%$APIVERSION%g" \ -e "s%@PACKAGE@%$PACKAGE%g" \ -e "s%@PERL@%$PERL%g" \ + -e "s%@PERL_THREADS@%$PERL_THREADS%g" \ -e "s%@SHELL@%$BOOTSTRAP_SHELL%g" \ -e "s%@VERSION@%$VERSION%g" \ -e "s%@datadir@%$datadir%g" \ -- cgit v1.2.1