config/global/build-behave.in
author Michael Hope <michael.hope@linaro.org>
Thu Sep 29 12:40:42 2011 +1300 (2011-09-29)
changeset 2695 f2495884ca3e
parent 1866 1539194a1877
child 2701 99de89e9acba
permissions -rw-r--r--
config: add a 'auto' value for the number of parallel jobs

When CT_PARALLEL_JOBS is -1, set the number of parallel jobs to the
number of online CPUs + 1. Update documentation to match.

I find this useful when building in the cloud. You can use the same
.config file and have the build adapt to the number of processors
available. Limited testing shows that NCPUS+1 is faster than NCPUS+0
or NCPUS+2.

Signed-off-by: Michael Hope <michael.hope@linaro.org>
     1 # Options related to how the build behaves
     2 
     3 comment "Build behavior"
     4 
     5 comment "Build options hiden"
     6     depends on BACKEND
     7 
     8 config PARALLEL_JOBS
     9     int
    10     prompt "Number of parallel jobs" if ! BACKEND
    11     default 1
    12     help
    13       Number of jobs make will be allowed to run concurently.
    14       Set this higher than the number of processors you have, but not too high.
    15       A good rule of thumb is twice the number of processors you have.
    16       
    17       Enter 1 (or 0) to have only one job at a time.
    18 
    19       Enter -1 to set automatically based on how many processors the host has.
    20 
    21 config LOAD
    22     int
    23     prompt "Maximum allowed load" if ! BACKEND
    24     default 0
    25     help
    26       Specifies that no new jobs should be started if there are others jobs
    27       running and the load average is at least this value.
    28       
    29       Makes sense on SMP machines only.
    30       
    31       Enter 0 to have no limit on the load average.
    32       
    33       Note: only the integer part of the load is allowed here (you can't enter
    34             0.75 for example).
    35 
    36 config USE_PIPES
    37     bool
    38     prompt "Use -pipe" if ! BACKEND
    39     default y
    40     help
    41       Use gcc's option -pipe to use pipes rather than temp files when building
    42       the toolchain.
    43 
    44 choice
    45     bool
    46     prompt "Shell to use as CONFIG_SHELL"
    47     default CONFIG_SHELL_BASH
    48     depends on ! BACKEND
    49 
    50 config CONFIG_SHELL_SH
    51     bool
    52     prompt "sh (the system shell)"
    53     help
    54       Use 'sh' as CONFIG_SHELL.
    55       
    56       ./configure scripts and Makefiles make intensive use of calling
    57       sub-shells. This is usually done by calling /bin/sh. /bin/sh ought
    58       to be an at-least-POSIX-conformant shell (that is, able to interpret
    59       POSIX shell scripts).
    60       
    61       On many (most?) systems, /bin/sh is a symlink to bash. On some other
    62       systems (eg. Ubuntu, latest Debian), /bin/sh points to dash (or ash).
    63       bash is a full-featured shell, with many extension to POSIX, but is
    64       quite slow (see ection BUGS in the bash man page), while dash is
    65       faster, with very few extensions to POSIX.  On the other hand, some
    66       ./configure scripts, although written to use /bin/sh, may really
    67       require to be run by bash.
    68       
    69       The default is to use bash, as some components (eg. GMP) will fail
    70       to build with anything else than bash.
    71 
    72 config CONFIG_SHELL_ASH
    73     bool
    74     prompt "ash (READ HELP!)"
    75     help
    76       Use 'ash' as CONFIG_SHELL.
    77       
    78       See help for CONFIG_SHELL_SH, above, for more explanations.
    79       
    80       NOTE: It is advised that you do NOT use ash as CONFIG_SHELL, as some
    81       components are broken. If you decide to use ash, and the build breaks,
    82       don't come moaning and set the CONFIG_SHELL to bash, below.
    83 
    84 config CONFIG_SHELL_BASH
    85     bool
    86     prompt "bash"
    87     help
    88       Use 'bash' as CONFIG_SHELL.
    89       
    90       See help for CONFIG_SHELL_SH, above, for more explanations.
    91 
    92 config CONFIG_SHELL_CUSTOM
    93     bool
    94     prompt "custom shell"
    95     help
    96       Enter full path to the custom shell below.
    97       
    98       See help for CONFIG_SHELL_SH, above, for more explanations.
    99 
   100 endchoice
   101 
   102 config CONFIG_SHELL
   103     string
   104     default "sh"        if CONFIG_SHELL_SH
   105     default "ash"       if CONFIG_SHELL_ASH
   106     default "bash"      if CONFIG_SHELL_BASH
   107     default "custom"    if CONFIG_SHELL_CUSTOM || BACKEND
   108 
   109 config CONFIG_SHELL_CUSTOM_PATH
   110     string
   111     prompt "Path to custom shell" if ! BACKEND
   112     depends on CONFIG_SHELL_CUSTOM || BACKEND
   113     default "/bin/sh"