45 #include <setjmp.h>
46 #include <signal.h>
47 #include <stdlib.h>
48 #include <sys/errno.h> /* ENOENT */
49 #include <sys/stat.h> /* fstat() */
50 #include <fcntl.h> /* open() */
51
52 # include <sys/systeminfo.h> /* sysinfo() */
53
54 #include <sys/types.h> /* stat() */
55 #include <sys/wait.h> /* wait() */
56 #include <unistd.h> /* execv(), unlink(), access() */
57 #include <vroot/report.h> /* report_dependency(), get_report_file() */
58
59 // From read2.cc
60 extern Name normalize_name(register wchar_t *name_string, register int length);
61
62 // From parallel.cc
63 #define MAXJOBS_ADJUST_RFE4694000
64
65 #ifdef MAXJOBS_ADJUST_RFE4694000
66 extern void job_adjust_fini();
67 #endif /* MAXJOBS_ADJUST_RFE4694000 */
68
69
70 /*
71 * Defined macros
72 */
73 #define LD_SUPPORT_ENV_VAR "SGS_SUPPORT_32"
74 #define LD_SUPPORT_ENV_VAR_32 "SGS_SUPPORT_32"
75 #define LD_SUPPORT_ENV_VAR_64 "SGS_SUPPORT_64"
76 #define LD_SUPPORT_MAKE_LIB "libmakestate.so.1"
77 #ifdef __i386
78 #define LD_SUPPORT_MAKE_ARCH "i386"
79 #elif __sparc
80 #define LD_SUPPORT_MAKE_ARCH "sparc"
81 #else
82 #error "Unsupported architecture"
83 #endif
84
85 /*
86 * typedefs & structs
87 */
698 retmem_mb(rp->stderr_file);
699 rp->stderr_file = NULL;
700 }
701 command_changed = true;
702 /*
703 line = get_prop(rp->target->prop, line_prop);
704 if (line != NULL) {
705 line->body.line.command_used = NULL;
706 }
707 */
708 }
709 /* Remove the statefile lock file if the file has been locked */
710 if ((make_state_lockfile != NULL) && (make_state_locked)) {
711 (void) unlink(make_state_lockfile);
712 make_state_lockfile = NULL;
713 make_state_locked = false;
714 }
715 /* Write .make.state */
716 write_state_file(1, (Boolean) 1);
717
718 #if defined (TEAMWARE_MAKE_CMN) && defined (MAXJOBS_ADJUST_RFE4694000)
719 job_adjust_fini();
720 #endif
721 }
722
723 /*
724 * handle_interrupt()
725 *
726 * This is where C-C traps are caught.
727 *
728 * Parameters:
729 *
730 * Global variables used (except DMake 1.0):
731 * current_target Sometimes the current target is removed
732 * do_not_exec_rule But not if -n is on
733 * quest or -q
734 * running_list List of parallel running processes
735 * touch Current target is not removed if -t on
736 */
737 void
738 handle_interrupt(int)
739 {
740 Property member;
1147 Boolean add_hyphen;
1148 int i;
1149 char tmp_char;
1150
1151 mf_argc = 1;
1152 cp = getenv(makeflags->string_mb);
1153 cp_orig = cp;
1154
1155 if (cp) {
1156 /*
1157 * If new MAKEFLAGS format, no need to add hyphen.
1158 * If old MAKEFLAGS format, add hyphen before flags.
1159 */
1160
1161 if ((strchr(cp, (int) hyphen_char) != NULL) ||
1162 (strchr(cp, (int) equal_char) != NULL)) {
1163
1164 /* New MAKEFLAGS format */
1165
1166 add_hyphen = false;
1167 #ifdef ADDFIX5060758
1168 /* Check if MAKEFLAGS value begins with multiple
1169 * hyphen characters, and remove all duplicates.
1170 * Usually it happens when the next command is
1171 * used: $(MAKE) -$(MAKEFLAGS)
1172 * This is a workaround for BugID 5060758.
1173 */
1174 while (*cp) {
1175 if (*cp != (int) hyphen_char) {
1176 break;
1177 }
1178 cp++;
1179 if (*cp == (int) hyphen_char) {
1180 /* There are two hyphens. Skip one */
1181 cp_orig = cp;
1182 cp++;
1183 }
1184 if (!(*cp)) {
1185 /* There are hyphens only. Skip all */
1186 cp_orig = cp;
1187 break;
1188 }
1189 }
1190 #endif
1191 } else {
1192
1193 /* Old MAKEFLAGS format */
1194
1195 add_hyphen = true;
1196 }
1197 }
1198
1199 /* Find the number of arguments in MAKEFLAGS */
1200 while (cp && *cp) {
1201 /* Skip white spaces */
1202 while (cp && *cp && isspace(*cp)) {
1203 cp++;
1204 }
1205 if (cp && *cp) {
1206 /* Increment arg count */
1207 mf_argc++;
1208 /* Go to next white space */
1209 while (cp && *cp && !isspace(*cp)) {
1210 if(*cp == (int) backslash_char) {
|
45 #include <setjmp.h>
46 #include <signal.h>
47 #include <stdlib.h>
48 #include <sys/errno.h> /* ENOENT */
49 #include <sys/stat.h> /* fstat() */
50 #include <fcntl.h> /* open() */
51
52 # include <sys/systeminfo.h> /* sysinfo() */
53
54 #include <sys/types.h> /* stat() */
55 #include <sys/wait.h> /* wait() */
56 #include <unistd.h> /* execv(), unlink(), access() */
57 #include <vroot/report.h> /* report_dependency(), get_report_file() */
58
59 // From read2.cc
60 extern Name normalize_name(register wchar_t *name_string, register int length);
61
62 // From parallel.cc
63 #define MAXJOBS_ADJUST_RFE4694000
64
65 extern void job_adjust_fini();
66
67
68 /*
69 * Defined macros
70 */
71 #define LD_SUPPORT_ENV_VAR "SGS_SUPPORT_32"
72 #define LD_SUPPORT_ENV_VAR_32 "SGS_SUPPORT_32"
73 #define LD_SUPPORT_ENV_VAR_64 "SGS_SUPPORT_64"
74 #define LD_SUPPORT_MAKE_LIB "libmakestate.so.1"
75 #ifdef __i386
76 #define LD_SUPPORT_MAKE_ARCH "i386"
77 #elif __sparc
78 #define LD_SUPPORT_MAKE_ARCH "sparc"
79 #else
80 #error "Unsupported architecture"
81 #endif
82
83 /*
84 * typedefs & structs
85 */
696 retmem_mb(rp->stderr_file);
697 rp->stderr_file = NULL;
698 }
699 command_changed = true;
700 /*
701 line = get_prop(rp->target->prop, line_prop);
702 if (line != NULL) {
703 line->body.line.command_used = NULL;
704 }
705 */
706 }
707 /* Remove the statefile lock file if the file has been locked */
708 if ((make_state_lockfile != NULL) && (make_state_locked)) {
709 (void) unlink(make_state_lockfile);
710 make_state_lockfile = NULL;
711 make_state_locked = false;
712 }
713 /* Write .make.state */
714 write_state_file(1, (Boolean) 1);
715
716 job_adjust_fini();
717 }
718
719 /*
720 * handle_interrupt()
721 *
722 * This is where C-C traps are caught.
723 *
724 * Parameters:
725 *
726 * Global variables used (except DMake 1.0):
727 * current_target Sometimes the current target is removed
728 * do_not_exec_rule But not if -n is on
729 * quest or -q
730 * running_list List of parallel running processes
731 * touch Current target is not removed if -t on
732 */
733 void
734 handle_interrupt(int)
735 {
736 Property member;
1143 Boolean add_hyphen;
1144 int i;
1145 char tmp_char;
1146
1147 mf_argc = 1;
1148 cp = getenv(makeflags->string_mb);
1149 cp_orig = cp;
1150
1151 if (cp) {
1152 /*
1153 * If new MAKEFLAGS format, no need to add hyphen.
1154 * If old MAKEFLAGS format, add hyphen before flags.
1155 */
1156
1157 if ((strchr(cp, (int) hyphen_char) != NULL) ||
1158 (strchr(cp, (int) equal_char) != NULL)) {
1159
1160 /* New MAKEFLAGS format */
1161
1162 add_hyphen = false;
1163
1164 /* Check if MAKEFLAGS value begins with multiple
1165 * hyphen characters, and remove all duplicates.
1166 * Usually it happens when the next command is
1167 * used: $(MAKE) -$(MAKEFLAGS)
1168 *
1169 * This was a workaround for BugID 5060758, but
1170 * appears to have survived as a fix in make.
1171 */
1172 while (*cp) {
1173 if (*cp != (int) hyphen_char) {
1174 break;
1175 }
1176 cp++;
1177 if (*cp == (int) hyphen_char) {
1178 /* There are two hyphens. Skip one */
1179 cp_orig = cp;
1180 cp++;
1181 }
1182 if (!(*cp)) {
1183 /* There are hyphens only. Skip all */
1184 cp_orig = cp;
1185 break;
1186 }
1187 }
1188 } else {
1189
1190 /* Old MAKEFLAGS format */
1191
1192 add_hyphen = true;
1193 }
1194 }
1195
1196 /* Find the number of arguments in MAKEFLAGS */
1197 while (cp && *cp) {
1198 /* Skip white spaces */
1199 while (cp && *cp && isspace(*cp)) {
1200 cp++;
1201 }
1202 if (cp && *cp) {
1203 /* Increment arg count */
1204 mf_argc++;
1205 /* Go to next white space */
1206 while (cp && *cp && !isspace(*cp)) {
1207 if(*cp == (int) backslash_char) {
|