Print this page
make: unifdef for MAKETOOL and DISTRIBUTED (undefined)
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 *
↓ open down ↓ |
20 lines elided |
↑ open up ↑ |
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 -#ifdef DISTRIBUTED
32 -# include <dm/Avo_AcknowledgeMsg.h>
33 -# include <dm/Avo_DoJobMsg.h>
34 -# include <dm/Avo_JobResultMsg.h>
35 -#endif
36 31
37 32 #include <mksh/defs.h>
38 33
39 -#if defined(DISTRIBUTED) || defined(MAKETOOL) /* tolik */
40 -# include <rw/xdrstrea.h>
41 -#endif
42 34
43 35
44 36 /*
45 37 * Defined macros
46 38 */
47 39
48 40 #define SKIPSPACE(x) while (*x && \
49 41 ((*x == (int) space_char) || \
50 42 (*x == (int) tab_char) || \
51 43 (*x == (int) comma_char))) { \
52 44 x++; \
53 45 }
54 46
55 47 #define SKIPWORD(x) while (*x && \
56 48 (*x != (int) space_char) && \
57 49 (*x != (int) tab_char) && \
58 50 (*x != (int) newline_char) && \
59 51 (*x != (int) comma_char) && \
60 52 (*x != (int) equal_char)) { \
61 53 x++; \
62 54 }
63 55
64 56 #define SKIPTOEND(x) while (*x && \
65 57 (*x != (int) newline_char)) { \
66 58 x++; \
67 59 }
68 60
69 61 #define PMAKE_DEF_MAX_JOBS 2 /* Default number of parallel jobs. */
70 62
71 63 #define OUT_OF_DATE(a,b) \
72 64 (((a) < (b)) || (((a) == file_doesnt_exist) && ((b) == file_doesnt_exist)))
73 65
74 66 #define OUT_OF_DATE_SEC(a,b) \
75 67 (((a).tv_sec < (b).tv_sec) || (((a).tv_sec == file_doesnt_exist.tv_sec) && ((b).tv_sec == file_doesnt_exist.tv_sec)))
76 68
77 69 #define SETVAR(name, value, append) \
78 70 setvar_daemon(name, value, append, no_daemon, \
79 71 true, debug_level)
80 72 #define MAX(a,b) (((a)>(b))?(a):(b))
81 73 /*
82 74 * New feature added to SUN5_0 make, invoke the vanilla svr4 make when
83 75 * the USE_SVR4_MAKE environment variable is set.
84 76 */
85 77 #define SVR4_MAKE "/usr/ccs/lib/svr4.make"
86 78 #define USE_SVR4_MAKE "USE_SVR4_MAKE"
87 79 /*
88 80 * The standard MAXHOSTNAMELEN is 64. We want 32.
89 81 */
90 82 #define MAX_HOSTNAMELEN 32
91 83
92 84
93 85 /*
94 86 * typedefs & structs
95 87 */
96 88 typedef enum {
97 89 no_state,
98 90 scan_name_state,
99 91 scan_command_state,
100 92 enter_dependencies_state,
101 93 enter_conditional_state,
102 94 enter_equal_state,
103 95 illegal_bytes_state,
104 96 illegal_eoln_state,
105 97 poorly_formed_macro_state,
106 98 exit_state
107 99 } Reader_state;
108 100
109 101 struct _Name_vector {
110 102 struct _Name *names[64];
111 103 struct _Chain *target_group[64];
112 104 short used;
113 105 struct _Name_vector *next;
114 106 };
115 107
116 108 struct _Running {
117 109 struct _Running *next;
118 110 Doname state;
119 111 struct _Name *target;
120 112 struct _Name *true_target;
121 113 struct _Property *command;
122 114 struct _Name *sprodep_value;
123 115 char *sprodep_env;
124 116 int recursion_level;
125 117 Boolean do_get;
126 118 Boolean implicit;
127 119 Boolean redo;
128 120 int auto_count;
129 121 struct _Name **automatics;
130 122 pid_t pid;
131 123 #ifdef TEAMWARE_MAKE_CMN
132 124 int job_msg_id;
133 125 #else
134 126 int host;
135 127 #endif
136 128 char *stdout_file;
137 129 char *stderr_file;
138 130 struct _Name *temp_file;
139 131 int conditional_cnt;
140 132 struct _Name **conditional_targets;
141 133 #ifdef TEAMWARE_MAKE_CMN
142 134 Boolean make_refd;
143 135 #endif
144 136 };
145 137
146 138 typedef enum {
147 139 serial_mode,
148 140 parallel_mode,
149 141 distributed_mode
150 142 } DMake_mode;
151 143
152 144 typedef enum {
153 145 txt1_mode,
154 146 txt2_mode,
155 147 html1_mode
156 148 } DMake_output_mode;
157 149
158 150 struct _Recursive_make {
159 151 struct _Recursive_make *next; /* Linked list */
160 152 wchar_t *target;/* Name of target */
161 153 wchar_t *oldline;/* Original line in .nse_depinfo */
162 154 wchar_t *newline;/* New line in .nse_depinfo */
163 155 wchar_t *cond_macrostring;
164 156 /* string built from value of
165 157 * conditional macros used by
166 158 * this target
167 159 */
168 160 Boolean removed;/* This target is no longer recursive*/
169 161 };
170 162
171 163 struct _Dyntarget {
172 164 struct _Dyntarget *next;
173 165 struct _Name *name;
174 166 };
175 167
176 168
177 169 /*
178 170 * Typedefs for all structs
179 171 */
180 172 typedef struct _Cmd_line *Cmd_line, Cmd_line_rec;
181 173 typedef struct _Dependency *Dependency, Dependency_rec;
182 174 typedef struct _Macro *Macro, Macro_rec;
183 175 typedef struct _Name_vector *Name_vector, Name_vector_rec;
184 176 typedef struct _Percent *Percent, Percent_rec;
185 177 typedef struct _Dyntarget *Dyntarget;
186 178 typedef struct _Recursive_make *Recursive_make, Recursive_make_rec;
187 179 typedef struct _Running *Running, Running_rec;
188 180
189 181
190 182 /*
↓ open down ↓ |
139 lines elided |
↑ open up ↑ |
191 183 * extern declarations for all global variables.
192 184 * The actual declarations are in globals.cc
193 185 */
194 186 extern Boolean allrules_read;
195 187 extern Name posix_name;
196 188 extern Name svr4_name;
197 189 extern Boolean sdot_target;
198 190 extern Boolean all_parallel;
199 191 extern Boolean assign_done;
200 192 extern Boolean build_failed_seen;
201 -#ifdef DISTRIBUTED
202 -extern Boolean building_serial;
203 -#endif
204 193 extern Name built_last_make_run;
205 194 extern Name c_at;
206 -#ifdef DISTRIBUTED
207 -extern Boolean called_make;
208 -#endif
209 195 extern Boolean command_changed;
210 196 extern Boolean commands_done;
211 197 extern Chain conditional_targets;
212 198 extern Name conditionals;
213 199 extern Boolean continue_after_error;
214 200 extern Property current_line;
215 201 extern Name current_make_version;
216 202 extern Name current_target;
217 203 extern short debug_level;
218 204 extern Cmd_line default_rule;
219 205 extern Name default_rule_name;
220 206 extern Name default_target_to_build;
221 207 extern Boolean depinfo_already_read;
222 208 extern Name dmake_group;
223 209 extern Name dmake_max_jobs;
224 210 extern Name dmake_mode;
225 211 extern DMake_mode dmake_mode_type;
226 212 extern Name dmake_output_mode;
227 213 extern DMake_output_mode output_mode;
228 214 extern Name dmake_odir;
229 215 extern Name dmake_rcfile;
230 216 extern Name done;
231 217 extern Name dot;
232 218 extern Name dot_keep_state;
233 219 extern Name dot_keep_state_file;
234 220 extern Name empty_name;
235 221 extern Boolean fatal_in_progress;
236 222 extern int file_number;
237 223 extern Name force;
238 224 extern Name ignore_name;
239 225 extern Boolean ignore_errors;
240 226 extern Boolean ignore_errors_all;
241 227 extern Name init;
242 228 extern int job_msg_id;
243 229 extern Boolean keep_state;
244 230 extern Name make_state;
245 231 #ifdef TEAMWARE_MAKE_CMN
246 232 extern timestruc_t make_state_before;
247 233 #endif
248 234 extern Boolean make_state_locked;
249 235 extern Dependency makefiles_used;
250 236 extern Name makeflags;
251 237 extern Name make_version;
252 238 extern char mbs_buffer2[];
253 239 extern char *mbs_ptr;
254 240 extern char *mbs_ptr2;
255 241 extern Boolean no_action_was_taken;
256 242 extern int mtool_msgs_fd;
257 243 extern Boolean no_parallel;
258 244 extern Name no_parallel_name;
259 245 extern Name not_auto;
260 246 extern Boolean only_parallel;
261 247 extern Boolean parallel;
262 248 extern Name parallel_name;
263 249 extern Name localhost_name;
264 250 extern int parallel_process_cnt;
265 251 extern Percent percent_list;
266 252 extern Dyntarget dyntarget_list;
267 253 extern Name plus;
268 254 extern Name pmake_machinesfile;
269 255 extern Name precious;
270 256 extern Name primary_makefile;
271 257 extern Boolean quest;
272 258 extern short read_trace_level;
273 259 extern Boolean reading_dependencies;
274 260 extern int recursion_level;
275 261 extern Name recursive_name;
276 262 extern short report_dependencies_level;
277 263 extern Boolean report_pwd;
278 264 extern Boolean rewrite_statefile;
279 265 extern Running running_list;
280 266 extern char *sccs_dir_path;
281 267 extern Name sccs_get_name;
282 268 extern Name sccs_get_posix_name;
283 269 extern Cmd_line sccs_get_rule;
284 270 extern Cmd_line sccs_get_org_rule;
285 271 extern Cmd_line sccs_get_posix_rule;
286 272 extern Name get_name;
287 273 extern Name get_posix_name;
288 274 extern Cmd_line get_rule;
289 275 extern Cmd_line get_posix_rule;
290 276 extern Boolean send_mtool_msgs;
291 277 extern Boolean all_precious;
292 278 extern Boolean report_cwd;
293 279 extern Boolean silent_all;
294 280 extern Boolean silent;
295 281 extern Name silent_name;
296 282 extern char *stderr_file;
297 283 extern char *stdout_file;
298 284 extern Boolean stdout_stderr_same;
299 285 extern Dependency suffixes;
300 286 extern Name suffixes_name;
301 287 extern Name sunpro_dependencies;
302 288 extern Boolean target_variants;
303 289 extern const char *tmpdir;
304 290 extern const char *temp_file_directory;
305 291 extern Name temp_file_name;
306 292 extern short temp_file_number;
307 293 extern wchar_t *top_level_target;
308 294 extern Boolean touch;
309 295 extern Boolean trace_reader;
310 296 extern Boolean build_unconditional;
311 297 extern pathpt vroot_path;
312 298 extern Name wait_name;
313 299 extern wchar_t wcs_buffer2[];
314 300 extern wchar_t *wcs_ptr;
315 301 extern wchar_t *wcs_ptr2;
316 302 extern nl_catd catd;
317 303 extern long int hostid;
318 304
319 305 /*
320 306 * Declarations of system defined variables
321 307 */
322 308 /* On linux this variable is defined in 'signal.h' */
323 309 extern char *sys_siglist[];
324 310
325 311 /*
326 312 * Declarations of system supplied functions
327 313 */
↓ open down ↓ |
109 lines elided |
↑ open up ↑ |
328 314 extern int file_lock(char *, char *, int *, int);
329 315
330 316 /*
331 317 * Declarations of functions declared and used by make
332 318 */
333 319 extern void add_pending(Name target, int recursion_level, Boolean do_get, Boolean implicit, Boolean redo);
334 320 extern void add_running(Name target, Name true_target, Property command, int recursion_level, int auto_count, Name *automatics, Boolean do_get, Boolean implicit);
335 321 extern void add_serial(Name target, int recursion_level, Boolean do_get, Boolean implicit);
336 322 extern void add_subtree(Name target, int recursion_level, Boolean do_get, Boolean implicit);
337 323 extern void append_or_replace_macro_in_dyn_array(ASCII_Dyn_Array *Ar, char *macro);
338 -#ifdef DISTRIBUTED
339 -extern Doname await_dist(Boolean waitflg);
340 -#endif
341 324 #ifdef TEAMWARE_MAKE_CMN
342 325 extern void await_parallel(Boolean waitflg);
343 326 #endif
344 327 extern void build_suffix_list(Name target_suffix);
345 328 extern Boolean check_auto_dependencies(Name target, int auto_count, Name *automatics);
346 329 extern void check_state(Name temp_file_name);
347 330 extern void cond_macros_into_string(Name np, String_rec *buffer);
348 331 extern void construct_target_string();
349 332 extern void create_xdrs_ptr(void);
350 333 extern void depvar_add_to_list (Name name, Boolean cmdline);
351 -#ifdef DISTRIBUTED
352 -extern void distribute_rxm(Avo_DoJobMsg *dmake_job_msg);
353 -extern int getRxmMessage(void);
354 -extern Avo_JobResultMsg* getJobResultMsg(void);
355 -extern Avo_AcknowledgeMsg* getAcknowledgeMsg(void);
356 -#endif
357 334 extern Doname doname(register Name target, register Boolean do_get, register Boolean implicit, register Boolean automatic = false);
358 335 extern Doname doname_check(register Name target, register Boolean do_get, register Boolean implicit, register Boolean automatic);
359 336 extern Doname doname_parallel(Name target, Boolean do_get, Boolean implicit);
360 337 extern Doname dosys(register Name command, register Boolean ignore_error, register Boolean call_make, Boolean silent_error, Boolean always_exec, Name target, Boolean redirect_out_err);
361 338 extern void dump_make_state(void);
362 339 extern void dump_target_list(void);
363 340 extern void enter_conditional(register Name target, Name name, Name value, register Boolean append);
364 341 extern void enter_dependencies(register Name target, Chain target_group, register Name_vector depes, register Cmd_line command, register Separator separator);
365 342 extern void enter_dependency(Property line, register Name depe, Boolean automatic);
366 343 extern void enter_equal(Name name, Name value, register Boolean append);
367 344 extern Percent enter_percent(register Name target, Chain target_group, register Name_vector depes, Cmd_line command);
368 345 extern Dyntarget enter_dyntarget(register Name target);
369 346 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);
370 347 extern Boolean exec_vp(register char *name, register char **argv, char **envp, register Boolean ignore_error);
371 348 extern Doname execute_parallel(Property line, Boolean waitflg, Boolean local = false);
372 349 extern Doname execute_serial(Property line);
373 350 extern timestruc_t& exists(register Name target);
374 351 extern void fatal(const char *, ...);
375 352 extern void fatal_reader(char *, ...);
376 353 extern Doname find_ar_suffix_rule(register Name target, Name true_target, Property *command, Boolean rechecking);
377 354 extern Doname find_double_suffix_rule(register Name target, Property *command, Boolean rechecking);
378 355 extern Doname find_percent_rule(register Name target, Property *command, Boolean rechecking);
↓ open down ↓ |
12 lines elided |
↑ open up ↑ |
379 356 extern int find_run_directory (char *cmd, char *cwd, char *dir, char **pgm, char **run, char *path);
380 357 extern Doname find_suffix_rule(Name target, Name target_body, Name target_suffix, Property *command, Boolean rechecking);
381 358 extern Chain find_target_groups(register Name_vector target_list, register int i, Boolean reset);
382 359 extern void finish_children(Boolean docheck);
383 360 extern void finish_running(void);
384 361 extern void free_chain(Name_vector ptr);
385 362 extern void gather_recursive_deps(void);
386 363 extern char *get_current_path(void);
387 364 extern int get_job_msg_id(void);
388 365 extern FILE *get_mtool_msgs_fp(void);
389 -#ifdef DISTRIBUTED
390 -extern Boolean get_dmake_group_specified(void);
391 -extern Boolean get_dmake_max_jobs_specified(void);
392 -extern Boolean get_dmake_mode_specified(void);
393 -extern Boolean get_dmake_odir_specified(void);
394 -extern Boolean get_dmake_rcfile_specified(void);
395 -extern Boolean get_pmake_machinesfile_specified(void);
396 -#endif
397 -#if defined(DISTRIBUTED) || defined(MAKETOOL) /* tolik */
398 -extern XDR *get_xdrs_ptr(void);
399 -#endif
400 366 extern wchar_t *getmem_wc(register int size);
401 367 /* On linux getwd(char *) is defined in 'unistd.h' */
402 368 #ifdef __cplusplus
403 369 extern "C" {
404 370 #endif
405 371 extern char *getwd(char *);
406 372 #ifdef __cplusplus
407 373 }
408 374 #endif
409 375 extern void handle_interrupt(int);
410 376 extern Boolean is_running(Name target);
411 377 extern void load_cached_names(void);
412 378 extern Boolean parallel_ok(Name target, Boolean line_prop_must_exists);
413 379 extern void print_dependencies(register Name target, register Property line);
414 380 extern void send_job_start_msg(Property line);
415 381 extern void send_rsrc_info_msg(int max_jobs, char *hostname, char *username);
416 382 extern void print_value(register Name value, Daemon daemon);
417 383 extern timestruc_t& read_archive(register Name target);
418 384 extern int read_dir(Name dir, wchar_t *pattern, Property line, wchar_t *library);
419 385 extern void read_directory_of_file(register Name file);
↓ open down ↓ |
10 lines elided |
↑ open up ↑ |
420 386 extern int read_make_machines(Name make_machines_name);
421 387 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);
422 388 extern void remove_recursive_dep(Name target);
423 389 extern void report_recursive_dep(Name target, char *line);
424 390 extern void report_recursive_done(void);
425 391 extern void report_recursive_init(void);
426 392 extern Recursive_make find_recursive_target(Name target);
427 393 extern void reset_locals(register Name target, register Property old_locals, register Property conditional, register int index);
428 394 extern void set_locals(register Name target, register Property old_locals);
429 395 extern void setvar_append(register Name name, register Name value);
430 -#ifdef DISTRIBUTED
431 -extern void setvar_envvar(Avo_DoJobMsg *dmake_job_msg);
432 -#else
433 396 extern void setvar_envvar(void);
434 -#endif
435 397 extern void special_reader(Name target, register Name_vector depes, Cmd_line command);
436 398 extern void startup_rxm();
437 399 extern Doname target_can_be_built(register Name target);
438 400 extern char *time_to_string(const timestruc_t &time);
439 401 extern void update_target(Property line, Doname result);
440 402 extern void warning(char *, ...);
441 403 extern void write_state_file(int report_recursive, Boolean exiting);
442 404 extern Name vpath_translation(register Name cmd);
443 405
444 406 #define DEPINFO_FMT_VERSION "VERS2$"
445 407 #define VER_LEN strlen(DEPINFO_FMT_VERSION)
446 408
447 409
448 410 #endif
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX