libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 368] New libtoolize --no-warn option.


From: Gary V. Vaughan
Subject: [PATCH 368] New libtoolize --no-warn option.
Date: Tue, 29 Apr 2008 15:19:24 -0400 (EDT)
User-agent: mailnotify/0.9

* libltdl/config/general.m4sh (opt_warning): New option.
(func_warning): Only display a warning message if $opt_warning
is true.
* libtoolize.m4sh (--no-warn): Accept 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.
* NEWS: Updated.
---

I hope this will allay Ralf's concerns for users who want to stick
with deprecated macro interfaces, and don't want libtoolize to nag
them to upgrade.

Okay to commit?

 ChangeLog                   |   11 +++++++++++
 NEWS                        |    2 ++
 doc/libtool.texi            |    6 ++++++
 libltdl/config/general.m4sh |    6 +++++-
 libtoolize.m4sh             |   14 ++++++++++++--
 5 files changed, 36 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5685bda..81a2929 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2008-04-29  Gary V. Vaughan  <address@hidden>
 
+       New libtoolize --no-warn option.
+       * libltdl/config/general.m4sh (opt_warning): New option.
+       (func_warning): Only display a warning message if $opt_warning
+       is true.
+       * libtoolize.m4sh (--no-warn): Accept 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.
+       * 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
diff --git a/NEWS b/NEWS
index d7579e9..494b863 100644
--- a/NEWS
+++ b/NEWS
@@ -23,6 +23,8 @@ New in 2.2.4: 2008-??-??: CVS version 2.2.3a, Libtool team:
   - libtoolize now advises use of `ACLOCAL_AMFLAGS = -I m4' (or
     equivalent) where appropriate, and errors out when ACLOCAL_AMFLAGS
     names a different directory to AC_CONFIG_MACRO_DIR.
+  - New libtoolize option --no-warn, for users that want to continue to
+    use old libtool style without being nagged.
 
 New in 2.2.2: 2008-04-01: CVS version 2.2.1a, Libtool team:
 
diff --git a/doc/libtool.texi b/doc/libtool.texi
index 5a2bd55..bb1643f 100644
--- a/doc/libtool.texi
+++ b/doc/libtool.texi
@@ -2329,6 +2329,12 @@ also specify a subdirectory name here if you are not 
using Autoconf
 for example.  If @command{libtoolize} can't determine the target
 directory, @samp{libltdl} is used as the default.
 
address@hidden --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
diff --git a/libltdl/config/general.m4sh b/libltdl/config/general.m4sh
index 29b3d91..53ff5ea 100644
--- a/libltdl/config/general.m4sh
+++ b/libltdl/config/general.m4sh
@@ -153,6 +153,7 @@ opt_dry_run=false
 opt_help=false
 opt_quiet=false
 opt_verbose=false
+opt_warning=:
 
 # func_echo arg...
 # Echo program name prefixed message, along with the current mode
@@ -185,7 +186,10 @@ func_error ()
 # 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...
diff --git a/libtoolize.m4sh b/libtoolize.m4sh
index ad024ed..340f46d 100644
--- a/libtoolize.m4sh
+++ b/libtoolize.m4sh
@@ -35,6 +35,7 @@ m4_divert_push([SCRIPT])#! /bin/sh
 # -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
@@ -153,6 +154,8 @@ configure_ac=configure.in
                        fi
                        ;;
 
+      --no-warn)       opt_warning=false ;;
+
       --nonrecursive|--non-recursive)
                        ltdl_mode=nonrecursive
                        ;;
@@ -743,7 +746,7 @@ func_serial_update_check ()
 
     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
       }
 
@@ -904,7 +907,7 @@ func_keyword_update ()
     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
       }
 
@@ -1361,6 +1364,13 @@ func_check_macros ()
       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."
 
-- 
1.5.4.3

Attachment: pgpPENQMkuxbW.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]