diff options
author | Bruno Haible <bruno@clisp.org> | 2022-01-05 18:21:55 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2022-01-05 18:21:55 +0100 |
commit | 0c8a563f65d44752b33aec42cceec25bd485f2d5 (patch) | |
tree | 877836cb122dddee5be66059e3d12ff442045bd0 /gnulib-tool | |
parent | 87e6634b28df65084321fed22f60d114a0931d21 (diff) | |
download | gnulib-0c8a563f65d44752b33aec42cceec25bd485f2d5.tar.gz |
gnulib-tool: Avoid known warnings that reflect Gnulib's coding style.
* m4/gnulib-common.m4 (gl_CC_GNULIB_WARNINGS): New macro.
* gnulib-tool (func_emit_lib_Makefile_am): Add the
GL_CFLAG_GNULIB_WARNINGS to the CFLAGS of all the compilation units of
the library.
(func_emit_tests_Makefile_am): Add the GL_CFLAG_GNULIB_WARNINGS to the
CFLAGS.
(func_import): Emit an invocation of gl_CC_GNULIB_WARNINGS.
Diffstat (limited to 'gnulib-tool')
-rwxr-xr-x | gnulib-tool | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gnulib-tool b/gnulib-tool index 02d4f8661d..a91847f55a 100755 --- a/gnulib-tool +++ b/gnulib-tool @@ -3974,6 +3974,9 @@ func_emit_lib_Makefile_am () fi echo echo "${libname}_${libext}_SOURCES =" + if ! $for_test; then + echo "${libname}_${libext}_CFLAGS = \$(AM_CFLAGS) \$(GL_CFLAG_GNULIB_WARNINGS)" + fi # Here we use $(LIBOBJS), not @LIBOBJS@. The value is the same. However, # automake during its analysis looks for $(LIBOBJS), not for @LIBOBJS@. echo "${libname}_${libext}_LIBADD = \$(${macro_prefix}_${perhapsLT}LIBOBJS)" @@ -4343,7 +4346,12 @@ func_emit_tests_Makefile_am () # CFLAGS, they have asked for errors, they will get errors. But they have # no right to complain about these errors, because Gnulib does not support # '-Werror'. - echo "CFLAGS = @GL_CFLAG_ALLOW_WARNINGS@ @CFLAGS@" + cflags_for_gnulib_code= + if ! $for_test; then + # Enable or disable warnings as suitable for the Gnulib coding style. + cflags_for_gnulib_code=" \$(GL_CFLAG_GNULIB_WARNINGS)" + fi + echo "CFLAGS = @GL_CFLAG_ALLOW_WARNINGS@${cflags_for_gnulib_code} @CFLAGS@" echo "CXXFLAGS = @GL_CXXFLAG_ALLOW_WARNINGS@ @CXXFLAGS@" echo echo "AM_CPPFLAGS = \\" @@ -6056,6 +6064,7 @@ s,//*$,/,' func_emit_autoconf_snippets "$testsrelated_modules" "$main_modules $testsrelated_modules" func_verify_module true true true echo " m4_popdef([gl_MODULE_INDICATOR_CONDITION])" func_emit_initmacro_end ${macro_prefix}tests $gentests + echo " AC_REQUIRE([gl_CC_GNULIB_WARNINGS])" # _LIBDEPS and _LTLIBDEPS variables are not needed if this library is # created using libtool, because libtool already handles the dependencies. if test "$libtool" != true; then |