Print this page
make: translate using gettext, rather than the unmaintainable catgets
*** 43,52 ****
--- 43,53 ----
#include <mk/defs.h>
#include <mksh/macro.h> /* SETVAR() */
#include <mksh/misc.h> /* enable_interrupt() */
#include <stdarg.h> /* va_list, va_start(), va_end() */
#include <vroot/report.h> /* SUNPRO_DEPENDENCIES */
+ #include <libintl.h>
#define MAXJOBS_ADJUST_RFE4694000
#ifdef MAXJOBS_ADJUST_RFE4694000
*** 139,155 ****
{
va_list args;
va_start(args, message);
(void) fflush(stdout);
! (void) fprintf(stderr, catgets(catd, 1, 263, "make: Fatal error: "));
(void) vfprintf(stderr, message, args);
(void) fprintf(stderr, "\n");
va_end(args);
if (report_pwd) {
(void) fprintf(stderr,
! catgets(catd, 1, 156, "Current working directory %s\n"),
get_current_path());
}
(void) fflush(stderr);
if (fatal_in_progress) {
exit_status = 1;
--- 140,156 ----
{
va_list args;
va_start(args, message);
(void) fflush(stdout);
! (void) fprintf(stderr, gettext("make: Fatal error: "));
(void) vfprintf(stderr, message, args);
(void) fprintf(stderr, "\n");
va_end(args);
if (report_pwd) {
(void) fprintf(stderr,
! gettext("Current working directory %s\n"),
get_current_path());
}
(void) fflush(stderr);
if (fatal_in_progress) {
exit_status = 1;
*** 158,171 ****
fatal_in_progress = true;
/* Let all parallel children finish */
if ((dmake_mode_type == parallel_mode) &&
(parallel_process_cnt > 0)) {
(void) fprintf(stderr,
! catgets(catd, 1, 157, "Waiting for %d %s to finish\n"),
parallel_process_cnt,
parallel_process_cnt == 1 ?
! catgets(catd, 1, 158, "job") : catgets(catd, 1, 159, "jobs"));
(void) fflush(stderr);
}
while (parallel_process_cnt > 0) {
await_parallel(true);
--- 159,172 ----
fatal_in_progress = true;
/* Let all parallel children finish */
if ((dmake_mode_type == parallel_mode) &&
(parallel_process_cnt > 0)) {
(void) fprintf(stderr,
! gettext("Waiting for %d %s to finish\n"),
parallel_process_cnt,
parallel_process_cnt == 1 ?
! gettext("job") : gettext("jobs"));
(void) fflush(stderr);
}
while (parallel_process_cnt > 0) {
await_parallel(true);
*** 198,214 ****
{
va_list args;
va_start(args, message);
(void) fflush(stdout);
! (void) fprintf(stderr, catgets(catd, 1, 265, "make: Warning: "));
(void) vfprintf(stderr, message, args);
(void) fprintf(stderr, "\n");
va_end(args);
if (report_pwd) {
(void) fprintf(stderr,
! catgets(catd, 1, 161, "Current working directory %s\n"),
get_current_path());
}
(void) fflush(stderr);
}
--- 199,215 ----
{
va_list args;
va_start(args, message);
(void) fflush(stdout);
! (void) fprintf(stderr, gettext("make: Warning: "));
(void) vfprintf(stderr, message, args);
(void) fprintf(stderr, "\n");
va_end(args);
if (report_pwd) {
(void) fprintf(stderr,
! gettext("Current working directory %s\n"),
get_current_path());
}
(void) fflush(stderr);
}
*** 231,247 ****
{
struct tm *tm;
char buf[128];
if (time == file_doesnt_exist) {
! return catgets(catd, 1, 163, "File does not exist");
}
if (time == file_max_time) {
! return catgets(catd, 1, 164, "Younger than any file");
}
tm = localtime(&time.tv_sec);
! strftime(buf, sizeof (buf), NOCATGETS("%c %Z"), tm);
buf[127] = (int) nul_char;
return strdup(buf);
}
/*
--- 232,248 ----
{
struct tm *tm;
char buf[128];
if (time == file_doesnt_exist) {
! return gettext("File does not exist");
}
if (time == file_max_time) {
! return gettext("Younger than any file");
}
tm = localtime(&time.tv_sec);
! strftime(buf, sizeof (buf), "%c %Z", tm);
buf[127] = (int) nul_char;
return strdup(buf);
}
/*
*** 556,659 ****
{
char *cp;
Name dollar;
/* Load the cached_names struct */
! MBSTOWCS(wcs_buffer, NOCATGETS(".BUILT_LAST_MAKE_RUN"));
built_last_make_run = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS("@"));
c_at = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS(" *conditionals* "));
conditionals = GETNAME(wcs_buffer, FIND_LENGTH);
/*
* A version of make was released with NSE 1.0 that used
* VERSION-1.1 but this version is identical to VERSION-1.0.
* The version mismatch code makes a special case for this
* situation. If the version number is changed from 1.0
* it should go to 1.2.
*/
! MBSTOWCS(wcs_buffer, NOCATGETS("VERSION-1.0"));
current_make_version = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS(".SVR4"));
svr4_name = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS(".POSIX"));
posix_name = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS(".DEFAULT"));
default_rule_name = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS("$"));
dollar = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS(".DONE"));
done = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS("."));
dot = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS(".KEEP_STATE"));
dot_keep_state = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS(".KEEP_STATE_FILE"));
dot_keep_state_file = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS(""));
empty_name = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS(" FORCE"));
force = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS("HOST_ARCH"));
host_arch = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS("HOST_MACH"));
host_mach = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS(".IGNORE"));
ignore_name = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS(".INIT"));
init = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS(".LOCAL"));
localhost_name = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS(".make.state"));
make_state = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS("MAKEFLAGS"));
makeflags = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS(".MAKE_VERSION"));
make_version = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS(".NO_PARALLEL"));
no_parallel_name = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS(".NOT_AUTO"));
not_auto = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS(".PARALLEL"));
parallel_name = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS("PATH"));
path_name = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS("+"));
plus = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS(".PRECIOUS"));
precious = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS("?"));
query = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS("^"));
hat = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS(".RECURSIVE"));
recursive_name = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS(".SCCS_GET"));
sccs_get_name = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS(".SCCS_GET_POSIX"));
sccs_get_posix_name = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS(".GET"));
get_name = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS(".GET_POSIX"));
get_posix_name = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS("SHELL"));
shell_name = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS(".SILENT"));
silent_name = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS(".SUFFIXES"));
suffixes_name = GETNAME(wcs_buffer, FIND_LENGTH);
MBSTOWCS(wcs_buffer, SUNPRO_DEPENDENCIES);
sunpro_dependencies = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS("TARGET_ARCH"));
target_arch = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS("TARGET_MACH"));
target_mach = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS("VIRTUAL_ROOT"));
virtual_root = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS("VPATH"));
vpath_name = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, NOCATGETS(".WAIT"));
wait_name = GETNAME(wcs_buffer, FIND_LENGTH);
wait_name->state = build_ok;
/* Mark special targets so that the reader treats them properly */
--- 557,660 ----
{
char *cp;
Name dollar;
/* Load the cached_names struct */
! MBSTOWCS(wcs_buffer, ".BUILT_LAST_MAKE_RUN");
built_last_make_run = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, "@");
c_at = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, " *conditionals* ");
conditionals = GETNAME(wcs_buffer, FIND_LENGTH);
/*
* A version of make was released with NSE 1.0 that used
* VERSION-1.1 but this version is identical to VERSION-1.0.
* The version mismatch code makes a special case for this
* situation. If the version number is changed from 1.0
* it should go to 1.2.
*/
! MBSTOWCS(wcs_buffer, "VERSION-1.0");
current_make_version = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, ".SVR4");
svr4_name = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, ".POSIX");
posix_name = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, ".DEFAULT");
default_rule_name = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, "$");
dollar = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, ".DONE");
done = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, ".");
dot = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, ".KEEP_STATE");
dot_keep_state = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, ".KEEP_STATE_FILE");
dot_keep_state_file = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, "");
empty_name = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, " FORCE");
force = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, "HOST_ARCH");
host_arch = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, "HOST_MACH");
host_mach = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, ".IGNORE");
ignore_name = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, ".INIT");
init = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, ".LOCAL");
localhost_name = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, ".make.state");
make_state = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, "MAKEFLAGS");
makeflags = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, ".MAKE_VERSION");
make_version = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, ".NO_PARALLEL");
no_parallel_name = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, ".NOT_AUTO");
not_auto = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, ".PARALLEL");
parallel_name = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, "PATH");
path_name = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, "+");
plus = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, ".PRECIOUS");
precious = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, "?");
query = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, "^");
hat = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, ".RECURSIVE");
recursive_name = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, ".SCCS_GET");
sccs_get_name = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, ".SCCS_GET_POSIX");
sccs_get_posix_name = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, ".GET");
get_name = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, ".GET_POSIX");
get_posix_name = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, "SHELL");
shell_name = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, ".SILENT");
silent_name = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, ".SUFFIXES");
suffixes_name = GETNAME(wcs_buffer, FIND_LENGTH);
MBSTOWCS(wcs_buffer, SUNPRO_DEPENDENCIES);
sunpro_dependencies = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, "TARGET_ARCH");
target_arch = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, "TARGET_MACH");
target_mach = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, "VIRTUAL_ROOT");
virtual_root = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, "VPATH");
vpath_name = GETNAME(wcs_buffer, FIND_LENGTH);
! MBSTOWCS(wcs_buffer, ".WAIT");
wait_name = GETNAME(wcs_buffer, FIND_LENGTH);
wait_name->state = build_ok;
/* Mark special targets so that the reader treats them properly */
*** 680,692 ****
(void) SETVAR(dollar, dollar, false);
dollar->dollar = false;
/* Set the value of $(SHELL) */
if (posix) {
! MBSTOWCS(wcs_buffer, NOCATGETS("/usr/xpg4/bin/sh"));
} else {
! MBSTOWCS(wcs_buffer, NOCATGETS("/bin/sh"));
}
(void) SETVAR(shell_name, GETNAME(wcs_buffer, FIND_LENGTH), false);
/*
* Use " FORCE" to simulate a FRC dependency for :: type
--- 681,693 ----
(void) SETVAR(dollar, dollar, false);
dollar->dollar = false;
/* Set the value of $(SHELL) */
if (posix) {
! MBSTOWCS(wcs_buffer, "/usr/xpg4/bin/sh");
} else {
! MBSTOWCS(wcs_buffer, "/bin/sh");
}
(void) SETVAR(shell_name, GETNAME(wcs_buffer, FIND_LENGTH), false);
/*
* Use " FORCE" to simulate a FRC dependency for :: type
*** 704,716 ****
}
/* Check if there is NO PATH variable. If not we construct one. */
if (getenv(path_name->string_mb) == NULL) {
vroot_path = NULL;
! add_dir_to_path(NOCATGETS("."), &vroot_path, -1);
! add_dir_to_path(NOCATGETS("/bin"), &vroot_path, -1);
! add_dir_to_path(NOCATGETS("/usr/bin"), &vroot_path, -1);
}
}
/*
* iterate on list of conditional macros in np, and place them in
--- 705,717 ----
}
/* Check if there is NO PATH variable. If not we construct one. */
if (getenv(path_name->string_mb) == NULL) {
vroot_path = NULL;
! add_dir_to_path(".", &vroot_path, -1);
! add_dir_to_path("/bin", &vroot_path, -1);
! add_dir_to_path("/usr/bin", &vroot_path, -1);
}
}
/*
* iterate on list of conditional macros in np, and place them in