]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
bootstrap: update bootstrap script to latest upstream.
authorGary V. Vaughan <gary@gnu.org>
Sun, 16 Sep 2012 04:47:22 +0000 (11:47 +0700)
committerGary V. Vaughan <gary@gnu.org>
Sun, 16 Sep 2012 10:08:58 +0000 (17:08 +0700)
* bootstrap, build-aux/options-parser: apply upstream fixes and
enhancements.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
bootstrap
build-aux/options-parser

index 7b26d006095d65c95932b4901e8f83997c6af5ef..ec8924d09517c2b9d7b7045ba8935383381ef0d9 100755 (executable)
--- a/bootstrap
+++ b/bootstrap
@@ -134,7 +134,6 @@ gnulib_modules=
 gnulib_non_module_files="
         build-aux/compile
         build-aux/install-sh
-        build-aux/missing
         build-aux/mdate-sh
         build-aux/texinfo.tex
         build-aux/depcomp
@@ -428,10 +427,10 @@ func_gnulib_tool ()
       gnulib_cmd=`echo $gnulib_tool $gnulib_tool_options`
 
       func_show_eval "$gnulib_cmd" 'exit $?'
-    }
 
-    # Use `gnulib-tool --copy-file' to install non-module files.
-    func_install_gnulib_non_module_files
+      # Use `gnulib-tool --copy-file' to install non-module files.
+      func_install_gnulib_non_module_files
+    }
 
     func_run_hooks func_gnulib_tool
 }
@@ -601,12 +600,18 @@ func_install_gnulib_non_module_files ()
         case $file in
           */COPYING*) dest=COPYING;;
           */INSTALL) dest=INSTALL;;
+         build-aux/missing) dest=
+            func_warning settings "\
+Please remove build-aux/missing from gnulib_module_files in
+\`bootstrap.conf', as it may clash with Automake's version."
+            ;;
           build-aux/*) dest=$build_aux/`expr "$file" : 'build-aux/\(.*\)'`;;
           *) dest=$file;;
         esac
 
         # Be sure to show all copying errors before bailing out
-       func_gnulib_tool_copy_file "$file" "$dest" \
+       test -z "$dest" \
+           || func_gnulib_tool_copy_file "$file" "$dest" \
            || maybe_exit_cmd="exit $EXIT_FAILURE"
       done
 
@@ -1257,7 +1262,7 @@ func_require_gnulib_merge_changelog ()
     test -f ChangeLog && {
       $require_git
 
-      test true = "$GIT" || {
+      func_grep_q '^\(/\|\)ChangeLog$' .gitignore || test true = "$GIT" || {
         if $GIT config merge.merge-changelog.driver >/dev/null ; then
           :
         elif (git-merge-changelog --version) >/dev/null 2>&1 ; then
@@ -2380,7 +2385,7 @@ bootstrap_options_prep ()
 {
     $debug_cmd
 
-    warning_func=func_error
+    warning_func=func_warn
 
     # Option defaults:
     opt_copy=${copy-'false'}
@@ -2495,6 +2500,7 @@ bootstrap_validate_options ()
     func_quote_for_eval ${1+"$@"}
     bootstrap_validate_options_result=$func_quote_for_eval_result
 }
+func_add_hook func_validate_options bootstrap_validate_options
 
 
 ## -------------------------------------------------- ##
index 9d42418dabea4a71568b04220d36059e0be8f0c8..f7f27a250b08722c003df4ecf47906207353e054 100644 (file)
@@ -462,6 +462,9 @@ func_parse_options ()
       # Adjust func_parse_options positional parameters to match
       eval set dummy $func_run_hooks_result; shift
 
+      # Break out of the loop if we already parsed every option.
+      test $# -gt 0 || break
+
       _G_opt=$1
       shift
       case $_G_opt in
@@ -476,7 +479,7 @@ func_parse_options ()
         --help)       func_help ;;
 
        # Separate optargs to long options (plugins may need this):
-       --*=*)        func_split_equals "$opt"
+       --*=*)        func_split_equals "$_G_opt"
                      set dummy "$func_split_equals_lhs" \
                           "$func_split_equals_rhs" ${1+"$@"}
                       shift
@@ -587,27 +590,47 @@ func_echo ()
 }
 
 
-# func_error ARG...
-# -----------------
-# Echo program name prefixed message to standard error.
-func_error ()
+# func_echo_infix_1 INFIX ARG...
+# ------------------------------
+# Echo program name, followed by INFIX on the first line, with any
+# additional lines not showing INFIX.
+func_echo_infix_1 ()
 {
     $require_term_colors
 
+    _G_infix=$1; shift
+    _G_prefix="$progname: $tc_standout$tc_red$_G_infix$tc_reset: "
     _G_message=$*
-    _G_prefix="$progname: $tc_standout${tc_red}error$tc_reset: "
 
     save_IFS=$IFS
     IFS=$nl
     for _G_line in $_G_message; do
       IFS=$save_IFS
       $bs_echo "$_G_prefix$tc_bold$_G_line$tc_reset" 1>&2
-      _G_prefix="$progname:        "
+      _G_prefix="$progname: `echo $_G_infix | sed 's|.| |g'`  "
     done
     IFS=$save_IFS
 }
 
 
+# func_warn ARG...
+# ----------------
+# Echo program name (and 'warning') prefixed message to standard error.
+func_warn ()
+{
+    func_echo_infix_1 warning "$*"
+}
+
+
+# func_error ARG...
+# -----------------
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+    func_echo_infix_1 error "$*"
+}
+
+
 # func_fatal_error ARG...
 # -----------------------
 # Echo program name prefixed message to standard error, and exit.
@@ -626,8 +649,8 @@ func_fatal_help ()
 {
     $debug_cmd
 
-    eval $bs_echo \""Usage: $usage"\"
-    eval $bs_echo \""$fatal_help"\"
+    eval \$bs_echo \""Usage: $usage"\"
+    eval \$bs_echo \""$fatal_help"\"
     func_error ${1+"$@"}
     exit $EXIT_FAILURE
 }
@@ -777,11 +800,11 @@ func_usage_message ()
 {
     $debug_cmd
 
-    eval $bs_echo \""$usage"\"
+    eval \$bs_echo \""$usage"\"
     echo
     $SED -n 's|^# ||;/^Written by/{x;p;x;};h' < "$progpath"
     echo
-    eval $bs_echo \""$usage_message"\"
+    eval \$bs_echo \""$usage_message"\"
 }