ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/hopm/trunk/ltmain.sh
(Generate patch)

Comparing hopm/trunk/ltmain.sh (file contents):
Revision 9484 by michael, Mon Apr 27 21:48:51 2015 UTC vs.
Revision 9485 by michael, Sat Jul 4 19:27:09 2020 UTC

# Line 31 | Line 31
31  
32   PROGRAM=libtool
33   PACKAGE=libtool
34 < VERSION=2.4.6
34 > VERSION="2.4.6 Debian-2.4.6-10"
35   package_revision=2.4.6
36  
37  
# Line 1370 | Line 1370 | func_lt_ver ()
1370   #! /bin/sh
1371  
1372   # Set a version string for this script.
1373 < scriptversion=2014-01-07.03; # UTC
1373 > scriptversion=2015-10-07.11; # UTC
1374  
1375   # A portable, pluggable option parser for Bourne shell.
1376   # Written by Gary V. Vaughan, 2010
# Line 1530 | Line 1530 | func_run_hooks ()
1530   {
1531      $debug_cmd
1532  
1533 +    _G_rc_run_hooks=false
1534 +
1535      case " $hookable_fns " in
1536        *" $1 "*) ;;
1537        *) func_fatal_error "'$1' does not support hook funcions.n" ;;
# Line 1538 | Line 1540 | func_run_hooks ()
1540      eval _G_hook_fns=\$$1_hooks; shift
1541  
1542      for _G_hook in $_G_hook_fns; do
1543 <      eval $_G_hook '"$@"'
1544 <
1545 <      # store returned options list back into positional
1546 <      # parameters for next 'cmd' execution.
1547 <      eval _G_hook_result=\$${_G_hook}_result
1548 <      eval set dummy "$_G_hook_result"; shift
1543 >      if eval $_G_hook '"$@"'; then
1544 >        # store returned options list back into positional
1545 >        # parameters for next 'cmd' execution.
1546 >        eval _G_hook_result=\$${_G_hook}_result
1547 >        eval set dummy "$_G_hook_result"; shift
1548 >        _G_rc_run_hooks=:
1549 >      fi
1550      done
1551  
1552 <    func_quote_for_eval ${1+"$@"}
1550 <    func_run_hooks_result=$func_quote_for_eval_result
1552 >    $_G_rc_run_hooks && func_run_hooks_result=$_G_hook_result
1553   }
1554  
1555  
# Line 1557 | Line 1559 | func_run_hooks ()
1559   ## --------------- ##
1560  
1561   # In order to add your own option parsing hooks, you must accept the
1562 < # full positional parameter list in your hook function, remove any
1563 < # options that you action, and then pass back the remaining unprocessed
1562 > # full positional parameter list in your hook function, you may remove/edit
1563 > # any options that you action, and then pass back the remaining unprocessed
1564   # options in '<hooked_function_name>_result', escaped suitably for
1565 < # 'eval'.  Like this:
1565 > # 'eval'.  In this case you also must return $EXIT_SUCCESS to let the
1566 > # hook's caller know that it should pay attention to
1567 > # '<hooked_function_name>_result'.  Returning $EXIT_FAILURE signalizes that
1568 > # arguments are left untouched by the hook and therefore caller will ignore the
1569 > # result variable.
1570 > #
1571 > # Like this:
1572   #
1573   #    my_options_prep ()
1574   #    {
# Line 1570 | Line 1578 | func_run_hooks ()
1578   #        usage_message=$usage_message'
1579   #      -s, --silent       don'\''t print informational messages
1580   #    '
1581 < #
1582 < #        func_quote_for_eval ${1+"$@"}
1583 < #        my_options_prep_result=$func_quote_for_eval_result
1581 > #        # No change in '$@' (ignored completely by this hook).  There is
1582 > #        # no need to do the equivalent (but slower) action:
1583 > #        # func_quote_for_eval ${1+"$@"}
1584 > #        # my_options_prep_result=$func_quote_for_eval_result
1585 > #        false
1586   #    }
1587   #    func_add_hook func_options_prep my_options_prep
1588   #
# Line 1581 | Line 1591 | func_run_hooks ()
1591   #    {
1592   #        $debug_cmd
1593   #
1594 + #        args_changed=false
1595 + #
1596   #        # Note that for efficiency, we parse as many options as we can
1597   #        # recognise in a loop before passing the remainder back to the
1598   #        # caller on the first unrecognised argument we encounter.
1599   #        while test $# -gt 0; do
1600   #          opt=$1; shift
1601   #          case $opt in
1602 < #            --silent|-s) opt_silent=: ;;
1602 > #            --silent|-s) opt_silent=:
1603 > #                         args_changed=:
1604 > #                         ;;
1605   #            # Separate non-argument short options:
1606   #            -s*)         func_split_short_opt "$_G_opt"
1607   #                         set dummy "$func_split_short_opt_name" \
1608   #                             "-$func_split_short_opt_arg" ${1+"$@"}
1609   #                         shift
1610 + #                         args_changed=:
1611   #                         ;;
1612 < #            *)            set dummy "$_G_opt" "$*"; shift; break ;;
1612 > #            *)           # Make sure the first unrecognised option "$_G_opt"
1613 > #                         # is added back to "$@", we could need that later
1614 > #                         # if $args_changed is true.
1615 > #                         set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
1616   #          esac
1617   #        done
1618   #
1619 < #        func_quote_for_eval ${1+"$@"}
1620 < #        my_silent_option_result=$func_quote_for_eval_result
1619 > #        if $args_changed; then
1620 > #          func_quote_for_eval ${1+"$@"}
1621 > #          my_silent_option_result=$func_quote_for_eval_result
1622 > #        fi
1623 > #
1624 > #        $args_changed
1625   #    }
1626   #    func_add_hook func_parse_options my_silent_option
1627   #
# Line 1611 | Line 1633 | func_run_hooks ()
1633   #        $opt_silent && $opt_verbose && func_fatal_help "\
1634   #    '--silent' and '--verbose' options are mutually exclusive."
1635   #
1636 < #        func_quote_for_eval ${1+"$@"}
1615 < #        my_option_validation_result=$func_quote_for_eval_result
1636 > #        false
1637   #    }
1638   #    func_add_hook func_validate_options my_option_validation
1639   #
1640 < # You'll alse need to manually amend $usage_message to reflect the extra
1640 > # You'll also need to manually amend $usage_message to reflect the extra
1641   # options you parse.  It's preferable to append if you can, so that
1642   # multiple option parsing hooks can be added safely.
1643  
1644  
1645 + # func_options_finish [ARG]...
1646 + # ----------------------------
1647 + # Finishing the option parse loop (call 'func_options' hooks ATM).
1648 + func_options_finish ()
1649 + {
1650 +    $debug_cmd
1651 +
1652 +    _G_func_options_finish_exit=false
1653 +    if func_run_hooks func_options ${1+"$@"}; then
1654 +      func_options_finish_result=$func_run_hooks_result
1655 +      _G_func_options_finish_exit=:
1656 +    fi
1657 +
1658 +    $_G_func_options_finish_exit
1659 + }
1660 +
1661 +
1662   # func_options [ARG]...
1663   # ---------------------
1664   # All the functions called inside func_options are hookable. See the
# Line 1630 | Line 1668 | func_options ()
1668   {
1669      $debug_cmd
1670  
1671 <    func_options_prep ${1+"$@"}
1672 <    eval func_parse_options \
1673 <        ${func_options_prep_result+"$func_options_prep_result"}
1674 <    eval func_validate_options \
1675 <        ${func_parse_options_result+"$func_parse_options_result"}
1671 >    _G_rc_options=false
1672 >
1673 >    for my_func in options_prep parse_options validate_options options_finish
1674 >    do
1675 >      if eval func_$my_func '${1+"$@"}'; then
1676 >        eval _G_res_var='$'"func_${my_func}_result"
1677 >        eval set dummy "$_G_res_var" ; shift
1678 >        _G_rc_options=:
1679 >      fi
1680 >    done
1681  
1682 <    eval func_run_hooks func_options \
1683 <        ${func_validate_options_result+"$func_validate_options_result"}
1682 >    # Save modified positional parameters for caller.  As a top-level
1683 >    # options-parser function we always need to set the 'func_options_result'
1684 >    # variable (regardless the $_G_rc_options value).
1685 >    if $_G_rc_options; then
1686 >      func_options_result=$_G_res_var
1687 >    else
1688 >      func_quote_for_eval ${1+"$@"}
1689 >      func_options_result=$func_quote_for_eval_result
1690 >    fi
1691  
1692 <    # save modified positional parameters for caller
1643 <    func_options_result=$func_run_hooks_result
1692 >    $_G_rc_options
1693   }
1694  
1695  
# Line 1649 | Line 1698 | func_options ()
1698   # All initialisations required before starting the option parse loop.
1699   # Note that when calling hook functions, we pass through the list of
1700   # positional parameters.  If a hook function modifies that list, and
1701 < # needs to propogate that back to rest of this script, then the complete
1701 > # needs to propagate that back to rest of this script, then the complete
1702   # modified list must be put in 'func_run_hooks_result' before
1703 < # returning.
1703 > # returning $EXIT_SUCCESS (otherwise $EXIT_FAILURE is returned).
1704   func_hookable func_options_prep
1705   func_options_prep ()
1706   {
# Line 1661 | Line 1710 | func_options_prep ()
1710      opt_verbose=false
1711      opt_warning_types=
1712  
1713 <    func_run_hooks func_options_prep ${1+"$@"}
1713 >    _G_rc_options_prep=false
1714 >    if func_run_hooks func_options_prep ${1+"$@"}; then
1715 >      _G_rc_options_prep=:
1716 >      # save modified positional parameters for caller
1717 >      func_options_prep_result=$func_run_hooks_result
1718 >    fi
1719  
1720 <    # save modified positional parameters for caller
1667 <    func_options_prep_result=$func_run_hooks_result
1720 >    $_G_rc_options_prep
1721   }
1722  
1723  
# Line 1678 | Line 1731 | func_parse_options ()
1731  
1732      func_parse_options_result=
1733  
1734 +    _G_rc_parse_options=false
1735      # this just eases exit handling
1736      while test $# -gt 0; do
1737        # Defer to hook functions for initial option parsing, so they
1738        # get priority in the event of reusing an option name.
1739 <      func_run_hooks func_parse_options ${1+"$@"}
1740 <
1741 <      # Adjust func_parse_options positional parameters to match
1742 <      eval set dummy "$func_run_hooks_result"; shift
1739 >      if func_run_hooks func_parse_options ${1+"$@"}; then
1740 >        eval set dummy "$func_run_hooks_result"; shift
1741 >        _G_rc_parse_options=:
1742 >      fi
1743  
1744        # Break out of the loop if we already parsed every option.
1745        test $# -gt 0 || break
1746  
1747 +      _G_match_parse_options=:
1748        _G_opt=$1
1749        shift
1750        case $_G_opt in
# Line 1704 | Line 1759 | func_parse_options ()
1759                        ;;
1760  
1761          --warnings|--warning|-W)
1762 <                      test $# = 0 && func_missing_arg $_G_opt && break
1762 >                      if test $# = 0 && func_missing_arg $_G_opt; then
1763 >                        _G_rc_parse_options=:
1764 >                        break
1765 >                      fi
1766                        case " $warning_categories $1" in
1767                          *" $1 "*)
1768                            # trailing space prevents matching last $1 above
# Line 1757 | Line 1815 | func_parse_options ()
1815                        shift
1816                        ;;
1817  
1818 <        --)           break ;;
1818 >        --)           _G_rc_parse_options=: ; break ;;
1819          -*)           func_fatal_help "unrecognised option: '$_G_opt'" ;;
1820 <        *)            set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
1820 >        *)            set dummy "$_G_opt" ${1+"$@"}; shift
1821 >                      _G_match_parse_options=false
1822 >                      break
1823 >                      ;;
1824        esac
1825 +
1826 +      $_G_match_parse_options && _G_rc_parse_options=:
1827      done
1828  
1829 <    # save modified positional parameters for caller
1830 <    func_quote_for_eval ${1+"$@"}
1831 <    func_parse_options_result=$func_quote_for_eval_result
1829 >
1830 >    if $_G_rc_parse_options; then
1831 >      # save modified positional parameters for caller
1832 >      func_quote_for_eval ${1+"$@"}
1833 >      func_parse_options_result=$func_quote_for_eval_result
1834 >    fi
1835 >
1836 >    $_G_rc_parse_options
1837   }
1838  
1839  
# Line 1778 | Line 1846 | func_validate_options ()
1846   {
1847      $debug_cmd
1848  
1849 +    _G_rc_validate_options=false
1850 +
1851      # Display all warnings if -W was not given.
1852      test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
1853  
1854 <    func_run_hooks func_validate_options ${1+"$@"}
1854 >    if func_run_hooks func_validate_options ${1+"$@"}; then
1855 >      # save modified positional parameters for caller
1856 >      func_validate_options_result=$func_run_hooks_result
1857 >      _G_rc_validate_options=:
1858 >    fi
1859  
1860      # Bail if the options were screwed!
1861      $exit_cmd $EXIT_FAILURE
1862  
1863 <    # save modified positional parameters for caller
1790 <    func_validate_options_result=$func_run_hooks_result
1863 >    $_G_rc_validate_options
1864   }
1865  
1866  
# Line 2068 | Line 2141 | include the following information:
2141         compiler:       $LTCC
2142         compiler flags: $LTCFLAGS
2143         linker:         $LD (gnu? $with_gnu_ld)
2144 <       version:        $progname (GNU libtool) 2.4.6
2144 >       version:        $progname $scriptversion Debian-2.4.6-10
2145         automake:       `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
2146         autoconf:       `($AUTOCONF --version) 2>/dev/null |$SED 1q`
2147  
2148   Report bugs to <bug-libtool@gnu.org>.
2149 < GNU libtool home page: <http://www.gnu.org/software/libtool/>.
2149 > GNU libtool home page: <http://www.gnu.org/s/libtool/>.
2150   General help using GNU software: <http://www.gnu.org/gethelp/>."
2151      exit 0
2152   }
# Line 2270 | Line 2343 | libtool_options_prep ()
2343      nonopt=
2344      preserve_args=
2345  
2346 +    _G_rc_lt_options_prep=:
2347 +
2348      # Shorthand for --mode=foo, only valid as the first argument
2349      case $1 in
2350      clean|clea|cle|cl)
# Line 2293 | Line 2368 | libtool_options_prep ()
2368      uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
2369        shift; set dummy --mode uninstall ${1+"$@"}; shift
2370        ;;
2371 +    *)
2372 +      _G_rc_lt_options_prep=false
2373 +      ;;
2374      esac
2375  
2376 <    # Pass back the list of options.
2377 <    func_quote_for_eval ${1+"$@"}
2378 <    libtool_options_prep_result=$func_quote_for_eval_result
2376 >    if $_G_rc_lt_options_prep; then
2377 >      # Pass back the list of options.
2378 >      func_quote_for_eval ${1+"$@"}
2379 >      libtool_options_prep_result=$func_quote_for_eval_result
2380 >    fi
2381 >
2382 >    $_G_rc_lt_options_prep
2383   }
2384   func_add_hook func_options_prep libtool_options_prep
2385  
# Line 2309 | Line 2391 | libtool_parse_options ()
2391   {
2392      $debug_cmd
2393  
2394 +    _G_rc_lt_parse_options=false
2395 +
2396      # Perform our own loop to consume as many options as possible in
2397      # each iteration.
2398      while test $# -gt 0; do
2399 +      _G_match_lt_parse_options=:
2400        _G_opt=$1
2401        shift
2402        case $_G_opt in
# Line 2386 | Line 2471 | libtool_parse_options ()
2471                          func_append preserve_args " $_G_opt"
2472                          ;;
2473  
2474 <        # An option not handled by this hook function:
2475 <        *)              set dummy "$_G_opt" ${1+"$@"};  shift; break  ;;
2474 >        # An option not handled by this hook function:
2475 >        *)              set dummy "$_G_opt" ${1+"$@"} ; shift
2476 >                        _G_match_lt_parse_options=false
2477 >                        break
2478 >                        ;;
2479        esac
2480 +      $_G_match_lt_parse_options && _G_rc_lt_parse_options=:
2481      done
2482  
2483 +    if $_G_rc_lt_parse_options; then
2484 +      # save modified positional parameters for caller
2485 +      func_quote_for_eval ${1+"$@"}
2486 +      libtool_parse_options_result=$func_quote_for_eval_result
2487 +    fi
2488  
2489 <    # save modified positional parameters for caller
2396 <    func_quote_for_eval ${1+"$@"}
2397 <    libtool_parse_options_result=$func_quote_for_eval_result
2489 >    $_G_rc_lt_parse_options
2490   }
2491   func_add_hook func_parse_options libtool_parse_options
2492  
# Line 7272 | Line 7364 | func_mode_link ()
7364        # -tp=*                Portland pgcc target processor selection
7365        # --sysroot=*          for sysroot support
7366        # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
7367 +      # -specs=*             GCC specs files
7368        # -stdlib=*            select c++ std lib with clang
7369 +      # -fsanitize=*         Clang/GCC memory and address sanitizer
7370 +      # -fuse-ld=*           Linker select flags for GCC
7371        -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
7372        -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
7373 <      -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*)
7373 >      -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
7374 >      -specs=*|-fsanitize=*|-fuse-ld=*)
7375          func_quote_for_eval "$arg"
7376          arg=$func_quote_for_eval_result
7377          func_append compile_command " $arg"
# Line 7568 | Line 7664 | func_mode_link ()
7664          case $pass in
7665          dlopen) libs=$dlfiles ;;
7666          dlpreopen) libs=$dlprefiles ;;
7667 <        link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
7667 >        link)
7668 >          libs="$deplibs %DEPLIBS%"
7669 >          test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
7670 >          ;;
7671          esac
7672        fi
7673        if test lib,dlpreopen = "$linkmode,$pass"; then
# Line 7887 | Line 7986 | func_mode_link ()
7986              # It is a libtool convenience library, so add in its objects.
7987              func_append convenience " $ladir/$objdir/$old_library"
7988              func_append old_convenience " $ladir/$objdir/$old_library"
7989 +            tmp_libs=
7990 +            for deplib in $dependency_libs; do
7991 +              deplibs="$deplib $deplibs"
7992 +              if $opt_preserve_dup_deps; then
7993 +                case "$tmp_libs " in
7994 +                *" $deplib "*) func_append specialdeplibs " $deplib" ;;
7995 +                esac
7996 +              fi
7997 +              func_append tmp_libs " $deplib"
7998 +            done
7999            elif test prog != "$linkmode" && test lib != "$linkmode"; then
8000              func_fatal_error "'$lib' is not a convenience library"
8001            fi
7893          tmp_libs=
7894          for deplib in $dependency_libs; do
7895            deplibs="$deplib $deplibs"
7896            if $opt_preserve_dup_deps; then
7897              case "$tmp_libs " in
7898              *" $deplib "*) func_append specialdeplibs " $deplib" ;;
7899              esac
7900            fi
7901            func_append tmp_libs " $deplib"
7902          done
8002            continue
8003          fi # $pass = conv
8004  
# Line 8823 | Line 8922 | func_mode_link ()
8922              revision=$number_minor
8923              lt_irix_increment=no
8924              ;;
8925 +          *)
8926 +            func_fatal_configuration "$modename: unknown library version type '$version_type'"
8927 +            ;;
8928            esac
8929            ;;
8930          no)

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)