147 {
148 va_list args;
149
150 va_start(args, message);
151 (void) fflush(stdout);
152 #ifdef DISTRIBUTED
153 (void) fprintf(stderr, catgets(catd, 1, 262, "dmake: Fatal error: "));
154 #else
155 (void) fprintf(stderr, catgets(catd, 1, 263, "make: Fatal error: "));
156 #endif
157 (void) vfprintf(stderr, message, args);
158 (void) fprintf(stderr, "\n");
159 va_end(args);
160 if (report_pwd) {
161 (void) fprintf(stderr,
162 catgets(catd, 1, 156, "Current working directory %s\n"),
163 get_current_path());
164 }
165 (void) fflush(stderr);
166 if (fatal_in_progress) {
167 #if defined(SUN5_0) || defined(HP_UX) || defined(linux)
168 exit_status = 1;
169 #endif
170 exit(1);
171 }
172 fatal_in_progress = true;
173 #ifdef TEAMWARE_MAKE_CMN
174 /* Let all parallel children finish */
175 if ((dmake_mode_type == parallel_mode) &&
176 (parallel_process_cnt > 0)) {
177 (void) fprintf(stderr,
178 catgets(catd, 1, 157, "Waiting for %d %s to finish\n"),
179 parallel_process_cnt,
180 parallel_process_cnt == 1 ?
181 catgets(catd, 1, 158, "job") : catgets(catd, 1, 159, "jobs"));
182 (void) fflush(stderr);
183 }
184
185 while (parallel_process_cnt > 0) {
186 #ifdef DISTRIBUTED
187 if (dmake_mode_type == distributed_mode) {
188 (void) await_dist(false);
189 } else {
190 await_parallel(true);
191 }
192 #else
193 await_parallel(true);
194 #endif
195 finish_children(false);
196 }
197 #endif
198
199 #if defined (TEAMWARE_MAKE_CMN) && defined (MAXJOBS_ADJUST_RFE4694000)
200 job_adjust_fini();
201 #endif
202
203 #if defined(SUN5_0) || defined(HP_UX) || defined(linux)
204 exit_status = 1;
205 #endif
206 exit(1);
207 }
208
209 /*
210 * warning(format, args...)
211 *
212 * Print a message and continue.
213 *
214 * Parameters:
215 * format printf type format string
216 * args Arguments to match the format
217 *
218 * Global variables used:
219 * report_pwd Should we report the current path?
220 */
221 /*VARARGS*/
222 void
223 warning(char * message, ...)
224 {
225 va_list args;
273 buf[127] = (int) nul_char;
274 return strdup(buf);
275 }
276
277 /*
278 * get_current_path()
279 *
280 * Stuff current_path with the current path if it isnt there already.
281 *
282 * Parameters:
283 *
284 * Global variables used:
285 */
286 char *
287 get_current_path(void)
288 {
289 char pwd[(MAXPATHLEN * MB_LEN_MAX)];
290 static char *current_path;
291
292 if (current_path == NULL) {
293 #if defined(SUN5_0) || defined(HP_UX) || defined(linux)
294 getcwd(pwd, sizeof(pwd));
295 #else
296 (void) getwd(pwd);
297 #endif
298 if (pwd[0] == (int) nul_char) {
299 pwd[0] = (int) slash_char;
300 pwd[1] = (int) nul_char;
301 #ifdef DISTRIBUTED
302 current_path = strdup(pwd);
303 } else if (IS_EQUALN(pwd, NOCATGETS("/tmp_mnt"), 8)) {
304 current_path = strdup(pwd + 8);
305 } else {
306 current_path = strdup(pwd);
307 }
308 #else
309 }
310 current_path = strdup(pwd);
311 #endif
312 }
313 return current_path;
314 }
315
316 /*****************************************
317 *
717 make_version->special_reader = make_version_special;
718 no_parallel_name->special_reader = no_parallel_special;
719 parallel_name->special_reader = parallel_special;
720 localhost_name->special_reader = localhost_special;
721 precious->special_reader = precious_special;
722 sccs_get_name->special_reader = sccs_get_special;
723 sccs_get_posix_name->special_reader = sccs_get_posix_special;
724 get_name->special_reader = get_special;
725 get_posix_name->special_reader = get_posix_special;
726 silent_name->special_reader = silent_special;
727 suffixes_name->special_reader = suffixes_special;
728
729 /* The value of $$ is $ */
730 (void) SETVAR(dollar, dollar, false);
731 dollar->dollar = false;
732
733 /* Set the value of $(SHELL) */
734 #ifdef HP_UX
735 MBSTOWCS(wcs_buffer, NOCATGETS("/bin/posix/sh"));
736 #else
737 #if defined(SUN5_0)
738 if (posix) {
739 MBSTOWCS(wcs_buffer, NOCATGETS("/usr/xpg4/bin/sh"));
740 } else {
741 MBSTOWCS(wcs_buffer, NOCATGETS("/bin/sh"));
742 }
743 #else /* ^SUN5_0 */
744 MBSTOWCS(wcs_buffer, NOCATGETS("/bin/sh"));
745 #endif /* ^SUN5_0 */
746 #endif
747 (void) SETVAR(shell_name, GETNAME(wcs_buffer, FIND_LENGTH), false);
748
749 /*
750 * Use " FORCE" to simulate a FRC dependency for :: type
751 * targets with no dependencies.
752 */
753 (void) append_prop(force, line_prop);
754 force->stat.time = file_max_time;
755
756 /* Make sure VPATH is defined before current dir is read */
757 if ((cp = getenv(vpath_name->string_mb)) != NULL) {
758 MBSTOWCS(wcs_buffer, cp);
759 (void) SETVAR(vpath_name,
760 GETNAME(wcs_buffer, FIND_LENGTH),
761 false);
762 }
763
764 /* Check if there is NO PATH variable. If not we construct one. */
765 if (getenv(path_name->string_mb) == NULL) {
|
147 {
148 va_list args;
149
150 va_start(args, message);
151 (void) fflush(stdout);
152 #ifdef DISTRIBUTED
153 (void) fprintf(stderr, catgets(catd, 1, 262, "dmake: Fatal error: "));
154 #else
155 (void) fprintf(stderr, catgets(catd, 1, 263, "make: Fatal error: "));
156 #endif
157 (void) vfprintf(stderr, message, args);
158 (void) fprintf(stderr, "\n");
159 va_end(args);
160 if (report_pwd) {
161 (void) fprintf(stderr,
162 catgets(catd, 1, 156, "Current working directory %s\n"),
163 get_current_path());
164 }
165 (void) fflush(stderr);
166 if (fatal_in_progress) {
167 exit_status = 1;
168 exit(1);
169 }
170 fatal_in_progress = true;
171 #ifdef TEAMWARE_MAKE_CMN
172 /* Let all parallel children finish */
173 if ((dmake_mode_type == parallel_mode) &&
174 (parallel_process_cnt > 0)) {
175 (void) fprintf(stderr,
176 catgets(catd, 1, 157, "Waiting for %d %s to finish\n"),
177 parallel_process_cnt,
178 parallel_process_cnt == 1 ?
179 catgets(catd, 1, 158, "job") : catgets(catd, 1, 159, "jobs"));
180 (void) fflush(stderr);
181 }
182
183 while (parallel_process_cnt > 0) {
184 #ifdef DISTRIBUTED
185 if (dmake_mode_type == distributed_mode) {
186 (void) await_dist(false);
187 } else {
188 await_parallel(true);
189 }
190 #else
191 await_parallel(true);
192 #endif
193 finish_children(false);
194 }
195 #endif
196
197 #if defined (TEAMWARE_MAKE_CMN) && defined (MAXJOBS_ADJUST_RFE4694000)
198 job_adjust_fini();
199 #endif
200
201 exit_status = 1;
202 exit(1);
203 }
204
205 /*
206 * warning(format, args...)
207 *
208 * Print a message and continue.
209 *
210 * Parameters:
211 * format printf type format string
212 * args Arguments to match the format
213 *
214 * Global variables used:
215 * report_pwd Should we report the current path?
216 */
217 /*VARARGS*/
218 void
219 warning(char * message, ...)
220 {
221 va_list args;
269 buf[127] = (int) nul_char;
270 return strdup(buf);
271 }
272
273 /*
274 * get_current_path()
275 *
276 * Stuff current_path with the current path if it isnt there already.
277 *
278 * Parameters:
279 *
280 * Global variables used:
281 */
282 char *
283 get_current_path(void)
284 {
285 char pwd[(MAXPATHLEN * MB_LEN_MAX)];
286 static char *current_path;
287
288 if (current_path == NULL) {
289 getcwd(pwd, sizeof(pwd));
290 if (pwd[0] == (int) nul_char) {
291 pwd[0] = (int) slash_char;
292 pwd[1] = (int) nul_char;
293 #ifdef DISTRIBUTED
294 current_path = strdup(pwd);
295 } else if (IS_EQUALN(pwd, NOCATGETS("/tmp_mnt"), 8)) {
296 current_path = strdup(pwd + 8);
297 } else {
298 current_path = strdup(pwd);
299 }
300 #else
301 }
302 current_path = strdup(pwd);
303 #endif
304 }
305 return current_path;
306 }
307
308 /*****************************************
309 *
709 make_version->special_reader = make_version_special;
710 no_parallel_name->special_reader = no_parallel_special;
711 parallel_name->special_reader = parallel_special;
712 localhost_name->special_reader = localhost_special;
713 precious->special_reader = precious_special;
714 sccs_get_name->special_reader = sccs_get_special;
715 sccs_get_posix_name->special_reader = sccs_get_posix_special;
716 get_name->special_reader = get_special;
717 get_posix_name->special_reader = get_posix_special;
718 silent_name->special_reader = silent_special;
719 suffixes_name->special_reader = suffixes_special;
720
721 /* The value of $$ is $ */
722 (void) SETVAR(dollar, dollar, false);
723 dollar->dollar = false;
724
725 /* Set the value of $(SHELL) */
726 #ifdef HP_UX
727 MBSTOWCS(wcs_buffer, NOCATGETS("/bin/posix/sh"));
728 #else
729 if (posix) {
730 MBSTOWCS(wcs_buffer, NOCATGETS("/usr/xpg4/bin/sh"));
731 } else {
732 MBSTOWCS(wcs_buffer, NOCATGETS("/bin/sh"));
733 }
734 #endif
735 (void) SETVAR(shell_name, GETNAME(wcs_buffer, FIND_LENGTH), false);
736
737 /*
738 * Use " FORCE" to simulate a FRC dependency for :: type
739 * targets with no dependencies.
740 */
741 (void) append_prop(force, line_prop);
742 force->stat.time = file_max_time;
743
744 /* Make sure VPATH is defined before current dir is read */
745 if ((cp = getenv(vpath_name->string_mb)) != NULL) {
746 MBSTOWCS(wcs_buffer, cp);
747 (void) SETVAR(vpath_name,
748 GETNAME(wcs_buffer, FIND_LENGTH),
749 false);
750 }
751
752 /* Check if there is NO PATH variable. If not we construct one. */
753 if (getenv(path_name->string_mb) == NULL) {
|