Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
| Download
GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
Project: cocalc-sagemath-dev-slelievre
Views: 418346#! /bin/sh1## DO NOT EDIT - This file generated from ./build-aux/ltmain.in2## by inline-source v2014-01-03.0134# libtool (GNU libtool) 2.4.65# Provide generalized library-building support services.6# Written by Gordon Matzigkeit <[email protected]>, 199678# Copyright (C) 1996-2015 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 Debian-2.4.6-0.1"34package_revision=2.4.6353637## ------ ##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=2015-01-20.17; # UTC6768# General shell script boiler plate, and helper functions.69# Written by Gary V. Vaughan, 20047071# Copyright (C) 2004-2015 Free Software Foundation, Inc.72# This is free software; see the source for copying conditions. There is NO73# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.7475# This program is free software; you can redistribute it and/or modify76# it under the terms of the GNU General Public License as published by77# the Free Software Foundation; either version 3 of the License, or78# (at your option) any later version.7980# As a special exception to the GNU General Public License, if you distribute81# this file as part of a program or library that is built using GNU Libtool,82# you may include this file under the same distribution terms that you use83# for the rest of that program.8485# This program is distributed in the hope that it will be useful,86# but WITHOUT ANY WARRANTY; without even the implied warranty of87# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU88# General Public License for more details.8990# You should have received a copy of the GNU General Public License91# along with this program. If not, see <http://www.gnu.org/licenses/>.9293# Please report bugs or propose patches to [email protected].949596## ------ ##97## Usage. ##98## ------ ##99100# Evaluate this file near the top of your script to gain access to101# the functions and variables defined here:102#103# . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh104#105# If you need to override any of the default environment variable106# settings, do that before evaluating this file.107108109## -------------------- ##110## Shell normalisation. ##111## -------------------- ##112113# Some shells need a little help to be as Bourne compatible as possible.114# Before doing anything else, make sure all that help has been provided!115116DUALCASE=1; export DUALCASE # for MKS sh117if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :118emulate sh119NULLCMD=:120# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which121# is contrary to our usage. Disable this feature.122alias -g '${1+"$@"}'='"$@"'123setopt NO_GLOB_SUBST124else125case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac126fi127128# NLS nuisances: We save the old values in case they are required later.129_G_user_locale=130_G_safe_locale=131for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES132do133eval "if test set = \"\${$_G_var+set}\"; then134save_$_G_var=\$$_G_var135$_G_var=C136export $_G_var137_G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"138_G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"139fi"140done141142# CDPATH.143(unset CDPATH) >/dev/null 2>&1 && unset CDPATH144145# Make sure IFS has a sensible default146sp=' '147nl='148'149IFS="$sp $nl"150151# There are apparently some retarded systems that use ';' as a PATH separator!152if test "${PATH_SEPARATOR+set}" != set; then153PATH_SEPARATOR=:154(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {155(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||156PATH_SEPARATOR=';'157}158fi159160161162## ------------------------- ##163## Locate command utilities. ##164## ------------------------- ##165166167# func_executable_p FILE168# ----------------------169# Check that FILE is an executable regular file.170func_executable_p ()171{172test -f "$1" && test -x "$1"173}174175176# func_path_progs PROGS_LIST CHECK_FUNC [PATH]177# --------------------------------------------178# Search for either a program that responds to --version with output179# containing "GNU", or else returned by CHECK_FUNC otherwise, by180# trying all the directories in PATH with each of the elements of181# PROGS_LIST.182#183# CHECK_FUNC should accept the path to a candidate program, and184# set $func_check_prog_result if it truncates its output less than185# $_G_path_prog_max characters.186func_path_progs ()187{188_G_progs_list=$1189_G_check_func=$2190_G_PATH=${3-"$PATH"}191192_G_path_prog_max=0193_G_path_prog_found=false194_G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}195for _G_dir in $_G_PATH; do196IFS=$_G_save_IFS197test -z "$_G_dir" && _G_dir=.198for _G_prog_name in $_G_progs_list; do199for _exeext in '' .EXE; do200_G_path_prog=$_G_dir/$_G_prog_name$_exeext201func_executable_p "$_G_path_prog" || continue202case `"$_G_path_prog" --version 2>&1` in203*GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;204*) $_G_check_func $_G_path_prog205func_path_progs_result=$func_check_prog_result206;;207esac208$_G_path_prog_found && break 3209done210done211done212IFS=$_G_save_IFS213test -z "$func_path_progs_result" && {214echo "no acceptable sed could be found in \$PATH" >&2215exit 1216}217}218219220# We want to be able to use the functions in this file before configure221# has figured out where the best binaries are kept, which means we have222# to search for them ourselves - except when the results are already set223# where we skip the searches.224225# Unless the user overrides by setting SED, search the path for either GNU226# sed, or the sed that truncates its output the least.227test -z "$SED" && {228_G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/229for _G_i in 1 2 3 4 5 6 7; do230_G_sed_script=$_G_sed_script$nl$_G_sed_script231done232echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed233_G_sed_script=234235func_check_prog_sed ()236{237_G_path_prog=$1238239_G_count=0240printf 0123456789 >conftest.in241while :242do243cat conftest.in conftest.in >conftest.tmp244mv conftest.tmp conftest.in245cp conftest.in conftest.nl246echo '' >> conftest.nl247"$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break248diff conftest.out conftest.nl >/dev/null 2>&1 || break249_G_count=`expr $_G_count + 1`250if test "$_G_count" -gt "$_G_path_prog_max"; then251# Best one so far, save it but keep looking for a better one252func_check_prog_result=$_G_path_prog253_G_path_prog_max=$_G_count254fi255# 10*(2^10) chars as input seems more than enough256test 10 -lt "$_G_count" && break257done258rm -f conftest.in conftest.tmp conftest.nl conftest.out259}260261func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin262rm -f conftest.sed263SED=$func_path_progs_result264}265266267# Unless the user overrides by setting GREP, search the path for either GNU268# grep, or the grep that truncates its output the least.269test -z "$GREP" && {270func_check_prog_grep ()271{272_G_path_prog=$1273274_G_count=0275_G_path_prog_max=0276printf 0123456789 >conftest.in277while :278do279cat conftest.in conftest.in >conftest.tmp280mv conftest.tmp conftest.in281cp conftest.in conftest.nl282echo 'GREP' >> conftest.nl283"$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break284diff conftest.out conftest.nl >/dev/null 2>&1 || break285_G_count=`expr $_G_count + 1`286if test "$_G_count" -gt "$_G_path_prog_max"; then287# Best one so far, save it but keep looking for a better one288func_check_prog_result=$_G_path_prog289_G_path_prog_max=$_G_count290fi291# 10*(2^10) chars as input seems more than enough292test 10 -lt "$_G_count" && break293done294rm -f conftest.in conftest.tmp conftest.nl conftest.out295}296297func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin298GREP=$func_path_progs_result299}300301302## ------------------------------- ##303## User overridable command paths. ##304## ------------------------------- ##305306# All uppercase variable names are used for environment variables. These307# variables can be overridden by the user before calling a script that308# uses them if a suitable command of that name is not already available309# in the command search PATH.310311: ${CP="cp -f"}312: ${ECHO="printf %s\n"}313: ${EGREP="$GREP -E"}314: ${FGREP="$GREP -F"}315: ${LN_S="ln -s"}316: ${MAKE="make"}317: ${MKDIR="mkdir"}318: ${MV="mv -f"}319: ${RM="rm -f"}320: ${SHELL="${CONFIG_SHELL-/bin/sh}"}321322323## -------------------- ##324## Useful sed snippets. ##325## -------------------- ##326327sed_dirname='s|/[^/]*$||'328sed_basename='s|^.*/||'329330# Sed substitution that helps us do robust quoting. It backslashifies331# metacharacters that are still active within double-quoted strings.332sed_quote_subst='s|\([`"$\\]\)|\\\1|g'333334# Same as above, but do not quote variable references.335sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'336337# Sed substitution that turns a string into a regex matching for the338# string literally.339sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'340341# Sed substitution that converts a w32 file name or path342# that contains forward slashes, into one that contains343# (escaped) backslashes. A very naive implementation.344sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'345346# Re-'\' parameter expansions in output of sed_double_quote_subst that347# were '\'-ed in input to the same. If an odd number of '\' preceded a348# '$' in input to sed_double_quote_subst, that '$' was protected from349# expansion. Since each input '\' is now two '\'s, look for any number350# of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'.351_G_bs='\\'352_G_bs2='\\\\'353_G_bs4='\\\\\\\\'354_G_dollar='\$'355sed_double_backslash="\356s/$_G_bs4/&\\357/g358s/^$_G_bs2$_G_dollar/$_G_bs&/359s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g360s/\n//g"361362363## ----------------- ##364## Global variables. ##365## ----------------- ##366367# Except for the global variables explicitly listed below, the following368# functions in the '^func_' namespace, and the '^require_' namespace369# variables initialised in the 'Resource management' section, sourcing370# this file will not pollute your global namespace with anything371# else. There's no portable way to scope variables in Bourne shell372# though, so actually running these functions will sometimes place373# results into a variable named after the function, and often use374# temporary variables in the '^_G_' namespace. If you are careful to375# avoid using those namespaces casually in your sourcing script, things376# should continue to work as you expect. And, of course, you can freely377# overwrite any of the functions or variables defined here before378# calling anything to customize them.379380EXIT_SUCCESS=0381EXIT_FAILURE=1382EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.383EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.384385# Allow overriding, eg assuming that you follow the convention of386# putting '$debug_cmd' at the start of all your functions, you can get387# bash to show function call trace with:388#389# debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name390debug_cmd=${debug_cmd-":"}391exit_cmd=:392393# By convention, finish your script with:394#395# exit $exit_status396#397# so that you can set exit_status to non-zero if you want to indicate398# something went wrong during execution without actually bailing out at399# the point of failure.400exit_status=$EXIT_SUCCESS401402# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh403# is ksh but when the shell is invoked as "sh" and the current value of404# the _XPG environment variable is not equal to 1 (one), the special405# positional parameter $0, within a function call, is the name of the406# function.407progpath=$0408409# The name of this program.410progname=`$ECHO "$progpath" |$SED "$sed_basename"`411412# Make sure we have an absolute progpath for reexecution:413case $progpath in414[\\/]*|[A-Za-z]:\\*) ;;415*[\\/]*)416progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`417progdir=`cd "$progdir" && pwd`418progpath=$progdir/$progname419;;420*)421_G_IFS=$IFS422IFS=${PATH_SEPARATOR-:}423for progdir in $PATH; do424IFS=$_G_IFS425test -x "$progdir/$progname" && break426done427IFS=$_G_IFS428test -n "$progdir" || progdir=`pwd`429progpath=$progdir/$progname430;;431esac432433434## ----------------- ##435## Standard options. ##436## ----------------- ##437438# The following options affect the operation of the functions defined439# below, and should be set appropriately depending on run-time para-440# meters passed on the command line.441442opt_dry_run=false443opt_quiet=false444opt_verbose=false445446# Categories 'all' and 'none' are always available. Append any others447# you will pass as the first argument to func_warning from your own448# code.449warning_categories=450451# By default, display warnings according to 'opt_warning_types'. Set452# 'warning_func' to ':' to elide all warnings, or func_fatal_error to453# treat the next displayed warning as a fatal error.454warning_func=func_warn_and_continue455456# Set to 'all' to display all warnings, 'none' to suppress all457# warnings, or a space delimited list of some subset of458# 'warning_categories' to display only the listed warnings.459opt_warning_types=all460461462## -------------------- ##463## Resource management. ##464## -------------------- ##465466# This section contains definitions for functions that each ensure a467# particular resource (a file, or a non-empty configuration variable for468# example) is available, and if appropriate to extract default values469# from pertinent package files. Call them using their associated470# 'require_*' variable to ensure that they are executed, at most, once.471#472# It's entirely deliberate that calling these functions can set473# variables that don't obey the namespace limitations obeyed by the rest474# of this file, in order that that they be as useful as possible to475# callers.476477478# require_term_colors479# -------------------480# Allow display of bold text on terminals that support it.481require_term_colors=func_require_term_colors482func_require_term_colors ()483{484$debug_cmd485486test -t 1 && {487# COLORTERM and USE_ANSI_COLORS environment variables take488# precedence, because most terminfo databases neglect to describe489# whether color sequences are supported.490test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}491492if test 1 = "$USE_ANSI_COLORS"; then493# Standard ANSI escape sequences494tc_reset='[0m'495tc_bold='[1m'; tc_standout='[7m'496tc_red='[31m'; tc_green='[32m'497tc_blue='[34m'; tc_cyan='[36m'498else499# Otherwise trust the terminfo database after all.500test -n "`tput sgr0 2>/dev/null`" && {501tc_reset=`tput sgr0`502test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`503tc_standout=$tc_bold504test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`505test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`506test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`507test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`508test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`509}510fi511}512513require_term_colors=:514}515516517## ----------------- ##518## Function library. ##519## ----------------- ##520521# This section contains a variety of useful functions to call in your522# scripts. Take note of the portable wrappers for features provided by523# some modern shells, which will fall back to slower equivalents on524# less featureful shells.525526527# func_append VAR VALUE528# ---------------------529# Append VALUE onto the existing contents of VAR.530531# We should try to minimise forks, especially on Windows where they are532# unreasonably slow, so skip the feature probes when bash or zsh are533# being used:534if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then535: ${_G_HAVE_ARITH_OP="yes"}536: ${_G_HAVE_XSI_OPS="yes"}537# The += operator was introduced in bash 3.1538case $BASH_VERSION in539[12].* | 3.0 | 3.0*) ;;540*)541: ${_G_HAVE_PLUSEQ_OP="yes"}542;;543esac544fi545546# _G_HAVE_PLUSEQ_OP547# Can be empty, in which case the shell is probed, "yes" if += is548# useable or anything else if it does not work.549test -z "$_G_HAVE_PLUSEQ_OP" \550&& (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \551&& _G_HAVE_PLUSEQ_OP=yes552553if test yes = "$_G_HAVE_PLUSEQ_OP"554then555# This is an XSI compatible shell, allowing a faster implementation...556eval 'func_append ()557{558$debug_cmd559560eval "$1+=\$2"561}'562else563# ...otherwise fall back to using expr, which is often a shell builtin.564func_append ()565{566$debug_cmd567568eval "$1=\$$1\$2"569}570fi571572573# func_append_quoted VAR VALUE574# ----------------------------575# Quote VALUE and append to the end of shell variable VAR, separated576# by a space.577if test yes = "$_G_HAVE_PLUSEQ_OP"; then578eval 'func_append_quoted ()579{580$debug_cmd581582func_quote_for_eval "$2"583eval "$1+=\\ \$func_quote_for_eval_result"584}'585else586func_append_quoted ()587{588$debug_cmd589590func_quote_for_eval "$2"591eval "$1=\$$1\\ \$func_quote_for_eval_result"592}593fi594595596# func_append_uniq VAR VALUE597# --------------------------598# Append unique VALUE onto the existing contents of VAR, assuming599# entries are delimited by the first character of VALUE. For example:600#601# func_append_uniq options " --another-option option-argument"602#603# will only append to $options if " --another-option option-argument "604# is not already present somewhere in $options already (note spaces at605# each end implied by leading space in second argument).606func_append_uniq ()607{608$debug_cmd609610eval _G_current_value='`$ECHO $'$1'`'611_G_delim=`expr "$2" : '\(.\)'`612613case $_G_delim$_G_current_value$_G_delim in614*"$2$_G_delim"*) ;;615*) func_append "$@" ;;616esac617}618619620# func_arith TERM...621# ------------------622# Set func_arith_result to the result of evaluating TERMs.623test -z "$_G_HAVE_ARITH_OP" \624&& (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \625&& _G_HAVE_ARITH_OP=yes626627if test yes = "$_G_HAVE_ARITH_OP"; then628eval 'func_arith ()629{630$debug_cmd631632func_arith_result=$(( $* ))633}'634else635func_arith ()636{637$debug_cmd638639func_arith_result=`expr "$@"`640}641fi642643644# func_basename FILE645# ------------------646# Set func_basename_result to FILE with everything up to and including647# the last / stripped.648if test yes = "$_G_HAVE_XSI_OPS"; then649# If this shell supports suffix pattern removal, then use it to avoid650# forking. Hide the definitions single quotes in case the shell chokes651# on unsupported syntax...652_b='func_basename_result=${1##*/}'653_d='case $1 in654*/*) func_dirname_result=${1%/*}$2 ;;655* ) func_dirname_result=$3 ;;656esac'657658else659# ...otherwise fall back to using sed.660_b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'661_d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"`662if test "X$func_dirname_result" = "X$1"; then663func_dirname_result=$3664else665func_append func_dirname_result "$2"666fi'667fi668669eval 'func_basename ()670{671$debug_cmd672673'"$_b"'674}'675676677# func_dirname FILE APPEND NONDIR_REPLACEMENT678# -------------------------------------------679# Compute the dirname of FILE. If nonempty, add APPEND to the result,680# otherwise set result to NONDIR_REPLACEMENT.681eval 'func_dirname ()682{683$debug_cmd684685'"$_d"'686}'687688689# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT690# --------------------------------------------------------691# Perform func_basename and func_dirname in a single function692# call:693# dirname: Compute the dirname of FILE. If nonempty,694# add APPEND to the result, otherwise set result695# to NONDIR_REPLACEMENT.696# value returned in "$func_dirname_result"697# basename: Compute filename of FILE.698# value retuned in "$func_basename_result"699# For efficiency, we do not delegate to the functions above but instead700# duplicate the functionality here.701eval 'func_dirname_and_basename ()702{703$debug_cmd704705'"$_b"'706'"$_d"'707}'708709710# func_echo ARG...711# ----------------712# Echo program name prefixed message.713func_echo ()714{715$debug_cmd716717_G_message=$*718719func_echo_IFS=$IFS720IFS=$nl721for _G_line in $_G_message; do722IFS=$func_echo_IFS723$ECHO "$progname: $_G_line"724done725IFS=$func_echo_IFS726}727728729# func_echo_all ARG...730# --------------------731# Invoke $ECHO with all args, space-separated.732func_echo_all ()733{734$ECHO "$*"735}736737738# func_echo_infix_1 INFIX ARG...739# ------------------------------740# Echo program name, followed by INFIX on the first line, with any741# additional lines not showing INFIX.742func_echo_infix_1 ()743{744$debug_cmd745746$require_term_colors747748_G_infix=$1; shift749_G_indent=$_G_infix750_G_prefix="$progname: $_G_infix: "751_G_message=$*752753# Strip color escape sequences before counting printable length754for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"755do756test -n "$_G_tc" && {757_G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`758_G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`759}760done761_G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes762763func_echo_infix_1_IFS=$IFS764IFS=$nl765for _G_line in $_G_message; do766IFS=$func_echo_infix_1_IFS767$ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2768_G_prefix=$_G_indent769done770IFS=$func_echo_infix_1_IFS771}772773774# func_error ARG...775# -----------------776# Echo program name prefixed message to standard error.777func_error ()778{779$debug_cmd780781$require_term_colors782783func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2784}785786787# func_fatal_error ARG...788# -----------------------789# Echo program name prefixed message to standard error, and exit.790func_fatal_error ()791{792$debug_cmd793794func_error "$*"795exit $EXIT_FAILURE796}797798799# func_grep EXPRESSION FILENAME800# -----------------------------801# Check whether EXPRESSION matches any line of FILENAME, without output.802func_grep ()803{804$debug_cmd805806$GREP "$1" "$2" >/dev/null 2>&1807}808809810# func_len STRING811# ---------------812# Set func_len_result to the length of STRING. STRING may not813# start with a hyphen.814test -z "$_G_HAVE_XSI_OPS" \815&& (eval 'x=a/b/c;816test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \817&& _G_HAVE_XSI_OPS=yes818819if test yes = "$_G_HAVE_XSI_OPS"; then820eval 'func_len ()821{822$debug_cmd823824func_len_result=${#1}825}'826else827func_len ()828{829$debug_cmd830831func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`832}833fi834835836# func_mkdir_p DIRECTORY-PATH837# ---------------------------838# Make sure the entire path to DIRECTORY-PATH is available.839func_mkdir_p ()840{841$debug_cmd842843_G_directory_path=$1844_G_dir_list=845846if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then847848# Protect directory names starting with '-'849case $_G_directory_path in850-*) _G_directory_path=./$_G_directory_path ;;851esac852853# While some portion of DIR does not yet exist...854while test ! -d "$_G_directory_path"; do855# ...make a list in topmost first order. Use a colon delimited856# list incase some portion of path contains whitespace.857_G_dir_list=$_G_directory_path:$_G_dir_list858859# If the last portion added has no slash in it, the list is done860case $_G_directory_path in */*) ;; *) break ;; esac861862# ...otherwise throw away the child directory and loop863_G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`864done865_G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`866867func_mkdir_p_IFS=$IFS; IFS=:868for _G_dir in $_G_dir_list; do869IFS=$func_mkdir_p_IFS870# mkdir can fail with a 'File exist' error if two processes871# try to create one of the directories concurrently. Don't872# stop in that case!873$MKDIR "$_G_dir" 2>/dev/null || :874done875IFS=$func_mkdir_p_IFS876877# Bail out if we (or some other process) failed to create a directory.878test -d "$_G_directory_path" || \879func_fatal_error "Failed to create '$1'"880fi881}882883884# func_mktempdir [BASENAME]885# -------------------------886# Make a temporary directory that won't clash with other running887# libtool processes, and avoids race conditions if possible. If888# given, BASENAME is the basename for that directory.889func_mktempdir ()890{891$debug_cmd892893_G_template=${TMPDIR-/tmp}/${1-$progname}894895if test : = "$opt_dry_run"; then896# Return a directory name, but don't create it in dry-run mode897_G_tmpdir=$_G_template-$$898else899900# If mktemp works, use that first and foremost901_G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`902903if test ! -d "$_G_tmpdir"; then904# Failing that, at least try and use $RANDOM to avoid a race905_G_tmpdir=$_G_template-${RANDOM-0}$$906907func_mktempdir_umask=`umask`908umask 0077909$MKDIR "$_G_tmpdir"910umask $func_mktempdir_umask911fi912913# If we're not in dry-run mode, bomb out on failure914test -d "$_G_tmpdir" || \915func_fatal_error "cannot create temporary directory '$_G_tmpdir'"916fi917918$ECHO "$_G_tmpdir"919}920921922# func_normal_abspath PATH923# ------------------------924# Remove doubled-up and trailing slashes, "." path components,925# and cancel out any ".." path components in PATH after making926# it an absolute path.927func_normal_abspath ()928{929$debug_cmd930931# These SED scripts presuppose an absolute path with a trailing slash.932_G_pathcar='s|^/\([^/]*\).*$|\1|'933_G_pathcdr='s|^/[^/]*||'934_G_removedotparts=':dotsl935s|/\./|/|g936t dotsl937s|/\.$|/|'938_G_collapseslashes='s|/\{1,\}|/|g'939_G_finalslash='s|/*$|/|'940941# Start from root dir and reassemble the path.942func_normal_abspath_result=943func_normal_abspath_tpath=$1944func_normal_abspath_altnamespace=945case $func_normal_abspath_tpath in946"")947# Empty path, that just means $cwd.948func_stripname '' '/' "`pwd`"949func_normal_abspath_result=$func_stripname_result950return951;;952# The next three entries are used to spot a run of precisely953# two leading slashes without using negated character classes;954# we take advantage of case's first-match behaviour.955///*)956# Unusual form of absolute path, do nothing.957;;958//*)959# Not necessarily an ordinary path; POSIX reserves leading '//'960# and for example Cygwin uses it to access remote file shares961# over CIFS/SMB, so we conserve a leading double slash if found.962func_normal_abspath_altnamespace=/963;;964/*)965# Absolute path, do nothing.966;;967*)968# Relative path, prepend $cwd.969func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath970;;971esac972973# Cancel out all the simple stuff to save iterations. We also want974# the path to end with a slash for ease of parsing, so make sure975# there is one (and only one) here.976func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \977-e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`978while :; do979# Processed it all yet?980if test / = "$func_normal_abspath_tpath"; then981# If we ascended to the root using ".." the result may be empty now.982if test -z "$func_normal_abspath_result"; then983func_normal_abspath_result=/984fi985break986fi987func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \988-e "$_G_pathcar"`989func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \990-e "$_G_pathcdr"`991# Figure out what to do with it992case $func_normal_abspath_tcomponent in993"")994# Trailing empty path component, ignore it.995;;996..)997# Parent dir; strip last assembled component from result.998func_dirname "$func_normal_abspath_result"999func_normal_abspath_result=$func_dirname_result1000;;1001*)1002# Actual path component, append it.1003func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"1004;;1005esac1006done1007# Restore leading double-slash if one was found on entry.1008func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result1009}101010111012# func_notquiet ARG...1013# --------------------1014# Echo program name prefixed message only when not in quiet mode.1015func_notquiet ()1016{1017$debug_cmd10181019$opt_quiet || func_echo ${1+"$@"}10201021# A bug in bash halts the script if the last line of a function1022# fails when set -e is in force, so we need another command to1023# work around that:1024:1025}102610271028# func_relative_path SRCDIR DSTDIR1029# --------------------------------1030# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.1031func_relative_path ()1032{1033$debug_cmd10341035func_relative_path_result=1036func_normal_abspath "$1"1037func_relative_path_tlibdir=$func_normal_abspath_result1038func_normal_abspath "$2"1039func_relative_path_tbindir=$func_normal_abspath_result10401041# Ascend the tree starting from libdir1042while :; do1043# check if we have found a prefix of bindir1044case $func_relative_path_tbindir in1045$func_relative_path_tlibdir)1046# found an exact match1047func_relative_path_tcancelled=1048break1049;;1050$func_relative_path_tlibdir*)1051# found a matching prefix1052func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"1053func_relative_path_tcancelled=$func_stripname_result1054if test -z "$func_relative_path_result"; then1055func_relative_path_result=.1056fi1057break1058;;1059*)1060func_dirname $func_relative_path_tlibdir1061func_relative_path_tlibdir=$func_dirname_result1062if test -z "$func_relative_path_tlibdir"; then1063# Have to descend all the way to the root!1064func_relative_path_result=../$func_relative_path_result1065func_relative_path_tcancelled=$func_relative_path_tbindir1066break1067fi1068func_relative_path_result=../$func_relative_path_result1069;;1070esac1071done10721073# Now calculate path; take care to avoid doubling-up slashes.1074func_stripname '' '/' "$func_relative_path_result"1075func_relative_path_result=$func_stripname_result1076func_stripname '/' '/' "$func_relative_path_tcancelled"1077if test -n "$func_stripname_result"; then1078func_append func_relative_path_result "/$func_stripname_result"1079fi10801081# Normalisation. If bindir is libdir, return '.' else relative path.1082if test -n "$func_relative_path_result"; then1083func_stripname './' '' "$func_relative_path_result"1084func_relative_path_result=$func_stripname_result1085fi10861087test -n "$func_relative_path_result" || func_relative_path_result=.10881089:1090}109110921093# func_quote_for_eval ARG...1094# --------------------------1095# Aesthetically quote ARGs to be evaled later.1096# This function returns two values:1097# i) func_quote_for_eval_result1098# double-quoted, suitable for a subsequent eval1099# ii) func_quote_for_eval_unquoted_result1100# has all characters that are still active within double1101# quotes backslashified.1102func_quote_for_eval ()1103{1104$debug_cmd11051106func_quote_for_eval_unquoted_result=1107func_quote_for_eval_result=1108while test 0 -lt $#; do1109case $1 in1110*[\\\`\"\$]*)1111_G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;1112*)1113_G_unquoted_arg=$1 ;;1114esac1115if test -n "$func_quote_for_eval_unquoted_result"; then1116func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"1117else1118func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"1119fi11201121case $_G_unquoted_arg in1122# Double-quote args containing shell metacharacters to delay1123# word splitting, command substitution and variable expansion1124# for a subsequent eval.1125# Many Bourne shells cannot handle close brackets correctly1126# in scan sets, so we specify it separately.1127*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")1128_G_quoted_arg=\"$_G_unquoted_arg\"1129;;1130*)1131_G_quoted_arg=$_G_unquoted_arg1132;;1133esac11341135if test -n "$func_quote_for_eval_result"; then1136func_append func_quote_for_eval_result " $_G_quoted_arg"1137else1138func_append func_quote_for_eval_result "$_G_quoted_arg"1139fi1140shift1141done1142}114311441145# func_quote_for_expand ARG1146# -------------------------1147# Aesthetically quote ARG to be evaled later; same as above,1148# but do not quote variable references.1149func_quote_for_expand ()1150{1151$debug_cmd11521153case $1 in1154*[\\\`\"]*)1155_G_arg=`$ECHO "$1" | $SED \1156-e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;1157*)1158_G_arg=$1 ;;1159esac11601161case $_G_arg in1162# Double-quote args containing shell metacharacters to delay1163# word splitting and command substitution for a subsequent eval.1164# Many Bourne shells cannot handle close brackets correctly1165# in scan sets, so we specify it separately.1166*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")1167_G_arg=\"$_G_arg\"1168;;1169esac11701171func_quote_for_expand_result=$_G_arg1172}117311741175# func_stripname PREFIX SUFFIX NAME1176# ---------------------------------1177# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.1178# PREFIX and SUFFIX must not contain globbing or regex special1179# characters, hashes, percent signs, but SUFFIX may contain a leading1180# dot (in which case that matches only a dot).1181if test yes = "$_G_HAVE_XSI_OPS"; then1182eval 'func_stripname ()1183{1184$debug_cmd11851186# pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are1187# positional parameters, so assign one to ordinary variable first.1188func_stripname_result=$31189func_stripname_result=${func_stripname_result#"$1"}1190func_stripname_result=${func_stripname_result%"$2"}1191}'1192else1193func_stripname ()1194{1195$debug_cmd11961197case $2 in1198.*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;1199*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;1200esac1201}1202fi120312041205# func_show_eval CMD [FAIL_EXP]1206# -----------------------------1207# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is1208# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP1209# is given, then evaluate it.1210func_show_eval ()1211{1212$debug_cmd12131214_G_cmd=$11215_G_fail_exp=${2-':'}12161217func_quote_for_expand "$_G_cmd"1218eval "func_notquiet $func_quote_for_expand_result"12191220$opt_dry_run || {1221eval "$_G_cmd"1222_G_status=$?1223if test 0 -ne "$_G_status"; then1224eval "(exit $_G_status); $_G_fail_exp"1225fi1226}1227}122812291230# func_show_eval_locale CMD [FAIL_EXP]1231# ------------------------------------1232# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is1233# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP1234# is given, then evaluate it. Use the saved locale for evaluation.1235func_show_eval_locale ()1236{1237$debug_cmd12381239_G_cmd=$11240_G_fail_exp=${2-':'}12411242$opt_quiet || {1243func_quote_for_expand "$_G_cmd"1244eval "func_echo $func_quote_for_expand_result"1245}12461247$opt_dry_run || {1248eval "$_G_user_locale1249$_G_cmd"1250_G_status=$?1251eval "$_G_safe_locale"1252if test 0 -ne "$_G_status"; then1253eval "(exit $_G_status); $_G_fail_exp"1254fi1255}1256}125712581259# func_tr_sh1260# ----------1261# Turn $1 into a string suitable for a shell variable name.1262# Result is stored in $func_tr_sh_result. All characters1263# not in the set a-zA-Z0-9_ are replaced with '_'. Further,1264# if $1 begins with a digit, a '_' is prepended as well.1265func_tr_sh ()1266{1267$debug_cmd12681269case $1 in1270[0-9]* | *[!a-zA-Z0-9_]*)1271func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`1272;;1273* )1274func_tr_sh_result=$11275;;1276esac1277}127812791280# func_verbose ARG...1281# -------------------1282# Echo program name prefixed message in verbose mode only.1283func_verbose ()1284{1285$debug_cmd12861287$opt_verbose && func_echo "$*"12881289:1290}129112921293# func_warn_and_continue ARG...1294# -----------------------------1295# Echo program name prefixed warning message to standard error.1296func_warn_and_continue ()1297{1298$debug_cmd12991300$require_term_colors13011302func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&21303}130413051306# func_warning CATEGORY ARG...1307# ----------------------------1308# Echo program name prefixed warning message to standard error. Warning1309# messages can be filtered according to CATEGORY, where this function1310# elides messages where CATEGORY is not listed in the global variable1311# 'opt_warning_types'.1312func_warning ()1313{1314$debug_cmd13151316# CATEGORY must be in the warning_categories list!1317case " $warning_categories " in1318*" $1 "*) ;;1319*) func_internal_error "invalid warning category '$1'" ;;1320esac13211322_G_category=$11323shift13241325case " $opt_warning_types " in1326*" $_G_category "*) $warning_func ${1+"$@"} ;;1327esac1328}132913301331# func_sort_ver VER1 VER21332# -----------------------1333# 'sort -V' is not generally available.1334# Note this deviates from the version comparison in automake1335# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a1336# but this should suffice as we won't be specifying old1337# version formats or redundant trailing .0 in bootstrap.conf.1338# If we did want full compatibility then we should probably1339# use m4_version_compare from autoconf.1340func_sort_ver ()1341{1342$debug_cmd13431344printf '%s\n%s\n' "$1" "$2" \1345| 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,9n1346}13471348# func_lt_ver PREV CURR1349# ---------------------1350# Return true if PREV and CURR are in the correct order according to1351# func_sort_ver, otherwise false. Use it like this:1352#1353# func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."1354func_lt_ver ()1355{1356$debug_cmd13571358test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`1359}136013611362# Local variables:1363# mode: shell-script1364# sh-indentation: 21365# eval: (add-hook 'before-save-hook 'time-stamp)1366# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"1367# time-stamp-time-zone: "UTC"1368# End:1369#! /bin/sh13701371# Set a version string for this script.1372scriptversion=2014-01-07.03; # UTC13731374# A portable, pluggable option parser for Bourne shell.1375# Written by Gary V. Vaughan, 201013761377# Copyright (C) 2010-2015 Free Software Foundation, Inc.1378# This is free software; see the source for copying conditions. There is NO1379# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.13801381# This program is free software: you can redistribute it and/or modify1382# it under the terms of the GNU General Public License as published by1383# the Free Software Foundation, either version 3 of the License, or1384# (at your option) any later version.13851386# This program is distributed in the hope that it will be useful,1387# but WITHOUT ANY WARRANTY; without even the implied warranty of1388# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1389# GNU General Public License for more details.13901391# You should have received a copy of the GNU General Public License1392# along with this program. If not, see <http://www.gnu.org/licenses/>.13931394# Please report bugs or propose patches to [email protected].139513961397## ------ ##1398## Usage. ##1399## ------ ##14001401# This file is a library for parsing options in your shell scripts along1402# with assorted other useful supporting features that you can make use1403# of too.1404#1405# For the simplest scripts you might need only:1406#1407# #!/bin/sh1408# . relative/path/to/funclib.sh1409# . relative/path/to/options-parser1410# scriptversion=1.01411# func_options ${1+"$@"}1412# eval set dummy "$func_options_result"; shift1413# ...rest of your script...1414#1415# In order for the '--version' option to work, you will need to have a1416# suitably formatted comment like the one at the top of this file1417# starting with '# Written by ' and ending with '# warranty; '.1418#1419# For '-h' and '--help' to work, you will also need a one line1420# description of your script's purpose in a comment directly above the1421# '# Written by ' line, like the one at the top of this file.1422#1423# The default options also support '--debug', which will turn on shell1424# execution tracing (see the comment above debug_cmd below for another1425# use), and '--verbose' and the func_verbose function to allow your script1426# to display verbose messages only when your user has specified1427# '--verbose'.1428#1429# After sourcing this file, you can plug processing for additional1430# options by amending the variables from the 'Configuration' section1431# below, and following the instructions in the 'Option parsing'1432# section further down.14331434## -------------- ##1435## Configuration. ##1436## -------------- ##14371438# You should override these variables in your script after sourcing this1439# file so that they reflect the customisations you have added to the1440# option parser.14411442# The usage line for option parsing errors and the start of '-h' and1443# '--help' output messages. You can embed shell variables for delayed1444# expansion at the time the message is displayed, but you will need to1445# quote other shell meta-characters carefully to prevent them being1446# expanded when the contents are evaled.1447usage='$progpath [OPTION]...'14481449# Short help message in response to '-h' and '--help'. Add to this or1450# override it after sourcing this library to reflect the full set of1451# options your script accepts.1452usage_message="\1453--debug enable verbose shell tracing1454-W, --warnings=CATEGORY1455report the warnings falling in CATEGORY [all]1456-v, --verbose verbosely report processing1457--version print version information and exit1458-h, --help print short or long help message and exit1459"14601461# Additional text appended to 'usage_message' in response to '--help'.1462long_help_message="1463Warning categories include:1464'all' show all warnings1465'none' turn off all the warnings1466'error' warnings are treated as fatal errors"14671468# Help message printed before fatal option parsing errors.1469fatal_help="Try '\$progname --help' for more information."1470147114721473## ------------------------- ##1474## Hook function management. ##1475## ------------------------- ##14761477# This section contains functions for adding, removing, and running hooks1478# to the main code. A hook is just a named list of of function, that can1479# be run in order later on.14801481# func_hookable FUNC_NAME1482# -----------------------1483# Declare that FUNC_NAME will run hooks added with1484# 'func_add_hook FUNC_NAME ...'.1485func_hookable ()1486{1487$debug_cmd14881489func_append hookable_fns " $1"1490}149114921493# func_add_hook FUNC_NAME HOOK_FUNC1494# ---------------------------------1495# Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must1496# first have been declared "hookable" by a call to 'func_hookable'.1497func_add_hook ()1498{1499$debug_cmd15001501case " $hookable_fns " in1502*" $1 "*) ;;1503*) func_fatal_error "'$1' does not accept hook functions." ;;1504esac15051506eval func_append ${1}_hooks '" $2"'1507}150815091510# func_remove_hook FUNC_NAME HOOK_FUNC1511# ------------------------------------1512# Remove HOOK_FUNC from the list of functions called by FUNC_NAME.1513func_remove_hook ()1514{1515$debug_cmd15161517eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'1518}151915201521# func_run_hooks FUNC_NAME [ARG]...1522# ---------------------------------1523# Run all hook functions registered to FUNC_NAME.1524# It is assumed that the list of hook functions contains nothing more1525# than a whitespace-delimited list of legal shell function names, and1526# no effort is wasted trying to catch shell meta-characters or preserve1527# whitespace.1528func_run_hooks ()1529{1530$debug_cmd15311532case " $hookable_fns " in1533*" $1 "*) ;;1534*) func_fatal_error "'$1' does not support hook funcions.n" ;;1535esac15361537eval _G_hook_fns=\$$1_hooks; shift15381539for _G_hook in $_G_hook_fns; do1540eval $_G_hook '"$@"'15411542# store returned options list back into positional1543# parameters for next 'cmd' execution.1544eval _G_hook_result=\$${_G_hook}_result1545eval set dummy "$_G_hook_result"; shift1546done15471548func_quote_for_eval ${1+"$@"}1549func_run_hooks_result=$func_quote_for_eval_result1550}1551155215531554## --------------- ##1555## Option parsing. ##1556## --------------- ##15571558# In order to add your own option parsing hooks, you must accept the1559# full positional parameter list in your hook function, remove any1560# options that you action, and then pass back the remaining unprocessed1561# options in '<hooked_function_name>_result', escaped suitably for1562# 'eval'. Like this:1563#1564# my_options_prep ()1565# {1566# $debug_cmd1567#1568# # Extend the existing usage message.1569# usage_message=$usage_message'1570# -s, --silent don'\''t print informational messages1571# '1572#1573# func_quote_for_eval ${1+"$@"}1574# my_options_prep_result=$func_quote_for_eval_result1575# }1576# func_add_hook func_options_prep my_options_prep1577#1578#1579# my_silent_option ()1580# {1581# $debug_cmd1582#1583# # Note that for efficiency, we parse as many options as we can1584# # recognise in a loop before passing the remainder back to the1585# # caller on the first unrecognised argument we encounter.1586# while test $# -gt 0; do1587# opt=$1; shift1588# case $opt in1589# --silent|-s) opt_silent=: ;;1590# # Separate non-argument short options:1591# -s*) func_split_short_opt "$_G_opt"1592# set dummy "$func_split_short_opt_name" \1593# "-$func_split_short_opt_arg" ${1+"$@"}1594# shift1595# ;;1596# *) set dummy "$_G_opt" "$*"; shift; break ;;1597# esac1598# done1599#1600# func_quote_for_eval ${1+"$@"}1601# my_silent_option_result=$func_quote_for_eval_result1602# }1603# func_add_hook func_parse_options my_silent_option1604#1605#1606# my_option_validation ()1607# {1608# $debug_cmd1609#1610# $opt_silent && $opt_verbose && func_fatal_help "\1611# '--silent' and '--verbose' options are mutually exclusive."1612#1613# func_quote_for_eval ${1+"$@"}1614# my_option_validation_result=$func_quote_for_eval_result1615# }1616# func_add_hook func_validate_options my_option_validation1617#1618# You'll alse need to manually amend $usage_message to reflect the extra1619# options you parse. It's preferable to append if you can, so that1620# multiple option parsing hooks can be added safely.162116221623# func_options [ARG]...1624# ---------------------1625# All the functions called inside func_options are hookable. See the1626# individual implementations for details.1627func_hookable func_options1628func_options ()1629{1630$debug_cmd16311632func_options_prep ${1+"$@"}1633eval func_parse_options \1634${func_options_prep_result+"$func_options_prep_result"}1635eval func_validate_options \1636${func_parse_options_result+"$func_parse_options_result"}16371638eval func_run_hooks func_options \1639${func_validate_options_result+"$func_validate_options_result"}16401641# save modified positional parameters for caller1642func_options_result=$func_run_hooks_result1643}164416451646# func_options_prep [ARG]...1647# --------------------------1648# All initialisations required before starting the option parse loop.1649# Note that when calling hook functions, we pass through the list of1650# positional parameters. If a hook function modifies that list, and1651# needs to propogate that back to rest of this script, then the complete1652# modified list must be put in 'func_run_hooks_result' before1653# returning.1654func_hookable func_options_prep1655func_options_prep ()1656{1657$debug_cmd16581659# Option defaults:1660opt_verbose=false1661opt_warning_types=16621663func_run_hooks func_options_prep ${1+"$@"}16641665# save modified positional parameters for caller1666func_options_prep_result=$func_run_hooks_result1667}166816691670# func_parse_options [ARG]...1671# ---------------------------1672# The main option parsing loop.1673func_hookable func_parse_options1674func_parse_options ()1675{1676$debug_cmd16771678func_parse_options_result=16791680# this just eases exit handling1681while test $# -gt 0; do1682# Defer to hook functions for initial option parsing, so they1683# get priority in the event of reusing an option name.1684func_run_hooks func_parse_options ${1+"$@"}16851686# Adjust func_parse_options positional parameters to match1687eval set dummy "$func_run_hooks_result"; shift16881689# Break out of the loop if we already parsed every option.1690test $# -gt 0 || break16911692_G_opt=$11693shift1694case $_G_opt in1695--debug|-x) debug_cmd='set -x'1696func_echo "enabling shell trace mode"1697$debug_cmd1698;;16991700--no-warnings|--no-warning|--no-warn)1701set dummy --warnings none ${1+"$@"}1702shift1703;;17041705--warnings|--warning|-W)1706test $# = 0 && func_missing_arg $_G_opt && break1707case " $warning_categories $1" in1708*" $1 "*)1709# trailing space prevents matching last $1 above1710func_append_uniq opt_warning_types " $1"1711;;1712*all)1713opt_warning_types=$warning_categories1714;;1715*none)1716opt_warning_types=none1717warning_func=:1718;;1719*error)1720opt_warning_types=$warning_categories1721warning_func=func_fatal_error1722;;1723*)1724func_fatal_error \1725"unsupported warning category: '$1'"1726;;1727esac1728shift1729;;17301731--verbose|-v) opt_verbose=: ;;1732--version) func_version ;;1733-\?|-h) func_usage ;;1734--help) func_help ;;17351736# Separate optargs to long options (plugins may need this):1737--*=*) func_split_equals "$_G_opt"1738set dummy "$func_split_equals_lhs" \1739"$func_split_equals_rhs" ${1+"$@"}1740shift1741;;17421743# Separate optargs to short options:1744-W*)1745func_split_short_opt "$_G_opt"1746set dummy "$func_split_short_opt_name" \1747"$func_split_short_opt_arg" ${1+"$@"}1748shift1749;;17501751# Separate non-argument short options:1752-\?*|-h*|-v*|-x*)1753func_split_short_opt "$_G_opt"1754set dummy "$func_split_short_opt_name" \1755"-$func_split_short_opt_arg" ${1+"$@"}1756shift1757;;17581759--) break ;;1760-*) func_fatal_help "unrecognised option: '$_G_opt'" ;;1761*) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;1762esac1763done17641765# save modified positional parameters for caller1766func_quote_for_eval ${1+"$@"}1767func_parse_options_result=$func_quote_for_eval_result1768}176917701771# func_validate_options [ARG]...1772# ------------------------------1773# Perform any sanity checks on option settings and/or unconsumed1774# arguments.1775func_hookable func_validate_options1776func_validate_options ()1777{1778$debug_cmd17791780# Display all warnings if -W was not given.1781test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"17821783func_run_hooks func_validate_options ${1+"$@"}17841785# Bail if the options were screwed!1786$exit_cmd $EXIT_FAILURE17871788# save modified positional parameters for caller1789func_validate_options_result=$func_run_hooks_result1790}1791179217931794## ----------------- ##1795## Helper functions. ##1796## ----------------- ##17971798# This section contains the helper functions used by the rest of the1799# hookable option parser framework in ascii-betical order.180018011802# func_fatal_help ARG...1803# ----------------------1804# Echo program name prefixed message to standard error, followed by1805# a help hint, and exit.1806func_fatal_help ()1807{1808$debug_cmd18091810eval \$ECHO \""Usage: $usage"\"1811eval \$ECHO \""$fatal_help"\"1812func_error ${1+"$@"}1813exit $EXIT_FAILURE1814}181518161817# func_help1818# ---------1819# Echo long help message to standard output and exit.1820func_help ()1821{1822$debug_cmd18231824func_usage_message1825$ECHO "$long_help_message"1826exit 01827}182818291830# func_missing_arg ARGNAME1831# ------------------------1832# Echo program name prefixed message to standard error and set global1833# exit_cmd.1834func_missing_arg ()1835{1836$debug_cmd18371838func_error "Missing argument for '$1'."1839exit_cmd=exit1840}184118421843# func_split_equals STRING1844# ------------------------1845# Set func_split_equals_lhs and func_split_equals_rhs shell variables after1846# splitting STRING at the '=' sign.1847test -z "$_G_HAVE_XSI_OPS" \1848&& (eval 'x=a/b/c;1849test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \1850&& _G_HAVE_XSI_OPS=yes18511852if test yes = "$_G_HAVE_XSI_OPS"1853then1854# This is an XSI compatible shell, allowing a faster implementation...1855eval 'func_split_equals ()1856{1857$debug_cmd18581859func_split_equals_lhs=${1%%=*}1860func_split_equals_rhs=${1#*=}1861test "x$func_split_equals_lhs" = "x$1" \1862&& func_split_equals_rhs=1863}'1864else1865# ...otherwise fall back to using expr, which is often a shell builtin.1866func_split_equals ()1867{1868$debug_cmd18691870func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`1871func_split_equals_rhs=1872test "x$func_split_equals_lhs" = "x$1" \1873|| func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`1874}1875fi #func_split_equals187618771878# func_split_short_opt SHORTOPT1879# -----------------------------1880# Set func_split_short_opt_name and func_split_short_opt_arg shell1881# variables after splitting SHORTOPT after the 2nd character.1882if test yes = "$_G_HAVE_XSI_OPS"1883then1884# This is an XSI compatible shell, allowing a faster implementation...1885eval 'func_split_short_opt ()1886{1887$debug_cmd18881889func_split_short_opt_arg=${1#??}1890func_split_short_opt_name=${1%"$func_split_short_opt_arg"}1891}'1892else1893# ...otherwise fall back to using expr, which is often a shell builtin.1894func_split_short_opt ()1895{1896$debug_cmd18971898func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`1899func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`1900}1901fi #func_split_short_opt190219031904# func_usage1905# ----------1906# Echo short help message to standard output and exit.1907func_usage ()1908{1909$debug_cmd19101911func_usage_message1912$ECHO "Run '$progname --help |${PAGER-more}' for full usage"1913exit 01914}191519161917# func_usage_message1918# ------------------1919# Echo short help message to standard output.1920func_usage_message ()1921{1922$debug_cmd19231924eval \$ECHO \""Usage: $usage"\"1925echo1926$SED -n 's|^# ||1927/^Written by/{1928x;p;x1929}1930h1931/^Written by/q' < "$progpath"1932echo1933eval \$ECHO \""$usage_message"\"1934}193519361937# func_version1938# ------------1939# Echo version message to standard output and exit.1940func_version ()1941{1942$debug_cmd19431944printf '%s\n' "$progname $scriptversion"1945$SED -n '1946/(C)/!b go1947:more1948/\./!{1949N1950s|\n# | |1951b more1952}1953:go1954/^# Written by /,/# warranty; / {1955s|^# ||1956s|^# *$||1957s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|1958p1959}1960/^# Written by / {1961s|^# ||1962p1963}1964/^warranty; /q' < "$progpath"19651966exit $?1967}196819691970# Local variables:1971# mode: shell-script1972# sh-indentation: 21973# eval: (add-hook 'before-save-hook 'time-stamp)1974# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"1975# time-stamp-time-zone: "UTC"1976# End:19771978# Set a version string.1979scriptversion='(GNU libtool) 2.4.6'198019811982# func_echo ARG...1983# ----------------1984# Libtool also displays the current mode in messages, so override1985# funclib.sh func_echo with this custom definition.1986func_echo ()1987{1988$debug_cmd19891990_G_message=$*19911992func_echo_IFS=$IFS1993IFS=$nl1994for _G_line in $_G_message; do1995IFS=$func_echo_IFS1996$ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"1997done1998IFS=$func_echo_IFS1999}200020012002# func_warning ARG...2003# -------------------2004# Libtool warnings are not categorized, so override funclib.sh2005# func_warning with this simpler definition.2006func_warning ()2007{2008$debug_cmd20092010$warning_func ${1+"$@"}2011}201220132014## ---------------- ##2015## Options parsing. ##2016## ---------------- ##20172018# Hook in the functions to make sure our own options are parsed during2019# the option parsing loop.20202021usage='$progpath [OPTION]... [MODE-ARG]...'20222023# Short help message in response to '-h'.2024usage_message="Options:2025--config show all configuration variables2026--debug enable verbose shell tracing2027-n, --dry-run display commands without modifying any files2028--features display basic configuration information and exit2029--mode=MODE use operation mode MODE2030--no-warnings equivalent to '-Wnone'2031--preserve-dup-deps don't remove duplicate dependency libraries2032--quiet, --silent don't print informational messages2033--tag=TAG use configuration variables from tag TAG2034-v, --verbose print more informational messages than default2035--version print version information2036-W, --warnings=CATEGORY report the warnings falling in CATEGORY [all]2037-h, --help, --help-all print short, long, or detailed help message2038"20392040# Additional text appended to 'usage_message' in response to '--help'.2041func_help ()2042{2043$debug_cmd20442045func_usage_message2046$ECHO "$long_help_message20472048MODE must be one of the following:20492050clean remove files from the build directory2051compile compile a source file into a libtool object2052execute automatically set library path, then run a program2053finish complete the installation of libtool libraries2054install install libraries or executables2055link create a library or an executable2056uninstall remove libraries from an installed directory20572058MODE-ARGS vary depending on the MODE. When passed as first option,2059'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.2060Try '$progname --help --mode=MODE' for a more detailed description of MODE.20612062When reporting a bug, please describe a test case to reproduce it and2063include the following information:20642065host-triplet: $host2066shell: $SHELL2067compiler: $LTCC2068compiler flags: $LTCFLAGS2069linker: $LD (gnu? $with_gnu_ld)2070version: $progname (GNU libtool) 2.4.62071automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`2072autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`20732074Report bugs to <[email protected]>.2075GNU libtool home page: <http://www.gnu.org/s/libtool/>.2076General help using GNU software: <http://www.gnu.org/gethelp/>."2077exit 02078}207920802081# func_lo2o OBJECT-NAME2082# ---------------------2083# Transform OBJECT-NAME from a '.lo' suffix to the platform specific2084# object suffix.20852086lo2o=s/\\.lo\$/.$objext/2087o2lo=s/\\.$objext\$/.lo/20882089if test yes = "$_G_HAVE_XSI_OPS"; then2090eval 'func_lo2o ()2091{2092case $1 in2093*.lo) func_lo2o_result=${1%.lo}.$objext ;;2094* ) func_lo2o_result=$1 ;;2095esac2096}'20972098# func_xform LIBOBJ-OR-SOURCE2099# ---------------------------2100# Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)2101# suffix to a '.lo' libtool-object suffix.2102eval 'func_xform ()2103{2104func_xform_result=${1%.*}.lo2105}'2106else2107# ...otherwise fall back to using sed.2108func_lo2o ()2109{2110func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`2111}21122113func_xform ()2114{2115func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`2116}2117fi211821192120# func_fatal_configuration ARG...2121# -------------------------------2122# Echo program name prefixed message to standard error, followed by2123# a configuration failure hint, and exit.2124func_fatal_configuration ()2125{2126func__fatal_error ${1+"$@"} \2127"See the $PACKAGE documentation for more information." \2128"Fatal configuration error."2129}213021312132# func_config2133# -----------2134# Display the configuration for all the tags in this script.2135func_config ()2136{2137re_begincf='^# ### BEGIN LIBTOOL'2138re_endcf='^# ### END LIBTOOL'21392140# Default configuration.2141$SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"21422143# Now print the configurations for the tags.2144for tagname in $taglist; do2145$SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"2146done21472148exit $?2149}215021512152# func_features2153# -------------2154# Display the features supported by this script.2155func_features ()2156{2157echo "host: $host"2158if test yes = "$build_libtool_libs"; then2159echo "enable shared libraries"2160else2161echo "disable shared libraries"2162fi2163if test yes = "$build_old_libs"; then2164echo "enable static libraries"2165else2166echo "disable static libraries"2167fi21682169exit $?2170}217121722173# func_enable_tag TAGNAME2174# -----------------------2175# Verify that TAGNAME is valid, and either flag an error and exit, or2176# enable the TAGNAME tag. We also add TAGNAME to the global $taglist2177# variable here.2178func_enable_tag ()2179{2180# Global variable:2181tagname=$121822183re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"2184re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"2185sed_extractcf=/$re_begincf/,/$re_endcf/p21862187# Validate tagname.2188case $tagname in2189*[!-_A-Za-z0-9,/]*)2190func_fatal_error "invalid tag name: $tagname"2191;;2192esac21932194# Don't test for the "default" C tag, as we know it's2195# there but not specially marked.2196case $tagname in2197CC) ;;2198*)2199if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then2200taglist="$taglist $tagname"22012202# Evaluate the configuration. Be careful to quote the path2203# and the sed script, to avoid splitting on whitespace, but2204# also don't use non-portable quotes within backquotes within2205# quotes we have to do it in 2 steps:2206extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`2207eval "$extractedcf"2208else2209func_error "ignoring unknown tag $tagname"2210fi2211;;2212esac2213}221422152216# func_check_version_match2217# ------------------------2218# Ensure that we are using m4 macros, and libtool script from the same2219# release of libtool.2220func_check_version_match ()2221{2222if test "$package_revision" != "$macro_revision"; then2223if test "$VERSION" != "$macro_version"; then2224if test -z "$macro_version"; then2225cat >&2 <<_LT_EOF2226$progname: Version mismatch error. This is $PACKAGE $VERSION, but the2227$progname: definition of this LT_INIT comes from an older release.2228$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION2229$progname: and run autoconf again.2230_LT_EOF2231else2232cat >&2 <<_LT_EOF2233$progname: Version mismatch error. This is $PACKAGE $VERSION, but the2234$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.2235$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION2236$progname: and run autoconf again.2237_LT_EOF2238fi2239else2240cat >&2 <<_LT_EOF2241$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,2242$progname: but the definition of this LT_INIT comes from revision $macro_revision.2243$progname: You should recreate aclocal.m4 with macros from revision $package_revision2244$progname: of $PACKAGE $VERSION and run autoconf again.2245_LT_EOF2246fi22472248exit $EXIT_MISMATCH2249fi2250}225122522253# libtool_options_prep [ARG]...2254# -----------------------------2255# Preparation for options parsed by libtool.2256libtool_options_prep ()2257{2258$debug_mode22592260# Option defaults:2261opt_config=false2262opt_dlopen=2263opt_dry_run=false2264opt_help=false2265opt_mode=2266opt_preserve_dup_deps=false2267opt_quiet=false22682269nonopt=2270preserve_args=22712272# Shorthand for --mode=foo, only valid as the first argument2273case $1 in2274clean|clea|cle|cl)2275shift; set dummy --mode clean ${1+"$@"}; shift2276;;2277compile|compil|compi|comp|com|co|c)2278shift; set dummy --mode compile ${1+"$@"}; shift2279;;2280execute|execut|execu|exec|exe|ex|e)2281shift; set dummy --mode execute ${1+"$@"}; shift2282;;2283finish|finis|fini|fin|fi|f)2284shift; set dummy --mode finish ${1+"$@"}; shift2285;;2286install|instal|insta|inst|ins|in|i)2287shift; set dummy --mode install ${1+"$@"}; shift2288;;2289link|lin|li|l)2290shift; set dummy --mode link ${1+"$@"}; shift2291;;2292uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)2293shift; set dummy --mode uninstall ${1+"$@"}; shift2294;;2295esac22962297# Pass back the list of options.2298func_quote_for_eval ${1+"$@"}2299libtool_options_prep_result=$func_quote_for_eval_result2300}2301func_add_hook func_options_prep libtool_options_prep230223032304# libtool_parse_options [ARG]...2305# ---------------------------------2306# Provide handling for libtool specific options.2307libtool_parse_options ()2308{2309$debug_cmd23102311# Perform our own loop to consume as many options as possible in2312# each iteration.2313while test $# -gt 0; do2314_G_opt=$12315shift2316case $_G_opt in2317--dry-run|--dryrun|-n)2318opt_dry_run=:2319;;23202321--config) func_config ;;23222323--dlopen|-dlopen)2324opt_dlopen="${opt_dlopen+$opt_dlopen2325}$1"2326shift2327;;23282329--preserve-dup-deps)2330opt_preserve_dup_deps=: ;;23312332--features) func_features ;;23332334--finish) set dummy --mode finish ${1+"$@"}; shift ;;23352336--help) opt_help=: ;;23372338--help-all) opt_help=': help-all' ;;23392340--mode) test $# = 0 && func_missing_arg $_G_opt && break2341opt_mode=$12342case $1 in2343# Valid mode arguments:2344clean|compile|execute|finish|install|link|relink|uninstall) ;;23452346# Catch anything else as an error2347*) func_error "invalid argument for $_G_opt"2348exit_cmd=exit2349break2350;;2351esac2352shift2353;;23542355--no-silent|--no-quiet)2356opt_quiet=false2357func_append preserve_args " $_G_opt"2358;;23592360--no-warnings|--no-warning|--no-warn)2361opt_warning=false2362func_append preserve_args " $_G_opt"2363;;23642365--no-verbose)2366opt_verbose=false2367func_append preserve_args " $_G_opt"2368;;23692370--silent|--quiet)2371opt_quiet=:2372opt_verbose=false2373func_append preserve_args " $_G_opt"2374;;23752376--tag) test $# = 0 && func_missing_arg $_G_opt && break2377opt_tag=$12378func_append preserve_args " $_G_opt $1"2379func_enable_tag "$1"2380shift2381;;23822383--verbose|-v) opt_quiet=false2384opt_verbose=:2385func_append preserve_args " $_G_opt"2386;;23872388# An option not handled by this hook function:2389*) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;2390esac2391done239223932394# save modified positional parameters for caller2395func_quote_for_eval ${1+"$@"}2396libtool_parse_options_result=$func_quote_for_eval_result2397}2398func_add_hook func_parse_options libtool_parse_options2399240024012402# libtool_validate_options [ARG]...2403# ---------------------------------2404# Perform any sanity checks on option settings and/or unconsumed2405# arguments.2406libtool_validate_options ()2407{2408# save first non-option argument2409if test 0 -lt $#; then2410nonopt=$12411shift2412fi24132414# preserve --debug2415test : = "$debug_cmd" || func_append preserve_args " --debug"24162417case $host in2418# Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=164522419# see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=597882420*cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)2421# don't eliminate duplications in $postdeps and $predeps2422opt_duplicate_compiler_generated_deps=:2423;;2424*)2425opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps2426;;2427esac24282429$opt_help || {2430# Sanity checks first:2431func_check_version_match24322433test yes != "$build_libtool_libs" \2434&& test yes != "$build_old_libs" \2435&& func_fatal_configuration "not configured to build any kind of library"24362437# Darwin sucks2438eval std_shrext=\"$shrext_cmds\"24392440# Only execute mode is allowed to have -dlopen flags.2441if test -n "$opt_dlopen" && test execute != "$opt_mode"; then2442func_error "unrecognized option '-dlopen'"2443$ECHO "$help" 1>&22444exit $EXIT_FAILURE2445fi24462447# Change the help message to a mode-specific one.2448generic_help=$help2449help="Try '$progname --help --mode=$opt_mode' for more information."2450}24512452# Pass back the unparsed argument list2453func_quote_for_eval ${1+"$@"}2454libtool_validate_options_result=$func_quote_for_eval_result2455}2456func_add_hook func_validate_options libtool_validate_options245724582459# Process options as early as possible so that --help and --version2460# can return quickly.2461func_options ${1+"$@"}2462eval set dummy "$func_options_result"; shift2463246424652466## ----------- ##2467## Main. ##2468## ----------- ##24692470magic='%%%MAGIC variable%%%'2471magic_exe='%%%MAGIC EXE variable%%%'24722473# Global variables.2474extracted_archives=2475extracted_serial=024762477# If this variable is set in any of the actions, the command in it2478# will be execed at the end. This prevents here-documents from being2479# left over by shells.2480exec_cmd=248124822483# A function that is used when there is no print builtin or printf.2484func_fallback_echo ()2485{2486eval 'cat <<_LTECHO_EOF2487$12488_LTECHO_EOF'2489}24902491# func_generated_by_libtool2492# True iff stdin has been generated by Libtool. This function is only2493# a basic sanity check; it will hardly flush out determined imposters.2494func_generated_by_libtool_p ()2495{2496$GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&12497}24982499# func_lalib_p file2500# True iff FILE is a libtool '.la' library or '.lo' object file.2501# This function is only a basic sanity check; it will hardly flush out2502# determined imposters.2503func_lalib_p ()2504{2505test -f "$1" &&2506$SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p2507}25082509# func_lalib_unsafe_p file2510# True iff FILE is a libtool '.la' library or '.lo' object file.2511# This function implements the same check as func_lalib_p without2512# resorting to external programs. To this end, it redirects stdin and2513# closes it afterwards, without saving the original file descriptor.2514# As a safety measure, use it only where a negative result would be2515# fatal anyway. Works if 'file' does not exist.2516func_lalib_unsafe_p ()2517{2518lalib_p=no2519if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then2520for lalib_p_l in 1 2 3 42521do2522read lalib_p_line2523case $lalib_p_line in2524\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;2525esac2526done2527exec 0<&5 5<&-2528fi2529test yes = "$lalib_p"2530}25312532# func_ltwrapper_script_p file2533# True iff FILE is a libtool wrapper script2534# This function is only a basic sanity check; it will hardly flush out2535# determined imposters.2536func_ltwrapper_script_p ()2537{2538test -f "$1" &&2539$lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p2540}25412542# func_ltwrapper_executable_p file2543# True iff FILE is a libtool wrapper executable2544# This function is only a basic sanity check; it will hardly flush out2545# determined imposters.2546func_ltwrapper_executable_p ()2547{2548func_ltwrapper_exec_suffix=2549case $1 in2550*.exe) ;;2551*) func_ltwrapper_exec_suffix=.exe ;;2552esac2553$GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&12554}25552556# func_ltwrapper_scriptname file2557# Assumes file is an ltwrapper_executable2558# uses $file to determine the appropriate filename for a2559# temporary ltwrapper_script.2560func_ltwrapper_scriptname ()2561{2562func_dirname_and_basename "$1" "" "."2563func_stripname '' '.exe' "$func_basename_result"2564func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper2565}25662567# func_ltwrapper_p file2568# True iff FILE is a libtool wrapper script or wrapper executable2569# This function is only a basic sanity check; it will hardly flush out2570# determined imposters.2571func_ltwrapper_p ()2572{2573func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"2574}257525762577# func_execute_cmds commands fail_cmd2578# Execute tilde-delimited COMMANDS.2579# If FAIL_CMD is given, eval that upon failure.2580# FAIL_CMD may read-access the current command in variable CMD!2581func_execute_cmds ()2582{2583$debug_cmd25842585save_ifs=$IFS; IFS='~'2586for cmd in $1; do2587IFS=$sp$nl2588eval cmd=\"$cmd\"2589IFS=$save_ifs2590func_show_eval "$cmd" "${2-:}"2591done2592IFS=$save_ifs2593}259425952596# func_source file2597# Source FILE, adding directory component if necessary.2598# Note that it is not necessary on cygwin/mingw to append a dot to2599# FILE even if both FILE and FILE.exe exist: automatic-append-.exe2600# behavior happens only for exec(3), not for open(2)! Also, sourcing2601# 'FILE.' does not work on cygwin managed mounts.2602func_source ()2603{2604$debug_cmd26052606case $1 in2607*/* | *\\*) . "$1" ;;2608*) . "./$1" ;;2609esac2610}261126122613# func_resolve_sysroot PATH2614# Replace a leading = in PATH with a sysroot. Store the result into2615# func_resolve_sysroot_result2616func_resolve_sysroot ()2617{2618func_resolve_sysroot_result=$12619case $func_resolve_sysroot_result in2620=*)2621func_stripname '=' '' "$func_resolve_sysroot_result"2622func_resolve_sysroot_result=$lt_sysroot$func_stripname_result2623;;2624esac2625}26262627# func_replace_sysroot PATH2628# If PATH begins with the sysroot, replace it with = and2629# store the result into func_replace_sysroot_result.2630func_replace_sysroot ()2631{2632case $lt_sysroot:$1 in2633?*:"$lt_sysroot"*)2634func_stripname "$lt_sysroot" '' "$1"2635func_replace_sysroot_result='='$func_stripname_result2636;;2637*)2638# Including no sysroot.2639func_replace_sysroot_result=$12640;;2641esac2642}26432644# func_infer_tag arg2645# Infer tagged configuration to use if any are available and2646# if one wasn't chosen via the "--tag" command line option.2647# Only attempt this if the compiler in the base compile2648# command doesn't match the default compiler.2649# arg is usually of the form 'gcc ...'2650func_infer_tag ()2651{2652$debug_cmd26532654if test -n "$available_tags" && test -z "$tagname"; then2655CC_quoted=2656for arg in $CC; do2657func_append_quoted CC_quoted "$arg"2658done2659CC_expanded=`func_echo_all $CC`2660CC_quoted_expanded=`func_echo_all $CC_quoted`2661case $@ in2662# Blanks in the command may have been stripped by the calling shell,2663# but not from the CC environment variable when configure was run.2664" $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \2665" $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;2666# Blanks at the start of $base_compile will cause this to fail2667# if we don't check for them as well.2668*)2669for z in $available_tags; do2670if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then2671# Evaluate the configuration.2672eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"2673CC_quoted=2674for arg in $CC; do2675# Double-quote args containing other shell metacharacters.2676func_append_quoted CC_quoted "$arg"2677done2678CC_expanded=`func_echo_all $CC`2679CC_quoted_expanded=`func_echo_all $CC_quoted`2680case "$@ " in2681" $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \2682" $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)2683# The compiler in the base compile command matches2684# the one in the tagged configuration.2685# Assume this is the tagged configuration we want.2686tagname=$z2687break2688;;2689esac2690fi2691done2692# If $tagname still isn't set, then no tagged configuration2693# was found and let the user know that the "--tag" command2694# line option must be used.2695if test -z "$tagname"; then2696func_echo "unable to infer tagged configuration"2697func_fatal_error "specify a tag with '--tag'"2698# else2699# func_verbose "using $tagname tagged configuration"2700fi2701;;2702esac2703fi2704}2705270627072708# func_write_libtool_object output_name pic_name nonpic_name2709# Create a libtool object file (analogous to a ".la" file),2710# but don't create it if we're doing a dry run.2711func_write_libtool_object ()2712{2713write_libobj=$12714if test yes = "$build_libtool_libs"; then2715write_lobj=\'$2\'2716else2717write_lobj=none2718fi27192720if test yes = "$build_old_libs"; then2721write_oldobj=\'$3\'2722else2723write_oldobj=none2724fi27252726$opt_dry_run || {2727cat >${write_libobj}T <<EOF2728# $write_libobj - a libtool object file2729# Generated by $PROGRAM (GNU $PACKAGE) $VERSION2730#2731# Please DO NOT delete this file!2732# It is necessary for linking the library.27332734# Name of the PIC object.2735pic_object=$write_lobj27362737# Name of the non-PIC object2738non_pic_object=$write_oldobj27392740EOF2741$MV "${write_libobj}T" "$write_libobj"2742}2743}274427452746##################################################2747# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #2748##################################################27492750# func_convert_core_file_wine_to_w32 ARG2751# Helper function used by file name conversion functions when $build is *nix,2752# and $host is mingw, cygwin, or some other w32 environment. Relies on a2753# correctly configured wine environment available, with the winepath program2754# in $build's $PATH.2755#2756# ARG is the $build file name to be converted to w32 format.2757# Result is available in $func_convert_core_file_wine_to_w32_result, and will2758# be empty on error (or when ARG is empty)2759func_convert_core_file_wine_to_w32 ()2760{2761$debug_cmd27622763func_convert_core_file_wine_to_w32_result=$12764if test -n "$1"; then2765# Unfortunately, winepath does not exit with a non-zero error code, so we2766# are forced to check the contents of stdout. On the other hand, if the2767# command is not found, the shell will set an exit code of 127 and print2768# *an error message* to stdout. So we must check for both error code of2769# zero AND non-empty stdout, which explains the odd construction:2770func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`2771if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then2772func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |2773$SED -e "$sed_naive_backslashify"`2774else2775func_convert_core_file_wine_to_w32_result=2776fi2777fi2778}2779# end: func_convert_core_file_wine_to_w32278027812782# func_convert_core_path_wine_to_w32 ARG2783# Helper function used by path conversion functions when $build is *nix, and2784# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly2785# configured wine environment available, with the winepath program in $build's2786# $PATH. Assumes ARG has no leading or trailing path separator characters.2787#2788# ARG is path to be converted from $build format to win32.2789# Result is available in $func_convert_core_path_wine_to_w32_result.2790# Unconvertible file (directory) names in ARG are skipped; if no directory names2791# are convertible, then the result may be empty.2792func_convert_core_path_wine_to_w32 ()2793{2794$debug_cmd27952796# unfortunately, winepath doesn't convert paths, only file names2797func_convert_core_path_wine_to_w32_result=2798if test -n "$1"; then2799oldIFS=$IFS2800IFS=:2801for func_convert_core_path_wine_to_w32_f in $1; do2802IFS=$oldIFS2803func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"2804if test -n "$func_convert_core_file_wine_to_w32_result"; then2805if test -z "$func_convert_core_path_wine_to_w32_result"; then2806func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result2807else2808func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"2809fi2810fi2811done2812IFS=$oldIFS2813fi2814}2815# end: func_convert_core_path_wine_to_w32281628172818# func_cygpath ARGS...2819# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when2820# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)2821# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or2822# (2), returns the Cygwin file name or path in func_cygpath_result (input2823# file name or path is assumed to be in w32 format, as previously converted2824# from $build's *nix or MSYS format). In case (3), returns the w32 file name2825# or path in func_cygpath_result (input file name or path is assumed to be in2826# Cygwin format). Returns an empty string on error.2827#2828# ARGS are passed to cygpath, with the last one being the file name or path to2829# be converted.2830#2831# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH2832# environment variable; do not put it in $PATH.2833func_cygpath ()2834{2835$debug_cmd28362837if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then2838func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`2839if test "$?" -ne 0; then2840# on failure, ensure result is empty2841func_cygpath_result=2842fi2843else2844func_cygpath_result=2845func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"2846fi2847}2848#end: func_cygpath284928502851# func_convert_core_msys_to_w32 ARG2852# Convert file name or path ARG from MSYS format to w32 format. Return2853# result in func_convert_core_msys_to_w32_result.2854func_convert_core_msys_to_w32 ()2855{2856$debug_cmd28572858# awkward: cmd appends spaces to result2859func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |2860$SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`2861}2862#end: func_convert_core_msys_to_w32286328642865# func_convert_file_check ARG1 ARG22866# Verify that ARG1 (a file name in $build format) was converted to $host2867# format in ARG2. Otherwise, emit an error message, but continue (resetting2868# func_to_host_file_result to ARG1).2869func_convert_file_check ()2870{2871$debug_cmd28722873if test -z "$2" && test -n "$1"; then2874func_error "Could not determine host file name corresponding to"2875func_error " '$1'"2876func_error "Continuing, but uninstalled executables may not work."2877# Fallback:2878func_to_host_file_result=$12879fi2880}2881# end func_convert_file_check288228832884# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH2885# Verify that FROM_PATH (a path in $build format) was converted to $host2886# format in TO_PATH. Otherwise, emit an error message, but continue, resetting2887# func_to_host_file_result to a simplistic fallback value (see below).2888func_convert_path_check ()2889{2890$debug_cmd28912892if test -z "$4" && test -n "$3"; then2893func_error "Could not determine the host path corresponding to"2894func_error " '$3'"2895func_error "Continuing, but uninstalled executables may not work."2896# Fallback. This is a deliberately simplistic "conversion" and2897# should not be "improved". See libtool.info.2898if test "x$1" != "x$2"; then2899lt_replace_pathsep_chars="s|$1|$2|g"2900func_to_host_path_result=`echo "$3" |2901$SED -e "$lt_replace_pathsep_chars"`2902else2903func_to_host_path_result=$32904fi2905fi2906}2907# end func_convert_path_check290829092910# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG2911# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT2912# and appending REPL if ORIG matches BACKPAT.2913func_convert_path_front_back_pathsep ()2914{2915$debug_cmd29162917case $4 in2918$1 ) func_to_host_path_result=$3$func_to_host_path_result2919;;2920esac2921case $4 in2922$2 ) func_append func_to_host_path_result "$3"2923;;2924esac2925}2926# end func_convert_path_front_back_pathsep292729282929##################################################2930# $build to $host FILE NAME CONVERSION FUNCTIONS #2931##################################################2932# invoked via '$to_host_file_cmd ARG'2933#2934# In each case, ARG is the path to be converted from $build to $host format.2935# Result will be available in $func_to_host_file_result.293629372938# func_to_host_file ARG2939# Converts the file name ARG from $build format to $host format. Return result2940# in func_to_host_file_result.2941func_to_host_file ()2942{2943$debug_cmd29442945$to_host_file_cmd "$1"2946}2947# end func_to_host_file294829492950# func_to_tool_file ARG LAZY2951# converts the file name ARG from $build format to toolchain format. Return2952# result in func_to_tool_file_result. If the conversion in use is listed2953# in (the comma separated) LAZY, no conversion takes place.2954func_to_tool_file ()2955{2956$debug_cmd29572958case ,$2, in2959*,"$to_tool_file_cmd",*)2960func_to_tool_file_result=$12961;;2962*)2963$to_tool_file_cmd "$1"2964func_to_tool_file_result=$func_to_host_file_result2965;;2966esac2967}2968# end func_to_tool_file296929702971# func_convert_file_noop ARG2972# Copy ARG to func_to_host_file_result.2973func_convert_file_noop ()2974{2975func_to_host_file_result=$12976}2977# end func_convert_file_noop297829792980# func_convert_file_msys_to_w32 ARG2981# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic2982# conversion to w32 is not available inside the cwrapper. Returns result in2983# func_to_host_file_result.2984func_convert_file_msys_to_w32 ()2985{2986$debug_cmd29872988func_to_host_file_result=$12989if test -n "$1"; then2990func_convert_core_msys_to_w32 "$1"2991func_to_host_file_result=$func_convert_core_msys_to_w32_result2992fi2993func_convert_file_check "$1" "$func_to_host_file_result"2994}2995# end func_convert_file_msys_to_w32299629972998# func_convert_file_cygwin_to_w32 ARG2999# Convert file name ARG from Cygwin to w32 format. Returns result in3000# func_to_host_file_result.3001func_convert_file_cygwin_to_w32 ()3002{3003$debug_cmd30043005func_to_host_file_result=$13006if test -n "$1"; then3007# because $build is cygwin, we call "the" cygpath in $PATH; no need to use3008# LT_CYGPATH in this case.3009func_to_host_file_result=`cygpath -m "$1"`3010fi3011func_convert_file_check "$1" "$func_to_host_file_result"3012}3013# end func_convert_file_cygwin_to_w32301430153016# func_convert_file_nix_to_w32 ARG3017# Convert file name ARG from *nix to w32 format. Requires a wine environment3018# and a working winepath. Returns result in func_to_host_file_result.3019func_convert_file_nix_to_w32 ()3020{3021$debug_cmd30223023func_to_host_file_result=$13024if test -n "$1"; then3025func_convert_core_file_wine_to_w32 "$1"3026func_to_host_file_result=$func_convert_core_file_wine_to_w32_result3027fi3028func_convert_file_check "$1" "$func_to_host_file_result"3029}3030# end func_convert_file_nix_to_w32303130323033# func_convert_file_msys_to_cygwin ARG3034# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.3035# Returns result in func_to_host_file_result.3036func_convert_file_msys_to_cygwin ()3037{3038$debug_cmd30393040func_to_host_file_result=$13041if test -n "$1"; then3042func_convert_core_msys_to_w32 "$1"3043func_cygpath -u "$func_convert_core_msys_to_w32_result"3044func_to_host_file_result=$func_cygpath_result3045fi3046func_convert_file_check "$1" "$func_to_host_file_result"3047}3048# end func_convert_file_msys_to_cygwin304930503051# func_convert_file_nix_to_cygwin ARG3052# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed3053# in a wine environment, working winepath, and LT_CYGPATH set. Returns result3054# in func_to_host_file_result.3055func_convert_file_nix_to_cygwin ()3056{3057$debug_cmd30583059func_to_host_file_result=$13060if test -n "$1"; then3061# convert from *nix to w32, then use cygpath to convert from w32 to cygwin.3062func_convert_core_file_wine_to_w32 "$1"3063func_cygpath -u "$func_convert_core_file_wine_to_w32_result"3064func_to_host_file_result=$func_cygpath_result3065fi3066func_convert_file_check "$1" "$func_to_host_file_result"3067}3068# end func_convert_file_nix_to_cygwin306930703071#############################################3072# $build to $host PATH CONVERSION FUNCTIONS #3073#############################################3074# invoked via '$to_host_path_cmd ARG'3075#3076# In each case, ARG is the path to be converted from $build to $host format.3077# The result will be available in $func_to_host_path_result.3078#3079# Path separators are also converted from $build format to $host format. If3080# ARG begins or ends with a path separator character, it is preserved (but3081# converted to $host format) on output.3082#3083# All path conversion functions are named using the following convention:3084# file name conversion function : func_convert_file_X_to_Y ()3085# path conversion function : func_convert_path_X_to_Y ()3086# where, for any given $build/$host combination the 'X_to_Y' value is the3087# same. If conversion functions are added for new $build/$host combinations,3088# the two new functions must follow this pattern, or func_init_to_host_path_cmd3089# will break.309030913092# func_init_to_host_path_cmd3093# Ensures that function "pointer" variable $to_host_path_cmd is set to the3094# appropriate value, based on the value of $to_host_file_cmd.3095to_host_path_cmd=3096func_init_to_host_path_cmd ()3097{3098$debug_cmd30993100if test -z "$to_host_path_cmd"; then3101func_stripname 'func_convert_file_' '' "$to_host_file_cmd"3102to_host_path_cmd=func_convert_path_$func_stripname_result3103fi3104}310531063107# func_to_host_path ARG3108# Converts the path ARG from $build format to $host format. Return result3109# in func_to_host_path_result.3110func_to_host_path ()3111{3112$debug_cmd31133114func_init_to_host_path_cmd3115$to_host_path_cmd "$1"3116}3117# end func_to_host_path311831193120# func_convert_path_noop ARG3121# Copy ARG to func_to_host_path_result.3122func_convert_path_noop ()3123{3124func_to_host_path_result=$13125}3126# end func_convert_path_noop312731283129# func_convert_path_msys_to_w32 ARG3130# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic3131# conversion to w32 is not available inside the cwrapper. Returns result in3132# func_to_host_path_result.3133func_convert_path_msys_to_w32 ()3134{3135$debug_cmd31363137func_to_host_path_result=$13138if test -n "$1"; then3139# Remove leading and trailing path separator characters from ARG. MSYS3140# behavior is inconsistent here; cygpath turns them into '.;' and ';.';3141# and winepath ignores them completely.3142func_stripname : : "$1"3143func_to_host_path_tmp1=$func_stripname_result3144func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"3145func_to_host_path_result=$func_convert_core_msys_to_w32_result3146func_convert_path_check : ";" \3147"$func_to_host_path_tmp1" "$func_to_host_path_result"3148func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"3149fi3150}3151# end func_convert_path_msys_to_w32315231533154# func_convert_path_cygwin_to_w32 ARG3155# Convert path ARG from Cygwin to w32 format. Returns result in3156# func_to_host_file_result.3157func_convert_path_cygwin_to_w32 ()3158{3159$debug_cmd31603161func_to_host_path_result=$13162if test -n "$1"; then3163# See func_convert_path_msys_to_w32:3164func_stripname : : "$1"3165func_to_host_path_tmp1=$func_stripname_result3166func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`3167func_convert_path_check : ";" \3168"$func_to_host_path_tmp1" "$func_to_host_path_result"3169func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"3170fi3171}3172# end func_convert_path_cygwin_to_w32317331743175# func_convert_path_nix_to_w32 ARG3176# Convert path ARG from *nix to w32 format. Requires a wine environment and3177# a working winepath. Returns result in func_to_host_file_result.3178func_convert_path_nix_to_w32 ()3179{3180$debug_cmd31813182func_to_host_path_result=$13183if test -n "$1"; then3184# See func_convert_path_msys_to_w32:3185func_stripname : : "$1"3186func_to_host_path_tmp1=$func_stripname_result3187func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"3188func_to_host_path_result=$func_convert_core_path_wine_to_w32_result3189func_convert_path_check : ";" \3190"$func_to_host_path_tmp1" "$func_to_host_path_result"3191func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"3192fi3193}3194# end func_convert_path_nix_to_w32319531963197# func_convert_path_msys_to_cygwin ARG3198# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.3199# Returns result in func_to_host_file_result.3200func_convert_path_msys_to_cygwin ()3201{3202$debug_cmd32033204func_to_host_path_result=$13205if test -n "$1"; then3206# See func_convert_path_msys_to_w32:3207func_stripname : : "$1"3208func_to_host_path_tmp1=$func_stripname_result3209func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"3210func_cygpath -u -p "$func_convert_core_msys_to_w32_result"3211func_to_host_path_result=$func_cygpath_result3212func_convert_path_check : : \3213"$func_to_host_path_tmp1" "$func_to_host_path_result"3214func_convert_path_front_back_pathsep ":*" "*:" : "$1"3215fi3216}3217# end func_convert_path_msys_to_cygwin321832193220# func_convert_path_nix_to_cygwin ARG3221# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a3222# a wine environment, working winepath, and LT_CYGPATH set. Returns result in3223# func_to_host_file_result.3224func_convert_path_nix_to_cygwin ()3225{3226$debug_cmd32273228func_to_host_path_result=$13229if test -n "$1"; then3230# Remove leading and trailing path separator characters from3231# ARG. msys behavior is inconsistent here, cygpath turns them3232# into '.;' and ';.', and winepath ignores them completely.3233func_stripname : : "$1"3234func_to_host_path_tmp1=$func_stripname_result3235func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"3236func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"3237func_to_host_path_result=$func_cygpath_result3238func_convert_path_check : : \3239"$func_to_host_path_tmp1" "$func_to_host_path_result"3240func_convert_path_front_back_pathsep ":*" "*:" : "$1"3241fi3242}3243# end func_convert_path_nix_to_cygwin324432453246# func_dll_def_p FILE3247# True iff FILE is a Windows DLL '.def' file.3248# Keep in sync with _LT_DLL_DEF_P in libtool.m43249func_dll_def_p ()3250{3251$debug_cmd32523253func_dll_def_p_tmp=`$SED -n \3254-e 's/^[ ]*//' \3255-e '/^\(;.*\)*$/d' \3256-e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \3257-e q \3258"$1"`3259test DEF = "$func_dll_def_p_tmp"3260}326132623263# func_mode_compile arg...3264func_mode_compile ()3265{3266$debug_cmd32673268# Get the compilation command and the source file.3269base_compile=3270srcfile=$nonopt # always keep a non-empty value in "srcfile"3271suppress_opt=yes3272suppress_output=3273arg_mode=normal3274libobj=3275later=3276pie_flag=32773278for arg3279do3280case $arg_mode in3281arg )3282# do not "continue". Instead, add this to base_compile3283lastarg=$arg3284arg_mode=normal3285;;32863287target )3288libobj=$arg3289arg_mode=normal3290continue3291;;32923293normal )3294# Accept any command-line options.3295case $arg in3296-o)3297test -n "$libobj" && \3298func_fatal_error "you cannot specify '-o' more than once"3299arg_mode=target3300continue3301;;33023303-pie | -fpie | -fPIE)3304func_append pie_flag " $arg"3305continue3306;;33073308-shared | -static | -prefer-pic | -prefer-non-pic)3309func_append later " $arg"3310continue3311;;33123313-no-suppress)3314suppress_opt=no3315continue3316;;33173318-Xcompiler)3319arg_mode=arg # the next one goes into the "base_compile" arg list3320continue # The current "srcfile" will either be retained or3321;; # replaced later. I would guess that would be a bug.33223323-Wc,*)3324func_stripname '-Wc,' '' "$arg"3325args=$func_stripname_result3326lastarg=3327save_ifs=$IFS; IFS=,3328for arg in $args; do3329IFS=$save_ifs3330func_append_quoted lastarg "$arg"3331done3332IFS=$save_ifs3333func_stripname ' ' '' "$lastarg"3334lastarg=$func_stripname_result33353336# Add the arguments to base_compile.3337func_append base_compile " $lastarg"3338continue3339;;33403341*)3342# Accept the current argument as the source file.3343# The previous "srcfile" becomes the current argument.3344#3345lastarg=$srcfile3346srcfile=$arg3347;;3348esac # case $arg3349;;3350esac # case $arg_mode33513352# Aesthetically quote the previous argument.3353func_append_quoted base_compile "$lastarg"3354done # for arg33553356case $arg_mode in3357arg)3358func_fatal_error "you must specify an argument for -Xcompile"3359;;3360target)3361func_fatal_error "you must specify a target with '-o'"3362;;3363*)3364# Get the name of the library object.3365test -z "$libobj" && {3366func_basename "$srcfile"3367libobj=$func_basename_result3368}3369;;3370esac33713372# Recognize several different file suffixes.3373# If the user specifies -o file.o, it is replaced with file.lo3374case $libobj in3375*.[cCFSifmso] | \3376*.ada | *.adb | *.ads | *.asm | \3377*.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \3378*.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)3379func_xform "$libobj"3380libobj=$func_xform_result3381;;3382esac33833384case $libobj in3385*.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;3386*)3387func_fatal_error "cannot determine name of library object from '$libobj'"3388;;3389esac33903391func_infer_tag $base_compile33923393for arg in $later; do3394case $arg in3395-shared)3396test yes = "$build_libtool_libs" \3397|| func_fatal_configuration "cannot build a shared library"3398build_old_libs=no3399continue3400;;34013402-static)3403build_libtool_libs=no3404build_old_libs=yes3405continue3406;;34073408-prefer-pic)3409pic_mode=yes3410continue3411;;34123413-prefer-non-pic)3414pic_mode=no3415continue3416;;3417esac3418done34193420func_quote_for_eval "$libobj"3421test "X$libobj" != "X$func_quote_for_eval_result" \3422&& $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \3423&& func_warning "libobj name '$libobj' may not contain shell special characters."3424func_dirname_and_basename "$obj" "/" ""3425objname=$func_basename_result3426xdir=$func_dirname_result3427lobj=$xdir$objdir/$objname34283429test -z "$base_compile" && \3430func_fatal_help "you must specify a compilation command"34313432# Delete any leftover library objects.3433if test yes = "$build_old_libs"; then3434removelist="$obj $lobj $libobj ${libobj}T"3435else3436removelist="$lobj $libobj ${libobj}T"3437fi34383439# On Cygwin there's no "real" PIC flag so we must build both object types3440case $host_os in3441cygwin* | mingw* | pw32* | os2* | cegcc*)3442pic_mode=default3443;;3444esac3445if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then3446# non-PIC code in shared libraries is not supported3447pic_mode=default3448fi34493450# Calculate the filename of the output object if compiler does3451# not support -o with -c3452if test no = "$compiler_c_o"; then3453output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext3454lockfile=$output_obj.lock3455else3456output_obj=3457need_locks=no3458lockfile=3459fi34603461# Lock this critical section if it is needed3462# We use this script file to make the link, it avoids creating a new file3463if test yes = "$need_locks"; then3464until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do3465func_echo "Waiting for $lockfile to be removed"3466sleep 23467done3468elif test warn = "$need_locks"; then3469if test -f "$lockfile"; then3470$ECHO "\3471*** ERROR, $lockfile exists and contains:3472`cat $lockfile 2>/dev/null`34733474This indicates that another process is trying to use the same3475temporary object file, and libtool could not work around it because3476your compiler does not support '-c' and '-o' together. If you3477repeat this compilation, it may succeed, by chance, but you had better3478avoid parallel builds (make -j) in this platform, or get a better3479compiler."34803481$opt_dry_run || $RM $removelist3482exit $EXIT_FAILURE3483fi3484func_append removelist " $output_obj"3485$ECHO "$srcfile" > "$lockfile"3486fi34873488$opt_dry_run || $RM $removelist3489func_append removelist " $lockfile"3490trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 1534913492func_to_tool_file "$srcfile" func_convert_file_msys_to_w323493srcfile=$func_to_tool_file_result3494func_quote_for_eval "$srcfile"3495qsrcfile=$func_quote_for_eval_result34963497# Only build a PIC object if we are building libtool libraries.3498if test yes = "$build_libtool_libs"; then3499# Without this assignment, base_compile gets emptied.3500fbsd_hideous_sh_bug=$base_compile35013502if test no != "$pic_mode"; then3503command="$base_compile $qsrcfile $pic_flag"3504else3505# Don't build PIC code3506command="$base_compile $qsrcfile"3507fi35083509func_mkdir_p "$xdir$objdir"35103511if test -z "$output_obj"; then3512# Place PIC objects in $objdir3513func_append command " -o $lobj"3514fi35153516func_show_eval_locale "$command" \3517'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'35183519if test warn = "$need_locks" &&3520test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then3521$ECHO "\3522*** ERROR, $lockfile contains:3523`cat $lockfile 2>/dev/null`35243525but it should contain:3526$srcfile35273528This indicates that another process is trying to use the same3529temporary object file, and libtool could not work around it because3530your compiler does not support '-c' and '-o' together. If you3531repeat this compilation, it may succeed, by chance, but you had better3532avoid parallel builds (make -j) in this platform, or get a better3533compiler."35343535$opt_dry_run || $RM $removelist3536exit $EXIT_FAILURE3537fi35383539# Just move the object if needed, then go on to compile the next one3540if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then3541func_show_eval '$MV "$output_obj" "$lobj"' \3542'error=$?; $opt_dry_run || $RM $removelist; exit $error'3543fi35443545# Allow error messages only from the first compilation.3546if test yes = "$suppress_opt"; then3547suppress_output=' >/dev/null 2>&1'3548fi3549fi35503551# Only build a position-dependent object if we build old libraries.3552if test yes = "$build_old_libs"; then3553if test yes != "$pic_mode"; then3554# Don't build PIC code3555command="$base_compile $qsrcfile$pie_flag"3556else3557command="$base_compile $qsrcfile $pic_flag"3558fi3559if test yes = "$compiler_c_o"; then3560func_append command " -o $obj"3561fi35623563# Suppress compiler output if we already did a PIC compilation.3564func_append command "$suppress_output"3565func_show_eval_locale "$command" \3566'$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'35673568if test warn = "$need_locks" &&3569test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then3570$ECHO "\3571*** ERROR, $lockfile contains:3572`cat $lockfile 2>/dev/null`35733574but it should contain:3575$srcfile35763577This indicates that another process is trying to use the same3578temporary object file, and libtool could not work around it because3579your compiler does not support '-c' and '-o' together. If you3580repeat this compilation, it may succeed, by chance, but you had better3581avoid parallel builds (make -j) in this platform, or get a better3582compiler."35833584$opt_dry_run || $RM $removelist3585exit $EXIT_FAILURE3586fi35873588# Just move the object if needed3589if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then3590func_show_eval '$MV "$output_obj" "$obj"' \3591'error=$?; $opt_dry_run || $RM $removelist; exit $error'3592fi3593fi35943595$opt_dry_run || {3596func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"35973598# Unlock the critical section if it was locked3599if test no != "$need_locks"; then3600removelist=$lockfile3601$RM "$lockfile"3602fi3603}36043605exit $EXIT_SUCCESS3606}36073608$opt_help || {3609test compile = "$opt_mode" && func_mode_compile ${1+"$@"}3610}36113612func_mode_help ()3613{3614# We need to display help for each of the modes.3615case $opt_mode in3616"")3617# Generic help is extracted from the usage comments3618# at the start of this file.3619func_help3620;;36213622clean)3623$ECHO \3624"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...36253626Remove files from the build directory.36273628RM is the name of the program to use to delete files associated with each FILE3629(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed3630to RM.36313632If FILE is a libtool library, object or program, all the files associated3633with it are deleted. Otherwise, only FILE itself is deleted using RM."3634;;36353636compile)3637$ECHO \3638"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE36393640Compile a source file into a libtool library object.36413642This mode accepts the following additional options:36433644-o OUTPUT-FILE set the output file name to OUTPUT-FILE3645-no-suppress do not suppress compiler output for multiple passes3646-prefer-pic try to build PIC objects only3647-prefer-non-pic try to build non-PIC objects only3648-shared do not build a '.o' file suitable for static linking3649-static only build a '.o' file suitable for static linking3650-Wc,FLAG pass FLAG directly to the compiler36513652COMPILE-COMMAND is a command to be used in creating a 'standard' object file3653from the given SOURCEFILE.36543655The output file name is determined by removing the directory component from3656SOURCEFILE, then substituting the C source code suffix '.c' with the3657library object suffix, '.lo'."3658;;36593660execute)3661$ECHO \3662"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...36633664Automatically set library path, then run a program.36653666This mode accepts the following additional options:36673668-dlopen FILE add the directory containing FILE to the library path36693670This mode sets the library path environment variable according to '-dlopen'3671flags.36723673If any of the ARGS are libtool executable wrappers, then they are translated3674into their corresponding uninstalled binary, and any of their required library3675directories are added to the library path.36763677Then, COMMAND is executed, with ARGS as arguments."3678;;36793680finish)3681$ECHO \3682"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...36833684Complete the installation of libtool libraries.36853686Each LIBDIR is a directory that contains libtool libraries.36873688The commands that this mode executes may require superuser privileges. Use3689the '--dry-run' option if you just want to see what would be executed."3690;;36913692install)3693$ECHO \3694"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...36953696Install executables or libraries.36973698INSTALL-COMMAND is the installation command. The first component should be3699either the 'install' or 'cp' program.37003701The following components of INSTALL-COMMAND are treated specially:37023703-inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation37043705The rest of the components are interpreted as arguments to that command (only3706BSD-compatible install options are recognized)."3707;;37083709link)3710$ECHO \3711"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...37123713Link object files or libraries together to form another library, or to3714create an executable program.37153716LINK-COMMAND is a command using the C compiler that you would use to create3717a program from several object files.37183719The following components of LINK-COMMAND are treated specially:37203721-all-static do not do any dynamic linking at all3722-avoid-version do not add a version suffix if possible3723-bindir BINDIR specify path to binaries directory (for systems where3724libraries must be found in the PATH setting at runtime)3725-dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime3726-dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols3727-export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)3728-export-symbols SYMFILE3729try to export only the symbols listed in SYMFILE3730-export-symbols-regex REGEX3731try to export only the symbols matching REGEX3732-LLIBDIR search LIBDIR for required installed libraries3733-lNAME OUTPUT-FILE requires the installed library libNAME3734-module build a library that can dlopened3735-no-fast-install disable the fast-install mode3736-no-install link a not-installable executable3737-no-undefined declare that a library does not refer to external symbols3738-o OUTPUT-FILE create OUTPUT-FILE from the specified objects3739-objectlist FILE use a list of object files found in FILE to specify objects3740-os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes)3741-precious-files-regex REGEX3742don't remove output files matching REGEX3743-release RELEASE specify package release information3744-rpath LIBDIR the created library will eventually be installed in LIBDIR3745-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries3746-shared only do dynamic linking of libtool libraries3747-shrext SUFFIX override the standard shared library file extension3748-static do not do any dynamic linking of uninstalled libtool libraries3749-static-libtool-libs3750do not do any dynamic linking of libtool libraries3751-version-info CURRENT[:REVISION[:AGE]]3752specify library version info [each variable defaults to 0]3753-weak LIBNAME declare that the target provides the LIBNAME interface3754-Wc,FLAG3755-Xcompiler FLAG pass linker-specific FLAG directly to the compiler3756-Wl,FLAG3757-Xlinker FLAG pass linker-specific FLAG directly to the linker3758-XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)37593760All other options (arguments beginning with '-') are ignored.37613762Every other argument is treated as a filename. Files ending in '.la' are3763treated as uninstalled libtool libraries, other files are standard or library3764object files.37653766If the OUTPUT-FILE ends in '.la', then a libtool library is created,3767only library objects ('.lo' files) may be specified, and '-rpath' is3768required, except when creating a convenience library.37693770If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created3771using 'ar' and 'ranlib', or on Windows using 'lib'.37723773If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file3774is created, otherwise an executable program is created."3775;;37763777uninstall)3778$ECHO \3779"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...37803781Remove libraries from an installation directory.37823783RM is the name of the program to use to delete files associated with each FILE3784(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed3785to RM.37863787If FILE is a libtool library, all the files associated with it are deleted.3788Otherwise, only FILE itself is deleted using RM."3789;;37903791*)3792func_fatal_help "invalid operation mode '$opt_mode'"3793;;3794esac37953796echo3797$ECHO "Try '$progname --help' for more information about other modes."3798}37993800# Now that we've collected a possible --mode arg, show help if necessary3801if $opt_help; then3802if test : = "$opt_help"; then3803func_mode_help3804else3805{3806func_help noexit3807for opt_mode in compile link execute install finish uninstall clean; do3808func_mode_help3809done3810} | $SED -n '1p; 2,$s/^Usage:/ or: /p'3811{3812func_help noexit3813for opt_mode in compile link execute install finish uninstall clean; do3814echo3815func_mode_help3816done3817} |3818$SED '1d3819/^When reporting/,/^Report/{3820H3821d3822}3823$x3824/information about other modes/d3825/more detailed .*MODE/d3826s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'3827fi3828exit $?3829fi383038313832# func_mode_execute arg...3833func_mode_execute ()3834{3835$debug_cmd38363837# The first argument is the command name.3838cmd=$nonopt3839test -z "$cmd" && \3840func_fatal_help "you must specify a COMMAND"38413842# Handle -dlopen flags immediately.3843for file in $opt_dlopen; do3844test -f "$file" \3845|| func_fatal_help "'$file' is not a file"38463847dir=3848case $file in3849*.la)3850func_resolve_sysroot "$file"3851file=$func_resolve_sysroot_result38523853# Check to see that this really is a libtool archive.3854func_lalib_unsafe_p "$file" \3855|| func_fatal_help "'$lib' is not a valid libtool archive"38563857# Read the libtool library.3858dlname=3859library_names=3860func_source "$file"38613862# Skip this library if it cannot be dlopened.3863if test -z "$dlname"; then3864# Warn if it was a shared library.3865test -n "$library_names" && \3866func_warning "'$file' was not linked with '-export-dynamic'"3867continue3868fi38693870func_dirname "$file" "" "."3871dir=$func_dirname_result38723873if test -f "$dir/$objdir/$dlname"; then3874func_append dir "/$objdir"3875else3876if test ! -f "$dir/$dlname"; then3877func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"3878fi3879fi3880;;38813882*.lo)3883# Just add the directory containing the .lo file.3884func_dirname "$file" "" "."3885dir=$func_dirname_result3886;;38873888*)3889func_warning "'-dlopen' is ignored for non-libtool libraries and objects"3890continue3891;;3892esac38933894# Get the absolute pathname.3895absdir=`cd "$dir" && pwd`3896test -n "$absdir" && dir=$absdir38973898# Now add the directory to shlibpath_var.3899if eval "test -z \"\$$shlibpath_var\""; then3900eval "$shlibpath_var=\"\$dir\""3901else3902eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""3903fi3904done39053906# This variable tells wrapper scripts just to set shlibpath_var3907# rather than running their programs.3908libtool_execute_magic=$magic39093910# Check if any of the arguments is a wrapper script.3911args=3912for file3913do3914case $file in3915-* | *.la | *.lo ) ;;3916*)3917# Do a test to see if this is really a libtool program.3918if func_ltwrapper_script_p "$file"; then3919func_source "$file"3920# Transform arg to wrapped name.3921file=$progdir/$program3922elif func_ltwrapper_executable_p "$file"; then3923func_ltwrapper_scriptname "$file"3924func_source "$func_ltwrapper_scriptname_result"3925# Transform arg to wrapped name.3926file=$progdir/$program3927fi3928;;3929esac3930# Quote arguments (to preserve shell metacharacters).3931func_append_quoted args "$file"3932done39333934if $opt_dry_run; then3935# Display what would be done.3936if test -n "$shlibpath_var"; then3937eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""3938echo "export $shlibpath_var"3939fi3940$ECHO "$cmd$args"3941exit $EXIT_SUCCESS3942else3943if test -n "$shlibpath_var"; then3944# Export the shlibpath_var.3945eval "export $shlibpath_var"3946fi39473948# Restore saved environment variables3949for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES3950do3951eval "if test \"\${save_$lt_var+set}\" = set; then3952$lt_var=\$save_$lt_var; export $lt_var3953else3954$lt_unset $lt_var3955fi"3956done39573958# Now prepare to actually exec the command.3959exec_cmd=\$cmd$args3960fi3961}39623963test execute = "$opt_mode" && func_mode_execute ${1+"$@"}396439653966# func_mode_finish arg...3967func_mode_finish ()3968{3969$debug_cmd39703971libs=3972libdirs=3973admincmds=39743975for opt in "$nonopt" ${1+"$@"}3976do3977if test -d "$opt"; then3978func_append libdirs " $opt"39793980elif test -f "$opt"; then3981if func_lalib_unsafe_p "$opt"; then3982func_append libs " $opt"3983else3984func_warning "'$opt' is not a valid libtool archive"3985fi39863987else3988func_fatal_error "invalid argument '$opt'"3989fi3990done39913992if test -n "$libs"; then3993if test -n "$lt_sysroot"; then3994sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`3995sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"3996else3997sysroot_cmd=3998fi39994000# Remove sysroot references4001if $opt_dry_run; then4002for lib in $libs; do4003echo "removing references to $lt_sysroot and '=' prefixes from $lib"4004done4005else4006tmpdir=`func_mktempdir`4007for lib in $libs; do4008$SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \4009> $tmpdir/tmp-la4010mv -f $tmpdir/tmp-la $lib4011done4012${RM}r "$tmpdir"4013fi4014fi40154016if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then4017for libdir in $libdirs; do4018if test -n "$finish_cmds"; then4019# Do each command in the finish commands.4020func_execute_cmds "$finish_cmds" 'admincmds="$admincmds4021'"$cmd"'"'4022fi4023if test -n "$finish_eval"; then4024# Do the single finish_eval.4025eval cmds=\"$finish_eval\"4026$opt_dry_run || eval "$cmds" || func_append admincmds "4027$cmds"4028fi4029done4030fi40314032# Exit here if they wanted silent mode.4033$opt_quiet && exit $EXIT_SUCCESS40344035if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then4036echo "----------------------------------------------------------------------"4037echo "Libraries have been installed in:"4038for libdir in $libdirs; do4039$ECHO " $libdir"4040done4041echo4042echo "If you ever happen to want to link against installed libraries"4043echo "in a given directory, LIBDIR, you must either use libtool, and"4044echo "specify the full pathname of the library, or use the '-LLIBDIR'"4045echo "flag during linking and do at least one of the following:"4046if test -n "$shlibpath_var"; then4047echo " - add LIBDIR to the '$shlibpath_var' environment variable"4048echo " during execution"4049fi4050if test -n "$runpath_var"; then4051echo " - add LIBDIR to the '$runpath_var' environment variable"4052echo " during linking"4053fi4054if test -n "$hardcode_libdir_flag_spec"; then4055libdir=LIBDIR4056eval flag=\"$hardcode_libdir_flag_spec\"40574058$ECHO " - use the '$flag' linker flag"4059fi4060if test -n "$admincmds"; then4061$ECHO " - have your system administrator run these commands:$admincmds"4062fi4063if test -f /etc/ld.so.conf; then4064echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'"4065fi4066echo40674068echo "See any operating system documentation about shared libraries for"4069case $host in4070solaris2.[6789]|solaris2.1[0-9])4071echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"4072echo "pages."4073;;4074*)4075echo "more information, such as the ld(1) and ld.so(8) manual pages."4076;;4077esac4078echo "----------------------------------------------------------------------"4079fi4080exit $EXIT_SUCCESS4081}40824083test finish = "$opt_mode" && func_mode_finish ${1+"$@"}408440854086# func_mode_install arg...4087func_mode_install ()4088{4089$debug_cmd40904091# There may be an optional sh(1) argument at the beginning of4092# install_prog (especially on Windows NT).4093if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||4094# Allow the use of GNU shtool's install command.4095case $nonopt in *shtool*) :;; *) false;; esac4096then4097# Aesthetically quote it.4098func_quote_for_eval "$nonopt"4099install_prog="$func_quote_for_eval_result "4100arg=$14101shift4102else4103install_prog=4104arg=$nonopt4105fi41064107# The real first argument should be the name of the installation program.4108# Aesthetically quote it.4109func_quote_for_eval "$arg"4110func_append install_prog "$func_quote_for_eval_result"4111install_shared_prog=$install_prog4112case " $install_prog " in4113*[\\\ /]cp\ *) install_cp=: ;;4114*) install_cp=false ;;4115esac41164117# We need to accept at least all the BSD install flags.4118dest=4119files=4120opts=4121prev=4122install_type=4123isdir=false4124stripme=4125no_mode=:4126for arg4127do4128arg2=4129if test -n "$dest"; then4130func_append files " $dest"4131dest=$arg4132continue4133fi41344135case $arg in4136-d) isdir=: ;;4137-f)4138if $install_cp; then :; else4139prev=$arg4140fi4141;;4142-g | -m | -o)4143prev=$arg4144;;4145-s)4146stripme=" -s"4147continue4148;;4149-*)4150;;4151*)4152# If the previous option needed an argument, then skip it.4153if test -n "$prev"; then4154if test X-m = "X$prev" && test -n "$install_override_mode"; then4155arg2=$install_override_mode4156no_mode=false4157fi4158prev=4159else4160dest=$arg4161continue4162fi4163;;4164esac41654166# Aesthetically quote the argument.4167func_quote_for_eval "$arg"4168func_append install_prog " $func_quote_for_eval_result"4169if test -n "$arg2"; then4170func_quote_for_eval "$arg2"4171fi4172func_append install_shared_prog " $func_quote_for_eval_result"4173done41744175test -z "$install_prog" && \4176func_fatal_help "you must specify an install program"41774178test -n "$prev" && \4179func_fatal_help "the '$prev' option requires an argument"41804181if test -n "$install_override_mode" && $no_mode; then4182if $install_cp; then :; else4183func_quote_for_eval "$install_override_mode"4184func_append install_shared_prog " -m $func_quote_for_eval_result"4185fi4186fi41874188if test -z "$files"; then4189if test -z "$dest"; then4190func_fatal_help "no file or destination specified"4191else4192func_fatal_help "you must specify a destination"4193fi4194fi41954196# Strip any trailing slash from the destination.4197func_stripname '' '/' "$dest"4198dest=$func_stripname_result41994200# Check to see that the destination is a directory.4201test -d "$dest" && isdir=:4202if $isdir; then4203destdir=$dest4204destname=4205else4206func_dirname_and_basename "$dest" "" "."4207destdir=$func_dirname_result4208destname=$func_basename_result42094210# Not a directory, so check to see that there is only one file specified.4211set dummy $files; shift4212test "$#" -gt 1 && \4213func_fatal_help "'$dest' is not a directory"4214fi4215case $destdir in4216[\\/]* | [A-Za-z]:[\\/]*) ;;4217*)4218for file in $files; do4219case $file in4220*.lo) ;;4221*)4222func_fatal_help "'$destdir' must be an absolute directory name"4223;;4224esac4225done4226;;4227esac42284229# This variable tells wrapper scripts just to set variables rather4230# than running their programs.4231libtool_install_magic=$magic42324233staticlibs=4234future_libdirs=4235current_libdirs=4236for file in $files; do42374238# Do each installation.4239case $file in4240*.$libext)4241# Do the static libraries later.4242func_append staticlibs " $file"4243;;42444245*.la)4246func_resolve_sysroot "$file"4247file=$func_resolve_sysroot_result42484249# Check to see that this really is a libtool archive.4250func_lalib_unsafe_p "$file" \4251|| func_fatal_help "'$file' is not a valid libtool archive"42524253library_names=4254old_library=4255relink_command=4256func_source "$file"42574258# Add the libdir to current_libdirs if it is the destination.4259if test "X$destdir" = "X$libdir"; then4260case "$current_libdirs " in4261*" $libdir "*) ;;4262*) func_append current_libdirs " $libdir" ;;4263esac4264else4265# Note the libdir as a future libdir.4266case "$future_libdirs " in4267*" $libdir "*) ;;4268*) func_append future_libdirs " $libdir" ;;4269esac4270fi42714272func_dirname "$file" "/" ""4273dir=$func_dirname_result4274func_append dir "$objdir"42754276if test -n "$relink_command"; then4277# Determine the prefix the user has applied to our future dir.4278inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`42794280# Don't allow the user to place us outside of our expected4281# location b/c this prevents finding dependent libraries that4282# are installed to the same prefix.4283# At present, this check doesn't affect windows .dll's that4284# are installed into $libdir/../bin (currently, that works fine)4285# but it's something to keep an eye on.4286test "$inst_prefix_dir" = "$destdir" && \4287func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"42884289if test -n "$inst_prefix_dir"; then4290# Stick the inst_prefix_dir data into the link command.4291relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`4292else4293relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`4294fi42954296func_warning "relinking '$file'"4297func_show_eval "$relink_command" \4298'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'4299fi43004301# See the names of the shared library.4302set dummy $library_names; shift4303if test -n "$1"; then4304realname=$14305shift43064307srcname=$realname4308test -n "$relink_command" && srcname=${realname}T43094310# Install the shared library and build the symlinks.4311func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \4312'exit $?'4313tstripme=$stripme4314case $host_os in4315cygwin* | mingw* | pw32* | cegcc*)4316case $realname in4317*.dll.a)4318tstripme=4319;;4320esac4321;;4322os2*)4323case $realname in4324*_dll.a)4325tstripme=4326;;4327esac4328;;4329esac4330if test -n "$tstripme" && test -n "$striplib"; then4331func_show_eval "$striplib $destdir/$realname" 'exit $?'4332fi43334334if test "$#" -gt 0; then4335# Delete the old symlinks, and create new ones.4336# Try 'ln -sf' first, because the 'ln' binary might depend on4337# the symlink we replace! Solaris /bin/ln does not understand -f,4338# so we also need to try rm && ln -s.4339for linkname4340do4341test "$linkname" != "$realname" \4342&& func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"4343done4344fi43454346# Do each command in the postinstall commands.4347lib=$destdir/$realname4348func_execute_cmds "$postinstall_cmds" 'exit $?'4349fi43504351# Install the pseudo-library for information purposes.4352func_basename "$file"4353name=$func_basename_result4354instname=$dir/${name}i4355func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'43564357# Maybe install the static library, too.4358test -n "$old_library" && func_append staticlibs " $dir/$old_library"4359;;43604361*.lo)4362# Install (i.e. copy) a libtool object.43634364# Figure out destination file name, if it wasn't already specified.4365if test -n "$destname"; then4366destfile=$destdir/$destname4367else4368func_basename "$file"4369destfile=$func_basename_result4370destfile=$destdir/$destfile4371fi43724373# Deduce the name of the destination old-style object file.4374case $destfile in4375*.lo)4376func_lo2o "$destfile"4377staticdest=$func_lo2o_result4378;;4379*.$objext)4380staticdest=$destfile4381destfile=4382;;4383*)4384func_fatal_help "cannot copy a libtool object to '$destfile'"4385;;4386esac43874388# Install the libtool object if requested.4389test -n "$destfile" && \4390func_show_eval "$install_prog $file $destfile" 'exit $?'43914392# Install the old object if enabled.4393if test yes = "$build_old_libs"; then4394# Deduce the name of the old-style object file.4395func_lo2o "$file"4396staticobj=$func_lo2o_result4397func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'4398fi4399exit $EXIT_SUCCESS4400;;44014402*)4403# Figure out destination file name, if it wasn't already specified.4404if test -n "$destname"; then4405destfile=$destdir/$destname4406else4407func_basename "$file"4408destfile=$func_basename_result4409destfile=$destdir/$destfile4410fi44114412# If the file is missing, and there is a .exe on the end, strip it4413# because it is most likely a libtool script we actually want to4414# install4415stripped_ext=4416case $file in4417*.exe)4418if test ! -f "$file"; then4419func_stripname '' '.exe' "$file"4420file=$func_stripname_result4421stripped_ext=.exe4422fi4423;;4424esac44254426# Do a test to see if this is really a libtool program.4427case $host in4428*cygwin* | *mingw*)4429if func_ltwrapper_executable_p "$file"; then4430func_ltwrapper_scriptname "$file"4431wrapper=$func_ltwrapper_scriptname_result4432else4433func_stripname '' '.exe' "$file"4434wrapper=$func_stripname_result4435fi4436;;4437*)4438wrapper=$file4439;;4440esac4441if func_ltwrapper_script_p "$wrapper"; then4442notinst_deplibs=4443relink_command=44444445func_source "$wrapper"44464447# Check the variables that should have been set.4448test -z "$generated_by_libtool_version" && \4449func_fatal_error "invalid libtool wrapper script '$wrapper'"44504451finalize=:4452for lib in $notinst_deplibs; do4453# Check to see that each library is installed.4454libdir=4455if test -f "$lib"; then4456func_source "$lib"4457fi4458libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`4459if test -n "$libdir" && test ! -f "$libfile"; then4460func_warning "'$lib' has not been installed in '$libdir'"4461finalize=false4462fi4463done44644465relink_command=4466func_source "$wrapper"44674468outputname=4469if test no = "$fast_install" && test -n "$relink_command"; then4470$opt_dry_run || {4471if $finalize; then4472tmpdir=`func_mktempdir`4473func_basename "$file$stripped_ext"4474file=$func_basename_result4475outputname=$tmpdir/$file4476# Replace the output file specification.4477relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`44784479$opt_quiet || {4480func_quote_for_expand "$relink_command"4481eval "func_echo $func_quote_for_expand_result"4482}4483if eval "$relink_command"; then :4484else4485func_error "error: relink '$file' with the above command before installing it"4486$opt_dry_run || ${RM}r "$tmpdir"4487continue4488fi4489file=$outputname4490else4491func_warning "cannot relink '$file'"4492fi4493}4494else4495# Install the binary that we compiled earlier.4496file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`4497fi4498fi44994500# remove .exe since cygwin /usr/bin/install will append another4501# one anyway4502case $install_prog,$host in4503*/usr/bin/install*,*cygwin*)4504case $file:$destfile in4505*.exe:*.exe)4506# this is ok4507;;4508*.exe:*)4509destfile=$destfile.exe4510;;4511*:*.exe)4512func_stripname '' '.exe' "$destfile"4513destfile=$func_stripname_result4514;;4515esac4516;;4517esac4518func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'4519$opt_dry_run || if test -n "$outputname"; then4520${RM}r "$tmpdir"4521fi4522;;4523esac4524done45254526for file in $staticlibs; do4527func_basename "$file"4528name=$func_basename_result45294530# Set up the ranlib parameters.4531oldlib=$destdir/$name4532func_to_tool_file "$oldlib" func_convert_file_msys_to_w324533tool_oldlib=$func_to_tool_file_result45344535func_show_eval "$install_prog \$file \$oldlib" 'exit $?'45364537if test -n "$stripme" && test -n "$old_striplib"; then4538func_show_eval "$old_striplib $tool_oldlib" 'exit $?'4539fi45404541# Do each command in the postinstall commands.4542func_execute_cmds "$old_postinstall_cmds" 'exit $?'4543done45444545test -n "$future_libdirs" && \4546func_warning "remember to run '$progname --finish$future_libdirs'"45474548if test -n "$current_libdirs"; then4549# Maybe just do a dry run.4550$opt_dry_run && current_libdirs=" -n$current_libdirs"4551exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'4552else4553exit $EXIT_SUCCESS4554fi4555}45564557test install = "$opt_mode" && func_mode_install ${1+"$@"}455845594560# func_generate_dlsyms outputname originator pic_p4561# Extract symbols from dlprefiles and create ${outputname}S.o with4562# a dlpreopen symbol table.4563func_generate_dlsyms ()4564{4565$debug_cmd45664567my_outputname=$14568my_originator=$24569my_pic_p=${3-false}4570my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`4571my_dlsyms=45724573if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then4574if test -n "$NM" && test -n "$global_symbol_pipe"; then4575my_dlsyms=${my_outputname}S.c4576else4577func_error "not configured to extract global symbols from dlpreopened files"4578fi4579fi45804581if test -n "$my_dlsyms"; then4582case $my_dlsyms in4583"") ;;4584*.c)4585# Discover the nlist of each of the dlfiles.4586nlist=$output_objdir/$my_outputname.nm45874588func_show_eval "$RM $nlist ${nlist}S ${nlist}T"45894590# Parse the name list into a source file.4591func_verbose "creating $output_objdir/$my_dlsyms"45924593$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\4594/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */4595/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */45964597#ifdef __cplusplus4598extern \"C\" {4599#endif46004601#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))4602#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"4603#endif46044605/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */4606#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE4607/* DATA imports from DLLs on WIN32 can't be const, because runtime4608relocations are performed -- see ld's documentation on pseudo-relocs. */4609# define LT_DLSYM_CONST4610#elif defined __osf__4611/* This system does not cope well with relocations in const data. */4612# define LT_DLSYM_CONST4613#else4614# define LT_DLSYM_CONST const4615#endif46164617#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)46184619/* External symbol declarations for the compiler. */\4620"46214622if test yes = "$dlself"; then4623func_verbose "generating symbol list for '$output'"46244625$opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"46264627# Add our own program objects to the symbol list.4628progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`4629for progfile in $progfiles; do4630func_to_tool_file "$progfile" func_convert_file_msys_to_w324631func_verbose "extracting global C symbols from '$func_to_tool_file_result'"4632$opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"4633done46344635if test -n "$exclude_expsyms"; then4636$opt_dry_run || {4637eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'4638eval '$MV "$nlist"T "$nlist"'4639}4640fi46414642if test -n "$export_symbols_regex"; then4643$opt_dry_run || {4644eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'4645eval '$MV "$nlist"T "$nlist"'4646}4647fi46484649# Prepare the list of exported symbols4650if test -z "$export_symbols"; then4651export_symbols=$output_objdir/$outputname.exp4652$opt_dry_run || {4653$RM $export_symbols4654eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'4655case $host in4656*cygwin* | *mingw* | *cegcc* )4657eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'4658eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'4659;;4660esac4661}4662else4663$opt_dry_run || {4664eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'4665eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'4666eval '$MV "$nlist"T "$nlist"'4667case $host in4668*cygwin* | *mingw* | *cegcc* )4669eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'4670eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'4671;;4672esac4673}4674fi4675fi46764677for dlprefile in $dlprefiles; do4678func_verbose "extracting global C symbols from '$dlprefile'"4679func_basename "$dlprefile"4680name=$func_basename_result4681case $host in4682*cygwin* | *mingw* | *cegcc* )4683# if an import library, we need to obtain dlname4684if func_win32_import_lib_p "$dlprefile"; then4685func_tr_sh "$dlprefile"4686eval "curr_lafile=\$libfile_$func_tr_sh_result"4687dlprefile_dlbasename=4688if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then4689# Use subshell, to avoid clobbering current variable values4690dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`4691if test -n "$dlprefile_dlname"; then4692func_basename "$dlprefile_dlname"4693dlprefile_dlbasename=$func_basename_result4694else4695# no lafile. user explicitly requested -dlpreopen <import library>.4696$sharedlib_from_linklib_cmd "$dlprefile"4697dlprefile_dlbasename=$sharedlib_from_linklib_result4698fi4699fi4700$opt_dry_run || {4701if test -n "$dlprefile_dlbasename"; then4702eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'4703else4704func_warning "Could not compute DLL name from $name"4705eval '$ECHO ": $name " >> "$nlist"'4706fi4707func_to_tool_file "$dlprefile" func_convert_file_msys_to_w324708eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |4709$SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"4710}4711else # not an import lib4712$opt_dry_run || {4713eval '$ECHO ": $name " >> "$nlist"'4714func_to_tool_file "$dlprefile" func_convert_file_msys_to_w324715eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"4716}4717fi4718;;4719*)4720$opt_dry_run || {4721eval '$ECHO ": $name " >> "$nlist"'4722func_to_tool_file "$dlprefile" func_convert_file_msys_to_w324723eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"4724}4725;;4726esac4727done47284729$opt_dry_run || {4730# Make sure we have at least an empty file.4731test -f "$nlist" || : > "$nlist"47324733if test -n "$exclude_expsyms"; then4734$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T4735$MV "$nlist"T "$nlist"4736fi47374738# Try sorting and uniquifying the output.4739if $GREP -v "^: " < "$nlist" |4740if sort -k 3 </dev/null >/dev/null 2>&1; then4741sort -k 34742else4743sort +24744fi |4745uniq > "$nlist"S; then4746:4747else4748$GREP -v "^: " < "$nlist" > "$nlist"S4749fi47504751if test -f "$nlist"S; then4752eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'4753else4754echo '/* NONE */' >> "$output_objdir/$my_dlsyms"4755fi47564757func_show_eval '$RM "${nlist}I"'4758if test -n "$global_symbol_to_import"; then4759eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'4760fi47614762echo >> "$output_objdir/$my_dlsyms" "\47634764/* The mapping between symbol names and symbols. */4765typedef struct {4766const char *name;4767void *address;4768} lt_dlsymlist;4769extern LT_DLSYM_CONST lt_dlsymlist4770lt_${my_prefix}_LTX_preloaded_symbols[];\4771"47724773if test -s "$nlist"I; then4774echo >> "$output_objdir/$my_dlsyms" "\4775static void lt_syminit(void)4776{4777LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;4778for (; symbol->name; ++symbol)4779{"4780$SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"4781echo >> "$output_objdir/$my_dlsyms" "\4782}4783}"4784fi4785echo >> "$output_objdir/$my_dlsyms" "\4786LT_DLSYM_CONST lt_dlsymlist4787lt_${my_prefix}_LTX_preloaded_symbols[] =4788{ {\"$my_originator\", (void *) 0},"47894790if test -s "$nlist"I; then4791echo >> "$output_objdir/$my_dlsyms" "\4792{\"@INIT@\", (void *) <_syminit},"4793fi47944795case $need_lib_prefix in4796no)4797eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"4798;;4799*)4800eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"4801;;4802esac4803echo >> "$output_objdir/$my_dlsyms" "\4804{0, (void *) 0}4805};48064807/* This works around a problem in FreeBSD linker */4808#ifdef FREEBSD_WORKAROUND4809static const void *lt_preloaded_setup() {4810return lt_${my_prefix}_LTX_preloaded_symbols;4811}4812#endif48134814#ifdef __cplusplus4815}4816#endif\4817"4818} # !$opt_dry_run48194820pic_flag_for_symtable=4821case "$compile_command " in4822*" -static "*) ;;4823*)4824case $host in4825# compiling the symbol table file with pic_flag works around4826# a FreeBSD bug that causes programs to crash when -lm is4827# linked before any other PIC object. But we must not use4828# pic_flag when linking with -static. The problem exists in4829# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.4830*-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)4831pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;4832*-*-hpux*)4833pic_flag_for_symtable=" $pic_flag" ;;4834*)4835$my_pic_p && pic_flag_for_symtable=" $pic_flag"4836;;4837esac4838;;4839esac4840symtab_cflags=4841for arg in $LTCFLAGS; do4842case $arg in4843-pie | -fpie | -fPIE) ;;4844*) func_append symtab_cflags " $arg" ;;4845esac4846done48474848# Now compile the dynamic symbol file.4849func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'48504851# Clean up the generated files.4852func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'48534854# Transform the symbol file into the correct name.4855symfileobj=$output_objdir/${my_outputname}S.$objext4856case $host in4857*cygwin* | *mingw* | *cegcc* )4858if test -f "$output_objdir/$my_outputname.def"; then4859compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`4860finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`4861else4862compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`4863finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`4864fi4865;;4866*)4867compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`4868finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`4869;;4870esac4871;;4872*)4873func_fatal_error "unknown suffix for '$my_dlsyms'"4874;;4875esac4876else4877# We keep going just in case the user didn't refer to4878# lt_preloaded_symbols. The linker will fail if global_symbol_pipe4879# really was required.48804881# Nullify the symbol file.4882compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`4883finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`4884fi4885}48864887# func_cygming_gnu_implib_p ARG4888# This predicate returns with zero status (TRUE) if4889# ARG is a GNU/binutils-style import library. Returns4890# with nonzero status (FALSE) otherwise.4891func_cygming_gnu_implib_p ()4892{4893$debug_cmd48944895func_to_tool_file "$1" func_convert_file_msys_to_w324896func_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)$'`4897test -n "$func_cygming_gnu_implib_tmp"4898}48994900# func_cygming_ms_implib_p ARG4901# This predicate returns with zero status (TRUE) if4902# ARG is an MS-style import library. Returns4903# with nonzero status (FALSE) otherwise.4904func_cygming_ms_implib_p ()4905{4906$debug_cmd49074908func_to_tool_file "$1" func_convert_file_msys_to_w324909func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`4910test -n "$func_cygming_ms_implib_tmp"4911}49124913# func_win32_libid arg4914# return the library type of file 'arg'4915#4916# Need a lot of goo to handle *both* DLLs and import libs4917# Has to be a shell function in order to 'eat' the argument4918# that is supplied when $file_magic_command is called.4919# Despite the name, also deal with 64 bit binaries.4920func_win32_libid ()4921{4922$debug_cmd49234924win32_libid_type=unknown4925win32_fileres=`file -L $1 2>/dev/null`4926case $win32_fileres in4927*ar\ archive\ import\ library*) # definitely import4928win32_libid_type="x86 archive import"4929;;4930*ar\ archive*) # could be an import, or static4931# Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.4932if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |4933$EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then4934case $nm_interface in4935"MS dumpbin")4936if func_cygming_ms_implib_p "$1" ||4937func_cygming_gnu_implib_p "$1"4938then4939win32_nmres=import4940else4941win32_nmres=4942fi4943;;4944*)4945func_to_tool_file "$1" func_convert_file_msys_to_w324946win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |4947$SED -n -e '49481,100{4949/ I /{4950s|.*|import|4951p4952q4953}4954}'`4955;;4956esac4957case $win32_nmres in4958import*) win32_libid_type="x86 archive import";;4959*) win32_libid_type="x86 archive static";;4960esac4961fi4962;;4963*DLL*)4964win32_libid_type="x86 DLL"4965;;4966*executable*) # but shell scripts are "executable" too...4967case $win32_fileres in4968*MS\ Windows\ PE\ Intel*)4969win32_libid_type="x86 DLL"4970;;4971esac4972;;4973esac4974$ECHO "$win32_libid_type"4975}49764977# func_cygming_dll_for_implib ARG4978#4979# Platform-specific function to extract the4980# name of the DLL associated with the specified4981# import library ARG.4982# Invoked by eval'ing the libtool variable4983# $sharedlib_from_linklib_cmd4984# Result is available in the variable4985# $sharedlib_from_linklib_result4986func_cygming_dll_for_implib ()4987{4988$debug_cmd49894990sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`4991}49924993# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs4994#4995# The is the core of a fallback implementation of a4996# platform-specific function to extract the name of the4997# DLL associated with the specified import library LIBNAME.4998#4999# SECTION_NAME is either .idata$6 or .idata$7, depending5000# on the platform and compiler that created the implib.5001#5002# Echos the name of the DLL associated with the5003# specified import library.5004func_cygming_dll_for_implib_fallback_core ()5005{5006$debug_cmd50075008match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`5009$OBJDUMP -s --section "$1" "$2" 2>/dev/null |5010$SED '/^Contents of section '"$match_literal"':/{5011# Place marker at beginning of archive member dllname section5012s/.*/====MARK====/5013p5014d5015}5016# These lines can sometimes be longer than 43 characters, but5017# are always uninteresting5018/:[ ]*file format pe[i]\{,1\}-/d5019/^In archive [^:]*:/d5020# Ensure marker is printed5021/^====MARK====/p5022# Remove all lines with less than 43 characters5023/^.\{43\}/!d5024# From remaining lines, remove first 43 characters5025s/^.\{43\}//' |5026$SED -n '5027# Join marker and all lines until next marker into a single line5028/^====MARK====/ b para5029H5030$ b para5031b5032:para5033x5034s/\n//g5035# Remove the marker5036s/^====MARK====//5037# Remove trailing dots and whitespace5038s/[\. \t]*$//50395040/./p' |5041# we now have a list, one entry per line, of the stringified5042# contents of the appropriate section of all members of the5043# archive that possess that section. Heuristic: eliminate5044# all those that have a first or second character that is5045# a '.' (that is, objdump's representation of an unprintable5046# character.) This should work for all archives with less than5047# 0x302f exports -- but will fail for DLLs whose name actually5048# begins with a literal '.' or a single character followed by5049# a '.'.5050#5051# Of those that remain, print the first one.5052$SED -e '/^\./d;/^.\./d;q'5053}50545055# func_cygming_dll_for_implib_fallback ARG5056# Platform-specific function to extract the5057# name of the DLL associated with the specified5058# import library ARG.5059#5060# This fallback implementation is for use when $DLLTOOL5061# does not support the --identify-strict option.5062# Invoked by eval'ing the libtool variable5063# $sharedlib_from_linklib_cmd5064# Result is available in the variable5065# $sharedlib_from_linklib_result5066func_cygming_dll_for_implib_fallback ()5067{5068$debug_cmd50695070if func_cygming_gnu_implib_p "$1"; then5071# binutils import library5072sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`5073elif func_cygming_ms_implib_p "$1"; then5074# ms-generated import library5075sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`5076else5077# unknown5078sharedlib_from_linklib_result=5079fi5080}508150825083# func_extract_an_archive dir oldlib5084func_extract_an_archive ()5085{5086$debug_cmd50875088f_ex_an_ar_dir=$1; shift5089f_ex_an_ar_oldlib=$15090if test yes = "$lock_old_archive_extraction"; then5091lockfile=$f_ex_an_ar_oldlib.lock5092until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do5093func_echo "Waiting for $lockfile to be removed"5094sleep 25095done5096fi5097func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \5098'stat=$?; rm -f "$lockfile"; exit $stat'5099if test yes = "$lock_old_archive_extraction"; then5100$opt_dry_run || rm -f "$lockfile"5101fi5102if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then5103:5104else5105func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"5106fi5107}510851095110# func_extract_archives gentop oldlib ...5111func_extract_archives ()5112{5113$debug_cmd51145115my_gentop=$1; shift5116my_oldlibs=${1+"$@"}5117my_oldobjs=5118my_xlib=5119my_xabs=5120my_xdir=51215122for my_xlib in $my_oldlibs; do5123# Extract the objects.5124case $my_xlib in5125[\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;5126*) my_xabs=`pwd`"/$my_xlib" ;;5127esac5128func_basename "$my_xlib"5129my_xlib=$func_basename_result5130my_xlib_u=$my_xlib5131while :; do5132case " $extracted_archives " in5133*" $my_xlib_u "*)5134func_arith $extracted_serial + 15135extracted_serial=$func_arith_result5136my_xlib_u=lt$extracted_serial-$my_xlib ;;5137*) break ;;5138esac5139done5140extracted_archives="$extracted_archives $my_xlib_u"5141my_xdir=$my_gentop/$my_xlib_u51425143func_mkdir_p "$my_xdir"51445145case $host in5146*-darwin*)5147func_verbose "Extracting $my_xabs"5148# Do not bother doing anything if just a dry run5149$opt_dry_run || {5150darwin_orig_dir=`pwd`5151cd $my_xdir || exit $?5152darwin_archive=$my_xabs5153darwin_curdir=`pwd`5154func_basename "$darwin_archive"5155darwin_base_archive=$func_basename_result5156darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`5157if test -n "$darwin_arches"; then5158darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`5159darwin_arch=5160func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"5161for darwin_arch in $darwin_arches; do5162func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"5163$LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"5164cd "unfat-$$/$darwin_base_archive-$darwin_arch"5165func_extract_an_archive "`pwd`" "$darwin_base_archive"5166cd "$darwin_curdir"5167$RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"5168done # $darwin_arches5169## Okay now we've a bunch of thin objects, gotta fatten them up :)5170darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u`5171darwin_file=5172darwin_files=5173for darwin_file in $darwin_filelist; do5174darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`5175$LIPO -create -output "$darwin_file" $darwin_files5176done # $darwin_filelist5177$RM -rf unfat-$$5178cd "$darwin_orig_dir"5179else5180cd $darwin_orig_dir5181func_extract_an_archive "$my_xdir" "$my_xabs"5182fi # $darwin_arches5183} # !$opt_dry_run5184;;5185*)5186func_extract_an_archive "$my_xdir" "$my_xabs"5187;;5188esac5189my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`5190done51915192func_extract_archives_result=$my_oldobjs5193}519451955196# func_emit_wrapper [arg=no]5197#5198# Emit a libtool wrapper script on stdout.5199# Don't directly open a file because we may want to5200# incorporate the script contents within a cygwin/mingw5201# wrapper executable. Must ONLY be called from within5202# func_mode_link because it depends on a number of variables5203# set therein.5204#5205# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR5206# variable will take. If 'yes', then the emitted script5207# will assume that the directory where it is stored is5208# the $objdir directory. This is a cygwin/mingw-specific5209# behavior.5210func_emit_wrapper ()5211{5212func_emit_wrapper_arg1=${1-no}52135214$ECHO "\5215#! $SHELL52165217# $output - temporary wrapper script for $objdir/$outputname5218# Generated by $PROGRAM (GNU $PACKAGE) $VERSION5219#5220# The $output program cannot be directly executed until all the libtool5221# libraries that it depends on are installed.5222#5223# This wrapper script should never be moved out of the build directory.5224# If it is, it will not operate correctly.52255226# Sed substitution that helps us do robust quoting. It backslashifies5227# metacharacters that are still active within double-quoted strings.5228sed_quote_subst='$sed_quote_subst'52295230# Be Bourne compatible5231if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then5232emulate sh5233NULLCMD=:5234# Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which5235# is contrary to our usage. Disable this feature.5236alias -g '\${1+\"\$@\"}'='\"\$@\"'5237setopt NO_GLOB_SUBST5238else5239case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac5240fi5241BIN_SH=xpg4; export BIN_SH # for Tru645242DUALCASE=1; export DUALCASE # for MKS sh52435244# The HP-UX ksh and POSIX shell print the target directory to stdout5245# if CDPATH is set.5246(unset CDPATH) >/dev/null 2>&1 && unset CDPATH52475248relink_command=\"$relink_command\"52495250# This environment variable determines our operation mode.5251if test \"\$libtool_install_magic\" = \"$magic\"; then5252# install mode needs the following variables:5253generated_by_libtool_version='$macro_version'5254notinst_deplibs='$notinst_deplibs'5255else5256# When we are sourced in execute mode, \$file and \$ECHO are already set.5257if test \"\$libtool_execute_magic\" != \"$magic\"; then5258file=\"\$0\""52595260qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`5261$ECHO "\52625263# A function that is used when there is no print builtin or printf.5264func_fallback_echo ()5265{5266eval 'cat <<_LTECHO_EOF5267\$15268_LTECHO_EOF'5269}5270ECHO=\"$qECHO\"5271fi52725273# Very basic option parsing. These options are (a) specific to5274# the libtool wrapper, (b) are identical between the wrapper5275# /script/ and the wrapper /executable/ that is used only on5276# windows platforms, and (c) all begin with the string "--lt-"5277# (application programs are unlikely to have options that match5278# this pattern).5279#5280# There are only two supported options: --lt-debug and5281# --lt-dump-script. There is, deliberately, no --lt-help.5282#5283# The first argument to this parsing function should be the5284# script's $0 value, followed by "$@".5285lt_option_debug=5286func_parse_lt_options ()5287{5288lt_script_arg0=\$05289shift5290for lt_opt5291do5292case \"\$lt_opt\" in5293--lt-debug) lt_option_debug=1 ;;5294--lt-dump-script)5295lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`5296test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.5297lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`5298cat \"\$lt_dump_D/\$lt_dump_F\"5299exit 05300;;5301--lt-*)5302\$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&25303exit 15304;;5305esac5306done53075308# Print the debug banner immediately:5309if test -n \"\$lt_option_debug\"; then5310echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&25311fi5312}53135314# Used when --lt-debug. Prints its arguments to stdout5315# (redirection is the responsibility of the caller)5316func_lt_dump_args ()5317{5318lt_dump_args_N=1;5319for lt_arg5320do5321\$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"5322lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`5323done5324}53255326# Core function for launching the target application5327func_exec_program_core ()5328{5329"5330case $host in5331# Backslashes separate directories on plain windows5332*-*-mingw | *-*-os2* | *-cegcc*)5333$ECHO "\5334if test -n \"\$lt_option_debug\"; then5335\$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&25336func_lt_dump_args \${1+\"\$@\"} 1>&25337fi5338exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}5339"5340;;53415342*)5343$ECHO "\5344if test -n \"\$lt_option_debug\"; then5345\$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&25346func_lt_dump_args \${1+\"\$@\"} 1>&25347fi5348exec \"\$progdir/\$program\" \${1+\"\$@\"}5349"5350;;5351esac5352$ECHO "\5353\$ECHO \"\$0: cannot exec \$program \$*\" 1>&25354exit 15355}53565357# A function to encapsulate launching the target application5358# Strips options in the --lt-* namespace from \$@ and5359# launches target application with the remaining arguments.5360func_exec_program ()5361{5362case \" \$* \" in5363*\\ --lt-*)5364for lt_wr_arg5365do5366case \$lt_wr_arg in5367--lt-*) ;;5368*) set x \"\$@\" \"\$lt_wr_arg\"; shift;;5369esac5370shift5371done ;;5372esac5373func_exec_program_core \${1+\"\$@\"}5374}53755376# Parse options5377func_parse_lt_options \"\$0\" \${1+\"\$@\"}53785379# Find the directory that this script lives in.5380thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`5381test \"x\$thisdir\" = \"x\$file\" && thisdir=.53825383# Follow symbolic links until we get to the real thisdir.5384file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`5385while test -n \"\$file\"; do5386destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`53875388# If there was a directory component, then change thisdir.5389if test \"x\$destdir\" != \"x\$file\"; then5390case \"\$destdir\" in5391[\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;5392*) thisdir=\"\$thisdir/\$destdir\" ;;5393esac5394fi53955396file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`5397file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`5398done53995400# Usually 'no', except on cygwin/mingw when embedded into5401# the cwrapper.5402WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg15403if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then5404# special case for '.'5405if test \"\$thisdir\" = \".\"; then5406thisdir=\`pwd\`5407fi5408# remove .libs from thisdir5409case \"\$thisdir\" in5410*[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;5411$objdir ) thisdir=. ;;5412esac5413fi54145415# Try to get the absolute directory name.5416absdir=\`cd \"\$thisdir\" && pwd\`5417test -n \"\$absdir\" && thisdir=\"\$absdir\"5418"54195420if test yes = "$fast_install"; then5421$ECHO "\5422program=lt-'$outputname'$exeext5423progdir=\"\$thisdir/$objdir\"54245425if test ! -f \"\$progdir/\$program\" ||5426{ file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\5427test \"X\$file\" != \"X\$progdir/\$program\"; }; then54285429file=\"\$\$-\$program\"54305431if test ! -d \"\$progdir\"; then5432$MKDIR \"\$progdir\"5433else5434$RM \"\$progdir/\$file\"5435fi"54365437$ECHO "\54385439# relink executable if necessary5440if test -n \"\$relink_command\"; then5441if relink_command_output=\`eval \$relink_command 2>&1\`; then :5442else5443\$ECHO \"\$relink_command_output\" >&25444$RM \"\$progdir/\$file\"5445exit 15446fi5447fi54485449$MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||5450{ $RM \"\$progdir/\$program\";5451$MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }5452$RM \"\$progdir/\$file\"5453fi"5454else5455$ECHO "\5456program='$outputname'5457progdir=\"\$thisdir/$objdir\"5458"5459fi54605461$ECHO "\54625463if test -f \"\$progdir/\$program\"; then"54645465# fixup the dll searchpath if we need to.5466#5467# Fix the DLL searchpath if we need to. Do this before prepending5468# to shlibpath, because on Windows, both are PATH and uninstalled5469# libraries must come first.5470if test -n "$dllsearchpath"; then5471$ECHO "\5472# Add the dll search path components to the executable PATH5473PATH=$dllsearchpath:\$PATH5474"5475fi54765477# Export our shlibpath_var if we have one.5478if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then5479$ECHO "\5480# Add our own library path to $shlibpath_var5481$shlibpath_var=\"$temp_rpath\$$shlibpath_var\"54825483# Some systems cannot cope with colon-terminated $shlibpath_var5484# The second colon is a workaround for a bug in BeOS R4 sed5485$shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`54865487export $shlibpath_var5488"5489fi54905491$ECHO "\5492if test \"\$libtool_execute_magic\" != \"$magic\"; then5493# Run the actual program with our arguments.5494func_exec_program \${1+\"\$@\"}5495fi5496else5497# The program doesn't exist.5498\$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&25499\$ECHO \"This script is just a wrapper for \$program.\" 1>&25500\$ECHO \"See the $PACKAGE documentation for more information.\" 1>&25501exit 15502fi5503fi\5504"5505}550655075508# func_emit_cwrapperexe_src5509# emit the source code for a wrapper executable on stdout5510# Must ONLY be called from within func_mode_link because5511# it depends on a number of variable set therein.5512func_emit_cwrapperexe_src ()5513{5514cat <<EOF55155516/* $cwrappersource - temporary wrapper executable for $objdir/$outputname5517Generated by $PROGRAM (GNU $PACKAGE) $VERSION55185519The $output program cannot be directly executed until all the libtool5520libraries that it depends on are installed.55215522This wrapper executable should never be moved out of the build directory.5523If it is, it will not operate correctly.5524*/5525EOF5526cat <<"EOF"5527#ifdef _MSC_VER5528# define _CRT_SECURE_NO_DEPRECATE 15529#endif5530#include <stdio.h>5531#include <stdlib.h>5532#ifdef _MSC_VER5533# include <direct.h>5534# include <process.h>5535# include <io.h>5536#else5537# include <unistd.h>5538# include <stdint.h>5539# ifdef __CYGWIN__5540# include <io.h>5541# endif5542#endif5543#include <malloc.h>5544#include <stdarg.h>5545#include <assert.h>5546#include <string.h>5547#include <ctype.h>5548#include <errno.h>5549#include <fcntl.h>5550#include <sys/stat.h>55515552#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)55535554/* declarations of non-ANSI functions */5555#if defined __MINGW32__5556# ifdef __STRICT_ANSI__5557int _putenv (const char *);5558# endif5559#elif defined __CYGWIN__5560# ifdef __STRICT_ANSI__5561char *realpath (const char *, char *);5562int putenv (char *);5563int setenv (const char *, const char *, int);5564# endif5565/* #elif defined other_platform || defined ... */5566#endif55675568/* portability defines, excluding path handling macros */5569#if defined _MSC_VER5570# define setmode _setmode5571# define stat _stat5572# define chmod _chmod5573# define getcwd _getcwd5574# define putenv _putenv5575# define S_IXUSR _S_IEXEC5576#elif defined __MINGW32__5577# define setmode _setmode5578# define stat _stat5579# define chmod _chmod5580# define getcwd _getcwd5581# define putenv _putenv5582#elif defined __CYGWIN__5583# define HAVE_SETENV5584# define FOPEN_WB "wb"5585/* #elif defined other platforms ... */5586#endif55875588#if defined PATH_MAX5589# define LT_PATHMAX PATH_MAX5590#elif defined MAXPATHLEN5591# define LT_PATHMAX MAXPATHLEN5592#else5593# define LT_PATHMAX 10245594#endif55955596#ifndef S_IXOTH5597# define S_IXOTH 05598#endif5599#ifndef S_IXGRP5600# define S_IXGRP 05601#endif56025603/* path handling portability macros */5604#ifndef DIR_SEPARATOR5605# define DIR_SEPARATOR '/'5606# define PATH_SEPARATOR ':'5607#endif56085609#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \5610defined __OS2__5611# define HAVE_DOS_BASED_FILE_SYSTEM5612# define FOPEN_WB "wb"5613# ifndef DIR_SEPARATOR_25614# define DIR_SEPARATOR_2 '\\'5615# endif5616# ifndef PATH_SEPARATOR_25617# define PATH_SEPARATOR_2 ';'5618# endif5619#endif56205621#ifndef DIR_SEPARATOR_25622# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)5623#else /* DIR_SEPARATOR_2 */5624# define IS_DIR_SEPARATOR(ch) \5625(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))5626#endif /* DIR_SEPARATOR_2 */56275628#ifndef PATH_SEPARATOR_25629# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)5630#else /* PATH_SEPARATOR_2 */5631# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)5632#endif /* PATH_SEPARATOR_2 */56335634#ifndef FOPEN_WB5635# define FOPEN_WB "w"5636#endif5637#ifndef _O_BINARY5638# define _O_BINARY 05639#endif56405641#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))5642#define XFREE(stale) do { \5643if (stale) { free (stale); stale = 0; } \5644} while (0)56455646#if defined LT_DEBUGWRAPPER5647static int lt_debug = 1;5648#else5649static int lt_debug = 0;5650#endif56515652const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */56535654void *xmalloc (size_t num);5655char *xstrdup (const char *string);5656const char *base_name (const char *name);5657char *find_executable (const char *wrapper);5658char *chase_symlinks (const char *pathspec);5659int make_executable (const char *path);5660int check_executable (const char *path);5661char *strendzap (char *str, const char *pat);5662void lt_debugprintf (const char *file, int line, const char *fmt, ...);5663void lt_fatal (const char *file, int line, const char *message, ...);5664static const char *nonnull (const char *s);5665static const char *nonempty (const char *s);5666void lt_setenv (const char *name, const char *value);5667char *lt_extend_str (const char *orig_value, const char *add, int to_end);5668void lt_update_exe_path (const char *name, const char *value);5669void lt_update_lib_path (const char *name, const char *value);5670char **prepare_spawn (char **argv);5671void lt_dump_script (FILE *f);5672EOF56735674cat <<EOF5675#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)5676# define externally_visible volatile5677#else5678# define externally_visible __attribute__((externally_visible)) volatile5679#endif5680externally_visible const char * MAGIC_EXE = "$magic_exe";5681const char * LIB_PATH_VARNAME = "$shlibpath_var";5682EOF56835684if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then5685func_to_host_path "$temp_rpath"5686cat <<EOF5687const char * LIB_PATH_VALUE = "$func_to_host_path_result";5688EOF5689else5690cat <<"EOF"5691const char * LIB_PATH_VALUE = "";5692EOF5693fi56945695if test -n "$dllsearchpath"; then5696func_to_host_path "$dllsearchpath:"5697cat <<EOF5698const char * EXE_PATH_VARNAME = "PATH";5699const char * EXE_PATH_VALUE = "$func_to_host_path_result";5700EOF5701else5702cat <<"EOF"5703const char * EXE_PATH_VARNAME = "";5704const char * EXE_PATH_VALUE = "";5705EOF5706fi57075708if test yes = "$fast_install"; then5709cat <<EOF5710const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */5711EOF5712else5713cat <<EOF5714const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */5715EOF5716fi571757185719cat <<"EOF"57205721#define LTWRAPPER_OPTION_PREFIX "--lt-"57225723static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;5724static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";5725static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";57265727int5728main (int argc, char *argv[])5729{5730char **newargz;5731int newargc;5732char *tmp_pathspec;5733char *actual_cwrapper_path;5734char *actual_cwrapper_name;5735char *target_name;5736char *lt_argv_zero;5737int rval = 127;57385739int i;57405741program_name = (char *) xstrdup (base_name (argv[0]));5742newargz = XMALLOC (char *, (size_t) argc + 1);57435744/* very simple arg parsing; don't want to rely on getopt5745* also, copy all non cwrapper options to newargz, except5746* argz[0], which is handled differently5747*/5748newargc=0;5749for (i = 1; i < argc; i++)5750{5751if (STREQ (argv[i], dumpscript_opt))5752{5753EOF5754case $host in5755*mingw* | *cygwin* )5756# make stdout use "unix" line endings5757echo " setmode(1,_O_BINARY);"5758;;5759esac57605761cat <<"EOF"5762lt_dump_script (stdout);5763return 0;5764}5765if (STREQ (argv[i], debug_opt))5766{5767lt_debug = 1;5768continue;5769}5770if (STREQ (argv[i], ltwrapper_option_prefix))5771{5772/* however, if there is an option in the LTWRAPPER_OPTION_PREFIX5773namespace, but it is not one of the ones we know about and5774have already dealt with, above (inluding dump-script), then5775report an error. Otherwise, targets might begin to believe5776they are allowed to use options in the LTWRAPPER_OPTION_PREFIX5777namespace. The first time any user complains about this, we'll5778need to make LTWRAPPER_OPTION_PREFIX a configure-time option5779or a configure.ac-settable value.5780*/5781lt_fatal (__FILE__, __LINE__,5782"unrecognized %s option: '%s'",5783ltwrapper_option_prefix, argv[i]);5784}5785/* otherwise ... */5786newargz[++newargc] = xstrdup (argv[i]);5787}5788newargz[++newargc] = NULL;57895790EOF5791cat <<EOF5792/* The GNU banner must be the first non-error debug message */5793lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");5794EOF5795cat <<"EOF"5796lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);5797lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);57985799tmp_pathspec = find_executable (argv[0]);5800if (tmp_pathspec == NULL)5801lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);5802lt_debugprintf (__FILE__, __LINE__,5803"(main) found exe (before symlink chase) at: %s\n",5804tmp_pathspec);58055806actual_cwrapper_path = chase_symlinks (tmp_pathspec);5807lt_debugprintf (__FILE__, __LINE__,5808"(main) found exe (after symlink chase) at: %s\n",5809actual_cwrapper_path);5810XFREE (tmp_pathspec);58115812actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));5813strendzap (actual_cwrapper_path, actual_cwrapper_name);58145815/* wrapper name transforms */5816strendzap (actual_cwrapper_name, ".exe");5817tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);5818XFREE (actual_cwrapper_name);5819actual_cwrapper_name = tmp_pathspec;5820tmp_pathspec = 0;58215822/* target_name transforms -- use actual target program name; might have lt- prefix */5823target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));5824strendzap (target_name, ".exe");5825tmp_pathspec = lt_extend_str (target_name, ".exe", 1);5826XFREE (target_name);5827target_name = tmp_pathspec;5828tmp_pathspec = 0;58295830lt_debugprintf (__FILE__, __LINE__,5831"(main) libtool target name: %s\n",5832target_name);5833EOF58345835cat <<EOF5836newargz[0] =5837XMALLOC (char, (strlen (actual_cwrapper_path) +5838strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));5839strcpy (newargz[0], actual_cwrapper_path);5840strcat (newargz[0], "$objdir");5841strcat (newargz[0], "/");5842EOF58435844cat <<"EOF"5845/* stop here, and copy so we don't have to do this twice */5846tmp_pathspec = xstrdup (newargz[0]);58475848/* do NOT want the lt- prefix here, so use actual_cwrapper_name */5849strcat (newargz[0], actual_cwrapper_name);58505851/* DO want the lt- prefix here if it exists, so use target_name */5852lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);5853XFREE (tmp_pathspec);5854tmp_pathspec = NULL;5855EOF58565857case $host_os in5858mingw*)5859cat <<"EOF"5860{5861char* p;5862while ((p = strchr (newargz[0], '\\')) != NULL)5863{5864*p = '/';5865}5866while ((p = strchr (lt_argv_zero, '\\')) != NULL)5867{5868*p = '/';5869}5870}5871EOF5872;;5873esac58745875cat <<"EOF"5876XFREE (target_name);5877XFREE (actual_cwrapper_path);5878XFREE (actual_cwrapper_name);58795880lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */5881lt_setenv ("DUALCASE", "1"); /* for MSK sh */5882/* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must5883be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)5884because on Windows, both *_VARNAMEs are PATH but uninstalled5885libraries must come first. */5886lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);5887lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);58885889lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",5890nonnull (lt_argv_zero));5891for (i = 0; i < newargc; i++)5892{5893lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",5894i, nonnull (newargz[i]));5895}58965897EOF58985899case $host_os in5900mingw*)5901cat <<"EOF"5902/* execv doesn't actually work on mingw as expected on unix */5903newargz = prepare_spawn (newargz);5904rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);5905if (rval == -1)5906{5907/* failed to start process */5908lt_debugprintf (__FILE__, __LINE__,5909"(main) failed to launch target \"%s\": %s\n",5910lt_argv_zero, nonnull (strerror (errno)));5911return 127;5912}5913return rval;5914EOF5915;;5916*)5917cat <<"EOF"5918execv (lt_argv_zero, newargz);5919return rval; /* =127, but avoids unused variable warning */5920EOF5921;;5922esac59235924cat <<"EOF"5925}59265927void *5928xmalloc (size_t num)5929{5930void *p = (void *) malloc (num);5931if (!p)5932lt_fatal (__FILE__, __LINE__, "memory exhausted");59335934return p;5935}59365937char *5938xstrdup (const char *string)5939{5940return string ? strcpy ((char *) xmalloc (strlen (string) + 1),5941string) : NULL;5942}59435944const char *5945base_name (const char *name)5946{5947const char *base;59485949#if defined HAVE_DOS_BASED_FILE_SYSTEM5950/* Skip over the disk name in MSDOS pathnames. */5951if (isalpha ((unsigned char) name[0]) && name[1] == ':')5952name += 2;5953#endif59545955for (base = name; *name; name++)5956if (IS_DIR_SEPARATOR (*name))5957base = name + 1;5958return base;5959}59605961int5962check_executable (const char *path)5963{5964struct stat st;59655966lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",5967nonempty (path));5968if ((!path) || (!*path))5969return 0;59705971if ((stat (path, &st) >= 0)5972&& (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))5973return 1;5974else5975return 0;5976}59775978int5979make_executable (const char *path)5980{5981int rval = 0;5982struct stat st;59835984lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",5985nonempty (path));5986if ((!path) || (!*path))5987return 0;59885989if (stat (path, &st) >= 0)5990{5991rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);5992}5993return rval;5994}59955996/* Searches for the full path of the wrapper. Returns5997newly allocated full path name if found, NULL otherwise5998Does not chase symlinks, even on platforms that support them.5999*/6000char *6001find_executable (const char *wrapper)6002{6003int has_slash = 0;6004const char *p;6005const char *p_next;6006/* static buffer for getcwd */6007char tmp[LT_PATHMAX + 1];6008size_t tmp_len;6009char *concat_name;60106011lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",6012nonempty (wrapper));60136014if ((wrapper == NULL) || (*wrapper == '\0'))6015return NULL;60166017/* Absolute path? */6018#if defined HAVE_DOS_BASED_FILE_SYSTEM6019if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')6020{6021concat_name = xstrdup (wrapper);6022if (check_executable (concat_name))6023return concat_name;6024XFREE (concat_name);6025}6026else6027{6028#endif6029if (IS_DIR_SEPARATOR (wrapper[0]))6030{6031concat_name = xstrdup (wrapper);6032if (check_executable (concat_name))6033return concat_name;6034XFREE (concat_name);6035}6036#if defined HAVE_DOS_BASED_FILE_SYSTEM6037}6038#endif60396040for (p = wrapper; *p; p++)6041if (*p == '/')6042{6043has_slash = 1;6044break;6045}6046if (!has_slash)6047{6048/* no slashes; search PATH */6049const char *path = getenv ("PATH");6050if (path != NULL)6051{6052for (p = path; *p; p = p_next)6053{6054const char *q;6055size_t p_len;6056for (q = p; *q; q++)6057if (IS_PATH_SEPARATOR (*q))6058break;6059p_len = (size_t) (q - p);6060p_next = (*q == '\0' ? q : q + 1);6061if (p_len == 0)6062{6063/* empty path: current directory */6064if (getcwd (tmp, LT_PATHMAX) == NULL)6065lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",6066nonnull (strerror (errno)));6067tmp_len = strlen (tmp);6068concat_name =6069XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);6070memcpy (concat_name, tmp, tmp_len);6071concat_name[tmp_len] = '/';6072strcpy (concat_name + tmp_len + 1, wrapper);6073}6074else6075{6076concat_name =6077XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);6078memcpy (concat_name, p, p_len);6079concat_name[p_len] = '/';6080strcpy (concat_name + p_len + 1, wrapper);6081}6082if (check_executable (concat_name))6083return concat_name;6084XFREE (concat_name);6085}6086}6087/* not found in PATH; assume curdir */6088}6089/* Relative path | not found in path: prepend cwd */6090if (getcwd (tmp, LT_PATHMAX) == NULL)6091lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",6092nonnull (strerror (errno)));6093tmp_len = strlen (tmp);6094concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);6095memcpy (concat_name, tmp, tmp_len);6096concat_name[tmp_len] = '/';6097strcpy (concat_name + tmp_len + 1, wrapper);60986099if (check_executable (concat_name))6100return concat_name;6101XFREE (concat_name);6102return NULL;6103}61046105char *6106chase_symlinks (const char *pathspec)6107{6108#ifndef S_ISLNK6109return xstrdup (pathspec);6110#else6111char buf[LT_PATHMAX];6112struct stat s;6113char *tmp_pathspec = xstrdup (pathspec);6114char *p;6115int has_symlinks = 0;6116while (strlen (tmp_pathspec) && !has_symlinks)6117{6118lt_debugprintf (__FILE__, __LINE__,6119"checking path component for symlinks: %s\n",6120tmp_pathspec);6121if (lstat (tmp_pathspec, &s) == 0)6122{6123if (S_ISLNK (s.st_mode) != 0)6124{6125has_symlinks = 1;6126break;6127}61286129/* search backwards for last DIR_SEPARATOR */6130p = tmp_pathspec + strlen (tmp_pathspec) - 1;6131while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))6132p--;6133if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))6134{6135/* no more DIR_SEPARATORS left */6136break;6137}6138*p = '\0';6139}6140else6141{6142lt_fatal (__FILE__, __LINE__,6143"error accessing file \"%s\": %s",6144tmp_pathspec, nonnull (strerror (errno)));6145}6146}6147XFREE (tmp_pathspec);61486149if (!has_symlinks)6150{6151return xstrdup (pathspec);6152}61536154tmp_pathspec = realpath (pathspec, buf);6155if (tmp_pathspec == 0)6156{6157lt_fatal (__FILE__, __LINE__,6158"could not follow symlinks for %s", pathspec);6159}6160return xstrdup (tmp_pathspec);6161#endif6162}61636164char *6165strendzap (char *str, const char *pat)6166{6167size_t len, patlen;61686169assert (str != NULL);6170assert (pat != NULL);61716172len = strlen (str);6173patlen = strlen (pat);61746175if (patlen <= len)6176{6177str += len - patlen;6178if (STREQ (str, pat))6179*str = '\0';6180}6181return str;6182}61836184void6185lt_debugprintf (const char *file, int line, const char *fmt, ...)6186{6187va_list args;6188if (lt_debug)6189{6190(void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);6191va_start (args, fmt);6192(void) vfprintf (stderr, fmt, args);6193va_end (args);6194}6195}61966197static void6198lt_error_core (int exit_status, const char *file,6199int line, const char *mode,6200const char *message, va_list ap)6201{6202fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);6203vfprintf (stderr, message, ap);6204fprintf (stderr, ".\n");62056206if (exit_status >= 0)6207exit (exit_status);6208}62096210void6211lt_fatal (const char *file, int line, const char *message, ...)6212{6213va_list ap;6214va_start (ap, message);6215lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);6216va_end (ap);6217}62186219static const char *6220nonnull (const char *s)6221{6222return s ? s : "(null)";6223}62246225static const char *6226nonempty (const char *s)6227{6228return (s && !*s) ? "(empty)" : nonnull (s);6229}62306231void6232lt_setenv (const char *name, const char *value)6233{6234lt_debugprintf (__FILE__, __LINE__,6235"(lt_setenv) setting '%s' to '%s'\n",6236nonnull (name), nonnull (value));6237{6238#ifdef HAVE_SETENV6239/* always make a copy, for consistency with !HAVE_SETENV */6240char *str = xstrdup (value);6241setenv (name, str, 1);6242#else6243size_t len = strlen (name) + 1 + strlen (value) + 1;6244char *str = XMALLOC (char, len);6245sprintf (str, "%s=%s", name, value);6246if (putenv (str) != EXIT_SUCCESS)6247{6248XFREE (str);6249}6250#endif6251}6252}62536254char *6255lt_extend_str (const char *orig_value, const char *add, int to_end)6256{6257char *new_value;6258if (orig_value && *orig_value)6259{6260size_t orig_value_len = strlen (orig_value);6261size_t add_len = strlen (add);6262new_value = XMALLOC (char, add_len + orig_value_len + 1);6263if (to_end)6264{6265strcpy (new_value, orig_value);6266strcpy (new_value + orig_value_len, add);6267}6268else6269{6270strcpy (new_value, add);6271strcpy (new_value + add_len, orig_value);6272}6273}6274else6275{6276new_value = xstrdup (add);6277}6278return new_value;6279}62806281void6282lt_update_exe_path (const char *name, const char *value)6283{6284lt_debugprintf (__FILE__, __LINE__,6285"(lt_update_exe_path) modifying '%s' by prepending '%s'\n",6286nonnull (name), nonnull (value));62876288if (name && *name && value && *value)6289{6290char *new_value = lt_extend_str (getenv (name), value, 0);6291/* some systems can't cope with a ':'-terminated path #' */6292size_t len = strlen (new_value);6293while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))6294{6295new_value[--len] = '\0';6296}6297lt_setenv (name, new_value);6298XFREE (new_value);6299}6300}63016302void6303lt_update_lib_path (const char *name, const char *value)6304{6305lt_debugprintf (__FILE__, __LINE__,6306"(lt_update_lib_path) modifying '%s' by prepending '%s'\n",6307nonnull (name), nonnull (value));63086309if (name && *name && value && *value)6310{6311char *new_value = lt_extend_str (getenv (name), value, 0);6312lt_setenv (name, new_value);6313XFREE (new_value);6314}6315}63166317EOF6318case $host_os in6319mingw*)6320cat <<"EOF"63216322/* Prepares an argument vector before calling spawn().6323Note that spawn() does not by itself call the command interpreter6324(getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :6325({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);6326GetVersionEx(&v);6327v.dwPlatformId == VER_PLATFORM_WIN32_NT;6328}) ? "cmd.exe" : "command.com").6329Instead it simply concatenates the arguments, separated by ' ', and calls6330CreateProcess(). We must quote the arguments since Win32 CreateProcess()6331interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a6332special way:6333- Space and tab are interpreted as delimiters. They are not treated as6334delimiters if they are surrounded by double quotes: "...".6335- Unescaped double quotes are removed from the input. Their only effect is6336that within double quotes, space and tab are treated like normal6337characters.6338- Backslashes not followed by double quotes are not special.6339- But 2*n+1 backslashes followed by a double quote become6340n backslashes followed by a double quote (n >= 0):6341\" -> "6342\\\" -> \"6343\\\\\" -> \\"6344*/6345#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"6346#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"6347char **6348prepare_spawn (char **argv)6349{6350size_t argc;6351char **new_argv;6352size_t i;63536354/* Count number of arguments. */6355for (argc = 0; argv[argc] != NULL; argc++)6356;63576358/* Allocate new argument vector. */6359new_argv = XMALLOC (char *, argc + 1);63606361/* Put quoted arguments into the new argument vector. */6362for (i = 0; i < argc; i++)6363{6364const char *string = argv[i];63656366if (string[0] == '\0')6367new_argv[i] = xstrdup ("\"\"");6368else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)6369{6370int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);6371size_t length;6372unsigned int backslashes;6373const char *s;6374char *quoted_string;6375char *p;63766377length = 0;6378backslashes = 0;6379if (quote_around)6380length++;6381for (s = string; *s != '\0'; s++)6382{6383char c = *s;6384if (c == '"')6385length += backslashes + 1;6386length++;6387if (c == '\\')6388backslashes++;6389else6390backslashes = 0;6391}6392if (quote_around)6393length += backslashes + 1;63946395quoted_string = XMALLOC (char, length + 1);63966397p = quoted_string;6398backslashes = 0;6399if (quote_around)6400*p++ = '"';6401for (s = string; *s != '\0'; s++)6402{6403char c = *s;6404if (c == '"')6405{6406unsigned int j;6407for (j = backslashes + 1; j > 0; j--)6408*p++ = '\\';6409}6410*p++ = c;6411if (c == '\\')6412backslashes++;6413else6414backslashes = 0;6415}6416if (quote_around)6417{6418unsigned int j;6419for (j = backslashes; j > 0; j--)6420*p++ = '\\';6421*p++ = '"';6422}6423*p = '\0';64246425new_argv[i] = quoted_string;6426}6427else6428new_argv[i] = (char *) string;6429}6430new_argv[argc] = NULL;64316432return new_argv;6433}6434EOF6435;;6436esac64376438cat <<"EOF"6439void lt_dump_script (FILE* f)6440{6441EOF6442func_emit_wrapper yes |6443$SED -n -e '6444s/^\(.\{79\}\)\(..*\)/\1\6445\2/6446h6447s/\([\\"]\)/\\\1/g6448s/$/\\n/6449s/\([^\n]*\).*/ fputs ("\1", f);/p6450g6451D'6452cat <<"EOF"6453}6454EOF6455}6456# end: func_emit_cwrapperexe_src64576458# func_win32_import_lib_p ARG6459# True if ARG is an import lib, as indicated by $file_magic_cmd6460func_win32_import_lib_p ()6461{6462$debug_cmd64636464case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in6465*import*) : ;;6466*) false ;;6467esac6468}64696470# func_suncc_cstd_abi6471# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!6472# Several compiler flags select an ABI that is incompatible with the6473# Cstd library. Avoid specifying it if any are in CXXFLAGS.6474func_suncc_cstd_abi ()6475{6476$debug_cmd64776478case " $compile_command " in6479*" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)6480suncc_use_cstd_abi=no6481;;6482*)6483suncc_use_cstd_abi=yes6484;;6485esac6486}64876488# func_mode_link arg...6489func_mode_link ()6490{6491$debug_cmd64926493case $host in6494*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)6495# It is impossible to link a dll without this setting, and6496# we shouldn't force the makefile maintainer to figure out6497# what system we are compiling for in order to pass an extra6498# flag for every libtool invocation.6499# allow_undefined=no65006501# FIXME: Unfortunately, there are problems with the above when trying6502# to make a dll that has undefined symbols, in which case not6503# even a static library is built. For now, we need to specify6504# -no-undefined on the libtool link line when we can be certain6505# that all symbols are satisfied, otherwise we get a static library.6506allow_undefined=yes6507;;6508*)6509allow_undefined=yes6510;;6511esac6512libtool_args=$nonopt6513base_compile="$nonopt $@"6514compile_command=$nonopt6515finalize_command=$nonopt65166517compile_rpath=6518finalize_rpath=6519compile_shlibpath=6520finalize_shlibpath=6521convenience=6522old_convenience=6523deplibs=6524old_deplibs=6525compiler_flags=6526linker_flags=6527dllsearchpath=6528lib_search_path=`pwd`6529inst_prefix_dir=6530new_inherited_linker_flags=65316532avoid_version=no6533bindir=6534dlfiles=6535dlprefiles=6536dlself=no6537export_dynamic=no6538export_symbols=6539export_symbols_regex=6540generated=6541libobjs=6542ltlibs=6543module=no6544no_install=no6545objs=6546os2dllname=6547non_pic_objects=6548precious_files_regex=6549prefer_static_libs=no6550preload=false6551prev=6552prevarg=6553release=6554rpath=6555xrpath=6556perm_rpath=6557temp_rpath=6558thread_safe=no6559vinfo=6560vinfo_number=no6561weak_libs=6562single_module=$wl-single_module6563func_infer_tag $base_compile65646565# We need to know -static, to get the right output filenames.6566for arg6567do6568case $arg in6569-shared)6570test yes != "$build_libtool_libs" \6571&& func_fatal_configuration "cannot build a shared library"6572build_old_libs=no6573break6574;;6575-all-static | -static | -static-libtool-libs)6576case $arg in6577-all-static)6578if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then6579func_warning "complete static linking is impossible in this configuration"6580fi6581if test -n "$link_static_flag"; then6582dlopen_self=$dlopen_self_static6583fi6584prefer_static_libs=yes6585;;6586-static)6587if test -z "$pic_flag" && test -n "$link_static_flag"; then6588dlopen_self=$dlopen_self_static6589fi6590prefer_static_libs=built6591;;6592-static-libtool-libs)6593if test -z "$pic_flag" && test -n "$link_static_flag"; then6594dlopen_self=$dlopen_self_static6595fi6596prefer_static_libs=yes6597;;6598esac6599build_libtool_libs=no6600build_old_libs=yes6601break6602;;6603esac6604done66056606# See if our shared archives depend on static archives.6607test -n "$old_archive_from_new_cmds" && build_old_libs=yes66086609# Go through the arguments, transforming them on the way.6610while test "$#" -gt 0; do6611arg=$16612shift6613func_quote_for_eval "$arg"6614qarg=$func_quote_for_eval_unquoted_result6615func_append libtool_args " $func_quote_for_eval_result"66166617# If the previous option needs an argument, assign it.6618if test -n "$prev"; then6619case $prev in6620output)6621func_append compile_command " @OUTPUT@"6622func_append finalize_command " @OUTPUT@"6623;;6624esac66256626case $prev in6627bindir)6628bindir=$arg6629prev=6630continue6631;;6632dlfiles|dlprefiles)6633$preload || {6634# Add the symbol object into the linking commands.6635func_append compile_command " @SYMFILE@"6636func_append finalize_command " @SYMFILE@"6637preload=:6638}6639case $arg in6640*.la | *.lo) ;; # We handle these cases below.6641force)6642if test no = "$dlself"; then6643dlself=needless6644export_dynamic=yes6645fi6646prev=6647continue6648;;6649self)6650if test dlprefiles = "$prev"; then6651dlself=yes6652elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then6653dlself=yes6654else6655dlself=needless6656export_dynamic=yes6657fi6658prev=6659continue6660;;6661*)6662if test dlfiles = "$prev"; then6663func_append dlfiles " $arg"6664else6665func_append dlprefiles " $arg"6666fi6667prev=6668continue6669;;6670esac6671;;6672expsyms)6673export_symbols=$arg6674test -f "$arg" \6675|| func_fatal_error "symbol file '$arg' does not exist"6676prev=6677continue6678;;6679expsyms_regex)6680export_symbols_regex=$arg6681prev=6682continue6683;;6684framework)6685case $host in6686*-*-darwin*)6687case "$deplibs " in6688*" $qarg.ltframework "*) ;;6689*) func_append deplibs " $qarg.ltframework" # this is fixed later6690;;6691esac6692;;6693esac6694prev=6695continue6696;;6697inst_prefix)6698inst_prefix_dir=$arg6699prev=6700continue6701;;6702mllvm)6703# Clang does not use LLVM to link, so we can simply discard any6704# '-mllvm $arg' options when doing the link step.6705prev=6706continue6707;;6708objectlist)6709if test -f "$arg"; then6710save_arg=$arg6711moreargs=6712for fil in `cat "$save_arg"`6713do6714# func_append moreargs " $fil"6715arg=$fil6716# A libtool-controlled object.67176718# Check to see that this really is a libtool object.6719if func_lalib_unsafe_p "$arg"; then6720pic_object=6721non_pic_object=67226723# Read the .lo file6724func_source "$arg"67256726if test -z "$pic_object" ||6727test -z "$non_pic_object" ||6728test none = "$pic_object" &&6729test none = "$non_pic_object"; then6730func_fatal_error "cannot find name of object for '$arg'"6731fi67326733# Extract subdirectory from the argument.6734func_dirname "$arg" "/" ""6735xdir=$func_dirname_result67366737if test none != "$pic_object"; then6738# Prepend the subdirectory the object is found in.6739pic_object=$xdir$pic_object67406741if test dlfiles = "$prev"; then6742if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then6743func_append dlfiles " $pic_object"6744prev=6745continue6746else6747# If libtool objects are unsupported, then we need to preload.6748prev=dlprefiles6749fi6750fi67516752# CHECK ME: I think I busted this. -Ossama6753if test dlprefiles = "$prev"; then6754# Preload the old-style object.6755func_append dlprefiles " $pic_object"6756prev=6757fi67586759# A PIC object.6760func_append libobjs " $pic_object"6761arg=$pic_object6762fi67636764# Non-PIC object.6765if test none != "$non_pic_object"; then6766# Prepend the subdirectory the object is found in.6767non_pic_object=$xdir$non_pic_object67686769# A standard non-PIC object6770func_append non_pic_objects " $non_pic_object"6771if test -z "$pic_object" || test none = "$pic_object"; then6772arg=$non_pic_object6773fi6774else6775# If the PIC object exists, use it instead.6776# $xdir was prepended to $pic_object above.6777non_pic_object=$pic_object6778func_append non_pic_objects " $non_pic_object"6779fi6780else6781# Only an error if not doing a dry-run.6782if $opt_dry_run; then6783# Extract subdirectory from the argument.6784func_dirname "$arg" "/" ""6785xdir=$func_dirname_result67866787func_lo2o "$arg"6788pic_object=$xdir$objdir/$func_lo2o_result6789non_pic_object=$xdir$func_lo2o_result6790func_append libobjs " $pic_object"6791func_append non_pic_objects " $non_pic_object"6792else6793func_fatal_error "'$arg' is not a valid libtool object"6794fi6795fi6796done6797else6798func_fatal_error "link input file '$arg' does not exist"6799fi6800arg=$save_arg6801prev=6802continue6803;;6804os2dllname)6805os2dllname=$arg6806prev=6807continue6808;;6809precious_regex)6810precious_files_regex=$arg6811prev=6812continue6813;;6814release)6815release=-$arg6816prev=6817continue6818;;6819rpath | xrpath)6820# We need an absolute path.6821case $arg in6822[\\/]* | [A-Za-z]:[\\/]*) ;;6823*)6824func_fatal_error "only absolute run-paths are allowed"6825;;6826esac6827if test rpath = "$prev"; then6828case "$rpath " in6829*" $arg "*) ;;6830*) func_append rpath " $arg" ;;6831esac6832else6833case "$xrpath " in6834*" $arg "*) ;;6835*) func_append xrpath " $arg" ;;6836esac6837fi6838prev=6839continue6840;;6841shrext)6842shrext_cmds=$arg6843prev=6844continue6845;;6846weak)6847func_append weak_libs " $arg"6848prev=6849continue6850;;6851xcclinker)6852func_append linker_flags " $qarg"6853func_append compiler_flags " $qarg"6854prev=6855func_append compile_command " $qarg"6856func_append finalize_command " $qarg"6857continue6858;;6859xcompiler)6860func_append compiler_flags " $qarg"6861prev=6862func_append compile_command " $qarg"6863func_append finalize_command " $qarg"6864continue6865;;6866xlinker)6867func_append linker_flags " $qarg"6868func_append compiler_flags " $wl$qarg"6869prev=6870func_append compile_command " $wl$qarg"6871func_append finalize_command " $wl$qarg"6872continue6873;;6874*)6875eval "$prev=\"\$arg\""6876prev=6877continue6878;;6879esac6880fi # test -n "$prev"68816882prevarg=$arg68836884case $arg in6885-all-static)6886if test -n "$link_static_flag"; then6887# See comment for -static flag below, for more details.6888func_append compile_command " $link_static_flag"6889func_append finalize_command " $link_static_flag"6890fi6891continue6892;;68936894-allow-undefined)6895# FIXME: remove this flag sometime in the future.6896func_fatal_error "'-allow-undefined' must not be used because it is the default"6897;;68986899-avoid-version)6900avoid_version=yes6901continue6902;;69036904-bindir)6905prev=bindir6906continue6907;;69086909-dlopen)6910prev=dlfiles6911continue6912;;69136914-dlpreopen)6915prev=dlprefiles6916continue6917;;69186919-export-dynamic)6920export_dynamic=yes6921continue6922;;69236924-export-symbols | -export-symbols-regex)6925if test -n "$export_symbols" || test -n "$export_symbols_regex"; then6926func_fatal_error "more than one -exported-symbols argument is not allowed"6927fi6928if test X-export-symbols = "X$arg"; then6929prev=expsyms6930else6931prev=expsyms_regex6932fi6933continue6934;;69356936-framework)6937prev=framework6938continue6939;;69406941-inst-prefix-dir)6942prev=inst_prefix6943continue6944;;69456946# The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*6947# so, if we see these flags be careful not to treat them like -L6948-L[A-Z][A-Z]*:*)6949case $with_gcc/$host in6950no/*-*-irix* | /*-*-irix*)6951func_append compile_command " $arg"6952func_append finalize_command " $arg"6953;;6954esac6955continue6956;;69576958-L*)6959func_stripname "-L" '' "$arg"6960if test -z "$func_stripname_result"; then6961if test "$#" -gt 0; then6962func_fatal_error "require no space between '-L' and '$1'"6963else6964func_fatal_error "need path for '-L' option"6965fi6966fi6967func_resolve_sysroot "$func_stripname_result"6968dir=$func_resolve_sysroot_result6969# We need an absolute path.6970case $dir in6971[\\/]* | [A-Za-z]:[\\/]*) ;;6972*)6973absdir=`cd "$dir" && pwd`6974test -z "$absdir" && \6975func_fatal_error "cannot determine absolute directory name of '$dir'"6976dir=$absdir6977;;6978esac6979case "$deplibs " in6980*" -L$dir "* | *" $arg "*)6981# Will only happen for absolute or sysroot arguments6982;;6983*)6984# Preserve sysroot, but never include relative directories6985case $dir in6986[\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;6987*) func_append deplibs " -L$dir" ;;6988esac6989func_append lib_search_path " $dir"6990;;6991esac6992case $host in6993*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)6994testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`6995case :$dllsearchpath: in6996*":$dir:"*) ;;6997::) dllsearchpath=$dir;;6998*) func_append dllsearchpath ":$dir";;6999esac7000case :$dllsearchpath: in7001*":$testbindir:"*) ;;7002::) dllsearchpath=$testbindir;;7003*) func_append dllsearchpath ":$testbindir";;7004esac7005;;7006esac7007continue7008;;70097010-l*)7011if test X-lc = "X$arg" || test X-lm = "X$arg"; then7012case $host in7013*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)7014# These systems don't actually have a C or math library (as such)7015continue7016;;7017*-*-os2*)7018# These systems don't actually have a C library (as such)7019test X-lc = "X$arg" && continue7020;;7021*-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)7022# Do not include libc due to us having libc/libc_r.7023test X-lc = "X$arg" && continue7024;;7025*-*-rhapsody* | *-*-darwin1.[012])7026# Rhapsody C and math libraries are in the System framework7027func_append deplibs " System.ltframework"7028continue7029;;7030*-*-sco3.2v5* | *-*-sco5v6*)7031# Causes problems with __ctype7032test X-lc = "X$arg" && continue7033;;7034*-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)7035# Compiler inserts libc in the correct place for threads to work7036test X-lc = "X$arg" && continue7037;;7038esac7039elif test X-lc_r = "X$arg"; then7040case $host in7041*-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)7042# Do not include libc_r directly, use -pthread flag.7043continue7044;;7045esac7046fi7047func_append deplibs " $arg"7048continue7049;;70507051-mllvm)7052prev=mllvm7053continue7054;;70557056-module)7057module=yes7058continue7059;;70607061# Tru64 UNIX uses -model [arg] to determine the layout of C++7062# classes, name mangling, and exception handling.7063# Darwin uses the -arch flag to determine output architecture.7064-model|-arch|-isysroot|--sysroot)7065func_append compiler_flags " $arg"7066func_append compile_command " $arg"7067func_append finalize_command " $arg"7068prev=xcompiler7069continue7070;;70717072-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \7073|-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)7074func_append compiler_flags " $arg"7075func_append compile_command " $arg"7076func_append finalize_command " $arg"7077case "$new_inherited_linker_flags " in7078*" $arg "*) ;;7079* ) func_append new_inherited_linker_flags " $arg" ;;7080esac7081continue7082;;70837084-multi_module)7085single_module=$wl-multi_module7086continue7087;;70887089-no-fast-install)7090fast_install=no7091continue7092;;70937094-no-install)7095case $host in7096*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)7097# The PATH hackery in wrapper scripts is required on Windows7098# and Darwin in order for the loader to find any dlls it needs.7099func_warning "'-no-install' is ignored for $host"7100func_warning "assuming '-no-fast-install' instead"7101fast_install=no7102;;7103*) no_install=yes ;;7104esac7105continue7106;;71077108-no-undefined)7109allow_undefined=no7110continue7111;;71127113-objectlist)7114prev=objectlist7115continue7116;;71177118-os2dllname)7119prev=os2dllname7120continue7121;;71227123-o) prev=output ;;71247125-precious-files-regex)7126prev=precious_regex7127continue7128;;71297130-release)7131prev=release7132continue7133;;71347135-rpath)7136prev=rpath7137continue7138;;71397140-R)7141prev=xrpath7142continue7143;;71447145-R*)7146func_stripname '-R' '' "$arg"7147dir=$func_stripname_result7148# We need an absolute path.7149case $dir in7150[\\/]* | [A-Za-z]:[\\/]*) ;;7151=*)7152func_stripname '=' '' "$dir"7153dir=$lt_sysroot$func_stripname_result7154;;7155*)7156func_fatal_error "only absolute run-paths are allowed"7157;;7158esac7159case "$xrpath " in7160*" $dir "*) ;;7161*) func_append xrpath " $dir" ;;7162esac7163continue7164;;71657166-shared)7167# The effects of -shared are defined in a previous loop.7168continue7169;;71707171-shrext)7172prev=shrext7173continue7174;;71757176-static | -static-libtool-libs)7177# The effects of -static are defined in a previous loop.7178# We used to do the same as -all-static on platforms that7179# didn't have a PIC flag, but the assumption that the effects7180# would be equivalent was wrong. It would break on at least7181# Digital Unix and AIX.7182continue7183;;71847185-thread-safe)7186thread_safe=yes7187continue7188;;71897190-version-info)7191prev=vinfo7192continue7193;;71947195-version-number)7196prev=vinfo7197vinfo_number=yes7198continue7199;;72007201-weak)7202prev=weak7203continue7204;;72057206-Wc,*)7207func_stripname '-Wc,' '' "$arg"7208args=$func_stripname_result7209arg=7210save_ifs=$IFS; IFS=,7211for flag in $args; do7212IFS=$save_ifs7213func_quote_for_eval "$flag"7214func_append arg " $func_quote_for_eval_result"7215func_append compiler_flags " $func_quote_for_eval_result"7216done7217IFS=$save_ifs7218func_stripname ' ' '' "$arg"7219arg=$func_stripname_result7220;;72217222-Wl,*)7223func_stripname '-Wl,' '' "$arg"7224args=$func_stripname_result7225arg=7226save_ifs=$IFS; IFS=,7227for flag in $args; do7228IFS=$save_ifs7229func_quote_for_eval "$flag"7230func_append arg " $wl$func_quote_for_eval_result"7231func_append compiler_flags " $wl$func_quote_for_eval_result"7232func_append linker_flags " $func_quote_for_eval_result"7233done7234IFS=$save_ifs7235func_stripname ' ' '' "$arg"7236arg=$func_stripname_result7237;;72387239-Xcompiler)7240prev=xcompiler7241continue7242;;72437244-Xlinker)7245prev=xlinker7246continue7247;;72487249-XCClinker)7250prev=xcclinker7251continue7252;;72537254# -msg_* for osf cc7255-msg_*)7256func_quote_for_eval "$arg"7257arg=$func_quote_for_eval_result7258;;72597260# Flags to be passed through unchanged, with rationale:7261# -64, -mips[0-9] enable 64-bit mode for the SGI compiler7262# -r[0-9][0-9]* specify processor for the SGI compiler7263# -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler7264# +DA*, +DD* enable 64-bit mode for the HP compiler7265# -q* compiler args for the IBM compiler7266# -m*, -t[45]*, -txscale* architecture-specific flags for GCC7267# -F/path path to uninstalled frameworks, gcc on darwin7268# -p, -pg, --coverage, -fprofile-* profiling flags for GCC7269# -fstack-protector* stack protector flags for GCC7270# @file GCC response files7271# -tp=* Portland pgcc target processor selection7272# --sysroot=* for sysroot support7273# -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization7274# -specs=* GCC specs files7275# -stdlib=* select c++ std lib with clang7276# -fsanitize=* Clang/GCC memory and address sanitizer7277-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \7278-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \7279-O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \7280-specs=*|-fsanitize=*)7281func_quote_for_eval "$arg"7282arg=$func_quote_for_eval_result7283func_append compile_command " $arg"7284func_append finalize_command " $arg"7285func_append compiler_flags " $arg"7286continue7287;;72887289-Z*)7290if test os2 = "`expr $host : '.*\(os2\)'`"; then7291# OS/2 uses -Zxxx to specify OS/2-specific options7292compiler_flags="$compiler_flags $arg"7293func_append compile_command " $arg"7294func_append finalize_command " $arg"7295case $arg in7296-Zlinker | -Zstack)7297prev=xcompiler7298;;7299esac7300continue7301else7302# Otherwise treat like 'Some other compiler flag' below7303func_quote_for_eval "$arg"7304arg=$func_quote_for_eval_result7305fi7306;;73077308# Some other compiler flag.7309-* | +*)7310func_quote_for_eval "$arg"7311arg=$func_quote_for_eval_result7312;;73137314*.$objext)7315# A standard object.7316func_append objs " $arg"7317;;73187319*.lo)7320# A libtool-controlled object.73217322# Check to see that this really is a libtool object.7323if func_lalib_unsafe_p "$arg"; then7324pic_object=7325non_pic_object=73267327# Read the .lo file7328func_source "$arg"73297330if test -z "$pic_object" ||7331test -z "$non_pic_object" ||7332test none = "$pic_object" &&7333test none = "$non_pic_object"; then7334func_fatal_error "cannot find name of object for '$arg'"7335fi73367337# Extract subdirectory from the argument.7338func_dirname "$arg" "/" ""7339xdir=$func_dirname_result73407341test none = "$pic_object" || {7342# Prepend the subdirectory the object is found in.7343pic_object=$xdir$pic_object73447345if test dlfiles = "$prev"; then7346if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then7347func_append dlfiles " $pic_object"7348prev=7349continue7350else7351# If libtool objects are unsupported, then we need to preload.7352prev=dlprefiles7353fi7354fi73557356# CHECK ME: I think I busted this. -Ossama7357if test dlprefiles = "$prev"; then7358# Preload the old-style object.7359func_append dlprefiles " $pic_object"7360prev=7361fi73627363# A PIC object.7364func_append libobjs " $pic_object"7365arg=$pic_object7366}73677368# Non-PIC object.7369if test none != "$non_pic_object"; then7370# Prepend the subdirectory the object is found in.7371non_pic_object=$xdir$non_pic_object73727373# A standard non-PIC object7374func_append non_pic_objects " $non_pic_object"7375if test -z "$pic_object" || test none = "$pic_object"; then7376arg=$non_pic_object7377fi7378else7379# If the PIC object exists, use it instead.7380# $xdir was prepended to $pic_object above.7381non_pic_object=$pic_object7382func_append non_pic_objects " $non_pic_object"7383fi7384else7385# Only an error if not doing a dry-run.7386if $opt_dry_run; then7387# Extract subdirectory from the argument.7388func_dirname "$arg" "/" ""7389xdir=$func_dirname_result73907391func_lo2o "$arg"7392pic_object=$xdir$objdir/$func_lo2o_result7393non_pic_object=$xdir$func_lo2o_result7394func_append libobjs " $pic_object"7395func_append non_pic_objects " $non_pic_object"7396else7397func_fatal_error "'$arg' is not a valid libtool object"7398fi7399fi7400;;74017402*.$libext)7403# An archive.7404func_append deplibs " $arg"7405func_append old_deplibs " $arg"7406continue7407;;74087409*.la)7410# A libtool-controlled library.74117412func_resolve_sysroot "$arg"7413if test dlfiles = "$prev"; then7414# This library was specified with -dlopen.7415func_append dlfiles " $func_resolve_sysroot_result"7416prev=7417elif test dlprefiles = "$prev"; then7418# The library was specified with -dlpreopen.7419func_append dlprefiles " $func_resolve_sysroot_result"7420prev=7421else7422func_append deplibs " $func_resolve_sysroot_result"7423fi7424continue7425;;74267427# Some other compiler argument.7428*)7429# Unknown arguments in both finalize_command and compile_command need7430# to be aesthetically quoted because they are evaled later.7431func_quote_for_eval "$arg"7432arg=$func_quote_for_eval_result7433;;7434esac # arg74357436# Now actually substitute the argument into the commands.7437if test -n "$arg"; then7438func_append compile_command " $arg"7439func_append finalize_command " $arg"7440fi7441done # argument parsing loop74427443test -n "$prev" && \7444func_fatal_help "the '$prevarg' option requires an argument"74457446if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then7447eval arg=\"$export_dynamic_flag_spec\"7448func_append compile_command " $arg"7449func_append finalize_command " $arg"7450fi74517452oldlibs=7453# calculate the name of the file, without its directory7454func_basename "$output"7455outputname=$func_basename_result7456libobjs_save=$libobjs74577458if test -n "$shlibpath_var"; then7459# get the directories listed in $shlibpath_var7460eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`7461else7462shlib_search_path=7463fi7464eval sys_lib_search_path=\"$sys_lib_search_path_spec\"7465eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"74667467# Definition is injected by LT_CONFIG during libtool generation.7468func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"74697470func_dirname "$output" "/" ""7471output_objdir=$func_dirname_result$objdir7472func_to_tool_file "$output_objdir/"7473tool_output_objdir=$func_to_tool_file_result7474# Create the object directory.7475func_mkdir_p "$output_objdir"74767477# Determine the type of output7478case $output in7479"")7480func_fatal_help "you must specify an output file"7481;;7482*.$libext) linkmode=oldlib ;;7483*.lo | *.$objext) linkmode=obj ;;7484*.la) linkmode=lib ;;7485*) linkmode=prog ;; # Anything else should be a program.7486esac74877488specialdeplibs=74897490libs=7491# Find all interdependent deplibs by searching for libraries7492# that are linked more than once (e.g. -la -lb -la)7493for deplib in $deplibs; do7494if $opt_preserve_dup_deps; then7495case "$libs " in7496*" $deplib "*) func_append specialdeplibs " $deplib" ;;7497esac7498fi7499func_append libs " $deplib"7500done75017502if test lib = "$linkmode"; then7503libs="$predeps $libs $compiler_lib_search_path $postdeps"75047505# Compute libraries that are listed more than once in $predeps7506# $postdeps and mark them as special (i.e., whose duplicates are7507# not to be eliminated).7508pre_post_deps=7509if $opt_duplicate_compiler_generated_deps; then7510for pre_post_dep in $predeps $postdeps; do7511case "$pre_post_deps " in7512*" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;7513esac7514func_append pre_post_deps " $pre_post_dep"7515done7516fi7517pre_post_deps=7518fi75197520deplibs=7521newdependency_libs=7522newlib_search_path=7523need_relink=no # whether we're linking any uninstalled libtool libraries7524notinst_deplibs= # not-installed libtool libraries7525notinst_path= # paths that contain not-installed libtool libraries75267527case $linkmode in7528lib)7529passes="conv dlpreopen link"7530for file in $dlfiles $dlprefiles; do7531case $file in7532*.la) ;;7533*)7534func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"7535;;7536esac7537done7538;;7539prog)7540compile_deplibs=7541finalize_deplibs=7542alldeplibs=false7543newdlfiles=7544newdlprefiles=7545passes="conv scan dlopen dlpreopen link"7546;;7547*) passes="conv"7548;;7549esac75507551for pass in $passes; do7552# The preopen pass in lib mode reverses $deplibs; put it back here7553# so that -L comes before libs that need it for instance...7554if test lib,link = "$linkmode,$pass"; then7555## FIXME: Find the place where the list is rebuilt in the wrong7556## order, and fix it there properly7557tmp_deplibs=7558for deplib in $deplibs; do7559tmp_deplibs="$deplib $tmp_deplibs"7560done7561deplibs=$tmp_deplibs7562fi75637564if test lib,link = "$linkmode,$pass" ||7565test prog,scan = "$linkmode,$pass"; then7566libs=$deplibs7567deplibs=7568fi7569if test prog = "$linkmode"; then7570case $pass in7571dlopen) libs=$dlfiles ;;7572dlpreopen) libs=$dlprefiles ;;7573link)7574libs="$deplibs %DEPLIBS%"7575test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"7576;;7577esac7578fi7579if test lib,dlpreopen = "$linkmode,$pass"; then7580# Collect and forward deplibs of preopened libtool libs7581for lib in $dlprefiles; do7582# Ignore non-libtool-libs7583dependency_libs=7584func_resolve_sysroot "$lib"7585case $lib in7586*.la) func_source "$func_resolve_sysroot_result" ;;7587esac75887589# Collect preopened libtool deplibs, except any this library7590# has declared as weak libs7591for deplib in $dependency_libs; do7592func_basename "$deplib"7593deplib_base=$func_basename_result7594case " $weak_libs " in7595*" $deplib_base "*) ;;7596*) func_append deplibs " $deplib" ;;7597esac7598done7599done7600libs=$dlprefiles7601fi7602if test dlopen = "$pass"; then7603# Collect dlpreopened libraries7604save_deplibs=$deplibs7605deplibs=7606fi76077608for deplib in $libs; do7609lib=7610found=false7611case $deplib in7612-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \7613|-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)7614if test prog,link = "$linkmode,$pass"; then7615compile_deplibs="$deplib $compile_deplibs"7616finalize_deplibs="$deplib $finalize_deplibs"7617else7618func_append compiler_flags " $deplib"7619if test lib = "$linkmode"; then7620case "$new_inherited_linker_flags " in7621*" $deplib "*) ;;7622* ) func_append new_inherited_linker_flags " $deplib" ;;7623esac7624fi7625fi7626continue7627;;7628-l*)7629if test lib != "$linkmode" && test prog != "$linkmode"; then7630func_warning "'-l' is ignored for archives/objects"7631continue7632fi7633func_stripname '-l' '' "$deplib"7634name=$func_stripname_result7635if test lib = "$linkmode"; then7636searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"7637else7638searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"7639fi7640for searchdir in $searchdirs; do7641for search_ext in .la $std_shrext .so .a; do7642# Search the libtool library7643lib=$searchdir/lib$name$search_ext7644if test -f "$lib"; then7645if test .la = "$search_ext"; then7646found=:7647else7648found=false7649fi7650break 27651fi7652done7653done7654if $found; then7655# deplib is a libtool library7656# If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,7657# We need to do some special things here, and not later.7658if test yes = "$allow_libtool_libs_with_static_runtimes"; then7659case " $predeps $postdeps " in7660*" $deplib "*)7661if func_lalib_p "$lib"; then7662library_names=7663old_library=7664func_source "$lib"7665for l in $old_library $library_names; do7666ll=$l7667done7668if test "X$ll" = "X$old_library"; then # only static version available7669found=false7670func_dirname "$lib" "" "."7671ladir=$func_dirname_result7672lib=$ladir/$old_library7673if test prog,link = "$linkmode,$pass"; then7674compile_deplibs="$deplib $compile_deplibs"7675finalize_deplibs="$deplib $finalize_deplibs"7676else7677deplibs="$deplib $deplibs"7678test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"7679fi7680continue7681fi7682fi7683;;7684*) ;;7685esac7686fi7687else7688# deplib doesn't seem to be a libtool library7689if test prog,link = "$linkmode,$pass"; then7690compile_deplibs="$deplib $compile_deplibs"7691finalize_deplibs="$deplib $finalize_deplibs"7692else7693deplibs="$deplib $deplibs"7694test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"7695fi7696continue7697fi7698;; # -l7699*.ltframework)7700if test prog,link = "$linkmode,$pass"; then7701compile_deplibs="$deplib $compile_deplibs"7702finalize_deplibs="$deplib $finalize_deplibs"7703else7704deplibs="$deplib $deplibs"7705if test lib = "$linkmode"; then7706case "$new_inherited_linker_flags " in7707*" $deplib "*) ;;7708* ) func_append new_inherited_linker_flags " $deplib" ;;7709esac7710fi7711fi7712continue7713;;7714-L*)7715case $linkmode in7716lib)7717deplibs="$deplib $deplibs"7718test conv = "$pass" && continue7719newdependency_libs="$deplib $newdependency_libs"7720func_stripname '-L' '' "$deplib"7721func_resolve_sysroot "$func_stripname_result"7722func_append newlib_search_path " $func_resolve_sysroot_result"7723;;7724prog)7725if test conv = "$pass"; then7726deplibs="$deplib $deplibs"7727continue7728fi7729if test scan = "$pass"; then7730deplibs="$deplib $deplibs"7731else7732compile_deplibs="$deplib $compile_deplibs"7733finalize_deplibs="$deplib $finalize_deplibs"7734fi7735func_stripname '-L' '' "$deplib"7736func_resolve_sysroot "$func_stripname_result"7737func_append newlib_search_path " $func_resolve_sysroot_result"7738;;7739*)7740func_warning "'-L' is ignored for archives/objects"7741;;7742esac # linkmode7743continue7744;; # -L7745-R*)7746if test link = "$pass"; then7747func_stripname '-R' '' "$deplib"7748func_resolve_sysroot "$func_stripname_result"7749dir=$func_resolve_sysroot_result7750# Make sure the xrpath contains only unique directories.7751case "$xrpath " in7752*" $dir "*) ;;7753*) func_append xrpath " $dir" ;;7754esac7755fi7756deplibs="$deplib $deplibs"7757continue7758;;7759*.la)7760func_resolve_sysroot "$deplib"7761lib=$func_resolve_sysroot_result7762;;7763*.$libext)7764if test conv = "$pass"; then7765deplibs="$deplib $deplibs"7766continue7767fi7768case $linkmode in7769lib)7770# Linking convenience modules into shared libraries is allowed,7771# but linking other static libraries is non-portable.7772case " $dlpreconveniencelibs " in7773*" $deplib "*) ;;7774*)7775valid_a_lib=false7776case $deplibs_check_method in7777match_pattern*)7778set dummy $deplibs_check_method; shift7779match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`7780if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \7781| $EGREP "$match_pattern_regex" > /dev/null; then7782valid_a_lib=:7783fi7784;;7785pass_all)7786valid_a_lib=:7787;;7788esac7789if $valid_a_lib; then7790echo7791$ECHO "*** Warning: Linking the shared library $output against the"7792$ECHO "*** static library $deplib is not portable!"7793deplibs="$deplib $deplibs"7794else7795echo7796$ECHO "*** Warning: Trying to link with static lib archive $deplib."7797echo "*** I have the capability to make that library automatically link in when"7798echo "*** you link to this library. But I can only do this if you have a"7799echo "*** shared version of the library, which you do not appear to have"7800echo "*** because the file extensions .$libext of this argument makes me believe"7801echo "*** that it is just a static archive that I should not use here."7802fi7803;;7804esac7805continue7806;;7807prog)7808if test link != "$pass"; then7809deplibs="$deplib $deplibs"7810else7811compile_deplibs="$deplib $compile_deplibs"7812finalize_deplibs="$deplib $finalize_deplibs"7813fi7814continue7815;;7816esac # linkmode7817;; # *.$libext7818*.lo | *.$objext)7819if test conv = "$pass"; then7820deplibs="$deplib $deplibs"7821elif test prog = "$linkmode"; then7822if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then7823# If there is no dlopen support or we're linking statically,7824# we need to preload.7825func_append newdlprefiles " $deplib"7826compile_deplibs="$deplib $compile_deplibs"7827finalize_deplibs="$deplib $finalize_deplibs"7828else7829func_append newdlfiles " $deplib"7830fi7831fi7832continue7833;;7834%DEPLIBS%)7835alldeplibs=:7836continue7837;;7838esac # case $deplib78397840$found || test -f "$lib" \7841|| func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"78427843# Check to see that this really is a libtool archive.7844func_lalib_unsafe_p "$lib" \7845|| func_fatal_error "'$lib' is not a valid libtool archive"78467847func_dirname "$lib" "" "."7848ladir=$func_dirname_result78497850dlname=7851dlopen=7852dlpreopen=7853libdir=7854library_names=7855old_library=7856inherited_linker_flags=7857# If the library was installed with an old release of libtool,7858# it will not redefine variables installed, or shouldnotlink7859installed=yes7860shouldnotlink=no7861avoidtemprpath=786278637864# Read the .la file7865func_source "$lib"78667867# Convert "-framework foo" to "foo.ltframework"7868if test -n "$inherited_linker_flags"; then7869tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`7870for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do7871case " $new_inherited_linker_flags " in7872*" $tmp_inherited_linker_flag "*) ;;7873*) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;7874esac7875done7876fi7877dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`7878if test lib,link = "$linkmode,$pass" ||7879test prog,scan = "$linkmode,$pass" ||7880{ test prog != "$linkmode" && test lib != "$linkmode"; }; then7881test -n "$dlopen" && func_append dlfiles " $dlopen"7882test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"7883fi78847885if test conv = "$pass"; then7886# Only check for convenience libraries7887deplibs="$lib $deplibs"7888if test -z "$libdir"; then7889if test -z "$old_library"; then7890func_fatal_error "cannot find name of link library for '$lib'"7891fi7892# It is a libtool convenience library, so add in its objects.7893func_append convenience " $ladir/$objdir/$old_library"7894func_append old_convenience " $ladir/$objdir/$old_library"7895tmp_libs=7896for deplib in $dependency_libs; do7897deplibs="$deplib $deplibs"7898if $opt_preserve_dup_deps; then7899case "$tmp_libs " in7900*" $deplib "*) func_append specialdeplibs " $deplib" ;;7901esac7902fi7903func_append tmp_libs " $deplib"7904done7905elif test prog != "$linkmode" && test lib != "$linkmode"; then7906func_fatal_error "'$lib' is not a convenience library"7907fi7908continue7909fi # $pass = conv791079117912# Get the name of the library we link against.7913linklib=7914if test -n "$old_library" &&7915{ test yes = "$prefer_static_libs" ||7916test built,no = "$prefer_static_libs,$installed"; }; then7917linklib=$old_library7918else7919for l in $old_library $library_names; do7920linklib=$l7921done7922fi7923if test -z "$linklib"; then7924func_fatal_error "cannot find name of link library for '$lib'"7925fi79267927# This library was specified with -dlopen.7928if test dlopen = "$pass"; then7929test -z "$libdir" \7930&& func_fatal_error "cannot -dlopen a convenience library: '$lib'"7931if test -z "$dlname" ||7932test yes != "$dlopen_support" ||7933test no = "$build_libtool_libs"7934then7935# If there is no dlname, no dlopen support or we're linking7936# statically, we need to preload. We also need to preload any7937# dependent libraries so libltdl's deplib preloader doesn't7938# bomb out in the load deplibs phase.7939func_append dlprefiles " $lib $dependency_libs"7940else7941func_append newdlfiles " $lib"7942fi7943continue7944fi # $pass = dlopen79457946# We need an absolute path.7947case $ladir in7948[\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;7949*)7950abs_ladir=`cd "$ladir" && pwd`7951if test -z "$abs_ladir"; then7952func_warning "cannot determine absolute directory name of '$ladir'"7953func_warning "passing it literally to the linker, although it might fail"7954abs_ladir=$ladir7955fi7956;;7957esac7958func_basename "$lib"7959laname=$func_basename_result79607961# Find the relevant object directory and library name.7962if test yes = "$installed"; then7963if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then7964func_warning "library '$lib' was moved."7965dir=$ladir7966absdir=$abs_ladir7967libdir=$abs_ladir7968else7969dir=$lt_sysroot$libdir7970absdir=$lt_sysroot$libdir7971fi7972test yes = "$hardcode_automatic" && avoidtemprpath=yes7973else7974if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then7975dir=$ladir7976absdir=$abs_ladir7977# Remove this search path later7978func_append notinst_path " $abs_ladir"7979else7980dir=$ladir/$objdir7981absdir=$abs_ladir/$objdir7982# Remove this search path later7983func_append notinst_path " $abs_ladir"7984fi7985fi # $installed = yes7986func_stripname 'lib' '.la' "$laname"7987name=$func_stripname_result79887989# This library was specified with -dlpreopen.7990if test dlpreopen = "$pass"; then7991if test -z "$libdir" && test prog = "$linkmode"; then7992func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"7993fi7994case $host in7995# special handling for platforms with PE-DLLs.7996*cygwin* | *mingw* | *cegcc* )7997# Linker will automatically link against shared library if both7998# static and shared are present. Therefore, ensure we extract7999# symbols from the import library if a shared library is present8000# (otherwise, the dlopen module name will be incorrect). We do8001# this by putting the import library name into $newdlprefiles.8002# We recover the dlopen module name by 'saving' the la file8003# name in a special purpose variable, and (later) extracting the8004# dlname from the la file.8005if test -n "$dlname"; then8006func_tr_sh "$dir/$linklib"8007eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"8008func_append newdlprefiles " $dir/$linklib"8009else8010func_append newdlprefiles " $dir/$old_library"8011# Keep a list of preopened convenience libraries to check8012# that they are being used correctly in the link pass.8013test -z "$libdir" && \8014func_append dlpreconveniencelibs " $dir/$old_library"8015fi8016;;8017* )8018# Prefer using a static library (so that no silly _DYNAMIC symbols8019# are required to link).8020if test -n "$old_library"; then8021func_append newdlprefiles " $dir/$old_library"8022# Keep a list of preopened convenience libraries to check8023# that they are being used correctly in the link pass.8024test -z "$libdir" && \8025func_append dlpreconveniencelibs " $dir/$old_library"8026# Otherwise, use the dlname, so that lt_dlopen finds it.8027elif test -n "$dlname"; then8028func_append newdlprefiles " $dir/$dlname"8029else8030func_append newdlprefiles " $dir/$linklib"8031fi8032;;8033esac8034fi # $pass = dlpreopen80358036if test -z "$libdir"; then8037# Link the convenience library8038if test lib = "$linkmode"; then8039deplibs="$dir/$old_library $deplibs"8040elif test prog,link = "$linkmode,$pass"; then8041compile_deplibs="$dir/$old_library $compile_deplibs"8042finalize_deplibs="$dir/$old_library $finalize_deplibs"8043else8044deplibs="$lib $deplibs" # used for prog,scan pass8045fi8046continue8047fi804880498050if test prog = "$linkmode" && test link != "$pass"; then8051func_append newlib_search_path " $ladir"8052deplibs="$lib $deplibs"80538054linkalldeplibs=false8055if test no != "$link_all_deplibs" || test -z "$library_names" ||8056test no = "$build_libtool_libs"; then8057linkalldeplibs=:8058fi80598060tmp_libs=8061for deplib in $dependency_libs; do8062case $deplib in8063-L*) func_stripname '-L' '' "$deplib"8064func_resolve_sysroot "$func_stripname_result"8065func_append newlib_search_path " $func_resolve_sysroot_result"8066;;8067esac8068# Need to link against all dependency_libs?8069if $linkalldeplibs; then8070deplibs="$deplib $deplibs"8071else8072# Need to hardcode shared library paths8073# or/and link against static libraries8074newdependency_libs="$deplib $newdependency_libs"8075fi8076if $opt_preserve_dup_deps; then8077case "$tmp_libs " in8078*" $deplib "*) func_append specialdeplibs " $deplib" ;;8079esac8080fi8081func_append tmp_libs " $deplib"8082done # for deplib8083continue8084fi # $linkmode = prog...80858086if test prog,link = "$linkmode,$pass"; then8087if test -n "$library_names" &&8088{ { test no = "$prefer_static_libs" ||8089test built,yes = "$prefer_static_libs,$installed"; } ||8090test -z "$old_library"; }; then8091# We need to hardcode the library path8092if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then8093# Make sure the rpath contains only unique directories.8094case $temp_rpath: in8095*"$absdir:"*) ;;8096*) func_append temp_rpath "$absdir:" ;;8097esac8098fi80998100# Hardcode the library path.8101# Skip directories that are in the system default run-time8102# search path.8103case " $sys_lib_dlsearch_path " in8104*" $absdir "*) ;;8105*)8106case "$compile_rpath " in8107*" $absdir "*) ;;8108*) func_append compile_rpath " $absdir" ;;8109esac8110;;8111esac8112case " $sys_lib_dlsearch_path " in8113*" $libdir "*) ;;8114*)8115case "$finalize_rpath " in8116*" $libdir "*) ;;8117*) func_append finalize_rpath " $libdir" ;;8118esac8119;;8120esac8121fi # $linkmode,$pass = prog,link...81228123if $alldeplibs &&8124{ test pass_all = "$deplibs_check_method" ||8125{ test yes = "$build_libtool_libs" &&8126test -n "$library_names"; }; }; then8127# We only need to search for static libraries8128continue8129fi8130fi81318132link_static=no # Whether the deplib will be linked statically8133use_static_libs=$prefer_static_libs8134if test built = "$use_static_libs" && test yes = "$installed"; then8135use_static_libs=no8136fi8137if test -n "$library_names" &&8138{ test no = "$use_static_libs" || test -z "$old_library"; }; then8139case $host in8140*cygwin* | *mingw* | *cegcc* | *os2*)8141# No point in relinking DLLs because paths are not encoded8142func_append notinst_deplibs " $lib"8143need_relink=no8144;;8145*)8146if test no = "$installed"; then8147func_append notinst_deplibs " $lib"8148need_relink=yes8149fi8150;;8151esac8152# This is a shared library81538154# Warn about portability, can't link against -module's on some8155# systems (darwin). Don't bleat about dlopened modules though!8156dlopenmodule=8157for dlpremoduletest in $dlprefiles; do8158if test "X$dlpremoduletest" = "X$lib"; then8159dlopenmodule=$dlpremoduletest8160break8161fi8162done8163if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then8164echo8165if test prog = "$linkmode"; then8166$ECHO "*** Warning: Linking the executable $output against the loadable module"8167else8168$ECHO "*** Warning: Linking the shared library $output against the loadable module"8169fi8170$ECHO "*** $linklib is not portable!"8171fi8172if test lib = "$linkmode" &&8173test yes = "$hardcode_into_libs"; then8174# Hardcode the library path.8175# Skip directories that are in the system default run-time8176# search path.8177case " $sys_lib_dlsearch_path " in8178*" $absdir "*) ;;8179*)8180case "$compile_rpath " in8181*" $absdir "*) ;;8182*) func_append compile_rpath " $absdir" ;;8183esac8184;;8185esac8186case " $sys_lib_dlsearch_path " in8187*" $libdir "*) ;;8188*)8189case "$finalize_rpath " in8190*" $libdir "*) ;;8191*) func_append finalize_rpath " $libdir" ;;8192esac8193;;8194esac8195fi81968197if test -n "$old_archive_from_expsyms_cmds"; then8198# figure out the soname8199set dummy $library_names8200shift8201realname=$18202shift8203libname=`eval "\\$ECHO \"$libname_spec\""`8204# use dlname if we got it. it's perfectly good, no?8205if test -n "$dlname"; then8206soname=$dlname8207elif test -n "$soname_spec"; then8208# bleh windows8209case $host in8210*cygwin* | mingw* | *cegcc* | *os2*)8211func_arith $current - $age8212major=$func_arith_result8213versuffix=-$major8214;;8215esac8216eval soname=\"$soname_spec\"8217else8218soname=$realname8219fi82208221# Make a new name for the extract_expsyms_cmds to use8222soroot=$soname8223func_basename "$soroot"8224soname=$func_basename_result8225func_stripname 'lib' '.dll' "$soname"8226newlib=libimp-$func_stripname_result.a82278228# If the library has no export list, then create one now8229if test -f "$output_objdir/$soname-def"; then :8230else8231func_verbose "extracting exported symbol list from '$soname'"8232func_execute_cmds "$extract_expsyms_cmds" 'exit $?'8233fi82348235# Create $newlib8236if test -f "$output_objdir/$newlib"; then :; else8237func_verbose "generating import library for '$soname'"8238func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'8239fi8240# make sure the library variables are pointing to the new library8241dir=$output_objdir8242linklib=$newlib8243fi # test -n "$old_archive_from_expsyms_cmds"82448245if test prog = "$linkmode" || test relink != "$opt_mode"; then8246add_shlibpath=8247add_dir=8248add=8249lib_linked=yes8250case $hardcode_action in8251immediate | unsupported)8252if test no = "$hardcode_direct"; then8253add=$dir/$linklib8254case $host in8255*-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;8256*-*-sysv4*uw2*) add_dir=-L$dir ;;8257*-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \8258*-*-unixware7*) add_dir=-L$dir ;;8259*-*-darwin* )8260# if the lib is a (non-dlopened) module then we cannot8261# link against it, someone is ignoring the earlier warnings8262if /usr/bin/file -L $add 2> /dev/null |8263$GREP ": [^:]* bundle" >/dev/null; then8264if test "X$dlopenmodule" != "X$lib"; then8265$ECHO "*** Warning: lib $linklib is a module, not a shared library"8266if test -z "$old_library"; then8267echo8268echo "*** And there doesn't seem to be a static archive available"8269echo "*** The link will probably fail, sorry"8270else8271add=$dir/$old_library8272fi8273elif test -n "$old_library"; then8274add=$dir/$old_library8275fi8276fi8277esac8278elif test no = "$hardcode_minus_L"; then8279case $host in8280*-*-sunos*) add_shlibpath=$dir ;;8281esac8282add_dir=-L$dir8283add=-l$name8284elif test no = "$hardcode_shlibpath_var"; then8285add_shlibpath=$dir8286add=-l$name8287else8288lib_linked=no8289fi8290;;8291relink)8292if test yes = "$hardcode_direct" &&8293test no = "$hardcode_direct_absolute"; then8294add=$dir/$linklib8295elif test yes = "$hardcode_minus_L"; then8296add_dir=-L$absdir8297# Try looking first in the location we're being installed to.8298if test -n "$inst_prefix_dir"; then8299case $libdir in8300[\\/]*)8301func_append add_dir " -L$inst_prefix_dir$libdir"8302;;8303esac8304fi8305add=-l$name8306elif test yes = "$hardcode_shlibpath_var"; then8307add_shlibpath=$dir8308add=-l$name8309else8310lib_linked=no8311fi8312;;8313*) lib_linked=no ;;8314esac83158316if test yes != "$lib_linked"; then8317func_fatal_configuration "unsupported hardcode properties"8318fi83198320if test -n "$add_shlibpath"; then8321case :$compile_shlibpath: in8322*":$add_shlibpath:"*) ;;8323*) func_append compile_shlibpath "$add_shlibpath:" ;;8324esac8325fi8326if test prog = "$linkmode"; then8327test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"8328test -n "$add" && compile_deplibs="$add $compile_deplibs"8329else8330test -n "$add_dir" && deplibs="$add_dir $deplibs"8331test -n "$add" && deplibs="$add $deplibs"8332if test yes != "$hardcode_direct" &&8333test yes != "$hardcode_minus_L" &&8334test yes = "$hardcode_shlibpath_var"; then8335case :$finalize_shlibpath: in8336*":$libdir:"*) ;;8337*) func_append finalize_shlibpath "$libdir:" ;;8338esac8339fi8340fi8341fi83428343if test prog = "$linkmode" || test relink = "$opt_mode"; then8344add_shlibpath=8345add_dir=8346add=8347# Finalize command for both is simple: just hardcode it.8348if test yes = "$hardcode_direct" &&8349test no = "$hardcode_direct_absolute"; then8350add=$libdir/$linklib8351elif test yes = "$hardcode_minus_L"; then8352add_dir=-L$libdir8353add=-l$name8354elif test yes = "$hardcode_shlibpath_var"; then8355case :$finalize_shlibpath: in8356*":$libdir:"*) ;;8357*) func_append finalize_shlibpath "$libdir:" ;;8358esac8359add=-l$name8360elif test yes = "$hardcode_automatic"; then8361if test -n "$inst_prefix_dir" &&8362test -f "$inst_prefix_dir$libdir/$linklib"; then8363add=$inst_prefix_dir$libdir/$linklib8364else8365add=$libdir/$linklib8366fi8367else8368# We cannot seem to hardcode it, guess we'll fake it.8369add_dir=-L$libdir8370# Try looking first in the location we're being installed to.8371if test -n "$inst_prefix_dir"; then8372case $libdir in8373[\\/]*)8374func_append add_dir " -L$inst_prefix_dir$libdir"8375;;8376esac8377fi8378add=-l$name8379fi83808381if test prog = "$linkmode"; then8382test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"8383test -n "$add" && finalize_deplibs="$add $finalize_deplibs"8384else8385test -n "$add_dir" && deplibs="$add_dir $deplibs"8386test -n "$add" && deplibs="$add $deplibs"8387fi8388fi8389elif test prog = "$linkmode"; then8390# Here we assume that one of hardcode_direct or hardcode_minus_L8391# is not unsupported. This is valid on all known static and8392# shared platforms.8393if test unsupported != "$hardcode_direct"; then8394test -n "$old_library" && linklib=$old_library8395compile_deplibs="$dir/$linklib $compile_deplibs"8396finalize_deplibs="$dir/$linklib $finalize_deplibs"8397else8398compile_deplibs="-l$name -L$dir $compile_deplibs"8399finalize_deplibs="-l$name -L$dir $finalize_deplibs"8400fi8401elif test yes = "$build_libtool_libs"; then8402# Not a shared library8403if test pass_all != "$deplibs_check_method"; then8404# We're trying link a shared library against a static one8405# but the system doesn't support it.84068407# Just print a warning and add the library to dependency_libs so8408# that the program can be linked against the static library.8409echo8410$ECHO "*** Warning: This system cannot link to static lib archive $lib."8411echo "*** I have the capability to make that library automatically link in when"8412echo "*** you link to this library. But I can only do this if you have a"8413echo "*** shared version of the library, which you do not appear to have."8414if test yes = "$module"; then8415echo "*** But as you try to build a module library, libtool will still create "8416echo "*** a static module, that should work as long as the dlopening application"8417echo "*** is linked with the -dlopen flag to resolve symbols at runtime."8418if test -z "$global_symbol_pipe"; then8419echo8420echo "*** However, this would only work if libtool was able to extract symbol"8421echo "*** lists from a program, using 'nm' or equivalent, but libtool could"8422echo "*** not find such a program. So, this module is probably useless."8423echo "*** 'nm' from GNU binutils and a full rebuild may help."8424fi8425if test no = "$build_old_libs"; then8426build_libtool_libs=module8427build_old_libs=yes8428else8429build_libtool_libs=no8430fi8431fi8432else8433deplibs="$dir/$old_library $deplibs"8434link_static=yes8435fi8436fi # link shared/static library?84378438if test lib = "$linkmode"; then8439if test -n "$dependency_libs" &&8440{ test yes != "$hardcode_into_libs" ||8441test yes = "$build_old_libs" ||8442test yes = "$link_static"; }; then8443# Extract -R from dependency_libs8444temp_deplibs=8445for libdir in $dependency_libs; do8446case $libdir in8447-R*) func_stripname '-R' '' "$libdir"8448temp_xrpath=$func_stripname_result8449case " $xrpath " in8450*" $temp_xrpath "*) ;;8451*) func_append xrpath " $temp_xrpath";;8452esac;;8453*) func_append temp_deplibs " $libdir";;8454esac8455done8456dependency_libs=$temp_deplibs8457fi84588459func_append newlib_search_path " $absdir"8460# Link against this library8461test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"8462# ... and its dependency_libs8463tmp_libs=8464for deplib in $dependency_libs; do8465newdependency_libs="$deplib $newdependency_libs"8466case $deplib in8467-L*) func_stripname '-L' '' "$deplib"8468func_resolve_sysroot "$func_stripname_result";;8469*) func_resolve_sysroot "$deplib" ;;8470esac8471if $opt_preserve_dup_deps; then8472case "$tmp_libs " in8473*" $func_resolve_sysroot_result "*)8474func_append specialdeplibs " $func_resolve_sysroot_result" ;;8475esac8476fi8477func_append tmp_libs " $func_resolve_sysroot_result"8478done84798480if test no != "$link_all_deplibs"; then8481# Add the search paths of all dependency libraries8482for deplib in $dependency_libs; do8483path=8484case $deplib in8485-L*) path=$deplib ;;8486*.la)8487func_resolve_sysroot "$deplib"8488deplib=$func_resolve_sysroot_result8489func_dirname "$deplib" "" "."8490dir=$func_dirname_result8491# We need an absolute path.8492case $dir in8493[\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;8494*)8495absdir=`cd "$dir" && pwd`8496if test -z "$absdir"; then8497func_warning "cannot determine absolute directory name of '$dir'"8498absdir=$dir8499fi8500;;8501esac8502if $GREP "^installed=no" $deplib > /dev/null; then8503case $host in8504*-*-darwin*)8505depdepl=8506eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`8507if test -n "$deplibrary_names"; then8508for tmp in $deplibrary_names; do8509depdepl=$tmp8510done8511if test -f "$absdir/$objdir/$depdepl"; then8512depdepl=$absdir/$objdir/$depdepl8513darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`8514if test -z "$darwin_install_name"; then8515darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`8516fi8517func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"8518func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"8519path=8520fi8521fi8522;;8523*)8524path=-L$absdir/$objdir8525;;8526esac8527else8528eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`8529test -z "$libdir" && \8530func_fatal_error "'$deplib' is not a valid libtool archive"8531test "$absdir" != "$libdir" && \8532func_warning "'$deplib' seems to be moved"85338534path=-L$absdir8535fi8536;;8537esac8538case " $deplibs " in8539*" $path "*) ;;8540*) deplibs="$path $deplibs" ;;8541esac8542done8543fi # link_all_deplibs != no8544fi # linkmode = lib8545done # for deplib in $libs8546if test link = "$pass"; then8547if test prog = "$linkmode"; then8548compile_deplibs="$new_inherited_linker_flags $compile_deplibs"8549finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"8550else8551compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`8552fi8553fi8554dependency_libs=$newdependency_libs8555if test dlpreopen = "$pass"; then8556# Link the dlpreopened libraries before other libraries8557for deplib in $save_deplibs; do8558deplibs="$deplib $deplibs"8559done8560fi8561if test dlopen != "$pass"; then8562test conv = "$pass" || {8563# Make sure lib_search_path contains only unique directories.8564lib_search_path=8565for dir in $newlib_search_path; do8566case "$lib_search_path " in8567*" $dir "*) ;;8568*) func_append lib_search_path " $dir" ;;8569esac8570done8571newlib_search_path=8572}85738574if test prog,link = "$linkmode,$pass"; then8575vars="compile_deplibs finalize_deplibs"8576else8577vars=deplibs8578fi8579for var in $vars dependency_libs; do8580# Add libraries to $var in reverse order8581eval tmp_libs=\"\$$var\"8582new_libs=8583for deplib in $tmp_libs; do8584# FIXME: Pedantically, this is the right thing to do, so8585# that some nasty dependency loop isn't accidentally8586# broken:8587#new_libs="$deplib $new_libs"8588# Pragmatically, this seems to cause very few problems in8589# practice:8590case $deplib in8591-L*) new_libs="$deplib $new_libs" ;;8592-R*) ;;8593*)8594# And here is the reason: when a library appears more8595# than once as an explicit dependence of a library, or8596# is implicitly linked in more than once by the8597# compiler, it is considered special, and multiple8598# occurrences thereof are not removed. Compare this8599# with having the same library being listed as a8600# dependency of multiple other libraries: in this case,8601# we know (pedantically, we assume) the library does not8602# need to be listed more than once, so we keep only the8603# last copy. This is not always right, but it is rare8604# enough that we require users that really mean to play8605# such unportable linking tricks to link the library8606# using -Wl,-lname, so that libtool does not consider it8607# for duplicate removal.8608case " $specialdeplibs " in8609*" $deplib "*) new_libs="$deplib $new_libs" ;;8610*)8611case " $new_libs " in8612*" $deplib "*) ;;8613*) new_libs="$deplib $new_libs" ;;8614esac8615;;8616esac8617;;8618esac8619done8620tmp_libs=8621for deplib in $new_libs; do8622case $deplib in8623-L*)8624case " $tmp_libs " in8625*" $deplib "*) ;;8626*) func_append tmp_libs " $deplib" ;;8627esac8628;;8629*) func_append tmp_libs " $deplib" ;;8630esac8631done8632eval $var=\"$tmp_libs\"8633done # for var8634fi86358636# Add Sun CC postdeps if required:8637test CXX = "$tagname" && {8638case $host_os in8639linux*)8640case `$CC -V 2>&1 | sed 5q` in8641*Sun\ C*) # Sun C++ 5.98642func_suncc_cstd_abi86438644if test no != "$suncc_use_cstd_abi"; then8645func_append postdeps ' -library=Cstd -library=Crun'8646fi8647;;8648esac8649;;86508651solaris*)8652func_cc_basename "$CC"8653case $func_cc_basename_result in8654CC* | sunCC*)8655func_suncc_cstd_abi86568657if test no != "$suncc_use_cstd_abi"; then8658func_append postdeps ' -library=Cstd -library=Crun'8659fi8660;;8661esac8662;;8663esac8664}86658666# Last step: remove runtime libs from dependency_libs8667# (they stay in deplibs)8668tmp_libs=8669for i in $dependency_libs; do8670case " $predeps $postdeps $compiler_lib_search_path " in8671*" $i "*)8672i=8673;;8674esac8675if test -n "$i"; then8676func_append tmp_libs " $i"8677fi8678done8679dependency_libs=$tmp_libs8680done # for pass8681if test prog = "$linkmode"; then8682dlfiles=$newdlfiles8683fi8684if test prog = "$linkmode" || test lib = "$linkmode"; then8685dlprefiles=$newdlprefiles8686fi86878688case $linkmode in8689oldlib)8690if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then8691func_warning "'-dlopen' is ignored for archives"8692fi86938694case " $deplibs" in8695*\ -l* | *\ -L*)8696func_warning "'-l' and '-L' are ignored for archives" ;;8697esac86988699test -n "$rpath" && \8700func_warning "'-rpath' is ignored for archives"87018702test -n "$xrpath" && \8703func_warning "'-R' is ignored for archives"87048705test -n "$vinfo" && \8706func_warning "'-version-info/-version-number' is ignored for archives"87078708test -n "$release" && \8709func_warning "'-release' is ignored for archives"87108711test -n "$export_symbols$export_symbols_regex" && \8712func_warning "'-export-symbols' is ignored for archives"87138714# Now set the variables for building old libraries.8715build_libtool_libs=no8716oldlibs=$output8717func_append objs "$old_deplibs"8718;;87198720lib)8721# Make sure we only generate libraries of the form 'libNAME.la'.8722case $outputname in8723lib*)8724func_stripname 'lib' '.la' "$outputname"8725name=$func_stripname_result8726eval shared_ext=\"$shrext_cmds\"8727eval libname=\"$libname_spec\"8728;;8729*)8730test no = "$module" \8731&& func_fatal_help "libtool library '$output' must begin with 'lib'"87328733if test no != "$need_lib_prefix"; then8734# Add the "lib" prefix for modules if required8735func_stripname '' '.la' "$outputname"8736name=$func_stripname_result8737eval shared_ext=\"$shrext_cmds\"8738eval libname=\"$libname_spec\"8739else8740func_stripname '' '.la' "$outputname"8741libname=$func_stripname_result8742fi8743;;8744esac87458746if test -n "$objs"; then8747if test pass_all != "$deplibs_check_method"; then8748func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"8749else8750echo8751$ECHO "*** Warning: Linking the shared library $output against the non-libtool"8752$ECHO "*** objects $objs is not portable!"8753func_append libobjs " $objs"8754fi8755fi87568757test no = "$dlself" \8758|| func_warning "'-dlopen self' is ignored for libtool libraries"87598760set dummy $rpath8761shift8762test 1 -lt "$#" \8763&& func_warning "ignoring multiple '-rpath's for a libtool library"87648765install_libdir=$187668767oldlibs=8768if test -z "$rpath"; then8769if test yes = "$build_libtool_libs"; then8770# Building a libtool convenience library.8771# Some compilers have problems with a '.al' extension so8772# convenience libraries should have the same extension an8773# archive normally would.8774oldlibs="$output_objdir/$libname.$libext $oldlibs"8775build_libtool_libs=convenience8776build_old_libs=yes8777fi87788779test -n "$vinfo" && \8780func_warning "'-version-info/-version-number' is ignored for convenience libraries"87818782test -n "$release" && \8783func_warning "'-release' is ignored for convenience libraries"8784else87858786# Parse the version information argument.8787save_ifs=$IFS; IFS=:8788set dummy $vinfo 0 0 08789shift8790IFS=$save_ifs87918792test -n "$7" && \8793func_fatal_help "too many parameters to '-version-info'"87948795# convert absolute version numbers to libtool ages8796# this retains compatibility with .la files and attempts8797# to make the code below a bit more comprehensible87988799case $vinfo_number in8800yes)8801number_major=$18802number_minor=$28803number_revision=$38804#8805# There are really only two kinds -- those that8806# use the current revision as the major version8807# and those that subtract age and use age as8808# a minor version. But, then there is irix8809# that has an extra 1 added just for fun8810#8811case $version_type in8812# correct linux to gnu/linux during the next big refactor8813darwin|freebsd-elf|linux|osf|windows|none)8814func_arith $number_major + $number_minor8815current=$func_arith_result8816age=$number_minor8817revision=$number_revision8818;;8819freebsd-aout|qnx|sunos)8820current=$number_major8821revision=$number_minor8822age=08823;;8824irix|nonstopux)8825func_arith $number_major + $number_minor8826current=$func_arith_result8827age=$number_minor8828revision=$number_minor8829lt_irix_increment=no8830;;8831*)8832func_fatal_configuration "$modename: unknown library version type '$version_type'"8833;;8834esac8835;;8836no)8837current=$18838revision=$28839age=$38840;;8841esac88428843# Check that each of the things are valid numbers.8844case $current in88450|[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]) ;;8846*)8847func_error "CURRENT '$current' must be a nonnegative integer"8848func_fatal_error "'$vinfo' is not valid version information"8849;;8850esac88518852case $revision in88530|[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]) ;;8854*)8855func_error "REVISION '$revision' must be a nonnegative integer"8856func_fatal_error "'$vinfo' is not valid version information"8857;;8858esac88598860case $age in88610|[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]) ;;8862*)8863func_error "AGE '$age' must be a nonnegative integer"8864func_fatal_error "'$vinfo' is not valid version information"8865;;8866esac88678868if test "$age" -gt "$current"; then8869func_error "AGE '$age' is greater than the current interface number '$current'"8870func_fatal_error "'$vinfo' is not valid version information"8871fi88728873# Calculate the version variables.8874major=8875versuffix=8876verstring=8877case $version_type in8878none) ;;88798880darwin)8881# Like Linux, but with the current version available in8882# verstring for coding it into the library header8883func_arith $current - $age8884major=.$func_arith_result8885versuffix=$major.$age.$revision8886# Darwin ld doesn't like 0 for these options...8887func_arith $current + 18888minor_current=$func_arith_result8889xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"8890verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"8891# On Darwin other compilers8892case $CC in8893nagfor*)8894verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"8895;;8896*)8897verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"8898;;8899esac8900;;89018902freebsd-aout)8903major=.$current8904versuffix=.$current.$revision8905;;89068907freebsd-elf)8908func_arith $current - $age8909major=.$func_arith_result8910versuffix=$major.$age.$revision8911;;89128913irix | nonstopux)8914if test no = "$lt_irix_increment"; then8915func_arith $current - $age8916else8917func_arith $current - $age + 18918fi8919major=$func_arith_result89208921case $version_type in8922nonstopux) verstring_prefix=nonstopux ;;8923*) verstring_prefix=sgi ;;8924esac8925verstring=$verstring_prefix$major.$revision89268927# Add in all the interfaces that we are compatible with.8928loop=$revision8929while test 0 -ne "$loop"; do8930func_arith $revision - $loop8931iface=$func_arith_result8932func_arith $loop - 18933loop=$func_arith_result8934verstring=$verstring_prefix$major.$iface:$verstring8935done89368937# Before this point, $major must not contain '.'.8938major=.$major8939versuffix=$major.$revision8940;;89418942linux) # correct to gnu/linux during the next big refactor8943func_arith $current - $age8944major=.$func_arith_result8945versuffix=$major.$age.$revision8946;;89478948osf)8949func_arith $current - $age8950major=.$func_arith_result8951versuffix=.$current.$age.$revision8952verstring=$current.$age.$revision89538954# Add in all the interfaces that we are compatible with.8955loop=$age8956while test 0 -ne "$loop"; do8957func_arith $current - $loop8958iface=$func_arith_result8959func_arith $loop - 18960loop=$func_arith_result8961verstring=$verstring:$iface.08962done89638964# Make executables depend on our current version.8965func_append verstring ":$current.0"8966;;89678968qnx)8969major=.$current8970versuffix=.$current8971;;89728973sco)8974major=.$current8975versuffix=.$current8976;;89778978sunos)8979major=.$current8980versuffix=.$current.$revision8981;;89828983windows)8984# Use '-' rather than '.', since we only want one8985# extension on DOS 8.3 file systems.8986func_arith $current - $age8987major=$func_arith_result8988versuffix=-$major8989;;89908991*)8992func_fatal_configuration "unknown library version type '$version_type'"8993;;8994esac89958996# Clear the version info if we defaulted, and they specified a release.8997if test -z "$vinfo" && test -n "$release"; then8998major=8999case $version_type in9000darwin)9001# we can't check for "0.0" in archive_cmds due to quoting9002# problems, so we reset it completely9003verstring=9004;;9005*)9006verstring=0.09007;;9008esac9009if test no = "$need_version"; then9010versuffix=9011else9012versuffix=.0.09013fi9014fi90159016# Remove version info from name if versioning should be avoided9017if test yes,no = "$avoid_version,$need_version"; then9018major=9019versuffix=9020verstring=9021fi90229023# Check to see if the archive will have undefined symbols.9024if test yes = "$allow_undefined"; then9025if test unsupported = "$allow_undefined_flag"; then9026if test yes = "$build_old_libs"; then9027func_warning "undefined symbols not allowed in $host shared libraries; building static only"9028build_libtool_libs=no9029else9030func_fatal_error "can't build $host shared library unless -no-undefined is specified"9031fi9032fi9033else9034# Don't allow undefined symbols.9035allow_undefined_flag=$no_undefined_flag9036fi90379038fi90399040func_generate_dlsyms "$libname" "$libname" :9041func_append libobjs " $symfileobj"9042test " " = "$libobjs" && libobjs=90439044if test relink != "$opt_mode"; then9045# Remove our outputs, but don't remove object files since they9046# may have been created when compiling PIC objects.9047removelist=9048tempremovelist=`$ECHO "$output_objdir/*"`9049for p in $tempremovelist; do9050case $p in9051*.$objext | *.gcno)9052;;9053$output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)9054if test -n "$precious_files_regex"; then9055if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&19056then9057continue9058fi9059fi9060func_append removelist " $p"9061;;9062*) ;;9063esac9064done9065test -n "$removelist" && \9066func_show_eval "${RM}r \$removelist"9067fi90689069# Now set the variables for building old libraries.9070if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then9071func_append oldlibs " $output_objdir/$libname.$libext"90729073# Transform .lo files to .o files.9074oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`9075fi90769077# Eliminate all temporary directories.9078#for path in $notinst_path; do9079# lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`9080# deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`9081# dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`9082#done90839084if test -n "$xrpath"; then9085# If the user specified any rpath flags, then add them.9086temp_xrpath=9087for libdir in $xrpath; do9088func_replace_sysroot "$libdir"9089func_append temp_xrpath " -R$func_replace_sysroot_result"9090case "$finalize_rpath " in9091*" $libdir "*) ;;9092*) func_append finalize_rpath " $libdir" ;;9093esac9094done9095if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then9096dependency_libs="$temp_xrpath $dependency_libs"9097fi9098fi90999100# Make sure dlfiles contains only unique files that won't be dlpreopened9101old_dlfiles=$dlfiles9102dlfiles=9103for lib in $old_dlfiles; do9104case " $dlprefiles $dlfiles " in9105*" $lib "*) ;;9106*) func_append dlfiles " $lib" ;;9107esac9108done91099110# Make sure dlprefiles contains only unique files9111old_dlprefiles=$dlprefiles9112dlprefiles=9113for lib in $old_dlprefiles; do9114case "$dlprefiles " in9115*" $lib "*) ;;9116*) func_append dlprefiles " $lib" ;;9117esac9118done91199120if test yes = "$build_libtool_libs"; then9121if test -n "$rpath"; then9122case $host in9123*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)9124# these systems don't actually have a c library (as such)!9125;;9126*-*-rhapsody* | *-*-darwin1.[012])9127# Rhapsody C library is in the System framework9128func_append deplibs " System.ltframework"9129;;9130*-*-netbsd*)9131# Don't link with libc until the a.out ld.so is fixed.9132;;9133*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)9134# Do not include libc due to us having libc/libc_r.9135;;9136*-*-sco3.2v5* | *-*-sco5v6*)9137# Causes problems with __ctype9138;;9139*-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)9140# Compiler inserts libc in the correct place for threads to work9141;;9142*)9143# Add libc to deplibs on all other systems if necessary.9144if test yes = "$build_libtool_need_lc"; then9145func_append deplibs " -lc"9146fi9147;;9148esac9149fi91509151# Transform deplibs into only deplibs that can be linked in shared.9152name_save=$name9153libname_save=$libname9154release_save=$release9155versuffix_save=$versuffix9156major_save=$major9157# I'm not sure if I'm treating the release correctly. I think9158# release should show up in the -l (ie -lgmp5) so we don't want to9159# add it in twice. Is that correct?9160release=9161versuffix=9162major=9163newdeplibs=9164droppeddeps=no9165case $deplibs_check_method in9166pass_all)9167# Don't check for shared/static. Everything works.9168# This might be a little naive. We might want to check9169# whether the library exists or not. But this is on9170# osf3 & osf4 and I'm not really sure... Just9171# implementing what was already the behavior.9172newdeplibs=$deplibs9173;;9174test_compile)9175# This code stresses the "libraries are programs" paradigm to its9176# limits. Maybe even breaks it. We compile a program, linking it9177# against the deplibs as a proxy for the library. Then we can check9178# whether they linked in statically or dynamically with ldd.9179$opt_dry_run || $RM conftest.c9180cat > conftest.c <<EOF9181int main() { return 0; }9182EOF9183$opt_dry_run || $RM conftest9184if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then9185ldd_output=`ldd conftest`9186for i in $deplibs; do9187case $i in9188-l*)9189func_stripname -l '' "$i"9190name=$func_stripname_result9191if test yes = "$allow_libtool_libs_with_static_runtimes"; then9192case " $predeps $postdeps " in9193*" $i "*)9194func_append newdeplibs " $i"9195i=9196;;9197esac9198fi9199if test -n "$i"; then9200libname=`eval "\\$ECHO \"$libname_spec\""`9201deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`9202set dummy $deplib_matches; shift9203deplib_match=$19204if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then9205func_append newdeplibs " $i"9206else9207droppeddeps=yes9208echo9209$ECHO "*** Warning: dynamic linker does not accept needed library $i."9210echo "*** I have the capability to make that library automatically link in when"9211echo "*** you link to this library. But I can only do this if you have a"9212echo "*** shared version of the library, which I believe you do not have"9213echo "*** because a test_compile did reveal that the linker did not use it for"9214echo "*** its dynamic dependency list that programs get resolved with at runtime."9215fi9216fi9217;;9218*)9219func_append newdeplibs " $i"9220;;9221esac9222done9223else9224# Error occurred in the first compile. Let's try to salvage9225# the situation: Compile a separate program for each library.9226for i in $deplibs; do9227case $i in9228-l*)9229func_stripname -l '' "$i"9230name=$func_stripname_result9231$opt_dry_run || $RM conftest9232if $LTCC $LTCFLAGS -o conftest conftest.c $i; then9233ldd_output=`ldd conftest`9234if test yes = "$allow_libtool_libs_with_static_runtimes"; then9235case " $predeps $postdeps " in9236*" $i "*)9237func_append newdeplibs " $i"9238i=9239;;9240esac9241fi9242if test -n "$i"; then9243libname=`eval "\\$ECHO \"$libname_spec\""`9244deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`9245set dummy $deplib_matches; shift9246deplib_match=$19247if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then9248func_append newdeplibs " $i"9249else9250droppeddeps=yes9251echo9252$ECHO "*** Warning: dynamic linker does not accept needed library $i."9253echo "*** I have the capability to make that library automatically link in when"9254echo "*** you link to this library. But I can only do this if you have a"9255echo "*** shared version of the library, which you do not appear to have"9256echo "*** because a test_compile did reveal that the linker did not use this one"9257echo "*** as a dynamic dependency that programs can get resolved with at runtime."9258fi9259fi9260else9261droppeddeps=yes9262echo9263$ECHO "*** Warning! Library $i is needed by this library but I was not able to"9264echo "*** make it link in! You will probably need to install it or some"9265echo "*** library that it depends on before this library will be fully"9266echo "*** functional. Installing it before continuing would be even better."9267fi9268;;9269*)9270func_append newdeplibs " $i"9271;;9272esac9273done9274fi9275;;9276file_magic*)9277set dummy $deplibs_check_method; shift9278file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`9279for a_deplib in $deplibs; do9280case $a_deplib in9281-l*)9282func_stripname -l '' "$a_deplib"9283name=$func_stripname_result9284if test yes = "$allow_libtool_libs_with_static_runtimes"; then9285case " $predeps $postdeps " in9286*" $a_deplib "*)9287func_append newdeplibs " $a_deplib"9288a_deplib=9289;;9290esac9291fi9292if test -n "$a_deplib"; then9293libname=`eval "\\$ECHO \"$libname_spec\""`9294if test -n "$file_magic_glob"; then9295libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`9296else9297libnameglob=$libname9298fi9299test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`9300for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do9301if test yes = "$want_nocaseglob"; then9302shopt -s nocaseglob9303potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`9304$nocaseglob9305else9306potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`9307fi9308for potent_lib in $potential_libs; do9309# Follow soft links.9310if ls -lLd "$potent_lib" 2>/dev/null |9311$GREP " -> " >/dev/null; then9312continue9313fi9314# The statement above tries to avoid entering an9315# endless loop below, in case of cyclic links.9316# We might still enter an endless loop, since a link9317# loop can be closed while we follow links,9318# but so what?9319potlib=$potent_lib9320while test -h "$potlib" 2>/dev/null; do9321potliblink=`ls -ld $potlib | $SED 's/.* -> //'`9322case $potliblink in9323[\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;9324*) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;9325esac9326done9327if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |9328$SED -e 10q |9329$EGREP "$file_magic_regex" > /dev/null; then9330func_append newdeplibs " $a_deplib"9331a_deplib=9332break 29333fi9334done9335done9336fi9337if test -n "$a_deplib"; then9338droppeddeps=yes9339echo9340$ECHO "*** Warning: linker path does not have real file for library $a_deplib."9341echo "*** I have the capability to make that library automatically link in when"9342echo "*** you link to this library. But I can only do this if you have a"9343echo "*** shared version of the library, which you do not appear to have"9344echo "*** because I did check the linker path looking for a file starting"9345if test -z "$potlib"; then9346$ECHO "*** with $libname but no candidates were found. (...for file magic test)"9347else9348$ECHO "*** with $libname and none of the candidates passed a file format test"9349$ECHO "*** using a file magic. Last file checked: $potlib"9350fi9351fi9352;;9353*)9354# Add a -L argument.9355func_append newdeplibs " $a_deplib"9356;;9357esac9358done # Gone through all deplibs.9359;;9360match_pattern*)9361set dummy $deplibs_check_method; shift9362match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`9363for a_deplib in $deplibs; do9364case $a_deplib in9365-l*)9366func_stripname -l '' "$a_deplib"9367name=$func_stripname_result9368if test yes = "$allow_libtool_libs_with_static_runtimes"; then9369case " $predeps $postdeps " in9370*" $a_deplib "*)9371func_append newdeplibs " $a_deplib"9372a_deplib=9373;;9374esac9375fi9376if test -n "$a_deplib"; then9377libname=`eval "\\$ECHO \"$libname_spec\""`9378for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do9379potential_libs=`ls $i/$libname[.-]* 2>/dev/null`9380for potent_lib in $potential_libs; do9381potlib=$potent_lib # see symlink-check above in file_magic test9382if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \9383$EGREP "$match_pattern_regex" > /dev/null; then9384func_append newdeplibs " $a_deplib"9385a_deplib=9386break 29387fi9388done9389done9390fi9391if test -n "$a_deplib"; then9392droppeddeps=yes9393echo9394$ECHO "*** Warning: linker path does not have real file for library $a_deplib."9395echo "*** I have the capability to make that library automatically link in when"9396echo "*** you link to this library. But I can only do this if you have a"9397echo "*** shared version of the library, which you do not appear to have"9398echo "*** because I did check the linker path looking for a file starting"9399if test -z "$potlib"; then9400$ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"9401else9402$ECHO "*** with $libname and none of the candidates passed a file format test"9403$ECHO "*** using a regex pattern. Last file checked: $potlib"9404fi9405fi9406;;9407*)9408# Add a -L argument.9409func_append newdeplibs " $a_deplib"9410;;9411esac9412done # Gone through all deplibs.9413;;9414none | unknown | *)9415newdeplibs=9416tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`9417if test yes = "$allow_libtool_libs_with_static_runtimes"; then9418for i in $predeps $postdeps; do9419# can't use Xsed below, because $i might contain '/'9420tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`9421done9422fi9423case $tmp_deplibs in9424*[!\ \ ]*)9425echo9426if test none = "$deplibs_check_method"; then9427echo "*** Warning: inter-library dependencies are not supported in this platform."9428else9429echo "*** Warning: inter-library dependencies are not known to be supported."9430fi9431echo "*** All declared inter-library dependencies are being dropped."9432droppeddeps=yes9433;;9434esac9435;;9436esac9437versuffix=$versuffix_save9438major=$major_save9439release=$release_save9440libname=$libname_save9441name=$name_save94429443case $host in9444*-*-rhapsody* | *-*-darwin1.[012])9445# On Rhapsody replace the C library with the System framework9446newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`9447;;9448esac94499450if test yes = "$droppeddeps"; then9451if test yes = "$module"; then9452echo9453echo "*** Warning: libtool could not satisfy all declared inter-library"9454$ECHO "*** dependencies of module $libname. Therefore, libtool will create"9455echo "*** a static module, that should work as long as the dlopening"9456echo "*** application is linked with the -dlopen flag."9457if test -z "$global_symbol_pipe"; then9458echo9459echo "*** However, this would only work if libtool was able to extract symbol"9460echo "*** lists from a program, using 'nm' or equivalent, but libtool could"9461echo "*** not find such a program. So, this module is probably useless."9462echo "*** 'nm' from GNU binutils and a full rebuild may help."9463fi9464if test no = "$build_old_libs"; then9465oldlibs=$output_objdir/$libname.$libext9466build_libtool_libs=module9467build_old_libs=yes9468else9469build_libtool_libs=no9470fi9471else9472echo "*** The inter-library dependencies that have been dropped here will be"9473echo "*** automatically added whenever a program is linked with this library"9474echo "*** or is declared to -dlopen it."94759476if test no = "$allow_undefined"; then9477echo9478echo "*** Since this library must not contain undefined symbols,"9479echo "*** because either the platform does not support them or"9480echo "*** it was explicitly requested with -no-undefined,"9481echo "*** libtool will only create a static version of it."9482if test no = "$build_old_libs"; then9483oldlibs=$output_objdir/$libname.$libext9484build_libtool_libs=module9485build_old_libs=yes9486else9487build_libtool_libs=no9488fi9489fi9490fi9491fi9492# Done checking deplibs!9493deplibs=$newdeplibs9494fi9495# Time to change all our "foo.ltframework" stuff back to "-framework foo"9496case $host in9497*-*-darwin*)9498newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`9499new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`9500deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`9501;;9502esac95039504# move library search paths that coincide with paths to not yet9505# installed libraries to the beginning of the library search list9506new_libs=9507for path in $notinst_path; do9508case " $new_libs " in9509*" -L$path/$objdir "*) ;;9510*)9511case " $deplibs " in9512*" -L$path/$objdir "*)9513func_append new_libs " -L$path/$objdir" ;;9514esac9515;;9516esac9517done9518for deplib in $deplibs; do9519case $deplib in9520-L*)9521case " $new_libs " in9522*" $deplib "*) ;;9523*) func_append new_libs " $deplib" ;;9524esac9525;;9526*) func_append new_libs " $deplib" ;;9527esac9528done9529deplibs=$new_libs95309531# All the library-specific variables (install_libdir is set above).9532library_names=9533old_library=9534dlname=95359536# Test again, we may have decided not to build it any more9537if test yes = "$build_libtool_libs"; then9538# Remove $wl instances when linking with ld.9539# FIXME: should test the right _cmds variable.9540case $archive_cmds in9541*\$LD\ *) wl= ;;9542esac9543if test yes = "$hardcode_into_libs"; then9544# Hardcode the library paths9545hardcode_libdirs=9546dep_rpath=9547rpath=$finalize_rpath9548test relink = "$opt_mode" || rpath=$compile_rpath$rpath9549for libdir in $rpath; do9550if test -n "$hardcode_libdir_flag_spec"; then9551if test -n "$hardcode_libdir_separator"; then9552func_replace_sysroot "$libdir"9553libdir=$func_replace_sysroot_result9554if test -z "$hardcode_libdirs"; then9555hardcode_libdirs=$libdir9556else9557# Just accumulate the unique libdirs.9558case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in9559*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)9560;;9561*)9562func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"9563;;9564esac9565fi9566else9567eval flag=\"$hardcode_libdir_flag_spec\"9568func_append dep_rpath " $flag"9569fi9570elif test -n "$runpath_var"; then9571case "$perm_rpath " in9572*" $libdir "*) ;;9573*) func_append perm_rpath " $libdir" ;;9574esac9575fi9576done9577# Substitute the hardcoded libdirs into the rpath.9578if test -n "$hardcode_libdir_separator" &&9579test -n "$hardcode_libdirs"; then9580libdir=$hardcode_libdirs9581eval "dep_rpath=\"$hardcode_libdir_flag_spec\""9582fi9583if test -n "$runpath_var" && test -n "$perm_rpath"; then9584# We should set the runpath_var.9585rpath=9586for dir in $perm_rpath; do9587func_append rpath "$dir:"9588done9589eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"9590fi9591test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"9592fi95939594shlibpath=$finalize_shlibpath9595test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath9596if test -n "$shlibpath"; then9597eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"9598fi95999600# Get the real and link names of the library.9601eval shared_ext=\"$shrext_cmds\"9602eval library_names=\"$library_names_spec\"9603set dummy $library_names9604shift9605realname=$19606shift96079608if test -n "$soname_spec"; then9609eval soname=\"$soname_spec\"9610else9611soname=$realname9612fi9613if test -z "$dlname"; then9614dlname=$soname9615fi96169617lib=$output_objdir/$realname9618linknames=9619for link9620do9621func_append linknames " $link"9622done96239624# Use standard objects if they are pic9625test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`9626test "X$libobjs" = "X " && libobjs=96279628delfiles=9629if test -n "$export_symbols" && test -n "$include_expsyms"; then9630$opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"9631export_symbols=$output_objdir/$libname.uexp9632func_append delfiles " $export_symbols"9633fi96349635orig_export_symbols=9636case $host_os in9637cygwin* | mingw* | cegcc*)9638if test -n "$export_symbols" && test -z "$export_symbols_regex"; then9639# exporting using user supplied symfile9640func_dll_def_p "$export_symbols" || {9641# and it's NOT already a .def file. Must figure out9642# which of the given symbols are data symbols and tag9643# them as such. So, trigger use of export_symbols_cmds.9644# export_symbols gets reassigned inside the "prepare9645# the list of exported symbols" if statement, so the9646# include_expsyms logic still works.9647orig_export_symbols=$export_symbols9648export_symbols=9649always_export_symbols=yes9650}9651fi9652;;9653esac96549655# Prepare the list of exported symbols9656if test -z "$export_symbols"; then9657if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then9658func_verbose "generating symbol list for '$libname.la'"9659export_symbols=$output_objdir/$libname.exp9660$opt_dry_run || $RM $export_symbols9661cmds=$export_symbols_cmds9662save_ifs=$IFS; IFS='~'9663for cmd1 in $cmds; do9664IFS=$save_ifs9665# Take the normal branch if the nm_file_list_spec branch9666# doesn't work or if tool conversion is not needed.9667case $nm_file_list_spec~$to_tool_file_cmd in9668*~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)9669try_normal_branch=yes9670eval cmd=\"$cmd1\"9671func_len " $cmd"9672len=$func_len_result9673;;9674*)9675try_normal_branch=no9676;;9677esac9678if test yes = "$try_normal_branch" \9679&& { test "$len" -lt "$max_cmd_len" \9680|| test "$max_cmd_len" -le -1; }9681then9682func_show_eval "$cmd" 'exit $?'9683skipped_export=false9684elif test -n "$nm_file_list_spec"; then9685func_basename "$output"9686output_la=$func_basename_result9687save_libobjs=$libobjs9688save_output=$output9689output=$output_objdir/$output_la.nm9690func_to_tool_file "$output"9691libobjs=$nm_file_list_spec$func_to_tool_file_result9692func_append delfiles " $output"9693func_verbose "creating $NM input file list: $output"9694for obj in $save_libobjs; do9695func_to_tool_file "$obj"9696$ECHO "$func_to_tool_file_result"9697done > "$output"9698eval cmd=\"$cmd1\"9699func_show_eval "$cmd" 'exit $?'9700output=$save_output9701libobjs=$save_libobjs9702skipped_export=false9703else9704# The command line is too long to execute in one step.9705func_verbose "using reloadable object file for export list..."9706skipped_export=:9707# Break out early, otherwise skipped_export may be9708# set to false by a later but shorter cmd.9709break9710fi9711done9712IFS=$save_ifs9713if test -n "$export_symbols_regex" && test : != "$skipped_export"; then9714func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'9715func_show_eval '$MV "${export_symbols}T" "$export_symbols"'9716fi9717fi9718fi97199720if test -n "$export_symbols" && test -n "$include_expsyms"; then9721tmp_export_symbols=$export_symbols9722test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols9723$opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'9724fi97259726if test : != "$skipped_export" && test -n "$orig_export_symbols"; then9727# The given exports_symbols file has to be filtered, so filter it.9728func_verbose "filter symbol list for '$libname.la' to tag DATA exports"9729# FIXME: $output_objdir/$libname.filter potentially contains lots of9730# 's' commands, which not all seds can handle. GNU sed should be fine9731# though. Also, the filter scales superlinearly with the number of9732# global variables. join(1) would be nice here, but unfortunately9733# isn't a blessed tool.9734$opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter9735func_append delfiles " $export_symbols $output_objdir/$libname.filter"9736export_symbols=$output_objdir/$libname.def9737$opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols9738fi97399740tmp_deplibs=9741for test_deplib in $deplibs; do9742case " $convenience " in9743*" $test_deplib "*) ;;9744*)9745func_append tmp_deplibs " $test_deplib"9746;;9747esac9748done9749deplibs=$tmp_deplibs97509751if test -n "$convenience"; then9752if test -n "$whole_archive_flag_spec" &&9753test yes = "$compiler_needs_object" &&9754test -z "$libobjs"; then9755# extract the archives, so we have objects to list.9756# TODO: could optimize this to just extract one archive.9757whole_archive_flag_spec=9758fi9759if test -n "$whole_archive_flag_spec"; then9760save_libobjs=$libobjs9761eval libobjs=\"\$libobjs $whole_archive_flag_spec\"9762test "X$libobjs" = "X " && libobjs=9763else9764gentop=$output_objdir/${outputname}x9765func_append generated " $gentop"97669767func_extract_archives $gentop $convenience9768func_append libobjs " $func_extract_archives_result"9769test "X$libobjs" = "X " && libobjs=9770fi9771fi97729773if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then9774eval flag=\"$thread_safe_flag_spec\"9775func_append linker_flags " $flag"9776fi97779778# Make a backup of the uninstalled library when relinking9779if test relink = "$opt_mode"; then9780$opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?9781fi97829783# Do each of the archive commands.9784if test yes = "$module" && test -n "$module_cmds"; then9785if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then9786eval test_cmds=\"$module_expsym_cmds\"9787cmds=$module_expsym_cmds9788else9789eval test_cmds=\"$module_cmds\"9790cmds=$module_cmds9791fi9792else9793if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then9794eval test_cmds=\"$archive_expsym_cmds\"9795cmds=$archive_expsym_cmds9796else9797eval test_cmds=\"$archive_cmds\"9798cmds=$archive_cmds9799fi9800fi98019802if test : != "$skipped_export" &&9803func_len " $test_cmds" &&9804len=$func_len_result &&9805test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then9806:9807else9808# The command line is too long to link in one step, link piecewise9809# or, if using GNU ld and skipped_export is not :, use a linker9810# script.98119812# Save the value of $output and $libobjs because we want to9813# use them later. If we have whole_archive_flag_spec, we9814# want to use save_libobjs as it was before9815# whole_archive_flag_spec was expanded, because we can't9816# assume the linker understands whole_archive_flag_spec.9817# This may have to be revisited, in case too many9818# convenience libraries get linked in and end up exceeding9819# the spec.9820if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then9821save_libobjs=$libobjs9822fi9823save_output=$output9824func_basename "$output"9825output_la=$func_basename_result98269827# Clear the reloadable object creation command queue and9828# initialize k to one.9829test_cmds=9830concat_cmds=9831objlist=9832last_robj=9833k=198349835if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then9836output=$output_objdir/$output_la.lnkscript9837func_verbose "creating GNU ld script: $output"9838echo 'INPUT (' > $output9839for obj in $save_libobjs9840do9841func_to_tool_file "$obj"9842$ECHO "$func_to_tool_file_result" >> $output9843done9844echo ')' >> $output9845func_append delfiles " $output"9846func_to_tool_file "$output"9847output=$func_to_tool_file_result9848elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then9849output=$output_objdir/$output_la.lnk9850func_verbose "creating linker input file list: $output"9851: > $output9852set x $save_libobjs9853shift9854firstobj=9855if test yes = "$compiler_needs_object"; then9856firstobj="$1 "9857shift9858fi9859for obj9860do9861func_to_tool_file "$obj"9862$ECHO "$func_to_tool_file_result" >> $output9863done9864func_append delfiles " $output"9865func_to_tool_file "$output"9866output=$firstobj\"$file_list_spec$func_to_tool_file_result\"9867else9868if test -n "$save_libobjs"; then9869func_verbose "creating reloadable object files..."9870output=$output_objdir/$output_la-$k.$objext9871eval test_cmds=\"$reload_cmds\"9872func_len " $test_cmds"9873len0=$func_len_result9874len=$len098759876# Loop over the list of objects to be linked.9877for obj in $save_libobjs9878do9879func_len " $obj"9880func_arith $len + $func_len_result9881len=$func_arith_result9882if test -z "$objlist" ||9883test "$len" -lt "$max_cmd_len"; then9884func_append objlist " $obj"9885else9886# The command $test_cmds is almost too long, add a9887# command to the queue.9888if test 1 -eq "$k"; then9889# The first file doesn't have a previous command to add.9890reload_objs=$objlist9891eval concat_cmds=\"$reload_cmds\"9892else9893# All subsequent reloadable object files will link in9894# the last one created.9895reload_objs="$objlist $last_robj"9896eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"9897fi9898last_robj=$output_objdir/$output_la-$k.$objext9899func_arith $k + 19900k=$func_arith_result9901output=$output_objdir/$output_la-$k.$objext9902objlist=" $obj"9903func_len " $last_robj"9904func_arith $len0 + $func_len_result9905len=$func_arith_result9906fi9907done9908# Handle the remaining objects by creating one last9909# reloadable object file. All subsequent reloadable object9910# files will link in the last one created.9911test -z "$concat_cmds" || concat_cmds=$concat_cmds~9912reload_objs="$objlist $last_robj"9913eval concat_cmds=\"\$concat_cmds$reload_cmds\"9914if test -n "$last_robj"; then9915eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"9916fi9917func_append delfiles " $output"99189919else9920output=9921fi99229923${skipped_export-false} && {9924func_verbose "generating symbol list for '$libname.la'"9925export_symbols=$output_objdir/$libname.exp9926$opt_dry_run || $RM $export_symbols9927libobjs=$output9928# Append the command to create the export file.9929test -z "$concat_cmds" || concat_cmds=$concat_cmds~9930eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"9931if test -n "$last_robj"; then9932eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"9933fi9934}99359936test -n "$save_libobjs" &&9937func_verbose "creating a temporary reloadable object file: $output"99389939# Loop through the commands generated above and execute them.9940save_ifs=$IFS; IFS='~'9941for cmd in $concat_cmds; do9942IFS=$save_ifs9943$opt_quiet || {9944func_quote_for_expand "$cmd"9945eval "func_echo $func_quote_for_expand_result"9946}9947$opt_dry_run || eval "$cmd" || {9948lt_exit=$?99499950# Restore the uninstalled library and exit9951if test relink = "$opt_mode"; then9952( cd "$output_objdir" && \9953$RM "${realname}T" && \9954$MV "${realname}U" "$realname" )9955fi99569957exit $lt_exit9958}9959done9960IFS=$save_ifs99619962if test -n "$export_symbols_regex" && ${skipped_export-false}; then9963func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'9964func_show_eval '$MV "${export_symbols}T" "$export_symbols"'9965fi9966fi99679968${skipped_export-false} && {9969if test -n "$export_symbols" && test -n "$include_expsyms"; then9970tmp_export_symbols=$export_symbols9971test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols9972$opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'9973fi99749975if test -n "$orig_export_symbols"; then9976# The given exports_symbols file has to be filtered, so filter it.9977func_verbose "filter symbol list for '$libname.la' to tag DATA exports"9978# FIXME: $output_objdir/$libname.filter potentially contains lots of9979# 's' commands, which not all seds can handle. GNU sed should be fine9980# though. Also, the filter scales superlinearly with the number of9981# global variables. join(1) would be nice here, but unfortunately9982# isn't a blessed tool.9983$opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter9984func_append delfiles " $export_symbols $output_objdir/$libname.filter"9985export_symbols=$output_objdir/$libname.def9986$opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols9987fi9988}99899990libobjs=$output9991# Restore the value of output.9992output=$save_output99939994if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then9995eval libobjs=\"\$libobjs $whole_archive_flag_spec\"9996test "X$libobjs" = "X " && libobjs=9997fi9998# Expand the library linking commands again to reset the9999# value of $libobjs for piecewise linking.1000010001# Do each of the archive commands.10002if test yes = "$module" && test -n "$module_cmds"; then10003if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then10004cmds=$module_expsym_cmds10005else10006cmds=$module_cmds10007fi10008else10009if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then10010cmds=$archive_expsym_cmds10011else10012cmds=$archive_cmds10013fi10014fi10015fi1001610017if test -n "$delfiles"; then10018# Append the command to remove temporary files to $cmds.10019eval cmds=\"\$cmds~\$RM $delfiles\"10020fi1002110022# Add any objects from preloaded convenience libraries10023if test -n "$dlprefiles"; then10024gentop=$output_objdir/${outputname}x10025func_append generated " $gentop"1002610027func_extract_archives $gentop $dlprefiles10028func_append libobjs " $func_extract_archives_result"10029test "X$libobjs" = "X " && libobjs=10030fi1003110032save_ifs=$IFS; IFS='~'10033for cmd in $cmds; do10034IFS=$sp$nl10035eval cmd=\"$cmd\"10036IFS=$save_ifs10037$opt_quiet || {10038func_quote_for_expand "$cmd"10039eval "func_echo $func_quote_for_expand_result"10040}10041$opt_dry_run || eval "$cmd" || {10042lt_exit=$?1004310044# Restore the uninstalled library and exit10045if test relink = "$opt_mode"; then10046( cd "$output_objdir" && \10047$RM "${realname}T" && \10048$MV "${realname}U" "$realname" )10049fi1005010051exit $lt_exit10052}10053done10054IFS=$save_ifs1005510056# Restore the uninstalled library and exit10057if test relink = "$opt_mode"; then10058$opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?1005910060if test -n "$convenience"; then10061if test -z "$whole_archive_flag_spec"; then10062func_show_eval '${RM}r "$gentop"'10063fi10064fi1006510066exit $EXIT_SUCCESS10067fi1006810069# Create links to the real library.10070for linkname in $linknames; do10071if test "$realname" != "$linkname"; then10072func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'10073fi10074done1007510076# If -module or -export-dynamic was specified, set the dlname.10077if test yes = "$module" || test yes = "$export_dynamic"; then10078# On all known operating systems, these are identical.10079dlname=$soname10080fi10081fi10082;;1008310084obj)10085if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then10086func_warning "'-dlopen' is ignored for objects"10087fi1008810089case " $deplibs" in10090*\ -l* | *\ -L*)10091func_warning "'-l' and '-L' are ignored for objects" ;;10092esac1009310094test -n "$rpath" && \10095func_warning "'-rpath' is ignored for objects"1009610097test -n "$xrpath" && \10098func_warning "'-R' is ignored for objects"1009910100test -n "$vinfo" && \10101func_warning "'-version-info' is ignored for objects"1010210103test -n "$release" && \10104func_warning "'-release' is ignored for objects"1010510106case $output in10107*.lo)10108test -n "$objs$old_deplibs" && \10109func_fatal_error "cannot build library object '$output' from non-libtool objects"1011010111libobj=$output10112func_lo2o "$libobj"10113obj=$func_lo2o_result10114;;10115*)10116libobj=10117obj=$output10118;;10119esac1012010121# Delete the old objects.10122$opt_dry_run || $RM $obj $libobj1012310124# Objects from convenience libraries. This assumes10125# single-version convenience libraries. Whenever we create10126# different ones for PIC/non-PIC, this we'll have to duplicate10127# the extraction.10128reload_conv_objs=10129gentop=10130# if reload_cmds runs $LD directly, get rid of -Wl from10131# whole_archive_flag_spec and hope we can get by with turning comma10132# into space.10133case $reload_cmds in10134*\$LD[\ \$]*) wl= ;;10135esac10136if test -n "$convenience"; then10137if test -n "$whole_archive_flag_spec"; then10138eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"10139test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`10140reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags10141else10142gentop=$output_objdir/${obj}x10143func_append generated " $gentop"1014410145func_extract_archives $gentop $convenience10146reload_conv_objs="$reload_objs $func_extract_archives_result"10147fi10148fi1014910150# If we're not building shared, we need to use non_pic_objs10151test yes = "$build_libtool_libs" || libobjs=$non_pic_objects1015210153# Create the old-style object.10154reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs1015510156output=$obj10157func_execute_cmds "$reload_cmds" 'exit $?'1015810159# Exit if we aren't doing a library object file.10160if test -z "$libobj"; then10161if test -n "$gentop"; then10162func_show_eval '${RM}r "$gentop"'10163fi1016410165exit $EXIT_SUCCESS10166fi1016710168test yes = "$build_libtool_libs" || {10169if test -n "$gentop"; then10170func_show_eval '${RM}r "$gentop"'10171fi1017210173# Create an invalid libtool object if no PIC, so that we don't10174# accidentally link it into a program.10175# $show "echo timestamp > $libobj"10176# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?10177exit $EXIT_SUCCESS10178}1017910180if test -n "$pic_flag" || test default != "$pic_mode"; then10181# Only do commands if we really have different PIC objects.10182reload_objs="$libobjs $reload_conv_objs"10183output=$libobj10184func_execute_cmds "$reload_cmds" 'exit $?'10185fi1018610187if test -n "$gentop"; then10188func_show_eval '${RM}r "$gentop"'10189fi1019010191exit $EXIT_SUCCESS10192;;1019310194prog)10195case $host in10196*cygwin*) func_stripname '' '.exe' "$output"10197output=$func_stripname_result.exe;;10198esac10199test -n "$vinfo" && \10200func_warning "'-version-info' is ignored for programs"1020110202test -n "$release" && \10203func_warning "'-release' is ignored for programs"1020410205$preload \10206&& test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \10207&& func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."1020810209case $host in10210*-*-rhapsody* | *-*-darwin1.[012])10211# On Rhapsody replace the C library is the System framework10212compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`10213finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`10214;;10215esac1021610217case $host in10218*-*-darwin*)10219# Don't allow lazy linking, it breaks C++ global constructors10220# But is supposedly fixed on 10.4 or later (yay!).10221if test CXX = "$tagname"; then10222case ${MACOSX_DEPLOYMENT_TARGET-10.0} in1022310.[0123])10224func_append compile_command " $wl-bind_at_load"10225func_append finalize_command " $wl-bind_at_load"10226;;10227esac10228fi10229# Time to change all our "foo.ltframework" stuff back to "-framework foo"10230compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`10231finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`10232;;10233esac102341023510236# move library search paths that coincide with paths to not yet10237# installed libraries to the beginning of the library search list10238new_libs=10239for path in $notinst_path; do10240case " $new_libs " in10241*" -L$path/$objdir "*) ;;10242*)10243case " $compile_deplibs " in10244*" -L$path/$objdir "*)10245func_append new_libs " -L$path/$objdir" ;;10246esac10247;;10248esac10249done10250for deplib in $compile_deplibs; do10251case $deplib in10252-L*)10253case " $new_libs " in10254*" $deplib "*) ;;10255*) func_append new_libs " $deplib" ;;10256esac10257;;10258*) func_append new_libs " $deplib" ;;10259esac10260done10261compile_deplibs=$new_libs102621026310264func_append compile_command " $compile_deplibs"10265func_append finalize_command " $finalize_deplibs"1026610267if test -n "$rpath$xrpath"; then10268# If the user specified any rpath flags, then add them.10269for libdir in $rpath $xrpath; do10270# This is the magic to use -rpath.10271case "$finalize_rpath " in10272*" $libdir "*) ;;10273*) func_append finalize_rpath " $libdir" ;;10274esac10275done10276fi1027710278# Now hardcode the library paths10279rpath=10280hardcode_libdirs=10281for libdir in $compile_rpath $finalize_rpath; do10282if test -n "$hardcode_libdir_flag_spec"; then10283if test -n "$hardcode_libdir_separator"; then10284if test -z "$hardcode_libdirs"; then10285hardcode_libdirs=$libdir10286else10287# Just accumulate the unique libdirs.10288case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in10289*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)10290;;10291*)10292func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"10293;;10294esac10295fi10296else10297eval flag=\"$hardcode_libdir_flag_spec\"10298func_append rpath " $flag"10299fi10300elif test -n "$runpath_var"; then10301case "$perm_rpath " in10302*" $libdir "*) ;;10303*) func_append perm_rpath " $libdir" ;;10304esac10305fi10306case $host in10307*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)10308testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`10309case :$dllsearchpath: in10310*":$libdir:"*) ;;10311::) dllsearchpath=$libdir;;10312*) func_append dllsearchpath ":$libdir";;10313esac10314case :$dllsearchpath: in10315*":$testbindir:"*) ;;10316::) dllsearchpath=$testbindir;;10317*) func_append dllsearchpath ":$testbindir";;10318esac10319;;10320esac10321done10322# Substitute the hardcoded libdirs into the rpath.10323if test -n "$hardcode_libdir_separator" &&10324test -n "$hardcode_libdirs"; then10325libdir=$hardcode_libdirs10326eval rpath=\" $hardcode_libdir_flag_spec\"10327fi10328compile_rpath=$rpath1032910330rpath=10331hardcode_libdirs=10332for libdir in $finalize_rpath; do10333if test -n "$hardcode_libdir_flag_spec"; then10334if test -n "$hardcode_libdir_separator"; then10335if test -z "$hardcode_libdirs"; then10336hardcode_libdirs=$libdir10337else10338# Just accumulate the unique libdirs.10339case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in10340*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)10341;;10342*)10343func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"10344;;10345esac10346fi10347else10348eval flag=\"$hardcode_libdir_flag_spec\"10349func_append rpath " $flag"10350fi10351elif test -n "$runpath_var"; then10352case "$finalize_perm_rpath " in10353*" $libdir "*) ;;10354*) func_append finalize_perm_rpath " $libdir" ;;10355esac10356fi10357done10358# Substitute the hardcoded libdirs into the rpath.10359if test -n "$hardcode_libdir_separator" &&10360test -n "$hardcode_libdirs"; then10361libdir=$hardcode_libdirs10362eval rpath=\" $hardcode_libdir_flag_spec\"10363fi10364finalize_rpath=$rpath1036510366if test -n "$libobjs" && test yes = "$build_old_libs"; then10367# Transform all the library objects into standard objects.10368compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`10369finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`10370fi1037110372func_generate_dlsyms "$outputname" "@PROGRAM@" false1037310374# template prelinking step10375if test -n "$prelink_cmds"; then10376func_execute_cmds "$prelink_cmds" 'exit $?'10377fi1037810379wrappers_required=:10380case $host in10381*cegcc* | *mingw32ce*)10382# Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.10383wrappers_required=false10384;;10385*cygwin* | *mingw* )10386test yes = "$build_libtool_libs" || wrappers_required=false10387;;10388*)10389if test no = "$need_relink" || test yes != "$build_libtool_libs"; then10390wrappers_required=false10391fi10392;;10393esac10394$wrappers_required || {10395# Replace the output file specification.10396compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`10397link_command=$compile_command$compile_rpath1039810399# We have no uninstalled library dependencies, so finalize right now.10400exit_status=010401func_show_eval "$link_command" 'exit_status=$?'1040210403if test -n "$postlink_cmds"; then10404func_to_tool_file "$output"10405postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`10406func_execute_cmds "$postlink_cmds" 'exit $?'10407fi1040810409# Delete the generated files.10410if test -f "$output_objdir/${outputname}S.$objext"; then10411func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'10412fi1041310414exit $exit_status10415}1041610417if test -n "$compile_shlibpath$finalize_shlibpath"; then10418compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"10419fi10420if test -n "$finalize_shlibpath"; then10421finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"10422fi1042310424compile_var=10425finalize_var=10426if test -n "$runpath_var"; then10427if test -n "$perm_rpath"; then10428# We should set the runpath_var.10429rpath=10430for dir in $perm_rpath; do10431func_append rpath "$dir:"10432done10433compile_var="$runpath_var=\"$rpath\$$runpath_var\" "10434fi10435if test -n "$finalize_perm_rpath"; then10436# We should set the runpath_var.10437rpath=10438for dir in $finalize_perm_rpath; do10439func_append rpath "$dir:"10440done10441finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "10442fi10443fi1044410445if test yes = "$no_install"; then10446# We don't need to create a wrapper script.10447link_command=$compile_var$compile_command$compile_rpath10448# Replace the output file specification.10449link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`10450# Delete the old output file.10451$opt_dry_run || $RM $output10452# Link the executable and exit10453func_show_eval "$link_command" 'exit $?'1045410455if test -n "$postlink_cmds"; then10456func_to_tool_file "$output"10457postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`10458func_execute_cmds "$postlink_cmds" 'exit $?'10459fi1046010461exit $EXIT_SUCCESS10462fi1046310464case $hardcode_action,$fast_install in10465relink,*)10466# Fast installation is not supported10467link_command=$compile_var$compile_command$compile_rpath10468relink_command=$finalize_var$finalize_command$finalize_rpath1046910470func_warning "this platform does not like uninstalled shared libraries"10471func_warning "'$output' will be relinked during installation"10472;;10473*,yes)10474link_command=$finalize_var$compile_command$finalize_rpath10475relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`10476;;10477*,no)10478link_command=$compile_var$compile_command$compile_rpath10479relink_command=$finalize_var$finalize_command$finalize_rpath10480;;10481*,needless)10482link_command=$finalize_var$compile_command$finalize_rpath10483relink_command=10484;;10485esac1048610487# Replace the output file specification.10488link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`1048910490# Delete the old output files.10491$opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname1049210493func_show_eval "$link_command" 'exit $?'1049410495if test -n "$postlink_cmds"; then10496func_to_tool_file "$output_objdir/$outputname"10497postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`10498func_execute_cmds "$postlink_cmds" 'exit $?'10499fi1050010501# Now create the wrapper script.10502func_verbose "creating $output"1050310504# Quote the relink command for shipping.10505if test -n "$relink_command"; then10506# Preserve any variables that may affect compiler behavior10507for var in $variables_saved_for_relink; do10508if eval test -z \"\${$var+set}\"; then10509relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"10510elif eval var_value=\$$var; test -z "$var_value"; then10511relink_command="$var=; export $var; $relink_command"10512else10513func_quote_for_eval "$var_value"10514relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"10515fi10516done10517relink_command="(cd `pwd`; $relink_command)"10518relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`10519fi1052010521# Only actually do things if not in dry run mode.10522$opt_dry_run || {10523# win32 will think the script is a binary if it has10524# a .exe suffix, so we strip it off here.10525case $output in10526*.exe) func_stripname '' '.exe' "$output"10527output=$func_stripname_result ;;10528esac10529# test for cygwin because mv fails w/o .exe extensions10530case $host in10531*cygwin*)10532exeext=.exe10533func_stripname '' '.exe' "$outputname"10534outputname=$func_stripname_result ;;10535*) exeext= ;;10536esac10537case $host in10538*cygwin* | *mingw* )10539func_dirname_and_basename "$output" "" "."10540output_name=$func_basename_result10541output_path=$func_dirname_result10542cwrappersource=$output_path/$objdir/lt-$output_name.c10543cwrapper=$output_path/$output_name.exe10544$RM $cwrappersource $cwrapper10545trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 151054610547func_emit_cwrapperexe_src > $cwrappersource1054810549# The wrapper executable is built using the $host compiler,10550# because it contains $host paths and files. If cross-10551# compiling, it, like the target executable, must be10552# executed on the $host or under an emulation environment.10553$opt_dry_run || {10554$LTCC $LTCFLAGS -o $cwrapper $cwrappersource10555$STRIP $cwrapper10556}1055710558# Now, create the wrapper script for func_source use:10559func_ltwrapper_scriptname $cwrapper10560$RM $func_ltwrapper_scriptname_result10561trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 1510562$opt_dry_run || {10563# note: this script will not be executed, so do not chmod.10564if test "x$build" = "x$host"; then10565$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result10566else10567func_emit_wrapper no > $func_ltwrapper_scriptname_result10568fi10569}10570;;10571* )10572$RM $output10573trap "$RM $output; exit $EXIT_FAILURE" 1 2 151057410575func_emit_wrapper no > $output10576chmod +x $output10577;;10578esac10579}10580exit $EXIT_SUCCESS10581;;10582esac1058310584# See if we need to build an old-fashioned archive.10585for oldlib in $oldlibs; do1058610587case $build_libtool_libs in10588convenience)10589oldobjs="$libobjs_save $symfileobj"10590addlibs=$convenience10591build_libtool_libs=no10592;;10593module)10594oldobjs=$libobjs_save10595addlibs=$old_convenience10596build_libtool_libs=no10597;;10598*)10599oldobjs="$old_deplibs $non_pic_objects"10600$preload && test -f "$symfileobj" \10601&& func_append oldobjs " $symfileobj"10602addlibs=$old_convenience10603;;10604esac1060510606if test -n "$addlibs"; then10607gentop=$output_objdir/${outputname}x10608func_append generated " $gentop"1060910610func_extract_archives $gentop $addlibs10611func_append oldobjs " $func_extract_archives_result"10612fi1061310614# Do each command in the archive commands.10615if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then10616cmds=$old_archive_from_new_cmds10617else1061810619# Add any objects from preloaded convenience libraries10620if test -n "$dlprefiles"; then10621gentop=$output_objdir/${outputname}x10622func_append generated " $gentop"1062310624func_extract_archives $gentop $dlprefiles10625func_append oldobjs " $func_extract_archives_result"10626fi1062710628# POSIX demands no paths to be encoded in archives. We have10629# to avoid creating archives with duplicate basenames if we10630# might have to extract them afterwards, e.g., when creating a10631# static archive out of a convenience library, or when linking10632# the entirety of a libtool archive into another (currently10633# not supported by libtool).10634if (for obj in $oldobjs10635do10636func_basename "$obj"10637$ECHO "$func_basename_result"10638done | sort | sort -uc >/dev/null 2>&1); then10639:10640else10641echo "copying selected object files to avoid basename conflicts..."10642gentop=$output_objdir/${outputname}x10643func_append generated " $gentop"10644func_mkdir_p "$gentop"10645save_oldobjs=$oldobjs10646oldobjs=10647counter=110648for obj in $save_oldobjs10649do10650func_basename "$obj"10651objbase=$func_basename_result10652case " $oldobjs " in10653" ") oldobjs=$obj ;;10654*[\ /]"$objbase "*)10655while :; do10656# Make sure we don't pick an alternate name that also10657# overlaps.10658newobj=lt$counter-$objbase10659func_arith $counter + 110660counter=$func_arith_result10661case " $oldobjs " in10662*[\ /]"$newobj "*) ;;10663*) if test ! -f "$gentop/$newobj"; then break; fi ;;10664esac10665done10666func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"10667func_append oldobjs " $gentop/$newobj"10668;;10669*) func_append oldobjs " $obj" ;;10670esac10671done10672fi10673func_to_tool_file "$oldlib" func_convert_file_msys_to_w3210674tool_oldlib=$func_to_tool_file_result10675eval cmds=\"$old_archive_cmds\"1067610677func_len " $cmds"10678len=$func_len_result10679if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then10680cmds=$old_archive_cmds10681elif test -n "$archiver_list_spec"; then10682func_verbose "using command file archive linking..."10683for obj in $oldobjs10684do10685func_to_tool_file "$obj"10686$ECHO "$func_to_tool_file_result"10687done > $output_objdir/$libname.libcmd10688func_to_tool_file "$output_objdir/$libname.libcmd"10689oldobjs=" $archiver_list_spec$func_to_tool_file_result"10690cmds=$old_archive_cmds10691else10692# the command line is too long to link in one step, link in parts10693func_verbose "using piecewise archive linking..."10694save_RANLIB=$RANLIB10695RANLIB=:10696objlist=10697concat_cmds=10698save_oldobjs=$oldobjs10699oldobjs=10700# Is there a better way of finding the last object in the list?10701for obj in $save_oldobjs10702do10703last_oldobj=$obj10704done10705eval test_cmds=\"$old_archive_cmds\"10706func_len " $test_cmds"10707len0=$func_len_result10708len=$len010709for obj in $save_oldobjs10710do10711func_len " $obj"10712func_arith $len + $func_len_result10713len=$func_arith_result10714func_append objlist " $obj"10715if test "$len" -lt "$max_cmd_len"; then10716:10717else10718# the above command should be used before it gets too long10719oldobjs=$objlist10720if test "$obj" = "$last_oldobj"; then10721RANLIB=$save_RANLIB10722fi10723test -z "$concat_cmds" || concat_cmds=$concat_cmds~10724eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"10725objlist=10726len=$len010727fi10728done10729RANLIB=$save_RANLIB10730oldobjs=$objlist10731if test -z "$oldobjs"; then10732eval cmds=\"\$concat_cmds\"10733else10734eval cmds=\"\$concat_cmds~\$old_archive_cmds\"10735fi10736fi10737fi10738func_execute_cmds "$cmds" 'exit $?'10739done1074010741test -n "$generated" && \10742func_show_eval "${RM}r$generated"1074310744# Now create the libtool archive.10745case $output in10746*.la)10747old_library=10748test yes = "$build_old_libs" && old_library=$libname.$libext10749func_verbose "creating $output"1075010751# Preserve any variables that may affect compiler behavior10752for var in $variables_saved_for_relink; do10753if eval test -z \"\${$var+set}\"; then10754relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"10755elif eval var_value=\$$var; test -z "$var_value"; then10756relink_command="$var=; export $var; $relink_command"10757else10758func_quote_for_eval "$var_value"10759relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"10760fi10761done10762# Quote the link command for shipping.10763relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"10764relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`10765if test yes = "$hardcode_automatic"; then10766relink_command=10767fi1076810769# Only create the output if not a dry run.10770$opt_dry_run || {10771for installed in no yes; do10772if test yes = "$installed"; then10773if test -z "$install_libdir"; then10774break10775fi10776output=$output_objdir/${outputname}i10777# Replace all uninstalled libtool libraries with the installed ones10778newdependency_libs=10779for deplib in $dependency_libs; do10780case $deplib in10781*.la)10782func_basename "$deplib"10783name=$func_basename_result10784func_resolve_sysroot "$deplib"10785eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`10786test -z "$libdir" && \10787func_fatal_error "'$deplib' is not a valid libtool archive"10788func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"10789;;10790-L*)10791func_stripname -L '' "$deplib"10792func_replace_sysroot "$func_stripname_result"10793func_append newdependency_libs " -L$func_replace_sysroot_result"10794;;10795-R*)10796func_stripname -R '' "$deplib"10797func_replace_sysroot "$func_stripname_result"10798func_append newdependency_libs " -R$func_replace_sysroot_result"10799;;10800*) func_append newdependency_libs " $deplib" ;;10801esac10802done10803dependency_libs=$newdependency_libs10804newdlfiles=1080510806for lib in $dlfiles; do10807case $lib in10808*.la)10809func_basename "$lib"10810name=$func_basename_result10811eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`10812test -z "$libdir" && \10813func_fatal_error "'$lib' is not a valid libtool archive"10814func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"10815;;10816*) func_append newdlfiles " $lib" ;;10817esac10818done10819dlfiles=$newdlfiles10820newdlprefiles=10821for lib in $dlprefiles; do10822case $lib in10823*.la)10824# Only pass preopened files to the pseudo-archive (for10825# eventual linking with the app. that links it) if we10826# didn't already link the preopened objects directly into10827# the library:10828func_basename "$lib"10829name=$func_basename_result10830eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`10831test -z "$libdir" && \10832func_fatal_error "'$lib' is not a valid libtool archive"10833func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"10834;;10835esac10836done10837dlprefiles=$newdlprefiles10838else10839newdlfiles=10840for lib in $dlfiles; do10841case $lib in10842[\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;10843*) abs=`pwd`"/$lib" ;;10844esac10845func_append newdlfiles " $abs"10846done10847dlfiles=$newdlfiles10848newdlprefiles=10849for lib in $dlprefiles; do10850case $lib in10851[\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;10852*) abs=`pwd`"/$lib" ;;10853esac10854func_append newdlprefiles " $abs"10855done10856dlprefiles=$newdlprefiles10857fi10858$RM $output10859# place dlname in correct position for cygwin10860# In fact, it would be nice if we could use this code for all target10861# systems that can't hard-code library paths into their executables10862# and that have no shared library path variable independent of PATH,10863# but it turns out we can't easily determine that from inspecting10864# libtool variables, so we have to hard-code the OSs to which it10865# applies here; at the moment, that means platforms that use the PE10866# object format with DLL files. See the long comment at the top of10867# tests/bindir.at for full details.10868tdlname=$dlname10869case $host,$output,$installed,$module,$dlname in10870*cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)10871# If a -bindir argument was supplied, place the dll there.10872if test -n "$bindir"; then10873func_relative_path "$install_libdir" "$bindir"10874tdlname=$func_relative_path_result/$dlname10875else10876# Otherwise fall back on heuristic.10877tdlname=../bin/$dlname10878fi10879;;10880esac10881$ECHO > $output "\10882# $outputname - a libtool library file10883# Generated by $PROGRAM (GNU $PACKAGE) $VERSION10884#10885# Please DO NOT delete this file!10886# It is necessary for linking the library.1088710888# The name that we can dlopen(3).10889dlname='$tdlname'1089010891# Names of this library.10892library_names='$library_names'1089310894# The name of the static archive.10895old_library='$old_library'1089610897# Linker flags that cannot go in dependency_libs.10898inherited_linker_flags='$new_inherited_linker_flags'1089910900# Libraries that this one depends upon.10901dependency_libs='$dependency_libs'1090210903# Names of additional weak libraries provided by this library10904weak_library_names='$weak_libs'1090510906# Version information for $libname.10907current=$current10908age=$age10909revision=$revision1091010911# Is this an already installed library?10912installed=$installed1091310914# Should we warn about portability when linking against -modules?10915shouldnotlink=$module1091610917# Files to dlopen/dlpreopen10918dlopen='$dlfiles'10919dlpreopen='$dlprefiles'1092010921# Directory that this library needs to be installed in:10922libdir='$install_libdir'"10923if test no,yes = "$installed,$need_relink"; then10924$ECHO >> $output "\10925relink_command=\"$relink_command\""10926fi10927done10928}1092910930# Do a symbolic link so that the libtool archive can be found in10931# LD_LIBRARY_PATH before the program is installed.10932func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'10933;;10934esac10935exit $EXIT_SUCCESS10936}1093710938if test link = "$opt_mode" || test relink = "$opt_mode"; then10939func_mode_link ${1+"$@"}10940fi109411094210943# func_mode_uninstall arg...10944func_mode_uninstall ()10945{10946$debug_cmd1094710948RM=$nonopt10949files=10950rmforce=false10951exit_status=01095210953# This variable tells wrapper scripts just to set variables rather10954# than running their programs.10955libtool_install_magic=$magic1095610957for arg10958do10959case $arg in10960-f) func_append RM " $arg"; rmforce=: ;;10961-*) func_append RM " $arg" ;;10962*) func_append files " $arg" ;;10963esac10964done1096510966test -z "$RM" && \10967func_fatal_help "you must specify an RM program"1096810969rmdirs=1097010971for file in $files; do10972func_dirname "$file" "" "."10973dir=$func_dirname_result10974if test . = "$dir"; then10975odir=$objdir10976else10977odir=$dir/$objdir10978fi10979func_basename "$file"10980name=$func_basename_result10981test uninstall = "$opt_mode" && odir=$dir1098210983# Remember odir for removal later, being careful to avoid duplicates10984if test clean = "$opt_mode"; then10985case " $rmdirs " in10986*" $odir "*) ;;10987*) func_append rmdirs " $odir" ;;10988esac10989fi1099010991# Don't error if the file doesn't exist and rm -f was used.10992if { test -L "$file"; } >/dev/null 2>&1 ||10993{ test -h "$file"; } >/dev/null 2>&1 ||10994test -f "$file"; then10995:10996elif test -d "$file"; then10997exit_status=110998continue10999elif $rmforce; then11000continue11001fi1100211003rmfiles=$file1100411005case $name in11006*.la)11007# Possibly a libtool archive, so verify it.11008if func_lalib_p "$file"; then11009func_source $dir/$name1101011011# Delete the libtool libraries and symlinks.11012for n in $library_names; do11013func_append rmfiles " $odir/$n"11014done11015test -n "$old_library" && func_append rmfiles " $odir/$old_library"1101611017case $opt_mode in11018clean)11019case " $library_names " in11020*" $dlname "*) ;;11021*) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;11022esac11023test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"11024;;11025uninstall)11026if test -n "$library_names"; then11027# Do each command in the postuninstall commands.11028func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'11029fi1103011031if test -n "$old_library"; then11032# Do each command in the old_postuninstall commands.11033func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'11034fi11035# FIXME: should reinstall the best remaining shared library.11036;;11037esac11038fi11039;;1104011041*.lo)11042# Possibly a libtool object, so verify it.11043if func_lalib_p "$file"; then1104411045# Read the .lo file11046func_source $dir/$name1104711048# Add PIC object to the list of files to remove.11049if test -n "$pic_object" && test none != "$pic_object"; then11050func_append rmfiles " $dir/$pic_object"11051fi1105211053# Add non-PIC object to the list of files to remove.11054if test -n "$non_pic_object" && test none != "$non_pic_object"; then11055func_append rmfiles " $dir/$non_pic_object"11056fi11057fi11058;;1105911060*)11061if test clean = "$opt_mode"; then11062noexename=$name11063case $file in11064*.exe)11065func_stripname '' '.exe' "$file"11066file=$func_stripname_result11067func_stripname '' '.exe' "$name"11068noexename=$func_stripname_result11069# $file with .exe has already been added to rmfiles,11070# add $file without .exe11071func_append rmfiles " $file"11072;;11073esac11074# Do a test to see if this is a libtool program.11075if func_ltwrapper_p "$file"; then11076if func_ltwrapper_executable_p "$file"; then11077func_ltwrapper_scriptname "$file"11078relink_command=11079func_source $func_ltwrapper_scriptname_result11080func_append rmfiles " $func_ltwrapper_scriptname_result"11081else11082relink_command=11083func_source $dir/$noexename11084fi1108511086# note $name still contains .exe if it was in $file originally11087# as does the version of $file that was added into $rmfiles11088func_append rmfiles " $odir/$name $odir/${name}S.$objext"11089if test yes = "$fast_install" && test -n "$relink_command"; then11090func_append rmfiles " $odir/lt-$name"11091fi11092if test "X$noexename" != "X$name"; then11093func_append rmfiles " $odir/lt-$noexename.c"11094fi11095fi11096fi11097;;11098esac11099func_show_eval "$RM $rmfiles" 'exit_status=1'11100done1110111102# Try to remove the $objdir's in the directories where we deleted files11103for dir in $rmdirs; do11104if test -d "$dir"; then11105func_show_eval "rmdir $dir >/dev/null 2>&1"11106fi11107done1110811109exit $exit_status11110}1111111112if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then11113func_mode_uninstall ${1+"$@"}11114fi1111511116test -z "$opt_mode" && {11117help=$generic_help11118func_fatal_help "you must specify a MODE"11119}1112011121test -z "$exec_cmd" && \11122func_fatal_help "invalid operation mode '$opt_mode'"1112311124if test -n "$exec_cmd"; then11125eval exec "$exec_cmd"11126exit $EXIT_FAILURE11127fi1112811129exit $exit_status111301113111132# The TAGs below are defined such that we never get into a situation11133# where we disable both kinds of libraries. Given conflicting11134# choices, we go for a static library, that is the most portable,11135# since we can't tell whether shared libraries were disabled because11136# the user asked for that or because the platform doesn't support11137# them. This is particularly important on AIX, because we don't11138# support having both static and shared libraries enabled at the same11139# time on that platform, so we default to a shared-only configuration.11140# If a disable-shared tag is given, we'll fallback to a static-only11141# configuration. But we'll never go from static-only to shared-only.1114211143# ### BEGIN LIBTOOL TAG CONFIG: disable-shared11144build_libtool_libs=no11145build_old_libs=yes11146# ### END LIBTOOL TAG CONFIG: disable-shared1114711148# ### BEGIN LIBTOOL TAG CONFIG: disable-static11149build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`11150# ### END LIBTOOL TAG CONFIG: disable-static1115111152# Local Variables:11153# mode:shell-script11154# sh-indentation:211155# End:111561115711158