GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
#! /bin/sh1## DO NOT EDIT - This file generated from ./build-aux/ltmain.in2## by inline-source v2016-02-21.1134# libtool (GNU libtool) 2.4.6.40-6ca55# Provide generalized library-building support services.6# Written by Gordon Matzigkeit <[email protected]>, 199678# Copyright (C) 1996-2017 Free Software Foundation, Inc.9# This is free software; see the source for copying conditions. There is NO10# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.1112# GNU Libtool is free software; you can redistribute it and/or modify13# it under the terms of the GNU General Public License as published by14# the Free Software Foundation; either version 2 of the License, or15# (at your option) any later version.16#17# As a special exception to the GNU General Public License,18# if you distribute this file as part of a program or library that19# is built using GNU Libtool, you may include this file under the20# same distribution terms that you use for the rest of that program.21#22# GNU Libtool is distributed in the hope that it will be useful, but23# WITHOUT ANY WARRANTY; without even the implied warranty of24# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU25# General Public License for more details.26#27# You should have received a copy of the GNU General Public License28# along with this program. If not, see <http://www.gnu.org/licenses/>.293031PROGRAM=libtool32PACKAGE=libtool33VERSION=2.4.6.40-6ca534package_revision=2.4.6.40353637## ------ ##38## Usage. ##39## ------ ##4041# Run './libtool --help' for help with using this script from the42# command line.434445## ------------------------------- ##46## User overridable command paths. ##47## ------------------------------- ##4849# After configure completes, it has a better idea of some of the50# shell tools we need than the defaults used by the functions shared51# with bootstrap, so set those here where they can still be over-52# ridden by the user, but otherwise take precedence.5354: ${AUTOCONF="autoconf"}55: ${AUTOMAKE="automake"}565758## -------------------------- ##59## Source external libraries. ##60## -------------------------- ##6162# Much of our low-level functionality needs to be sourced from external63# libraries, which are installed to $pkgauxdir.6465# Set a version string for this script.66scriptversion=2017-04-19.12; # UTC6768# General shell script boiler plate, and helper functions.69# Written by Gary V. Vaughan, 20047071# This is free software. There is NO warranty; not even for72# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.73#74# Copyright (C) 2004-2017 Bootstrap Authors75#76# This file is dual licensed under the terms of the MIT license77# <https://opensource.org/license/MIT>, and GPL version 3 or later78# <http://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of79# these licenses when using or redistributing this software or any of80# the files within it. See the URLs above, or the file `LICENSE`81# included in the Bootstrap distribution for the full license texts.8283# Please report bugs or propose patches to:84# <https://github.com/gnulib-modules/bootstrap/issues>858687## ------ ##88## Usage. ##89## ------ ##9091# Evaluate this file near the top of your script to gain access to92# the functions and variables defined here:93#94# . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh95#96# If you need to override any of the default environment variable97# settings, do that before evaluating this file.9899100## -------------------- ##101## Shell normalisation. ##102## -------------------- ##103104# Some shells need a little help to be as Bourne compatible as possible.105# Before doing anything else, make sure all that help has been provided!106107DUALCASE=1; export DUALCASE # for MKS sh108if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :109emulate sh110NULLCMD=:111# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which112# is contrary to our usage. Disable this feature.113alias -g '${1+"$@"}'='"$@"'114setopt NO_GLOB_SUBST115else116case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac117fi118119# NLS nuisances: We save the old values in case they are required later.120_G_user_locale=121_G_safe_locale=122for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES123do124eval "if test set = \"\${$_G_var+set}\"; then125save_$_G_var=\$$_G_var126$_G_var=C127export $_G_var128_G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"129_G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"130fi"131done132133# Make sure IFS has a sensible default134sp=' '135nl='136'137IFS="$sp $nl"138139# There are apparently some retarded systems that use ';' as a PATH separator!140if test "${PATH_SEPARATOR+set}" != set; then141PATH_SEPARATOR=:142(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {143(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||144PATH_SEPARATOR=';'145}146fi147148149# func_unset VAR150# --------------151# Portably unset VAR.152# In some shells, an 'unset VAR' statement leaves a non-zero return153# status if VAR is already unset, which might be problematic if the154# statement is used at the end of a function (thus poisoning its return155# value) or when 'set -e' is active (causing even a spurious abort of156# the script in this case).157func_unset ()158{159{ eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; }160}161162163# Make sure CDPATH doesn't cause `cd` commands to output the target dir.164func_unset CDPATH165166# Make sure ${,E,F}GREP behave sanely.167func_unset GREP_OPTIONS168169170## ------------------------- ##171## Locate command utilities. ##172## ------------------------- ##173174175# func_executable_p FILE176# ----------------------177# Check that FILE is an executable regular file.178func_executable_p ()179{180test -f "$1" && test -x "$1"181}182183184# func_path_progs PROGS_LIST CHECK_FUNC [PATH]185# --------------------------------------------186# Search for either a program that responds to --version with output187# containing "GNU", or else returned by CHECK_FUNC otherwise, by188# trying all the directories in PATH with each of the elements of189# PROGS_LIST.190#191# CHECK_FUNC should accept the path to a candidate program, and192# set $func_check_prog_result if it truncates its output less than193# $_G_path_prog_max characters.194func_path_progs ()195{196_G_progs_list=$1197_G_check_func=$2198_G_PATH=${3-"$PATH"}199200_G_path_prog_max=0201_G_path_prog_found=false202_G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}203for _G_dir in $_G_PATH; do204IFS=$_G_save_IFS205test -z "$_G_dir" && _G_dir=.206for _G_prog_name in $_G_progs_list; do207for _exeext in '' .EXE; do208_G_path_prog=$_G_dir/$_G_prog_name$_exeext209func_executable_p "$_G_path_prog" || continue210case `"$_G_path_prog" --version 2>&1` in211*GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;212*) $_G_check_func $_G_path_prog213func_path_progs_result=$func_check_prog_result214;;215esac216$_G_path_prog_found && break 3217done218done219done220IFS=$_G_save_IFS221test -z "$func_path_progs_result" && {222echo "no acceptable sed could be found in \$PATH" >&2223exit 1224}225}226227228# We want to be able to use the functions in this file before configure229# has figured out where the best binaries are kept, which means we have230# to search for them ourselves - except when the results are already set231# where we skip the searches.232233# Unless the user overrides by setting SED, search the path for either GNU234# sed, or the sed that truncates its output the least.235test -z "$SED" && {236_G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/237for _G_i in 1 2 3 4 5 6 7; do238_G_sed_script=$_G_sed_script$nl$_G_sed_script239done240echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed241_G_sed_script=242243func_check_prog_sed ()244{245_G_path_prog=$1246247_G_count=0248printf 0123456789 >conftest.in249while :250do251cat conftest.in conftest.in >conftest.tmp252mv conftest.tmp conftest.in253cp conftest.in conftest.nl254echo '' >> conftest.nl255"$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break256diff conftest.out conftest.nl >/dev/null 2>&1 || break257_G_count=`expr $_G_count + 1`258if test "$_G_count" -gt "$_G_path_prog_max"; then259# Best one so far, save it but keep looking for a better one260func_check_prog_result=$_G_path_prog261_G_path_prog_max=$_G_count262fi263# 10*(2^10) chars as input seems more than enough264test 10 -lt "$_G_count" && break265done266rm -f conftest.in conftest.tmp conftest.nl conftest.out267}268269func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin"270rm -f conftest.sed271SED=$func_path_progs_result272}273274275# Unless the user overrides by setting GREP, search the path for either GNU276# grep, or the grep that truncates its output the least.277test -z "$GREP" && {278func_check_prog_grep ()279{280_G_path_prog=$1281282_G_count=0283_G_path_prog_max=0284printf 0123456789 >conftest.in285while :286do287cat conftest.in conftest.in >conftest.tmp288mv conftest.tmp conftest.in289cp conftest.in conftest.nl290echo 'GREP' >> conftest.nl291"$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break292diff conftest.out conftest.nl >/dev/null 2>&1 || break293_G_count=`expr $_G_count + 1`294if test "$_G_count" -gt "$_G_path_prog_max"; then295# Best one so far, save it but keep looking for a better one296func_check_prog_result=$_G_path_prog297_G_path_prog_max=$_G_count298fi299# 10*(2^10) chars as input seems more than enough300test 10 -lt "$_G_count" && break301done302rm -f conftest.in conftest.tmp conftest.nl conftest.out303}304305func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin"306GREP=$func_path_progs_result307}308309310## ------------------------------- ##311## User overridable command paths. ##312## ------------------------------- ##313314# All uppercase variable names are used for environment variables. These315# variables can be overridden by the user before calling a script that316# uses them if a suitable command of that name is not already available317# in the command search PATH.318319: ${CP="cp -f"}320: ${ECHO="printf %s\n"}321: ${EGREP="$GREP -E"}322: ${FGREP="$GREP -F"}323: ${LN_S="ln -s"}324: ${MAKE="make"}325: ${MKDIR="mkdir"}326: ${MV="mv -f"}327: ${RM="rm -f"}328: ${SHELL="${CONFIG_SHELL-/bin/sh}"}329330331## -------------------- ##332## Useful sed snippets. ##333## -------------------- ##334335sed_dirname='s|/[^/]*$||'336sed_basename='s|^.*/||'337338# Sed substitution that helps us do robust quoting. It backslashifies339# metacharacters that are still active within double-quoted strings.340sed_quote_subst='s|\([`"$\\]\)|\\\1|g'341342# Same as above, but do not quote variable references.343sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'344345# Sed substitution that turns a string into a regex matching for the346# string literally.347sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'348349# Sed substitution that converts a w32 file name or path350# that contains forward slashes, into one that contains351# (escaped) backslashes. A very naive implementation.352sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'353354# Re-'\' parameter expansions in output of sed_double_quote_subst that355# were '\'-ed in input to the same. If an odd number of '\' preceded a356# '$' in input to sed_double_quote_subst, that '$' was protected from357# expansion. Since each input '\' is now two '\'s, look for any number358# of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'.359_G_bs='\\'360_G_bs2='\\\\'361_G_bs4='\\\\\\\\'362_G_dollar='\$'363sed_double_backslash="\364s/$_G_bs4/&\\365/g366s/^$_G_bs2$_G_dollar/$_G_bs&/367s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g368s/\n//g"369370371## ----------------- ##372## Global variables. ##373## ----------------- ##374375# Except for the global variables explicitly listed below, the following376# functions in the '^func_' namespace, and the '^require_' namespace377# variables initialised in the 'Resource management' section, sourcing378# this file will not pollute your global namespace with anything379# else. There's no portable way to scope variables in Bourne shell380# though, so actually running these functions will sometimes place381# results into a variable named after the function, and often use382# temporary variables in the '^_G_' namespace. If you are careful to383# avoid using those namespaces casually in your sourcing script, things384# should continue to work as you expect. And, of course, you can freely385# overwrite any of the functions or variables defined here before386# calling anything to customize them.387388EXIT_SUCCESS=0389EXIT_FAILURE=1390EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.391EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.392393# Allow overriding, eg assuming that you follow the convention of394# putting '$debug_cmd' at the start of all your functions, you can get395# bash to show function call trace with:396#397# debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name398debug_cmd=${debug_cmd-":"}399exit_cmd=:400401# By convention, finish your script with:402#403# exit $exit_status404#405# so that you can set exit_status to non-zero if you want to indicate406# something went wrong during execution without actually bailing out at407# the point of failure.408exit_status=$EXIT_SUCCESS409410# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh411# is ksh but when the shell is invoked as "sh" and the current value of412# the _XPG environment variable is not equal to 1 (one), the special413# positional parameter $0, within a function call, is the name of the414# function.415progpath=$0416417# The name of this program.418progname=`$ECHO "$progpath" |$SED "$sed_basename"`419420# Make sure we have an absolute progpath for reexecution:421case $progpath in422[\\/]*|[A-Za-z]:\\*) ;;423*[\\/]*)424progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`425progdir=`cd "$progdir" && pwd`426progpath=$progdir/$progname427;;428*)429_G_IFS=$IFS430IFS=${PATH_SEPARATOR-:}431for progdir in $PATH; do432IFS=$_G_IFS433test -x "$progdir/$progname" && break434done435IFS=$_G_IFS436test -n "$progdir" || progdir=`pwd`437progpath=$progdir/$progname438;;439esac440441442## ----------------- ##443## Standard options. ##444## ----------------- ##445446# The following options affect the operation of the functions defined447# below, and should be set appropriately depending on run-time para-448# meters passed on the command line.449450opt_dry_run=false451opt_quiet=false452opt_verbose=false453454# Categories 'all' and 'none' are always available. Append any others455# you will pass as the first argument to func_warning from your own456# code.457warning_categories=458459# By default, display warnings according to 'opt_warning_types'. Set460# 'warning_func' to ':' to elide all warnings, or func_fatal_error to461# treat the next displayed warning as a fatal error.462warning_func=func_warn_and_continue463464# Set to 'all' to display all warnings, 'none' to suppress all465# warnings, or a space delimited list of some subset of466# 'warning_categories' to display only the listed warnings.467opt_warning_types=all468469470## -------------------- ##471## Resource management. ##472## -------------------- ##473474# This section contains definitions for functions that each ensure a475# particular resource (a file, or a non-empty configuration variable for476# example) is available, and if appropriate to extract default values477# from pertinent package files. Call them using their associated478# 'require_*' variable to ensure that they are executed, at most, once.479#480# It's entirely deliberate that calling these functions can set481# variables that don't obey the namespace limitations obeyed by the rest482# of this file, in order that that they be as useful as possible to483# callers.484485486# require_term_colors487# -------------------488# Allow display of bold text on terminals that support it.489require_term_colors=func_require_term_colors490func_require_term_colors ()491{492$debug_cmd493494test -t 1 && {495# COLORTERM and USE_ANSI_COLORS environment variables take496# precedence, because most terminfo databases neglect to describe497# whether color sequences are supported.498test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}499500if test 1 = "$USE_ANSI_COLORS"; then501# Standard ANSI escape sequences502tc_reset='[0m'503tc_bold='[1m'; tc_standout='[7m'504tc_red='[31m'; tc_green='[32m'505tc_blue='[34m'; tc_cyan='[36m'506else507# Otherwise trust the terminfo database after all.508test -n "`tput sgr0 2>/dev/null`" && {509tc_reset=`tput sgr0`510test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`511tc_standout=$tc_bold512test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`513test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`514test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`515test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`516test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`517}518fi519}520521require_term_colors=:522}523524525## ----------------- ##526## Function library. ##527## ----------------- ##528529# This section contains a variety of useful functions to call in your530# scripts. Take note of the portable wrappers for features provided by531# some modern shells, which will fall back to slower equivalents on532# less featureful shells.533534535# func_append VAR VALUE536# ---------------------537# Append VALUE onto the existing contents of VAR.538539# We should try to minimise forks, especially on Windows where they are540# unreasonably slow, so skip the feature probes when bash or zsh are541# being used:542if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then543: ${_G_HAVE_ARITH_OP="yes"}544: ${_G_HAVE_XSI_OPS="yes"}545# The += operator was introduced in bash 3.1546case $BASH_VERSION in547[12].* | 3.0 | 3.0*) ;;548*)549: ${_G_HAVE_PLUSEQ_OP="yes"}550;;551esac552fi553554# _G_HAVE_PLUSEQ_OP555# Can be empty, in which case the shell is probed, "yes" if += is556# useable or anything else if it does not work.557test -z "$_G_HAVE_PLUSEQ_OP" \558&& (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \559&& _G_HAVE_PLUSEQ_OP=yes560561if test yes = "$_G_HAVE_PLUSEQ_OP"562then563# This is an XSI compatible shell, allowing a faster implementation...564eval 'func_append ()565{566$debug_cmd567568eval "$1+=\$2"569}'570else571# ...otherwise fall back to using expr, which is often a shell builtin.572func_append ()573{574$debug_cmd575576eval "$1=\$$1\$2"577}578fi579580581# func_append_quoted VAR VALUE582# ----------------------------583# Quote VALUE and append to the end of shell variable VAR, separated584# by a space.585if test yes = "$_G_HAVE_PLUSEQ_OP"; then586eval 'func_append_quoted ()587{588$debug_cmd589590func_quote_arg pretty "$2"591eval "$1+=\\ \$func_quote_arg_result"592}'593else594func_append_quoted ()595{596$debug_cmd597598func_quote_arg pretty "$2"599eval "$1=\$$1\\ \$func_quote_arg_result"600}601fi602603604# func_append_uniq VAR VALUE605# --------------------------606# Append unique VALUE onto the existing contents of VAR, assuming607# entries are delimited by the first character of VALUE. For example:608#609# func_append_uniq options " --another-option option-argument"610#611# will only append to $options if " --another-option option-argument "612# is not already present somewhere in $options already (note spaces at613# each end implied by leading space in second argument).614func_append_uniq ()615{616$debug_cmd617618eval _G_current_value='`$ECHO $'$1'`'619_G_delim=`expr "$2" : '\(.\)'`620621case $_G_delim$_G_current_value$_G_delim in622*"$2$_G_delim"*) ;;623*) func_append "$@" ;;624esac625}626627628# func_arith TERM...629# ------------------630# Set func_arith_result to the result of evaluating TERMs.631test -z "$_G_HAVE_ARITH_OP" \632&& (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \633&& _G_HAVE_ARITH_OP=yes634635if test yes = "$_G_HAVE_ARITH_OP"; then636eval 'func_arith ()637{638$debug_cmd639640func_arith_result=$(( $* ))641}'642else643func_arith ()644{645$debug_cmd646647func_arith_result=`expr "$@"`648}649fi650651652# func_basename FILE653# ------------------654# Set func_basename_result to FILE with everything up to and including655# the last / stripped.656if test yes = "$_G_HAVE_XSI_OPS"; then657# If this shell supports suffix pattern removal, then use it to avoid658# forking. Hide the definitions single quotes in case the shell chokes659# on unsupported syntax...660_b='func_basename_result=${1##*/}'661_d='case $1 in662*/*) func_dirname_result=${1%/*}$2 ;;663* ) func_dirname_result=$3 ;;664esac'665666else667# ...otherwise fall back to using sed.668_b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'669_d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"`670if test "X$func_dirname_result" = "X$1"; then671func_dirname_result=$3672else673func_append func_dirname_result "$2"674fi'675fi676677eval 'func_basename ()678{679$debug_cmd680681'"$_b"'682}'683684685# func_dirname FILE APPEND NONDIR_REPLACEMENT686# -------------------------------------------687# Compute the dirname of FILE. If nonempty, add APPEND to the result,688# otherwise set result to NONDIR_REPLACEMENT.689eval 'func_dirname ()690{691$debug_cmd692693'"$_d"'694}'695696697# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT698# --------------------------------------------------------699# Perform func_basename and func_dirname in a single function700# call:701# dirname: Compute the dirname of FILE. If nonempty,702# add APPEND to the result, otherwise set result703# to NONDIR_REPLACEMENT.704# value returned in "$func_dirname_result"705# basename: Compute filename of FILE.706# value retuned in "$func_basename_result"707# For efficiency, we do not delegate to the functions above but instead708# duplicate the functionality here.709eval 'func_dirname_and_basename ()710{711$debug_cmd712713'"$_b"'714'"$_d"'715}'716717718# func_echo ARG...719# ----------------720# Echo program name prefixed message.721func_echo ()722{723$debug_cmd724725_G_message=$*726727func_echo_IFS=$IFS728IFS=$nl729for _G_line in $_G_message; do730IFS=$func_echo_IFS731$ECHO "$progname: $_G_line"732done733IFS=$func_echo_IFS734}735736737# func_echo_all ARG...738# --------------------739# Invoke $ECHO with all args, space-separated.740func_echo_all ()741{742$ECHO "$*"743}744745746# func_echo_infix_1 INFIX ARG...747# ------------------------------748# Echo program name, followed by INFIX on the first line, with any749# additional lines not showing INFIX.750func_echo_infix_1 ()751{752$debug_cmd753754$require_term_colors755756_G_infix=$1; shift757_G_indent=$_G_infix758_G_prefix="$progname: $_G_infix: "759_G_message=$*760761# Strip color escape sequences before counting printable length762for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"763do764test -n "$_G_tc" && {765_G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`766_G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`767}768done769_G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes770771func_echo_infix_1_IFS=$IFS772IFS=$nl773for _G_line in $_G_message; do774IFS=$func_echo_infix_1_IFS775$ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2776_G_prefix=$_G_indent777done778IFS=$func_echo_infix_1_IFS779}780781782# func_error ARG...783# -----------------784# Echo program name prefixed message to standard error.785func_error ()786{787$debug_cmd788789$require_term_colors790791func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2792}793794795# func_fatal_error ARG...796# -----------------------797# Echo program name prefixed message to standard error, and exit.798func_fatal_error ()799{800$debug_cmd801802func_error "$*"803exit $EXIT_FAILURE804}805806807# func_grep EXPRESSION FILENAME808# -----------------------------809# Check whether EXPRESSION matches any line of FILENAME, without output.810func_grep ()811{812$debug_cmd813814$GREP "$1" "$2" >/dev/null 2>&1815}816817818# func_len STRING819# ---------------820# Set func_len_result to the length of STRING. STRING may not821# start with a hyphen.822test -z "$_G_HAVE_XSI_OPS" \823&& (eval 'x=a/b/c;824test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \825&& _G_HAVE_XSI_OPS=yes826827if test yes = "$_G_HAVE_XSI_OPS"; then828eval 'func_len ()829{830$debug_cmd831832func_len_result=${#1}833}'834else835func_len ()836{837$debug_cmd838839func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`840}841fi842843844# func_mkdir_p DIRECTORY-PATH845# ---------------------------846# Make sure the entire path to DIRECTORY-PATH is available.847func_mkdir_p ()848{849$debug_cmd850851_G_directory_path=$1852_G_dir_list=853854if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then855856# Protect directory names starting with '-'857case $_G_directory_path in858-*) _G_directory_path=./$_G_directory_path ;;859esac860861# While some portion of DIR does not yet exist...862while test ! -d "$_G_directory_path"; do863# ...make a list in topmost first order. Use a colon delimited864# list incase some portion of path contains whitespace.865_G_dir_list=$_G_directory_path:$_G_dir_list866867# If the last portion added has no slash in it, the list is done868case $_G_directory_path in */*) ;; *) break ;; esac869870# ...otherwise throw away the child directory and loop871_G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`872done873_G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`874875func_mkdir_p_IFS=$IFS; IFS=:876for _G_dir in $_G_dir_list; do877IFS=$func_mkdir_p_IFS878# mkdir can fail with a 'File exist' error if two processes879# try to create one of the directories concurrently. Don't880# stop in that case!881$MKDIR "$_G_dir" 2>/dev/null || :882done883IFS=$func_mkdir_p_IFS884885# Bail out if we (or some other process) failed to create a directory.886test -d "$_G_directory_path" || \887func_fatal_error "Failed to create '$1'"888fi889}890891892# func_mktempdir [BASENAME]893# -------------------------894# Make a temporary directory that won't clash with other running895# libtool processes, and avoids race conditions if possible. If896# given, BASENAME is the basename for that directory.897func_mktempdir ()898{899$debug_cmd900901_G_template=${TMPDIR-/tmp}/${1-$progname}902903if test : = "$opt_dry_run"; then904# Return a directory name, but don't create it in dry-run mode905_G_tmpdir=$_G_template-$$906else907908# If mktemp works, use that first and foremost909_G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`910911if test ! -d "$_G_tmpdir"; then912# Failing that, at least try and use $RANDOM to avoid a race913_G_tmpdir=$_G_template-${RANDOM-0}$$914915func_mktempdir_umask=`umask`916umask 0077917$MKDIR "$_G_tmpdir"918umask $func_mktempdir_umask919fi920921# If we're not in dry-run mode, bomb out on failure922test -d "$_G_tmpdir" || \923func_fatal_error "cannot create temporary directory '$_G_tmpdir'"924fi925926$ECHO "$_G_tmpdir"927}928929930# func_normal_abspath PATH931# ------------------------932# Remove doubled-up and trailing slashes, "." path components,933# and cancel out any ".." path components in PATH after making934# it an absolute path.935func_normal_abspath ()936{937$debug_cmd938939# These SED scripts presuppose an absolute path with a trailing slash.940_G_pathcar='s|^/\([^/]*\).*$|\1|'941_G_pathcdr='s|^/[^/]*||'942_G_removedotparts=':dotsl943s|/\./|/|g944t dotsl945s|/\.$|/|'946_G_collapseslashes='s|/\{1,\}|/|g'947_G_finalslash='s|/*$|/|'948949# Start from root dir and reassemble the path.950func_normal_abspath_result=951func_normal_abspath_tpath=$1952func_normal_abspath_altnamespace=953case $func_normal_abspath_tpath in954"")955# Empty path, that just means $cwd.956func_stripname '' '/' "`pwd`"957func_normal_abspath_result=$func_stripname_result958return959;;960# The next three entries are used to spot a run of precisely961# two leading slashes without using negated character classes;962# we take advantage of case's first-match behaviour.963///*)964# Unusual form of absolute path, do nothing.965;;966//*)967# Not necessarily an ordinary path; POSIX reserves leading '//'968# and for example Cygwin uses it to access remote file shares969# over CIFS/SMB, so we conserve a leading double slash if found.970func_normal_abspath_altnamespace=/971;;972/*)973# Absolute path, do nothing.974;;975*)976# Relative path, prepend $cwd.977func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath978;;979esac980981# Cancel out all the simple stuff to save iterations. We also want982# the path to end with a slash for ease of parsing, so make sure983# there is one (and only one) here.984func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \985-e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`986while :; do987# Processed it all yet?988if test / = "$func_normal_abspath_tpath"; then989# If we ascended to the root using ".." the result may be empty now.990if test -z "$func_normal_abspath_result"; then991func_normal_abspath_result=/992fi993break994fi995func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \996-e "$_G_pathcar"`997func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \998-e "$_G_pathcdr"`999# Figure out what to do with it1000case $func_normal_abspath_tcomponent in1001"")1002# Trailing empty path component, ignore it.1003;;1004..)1005# Parent dir; strip last assembled component from result.1006func_dirname "$func_normal_abspath_result"1007func_normal_abspath_result=$func_dirname_result1008;;1009*)1010# Actual path component, append it.1011func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"1012;;1013esac1014done1015# Restore leading double-slash if one was found on entry.1016func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result1017}101810191020# func_notquiet ARG...1021# --------------------1022# Echo program name prefixed message only when not in quiet mode.1023func_notquiet ()1024{1025$debug_cmd10261027$opt_quiet || func_echo ${1+"$@"}10281029# A bug in bash halts the script if the last line of a function1030# fails when set -e is in force, so we need another command to1031# work around that:1032:1033}103410351036# func_relative_path SRCDIR DSTDIR1037# --------------------------------1038# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.1039func_relative_path ()1040{1041$debug_cmd10421043func_relative_path_result=1044func_normal_abspath "$1"1045func_relative_path_tlibdir=$func_normal_abspath_result1046func_normal_abspath "$2"1047func_relative_path_tbindir=$func_normal_abspath_result10481049# Ascend the tree starting from libdir1050while :; do1051# check if we have found a prefix of bindir1052case $func_relative_path_tbindir in1053$func_relative_path_tlibdir)1054# found an exact match1055func_relative_path_tcancelled=1056break1057;;1058$func_relative_path_tlibdir*)1059# found a matching prefix1060func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"1061func_relative_path_tcancelled=$func_stripname_result1062if test -z "$func_relative_path_result"; then1063func_relative_path_result=.1064fi1065break1066;;1067*)1068func_dirname $func_relative_path_tlibdir1069func_relative_path_tlibdir=$func_dirname_result1070if test -z "$func_relative_path_tlibdir"; then1071# Have to descend all the way to the root!1072func_relative_path_result=../$func_relative_path_result1073func_relative_path_tcancelled=$func_relative_path_tbindir1074break1075fi1076func_relative_path_result=../$func_relative_path_result1077;;1078esac1079done10801081# Now calculate path; take care to avoid doubling-up slashes.1082func_stripname '' '/' "$func_relative_path_result"1083func_relative_path_result=$func_stripname_result1084func_stripname '/' '/' "$func_relative_path_tcancelled"1085if test -n "$func_stripname_result"; then1086func_append func_relative_path_result "/$func_stripname_result"1087fi10881089# Normalisation. If bindir is libdir, return '.' else relative path.1090if test -n "$func_relative_path_result"; then1091func_stripname './' '' "$func_relative_path_result"1092func_relative_path_result=$func_stripname_result1093fi10941095test -n "$func_relative_path_result" || func_relative_path_result=.10961097:1098}109911001101# func_quote_portable EVAL ARG1102# ----------------------------1103# Internal function to portably implement func_quote_arg. Note that we still1104# keep attention to performance here so we as much as possible try to avoid1105# calling sed binary (so far O(N) complexity as long as func_append is O(1)).1106func_quote_portable ()1107{1108$debug_cmd11091110func_quote_portable_result=$211111112# one-time-loop (easy break)1113while true1114do1115if $1; then1116func_quote_portable_result=`$ECHO "$2" | $SED \1117-e "$sed_double_quote_subst" -e "$sed_double_backslash"`1118break1119fi11201121# Quote for eval.1122case $func_quote_portable_result in1123*[\\\`\"\$]*)1124case $func_quote_portable_result in1125*[\[\*\?]*)1126func_quote_portable_result=`$ECHO "$func_quote_portable_result" \1127| $SED "$sed_quote_subst"`1128break1129;;1130esac11311132func_quote_portable_old_IFS=$IFS1133for _G_char in '\' '`' '"' '$'1134do1135# STATE($1) PREV($2) SEPARATOR($3)1136set start "" ""1137func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy1138IFS=$_G_char1139for _G_part in $func_quote_portable_result1140do1141case $1 in1142quote)1143func_append func_quote_portable_result "$3$2"1144set quote "$_G_part" "\\$_G_char"1145;;1146start)1147set first "" ""1148func_quote_portable_result=1149;;1150first)1151set quote "$_G_part" ""1152;;1153esac1154done1155done1156IFS=$func_quote_portable_old_IFS1157;;1158*) ;;1159esac1160break1161done11621163func_quote_portable_unquoted_result=$func_quote_portable_result1164case $func_quote_portable_result in1165# double-quote args containing shell metacharacters to delay1166# word splitting, command substitution and variable expansion1167# for a subsequent eval.1168# many bourne shells cannot handle close brackets correctly1169# in scan sets, so we specify it separately.1170*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")1171func_quote_portable_result=\"$func_quote_portable_result\"1172;;1173esac1174}117511761177# func_quotefast_eval ARG1178# -----------------------1179# Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG',1180# but optimized for speed. Result is stored in $func_quotefast_eval.1181if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then1182printf -v _GL_test_printf_tilde %q '~'1183if test '\~' = "$_GL_test_printf_tilde"; then1184func_quotefast_eval ()1185{1186printf -v func_quotefast_eval_result %q "$1"1187}1188else1189# Broken older Bash implementations. Make those faster too if possible.1190func_quotefast_eval ()1191{1192case $1 in1193'~'*)1194func_quote_portable false "$1"1195func_quotefast_eval_result=$func_quote_portable_result1196;;1197*)1198printf -v func_quotefast_eval_result %q "$1"1199;;1200esac1201}1202fi1203else1204func_quotefast_eval ()1205{1206func_quote_portable false "$1"1207func_quotefast_eval_result=$func_quote_portable_result1208}1209fi121012111212# func_quote_arg MODEs ARG1213# ------------------------1214# Quote one ARG to be evaled later. MODEs argument may contain zero or more1215# specifiers listed below separated by ',' character. This function returns two1216# values:1217# i) func_quote_arg_result1218# double-quoted (when needed), suitable for a subsequent eval1219# ii) func_quote_arg_unquoted_result1220# has all characters that are still active within double1221# quotes backslashified. Available only if 'unquoted' is specified.1222#1223# Available modes:1224# ----------------1225# 'eval' (default)1226# - escape shell special characters1227# 'expand'1228# - the same as 'eval'; but do not quote variable references1229# 'pretty'1230# - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might1231# be used later in func_quote to get output like: 'echo "a b"' instead1232# of 'echo a\ b'. This is slower than default on some shells.1233# 'unquoted'1234# - produce also $func_quote_arg_unquoted_result which does not contain1235# wrapping double-quotes.1236#1237# Examples for 'func_quote_arg pretty,unquoted string':1238#1239# string | *_result | *_unquoted_result1240# ------------+-----------------------+-------------------1241# " | \" | \"1242# a b | "a b" | a b1243# "a b" | "\"a b\"" | \"a b\"1244# * | "*" | *1245# z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\"1246#1247# Examples for 'func_quote_arg pretty,unquoted,expand string':1248#1249# string | *_result | *_unquoted_result1250# --------------+---------------------+--------------------1251# z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\"1252func_quote_arg ()1253{1254_G_quote_expand=false1255case ,$1, in1256*,expand,*)1257_G_quote_expand=:1258;;1259esac12601261case ,$1, in1262*,pretty,*|*,expand,*|*,unquoted,*)1263func_quote_portable $_G_quote_expand "$2"1264func_quote_arg_result=$func_quote_portable_result1265func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result1266;;1267*)1268# Faster quote-for-eval for some shells.1269func_quotefast_eval "$2"1270func_quote_arg_result=$func_quotefast_eval_result1271;;1272esac1273}127412751276# func_quote MODEs ARGs...1277# ------------------------1278# Quote all ARGs to be evaled later and join them into single command. See1279# func_quote_arg's description for more info.1280func_quote ()1281{1282$debug_cmd1283_G_func_quote_mode=$1 ; shift1284func_quote_result=1285while test 0 -lt $#; do1286func_quote_arg "$_G_func_quote_mode" "$1"1287if test -n "$func_quote_result"; then1288func_append func_quote_result " $func_quote_arg_result"1289else1290func_append func_quote_result "$func_quote_arg_result"1291fi1292shift1293done1294}129512961297# func_stripname PREFIX SUFFIX NAME1298# ---------------------------------1299# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.1300# PREFIX and SUFFIX must not contain globbing or regex special1301# characters, hashes, percent signs, but SUFFIX may contain a leading1302# dot (in which case that matches only a dot).1303if test yes = "$_G_HAVE_XSI_OPS"; then1304eval 'func_stripname ()1305{1306$debug_cmd13071308# pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are1309# positional parameters, so assign one to ordinary variable first.1310func_stripname_result=$31311func_stripname_result=${func_stripname_result#"$1"}1312func_stripname_result=${func_stripname_result%"$2"}1313}'1314else1315func_stripname ()1316{1317$debug_cmd13181319case $2 in1320.*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;1321*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;1322esac1323}1324fi132513261327# func_show_eval CMD [FAIL_EXP]1328# -----------------------------1329# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is1330# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP1331# is given, then evaluate it.1332func_show_eval ()1333{1334$debug_cmd13351336_G_cmd=$11337_G_fail_exp=${2-':'}13381339func_quote_arg pretty,expand "$_G_cmd"1340eval "func_notquiet $func_quote_arg_result"13411342$opt_dry_run || {1343eval "$_G_cmd"1344_G_status=$?1345if test 0 -ne "$_G_status"; then1346eval "(exit $_G_status); $_G_fail_exp"1347fi1348}1349}135013511352# func_show_eval_locale CMD [FAIL_EXP]1353# ------------------------------------1354# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is1355# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP1356# is given, then evaluate it. Use the saved locale for evaluation.1357func_show_eval_locale ()1358{1359$debug_cmd13601361_G_cmd=$11362_G_fail_exp=${2-':'}13631364$opt_quiet || {1365func_quote_arg expand,pretty "$_G_cmd"1366eval "func_echo $func_quote_arg_result"1367}13681369$opt_dry_run || {1370eval "$_G_user_locale1371$_G_cmd"1372_G_status=$?1373eval "$_G_safe_locale"1374if test 0 -ne "$_G_status"; then1375eval "(exit $_G_status); $_G_fail_exp"1376fi1377}1378}137913801381# func_tr_sh1382# ----------1383# Turn $1 into a string suitable for a shell variable name.1384# Result is stored in $func_tr_sh_result. All characters1385# not in the set a-zA-Z0-9_ are replaced with '_'. Further,1386# if $1 begins with a digit, a '_' is prepended as well.1387func_tr_sh ()1388{1389$debug_cmd13901391case $1 in1392[0-9]* | *[!a-zA-Z0-9_]*)1393func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`1394;;1395* )1396func_tr_sh_result=$11397;;1398esac1399}140014011402# func_verbose ARG...1403# -------------------1404# Echo program name prefixed message in verbose mode only.1405func_verbose ()1406{1407$debug_cmd14081409$opt_verbose && func_echo "$*"14101411:1412}141314141415# func_warn_and_continue ARG...1416# -----------------------------1417# Echo program name prefixed warning message to standard error.1418func_warn_and_continue ()1419{1420$debug_cmd14211422$require_term_colors14231424func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&21425}142614271428# func_warning CATEGORY ARG...1429# ----------------------------1430# Echo program name prefixed warning message to standard error. Warning1431# messages can be filtered according to CATEGORY, where this function1432# elides messages where CATEGORY is not listed in the global variable1433# 'opt_warning_types'.1434func_warning ()1435{1436$debug_cmd14371438# CATEGORY must be in the warning_categories list!1439case " $warning_categories " in1440*" $1 "*) ;;1441*) func_internal_error "invalid warning category '$1'" ;;1442esac14431444_G_category=$11445shift14461447case " $opt_warning_types " in1448*" $_G_category "*) $warning_func ${1+"$@"} ;;1449esac1450}145114521453# func_sort_ver VER1 VER21454# -----------------------1455# 'sort -V' is not generally available.1456# Note this deviates from the version comparison in automake1457# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a1458# but this should suffice as we won't be specifying old1459# version formats or redundant trailing .0 in bootstrap.conf.1460# If we did want full compatibility then we should probably1461# use m4_version_compare from autoconf.1462func_sort_ver ()1463{1464$debug_cmd14651466printf '%s\n%s\n' "$1" "$2" \1467| 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,9n1468}14691470# func_lt_ver PREV CURR1471# ---------------------1472# Return true if PREV and CURR are in the correct order according to1473# func_sort_ver, otherwise false. Use it like this:1474#1475# func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."1476func_lt_ver ()1477{1478$debug_cmd14791480test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`1481}148214831484# Local variables:1485# mode: shell-script1486# sh-indentation: 21487# eval: (add-hook 'before-save-hook 'time-stamp)1488# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"1489# time-stamp-time-zone: "UTC"1490# End:1491#! /bin/sh14921493# A portable, pluggable option parser for Bourne shell.1494# Written by Gary V. Vaughan, 201014951496# This is free software. There is NO warranty; not even for1497# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.1498#1499# Copyright (C) 2010-2017 Bootstrap Authors1500#1501# This file is dual licensed under the terms of the MIT license1502# <https://opensource.org/license/MIT>, and GPL version 3 or later1503# <http://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of1504# these licenses when using or redistributing this software or any of1505# the files within it. See the URLs above, or the file `LICENSE`1506# included in the Bootstrap distribution for the full license texts.15071508# Please report bugs or propose patches to:1509# <https://github.com/gnulib-modules/bootstrap/issues>15101511# Set a version string for this script.1512scriptversion=2016-03-06.01; # UTC151315141515## ------ ##1516## Usage. ##1517## ------ ##15181519# This file is a library for parsing options in your shell scripts along1520# with assorted other useful supporting features that you can make use1521# of too.1522#1523# For the simplest scripts you might need only:1524#1525# #!/bin/sh1526# . relative/path/to/funclib.sh1527# . relative/path/to/options-parser1528# scriptversion=1.01529# func_options ${1+"$@"}1530# eval set dummy "$func_options_result"; shift1531# ...rest of your script...1532#1533# In order for the '--version' option to work, you will need to have a1534# suitably formatted comment like the one at the top of this file1535# starting with '# Written by ' and ending with '# Copyright'.1536#1537# For '-h' and '--help' to work, you will also need a one line1538# description of your script's purpose in a comment directly above the1539# '# Written by ' line, like the one at the top of this file.1540#1541# The default options also support '--debug', which will turn on shell1542# execution tracing (see the comment above debug_cmd below for another1543# use), and '--verbose' and the func_verbose function to allow your script1544# to display verbose messages only when your user has specified1545# '--verbose'.1546#1547# After sourcing this file, you can plug in processing for additional1548# options by amending the variables from the 'Configuration' section1549# below, and following the instructions in the 'Option parsing'1550# section further down.15511552## -------------- ##1553## Configuration. ##1554## -------------- ##15551556# You should override these variables in your script after sourcing this1557# file so that they reflect the customisations you have added to the1558# option parser.15591560# The usage line for option parsing errors and the start of '-h' and1561# '--help' output messages. You can embed shell variables for delayed1562# expansion at the time the message is displayed, but you will need to1563# quote other shell meta-characters carefully to prevent them being1564# expanded when the contents are evaled.1565usage='$progpath [OPTION]...'15661567# Short help message in response to '-h' and '--help'. Add to this or1568# override it after sourcing this library to reflect the full set of1569# options your script accepts.1570usage_message="\1571--debug enable verbose shell tracing1572-W, --warnings=CATEGORY1573report the warnings falling in CATEGORY [all]1574-v, --verbose verbosely report processing1575--version print version information and exit1576-h, --help print short or long help message and exit1577"15781579# Additional text appended to 'usage_message' in response to '--help'.1580long_help_message="1581Warning categories include:1582'all' show all warnings1583'none' turn off all the warnings1584'error' warnings are treated as fatal errors"15851586# Help message printed before fatal option parsing errors.1587fatal_help="Try '\$progname --help' for more information."1588158915901591## ------------------------- ##1592## Hook function management. ##1593## ------------------------- ##15941595# This section contains functions for adding, removing, and running hooks1596# in the main code. A hook is just a list of function names that can be1597# run in order later on.15981599# func_hookable FUNC_NAME1600# -----------------------1601# Declare that FUNC_NAME will run hooks added with1602# 'func_add_hook FUNC_NAME ...'.1603func_hookable ()1604{1605$debug_cmd16061607func_append hookable_fns " $1"1608}160916101611# func_add_hook FUNC_NAME HOOK_FUNC1612# ---------------------------------1613# Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must1614# first have been declared "hookable" by a call to 'func_hookable'.1615func_add_hook ()1616{1617$debug_cmd16181619case " $hookable_fns " in1620*" $1 "*) ;;1621*) func_fatal_error "'$1' does not accept hook functions." ;;1622esac16231624eval func_append ${1}_hooks '" $2"'1625}162616271628# func_remove_hook FUNC_NAME HOOK_FUNC1629# ------------------------------------1630# Remove HOOK_FUNC from the list of hook functions to be called by1631# FUNC_NAME.1632func_remove_hook ()1633{1634$debug_cmd16351636eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'1637}163816391640# func_propagate_result FUNC_NAME_A FUNC_NAME_B1641# ---------------------------------------------1642# If the *_result variable of FUNC_NAME_A _is set_, assign its value to1643# *_result variable of FUNC_NAME_B.1644func_propagate_result ()1645{1646$debug_cmd16471648func_propagate_result_result=:1649if eval "test \"\${${1}_result+set}\" = set"1650then1651eval "${2}_result=\$${1}_result"1652else1653func_propagate_result_result=false1654fi1655}165616571658# func_run_hooks FUNC_NAME [ARG]...1659# ---------------------------------1660# Run all hook functions registered to FUNC_NAME.1661# It's assumed that the list of hook functions contains nothing more1662# than a whitespace-delimited list of legal shell function names, and1663# no effort is wasted trying to catch shell meta-characters or preserve1664# whitespace.1665func_run_hooks ()1666{1667$debug_cmd16681669case " $hookable_fns " in1670*" $1 "*) ;;1671*) func_fatal_error "'$1' does not support hook functions." ;;1672esac16731674eval _G_hook_fns=\$$1_hooks; shift16751676for _G_hook in $_G_hook_fns; do1677func_unset "${_G_hook}_result"1678eval $_G_hook '${1+"$@"}'1679func_propagate_result $_G_hook func_run_hooks1680if $func_propagate_result_result; then1681eval set dummy "$func_run_hooks_result"; shift1682fi1683done1684}1685168616871688## --------------- ##1689## Option parsing. ##1690## --------------- ##16911692# In order to add your own option parsing hooks, you must accept the1693# full positional parameter list from your hook function. You may remove1694# or edit any options that you action, and then pass back the remaining1695# unprocessed options in '<hooked_function_name>_result', escaped1696# suitably for 'eval'.1697#1698# The '<hooked_function_name>_result' variable is automatically unset1699# before your hook gets called; for best performance, only set the1700# *_result variable when necessary (i.e. don't call the 'func_quote'1701# function unnecessarily because it can be an expensive operation on some1702# machines).1703#1704# Like this:1705#1706# my_options_prep ()1707# {1708# $debug_cmd1709#1710# # Extend the existing usage message.1711# usage_message=$usage_message'1712# -s, --silent don'\''t print informational messages1713# '1714# # No change in '$@' (ignored completely by this hook). Leave1715# # my_options_prep_result variable intact.1716# }1717# func_add_hook func_options_prep my_options_prep1718#1719#1720# my_silent_option ()1721# {1722# $debug_cmd1723#1724# args_changed=false1725#1726# # Note that, for efficiency, we parse as many options as we can1727# # recognise in a loop before passing the remainder back to the1728# # caller on the first unrecognised argument we encounter.1729# while test $# -gt 0; do1730# opt=$1; shift1731# case $opt in1732# --silent|-s) opt_silent=:1733# args_changed=:1734# ;;1735# # Separate non-argument short options:1736# -s*) func_split_short_opt "$_G_opt"1737# set dummy "$func_split_short_opt_name" \1738# "-$func_split_short_opt_arg" ${1+"$@"}1739# shift1740# args_changed=:1741# ;;1742# *) # Make sure the first unrecognised option "$_G_opt"1743# # is added back to "$@" in case we need it later,1744# # if $args_changed was set to 'true'.1745# set dummy "$_G_opt" ${1+"$@"}; shift; break ;;1746# esac1747# done1748#1749# # Only call 'func_quote' here if we processed at least one argument.1750# if $args_changed; then1751# func_quote eval ${1+"$@"}1752# my_silent_option_result=$func_quote_result1753# fi1754# }1755# func_add_hook func_parse_options my_silent_option1756#1757#1758# my_option_validation ()1759# {1760# $debug_cmd1761#1762# $opt_silent && $opt_verbose && func_fatal_help "\1763# '--silent' and '--verbose' options are mutually exclusive."1764# }1765# func_add_hook func_validate_options my_option_validation1766#1767# You'll also need to manually amend $usage_message to reflect the extra1768# options you parse. It's preferable to append if you can, so that1769# multiple option parsing hooks can be added safely.177017711772# func_options_finish [ARG]...1773# ----------------------------1774# Finishing the option parse loop (call 'func_options' hooks ATM).1775func_options_finish ()1776{1777$debug_cmd17781779func_run_hooks func_options ${1+"$@"}1780func_propagate_result func_run_hooks func_options_finish1781}178217831784# func_options [ARG]...1785# ---------------------1786# All the functions called inside func_options are hookable. See the1787# individual implementations for details.1788func_hookable func_options1789func_options ()1790{1791$debug_cmd17921793_G_options_quoted=false17941795for my_func in options_prep parse_options validate_options options_finish1796do1797func_unset func_${my_func}_result1798func_unset func_run_hooks_result1799eval func_$my_func '${1+"$@"}'1800func_propagate_result func_$my_func func_options1801if $func_propagate_result_result; then1802eval set dummy "$func_options_result"; shift1803_G_options_quoted=:1804fi1805done18061807$_G_options_quoted || {1808# As we (func_options) are top-level options-parser function and1809# nobody quoted "$@" for us yet, we need to do it explicitly for1810# caller.1811func_quote eval ${1+"$@"}1812func_options_result=$func_quote_result1813}1814}181518161817# func_options_prep [ARG]...1818# --------------------------1819# All initialisations required before starting the option parse loop.1820# Note that when calling hook functions, we pass through the list of1821# positional parameters. If a hook function modifies that list, and1822# needs to propagate that back to rest of this script, then the complete1823# modified list must be put in 'func_run_hooks_result' before returning.1824func_hookable func_options_prep1825func_options_prep ()1826{1827$debug_cmd18281829# Option defaults:1830opt_verbose=false1831opt_warning_types=18321833func_run_hooks func_options_prep ${1+"$@"}1834func_propagate_result func_run_hooks func_options_prep1835}183618371838# func_parse_options [ARG]...1839# ---------------------------1840# The main option parsing loop.1841func_hookable func_parse_options1842func_parse_options ()1843{1844$debug_cmd18451846_G_parse_options_requote=false1847# this just eases exit handling1848while test $# -gt 0; do1849# Defer to hook functions for initial option parsing, so they1850# get priority in the event of reusing an option name.1851func_run_hooks func_parse_options ${1+"$@"}1852func_propagate_result func_run_hooks func_parse_options1853if $func_propagate_result_result; then1854eval set dummy "$func_parse_options_result"; shift1855# Even though we may have changed "$@", we passed the "$@" array1856# down into the hook and it quoted it for us (because we are in1857# this if-branch). No need to quote it again.1858_G_parse_options_requote=false1859fi18601861# Break out of the loop if we already parsed every option.1862test $# -gt 0 || break18631864# We expect that one of the options parsed in this function matches1865# and thus we remove _G_opt from "$@" and need to re-quote.1866_G_match_parse_options=:1867_G_opt=$11868shift1869case $_G_opt in1870--debug|-x) debug_cmd='set -x'1871func_echo "enabling shell trace mode" >&21872$debug_cmd1873;;18741875--no-warnings|--no-warning|--no-warn)1876set dummy --warnings none ${1+"$@"}1877shift1878;;18791880--warnings|--warning|-W)1881if test $# = 0 && func_missing_arg $_G_opt; then1882_G_parse_options_requote=:1883break1884fi1885case " $warning_categories $1" in1886*" $1 "*)1887# trailing space prevents matching last $1 above1888func_append_uniq opt_warning_types " $1"1889;;1890*all)1891opt_warning_types=$warning_categories1892;;1893*none)1894opt_warning_types=none1895warning_func=:1896;;1897*error)1898opt_warning_types=$warning_categories1899warning_func=func_fatal_error1900;;1901*)1902func_fatal_error \1903"unsupported warning category: '$1'"1904;;1905esac1906shift1907;;19081909--verbose|-v) opt_verbose=: ;;1910--version) func_version ;;1911-\?|-h) func_usage ;;1912--help) func_help ;;19131914# Separate optargs to long options (plugins may need this):1915--*=*) func_split_equals "$_G_opt"1916set dummy "$func_split_equals_lhs" \1917"$func_split_equals_rhs" ${1+"$@"}1918shift1919;;19201921# Separate optargs to short options:1922-W*)1923func_split_short_opt "$_G_opt"1924set dummy "$func_split_short_opt_name" \1925"$func_split_short_opt_arg" ${1+"$@"}1926shift1927;;19281929# Separate non-argument short options:1930-\?*|-h*|-v*|-x*)1931func_split_short_opt "$_G_opt"1932set dummy "$func_split_short_opt_name" \1933"-$func_split_short_opt_arg" ${1+"$@"}1934shift1935;;19361937--) _G_parse_options_requote=: ; break ;;1938-*) func_fatal_help "unrecognised option: '$_G_opt'" ;;1939*) set dummy "$_G_opt" ${1+"$@"}; shift1940_G_match_parse_options=false1941break1942;;1943esac19441945if $_G_match_parse_options; then1946_G_parse_options_requote=:1947fi1948done19491950if $_G_parse_options_requote; then1951# save modified positional parameters for caller1952func_quote eval ${1+"$@"}1953func_parse_options_result=$func_quote_result1954fi1955}195619571958# func_validate_options [ARG]...1959# ------------------------------1960# Perform any sanity checks on option settings and/or unconsumed1961# arguments.1962func_hookable func_validate_options1963func_validate_options ()1964{1965$debug_cmd19661967# Display all warnings if -W was not given.1968test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"19691970func_run_hooks func_validate_options ${1+"$@"}1971func_propagate_result func_run_hooks func_validate_options19721973# Bail if the options were screwed!1974$exit_cmd $EXIT_FAILURE1975}1976197719781979## ----------------- ##1980## Helper functions. ##1981## ----------------- ##19821983# This section contains the helper functions used by the rest of the1984# hookable option parser framework in ascii-betical order.198519861987# func_fatal_help ARG...1988# ----------------------1989# Echo program name prefixed message to standard error, followed by1990# a help hint, and exit.1991func_fatal_help ()1992{1993$debug_cmd19941995eval \$ECHO \""Usage: $usage"\"1996eval \$ECHO \""$fatal_help"\"1997func_error ${1+"$@"}1998exit $EXIT_FAILURE1999}200020012002# func_help2003# ---------2004# Echo long help message to standard output and exit.2005func_help ()2006{2007$debug_cmd20082009func_usage_message2010$ECHO "$long_help_message"2011exit 02012}201320142015# func_missing_arg ARGNAME2016# ------------------------2017# Echo program name prefixed message to standard error and set global2018# exit_cmd.2019func_missing_arg ()2020{2021$debug_cmd20222023func_error "Missing argument for '$1'."2024exit_cmd=exit2025}202620272028# func_split_equals STRING2029# ------------------------2030# Set func_split_equals_lhs and func_split_equals_rhs shell variables2031# after splitting STRING at the '=' sign.2032test -z "$_G_HAVE_XSI_OPS" \2033&& (eval 'x=a/b/c;2034test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \2035&& _G_HAVE_XSI_OPS=yes20362037if test yes = "$_G_HAVE_XSI_OPS"2038then2039# This is an XSI compatible shell, allowing a faster implementation...2040eval 'func_split_equals ()2041{2042$debug_cmd20432044func_split_equals_lhs=${1%%=*}2045func_split_equals_rhs=${1#*=}2046if test "x$func_split_equals_lhs" = "x$1"; then2047func_split_equals_rhs=2048fi2049}'2050else2051# ...otherwise fall back to using expr, which is often a shell builtin.2052func_split_equals ()2053{2054$debug_cmd20552056func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`2057func_split_equals_rhs=2058test "x$func_split_equals_lhs" = "x$1" \2059|| func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`2060}2061fi #func_split_equals206220632064# func_split_short_opt SHORTOPT2065# -----------------------------2066# Set func_split_short_opt_name and func_split_short_opt_arg shell2067# variables after splitting SHORTOPT after the 2nd character.2068if test yes = "$_G_HAVE_XSI_OPS"2069then2070# This is an XSI compatible shell, allowing a faster implementation...2071eval 'func_split_short_opt ()2072{2073$debug_cmd20742075func_split_short_opt_arg=${1#??}2076func_split_short_opt_name=${1%"$func_split_short_opt_arg"}2077}'2078else2079# ...otherwise fall back to using expr, which is often a shell builtin.2080func_split_short_opt ()2081{2082$debug_cmd20832084func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`2085func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`2086}2087fi #func_split_short_opt208820892090# func_usage2091# ----------2092# Echo short help message to standard output and exit.2093func_usage ()2094{2095$debug_cmd20962097func_usage_message2098$ECHO "Run '$progname --help |${PAGER-more}' for full usage"2099exit 02100}210121022103# func_usage_message2104# ------------------2105# Echo short help message to standard output.2106func_usage_message ()2107{2108$debug_cmd21092110eval \$ECHO \""Usage: $usage"\"2111echo2112$SED -n 's|^# ||2113/^Written by/{2114x;p;x2115}2116h2117/^Written by/q' < "$progpath"2118echo2119eval \$ECHO \""$usage_message"\"2120}212121222123# func_version2124# ------------2125# Echo version message to standard output and exit.2126# The version message is extracted from the calling file's header2127# comments, with leading '# ' stripped:2128# 1. First display the progname and version2129# 2. Followed by the header comment line matching /^# Written by /2130# 3. Then a blank line followed by the first following line matching2131# /^# Copyright /2132# 4. Immediately followed by any lines between the previous matches,2133# except lines preceding the intervening completely blank line.2134# For example, see the header comments of this file.2135func_version ()2136{2137$debug_cmd21382139printf '%s\n' "$progname $scriptversion"2140$SED -n '2141/^# Written by /!b2142s|^# ||; p; n21432144:fwd2blnk2145/./ {2146n2147b fwd2blnk2148}2149p; n21502151:holdwrnt2152s|^# ||2153s|^# *$||2154/^Copyright /!{2155/./H2156n2157b holdwrnt2158}21592160s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|2161G2162s|\(\n\)\n*|\1|g2163p; q' < "$progpath"21642165exit $?2166}216721682169# Local variables:2170# mode: shell-script2171# sh-indentation: 22172# eval: (add-hook 'before-save-hook 'time-stamp)2173# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"2174# time-stamp-time-zone: "UTC"2175# End:21762177# Set a version string.2178scriptversion='(GNU libtool) 2.4.6.40-6ca5'217921802181# func_echo ARG...2182# ----------------2183# Libtool also displays the current mode in messages, so override2184# funclib.sh func_echo with this custom definition.2185func_echo ()2186{2187$debug_cmd21882189_G_message=$*21902191func_echo_IFS=$IFS2192IFS=$nl2193for _G_line in $_G_message; do2194IFS=$func_echo_IFS2195$ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"2196done2197IFS=$func_echo_IFS2198}219922002201# func_warning ARG...2202# -------------------2203# Libtool warnings are not categorized, so override funclib.sh2204# func_warning with this simpler definition.2205func_warning ()2206{2207$debug_cmd22082209$warning_func ${1+"$@"}2210}221122122213## ---------------- ##2214## Options parsing. ##2215## ---------------- ##22162217# Hook in the functions to make sure our own options are parsed during2218# the option parsing loop.22192220usage='$progpath [OPTION]... [MODE-ARG]...'22212222# Short help message in response to '-h'.2223usage_message="Options:2224--config show all configuration variables2225--debug enable verbose shell tracing2226-n, --dry-run display commands without modifying any files2227--features display basic configuration information and exit2228--mode=MODE use operation mode MODE2229--no-warnings equivalent to '-Wnone'2230--preserve-dup-deps don't remove duplicate dependency libraries2231--quiet, --silent don't print informational messages2232--tag=TAG use configuration variables from tag TAG2233-v, --verbose print more informational messages than default2234--version print version information2235-W, --warnings=CATEGORY report the warnings falling in CATEGORY [all]2236-h, --help, --help-all print short, long, or detailed help message2237"22382239# Additional text appended to 'usage_message' in response to '--help'.2240func_help ()2241{2242$debug_cmd22432244func_usage_message2245$ECHO "$long_help_message22462247MODE must be one of the following:22482249clean remove files from the build directory2250compile compile a source file into a libtool object2251execute automatically set library path, then run a program2252finish complete the installation of libtool libraries2253install install libraries or executables2254link create a library or an executable2255uninstall remove libraries from an installed directory22562257MODE-ARGS vary depending on the MODE. When passed as first option,2258'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.2259Try '$progname --help --mode=MODE' for a more detailed description of MODE.22602261When reporting a bug, please describe a test case to reproduce it and2262include the following information:22632264host-triplet: $host2265shell: $SHELL2266compiler: $LTCC2267compiler flags: $LTCFLAGS2268linker: $LD (gnu? $with_gnu_ld)2269version: $progname (GNU libtool) 2.4.6.40-6ca52270automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`2271autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`22722273Report bugs to <[email protected]>.2274GNU libtool home page: <http://www.gnu.org/s/libtool/>.2275General help using GNU software: <http://www.gnu.org/gethelp/>."2276exit 02277}227822792280# func_lo2o OBJECT-NAME2281# ---------------------2282# Transform OBJECT-NAME from a '.lo' suffix to the platform specific2283# object suffix.22842285lo2o=s/\\.lo\$/.$objext/2286o2lo=s/\\.$objext\$/.lo/22872288if test yes = "$_G_HAVE_XSI_OPS"; then2289eval 'func_lo2o ()2290{2291case $1 in2292*.lo) func_lo2o_result=${1%.lo}.$objext ;;2293* ) func_lo2o_result=$1 ;;2294esac2295}'22962297# func_xform LIBOBJ-OR-SOURCE2298# ---------------------------2299# Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)2300# suffix to a '.lo' libtool-object suffix.2301eval 'func_xform ()2302{2303func_xform_result=${1%.*}.lo2304}'2305else2306# ...otherwise fall back to using sed.2307func_lo2o ()2308{2309func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`2310}23112312func_xform ()2313{2314func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`2315}2316fi231723182319# func_fatal_configuration ARG...2320# -------------------------------2321# Echo program name prefixed message to standard error, followed by2322# a configuration failure hint, and exit.2323func_fatal_configuration ()2324{2325func_fatal_error ${1+"$@"} \2326"See the $PACKAGE documentation for more information." \2327"Fatal configuration error."2328}232923302331# func_config2332# -----------2333# Display the configuration for all the tags in this script.2334func_config ()2335{2336re_begincf='^# ### BEGIN LIBTOOL'2337re_endcf='^# ### END LIBTOOL'23382339# Default configuration.2340$SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"23412342# Now print the configurations for the tags.2343for tagname in $taglist; do2344$SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"2345done23462347exit $?2348}234923502351# func_features2352# -------------2353# Display the features supported by this script.2354func_features ()2355{2356echo "host: $host"2357if test yes = "$build_libtool_libs"; then2358echo "enable shared libraries"2359else2360echo "disable shared libraries"2361fi2362if test yes = "$build_old_libs"; then2363echo "enable static libraries"2364else2365echo "disable static libraries"2366fi23672368exit $?2369}237023712372# func_enable_tag TAGNAME2373# -----------------------2374# Verify that TAGNAME is valid, and either flag an error and exit, or2375# enable the TAGNAME tag. We also add TAGNAME to the global $taglist2376# variable here.2377func_enable_tag ()2378{2379# Global variable:2380tagname=$123812382re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"2383re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"2384sed_extractcf=/$re_begincf/,/$re_endcf/p23852386# Validate tagname.2387case $tagname in2388*[!-_A-Za-z0-9,/]*)2389func_fatal_error "invalid tag name: $tagname"2390;;2391esac23922393# Don't test for the "default" C tag, as we know it's2394# there but not specially marked.2395case $tagname in2396CC) ;;2397*)2398if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then2399taglist="$taglist $tagname"24002401# Evaluate the configuration. Be careful to quote the path2402# and the sed script, to avoid splitting on whitespace, but2403# also don't use non-portable quotes within backquotes within2404# quotes we have to do it in 2 steps:2405extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`2406eval "$extractedcf"2407else2408func_error "ignoring unknown tag $tagname"2409fi2410;;2411esac2412}241324142415# func_check_version_match2416# ------------------------2417# Ensure that we are using m4 macros, and libtool script from the same2418# release of libtool.2419func_check_version_match ()2420{2421if test "$package_revision" != "$macro_revision"; then2422if test "$VERSION" != "$macro_version"; then2423if test -z "$macro_version"; then2424cat >&2 <<_LT_EOF2425$progname: Version mismatch error. This is $PACKAGE $VERSION, but the2426$progname: definition of this LT_INIT comes from an older release.2427$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION2428$progname: and run autoconf again.2429_LT_EOF2430else2431cat >&2 <<_LT_EOF2432$progname: Version mismatch error. This is $PACKAGE $VERSION, but the2433$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.2434$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION2435$progname: and run autoconf again.2436_LT_EOF2437fi2438else2439cat >&2 <<_LT_EOF2440$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,2441$progname: but the definition of this LT_INIT comes from revision $macro_revision.2442$progname: You should recreate aclocal.m4 with macros from revision $package_revision2443$progname: of $PACKAGE $VERSION and run autoconf again.2444_LT_EOF2445fi24462447exit $EXIT_MISMATCH2448fi2449}245024512452# libtool_options_prep [ARG]...2453# -----------------------------2454# Preparation for options parsed by libtool.2455libtool_options_prep ()2456{2457$debug_mode24582459# Option defaults:2460opt_config=false2461opt_dlopen=2462opt_dry_run=false2463opt_help=false2464opt_mode=2465opt_preserve_dup_deps=false2466opt_quiet=false24672468nonopt=2469preserve_args=24702471_G_rc_lt_options_prep=:24722473# Shorthand for --mode=foo, only valid as the first argument2474case $1 in2475clean|clea|cle|cl)2476shift; set dummy --mode clean ${1+"$@"}; shift2477;;2478compile|compil|compi|comp|com|co|c)2479shift; set dummy --mode compile ${1+"$@"}; shift2480;;2481execute|execut|execu|exec|exe|ex|e)2482shift; set dummy --mode execute ${1+"$@"}; shift2483;;2484finish|finis|fini|fin|fi|f)2485shift; set dummy --mode finish ${1+"$@"}; shift2486;;2487install|instal|insta|inst|ins|in|i)2488shift; set dummy --mode install ${1+"$@"}; shift2489;;2490link|lin|li|l)2491shift; set dummy --mode link ${1+"$@"}; shift2492;;2493uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)2494shift; set dummy --mode uninstall ${1+"$@"}; shift2495;;2496*)2497_G_rc_lt_options_prep=false2498;;2499esac25002501if $_G_rc_lt_options_prep; then2502# Pass back the list of options.2503func_quote eval ${1+"$@"}2504libtool_options_prep_result=$func_quote_result2505fi2506}2507func_add_hook func_options_prep libtool_options_prep250825092510# libtool_parse_options [ARG]...2511# ---------------------------------2512# Provide handling for libtool specific options.2513libtool_parse_options ()2514{2515$debug_cmd25162517_G_rc_lt_parse_options=false25182519# Perform our own loop to consume as many options as possible in2520# each iteration.2521while test $# -gt 0; do2522_G_match_lt_parse_options=:2523_G_opt=$12524shift2525case $_G_opt in2526--dry-run|--dryrun|-n)2527opt_dry_run=:2528;;25292530--config) func_config ;;25312532--dlopen|-dlopen)2533opt_dlopen="${opt_dlopen+$opt_dlopen2534}$1"2535shift2536;;25372538--preserve-dup-deps)2539opt_preserve_dup_deps=: ;;25402541--features) func_features ;;25422543--finish) set dummy --mode finish ${1+"$@"}; shift ;;25442545--help) opt_help=: ;;25462547--help-all) opt_help=': help-all' ;;25482549--mode) test $# = 0 && func_missing_arg $_G_opt && break2550opt_mode=$12551case $1 in2552# Valid mode arguments:2553clean|compile|execute|finish|install|link|relink|uninstall) ;;25542555# Catch anything else as an error2556*) func_error "invalid argument for $_G_opt"2557exit_cmd=exit2558break2559;;2560esac2561shift2562;;25632564--no-silent|--no-quiet)2565opt_quiet=false2566func_append preserve_args " $_G_opt"2567;;25682569--no-warnings|--no-warning|--no-warn)2570opt_warning=false2571func_append preserve_args " $_G_opt"2572;;25732574--no-verbose)2575opt_verbose=false2576func_append preserve_args " $_G_opt"2577;;25782579--silent|--quiet)2580opt_quiet=:2581opt_verbose=false2582func_append preserve_args " $_G_opt"2583;;25842585--tag) test $# = 0 && func_missing_arg $_G_opt && break2586opt_tag=$12587func_append preserve_args " $_G_opt $1"2588func_enable_tag "$1"2589shift2590;;25912592--verbose|-v) opt_quiet=false2593opt_verbose=:2594func_append preserve_args " $_G_opt"2595;;25962597# An option not handled by this hook function:2598*) set dummy "$_G_opt" ${1+"$@"} ; shift2599_G_match_lt_parse_options=false2600break2601;;2602esac2603$_G_match_lt_parse_options && _G_rc_lt_parse_options=:2604done26052606if $_G_rc_lt_parse_options; then2607# save modified positional parameters for caller2608func_quote eval ${1+"$@"}2609libtool_parse_options_result=$func_quote_result2610fi2611}2612func_add_hook func_parse_options libtool_parse_options2613261426152616# libtool_validate_options [ARG]...2617# ---------------------------------2618# Perform any sanity checks on option settings and/or unconsumed2619# arguments.2620libtool_validate_options ()2621{2622# save first non-option argument2623if test 0 -lt $#; then2624nonopt=$12625shift2626fi26272628# preserve --debug2629test : = "$debug_cmd" || func_append preserve_args " --debug"26302631case $host in2632# Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=164522633# see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=597882634*cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)2635# don't eliminate duplications in $postdeps and $predeps2636opt_duplicate_compiler_generated_deps=:2637;;2638*)2639opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps2640;;2641esac26422643$opt_help || {2644# Sanity checks first:2645func_check_version_match26462647test yes != "$build_libtool_libs" \2648&& test yes != "$build_old_libs" \2649&& func_fatal_configuration "not configured to build any kind of library"26502651# Darwin sucks2652eval std_shrext=\"$shrext_cmds\"26532654# Only execute mode is allowed to have -dlopen flags.2655if test -n "$opt_dlopen" && test execute != "$opt_mode"; then2656func_error "unrecognized option '-dlopen'"2657$ECHO "$help" 1>&22658exit $EXIT_FAILURE2659fi26602661# Change the help message to a mode-specific one.2662generic_help=$help2663help="Try '$progname --help --mode=$opt_mode' for more information."2664}26652666# Pass back the unparsed argument list2667func_quote eval ${1+"$@"}2668libtool_validate_options_result=$func_quote_result2669}2670func_add_hook func_validate_options libtool_validate_options267126722673# Process options as early as possible so that --help and --version2674# can return quickly.2675func_options ${1+"$@"}2676eval set dummy "$func_options_result"; shift2677267826792680## ----------- ##2681## Main. ##2682## ----------- ##26832684magic='%%%MAGIC variable%%%'2685magic_exe='%%%MAGIC EXE variable%%%'26862687# Global variables.2688extracted_archives=2689extracted_serial=026902691# If this variable is set in any of the actions, the command in it2692# will be execed at the end. This prevents here-documents from being2693# left over by shells.2694exec_cmd=269526962697# A function that is used when there is no print builtin or printf.2698func_fallback_echo ()2699{2700eval 'cat <<_LTECHO_EOF2701$12702_LTECHO_EOF'2703}27042705# func_generated_by_libtool2706# True iff stdin has been generated by Libtool. This function is only2707# a basic sanity check; it will hardly flush out determined imposters.2708func_generated_by_libtool_p ()2709{2710$GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&12711}27122713# func_lalib_p file2714# True iff FILE is a libtool '.la' library or '.lo' object file.2715# This function is only a basic sanity check; it will hardly flush out2716# determined imposters.2717func_lalib_p ()2718{2719test -f "$1" &&2720$SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p2721}27222723# func_lalib_unsafe_p file2724# True iff FILE is a libtool '.la' library or '.lo' object file.2725# This function implements the same check as func_lalib_p without2726# resorting to external programs. To this end, it redirects stdin and2727# closes it afterwards, without saving the original file descriptor.2728# As a safety measure, use it only where a negative result would be2729# fatal anyway. Works if 'file' does not exist.2730func_lalib_unsafe_p ()2731{2732lalib_p=no2733if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then2734for lalib_p_l in 1 2 3 42735do2736read lalib_p_line2737case $lalib_p_line in2738\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;2739esac2740done2741exec 0<&5 5<&-2742fi2743test yes = "$lalib_p"2744}27452746# func_ltwrapper_script_p file2747# True iff FILE is a libtool wrapper script2748# This function is only a basic sanity check; it will hardly flush out2749# determined imposters.2750func_ltwrapper_script_p ()2751{2752test -f "$1" &&2753$lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p2754}27552756# func_ltwrapper_executable_p file2757# True iff FILE is a libtool wrapper executable2758# This function is only a basic sanity check; it will hardly flush out2759# determined imposters.2760func_ltwrapper_executable_p ()2761{2762func_ltwrapper_exec_suffix=2763case $1 in2764*.exe) ;;2765*) func_ltwrapper_exec_suffix=.exe ;;2766esac2767$GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&12768}27692770# func_ltwrapper_scriptname file2771# Assumes file is an ltwrapper_executable2772# uses $file to determine the appropriate filename for a2773# temporary ltwrapper_script.2774func_ltwrapper_scriptname ()2775{2776func_dirname_and_basename "$1" "" "."2777func_stripname '' '.exe' "$func_basename_result"2778func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper2779}27802781# func_ltwrapper_p file2782# True iff FILE is a libtool wrapper script or wrapper executable2783# This function is only a basic sanity check; it will hardly flush out2784# determined imposters.2785func_ltwrapper_p ()2786{2787func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"2788}278927902791# func_execute_cmds commands fail_cmd2792# Execute tilde-delimited COMMANDS.2793# If FAIL_CMD is given, eval that upon failure.2794# FAIL_CMD may read-access the current command in variable CMD!2795func_execute_cmds ()2796{2797$debug_cmd27982799save_ifs=$IFS; IFS='~'2800for cmd in $1; do2801IFS=$sp$nl2802eval cmd=\"$cmd\"2803IFS=$save_ifs2804func_show_eval "$cmd" "${2-:}"2805done2806IFS=$save_ifs2807}280828092810# func_source file2811# Source FILE, adding directory component if necessary.2812# Note that it is not necessary on cygwin/mingw to append a dot to2813# FILE even if both FILE and FILE.exe exist: automatic-append-.exe2814# behavior happens only for exec(3), not for open(2)! Also, sourcing2815# 'FILE.' does not work on cygwin managed mounts.2816func_source ()2817{2818$debug_cmd28192820case $1 in2821*/* | *\\*) . "$1" ;;2822*) . "./$1" ;;2823esac2824}282528262827# func_resolve_sysroot PATH2828# Replace a leading = in PATH with a sysroot. Store the result into2829# func_resolve_sysroot_result2830func_resolve_sysroot ()2831{2832func_resolve_sysroot_result=$12833case $func_resolve_sysroot_result in2834=*)2835func_stripname '=' '' "$func_resolve_sysroot_result"2836func_resolve_sysroot_result=$lt_sysroot$func_stripname_result2837;;2838esac2839}28402841# func_replace_sysroot PATH2842# If PATH begins with the sysroot, replace it with = and2843# store the result into func_replace_sysroot_result.2844func_replace_sysroot ()2845{2846case $lt_sysroot:$1 in2847?*:"$lt_sysroot"*)2848func_stripname "$lt_sysroot" '' "$1"2849func_replace_sysroot_result='='$func_stripname_result2850;;2851*)2852# Including no sysroot.2853func_replace_sysroot_result=$12854;;2855esac2856}28572858# func_infer_tag arg2859# Infer tagged configuration to use if any are available and2860# if one wasn't chosen via the "--tag" command line option.2861# Only attempt this if the compiler in the base compile2862# command doesn't match the default compiler.2863# arg is usually of the form 'gcc ...'2864func_infer_tag ()2865{2866$debug_cmd28672868if test -n "$available_tags" && test -z "$tagname"; then2869CC_quoted=2870for arg in $CC; do2871func_append_quoted CC_quoted "$arg"2872done2873CC_expanded=`func_echo_all $CC`2874CC_quoted_expanded=`func_echo_all $CC_quoted`2875case $@ in2876# Blanks in the command may have been stripped by the calling shell,2877# but not from the CC environment variable when configure was run.2878" $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \2879" $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;2880# Blanks at the start of $base_compile will cause this to fail2881# if we don't check for them as well.2882*)2883for z in $available_tags; do2884if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then2885# Evaluate the configuration.2886eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"2887CC_quoted=2888for arg in $CC; do2889# Double-quote args containing other shell metacharacters.2890func_append_quoted CC_quoted "$arg"2891done2892CC_expanded=`func_echo_all $CC`2893CC_quoted_expanded=`func_echo_all $CC_quoted`2894case "$@ " in2895" $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \2896" $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)2897# The compiler in the base compile command matches2898# the one in the tagged configuration.2899# Assume this is the tagged configuration we want.2900tagname=$z2901break2902;;2903esac2904fi2905done2906# If $tagname still isn't set, then no tagged configuration2907# was found and let the user know that the "--tag" command2908# line option must be used.2909if test -z "$tagname"; then2910func_echo "unable to infer tagged configuration"2911func_fatal_error "specify a tag with '--tag'"2912# else2913# func_verbose "using $tagname tagged configuration"2914fi2915;;2916esac2917fi2918}2919292029212922# func_write_libtool_object output_name pic_name nonpic_name2923# Create a libtool object file (analogous to a ".la" file),2924# but don't create it if we're doing a dry run.2925func_write_libtool_object ()2926{2927write_libobj=$12928if test yes = "$build_libtool_libs"; then2929write_lobj=\'$2\'2930else2931write_lobj=none2932fi29332934if test yes = "$build_old_libs"; then2935write_oldobj=\'$3\'2936else2937write_oldobj=none2938fi29392940$opt_dry_run || {2941cat >${write_libobj}T <<EOF2942# $write_libobj - a libtool object file2943# Generated by $PROGRAM (GNU $PACKAGE) $VERSION2944#2945# Please DO NOT delete this file!2946# It is necessary for linking the library.29472948# Name of the PIC object.2949pic_object=$write_lobj29502951# Name of the non-PIC object2952non_pic_object=$write_oldobj29532954EOF2955$MV "${write_libobj}T" "$write_libobj"2956}2957}295829592960##################################################2961# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #2962##################################################29632964# func_convert_core_file_wine_to_w32 ARG2965# Helper function used by file name conversion functions when $build is *nix,2966# and $host is mingw, cygwin, or some other w32 environment. Relies on a2967# correctly configured wine environment available, with the winepath program2968# in $build's $PATH.2969#2970# ARG is the $build file name to be converted to w32 format.2971# Result is available in $func_convert_core_file_wine_to_w32_result, and will2972# be empty on error (or when ARG is empty)2973func_convert_core_file_wine_to_w32 ()2974{2975$debug_cmd29762977func_convert_core_file_wine_to_w32_result=$12978if test -n "$1"; then2979# Unfortunately, winepath does not exit with a non-zero error code, so we2980# are forced to check the contents of stdout. On the other hand, if the2981# command is not found, the shell will set an exit code of 127 and print2982# *an error message* to stdout. So we must check for both error code of2983# zero AND non-empty stdout, which explains the odd construction:2984func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`2985if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then2986func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |2987$SED -e "$sed_naive_backslashify"`2988else2989func_convert_core_file_wine_to_w32_result=2990fi2991fi2992}2993# end: func_convert_core_file_wine_to_w32299429952996# func_convert_core_path_wine_to_w32 ARG2997# Helper function used by path conversion functions when $build is *nix, and2998# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly2999# configured wine environment available, with the winepath program in $build's3000# $PATH. Assumes ARG has no leading or trailing path separator characters.3001#3002# ARG is path to be converted from $build format to win32.3003# Result is available in $func_convert_core_path_wine_to_w32_result.3004# Unconvertible file (directory) names in ARG are skipped; if no directory names3005# are convertible, then the result may be empty.3006func_convert_core_path_wine_to_w32 ()3007{3008$debug_cmd30093010# unfortunately, winepath doesn't convert paths, only file names3011func_convert_core_path_wine_to_w32_result=3012if test -n "$1"; then3013oldIFS=$IFS3014IFS=:3015for func_convert_core_path_wine_to_w32_f in $1; do3016IFS=$oldIFS3017func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"3018if test -n "$func_convert_core_file_wine_to_w32_result"; then3019if test -z "$func_convert_core_path_wine_to_w32_result"; then3020func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result3021else3022func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"3023fi3024fi3025done3026IFS=$oldIFS3027fi3028}3029# end: func_convert_core_path_wine_to_w32303030313032# func_cygpath ARGS...3033# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when3034# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)3035# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or3036# (2), returns the Cygwin file name or path in func_cygpath_result (input3037# file name or path is assumed to be in w32 format, as previously converted3038# from $build's *nix or MSYS format). In case (3), returns the w32 file name3039# or path in func_cygpath_result (input file name or path is assumed to be in3040# Cygwin format). Returns an empty string on error.3041#3042# ARGS are passed to cygpath, with the last one being the file name or path to3043# be converted.3044#3045# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH3046# environment variable; do not put it in $PATH.3047func_cygpath ()3048{3049$debug_cmd30503051if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then3052func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`3053if test "$?" -ne 0; then3054# on failure, ensure result is empty3055func_cygpath_result=3056fi3057else3058func_cygpath_result=3059func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"3060fi3061}3062#end: func_cygpath306330643065# func_convert_core_msys_to_w32 ARG3066# Convert file name or path ARG from MSYS format to w32 format. Return3067# result in func_convert_core_msys_to_w32_result.3068func_convert_core_msys_to_w32 ()3069{3070$debug_cmd30713072# awkward: cmd appends spaces to result3073func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |3074$SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`3075}3076#end: func_convert_core_msys_to_w32307730783079# func_convert_file_check ARG1 ARG23080# Verify that ARG1 (a file name in $build format) was converted to $host3081# format in ARG2. Otherwise, emit an error message, but continue (resetting3082# func_to_host_file_result to ARG1).3083func_convert_file_check ()3084{3085$debug_cmd30863087if test -z "$2" && test -n "$1"; then3088func_error "Could not determine host file name corresponding to"3089func_error " '$1'"3090func_error "Continuing, but uninstalled executables may not work."3091# Fallback:3092func_to_host_file_result=$13093fi3094}3095# end func_convert_file_check309630973098# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH3099# Verify that FROM_PATH (a path in $build format) was converted to $host3100# format in TO_PATH. Otherwise, emit an error message, but continue, resetting3101# func_to_host_file_result to a simplistic fallback value (see below).3102func_convert_path_check ()3103{3104$debug_cmd31053106if test -z "$4" && test -n "$3"; then3107func_error "Could not determine the host path corresponding to"3108func_error " '$3'"3109func_error "Continuing, but uninstalled executables may not work."3110# Fallback. This is a deliberately simplistic "conversion" and3111# should not be "improved". See libtool.info.3112if test "x$1" != "x$2"; then3113lt_replace_pathsep_chars="s|$1|$2|g"3114func_to_host_path_result=`echo "$3" |3115$SED -e "$lt_replace_pathsep_chars"`3116else3117func_to_host_path_result=$33118fi3119fi3120}3121# end func_convert_path_check312231233124# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG3125# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT3126# and appending REPL if ORIG matches BACKPAT.3127func_convert_path_front_back_pathsep ()3128{3129$debug_cmd31303131case $4 in3132$1 ) func_to_host_path_result=$3$func_to_host_path_result3133;;3134esac3135case $4 in3136$2 ) func_append func_to_host_path_result "$3"3137;;3138esac3139}3140# end func_convert_path_front_back_pathsep314131423143##################################################3144# $build to $host FILE NAME CONVERSION FUNCTIONS #3145##################################################3146# invoked via '$to_host_file_cmd ARG'3147#3148# In each case, ARG is the path to be converted from $build to $host format.3149# Result will be available in $func_to_host_file_result.315031513152# func_to_host_file ARG3153# Converts the file name ARG from $build format to $host format. Return result3154# in func_to_host_file_result.3155func_to_host_file ()3156{3157$debug_cmd31583159$to_host_file_cmd "$1"3160}3161# end func_to_host_file316231633164# func_to_tool_file ARG LAZY3165# converts the file name ARG from $build format to toolchain format. Return3166# result in func_to_tool_file_result. If the conversion in use is listed3167# in (the comma separated) LAZY, no conversion takes place.3168func_to_tool_file ()3169{3170$debug_cmd31713172case ,$2, in3173*,"$to_tool_file_cmd",*)3174func_to_tool_file_result=$13175;;3176*)3177$to_tool_file_cmd "$1"3178func_to_tool_file_result=$func_to_host_file_result3179;;3180esac3181}3182# end func_to_tool_file318331843185# func_convert_file_noop ARG3186# Copy ARG to func_to_host_file_result.3187func_convert_file_noop ()3188{3189func_to_host_file_result=$13190}3191# end func_convert_file_noop319231933194# func_convert_file_msys_to_w32 ARG3195# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic3196# conversion to w32 is not available inside the cwrapper. Returns result in3197# func_to_host_file_result.3198func_convert_file_msys_to_w32 ()3199{3200$debug_cmd32013202func_to_host_file_result=$13203if test -n "$1"; then3204func_convert_core_msys_to_w32 "$1"3205func_to_host_file_result=$func_convert_core_msys_to_w32_result3206fi3207func_convert_file_check "$1" "$func_to_host_file_result"3208}3209# end func_convert_file_msys_to_w32321032113212# func_convert_file_cygwin_to_w32 ARG3213# Convert file name ARG from Cygwin to w32 format. Returns result in3214# func_to_host_file_result.3215func_convert_file_cygwin_to_w32 ()3216{3217$debug_cmd32183219func_to_host_file_result=$13220if test -n "$1"; then3221# because $build is cygwin, we call "the" cygpath in $PATH; no need to use3222# LT_CYGPATH in this case.3223func_to_host_file_result=`cygpath -m "$1"`3224fi3225func_convert_file_check "$1" "$func_to_host_file_result"3226}3227# end func_convert_file_cygwin_to_w32322832293230# func_convert_file_nix_to_w32 ARG3231# Convert file name ARG from *nix to w32 format. Requires a wine environment3232# and a working winepath. Returns result in func_to_host_file_result.3233func_convert_file_nix_to_w32 ()3234{3235$debug_cmd32363237func_to_host_file_result=$13238if test -n "$1"; then3239func_convert_core_file_wine_to_w32 "$1"3240func_to_host_file_result=$func_convert_core_file_wine_to_w32_result3241fi3242func_convert_file_check "$1" "$func_to_host_file_result"3243}3244# end func_convert_file_nix_to_w32324532463247# func_convert_file_msys_to_cygwin ARG3248# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.3249# Returns result in func_to_host_file_result.3250func_convert_file_msys_to_cygwin ()3251{3252$debug_cmd32533254func_to_host_file_result=$13255if test -n "$1"; then3256func_convert_core_msys_to_w32 "$1"3257func_cygpath -u "$func_convert_core_msys_to_w32_result"3258func_to_host_file_result=$func_cygpath_result3259fi3260func_convert_file_check "$1" "$func_to_host_file_result"3261}3262# end func_convert_file_msys_to_cygwin326332643265# func_convert_file_nix_to_cygwin ARG3266# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed3267# in a wine environment, working winepath, and LT_CYGPATH set. Returns result3268# in func_to_host_file_result.3269func_convert_file_nix_to_cygwin ()3270{3271$debug_cmd32723273func_to_host_file_result=$13274if test -n "$1"; then3275# convert from *nix to w32, then use cygpath to convert from w32 to cygwin.3276func_convert_core_file_wine_to_w32 "$1"3277func_cygpath -u "$func_convert_core_file_wine_to_w32_result"3278func_to_host_file_result=$func_cygpath_result3279fi3280func_convert_file_check "$1" "$func_to_host_file_result"3281}3282# end func_convert_file_nix_to_cygwin328332843285#############################################3286# $build to $host PATH CONVERSION FUNCTIONS #3287#############################################3288# invoked via '$to_host_path_cmd ARG'3289#3290# In each case, ARG is the path to be converted from $build to $host format.3291# The result will be available in $func_to_host_path_result.3292#3293# Path separators are also converted from $build format to $host format. If3294# ARG begins or ends with a path separator character, it is preserved (but3295# converted to $host format) on output.3296#3297# All path conversion functions are named using the following convention:3298# file name conversion function : func_convert_file_X_to_Y ()3299# path conversion function : func_convert_path_X_to_Y ()3300# where, for any given $build/$host combination the 'X_to_Y' value is the3301# same. If conversion functions are added for new $build/$host combinations,3302# the two new functions must follow this pattern, or func_init_to_host_path_cmd3303# will break.330433053306# func_init_to_host_path_cmd3307# Ensures that function "pointer" variable $to_host_path_cmd is set to the3308# appropriate value, based on the value of $to_host_file_cmd.3309to_host_path_cmd=3310func_init_to_host_path_cmd ()3311{3312$debug_cmd33133314if test -z "$to_host_path_cmd"; then3315func_stripname 'func_convert_file_' '' "$to_host_file_cmd"3316to_host_path_cmd=func_convert_path_$func_stripname_result3317fi3318}331933203321# func_to_host_path ARG3322# Converts the path ARG from $build format to $host format. Return result3323# in func_to_host_path_result.3324func_to_host_path ()3325{3326$debug_cmd33273328func_init_to_host_path_cmd3329$to_host_path_cmd "$1"3330}3331# end func_to_host_path333233333334# func_convert_path_noop ARG3335# Copy ARG to func_to_host_path_result.3336func_convert_path_noop ()3337{3338func_to_host_path_result=$13339}3340# end func_convert_path_noop334133423343# func_convert_path_msys_to_w32 ARG3344# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic3345# conversion to w32 is not available inside the cwrapper. Returns result in3346# func_to_host_path_result.3347func_convert_path_msys_to_w32 ()3348{3349$debug_cmd33503351func_to_host_path_result=$13352if test -n "$1"; then3353# Remove leading and trailing path separator characters from ARG. MSYS3354# behavior is inconsistent here; cygpath turns them into '.;' and ';.';3355# and winepath ignores them completely.3356func_stripname : : "$1"3357func_to_host_path_tmp1=$func_stripname_result3358func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"3359func_to_host_path_result=$func_convert_core_msys_to_w32_result3360func_convert_path_check : ";" \3361"$func_to_host_path_tmp1" "$func_to_host_path_result"3362func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"3363fi3364}3365# end func_convert_path_msys_to_w32336633673368# func_convert_path_cygwin_to_w32 ARG3369# Convert path ARG from Cygwin to w32 format. Returns result in3370# func_to_host_file_result.3371func_convert_path_cygwin_to_w32 ()3372{3373$debug_cmd33743375func_to_host_path_result=$13376if test -n "$1"; then3377# See func_convert_path_msys_to_w32:3378func_stripname : : "$1"3379func_to_host_path_tmp1=$func_stripname_result3380func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`3381func_convert_path_check : ";" \3382"$func_to_host_path_tmp1" "$func_to_host_path_result"3383func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"3384fi3385}3386# end func_convert_path_cygwin_to_w32338733883389# func_convert_path_nix_to_w32 ARG3390# Convert path ARG from *nix to w32 format. Requires a wine environment and3391# a working winepath. Returns result in func_to_host_file_result.3392func_convert_path_nix_to_w32 ()3393{3394$debug_cmd33953396func_to_host_path_result=$13397if test -n "$1"; then3398# See func_convert_path_msys_to_w32:3399func_stripname : : "$1"3400func_to_host_path_tmp1=$func_stripname_result3401func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"3402func_to_host_path_result=$func_convert_core_path_wine_to_w32_result3403func_convert_path_check : ";" \3404"$func_to_host_path_tmp1" "$func_to_host_path_result"3405func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"3406fi3407}3408# end func_convert_path_nix_to_w32340934103411# func_convert_path_msys_to_cygwin ARG3412# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.3413# Returns result in func_to_host_file_result.3414func_convert_path_msys_to_cygwin ()3415{3416$debug_cmd34173418func_to_host_path_result=$13419if test -n "$1"; then3420# See func_convert_path_msys_to_w32:3421func_stripname : : "$1"3422func_to_host_path_tmp1=$func_stripname_result3423func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"3424func_cygpath -u -p "$func_convert_core_msys_to_w32_result"3425func_to_host_path_result=$func_cygpath_result3426func_convert_path_check : : \3427"$func_to_host_path_tmp1" "$func_to_host_path_result"3428func_convert_path_front_back_pathsep ":*" "*:" : "$1"3429fi3430}3431# end func_convert_path_msys_to_cygwin343234333434# func_convert_path_nix_to_cygwin ARG3435# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a3436# a wine environment, working winepath, and LT_CYGPATH set. Returns result in3437# func_to_host_file_result.3438func_convert_path_nix_to_cygwin ()3439{3440$debug_cmd34413442func_to_host_path_result=$13443if test -n "$1"; then3444# Remove leading and trailing path separator characters from3445# ARG. msys behavior is inconsistent here, cygpath turns them3446# into '.;' and ';.', and winepath ignores them completely.3447func_stripname : : "$1"3448func_to_host_path_tmp1=$func_stripname_result3449func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"3450func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"3451func_to_host_path_result=$func_cygpath_result3452func_convert_path_check : : \3453"$func_to_host_path_tmp1" "$func_to_host_path_result"3454func_convert_path_front_back_pathsep ":*" "*:" : "$1"3455fi3456}3457# end func_convert_path_nix_to_cygwin345834593460# func_dll_def_p FILE3461# True iff FILE is a Windows DLL '.def' file.3462# Keep in sync with _LT_DLL_DEF_P in libtool.m43463func_dll_def_p ()3464{3465$debug_cmd34663467func_dll_def_p_tmp=`$SED -n \3468-e 's/^[ ]*//' \3469-e '/^\(;.*\)*$/d' \3470-e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \3471-e q \3472"$1"`3473test DEF = "$func_dll_def_p_tmp"3474}347534763477# func_mode_compile arg...3478func_mode_compile ()3479{3480$debug_cmd34813482# Get the compilation command and the source file.3483base_compile=3484srcfile=$nonopt # always keep a non-empty value in "srcfile"3485suppress_opt=yes3486suppress_output=3487arg_mode=normal3488libobj=3489later=3490pie_flag=34913492for arg3493do3494case $arg_mode in3495arg )3496# do not "continue". Instead, add this to base_compile3497lastarg=$arg3498arg_mode=normal3499;;35003501target )3502libobj=$arg3503arg_mode=normal3504continue3505;;35063507normal )3508# Accept any command-line options.3509case $arg in3510-o)3511test -n "$libobj" && \3512func_fatal_error "you cannot specify '-o' more than once"3513arg_mode=target3514continue3515;;35163517-pie | -fpie | -fPIE)3518func_append pie_flag " $arg"3519continue3520;;35213522-shared | -static | -prefer-pic | -prefer-non-pic)3523func_append later " $arg"3524continue3525;;35263527-no-suppress)3528suppress_opt=no3529continue3530;;35313532-Xcompiler)3533arg_mode=arg # the next one goes into the "base_compile" arg list3534continue # The current "srcfile" will either be retained or3535;; # replaced later. I would guess that would be a bug.35363537-Wc,*)3538func_stripname '-Wc,' '' "$arg"3539args=$func_stripname_result3540lastarg=3541save_ifs=$IFS; IFS=,3542for arg in $args; do3543IFS=$save_ifs3544func_append_quoted lastarg "$arg"3545done3546IFS=$save_ifs3547func_stripname ' ' '' "$lastarg"3548lastarg=$func_stripname_result35493550# Add the arguments to base_compile.3551func_append base_compile " $lastarg"3552continue3553;;35543555*)3556# Accept the current argument as the source file.3557# The previous "srcfile" becomes the current argument.3558#3559lastarg=$srcfile3560srcfile=$arg3561;;3562esac # case $arg3563;;3564esac # case $arg_mode35653566# Aesthetically quote the previous argument.3567func_append_quoted base_compile "$lastarg"3568done # for arg35693570case $arg_mode in3571arg)3572func_fatal_error "you must specify an argument for -Xcompile"3573;;3574target)3575func_fatal_error "you must specify a target with '-o'"3576;;3577*)3578# Get the name of the library object.3579test -z "$libobj" && {3580func_basename "$srcfile"3581libobj=$func_basename_result3582}3583;;3584esac35853586# Recognize several different file suffixes.3587# If the user specifies -o file.o, it is replaced with file.lo3588case $libobj in3589*.[cCFSifmso] | \3590*.ada | *.adb | *.ads | *.asm | \3591*.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \3592*.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)3593func_xform "$libobj"3594libobj=$func_xform_result3595;;3596esac35973598case $libobj in3599*.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;3600*)3601func_fatal_error "cannot determine name of library object from '$libobj'"3602;;3603esac36043605func_infer_tag $base_compile36063607for arg in $later; do3608case $arg in3609-shared)3610test yes = "$build_libtool_libs" \3611|| func_fatal_configuration "cannot build a shared library"3612build_old_libs=no3613continue3614;;36153616-static)3617build_libtool_libs=no3618build_old_libs=yes3619continue3620;;36213622-prefer-pic)3623pic_mode=yes3624continue3625;;36263627-prefer-non-pic)3628pic_mode=no3629continue3630;;3631esac3632done36333634func_quote_arg pretty "$libobj"3635test "X$libobj" != "X$func_quote_arg_result" \3636&& $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \3637&& func_warning "libobj name '$libobj' may not contain shell special characters."3638func_dirname_and_basename "$obj" "/" ""3639objname=$func_basename_result3640xdir=$func_dirname_result3641lobj=$xdir$objdir/$objname36423643test -z "$base_compile" && \3644func_fatal_help "you must specify a compilation command"36453646# Delete any leftover library objects.3647if test yes = "$build_old_libs"; then3648removelist="$obj $lobj $libobj ${libobj}T"3649else3650removelist="$lobj $libobj ${libobj}T"3651fi36523653# On Cygwin there's no "real" PIC flag so we must build both object types3654case $host_os in3655cygwin* | mingw* | pw32* | os2* | cegcc*)3656pic_mode=default3657;;3658esac3659if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then3660# non-PIC code in shared libraries is not supported3661pic_mode=default3662fi36633664# Calculate the filename of the output object if compiler does3665# not support -o with -c3666if test no = "$compiler_c_o"; then3667output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext3668lockfile=$output_obj.lock3669else3670output_obj=3671need_locks=no3672lockfile=3673fi36743675# Lock this critical section if it is needed3676# We use this script file to make the link, it avoids creating a new file3677if test yes = "$need_locks"; then3678until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do3679func_echo "Waiting for $lockfile to be removed"3680sleep 23681done3682elif test warn = "$need_locks"; then3683if test -f "$lockfile"; then3684$ECHO "\3685*** ERROR, $lockfile exists and contains:3686`cat $lockfile 2>/dev/null`36873688This indicates that another process is trying to use the same3689temporary object file, and libtool could not work around it because3690your compiler does not support '-c' and '-o' together. If you3691repeat this compilation, it may succeed, by chance, but you had better3692avoid parallel builds (make -j) in this platform, or get a better3693compiler."36943695$opt_dry_run || $RM $removelist3696exit $EXIT_FAILURE3697fi3698func_append removelist " $output_obj"3699$ECHO "$srcfile" > "$lockfile"3700fi37013702$opt_dry_run || $RM $removelist3703func_append removelist " $lockfile"3704trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 1537053706func_to_tool_file "$srcfile" func_convert_file_msys_to_w323707srcfile=$func_to_tool_file_result3708func_quote_arg pretty "$srcfile"3709qsrcfile=$func_quote_arg_result37103711# Only build a PIC object if we are building libtool libraries.3712if test yes = "$build_libtool_libs"; then3713# Without this assignment, base_compile gets emptied.3714fbsd_hideous_sh_bug=$base_compile37153716if test no != "$pic_mode"; then3717command="$base_compile $qsrcfile $pic_flag"3718else3719# Don't build PIC code3720command="$base_compile $qsrcfile"3721fi37223723func_mkdir_p "$xdir$objdir"37243725if test -z "$output_obj"; then3726# Place PIC objects in $objdir3727func_append command " -o $lobj"3728fi37293730func_show_eval_locale "$command" \3731'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'37323733if test warn = "$need_locks" &&3734test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then3735$ECHO "\3736*** ERROR, $lockfile contains:3737`cat $lockfile 2>/dev/null`37383739but it should contain:3740$srcfile37413742This indicates that another process is trying to use the same3743temporary object file, and libtool could not work around it because3744your compiler does not support '-c' and '-o' together. If you3745repeat this compilation, it may succeed, by chance, but you had better3746avoid parallel builds (make -j) in this platform, or get a better3747compiler."37483749$opt_dry_run || $RM $removelist3750exit $EXIT_FAILURE3751fi37523753# Just move the object if needed, then go on to compile the next one3754if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then3755func_show_eval '$MV "$output_obj" "$lobj"' \3756'error=$?; $opt_dry_run || $RM $removelist; exit $error'3757fi37583759# Allow error messages only from the first compilation.3760if test yes = "$suppress_opt"; then3761suppress_output=' >/dev/null 2>&1'3762fi3763fi37643765# Only build a position-dependent object if we build old libraries.3766if test yes = "$build_old_libs"; then3767if test yes != "$pic_mode"; then3768# Don't build PIC code3769command="$base_compile $qsrcfile$pie_flag"3770else3771command="$base_compile $qsrcfile $pic_flag"3772fi3773if test yes = "$compiler_c_o"; then3774func_append command " -o $obj"3775fi37763777# Suppress compiler output if we already did a PIC compilation.3778func_append command "$suppress_output"3779func_show_eval_locale "$command" \3780'$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'37813782if test warn = "$need_locks" &&3783test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then3784$ECHO "\3785*** ERROR, $lockfile contains:3786`cat $lockfile 2>/dev/null`37873788but it should contain:3789$srcfile37903791This indicates that another process is trying to use the same3792temporary object file, and libtool could not work around it because3793your compiler does not support '-c' and '-o' together. If you3794repeat this compilation, it may succeed, by chance, but you had better3795avoid parallel builds (make -j) in this platform, or get a better3796compiler."37973798$opt_dry_run || $RM $removelist3799exit $EXIT_FAILURE3800fi38013802# Just move the object if needed3803if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then3804func_show_eval '$MV "$output_obj" "$obj"' \3805'error=$?; $opt_dry_run || $RM $removelist; exit $error'3806fi3807fi38083809$opt_dry_run || {3810func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"38113812# Unlock the critical section if it was locked3813if test no != "$need_locks"; then3814removelist=$lockfile3815$RM "$lockfile"3816fi3817}38183819exit $EXIT_SUCCESS3820}38213822$opt_help || {3823test compile = "$opt_mode" && func_mode_compile ${1+"$@"}3824}38253826func_mode_help ()3827{3828# We need to display help for each of the modes.3829case $opt_mode in3830"")3831# Generic help is extracted from the usage comments3832# at the start of this file.3833func_help3834;;38353836clean)3837$ECHO \3838"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...38393840Remove files from the build directory.38413842RM is the name of the program to use to delete files associated with each FILE3843(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed3844to RM.38453846If FILE is a libtool library, object or program, all the files associated3847with it are deleted. Otherwise, only FILE itself is deleted using RM."3848;;38493850compile)3851$ECHO \3852"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE38533854Compile a source file into a libtool library object.38553856This mode accepts the following additional options:38573858-o OUTPUT-FILE set the output file name to OUTPUT-FILE3859-no-suppress do not suppress compiler output for multiple passes3860-prefer-pic try to build PIC objects only3861-prefer-non-pic try to build non-PIC objects only3862-shared do not build a '.o' file suitable for static linking3863-static only build a '.o' file suitable for static linking3864-Wc,FLAG pass FLAG directly to the compiler38653866COMPILE-COMMAND is a command to be used in creating a 'standard' object file3867from the given SOURCEFILE.38683869The output file name is determined by removing the directory component from3870SOURCEFILE, then substituting the C source code suffix '.c' with the3871library object suffix, '.lo'."3872;;38733874execute)3875$ECHO \3876"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...38773878Automatically set library path, then run a program.38793880This mode accepts the following additional options:38813882-dlopen FILE add the directory containing FILE to the library path38833884This mode sets the library path environment variable according to '-dlopen'3885flags.38863887If any of the ARGS are libtool executable wrappers, then they are translated3888into their corresponding uninstalled binary, and any of their required library3889directories are added to the library path.38903891Then, COMMAND is executed, with ARGS as arguments."3892;;38933894finish)3895$ECHO \3896"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...38973898Complete the installation of libtool libraries.38993900Each LIBDIR is a directory that contains libtool libraries.39013902The commands that this mode executes may require superuser privileges. Use3903the '--dry-run' option if you just want to see what would be executed."3904;;39053906install)3907$ECHO \3908"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...39093910Install executables or libraries.39113912INSTALL-COMMAND is the installation command. The first component should be3913either the 'install' or 'cp' program.39143915The following components of INSTALL-COMMAND are treated specially:39163917-inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation39183919The rest of the components are interpreted as arguments to that command (only3920BSD-compatible install options are recognized)."3921;;39223923link)3924$ECHO \3925"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...39263927Link object files or libraries together to form another library, or to3928create an executable program.39293930LINK-COMMAND is a command using the C compiler that you would use to create3931a program from several object files.39323933The following components of LINK-COMMAND are treated specially:39343935-all-static do not do any dynamic linking at all3936-avoid-version do not add a version suffix if possible3937-bindir BINDIR specify path to binaries directory (for systems where3938libraries must be found in the PATH setting at runtime)3939-dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime3940-dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols3941-export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)3942-export-symbols SYMFILE3943try to export only the symbols listed in SYMFILE3944-export-symbols-regex REGEX3945try to export only the symbols matching REGEX3946-LLIBDIR search LIBDIR for required installed libraries3947-lNAME OUTPUT-FILE requires the installed library libNAME3948-module build a library that can dlopened3949-no-fast-install disable the fast-install mode3950-no-install link a not-installable executable3951-no-undefined declare that a library does not refer to external symbols3952-o OUTPUT-FILE create OUTPUT-FILE from the specified objects3953-objectlist FILE use a list of object files found in FILE to specify objects3954-os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes)3955-precious-files-regex REGEX3956don't remove output files matching REGEX3957-release RELEASE specify package release information3958-rpath LIBDIR the created library will eventually be installed in LIBDIR3959-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries3960-shared only do dynamic linking of libtool libraries3961-shrext SUFFIX override the standard shared library file extension3962-static do not do any dynamic linking of uninstalled libtool libraries3963-static-libtool-libs3964do not do any dynamic linking of libtool libraries3965-version-info CURRENT[:REVISION[:AGE]]3966specify library version info [each variable defaults to 0]3967-weak LIBNAME declare that the target provides the LIBNAME interface3968-Wc,FLAG3969-Xcompiler FLAG pass linker-specific FLAG directly to the compiler3970-Wl,FLAG3971-Xlinker FLAG pass linker-specific FLAG directly to the linker3972-XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)39733974All other options (arguments beginning with '-') are ignored.39753976Every other argument is treated as a filename. Files ending in '.la' are3977treated as uninstalled libtool libraries, other files are standard or library3978object files.39793980If the OUTPUT-FILE ends in '.la', then a libtool library is created,3981only library objects ('.lo' files) may be specified, and '-rpath' is3982required, except when creating a convenience library.39833984If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created3985using 'ar' and 'ranlib', or on Windows using 'lib'.39863987If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file3988is created, otherwise an executable program is created."3989;;39903991uninstall)3992$ECHO \3993"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...39943995Remove libraries from an installation directory.39963997RM is the name of the program to use to delete files associated with each FILE3998(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed3999to RM.40004001If FILE is a libtool library, all the files associated with it are deleted.4002Otherwise, only FILE itself is deleted using RM."4003;;40044005*)4006func_fatal_help "invalid operation mode '$opt_mode'"4007;;4008esac40094010echo4011$ECHO "Try '$progname --help' for more information about other modes."4012}40134014# Now that we've collected a possible --mode arg, show help if necessary4015if $opt_help; then4016if test : = "$opt_help"; then4017func_mode_help4018else4019{4020func_help noexit4021for opt_mode in compile link execute install finish uninstall clean; do4022func_mode_help4023done4024} | $SED -n '1p; 2,$s/^Usage:/ or: /p'4025{4026func_help noexit4027for opt_mode in compile link execute install finish uninstall clean; do4028echo4029func_mode_help4030done4031} |4032$SED '1d4033/^When reporting/,/^Report/{4034H4035d4036}4037$x4038/information about other modes/d4039/more detailed .*MODE/d4040s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'4041fi4042exit $?4043fi404440454046# func_mode_execute arg...4047func_mode_execute ()4048{4049$debug_cmd40504051# The first argument is the command name.4052cmd=$nonopt4053test -z "$cmd" && \4054func_fatal_help "you must specify a COMMAND"40554056# Handle -dlopen flags immediately.4057for file in $opt_dlopen; do4058test -f "$file" \4059|| func_fatal_help "'$file' is not a file"40604061dir=4062case $file in4063*.la)4064func_resolve_sysroot "$file"4065file=$func_resolve_sysroot_result40664067# Check to see that this really is a libtool archive.4068func_lalib_unsafe_p "$file" \4069|| func_fatal_help "'$lib' is not a valid libtool archive"40704071# Read the libtool library.4072dlname=4073library_names=4074func_source "$file"40754076# Skip this library if it cannot be dlopened.4077if test -z "$dlname"; then4078# Warn if it was a shared library.4079test -n "$library_names" && \4080func_warning "'$file' was not linked with '-export-dynamic'"4081continue4082fi40834084func_dirname "$file" "" "."4085dir=$func_dirname_result40864087if test -f "$dir/$objdir/$dlname"; then4088func_append dir "/$objdir"4089else4090if test ! -f "$dir/$dlname"; then4091func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"4092fi4093fi4094;;40954096*.lo)4097# Just add the directory containing the .lo file.4098func_dirname "$file" "" "."4099dir=$func_dirname_result4100;;41014102*)4103func_warning "'-dlopen' is ignored for non-libtool libraries and objects"4104continue4105;;4106esac41074108# Get the absolute pathname.4109absdir=`cd "$dir" && pwd`4110test -n "$absdir" && dir=$absdir41114112# Now add the directory to shlibpath_var.4113if eval "test -z \"\$$shlibpath_var\""; then4114eval "$shlibpath_var=\"\$dir\""4115else4116eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""4117fi4118done41194120# This variable tells wrapper scripts just to set shlibpath_var4121# rather than running their programs.4122libtool_execute_magic=$magic41234124# Check if any of the arguments is a wrapper script.4125args=4126for file4127do4128case $file in4129-* | *.la | *.lo ) ;;4130*)4131# Do a test to see if this is really a libtool program.4132if func_ltwrapper_script_p "$file"; then4133func_source "$file"4134# Transform arg to wrapped name.4135file=$progdir/$program4136elif func_ltwrapper_executable_p "$file"; then4137func_ltwrapper_scriptname "$file"4138func_source "$func_ltwrapper_scriptname_result"4139# Transform arg to wrapped name.4140file=$progdir/$program4141fi4142;;4143esac4144# Quote arguments (to preserve shell metacharacters).4145func_append_quoted args "$file"4146done41474148if $opt_dry_run; then4149# Display what would be done.4150if test -n "$shlibpath_var"; then4151eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""4152echo "export $shlibpath_var"4153fi4154$ECHO "$cmd$args"4155exit $EXIT_SUCCESS4156else4157if test -n "$shlibpath_var"; then4158# Export the shlibpath_var.4159eval "export $shlibpath_var"4160fi41614162# Restore saved environment variables4163for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES4164do4165eval "if test \"\${save_$lt_var+set}\" = set; then4166$lt_var=\$save_$lt_var; export $lt_var4167else4168$lt_unset $lt_var4169fi"4170done41714172# Now prepare to actually exec the command.4173exec_cmd=\$cmd$args4174fi4175}41764177test execute = "$opt_mode" && func_mode_execute ${1+"$@"}417841794180# func_mode_finish arg...4181func_mode_finish ()4182{4183$debug_cmd41844185libs=4186libdirs=4187admincmds=41884189for opt in "$nonopt" ${1+"$@"}4190do4191if test -d "$opt"; then4192func_append libdirs " $opt"41934194elif test -f "$opt"; then4195if func_lalib_unsafe_p "$opt"; then4196func_append libs " $opt"4197else4198func_warning "'$opt' is not a valid libtool archive"4199fi42004201else4202func_fatal_error "invalid argument '$opt'"4203fi4204done42054206if test -n "$libs"; then4207if test -n "$lt_sysroot"; then4208sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`4209sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"4210else4211sysroot_cmd=4212fi42134214# Remove sysroot references4215if $opt_dry_run; then4216for lib in $libs; do4217echo "removing references to $lt_sysroot and '=' prefixes from $lib"4218done4219else4220tmpdir=`func_mktempdir`4221for lib in $libs; do4222$SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \4223> $tmpdir/tmp-la4224mv -f $tmpdir/tmp-la $lib4225done4226${RM}r "$tmpdir"4227fi4228fi42294230if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then4231for libdir in $libdirs; do4232if test -n "$finish_cmds"; then4233# Do each command in the finish commands.4234func_execute_cmds "$finish_cmds" 'admincmds="$admincmds4235'"$cmd"'"'4236fi4237if test -n "$finish_eval"; then4238# Do the single finish_eval.4239eval cmds=\"$finish_eval\"4240$opt_dry_run || eval "$cmds" || func_append admincmds "4241$cmds"4242fi4243done4244fi42454246# Exit here if they wanted silent mode.4247$opt_quiet && exit $EXIT_SUCCESS42484249if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then4250echo "----------------------------------------------------------------------"4251echo "Libraries have been installed in:"4252for libdir in $libdirs; do4253$ECHO " $libdir"4254done4255echo4256echo "If you ever happen to want to link against installed libraries"4257echo "in a given directory, LIBDIR, you must either use libtool, and"4258echo "specify the full pathname of the library, or use the '-LLIBDIR'"4259echo "flag during linking and do at least one of the following:"4260if test -n "$shlibpath_var"; then4261echo " - add LIBDIR to the '$shlibpath_var' environment variable"4262echo " during execution"4263fi4264if test -n "$runpath_var"; then4265echo " - add LIBDIR to the '$runpath_var' environment variable"4266echo " during linking"4267fi4268if test -n "$hardcode_libdir_flag_spec"; then4269libdir=LIBDIR4270eval flag=\"$hardcode_libdir_flag_spec\"42714272$ECHO " - use the '$flag' linker flag"4273fi4274if test -n "$admincmds"; then4275$ECHO " - have your system administrator run these commands:$admincmds"4276fi4277if test -f /etc/ld.so.conf; then4278echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'"4279fi4280echo42814282echo "See any operating system documentation about shared libraries for"4283case $host in4284solaris2.[6789]|solaris2.1[0-9])4285echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"4286echo "pages."4287;;4288*)4289echo "more information, such as the ld(1) and ld.so(8) manual pages."4290;;4291esac4292echo "----------------------------------------------------------------------"4293fi4294exit $EXIT_SUCCESS4295}42964297test finish = "$opt_mode" && func_mode_finish ${1+"$@"}429842994300# func_mode_install arg...4301func_mode_install ()4302{4303$debug_cmd43044305# There may be an optional sh(1) argument at the beginning of4306# install_prog (especially on Windows NT).4307if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||4308# Allow the use of GNU shtool's install command.4309case $nonopt in *shtool*) :;; *) false;; esac4310then4311# Aesthetically quote it.4312func_quote_arg pretty "$nonopt"4313install_prog="$func_quote_arg_result "4314arg=$14315shift4316else4317install_prog=4318arg=$nonopt4319fi43204321# The real first argument should be the name of the installation program.4322# Aesthetically quote it.4323func_quote_arg pretty "$arg"4324func_append install_prog "$func_quote_arg_result"4325install_shared_prog=$install_prog4326case " $install_prog " in4327*[\\\ /]cp\ *) install_cp=: ;;4328*) install_cp=false ;;4329esac43304331# We need to accept at least all the BSD install flags.4332dest=4333files=4334opts=4335prev=4336install_type=4337isdir=false4338stripme=4339no_mode=:4340for arg4341do4342arg2=4343if test -n "$dest"; then4344func_append files " $dest"4345dest=$arg4346continue4347fi43484349case $arg in4350-d) isdir=: ;;4351-f)4352if $install_cp; then :; else4353prev=$arg4354fi4355;;4356-g | -m | -o)4357prev=$arg4358;;4359-s)4360stripme=" -s"4361continue4362;;4363-*)4364;;4365*)4366# If the previous option needed an argument, then skip it.4367if test -n "$prev"; then4368if test X-m = "X$prev" && test -n "$install_override_mode"; then4369arg2=$install_override_mode4370no_mode=false4371fi4372prev=4373else4374dest=$arg4375continue4376fi4377;;4378esac43794380# Aesthetically quote the argument.4381func_quote_arg pretty "$arg"4382func_append install_prog " $func_quote_arg_result"4383if test -n "$arg2"; then4384func_quote_arg pretty "$arg2"4385fi4386func_append install_shared_prog " $func_quote_arg_result"4387done43884389test -z "$install_prog" && \4390func_fatal_help "you must specify an install program"43914392test -n "$prev" && \4393func_fatal_help "the '$prev' option requires an argument"43944395if test -n "$install_override_mode" && $no_mode; then4396if $install_cp; then :; else4397func_quote_arg pretty "$install_override_mode"4398func_append install_shared_prog " -m $func_quote_arg_result"4399fi4400fi44014402if test -z "$files"; then4403if test -z "$dest"; then4404func_fatal_help "no file or destination specified"4405else4406func_fatal_help "you must specify a destination"4407fi4408fi44094410# Strip any trailing slash from the destination.4411func_stripname '' '/' "$dest"4412dest=$func_stripname_result44134414# Check to see that the destination is a directory.4415test -d "$dest" && isdir=:4416if $isdir; then4417destdir=$dest4418destname=4419else4420func_dirname_and_basename "$dest" "" "."4421destdir=$func_dirname_result4422destname=$func_basename_result44234424# Not a directory, so check to see that there is only one file specified.4425set dummy $files; shift4426test "$#" -gt 1 && \4427func_fatal_help "'$dest' is not a directory"4428fi4429case $destdir in4430[\\/]* | [A-Za-z]:[\\/]*) ;;4431*)4432for file in $files; do4433case $file in4434*.lo) ;;4435*)4436func_fatal_help "'$destdir' must be an absolute directory name"4437;;4438esac4439done4440;;4441esac44424443# This variable tells wrapper scripts just to set variables rather4444# than running their programs.4445libtool_install_magic=$magic44464447staticlibs=4448future_libdirs=4449current_libdirs=4450for file in $files; do44514452# Do each installation.4453case $file in4454*.$libext)4455# Do the static libraries later.4456func_append staticlibs " $file"4457;;44584459*.la)4460func_resolve_sysroot "$file"4461file=$func_resolve_sysroot_result44624463# Check to see that this really is a libtool archive.4464func_lalib_unsafe_p "$file" \4465|| func_fatal_help "'$file' is not a valid libtool archive"44664467library_names=4468old_library=4469relink_command=4470func_source "$file"44714472# Add the libdir to current_libdirs if it is the destination.4473if test "X$destdir" = "X$libdir"; then4474case "$current_libdirs " in4475*" $libdir "*) ;;4476*) func_append current_libdirs " $libdir" ;;4477esac4478else4479# Note the libdir as a future libdir.4480case "$future_libdirs " in4481*" $libdir "*) ;;4482*) func_append future_libdirs " $libdir" ;;4483esac4484fi44854486func_dirname "$file" "/" ""4487dir=$func_dirname_result4488func_append dir "$objdir"44894490if test -n "$relink_command"; then4491# Determine the prefix the user has applied to our future dir.4492inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`44934494# Don't allow the user to place us outside of our expected4495# location b/c this prevents finding dependent libraries that4496# are installed to the same prefix.4497# At present, this check doesn't affect windows .dll's that4498# are installed into $libdir/../bin (currently, that works fine)4499# but it's something to keep an eye on.4500test "$inst_prefix_dir" = "$destdir" && \4501func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"45024503if test -n "$inst_prefix_dir"; then4504# Stick the inst_prefix_dir data into the link command.4505relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`4506else4507relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`4508fi45094510func_warning "relinking '$file'"4511func_show_eval "$relink_command" \4512'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'4513fi45144515# See the names of the shared library.4516set dummy $library_names; shift4517if test -n "$1"; then4518realname=$14519shift45204521srcname=$realname4522test -n "$relink_command" && srcname=${realname}T45234524# Install the shared library and build the symlinks.4525func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \4526'exit $?'4527tstripme=$stripme4528case $host_os in4529cygwin* | mingw* | pw32* | cegcc*)4530case $realname in4531*.dll.a)4532tstripme=4533;;4534esac4535;;4536os2*)4537case $realname in4538*_dll.a)4539tstripme=4540;;4541esac4542;;4543esac4544if test -n "$tstripme" && test -n "$striplib"; then4545func_show_eval "$striplib $destdir/$realname" 'exit $?'4546fi45474548if test "$#" -gt 0; then4549# Delete the old symlinks, and create new ones.4550# Try 'ln -sf' first, because the 'ln' binary might depend on4551# the symlink we replace! Solaris /bin/ln does not understand -f,4552# so we also need to try rm && ln -s.4553for linkname4554do4555test "$linkname" != "$realname" \4556&& func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"4557done4558fi45594560# Do each command in the postinstall commands.4561lib=$destdir/$realname4562func_execute_cmds "$postinstall_cmds" 'exit $?'4563fi45644565# Install the pseudo-library for information purposes.4566func_basename "$file"4567name=$func_basename_result4568instname=$dir/${name}i4569func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'45704571# Maybe install the static library, too.4572test -n "$old_library" && func_append staticlibs " $dir/$old_library"4573;;45744575*.lo)4576# Install (i.e. copy) a libtool object.45774578# Figure out destination file name, if it wasn't already specified.4579if test -n "$destname"; then4580destfile=$destdir/$destname4581else4582func_basename "$file"4583destfile=$func_basename_result4584destfile=$destdir/$destfile4585fi45864587# Deduce the name of the destination old-style object file.4588case $destfile in4589*.lo)4590func_lo2o "$destfile"4591staticdest=$func_lo2o_result4592;;4593*.$objext)4594staticdest=$destfile4595destfile=4596;;4597*)4598func_fatal_help "cannot copy a libtool object to '$destfile'"4599;;4600esac46014602# Install the libtool object if requested.4603test -n "$destfile" && \4604func_show_eval "$install_prog $file $destfile" 'exit $?'46054606# Install the old object if enabled.4607if test yes = "$build_old_libs"; then4608# Deduce the name of the old-style object file.4609func_lo2o "$file"4610staticobj=$func_lo2o_result4611func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'4612fi4613exit $EXIT_SUCCESS4614;;46154616*)4617# Figure out destination file name, if it wasn't already specified.4618if test -n "$destname"; then4619destfile=$destdir/$destname4620else4621func_basename "$file"4622destfile=$func_basename_result4623destfile=$destdir/$destfile4624fi46254626# If the file is missing, and there is a .exe on the end, strip it4627# because it is most likely a libtool script we actually want to4628# install4629stripped_ext=4630case $file in4631*.exe)4632if test ! -f "$file"; then4633func_stripname '' '.exe' "$file"4634file=$func_stripname_result4635stripped_ext=.exe4636fi4637;;4638esac46394640# Do a test to see if this is really a libtool program.4641case $host in4642*cygwin* | *mingw*)4643if func_ltwrapper_executable_p "$file"; then4644func_ltwrapper_scriptname "$file"4645wrapper=$func_ltwrapper_scriptname_result4646else4647func_stripname '' '.exe' "$file"4648wrapper=$func_stripname_result4649fi4650;;4651*)4652wrapper=$file4653;;4654esac4655if func_ltwrapper_script_p "$wrapper"; then4656notinst_deplibs=4657relink_command=46584659func_source "$wrapper"46604661# Check the variables that should have been set.4662test -z "$generated_by_libtool_version" && \4663func_fatal_error "invalid libtool wrapper script '$wrapper'"46644665finalize=:4666for lib in $notinst_deplibs; do4667# Check to see that each library is installed.4668libdir=4669if test -f "$lib"; then4670func_source "$lib"4671fi4672libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`4673if test -n "$libdir" && test ! -f "$libfile"; then4674func_warning "'$lib' has not been installed in '$libdir'"4675finalize=false4676fi4677done46784679relink_command=4680func_source "$wrapper"46814682outputname=4683if test no = "$fast_install" && test -n "$relink_command"; then4684$opt_dry_run || {4685if $finalize; then4686tmpdir=`func_mktempdir`4687func_basename "$file$stripped_ext"4688file=$func_basename_result4689outputname=$tmpdir/$file4690# Replace the output file specification.4691relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`46924693$opt_quiet || {4694func_quote_arg expand,pretty "$relink_command"4695eval "func_echo $func_quote_arg_result"4696}4697if eval "$relink_command"; then :4698else4699func_error "error: relink '$file' with the above command before installing it"4700$opt_dry_run || ${RM}r "$tmpdir"4701continue4702fi4703file=$outputname4704else4705func_warning "cannot relink '$file'"4706fi4707}4708else4709# Install the binary that we compiled earlier.4710file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`4711fi4712fi47134714# remove .exe since cygwin /usr/bin/install will append another4715# one anyway4716case $install_prog,$host in4717*/usr/bin/install*,*cygwin*)4718case $file:$destfile in4719*.exe:*.exe)4720# this is ok4721;;4722*.exe:*)4723destfile=$destfile.exe4724;;4725*:*.exe)4726func_stripname '' '.exe' "$destfile"4727destfile=$func_stripname_result4728;;4729esac4730;;4731esac4732func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'4733$opt_dry_run || if test -n "$outputname"; then4734${RM}r "$tmpdir"4735fi4736;;4737esac4738done47394740for file in $staticlibs; do4741func_basename "$file"4742name=$func_basename_result47434744# Set up the ranlib parameters.4745oldlib=$destdir/$name4746func_to_tool_file "$oldlib" func_convert_file_msys_to_w324747tool_oldlib=$func_to_tool_file_result47484749func_show_eval "$install_prog \$file \$oldlib" 'exit $?'47504751if test -n "$stripme" && test -n "$old_striplib"; then4752func_show_eval "$old_striplib $tool_oldlib" 'exit $?'4753fi47544755# Do each command in the postinstall commands.4756func_execute_cmds "$old_postinstall_cmds" 'exit $?'4757done47584759test -n "$future_libdirs" && \4760func_warning "remember to run '$progname --finish$future_libdirs'"47614762if test -n "$current_libdirs"; then4763# Maybe just do a dry run.4764$opt_dry_run && current_libdirs=" -n$current_libdirs"4765exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'4766else4767exit $EXIT_SUCCESS4768fi4769}47704771test install = "$opt_mode" && func_mode_install ${1+"$@"}477247734774# func_generate_dlsyms outputname originator pic_p4775# Extract symbols from dlprefiles and create ${outputname}S.o with4776# a dlpreopen symbol table.4777func_generate_dlsyms ()4778{4779$debug_cmd47804781my_outputname=$14782my_originator=$24783my_pic_p=${3-false}4784my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`4785my_dlsyms=47864787if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then4788if test -n "$NM" && test -n "$global_symbol_pipe"; then4789my_dlsyms=${my_outputname}S.c4790else4791func_error "not configured to extract global symbols from dlpreopened files"4792fi4793fi47944795if test -n "$my_dlsyms"; then4796case $my_dlsyms in4797"") ;;4798*.c)4799# Discover the nlist of each of the dlfiles.4800nlist=$output_objdir/$my_outputname.nm48014802func_show_eval "$RM $nlist ${nlist}S ${nlist}T"48034804# Parse the name list into a source file.4805func_verbose "creating $output_objdir/$my_dlsyms"48064807$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\4808/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */4809/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */48104811#ifdef __cplusplus4812extern \"C\" {4813#endif48144815#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))4816#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"4817#endif48184819/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */4820#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE4821/* DATA imports from DLLs on WIN32 can't be const, because runtime4822relocations are performed -- see ld's documentation on pseudo-relocs. */4823# define LT_DLSYM_CONST4824#elif defined __osf__4825/* This system does not cope well with relocations in const data. */4826# define LT_DLSYM_CONST4827#else4828# define LT_DLSYM_CONST const4829#endif48304831#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)48324833/* External symbol declarations for the compiler. */\4834"48354836if test yes = "$dlself"; then4837func_verbose "generating symbol list for '$output'"48384839$opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"48404841# Add our own program objects to the symbol list.4842progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`4843for progfile in $progfiles; do4844func_to_tool_file "$progfile" func_convert_file_msys_to_w324845func_verbose "extracting global C symbols from '$func_to_tool_file_result'"4846$opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"4847done48484849if test -n "$exclude_expsyms"; then4850$opt_dry_run || {4851eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'4852eval '$MV "$nlist"T "$nlist"'4853}4854fi48554856if test -n "$export_symbols_regex"; then4857$opt_dry_run || {4858eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'4859eval '$MV "$nlist"T "$nlist"'4860}4861fi48624863# Prepare the list of exported symbols4864if test -z "$export_symbols"; then4865export_symbols=$output_objdir/$outputname.exp4866$opt_dry_run || {4867$RM $export_symbols4868eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'4869case $host in4870*cygwin* | *mingw* | *cegcc* )4871eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'4872eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'4873;;4874esac4875}4876else4877$opt_dry_run || {4878eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'4879eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'4880eval '$MV "$nlist"T "$nlist"'4881case $host in4882*cygwin* | *mingw* | *cegcc* )4883eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'4884eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'4885;;4886esac4887}4888fi4889fi48904891for dlprefile in $dlprefiles; do4892func_verbose "extracting global C symbols from '$dlprefile'"4893func_basename "$dlprefile"4894name=$func_basename_result4895case $host in4896*cygwin* | *mingw* | *cegcc* )4897# if an import library, we need to obtain dlname4898if func_win32_import_lib_p "$dlprefile"; then4899func_tr_sh "$dlprefile"4900eval "curr_lafile=\$libfile_$func_tr_sh_result"4901dlprefile_dlbasename=4902if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then4903# Use subshell, to avoid clobbering current variable values4904dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`4905if test -n "$dlprefile_dlname"; then4906func_basename "$dlprefile_dlname"4907dlprefile_dlbasename=$func_basename_result4908else4909# no lafile. user explicitly requested -dlpreopen <import library>.4910$sharedlib_from_linklib_cmd "$dlprefile"4911dlprefile_dlbasename=$sharedlib_from_linklib_result4912fi4913fi4914$opt_dry_run || {4915if test -n "$dlprefile_dlbasename"; then4916eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'4917else4918func_warning "Could not compute DLL name from $name"4919eval '$ECHO ": $name " >> "$nlist"'4920fi4921func_to_tool_file "$dlprefile" func_convert_file_msys_to_w324922eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |4923$SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"4924}4925else # not an import lib4926$opt_dry_run || {4927eval '$ECHO ": $name " >> "$nlist"'4928func_to_tool_file "$dlprefile" func_convert_file_msys_to_w324929eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"4930}4931fi4932;;4933*)4934$opt_dry_run || {4935eval '$ECHO ": $name " >> "$nlist"'4936func_to_tool_file "$dlprefile" func_convert_file_msys_to_w324937eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"4938}4939;;4940esac4941done49424943$opt_dry_run || {4944# Make sure we have at least an empty file.4945test -f "$nlist" || : > "$nlist"49464947if test -n "$exclude_expsyms"; then4948$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T4949$MV "$nlist"T "$nlist"4950fi49514952# Try sorting and uniquifying the output.4953if $GREP -v "^: " < "$nlist" |4954if sort -k 3 </dev/null >/dev/null 2>&1; then4955sort -k 34956else4957sort +24958fi |4959uniq > "$nlist"S; then4960:4961else4962$GREP -v "^: " < "$nlist" > "$nlist"S4963fi49644965if test -f "$nlist"S; then4966eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'4967else4968echo '/* NONE */' >> "$output_objdir/$my_dlsyms"4969fi49704971func_show_eval '$RM "${nlist}I"'4972if test -n "$global_symbol_to_import"; then4973eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'4974fi49754976echo >> "$output_objdir/$my_dlsyms" "\49774978/* The mapping between symbol names and symbols. */4979typedef struct {4980const char *name;4981void *address;4982} lt_dlsymlist;4983extern LT_DLSYM_CONST lt_dlsymlist4984lt_${my_prefix}_LTX_preloaded_symbols[];\4985"49864987if test -s "$nlist"I; then4988echo >> "$output_objdir/$my_dlsyms" "\4989static void lt_syminit(void)4990{4991LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;4992for (; symbol->name; ++symbol)4993{"4994$SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"4995echo >> "$output_objdir/$my_dlsyms" "\4996}4997}"4998fi4999echo >> "$output_objdir/$my_dlsyms" "\5000LT_DLSYM_CONST lt_dlsymlist5001lt_${my_prefix}_LTX_preloaded_symbols[] =5002{ {\"$my_originator\", (void *) 0},"50035004if test -s "$nlist"I; then5005echo >> "$output_objdir/$my_dlsyms" "\5006{\"@INIT@\", (void *) <_syminit},"5007fi50085009case $need_lib_prefix in5010no)5011eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"5012;;5013*)5014eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"5015;;5016esac5017echo >> "$output_objdir/$my_dlsyms" "\5018{0, (void *) 0}5019};50205021/* This works around a problem in FreeBSD linker */5022#ifdef FREEBSD_WORKAROUND5023static const void *lt_preloaded_setup() {5024return lt_${my_prefix}_LTX_preloaded_symbols;5025}5026#endif50275028#ifdef __cplusplus5029}5030#endif\5031"5032} # !$opt_dry_run50335034pic_flag_for_symtable=5035case "$compile_command " in5036*" -static "*) ;;5037*)5038case $host in5039# compiling the symbol table file with pic_flag works around5040# a FreeBSD bug that causes programs to crash when -lm is5041# linked before any other PIC object. But we must not use5042# pic_flag when linking with -static. The problem exists in5043# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.5044*-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)5045pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;5046*-*-hpux*)5047pic_flag_for_symtable=" $pic_flag" ;;5048*)5049$my_pic_p && pic_flag_for_symtable=" $pic_flag"5050;;5051esac5052;;5053esac5054symtab_cflags=5055for arg in $LTCFLAGS; do5056case $arg in5057-pie | -fpie | -fPIE) ;;5058*) func_append symtab_cflags " $arg" ;;5059esac5060done50615062# Now compile the dynamic symbol file.5063func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'50645065# Clean up the generated files.5066func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'50675068# Transform the symbol file into the correct name.5069symfileobj=$output_objdir/${my_outputname}S.$objext5070case $host in5071*cygwin* | *mingw* | *cegcc* )5072if test -f "$output_objdir/$my_outputname.def"; then5073compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`5074finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`5075else5076compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`5077finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`5078fi5079;;5080*)5081compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`5082finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`5083;;5084esac5085;;5086*)5087func_fatal_error "unknown suffix for '$my_dlsyms'"5088;;5089esac5090else5091# We keep going just in case the user didn't refer to5092# lt_preloaded_symbols. The linker will fail if global_symbol_pipe5093# really was required.50945095# Nullify the symbol file.5096compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`5097finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`5098fi5099}51005101# func_cygming_gnu_implib_p ARG5102# This predicate returns with zero status (TRUE) if5103# ARG is a GNU/binutils-style import library. Returns5104# with nonzero status (FALSE) otherwise.5105func_cygming_gnu_implib_p ()5106{5107$debug_cmd51085109func_to_tool_file "$1" func_convert_file_msys_to_w325110func_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)$'`5111test -n "$func_cygming_gnu_implib_tmp"5112}51135114# func_cygming_ms_implib_p ARG5115# This predicate returns with zero status (TRUE) if5116# ARG is an MS-style import library. Returns5117# with nonzero status (FALSE) otherwise.5118func_cygming_ms_implib_p ()5119{5120$debug_cmd51215122func_to_tool_file "$1" func_convert_file_msys_to_w325123func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`5124test -n "$func_cygming_ms_implib_tmp"5125}51265127# func_win32_libid arg5128# return the library type of file 'arg'5129#5130# Need a lot of goo to handle *both* DLLs and import libs5131# Has to be a shell function in order to 'eat' the argument5132# that is supplied when $file_magic_command is called.5133# Despite the name, also deal with 64 bit binaries.5134func_win32_libid ()5135{5136$debug_cmd51375138win32_libid_type=unknown5139win32_fileres=`file -L $1 2>/dev/null`5140case $win32_fileres in5141*ar\ archive\ import\ library*) # definitely import5142win32_libid_type="x86 archive import"5143;;5144*ar\ archive*) # could be an import, or static5145# Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.5146if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |5147$EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then5148case $nm_interface in5149"MS dumpbin")5150if func_cygming_ms_implib_p "$1" ||5151func_cygming_gnu_implib_p "$1"5152then5153win32_nmres=import5154else5155win32_nmres=5156fi5157;;5158*)5159func_to_tool_file "$1" func_convert_file_msys_to_w325160win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |5161$SED -n -e '51621,100{5163/ I /{5164s|.*|import|5165p5166q5167}5168}'`5169;;5170esac5171case $win32_nmres in5172import*) win32_libid_type="x86 archive import";;5173*) win32_libid_type="x86 archive static";;5174esac5175fi5176;;5177*DLL*)5178win32_libid_type="x86 DLL"5179;;5180*executable*) # but shell scripts are "executable" too...5181case $win32_fileres in5182*MS\ Windows\ PE\ Intel*)5183win32_libid_type="x86 DLL"5184;;5185esac5186;;5187esac5188$ECHO "$win32_libid_type"5189}51905191# func_cygming_dll_for_implib ARG5192#5193# Platform-specific function to extract the5194# name of the DLL associated with the specified5195# import library ARG.5196# Invoked by eval'ing the libtool variable5197# $sharedlib_from_linklib_cmd5198# Result is available in the variable5199# $sharedlib_from_linklib_result5200func_cygming_dll_for_implib ()5201{5202$debug_cmd52035204sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`5205}52065207# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs5208#5209# The is the core of a fallback implementation of a5210# platform-specific function to extract the name of the5211# DLL associated with the specified import library LIBNAME.5212#5213# SECTION_NAME is either .idata$6 or .idata$7, depending5214# on the platform and compiler that created the implib.5215#5216# Echos the name of the DLL associated with the5217# specified import library.5218func_cygming_dll_for_implib_fallback_core ()5219{5220$debug_cmd52215222match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`5223$OBJDUMP -s --section "$1" "$2" 2>/dev/null |5224$SED '/^Contents of section '"$match_literal"':/{5225# Place marker at beginning of archive member dllname section5226s/.*/====MARK====/5227p5228d5229}5230# These lines can sometimes be longer than 43 characters, but5231# are always uninteresting5232/:[ ]*file format pe[i]\{,1\}-/d5233/^In archive [^:]*:/d5234# Ensure marker is printed5235/^====MARK====/p5236# Remove all lines with less than 43 characters5237/^.\{43\}/!d5238# From remaining lines, remove first 43 characters5239s/^.\{43\}//' |5240$SED -n '5241# Join marker and all lines until next marker into a single line5242/^====MARK====/ b para5243H5244$ b para5245b5246:para5247x5248s/\n//g5249# Remove the marker5250s/^====MARK====//5251# Remove trailing dots and whitespace5252s/[\. \t]*$//52535254/./p' |5255# we now have a list, one entry per line, of the stringified5256# contents of the appropriate section of all members of the5257# archive that possess that section. Heuristic: eliminate5258# all those that have a first or second character that is5259# a '.' (that is, objdump's representation of an unprintable5260# character.) This should work for all archives with less than5261# 0x302f exports -- but will fail for DLLs whose name actually5262# begins with a literal '.' or a single character followed by5263# a '.'.5264#5265# Of those that remain, print the first one.5266$SED -e '/^\./d;/^.\./d;q'5267}52685269# func_cygming_dll_for_implib_fallback ARG5270# Platform-specific function to extract the5271# name of the DLL associated with the specified5272# import library ARG.5273#5274# This fallback implementation is for use when $DLLTOOL5275# does not support the --identify-strict option.5276# Invoked by eval'ing the libtool variable5277# $sharedlib_from_linklib_cmd5278# Result is available in the variable5279# $sharedlib_from_linklib_result5280func_cygming_dll_for_implib_fallback ()5281{5282$debug_cmd52835284if func_cygming_gnu_implib_p "$1"; then5285# binutils import library5286sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`5287elif func_cygming_ms_implib_p "$1"; then5288# ms-generated import library5289sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`5290else5291# unknown5292sharedlib_from_linklib_result=5293fi5294}529552965297# func_extract_an_archive dir oldlib5298func_extract_an_archive ()5299{5300$debug_cmd53015302f_ex_an_ar_dir=$1; shift5303f_ex_an_ar_oldlib=$15304if test yes = "$lock_old_archive_extraction"; then5305lockfile=$f_ex_an_ar_oldlib.lock5306until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do5307func_echo "Waiting for $lockfile to be removed"5308sleep 25309done5310fi5311func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \5312'stat=$?; rm -f "$lockfile"; exit $stat'5313if test yes = "$lock_old_archive_extraction"; then5314$opt_dry_run || rm -f "$lockfile"5315fi5316if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then5317:5318else5319func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"5320fi5321}532253235324# func_extract_archives gentop oldlib ...5325func_extract_archives ()5326{5327$debug_cmd53285329my_gentop=$1; shift5330my_oldlibs=${1+"$@"}5331my_oldobjs=5332my_xlib=5333my_xabs=5334my_xdir=53355336for my_xlib in $my_oldlibs; do5337# Extract the objects.5338case $my_xlib in5339[\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;5340*) my_xabs=`pwd`"/$my_xlib" ;;5341esac5342func_basename "$my_xlib"5343my_xlib=$func_basename_result5344my_xlib_u=$my_xlib5345while :; do5346case " $extracted_archives " in5347*" $my_xlib_u "*)5348func_arith $extracted_serial + 15349extracted_serial=$func_arith_result5350my_xlib_u=lt$extracted_serial-$my_xlib ;;5351*) break ;;5352esac5353done5354extracted_archives="$extracted_archives $my_xlib_u"5355my_xdir=$my_gentop/$my_xlib_u53565357func_mkdir_p "$my_xdir"53585359case $host in5360*-darwin*)5361func_verbose "Extracting $my_xabs"5362# Do not bother doing anything if just a dry run5363$opt_dry_run || {5364darwin_orig_dir=`pwd`5365cd $my_xdir || exit $?5366darwin_archive=$my_xabs5367darwin_curdir=`pwd`5368func_basename "$darwin_archive"5369darwin_base_archive=$func_basename_result5370darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`5371if test -n "$darwin_arches"; then5372darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`5373darwin_arch=5374func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"5375for darwin_arch in $darwin_arches; do5376func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"5377$LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"5378cd "unfat-$$/$darwin_base_archive-$darwin_arch"5379func_extract_an_archive "`pwd`" "$darwin_base_archive"5380cd "$darwin_curdir"5381$RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"5382done # $darwin_arches5383## Okay now we've a bunch of thin objects, gotta fatten them up :)5384darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u`5385darwin_file=5386darwin_files=5387for darwin_file in $darwin_filelist; do5388darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`5389$LIPO -create -output "$darwin_file" $darwin_files5390done # $darwin_filelist5391$RM -rf unfat-$$5392cd "$darwin_orig_dir"5393else5394cd $darwin_orig_dir5395func_extract_an_archive "$my_xdir" "$my_xabs"5396fi # $darwin_arches5397} # !$opt_dry_run5398;;5399*)5400func_extract_an_archive "$my_xdir" "$my_xabs"5401;;5402esac5403my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`5404done54055406func_extract_archives_result=$my_oldobjs5407}540854095410# func_emit_wrapper [arg=no]5411#5412# Emit a libtool wrapper script on stdout.5413# Don't directly open a file because we may want to5414# incorporate the script contents within a cygwin/mingw5415# wrapper executable. Must ONLY be called from within5416# func_mode_link because it depends on a number of variables5417# set therein.5418#5419# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR5420# variable will take. If 'yes', then the emitted script5421# will assume that the directory where it is stored is5422# the $objdir directory. This is a cygwin/mingw-specific5423# behavior.5424func_emit_wrapper ()5425{5426func_emit_wrapper_arg1=${1-no}54275428$ECHO "\5429#! $SHELL54305431# $output - temporary wrapper script for $objdir/$outputname5432# Generated by $PROGRAM (GNU $PACKAGE) $VERSION5433#5434# The $output program cannot be directly executed until all the libtool5435# libraries that it depends on are installed.5436#5437# This wrapper script should never be moved out of the build directory.5438# If it is, it will not operate correctly.54395440# Sed substitution that helps us do robust quoting. It backslashifies5441# metacharacters that are still active within double-quoted strings.5442sed_quote_subst='$sed_quote_subst'54435444# Be Bourne compatible5445if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then5446emulate sh5447NULLCMD=:5448# Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which5449# is contrary to our usage. Disable this feature.5450alias -g '\${1+\"\$@\"}'='\"\$@\"'5451setopt NO_GLOB_SUBST5452else5453case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac5454fi5455BIN_SH=xpg4; export BIN_SH # for Tru645456DUALCASE=1; export DUALCASE # for MKS sh54575458# The HP-UX ksh and POSIX shell print the target directory to stdout5459# if CDPATH is set.5460(unset CDPATH) >/dev/null 2>&1 && unset CDPATH54615462relink_command=\"$relink_command\"54635464# This environment variable determines our operation mode.5465if test \"\$libtool_install_magic\" = \"$magic\"; then5466# install mode needs the following variables:5467generated_by_libtool_version='$macro_version'5468notinst_deplibs='$notinst_deplibs'5469else5470# When we are sourced in execute mode, \$file and \$ECHO are already set.5471if test \"\$libtool_execute_magic\" != \"$magic\"; then5472file=\"\$0\""54735474func_quote_arg pretty "$ECHO"5475qECHO=$func_quote_arg_result5476$ECHO "\54775478# A function that is used when there is no print builtin or printf.5479func_fallback_echo ()5480{5481eval 'cat <<_LTECHO_EOF5482\$15483_LTECHO_EOF'5484}5485ECHO=$qECHO5486fi54875488# Very basic option parsing. These options are (a) specific to5489# the libtool wrapper, (b) are identical between the wrapper5490# /script/ and the wrapper /executable/ that is used only on5491# windows platforms, and (c) all begin with the string "--lt-"5492# (application programs are unlikely to have options that match5493# this pattern).5494#5495# There are only two supported options: --lt-debug and5496# --lt-dump-script. There is, deliberately, no --lt-help.5497#5498# The first argument to this parsing function should be the5499# script's $0 value, followed by "$@".5500lt_option_debug=5501func_parse_lt_options ()5502{5503lt_script_arg0=\$05504shift5505for lt_opt5506do5507case \"\$lt_opt\" in5508--lt-debug) lt_option_debug=1 ;;5509--lt-dump-script)5510lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`5511test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.5512lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`5513cat \"\$lt_dump_D/\$lt_dump_F\"5514exit 05515;;5516--lt-*)5517\$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&25518exit 15519;;5520esac5521done55225523# Print the debug banner immediately:5524if test -n \"\$lt_option_debug\"; then5525echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&25526fi5527}55285529# Used when --lt-debug. Prints its arguments to stdout5530# (redirection is the responsibility of the caller)5531func_lt_dump_args ()5532{5533lt_dump_args_N=1;5534for lt_arg5535do5536\$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"5537lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`5538done5539}55405541# Core function for launching the target application5542func_exec_program_core ()5543{5544"5545case $host in5546# Backslashes separate directories on plain windows5547*-*-mingw | *-*-os2* | *-cegcc*)5548$ECHO "\5549if test -n \"\$lt_option_debug\"; then5550\$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&25551func_lt_dump_args \${1+\"\$@\"} 1>&25552fi5553exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}5554"5555;;55565557*)5558$ECHO "\5559if test -n \"\$lt_option_debug\"; then5560\$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&25561func_lt_dump_args \${1+\"\$@\"} 1>&25562fi5563exec \"\$progdir/\$program\" \${1+\"\$@\"}5564"5565;;5566esac5567$ECHO "\5568\$ECHO \"\$0: cannot exec \$program \$*\" 1>&25569exit 15570}55715572# A function to encapsulate launching the target application5573# Strips options in the --lt-* namespace from \$@ and5574# launches target application with the remaining arguments.5575func_exec_program ()5576{5577case \" \$* \" in5578*\\ --lt-*)5579for lt_wr_arg5580do5581case \$lt_wr_arg in5582--lt-*) ;;5583*) set x \"\$@\" \"\$lt_wr_arg\"; shift;;5584esac5585shift5586done ;;5587esac5588func_exec_program_core \${1+\"\$@\"}5589}55905591# Parse options5592func_parse_lt_options \"\$0\" \${1+\"\$@\"}55935594# Find the directory that this script lives in.5595thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`5596test \"x\$thisdir\" = \"x\$file\" && thisdir=.55975598# Follow symbolic links until we get to the real thisdir.5599file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`5600while test -n \"\$file\"; do5601destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`56025603# If there was a directory component, then change thisdir.5604if test \"x\$destdir\" != \"x\$file\"; then5605case \"\$destdir\" in5606[\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;5607*) thisdir=\"\$thisdir/\$destdir\" ;;5608esac5609fi56105611file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`5612file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`5613done56145615# Usually 'no', except on cygwin/mingw when embedded into5616# the cwrapper.5617WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg15618if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then5619# special case for '.'5620if test \"\$thisdir\" = \".\"; then5621thisdir=\`pwd\`5622fi5623# remove .libs from thisdir5624case \"\$thisdir\" in5625*[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;5626$objdir ) thisdir=. ;;5627esac5628fi56295630# Try to get the absolute directory name.5631absdir=\`cd \"\$thisdir\" && pwd\`5632test -n \"\$absdir\" && thisdir=\"\$absdir\"5633"56345635if test yes = "$fast_install"; then5636$ECHO "\5637program=lt-'$outputname'$exeext5638progdir=\"\$thisdir/$objdir\"56395640if test ! -f \"\$progdir/\$program\" ||5641{ file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\5642test \"X\$file\" != \"X\$progdir/\$program\"; }; then56435644file=\"\$\$-\$program\"56455646if test ! -d \"\$progdir\"; then5647$MKDIR \"\$progdir\"5648else5649$RM \"\$progdir/\$file\"5650fi"56515652$ECHO "\56535654# relink executable if necessary5655if test -n \"\$relink_command\"; then5656if relink_command_output=\`eval \$relink_command 2>&1\`; then :5657else5658\$ECHO \"\$relink_command_output\" >&25659$RM \"\$progdir/\$file\"5660exit 15661fi5662fi56635664$MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||5665{ $RM \"\$progdir/\$program\";5666$MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }5667$RM \"\$progdir/\$file\"5668fi"5669else5670$ECHO "\5671program='$outputname'5672progdir=\"\$thisdir/$objdir\"5673"5674fi56755676$ECHO "\56775678if test -f \"\$progdir/\$program\"; then"56795680# fixup the dll searchpath if we need to.5681#5682# Fix the DLL searchpath if we need to. Do this before prepending5683# to shlibpath, because on Windows, both are PATH and uninstalled5684# libraries must come first.5685if test -n "$dllsearchpath"; then5686$ECHO "\5687# Add the dll search path components to the executable PATH5688PATH=$dllsearchpath:\$PATH5689"5690fi56915692# Export our shlibpath_var if we have one.5693if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then5694$ECHO "\5695# Add our own library path to $shlibpath_var5696$shlibpath_var=\"$temp_rpath\$$shlibpath_var\"56975698# Some systems cannot cope with colon-terminated $shlibpath_var5699# The second colon is a workaround for a bug in BeOS R4 sed5700$shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`57015702export $shlibpath_var5703"5704fi57055706$ECHO "\5707if test \"\$libtool_execute_magic\" != \"$magic\"; then5708# Run the actual program with our arguments.5709func_exec_program \${1+\"\$@\"}5710fi5711else5712# The program doesn't exist.5713\$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&25714\$ECHO \"This script is just a wrapper for \$program.\" 1>&25715\$ECHO \"See the $PACKAGE documentation for more information.\" 1>&25716exit 15717fi5718fi\5719"5720}572157225723# func_emit_cwrapperexe_src5724# emit the source code for a wrapper executable on stdout5725# Must ONLY be called from within func_mode_link because5726# it depends on a number of variable set therein.5727func_emit_cwrapperexe_src ()5728{5729cat <<EOF57305731/* $cwrappersource - temporary wrapper executable for $objdir/$outputname5732Generated by $PROGRAM (GNU $PACKAGE) $VERSION57335734The $output program cannot be directly executed until all the libtool5735libraries that it depends on are installed.57365737This wrapper executable should never be moved out of the build directory.5738If it is, it will not operate correctly.5739*/5740EOF5741cat <<"EOF"5742#ifdef _MSC_VER5743# define _CRT_SECURE_NO_DEPRECATE 15744#endif5745#include <stdio.h>5746#include <stdlib.h>5747#ifdef _MSC_VER5748# include <direct.h>5749# include <process.h>5750# include <io.h>5751#else5752# include <unistd.h>5753# include <stdint.h>5754# ifdef __CYGWIN__5755# include <io.h>5756# endif5757#endif5758#include <malloc.h>5759#include <stdarg.h>5760#include <assert.h>5761#include <string.h>5762#include <ctype.h>5763#include <errno.h>5764#include <fcntl.h>5765#include <sys/stat.h>57665767#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)57685769/* declarations of non-ANSI functions */5770#if defined __MINGW32__5771# ifdef __STRICT_ANSI__5772int _putenv (const char *);5773# endif5774#elif defined __CYGWIN__5775# ifdef __STRICT_ANSI__5776char *realpath (const char *, char *);5777int putenv (char *);5778int setenv (const char *, const char *, int);5779# endif5780/* #elif defined other_platform || defined ... */5781#endif57825783/* portability defines, excluding path handling macros */5784#if defined _MSC_VER5785# define setmode _setmode5786# define stat _stat5787# define chmod _chmod5788# define getcwd _getcwd5789# define putenv _putenv5790# define S_IXUSR _S_IEXEC5791#elif defined __MINGW32__5792# define setmode _setmode5793# define stat _stat5794# define chmod _chmod5795# define getcwd _getcwd5796# define putenv _putenv5797#elif defined __CYGWIN__5798# define HAVE_SETENV5799# define FOPEN_WB "wb"5800/* #elif defined other platforms ... */5801#endif58025803#if defined PATH_MAX5804# define LT_PATHMAX PATH_MAX5805#elif defined MAXPATHLEN5806# define LT_PATHMAX MAXPATHLEN5807#else5808# define LT_PATHMAX 10245809#endif58105811#ifndef S_IXOTH5812# define S_IXOTH 05813#endif5814#ifndef S_IXGRP5815# define S_IXGRP 05816#endif58175818/* path handling portability macros */5819#ifndef DIR_SEPARATOR5820# define DIR_SEPARATOR '/'5821# define PATH_SEPARATOR ':'5822#endif58235824#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \5825defined __OS2__5826# define HAVE_DOS_BASED_FILE_SYSTEM5827# define FOPEN_WB "wb"5828# ifndef DIR_SEPARATOR_25829# define DIR_SEPARATOR_2 '\\'5830# endif5831# ifndef PATH_SEPARATOR_25832# define PATH_SEPARATOR_2 ';'5833# endif5834#endif58355836#ifndef DIR_SEPARATOR_25837# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)5838#else /* DIR_SEPARATOR_2 */5839# define IS_DIR_SEPARATOR(ch) \5840(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))5841#endif /* DIR_SEPARATOR_2 */58425843#ifndef PATH_SEPARATOR_25844# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)5845#else /* PATH_SEPARATOR_2 */5846# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)5847#endif /* PATH_SEPARATOR_2 */58485849#ifndef FOPEN_WB5850# define FOPEN_WB "w"5851#endif5852#ifndef _O_BINARY5853# define _O_BINARY 05854#endif58555856#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))5857#define XFREE(stale) do { \5858if (stale) { free (stale); stale = 0; } \5859} while (0)58605861#if defined LT_DEBUGWRAPPER5862static int lt_debug = 1;5863#else5864static int lt_debug = 0;5865#endif58665867const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */58685869void *xmalloc (size_t num);5870char *xstrdup (const char *string);5871const char *base_name (const char *name);5872char *find_executable (const char *wrapper);5873char *chase_symlinks (const char *pathspec);5874int make_executable (const char *path);5875int check_executable (const char *path);5876char *strendzap (char *str, const char *pat);5877void lt_debugprintf (const char *file, int line, const char *fmt, ...);5878void lt_fatal (const char *file, int line, const char *message, ...);5879static const char *nonnull (const char *s);5880static const char *nonempty (const char *s);5881void lt_setenv (const char *name, const char *value);5882char *lt_extend_str (const char *orig_value, const char *add, int to_end);5883void lt_update_exe_path (const char *name, const char *value);5884void lt_update_lib_path (const char *name, const char *value);5885char **prepare_spawn (char **argv);5886void lt_dump_script (FILE *f);5887EOF58885889cat <<EOF5890#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)5891# define externally_visible volatile5892#else5893# define externally_visible __attribute__((externally_visible)) volatile5894#endif5895externally_visible const char * MAGIC_EXE = "$magic_exe";5896const char * LIB_PATH_VARNAME = "$shlibpath_var";5897EOF58985899if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then5900func_to_host_path "$temp_rpath"5901cat <<EOF5902const char * LIB_PATH_VALUE = "$func_to_host_path_result";5903EOF5904else5905cat <<"EOF"5906const char * LIB_PATH_VALUE = "";5907EOF5908fi59095910if test -n "$dllsearchpath"; then5911func_to_host_path "$dllsearchpath:"5912cat <<EOF5913const char * EXE_PATH_VARNAME = "PATH";5914const char * EXE_PATH_VALUE = "$func_to_host_path_result";5915EOF5916else5917cat <<"EOF"5918const char * EXE_PATH_VARNAME = "";5919const char * EXE_PATH_VALUE = "";5920EOF5921fi59225923if test yes = "$fast_install"; then5924cat <<EOF5925const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */5926EOF5927else5928cat <<EOF5929const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */5930EOF5931fi593259335934cat <<"EOF"59355936#define LTWRAPPER_OPTION_PREFIX "--lt-"59375938static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;5939static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";5940static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";59415942int5943main (int argc, char *argv[])5944{5945char **newargz;5946int newargc;5947char *tmp_pathspec;5948char *actual_cwrapper_path;5949char *actual_cwrapper_name;5950char *target_name;5951char *lt_argv_zero;5952int rval = 127;59535954int i;59555956program_name = (char *) xstrdup (base_name (argv[0]));5957newargz = XMALLOC (char *, (size_t) argc + 1);59585959/* very simple arg parsing; don't want to rely on getopt5960* also, copy all non cwrapper options to newargz, except5961* argz[0], which is handled differently5962*/5963newargc=0;5964for (i = 1; i < argc; i++)5965{5966if (STREQ (argv[i], dumpscript_opt))5967{5968EOF5969case $host in5970*mingw* | *cygwin* )5971# make stdout use "unix" line endings5972echo " setmode(1,_O_BINARY);"5973;;5974esac59755976cat <<"EOF"5977lt_dump_script (stdout);5978return 0;5979}5980if (STREQ (argv[i], debug_opt))5981{5982lt_debug = 1;5983continue;5984}5985if (STREQ (argv[i], ltwrapper_option_prefix))5986{5987/* however, if there is an option in the LTWRAPPER_OPTION_PREFIX5988namespace, but it is not one of the ones we know about and5989have already dealt with, above (inluding dump-script), then5990report an error. Otherwise, targets might begin to believe5991they are allowed to use options in the LTWRAPPER_OPTION_PREFIX5992namespace. The first time any user complains about this, we'll5993need to make LTWRAPPER_OPTION_PREFIX a configure-time option5994or a configure.ac-settable value.5995*/5996lt_fatal (__FILE__, __LINE__,5997"unrecognized %s option: '%s'",5998ltwrapper_option_prefix, argv[i]);5999}6000/* otherwise ... */6001newargz[++newargc] = xstrdup (argv[i]);6002}6003newargz[++newargc] = NULL;60046005EOF6006cat <<EOF6007/* The GNU banner must be the first non-error debug message */6008lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");6009EOF6010cat <<"EOF"6011lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);6012lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);60136014tmp_pathspec = find_executable (argv[0]);6015if (tmp_pathspec == NULL)6016lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);6017lt_debugprintf (__FILE__, __LINE__,6018"(main) found exe (before symlink chase) at: %s\n",6019tmp_pathspec);60206021actual_cwrapper_path = chase_symlinks (tmp_pathspec);6022lt_debugprintf (__FILE__, __LINE__,6023"(main) found exe (after symlink chase) at: %s\n",6024actual_cwrapper_path);6025XFREE (tmp_pathspec);60266027actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));6028strendzap (actual_cwrapper_path, actual_cwrapper_name);60296030/* wrapper name transforms */6031strendzap (actual_cwrapper_name, ".exe");6032tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);6033XFREE (actual_cwrapper_name);6034actual_cwrapper_name = tmp_pathspec;6035tmp_pathspec = 0;60366037/* target_name transforms -- use actual target program name; might have lt- prefix */6038target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));6039strendzap (target_name, ".exe");6040tmp_pathspec = lt_extend_str (target_name, ".exe", 1);6041XFREE (target_name);6042target_name = tmp_pathspec;6043tmp_pathspec = 0;60446045lt_debugprintf (__FILE__, __LINE__,6046"(main) libtool target name: %s\n",6047target_name);6048EOF60496050cat <<EOF6051newargz[0] =6052XMALLOC (char, (strlen (actual_cwrapper_path) +6053strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));6054strcpy (newargz[0], actual_cwrapper_path);6055strcat (newargz[0], "$objdir");6056strcat (newargz[0], "/");6057EOF60586059cat <<"EOF"6060/* stop here, and copy so we don't have to do this twice */6061tmp_pathspec = xstrdup (newargz[0]);60626063/* do NOT want the lt- prefix here, so use actual_cwrapper_name */6064strcat (newargz[0], actual_cwrapper_name);60656066/* DO want the lt- prefix here if it exists, so use target_name */6067lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);6068XFREE (tmp_pathspec);6069tmp_pathspec = NULL;6070EOF60716072case $host_os in6073mingw*)6074cat <<"EOF"6075{6076char* p;6077while ((p = strchr (newargz[0], '\\')) != NULL)6078{6079*p = '/';6080}6081while ((p = strchr (lt_argv_zero, '\\')) != NULL)6082{6083*p = '/';6084}6085}6086EOF6087;;6088esac60896090cat <<"EOF"6091XFREE (target_name);6092XFREE (actual_cwrapper_path);6093XFREE (actual_cwrapper_name);60946095lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */6096lt_setenv ("DUALCASE", "1"); /* for MSK sh */6097/* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must6098be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)6099because on Windows, both *_VARNAMEs are PATH but uninstalled6100libraries must come first. */6101lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);6102lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);61036104lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",6105nonnull (lt_argv_zero));6106for (i = 0; i < newargc; i++)6107{6108lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",6109i, nonnull (newargz[i]));6110}61116112EOF61136114case $host_os in6115mingw*)6116cat <<"EOF"6117/* execv doesn't actually work on mingw as expected on unix */6118newargz = prepare_spawn (newargz);6119rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);6120if (rval == -1)6121{6122/* failed to start process */6123lt_debugprintf (__FILE__, __LINE__,6124"(main) failed to launch target \"%s\": %s\n",6125lt_argv_zero, nonnull (strerror (errno)));6126return 127;6127}6128return rval;6129EOF6130;;6131*)6132cat <<"EOF"6133execv (lt_argv_zero, newargz);6134return rval; /* =127, but avoids unused variable warning */6135EOF6136;;6137esac61386139cat <<"EOF"6140}61416142void *6143xmalloc (size_t num)6144{6145void *p = (void *) malloc (num);6146if (!p)6147lt_fatal (__FILE__, __LINE__, "memory exhausted");61486149return p;6150}61516152char *6153xstrdup (const char *string)6154{6155return string ? strcpy ((char *) xmalloc (strlen (string) + 1),6156string) : NULL;6157}61586159const char *6160base_name (const char *name)6161{6162const char *base;61636164#if defined HAVE_DOS_BASED_FILE_SYSTEM6165/* Skip over the disk name in MSDOS pathnames. */6166if (isalpha ((unsigned char) name[0]) && name[1] == ':')6167name += 2;6168#endif61696170for (base = name; *name; name++)6171if (IS_DIR_SEPARATOR (*name))6172base = name + 1;6173return base;6174}61756176int6177check_executable (const char *path)6178{6179struct stat st;61806181lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",6182nonempty (path));6183if ((!path) || (!*path))6184return 0;61856186if ((stat (path, &st) >= 0)6187&& (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))6188return 1;6189else6190return 0;6191}61926193int6194make_executable (const char *path)6195{6196int rval = 0;6197struct stat st;61986199lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",6200nonempty (path));6201if ((!path) || (!*path))6202return 0;62036204if (stat (path, &st) >= 0)6205{6206rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);6207}6208return rval;6209}62106211/* Searches for the full path of the wrapper. Returns6212newly allocated full path name if found, NULL otherwise6213Does not chase symlinks, even on platforms that support them.6214*/6215char *6216find_executable (const char *wrapper)6217{6218int has_slash = 0;6219const char *p;6220const char *p_next;6221/* static buffer for getcwd */6222char tmp[LT_PATHMAX + 1];6223size_t tmp_len;6224char *concat_name;62256226lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",6227nonempty (wrapper));62286229if ((wrapper == NULL) || (*wrapper == '\0'))6230return NULL;62316232/* Absolute path? */6233#if defined HAVE_DOS_BASED_FILE_SYSTEM6234if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')6235{6236concat_name = xstrdup (wrapper);6237if (check_executable (concat_name))6238return concat_name;6239XFREE (concat_name);6240}6241else6242{6243#endif6244if (IS_DIR_SEPARATOR (wrapper[0]))6245{6246concat_name = xstrdup (wrapper);6247if (check_executable (concat_name))6248return concat_name;6249XFREE (concat_name);6250}6251#if defined HAVE_DOS_BASED_FILE_SYSTEM6252}6253#endif62546255for (p = wrapper; *p; p++)6256if (*p == '/')6257{6258has_slash = 1;6259break;6260}6261if (!has_slash)6262{6263/* no slashes; search PATH */6264const char *path = getenv ("PATH");6265if (path != NULL)6266{6267for (p = path; *p; p = p_next)6268{6269const char *q;6270size_t p_len;6271for (q = p; *q; q++)6272if (IS_PATH_SEPARATOR (*q))6273break;6274p_len = (size_t) (q - p);6275p_next = (*q == '\0' ? q : q + 1);6276if (p_len == 0)6277{6278/* empty path: current directory */6279if (getcwd (tmp, LT_PATHMAX) == NULL)6280lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",6281nonnull (strerror (errno)));6282tmp_len = strlen (tmp);6283concat_name =6284XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);6285memcpy (concat_name, tmp, tmp_len);6286concat_name[tmp_len] = '/';6287strcpy (concat_name + tmp_len + 1, wrapper);6288}6289else6290{6291concat_name =6292XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);6293memcpy (concat_name, p, p_len);6294concat_name[p_len] = '/';6295strcpy (concat_name + p_len + 1, wrapper);6296}6297if (check_executable (concat_name))6298return concat_name;6299XFREE (concat_name);6300}6301}6302/* not found in PATH; assume curdir */6303}6304/* Relative path | not found in path: prepend cwd */6305if (getcwd (tmp, LT_PATHMAX) == NULL)6306lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",6307nonnull (strerror (errno)));6308tmp_len = strlen (tmp);6309concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);6310memcpy (concat_name, tmp, tmp_len);6311concat_name[tmp_len] = '/';6312strcpy (concat_name + tmp_len + 1, wrapper);63136314if (check_executable (concat_name))6315return concat_name;6316XFREE (concat_name);6317return NULL;6318}63196320char *6321chase_symlinks (const char *pathspec)6322{6323#ifndef S_ISLNK6324return xstrdup (pathspec);6325#else6326char buf[LT_PATHMAX];6327struct stat s;6328char *tmp_pathspec = xstrdup (pathspec);6329char *p;6330int has_symlinks = 0;6331while (strlen (tmp_pathspec) && !has_symlinks)6332{6333lt_debugprintf (__FILE__, __LINE__,6334"checking path component for symlinks: %s\n",6335tmp_pathspec);6336if (lstat (tmp_pathspec, &s) == 0)6337{6338if (S_ISLNK (s.st_mode) != 0)6339{6340has_symlinks = 1;6341break;6342}63436344/* search backwards for last DIR_SEPARATOR */6345p = tmp_pathspec + strlen (tmp_pathspec) - 1;6346while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))6347p--;6348if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))6349{6350/* no more DIR_SEPARATORS left */6351break;6352}6353*p = '\0';6354}6355else6356{6357lt_fatal (__FILE__, __LINE__,6358"error accessing file \"%s\": %s",6359tmp_pathspec, nonnull (strerror (errno)));6360}6361}6362XFREE (tmp_pathspec);63636364if (!has_symlinks)6365{6366return xstrdup (pathspec);6367}63686369tmp_pathspec = realpath (pathspec, buf);6370if (tmp_pathspec == 0)6371{6372lt_fatal (__FILE__, __LINE__,6373"could not follow symlinks for %s", pathspec);6374}6375return xstrdup (tmp_pathspec);6376#endif6377}63786379char *6380strendzap (char *str, const char *pat)6381{6382size_t len, patlen;63836384assert (str != NULL);6385assert (pat != NULL);63866387len = strlen (str);6388patlen = strlen (pat);63896390if (patlen <= len)6391{6392str += len - patlen;6393if (STREQ (str, pat))6394*str = '\0';6395}6396return str;6397}63986399void6400lt_debugprintf (const char *file, int line, const char *fmt, ...)6401{6402va_list args;6403if (lt_debug)6404{6405(void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);6406va_start (args, fmt);6407(void) vfprintf (stderr, fmt, args);6408va_end (args);6409}6410}64116412static void6413lt_error_core (int exit_status, const char *file,6414int line, const char *mode,6415const char *message, va_list ap)6416{6417fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);6418vfprintf (stderr, message, ap);6419fprintf (stderr, ".\n");64206421if (exit_status >= 0)6422exit (exit_status);6423}64246425void6426lt_fatal (const char *file, int line, const char *message, ...)6427{6428va_list ap;6429va_start (ap, message);6430lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);6431va_end (ap);6432}64336434static const char *6435nonnull (const char *s)6436{6437return s ? s : "(null)";6438}64396440static const char *6441nonempty (const char *s)6442{6443return (s && !*s) ? "(empty)" : nonnull (s);6444}64456446void6447lt_setenv (const char *name, const char *value)6448{6449lt_debugprintf (__FILE__, __LINE__,6450"(lt_setenv) setting '%s' to '%s'\n",6451nonnull (name), nonnull (value));6452{6453#ifdef HAVE_SETENV6454/* always make a copy, for consistency with !HAVE_SETENV */6455char *str = xstrdup (value);6456setenv (name, str, 1);6457#else6458size_t len = strlen (name) + 1 + strlen (value) + 1;6459char *str = XMALLOC (char, len);6460sprintf (str, "%s=%s", name, value);6461if (putenv (str) != EXIT_SUCCESS)6462{6463XFREE (str);6464}6465#endif6466}6467}64686469char *6470lt_extend_str (const char *orig_value, const char *add, int to_end)6471{6472char *new_value;6473if (orig_value && *orig_value)6474{6475size_t orig_value_len = strlen (orig_value);6476size_t add_len = strlen (add);6477new_value = XMALLOC (char, add_len + orig_value_len + 1);6478if (to_end)6479{6480strcpy (new_value, orig_value);6481strcpy (new_value + orig_value_len, add);6482}6483else6484{6485strcpy (new_value, add);6486strcpy (new_value + add_len, orig_value);6487}6488}6489else6490{6491new_value = xstrdup (add);6492}6493return new_value;6494}64956496void6497lt_update_exe_path (const char *name, const char *value)6498{6499lt_debugprintf (__FILE__, __LINE__,6500"(lt_update_exe_path) modifying '%s' by prepending '%s'\n",6501nonnull (name), nonnull (value));65026503if (name && *name && value && *value)6504{6505char *new_value = lt_extend_str (getenv (name), value, 0);6506/* some systems can't cope with a ':'-terminated path #' */6507size_t len = strlen (new_value);6508while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))6509{6510new_value[--len] = '\0';6511}6512lt_setenv (name, new_value);6513XFREE (new_value);6514}6515}65166517void6518lt_update_lib_path (const char *name, const char *value)6519{6520lt_debugprintf (__FILE__, __LINE__,6521"(lt_update_lib_path) modifying '%s' by prepending '%s'\n",6522nonnull (name), nonnull (value));65236524if (name && *name && value && *value)6525{6526char *new_value = lt_extend_str (getenv (name), value, 0);6527lt_setenv (name, new_value);6528XFREE (new_value);6529}6530}65316532EOF6533case $host_os in6534mingw*)6535cat <<"EOF"65366537/* Prepares an argument vector before calling spawn().6538Note that spawn() does not by itself call the command interpreter6539(getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :6540({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);6541GetVersionEx(&v);6542v.dwPlatformId == VER_PLATFORM_WIN32_NT;6543}) ? "cmd.exe" : "command.com").6544Instead it simply concatenates the arguments, separated by ' ', and calls6545CreateProcess(). We must quote the arguments since Win32 CreateProcess()6546interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a6547special way:6548- Space and tab are interpreted as delimiters. They are not treated as6549delimiters if they are surrounded by double quotes: "...".6550- Unescaped double quotes are removed from the input. Their only effect is6551that within double quotes, space and tab are treated like normal6552characters.6553- Backslashes not followed by double quotes are not special.6554- But 2*n+1 backslashes followed by a double quote become6555n backslashes followed by a double quote (n >= 0):6556\" -> "6557\\\" -> \"6558\\\\\" -> \\"6559*/6560#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"6561#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"6562char **6563prepare_spawn (char **argv)6564{6565size_t argc;6566char **new_argv;6567size_t i;65686569/* Count number of arguments. */6570for (argc = 0; argv[argc] != NULL; argc++)6571;65726573/* Allocate new argument vector. */6574new_argv = XMALLOC (char *, argc + 1);65756576/* Put quoted arguments into the new argument vector. */6577for (i = 0; i < argc; i++)6578{6579const char *string = argv[i];65806581if (string[0] == '\0')6582new_argv[i] = xstrdup ("\"\"");6583else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)6584{6585int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);6586size_t length;6587unsigned int backslashes;6588const char *s;6589char *quoted_string;6590char *p;65916592length = 0;6593backslashes = 0;6594if (quote_around)6595length++;6596for (s = string; *s != '\0'; s++)6597{6598char c = *s;6599if (c == '"')6600length += backslashes + 1;6601length++;6602if (c == '\\')6603backslashes++;6604else6605backslashes = 0;6606}6607if (quote_around)6608length += backslashes + 1;66096610quoted_string = XMALLOC (char, length + 1);66116612p = quoted_string;6613backslashes = 0;6614if (quote_around)6615*p++ = '"';6616for (s = string; *s != '\0'; s++)6617{6618char c = *s;6619if (c == '"')6620{6621unsigned int j;6622for (j = backslashes + 1; j > 0; j--)6623*p++ = '\\';6624}6625*p++ = c;6626if (c == '\\')6627backslashes++;6628else6629backslashes = 0;6630}6631if (quote_around)6632{6633unsigned int j;6634for (j = backslashes; j > 0; j--)6635*p++ = '\\';6636*p++ = '"';6637}6638*p = '\0';66396640new_argv[i] = quoted_string;6641}6642else6643new_argv[i] = (char *) string;6644}6645new_argv[argc] = NULL;66466647return new_argv;6648}6649EOF6650;;6651esac66526653cat <<"EOF"6654void lt_dump_script (FILE* f)6655{6656EOF6657func_emit_wrapper yes |6658$SED -n -e '6659s/^\(.\{79\}\)\(..*\)/\1\6660\2/6661h6662s/\([\\"]\)/\\\1/g6663s/$/\\n/6664s/\([^\n]*\).*/ fputs ("\1", f);/p6665g6666D'6667cat <<"EOF"6668}6669EOF6670}6671# end: func_emit_cwrapperexe_src66726673# func_win32_import_lib_p ARG6674# True if ARG is an import lib, as indicated by $file_magic_cmd6675func_win32_import_lib_p ()6676{6677$debug_cmd66786679case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in6680*import*) : ;;6681*) false ;;6682esac6683}66846685# func_suncc_cstd_abi6686# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!6687# Several compiler flags select an ABI that is incompatible with the6688# Cstd library. Avoid specifying it if any are in CXXFLAGS.6689func_suncc_cstd_abi ()6690{6691$debug_cmd66926693case " $compile_command " in6694*" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)6695suncc_use_cstd_abi=no6696;;6697*)6698suncc_use_cstd_abi=yes6699;;6700esac6701}67026703# func_mode_link arg...6704func_mode_link ()6705{6706$debug_cmd67076708case $host in6709*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)6710# It is impossible to link a dll without this setting, and6711# we shouldn't force the makefile maintainer to figure out6712# what system we are compiling for in order to pass an extra6713# flag for every libtool invocation.6714# allow_undefined=no67156716# FIXME: Unfortunately, there are problems with the above when trying6717# to make a dll that has undefined symbols, in which case not6718# even a static library is built. For now, we need to specify6719# -no-undefined on the libtool link line when we can be certain6720# that all symbols are satisfied, otherwise we get a static library.6721allow_undefined=yes6722;;6723*)6724allow_undefined=yes6725;;6726esac6727libtool_args=$nonopt6728base_compile="$nonopt $@"6729compile_command=$nonopt6730finalize_command=$nonopt67316732compile_rpath=6733finalize_rpath=6734compile_shlibpath=6735finalize_shlibpath=6736convenience=6737old_convenience=6738deplibs=6739old_deplibs=6740compiler_flags=6741linker_flags=6742dllsearchpath=6743lib_search_path=`pwd`6744inst_prefix_dir=6745new_inherited_linker_flags=67466747avoid_version=no6748bindir=6749dlfiles=6750dlprefiles=6751dlself=no6752export_dynamic=no6753export_symbols=6754export_symbols_regex=6755generated=6756libobjs=6757ltlibs=6758module=no6759no_install=no6760objs=6761os2dllname=6762non_pic_objects=6763precious_files_regex=6764prefer_static_libs=no6765preload=false6766prev=6767prevarg=6768release=6769rpath=6770xrpath=6771perm_rpath=6772temp_rpath=6773thread_safe=no6774vinfo=6775vinfo_number=no6776weak_libs=6777single_module=$wl-single_module6778func_infer_tag $base_compile67796780# We need to know -static, to get the right output filenames.6781for arg6782do6783case $arg in6784-shared)6785test yes != "$build_libtool_libs" \6786&& func_fatal_configuration "cannot build a shared library"6787build_old_libs=no6788break6789;;6790-all-static | -static | -static-libtool-libs)6791case $arg in6792-all-static)6793if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then6794func_warning "complete static linking is impossible in this configuration"6795fi6796if test -n "$link_static_flag"; then6797dlopen_self=$dlopen_self_static6798fi6799prefer_static_libs=yes6800;;6801-static)6802if test -z "$pic_flag" && test -n "$link_static_flag"; then6803dlopen_self=$dlopen_self_static6804fi6805prefer_static_libs=built6806;;6807-static-libtool-libs)6808if test -z "$pic_flag" && test -n "$link_static_flag"; then6809dlopen_self=$dlopen_self_static6810fi6811prefer_static_libs=yes6812;;6813esac6814build_libtool_libs=no6815build_old_libs=yes6816break6817;;6818esac6819done68206821# See if our shared archives depend on static archives.6822test -n "$old_archive_from_new_cmds" && build_old_libs=yes68236824# Go through the arguments, transforming them on the way.6825while test "$#" -gt 0; do6826arg=$16827shift6828func_quote_arg pretty,unquoted "$arg"6829qarg=$func_quote_arg_unquoted_result6830func_append libtool_args " $func_quote_arg_result"68316832# If the previous option needs an argument, assign it.6833if test -n "$prev"; then6834case $prev in6835output)6836func_append compile_command " @OUTPUT@"6837func_append finalize_command " @OUTPUT@"6838;;6839esac68406841case $prev in6842bindir)6843bindir=$arg6844prev=6845continue6846;;6847dlfiles|dlprefiles)6848$preload || {6849# Add the symbol object into the linking commands.6850func_append compile_command " @SYMFILE@"6851func_append finalize_command " @SYMFILE@"6852preload=:6853}6854case $arg in6855*.la | *.lo) ;; # We handle these cases below.6856force)6857if test no = "$dlself"; then6858dlself=needless6859export_dynamic=yes6860fi6861prev=6862continue6863;;6864self)6865if test dlprefiles = "$prev"; then6866dlself=yes6867elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then6868dlself=yes6869else6870dlself=needless6871export_dynamic=yes6872fi6873prev=6874continue6875;;6876*)6877if test dlfiles = "$prev"; then6878func_append dlfiles " $arg"6879else6880func_append dlprefiles " $arg"6881fi6882prev=6883continue6884;;6885esac6886;;6887expsyms)6888export_symbols=$arg6889test -f "$arg" \6890|| func_fatal_error "symbol file '$arg' does not exist"6891prev=6892continue6893;;6894expsyms_regex)6895export_symbols_regex=$arg6896prev=6897continue6898;;6899framework)6900case $host in6901*-*-darwin*)6902case "$deplibs " in6903*" $qarg.ltframework "*) ;;6904*) func_append deplibs " $qarg.ltframework" # this is fixed later6905;;6906esac6907;;6908esac6909prev=6910continue6911;;6912inst_prefix)6913inst_prefix_dir=$arg6914prev=6915continue6916;;6917mllvm)6918# Clang does not use LLVM to link, so we can simply discard any6919# '-mllvm $arg' options when doing the link step.6920prev=6921continue6922;;6923objectlist)6924if test -f "$arg"; then6925save_arg=$arg6926moreargs=6927for fil in `cat "$save_arg"`6928do6929# func_append moreargs " $fil"6930arg=$fil6931# A libtool-controlled object.69326933# Check to see that this really is a libtool object.6934if func_lalib_unsafe_p "$arg"; then6935pic_object=6936non_pic_object=69376938# Read the .lo file6939func_source "$arg"69406941if test -z "$pic_object" ||6942test -z "$non_pic_object" ||6943test none = "$pic_object" &&6944test none = "$non_pic_object"; then6945func_fatal_error "cannot find name of object for '$arg'"6946fi69476948# Extract subdirectory from the argument.6949func_dirname "$arg" "/" ""6950xdir=$func_dirname_result69516952if test none != "$pic_object"; then6953# Prepend the subdirectory the object is found in.6954pic_object=$xdir$pic_object69556956if test dlfiles = "$prev"; then6957if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then6958func_append dlfiles " $pic_object"6959prev=6960continue6961else6962# If libtool objects are unsupported, then we need to preload.6963prev=dlprefiles6964fi6965fi69666967# CHECK ME: I think I busted this. -Ossama6968if test dlprefiles = "$prev"; then6969# Preload the old-style object.6970func_append dlprefiles " $pic_object"6971prev=6972fi69736974# A PIC object.6975func_append libobjs " $pic_object"6976arg=$pic_object6977fi69786979# Non-PIC object.6980if test none != "$non_pic_object"; then6981# Prepend the subdirectory the object is found in.6982non_pic_object=$xdir$non_pic_object69836984# A standard non-PIC object6985func_append non_pic_objects " $non_pic_object"6986if test -z "$pic_object" || test none = "$pic_object"; then6987arg=$non_pic_object6988fi6989else6990# If the PIC object exists, use it instead.6991# $xdir was prepended to $pic_object above.6992non_pic_object=$pic_object6993func_append non_pic_objects " $non_pic_object"6994fi6995else6996# Only an error if not doing a dry-run.6997if $opt_dry_run; then6998# Extract subdirectory from the argument.6999func_dirname "$arg" "/" ""7000xdir=$func_dirname_result70017002func_lo2o "$arg"7003pic_object=$xdir$objdir/$func_lo2o_result7004non_pic_object=$xdir$func_lo2o_result7005func_append libobjs " $pic_object"7006func_append non_pic_objects " $non_pic_object"7007else7008func_fatal_error "'$arg' is not a valid libtool object"7009fi7010fi7011done7012else7013func_fatal_error "link input file '$arg' does not exist"7014fi7015arg=$save_arg7016prev=7017continue7018;;7019os2dllname)7020os2dllname=$arg7021prev=7022continue7023;;7024precious_regex)7025precious_files_regex=$arg7026prev=7027continue7028;;7029release)7030release=-$arg7031prev=7032continue7033;;7034rpath | xrpath)7035# We need an absolute path.7036case $arg in7037[\\/]* | [A-Za-z]:[\\/]*) ;;7038*)7039func_fatal_error "only absolute run-paths are allowed"7040;;7041esac7042if test rpath = "$prev"; then7043case "$rpath " in7044*" $arg "*) ;;7045*) func_append rpath " $arg" ;;7046esac7047else7048case "$xrpath " in7049*" $arg "*) ;;7050*) func_append xrpath " $arg" ;;7051esac7052fi7053prev=7054continue7055;;7056shrext)7057shrext_cmds=$arg7058prev=7059continue7060;;7061weak)7062func_append weak_libs " $arg"7063prev=7064continue7065;;7066xcclinker)7067func_append linker_flags " $qarg"7068func_append compiler_flags " $qarg"7069prev=7070func_append compile_command " $qarg"7071func_append finalize_command " $qarg"7072continue7073;;7074xcompiler)7075func_append compiler_flags " $qarg"7076prev=7077func_append compile_command " $qarg"7078func_append finalize_command " $qarg"7079continue7080;;7081xlinker)7082func_append linker_flags " $qarg"7083func_append compiler_flags " $wl$qarg"7084prev=7085func_append compile_command " $wl$qarg"7086func_append finalize_command " $wl$qarg"7087continue7088;;7089*)7090eval "$prev=\"\$arg\""7091prev=7092continue7093;;7094esac7095fi # test -n "$prev"70967097prevarg=$arg70987099case $arg in7100-all-static)7101if test -n "$link_static_flag"; then7102# See comment for -static flag below, for more details.7103func_append compile_command " $link_static_flag"7104func_append finalize_command " $link_static_flag"7105fi7106continue7107;;71087109-allow-undefined)7110# FIXME: remove this flag sometime in the future.7111func_fatal_error "'-allow-undefined' must not be used because it is the default"7112;;71137114-avoid-version)7115avoid_version=yes7116continue7117;;71187119-bindir)7120prev=bindir7121continue7122;;71237124-dlopen)7125prev=dlfiles7126continue7127;;71287129-dlpreopen)7130prev=dlprefiles7131continue7132;;71337134-export-dynamic)7135export_dynamic=yes7136continue7137;;71387139-export-symbols | -export-symbols-regex)7140if test -n "$export_symbols" || test -n "$export_symbols_regex"; then7141func_fatal_error "more than one -exported-symbols argument is not allowed"7142fi7143if test X-export-symbols = "X$arg"; then7144prev=expsyms7145else7146prev=expsyms_regex7147fi7148continue7149;;71507151-framework)7152prev=framework7153continue7154;;71557156-inst-prefix-dir)7157prev=inst_prefix7158continue7159;;71607161# The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*7162# so, if we see these flags be careful not to treat them like -L7163-L[A-Z][A-Z]*:*)7164case $with_gcc/$host in7165no/*-*-irix* | /*-*-irix*)7166func_append compile_command " $arg"7167func_append finalize_command " $arg"7168;;7169esac7170continue7171;;71727173-L*)7174func_stripname "-L" '' "$arg"7175if test -z "$func_stripname_result"; then7176if test "$#" -gt 0; then7177func_fatal_error "require no space between '-L' and '$1'"7178else7179func_fatal_error "need path for '-L' option"7180fi7181fi7182func_resolve_sysroot "$func_stripname_result"7183dir=$func_resolve_sysroot_result7184# We need an absolute path.7185case $dir in7186[\\/]* | [A-Za-z]:[\\/]*) ;;7187*)7188absdir=`cd "$dir" && pwd`7189test -z "$absdir" && \7190func_fatal_error "cannot determine absolute directory name of '$dir'"7191dir=$absdir7192;;7193esac7194case "$deplibs " in7195*" -L$dir "* | *" $arg "*)7196# Will only happen for absolute or sysroot arguments7197;;7198*)7199# Preserve sysroot, but never include relative directories7200case $dir in7201[\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;7202*) func_append deplibs " -L$dir" ;;7203esac7204func_append lib_search_path " $dir"7205;;7206esac7207case $host in7208*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)7209testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`7210case :$dllsearchpath: in7211*":$dir:"*) ;;7212::) dllsearchpath=$dir;;7213*) func_append dllsearchpath ":$dir";;7214esac7215case :$dllsearchpath: in7216*":$testbindir:"*) ;;7217::) dllsearchpath=$testbindir;;7218*) func_append dllsearchpath ":$testbindir";;7219esac7220;;7221esac7222continue7223;;72247225-l*)7226if test X-lc = "X$arg" || test X-lm = "X$arg"; then7227case $host in7228*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)7229# These systems don't actually have a C or math library (as such)7230continue7231;;7232*-*-os2*)7233# These systems don't actually have a C library (as such)7234test X-lc = "X$arg" && continue7235;;7236*-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)7237# Do not include libc due to us having libc/libc_r.7238test X-lc = "X$arg" && continue7239;;7240*-*-rhapsody* | *-*-darwin1.[012])7241# Rhapsody C and math libraries are in the System framework7242func_append deplibs " System.ltframework"7243continue7244;;7245*-*-sco3.2v5* | *-*-sco5v6*)7246# Causes problems with __ctype7247test X-lc = "X$arg" && continue7248;;7249*-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)7250# Compiler inserts libc in the correct place for threads to work7251test X-lc = "X$arg" && continue7252;;7253esac7254elif test X-lc_r = "X$arg"; then7255case $host in7256*-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)7257# Do not include libc_r directly, use -pthread flag.7258continue7259;;7260esac7261fi7262func_append deplibs " $arg"7263continue7264;;72657266-mllvm)7267prev=mllvm7268continue7269;;72707271-module)7272module=yes7273continue7274;;72757276# Tru64 UNIX uses -model [arg] to determine the layout of C++7277# classes, name mangling, and exception handling.7278# Darwin uses the -arch flag to determine output architecture.7279-model|-arch|-isysroot|--sysroot)7280func_append compiler_flags " $arg"7281func_append compile_command " $arg"7282func_append finalize_command " $arg"7283prev=xcompiler7284continue7285;;72867287-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \7288|-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)7289func_append compiler_flags " $arg"7290func_append compile_command " $arg"7291func_append finalize_command " $arg"7292case "$new_inherited_linker_flags " in7293*" $arg "*) ;;7294* ) func_append new_inherited_linker_flags " $arg" ;;7295esac7296continue7297;;72987299-multi_module)7300single_module=$wl-multi_module7301continue7302;;73037304-no-fast-install)7305fast_install=no7306continue7307;;73087309-no-install)7310case $host in7311*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)7312# The PATH hackery in wrapper scripts is required on Windows7313# and Darwin in order for the loader to find any dlls it needs.7314func_warning "'-no-install' is ignored for $host"7315func_warning "assuming '-no-fast-install' instead"7316fast_install=no7317;;7318*) no_install=yes ;;7319esac7320continue7321;;73227323-no-undefined)7324allow_undefined=no7325continue7326;;73277328-objectlist)7329prev=objectlist7330continue7331;;73327333-os2dllname)7334prev=os2dllname7335continue7336;;73377338-o) prev=output ;;73397340-precious-files-regex)7341prev=precious_regex7342continue7343;;73447345-release)7346prev=release7347continue7348;;73497350-rpath)7351prev=rpath7352continue7353;;73547355-R)7356prev=xrpath7357continue7358;;73597360-R*)7361func_stripname '-R' '' "$arg"7362dir=$func_stripname_result7363# We need an absolute path.7364case $dir in7365[\\/]* | [A-Za-z]:[\\/]*) ;;7366=*)7367func_stripname '=' '' "$dir"7368dir=$lt_sysroot$func_stripname_result7369;;7370*)7371func_fatal_error "only absolute run-paths are allowed"7372;;7373esac7374case "$xrpath " in7375*" $dir "*) ;;7376*) func_append xrpath " $dir" ;;7377esac7378continue7379;;73807381-shared)7382# The effects of -shared are defined in a previous loop.7383continue7384;;73857386-shrext)7387prev=shrext7388continue7389;;73907391-static | -static-libtool-libs)7392# The effects of -static are defined in a previous loop.7393# We used to do the same as -all-static on platforms that7394# didn't have a PIC flag, but the assumption that the effects7395# would be equivalent was wrong. It would break on at least7396# Digital Unix and AIX.7397continue7398;;73997400-thread-safe)7401thread_safe=yes7402continue7403;;74047405-version-info)7406prev=vinfo7407continue7408;;74097410-version-number)7411prev=vinfo7412vinfo_number=yes7413continue7414;;74157416-weak)7417prev=weak7418continue7419;;74207421-Wc,*)7422func_stripname '-Wc,' '' "$arg"7423args=$func_stripname_result7424arg=7425save_ifs=$IFS; IFS=,7426for flag in $args; do7427IFS=$save_ifs7428func_quote_arg pretty "$flag"7429func_append arg " $func_quote_arg_result"7430func_append compiler_flags " $func_quote_arg_result"7431done7432IFS=$save_ifs7433func_stripname ' ' '' "$arg"7434arg=$func_stripname_result7435;;74367437-Wl,*)7438func_stripname '-Wl,' '' "$arg"7439args=$func_stripname_result7440arg=7441save_ifs=$IFS; IFS=,7442for flag in $args; do7443IFS=$save_ifs7444func_quote_arg pretty "$flag"7445func_append arg " $wl$func_quote_arg_result"7446func_append compiler_flags " $wl$func_quote_arg_result"7447func_append linker_flags " $func_quote_arg_result"7448done7449IFS=$save_ifs7450func_stripname ' ' '' "$arg"7451arg=$func_stripname_result7452;;74537454-Xcompiler)7455prev=xcompiler7456continue7457;;74587459-Xlinker)7460prev=xlinker7461continue7462;;74637464-XCClinker)7465prev=xcclinker7466continue7467;;74687469# -msg_* for osf cc7470-msg_*)7471func_quote_arg pretty "$arg"7472arg=$func_quote_arg_result7473;;74747475# Flags to be passed through unchanged, with rationale:7476# -64, -mips[0-9] enable 64-bit mode for the SGI compiler7477# -r[0-9][0-9]* specify processor for the SGI compiler7478# -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler7479# +DA*, +DD* enable 64-bit mode for the HP compiler7480# -q* compiler args for the IBM compiler7481# -m*, -t[45]*, -txscale* architecture-specific flags for GCC7482# -F/path path to uninstalled frameworks, gcc on darwin7483# -p, -pg, --coverage, -fprofile-* profiling flags for GCC7484# -fstack-protector* stack protector flags for GCC7485# @file GCC response files7486# -tp=* Portland pgcc target processor selection7487# --sysroot=* for sysroot support7488# -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization7489# -specs=* GCC specs files7490# -stdlib=* select c++ std lib with clang7491# -fsanitize=* Clang/GCC memory and address sanitizer7492# -fuse-ld=* Linker select flags for GCC7493-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \7494-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \7495-O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \7496-specs=*|-fsanitize=*|-fuse-ld=*)7497func_quote_arg pretty "$arg"7498arg=$func_quote_arg_result7499func_append compile_command " $arg"7500func_append finalize_command " $arg"7501func_append compiler_flags " $arg"7502continue7503;;75047505-Z*)7506if test os2 = "`expr $host : '.*\(os2\)'`"; then7507# OS/2 uses -Zxxx to specify OS/2-specific options7508compiler_flags="$compiler_flags $arg"7509func_append compile_command " $arg"7510func_append finalize_command " $arg"7511case $arg in7512-Zlinker | -Zstack)7513prev=xcompiler7514;;7515esac7516continue7517else7518# Otherwise treat like 'Some other compiler flag' below7519func_quote_arg pretty "$arg"7520arg=$func_quote_arg_result7521fi7522;;75237524# Some other compiler flag.7525-* | +*)7526func_quote_arg pretty "$arg"7527arg=$func_quote_arg_result7528;;75297530*.$objext)7531# A standard object.7532func_append objs " $arg"7533;;75347535*.lo)7536# A libtool-controlled object.75377538# Check to see that this really is a libtool object.7539if func_lalib_unsafe_p "$arg"; then7540pic_object=7541non_pic_object=75427543# Read the .lo file7544func_source "$arg"75457546if test -z "$pic_object" ||7547test -z "$non_pic_object" ||7548test none = "$pic_object" &&7549test none = "$non_pic_object"; then7550func_fatal_error "cannot find name of object for '$arg'"7551fi75527553# Extract subdirectory from the argument.7554func_dirname "$arg" "/" ""7555xdir=$func_dirname_result75567557test none = "$pic_object" || {7558# Prepend the subdirectory the object is found in.7559pic_object=$xdir$pic_object75607561if test dlfiles = "$prev"; then7562if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then7563func_append dlfiles " $pic_object"7564prev=7565continue7566else7567# If libtool objects are unsupported, then we need to preload.7568prev=dlprefiles7569fi7570fi75717572# CHECK ME: I think I busted this. -Ossama7573if test dlprefiles = "$prev"; then7574# Preload the old-style object.7575func_append dlprefiles " $pic_object"7576prev=7577fi75787579# A PIC object.7580func_append libobjs " $pic_object"7581arg=$pic_object7582}75837584# Non-PIC object.7585if test none != "$non_pic_object"; then7586# Prepend the subdirectory the object is found in.7587non_pic_object=$xdir$non_pic_object75887589# A standard non-PIC object7590func_append non_pic_objects " $non_pic_object"7591if test -z "$pic_object" || test none = "$pic_object"; then7592arg=$non_pic_object7593fi7594else7595# If the PIC object exists, use it instead.7596# $xdir was prepended to $pic_object above.7597non_pic_object=$pic_object7598func_append non_pic_objects " $non_pic_object"7599fi7600else7601# Only an error if not doing a dry-run.7602if $opt_dry_run; then7603# Extract subdirectory from the argument.7604func_dirname "$arg" "/" ""7605xdir=$func_dirname_result76067607func_lo2o "$arg"7608pic_object=$xdir$objdir/$func_lo2o_result7609non_pic_object=$xdir$func_lo2o_result7610func_append libobjs " $pic_object"7611func_append non_pic_objects " $non_pic_object"7612else7613func_fatal_error "'$arg' is not a valid libtool object"7614fi7615fi7616;;76177618*.$libext)7619# An archive.7620func_append deplibs " $arg"7621func_append old_deplibs " $arg"7622continue7623;;76247625*.la)7626# A libtool-controlled library.76277628func_resolve_sysroot "$arg"7629if test dlfiles = "$prev"; then7630# This library was specified with -dlopen.7631func_append dlfiles " $func_resolve_sysroot_result"7632prev=7633elif test dlprefiles = "$prev"; then7634# The library was specified with -dlpreopen.7635func_append dlprefiles " $func_resolve_sysroot_result"7636prev=7637else7638func_append deplibs " $func_resolve_sysroot_result"7639fi7640continue7641;;76427643# Some other compiler argument.7644*)7645# Unknown arguments in both finalize_command and compile_command need7646# to be aesthetically quoted because they are evaled later.7647func_quote_arg pretty "$arg"7648arg=$func_quote_arg_result7649;;7650esac # arg76517652# Now actually substitute the argument into the commands.7653if test -n "$arg"; then7654func_append compile_command " $arg"7655func_append finalize_command " $arg"7656fi7657done # argument parsing loop76587659test -n "$prev" && \7660func_fatal_help "the '$prevarg' option requires an argument"76617662if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then7663eval arg=\"$export_dynamic_flag_spec\"7664func_append compile_command " $arg"7665func_append finalize_command " $arg"7666fi76677668oldlibs=7669# calculate the name of the file, without its directory7670func_basename "$output"7671outputname=$func_basename_result7672libobjs_save=$libobjs76737674if test -n "$shlibpath_var"; then7675# get the directories listed in $shlibpath_var7676eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`7677else7678shlib_search_path=7679fi7680eval sys_lib_search_path=\"$sys_lib_search_path_spec\"7681eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"76827683# Definition is injected by LT_CONFIG during libtool generation.7684func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"76857686func_dirname "$output" "/" ""7687output_objdir=$func_dirname_result$objdir7688func_to_tool_file "$output_objdir/"7689tool_output_objdir=$func_to_tool_file_result7690# Create the object directory.7691func_mkdir_p "$output_objdir"76927693# Determine the type of output7694case $output in7695"")7696func_fatal_help "you must specify an output file"7697;;7698*.$libext) linkmode=oldlib ;;7699*.lo | *.$objext) linkmode=obj ;;7700*.la) linkmode=lib ;;7701*) linkmode=prog ;; # Anything else should be a program.7702esac77037704specialdeplibs=77057706libs=7707# Find all interdependent deplibs by searching for libraries7708# that are linked more than once (e.g. -la -lb -la)7709for deplib in $deplibs; do7710if $opt_preserve_dup_deps; then7711case "$libs " in7712*" $deplib "*) func_append specialdeplibs " $deplib" ;;7713esac7714fi7715func_append libs " $deplib"7716done77177718if test lib = "$linkmode"; then7719libs="$predeps $libs $compiler_lib_search_path $postdeps"77207721# Compute libraries that are listed more than once in $predeps7722# $postdeps and mark them as special (i.e., whose duplicates are7723# not to be eliminated).7724pre_post_deps=7725if $opt_duplicate_compiler_generated_deps; then7726for pre_post_dep in $predeps $postdeps; do7727case "$pre_post_deps " in7728*" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;7729esac7730func_append pre_post_deps " $pre_post_dep"7731done7732fi7733pre_post_deps=7734fi77357736deplibs=7737newdependency_libs=7738newlib_search_path=7739need_relink=no # whether we're linking any uninstalled libtool libraries7740notinst_deplibs= # not-installed libtool libraries7741notinst_path= # paths that contain not-installed libtool libraries77427743case $linkmode in7744lib)7745passes="conv dlpreopen link"7746for file in $dlfiles $dlprefiles; do7747case $file in7748*.la) ;;7749*)7750func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"7751;;7752esac7753done7754;;7755prog)7756compile_deplibs=7757finalize_deplibs=7758alldeplibs=false7759newdlfiles=7760newdlprefiles=7761passes="conv scan dlopen dlpreopen link"7762;;7763*) passes="conv"7764;;7765esac77667767for pass in $passes; do7768# The preopen pass in lib mode reverses $deplibs; put it back here7769# so that -L comes before libs that need it for instance...7770if test lib,link = "$linkmode,$pass"; then7771## FIXME: Find the place where the list is rebuilt in the wrong7772## order, and fix it there properly7773tmp_deplibs=7774for deplib in $deplibs; do7775tmp_deplibs="$deplib $tmp_deplibs"7776done7777deplibs=$tmp_deplibs7778fi77797780if test lib,link = "$linkmode,$pass" ||7781test prog,scan = "$linkmode,$pass"; then7782libs=$deplibs7783deplibs=7784fi7785if test prog = "$linkmode"; then7786case $pass in7787dlopen) libs=$dlfiles ;;7788dlpreopen) libs=$dlprefiles ;;7789link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;7790esac7791fi7792if test lib,dlpreopen = "$linkmode,$pass"; then7793# Collect and forward deplibs of preopened libtool libs7794for lib in $dlprefiles; do7795# Ignore non-libtool-libs7796dependency_libs=7797func_resolve_sysroot "$lib"7798case $lib in7799*.la) func_source "$func_resolve_sysroot_result" ;;7800esac78017802# Collect preopened libtool deplibs, except any this library7803# has declared as weak libs7804for deplib in $dependency_libs; do7805func_basename "$deplib"7806deplib_base=$func_basename_result7807case " $weak_libs " in7808*" $deplib_base "*) ;;7809*) func_append deplibs " $deplib" ;;7810esac7811done7812done7813libs=$dlprefiles7814fi7815if test dlopen = "$pass"; then7816# Collect dlpreopened libraries7817save_deplibs=$deplibs7818deplibs=7819fi78207821for deplib in $libs; do7822lib=7823found=false7824case $deplib in7825-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \7826|-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)7827if test prog,link = "$linkmode,$pass"; then7828compile_deplibs="$deplib $compile_deplibs"7829finalize_deplibs="$deplib $finalize_deplibs"7830else7831func_append compiler_flags " $deplib"7832if test lib = "$linkmode"; then7833case "$new_inherited_linker_flags " in7834*" $deplib "*) ;;7835* ) func_append new_inherited_linker_flags " $deplib" ;;7836esac7837fi7838fi7839continue7840;;7841-l*)7842if test lib != "$linkmode" && test prog != "$linkmode"; then7843func_warning "'-l' is ignored for archives/objects"7844continue7845fi7846func_stripname '-l' '' "$deplib"7847name=$func_stripname_result7848if test lib = "$linkmode"; then7849searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"7850else7851searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"7852fi7853for searchdir in $searchdirs; do7854for search_ext in .la $std_shrext .so .a; do7855# Search the libtool library7856lib=$searchdir/lib$name$search_ext7857if test -f "$lib"; then7858if test .la = "$search_ext"; then7859found=:7860else7861found=false7862fi7863break 27864fi7865done7866done7867if $found; then7868# deplib is a libtool library7869# If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,7870# We need to do some special things here, and not later.7871if test yes = "$allow_libtool_libs_with_static_runtimes"; then7872case " $predeps $postdeps " in7873*" $deplib "*)7874if func_lalib_p "$lib"; then7875library_names=7876old_library=7877func_source "$lib"7878for l in $old_library $library_names; do7879ll=$l7880done7881if test "X$ll" = "X$old_library"; then # only static version available7882found=false7883func_dirname "$lib" "" "."7884ladir=$func_dirname_result7885lib=$ladir/$old_library7886if test prog,link = "$linkmode,$pass"; then7887compile_deplibs="$deplib $compile_deplibs"7888finalize_deplibs="$deplib $finalize_deplibs"7889else7890deplibs="$deplib $deplibs"7891test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"7892fi7893continue7894fi7895fi7896;;7897*) ;;7898esac7899fi7900else7901# deplib doesn't seem to be a libtool library7902if test prog,link = "$linkmode,$pass"; then7903compile_deplibs="$deplib $compile_deplibs"7904finalize_deplibs="$deplib $finalize_deplibs"7905else7906deplibs="$deplib $deplibs"7907test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"7908fi7909continue7910fi7911;; # -l7912*.ltframework)7913if test prog,link = "$linkmode,$pass"; then7914compile_deplibs="$deplib $compile_deplibs"7915finalize_deplibs="$deplib $finalize_deplibs"7916else7917deplibs="$deplib $deplibs"7918if test lib = "$linkmode"; then7919case "$new_inherited_linker_flags " in7920*" $deplib "*) ;;7921* ) func_append new_inherited_linker_flags " $deplib" ;;7922esac7923fi7924fi7925continue7926;;7927-L*)7928case $linkmode in7929lib)7930deplibs="$deplib $deplibs"7931test conv = "$pass" && continue7932newdependency_libs="$deplib $newdependency_libs"7933func_stripname '-L' '' "$deplib"7934func_resolve_sysroot "$func_stripname_result"7935func_append newlib_search_path " $func_resolve_sysroot_result"7936;;7937prog)7938if test conv = "$pass"; then7939deplibs="$deplib $deplibs"7940continue7941fi7942if test scan = "$pass"; then7943deplibs="$deplib $deplibs"7944else7945compile_deplibs="$deplib $compile_deplibs"7946finalize_deplibs="$deplib $finalize_deplibs"7947fi7948func_stripname '-L' '' "$deplib"7949func_resolve_sysroot "$func_stripname_result"7950func_append newlib_search_path " $func_resolve_sysroot_result"7951;;7952*)7953func_warning "'-L' is ignored for archives/objects"7954;;7955esac # linkmode7956continue7957;; # -L7958-R*)7959if test link = "$pass"; then7960func_stripname '-R' '' "$deplib"7961func_resolve_sysroot "$func_stripname_result"7962dir=$func_resolve_sysroot_result7963# Make sure the xrpath contains only unique directories.7964case "$xrpath " in7965*" $dir "*) ;;7966*) func_append xrpath " $dir" ;;7967esac7968fi7969deplibs="$deplib $deplibs"7970continue7971;;7972*.la)7973func_resolve_sysroot "$deplib"7974lib=$func_resolve_sysroot_result7975;;7976*.$libext)7977if test conv = "$pass"; then7978deplibs="$deplib $deplibs"7979continue7980fi7981case $linkmode in7982lib)7983# Linking convenience modules into shared libraries is allowed,7984# but linking other static libraries is non-portable.7985case " $dlpreconveniencelibs " in7986*" $deplib "*) ;;7987*)7988valid_a_lib=false7989case $deplibs_check_method in7990match_pattern*)7991set dummy $deplibs_check_method; shift7992match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`7993if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \7994| $EGREP "$match_pattern_regex" > /dev/null; then7995valid_a_lib=:7996fi7997;;7998pass_all)7999valid_a_lib=:8000;;8001esac8002if $valid_a_lib; then8003echo8004$ECHO "*** Warning: Linking the shared library $output against the"8005$ECHO "*** static library $deplib is not portable!"8006deplibs="$deplib $deplibs"8007else8008echo8009$ECHO "*** Warning: Trying to link with static lib archive $deplib."8010echo "*** I have the capability to make that library automatically link in when"8011echo "*** you link to this library. But I can only do this if you have a"8012echo "*** shared version of the library, which you do not appear to have"8013echo "*** because the file extensions .$libext of this argument makes me believe"8014echo "*** that it is just a static archive that I should not use here."8015fi8016;;8017esac8018continue8019;;8020prog)8021if test link != "$pass"; then8022deplibs="$deplib $deplibs"8023else8024compile_deplibs="$deplib $compile_deplibs"8025finalize_deplibs="$deplib $finalize_deplibs"8026fi8027continue8028;;8029esac # linkmode8030;; # *.$libext8031*.lo | *.$objext)8032if test conv = "$pass"; then8033deplibs="$deplib $deplibs"8034elif test prog = "$linkmode"; then8035if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then8036# If there is no dlopen support or we're linking statically,8037# we need to preload.8038func_append newdlprefiles " $deplib"8039compile_deplibs="$deplib $compile_deplibs"8040finalize_deplibs="$deplib $finalize_deplibs"8041else8042func_append newdlfiles " $deplib"8043fi8044fi8045continue8046;;8047%DEPLIBS%)8048alldeplibs=:8049continue8050;;8051esac # case $deplib80528053$found || test -f "$lib" \8054|| func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"80558056# Check to see that this really is a libtool archive.8057func_lalib_unsafe_p "$lib" \8058|| func_fatal_error "'$lib' is not a valid libtool archive"80598060func_dirname "$lib" "" "."8061ladir=$func_dirname_result80628063dlname=8064dlopen=8065dlpreopen=8066libdir=8067library_names=8068old_library=8069inherited_linker_flags=8070# If the library was installed with an old release of libtool,8071# it will not redefine variables installed, or shouldnotlink8072installed=yes8073shouldnotlink=no8074avoidtemprpath=807580768077# Read the .la file8078func_source "$lib"80798080# Convert "-framework foo" to "foo.ltframework"8081if test -n "$inherited_linker_flags"; then8082tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`8083for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do8084case " $new_inherited_linker_flags " in8085*" $tmp_inherited_linker_flag "*) ;;8086*) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;8087esac8088done8089fi8090dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`8091if test lib,link = "$linkmode,$pass" ||8092test prog,scan = "$linkmode,$pass" ||8093{ test prog != "$linkmode" && test lib != "$linkmode"; }; then8094test -n "$dlopen" && func_append dlfiles " $dlopen"8095test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"8096fi80978098if test conv = "$pass"; then8099# Only check for convenience libraries8100deplibs="$lib $deplibs"8101if test -z "$libdir"; then8102if test -z "$old_library"; then8103func_fatal_error "cannot find name of link library for '$lib'"8104fi8105# It is a libtool convenience library, so add in its objects.8106func_append convenience " $ladir/$objdir/$old_library"8107func_append old_convenience " $ladir/$objdir/$old_library"8108elif test prog != "$linkmode" && test lib != "$linkmode"; then8109func_fatal_error "'$lib' is not a convenience library"8110fi8111tmp_libs=8112for deplib in $dependency_libs; do8113deplibs="$deplib $deplibs"8114if $opt_preserve_dup_deps; then8115case "$tmp_libs " in8116*" $deplib "*) func_append specialdeplibs " $deplib" ;;8117esac8118fi8119func_append tmp_libs " $deplib"8120done8121continue8122fi # $pass = conv812381248125# Get the name of the library we link against.8126linklib=8127if test -n "$old_library" &&8128{ test yes = "$prefer_static_libs" ||8129test built,no = "$prefer_static_libs,$installed"; }; then8130linklib=$old_library8131else8132for l in $old_library $library_names; do8133linklib=$l8134done8135fi8136if test -z "$linklib"; then8137func_fatal_error "cannot find name of link library for '$lib'"8138fi81398140# This library was specified with -dlopen.8141if test dlopen = "$pass"; then8142test -z "$libdir" \8143&& func_fatal_error "cannot -dlopen a convenience library: '$lib'"8144if test -z "$dlname" ||8145test yes != "$dlopen_support" ||8146test no = "$build_libtool_libs"8147then8148# If there is no dlname, no dlopen support or we're linking8149# statically, we need to preload. We also need to preload any8150# dependent libraries so libltdl's deplib preloader doesn't8151# bomb out in the load deplibs phase.8152func_append dlprefiles " $lib $dependency_libs"8153else8154func_append newdlfiles " $lib"8155fi8156continue8157fi # $pass = dlopen81588159# We need an absolute path.8160case $ladir in8161[\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;8162*)8163abs_ladir=`cd "$ladir" && pwd`8164if test -z "$abs_ladir"; then8165func_warning "cannot determine absolute directory name of '$ladir'"8166func_warning "passing it literally to the linker, although it might fail"8167abs_ladir=$ladir8168fi8169;;8170esac8171func_basename "$lib"8172laname=$func_basename_result81738174# Find the relevant object directory and library name.8175if test yes = "$installed"; then8176if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then8177func_warning "library '$lib' was moved."8178dir=$ladir8179absdir=$abs_ladir8180libdir=$abs_ladir8181else8182dir=$lt_sysroot$libdir8183absdir=$lt_sysroot$libdir8184fi8185test yes = "$hardcode_automatic" && avoidtemprpath=yes8186else8187if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then8188dir=$ladir8189absdir=$abs_ladir8190# Remove this search path later8191func_append notinst_path " $abs_ladir"8192else8193dir=$ladir/$objdir8194absdir=$abs_ladir/$objdir8195# Remove this search path later8196func_append notinst_path " $abs_ladir"8197fi8198fi # $installed = yes8199func_stripname 'lib' '.la' "$laname"8200name=$func_stripname_result82018202# This library was specified with -dlpreopen.8203if test dlpreopen = "$pass"; then8204if test -z "$libdir" && test prog = "$linkmode"; then8205func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"8206fi8207case $host in8208# special handling for platforms with PE-DLLs.8209*cygwin* | *mingw* | *cegcc* )8210# Linker will automatically link against shared library if both8211# static and shared are present. Therefore, ensure we extract8212# symbols from the import library if a shared library is present8213# (otherwise, the dlopen module name will be incorrect). We do8214# this by putting the import library name into $newdlprefiles.8215# We recover the dlopen module name by 'saving' the la file8216# name in a special purpose variable, and (later) extracting the8217# dlname from the la file.8218if test -n "$dlname"; then8219func_tr_sh "$dir/$linklib"8220eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"8221func_append newdlprefiles " $dir/$linklib"8222else8223func_append newdlprefiles " $dir/$old_library"8224# Keep a list of preopened convenience libraries to check8225# that they are being used correctly in the link pass.8226test -z "$libdir" && \8227func_append dlpreconveniencelibs " $dir/$old_library"8228fi8229;;8230* )8231# Prefer using a static library (so that no silly _DYNAMIC symbols8232# are required to link).8233if test -n "$old_library"; then8234func_append newdlprefiles " $dir/$old_library"8235# Keep a list of preopened convenience libraries to check8236# that they are being used correctly in the link pass.8237test -z "$libdir" && \8238func_append dlpreconveniencelibs " $dir/$old_library"8239# Otherwise, use the dlname, so that lt_dlopen finds it.8240elif test -n "$dlname"; then8241func_append newdlprefiles " $dir/$dlname"8242else8243func_append newdlprefiles " $dir/$linklib"8244fi8245;;8246esac8247fi # $pass = dlpreopen82488249if test -z "$libdir"; then8250# Link the convenience library8251if test lib = "$linkmode"; then8252deplibs="$dir/$old_library $deplibs"8253elif test prog,link = "$linkmode,$pass"; then8254compile_deplibs="$dir/$old_library $compile_deplibs"8255finalize_deplibs="$dir/$old_library $finalize_deplibs"8256else8257deplibs="$lib $deplibs" # used for prog,scan pass8258fi8259continue8260fi826182628263if test prog = "$linkmode" && test link != "$pass"; then8264func_append newlib_search_path " $ladir"8265deplibs="$lib $deplibs"82668267linkalldeplibs=false8268if test no != "$link_all_deplibs" || test -z "$library_names" ||8269test no = "$build_libtool_libs"; then8270linkalldeplibs=:8271fi82728273tmp_libs=8274for deplib in $dependency_libs; do8275case $deplib in8276-L*) func_stripname '-L' '' "$deplib"8277func_resolve_sysroot "$func_stripname_result"8278func_append newlib_search_path " $func_resolve_sysroot_result"8279;;8280esac8281# Need to link against all dependency_libs?8282if $linkalldeplibs; then8283deplibs="$deplib $deplibs"8284else8285# Need to hardcode shared library paths8286# or/and link against static libraries8287newdependency_libs="$deplib $newdependency_libs"8288fi8289if $opt_preserve_dup_deps; then8290case "$tmp_libs " in8291*" $deplib "*) func_append specialdeplibs " $deplib" ;;8292esac8293fi8294func_append tmp_libs " $deplib"8295done # for deplib8296continue8297fi # $linkmode = prog...82988299if test prog,link = "$linkmode,$pass"; then8300if test -n "$library_names" &&8301{ { test no = "$prefer_static_libs" ||8302test built,yes = "$prefer_static_libs,$installed"; } ||8303test -z "$old_library"; }; then8304# We need to hardcode the library path8305if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then8306# Make sure the rpath contains only unique directories.8307case $temp_rpath: in8308*"$absdir:"*) ;;8309*) func_append temp_rpath "$absdir:" ;;8310esac8311fi83128313# Hardcode the library path.8314# Skip directories that are in the system default run-time8315# search path.8316case " $sys_lib_dlsearch_path " in8317*" $absdir "*) ;;8318*)8319case "$compile_rpath " in8320*" $absdir "*) ;;8321*) func_append compile_rpath " $absdir" ;;8322esac8323;;8324esac8325case " $sys_lib_dlsearch_path " in8326*" $libdir "*) ;;8327*)8328case "$finalize_rpath " in8329*" $libdir "*) ;;8330*) func_append finalize_rpath " $libdir" ;;8331esac8332;;8333esac8334fi # $linkmode,$pass = prog,link...83358336if $alldeplibs &&8337{ test pass_all = "$deplibs_check_method" ||8338{ test yes = "$build_libtool_libs" &&8339test -n "$library_names"; }; }; then8340# We only need to search for static libraries8341continue8342fi8343fi83448345link_static=no # Whether the deplib will be linked statically8346use_static_libs=$prefer_static_libs8347if test built = "$use_static_libs" && test yes = "$installed"; then8348use_static_libs=no8349fi8350if test -n "$library_names" &&8351{ test no = "$use_static_libs" || test -z "$old_library"; }; then8352case $host in8353*cygwin* | *mingw* | *cegcc* | *os2*)8354# No point in relinking DLLs because paths are not encoded8355func_append notinst_deplibs " $lib"8356need_relink=no8357;;8358*)8359if test no = "$installed"; then8360func_append notinst_deplibs " $lib"8361need_relink=yes8362fi8363;;8364esac8365# This is a shared library83668367# Warn about portability, can't link against -module's on some8368# systems (darwin). Don't bleat about dlopened modules though!8369dlopenmodule=8370for dlpremoduletest in $dlprefiles; do8371if test "X$dlpremoduletest" = "X$lib"; then8372dlopenmodule=$dlpremoduletest8373break8374fi8375done8376if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then8377echo8378if test prog = "$linkmode"; then8379$ECHO "*** Warning: Linking the executable $output against the loadable module"8380else8381$ECHO "*** Warning: Linking the shared library $output against the loadable module"8382fi8383$ECHO "*** $linklib is not portable!"8384fi8385if test lib = "$linkmode" &&8386test yes = "$hardcode_into_libs"; then8387# Hardcode the library path.8388# Skip directories that are in the system default run-time8389# search path.8390case " $sys_lib_dlsearch_path " in8391*" $absdir "*) ;;8392*)8393case "$compile_rpath " in8394*" $absdir "*) ;;8395*) func_append compile_rpath " $absdir" ;;8396esac8397;;8398esac8399case " $sys_lib_dlsearch_path " in8400*" $libdir "*) ;;8401*)8402case "$finalize_rpath " in8403*" $libdir "*) ;;8404*) func_append finalize_rpath " $libdir" ;;8405esac8406;;8407esac8408fi84098410if test -n "$old_archive_from_expsyms_cmds"; then8411# figure out the soname8412set dummy $library_names8413shift8414realname=$18415shift8416libname=`eval "\\$ECHO \"$libname_spec\""`8417# use dlname if we got it. it's perfectly good, no?8418if test -n "$dlname"; then8419soname=$dlname8420elif test -n "$soname_spec"; then8421# bleh windows8422case $host in8423*cygwin* | mingw* | *cegcc* | *os2*)8424func_arith $current - $age8425major=$func_arith_result8426versuffix=-$major8427;;8428esac8429eval soname=\"$soname_spec\"8430else8431soname=$realname8432fi84338434# Make a new name for the extract_expsyms_cmds to use8435soroot=$soname8436func_basename "$soroot"8437soname=$func_basename_result8438func_stripname 'lib' '.dll' "$soname"8439newlib=libimp-$func_stripname_result.a84408441# If the library has no export list, then create one now8442if test -f "$output_objdir/$soname-def"; then :8443else8444func_verbose "extracting exported symbol list from '$soname'"8445func_execute_cmds "$extract_expsyms_cmds" 'exit $?'8446fi84478448# Create $newlib8449if test -f "$output_objdir/$newlib"; then :; else8450func_verbose "generating import library for '$soname'"8451func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'8452fi8453# make sure the library variables are pointing to the new library8454dir=$output_objdir8455linklib=$newlib8456fi # test -n "$old_archive_from_expsyms_cmds"84578458if test prog = "$linkmode" || test relink != "$opt_mode"; then8459add_shlibpath=8460add_dir=8461add=8462lib_linked=yes8463case $hardcode_action in8464immediate | unsupported)8465if test no = "$hardcode_direct"; then8466add=$dir/$linklib8467case $host in8468*-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;8469*-*-sysv4*uw2*) add_dir=-L$dir ;;8470*-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \8471*-*-unixware7*) add_dir=-L$dir ;;8472*-*-darwin* )8473# if the lib is a (non-dlopened) module then we cannot8474# link against it, someone is ignoring the earlier warnings8475if /usr/bin/file -L $add 2> /dev/null |8476$GREP ": [^:]* bundle" >/dev/null; then8477if test "X$dlopenmodule" != "X$lib"; then8478$ECHO "*** Warning: lib $linklib is a module, not a shared library"8479if test -z "$old_library"; then8480echo8481echo "*** And there doesn't seem to be a static archive available"8482echo "*** The link will probably fail, sorry"8483else8484add=$dir/$old_library8485fi8486elif test -n "$old_library"; then8487add=$dir/$old_library8488fi8489fi8490esac8491elif test no = "$hardcode_minus_L"; then8492case $host in8493*-*-sunos*) add_shlibpath=$dir ;;8494esac8495add_dir=-L$dir8496add=-l$name8497elif test no = "$hardcode_shlibpath_var"; then8498add_shlibpath=$dir8499add=-l$name8500else8501lib_linked=no8502fi8503;;8504relink)8505if test yes = "$hardcode_direct" &&8506test no = "$hardcode_direct_absolute"; then8507add=$dir/$linklib8508elif test yes = "$hardcode_minus_L"; then8509add_dir=-L$absdir8510# Try looking first in the location we're being installed to.8511if test -n "$inst_prefix_dir"; then8512case $libdir in8513[\\/]*)8514func_append add_dir " -L$inst_prefix_dir$libdir"8515;;8516esac8517fi8518add=-l$name8519elif test yes = "$hardcode_shlibpath_var"; then8520add_shlibpath=$dir8521add=-l$name8522else8523lib_linked=no8524fi8525;;8526*) lib_linked=no ;;8527esac85288529if test yes != "$lib_linked"; then8530func_fatal_configuration "unsupported hardcode properties"8531fi85328533if test -n "$add_shlibpath"; then8534case :$compile_shlibpath: in8535*":$add_shlibpath:"*) ;;8536*) func_append compile_shlibpath "$add_shlibpath:" ;;8537esac8538fi8539if test prog = "$linkmode"; then8540test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"8541test -n "$add" && compile_deplibs="$add $compile_deplibs"8542else8543test -n "$add_dir" && deplibs="$add_dir $deplibs"8544test -n "$add" && deplibs="$add $deplibs"8545if test yes != "$hardcode_direct" &&8546test yes != "$hardcode_minus_L" &&8547test yes = "$hardcode_shlibpath_var"; then8548case :$finalize_shlibpath: in8549*":$libdir:"*) ;;8550*) func_append finalize_shlibpath "$libdir:" ;;8551esac8552fi8553fi8554fi85558556if test prog = "$linkmode" || test relink = "$opt_mode"; then8557add_shlibpath=8558add_dir=8559add=8560# Finalize command for both is simple: just hardcode it.8561if test yes = "$hardcode_direct" &&8562test no = "$hardcode_direct_absolute"; then8563add=$libdir/$linklib8564elif test yes = "$hardcode_minus_L"; then8565add_dir=-L$libdir8566add=-l$name8567elif test yes = "$hardcode_shlibpath_var"; then8568case :$finalize_shlibpath: in8569*":$libdir:"*) ;;8570*) func_append finalize_shlibpath "$libdir:" ;;8571esac8572add=-l$name8573elif test yes = "$hardcode_automatic"; then8574if test -n "$inst_prefix_dir" &&8575test -f "$inst_prefix_dir$libdir/$linklib"; then8576add=$inst_prefix_dir$libdir/$linklib8577else8578add=$libdir/$linklib8579fi8580else8581# We cannot seem to hardcode it, guess we'll fake it.8582add_dir=-L$libdir8583# Try looking first in the location we're being installed to.8584if test -n "$inst_prefix_dir"; then8585case $libdir in8586[\\/]*)8587func_append add_dir " -L$inst_prefix_dir$libdir"8588;;8589esac8590fi8591add=-l$name8592fi85938594if test prog = "$linkmode"; then8595test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"8596test -n "$add" && finalize_deplibs="$add $finalize_deplibs"8597else8598test -n "$add_dir" && deplibs="$add_dir $deplibs"8599test -n "$add" && deplibs="$add $deplibs"8600fi8601fi8602elif test prog = "$linkmode"; then8603# Here we assume that one of hardcode_direct or hardcode_minus_L8604# is not unsupported. This is valid on all known static and8605# shared platforms.8606if test unsupported != "$hardcode_direct"; then8607test -n "$old_library" && linklib=$old_library8608compile_deplibs="$dir/$linklib $compile_deplibs"8609finalize_deplibs="$dir/$linklib $finalize_deplibs"8610else8611compile_deplibs="-l$name -L$dir $compile_deplibs"8612finalize_deplibs="-l$name -L$dir $finalize_deplibs"8613fi8614elif test yes = "$build_libtool_libs"; then8615# Not a shared library8616if test pass_all != "$deplibs_check_method"; then8617# We're trying link a shared library against a static one8618# but the system doesn't support it.86198620# Just print a warning and add the library to dependency_libs so8621# that the program can be linked against the static library.8622echo8623$ECHO "*** Warning: This system cannot link to static lib archive $lib."8624echo "*** I have the capability to make that library automatically link in when"8625echo "*** you link to this library. But I can only do this if you have a"8626echo "*** shared version of the library, which you do not appear to have."8627if test yes = "$module"; then8628echo "*** But as you try to build a module library, libtool will still create "8629echo "*** a static module, that should work as long as the dlopening application"8630echo "*** is linked with the -dlopen flag to resolve symbols at runtime."8631if test -z "$global_symbol_pipe"; then8632echo8633echo "*** However, this would only work if libtool was able to extract symbol"8634echo "*** lists from a program, using 'nm' or equivalent, but libtool could"8635echo "*** not find such a program. So, this module is probably useless."8636echo "*** 'nm' from GNU binutils and a full rebuild may help."8637fi8638if test no = "$build_old_libs"; then8639build_libtool_libs=module8640build_old_libs=yes8641else8642build_libtool_libs=no8643fi8644fi8645else8646deplibs="$dir/$old_library $deplibs"8647link_static=yes8648fi8649fi # link shared/static library?86508651if test lib = "$linkmode"; then8652if test -n "$dependency_libs" &&8653{ test yes != "$hardcode_into_libs" ||8654test yes = "$build_old_libs" ||8655test yes = "$link_static"; }; then8656# Extract -R from dependency_libs8657temp_deplibs=8658for libdir in $dependency_libs; do8659case $libdir in8660-R*) func_stripname '-R' '' "$libdir"8661temp_xrpath=$func_stripname_result8662case " $xrpath " in8663*" $temp_xrpath "*) ;;8664*) func_append xrpath " $temp_xrpath";;8665esac;;8666*) func_append temp_deplibs " $libdir";;8667esac8668done8669dependency_libs=$temp_deplibs8670fi86718672func_append newlib_search_path " $absdir"8673# Link against this library8674test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"8675# ... and its dependency_libs8676tmp_libs=8677for deplib in $dependency_libs; do8678newdependency_libs="$deplib $newdependency_libs"8679case $deplib in8680-L*) func_stripname '-L' '' "$deplib"8681func_resolve_sysroot "$func_stripname_result";;8682*) func_resolve_sysroot "$deplib" ;;8683esac8684if $opt_preserve_dup_deps; then8685case "$tmp_libs " in8686*" $func_resolve_sysroot_result "*)8687func_append specialdeplibs " $func_resolve_sysroot_result" ;;8688esac8689fi8690func_append tmp_libs " $func_resolve_sysroot_result"8691done86928693if test no != "$link_all_deplibs"; then8694# Add the search paths of all dependency libraries8695for deplib in $dependency_libs; do8696path=8697case $deplib in8698-L*) path=$deplib ;;8699*.la)8700func_resolve_sysroot "$deplib"8701deplib=$func_resolve_sysroot_result8702func_dirname "$deplib" "" "."8703dir=$func_dirname_result8704# We need an absolute path.8705case $dir in8706[\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;8707*)8708absdir=`cd "$dir" && pwd`8709if test -z "$absdir"; then8710func_warning "cannot determine absolute directory name of '$dir'"8711absdir=$dir8712fi8713;;8714esac8715if $GREP "^installed=no" $deplib > /dev/null; then8716case $host in8717*-*-darwin*)8718depdepl=8719eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`8720if test -n "$deplibrary_names"; then8721for tmp in $deplibrary_names; do8722depdepl=$tmp8723done8724if test -f "$absdir/$objdir/$depdepl"; then8725depdepl=$absdir/$objdir/$depdepl8726darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`8727if test -z "$darwin_install_name"; then8728darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`8729fi8730func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"8731func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"8732path=8733fi8734fi8735;;8736*)8737path=-L$absdir/$objdir8738;;8739esac8740else8741eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`8742test -z "$libdir" && \8743func_fatal_error "'$deplib' is not a valid libtool archive"8744test "$absdir" != "$libdir" && \8745func_warning "'$deplib' seems to be moved"87468747path=-L$absdir8748fi8749;;8750esac8751case " $deplibs " in8752*" $path "*) ;;8753*) deplibs="$path $deplibs" ;;8754esac8755done8756fi # link_all_deplibs != no8757fi # linkmode = lib8758done # for deplib in $libs8759if test link = "$pass"; then8760if test prog = "$linkmode"; then8761compile_deplibs="$new_inherited_linker_flags $compile_deplibs"8762finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"8763else8764compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`8765fi8766fi8767dependency_libs=$newdependency_libs8768if test dlpreopen = "$pass"; then8769# Link the dlpreopened libraries before other libraries8770for deplib in $save_deplibs; do8771deplibs="$deplib $deplibs"8772done8773fi8774if test dlopen != "$pass"; then8775test conv = "$pass" || {8776# Make sure lib_search_path contains only unique directories.8777lib_search_path=8778for dir in $newlib_search_path; do8779case "$lib_search_path " in8780*" $dir "*) ;;8781*) func_append lib_search_path " $dir" ;;8782esac8783done8784newlib_search_path=8785}87868787if test prog,link = "$linkmode,$pass"; then8788vars="compile_deplibs finalize_deplibs"8789else8790vars=deplibs8791fi8792for var in $vars dependency_libs; do8793# Add libraries to $var in reverse order8794eval tmp_libs=\"\$$var\"8795new_libs=8796for deplib in $tmp_libs; do8797# FIXME: Pedantically, this is the right thing to do, so8798# that some nasty dependency loop isn't accidentally8799# broken:8800#new_libs="$deplib $new_libs"8801# Pragmatically, this seems to cause very few problems in8802# practice:8803case $deplib in8804-L*) new_libs="$deplib $new_libs" ;;8805-R*) ;;8806*)8807# And here is the reason: when a library appears more8808# than once as an explicit dependence of a library, or8809# is implicitly linked in more than once by the8810# compiler, it is considered special, and multiple8811# occurrences thereof are not removed. Compare this8812# with having the same library being listed as a8813# dependency of multiple other libraries: in this case,8814# we know (pedantically, we assume) the library does not8815# need to be listed more than once, so we keep only the8816# last copy. This is not always right, but it is rare8817# enough that we require users that really mean to play8818# such unportable linking tricks to link the library8819# using -Wl,-lname, so that libtool does not consider it8820# for duplicate removal.8821case " $specialdeplibs " in8822*" $deplib "*) new_libs="$deplib $new_libs" ;;8823*)8824case " $new_libs " in8825*" $deplib "*) ;;8826*) new_libs="$deplib $new_libs" ;;8827esac8828;;8829esac8830;;8831esac8832done8833tmp_libs=8834for deplib in $new_libs; do8835case $deplib in8836-L*)8837case " $tmp_libs " in8838*" $deplib "*) ;;8839*) func_append tmp_libs " $deplib" ;;8840esac8841;;8842*) func_append tmp_libs " $deplib" ;;8843esac8844done8845eval $var=\"$tmp_libs\"8846done # for var8847fi88488849# Add Sun CC postdeps if required:8850test CXX = "$tagname" && {8851case $host_os in8852linux*)8853case `$CC -V 2>&1 | sed 5q` in8854*Sun\ C*) # Sun C++ 5.98855func_suncc_cstd_abi88568857if test no != "$suncc_use_cstd_abi"; then8858func_append postdeps ' -library=Cstd -library=Crun'8859fi8860;;8861esac8862;;88638864solaris*)8865func_cc_basename "$CC"8866case $func_cc_basename_result in8867CC* | sunCC*)8868func_suncc_cstd_abi88698870if test no != "$suncc_use_cstd_abi"; then8871func_append postdeps ' -library=Cstd -library=Crun'8872fi8873;;8874esac8875;;8876esac8877}88788879# Last step: remove runtime libs from dependency_libs8880# (they stay in deplibs)8881tmp_libs=8882for i in $dependency_libs; do8883case " $predeps $postdeps $compiler_lib_search_path " in8884*" $i "*)8885i=8886;;8887esac8888if test -n "$i"; then8889func_append tmp_libs " $i"8890fi8891done8892dependency_libs=$tmp_libs8893done # for pass8894if test prog = "$linkmode"; then8895dlfiles=$newdlfiles8896fi8897if test prog = "$linkmode" || test lib = "$linkmode"; then8898dlprefiles=$newdlprefiles8899fi89008901case $linkmode in8902oldlib)8903if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then8904func_warning "'-dlopen' is ignored for archives"8905fi89068907case " $deplibs" in8908*\ -l* | *\ -L*)8909func_warning "'-l' and '-L' are ignored for archives" ;;8910esac89118912test -n "$rpath" && \8913func_warning "'-rpath' is ignored for archives"89148915test -n "$xrpath" && \8916func_warning "'-R' is ignored for archives"89178918test -n "$vinfo" && \8919func_warning "'-version-info/-version-number' is ignored for archives"89208921test -n "$release" && \8922func_warning "'-release' is ignored for archives"89238924test -n "$export_symbols$export_symbols_regex" && \8925func_warning "'-export-symbols' is ignored for archives"89268927# Now set the variables for building old libraries.8928build_libtool_libs=no8929oldlibs=$output8930func_append objs "$old_deplibs"8931;;89328933lib)8934# Make sure we only generate libraries of the form 'libNAME.la'.8935case $outputname in8936lib*)8937func_stripname 'lib' '.la' "$outputname"8938name=$func_stripname_result8939eval shared_ext=\"$shrext_cmds\"8940eval libname=\"$libname_spec\"8941;;8942*)8943test no = "$module" \8944&& func_fatal_help "libtool library '$output' must begin with 'lib'"89458946if test no != "$need_lib_prefix"; then8947# Add the "lib" prefix for modules if required8948func_stripname '' '.la' "$outputname"8949name=$func_stripname_result8950eval shared_ext=\"$shrext_cmds\"8951eval libname=\"$libname_spec\"8952else8953func_stripname '' '.la' "$outputname"8954libname=$func_stripname_result8955fi8956;;8957esac89588959if test -n "$objs"; then8960if test pass_all != "$deplibs_check_method"; then8961func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"8962else8963echo8964$ECHO "*** Warning: Linking the shared library $output against the non-libtool"8965$ECHO "*** objects $objs is not portable!"8966func_append libobjs " $objs"8967fi8968fi89698970test no = "$dlself" \8971|| func_warning "'-dlopen self' is ignored for libtool libraries"89728973set dummy $rpath8974shift8975test 1 -lt "$#" \8976&& func_warning "ignoring multiple '-rpath's for a libtool library"89778978install_libdir=$189798980oldlibs=8981if test -z "$rpath"; then8982if test yes = "$build_libtool_libs"; then8983# Building a libtool convenience library.8984# Some compilers have problems with a '.al' extension so8985# convenience libraries should have the same extension an8986# archive normally would.8987oldlibs="$output_objdir/$libname.$libext $oldlibs"8988build_libtool_libs=convenience8989build_old_libs=yes8990fi89918992test -n "$vinfo" && \8993func_warning "'-version-info/-version-number' is ignored for convenience libraries"89948995test -n "$release" && \8996func_warning "'-release' is ignored for convenience libraries"8997else89988999# Parse the version information argument.9000save_ifs=$IFS; IFS=:9001set dummy $vinfo 0 0 09002shift9003IFS=$save_ifs90049005test -n "$7" && \9006func_fatal_help "too many parameters to '-version-info'"90079008# convert absolute version numbers to libtool ages9009# this retains compatibility with .la files and attempts9010# to make the code below a bit more comprehensible90119012case $vinfo_number in9013yes)9014number_major=$19015number_minor=$29016number_revision=$39017#9018# There are really only two kinds -- those that9019# use the current revision as the major version9020# and those that subtract age and use age as9021# a minor version. But, then there is irix9022# that has an extra 1 added just for fun9023#9024case $version_type in9025# correct linux to gnu/linux during the next big refactor9026darwin|freebsd-elf|linux|osf|windows|none)9027func_arith $number_major + $number_minor9028current=$func_arith_result9029age=$number_minor9030revision=$number_revision9031;;9032freebsd-aout|qnx|sunos)9033current=$number_major9034revision=$number_minor9035age=09036;;9037irix|nonstopux)9038func_arith $number_major + $number_minor9039current=$func_arith_result9040age=$number_minor9041revision=$number_minor9042lt_irix_increment=no9043;;9044esac9045;;9046no)9047current=$19048revision=$29049age=$39050;;9051esac90529053# Check that each of the things are valid numbers.9054case $current in90550|[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]) ;;9056*)9057func_error "CURRENT '$current' must be a nonnegative integer"9058func_fatal_error "'$vinfo' is not valid version information"9059;;9060esac90619062case $revision in90630|[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]) ;;9064*)9065func_error "REVISION '$revision' must be a nonnegative integer"9066func_fatal_error "'$vinfo' is not valid version information"9067;;9068esac90699070case $age in90710|[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]) ;;9072*)9073func_error "AGE '$age' must be a nonnegative integer"9074func_fatal_error "'$vinfo' is not valid version information"9075;;9076esac90779078if test "$age" -gt "$current"; then9079func_error "AGE '$age' is greater than the current interface number '$current'"9080func_fatal_error "'$vinfo' is not valid version information"9081fi90829083# Calculate the version variables.9084major=9085versuffix=9086verstring=9087case $version_type in9088none) ;;90899090darwin)9091# Like Linux, but with the current version available in9092# verstring for coding it into the library header9093func_arith $current - $age9094major=.$func_arith_result9095versuffix=$major.$age.$revision9096# Darwin ld doesn't like 0 for these options...9097func_arith $current + 19098minor_current=$func_arith_result9099xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"9100verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"9101# On Darwin other compilers9102case $CC in9103nagfor*)9104verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"9105;;9106*)9107verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"9108;;9109esac9110;;91119112freebsd-aout)9113major=.$current9114versuffix=.$current.$revision9115;;91169117freebsd-elf)9118func_arith $current - $age9119major=.$func_arith_result9120versuffix=$major.$age.$revision9121;;91229123irix | nonstopux)9124if test no = "$lt_irix_increment"; then9125func_arith $current - $age9126else9127func_arith $current - $age + 19128fi9129major=$func_arith_result91309131case $version_type in9132nonstopux) verstring_prefix=nonstopux ;;9133*) verstring_prefix=sgi ;;9134esac9135verstring=$verstring_prefix$major.$revision91369137# Add in all the interfaces that we are compatible with.9138loop=$revision9139while test 0 -ne "$loop"; do9140func_arith $revision - $loop9141iface=$func_arith_result9142func_arith $loop - 19143loop=$func_arith_result9144verstring=$verstring_prefix$major.$iface:$verstring9145done91469147# Before this point, $major must not contain '.'.9148major=.$major9149versuffix=$major.$revision9150;;91519152linux) # correct to gnu/linux during the next big refactor9153func_arith $current - $age9154major=.$func_arith_result9155versuffix=$major.$age.$revision9156;;91579158osf)9159func_arith $current - $age9160major=.$func_arith_result9161versuffix=.$current.$age.$revision9162verstring=$current.$age.$revision91639164# Add in all the interfaces that we are compatible with.9165loop=$age9166while test 0 -ne "$loop"; do9167func_arith $current - $loop9168iface=$func_arith_result9169func_arith $loop - 19170loop=$func_arith_result9171verstring=$verstring:$iface.09172done91739174# Make executables depend on our current version.9175func_append verstring ":$current.0"9176;;91779178qnx)9179major=.$current9180versuffix=.$current9181;;91829183sco)9184major=.$current9185versuffix=.$current9186;;91879188sunos)9189major=.$current9190versuffix=.$current.$revision9191;;91929193windows)9194# Use '-' rather than '.', since we only want one9195# extension on DOS 8.3 file systems.9196func_arith $current - $age9197major=$func_arith_result9198versuffix=-$major9199;;92009201*)9202func_fatal_configuration "unknown library version type '$version_type'"9203;;9204esac92059206# Clear the version info if we defaulted, and they specified a release.9207if test -z "$vinfo" && test -n "$release"; then9208major=9209case $version_type in9210darwin)9211# we can't check for "0.0" in archive_cmds due to quoting9212# problems, so we reset it completely9213verstring=9214;;9215*)9216verstring=0.09217;;9218esac9219if test no = "$need_version"; then9220versuffix=9221else9222versuffix=.0.09223fi9224fi92259226# Remove version info from name if versioning should be avoided9227if test yes,no = "$avoid_version,$need_version"; then9228major=9229versuffix=9230verstring=9231fi92329233# Check to see if the archive will have undefined symbols.9234if test yes = "$allow_undefined"; then9235if test unsupported = "$allow_undefined_flag"; then9236if test yes = "$build_old_libs"; then9237func_warning "undefined symbols not allowed in $host shared libraries; building static only"9238build_libtool_libs=no9239else9240func_fatal_error "can't build $host shared library unless -no-undefined is specified"9241fi9242fi9243else9244# Don't allow undefined symbols.9245allow_undefined_flag=$no_undefined_flag9246fi92479248fi92499250func_generate_dlsyms "$libname" "$libname" :9251func_append libobjs " $symfileobj"9252test " " = "$libobjs" && libobjs=92539254if test relink != "$opt_mode"; then9255# Remove our outputs, but don't remove object files since they9256# may have been created when compiling PIC objects.9257removelist=9258tempremovelist=`$ECHO "$output_objdir/*"`9259for p in $tempremovelist; do9260case $p in9261*.$objext | *.gcno)9262;;9263$output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)9264if test -n "$precious_files_regex"; then9265if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&19266then9267continue9268fi9269fi9270func_append removelist " $p"9271;;9272*) ;;9273esac9274done9275test -n "$removelist" && \9276func_show_eval "${RM}r \$removelist"9277fi92789279# Now set the variables for building old libraries.9280if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then9281func_append oldlibs " $output_objdir/$libname.$libext"92829283# Transform .lo files to .o files.9284oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`9285fi92869287# Eliminate all temporary directories.9288#for path in $notinst_path; do9289# lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`9290# deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`9291# dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`9292#done92939294if test -n "$xrpath"; then9295# If the user specified any rpath flags, then add them.9296temp_xrpath=9297for libdir in $xrpath; do9298func_replace_sysroot "$libdir"9299func_append temp_xrpath " -R$func_replace_sysroot_result"9300case "$finalize_rpath " in9301*" $libdir "*) ;;9302*) func_append finalize_rpath " $libdir" ;;9303esac9304done9305if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then9306dependency_libs="$temp_xrpath $dependency_libs"9307fi9308fi93099310# Make sure dlfiles contains only unique files that won't be dlpreopened9311old_dlfiles=$dlfiles9312dlfiles=9313for lib in $old_dlfiles; do9314case " $dlprefiles $dlfiles " in9315*" $lib "*) ;;9316*) func_append dlfiles " $lib" ;;9317esac9318done93199320# Make sure dlprefiles contains only unique files9321old_dlprefiles=$dlprefiles9322dlprefiles=9323for lib in $old_dlprefiles; do9324case "$dlprefiles " in9325*" $lib "*) ;;9326*) func_append dlprefiles " $lib" ;;9327esac9328done93299330if test yes = "$build_libtool_libs"; then9331if test -n "$rpath"; then9332case $host in9333*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)9334# these systems don't actually have a c library (as such)!9335;;9336*-*-rhapsody* | *-*-darwin1.[012])9337# Rhapsody C library is in the System framework9338func_append deplibs " System.ltframework"9339;;9340*-*-netbsd*)9341# Don't link with libc until the a.out ld.so is fixed.9342;;9343*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)9344# Do not include libc due to us having libc/libc_r.9345;;9346*-*-sco3.2v5* | *-*-sco5v6*)9347# Causes problems with __ctype9348;;9349*-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)9350# Compiler inserts libc in the correct place for threads to work9351;;9352*)9353# Add libc to deplibs on all other systems if necessary.9354if test yes = "$build_libtool_need_lc"; then9355func_append deplibs " -lc"9356fi9357;;9358esac9359fi93609361# Transform deplibs into only deplibs that can be linked in shared.9362name_save=$name9363libname_save=$libname9364release_save=$release9365versuffix_save=$versuffix9366major_save=$major9367# I'm not sure if I'm treating the release correctly. I think9368# release should show up in the -l (ie -lgmp5) so we don't want to9369# add it in twice. Is that correct?9370release=9371versuffix=9372major=9373newdeplibs=9374droppeddeps=no9375case $deplibs_check_method in9376pass_all)9377# Don't check for shared/static. Everything works.9378# This might be a little naive. We might want to check9379# whether the library exists or not. But this is on9380# osf3 & osf4 and I'm not really sure... Just9381# implementing what was already the behavior.9382newdeplibs=$deplibs9383;;9384test_compile)9385# This code stresses the "libraries are programs" paradigm to its9386# limits. Maybe even breaks it. We compile a program, linking it9387# against the deplibs as a proxy for the library. Then we can check9388# whether they linked in statically or dynamically with ldd.9389$opt_dry_run || $RM conftest.c9390cat > conftest.c <<EOF9391int main() { return 0; }9392EOF9393$opt_dry_run || $RM conftest9394if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then9395ldd_output=`ldd conftest`9396for i in $deplibs; do9397case $i in9398-l*)9399func_stripname -l '' "$i"9400name=$func_stripname_result9401if test yes = "$allow_libtool_libs_with_static_runtimes"; then9402case " $predeps $postdeps " in9403*" $i "*)9404func_append newdeplibs " $i"9405i=9406;;9407esac9408fi9409if test -n "$i"; then9410libname=`eval "\\$ECHO \"$libname_spec\""`9411deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`9412set dummy $deplib_matches; shift9413deplib_match=$19414if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then9415func_append newdeplibs " $i"9416else9417droppeddeps=yes9418echo9419$ECHO "*** Warning: dynamic linker does not accept needed library $i."9420echo "*** I have the capability to make that library automatically link in when"9421echo "*** you link to this library. But I can only do this if you have a"9422echo "*** shared version of the library, which I believe you do not have"9423echo "*** because a test_compile did reveal that the linker did not use it for"9424echo "*** its dynamic dependency list that programs get resolved with at runtime."9425fi9426fi9427;;9428*)9429func_append newdeplibs " $i"9430;;9431esac9432done9433else9434# Error occurred in the first compile. Let's try to salvage9435# the situation: Compile a separate program for each library.9436for i in $deplibs; do9437case $i in9438-l*)9439func_stripname -l '' "$i"9440name=$func_stripname_result9441$opt_dry_run || $RM conftest9442if $LTCC $LTCFLAGS -o conftest conftest.c $i; then9443ldd_output=`ldd conftest`9444if test yes = "$allow_libtool_libs_with_static_runtimes"; then9445case " $predeps $postdeps " in9446*" $i "*)9447func_append newdeplibs " $i"9448i=9449;;9450esac9451fi9452if test -n "$i"; then9453libname=`eval "\\$ECHO \"$libname_spec\""`9454deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`9455set dummy $deplib_matches; shift9456deplib_match=$19457if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then9458func_append newdeplibs " $i"9459else9460droppeddeps=yes9461echo9462$ECHO "*** Warning: dynamic linker does not accept needed library $i."9463echo "*** I have the capability to make that library automatically link in when"9464echo "*** you link to this library. But I can only do this if you have a"9465echo "*** shared version of the library, which you do not appear to have"9466echo "*** because a test_compile did reveal that the linker did not use this one"9467echo "*** as a dynamic dependency that programs can get resolved with at runtime."9468fi9469fi9470else9471droppeddeps=yes9472echo9473$ECHO "*** Warning! Library $i is needed by this library but I was not able to"9474echo "*** make it link in! You will probably need to install it or some"9475echo "*** library that it depends on before this library will be fully"9476echo "*** functional. Installing it before continuing would be even better."9477fi9478;;9479*)9480func_append newdeplibs " $i"9481;;9482esac9483done9484fi9485;;9486file_magic*)9487set dummy $deplibs_check_method; shift9488file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`9489for a_deplib in $deplibs; do9490case $a_deplib in9491-l*)9492func_stripname -l '' "$a_deplib"9493name=$func_stripname_result9494if test yes = "$allow_libtool_libs_with_static_runtimes"; then9495case " $predeps $postdeps " in9496*" $a_deplib "*)9497func_append newdeplibs " $a_deplib"9498a_deplib=9499;;9500esac9501fi9502if test -n "$a_deplib"; then9503libname=`eval "\\$ECHO \"$libname_spec\""`9504if test -n "$file_magic_glob"; then9505libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`9506else9507libnameglob=$libname9508fi9509test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`9510for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do9511if test yes = "$want_nocaseglob"; then9512shopt -s nocaseglob9513potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`9514$nocaseglob9515else9516potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`9517fi9518for potent_lib in $potential_libs; do9519# Follow soft links.9520if ls -lLd "$potent_lib" 2>/dev/null |9521$GREP " -> " >/dev/null; then9522continue9523fi9524# The statement above tries to avoid entering an9525# endless loop below, in case of cyclic links.9526# We might still enter an endless loop, since a link9527# loop can be closed while we follow links,9528# but so what?9529potlib=$potent_lib9530while test -h "$potlib" 2>/dev/null; do9531potliblink=`ls -ld $potlib | $SED 's/.* -> //'`9532case $potliblink in9533[\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;9534*) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;9535esac9536done9537if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |9538$SED -e 10q |9539$EGREP "$file_magic_regex" > /dev/null; then9540func_append newdeplibs " $a_deplib"9541a_deplib=9542break 29543fi9544done9545done9546fi9547if test -n "$a_deplib"; then9548droppeddeps=yes9549echo9550$ECHO "*** Warning: linker path does not have real file for library $a_deplib."9551echo "*** I have the capability to make that library automatically link in when"9552echo "*** you link to this library. But I can only do this if you have a"9553echo "*** shared version of the library, which you do not appear to have"9554echo "*** because I did check the linker path looking for a file starting"9555if test -z "$potlib"; then9556$ECHO "*** with $libname but no candidates were found. (...for file magic test)"9557else9558$ECHO "*** with $libname and none of the candidates passed a file format test"9559$ECHO "*** using a file magic. Last file checked: $potlib"9560fi9561fi9562;;9563*)9564# Add a -L argument.9565func_append newdeplibs " $a_deplib"9566;;9567esac9568done # Gone through all deplibs.9569;;9570match_pattern*)9571set dummy $deplibs_check_method; shift9572match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`9573for a_deplib in $deplibs; do9574case $a_deplib in9575-l*)9576func_stripname -l '' "$a_deplib"9577name=$func_stripname_result9578if test yes = "$allow_libtool_libs_with_static_runtimes"; then9579case " $predeps $postdeps " in9580*" $a_deplib "*)9581func_append newdeplibs " $a_deplib"9582a_deplib=9583;;9584esac9585fi9586if test -n "$a_deplib"; then9587libname=`eval "\\$ECHO \"$libname_spec\""`9588for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do9589potential_libs=`ls $i/$libname[.-]* 2>/dev/null`9590for potent_lib in $potential_libs; do9591potlib=$potent_lib # see symlink-check above in file_magic test9592if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \9593$EGREP "$match_pattern_regex" > /dev/null; then9594func_append newdeplibs " $a_deplib"9595a_deplib=9596break 29597fi9598done9599done9600fi9601if test -n "$a_deplib"; then9602droppeddeps=yes9603echo9604$ECHO "*** Warning: linker path does not have real file for library $a_deplib."9605echo "*** I have the capability to make that library automatically link in when"9606echo "*** you link to this library. But I can only do this if you have a"9607echo "*** shared version of the library, which you do not appear to have"9608echo "*** because I did check the linker path looking for a file starting"9609if test -z "$potlib"; then9610$ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"9611else9612$ECHO "*** with $libname and none of the candidates passed a file format test"9613$ECHO "*** using a regex pattern. Last file checked: $potlib"9614fi9615fi9616;;9617*)9618# Add a -L argument.9619func_append newdeplibs " $a_deplib"9620;;9621esac9622done # Gone through all deplibs.9623;;9624none | unknown | *)9625newdeplibs=9626tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`9627if test yes = "$allow_libtool_libs_with_static_runtimes"; then9628for i in $predeps $postdeps; do9629# can't use Xsed below, because $i might contain '/'9630tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`9631done9632fi9633case $tmp_deplibs in9634*[!\ \ ]*)9635echo9636if test none = "$deplibs_check_method"; then9637echo "*** Warning: inter-library dependencies are not supported in this platform."9638else9639echo "*** Warning: inter-library dependencies are not known to be supported."9640fi9641echo "*** All declared inter-library dependencies are being dropped."9642droppeddeps=yes9643;;9644esac9645;;9646esac9647versuffix=$versuffix_save9648major=$major_save9649release=$release_save9650libname=$libname_save9651name=$name_save96529653case $host in9654*-*-rhapsody* | *-*-darwin1.[012])9655# On Rhapsody replace the C library with the System framework9656newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`9657;;9658esac96599660if test yes = "$droppeddeps"; then9661if test yes = "$module"; then9662echo9663echo "*** Warning: libtool could not satisfy all declared inter-library"9664$ECHO "*** dependencies of module $libname. Therefore, libtool will create"9665echo "*** a static module, that should work as long as the dlopening"9666echo "*** application is linked with the -dlopen flag."9667if test -z "$global_symbol_pipe"; then9668echo9669echo "*** However, this would only work if libtool was able to extract symbol"9670echo "*** lists from a program, using 'nm' or equivalent, but libtool could"9671echo "*** not find such a program. So, this module is probably useless."9672echo "*** 'nm' from GNU binutils and a full rebuild may help."9673fi9674if test no = "$build_old_libs"; then9675oldlibs=$output_objdir/$libname.$libext9676build_libtool_libs=module9677build_old_libs=yes9678else9679build_libtool_libs=no9680fi9681else9682echo "*** The inter-library dependencies that have been dropped here will be"9683echo "*** automatically added whenever a program is linked with this library"9684echo "*** or is declared to -dlopen it."96859686if test no = "$allow_undefined"; then9687echo9688echo "*** Since this library must not contain undefined symbols,"9689echo "*** because either the platform does not support them or"9690echo "*** it was explicitly requested with -no-undefined,"9691echo "*** libtool will only create a static version of it."9692if test no = "$build_old_libs"; then9693oldlibs=$output_objdir/$libname.$libext9694build_libtool_libs=module9695build_old_libs=yes9696else9697build_libtool_libs=no9698fi9699fi9700fi9701fi9702# Done checking deplibs!9703deplibs=$newdeplibs9704fi9705# Time to change all our "foo.ltframework" stuff back to "-framework foo"9706case $host in9707*-*-darwin*)9708newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`9709new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`9710deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`9711;;9712esac97139714# move library search paths that coincide with paths to not yet9715# installed libraries to the beginning of the library search list9716new_libs=9717for path in $notinst_path; do9718case " $new_libs " in9719*" -L$path/$objdir "*) ;;9720*)9721case " $deplibs " in9722*" -L$path/$objdir "*)9723func_append new_libs " -L$path/$objdir" ;;9724esac9725;;9726esac9727done9728for deplib in $deplibs; do9729case $deplib in9730-L*)9731case " $new_libs " in9732*" $deplib "*) ;;9733*) func_append new_libs " $deplib" ;;9734esac9735;;9736*) func_append new_libs " $deplib" ;;9737esac9738done9739deplibs=$new_libs97409741# All the library-specific variables (install_libdir is set above).9742library_names=9743old_library=9744dlname=97459746# Test again, we may have decided not to build it any more9747if test yes = "$build_libtool_libs"; then9748# Remove $wl instances when linking with ld.9749# FIXME: should test the right _cmds variable.9750case $archive_cmds in9751*\$LD\ *) wl= ;;9752esac9753if test yes = "$hardcode_into_libs"; then9754# Hardcode the library paths9755hardcode_libdirs=9756dep_rpath=9757rpath=$finalize_rpath9758test relink = "$opt_mode" || rpath=$compile_rpath$rpath9759for libdir in $rpath; do9760if test -n "$hardcode_libdir_flag_spec"; then9761if test -n "$hardcode_libdir_separator"; then9762func_replace_sysroot "$libdir"9763libdir=$func_replace_sysroot_result9764if test -z "$hardcode_libdirs"; then9765hardcode_libdirs=$libdir9766else9767# Just accumulate the unique libdirs.9768case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in9769*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)9770;;9771*)9772func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"9773;;9774esac9775fi9776else9777eval flag=\"$hardcode_libdir_flag_spec\"9778func_append dep_rpath " $flag"9779fi9780elif test -n "$runpath_var"; then9781case "$perm_rpath " in9782*" $libdir "*) ;;9783*) func_append perm_rpath " $libdir" ;;9784esac9785fi9786done9787# Substitute the hardcoded libdirs into the rpath.9788if test -n "$hardcode_libdir_separator" &&9789test -n "$hardcode_libdirs"; then9790libdir=$hardcode_libdirs9791eval "dep_rpath=\"$hardcode_libdir_flag_spec\""9792fi9793if test -n "$runpath_var" && test -n "$perm_rpath"; then9794# We should set the runpath_var.9795rpath=9796for dir in $perm_rpath; do9797func_append rpath "$dir:"9798done9799eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"9800fi9801test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"9802fi98039804shlibpath=$finalize_shlibpath9805test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath9806if test -n "$shlibpath"; then9807eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"9808fi98099810# Get the real and link names of the library.9811eval shared_ext=\"$shrext_cmds\"9812eval library_names=\"$library_names_spec\"9813set dummy $library_names9814shift9815realname=$19816shift98179818if test -n "$soname_spec"; then9819eval soname=\"$soname_spec\"9820else9821soname=$realname9822fi9823if test -z "$dlname"; then9824dlname=$soname9825fi98269827lib=$output_objdir/$realname9828linknames=9829for link9830do9831func_append linknames " $link"9832done98339834# Use standard objects if they are pic9835test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`9836test "X$libobjs" = "X " && libobjs=98379838delfiles=9839if test -n "$export_symbols" && test -n "$include_expsyms"; then9840$opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"9841export_symbols=$output_objdir/$libname.uexp9842func_append delfiles " $export_symbols"9843fi98449845orig_export_symbols=9846case $host_os in9847cygwin* | mingw* | cegcc*)9848if test -n "$export_symbols" && test -z "$export_symbols_regex"; then9849# exporting using user supplied symfile9850func_dll_def_p "$export_symbols" || {9851# and it's NOT already a .def file. Must figure out9852# which of the given symbols are data symbols and tag9853# them as such. So, trigger use of export_symbols_cmds.9854# export_symbols gets reassigned inside the "prepare9855# the list of exported symbols" if statement, so the9856# include_expsyms logic still works.9857orig_export_symbols=$export_symbols9858export_symbols=9859always_export_symbols=yes9860}9861fi9862;;9863esac98649865# Prepare the list of exported symbols9866if test -z "$export_symbols"; then9867if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then9868func_verbose "generating symbol list for '$libname.la'"9869export_symbols=$output_objdir/$libname.exp9870$opt_dry_run || $RM $export_symbols9871cmds=$export_symbols_cmds9872save_ifs=$IFS; IFS='~'9873for cmd1 in $cmds; do9874IFS=$save_ifs9875# Take the normal branch if the nm_file_list_spec branch9876# doesn't work or if tool conversion is not needed.9877case $nm_file_list_spec~$to_tool_file_cmd in9878*~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)9879try_normal_branch=yes9880eval cmd=\"$cmd1\"9881func_len " $cmd"9882len=$func_len_result9883;;9884*)9885try_normal_branch=no9886;;9887esac9888if test yes = "$try_normal_branch" \9889&& { test "$len" -lt "$max_cmd_len" \9890|| test "$max_cmd_len" -le -1; }9891then9892func_show_eval "$cmd" 'exit $?'9893skipped_export=false9894elif test -n "$nm_file_list_spec"; then9895func_basename "$output"9896output_la=$func_basename_result9897save_libobjs=$libobjs9898save_output=$output9899output=$output_objdir/$output_la.nm9900func_to_tool_file "$output"9901libobjs=$nm_file_list_spec$func_to_tool_file_result9902func_append delfiles " $output"9903func_verbose "creating $NM input file list: $output"9904for obj in $save_libobjs; do9905func_to_tool_file "$obj"9906$ECHO "$func_to_tool_file_result"9907done > "$output"9908eval cmd=\"$cmd1\"9909func_show_eval "$cmd" 'exit $?'9910output=$save_output9911libobjs=$save_libobjs9912skipped_export=false9913else9914# The command line is too long to execute in one step.9915func_verbose "using reloadable object file for export list..."9916skipped_export=:9917# Break out early, otherwise skipped_export may be9918# set to false by a later but shorter cmd.9919break9920fi9921done9922IFS=$save_ifs9923if test -n "$export_symbols_regex" && test : != "$skipped_export"; then9924func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'9925func_show_eval '$MV "${export_symbols}T" "$export_symbols"'9926fi9927fi9928fi99299930if test -n "$export_symbols" && test -n "$include_expsyms"; then9931tmp_export_symbols=$export_symbols9932test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols9933$opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'9934fi99359936if test : != "$skipped_export" && test -n "$orig_export_symbols"; then9937# The given exports_symbols file has to be filtered, so filter it.9938func_verbose "filter symbol list for '$libname.la' to tag DATA exports"9939# FIXME: $output_objdir/$libname.filter potentially contains lots of9940# 's' commands, which not all seds can handle. GNU sed should be fine9941# though. Also, the filter scales superlinearly with the number of9942# global variables. join(1) would be nice here, but unfortunately9943# isn't a blessed tool.9944$opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter9945func_append delfiles " $export_symbols $output_objdir/$libname.filter"9946export_symbols=$output_objdir/$libname.def9947$opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols9948fi99499950tmp_deplibs=9951for test_deplib in $deplibs; do9952case " $convenience " in9953*" $test_deplib "*) ;;9954*)9955func_append tmp_deplibs " $test_deplib"9956;;9957esac9958done9959deplibs=$tmp_deplibs99609961if test -n "$convenience"; then9962if test -n "$whole_archive_flag_spec" &&9963test yes = "$compiler_needs_object" &&9964test -z "$libobjs"; then9965# extract the archives, so we have objects to list.9966# TODO: could optimize this to just extract one archive.9967whole_archive_flag_spec=9968fi9969if test -n "$whole_archive_flag_spec"; then9970save_libobjs=$libobjs9971eval libobjs=\"\$libobjs $whole_archive_flag_spec\"9972test "X$libobjs" = "X " && libobjs=9973else9974gentop=$output_objdir/${outputname}x9975func_append generated " $gentop"99769977func_extract_archives $gentop $convenience9978func_append libobjs " $func_extract_archives_result"9979test "X$libobjs" = "X " && libobjs=9980fi9981fi99829983if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then9984eval flag=\"$thread_safe_flag_spec\"9985func_append linker_flags " $flag"9986fi99879988# Make a backup of the uninstalled library when relinking9989if test relink = "$opt_mode"; then9990$opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?9991fi99929993# Do each of the archive commands.9994if test yes = "$module" && test -n "$module_cmds"; then9995if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then9996eval test_cmds=\"$module_expsym_cmds\"9997cmds=$module_expsym_cmds9998else9999eval test_cmds=\"$module_cmds\"10000cmds=$module_cmds10001fi10002else10003if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then10004eval test_cmds=\"$archive_expsym_cmds\"10005cmds=$archive_expsym_cmds10006else10007eval test_cmds=\"$archive_cmds\"10008cmds=$archive_cmds10009fi10010fi1001110012if test : != "$skipped_export" &&10013func_len " $test_cmds" &&10014len=$func_len_result &&10015test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then10016:10017else10018# The command line is too long to link in one step, link piecewise10019# or, if using GNU ld and skipped_export is not :, use a linker10020# script.1002110022# Save the value of $output and $libobjs because we want to10023# use them later. If we have whole_archive_flag_spec, we10024# want to use save_libobjs as it was before10025# whole_archive_flag_spec was expanded, because we can't10026# assume the linker understands whole_archive_flag_spec.10027# This may have to be revisited, in case too many10028# convenience libraries get linked in and end up exceeding10029# the spec.10030if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then10031save_libobjs=$libobjs10032fi10033save_output=$output10034func_basename "$output"10035output_la=$func_basename_result1003610037# Clear the reloadable object creation command queue and10038# initialize k to one.10039test_cmds=10040concat_cmds=10041objlist=10042last_robj=10043k=11004410045if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then10046output=$output_objdir/$output_la.lnkscript10047func_verbose "creating GNU ld script: $output"10048echo 'INPUT (' > $output10049for obj in $save_libobjs10050do10051func_to_tool_file "$obj"10052$ECHO "$func_to_tool_file_result" >> $output10053done10054echo ')' >> $output10055func_append delfiles " $output"10056func_to_tool_file "$output"10057output=$func_to_tool_file_result10058elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then10059output=$output_objdir/$output_la.lnk10060func_verbose "creating linker input file list: $output"10061: > $output10062set x $save_libobjs10063shift10064firstobj=10065if test yes = "$compiler_needs_object"; then10066firstobj="$1 "10067shift10068fi10069for obj10070do10071func_to_tool_file "$obj"10072$ECHO "$func_to_tool_file_result" >> $output10073done10074func_append delfiles " $output"10075func_to_tool_file "$output"10076output=$firstobj\"$file_list_spec$func_to_tool_file_result\"10077else10078if test -n "$save_libobjs"; then10079func_verbose "creating reloadable object files..."10080output=$output_objdir/$output_la-$k.$objext10081eval test_cmds=\"$reload_cmds\"10082func_len " $test_cmds"10083len0=$func_len_result10084len=$len01008510086# Loop over the list of objects to be linked.10087for obj in $save_libobjs10088do10089func_len " $obj"10090func_arith $len + $func_len_result10091len=$func_arith_result10092if test -z "$objlist" ||10093test "$len" -lt "$max_cmd_len"; then10094func_append objlist " $obj"10095else10096# The command $test_cmds is almost too long, add a10097# command to the queue.10098if test 1 -eq "$k"; then10099# The first file doesn't have a previous command to add.10100reload_objs=$objlist10101eval concat_cmds=\"$reload_cmds\"10102else10103# All subsequent reloadable object files will link in10104# the last one created.10105reload_objs="$objlist $last_robj"10106eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"10107fi10108last_robj=$output_objdir/$output_la-$k.$objext10109func_arith $k + 110110k=$func_arith_result10111output=$output_objdir/$output_la-$k.$objext10112objlist=" $obj"10113func_len " $last_robj"10114func_arith $len0 + $func_len_result10115len=$func_arith_result10116fi10117done10118# Handle the remaining objects by creating one last10119# reloadable object file. All subsequent reloadable object10120# files will link in the last one created.10121test -z "$concat_cmds" || concat_cmds=$concat_cmds~10122reload_objs="$objlist $last_robj"10123eval concat_cmds=\"\$concat_cmds$reload_cmds\"10124if test -n "$last_robj"; then10125eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"10126fi10127func_append delfiles " $output"1012810129else10130output=10131fi1013210133${skipped_export-false} && {10134func_verbose "generating symbol list for '$libname.la'"10135export_symbols=$output_objdir/$libname.exp10136$opt_dry_run || $RM $export_symbols10137libobjs=$output10138# Append the command to create the export file.10139test -z "$concat_cmds" || concat_cmds=$concat_cmds~10140eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"10141if test -n "$last_robj"; then10142eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"10143fi10144}1014510146test -n "$save_libobjs" &&10147func_verbose "creating a temporary reloadable object file: $output"1014810149# Loop through the commands generated above and execute them.10150save_ifs=$IFS; IFS='~'10151for cmd in $concat_cmds; do10152IFS=$save_ifs10153$opt_quiet || {10154func_quote_arg expand,pretty "$cmd"10155eval "func_echo $func_quote_arg_result"10156}10157$opt_dry_run || eval "$cmd" || {10158lt_exit=$?1015910160# Restore the uninstalled library and exit10161if test relink = "$opt_mode"; then10162( cd "$output_objdir" && \10163$RM "${realname}T" && \10164$MV "${realname}U" "$realname" )10165fi1016610167exit $lt_exit10168}10169done10170IFS=$save_ifs1017110172if test -n "$export_symbols_regex" && ${skipped_export-false}; then10173func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'10174func_show_eval '$MV "${export_symbols}T" "$export_symbols"'10175fi10176fi1017710178${skipped_export-false} && {10179if test -n "$export_symbols" && test -n "$include_expsyms"; then10180tmp_export_symbols=$export_symbols10181test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols10182$opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'10183fi1018410185if test -n "$orig_export_symbols"; then10186# The given exports_symbols file has to be filtered, so filter it.10187func_verbose "filter symbol list for '$libname.la' to tag DATA exports"10188# FIXME: $output_objdir/$libname.filter potentially contains lots of10189# 's' commands, which not all seds can handle. GNU sed should be fine10190# though. Also, the filter scales superlinearly with the number of10191# global variables. join(1) would be nice here, but unfortunately10192# isn't a blessed tool.10193$opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter10194func_append delfiles " $export_symbols $output_objdir/$libname.filter"10195export_symbols=$output_objdir/$libname.def10196$opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols10197fi10198}1019910200libobjs=$output10201# Restore the value of output.10202output=$save_output1020310204if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then10205eval libobjs=\"\$libobjs $whole_archive_flag_spec\"10206test "X$libobjs" = "X " && libobjs=10207fi10208# Expand the library linking commands again to reset the10209# value of $libobjs for piecewise linking.1021010211# Do each of the archive commands.10212if test yes = "$module" && test -n "$module_cmds"; then10213if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then10214cmds=$module_expsym_cmds10215else10216cmds=$module_cmds10217fi10218else10219if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then10220cmds=$archive_expsym_cmds10221else10222cmds=$archive_cmds10223fi10224fi10225fi1022610227if test -n "$delfiles"; then10228# Append the command to remove temporary files to $cmds.10229eval cmds=\"\$cmds~\$RM $delfiles\"10230fi1023110232# Add any objects from preloaded convenience libraries10233if test -n "$dlprefiles"; then10234gentop=$output_objdir/${outputname}x10235func_append generated " $gentop"1023610237func_extract_archives $gentop $dlprefiles10238func_append libobjs " $func_extract_archives_result"10239test "X$libobjs" = "X " && libobjs=10240fi1024110242save_ifs=$IFS; IFS='~'10243for cmd in $cmds; do10244IFS=$sp$nl10245eval cmd=\"$cmd\"10246IFS=$save_ifs10247$opt_quiet || {10248func_quote_arg expand,pretty "$cmd"10249eval "func_echo $func_quote_arg_result"10250}10251$opt_dry_run || eval "$cmd" || {10252lt_exit=$?1025310254# Restore the uninstalled library and exit10255if test relink = "$opt_mode"; then10256( cd "$output_objdir" && \10257$RM "${realname}T" && \10258$MV "${realname}U" "$realname" )10259fi1026010261exit $lt_exit10262}10263done10264IFS=$save_ifs1026510266# Restore the uninstalled library and exit10267if test relink = "$opt_mode"; then10268$opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?1026910270if test -n "$convenience"; then10271if test -z "$whole_archive_flag_spec"; then10272func_show_eval '${RM}r "$gentop"'10273fi10274fi1027510276exit $EXIT_SUCCESS10277fi1027810279# Create links to the real library.10280for linkname in $linknames; do10281if test "$realname" != "$linkname"; then10282func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'10283fi10284done1028510286# If -module or -export-dynamic was specified, set the dlname.10287if test yes = "$module" || test yes = "$export_dynamic"; then10288# On all known operating systems, these are identical.10289dlname=$soname10290fi10291fi10292;;1029310294obj)10295if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then10296func_warning "'-dlopen' is ignored for objects"10297fi1029810299case " $deplibs" in10300*\ -l* | *\ -L*)10301func_warning "'-l' and '-L' are ignored for objects" ;;10302esac1030310304test -n "$rpath" && \10305func_warning "'-rpath' is ignored for objects"1030610307test -n "$xrpath" && \10308func_warning "'-R' is ignored for objects"1030910310test -n "$vinfo" && \10311func_warning "'-version-info' is ignored for objects"1031210313test -n "$release" && \10314func_warning "'-release' is ignored for objects"1031510316case $output in10317*.lo)10318test -n "$objs$old_deplibs" && \10319func_fatal_error "cannot build library object '$output' from non-libtool objects"1032010321libobj=$output10322func_lo2o "$libobj"10323obj=$func_lo2o_result10324;;10325*)10326libobj=10327obj=$output10328;;10329esac1033010331# Delete the old objects.10332$opt_dry_run || $RM $obj $libobj1033310334# Objects from convenience libraries. This assumes10335# single-version convenience libraries. Whenever we create10336# different ones for PIC/non-PIC, this we'll have to duplicate10337# the extraction.10338reload_conv_objs=10339gentop=10340# if reload_cmds runs $LD directly, get rid of -Wl from10341# whole_archive_flag_spec and hope we can get by with turning comma10342# into space.10343case $reload_cmds in10344*\$LD[\ \$]*) wl= ;;10345esac10346if test -n "$convenience"; then10347if test -n "$whole_archive_flag_spec"; then10348eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"10349test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`10350reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags10351else10352gentop=$output_objdir/${obj}x10353func_append generated " $gentop"1035410355func_extract_archives $gentop $convenience10356reload_conv_objs="$reload_objs $func_extract_archives_result"10357fi10358fi1035910360# If we're not building shared, we need to use non_pic_objs10361test yes = "$build_libtool_libs" || libobjs=$non_pic_objects1036210363# Create the old-style object.10364reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs1036510366output=$obj10367func_execute_cmds "$reload_cmds" 'exit $?'1036810369# Exit if we aren't doing a library object file.10370if test -z "$libobj"; then10371if test -n "$gentop"; then10372func_show_eval '${RM}r "$gentop"'10373fi1037410375exit $EXIT_SUCCESS10376fi1037710378test yes = "$build_libtool_libs" || {10379if test -n "$gentop"; then10380func_show_eval '${RM}r "$gentop"'10381fi1038210383# Create an invalid libtool object if no PIC, so that we don't10384# accidentally link it into a program.10385# $show "echo timestamp > $libobj"10386# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?10387exit $EXIT_SUCCESS10388}1038910390if test -n "$pic_flag" || test default != "$pic_mode"; then10391# Only do commands if we really have different PIC objects.10392reload_objs="$libobjs $reload_conv_objs"10393output=$libobj10394func_execute_cmds "$reload_cmds" 'exit $?'10395fi1039610397if test -n "$gentop"; then10398func_show_eval '${RM}r "$gentop"'10399fi1040010401exit $EXIT_SUCCESS10402;;1040310404prog)10405case $host in10406*cygwin*) func_stripname '' '.exe' "$output"10407output=$func_stripname_result.exe;;10408esac10409test -n "$vinfo" && \10410func_warning "'-version-info' is ignored for programs"1041110412test -n "$release" && \10413func_warning "'-release' is ignored for programs"1041410415$preload \10416&& test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \10417&& func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."1041810419case $host in10420*-*-rhapsody* | *-*-darwin1.[012])10421# On Rhapsody replace the C library is the System framework10422compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`10423finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`10424;;10425esac1042610427case $host in10428*-*-darwin*)10429# Don't allow lazy linking, it breaks C++ global constructors10430# But is supposedly fixed on 10.4 or later (yay!).10431if test CXX = "$tagname"; then10432case ${MACOSX_DEPLOYMENT_TARGET-10.0} in1043310.[0123])10434func_append compile_command " $wl-bind_at_load"10435func_append finalize_command " $wl-bind_at_load"10436;;10437esac10438fi10439# Time to change all our "foo.ltframework" stuff back to "-framework foo"10440compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`10441finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`10442;;10443esac104441044510446# move library search paths that coincide with paths to not yet10447# installed libraries to the beginning of the library search list10448new_libs=10449for path in $notinst_path; do10450case " $new_libs " in10451*" -L$path/$objdir "*) ;;10452*)10453case " $compile_deplibs " in10454*" -L$path/$objdir "*)10455func_append new_libs " -L$path/$objdir" ;;10456esac10457;;10458esac10459done10460for deplib in $compile_deplibs; do10461case $deplib in10462-L*)10463case " $new_libs " in10464*" $deplib "*) ;;10465*) func_append new_libs " $deplib" ;;10466esac10467;;10468*) func_append new_libs " $deplib" ;;10469esac10470done10471compile_deplibs=$new_libs104721047310474func_append compile_command " $compile_deplibs"10475func_append finalize_command " $finalize_deplibs"1047610477if test -n "$rpath$xrpath"; then10478# If the user specified any rpath flags, then add them.10479for libdir in $rpath $xrpath; do10480# This is the magic to use -rpath.10481case "$finalize_rpath " in10482*" $libdir "*) ;;10483*) func_append finalize_rpath " $libdir" ;;10484esac10485done10486fi1048710488# Now hardcode the library paths10489rpath=10490hardcode_libdirs=10491for libdir in $compile_rpath $finalize_rpath; do10492if test -n "$hardcode_libdir_flag_spec"; then10493if test -n "$hardcode_libdir_separator"; then10494if test -z "$hardcode_libdirs"; then10495hardcode_libdirs=$libdir10496else10497# Just accumulate the unique libdirs.10498case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in10499*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)10500;;10501*)10502func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"10503;;10504esac10505fi10506else10507eval flag=\"$hardcode_libdir_flag_spec\"10508func_append rpath " $flag"10509fi10510elif test -n "$runpath_var"; then10511case "$perm_rpath " in10512*" $libdir "*) ;;10513*) func_append perm_rpath " $libdir" ;;10514esac10515fi10516case $host in10517*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)10518testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`10519case :$dllsearchpath: in10520*":$libdir:"*) ;;10521::) dllsearchpath=$libdir;;10522*) func_append dllsearchpath ":$libdir";;10523esac10524case :$dllsearchpath: in10525*":$testbindir:"*) ;;10526::) dllsearchpath=$testbindir;;10527*) func_append dllsearchpath ":$testbindir";;10528esac10529;;10530esac10531done10532# Substitute the hardcoded libdirs into the rpath.10533if test -n "$hardcode_libdir_separator" &&10534test -n "$hardcode_libdirs"; then10535libdir=$hardcode_libdirs10536eval rpath=\" $hardcode_libdir_flag_spec\"10537fi10538compile_rpath=$rpath1053910540rpath=10541hardcode_libdirs=10542for libdir in $finalize_rpath; do10543if test -n "$hardcode_libdir_flag_spec"; then10544if test -n "$hardcode_libdir_separator"; then10545if test -z "$hardcode_libdirs"; then10546hardcode_libdirs=$libdir10547else10548# Just accumulate the unique libdirs.10549case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in10550*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)10551;;10552*)10553func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"10554;;10555esac10556fi10557else10558eval flag=\"$hardcode_libdir_flag_spec\"10559func_append rpath " $flag"10560fi10561elif test -n "$runpath_var"; then10562case "$finalize_perm_rpath " in10563*" $libdir "*) ;;10564*) func_append finalize_perm_rpath " $libdir" ;;10565esac10566fi10567done10568# Substitute the hardcoded libdirs into the rpath.10569if test -n "$hardcode_libdir_separator" &&10570test -n "$hardcode_libdirs"; then10571libdir=$hardcode_libdirs10572eval rpath=\" $hardcode_libdir_flag_spec\"10573fi10574finalize_rpath=$rpath1057510576if test -n "$libobjs" && test yes = "$build_old_libs"; then10577# Transform all the library objects into standard objects.10578compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`10579finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`10580fi1058110582func_generate_dlsyms "$outputname" "@PROGRAM@" false1058310584# template prelinking step10585if test -n "$prelink_cmds"; then10586func_execute_cmds "$prelink_cmds" 'exit $?'10587fi1058810589wrappers_required=:10590case $host in10591*cegcc* | *mingw32ce*)10592# Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.10593wrappers_required=false10594;;10595*cygwin* | *mingw* )10596test yes = "$build_libtool_libs" || wrappers_required=false10597;;10598*)10599if test no = "$need_relink" || test yes != "$build_libtool_libs"; then10600wrappers_required=false10601fi10602;;10603esac10604$wrappers_required || {10605# Replace the output file specification.10606compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`10607link_command=$compile_command$compile_rpath1060810609# We have no uninstalled library dependencies, so finalize right now.10610exit_status=010611func_show_eval "$link_command" 'exit_status=$?'1061210613if test -n "$postlink_cmds"; then10614func_to_tool_file "$output"10615postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`10616func_execute_cmds "$postlink_cmds" 'exit $?'10617fi1061810619# Delete the generated files.10620if test -f "$output_objdir/${outputname}S.$objext"; then10621func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'10622fi1062310624exit $exit_status10625}1062610627if test -n "$compile_shlibpath$finalize_shlibpath"; then10628compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"10629fi10630if test -n "$finalize_shlibpath"; then10631finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"10632fi1063310634compile_var=10635finalize_var=10636if test -n "$runpath_var"; then10637if test -n "$perm_rpath"; then10638# We should set the runpath_var.10639rpath=10640for dir in $perm_rpath; do10641func_append rpath "$dir:"10642done10643compile_var="$runpath_var=\"$rpath\$$runpath_var\" "10644fi10645if test -n "$finalize_perm_rpath"; then10646# We should set the runpath_var.10647rpath=10648for dir in $finalize_perm_rpath; do10649func_append rpath "$dir:"10650done10651finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "10652fi10653fi1065410655if test yes = "$no_install"; then10656# We don't need to create a wrapper script.10657link_command=$compile_var$compile_command$compile_rpath10658# Replace the output file specification.10659link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`10660# Delete the old output file.10661$opt_dry_run || $RM $output10662# Link the executable and exit10663func_show_eval "$link_command" 'exit $?'1066410665if test -n "$postlink_cmds"; then10666func_to_tool_file "$output"10667postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`10668func_execute_cmds "$postlink_cmds" 'exit $?'10669fi1067010671exit $EXIT_SUCCESS10672fi1067310674case $hardcode_action,$fast_install in10675relink,*)10676# Fast installation is not supported10677link_command=$compile_var$compile_command$compile_rpath10678relink_command=$finalize_var$finalize_command$finalize_rpath1067910680func_warning "this platform does not like uninstalled shared libraries"10681func_warning "'$output' will be relinked during installation"10682;;10683*,yes)10684link_command=$finalize_var$compile_command$finalize_rpath10685relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`10686;;10687*,no)10688link_command=$compile_var$compile_command$compile_rpath10689relink_command=$finalize_var$finalize_command$finalize_rpath10690;;10691*,needless)10692link_command=$finalize_var$compile_command$finalize_rpath10693relink_command=10694;;10695esac1069610697# Replace the output file specification.10698link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`1069910700# Delete the old output files.10701$opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname1070210703func_show_eval "$link_command" 'exit $?'1070410705if test -n "$postlink_cmds"; then10706func_to_tool_file "$output_objdir/$outputname"10707postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`10708func_execute_cmds "$postlink_cmds" 'exit $?'10709fi1071010711# Now create the wrapper script.10712func_verbose "creating $output"1071310714# Quote the relink command for shipping.10715if test -n "$relink_command"; then10716# Preserve any variables that may affect compiler behavior10717for var in $variables_saved_for_relink; do10718if eval test -z \"\${$var+set}\"; then10719relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"10720elif eval var_value=\$$var; test -z "$var_value"; then10721relink_command="$var=; export $var; $relink_command"10722else10723func_quote_arg pretty "$var_value"10724relink_command="$var=$func_quote_arg_result; export $var; $relink_command"10725fi10726done10727func_quote eval cd "`pwd`"10728func_quote_arg pretty,unquoted "($func_quote_result; $relink_command)"10729relink_command=$func_quote_arg_unquoted_result10730fi1073110732# Only actually do things if not in dry run mode.10733$opt_dry_run || {10734# win32 will think the script is a binary if it has10735# a .exe suffix, so we strip it off here.10736case $output in10737*.exe) func_stripname '' '.exe' "$output"10738output=$func_stripname_result ;;10739esac10740# test for cygwin because mv fails w/o .exe extensions10741case $host in10742*cygwin*)10743exeext=.exe10744func_stripname '' '.exe' "$outputname"10745outputname=$func_stripname_result ;;10746*) exeext= ;;10747esac10748case $host in10749*cygwin* | *mingw* )10750func_dirname_and_basename "$output" "" "."10751output_name=$func_basename_result10752output_path=$func_dirname_result10753cwrappersource=$output_path/$objdir/lt-$output_name.c10754cwrapper=$output_path/$output_name.exe10755$RM $cwrappersource $cwrapper10756trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 151075710758func_emit_cwrapperexe_src > $cwrappersource1075910760# The wrapper executable is built using the $host compiler,10761# because it contains $host paths and files. If cross-10762# compiling, it, like the target executable, must be10763# executed on the $host or under an emulation environment.10764$opt_dry_run || {10765$LTCC $LTCFLAGS -o $cwrapper $cwrappersource10766$STRIP $cwrapper10767}1076810769# Now, create the wrapper script for func_source use:10770func_ltwrapper_scriptname $cwrapper10771$RM $func_ltwrapper_scriptname_result10772trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 1510773$opt_dry_run || {10774# note: this script will not be executed, so do not chmod.10775if test "x$build" = "x$host"; then10776$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result10777else10778func_emit_wrapper no > $func_ltwrapper_scriptname_result10779fi10780}10781;;10782* )10783$RM $output10784trap "$RM $output; exit $EXIT_FAILURE" 1 2 151078510786func_emit_wrapper no > $output10787chmod +x $output10788;;10789esac10790}10791exit $EXIT_SUCCESS10792;;10793esac1079410795# See if we need to build an old-fashioned archive.10796for oldlib in $oldlibs; do1079710798case $build_libtool_libs in10799convenience)10800oldobjs="$libobjs_save $symfileobj"10801addlibs=$convenience10802build_libtool_libs=no10803;;10804module)10805oldobjs=$libobjs_save10806addlibs=$old_convenience10807build_libtool_libs=no10808;;10809*)10810oldobjs="$old_deplibs $non_pic_objects"10811$preload && test -f "$symfileobj" \10812&& func_append oldobjs " $symfileobj"10813addlibs=$old_convenience10814;;10815esac1081610817if test -n "$addlibs"; then10818gentop=$output_objdir/${outputname}x10819func_append generated " $gentop"1082010821func_extract_archives $gentop $addlibs10822func_append oldobjs " $func_extract_archives_result"10823fi1082410825# Do each command in the archive commands.10826if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then10827cmds=$old_archive_from_new_cmds10828else1082910830# Add any objects from preloaded convenience libraries10831if test -n "$dlprefiles"; then10832gentop=$output_objdir/${outputname}x10833func_append generated " $gentop"1083410835func_extract_archives $gentop $dlprefiles10836func_append oldobjs " $func_extract_archives_result"10837fi1083810839# POSIX demands no paths to be encoded in archives. We have10840# to avoid creating archives with duplicate basenames if we10841# might have to extract them afterwards, e.g., when creating a10842# static archive out of a convenience library, or when linking10843# the entirety of a libtool archive into another (currently10844# not supported by libtool).10845if (for obj in $oldobjs10846do10847func_basename "$obj"10848$ECHO "$func_basename_result"10849done | sort | sort -uc >/dev/null 2>&1); then10850:10851else10852echo "copying selected object files to avoid basename conflicts..."10853gentop=$output_objdir/${outputname}x10854func_append generated " $gentop"10855func_mkdir_p "$gentop"10856save_oldobjs=$oldobjs10857oldobjs=10858counter=110859for obj in $save_oldobjs10860do10861func_basename "$obj"10862objbase=$func_basename_result10863case " $oldobjs " in10864" ") oldobjs=$obj ;;10865*[\ /]"$objbase "*)10866while :; do10867# Make sure we don't pick an alternate name that also10868# overlaps.10869newobj=lt$counter-$objbase10870func_arith $counter + 110871counter=$func_arith_result10872case " $oldobjs " in10873*[\ /]"$newobj "*) ;;10874*) if test ! -f "$gentop/$newobj"; then break; fi ;;10875esac10876done10877func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"10878func_append oldobjs " $gentop/$newobj"10879;;10880*) func_append oldobjs " $obj" ;;10881esac10882done10883fi10884func_to_tool_file "$oldlib" func_convert_file_msys_to_w3210885tool_oldlib=$func_to_tool_file_result10886eval cmds=\"$old_archive_cmds\"1088710888func_len " $cmds"10889len=$func_len_result10890if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then10891cmds=$old_archive_cmds10892elif test -n "$archiver_list_spec"; then10893func_verbose "using command file archive linking..."10894for obj in $oldobjs10895do10896func_to_tool_file "$obj"10897$ECHO "$func_to_tool_file_result"10898done > $output_objdir/$libname.libcmd10899func_to_tool_file "$output_objdir/$libname.libcmd"10900oldobjs=" $archiver_list_spec$func_to_tool_file_result"10901cmds=$old_archive_cmds10902else10903# the command line is too long to link in one step, link in parts10904func_verbose "using piecewise archive linking..."10905save_RANLIB=$RANLIB10906RANLIB=:10907objlist=10908concat_cmds=10909save_oldobjs=$oldobjs10910oldobjs=10911# Is there a better way of finding the last object in the list?10912for obj in $save_oldobjs10913do10914last_oldobj=$obj10915done10916eval test_cmds=\"$old_archive_cmds\"10917func_len " $test_cmds"10918len0=$func_len_result10919len=$len010920for obj in $save_oldobjs10921do10922func_len " $obj"10923func_arith $len + $func_len_result10924len=$func_arith_result10925func_append objlist " $obj"10926if test "$len" -lt "$max_cmd_len"; then10927:10928else10929# the above command should be used before it gets too long10930oldobjs=$objlist10931if test "$obj" = "$last_oldobj"; then10932RANLIB=$save_RANLIB10933fi10934test -z "$concat_cmds" || concat_cmds=$concat_cmds~10935eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"10936objlist=10937len=$len010938fi10939done10940RANLIB=$save_RANLIB10941oldobjs=$objlist10942if test -z "$oldobjs"; then10943eval cmds=\"\$concat_cmds\"10944else10945eval cmds=\"\$concat_cmds~\$old_archive_cmds\"10946fi10947fi10948fi10949func_execute_cmds "$cmds" 'exit $?'10950done1095110952test -n "$generated" && \10953func_show_eval "${RM}r$generated"1095410955# Now create the libtool archive.10956case $output in10957*.la)10958old_library=10959test yes = "$build_old_libs" && old_library=$libname.$libext10960func_verbose "creating $output"1096110962# Preserve any variables that may affect compiler behavior10963for var in $variables_saved_for_relink; do10964if eval test -z \"\${$var+set}\"; then10965relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"10966elif eval var_value=\$$var; test -z "$var_value"; then10967relink_command="$var=; export $var; $relink_command"10968else10969func_quote_arg pretty,unquoted "$var_value"10970relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command"10971fi10972done10973# Quote the link command for shipping.10974func_quote eval cd "`pwd`"10975relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"10976func_quote_arg pretty,unquoted "$relink_command"10977relink_command=$func_quote_arg_unquoted_result10978if test yes = "$hardcode_automatic"; then10979relink_command=10980fi1098110982# Only create the output if not a dry run.10983$opt_dry_run || {10984for installed in no yes; do10985if test yes = "$installed"; then10986if test -z "$install_libdir"; then10987break10988fi10989output=$output_objdir/${outputname}i10990# Replace all uninstalled libtool libraries with the installed ones10991newdependency_libs=10992for deplib in $dependency_libs; do10993case $deplib in10994*.la)10995func_basename "$deplib"10996name=$func_basename_result10997func_resolve_sysroot "$deplib"10998eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`10999test -z "$libdir" && \11000func_fatal_error "'$deplib' is not a valid libtool archive"11001func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"11002;;11003-L*)11004func_stripname -L '' "$deplib"11005func_replace_sysroot "$func_stripname_result"11006func_append newdependency_libs " -L$func_replace_sysroot_result"11007;;11008-R*)11009func_stripname -R '' "$deplib"11010func_replace_sysroot "$func_stripname_result"11011func_append newdependency_libs " -R$func_replace_sysroot_result"11012;;11013*) func_append newdependency_libs " $deplib" ;;11014esac11015done11016dependency_libs=$newdependency_libs11017newdlfiles=1101811019for lib in $dlfiles; do11020case $lib in11021*.la)11022func_basename "$lib"11023name=$func_basename_result11024eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`11025test -z "$libdir" && \11026func_fatal_error "'$lib' is not a valid libtool archive"11027func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"11028;;11029*) func_append newdlfiles " $lib" ;;11030esac11031done11032dlfiles=$newdlfiles11033newdlprefiles=11034for lib in $dlprefiles; do11035case $lib in11036*.la)11037# Only pass preopened files to the pseudo-archive (for11038# eventual linking with the app. that links it) if we11039# didn't already link the preopened objects directly into11040# the library:11041func_basename "$lib"11042name=$func_basename_result11043eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`11044test -z "$libdir" && \11045func_fatal_error "'$lib' is not a valid libtool archive"11046func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"11047;;11048esac11049done11050dlprefiles=$newdlprefiles11051else11052newdlfiles=11053for lib in $dlfiles; do11054case $lib in11055[\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;11056*) abs=`pwd`"/$lib" ;;11057esac11058func_append newdlfiles " $abs"11059done11060dlfiles=$newdlfiles11061newdlprefiles=11062for lib in $dlprefiles; do11063case $lib in11064[\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;11065*) abs=`pwd`"/$lib" ;;11066esac11067func_append newdlprefiles " $abs"11068done11069dlprefiles=$newdlprefiles11070fi11071$RM $output11072# place dlname in correct position for cygwin11073# In fact, it would be nice if we could use this code for all target11074# systems that can't hard-code library paths into their executables11075# and that have no shared library path variable independent of PATH,11076# but it turns out we can't easily determine that from inspecting11077# libtool variables, so we have to hard-code the OSs to which it11078# applies here; at the moment, that means platforms that use the PE11079# object format with DLL files. See the long comment at the top of11080# tests/bindir.at for full details.11081tdlname=$dlname11082case $host,$output,$installed,$module,$dlname in11083*cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)11084# If a -bindir argument was supplied, place the dll there.11085if test -n "$bindir"; then11086func_relative_path "$install_libdir" "$bindir"11087tdlname=$func_relative_path_result/$dlname11088else11089# Otherwise fall back on heuristic.11090tdlname=../bin/$dlname11091fi11092;;11093esac11094$ECHO > $output "\11095# $outputname - a libtool library file11096# Generated by $PROGRAM (GNU $PACKAGE) $VERSION11097#11098# Please DO NOT delete this file!11099# It is necessary for linking the library.1110011101# The name that we can dlopen(3).11102dlname='$tdlname'1110311104# Names of this library.11105library_names='$library_names'1110611107# The name of the static archive.11108old_library='$old_library'1110911110# Linker flags that cannot go in dependency_libs.11111inherited_linker_flags='$new_inherited_linker_flags'1111211113# Libraries that this one depends upon.11114dependency_libs='$dependency_libs'1111511116# Names of additional weak libraries provided by this library11117weak_library_names='$weak_libs'1111811119# Version information for $libname.11120current=$current11121age=$age11122revision=$revision1112311124# Is this an already installed library?11125installed=$installed1112611127# Should we warn about portability when linking against -modules?11128shouldnotlink=$module1112911130# Files to dlopen/dlpreopen11131dlopen='$dlfiles'11132dlpreopen='$dlprefiles'1113311134# Directory that this library needs to be installed in:11135libdir='$install_libdir'"11136if test no,yes = "$installed,$need_relink"; then11137$ECHO >> $output "\11138relink_command=\"$relink_command\""11139fi11140done11141}1114211143# Do a symbolic link so that the libtool archive can be found in11144# LD_LIBRARY_PATH before the program is installed.11145func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'11146;;11147esac11148exit $EXIT_SUCCESS11149}1115011151if test link = "$opt_mode" || test relink = "$opt_mode"; then11152func_mode_link ${1+"$@"}11153fi111541115511156# func_mode_uninstall arg...11157func_mode_uninstall ()11158{11159$debug_cmd1116011161RM=$nonopt11162files=11163rmforce=false11164exit_status=01116511166# This variable tells wrapper scripts just to set variables rather11167# than running their programs.11168libtool_install_magic=$magic1116911170for arg11171do11172case $arg in11173-f) func_append RM " $arg"; rmforce=: ;;11174-*) func_append RM " $arg" ;;11175*) func_append files " $arg" ;;11176esac11177done1117811179test -z "$RM" && \11180func_fatal_help "you must specify an RM program"1118111182rmdirs=1118311184for file in $files; do11185func_dirname "$file" "" "."11186dir=$func_dirname_result11187if test . = "$dir"; then11188odir=$objdir11189else11190odir=$dir/$objdir11191fi11192func_basename "$file"11193name=$func_basename_result11194test uninstall = "$opt_mode" && odir=$dir1119511196# Remember odir for removal later, being careful to avoid duplicates11197if test clean = "$opt_mode"; then11198case " $rmdirs " in11199*" $odir "*) ;;11200*) func_append rmdirs " $odir" ;;11201esac11202fi1120311204# Don't error if the file doesn't exist and rm -f was used.11205if { test -L "$file"; } >/dev/null 2>&1 ||11206{ test -h "$file"; } >/dev/null 2>&1 ||11207test -f "$file"; then11208:11209elif test -d "$file"; then11210exit_status=111211continue11212elif $rmforce; then11213continue11214fi1121511216rmfiles=$file1121711218case $name in11219*.la)11220# Possibly a libtool archive, so verify it.11221if func_lalib_p "$file"; then11222func_source $dir/$name1122311224# Delete the libtool libraries and symlinks.11225for n in $library_names; do11226func_append rmfiles " $odir/$n"11227done11228test -n "$old_library" && func_append rmfiles " $odir/$old_library"1122911230case $opt_mode in11231clean)11232case " $library_names " in11233*" $dlname "*) ;;11234*) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;11235esac11236test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"11237;;11238uninstall)11239if test -n "$library_names"; then11240# Do each command in the postuninstall commands.11241func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'11242fi1124311244if test -n "$old_library"; then11245# Do each command in the old_postuninstall commands.11246func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'11247fi11248# FIXME: should reinstall the best remaining shared library.11249;;11250esac11251fi11252;;1125311254*.lo)11255# Possibly a libtool object, so verify it.11256if func_lalib_p "$file"; then1125711258# Read the .lo file11259func_source $dir/$name1126011261# Add PIC object to the list of files to remove.11262if test -n "$pic_object" && test none != "$pic_object"; then11263func_append rmfiles " $dir/$pic_object"11264fi1126511266# Add non-PIC object to the list of files to remove.11267if test -n "$non_pic_object" && test none != "$non_pic_object"; then11268func_append rmfiles " $dir/$non_pic_object"11269fi11270fi11271;;1127211273*)11274if test clean = "$opt_mode"; then11275noexename=$name11276case $file in11277*.exe)11278func_stripname '' '.exe' "$file"11279file=$func_stripname_result11280func_stripname '' '.exe' "$name"11281noexename=$func_stripname_result11282# $file with .exe has already been added to rmfiles,11283# add $file without .exe11284func_append rmfiles " $file"11285;;11286esac11287# Do a test to see if this is a libtool program.11288if func_ltwrapper_p "$file"; then11289if func_ltwrapper_executable_p "$file"; then11290func_ltwrapper_scriptname "$file"11291relink_command=11292func_source $func_ltwrapper_scriptname_result11293func_append rmfiles " $func_ltwrapper_scriptname_result"11294else11295relink_command=11296func_source $dir/$noexename11297fi1129811299# note $name still contains .exe if it was in $file originally11300# as does the version of $file that was added into $rmfiles11301func_append rmfiles " $odir/$name $odir/${name}S.$objext"11302if test yes = "$fast_install" && test -n "$relink_command"; then11303func_append rmfiles " $odir/lt-$name"11304fi11305if test "X$noexename" != "X$name"; then11306func_append rmfiles " $odir/lt-$noexename.c"11307fi11308fi11309fi11310;;11311esac11312func_show_eval "$RM $rmfiles" 'exit_status=1'11313done1131411315# Try to remove the $objdir's in the directories where we deleted files11316for dir in $rmdirs; do11317if test -d "$dir"; then11318func_show_eval "rmdir $dir >/dev/null 2>&1"11319fi11320done1132111322exit $exit_status11323}1132411325if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then11326func_mode_uninstall ${1+"$@"}11327fi1132811329test -z "$opt_mode" && {11330help=$generic_help11331func_fatal_help "you must specify a MODE"11332}1133311334test -z "$exec_cmd" && \11335func_fatal_help "invalid operation mode '$opt_mode'"1133611337if test -n "$exec_cmd"; then11338eval exec "$exec_cmd"11339exit $EXIT_FAILURE11340fi1134111342exit $exit_status113431134411345# The TAGs below are defined such that we never get into a situation11346# where we disable both kinds of libraries. Given conflicting11347# choices, we go for a static library, that is the most portable,11348# since we can't tell whether shared libraries were disabled because11349# the user asked for that or because the platform doesn't support11350# them. This is particularly important on AIX, because we don't11351# support having both static and shared libraries enabled at the same11352# time on that platform, so we default to a shared-only configuration.11353# If a disable-shared tag is given, we'll fallback to a static-only11354# configuration. But we'll never go from static-only to shared-only.1135511356# ### BEGIN LIBTOOL TAG CONFIG: disable-shared11357build_libtool_libs=no11358build_old_libs=yes11359# ### END LIBTOOL TAG CONFIG: disable-shared1136011361# ### BEGIN LIBTOOL TAG CONFIG: disable-static11362build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`11363# ### END LIBTOOL TAG CONFIG: disable-static1136411365# Local Variables:11366# mode:shell-script11367# sh-indentation:211368# End:113691137011371