From b43b1eaf9553ba19e7b997ed6c0b3a7a464ba612 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Fri, 23 Mar 2001 16:54:42 +0000 Subject: [PATCH] * automake.in (IF_PATTERN): Unobfuscate the parens. (ENDIF_PATTERN): Allow a condition to be specified. (&file_contents): Use a @cond_stack. (&transform): At least for an easy transition, also transform %?FOO% and %!FOO%, as suggested by Lars. * scripts.am: First test bed for static if/endif use. --- ChangeLog | 9 ++++++++ automake.in | 53 ++++++++++++++++++++++++++++++++++++++++++----- lib/am/scripts.am | 53 +++++++++++++++++++++++++---------------------- scripts.am | 53 +++++++++++++++++++++++++---------------------- 4 files changed, 113 insertions(+), 55 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3f594dfc..e19200e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2001-03-23 Akim Demaille + + * automake.in (IF_PATTERN): Unobfuscate the parens. + (ENDIF_PATTERN): Allow a condition to be specified. + (&file_contents): Use a @cond_stack. + (&transform): At least for an easy transition, also transform + %?FOO% and %!FOO%, as suggested by Lars. + * scripts.am: First test bed for static if/endif use. + 2001-03-23 Akim Demaille * automake.in (&file_contents): Use rule_define. diff --git a/automake.in b/automake.in index 4980f192..a538b490 100755 --- a/automake.in +++ b/automake.in @@ -59,9 +59,9 @@ my $SUFFIX_RULE_PATTERN = "^\\.([a-zA-Z0-9]+)\\.([a-zA-Z0-9]+)\$"; my $MACRO_PATTERN = "^ *([A-Za-z0-9_\@]+)[ \t]*([:+]?)=[ \t]*(.*)\$"; my $BOGUS_MACRO_PATTERN = "^ *([^ \t]*)[ \t]*([:+]?)=[ \t]*(.*)\$"; my $GNITS_VERSION_PATTERN = "[0-9]+\\.[0-9]+([a-z]|\\.[0-9]+)?"; -my $IF_PATTERN = "^if[ \t]+\([A-Za-z][A-Za-z0-9_]*\)[ \t]*\(#.*\)?\$"; -my $ELSE_PATTERN = "^else[ \t]*\(#.*\)?\$"; -my $ENDIF_PATTERN = "^endif[ \t]*\(#.*\)?\$"; +my $IF_PATTERN = "^if[ \t]+([A-Za-z][A-Za-z0-9_]*)[ \t]*(#.*)?\$"; +my $ELSE_PATTERN = "^else[ \t]*(#.*)?\$"; +my $ENDIF_PATTERN = "^endif(?:[ \t]+([A-Za-z][A-Za-z0-9_]*))?[ \t]*(#.*)?\$"; my $PATH_PATTERN='(\\w|[/.-])+'; # This will pass through anything not of the prescribed form. my $INCLUDE_PATTERN = "^include[ \t]+((\\\$\\\(top_srcdir\\\)/${PATH_PATTERN})|(\\\$\\\(srcdir\\\)/${PATH_PATTERN})|([^/\\\$]${PATH_PATTERN}))[ \t]*(#.*)?\$"; @@ -6739,6 +6739,7 @@ sub file_contents ($%) my $result_rules = ''; my $comment = ''; my $separator = ''; + my @cond_stack = (); foreach (split (/(?