diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/basic/.gitignore | 3 | ||||
-rw-r--r-- | scripts/basic/docproc.c | 15 | ||||
-rw-r--r-- | scripts/basic/fixdep.c | 68 | ||||
-rw-r--r-- | scripts/basic/split-include.c | 13 | ||||
-rwxr-xr-x | scripts/bloat-o-meter | 25 | ||||
-rw-r--r-- | scripts/kconfig/.gitignore | 1 | ||||
-rw-r--r-- | scripts/kconfig/conf.c | 15 | ||||
-rw-r--r-- | scripts/kconfig/confdata.c | 9 | ||||
-rw-r--r-- | scripts/kconfig/lkc.h | 6 | ||||
-rw-r--r-- | scripts/kconfig/mconf.c | 25 | ||||
-rw-r--r-- | scripts/kconfig/symbol.c | 15 | ||||
-rw-r--r-- | scripts/kconfig/zconf.hash.c_shipped | 60 | ||||
-rw-r--r-- | scripts/kconfig/zconf.tab.c_shipped | 1 |
13 files changed, 214 insertions, 42 deletions
diff --git a/scripts/basic/.gitignore b/scripts/basic/.gitignore index d91e941a4..3d20e4f15 100644 --- a/scripts/basic/.gitignore +++ b/scripts/basic/.gitignore | |||
@@ -2,3 +2,6 @@ hash | |||
2 | fixdep | 2 | fixdep |
3 | docproc | 3 | docproc |
4 | split-include | 4 | split-include |
5 | /docproc.exe | ||
6 | /fixdep.exe | ||
7 | /split-include.exe | ||
diff --git a/scripts/basic/docproc.c b/scripts/basic/docproc.c index 4464e1874..2c7a19b83 100644 --- a/scripts/basic/docproc.c +++ b/scripts/basic/docproc.c | |||
@@ -38,7 +38,9 @@ | |||
38 | #include <unistd.h> | 38 | #include <unistd.h> |
39 | #include <limits.h> | 39 | #include <limits.h> |
40 | #include <sys/types.h> | 40 | #include <sys/types.h> |
41 | #ifndef __MINGW32__ | ||
41 | #include <sys/wait.h> | 42 | #include <sys/wait.h> |
43 | #endif | ||
42 | //bbox disabled: #include <alloca.h> | 44 | //bbox disabled: #include <alloca.h> |
43 | 45 | ||
44 | /* exitstatus is used to keep track of any failing calls to kernel-doc, | 46 | /* exitstatus is used to keep track of any failing calls to kernel-doc, |
@@ -78,12 +80,24 @@ void usage (void) | |||
78 | */ | 80 | */ |
79 | void exec_kernel_doc(char **svec) | 81 | void exec_kernel_doc(char **svec) |
80 | { | 82 | { |
83 | #ifndef __MINGW32__ | ||
81 | pid_t pid; | 84 | pid_t pid; |
82 | int ret; | 85 | int ret; |
86 | #endif | ||
83 | char *real_filename; | 87 | char *real_filename; |
84 | int rflen; | 88 | int rflen; |
85 | 89 | ||
86 | /* Make sure output generated so far are flushed */ | 90 | /* Make sure output generated so far are flushed */ |
91 | #ifdef __MINGW32__ | ||
92 | fflush(stdout); | ||
93 | rflen = strlen(getenv("SRCTREE")); | ||
94 | rflen += strlen(KERNELDOCPATH KERNELDOC); | ||
95 | real_filename = alloca(rflen + 1); | ||
96 | strcpy(real_filename, getenv("SRCTREE")); | ||
97 | strcat(real_filename, KERNELDOCPATH KERNELDOC); | ||
98 | fprintf(stderr, "NOTIMPL: exec %s\n", real_filename); | ||
99 | exit(1); | ||
100 | #else | ||
87 | fflush(stdout); | 101 | fflush(stdout); |
88 | switch(pid=fork()) { | 102 | switch(pid=fork()) { |
89 | case -1: | 103 | case -1: |
@@ -106,6 +120,7 @@ void exec_kernel_doc(char **svec) | |||
106 | exitstatus |= WEXITSTATUS(ret); | 120 | exitstatus |= WEXITSTATUS(ret); |
107 | else | 121 | else |
108 | exitstatus = 0xff; | 122 | exitstatus = 0xff; |
123 | #endif | ||
109 | } | 124 | } |
110 | 125 | ||
111 | /* Types used to create list of all exported symbols in a number of files */ | 126 | /* Types used to create list of all exported symbols in a number of files */ |
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index 426b4888b..64fd92f06 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c | |||
@@ -104,7 +104,9 @@ | |||
104 | 104 | ||
105 | #include <sys/types.h> | 105 | #include <sys/types.h> |
106 | #include <sys/stat.h> | 106 | #include <sys/stat.h> |
107 | #ifndef __MINGW32__ | ||
107 | #include <sys/mman.h> | 108 | #include <sys/mman.h> |
109 | #endif | ||
108 | #include <unistd.h> | 110 | #include <unistd.h> |
109 | #include <fcntl.h> | 111 | #include <fcntl.h> |
110 | #include <string.h> | 112 | #include <string.h> |
@@ -112,7 +114,9 @@ | |||
112 | #include <stdio.h> | 114 | #include <stdio.h> |
113 | #include <limits.h> | 115 | #include <limits.h> |
114 | #include <ctype.h> | 116 | #include <ctype.h> |
117 | #ifndef __MINGW32__ | ||
115 | #include <arpa/inet.h> | 118 | #include <arpa/inet.h> |
119 | #endif | ||
116 | //bbox disabled: #include <alloca.h> | 120 | //bbox disabled: #include <alloca.h> |
117 | 121 | ||
118 | /* bbox: not needed | 122 | /* bbox: not needed |
@@ -122,6 +126,57 @@ | |||
122 | #define INT_FIG_ ntohl(0x4649475f) | 126 | #define INT_FIG_ ntohl(0x4649475f) |
123 | */ | 127 | */ |
124 | 128 | ||
129 | #ifndef O_BINARY | ||
130 | #define O_BINARY 0 | ||
131 | #endif | ||
132 | |||
133 | #ifdef __MINGW32__ | ||
134 | #define UNUSED __attribute__ ((__unused__)) | ||
135 | |||
136 | /* Workaround specifically for fixdep */ | ||
137 | #define PROT_READ 0 | ||
138 | #define MAP_PRIVATE 0 | ||
139 | void *mmap(void *start UNUSED, size_t size, int prot UNUSED, | ||
140 | int flags UNUSED, int fd, off_t offset UNUSED) | ||
141 | { | ||
142 | void *p; | ||
143 | void *curP; | ||
144 | ssize_t readB; | ||
145 | |||
146 | p = malloc(size); | ||
147 | if (!p) | ||
148 | return (void*)((long)-1); | ||
149 | |||
150 | curP = p; | ||
151 | |||
152 | while (size > 0) | ||
153 | { | ||
154 | readB = read(fd, curP, size); | ||
155 | |||
156 | if (readB == 0) | ||
157 | { | ||
158 | /* EOF reached */ | ||
159 | break; | ||
160 | } | ||
161 | else if (readB < 0) | ||
162 | { | ||
163 | perror("fixdep: read config"); | ||
164 | free(p); | ||
165 | return (void*)((long)-1); | ||
166 | } | ||
167 | |||
168 | size -= readB; | ||
169 | curP += readB; | ||
170 | } | ||
171 | |||
172 | return p; | ||
173 | } | ||
174 | void munmap(void *p, size_t size UNUSED) | ||
175 | { | ||
176 | free(p); | ||
177 | } | ||
178 | #endif | ||
179 | |||
125 | char *target; | 180 | char *target; |
126 | char *depfile; | 181 | char *depfile; |
127 | char *cmdline; | 182 | char *cmdline; |
@@ -286,7 +341,7 @@ void do_config_file(char *filename) | |||
286 | int fd; | 341 | int fd; |
287 | void *map; | 342 | void *map; |
288 | 343 | ||
289 | fd = open(filename, O_RDONLY); | 344 | fd = open(filename, O_RDONLY | O_BINARY); |
290 | if (fd < 0) { | 345 | if (fd < 0) { |
291 | fprintf(stderr, "fixdep: "); | 346 | fprintf(stderr, "fixdep: "); |
292 | perror(filename); | 347 | perror(filename); |
@@ -298,7 +353,7 @@ void do_config_file(char *filename) | |||
298 | return; | 353 | return; |
299 | } | 354 | } |
300 | map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0); | 355 | map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0); |
301 | if ((long) map == -1) { | 356 | if ((intptr_t) map == -1) { |
302 | perror("fixdep: mmap"); | 357 | perror("fixdep: mmap"); |
303 | close(fd); | 358 | close(fd); |
304 | return; | 359 | return; |
@@ -334,10 +389,12 @@ void parse_dep_file(void *map, size_t len) | |||
334 | m++; | 389 | m++; |
335 | p = m; | 390 | p = m; |
336 | while (p < end && *p != ' ') p++; | 391 | while (p < end && *p != ' ') p++; |
392 | if (p == m) break; | ||
337 | if (p == end) { | 393 | if (p == end) { |
338 | do p--; while (!isalnum((unsigned char)*p)); | 394 | do p--; while (p != m && !isalnum((unsigned char)*p)); |
339 | p++; | 395 | p++; |
340 | } | 396 | } |
397 | if (p == m) break; | ||
341 | memcpy(s, m, p-m); s[p-m] = 0; | 398 | memcpy(s, m, p-m); s[p-m] = 0; |
342 | if (strrcmp(s, "include/autoconf.h") && | 399 | if (strrcmp(s, "include/autoconf.h") && |
343 | strrcmp(s, "arch/um/include/uml-config.h") && | 400 | strrcmp(s, "arch/um/include/uml-config.h") && |
@@ -345,6 +402,7 @@ void parse_dep_file(void *map, size_t len) | |||
345 | printf(" %s \\\n", s); | 402 | printf(" %s \\\n", s); |
346 | do_config_file(s); | 403 | do_config_file(s); |
347 | } | 404 | } |
405 | if (p == end) break; | ||
348 | m = p + 1; | 406 | m = p + 1; |
349 | } | 407 | } |
350 | printf("\n%s: $(deps_%s)\n\n", target, target); | 408 | printf("\n%s: $(deps_%s)\n\n", target, target); |
@@ -357,7 +415,7 @@ void print_deps(void) | |||
357 | int fd; | 415 | int fd; |
358 | void *map; | 416 | void *map; |
359 | 417 | ||
360 | fd = open(depfile, O_RDONLY); | 418 | fd = open(depfile, O_RDONLY | O_BINARY); |
361 | if (fd < 0) { | 419 | if (fd < 0) { |
362 | fprintf(stderr, "fixdep: "); | 420 | fprintf(stderr, "fixdep: "); |
363 | perror(depfile); | 421 | perror(depfile); |
@@ -370,7 +428,7 @@ void print_deps(void) | |||
370 | return; | 428 | return; |
371 | } | 429 | } |
372 | map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0); | 430 | map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0); |
373 | if ((long) map == -1) { | 431 | if ((intptr_t) map == -1) { |
374 | perror("fixdep: mmap"); | 432 | perror("fixdep: mmap"); |
375 | close(fd); | 433 | close(fd); |
376 | return; | 434 | return; |
diff --git a/scripts/basic/split-include.c b/scripts/basic/split-include.c index 6ef29195e..290bea2fb 100644 --- a/scripts/basic/split-include.c +++ b/scripts/basic/split-include.c | |||
@@ -39,8 +39,6 @@ | |||
39 | exit(1); \ | 39 | exit(1); \ |
40 | } | 40 | } |
41 | 41 | ||
42 | |||
43 | |||
44 | int main(int argc, const char * argv []) | 42 | int main(int argc, const char * argv []) |
45 | { | 43 | { |
46 | const char * str_my_name; | 44 | const char * str_my_name; |
@@ -89,7 +87,11 @@ int main(int argc, const char * argv []) | |||
89 | /* Make output directory if needed. */ | 87 | /* Make output directory if needed. */ |
90 | if (stat(str_dir_config, &stat_buf) != 0) | 88 | if (stat(str_dir_config, &stat_buf) != 0) |
91 | { | 89 | { |
90 | #ifdef __MINGW32__ | ||
91 | if (mkdir(str_dir_config) != 0) | ||
92 | #else | ||
92 | if (mkdir(str_dir_config, 0755) != 0) | 93 | if (mkdir(str_dir_config, 0755) != 0) |
94 | #endif | ||
93 | ERROR_EXIT(str_dir_config); | 95 | ERROR_EXIT(str_dir_config); |
94 | } | 96 | } |
95 | 97 | ||
@@ -149,7 +151,12 @@ int main(int argc, const char * argv []) | |||
149 | { | 151 | { |
150 | ptarget[islash] = '\0'; | 152 | ptarget[islash] = '\0'; |
151 | if (stat(ptarget, &stat_buf) != 0 | 153 | if (stat(ptarget, &stat_buf) != 0 |
152 | && mkdir(ptarget, 0755) != 0) | 154 | #ifdef __MINGW32__ |
155 | && mkdir(ptarget) != 0 | ||
156 | #else | ||
157 | && mkdir(ptarget, 0755) != 0 | ||
158 | #endif | ||
159 | ) | ||
153 | ERROR_EXIT( ptarget ); | 160 | ERROR_EXIT( ptarget ); |
154 | ptarget[islash] = '/'; | 161 | ptarget[islash] = '/'; |
155 | } | 162 | } |
diff --git a/scripts/bloat-o-meter b/scripts/bloat-o-meter index b4a1d2811..26474595f 100755 --- a/scripts/bloat-o-meter +++ b/scripts/bloat-o-meter | |||
@@ -43,6 +43,8 @@ if f1 is None or f2 is None: | |||
43 | 43 | ||
44 | sym_args = " ".join(sys.argv[3 + flag_timing + dashes:]) | 44 | sym_args = " ".join(sys.argv[3 + flag_timing + dashes:]) |
45 | def getsizes(file): | 45 | def getsizes(file): |
46 | if file.endswith(".exe"): | ||
47 | return getsizes_pe(file) | ||
46 | sym, alias, lut, section = {}, {}, {}, {} | 48 | sym, alias, lut, section = {}, {}, {}, {} |
47 | for l in os.popen("readelf -W -S " + file).readlines(): | 49 | for l in os.popen("readelf -W -S " + file).readlines(): |
48 | x = l.replace("[ ", "[", 1).split() | 50 | x = l.replace("[ ", "[", 1).split() |
@@ -80,6 +82,29 @@ def getsizes(file): | |||
80 | sym[alias[(addr, sz)]["name"]] = {"addr" : addr, "size": sz} | 82 | sym[alias[(addr, sz)]["name"]] = {"addr" : addr, "size": sz} |
81 | return sym | 83 | return sym |
82 | 84 | ||
85 | def getsizes_pe(file): | ||
86 | sym, sections = {}, {} | ||
87 | prefix = os.getenv("CROSS_COMPILE", "") | ||
88 | for l in os.popen(prefix + "objdump -h " + file).readlines(): | ||
89 | x = l.split() | ||
90 | if len(x) != 7: continue | ||
91 | sections[x[1]] = 1 | ||
92 | if x[1] not in [".rdata"]: continue | ||
93 | sym[x[1]] = {"addr" : int(x[3], 16), "size" : int(x[2], 16)} | ||
94 | for l in os.popen(prefix + "nm -S --size-sort %s %s" % (sym_args, file)).readlines(): | ||
95 | if len(l.split()) != 4: continue | ||
96 | value, size, typ, name = l.split() | ||
97 | if typ in ["N"]: continue # skip debug symbols | ||
98 | if name in sections: continue # bare reference to section | ||
99 | value = int(value, 16) | ||
100 | size = int(size, 16) | ||
101 | if "$" in name: | ||
102 | section, name = name.split("$") | ||
103 | if section in sym: | ||
104 | sym[section]["size"] -= size | ||
105 | sym[name] = {"addr" : value, "size": size} | ||
106 | return sym | ||
107 | |||
83 | if flag_timing: | 108 | if flag_timing: |
84 | start_t1 = int(time.time() * 1e9) | 109 | start_t1 = int(time.time() * 1e9) |
85 | old = getsizes(f1) | 110 | old = getsizes(f1) |
diff --git a/scripts/kconfig/.gitignore b/scripts/kconfig/.gitignore index b49584c93..aa9c7d637 100644 --- a/scripts/kconfig/.gitignore +++ b/scripts/kconfig/.gitignore | |||
@@ -17,3 +17,4 @@ mconf | |||
17 | qconf | 17 | qconf |
18 | gconf | 18 | gconf |
19 | kxgettext | 19 | kxgettext |
20 | /conf.exe | ||
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index 39ec1cdb6..4680932d7 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c | |||
@@ -193,9 +193,14 @@ static void conf_askvalue(struct symbol *sym, const char *def) | |||
193 | break; | 193 | break; |
194 | } | 194 | } |
195 | case set_random: | 195 | case set_random: |
196 | #ifdef __MINGW32__ | ||
197 | fprintf(stderr, "set_random not supported\n"); | ||
198 | exit(1); | ||
199 | #else | ||
196 | do { | 200 | do { |
197 | val = (tristate)(random() % 3); | 201 | val = (tristate)(random() % 3); |
198 | } while (!sym_tristate_within_range(sym, val)); | 202 | } while (!sym_tristate_within_range(sym, val)); |
203 | #endif | ||
199 | switch (val) { | 204 | switch (val) { |
200 | case no: line[0] = 'n'; break; | 205 | case no: line[0] = 'n'; break; |
201 | case mod: line[0] = 'm'; break; | 206 | case mod: line[0] = 'm'; break; |
@@ -407,7 +412,12 @@ static int conf_choice(struct menu *menu) | |||
407 | continue; | 412 | continue; |
408 | break; | 413 | break; |
409 | case set_random: | 414 | case set_random: |
415 | #ifdef __MINGW32__ | ||
416 | fprintf(stderr, "set_random not supported\n"); | ||
417 | exit(1); | ||
418 | #else | ||
410 | def = (random() % cnt) + 1; | 419 | def = (random() % cnt) + 1; |
420 | #endif | ||
411 | case set_default: | 421 | case set_default: |
412 | case set_yes: | 422 | case set_yes: |
413 | case set_mod: | 423 | case set_mod: |
@@ -563,8 +573,13 @@ int main(int ac, char **av) | |||
563 | input_mode = set_yes; | 573 | input_mode = set_yes; |
564 | break; | 574 | break; |
565 | case 'r': | 575 | case 'r': |
576 | #ifdef __MINGW32__ | ||
577 | fprintf(stderr, "set_random not supported\n"); | ||
578 | exit(1); | ||
579 | #else | ||
566 | input_mode = set_random; | 580 | input_mode = set_random; |
567 | srandom(time(NULL)); | 581 | srandom(time(NULL)); |
582 | #endif | ||
568 | break; | 583 | break; |
569 | case 'h': | 584 | case 'h': |
570 | case '?': | 585 | case '?': |
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index 249a3195e..2f7fa6618 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c | |||
@@ -584,15 +584,24 @@ int conf_write(const char *name) | |||
584 | fclose(out); | 584 | fclose(out); |
585 | if (out_h) { | 585 | if (out_h) { |
586 | fclose(out_h); | 586 | fclose(out_h); |
587 | #ifdef __MINGW32__ | ||
588 | unlink("include/autoconf.h"); | ||
589 | #endif | ||
587 | rename(".tmpconfig.h", "include/autoconf.h"); | 590 | rename(".tmpconfig.h", "include/autoconf.h"); |
588 | } | 591 | } |
589 | if (!name || basename != conf_def_filename) { | 592 | if (!name || basename != conf_def_filename) { |
590 | if (!name) | 593 | if (!name) |
591 | name = conf_def_filename; | 594 | name = conf_def_filename; |
592 | sprintf(tmpname, "%s.old", name); | 595 | sprintf(tmpname, "%s.old", name); |
596 | #ifdef __MINGW32__ | ||
597 | unlink(tmpname); | ||
598 | #endif | ||
593 | rename(name, tmpname); | 599 | rename(name, tmpname); |
594 | } | 600 | } |
595 | sprintf(tmpname, "%s%s", dirname, basename); | 601 | sprintf(tmpname, "%s%s", dirname, basename); |
602 | #ifdef __MINGW32__ | ||
603 | unlink(tmpname); | ||
604 | #endif | ||
596 | if (rename(newname, tmpname)) | 605 | if (rename(newname, tmpname)) |
597 | return 1; | 606 | return 1; |
598 | 607 | ||
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h index 527f60c99..b88b89d2d 100644 --- a/scripts/kconfig/lkc.h +++ b/scripts/kconfig/lkc.h | |||
@@ -11,9 +11,9 @@ | |||
11 | #ifndef KBUILD_NO_NLS | 11 | #ifndef KBUILD_NO_NLS |
12 | # include <libintl.h> | 12 | # include <libintl.h> |
13 | #else | 13 | #else |
14 | # define gettext(Msgid) ((const char *) (Msgid)) | 14 | static inline const char *gettext(const char *txt) { return txt; } |
15 | # define textdomain(Domainname) ((const char *) (Domainname)) | 15 | static inline void textdomain(const char *domainname) {} |
16 | # define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname)) | 16 | static inline void bindtextdomain(const char *name, const char *dir) {} |
17 | #endif | 17 | #endif |
18 | 18 | ||
19 | #ifdef __cplusplus | 19 | #ifdef __cplusplus |
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index aaf82820e..55afeb763 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c | |||
@@ -12,8 +12,10 @@ | |||
12 | /* On Darwin, this may be needed to get SIGWINCH: */ | 12 | /* On Darwin, this may be needed to get SIGWINCH: */ |
13 | #define _DARWIN_C_SOURCE 1 | 13 | #define _DARWIN_C_SOURCE 1 |
14 | 14 | ||
15 | #ifndef __MINGW32__ | ||
15 | #include <sys/ioctl.h> | 16 | #include <sys/ioctl.h> |
16 | #include <sys/wait.h> | 17 | #include <sys/wait.h> |
18 | #endif | ||
17 | #include <ctype.h> | 19 | #include <ctype.h> |
18 | #include <errno.h> | 20 | #include <errno.h> |
19 | #include <fcntl.h> | 21 | #include <fcntl.h> |
@@ -23,13 +25,17 @@ | |||
23 | #include <stdlib.h> | 25 | #include <stdlib.h> |
24 | #include <string.h> | 26 | #include <string.h> |
25 | #include <strings.h> /* for strcasecmp */ | 27 | #include <strings.h> /* for strcasecmp */ |
28 | #ifndef __MINGW32__ | ||
26 | #include <termios.h> | 29 | #include <termios.h> |
30 | #endif | ||
27 | #include <unistd.h> | 31 | #include <unistd.h> |
28 | #include <locale.h> | 32 | #include <locale.h> |
29 | 33 | ||
34 | #ifndef __MINGW32__ | ||
30 | #ifndef SIGWINCH | 35 | #ifndef SIGWINCH |
31 | #define SIGWINCH 28 | 36 | #define SIGWINCH 28 |
32 | #endif | 37 | #endif |
38 | #endif | ||
33 | 39 | ||
34 | #define LKC_DIRECT_LINK | 40 | #define LKC_DIRECT_LINK |
35 | #include "lkc.h" | 41 | #include "lkc.h" |
@@ -270,11 +276,15 @@ static char input_buf[4096]; | |||
270 | static const char filename[] = ".config"; | 276 | static const char filename[] = ".config"; |
271 | static char *args[1024], **argptr = args; | 277 | static char *args[1024], **argptr = args; |
272 | static int indent; | 278 | static int indent; |
279 | #ifndef __MINGW32__ | ||
273 | static struct termios ios_org; | 280 | static struct termios ios_org; |
281 | #endif | ||
274 | static int rows = 0, cols = 0; | 282 | static int rows = 0, cols = 0; |
275 | static struct menu *current_menu; | 283 | static struct menu *current_menu; |
276 | static int child_count; | 284 | static int child_count; |
285 | #ifndef __MINGW32__ | ||
277 | static int do_resize; | 286 | static int do_resize; |
287 | #endif | ||
278 | static int single_menu_mode; | 288 | static int single_menu_mode; |
279 | 289 | ||
280 | static void conf(struct menu *menu); | 290 | static void conf(struct menu *menu); |
@@ -294,6 +304,9 @@ static int cprint(const char *fmt, ...); | |||
294 | 304 | ||
295 | static void init_wsize(void) | 305 | static void init_wsize(void) |
296 | { | 306 | { |
307 | #ifdef __MINGW32__ | ||
308 | fprintf(stderr, "Skipping attempt to change window size\n"); | ||
309 | #else | ||
297 | struct winsize ws; | 310 | struct winsize ws; |
298 | char *env; | 311 | char *env; |
299 | 312 | ||
@@ -325,6 +338,7 @@ static void init_wsize(void) | |||
325 | 338 | ||
326 | rows -= 4; | 339 | rows -= 4; |
327 | cols -= 5; | 340 | cols -= 5; |
341 | #endif | ||
328 | } | 342 | } |
329 | 343 | ||
330 | static void cprint_init(void) | 344 | static void cprint_init(void) |
@@ -461,6 +475,10 @@ static void winch_handler(int sig) | |||
461 | 475 | ||
462 | static int exec_conf(void) | 476 | static int exec_conf(void) |
463 | { | 477 | { |
478 | #ifdef __MINGW32__ | ||
479 | fprintf(stderr, "exec_conf not implemented\n"); | ||
480 | exit(1); | ||
481 | #else | ||
464 | int pipefd[2], stat, size; | 482 | int pipefd[2], stat, size; |
465 | sigset_t sset, osset; | 483 | sigset_t sset, osset; |
466 | 484 | ||
@@ -535,6 +553,7 @@ static int exec_conf(void) | |||
535 | sigprocmask(SIG_SETMASK, &osset, NULL); | 553 | sigprocmask(SIG_SETMASK, &osset, NULL); |
536 | 554 | ||
537 | return WEXITSTATUS(stat); | 555 | return WEXITSTATUS(stat); |
556 | #endif | ||
538 | } | 557 | } |
539 | 558 | ||
540 | static void search_conf(void) | 559 | static void search_conf(void) |
@@ -788,7 +807,7 @@ static void conf(struct menu *menu) | |||
788 | switch (type) { | 807 | switch (type) { |
789 | case 'm': | 808 | case 'm': |
790 | if (single_menu_mode) | 809 | if (single_menu_mode) |
791 | submenu->data = (void *) (long) !submenu->data; | 810 | submenu->data = (void *) (intptr_t) !submenu->data; |
792 | else | 811 | else |
793 | conf(submenu); | 812 | conf(submenu); |
794 | break; | 813 | break; |
@@ -1051,7 +1070,9 @@ static void conf_save(void) | |||
1051 | 1070 | ||
1052 | static void conf_cleanup(void) | 1071 | static void conf_cleanup(void) |
1053 | { | 1072 | { |
1073 | #ifndef __MINGW32__ | ||
1054 | tcsetattr(1, TCSAFLUSH, &ios_org); | 1074 | tcsetattr(1, TCSAFLUSH, &ios_org); |
1075 | #endif | ||
1055 | unlink(".help.tmp"); | 1076 | unlink(".help.tmp"); |
1056 | unlink("lxdialog.scrltmp"); | 1077 | unlink("lxdialog.scrltmp"); |
1057 | } | 1078 | } |
@@ -1080,7 +1101,9 @@ int main(int ac, char **av) | |||
1080 | single_menu_mode = 1; | 1101 | single_menu_mode = 1; |
1081 | } | 1102 | } |
1082 | 1103 | ||
1104 | #ifndef __MINGW32__ | ||
1083 | tcgetattr(1, &ios_org); | 1105 | tcgetattr(1, &ios_org); |
1106 | #endif | ||
1084 | atexit(conf_cleanup); | 1107 | atexit(conf_cleanup); |
1085 | init_wsize(); | 1108 | init_wsize(); |
1086 | conf(&rootmenu); | 1109 | conf(&rootmenu); |
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index 3d7877afc..63199cd93 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c | |||
@@ -6,8 +6,10 @@ | |||
6 | #include <ctype.h> | 6 | #include <ctype.h> |
7 | #include <stdlib.h> | 7 | #include <stdlib.h> |
8 | #include <string.h> | 8 | #include <string.h> |
9 | #ifndef __MINGW32__ | ||
9 | #include <regex.h> | 10 | #include <regex.h> |
10 | #include <sys/utsname.h> | 11 | #include <sys/utsname.h> |
12 | #endif | ||
11 | 13 | ||
12 | #define LKC_DIRECT_LINK | 14 | #define LKC_DIRECT_LINK |
13 | #include "lkc.h" | 15 | #include "lkc.h" |
@@ -44,7 +46,9 @@ void sym_add_default(struct symbol *sym, const char *def) | |||
44 | void sym_init(void) | 46 | void sym_init(void) |
45 | { | 47 | { |
46 | struct symbol *sym; | 48 | struct symbol *sym; |
49 | #ifndef __MINGW32__ | ||
47 | struct utsname uts; | 50 | struct utsname uts; |
51 | #endif | ||
48 | char *p; | 52 | char *p; |
49 | static bool inited = false; | 53 | static bool inited = false; |
50 | 54 | ||
@@ -52,7 +56,9 @@ void sym_init(void) | |||
52 | return; | 56 | return; |
53 | inited = true; | 57 | inited = true; |
54 | 58 | ||
59 | #ifndef __MINGW32__ | ||
55 | uname(&uts); | 60 | uname(&uts); |
61 | #endif | ||
56 | 62 | ||
57 | sym = sym_lookup("ARCH", 0); | 63 | sym = sym_lookup("ARCH", 0); |
58 | sym->type = S_STRING; | 64 | sym->type = S_STRING; |
@@ -71,7 +77,11 @@ void sym_init(void) | |||
71 | sym = sym_lookup("UNAME_RELEASE", 0); | 77 | sym = sym_lookup("UNAME_RELEASE", 0); |
72 | sym->type = S_STRING; | 78 | sym->type = S_STRING; |
73 | sym->flags |= SYMBOL_AUTO; | 79 | sym->flags |= SYMBOL_AUTO; |
80 | #ifdef __MINGW32__ | ||
81 | sym_add_default(sym, "UNKNOWN"); | ||
82 | #else | ||
74 | sym_add_default(sym, uts.release); | 83 | sym_add_default(sym, uts.release); |
84 | #endif | ||
75 | } | 85 | } |
76 | 86 | ||
77 | enum symbol_type sym_get_type(struct symbol *sym) | 87 | enum symbol_type sym_get_type(struct symbol *sym) |
@@ -720,6 +730,10 @@ struct symbol *sym_find(const char *name) | |||
720 | 730 | ||
721 | struct symbol **sym_re_search(const char *pattern) | 731 | struct symbol **sym_re_search(const char *pattern) |
722 | { | 732 | { |
733 | #ifdef __MINGW32__ | ||
734 | fprintf(stderr, "NOTIMPL: sym_re_search\n"); | ||
735 | exit(1); | ||
736 | #else | ||
723 | struct symbol *sym, **sym_arr = NULL; | 737 | struct symbol *sym, **sym_arr = NULL; |
724 | int i, cnt, size; | 738 | int i, cnt, size; |
725 | regex_t re; | 739 | regex_t re; |
@@ -752,6 +766,7 @@ struct symbol **sym_re_search(const char *pattern) | |||
752 | regfree(&re); | 766 | regfree(&re); |
753 | 767 | ||
754 | return sym_arr; | 768 | return sym_arr; |
769 | #endif | ||
755 | } | 770 | } |
756 | 771 | ||
757 | 772 | ||
diff --git a/scripts/kconfig/zconf.hash.c_shipped b/scripts/kconfig/zconf.hash.c_shipped index 29d9cf6cc..6996aba7f 100644 --- a/scripts/kconfig/zconf.hash.c_shipped +++ b/scripts/kconfig/zconf.hash.c_shipped | |||
@@ -161,43 +161,43 @@ kconf_id_lookup (register const char *str, register unsigned int len) | |||
161 | static struct kconf_id wordlist[] = | 161 | static struct kconf_id wordlist[] = |
162 | { | 162 | { |
163 | {-1}, {-1}, | 163 | {-1}, {-1}, |
164 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str2, T_IF, TF_COMMAND|TF_PARAM}, | 164 | {(int)(intptr_t)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str2, T_IF, TF_COMMAND|TF_PARAM}, |
165 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str3, T_TYPE, TF_COMMAND, S_INT}, | 165 | {(int)(intptr_t)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str3, T_TYPE, TF_COMMAND, S_INT}, |
166 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str4, T_HELP, TF_COMMAND}, | 166 | {(int)(intptr_t)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str4, T_HELP, TF_COMMAND}, |
167 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str5, T_ENDIF, TF_COMMAND}, | 167 | {(int)(intptr_t)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str5, T_ENDIF, TF_COMMAND}, |
168 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str6, T_SELECT, TF_COMMAND}, | 168 | {(int)(intptr_t)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str6, T_SELECT, TF_COMMAND}, |
169 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str7, T_ENDMENU, TF_COMMAND}, | 169 | {(int)(intptr_t)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str7, T_ENDMENU, TF_COMMAND}, |
170 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str8, T_TYPE, TF_COMMAND, S_TRISTATE}, | 170 | {(int)(intptr_t)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str8, T_TYPE, TF_COMMAND, S_TRISTATE}, |
171 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str9, T_ENDCHOICE, TF_COMMAND}, | 171 | {(int)(intptr_t)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str9, T_ENDCHOICE, TF_COMMAND}, |
172 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str10, T_RANGE, TF_COMMAND}, | 172 | {(int)(intptr_t)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str10, T_RANGE, TF_COMMAND}, |
173 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str11, T_TYPE, TF_COMMAND, S_STRING}, | 173 | {(int)(intptr_t)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str11, T_TYPE, TF_COMMAND, S_STRING}, |
174 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str12, T_DEFAULT, TF_COMMAND, S_UNKNOWN}, | 174 | {(int)(intptr_t)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str12, T_DEFAULT, TF_COMMAND, S_UNKNOWN}, |
175 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str13, T_DEFAULT, TF_COMMAND, S_BOOLEAN}, | 175 | {(int)(intptr_t)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str13, T_DEFAULT, TF_COMMAND, S_BOOLEAN}, |
176 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str14, T_MENU, TF_COMMAND}, | 176 | {(int)(intptr_t)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str14, T_MENU, TF_COMMAND}, |
177 | {-1}, | 177 | {-1}, |
178 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str16, T_DEFAULT, TF_COMMAND, S_BOOLEAN}, | 178 | {(int)(intptr_t)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str16, T_DEFAULT, TF_COMMAND, S_BOOLEAN}, |
179 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str17, T_DEFAULT, TF_COMMAND, S_TRISTATE}, | 179 | {(int)(intptr_t)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str17, T_DEFAULT, TF_COMMAND, S_TRISTATE}, |
180 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str18, T_MAINMENU, TF_COMMAND}, | 180 | {(int)(intptr_t)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str18, T_MAINMENU, TF_COMMAND}, |
181 | {-1}, | 181 | {-1}, |
182 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str20, T_MENUCONFIG, TF_COMMAND}, | 182 | {(int)(intptr_t)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str20, T_MENUCONFIG, TF_COMMAND}, |
183 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str21, T_CONFIG, TF_COMMAND}, | 183 | {(int)(intptr_t)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str21, T_CONFIG, TF_COMMAND}, |
184 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str22, T_ON, TF_PARAM}, | 184 | {(int)(intptr_t)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str22, T_ON, TF_PARAM}, |
185 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str23, T_TYPE, TF_COMMAND, S_HEX}, | 185 | {(int)(intptr_t)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str23, T_TYPE, TF_COMMAND, S_HEX}, |
186 | {-1}, {-1}, | 186 | {-1}, {-1}, |
187 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str26, T_SOURCE, TF_COMMAND}, | 187 | {(int)(intptr_t)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str26, T_SOURCE, TF_COMMAND}, |
188 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str27, T_DEPENDS, TF_COMMAND}, | 188 | {(int)(intptr_t)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str27, T_DEPENDS, TF_COMMAND}, |
189 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str28, T_OPTIONAL, TF_COMMAND}, | 189 | {(int)(intptr_t)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str28, T_OPTIONAL, TF_COMMAND}, |
190 | {-1}, {-1}, | 190 | {-1}, {-1}, |
191 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str31, T_SELECT, TF_COMMAND}, | 191 | {(int)(intptr_t)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str31, T_SELECT, TF_COMMAND}, |
192 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str32, T_COMMENT, TF_COMMAND}, | 192 | {(int)(intptr_t)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str32, T_COMMENT, TF_COMMAND}, |
193 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str33, T_REQUIRES, TF_COMMAND}, | 193 | {(int)(intptr_t)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str33, T_REQUIRES, TF_COMMAND}, |
194 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str34, T_TYPE, TF_COMMAND, S_BOOLEAN}, | 194 | {(int)(intptr_t)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str34, T_TYPE, TF_COMMAND, S_BOOLEAN}, |
195 | {-1}, {-1}, | 195 | {-1}, {-1}, |
196 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str37, T_TYPE, TF_COMMAND, S_BOOLEAN}, | 196 | {(int)(intptr_t)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str37, T_TYPE, TF_COMMAND, S_BOOLEAN}, |
197 | {-1}, {-1}, {-1}, | 197 | {-1}, {-1}, {-1}, |
198 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str41, T_CHOICE, TF_COMMAND}, | 198 | {(int)(intptr_t)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str41, T_CHOICE, TF_COMMAND}, |
199 | {-1}, {-1}, {-1}, {-1}, | 199 | {-1}, {-1}, {-1}, {-1}, |
200 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str46, T_PROMPT, TF_COMMAND} | 200 | {(int)(intptr_t)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str46, T_PROMPT, TF_COMMAND} |
201 | }; | 201 | }; |
202 | 202 | ||
203 | if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) | 203 | if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) |
diff --git a/scripts/kconfig/zconf.tab.c_shipped b/scripts/kconfig/zconf.tab.c_shipped index a27d256d6..863f375be 100644 --- a/scripts/kconfig/zconf.tab.c_shipped +++ b/scripts/kconfig/zconf.tab.c_shipped | |||
@@ -143,6 +143,7 @@ | |||
143 | #include <stdarg.h> | 143 | #include <stdarg.h> |
144 | #include <stdio.h> | 144 | #include <stdio.h> |
145 | #include <stdlib.h> | 145 | #include <stdlib.h> |
146 | #include <stdint.h> | ||
146 | #include <string.h> | 147 | #include <string.h> |
147 | #include <stdbool.h> | 148 | #include <stdbool.h> |
148 | 149 | ||