From: Stefano Lattarini Date: Thu, 24 May 2012 14:42:32 +0000 (+0200) Subject: fixup: interaction between verbatim lines and line continuation X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b9a51979d8e24ae32f8c114d8d9a90c646cd89a;p=thirdparty%2Fautomake.git fixup: interaction between verbatim lines and line continuation When line continuations were involved, our hack to pass lines verbatim to the output Makefile didn't work as expected; for example, the input !$(call foo,=, \ ! long continued line still in the call) produced in the generated Makefile an output like $(call foo,=, \ ! long continued line still in the call) rather than as the expected $(call foo,=, \ long continued line still in the call) That bug severely limited the usefulness of our hack. Luckily, it's pretty easy to fix. * automake.in (file_contents_internal): Handling of !-escaped lines moved ... (make_paragraphs): ... here, and adjusted to cope with line continuations. * lib/am/parallel-tests.am: Break overly long !-escaped lines, now that we can. Signed-off-by: Stefano Lattarini --- diff --git a/automake.in b/automake.in index d2d155190..6d5b220c7 100644 --- a/automake.in +++ b/automake.in @@ -6571,9 +6571,27 @@ sub make_paragraphs ($%) $transform{FIRST} = !$transformed_files{$file}; $transformed_files{$file} = 1; - my @lines = split /(?set ($file); - # A line starting with '!' must be passed verbatim to the output - # Makefile, placed after the variables' definitions and before the - # Makefile targets. - if (s/^!//) - { - $output_verbatim .= "$_\n"; - } - # Sanity checks. - elsif (/\\$/) + if (/\\$/) { error $where, "blank line following trailing backslash:\n$_" } diff --git a/lib/am/parallel-tests.am b/lib/am/parallel-tests.am index 4f2e003a4..0c3e9ff52 100644 --- a/lib/am/parallel-tests.am +++ b/lib/am/parallel-tests.am @@ -91,10 +91,10 @@ am__tpfx = \ ## FIXME: this will pick up the default from the environment; are we sure ## FIXME: we want that? !TEST_EXTENSIONS ?= .test -!$(call am__maybe_invalid_test_extensions,$(filter-out .%,$(TEST_EXTENSIONS))) -## FIXME: it would be nice to break these on multiple lines. Unfortunately, -## FIXME: our '!' is not yet smart enough to handle that :-( -!$(foreach am__e,$(TEST_EXTENSIONS), $(eval $(call am__handle_per_suffix_test,$(am__e)))) +!$(call am__maybe_invalid_test_extensions,\ +! $(filter-out .%,$(TEST_EXTENSIONS))) +!$(foreach am__e,$(TEST_EXTENSIONS), \ +! $(eval $(call am__handle_per_suffix_test,$(am__e)))) ## It is *imperative* that the "empty" suffix goes last. Otherwise, a ## declaration like "TESTS = all.test" would cause GNU make to mistakenly ## try to build the 'all.log' and 'all.trs' files from a non-existent