Print this page
make: translate using gettext, rather than the unmaintainable catgets
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/make/bin/misc.cc
+++ new/usr/src/cmd/make/bin/misc.cc
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
23 23 * Use is subject to license terms.
24 24 */
25 25
26 26 /*
27 27 * misc.cc
28 28 *
29 29 * This file contains various unclassified routines. Some main groups:
30 30 * getname
31 31 * Memory allocation
32 32 * String handling
33 33 * Property handling
34 34 * Error message handling
35 35 * Make internal state dumping
36 36 * main routine support
37 37 */
↓ open down ↓ |
37 lines elided |
↑ open up ↑ |
38 38
39 39 /*
40 40 * Included files
41 41 */
42 42 #include <errno.h>
43 43 #include <mk/defs.h>
44 44 #include <mksh/macro.h> /* SETVAR() */
45 45 #include <mksh/misc.h> /* enable_interrupt() */
46 46 #include <stdarg.h> /* va_list, va_start(), va_end() */
47 47 #include <vroot/report.h> /* SUNPRO_DEPENDENCIES */
48 +#include <libintl.h>
48 49
49 50
50 51 #define MAXJOBS_ADJUST_RFE4694000
51 52
52 53 #ifdef MAXJOBS_ADJUST_RFE4694000
53 54 extern void job_adjust_fini();
54 55 #endif /* MAXJOBS_ADJUST_RFE4694000 */
55 56
56 57
57 58 /*
58 59 * Defined macros
59 60 */
60 61
61 62 /*
62 63 * typedefs & structs
63 64 */
64 65
65 66 /*
66 67 * Static variables
67 68 */
68 69
69 70 /*
70 71 * File table of contents
71 72 */
72 73 static void print_rule(register Name target);
73 74 static void print_target_n_deps(register Name target);
74 75
75 76 /*****************************************
76 77 *
77 78 * getname
78 79 */
79 80
80 81 /*****************************************
81 82 *
82 83 * Memory allocation
83 84 */
84 85
85 86 /*
86 87 * free_chain()
87 88 *
88 89 * frees a chain of Name_vector's
89 90 *
90 91 * Parameters:
91 92 * ptr Pointer to the first element in the chain
92 93 * to be freed.
93 94 *
94 95 * Global variables used:
95 96 */
96 97 void
97 98 free_chain(Name_vector ptr)
98 99 {
99 100 if (ptr != NULL) {
100 101 if (ptr->next != NULL) {
101 102 free_chain(ptr->next);
102 103 }
103 104 free((char *) ptr);
104 105 }
105 106 }
106 107
107 108 /*****************************************
108 109 *
109 110 * String manipulation
110 111 */
111 112
112 113 /*****************************************
113 114 *
114 115 * Nameblock property handling
115 116 */
116 117
117 118 /*****************************************
118 119 *
119 120 * Error message handling
120 121 */
121 122
122 123 /*
123 124 * fatal(format, args...)
124 125 *
125 126 * Print a message and die
126 127 *
127 128 * Parameters:
128 129 * format printf type format string
129 130 * args Arguments to match the format
130 131 *
131 132 * Global variables used:
132 133 * fatal_in_progress Indicates if this is a recursive call
133 134 * parallel_process_cnt Do we need to wait for anything?
↓ open down ↓ |
76 lines elided |
↑ open up ↑ |
134 135 * report_pwd Should we report the current path?
135 136 */
136 137 /*VARARGS*/
137 138 void
138 139 fatal(const char *message, ...)
139 140 {
140 141 va_list args;
141 142
142 143 va_start(args, message);
143 144 (void) fflush(stdout);
144 - (void) fprintf(stderr, catgets(catd, 1, 263, "make: Fatal error: "));
145 + (void) fprintf(stderr, gettext("make: Fatal error: "));
145 146 (void) vfprintf(stderr, message, args);
146 147 (void) fprintf(stderr, "\n");
147 148 va_end(args);
148 149 if (report_pwd) {
149 150 (void) fprintf(stderr,
150 - catgets(catd, 1, 156, "Current working directory %s\n"),
151 + gettext("Current working directory %s\n"),
151 152 get_current_path());
152 153 }
153 154 (void) fflush(stderr);
154 155 if (fatal_in_progress) {
155 156 exit_status = 1;
156 157 exit(1);
157 158 }
158 159 fatal_in_progress = true;
159 160 /* Let all parallel children finish */
160 161 if ((dmake_mode_type == parallel_mode) &&
161 162 (parallel_process_cnt > 0)) {
162 163 (void) fprintf(stderr,
163 - catgets(catd, 1, 157, "Waiting for %d %s to finish\n"),
164 + gettext("Waiting for %d %s to finish\n"),
164 165 parallel_process_cnt,
165 166 parallel_process_cnt == 1 ?
166 - catgets(catd, 1, 158, "job") : catgets(catd, 1, 159, "jobs"));
167 + gettext("job") : gettext("jobs"));
167 168 (void) fflush(stderr);
168 169 }
169 170
170 171 while (parallel_process_cnt > 0) {
171 172 await_parallel(true);
172 173 finish_children(false);
173 174 }
174 175
175 176 #if defined (TEAMWARE_MAKE_CMN) && defined (MAXJOBS_ADJUST_RFE4694000)
176 177 job_adjust_fini();
177 178 #endif
178 179
179 180 exit_status = 1;
180 181 exit(1);
181 182 }
182 183
183 184 /*
184 185 * warning(format, args...)
185 186 *
186 187 * Print a message and continue.
187 188 *
188 189 * Parameters:
189 190 * format printf type format string
190 191 * args Arguments to match the format
191 192 *
192 193 * Global variables used:
↓ open down ↓ |
16 lines elided |
↑ open up ↑ |
193 194 * report_pwd Should we report the current path?
194 195 */
195 196 /*VARARGS*/
196 197 void
197 198 warning(char * message, ...)
198 199 {
199 200 va_list args;
200 201
201 202 va_start(args, message);
202 203 (void) fflush(stdout);
203 - (void) fprintf(stderr, catgets(catd, 1, 265, "make: Warning: "));
204 + (void) fprintf(stderr, gettext("make: Warning: "));
204 205 (void) vfprintf(stderr, message, args);
205 206 (void) fprintf(stderr, "\n");
206 207 va_end(args);
207 208 if (report_pwd) {
208 209 (void) fprintf(stderr,
209 - catgets(catd, 1, 161, "Current working directory %s\n"),
210 + gettext("Current working directory %s\n"),
210 211 get_current_path());
211 212 }
212 213 (void) fflush(stderr);
213 214 }
214 215
215 216 /*
216 217 * time_to_string(time)
217 218 *
218 219 * Take a numeric time value and produce
219 220 * a proper string representation.
220 221 *
221 222 * Return value:
222 223 * The string representation of the time
223 224 *
224 225 * Parameters:
225 226 * time The time we need to translate
↓ open down ↓ |
6 lines elided |
↑ open up ↑ |
226 227 *
227 228 * Global variables used:
228 229 */
229 230 char *
230 231 time_to_string(const timestruc_t &time)
231 232 {
232 233 struct tm *tm;
233 234 char buf[128];
234 235
235 236 if (time == file_doesnt_exist) {
236 - return catgets(catd, 1, 163, "File does not exist");
237 + return gettext("File does not exist");
237 238 }
238 239 if (time == file_max_time) {
239 - return catgets(catd, 1, 164, "Younger than any file");
240 + return gettext("Younger than any file");
240 241 }
241 242 tm = localtime(&time.tv_sec);
242 - strftime(buf, sizeof (buf), NOCATGETS("%c %Z"), tm);
243 + strftime(buf, sizeof (buf), "%c %Z", tm);
243 244 buf[127] = (int) nul_char;
244 245 return strdup(buf);
245 246 }
246 247
247 248 /*
248 249 * get_current_path()
249 250 *
250 251 * Stuff current_path with the current path if it isnt there already.
251 252 *
252 253 * Parameters:
253 254 *
254 255 * Global variables used:
255 256 */
256 257 char *
257 258 get_current_path(void)
258 259 {
259 260 char pwd[(MAXPATHLEN * MB_LEN_MAX)];
260 261 static char *current_path;
261 262
262 263 if (current_path == NULL) {
263 264 getcwd(pwd, sizeof(pwd));
264 265 if (pwd[0] == (int) nul_char) {
265 266 pwd[0] = (int) slash_char;
266 267 pwd[1] = (int) nul_char;
267 268 }
268 269 current_path = strdup(pwd);
269 270 }
270 271 return current_path;
271 272 }
272 273
273 274 /*****************************************
274 275 *
275 276 * Make internal state dumping
276 277 *
277 278 * This is a set of routines for dumping the internal make state
278 279 * Used for the -p option
279 280 */
280 281
281 282 /*
282 283 * dump_make_state()
283 284 *
284 285 * Dump make's internal state to stdout
285 286 *
286 287 * Parameters:
287 288 *
288 289 * Global variables used:
289 290 * svr4 Was ".SVR4" seen in makefile?
290 291 * svr4_name The Name ".SVR4", printed
291 292 * posix Was ".POSIX" seen in makefile?
292 293 * posix_name The Name ".POSIX", printed
293 294 * default_rule Points to the .DEFAULT rule
294 295 * default_rule_name The Name ".DEFAULT", printed
295 296 * default_target_to_build The first target to print
296 297 * dot_keep_state The Name ".KEEP_STATE", printed
297 298 * dot_keep_state_file The Name ".KEEP_STATE_FILE", printed
298 299 * hashtab The make hash table for Name blocks
299 300 * ignore_errors Was ".IGNORE" seen in makefile?
300 301 * ignore_name The Name ".IGNORE", printed
301 302 * keep_state Was ".KEEP_STATE" seen in makefile?
302 303 * percent_list The list of % rules
303 304 * precious The Name ".PRECIOUS", printed
304 305 * sccs_get_name The Name ".SCCS_GET", printed
305 306 * sccs_get_posix_name The Name ".SCCS_GET_POSIX", printed
306 307 * get_name The Name ".GET", printed
307 308 * get_posix_name The Name ".GET_POSIX", printed
308 309 * sccs_get_rule Points to the ".SCCS_GET" rule
309 310 * silent Was ".SILENT" seen in makefile?
310 311 * silent_name The Name ".SILENT", printed
311 312 * suffixes The suffix list from ".SUFFIXES"
312 313 * suffixes_name The Name ".SUFFIX", printed
313 314 */
314 315 void
315 316 dump_make_state(void)
316 317 {
317 318 Name_set::iterator p, e;
318 319 register Property prop;
319 320 register Dependency dep;
320 321 register Cmd_line rule;
321 322 Percent percent, percent_depe;
322 323
323 324 /* Default target */
324 325 if (default_target_to_build != NULL) {
325 326 print_rule(default_target_to_build);
326 327 }
327 328 (void) printf("\n");
328 329
329 330 /* .POSIX */
330 331 if (posix) {
331 332 (void) printf("%s:\n", posix_name->string_mb);
332 333 }
333 334
334 335 /* .DEFAULT */
335 336 if (default_rule != NULL) {
336 337 (void) printf("%s:\n", default_rule_name->string_mb);
337 338 for (rule = default_rule; rule != NULL; rule = rule->next) {
338 339 (void) printf("\t%s\n", rule->command_line->string_mb);
339 340 }
340 341 }
341 342
342 343 /* .IGNORE */
343 344 if (ignore_errors) {
344 345 (void) printf("%s:\n", ignore_name->string_mb);
345 346 }
346 347
347 348 /* .KEEP_STATE: */
348 349 if (keep_state) {
349 350 (void) printf("%s:\n\n", dot_keep_state->string_mb);
350 351 }
351 352
352 353 /* .PRECIOUS */
353 354 (void) printf("%s:", precious->string_mb);
354 355 for (p = hashtab.begin(), e = hashtab.end(); p != e; p++) {
355 356 if ((p->stat.is_precious) || (all_precious)) {
356 357 (void) printf(" %s", p->string_mb);
357 358 }
358 359 }
359 360 (void) printf("\n");
360 361
361 362 /* .SCCS_GET */
362 363 if (sccs_get_rule != NULL) {
363 364 (void) printf("%s:\n", sccs_get_name->string_mb);
364 365 for (rule = sccs_get_rule; rule != NULL; rule = rule->next) {
365 366 (void) printf("\t%s\n", rule->command_line->string_mb);
366 367 }
367 368 }
368 369
369 370 /* .SILENT */
370 371 if (silent) {
371 372 (void) printf("%s:\n", silent_name->string_mb);
372 373 }
373 374
374 375 /* .SUFFIXES: */
375 376 (void) printf("%s:", suffixes_name->string_mb);
376 377 for (dep = suffixes; dep != NULL; dep = dep->next) {
377 378 (void) printf(" %s", dep->name->string_mb);
378 379 build_suffix_list(dep->name);
379 380 }
380 381 (void) printf("\n\n");
381 382
382 383 /* % rules */
383 384 for (percent = percent_list;
384 385 percent != NULL;
385 386 percent = percent->next) {
386 387 (void) printf("%s:",
387 388 percent->name->string_mb);
388 389
389 390 for (percent_depe = percent->dependencies;
390 391 percent_depe != NULL;
391 392 percent_depe = percent_depe->next) {
392 393 (void) printf(" %s", percent_depe->name->string_mb);
393 394 }
394 395
395 396 (void) printf("\n");
396 397
397 398 for (rule = percent->command_template;
398 399 rule != NULL;
399 400 rule = rule->next) {
400 401 (void) printf("\t%s\n", rule->command_line->string_mb);
401 402 }
402 403 }
403 404
404 405 /* Suffix rules */
405 406 for (p = hashtab.begin(), e = hashtab.end(); p != e; p++) {
406 407 Wstring wcb(p);
407 408 if (wcb.get_string()[0] == (int) period_char) {
408 409 print_rule(p);
409 410 }
410 411 }
411 412
412 413 /* Macro assignments */
413 414 for (p = hashtab.begin(), e = hashtab.end(); p != e; p++) {
414 415 if (((prop = get_prop(p->prop, macro_prop)) != NULL) &&
415 416 (prop->body.macro.value != NULL)) {
416 417 (void) printf("%s", p->string_mb);
417 418 print_value(prop->body.macro.value,
418 419 (Daemon) prop->body.macro.daemon);
419 420 }
420 421 }
421 422 (void) printf("\n");
422 423
423 424 /* Conditional macro assignments */
424 425 for (p = hashtab.begin(), e = hashtab.end(); p != e; p++) {
425 426 for (prop = get_prop(p->prop, conditional_prop);
426 427 prop != NULL;
427 428 prop = get_prop(prop->next, conditional_prop)) {
428 429 (void) printf("%s := %s",
429 430 p->string_mb,
430 431 prop->body.conditional.name->
431 432 string_mb);
432 433 if (prop->body.conditional.append) {
433 434 printf(" +");
434 435 }
435 436 else {
436 437 printf(" ");
437 438 }
438 439 print_value(prop->body.conditional.value,
439 440 no_daemon);
440 441 }
441 442 }
442 443 (void) printf("\n");
443 444
444 445 /* All other dependencies */
445 446 for (p = hashtab.begin(), e = hashtab.end(); p != e; p++) {
446 447 if (p->colons != no_colon) {
447 448 print_rule(p);
448 449 }
449 450 }
450 451 (void) printf("\n");
451 452 }
452 453
453 454 /*
454 455 * print_rule(target)
455 456 *
456 457 * Print the rule for one target
457 458 *
458 459 * Parameters:
459 460 * target Target we print rule for
460 461 *
461 462 * Global variables used:
462 463 */
463 464 static void
464 465 print_rule(register Name target)
465 466 {
466 467 register Cmd_line rule;
467 468 register Property line;
468 469 register Dependency dependency;
469 470
470 471 if (target->dependency_printed ||
471 472 ((line = get_prop(target->prop, line_prop)) == NULL) ||
472 473 ((line->body.line.command_template == NULL) &&
473 474 (line->body.line.dependencies == NULL))) {
474 475 return;
475 476 }
476 477 target->dependency_printed = true;
477 478
478 479 (void) printf("%s:", target->string_mb);
479 480
480 481 for (dependency = line->body.line.dependencies;
481 482 dependency != NULL;
482 483 dependency = dependency->next) {
483 484 (void) printf(" %s", dependency->name->string_mb);
484 485 }
485 486
486 487 (void) printf("\n");
487 488
488 489 for (rule = line->body.line.command_template;
489 490 rule != NULL;
490 491 rule = rule->next) {
491 492 (void) printf("\t%s\n", rule->command_line->string_mb);
492 493 }
493 494 }
494 495
495 496 void
496 497 dump_target_list(void)
497 498 {
498 499 Name_set::iterator p, e;
499 500 Wstring str;
500 501
501 502 for (p = hashtab.begin(), e = hashtab.end(); p != e; p++) {
502 503 str.init(p);
503 504 wchar_t * wcb = str.get_string();
504 505 if ((p->colons != no_colon) &&
505 506 ((wcb[0] != (int) period_char) ||
506 507 ((wcb[0] == (int) period_char) &&
507 508 (wschr(wcb, (int) slash_char))))) {
508 509 print_target_n_deps(p);
509 510 }
510 511 }
511 512 }
512 513
513 514 static void
514 515 print_target_n_deps(register Name target)
515 516 {
516 517 register Cmd_line rule;
517 518 register Property line;
518 519 register Dependency dependency;
519 520
520 521 if (target->dependency_printed) {
521 522 return;
522 523 }
523 524 target->dependency_printed = true;
524 525
525 526 (void) printf("%s\n", target->string_mb);
526 527
527 528 if ((line = get_prop(target->prop, line_prop)) == NULL) {
528 529 return;
529 530 }
530 531 for (dependency = line->body.line.dependencies;
531 532 dependency != NULL;
532 533 dependency = dependency->next) {
533 534 if (!dependency->automatic) {
534 535 print_target_n_deps(dependency->name);
535 536 }
536 537 }
537 538 }
538 539
539 540 /*****************************************
540 541 *
541 542 * main() support
542 543 */
543 544
544 545 /*
545 546 * load_cached_names()
546 547 *
547 548 * Load the vector of cached names
548 549 *
549 550 * Parameters:
550 551 *
↓ open down ↓ |
298 lines elided |
↑ open up ↑ |
551 552 * Global variables used:
552 553 * Many many pointers to Name blocks.
553 554 */
554 555 void
555 556 load_cached_names(void)
556 557 {
557 558 char *cp;
558 559 Name dollar;
559 560
560 561 /* Load the cached_names struct */
561 - MBSTOWCS(wcs_buffer, NOCATGETS(".BUILT_LAST_MAKE_RUN"));
562 + MBSTOWCS(wcs_buffer, ".BUILT_LAST_MAKE_RUN");
562 563 built_last_make_run = GETNAME(wcs_buffer, FIND_LENGTH);
563 - MBSTOWCS(wcs_buffer, NOCATGETS("@"));
564 + MBSTOWCS(wcs_buffer, "@");
564 565 c_at = GETNAME(wcs_buffer, FIND_LENGTH);
565 - MBSTOWCS(wcs_buffer, NOCATGETS(" *conditionals* "));
566 + MBSTOWCS(wcs_buffer, " *conditionals* ");
566 567 conditionals = GETNAME(wcs_buffer, FIND_LENGTH);
567 568 /*
568 569 * A version of make was released with NSE 1.0 that used
569 570 * VERSION-1.1 but this version is identical to VERSION-1.0.
570 571 * The version mismatch code makes a special case for this
571 572 * situation. If the version number is changed from 1.0
572 573 * it should go to 1.2.
573 574 */
574 - MBSTOWCS(wcs_buffer, NOCATGETS("VERSION-1.0"));
575 + MBSTOWCS(wcs_buffer, "VERSION-1.0");
575 576 current_make_version = GETNAME(wcs_buffer, FIND_LENGTH);
576 - MBSTOWCS(wcs_buffer, NOCATGETS(".SVR4"));
577 + MBSTOWCS(wcs_buffer, ".SVR4");
577 578 svr4_name = GETNAME(wcs_buffer, FIND_LENGTH);
578 - MBSTOWCS(wcs_buffer, NOCATGETS(".POSIX"));
579 + MBSTOWCS(wcs_buffer, ".POSIX");
579 580 posix_name = GETNAME(wcs_buffer, FIND_LENGTH);
580 - MBSTOWCS(wcs_buffer, NOCATGETS(".DEFAULT"));
581 + MBSTOWCS(wcs_buffer, ".DEFAULT");
581 582 default_rule_name = GETNAME(wcs_buffer, FIND_LENGTH);
582 - MBSTOWCS(wcs_buffer, NOCATGETS("$"));
583 + MBSTOWCS(wcs_buffer, "$");
583 584 dollar = GETNAME(wcs_buffer, FIND_LENGTH);
584 - MBSTOWCS(wcs_buffer, NOCATGETS(".DONE"));
585 + MBSTOWCS(wcs_buffer, ".DONE");
585 586 done = GETNAME(wcs_buffer, FIND_LENGTH);
586 - MBSTOWCS(wcs_buffer, NOCATGETS("."));
587 + MBSTOWCS(wcs_buffer, ".");
587 588 dot = GETNAME(wcs_buffer, FIND_LENGTH);
588 - MBSTOWCS(wcs_buffer, NOCATGETS(".KEEP_STATE"));
589 + MBSTOWCS(wcs_buffer, ".KEEP_STATE");
589 590 dot_keep_state = GETNAME(wcs_buffer, FIND_LENGTH);
590 - MBSTOWCS(wcs_buffer, NOCATGETS(".KEEP_STATE_FILE"));
591 + MBSTOWCS(wcs_buffer, ".KEEP_STATE_FILE");
591 592 dot_keep_state_file = GETNAME(wcs_buffer, FIND_LENGTH);
592 - MBSTOWCS(wcs_buffer, NOCATGETS(""));
593 + MBSTOWCS(wcs_buffer, "");
593 594 empty_name = GETNAME(wcs_buffer, FIND_LENGTH);
594 - MBSTOWCS(wcs_buffer, NOCATGETS(" FORCE"));
595 + MBSTOWCS(wcs_buffer, " FORCE");
595 596 force = GETNAME(wcs_buffer, FIND_LENGTH);
596 - MBSTOWCS(wcs_buffer, NOCATGETS("HOST_ARCH"));
597 + MBSTOWCS(wcs_buffer, "HOST_ARCH");
597 598 host_arch = GETNAME(wcs_buffer, FIND_LENGTH);
598 - MBSTOWCS(wcs_buffer, NOCATGETS("HOST_MACH"));
599 + MBSTOWCS(wcs_buffer, "HOST_MACH");
599 600 host_mach = GETNAME(wcs_buffer, FIND_LENGTH);
600 - MBSTOWCS(wcs_buffer, NOCATGETS(".IGNORE"));
601 + MBSTOWCS(wcs_buffer, ".IGNORE");
601 602 ignore_name = GETNAME(wcs_buffer, FIND_LENGTH);
602 - MBSTOWCS(wcs_buffer, NOCATGETS(".INIT"));
603 + MBSTOWCS(wcs_buffer, ".INIT");
603 604 init = GETNAME(wcs_buffer, FIND_LENGTH);
604 - MBSTOWCS(wcs_buffer, NOCATGETS(".LOCAL"));
605 + MBSTOWCS(wcs_buffer, ".LOCAL");
605 606 localhost_name = GETNAME(wcs_buffer, FIND_LENGTH);
606 - MBSTOWCS(wcs_buffer, NOCATGETS(".make.state"));
607 + MBSTOWCS(wcs_buffer, ".make.state");
607 608 make_state = GETNAME(wcs_buffer, FIND_LENGTH);
608 - MBSTOWCS(wcs_buffer, NOCATGETS("MAKEFLAGS"));
609 + MBSTOWCS(wcs_buffer, "MAKEFLAGS");
609 610 makeflags = GETNAME(wcs_buffer, FIND_LENGTH);
610 - MBSTOWCS(wcs_buffer, NOCATGETS(".MAKE_VERSION"));
611 + MBSTOWCS(wcs_buffer, ".MAKE_VERSION");
611 612 make_version = GETNAME(wcs_buffer, FIND_LENGTH);
612 - MBSTOWCS(wcs_buffer, NOCATGETS(".NO_PARALLEL"));
613 + MBSTOWCS(wcs_buffer, ".NO_PARALLEL");
613 614 no_parallel_name = GETNAME(wcs_buffer, FIND_LENGTH);
614 - MBSTOWCS(wcs_buffer, NOCATGETS(".NOT_AUTO"));
615 + MBSTOWCS(wcs_buffer, ".NOT_AUTO");
615 616 not_auto = GETNAME(wcs_buffer, FIND_LENGTH);
616 - MBSTOWCS(wcs_buffer, NOCATGETS(".PARALLEL"));
617 + MBSTOWCS(wcs_buffer, ".PARALLEL");
617 618 parallel_name = GETNAME(wcs_buffer, FIND_LENGTH);
618 - MBSTOWCS(wcs_buffer, NOCATGETS("PATH"));
619 + MBSTOWCS(wcs_buffer, "PATH");
619 620 path_name = GETNAME(wcs_buffer, FIND_LENGTH);
620 - MBSTOWCS(wcs_buffer, NOCATGETS("+"));
621 + MBSTOWCS(wcs_buffer, "+");
621 622 plus = GETNAME(wcs_buffer, FIND_LENGTH);
622 - MBSTOWCS(wcs_buffer, NOCATGETS(".PRECIOUS"));
623 + MBSTOWCS(wcs_buffer, ".PRECIOUS");
623 624 precious = GETNAME(wcs_buffer, FIND_LENGTH);
624 - MBSTOWCS(wcs_buffer, NOCATGETS("?"));
625 + MBSTOWCS(wcs_buffer, "?");
625 626 query = GETNAME(wcs_buffer, FIND_LENGTH);
626 - MBSTOWCS(wcs_buffer, NOCATGETS("^"));
627 + MBSTOWCS(wcs_buffer, "^");
627 628 hat = GETNAME(wcs_buffer, FIND_LENGTH);
628 - MBSTOWCS(wcs_buffer, NOCATGETS(".RECURSIVE"));
629 + MBSTOWCS(wcs_buffer, ".RECURSIVE");
629 630 recursive_name = GETNAME(wcs_buffer, FIND_LENGTH);
630 - MBSTOWCS(wcs_buffer, NOCATGETS(".SCCS_GET"));
631 + MBSTOWCS(wcs_buffer, ".SCCS_GET");
631 632 sccs_get_name = GETNAME(wcs_buffer, FIND_LENGTH);
632 - MBSTOWCS(wcs_buffer, NOCATGETS(".SCCS_GET_POSIX"));
633 + MBSTOWCS(wcs_buffer, ".SCCS_GET_POSIX");
633 634 sccs_get_posix_name = GETNAME(wcs_buffer, FIND_LENGTH);
634 - MBSTOWCS(wcs_buffer, NOCATGETS(".GET"));
635 + MBSTOWCS(wcs_buffer, ".GET");
635 636 get_name = GETNAME(wcs_buffer, FIND_LENGTH);
636 - MBSTOWCS(wcs_buffer, NOCATGETS(".GET_POSIX"));
637 + MBSTOWCS(wcs_buffer, ".GET_POSIX");
637 638 get_posix_name = GETNAME(wcs_buffer, FIND_LENGTH);
638 - MBSTOWCS(wcs_buffer, NOCATGETS("SHELL"));
639 + MBSTOWCS(wcs_buffer, "SHELL");
639 640 shell_name = GETNAME(wcs_buffer, FIND_LENGTH);
640 - MBSTOWCS(wcs_buffer, NOCATGETS(".SILENT"));
641 + MBSTOWCS(wcs_buffer, ".SILENT");
641 642 silent_name = GETNAME(wcs_buffer, FIND_LENGTH);
642 - MBSTOWCS(wcs_buffer, NOCATGETS(".SUFFIXES"));
643 + MBSTOWCS(wcs_buffer, ".SUFFIXES");
643 644 suffixes_name = GETNAME(wcs_buffer, FIND_LENGTH);
644 645 MBSTOWCS(wcs_buffer, SUNPRO_DEPENDENCIES);
645 646 sunpro_dependencies = GETNAME(wcs_buffer, FIND_LENGTH);
646 - MBSTOWCS(wcs_buffer, NOCATGETS("TARGET_ARCH"));
647 + MBSTOWCS(wcs_buffer, "TARGET_ARCH");
647 648 target_arch = GETNAME(wcs_buffer, FIND_LENGTH);
648 - MBSTOWCS(wcs_buffer, NOCATGETS("TARGET_MACH"));
649 + MBSTOWCS(wcs_buffer, "TARGET_MACH");
649 650 target_mach = GETNAME(wcs_buffer, FIND_LENGTH);
650 - MBSTOWCS(wcs_buffer, NOCATGETS("VIRTUAL_ROOT"));
651 + MBSTOWCS(wcs_buffer, "VIRTUAL_ROOT");
651 652 virtual_root = GETNAME(wcs_buffer, FIND_LENGTH);
652 - MBSTOWCS(wcs_buffer, NOCATGETS("VPATH"));
653 + MBSTOWCS(wcs_buffer, "VPATH");
653 654 vpath_name = GETNAME(wcs_buffer, FIND_LENGTH);
654 - MBSTOWCS(wcs_buffer, NOCATGETS(".WAIT"));
655 + MBSTOWCS(wcs_buffer, ".WAIT");
655 656 wait_name = GETNAME(wcs_buffer, FIND_LENGTH);
656 657
657 658 wait_name->state = build_ok;
658 659
659 660 /* Mark special targets so that the reader treats them properly */
660 661 svr4_name->special_reader = svr4_special;
661 662 posix_name->special_reader = posix_special;
662 663 built_last_make_run->special_reader = built_last_make_run_special;
663 664 default_rule_name->special_reader = default_special;
664 665 dot_keep_state->special_reader = keep_state_special;
665 666 dot_keep_state_file->special_reader = keep_state_file_special;
666 667 ignore_name->special_reader = ignore_special;
667 668 make_version->special_reader = make_version_special;
668 669 no_parallel_name->special_reader = no_parallel_special;
669 670 parallel_name->special_reader = parallel_special;
670 671 localhost_name->special_reader = localhost_special;
671 672 precious->special_reader = precious_special;
672 673 sccs_get_name->special_reader = sccs_get_special;
673 674 sccs_get_posix_name->special_reader = sccs_get_posix_special;
674 675 get_name->special_reader = get_special;
↓ open down ↓ |
10 lines elided |
↑ open up ↑ |
675 676 get_posix_name->special_reader = get_posix_special;
676 677 silent_name->special_reader = silent_special;
677 678 suffixes_name->special_reader = suffixes_special;
678 679
679 680 /* The value of $$ is $ */
680 681 (void) SETVAR(dollar, dollar, false);
681 682 dollar->dollar = false;
682 683
683 684 /* Set the value of $(SHELL) */
684 685 if (posix) {
685 - MBSTOWCS(wcs_buffer, NOCATGETS("/usr/xpg4/bin/sh"));
686 + MBSTOWCS(wcs_buffer, "/usr/xpg4/bin/sh");
686 687 } else {
687 - MBSTOWCS(wcs_buffer, NOCATGETS("/bin/sh"));
688 + MBSTOWCS(wcs_buffer, "/bin/sh");
688 689 }
689 690 (void) SETVAR(shell_name, GETNAME(wcs_buffer, FIND_LENGTH), false);
690 691
691 692 /*
692 693 * Use " FORCE" to simulate a FRC dependency for :: type
693 694 * targets with no dependencies.
694 695 */
695 696 (void) append_prop(force, line_prop);
696 697 force->stat.time = file_max_time;
697 698
698 699 /* Make sure VPATH is defined before current dir is read */
↓ open down ↓ |
1 lines elided |
↑ open up ↑ |
699 700 if ((cp = getenv(vpath_name->string_mb)) != NULL) {
700 701 MBSTOWCS(wcs_buffer, cp);
701 702 (void) SETVAR(vpath_name,
702 703 GETNAME(wcs_buffer, FIND_LENGTH),
703 704 false);
704 705 }
705 706
706 707 /* Check if there is NO PATH variable. If not we construct one. */
707 708 if (getenv(path_name->string_mb) == NULL) {
708 709 vroot_path = NULL;
709 - add_dir_to_path(NOCATGETS("."), &vroot_path, -1);
710 - add_dir_to_path(NOCATGETS("/bin"), &vroot_path, -1);
711 - add_dir_to_path(NOCATGETS("/usr/bin"), &vroot_path, -1);
710 + add_dir_to_path(".", &vroot_path, -1);
711 + add_dir_to_path("/bin", &vroot_path, -1);
712 + add_dir_to_path("/usr/bin", &vroot_path, -1);
712 713 }
713 714 }
714 715
715 716 /*
716 717 * iterate on list of conditional macros in np, and place them in
717 718 * a String_rec starting with, and separated by the '$' character.
718 719 */
719 720 void
720 721 cond_macros_into_string(Name np, String_rec *buffer)
721 722 {
722 723 Macro_list macro_list;
723 724
724 725 /*
725 726 * Put the version number at the start of the string
726 727 */
727 728 MBSTOWCS(wcs_buffer, DEPINFO_FMT_VERSION);
728 729 append_string(wcs_buffer, buffer, FIND_LENGTH);
729 730 /*
730 731 * Add the rest of the conditional macros to the buffer
731 732 */
732 733 if (np->depends_on_conditional){
733 734 for (macro_list = np->conditional_macro_list;
734 735 macro_list != NULL; macro_list = macro_list->next){
735 736 append_string(macro_list->macro_name, buffer,
736 737 FIND_LENGTH);
737 738 append_char((int) equal_char, buffer);
738 739 append_string(macro_list->value, buffer, FIND_LENGTH);
739 740 append_char((int) dollar_char, buffer);
740 741 }
741 742 }
742 743 }
743 744
↓ open down ↓ |
22 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX