config/global/build-behave.in
author Yann Diorcet <diorcet.yann@gmail.com>
Fri Nov 16 15:25:57 2012 +0100 (2012-11-16)
changeset 3119 1c56c03b7ed5
parent 2716 afa3fde1f7a7
child 3172 edb17e96ca60
permissions -rw-r--r--
scripts: add BUILD/HOST extra cflags/ldflags

On some hosts, and for certain toolchains (eg. toolchain targetting
the upcoming Darwin), it may be necessary to pass arbitrary CFLAGS
and/or LDFLAGS when building the components.

And necessary infrastructure:
- EXTRA_{CFLAGS,LDFLAGS}_FOR_{BUILD,HOST} as config options
- pass those extra flags to components

Fix-up a slight typo in elf2flt at the same time (misnamed cflags).

Signed-off-by: Yann Diorcet <diorcet.yann@gmail.com>
Message-Id: <d24043276c9243a35421.1353077450@macbook-smorlat.local>
Patchwork-Id: 199645
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@2716
    11
    default 0
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@2716
    17
      Enter 1 to have only one job at a time.
yann@1
    18
yann@2716
    19
      Enter 0 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
diorcet@3119
    44
config EXTRA_CFLAGS_FOR_BUILD
diorcet@3119
    45
    string
diorcet@3119
    46
    prompt "Extra build compiler flags"
diorcet@3119
    47
    default ""
diorcet@3119
    48
    help
diorcet@3119
    49
      Extra flags to pass to the build C and C++ compiler.
diorcet@3119
    50
diorcet@3119
    51
      May be used to change the default features of the build
diorcet@3119
    52
      compiler such as turning off the stack protector or fortify.
diorcet@3119
    53
      
diorcet@3119
    54
config EXTRA_LDFLAGS_FOR_BUILD
diorcet@3119
    55
    string
diorcet@3119
    56
    prompt "Extra build linker flags"
diorcet@3119
    57
    default ""
diorcet@3119
    58
    help
diorcet@3119
    59
      Extra flags to pass to the build linker.
diorcet@3119
    60
diorcet@3119
    61
      May be used to change the default features of the build
diorcet@3119
    62
      linker.
diorcet@3119
    63
      
diorcet@3119
    64
config EXTRA_CFLAGS_FOR_HOST
michael@2701
    65
    string
michael@2701
    66
    prompt "Extra host compiler flags"
michael@2701
    67
    default ""
michael@2701
    68
    help
michael@2701
    69
      Extra flags to pass to the host C and C++ compiler.
michael@2701
    70
michael@2701
    71
      May be used to change the default features of the host
michael@2701
    72
      compiler such as turning off the stack protector or fortify.
diorcet@3119
    73
      
diorcet@3119
    74
config EXTRA_LDFLAGS_FOR_HOST
diorcet@3119
    75
    string
diorcet@3119
    76
    prompt "Extra host linker flags"
diorcet@3119
    77
    default ""
diorcet@3119
    78
    help
diorcet@3119
    79
      Extra flags to pass to the host linker.
diorcet@3119
    80
diorcet@3119
    81
      May be used to change the default features of the host
diorcet@3119
    82
      linker.
michael@2701
    83
yann@1444
    84
choice
yann@1444
    85
    bool
yann@1444
    86
    prompt "Shell to use as CONFIG_SHELL"
yann@1459
    87
    default CONFIG_SHELL_BASH
yann@1866
    88
    depends on ! BACKEND
yann@1444
    89
yann@1444
    90
config CONFIG_SHELL_SH
yann@1444
    91
    bool
yann@1444
    92
    prompt "sh (the system shell)"
yann@1444
    93
    help
yann@1444
    94
      Use 'sh' as CONFIG_SHELL.
yann@1444
    95
      
yann@1444
    96
      ./configure scripts and Makefiles make intensive use of calling
yann@1444
    97
      sub-shells. This is usually done by calling /bin/sh. /bin/sh ought
yann@1444
    98
      to be an at-least-POSIX-conformant shell (that is, able to interpret
yann@1444
    99
      POSIX shell scripts).
yann@1444
   100
      
yann@1444
   101
      On many (most?) systems, /bin/sh is a symlink to bash. On some other
yann@1444
   102
      systems (eg. Ubuntu, latest Debian), /bin/sh points to dash (or ash).
yann@1444
   103
      bash is a full-featured shell, with many extension to POSIX, but is
yann@1444
   104
      quite slow (see ection BUGS in the bash man page), while dash is
yann@1444
   105
      faster, with very few extensions to POSIX.  On the other hand, some
yann@1444
   106
      ./configure scripts, although written to use /bin/sh, may really
yann@1444
   107
      require to be run by bash.
yann@1444
   108
      
yann@1459
   109
      The default is to use bash, as some components (eg. GMP) will fail
yann@1459
   110
      to build with anything else than bash.
yann@2705
   111
      
yann@2705
   112
      Unless you have a very strong reason not to (eg. you are debugging
yann@2705
   113
      the bashisms in a ./configure script), you should use the default,
yann@2705
   114
      and use bash.
yann@1459
   115
yann@805
   116
config CONFIG_SHELL_ASH
yann@805
   117
    bool
yann@1447
   118
    prompt "ash (READ HELP!)"
yann@805
   119
    help
yann@1444
   120
      Use 'ash' as CONFIG_SHELL.
yann@805
   121
      
yann@1444
   122
      See help for CONFIG_SHELL_SH, above, for more explanations.
yann@1447
   123
      
yann@1447
   124
      NOTE: It is advised that you do NOT use ash as CONFIG_SHELL, as some
yann@1447
   125
      components are broken. If you decide to use ash, and the build breaks,
yann@1447
   126
      don't come moaning and set the CONFIG_SHELL to bash, below.
yann@1444
   127
yann@1445
   128
config CONFIG_SHELL_BASH
yann@1445
   129
    bool
yann@1445
   130
    prompt "bash"
yann@1445
   131
    help
yann@1445
   132
      Use 'bash' as CONFIG_SHELL.
yann@1445
   133
      
yann@1445
   134
      See help for CONFIG_SHELL_SH, above, for more explanations.
yann@1445
   135
yann@1446
   136
config CONFIG_SHELL_CUSTOM
yann@1446
   137
    bool
yann@1446
   138
    prompt "custom shell"
yann@1446
   139
    help
yann@1446
   140
      Enter full path to the custom shell below.
yann@1446
   141
      
yann@1446
   142
      See help for CONFIG_SHELL_SH, above, for more explanations.
yann@1446
   143
yann@1444
   144
endchoice
yann@1444
   145
yann@2705
   146
# Do not put this into the choice above, because the choice
yann@2705
   147
# is not available in BACKEND-mode, while we do want this to
yann@2705
   148
# be set even in BACKEND-mode.
yann@1866
   149
config CONFIG_SHELL_CUSTOM_PATH
yann@1866
   150
    string
yann@1866
   151
    prompt "Path to custom shell" if ! BACKEND
yann@1866
   152
    depends on CONFIG_SHELL_CUSTOM || BACKEND
yann@1866
   153
    default "/bin/sh"
yann@2705
   154
yann@2705
   155
# Ditto.
yann@2705
   156
# And we must use the ./configured bash...
yann@2705
   157
config CONFIG_SHELL
yann@2705
   158
    string
yann@2705
   159
    default "/bin/sh"                   if CONFIG_SHELL_SH
yann@2705
   160
    default "/bin/ash"                  if CONFIG_SHELL_ASH
yann@2705
   161
    default "${bash}"                   if CONFIG_SHELL_BASH
yann@2705
   162
    default CONFIG_SHELL_CUSTOM_PATH    if CONFIG_SHELL_CUSTOM || BACKEND