* libltdl/config/general.m4sh (opt_warning): New option.
(func_warning): Only display a warning message if $opt_warning
is true.
* libtoolize.m4sh: Accept options in LIBTOOLIZE_OPTIONS
environment variable.
(--no-warn): Parse new option.
(func_serial_update_check, func_keyword_update): Use func_warning.
(func_check_macros): Bail out before style issues nags when
$opt_warning is false.
* doc/libtool.texi (Invoking Libtoolize): Document it.
* tests/libtoolize.at: Test it.
* NEWS: Updated.
2008-04-29 Gary V. Vaughan <gary@gnu.org>
+ New libtoolize --no-warn option and LIBTOOLIZE_OPTIONS parsing.
+ * libltdl/config/general.m4sh (opt_warning): New option.
+ (func_warning): Only display a warning message if $opt_warning
+ is true.
+ * libtoolize.m4sh: Accept options in LIBTOOLIZE_OPTIONS
+ environment variable.
+ (--no-warn): Parse new option.
+ (func_serial_update_check, func_keyword_update): Use func_warning.
+ (func_check_macros): Bail out before style issues nags when
+ $opt_warning is false.
+ * doc/libtool.texi (Invoking Libtoolize): Document it.
+ * tests/libtoolize.at: Test it.
+ * NEWS: Updated.
+
Fix libtoolize test failure with aclocal-1.10.1.
* tests/libtoolize.at
(verbatim aclocal.m4 w/o AC_CONFIG_MACRO_DIR): Force aclocal to
New in 2.2.4: 2008-??-??: CVS version 2.2.3a, Libtool team:
+* New features:
+
+ - New libtoolize option --no-warn, for users that want to continue to
+ use old libtool style without being nagged.
+ - Options --debug, --no-warn, --quiet and --verbose can be passed to
+ libtoolize through the environment variable LIBTOOLIZE_OPTIONS, for
+ cleaner interaction between the user and libtoolize when called by
+ autoreconf.
+
* Bug fixes:
- The documentation for lt_dlopenadvise showed the wrong type for
for example. If @command{libtoolize} can't determine the target
directory, @samp{libltdl} is used as the default.
+@item --no-warn
+Normally, Libtoolize tries to diagnose use of deprecated libtool macros
+and other stylistic issues. If you are deliberately using outdated
+calling conventions, this option prevents Libtoolize from explaining
+how to update your project's Libtool conventions.
+
@item --nonrecursive
If passed in conjunction with @option{--ltdl}, this option will cause
the @command{libltdl} installed by @samp{libtoolize} to be set up for
Print @command{libtoolize} version information and exit.
@end table
+@cindex LIBTOOLIZE_OPTIONS
+Sometimes it can be useful to pass options to @command{libtoolize} even
+though it is called by another program, such as @command{autoreconf}. A
+limited number of options are parsed from the environment variable
+@code{LIBTOOLIZE_OPTIONS}: currently @option{--debug}, @option{--no-warn},
+@option{--quiet} and @option{--verbose}. Multiple options passed in
+@code{LIBTOOLIZE_OPTIONS} must be separated with a space, comma or a
+colon.
+
+By default, a warning is issued for unknown options found in
+@code{LIBTOOLIZE_OPTIONS} unless the first such option is
+@option{--no-warn}. Where @command{libtoolize} has always quit
+on receipt of an unknown option at the command line, this and all
+previous releases of @command{libtoolize} will continue unabated whatever
+the content of @code{LIBTOOLIZE_OPTIONS} (modulo some possible warning
+messages).
+
+@example
+trick$ @kbd{LIBTOOLIZE_OPTIONS=--no-warn,--quiet autoreconf --install}
+@end example
+
@findex AC_CONFIG_MACRO_DIR
If @command{libtoolize} detects an explicit call to
@code{AC_CONFIG_MACRO_DIR} (@pxref{Input, , The Autoconf Manual,
will put the other support files in the specified directory.
Otherwise they too end up in the project root directory.
-@command{libtoolize} displays hints for adding libtool support to your
-package, as well.
+Unless @option{--no-warn} is passed, @command{libtoolize} displays
+hints for adding libtool support to your package, as well.
@node Autoconf and LTLIBOBJS
@subsection Autoconf and @code{LTLIBOBJS}
opt_help=false
opt_quiet=false
opt_verbose=false
+opt_warning=:
# func_echo arg...
# Echo program name prefixed message, along with the current mode
# Echo program name prefixed warning message to standard error.
func_warning ()
{
- $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
+ $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
+
+ # bash bug again:
+ :
}
# func_fatal_error arg...
# -f, --force replace existing files
# -i, --install copy missing auxiliary files
# --ltdl[=DIR] install libltdl sources [default: libltdl]
+# --no-warn don't display warning messages
# --nonrecursive prepare ltdl for non-recursive make
# -q, --quiet work silently
# --recursive prepare ltdl for recursive make
# --version print version information and exit
# -h, --help print short or long help message
#
+# The following space or comma delimited options can be passed to $progname
+# via the environment variable LIBTOOLIZE_OPTIONS, unknown environment
+# options are ignored:
+#
+# --debug enable verbose shell tracing
+# --no-warn don't display warning messages
+# --quiet work silently
+# --verbose verbosely report processing
+#
# You must `cd' to the top directory of your package before you run
# `$progname'.
#
configure_ac=configure.in
+# Parse environment options
+{
+ my_sed_env_opt='1s/^\([^,:; ]*\).*$/\1/;q'
+ my_sed_env_rest='1s/^[^,:; ]*[,:; ]*\(.*\)$/\1/;q'
+
+ while test -n "$LIBTOOLIZE_OPTIONS"; do
+ opt=`echo "$LIBTOOLIZE_OPTIONS" | sed "$my_sed_env_opt"`
+ LIBTOOLIZE_OPTIONS=`echo "$LIBTOOLIZE_OPTIONS" | sed "$my_sed_env_rest"`
+
+ case $opt in
+ --debug) opt_debug=: ;;
+ --no-warn) opt_warning=false ;;
+ --quiet) opt_quiet=: ;;
+ --verbose) opt_verbose=: ;;
+
+ --*) func_warning "unrecognized environment option \`$opt'" ;;
+ *) func_fatal_help "garbled LIBTOOLIZE_OPTIONS near \`$opt'" ;;
+ esac
+ done
+}
+
+
# Parse options once, thoroughly. This comes as soon as possible in
# the script to make things like `libtoolize --version' happen quickly.
{
fi
;;
+ --no-warn) opt_warning=false ;;
+
--nonrecursive|--non-recursive)
ltdl_mode=nonrecursive
;;
if test -f "$my_destfile"; then
test "X$my_src_serial" = "X0" && {
- func_error "warning: no serial number on \`$my_srcfile', not copying."
+ func_warning "no serial number on \`$my_srcfile', not copying."
return
}
if test -f "$my_destfile"; then
my_src_serial=`$SED -e "$my_sed_script" "$my_srcfile"`
test -z "$my_src_serial" && {
- func_error "warning: no serial number in \`$my_srcfile', not copying."
+ func_warning "no serial number in \`$my_srcfile', not copying."
return
}
fi
fi
+ ## ---------------------------------------------------------- ##
+ ## Since we return early here when --no-warn was given: ##
+ ## DO NOT PUT ANYTHING BUT UPGRADE ADVICE MESSAGES BELOW HERE ##
+ ## ---------------------------------------------------------- ##
+
+ $opt_warning || return
+
$seen_libtool ||
func_echo "Remember to add \`LT_INIT' to $configure_ac."
AT_CLEANUP
+
+## --------------------------- ##
+## Garbled LIBTOOLIZE_OPTIONS. ##
+## --------------------------- ##
+
+AT_SETUP([LIBTOOLIZE_OPTIONS])
+
+_LT_CONFIGURE_AC
+
+LIBTOOLIZE_OPTIONS="narf"
+export LIBTOOLIZE_OPTIONS
+
+AT_DATA(experr,
+[[libtoolize: garbled LIBTOOLIZE_OPTIONS near `narf'
+libtoolize: Try `libtoolize --help' for more information.
+]])
+
+LT_AT_CHECK_LIBTOOLIZE([--copy], 1, [ignore], experr)
+
+
+## --------------------------- ##
+## Unknown LIBTOOLIZE_OPTIONS. ##
+## --------------------------- ##
+
+LIBTOOLIZE_OPTIONS=--no-such-option
+export LIBTOOLIZE_OPTIONS
+
+AT_DATA(experr,
+[[libtoolize: warning: unrecognized environment option `--no-such-option'
+]])
+
+LT_AT_CHECK_LIBTOOLIZE([--copy], 0, [ignore], experr)
+
+
+## ----------------------------- ##
+## --no-warn environment option. ##
+## ----------------------------- ##
+
+LIBTOOLIZE_OPTIONS=--no-warn,--no-such-option
+export LIBTOOLIZE_OPTIONS
+
+AT_DATA(experr, [[]])
+
+LT_AT_CHECK_LIBTOOLIZE([--copy], 0, [ignore], experr)
+
+AT_CLEANUP