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