Passing --no-warnings to libtool would not suppress warning messages.
* build-aux/ltmain.in: Add 'opt_warning' check before printing out
warning messages.
* tests/libtool.at: Add simple test for '--no-warnings'.
* NEWS: Update.
- Fix '-Fe' usage with linking in MSVC.
+ - Fix '--no-warnings' flag.
+
** Changes in supported systems or compilers:
- Support additional flang-based compilers, 'f18' and 'f95'.
}
-# func_warning ARG...
-# -------------------
-# Libtool warnings are not categorized, so override funclib.sh
-# func_warning with this simpler definition.
-func_warning ()
-{
- $debug_cmd
-
- $warning_func ${1+"$@"}
-}
-
-
## ---------------- ##
## Options parsing. ##
## ---------------- ##
opt_preserve_dup_deps=false
opt_quiet=false
opt_finishing=true
+ opt_warning=
nonopt=
preserve_args=
func_add_hook func_parse_options libtool_parse_options
+# func_warning ARG...
+# -------------------
+# Libtool warnings are not categorized, so override funclib.sh
+# func_warning with this simpler definition.
+func_warning ()
+{
+ if $opt_warning; then
+ $debug_cmd
+ $warning_func ${1+"$@"}
+ fi
+}
+
# libtool_validate_options [ARG]...
# ---------------------------------
AT_CHECK([$GREP 'ignoring unknown tag' stderr], [0], [ignore])
AT_CLEANUP
+
+## -------------------- ##
+## Silence LT warnings. ##
+## -------------------- ##
+
+AT_SETUP([test silencing warnings])
+
+AT_DATA([x.cpp],
+[[
+void f(int *p) { *p = 21; }
+]])
+
+AT_CHECK([$LIBTOOL --mode=compile --tag=CXX g++ -c x.cpp], [0], [stdout], [stderr])
+
+AT_CHECK([$LIBTOOL --no-warnings --mode=link --tag=CXX g++ -o libx.la -no-canonical-prefixes -R /usr/lib64/ -version-info x.lo], [0], [stdout], [stderr])
+
+AT_CHECK([$GREP -- 'warning' stderr], [1], [ignore])
+
+AT_CLEANUP