config/target.in
author Johannes Stezenbach <js@sig21.net>
Thu Jul 29 19:30:37 2010 +0200 (2010-07-29)
branch1.7
changeset 2047 ace1d90c9b15
parent 1715 18eb650d191a
child 1976 2d90ec981ba3
permissions -rw-r--r--
scripts: remove . from $PATH

Add CT_SanitizePath function which removes entries referring to ., /tmp
and non-existing directories from $PATH, and call it early in the
build script.

If . is in PATH, gcc-4.4.4 build breaks:

[ALL ] checking what assembler to use...
/tmp/build/targets/arm-unknown-linux-uclibcgnueabi/build/gcc-core-static/arm-unknown-linux-uclibcgnueabi/bin/as
...
[ALL ] config.status: creating as

i.e. "as" is supposed to be the arm-unknown-linux-uclibcgnueabi cross assembler,
but config.status creates a local "as" script which is calling the
host assembler.

Signed-off-by: Johannes Stezenbach <js@sig21.net>
[Yann E. MORIN: style fixes + explanations]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
(transplanted from 20dd8cef1c8adff0aa3e78ae6d7acfbc45ed5a83)
     1 # Target definition: architecture, optimisations, etc...
     2 
     3 menu "Target options"
     4 
     5 config ARCH
     6     string
     7 
     8 # Pre-declare target optimisation variables
     9 config ARCH_SUPPORTS_BOTH_MMU
    10 config ARCH_SUPPORTS_BOTH_ENDIAN
    11 config ARCH_SUPPORTS_32
    12 config ARCH_SUPPORTS_64
    13 config ARCH_SUPPORT_ARCH
    14 config ARCH_SUPPORT_ABI
    15 config ARCH_SUPPORT_CPU
    16 config ARCH_SUPPORT_TUNE
    17 config ARCH_SUPPORT_FPU
    18 
    19 config ARCH_DEFAULT_HAS_MMU
    20 config ARCH_DEFAULT_BE
    21 config ARCH_DEFAULT_LE
    22 config ARCH_DEFAULT_32
    23 config ARCH_DEFAULT_64
    24 
    25 config ARCH_ARCH
    26 config ARCH_ABI
    27 config ARCH_CPU
    28 config ARCH_TUNE
    29 config ARCH_FPU
    30 config ARCH_BE
    31 config ARCH_LE
    32 config ARCH_32
    33 config ARCH_64
    34 config ARCH_BITNESS
    35 config ARCH_FLOAT_HW
    36 config ARCH_FLOAT_SW
    37 config TARGET_CFLAGS
    38 config TARGET_LDFLAGS
    39 
    40 comment "General target options"
    41 
    42 source "config.gen/arch.in"
    43 
    44 #--------------------------------------
    45 config ARCH_SUPPORTS_BOTH_MMU
    46     bool
    47     default n
    48 
    49 config ARCH_DEFAULT_HAS_MMU
    50     bool
    51     default n
    52 
    53 config ARCH_USE_MMU
    54     bool
    55     prompt "Use the MMU" if ARCH_SUPPORTS_BOTH_MMU
    56     default n if ! ARCH_DEFAULT_HAS_MMU
    57     default y if ARCH_DEFAULT_HAS_MMU
    58     help
    59       If your architecture has an MMU and you want to use it,
    60       say 'Y' here.
    61       
    62       OTOH, if you don't want to use the MMU, or your arch
    63       lacks an MMU, say 'N' here.
    64       
    65       Note that some architectures (eg. ARM) has variants that
    66       lacks an MMU (eg. ARM Cortex-M3), while other variants
    67       have one (eg. ARM Cortex-A8).
    68 
    69 #--------------------------------------
    70 config ARCH_SUPPORTS_BOTH_ENDIAN
    71     bool
    72     default n
    73 
    74 config ARCH_DEFAULT_BE
    75     bool
    76     default n
    77 
    78 config ARCH_DEFAULT_LE
    79     bool
    80     default n
    81 
    82 choice
    83     bool
    84     prompt "Endianness:"
    85     depends on ARCH_SUPPORTS_BOTH_ENDIAN
    86     default ARCH_BE if ARCH_DEFAULT_BE
    87     default ARCH_LE if ARCH_DEFAULT_LE
    88 
    89 config ARCH_BE
    90     bool
    91     prompt "Big endian"
    92 
    93 config ARCH_LE
    94     bool
    95     prompt "Little endian"
    96 
    97 endchoice
    98 
    99 #--------------------------------------
   100 config ARCH_SUPPORTS_32
   101     bool
   102     default n
   103 
   104 config ARCH_SUPPORTS_64
   105     bool
   106     default n
   107 
   108 config ARCH_DEFAULT_32
   109     bool
   110     default n
   111 
   112 config ARCH_DEFAULT_64
   113     bool
   114     default n
   115 
   116 config ARCH_BITNESS
   117     int
   118     default "32"    if ARCH_32
   119     default "64"    if ARCH_64
   120 
   121 choice
   122     bool
   123     prompt "Bitness:"
   124     default ARCH_32 if ARCH_DEFAULT_32
   125     default ARCH_64 if ARCH_DEFAULT_64
   126 
   127 config ARCH_32
   128     bool
   129     prompt "32-bit"
   130     depends on ARCH_SUPPORTS_32
   131 
   132 config ARCH_64
   133     bool
   134     prompt "64-bit"
   135     depends on ARCH_SUPPORTS_64
   136 
   137 endchoice
   138 
   139 #--------------------------------------
   140 comment "Target optimisations"
   141 
   142 config ARCH_SUPPORT_ARCH
   143     bool
   144     default n
   145 
   146 config ARCH_SUPPORT_ABI
   147     bool
   148     default n
   149 
   150 config ARCH_SUPPORT_CPU
   151     bool
   152     default n
   153 
   154 config ARCH_SUPPORT_TUNE
   155     bool
   156     default n
   157 
   158 config ARCH_SUPPORT_FPU
   159     bool
   160     default n
   161 
   162 config ARCH_ARCH
   163     string
   164     prompt "Architecture level"
   165     depends on ARCH_SUPPORT_ARCH
   166     default ""
   167     help
   168       GCC uses this name to determine what kind of instructions it can emit
   169       when generating assembly code. This option can be used in conjunction
   170       with or instead of the ARCH_CPU option (above), or a (command-line)
   171       -mcpu= option.
   172       
   173       This is the configuration flag --with-arch=XXXX, and the runtime flag
   174       -march=XXX.
   175       
   176       Pick a value from the gcc manual for your choosen gcc version and your
   177       target CPU.
   178       
   179       Leave blank if you don't know, or if your target architecture does not
   180       offer this option.
   181 
   182 config ARCH_ABI
   183     string
   184     prompt "Generate code for the specific ABI"
   185     depends on ARCH_SUPPORT_ABI
   186     default ""
   187     help
   188       Generate code for the given ABI.
   189 
   190       This is the configuration flag --with-abi=XXXX, and the runtime flag
   191       -mabi=XXX.
   192 
   193       Pick a value from the gcc manual for your choosen gcc version and your
   194       target CPU.
   195 
   196       Leave blank if you don't know, or if your target architecutre does not
   197       offer this option.
   198 
   199 config ARCH_CPU
   200     string
   201     prompt "Emit assembly for CPU"
   202     depends on ARCH_SUPPORT_CPU
   203     default ""
   204     help
   205       This specifies the name of the target processor. GCC uses this name
   206       to determine what kind of instructions it can emit when generating
   207       assembly code.
   208       
   209       This is the configuration flag --with-cpu=XXXX, and the runtime flag
   210       -mcpu=XXX.
   211 
   212       Pick a value from the gcc manual for your choosen gcc version and your
   213       target CPU.
   214       
   215       Leave blank if you don't know, or if your target architecture does not
   216       offer this option.
   217 
   218 config ARCH_TUNE
   219     string
   220     prompt "Tune for CPU"
   221     depends on ARCH_SUPPORT_TUNE
   222     default ""
   223     help
   224       This option is very similar to the ARCH_CPU option (above), except
   225       that instead of specifying the actual target processor type, and hence
   226       restricting which instructions can be used, it specifies that GCC should
   227       tune the performance of the code as if the target were of the type
   228       specified in this option, but still choosing the instructions that it
   229       will generate based on the cpu specified by the ARCH_CPU option
   230       (above), or a (command-line) -mcpu= option.
   231       
   232       This is the configuration flag --with-tune=XXXX, and the runtime flag
   233       -mtune=XXX.
   234       
   235       Pick a value from the gcc manual for your choosen gcc version and your
   236       target CPU.
   237       
   238       Leave blank if you don't know, or if your target architecture does not
   239       offer this option.
   240 
   241 config ARCH_FPU
   242     string
   243     prompt "Use specific FPU"
   244     depends on ARCH_SUPPORT_FPU
   245     default ""
   246     help
   247       On some targets (eg. ARM), you can specify the kind of FPU to emit
   248       code for.
   249 
   250       This is the configuration flag --with-fpu=XXX, and the runtime flag
   251       -mfpu=XXX.
   252       
   253       See below wether to actually emit FP opcodes, or to emulate them.
   254       
   255       Pick a value from the gcc manual for your choosen gcc version and your
   256       target CPU.
   257       
   258       Leave blank if you don't know, or if your target architecture does not
   259       offer this option.
   260 
   261 choice
   262     bool
   263     prompt "Floating point:"
   264 
   265 config ARCH_FLOAT_HW
   266     bool
   267     prompt "hardware (FPU)"
   268     help
   269       Emit hardware floating point opcodes.
   270       
   271       If you've got a processor with a FPU, then you want that.
   272       If your hardware has no FPU, you still can use HW floating point, but
   273       need to compile support for FPU emulation in your kernel. Needless to
   274       say that emulating the FPU is /slooowwwww/...
   275       
   276       One situation you'd want HW floating point without a FPU is if you get
   277       binary blobs from different vendors that are compiling this way and
   278       can't (don't wan't to) change.
   279 
   280 config ARCH_FLOAT_SW
   281     bool
   282     prompt "software"
   283     help
   284       Do not emit any hardware floating point opcode.
   285       
   286       If your processor has no FPU, then you most probably want this, as it
   287       is faster than emulating the FPU in the kernel.
   288 
   289 endchoice
   290 
   291 config TARGET_CFLAGS
   292     string
   293     prompt "Target CFLAGS"
   294     default ""
   295     help
   296       Used to add specific options when compiling libraries of the toolchain,
   297       that will run on the target (eg. libc.so).
   298       
   299       Note that the options above for ARCH, ABI, CPU, TUNE and FPU will be
   300       automaticaly used. You don't need to specify them here.
   301       
   302       Leave blank if you don't know better.
   303 
   304 config TARGET_LDFLAGS
   305     string
   306     prompt "Target LDFLAGS"
   307     default ""
   308     help
   309       Used to add specific options when linking libraries of the toolchain,
   310       that will run on your target.
   311       
   312       Leave blank if you don't know better.
   313 
   314 endmenu