Print this page
make: translate using gettext, rather than the unmaintainable catgets

*** 33,42 **** --- 33,43 ---- * Included files */ #include <mk/defs.h> #include <mksh/macro.h> /* expand_value() */ #include <mksh/misc.h> /* retmem() */ + #include <libintl.h> /* * Defined macros */
*** 137,147 **** if (target->has_target_prop) { true_target = get_prop(target->prop, target_prop)->body.target.target; } if (debug_level > 1) { ! (void) printf(NOCATGETS("%*sfind_suffix_rule(%s,%s,%s)\n"), recursion_level, "", true_target->string_mb, target_body->string_mb, target_suffix->string_mb); --- 138,148 ---- if (target->has_target_prop) { true_target = get_prop(target->prop, target_prop)->body.target.target; } if (debug_level > 1) { ! (void) printf("%*sfind_suffix_rule(%s,%s,%s)\n", recursion_level, "", true_target->string_mb, target_body->string_mb, target_suffix->string_mb);
*** 187,197 **** put_suffix[source_suffix->body. suffix.suffix->hash.length] = (int) nul_char; if (debug_level > 1) { WCSTOMBS(mbs_buffer, sourcename); ! (void) printf(catgets(catd, 1, 218, "%*sTrying %s\n"), recursion_level, "", mbs_buffer); } source = getname_fn(sourcename, FIND_LENGTH, false, &name_found); --- 188,198 ---- put_suffix[source_suffix->body. suffix.suffix->hash.length] = (int) nul_char; if (debug_level > 1) { WCSTOMBS(mbs_buffer, sourcename); ! (void) printf(gettext("%*sTrying %s\n"), recursion_level, "", mbs_buffer); } source = getname_fn(sourcename, FIND_LENGTH, false, &name_found);
*** 237,253 **** p = np; } else {break;} } /* copy everything including '/' */ strncpy(tmpbuf, source->string_mb, p - source->string_mb + 1); ! strcat(tmpbuf, NOCATGETS("s.")); strcat(tmpbuf, p+1); retmem((wchar_t *) source->string_mb); source->string_mb = tmpbuf; } else { ! strcpy(tmpbuf, NOCATGETS("s.")); strcat(tmpbuf, source->string_mb); retmem((wchar_t *) source->string_mb); source->string_mb = tmpbuf; } --- 238,254 ---- p = np; } else {break;} } /* copy everything including '/' */ strncpy(tmpbuf, source->string_mb, p - source->string_mb + 1); ! strcat(tmpbuf, "s."); strcat(tmpbuf, p+1); retmem((wchar_t *) source->string_mb); source->string_mb = tmpbuf; } else { ! strcpy(tmpbuf, "s."); strcat(tmpbuf, source->string_mb); retmem((wchar_t *) source->string_mb); source->string_mb = tmpbuf; }
*** 347,357 **** return build_failed; } if (debug_level > 1) { WCSTOMBS(mbs_buffer, sourcename); ! (void) printf(catgets(catd, 1, 219, "%*sFound %s\n"), recursion_level, "", mbs_buffer); } --- 348,358 ---- return build_failed; } if (debug_level > 1) { WCSTOMBS(mbs_buffer, sourcename); ! (void) printf(gettext("%*sFound %s\n"), recursion_level, "", mbs_buffer); }
*** 367,377 **** if (*command == NULL) { *command = line; } if ((source->stat.time > (*command)->body.line.dependency_time) && (debug_level > 1)) { ! (void) printf(catgets(catd, 1, 220, "%*sDate(%s)=%s Date-dependencies(%s)=%s\n"), recursion_level, "", source->string_mb, time_to_string(source-> stat.time), --- 368,378 ---- if (*command == NULL) { *command = line; } if ((source->stat.time > (*command)->body.line.dependency_time) && (debug_level > 1)) { ! (void) printf(gettext("%*sDate(%s)=%s Date-dependencies(%s)=%s\n"), recursion_level, "", source->string_mb, time_to_string(source-> stat.time),
*** 398,408 **** if (build_unconditional || out_of_date) { if(!rechecking) { line->body.line.is_out_of_date = true; } if (debug_level > 0) { ! (void) printf(catgets(catd, 1, 221, "%*sBuilding %s using suffix rule for %s%s because it is out of date relative to %s\n"), recursion_level, "", true_target->string_mb, source_suffix->body.suffix.suffix->string_mb, target_suffix->string_mb, --- 399,409 ---- if (build_unconditional || out_of_date) { if(!rechecking) { line->body.line.is_out_of_date = true; } if (debug_level > 0) { ! (void) printf(gettext("%*sBuilding %s using suffix rule for %s%s because it is out of date relative to %s\n"), recursion_level, "", true_target->string_mb, source_suffix->body.suffix.suffix->string_mb, target_suffix->string_mb,
*** 434,444 **** char tstr[256]; extern Boolean dollarless_flag; extern Name dollarless_value; if(tilde_rule) { ! MBSTOWCS(wcs_buffer, NOCATGETS(source->string_mb)); dollarless_value = GETNAME(wcs_buffer,FIND_LENGTH); } else { dollarless_flag = false; } --- 435,445 ---- char tstr[256]; extern Boolean dollarless_flag; extern Name dollarless_value; if(tilde_rule) { ! MBSTOWCS(wcs_buffer, source->string_mb); dollarless_value = GETNAME(wcs_buffer,FIND_LENGTH); } else { dollarless_flag = false; }
*** 504,524 **** Wstring targ_string(true_target); Wstring suf_string; if (dot_a == NULL) { ! MBSTOWCS(wcs_buffer, NOCATGETS(".a")); dot_a = GETNAME(wcs_buffer, FIND_LENGTH); } target_end = targ_string.get_string() + true_target->hash.length; /* * We compare the tail of the target name with the suffixes * from .SUFFIXES. */ if (debug_level > 1) { ! (void) printf(NOCATGETS("%*sfind_ar_suffix_rule(%s)\n"), recursion_level, "", true_target->string_mb); } /* --- 505,525 ---- Wstring targ_string(true_target); Wstring suf_string; if (dot_a == NULL) { ! MBSTOWCS(wcs_buffer, ".a"); dot_a = GETNAME(wcs_buffer, FIND_LENGTH); } target_end = targ_string.get_string() + true_target->hash.length; /* * We compare the tail of the target name with the suffixes * from .SUFFIXES. */ if (debug_level > 1) { ! (void) printf("%*sfind_ar_suffix_rule(%s)\n", recursion_level, "", true_target->string_mb); } /*
*** 615,625 **** * We compare the tail of the target name with the * suffixes from .SUFFIXES. */ target_end = targ_string.get_string() + true_target->hash.length; if (debug_level > 1) { ! (void) printf(NOCATGETS("%*sfind_double_suffix_rule(%s)\n"), recursion_level, "", true_target->string_mb); } /* --- 616,626 ---- * We compare the tail of the target name with the * suffixes from .SUFFIXES. */ target_end = targ_string.get_string() + true_target->hash.length; if (debug_level > 1) { ! (void) printf("%*sfind_double_suffix_rule(%s)\n", recursion_level, "", true_target->string_mb); } /*
*** 707,717 **** /* again later */ if ((suffixes == NULL) || !working_on_targets) { return; } if (debug_level > 1) { ! (void) printf(NOCATGETS("%*sbuild_suffix_list(%s) "), recursion_level, "", target_suffix->string_mb); } /* Mark the target suffix saying we cashed its list */ --- 708,718 ---- /* again later */ if ((suffixes == NULL) || !working_on_targets) { return; } if (debug_level > 1) { ! (void) printf("%*sbuild_suffix_list(%s) ", recursion_level, "", target_suffix->string_mb); } /* Mark the target suffix saying we cashed its list */
*** 820,830 **** if (target->has_long_member_name) { true_target = get_prop(target->prop, long_member_name_prop)->body.long_member_name.member_name; } if (debug_level > 1) { ! (void) printf(catgets(catd, 1, 222, "%*sLooking for %% rule for %s\n"), recursion_level, "", true_target->string_mb); } for (pat_rule = percent_list; --- 821,831 ---- if (target->has_long_member_name) { true_target = get_prop(target->prop, long_member_name_prop)->body.long_member_name.member_name; } if (debug_level > 1) { ! (void) printf(gettext("%*sLooking for %% rule for %s\n"), recursion_level, "", true_target->string_mb); } for (pat_rule = percent_list;
*** 901,911 **** if (depe_to_check == empty_name) { result = build_ok; } else { if (debug_level > 1) { ! (void) printf(catgets(catd, 1, 223, "%*sTrying %s\n"), recursion_level, "", depe_to_check->string_mb); } --- 902,912 ---- if (depe_to_check == empty_name) { result = build_ok; } else { if (debug_level > 1) { ! (void) printf(gettext("%*sTrying %s\n"), recursion_level, "", depe_to_check->string_mb); }
*** 991,1001 **** } return result; } if (debug_level > 1) { ! (void) printf(catgets(catd, 1, 224, "%*sMatched %s:"), recursion_level, "", target->string_mb); for (pat_depe = pat_rule->dependencies; --- 992,1002 ---- } return result; } if (debug_level > 1) { ! (void) printf(gettext("%*sMatched %s:"), recursion_level, "", target->string_mb); for (pat_depe = pat_rule->dependencies;
*** 1017,1027 **** if (depe_to_check != empty_name) { (void) printf(" %s", depe_to_check->string_mb); } } ! (void) printf(catgets(catd, 1, 225, " from: %s:"), pat_rule->name->string_mb); for (pat_depe = pat_rule->dependencies; pat_depe != NULL; pat_depe = pat_depe->next) { --- 1018,1028 ---- if (depe_to_check != empty_name) { (void) printf(" %s", depe_to_check->string_mb); } } ! (void) printf(gettext(" from: %s:"), pat_rule->name->string_mb); for (pat_depe = pat_rule->dependencies; pat_depe != NULL; pat_depe = pat_depe->next) {
*** 1067,1077 **** return build_running; } if ((depe->name->stat.time > line->body.line.dependency_time) && (debug_level > 1)) { ! (void) printf(catgets(catd, 1, 226, "%*sDate(%s)=%s Date-dependencies(%s)=%s\n"), recursion_level, "", depe->name->string_mb, time_to_string(depe->name->stat.time), true_target->string_mb, --- 1068,1078 ---- return build_running; } if ((depe->name->stat.time > line->body.line.dependency_time) && (debug_level > 1)) { ! (void) printf(gettext("%*sDate(%s)=%s Date-dependencies(%s)=%s\n"), recursion_level, "", depe->name->string_mb, time_to_string(depe->name->stat.time), true_target->string_mb,
*** 1093,1103 **** line->body.line.is_out_of_date = true; } add_target_to_chain(depe->name, &(line->body.line.query)); if (debug_level > 0) { ! (void) printf(catgets(catd, 1, 227, "%*sBuilding %s using pattern rule %s:"), recursion_level, "", true_target->string_mb, pat_rule->name->string_mb); --- 1094,1104 ---- line->body.line.is_out_of_date = true; } add_target_to_chain(depe->name, &(line->body.line.query)); if (debug_level > 0) { ! (void) printf(gettext("%*sBuilding %s using pattern rule %s:"), recursion_level, "", true_target->string_mb, pat_rule->name->string_mb);
*** 1105,1115 **** pat_depe != NULL; pat_depe = pat_depe->next) { (void) printf(" %s", pat_depe->name->string_mb); } ! (void) printf(catgets(catd, 1, 228, " because it is out of date relative to %s\n"), depe->name->string_mb); } } } } else { --- 1106,1116 ---- pat_depe != NULL; pat_depe = pat_depe->next) { (void) printf(" %s", pat_depe->name->string_mb); } ! (void) printf(gettext(" because it is out of date relative to %s\n"), depe->name->string_mb); } } } } else {
*** 1117,1134 **** (true_target->stat.time < line->body.line.dependency_time)) { if(!rechecking) { line->body.line.is_out_of_date = true; } if (debug_level > 0) { ! (void) printf(catgets(catd, 1, 229, "%*sBuilding %s using pattern rule %s: "), recursion_level, "", true_target->string_mb, pat_rule->name->string_mb, (target->stat.time > file_doesnt_exist) ? ! catgets(catd, 1, 230, "because it is out of date") : ! catgets(catd, 1, 236, "because it does not exist")); } } } /* enter explicit rule from percent rule */ --- 1118,1135 ---- (true_target->stat.time < line->body.line.dependency_time)) { if(!rechecking) { line->body.line.is_out_of_date = true; } if (debug_level > 0) { ! (void) printf(gettext("%*sBuilding %s using pattern rule %s: "), recursion_level, "", true_target->string_mb, pat_rule->name->string_mb, (target->stat.time > file_doesnt_exist) ? ! gettext("because it is out of date") : ! gettext("because it does not exist")); } } } /* enter explicit rule from percent rule */