diff options
author | Bruno Haible <bruno@clisp.org> | 2020-12-29 02:48:31 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2020-12-29 02:56:21 +0100 |
commit | 0be855ee827bf7e9043eeb626c4fd847704be2e6 (patch) | |
tree | d4758d32f732fe65a509c4177d551ec9d1922f8c /gnulib-tool | |
parent | d82dfeb8a7c9b276c8c7db94d077eb7a43a6760c (diff) | |
download | gnulib-0be855ee827bf7e9043eeb626c4fd847704be2e6.tar.gz |
gnulib-tool: Fix logic whether to add a dummy.c.
* gnulib-tool (func_remove_if_blocks): New function.
(func_modules_add_dummy): Use it to eliminate all conditional statements
from the automake snippet.
Diffstat (limited to 'gnulib-tool')
-rwxr-xr-x | gnulib-tool | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/gnulib-tool b/gnulib-tool index faed693ff2..9044d6d2d5 100755 --- a/gnulib-tool +++ b/gnulib-tool @@ -3280,6 +3280,21 @@ func_determine_use_libtests () done } +# func_remove_if_blocks +# removes if...endif blocks from an automake snippet. +func_remove_if_blocks () +{ + sed -n -e '/^if / { + :a + n + s/^endif// + tb + ba + :b + } + p' +} + # func_modules_add_dummy # Input: # - local_gnulib_path from --local-dir @@ -3299,8 +3314,9 @@ func_modules_add_dummy () # contribute to lib_SOURCES. : else - # Extract the value of "lib_SOURCES += ...". + # Extract the value of unconditional "lib_SOURCES += ..." augmentations. for file in `func_get_automake_snippet "$module" | combine_lines | + func_remove_if_blocks | sed -n -e 's,^lib_SOURCES[ ]*+=\([^#]*\).*$,\1,p'`; do # Ignore .h files since they are not compiled. case "$file" in |