Mercurial > ecos
comparison packages/language/c/libc/current/include/pkgconf/libc.h @ 0:3111d98ba7b3 ecos-v1_1-release
Initial commit of eCos version 1.1
| author | jlarmour |
|---|---|
| date | Tue, 11 May 1999 11:16:07 +0000 |
| parents | |
| children | 443894e2e912 |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:3111d98ba7b3 |
|---|---|
| 1 #ifndef CYGONCE_PKGCONF_LIBC_H | |
| 2 #define CYGONCE_PKGCONF_LIBC_H | |
| 3 //======================================================================== | |
| 4 // | |
| 5 // libc.h | |
| 6 // | |
| 7 // Configuration header for the ANSI standard C library | |
| 8 // | |
| 9 //======================================================================== | |
| 10 //####COPYRIGHTBEGIN#### | |
| 11 // | |
| 12 // ------------------------------------------- | |
| 13 // The contents of this file are subject to the Cygnus eCos Public License | |
| 14 // Version 1.0 (the "License"); you may not use this file except in | |
| 15 // compliance with the License. You may obtain a copy of the License at | |
| 16 // http://sourceware.cygnus.com/ecos | |
| 17 // | |
| 18 // Software distributed under the License is distributed on an "AS IS" | |
| 19 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the | |
| 20 // License for the specific language governing rights and limitations under | |
| 21 // the License. | |
| 22 // | |
| 23 // The Original Code is eCos - Embedded Cygnus Operating System, released | |
| 24 // September 30, 1998. | |
| 25 // | |
| 26 // The Initial Developer of the Original Code is Cygnus. Portions created | |
| 27 // by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. | |
| 28 // ------------------------------------------- | |
| 29 // | |
| 30 //####COPYRIGHTEND#### | |
| 31 //======================================================================== | |
| 32 //#####DESCRIPTIONBEGIN#### | |
| 33 // | |
| 34 // Author(s): jlarmour | |
| 35 // Contributors: jlarmour@cygnus.co.uk | |
| 36 // Date: 1998-02-13 | |
| 37 // Purpose: Configuration of the ISO C library | |
| 38 // Description: The preprocessor defines here can be used to configure | |
| 39 // the ISO C library, preferably with a graphical tool, | |
| 40 // but also manually if required. | |
| 41 // Usage: #include <pkgconf/libc.h> | |
| 42 // | |
| 43 // | |
| 44 //####DESCRIPTIONEND#### | |
| 45 // | |
| 46 //======================================================================== | |
| 47 | |
| 48 // INCLUDES | |
| 49 | |
| 50 // Include system configuration file to work out whether the C library is | |
| 51 // to be included at all | |
| 52 #include <pkgconf/system.h> | |
| 53 | |
| 54 // Make sure kernel config is already there for | |
| 55 // CYGNUM_KERNEL_THREADS_DATA_LIBC and CYGVAR_KERNEL_THREADS_DATA | |
| 56 #ifdef CYGPKG_KERNEL | |
| 57 # include <pkgconf/kernel.h> | |
| 58 #endif | |
| 59 | |
| 60 /* | |
| 61 {{CFG_DATA | |
| 62 | |
| 63 cdl_package CYGPKG_LIBC { | |
| 64 display "C Library" | |
| 65 description "This package enables compatibility with the ISO | |
| 66 C standard - ISO/IEC 9899:1990. This allows the | |
| 67 user application to use well known standard | |
| 68 C library functions, and in eCos starts a | |
| 69 thread to invoke the user function main()" | |
| 70 type boolean | |
| 71 requires CYGPKG_ERROR | |
| 72 doc ref/ecos-ref/the-iso-standard-c-and-math-libraries.html | |
| 73 } | |
| 74 | |
| 75 }}CFG_DATA | |
| 76 */ | |
| 77 | |
| 78 //======================================================================== | |
| 79 | |
| 80 // CTYPE CONFIGURATION OPTIONS | |
| 81 | |
| 82 /* | |
| 83 {{CFG_DATA | |
| 84 cdl_option CYGIMP_LIBC_CTYPE_INLINES { | |
| 85 display "Inline versions of <ctype.h> functions" | |
| 86 description "This option chooses whether the simple character | |
| 87 classification and conversion functions (e.g. | |
| 88 isupper(), isalpha(), toupper(), etc.) | |
| 89 from <ctype.h> are available as inline | |
| 90 functions. This may improve performance and as | |
| 91 the functions are small, may even improve code | |
| 92 size." | |
| 93 | |
| 94 type boolean | |
| 95 parent CYGPKG_LIBC | |
| 96 } | |
| 97 }}CFG_DATA | |
| 98 */ | |
| 99 | |
| 100 #define CYGIMP_LIBC_CTYPE_INLINES | |
| 101 | |
| 102 //======================================================================== | |
| 103 | |
| 104 // STRING CONFIGURATION OPTIONS | |
| 105 | |
| 106 /* | |
| 107 {{CFG_DATA | |
| 108 cdl_component CYGPKG_LIBC_STRING { | |
| 109 display "String functions" | |
| 110 description "Options associated with the standard string | |
| 111 functions" | |
| 112 | |
| 113 type dummy | |
| 114 parent CYGPKG_LIBC | |
| 115 } | |
| 116 | |
| 117 cdl_option CYGIMP_LIBC_STRING_INLINES { | |
| 118 display "Inline versions of <string.h> functions" | |
| 119 description "This option chooses whether some of the | |
| 120 particularly simple string functions from | |
| 121 <string.h> are available as inline | |
| 122 functions. This may improve performance, and as | |
| 123 the functions are small, may even improve code | |
| 124 size." | |
| 125 | |
| 126 type boolean | |
| 127 parent CYGPKG_LIBC_STRING | |
| 128 } | |
| 129 | |
| 130 cdl_option CYGFUN_LIBC_strtok { | |
| 131 display "Provides strtok()" | |
| 132 description "This option chooses whether the strtok() function | |
| 133 is to be available. Some space may be saved if | |
| 134 not." | |
| 135 | |
| 136 type boolean | |
| 137 parent CYGPKG_LIBC_STRING | |
| 138 } | |
| 139 | |
| 140 cdl_component CYGPKG_LIBC_STRING_OPTIMIZATIONS { | |
| 141 display "Options for string function optimization" | |
| 142 description "This component lets you choose between different | |
| 143 implementations of the string functions with | |
| 144 different tradeoffs. Most of the string | |
| 145 functions can be implemented in two ways. One | |
| 146 approach is geared towards smaller code size, | |
| 147 while the other tries to improve execution speed | |
| 148 at the expense of code size. " | |
| 149 | |
| 150 type dummy | |
| 151 parent CYGPKG_LIBC_STRING | |
| 152 } | |
| 153 | |
| 154 cdl_option CYGIMP_LIBC_STRING_PREFER_FAST { | |
| 155 display "Fast" | |
| 156 description "This option improves string function execution | |
| 157 speed at the expense of code size. This | |
| 158 option is overriden if the code is | |
| 159 compiled with the -Os option to the compiler." | |
| 160 | |
| 161 type radio | |
| 162 parent CYGPKG_LIBC_STRING_OPTIMIZATIONS | |
| 163 } | |
| 164 | |
| 165 cdl_option CYGIMP_LIBC_STRING_PREFER_SMALL { | |
| 166 display "Small" | |
| 167 description "This option tries to reduce string function | |
| 168 code size at the expense of execution speed. The | |
| 169 same effect can be produced if the code is | |
| 170 compiled with the -Os option to the compiler." | |
| 171 | |
| 172 type radio | |
| 173 parent CYGPKG_LIBC_STRING_OPTIMIZATIONS | |
| 174 } | |
| 175 | |
| 176 }}CFG_DATA | |
| 177 */ | |
| 178 | |
| 179 #define CYGIMP_LIBC_STRING_INLINES | |
| 180 | |
| 181 #define CYGFUN_LIBC_strtok | |
| 182 | |
| 183 #undef CYGIMP_LIBC_STRING_PREFER_SMALL | |
| 184 | |
| 185 #define CYGIMP_LIBC_STRING_PREFER_FAST | |
| 186 | |
| 187 #ifdef CYGIMP_LIBC_STRING_PREFER_SMALL | |
| 188 # define CYGIMP_LIBC_STRING_PREFER_SMALL_TO_FAST | |
| 189 #endif | |
| 190 | |
| 191 //======================================================================== | |
| 192 | |
| 193 // SETJMP CONFIGURATION OPTIONS | |
| 194 | |
| 195 /* | |
| 196 {{CFG_DATA | |
| 197 cdl_option CYGIMP_LIBC_SETJMP_INLINES { | |
| 198 display "Inline version of the longjmp() function" | |
| 199 description "This option chooses whether the longjmp() function | |
| 200 is available as an inline function. This may | |
| 201 improve performance, and as the function is small | |
| 202 may even improve code size. " | |
| 203 | |
| 204 type boolean | |
| 205 parent CYGPKG_LIBC | |
| 206 } | |
| 207 }}CFG_DATA | |
| 208 */ | |
| 209 | |
| 210 #define CYGIMP_LIBC_SETJMP_INLINES | |
| 211 | |
| 212 //======================================================================== | |
| 213 | |
| 214 // STDLIB CONFIGURATION OPTIONS | |
| 215 | |
| 216 | |
| 217 /* | |
| 218 {{CFG_DATA | |
| 219 cdl_component CYGPKG_LIBC_STDLIB { | |
| 220 display "Standard utility functions" | |
| 221 description "Options associated with the standard utility | |
| 222 functions in <stdlib.h>" | |
| 223 | |
| 224 type dummy | |
| 225 parent CYGPKG_LIBC | |
| 226 } | |
| 227 | |
| 228 cdl_option CYGIMP_LIBC_STDLIB_INLINES { | |
| 229 display "Inline versions of <stdlib.h> functions" | |
| 230 description "This option chooses whether some of the | |
| 231 particularly simple standard utility functions | |
| 232 from <stdlib.h> are available as inline | |
| 233 functions. This may improve performance, and as | |
| 234 the functions are small, may even improve code | |
| 235 size." | |
| 236 | |
| 237 type boolean | |
| 238 parent CYGPKG_LIBC_STDLIB | |
| 239 } | |
| 240 | |
| 241 cdl_component CYGPKG_LIBC_RAND { | |
| 242 display "Provide rand() and srand()" | |
| 243 description "This option chooses whether the pseudo-random | |
| 244 number generator functions rand() and | |
| 245 srand() are available. Some space may | |
| 246 saved if not." | |
| 247 | |
| 248 type boolean | |
| 249 parent CYGPKG_LIBC_STDLIB | |
| 250 } | |
| 251 | |
| 252 cdl_option CYGNUM_LIBC_RAND_SEED { | |
| 253 display "Random number seed" | |
| 254 description "This selects the initial random number seed for | |
| 255 rand()'s pseudo-random number generator. For | |
| 256 strict ISO standard compliance, this should be 1, | |
| 257 as per section 7.10.2.2 of the standard." | |
| 258 | |
| 259 type count | |
| 260 legal_values 0 to 0x7fffffff | |
| 261 parent CYGPKG_LIBC_RAND | |
| 262 } | |
| 263 | |
| 264 cdl_component CYGPKG_LIBC_MALLOC { | |
| 265 display "Support for dynamic memory allocation" | |
| 266 description "This enables support for dynamic memory | |
| 267 allocation as supplied by the functions malloc(), | |
| 268 free(), calloc() and realloc(). As these | |
| 269 functions are often used, but can have quite an | |
| 270 overhead, disabling them here can ensure they | |
| 271 cannot even be used accidentally when static | |
| 272 allocation is preferred." | |
| 273 | |
| 274 type boolean | |
| 275 parent CYGPKG_LIBC_STDLIB | |
| 276 requires CYGPKG_KERNEL | |
| 277 } | |
| 278 | |
| 279 cdl_option CYGNUM_LIBC_MALLOC_MEMPOOL_SIZE { | |
| 280 display "Size of the dynamic memory pool in bytes" | |
| 281 description "At this stage, dynamic memory allocation by | |
| 282 malloc() and calloc() must be from a fixed-size, | |
| 283 contiguous memory pool. This option is the size | |
| 284 of that pool, in bytes. Note that not all of | |
| 285 this is available for programs to | |
| 286 use - some is needed for internal information | |
| 287 about memory regions, and some may be lost to | |
| 288 ensure that memory allocation only returns | |
| 289 memory aligned on word (or double word) | |
| 290 boundaries - a very common architecture | |
| 291 constraint." | |
| 292 | |
| 293 type count | |
| 294 legal_values 32 to 0x7fffffff | |
| 295 parent CYGPKG_LIBC_MALLOC | |
| 296 } | |
| 297 | |
| 298 cdl_option CYGIMP_LIBC_MALLOC_CXX_DELETE_CALLS_FREE { | |
| 299 display "Support for C++ delete operator" | |
| 300 description "C++ new and delete operators can call | |
| 301 the C library's malloc() and free() implicitly. | |
| 302 If this is what is required, enable this option. | |
| 303 However, if enabled, the dynamic memory allocation | |
| 304 code is always linked in to the application, | |
| 305 even if it is not explicitly called and new/delete | |
| 306 are not used. | |
| 307 This increases code and data size needlessly." | |
| 308 | |
| 309 type bool | |
| 310 parent CYGPKG_LIBC_MALLOC | |
| 311 } | |
| 312 | |
| 313 cdl_option CYGFUN_LIBC_strtod { | |
| 314 display "Provides strtod() and atof()" | |
| 315 description "This option allows use of the utility function | |
| 316 strtod() (and consequently atof()) to convert | |
| 317 from string to double precision floating point | |
| 318 numbers. Disabling this option removes the | |
| 319 dependency on the math library package." | |
| 320 | |
| 321 type boolean | |
| 322 parent CYGPKG_LIBC_STDLIB | |
| 323 requires CYGPKG_LIBM | |
| 324 } | |
| 325 | |
| 326 }}CFG_DATA | |
| 327 */ | |
| 328 | |
| 329 #define CYGIMP_LIBC_STDLIB_INLINES | |
| 330 | |
| 331 #define CYGPKG_LIBC_RAND | |
| 332 | |
| 333 #ifdef CYGPKG_LIBC_RAND | |
| 334 #define CYGNUM_LIBC_RAND_SEED 1 | |
| 335 #endif | |
| 336 | |
| 337 #define CYGPKG_LIBC_MALLOC | |
| 338 | |
| 339 #ifdef CYGPKG_LIBC_MALLOC | |
| 340 | |
| 341 #undef CYGIMP_LIBC_MALLOC_CXX_DELETE_CALLS_FREE | |
| 342 | |
| 343 #ifndef CYGPKG_KERNEL | |
| 344 # error You must have the Kernel enabled to use the C library dynamic \ | |
| 345 memory allocation functions | |
| 346 #endif | |
| 347 | |
| 348 #define CYGNUM_LIBC_MALLOC_MEMPOOL_SIZE 32768 | |
| 349 | |
| 350 #endif // ifdef CYGPKG_LIBC_MALLOC | |
| 351 | |
| 352 #define CYGFUN_LIBC_strtod | |
| 353 | |
| 354 #ifdef CYGFUN_LIBC_strtod | |
| 355 # ifndef CYGPKG_LIBM | |
| 356 # error You must enable the Math library package to use strtod() or atof() | |
| 357 # endif | |
| 358 #endif | |
| 359 | |
| 360 //======================================================================== | |
| 361 | |
| 362 // STDIO CONFIGURATION OPTIONS | |
| 363 | |
| 364 /* | |
| 365 {{CFG_DATA | |
| 366 cdl_component CYGPKG_LIBC_STDIO { | |
| 367 display "Standard Input/Output functions" | |
| 368 description "This enables support for standard I/O functions | |
| 369 from <stdio.h>." | |
| 370 | |
| 371 type boolean | |
| 372 parent CYGPKG_LIBC | |
| 373 requires CYGPKG_DEVICES | |
| 374 } | |
| 375 | |
| 376 cdl_option CYGIMP_LIBC_STDIO_INLINES { | |
| 377 display "Inline versions of <stdio.h> functions" | |
| 378 description "This option chooses whether some of the | |
| 379 particularly simple functions from | |
| 380 <stdio.h> are available as inline | |
| 381 functions. This may improve performance, and as | |
| 382 the functions are small, may even improve code | |
| 383 size." | |
| 384 | |
| 385 type boolean | |
| 386 parent CYGPKG_LIBC_STDIO | |
| 387 } | |
| 388 | |
| 389 cdl_option FOPEN_MAX { | |
| 390 display "Permitted number of open files" | |
| 391 description "This option controls the guaranteed minimum | |
| 392 number of simultaneously open files. The ISO | |
| 393 C standard requires it to be defined (para | |
| 394 7.9.1), and if strictly compliant, it must be | |
| 395 at least 8 (para 7.9.3). In practice it can be | |
| 396 as low as 3 - for stdin, stdout and stderr." | |
| 397 | |
| 398 type count | |
| 399 legal_values 3 to 0x7fffffff | |
| 400 parent CYGPKG_LIBC_STDIO | |
| 401 } | |
| 402 | |
| 403 cdl_option FILENAME_MAX { | |
| 404 display "Maximum length of filename" | |
| 405 description "This option defines the maximum allowed size of | |
| 406 a filename in characters. The ISO C standard | |
| 407 requires it to be defined (para 7.9.1)." | |
| 408 | |
| 409 type count | |
| 410 legal_values 1 to 0x7fffffff | |
| 411 parent CYGPKG_LIBC_STDIO | |
| 412 } | |
| 413 | |
| 414 cdl_option L_tmpnam { | |
| 415 display "Maximum length of filenames for temporary files" | |
| 416 description "This option defines the maximum allowed size of | |
| 417 filenames for temporary files as generated by | |
| 418 tmpnam(). It is measured in characters, and the | |
| 419 ISO C standard requires it to be defined (para | |
| 420 7.9.1)." | |
| 421 | |
| 422 type count | |
| 423 legal_values 1 to 0x7fffffff | |
| 424 parent CYGPKG_LIBC_STDIO | |
| 425 } | |
| 426 | |
| 427 cdl_option TMP_MAX { | |
| 428 display "Unique file names generated by tmpnam()" | |
| 429 description "This option defines the minimum number of | |
| 430 unique file names generated by tmpnam(). The | |
| 431 ISO C standard requires it to be defined (para | |
| 432 7.9.1)." | |
| 433 | |
| 434 type count | |
| 435 legal_values 0 to 0x7fffffff | |
| 436 parent CYGPKG_LIBC_STDIO | |
| 437 } | |
| 438 | |
| 439 cdl_component CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO { | |
| 440 display "Buffered I/O" | |
| 441 description "This option controls whether input/output | |
| 442 through the <stdio.h> functions is buffered. | |
| 443 This may save some memory per file. It | |
| 444 is equivalent to putting every file into | |
| 445 non-buffered mode (_IONBF) through setvbuf(), | |
| 446 except now it can never be altered back to | |
| 447 buffered mode. Disabling buffering is strictly | |
| 448 non-compliant with the ISO C standard." | |
| 449 | |
| 450 type boolean | |
| 451 parent CYGPKG_LIBC_STDIO | |
| 452 } | |
| 453 | |
| 454 cdl_option CYGNUM_LIBC_STDIO_BUFSIZE { | |
| 455 display "Default buffer size" | |
| 456 description "This option defines the default size of buffer | |
| 457 used with calls to setbuf(), and is the default | |
| 458 size for buffered streams that have not had | |
| 459 either setbuf() or setvbuf() invoked on them. | |
| 460 It is exactly equivalent to the standard | |
| 461 constant BUFSIZE, except that it is 0 if | |
| 462 CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO is disabled. | |
| 463 The ISO C standard requires this to be defined | |
| 464 (para 7.9.1), and says it must be at least 256 | |
| 465 (para 7.9.2)." | |
| 466 | |
| 467 type count | |
| 468 legal_values 1 to 0x7fffffff | |
| 469 parent CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO | |
| 470 } | |
| 471 | |
| 472 cdl_option CYGSEM_LIBC_STDIO_DYNAMIC_SETVBUF { | |
| 473 display "setbuf()/setvbuf() uses malloc()" | |
| 474 description "This option controls whether I/O buffers are | |
| 475 implemented dynamically within the stdio | |
| 476 implementation. Otherwise they will be static, | |
| 477 and cannot be changed by setbuf()/setvbuf(). If | |
| 478 they are static (i.e. this option is disabled), | |
| 479 any attempt to use an arbitrary buffer size, or | |
| 480 to pass a user-supplied buffer to setbuf() or | |
| 481 setvbuf() will fail - the buffer is implemented | |
| 482 internally as a static array of taking the size | |
| 483 of the configuration option BUFSIZE. The only | |
| 484 exception is if a user buffer is not supplied, | |
| 485 and the buffer size requested is less than | |
| 486 BUFSIZE. In this case, the buffer will | |
| 487 be configured to only use that amount of | |
| 488 buffering. However the unused memory left over | |
| 489 will NOT be freed. If this option is enabled, | |
| 490 then CYGPKG_LIBC_MALLOC must also | |
| 491 be enabled. Either setting can be considered to | |
| 492 be compliant with the ISO C standard." | |
| 493 | |
| 494 type boolean | |
| 495 parent CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO | |
| 496 requires CYGPKG_LIBC_MALLOC | |
| 497 } | |
| 498 | |
| 499 cdl_option CYGFUN_LIBC_STDIO_ungetc { | |
| 500 display "Support for ungetc()" | |
| 501 description "This option controls whether ungetc() is | |
| 502 supported. If not, then some space can be | |
| 503 saved, and speed is improved. Note that you | |
| 504 MUST have this defined if you want to use the | |
| 505 scanf() family of functions." | |
| 506 | |
| 507 type boolean | |
| 508 parent CYGPKG_LIBC_STDIO | |
| 509 } | |
| 510 | |
| 511 cdl_option CYGPKG_LIBC_STDIO_OPEN { | |
| 512 display "Dynamic opening/closing of files" | |
| 513 description "fopen() and fclose() use dynamic memory | |
| 514 allocation routines to allocate memory for | |
| 515 new FILE structure pointers. This option, | |
| 516 along with CYGPKG_LIBC_MALLOC, should be | |
| 517 enabled to use | |
| 518 fopen() and fclose(). If disabled, only the | |
| 519 default console streams - stdin, stdout and | |
| 520 stderr - will be available." | |
| 521 | |
| 522 type boolean | |
| 523 parent CYGPKG_LIBC_STDIO | |
| 524 requires CYGPKG_LIBC_MALLOC | |
| 525 } | |
| 526 | |
| 527 cdl_option CYGDAT_LIBC_STDIO_DEFAULT_CONSOLE { | |
| 528 display "Default console device" | |
| 529 description "This option allows you to choose the | |
| 530 default console device. In the current | |
| 531 implementation, all these devices begin | |
| 532 with the prefix /dev/ and are followed by | |
| 533 the name of a device as listed in the | |
| 534 devs/common/current/src/table.cxx file in the | |
| 535 source repository. Look at that file to see | |
| 536 list of available devices." | |
| 537 | |
| 538 type string | |
| 539 parent CYGPKG_LIBC_STDIO | |
| 540 } | |
| 541 | |
| 542 cdl_component CYGPKG_LIBC_STDIO_FLOATING_POINT { | |
| 543 display "Floating point support" | |
| 544 description "This component allows floating point support | |
| 545 to be enabled in certain standard I/O | |
| 546 functions." | |
| 547 | |
| 548 type dummy | |
| 549 parent CYGPKG_LIBC_STDIO | |
| 550 } | |
| 551 | |
| 552 cdl_option CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT { | |
| 553 display "printf() family" | |
| 554 description "This option enables the use of floating point | |
| 555 number output in the printf() family (i.e. | |
| 556 printf(), sprintf(), vprintf(), etc.) of | |
| 557 functions. A substantial amount of code space | |
| 558 can be saved if this option is disabled. If it | |
| 559 is disabled then floating point specifiers | |
| 560 (%e, %f, %g) are ignored, and nothing is | |
| 561 output." | |
| 562 | |
| 563 type boolean | |
| 564 parent CYGPKG_LIBC_STDIO_FLOATING_POINT | |
| 565 requires CYGPKG_LIBM | |
| 566 } | |
| 567 | |
| 568 cdl_option CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT { | |
| 569 display "scanf() family" | |
| 570 description "This option enables the use of floating point | |
| 571 number conversion in the scanf() family (i.e. | |
| 572 scanf(), sscanf(), vscanf(), etc.) of | |
| 573 functions. A substantial amount of code space | |
| 574 can be saved if this option is disabled. If it | |
| 575 is disabled then floating point specifiers | |
| 576 (%e, %f, %g) are ignored, and nothing is | |
| 577 converted." | |
| 578 | |
| 579 type boolean | |
| 580 parent CYGPKG_LIBC_STDIO_FLOATING_POINT | |
| 581 requires CYGPKG_LIBM | |
| 582 requires CYGFUN_LIBC_strtod | |
| 583 } | |
| 584 | |
| 585 }}CFG_DATA | |
| 586 */ | |
| 587 | |
| 588 #define CYGPKG_LIBC_STDIO | |
| 589 | |
| 590 #ifdef CYGPKG_LIBC_STDIO | |
| 591 | |
| 592 #ifndef CYGPKG_DEVICES | |
| 593 # error You must have generic device driver support enabled for C library \ | |
| 594 standard I/O | |
| 595 #endif | |
| 596 | |
| 597 #define CYGIMP_LIBC_STDIO_INLINES | |
| 598 | |
| 599 #define FOPEN_MAX 8 | |
| 600 | |
| 601 #define FILENAME_MAX 16 | |
| 602 | |
| 603 #define L_tmpnam 16 | |
| 604 | |
| 605 #define TMP_MAX 0 | |
| 606 | |
| 607 #define CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO | |
| 608 | |
| 609 #define CYGNUM_LIBC_STDIO_BUFSIZE 256 | |
| 610 | |
| 611 #ifdef CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO | |
| 612 # define BUFSIZE CYGNUM_LIBC_STDIO_BUFSIZE | |
| 613 #else | |
| 614 # define BUFSIZE 0 | |
| 615 #endif | |
| 616 | |
| 617 #undef CYGSEM_LIBC_STDIO_DYNAMIC_SETVBUF | |
| 618 | |
| 619 #ifdef CYGSEM_LIBC_STDIO_DYNAMIC_SETVBUF | |
| 620 # ifndef CYGPKG_LIBC_MALLOC | |
| 621 # error You must have malloc() support if you want dynamic setvbuf \ | |
| 622 support in the C library | |
| 623 # endif | |
| 624 #endif | |
| 625 | |
| 626 #define CYGFUN_LIBC_STDIO_ungetc | |
| 627 | |
| 628 #define CYGPKG_LIBC_STDIO_OPEN | |
| 629 | |
| 630 #ifdef CYGPKG_LIBC_STDIO_OPEN | |
| 631 # ifndef CYGPKG_LIBC_MALLOC | |
| 632 # error You must have malloc() support if you want to use fopen() | |
| 633 # endif | |
| 634 #endif | |
| 635 | |
| 636 // We define a default console so that the console is defined | |
| 637 // statically, to prevent the requirement of dynamic memory allocation, and | |
| 638 // since there is generally only one relevant console which exists for the | |
| 639 // lifetime of the system. See the device driver documentation and examine | |
| 640 // your configuration to find out which device names are available. The | |
| 641 // device names should be prefixed with "/dev/". | |
| 642 // | |
| 643 // So what is the name of the device that is the default console device | |
| 644 #define CYGDAT_LIBC_STDIO_DEFAULT_CONSOLE "/dev/haldiag" | |
| 645 | |
| 646 #define CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT | |
| 647 | |
| 648 #ifdef CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT | |
| 649 # ifndef CYGPKG_LIBM | |
| 650 # error You must enable the Math library to use floating point in the \ | |
| 651 *printf() functions | |
| 652 # endif | |
| 653 #endif | |
| 654 | |
| 655 #define CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT | |
| 656 | |
| 657 #ifdef CYGSEM_LIBC_STDIO_SCANF_FLOATING_POINT | |
| 658 # ifndef CYGFUN_LIBC_strtod // libm is implicit with this | |
| 659 # error You must enable the use of strtod and the math library to use \ | |
| 660 floating point in the *scanf() functions | |
| 661 # endif | |
| 662 #endif | |
| 663 | |
| 664 #endif // ifdef CYGPKG_LIBC_STDIO | |
| 665 | |
| 666 //======================================================================== | |
| 667 | |
| 668 // THREAD SAFETY CONFIGURATION OPTIONS | |
| 669 | |
| 670 /* | |
| 671 | |
| 672 {{CFG_DATA | |
| 673 | |
| 674 cdl_component CYGSEM_LIBC_THREAD_SAFETY { | |
| 675 display "Thread safety" | |
| 676 description "This option controls whether the C library has | |
| 677 support for thread safe operation in general. | |
| 678 This requires eCos kernel support for per-thread | |
| 679 data, and adjustment of the stack limit." | |
| 680 doc ref/ecos-ref/c-and-math-library-overview-thread-safety.html | |
| 681 type boolean | |
| 682 parent CYGPKG_LIBC | |
| 683 requires CYGPKG_KERNEL | |
| 684 requires CYGVAR_KERNEL_THREADS_DATA | |
| 685 requires CYGFUN_KERNEL_THREADS_STACK_LIMIT | |
| 686 } | |
| 687 | |
| 688 cdl_option CYGSEM_LIBC_PER_THREAD_ERRNO { | |
| 689 display "Per-thread errno" | |
| 690 description "This option controls whether the standard error | |
| 691 code reporting variable errno is a per-thread | |
| 692 variable, rather than global." | |
| 693 type boolean | |
| 694 parent CYGSEM_LIBC_THREAD_SAFETY | |
| 695 } | |
| 696 | |
| 697 cdl_option CYGSEM_LIBC_PER_THREAD_STRTOK { | |
| 698 display "Per-thread strtok()" | |
| 699 description "This option controls whether the string function | |
| 700 strtok() has its state recorded on a per-thread | |
| 701 basis rather than global. If this option is | |
| 702 disabled, some per-thread space can be saved. | |
| 703 Note there is also a POSIX-standard strtok_r() | |
| 704 function to achieve a similar effect with user | |
| 705 support." | |
| 706 type boolean | |
| 707 parent CYGSEM_LIBC_THREAD_SAFETY | |
| 708 } | |
| 709 | |
| 710 cdl_option CYGSEM_LIBC_PER_THREAD_RAND { | |
| 711 display "Per-thread rand()" | |
| 712 description "This option controls whether the pseudo-random | |
| 713 number generation functions rand() and srand() | |
| 714 have their state recorded on a per-thread | |
| 715 basis rather than global. If this option is | |
| 716 disabled, some per-thread space can be saved. | |
| 717 Note there is also a POSIX-standard rand_r() | |
| 718 function to achieve a similar effect with user | |
| 719 support." | |
| 720 type boolean | |
| 721 parent CYGSEM_LIBC_THREAD_SAFETY | |
| 722 } | |
| 723 | |
| 724 cdl_option CYGSEM_LIBC_STDIO_THREAD_SAFE_STREAMS { | |
| 725 display "Thread safe I/O streams" | |
| 726 description "This option controls whether standard I/O streams | |
| 727 are thread-safe. Having this option set allows | |
| 728 the streams to be locked when accessed by | |
| 729 multiple threads simultaneously." | |
| 730 type boolean | |
| 731 parent CYGSEM_LIBC_THREAD_SAFETY | |
| 732 } | |
| 733 | |
| 734 | |
| 735 | |
| 736 }}CFG_DATA | |
| 737 | |
| 738 */ | |
| 739 | |
| 740 #undef CYGSEM_LIBC_THREAD_SAFETY | |
| 741 | |
| 742 #ifdef CYGSEM_LIBC_THREAD_SAFETY | |
| 743 | |
| 744 #define CYGSEM_LIBC_PER_THREAD_ERRNO | |
| 745 | |
| 746 #define CYGSEM_LIBC_PER_THREAD_STRTOK | |
| 747 | |
| 748 #define CYGSEM_LIBC_PER_THREAD_RAND | |
| 749 | |
| 750 #define CYGSEM_LIBC_STDIO_THREAD_SAFE_STREAMS | |
| 751 | |
| 752 // Consistency check for kernel support | |
| 753 # if !defined(CYGVAR_KERNEL_THREADS_DATA) || !defined(CYGFUN_KERNEL_THREADS_STACK_LIMIT) | |
| 754 | |
| 755 # error Sorry, the kernel must have per-thread data and stack limit \ | |
| 756 support configured to allow a thread-safe C library | |
| 757 | |
| 758 # endif // if !defined(CYGVAR_KERNEL_THREADS_DATA) || | |
| 759 // !defined(CYGFUN_KERNEL_THREADS_STACK_LIMIT) | |
| 760 | |
| 761 #endif // ifdef CYGSEM_LIBC_THREAD_SAFETY | |
| 762 | |
| 763 //======================================================================== | |
| 764 | |
| 765 // INTERNATIONALIZATION AND LOCALIZATION OPTIONS | |
| 766 | |
| 767 /* | |
| 768 | |
| 769 {{CFG_DATA | |
| 770 | |
| 771 cdl_option CYGNUM_LIBC_MAX_LOCALE_NAME_SIZE { | |
| 772 display "Size of locale name strings" | |
| 773 description "This option controls the maximum size of | |
| 774 locale names and is used, among other things | |
| 775 to instantiate a static string used | |
| 776 as a return value from the | |
| 777 setlocale() function. When requesting the | |
| 778 current locale settings with LC_ALL, a string | |
| 779 must be constructed to contain this data, rather | |
| 780 than just returning a constant string. This | |
| 781 string data is stored in the static string. | |
| 782 This depends on the length of locale names, | |
| 783 hence this option. If just the C locale is | |
| 784 present, this option can be set as low as 2." | |
| 785 | |
| 786 type count | |
| 787 legal_values 2 to 0x7fffffff | |
| 788 parent CYGPKG_LIBC | |
| 789 } | |
| 790 | |
| 791 }}CFG_DATA | |
| 792 | |
| 793 */ | |
| 794 | |
| 795 #define CYGNUM_LIBC_MAX_LOCALE_NAME_SIZE 16 | |
| 796 | |
| 797 //======================================================================== | |
| 798 | |
| 799 // STARTUP OPTIONS | |
| 800 | |
| 801 /* | |
| 802 {{CFG_DATA | |
| 803 | |
| 804 cdl_component CYGPKG_LIBC_STARTUP { | |
| 805 display "ISO C startup/termination" | |
| 806 description "This component manages the control of the | |
| 807 environment (in the general sense) that the | |
| 808 C library provides for use for full ISO C | |
| 809 compatibility, including a main() entry point | |
| 810 supplied with arguments and an environment | |
| 811 (as retrievable by the getenv() function). | |
| 812 It also includes at the other end of things, | |
| 813 what happens when main() returns or exit() is | |
| 814 called." | |
| 815 doc ref/ecos-ref/c-library-startup.html.html | |
| 816 type dummy | |
| 817 parent CYGPKG_LIBC | |
| 818 } | |
| 819 | |
| 820 cdl_option CYGDAT_LIBC_ARGUMENTS { | |
| 821 display "Arguments to main()" | |
| 822 description "This option allows the setting of the arguments | |
| 823 to the main function. This only has any effect | |
| 824 when cyg_iso_c_start() is used to start the | |
| 825 ISO C compatibility. This will automatically | |
| 826 invoke main() in an ISO C compatible fashion. | |
| 827 This option is in fact used as argv, and so is | |
| 828 an n-tuple of string constants. The final | |
| 829 entry must be NULL. Conventionally if argv[0] | |
| 830 is supplied, it is used to inform the program | |
| 831 of its name." | |
| 832 | |
| 833 type string | |
| 834 parent CYGPKG_LIBC_STARTUP | |
| 835 } | |
| 836 | |
| 837 cdl_option CYGNUM_LIBC_MAIN_STACK_SIZE { | |
| 838 display "main()'s thread stack size" | |
| 839 description "With an eCos kernel, when the cyg_iso_c_start() | |
| 840 function is used to invoke the user-supplied | |
| 841 main() function in an ISO C compatible fashion, | |
| 842 a separate thread is created to call main(). | |
| 843 This option controls the size of that thread's | |
| 844 stack, which is allocated in the BSS. It | |
| 845 must be a multiple of 8." | |
| 846 | |
| 847 type count | |
| 848 legal_values 16 to 0x7fffffff | |
| 849 parent CYGPKG_LIBC_STARTUP | |
| 850 #requires CYGPKG_KERNEL | |
| 851 } | |
| 852 | |
| 853 cdl_option CYGNUM_LIBC_ATEXIT_HANDLERS { | |
| 854 display "Number of functions atexit() supports" | |
| 855 description "This option sets the number of functions | |
| 856 that atexit() has room for. In other words, | |
| 857 the number of separate atexit() calls that | |
| 858 can be made before calling exit() or returning | |
| 859 from main() ( in an environment controlled by | |
| 860 cyg_iso_c_start() ). For strict compliance | |
| 861 with the ISO C standard this should be at | |
| 862 least 32." | |
| 863 | |
| 864 type count | |
| 865 parent CYGPKG_LIBC_STARTUP | |
| 866 legal_values 1 to 0x7fffffff | |
| 867 } | |
| 868 | |
| 869 cdl_option CYGSEM_LIBC_EXIT_STOPS_SYSTEM { | |
| 870 display "_exit() stops all threads" | |
| 871 description "If this option is enabled then _exit(), | |
| 872 which is called from exit() which itself is | |
| 873 called on return from main(), stops the eCos | |
| 874 scheduler. For strict POSIX 1003.1 | |
| 875 compatibility this would be the normal | |
| 876 behaviour. To allow the thread to simply | |
| 877 exit, without affecting other threads, simply | |
| 878 disable this option. If there is no eCos | |
| 879 scheduler, then _exit() simply loops | |
| 880 irrespective of the setting of this option." | |
| 881 | |
| 882 type boolean | |
| 883 parent CYGPKG_LIBC_STARTUP | |
| 884 requires CYGPKG_KERNEL | |
| 885 } | |
| 886 | |
| 887 cdl_component CYGPKG_LIBC_ENVIRONMENT { | |
| 888 display "Provide a system environment" | |
| 889 description "This option allows use of the getenv() function | |
| 890 and the global environment pointer | |
| 891 char **environ defined by POSIX 1003.1. | |
| 892 Disabling this saves a small amount of space." | |
| 893 | |
| 894 type boolean | |
| 895 parent CYGPKG_LIBC_STARTUP | |
| 896 } | |
| 897 | |
| 898 cdl_option CYGDAT_LIBC_DEFAULT_ENVIRONMENT { | |
| 899 display "Default environment" | |
| 900 description "This option allows the setting of the default | |
| 901 contents of the environment. This is in fact | |
| 902 the contents of the global environment pointer | |
| 903 char **environ defined by POSIX 1003.1. Strings | |
| 904 must be of the form NAME=VALUE, and the final | |
| 905 entry must be NULL." | |
| 906 | |
| 907 type string | |
| 908 parent CYGPKG_LIBC_ENVIRONMENT | |
| 909 } | |
| 910 | |
| 911 }}CFG_DATA | |
| 912 */ | |
| 913 | |
| 914 #define CYGDAT_LIBC_ARGUMENTS { "", NULL } | |
| 915 | |
| 916 #define CYGNUM_LIBC_MAIN_STACK_SIZE 32768 | |
| 917 | |
| 918 #define CYGNUM_LIBC_ATEXIT_HANDLERS 32 | |
| 919 | |
| 920 #undef CYGSEM_LIBC_EXIT_STOPS_SYSTEM | |
| 921 | |
| 922 #define CYGPKG_LIBC_ENVIRONMENT | |
| 923 | |
| 924 #define CYGDAT_LIBC_DEFAULT_ENVIRONMENT { NULL } | |
| 925 | |
| 926 | |
| 927 //======================================================================== | |
| 928 | |
| 929 // TRACING OPTIONS | |
| 930 | |
| 931 /* | |
| 932 {{CFG_DATA | |
| 933 | |
| 934 cdl_component CYGPKG_LIBC_TRACE { | |
| 935 display "Tracing output levels in C library" | |
| 936 description "Tracing support is useful for debugging. Some | |
| 937 C library modules can be configured with | |
| 938 different levels of tracing verbosity. These | |
| 939 levels can be configured here." | |
| 940 | |
| 941 type boolean | |
| 942 requires CYGDBG_USE_TRACING | |
| 943 parent CYGPKG_LIBC | |
| 944 } | |
| 945 | |
| 946 cdl_option CYGNUM_LIBC_RAND_TRACE_LEVEL { | |
| 947 display "rand(), srand() and rand_r()" | |
| 948 description "Trace level for debugging the rand(), srand() | |
| 949 and rand_r() functions." | |
| 950 | |
| 951 type count | |
| 952 legal_values 0 to 1 | |
| 953 parent CYGPKG_LIBC_TRACE | |
| 954 } | |
| 955 | |
| 956 cdl_option CYGNUM_LIBC_ERRNO_TRACE_LEVEL { | |
| 957 display "errno" | |
| 958 description "Trace level for debugging the errno retrieval | |
| 959 mechanism in errno.cxx." | |
| 960 | |
| 961 type count | |
| 962 legal_values 0 to 1 | |
| 963 parent CYGPKG_LIBC_TRACE | |
| 964 } | |
| 965 | |
| 966 cdl_option CYGNUM_LIBC_BSEARCH_TRACE_LEVEL { | |
| 967 display "bsearch()" | |
| 968 description "Trace level for debugging the <stdlib.h> binary | |
| 969 search function bsearch()." | |
| 970 | |
| 971 type count | |
| 972 legal_values 0 to 1 | |
| 973 parent CYGPKG_LIBC_TRACE | |
| 974 } | |
| 975 | |
| 976 cdl_option CYGNUM_LIBC_QSORT_TRACE_LEVEL { | |
| 977 display "qsort()" | |
| 978 description "Trace level for debugging the <stdlib.h> | |
| 979 quicksort function qsort()." | |
| 980 | |
| 981 type count | |
| 982 legal_values 0 to 1 | |
| 983 parent CYGPKG_LIBC_TRACE | |
| 984 } | |
| 985 | |
| 986 cdl_option CYGNUM_LIBC_CLOCK_TRACE_LEVEL { | |
| 987 display "clock()" | |
| 988 description "Trace level for debugging the <time.h> function | |
| 989 clock()." | |
| 990 | |
| 991 type count | |
| 992 legal_values 0 to 1 | |
| 993 parent CYGPKG_LIBC_TRACE | |
| 994 } | |
| 995 | |
| 996 cdl_option CYGNUM_LIBC_STRTOK_TRACE_LEVEL { | |
| 997 display "strtok() and strtok_r()" | |
| 998 description "Trace level for debugging the <string.h> | |
| 999 functions strtok() and strtok_r()." | |
| 1000 | |
| 1001 type count | |
| 1002 legal_values 0 to 1 | |
| 1003 parent CYGPKG_LIBC_TRACE | |
| 1004 } | |
| 1005 | |
| 1006 }}CFG_DATA | |
| 1007 */ | |
| 1008 | |
| 1009 #undef CYGPKG_LIBC_TRACE | |
| 1010 | |
| 1011 #ifdef CYGPKG_LIBC_TRACE | |
| 1012 | |
| 1013 #define CYGNUM_LIBC_RAND_TRACE_LEVEL 0 | |
| 1014 | |
| 1015 #define CYGNUM_LIBC_ERRNO_TRACE_LEVEL 0 | |
| 1016 | |
| 1017 #define CYGNUM_LIBC_BSEARCH_TRACE_LEVEL 0 | |
| 1018 | |
| 1019 #define CYGNUM_LIBC_QSORT_TRACE_LEVEL 0 | |
| 1020 | |
| 1021 #define CYGNUM_LIBC_CLOCK_TRACE_LEVEL 0 | |
| 1022 | |
| 1023 #define CYGNUM_LIBC_STRTOK_TRACE_LEVEL 0 | |
| 1024 | |
| 1025 #endif // ifdef CYGPKG_LIBC_TRACE | |
| 1026 | |
| 1027 //======================================================================== | |
| 1028 | |
| 1029 // MISCELLANEOUS CONFIGURATION OPTIONS | |
| 1030 | |
| 1031 // These are not really adjustable by the user. Do not change these unless | |
| 1032 // you know what you are doing! | |
| 1033 | |
| 1034 // How to define inline functions | |
| 1035 #define CYGPRI_LIBC_INLINE extern __inline__ | |
| 1036 | |
| 1037 // How to define weak symbols - may disappear as this is only relevant for | |
| 1038 // ELF and a.out | |
| 1039 #define CYGPRI_LIBC_WEAK __attribute__ ((weak)) | |
| 1040 | |
| 1041 // How to define aliases | |
| 1042 #define CYGPRI_LIBC_ALIAS(X) __attribute__ ((alias (X))) | |
| 1043 | |
| 1044 // How to define weak aliases or an equivalent hack if not available | |
| 1045 | |
| 1046 #define CYGPRI_LIBC_WEAK_ALIAS(X) __attribute__ ((weak, alias (X))) | |
| 1047 | |
| 1048 // How to define functions that don't return | |
| 1049 #define CYGPRI_LIBC_NORETURN __attribute__ ((noreturn)) | |
| 1050 | |
| 1051 #endif // CYGONCE_PKGCONF_LIBC_H multiple inclusion protection | |
| 1052 | |
| 1053 // EOF libc.h |
