Link Here
|
|
|
1 |
diff -u orig/configure.in configure.in |
2 |
--- orig/configure.in 2010-07-28 07:39:50.000000000 +0200 |
3 |
+++ configure.in 2012-03-21 12:34:20.000000000 +0100 |
4 |
@@ -64,7 +64,8 @@ |
5 |
AC_HEADER_STAT |
6 |
AC_HEADER_TIME |
7 |
AC_CHECK_HEADERS(stdlib.h locale.h unistd.h limits.h fcntl.h string.h \ |
8 |
- memory.h sys/param.h sys/resource.h sys/time.h sys/timeb.h) |
9 |
+ memory.h sys/param.h sys/resource.h sys/time.h sys/timeb.h \ |
10 |
+ sys/user.h linux/binfmts.h) |
11 |
|
12 |
# Set a flag if we have an ANSI C compiler |
13 |
if test "$ac_cv_prog_cc_stdc" != no; then |
14 |
Subdirectorios comunes: orig/doc y doc |
15 |
Subdirectorios comunes: orig/glob y glob |
16 |
diff -u orig/job.c job.c |
17 |
--- orig/job.c 2010-07-24 10:27:50.000000000 +0200 |
18 |
+++ job.c 2012-03-21 12:34:20.000000000 +0100 |
19 |
@@ -29,6 +29,11 @@ |
20 |
|
21 |
#include <string.h> |
22 |
|
23 |
+#if defined (HAVE_LINUX_BINFMTS_H) && defined (HAVE_SYS_USER_H) |
24 |
+#include <sys/user.h> |
25 |
+#include <linux/binfmts.h> |
26 |
+#endif |
27 |
+ |
28 |
/* Default shell to use. */ |
29 |
#ifdef WINDOWS32 |
30 |
#include <windows.h> |
31 |
@@ -2795,6 +2800,7 @@ |
32 |
unsigned int sflags_len = strlen (shellflags); |
33 |
char *command_ptr = NULL; /* used for batch_mode_shell mode */ |
34 |
char *new_line; |
35 |
+ char *args_ptr; |
36 |
|
37 |
# ifdef __EMX__ /* is this necessary? */ |
38 |
if (!unixy_shell) |
39 |
@@ -2865,8 +2871,17 @@ |
40 |
return new_argv; |
41 |
} |
42 |
|
43 |
+#ifdef MAX_ARG_STRLEN |
44 |
+ static char eval_line[] = "eval\\ \\\"set\\ x\\;\\ shift\\;\\ "; |
45 |
+#define ARG_NUMBER_DIGITS 5 |
46 |
+#define EVAL_LEN (sizeof(eval_line)-1 + shell_len + 4 \ |
47 |
+ + (7 + ARG_NUMBER_DIGITS) * 2 * line_len / (MAX_ARG_STRLEN - 2)) |
48 |
+#else |
49 |
+#define EVAL_LEN 0 |
50 |
+#endif |
51 |
+ |
52 |
new_line = alloca (shell_len + 1 + sflags_len + 1 |
53 |
- + (line_len*2) + 1); |
54 |
+ + (line_len*2) + 1 + EVAL_LEN); |
55 |
ap = new_line; |
56 |
memcpy (ap, shell, shell_len); |
57 |
ap += shell_len; |
58 |
@@ -2875,6 +2890,30 @@ |
59 |
ap += sflags_len; |
60 |
*(ap++) = ' '; |
61 |
command_ptr = ap; |
62 |
+ |
63 |
+#if !defined (WINDOWS32) && defined (MAX_ARG_STRLEN) |
64 |
+ if (unixy_shell && line_len > MAX_ARG_STRLEN) |
65 |
+ { |
66 |
+ unsigned j; |
67 |
+ memcpy (ap, eval_line, sizeof (eval_line) - 1); |
68 |
+ ap += sizeof (eval_line) - 1; |
69 |
+ for (j = 1; j <= 2 * line_len / (MAX_ARG_STRLEN - 2); j++) |
70 |
+ ap += sprintf (ap, "\\$\\{%u\\}", j); |
71 |
+ *ap++ = '\\'; |
72 |
+ *ap++ = '"'; |
73 |
+ *ap++ = ' '; |
74 |
+ /* Copy only the first word of SHELL to $0. */ |
75 |
+ for (p = shell; *p != '\0'; ++p) |
76 |
+ { |
77 |
+ if (isspace ((unsigned char)*p)) |
78 |
+ break; |
79 |
+ *ap++ = *p; |
80 |
+ } |
81 |
+ *ap++ = ' '; |
82 |
+ } |
83 |
+#endif |
84 |
+ args_ptr = ap; |
85 |
+ |
86 |
for (p = line; *p != '\0'; ++p) |
87 |
{ |
88 |
if (restp != NULL && *p == '\n') |
89 |
@@ -2922,6 +2961,14 @@ |
90 |
} |
91 |
#endif |
92 |
*ap++ = *p; |
93 |
+ |
94 |
+#if !defined (WINDOWS32) && defined (MAX_ARG_STRLEN) |
95 |
+ if (unixy_shell && line_len > MAX_ARG_STRLEN && (ap - args_ptr > MAX_ARG_STRLEN - 2)) |
96 |
+ { |
97 |
+ *ap++ = ' '; |
98 |
+ args_ptr = ap; |
99 |
+ } |
100 |
+#endif |
101 |
} |
102 |
if (ap == new_line + shell_len + sflags_len + 2) |
103 |
/* Line was empty. */ |
104 |
diff -u make-3.82-orig/remake.c make-3.82/remake.c |
105 |
--- orig/remake.c 2010-07-13 03:20:42.000000000 +0200 |
106 |
+++ remake.c 2012-03-21 12:47:52.000000000 +0100 |
107 |
@@ -301,7 +301,7 @@ |
108 |
/* Check for the case where a target has been tried and failed but |
109 |
the diagnostics hasn't been issued. If we need the diagnostics |
110 |
then we will have to continue. */ |
111 |
- if (!(f->updated && f->update_status > 0 && !f->dontcare && f->no_diag)) |
112 |
+ if (!(f->updated && f->update_status > 0 && !f->dontcare && f->no_diag) && f->command_state!=cs_not_started ) |
113 |
{ |
114 |
DBF (DB_VERBOSE, _("Pruning file `%s'.\n")); |
115 |
return f->command_state == cs_finished ? f->update_status : 0; |