+* document user namespace for macro/target names
+ adopt some conventions and use uniformly
+
* distclean must remove config.status
can't this cause problems for maintainer-clean?
shouldn't maintainer-clean print the message before running
Then have automake know about fnmatch.h.
* Add a conditional for dependency tracking
+ (what to name it is the biggest problem here)
+ (because we want it to flag dist/no-dist -- not just deps)
* Allow per-object cflags:
bin_PROGRAMS = foo
* add $(srcdir)/ before some dependencies?
-* mention PACKAGE/VERSION -vs- autoheader in manual
-
* define LINK if a program is mentioned, even if no C sources appear
* BUILT_SOURCES should not be distributed, even when they appear in
* if $(FOO) is used somewhere, ensure FOO is defined, either by
user or by automake if possible
-* Handle += assignments
-X Handle `include' lines by scanning other files, and adding
- to Makefile.in dependency [ this is done, but needs += to be really
- useful ]
- even better would be allowing targets in different included
+[ include, += support ]
+* even better would be allowing targets in different included
fragments to be merged. e.g., `install-local'.
consider putting all check-* targets onto @check?
certain part of the standards apply. saw idea in message from
Craig Burley. wouldn't it be really cool if compile-mode in Emacs
understood this convention, and you could click on such text to
- go to the appropriate info page?
+ go to the appropriate info page? [ I think you can ]
Jim's idea: should look for @setfilename and warn if filenames too long
* guess split size
$COMMENT_PATTERN = "^#";
$RULE_PATTERN = "^([\$a-zA-Z_.][-.a-zA-Z0-9_(){}/\$]*) *:([^=].*|)\$";
$SUFFIX_RULE_PATTERN = "^\\.([a-zA-Z]+)\\.([a-zA-Z]+)\$";
-$MACRO_PATTERN = "^([A-Za-z][A-Za-z0-9_]*)[ \t]*:?=[ \t]*(.*)\$";
-$BOGUS_MACRO_PATTERN = "^([^ \t]*)[ \t]*:?=[ \t]*(.*)\$";
+$MACRO_PATTERN = "^([A-Za-z][A-Za-z0-9_]*)[ \t]*([:+]?)=[ \t]*(.*)\$";
+$BOGUS_MACRO_PATTERN = "^([^ \t]*)[ \t]*([:+]?)=[ \t]*(.*)\$";
$GNITS_VERSION_PATTERN = "[0-9]+\\.[0-9]+([a-z]|\\.[0-9]+)?";
$IF_PATTERN = "^if[ \t]+\([A-Za-z][A-Za-z0-9_]*\)[ \t]*\(#.*\)?\$";
$ELSE_PATTERN = "^else[ \t]*\(#.*\)?\$";
$output_vars .= $comment . "\n";
$comment = '';
$spacing = "\n";
- local ($am_vars) = '';
+
+ # The keys here are variables we want to dump at the end of this
+ # function. The values are corresponding comments.
+ local (%am_vars) = ();
+ local (@var_list) = ();
+ local (%def_type) = ();
local ($is_ok_macro);
while ($_)
}
else
{
- $am_vars .= join ('', @conditional_stack) . $_;
$saw_bk = /\\$/;
# Chop newline and backslash if this line is
# continued. ensure trailing whitespace exists.
&am_line_error ($1,
"$1 defined both conditionally and unconditionally");
}
- if ($2 ne '' && substr ($2, -1) eq "\\")
+ local ($value);
+ if ($3 ne '' && substr ($3, -1) eq "\\")
{
- $contents{$last_var_name} = substr ($2, 0, length ($2) - 1);
+ $value = substr ($3, 0, length ($3) - 1);
}
else
{
- $contents{$last_var_name} = $2;
+ $value = $3;
+ }
+ local ($type) = $2;
+ if ($type eq '+')
+ {
+ $contents{$last_var_name} .= ' ' . $value;
+ }
+ else
+ {
+ $contents{$last_var_name} = $value;
+ # The first assignment to a macro sets the line
+ # number. Ideally I suppose we would associate line
+ # numbers with random bits of text.
+ $content_lines{$last_var_name} = $.;
}
local ($cond_string) = join ('', @conditional_stack);
if (@conditional_stack)
{
+ local ($found) = 0;
+ local ($val) = $contents{$last_var_name};
+ $val = "e_cond_val ($val);
if ($conditional{$last_var_name})
{
- &check_ambiguous_conditional ($last_var_name,
- $cond_string);
- $conditional{$last_var_name} .= ' ';
+ if ($type eq '+')
+ {
+ # If we're adding to the conditional, and it
+ # exists, then we might want to simply replace
+ # the old value with the new one.
+ local (@new_vals, @cond_vals);
+ @cond_vals = split (' ', $conditional{$last_var_name});
+ while (@cond_vals)
+ {
+ local ($vcond) = shift (@cond_vals);
+ push (@new_vals, $vcond);
+ if (&conditional_stack ($vcond, $cond_string))
+ {
+ $found = 1;
+ shift (@cond_vals);
+ push (@new_vals, $val);
+ }
+ else
+ {
+ push (@new_vals, shift (@cond_vals));
+ }
+ }
+ if ($found)
+ {
+ $conditional{$last_var_name}
+ = join (' ', @new_vals);
+ }
+ }
+
+ if (! $found)
+ {
+ &check_ambiguous_conditional ($last_var_name,
+ $cond_string);
+ $conditional{$last_var_name} .= ' ';
+ }
}
else
{
$conditional{$last_var_name} = '';
}
- local ($val) = $contents{$last_var_name};
- $conditional{$last_var_name} .= ($cond_string
- . ' '
- . "e_cond_val ($val));
+ if (! $found)
+ {
+ $conditional{$last_var_name} .= ($cond_string
+ . ' '
+ . $val);
+ }
}
- $content_lines{$last_var_name} = $.;
- $am_vars .= $comment . $spacing . $cond_string . $_;
+
+ # FIXME: this doesn't always work correctly; it will group
+ # all comments for a given variable, no matter where
+ # defined.
+ $am_vars{$last_var_name} = $comment . $spacing;
+ $def_type{$last_var_name} = ($type eq ':') ? ':' : '';
+ push (@var_list, $last_var_name);
$comment = $spacing = '';
$saw_bk = /\\$/;
&define_configure_variable ($curs);
}
- $output_vars .= $am_vars;
+ # Now dump the variables that were defined. We do it in the same
+ # order in which they were defined (skipping duplicates).
+ local (%done);
+ foreach $curs (@var_list)
+ {
+ next if $done{$curs};
+ $done{$curs} = 1;
+
+ $output_vars .= $am_vars{$curs};
+ if ($conditional{$curs})
+ {
+ local (@cond_vals) = split (' ', $conditional{$curs});
+ while (@cond_vals)
+ {
+ local ($vcond) = shift (@cond_vals);
+ local ($val) = &unquote_cond_val (shift (@cond_vals));
+ $output_vars .= ($vcond . $curs
+ . ' ' . $def_type{$curs} . '= '
+ . $val . "\n");
+ }
+ }
+ else
+ {
+ $output_vars .= ($curs . ' ' . $def_type{$curs} . '= '
+ . $contents{$curs} . "\n");
+ }
+ }
}
################################################################