Print this page
make: translate using gettext, rather than the unmaintainable catgets
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/make/include/mk/defs.h
+++ new/usr/src/cmd/make/include/mk/defs.h
1 1 #ifndef _MK_DEFS_H
2 2 #define _MK_DEFS_H
3 3 /*
4 4 * CDDL HEADER START
5 5 *
6 6 * The contents of this file are subject to the terms of the
7 7 * Common Development and Distribution License (the "License").
8 8 * You may not use this file except in compliance with the License.
9 9 *
10 10 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11 11 * or http://www.opensolaris.org/os/licensing.
12 12 * See the License for the specific language governing permissions
13 13 * and limitations under the License.
14 14 *
15 15 * When distributing Covered Code, include this CDDL HEADER in each
16 16 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
17 17 * If applicable, add the following below this CDDL HEADER, with the
18 18 * fields enclosed by brackets "[]" replaced with your own identifying
19 19 * information: Portions Copyright [yyyy] [name of copyright owner]
20 20 *
21 21 * CDDL HEADER END
22 22 */
23 23 /*
24 24 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
25 25 * Use is subject to license terms.
26 26 */
27 27
28 28 /*
29 29 * Included files
30 30 */
31 31
32 32 #include <mksh/defs.h>
33 33
34 34
35 35
36 36 /*
37 37 * Defined macros
38 38 */
39 39
40 40 #define SKIPSPACE(x) while (*x && \
41 41 ((*x == (int) space_char) || \
42 42 (*x == (int) tab_char) || \
43 43 (*x == (int) comma_char))) { \
44 44 x++; \
45 45 }
46 46
47 47 #define SKIPWORD(x) while (*x && \
48 48 (*x != (int) space_char) && \
49 49 (*x != (int) tab_char) && \
50 50 (*x != (int) newline_char) && \
51 51 (*x != (int) comma_char) && \
52 52 (*x != (int) equal_char)) { \
53 53 x++; \
54 54 }
55 55
56 56 #define SKIPTOEND(x) while (*x && \
57 57 (*x != (int) newline_char)) { \
58 58 x++; \
59 59 }
60 60
61 61 #define PMAKE_DEF_MAX_JOBS 2 /* Default number of parallel jobs. */
62 62
63 63 #define OUT_OF_DATE(a,b) \
64 64 (((a) < (b)) || (((a) == file_doesnt_exist) && ((b) == file_doesnt_exist)))
65 65
66 66 #define OUT_OF_DATE_SEC(a,b) \
67 67 (((a).tv_sec < (b).tv_sec) || (((a).tv_sec == file_doesnt_exist.tv_sec) && ((b).tv_sec == file_doesnt_exist.tv_sec)))
68 68
69 69 #define SETVAR(name, value, append) \
70 70 setvar_daemon(name, value, append, no_daemon, \
71 71 true, debug_level)
72 72 #define MAX(a,b) (((a)>(b))?(a):(b))
73 73 /*
74 74 * New feature added to SUN5_0 make, invoke the vanilla svr4 make when
75 75 * the USE_SVR4_MAKE environment variable is set.
76 76 */
77 77 #define SVR4_MAKE "/usr/ccs/lib/svr4.make"
78 78 #define USE_SVR4_MAKE "USE_SVR4_MAKE"
79 79 /*
80 80 * The standard MAXHOSTNAMELEN is 64. We want 32.
81 81 */
82 82 #define MAX_HOSTNAMELEN 32
83 83
84 84
85 85 /*
86 86 * typedefs & structs
87 87 */
88 88 typedef enum {
89 89 no_state,
90 90 scan_name_state,
91 91 scan_command_state,
92 92 enter_dependencies_state,
93 93 enter_conditional_state,
94 94 enter_equal_state,
95 95 illegal_bytes_state,
96 96 illegal_eoln_state,
97 97 poorly_formed_macro_state,
98 98 exit_state
99 99 } Reader_state;
100 100
101 101 struct _Name_vector {
102 102 struct _Name *names[64];
103 103 struct _Chain *target_group[64];
104 104 short used;
105 105 struct _Name_vector *next;
106 106 };
107 107
108 108 struct _Running {
109 109 struct _Running *next;
110 110 Doname state;
111 111 struct _Name *target;
112 112 struct _Name *true_target;
113 113 struct _Property *command;
114 114 struct _Name *sprodep_value;
115 115 char *sprodep_env;
116 116 int recursion_level;
117 117 Boolean do_get;
118 118 Boolean implicit;
119 119 Boolean redo;
120 120 int auto_count;
121 121 struct _Name **automatics;
122 122 pid_t pid;
123 123 int job_msg_id;
124 124 char *stdout_file;
125 125 char *stderr_file;
126 126 struct _Name *temp_file;
127 127 int conditional_cnt;
128 128 struct _Name **conditional_targets;
129 129 Boolean make_refd;
130 130 };
131 131
132 132 typedef enum {
133 133 serial_mode,
134 134 parallel_mode
135 135 } DMake_mode;
136 136
137 137 typedef enum {
138 138 txt1_mode,
139 139 txt2_mode,
140 140 html1_mode
141 141 } DMake_output_mode;
142 142
143 143 struct _Recursive_make {
144 144 struct _Recursive_make *next; /* Linked list */
145 145 wchar_t *target;/* Name of target */
146 146 wchar_t *oldline;/* Original line in .nse_depinfo */
147 147 wchar_t *newline;/* New line in .nse_depinfo */
148 148 wchar_t *cond_macrostring;
149 149 /* string built from value of
150 150 * conditional macros used by
151 151 * this target
152 152 */
153 153 Boolean removed;/* This target is no longer recursive*/
154 154 };
155 155
156 156 struct _Dyntarget {
157 157 struct _Dyntarget *next;
158 158 struct _Name *name;
159 159 };
160 160
161 161
162 162 /*
163 163 * Typedefs for all structs
164 164 */
165 165 typedef struct _Cmd_line *Cmd_line, Cmd_line_rec;
166 166 typedef struct _Dependency *Dependency, Dependency_rec;
167 167 typedef struct _Macro *Macro, Macro_rec;
168 168 typedef struct _Name_vector *Name_vector, Name_vector_rec;
169 169 typedef struct _Percent *Percent, Percent_rec;
170 170 typedef struct _Dyntarget *Dyntarget;
171 171 typedef struct _Recursive_make *Recursive_make, Recursive_make_rec;
172 172 typedef struct _Running *Running, Running_rec;
173 173
174 174
175 175 /*
176 176 * extern declarations for all global variables.
177 177 * The actual declarations are in globals.cc
178 178 */
179 179 extern Boolean allrules_read;
180 180 extern Name posix_name;
181 181 extern Name svr4_name;
182 182 extern Boolean sdot_target;
183 183 extern Boolean all_parallel;
184 184 extern Boolean assign_done;
185 185 extern Boolean build_failed_seen;
186 186 extern Name built_last_make_run;
187 187 extern Name c_at;
188 188 extern Boolean command_changed;
189 189 extern Boolean commands_done;
190 190 extern Chain conditional_targets;
191 191 extern Name conditionals;
192 192 extern Boolean continue_after_error;
193 193 extern Property current_line;
194 194 extern Name current_make_version;
195 195 extern Name current_target;
196 196 extern short debug_level;
197 197 extern Cmd_line default_rule;
198 198 extern Name default_rule_name;
199 199 extern Name default_target_to_build;
200 200 extern Boolean depinfo_already_read;
201 201 extern Name dmake_group;
202 202 extern Name dmake_max_jobs;
203 203 extern Name dmake_mode;
204 204 extern DMake_mode dmake_mode_type;
205 205 extern Name dmake_output_mode;
206 206 extern DMake_output_mode output_mode;
207 207 extern Name dmake_odir;
208 208 extern Name dmake_rcfile;
209 209 extern Name done;
210 210 extern Name dot;
211 211 extern Name dot_keep_state;
212 212 extern Name dot_keep_state_file;
213 213 extern Name empty_name;
214 214 extern Boolean fatal_in_progress;
215 215 extern int file_number;
216 216 extern Name force;
217 217 extern Name ignore_name;
218 218 extern Boolean ignore_errors;
219 219 extern Boolean ignore_errors_all;
220 220 extern Name init;
221 221 extern int job_msg_id;
222 222 extern Boolean keep_state;
223 223 extern Name make_state;
224 224 extern timestruc_t make_state_before;
225 225 extern Boolean make_state_locked;
226 226 extern Dependency makefiles_used;
227 227 extern Name makeflags;
228 228 extern Name make_version;
229 229 extern char mbs_buffer2[];
230 230 extern char *mbs_ptr;
231 231 extern char *mbs_ptr2;
232 232 extern Boolean no_action_was_taken;
233 233 extern Boolean no_parallel;
234 234 extern Name no_parallel_name;
235 235 extern Name not_auto;
236 236 extern Boolean only_parallel;
237 237 extern Boolean parallel;
238 238 extern Name parallel_name;
239 239 extern Name localhost_name;
240 240 extern int parallel_process_cnt;
241 241 extern Percent percent_list;
242 242 extern Dyntarget dyntarget_list;
243 243 extern Name plus;
244 244 extern Name pmake_machinesfile;
245 245 extern Name precious;
246 246 extern Name primary_makefile;
247 247 extern Boolean quest;
248 248 extern short read_trace_level;
249 249 extern Boolean reading_dependencies;
250 250 extern int recursion_level;
251 251 extern Name recursive_name;
252 252 extern short report_dependencies_level;
253 253 extern Boolean report_pwd;
254 254 extern Boolean rewrite_statefile;
255 255 extern Running running_list;
256 256 extern char *sccs_dir_path;
257 257 extern Name sccs_get_name;
258 258 extern Name sccs_get_posix_name;
259 259 extern Cmd_line sccs_get_rule;
260 260 extern Cmd_line sccs_get_org_rule;
261 261 extern Cmd_line sccs_get_posix_rule;
262 262 extern Name get_name;
263 263 extern Name get_posix_name;
264 264 extern Cmd_line get_rule;
265 265 extern Cmd_line get_posix_rule;
266 266 extern Boolean all_precious;
267 267 extern Boolean report_cwd;
268 268 extern Boolean silent_all;
269 269 extern Boolean silent;
270 270 extern Name silent_name;
271 271 extern char *stderr_file;
272 272 extern char *stdout_file;
273 273 extern Boolean stdout_stderr_same;
274 274 extern Dependency suffixes;
275 275 extern Name suffixes_name;
276 276 extern Name sunpro_dependencies;
277 277 extern Boolean target_variants;
278 278 extern const char *tmpdir;
279 279 extern const char *temp_file_directory;
280 280 extern Name temp_file_name;
↓ open down ↓ |
280 lines elided |
↑ open up ↑ |
281 281 extern short temp_file_number;
282 282 extern wchar_t *top_level_target;
283 283 extern Boolean touch;
284 284 extern Boolean trace_reader;
285 285 extern Boolean build_unconditional;
286 286 extern pathpt vroot_path;
287 287 extern Name wait_name;
288 288 extern wchar_t wcs_buffer2[];
289 289 extern wchar_t *wcs_ptr;
290 290 extern wchar_t *wcs_ptr2;
291 -extern nl_catd catd;
292 291 extern long int hostid;
293 292
294 293 /*
295 294 * Declarations of system defined variables
296 295 */
297 296 /* On linux this variable is defined in 'signal.h' */
298 297 extern char *sys_siglist[];
299 298
300 299 /*
301 300 * Declarations of system supplied functions
302 301 */
303 302 extern int file_lock(char *, char *, int *, int);
304 303
305 304 /*
306 305 * Declarations of functions declared and used by make
307 306 */
308 307 extern void add_pending(Name target, int recursion_level, Boolean do_get, Boolean implicit, Boolean redo);
309 308 extern void add_running(Name target, Name true_target, Property command, int recursion_level, int auto_count, Name *automatics, Boolean do_get, Boolean implicit);
310 309 extern void add_serial(Name target, int recursion_level, Boolean do_get, Boolean implicit);
311 310 extern void add_subtree(Name target, int recursion_level, Boolean do_get, Boolean implicit);
312 311 extern void append_or_replace_macro_in_dyn_array(ASCII_Dyn_Array *Ar, char *macro);
313 312 extern void await_parallel(Boolean waitflg);
314 313 extern void build_suffix_list(Name target_suffix);
315 314 extern Boolean check_auto_dependencies(Name target, int auto_count, Name *automatics);
316 315 extern void check_state(Name temp_file_name);
317 316 extern void cond_macros_into_string(Name np, String_rec *buffer);
318 317 extern void construct_target_string();
319 318 extern void create_xdrs_ptr(void);
320 319 extern void depvar_add_to_list (Name name, Boolean cmdline);
321 320 extern Doname doname(register Name target, register Boolean do_get, register Boolean implicit, register Boolean automatic = false);
322 321 extern Doname doname_check(register Name target, register Boolean do_get, register Boolean implicit, register Boolean automatic);
323 322 extern Doname doname_parallel(Name target, Boolean do_get, Boolean implicit);
324 323 extern Doname dosys(register Name command, register Boolean ignore_error, register Boolean call_make, Boolean silent_error, Boolean always_exec, Name target);
325 324 extern void dump_make_state(void);
326 325 extern void dump_target_list(void);
327 326 extern void enter_conditional(register Name target, Name name, Name value, register Boolean append);
328 327 extern void enter_dependencies(register Name target, Chain target_group, register Name_vector depes, register Cmd_line command, register Separator separator);
329 328 extern void enter_dependency(Property line, register Name depe, Boolean automatic);
330 329 extern void enter_equal(Name name, Name value, register Boolean append);
331 330 extern Percent enter_percent(register Name target, Chain target_group, register Name_vector depes, Cmd_line command);
332 331 extern Dyntarget enter_dyntarget(register Name target);
333 332 extern Name_vector enter_name(String string, Boolean tail_present, register wchar_t *string_start, register wchar_t *string_end, Name_vector current_names, Name_vector *extra_names, Boolean *target_group_seen);
334 333 extern Boolean exec_vp(register char *name, register char **argv, char **envp, register Boolean ignore_error);
335 334 extern Doname execute_parallel(Property line, Boolean waitflg, Boolean local = false);
336 335 extern Doname execute_serial(Property line);
337 336 extern timestruc_t& exists(register Name target);
338 337 extern void fatal(const char *, ...);
339 338 extern void fatal_reader(char *, ...);
340 339 extern Doname find_ar_suffix_rule(register Name target, Name true_target, Property *command, Boolean rechecking);
341 340 extern Doname find_double_suffix_rule(register Name target, Property *command, Boolean rechecking);
342 341 extern Doname find_percent_rule(register Name target, Property *command, Boolean rechecking);
343 342 extern int find_run_directory (char *cmd, char *cwd, char *dir, char **pgm, char **run, char *path);
344 343 extern Doname find_suffix_rule(Name target, Name target_body, Name target_suffix, Property *command, Boolean rechecking);
345 344 extern Chain find_target_groups(register Name_vector target_list, register int i, Boolean reset);
346 345 extern void finish_children(Boolean docheck);
347 346 extern void finish_running(void);
348 347 extern void free_chain(Name_vector ptr);
349 348 extern void gather_recursive_deps(void);
350 349 extern char *get_current_path(void);
351 350 extern int get_job_msg_id(void);
352 351 extern wchar_t *getmem_wc(register int size);
353 352 /* On linux getwd(char *) is defined in 'unistd.h' */
354 353 #ifdef __cplusplus
355 354 extern "C" {
356 355 #endif
357 356 extern char *getwd(char *);
358 357 #ifdef __cplusplus
359 358 }
360 359 #endif
361 360 extern void handle_interrupt(int);
362 361 extern Boolean is_running(Name target);
363 362 extern void load_cached_names(void);
364 363 extern Boolean parallel_ok(Name target, Boolean line_prop_must_exists);
365 364 extern void print_dependencies(register Name target, register Property line);
366 365 extern void send_job_start_msg(Property line);
367 366 extern void send_rsrc_info_msg(int max_jobs, char *hostname, char *username);
368 367 extern void print_value(register Name value, Daemon daemon);
369 368 extern timestruc_t& read_archive(register Name target);
370 369 extern int read_dir(Name dir, wchar_t *pattern, Property line, wchar_t *library);
371 370 extern void read_directory_of_file(register Name file);
372 371 extern int read_make_machines(Name make_machines_name);
373 372 extern Boolean read_simple_file(register Name makefile_name, register Boolean chase_path, register Boolean doname_it, Boolean complain, Boolean must_exist, Boolean report_file, Boolean lock_makefile);
374 373 extern void remove_recursive_dep(Name target);
375 374 extern void report_recursive_dep(Name target, char *line);
376 375 extern void report_recursive_done(void);
377 376 extern void report_recursive_init(void);
378 377 extern Recursive_make find_recursive_target(Name target);
379 378 extern void reset_locals(register Name target, register Property old_locals, register Property conditional, register int index);
380 379 extern void set_locals(register Name target, register Property old_locals);
381 380 extern void setvar_append(register Name name, register Name value);
382 381 extern void setvar_envvar(void);
383 382 extern void special_reader(Name target, register Name_vector depes, Cmd_line command);
384 383 extern void startup_rxm();
385 384 extern Doname target_can_be_built(register Name target);
386 385 extern char *time_to_string(const timestruc_t &time);
387 386 extern void update_target(Property line, Doname result);
388 387 extern void warning(char *, ...);
389 388 extern void write_state_file(int report_recursive, Boolean exiting);
390 389 extern Name vpath_translation(register Name cmd);
391 390 extern char *make_install_prefix(void);
392 391
393 392 #define DEPINFO_FMT_VERSION "VERS2$"
394 393 #define VER_LEN strlen(DEPINFO_FMT_VERSION)
395 394
396 395
397 396 #endif
↓ open down ↓ |
96 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX