summaryrefslogtreecommitdiff
path: root/commands.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2009-09-24 02:41:44 +0000
committerPaul Smith <psmith@gnu.org>2009-09-24 02:41:44 +0000
commit0afbbf8595b6035a5a930399d20320d2e2852d72 (patch)
tree6c74d485e4d57b2bf41bb5d6afaac1b4569dd554 /commands.c
parent3cc351decdd7d53fea0c730fd919163f20706762 (diff)
downloadgunmake-0afbbf8595b6035a5a930399d20320d2e2852d72.tar.gz
- Rework secondary expansion so we only defer it if there's a possibility
it might be needed: for most situations we parse prereqs immediately as we used to. Reduces memory usage. - Fixes Savannah bug #18622.
Diffstat (limited to 'commands.c')
-rw-r--r--commands.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/commands.c b/commands.c
index 94c4867..d9d7f53 100644
--- a/commands.c
+++ b/commands.c
@@ -116,7 +116,8 @@ set_file_variables (struct file *file)
for (d = file->deps; d != 0; d = d->next)
if (!d->ignore_mtime)
{
- less = dep_name (d);
+ if (!d->need_2nd_expansion)
+ less = dep_name (d);
break;
}
@@ -153,7 +154,7 @@ set_file_variables (struct file *file)
plus_len = 0;
for (d = file->deps; d != 0; d = d->next)
- if (! d->ignore_mtime)
+ if (! d->ignore_mtime && ! d->need_2nd_expansion)
plus_len += strlen (dep_name (d)) + 1;
if (plus_len == 0)
plus_len++;
@@ -164,7 +165,7 @@ set_file_variables (struct file *file)
qmark_len = plus_len + 1; /* Will be this or less. */
for (d = file->deps; d != 0; d = d->next)
- if (! d->ignore_mtime)
+ if (! d->ignore_mtime && ! d->need_2nd_expansion)
{
const char *c = dep_name (d);
@@ -198,7 +199,7 @@ set_file_variables (struct file *file)
bar_len = 0;
for (d = file->deps; d != 0; d = d->next)
- if (d->ignore_mtime)
+ if (d->ignore_mtime && ! d->need_2nd_expansion)
bar_len += strlen (dep_name (d)) + 1;
if (bar_len == 0)
bar_len++;
@@ -217,8 +218,12 @@ set_file_variables (struct file *file)
for (d = file->deps; d != 0; d = d->next)
{
- const char *c = dep_name (d);
+ const char *c;
+ if (d->need_2nd_expansion)
+ continue;
+
+ c = dep_name (d);
#ifndef NO_ARCHIVES
if (ar_name (c))
{