config/global/build-behave.in
author Michael Hope <michael.hope@linaro.org>
Wed Oct 05 14:19:51 2011 +1300 (2011-10-05)
changeset 2701 99de89e9acba
parent 2695 f2495884ca3e
child 2705 80a09cf51c87
permissions -rw-r--r--
scripts: support extra host compiler flags

Allow the user to configure extra flags to pass to the host compiler
at build time. Applies to both C and C++.

Useful on Ubuntu to turn off the stack protector and fortify defaults
so the program stands a better chance of running on other distros.

Signed-off-by: Michael Hope <michael.hope@linaro.org>
[yann.morin.1998@anciens.enib.fr: put the custom flags at the end]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
     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 config EXTRA_FLAGS_FOR_HOST
    45     string
    46     prompt "Extra host compiler flags"
    47     default ""
    48     help
    49       Extra flags to pass to the host C and C++ compiler.
    50 
    51       May be used to change the default features of the host
    52       compiler such as turning off the stack protector or fortify.
    53 
    54 choice
    55     bool
    56     prompt "Shell to use as CONFIG_SHELL"
    57     default CONFIG_SHELL_BASH
    58     depends on ! BACKEND
    59 
    60 config CONFIG_SHELL_SH
    61     bool
    62     prompt "sh (the system shell)"
    63     help
    64       Use 'sh' as CONFIG_SHELL.
    65       
    66       ./configure scripts and Makefiles make intensive use of calling
    67       sub-shells. This is usually done by calling /bin/sh. /bin/sh ought
    68       to be an at-least-POSIX-conformant shell (that is, able to interpret
    69       POSIX shell scripts).
    70       
    71       On many (most?) systems, /bin/sh is a symlink to bash. On some other
    72       systems (eg. Ubuntu, latest Debian), /bin/sh points to dash (or ash).
    73       bash is a full-featured shell, with many extension to POSIX, but is
    74       quite slow (see ection BUGS in the bash man page), while dash is
    75       faster, with very few extensions to POSIX.  On the other hand, some
    76       ./configure scripts, although written to use /bin/sh, may really
    77       require to be run by bash.
    78       
    79       The default is to use bash, as some components (eg. GMP) will fail
    80       to build with anything else than bash.
    81 
    82 config CONFIG_SHELL_ASH
    83     bool
    84     prompt "ash (READ HELP!)"
    85     help
    86       Use 'ash' as CONFIG_SHELL.
    87       
    88       See help for CONFIG_SHELL_SH, above, for more explanations.
    89       
    90       NOTE: It is advised that you do NOT use ash as CONFIG_SHELL, as some
    91       components are broken. If you decide to use ash, and the build breaks,
    92       don't come moaning and set the CONFIG_SHELL to bash, below.
    93 
    94 config CONFIG_SHELL_BASH
    95     bool
    96     prompt "bash"
    97     help
    98       Use 'bash' as CONFIG_SHELL.
    99       
   100       See help for CONFIG_SHELL_SH, above, for more explanations.
   101 
   102 config CONFIG_SHELL_CUSTOM
   103     bool
   104     prompt "custom shell"
   105     help
   106       Enter full path to the custom shell below.
   107       
   108       See help for CONFIG_SHELL_SH, above, for more explanations.
   109 
   110 endchoice
   111 
   112 config CONFIG_SHELL
   113     string
   114     default "sh"        if CONFIG_SHELL_SH
   115     default "ash"       if CONFIG_SHELL_ASH
   116     default "bash"      if CONFIG_SHELL_BASH
   117     default "custom"    if CONFIG_SHELL_CUSTOM || BACKEND
   118 
   119 config CONFIG_SHELL_CUSTOM_PATH
   120     string
   121     prompt "Path to custom shell" if ! BACKEND
   122     depends on CONFIG_SHELL_CUSTOM || BACKEND
   123     default "/bin/sh"