diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2016-05-26 12:39:18 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2016-05-26 12:39:21 +0200 |
commit | ca8040d47f2add5971085c3d06b4b12f7da757e9 (patch) | |
tree | a090a8215d02fef5768a2dc68c980f17d7421411 /bin | |
parent | 434722d90b20555c487d927f0b0cf48997c9995d (diff) | |
download | ptxdist-ca8040d47f2add5971085c3d06b4b12f7da757e9.tar.gz ptxdist-ca8040d47f2add5971085c3d06b4b12f7da757e9.tar.xz |
ptxdist: add --output-sync option
Calling make with --output-sync=... can have unexpected effects. So don't
enable it by default for parallel building. Instead this adds an option for
this and enables it by default for quiet builds.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ptxdist | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/bin/ptxdist b/bin/ptxdist index f9e7d845d..224bbe2d8 100755 --- a/bin/ptxdist +++ b/bin/ptxdist @@ -1022,6 +1022,9 @@ Options: --debug, -d print out additional info (like make decisions) --quiet, -q suppress output, show only stderr --verbose, -v be more verbose, print command before execute them + --output-sync Improve output readability for parallel building. + Disabled by default except for quiet builds. + --no-output-sync Disable output-sync if enabled by default. --j-intern=<n>, -ji<n> set number of parallel builds in packages (default = 2*CPUs) @@ -1328,6 +1331,12 @@ parse_first() PTX_NICE="${arg#*=}" PTX_NICE="${PTX_NICE:-10}" ;; + --output-sync) + PTXDIST_OUTPUT_SYNC=1 + ;; + --no-output-sync) + PTXDIST_OUTPUT_SYNC=0 + ;; -q|--quiet) PTXDIST_QUIET=1 ;; @@ -2326,12 +2335,14 @@ setup_config() { # out: PTXDIST_PARALLELMFLAGS # PTXDIST_PARALLELMFLAGS_INTERN # PTXDIST_PARALLELMFLAGS_EXTERN +# PTXDIST_OUTPUT_SYNC # setup_parallel() { # default no parallel for now local pmf_extern="" local pmf_intern="" local cpus + local output_sync="" # this one is for Linux if [ -r /proc/cpuinfo ]; then @@ -2356,12 +2367,19 @@ setup_parallel() { PTXDIST_PARALLELMFLAGS="${pmf_cpus}" fi + PTXDIST_OUTPUT_SYNC="${PTXDIST_OUTPUT_SYNC:-${PTXDIST_QUIET}}" + if [ "${PTXDIST_OUTPUT_SYNC}" == "1" ]; then + if make -h | grep -q -- --output-sync; then + PTXDIST_OUTPUT_SYNC="--output-sync=" + fi + fi + # # user may override these, via cmdline # PTXDIST_PARALLELMFLAGS_INTERN="${PTXDIST_PARALLELMFLAGS_INTERN:-${pmf_intern}}" PTXDIST_PARALLELMFLAGS_EXTERN="${PTXDIST_PARALLELMFLAGS_EXTERN:-${pmf_extern}}" - export PTXDIST_PARALLELMFLAGS_EXTERN + export PTXDIST_PARALLELMFLAGS_EXTERN PTXDIST_OUTPUT_SYNC } @@ -2649,6 +2667,7 @@ setup_export() { PTXDIST_FORCE_DOWNLOAD \ PTXDIST_ICECC \ PTXDIST_LOG_PROMPT \ + PTXDIST_OUTPUT_SYNC \ PTXDIST_PEDANTIC \ PTXDIST_QUIET \ PTXDIST_VERBOSE |