Print this page
make: remove maketool support
@@ -59,12 +59,10 @@
*/
# define LOCALHOST "localhost"
#define MAXRULES 100
-#define SEND_MTOOL_MSG(cmds)
-
// Sleep for .1 seconds between stat()'s
const int STAT_RETRY_SLEEP_TIME = 100000;
/*
* typedefs & structs
@@ -1771,25 +1769,10 @@
Cmd_line rule, cmd_tail, command = NULL;
char mbstring[MAXPATHLEN];
int filed;
Name target = line->body.line.target;
- SEND_MTOOL_MSG(
- if (!sent_rsrc_info_msg) {
- if (userName[0] == '\0') {
- avo_get_user(userName, NULL);
- }
- if (hostName[0] == '\0') {
- strcpy(hostName, avo_hostname());
- }
- send_rsrc_info_msg(1, hostName, userName);
- sent_rsrc_info_msg = 1;
- }
- send_job_start_msg(line);
- job_result_msg = new Avo_MToolJobResultMsg();
- );
-
target->has_recursive_dependency = false;
// We have to create a copy of the rules chain for processing because
// the original one can be destroyed during .make.state file rereading.
for (rule = line->body.line.command_used;
rule != NULL;
@@ -1817,33 +1800,12 @@
if ((rule->command_line->hash.length > 0) &&
!silent &&
(!rule->silent || do_not_exec_rule) &&
(report_dependencies_level == 0)) {
(void) printf("%s\n", rule->command_line->string_mb);
- SEND_MTOOL_MSG(
- job_result_msg->appendOutput(AVO_STRDUP(rule->command_line->string_mb));
- );
}
if (rule->command_line->hash.length > 0) {
- SEND_MTOOL_MSG(
- (void) sprintf(mbstring,
- NOCATGETS("%s/make.stdout.%d.%d.XXXXXX"),
- tmpdir,
- getpid(),
- file_number++);
-
- int tmp_fd = mkstemp(mbstring);
- if(tmp_fd) {
- (void) close(tmp_fd);
- }
-
- stdout_file = strdup(mbstring);
- stderr_file = NULL;
- child_pid = pollResults(stdout_file,
- (char *)NULL,
- (char *)NULL);
- );
/* Do assignment if command line prefixed with "=" */
if (rule->assign) {
result = build_ok;
do_assign(rule->command_line, target);
} else if (report_dependencies_level == 0) {
@@ -1855,48 +1817,23 @@
/* ds 98.04.23 bug #4085164. make should always show error messages */
false,
/* BOOLEAN(rule->silent &&
rule->ignore_error), */
(Boolean) rule->always_exec,
- target,
- send_mtool_msgs);
+ target);
check_state(temp_file_name);
}
- SEND_MTOOL_MSG(
- append_job_result_msg(job_result_msg);
- if (child_pid > 0) {
- kill(child_pid, SIGUSR1);
- while (!((waitpid(child_pid, 0, 0) == -1)
- && (errno == ECHILD)));
- }
- child_pid = 0;
- (void) unlink(stdout_file);
- retmem_mb(stdout_file);
- stdout_file = NULL;
- );
} else {
result = build_ok;
}
if (result == build_failed) {
if (silent || rule->silent) {
(void) printf(catgets(catd, 1, 242, "The following command caused the error:\n%s\n"),
rule->command_line->string_mb);
- SEND_MTOOL_MSG(
- job_result_msg->appendOutput(AVO_STRDUP(catgets(catd, 1, 243, "The following command caused the error:")));
- job_result_msg->appendOutput(AVO_STRDUP(rule->command_line->string_mb));
- );
}
if (!rule->ignore_error && !ignore_errors) {
if (!continue_after_error) {
- SEND_MTOOL_MSG(
- job_result_msg->setResult(job_msg_id, (result == build_ok) ? 0 : 1, DONE);
- xdr_msg = (RWCollectable*)
- job_result_msg;
- xdr(&xdrs, xdr_msg);
- (void) fflush(mtool_msgs_fp);
- delete job_result_msg;
- );
fatal(catgets(catd, 1, 244, "Command failed for target `%s'"),
target->string_mb);
}
/*
* Make sure a failing command is not
@@ -1912,18 +1849,10 @@
for (rule = command; rule != NULL; rule = cmd_tail) {
cmd_tail = rule->next;
free(rule);
}
command = NULL;
- SEND_MTOOL_MSG(
- job_result_msg->setResult(job_msg_id, (result == build_ok) ? 0 : 1, DONE);
- xdr_msg = (RWCollectable*) job_result_msg;
- xdr(&xdrs, xdr_msg);
- (void) fflush(mtool_msgs_fp);
-
- delete job_result_msg;
- );
if (temp_file_name != NULL) {
free_name(temp_file_name);
}
temp_file_name = NULL;
@@ -2581,25 +2510,10 @@
String_rec touch_string;
wchar_t buffer[MAXPATHLEN];
Name touch_cmd;
Cmd_line rule;
-
- SEND_MTOOL_MSG(
- if (!sent_rsrc_info_msg) {
- if (userName[0] == '\0') {
- avo_get_user(userName, NULL);
- }
- if (hostName[0] == '\0') {
- strcpy(hostName, avo_hostname());
- }
- send_rsrc_info_msg(1, hostName, userName);
- sent_rsrc_info_msg = 1;
- }
- send_job_start_msg(line);
- job_result_msg = new Avo_MToolJobResultMsg();
- );
for (name = target, target_group = NULL; name != NULL;) {
if (!name->is_member) {
/*
* Build a touch command that can be passed
* to dosys(). If KEEP_STATE is on, "make -t"
@@ -2625,57 +2539,19 @@
}
if (!silent ||
do_not_exec_rule &&
(target_group == NULL)) {
(void) printf("%s\n", touch_cmd->string_mb);
- SEND_MTOOL_MSG(
- job_result_msg->appendOutput(AVO_STRDUP(touch_cmd->string_mb));
- );
}
/* Run the touch command, or simulate it */
if (!do_not_exec_rule) {
-
- SEND_MTOOL_MSG(
- (void) sprintf(mbstring,
- NOCATGETS("%s/make.stdout.%d.%d.XXXXXX"),
- tmpdir,
- getpid(),
- file_number++);
-
- int tmp_fd = mkstemp(mbstring);
- if(tmp_fd) {
- (void) close(tmp_fd);
- }
-
- stdout_file = strdup(mbstring);
- stderr_file = NULL;
- child_pid = pollResults(stdout_file,
- (char *)NULL,
- (char *)NULL);
- );
-
result = dosys(touch_cmd,
false,
false,
false,
false,
- name,
- send_mtool_msgs);
-
- SEND_MTOOL_MSG(
- append_job_result_msg(job_result_msg);
- if (child_pid > 0) {
- kill(child_pid, SIGUSR1);
- while (!((waitpid(child_pid, 0, 0) == -1)
- && (errno == ECHILD)));
- }
- child_pid = 0;
- (void) unlink(stdout_file);
- retmem_mb(stdout_file);
- stdout_file = NULL;
- );
-
+ name);
} else {
result = build_ok;
}
} else {
result = build_ok;
@@ -2689,17 +2565,10 @@
name = target_group->name;
} else {
name = NULL;
}
}
- SEND_MTOOL_MSG(
- job_result_msg->setResult(job_msg_id, (result == build_ok) ? 0 : 1, DONE);
- xdr_msg = (RWCollectable*) job_result_msg;
- xdr(&xdrs, xdr_msg);
- (void) fflush(mtool_msgs_fp);
- delete job_result_msg;
- );
return result;
}
/*
* update_target(line, result)