Print this page
make: translate using gettext, rather than the unmaintainable catgets
*** 35,44 ****
--- 35,45 ----
#include <mk/defs.h>
#include <mksh/dosys.h> /* sh_command2string() */
#include <mksh/macro.h> /* expand_value() */
#include <mksh/misc.h> /* retmem() */
#include <stdarg.h> /* va_list, va_start(), va_end() */
+ #include <libintl.h>
/*
* Defined macros
*/
*** 669,679 ****
if (makefile_type == reading_makefile) {
if (target->colons == no_colon) {
target->colons = separator;
} else {
if (target->colons != separator) {
! fatal_reader(catgets(catd, 1, 92, ":/:: conflict for target `%s'"),
target->string_mb);
}
}
if (target->colons == two_colon) {
if (depes->used == 0) {
--- 670,680 ----
if (makefile_type == reading_makefile) {
if (target->colons == no_colon) {
target->colons = separator;
} else {
if (target->colons != separator) {
! fatal_reader(gettext(":/:: conflict for target `%s'"),
target->string_mb);
}
}
if (target->colons == two_colon) {
if (depes->used == 0) {
*** 803,819 ****
}
}
}
break;
default:
! fatal_reader(catgets(catd, 1, 93, "Internal error. Unknown makefile type %d"),
makefile_type);
}
/* A target may only be involved in one target group */
if (line->body.line.target_group != NULL) {
if (target_group != NULL) {
! fatal_reader(catgets(catd, 1, 94, "Too many target groups for target `%s'"),
target->string_mb);
}
} else {
line->body.line.target_group = target_group;
}
--- 804,820 ----
}
}
}
break;
default:
! fatal_reader(gettext("Internal error. Unknown makefile type %d"),
makefile_type);
}
/* A target may only be involved in one target group */
if (line->body.line.target_group != NULL) {
if (target_group != NULL) {
! fatal_reader(gettext("Too many target groups for target `%s'"),
target->string_mb);
}
} else {
line->body.line.target_group = target_group;
}
*** 1076,1086 ****
p != NULL;
insert = &p->next, p = *insert);
*insert = result;
if (trace_reader) {
! (void) printf(NOCATGETS("Dynamic target %s:\n"), result->name->string_mb);
}
return( result);
}
--- 1077,1087 ----
p != NULL;
insert = &p->next, p = *insert);
*insert = result;
if (trace_reader) {
! (void) printf("Dynamic target %s:\n", result->name->string_mb);
}
return( result);
}
*** 1131,1141 ****
switch (target->special_reader) {
case svr4_special:
if (depes->used != 0) {
! fatal_reader(catgets(catd, 1, 98, "Illegal dependencies for target `%s'"),
target->string_mb);
}
svr4 = true;
posix = false;
keep_state = false;
--- 1132,1142 ----
switch (target->special_reader) {
case svr4_special:
if (depes->used != 0) {
! fatal_reader(gettext("Illegal dependencies for target `%s'"),
target->string_mb);
}
svr4 = true;
posix = false;
keep_state = false;
*** 1148,1167 ****
case posix_special:
if(svr4)
break;
if (depes->used != 0) {
! fatal_reader(catgets(catd, 1, 99, "Illegal dependencies for target `%s'"),
target->string_mb);
}
posix = true;
/* with posix on, use the posix get rule */
sccs_get_rule = sccs_get_posix_rule;
/* turn keep state off being SunPro make specific */
keep_state = false;
/* Use /usr/xpg4/bin/sh on Solaris */
! MBSTOWCS(wcs_buffer, NOCATGETS("/usr/xpg4/bin/sh"));
(void) SETVAR(shell_name, GETNAME(wcs_buffer, FIND_LENGTH), false);
if (trace_reader) {
(void) printf("%s:\n", posix_name->string_mb);
}
break;
--- 1149,1168 ----
case posix_special:
if(svr4)
break;
if (depes->used != 0) {
! fatal_reader(gettext("Illegal dependencies for target `%s'"),
target->string_mb);
}
posix = true;
/* with posix on, use the posix get rule */
sccs_get_rule = sccs_get_posix_rule;
/* turn keep state off being SunPro make specific */
keep_state = false;
/* Use /usr/xpg4/bin/sh on Solaris */
! MBSTOWCS(wcs_buffer, "/usr/xpg4/bin/sh");
(void) SETVAR(shell_name, GETNAME(wcs_buffer, FIND_LENGTH), false);
if (trace_reader) {
(void) printf("%s:\n", posix_name->string_mb);
}
break;
*** 1170,1180 ****
built_last_make_run_seen = true;
break;
case default_special:
if (depes->used != 0) {
! warning(catgets(catd, 1, 100, "Illegal dependency list for target `%s'"),
target->string_mb);
}
default_rule = command;
if (trace_reader) {
(void) printf("%s:\n",
--- 1171,1181 ----
built_last_make_run_seen = true;
break;
case default_special:
if (depes->used != 0) {
! warning(gettext("Illegal dependency list for target `%s'"),
target->string_mb);
}
default_rule = command;
if (trace_reader) {
(void) printf("%s:\n",
*** 1184,1194 ****
break;
case ignore_special:
if ((depes->used != 0) &&(!posix)){
! fatal_reader(catgets(catd, 1, 101, "Illegal dependencies for target `%s'"),
target->string_mb);
}
if (depes->used == 0)
{
ignore_errors_all = true;
--- 1185,1195 ----
break;
case ignore_special:
if ((depes->used != 0) &&(!posix)){
! fatal_reader(gettext("Illegal dependencies for target `%s'"),
target->string_mb);
}
if (depes->used == 0)
{
ignore_errors_all = true;
*** 1212,1222 ****
break;
/* ignore keep state, being SunPro make specific */
if(posix)
break;
if (depes->used != 0) {
! fatal_reader(catgets(catd, 1, 102, "Illegal dependencies for target `%s'"),
target->string_mb);
}
keep_state = true;
if (trace_reader) {
(void) printf("%s:\n",
--- 1213,1223 ----
break;
/* ignore keep state, being SunPro make specific */
if(posix)
break;
if (depes->used != 0) {
! fatal_reader(gettext("Illegal dependencies for target `%s'"),
target->string_mb);
}
keep_state = true;
if (trace_reader) {
(void) printf("%s:\n",
*** 1232,1269 ****
/* it's not necessary to specify KEEP_STATE, if this
** is given, so set the keep_state.
*/
keep_state = true;
if (depes->used != 0) {
! if((!make_state) ||(!strcmp(make_state->string_mb,NOCATGETS(".make.state")))) {
make_state = depes->names[0];
}
}
break;
case make_version_special:
if(svr4)
break;
if (depes->used != 1) {
! fatal_reader(catgets(catd, 1, 103, "Illegal dependency list for target `%s'"),
target->string_mb);
}
if (depes->names[0] != current_make_version) {
/*
* Special case the fact that version 1.0 and 1.1
* are identical.
*/
if (!IS_EQUAL(depes->names[0]->string_mb,
! NOCATGETS("VERSION-1.1")) ||
!IS_EQUAL(current_make_version->string_mb,
! NOCATGETS("VERSION-1.0"))) {
/*
* Version mismatches should cause the
* .make.state file to be skipped.
* This is currently not true - it is read
* anyway.
*/
! warning(catgets(catd, 1, 104, "Version mismatch between current version `%s' and `%s'"),
current_make_version->string_mb,
depes->names[0]->string_mb);
}
}
break;
--- 1233,1270 ----
/* it's not necessary to specify KEEP_STATE, if this
** is given, so set the keep_state.
*/
keep_state = true;
if (depes->used != 0) {
! if((!make_state) ||(!strcmp(make_state->string_mb,".make.state"))) {
make_state = depes->names[0];
}
}
break;
case make_version_special:
if(svr4)
break;
if (depes->used != 1) {
! fatal_reader(gettext("Illegal dependency list for target `%s'"),
target->string_mb);
}
if (depes->names[0] != current_make_version) {
/*
* Special case the fact that version 1.0 and 1.1
* are identical.
*/
if (!IS_EQUAL(depes->names[0]->string_mb,
! "VERSION-1.1") ||
!IS_EQUAL(current_make_version->string_mb,
! "VERSION-1.0")) {
/*
* Version mismatches should cause the
* .make.state file to be skipped.
* This is currently not true - it is read
* anyway.
*/
! warning(gettext("Version mismatch between current version `%s' and `%s'"),
current_make_version->string_mb,
depes->names[0]->string_mb);
}
}
break;
*** 1363,1373 ****
}
break;
case sccs_get_special:
if (depes->used != 0) {
! fatal_reader(catgets(catd, 1, 105, "Illegal dependencies for target `%s'"),
target->string_mb);
}
sccs_get_rule = command;
sccs_get_org_rule = command;
if (trace_reader) {
--- 1364,1374 ----
}
break;
case sccs_get_special:
if (depes->used != 0) {
! fatal_reader(gettext("Illegal dependencies for target `%s'"),
target->string_mb);
}
sccs_get_rule = command;
sccs_get_org_rule = command;
if (trace_reader) {
*** 1376,1386 ****
}
break;
case sccs_get_posix_special:
if (depes->used != 0) {
! fatal_reader(catgets(catd, 1, 106, "Illegal dependencies for target `%s'"),
target->string_mb);
}
sccs_get_posix_rule = command;
if (trace_reader) {
(void) printf("%s:\n", sccs_get_posix_name->string_mb);
--- 1377,1387 ----
}
break;
case sccs_get_posix_special:
if (depes->used != 0) {
! fatal_reader(gettext("Illegal dependencies for target `%s'"),
target->string_mb);
}
sccs_get_posix_rule = command;
if (trace_reader) {
(void) printf("%s:\n", sccs_get_posix_name->string_mb);
*** 1388,1398 ****
}
break;
case get_posix_special:
if (depes->used != 0) {
! fatal_reader(catgets(catd, 1, 107, "Illegal dependencies for target `%s'"),
target->string_mb);
}
get_posix_rule = command;
if (trace_reader) {
(void) printf("%s:\n", get_posix_name->string_mb);
--- 1389,1399 ----
}
break;
case get_posix_special:
if (depes->used != 0) {
! fatal_reader(gettext("Illegal dependencies for target `%s'"),
target->string_mb);
}
get_posix_rule = command;
if (trace_reader) {
(void) printf("%s:\n", get_posix_name->string_mb);
*** 1403,1413 ****
case get_special:
if(!svr4) {
break;
}
if (depes->used != 0) {
! fatal_reader(catgets(catd, 1, 108, "Illegal dependencies for target `%s'"),
target->string_mb);
}
get_rule = command;
sccs_get_rule = command;
if (trace_reader) {
--- 1404,1414 ----
case get_special:
if(!svr4) {
break;
}
if (depes->used != 0) {
! fatal_reader(gettext("Illegal dependencies for target `%s'"),
target->string_mb);
}
get_rule = command;
sccs_get_rule = command;
if (trace_reader) {
*** 1416,1426 ****
}
break;
case silent_special:
if ((depes->used != 0) && (!posix)){
! fatal_reader(catgets(catd, 1, 109, "Illegal dependencies for target `%s'"),
target->string_mb);
}
if (depes->used == 0)
{
silent_all = true;
--- 1417,1427 ----
}
break;
case silent_special:
if ((depes->used != 0) && (!posix)){
! fatal_reader(gettext("Illegal dependencies for target `%s'"),
target->string_mb);
}
if (depes->used == 0)
{
silent_all = true;
*** 1443,1453 ****
read_suffixes_list(depes);
break;
default:
! fatal_reader(catgets(catd, 1, 110, "Internal error: Unknown special reader"));
}
}
/*
* read_suffixes_list(depes)
--- 1444,1454 ----
read_suffixes_list(depes);
break;
default:
! fatal_reader(gettext("Internal error: Unknown special reader"));
}
}
/*
* read_suffixes_list(depes)
*** 1751,1765 ****
wchar_t * wcb = nms.get_string();
string = wcb;
if (string[0]=='F' &&
string[1]=='C' &&
string[2]=='\0') {
! MBSTOWCS(wcs_buffer, NOCATGETS("F77"));
temp = GETNAME(wcs_buffer, FIND_LENGTH);
(void) SETVAR(temp, value, append);
/*
! fprintf(stderr, catgets(catd, 1, 111, "warning: FC is obsolete, use F77 instead\n"));
*/
}
if (trace_reader) {
if (value == NULL) {
--- 1752,1766 ----
wchar_t * wcb = nms.get_string();
string = wcb;
if (string[0]=='F' &&
string[1]=='C' &&
string[2]=='\0') {
! MBSTOWCS(wcs_buffer, "F77");
temp = GETNAME(wcs_buffer, FIND_LENGTH);
(void) SETVAR(temp, value, append);
/*
! fprintf(stderr, gettext("warning: FC is obsolete, use F77 instead\n"));
*/
}
if (trace_reader) {
if (value == NULL) {
*** 1797,1808 ****
static wchar_t colon_sh[4];
static wchar_t colon_shell[7];
if (colon_sh[0] == (int) nul_char) {
! MBSTOWCS(colon_sh, NOCATGETS(":sh"));
! MBSTOWCS(colon_shell, NOCATGETS(":shell"));
}
Wstring nms((*name));
wchar_t * wcb = nms.get_string();
colon = (wchar_t *) wsrchr(wcb, (int) colon_char);
--- 1798,1809 ----
static wchar_t colon_sh[4];
static wchar_t colon_shell[7];
if (colon_sh[0] == (int) nul_char) {
! MBSTOWCS(colon_sh, ":sh");
! MBSTOWCS(colon_shell, ":shell");
}
Wstring nms((*name));
wchar_t * wcb = nms.get_string();
colon = (wchar_t *) wsrchr(wcb, (int) colon_char);
*** 1855,1865 ****
va_start(args, pattern);
if (file_being_read != NULL) {
WCSTOMBS(mbs_buffer, file_being_read);
if (line_number != 0) {
(void) sprintf(message,
! catgets(catd, 1, 112, "%s, line %d: %s"),
mbs_buffer,
line_number,
pattern);
} else {
(void) sprintf(message,
--- 1856,1866 ----
va_start(args, pattern);
if (file_being_read != NULL) {
WCSTOMBS(mbs_buffer, file_being_read);
if (line_number != 0) {
(void) sprintf(message,
! gettext("%s, line %d: %s"),
mbs_buffer,
line_number,
pattern);
} else {
(void) sprintf(message,
*** 1869,1893 ****
}
pattern = message;
}
(void) fflush(stdout);
! (void) fprintf(stderr, catgets(catd, 1, 238, "make: Fatal error in reader: "));
(void) vfprintf(stderr, pattern, args);
(void) fprintf(stderr, "\n");
va_end(args);
if (temp_file_name != NULL) {
(void) fprintf(stderr,
! catgets(catd, 1, 239, "make: Temp-file %s not removed\n"),
temp_file_name->string_mb);
temp_file_name = NULL;
}
if (report_pwd) {
(void) fprintf(stderr,
! catgets(catd, 1, 115, "Current working directory %s\n"),
get_current_path());
}
(void) fflush(stderr);
exit_status = 1;
exit(1);
--- 1870,1894 ----
}
pattern = message;
}
(void) fflush(stdout);
! (void) fprintf(stderr, gettext("make: Fatal error in reader: "));
(void) vfprintf(stderr, pattern, args);
(void) fprintf(stderr, "\n");
va_end(args);
if (temp_file_name != NULL) {
(void) fprintf(stderr,
! gettext("make: Temp-file %s not removed\n"),
temp_file_name->string_mb);
temp_file_name = NULL;
}
if (report_pwd) {
(void) fprintf(stderr,
! gettext("Current working directory %s\n"),
get_current_path());
}
(void) fflush(stderr);
exit_status = 1;
exit(1);