Ignore:
Timestamp:
09/17/16 18:59:54 (8 years ago)
Author:
tbretz
Message:
Upadted the build system from a current Ubuntu 16.04 -- let's see if it works on older systems as well.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/.aux_dir/ltmain.sh

    r14328 r18603  
    1 
    2 # libtool (GNU libtool) 2.4.2
     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.
    37# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
    48
    5 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
    6 # 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
     9# Copyright (C) 1996-2015 Free Software Foundation, Inc.
    710# This is free software; see the source for copying conditions.  There is NO
    811# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     
    2427#
    2528# You should have received a copy of the GNU General Public License
    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-1ubuntu1
    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/>.
     29# along with this program.  If not, see <http://www.gnu.org/licenses/>.
     30
    8031
    8132PROGRAM=libtool
    8233PACKAGE=libtool
    83 VERSION="2.4.2 Debian-2.4.2-1ubuntu1"
    84 TIMESTAMP=""
    85 package_revision=1.3337
    86 
    87 # Be Bourne compatible
    88 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
     34VERSION="2.4.6 Debian-2.4.6-0.1"
     35package_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.
     67scriptversion=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
     117DUALCASE=1; export DUALCASE # for MKS sh
     118if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
    89119  emulate sh
    90120  NULLCMD=:
    91   # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
     121  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
    92122  # is contrary to our usage.  Disable this feature.
    93123  alias -g '${1+"$@"}'='"$@"'
    94124  setopt NO_GLOB_SUBST
    95125else
    96   case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
     126  case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
    97127fi
    98 BIN_SH=xpg4; export BIN_SH # for Tru64
    99 DUALCASE=1; export DUALCASE # for MKS sh
    100 
    101 # A function that is used when there is no print builtin or printf.
    102 func_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.
    110 lt_user_locale=
    111 lt_safe_locale=
    112 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
     128
     129# NLS nuisances: We save the old values in case they are required later.
     130_G_user_locale=
     131_G_safe_locale=
     132for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
    113133do
    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\"
     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\"
    120140        fi"
    121141done
    122 LC_ALL=C
    123 LANGUAGE=C
    124 export LANGUAGE LC_ALL
    125 
    126 $lt_unset CDPATH
    127 
     142
     143# CDPATH.
     144(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
     145
     146# Make sure IFS has a sensible default
     147sp=' '
     148nl='
     149'
     150IFS="$sp        $nl"
     151
     152# There are apparently some retarded systems that use ';' as a PATH separator!
     153if 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  }
     159fi
     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.
     171func_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.
     187func_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.
     228test -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.
     270test -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.
     311
     312: ${CP="cp -f"}
     313: ${ECHO="printf %s\n"}
     314: ${EGREP="$GREP -E"}
     315: ${FGREP="$GREP -F"}
     316: ${LN_S="ln -s"}
     317: ${MAKE="make"}
     318: ${MKDIR="mkdir"}
     319: ${MV="mv -f"}
     320: ${RM="rm -f"}
     321: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
     322
     323
     324## -------------------- ##
     325## Useful sed snippets. ##
     326## -------------------- ##
     327
     328sed_dirname='s|/[^/]*$||'
     329sed_basename='s|^.*/||'
     330
     331# Sed substitution that helps us do robust quoting.  It backslashifies
     332# metacharacters that are still active within double-quoted strings.
     333sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
     334
     335# Same as above, but do not quote variable references.
     336sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
     337
     338# Sed substitution that turns a string into a regex matching for the
     339# string literally.
     340sed_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.
     345sed_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='\$'
     356sed_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
     381EXIT_SUCCESS=0
     382EXIT_FAILURE=1
     383EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
     384EXIT_SKIP=77      # $? = 77 is used to indicate a skipped test to automake.
     385
     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
     391debug_cmd=${debug_cmd-":"}
     392exit_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.
     401exit_status=$EXIT_SUCCESS
    128402
    129403# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
     
    132406# positional parameter $0, within a function call, is the name of the
    133407# function.
    134 progpath="$0"
    135 
    136 
    137 
    138 : ${CP="cp -f"}
    139 test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
    140 : ${MAKE="make"}
    141 : ${MKDIR="mkdir"}
    142 : ${MV="mv -f"}
    143 : ${RM="rm -f"}
    144 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
    145 : ${Xsed="$SED -e 1s/^X//"}
    146 
    147 # Global variables:
    148 EXIT_SUCCESS=0
    149 EXIT_FAILURE=1
    150 EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
    151 EXIT_SKIP=77      # $? = 77 is used to indicate a skipped test to automake.
    152 
    153 exit_status=$EXIT_SUCCESS
    154 
    155 # Make sure IFS has a sensible default
    156 lt_nl='
    157 '
    158 IFS="   $lt_nl"
    159 
    160 dirname="s,/[^/]*$,,"
    161 basename="s,^.*/,,"
    162 
    163 # func_dirname file append nondir_replacement
     408progpath=$0
     409
     410# The name of this program.
     411progname=`$ECHO "$progpath" |$SED "$sed_basename"`
     412
     413# Make sure we have an absolute progpath for reexecution:
     414case $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     ;;
     432esac
     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
     443opt_dry_run=false
     444opt_quiet=false
     445opt_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.
     450warning_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.
     455warning_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.
     460opt_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.
     482require_term_colors=func_require_term_colors
     483func_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
     554if test yes = "$_G_HAVE_PLUSEQ_OP"
     555then
     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  }'
     563else
     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  }
     571fi
     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.
     578if 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  }'
     586else
     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  }
     594fi
     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).
     607func_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
     628if test yes = "$_G_HAVE_ARITH_OP"; then
     629  eval 'func_arith ()
     630  {
     631    $debug_cmd
     632
     633    func_arith_result=$(( $* ))
     634  }'
     635else
     636  func_arith ()
     637  {
     638    $debug_cmd
     639
     640    func_arith_result=`expr "$@"`
     641  }
     642fi
     643
     644
     645# func_basename FILE
     646# ------------------
     647# Set func_basename_result to FILE with everything up to and including
     648# the last / stripped.
     649if 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
     659else
     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'
     668fi
     669
     670eval 'func_basename ()
     671{
     672    $debug_cmd
     673
     674    '"$_b"'
     675}'
     676
     677
     678# func_dirname FILE APPEND NONDIR_REPLACEMENT
     679# -------------------------------------------
    164680# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
    165681# otherwise set result to NONDIR_REPLACEMENT.
    166 func_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
    178 func_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
     682eval '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
    186693# call:
    187694#   dirname:  Compute the dirname of FILE.  If nonempty,
     
    191698#   basename: Compute filename of FILE.
    192699#             value retuned in "$func_basename_result"
    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.
    196 func_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}"
     700# For efficiency, we do not delegate to the functions above but instead
     701# duplicate the functionality here.
     702eval '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.
     714func_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.
     733func_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.
     743func_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.
     778func_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.
     791func_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.
     803func_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
     820if test yes = "$_G_HAVE_XSI_OPS"; then
     821  eval 'func_len ()
     822  {
     823    $debug_cmd
     824
     825    func_len_result=${#1}
     826  }'
     827else
     828  func_len ()
     829  {
     830    $debug_cmd
     831
     832    func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
     833  }
     834fi
     835
     836
     837# func_mkdir_p DIRECTORY-PATH
     838# ---------------------------
     839# Make sure the entire path to DIRECTORY-PATH is available.
     840func_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'"
     881    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.
     890func_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-$$
    202899    else
    203       func_dirname_result="$func_dirname_result${2}"
     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'"
    204917    fi
    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
    215 func_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.
    225 pathcar='s,^/\([^/]*\).*$,\1,'
    226 pathcdr='s,^/[^/]*,,'
    227 removedotparts=':dotsl
    228                 s@/\./@/@g
    229                 t dotsl
    230                 s,/\.$,/,'
    231 collapseslashes='s@/\{1,\}@/@g'
    232 finalslash='s,/*$,/,'
     918
     919    $ECHO "$_G_tmpdir"
     920}
     921
    233922
    234923# func_normal_abspath PATH
     924# ------------------------
    235925# Remove doubled-up and trailing slashes, "." path components,
    236926# and cancel out any ".." path components in PATH after making
    237927# it an absolute path.
    238 #             value returned in "$func_normal_abspath_result"
    239928func_normal_abspath ()
    240929{
    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"`
     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
     947      "")
     948        # Empty path, that just means $cwd.
     949        func_stripname '' '/' "`pwd`"
     950        func_normal_abspath_result=$func_stripname_result
     951        return
     952        ;;
     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.
     967        ;;
     968      *)
     969        # Relative path, prepend $cwd.
     970        func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
     971        ;;
     972    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.
    288977    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
    292       "")
    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"
    315 func_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
    331         ;;
    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=.
     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=/
    338985        fi
    339986        break
    340         ;;
    341       *)
    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
    351         ;;
    352     esac
    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:
    373 func_dirname_and_basename "$progpath"
    374 progname=$func_basename_result
    375 
    376 # Make sure we have an absolute path for reexecution:
    377 case $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      ;;
    395 esac
    396 
    397 # Sed substitution that helps us do robust quoting.  It backslashifies
    398 # metacharacters that are still active within double-quoted strings.
    399 Xsed="${SED}"' -e 1s/^X//'
    400 sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
    401 
    402 # Same as above, but do not quote variable references.
    403 double_quote_subst='s/\(["`\\]\)/\\\1/g'
    404 
    405 # Sed substitution that turns a string into a regex matching for the
    406 # string literally.
    407 sed_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.
    412 lt_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 '$'.
    419 bs='\\'
    420 bs2='\\\\'
    421 bs4='\\\\\\\\'
    422 dollar='\$'
    423 sed_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:
    431 opt_dry_run=false
    432 opt_help=false
    433 opt_quiet=false
    434 opt_verbose=false
    435 opt_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.
    440 func_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.
    447 func_verbose ()
    448 {
    449     $opt_verbose && func_echo ${1+"$@"}
     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.
     1016func_notquiet ()
     1017{
     1018    $debug_cmd
     1019
     1020    $opt_quiet || func_echo ${1+"$@"}
    4501021
    4511022    # A bug in bash halts the script if the last line of a function
     
    4551026}
    4561027
    457 # func_echo_all arg...
    458 # Invoke $ECHO with all args, space-separated.
    459 func_echo_all ()
    460 {
    461     $ECHO "$*"
    462 }
    463 
    464 # func_error arg...
    465 # Echo program name prefixed message to standard error.
    466 func_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.
    473 func_warning ()
    474 {
    475     $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
    476 
    477     # bash bug again:
     1028
     1029# func_relative_path SRCDIR DSTDIR
     1030# --------------------------------
     1031# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
     1032func_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          ;;
     1071      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"
     1080    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
     1086    fi
     1087
     1088    test -n "$func_relative_path_result" || func_relative_path_result=.
     1089
    4781090    :
    4791091}
    4801092
    481 # func_fatal_error arg...
    482 # Echo program name prefixed message to standard error, and exit.
    483 func_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.
    492 func_fatal_help ()
    493 {
    494     func_error ${1+"$@"}
    495     func_fatal_error "$help"
    496 }
    497 help="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.
    502 func_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.
    510 func_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" ;;
     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.
     1103func_quote_for_eval ()
     1104{
     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 ;;
    5201115      esac
    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'"
    549     fi
    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.
    557 func_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
     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"
    5771120      fi
    5781121
    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'"
    582     fi
    583 
    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.
    594 func_quote_for_eval ()
    595 {
    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
     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# -------------------------
    6191148# Aesthetically quote ARG to be evaled later; same as above,
    6201149# but do not quote variable references.
    6211150func_quote_for_expand ()
    6221151{
     1152    $debug_cmd
     1153
    6231154    case $1 in
    6241155      *[\\\`\"]*)
    625         my_arg=`$ECHO "$1" | $SED \
    626             -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
     1156        _G_arg=`$ECHO "$1" | $SED \
     1157            -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
    6271158      *)
    628         my_arg="$1" ;;
     1159        _G_arg=$1 ;;
    6291160    esac
    6301161
    631     case $my_arg in
     1162    case $_G_arg in
    6321163      # Double-quote args containing shell metacharacters to delay
    6331164      # word splitting and command substitution for a subsequent eval.
     
    6351166      # in scan sets, so we specify it separately.
    6361167      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
    637         my_arg="\"$my_arg\""
     1168        _G_arg=\"$_G_arg\"
    6381169        ;;
    6391170    esac
    6401171
    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
     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).
     1182if 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  }'
     1193else
     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  }
     1203fi
     1204
     1205
     1206# func_show_eval CMD [FAIL_EXP]
     1207# -----------------------------
     1208# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
    6471209# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
    6481210# is given, then evaluate it.
    6491211func_show_eval ()
    6501212{
    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"
     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"
     1226      fi
    6571227    }
    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"
    664       fi
    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
     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
    6711234# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
    6721235# is given, then evaluate it.  Use the saved locale for evaluation.
    6731236func_show_eval_locale ()
    6741237{
    675     my_cmd="$1"
    676     my_fail_exp="${2-:}"
    677 
    678     ${opt_silent-false} || {
    679       func_quote_for_expand "$my_cmd"
     1238    $debug_cmd
     1239
     1240    _G_cmd=$1
     1241    _G_fail_exp=${2-':'}
     1242
     1243    $opt_quiet || {
     1244      func_quote_for_expand "$_G_cmd"
    6801245      eval "func_echo $func_quote_for_expand_result"
    6811246    }
    6821247
    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"
     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"
    6901255      fi
    691     fi
    692 }
     1256    }
     1257}
     1258
    6931259
    6941260# func_tr_sh
     1261# ----------
    6951262# Turn $1 into a string suitable for a shell variable name.
    6961263# Result is stored in $func_tr_sh_result.  All characters
     
    6991266func_tr_sh ()
    7001267{
    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.
    714 func_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.
    737 func_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.
     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.
     1284func_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.
     1297func_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'.
     1313func_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.
     1341func_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 "..."
     1355func_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.
     1373scriptversion=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.
     1448usage='$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.
     1453usage_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'.
     1463long_help_message="
     1464Warning 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.
     1470fatal_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 ...'.
     1486func_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'.
     1498func_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.
     1514func_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.
     1529func_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.
     1628func_hookable func_options
     1629func_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.
     1655func_hookable func_options_prep
     1656func_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.
     1674func_hookable func_parse_options
     1675func_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.
     1776func_hookable func_validate_options
     1777func_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.
     1807func_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.
    7551821func_help ()
    7561822{
    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
     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# ------------------------
    7851833# Echo program name prefixed message to standard error and set global
    7861834# exit_cmd.
    7871835func_missing_arg ()
    7881836{
    789     $opt_debug
    790 
    791     func_error "missing argument for $1."
     1837    $debug_cmd
     1838
     1839    func_error "Missing argument for '$1'."
    7921840    exit_cmd=exit
    7931841}
    7941842
    7951843
    796 # func_split_short_opt shortopt
     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.
     1848test -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
     1853if test yes = "$_G_HAVE_XSI_OPS"
     1854then
     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  }'
     1865else
     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  }
     1876fi #func_split_equals
     1877
     1878
     1879# func_split_short_opt SHORTOPT
     1880# -----------------------------
    7971881# Set func_split_short_opt_name and func_split_short_opt_arg shell
    7981882# variables after splitting SHORTOPT after the 2nd character.
    799 func_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.
    812 func_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 
    821 exit_cmd=:
    822 
    823 
    824 
    825 
    826 
    827 magic="%%%MAGIC variable%%%"
    828 magic_exe="%%%MAGIC EXE variable%%%"
    829 
    830 # Global variables.
    831 nonopt=
    832 preserve_args=
    833 lo2o="s/\\.lo\$/.${objext}/"
    834 o2lo="s/\\.${objext}\$/.lo/"
    835 extracted_archives=
    836 extracted_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.
    841 exec_cmd=
    842 
    843 # func_append var value
    844 # Append VALUE to the end of shell variable VAR.
    845 func_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.
    853 func_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...
    861 func_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.
    869 func_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
    876 func_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
    883 func_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...
     1883if test yes = "$_G_HAVE_XSI_OPS"
     1884then
     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  }'
     1893else
     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  }
     1902fi #func_split_short_opt
     1903
     1904
     1905# func_usage
     1906# ----------
     1907# Echo short help message to standard output and exit.
     1908func_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.
     1921func_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.
     1941func_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.
     1980scriptversion='(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.
     1987func_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.
     2007func_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
     2022usage='$progpath [OPTION]... [MODE-ARG]...'
     2023
     2024# Short help message in response to '-h'.
     2025usage_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'.
     2042func_help ()
     2043{
     2044    $debug_cmd
     2045
     2046    func_usage_message
     2047    $ECHO "$long_help_message
     2048
     2049MODE 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
     2059MODE-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.
     2061Try '$progname --help --mode=MODE' for a more detailed description of MODE.
     2062
     2063When reporting a bug, please describe a test case to reproduce it and
     2064include 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
     2075Report bugs to <bug-libtool@gnu.org>.
     2076GNU libtool home page: <http://www.gnu.org/s/libtool/>.
     2077General 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
     2087lo2o=s/\\.lo\$/.$objext/
     2088o2lo=s/\\.$objext\$/.lo/
     2089
     2090if 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  }'
     2107else
     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  }
     2118fi
     2119
     2120
     2121# func_fatal_configuration ARG...
     2122# -------------------------------
    8902123# Echo program name prefixed message to standard error, followed by
    8912124# a configuration failure hint, and exit.
    8922125func_fatal_configuration ()
    8932126{
    894     func_error ${1+"$@"}
    895     func_error "See the $PACKAGE documentation for more information."
    896     func_fatal_error "Fatal configuration error."
     2127    func__fatal_error ${1+"$@"} \
     2128      "See the $PACKAGE documentation for more information." \
     2129      "Fatal configuration error."
    8972130}
    8982131
    8992132
    9002133# func_config
     2134# -----------
    9012135# Display the configuration for all the tags in this script.
    9022136func_config ()
     
    9162150}
    9172151
     2152
    9182153# func_features
     2154# -------------
    9192155# Display the features supported by this script.
    9202156func_features ()
    9212157{
    9222158    echo "host: $host"
    923     if test "$build_libtool_libs" = yes; then
     2159    if test yes = "$build_libtool_libs"; then
    9242160      echo "enable shared libraries"
    9252161    else
    9262162      echo "disable shared libraries"
    9272163    fi
    928     if test "$build_old_libs" = yes; then
     2164    if test yes = "$build_old_libs"; then
    9292165      echo "enable static libraries"
    9302166    else
     
    9352171}
    9362172
    937 # func_enable_tag tagname
     2173
     2174# func_enable_tag TAGNAME
     2175# -----------------------
    9382176# Verify that TAGNAME is valid, and either flag an error and exit, or
    9392177# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
     
    9412179func_enable_tag ()
    9422180{
    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) ;;
     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) ;;
    9612199    *)
    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 }
     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
    9772216
    9782217# func_check_version_match
     2218# ------------------------
    9792219# Ensure that we are using m4 macros, and libtool script from the same
    9802220# release of libtool.
    9812221func_check_version_match ()
    9822222{
    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
     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
    9872227$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
    9882228$progname: definition of this LT_INIT comes from an older release.
     
    9902230$progname: and run autoconf again.
    9912231_LT_EOF
    992       else
    993         cat >&2 <<_LT_EOF
     2232        else
     2233          cat >&2 <<_LT_EOF
    9942234$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
    9952235$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
     
    9972237$progname: and run autoconf again.
    9982238_LT_EOF
    999       fi
    1000     else
    1001       cat >&2 <<_LT_EOF
     2239        fi
     2240      else
     2241        cat >&2 <<_LT_EOF
    10022242$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
    10032243$progname: but the definition of this LT_INIT comes from revision $macro_revision.
     
    10052245$progname: of $PACKAGE $VERSION and run autoconf again.
    10062246_LT_EOF
     2247      fi
     2248
     2249      exit $EXIT_MISMATCH
    10072250    fi
    1008 
    1009     exit $EXIT_MISMATCH
    1010   fi
    1011 }
    1012 
    1013 
    1014 # Shorthand for --mode=foo, only valid as the first argument
    1015 case $1 in
    1016 clean|clea|cle|cl)
    1017   shift; set dummy --mode clean ${1+"$@"}; shift
    1018   ;;
    1019 compile|compil|compi|comp|com|co|c)
    1020   shift; set dummy --mode compile ${1+"$@"}; shift
    1021   ;;
    1022 execute|execut|execu|exec|exe|ex|e)
    1023   shift; set dummy --mode execute ${1+"$@"}; shift
    1024   ;;
    1025 finish|finis|fini|fin|fi|f)
    1026   shift; set dummy --mode finish ${1+"$@"}; shift
    1027   ;;
    1028 install|instal|insta|inst|ins|in|i)
    1029   shift; set dummy --mode install ${1+"$@"}; shift
    1030   ;;
    1031 link|lin|li|l)
    1032   shift; set dummy --mode link ${1+"$@"}; shift
    1033   ;;
    1034 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
    1035   shift; set dummy --mode uninstall ${1+"$@"}; shift
    1036   ;;
    1037 esac
    1038 
    1039 
    1040 
    1041 # Option defaults:
    1042 opt_debug=:
    1043 opt_dry_run=false
    1044 opt_config=false
    1045 opt_preserve_dup_deps=false
    1046 opt_features=false
    1047 opt_finish=false
    1048 opt_help=false
    1049 opt_help_all=false
    1050 opt_silent=:
    1051 opt_warning=:
    1052 opt_verbose=:
    1053 opt_silent=false
    1054 opt_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=:
    1074 func_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=:
    1087 func_features
    1088                         ;;
    1089       --finish)
    1090                         opt_finish=:
    1091 set dummy --mode finish ${1+"$@"}; shift
    1092                         ;;
    1093       --help)
    1094                         opt_help=:
    1095                         ;;
    1096       --help-all)
    1097                         opt_help_all=:
    1098 opt_help=': help-all'
    1099                         ;;
    1100       --mode)
    1101                         test $# = 0 && func_missing_arg $opt && break
    1102                         optarg="$1"
    1103                         opt_mode="$optarg"
    1104 case $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      ;;
    1113 esac
    1114                         shift
    1115                         ;;
    1116       --no-silent|--no-quiet)
    1117                         opt_silent=false
    1118 func_append preserve_args " $opt"
    1119                         ;;
    1120       --no-warning|--no-warn)
    1121                         opt_warning=false
    1122 func_append preserve_args " $opt"
    1123                         ;;
    1124       --no-verbose)
    1125                         opt_verbose=false
    1126 func_append preserve_args " $opt"
    1127                         ;;
    1128       --silent|--quiet)
    1129                         opt_silent=:
    1130 func_append preserve_args " $opt"
    1131         opt_verbose=false
    1132                         ;;
    1133       --verbose|-v)
    1134                         opt_verbose=:
    1135 func_append preserve_args " $opt"
    1136 opt_silent=false
    1137                         ;;
    1138       --tag)
    1139                         test $# = 0 && func_missing_arg $opt && break
    1140                         optarg="$1"
    1141                         opt_tag="$optarg"
    1142 func_append preserve_args " $opt $optarg"
    1143 func_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  ;;
     2251}
     2252
     2253
     2254# libtool_options_prep [ARG]...
     2255# -----------------------------
     2256# Preparation for options parsed by libtool.
     2257libtool_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
     2277      ;;
     2278    compile|compil|compi|comp|com|co|c)
     2279      shift; set dummy --mode compile ${1+"$@"}; shift
     2280      ;;
     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      ;;
    11682296    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=:
    1186       ;;
    1187     *)
    1188       opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
    1189       ;;
    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"
     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}
     2302func_add_hook func_options_prep libtool_options_prep
     2303
     2304
     2305# libtool_parse_options [ARG]...
     2306# ---------------------------------
     2307# Provide handling for libtool specific options.
     2308libtool_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}
     2399func_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.
     2407libtool_validate_options ()
     2408{
     2409    # save first non-option argument
     2410    if test 0 -lt $#; then
     2411      nonopt=$1
     2412      shift
    11982413    fi
    11992414
    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 
     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}
     2457func_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.
     2462func_options ${1+"$@"}
     2463eval set dummy "$func_options_result"; shift
    12202464
    12212465
     
    12252469## ----------- ##
    12262470
     2471magic='%%%MAGIC variable%%%'
     2472magic_exe='%%%MAGIC EXE variable%%%'
     2473
     2474# Global variables.
     2475extracted_archives=
     2476extracted_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.
     2481exec_cmd=
     2482
     2483
     2484# A function that is used when there is no print builtin or printf.
     2485func_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.
     2495func_generated_by_libtool_p ()
     2496{
     2497  $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
     2498}
     2499
    12272500# func_lalib_p file
    1228 # True iff FILE is a libtool `.la' library or `.lo' object file.
     2501# True iff FILE is a libtool '.la' library or '.lo' object file.
    12292502# This function is only a basic sanity check; it will hardly flush out
    12302503# determined imposters.
     
    12322505{
    12332506    test -f "$1" &&
    1234       $SED -e 4q "$1" 2>/dev/null \
    1235         | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
     2507      $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p
    12362508}
    12372509
    12382510# func_lalib_unsafe_p file
    1239 # True iff FILE is a libtool `.la' library or `.lo' object file.
     2511# True iff FILE is a libtool '.la' library or '.lo' object file.
    12402512# This function implements the same check as func_lalib_p without
    12412513# resorting to external programs.  To this end, it redirects stdin and
    12422514# closes it afterwards, without saving the original file descriptor.
    12432515# As a safety measure, use it only where a negative result would be
    1244 # fatal anyway.  Works if `file' does not exist.
     2516# fatal anyway.  Works if 'file' does not exist.
    12452517func_lalib_unsafe_p ()
    12462518{
     
    12502522        do
    12512523            read lalib_p_line
    1252             case "$lalib_p_line" in
     2524            case $lalib_p_line in
    12532525                \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
    12542526            esac
     
    12562528        exec 0<&5 5<&-
    12572529    fi
    1258     test "$lalib_p" = yes
     2530    test yes = "$lalib_p"
    12592531}
    12602532
     
    12652537func_ltwrapper_script_p ()
    12662538{
    1267     func_lalib_p "$1"
     2539    test -f "$1" &&
     2540      $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p
    12682541}
    12692542
     
    12902563    func_dirname_and_basename "$1" "" "."
    12912564    func_stripname '' '.exe' "$func_basename_result"
    1292     func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
     2565    func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
    12932566}
    12942567
     
    13092582func_execute_cmds ()
    13102583{
    1311     $opt_debug
     2584    $debug_cmd
     2585
    13122586    save_ifs=$IFS; IFS='~'
    13132587    for cmd in $1; do
     2588      IFS=$sp$nl
     2589      eval cmd=\"$cmd\"
    13142590      IFS=$save_ifs
    1315       eval cmd=\"$cmd\"
    13162591      func_show_eval "$cmd" "${2-:}"
    13172592    done
     
    13252600# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
    13262601# behavior happens only for exec(3), not for open(2)!  Also, sourcing
    1327 # `FILE.' does not work on cygwin managed mounts.
     2602# 'FILE.' does not work on cygwin managed mounts.
    13282603func_source ()
    13292604{
    1330     $opt_debug
     2605    $debug_cmd
     2606
    13312607    case $1 in
    13322608    */* | *\\*) . "$1" ;;
     
    13552631func_replace_sysroot ()
    13562632{
    1357   case "$lt_sysroot:$1" in
     2633  case $lt_sysroot:$1 in
    13582634  ?*:"$lt_sysroot"*)
    13592635    func_stripname "$lt_sysroot" '' "$1"
    1360     func_replace_sysroot_result="=$func_stripname_result"
     2636    func_replace_sysroot_result='='$func_stripname_result
    13612637    ;;
    13622638  *)
     
    13752651func_infer_tag ()
    13762652{
    1377     $opt_debug
     2653    $debug_cmd
     2654
    13782655    if test -n "$available_tags" && test -z "$tagname"; then
    13792656      CC_quoted=
     
    13942671          if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
    13952672            # Evaluate the configuration.
    1396             eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
     2673            eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
    13972674            CC_quoted=
    13982675            for arg in $CC; do
     
    14192696        if test -z "$tagname"; then
    14202697          func_echo "unable to infer tagged configuration"
    1421           func_fatal_error "specify a tag with \`--tag'"
     2698          func_fatal_error "specify a tag with '--tag'"
    14222699#       else
    14232700#         func_verbose "using $tagname tagged configuration"
     
    14352712func_write_libtool_object ()
    14362713{
    1437     write_libobj=${1}
    1438     if test "$build_libtool_libs" = yes; then
    1439       write_lobj=\'${2}\'
     2714    write_libobj=$1
     2715    if test yes = "$build_libtool_libs"; then
     2716      write_lobj=\'$2\'
    14402717    else
    14412718      write_lobj=none
    14422719    fi
    14432720
    1444     if test "$build_old_libs" = yes; then
    1445       write_oldobj=\'${3}\'
     2721    if test yes = "$build_old_libs"; then
     2722      write_oldobj=\'$3\'
    14462723    else
    14472724      write_oldobj=none
     
    14512728      cat >${write_libobj}T <<EOF
    14522729# $write_libobj - a libtool object file
    1453 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
     2730# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
    14542731#
    14552732# Please DO NOT delete this file!
     
    14632740
    14642741EOF
    1465       $MV "${write_libobj}T" "${write_libobj}"
     2742      $MV "${write_libobj}T" "$write_libobj"
    14662743    }
    14672744}
     
    14832760func_convert_core_file_wine_to_w32 ()
    14842761{
    1485   $opt_debug
    1486   func_convert_core_file_wine_to_w32_result="$1"
     2762  $debug_cmd
     2763
     2764  func_convert_core_file_wine_to_w32_result=$1
    14872765  if test -n "$1"; then
    14882766    # Unfortunately, winepath does not exit with a non-zero error code, so we
     
    14922770    # zero AND non-empty stdout, which explains the odd construction:
    14932771    func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
    1494     if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
     2772    if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
    14952773      func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
    1496         $SED -e "$lt_sed_naive_backslashify"`
     2774        $SED -e "$sed_naive_backslashify"`
    14972775    else
    14982776      func_convert_core_file_wine_to_w32_result=
     
    15152793func_convert_core_path_wine_to_w32 ()
    15162794{
    1517   $opt_debug
     2795  $debug_cmd
     2796
    15182797  # unfortunately, winepath doesn't convert paths, only file names
    1519   func_convert_core_path_wine_to_w32_result=""
     2798  func_convert_core_path_wine_to_w32_result=
    15202799  if test -n "$1"; then
    15212800    oldIFS=$IFS
     
    15242803      IFS=$oldIFS
    15252804      func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
    1526       if test -n "$func_convert_core_file_wine_to_w32_result" ; then
     2805      if test -n "$func_convert_core_file_wine_to_w32_result"; then
    15272806        if test -z "$func_convert_core_path_wine_to_w32_result"; then
    1528           func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
     2807          func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
    15292808        else
    15302809          func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
     
    15552834func_cygpath ()
    15562835{
    1557   $opt_debug
     2836  $debug_cmd
     2837
    15582838  if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
    15592839    func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
     
    15642844  else
    15652845    func_cygpath_result=
    1566     func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
     2846    func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
    15672847  fi
    15682848}
     
    15752855func_convert_core_msys_to_w32 ()
    15762856{
    1577   $opt_debug
     2857  $debug_cmd
     2858
    15782859  # awkward: cmd appends spaces to result
    15792860  func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
    1580     $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
     2861    $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
    15812862}
    15822863#end: func_convert_core_msys_to_w32
     
    15892870func_convert_file_check ()
    15902871{
    1591   $opt_debug
    1592   if test -z "$2" && test -n "$1" ; then
     2872  $debug_cmd
     2873
     2874  if test -z "$2" && test -n "$1"; then
    15932875    func_error "Could not determine host file name corresponding to"
    1594     func_error "  \`$1'"
     2876    func_error "  '$1'"
    15952877    func_error "Continuing, but uninstalled executables may not work."
    15962878    # Fallback:
    1597     func_to_host_file_result="$1"
     2879    func_to_host_file_result=$1
    15982880  fi
    15992881}
     
    16072889func_convert_path_check ()
    16082890{
    1609   $opt_debug
     2891  $debug_cmd
     2892
    16102893  if test -z "$4" && test -n "$3"; then
    16112894    func_error "Could not determine the host path corresponding to"
    1612     func_error "  \`$3'"
     2895    func_error "  '$3'"
    16132896    func_error "Continuing, but uninstalled executables may not work."
    16142897    # Fallback.  This is a deliberately simplistic "conversion" and
     
    16192902        $SED -e "$lt_replace_pathsep_chars"`
    16202903    else
    1621       func_to_host_path_result="$3"
     2904      func_to_host_path_result=$3
    16222905    fi
    16232906  fi
     
    16312914func_convert_path_front_back_pathsep ()
    16322915{
    1633   $opt_debug
     2916  $debug_cmd
     2917
    16342918  case $4 in
    1635   $1 ) func_to_host_path_result="$3$func_to_host_path_result"
     2919  $1 ) func_to_host_path_result=$3$func_to_host_path_result
    16362920    ;;
    16372921  esac
     
    16472931# $build to $host FILE NAME CONVERSION FUNCTIONS #
    16482932##################################################
    1649 # invoked via `$to_host_file_cmd ARG'
     2933# invoked via '$to_host_file_cmd ARG'
    16502934#
    16512935# In each case, ARG is the path to be converted from $build to $host format.
     
    16582942func_to_host_file ()
    16592943{
    1660   $opt_debug
     2944  $debug_cmd
     2945
    16612946  $to_host_file_cmd "$1"
    16622947}
     
    16702955func_to_tool_file ()
    16712956{
    1672   $opt_debug
     2957  $debug_cmd
     2958
    16732959  case ,$2, in
    16742960    *,"$to_tool_file_cmd",*)
     
    16882974func_convert_file_noop ()
    16892975{
    1690   func_to_host_file_result="$1"
     2976  func_to_host_file_result=$1
    16912977}
    16922978# end func_convert_file_noop
     
    16992985func_convert_file_msys_to_w32 ()
    17002986{
    1701   $opt_debug
    1702   func_to_host_file_result="$1"
     2987  $debug_cmd
     2988
     2989  func_to_host_file_result=$1
    17032990  if test -n "$1"; then
    17042991    func_convert_core_msys_to_w32 "$1"
    1705     func_to_host_file_result="$func_convert_core_msys_to_w32_result"
     2992    func_to_host_file_result=$func_convert_core_msys_to_w32_result
    17062993  fi
    17072994  func_convert_file_check "$1" "$func_to_host_file_result"
     
    17153002func_convert_file_cygwin_to_w32 ()
    17163003{
    1717   $opt_debug
    1718   func_to_host_file_result="$1"
     3004  $debug_cmd
     3005
     3006  func_to_host_file_result=$1
    17193007  if test -n "$1"; then
    17203008    # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
     
    17323020func_convert_file_nix_to_w32 ()
    17333021{
    1734   $opt_debug
    1735   func_to_host_file_result="$1"
     3022  $debug_cmd
     3023
     3024  func_to_host_file_result=$1
    17363025  if test -n "$1"; then
    17373026    func_convert_core_file_wine_to_w32 "$1"
    1738     func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
     3027    func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
    17393028  fi
    17403029  func_convert_file_check "$1" "$func_to_host_file_result"
     
    17483037func_convert_file_msys_to_cygwin ()
    17493038{
    1750   $opt_debug
    1751   func_to_host_file_result="$1"
     3039  $debug_cmd
     3040
     3041  func_to_host_file_result=$1
    17523042  if test -n "$1"; then
    17533043    func_convert_core_msys_to_w32 "$1"
    17543044    func_cygpath -u "$func_convert_core_msys_to_w32_result"
    1755     func_to_host_file_result="$func_cygpath_result"
     3045    func_to_host_file_result=$func_cygpath_result
    17563046  fi
    17573047  func_convert_file_check "$1" "$func_to_host_file_result"
     
    17663056func_convert_file_nix_to_cygwin ()
    17673057{
    1768   $opt_debug
    1769   func_to_host_file_result="$1"
     3058  $debug_cmd
     3059
     3060  func_to_host_file_result=$1
    17703061  if test -n "$1"; then
    17713062    # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
    17723063    func_convert_core_file_wine_to_w32 "$1"
    17733064    func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
    1774     func_to_host_file_result="$func_cygpath_result"
     3065    func_to_host_file_result=$func_cygpath_result
    17753066  fi
    17763067  func_convert_file_check "$1" "$func_to_host_file_result"
     
    17823073# $build to $host PATH CONVERSION FUNCTIONS #
    17833074#############################################
    1784 # invoked via `$to_host_path_cmd ARG'
     3075# invoked via '$to_host_path_cmd ARG'
    17853076#
    17863077# In each case, ARG is the path to be converted from $build to $host format.
     
    18063097func_init_to_host_path_cmd ()
    18073098{
    1808   $opt_debug
     3099  $debug_cmd
     3100
    18093101  if test -z "$to_host_path_cmd"; then
    18103102    func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
    1811     to_host_path_cmd="func_convert_path_${func_stripname_result}"
     3103    to_host_path_cmd=func_convert_path_$func_stripname_result
    18123104  fi
    18133105}
     
    18193111func_to_host_path ()
    18203112{
    1821   $opt_debug
     3113  $debug_cmd
     3114
    18223115  func_init_to_host_path_cmd
    18233116  $to_host_path_cmd "$1"
     
    18303123func_convert_path_noop ()
    18313124{
    1832   func_to_host_path_result="$1"
     3125  func_to_host_path_result=$1
    18333126}
    18343127# end func_convert_path_noop
     
    18413134func_convert_path_msys_to_w32 ()
    18423135{
    1843   $opt_debug
    1844   func_to_host_path_result="$1"
     3136  $debug_cmd
     3137
     3138  func_to_host_path_result=$1
    18453139  if test -n "$1"; then
    18463140    # Remove leading and trailing path separator characters from ARG.  MSYS
     
    18503144    func_to_host_path_tmp1=$func_stripname_result
    18513145    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
    1852     func_to_host_path_result="$func_convert_core_msys_to_w32_result"
     3146    func_to_host_path_result=$func_convert_core_msys_to_w32_result
    18533147    func_convert_path_check : ";" \
    18543148      "$func_to_host_path_tmp1" "$func_to_host_path_result"
     
    18643158func_convert_path_cygwin_to_w32 ()
    18653159{
    1866   $opt_debug
    1867   func_to_host_path_result="$1"
     3160  $debug_cmd
     3161
     3162  func_to_host_path_result=$1
    18683163  if test -n "$1"; then
    18693164    # See func_convert_path_msys_to_w32:
     
    18843179func_convert_path_nix_to_w32 ()
    18853180{
    1886   $opt_debug
    1887   func_to_host_path_result="$1"
     3181  $debug_cmd
     3182
     3183  func_to_host_path_result=$1
    18883184  if test -n "$1"; then
    18893185    # See func_convert_path_msys_to_w32:
     
    18913187    func_to_host_path_tmp1=$func_stripname_result
    18923188    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
    1893     func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
     3189    func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
    18943190    func_convert_path_check : ";" \
    18953191      "$func_to_host_path_tmp1" "$func_to_host_path_result"
     
    19053201func_convert_path_msys_to_cygwin ()
    19063202{
    1907   $opt_debug
    1908   func_to_host_path_result="$1"
     3203  $debug_cmd
     3204
     3205  func_to_host_path_result=$1
    19093206  if test -n "$1"; then
    19103207    # See func_convert_path_msys_to_w32:
     
    19133210    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
    19143211    func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
    1915     func_to_host_path_result="$func_cygpath_result"
     3212    func_to_host_path_result=$func_cygpath_result
    19163213    func_convert_path_check : : \
    19173214      "$func_to_host_path_tmp1" "$func_to_host_path_result"
     
    19283225func_convert_path_nix_to_cygwin ()
    19293226{
    1930   $opt_debug
    1931   func_to_host_path_result="$1"
     3227  $debug_cmd
     3228
     3229  func_to_host_path_result=$1
    19323230  if test -n "$1"; then
    19333231    # Remove leading and trailing path separator characters from
     
    19383236    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
    19393237    func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
    1940     func_to_host_path_result="$func_cygpath_result"
     3238    func_to_host_path_result=$func_cygpath_result
    19413239    func_convert_path_check : : \
    19423240      "$func_to_host_path_tmp1" "$func_to_host_path_result"
     
    19473245
    19483246
     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
     3250func_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
    19493264# func_mode_compile arg...
    19503265func_mode_compile ()
    19513266{
    1952     $opt_debug
     3267    $debug_cmd
     3268
    19533269    # Get the compilation command and the source file.
    19543270    base_compile=
    1955     srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
     3271    srcfile=$nonopt  #  always keep a non-empty value in "srcfile"
    19563272    suppress_opt=yes
    19573273    suppress_output=
     
    19663282      arg  )
    19673283        # do not "continue".  Instead, add this to base_compile
    1968         lastarg="$arg"
     3284        lastarg=$arg
    19693285        arg_mode=normal
    19703286        ;;
    19713287
    19723288      target )
    1973         libobj="$arg"
     3289        libobj=$arg
    19743290        arg_mode=normal
    19753291        continue
     
    19813297        -o)
    19823298          test -n "$libobj" && \
    1983             func_fatal_error "you cannot specify \`-o' more than once"
     3299            func_fatal_error "you cannot specify '-o' more than once"
    19843300          arg_mode=target
    19853301          continue
     
    20103326          args=$func_stripname_result
    20113327          lastarg=
    2012           save_ifs="$IFS"; IFS=','
     3328          save_ifs=$IFS; IFS=,
    20133329          for arg in $args; do
    2014             IFS="$save_ifs"
     3330            IFS=$save_ifs
    20153331            func_append_quoted lastarg "$arg"
    20163332          done
    2017           IFS="$save_ifs"
     3333          IFS=$save_ifs
    20183334          func_stripname ' ' '' "$lastarg"
    20193335          lastarg=$func_stripname_result
     
    20283344          # The previous "srcfile" becomes the current argument.
    20293345          #
    2030           lastarg="$srcfile"
    2031           srcfile="$arg"
     3346          lastarg=$srcfile
     3347          srcfile=$arg
    20323348          ;;
    20333349        esac  #  case $arg
     
    20443360      ;;
    20453361    target)
    2046       func_fatal_error "you must specify a target with \`-o'"
     3362      func_fatal_error "you must specify a target with '-o'"
    20473363      ;;
    20483364    *)
     
    20503366      test -z "$libobj" && {
    20513367        func_basename "$srcfile"
    2052         libobj="$func_basename_result"
     3368        libobj=$func_basename_result
    20533369      }
    20543370      ;;
     
    20703386    *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
    20713387    *)
    2072       func_fatal_error "cannot determine name of library object from \`$libobj'"
     3388      func_fatal_error "cannot determine name of library object from '$libobj'"
    20733389      ;;
    20743390    esac
     
    20793395      case $arg in
    20803396      -shared)
    2081         test "$build_libtool_libs" != yes && \
    2082           func_fatal_configuration "can not build a shared library"
     3397        test yes = "$build_libtool_libs" \
     3398          || func_fatal_configuration "cannot build a shared library"
    20833399        build_old_libs=no
    20843400        continue
     
    21063422    test "X$libobj" != "X$func_quote_for_eval_result" \
    21073423      && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'    &()|`$[]' \
    2108       && func_warning "libobj name \`$libobj' may not contain shell special characters."
     3424      && func_warning "libobj name '$libobj' may not contain shell special characters."
    21093425    func_dirname_and_basename "$obj" "/" ""
    2110     objname="$func_basename_result"
    2111     xdir="$func_dirname_result"
    2112     lobj=${xdir}$objdir/$objname
     3426    objname=$func_basename_result
     3427    xdir=$func_dirname_result
     3428    lobj=$xdir$objdir/$objname
    21133429
    21143430    test -z "$base_compile" && \
     
    21163432
    21173433    # Delete any leftover library objects.
    2118     if test "$build_old_libs" = yes; then
     3434    if test yes = "$build_old_libs"; then
    21193435      removelist="$obj $lobj $libobj ${libobj}T"
    21203436    else
     
    21283444      ;;
    21293445    esac
    2130     if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
     3446    if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
    21313447      # non-PIC code in shared libraries is not supported
    21323448      pic_mode=default
     
    21353451    # Calculate the filename of the output object if compiler does
    21363452    # not support -o with -c
    2137     if test "$compiler_c_o" = no; then
    2138       output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
    2139       lockfile="$output_obj.lock"
     3453    if test no = "$compiler_c_o"; then
     3454      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
     3455      lockfile=$output_obj.lock
    21403456    else
    21413457      output_obj=
     
    21463462    # Lock this critical section if it is needed
    21473463    # We use this script file to make the link, it avoids creating a new file
    2148     if test "$need_locks" = yes; then
     3464    if test yes = "$need_locks"; then
    21493465      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
    21503466        func_echo "Waiting for $lockfile to be removed"
    21513467        sleep 2
    21523468      done
    2153     elif test "$need_locks" = warn; then
     3469    elif test warn = "$need_locks"; then
    21543470      if test -f "$lockfile"; then
    21553471        $ECHO "\
     
    21593475This indicates that another process is trying to use the same
    21603476temporary object file, and libtool could not work around it because
    2161 your compiler does not support \`-c' and \`-o' together.  If you
     3477your compiler does not support '-c' and '-o' together.  If you
    21623478repeat this compilation, it may succeed, by chance, but you had better
    21633479avoid parallel builds (make -j) in this platform, or get a better
     
    21813497
    21823498    # Only build a PIC object if we are building libtool libraries.
    2183     if test "$build_libtool_libs" = yes; then
     3499    if test yes = "$build_libtool_libs"; then
    21843500      # Without this assignment, base_compile gets emptied.
    21853501      fbsd_hideous_sh_bug=$base_compile
    21863502
    2187       if test "$pic_mode" != no; then
     3503      if test no != "$pic_mode"; then
    21883504        command="$base_compile $qsrcfile $pic_flag"
    21893505      else
     
    22023518          'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
    22033519
    2204       if test "$need_locks" = warn &&
     3520      if test warn = "$need_locks" &&
    22053521         test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
    22063522        $ECHO "\
     
    22133529This indicates that another process is trying to use the same
    22143530temporary object file, and libtool could not work around it because
    2215 your compiler does not support \`-c' and \`-o' together.  If you
     3531your compiler does not support '-c' and '-o' together.  If you
    22163532repeat this compilation, it may succeed, by chance, but you had better
    22173533avoid parallel builds (make -j) in this platform, or get a better
     
    22293545
    22303546      # Allow error messages only from the first compilation.
    2231       if test "$suppress_opt" = yes; then
     3547      if test yes = "$suppress_opt"; then
    22323548        suppress_output=' >/dev/null 2>&1'
    22333549      fi
     
    22353551
    22363552    # Only build a position-dependent object if we build old libraries.
    2237     if test "$build_old_libs" = yes; then
    2238       if test "$pic_mode" != yes; then
     3553    if test yes = "$build_old_libs"; then
     3554      if test yes != "$pic_mode"; then
    22393555        # Don't build PIC code
    22403556        command="$base_compile $qsrcfile$pie_flag"
     
    22423558        command="$base_compile $qsrcfile $pic_flag"
    22433559      fi
    2244       if test "$compiler_c_o" = yes; then
     3560      if test yes = "$compiler_c_o"; then
    22453561        func_append command " -o $obj"
    22463562      fi
     
    22513567        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
    22523568
    2253       if test "$need_locks" = warn &&
     3569      if test warn = "$need_locks" &&
    22543570         test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
    22553571        $ECHO "\
     
    22623578This indicates that another process is trying to use the same
    22633579temporary object file, and libtool could not work around it because
    2264 your compiler does not support \`-c' and \`-o' together.  If you
     3580your compiler does not support '-c' and '-o' together.  If you
    22653581repeat this compilation, it may succeed, by chance, but you had better
    22663582avoid parallel builds (make -j) in this platform, or get a better
     
    22823598
    22833599      # Unlock the critical section if it was locked
    2284       if test "$need_locks" != no; then
     3600      if test no != "$need_locks"; then
    22853601        removelist=$lockfile
    22863602        $RM "$lockfile"
     
    22923608
    22933609$opt_help || {
    2294   test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
     3610  test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
    22953611}
    22963612
     
    23123628
    23133629RM is the name of the program to use to delete files associated with each FILE
    2314 (typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
     3630(typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
    23153631to RM.
    23163632
     
    23313647  -prefer-pic       try to build PIC objects only
    23323648  -prefer-non-pic   try to build non-PIC objects only
    2333   -shared           do not build a \`.o' file suitable for static linking
    2334   -static           only build a \`.o' file suitable for static linking
     3649  -shared           do not build a '.o' file suitable for static linking
     3650  -static           only build a '.o' file suitable for static linking
    23353651  -Wc,FLAG          pass FLAG directly to the compiler
    23363652
    2337 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
     3653COMPILE-COMMAND is a command to be used in creating a 'standard' object file
    23383654from the given SOURCEFILE.
    23393655
    23403656The output file name is determined by removing the directory component from
    2341 SOURCEFILE, then substituting the C source code suffix \`.c' with the
    2342 library object suffix, \`.lo'."
     3657SOURCEFILE, then substituting the C source code suffix '.c' with the
     3658library object suffix, '.lo'."
    23433659        ;;
    23443660
     
    23533669  -dlopen FILE      add the directory containing FILE to the library path
    23543670
    2355 This mode sets the library path environment variable according to \`-dlopen'
     3671This mode sets the library path environment variable according to '-dlopen'
    23563672flags.
    23573673
     
    23723688
    23733689The commands that this mode executes may require superuser privileges.  Use
    2374 the \`--dry-run' option if you just want to see what would be executed."
     3690the '--dry-run' option if you just want to see what would be executed."
    23753691        ;;
    23763692
     
    23823698
    23833699INSTALL-COMMAND is the installation command.  The first component should be
    2384 either the \`install' or \`cp' program.
     3700either the 'install' or 'cp' program.
    23853701
    23863702The following components of INSTALL-COMMAND are treated specially:
     
    24083724  -bindir BINDIR    specify path to binaries directory (for systems where
    24093725                    libraries must be found in the PATH setting at runtime)
    2410   -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
     3726  -dlopen FILE      '-dlpreopen' FILE if it cannot be dlopened at runtime
    24113727  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
    24123728  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
     
    24223738  -no-undefined     declare that a library does not refer to external symbols
    24233739  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
    2424   -objectlist FILE  Use a list of object files found in FILE to specify 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)
    24253742  -precious-files-regex REGEX
    24263743                    don't remove output files matching REGEX
     
    24423759  -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
    24433760
    2444 All other options (arguments beginning with \`-') are ignored.
    2445 
    2446 Every other argument is treated as a filename.  Files ending in \`.la' are
     3761All other options (arguments beginning with '-') are ignored.
     3762
     3763Every other argument is treated as a filename.  Files ending in '.la' are
    24473764treated as uninstalled libtool libraries, other files are standard or library
    24483765object files.
    24493766
    2450 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
    2451 only library objects (\`.lo' files) may be specified, and \`-rpath' is
     3767If the OUTPUT-FILE ends in '.la', then a libtool library is created,
     3768only library objects ('.lo' files) may be specified, and '-rpath' is
    24523769required, except when creating a convenience library.
    24533770
    2454 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
    2455 using \`ar' and \`ranlib', or on Windows using \`lib'.
    2456 
    2457 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
     3771If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created
     3772using 'ar' and 'ranlib', or on Windows using 'lib'.
     3773
     3774If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
    24583775is created, otherwise an executable program is created."
    24593776        ;;
     
    24663783
    24673784RM is the name of the program to use to delete files associated with each FILE
    2468 (typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
     3785(typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
    24693786to RM.
    24703787
     
    24743791
    24753792      *)
    2476         func_fatal_help "invalid operation mode \`$opt_mode'"
     3793        func_fatal_help "invalid operation mode '$opt_mode'"
    24773794        ;;
    24783795    esac
    24793796
    24803797    echo
    2481     $ECHO "Try \`$progname --help' for more information about other modes."
     3798    $ECHO "Try '$progname --help' for more information about other modes."
    24823799}
    24833800
    24843801# Now that we've collected a possible --mode arg, show help if necessary
    24853802if $opt_help; then
    2486   if test "$opt_help" = :; then
     3803  if test : = "$opt_help"; then
    24873804    func_mode_help
    24883805  else
     
    24923809        func_mode_help
    24933810      done
    2494     } | sed -n '1p; 2,$s/^Usage:/  or: /p'
     3811    } | $SED -n '1p; 2,$s/^Usage:/  or: /p'
    24953812    {
    24963813      func_help noexit
     
    25003817      done
    25013818    } |
    2502     sed '1d
     3819    $SED '1d
    25033820      /^When reporting/,/^Report/{
    25043821        H
     
    25173834func_mode_execute ()
    25183835{
    2519     $opt_debug
     3836    $debug_cmd
     3837
    25203838    # The first argument is the command name.
    2521     cmd="$nonopt"
     3839    cmd=$nonopt
    25223840    test -z "$cmd" && \
    25233841      func_fatal_help "you must specify a COMMAND"
     
    25263844    for file in $opt_dlopen; do
    25273845      test -f "$file" \
    2528         || func_fatal_help "\`$file' is not a file"
     3846        || func_fatal_help "'$file' is not a file"
    25293847
    25303848      dir=
     
    25363854        # Check to see that this really is a libtool archive.
    25373855        func_lalib_unsafe_p "$file" \
    2538           || func_fatal_help "\`$lib' is not a valid libtool archive"
     3856          || func_fatal_help "'$lib' is not a valid libtool archive"
    25393857
    25403858        # Read the libtool library.
     
    25473865          # Warn if it was a shared library.
    25483866          test -n "$library_names" && \
    2549             func_warning "\`$file' was not linked with \`-export-dynamic'"
     3867            func_warning "'$file' was not linked with '-export-dynamic'"
    25503868          continue
    25513869        fi
    25523870
    25533871        func_dirname "$file" "" "."
    2554         dir="$func_dirname_result"
     3872        dir=$func_dirname_result
    25553873
    25563874        if test -f "$dir/$objdir/$dlname"; then
     
    25583876        else
    25593877          if test ! -f "$dir/$dlname"; then
    2560             func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
     3878            func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
    25613879          fi
    25623880        fi
     
    25663884        # Just add the directory containing the .lo file.
    25673885        func_dirname "$file" "" "."
    2568         dir="$func_dirname_result"
     3886        dir=$func_dirname_result
    25693887        ;;
    25703888
    25713889      *)
    2572         func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
     3890        func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
    25733891        continue
    25743892        ;;
     
    25773895      # Get the absolute pathname.
    25783896      absdir=`cd "$dir" && pwd`
    2579       test -n "$absdir" && dir="$absdir"
     3897      test -n "$absdir" && dir=$absdir
    25803898
    25813899      # Now add the directory to shlibpath_var.
     
    25893907    # This variable tells wrapper scripts just to set shlibpath_var
    25903908    # rather than running their programs.
    2591     libtool_execute_magic="$magic"
     3909    libtool_execute_magic=$magic
    25923910
    25933911    # Check if any of the arguments is a wrapper script.
     
    26023920          func_source "$file"
    26033921          # Transform arg to wrapped name.
    2604           file="$progdir/$program"
     3922          file=$progdir/$program
    26053923        elif func_ltwrapper_executable_p "$file"; then
    26063924          func_ltwrapper_scriptname "$file"
    26073925          func_source "$func_ltwrapper_scriptname_result"
    26083926          # Transform arg to wrapped name.
    2609           file="$progdir/$program"
     3927          file=$progdir/$program
    26103928        fi
    26113929        ;;
     
    26153933    done
    26163934
    2617     if test "X$opt_dry_run" = Xfalse; then
     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
    26183944      if test -n "$shlibpath_var"; then
    26193945        # Export the shlibpath_var.
     
    26323958
    26333959      # Now prepare to actually exec the command.
    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
     3960      exec_cmd=\$cmd$args
    26433961    fi
    26443962}
    26453963
    2646 test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
     3964test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
    26473965
    26483966
     
    26503968func_mode_finish ()
    26513969{
    2652     $opt_debug
     3970    $debug_cmd
     3971
    26533972    libs=
    26543973    libdirs=
     
    26643983          func_append libs " $opt"
    26653984        else
    2666           func_warning "\`$opt' is not a valid libtool archive"
     3985          func_warning "'$opt' is not a valid libtool archive"
    26673986        fi
    26683987
    26693988      else
    2670         func_fatal_error "invalid argument \`$opt'"
     3989        func_fatal_error "invalid argument '$opt'"
    26713990      fi
    26723991    done
     
    26834002      if $opt_dry_run; then
    26844003        for lib in $libs; do
    2685           echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
     4004          echo "removing references to $lt_sysroot and '=' prefixes from $lib"
    26864005        done
    26874006      else
    26884007        tmpdir=`func_mktempdir`
    26894008        for lib in $libs; do
    2690           sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
     4009          $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
    26914010            > $tmpdir/tmp-la
    26924011          mv -f $tmpdir/tmp-la $lib
     
    27134032
    27144033    # Exit here if they wanted silent mode.
    2715     $opt_silent && exit $EXIT_SUCCESS
     4034    $opt_quiet && exit $EXIT_SUCCESS
    27164035
    27174036    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
     
    27244043      echo "If you ever happen to want to link against installed libraries"
    27254044      echo "in a given directory, LIBDIR, you must either use libtool, and"
    2726       echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
     4045      echo "specify the full pathname of the library, or use the '-LLIBDIR'"
    27274046      echo "flag during linking and do at least one of the following:"
    27284047      if test -n "$shlibpath_var"; then
    2729         echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
     4048        echo "   - add LIBDIR to the '$shlibpath_var' environment variable"
    27304049        echo "     during execution"
    27314050      fi
    27324051      if test -n "$runpath_var"; then
    2733         echo "   - add LIBDIR to the \`$runpath_var' environment variable"
     4052        echo "   - add LIBDIR to the '$runpath_var' environment variable"
    27344053        echo "     during linking"
    27354054      fi
     
    27384057        eval flag=\"$hardcode_libdir_flag_spec\"
    27394058
    2740         $ECHO "   - use the \`$flag' linker flag"
     4059        $ECHO "   - use the '$flag' linker flag"
    27414060      fi
    27424061      if test -n "$admincmds"; then
     
    27444063      fi
    27454064      if test -f /etc/ld.so.conf; then
    2746         echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
     4065        echo "   - have your system administrator add LIBDIR to '/etc/ld.so.conf'"
    27474066      fi
    27484067      echo
     
    27634082}
    27644083
    2765 test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
     4084test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
    27664085
    27674086
     
    27694088func_mode_install ()
    27704089{
    2771     $opt_debug
     4090    $debug_cmd
     4091
    27724092    # There may be an optional sh(1) argument at the beginning of
    27734093    # install_prog (especially on Windows NT).
    2774     if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
     4094    if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
    27754095       # Allow the use of GNU shtool's install command.
    2776        case $nonopt in *shtool*) :;; *) false;; esac; then
     4096       case $nonopt in *shtool*) :;; *) false;; esac
     4097    then
    27774098      # Aesthetically quote it.
    27784099      func_quote_for_eval "$nonopt"
     
    28014122    prev=
    28024123    install_type=
    2803     isdir=no
     4124    isdir=false
    28044125    stripme=
    28054126    no_mode=:
     
    28144135
    28154136      case $arg in
    2816       -d) isdir=yes ;;
     4137      -d) isdir=: ;;
    28174138      -f)
    28184139        if $install_cp; then :; else
     
    28324153        # If the previous option needed an argument, then skip it.
    28334154        if test -n "$prev"; then
    2834           if test "x$prev" = x-m && test -n "$install_override_mode"; then
     4155          if test X-m = "X$prev" && test -n "$install_override_mode"; then
    28354156            arg2=$install_override_mode
    28364157            no_mode=false
     
    28574178
    28584179    test -n "$prev" && \
    2859       func_fatal_help "the \`$prev' option requires an argument"
     4180      func_fatal_help "the '$prev' option requires an argument"
    28604181
    28614182    if test -n "$install_override_mode" && $no_mode; then
     
    28794200
    28804201    # Check to see that the destination is a directory.
    2881     test -d "$dest" && isdir=yes
    2882     if test "$isdir" = yes; then
    2883       destdir="$dest"
     4202    test -d "$dest" && isdir=:
     4203    if $isdir; then
     4204      destdir=$dest
    28844205      destname=
    28854206    else
    28864207      func_dirname_and_basename "$dest" "" "."
    2887       destdir="$func_dirname_result"
    2888       destname="$func_basename_result"
     4208      destdir=$func_dirname_result
     4209      destname=$func_basename_result
    28894210
    28904211      # Not a directory, so check to see that there is only one file specified.
    28914212      set dummy $files; shift
    28924213      test "$#" -gt 1 && \
    2893         func_fatal_help "\`$dest' is not a directory"
     4214        func_fatal_help "'$dest' is not a directory"
    28944215    fi
    28954216    case $destdir in
     
    29004221        *.lo) ;;
    29014222        *)
    2902           func_fatal_help "\`$destdir' must be an absolute directory name"
     4223          func_fatal_help "'$destdir' must be an absolute directory name"
    29034224          ;;
    29044225        esac
     
    29094230    # This variable tells wrapper scripts just to set variables rather
    29104231    # than running their programs.
    2911     libtool_install_magic="$magic"
     4232    libtool_install_magic=$magic
    29124233
    29134234    staticlibs=
     
    29294250        # Check to see that this really is a libtool archive.
    29304251        func_lalib_unsafe_p "$file" \
    2931           || func_fatal_help "\`$file' is not a valid libtool archive"
     4252          || func_fatal_help "'$file' is not a valid libtool archive"
    29324253
    29334254        library_names=
     
    29514272
    29524273        func_dirname "$file" "/" ""
    2953         dir="$func_dirname_result"
     4274        dir=$func_dirname_result
    29544275        func_append dir "$objdir"
    29554276
     
    29654286          # but it's something to keep an eye on.
    29664287          test "$inst_prefix_dir" = "$destdir" && \
    2967             func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
     4288            func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
    29684289
    29694290          if test -n "$inst_prefix_dir"; then
     
    29744295          fi
    29754296
    2976           func_warning "relinking \`$file'"
     4297          func_warning "relinking '$file'"
    29774298          func_show_eval "$relink_command" \
    2978             'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
     4299            'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
    29794300        fi
    29804301
     
    29824303        set dummy $library_names; shift
    29834304        if test -n "$1"; then
    2984           realname="$1"
     4305          realname=$1
    29854306          shift
    29864307
    2987           srcname="$realname"
    2988           test -n "$relink_command" && srcname="$realname"T
     4308          srcname=$realname
     4309          test -n "$relink_command" && srcname=${realname}T
    29894310
    29904311          # Install the shared library and build the symlinks.
    29914312          func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
    29924313              'exit $?'
    2993           tstripme="$stripme"
     4314          tstripme=$stripme
    29944315          case $host_os in
    29954316          cygwin* | mingw* | pw32* | cegcc*)
    29964317            case $realname in
    29974318            *.dll.a)
    2998               tstripme=""
     4319              tstripme=
     4320              ;;
     4321            esac
     4322            ;;
     4323          os2*)
     4324            case $realname in
     4325            *_dll.a)
     4326              tstripme=
    29994327              ;;
    30004328            esac
     
    30074335          if test "$#" -gt 0; then
    30084336            # Delete the old symlinks, and create new ones.
    3009             # Try `ln -sf' first, because the `ln' binary might depend on
     4337            # Try 'ln -sf' first, because the 'ln' binary might depend on
    30104338            # the symlink we replace!  Solaris /bin/ln does not understand -f,
    30114339            # so we also need to try rm && ln -s.
     
    30184346
    30194347          # Do each command in the postinstall commands.
    3020           lib="$destdir/$realname"
     4348          lib=$destdir/$realname
    30214349          func_execute_cmds "$postinstall_cmds" 'exit $?'
    30224350        fi
     
    30244352        # Install the pseudo-library for information purposes.
    30254353        func_basename "$file"
    3026         name="$func_basename_result"
    3027         instname="$dir/$name"i
     4354        name=$func_basename_result
     4355        instname=$dir/${name}i
    30284356        func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
    30294357
     
    30374365        # Figure out destination file name, if it wasn't already specified.
    30384366        if test -n "$destname"; then
    3039           destfile="$destdir/$destname"
     4367          destfile=$destdir/$destname
    30404368        else
    30414369          func_basename "$file"
    3042           destfile="$func_basename_result"
    3043           destfile="$destdir/$destfile"
     4370          destfile=$func_basename_result
     4371          destfile=$destdir/$destfile
    30444372        fi
    30454373
     
    30514379          ;;
    30524380        *.$objext)
    3053           staticdest="$destfile"
     4381          staticdest=$destfile
    30544382          destfile=
    30554383          ;;
    30564384        *)
    3057           func_fatal_help "cannot copy a libtool object to \`$destfile'"
     4385          func_fatal_help "cannot copy a libtool object to '$destfile'"
    30584386          ;;
    30594387        esac
     
    30644392
    30654393        # Install the old object if enabled.
    3066         if test "$build_old_libs" = yes; then
     4394        if test yes = "$build_old_libs"; then
    30674395          # Deduce the name of the old-style object file.
    30684396          func_lo2o "$file"
     
    30764404        # Figure out destination file name, if it wasn't already specified.
    30774405        if test -n "$destname"; then
    3078           destfile="$destdir/$destname"
     4406          destfile=$destdir/$destname
    30794407        else
    30804408          func_basename "$file"
    3081           destfile="$func_basename_result"
    3082           destfile="$destdir/$destfile"
     4409          destfile=$func_basename_result
     4410          destfile=$destdir/$destfile
    30834411        fi
    30844412
     
    30864414        # because it is most likely a libtool script we actually want to
    30874415        # install
    3088         stripped_ext=""
     4416        stripped_ext=
    30894417        case $file in
    30904418          *.exe)
     
    30924420              func_stripname '' '.exe' "$file"
    30934421              file=$func_stripname_result
    3094               stripped_ext=".exe"
     4422              stripped_ext=.exe
    30954423            fi
    30964424            ;;
     
    31204448          # Check the variables that should have been set.
    31214449          test -z "$generated_by_libtool_version" && \
    3122             func_fatal_error "invalid libtool wrapper script \`$wrapper'"
    3123 
    3124           finalize=yes
     4450            func_fatal_error "invalid libtool wrapper script '$wrapper'"
     4451
     4452          finalize=:
    31254453          for lib in $notinst_deplibs; do
    31264454            # Check to see that each library is installed.
     
    31294457              func_source "$lib"
    31304458            fi
    3131             libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
     4459            libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
    31324460            if test -n "$libdir" && test ! -f "$libfile"; then
    3133               func_warning "\`$lib' has not been installed in \`$libdir'"
    3134               finalize=no
     4461              func_warning "'$lib' has not been installed in '$libdir'"
     4462              finalize=false
    31354463            fi
    31364464          done
     
    31404468
    31414469          outputname=
    3142           if test "$fast_install" = no && test -n "$relink_command"; then
     4470          if test no = "$fast_install" && test -n "$relink_command"; then
    31434471            $opt_dry_run || {
    3144               if test "$finalize" = yes; then
     4472              if $finalize; then
    31454473                tmpdir=`func_mktempdir`
    31464474                func_basename "$file$stripped_ext"
    3147                 file="$func_basename_result"
    3148                 outputname="$tmpdir/$file"
     4475                file=$func_basename_result
     4476                outputname=$tmpdir/$file
    31494477                # Replace the output file specification.
    31504478                relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
    31514479
    3152                 $opt_silent || {
     4480                $opt_quiet || {
    31534481                  func_quote_for_expand "$relink_command"
    31544482                  eval "func_echo $func_quote_for_expand_result"
     
    31564484                if eval "$relink_command"; then :
    31574485                  else
    3158                   func_error "error: relink \`$file' with the above command before installing it"
     4486                  func_error "error: relink '$file' with the above command before installing it"
    31594487                  $opt_dry_run || ${RM}r "$tmpdir"
    31604488                  continue
    31614489                fi
    3162                 file="$outputname"
     4490                file=$outputname
    31634491              else
    3164                 func_warning "cannot relink \`$file'"
     4492                func_warning "cannot relink '$file'"
    31654493              fi
    31664494            }
     
    31994527    for file in $staticlibs; do
    32004528      func_basename "$file"
    3201       name="$func_basename_result"
     4529      name=$func_basename_result
    32024530
    32034531      # Set up the ranlib parameters.
    3204       oldlib="$destdir/$name"
     4532      oldlib=$destdir/$name
    32054533      func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
    32064534      tool_oldlib=$func_to_tool_file_result
     
    32174545
    32184546    test -n "$future_libdirs" && \
    3219       func_warning "remember to run \`$progname --finish$future_libdirs'"
     4547      func_warning "remember to run '$progname --finish$future_libdirs'"
    32204548
    32214549    if test -n "$current_libdirs"; then
    32224550      # Maybe just do a dry run.
    32234551      $opt_dry_run && current_libdirs=" -n$current_libdirs"
    3224       exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
     4552      exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
    32254553    else
    32264554      exit $EXIT_SUCCESS
     
    32284556}
    32294557
    3230 test "$opt_mode" = install && func_mode_install ${1+"$@"}
     4558test install = "$opt_mode" && func_mode_install ${1+"$@"}
    32314559
    32324560
     
    32364564func_generate_dlsyms ()
    32374565{
    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'`
     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'`
    32434572    my_dlsyms=
    32444573
    3245     if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
     4574    if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
    32464575      if test -n "$NM" && test -n "$global_symbol_pipe"; then
    3247         my_dlsyms="${my_outputname}S.c"
     4576        my_dlsyms=${my_outputname}S.c
    32484577      else
    32494578        func_error "not configured to extract global symbols from dlpreopened files"
     
    32564585      *.c)
    32574586        # Discover the nlist of each of the dlfiles.
    3258         nlist="$output_objdir/${my_outputname}.nm"
     4587        nlist=$output_objdir/$my_outputname.nm
    32594588
    32604589        func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
     
    32644593
    32654594        $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
    3266 /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
    3267 /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
     4595/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
     4596/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
    32684597
    32694598#ifdef __cplusplus
     
    32714600#endif
    32724601
    3273 #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
     4602#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
    32744603#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
    32754604#endif
    32764605
    32774606/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
    3278 #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
    3279 /* DATA imports from DLLs on WIN32 con't be const, because runtime
     4607#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
     4608/* DATA imports from DLLs on WIN32 can't be const, because runtime
    32804609   relocations are performed -- see ld's documentation on pseudo-relocs.  */
    32814610# define LT_DLSYM_CONST
    3282 #elif defined(__osf__)
     4611#elif defined __osf__
    32834612/* This system does not cope well with relocations in const data.  */
    32844613# define LT_DLSYM_CONST
     
    32874616#endif
    32884617
     4618#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
     4619
    32894620/* External symbol declarations for the compiler. */\
    32904621"
    32914622
    3292         if test "$dlself" = yes; then
    3293           func_verbose "generating symbol list for \`$output'"
     4623        if test yes = "$dlself"; then
     4624          func_verbose "generating symbol list for '$output'"
    32944625
    32954626          $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
     
    32994630          for progfile in $progfiles; do
    33004631            func_to_tool_file "$progfile" func_convert_file_msys_to_w32
    3301             func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
     4632            func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
    33024633            $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
    33034634          done
     
    33194650          # Prepare the list of exported symbols
    33204651          if test -z "$export_symbols"; then
    3321             export_symbols="$output_objdir/$outputname.exp"
     4652            export_symbols=$output_objdir/$outputname.exp
    33224653            $opt_dry_run || {
    33234654              $RM $export_symbols
    3324               eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
     4655              eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
    33254656              case $host in
    33264657              *cygwin* | *mingw* | *cegcc* )
     
    33324663          else
    33334664            $opt_dry_run || {
    3334               eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
     4665              eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
    33354666              eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
    33364667              eval '$MV "$nlist"T "$nlist"'
     
    33464677
    33474678        for dlprefile in $dlprefiles; do
    3348           func_verbose "extracting global C symbols from \`$dlprefile'"
     4679          func_verbose "extracting global C symbols from '$dlprefile'"
    33494680          func_basename "$dlprefile"
    3350           name="$func_basename_result"
     4681          name=$func_basename_result
    33514682          case $host in
    33524683            *cygwin* | *mingw* | *cegcc* )
     
    33554686                func_tr_sh "$dlprefile"
    33564687                eval "curr_lafile=\$libfile_$func_tr_sh_result"
    3357                 dlprefile_dlbasename=""
     4688                dlprefile_dlbasename=
    33584689                if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
    33594690                  # Use subshell, to avoid clobbering current variable values
    33604691                  dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
    3361                   if test -n "$dlprefile_dlname" ; then
     4692                  if test -n "$dlprefile_dlname"; then
    33624693                    func_basename "$dlprefile_dlname"
    3363                     dlprefile_dlbasename="$func_basename_result"
     4694                    dlprefile_dlbasename=$func_basename_result
    33644695                  else
    33654696                    # no lafile. user explicitly requested -dlpreopen <import library>.
     
    33694700                fi
    33704701                $opt_dry_run || {
    3371                   if test -n "$dlprefile_dlbasename" ; then
     4702                  if test -n "$dlprefile_dlbasename"; then
    33724703                    eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
    33734704                  else
     
    34254756          fi
    34264757
     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
    34274763          echo >> "$output_objdir/$my_dlsyms" "\
    34284764
     
    34334769} lt_dlsymlist;
    34344770extern LT_DLSYM_CONST lt_dlsymlist
    3435 lt_${my_prefix}_LTX_preloaded_symbols[];
     4771lt_${my_prefix}_LTX_preloaded_symbols[];\
     4772"
     4773
     4774          if test -s "$nlist"I; then
     4775            echo >> "$output_objdir/$my_dlsyms" "\
     4776static 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" "\
    34364787LT_DLSYM_CONST lt_dlsymlist
    34374788lt_${my_prefix}_LTX_preloaded_symbols[] =
    3438 {\
    3439   { \"$my_originator\", (void *) 0 },"
     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
    34404795
    34414796          case $need_lib_prefix in
     
    34794834            pic_flag_for_symtable=" $pic_flag"  ;;
    34804835          *)
    3481             if test "X$my_pic_p" != Xno; then
    3482               pic_flag_for_symtable=" $pic_flag"
    3483             fi
     4836            $my_pic_p && pic_flag_for_symtable=" $pic_flag"
    34844837            ;;
    34854838          esac
     
    34984851
    34994852        # Clean up the generated files.
    3500         func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
     4853        func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
    35014854
    35024855        # Transform the symbol file into the correct name.
    3503         symfileobj="$output_objdir/${my_outputname}S.$objext"
     4856        symfileobj=$output_objdir/${my_outputname}S.$objext
    35044857        case $host in
    35054858        *cygwin* | *mingw* | *cegcc* )
     
    35194872        ;;
    35204873      *)
    3521         func_fatal_error "unknown suffix for \`$my_dlsyms'"
     4874        func_fatal_error "unknown suffix for '$my_dlsyms'"
    35224875        ;;
    35234876      esac
     
    35314884      finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
    35324885    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.
     4892func_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.
     4905func_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"
    35334912}
    35344913
     
    35424921func_win32_libid ()
    35434922{
    3544   $opt_debug
    3545   win32_libid_type="unknown"
     4923  $debug_cmd
     4924
     4925  win32_libid_type=unknown
    35464926  win32_fileres=`file -L $1 2>/dev/null`
    35474927  case $win32_fileres in
     
    35534933    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
    35544934       $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
    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 '
     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 '
    35584949            1,100{
    35594950                / I /{
    3560                     s,.*,import,
     4951                    s|.*|import|
    35614952                    p
    35624953                    q
    35634954                }
    35644955            }'`
     4956        ;;
     4957      esac
    35654958      case $win32_nmres in
    35664959      import*)  win32_libid_type="x86 archive import";;
     
    35944987func_cygming_dll_for_implib ()
    35954988{
    3596   $opt_debug
     4989  $debug_cmd
     4990
    35974991  sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
    35984992}
     
    36115005func_cygming_dll_for_implib_fallback_core ()
    36125006{
    3613   $opt_debug
     5007  $debug_cmd
     5008
    36145009  match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
    36155010  $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
     
    36475042    # we now have a list, one entry per line, of the stringified
    36485043    # contents of the appropriate section of all members of the
    3649     # archive which possess that section. Heuristic: eliminate
    3650     # all those which have a first or second character that is
     5044    # archive that possess that section. Heuristic: eliminate
     5045    # all those that have a first or second character that is
    36515046    # a '.' (that is, objdump's representation of an unprintable
    36525047    # character.) This should work for all archives with less than
     
    36575052    # Of those that remain, print the first one.
    36585053    $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.
    3665 func_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.
    3677 func_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"
    36835054}
    36845055
     
    36965067func_cygming_dll_for_implib_fallback ()
    36975068{
    3698   $opt_debug
    3699   if func_cygming_gnu_implib_p "$1" ; then
     5069  $debug_cmd
     5070
     5071  if func_cygming_gnu_implib_p "$1"; then
    37005072    # binutils import library
    37015073    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
    3702   elif func_cygming_ms_implib_p "$1" ; then
     5074  elif func_cygming_ms_implib_p "$1"; then
    37035075    # ms-generated import library
    37045076    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
    37055077  else
    37065078    # unknown
    3707     sharedlib_from_linklib_result=""
     5079    sharedlib_from_linklib_result=
    37085080  fi
    37095081}
     
    37135085func_extract_an_archive ()
    37145086{
    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
     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
    37195092      lockfile=$f_ex_an_ar_oldlib.lock
    37205093      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
     
    37255098    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
    37265099                   'stat=$?; rm -f "$lockfile"; exit $stat'
    3727     if test "$lock_old_archive_extraction" = yes; then
     5100    if test yes = "$lock_old_archive_extraction"; then
    37285101      $opt_dry_run || rm -f "$lockfile"
    37295102    fi
     
    37395112func_extract_archives ()
    37405113{
    3741     $opt_debug
    3742     my_gentop="$1"; shift
     5114    $debug_cmd
     5115
     5116    my_gentop=$1; shift
    37435117    my_oldlibs=${1+"$@"}
    3744     my_oldobjs=""
    3745     my_xlib=""
    3746     my_xabs=""
    3747     my_xdir=""
     5118    my_oldobjs=
     5119    my_xlib=
     5120    my_xabs=
     5121    my_xdir=
    37485122
    37495123    for my_xlib in $my_oldlibs; do
    37505124      # Extract the objects.
    37515125      case $my_xlib in
    3752         [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
     5126        [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
    37535127        *) my_xabs=`pwd`"/$my_xlib" ;;
    37545128      esac
    37555129      func_basename "$my_xlib"
    3756       my_xlib="$func_basename_result"
     5130      my_xlib=$func_basename_result
    37575131      my_xlib_u=$my_xlib
    37585132      while :; do
     
    37665140      done
    37675141      extracted_archives="$extracted_archives $my_xlib_u"
    3768       my_xdir="$my_gentop/$my_xlib_u"
     5142      my_xdir=$my_gentop/$my_xlib_u
    37695143
    37705144      func_mkdir_p "$my_xdir"
     
    37795153          darwin_archive=$my_xabs
    37805154          darwin_curdir=`pwd`
    3781           darwin_base_archive=`basename "$darwin_archive"`
     5155          func_basename "$darwin_archive"
     5156          darwin_base_archive=$func_basename_result
    37825157          darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
    37835158          if test -n "$darwin_arches"; then
     
    37855160            darwin_arch=
    37865161            func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
    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}"
     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"
    37925167              cd "$darwin_curdir"
    3793               $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
     5168              $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
    37945169            done # $darwin_arches
    37955170            ## Okay now we've a bunch of thin objects, gotta fatten them up :)
    3796             darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
     5171            darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u`
    37975172            darwin_file=
    37985173            darwin_files=
     
    38165191    done
    38175192
    3818     func_extract_archives_result="$my_oldobjs"
     5193    func_extract_archives_result=$my_oldobjs
    38195194}
    38205195
     
    38315206# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
    38325207# variable will take.  If 'yes', then the emitted script
    3833 # will assume that the directory in which it is stored is
     5208# will assume that the directory where it is stored is
    38345209# the $objdir directory.  This is a cygwin/mingw-specific
    38355210# behavior.
     
    38425217
    38435218# $output - temporary wrapper script for $objdir/$outputname
    3844 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
     5219# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
    38455220#
    38465221# The $output program cannot be directly executed until all the libtool
     
    38995274# Very basic option parsing. These options are (a) specific to
    39005275# the libtool wrapper, (b) are identical between the wrapper
    3901 # /script/ and the wrapper /executable/ which is used only on
     5276# /script/ and the wrapper /executable/ that is used only on
    39025277# windows platforms, and (c) all begin with the string "--lt-"
    3903 # (application programs are unlikely to have options which match
     5278# (application programs are unlikely to have options that match
    39045279# this pattern).
    39055280#
     
    39345309  # Print the debug banner immediately:
    39355310  if test -n \"\$lt_option_debug\"; then
    3936     echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
     5311    echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
    39375312  fi
    39385313}
     
    39455320  for lt_arg
    39465321  do
    3947     \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
     5322    \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
    39485323    lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
    39495324  done
     
    39595334    $ECHO "\
    39605335      if test -n \"\$lt_option_debug\"; then
    3961         \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
     5336        \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
    39625337        func_lt_dump_args \${1+\"\$@\"} 1>&2
    39635338      fi
     
    39695344    $ECHO "\
    39705345      if test -n \"\$lt_option_debug\"; then
    3971         \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
     5346        \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
    39725347        func_lt_dump_args \${1+\"\$@\"} 1>&2
    39735348      fi
     
    40445419"
    40455420
    4046         if test "$fast_install" = yes; then
     5421        if test yes = "$fast_install"; then
    40475422          $ECHO "\
    40485423  program=lt-'$outputname'$exeext
     
    40505425
    40515426  if test ! -f \"\$progdir/\$program\" ||
    4052      { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
     5427     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\
    40535428       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
    40545429
     
    40675442      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
    40685443      else
    4069         $ECHO \"\$relink_command_output\" >&2
     5444        \$ECHO \"\$relink_command_output\" >&2
    40705445        $RM \"\$progdir/\$file\"
    40715446        exit 1
     
    41025477
    41035478        # Export our shlibpath_var if we have one.
    4104         if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
     5479        if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
    41055480          $ECHO "\
    41065481    # Add our own library path to $shlibpath_var
     
    41225497  else
    41235498    # The program doesn't exist.
    4124     \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
     5499    \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2
    41255500    \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
    41265501    \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
     
    41415516
    41425517/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
    4143    Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
     5518   Generated by $PROGRAM (GNU $PACKAGE) $VERSION
    41445519
    41455520   The $output program cannot be directly executed until all the libtool
     
    41765551#include <sys/stat.h>
    41775552
     5553#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
     5554
    41785555/* declarations of non-ANSI functions */
    4179 #if defined(__MINGW32__)
     5556#if defined __MINGW32__
    41805557# ifdef __STRICT_ANSI__
    41815558int _putenv (const char *);
    41825559# endif
    4183 #elif defined(__CYGWIN__)
     5560#elif defined __CYGWIN__
    41845561# ifdef __STRICT_ANSI__
    41855562char *realpath (const char *, char *);
     
    41875564int setenv (const char *, const char *, int);
    41885565# endif
    4189 /* #elif defined (other platforms) ... */
     5566/* #elif defined other_platform || defined ... */
    41905567#endif
    41915568
    41925569/* portability defines, excluding path handling macros */
    4193 #if defined(_MSC_VER)
     5570#if defined _MSC_VER
    41945571# define setmode _setmode
    41955572# define stat    _stat
     
    41985575# define putenv  _putenv
    41995576# define S_IXUSR _S_IEXEC
    4200 # ifndef _INTPTR_T_DEFINED
    4201 #  define _INTPTR_T_DEFINED
    4202 #  define intptr_t int
    4203 # endif
    4204 #elif defined(__MINGW32__)
     5577#elif defined __MINGW32__
    42055578# define setmode _setmode
    42065579# define stat    _stat
     
    42085581# define getcwd  _getcwd
    42095582# define putenv  _putenv
    4210 #elif defined(__CYGWIN__)
     5583#elif defined __CYGWIN__
    42115584# define HAVE_SETENV
    42125585# define FOPEN_WB "wb"
    4213 /* #elif defined (other platforms) ... */
     5586/* #elif defined other platforms ... */
    42145587#endif
    42155588
    4216 #if defined(PATH_MAX)
     5589#if defined PATH_MAX
    42175590# define LT_PATHMAX PATH_MAX
    4218 #elif defined(MAXPATHLEN)
     5591#elif defined MAXPATHLEN
    42195592# define LT_PATHMAX MAXPATHLEN
    42205593#else
     
    42355608#endif
    42365609
    4237 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
    4238   defined (__OS2__)
     5610#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
     5611  defined __OS2__
    42395612# define HAVE_DOS_BASED_FILE_SYSTEM
    42405613# define FOPEN_WB "wb"
     
    42695642#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
    42705643#define XFREE(stale) do { \
    4271   if (stale) { free ((void *) stale); stale = 0; } \
     5644  if (stale) { free (stale); stale = 0; } \
    42725645} while (0)
    42735646
    4274 #if defined(LT_DEBUGWRAPPER)
     5647#if defined LT_DEBUGWRAPPER
    42755648static int lt_debug = 1;
    42765649#else
     
    43015674
    43025675            cat <<EOF
    4303 volatile const char * MAGIC_EXE = "$magic_exe";
     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
     5681externally_visible const char * MAGIC_EXE = "$magic_exe";
    43045682const char * LIB_PATH_VARNAME = "$shlibpath_var";
    43055683EOF
    43065684
    4307             if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
     5685            if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
    43085686              func_to_host_path "$temp_rpath"
    43095687              cat <<EOF
     
    43295707            fi
    43305708
    4331             if test "$fast_install" = yes; then
     5709            if test yes = "$fast_install"; then
    43325710              cat <<EOF
    43335711const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
     
    43585736  char *target_name;
    43595737  char *lt_argv_zero;
    4360   intptr_t rval = 127;
     5738  int rval = 127;
    43615739
    43625740  int i;
    43635741
    43645742  program_name = (char *) xstrdup (base_name (argv[0]));
    4365   newargz = XMALLOC (char *, argc + 1);
     5743  newargz = XMALLOC (char *, (size_t) argc + 1);
    43665744
    43675745  /* very simple arg parsing; don't want to rely on getopt
     
    43725750  for (i = 1; i < argc; i++)
    43735751    {
    4374       if (strcmp (argv[i], dumpscript_opt) == 0)
     5752      if (STREQ (argv[i], dumpscript_opt))
    43755753        {
    43765754EOF
    4377             case "$host" in
     5755            case $host in
    43785756              *mingw* | *cygwin* )
    43795757                # make stdout use "unix" line endings
     
    43865764          return 0;
    43875765        }
    4388       if (strcmp (argv[i], debug_opt) == 0)
     5766      if (STREQ (argv[i], debug_opt))
    43895767        {
    43905768          lt_debug = 1;
    43915769          continue;
    43925770        }
    4393       if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
     5771      if (STREQ (argv[i], ltwrapper_option_prefix))
    43945772        {
    43955773          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
     
    44145792            cat <<EOF
    44155793  /* The GNU banner must be the first non-error debug message */
    4416   lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
     5794  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
    44175795EOF
    44185796            cat <<"EOF"
     
    45255903  /* execv doesn't actually work on mingw as expected on unix */
    45265904  newargz = prepare_spawn (newargz);
    4527   rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
     5905  rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
    45285906  if (rval == -1)
    45295907    {
     
    45705948  const char *base;
    45715949
    4572 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
     5950#if defined HAVE_DOS_BASED_FILE_SYSTEM
    45735951  /* Skip over the disk name in MSDOS pathnames. */
    45745952  if (isalpha ((unsigned char) name[0]) && name[1] == ':')
     
    46296007  /* static buffer for getcwd */
    46306008  char tmp[LT_PATHMAX + 1];
    4631   int tmp_len;
     6009  size_t tmp_len;
    46326010  char *concat_name;
    46336011
     
    46396017
    46406018  /* Absolute path? */
    4641 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
     6019#if defined HAVE_DOS_BASED_FILE_SYSTEM
    46426020  if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
    46436021    {
     
    46576035          XFREE (concat_name);
    46586036        }
    4659 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
     6037#if defined HAVE_DOS_BASED_FILE_SYSTEM
    46606038    }
    46616039#endif
     
    46806058                if (IS_PATH_SEPARATOR (*q))
    46816059                  break;
    4682               p_len = q - p;
     6060              p_len = (size_t) (q - p);
    46836061              p_next = (*q == '\0' ? q : q + 1);
    46846062              if (p_len == 0)
     
    47996177    {
    48006178      str += len - patlen;
    4801       if (strcmp (str, pat) == 0)
     6179      if (STREQ (str, pat))
    48026180        *str = '\0';
    48036181    }
     
    48646242    setenv (name, str, 1);
    48656243#else
    4866     int len = strlen (name) + 1 + strlen (value) + 1;
     6244    size_t len = strlen (name) + 1 + strlen (value) + 1;
    48676245    char *str = XMALLOC (char, len);
    48686246    sprintf (str, "%s=%s", name, value);
     
    48816259  if (orig_value && *orig_value)
    48826260    {
    4883       int orig_value_len = strlen (orig_value);
    4884       int add_len = strlen (add);
     6261      size_t orig_value_len = strlen (orig_value);
     6262      size_t add_len = strlen (add);
    48856263      new_value = XMALLOC (char, add_len + orig_value_len + 1);
    48866264      if (to_end)
     
    49136291      char *new_value = lt_extend_str (getenv (name), value, 0);
    49146292      /* some systems can't cope with a ':'-terminated path #' */
    4915       int len = strlen (new_value);
    4916       while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
     6293      size_t len = strlen (new_value);
     6294      while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
    49176295        {
    4918           new_value[len-1] = '\0';
     6296          new_value[--len] = '\0';
    49196297        }
    49206298      lt_setenv (name, new_value);
     
    50836461func_win32_import_lib_p ()
    50846462{
    5085     $opt_debug
     6463    $debug_cmd
     6464
    50866465    case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
    50876466    *import*) : ;;
     
    50906469}
    50916470
     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.
     6475func_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
    50926489# func_mode_link arg...
    50936490func_mode_link ()
    50946491{
    5095     $opt_debug
     6492    $debug_cmd
     6493
    50966494    case $host in
    50976495    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
    50986496      # It is impossible to link a dll without this setting, and
    50996497      # we shouldn't force the makefile maintainer to figure out
    5100       # which system we are compiling for in order to pass an extra
     6498      # what system we are compiling for in order to pass an extra
    51016499      # flag for every libtool invocation.
    51026500      # allow_undefined=no
    51036501
    51046502      # FIXME: Unfortunately, there are problems with the above when trying
    5105       # to make a dll which has undefined symbols, in which case not
     6503      # to make a dll that has undefined symbols, in which case not
    51066504      # even a static library is built.  For now, we need to specify
    51076505      # -no-undefined on the libtool link line when we can be certain
     
    51476545    no_install=no
    51486546    objs=
     6547    os2dllname=
    51496548    non_pic_objects=
    51506549    precious_files_regex=
    51516550    prefer_static_libs=no
    5152     preload=no
     6551    preload=false
    51536552    prev=
    51546553    prevarg=
     
    51626561    vinfo_number=no
    51636562    weak_libs=
    5164     single_module="${wl}-single_module"
     6563    single_module=$wl-single_module
    51656564    func_infer_tag $base_compile
    51666565
     
    51706569      case $arg in
    51716570      -shared)
    5172         test "$build_libtool_libs" != yes && \
    5173           func_fatal_configuration "can not build a shared library"
     6571        test yes != "$build_libtool_libs" \
     6572          && func_fatal_configuration "cannot build a shared library"
    51746573        build_old_libs=no
    51756574        break
     
    51786577        case $arg in
    51796578        -all-static)
    5180           if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
     6579          if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
    51816580            func_warning "complete static linking is impossible in this configuration"
    51826581          fi
     
    52116610    # Go through the arguments, transforming them on the way.
    52126611    while test "$#" -gt 0; do
    5213       arg="$1"
     6612      arg=$1
    52146613      shift
    52156614      func_quote_for_eval "$arg"
     
    52286627        case $prev in
    52296628        bindir)
    5230           bindir="$arg"
     6629          bindir=$arg
    52316630          prev=
    52326631          continue
    52336632          ;;
    52346633        dlfiles|dlprefiles)
    5235           if test "$preload" = no; then
     6634          $preload || {
    52366635            # Add the symbol object into the linking commands.
    52376636            func_append compile_command " @SYMFILE@"
    52386637            func_append finalize_command " @SYMFILE@"
    5239             preload=yes
    5240           fi
     6638            preload=:
     6639          }
    52416640          case $arg in
    52426641          *.la | *.lo) ;;  # We handle these cases below.
    52436642          force)
    5244             if test "$dlself" = no; then
     6643            if test no = "$dlself"; then
    52456644              dlself=needless
    52466645              export_dynamic=yes
     
    52506649            ;;
    52516650          self)
    5252             if test "$prev" = dlprefiles; then
     6651            if test dlprefiles = "$prev"; then
    52536652              dlself=yes
    5254             elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
     6653            elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
    52556654              dlself=yes
    52566655            else
     
    52626661            ;;
    52636662          *)
    5264             if test "$prev" = dlfiles; then
     6663            if test dlfiles = "$prev"; then
    52656664              func_append dlfiles " $arg"
    52666665            else
     
    52736672          ;;
    52746673        expsyms)
    5275           export_symbols="$arg"
     6674          export_symbols=$arg
    52766675          test -f "$arg" \
    5277             || func_fatal_error "symbol file \`$arg' does not exist"
     6676            || func_fatal_error "symbol file '$arg' does not exist"
    52786677          prev=
    52796678          continue
    52806679          ;;
    52816680        expsyms_regex)
    5282           export_symbols_regex="$arg"
     6681          export_symbols_regex=$arg
    52836682          prev=
    52846683          continue
     
    52986697          ;;
    52996698        inst_prefix)
    5300           inst_prefix_dir="$arg"
     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.
    53016706          prev=
    53026707          continue
     
    53226727                if test -z "$pic_object" ||
    53236728                   test -z "$non_pic_object" ||
    5324                    test "$pic_object" = none &&
    5325                    test "$non_pic_object" = none; then
    5326                   func_fatal_error "cannot find name of object for \`$arg'"
     6729                   test none = "$pic_object" &&
     6730                   test none = "$non_pic_object"; then
     6731                  func_fatal_error "cannot find name of object for '$arg'"
    53276732                fi
    53286733
    53296734                # Extract subdirectory from the argument.
    53306735                func_dirname "$arg" "/" ""
    5331                 xdir="$func_dirname_result"
    5332 
    5333                 if test "$pic_object" != none; then
     6736                xdir=$func_dirname_result
     6737
     6738                if test none != "$pic_object"; then
    53346739                  # Prepend the subdirectory the object is found in.
    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
     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
    53396744                      func_append dlfiles " $pic_object"
    53406745                      prev=
     
    53476752
    53486753                  # CHECK ME:  I think I busted this.  -Ossama
    5349                   if test "$prev" = dlprefiles; then
     6754                  if test dlprefiles = "$prev"; then
    53506755                    # Preload the old-style object.
    53516756                    func_append dlprefiles " $pic_object"
     
    53556760                  # A PIC object.
    53566761                  func_append libobjs " $pic_object"
    5357                   arg="$pic_object"
     6762                  arg=$pic_object
    53586763                fi
    53596764
    53606765                # Non-PIC object.
    5361                 if test "$non_pic_object" != none; then
     6766                if test none != "$non_pic_object"; then
    53626767                  # Prepend the subdirectory the object is found in.
    5363                   non_pic_object="$xdir$non_pic_object"
     6768                  non_pic_object=$xdir$non_pic_object
    53646769
    53656770                  # A standard non-PIC object
    53666771                  func_append non_pic_objects " $non_pic_object"
    5367                   if test -z "$pic_object" || test "$pic_object" = none ; then
    5368                     arg="$non_pic_object"
     6772                  if test -z "$pic_object" || test none = "$pic_object"; then
     6773                    arg=$non_pic_object
    53696774                  fi
    53706775                else
    53716776                  # If the PIC object exists, use it instead.
    53726777                  # $xdir was prepended to $pic_object above.
    5373                   non_pic_object="$pic_object"
     6778                  non_pic_object=$pic_object
    53746779                  func_append non_pic_objects " $non_pic_object"
    53756780                fi
     
    53796784                  # Extract subdirectory from the argument.
    53806785                  func_dirname "$arg" "/" ""
    5381                   xdir="$func_dirname_result"
     6786                  xdir=$func_dirname_result
    53826787
    53836788                  func_lo2o "$arg"
     
    53876792                  func_append non_pic_objects " $non_pic_object"
    53886793                else
    5389                   func_fatal_error "\`$arg' is not a valid libtool object"
     6794                  func_fatal_error "'$arg' is not a valid libtool object"
    53906795                fi
    53916796              fi
    53926797            done
    53936798          else
    5394             func_fatal_error "link input file \`$arg' does not exist"
     6799            func_fatal_error "link input file '$arg' does not exist"
    53956800          fi
    53966801          arg=$save_arg
     
    53986803          continue
    53996804          ;;
     6805        os2dllname)
     6806          os2dllname=$arg
     6807          prev=
     6808          continue
     6809          ;;
    54006810        precious_regex)
    5401           precious_files_regex="$arg"
     6811          precious_files_regex=$arg
    54026812          prev=
    54036813          continue
    54046814          ;;
    54056815        release)
    5406           release="-$arg"
     6816          release=-$arg
    54076817          prev=
    54086818          continue
     
    54166826            ;;
    54176827          esac
    5418           if test "$prev" = rpath; then
     6828          if test rpath = "$prev"; then
    54196829            case "$rpath " in
    54206830            *" $arg "*) ;;
     
    54316841          ;;
    54326842        shrext)
    5433           shrext_cmds="$arg"
     6843          shrext_cmds=$arg
    54346844          prev=
    54356845          continue
     
    54716881      fi # test -n "$prev"
    54726882
    5473       prevarg="$arg"
     6883      prevarg=$arg
    54746884
    54756885      case $arg in
     
    54856895      -allow-undefined)
    54866896        # FIXME: remove this flag sometime in the future.
    5487         func_fatal_error "\`-allow-undefined' must not be used because it is the default"
     6897        func_fatal_error "'-allow-undefined' must not be used because it is the default"
    54886898        ;;
    54896899
     
    55176927          func_fatal_error "more than one -exported-symbols argument is not allowed"
    55186928        fi
    5519         if test "X$arg" = "X-export-symbols"; then
     6929        if test X-export-symbols = "X$arg"; then
    55206930          prev=expsyms
    55216931        else
     
    55516961        if test -z "$func_stripname_result"; then
    55526962          if test "$#" -gt 0; then
    5553             func_fatal_error "require no space between \`-L' and \`$1'"
     6963            func_fatal_error "require no space between '-L' and '$1'"
    55546964          else
    5555             func_fatal_error "need path for \`-L' option"
     6965            func_fatal_error "need path for '-L' option"
    55566966          fi
    55576967        fi
     
    55646974          absdir=`cd "$dir" && pwd`
    55656975          test -z "$absdir" && \
    5566             func_fatal_error "cannot determine absolute directory name of \`$dir'"
    5567           dir="$absdir"
     6976            func_fatal_error "cannot determine absolute directory name of '$dir'"
     6977          dir=$absdir
    55686978          ;;
    55696979        esac
     
    56007010
    56017011      -l*)
    5602         if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
     7012        if test X-lc = "X$arg" || test X-lm = "X$arg"; then
    56037013          case $host in
    56047014          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
     
    56087018          *-*-os2*)
    56097019            # These systems don't actually have a C library (as such)
    5610             test "X$arg" = "X-lc" && continue
     7020            test X-lc = "X$arg" && continue
    56117021            ;;
    5612           *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
     7022          *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
    56137023            # Do not include libc due to us having libc/libc_r.
    5614             test "X$arg" = "X-lc" && continue
     7024            test X-lc = "X$arg" && continue
    56157025            ;;
    56167026          *-*-rhapsody* | *-*-darwin1.[012])
     
    56217031          *-*-sco3.2v5* | *-*-sco5v6*)
    56227032            # Causes problems with __ctype
    5623             test "X$arg" = "X-lc" && continue
     7033            test X-lc = "X$arg" && continue
    56247034            ;;
    56257035          *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
    56267036            # Compiler inserts libc in the correct place for threads to work
    5627             test "X$arg" = "X-lc" && continue
     7037            test X-lc = "X$arg" && continue
    56287038            ;;
    56297039          esac
    5630         elif test "X$arg" = "X-lc_r"; then
     7040        elif test X-lc_r = "X$arg"; then
    56317041         case $host in
    5632          *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
     7042         *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
    56337043           # Do not include libc_r directly, use -pthread flag.
    56347044           continue
     
    56377047        fi
    56387048        func_append deplibs " $arg"
     7049        continue
     7050        ;;
     7051
     7052      -mllvm)
     7053        prev=mllvm
    56397054        continue
    56407055        ;;
     
    56697084
    56707085      -multi_module)
    5671         single_module="${wl}-multi_module"
     7086        single_module=$wl-multi_module
    56727087        continue
    56737088        ;;
     
    56837098          # The PATH hackery in wrapper scripts is required on Windows
    56847099          # and Darwin in order for the loader to find any dlls it needs.
    5685           func_warning "\`-no-install' is ignored for $host"
    5686           func_warning "assuming \`-no-fast-install' instead"
     7100          func_warning "'-no-install' is ignored for $host"
     7101          func_warning "assuming '-no-fast-install' instead"
    56877102          fast_install=no
    56887103          ;;
     
    56997114      -objectlist)
    57007115        prev=objectlist
     7116        continue
     7117        ;;
     7118
     7119      -os2dllname)
     7120        prev=os2dllname
    57017121        continue
    57027122        ;;
     
    57897209        args=$func_stripname_result
    57907210        arg=
    5791         save_ifs="$IFS"; IFS=','
     7211        save_ifs=$IFS; IFS=,
    57927212        for flag in $args; do
    5793           IFS="$save_ifs"
     7213          IFS=$save_ifs
    57947214          func_quote_for_eval "$flag"
    57957215          func_append arg " $func_quote_for_eval_result"
    57967216          func_append compiler_flags " $func_quote_for_eval_result"
    57977217        done
    5798         IFS="$save_ifs"
     7218        IFS=$save_ifs
    57997219        func_stripname ' ' '' "$arg"
    58007220        arg=$func_stripname_result
     
    58057225        args=$func_stripname_result
    58067226        arg=
    5807         save_ifs="$IFS"; IFS=','
     7227        save_ifs=$IFS; IFS=,
    58087228        for flag in $args; do
    5809           IFS="$save_ifs"
     7229          IFS=$save_ifs
    58107230          func_quote_for_eval "$flag"
    58117231          func_append arg " $wl$func_quote_for_eval_result"
     
    58137233          func_append linker_flags " $func_quote_for_eval_result"
    58147234        done
    5815         IFS="$save_ifs"
     7235        IFS=$save_ifs
    58167236        func_stripname ' ' '' "$arg"
    58177237        arg=$func_stripname_result
     
    58367256      -msg_*)
    58377257        func_quote_for_eval "$arg"
    5838         arg="$func_quote_for_eval_result"
     7258        arg=$func_quote_for_eval_result
    58397259        ;;
    58407260
     
    58487268      # -F/path              path to uninstalled frameworks, gcc on darwin
    58497269      # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
     7270      # -fstack-protector*   stack protector flags for GCC
    58507271      # @file                GCC response files
    58517272      # -tp=*                Portland pgcc target processor selection
    58527273      # --sysroot=*          for sysroot support
    5853       # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
     7274      # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
     7275      # -specs=*             GCC specs files
     7276      # -stdlib=*            select c++ std lib with clang
     7277      # -fsanitize=*         Clang/GCC memory and address sanitizer
    58547278      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
    58557279      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
    5856       -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
     7280      -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
     7281      -specs=*|-fsanitize=*)
    58577282        func_quote_for_eval "$arg"
    5858         arg="$func_quote_for_eval_result"
     7283        arg=$func_quote_for_eval_result
    58597284        func_append compile_command " $arg"
    58607285        func_append finalize_command " $arg"
     
    58637288        ;;
    58647289
     7290      -Z*)
     7291        if test os2 = "`expr $host : '.*\(os2\)'`"; then
     7292          # OS/2 uses -Zxxx to specify OS/2-specific options
     7293          compiler_flags="$compiler_flags $arg"
     7294          func_append compile_command " $arg"
     7295          func_append finalize_command " $arg"
     7296          case $arg in
     7297          -Zlinker | -Zstack)
     7298            prev=xcompiler
     7299            ;;
     7300          esac
     7301          continue
     7302        else
     7303          # Otherwise treat like 'Some other compiler flag' below
     7304          func_quote_for_eval "$arg"
     7305          arg=$func_quote_for_eval_result
     7306        fi
     7307        ;;
     7308
    58657309      # Some other compiler flag.
    58667310      -* | +*)
    58677311        func_quote_for_eval "$arg"
    5868         arg="$func_quote_for_eval_result"
     7312        arg=$func_quote_for_eval_result
    58697313        ;;
    58707314
     
    58877331          if test -z "$pic_object" ||
    58887332             test -z "$non_pic_object" ||
    5889              test "$pic_object" = none &&
    5890              test "$non_pic_object" = none; then
    5891             func_fatal_error "cannot find name of object for \`$arg'"
     7333             test none = "$pic_object" &&
     7334             test none = "$non_pic_object"; then
     7335            func_fatal_error "cannot find name of object for '$arg'"
    58927336          fi
    58937337
    58947338          # Extract subdirectory from the argument.
    58957339          func_dirname "$arg" "/" ""
    5896           xdir="$func_dirname_result"
    5897 
    5898           if test "$pic_object" != none; then
     7340          xdir=$func_dirname_result
     7341
     7342          test none = "$pic_object" || {
    58997343            # Prepend the subdirectory the object is found in.
    5900             pic_object="$xdir$pic_object"
    5901 
    5902             if test "$prev" = dlfiles; then
    5903               if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
     7344            pic_object=$xdir$pic_object
     7345
     7346            if test dlfiles = "$prev"; then
     7347              if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
    59047348                func_append dlfiles " $pic_object"
    59057349                prev=
     
    59127356
    59137357            # CHECK ME:  I think I busted this.  -Ossama
    5914             if test "$prev" = dlprefiles; then
     7358            if test dlprefiles = "$prev"; then
    59157359              # Preload the old-style object.
    59167360              func_append dlprefiles " $pic_object"
     
    59207364            # A PIC object.
    59217365            func_append libobjs " $pic_object"
    5922             arg="$pic_object"
    5923           fi
     7366            arg=$pic_object
     7367          }
    59247368
    59257369          # Non-PIC object.
    5926           if test "$non_pic_object" != none; then
     7370          if test none != "$non_pic_object"; then
    59277371            # Prepend the subdirectory the object is found in.
    5928             non_pic_object="$xdir$non_pic_object"
     7372            non_pic_object=$xdir$non_pic_object
    59297373
    59307374            # A standard non-PIC object
    59317375            func_append non_pic_objects " $non_pic_object"
    5932             if test -z "$pic_object" || test "$pic_object" = none ; then
    5933               arg="$non_pic_object"
     7376            if test -z "$pic_object" || test none = "$pic_object"; then
     7377              arg=$non_pic_object
    59347378            fi
    59357379          else
    59367380            # If the PIC object exists, use it instead.
    59377381            # $xdir was prepended to $pic_object above.
    5938             non_pic_object="$pic_object"
     7382            non_pic_object=$pic_object
    59397383            func_append non_pic_objects " $non_pic_object"
    59407384          fi
     
    59447388            # Extract subdirectory from the argument.
    59457389            func_dirname "$arg" "/" ""
    5946             xdir="$func_dirname_result"
     7390            xdir=$func_dirname_result
    59477391
    59487392            func_lo2o "$arg"
     
    59527396            func_append non_pic_objects " $non_pic_object"
    59537397          else
    5954             func_fatal_error "\`$arg' is not a valid libtool object"
     7398            func_fatal_error "'$arg' is not a valid libtool object"
    59557399          fi
    59567400        fi
     
    59687412
    59697413        func_resolve_sysroot "$arg"
    5970         if test "$prev" = dlfiles; then
     7414        if test dlfiles = "$prev"; then
    59717415          # This library was specified with -dlopen.
    59727416          func_append dlfiles " $func_resolve_sysroot_result"
    59737417          prev=
    5974         elif test "$prev" = dlprefiles; then
     7418        elif test dlprefiles = "$prev"; then
    59757419          # The library was specified with -dlpreopen.
    59767420          func_append dlprefiles " $func_resolve_sysroot_result"
     
    59877431        # to be aesthetically quoted because they are evaled later.
    59887432        func_quote_for_eval "$arg"
    5989         arg="$func_quote_for_eval_result"
     7433        arg=$func_quote_for_eval_result
    59907434        ;;
    59917435      esac # arg
     
    59997443
    60007444    test -n "$prev" && \
    6001       func_fatal_help "the \`$prevarg' option requires an argument"
    6002 
    6003     if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
     7445      func_fatal_help "the '$prevarg' option requires an argument"
     7446
     7447    if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
    60047448      eval arg=\"$export_dynamic_flag_spec\"
    60057449      func_append compile_command " $arg"
     
    60107454    # calculate the name of the file, without its directory
    60117455    func_basename "$output"
    6012     outputname="$func_basename_result"
    6013     libobjs_save="$libobjs"
     7456    outputname=$func_basename_result
     7457    libobjs_save=$libobjs
    60147458
    60157459    if test -n "$shlibpath_var"; then
    60167460      # get the directories listed in $shlibpath_var
    6017       eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
     7461      eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`
    60187462    else
    60197463      shlib_search_path=
     
    60227466    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
    60237467
     7468    # Definition is injected by LT_CONFIG during libtool generation.
     7469    func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
     7470
    60247471    func_dirname "$output" "/" ""
    6025     output_objdir="$func_dirname_result$objdir"
     7472    output_objdir=$func_dirname_result$objdir
    60267473    func_to_tool_file "$output_objdir/"
    60277474    tool_output_objdir=$func_to_tool_file_result
     
    60467493    # that are linked more than once (e.g. -la -lb -la)
    60477494    for deplib in $deplibs; do
    6048       if $opt_preserve_dup_deps ; then
     7495      if $opt_preserve_dup_deps; then
    60497496        case "$libs " in
    60507497        *" $deplib "*) func_append specialdeplibs " $deplib" ;;
     
    60547501    done
    60557502
    6056     if test "$linkmode" = lib; then
     7503    if test lib = "$linkmode"; then
    60577504      libs="$predeps $libs $compiler_lib_search_path $postdeps"
    60587505
     
    60867533          *.la) ;;
    60877534          *)
    6088             func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
     7535            func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"
    60897536            ;;
    60907537          esac
     
    60947541        compile_deplibs=
    60957542        finalize_deplibs=
    6096         alldeplibs=no
     7543        alldeplibs=false
    60977544        newdlfiles=
    60987545        newdlprefiles=
     
    61067553      # The preopen pass in lib mode reverses $deplibs; put it back here
    61077554      # so that -L comes before libs that need it for instance...
    6108       if test "$linkmode,$pass" = "lib,link"; then
     7555      if test lib,link = "$linkmode,$pass"; then
    61097556        ## FIXME: Find the place where the list is rebuilt in the wrong
    61107557        ##        order, and fix it there properly
     
    61137560          tmp_deplibs="$deplib $tmp_deplibs"
    61147561        done
    6115         deplibs="$tmp_deplibs"
     7562        deplibs=$tmp_deplibs
    61167563      fi
    61177564
    6118       if test "$linkmode,$pass" = "lib,link" ||
    6119          test "$linkmode,$pass" = "prog,scan"; then
    6120         libs="$deplibs"
     7565      if test lib,link = "$linkmode,$pass" ||
     7566         test prog,scan = "$linkmode,$pass"; then
     7567        libs=$deplibs
    61217568        deplibs=
    61227569      fi
    6123       if test "$linkmode" = prog; then
     7570      if test prog = "$linkmode"; then
    61247571        case $pass in
    6125         dlopen) libs="$dlfiles" ;;
    6126         dlpreopen) libs="$dlprefiles" ;;
     7572        dlopen) libs=$dlfiles ;;
     7573        dlpreopen) libs=$dlprefiles ;;
    61277574        link)
    61287575          libs="$deplibs %DEPLIBS%"
     
    61317578        esac
    61327579      fi
    6133       if test "$linkmode,$pass" = "lib,dlpreopen"; then
     7580      if test lib,dlpreopen = "$linkmode,$pass"; then
    61347581        # Collect and forward deplibs of preopened libtool libs
    61357582        for lib in $dlprefiles; do
     
    61527599          done
    61537600        done
    6154         libs="$dlprefiles"
     7601        libs=$dlprefiles
    61557602      fi
    6156       if test "$pass" = dlopen; then
     7603      if test dlopen = "$pass"; then
    61577604        # Collect dlpreopened libraries
    6158         save_deplibs="$deplibs"
     7605        save_deplibs=$deplibs
    61597606        deplibs=
    61607607      fi
     
    61627609      for deplib in $libs; do
    61637610        lib=
    6164         found=no
     7611        found=false
    61657612        case $deplib in
    61667613        -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
    61677614        |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
    6168           if test "$linkmode,$pass" = "prog,link"; then
     7615          if test prog,link = "$linkmode,$pass"; then
    61697616            compile_deplibs="$deplib $compile_deplibs"
    61707617            finalize_deplibs="$deplib $finalize_deplibs"
    61717618          else
    61727619            func_append compiler_flags " $deplib"
    6173             if test "$linkmode" = lib ; then
     7620            if test lib = "$linkmode"; then
    61747621                case "$new_inherited_linker_flags " in
    61757622                    *" $deplib "*) ;;
     
    61817628          ;;
    61827629        -l*)
    6183           if test "$linkmode" != lib && test "$linkmode" != prog; then
    6184             func_warning "\`-l' is ignored for archives/objects"
     7630          if test lib != "$linkmode" && test prog != "$linkmode"; then
     7631            func_warning "'-l' is ignored for archives/objects"
    61857632            continue
    61867633          fi
    61877634          func_stripname '-l' '' "$deplib"
    61887635          name=$func_stripname_result
    6189           if test "$linkmode" = lib; then
     7636          if test lib = "$linkmode"; then
    61907637            searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
    61917638          else
     
    61957642            for search_ext in .la $std_shrext .so .a; do
    61967643              # Search the libtool library
    6197               lib="$searchdir/lib${name}${search_ext}"
     7644              lib=$searchdir/lib$name$search_ext
    61987645              if test -f "$lib"; then
    6199                 if test "$search_ext" = ".la"; then
    6200                   found=yes
     7646                if test .la = "$search_ext"; then
     7647                  found=:
    62017648                else
    6202                   found=no
     7649                  found=false
    62037650                fi
    62047651                break 2
     
    62067653            done
    62077654          done
    6208           if test "$found" != yes; then
    6209             # deplib doesn't seem to be a libtool library
    6210             if test "$linkmode,$pass" = "prog,link"; then
    6211               compile_deplibs="$deplib $compile_deplibs"
    6212               finalize_deplibs="$deplib $finalize_deplibs"
    6213             else
    6214               deplibs="$deplib $deplibs"
    6215               test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
    6216             fi
    6217             continue
    6218           else # deplib is a libtool library
     7655          if $found; then
     7656            # deplib is a libtool library
    62197657            # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
    62207658            # We need to do some special things here, and not later.
    6221             if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
     7659            if test yes = "$allow_libtool_libs_with_static_runtimes"; then
    62227660              case " $predeps $postdeps " in
    62237661              *" $deplib "*)
     
    62277665                  func_source "$lib"
    62287666                  for l in $old_library $library_names; do
    6229                     ll="$l"
     7667                    ll=$l
    62307668                  done
    6231                   if test "X$ll" = "X$old_library" ; then # only static version available
    6232                     found=no
     7669                  if test "X$ll" = "X$old_library"; then # only static version available
     7670                    found=false
    62337671                    func_dirname "$lib" "" "."
    6234                     ladir="$func_dirname_result"
     7672                    ladir=$func_dirname_result
    62357673                    lib=$ladir/$old_library
    6236                     if test "$linkmode,$pass" = "prog,link"; then
     7674                    if test prog,link = "$linkmode,$pass"; then
    62377675                      compile_deplibs="$deplib $compile_deplibs"
    62387676                      finalize_deplibs="$deplib $finalize_deplibs"
    62397677                    else
    62407678                      deplibs="$deplib $deplibs"
    6241                       test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
     7679                      test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
    62427680                    fi
    62437681                    continue
     
    62487686              esac
    62497687            fi
     7688          else
     7689            # deplib doesn't seem to be a libtool library
     7690            if test prog,link = "$linkmode,$pass"; then
     7691              compile_deplibs="$deplib $compile_deplibs"
     7692              finalize_deplibs="$deplib $finalize_deplibs"
     7693            else
     7694              deplibs="$deplib $deplibs"
     7695              test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
     7696            fi
     7697            continue
    62507698          fi
    62517699          ;; # -l
    62527700        *.ltframework)
    6253           if test "$linkmode,$pass" = "prog,link"; then
     7701          if test prog,link = "$linkmode,$pass"; then
    62547702            compile_deplibs="$deplib $compile_deplibs"
    62557703            finalize_deplibs="$deplib $finalize_deplibs"
    62567704          else
    62577705            deplibs="$deplib $deplibs"
    6258             if test "$linkmode" = lib ; then
     7706            if test lib = "$linkmode"; then
    62597707                case "$new_inherited_linker_flags " in
    62607708                    *" $deplib "*) ;;
     
    62697717          lib)
    62707718            deplibs="$deplib $deplibs"
    6271             test "$pass" = conv && continue
     7719            test conv = "$pass" && continue
    62727720            newdependency_libs="$deplib $newdependency_libs"
    62737721            func_stripname '-L' '' "$deplib"
     
    62767724            ;;
    62777725          prog)
    6278             if test "$pass" = conv; then
     7726            if test conv = "$pass"; then
    62797727              deplibs="$deplib $deplibs"
    62807728              continue
    62817729            fi
    6282             if test "$pass" = scan; then
     7730            if test scan = "$pass"; then
    62837731              deplibs="$deplib $deplibs"
    62847732            else
     
    62917739            ;;
    62927740          *)
    6293             func_warning "\`-L' is ignored for archives/objects"
     7741            func_warning "'-L' is ignored for archives/objects"
    62947742            ;;
    62957743          esac # linkmode
     
    62977745          ;; # -L
    62987746        -R*)
    6299           if test "$pass" = link; then
     7747          if test link = "$pass"; then
    63007748            func_stripname '-R' '' "$deplib"
    63017749            func_resolve_sysroot "$func_stripname_result"
     
    63157763          ;;
    63167764        *.$libext)
    6317           if test "$pass" = conv; then
     7765          if test conv = "$pass"; then
    63187766            deplibs="$deplib $deplibs"
    63197767            continue
     
    63267774            *" $deplib "*) ;;
    63277775            *)
    6328               valid_a_lib=no
     7776              valid_a_lib=false
    63297777              case $deplibs_check_method in
    63307778                match_pattern*)
     
    63337781                  if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
    63347782                    | $EGREP "$match_pattern_regex" > /dev/null; then
    6335                     valid_a_lib=yes
     7783                    valid_a_lib=:
    63367784                  fi
    63377785                ;;
    63387786                pass_all)
    6339                   valid_a_lib=yes
     7787                  valid_a_lib=:
    63407788                ;;
    63417789              esac
    6342               if test "$valid_a_lib" != yes; then
     7790              if $valid_a_lib; then
     7791                echo
     7792                $ECHO "*** Warning: Linking the shared library $output against the"
     7793                $ECHO "*** static library $deplib is not portable!"
     7794                deplibs="$deplib $deplibs"
     7795              else
    63437796                echo
    63447797                $ECHO "*** Warning: Trying to link with static lib archive $deplib."
     
    63487801                echo "*** because the file extensions .$libext of this argument makes me believe"
    63497802                echo "*** that it is just a static archive that I should not use here."
    6350               else
    6351                 echo
    6352                 $ECHO "*** Warning: Linking the shared library $output against the"
    6353                 $ECHO "*** static library $deplib is not portable!"
    6354                 deplibs="$deplib $deplibs"
    63557803              fi
    63567804              ;;
     
    63597807            ;;
    63607808          prog)
    6361             if test "$pass" != link; then
     7809            if test link != "$pass"; then
    63627810              deplibs="$deplib $deplibs"
    63637811            else
     
    63707818          ;; # *.$libext
    63717819        *.lo | *.$objext)
    6372           if test "$pass" = conv; then
     7820          if test conv = "$pass"; then
    63737821            deplibs="$deplib $deplibs"
    6374           elif test "$linkmode" = prog; then
    6375             if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
     7822          elif test prog = "$linkmode"; then
     7823            if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
    63767824              # If there is no dlopen support or we're linking statically,
    63777825              # we need to preload.
     
    63867834          ;;
    63877835        %DEPLIBS%)
    6388           alldeplibs=yes
     7836          alldeplibs=:
    63897837          continue
    63907838          ;;
    63917839        esac # case $deplib
    63927840
    6393         if test "$found" = yes || test -f "$lib"; then :
    6394         else
    6395           func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
    6396         fi
     7841        $found || test -f "$lib" \
     7842          || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
    63977843
    63987844        # Check to see that this really is a libtool archive.
    63997845        func_lalib_unsafe_p "$lib" \
    6400           || func_fatal_error "\`$lib' is not a valid libtool archive"
     7846          || func_fatal_error "'$lib' is not a valid libtool archive"
    64017847
    64027848        func_dirname "$lib" "" "."
    6403         ladir="$func_dirname_result"
     7849        ladir=$func_dirname_result
    64047850
    64057851        dlname=
     
    64317877        fi
    64327878        dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
    6433         if test "$linkmode,$pass" = "lib,link" ||
    6434            test "$linkmode,$pass" = "prog,scan" ||
    6435            { test "$linkmode" != prog && test "$linkmode" != lib; }; then
     7879        if test lib,link = "$linkmode,$pass" ||
     7880           test prog,scan = "$linkmode,$pass" ||
     7881           { test prog != "$linkmode" && test lib != "$linkmode"; }; then
    64367882          test -n "$dlopen" && func_append dlfiles " $dlopen"
    64377883          test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
    64387884        fi
    64397885
    6440         if test "$pass" = conv; then
     7886        if test conv = "$pass"; then
    64417887          # Only check for convenience libraries
    64427888          deplibs="$lib $deplibs"
    64437889          if test -z "$libdir"; then
    64447890            if test -z "$old_library"; then
    6445               func_fatal_error "cannot find name of link library for \`$lib'"
     7891              func_fatal_error "cannot find name of link library for '$lib'"
    64467892            fi
    64477893            # It is a libtool convenience library, so add in its objects.
     
    64517897            for deplib in $dependency_libs; do
    64527898              deplibs="$deplib $deplibs"
    6453               if $opt_preserve_dup_deps ; then
     7899              if $opt_preserve_dup_deps; then
    64547900                case "$tmp_libs " in
    64557901                *" $deplib "*) func_append specialdeplibs " $deplib" ;;
     
    64587904              func_append tmp_libs " $deplib"
    64597905            done
    6460           elif test "$linkmode" != prog && test "$linkmode" != lib; then
    6461             func_fatal_error "\`$lib' is not a convenience library"
     7906          elif test prog != "$linkmode" && test lib != "$linkmode"; then
     7907            func_fatal_error "'$lib' is not a convenience library"
    64627908          fi
    64637909          continue
     
    64687914        linklib=
    64697915        if test -n "$old_library" &&
    6470            { test "$prefer_static_libs" = yes ||
    6471              test "$prefer_static_libs,$installed" = "built,no"; }; then
     7916           { test yes = "$prefer_static_libs" ||
     7917             test built,no = "$prefer_static_libs,$installed"; }; then
    64727918          linklib=$old_library
    64737919        else
    64747920          for l in $old_library $library_names; do
    6475             linklib="$l"
     7921            linklib=$l
    64767922          done
    64777923        fi
    64787924        if test -z "$linklib"; then
    6479           func_fatal_error "cannot find name of link library for \`$lib'"
     7925          func_fatal_error "cannot find name of link library for '$lib'"
    64807926        fi
    64817927
    64827928        # This library was specified with -dlopen.
    6483         if test "$pass" = dlopen; then
    6484           if test -z "$libdir"; then
    6485             func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
    6486           fi
     7929        if test dlopen = "$pass"; then
     7930          test -z "$libdir" \
     7931            && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
    64877932          if test -z "$dlname" ||
    6488              test "$dlopen_support" != yes ||
    6489              test "$build_libtool_libs" = no; then
     7933             test yes != "$dlopen_support" ||
     7934             test no = "$build_libtool_libs"
     7935          then
    64907936            # If there is no dlname, no dlopen support or we're linking
    64917937            # statically, we need to preload.  We also need to preload any
     
    65017947        # We need an absolute path.
    65027948        case $ladir in
    6503         [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
     7949        [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;
    65047950        *)
    65057951          abs_ladir=`cd "$ladir" && pwd`
    65067952          if test -z "$abs_ladir"; then
    6507             func_warning "cannot determine absolute directory name of \`$ladir'"
     7953            func_warning "cannot determine absolute directory name of '$ladir'"
    65087954            func_warning "passing it literally to the linker, although it might fail"
    6509             abs_ladir="$ladir"
     7955            abs_ladir=$ladir
    65107956          fi
    65117957          ;;
    65127958        esac
    65137959        func_basename "$lib"
    6514         laname="$func_basename_result"
     7960        laname=$func_basename_result
    65157961
    65167962        # Find the relevant object directory and library name.
    6517         if test "X$installed" = Xyes; then
     7963        if test yes = "$installed"; then
    65187964          if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
    6519             func_warning "library \`$lib' was moved."
    6520             dir="$ladir"
    6521             absdir="$abs_ladir"
    6522             libdir="$abs_ladir"
     7965            func_warning "library '$lib' was moved."
     7966            dir=$ladir
     7967            absdir=$abs_ladir
     7968            libdir=$abs_ladir
    65237969          else
    6524             dir="$lt_sysroot$libdir"
    6525             absdir="$lt_sysroot$libdir"
     7970            dir=$lt_sysroot$libdir
     7971            absdir=$lt_sysroot$libdir
    65267972          fi
    6527           test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
     7973          test yes = "$hardcode_automatic" && avoidtemprpath=yes
    65287974        else
    65297975          if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
    6530             dir="$ladir"
    6531             absdir="$abs_ladir"
     7976            dir=$ladir
     7977            absdir=$abs_ladir
    65327978            # Remove this search path later
    65337979            func_append notinst_path " $abs_ladir"
    65347980          else
    6535             dir="$ladir/$objdir"
    6536             absdir="$abs_ladir/$objdir"
     7981            dir=$ladir/$objdir
     7982            absdir=$abs_ladir/$objdir
    65377983            # Remove this search path later
    65387984            func_append notinst_path " $abs_ladir"
     
    65437989
    65447990        # This library was specified with -dlpreopen.
    6545         if test "$pass" = dlpreopen; then
    6546           if test -z "$libdir" && test "$linkmode" = prog; then
    6547             func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
     7991        if test dlpreopen = "$pass"; then
     7992          if test -z "$libdir" && test prog = "$linkmode"; then
     7993            func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
    65487994          fi
    6549           case "$host" in
     7995          case $host in
    65507996            # special handling for platforms with PE-DLLs.
    65517997            *cygwin* | *mingw* | *cegcc* )
     
    65918037        if test -z "$libdir"; then
    65928038          # Link the convenience library
    6593           if test "$linkmode" = lib; then
     8039          if test lib = "$linkmode"; then
    65948040            deplibs="$dir/$old_library $deplibs"
    6595           elif test "$linkmode,$pass" = "prog,link"; then
     8041          elif test prog,link = "$linkmode,$pass"; then
    65968042            compile_deplibs="$dir/$old_library $compile_deplibs"
    65978043            finalize_deplibs="$dir/$old_library $finalize_deplibs"
     
    66038049
    66048050
    6605         if test "$linkmode" = prog && test "$pass" != link; then
     8051        if test prog = "$linkmode" && test link != "$pass"; then
    66068052          func_append newlib_search_path " $ladir"
    66078053          deplibs="$lib $deplibs"
    66088054
    6609           linkalldeplibs=no
    6610           if test "$link_all_deplibs" != no || test -z "$library_names" ||
    6611              test "$build_libtool_libs" = no; then
    6612             linkalldeplibs=yes
     8055          linkalldeplibs=false
     8056          if test no != "$link_all_deplibs" || test -z "$library_names" ||
     8057             test no = "$build_libtool_libs"; then
     8058            linkalldeplibs=:
    66138059          fi
    66148060
     
    66228068            esac
    66238069            # Need to link against all dependency_libs?
    6624             if test "$linkalldeplibs" = yes; then
     8070            if $linkalldeplibs; then
    66258071              deplibs="$deplib $deplibs"
    66268072            else
     
    66298075              newdependency_libs="$deplib $newdependency_libs"
    66308076            fi
    6631             if $opt_preserve_dup_deps ; then
     8077            if $opt_preserve_dup_deps; then
    66328078              case "$tmp_libs " in
    66338079              *" $deplib "*) func_append specialdeplibs " $deplib" ;;
     
    66398085        fi # $linkmode = prog...
    66408086
    6641         if test "$linkmode,$pass" = "prog,link"; then
     8087        if test prog,link = "$linkmode,$pass"; then
    66428088          if test -n "$library_names" &&
    6643              { { test "$prefer_static_libs" = no ||
    6644                  test "$prefer_static_libs,$installed" = "built,yes"; } ||
     8089             { { test no = "$prefer_static_libs" ||
     8090                 test built,yes = "$prefer_static_libs,$installed"; } ||
    66458091               test -z "$old_library"; }; then
    66468092            # We need to hardcode the library path
    6647             if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
     8093            if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
    66488094              # Make sure the rpath contains only unique directories.
    6649               case "$temp_rpath:" in
     8095              case $temp_rpath: in
    66508096              *"$absdir:"*) ;;
    66518097              *) func_append temp_rpath "$absdir:" ;;
     
    66768122          fi # $linkmode,$pass = prog,link...
    66778123
    6678           if test "$alldeplibs" = yes &&
    6679              { test "$deplibs_check_method" = pass_all ||
    6680                { test "$build_libtool_libs" = yes &&
     8124          if $alldeplibs &&
     8125             { test pass_all = "$deplibs_check_method" ||
     8126               { test yes = "$build_libtool_libs" &&
    66818127                 test -n "$library_names"; }; }; then
    66828128            # We only need to search for static libraries
     
    66878133        link_static=no # Whether the deplib will be linked statically
    66888134        use_static_libs=$prefer_static_libs
    6689         if test "$use_static_libs" = built && test "$installed" = yes; then
     8135        if test built = "$use_static_libs" && test yes = "$installed"; then
    66908136          use_static_libs=no
    66918137        fi
    66928138        if test -n "$library_names" &&
    6693            { test "$use_static_libs" = no || test -z "$old_library"; }; then
     8139           { test no = "$use_static_libs" || test -z "$old_library"; }; then
    66948140          case $host in
    6695           *cygwin* | *mingw* | *cegcc*)
     8141          *cygwin* | *mingw* | *cegcc* | *os2*)
    66968142              # No point in relinking DLLs because paths are not encoded
    66978143              func_append notinst_deplibs " $lib"
     
    66998145            ;;
    67008146          *)
    6701             if test "$installed" = no; then
     8147            if test no = "$installed"; then
    67028148              func_append notinst_deplibs " $lib"
    67038149              need_relink=yes
     
    67098155          # Warn about portability, can't link against -module's on some
    67108156          # systems (darwin).  Don't bleat about dlopened modules though!
    6711           dlopenmodule=""
     8157          dlopenmodule=
    67128158          for dlpremoduletest in $dlprefiles; do
    67138159            if test "X$dlpremoduletest" = "X$lib"; then
    6714               dlopenmodule="$dlpremoduletest"
     8160              dlopenmodule=$dlpremoduletest
    67158161              break
    67168162            fi
    67178163          done
    6718           if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
    6719             if test "$linkmode" != prog; then
    6720             echo
    6721             #  $ECHO "*** Warning: Linking the executable $output against the loadable module"
    6722             #else
    6723               $ECHO "*** Warning: Linking the shared library $output against the loadable module"
    6724             $ECHO "*** $linklib is not portable!"
    6725             fi
    6726           fi
    6727           if test "$linkmode" = lib &&
    6728              test "$hardcode_into_libs" = yes; then
     8164          #if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
     8165          #  echo
     8166          #  if test prog = "$linkmode"; then
     8167            $ECHO "*** Warning: Linking the executable $output against the loadable module"
     8168          else
     8169          #    $ECHO "*** Warning: Linking the shared library $output against the loadable module"
     8170          #  fi
     8171          #  $ECHO "*** $linklib is not portable!"
     8172          #fi
     8173          if test lib = "$linkmode" &&
     8174             test yes = "$hardcode_into_libs"; then
    67298175            # Hardcode the library path.
    67308176            # Skip directories that are in the system default run-time
     
    67548200            set dummy $library_names
    67558201            shift
    6756             realname="$1"
     8202            realname=$1
    67578203            shift
    67588204            libname=`eval "\\$ECHO \"$libname_spec\""`
    67598205            # use dlname if we got it. it's perfectly good, no?
    67608206            if test -n "$dlname"; then
    6761               soname="$dlname"
     8207              soname=$dlname
    67628208            elif test -n "$soname_spec"; then
    67638209              # bleh windows
    67648210              case $host in
    6765               *cygwin* | mingw* | *cegcc*)
     8211              *cygwin* | mingw* | *cegcc* | *os2*)
    67668212                func_arith $current - $age
    67678213                major=$func_arith_result
    6768                 versuffix="-$major"
     8214                versuffix=-$major
    67698215                ;;
    67708216              esac
    67718217              eval soname=\"$soname_spec\"
    67728218            else
    6773               soname="$realname"
     8219              soname=$realname
    67748220            fi
    67758221
    67768222            # Make a new name for the extract_expsyms_cmds to use
    6777             soroot="$soname"
     8223            soroot=$soname
    67788224            func_basename "$soroot"
    6779             soname="$func_basename_result"
     8225            soname=$func_basename_result
    67808226            func_stripname 'lib' '.dll' "$soname"
    67818227            newlib=libimp-$func_stripname_result.a
     
    67848230            if test -f "$output_objdir/$soname-def"; then :
    67858231            else
    6786               func_verbose "extracting exported symbol list from \`$soname'"
     8232              func_verbose "extracting exported symbol list from '$soname'"
    67878233              func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
    67888234            fi
     
    67908236            # Create $newlib
    67918237            if test -f "$output_objdir/$newlib"; then :; else
    6792               func_verbose "generating import library for \`$soname'"
     8238              func_verbose "generating import library for '$soname'"
    67938239              func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
    67948240            fi
     
    67988244          fi # test -n "$old_archive_from_expsyms_cmds"
    67998245
    6800           if test "$linkmode" = prog || test "$opt_mode" != relink; then
     8246          if test prog = "$linkmode" || test relink != "$opt_mode"; then
    68018247            add_shlibpath=
    68028248            add_dir=
     
    68058251            case $hardcode_action in
    68068252            immediate | unsupported)
    6807               if test "$hardcode_direct" = no; then
    6808                 add="$dir/$linklib"
     8253              if test no = "$hardcode_direct"; then
     8254                add=$dir/$linklib
    68098255                case $host in
    6810                   *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
    6811                   *-*-sysv4*uw2*) add_dir="-L$dir" ;;
     8256                  *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
     8257                  *-*-sysv4*uw2*) add_dir=-L$dir ;;
    68128258                  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
    6813                     *-*-unixware7*) add_dir="-L$dir" ;;
     8259                    *-*-unixware7*) add_dir=-L$dir ;;
    68148260                  *-*-darwin* )
    6815                     # if the lib is a (non-dlopened) module then we can not
     8261                    # if the lib is a (non-dlopened) module then we cannot
    68168262                    # link against it, someone is ignoring the earlier warnings
    68178263                    if /usr/bin/file -L $add 2> /dev/null |
    6818                          $GREP ": [^:]* bundle" >/dev/null ; then
     8264                         $GREP ": [^:]* bundle" >/dev/null; then
    68198265                      if test "X$dlopenmodule" != "X$lib"; then
    68208266                        $ECHO "*** Warning: lib $linklib is a module, not a shared library"
    6821                         if test -z "$old_library" ; then
     8267                        if test -z "$old_library"; then
    68228268                          echo
    68238269                          echo "*** And there doesn't seem to be a static archive available"
    68248270                          echo "*** The link will probably fail, sorry"
    68258271                        else
    6826                           add="$dir/$old_library"
     8272                          add=$dir/$old_library
    68278273                        fi
    68288274                      elif test -n "$old_library"; then
    6829                         add="$dir/$old_library"
     8275                        add=$dir/$old_library
    68308276                      fi
    68318277                    fi
    68328278                esac
    6833               elif test "$hardcode_minus_L" = no; then
     8279              elif test no = "$hardcode_minus_L"; then
    68348280                case $host in
    6835                 *-*-sunos*) add_shlibpath="$dir" ;;
     8281                *-*-sunos*) add_shlibpath=$dir ;;
    68368282                esac
    6837                 add_dir="-L$dir"
    6838                 add="-l$name"
    6839               elif test "$hardcode_shlibpath_var" = no; then
    6840                 add_shlibpath="$dir"
    6841                 add="-l$name"
     8283                add_dir=-L$dir
     8284                add=-l$name
     8285              elif test no = "$hardcode_shlibpath_var"; then
     8286                add_shlibpath=$dir
     8287                add=-l$name
    68428288              else
    68438289                lib_linked=no
     
    68458291              ;;
    68468292            relink)
    6847               if test "$hardcode_direct" = yes &&
    6848                  test "$hardcode_direct_absolute" = no; then
    6849                 add="$dir/$linklib"
    6850               elif test "$hardcode_minus_L" = yes; then
    6851                 add_dir="-L$absdir"
     8293              if test yes = "$hardcode_direct" &&
     8294                 test no = "$hardcode_direct_absolute"; then
     8295                add=$dir/$linklib
     8296              elif test yes = "$hardcode_minus_L"; then
     8297                add_dir=-L$absdir
    68528298                # Try looking first in the location we're being installed to.
    68538299                if test -n "$inst_prefix_dir"; then
     
    68588304                  esac
    68598305                fi
    6860                 add="-l$name"
    6861               elif test "$hardcode_shlibpath_var" = yes; then
    6862                 add_shlibpath="$dir"
    6863                 add="-l$name"
     8306                add=-l$name
     8307              elif test yes = "$hardcode_shlibpath_var"; then
     8308                add_shlibpath=$dir
     8309                add=-l$name
    68648310              else
    68658311                lib_linked=no
     
    68698315            esac
    68708316
    6871             if test "$lib_linked" != yes; then
     8317            if test yes != "$lib_linked"; then
    68728318              func_fatal_configuration "unsupported hardcode properties"
    68738319            fi
     
    68798325              esac
    68808326            fi
    6881             if test "$linkmode" = prog; then
     8327            if test prog = "$linkmode"; then
    68828328              test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
    68838329              test -n "$add" && compile_deplibs="$add $compile_deplibs"
     
    68858331              test -n "$add_dir" && deplibs="$add_dir $deplibs"
    68868332              test -n "$add" && deplibs="$add $deplibs"
    6887               if test "$hardcode_direct" != yes &&
    6888                  test "$hardcode_minus_L" != yes &&
    6889                  test "$hardcode_shlibpath_var" = yes; then
     8333              if test yes != "$hardcode_direct" &&
     8334                 test yes != "$hardcode_minus_L" &&
     8335                 test yes = "$hardcode_shlibpath_var"; then
    68908336                case :$finalize_shlibpath: in
    68918337                *":$libdir:"*) ;;
     
    68968342          fi
    68978343
    6898           if test "$linkmode" = prog || test "$opt_mode" = relink; then
     8344          if test prog = "$linkmode" || test relink = "$opt_mode"; then
    68998345            add_shlibpath=
    69008346            add_dir=
    69018347            add=
    69028348            # Finalize command for both is simple: just hardcode it.
    6903             if test "$hardcode_direct" = yes &&
    6904                test "$hardcode_direct_absolute" = no; then
    6905               add="$libdir/$linklib"
    6906             elif test "$hardcode_minus_L" = yes; then
    6907               add_dir="-L$libdir"
    6908               add="-l$name"
    6909             elif test "$hardcode_shlibpath_var" = yes; then
     8349            if test yes = "$hardcode_direct" &&
     8350               test no = "$hardcode_direct_absolute"; then
     8351              add=$libdir/$linklib
     8352            elif test yes = "$hardcode_minus_L"; then
     8353              add_dir=-L$libdir
     8354              add=-l$name
     8355            elif test yes = "$hardcode_shlibpath_var"; then
    69108356              case :$finalize_shlibpath: in
    69118357              *":$libdir:"*) ;;
    69128358              *) func_append finalize_shlibpath "$libdir:" ;;
    69138359              esac
    6914               add="-l$name"
    6915             elif test "$hardcode_automatic" = yes; then
     8360              add=-l$name
     8361            elif test yes = "$hardcode_automatic"; then
    69168362              if test -n "$inst_prefix_dir" &&
    6917                  test -f "$inst_prefix_dir$libdir/$linklib" ; then
    6918                 add="$inst_prefix_dir$libdir/$linklib"
     8363                 test -f "$inst_prefix_dir$libdir/$linklib"; then
     8364                add=$inst_prefix_dir$libdir/$linklib
    69198365              else
    6920                 add="$libdir/$linklib"
     8366                add=$libdir/$linklib
    69218367              fi
    69228368            else
    69238369              # We cannot seem to hardcode it, guess we'll fake it.
    6924               add_dir="-L$libdir"
     8370              add_dir=-L$libdir
    69258371              # Try looking first in the location we're being installed to.
    69268372              if test -n "$inst_prefix_dir"; then
     
    69318377                esac
    69328378              fi
    6933               add="-l$name"
     8379              add=-l$name
    69348380            fi
    69358381
    6936             if test "$linkmode" = prog; then
     8382            if test prog = "$linkmode"; then
    69378383              test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
    69388384              test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
     
    69428388            fi
    69438389          fi
    6944         elif test "$linkmode" = prog; then
     8390        elif test prog = "$linkmode"; then
    69458391          # Here we assume that one of hardcode_direct or hardcode_minus_L
    69468392          # is not unsupported.  This is valid on all known static and
    69478393          # shared platforms.
    6948           if test "$hardcode_direct" != unsupported; then
    6949             test -n "$old_library" && linklib="$old_library"
     8394          if test unsupported != "$hardcode_direct"; then
     8395            test -n "$old_library" && linklib=$old_library
    69508396            compile_deplibs="$dir/$linklib $compile_deplibs"
    69518397            finalize_deplibs="$dir/$linklib $finalize_deplibs"
     
    69548400            finalize_deplibs="-l$name -L$dir $finalize_deplibs"
    69558401          fi
    6956         elif test "$build_libtool_libs" = yes; then
     8402        elif test yes = "$build_libtool_libs"; then
    69578403          # Not a shared library
    6958           if test "$deplibs_check_method" != pass_all; then
     8404          if test pass_all != "$deplibs_check_method"; then
    69598405            # We're trying link a shared library against a static one
    69608406            # but the system doesn't support it.
     
    69638409            # that the program can be linked against the static library.
    69648410            echo
    6965             $ECHO "*** Warning: This system can not link to static lib archive $lib."
     8411            $ECHO "*** Warning: This system cannot link to static lib archive $lib."
    69668412            echo "*** I have the capability to make that library automatically link in when"
    69678413            echo "*** you link to this library.  But I can only do this if you have a"
    69688414            echo "*** shared version of the library, which you do not appear to have."
    6969             if test "$module" = yes; then
     8415            if test yes = "$module"; then
    69708416              echo "*** But as you try to build a module library, libtool will still create "
    69718417              echo "*** a static module, that should work as long as the dlopening application"
     
    69748420                echo
    69758421                echo "*** However, this would only work if libtool was able to extract symbol"
    6976                 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
     8422                echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
    69778423                echo "*** not find such a program.  So, this module is probably useless."
    6978                 echo "*** \`nm' from GNU binutils and a full rebuild may help."
     8424                echo "*** 'nm' from GNU binutils and a full rebuild may help."
    69798425              fi
    6980               if test "$build_old_libs" = no; then
     8426              if test no = "$build_old_libs"; then
    69818427                build_libtool_libs=module
    69828428                build_old_libs=yes
     
    69918437        fi # link shared/static library?
    69928438
    6993         if test "$linkmode" = lib; then
     8439        if test lib = "$linkmode"; then
    69948440          if test -n "$dependency_libs" &&
    6995              { test "$hardcode_into_libs" != yes ||
    6996                test "$build_old_libs" = yes ||
    6997                test "$link_static" = yes; }; then
     8441             { test yes != "$hardcode_into_libs" ||
     8442               test yes = "$build_old_libs" ||
     8443               test yes = "$link_static"; }; then
    69988444            # Extract -R from dependency_libs
    69998445            temp_deplibs=
     
    70098455              esac
    70108456            done
    7011             dependency_libs="$temp_deplibs"
     8457            dependency_libs=$temp_deplibs
    70128458          fi
    70138459
    70148460          func_append newlib_search_path " $absdir"
    70158461          # Link against this library
    7016           test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
     8462          test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
    70178463          # ... and its dependency_libs
    70188464          tmp_libs=
     
    70248470              *) func_resolve_sysroot "$deplib" ;;
    70258471            esac
    7026             if $opt_preserve_dup_deps ; then
     8472            if $opt_preserve_dup_deps; then
    70278473              case "$tmp_libs " in
    70288474              *" $func_resolve_sysroot_result "*)
     
    70338479          done
    70348480
    7035           if test "$link_all_deplibs" != no; then
     8481          if test no != "$link_all_deplibs"; then
    70368482            # Add the search paths of all dependency libraries
    70378483            for deplib in $dependency_libs; do
    70388484              path=
    70398485              case $deplib in
    7040               -L*) path="$deplib" ;;
     8486              -L*) path=$deplib ;;
    70418487              *.la)
    70428488                func_resolve_sysroot "$deplib"
     
    70468492                # We need an absolute path.
    70478493                case $dir in
    7048                 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
     8494                [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
    70498495                *)
    70508496                  absdir=`cd "$dir" && pwd`
    70518497                  if test -z "$absdir"; then
    7052                     func_warning "cannot determine absolute directory name of \`$dir'"
    7053                     absdir="$dir"
     8498                    func_warning "cannot determine absolute directory name of '$dir'"
     8499                    absdir=$dir
    70548500                  fi
    70558501                  ;;
     
    70598505                *-*-darwin*)
    70608506                  depdepl=
    7061                   eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
    7062                   if test -n "$deplibrary_names" ; then
    7063                     for tmp in $deplibrary_names ; do
     8507                  eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
     8508                  if test -n "$deplibrary_names"; then
     8509                    for tmp in $deplibrary_names; do
    70648510                      depdepl=$tmp
    70658511                    done
    7066                     if test -f "$absdir/$objdir/$depdepl" ; then
    7067                       depdepl="$absdir/$objdir/$depdepl"
    7068                       darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
     8512                    if test -f "$absdir/$objdir/$depdepl"; then
     8513                      depdepl=$absdir/$objdir/$depdepl
     8514                      darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
    70698515                      if test -z "$darwin_install_name"; then
    7070                           darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
     8516                          darwin_install_name=`$OTOOL64 -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
    70718517                      fi
    7072                       func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
    7073                       func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
     8518                      func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"
     8519                      func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"
    70748520                      path=
    70758521                    fi
     
    70778523                  ;;
    70788524                *)
    7079                   path="-L$absdir/$objdir"
     8525                  path=-L$absdir/$objdir
    70808526                  ;;
    70818527                esac
    70828528                else
    7083                   eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
     8529                  eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
    70848530                  test -z "$libdir" && \
    7085                     func_fatal_error "\`$deplib' is not a valid libtool archive"
     8531                    func_fatal_error "'$deplib' is not a valid libtool archive"
    70868532                  test "$absdir" != "$libdir" && \
    7087                     func_warning "\`$deplib' seems to be moved"
    7088 
    7089                   path="-L$absdir"
     8533                    func_warning "'$deplib' seems to be moved"
     8534
     8535                  path=-L$absdir
    70908536                fi
    70918537                ;;
     
    70998545        fi # linkmode = lib
    71008546      done # for deplib in $libs
    7101       if test "$pass" = link; then
    7102         if test "$linkmode" = "prog"; then
     8547      if test link = "$pass"; then
     8548        if test prog = "$linkmode"; then
    71038549          compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
    71048550          finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
     
    71078553        fi
    71088554      fi
    7109       dependency_libs="$newdependency_libs"
    7110       if test "$pass" = dlpreopen; then
     8555      dependency_libs=$newdependency_libs
     8556      if test dlpreopen = "$pass"; then
    71118557        # Link the dlpreopened libraries before other libraries
    71128558        for deplib in $save_deplibs; do
     
    71148560        done
    71158561      fi
    7116       if test "$pass" != dlopen; then
    7117         if test "$pass" != conv; then
     8562      if test dlopen != "$pass"; then
     8563        test conv = "$pass" || {
    71188564          # Make sure lib_search_path contains only unique directories.
    71198565          lib_search_path=
     
    71258571          done
    71268572          newlib_search_path=
    7127         fi
    7128 
    7129         if test "$linkmode,$pass" != "prog,link"; then
    7130           vars="deplibs"
     8573        }
     8574
     8575        if test prog,link = "$linkmode,$pass"; then
     8576          vars="compile_deplibs finalize_deplibs"
    71318577        else
    7132           vars="compile_deplibs finalize_deplibs"
     8578          vars=deplibs
    71338579        fi
    71348580        for var in $vars dependency_libs; do
     
    71888634        done # for var
    71898635      fi
     8636
     8637      # Add Sun CC postdeps if required:
     8638      test CXX = "$tagname" && {
     8639        case $host_os in
     8640        linux*)
     8641          case `$CC -V 2>&1 | sed 5q` in
     8642          *Sun\ C*) # Sun C++ 5.9
     8643            func_suncc_cstd_abi
     8644
     8645            if test no != "$suncc_use_cstd_abi"; then
     8646              func_append postdeps ' -library=Cstd -library=Crun'
     8647            fi
     8648            ;;
     8649          esac
     8650          ;;
     8651
     8652        solaris*)
     8653          func_cc_basename "$CC"
     8654          case $func_cc_basename_result in
     8655          CC* | sunCC*)
     8656            func_suncc_cstd_abi
     8657
     8658            if test no != "$suncc_use_cstd_abi"; then
     8659              func_append postdeps ' -library=Cstd -library=Crun'
     8660            fi
     8661            ;;
     8662          esac
     8663          ;;
     8664        esac
     8665      }
     8666
    71908667      # Last step: remove runtime libs from dependency_libs
    71918668      # (they stay in deplibs)
    71928669      tmp_libs=
    7193       for i in $dependency_libs ; do
     8670      for i in $dependency_libs; do
    71948671        case " $predeps $postdeps $compiler_lib_search_path " in
    71958672        *" $i "*)
    7196           i=""
     8673          i=
    71978674          ;;
    71988675        esac
    7199         if test -n "$i" ; then
     8676        if test -n "$i"; then
    72008677          func_append tmp_libs " $i"
    72018678        fi
     
    72038680      dependency_libs=$tmp_libs
    72048681    done # for pass
    7205     if test "$linkmode" = prog; then
    7206       dlfiles="$newdlfiles"
     8682    if test prog = "$linkmode"; then
     8683      dlfiles=$newdlfiles
    72078684    fi
    7208     if test "$linkmode" = prog || test "$linkmode" = lib; then
    7209       dlprefiles="$newdlprefiles"
     8685    if test prog = "$linkmode" || test lib = "$linkmode"; then
     8686      dlprefiles=$newdlprefiles
    72108687    fi
    72118688
    72128689    case $linkmode in
    72138690    oldlib)
    7214       if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
    7215         func_warning "\`-dlopen' is ignored for archives"
     8691      if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
     8692        func_warning "'-dlopen' is ignored for archives"
    72168693      fi
    72178694
    72188695      case " $deplibs" in
    72198696      *\ -l* | *\ -L*)
    7220         func_warning "\`-l' and \`-L' are ignored for archives" ;;
     8697        func_warning "'-l' and '-L' are ignored for archives" ;;
    72218698      esac
    72228699
    72238700      test -n "$rpath" && \
    7224         func_warning "\`-rpath' is ignored for archives"
     8701        func_warning "'-rpath' is ignored for archives"
    72258702
    72268703      test -n "$xrpath" && \
    7227         func_warning "\`-R' is ignored for archives"
     8704        func_warning "'-R' is ignored for archives"
    72288705
    72298706      test -n "$vinfo" && \
    7230         func_warning "\`-version-info/-version-number' is ignored for archives"
     8707        func_warning "'-version-info/-version-number' is ignored for archives"
    72318708
    72328709      test -n "$release" && \
    7233         func_warning "\`-release' is ignored for archives"
     8710        func_warning "'-release' is ignored for archives"
    72348711
    72358712      test -n "$export_symbols$export_symbols_regex" && \
    7236         func_warning "\`-export-symbols' is ignored for archives"
     8713        func_warning "'-export-symbols' is ignored for archives"
    72378714
    72388715      # Now set the variables for building old libraries.
    72398716      build_libtool_libs=no
    7240       oldlibs="$output"
     8717      oldlibs=$output
    72418718      func_append objs "$old_deplibs"
    72428719      ;;
    72438720
    72448721    lib)
    7245       # Make sure we only generate libraries of the form `libNAME.la'.
     8722      # Make sure we only generate libraries of the form 'libNAME.la'.
    72468723      case $outputname in
    72478724      lib*)
     
    72528729        ;;
    72538730      *)
    7254         test "$module" = no && \
    7255           func_fatal_help "libtool library \`$output' must begin with \`lib'"
    7256 
    7257         if test "$need_lib_prefix" != no; then
     8731        test no = "$module" \
     8732          && func_fatal_help "libtool library '$output' must begin with 'lib'"
     8733
     8734        if test no != "$need_lib_prefix"; then
    72588735          # Add the "lib" prefix for modules if required
    72598736          func_stripname '' '.la' "$outputname"
     
    72698746
    72708747      if test -n "$objs"; then
    7271         if test "$deplibs_check_method" != pass_all; then
    7272           func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
     8748        if test pass_all != "$deplibs_check_method"; then
     8749          func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
    72738750        else
    72748751          echo
     
    72798756      fi
    72808757
    7281       test "$dlself" != no && \
    7282         func_warning "\`-dlopen self' is ignored for libtool libraries"
     8758      test no = "$dlself" \
     8759        || func_warning "'-dlopen self' is ignored for libtool libraries"
    72838760
    72848761      set dummy $rpath
    72858762      shift
    7286       test "$#" -gt 1 && \
    7287         func_warning "ignoring multiple \`-rpath's for a libtool library"
    7288 
    7289       install_libdir="$1"
     8763      test 1 -lt "$#" \
     8764        && func_warning "ignoring multiple '-rpath's for a libtool library"
     8765
     8766      install_libdir=$1
    72908767
    72918768      oldlibs=
    72928769      if test -z "$rpath"; then
    7293         if test "$build_libtool_libs" = yes; then
     8770        if test yes = "$build_libtool_libs"; then
    72948771          # Building a libtool convenience library.
    7295           # Some compilers have problems with a `.al' extension so
     8772          # Some compilers have problems with a '.al' extension so
    72968773          # convenience libraries should have the same extension an
    72978774          # archive normally would.
     
    73028779
    73038780        test -n "$vinfo" && \
    7304           func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
     8781          func_warning "'-version-info/-version-number' is ignored for convenience libraries"
    73058782
    73068783        test -n "$release" && \
    7307           func_warning "\`-release' is ignored for convenience libraries"
     8784          func_warning "'-release' is ignored for convenience libraries"
    73088785      else
    73098786
    73108787        # Parse the version information argument.
    7311         save_ifs="$IFS"; IFS=':'
     8788        save_ifs=$IFS; IFS=:
    73128789        set dummy $vinfo 0 0 0
    73138790        shift
    7314         IFS="$save_ifs"
     8791        IFS=$save_ifs
    73158792
    73168793        test -n "$7" && \
    7317           func_fatal_help "too many parameters to \`-version-info'"
     8794          func_fatal_help "too many parameters to '-version-info'"
    73188795
    73198796        # convert absolute version numbers to libtool ages
     
    73238800        case $vinfo_number in
    73248801        yes)
    7325           number_major="$1"
    7326           number_minor="$2"
    7327           number_revision="$3"
     8802          number_major=$1
     8803          number_minor=$2
     8804          number_revision=$3
    73288805          #
    73298806          # There are really only two kinds -- those that
     
    73318808          # and those that subtract age and use age as
    73328809          # a minor version.  But, then there is irix
    7333           # which has an extra 1 added just for fun
     8810          # that has an extra 1 added just for fun
    73348811          #
    73358812          case $version_type in
    73368813          # correct linux to gnu/linux during the next big refactor
    7337           darwin|linux|osf|windows|none)
     8814          darwin|freebsd-elf|linux|osf|windows|none)
    73388815            func_arith $number_major + $number_minor
    73398816            current=$func_arith_result
    7340             age="$number_minor"
    7341             revision="$number_revision"
     8817            age=$number_minor
     8818            revision=$number_revision
    73428819            ;;
    7343           freebsd-aout|freebsd-elf|qnx|sunos)
    7344             current="$number_major"
    7345             revision="$number_minor"
    7346             age="0"
     8820          freebsd-aout|qnx|sunos)
     8821            current=$number_major
     8822            revision=$number_minor
     8823            age=0
    73478824            ;;
    73488825          irix|nonstopux)
    73498826            func_arith $number_major + $number_minor
    73508827            current=$func_arith_result
    7351             age="$number_minor"
    7352             revision="$number_minor"
     8828            age=$number_minor
     8829            revision=$number_minor
    73538830            lt_irix_increment=no
    73548831            ;;
    73558832          *)
    7356             func_fatal_configuration "$modename: unknown library version type \`$version_type'"
     8833            func_fatal_configuration "$modename: unknown library version type '$version_type'"
    73578834            ;;
    73588835          esac
    73598836          ;;
    73608837        no)
    7361           current="$1"
    7362           revision="$2"
    7363           age="$3"
     8838          current=$1
     8839          revision=$2
     8840          age=$3
    73648841          ;;
    73658842        esac
     
    73698846        0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
    73708847        *)
    7371           func_error "CURRENT \`$current' must be a nonnegative integer"
    7372           func_fatal_error "\`$vinfo' is not valid version information"
     8848          func_error "CURRENT '$current' must be a nonnegative integer"
     8849          func_fatal_error "'$vinfo' is not valid version information"
    73738850          ;;
    73748851        esac
     
    73778854        0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
    73788855        *)
    7379           func_error "REVISION \`$revision' must be a nonnegative integer"
    7380           func_fatal_error "\`$vinfo' is not valid version information"
     8856          func_error "REVISION '$revision' must be a nonnegative integer"
     8857          func_fatal_error "'$vinfo' is not valid version information"
    73818858          ;;
    73828859        esac
     
    73858862        0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
    73868863        *)
    7387           func_error "AGE \`$age' must be a nonnegative integer"
    7388           func_fatal_error "\`$vinfo' is not valid version information"
     8864          func_error "AGE '$age' must be a nonnegative integer"
     8865          func_fatal_error "'$vinfo' is not valid version information"
    73898866          ;;
    73908867        esac
    73918868
    73928869        if test "$age" -gt "$current"; then
    7393           func_error "AGE \`$age' is greater than the current interface number \`$current'"
    7394           func_fatal_error "\`$vinfo' is not valid version information"
     8870          func_error "AGE '$age' is greater than the current interface number '$current'"
     8871          func_fatal_error "'$vinfo' is not valid version information"
    73958872        fi
    73968873
     
    74078884          func_arith $current - $age
    74088885          major=.$func_arith_result
    7409           versuffix="$major.$age.$revision"
     8886          versuffix=$major.$age.$revision
    74108887          # Darwin ld doesn't like 0 for these options...
    74118888          func_arith $current + 1
    74128889          minor_current=$func_arith_result
    7413           xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
     8890          xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
    74148891          verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
     8892          # On Darwin other compilers
     8893          case $CC in
     8894              nagfor*)
     8895                  verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
     8896                  ;;
     8897              *)
     8898                  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
     8899                  ;;
     8900          esac
    74158901          ;;
    74168902
    74178903        freebsd-aout)
    7418           major=".$current"
    7419           versuffix=".$current.$revision";
     8904          major=.$current
     8905          versuffix=.$current.$revision
    74208906          ;;
    74218907
    74228908        freebsd-elf)
    7423           major=".$current"
    7424           versuffix=".$current"
     8909          func_arith $current - $age
     8910          major=.$func_arith_result
     8911          versuffix=$major.$age.$revision
    74258912          ;;
    74268913
    74278914        irix | nonstopux)
    7428           if test "X$lt_irix_increment" = "Xno"; then
     8915          if test no = "$lt_irix_increment"; then
    74298916            func_arith $current - $age
    74308917          else
     
    74378924            *)         verstring_prefix=sgi ;;
    74388925          esac
    7439           verstring="$verstring_prefix$major.$revision"
     8926          verstring=$verstring_prefix$major.$revision
    74408927
    74418928          # Add in all the interfaces that we are compatible with.
    74428929          loop=$revision
    7443           while test "$loop" -ne 0; do
     8930          while test 0 -ne "$loop"; do
    74448931            func_arith $revision - $loop
    74458932            iface=$func_arith_result
    74468933            func_arith $loop - 1
    74478934            loop=$func_arith_result
    7448             verstring="$verstring_prefix$major.$iface:$verstring"
     8935            verstring=$verstring_prefix$major.$iface:$verstring
    74498936          done
    74508937
    7451           # Before this point, $major must not contain `.'.
     8938          # Before this point, $major must not contain '.'.
    74528939          major=.$major
    7453           versuffix="$major.$revision"
     8940          versuffix=$major.$revision
    74548941          ;;
    74558942
     
    74578944          func_arith $current - $age
    74588945          major=.$func_arith_result
    7459           versuffix="$major.$age.$revision"
     8946          versuffix=$major.$age.$revision
    74608947          ;;
    74618948
     
    74638950          func_arith $current - $age
    74648951          major=.$func_arith_result
    7465           versuffix=".$current.$age.$revision"
    7466           verstring="$current.$age.$revision"
     8952          versuffix=.$current.$age.$revision
     8953          verstring=$current.$age.$revision
    74678954
    74688955          # Add in all the interfaces that we are compatible with.
    74698956          loop=$age
    7470           while test "$loop" -ne 0; do
     8957          while test 0 -ne "$loop"; do
    74718958            func_arith $current - $loop
    74728959            iface=$func_arith_result
    74738960            func_arith $loop - 1
    74748961            loop=$func_arith_result
    7475             verstring="$verstring:${iface}.0"
     8962            verstring=$verstring:$iface.0
    74768963          done
    74778964
    74788965          # Make executables depend on our current version.
    7479           func_append verstring ":${current}.0"
     8966          func_append verstring ":$current.0"
    74808967          ;;
    74818968
    74828969        qnx)
    7483           major=".$current"
    7484           versuffix=".$current"
     8970          major=.$current
     8971          versuffix=.$current
    74858972          ;;
    74868973
     8974        sco)
     8975          major=.$current
     8976          versuffix=.$current
     8977          ;;
     8978
    74878979        sunos)
    7488           major=".$current"
    7489           versuffix=".$current.$revision"
     8980          major=.$current
     8981          versuffix=.$current.$revision
    74908982          ;;
    74918983
    74928984        windows)
    74938985          # Use '-' rather than '.', since we only want one
    7494           # extension on DOS 8.3 filesystems.
     8986          # extension on DOS 8.3 file systems.
    74958987          func_arith $current - $age
    74968988          major=$func_arith_result
    7497           versuffix="-$major"
     8989          versuffix=-$major
    74988990          ;;
    74998991
    75008992        *)
    7501           func_fatal_configuration "unknown library version type \`$version_type'"
     8993          func_fatal_configuration "unknown library version type '$version_type'"
    75028994          ;;
    75038995        esac
     
    75139005            ;;
    75149006          *)
    7515             verstring="0.0"
     9007            verstring=0.0
    75169008            ;;
    75179009          esac
    7518           if test "$need_version" = no; then
     9010          if test no = "$need_version"; then
    75199011            versuffix=
    75209012          else
    7521             versuffix=".0.0"
     9013            versuffix=.0.0
    75229014          fi
    75239015        fi
    75249016
    75259017        # Remove version info from name if versioning should be avoided
    7526         if test "$avoid_version" = yes && test "$need_version" = no; then
     9018        if test yes,no = "$avoid_version,$need_version"; then
    75279019          major=
    75289020          versuffix=
    7529           verstring=""
     9021          verstring=
    75309022        fi
    75319023
    75329024        # Check to see if the archive will have undefined symbols.
    7533         if test "$allow_undefined" = yes; then
    7534           if test "$allow_undefined_flag" = unsupported; then
    7535             func_warning "undefined symbols not allowed in $host shared libraries"
    7536             build_libtool_libs=no
    7537             build_old_libs=yes
     9025        if test yes = "$allow_undefined"; then
     9026          if test unsupported = "$allow_undefined_flag"; then
     9027            if test yes = "$build_old_libs"; then
     9028              func_warning "undefined symbols not allowed in $host shared libraries; building static only"
     9029              build_libtool_libs=no
     9030            else
     9031              func_fatal_error "can't build $host shared library unless -no-undefined is specified"
     9032            fi
    75389033          fi
    75399034        else
    75409035          # Don't allow undefined symbols.
    7541           allow_undefined_flag="$no_undefined_flag"
     9036          allow_undefined_flag=$no_undefined_flag
    75429037        fi
    75439038
    75449039      fi
    75459040
    7546       func_generate_dlsyms "$libname" "$libname" "yes"
     9041      func_generate_dlsyms "$libname" "$libname" :
    75479042      func_append libobjs " $symfileobj"
    7548       test "X$libobjs" = "X " && libobjs=
    7549 
    7550       if test "$opt_mode" != relink; then
     9043      test " " = "$libobjs" && libobjs=
     9044
     9045      if test relink != "$opt_mode"; then
    75519046        # Remove our outputs, but don't remove object files since they
    75529047        # may have been created when compiling PIC objects.
     
    75579052            *.$objext | *.gcno)
    75589053               ;;
    7559             $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
    7560                if test "X$precious_files_regex" != "X"; then
     9054            $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)
     9055               if test -n "$precious_files_regex"; then
    75619056                 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
    75629057                 then
     
    75749069
    75759070      # Now set the variables for building old libraries.
    7576       if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
     9071      if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then
    75779072        func_append oldlibs " $output_objdir/$libname.$libext"
    75789073
    75799074        # Transform .lo files to .o files.
    7580         oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
     9075        oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`
    75819076      fi
    75829077
     
    75999094          esac
    76009095        done
    7601         if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
     9096        if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then
    76029097          dependency_libs="$temp_xrpath $dependency_libs"
    76039098        fi
     
    76059100
    76069101      # Make sure dlfiles contains only unique files that won't be dlpreopened
    7607       old_dlfiles="$dlfiles"
     9102      old_dlfiles=$dlfiles
    76089103      dlfiles=
    76099104      for lib in $old_dlfiles; do
     
    76159110
    76169111      # Make sure dlprefiles contains only unique files
    7617       old_dlprefiles="$dlprefiles"
     9112      old_dlprefiles=$dlprefiles
    76189113      dlprefiles=
    76199114      for lib in $old_dlprefiles; do
     
    76249119      done
    76259120
    7626       if test "$build_libtool_libs" = yes; then
     9121      if test yes = "$build_libtool_libs"; then
    76279122        if test -n "$rpath"; then
    76289123          case $host in
     
    76489143          *)
    76499144            # Add libc to deplibs on all other systems if necessary.
    7650             if test "$build_libtool_need_lc" = "yes"; then
     9145            if test yes = "$build_libtool_need_lc"; then
    76519146              func_append deplibs " -lc"
    76529147            fi
     
    76649159        # release should show up in the -l (ie -lgmp5) so we don't want to
    76659160        # add it in twice.  Is that correct?
    7666         release=""
    7667         versuffix=""
    7668         major=""
     9161        release=
     9162        versuffix=
     9163        major=
    76699164        newdeplibs=
    76709165        droppeddeps=no
     
    76959190                func_stripname -l '' "$i"
    76969191                name=$func_stripname_result
    7697                 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
     9192                if test yes = "$allow_libtool_libs_with_static_runtimes"; then
    76989193                  case " $predeps $postdeps " in
    76999194                  *" $i "*)
    77009195                    func_append newdeplibs " $i"
    7701                     i=""
     9196                    i=
    77029197                    ;;
    77039198                  esac
    77049199                fi
    7705                 if test -n "$i" ; then
     9200                if test -n "$i"; then
    77069201                  libname=`eval "\\$ECHO \"$libname_spec\""`
    77079202                  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
    77089203                  set dummy $deplib_matches; shift
    77099204                  deplib_match=$1
    7710                   if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
     9205                  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
    77119206                    func_append newdeplibs " $i"
    77129207                  else
     
    77389233                if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
    77399234                  ldd_output=`ldd conftest`
    7740                   if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
     9235                  if test yes = "$allow_libtool_libs_with_static_runtimes"; then
    77419236                    case " $predeps $postdeps " in
    77429237                    *" $i "*)
    77439238                      func_append newdeplibs " $i"
    7744                       i=""
     9239                      i=
    77459240                      ;;
    77469241                    esac
    77479242                  fi
    7748                   if test -n "$i" ; then
     9243                  if test -n "$i"; then
    77499244                    libname=`eval "\\$ECHO \"$libname_spec\""`
    77509245                    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
    77519246                    set dummy $deplib_matches; shift
    77529247                    deplib_match=$1
    7753                     if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
     9248                    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
    77549249                      func_append newdeplibs " $i"
    77559250                    else
     
    77889283              func_stripname -l '' "$a_deplib"
    77899284              name=$func_stripname_result
    7790               if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
     9285              if test yes = "$allow_libtool_libs_with_static_runtimes"; then
    77919286                case " $predeps $postdeps " in
    77929287                *" $a_deplib "*)
    77939288                  func_append newdeplibs " $a_deplib"
    7794                   a_deplib=""
     9289                  a_deplib=
    77959290                  ;;
    77969291                esac
    77979292              fi
    7798               if test -n "$a_deplib" ; then
     9293              if test -n "$a_deplib"; then
    77999294                libname=`eval "\\$ECHO \"$libname_spec\""`
    78009295                if test -n "$file_magic_glob"; then
     
    78039298                  libnameglob=$libname
    78049299                fi
    7805                 test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
     9300                test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`
    78069301                for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
    7807                   if test "$want_nocaseglob" = yes; then
     9302                  if test yes = "$want_nocaseglob"; then
    78089303                    shopt -s nocaseglob
    78099304                    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
     
    78239318                      # loop can be closed while we follow links,
    78249319                      # but so what?
    7825                       potlib="$potent_lib"
     9320                      potlib=$potent_lib
    78269321                      while test -h "$potlib" 2>/dev/null; do
    7827                         potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
     9322                        potliblink=`ls -ld $potlib | $SED 's/.* -> //'`
    78289323                        case $potliblink in
    7829                         [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
    7830                         *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
     9324                        [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
     9325                        *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
    78319326                        esac
    78329327                      done
     
    78359330                         $EGREP "$file_magic_regex" > /dev/null; then
    78369331                        func_append newdeplibs " $a_deplib"
    7837                         a_deplib=""
     9332                        a_deplib=
    78389333                        break 2
    78399334                      fi
     
    78419336                done
    78429337              fi
    7843               if test -n "$a_deplib" ; then
     9338              if test -n "$a_deplib"; then
    78449339                droppeddeps=yes
    78459340                echo
     
    78499344                echo "*** shared version of the library, which you do not appear to have"
    78509345                echo "*** because I did check the linker path looking for a file starting"
    7851                 if test -z "$potlib" ; then
     9346                if test -z "$potlib"; then
    78529347                  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
    78539348                else
     
    78729367              func_stripname -l '' "$a_deplib"
    78739368              name=$func_stripname_result
    7874               if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
     9369              if test yes = "$allow_libtool_libs_with_static_runtimes"; then
    78759370                case " $predeps $postdeps " in
    78769371                *" $a_deplib "*)
    78779372                  func_append newdeplibs " $a_deplib"
    7878                   a_deplib=""
     9373                  a_deplib=
    78799374                  ;;
    78809375                esac
    78819376              fi
    7882               if test -n "$a_deplib" ; then
     9377              if test -n "$a_deplib"; then
    78839378                libname=`eval "\\$ECHO \"$libname_spec\""`
    78849379                for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
    78859380                  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
    78869381                  for potent_lib in $potential_libs; do
    7887                     potlib="$potent_lib" # see symlink-check above in file_magic test
     9382                    potlib=$potent_lib # see symlink-check above in file_magic test
    78889383                    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
    78899384                       $EGREP "$match_pattern_regex" > /dev/null; then
    78909385                      func_append newdeplibs " $a_deplib"
    7891                       a_deplib=""
     9386                      a_deplib=
    78929387                      break 2
    78939388                    fi
     
    78959390                done
    78969391              fi
    7897               if test -n "$a_deplib" ; then
     9392              if test -n "$a_deplib"; then
    78989393                droppeddeps=yes
    78999394                echo
     
    79039398                echo "*** shared version of the library, which you do not appear to have"
    79049399                echo "*** because I did check the linker path looking for a file starting"
    7905                 if test -z "$potlib" ; then
     9400                if test -z "$potlib"; then
    79069401                  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
    79079402                else
     
    79199414          ;;
    79209415        none | unknown | *)
    7921           newdeplibs=""
     9416          newdeplibs=
    79229417          tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
    7923           if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
    7924             for i in $predeps $postdeps ; do
     9418          if test yes = "$allow_libtool_libs_with_static_runtimes"; then
     9419            for i in $predeps $postdeps; do
    79259420              # can't use Xsed below, because $i might contain '/'
    7926               tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
     9421              tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
    79279422            done
    79289423          fi
     
    79309425          *[!\  \ ]*)
    79319426            echo
    7932             if test "X$deplibs_check_method" = "Xnone"; then
     9427            if test none = "$deplibs_check_method"; then
    79339428              echo "*** Warning: inter-library dependencies are not supported in this platform."
    79349429            else
     
    79549449        esac
    79559450
    7956         if test "$droppeddeps" = yes; then
    7957           if test "$module" = yes; then
     9451        if test yes = "$droppeddeps"; then
     9452          if test yes = "$module"; then
    79589453            echo
    79599454            echo "*** Warning: libtool could not satisfy all declared inter-library"
     
    79649459              echo
    79659460              echo "*** However, this would only work if libtool was able to extract symbol"
    7966               echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
     9461              echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
    79679462              echo "*** not find such a program.  So, this module is probably useless."
    7968               echo "*** \`nm' from GNU binutils and a full rebuild may help."
     9463              echo "*** 'nm' from GNU binutils and a full rebuild may help."
    79699464            fi
    7970             if test "$build_old_libs" = no; then
    7971               oldlibs="$output_objdir/$libname.$libext"
     9465            if test no = "$build_old_libs"; then
     9466              oldlibs=$output_objdir/$libname.$libext
    79729467              build_libtool_libs=module
    79739468              build_old_libs=yes
     
    79809475            echo "*** or is declared to -dlopen it."
    79819476
    7982             if test "$allow_undefined" = no; then
     9477            if test no = "$allow_undefined"; then
    79839478              echo
    79849479              echo "*** Since this library must not contain undefined symbols,"
     
    79869481              echo "*** it was explicitly requested with -no-undefined,"
    79879482              echo "*** libtool will only create a static version of it."
    7988               if test "$build_old_libs" = no; then
    7989                 oldlibs="$output_objdir/$libname.$libext"
     9483              if test no = "$build_old_libs"; then
     9484                oldlibs=$output_objdir/$libname.$libext
    79909485                build_libtool_libs=module
    79919486                build_old_libs=yes
     
    80339528        esac
    80349529      done
    8035       deplibs="$new_libs"
     9530      deplibs=$new_libs
    80369531
    80379532      # All the library-specific variables (install_libdir is set above).
     
    80419536
    80429537      # Test again, we may have decided not to build it any more
    8043       if test "$build_libtool_libs" = yes; then
    8044         # Remove ${wl} instances when linking with ld.
     9538      if test yes = "$build_libtool_libs"; then
     9539        # Remove $wl instances when linking with ld.
    80459540        # FIXME: should test the right _cmds variable.
    80469541        case $archive_cmds in
    80479542          *\$LD\ *) wl= ;;
    80489543        esac
    8049         if test "$hardcode_into_libs" = yes; then
     9544        if test yes = "$hardcode_into_libs"; then
    80509545          # Hardcode the library paths
    80519546          hardcode_libdirs=
    80529547          dep_rpath=
    8053           rpath="$finalize_rpath"
    8054           test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
     9548          rpath=$finalize_rpath
     9549          test relink = "$opt_mode" || rpath=$compile_rpath$rpath
    80559550          for libdir in $rpath; do
    80569551            if test -n "$hardcode_libdir_flag_spec"; then
     
    80599554                libdir=$func_replace_sysroot_result
    80609555                if test -z "$hardcode_libdirs"; then
    8061                   hardcode_libdirs="$libdir"
     9556                  hardcode_libdirs=$libdir
    80629557                else
    80639558                  # Just accumulate the unique libdirs.
     
    80849579          if test -n "$hardcode_libdir_separator" &&
    80859580             test -n "$hardcode_libdirs"; then
    8086             libdir="$hardcode_libdirs"
     9581            libdir=$hardcode_libdirs
    80879582            eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
    80889583          fi
     
    80989593        fi
    80999594
    8100         shlibpath="$finalize_shlibpath"
    8101         test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
     9595        shlibpath=$finalize_shlibpath
     9596        test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath
    81029597        if test -n "$shlibpath"; then
    81039598          eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
     
    81099604        set dummy $library_names
    81109605        shift
    8111         realname="$1"
     9606        realname=$1
    81129607        shift
    81139608
     
    81159610          eval soname=\"$soname_spec\"
    81169611        else
    8117           soname="$realname"
     9612          soname=$realname
    81189613        fi
    81199614        if test -z "$dlname"; then
     
    81219616        fi
    81229617
    8123         lib="$output_objdir/$realname"
     9618        lib=$output_objdir/$realname
    81249619        linknames=
    81259620        for link
     
    81359630        if test -n "$export_symbols" && test -n "$include_expsyms"; then
    81369631          $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
    8137           export_symbols="$output_objdir/$libname.uexp"
     9632          export_symbols=$output_objdir/$libname.uexp
    81389633          func_append delfiles " $export_symbols"
    81399634        fi
     
    81449639          if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
    81459640            # exporting using user supplied symfile
    8146             if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
     9641            func_dll_def_p "$export_symbols" || {
    81479642              # and it's NOT already a .def file. Must figure out
    81489643              # which of the given symbols are data symbols and tag
     
    81519646              # the list of exported symbols" if statement, so the
    81529647              # include_expsyms logic still works.
    8153               orig_export_symbols="$export_symbols"
     9648              orig_export_symbols=$export_symbols
    81549649              export_symbols=
    81559650              always_export_symbols=yes
    8156             fi
     9651            }
    81579652          fi
    81589653          ;;
     
    81619656        # Prepare the list of exported symbols
    81629657        if test -z "$export_symbols"; then
    8163           if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
    8164             func_verbose "generating symbol list for \`$libname.la'"
    8165             export_symbols="$output_objdir/$libname.exp"
     9658          if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then
     9659            func_verbose "generating symbol list for '$libname.la'"
     9660            export_symbols=$output_objdir/$libname.exp
    81669661            $opt_dry_run || $RM $export_symbols
    81679662            cmds=$export_symbols_cmds
    8168             save_ifs="$IFS"; IFS='~'
     9663            save_ifs=$IFS; IFS='~'
    81699664            for cmd1 in $cmds; do
    8170               IFS="$save_ifs"
     9665              IFS=$save_ifs
    81719666              # Take the normal branch if the nm_file_list_spec branch
    81729667              # doesn't work or if tool conversion is not needed.
     
    81829677                  ;;
    81839678              esac
    8184               if test "$try_normal_branch" = yes \
     9679              if test yes = "$try_normal_branch" \
    81859680                 && { test "$len" -lt "$max_cmd_len" \
    81869681                      || test "$max_cmd_len" -le -1; }
     
    81939688                save_libobjs=$libobjs
    81949689                save_output=$output
    8195                 output=${output_objdir}/${output_la}.nm
     9690                output=$output_objdir/$output_la.nm
    81969691                func_to_tool_file "$output"
    81979692                libobjs=$nm_file_list_spec$func_to_tool_file_result
     
    82169711              fi
    82179712            done
    8218             IFS="$save_ifs"
    8219             if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
     9713            IFS=$save_ifs
     9714            if test -n "$export_symbols_regex" && test : != "$skipped_export"; then
    82209715              func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
    82219716              func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
     
    82259720
    82269721        if test -n "$export_symbols" && test -n "$include_expsyms"; then
    8227           tmp_export_symbols="$export_symbols"
    8228           test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
     9722          tmp_export_symbols=$export_symbols
     9723          test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
    82299724          $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
    82309725        fi
    82319726
    8232         if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
     9727        if test : != "$skipped_export" && test -n "$orig_export_symbols"; then
    82339728          # The given exports_symbols file has to be filtered, so filter it.
    8234           func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
     9729          func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
    82359730          # FIXME: $output_objdir/$libname.filter potentially contains lots of
    8236           # 's' commands which not all seds can handle. GNU sed should be fine
     9731          # 's' commands, which not all seds can handle. GNU sed should be fine
    82379732          # though. Also, the filter scales superlinearly with the number of
    82389733          # global variables. join(1) would be nice here, but unfortunately
     
    82539748          esac
    82549749        done
    8255         deplibs="$tmp_deplibs"
     9750        deplibs=$tmp_deplibs
    82569751
    82579752        if test -n "$convenience"; then
    82589753          if test -n "$whole_archive_flag_spec" &&
    8259             test "$compiler_needs_object" = yes &&
     9754            test yes = "$compiler_needs_object" &&
    82609755            test -z "$libobjs"; then
    82619756            # extract the archives, so we have objects to list.
     
    82689763            test "X$libobjs" = "X " && libobjs=
    82699764          else
    8270             gentop="$output_objdir/${outputname}x"
     9765            gentop=$output_objdir/${outputname}x
    82719766            func_append generated " $gentop"
    82729767
     
    82779772        fi
    82789773
    8279         if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
     9774        if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
    82809775          eval flag=\"$thread_safe_flag_spec\"
    82819776          func_append linker_flags " $flag"
     
    82839778
    82849779        # Make a backup of the uninstalled library when relinking
    8285         if test "$opt_mode" = relink; then
     9780        if test relink = "$opt_mode"; then
    82869781          $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
    82879782        fi
    82889783
    82899784        # Do each of the archive commands.
    8290         if test "$module" = yes && test -n "$module_cmds" ; then
     9785        if test yes = "$module" && test -n "$module_cmds"; then
    82919786          if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
    82929787            eval test_cmds=\"$module_expsym_cmds\"
     
    83069801        fi
    83079802
    8308         if test "X$skipped_export" != "X:" &&
     9803        if test : != "$skipped_export" &&
    83099804           func_len " $test_cmds" &&
    83109805           len=$func_len_result &&
     
    83399834          k=1
    83409835
    8341           if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
    8342             output=${output_objdir}/${output_la}.lnkscript
     9836          if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
     9837            output=$output_objdir/$output_la.lnkscript
    83439838            func_verbose "creating GNU ld script: $output"
    83449839            echo 'INPUT (' > $output
     
    83529847            func_to_tool_file "$output"
    83539848            output=$func_to_tool_file_result
    8354           elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
    8355             output=${output_objdir}/${output_la}.lnk
     9849          elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
     9850            output=$output_objdir/$output_la.lnk
    83569851            func_verbose "creating linker input file list: $output"
    83579852            : > $output
     
    83599854            shift
    83609855            firstobj=
    8361             if test "$compiler_needs_object" = yes; then
     9856            if test yes = "$compiler_needs_object"; then
    83629857              firstobj="$1 "
    83639858              shift
     
    83749869            if test -n "$save_libobjs"; then
    83759870              func_verbose "creating reloadable object files..."
    8376               output=$output_objdir/$output_la-${k}.$objext
     9871              output=$output_objdir/$output_la-$k.$objext
    83779872              eval test_cmds=\"$reload_cmds\"
    83789873              func_len " $test_cmds"
     
    83869881                func_arith $len + $func_len_result
    83879882                len=$func_arith_result
    8388                 if test "X$objlist" = X ||
     9883                if test -z "$objlist" ||
    83899884                   test "$len" -lt "$max_cmd_len"; then
    83909885                  func_append objlist " $obj"
     
    83929887                  # The command $test_cmds is almost too long, add a
    83939888                  # command to the queue.
    8394                   if test "$k" -eq 1 ; then
     9889                  if test 1 -eq "$k"; then
    83959890                    # The first file doesn't have a previous command to add.
    83969891                    reload_objs=$objlist
     
    84029897                    eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
    84039898                  fi
    8404                   last_robj=$output_objdir/$output_la-${k}.$objext
     9899                  last_robj=$output_objdir/$output_la-$k.$objext
    84059900                  func_arith $k + 1
    84069901                  k=$func_arith_result
    8407                   output=$output_objdir/$output_la-${k}.$objext
     9902                  output=$output_objdir/$output_la-$k.$objext
    84089903                  objlist=" $obj"
    84099904                  func_len " $last_robj"
     
    84179912              test -z "$concat_cmds" || concat_cmds=$concat_cmds~
    84189913              reload_objs="$objlist $last_robj"
    8419               eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
     9914              eval concat_cmds=\"\$concat_cmds$reload_cmds\"
    84209915              if test -n "$last_robj"; then
    8421                 eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
     9916                eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
    84229917              fi
    84239918              func_append delfiles " $output"
     
    84279922            fi
    84289923
    8429             if ${skipped_export-false}; then
    8430               func_verbose "generating symbol list for \`$libname.la'"
    8431               export_symbols="$output_objdir/$libname.exp"
     9924            ${skipped_export-false} && {
     9925              func_verbose "generating symbol list for '$libname.la'"
     9926              export_symbols=$output_objdir/$libname.exp
    84329927              $opt_dry_run || $RM $export_symbols
    84339928              libobjs=$output
     
    84389933                eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
    84399934              fi
    8440             fi
     9935            }
    84419936
    84429937            test -n "$save_libobjs" &&
     
    84449939
    84459940            # Loop through the commands generated above and execute them.
    8446             save_ifs="$IFS"; IFS='~'
     9941            save_ifs=$IFS; IFS='~'
    84479942            for cmd in $concat_cmds; do
    8448               IFS="$save_ifs"
    8449               $opt_silent || {
     9943              IFS=$save_ifs
     9944              $opt_quiet || {
    84509945                  func_quote_for_expand "$cmd"
    84519946                  eval "func_echo $func_quote_for_expand_result"
     
    84559950
    84569951                # Restore the uninstalled library and exit
    8457                 if test "$opt_mode" = relink; then
     9952                if test relink = "$opt_mode"; then
    84589953                  ( cd "$output_objdir" && \
    84599954                    $RM "${realname}T" && \
     
    84649959              }
    84659960            done
    8466             IFS="$save_ifs"
     9961            IFS=$save_ifs
    84679962
    84689963            if test -n "$export_symbols_regex" && ${skipped_export-false}; then
     
    84729967          fi
    84739968
    8474           if ${skipped_export-false}; then
     9969          ${skipped_export-false} && {
    84759970            if test -n "$export_symbols" && test -n "$include_expsyms"; then
    8476               tmp_export_symbols="$export_symbols"
    8477               test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
     9971              tmp_export_symbols=$export_symbols
     9972              test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
    84789973              $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
    84799974            fi
     
    84819976            if test -n "$orig_export_symbols"; then
    84829977              # The given exports_symbols file has to be filtered, so filter it.
    8483               func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
     9978              func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
    84849979              # FIXME: $output_objdir/$libname.filter potentially contains lots of
    8485               # 's' commands which not all seds can handle. GNU sed should be fine
     9980              # 's' commands, which not all seds can handle. GNU sed should be fine
    84869981              # though. Also, the filter scales superlinearly with the number of
    84879982              # global variables. join(1) would be nice here, but unfortunately
     
    84929987              $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
    84939988            fi
    8494           fi
     9989          }
    84959990
    84969991          libobjs=$output
     
    850610001
    850710002          # Do each of the archive commands.
    8508           if test "$module" = yes && test -n "$module_cmds" ; then
     10003          if test yes = "$module" && test -n "$module_cmds"; then
    850910004            if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
    851010005              cmds=$module_expsym_cmds
     
    852810023        # Add any objects from preloaded convenience libraries
    852910024        if test -n "$dlprefiles"; then
    8530           gentop="$output_objdir/${outputname}x"
     10025          gentop=$output_objdir/${outputname}x
    853110026          func_append generated " $gentop"
    853210027
     
    853610031        fi
    853710032
    8538         save_ifs="$IFS"; IFS='~'
     10033        save_ifs=$IFS; IFS='~'
    853910034        for cmd in $cmds; do
    8540           IFS="$save_ifs"
     10035          IFS=$sp$nl
    854110036          eval cmd=\"$cmd\"
    8542           $opt_silent || {
     10037          IFS=$save_ifs
     10038          $opt_quiet || {
    854310039            func_quote_for_expand "$cmd"
    854410040            eval "func_echo $func_quote_for_expand_result"
     
    854810044
    854910045            # Restore the uninstalled library and exit
    8550             if test "$opt_mode" = relink; then
     10046            if test relink = "$opt_mode"; then
    855110047              ( cd "$output_objdir" && \
    855210048                $RM "${realname}T" && \
     
    855710053          }
    855810054        done
    8559         IFS="$save_ifs"
     10055        IFS=$save_ifs
    856010056
    856110057        # Restore the uninstalled library and exit
    8562         if test "$opt_mode" = relink; then
     10058        if test relink = "$opt_mode"; then
    856310059          $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
    856410060
     
    858010076
    858110077        # If -module or -export-dynamic was specified, set the dlname.
    8582         if test "$module" = yes || test "$export_dynamic" = yes; then
     10078        if test yes = "$module" || test yes = "$export_dynamic"; then
    858310079          # On all known operating systems, these are identical.
    8584           dlname="$soname"
     10080          dlname=$soname
    858510081        fi
    858610082      fi
     
    858810084
    858910085    obj)
    8590       if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
    8591         func_warning "\`-dlopen' is ignored for objects"
     10086      if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
     10087        func_warning "'-dlopen' is ignored for objects"
    859210088      fi
    859310089
    859410090      case " $deplibs" in
    859510091      *\ -l* | *\ -L*)
    8596         func_warning "\`-l' and \`-L' are ignored for objects" ;;
     10092        func_warning "'-l' and '-L' are ignored for objects" ;;
    859710093      esac
    859810094
    859910095      test -n "$rpath" && \
    8600         func_warning "\`-rpath' is ignored for objects"
     10096        func_warning "'-rpath' is ignored for objects"
    860110097
    860210098      test -n "$xrpath" && \
    8603         func_warning "\`-R' is ignored for objects"
     10099        func_warning "'-R' is ignored for objects"
    860410100
    860510101      test -n "$vinfo" && \
    8606         func_warning "\`-version-info' is ignored for objects"
     10102        func_warning "'-version-info' is ignored for objects"
    860710103
    860810104      test -n "$release" && \
    8609         func_warning "\`-release' is ignored for objects"
     10105        func_warning "'-release' is ignored for objects"
    861010106
    861110107      case $output in
    861210108      *.lo)
    861310109        test -n "$objs$old_deplibs" && \
    8614           func_fatal_error "cannot build library object \`$output' from non-libtool objects"
     10110          func_fatal_error "cannot build library object '$output' from non-libtool objects"
    861510111
    861610112        libobj=$output
     
    862010116      *)
    862110117        libobj=
    8622         obj="$output"
     10118        obj=$output
    862310119        ;;
    862410120      esac
     
    863310129      reload_conv_objs=
    863410130      gentop=
    8635       # reload_cmds runs $LD directly, so let us get rid of
    8636       # -Wl from whole_archive_flag_spec and hope we can get by with
    8637       # turning comma into space..
    8638       wl=
    8639 
     10131      # if reload_cmds runs $LD directly, get rid of -Wl from
     10132      # whole_archive_flag_spec and hope we can get by with turning comma
     10133      # into space.
     10134      case $reload_cmds in
     10135        *\$LD[\ \$]*) wl= ;;
     10136      esac
    864010137      if test -n "$convenience"; then
    864110138        if test -n "$whole_archive_flag_spec"; then
    864210139          eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
    8643           reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
     10140          test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
     10141          reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags
    864410142        else
    8645           gentop="$output_objdir/${obj}x"
     10143          gentop=$output_objdir/${obj}x
    864610144          func_append generated " $gentop"
    864710145
     
    865210150
    865310151      # If we're not building shared, we need to use non_pic_objs
    8654       test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
     10152      test yes = "$build_libtool_libs" || libobjs=$non_pic_objects
    865510153
    865610154      # Create the old-style object.
    8657       reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
    8658 
    8659       output="$obj"
     10155      reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs
     10156
     10157      output=$obj
    866010158      func_execute_cmds "$reload_cmds" 'exit $?'
    866110159
     
    866910167      fi
    867010168
    8671       if test "$build_libtool_libs" != yes; then
     10169      test yes = "$build_libtool_libs" || {
    867210170        if test -n "$gentop"; then
    867310171          func_show_eval '${RM}r "$gentop"'
     
    867910177        # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
    868010178        exit $EXIT_SUCCESS
    8681       fi
    8682 
    8683       if test -n "$pic_flag" || test "$pic_mode" != default; then
     10179      }
     10180
     10181      if test -n "$pic_flag" || test default != "$pic_mode"; then
    868410182        # Only do commands if we really have different PIC objects.
    868510183        reload_objs="$libobjs $reload_conv_objs"
    8686         output="$libobj"
     10184        output=$libobj
    868710185        func_execute_cmds "$reload_cmds" 'exit $?'
    868810186      fi
     
    870110199      esac
    870210200      test -n "$vinfo" && \
    8703         func_warning "\`-version-info' is ignored for programs"
     10201        func_warning "'-version-info' is ignored for programs"
    870410202
    870510203      test -n "$release" && \
    8706         func_warning "\`-release' is ignored for programs"
    8707 
    8708       test "$preload" = yes \
    8709         && test "$dlopen_support" = unknown \
    8710         && test "$dlopen_self" = unknown \
    8711         && test "$dlopen_self_static" = unknown && \
    8712           func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
     10204        func_warning "'-release' is ignored for programs"
     10205
     10206      $preload \
     10207        && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \
     10208        && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."
    871310209
    871410210      case $host in
     
    872410220        # Don't allow lazy linking, it breaks C++ global constructors
    872510221        # But is supposedly fixed on 10.4 or later (yay!).
    8726         if test "$tagname" = CXX ; then
     10222        if test CXX = "$tagname"; then
    872710223          case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
    872810224            10.[0123])
    8729               func_append compile_command " ${wl}-bind_at_load"
    8730               func_append finalize_command " ${wl}-bind_at_load"
     10225              func_append compile_command " $wl-bind_at_load"
     10226              func_append finalize_command " $wl-bind_at_load"
    873110227            ;;
    873210228          esac
     
    876410260        esac
    876510261      done
    8766       compile_deplibs="$new_libs"
     10262      compile_deplibs=$new_libs
    876710263
    876810264
     
    878810284          if test -n "$hardcode_libdir_separator"; then
    878910285            if test -z "$hardcode_libdirs"; then
    8790               hardcode_libdirs="$libdir"
     10286              hardcode_libdirs=$libdir
    879110287            else
    879210288              # Just accumulate the unique libdirs.
     
    881110307        case $host in
    881210308        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
    8813           testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
     10309          testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
    881410310          case :$dllsearchpath: in
    881510311          *":$libdir:"*) ;;
     
    882810324      if test -n "$hardcode_libdir_separator" &&
    882910325         test -n "$hardcode_libdirs"; then
    8830         libdir="$hardcode_libdirs"
     10326        libdir=$hardcode_libdirs
    883110327        eval rpath=\" $hardcode_libdir_flag_spec\"
    883210328      fi
    8833       compile_rpath="$rpath"
     10329      compile_rpath=$rpath
    883410330
    883510331      rpath=
     
    883910335          if test -n "$hardcode_libdir_separator"; then
    884010336            if test -z "$hardcode_libdirs"; then
    8841               hardcode_libdirs="$libdir"
     10337              hardcode_libdirs=$libdir
    884210338            else
    884310339              # Just accumulate the unique libdirs.
     
    886410360      if test -n "$hardcode_libdir_separator" &&
    886510361         test -n "$hardcode_libdirs"; then
    8866         libdir="$hardcode_libdirs"
     10362        libdir=$hardcode_libdirs
    886710363        eval rpath=\" $hardcode_libdir_flag_spec\"
    886810364      fi
    8869       finalize_rpath="$rpath"
    8870 
    8871       if test -n "$libobjs" && test "$build_old_libs" = yes; then
     10365      finalize_rpath=$rpath
     10366
     10367      if test -n "$libobjs" && test yes = "$build_old_libs"; then
    887210368        # Transform all the library objects into standard objects.
    887310369        compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
     
    887510371      fi
    887610372
    8877       func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
     10373      func_generate_dlsyms "$outputname" "@PROGRAM@" false
    887810374
    887910375      # template prelinking step
     
    888210378      fi
    888310379
    8884       wrappers_required=yes
     10380      wrappers_required=:
    888510381      case $host in
    888610382      *cegcc* | *mingw32ce*)
    888710383        # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
    8888         wrappers_required=no
     10384        wrappers_required=false
    888910385        ;;
    889010386      *cygwin* | *mingw* )
    8891         if test "$build_libtool_libs" != yes; then
    8892           wrappers_required=no
    8893         fi
     10387        test yes = "$build_libtool_libs" || wrappers_required=false
    889410388        ;;
    889510389      *)
    8896         if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
    8897           wrappers_required=no
     10390        if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
     10391          wrappers_required=false
    889810392        fi
    889910393        ;;
    890010394      esac
    8901       if test "$wrappers_required" = no; then
     10395      $wrappers_required || {
    890210396        # Replace the output file specification.
    890310397        compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
    8904         link_command="$compile_command$compile_rpath"
     10398        link_command=$compile_command$compile_rpath
    890510399
    890610400        # We have no uninstalled library dependencies, so finalize right now.
     
    891510409
    891610410        # Delete the generated files.
    8917         if test -f "$output_objdir/${outputname}S.${objext}"; then
    8918           func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
     10411        if test -f "$output_objdir/${outputname}S.$objext"; then
     10412          func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'
    891910413        fi
    892010414
    892110415        exit $exit_status
    8922       fi
     10416      }
    892310417
    892410418      if test -n "$compile_shlibpath$finalize_shlibpath"; then
     
    895010444      fi
    895110445
    8952       if test "$no_install" = yes; then
     10446      if test yes = "$no_install"; then
    895310447        # We don't need to create a wrapper script.
    8954         link_command="$compile_var$compile_command$compile_rpath"
     10448        link_command=$compile_var$compile_command$compile_rpath
    895510449        # Replace the output file specification.
    895610450        link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
     
    896910463      fi
    897010464
    8971       if test "$hardcode_action" = relink; then
    8972         # Fast installation is not supported
    8973         link_command="$compile_var$compile_command$compile_rpath"
    8974         relink_command="$finalize_var$finalize_command$finalize_rpath"
    8975 
    8976         func_warning "this platform does not like uninstalled shared libraries"
    8977         func_warning "\`$output' will be relinked during installation"
    8978       else
    8979         if test "$fast_install" != no; then
    8980           link_command="$finalize_var$compile_command$finalize_rpath"
    8981           if test "$fast_install" = yes; then
    8982             relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
    8983           else
    8984             # fast_install is set to needless
    8985             relink_command=
    8986           fi
    8987         else
    8988           link_command="$compile_var$compile_command$compile_rpath"
    8989           relink_command="$finalize_var$finalize_command$finalize_rpath"
    8990         fi
    8991       fi
     10465      case $hardcode_action,$fast_install in
     10466        relink,*)
     10467          # Fast installation is not supported
     10468          link_command=$compile_var$compile_command$compile_rpath
     10469          relink_command=$finalize_var$finalize_command$finalize_rpath
     10470
     10471          func_warning "this platform does not like uninstalled shared libraries"
     10472          func_warning "'$output' will be relinked during installation"
     10473          ;;
     10474        *,yes)
     10475          link_command=$finalize_var$compile_command$finalize_rpath
     10476          relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
     10477          ;;
     10478        *,no)
     10479          link_command=$compile_var$compile_command$compile_rpath
     10480          relink_command=$finalize_var$finalize_command$finalize_rpath
     10481          ;;
     10482        *,needless)
     10483          link_command=$finalize_var$compile_command$finalize_rpath
     10484          relink_command=
     10485          ;;
     10486      esac
    899210487
    899310488      # Replace the output file specification.
     
    904610541            output_name=$func_basename_result
    904710542            output_path=$func_dirname_result
    9048             cwrappersource="$output_path/$objdir/lt-$output_name.c"
    9049             cwrapper="$output_path/$output_name.exe"
     10543            cwrappersource=$output_path/$objdir/lt-$output_name.c
     10544            cwrapper=$output_path/$output_name.exe
    905010545            $RM $cwrappersource $cwrapper
    905110546            trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
     
    906810563            $opt_dry_run || {
    906910564              # note: this script will not be executed, so do not chmod.
    9070               if test "x$build" = "x$host" ; then
     10565              if test "x$build" = "x$host"; then
    907110566                $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
    907210567              else
     
    909110586    for oldlib in $oldlibs; do
    909210587
    9093       if test "$build_libtool_libs" = convenience; then
    9094         oldobjs="$libobjs_save $symfileobj"
    9095         addlibs="$convenience"
    9096         build_libtool_libs=no
    9097       else
    9098         if test "$build_libtool_libs" = module; then
    9099           oldobjs="$libobjs_save"
     10588      case $build_libtool_libs in
     10589        convenience)
     10590          oldobjs="$libobjs_save $symfileobj"
     10591          addlibs=$convenience
    910010592          build_libtool_libs=no
    9101         else
     10593          ;;
     10594        module)
     10595          oldobjs=$libobjs_save
     10596          addlibs=$old_convenience
     10597          build_libtool_libs=no
     10598          ;;
     10599        *)
    910210600          oldobjs="$old_deplibs $non_pic_objects"
    9103           if test "$preload" = yes && test -f "$symfileobj"; then
    9104             func_append oldobjs " $symfileobj"
    9105           fi
    9106         fi
    9107         addlibs="$old_convenience"
    9108       fi
     10601          $preload && test -f "$symfileobj" \
     10602            && func_append oldobjs " $symfileobj"
     10603          addlibs=$old_convenience
     10604          ;;
     10605      esac
    910910606
    911010607      if test -n "$addlibs"; then
    9111         gentop="$output_objdir/${outputname}x"
     10608        gentop=$output_objdir/${outputname}x
    911210609        func_append generated " $gentop"
    911310610
     
    911710614
    911810615      # Do each command in the archive commands.
    9119       if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
     10616      if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then
    912010617        cmds=$old_archive_from_new_cmds
    912110618      else
     
    912310620        # Add any objects from preloaded convenience libraries
    912410621        if test -n "$dlprefiles"; then
    9125           gentop="$output_objdir/${outputname}x"
     10622          gentop=$output_objdir/${outputname}x
    912610623          func_append generated " $gentop"
    912710624
     
    914410641        else
    914510642          echo "copying selected object files to avoid basename conflicts..."
    9146           gentop="$output_objdir/${outputname}x"
     10643          gentop=$output_objdir/${outputname}x
    914710644          func_append generated " $gentop"
    914810645          func_mkdir_p "$gentop"
     
    915310650          do
    915410651            func_basename "$obj"
    9155             objbase="$func_basename_result"
     10652            objbase=$func_basename_result
    915610653            case " $oldobjs " in
    915710654            " ") oldobjs=$obj ;;
     
    922210719              # the above command should be used before it gets too long
    922310720              oldobjs=$objlist
    9224               if test "$obj" = "$last_oldobj" ; then
     10721              if test "$obj" = "$last_oldobj"; then
    922510722                RANLIB=$save_RANLIB
    922610723              fi
    922710724              test -z "$concat_cmds" || concat_cmds=$concat_cmds~
    9228               eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
     10725              eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
    922910726              objlist=
    923010727              len=$len0
     
    923310730          RANLIB=$save_RANLIB
    923410731          oldobjs=$objlist
    9235           if test "X$oldobjs" = "X" ; then
     10732          if test -z "$oldobjs"; then
    923610733            eval cmds=\"\$concat_cmds\"
    923710734          else
     
    925010747    *.la)
    925110748      old_library=
    9252       test "$build_old_libs" = yes && old_library="$libname.$libext"
     10749      test yes = "$build_old_libs" && old_library=$libname.$libext
    925310750      func_verbose "creating $output"
    925410751
     
    926510762      done
    926610763      # Quote the link command for shipping.
    9267       relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
     10764      relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
    926810765      relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
    9269       if test "$hardcode_automatic" = yes ; then
     10766      if test yes = "$hardcode_automatic"; then
    927010767        relink_command=
    927110768      fi
     
    927410771      $opt_dry_run || {
    927510772        for installed in no yes; do
    9276           if test "$installed" = yes; then
     10773          if test yes = "$installed"; then
    927710774            if test -z "$install_libdir"; then
    927810775              break
    927910776            fi
    9280             output="$output_objdir/$outputname"i
     10777            output=$output_objdir/${outputname}i
    928110778            # Replace all uninstalled libtool libraries with the installed ones
    928210779            newdependency_libs=
     
    928510782              *.la)
    928610783                func_basename "$deplib"
    9287                 name="$func_basename_result"
     10784                name=$func_basename_result
    928810785                func_resolve_sysroot "$deplib"
    9289                 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
     10786                eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
    929010787                test -z "$libdir" && \
    9291                   func_fatal_error "\`$deplib' is not a valid libtool archive"
     10788                  func_fatal_error "'$deplib' is not a valid libtool archive"
    929210789                func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
    929310790                ;;
     
    930510802              esac
    930610803            done
    9307             dependency_libs="$newdependency_libs"
     10804            dependency_libs=$newdependency_libs
    930810805            newdlfiles=
    930910806
     
    931210809              *.la)
    931310810                func_basename "$lib"
    9314                 name="$func_basename_result"
    9315                 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
     10811                name=$func_basename_result
     10812                eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
    931610813                test -z "$libdir" && \
    9317                   func_fatal_error "\`$lib' is not a valid libtool archive"
     10814                  func_fatal_error "'$lib' is not a valid libtool archive"
    931810815                func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
    931910816                ;;
     
    932110818              esac
    932210819            done
    9323             dlfiles="$newdlfiles"
     10820            dlfiles=$newdlfiles
    932410821            newdlprefiles=
    932510822            for lib in $dlprefiles; do
     
    933110828                # the library:
    933210829                func_basename "$lib"
    9333                 name="$func_basename_result"
    9334                 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
     10830                name=$func_basename_result
     10831                eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
    933510832                test -z "$libdir" && \
    9336                   func_fatal_error "\`$lib' is not a valid libtool archive"
     10833                  func_fatal_error "'$lib' is not a valid libtool archive"
    933710834                func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
    933810835                ;;
    933910836              esac
    934010837            done
    9341             dlprefiles="$newdlprefiles"
     10838            dlprefiles=$newdlprefiles
    934210839          else
    934310840            newdlfiles=
    934410841            for lib in $dlfiles; do
    934510842              case $lib in
    9346                 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
     10843                [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
    934710844                *) abs=`pwd`"/$lib" ;;
    934810845              esac
    934910846              func_append newdlfiles " $abs"
    935010847            done
    9351             dlfiles="$newdlfiles"
     10848            dlfiles=$newdlfiles
    935210849            newdlprefiles=
    935310850            for lib in $dlprefiles; do
    935410851              case $lib in
    9355                 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
     10852                [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
    935610853                *) abs=`pwd`"/$lib" ;;
    935710854              esac
    935810855              func_append newdlprefiles " $abs"
    935910856            done
    9360             dlprefiles="$newdlprefiles"
     10857            dlprefiles=$newdlprefiles
    936110858          fi
    936210859          $RM $output
     
    937410871            *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
    937510872              # If a -bindir argument was supplied, place the dll there.
    9376               if test "x$bindir" != x ;
    9377               then
     10873              if test -n "$bindir"; then
    937810874                func_relative_path "$install_libdir" "$bindir"
    9379                 tdlname=$func_relative_path_result$dlname
     10875                tdlname=$func_relative_path_result/$dlname
    938010876              else
    938110877                # Otherwise fall back on heuristic.
     
    938610882          $ECHO > $output "\
    938710883# $outputname - a libtool library file
    9388 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
     10884# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
    938910885#
    939010886# Please DO NOT delete this file!
     
    940010896old_library='$old_library'
    940110897
    9402 # Linker flags that can not go in dependency_libs.
     10898# Linker flags that cannot go in dependency_libs.
    940310899inherited_linker_flags='$new_inherited_linker_flags'
    940410900
     
    942610922# Directory that this library needs to be installed in:
    942710923libdir='$install_libdir'"
    9428           if test "$installed" = no && test "$need_relink" = yes; then
     10924          if test no,yes = "$installed,$need_relink"; then
    942910925            $ECHO >> $output "\
    943010926relink_command=\"$relink_command\""
     
    944110937}
    944210938
    9443 { test "$opt_mode" = link || test "$opt_mode" = relink; } &&
    9444     func_mode_link ${1+"$@"}
     10939if test link = "$opt_mode" || test relink = "$opt_mode"; then
     10940  func_mode_link ${1+"$@"}
     10941fi
    944510942
    944610943
     
    944810945func_mode_uninstall ()
    944910946{
    9450     $opt_debug
    9451     RM="$nonopt"
     10947    $debug_cmd
     10948
     10949    RM=$nonopt
    945210950    files=
    9453     rmforce=
     10951    rmforce=false
    945410952    exit_status=0
    945510953
    945610954    # This variable tells wrapper scripts just to set variables rather
    945710955    # than running their programs.
    9458     libtool_install_magic="$magic"
     10956    libtool_install_magic=$magic
    945910957
    946010958    for arg
    946110959    do
    946210960      case $arg in
    9463       -f) func_append RM " $arg"; rmforce=yes ;;
     10961      -f) func_append RM " $arg"; rmforce=: ;;
    946410962      -*) func_append RM " $arg" ;;
    946510963      *) func_append files " $arg" ;;
     
    947410972    for file in $files; do
    947510973      func_dirname "$file" "" "."
    9476       dir="$func_dirname_result"
    9477       if test "X$dir" = X.; then
    9478         odir="$objdir"
     10974      dir=$func_dirname_result
     10975      if test . = "$dir"; then
     10976        odir=$objdir
    947910977      else
    9480         odir="$dir/$objdir"
     10978        odir=$dir/$objdir
    948110979      fi
    948210980      func_basename "$file"
    9483       name="$func_basename_result"
    9484       test "$opt_mode" = uninstall && odir="$dir"
     10981      name=$func_basename_result
     10982      test uninstall = "$opt_mode" && odir=$dir
    948510983
    948610984      # Remember odir for removal later, being careful to avoid duplicates
    9487       if test "$opt_mode" = clean; then
     10985      if test clean = "$opt_mode"; then
    948810986        case " $rmdirs " in
    948910987          *" $odir "*) ;;
     
    950010998        exit_status=1
    950110999        continue
    9502       elif test "$rmforce" = yes; then
     11000      elif $rmforce; then
    950311001        continue
    950411002      fi
    950511003
    9506       rmfiles="$file"
     11004      rmfiles=$file
    950711005
    950811006      case $name in
     
    951811016          test -n "$old_library" && func_append rmfiles " $odir/$old_library"
    951911017
    9520           case "$opt_mode" in
     11018          case $opt_mode in
    952111019          clean)
    952211020            case " $library_names " in
     
    952911027            if test -n "$library_names"; then
    953011028              # Do each command in the postuninstall commands.
    9531               func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
     11029              func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'
    953211030            fi
    953311031
    953411032            if test -n "$old_library"; then
    953511033              # Do each command in the old_postuninstall commands.
    9536               func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
     11034              func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'
    953711035            fi
    953811036            # FIXME: should reinstall the best remaining shared library.
     
    955011048
    955111049          # Add PIC object to the list of files to remove.
    9552           if test -n "$pic_object" &&
    9553              test "$pic_object" != none; then
     11050          if test -n "$pic_object" && test none != "$pic_object"; then
    955411051            func_append rmfiles " $dir/$pic_object"
    955511052          fi
    955611053
    955711054          # Add non-PIC object to the list of files to remove.
    9558           if test -n "$non_pic_object" &&
    9559              test "$non_pic_object" != none; then
     11055          if test -n "$non_pic_object" && test none != "$non_pic_object"; then
    956011056            func_append rmfiles " $dir/$non_pic_object"
    956111057          fi
     
    956411060
    956511061      *)
    9566         if test "$opt_mode" = clean ; then
     11062        if test clean = "$opt_mode"; then
    956711063          noexename=$name
    956811064          case $file in
     
    959111087            # note $name still contains .exe if it was in $file originally
    959211088            # as does the version of $file that was added into $rmfiles
    9593             func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
    9594             if test "$fast_install" = yes && test -n "$relink_command"; then
     11089            func_append rmfiles " $odir/$name $odir/${name}S.$objext"
     11090            if test yes = "$fast_install" && test -n "$relink_command"; then
    959511091              func_append rmfiles " $odir/lt-$name"
    959611092            fi
    9597             if test "X$noexename" != "X$name" ; then
    9598               func_append rmfiles " $odir/lt-${noexename}.c"
     11093            if test "X$noexename" != "X$name"; then
     11094              func_append rmfiles " $odir/lt-$noexename.c"
    959911095            fi
    960011096          fi
     
    960511101    done
    960611102
    9607     # Try to remove the ${objdir}s in the directories where we deleted files
     11103    # Try to remove the $objdir's in the directories where we deleted files
    960811104    for dir in $rmdirs; do
    960911105      if test -d "$dir"; then
     
    961511111}
    961611112
    9617 { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
    9618     func_mode_uninstall ${1+"$@"}
     11113if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
     11114  func_mode_uninstall ${1+"$@"}
     11115fi
    961911116
    962011117test -z "$opt_mode" && {
    9621   help="$generic_help"
     11118  help=$generic_help
    962211119  func_fatal_help "you must specify a MODE"
    962311120}
    962411121
    962511122test -z "$exec_cmd" && \
    9626   func_fatal_help "invalid operation mode \`$opt_mode'"
     11123  func_fatal_help "invalid operation mode '$opt_mode'"
    962711124
    962811125if test -n "$exec_cmd"; then
     
    963511132
    963611133# The TAGs below are defined such that we never get into a situation
    9637 # in which we disable both kinds of libraries.  Given conflicting
     11134# where we disable both kinds of libraries.  Given conflicting
    963811135# choices, we go for a static library, that is the most portable,
    963911136# since we can't tell whether shared libraries were disabled because
     
    965811155# sh-indentation:2
    965911156# End:
    9660 # vi:sw=2
    9661 
Note: See TracChangeset for help on using the changeset viewer.