diff options
author | vodz <vodz@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-02-15 12:29:37 +0000 |
---|---|---|
committer | vodz <vodz@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-02-15 12:29:37 +0000 |
commit | b4f1d9939d4ab3f45c7feb1774fc00f63865efe0 (patch) | |
tree | 35ee2aa8216995e7665272e8e2b58f017f7dfdcd /scripts/config | |
parent | 78f86409549faa383de5d405fdaae57c0ff932cb (diff) | |
download | busybox-w32-b4f1d9939d4ab3f45c7feb1774fc00f63865efe0.tar.gz busybox-w32-b4f1d9939d4ab3f45c7feb1774fc00f63865efe0.tar.bz2 busybox-w32-b4f1d9939d4ab3f45c7feb1774fc00f63865efe0.zip |
full removed config.h, use bb_config.h only
git-svn-id: svn://busybox.net/trunk/busybox@14055 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'scripts/config')
-rw-r--r-- | scripts/config/confdata.c | 42 |
1 files changed, 36 insertions, 6 deletions
diff --git a/scripts/config/confdata.c b/scripts/config/confdata.c index c4087fd73..fa262930f 100644 --- a/scripts/config/confdata.c +++ b/scripts/config/confdata.c | |||
@@ -279,6 +279,7 @@ int conf_write(const char *name) | |||
279 | char dirname[128], tmpname[128], newname[128]; | 279 | char dirname[128], tmpname[128], newname[128]; |
280 | int type, l; | 280 | int type, l; |
281 | const char *str; | 281 | const char *str; |
282 | const char *opt_name; | ||
282 | 283 | ||
283 | dirname[0] = 0; | 284 | dirname[0] = 0; |
284 | if (name && name[0]) { | 285 | if (name && name[0]) { |
@@ -316,6 +317,7 @@ int conf_write(const char *name) | |||
316 | "# Automatically generated make config: don't edit\n" | 317 | "# Automatically generated make config: don't edit\n" |
317 | "#\n"); | 318 | "#\n"); |
318 | if (out_h) { | 319 | if (out_h) { |
320 | fprintf(out_h, "#ifndef BB_CONFIG_H\n#define BB_CONFIG_H\n"); | ||
319 | fprintf(out_h, "/*\n" | 321 | fprintf(out_h, "/*\n" |
320 | " * Automatically generated header file: don't edit\n" | 322 | " * Automatically generated header file: don't edit\n" |
321 | " */\n\n" | 323 | " */\n\n" |
@@ -367,14 +369,23 @@ int conf_write(const char *name) | |||
367 | if (modules_sym->curr.tri == no) | 369 | if (modules_sym->curr.tri == no) |
368 | type = S_BOOLEAN; | 370 | type = S_BOOLEAN; |
369 | } | 371 | } |
372 | opt_name = strchr(sym->name, '_'); | ||
373 | if(opt_name == NULL) | ||
374 | opt_name = sym->name; | ||
375 | else | ||
376 | opt_name++; | ||
370 | switch (type) { | 377 | switch (type) { |
371 | case S_BOOLEAN: | 378 | case S_BOOLEAN: |
372 | case S_TRISTATE: | 379 | case S_TRISTATE: |
373 | switch (sym_get_tristate_value(sym)) { | 380 | switch (sym_get_tristate_value(sym)) { |
374 | case no: | 381 | case no: |
375 | fprintf(out, "# %s is not set\n", sym->name); | 382 | fprintf(out, "# %s is not set\n", sym->name); |
376 | if (out_h) | 383 | if (out_h) { |
377 | fprintf(out_h, "#undef %s\n", sym->name); | 384 | fprintf(out_h, "#undef %s\n", sym->name); |
385 | fprintf(out_h, "#define ENABLE_%s 0\n", opt_name); | ||
386 | fprintf(out_h, "#define USE_%s(...)\n", opt_name); | ||
387 | fprintf(out_h, "#define UNUSE_%s(...) __VA_ARGS__\n", opt_name); | ||
388 | } | ||
378 | break; | 389 | break; |
379 | case mod: | 390 | case mod: |
380 | #if 0 | 391 | #if 0 |
@@ -385,8 +396,12 @@ int conf_write(const char *name) | |||
385 | break; | 396 | break; |
386 | case yes: | 397 | case yes: |
387 | fprintf(out, "%s=y\n", sym->name); | 398 | fprintf(out, "%s=y\n", sym->name); |
388 | if (out_h) | 399 | if (out_h) { |
389 | fprintf(out_h, "#define %s 1\n", sym->name); | 400 | fprintf(out_h, "#define %s 1\n", sym->name); |
401 | fprintf(out_h, "#define ENABLE_%s 1\n", opt_name); | ||
402 | fprintf(out_h, "#define USE_%s(...) __VA_ARGS__\n", opt_name); | ||
403 | fprintf(out_h, "#define UNUSE_%s(...)\n", opt_name); | ||
404 | } | ||
390 | break; | 405 | break; |
391 | } | 406 | } |
392 | break; | 407 | break; |
@@ -412,32 +427,47 @@ int conf_write(const char *name) | |||
412 | } | 427 | } |
413 | } while (*str); | 428 | } while (*str); |
414 | fputs("\"\n", out); | 429 | fputs("\"\n", out); |
415 | if (out_h) | 430 | if (out_h) { |
416 | fputs("\"\n", out_h); | 431 | fputs("\"\n", out_h); |
432 | fprintf(out_h, "#define ENABLE_%s 1\n", opt_name); | ||
433 | fprintf(out_h, "#define USE_%s(...) __VA_ARGS__\n", opt_name); | ||
434 | fprintf(out_h, "#define UNUSE_%s(...)\n", opt_name); | ||
435 | } | ||
417 | break; | 436 | break; |
418 | case S_HEX: | 437 | case S_HEX: |
419 | str = sym_get_string_value(sym); | 438 | str = sym_get_string_value(sym); |
420 | if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) { | 439 | if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) { |
421 | fprintf(out, "%s=%s\n", sym->name, *str ? str : "0"); | 440 | fprintf(out, "%s=%s\n", sym->name, *str ? str : "0"); |
422 | if (out_h) | 441 | if (out_h) { |
423 | fprintf(out_h, "#define %s 0x%s\n", sym->name, str); | 442 | fprintf(out_h, "#define %s 0x%s\n", sym->name, str); |
443 | fprintf(out_h, "#define ENABLE_%s 1\n", opt_name); | ||
444 | fprintf(out_h, "#define USE_%s(...) __VA_ARGS__\n", opt_name); | ||
445 | fprintf(out_h, "#define UNUSE_%s(...)\n", opt_name); | ||
446 | } | ||
424 | break; | 447 | break; |
425 | } | 448 | } |
426 | case S_INT: | 449 | case S_INT: |
427 | str = sym_get_string_value(sym); | 450 | str = sym_get_string_value(sym); |
428 | fprintf(out, "%s=%s\n", sym->name, *str ? str : "0"); | 451 | fprintf(out, "%s=%s\n", sym->name, *str ? str : "0"); |
429 | if (out_h) | 452 | if (out_h) { |
430 | fprintf(out_h, "#define %s %s\n", sym->name, str); | 453 | fprintf(out_h, "#define %s %s\n", sym->name, str); |
454 | fprintf(out_h, "#define ENABLE_%s 1\n", opt_name); | ||
455 | fprintf(out_h, "#define USE_%s(...) __VA_ARGS__\n", opt_name); | ||
456 | fprintf(out_h, "#define UNUSE_%s(...)\n", opt_name); | ||
457 | } | ||
431 | break; | 458 | break; |
432 | } | 459 | } |
460 | if (out_h) | ||
461 | fprintf(out_h, "\n"); | ||
433 | } | 462 | } |
434 | next: | 463 | next: |
435 | menu = next_menu(menu); | 464 | menu = next_menu(menu); |
436 | } | 465 | } |
437 | fclose(out); | 466 | fclose(out); |
438 | if (out_h) { | 467 | if (out_h) { |
468 | fprintf(out_h, "#endif /* BB_CONFIG_H */\n"); | ||
439 | fclose(out_h); | 469 | fclose(out_h); |
440 | rename(".tmpconfig.h", "include/config.h"); | 470 | rename(".tmpconfig.h", "include/bb_config.h"); |
441 | file_write_dep(NULL); | 471 | file_write_dep(NULL); |
442 | } | 472 | } |
443 | if (!name || basename != conf_def_filename) { | 473 | if (!name || basename != conf_def_filename) { |