Print this page
make: remove maketool support

*** 59,70 **** */ # 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 --- 59,68 ----
*** 1771,1795 **** 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; --- 1769,1778 ----
*** 1817,1849 **** 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) { --- 1800,1811 ----
*** 1855,1902 **** /* 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); 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 --- 1817,1839 ---- /* ds 98.04.23 bug #4085164. make should always show error messages */ false, /* BOOLEAN(rule->silent && rule->ignore_error), */ (Boolean) rule->always_exec, ! target); check_state(temp_file_name); } } 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); } if (!rule->ignore_error && !ignore_errors) { if (!continue_after_error) { fatal(catgets(catd, 1, 244, "Command failed for target `%s'"), target->string_mb); } /* * Make sure a failing command is not
*** 1912,1929 **** 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; --- 1849,1858 ----
*** 2581,2605 **** 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" --- 2510,2519 ----
*** 2625,2681 **** } 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; ! ); ! } else { result = build_ok; } } else { result = build_ok; --- 2539,2557 ---- } if (!silent || do_not_exec_rule && (target_group == NULL)) { (void) printf("%s\n", touch_cmd->string_mb); } /* Run the touch command, or simulate it */ if (!do_not_exec_rule) { result = dosys(touch_cmd, false, false, false, false, ! name); } else { result = build_ok; } } else { result = build_ok;
*** 2689,2705 **** 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) --- 2565,2574 ----