From: Akim Demaille Date: Mon, 9 Apr 2001 14:47:45 +0000 (+0000) Subject: * automake.in: Use simple quotes to define the _PATTERN variables X-Git-Tag: handle-languages~82 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=614cd8aa397ec680fce8120924996fdd6e794f29;p=automake.git * automake.in: Use simple quotes to define the _PATTERN variables to unobfuscate the regexps. ($AM_CONDITIONAL_PATTERN): Let the user quote the variable. --- diff --git a/ChangeLog b/ChangeLog index d3b16ad5..4c686c2e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2001-04-09 Akim Demaille + + * automake.in: Use simple quotes to define the _PATTERN variables + to unobfuscate the regexps. + ($AM_CONDITIONAL_PATTERN): Let the user quote the variable. + + 2001-04-09 Akim Demaille * automake.in (&rule_define): When you discover a suffix rules, diff --git a/automake.in b/automake.in index 3422b83f..c42103ab 100755 --- a/automake.in +++ b/automake.in @@ -47,37 +47,40 @@ my $prefix = "@prefix@"; my $am_dir = "@datadir@/@PACKAGE@"; # String constants. -my $IGNORE_PATTERN = "^##([^#].*)?\$"; -my $WHITE_PATTERN = "^[ \t]*\$"; -my $COMMENT_PATTERN = "^#"; -my $TARGET_PATTERN="[\$a-zA-Z_.][-.a-zA-Z0-9_(){}/\$]*"; +my $IGNORE_PATTERN = '^##([^#].*)?$'; +my $WHITE_PATTERN = '^[ \t]*$'; +my $COMMENT_PATTERN = '^#'; +my $TARGET_PATTERN='[$a-zA-Z_.][-.a-zA-Z0-9_(){}/$]*'; my $RULE_PATTERN = "^($TARGET_PATTERN) *:([^=].*|)\$"; -my $SUFFIX_RULE_PATTERN = "^\\.([a-zA-Z0-9]+)\\.([a-zA-Z0-9]+)\$"; +my $SUFFIX_RULE_PATTERN = '^\.([a-zA-Z0-9]+)\.([a-zA-Z0-9]+)$'; # Only recognize leading spaces, not leading tabs. If we recognize # leading tabs here then we need to make the reader smarter, because # otherwise it will think rules like `foo=bar; \' are errors. -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]+([A-Za-z][A-Za-z0-9_]*))?[ \t]*(#.*)?\$"; -my $ENDIF_PATTERN = "^endif(?:[ \t]+([A-Za-z][A-Za-z0-9_]*))?[ \t]*(#.*)?\$"; -my $PATH_PATTERN='(\\w|[/.-])+'; +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]+([A-Za-z][A-Za-z0-9_]*))?[ \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]*(#.*)?\$"; +my $INCLUDE_PATTERN = ('^include[ \t]+' + . '((\$\(top_srcdir\)/' . $PATH_PATTERN . ')' + . '|(\$\(srcdir\)/' . $PATH_PATTERN . ')' + . '|([^/\$]' . $PATH_PATTERN. '))[ \t]*(#.*)?$'); # Some regular expressions. One reason to put them here is that it # makes indentation work better in Emacs. -my $AC_CONFIG_AUX_DIR_PATTERN = "AC_CONFIG_AUX_DIR\\(([^)]+)\\)"; -my $AM_INIT_AUTOMAKE_PATTERN = "AM_INIT_AUTOMAKE\\([^,]*,([^,)]+)[,)]"; -my $AM_PACKAGE_VERSION_PATTERN = "^\\s*\\[?([^]\\s]+)\\]?\\s*\$"; +my $AC_CONFIG_AUX_DIR_PATTERN = 'AC_CONFIG_AUX_DIR\(([^)]+)\)'; +my $AM_INIT_AUTOMAKE_PATTERN = 'AM_INIT_AUTOMAKE\([^,]*,([^,)]+)[,)]'; +my $AM_PACKAGE_VERSION_PATTERN = '^\s*\[?([^]\s]+)\]?\s*$'; # Note that there is no AC_PATH_TOOL. But we don't really care. -my $AC_CHECK_PATTERN = "AC_(CHECK|PATH)_(PROG|PROGS|TOOL)\\(\\[?(\\w+)"; -my $AM_MISSING_PATTERN = "AM_MISSING_PROG\\(\\[?(\\w+)"; +my $AC_CHECK_PATTERN = 'AC_(CHECK|PATH)_(PROG|PROGS|TOOL)\(\[?(\w+)'; +my $AM_MISSING_PATTERN = 'AM_MISSING_PROG\(\[?(\w+)'; # Just check for alphanumeric in AC_SUBST. If you do AC_SUBST(5), # then too bad. -my $AC_SUBST_PATTERN = "AC_SUBST\\(\\[?(\\w+)"; -my $AM_CONDITIONAL_PATTERN = "AM_CONDITIONAL\\((\\w+)"; +my $AC_SUBST_PATTERN = 'AC_SUBST\(\[?(\w+)'; +my $AM_CONDITIONAL_PATTERN = 'AM_CONDITIONAL\(\[?(\w+)'; # Constants to define the "strictness" level. my $FOREIGN = 0;