2 # Copyright (C) 2022-2024 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <https://www.gnu.org/licenses/>.
17 # Make sure Automake preserves escaped comments in the output.
21 cat >> configure.ac
<<'END'
25 cat > Makefile.am
<< 'END'
26 # This value should be preserved.
27 var
= -DVAL='"\#xxx\#"' # this should be stripped
28 var
+= -DX=1 # this should be kept
33 # This should fail due to -Werror, as in:
34 # automake-1.16: warnings are treated as errors
35 # Makefile.am:2: warning: escaping \# comment markers is not portable
37 grep 'escaping.*comment markers.*portable' stderr
39 # This should pass though.
40 $AUTOMAKE -Wno-portability
45 # The full flag should be retained.
46 grep '^var.*\\#xxx\\#.*DX=1' Makefile.
in
48 # Only the 2nd comment should be retained.
49 grep '^var.*stripped' Makefile.
in && exit 1 ||
:
50 grep '^var.*should be kept' Makefile.
in