From 4f40d11eb7538ef16f284ada5952c42776e4a3ee Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Thu, 21 Aug 2008 02:08:33 +0200 Subject: [PATCH] Make it possible to compile autoconf tests remotely If $DISTCC_AUTOCONF_REMOTE is set to "1", then configuration tests will be compiled remotely as well. This can be dangerous in case the remote machines are not available (all configuration test will fail), but it speeds up the configure part. --- man/distcc.1 | 6 ++++++ src/arg.c | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletions(-) diff --git a/man/distcc.1 b/man/distcc.1 index 96c7ee2..d9f90fe 100644 --- a/man/distcc.1 +++ b/man/distcc.1 @@ -682,6 +682,12 @@ and the succeeding local compilation. .TP .B "DCC_EMAILLOG_WHOM_TO_BLAME" The email address for discrepancy email; the default is "distcc-pump-errors". +.TP +.B "DISTCC_AUTOCONF_REMOTE" +If set to "1", then configuration tests will be compiled remotely as +well. This can be dangerous in case the remote machines are not +available (all configuration test will fail), but it speeds up the +configure part. .SH "CROSS COMPILING" Cross compilation means building programs to run on a machine with a different processor, architecture, or diff --git a/src/arg.c b/src/arg.c index 6f814b9..f1093da 100644 --- a/src/arg.c +++ b/src/arg.c @@ -125,6 +125,11 @@ static void dcc_note_compiled(const char *input_file, const char *output_file) * The copy is dynamically allocated and the caller is responsible for * deallocating it. * + * If $DISTCC_AUTOCONF_REMOTE is set to "1", then configuration tests + * will be compiled remotely as well. This can be dangerous in case the + * remote machines are not available (all configuration test will fail), + * but it speeds up the configure part. + * * @returns 0 if it's ok to distribute this compilation, or an error code. **/ int dcc_scan_args(char *argv[], char **input_file, char **output_file, @@ -134,6 +139,7 @@ int dcc_scan_args(char *argv[], char **input_file, char **output_file, int i; char *a; int ret; + int autoconf_remote = dcc_getenv_bool("DISTCC_AUTOCONF_REMOTE", 0); /* allow for -o foo.o */ if ((ret = dcc_copy_argv(argv, ret_newargv, 2)) != 0) @@ -262,7 +268,7 @@ int dcc_scan_args(char *argv[], char **input_file, char **output_file, return EXIT_DISTCC_FAILED; } - if (dcc_source_needs_local(*input_file)) + if (!autoconf_remote && dcc_source_needs_local(*input_file)) return EXIT_DISTCC_FAILED; if (!*output_file) {