diff options
| author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-10-19 22:14:58 +0000 |
|---|---|---|
| committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-10-19 22:14:58 +0000 |
| commit | 9fa9950784a0399b03473281de0109214552dbdf (patch) | |
| tree | 51abcccf0c91efea2a07b70ffe6a9aecd86b21a2 /scripts/basic | |
| parent | b560577cb27a4a15a5e1a77d3ac720d2151d3d60 (diff) | |
| download | busybox-w32-9fa9950784a0399b03473281de0109214552dbdf.tar.gz busybox-w32-9fa9950784a0399b03473281de0109214552dbdf.tar.bz2 busybox-w32-9fa9950784a0399b03473281de0109214552dbdf.zip | |
build system: check for ENABLE_, USE_ and SKIP_ (not only for CONFIG_)
Diffstat (limited to 'scripts/basic')
| -rw-r--r-- | scripts/basic/fixdep.c | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index cc2c6541b..df3446e35 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c | |||
| @@ -114,10 +114,12 @@ | |||
| 114 | #include <ctype.h> | 114 | #include <ctype.h> |
| 115 | #include <arpa/inet.h> | 115 | #include <arpa/inet.h> |
| 116 | 116 | ||
| 117 | /* bbox: not needed | ||
| 117 | #define INT_CONF ntohl(0x434f4e46) | 118 | #define INT_CONF ntohl(0x434f4e46) |
| 118 | #define INT_ONFI ntohl(0x4f4e4649) | 119 | #define INT_ONFI ntohl(0x4f4e4649) |
| 119 | #define INT_NFIG ntohl(0x4e464947) | 120 | #define INT_NFIG ntohl(0x4e464947) |
| 120 | #define INT_FIG_ ntohl(0x4649475f) | 121 | #define INT_FIG_ ntohl(0x4649475f) |
| 122 | */ | ||
| 121 | 123 | ||
| 122 | char *target; | 124 | char *target; |
| 123 | char *depfile; | 125 | char *depfile; |
| @@ -222,30 +224,32 @@ void use_config(char *m, int slen) | |||
| 222 | 224 | ||
| 223 | void parse_config_file(char *map, size_t len) | 225 | void parse_config_file(char *map, size_t len) |
| 224 | { | 226 | { |
| 225 | int *end = (int *) (map + len); | 227 | /* modified for bbox */ |
| 226 | /* start at +1, so that p can never be < map */ | 228 | char *end = map + len; |
| 227 | int *m = (int *) map + 1; | 229 | char *p = map; |
| 228 | char *p, *q; | 230 | char *q; |
| 229 | 231 | int off; | |
| 230 | for (; m < end; m++) { | 232 | |
| 231 | if (*m == INT_CONF) { p = (char *) m ; goto conf; } | 233 | for (; p < end; p++) { |
| 232 | if (*m == INT_ONFI) { p = (char *) m-1; goto conf; } | 234 | if (!memcmp(p, "CONFIG_", 7)) goto conf7; |
| 233 | if (*m == INT_NFIG) { p = (char *) m-2; goto conf; } | 235 | if (!memcmp(p, "ENABLE_", 7)) goto conf7; |
| 234 | if (*m == INT_FIG_) { p = (char *) m-3; goto conf; } | 236 | if (!memcmp(p, "USE_", 4)) goto conf4; |
| 237 | if (!memcmp(p, "SKIP_", 5)) goto conf5; | ||
| 235 | continue; | 238 | continue; |
| 239 | conf4: off = 4; goto conf; | ||
| 240 | conf5: off = 5; goto conf; | ||
| 241 | conf7: off = 7; | ||
| 236 | conf: | 242 | conf: |
| 237 | if (p > map + len - 7) | 243 | if (p > map + len - off) |
| 238 | continue; | 244 | continue; |
| 239 | if (memcmp(p, "CONFIG_", 7)) | 245 | for (q = p + off; q < map + len; q++) { |
| 240 | continue; | ||
| 241 | for (q = p + 7; q < map + len; q++) { | ||
| 242 | if (!(isalnum(*q) || *q == '_')) | 246 | if (!(isalnum(*q) || *q == '_')) |
| 243 | goto found; | 247 | goto found; |
| 244 | } | 248 | } |
| 245 | continue; | 249 | continue; |
| 246 | 250 | ||
| 247 | found: | 251 | found: |
| 248 | use_config(p+7, q-p-7); | 252 | use_config(p+off, q-p-off); |
| 249 | } | 253 | } |
| 250 | } | 254 | } |
| 251 | 255 | ||
| @@ -366,6 +370,7 @@ void print_deps(void) | |||
| 366 | 370 | ||
| 367 | void traps(void) | 371 | void traps(void) |
| 368 | { | 372 | { |
| 373 | /* bbox: not needed | ||
| 369 | static char test[] __attribute__((aligned(sizeof(int)))) = "CONF"; | 374 | static char test[] __attribute__((aligned(sizeof(int)))) = "CONF"; |
| 370 | 375 | ||
| 371 | if (*(int *)test != INT_CONF) { | 376 | if (*(int *)test != INT_CONF) { |
| @@ -373,6 +378,7 @@ void traps(void) | |||
| 373 | *(int *)test); | 378 | *(int *)test); |
| 374 | exit(2); | 379 | exit(2); |
| 375 | } | 380 | } |
| 381 | */ | ||
| 376 | } | 382 | } |
| 377 | 383 | ||
| 378 | int main(int argc, char *argv[]) | 384 | int main(int argc, char *argv[]) |
