Ignore:
Timestamp:
Jul 13, 2017, 9:01:05 AM (21 months ago)
Author:
Juanma
Message:

Initial release

File:
1 edited

Legend:

Unmodified
Added
Removed
  • squid-ssl/trunk/fuentes/cfgaux/ltmain.sh

    r5495 r5496  
    1 #! /bin/sh
    2 ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
    3 ##               by inline-source v2014-01-03.01
    4 
    5 # libtool (GNU libtool) 2.4.6
    6 # Provide generalized library-building support services.
     1
     2# libtool (GNU libtool) 2.4.2
    73# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
    84
    9 # Copyright (C) 1996-2015 Free Software Foundation, Inc.
     5# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
     6# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
    107# This is free software; see the source for copying conditions.  There is NO
    118# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     
    2724#
    2825# You should have received a copy of the GNU General Public License
    29 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
    30 
     26# along with GNU Libtool; see the file COPYING.  If not, a copy
     27# can be downloaded from http://www.gnu.org/licenses/gpl.html,
     28# or obtained by writing to the Free Software Foundation, Inc.,
     29# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
     30
     31# Usage: $progname [OPTION]... [MODE-ARG]...
     32#
     33# Provide generalized library-building support services.
     34#
     35#       --config             show all configuration variables
     36#       --debug              enable verbose shell tracing
     37#   -n, --dry-run            display commands without modifying any files
     38#       --features           display basic configuration information and exit
     39#       --mode=MODE          use operation mode MODE
     40#       --preserve-dup-deps  don't remove duplicate dependency libraries
     41#       --quiet, --silent    don't print informational messages
     42#       --no-quiet, --no-silent
     43#                            print informational messages (default)
     44#       --no-warn            don't display warning messages
     45#       --tag=TAG            use configuration variables from tag TAG
     46#   -v, --verbose            print more informational messages than default
     47#       --no-verbose         don't print the extra informational messages
     48#       --version            print version information
     49#   -h, --help, --help-all   print short, long, or detailed help message
     50#
     51# MODE must be one of the following:
     52#
     53#         clean              remove files from the build directory
     54#         compile            compile a source file into a libtool object
     55#         execute            automatically set library path, then run a program
     56#         finish             complete the installation of libtool libraries
     57#         install            install libraries or executables
     58#         link               create a library or an executable
     59#         uninstall          remove libraries from an installed directory
     60#
     61# MODE-ARGS vary depending on the MODE.  When passed as first option,
     62# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
     63# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
     64#
     65# When reporting a bug, please describe a test case to reproduce it and
     66# include the following information:
     67#
     68#         host-triplet: $host
     69#         shell:                $SHELL
     70#         compiler:             $LTCC
     71#         compiler flags:               $LTCFLAGS
     72#         linker:               $LD (gnu? $with_gnu_ld)
     73#         $progname:    (GNU libtool) 2.4.2 Debian-2.4.2-1.11
     74#         automake:     $automake_version
     75#         autoconf:     $autoconf_version
     76#
     77# Report bugs to <bug-libtool@gnu.org>.
     78# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
     79# General help using GNU software: <http://www.gnu.org/gethelp/>.
    3180
    3281PROGRAM=libtool
    3382PACKAGE=libtool
    34 VERSION="2.4.6 Debian-2.4.6-0.1"
    35 package_revision=2.4.6
    36 
    37 
    38 ## ------ ##
    39 ## Usage. ##
    40 ## ------ ##
    41 
    42 # Run './libtool --help' for help with using this script from the
    43 # command line.
    44 
    45 
    46 ## ------------------------------- ##
    47 ## User overridable command paths. ##
    48 ## ------------------------------- ##
    49 
    50 # After configure completes, it has a better idea of some of the
    51 # shell tools we need than the defaults used by the functions shared
    52 # with bootstrap, so set those here where they can still be over-
    53 # ridden by the user, but otherwise take precedence.
    54 
    55 : ${AUTOCONF="autoconf"}
    56 : ${AUTOMAKE="automake"}
    57 
    58 
    59 ## -------------------------- ##
    60 ## Source external libraries. ##
    61 ## -------------------------- ##
    62 
    63 # Much of our low-level functionality needs to be sourced from external
    64 # libraries, which are installed to $pkgauxdir.
    65 
    66 # Set a version string for this script.
    67 scriptversion=2015-01-20.17; # UTC
    68 
    69 # General shell script boiler plate, and helper functions.
    70 # Written by Gary V. Vaughan, 2004
    71 
    72 # Copyright (C) 2004-2015 Free Software Foundation, Inc.
    73 # This is free software; see the source for copying conditions.  There is NO
    74 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    75 
    76 # This program is free software; you can redistribute it and/or modify
    77 # it under the terms of the GNU General Public License as published by
    78 # the Free Software Foundation; either version 3 of the License, or
    79 # (at your option) any later version.
    80 
    81 # As a special exception to the GNU General Public License, if you distribute
    82 # this file as part of a program or library that is built using GNU Libtool,
    83 # you may include this file under the same distribution terms that you use
    84 # for the rest of that program.
    85 
    86 # This program is distributed in the hope that it will be useful,
    87 # but WITHOUT ANY WARRANTY; without even the implied warranty of
    88 # MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
    89 # General Public License for more details.
    90 
    91 # You should have received a copy of the GNU General Public License
    92 # along with this program. If not, see <http://www.gnu.org/licenses/>.
    93 
    94 # Please report bugs or propose patches to gary@gnu.org.
    95 
    96 
    97 ## ------ ##
    98 ## Usage. ##
    99 ## ------ ##
    100 
    101 # Evaluate this file near the top of your script to gain access to
    102 # the functions and variables defined here:
    103 #
    104 #   . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
    105 #
    106 # If you need to override any of the default environment variable
    107 # settings, do that before evaluating this file.
    108 
    109 
    110 ## -------------------- ##
    111 ## Shell normalisation. ##
    112 ## -------------------- ##
    113 
    114 # Some shells need a little help to be as Bourne compatible as possible.
    115 # Before doing anything else, make sure all that help has been provided!
    116 
    117 DUALCASE=1; export DUALCASE # for MKS sh
    118 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
     83VERSION="2.4.2 Debian-2.4.2-1.11"
     84TIMESTAMP=""
     85package_revision=1.3337
     86
     87# Be Bourne compatible
     88if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
    11989  emulate sh
    12090  NULLCMD=:
    121   # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
     91  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
    12292  # is contrary to our usage.  Disable this feature.
    12393  alias -g '${1+"$@"}'='"$@"'
    12494  setopt NO_GLOB_SUBST
    12595else
    126   case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
     96  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
    12797fi
    128 
    129 # NLS nuisances: We save the old values in case they are required later.
    130 _G_user_locale=
    131 _G_safe_locale=
    132 for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
     98BIN_SH=xpg4; export BIN_SH # for Tru64
     99DUALCASE=1; export DUALCASE # for MKS sh
     100
     101# A function that is used when there is no print builtin or printf.
     102func_fallback_echo ()
     103{
     104  eval 'cat <<_LTECHO_EOF
     105$1
     106_LTECHO_EOF'
     107}
     108
     109# NLS nuisances: We save the old values to restore during execute mode.
     110lt_user_locale=
     111lt_safe_locale=
     112for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
    133113do
    134   eval "if test set = \"\${$_G_var+set}\"; then
    135           save_$_G_var=\$$_G_var
    136           $_G_var=C
    137           export $_G_var
    138           _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
    139           _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
     114  eval "if test \"\${$lt_var+set}\" = set; then
     115          save_$lt_var=\$$lt_var
     116          $lt_var=C
     117          export $lt_var
     118          lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
     119          lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
    140120        fi"
    141121done
    142 
    143 # CDPATH.
    144 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
    145 
    146 # Make sure IFS has a sensible default
    147 sp=' '
    148 nl='
    149 '
    150 IFS="$sp        $nl"
    151 
    152 # There are apparently some retarded systems that use ';' as a PATH separator!
    153 if test "${PATH_SEPARATOR+set}" != set; then
    154   PATH_SEPARATOR=:
    155   (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
    156     (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
    157       PATH_SEPARATOR=';'
    158   }
    159 fi
    160 
    161 
    162 
    163 ## ------------------------- ##
    164 ## Locate command utilities. ##
    165 ## ------------------------- ##
    166 
    167 
    168 # func_executable_p FILE
    169 # ----------------------
    170 # Check that FILE is an executable regular file.
    171 func_executable_p ()
    172 {
    173     test -f "$1" && test -x "$1"
    174 }
    175 
    176 
    177 # func_path_progs PROGS_LIST CHECK_FUNC [PATH]
    178 # --------------------------------------------
    179 # Search for either a program that responds to --version with output
    180 # containing "GNU", or else returned by CHECK_FUNC otherwise, by
    181 # trying all the directories in PATH with each of the elements of
    182 # PROGS_LIST.
    183 #
    184 # CHECK_FUNC should accept the path to a candidate program, and
    185 # set $func_check_prog_result if it truncates its output less than
    186 # $_G_path_prog_max characters.
    187 func_path_progs ()
    188 {
    189     _G_progs_list=$1
    190     _G_check_func=$2
    191     _G_PATH=${3-"$PATH"}
    192 
    193     _G_path_prog_max=0
    194     _G_path_prog_found=false
    195     _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}
    196     for _G_dir in $_G_PATH; do
    197       IFS=$_G_save_IFS
    198       test -z "$_G_dir" && _G_dir=.
    199       for _G_prog_name in $_G_progs_list; do
    200         for _exeext in '' .EXE; do
    201           _G_path_prog=$_G_dir/$_G_prog_name$_exeext
    202           func_executable_p "$_G_path_prog" || continue
    203           case `"$_G_path_prog" --version 2>&1` in
    204             *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;
    205             *)     $_G_check_func $_G_path_prog
    206                    func_path_progs_result=$func_check_prog_result
    207                    ;;
    208           esac
    209           $_G_path_prog_found && break 3
    210         done
    211       done
    212     done
    213     IFS=$_G_save_IFS
    214     test -z "$func_path_progs_result" && {
    215       echo "no acceptable sed could be found in \$PATH" >&2
    216       exit 1
    217     }
    218 }
    219 
    220 
    221 # We want to be able to use the functions in this file before configure
    222 # has figured out where the best binaries are kept, which means we have
    223 # to search for them ourselves - except when the results are already set
    224 # where we skip the searches.
    225 
    226 # Unless the user overrides by setting SED, search the path for either GNU
    227 # sed, or the sed that truncates its output the least.
    228 test -z "$SED" && {
    229   _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
    230   for _G_i in 1 2 3 4 5 6 7; do
    231     _G_sed_script=$_G_sed_script$nl$_G_sed_script
    232   done
    233   echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed
    234   _G_sed_script=
    235 
    236   func_check_prog_sed ()
    237   {
    238     _G_path_prog=$1
    239 
    240     _G_count=0
    241     printf 0123456789 >conftest.in
    242     while :
    243     do
    244       cat conftest.in conftest.in >conftest.tmp
    245       mv conftest.tmp conftest.in
    246       cp conftest.in conftest.nl
    247       echo '' >> conftest.nl
    248       "$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
    249       diff conftest.out conftest.nl >/dev/null 2>&1 || break
    250       _G_count=`expr $_G_count + 1`
    251       if test "$_G_count" -gt "$_G_path_prog_max"; then
    252         # Best one so far, save it but keep looking for a better one
    253         func_check_prog_result=$_G_path_prog
    254         _G_path_prog_max=$_G_count
    255       fi
    256       # 10*(2^10) chars as input seems more than enough
    257       test 10 -lt "$_G_count" && break
    258     done
    259     rm -f conftest.in conftest.tmp conftest.nl conftest.out
    260   }
    261 
    262   func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
    263   rm -f conftest.sed
    264   SED=$func_path_progs_result
    265 }
    266 
    267 
    268 # Unless the user overrides by setting GREP, search the path for either GNU
    269 # grep, or the grep that truncates its output the least.
    270 test -z "$GREP" && {
    271   func_check_prog_grep ()
    272   {
    273     _G_path_prog=$1
    274 
    275     _G_count=0
    276     _G_path_prog_max=0
    277     printf 0123456789 >conftest.in
    278     while :
    279     do
    280       cat conftest.in conftest.in >conftest.tmp
    281       mv conftest.tmp conftest.in
    282       cp conftest.in conftest.nl
    283       echo 'GREP' >> conftest.nl
    284       "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break
    285       diff conftest.out conftest.nl >/dev/null 2>&1 || break
    286       _G_count=`expr $_G_count + 1`
    287       if test "$_G_count" -gt "$_G_path_prog_max"; then
    288         # Best one so far, save it but keep looking for a better one
    289         func_check_prog_result=$_G_path_prog
    290         _G_path_prog_max=$_G_count
    291       fi
    292       # 10*(2^10) chars as input seems more than enough
    293       test 10 -lt "$_G_count" && break
    294     done
    295     rm -f conftest.in conftest.tmp conftest.nl conftest.out
    296   }
    297 
    298   func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
    299   GREP=$func_path_progs_result
    300 }
    301 
    302 
    303 ## ------------------------------- ##
    304 ## User overridable command paths. ##
    305 ## ------------------------------- ##
    306 
    307 # All uppercase variable names are used for environment variables.  These
    308 # variables can be overridden by the user before calling a script that
    309 # uses them if a suitable command of that name is not already available
    310 # in the command search PATH.
     122LC_ALL=C
     123LANGUAGE=C
     124export LANGUAGE LC_ALL
     125
     126$lt_unset CDPATH
     127
     128
     129# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
     130# is ksh but when the shell is invoked as "sh" and the current value of
     131# the _XPG environment variable is not equal to 1 (one), the special
     132# positional parameter $0, within a function call, is the name of the
     133# function.
     134progpath="$0"
     135
     136
    311137
    312138: ${CP="cp -f"}
    313 : ${ECHO="printf %s\n"}
    314 : ${EGREP="$GREP -E"}
    315 : ${FGREP="$GREP -F"}
    316 : ${LN_S="ln -s"}
     139test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
    317140: ${MAKE="make"}
    318141: ${MKDIR="mkdir"}
     
    320143: ${RM="rm -f"}
    321144: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
    322 
    323 
    324 ## -------------------- ##
    325 ## Useful sed snippets. ##
    326 ## -------------------- ##
    327 
    328 sed_dirname='s|/[^/]*$||'
    329 sed_basename='s|^.*/||'
    330 
    331 # Sed substitution that helps us do robust quoting.  It backslashifies
    332 # metacharacters that are still active within double-quoted strings.
    333 sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
    334 
    335 # Same as above, but do not quote variable references.
    336 sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
    337 
    338 # Sed substitution that turns a string into a regex matching for the
    339 # string literally.
    340 sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
    341 
    342 # Sed substitution that converts a w32 file name or path
    343 # that contains forward slashes, into one that contains
    344 # (escaped) backslashes.  A very naive implementation.
    345 sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
    346 
    347 # Re-'\' parameter expansions in output of sed_double_quote_subst that
    348 # were '\'-ed in input to the same.  If an odd number of '\' preceded a
    349 # '$' in input to sed_double_quote_subst, that '$' was protected from
    350 # expansion.  Since each input '\' is now two '\'s, look for any number
    351 # of runs of four '\'s followed by two '\'s and then a '$'.  '\' that '$'.
    352 _G_bs='\\'
    353 _G_bs2='\\\\'
    354 _G_bs4='\\\\\\\\'
    355 _G_dollar='\$'
    356 sed_double_backslash="\
    357   s/$_G_bs4/&\\
    358 /g
    359   s/^$_G_bs2$_G_dollar/$_G_bs&/
    360   s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
    361   s/\n//g"
    362 
    363 
    364 ## ----------------- ##
    365 ## Global variables. ##
    366 ## ----------------- ##
    367 
    368 # Except for the global variables explicitly listed below, the following
    369 # functions in the '^func_' namespace, and the '^require_' namespace
    370 # variables initialised in the 'Resource management' section, sourcing
    371 # this file will not pollute your global namespace with anything
    372 # else. There's no portable way to scope variables in Bourne shell
    373 # though, so actually running these functions will sometimes place
    374 # results into a variable named after the function, and often use
    375 # temporary variables in the '^_G_' namespace. If you are careful to
    376 # avoid using those namespaces casually in your sourcing script, things
    377 # should continue to work as you expect. And, of course, you can freely
    378 # overwrite any of the functions or variables defined here before
    379 # calling anything to customize them.
    380 
     145: ${Xsed="$SED -e 1s/^X//"}
     146
     147# Global variables:
    381148EXIT_SUCCESS=0
    382149EXIT_FAILURE=1
     
    384151EXIT_SKIP=77      # $? = 77 is used to indicate a skipped test to automake.
    385152
    386 # Allow overriding, eg assuming that you follow the convention of
    387 # putting '$debug_cmd' at the start of all your functions, you can get
    388 # bash to show function call trace with:
    389 #
    390 #    debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
    391 debug_cmd=${debug_cmd-":"}
    392 exit_cmd=:
    393 
    394 # By convention, finish your script with:
    395 #
    396 #    exit $exit_status
    397 #
    398 # so that you can set exit_status to non-zero if you want to indicate
    399 # something went wrong during execution without actually bailing out at
    400 # the point of failure.
    401153exit_status=$EXIT_SUCCESS
    402154
    403 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
    404 # is ksh but when the shell is invoked as "sh" and the current value of
    405 # the _XPG environment variable is not equal to 1 (one), the special
    406 # positional parameter $0, within a function call, is the name of the
    407 # function.
    408 progpath=$0
    409 
    410 # The name of this program.
    411 progname=`$ECHO "$progpath" |$SED "$sed_basename"`
    412 
    413 # Make sure we have an absolute progpath for reexecution:
    414 case $progpath in
    415   [\\/]*|[A-Za-z]:\\*) ;;
    416   *[\\/]*)
    417      progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`
    418      progdir=`cd "$progdir" && pwd`
    419      progpath=$progdir/$progname
    420      ;;
    421   *)
    422      _G_IFS=$IFS
    423      IFS=${PATH_SEPARATOR-:}
    424      for progdir in $PATH; do
    425        IFS=$_G_IFS
    426        test -x "$progdir/$progname" && break
    427      done
    428      IFS=$_G_IFS
    429      test -n "$progdir" || progdir=`pwd`
    430      progpath=$progdir/$progname
    431      ;;
    432 esac
    433 
    434 
    435 ## ----------------- ##
    436 ## Standard options. ##
    437 ## ----------------- ##
    438 
    439 # The following options affect the operation of the functions defined
    440 # below, and should be set appropriately depending on run-time para-
    441 # meters passed on the command line.
    442 
    443 opt_dry_run=false
    444 opt_quiet=false
    445 opt_verbose=false
    446 
    447 # Categories 'all' and 'none' are always available.  Append any others
    448 # you will pass as the first argument to func_warning from your own
    449 # code.
    450 warning_categories=
    451 
    452 # By default, display warnings according to 'opt_warning_types'.  Set
    453 # 'warning_func'  to ':' to elide all warnings, or func_fatal_error to
    454 # treat the next displayed warning as a fatal error.
    455 warning_func=func_warn_and_continue
    456 
    457 # Set to 'all' to display all warnings, 'none' to suppress all
    458 # warnings, or a space delimited list of some subset of
    459 # 'warning_categories' to display only the listed warnings.
    460 opt_warning_types=all
    461 
    462 
    463 ## -------------------- ##
    464 ## Resource management. ##
    465 ## -------------------- ##
    466 
    467 # This section contains definitions for functions that each ensure a
    468 # particular resource (a file, or a non-empty configuration variable for
    469 # example) is available, and if appropriate to extract default values
    470 # from pertinent package files. Call them using their associated
    471 # 'require_*' variable to ensure that they are executed, at most, once.
    472 #
    473 # It's entirely deliberate that calling these functions can set
    474 # variables that don't obey the namespace limitations obeyed by the rest
    475 # of this file, in order that that they be as useful as possible to
    476 # callers.
    477 
    478 
    479 # require_term_colors
    480 # -------------------
    481 # Allow display of bold text on terminals that support it.
    482 require_term_colors=func_require_term_colors
    483 func_require_term_colors ()
    484 {
    485     $debug_cmd
    486 
    487     test -t 1 && {
    488       # COLORTERM and USE_ANSI_COLORS environment variables take
    489       # precedence, because most terminfo databases neglect to describe
    490       # whether color sequences are supported.
    491       test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
    492 
    493       if test 1 = "$USE_ANSI_COLORS"; then
    494         # Standard ANSI escape sequences
    495         tc_reset='[0m'
    496         tc_bold='[1m';   tc_standout='[7m'
    497         tc_red='[31m';   tc_green='[32m'
    498         tc_blue='[34m';  tc_cyan='[36m'
    499       else
    500         # Otherwise trust the terminfo database after all.
    501         test -n "`tput sgr0 2>/dev/null`" && {
    502           tc_reset=`tput sgr0`
    503           test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
    504           tc_standout=$tc_bold
    505           test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
    506           test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
    507           test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
    508           test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
    509           test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
    510         }
    511       fi
    512     }
    513 
    514     require_term_colors=:
    515 }
    516 
    517 
    518 ## ----------------- ##
    519 ## Function library. ##
    520 ## ----------------- ##
    521 
    522 # This section contains a variety of useful functions to call in your
    523 # scripts. Take note of the portable wrappers for features provided by
    524 # some modern shells, which will fall back to slower equivalents on
    525 # less featureful shells.
    526 
    527 
    528 # func_append VAR VALUE
    529 # ---------------------
    530 # Append VALUE onto the existing contents of VAR.
    531 
    532   # We should try to minimise forks, especially on Windows where they are
    533   # unreasonably slow, so skip the feature probes when bash or zsh are
    534   # being used:
    535   if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
    536     : ${_G_HAVE_ARITH_OP="yes"}
    537     : ${_G_HAVE_XSI_OPS="yes"}
    538     # The += operator was introduced in bash 3.1
    539     case $BASH_VERSION in
    540       [12].* | 3.0 | 3.0*) ;;
    541       *)
    542         : ${_G_HAVE_PLUSEQ_OP="yes"}
    543         ;;
    544     esac
    545   fi
    546 
    547   # _G_HAVE_PLUSEQ_OP
    548   # Can be empty, in which case the shell is probed, "yes" if += is
    549   # useable or anything else if it does not work.
    550   test -z "$_G_HAVE_PLUSEQ_OP" \
    551     && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
    552     && _G_HAVE_PLUSEQ_OP=yes
    553 
    554 if test yes = "$_G_HAVE_PLUSEQ_OP"
    555 then
    556   # This is an XSI compatible shell, allowing a faster implementation...
    557   eval 'func_append ()
    558   {
    559     $debug_cmd
    560 
    561     eval "$1+=\$2"
    562   }'
    563 else
    564   # ...otherwise fall back to using expr, which is often a shell builtin.
    565   func_append ()
    566   {
    567     $debug_cmd
    568 
    569     eval "$1=\$$1\$2"
    570   }
    571 fi
    572 
    573 
    574 # func_append_quoted VAR VALUE
    575 # ----------------------------
    576 # Quote VALUE and append to the end of shell variable VAR, separated
    577 # by a space.
    578 if test yes = "$_G_HAVE_PLUSEQ_OP"; then
    579   eval 'func_append_quoted ()
    580   {
    581     $debug_cmd
    582 
    583     func_quote_for_eval "$2"
    584     eval "$1+=\\ \$func_quote_for_eval_result"
    585   }'
    586 else
    587   func_append_quoted ()
    588   {
    589     $debug_cmd
    590 
    591     func_quote_for_eval "$2"
    592     eval "$1=\$$1\\ \$func_quote_for_eval_result"
    593   }
    594 fi
    595 
    596 
    597 # func_append_uniq VAR VALUE
    598 # --------------------------
    599 # Append unique VALUE onto the existing contents of VAR, assuming
    600 # entries are delimited by the first character of VALUE.  For example:
    601 #
    602 #   func_append_uniq options " --another-option option-argument"
    603 #
    604 # will only append to $options if " --another-option option-argument "
    605 # is not already present somewhere in $options already (note spaces at
    606 # each end implied by leading space in second argument).
    607 func_append_uniq ()
    608 {
    609     $debug_cmd
    610 
    611     eval _G_current_value='`$ECHO $'$1'`'
    612     _G_delim=`expr "$2" : '\(.\)'`
    613 
    614     case $_G_delim$_G_current_value$_G_delim in
    615       *"$2$_G_delim"*) ;;
    616       *) func_append "$@" ;;
    617     esac
    618 }
    619 
    620 
    621 # func_arith TERM...
    622 # ------------------
    623 # Set func_arith_result to the result of evaluating TERMs.
    624   test -z "$_G_HAVE_ARITH_OP" \
    625     && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
    626     && _G_HAVE_ARITH_OP=yes
    627 
    628 if test yes = "$_G_HAVE_ARITH_OP"; then
    629   eval 'func_arith ()
    630   {
    631     $debug_cmd
    632 
    633     func_arith_result=$(( $* ))
    634   }'
    635 else
    636   func_arith ()
    637   {
    638     $debug_cmd
    639 
    640     func_arith_result=`expr "$@"`
    641   }
    642 fi
    643 
    644 
    645 # func_basename FILE
    646 # ------------------
    647 # Set func_basename_result to FILE with everything up to and including
    648 # the last / stripped.
    649 if test yes = "$_G_HAVE_XSI_OPS"; then
    650   # If this shell supports suffix pattern removal, then use it to avoid
    651   # forking. Hide the definitions single quotes in case the shell chokes
    652   # on unsupported syntax...
    653   _b='func_basename_result=${1##*/}'
    654   _d='case $1 in
    655         */*) func_dirname_result=${1%/*}$2 ;;
    656         *  ) func_dirname_result=$3        ;;
    657       esac'
    658 
    659 else
    660   # ...otherwise fall back to using sed.
    661   _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
    662   _d='func_dirname_result=`$ECHO "$1"  |$SED "$sed_dirname"`
    663       if test "X$func_dirname_result" = "X$1"; then
    664         func_dirname_result=$3
    665       else
    666         func_append func_dirname_result "$2"
    667       fi'
    668 fi
    669 
    670 eval 'func_basename ()
    671 {
    672     $debug_cmd
    673 
    674     '"$_b"'
    675 }'
    676 
    677 
    678 # func_dirname FILE APPEND NONDIR_REPLACEMENT
    679 # -------------------------------------------
     155# Make sure IFS has a sensible default
     156lt_nl='
     157'
     158IFS="   $lt_nl"
     159
     160dirname="s,/[^/]*$,,"
     161basename="s,^.*/,,"
     162
     163# func_dirname file append nondir_replacement
    680164# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
    681165# otherwise set result to NONDIR_REPLACEMENT.
    682 eval 'func_dirname ()
    683 {
    684     $debug_cmd
    685 
    686     '"$_d"'
    687 }'
    688 
    689 
    690 # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT
    691 # --------------------------------------------------------
    692 # Perform func_basename and func_dirname in a single function
     166func_dirname ()
     167{
     168    func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
     169    if test "X$func_dirname_result" = "X${1}"; then
     170      func_dirname_result="${3}"
     171    else
     172      func_dirname_result="$func_dirname_result${2}"
     173    fi
     174} # func_dirname may be replaced by extended shell implementation
     175
     176
     177# func_basename file
     178func_basename ()
     179{
     180    func_basename_result=`$ECHO "${1}" | $SED "$basename"`
     181} # func_basename may be replaced by extended shell implementation
     182
     183
     184# func_dirname_and_basename file append nondir_replacement
     185# perform func_basename and func_dirname in a single function
    693186# call:
    694187#   dirname:  Compute the dirname of FILE.  If nonempty,
     
    698191#   basename: Compute filename of FILE.
    699192#             value retuned in "$func_basename_result"
    700 # For efficiency, we do not delegate to the functions above but instead
    701 # duplicate the functionality here.
    702 eval 'func_dirname_and_basename ()
    703 {
    704     $debug_cmd
    705 
    706     '"$_b"'
    707     '"$_d"'
    708 }'
    709 
    710 
    711 # func_echo ARG...
    712 # ----------------
    713 # Echo program name prefixed message.
    714 func_echo ()
    715 {
    716     $debug_cmd
    717 
    718     _G_message=$*
    719 
    720     func_echo_IFS=$IFS
    721     IFS=$nl
    722     for _G_line in $_G_message; do
    723       IFS=$func_echo_IFS
    724       $ECHO "$progname: $_G_line"
    725     done
    726     IFS=$func_echo_IFS
    727 }
    728 
    729 
    730 # func_echo_all ARG...
    731 # --------------------
    732 # Invoke $ECHO with all args, space-separated.
    733 func_echo_all ()
    734 {
    735     $ECHO "$*"
    736 }
    737 
    738 
    739 # func_echo_infix_1 INFIX ARG...
    740 # ------------------------------
    741 # Echo program name, followed by INFIX on the first line, with any
    742 # additional lines not showing INFIX.
    743 func_echo_infix_1 ()
    744 {
    745     $debug_cmd
    746 
    747     $require_term_colors
    748 
    749     _G_infix=$1; shift
    750     _G_indent=$_G_infix
    751     _G_prefix="$progname: $_G_infix: "
    752     _G_message=$*
    753 
    754     # Strip color escape sequences before counting printable length
    755     for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
    756     do
    757       test -n "$_G_tc" && {
    758         _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`
    759         _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`
    760       }
    761     done
    762     _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`"  " ## exclude from sc_prohibit_nested_quotes
    763 
    764     func_echo_infix_1_IFS=$IFS
    765     IFS=$nl
    766     for _G_line in $_G_message; do
    767       IFS=$func_echo_infix_1_IFS
    768       $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
    769       _G_prefix=$_G_indent
    770     done
    771     IFS=$func_echo_infix_1_IFS
    772 }
    773 
    774 
    775 # func_error ARG...
    776 # -----------------
    777 # Echo program name prefixed message to standard error.
    778 func_error ()
    779 {
    780     $debug_cmd
    781 
    782     $require_term_colors
    783 
    784     func_echo_infix_1 "  $tc_standout${tc_red}error$tc_reset" "$*" >&2
    785 }
    786 
    787 
    788 # func_fatal_error ARG...
    789 # -----------------------
    790 # Echo program name prefixed message to standard error, and exit.
    791 func_fatal_error ()
    792 {
    793     $debug_cmd
    794 
    795     func_error "$*"
    796     exit $EXIT_FAILURE
    797 }
    798 
    799 
    800 # func_grep EXPRESSION FILENAME
    801 # -----------------------------
    802 # Check whether EXPRESSION matches any line of FILENAME, without output.
    803 func_grep ()
    804 {
    805     $debug_cmd
    806 
    807     $GREP "$1" "$2" >/dev/null 2>&1
    808 }
    809 
    810 
    811 # func_len STRING
    812 # ---------------
    813 # Set func_len_result to the length of STRING. STRING may not
    814 # start with a hyphen.
    815   test -z "$_G_HAVE_XSI_OPS" \
    816     && (eval 'x=a/b/c;
    817       test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
    818     && _G_HAVE_XSI_OPS=yes
    819 
    820 if test yes = "$_G_HAVE_XSI_OPS"; then
    821   eval 'func_len ()
    822   {
    823     $debug_cmd
    824 
    825     func_len_result=${#1}
    826   }'
    827 else
    828   func_len ()
    829   {
    830     $debug_cmd
    831 
    832     func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
    833   }
    834 fi
    835 
    836 
    837 # func_mkdir_p DIRECTORY-PATH
    838 # ---------------------------
    839 # Make sure the entire path to DIRECTORY-PATH is available.
    840 func_mkdir_p ()
    841 {
    842     $debug_cmd
    843 
    844     _G_directory_path=$1
    845     _G_dir_list=
    846 
    847     if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
    848 
    849       # Protect directory names starting with '-'
    850       case $_G_directory_path in
    851         -*) _G_directory_path=./$_G_directory_path ;;
    852       esac
    853 
    854       # While some portion of DIR does not yet exist...
    855       while test ! -d "$_G_directory_path"; do
    856         # ...make a list in topmost first order.  Use a colon delimited
    857         # list incase some portion of path contains whitespace.
    858         _G_dir_list=$_G_directory_path:$_G_dir_list
    859 
    860         # If the last portion added has no slash in it, the list is done
    861         case $_G_directory_path in */*) ;; *) break ;; esac
    862 
    863         # ...otherwise throw away the child directory and loop
    864         _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
    865       done
    866       _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
    867 
    868       func_mkdir_p_IFS=$IFS; IFS=:
    869       for _G_dir in $_G_dir_list; do
    870         IFS=$func_mkdir_p_IFS
    871         # mkdir can fail with a 'File exist' error if two processes
    872         # try to create one of the directories concurrently.  Don't
    873         # stop in that case!
    874         $MKDIR "$_G_dir" 2>/dev/null || :
    875       done
    876       IFS=$func_mkdir_p_IFS
    877 
    878       # Bail out if we (or some other process) failed to create a directory.
    879       test -d "$_G_directory_path" || \
    880         func_fatal_error "Failed to create '$1'"
     193# Implementation must be kept synchronized with func_dirname
     194# and func_basename. For efficiency, we do not delegate to
     195# those functions but instead duplicate the functionality here.
     196func_dirname_and_basename ()
     197{
     198    # Extract subdirectory from the argument.
     199    func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
     200    if test "X$func_dirname_result" = "X${1}"; then
     201      func_dirname_result="${3}"
     202    else
     203      func_dirname_result="$func_dirname_result${2}"
    881204    fi
    882 }
    883 
    884 
    885 # func_mktempdir [BASENAME]
    886 # -------------------------
    887 # Make a temporary directory that won't clash with other running
    888 # libtool processes, and avoids race conditions if possible.  If
    889 # given, BASENAME is the basename for that directory.
    890 func_mktempdir ()
    891 {
    892     $debug_cmd
    893 
    894     _G_template=${TMPDIR-/tmp}/${1-$progname}
    895 
    896     if test : = "$opt_dry_run"; then
    897       # Return a directory name, but don't create it in dry-run mode
    898       _G_tmpdir=$_G_template-$$
    899     else
    900 
    901       # If mktemp works, use that first and foremost
    902       _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
    903 
    904       if test ! -d "$_G_tmpdir"; then
    905         # Failing that, at least try and use $RANDOM to avoid a race
    906         _G_tmpdir=$_G_template-${RANDOM-0}$$
    907 
    908         func_mktempdir_umask=`umask`
    909         umask 0077
    910         $MKDIR "$_G_tmpdir"
    911         umask $func_mktempdir_umask
    912       fi
    913 
    914       # If we're not in dry-run mode, bomb out on failure
    915       test -d "$_G_tmpdir" || \
    916         func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
    917     fi
    918 
    919     $ECHO "$_G_tmpdir"
    920 }
    921 
     205    func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
     206} # func_dirname_and_basename may be replaced by extended shell implementation
     207
     208
     209# func_stripname prefix suffix name
     210# strip PREFIX and SUFFIX off of NAME.
     211# PREFIX and SUFFIX must not contain globbing or regex special
     212# characters, hashes, percent signs, but SUFFIX may contain a leading
     213# dot (in which case that matches only a dot).
     214# func_strip_suffix prefix name
     215func_stripname ()
     216{
     217    case ${2} in
     218      .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
     219      *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
     220    esac
     221} # func_stripname may be replaced by extended shell implementation
     222
     223
     224# These SED scripts presuppose an absolute path with a trailing slash.
     225pathcar='s,^/\([^/]*\).*$,\1,'
     226pathcdr='s,^/[^/]*,,'
     227removedotparts=':dotsl
     228                s@/\./@/@g
     229                t dotsl
     230                s,/\.$,/,'
     231collapseslashes='s@/\{1,\}@/@g'
     232finalslash='s,/*$,/,'
    922233
    923234# func_normal_abspath PATH
    924 # ------------------------
    925235# Remove doubled-up and trailing slashes, "." path components,
    926236# and cancel out any ".." path components in PATH after making
    927237# it an absolute path.
     238#             value returned in "$func_normal_abspath_result"
    928239func_normal_abspath ()
    929240{
    930     $debug_cmd
    931 
    932     # These SED scripts presuppose an absolute path with a trailing slash.
    933     _G_pathcar='s|^/\([^/]*\).*$|\1|'
    934     _G_pathcdr='s|^/[^/]*||'
    935     _G_removedotparts=':dotsl
    936                 s|/\./|/|g
    937                 t dotsl
    938                 s|/\.$|/|'
    939     _G_collapseslashes='s|/\{1,\}|/|g'
    940     _G_finalslash='s|/*$|/|'
    941 
    942     # Start from root dir and reassemble the path.
    943     func_normal_abspath_result=
    944     func_normal_abspath_tpath=$1
    945     func_normal_abspath_altnamespace=
    946     case $func_normal_abspath_tpath in
     241  # Start from root dir and reassemble the path.
     242  func_normal_abspath_result=
     243  func_normal_abspath_tpath=$1
     244  func_normal_abspath_altnamespace=
     245  case $func_normal_abspath_tpath in
     246    "")
     247      # Empty path, that just means $cwd.
     248      func_stripname '' '/' "`pwd`"
     249      func_normal_abspath_result=$func_stripname_result
     250      return
     251    ;;
     252    # The next three entries are used to spot a run of precisely
     253    # two leading slashes without using negated character classes;
     254    # we take advantage of case's first-match behaviour.
     255    ///*)
     256      # Unusual form of absolute path, do nothing.
     257    ;;
     258    //*)
     259      # Not necessarily an ordinary path; POSIX reserves leading '//'
     260      # and for example Cygwin uses it to access remote file shares
     261      # over CIFS/SMB, so we conserve a leading double slash if found.
     262      func_normal_abspath_altnamespace=/
     263    ;;
     264    /*)
     265      # Absolute path, do nothing.
     266    ;;
     267    *)
     268      # Relative path, prepend $cwd.
     269      func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
     270    ;;
     271  esac
     272  # Cancel out all the simple stuff to save iterations.  We also want
     273  # the path to end with a slash for ease of parsing, so make sure
     274  # there is one (and only one) here.
     275  func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
     276        -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
     277  while :; do
     278    # Processed it all yet?
     279    if test "$func_normal_abspath_tpath" = / ; then
     280      # If we ascended to the root using ".." the result may be empty now.
     281      if test -z "$func_normal_abspath_result" ; then
     282        func_normal_abspath_result=/
     283      fi
     284      break
     285    fi
     286    func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
     287        -e "$pathcar"`
     288    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
     289        -e "$pathcdr"`
     290    # Figure out what to do with it
     291    case $func_normal_abspath_tcomponent in
    947292      "")
    948         # Empty path, that just means $cwd.
    949         func_stripname '' '/' "`pwd`"
    950         func_normal_abspath_result=$func_stripname_result
    951         return
     293        # Trailing empty path component, ignore it.
     294      ;;
     295      ..)
     296        # Parent dir; strip last assembled component from result.
     297        func_dirname "$func_normal_abspath_result"
     298        func_normal_abspath_result=$func_dirname_result
     299      ;;
     300      *)
     301        # Actual path component, append it.
     302        func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
     303      ;;
     304    esac
     305  done
     306  # Restore leading double-slash if one was found on entry.
     307  func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
     308}
     309
     310# func_relative_path SRCDIR DSTDIR
     311# generates a relative path from SRCDIR to DSTDIR, with a trailing
     312# slash if non-empty, suitable for immediately appending a filename
     313# without needing to append a separator.
     314#             value returned in "$func_relative_path_result"
     315func_relative_path ()
     316{
     317  func_relative_path_result=
     318  func_normal_abspath "$1"
     319  func_relative_path_tlibdir=$func_normal_abspath_result
     320  func_normal_abspath "$2"
     321  func_relative_path_tbindir=$func_normal_abspath_result
     322
     323  # Ascend the tree starting from libdir
     324  while :; do
     325    # check if we have found a prefix of bindir
     326    case $func_relative_path_tbindir in
     327      $func_relative_path_tlibdir)
     328        # found an exact match
     329        func_relative_path_tcancelled=
     330        break
    952331        ;;
    953       # The next three entries are used to spot a run of precisely
    954       # two leading slashes without using negated character classes;
    955       # we take advantage of case's first-match behaviour.
    956       ///*)
    957         # Unusual form of absolute path, do nothing.
    958         ;;
    959       //*)
    960         # Not necessarily an ordinary path; POSIX reserves leading '//'
    961         # and for example Cygwin uses it to access remote file shares
    962         # over CIFS/SMB, so we conserve a leading double slash if found.
    963         func_normal_abspath_altnamespace=/
    964         ;;
    965       /*)
    966         # Absolute path, do nothing.
     332      $func_relative_path_tlibdir*)
     333        # found a matching prefix
     334        func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
     335        func_relative_path_tcancelled=$func_stripname_result
     336        if test -z "$func_relative_path_result"; then
     337          func_relative_path_result=.
     338        fi
     339        break
    967340        ;;
    968341      *)
    969         # Relative path, prepend $cwd.
    970         func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
     342        func_dirname $func_relative_path_tlibdir
     343        func_relative_path_tlibdir=${func_dirname_result}
     344        if test "x$func_relative_path_tlibdir" = x ; then
     345          # Have to descend all the way to the root!
     346          func_relative_path_result=../$func_relative_path_result
     347          func_relative_path_tcancelled=$func_relative_path_tbindir
     348          break
     349        fi
     350        func_relative_path_result=../$func_relative_path_result
    971351        ;;
    972352    esac
    973 
    974     # Cancel out all the simple stuff to save iterations.  We also want
    975     # the path to end with a slash for ease of parsing, so make sure
    976     # there is one (and only one) here.
    977     func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
    978           -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
    979     while :; do
    980       # Processed it all yet?
    981       if test / = "$func_normal_abspath_tpath"; then
    982         # If we ascended to the root using ".." the result may be empty now.
    983         if test -z "$func_normal_abspath_result"; then
    984           func_normal_abspath_result=/
    985         fi
    986         break
    987       fi
    988       func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
    989           -e "$_G_pathcar"`
    990       func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
    991           -e "$_G_pathcdr"`
    992       # Figure out what to do with it
    993       case $func_normal_abspath_tcomponent in
    994         "")
    995           # Trailing empty path component, ignore it.
    996           ;;
    997         ..)
    998           # Parent dir; strip last assembled component from result.
    999           func_dirname "$func_normal_abspath_result"
    1000           func_normal_abspath_result=$func_dirname_result
    1001           ;;
    1002         *)
    1003           # Actual path component, append it.
    1004           func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
    1005           ;;
    1006       esac
    1007     done
    1008     # Restore leading double-slash if one was found on entry.
    1009     func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
    1010 }
    1011 
    1012 
    1013 # func_notquiet ARG...
    1014 # --------------------
    1015 # Echo program name prefixed message only when not in quiet mode.
    1016 func_notquiet ()
    1017 {
    1018     $debug_cmd
    1019 
    1020     $opt_quiet || func_echo ${1+"$@"}
     353  done
     354
     355  # Now calculate path; take care to avoid doubling-up slashes.
     356  func_stripname '' '/' "$func_relative_path_result"
     357  func_relative_path_result=$func_stripname_result
     358  func_stripname '/' '/' "$func_relative_path_tcancelled"
     359  if test "x$func_stripname_result" != x ; then
     360    func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
     361  fi
     362
     363  # Normalisation. If bindir is libdir, return empty string,
     364  # else relative path ending with a slash; either way, target
     365  # file name can be directly appended.
     366  if test ! -z "$func_relative_path_result"; then
     367    func_stripname './' '' "$func_relative_path_result/"
     368    func_relative_path_result=$func_stripname_result
     369  fi
     370}
     371
     372# The name of this program:
     373func_dirname_and_basename "$progpath"
     374progname=$func_basename_result
     375
     376# Make sure we have an absolute path for reexecution:
     377case $progpath in
     378  [\\/]*|[A-Za-z]:\\*) ;;
     379  *[\\/]*)
     380     progdir=$func_dirname_result
     381     progdir=`cd "$progdir" && pwd`
     382     progpath="$progdir/$progname"
     383     ;;
     384  *)
     385     save_IFS="$IFS"
     386     IFS=${PATH_SEPARATOR-:}
     387     for progdir in $PATH; do
     388       IFS="$save_IFS"
     389       test -x "$progdir/$progname" && break
     390     done
     391     IFS="$save_IFS"
     392     test -n "$progdir" || progdir=`pwd`
     393     progpath="$progdir/$progname"
     394     ;;
     395esac
     396
     397# Sed substitution that helps us do robust quoting.  It backslashifies
     398# metacharacters that are still active within double-quoted strings.
     399Xsed="${SED}"' -e 1s/^X//'
     400sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
     401
     402# Same as above, but do not quote variable references.
     403double_quote_subst='s/\(["`\\]\)/\\\1/g'
     404
     405# Sed substitution that turns a string into a regex matching for the
     406# string literally.
     407sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
     408
     409# Sed substitution that converts a w32 file name or path
     410# which contains forward slashes, into one that contains
     411# (escaped) backslashes.  A very naive implementation.
     412lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
     413
     414# Re-`\' parameter expansions in output of double_quote_subst that were
     415# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
     416# in input to double_quote_subst, that '$' was protected from expansion.
     417# Since each input `\' is now two `\'s, look for any number of runs of
     418# four `\'s followed by two `\'s and then a '$'.  `\' that '$'.
     419bs='\\'
     420bs2='\\\\'
     421bs4='\\\\\\\\'
     422dollar='\$'
     423sed_double_backslash="\
     424  s/$bs4/&\\
     425/g
     426  s/^$bs2$dollar/$bs&/
     427  s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
     428  s/\n//g"
     429
     430# Standard options:
     431opt_dry_run=false
     432opt_help=false
     433opt_quiet=false
     434opt_verbose=false
     435opt_warning=:
     436
     437# func_echo arg...
     438# Echo program name prefixed message, along with the current mode
     439# name if it has been set yet.
     440func_echo ()
     441{
     442    $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
     443}
     444
     445# func_verbose arg...
     446# Echo program name prefixed message in verbose mode only.
     447func_verbose ()
     448{
     449    $opt_verbose && func_echo ${1+"$@"}
    1021450
    1022451    # A bug in bash halts the script if the last line of a function
     
    1026455}
    1027456
    1028 
    1029 # func_relative_path SRCDIR DSTDIR
    1030 # --------------------------------
    1031 # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
    1032 func_relative_path ()
    1033 {
    1034     $debug_cmd
    1035 
    1036     func_relative_path_result=
    1037     func_normal_abspath "$1"
    1038     func_relative_path_tlibdir=$func_normal_abspath_result
    1039     func_normal_abspath "$2"
    1040     func_relative_path_tbindir=$func_normal_abspath_result
    1041 
    1042     # Ascend the tree starting from libdir
    1043     while :; do
    1044       # check if we have found a prefix of bindir
    1045       case $func_relative_path_tbindir in
    1046         $func_relative_path_tlibdir)
    1047           # found an exact match
    1048           func_relative_path_tcancelled=
    1049           break
    1050           ;;
    1051         $func_relative_path_tlibdir*)
    1052           # found a matching prefix
    1053           func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
    1054           func_relative_path_tcancelled=$func_stripname_result
    1055           if test -z "$func_relative_path_result"; then
    1056             func_relative_path_result=.
    1057           fi
    1058           break
    1059           ;;
    1060         *)
    1061           func_dirname $func_relative_path_tlibdir
    1062           func_relative_path_tlibdir=$func_dirname_result
    1063           if test -z "$func_relative_path_tlibdir"; then
    1064             # Have to descend all the way to the root!
    1065             func_relative_path_result=../$func_relative_path_result
    1066             func_relative_path_tcancelled=$func_relative_path_tbindir
    1067             break
    1068           fi
    1069           func_relative_path_result=../$func_relative_path_result
    1070           ;;
     457# func_echo_all arg...
     458# Invoke $ECHO with all args, space-separated.
     459func_echo_all ()
     460{
     461    $ECHO "$*"
     462}
     463
     464# func_error arg...
     465# Echo program name prefixed message to standard error.
     466func_error ()
     467{
     468    $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
     469}
     470
     471# func_warning arg...
     472# Echo program name prefixed warning message to standard error.
     473func_warning ()
     474{
     475    $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
     476
     477    # bash bug again:
     478    :
     479}
     480
     481# func_fatal_error arg...
     482# Echo program name prefixed message to standard error, and exit.
     483func_fatal_error ()
     484{
     485    func_error ${1+"$@"}
     486    exit $EXIT_FAILURE
     487}
     488
     489# func_fatal_help arg...
     490# Echo program name prefixed message to standard error, followed by
     491# a help hint, and exit.
     492func_fatal_help ()
     493{
     494    func_error ${1+"$@"}
     495    func_fatal_error "$help"
     496}
     497help="Try \`$progname --help' for more information."  ## default
     498
     499
     500# func_grep expression filename
     501# Check whether EXPRESSION matches any line of FILENAME, without output.
     502func_grep ()
     503{
     504    $GREP "$1" "$2" >/dev/null 2>&1
     505}
     506
     507
     508# func_mkdir_p directory-path
     509# Make sure the entire path to DIRECTORY-PATH is available.
     510func_mkdir_p ()
     511{
     512    my_directory_path="$1"
     513    my_dir_list=
     514
     515    if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
     516
     517      # Protect directory names starting with `-'
     518      case $my_directory_path in
     519        -*) my_directory_path="./$my_directory_path" ;;
    1071520      esac
    1072     done
    1073 
    1074     # Now calculate path; take care to avoid doubling-up slashes.
    1075     func_stripname '' '/' "$func_relative_path_result"
    1076     func_relative_path_result=$func_stripname_result
    1077     func_stripname '/' '/' "$func_relative_path_tcancelled"
    1078     if test -n "$func_stripname_result"; then
    1079       func_append func_relative_path_result "/$func_stripname_result"
     521
     522      # While some portion of DIR does not yet exist...
     523      while test ! -d "$my_directory_path"; do
     524        # ...make a list in topmost first order.  Use a colon delimited
     525        # list incase some portion of path contains whitespace.
     526        my_dir_list="$my_directory_path:$my_dir_list"
     527
     528        # If the last portion added has no slash in it, the list is done
     529        case $my_directory_path in */*) ;; *) break ;; esac
     530
     531        # ...otherwise throw away the child directory and loop
     532        my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
     533      done
     534      my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
     535
     536      save_mkdir_p_IFS="$IFS"; IFS=':'
     537      for my_dir in $my_dir_list; do
     538        IFS="$save_mkdir_p_IFS"
     539        # mkdir can fail with a `File exist' error if two processes
     540        # try to create one of the directories concurrently.  Don't
     541        # stop in that case!
     542        $MKDIR "$my_dir" 2>/dev/null || :
     543      done
     544      IFS="$save_mkdir_p_IFS"
     545
     546      # Bail out if we (or some other process) failed to create a directory.
     547      test -d "$my_directory_path" || \
     548        func_fatal_error "Failed to create \`$1'"
    1080549    fi
    1081 
    1082     # Normalisation. If bindir is libdir, return '.' else relative path.
    1083     if test -n "$func_relative_path_result"; then
    1084       func_stripname './' '' "$func_relative_path_result"
    1085       func_relative_path_result=$func_stripname_result
     550}
     551
     552
     553# func_mktempdir [string]
     554# Make a temporary directory that won't clash with other running
     555# libtool processes, and avoids race conditions if possible.  If
     556# given, STRING is the basename for that directory.
     557func_mktempdir ()
     558{
     559    my_template="${TMPDIR-/tmp}/${1-$progname}"
     560
     561    if test "$opt_dry_run" = ":"; then
     562      # Return a directory name, but don't create it in dry-run mode
     563      my_tmpdir="${my_template}-$$"
     564    else
     565
     566      # If mktemp works, use that first and foremost
     567      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
     568
     569      if test ! -d "$my_tmpdir"; then
     570        # Failing that, at least try and use $RANDOM to avoid a race
     571        my_tmpdir="${my_template}-${RANDOM-0}$$"
     572
     573        save_mktempdir_umask=`umask`
     574        umask 0077
     575        $MKDIR "$my_tmpdir"
     576        umask $save_mktempdir_umask
     577      fi
     578
     579      # If we're not in dry-run mode, bomb out on failure
     580      test -d "$my_tmpdir" || \
     581        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
    1086582    fi
    1087583
    1088     test -n "$func_relative_path_result" || func_relative_path_result=.
    1089 
    1090     :
    1091 }
    1092 
    1093 
    1094 # func_quote_for_eval ARG...
    1095 # --------------------------
    1096 # Aesthetically quote ARGs to be evaled later.
    1097 # This function returns two values:
    1098 #   i) func_quote_for_eval_result
    1099 #      double-quoted, suitable for a subsequent eval
    1100 #  ii) func_quote_for_eval_unquoted_result
    1101 #      has all characters that are still active within double
    1102 #      quotes backslashified.
     584    $ECHO "$my_tmpdir"
     585}
     586
     587
     588# func_quote_for_eval arg
     589# Aesthetically quote ARG to be evaled later.
     590# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
     591# is double-quoted, suitable for a subsequent eval, whereas
     592# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
     593# which are still active within double quotes backslashified.
    1103594func_quote_for_eval ()
    1104595{
    1105     $debug_cmd
    1106 
    1107     func_quote_for_eval_unquoted_result=
    1108     func_quote_for_eval_result=
    1109     while test 0 -lt $#; do
    1110       case $1 in
    1111         *[\\\`\"\$]*)
    1112           _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
    1113         *)
    1114           _G_unquoted_arg=$1 ;;
    1115       esac
    1116       if test -n "$func_quote_for_eval_unquoted_result"; then
    1117         func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
    1118       else
    1119         func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
    1120       fi
    1121 
    1122       case $_G_unquoted_arg in
    1123         # Double-quote args containing shell metacharacters to delay
    1124         # word splitting, command substitution and variable expansion
    1125         # for a subsequent eval.
    1126         # Many Bourne shells cannot handle close brackets correctly
    1127         # in scan sets, so we specify it separately.
    1128         *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
    1129           _G_quoted_arg=\"$_G_unquoted_arg\"
    1130           ;;
    1131         *)
    1132           _G_quoted_arg=$_G_unquoted_arg
    1133           ;;
    1134       esac
    1135 
    1136       if test -n "$func_quote_for_eval_result"; then
    1137         func_append func_quote_for_eval_result " $_G_quoted_arg"
    1138       else
    1139         func_append func_quote_for_eval_result "$_G_quoted_arg"
    1140       fi
    1141       shift
    1142     done
    1143 }
    1144 
    1145 
    1146 # func_quote_for_expand ARG
    1147 # -------------------------
     596    case $1 in
     597      *[\\\`\"\$]*)
     598        func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
     599      *)
     600        func_quote_for_eval_unquoted_result="$1" ;;
     601    esac
     602
     603    case $func_quote_for_eval_unquoted_result in
     604      # Double-quote args containing shell metacharacters to delay
     605      # word splitting, command substitution and and variable
     606      # expansion for a subsequent eval.
     607      # Many Bourne shells cannot handle close brackets correctly
     608      # in scan sets, so we specify it separately.
     609      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
     610        func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
     611        ;;
     612      *)
     613        func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
     614    esac
     615}
     616
     617
     618# func_quote_for_expand arg
    1148619# Aesthetically quote ARG to be evaled later; same as above,
    1149620# but do not quote variable references.
    1150621func_quote_for_expand ()
    1151622{
    1152     $debug_cmd
    1153 
    1154623    case $1 in
    1155624      *[\\\`\"]*)
    1156         _G_arg=`$ECHO "$1" | $SED \
    1157             -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
     625        my_arg=`$ECHO "$1" | $SED \
     626            -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
    1158627      *)
    1159         _G_arg=$1 ;;
     628        my_arg="$1" ;;
    1160629    esac
    1161630
    1162     case $_G_arg in
     631    case $my_arg in
    1163632      # Double-quote args containing shell metacharacters to delay
    1164633      # word splitting and command substitution for a subsequent eval.
     
    1166635      # in scan sets, so we specify it separately.
    1167636      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
    1168         _G_arg=\"$_G_arg\"
     637        my_arg="\"$my_arg\""
    1169638        ;;
    1170639    esac
    1171640
    1172     func_quote_for_expand_result=$_G_arg
    1173 }
    1174 
    1175 
    1176 # func_stripname PREFIX SUFFIX NAME
    1177 # ---------------------------------
    1178 # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
    1179 # PREFIX and SUFFIX must not contain globbing or regex special
    1180 # characters, hashes, percent signs, but SUFFIX may contain a leading
    1181 # dot (in which case that matches only a dot).
    1182 if test yes = "$_G_HAVE_XSI_OPS"; then
    1183   eval 'func_stripname ()
    1184   {
    1185     $debug_cmd
    1186 
    1187     # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
    1188     # positional parameters, so assign one to ordinary variable first.
    1189     func_stripname_result=$3
    1190     func_stripname_result=${func_stripname_result#"$1"}
    1191     func_stripname_result=${func_stripname_result%"$2"}
    1192   }'
    1193 else
    1194   func_stripname ()
    1195   {
    1196     $debug_cmd
    1197 
    1198     case $2 in
    1199       .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
    1200       *)  func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
    1201     esac
    1202   }
    1203 fi
    1204 
    1205 
    1206 # func_show_eval CMD [FAIL_EXP]
    1207 # -----------------------------
    1208 # Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
     641    func_quote_for_expand_result="$my_arg"
     642}
     643
     644
     645# func_show_eval cmd [fail_exp]
     646# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
    1209647# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
    1210648# is given, then evaluate it.
    1211649func_show_eval ()
    1212650{
    1213     $debug_cmd
    1214 
    1215     _G_cmd=$1
    1216     _G_fail_exp=${2-':'}
    1217 
    1218     func_quote_for_expand "$_G_cmd"
    1219     eval "func_notquiet $func_quote_for_expand_result"
    1220 
    1221     $opt_dry_run || {
    1222       eval "$_G_cmd"
    1223       _G_status=$?
    1224       if test 0 -ne "$_G_status"; then
    1225         eval "(exit $_G_status); $_G_fail_exp"
     651    my_cmd="$1"
     652    my_fail_exp="${2-:}"
     653
     654    ${opt_silent-false} || {
     655      func_quote_for_expand "$my_cmd"
     656      eval "func_echo $func_quote_for_expand_result"
     657    }
     658
     659    if ${opt_dry_run-false}; then :; else
     660      eval "$my_cmd"
     661      my_status=$?
     662      if test "$my_status" -eq 0; then :; else
     663        eval "(exit $my_status); $my_fail_exp"
    1226664      fi
    1227     }
    1228 }
    1229 
    1230 
    1231 # func_show_eval_locale CMD [FAIL_EXP]
    1232 # ------------------------------------
    1233 # Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
     665    fi
     666}
     667
     668
     669# func_show_eval_locale cmd [fail_exp]
     670# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
    1234671# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
    1235672# is given, then evaluate it.  Use the saved locale for evaluation.
    1236673func_show_eval_locale ()
    1237674{
    1238     $debug_cmd
    1239 
    1240     _G_cmd=$1
    1241     _G_fail_exp=${2-':'}
    1242 
    1243     $opt_quiet || {
    1244       func_quote_for_expand "$_G_cmd"
     675    my_cmd="$1"
     676    my_fail_exp="${2-:}"
     677
     678    ${opt_silent-false} || {
     679      func_quote_for_expand "$my_cmd"
    1245680      eval "func_echo $func_quote_for_expand_result"
    1246681    }
    1247682
    1248     $opt_dry_run || {
    1249       eval "$_G_user_locale
    1250             $_G_cmd"
    1251       _G_status=$?
    1252       eval "$_G_safe_locale"
    1253       if test 0 -ne "$_G_status"; then
    1254         eval "(exit $_G_status); $_G_fail_exp"
     683    if ${opt_dry_run-false}; then :; else
     684      eval "$lt_user_locale
     685            $my_cmd"
     686      my_status=$?
     687      eval "$lt_safe_locale"
     688      if test "$my_status" -eq 0; then :; else
     689        eval "(exit $my_status); $my_fail_exp"
    1255690      fi
    1256     }
    1257 }
    1258 
     691    fi
     692}
    1259693
    1260694# func_tr_sh
    1261 # ----------
    1262695# Turn $1 into a string suitable for a shell variable name.
    1263696# Result is stored in $func_tr_sh_result.  All characters
     
    1266699func_tr_sh ()
    1267700{
    1268     $debug_cmd
    1269 
    1270     case $1 in
    1271     [0-9]* | *[!a-zA-Z0-9_]*)
    1272       func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
    1273       ;;
    1274     * )
    1275       func_tr_sh_result=$1
    1276       ;;
    1277     esac
    1278 }
    1279 
    1280 
    1281 # func_verbose ARG...
    1282 # -------------------
    1283 # Echo program name prefixed message in verbose mode only.
    1284 func_verbose ()
    1285 {
    1286     $debug_cmd
    1287 
    1288     $opt_verbose && func_echo "$*"
    1289 
    1290     :
    1291 }
    1292 
    1293 
    1294 # func_warn_and_continue ARG...
    1295 # -----------------------------
    1296 # Echo program name prefixed warning message to standard error.
    1297 func_warn_and_continue ()
    1298 {
    1299     $debug_cmd
    1300 
    1301     $require_term_colors
    1302 
    1303     func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
    1304 }
    1305 
    1306 
    1307 # func_warning CATEGORY ARG...
    1308 # ----------------------------
    1309 # Echo program name prefixed warning message to standard error. Warning
    1310 # messages can be filtered according to CATEGORY, where this function
    1311 # elides messages where CATEGORY is not listed in the global variable
    1312 # 'opt_warning_types'.
    1313 func_warning ()
    1314 {
    1315     $debug_cmd
    1316 
    1317     # CATEGORY must be in the warning_categories list!
    1318     case " $warning_categories " in
    1319       *" $1 "*) ;;
    1320       *) func_internal_error "invalid warning category '$1'" ;;
    1321     esac
    1322 
    1323     _G_category=$1
    1324     shift
    1325 
    1326     case " $opt_warning_types " in
    1327       *" $_G_category "*) $warning_func ${1+"$@"} ;;
    1328     esac
    1329 }
    1330 
    1331 
    1332 # func_sort_ver VER1 VER2
    1333 # -----------------------
    1334 # 'sort -V' is not generally available.
    1335 # Note this deviates from the version comparison in automake
    1336 # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
    1337 # but this should suffice as we won't be specifying old
    1338 # version formats or redundant trailing .0 in bootstrap.conf.
    1339 # If we did want full compatibility then we should probably
    1340 # use m4_version_compare from autoconf.
    1341 func_sort_ver ()
    1342 {
    1343     $debug_cmd
    1344 
    1345     printf '%s\n%s\n' "$1" "$2" \
    1346       | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n
    1347 }
    1348 
    1349 # func_lt_ver PREV CURR
    1350 # ---------------------
    1351 # Return true if PREV and CURR are in the correct order according to
    1352 # func_sort_ver, otherwise false.  Use it like this:
    1353 #
    1354 #  func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."
    1355 func_lt_ver ()
    1356 {
    1357     $debug_cmd
    1358 
    1359     test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`
    1360 }
    1361 
    1362 
    1363 # Local variables:
    1364 # mode: shell-script
    1365 # sh-indentation: 2
    1366 # eval: (add-hook 'before-save-hook 'time-stamp)
    1367 # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
    1368 # time-stamp-time-zone: "UTC"
    1369 # End:
    1370 #! /bin/sh
    1371 
    1372 # Set a version string for this script.
    1373 scriptversion=2014-01-07.03; # UTC
    1374 
    1375 # A portable, pluggable option parser for Bourne shell.
    1376 # Written by Gary V. Vaughan, 2010
    1377 
    1378 # Copyright (C) 2010-2015 Free Software Foundation, Inc.
    1379 # This is free software; see the source for copying conditions.  There is NO
    1380 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    1381 
    1382 # This program is free software: you can redistribute it and/or modify
    1383 # it under the terms of the GNU General Public License as published by
    1384 # the Free Software Foundation, either version 3 of the License, or
    1385 # (at your option) any later version.
    1386 
    1387 # This program is distributed in the hope that it will be useful,
    1388 # but WITHOUT ANY WARRANTY; without even the implied warranty of
    1389 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1390 # GNU General Public License for more details.
    1391 
    1392 # You should have received a copy of the GNU General Public License
    1393 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
    1394 
    1395 # Please report bugs or propose patches to gary@gnu.org.
    1396 
    1397 
    1398 ## ------ ##
    1399 ## Usage. ##
    1400 ## ------ ##
    1401 
    1402 # This file is a library for parsing options in your shell scripts along
    1403 # with assorted other useful supporting features that you can make use
    1404 # of too.
    1405 #
    1406 # For the simplest scripts you might need only:
    1407 #
    1408 #   #!/bin/sh
    1409 #   . relative/path/to/funclib.sh
    1410 #   . relative/path/to/options-parser
    1411 #   scriptversion=1.0
    1412 #   func_options ${1+"$@"}
    1413 #   eval set dummy "$func_options_result"; shift
    1414 #   ...rest of your script...
    1415 #
    1416 # In order for the '--version' option to work, you will need to have a
    1417 # suitably formatted comment like the one at the top of this file
    1418 # starting with '# Written by ' and ending with '# warranty; '.
    1419 #
    1420 # For '-h' and '--help' to work, you will also need a one line
    1421 # description of your script's purpose in a comment directly above the
    1422 # '# Written by ' line, like the one at the top of this file.
    1423 #
    1424 # The default options also support '--debug', which will turn on shell
    1425 # execution tracing (see the comment above debug_cmd below for another
    1426 # use), and '--verbose' and the func_verbose function to allow your script
    1427 # to display verbose messages only when your user has specified
    1428 # '--verbose'.
    1429 #
    1430 # After sourcing this file, you can plug processing for additional
    1431 # options by amending the variables from the 'Configuration' section
    1432 # below, and following the instructions in the 'Option parsing'
    1433 # section further down.
    1434 
    1435 ## -------------- ##
    1436 ## Configuration. ##
    1437 ## -------------- ##
    1438 
    1439 # You should override these variables in your script after sourcing this
    1440 # file so that they reflect the customisations you have added to the
    1441 # option parser.
    1442 
    1443 # The usage line for option parsing errors and the start of '-h' and
    1444 # '--help' output messages. You can embed shell variables for delayed
    1445 # expansion at the time the message is displayed, but you will need to
    1446 # quote other shell meta-characters carefully to prevent them being
    1447 # expanded when the contents are evaled.
    1448 usage='$progpath [OPTION]...'
    1449 
    1450 # Short help message in response to '-h' and '--help'.  Add to this or
    1451 # override it after sourcing this library to reflect the full set of
    1452 # options your script accepts.
    1453 usage_message="\
    1454        --debug        enable verbose shell tracing
    1455    -W, --warnings=CATEGORY
    1456                       report the warnings falling in CATEGORY [all]
    1457    -v, --verbose      verbosely report processing
    1458        --version      print version information and exit
    1459    -h, --help         print short or long help message and exit
    1460 "
    1461 
    1462 # Additional text appended to 'usage_message' in response to '--help'.
    1463 long_help_message="
    1464 Warning categories include:
    1465        'all'          show all warnings
    1466        'none'         turn off all the warnings
    1467        'error'        warnings are treated as fatal errors"
    1468 
    1469 # Help message printed before fatal option parsing errors.
    1470 fatal_help="Try '\$progname --help' for more information."
    1471 
    1472 
    1473 
    1474 ## ------------------------- ##
    1475 ## Hook function management. ##
    1476 ## ------------------------- ##
    1477 
    1478 # This section contains functions for adding, removing, and running hooks
    1479 # to the main code.  A hook is just a named list of of function, that can
    1480 # be run in order later on.
    1481 
    1482 # func_hookable FUNC_NAME
    1483 # -----------------------
    1484 # Declare that FUNC_NAME will run hooks added with
    1485 # 'func_add_hook FUNC_NAME ...'.
    1486 func_hookable ()
    1487 {
    1488     $debug_cmd
    1489 
    1490     func_append hookable_fns " $1"
    1491 }
    1492 
    1493 
    1494 # func_add_hook FUNC_NAME HOOK_FUNC
    1495 # ---------------------------------
    1496 # Request that FUNC_NAME call HOOK_FUNC before it returns.  FUNC_NAME must
    1497 # first have been declared "hookable" by a call to 'func_hookable'.
    1498 func_add_hook ()
    1499 {
    1500     $debug_cmd
    1501 
    1502     case " $hookable_fns " in
    1503       *" $1 "*) ;;
    1504       *) func_fatal_error "'$1' does not accept hook functions." ;;
    1505     esac
    1506 
    1507     eval func_append ${1}_hooks '" $2"'
    1508 }
    1509 
    1510 
    1511 # func_remove_hook FUNC_NAME HOOK_FUNC
    1512 # ------------------------------------
    1513 # Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
    1514 func_remove_hook ()
    1515 {
    1516     $debug_cmd
    1517 
    1518     eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
    1519 }
    1520 
    1521 
    1522 # func_run_hooks FUNC_NAME [ARG]...
    1523 # ---------------------------------
    1524 # Run all hook functions registered to FUNC_NAME.
    1525 # It is assumed that the list of hook functions contains nothing more
    1526 # than a whitespace-delimited list of legal shell function names, and
    1527 # no effort is wasted trying to catch shell meta-characters or preserve
    1528 # whitespace.
    1529 func_run_hooks ()
    1530 {
    1531     $debug_cmd
    1532 
    1533     case " $hookable_fns " in
    1534       *" $1 "*) ;;
    1535       *) func_fatal_error "'$1' does not support hook funcions.n" ;;
    1536     esac
    1537 
    1538     eval _G_hook_fns=\$$1_hooks; shift
    1539 
    1540     for _G_hook in $_G_hook_fns; do
    1541       eval $_G_hook '"$@"'
    1542 
    1543       # store returned options list back into positional
    1544       # parameters for next 'cmd' execution.
    1545       eval _G_hook_result=\$${_G_hook}_result
    1546       eval set dummy "$_G_hook_result"; shift
    1547     done
    1548 
    1549     func_quote_for_eval ${1+"$@"}
    1550     func_run_hooks_result=$func_quote_for_eval_result
    1551 }
    1552 
    1553 
    1554 
    1555 ## --------------- ##
    1556 ## Option parsing. ##
    1557 ## --------------- ##
    1558 
    1559 # In order to add your own option parsing hooks, you must accept the
    1560 # full positional parameter list in your hook function, remove any
    1561 # options that you action, and then pass back the remaining unprocessed
    1562 # options in '<hooked_function_name>_result', escaped suitably for
    1563 # 'eval'.  Like this:
    1564 #
    1565 #    my_options_prep ()
    1566 #    {
    1567 #        $debug_cmd
    1568 #
    1569 #        # Extend the existing usage message.
    1570 #        usage_message=$usage_message'
    1571 #      -s, --silent       don'\''t print informational messages
    1572 #    '
    1573 #
    1574 #        func_quote_for_eval ${1+"$@"}
    1575 #        my_options_prep_result=$func_quote_for_eval_result
    1576 #    }
    1577 #    func_add_hook func_options_prep my_options_prep
    1578 #
    1579 #
    1580 #    my_silent_option ()
    1581 #    {
    1582 #        $debug_cmd
    1583 #
    1584 #        # Note that for efficiency, we parse as many options as we can
    1585 #        # recognise in a loop before passing the remainder back to the
    1586 #        # caller on the first unrecognised argument we encounter.
    1587 #        while test $# -gt 0; do
    1588 #          opt=$1; shift
    1589 #          case $opt in
    1590 #            --silent|-s) opt_silent=: ;;
    1591 #            # Separate non-argument short options:
    1592 #            -s*)         func_split_short_opt "$_G_opt"
    1593 #                         set dummy "$func_split_short_opt_name" \
    1594 #                             "-$func_split_short_opt_arg" ${1+"$@"}
    1595 #                         shift
    1596 #                         ;;
    1597 #            *)            set dummy "$_G_opt" "$*"; shift; break ;;
    1598 #          esac
    1599 #        done
    1600 #
    1601 #        func_quote_for_eval ${1+"$@"}
    1602 #        my_silent_option_result=$func_quote_for_eval_result
    1603 #    }
    1604 #    func_add_hook func_parse_options my_silent_option
    1605 #
    1606 #
    1607 #    my_option_validation ()
    1608 #    {
    1609 #        $debug_cmd
    1610 #
    1611 #        $opt_silent && $opt_verbose && func_fatal_help "\
    1612 #    '--silent' and '--verbose' options are mutually exclusive."
    1613 #
    1614 #        func_quote_for_eval ${1+"$@"}
    1615 #        my_option_validation_result=$func_quote_for_eval_result
    1616 #    }
    1617 #    func_add_hook func_validate_options my_option_validation
    1618 #
    1619 # You'll alse need to manually amend $usage_message to reflect the extra
    1620 # options you parse.  It's preferable to append if you can, so that
    1621 # multiple option parsing hooks can be added safely.
    1622 
    1623 
    1624 # func_options [ARG]...
    1625 # ---------------------
    1626 # All the functions called inside func_options are hookable. See the
    1627 # individual implementations for details.
    1628 func_hookable func_options
    1629 func_options ()
    1630 {
    1631     $debug_cmd
    1632 
    1633     func_options_prep ${1+"$@"}
    1634     eval func_parse_options \
    1635         ${func_options_prep_result+"$func_options_prep_result"}
    1636     eval func_validate_options \
    1637         ${func_parse_options_result+"$func_parse_options_result"}
    1638 
    1639     eval func_run_hooks func_options \
    1640         ${func_validate_options_result+"$func_validate_options_result"}
    1641 
    1642     # save modified positional parameters for caller
    1643     func_options_result=$func_run_hooks_result
    1644 }
    1645 
    1646 
    1647 # func_options_prep [ARG]...
    1648 # --------------------------
    1649 # All initialisations required before starting the option parse loop.
    1650 # Note that when calling hook functions, we pass through the list of
    1651 # positional parameters.  If a hook function modifies that list, and
    1652 # needs to propogate that back to rest of this script, then the complete
    1653 # modified list must be put in 'func_run_hooks_result' before
    1654 # returning.
    1655 func_hookable func_options_prep
    1656 func_options_prep ()
    1657 {
    1658     $debug_cmd
    1659 
    1660     # Option defaults:
    1661     opt_verbose=false
    1662     opt_warning_types=
    1663 
    1664     func_run_hooks func_options_prep ${1+"$@"}
    1665 
    1666     # save modified positional parameters for caller
    1667     func_options_prep_result=$func_run_hooks_result
    1668 }
    1669 
    1670 
    1671 # func_parse_options [ARG]...
    1672 # ---------------------------
    1673 # The main option parsing loop.
    1674 func_hookable func_parse_options
    1675 func_parse_options ()
    1676 {
    1677     $debug_cmd
    1678 
    1679     func_parse_options_result=
    1680 
    1681     # this just eases exit handling
    1682     while test $# -gt 0; do
    1683       # Defer to hook functions for initial option parsing, so they
    1684       # get priority in the event of reusing an option name.
    1685       func_run_hooks func_parse_options ${1+"$@"}
    1686 
    1687       # Adjust func_parse_options positional parameters to match
    1688       eval set dummy "$func_run_hooks_result"; shift
    1689 
    1690       # Break out of the loop if we already parsed every option.
    1691       test $# -gt 0 || break
    1692 
    1693       _G_opt=$1
    1694       shift
    1695       case $_G_opt in
    1696         --debug|-x)   debug_cmd='set -x'
    1697                       func_echo "enabling shell trace mode"
    1698                       $debug_cmd
    1699                       ;;
    1700 
    1701         --no-warnings|--no-warning|--no-warn)
    1702                       set dummy --warnings none ${1+"$@"}
    1703                       shift
    1704                       ;;
    1705 
    1706         --warnings|--warning|-W)
    1707                       test $# = 0 && func_missing_arg $_G_opt && break
    1708                       case " $warning_categories $1" in
    1709                         *" $1 "*)
    1710                           # trailing space prevents matching last $1 above
    1711                           func_append_uniq opt_warning_types " $1"
    1712                           ;;
    1713                         *all)
    1714                           opt_warning_types=$warning_categories
    1715                           ;;
    1716                         *none)
    1717                           opt_warning_types=none
    1718                           warning_func=:
    1719                           ;;
    1720                         *error)
    1721                           opt_warning_types=$warning_categories
    1722                           warning_func=func_fatal_error
    1723                           ;;
    1724                         *)
    1725                           func_fatal_error \
    1726                              "unsupported warning category: '$1'"
    1727                           ;;
    1728                       esac
    1729                       shift
    1730                       ;;
    1731 
    1732         --verbose|-v) opt_verbose=: ;;
    1733         --version)    func_version ;;
    1734         -\?|-h)       func_usage ;;
    1735         --help)       func_help ;;
    1736 
    1737         # Separate optargs to long options (plugins may need this):
    1738         --*=*)        func_split_equals "$_G_opt"
    1739                       set dummy "$func_split_equals_lhs" \
    1740                           "$func_split_equals_rhs" ${1+"$@"}
    1741                       shift
    1742                       ;;
    1743 
    1744        # Separate optargs to short options:
    1745         -W*)
    1746                       func_split_short_opt "$_G_opt"
    1747                       set dummy "$func_split_short_opt_name" \
    1748                           "$func_split_short_opt_arg" ${1+"$@"}
    1749                       shift
    1750                       ;;
    1751 
    1752         # Separate non-argument short options:
    1753         -\?*|-h*|-v*|-x*)
    1754                       func_split_short_opt "$_G_opt"
    1755                       set dummy "$func_split_short_opt_name" \
    1756                           "-$func_split_short_opt_arg" ${1+"$@"}
    1757                       shift
    1758                       ;;
    1759 
    1760         --)           break ;;
    1761         -*)           func_fatal_help "unrecognised option: '$_G_opt'" ;;
    1762         *)            set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
    1763       esac
    1764     done
    1765 
    1766     # save modified positional parameters for caller
    1767     func_quote_for_eval ${1+"$@"}
    1768     func_parse_options_result=$func_quote_for_eval_result
    1769 }
    1770 
    1771 
    1772 # func_validate_options [ARG]...
    1773 # ------------------------------
    1774 # Perform any sanity checks on option settings and/or unconsumed
    1775 # arguments.
    1776 func_hookable func_validate_options
    1777 func_validate_options ()
    1778 {
    1779     $debug_cmd
    1780 
    1781     # Display all warnings if -W was not given.
    1782     test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
    1783 
    1784     func_run_hooks func_validate_options ${1+"$@"}
    1785 
    1786     # Bail if the options were screwed!
    1787     $exit_cmd $EXIT_FAILURE
    1788 
    1789     # save modified positional parameters for caller
    1790     func_validate_options_result=$func_run_hooks_result
    1791 }
    1792 
    1793 
    1794 
    1795 ## ----------------- ##
    1796 ## Helper functions. ##
    1797 ## ----------------- ##
    1798 
    1799 # This section contains the helper functions used by the rest of the
    1800 # hookable option parser framework in ascii-betical order.
    1801 
    1802 
    1803 # func_fatal_help ARG...
    1804 # ----------------------
    1805 # Echo program name prefixed message to standard error, followed by
    1806 # a help hint, and exit.
    1807 func_fatal_help ()
    1808 {
    1809     $debug_cmd
    1810 
    1811     eval \$ECHO \""Usage: $usage"\"
    1812     eval \$ECHO \""$fatal_help"\"
    1813     func_error ${1+"$@"}
    1814     exit $EXIT_FAILURE
    1815 }
    1816 
    1817 
    1818 # func_help
    1819 # ---------
    1820 # Echo long help message to standard output and exit.
     701  case $1 in
     702  [0-9]* | *[!a-zA-Z0-9_]*)
     703    func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
     704    ;;
     705  * )
     706    func_tr_sh_result=$1
     707    ;;
     708  esac
     709}
     710
     711
     712# func_version
     713# Echo version message to standard output and exit.
     714func_version ()
     715{
     716    $opt_debug
     717
     718    $SED -n '/(C)/!b go
     719        :more
     720        /\./!{
     721          N
     722          s/\n# / /
     723          b more
     724        }
     725        :go
     726        /^# '$PROGRAM' (GNU /,/# warranty; / {
     727        s/^# //
     728        s/^# *$//
     729        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
     730        p
     731     }' < "$progpath"
     732     exit $?
     733}
     734
     735# func_usage
     736# Echo short help message to standard output and exit.
     737func_usage ()
     738{
     739    $opt_debug
     740
     741    $SED -n '/^# Usage:/,/^#  *.*--help/ {
     742        s/^# //
     743        s/^# *$//
     744        s/\$progname/'$progname'/
     745        p
     746    }' < "$progpath"
     747    echo
     748    $ECHO "run \`$progname --help | more' for full usage"
     749    exit $?
     750}
     751
     752# func_help [NOEXIT]
     753# Echo long help message to standard output and exit,
     754# unless 'noexit' is passed as argument.
    1821755func_help ()
    1822756{
    1823     $debug_cmd
    1824 
    1825     func_usage_message
    1826     $ECHO "$long_help_message"
    1827     exit 0
    1828 }
    1829 
    1830 
    1831 # func_missing_arg ARGNAME
    1832 # ------------------------
     757    $opt_debug
     758
     759    $SED -n '/^# Usage:/,/# Report bugs to/ {
     760        :print
     761        s/^# //
     762        s/^# *$//
     763        s*\$progname*'$progname'*
     764        s*\$host*'"$host"'*
     765        s*\$SHELL*'"$SHELL"'*
     766        s*\$LTCC*'"$LTCC"'*
     767        s*\$LTCFLAGS*'"$LTCFLAGS"'*
     768        s*\$LD*'"$LD"'*
     769        s/\$with_gnu_ld/'"$with_gnu_ld"'/
     770        s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
     771        s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
     772        p
     773        d
     774     }
     775     /^# .* home page:/b print
     776     /^# General help using/b print
     777     ' < "$progpath"
     778    ret=$?
     779    if test -z "$1"; then
     780      exit $ret
     781    fi
     782}
     783
     784# func_missing_arg argname
    1833785# Echo program name prefixed message to standard error and set global
    1834786# exit_cmd.
    1835787func_missing_arg ()
    1836788{
    1837     $debug_cmd
    1838 
    1839     func_error "Missing argument for '$1'."
     789    $opt_debug
     790
     791    func_error "missing argument for $1."
    1840792    exit_cmd=exit
    1841793}
    1842794
    1843795
    1844 # func_split_equals STRING
    1845 # ------------------------
    1846 # Set func_split_equals_lhs and func_split_equals_rhs shell variables after
    1847 # splitting STRING at the '=' sign.
    1848 test -z "$_G_HAVE_XSI_OPS" \
    1849     && (eval 'x=a/b/c;
    1850       test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
    1851     && _G_HAVE_XSI_OPS=yes
    1852 
    1853 if test yes = "$_G_HAVE_XSI_OPS"
    1854 then
    1855   # This is an XSI compatible shell, allowing a faster implementation...
    1856   eval 'func_split_equals ()
    1857   {
    1858       $debug_cmd
    1859 
    1860       func_split_equals_lhs=${1%%=*}
    1861       func_split_equals_rhs=${1#*=}
    1862       test "x$func_split_equals_lhs" = "x$1" \
    1863         && func_split_equals_rhs=
    1864   }'
    1865 else
    1866   # ...otherwise fall back to using expr, which is often a shell builtin.
    1867   func_split_equals ()
    1868   {
    1869       $debug_cmd
    1870 
    1871       func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
    1872       func_split_equals_rhs=
    1873       test "x$func_split_equals_lhs" = "x$1" \
    1874         || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
    1875   }
    1876 fi #func_split_equals
    1877 
    1878 
    1879 # func_split_short_opt SHORTOPT
    1880 # -----------------------------
     796# func_split_short_opt shortopt
    1881797# Set func_split_short_opt_name and func_split_short_opt_arg shell
    1882798# variables after splitting SHORTOPT after the 2nd character.
    1883 if test yes = "$_G_HAVE_XSI_OPS"
    1884 then
    1885   # This is an XSI compatible shell, allowing a faster implementation...
    1886   eval 'func_split_short_opt ()
    1887   {
    1888       $debug_cmd
    1889 
    1890       func_split_short_opt_arg=${1#??}
    1891       func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
    1892   }'
    1893 else
    1894   # ...otherwise fall back to using expr, which is often a shell builtin.
    1895   func_split_short_opt ()
    1896   {
    1897       $debug_cmd
    1898 
    1899       func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
    1900       func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
    1901   }
    1902 fi #func_split_short_opt
    1903 
    1904 
    1905 # func_usage
    1906 # ----------
    1907 # Echo short help message to standard output and exit.
    1908 func_usage ()
    1909 {
    1910     $debug_cmd
    1911 
    1912     func_usage_message
    1913     $ECHO "Run '$progname --help |${PAGER-more}' for full usage"
    1914     exit 0
    1915 }
    1916 
    1917 
    1918 # func_usage_message
    1919 # ------------------
    1920 # Echo short help message to standard output.
    1921 func_usage_message ()
    1922 {
    1923     $debug_cmd
    1924 
    1925     eval \$ECHO \""Usage: $usage"\"
    1926     echo
    1927     $SED -n 's|^# ||
    1928         /^Written by/{
    1929           x;p;x
    1930         }
    1931         h
    1932         /^Written by/q' < "$progpath"
    1933     echo
    1934     eval \$ECHO \""$usage_message"\"
    1935 }
    1936 
    1937 
    1938 # func_version
    1939 # ------------
    1940 # Echo version message to standard output and exit.
    1941 func_version ()
    1942 {
    1943     $debug_cmd
    1944 
    1945     printf '%s\n' "$progname $scriptversion"
    1946     $SED -n '
    1947         /(C)/!b go
    1948         :more
    1949         /\./!{
    1950           N
    1951           s|\n# | |
    1952           b more
    1953         }
    1954         :go
    1955         /^# Written by /,/# warranty; / {
    1956           s|^# ||
    1957           s|^# *$||
    1958           s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
    1959           p
    1960         }
    1961         /^# Written by / {
    1962           s|^# ||
    1963           p
    1964         }
    1965         /^warranty; /q' < "$progpath"
    1966 
    1967     exit $?
    1968 }
    1969 
    1970 
    1971 # Local variables:
    1972 # mode: shell-script
    1973 # sh-indentation: 2
    1974 # eval: (add-hook 'before-save-hook 'time-stamp)
    1975 # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
    1976 # time-stamp-time-zone: "UTC"
    1977 # End:
    1978 
    1979 # Set a version string.
    1980 scriptversion='(GNU libtool) 2.4.6'
    1981 
    1982 
    1983 # func_echo ARG...
    1984 # ----------------
    1985 # Libtool also displays the current mode in messages, so override
    1986 # funclib.sh func_echo with this custom definition.
    1987 func_echo ()
    1988 {
    1989     $debug_cmd
    1990 
    1991     _G_message=$*
    1992 
    1993     func_echo_IFS=$IFS
    1994     IFS=$nl
    1995     for _G_line in $_G_message; do
    1996       IFS=$func_echo_IFS
    1997       $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
    1998     done
    1999     IFS=$func_echo_IFS
    2000 }
    2001 
    2002 
    2003 # func_warning ARG...
    2004 # -------------------
    2005 # Libtool warnings are not categorized, so override funclib.sh
    2006 # func_warning with this simpler definition.
    2007 func_warning ()
    2008 {
    2009     $debug_cmd
    2010 
    2011     $warning_func ${1+"$@"}
    2012 }
    2013 
    2014 
    2015 ## ---------------- ##
    2016 ## Options parsing. ##
    2017 ## ---------------- ##
    2018 
    2019 # Hook in the functions to make sure our own options are parsed during
    2020 # the option parsing loop.
    2021 
    2022 usage='$progpath [OPTION]... [MODE-ARG]...'
    2023 
    2024 # Short help message in response to '-h'.
    2025 usage_message="Options:
    2026        --config             show all configuration variables
    2027        --debug              enable verbose shell tracing
    2028    -n, --dry-run            display commands without modifying any files
    2029        --features           display basic configuration information and exit
    2030        --mode=MODE          use operation mode MODE
    2031        --no-warnings        equivalent to '-Wnone'
    2032        --preserve-dup-deps  don't remove duplicate dependency libraries
    2033        --quiet, --silent    don't print informational messages
    2034        --tag=TAG            use configuration variables from tag TAG
    2035    -v, --verbose            print more informational messages than default
    2036        --version            print version information
    2037    -W, --warnings=CATEGORY  report the warnings falling in CATEGORY [all]
    2038    -h, --help, --help-all   print short, long, or detailed help message
    2039 "
    2040 
    2041 # Additional text appended to 'usage_message' in response to '--help'.
    2042 func_help ()
    2043 {
    2044     $debug_cmd
    2045 
    2046     func_usage_message
    2047     $ECHO "$long_help_message
    2048 
    2049 MODE must be one of the following:
    2050 
    2051        clean           remove files from the build directory
    2052        compile         compile a source file into a libtool object
    2053        execute         automatically set library path, then run a program
    2054        finish          complete the installation of libtool libraries
    2055        install         install libraries or executables
    2056        link            create a library or an executable
    2057        uninstall       remove libraries from an installed directory
    2058 
    2059 MODE-ARGS vary depending on the MODE.  When passed as first option,
    2060 '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
    2061 Try '$progname --help --mode=MODE' for a more detailed description of MODE.
    2062 
    2063 When reporting a bug, please describe a test case to reproduce it and
    2064 include the following information:
    2065 
    2066        host-triplet:   $host
    2067        shell:          $SHELL
    2068        compiler:       $LTCC
    2069        compiler flags: $LTCFLAGS
    2070        linker:         $LD (gnu? $with_gnu_ld)
    2071        version:        $progname (GNU libtool) 2.4.6
    2072        automake:       `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
    2073        autoconf:       `($AUTOCONF --version) 2>/dev/null |$SED 1q`
    2074 
    2075 Report bugs to <bug-libtool@gnu.org>.
    2076 GNU libtool home page: <http://www.gnu.org/s/libtool/>.
    2077 General help using GNU software: <http://www.gnu.org/gethelp/>."
    2078     exit 0
    2079 }
    2080 
    2081 
    2082 # func_lo2o OBJECT-NAME
    2083 # ---------------------
    2084 # Transform OBJECT-NAME from a '.lo' suffix to the platform specific
    2085 # object suffix.
    2086 
    2087 lo2o=s/\\.lo\$/.$objext/
    2088 o2lo=s/\\.$objext\$/.lo/
    2089 
    2090 if test yes = "$_G_HAVE_XSI_OPS"; then
    2091   eval 'func_lo2o ()
    2092   {
    2093     case $1 in
    2094       *.lo) func_lo2o_result=${1%.lo}.$objext ;;
    2095       *   ) func_lo2o_result=$1               ;;
    2096     esac
    2097   }'
    2098 
    2099   # func_xform LIBOBJ-OR-SOURCE
    2100   # ---------------------------
    2101   # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
    2102   # suffix to a '.lo' libtool-object suffix.
    2103   eval 'func_xform ()
    2104   {
    2105     func_xform_result=${1%.*}.lo
    2106   }'
    2107 else
    2108   # ...otherwise fall back to using sed.
    2109   func_lo2o ()
    2110   {
    2111     func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
    2112   }
    2113 
    2114   func_xform ()
    2115   {
    2116     func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
    2117   }
    2118 fi
    2119 
    2120 
    2121 # func_fatal_configuration ARG...
    2122 # -------------------------------
     799func_split_short_opt ()
     800{
     801    my_sed_short_opt='1s/^\(..\).*$/\1/;q'
     802    my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
     803
     804    func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
     805    func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
     806} # func_split_short_opt may be replaced by extended shell implementation
     807
     808
     809# func_split_long_opt longopt
     810# Set func_split_long_opt_name and func_split_long_opt_arg shell
     811# variables after splitting LONGOPT at the `=' sign.
     812func_split_long_opt ()
     813{
     814    my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
     815    my_sed_long_arg='1s/^--[^=]*=//'
     816
     817    func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
     818    func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
     819} # func_split_long_opt may be replaced by extended shell implementation
     820
     821exit_cmd=:
     822
     823
     824
     825
     826
     827magic="%%%MAGIC variable%%%"
     828magic_exe="%%%MAGIC EXE variable%%%"
     829
     830# Global variables.
     831nonopt=
     832preserve_args=
     833lo2o="s/\\.lo\$/.${objext}/"
     834o2lo="s/\\.${objext}\$/.lo/"
     835extracted_archives=
     836extracted_serial=0
     837
     838# If this variable is set in any of the actions, the command in it
     839# will be execed at the end.  This prevents here-documents from being
     840# left over by shells.
     841exec_cmd=
     842
     843# func_append var value
     844# Append VALUE to the end of shell variable VAR.
     845func_append ()
     846{
     847    eval "${1}=\$${1}\${2}"
     848} # func_append may be replaced by extended shell implementation
     849
     850# func_append_quoted var value
     851# Quote VALUE and append to the end of shell variable VAR, separated
     852# by a space.
     853func_append_quoted ()
     854{
     855    func_quote_for_eval "${2}"
     856    eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
     857} # func_append_quoted may be replaced by extended shell implementation
     858
     859
     860# func_arith arithmetic-term...
     861func_arith ()
     862{
     863    func_arith_result=`expr "${@}"`
     864} # func_arith may be replaced by extended shell implementation
     865
     866
     867# func_len string
     868# STRING may not start with a hyphen.
     869func_len ()
     870{
     871    func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
     872} # func_len may be replaced by extended shell implementation
     873
     874
     875# func_lo2o object
     876func_lo2o ()
     877{
     878    func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
     879} # func_lo2o may be replaced by extended shell implementation
     880
     881
     882# func_xform libobj-or-source
     883func_xform ()
     884{
     885    func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
     886} # func_xform may be replaced by extended shell implementation
     887
     888
     889# func_fatal_configuration arg...
    2123890# Echo program name prefixed message to standard error, followed by
    2124891# a configuration failure hint, and exit.
    2125892func_fatal_configuration ()
    2126893{
    2127     func__fatal_error ${1+"$@"} \
    2128       "See the $PACKAGE documentation for more information." \
    2129       "Fatal configuration error."
     894    func_error ${1+"$@"}
     895    func_error "See the $PACKAGE documentation for more information."
     896    func_fatal_error "Fatal configuration error."
    2130897}
    2131898
    2132899
    2133900# func_config
    2134 # -----------
    2135901# Display the configuration for all the tags in this script.
    2136902func_config ()
     
    2150916}
    2151917
    2152 
    2153918# func_features
    2154 # -------------
    2155919# Display the features supported by this script.
    2156920func_features ()
    2157921{
    2158922    echo "host: $host"
    2159     if test yes = "$build_libtool_libs"; then
     923    if test "$build_libtool_libs" = yes; then
    2160924      echo "enable shared libraries"
    2161925    else
    2162926      echo "disable shared libraries"
    2163927    fi
    2164     if test yes = "$build_old_libs"; then
     928    if test "$build_old_libs" = yes; then
    2165929      echo "enable static libraries"
    2166930    else
     
    2171935}
    2172936
    2173 
    2174 # func_enable_tag TAGNAME
    2175 # -----------------------
     937# func_enable_tag tagname
    2176938# Verify that TAGNAME is valid, and either flag an error and exit, or
    2177939# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
     
    2179941func_enable_tag ()
    2180942{
    2181     # Global variable:
    2182     tagname=$1
    2183 
    2184     re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
    2185     re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
    2186     sed_extractcf=/$re_begincf/,/$re_endcf/p
    2187 
    2188     # Validate tagname.
    2189     case $tagname in
    2190       *[!-_A-Za-z0-9,/]*)
    2191         func_fatal_error "invalid tag name: $tagname"
    2192         ;;
    2193     esac
    2194 
    2195     # Don't test for the "default" C tag, as we know it's
    2196     # there but not specially marked.
    2197     case $tagname in
    2198         CC) ;;
     943  # Global variable:
     944  tagname="$1"
     945
     946  re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
     947  re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
     948  sed_extractcf="/$re_begincf/,/$re_endcf/p"
     949
     950  # Validate tagname.
     951  case $tagname in
     952    *[!-_A-Za-z0-9,/]*)
     953      func_fatal_error "invalid tag name: $tagname"
     954      ;;
     955  esac
     956
     957  # Don't test for the "default" C tag, as we know it's
     958  # there but not specially marked.
     959  case $tagname in
     960    CC) ;;
    2199961    *)
    2200         if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
    2201           taglist="$taglist $tagname"
    2202 
    2203           # Evaluate the configuration.  Be careful to quote the path
    2204           # and the sed script, to avoid splitting on whitespace, but
    2205           # also don't use non-portable quotes within backquotes within
    2206           # quotes we have to do it in 2 steps:
    2207           extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
    2208           eval "$extractedcf"
    2209         else
    2210           func_error "ignoring unknown tag $tagname"
    2211         fi
    2212         ;;
    2213     esac
    2214 }
    2215 
     962      if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
     963        taglist="$taglist $tagname"
     964
     965        # Evaluate the configuration.  Be careful to quote the path
     966        # and the sed script, to avoid splitting on whitespace, but
     967        # also don't use non-portable quotes within backquotes within
     968        # quotes we have to do it in 2 steps:
     969        extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
     970        eval "$extractedcf"
     971      else
     972        func_error "ignoring unknown tag $tagname"
     973      fi
     974      ;;
     975  esac
     976}
    2216977
    2217978# func_check_version_match
    2218 # ------------------------
    2219979# Ensure that we are using m4 macros, and libtool script from the same
    2220980# release of libtool.
    2221981func_check_version_match ()
    2222982{
    2223     if test "$package_revision" != "$macro_revision"; then
    2224       if test "$VERSION" != "$macro_version"; then
    2225         if test -z "$macro_version"; then
    2226           cat >&2 <<_LT_EOF
     983  if test "$package_revision" != "$macro_revision"; then
     984    if test "$VERSION" != "$macro_version"; then
     985      if test -z "$macro_version"; then
     986        cat >&2 <<_LT_EOF
    2227987$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
    2228988$progname: definition of this LT_INIT comes from an older release.
     
    2230990$progname: and run autoconf again.
    2231991_LT_EOF
    2232         else
    2233           cat >&2 <<_LT_EOF
     992      else
     993        cat >&2 <<_LT_EOF
    2234994$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
    2235995$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
     
    2237997$progname: and run autoconf again.
    2238998_LT_EOF
    2239         fi
    2240       else
    2241         cat >&2 <<_LT_EOF
     999      fi
     1000    else
     1001      cat >&2 <<_LT_EOF
    22421002$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
    22431003$progname: but the definition of this LT_INIT comes from revision $macro_revision.
     
    22451005$progname: of $PACKAGE $VERSION and run autoconf again.
    22461006_LT_EOF
    2247       fi
    2248 
    2249       exit $EXIT_MISMATCH
    22501007    fi
    2251 }
    2252 
    2253 
    2254 # libtool_options_prep [ARG]...
    2255 # -----------------------------
    2256 # Preparation for options parsed by libtool.
    2257 libtool_options_prep ()
    2258 {
    2259     $debug_mode
    2260 
    2261     # Option defaults:
    2262     opt_config=false
    2263     opt_dlopen=
    2264     opt_dry_run=false
    2265     opt_help=false
    2266     opt_mode=
    2267     opt_preserve_dup_deps=false
    2268     opt_quiet=false
    2269 
    2270     nonopt=
    2271     preserve_args=
    2272 
    2273     # Shorthand for --mode=foo, only valid as the first argument
    2274     case $1 in
    2275     clean|clea|cle|cl)
    2276       shift; set dummy --mode clean ${1+"$@"}; shift
     1008
     1009    exit $EXIT_MISMATCH
     1010  fi
     1011}
     1012
     1013
     1014# Shorthand for --mode=foo, only valid as the first argument
     1015case $1 in
     1016clean|clea|cle|cl)
     1017  shift; set dummy --mode clean ${1+"$@"}; shift
     1018  ;;
     1019compile|compil|compi|comp|com|co|c)
     1020  shift; set dummy --mode compile ${1+"$@"}; shift
     1021  ;;
     1022execute|execut|execu|exec|exe|ex|e)
     1023  shift; set dummy --mode execute ${1+"$@"}; shift
     1024  ;;
     1025finish|finis|fini|fin|fi|f)
     1026  shift; set dummy --mode finish ${1+"$@"}; shift
     1027  ;;
     1028install|instal|insta|inst|ins|in|i)
     1029  shift; set dummy --mode install ${1+"$@"}; shift
     1030  ;;
     1031link|lin|li|l)
     1032  shift; set dummy --mode link ${1+"$@"}; shift
     1033  ;;
     1034uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
     1035  shift; set dummy --mode uninstall ${1+"$@"}; shift
     1036  ;;
     1037esac
     1038
     1039
     1040
     1041# Option defaults:
     1042opt_debug=:
     1043opt_dry_run=false
     1044opt_config=false
     1045opt_preserve_dup_deps=false
     1046opt_features=false
     1047opt_finish=false
     1048opt_help=false
     1049opt_help_all=false
     1050opt_silent=:
     1051opt_warning=:
     1052opt_verbose=:
     1053opt_silent=false
     1054opt_verbose=false
     1055
     1056
     1057# Parse options once, thoroughly.  This comes as soon as possible in the
     1058# script to make things like `--version' happen as quickly as we can.
     1059{
     1060  # this just eases exit handling
     1061  while test $# -gt 0; do
     1062    opt="$1"
     1063    shift
     1064    case $opt in
     1065      --debug|-x)       opt_debug='set -x'
     1066                        func_echo "enabling shell trace mode"
     1067                        $opt_debug
     1068                        ;;
     1069      --dry-run|--dryrun|-n)
     1070                        opt_dry_run=:
     1071                        ;;
     1072      --config)
     1073                        opt_config=:
     1074func_config
     1075                        ;;
     1076      --dlopen|-dlopen)
     1077                        optarg="$1"
     1078                        opt_dlopen="${opt_dlopen+$opt_dlopen
     1079}$optarg"
     1080                        shift
     1081                        ;;
     1082      --preserve-dup-deps)
     1083                        opt_preserve_dup_deps=:
     1084                        ;;
     1085      --features)
     1086                        opt_features=:
     1087func_features
     1088                        ;;
     1089      --finish)
     1090                        opt_finish=:
     1091set dummy --mode finish ${1+"$@"}; shift
     1092                        ;;
     1093      --help)
     1094                        opt_help=:
     1095                        ;;
     1096      --help-all)
     1097                        opt_help_all=:
     1098opt_help=': help-all'
     1099                        ;;
     1100      --mode)
     1101                        test $# = 0 && func_missing_arg $opt && break
     1102                        optarg="$1"
     1103                        opt_mode="$optarg"
     1104case $optarg in
     1105  # Valid mode arguments:
     1106  clean|compile|execute|finish|install|link|relink|uninstall) ;;
     1107
     1108  # Catch anything else as an error
     1109  *) func_error "invalid argument for $opt"
     1110     exit_cmd=exit
     1111     break
     1112     ;;
     1113esac
     1114                        shift
     1115                        ;;
     1116      --no-silent|--no-quiet)
     1117                        opt_silent=false
     1118func_append preserve_args " $opt"
     1119                        ;;
     1120      --no-warning|--no-warn)
     1121                        opt_warning=false
     1122func_append preserve_args " $opt"
     1123                        ;;
     1124      --no-verbose)
     1125                        opt_verbose=false
     1126func_append preserve_args " $opt"
     1127                        ;;
     1128      --silent|--quiet)
     1129                        opt_silent=:
     1130func_append preserve_args " $opt"
     1131        opt_verbose=false
     1132                        ;;
     1133      --verbose|-v)
     1134                        opt_verbose=:
     1135func_append preserve_args " $opt"
     1136opt_silent=false
     1137                        ;;
     1138      --tag)
     1139                        test $# = 0 && func_missing_arg $opt && break
     1140                        optarg="$1"
     1141                        opt_tag="$optarg"
     1142func_append preserve_args " $opt $optarg"
     1143func_enable_tag "$optarg"
     1144                        shift
     1145                        ;;
     1146
     1147      -\?|-h)           func_usage                              ;;
     1148      --help)           func_help                               ;;
     1149      --version)        func_version                            ;;
     1150
     1151      # Separate optargs to long options:
     1152      --*=*)
     1153                        func_split_long_opt "$opt"
     1154                        set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
     1155                        shift
     1156                        ;;
     1157
     1158      # Separate non-argument short options:
     1159      -\?*|-h*|-n*|-v*)
     1160                        func_split_short_opt "$opt"
     1161                        set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
     1162                        shift
     1163                        ;;
     1164
     1165      --)               break                                   ;;
     1166      -*)               func_fatal_help "unrecognized option \`$opt'" ;;
     1167      *)                set dummy "$opt" ${1+"$@"};     shift; break  ;;
     1168    esac
     1169  done
     1170
     1171  # Validate options:
     1172
     1173  # save first non-option argument
     1174  if test "$#" -gt 0; then
     1175    nonopt="$opt"
     1176    shift
     1177  fi
     1178
     1179  # preserve --debug
     1180  test "$opt_debug" = : || func_append preserve_args " --debug"
     1181
     1182  case $host in
     1183    *cygwin* | *mingw* | *pw32* | *cegcc*)
     1184      # don't eliminate duplications in $postdeps and $predeps
     1185      opt_duplicate_compiler_generated_deps=:
    22771186      ;;
    2278     compile|compil|compi|comp|com|co|c)
    2279       shift; set dummy --mode compile ${1+"$@"}; shift
     1187    *)
     1188      opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
    22801189      ;;
    2281     execute|execut|execu|exec|exe|ex|e)
    2282       shift; set dummy --mode execute ${1+"$@"}; shift
    2283       ;;
    2284     finish|finis|fini|fin|fi|f)
    2285       shift; set dummy --mode finish ${1+"$@"}; shift
    2286       ;;
    2287     install|instal|insta|inst|ins|in|i)
    2288       shift; set dummy --mode install ${1+"$@"}; shift
    2289       ;;
    2290     link|lin|li|l)
    2291       shift; set dummy --mode link ${1+"$@"}; shift
    2292       ;;
    2293     uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
    2294       shift; set dummy --mode uninstall ${1+"$@"}; shift
    2295       ;;
    2296     esac
    2297 
    2298     # Pass back the list of options.
    2299     func_quote_for_eval ${1+"$@"}
    2300     libtool_options_prep_result=$func_quote_for_eval_result
    2301 }
    2302 func_add_hook func_options_prep libtool_options_prep
    2303 
    2304 
    2305 # libtool_parse_options [ARG]...
    2306 # ---------------------------------
    2307 # Provide handling for libtool specific options.
    2308 libtool_parse_options ()
    2309 {
    2310     $debug_cmd
    2311 
    2312     # Perform our own loop to consume as many options as possible in
    2313     # each iteration.
    2314     while test $# -gt 0; do
    2315       _G_opt=$1
    2316       shift
    2317       case $_G_opt in
    2318         --dry-run|--dryrun|-n)
    2319                         opt_dry_run=:
    2320                         ;;
    2321 
    2322         --config)       func_config ;;
    2323 
    2324         --dlopen|-dlopen)
    2325                         opt_dlopen="${opt_dlopen+$opt_dlopen
    2326 }$1"
    2327                         shift
    2328                         ;;
    2329 
    2330         --preserve-dup-deps)
    2331                         opt_preserve_dup_deps=: ;;
    2332 
    2333         --features)     func_features ;;
    2334 
    2335         --finish)       set dummy --mode finish ${1+"$@"}; shift ;;
    2336 
    2337         --help)         opt_help=: ;;
    2338 
    2339         --help-all)     opt_help=': help-all' ;;
    2340 
    2341         --mode)         test $# = 0 && func_missing_arg $_G_opt && break
    2342                         opt_mode=$1
    2343                         case $1 in
    2344                           # Valid mode arguments:
    2345                           clean|compile|execute|finish|install|link|relink|uninstall) ;;
    2346 
    2347                           # Catch anything else as an error
    2348                           *) func_error "invalid argument for $_G_opt"
    2349                              exit_cmd=exit
    2350                              break
    2351                              ;;
    2352                         esac
    2353                         shift
    2354                         ;;
    2355 
    2356         --no-silent|--no-quiet)
    2357                         opt_quiet=false
    2358                         func_append preserve_args " $_G_opt"
    2359                         ;;
    2360 
    2361         --no-warnings|--no-warning|--no-warn)
    2362                         opt_warning=false
    2363                         func_append preserve_args " $_G_opt"
    2364                         ;;
    2365 
    2366         --no-verbose)
    2367                         opt_verbose=false
    2368                         func_append preserve_args " $_G_opt"
    2369                         ;;
    2370 
    2371         --silent|--quiet)
    2372                         opt_quiet=:
    2373                         opt_verbose=false
    2374                         func_append preserve_args " $_G_opt"
    2375                         ;;
    2376 
    2377         --tag)          test $# = 0 && func_missing_arg $_G_opt && break
    2378                         opt_tag=$1
    2379                         func_append preserve_args " $_G_opt $1"
    2380                         func_enable_tag "$1"
    2381                         shift
    2382                         ;;
    2383 
    2384         --verbose|-v)   opt_quiet=false
    2385                         opt_verbose=:
    2386                         func_append preserve_args " $_G_opt"
    2387                         ;;
    2388 
    2389         # An option not handled by this hook function:
    2390         *)              set dummy "$_G_opt" ${1+"$@"};  shift; break  ;;
    2391       esac
    2392     done
    2393 
    2394 
    2395     # save modified positional parameters for caller
    2396     func_quote_for_eval ${1+"$@"}
    2397     libtool_parse_options_result=$func_quote_for_eval_result
    2398 }
    2399 func_add_hook func_parse_options libtool_parse_options
    2400 
    2401 
    2402 
    2403 # libtool_validate_options [ARG]...
    2404 # ---------------------------------
    2405 # Perform any sanity checks on option settings and/or unconsumed
    2406 # arguments.
    2407 libtool_validate_options ()
    2408 {
    2409     # save first non-option argument
    2410     if test 0 -lt $#; then
    2411       nonopt=$1
    2412       shift
     1190  esac
     1191
     1192  $opt_help || {
     1193    # Sanity checks first:
     1194    func_check_version_match
     1195
     1196    if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
     1197      func_fatal_configuration "not configured to build any kind of library"
    24131198    fi
    24141199
    2415     # preserve --debug
    2416     test : = "$debug_cmd" || func_append preserve_args " --debug"
    2417 
    2418     case $host in
    2419       # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
    2420       # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
    2421       *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
    2422         # don't eliminate duplications in $postdeps and $predeps
    2423         opt_duplicate_compiler_generated_deps=:
    2424         ;;
    2425       *)
    2426         opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
    2427         ;;
    2428     esac
    2429 
    2430     $opt_help || {
    2431       # Sanity checks first:
    2432       func_check_version_match
    2433 
    2434       test yes != "$build_libtool_libs" \
    2435         && test yes != "$build_old_libs" \
    2436         && func_fatal_configuration "not configured to build any kind of library"
    2437 
    2438       # Darwin sucks
    2439       eval std_shrext=\"$shrext_cmds\"
    2440 
    2441       # Only execute mode is allowed to have -dlopen flags.
    2442       if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
    2443         func_error "unrecognized option '-dlopen'"
    2444         $ECHO "$help" 1>&2
    2445         exit $EXIT_FAILURE
    2446       fi
    2447 
    2448       # Change the help message to a mode-specific one.
    2449       generic_help=$help
    2450       help="Try '$progname --help --mode=$opt_mode' for more information."
    2451     }
    2452 
    2453     # Pass back the unparsed argument list
    2454     func_quote_for_eval ${1+"$@"}
    2455     libtool_validate_options_result=$func_quote_for_eval_result
    2456 }
    2457 func_add_hook func_validate_options libtool_validate_options
    2458 
    2459 
    2460 # Process options as early as possible so that --help and --version
    2461 # can return quickly.
    2462 func_options ${1+"$@"}
    2463 eval set dummy "$func_options_result"; shift
     1200    # Darwin sucks
     1201    eval std_shrext=\"$shrext_cmds\"
     1202
     1203    # Only execute mode is allowed to have -dlopen flags.
     1204    if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
     1205      func_error "unrecognized option \`-dlopen'"
     1206      $ECHO "$help" 1>&2
     1207      exit $EXIT_FAILURE
     1208    fi
     1209
     1210    # Change the help message to a mode-specific one.
     1211    generic_help="$help"
     1212    help="Try \`$progname --help --mode=$opt_mode' for more information."
     1213  }
     1214
     1215
     1216  # Bail if the options were screwed
     1217  $exit_cmd $EXIT_FAILURE
     1218}
     1219
    24641220
    24651221
     
    24691225## ----------- ##
    24701226
    2471 magic='%%%MAGIC variable%%%'
    2472 magic_exe='%%%MAGIC EXE variable%%%'
    2473 
    2474 # Global variables.
    2475 extracted_archives=
    2476 extracted_serial=0
    2477 
    2478 # If this variable is set in any of the actions, the command in it
    2479 # will be execed at the end.  This prevents here-documents from being
    2480 # left over by shells.
    2481 exec_cmd=
    2482 
    2483 
    2484 # A function that is used when there is no print builtin or printf.
    2485 func_fallback_echo ()
    2486 {
    2487   eval 'cat <<_LTECHO_EOF
    2488 $1
    2489 _LTECHO_EOF'
    2490 }
    2491 
    2492 # func_generated_by_libtool
    2493 # True iff stdin has been generated by Libtool. This function is only
    2494 # a basic sanity check; it will hardly flush out determined imposters.
    2495 func_generated_by_libtool_p ()
    2496 {
    2497   $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
    2498 }
    2499 
    25001227# func_lalib_p file
    2501 # True iff FILE is a libtool '.la' library or '.lo' object file.
     1228# True iff FILE is a libtool `.la' library or `.lo' object file.
    25021229# This function is only a basic sanity check; it will hardly flush out
    25031230# determined imposters.
     
    25051232{
    25061233    test -f "$1" &&
    2507       $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p
     1234      $SED -e 4q "$1" 2>/dev/null \
     1235        | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
    25081236}
    25091237
    25101238# func_lalib_unsafe_p file
    2511 # True iff FILE is a libtool '.la' library or '.lo' object file.
     1239# True iff FILE is a libtool `.la' library or `.lo' object file.
    25121240# This function implements the same check as func_lalib_p without
    25131241# resorting to external programs.  To this end, it redirects stdin and
    25141242# closes it afterwards, without saving the original file descriptor.
    25151243# As a safety measure, use it only where a negative result would be
    2516 # fatal anyway.  Works if 'file' does not exist.
     1244# fatal anyway.  Works if `file' does not exist.
    25171245func_lalib_unsafe_p ()
    25181246{
     
    25221250        do
    25231251            read lalib_p_line
    2524             case $lalib_p_line in
     1252            case "$lalib_p_line" in
    25251253                \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
    25261254            esac
     
    25281256        exec 0<&5 5<&-
    25291257    fi
    2530     test yes = "$lalib_p"
     1258    test "$lalib_p" = yes
    25311259}
    25321260
     
    25371265func_ltwrapper_script_p ()
    25381266{
    2539     test -f "$1" &&
    2540       $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p
     1267    func_lalib_p "$1"
    25411268}
    25421269
     
    25631290    func_dirname_and_basename "$1" "" "."
    25641291    func_stripname '' '.exe' "$func_basename_result"
    2565     func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
     1292    func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
    25661293}
    25671294
     
    25821309func_execute_cmds ()
    25831310{
    2584     $debug_cmd
    2585 
     1311    $opt_debug
    25861312    save_ifs=$IFS; IFS='~'
    25871313    for cmd in $1; do
    2588       IFS=$sp$nl
     1314      IFS=$save_ifs
    25891315      eval cmd=\"$cmd\"
    2590       IFS=$save_ifs
    25911316      func_show_eval "$cmd" "${2-:}"
    25921317    done
     
    26001325# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
    26011326# behavior happens only for exec(3), not for open(2)!  Also, sourcing
    2602 # 'FILE.' does not work on cygwin managed mounts.
     1327# `FILE.' does not work on cygwin managed mounts.
    26031328func_source ()
    26041329{
    2605     $debug_cmd
    2606 
     1330    $opt_debug
    26071331    case $1 in
    26081332    */* | *\\*) . "$1" ;;
     
    26311355func_replace_sysroot ()
    26321356{
    2633   case $lt_sysroot:$1 in
     1357  case "$lt_sysroot:$1" in
    26341358  ?*:"$lt_sysroot"*)
    26351359    func_stripname "$lt_sysroot" '' "$1"
    2636     func_replace_sysroot_result='='$func_stripname_result
     1360    func_replace_sysroot_result="=$func_stripname_result"
    26371361    ;;
    26381362  *)
     
    26511375func_infer_tag ()
    26521376{
    2653     $debug_cmd
    2654 
     1377    $opt_debug
    26551378    if test -n "$available_tags" && test -z "$tagname"; then
    26561379      CC_quoted=
     
    26711394          if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
    26721395            # Evaluate the configuration.
    2673             eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
     1396            eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
    26741397            CC_quoted=
    26751398            for arg in $CC; do
     
    26961419        if test -z "$tagname"; then
    26971420          func_echo "unable to infer tagged configuration"
    2698           func_fatal_error "specify a tag with '--tag'"
     1421          func_fatal_error "specify a tag with \`--tag'"
    26991422#       else
    27001423#         func_verbose "using $tagname tagged configuration"
     
    27121435func_write_libtool_object ()
    27131436{
    2714     write_libobj=$1
    2715     if test yes = "$build_libtool_libs"; then
    2716       write_lobj=\'$2\'
     1437    write_libobj=${1}
     1438    if test "$build_libtool_libs" = yes; then
     1439      write_lobj=\'${2}\'
    27171440    else
    27181441      write_lobj=none
    27191442    fi
    27201443
    2721     if test yes = "$build_old_libs"; then
    2722       write_oldobj=\'$3\'
     1444    if test "$build_old_libs" = yes; then
     1445      write_oldobj=\'${3}\'
    27231446    else
    27241447      write_oldobj=none
     
    27281451      cat >${write_libobj}T <<EOF
    27291452# $write_libobj - a libtool object file
    2730 # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
     1453# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
    27311454#
    27321455# Please DO NOT delete this file!
     
    27401463
    27411464EOF
    2742       $MV "${write_libobj}T" "$write_libobj"
     1465      $MV "${write_libobj}T" "${write_libobj}"
    27431466    }
    27441467}
     
    27601483func_convert_core_file_wine_to_w32 ()
    27611484{
    2762   $debug_cmd
    2763 
    2764   func_convert_core_file_wine_to_w32_result=$1
     1485  $opt_debug
     1486  func_convert_core_file_wine_to_w32_result="$1"
    27651487  if test -n "$1"; then
    27661488    # Unfortunately, winepath does not exit with a non-zero error code, so we
     
    27701492    # zero AND non-empty stdout, which explains the odd construction:
    27711493    func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
    2772     if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
     1494    if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
    27731495      func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
    2774         $SED -e "$sed_naive_backslashify"`
     1496        $SED -e "$lt_sed_naive_backslashify"`
    27751497    else
    27761498      func_convert_core_file_wine_to_w32_result=
     
    27931515func_convert_core_path_wine_to_w32 ()
    27941516{
    2795   $debug_cmd
    2796 
     1517  $opt_debug
    27971518  # unfortunately, winepath doesn't convert paths, only file names
    2798   func_convert_core_path_wine_to_w32_result=
     1519  func_convert_core_path_wine_to_w32_result=""
    27991520  if test -n "$1"; then
    28001521    oldIFS=$IFS
     
    28031524      IFS=$oldIFS
    28041525      func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
    2805       if test -n "$func_convert_core_file_wine_to_w32_result"; then
     1526      if test -n "$func_convert_core_file_wine_to_w32_result" ; then
    28061527        if test -z "$func_convert_core_path_wine_to_w32_result"; then
    2807           func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
     1528          func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
    28081529        else
    28091530          func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
     
    28341555func_cygpath ()
    28351556{
    2836   $debug_cmd
    2837 
     1557  $opt_debug
    28381558  if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
    28391559    func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
     
    28441564  else
    28451565    func_cygpath_result=
    2846     func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
     1566    func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
    28471567  fi
    28481568}
     
    28551575func_convert_core_msys_to_w32 ()
    28561576{
    2857   $debug_cmd
    2858 
     1577  $opt_debug
    28591578  # awkward: cmd appends spaces to result
    28601579  func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
    2861     $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
     1580    $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
    28621581}
    28631582#end: func_convert_core_msys_to_w32
     
    28701589func_convert_file_check ()
    28711590{
    2872   $debug_cmd
    2873 
    2874   if test -z "$2" && test -n "$1"; then
     1591  $opt_debug
     1592  if test -z "$2" && test -n "$1" ; then
    28751593    func_error "Could not determine host file name corresponding to"
    2876     func_error "  '$1'"
     1594    func_error "  \`$1'"
    28771595    func_error "Continuing, but uninstalled executables may not work."
    28781596    # Fallback:
    2879     func_to_host_file_result=$1
     1597    func_to_host_file_result="$1"
    28801598  fi
    28811599}
     
    28891607func_convert_path_check ()
    28901608{
    2891   $debug_cmd
    2892 
     1609  $opt_debug
    28931610  if test -z "$4" && test -n "$3"; then
    28941611    func_error "Could not determine the host path corresponding to"
    2895     func_error "  '$3'"
     1612    func_error "  \`$3'"
    28961613    func_error "Continuing, but uninstalled executables may not work."
    28971614    # Fallback.  This is a deliberately simplistic "conversion" and
     
    29021619        $SED -e "$lt_replace_pathsep_chars"`
    29031620    else
    2904       func_to_host_path_result=$3
     1621      func_to_host_path_result="$3"
    29051622    fi
    29061623  fi
     
    29141631func_convert_path_front_back_pathsep ()
    29151632{
    2916   $debug_cmd
    2917 
     1633  $opt_debug
    29181634  case $4 in
    2919   $1 ) func_to_host_path_result=$3$func_to_host_path_result
     1635  $1 ) func_to_host_path_result="$3$func_to_host_path_result"
    29201636    ;;
    29211637  esac
     
    29311647# $build to $host FILE NAME CONVERSION FUNCTIONS #
    29321648##################################################
    2933 # invoked via '$to_host_file_cmd ARG'
     1649# invoked via `$to_host_file_cmd ARG'
    29341650#
    29351651# In each case, ARG is the path to be converted from $build to $host format.
     
    29421658func_to_host_file ()
    29431659{
    2944   $debug_cmd
    2945 
     1660  $opt_debug
    29461661  $to_host_file_cmd "$1"
    29471662}
     
    29551670func_to_tool_file ()
    29561671{
    2957   $debug_cmd
    2958 
     1672  $opt_debug
    29591673  case ,$2, in
    29601674    *,"$to_tool_file_cmd",*)
     
    29741688func_convert_file_noop ()
    29751689{
    2976   func_to_host_file_result=$1
     1690  func_to_host_file_result="$1"
    29771691}
    29781692# end func_convert_file_noop
     
    29851699func_convert_file_msys_to_w32 ()
    29861700{
    2987   $debug_cmd
    2988 
    2989   func_to_host_file_result=$1
     1701  $opt_debug
     1702  func_to_host_file_result="$1"
    29901703  if test -n "$1"; then
    29911704    func_convert_core_msys_to_w32 "$1"
    2992     func_to_host_file_result=$func_convert_core_msys_to_w32_result
     1705    func_to_host_file_result="$func_convert_core_msys_to_w32_result"
    29931706  fi
    29941707  func_convert_file_check "$1" "$func_to_host_file_result"
     
    30021715func_convert_file_cygwin_to_w32 ()
    30031716{
    3004   $debug_cmd
    3005 
    3006   func_to_host_file_result=$1
     1717  $opt_debug
     1718  func_to_host_file_result="$1"
    30071719  if test -n "$1"; then
    30081720    # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
     
    30201732func_convert_file_nix_to_w32 ()
    30211733{
    3022   $debug_cmd
    3023 
    3024   func_to_host_file_result=$1
     1734  $opt_debug
     1735  func_to_host_file_result="$1"
    30251736  if test -n "$1"; then
    30261737    func_convert_core_file_wine_to_w32 "$1"
    3027     func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
     1738    func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
    30281739  fi
    30291740  func_convert_file_check "$1" "$func_to_host_file_result"
     
    30371748func_convert_file_msys_to_cygwin ()
    30381749{
    3039   $debug_cmd
    3040 
    3041   func_to_host_file_result=$1
     1750  $opt_debug
     1751  func_to_host_file_result="$1"
    30421752  if test -n "$1"; then
    30431753    func_convert_core_msys_to_w32 "$1"
    30441754    func_cygpath -u "$func_convert_core_msys_to_w32_result"
    3045     func_to_host_file_result=$func_cygpath_result
     1755    func_to_host_file_result="$func_cygpath_result"
    30461756  fi
    30471757  func_convert_file_check "$1" "$func_to_host_file_result"
     
    30561766func_convert_file_nix_to_cygwin ()
    30571767{
    3058   $debug_cmd
    3059 
    3060   func_to_host_file_result=$1
     1768  $opt_debug
     1769  func_to_host_file_result="$1"
    30611770  if test -n "$1"; then
    30621771    # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
    30631772    func_convert_core_file_wine_to_w32 "$1"
    30641773    func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
    3065     func_to_host_file_result=$func_cygpath_result
     1774    func_to_host_file_result="$func_cygpath_result"
    30661775  fi
    30671776  func_convert_file_check "$1" "$func_to_host_file_result"
     
    30731782# $build to $host PATH CONVERSION FUNCTIONS #
    30741783#############################################
    3075 # invoked via '$to_host_path_cmd ARG'
     1784# invoked via `$to_host_path_cmd ARG'
    30761785#
    30771786# In each case, ARG is the path to be converted from $build to $host format.
     
    30971806func_init_to_host_path_cmd ()
    30981807{
    3099   $debug_cmd
    3100 
     1808  $opt_debug
    31011809  if test -z "$to_host_path_cmd"; then
    31021810    func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
    3103     to_host_path_cmd=func_convert_path_$func_stripname_result
     1811    to_host_path_cmd="func_convert_path_${func_stripname_result}"
    31041812  fi
    31051813}
     
    31111819func_to_host_path ()
    31121820{
    3113   $debug_cmd
    3114 
     1821  $opt_debug
    31151822  func_init_to_host_path_cmd
    31161823  $to_host_path_cmd "$1"
     
    31231830func_convert_path_noop ()
    31241831{
    3125   func_to_host_path_result=$1
     1832  func_to_host_path_result="$1"
    31261833}
    31271834# end func_convert_path_noop
     
    31341841func_convert_path_msys_to_w32 ()
    31351842{
    3136   $debug_cmd
    3137 
    3138   func_to_host_path_result=$1
     1843  $opt_debug
     1844  func_to_host_path_result="$1"
    31391845  if test -n "$1"; then
    31401846    # Remove leading and trailing path separator characters from ARG.  MSYS
     
    31441850    func_to_host_path_tmp1=$func_stripname_result
    31451851    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
    3146     func_to_host_path_result=$func_convert_core_msys_to_w32_result
     1852    func_to_host_path_result="$func_convert_core_msys_to_w32_result"
    31471853    func_convert_path_check : ";" \
    31481854      "$func_to_host_path_tmp1" "$func_to_host_path_result"
     
    31581864func_convert_path_cygwin_to_w32 ()
    31591865{
    3160   $debug_cmd
    3161 
    3162   func_to_host_path_result=$1
     1866  $opt_debug
     1867  func_to_host_path_result="$1"
    31631868  if test -n "$1"; then
    31641869    # See func_convert_path_msys_to_w32:
     
    31791884func_convert_path_nix_to_w32 ()
    31801885{
    3181   $debug_cmd
    3182 
    3183   func_to_host_path_result=$1
     1886  $opt_debug
     1887  func_to_host_path_result="$1"
    31841888  if test -n "$1"; then
    31851889    # See func_convert_path_msys_to_w32:
     
    31871891    func_to_host_path_tmp1=$func_stripname_result
    31881892    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
    3189     func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
     1893    func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
    31901894    func_convert_path_check : ";" \
    31911895      "$func_to_host_path_tmp1" "$func_to_host_path_result"
     
    32011905func_convert_path_msys_to_cygwin ()
    32021906{
    3203   $debug_cmd
    3204 
    3205   func_to_host_path_result=$1
     1907  $opt_debug
     1908  func_to_host_path_result="$1"
    32061909  if test -n "$1"; then
    32071910    # See func_convert_path_msys_to_w32:
     
    32101913    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
    32111914    func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
    3212     func_to_host_path_result=$func_cygpath_result
     1915    func_to_host_path_result="$func_cygpath_result"
    32131916    func_convert_path_check : : \
    32141917      "$func_to_host_path_tmp1" "$func_to_host_path_result"
     
    32251928func_convert_path_nix_to_cygwin ()
    32261929{
    3227   $debug_cmd
    3228 
    3229   func_to_host_path_result=$1
     1930  $opt_debug
     1931  func_to_host_path_result="$1"
    32301932  if test -n "$1"; then
    32311933    # Remove leading and trailing path separator characters from
     
    32361938    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
    32371939    func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
    3238     func_to_host_path_result=$func_cygpath_result
     1940    func_to_host_path_result="$func_cygpath_result"
    32391941    func_convert_path_check : : \
    32401942      "$func_to_host_path_tmp1" "$func_to_host_path_result"
     
    32451947
    32461948
    3247 # func_dll_def_p FILE
    3248 # True iff FILE is a Windows DLL '.def' file.
    3249 # Keep in sync with _LT_DLL_DEF_P in libtool.m4
    3250 func_dll_def_p ()
    3251 {
    3252   $debug_cmd
    3253 
    3254   func_dll_def_p_tmp=`$SED -n \
    3255     -e 's/^[     ]*//' \
    3256     -e '/^\(;.*\)*$/d' \
    3257     -e 's/^\(EXPORTS\|LIBRARY\)\([       ].*\)*$/DEF/p' \
    3258     -e q \
    3259     "$1"`
    3260   test DEF = "$func_dll_def_p_tmp"
    3261 }
    3262 
    3263 
    32641949# func_mode_compile arg...
    32651950func_mode_compile ()
    32661951{
    3267     $debug_cmd
    3268 
     1952    $opt_debug
    32691953    # Get the compilation command and the source file.
    32701954    base_compile=
    3271     srcfile=$nonopt  #  always keep a non-empty value in "srcfile"
     1955    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
    32721956    suppress_opt=yes
    32731957    suppress_output=
     
    32821966      arg  )
    32831967        # do not "continue".  Instead, add this to base_compile
    3284         lastarg=$arg
     1968        lastarg="$arg"
    32851969        arg_mode=normal
    32861970        ;;
    32871971
    32881972      target )
    3289         libobj=$arg
     1973        libobj="$arg"
    32901974        arg_mode=normal
    32911975        continue
     
    32971981        -o)
    32981982          test -n "$libobj" && \
    3299             func_fatal_error "you cannot specify '-o' more than once"
     1983            func_fatal_error "you cannot specify \`-o' more than once"
    33001984          arg_mode=target
    33011985          continue
     
    33262010          args=$func_stripname_result
    33272011          lastarg=
    3328           save_ifs=$IFS; IFS=,
     2012          save_ifs="$IFS"; IFS=','
    33292013          for arg in $args; do
    3330             IFS=$save_ifs
     2014            IFS="$save_ifs"
    33312015            func_append_quoted lastarg "$arg"
    33322016          done
    3333           IFS=$save_ifs
     2017          IFS="$save_ifs"
    33342018          func_stripname ' ' '' "$lastarg"
    33352019          lastarg=$func_stripname_result
     
    33442028          # The previous "srcfile" becomes the current argument.
    33452029          #
    3346           lastarg=$srcfile
    3347           srcfile=$arg
     2030          lastarg="$srcfile"
     2031          srcfile="$arg"
    33482032          ;;
    33492033        esac  #  case $arg
     
    33602044      ;;
    33612045    target)
    3362       func_fatal_error "you must specify a target with '-o'"
     2046      func_fatal_error "you must specify a target with \`-o'"
    33632047      ;;
    33642048    *)
     
    33662050      test -z "$libobj" && {
    33672051        func_basename "$srcfile"
    3368         libobj=$func_basename_result
     2052        libobj="$func_basename_result"
    33692053      }
    33702054      ;;
     
    33862070    *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
    33872071    *)
    3388       func_fatal_error "cannot determine name of library object from '$libobj'"
     2072      func_fatal_error "cannot determine name of library object from \`$libobj'"
    33892073      ;;
    33902074    esac
     
    33952079      case $arg in
    33962080      -shared)
    3397         test yes = "$build_libtool_libs" \
    3398           || func_fatal_configuration "cannot build a shared library"
     2081        test "$build_libtool_libs" != yes && \
     2082          func_fatal_configuration "can not build a shared library"
    33992083        build_old_libs=no
    34002084        continue
     
    34222106    test "X$libobj" != "X$func_quote_for_eval_result" \
    34232107      && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'    &()|`$[]' \
    3424       && func_warning "libobj name '$libobj' may not contain shell special characters."
     2108      && func_warning "libobj name \`$libobj' may not contain shell special characters."
    34252109    func_dirname_and_basename "$obj" "/" ""
    3426     objname=$func_basename_result
    3427     xdir=$func_dirname_result
    3428     lobj=$xdir$objdir/$objname
     2110    objname="$func_basename_result"
     2111    xdir="$func_dirname_result"
     2112    lobj=${xdir}$objdir/$objname
    34292113
    34302114    test -z "$base_compile" && \
     
    34322116
    34332117    # Delete any leftover library objects.
    3434     if test yes = "$build_old_libs"; then
     2118    if test "$build_old_libs" = yes; then
    34352119      removelist="$obj $lobj $libobj ${libobj}T"
    34362120    else
     
    34442128      ;;
    34452129    esac
    3446     if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
     2130    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
    34472131      # non-PIC code in shared libraries is not supported
    34482132      pic_mode=default
     
    34512135    # Calculate the filename of the output object if compiler does
    34522136    # not support -o with -c
    3453     if test no = "$compiler_c_o"; then
    3454       output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
    3455       lockfile=$output_obj.lock
     2137    if test "$compiler_c_o" = no; then
     2138      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
     2139      lockfile="$output_obj.lock"
    34562140    else
    34572141      output_obj=
     
    34622146    # Lock this critical section if it is needed
    34632147    # We use this script file to make the link, it avoids creating a new file
    3464     if test yes = "$need_locks"; then
     2148    if test "$need_locks" = yes; then
    34652149      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
    34662150        func_echo "Waiting for $lockfile to be removed"
    34672151        sleep 2
    34682152      done
    3469     elif test warn = "$need_locks"; then
     2153    elif test "$need_locks" = warn; then
    34702154      if test -f "$lockfile"; then
    34712155        $ECHO "\
     
    34752159This indicates that another process is trying to use the same
    34762160temporary object file, and libtool could not work around it because
    3477 your compiler does not support '-c' and '-o' together.  If you
     2161your compiler does not support \`-c' and \`-o' together.  If you
    34782162repeat this compilation, it may succeed, by chance, but you had better
    34792163avoid parallel builds (make -j) in this platform, or get a better
     
    34972181
    34982182    # Only build a PIC object if we are building libtool libraries.
    3499     if test yes = "$build_libtool_libs"; then
     2183    if test "$build_libtool_libs" = yes; then
    35002184      # Without this assignment, base_compile gets emptied.
    35012185      fbsd_hideous_sh_bug=$base_compile
    35022186
    3503       if test no != "$pic_mode"; then
     2187      if test "$pic_mode" != no; then
    35042188        command="$base_compile $qsrcfile $pic_flag"
    35052189      else
     
    35182202          'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
    35192203
    3520       if test warn = "$need_locks" &&
     2204      if test "$need_locks" = warn &&
    35212205         test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
    35222206        $ECHO "\
     
    35292213This indicates that another process is trying to use the same
    35302214temporary object file, and libtool could not work around it because
    3531 your compiler does not support '-c' and '-o' together.  If you
     2215your compiler does not support \`-c' and \`-o' together.  If you
    35322216repeat this compilation, it may succeed, by chance, but you had better
    35332217avoid parallel builds (make -j) in this platform, or get a better
     
    35452229
    35462230      # Allow error messages only from the first compilation.
    3547       if test yes = "$suppress_opt"; then
     2231      if test "$suppress_opt" = yes; then
    35482232        suppress_output=' >/dev/null 2>&1'
    35492233      fi
     
    35512235
    35522236    # Only build a position-dependent object if we build old libraries.
    3553     if test yes = "$build_old_libs"; then
    3554       if test yes != "$pic_mode"; then
     2237    if test "$build_old_libs" = yes; then
     2238      if test "$pic_mode" != yes; then
    35552239        # Don't build PIC code
    35562240        command="$base_compile $qsrcfile$pie_flag"
     
    35582242        command="$base_compile $qsrcfile $pic_flag"
    35592243      fi
    3560       if test yes = "$compiler_c_o"; then
     2244      if test "$compiler_c_o" = yes; then
    35612245        func_append command " -o $obj"
    35622246      fi
     
    35672251        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
    35682252
    3569       if test warn = "$need_locks" &&
     2253      if test "$need_locks" = warn &&
    35702254         test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
    35712255        $ECHO "\
     
    35782262This indicates that another process is trying to use the same
    35792263temporary object file, and libtool could not work around it because
    3580 your compiler does not support '-c' and '-o' together.  If you
     2264your compiler does not support \`-c' and \`-o' together.  If you
    35812265repeat this compilation, it may succeed, by chance, but you had better
    35822266avoid parallel builds (make -j) in this platform, or get a better
     
    35982282
    35992283      # Unlock the critical section if it was locked
    3600       if test no != "$need_locks"; then
     2284      if test "$need_locks" != no; then
    36012285        removelist=$lockfile
    36022286        $RM "$lockfile"
     
    36082292
    36092293$opt_help || {
    3610   test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
     2294  test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
    36112295}
    36122296
     
    36282312
    36292313RM is the name of the program to use to delete files associated with each FILE
    3630 (typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
     2314(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
    36312315to RM.
    36322316
     
    36472331  -prefer-pic       try to build PIC objects only
    36482332  -prefer-non-pic   try to build non-PIC objects only
    3649   -shared           do not build a '.o' file suitable for static linking
    3650   -static           only build a '.o' file suitable for static linking
     2333  -shared           do not build a \`.o' file suitable for static linking
     2334  -static           only build a \`.o' file suitable for static linking
    36512335  -Wc,FLAG          pass FLAG directly to the compiler
    36522336
    3653 COMPILE-COMMAND is a command to be used in creating a 'standard' object file
     2337COMPILE-COMMAND is a command to be used in creating a \`standard' object file
    36542338from the given SOURCEFILE.
    36552339
    36562340The output file name is determined by removing the directory component from
    3657 SOURCEFILE, then substituting the C source code suffix '.c' with the
    3658 library object suffix, '.lo'."
     2341SOURCEFILE, then substituting the C source code suffix \`.c' with the
     2342library object suffix, \`.lo'."
    36592343        ;;
    36602344
     
    36692353  -dlopen FILE      add the directory containing FILE to the library path
    36702354
    3671 This mode sets the library path environment variable according to '-dlopen'
     2355This mode sets the library path environment variable according to \`-dlopen'
    36722356flags.
    36732357
     
    36882372
    36892373The commands that this mode executes may require superuser privileges.  Use
    3690 the '--dry-run' option if you just want to see what would be executed."
     2374the \`--dry-run' option if you just want to see what would be executed."
    36912375        ;;
    36922376
     
    36982382
    36992383INSTALL-COMMAND is the installation command.  The first component should be
    3700 either the 'install' or 'cp' program.
     2384either the \`install' or \`cp' program.
    37012385
    37022386The following components of INSTALL-COMMAND are treated specially:
     
    37242408  -bindir BINDIR    specify path to binaries directory (for systems where
    37252409                    libraries must be found in the PATH setting at runtime)
    3726   -dlopen FILE      '-dlpreopen' FILE if it cannot be dlopened at runtime
     2410  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
    37272411  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
    37282412  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
     
    37382422  -no-undefined     declare that a library does not refer to external symbols
    37392423  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
    3740   -objectlist FILE  use a list of object files found in FILE to specify objects
    3741   -os2dllname NAME  force a short DLL name on OS/2 (no effect on other OSes)
     2424  -objectlist FILE  Use a list of object files found in FILE to specify objects
    37422425  -precious-files-regex REGEX
    37432426                    don't remove output files matching REGEX
     
    37592442  -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
    37602443
    3761 All other options (arguments beginning with '-') are ignored.
    3762 
    3763 Every other argument is treated as a filename.  Files ending in '.la' are
     2444All other options (arguments beginning with \`-') are ignored.
     2445
     2446Every other argument is treated as a filename.  Files ending in \`.la' are
    37642447treated as uninstalled libtool libraries, other files are standard or library
    37652448object files.
    37662449
    3767 If the OUTPUT-FILE ends in '.la', then a libtool library is created,
    3768 only library objects ('.lo' files) may be specified, and '-rpath' is
     2450If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
     2451only library objects (\`.lo' files) may be specified, and \`-rpath' is
    37692452required, except when creating a convenience library.
    37702453
    3771 If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created
    3772 using 'ar' and 'ranlib', or on Windows using 'lib'.
    3773 
    3774 If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
     2454If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
     2455using \`ar' and \`ranlib', or on Windows using \`lib'.
     2456
     2457If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
    37752458is created, otherwise an executable program is created."
    37762459        ;;
     
    37832466
    37842467RM is the name of the program to use to delete files associated with each FILE
    3785 (typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
     2468(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
    37862469to RM.
    37872470
     
    37912474
    37922475      *)
    3793         func_fatal_help "invalid operation mode '$opt_mode'"
     2476        func_fatal_help "invalid operation mode \`$opt_mode'"
    37942477        ;;
    37952478    esac
    37962479
    37972480    echo
    3798     $ECHO "Try '$progname --help' for more information about other modes."
     2481    $ECHO "Try \`$progname --help' for more information about other modes."
    37992482}
    38002483
    38012484# Now that we've collected a possible --mode arg, show help if necessary
    38022485if $opt_help; then
    3803   if test : = "$opt_help"; then
     2486  if test "$opt_help" = :; then
    38042487    func_mode_help
    38052488  else
     
    38092492        func_mode_help
    38102493      done
    3811     } | $SED -n '1p; 2,$s/^Usage:/  or: /p'
     2494    } | sed -n '1p; 2,$s/^Usage:/  or: /p'
    38122495    {
    38132496      func_help noexit
     
    38172500      done
    38182501    } |
    3819     $SED '1d
     2502    sed '1d
    38202503      /^When reporting/,/^Report/{
    38212504        H
     
    38342517func_mode_execute ()
    38352518{
    3836     $debug_cmd
    3837 
     2519    $opt_debug
    38382520    # The first argument is the command name.
    3839     cmd=$nonopt
     2521    cmd="$nonopt"
    38402522    test -z "$cmd" && \
    38412523      func_fatal_help "you must specify a COMMAND"
     
    38442526    for file in $opt_dlopen; do
    38452527      test -f "$file" \
    3846         || func_fatal_help "'$file' is not a file"
     2528        || func_fatal_help "\`$file' is not a file"
    38472529
    38482530      dir=
     
    38542536        # Check to see that this really is a libtool archive.
    38552537        func_lalib_unsafe_p "$file" \
    3856           || func_fatal_help "'$lib' is not a valid libtool archive"
     2538          || func_fatal_help "\`$lib' is not a valid libtool archive"
    38572539
    38582540        # Read the libtool library.
     
    38652547          # Warn if it was a shared library.
    38662548          test -n "$library_names" && \
    3867             func_warning "'$file' was not linked with '-export-dynamic'"
     2549            func_warning "\`$file' was not linked with \`-export-dynamic'"
    38682550          continue
    38692551        fi
    38702552
    38712553        func_dirname "$file" "" "."
    3872         dir=$func_dirname_result
     2554        dir="$func_dirname_result"
    38732555
    38742556        if test -f "$dir/$objdir/$dlname"; then
     
    38762558        else
    38772559          if test ! -f "$dir/$dlname"; then
    3878             func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
     2560            func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
    38792561          fi
    38802562        fi
     
    38842566        # Just add the directory containing the .lo file.
    38852567        func_dirname "$file" "" "."
    3886         dir=$func_dirname_result
     2568        dir="$func_dirname_result"
    38872569        ;;
    38882570
    38892571      *)
    3890         func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
     2572        func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
    38912573        continue
    38922574        ;;
     
    38952577      # Get the absolute pathname.
    38962578      absdir=`cd "$dir" && pwd`
    3897       test -n "$absdir" && dir=$absdir
     2579      test -n "$absdir" && dir="$absdir"
    38982580
    38992581      # Now add the directory to shlibpath_var.
     
    39072589    # This variable tells wrapper scripts just to set shlibpath_var
    39082590    # rather than running their programs.
    3909     libtool_execute_magic=$magic
     2591    libtool_execute_magic="$magic"
    39102592
    39112593    # Check if any of the arguments is a wrapper script.
     
    39202602          func_source "$file"
    39212603          # Transform arg to wrapped name.
    3922           file=$progdir/$program
     2604          file="$progdir/$program"
    39232605        elif func_ltwrapper_executable_p "$file"; then
    39242606          func_ltwrapper_scriptname "$file"
    39252607          func_source "$func_ltwrapper_scriptname_result"
    39262608          # Transform arg to wrapped name.
    3927           file=$progdir/$program
     2609          file="$progdir/$program"
    39282610        fi
    39292611        ;;
     
    39332615    done
    39342616
    3935     if $opt_dry_run; then
    3936       # Display what would be done.
    3937       if test -n "$shlibpath_var"; then
    3938         eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
    3939         echo "export $shlibpath_var"
    3940       fi
    3941       $ECHO "$cmd$args"
    3942       exit $EXIT_SUCCESS
    3943     else
     2617    if test "X$opt_dry_run" = Xfalse; then
    39442618      if test -n "$shlibpath_var"; then
    39452619        # Export the shlibpath_var.
     
    39582632
    39592633      # Now prepare to actually exec the command.
    3960       exec_cmd=\$cmd$args
     2634      exec_cmd="\$cmd$args"
     2635    else
     2636      # Display what would be done.
     2637      if test -n "$shlibpath_var"; then
     2638        eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
     2639        echo "export $shlibpath_var"
     2640      fi
     2641      $ECHO "$cmd$args"
     2642      exit $EXIT_SUCCESS
    39612643    fi
    39622644}
    39632645
    3964 test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
     2646test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
    39652647
    39662648
     
    39682650func_mode_finish ()
    39692651{
    3970     $debug_cmd
    3971 
     2652    $opt_debug
    39722653    libs=
    39732654    libdirs=
     
    39832664          func_append libs " $opt"
    39842665        else
    3985           func_warning "'$opt' is not a valid libtool archive"
     2666          func_warning "\`$opt' is not a valid libtool archive"
    39862667        fi
    39872668
    39882669      else
    3989         func_fatal_error "invalid argument '$opt'"
     2670        func_fatal_error "invalid argument \`$opt'"
    39902671      fi
    39912672    done
     
    40022683      if $opt_dry_run; then
    40032684        for lib in $libs; do
    4004           echo "removing references to $lt_sysroot and '=' prefixes from $lib"
     2685          echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
    40052686        done
    40062687      else
    40072688        tmpdir=`func_mktempdir`
    40082689        for lib in $libs; do
    4009           $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
     2690          sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
    40102691            > $tmpdir/tmp-la
    40112692          mv -f $tmpdir/tmp-la $lib
     
    40322713
    40332714    # Exit here if they wanted silent mode.
    4034     $opt_quiet && exit $EXIT_SUCCESS
     2715    $opt_silent && exit $EXIT_SUCCESS
    40352716
    40362717    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
     
    40432724      echo "If you ever happen to want to link against installed libraries"
    40442725      echo "in a given directory, LIBDIR, you must either use libtool, and"
    4045       echo "specify the full pathname of the library, or use the '-LLIBDIR'"
     2726      echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
    40462727      echo "flag during linking and do at least one of the following:"
    40472728      if test -n "$shlibpath_var"; then
    4048         echo "   - add LIBDIR to the '$shlibpath_var' environment variable"
     2729        echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
    40492730        echo "     during execution"
    40502731      fi
    40512732      if test -n "$runpath_var"; then
    4052         echo "   - add LIBDIR to the '$runpath_var' environment variable"
     2733        echo "   - add LIBDIR to the \`$runpath_var' environment variable"
    40532734        echo "     during linking"
    40542735      fi
     
    40572738        eval flag=\"$hardcode_libdir_flag_spec\"
    40582739
    4059         $ECHO "   - use the '$flag' linker flag"
     2740        $ECHO "   - use the \`$flag' linker flag"
    40602741      fi
    40612742      if test -n "$admincmds"; then
     
    40632744      fi
    40642745      if test -f /etc/ld.so.conf; then
    4065         echo "   - have your system administrator add LIBDIR to '/etc/ld.so.conf'"
     2746        echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
    40662747      fi
    40672748      echo
     
    40822763}
    40832764
    4084 test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
     2765test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
    40852766
    40862767
     
    40882769func_mode_install ()
    40892770{
    4090     $debug_cmd
    4091 
     2771    $opt_debug
    40922772    # There may be an optional sh(1) argument at the beginning of
    40932773    # install_prog (especially on Windows NT).
    4094     if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
     2774    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
    40952775       # Allow the use of GNU shtool's install command.
    4096        case $nonopt in *shtool*) :;; *) false;; esac
    4097     then
     2776       case $nonopt in *shtool*) :;; *) false;; esac; then
    40982777      # Aesthetically quote it.
    40992778      func_quote_for_eval "$nonopt"
     
    41222801    prev=
    41232802    install_type=
    4124     isdir=false
     2803    isdir=no
    41252804    stripme=
    41262805    no_mode=:
     
    41352814
    41362815      case $arg in
    4137       -d) isdir=: ;;
     2816      -d) isdir=yes ;;
    41382817      -f)
    41392818        if $install_cp; then :; else
     
    41532832        # If the previous option needed an argument, then skip it.
    41542833        if test -n "$prev"; then
    4155           if test X-m = "X$prev" && test -n "$install_override_mode"; then
     2834          if test "x$prev" = x-m && test -n "$install_override_mode"; then
    41562835            arg2=$install_override_mode
    41572836            no_mode=false
     
    41782857
    41792858    test -n "$prev" && \
    4180       func_fatal_help "the '$prev' option requires an argument"
     2859      func_fatal_help "the \`$prev' option requires an argument"
    41812860
    41822861    if test -n "$install_override_mode" && $no_mode; then
     
    42002879
    42012880    # Check to see that the destination is a directory.
    4202     test -d "$dest" && isdir=:
    4203     if $isdir; then
    4204       destdir=$dest
     2881    test -d "$dest" && isdir=yes
     2882    if test "$isdir" = yes; then
     2883      destdir="$dest"
    42052884      destname=
    42062885    else
    42072886      func_dirname_and_basename "$dest" "" "."
    4208       destdir=$func_dirname_result
    4209       destname=$func_basename_result
     2887      destdir="$func_dirname_result"
     2888      destname="$func_basename_result"
    42102889
    42112890      # Not a directory, so check to see that there is only one file specified.
    42122891      set dummy $files; shift
    42132892      test "$#" -gt 1 && \
    4214         func_fatal_help "'$dest' is not a directory"
     2893        func_fatal_help "\`$dest' is not a directory"
    42152894    fi
    42162895    case $destdir in
     
    42212900        *.lo) ;;
    42222901        *)
    4223           func_fatal_help "'$destdir' must be an absolute directory name"
     2902          func_fatal_help "\`$destdir' must be an absolute directory name"
    42242903          ;;
    42252904        esac
     
    42302909    # This variable tells wrapper scripts just to set variables rather
    42312910    # than running their programs.
    4232     libtool_install_magic=$magic
     2911    libtool_install_magic="$magic"
    42332912
    42342913    staticlibs=
     
    42502929        # Check to see that this really is a libtool archive.
    42512930        func_lalib_unsafe_p "$file" \
    4252           || func_fatal_help "'$file' is not a valid libtool archive"
     2931          || func_fatal_help "\`$file' is not a valid libtool archive"
    42532932
    42542933        library_names=
     
    42722951
    42732952        func_dirname "$file" "/" ""
    4274         dir=$func_dirname_result
     2953        dir="$func_dirname_result"
    42752954        func_append dir "$objdir"
    42762955
     
    42862965          # but it's something to keep an eye on.
    42872966          test "$inst_prefix_dir" = "$destdir" && \
    4288             func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
     2967            func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
    42892968
    42902969          if test -n "$inst_prefix_dir"; then
     
    42952974          fi
    42962975
    4297           func_warning "relinking '$file'"
     2976          func_warning "relinking \`$file'"
    42982977          func_show_eval "$relink_command" \
    4299             'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
     2978            'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
    43002979        fi
    43012980
     
    43032982        set dummy $library_names; shift
    43042983        if test -n "$1"; then
    4305           realname=$1
     2984          realname="$1"
    43062985          shift
    43072986
    4308           srcname=$realname
    4309           test -n "$relink_command" && srcname=${realname}T
     2987          srcname="$realname"
     2988          test -n "$relink_command" && srcname="$realname"T
    43102989
    43112990          # Install the shared library and build the symlinks.
    43122991          func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
    43132992              'exit $?'
    4314           tstripme=$stripme
     2993          tstripme="$stripme"
    43152994          case $host_os in
    43162995          cygwin* | mingw* | pw32* | cegcc*)
    43172996            case $realname in
    43182997            *.dll.a)
    4319               tstripme=
    4320               ;;
    4321             esac
    4322             ;;
    4323           os2*)
    4324             case $realname in
    4325             *_dll.a)
    4326               tstripme=
     2998              tstripme=""
    43272999              ;;
    43283000            esac
     
    43353007          if test "$#" -gt 0; then
    43363008            # Delete the old symlinks, and create new ones.
    4337             # Try 'ln -sf' first, because the 'ln' binary might depend on
     3009            # Try `ln -sf' first, because the `ln' binary might depend on
    43383010            # the symlink we replace!  Solaris /bin/ln does not understand -f,
    43393011            # so we also need to try rm && ln -s.
     
    43463018
    43473019          # Do each command in the postinstall commands.
    4348           lib=$destdir/$realname
     3020          lib="$destdir/$realname"
    43493021          func_execute_cmds "$postinstall_cmds" 'exit $?'
    43503022        fi
     
    43523024        # Install the pseudo-library for information purposes.
    43533025        func_basename "$file"
    4354         name=$func_basename_result
    4355         instname=$dir/${name}i
     3026        name="$func_basename_result"
     3027        instname="$dir/$name"i
    43563028        func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
    43573029
     
    43653037        # Figure out destination file name, if it wasn't already specified.
    43663038        if test -n "$destname"; then
    4367           destfile=$destdir/$destname
     3039          destfile="$destdir/$destname"
    43683040        else
    43693041          func_basename "$file"
    4370           destfile=$func_basename_result
    4371           destfile=$destdir/$destfile
     3042          destfile="$func_basename_result"
     3043          destfile="$destdir/$destfile"
    43723044        fi
    43733045
     
    43793051          ;;
    43803052        *.$objext)
    4381           staticdest=$destfile
     3053          staticdest="$destfile"
    43823054          destfile=
    43833055          ;;
    43843056        *)
    4385           func_fatal_help "cannot copy a libtool object to '$destfile'"
     3057          func_fatal_help "cannot copy a libtool object to \`$destfile'"
    43863058          ;;
    43873059        esac
     
    43923064
    43933065        # Install the old object if enabled.
    4394         if test yes = "$build_old_libs"; then
     3066        if test "$build_old_libs" = yes; then
    43953067          # Deduce the name of the old-style object file.
    43963068          func_lo2o "$file"
     
    44043076        # Figure out destination file name, if it wasn't already specified.
    44053077        if test -n "$destname"; then
    4406           destfile=$destdir/$destname
     3078          destfile="$destdir/$destname"
    44073079        else
    44083080          func_basename "$file"
    4409           destfile=$func_basename_result
    4410           destfile=$destdir/$destfile
     3081          destfile="$func_basename_result"
     3082          destfile="$destdir/$destfile"
    44113083        fi
    44123084
     
    44143086        # because it is most likely a libtool script we actually want to
    44153087        # install
    4416         stripped_ext=
     3088        stripped_ext=""
    44173089        case $file in
    44183090          *.exe)
     
    44203092              func_stripname '' '.exe' "$file"
    44213093              file=$func_stripname_result
    4422               stripped_ext=.exe
     3094              stripped_ext=".exe"
    44233095            fi
    44243096            ;;
     
    44483120          # Check the variables that should have been set.
    44493121          test -z "$generated_by_libtool_version" && \
    4450             func_fatal_error "invalid libtool wrapper script '$wrapper'"
    4451 
    4452           finalize=:
     3122            func_fatal_error "invalid libtool wrapper script \`$wrapper'"
     3123
     3124          finalize=yes
    44533125          for lib in $notinst_deplibs; do
    44543126            # Check to see that each library is installed.
     
    44573129              func_source "$lib"
    44583130            fi
    4459             libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
     3131            libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
    44603132            if test -n "$libdir" && test ! -f "$libfile"; then
    4461               func_warning "'$lib' has not been installed in '$libdir'"
    4462               finalize=false
     3133              func_warning "\`$lib' has not been installed in \`$libdir'"
     3134              finalize=no
    44633135            fi
    44643136          done
     
    44683140
    44693141          outputname=
    4470           if test no = "$fast_install" && test -n "$relink_command"; then
     3142          if test "$fast_install" = no && test -n "$relink_command"; then
    44713143            $opt_dry_run || {
    4472               if $finalize; then
     3144              if test "$finalize" = yes; then
    44733145                tmpdir=`func_mktempdir`
    44743146                func_basename "$file$stripped_ext"
    4475                 file=$func_basename_result
    4476                 outputname=$tmpdir/$file
     3147                file="$func_basename_result"
     3148                outputname="$tmpdir/$file"
    44773149                # Replace the output file specification.
    44783150                relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
    44793151
    4480                 $opt_quiet || {
     3152                $opt_silent || {
    44813153                  func_quote_for_expand "$relink_command"
    44823154                  eval "func_echo $func_quote_for_expand_result"
     
    44843156                if eval "$relink_command"; then :
    44853157                  else
    4486                   func_error "error: relink '$file' with the above command before installing it"
     3158                  func_error "error: relink \`$file' with the above command before installing it"
    44873159                  $opt_dry_run || ${RM}r "$tmpdir"
    44883160                  continue
    44893161                fi
    4490                 file=$outputname
     3162                file="$outputname"
    44913163              else
    4492                 func_warning "cannot relink '$file'"
     3164                func_warning "cannot relink \`$file'"
    44933165              fi
    44943166            }
     
    45273199    for file in $staticlibs; do
    45283200      func_basename "$file"
    4529       name=$func_basename_result
     3201      name="$func_basename_result"
    45303202
    45313203      # Set up the ranlib parameters.
    4532       oldlib=$destdir/$name
     3204      oldlib="$destdir/$name"
    45333205      func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
    45343206      tool_oldlib=$func_to_tool_file_result
     
    45453217
    45463218    test -n "$future_libdirs" && \
    4547       func_warning "remember to run '$progname --finish$future_libdirs'"
     3219      func_warning "remember to run \`$progname --finish$future_libdirs'"
    45483220
    45493221    if test -n "$current_libdirs"; then
    45503222      # Maybe just do a dry run.
    45513223      $opt_dry_run && current_libdirs=" -n$current_libdirs"
    4552       exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
     3224      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
    45533225    else
    45543226      exit $EXIT_SUCCESS
     
    45563228}
    45573229
    4558 test install = "$opt_mode" && func_mode_install ${1+"$@"}
     3230test "$opt_mode" = install && func_mode_install ${1+"$@"}
    45593231
    45603232
     
    45643236func_generate_dlsyms ()
    45653237{
    4566     $debug_cmd
    4567 
    4568     my_outputname=$1
    4569     my_originator=$2
    4570     my_pic_p=${3-false}
    4571     my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`
     3238    $opt_debug
     3239    my_outputname="$1"
     3240    my_originator="$2"
     3241    my_pic_p="${3-no}"
     3242    my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
    45723243    my_dlsyms=
    45733244
    4574     if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
     3245    if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
    45753246      if test -n "$NM" && test -n "$global_symbol_pipe"; then
    4576         my_dlsyms=${my_outputname}S.c
     3247        my_dlsyms="${my_outputname}S.c"
    45773248      else
    45783249        func_error "not configured to extract global symbols from dlpreopened files"
     
    45853256      *.c)
    45863257        # Discover the nlist of each of the dlfiles.
    4587         nlist=$output_objdir/$my_outputname.nm
     3258        nlist="$output_objdir/${my_outputname}.nm"
    45883259
    45893260        func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
     
    45933264
    45943265        $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
    4595 /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
    4596 /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
     3266/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
     3267/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
    45973268
    45983269#ifdef __cplusplus
     
    46003271#endif
    46013272
    4602 #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
     3273#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
    46033274#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
    46043275#endif
    46053276
    46063277/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
    4607 #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
    4608 /* DATA imports from DLLs on WIN32 can't be const, because runtime
     3278#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
     3279/* DATA imports from DLLs on WIN32 con't be const, because runtime
    46093280   relocations are performed -- see ld's documentation on pseudo-relocs.  */
    46103281# define LT_DLSYM_CONST
    4611 #elif defined __osf__
     3282#elif defined(__osf__)
    46123283/* This system does not cope well with relocations in const data.  */
    46133284# define LT_DLSYM_CONST
     
    46163287#endif
    46173288
    4618 #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
    4619 
    46203289/* External symbol declarations for the compiler. */\
    46213290"
    46223291
    4623         if test yes = "$dlself"; then
    4624           func_verbose "generating symbol list for '$output'"
     3292        if test "$dlself" = yes; then
     3293          func_verbose "generating symbol list for \`$output'"
    46253294
    46263295          $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
     
    46303299          for progfile in $progfiles; do
    46313300            func_to_tool_file "$progfile" func_convert_file_msys_to_w32
    4632             func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
     3301            func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
    46333302            $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
    46343303          done
     
    46503319          # Prepare the list of exported symbols
    46513320          if test -z "$export_symbols"; then
    4652             export_symbols=$output_objdir/$outputname.exp
     3321            export_symbols="$output_objdir/$outputname.exp"
    46533322            $opt_dry_run || {
    46543323              $RM $export_symbols
    4655               eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
     3324              eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
    46563325              case $host in
    46573326              *cygwin* | *mingw* | *cegcc* )
     
    46633332          else
    46643333            $opt_dry_run || {
    4665               eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
     3334              eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
    46663335              eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
    46673336              eval '$MV "$nlist"T "$nlist"'
     
    46773346
    46783347        for dlprefile in $dlprefiles; do
    4679           func_verbose "extracting global C symbols from '$dlprefile'"
     3348          func_verbose "extracting global C symbols from \`$dlprefile'"
    46803349          func_basename "$dlprefile"
    4681           name=$func_basename_result
     3350          name="$func_basename_result"
    46823351          case $host in
    46833352            *cygwin* | *mingw* | *cegcc* )
     
    46863355                func_tr_sh "$dlprefile"
    46873356                eval "curr_lafile=\$libfile_$func_tr_sh_result"
    4688                 dlprefile_dlbasename=
     3357                dlprefile_dlbasename=""
    46893358                if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
    46903359                  # Use subshell, to avoid clobbering current variable values
    46913360                  dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
    4692                   if test -n "$dlprefile_dlname"; then
     3361                  if test -n "$dlprefile_dlname" ; then
    46933362                    func_basename "$dlprefile_dlname"
    4694                     dlprefile_dlbasename=$func_basename_result
     3363                    dlprefile_dlbasename="$func_basename_result"
    46953364                  else
    46963365                    # no lafile. user explicitly requested -dlpreopen <import library>.
     
    47003369                fi
    47013370                $opt_dry_run || {
    4702                   if test -n "$dlprefile_dlbasename"; then
     3371                  if test -n "$dlprefile_dlbasename" ; then
    47033372                    eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
    47043373                  else
     
    47563425          fi
    47573426
    4758           func_show_eval '$RM "${nlist}I"'
    4759           if test -n "$global_symbol_to_import"; then
    4760             eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
    4761           fi
    4762 
    47633427          echo >> "$output_objdir/$my_dlsyms" "\
    47643428
     
    47693433} lt_dlsymlist;
    47703434extern LT_DLSYM_CONST lt_dlsymlist
    4771 lt_${my_prefix}_LTX_preloaded_symbols[];\
    4772 "
    4773 
    4774           if test -s "$nlist"I; then
    4775             echo >> "$output_objdir/$my_dlsyms" "\
    4776 static void lt_syminit(void)
    4777 {
    4778   LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
    4779   for (; symbol->name; ++symbol)
    4780     {"
    4781             $SED 's/.*/      if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
    4782             echo >> "$output_objdir/$my_dlsyms" "\
    4783     }
    4784 }"
    4785           fi
    4786           echo >> "$output_objdir/$my_dlsyms" "\
     3435lt_${my_prefix}_LTX_preloaded_symbols[];
    47873436LT_DLSYM_CONST lt_dlsymlist
    47883437lt_${my_prefix}_LTX_preloaded_symbols[] =
    4789 { {\"$my_originator\", (void *) 0},"
    4790 
    4791           if test -s "$nlist"I; then
    4792             echo >> "$output_objdir/$my_dlsyms" "\
    4793   {\"@INIT@\", (void *) &lt_syminit},"
    4794           fi
     3438{\
     3439  { \"$my_originator\", (void *) 0 },"
    47953440
    47963441          case $need_lib_prefix in
     
    48343479            pic_flag_for_symtable=" $pic_flag"  ;;
    48353480          *)
    4836             $my_pic_p && pic_flag_for_symtable=" $pic_flag"
     3481            if test "X$my_pic_p" != Xno; then
     3482              pic_flag_for_symtable=" $pic_flag"
     3483            fi
    48373484            ;;
    48383485          esac
     
    48513498
    48523499        # Clean up the generated files.
    4853         func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
     3500        func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
    48543501
    48553502        # Transform the symbol file into the correct name.
    4856         symfileobj=$output_objdir/${my_outputname}S.$objext
     3503        symfileobj="$output_objdir/${my_outputname}S.$objext"
    48573504        case $host in
    48583505        *cygwin* | *mingw* | *cegcc* )
     
    48723519        ;;
    48733520      *)
    4874         func_fatal_error "unknown suffix for '$my_dlsyms'"
     3521        func_fatal_error "unknown suffix for \`$my_dlsyms'"
    48753522        ;;
    48763523      esac
     
    48843531      finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
    48853532    fi
    4886 }
    4887 
    4888 # func_cygming_gnu_implib_p ARG
    4889 # This predicate returns with zero status (TRUE) if
    4890 # ARG is a GNU/binutils-style import library. Returns
    4891 # with nonzero status (FALSE) otherwise.
    4892 func_cygming_gnu_implib_p ()
    4893 {
    4894   $debug_cmd
    4895 
    4896   func_to_tool_file "$1" func_convert_file_msys_to_w32
    4897   func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
    4898   test -n "$func_cygming_gnu_implib_tmp"
    4899 }
    4900 
    4901 # func_cygming_ms_implib_p ARG
    4902 # This predicate returns with zero status (TRUE) if
    4903 # ARG is an MS-style import library. Returns
    4904 # with nonzero status (FALSE) otherwise.
    4905 func_cygming_ms_implib_p ()
    4906 {
    4907   $debug_cmd
    4908 
    4909   func_to_tool_file "$1" func_convert_file_msys_to_w32
    4910   func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
    4911   test -n "$func_cygming_ms_implib_tmp"
    49123533}
    49133534
     
    49213542func_win32_libid ()
    49223543{
    4923   $debug_cmd
    4924 
    4925   win32_libid_type=unknown
     3544  $opt_debug
     3545  win32_libid_type="unknown"
    49263546  win32_fileres=`file -L $1 2>/dev/null`
    49273547  case $win32_fileres in
     
    49333553    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
    49343554       $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
    4935       case $nm_interface in
    4936       "MS dumpbin")
    4937         if func_cygming_ms_implib_p "$1" ||
    4938            func_cygming_gnu_implib_p "$1"
    4939         then
    4940           win32_nmres=import
    4941         else
    4942           win32_nmres=
    4943         fi
    4944         ;;
    4945       *)
    4946         func_to_tool_file "$1" func_convert_file_msys_to_w32
    4947         win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
    4948           $SED -n -e '
     3555      func_to_tool_file "$1" func_convert_file_msys_to_w32
     3556      win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
     3557        $SED -n -e '
    49493558            1,100{
    49503559                / I /{
    4951                     s|.*|import|
     3560                    s,.*,import,
    49523561                    p
    49533562                    q
    49543563                }
    49553564            }'`
    4956         ;;
    4957       esac
    49583565      case $win32_nmres in
    49593566      import*)  win32_libid_type="x86 archive import";;
     
    49873594func_cygming_dll_for_implib ()
    49883595{
    4989   $debug_cmd
    4990 
     3596  $opt_debug
    49913597  sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
    49923598}
     
    50053611func_cygming_dll_for_implib_fallback_core ()
    50063612{
    5007   $debug_cmd
    5008 
     3613  $opt_debug
    50093614  match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
    50103615  $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
     
    50423647    # we now have a list, one entry per line, of the stringified
    50433648    # contents of the appropriate section of all members of the
    5044     # archive that possess that section. Heuristic: eliminate
    5045     # all those that have a first or second character that is
     3649    # archive which possess that section. Heuristic: eliminate
     3650    # all those which have a first or second character that is
    50463651    # a '.' (that is, objdump's representation of an unprintable
    50473652    # character.) This should work for all archives with less than
     
    50523657    # Of those that remain, print the first one.
    50533658    $SED -e '/^\./d;/^.\./d;q'
     3659}
     3660
     3661# func_cygming_gnu_implib_p ARG
     3662# This predicate returns with zero status (TRUE) if
     3663# ARG is a GNU/binutils-style import library. Returns
     3664# with nonzero status (FALSE) otherwise.
     3665func_cygming_gnu_implib_p ()
     3666{
     3667  $opt_debug
     3668  func_to_tool_file "$1" func_convert_file_msys_to_w32
     3669  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
     3670  test -n "$func_cygming_gnu_implib_tmp"
     3671}
     3672
     3673# func_cygming_ms_implib_p ARG
     3674# This predicate returns with zero status (TRUE) if
     3675# ARG is an MS-style import library. Returns
     3676# with nonzero status (FALSE) otherwise.
     3677func_cygming_ms_implib_p ()
     3678{
     3679  $opt_debug
     3680  func_to_tool_file "$1" func_convert_file_msys_to_w32
     3681  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
     3682  test -n "$func_cygming_ms_implib_tmp"
    50543683}
    50553684
     
    50673696func_cygming_dll_for_implib_fallback ()
    50683697{
    5069   $debug_cmd
    5070 
    5071   if func_cygming_gnu_implib_p "$1"; then
     3698  $opt_debug
     3699  if func_cygming_gnu_implib_p "$1" ; then
    50723700    # binutils import library
    50733701    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
    5074   elif func_cygming_ms_implib_p "$1"; then
     3702  elif func_cygming_ms_implib_p "$1" ; then
    50753703    # ms-generated import library
    50763704    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
    50773705  else
    50783706    # unknown
    5079     sharedlib_from_linklib_result=
     3707    sharedlib_from_linklib_result=""
    50803708  fi
    50813709}
     
    50853713func_extract_an_archive ()
    50863714{
    5087     $debug_cmd
    5088 
    5089     f_ex_an_ar_dir=$1; shift
    5090     f_ex_an_ar_oldlib=$1
    5091     if test yes = "$lock_old_archive_extraction"; then
     3715    $opt_debug
     3716    f_ex_an_ar_dir="$1"; shift
     3717    f_ex_an_ar_oldlib="$1"
     3718    if test "$lock_old_archive_extraction" = yes; then
    50923719      lockfile=$f_ex_an_ar_oldlib.lock
    50933720      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
     
    50983725    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
    50993726                   'stat=$?; rm -f "$lockfile"; exit $stat'
    5100     if test yes = "$lock_old_archive_extraction"; then
     3727    if test "$lock_old_archive_extraction" = yes; then
    51013728      $opt_dry_run || rm -f "$lockfile"
    51023729    fi
     
    51123739func_extract_archives ()
    51133740{
    5114     $debug_cmd
    5115 
    5116     my_gentop=$1; shift
     3741    $opt_debug
     3742    my_gentop="$1"; shift
    51173743    my_oldlibs=${1+"$@"}
    5118     my_oldobjs=
    5119     my_xlib=
    5120     my_xabs=
    5121     my_xdir=
     3744    my_oldobjs=""
     3745    my_xlib=""
     3746    my_xabs=""
     3747    my_xdir=""
    51223748
    51233749    for my_xlib in $my_oldlibs; do
    51243750      # Extract the objects.
    51253751      case $my_xlib in
    5126         [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
     3752        [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
    51273753        *) my_xabs=`pwd`"/$my_xlib" ;;
    51283754      esac
    51293755      func_basename "$my_xlib"
    5130       my_xlib=$func_basename_result
     3756      my_xlib="$func_basename_result"
    51313757      my_xlib_u=$my_xlib
    51323758      while :; do
     
    51403766      done
    51413767      extracted_archives="$extracted_archives $my_xlib_u"
    5142       my_xdir=$my_gentop/$my_xlib_u
     3768      my_xdir="$my_gentop/$my_xlib_u"
    51433769
    51443770      func_mkdir_p "$my_xdir"
     
    51533779          darwin_archive=$my_xabs
    51543780          darwin_curdir=`pwd`
    5155           func_basename "$darwin_archive"
    5156           darwin_base_archive=$func_basename_result
     3781          darwin_base_archive=`basename "$darwin_archive"`
    51573782          darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
    51583783          if test -n "$darwin_arches"; then
     
    51603785            darwin_arch=
    51613786            func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
    5162             for darwin_arch in  $darwin_arches; do
    5163               func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
    5164               $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
    5165               cd "unfat-$$/$darwin_base_archive-$darwin_arch"
    5166               func_extract_an_archive "`pwd`" "$darwin_base_archive"
     3787            for darwin_arch in  $darwin_arches ; do
     3788              func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
     3789              $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
     3790              cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
     3791              func_extract_an_archive "`pwd`" "${darwin_base_archive}"
    51673792              cd "$darwin_curdir"
    5168               $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
     3793              $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
    51693794            done # $darwin_arches
    51703795            ## Okay now we've a bunch of thin objects, gotta fatten them up :)
    5171             darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u`
     3796            darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
    51723797            darwin_file=
    51733798            darwin_files=
     
    51913816    done
    51923817
    5193     func_extract_archives_result=$my_oldobjs
     3818    func_extract_archives_result="$my_oldobjs"
    51943819}
    51953820
     
    52063831# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
    52073832# variable will take.  If 'yes', then the emitted script
    5208 # will assume that the directory where it is stored is
     3833# will assume that the directory in which it is stored is
    52093834# the $objdir directory.  This is a cygwin/mingw-specific
    52103835# behavior.
     
    52173842
    52183843# $output - temporary wrapper script for $objdir/$outputname
    5219 # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
     3844# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
    52203845#
    52213846# The $output program cannot be directly executed until all the libtool
     
    52743899# Very basic option parsing. These options are (a) specific to
    52753900# the libtool wrapper, (b) are identical between the wrapper
    5276 # /script/ and the wrapper /executable/ that is used only on
     3901# /script/ and the wrapper /executable/ which is used only on
    52773902# windows platforms, and (c) all begin with the string "--lt-"
    5278 # (application programs are unlikely to have options that match
     3903# (application programs are unlikely to have options which match
    52793904# this pattern).
    52803905#
     
    53093934  # Print the debug banner immediately:
    53103935  if test -n \"\$lt_option_debug\"; then
    5311     echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
     3936    echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
    53123937  fi
    53133938}
     
    53203945  for lt_arg
    53213946  do
    5322     \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
     3947    \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
    53233948    lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
    53243949  done
     
    53343959    $ECHO "\
    53353960      if test -n \"\$lt_option_debug\"; then
    5336         \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
     3961        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
    53373962        func_lt_dump_args \${1+\"\$@\"} 1>&2
    53383963      fi
     
    53443969    $ECHO "\
    53453970      if test -n \"\$lt_option_debug\"; then
    5346         \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
     3971        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
    53473972        func_lt_dump_args \${1+\"\$@\"} 1>&2
    53483973      fi
     
    54194044"
    54204045
    5421         if test yes = "$fast_install"; then
     4046        if test "$fast_install" = yes; then
    54224047          $ECHO "\
    54234048  program=lt-'$outputname'$exeext
     
    54254050
    54264051  if test ! -f \"\$progdir/\$program\" ||
    5427      { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\
     4052     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
    54284053       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
    54294054
     
    54424067      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
    54434068      else
    5444         \$ECHO \"\$relink_command_output\" >&2
     4069        $ECHO \"\$relink_command_output\" >&2
    54454070        $RM \"\$progdir/\$file\"
    54464071        exit 1
     
    54774102
    54784103        # Export our shlibpath_var if we have one.
    5479         if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
     4104        if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
    54804105          $ECHO "\
    54814106    # Add our own library path to $shlibpath_var
     
    54974122  else
    54984123    # The program doesn't exist.
    5499     \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2
     4124    \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
    55004125    \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
    55014126    \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
     
    55164141
    55174142/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
    5518    Generated by $PROGRAM (GNU $PACKAGE) $VERSION
     4143   Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
    55194144
    55204145   The $output program cannot be directly executed until all the libtool
     
    55514176#include <sys/stat.h>
    55524177
    5553 #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
    5554 
    55554178/* declarations of non-ANSI functions */
    5556 #if defined __MINGW32__
     4179#if defined(__MINGW32__)
    55574180# ifdef __STRICT_ANSI__
    55584181int _putenv (const char *);
    55594182# endif
    5560 #elif defined __CYGWIN__
     4183#elif defined(__CYGWIN__)
    55614184# ifdef __STRICT_ANSI__
    55624185char *realpath (const char *, char *);
     
    55644187int setenv (const char *, const char *, int);
    55654188# endif
    5566 /* #elif defined other_platform || defined ... */
     4189/* #elif defined (other platforms) ... */
    55674190#endif
    55684191
    55694192/* portability defines, excluding path handling macros */
    5570 #if defined _MSC_VER
     4193#if defined(_MSC_VER)
    55714194# define setmode _setmode
    55724195# define stat    _stat
     
    55754198# define putenv  _putenv
    55764199# define S_IXUSR _S_IEXEC
    5577 #elif defined __MINGW32__
     4200# ifndef _INTPTR_T_DEFINED
     4201#  define _INTPTR_T_DEFINED
     4202#  define intptr_t int
     4203# endif
     4204#elif defined(__MINGW32__)
    55784205# define setmode _setmode
    55794206# define stat    _stat
     
    55814208# define getcwd  _getcwd
    55824209# define putenv  _putenv
    5583 #elif defined __CYGWIN__
     4210#elif defined(__CYGWIN__)
    55844211# define HAVE_SETENV
    55854212# define FOPEN_WB "wb"
    5586 /* #elif defined other platforms ... */
     4213/* #elif defined (other platforms) ... */
    55874214#endif
    55884215
    5589 #if defined PATH_MAX
     4216#if defined(PATH_MAX)
    55904217# define LT_PATHMAX PATH_MAX
    5591 #elif defined MAXPATHLEN
     4218#elif defined(MAXPATHLEN)
    55924219# define LT_PATHMAX MAXPATHLEN
    55934220#else
     
    56084235#endif
    56094236
    5610 #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
    5611   defined __OS2__
     4237#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
     4238  defined (__OS2__)
    56124239# define HAVE_DOS_BASED_FILE_SYSTEM
    56134240# define FOPEN_WB "wb"
     
    56424269#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
    56434270#define XFREE(stale) do { \
    5644   if (stale) { free (stale); stale = 0; } \
     4271  if (stale) { free ((void *) stale); stale = 0; } \
    56454272} while (0)
    56464273
    5647 #if defined LT_DEBUGWRAPPER
     4274#if defined(LT_DEBUGWRAPPER)
    56484275static int lt_debug = 1;
    56494276#else
     
    56744301
    56754302            cat <<EOF
    5676 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
    5677 # define externally_visible volatile
    5678 #else
    5679 # define externally_visible __attribute__((externally_visible)) volatile
    5680 #endif
    5681 externally_visible const char * MAGIC_EXE = "$magic_exe";
     4303volatile const char * MAGIC_EXE = "$magic_exe";
    56824304const char * LIB_PATH_VARNAME = "$shlibpath_var";
    56834305EOF
    56844306
    5685             if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
     4307            if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
    56864308              func_to_host_path "$temp_rpath"
    56874309              cat <<EOF
     
    57074329            fi
    57084330
    5709             if test yes = "$fast_install"; then
     4331            if test "$fast_install" = yes; then
    57104332              cat <<EOF
    57114333const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
     
    57364358  char *target_name;
    57374359  char *lt_argv_zero;
    5738   int rval = 127;
     4360  intptr_t rval = 127;
    57394361
    57404362  int i;
    57414363
    57424364  program_name = (char *) xstrdup (base_name (argv[0]));
    5743   newargz = XMALLOC (char *, (size_t) argc + 1);
     4365  newargz = XMALLOC (char *, argc + 1);
    57444366
    57454367  /* very simple arg parsing; don't want to rely on getopt
     
    57504372  for (i = 1; i < argc; i++)
    57514373    {
    5752       if (STREQ (argv[i], dumpscript_opt))
     4374      if (strcmp (argv[i], dumpscript_opt) == 0)
    57534375        {
    57544376EOF
    5755             case $host in
     4377            case "$host" in
    57564378              *mingw* | *cygwin* )
    57574379                # make stdout use "unix" line endings
     
    57644386          return 0;
    57654387        }
    5766       if (STREQ (argv[i], debug_opt))
     4388      if (strcmp (argv[i], debug_opt) == 0)
    57674389        {
    57684390          lt_debug = 1;
    57694391          continue;
    57704392        }
    5771       if (STREQ (argv[i], ltwrapper_option_prefix))
     4393      if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
    57724394        {
    57734395          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
     
    57924414            cat <<EOF
    57934415  /* The GNU banner must be the first non-error debug message */
    5794   lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
     4416  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
    57954417EOF
    57964418            cat <<"EOF"
     
    59034525  /* execv doesn't actually work on mingw as expected on unix */
    59044526  newargz = prepare_spawn (newargz);
    5905   rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
     4527  rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
    59064528  if (rval == -1)
    59074529    {
     
    59484570  const char *base;
    59494571
    5950 #if defined HAVE_DOS_BASED_FILE_SYSTEM
     4572#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
    59514573  /* Skip over the disk name in MSDOS pathnames. */
    59524574  if (isalpha ((unsigned char) name[0]) && name[1] == ':')
     
    60074629  /* static buffer for getcwd */
    60084630  char tmp[LT_PATHMAX + 1];
    6009   size_t tmp_len;
     4631  int tmp_len;
    60104632  char *concat_name;
    60114633
     
    60174639
    60184640  /* Absolute path? */
    6019 #if defined HAVE_DOS_BASED_FILE_SYSTEM
     4641#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
    60204642  if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
    60214643    {
     
    60354657          XFREE (concat_name);
    60364658        }
    6037 #if defined HAVE_DOS_BASED_FILE_SYSTEM
     4659#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
    60384660    }
    60394661#endif
     
    60584680                if (IS_PATH_SEPARATOR (*q))
    60594681                  break;
    6060               p_len = (size_t) (q - p);
     4682              p_len = q - p;
    60614683              p_next = (*q == '\0' ? q : q + 1);
    60624684              if (p_len == 0)
     
    61774799    {
    61784800      str += len - patlen;
    6179       if (STREQ (str, pat))
     4801      if (strcmp (str, pat) == 0)
    61804802        *str = '\0';
    61814803    }
     
    62424864    setenv (name, str, 1);
    62434865#else
    6244     size_t len = strlen (name) + 1 + strlen (value) + 1;
     4866    int len = strlen (name) + 1 + strlen (value) + 1;
    62454867    char *str = XMALLOC (char, len);
    62464868    sprintf (str, "%s=%s", name, value);
     
    62594881  if (orig_value && *orig_value)
    62604882    {
    6261       size_t orig_value_len = strlen (orig_value);
    6262       size_t add_len = strlen (add);
     4883      int orig_value_len = strlen (orig_value);
     4884      int add_len = strlen (add);
    62634885      new_value = XMALLOC (char, add_len + orig_value_len + 1);
    62644886      if (to_end)
     
    62914913      char *new_value = lt_extend_str (getenv (name), value, 0);
    62924914      /* some systems can't cope with a ':'-terminated path #' */
    6293       size_t len = strlen (new_value);
    6294       while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
     4915      int len = strlen (new_value);
     4916      while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
    62954917        {
    6296           new_value[--len] = '\0';
     4918          new_value[len-1] = '\0';
    62974919        }
    62984920      lt_setenv (name, new_value);
     
    64615083func_win32_import_lib_p ()
    64625084{
    6463     $debug_cmd
    6464 
     5085    $opt_debug
    64655086    case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
    64665087    *import*) : ;;
     
    64695090}
    64705091
    6471 # func_suncc_cstd_abi
    6472 # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!
    6473 # Several compiler flags select an ABI that is incompatible with the
    6474 # Cstd library. Avoid specifying it if any are in CXXFLAGS.
    6475 func_suncc_cstd_abi ()
    6476 {
    6477     $debug_cmd
    6478 
    6479     case " $compile_command " in
    6480     *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)
    6481       suncc_use_cstd_abi=no
    6482       ;;
    6483     *)
    6484       suncc_use_cstd_abi=yes
    6485       ;;
    6486     esac
    6487 }
    6488 
    64895092# func_mode_link arg...
    64905093func_mode_link ()
    64915094{
    6492     $debug_cmd
    6493 
     5095    $opt_debug
    64945096    case $host in
    64955097    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
    64965098      # It is impossible to link a dll without this setting, and
    64975099      # we shouldn't force the makefile maintainer to figure out
    6498       # what system we are compiling for in order to pass an extra
     5100      # which system we are compiling for in order to pass an extra
    64995101      # flag for every libtool invocation.
    65005102      # allow_undefined=no
    65015103
    65025104      # FIXME: Unfortunately, there are problems with the above when trying
    6503       # to make a dll that has undefined symbols, in which case not
     5105      # to make a dll which has undefined symbols, in which case not
    65045106      # even a static library is built.  For now, we need to specify
    65055107      # -no-undefined on the libtool link line when we can be certain
     
    65455147    no_install=no
    65465148    objs=
    6547     os2dllname=
    65485149    non_pic_objects=
    65495150    precious_files_regex=
    65505151    prefer_static_libs=no
    6551     preload=false
     5152    preload=no
    65525153    prev=
    65535154    prevarg=
     
    65615162    vinfo_number=no
    65625163    weak_libs=
    6563     single_module=$wl-single_module
     5164    single_module="${wl}-single_module"
    65645165    func_infer_tag $base_compile
    65655166
     
    65695170      case $arg in
    65705171      -shared)
    6571         test yes != "$build_libtool_libs" \
    6572           && func_fatal_configuration "cannot build a shared library"
     5172        test "$build_libtool_libs" != yes && \
     5173          func_fatal_configuration "can not build a shared library"
    65735174        build_old_libs=no
    65745175        break
     
    65775178        case $arg in
    65785179        -all-static)
    6579           if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
     5180          if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
    65805181            func_warning "complete static linking is impossible in this configuration"
    65815182          fi
     
    66105211    # Go through the arguments, transforming them on the way.
    66115212    while test "$#" -gt 0; do
    6612       arg=$1
     5213      arg="$1"
    66135214      shift
    66145215      func_quote_for_eval "$arg"
     
    66275228        case $prev in
    66285229        bindir)
    6629           bindir=$arg
     5230          bindir="$arg"
    66305231          prev=
    66315232          continue
    66325233          ;;
    66335234        dlfiles|dlprefiles)
    6634           $preload || {
     5235          if test "$preload" = no; then
    66355236            # Add the symbol object into the linking commands.
    66365237            func_append compile_command " @SYMFILE@"
    66375238            func_append finalize_command " @SYMFILE@"
    6638             preload=:
    6639           }
     5239            preload=yes
     5240          fi
    66405241          case $arg in
    66415242          *.la | *.lo) ;;  # We handle these cases below.
    66425243          force)
    6643             if test no = "$dlself"; then
     5244            if test "$dlself" = no; then
    66445245              dlself=needless
    66455246              export_dynamic=yes
     
    66495250            ;;
    66505251          self)
    6651             if test dlprefiles = "$prev"; then
     5252            if test "$prev" = dlprefiles; then
    66525253              dlself=yes
    6653             elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
     5254            elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
    66545255              dlself=yes
    66555256            else
     
    66615262            ;;
    66625263          *)
    6663             if test dlfiles = "$prev"; then
     5264            if test "$prev" = dlfiles; then
    66645265              func_append dlfiles " $arg"
    66655266            else
     
    66725273          ;;
    66735274        expsyms)
    6674           export_symbols=$arg
     5275          export_symbols="$arg"
    66755276          test -f "$arg" \
    6676             || func_fatal_error "symbol file '$arg' does not exist"
     5277            || func_fatal_error "symbol file \`$arg' does not exist"
    66775278          prev=
    66785279          continue
    66795280          ;;
    66805281        expsyms_regex)
    6681           export_symbols_regex=$arg
     5282          export_symbols_regex="$arg"
    66825283          prev=
    66835284          continue
     
    66975298          ;;
    66985299        inst_prefix)
    6699           inst_prefix_dir=$arg
    6700           prev=
    6701           continue
    6702           ;;
    6703         mllvm)
    6704           # Clang does not use LLVM to link, so we can simply discard any
    6705           # '-mllvm $arg' options when doing the link step.
     5300          inst_prefix_dir="$arg"
    67065301          prev=
    67075302          continue
     
    67275322                if test -z "$pic_object" ||
    67285323                   test -z "$non_pic_object" ||
    6729                    test none = "$pic_object" &&
    6730                    test none = "$non_pic_object"; then
    6731                   func_fatal_error "cannot find name of object for '$arg'"
     5324                   test "$pic_object" = none &&
     5325                   test "$non_pic_object" = none; then
     5326                  func_fatal_error "cannot find name of object for \`$arg'"
    67325327                fi
    67335328
    67345329                # Extract subdirectory from the argument.
    67355330                func_dirname "$arg" "/" ""
    6736                 xdir=$func_dirname_result
    6737 
    6738                 if test none != "$pic_object"; then
     5331                xdir="$func_dirname_result"
     5332
     5333                if test "$pic_object" != none; then
    67395334                  # Prepend the subdirectory the object is found in.
    6740                   pic_object=$xdir$pic_object
    6741 
    6742                   if test dlfiles = "$prev"; then
    6743                     if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
     5335                  pic_object="$xdir$pic_object"
     5336
     5337                  if test "$prev" = dlfiles; then
     5338                    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
    67445339                      func_append dlfiles " $pic_object"
    67455340                      prev=
     
    67525347
    67535348                  # CHECK ME:  I think I busted this.  -Ossama
    6754                   if test dlprefiles = "$prev"; then
     5349                  if test "$prev" = dlprefiles; then
    67555350                    # Preload the old-style object.
    67565351                    func_append dlprefiles " $pic_object"
     
    67605355                  # A PIC object.
    67615356                  func_append libobjs " $pic_object"
    6762                   arg=$pic_object
     5357                  arg="$pic_object"
    67635358                fi
    67645359
    67655360                # Non-PIC object.
    6766                 if test none != "$non_pic_object"; then
     5361                if test "$non_pic_object" != none; then
    67675362                  # Prepend the subdirectory the object is found in.
    6768                   non_pic_object=$xdir$non_pic_object
     5363                  non_pic_object="$xdir$non_pic_object"
    67695364
    67705365                  # A standard non-PIC object
    67715366                  func_append non_pic_objects " $non_pic_object"
    6772                   if test -z "$pic_object" || test none = "$pic_object"; then
    6773                     arg=$non_pic_object
     5367                  if test -z "$pic_object" || test "$pic_object" = none ; then
     5368                    arg="$non_pic_object"
    67745369                  fi
    67755370                else
    67765371                  # If the PIC object exists, use it instead.