Path: blob/master/build/pkgs/cddlib/patches/autogenerated/ltmain.sh
8822 views
# Generated from ltmain.m4sh.12# ltmain.sh (GNU libtool) 2.2.6b3# Written by Gordon Matzigkeit <[email protected]>, 199645# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.6# This is free software; see the source for copying conditions. There is NO7# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.89# GNU Libtool is free software; you can redistribute it and/or modify10# it under the terms of the GNU General Public License as published by11# the Free Software Foundation; either version 2 of the License, or12# (at your option) any later version.13#14# As a special exception to the GNU General Public License,15# if you distribute this file as part of a program or library that16# is built using GNU Libtool, you may include this file under the17# same distribution terms that you use for the rest of that program.18#19# GNU Libtool is distributed in the hope that it will be useful, but20# WITHOUT ANY WARRANTY; without even the implied warranty of21# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU22# General Public License for more details.23#24# You should have received a copy of the GNU General Public License25# along with GNU Libtool; see the file COPYING. If not, a copy26# can be downloaded from http://www.gnu.org/licenses/gpl.html,27# or obtained by writing to the Free Software Foundation, Inc.,28# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.2930# Usage: $progname [OPTION]... [MODE-ARG]...31#32# Provide generalized library-building support services.33#34# --config show all configuration variables35# --debug enable verbose shell tracing36# -n, --dry-run display commands without modifying any files37# --features display basic configuration information and exit38# --mode=MODE use operation mode MODE39# --preserve-dup-deps don't remove duplicate dependency libraries40# --quiet, --silent don't print informational messages41# --tag=TAG use configuration variables from tag TAG42# -v, --verbose print informational messages (default)43# --version print version information44# -h, --help print short or long help message45#46# MODE must be one of the following:47#48# clean remove files from the build directory49# compile compile a source file into a libtool object50# execute automatically set library path, then run a program51# finish complete the installation of libtool libraries52# install install libraries or executables53# link create a library or an executable54# uninstall remove libraries from an installed directory55#56# MODE-ARGS vary depending on the MODE.57# Try `$progname --help --mode=MODE' for a more detailed description of MODE.58#59# When reporting a bug, please describe a test case to reproduce it and60# include the following information:61#62# host-triplet: $host63# shell: $SHELL64# compiler: $LTCC65# compiler flags: $LTCFLAGS66# linker: $LD (gnu? $with_gnu_ld)67# $progname: (GNU libtool) 2.2.6b68# automake: $automake_version69# autoconf: $autoconf_version70#71# Report bugs to <[email protected]>.7273PROGRAM=ltmain.sh74PACKAGE=libtool75VERSION=2.2.6b76TIMESTAMP=""77package_revision=1.30177879# Be Bourne compatible80if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then81emulate sh82NULLCMD=:83# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which84# is contrary to our usage. Disable this feature.85alias -g '${1+"$@"}'='"$@"'86setopt NO_GLOB_SUBST87else88case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac89fi90BIN_SH=xpg4; export BIN_SH # for Tru6491DUALCASE=1; export DUALCASE # for MKS sh9293# NLS nuisances: We save the old values to restore during execute mode.94# Only set LANG and LC_ALL to C if already set.95# These must not be set unconditionally because not all systems understand96# e.g. LANG=C (notably SCO).97lt_user_locale=98lt_safe_locale=99for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES100do101eval "if test \"\${$lt_var+set}\" = set; then102save_$lt_var=\$$lt_var103$lt_var=C104export $lt_var105lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"106lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"107fi"108done109110$lt_unset CDPATH111112113114115116: ${CP="cp -f"}117: ${ECHO="echo"}118: ${EGREP="/bin/grep -E"}119: ${FGREP="/bin/grep -F"}120: ${GREP="/bin/grep"}121: ${LN_S="ln -s"}122: ${MAKE="make"}123: ${MKDIR="mkdir"}124: ${MV="mv -f"}125: ${RM="rm -f"}126: ${SED="/bin/sed"}127: ${SHELL="${CONFIG_SHELL-/bin/sh}"}128: ${Xsed="$SED -e 1s/^X//"}129130# Global variables:131EXIT_SUCCESS=0132EXIT_FAILURE=1133EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.134EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.135136exit_status=$EXIT_SUCCESS137138# Make sure IFS has a sensible default139lt_nl='140'141IFS=" $lt_nl"142143dirname="s,/[^/]*$,,"144basename="s,^.*/,,"145146# func_dirname_and_basename file append nondir_replacement147# perform func_basename and func_dirname in a single function148# call:149# dirname: Compute the dirname of FILE. If nonempty,150# add APPEND to the result, otherwise set result151# to NONDIR_REPLACEMENT.152# value returned in "$func_dirname_result"153# basename: Compute filename of FILE.154# value retuned in "$func_basename_result"155# Implementation must be kept synchronized with func_dirname156# and func_basename. For efficiency, we do not delegate to157# those functions but instead duplicate the functionality here.158func_dirname_and_basename ()159{160# Extract subdirectory from the argument.161func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`162if test "X$func_dirname_result" = "X${1}"; then163func_dirname_result="${3}"164else165func_dirname_result="$func_dirname_result${2}"166fi167func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`168}169170# Generated shell functions inserted here.171172# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh173# is ksh but when the shell is invoked as "sh" and the current value of174# the _XPG environment variable is not equal to 1 (one), the special175# positional parameter $0, within a function call, is the name of the176# function.177progpath="$0"178179# The name of this program:180# In the unlikely event $progname began with a '-', it would play havoc with181# func_echo (imagine progname=-n), so we prepend ./ in that case:182func_dirname_and_basename "$progpath"183progname=$func_basename_result184case $progname in185-*) progname=./$progname ;;186esac187188# Make sure we have an absolute path for reexecution:189case $progpath in190[\\/]*|[A-Za-z]:\\*) ;;191*[\\/]*)192progdir=$func_dirname_result193progdir=`cd "$progdir" && pwd`194progpath="$progdir/$progname"195;;196*)197save_IFS="$IFS"198IFS=:199for progdir in $PATH; do200IFS="$save_IFS"201test -x "$progdir/$progname" && break202done203IFS="$save_IFS"204test -n "$progdir" || progdir=`pwd`205progpath="$progdir/$progname"206;;207esac208209# Sed substitution that helps us do robust quoting. It backslashifies210# metacharacters that are still active within double-quoted strings.211Xsed="${SED}"' -e 1s/^X//'212sed_quote_subst='s/\([`"$\\]\)/\\\1/g'213214# Same as above, but do not quote variable references.215double_quote_subst='s/\(["`\\]\)/\\\1/g'216217# Re-`\' parameter expansions in output of double_quote_subst that were218# `\'-ed in input to the same. If an odd number of `\' preceded a '$'219# in input to double_quote_subst, that '$' was protected from expansion.220# Since each input `\' is now two `\'s, look for any number of runs of221# four `\'s followed by two `\'s and then a '$'. `\' that '$'.222bs='\\'223bs2='\\\\'224bs4='\\\\\\\\'225dollar='\$'226sed_double_backslash="\227s/$bs4/&\\228/g229s/^$bs2$dollar/$bs&/230s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g231s/\n//g"232233# Standard options:234opt_dry_run=false235opt_help=false236opt_quiet=false237opt_verbose=false238opt_warning=:239240# func_echo arg...241# Echo program name prefixed message, along with the current mode242# name if it has been set yet.243func_echo ()244{245$ECHO "$progname${mode+: }$mode: $*"246}247248# func_verbose arg...249# Echo program name prefixed message in verbose mode only.250func_verbose ()251{252$opt_verbose && func_echo ${1+"$@"}253254# A bug in bash halts the script if the last line of a function255# fails when set -e is in force, so we need another command to256# work around that:257:258}259260# func_error arg...261# Echo program name prefixed message to standard error.262func_error ()263{264$ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2265}266267# func_warning arg...268# Echo program name prefixed warning message to standard error.269func_warning ()270{271$opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2272273# bash bug again:274:275}276277# func_fatal_error arg...278# Echo program name prefixed message to standard error, and exit.279func_fatal_error ()280{281func_error ${1+"$@"}282exit $EXIT_FAILURE283}284285# func_fatal_help arg...286# Echo program name prefixed message to standard error, followed by287# a help hint, and exit.288func_fatal_help ()289{290func_error ${1+"$@"}291func_fatal_error "$help"292}293help="Try \`$progname --help' for more information." ## default294295296# func_grep expression filename297# Check whether EXPRESSION matches any line of FILENAME, without output.298func_grep ()299{300$GREP "$1" "$2" >/dev/null 2>&1301}302303304# func_mkdir_p directory-path305# Make sure the entire path to DIRECTORY-PATH is available.306func_mkdir_p ()307{308my_directory_path="$1"309my_dir_list=310311if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then312313# Protect directory names starting with `-'314case $my_directory_path in315-*) my_directory_path="./$my_directory_path" ;;316esac317318# While some portion of DIR does not yet exist...319while test ! -d "$my_directory_path"; do320# ...make a list in topmost first order. Use a colon delimited321# list incase some portion of path contains whitespace.322my_dir_list="$my_directory_path:$my_dir_list"323324# If the last portion added has no slash in it, the list is done325case $my_directory_path in */*) ;; *) break ;; esac326327# ...otherwise throw away the child directory and loop328my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`329done330my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`331332save_mkdir_p_IFS="$IFS"; IFS=':'333for my_dir in $my_dir_list; do334IFS="$save_mkdir_p_IFS"335# mkdir can fail with a `File exist' error if two processes336# try to create one of the directories concurrently. Don't337# stop in that case!338$MKDIR "$my_dir" 2>/dev/null || :339done340IFS="$save_mkdir_p_IFS"341342# Bail out if we (or some other process) failed to create a directory.343test -d "$my_directory_path" || \344func_fatal_error "Failed to create \`$1'"345fi346}347348349# func_mktempdir [string]350# Make a temporary directory that won't clash with other running351# libtool processes, and avoids race conditions if possible. If352# given, STRING is the basename for that directory.353func_mktempdir ()354{355my_template="${TMPDIR-/tmp}/${1-$progname}"356357if test "$opt_dry_run" = ":"; then358# Return a directory name, but don't create it in dry-run mode359my_tmpdir="${my_template}-$$"360else361362# If mktemp works, use that first and foremost363my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`364365if test ! -d "$my_tmpdir"; then366# Failing that, at least try and use $RANDOM to avoid a race367my_tmpdir="${my_template}-${RANDOM-0}$$"368369save_mktempdir_umask=`umask`370umask 0077371$MKDIR "$my_tmpdir"372umask $save_mktempdir_umask373fi374375# If we're not in dry-run mode, bomb out on failure376test -d "$my_tmpdir" || \377func_fatal_error "cannot create temporary directory \`$my_tmpdir'"378fi379380$ECHO "X$my_tmpdir" | $Xsed381}382383384# func_quote_for_eval arg385# Aesthetically quote ARG to be evaled later.386# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT387# is double-quoted, suitable for a subsequent eval, whereas388# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters389# which are still active within double quotes backslashified.390func_quote_for_eval ()391{392case $1 in393*[\\\`\"\$]*)394func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;395*)396func_quote_for_eval_unquoted_result="$1" ;;397esac398399case $func_quote_for_eval_unquoted_result in400# Double-quote args containing shell metacharacters to delay401# word splitting, command substitution and and variable402# expansion for a subsequent eval.403# Many Bourne shells cannot handle close brackets correctly404# in scan sets, so we specify it separately.405*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")406func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""407;;408*)409func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"410esac411}412413414# func_quote_for_expand arg415# Aesthetically quote ARG to be evaled later; same as above,416# but do not quote variable references.417func_quote_for_expand ()418{419case $1 in420*[\\\`\"]*)421my_arg=`$ECHO "X$1" | $Xsed \422-e "$double_quote_subst" -e "$sed_double_backslash"` ;;423*)424my_arg="$1" ;;425esac426427case $my_arg in428# Double-quote args containing shell metacharacters to delay429# word splitting and command substitution for a subsequent eval.430# Many Bourne shells cannot handle close brackets correctly431# in scan sets, so we specify it separately.432*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")433my_arg="\"$my_arg\""434;;435esac436437func_quote_for_expand_result="$my_arg"438}439440441# func_show_eval cmd [fail_exp]442# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is443# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP444# is given, then evaluate it.445func_show_eval ()446{447my_cmd="$1"448my_fail_exp="${2-:}"449450${opt_silent-false} || {451func_quote_for_expand "$my_cmd"452eval "func_echo $func_quote_for_expand_result"453}454455if ${opt_dry_run-false}; then :; else456eval "$my_cmd"457my_status=$?458if test "$my_status" -eq 0; then :; else459eval "(exit $my_status); $my_fail_exp"460fi461fi462}463464465# func_show_eval_locale cmd [fail_exp]466# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is467# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP468# is given, then evaluate it. Use the saved locale for evaluation.469func_show_eval_locale ()470{471my_cmd="$1"472my_fail_exp="${2-:}"473474${opt_silent-false} || {475func_quote_for_expand "$my_cmd"476eval "func_echo $func_quote_for_expand_result"477}478479if ${opt_dry_run-false}; then :; else480eval "$lt_user_locale481$my_cmd"482my_status=$?483eval "$lt_safe_locale"484if test "$my_status" -eq 0; then :; else485eval "(exit $my_status); $my_fail_exp"486fi487fi488}489490491492493494# func_version495# Echo version message to standard output and exit.496func_version ()497{498$SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {499s/^# //500s/^# *$//501s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/502p503}' < "$progpath"504exit $?505}506507# func_usage508# Echo short help message to standard output and exit.509func_usage ()510{511$SED -n '/^# Usage:/,/# -h/ {512s/^# //513s/^# *$//514s/\$progname/'$progname'/515p516}' < "$progpath"517$ECHO518$ECHO "run \`$progname --help | more' for full usage"519exit $?520}521522# func_help523# Echo long help message to standard output and exit.524func_help ()525{526$SED -n '/^# Usage:/,/# Report bugs to/ {527s/^# //528s/^# *$//529s*\$progname*'$progname'*530s*\$host*'"$host"'*531s*\$SHELL*'"$SHELL"'*532s*\$LTCC*'"$LTCC"'*533s*\$LTCFLAGS*'"$LTCFLAGS"'*534s*\$LD*'"$LD"'*535s/\$with_gnu_ld/'"$with_gnu_ld"'/536s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/537s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/538p539}' < "$progpath"540exit $?541}542543# func_missing_arg argname544# Echo program name prefixed message to standard error and set global545# exit_cmd.546func_missing_arg ()547{548func_error "missing argument for $1"549exit_cmd=exit550}551552exit_cmd=:553554555556557558# Check that we have a working $ECHO.559if test "X$1" = X--no-reexec; then560# Discard the --no-reexec flag, and continue.561shift562elif test "X$1" = X--fallback-echo; then563# Avoid inline document here, it may be left over564:565elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then566# Yippee, $ECHO works!567:568else569# Restart under the correct shell, and then maybe $ECHO will work.570exec $SHELL "$progpath" --no-reexec ${1+"$@"}571fi572573if test "X$1" = X--fallback-echo; then574# used as fallback echo575shift576cat <<EOF577$*578EOF579exit $EXIT_SUCCESS580fi581582magic="%%%MAGIC variable%%%"583magic_exe="%%%MAGIC EXE variable%%%"584585# Global variables.586# $mode is unset587nonopt=588execute_dlfiles=589preserve_args=590lo2o="s/\\.lo\$/.${objext}/"591o2lo="s/\\.${objext}\$/.lo/"592extracted_archives=593extracted_serial=0594595opt_dry_run=false596opt_duplicate_deps=false597opt_silent=false598opt_debug=:599600# If this variable is set in any of the actions, the command in it601# will be execed at the end. This prevents here-documents from being602# left over by shells.603exec_cmd=604605# func_fatal_configuration arg...606# Echo program name prefixed message to standard error, followed by607# a configuration failure hint, and exit.608func_fatal_configuration ()609{610func_error ${1+"$@"}611func_error "See the $PACKAGE documentation for more information."612func_fatal_error "Fatal configuration error."613}614615616# func_config617# Display the configuration for all the tags in this script.618func_config ()619{620re_begincf='^# ### BEGIN LIBTOOL'621re_endcf='^# ### END LIBTOOL'622623# Default configuration.624$SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"625626# Now print the configurations for the tags.627for tagname in $taglist; do628$SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"629done630631exit $?632}633634# func_features635# Display the features supported by this script.636func_features ()637{638$ECHO "host: $host"639if test "$build_libtool_libs" = yes; then640$ECHO "enable shared libraries"641else642$ECHO "disable shared libraries"643fi644if test "$build_old_libs" = yes; then645$ECHO "enable static libraries"646else647$ECHO "disable static libraries"648fi649650exit $?651}652653# func_enable_tag tagname654# Verify that TAGNAME is valid, and either flag an error and exit, or655# enable the TAGNAME tag. We also add TAGNAME to the global $taglist656# variable here.657func_enable_tag ()658{659# Global variable:660tagname="$1"661662re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"663re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"664sed_extractcf="/$re_begincf/,/$re_endcf/p"665666# Validate tagname.667case $tagname in668*[!-_A-Za-z0-9,/]*)669func_fatal_error "invalid tag name: $tagname"670;;671esac672673# Don't test for the "default" C tag, as we know it's674# there but not specially marked.675case $tagname in676CC) ;;677*)678if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then679taglist="$taglist $tagname"680681# Evaluate the configuration. Be careful to quote the path682# and the sed script, to avoid splitting on whitespace, but683# also don't use non-portable quotes within backquotes within684# quotes we have to do it in 2 steps:685extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`686eval "$extractedcf"687else688func_error "ignoring unknown tag $tagname"689fi690;;691esac692}693694# Parse options once, thoroughly. This comes as soon as possible in695# the script to make things like `libtool --version' happen quickly.696{697698# Shorthand for --mode=foo, only valid as the first argument699case $1 in700clean|clea|cle|cl)701shift; set dummy --mode clean ${1+"$@"}; shift702;;703compile|compil|compi|comp|com|co|c)704shift; set dummy --mode compile ${1+"$@"}; shift705;;706execute|execut|execu|exec|exe|ex|e)707shift; set dummy --mode execute ${1+"$@"}; shift708;;709finish|finis|fini|fin|fi|f)710shift; set dummy --mode finish ${1+"$@"}; shift711;;712install|instal|insta|inst|ins|in|i)713shift; set dummy --mode install ${1+"$@"}; shift714;;715link|lin|li|l)716shift; set dummy --mode link ${1+"$@"}; shift717;;718uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)719shift; set dummy --mode uninstall ${1+"$@"}; shift720;;721esac722723# Parse non-mode specific arguments:724while test "$#" -gt 0; do725opt="$1"726shift727728case $opt in729--config) func_config ;;730731--debug) preserve_args="$preserve_args $opt"732func_echo "enabling shell trace mode"733opt_debug='set -x'734$opt_debug735;;736737-dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break738execute_dlfiles="$execute_dlfiles $1"739shift740;;741742--dry-run | -n) opt_dry_run=: ;;743--features) func_features ;;744--finish) mode="finish" ;;745746--mode) test "$#" -eq 0 && func_missing_arg "$opt" && break747case $1 in748# Valid mode arguments:749clean) ;;750compile) ;;751execute) ;;752finish) ;;753install) ;;754link) ;;755relink) ;;756uninstall) ;;757758# Catch anything else as an error759*) func_error "invalid argument for $opt"760exit_cmd=exit761break762;;763esac764765mode="$1"766shift767;;768769--preserve-dup-deps)770opt_duplicate_deps=: ;;771772--quiet|--silent) preserve_args="$preserve_args $opt"773opt_silent=:774;;775776--verbose| -v) preserve_args="$preserve_args $opt"777opt_silent=false778;;779780--tag) test "$#" -eq 0 && func_missing_arg "$opt" && break781preserve_args="$preserve_args $opt $1"782func_enable_tag "$1" # tagname is set here783shift784;;785786# Separate optargs to long options:787-dlopen=*|--mode=*|--tag=*)788func_opt_split "$opt"789set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}790shift791;;792793-\?|-h) func_usage ;;794--help) opt_help=: ;;795--version) func_version ;;796797-*) func_fatal_help "unrecognized option \`$opt'" ;;798799*) nonopt="$opt"800break801;;802esac803done804805806case $host in807*cygwin* | *mingw* | *pw32* | *cegcc*)808# don't eliminate duplications in $postdeps and $predeps809opt_duplicate_compiler_generated_deps=:810;;811*)812opt_duplicate_compiler_generated_deps=$opt_duplicate_deps813;;814esac815816# Having warned about all mis-specified options, bail out if817# anything was wrong.818$exit_cmd $EXIT_FAILURE819}820821# func_check_version_match822# Ensure that we are using m4 macros, and libtool script from the same823# release of libtool.824func_check_version_match ()825{826if test "$package_revision" != "$macro_revision"; then827if test "$VERSION" != "$macro_version"; then828if test -z "$macro_version"; then829cat >&2 <<_LT_EOF830$progname: Version mismatch error. This is $PACKAGE $VERSION, but the831$progname: definition of this LT_INIT comes from an older release.832$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION833$progname: and run autoconf again.834_LT_EOF835else836cat >&2 <<_LT_EOF837$progname: Version mismatch error. This is $PACKAGE $VERSION, but the838$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.839$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION840$progname: and run autoconf again.841_LT_EOF842fi843else844cat >&2 <<_LT_EOF845$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,846$progname: but the definition of this LT_INIT comes from revision $macro_revision.847$progname: You should recreate aclocal.m4 with macros from revision $package_revision848$progname: of $PACKAGE $VERSION and run autoconf again.849_LT_EOF850fi851852exit $EXIT_MISMATCH853fi854}855856857## ----------- ##858## Main. ##859## ----------- ##860861$opt_help || {862# Sanity checks first:863func_check_version_match864865if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then866func_fatal_configuration "not configured to build any kind of library"867fi868869test -z "$mode" && func_fatal_error "error: you must specify a MODE."870871872# Darwin sucks873eval std_shrext=\"$shrext_cmds\"874875876# Only execute mode is allowed to have -dlopen flags.877if test -n "$execute_dlfiles" && test "$mode" != execute; then878func_error "unrecognized option \`-dlopen'"879$ECHO "$help" 1>&2880exit $EXIT_FAILURE881fi882883# Change the help message to a mode-specific one.884generic_help="$help"885help="Try \`$progname --help --mode=$mode' for more information."886}887888889# func_lalib_p file890# True iff FILE is a libtool `.la' library or `.lo' object file.891# This function is only a basic sanity check; it will hardly flush out892# determined imposters.893func_lalib_p ()894{895test -f "$1" &&896$SED -e 4q "$1" 2>/dev/null \897| $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1898}899900# func_lalib_unsafe_p file901# True iff FILE is a libtool `.la' library or `.lo' object file.902# This function implements the same check as func_lalib_p without903# resorting to external programs. To this end, it redirects stdin and904# closes it afterwards, without saving the original file descriptor.905# As a safety measure, use it only where a negative result would be906# fatal anyway. Works if `file' does not exist.907func_lalib_unsafe_p ()908{909lalib_p=no910if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then911for lalib_p_l in 1 2 3 4912do913read lalib_p_line914case "$lalib_p_line" in915\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;916esac917done918exec 0<&5 5<&-919fi920test "$lalib_p" = yes921}922923# func_ltwrapper_script_p file924# True iff FILE is a libtool wrapper script925# This function is only a basic sanity check; it will hardly flush out926# determined imposters.927func_ltwrapper_script_p ()928{929func_lalib_p "$1"930}931932# func_ltwrapper_executable_p file933# True iff FILE is a libtool wrapper executable934# This function is only a basic sanity check; it will hardly flush out935# determined imposters.936func_ltwrapper_executable_p ()937{938func_ltwrapper_exec_suffix=939case $1 in940*.exe) ;;941*) func_ltwrapper_exec_suffix=.exe ;;942esac943$GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1944}945946# func_ltwrapper_scriptname file947# Assumes file is an ltwrapper_executable948# uses $file to determine the appropriate filename for a949# temporary ltwrapper_script.950func_ltwrapper_scriptname ()951{952func_ltwrapper_scriptname_result=""953if func_ltwrapper_executable_p "$1"; then954func_dirname_and_basename "$1" "" "."955func_stripname '' '.exe' "$func_basename_result"956func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"957fi958}959960# func_ltwrapper_p file961# True iff FILE is a libtool wrapper script or wrapper executable962# This function is only a basic sanity check; it will hardly flush out963# determined imposters.964func_ltwrapper_p ()965{966func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"967}968969970# func_execute_cmds commands fail_cmd971# Execute tilde-delimited COMMANDS.972# If FAIL_CMD is given, eval that upon failure.973# FAIL_CMD may read-access the current command in variable CMD!974func_execute_cmds ()975{976$opt_debug977save_ifs=$IFS; IFS='~'978for cmd in $1; do979IFS=$save_ifs980eval cmd=\"$cmd\"981func_show_eval "$cmd" "${2-:}"982done983IFS=$save_ifs984}985986987# func_source file988# Source FILE, adding directory component if necessary.989# Note that it is not necessary on cygwin/mingw to append a dot to990# FILE even if both FILE and FILE.exe exist: automatic-append-.exe991# behavior happens only for exec(3), not for open(2)! Also, sourcing992# `FILE.' does not work on cygwin managed mounts.993func_source ()994{995$opt_debug996case $1 in997*/* | *\\*) . "$1" ;;998*) . "./$1" ;;999esac1000}100110021003# func_infer_tag arg1004# Infer tagged configuration to use if any are available and1005# if one wasn't chosen via the "--tag" command line option.1006# Only attempt this if the compiler in the base compile1007# command doesn't match the default compiler.1008# arg is usually of the form 'gcc ...'1009func_infer_tag ()1010{1011$opt_debug1012if test -n "$available_tags" && test -z "$tagname"; then1013CC_quoted=1014for arg in $CC; do1015func_quote_for_eval "$arg"1016CC_quoted="$CC_quoted $func_quote_for_eval_result"1017done1018case $@ in1019# Blanks in the command may have been stripped by the calling shell,1020# but not from the CC environment variable when configure was run.1021" $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;1022# Blanks at the start of $base_compile will cause this to fail1023# if we don't check for them as well.1024*)1025for z in $available_tags; do1026if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then1027# Evaluate the configuration.1028eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"1029CC_quoted=1030for arg in $CC; do1031# Double-quote args containing other shell metacharacters.1032func_quote_for_eval "$arg"1033CC_quoted="$CC_quoted $func_quote_for_eval_result"1034done1035case "$@ " in1036" $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)1037# The compiler in the base compile command matches1038# the one in the tagged configuration.1039# Assume this is the tagged configuration we want.1040tagname=$z1041break1042;;1043esac1044fi1045done1046# If $tagname still isn't set, then no tagged configuration1047# was found and let the user know that the "--tag" command1048# line option must be used.1049if test -z "$tagname"; then1050func_echo "unable to infer tagged configuration"1051func_fatal_error "specify a tag with \`--tag'"1052# else1053# func_verbose "using $tagname tagged configuration"1054fi1055;;1056esac1057fi1058}1059106010611062# func_write_libtool_object output_name pic_name nonpic_name1063# Create a libtool object file (analogous to a ".la" file),1064# but don't create it if we're doing a dry run.1065func_write_libtool_object ()1066{1067write_libobj=${1}1068if test "$build_libtool_libs" = yes; then1069write_lobj=\'${2}\'1070else1071write_lobj=none1072fi10731074if test "$build_old_libs" = yes; then1075write_oldobj=\'${3}\'1076else1077write_oldobj=none1078fi10791080$opt_dry_run || {1081cat >${write_libobj}T <<EOF1082# $write_libobj - a libtool object file1083# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION1084#1085# Please DO NOT delete this file!1086# It is necessary for linking the library.10871088# Name of the PIC object.1089pic_object=$write_lobj10901091# Name of the non-PIC object1092non_pic_object=$write_oldobj10931094EOF1095$MV "${write_libobj}T" "${write_libobj}"1096}1097}10981099# func_mode_compile arg...1100func_mode_compile ()1101{1102$opt_debug1103# Get the compilation command and the source file.1104base_compile=1105srcfile="$nonopt" # always keep a non-empty value in "srcfile"1106suppress_opt=yes1107suppress_output=1108arg_mode=normal1109libobj=1110later=1111pie_flag=11121113for arg1114do1115case $arg_mode in1116arg )1117# do not "continue". Instead, add this to base_compile1118lastarg="$arg"1119arg_mode=normal1120;;11211122target )1123libobj="$arg"1124arg_mode=normal1125continue1126;;11271128normal )1129# Accept any command-line options.1130case $arg in1131-o)1132test -n "$libobj" && \1133func_fatal_error "you cannot specify \`-o' more than once"1134arg_mode=target1135continue1136;;11371138-pie | -fpie | -fPIE)1139pie_flag="$pie_flag $arg"1140continue1141;;11421143-shared | -static | -prefer-pic | -prefer-non-pic)1144later="$later $arg"1145continue1146;;11471148-no-suppress)1149suppress_opt=no1150continue1151;;11521153-Xcompiler)1154arg_mode=arg # the next one goes into the "base_compile" arg list1155continue # The current "srcfile" will either be retained or1156;; # replaced later. I would guess that would be a bug.11571158-Wc,*)1159func_stripname '-Wc,' '' "$arg"1160args=$func_stripname_result1161lastarg=1162save_ifs="$IFS"; IFS=','1163for arg in $args; do1164IFS="$save_ifs"1165func_quote_for_eval "$arg"1166lastarg="$lastarg $func_quote_for_eval_result"1167done1168IFS="$save_ifs"1169func_stripname ' ' '' "$lastarg"1170lastarg=$func_stripname_result11711172# Add the arguments to base_compile.1173base_compile="$base_compile $lastarg"1174continue1175;;11761177*)1178# Accept the current argument as the source file.1179# The previous "srcfile" becomes the current argument.1180#1181lastarg="$srcfile"1182srcfile="$arg"1183;;1184esac # case $arg1185;;1186esac # case $arg_mode11871188# Aesthetically quote the previous argument.1189func_quote_for_eval "$lastarg"1190base_compile="$base_compile $func_quote_for_eval_result"1191done # for arg11921193case $arg_mode in1194arg)1195func_fatal_error "you must specify an argument for -Xcompile"1196;;1197target)1198func_fatal_error "you must specify a target with \`-o'"1199;;1200*)1201# Get the name of the library object.1202test -z "$libobj" && {1203func_basename "$srcfile"1204libobj="$func_basename_result"1205}1206;;1207esac12081209# Recognize several different file suffixes.1210# If the user specifies -o file.o, it is replaced with file.lo1211case $libobj in1212*.[cCFSifmso] | \1213*.ada | *.adb | *.ads | *.asm | \1214*.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \1215*.[fF][09]? | *.for | *.java | *.obj | *.sx)1216func_xform "$libobj"1217libobj=$func_xform_result1218;;1219esac12201221case $libobj in1222*.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;1223*)1224func_fatal_error "cannot determine name of library object from \`$libobj'"1225;;1226esac12271228func_infer_tag $base_compile12291230for arg in $later; do1231case $arg in1232-shared)1233test "$build_libtool_libs" != yes && \1234func_fatal_configuration "can not build a shared library"1235build_old_libs=no1236continue1237;;12381239-static)1240build_libtool_libs=no1241build_old_libs=yes1242continue1243;;12441245-prefer-pic)1246pic_mode=yes1247continue1248;;12491250-prefer-non-pic)1251pic_mode=no1252continue1253;;1254esac1255done12561257func_quote_for_eval "$libobj"1258test "X$libobj" != "X$func_quote_for_eval_result" \1259&& $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \1260&& func_warning "libobj name \`$libobj' may not contain shell special characters."1261func_dirname_and_basename "$obj" "/" ""1262objname="$func_basename_result"1263xdir="$func_dirname_result"1264lobj=${xdir}$objdir/$objname12651266test -z "$base_compile" && \1267func_fatal_help "you must specify a compilation command"12681269# Delete any leftover library objects.1270if test "$build_old_libs" = yes; then1271removelist="$obj $lobj $libobj ${libobj}T"1272else1273removelist="$lobj $libobj ${libobj}T"1274fi12751276# On Cygwin there's no "real" PIC flag so we must build both object types1277case $host_os in1278cygwin* | mingw* | pw32* | os2* | cegcc*)1279pic_mode=default1280;;1281esac1282if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then1283# non-PIC code in shared libraries is not supported1284pic_mode=default1285fi12861287# Calculate the filename of the output object if compiler does1288# not support -o with -c1289if test "$compiler_c_o" = no; then1290output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}1291lockfile="$output_obj.lock"1292else1293output_obj=1294need_locks=no1295lockfile=1296fi12971298# Lock this critical section if it is needed1299# We use this script file to make the link, it avoids creating a new file1300if test "$need_locks" = yes; then1301until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do1302func_echo "Waiting for $lockfile to be removed"1303sleep 21304done1305elif test "$need_locks" = warn; then1306if test -f "$lockfile"; then1307$ECHO "\1308*** ERROR, $lockfile exists and contains:1309`cat $lockfile 2>/dev/null`13101311This indicates that another process is trying to use the same1312temporary object file, and libtool could not work around it because1313your compiler does not support \`-c' and \`-o' together. If you1314repeat this compilation, it may succeed, by chance, but you had better1315avoid parallel builds (make -j) in this platform, or get a better1316compiler."13171318$opt_dry_run || $RM $removelist1319exit $EXIT_FAILURE1320fi1321removelist="$removelist $output_obj"1322$ECHO "$srcfile" > "$lockfile"1323fi13241325$opt_dry_run || $RM $removelist1326removelist="$removelist $lockfile"1327trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 1513281329if test -n "$fix_srcfile_path"; then1330eval srcfile=\"$fix_srcfile_path\"1331fi1332func_quote_for_eval "$srcfile"1333qsrcfile=$func_quote_for_eval_result13341335# Only build a PIC object if we are building libtool libraries.1336if test "$build_libtool_libs" = yes; then1337# Without this assignment, base_compile gets emptied.1338fbsd_hideous_sh_bug=$base_compile13391340if test "$pic_mode" != no; then1341command="$base_compile $qsrcfile $pic_flag"1342else1343# Don't build PIC code1344command="$base_compile $qsrcfile"1345fi13461347func_mkdir_p "$xdir$objdir"13481349if test -z "$output_obj"; then1350# Place PIC objects in $objdir1351command="$command -o $lobj"1352fi13531354func_show_eval_locale "$command" \1355'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'13561357if test "$need_locks" = warn &&1358test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then1359$ECHO "\1360*** ERROR, $lockfile contains:1361`cat $lockfile 2>/dev/null`13621363but it should contain:1364$srcfile13651366This indicates that another process is trying to use the same1367temporary object file, and libtool could not work around it because1368your compiler does not support \`-c' and \`-o' together. If you1369repeat this compilation, it may succeed, by chance, but you had better1370avoid parallel builds (make -j) in this platform, or get a better1371compiler."13721373$opt_dry_run || $RM $removelist1374exit $EXIT_FAILURE1375fi13761377# Just move the object if needed, then go on to compile the next one1378if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then1379func_show_eval '$MV "$output_obj" "$lobj"' \1380'error=$?; $opt_dry_run || $RM $removelist; exit $error'1381fi13821383# Allow error messages only from the first compilation.1384if test "$suppress_opt" = yes; then1385suppress_output=' >/dev/null 2>&1'1386fi1387fi13881389# Only build a position-dependent object if we build old libraries.1390if test "$build_old_libs" = yes; then1391if test "$pic_mode" != yes; then1392# Don't build PIC code1393command="$base_compile $qsrcfile$pie_flag"1394else1395command="$base_compile $qsrcfile $pic_flag"1396fi1397if test "$compiler_c_o" = yes; then1398command="$command -o $obj"1399fi14001401# Suppress compiler output if we already did a PIC compilation.1402command="$command$suppress_output"1403func_show_eval_locale "$command" \1404'$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'14051406if test "$need_locks" = warn &&1407test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then1408$ECHO "\1409*** ERROR, $lockfile contains:1410`cat $lockfile 2>/dev/null`14111412but it should contain:1413$srcfile14141415This indicates that another process is trying to use the same1416temporary object file, and libtool could not work around it because1417your compiler does not support \`-c' and \`-o' together. If you1418repeat this compilation, it may succeed, by chance, but you had better1419avoid parallel builds (make -j) in this platform, or get a better1420compiler."14211422$opt_dry_run || $RM $removelist1423exit $EXIT_FAILURE1424fi14251426# Just move the object if needed1427if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then1428func_show_eval '$MV "$output_obj" "$obj"' \1429'error=$?; $opt_dry_run || $RM $removelist; exit $error'1430fi1431fi14321433$opt_dry_run || {1434func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"14351436# Unlock the critical section if it was locked1437if test "$need_locks" != no; then1438removelist=$lockfile1439$RM "$lockfile"1440fi1441}14421443exit $EXIT_SUCCESS1444}14451446$opt_help || {1447test "$mode" = compile && func_mode_compile ${1+"$@"}1448}14491450func_mode_help ()1451{1452# We need to display help for each of the modes.1453case $mode in1454"")1455# Generic help is extracted from the usage comments1456# at the start of this file.1457func_help1458;;14591460clean)1461$ECHO \1462"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...14631464Remove files from the build directory.14651466RM is the name of the program to use to delete files associated with each FILE1467(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed1468to RM.14691470If FILE is a libtool library, object or program, all the files associated1471with it are deleted. Otherwise, only FILE itself is deleted using RM."1472;;14731474compile)1475$ECHO \1476"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE14771478Compile a source file into a libtool library object.14791480This mode accepts the following additional options:14811482-o OUTPUT-FILE set the output file name to OUTPUT-FILE1483-no-suppress do not suppress compiler output for multiple passes1484-prefer-pic try to building PIC objects only1485-prefer-non-pic try to building non-PIC objects only1486-shared do not build a \`.o' file suitable for static linking1487-static only build a \`.o' file suitable for static linking14881489COMPILE-COMMAND is a command to be used in creating a \`standard' object file1490from the given SOURCEFILE.14911492The output file name is determined by removing the directory component from1493SOURCEFILE, then substituting the C source code suffix \`.c' with the1494library object suffix, \`.lo'."1495;;14961497execute)1498$ECHO \1499"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...15001501Automatically set library path, then run a program.15021503This mode accepts the following additional options:15041505-dlopen FILE add the directory containing FILE to the library path15061507This mode sets the library path environment variable according to \`-dlopen'1508flags.15091510If any of the ARGS are libtool executable wrappers, then they are translated1511into their corresponding uninstalled binary, and any of their required library1512directories are added to the library path.15131514Then, COMMAND is executed, with ARGS as arguments."1515;;15161517finish)1518$ECHO \1519"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...15201521Complete the installation of libtool libraries.15221523Each LIBDIR is a directory that contains libtool libraries.15241525The commands that this mode executes may require superuser privileges. Use1526the \`--dry-run' option if you just want to see what would be executed."1527;;15281529install)1530$ECHO \1531"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...15321533Install executables or libraries.15341535INSTALL-COMMAND is the installation command. The first component should be1536either the \`install' or \`cp' program.15371538The following components of INSTALL-COMMAND are treated specially:15391540-inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation15411542The rest of the components are interpreted as arguments to that command (only1543BSD-compatible install options are recognized)."1544;;15451546link)1547$ECHO \1548"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...15491550Link object files or libraries together to form another library, or to1551create an executable program.15521553LINK-COMMAND is a command using the C compiler that you would use to create1554a program from several object files.15551556The following components of LINK-COMMAND are treated specially:15571558-all-static do not do any dynamic linking at all1559-avoid-version do not add a version suffix if possible1560-dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime1561-dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols1562-export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)1563-export-symbols SYMFILE1564try to export only the symbols listed in SYMFILE1565-export-symbols-regex REGEX1566try to export only the symbols matching REGEX1567-LLIBDIR search LIBDIR for required installed libraries1568-lNAME OUTPUT-FILE requires the installed library libNAME1569-module build a library that can dlopened1570-no-fast-install disable the fast-install mode1571-no-install link a not-installable executable1572-no-undefined declare that a library does not refer to external symbols1573-o OUTPUT-FILE create OUTPUT-FILE from the specified objects1574-objectlist FILE Use a list of object files found in FILE to specify objects1575-precious-files-regex REGEX1576don't remove output files matching REGEX1577-release RELEASE specify package release information1578-rpath LIBDIR the created library will eventually be installed in LIBDIR1579-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries1580-shared only do dynamic linking of libtool libraries1581-shrext SUFFIX override the standard shared library file extension1582-static do not do any dynamic linking of uninstalled libtool libraries1583-static-libtool-libs1584do not do any dynamic linking of libtool libraries1585-version-info CURRENT[:REVISION[:AGE]]1586specify library version info [each variable defaults to 0]1587-weak LIBNAME declare that the target provides the LIBNAME interface15881589All other options (arguments beginning with \`-') are ignored.15901591Every other argument is treated as a filename. Files ending in \`.la' are1592treated as uninstalled libtool libraries, other files are standard or library1593object files.15941595If the OUTPUT-FILE ends in \`.la', then a libtool library is created,1596only library objects (\`.lo' files) may be specified, and \`-rpath' is1597required, except when creating a convenience library.15981599If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created1600using \`ar' and \`ranlib', or on Windows using \`lib'.16011602If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file1603is created, otherwise an executable program is created."1604;;16051606uninstall)1607$ECHO \1608"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...16091610Remove libraries from an installation directory.16111612RM is the name of the program to use to delete files associated with each FILE1613(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed1614to RM.16151616If FILE is a libtool library, all the files associated with it are deleted.1617Otherwise, only FILE itself is deleted using RM."1618;;16191620*)1621func_fatal_help "invalid operation mode \`$mode'"1622;;1623esac16241625$ECHO1626$ECHO "Try \`$progname --help' for more information about other modes."16271628exit $?1629}16301631# Now that we've collected a possible --mode arg, show help if necessary1632$opt_help && func_mode_help163316341635# func_mode_execute arg...1636func_mode_execute ()1637{1638$opt_debug1639# The first argument is the command name.1640cmd="$nonopt"1641test -z "$cmd" && \1642func_fatal_help "you must specify a COMMAND"16431644# Handle -dlopen flags immediately.1645for file in $execute_dlfiles; do1646test -f "$file" \1647|| func_fatal_help "\`$file' is not a file"16481649dir=1650case $file in1651*.la)1652# Check to see that this really is a libtool archive.1653func_lalib_unsafe_p "$file" \1654|| func_fatal_help "\`$lib' is not a valid libtool archive"16551656# Read the libtool library.1657dlname=1658library_names=1659func_source "$file"16601661# Skip this library if it cannot be dlopened.1662if test -z "$dlname"; then1663# Warn if it was a shared library.1664test -n "$library_names" && \1665func_warning "\`$file' was not linked with \`-export-dynamic'"1666continue1667fi16681669func_dirname "$file" "" "."1670dir="$func_dirname_result"16711672if test -f "$dir/$objdir/$dlname"; then1673dir="$dir/$objdir"1674else1675if test ! -f "$dir/$dlname"; then1676func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"1677fi1678fi1679;;16801681*.lo)1682# Just add the directory containing the .lo file.1683func_dirname "$file" "" "."1684dir="$func_dirname_result"1685;;16861687*)1688func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"1689continue1690;;1691esac16921693# Get the absolute pathname.1694absdir=`cd "$dir" && pwd`1695test -n "$absdir" && dir="$absdir"16961697# Now add the directory to shlibpath_var.1698if eval "test -z \"\$$shlibpath_var\""; then1699eval "$shlibpath_var=\"\$dir\""1700else1701eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""1702fi1703done17041705# This variable tells wrapper scripts just to set shlibpath_var1706# rather than running their programs.1707libtool_execute_magic="$magic"17081709# Check if any of the arguments is a wrapper script.1710args=1711for file1712do1713case $file in1714-*) ;;1715*)1716# Do a test to see if this is really a libtool program.1717if func_ltwrapper_script_p "$file"; then1718func_source "$file"1719# Transform arg to wrapped name.1720file="$progdir/$program"1721elif func_ltwrapper_executable_p "$file"; then1722func_ltwrapper_scriptname "$file"1723func_source "$func_ltwrapper_scriptname_result"1724# Transform arg to wrapped name.1725file="$progdir/$program"1726fi1727;;1728esac1729# Quote arguments (to preserve shell metacharacters).1730func_quote_for_eval "$file"1731args="$args $func_quote_for_eval_result"1732done17331734if test "X$opt_dry_run" = Xfalse; then1735if test -n "$shlibpath_var"; then1736# Export the shlibpath_var.1737eval "export $shlibpath_var"1738fi17391740# Restore saved environment variables1741for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES1742do1743eval "if test \"\${save_$lt_var+set}\" = set; then1744$lt_var=\$save_$lt_var; export $lt_var1745else1746$lt_unset $lt_var1747fi"1748done17491750# Now prepare to actually exec the command.1751exec_cmd="\$cmd$args"1752else1753# Display what would be done.1754if test -n "$shlibpath_var"; then1755eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""1756$ECHO "export $shlibpath_var"1757fi1758$ECHO "$cmd$args"1759exit $EXIT_SUCCESS1760fi1761}17621763test "$mode" = execute && func_mode_execute ${1+"$@"}176417651766# func_mode_finish arg...1767func_mode_finish ()1768{1769$opt_debug1770libdirs="$nonopt"1771admincmds=17721773if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then1774for dir1775do1776libdirs="$libdirs $dir"1777done17781779for libdir in $libdirs; do1780if test -n "$finish_cmds"; then1781# Do each command in the finish commands.1782func_execute_cmds "$finish_cmds" 'admincmds="$admincmds1783'"$cmd"'"'1784fi1785if test -n "$finish_eval"; then1786# Do the single finish_eval.1787eval cmds=\"$finish_eval\"1788$opt_dry_run || eval "$cmds" || admincmds="$admincmds1789$cmds"1790fi1791done1792fi17931794# Exit here if they wanted silent mode.1795$opt_silent && exit $EXIT_SUCCESS17961797$ECHO "X----------------------------------------------------------------------" | $Xsed1798$ECHO "Libraries have been installed in:"1799for libdir in $libdirs; do1800$ECHO " $libdir"1801done1802$ECHO1803$ECHO "If you ever happen to want to link against installed libraries"1804$ECHO "in a given directory, LIBDIR, you must either use libtool, and"1805$ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"1806$ECHO "flag during linking and do at least one of the following:"1807if test -n "$shlibpath_var"; then1808$ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable"1809$ECHO " during execution"1810fi1811if test -n "$runpath_var"; then1812$ECHO " - add LIBDIR to the \`$runpath_var' environment variable"1813$ECHO " during linking"1814fi1815if test -n "$hardcode_libdir_flag_spec"; then1816libdir=LIBDIR1817eval flag=\"$hardcode_libdir_flag_spec\"18181819$ECHO " - use the \`$flag' linker flag"1820fi1821if test -n "$admincmds"; then1822$ECHO " - have your system administrator run these commands:$admincmds"1823fi1824if test -f /etc/ld.so.conf; then1825$ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"1826fi1827$ECHO18281829$ECHO "See any operating system documentation about shared libraries for"1830case $host in1831solaris2.[6789]|solaris2.1[0-9])1832$ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"1833$ECHO "pages."1834;;1835*)1836$ECHO "more information, such as the ld(1) and ld.so(8) manual pages."1837;;1838esac1839$ECHO "X----------------------------------------------------------------------" | $Xsed1840exit $EXIT_SUCCESS1841}18421843test "$mode" = finish && func_mode_finish ${1+"$@"}184418451846# func_mode_install arg...1847func_mode_install ()1848{1849$opt_debug1850# There may be an optional sh(1) argument at the beginning of1851# install_prog (especially on Windows NT).1852if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||1853# Allow the use of GNU shtool's install command.1854$ECHO "X$nonopt" | $GREP shtool >/dev/null; then1855# Aesthetically quote it.1856func_quote_for_eval "$nonopt"1857install_prog="$func_quote_for_eval_result "1858arg=$11859shift1860else1861install_prog=1862arg=$nonopt1863fi18641865# The real first argument should be the name of the installation program.1866# Aesthetically quote it.1867func_quote_for_eval "$arg"1868install_prog="$install_prog$func_quote_for_eval_result"18691870# We need to accept at least all the BSD install flags.1871dest=1872files=1873opts=1874prev=1875install_type=1876isdir=no1877stripme=1878for arg1879do1880if test -n "$dest"; then1881files="$files $dest"1882dest=$arg1883continue1884fi18851886case $arg in1887-d) isdir=yes ;;1888-f)1889case " $install_prog " in1890*[\\\ /]cp\ *) ;;1891*) prev=$arg ;;1892esac1893;;1894-g | -m | -o)1895prev=$arg1896;;1897-s)1898stripme=" -s"1899continue1900;;1901-*)1902;;1903*)1904# If the previous option needed an argument, then skip it.1905if test -n "$prev"; then1906prev=1907else1908dest=$arg1909continue1910fi1911;;1912esac19131914# Aesthetically quote the argument.1915func_quote_for_eval "$arg"1916install_prog="$install_prog $func_quote_for_eval_result"1917done19181919test -z "$install_prog" && \1920func_fatal_help "you must specify an install program"19211922test -n "$prev" && \1923func_fatal_help "the \`$prev' option requires an argument"19241925if test -z "$files"; then1926if test -z "$dest"; then1927func_fatal_help "no file or destination specified"1928else1929func_fatal_help "you must specify a destination"1930fi1931fi19321933# Strip any trailing slash from the destination.1934func_stripname '' '/' "$dest"1935dest=$func_stripname_result19361937# Check to see that the destination is a directory.1938test -d "$dest" && isdir=yes1939if test "$isdir" = yes; then1940destdir="$dest"1941destname=1942else1943func_dirname_and_basename "$dest" "" "."1944destdir="$func_dirname_result"1945destname="$func_basename_result"19461947# Not a directory, so check to see that there is only one file specified.1948set dummy $files; shift1949test "$#" -gt 1 && \1950func_fatal_help "\`$dest' is not a directory"1951fi1952case $destdir in1953[\\/]* | [A-Za-z]:[\\/]*) ;;1954*)1955for file in $files; do1956case $file in1957*.lo) ;;1958*)1959func_fatal_help "\`$destdir' must be an absolute directory name"1960;;1961esac1962done1963;;1964esac19651966# This variable tells wrapper scripts just to set variables rather1967# than running their programs.1968libtool_install_magic="$magic"19691970staticlibs=1971future_libdirs=1972current_libdirs=1973for file in $files; do19741975# Do each installation.1976case $file in1977*.$libext)1978# Do the static libraries later.1979staticlibs="$staticlibs $file"1980;;19811982*.la)1983# Check to see that this really is a libtool archive.1984func_lalib_unsafe_p "$file" \1985|| func_fatal_help "\`$file' is not a valid libtool archive"19861987library_names=1988old_library=1989relink_command=1990func_source "$file"19911992# Add the libdir to current_libdirs if it is the destination.1993if test "X$destdir" = "X$libdir"; then1994case "$current_libdirs " in1995*" $libdir "*) ;;1996*) current_libdirs="$current_libdirs $libdir" ;;1997esac1998else1999# Note the libdir as a future libdir.2000case "$future_libdirs " in2001*" $libdir "*) ;;2002*) future_libdirs="$future_libdirs $libdir" ;;2003esac2004fi20052006func_dirname "$file" "/" ""2007dir="$func_dirname_result"2008dir="$dir$objdir"20092010if test -n "$relink_command"; then2011# Determine the prefix the user has applied to our future dir.2012inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`20132014# Don't allow the user to place us outside of our expected2015# location b/c this prevents finding dependent libraries that2016# are installed to the same prefix.2017# At present, this check doesn't affect windows .dll's that2018# are installed into $libdir/../bin (currently, that works fine)2019# but it's something to keep an eye on.2020test "$inst_prefix_dir" = "$destdir" && \2021func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"20222023if test -n "$inst_prefix_dir"; then2024# Stick the inst_prefix_dir data into the link command.2025relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`2026else2027relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`2028fi20292030func_warning "relinking \`$file'"2031func_show_eval "$relink_command" \2032'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'2033fi20342035# See the names of the shared library.2036set dummy $library_names; shift2037if test -n "$1"; then2038realname="$1"2039shift20402041srcname="$realname"2042test -n "$relink_command" && srcname="$realname"T20432044# Install the shared library and build the symlinks.2045func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \2046'exit $?'2047tstripme="$stripme"2048case $host_os in2049cygwin* | mingw* | pw32* | cegcc*)2050case $realname in2051*.dll.a)2052tstripme=""2053;;2054esac2055;;2056esac2057if test -n "$tstripme" && test -n "$striplib"; then2058func_show_eval "$striplib $destdir/$realname" 'exit $?'2059fi20602061if test "$#" -gt 0; then2062# Delete the old symlinks, and create new ones.2063# Try `ln -sf' first, because the `ln' binary might depend on2064# the symlink we replace! Solaris /bin/ln does not understand -f,2065# so we also need to try rm && ln -s.2066for linkname2067do2068test "$linkname" != "$realname" \2069&& func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"2070done2071fi20722073# Do each command in the postinstall commands.2074lib="$destdir/$realname"2075func_execute_cmds "$postinstall_cmds" 'exit $?'2076fi20772078# Install the pseudo-library for information purposes.2079func_basename "$file"2080name="$func_basename_result"2081instname="$dir/$name"i2082func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'20832084# Maybe install the static library, too.2085test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"2086;;20872088*.lo)2089# Install (i.e. copy) a libtool object.20902091# Figure out destination file name, if it wasn't already specified.2092if test -n "$destname"; then2093destfile="$destdir/$destname"2094else2095func_basename "$file"2096destfile="$func_basename_result"2097destfile="$destdir/$destfile"2098fi20992100# Deduce the name of the destination old-style object file.2101case $destfile in2102*.lo)2103func_lo2o "$destfile"2104staticdest=$func_lo2o_result2105;;2106*.$objext)2107staticdest="$destfile"2108destfile=2109;;2110*)2111func_fatal_help "cannot copy a libtool object to \`$destfile'"2112;;2113esac21142115# Install the libtool object if requested.2116test -n "$destfile" && \2117func_show_eval "$install_prog $file $destfile" 'exit $?'21182119# Install the old object if enabled.2120if test "$build_old_libs" = yes; then2121# Deduce the name of the old-style object file.2122func_lo2o "$file"2123staticobj=$func_lo2o_result2124func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'2125fi2126exit $EXIT_SUCCESS2127;;21282129*)2130# Figure out destination file name, if it wasn't already specified.2131if test -n "$destname"; then2132destfile="$destdir/$destname"2133else2134func_basename "$file"2135destfile="$func_basename_result"2136destfile="$destdir/$destfile"2137fi21382139# If the file is missing, and there is a .exe on the end, strip it2140# because it is most likely a libtool script we actually want to2141# install2142stripped_ext=""2143case $file in2144*.exe)2145if test ! -f "$file"; then2146func_stripname '' '.exe' "$file"2147file=$func_stripname_result2148stripped_ext=".exe"2149fi2150;;2151esac21522153# Do a test to see if this is really a libtool program.2154case $host in2155*cygwin* | *mingw*)2156if func_ltwrapper_executable_p "$file"; then2157func_ltwrapper_scriptname "$file"2158wrapper=$func_ltwrapper_scriptname_result2159else2160func_stripname '' '.exe' "$file"2161wrapper=$func_stripname_result2162fi2163;;2164*)2165wrapper=$file2166;;2167esac2168if func_ltwrapper_script_p "$wrapper"; then2169notinst_deplibs=2170relink_command=21712172func_source "$wrapper"21732174# Check the variables that should have been set.2175test -z "$generated_by_libtool_version" && \2176func_fatal_error "invalid libtool wrapper script \`$wrapper'"21772178finalize=yes2179for lib in $notinst_deplibs; do2180# Check to see that each library is installed.2181libdir=2182if test -f "$lib"; then2183func_source "$lib"2184fi2185libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test2186if test -n "$libdir" && test ! -f "$libfile"; then2187func_warning "\`$lib' has not been installed in \`$libdir'"2188finalize=no2189fi2190done21912192relink_command=2193func_source "$wrapper"21942195outputname=2196if test "$fast_install" = no && test -n "$relink_command"; then2197$opt_dry_run || {2198if test "$finalize" = yes; then2199tmpdir=`func_mktempdir`2200func_basename "$file$stripped_ext"2201file="$func_basename_result"2202outputname="$tmpdir/$file"2203# Replace the output file specification.2204relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`22052206$opt_silent || {2207func_quote_for_expand "$relink_command"2208eval "func_echo $func_quote_for_expand_result"2209}2210if eval "$relink_command"; then :2211else2212func_error "error: relink \`$file' with the above command before installing it"2213$opt_dry_run || ${RM}r "$tmpdir"2214continue2215fi2216file="$outputname"2217else2218func_warning "cannot relink \`$file'"2219fi2220}2221else2222# Install the binary that we compiled earlier.2223file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`2224fi2225fi22262227# remove .exe since cygwin /usr/bin/install will append another2228# one anyway2229case $install_prog,$host in2230*/usr/bin/install*,*cygwin*)2231case $file:$destfile in2232*.exe:*.exe)2233# this is ok2234;;2235*.exe:*)2236destfile=$destfile.exe2237;;2238*:*.exe)2239func_stripname '' '.exe' "$destfile"2240destfile=$func_stripname_result2241;;2242esac2243;;2244esac2245func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'2246$opt_dry_run || if test -n "$outputname"; then2247${RM}r "$tmpdir"2248fi2249;;2250esac2251done22522253for file in $staticlibs; do2254func_basename "$file"2255name="$func_basename_result"22562257# Set up the ranlib parameters.2258oldlib="$destdir/$name"22592260func_show_eval "$install_prog \$file \$oldlib" 'exit $?'22612262if test -n "$stripme" && test -n "$old_striplib"; then2263func_show_eval "$old_striplib $oldlib" 'exit $?'2264fi22652266# Do each command in the postinstall commands.2267func_execute_cmds "$old_postinstall_cmds" 'exit $?'2268done22692270test -n "$future_libdirs" && \2271func_warning "remember to run \`$progname --finish$future_libdirs'"22722273if test -n "$current_libdirs"; then2274# Maybe just do a dry run.2275$opt_dry_run && current_libdirs=" -n$current_libdirs"2276exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'2277else2278exit $EXIT_SUCCESS2279fi2280}22812282test "$mode" = install && func_mode_install ${1+"$@"}228322842285# func_generate_dlsyms outputname originator pic_p2286# Extract symbols from dlprefiles and create ${outputname}S.o with2287# a dlpreopen symbol table.2288func_generate_dlsyms ()2289{2290$opt_debug2291my_outputname="$1"2292my_originator="$2"2293my_pic_p="${3-no}"2294my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`2295my_dlsyms=22962297if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then2298if test -n "$NM" && test -n "$global_symbol_pipe"; then2299my_dlsyms="${my_outputname}S.c"2300else2301func_error "not configured to extract global symbols from dlpreopened files"2302fi2303fi23042305if test -n "$my_dlsyms"; then2306case $my_dlsyms in2307"") ;;2308*.c)2309# Discover the nlist of each of the dlfiles.2310nlist="$output_objdir/${my_outputname}.nm"23112312func_show_eval "$RM $nlist ${nlist}S ${nlist}T"23132314# Parse the name list into a source file.2315func_verbose "creating $output_objdir/$my_dlsyms"23162317$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\2318/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */2319/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */23202321#ifdef __cplusplus2322extern \"C\" {2323#endif23242325/* External symbol declarations for the compiler. */\2326"23272328if test "$dlself" = yes; then2329func_verbose "generating symbol list for \`$output'"23302331$opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"23322333# Add our own program objects to the symbol list.2334progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`2335for progfile in $progfiles; do2336func_verbose "extracting global C symbols from \`$progfile'"2337$opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"2338done23392340if test -n "$exclude_expsyms"; then2341$opt_dry_run || {2342eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'2343eval '$MV "$nlist"T "$nlist"'2344}2345fi23462347if test -n "$export_symbols_regex"; then2348$opt_dry_run || {2349eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'2350eval '$MV "$nlist"T "$nlist"'2351}2352fi23532354# Prepare the list of exported symbols2355if test -z "$export_symbols"; then2356export_symbols="$output_objdir/$outputname.exp"2357$opt_dry_run || {2358$RM $export_symbols2359eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'2360case $host in2361*cygwin* | *mingw* | *cegcc* )2362eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'2363eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'2364;;2365esac2366}2367else2368$opt_dry_run || {2369eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'2370eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'2371eval '$MV "$nlist"T "$nlist"'2372case $host in2373*cygwin | *mingw* | *cegcc* )2374eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'2375eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'2376;;2377esac2378}2379fi2380fi23812382for dlprefile in $dlprefiles; do2383func_verbose "extracting global C symbols from \`$dlprefile'"2384func_basename "$dlprefile"2385name="$func_basename_result"2386$opt_dry_run || {2387eval '$ECHO ": $name " >> "$nlist"'2388eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"2389}2390done23912392$opt_dry_run || {2393# Make sure we have at least an empty file.2394test -f "$nlist" || : > "$nlist"23952396if test -n "$exclude_expsyms"; then2397$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T2398$MV "$nlist"T "$nlist"2399fi24002401# Try sorting and uniquifying the output.2402if $GREP -v "^: " < "$nlist" |2403if sort -k 3 </dev/null >/dev/null 2>&1; then2404sort -k 32405else2406sort +22407fi |2408uniq > "$nlist"S; then2409:2410else2411$GREP -v "^: " < "$nlist" > "$nlist"S2412fi24132414if test -f "$nlist"S; then2415eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'2416else2417$ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"2418fi24192420$ECHO >> "$output_objdir/$my_dlsyms" "\24212422/* The mapping between symbol names and symbols. */2423typedef struct {2424const char *name;2425void *address;2426} lt_dlsymlist;2427"2428case $host in2429*cygwin* | *mingw* | *cegcc* )2430$ECHO >> "$output_objdir/$my_dlsyms" "\2431/* DATA imports from DLLs on WIN32 con't be const, because2432runtime relocations are performed -- see ld's documentation2433on pseudo-relocs. */"2434lt_dlsym_const= ;;2435*osf5*)2436echo >> "$output_objdir/$my_dlsyms" "\2437/* This system does not cope well with relocations in const data */"2438lt_dlsym_const= ;;2439*)2440lt_dlsym_const=const ;;2441esac24422443$ECHO >> "$output_objdir/$my_dlsyms" "\2444extern $lt_dlsym_const lt_dlsymlist2445lt_${my_prefix}_LTX_preloaded_symbols[];2446$lt_dlsym_const lt_dlsymlist2447lt_${my_prefix}_LTX_preloaded_symbols[] =2448{\2449{ \"$my_originator\", (void *) 0 },"24502451case $need_lib_prefix in2452no)2453eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"2454;;2455*)2456eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"2457;;2458esac2459$ECHO >> "$output_objdir/$my_dlsyms" "\2460{0, (void *) 0}2461};24622463/* This works around a problem in FreeBSD linker */2464#ifdef FREEBSD_WORKAROUND2465static const void *lt_preloaded_setup() {2466return lt_${my_prefix}_LTX_preloaded_symbols;2467}2468#endif24692470#ifdef __cplusplus2471}2472#endif\2473"2474} # !$opt_dry_run24752476pic_flag_for_symtable=2477case "$compile_command " in2478*" -static "*) ;;2479*)2480case $host in2481# compiling the symbol table file with pic_flag works around2482# a FreeBSD bug that causes programs to crash when -lm is2483# linked before any other PIC object. But we must not use2484# pic_flag when linking with -static. The problem exists in2485# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.2486*-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)2487pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;2488*-*-hpux*)2489pic_flag_for_symtable=" $pic_flag" ;;2490*)2491if test "X$my_pic_p" != Xno; then2492pic_flag_for_symtable=" $pic_flag"2493fi2494;;2495esac2496;;2497esac2498symtab_cflags=2499for arg in $LTCFLAGS; do2500case $arg in2501-pie | -fpie | -fPIE) ;;2502*) symtab_cflags="$symtab_cflags $arg" ;;2503esac2504done25052506# Now compile the dynamic symbol file.2507func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'25082509# Clean up the generated files.2510func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'25112512# Transform the symbol file into the correct name.2513symfileobj="$output_objdir/${my_outputname}S.$objext"2514case $host in2515*cygwin* | *mingw* | *cegcc* )2516if test -f "$output_objdir/$my_outputname.def"; then2517compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`2518finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`2519else2520compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`2521finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`2522fi2523;;2524*)2525compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`2526finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`2527;;2528esac2529;;2530*)2531func_fatal_error "unknown suffix for \`$my_dlsyms'"2532;;2533esac2534else2535# We keep going just in case the user didn't refer to2536# lt_preloaded_symbols. The linker will fail if global_symbol_pipe2537# really was required.25382539# Nullify the symbol file.2540compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`2541finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`2542fi2543}25442545# func_win32_libid arg2546# return the library type of file 'arg'2547#2548# Need a lot of goo to handle *both* DLLs and import libs2549# Has to be a shell function in order to 'eat' the argument2550# that is supplied when $file_magic_command is called.2551func_win32_libid ()2552{2553$opt_debug2554win32_libid_type="unknown"2555win32_fileres=`file -L $1 2>/dev/null`2556case $win32_fileres in2557*ar\ archive\ import\ library*) # definitely import2558win32_libid_type="x86 archive import"2559;;2560*ar\ archive*) # could be an import, or static2561if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |2562$EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then2563win32_nmres=`eval $NM -f posix -A $1 |2564$SED -n -e '25651,100{2566/ I /{2567s,.*,import,2568p2569q2570}2571}'`2572case $win32_nmres in2573import*) win32_libid_type="x86 archive import";;2574*) win32_libid_type="x86 archive static";;2575esac2576fi2577;;2578*DLL*)2579win32_libid_type="x86 DLL"2580;;2581*executable*) # but shell scripts are "executable" too...2582case $win32_fileres in2583*MS\ Windows\ PE\ Intel*)2584win32_libid_type="x86 DLL"2585;;2586esac2587;;2588esac2589$ECHO "$win32_libid_type"2590}2591259225932594# func_extract_an_archive dir oldlib2595func_extract_an_archive ()2596{2597$opt_debug2598f_ex_an_ar_dir="$1"; shift2599f_ex_an_ar_oldlib="$1"2600func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'2601if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then2602:2603else2604func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"2605fi2606}260726082609# func_extract_archives gentop oldlib ...2610func_extract_archives ()2611{2612$opt_debug2613my_gentop="$1"; shift2614my_oldlibs=${1+"$@"}2615my_oldobjs=""2616my_xlib=""2617my_xabs=""2618my_xdir=""26192620for my_xlib in $my_oldlibs; do2621# Extract the objects.2622case $my_xlib in2623[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;2624*) my_xabs=`pwd`"/$my_xlib" ;;2625esac2626func_basename "$my_xlib"2627my_xlib="$func_basename_result"2628my_xlib_u=$my_xlib2629while :; do2630case " $extracted_archives " in2631*" $my_xlib_u "*)2632func_arith $extracted_serial + 12633extracted_serial=$func_arith_result2634my_xlib_u=lt$extracted_serial-$my_xlib ;;2635*) break ;;2636esac2637done2638extracted_archives="$extracted_archives $my_xlib_u"2639my_xdir="$my_gentop/$my_xlib_u"26402641func_mkdir_p "$my_xdir"26422643case $host in2644*-darwin*)2645func_verbose "Extracting $my_xabs"2646# Do not bother doing anything if just a dry run2647$opt_dry_run || {2648darwin_orig_dir=`pwd`2649cd $my_xdir || exit $?2650darwin_archive=$my_xabs2651darwin_curdir=`pwd`2652darwin_base_archive=`basename "$darwin_archive"`2653darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`2654if test -n "$darwin_arches"; then2655darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`2656darwin_arch=2657func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"2658for darwin_arch in $darwin_arches ; do2659func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"2660$LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"2661cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"2662func_extract_an_archive "`pwd`" "${darwin_base_archive}"2663cd "$darwin_curdir"2664$RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"2665done # $darwin_arches2666## Okay now we've a bunch of thin objects, gotta fatten them up :)2667darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`2668darwin_file=2669darwin_files=2670for darwin_file in $darwin_filelist; do2671darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`2672$LIPO -create -output "$darwin_file" $darwin_files2673done # $darwin_filelist2674$RM -rf unfat-$$2675cd "$darwin_orig_dir"2676else2677cd $darwin_orig_dir2678func_extract_an_archive "$my_xdir" "$my_xabs"2679fi # $darwin_arches2680} # !$opt_dry_run2681;;2682*)2683func_extract_an_archive "$my_xdir" "$my_xabs"2684;;2685esac2686my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`2687done26882689func_extract_archives_result="$my_oldobjs"2690}2691269226932694# func_emit_wrapper_part1 [arg=no]2695#2696# Emit the first part of a libtool wrapper script on stdout.2697# For more information, see the description associated with2698# func_emit_wrapper(), below.2699func_emit_wrapper_part1 ()2700{2701func_emit_wrapper_part1_arg1=no2702if test -n "$1" ; then2703func_emit_wrapper_part1_arg1=$12704fi27052706$ECHO "\2707#! $SHELL27082709# $output - temporary wrapper script for $objdir/$outputname2710# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION2711#2712# The $output program cannot be directly executed until all the libtool2713# libraries that it depends on are installed.2714#2715# This wrapper script should never be moved out of the build directory.2716# If it is, it will not operate correctly.27172718# Sed substitution that helps us do robust quoting. It backslashifies2719# metacharacters that are still active within double-quoted strings.2720Xsed='${SED} -e 1s/^X//'2721sed_quote_subst='$sed_quote_subst'27222723# Be Bourne compatible2724if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then2725emulate sh2726NULLCMD=:2727# Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which2728# is contrary to our usage. Disable this feature.2729alias -g '\${1+\"\$@\"}'='\"\$@\"'2730setopt NO_GLOB_SUBST2731else2732case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac2733fi2734BIN_SH=xpg4; export BIN_SH # for Tru642735DUALCASE=1; export DUALCASE # for MKS sh27362737# The HP-UX ksh and POSIX shell print the target directory to stdout2738# if CDPATH is set.2739(unset CDPATH) >/dev/null 2>&1 && unset CDPATH27402741relink_command=\"$relink_command\"27422743# This environment variable determines our operation mode.2744if test \"\$libtool_install_magic\" = \"$magic\"; then2745# install mode needs the following variables:2746generated_by_libtool_version='$macro_version'2747notinst_deplibs='$notinst_deplibs'2748else2749# When we are sourced in execute mode, \$file and \$ECHO are already set.2750if test \"\$libtool_execute_magic\" != \"$magic\"; then2751ECHO=\"$qecho\"2752file=\"\$0\"2753# Make sure echo works.2754if test \"X\$1\" = X--no-reexec; then2755# Discard the --no-reexec flag, and continue.2756shift2757elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then2758# Yippee, \$ECHO works!2759:2760else2761# Restart under the correct shell, and then maybe \$ECHO will work.2762exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}2763fi2764fi\2765"2766$ECHO "\27672768# Find the directory that this script lives in.2769thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`2770test \"x\$thisdir\" = \"x\$file\" && thisdir=.27712772# Follow symbolic links until we get to the real thisdir.2773file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`2774while test -n \"\$file\"; do2775destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`27762777# If there was a directory component, then change thisdir.2778if test \"x\$destdir\" != \"x\$file\"; then2779case \"\$destdir\" in2780[\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;2781*) thisdir=\"\$thisdir/\$destdir\" ;;2782esac2783fi27842785file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`2786file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`2787done2788"2789}2790# end: func_emit_wrapper_part127912792# func_emit_wrapper_part2 [arg=no]2793#2794# Emit the second part of a libtool wrapper script on stdout.2795# For more information, see the description associated with2796# func_emit_wrapper(), below.2797func_emit_wrapper_part2 ()2798{2799func_emit_wrapper_part2_arg1=no2800if test -n "$1" ; then2801func_emit_wrapper_part2_arg1=$12802fi28032804$ECHO "\28052806# Usually 'no', except on cygwin/mingw when embedded into2807# the cwrapper.2808WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg12809if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then2810# special case for '.'2811if test \"\$thisdir\" = \".\"; then2812thisdir=\`pwd\`2813fi2814# remove .libs from thisdir2815case \"\$thisdir\" in2816*[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;2817$objdir ) thisdir=. ;;2818esac2819fi28202821# Try to get the absolute directory name.2822absdir=\`cd \"\$thisdir\" && pwd\`2823test -n \"\$absdir\" && thisdir=\"\$absdir\"2824"28252826if test "$fast_install" = yes; then2827$ECHO "\2828program=lt-'$outputname'$exeext2829progdir=\"\$thisdir/$objdir\"28302831if test ! -f \"\$progdir/\$program\" ||2832{ file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\2833test \"X\$file\" != \"X\$progdir/\$program\"; }; then28342835file=\"\$\$-\$program\"28362837if test ! -d \"\$progdir\"; then2838$MKDIR \"\$progdir\"2839else2840$RM \"\$progdir/\$file\"2841fi"28422843$ECHO "\28442845# relink executable if necessary2846if test -n \"\$relink_command\"; then2847if relink_command_output=\`eval \$relink_command 2>&1\`; then :2848else2849$ECHO \"\$relink_command_output\" >&22850$RM \"\$progdir/\$file\"2851exit 12852fi2853fi28542855$MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||2856{ $RM \"\$progdir/\$program\";2857$MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }2858$RM \"\$progdir/\$file\"2859fi"2860else2861$ECHO "\2862program='$outputname'2863progdir=\"\$thisdir/$objdir\"2864"2865fi28662867$ECHO "\28682869if test -f \"\$progdir/\$program\"; then"28702871# Export our shlibpath_var if we have one.2872if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then2873$ECHO "\2874# Add our own library path to $shlibpath_var2875$shlibpath_var=\"$temp_rpath\$$shlibpath_var\"28762877# Some systems cannot cope with colon-terminated $shlibpath_var2878# The second colon is a workaround for a bug in BeOS R4 sed2879$shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`28802881export $shlibpath_var2882"2883fi28842885# fixup the dll searchpath if we need to.2886if test -n "$dllsearchpath"; then2887$ECHO "\2888# Add the dll search path components to the executable PATH2889PATH=$dllsearchpath:\$PATH2890"2891fi28922893$ECHO "\2894if test \"\$libtool_execute_magic\" != \"$magic\"; then2895# Run the actual program with our arguments.2896"2897case $host in2898# Backslashes separate directories on plain windows2899*-*-mingw | *-*-os2* | *-cegcc*)2900$ECHO "\2901exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}2902"2903;;29042905*)2906$ECHO "\2907exec \"\$progdir/\$program\" \${1+\"\$@\"}2908"2909;;2910esac2911$ECHO "\2912\$ECHO \"\$0: cannot exec \$program \$*\" 1>&22913exit 12914fi2915else2916# The program doesn't exist.2917\$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&22918\$ECHO \"This script is just a wrapper for \$program.\" 1>&22919$ECHO \"See the $PACKAGE documentation for more information.\" 1>&22920exit 12921fi2922fi\2923"2924}2925# end: func_emit_wrapper_part2292629272928# func_emit_wrapper [arg=no]2929#2930# Emit a libtool wrapper script on stdout.2931# Don't directly open a file because we may want to2932# incorporate the script contents within a cygwin/mingw2933# wrapper executable. Must ONLY be called from within2934# func_mode_link because it depends on a number of variables2935# set therein.2936#2937# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR2938# variable will take. If 'yes', then the emitted script2939# will assume that the directory in which it is stored is2940# the $objdir directory. This is a cygwin/mingw-specific2941# behavior.2942func_emit_wrapper ()2943{2944func_emit_wrapper_arg1=no2945if test -n "$1" ; then2946func_emit_wrapper_arg1=$12947fi29482949# split this up so that func_emit_cwrapperexe_src2950# can call each part independently.2951func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"2952func_emit_wrapper_part2 "${func_emit_wrapper_arg1}"2953}295429552956# func_to_host_path arg2957#2958# Convert paths to host format when used with build tools.2959# Intended for use with "native" mingw (where libtool itself2960# is running under the msys shell), or in the following cross-2961# build environments:2962# $build $host2963# mingw (msys) mingw [e.g. native]2964# cygwin mingw2965# *nix + wine mingw2966# where wine is equipped with the `winepath' executable.2967# In the native mingw case, the (msys) shell automatically2968# converts paths for any non-msys applications it launches,2969# but that facility isn't available from inside the cwrapper.2970# Similar accommodations are necessary for $host mingw and2971# $build cygwin. Calling this function does no harm for other2972# $host/$build combinations not listed above.2973#2974# ARG is the path (on $build) that should be converted to2975# the proper representation for $host. The result is stored2976# in $func_to_host_path_result.2977func_to_host_path ()2978{2979func_to_host_path_result="$1"2980if test -n "$1" ; then2981case $host in2982*mingw* )2983lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'2984case $build in2985*mingw* ) # actually, msys2986# awkward: cmd appends spaces to result2987lt_sed_strip_trailing_spaces="s/[ ]*\$//"2988func_to_host_path_tmp1=`( cmd //c echo "$1" |\2989$SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`2990func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\2991$SED -e "$lt_sed_naive_backslashify"`2992;;2993*cygwin* )2994func_to_host_path_tmp1=`cygpath -w "$1"`2995func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\2996$SED -e "$lt_sed_naive_backslashify"`2997;;2998* )2999# Unfortunately, winepath does not exit with a non-zero3000# error code, so we are forced to check the contents of3001# stdout. On the other hand, if the command is not3002# found, the shell will set an exit code of 127 and print3003# *an error message* to stdout. So we must check for both3004# error code of zero AND non-empty stdout, which explains3005# the odd construction:3006func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`3007if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then3008func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\3009$SED -e "$lt_sed_naive_backslashify"`3010else3011# Allow warning below.3012func_to_host_path_result=""3013fi3014;;3015esac3016if test -z "$func_to_host_path_result" ; then3017func_error "Could not determine host path corresponding to"3018func_error " '$1'"3019func_error "Continuing, but uninstalled executables may not work."3020# Fallback:3021func_to_host_path_result="$1"3022fi3023;;3024esac3025fi3026}3027# end: func_to_host_path30283029# func_to_host_pathlist arg3030#3031# Convert pathlists to host format when used with build tools.3032# See func_to_host_path(), above. This function supports the3033# following $build/$host combinations (but does no harm for3034# combinations not listed here):3035# $build $host3036# mingw (msys) mingw [e.g. native]3037# cygwin mingw3038# *nix + wine mingw3039#3040# Path separators are also converted from $build format to3041# $host format. If ARG begins or ends with a path separator3042# character, it is preserved (but converted to $host format)3043# on output.3044#3045# ARG is a pathlist (on $build) that should be converted to3046# the proper representation on $host. The result is stored3047# in $func_to_host_pathlist_result.3048func_to_host_pathlist ()3049{3050func_to_host_pathlist_result="$1"3051if test -n "$1" ; then3052case $host in3053*mingw* )3054lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'3055# Remove leading and trailing path separator characters from3056# ARG. msys behavior is inconsistent here, cygpath turns them3057# into '.;' and ';.', and winepath ignores them completely.3058func_to_host_pathlist_tmp2="$1"3059# Once set for this call, this variable should not be3060# reassigned. It is used in tha fallback case.3061func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\3062$SED -e 's|^:*||' -e 's|:*$||'`3063case $build in3064*mingw* ) # Actually, msys.3065# Awkward: cmd appends spaces to result.3066lt_sed_strip_trailing_spaces="s/[ ]*\$//"3067func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\3068$SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`3069func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\3070$SED -e "$lt_sed_naive_backslashify"`3071;;3072*cygwin* )3073func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"`3074func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\3075$SED -e "$lt_sed_naive_backslashify"`3076;;3077* )3078# unfortunately, winepath doesn't convert pathlists3079func_to_host_pathlist_result=""3080func_to_host_pathlist_oldIFS=$IFS3081IFS=:3082for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do3083IFS=$func_to_host_pathlist_oldIFS3084if test -n "$func_to_host_pathlist_f" ; then3085func_to_host_path "$func_to_host_pathlist_f"3086if test -n "$func_to_host_path_result" ; then3087if test -z "$func_to_host_pathlist_result" ; then3088func_to_host_pathlist_result="$func_to_host_path_result"3089else3090func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result"3091fi3092fi3093fi3094IFS=:3095done3096IFS=$func_to_host_pathlist_oldIFS3097;;3098esac3099if test -z "$func_to_host_pathlist_result" ; then3100func_error "Could not determine the host path(s) corresponding to"3101func_error " '$1'"3102func_error "Continuing, but uninstalled executables may not work."3103# Fallback. This may break if $1 contains DOS-style drive3104# specifications. The fix is not to complicate the expression3105# below, but for the user to provide a working wine installation3106# with winepath so that path translation in the cross-to-mingw3107# case works properly.3108lt_replace_pathsep_nix_to_dos="s|:|;|g"3109func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\3110$SED -e "$lt_replace_pathsep_nix_to_dos"`3111fi3112# Now, add the leading and trailing path separators back3113case "$1" in3114:* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"3115;;3116esac3117case "$1" in3118*: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;"3119;;3120esac3121;;3122esac3123fi3124}3125# end: func_to_host_pathlist31263127# func_emit_cwrapperexe_src3128# emit the source code for a wrapper executable on stdout3129# Must ONLY be called from within func_mode_link because3130# it depends on a number of variable set therein.3131func_emit_cwrapperexe_src ()3132{3133cat <<EOF31343135/* $cwrappersource - temporary wrapper executable for $objdir/$outputname3136Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION31373138The $output program cannot be directly executed until all the libtool3139libraries that it depends on are installed.31403141This wrapper executable should never be moved out of the build directory.3142If it is, it will not operate correctly.31433144Currently, it simply execs the wrapper *script* "$SHELL $output",3145but could eventually absorb all of the scripts functionality and3146exec $objdir/$outputname directly.3147*/3148EOF3149cat <<"EOF"3150#include <stdio.h>3151#include <stdlib.h>3152#ifdef _MSC_VER3153# include <direct.h>3154# include <process.h>3155# include <io.h>3156# define setmode _setmode3157#else3158# include <unistd.h>3159# include <stdint.h>3160# ifdef __CYGWIN__3161# include <io.h>3162# define HAVE_SETENV3163# ifdef __STRICT_ANSI__3164char *realpath (const char *, char *);3165int putenv (char *);3166int setenv (const char *, const char *, int);3167# endif3168# endif3169#endif3170#include <malloc.h>3171#include <stdarg.h>3172#include <assert.h>3173#include <string.h>3174#include <ctype.h>3175#include <errno.h>3176#include <fcntl.h>3177#include <sys/stat.h>31783179#if defined(PATH_MAX)3180# define LT_PATHMAX PATH_MAX3181#elif defined(MAXPATHLEN)3182# define LT_PATHMAX MAXPATHLEN3183#else3184# define LT_PATHMAX 10243185#endif31863187#ifndef S_IXOTH3188# define S_IXOTH 03189#endif3190#ifndef S_IXGRP3191# define S_IXGRP 03192#endif31933194#ifdef _MSC_VER3195# define S_IXUSR _S_IEXEC3196# define stat _stat3197# ifndef _INTPTR_T_DEFINED3198# define intptr_t int3199# endif3200#endif32013202#ifndef DIR_SEPARATOR3203# define DIR_SEPARATOR '/'3204# define PATH_SEPARATOR ':'3205#endif32063207#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \3208defined (__OS2__)3209# define HAVE_DOS_BASED_FILE_SYSTEM3210# define FOPEN_WB "wb"3211# ifndef DIR_SEPARATOR_23212# define DIR_SEPARATOR_2 '\\'3213# endif3214# ifndef PATH_SEPARATOR_23215# define PATH_SEPARATOR_2 ';'3216# endif3217#endif32183219#ifndef DIR_SEPARATOR_23220# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)3221#else /* DIR_SEPARATOR_2 */3222# define IS_DIR_SEPARATOR(ch) \3223(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))3224#endif /* DIR_SEPARATOR_2 */32253226#ifndef PATH_SEPARATOR_23227# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)3228#else /* PATH_SEPARATOR_2 */3229# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)3230#endif /* PATH_SEPARATOR_2 */32313232#ifdef __CYGWIN__3233# define FOPEN_WB "wb"3234#endif32353236#ifndef FOPEN_WB3237# define FOPEN_WB "w"3238#endif3239#ifndef _O_BINARY3240# define _O_BINARY 03241#endif32423243#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))3244#define XFREE(stale) do { \3245if (stale) { free ((void *) stale); stale = 0; } \3246} while (0)32473248#undef LTWRAPPER_DEBUGPRINTF3249#if defined DEBUGWRAPPER3250# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args3251static void3252ltwrapper_debugprintf (const char *fmt, ...)3253{3254va_list args;3255va_start (args, fmt);3256(void) vfprintf (stderr, fmt, args);3257va_end (args);3258}3259#else3260# define LTWRAPPER_DEBUGPRINTF(args)3261#endif32623263const char *program_name = NULL;32643265void *xmalloc (size_t num);3266char *xstrdup (const char *string);3267const char *base_name (const char *name);3268char *find_executable (const char *wrapper);3269char *chase_symlinks (const char *pathspec);3270int make_executable (const char *path);3271int check_executable (const char *path);3272char *strendzap (char *str, const char *pat);3273void lt_fatal (const char *message, ...);3274void lt_setenv (const char *name, const char *value);3275char *lt_extend_str (const char *orig_value, const char *add, int to_end);3276void lt_opt_process_env_set (const char *arg);3277void lt_opt_process_env_prepend (const char *arg);3278void lt_opt_process_env_append (const char *arg);3279int lt_split_name_value (const char *arg, char** name, char** value);3280void lt_update_exe_path (const char *name, const char *value);3281void lt_update_lib_path (const char *name, const char *value);32823283static const char *script_text_part1 =3284EOF32853286func_emit_wrapper_part1 yes |3287$SED -e 's/\([\\"]\)/\\\1/g' \3288-e 's/^/ "/' -e 's/$/\\n"/'3289echo ";"3290cat <<EOF32913292static const char *script_text_part2 =3293EOF3294func_emit_wrapper_part2 yes |3295$SED -e 's/\([\\"]\)/\\\1/g' \3296-e 's/^/ "/' -e 's/$/\\n"/'3297echo ";"32983299cat <<EOF3300const char * MAGIC_EXE = "$magic_exe";3301const char * LIB_PATH_VARNAME = "$shlibpath_var";3302EOF33033304if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then3305func_to_host_pathlist "$temp_rpath"3306cat <<EOF3307const char * LIB_PATH_VALUE = "$func_to_host_pathlist_result";3308EOF3309else3310cat <<"EOF"3311const char * LIB_PATH_VALUE = "";3312EOF3313fi33143315if test -n "$dllsearchpath"; then3316func_to_host_pathlist "$dllsearchpath:"3317cat <<EOF3318const char * EXE_PATH_VARNAME = "PATH";3319const char * EXE_PATH_VALUE = "$func_to_host_pathlist_result";3320EOF3321else3322cat <<"EOF"3323const char * EXE_PATH_VARNAME = "";3324const char * EXE_PATH_VALUE = "";3325EOF3326fi33273328if test "$fast_install" = yes; then3329cat <<EOF3330const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */3331EOF3332else3333cat <<EOF3334const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */3335EOF3336fi333733383339cat <<"EOF"33403341#define LTWRAPPER_OPTION_PREFIX "--lt-"3342#define LTWRAPPER_OPTION_PREFIX_LENGTH 533433344static const size_t opt_prefix_len = LTWRAPPER_OPTION_PREFIX_LENGTH;3345static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;33463347static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";33483349static const size_t env_set_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 7;3350static const char *env_set_opt = LTWRAPPER_OPTION_PREFIX "env-set";3351/* argument is putenv-style "foo=bar", value of foo is set to bar */33523353static const size_t env_prepend_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 11;3354static const char *env_prepend_opt = LTWRAPPER_OPTION_PREFIX "env-prepend";3355/* argument is putenv-style "foo=bar", new value of foo is bar${foo} */33563357static const size_t env_append_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 10;3358static const char *env_append_opt = LTWRAPPER_OPTION_PREFIX "env-append";3359/* argument is putenv-style "foo=bar", new value of foo is ${foo}bar */33603361int3362main (int argc, char *argv[])3363{3364char **newargz;3365int newargc;3366char *tmp_pathspec;3367char *actual_cwrapper_path;3368char *actual_cwrapper_name;3369char *target_name;3370char *lt_argv_zero;3371intptr_t rval = 127;33723373int i;33743375program_name = (char *) xstrdup (base_name (argv[0]));3376LTWRAPPER_DEBUGPRINTF (("(main) argv[0] : %s\n", argv[0]));3377LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));33783379/* very simple arg parsing; don't want to rely on getopt */3380for (i = 1; i < argc; i++)3381{3382if (strcmp (argv[i], dumpscript_opt) == 0)3383{3384EOF3385case "$host" in3386*mingw* | *cygwin* )3387# make stdout use "unix" line endings3388echo " setmode(1,_O_BINARY);"3389;;3390esac33913392cat <<"EOF"3393printf ("%s", script_text_part1);3394printf ("%s", script_text_part2);3395return 0;3396}3397}33983399newargz = XMALLOC (char *, argc + 1);3400tmp_pathspec = find_executable (argv[0]);3401if (tmp_pathspec == NULL)3402lt_fatal ("Couldn't find %s", argv[0]);3403LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",3404tmp_pathspec));34053406actual_cwrapper_path = chase_symlinks (tmp_pathspec);3407LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",3408actual_cwrapper_path));3409XFREE (tmp_pathspec);34103411actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));3412strendzap (actual_cwrapper_path, actual_cwrapper_name);34133414/* wrapper name transforms */3415strendzap (actual_cwrapper_name, ".exe");3416tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);3417XFREE (actual_cwrapper_name);3418actual_cwrapper_name = tmp_pathspec;3419tmp_pathspec = 0;34203421/* target_name transforms -- use actual target program name; might have lt- prefix */3422target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));3423strendzap (target_name, ".exe");3424tmp_pathspec = lt_extend_str (target_name, ".exe", 1);3425XFREE (target_name);3426target_name = tmp_pathspec;3427tmp_pathspec = 0;34283429LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",3430target_name));3431EOF34323433cat <<EOF3434newargz[0] =3435XMALLOC (char, (strlen (actual_cwrapper_path) +3436strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));3437strcpy (newargz[0], actual_cwrapper_path);3438strcat (newargz[0], "$objdir");3439strcat (newargz[0], "/");3440EOF34413442cat <<"EOF"3443/* stop here, and copy so we don't have to do this twice */3444tmp_pathspec = xstrdup (newargz[0]);34453446/* do NOT want the lt- prefix here, so use actual_cwrapper_name */3447strcat (newargz[0], actual_cwrapper_name);34483449/* DO want the lt- prefix here if it exists, so use target_name */3450lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);3451XFREE (tmp_pathspec);3452tmp_pathspec = NULL;3453EOF34543455case $host_os in3456mingw*)3457cat <<"EOF"3458{3459char* p;3460while ((p = strchr (newargz[0], '\\')) != NULL)3461{3462*p = '/';3463}3464while ((p = strchr (lt_argv_zero, '\\')) != NULL)3465{3466*p = '/';3467}3468}3469EOF3470;;3471esac34723473cat <<"EOF"3474XFREE (target_name);3475XFREE (actual_cwrapper_path);3476XFREE (actual_cwrapper_name);34773478lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */3479lt_setenv ("DUALCASE", "1"); /* for MSK sh */3480lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);3481lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);34823483newargc=0;3484for (i = 1; i < argc; i++)3485{3486if (strncmp (argv[i], env_set_opt, env_set_opt_len) == 0)3487{3488if (argv[i][env_set_opt_len] == '=')3489{3490const char *p = argv[i] + env_set_opt_len + 1;3491lt_opt_process_env_set (p);3492}3493else if (argv[i][env_set_opt_len] == '\0' && i + 1 < argc)3494{3495lt_opt_process_env_set (argv[++i]); /* don't copy */3496}3497else3498lt_fatal ("%s missing required argument", env_set_opt);3499continue;3500}3501if (strncmp (argv[i], env_prepend_opt, env_prepend_opt_len) == 0)3502{3503if (argv[i][env_prepend_opt_len] == '=')3504{3505const char *p = argv[i] + env_prepend_opt_len + 1;3506lt_opt_process_env_prepend (p);3507}3508else if (argv[i][env_prepend_opt_len] == '\0' && i + 1 < argc)3509{3510lt_opt_process_env_prepend (argv[++i]); /* don't copy */3511}3512else3513lt_fatal ("%s missing required argument", env_prepend_opt);3514continue;3515}3516if (strncmp (argv[i], env_append_opt, env_append_opt_len) == 0)3517{3518if (argv[i][env_append_opt_len] == '=')3519{3520const char *p = argv[i] + env_append_opt_len + 1;3521lt_opt_process_env_append (p);3522}3523else if (argv[i][env_append_opt_len] == '\0' && i + 1 < argc)3524{3525lt_opt_process_env_append (argv[++i]); /* don't copy */3526}3527else3528lt_fatal ("%s missing required argument", env_append_opt);3529continue;3530}3531if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)3532{3533/* however, if there is an option in the LTWRAPPER_OPTION_PREFIX3534namespace, but it is not one of the ones we know about and3535have already dealt with, above (inluding dump-script), then3536report an error. Otherwise, targets might begin to believe3537they are allowed to use options in the LTWRAPPER_OPTION_PREFIX3538namespace. The first time any user complains about this, we'll3539need to make LTWRAPPER_OPTION_PREFIX a configure-time option3540or a configure.ac-settable value.3541*/3542lt_fatal ("Unrecognized option in %s namespace: '%s'",3543ltwrapper_option_prefix, argv[i]);3544}3545/* otherwise ... */3546newargz[++newargc] = xstrdup (argv[i]);3547}3548newargz[++newargc] = NULL;35493550LTWRAPPER_DEBUGPRINTF (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));3551for (i = 0; i < newargc; i++)3552{3553LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));3554}35553556EOF35573558case $host_os in3559mingw*)3560cat <<"EOF"3561/* execv doesn't actually work on mingw as expected on unix */3562rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);3563if (rval == -1)3564{3565/* failed to start process */3566LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));3567return 127;3568}3569return rval;3570EOF3571;;3572*)3573cat <<"EOF"3574execv (lt_argv_zero, newargz);3575return rval; /* =127, but avoids unused variable warning */3576EOF3577;;3578esac35793580cat <<"EOF"3581}35823583void *3584xmalloc (size_t num)3585{3586void *p = (void *) malloc (num);3587if (!p)3588lt_fatal ("Memory exhausted");35893590return p;3591}35923593char *3594xstrdup (const char *string)3595{3596return string ? strcpy ((char *) xmalloc (strlen (string) + 1),3597string) : NULL;3598}35993600const char *3601base_name (const char *name)3602{3603const char *base;36043605#if defined (HAVE_DOS_BASED_FILE_SYSTEM)3606/* Skip over the disk name in MSDOS pathnames. */3607if (isalpha ((unsigned char) name[0]) && name[1] == ':')3608name += 2;3609#endif36103611for (base = name; *name; name++)3612if (IS_DIR_SEPARATOR (*name))3613base = name + 1;3614return base;3615}36163617int3618check_executable (const char *path)3619{3620struct stat st;36213622LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n",3623path ? (*path ? path : "EMPTY!") : "NULL!"));3624if ((!path) || (!*path))3625return 0;36263627if ((stat (path, &st) >= 0)3628&& (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))3629return 1;3630else3631return 0;3632}36333634int3635make_executable (const char *path)3636{3637int rval = 0;3638struct stat st;36393640LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n",3641path ? (*path ? path : "EMPTY!") : "NULL!"));3642if ((!path) || (!*path))3643return 0;36443645if (stat (path, &st) >= 0)3646{3647rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);3648}3649return rval;3650}36513652/* Searches for the full path of the wrapper. Returns3653newly allocated full path name if found, NULL otherwise3654Does not chase symlinks, even on platforms that support them.3655*/3656char *3657find_executable (const char *wrapper)3658{3659int has_slash = 0;3660const char *p;3661const char *p_next;3662/* static buffer for getcwd */3663char tmp[LT_PATHMAX + 1];3664int tmp_len;3665char *concat_name;36663667LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n",3668wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));36693670if ((wrapper == NULL) || (*wrapper == '\0'))3671return NULL;36723673/* Absolute path? */3674#if defined (HAVE_DOS_BASED_FILE_SYSTEM)3675if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')3676{3677concat_name = xstrdup (wrapper);3678if (check_executable (concat_name))3679return concat_name;3680XFREE (concat_name);3681}3682else3683{3684#endif3685if (IS_DIR_SEPARATOR (wrapper[0]))3686{3687concat_name = xstrdup (wrapper);3688if (check_executable (concat_name))3689return concat_name;3690XFREE (concat_name);3691}3692#if defined (HAVE_DOS_BASED_FILE_SYSTEM)3693}3694#endif36953696for (p = wrapper; *p; p++)3697if (*p == '/')3698{3699has_slash = 1;3700break;3701}3702if (!has_slash)3703{3704/* no slashes; search PATH */3705const char *path = getenv ("PATH");3706if (path != NULL)3707{3708for (p = path; *p; p = p_next)3709{3710const char *q;3711size_t p_len;3712for (q = p; *q; q++)3713if (IS_PATH_SEPARATOR (*q))3714break;3715p_len = q - p;3716p_next = (*q == '\0' ? q : q + 1);3717if (p_len == 0)3718{3719/* empty path: current directory */3720if (getcwd (tmp, LT_PATHMAX) == NULL)3721lt_fatal ("getcwd failed");3722tmp_len = strlen (tmp);3723concat_name =3724XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);3725memcpy (concat_name, tmp, tmp_len);3726concat_name[tmp_len] = '/';3727strcpy (concat_name + tmp_len + 1, wrapper);3728}3729else3730{3731concat_name =3732XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);3733memcpy (concat_name, p, p_len);3734concat_name[p_len] = '/';3735strcpy (concat_name + p_len + 1, wrapper);3736}3737if (check_executable (concat_name))3738return concat_name;3739XFREE (concat_name);3740}3741}3742/* not found in PATH; assume curdir */3743}3744/* Relative path | not found in path: prepend cwd */3745if (getcwd (tmp, LT_PATHMAX) == NULL)3746lt_fatal ("getcwd failed");3747tmp_len = strlen (tmp);3748concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);3749memcpy (concat_name, tmp, tmp_len);3750concat_name[tmp_len] = '/';3751strcpy (concat_name + tmp_len + 1, wrapper);37523753if (check_executable (concat_name))3754return concat_name;3755XFREE (concat_name);3756return NULL;3757}37583759char *3760chase_symlinks (const char *pathspec)3761{3762#ifndef S_ISLNK3763return xstrdup (pathspec);3764#else3765char buf[LT_PATHMAX];3766struct stat s;3767char *tmp_pathspec = xstrdup (pathspec);3768char *p;3769int has_symlinks = 0;3770while (strlen (tmp_pathspec) && !has_symlinks)3771{3772LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",3773tmp_pathspec));3774if (lstat (tmp_pathspec, &s) == 0)3775{3776if (S_ISLNK (s.st_mode) != 0)3777{3778has_symlinks = 1;3779break;3780}37813782/* search backwards for last DIR_SEPARATOR */3783p = tmp_pathspec + strlen (tmp_pathspec) - 1;3784while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))3785p--;3786if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))3787{3788/* no more DIR_SEPARATORS left */3789break;3790}3791*p = '\0';3792}3793else3794{3795char *errstr = strerror (errno);3796lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);3797}3798}3799XFREE (tmp_pathspec);38003801if (!has_symlinks)3802{3803return xstrdup (pathspec);3804}38053806tmp_pathspec = realpath (pathspec, buf);3807if (tmp_pathspec == 0)3808{3809lt_fatal ("Could not follow symlinks for %s", pathspec);3810}3811return xstrdup (tmp_pathspec);3812#endif3813}38143815char *3816strendzap (char *str, const char *pat)3817{3818size_t len, patlen;38193820assert (str != NULL);3821assert (pat != NULL);38223823len = strlen (str);3824patlen = strlen (pat);38253826if (patlen <= len)3827{3828str += len - patlen;3829if (strcmp (str, pat) == 0)3830*str = '\0';3831}3832return str;3833}38343835static void3836lt_error_core (int exit_status, const char *mode,3837const char *message, va_list ap)3838{3839fprintf (stderr, "%s: %s: ", program_name, mode);3840vfprintf (stderr, message, ap);3841fprintf (stderr, ".\n");38423843if (exit_status >= 0)3844exit (exit_status);3845}38463847void3848lt_fatal (const char *message, ...)3849{3850va_list ap;3851va_start (ap, message);3852lt_error_core (EXIT_FAILURE, "FATAL", message, ap);3853va_end (ap);3854}38553856void3857lt_setenv (const char *name, const char *value)3858{3859LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",3860(name ? name : "<NULL>"),3861(value ? value : "<NULL>")));3862{3863#ifdef HAVE_SETENV3864/* always make a copy, for consistency with !HAVE_SETENV */3865char *str = xstrdup (value);3866setenv (name, str, 1);3867#else3868int len = strlen (name) + 1 + strlen (value) + 1;3869char *str = XMALLOC (char, len);3870sprintf (str, "%s=%s", name, value);3871if (putenv (str) != EXIT_SUCCESS)3872{3873XFREE (str);3874}3875#endif3876}3877}38783879char *3880lt_extend_str (const char *orig_value, const char *add, int to_end)3881{3882char *new_value;3883if (orig_value && *orig_value)3884{3885int orig_value_len = strlen (orig_value);3886int add_len = strlen (add);3887new_value = XMALLOC (char, add_len + orig_value_len + 1);3888if (to_end)3889{3890strcpy (new_value, orig_value);3891strcpy (new_value + orig_value_len, add);3892}3893else3894{3895strcpy (new_value, add);3896strcpy (new_value + add_len, orig_value);3897}3898}3899else3900{3901new_value = xstrdup (add);3902}3903return new_value;3904}39053906int3907lt_split_name_value (const char *arg, char** name, char** value)3908{3909const char *p;3910int len;3911if (!arg || !*arg)3912return 1;39133914p = strchr (arg, (int)'=');39153916if (!p)3917return 1;39183919*value = xstrdup (++p);39203921len = strlen (arg) - strlen (*value);3922*name = XMALLOC (char, len);3923strncpy (*name, arg, len-1);3924(*name)[len - 1] = '\0';39253926return 0;3927}39283929void3930lt_opt_process_env_set (const char *arg)3931{3932char *name = NULL;3933char *value = NULL;39343935if (lt_split_name_value (arg, &name, &value) != 0)3936{3937XFREE (name);3938XFREE (value);3939lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg);3940}39413942lt_setenv (name, value);3943XFREE (name);3944XFREE (value);3945}39463947void3948lt_opt_process_env_prepend (const char *arg)3949{3950char *name = NULL;3951char *value = NULL;3952char *new_value = NULL;39533954if (lt_split_name_value (arg, &name, &value) != 0)3955{3956XFREE (name);3957XFREE (value);3958lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg);3959}39603961new_value = lt_extend_str (getenv (name), value, 0);3962lt_setenv (name, new_value);3963XFREE (new_value);3964XFREE (name);3965XFREE (value);3966}39673968void3969lt_opt_process_env_append (const char *arg)3970{3971char *name = NULL;3972char *value = NULL;3973char *new_value = NULL;39743975if (lt_split_name_value (arg, &name, &value) != 0)3976{3977XFREE (name);3978XFREE (value);3979lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg);3980}39813982new_value = lt_extend_str (getenv (name), value, 1);3983lt_setenv (name, new_value);3984XFREE (new_value);3985XFREE (name);3986XFREE (value);3987}39883989void3990lt_update_exe_path (const char *name, const char *value)3991{3992LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",3993(name ? name : "<NULL>"),3994(value ? value : "<NULL>")));39953996if (name && *name && value && *value)3997{3998char *new_value = lt_extend_str (getenv (name), value, 0);3999/* some systems can't cope with a ':'-terminated path #' */4000int len = strlen (new_value);4001while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))4002{4003new_value[len-1] = '\0';4004}4005lt_setenv (name, new_value);4006XFREE (new_value);4007}4008}40094010void4011lt_update_lib_path (const char *name, const char *value)4012{4013LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",4014(name ? name : "<NULL>"),4015(value ? value : "<NULL>")));40164017if (name && *name && value && *value)4018{4019char *new_value = lt_extend_str (getenv (name), value, 0);4020lt_setenv (name, new_value);4021XFREE (new_value);4022}4023}402440254026EOF4027}4028# end: func_emit_cwrapperexe_src40294030# func_mode_link arg...4031func_mode_link ()4032{4033$opt_debug4034case $host in4035*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)4036# It is impossible to link a dll without this setting, and4037# we shouldn't force the makefile maintainer to figure out4038# which system we are compiling for in order to pass an extra4039# flag for every libtool invocation.4040# allow_undefined=no40414042# FIXME: Unfortunately, there are problems with the above when trying4043# to make a dll which has undefined symbols, in which case not4044# even a static library is built. For now, we need to specify4045# -no-undefined on the libtool link line when we can be certain4046# that all symbols are satisfied, otherwise we get a static library.4047allow_undefined=yes4048;;4049*)4050allow_undefined=yes4051;;4052esac4053libtool_args=$nonopt4054base_compile="$nonopt $@"4055compile_command=$nonopt4056finalize_command=$nonopt40574058compile_rpath=4059finalize_rpath=4060compile_shlibpath=4061finalize_shlibpath=4062convenience=4063old_convenience=4064deplibs=4065old_deplibs=4066compiler_flags=4067linker_flags=4068dllsearchpath=4069lib_search_path=`pwd`4070inst_prefix_dir=4071new_inherited_linker_flags=40724073avoid_version=no4074dlfiles=4075dlprefiles=4076dlself=no4077export_dynamic=no4078export_symbols=4079export_symbols_regex=4080generated=4081libobjs=4082ltlibs=4083module=no4084no_install=no4085objs=4086non_pic_objects=4087precious_files_regex=4088prefer_static_libs=no4089preload=no4090prev=4091prevarg=4092release=4093rpath=4094xrpath=4095perm_rpath=4096temp_rpath=4097thread_safe=no4098vinfo=4099vinfo_number=no4100weak_libs=4101single_module="${wl}-single_module"4102func_infer_tag $base_compile41034104# We need to know -static, to get the right output filenames.4105for arg4106do4107case $arg in4108-shared)4109test "$build_libtool_libs" != yes && \4110func_fatal_configuration "can not build a shared library"4111build_old_libs=no4112break4113;;4114-all-static | -static | -static-libtool-libs)4115case $arg in4116-all-static)4117if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then4118func_warning "complete static linking is impossible in this configuration"4119fi4120if test -n "$link_static_flag"; then4121dlopen_self=$dlopen_self_static4122fi4123prefer_static_libs=yes4124;;4125-static)4126if test -z "$pic_flag" && test -n "$link_static_flag"; then4127dlopen_self=$dlopen_self_static4128fi4129prefer_static_libs=built4130;;4131-static-libtool-libs)4132if test -z "$pic_flag" && test -n "$link_static_flag"; then4133dlopen_self=$dlopen_self_static4134fi4135prefer_static_libs=yes4136;;4137esac4138build_libtool_libs=no4139build_old_libs=yes4140break4141;;4142esac4143done41444145# See if our shared archives depend on static archives.4146test -n "$old_archive_from_new_cmds" && build_old_libs=yes41474148# Go through the arguments, transforming them on the way.4149while test "$#" -gt 0; do4150arg="$1"4151shift4152func_quote_for_eval "$arg"4153qarg=$func_quote_for_eval_unquoted_result4154func_append libtool_args " $func_quote_for_eval_result"41554156# If the previous option needs an argument, assign it.4157if test -n "$prev"; then4158case $prev in4159output)4160func_append compile_command " @OUTPUT@"4161func_append finalize_command " @OUTPUT@"4162;;4163esac41644165case $prev in4166dlfiles|dlprefiles)4167if test "$preload" = no; then4168# Add the symbol object into the linking commands.4169func_append compile_command " @SYMFILE@"4170func_append finalize_command " @SYMFILE@"4171preload=yes4172fi4173case $arg in4174*.la | *.lo) ;; # We handle these cases below.4175force)4176if test "$dlself" = no; then4177dlself=needless4178export_dynamic=yes4179fi4180prev=4181continue4182;;4183self)4184if test "$prev" = dlprefiles; then4185dlself=yes4186elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then4187dlself=yes4188else4189dlself=needless4190export_dynamic=yes4191fi4192prev=4193continue4194;;4195*)4196if test "$prev" = dlfiles; then4197dlfiles="$dlfiles $arg"4198else4199dlprefiles="$dlprefiles $arg"4200fi4201prev=4202continue4203;;4204esac4205;;4206expsyms)4207export_symbols="$arg"4208test -f "$arg" \4209|| func_fatal_error "symbol file \`$arg' does not exist"4210prev=4211continue4212;;4213expsyms_regex)4214export_symbols_regex="$arg"4215prev=4216continue4217;;4218framework)4219case $host in4220*-*-darwin*)4221case "$deplibs " in4222*" $qarg.ltframework "*) ;;4223*) deplibs="$deplibs $qarg.ltframework" # this is fixed later4224;;4225esac4226;;4227esac4228prev=4229continue4230;;4231inst_prefix)4232inst_prefix_dir="$arg"4233prev=4234continue4235;;4236objectlist)4237if test -f "$arg"; then4238save_arg=$arg4239moreargs=4240for fil in `cat "$save_arg"`4241do4242# moreargs="$moreargs $fil"4243arg=$fil4244# A libtool-controlled object.42454246# Check to see that this really is a libtool object.4247if func_lalib_unsafe_p "$arg"; then4248pic_object=4249non_pic_object=42504251# Read the .lo file4252func_source "$arg"42534254if test -z "$pic_object" ||4255test -z "$non_pic_object" ||4256test "$pic_object" = none &&4257test "$non_pic_object" = none; then4258func_fatal_error "cannot find name of object for \`$arg'"4259fi42604261# Extract subdirectory from the argument.4262func_dirname "$arg" "/" ""4263xdir="$func_dirname_result"42644265if test "$pic_object" != none; then4266# Prepend the subdirectory the object is found in.4267pic_object="$xdir$pic_object"42684269if test "$prev" = dlfiles; then4270if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then4271dlfiles="$dlfiles $pic_object"4272prev=4273continue4274else4275# If libtool objects are unsupported, then we need to preload.4276prev=dlprefiles4277fi4278fi42794280# CHECK ME: I think I busted this. -Ossama4281if test "$prev" = dlprefiles; then4282# Preload the old-style object.4283dlprefiles="$dlprefiles $pic_object"4284prev=4285fi42864287# A PIC object.4288func_append libobjs " $pic_object"4289arg="$pic_object"4290fi42914292# Non-PIC object.4293if test "$non_pic_object" != none; then4294# Prepend the subdirectory the object is found in.4295non_pic_object="$xdir$non_pic_object"42964297# A standard non-PIC object4298func_append non_pic_objects " $non_pic_object"4299if test -z "$pic_object" || test "$pic_object" = none ; then4300arg="$non_pic_object"4301fi4302else4303# If the PIC object exists, use it instead.4304# $xdir was prepended to $pic_object above.4305non_pic_object="$pic_object"4306func_append non_pic_objects " $non_pic_object"4307fi4308else4309# Only an error if not doing a dry-run.4310if $opt_dry_run; then4311# Extract subdirectory from the argument.4312func_dirname "$arg" "/" ""4313xdir="$func_dirname_result"43144315func_lo2o "$arg"4316pic_object=$xdir$objdir/$func_lo2o_result4317non_pic_object=$xdir$func_lo2o_result4318func_append libobjs " $pic_object"4319func_append non_pic_objects " $non_pic_object"4320else4321func_fatal_error "\`$arg' is not a valid libtool object"4322fi4323fi4324done4325else4326func_fatal_error "link input file \`$arg' does not exist"4327fi4328arg=$save_arg4329prev=4330continue4331;;4332precious_regex)4333precious_files_regex="$arg"4334prev=4335continue4336;;4337release)4338release="-$arg"4339prev=4340continue4341;;4342rpath | xrpath)4343# We need an absolute path.4344case $arg in4345[\\/]* | [A-Za-z]:[\\/]*) ;;4346*)4347func_fatal_error "only absolute run-paths are allowed"4348;;4349esac4350if test "$prev" = rpath; then4351case "$rpath " in4352*" $arg "*) ;;4353*) rpath="$rpath $arg" ;;4354esac4355else4356case "$xrpath " in4357*" $arg "*) ;;4358*) xrpath="$xrpath $arg" ;;4359esac4360fi4361prev=4362continue4363;;4364shrext)4365shrext_cmds="$arg"4366prev=4367continue4368;;4369weak)4370weak_libs="$weak_libs $arg"4371prev=4372continue4373;;4374xcclinker)4375linker_flags="$linker_flags $qarg"4376compiler_flags="$compiler_flags $qarg"4377prev=4378func_append compile_command " $qarg"4379func_append finalize_command " $qarg"4380continue4381;;4382xcompiler)4383compiler_flags="$compiler_flags $qarg"4384prev=4385func_append compile_command " $qarg"4386func_append finalize_command " $qarg"4387continue4388;;4389xlinker)4390linker_flags="$linker_flags $qarg"4391compiler_flags="$compiler_flags $wl$qarg"4392prev=4393func_append compile_command " $wl$qarg"4394func_append finalize_command " $wl$qarg"4395continue4396;;4397*)4398eval "$prev=\"\$arg\""4399prev=4400continue4401;;4402esac4403fi # test -n "$prev"44044405prevarg="$arg"44064407case $arg in4408-all-static)4409if test -n "$link_static_flag"; then4410# See comment for -static flag below, for more details.4411func_append compile_command " $link_static_flag"4412func_append finalize_command " $link_static_flag"4413fi4414continue4415;;44164417-allow-undefined)4418# FIXME: remove this flag sometime in the future.4419func_fatal_error "\`-allow-undefined' must not be used because it is the default"4420;;44214422-avoid-version)4423avoid_version=yes4424continue4425;;44264427-dlopen)4428prev=dlfiles4429continue4430;;44314432-dlpreopen)4433prev=dlprefiles4434continue4435;;44364437-export-dynamic)4438export_dynamic=yes4439continue4440;;44414442-export-symbols | -export-symbols-regex)4443if test -n "$export_symbols" || test -n "$export_symbols_regex"; then4444func_fatal_error "more than one -exported-symbols argument is not allowed"4445fi4446if test "X$arg" = "X-export-symbols"; then4447prev=expsyms4448else4449prev=expsyms_regex4450fi4451continue4452;;44534454-framework)4455prev=framework4456continue4457;;44584459-inst-prefix-dir)4460prev=inst_prefix4461continue4462;;44634464# The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*4465# so, if we see these flags be careful not to treat them like -L4466-L[A-Z][A-Z]*:*)4467case $with_gcc/$host in4468no/*-*-irix* | /*-*-irix*)4469func_append compile_command " $arg"4470func_append finalize_command " $arg"4471;;4472esac4473continue4474;;44754476-L*)4477func_stripname '-L' '' "$arg"4478dir=$func_stripname_result4479if test -z "$dir"; then4480if test "$#" -gt 0; then4481func_fatal_error "require no space between \`-L' and \`$1'"4482else4483func_fatal_error "need path for \`-L' option"4484fi4485fi4486# We need an absolute path.4487case $dir in4488[\\/]* | [A-Za-z]:[\\/]*) ;;4489*)4490absdir=`cd "$dir" && pwd`4491test -z "$absdir" && \4492func_fatal_error "cannot determine absolute directory name of \`$dir'"4493dir="$absdir"4494;;4495esac4496case "$deplibs " in4497*" -L$dir "*) ;;4498*)4499deplibs="$deplibs -L$dir"4500lib_search_path="$lib_search_path $dir"4501;;4502esac4503case $host in4504*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)4505testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`4506case :$dllsearchpath: in4507*":$dir:"*) ;;4508::) dllsearchpath=$dir;;4509*) dllsearchpath="$dllsearchpath:$dir";;4510esac4511case :$dllsearchpath: in4512*":$testbindir:"*) ;;4513::) dllsearchpath=$testbindir;;4514*) dllsearchpath="$dllsearchpath:$testbindir";;4515esac4516;;4517esac4518continue4519;;45204521-l*)4522if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then4523case $host in4524*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*)4525# These systems don't actually have a C or math library (as such)4526continue4527;;4528*-*-os2*)4529# These systems don't actually have a C library (as such)4530test "X$arg" = "X-lc" && continue4531;;4532*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)4533# Do not include libc due to us having libc/libc_r.4534test "X$arg" = "X-lc" && continue4535;;4536*-*-rhapsody* | *-*-darwin1.[012])4537# Rhapsody C and math libraries are in the System framework4538deplibs="$deplibs System.ltframework"4539continue4540;;4541*-*-sco3.2v5* | *-*-sco5v6*)4542# Causes problems with __ctype4543test "X$arg" = "X-lc" && continue4544;;4545*-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)4546# Compiler inserts libc in the correct place for threads to work4547test "X$arg" = "X-lc" && continue4548;;4549esac4550elif test "X$arg" = "X-lc_r"; then4551case $host in4552*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)4553# Do not include libc_r directly, use -pthread flag.4554continue4555;;4556esac4557fi4558deplibs="$deplibs $arg"4559continue4560;;45614562-module)4563module=yes4564continue4565;;45664567# Tru64 UNIX uses -model [arg] to determine the layout of C++4568# classes, name mangling, and exception handling.4569# Darwin uses the -arch flag to determine output architecture.4570-model|-arch|-isysroot)4571compiler_flags="$compiler_flags $arg"4572func_append compile_command " $arg"4573func_append finalize_command " $arg"4574prev=xcompiler4575continue4576;;45774578-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)4579compiler_flags="$compiler_flags $arg"4580func_append compile_command " $arg"4581func_append finalize_command " $arg"4582case "$new_inherited_linker_flags " in4583*" $arg "*) ;;4584* ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;4585esac4586continue4587;;45884589-multi_module)4590single_module="${wl}-multi_module"4591continue4592;;45934594-no-fast-install)4595fast_install=no4596continue4597;;45984599-no-install)4600case $host in4601*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)4602# The PATH hackery in wrapper scripts is required on Windows4603# and Darwin in order for the loader to find any dlls it needs.4604func_warning "\`-no-install' is ignored for $host"4605func_warning "assuming \`-no-fast-install' instead"4606fast_install=no4607;;4608*) no_install=yes ;;4609esac4610continue4611;;46124613-no-undefined)4614allow_undefined=no4615continue4616;;46174618-objectlist)4619prev=objectlist4620continue4621;;46224623-o) prev=output ;;46244625-precious-files-regex)4626prev=precious_regex4627continue4628;;46294630-release)4631prev=release4632continue4633;;46344635-rpath)4636prev=rpath4637continue4638;;46394640-R)4641prev=xrpath4642continue4643;;46444645-R*)4646func_stripname '-R' '' "$arg"4647dir=$func_stripname_result4648# We need an absolute path.4649case $dir in4650[\\/]* | [A-Za-z]:[\\/]*) ;;4651*)4652func_fatal_error "only absolute run-paths are allowed"4653;;4654esac4655case "$xrpath " in4656*" $dir "*) ;;4657*) xrpath="$xrpath $dir" ;;4658esac4659continue4660;;46614662-shared)4663# The effects of -shared are defined in a previous loop.4664continue4665;;46664667-shrext)4668prev=shrext4669continue4670;;46714672-static | -static-libtool-libs)4673# The effects of -static are defined in a previous loop.4674# We used to do the same as -all-static on platforms that4675# didn't have a PIC flag, but the assumption that the effects4676# would be equivalent was wrong. It would break on at least4677# Digital Unix and AIX.4678continue4679;;46804681-thread-safe)4682thread_safe=yes4683continue4684;;46854686-version-info)4687prev=vinfo4688continue4689;;46904691-version-number)4692prev=vinfo4693vinfo_number=yes4694continue4695;;46964697-weak)4698prev=weak4699continue4700;;47014702-Wc,*)4703func_stripname '-Wc,' '' "$arg"4704args=$func_stripname_result4705arg=4706save_ifs="$IFS"; IFS=','4707for flag in $args; do4708IFS="$save_ifs"4709func_quote_for_eval "$flag"4710arg="$arg $wl$func_quote_for_eval_result"4711compiler_flags="$compiler_flags $func_quote_for_eval_result"4712done4713IFS="$save_ifs"4714func_stripname ' ' '' "$arg"4715arg=$func_stripname_result4716;;47174718-Wl,*)4719func_stripname '-Wl,' '' "$arg"4720args=$func_stripname_result4721arg=4722save_ifs="$IFS"; IFS=','4723for flag in $args; do4724IFS="$save_ifs"4725func_quote_for_eval "$flag"4726arg="$arg $wl$func_quote_for_eval_result"4727compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"4728linker_flags="$linker_flags $func_quote_for_eval_result"4729done4730IFS="$save_ifs"4731func_stripname ' ' '' "$arg"4732arg=$func_stripname_result4733;;47344735-Xcompiler)4736prev=xcompiler4737continue4738;;47394740-Xlinker)4741prev=xlinker4742continue4743;;47444745-XCClinker)4746prev=xcclinker4747continue4748;;47494750# -msg_* for osf cc4751-msg_*)4752func_quote_for_eval "$arg"4753arg="$func_quote_for_eval_result"4754;;47554756# -64, -mips[0-9] enable 64-bit mode on the SGI compiler4757# -r[0-9][0-9]* specifies the processor on the SGI compiler4758# -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler4759# +DA*, +DD* enable 64-bit mode on the HP compiler4760# -q* pass through compiler args for the IBM compiler4761# -m*, -t[45]*, -txscale* pass through architecture-specific4762# compiler args for GCC4763# -F/path gives path to uninstalled frameworks, gcc on darwin4764# -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC4765# @file GCC response files4766-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \4767-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)4768func_quote_for_eval "$arg"4769arg="$func_quote_for_eval_result"4770func_append compile_command " $arg"4771func_append finalize_command " $arg"4772compiler_flags="$compiler_flags $arg"4773continue4774;;47754776# Some other compiler flag.4777-* | +*)4778func_quote_for_eval "$arg"4779arg="$func_quote_for_eval_result"4780;;47814782*.$objext)4783# A standard object.4784objs="$objs $arg"4785;;47864787*.lo)4788# A libtool-controlled object.47894790# Check to see that this really is a libtool object.4791if func_lalib_unsafe_p "$arg"; then4792pic_object=4793non_pic_object=47944795# Read the .lo file4796func_source "$arg"47974798if test -z "$pic_object" ||4799test -z "$non_pic_object" ||4800test "$pic_object" = none &&4801test "$non_pic_object" = none; then4802func_fatal_error "cannot find name of object for \`$arg'"4803fi48044805# Extract subdirectory from the argument.4806func_dirname "$arg" "/" ""4807xdir="$func_dirname_result"48084809if test "$pic_object" != none; then4810# Prepend the subdirectory the object is found in.4811pic_object="$xdir$pic_object"48124813if test "$prev" = dlfiles; then4814if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then4815dlfiles="$dlfiles $pic_object"4816prev=4817continue4818else4819# If libtool objects are unsupported, then we need to preload.4820prev=dlprefiles4821fi4822fi48234824# CHECK ME: I think I busted this. -Ossama4825if test "$prev" = dlprefiles; then4826# Preload the old-style object.4827dlprefiles="$dlprefiles $pic_object"4828prev=4829fi48304831# A PIC object.4832func_append libobjs " $pic_object"4833arg="$pic_object"4834fi48354836# Non-PIC object.4837if test "$non_pic_object" != none; then4838# Prepend the subdirectory the object is found in.4839non_pic_object="$xdir$non_pic_object"48404841# A standard non-PIC object4842func_append non_pic_objects " $non_pic_object"4843if test -z "$pic_object" || test "$pic_object" = none ; then4844arg="$non_pic_object"4845fi4846else4847# If the PIC object exists, use it instead.4848# $xdir was prepended to $pic_object above.4849non_pic_object="$pic_object"4850func_append non_pic_objects " $non_pic_object"4851fi4852else4853# Only an error if not doing a dry-run.4854if $opt_dry_run; then4855# Extract subdirectory from the argument.4856func_dirname "$arg" "/" ""4857xdir="$func_dirname_result"48584859func_lo2o "$arg"4860pic_object=$xdir$objdir/$func_lo2o_result4861non_pic_object=$xdir$func_lo2o_result4862func_append libobjs " $pic_object"4863func_append non_pic_objects " $non_pic_object"4864else4865func_fatal_error "\`$arg' is not a valid libtool object"4866fi4867fi4868;;48694870*.$libext)4871# An archive.4872deplibs="$deplibs $arg"4873old_deplibs="$old_deplibs $arg"4874continue4875;;48764877*.la)4878# A libtool-controlled library.48794880if test "$prev" = dlfiles; then4881# This library was specified with -dlopen.4882dlfiles="$dlfiles $arg"4883prev=4884elif test "$prev" = dlprefiles; then4885# The library was specified with -dlpreopen.4886dlprefiles="$dlprefiles $arg"4887prev=4888else4889deplibs="$deplibs $arg"4890fi4891continue4892;;48934894# Some other compiler argument.4895*)4896# Unknown arguments in both finalize_command and compile_command need4897# to be aesthetically quoted because they are evaled later.4898func_quote_for_eval "$arg"4899arg="$func_quote_for_eval_result"4900;;4901esac # arg49024903# Now actually substitute the argument into the commands.4904if test -n "$arg"; then4905func_append compile_command " $arg"4906func_append finalize_command " $arg"4907fi4908done # argument parsing loop49094910test -n "$prev" && \4911func_fatal_help "the \`$prevarg' option requires an argument"49124913if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then4914eval arg=\"$export_dynamic_flag_spec\"4915func_append compile_command " $arg"4916func_append finalize_command " $arg"4917fi49184919oldlibs=4920# calculate the name of the file, without its directory4921func_basename "$output"4922outputname="$func_basename_result"4923libobjs_save="$libobjs"49244925if test -n "$shlibpath_var"; then4926# get the directories listed in $shlibpath_var4927eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`4928else4929shlib_search_path=4930fi4931eval sys_lib_search_path=\"$sys_lib_search_path_spec\"4932eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"49334934func_dirname "$output" "/" ""4935output_objdir="$func_dirname_result$objdir"4936# Create the object directory.4937func_mkdir_p "$output_objdir"49384939# Determine the type of output4940case $output in4941"")4942func_fatal_help "you must specify an output file"4943;;4944*.$libext) linkmode=oldlib ;;4945*.lo | *.$objext) linkmode=obj ;;4946*.la) linkmode=lib ;;4947*) linkmode=prog ;; # Anything else should be a program.4948esac49494950specialdeplibs=49514952libs=4953# Find all interdependent deplibs by searching for libraries4954# that are linked more than once (e.g. -la -lb -la)4955for deplib in $deplibs; do4956if $opt_duplicate_deps ; then4957case "$libs " in4958*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;4959esac4960fi4961libs="$libs $deplib"4962done49634964if test "$linkmode" = lib; then4965libs="$predeps $libs $compiler_lib_search_path $postdeps"49664967# Compute libraries that are listed more than once in $predeps4968# $postdeps and mark them as special (i.e., whose duplicates are4969# not to be eliminated).4970pre_post_deps=4971if $opt_duplicate_compiler_generated_deps; then4972for pre_post_dep in $predeps $postdeps; do4973case "$pre_post_deps " in4974*" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;4975esac4976pre_post_deps="$pre_post_deps $pre_post_dep"4977done4978fi4979pre_post_deps=4980fi49814982deplibs=4983newdependency_libs=4984newlib_search_path=4985need_relink=no # whether we're linking any uninstalled libtool libraries4986notinst_deplibs= # not-installed libtool libraries4987notinst_path= # paths that contain not-installed libtool libraries49884989case $linkmode in4990lib)4991passes="conv dlpreopen link"4992for file in $dlfiles $dlprefiles; do4993case $file in4994*.la) ;;4995*)4996func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"4997;;4998esac4999done5000;;5001prog)5002compile_deplibs=5003finalize_deplibs=5004alldeplibs=no5005newdlfiles=5006newdlprefiles=5007passes="conv scan dlopen dlpreopen link"5008;;5009*) passes="conv"5010;;5011esac50125013for pass in $passes; do5014# The preopen pass in lib mode reverses $deplibs; put it back here5015# so that -L comes before libs that need it for instance...5016if test "$linkmode,$pass" = "lib,link"; then5017## FIXME: Find the place where the list is rebuilt in the wrong5018## order, and fix it there properly5019tmp_deplibs=5020for deplib in $deplibs; do5021tmp_deplibs="$deplib $tmp_deplibs"5022done5023deplibs="$tmp_deplibs"5024fi50255026if test "$linkmode,$pass" = "lib,link" ||5027test "$linkmode,$pass" = "prog,scan"; then5028libs="$deplibs"5029deplibs=5030fi5031if test "$linkmode" = prog; then5032case $pass in5033dlopen) libs="$dlfiles" ;;5034dlpreopen) libs="$dlprefiles" ;;5035link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;5036esac5037fi5038if test "$linkmode,$pass" = "lib,dlpreopen"; then5039# Collect and forward deplibs of preopened libtool libs5040for lib in $dlprefiles; do5041# Ignore non-libtool-libs5042dependency_libs=5043case $lib in5044*.la) func_source "$lib" ;;5045esac50465047# Collect preopened libtool deplibs, except any this library5048# has declared as weak libs5049for deplib in $dependency_libs; do5050deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`5051case " $weak_libs " in5052*" $deplib_base "*) ;;5053*) deplibs="$deplibs $deplib" ;;5054esac5055done5056done5057libs="$dlprefiles"5058fi5059if test "$pass" = dlopen; then5060# Collect dlpreopened libraries5061save_deplibs="$deplibs"5062deplibs=5063fi50645065for deplib in $libs; do5066lib=5067found=no5068case $deplib in5069-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)5070if test "$linkmode,$pass" = "prog,link"; then5071compile_deplibs="$deplib $compile_deplibs"5072finalize_deplibs="$deplib $finalize_deplibs"5073else5074compiler_flags="$compiler_flags $deplib"5075if test "$linkmode" = lib ; then5076case "$new_inherited_linker_flags " in5077*" $deplib "*) ;;5078* ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;5079esac5080fi5081fi5082continue5083;;5084-l*)5085if test "$linkmode" != lib && test "$linkmode" != prog; then5086func_warning "\`-l' is ignored for archives/objects"5087continue5088fi5089func_stripname '-l' '' "$deplib"5090name=$func_stripname_result5091if test "$linkmode" = lib; then5092searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"5093else5094searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"5095fi5096for searchdir in $searchdirs; do5097for search_ext in .la $std_shrext .so .a; do5098# Search the libtool library5099lib="$searchdir/lib${name}${search_ext}"5100if test -f "$lib"; then5101if test "$search_ext" = ".la"; then5102found=yes5103else5104found=no5105fi5106break 25107fi5108done5109done5110if test "$found" != yes; then5111# deplib doesn't seem to be a libtool library5112if test "$linkmode,$pass" = "prog,link"; then5113compile_deplibs="$deplib $compile_deplibs"5114finalize_deplibs="$deplib $finalize_deplibs"5115else5116deplibs="$deplib $deplibs"5117test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"5118fi5119continue5120else # deplib is a libtool library5121# If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,5122# We need to do some special things here, and not later.5123if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then5124case " $predeps $postdeps " in5125*" $deplib "*)5126if func_lalib_p "$lib"; then5127library_names=5128old_library=5129func_source "$lib"5130for l in $old_library $library_names; do5131ll="$l"5132done5133if test "X$ll" = "X$old_library" ; then # only static version available5134found=no5135func_dirname "$lib" "" "."5136ladir="$func_dirname_result"5137lib=$ladir/$old_library5138if test "$linkmode,$pass" = "prog,link"; then5139compile_deplibs="$deplib $compile_deplibs"5140finalize_deplibs="$deplib $finalize_deplibs"5141else5142deplibs="$deplib $deplibs"5143test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"5144fi5145continue5146fi5147fi5148;;5149*) ;;5150esac5151fi5152fi5153;; # -l5154*.ltframework)5155if test "$linkmode,$pass" = "prog,link"; then5156compile_deplibs="$deplib $compile_deplibs"5157finalize_deplibs="$deplib $finalize_deplibs"5158else5159deplibs="$deplib $deplibs"5160if test "$linkmode" = lib ; then5161case "$new_inherited_linker_flags " in5162*" $deplib "*) ;;5163* ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;5164esac5165fi5166fi5167continue5168;;5169-L*)5170case $linkmode in5171lib)5172deplibs="$deplib $deplibs"5173test "$pass" = conv && continue5174newdependency_libs="$deplib $newdependency_libs"5175func_stripname '-L' '' "$deplib"5176newlib_search_path="$newlib_search_path $func_stripname_result"5177;;5178prog)5179if test "$pass" = conv; then5180deplibs="$deplib $deplibs"5181continue5182fi5183if test "$pass" = scan; then5184deplibs="$deplib $deplibs"5185else5186compile_deplibs="$deplib $compile_deplibs"5187finalize_deplibs="$deplib $finalize_deplibs"5188fi5189func_stripname '-L' '' "$deplib"5190newlib_search_path="$newlib_search_path $func_stripname_result"5191;;5192*)5193func_warning "\`-L' is ignored for archives/objects"5194;;5195esac # linkmode5196continue5197;; # -L5198-R*)5199if test "$pass" = link; then5200func_stripname '-R' '' "$deplib"5201dir=$func_stripname_result5202# Make sure the xrpath contains only unique directories.5203case "$xrpath " in5204*" $dir "*) ;;5205*) xrpath="$xrpath $dir" ;;5206esac5207fi5208deplibs="$deplib $deplibs"5209continue5210;;5211*.la) lib="$deplib" ;;5212*.$libext)5213if test "$pass" = conv; then5214deplibs="$deplib $deplibs"5215continue5216fi5217case $linkmode in5218lib)5219# Linking convenience modules into shared libraries is allowed,5220# but linking other static libraries is non-portable.5221case " $dlpreconveniencelibs " in5222*" $deplib "*) ;;5223*)5224valid_a_lib=no5225case $deplibs_check_method in5226match_pattern*)5227set dummy $deplibs_check_method; shift5228match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`5229if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \5230| $EGREP "$match_pattern_regex" > /dev/null; then5231valid_a_lib=yes5232fi5233;;5234pass_all)5235valid_a_lib=yes5236;;5237esac5238if test "$valid_a_lib" != yes; then5239$ECHO5240$ECHO "*** Warning: Trying to link with static lib archive $deplib."5241$ECHO "*** I have the capability to make that library automatically link in when"5242$ECHO "*** you link to this library. But I can only do this if you have a"5243$ECHO "*** shared version of the library, which you do not appear to have"5244$ECHO "*** because the file extensions .$libext of this argument makes me believe"5245$ECHO "*** that it is just a static archive that I should not use here."5246else5247$ECHO5248$ECHO "*** Warning: Linking the shared library $output against the"5249$ECHO "*** static library $deplib is not portable!"5250deplibs="$deplib $deplibs"5251fi5252;;5253esac5254continue5255;;5256prog)5257if test "$pass" != link; then5258deplibs="$deplib $deplibs"5259else5260compile_deplibs="$deplib $compile_deplibs"5261finalize_deplibs="$deplib $finalize_deplibs"5262fi5263continue5264;;5265esac # linkmode5266;; # *.$libext5267*.lo | *.$objext)5268if test "$pass" = conv; then5269deplibs="$deplib $deplibs"5270elif test "$linkmode" = prog; then5271if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then5272# If there is no dlopen support or we're linking statically,5273# we need to preload.5274newdlprefiles="$newdlprefiles $deplib"5275compile_deplibs="$deplib $compile_deplibs"5276finalize_deplibs="$deplib $finalize_deplibs"5277else5278newdlfiles="$newdlfiles $deplib"5279fi5280fi5281continue5282;;5283%DEPLIBS%)5284alldeplibs=yes5285continue5286;;5287esac # case $deplib52885289if test "$found" = yes || test -f "$lib"; then :5290else5291func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"5292fi52935294# Check to see that this really is a libtool archive.5295func_lalib_unsafe_p "$lib" \5296|| func_fatal_error "\`$lib' is not a valid libtool archive"52975298func_dirname "$lib" "" "."5299ladir="$func_dirname_result"53005301dlname=5302dlopen=5303dlpreopen=5304libdir=5305library_names=5306old_library=5307inherited_linker_flags=5308# If the library was installed with an old release of libtool,5309# it will not redefine variables installed, or shouldnotlink5310installed=yes5311shouldnotlink=no5312avoidtemprpath=531353145315# Read the .la file5316func_source "$lib"53175318# Convert "-framework foo" to "foo.ltframework"5319if test -n "$inherited_linker_flags"; then5320tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`5321for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do5322case " $new_inherited_linker_flags " in5323*" $tmp_inherited_linker_flag "*) ;;5324*) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;5325esac5326done5327fi5328dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`5329if test "$linkmode,$pass" = "lib,link" ||5330test "$linkmode,$pass" = "prog,scan" ||5331{ test "$linkmode" != prog && test "$linkmode" != lib; }; then5332test -n "$dlopen" && dlfiles="$dlfiles $dlopen"5333test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"5334fi53355336if test "$pass" = conv; then5337# Only check for convenience libraries5338deplibs="$lib $deplibs"5339if test -z "$libdir"; then5340if test -z "$old_library"; then5341func_fatal_error "cannot find name of link library for \`$lib'"5342fi5343# It is a libtool convenience library, so add in its objects.5344convenience="$convenience $ladir/$objdir/$old_library"5345old_convenience="$old_convenience $ladir/$objdir/$old_library"5346elif test "$linkmode" != prog && test "$linkmode" != lib; then5347func_fatal_error "\`$lib' is not a convenience library"5348fi5349tmp_libs=5350for deplib in $dependency_libs; do5351deplibs="$deplib $deplibs"5352if $opt_duplicate_deps ; then5353case "$tmp_libs " in5354*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;5355esac5356fi5357tmp_libs="$tmp_libs $deplib"5358done5359continue5360fi # $pass = conv536153625363# Get the name of the library we link against.5364linklib=5365for l in $old_library $library_names; do5366linklib="$l"5367done5368if test -z "$linklib"; then5369func_fatal_error "cannot find name of link library for \`$lib'"5370fi53715372# This library was specified with -dlopen.5373if test "$pass" = dlopen; then5374if test -z "$libdir"; then5375func_fatal_error "cannot -dlopen a convenience library: \`$lib'"5376fi5377if test -z "$dlname" ||5378test "$dlopen_support" != yes ||5379test "$build_libtool_libs" = no; then5380# If there is no dlname, no dlopen support or we're linking5381# statically, we need to preload. We also need to preload any5382# dependent libraries so libltdl's deplib preloader doesn't5383# bomb out in the load deplibs phase.5384dlprefiles="$dlprefiles $lib $dependency_libs"5385else5386newdlfiles="$newdlfiles $lib"5387fi5388continue5389fi # $pass = dlopen53905391# We need an absolute path.5392case $ladir in5393[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;5394*)5395abs_ladir=`cd "$ladir" && pwd`5396if test -z "$abs_ladir"; then5397func_warning "cannot determine absolute directory name of \`$ladir'"5398func_warning "passing it literally to the linker, although it might fail"5399abs_ladir="$ladir"5400fi5401;;5402esac5403func_basename "$lib"5404laname="$func_basename_result"54055406# Find the relevant object directory and library name.5407if test "X$installed" = Xyes; then5408if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then5409func_warning "library \`$lib' was moved."5410dir="$ladir"5411absdir="$abs_ladir"5412libdir="$abs_ladir"5413else5414dir="$libdir"5415absdir="$libdir"5416fi5417test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes5418else5419if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then5420dir="$ladir"5421absdir="$abs_ladir"5422# Remove this search path later5423notinst_path="$notinst_path $abs_ladir"5424else5425dir="$ladir/$objdir"5426absdir="$abs_ladir/$objdir"5427# Remove this search path later5428notinst_path="$notinst_path $abs_ladir"5429fi5430fi # $installed = yes5431func_stripname 'lib' '.la' "$laname"5432name=$func_stripname_result54335434# This library was specified with -dlpreopen.5435if test "$pass" = dlpreopen; then5436if test -z "$libdir" && test "$linkmode" = prog; then5437func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"5438fi5439# Prefer using a static library (so that no silly _DYNAMIC symbols5440# are required to link).5441if test -n "$old_library"; then5442newdlprefiles="$newdlprefiles $dir/$old_library"5443# Keep a list of preopened convenience libraries to check5444# that they are being used correctly in the link pass.5445test -z "$libdir" && \5446dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"5447# Otherwise, use the dlname, so that lt_dlopen finds it.5448elif test -n "$dlname"; then5449newdlprefiles="$newdlprefiles $dir/$dlname"5450else5451newdlprefiles="$newdlprefiles $dir/$linklib"5452fi5453fi # $pass = dlpreopen54545455if test -z "$libdir"; then5456# Link the convenience library5457if test "$linkmode" = lib; then5458deplibs="$dir/$old_library $deplibs"5459elif test "$linkmode,$pass" = "prog,link"; then5460compile_deplibs="$dir/$old_library $compile_deplibs"5461finalize_deplibs="$dir/$old_library $finalize_deplibs"5462else5463deplibs="$lib $deplibs" # used for prog,scan pass5464fi5465continue5466fi546754685469if test "$linkmode" = prog && test "$pass" != link; then5470newlib_search_path="$newlib_search_path $ladir"5471deplibs="$lib $deplibs"54725473linkalldeplibs=no5474if test "$link_all_deplibs" != no || test -z "$library_names" ||5475test "$build_libtool_libs" = no; then5476linkalldeplibs=yes5477fi54785479tmp_libs=5480for deplib in $dependency_libs; do5481case $deplib in5482-L*) func_stripname '-L' '' "$deplib"5483newlib_search_path="$newlib_search_path $func_stripname_result"5484;;5485esac5486# Need to link against all dependency_libs?5487if test "$linkalldeplibs" = yes; then5488deplibs="$deplib $deplibs"5489else5490# Need to hardcode shared library paths5491# or/and link against static libraries5492newdependency_libs="$deplib $newdependency_libs"5493fi5494if $opt_duplicate_deps ; then5495case "$tmp_libs " in5496*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;5497esac5498fi5499tmp_libs="$tmp_libs $deplib"5500done # for deplib5501continue5502fi # $linkmode = prog...55035504if test "$linkmode,$pass" = "prog,link"; then5505if test -n "$library_names" &&5506{ { test "$prefer_static_libs" = no ||5507test "$prefer_static_libs,$installed" = "built,yes"; } ||5508test -z "$old_library"; }; then5509# We need to hardcode the library path5510if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then5511# Make sure the rpath contains only unique directories.5512case "$temp_rpath:" in5513*"$absdir:"*) ;;5514*) temp_rpath="$temp_rpath$absdir:" ;;5515esac5516fi55175518# Hardcode the library path.5519# Skip directories that are in the system default run-time5520# search path.5521case " $sys_lib_dlsearch_path " in5522*" $absdir "*) ;;5523*)5524case "$compile_rpath " in5525*" $absdir "*) ;;5526*) compile_rpath="$compile_rpath $absdir"5527esac5528;;5529esac5530case " $sys_lib_dlsearch_path " in5531*" $libdir "*) ;;5532*)5533case "$finalize_rpath " in5534*" $libdir "*) ;;5535*) finalize_rpath="$finalize_rpath $libdir"5536esac5537;;5538esac5539fi # $linkmode,$pass = prog,link...55405541if test "$alldeplibs" = yes &&5542{ test "$deplibs_check_method" = pass_all ||5543{ test "$build_libtool_libs" = yes &&5544test -n "$library_names"; }; }; then5545# We only need to search for static libraries5546continue5547fi5548fi55495550link_static=no # Whether the deplib will be linked statically5551use_static_libs=$prefer_static_libs5552if test "$use_static_libs" = built && test "$installed" = yes; then5553use_static_libs=no5554fi5555if test -n "$library_names" &&5556{ test "$use_static_libs" = no || test -z "$old_library"; }; then5557case $host in5558*cygwin* | *mingw* | *cegcc*)5559# No point in relinking DLLs because paths are not encoded5560notinst_deplibs="$notinst_deplibs $lib"5561need_relink=no5562;;5563*)5564if test "$installed" = no; then5565notinst_deplibs="$notinst_deplibs $lib"5566need_relink=yes5567fi5568;;5569esac5570# This is a shared library55715572# Warn about portability, can't link against -module's on some5573# systems (darwin). Don't bleat about dlopened modules though!5574dlopenmodule=""5575for dlpremoduletest in $dlprefiles; do5576if test "X$dlpremoduletest" = "X$lib"; then5577dlopenmodule="$dlpremoduletest"5578break5579fi5580done5581if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then5582$ECHO5583if test "$linkmode" = prog; then5584$ECHO "*** Warning: Linking the executable $output against the loadable module"5585else5586$ECHO "*** Warning: Linking the shared library $output against the loadable module"5587fi5588$ECHO "*** $linklib is not portable!"5589fi5590if test "$linkmode" = lib &&5591test "$hardcode_into_libs" = yes; then5592# Hardcode the library path.5593# Skip directories that are in the system default run-time5594# search path.5595case " $sys_lib_dlsearch_path " in5596*" $absdir "*) ;;5597*)5598case "$compile_rpath " in5599*" $absdir "*) ;;5600*) compile_rpath="$compile_rpath $absdir"5601esac5602;;5603esac5604case " $sys_lib_dlsearch_path " in5605*" $libdir "*) ;;5606*)5607case "$finalize_rpath " in5608*" $libdir "*) ;;5609*) finalize_rpath="$finalize_rpath $libdir"5610esac5611;;5612esac5613fi56145615if test -n "$old_archive_from_expsyms_cmds"; then5616# figure out the soname5617set dummy $library_names5618shift5619realname="$1"5620shift5621libname=`eval "\\$ECHO \"$libname_spec\""`5622# use dlname if we got it. it's perfectly good, no?5623if test -n "$dlname"; then5624soname="$dlname"5625elif test -n "$soname_spec"; then5626# bleh windows5627case $host in5628*cygwin* | mingw* | *cegcc*)5629func_arith $current - $age5630major=$func_arith_result5631versuffix="-$major"5632;;5633esac5634eval soname=\"$soname_spec\"5635else5636soname="$realname"5637fi56385639# Make a new name for the extract_expsyms_cmds to use5640soroot="$soname"5641func_basename "$soroot"5642soname="$func_basename_result"5643func_stripname 'lib' '.dll' "$soname"5644newlib=libimp-$func_stripname_result.a56455646# If the library has no export list, then create one now5647if test -f "$output_objdir/$soname-def"; then :5648else5649func_verbose "extracting exported symbol list from \`$soname'"5650func_execute_cmds "$extract_expsyms_cmds" 'exit $?'5651fi56525653# Create $newlib5654if test -f "$output_objdir/$newlib"; then :; else5655func_verbose "generating import library for \`$soname'"5656func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'5657fi5658# make sure the library variables are pointing to the new library5659dir=$output_objdir5660linklib=$newlib5661fi # test -n "$old_archive_from_expsyms_cmds"56625663if test "$linkmode" = prog || test "$mode" != relink; then5664add_shlibpath=5665add_dir=5666add=5667lib_linked=yes5668case $hardcode_action in5669immediate | unsupported)5670if test "$hardcode_direct" = no; then5671add="$dir/$linklib"5672case $host in5673*-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;5674*-*-sysv4*uw2*) add_dir="-L$dir" ;;5675*-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \5676*-*-unixware7*) add_dir="-L$dir" ;;5677*-*-darwin* )5678# if the lib is a (non-dlopened) module then we can not5679# link against it, someone is ignoring the earlier warnings5680if /usr/bin/file -L $add 2> /dev/null |5681$GREP ": [^:]* bundle" >/dev/null ; then5682if test "X$dlopenmodule" != "X$lib"; then5683$ECHO "*** Warning: lib $linklib is a module, not a shared library"5684if test -z "$old_library" ; then5685$ECHO5686$ECHO "*** And there doesn't seem to be a static archive available"5687$ECHO "*** The link will probably fail, sorry"5688else5689add="$dir/$old_library"5690fi5691elif test -n "$old_library"; then5692add="$dir/$old_library"5693fi5694fi5695esac5696elif test "$hardcode_minus_L" = no; then5697case $host in5698*-*-sunos*) add_shlibpath="$dir" ;;5699esac5700add_dir="-L$dir"5701add="-l$name"5702elif test "$hardcode_shlibpath_var" = no; then5703add_shlibpath="$dir"5704add="-l$name"5705else5706lib_linked=no5707fi5708;;5709relink)5710if test "$hardcode_direct" = yes &&5711test "$hardcode_direct_absolute" = no; then5712add="$dir/$linklib"5713elif test "$hardcode_minus_L" = yes; then5714add_dir="-L$dir"5715# Try looking first in the location we're being installed to.5716if test -n "$inst_prefix_dir"; then5717case $libdir in5718[\\/]*)5719add_dir="$add_dir -L$inst_prefix_dir$libdir"5720;;5721esac5722fi5723add="-l$name"5724elif test "$hardcode_shlibpath_var" = yes; then5725add_shlibpath="$dir"5726add="-l$name"5727else5728lib_linked=no5729fi5730;;5731*) lib_linked=no ;;5732esac57335734if test "$lib_linked" != yes; then5735func_fatal_configuration "unsupported hardcode properties"5736fi57375738if test -n "$add_shlibpath"; then5739case :$compile_shlibpath: in5740*":$add_shlibpath:"*) ;;5741*) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;5742esac5743fi5744if test "$linkmode" = prog; then5745test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"5746test -n "$add" && compile_deplibs="$add $compile_deplibs"5747else5748test -n "$add_dir" && deplibs="$add_dir $deplibs"5749test -n "$add" && deplibs="$add $deplibs"5750if test "$hardcode_direct" != yes &&5751test "$hardcode_minus_L" != yes &&5752test "$hardcode_shlibpath_var" = yes; then5753case :$finalize_shlibpath: in5754*":$libdir:"*) ;;5755*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;5756esac5757fi5758fi5759fi57605761if test "$linkmode" = prog || test "$mode" = relink; then5762add_shlibpath=5763add_dir=5764add=5765# Finalize command for both is simple: just hardcode it.5766if test "$hardcode_direct" = yes &&5767test "$hardcode_direct_absolute" = no; then5768add="$libdir/$linklib"5769elif test "$hardcode_minus_L" = yes; then5770add_dir="-L$libdir"5771add="-l$name"5772elif test "$hardcode_shlibpath_var" = yes; then5773case :$finalize_shlibpath: in5774*":$libdir:"*) ;;5775*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;5776esac5777add="-l$name"5778elif test "$hardcode_automatic" = yes; then5779if test -n "$inst_prefix_dir" &&5780test -f "$inst_prefix_dir$libdir/$linklib" ; then5781add="$inst_prefix_dir$libdir/$linklib"5782else5783add="$libdir/$linklib"5784fi5785else5786# We cannot seem to hardcode it, guess we'll fake it.5787add_dir="-L$libdir"5788# Try looking first in the location we're being installed to.5789if test -n "$inst_prefix_dir"; then5790case $libdir in5791[\\/]*)5792add_dir="$add_dir -L$inst_prefix_dir$libdir"5793;;5794esac5795fi5796add="-l$name"5797fi57985799if test "$linkmode" = prog; then5800test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"5801test -n "$add" && finalize_deplibs="$add $finalize_deplibs"5802else5803test -n "$add_dir" && deplibs="$add_dir $deplibs"5804test -n "$add" && deplibs="$add $deplibs"5805fi5806fi5807elif test "$linkmode" = prog; then5808# Here we assume that one of hardcode_direct or hardcode_minus_L5809# is not unsupported. This is valid on all known static and5810# shared platforms.5811if test "$hardcode_direct" != unsupported; then5812test -n "$old_library" && linklib="$old_library"5813compile_deplibs="$dir/$linklib $compile_deplibs"5814finalize_deplibs="$dir/$linklib $finalize_deplibs"5815else5816compile_deplibs="-l$name -L$dir $compile_deplibs"5817finalize_deplibs="-l$name -L$dir $finalize_deplibs"5818fi5819elif test "$build_libtool_libs" = yes; then5820# Not a shared library5821if test "$deplibs_check_method" != pass_all; then5822# We're trying link a shared library against a static one5823# but the system doesn't support it.58245825# Just print a warning and add the library to dependency_libs so5826# that the program can be linked against the static library.5827$ECHO5828$ECHO "*** Warning: This system can not link to static lib archive $lib."5829$ECHO "*** I have the capability to make that library automatically link in when"5830$ECHO "*** you link to this library. But I can only do this if you have a"5831$ECHO "*** shared version of the library, which you do not appear to have."5832if test "$module" = yes; then5833$ECHO "*** But as you try to build a module library, libtool will still create "5834$ECHO "*** a static module, that should work as long as the dlopening application"5835$ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."5836if test -z "$global_symbol_pipe"; then5837$ECHO5838$ECHO "*** However, this would only work if libtool was able to extract symbol"5839$ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"5840$ECHO "*** not find such a program. So, this module is probably useless."5841$ECHO "*** \`nm' from GNU binutils and a full rebuild may help."5842fi5843if test "$build_old_libs" = no; then5844build_libtool_libs=module5845build_old_libs=yes5846else5847build_libtool_libs=no5848fi5849fi5850else5851deplibs="$dir/$old_library $deplibs"5852link_static=yes5853fi5854fi # link shared/static library?58555856if test "$linkmode" = lib; then5857if test -n "$dependency_libs" &&5858{ test "$hardcode_into_libs" != yes ||5859test "$build_old_libs" = yes ||5860test "$link_static" = yes; }; then5861# Extract -R from dependency_libs5862temp_deplibs=5863for libdir in $dependency_libs; do5864case $libdir in5865-R*) func_stripname '-R' '' "$libdir"5866temp_xrpath=$func_stripname_result5867case " $xrpath " in5868*" $temp_xrpath "*) ;;5869*) xrpath="$xrpath $temp_xrpath";;5870esac;;5871*) temp_deplibs="$temp_deplibs $libdir";;5872esac5873done5874dependency_libs="$temp_deplibs"5875fi58765877newlib_search_path="$newlib_search_path $absdir"5878# Link against this library5879test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"5880# ... and its dependency_libs5881tmp_libs=5882for deplib in $dependency_libs; do5883newdependency_libs="$deplib $newdependency_libs"5884if $opt_duplicate_deps ; then5885case "$tmp_libs " in5886*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;5887esac5888fi5889tmp_libs="$tmp_libs $deplib"5890done58915892if test "$link_all_deplibs" != no; then5893# Add the search paths of all dependency libraries5894for deplib in $dependency_libs; do5895case $deplib in5896-L*) path="$deplib" ;;5897*.la)5898func_dirname "$deplib" "" "."5899dir="$func_dirname_result"5900# We need an absolute path.5901case $dir in5902[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;5903*)5904absdir=`cd "$dir" && pwd`5905if test -z "$absdir"; then5906func_warning "cannot determine absolute directory name of \`$dir'"5907absdir="$dir"5908fi5909;;5910esac5911if $GREP "^installed=no" $deplib > /dev/null; then5912case $host in5913*-*-darwin*)5914depdepl=5915eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`5916if test -n "$deplibrary_names" ; then5917for tmp in $deplibrary_names ; do5918depdepl=$tmp5919done5920if test -f "$absdir/$objdir/$depdepl" ; then5921depdepl="$absdir/$objdir/$depdepl"5922darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`5923if test -z "$darwin_install_name"; then5924darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`5925fi5926compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"5927linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"5928path=5929fi5930fi5931;;5932*)5933path="-L$absdir/$objdir"5934;;5935esac5936else5937eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`5938test -z "$libdir" && \5939func_fatal_error "\`$deplib' is not a valid libtool archive"5940test "$absdir" != "$libdir" && \5941func_warning "\`$deplib' seems to be moved"59425943path="-L$absdir"5944fi5945;;5946esac5947case " $deplibs " in5948*" $path "*) ;;5949*) deplibs="$path $deplibs" ;;5950esac5951done5952fi # link_all_deplibs != no5953fi # linkmode = lib5954done # for deplib in $libs5955if test "$pass" = link; then5956if test "$linkmode" = "prog"; then5957compile_deplibs="$new_inherited_linker_flags $compile_deplibs"5958finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"5959else5960compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`5961fi5962fi5963dependency_libs="$newdependency_libs"5964if test "$pass" = dlpreopen; then5965# Link the dlpreopened libraries before other libraries5966for deplib in $save_deplibs; do5967deplibs="$deplib $deplibs"5968done5969fi5970if test "$pass" != dlopen; then5971if test "$pass" != conv; then5972# Make sure lib_search_path contains only unique directories.5973lib_search_path=5974for dir in $newlib_search_path; do5975case "$lib_search_path " in5976*" $dir "*) ;;5977*) lib_search_path="$lib_search_path $dir" ;;5978esac5979done5980newlib_search_path=5981fi59825983if test "$linkmode,$pass" != "prog,link"; then5984vars="deplibs"5985else5986vars="compile_deplibs finalize_deplibs"5987fi5988for var in $vars dependency_libs; do5989# Add libraries to $var in reverse order5990eval tmp_libs=\"\$$var\"5991new_libs=5992for deplib in $tmp_libs; do5993# FIXME: Pedantically, this is the right thing to do, so5994# that some nasty dependency loop isn't accidentally5995# broken:5996#new_libs="$deplib $new_libs"5997# Pragmatically, this seems to cause very few problems in5998# practice:5999case $deplib in6000-L*) new_libs="$deplib $new_libs" ;;6001-R*) ;;6002*)6003# And here is the reason: when a library appears more6004# than once as an explicit dependence of a library, or6005# is implicitly linked in more than once by the6006# compiler, it is considered special, and multiple6007# occurrences thereof are not removed. Compare this6008# with having the same library being listed as a6009# dependency of multiple other libraries: in this case,6010# we know (pedantically, we assume) the library does not6011# need to be listed more than once, so we keep only the6012# last copy. This is not always right, but it is rare6013# enough that we require users that really mean to play6014# such unportable linking tricks to link the library6015# using -Wl,-lname, so that libtool does not consider it6016# for duplicate removal.6017case " $specialdeplibs " in6018*" $deplib "*) new_libs="$deplib $new_libs" ;;6019*)6020case " $new_libs " in6021*" $deplib "*) ;;6022*) new_libs="$deplib $new_libs" ;;6023esac6024;;6025esac6026;;6027esac6028done6029tmp_libs=6030for deplib in $new_libs; do6031case $deplib in6032-L*)6033case " $tmp_libs " in6034*" $deplib "*) ;;6035*) tmp_libs="$tmp_libs $deplib" ;;6036esac6037;;6038*) tmp_libs="$tmp_libs $deplib" ;;6039esac6040done6041eval $var=\"$tmp_libs\"6042done # for var6043fi6044# Last step: remove runtime libs from dependency_libs6045# (they stay in deplibs)6046tmp_libs=6047for i in $dependency_libs ; do6048case " $predeps $postdeps $compiler_lib_search_path " in6049*" $i "*)6050i=""6051;;6052esac6053if test -n "$i" ; then6054tmp_libs="$tmp_libs $i"6055fi6056done6057dependency_libs=$tmp_libs6058done # for pass6059if test "$linkmode" = prog; then6060dlfiles="$newdlfiles"6061fi6062if test "$linkmode" = prog || test "$linkmode" = lib; then6063dlprefiles="$newdlprefiles"6064fi60656066case $linkmode in6067oldlib)6068if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then6069func_warning "\`-dlopen' is ignored for archives"6070fi60716072case " $deplibs" in6073*\ -l* | *\ -L*)6074func_warning "\`-l' and \`-L' are ignored for archives" ;;6075esac60766077test -n "$rpath" && \6078func_warning "\`-rpath' is ignored for archives"60796080test -n "$xrpath" && \6081func_warning "\`-R' is ignored for archives"60826083test -n "$vinfo" && \6084func_warning "\`-version-info/-version-number' is ignored for archives"60856086test -n "$release" && \6087func_warning "\`-release' is ignored for archives"60886089test -n "$export_symbols$export_symbols_regex" && \6090func_warning "\`-export-symbols' is ignored for archives"60916092# Now set the variables for building old libraries.6093build_libtool_libs=no6094oldlibs="$output"6095objs="$objs$old_deplibs"6096;;60976098lib)6099# Make sure we only generate libraries of the form `libNAME.la'.6100case $outputname in6101lib*)6102func_stripname 'lib' '.la' "$outputname"6103name=$func_stripname_result6104eval shared_ext=\"$shrext_cmds\"6105eval libname=\"$libname_spec\"6106;;6107*)6108test "$module" = no && \6109func_fatal_help "libtool library \`$output' must begin with \`lib'"61106111if test "$need_lib_prefix" != no; then6112# Add the "lib" prefix for modules if required6113func_stripname '' '.la' "$outputname"6114name=$func_stripname_result6115eval shared_ext=\"$shrext_cmds\"6116eval libname=\"$libname_spec\"6117else6118func_stripname '' '.la' "$outputname"6119libname=$func_stripname_result6120fi6121;;6122esac61236124if test -n "$objs"; then6125if test "$deplibs_check_method" != pass_all; then6126func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"6127else6128$ECHO6129$ECHO "*** Warning: Linking the shared library $output against the non-libtool"6130$ECHO "*** objects $objs is not portable!"6131libobjs="$libobjs $objs"6132fi6133fi61346135test "$dlself" != no && \6136func_warning "\`-dlopen self' is ignored for libtool libraries"61376138set dummy $rpath6139shift6140test "$#" -gt 1 && \6141func_warning "ignoring multiple \`-rpath's for a libtool library"61426143install_libdir="$1"61446145oldlibs=6146if test -z "$rpath"; then6147if test "$build_libtool_libs" = yes; then6148# Building a libtool convenience library.6149# Some compilers have problems with a `.al' extension so6150# convenience libraries should have the same extension an6151# archive normally would.6152oldlibs="$output_objdir/$libname.$libext $oldlibs"6153build_libtool_libs=convenience6154build_old_libs=yes6155fi61566157test -n "$vinfo" && \6158func_warning "\`-version-info/-version-number' is ignored for convenience libraries"61596160test -n "$release" && \6161func_warning "\`-release' is ignored for convenience libraries"6162else61636164# Parse the version information argument.6165save_ifs="$IFS"; IFS=':'6166set dummy $vinfo 0 0 06167shift6168IFS="$save_ifs"61696170test -n "$7" && \6171func_fatal_help "too many parameters to \`-version-info'"61726173# convert absolute version numbers to libtool ages6174# this retains compatibility with .la files and attempts6175# to make the code below a bit more comprehensible61766177case $vinfo_number in6178yes)6179number_major="$1"6180number_minor="$2"6181number_revision="$3"6182#6183# There are really only two kinds -- those that6184# use the current revision as the major version6185# and those that subtract age and use age as6186# a minor version. But, then there is irix6187# which has an extra 1 added just for fun6188#6189case $version_type in6190darwin|linux|osf|windows|none)6191func_arith $number_major + $number_minor6192current=$func_arith_result6193age="$number_minor"6194revision="$number_revision"6195;;6196freebsd-aout|freebsd-elf|sunos)6197current="$number_major"6198revision="$number_minor"6199age="0"6200;;6201irix|nonstopux)6202func_arith $number_major + $number_minor6203current=$func_arith_result6204age="$number_minor"6205revision="$number_minor"6206lt_irix_increment=no6207;;6208esac6209;;6210no)6211current="$1"6212revision="$2"6213age="$3"6214;;6215esac62166217# Check that each of the things are valid numbers.6218case $current in62190|[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]) ;;6220*)6221func_error "CURRENT \`$current' must be a nonnegative integer"6222func_fatal_error "\`$vinfo' is not valid version information"6223;;6224esac62256226case $revision in62270|[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]) ;;6228*)6229func_error "REVISION \`$revision' must be a nonnegative integer"6230func_fatal_error "\`$vinfo' is not valid version information"6231;;6232esac62336234case $age in62350|[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]) ;;6236*)6237func_error "AGE \`$age' must be a nonnegative integer"6238func_fatal_error "\`$vinfo' is not valid version information"6239;;6240esac62416242if test "$age" -gt "$current"; then6243func_error "AGE \`$age' is greater than the current interface number \`$current'"6244func_fatal_error "\`$vinfo' is not valid version information"6245fi62466247# Calculate the version variables.6248major=6249versuffix=6250verstring=6251case $version_type in6252none) ;;62536254darwin)6255# Like Linux, but with the current version available in6256# verstring for coding it into the library header6257func_arith $current - $age6258major=.$func_arith_result6259versuffix="$major.$age.$revision"6260# Darwin ld doesn't like 0 for these options...6261func_arith $current + 16262minor_current=$func_arith_result6263xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"6264verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"6265;;62666267freebsd-aout)6268major=".$current"6269versuffix=".$current.$revision";6270;;62716272freebsd-elf)6273major=".$current"6274versuffix=".$current"6275;;62766277irix | nonstopux)6278if test "X$lt_irix_increment" = "Xno"; then6279func_arith $current - $age6280else6281func_arith $current - $age + 16282fi6283major=$func_arith_result62846285case $version_type in6286nonstopux) verstring_prefix=nonstopux ;;6287*) verstring_prefix=sgi ;;6288esac6289verstring="$verstring_prefix$major.$revision"62906291# Add in all the interfaces that we are compatible with.6292loop=$revision6293while test "$loop" -ne 0; do6294func_arith $revision - $loop6295iface=$func_arith_result6296func_arith $loop - 16297loop=$func_arith_result6298verstring="$verstring_prefix$major.$iface:$verstring"6299done63006301# Before this point, $major must not contain `.'.6302major=.$major6303versuffix="$major.$revision"6304;;63056306linux)6307func_arith $current - $age6308major=.$func_arith_result6309versuffix="$major.$age.$revision"6310;;63116312osf)6313func_arith $current - $age6314major=.$func_arith_result6315versuffix=".$current.$age.$revision"6316verstring="$current.$age.$revision"63176318# Add in all the interfaces that we are compatible with.6319loop=$age6320while test "$loop" -ne 0; do6321func_arith $current - $loop6322iface=$func_arith_result6323func_arith $loop - 16324loop=$func_arith_result6325verstring="$verstring:${iface}.0"6326done63276328# Make executables depend on our current version.6329verstring="$verstring:${current}.0"6330;;63316332qnx)6333major=".$current"6334versuffix=".$current"6335;;63366337sunos)6338major=".$current"6339versuffix=".$current.$revision"6340;;63416342windows)6343# Use '-' rather than '.', since we only want one6344# extension on DOS 8.3 filesystems.6345func_arith $current - $age6346major=$func_arith_result6347versuffix="-$major"6348;;63496350*)6351func_fatal_configuration "unknown library version type \`$version_type'"6352;;6353esac63546355# Clear the version info if we defaulted, and they specified a release.6356if test -z "$vinfo" && test -n "$release"; then6357major=6358case $version_type in6359darwin)6360# we can't check for "0.0" in archive_cmds due to quoting6361# problems, so we reset it completely6362verstring=6363;;6364*)6365verstring="0.0"6366;;6367esac6368if test "$need_version" = no; then6369versuffix=6370else6371versuffix=".0.0"6372fi6373fi63746375# Remove version info from name if versioning should be avoided6376if test "$avoid_version" = yes && test "$need_version" = no; then6377major=6378versuffix=6379verstring=""6380fi63816382# Check to see if the archive will have undefined symbols.6383if test "$allow_undefined" = yes; then6384if test "$allow_undefined_flag" = unsupported; then6385func_warning "undefined symbols not allowed in $host shared libraries"6386build_libtool_libs=no6387build_old_libs=yes6388fi6389else6390# Don't allow undefined symbols.6391allow_undefined_flag="$no_undefined_flag"6392fi63936394fi63956396func_generate_dlsyms "$libname" "$libname" "yes"6397libobjs="$libobjs $symfileobj"6398test "X$libobjs" = "X " && libobjs=63996400if test "$mode" != relink; then6401# Remove our outputs, but don't remove object files since they6402# may have been created when compiling PIC objects.6403removelist=6404tempremovelist=`$ECHO "$output_objdir/*"`6405for p in $tempremovelist; do6406case $p in6407*.$objext | *.gcno)6408;;6409$output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)6410if test "X$precious_files_regex" != "X"; then6411if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&16412then6413continue6414fi6415fi6416removelist="$removelist $p"6417;;6418*) ;;6419esac6420done6421test -n "$removelist" && \6422func_show_eval "${RM}r \$removelist"6423fi64246425# Now set the variables for building old libraries.6426if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then6427oldlibs="$oldlibs $output_objdir/$libname.$libext"64286429# Transform .lo files to .o files.6430oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`6431fi64326433# Eliminate all temporary directories.6434#for path in $notinst_path; do6435# lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`6436# deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`6437# dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`6438#done64396440if test -n "$xrpath"; then6441# If the user specified any rpath flags, then add them.6442temp_xrpath=6443for libdir in $xrpath; do6444temp_xrpath="$temp_xrpath -R$libdir"6445case "$finalize_rpath " in6446*" $libdir "*) ;;6447*) finalize_rpath="$finalize_rpath $libdir" ;;6448esac6449done6450if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then6451dependency_libs="$temp_xrpath $dependency_libs"6452fi6453fi64546455# Make sure dlfiles contains only unique files that won't be dlpreopened6456old_dlfiles="$dlfiles"6457dlfiles=6458for lib in $old_dlfiles; do6459case " $dlprefiles $dlfiles " in6460*" $lib "*) ;;6461*) dlfiles="$dlfiles $lib" ;;6462esac6463done64646465# Make sure dlprefiles contains only unique files6466old_dlprefiles="$dlprefiles"6467dlprefiles=6468for lib in $old_dlprefiles; do6469case "$dlprefiles " in6470*" $lib "*) ;;6471*) dlprefiles="$dlprefiles $lib" ;;6472esac6473done64746475if test "$build_libtool_libs" = yes; then6476if test -n "$rpath"; then6477case $host in6478*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*)6479# these systems don't actually have a c library (as such)!6480;;6481*-*-rhapsody* | *-*-darwin1.[012])6482# Rhapsody C library is in the System framework6483deplibs="$deplibs System.ltframework"6484;;6485*-*-netbsd*)6486# Don't link with libc until the a.out ld.so is fixed.6487;;6488*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)6489# Do not include libc due to us having libc/libc_r.6490;;6491*-*-sco3.2v5* | *-*-sco5v6*)6492# Causes problems with __ctype6493;;6494*-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)6495# Compiler inserts libc in the correct place for threads to work6496;;6497*)6498# Add libc to deplibs on all other systems if necessary.6499if test "$build_libtool_need_lc" = "yes"; then6500deplibs="$deplibs -lc"6501fi6502;;6503esac6504fi65056506# Transform deplibs into only deplibs that can be linked in shared.6507name_save=$name6508libname_save=$libname6509release_save=$release6510versuffix_save=$versuffix6511major_save=$major6512# I'm not sure if I'm treating the release correctly. I think6513# release should show up in the -l (ie -lgmp5) so we don't want to6514# add it in twice. Is that correct?6515release=""6516versuffix=""6517major=""6518newdeplibs=6519droppeddeps=no6520case $deplibs_check_method in6521pass_all)6522# Don't check for shared/static. Everything works.6523# This might be a little naive. We might want to check6524# whether the library exists or not. But this is on6525# osf3 & osf4 and I'm not really sure... Just6526# implementing what was already the behavior.6527newdeplibs=$deplibs6528;;6529test_compile)6530# This code stresses the "libraries are programs" paradigm to its6531# limits. Maybe even breaks it. We compile a program, linking it6532# against the deplibs as a proxy for the library. Then we can check6533# whether they linked in statically or dynamically with ldd.6534$opt_dry_run || $RM conftest.c6535cat > conftest.c <<EOF6536int main() { return 0; }6537EOF6538$opt_dry_run || $RM conftest6539if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then6540ldd_output=`ldd conftest`6541for i in $deplibs; do6542case $i in6543-l*)6544func_stripname -l '' "$i"6545name=$func_stripname_result6546if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then6547case " $predeps $postdeps " in6548*" $i "*)6549newdeplibs="$newdeplibs $i"6550i=""6551;;6552esac6553fi6554if test -n "$i" ; then6555libname=`eval "\\$ECHO \"$libname_spec\""`6556deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`6557set dummy $deplib_matches; shift6558deplib_match=$16559if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then6560newdeplibs="$newdeplibs $i"6561else6562droppeddeps=yes6563$ECHO6564$ECHO "*** Warning: dynamic linker does not accept needed library $i."6565$ECHO "*** I have the capability to make that library automatically link in when"6566$ECHO "*** you link to this library. But I can only do this if you have a"6567$ECHO "*** shared version of the library, which I believe you do not have"6568$ECHO "*** because a test_compile did reveal that the linker did not use it for"6569$ECHO "*** its dynamic dependency list that programs get resolved with at runtime."6570fi6571fi6572;;6573*)6574newdeplibs="$newdeplibs $i"6575;;6576esac6577done6578else6579# Error occurred in the first compile. Let's try to salvage6580# the situation: Compile a separate program for each library.6581for i in $deplibs; do6582case $i in6583-l*)6584func_stripname -l '' "$i"6585name=$func_stripname_result6586$opt_dry_run || $RM conftest6587if $LTCC $LTCFLAGS -o conftest conftest.c $i; then6588ldd_output=`ldd conftest`6589if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then6590case " $predeps $postdeps " in6591*" $i "*)6592newdeplibs="$newdeplibs $i"6593i=""6594;;6595esac6596fi6597if test -n "$i" ; then6598libname=`eval "\\$ECHO \"$libname_spec\""`6599deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`6600set dummy $deplib_matches; shift6601deplib_match=$16602if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then6603newdeplibs="$newdeplibs $i"6604else6605droppeddeps=yes6606$ECHO6607$ECHO "*** Warning: dynamic linker does not accept needed library $i."6608$ECHO "*** I have the capability to make that library automatically link in when"6609$ECHO "*** you link to this library. But I can only do this if you have a"6610$ECHO "*** shared version of the library, which you do not appear to have"6611$ECHO "*** because a test_compile did reveal that the linker did not use this one"6612$ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."6613fi6614fi6615else6616droppeddeps=yes6617$ECHO6618$ECHO "*** Warning! Library $i is needed by this library but I was not able to"6619$ECHO "*** make it link in! You will probably need to install it or some"6620$ECHO "*** library that it depends on before this library will be fully"6621$ECHO "*** functional. Installing it before continuing would be even better."6622fi6623;;6624*)6625newdeplibs="$newdeplibs $i"6626;;6627esac6628done6629fi6630;;6631file_magic*)6632set dummy $deplibs_check_method; shift6633file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`6634for a_deplib in $deplibs; do6635case $a_deplib in6636-l*)6637func_stripname -l '' "$a_deplib"6638name=$func_stripname_result6639if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then6640case " $predeps $postdeps " in6641*" $a_deplib "*)6642newdeplibs="$newdeplibs $a_deplib"6643a_deplib=""6644;;6645esac6646fi6647if test -n "$a_deplib" ; then6648libname=`eval "\\$ECHO \"$libname_spec\""`6649for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do6650potential_libs=`ls $i/$libname[.-]* 2>/dev/null`6651for potent_lib in $potential_libs; do6652# Follow soft links.6653if ls -lLd "$potent_lib" 2>/dev/null |6654$GREP " -> " >/dev/null; then6655continue6656fi6657# The statement above tries to avoid entering an6658# endless loop below, in case of cyclic links.6659# We might still enter an endless loop, since a link6660# loop can be closed while we follow links,6661# but so what?6662potlib="$potent_lib"6663while test -h "$potlib" 2>/dev/null; do6664potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`6665case $potliblink in6666[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;6667*) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;6668esac6669done6670if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |6671$SED -e 10q |6672$EGREP "$file_magic_regex" > /dev/null; then6673newdeplibs="$newdeplibs $a_deplib"6674a_deplib=""6675break 26676fi6677done6678done6679fi6680if test -n "$a_deplib" ; then6681droppeddeps=yes6682$ECHO6683$ECHO "*** Warning: linker path does not have real file for library $a_deplib."6684$ECHO "*** I have the capability to make that library automatically link in when"6685$ECHO "*** you link to this library. But I can only do this if you have a"6686$ECHO "*** shared version of the library, which you do not appear to have"6687$ECHO "*** because I did check the linker path looking for a file starting"6688if test -z "$potlib" ; then6689$ECHO "*** with $libname but no candidates were found. (...for file magic test)"6690else6691$ECHO "*** with $libname and none of the candidates passed a file format test"6692$ECHO "*** using a file magic. Last file checked: $potlib"6693fi6694fi6695;;6696*)6697# Add a -L argument.6698newdeplibs="$newdeplibs $a_deplib"6699;;6700esac6701done # Gone through all deplibs.6702;;6703match_pattern*)6704set dummy $deplibs_check_method; shift6705match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`6706for a_deplib in $deplibs; do6707case $a_deplib in6708-l*)6709func_stripname -l '' "$a_deplib"6710name=$func_stripname_result6711if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then6712case " $predeps $postdeps " in6713*" $a_deplib "*)6714newdeplibs="$newdeplibs $a_deplib"6715a_deplib=""6716;;6717esac6718fi6719if test -n "$a_deplib" ; then6720libname=`eval "\\$ECHO \"$libname_spec\""`6721for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do6722potential_libs=`ls $i/$libname[.-]* 2>/dev/null`6723for potent_lib in $potential_libs; do6724potlib="$potent_lib" # see symlink-check above in file_magic test6725if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \6726$EGREP "$match_pattern_regex" > /dev/null; then6727newdeplibs="$newdeplibs $a_deplib"6728a_deplib=""6729break 26730fi6731done6732done6733fi6734if test -n "$a_deplib" ; then6735droppeddeps=yes6736$ECHO6737$ECHO "*** Warning: linker path does not have real file for library $a_deplib."6738$ECHO "*** I have the capability to make that library automatically link in when"6739$ECHO "*** you link to this library. But I can only do this if you have a"6740$ECHO "*** shared version of the library, which you do not appear to have"6741$ECHO "*** because I did check the linker path looking for a file starting"6742if test -z "$potlib" ; then6743$ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"6744else6745$ECHO "*** with $libname and none of the candidates passed a file format test"6746$ECHO "*** using a regex pattern. Last file checked: $potlib"6747fi6748fi6749;;6750*)6751# Add a -L argument.6752newdeplibs="$newdeplibs $a_deplib"6753;;6754esac6755done # Gone through all deplibs.6756;;6757none | unknown | *)6758newdeplibs=""6759tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \6760-e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`6761if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then6762for i in $predeps $postdeps ; do6763# can't use Xsed below, because $i might contain '/'6764tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`6765done6766fi6767if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' |6768$GREP . >/dev/null; then6769$ECHO6770if test "X$deplibs_check_method" = "Xnone"; then6771$ECHO "*** Warning: inter-library dependencies are not supported in this platform."6772else6773$ECHO "*** Warning: inter-library dependencies are not known to be supported."6774fi6775$ECHO "*** All declared inter-library dependencies are being dropped."6776droppeddeps=yes6777fi6778;;6779esac6780versuffix=$versuffix_save6781major=$major_save6782release=$release_save6783libname=$libname_save6784name=$name_save67856786case $host in6787*-*-rhapsody* | *-*-darwin1.[012])6788# On Rhapsody replace the C library with the System framework6789newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`6790;;6791esac67926793if test "$droppeddeps" = yes; then6794if test "$module" = yes; then6795$ECHO6796$ECHO "*** Warning: libtool could not satisfy all declared inter-library"6797$ECHO "*** dependencies of module $libname. Therefore, libtool will create"6798$ECHO "*** a static module, that should work as long as the dlopening"6799$ECHO "*** application is linked with the -dlopen flag."6800if test -z "$global_symbol_pipe"; then6801$ECHO6802$ECHO "*** However, this would only work if libtool was able to extract symbol"6803$ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"6804$ECHO "*** not find such a program. So, this module is probably useless."6805$ECHO "*** \`nm' from GNU binutils and a full rebuild may help."6806fi6807if test "$build_old_libs" = no; then6808oldlibs="$output_objdir/$libname.$libext"6809build_libtool_libs=module6810build_old_libs=yes6811else6812build_libtool_libs=no6813fi6814else6815$ECHO "*** The inter-library dependencies that have been dropped here will be"6816$ECHO "*** automatically added whenever a program is linked with this library"6817$ECHO "*** or is declared to -dlopen it."68186819if test "$allow_undefined" = no; then6820$ECHO6821$ECHO "*** Since this library must not contain undefined symbols,"6822$ECHO "*** because either the platform does not support them or"6823$ECHO "*** it was explicitly requested with -no-undefined,"6824$ECHO "*** libtool will only create a static version of it."6825if test "$build_old_libs" = no; then6826oldlibs="$output_objdir/$libname.$libext"6827build_libtool_libs=module6828build_old_libs=yes6829else6830build_libtool_libs=no6831fi6832fi6833fi6834fi6835# Done checking deplibs!6836deplibs=$newdeplibs6837fi6838# Time to change all our "foo.ltframework" stuff back to "-framework foo"6839case $host in6840*-*-darwin*)6841newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`6842new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`6843deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`6844;;6845esac68466847# move library search paths that coincide with paths to not yet6848# installed libraries to the beginning of the library search list6849new_libs=6850for path in $notinst_path; do6851case " $new_libs " in6852*" -L$path/$objdir "*) ;;6853*)6854case " $deplibs " in6855*" -L$path/$objdir "*)6856new_libs="$new_libs -L$path/$objdir" ;;6857esac6858;;6859esac6860done6861for deplib in $deplibs; do6862case $deplib in6863-L*)6864case " $new_libs " in6865*" $deplib "*) ;;6866*) new_libs="$new_libs $deplib" ;;6867esac6868;;6869*) new_libs="$new_libs $deplib" ;;6870esac6871done6872deplibs="$new_libs"68736874# All the library-specific variables (install_libdir is set above).6875library_names=6876old_library=6877dlname=68786879# Test again, we may have decided not to build it any more6880if test "$build_libtool_libs" = yes; then6881if test "$hardcode_into_libs" = yes; then6882# Hardcode the library paths6883hardcode_libdirs=6884dep_rpath=6885rpath="$finalize_rpath"6886test "$mode" != relink && rpath="$compile_rpath$rpath"6887for libdir in $rpath; do6888if test -n "$hardcode_libdir_flag_spec"; then6889if test -n "$hardcode_libdir_separator"; then6890if test -z "$hardcode_libdirs"; then6891hardcode_libdirs="$libdir"6892else6893# Just accumulate the unique libdirs.6894case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in6895*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)6896;;6897*)6898hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"6899;;6900esac6901fi6902else6903eval flag=\"$hardcode_libdir_flag_spec\"6904dep_rpath="$dep_rpath $flag"6905fi6906elif test -n "$runpath_var"; then6907case "$perm_rpath " in6908*" $libdir "*) ;;6909*) perm_rpath="$perm_rpath $libdir" ;;6910esac6911fi6912done6913# Substitute the hardcoded libdirs into the rpath.6914if test -n "$hardcode_libdir_separator" &&6915test -n "$hardcode_libdirs"; then6916libdir="$hardcode_libdirs"6917if test -n "$hardcode_libdir_flag_spec_ld"; then6918eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"6919else6920eval dep_rpath=\"$hardcode_libdir_flag_spec\"6921fi6922fi6923if test -n "$runpath_var" && test -n "$perm_rpath"; then6924# We should set the runpath_var.6925rpath=6926for dir in $perm_rpath; do6927rpath="$rpath$dir:"6928done6929eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"6930fi6931test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"6932fi69336934shlibpath="$finalize_shlibpath"6935test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"6936if test -n "$shlibpath"; then6937eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"6938fi69396940# Get the real and link names of the library.6941eval shared_ext=\"$shrext_cmds\"6942eval library_names=\"$library_names_spec\"6943set dummy $library_names6944shift6945realname="$1"6946shift69476948if test -n "$soname_spec"; then6949eval soname=\"$soname_spec\"6950else6951soname="$realname"6952fi6953if test -z "$dlname"; then6954dlname=$soname6955fi69566957lib="$output_objdir/$realname"6958linknames=6959for link6960do6961linknames="$linknames $link"6962done69636964# Use standard objects if they are pic6965test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`6966test "X$libobjs" = "X " && libobjs=69676968delfiles=6969if test -n "$export_symbols" && test -n "$include_expsyms"; then6970$opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"6971export_symbols="$output_objdir/$libname.uexp"6972delfiles="$delfiles $export_symbols"6973fi69746975orig_export_symbols=6976case $host_os in6977cygwin* | mingw* | cegcc*)6978if test -n "$export_symbols" && test -z "$export_symbols_regex"; then6979# exporting using user supplied symfile6980if test "x`$SED 1q $export_symbols`" != xEXPORTS; then6981# and it's NOT already a .def file. Must figure out6982# which of the given symbols are data symbols and tag6983# them as such. So, trigger use of export_symbols_cmds.6984# export_symbols gets reassigned inside the "prepare6985# the list of exported symbols" if statement, so the6986# include_expsyms logic still works.6987orig_export_symbols="$export_symbols"6988export_symbols=6989always_export_symbols=yes6990fi6991fi6992;;6993esac69946995# Prepare the list of exported symbols6996if test -z "$export_symbols"; then6997if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then6998func_verbose "generating symbol list for \`$libname.la'"6999export_symbols="$output_objdir/$libname.exp"7000$opt_dry_run || $RM $export_symbols7001cmds=$export_symbols_cmds7002save_ifs="$IFS"; IFS='~'7003for cmd in $cmds; do7004IFS="$save_ifs"7005eval cmd=\"$cmd\"7006func_len " $cmd"7007len=$func_len_result7008if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then7009func_show_eval "$cmd" 'exit $?'7010skipped_export=false7011else7012# The command line is too long to execute in one step.7013func_verbose "using reloadable object file for export list..."7014skipped_export=:7015# Break out early, otherwise skipped_export may be7016# set to false by a later but shorter cmd.7017break7018fi7019done7020IFS="$save_ifs"7021if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then7022func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'7023func_show_eval '$MV "${export_symbols}T" "$export_symbols"'7024fi7025fi7026fi70277028if test -n "$export_symbols" && test -n "$include_expsyms"; then7029tmp_export_symbols="$export_symbols"7030test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"7031$opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'7032fi70337034if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then7035# The given exports_symbols file has to be filtered, so filter it.7036func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"7037# FIXME: $output_objdir/$libname.filter potentially contains lots of7038# 's' commands which not all seds can handle. GNU sed should be fine7039# though. Also, the filter scales superlinearly with the number of7040# global variables. join(1) would be nice here, but unfortunately7041# isn't a blessed tool.7042$opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter7043delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"7044export_symbols=$output_objdir/$libname.def7045$opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols7046fi70477048tmp_deplibs=7049for test_deplib in $deplibs; do7050case " $convenience " in7051*" $test_deplib "*) ;;7052*)7053tmp_deplibs="$tmp_deplibs $test_deplib"7054;;7055esac7056done7057deplibs="$tmp_deplibs"70587059if test -n "$convenience"; then7060if test -n "$whole_archive_flag_spec" &&7061test "$compiler_needs_object" = yes &&7062test -z "$libobjs"; then7063# extract the archives, so we have objects to list.7064# TODO: could optimize this to just extract one archive.7065whole_archive_flag_spec=7066fi7067if test -n "$whole_archive_flag_spec"; then7068save_libobjs=$libobjs7069eval libobjs=\"\$libobjs $whole_archive_flag_spec\"7070test "X$libobjs" = "X " && libobjs=7071else7072gentop="$output_objdir/${outputname}x"7073generated="$generated $gentop"70747075func_extract_archives $gentop $convenience7076libobjs="$libobjs $func_extract_archives_result"7077test "X$libobjs" = "X " && libobjs=7078fi7079fi70807081if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then7082eval flag=\"$thread_safe_flag_spec\"7083linker_flags="$linker_flags $flag"7084fi70857086# Make a backup of the uninstalled library when relinking7087if test "$mode" = relink; then7088$opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?7089fi70907091# Do each of the archive commands.7092if test "$module" = yes && test -n "$module_cmds" ; then7093if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then7094eval test_cmds=\"$module_expsym_cmds\"7095cmds=$module_expsym_cmds7096else7097eval test_cmds=\"$module_cmds\"7098cmds=$module_cmds7099fi7100else7101if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then7102eval test_cmds=\"$archive_expsym_cmds\"7103cmds=$archive_expsym_cmds7104else7105eval test_cmds=\"$archive_cmds\"7106cmds=$archive_cmds7107fi7108fi71097110if test "X$skipped_export" != "X:" &&7111func_len " $test_cmds" &&7112len=$func_len_result &&7113test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then7114:7115else7116# The command line is too long to link in one step, link piecewise7117# or, if using GNU ld and skipped_export is not :, use a linker7118# script.71197120# Save the value of $output and $libobjs because we want to7121# use them later. If we have whole_archive_flag_spec, we7122# want to use save_libobjs as it was before7123# whole_archive_flag_spec was expanded, because we can't7124# assume the linker understands whole_archive_flag_spec.7125# This may have to be revisited, in case too many7126# convenience libraries get linked in and end up exceeding7127# the spec.7128if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then7129save_libobjs=$libobjs7130fi7131save_output=$output7132output_la=`$ECHO "X$output" | $Xsed -e "$basename"`71337134# Clear the reloadable object creation command queue and7135# initialize k to one.7136test_cmds=7137concat_cmds=7138objlist=7139last_robj=7140k=171417142if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then7143output=${output_objdir}/${output_la}.lnkscript7144func_verbose "creating GNU ld script: $output"7145$ECHO 'INPUT (' > $output7146for obj in $save_libobjs7147do7148$ECHO "$obj" >> $output7149done7150$ECHO ')' >> $output7151delfiles="$delfiles $output"7152elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then7153output=${output_objdir}/${output_la}.lnk7154func_verbose "creating linker input file list: $output"7155: > $output7156set x $save_libobjs7157shift7158firstobj=7159if test "$compiler_needs_object" = yes; then7160firstobj="$1 "7161shift7162fi7163for obj7164do7165$ECHO "$obj" >> $output7166done7167delfiles="$delfiles $output"7168output=$firstobj\"$file_list_spec$output\"7169else7170if test -n "$save_libobjs"; then7171func_verbose "creating reloadable object files..."7172output=$output_objdir/$output_la-${k}.$objext7173eval test_cmds=\"$reload_cmds\"7174func_len " $test_cmds"7175len0=$func_len_result7176len=$len071777178# Loop over the list of objects to be linked.7179for obj in $save_libobjs7180do7181func_len " $obj"7182func_arith $len + $func_len_result7183len=$func_arith_result7184if test "X$objlist" = X ||7185test "$len" -lt "$max_cmd_len"; then7186func_append objlist " $obj"7187else7188# The command $test_cmds is almost too long, add a7189# command to the queue.7190if test "$k" -eq 1 ; then7191# The first file doesn't have a previous command to add.7192eval concat_cmds=\"$reload_cmds $objlist $last_robj\"7193else7194# All subsequent reloadable object files will link in7195# the last one created.7196eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\"7197fi7198last_robj=$output_objdir/$output_la-${k}.$objext7199func_arith $k + 17200k=$func_arith_result7201output=$output_objdir/$output_la-${k}.$objext7202objlist=$obj7203func_len " $last_robj"7204func_arith $len0 + $func_len_result7205len=$func_arith_result7206fi7207done7208# Handle the remaining objects by creating one last7209# reloadable object file. All subsequent reloadable object7210# files will link in the last one created.7211test -z "$concat_cmds" || concat_cmds=$concat_cmds~7212eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"7213if test -n "$last_robj"; then7214eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"7215fi7216delfiles="$delfiles $output"72177218else7219output=7220fi72217222if ${skipped_export-false}; then7223func_verbose "generating symbol list for \`$libname.la'"7224export_symbols="$output_objdir/$libname.exp"7225$opt_dry_run || $RM $export_symbols7226libobjs=$output7227# Append the command to create the export file.7228test -z "$concat_cmds" || concat_cmds=$concat_cmds~7229eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"7230if test -n "$last_robj"; then7231eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"7232fi7233fi72347235test -n "$save_libobjs" &&7236func_verbose "creating a temporary reloadable object file: $output"72377238# Loop through the commands generated above and execute them.7239save_ifs="$IFS"; IFS='~'7240for cmd in $concat_cmds; do7241IFS="$save_ifs"7242$opt_silent || {7243func_quote_for_expand "$cmd"7244eval "func_echo $func_quote_for_expand_result"7245}7246$opt_dry_run || eval "$cmd" || {7247lt_exit=$?72487249# Restore the uninstalled library and exit7250if test "$mode" = relink; then7251( cd "$output_objdir" && \7252$RM "${realname}T" && \7253$MV "${realname}U" "$realname" )7254fi72557256exit $lt_exit7257}7258done7259IFS="$save_ifs"72607261if test -n "$export_symbols_regex" && ${skipped_export-false}; then7262func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'7263func_show_eval '$MV "${export_symbols}T" "$export_symbols"'7264fi7265fi72667267if ${skipped_export-false}; then7268if test -n "$export_symbols" && test -n "$include_expsyms"; then7269tmp_export_symbols="$export_symbols"7270test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"7271$opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'7272fi72737274if test -n "$orig_export_symbols"; then7275# The given exports_symbols file has to be filtered, so filter it.7276func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"7277# FIXME: $output_objdir/$libname.filter potentially contains lots of7278# 's' commands which not all seds can handle. GNU sed should be fine7279# though. Also, the filter scales superlinearly with the number of7280# global variables. join(1) would be nice here, but unfortunately7281# isn't a blessed tool.7282$opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter7283delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"7284export_symbols=$output_objdir/$libname.def7285$opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols7286fi7287fi72887289libobjs=$output7290# Restore the value of output.7291output=$save_output72927293if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then7294eval libobjs=\"\$libobjs $whole_archive_flag_spec\"7295test "X$libobjs" = "X " && libobjs=7296fi7297# Expand the library linking commands again to reset the7298# value of $libobjs for piecewise linking.72997300# Do each of the archive commands.7301if test "$module" = yes && test -n "$module_cmds" ; then7302if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then7303cmds=$module_expsym_cmds7304else7305cmds=$module_cmds7306fi7307else7308if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then7309cmds=$archive_expsym_cmds7310else7311cmds=$archive_cmds7312fi7313fi7314fi73157316if test -n "$delfiles"; then7317# Append the command to remove temporary files to $cmds.7318eval cmds=\"\$cmds~\$RM $delfiles\"7319fi73207321# Add any objects from preloaded convenience libraries7322if test -n "$dlprefiles"; then7323gentop="$output_objdir/${outputname}x"7324generated="$generated $gentop"73257326func_extract_archives $gentop $dlprefiles7327libobjs="$libobjs $func_extract_archives_result"7328test "X$libobjs" = "X " && libobjs=7329fi73307331save_ifs="$IFS"; IFS='~'7332for cmd in $cmds; do7333IFS="$save_ifs"7334eval cmd=\"$cmd\"7335$opt_silent || {7336func_quote_for_expand "$cmd"7337eval "func_echo $func_quote_for_expand_result"7338}7339$opt_dry_run || eval "$cmd" || {7340lt_exit=$?73417342# Restore the uninstalled library and exit7343if test "$mode" = relink; then7344( cd "$output_objdir" && \7345$RM "${realname}T" && \7346$MV "${realname}U" "$realname" )7347fi73487349exit $lt_exit7350}7351done7352IFS="$save_ifs"73537354# Restore the uninstalled library and exit7355if test "$mode" = relink; then7356$opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?73577358if test -n "$convenience"; then7359if test -z "$whole_archive_flag_spec"; then7360func_show_eval '${RM}r "$gentop"'7361fi7362fi73637364exit $EXIT_SUCCESS7365fi73667367# Create links to the real library.7368for linkname in $linknames; do7369if test "$realname" != "$linkname"; then7370func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'7371fi7372done73737374# If -module or -export-dynamic was specified, set the dlname.7375if test "$module" = yes || test "$export_dynamic" = yes; then7376# On all known operating systems, these are identical.7377dlname="$soname"7378fi7379fi7380;;73817382obj)7383if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then7384func_warning "\`-dlopen' is ignored for objects"7385fi73867387case " $deplibs" in7388*\ -l* | *\ -L*)7389func_warning "\`-l' and \`-L' are ignored for objects" ;;7390esac73917392test -n "$rpath" && \7393func_warning "\`-rpath' is ignored for objects"73947395test -n "$xrpath" && \7396func_warning "\`-R' is ignored for objects"73977398test -n "$vinfo" && \7399func_warning "\`-version-info' is ignored for objects"74007401test -n "$release" && \7402func_warning "\`-release' is ignored for objects"74037404case $output in7405*.lo)7406test -n "$objs$old_deplibs" && \7407func_fatal_error "cannot build library object \`$output' from non-libtool objects"74087409libobj=$output7410func_lo2o "$libobj"7411obj=$func_lo2o_result7412;;7413*)7414libobj=7415obj="$output"7416;;7417esac74187419# Delete the old objects.7420$opt_dry_run || $RM $obj $libobj74217422# Objects from convenience libraries. This assumes7423# single-version convenience libraries. Whenever we create7424# different ones for PIC/non-PIC, this we'll have to duplicate7425# the extraction.7426reload_conv_objs=7427gentop=7428# reload_cmds runs $LD directly, so let us get rid of7429# -Wl from whole_archive_flag_spec and hope we can get by with7430# turning comma into space..7431wl=74327433if test -n "$convenience"; then7434if test -n "$whole_archive_flag_spec"; then7435eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"7436reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`7437else7438gentop="$output_objdir/${obj}x"7439generated="$generated $gentop"74407441func_extract_archives $gentop $convenience7442reload_conv_objs="$reload_objs $func_extract_archives_result"7443fi7444fi74457446# Create the old-style object.7447reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test74487449output="$obj"7450func_execute_cmds "$reload_cmds" 'exit $?'74517452# Exit if we aren't doing a library object file.7453if test -z "$libobj"; then7454if test -n "$gentop"; then7455func_show_eval '${RM}r "$gentop"'7456fi74577458exit $EXIT_SUCCESS7459fi74607461if test "$build_libtool_libs" != yes; then7462if test -n "$gentop"; then7463func_show_eval '${RM}r "$gentop"'7464fi74657466# Create an invalid libtool object if no PIC, so that we don't7467# accidentally link it into a program.7468# $show "echo timestamp > $libobj"7469# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?7470exit $EXIT_SUCCESS7471fi74727473if test -n "$pic_flag" || test "$pic_mode" != default; then7474# Only do commands if we really have different PIC objects.7475reload_objs="$libobjs $reload_conv_objs"7476output="$libobj"7477func_execute_cmds "$reload_cmds" 'exit $?'7478fi74797480if test -n "$gentop"; then7481func_show_eval '${RM}r "$gentop"'7482fi74837484exit $EXIT_SUCCESS7485;;74867487prog)7488case $host in7489*cygwin*) func_stripname '' '.exe' "$output"7490output=$func_stripname_result.exe;;7491esac7492test -n "$vinfo" && \7493func_warning "\`-version-info' is ignored for programs"74947495test -n "$release" && \7496func_warning "\`-release' is ignored for programs"74977498test "$preload" = yes \7499&& test "$dlopen_support" = unknown \7500&& test "$dlopen_self" = unknown \7501&& test "$dlopen_self_static" = unknown && \7502func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."75037504case $host in7505*-*-rhapsody* | *-*-darwin1.[012])7506# On Rhapsody replace the C library is the System framework7507compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`7508finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`7509;;7510esac75117512case $host in7513*-*-darwin*)7514# Don't allow lazy linking, it breaks C++ global constructors7515# But is supposedly fixed on 10.4 or later (yay!).7516if test "$tagname" = CXX ; then7517case ${MACOSX_DEPLOYMENT_TARGET-10.0} in751810.[0123])7519compile_command="$compile_command ${wl}-bind_at_load"7520finalize_command="$finalize_command ${wl}-bind_at_load"7521;;7522esac7523fi7524# Time to change all our "foo.ltframework" stuff back to "-framework foo"7525compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`7526finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`7527;;7528esac752975307531# move library search paths that coincide with paths to not yet7532# installed libraries to the beginning of the library search list7533new_libs=7534for path in $notinst_path; do7535case " $new_libs " in7536*" -L$path/$objdir "*) ;;7537*)7538case " $compile_deplibs " in7539*" -L$path/$objdir "*)7540new_libs="$new_libs -L$path/$objdir" ;;7541esac7542;;7543esac7544done7545for deplib in $compile_deplibs; do7546case $deplib in7547-L*)7548case " $new_libs " in7549*" $deplib "*) ;;7550*) new_libs="$new_libs $deplib" ;;7551esac7552;;7553*) new_libs="$new_libs $deplib" ;;7554esac7555done7556compile_deplibs="$new_libs"755775587559compile_command="$compile_command $compile_deplibs"7560finalize_command="$finalize_command $finalize_deplibs"75617562if test -n "$rpath$xrpath"; then7563# If the user specified any rpath flags, then add them.7564for libdir in $rpath $xrpath; do7565# This is the magic to use -rpath.7566case "$finalize_rpath " in7567*" $libdir "*) ;;7568*) finalize_rpath="$finalize_rpath $libdir" ;;7569esac7570done7571fi75727573# Now hardcode the library paths7574rpath=7575hardcode_libdirs=7576for libdir in $compile_rpath $finalize_rpath; do7577if test -n "$hardcode_libdir_flag_spec"; then7578if test -n "$hardcode_libdir_separator"; then7579if test -z "$hardcode_libdirs"; then7580hardcode_libdirs="$libdir"7581else7582# Just accumulate the unique libdirs.7583case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in7584*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)7585;;7586*)7587hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"7588;;7589esac7590fi7591else7592eval flag=\"$hardcode_libdir_flag_spec\"7593rpath="$rpath $flag"7594fi7595elif test -n "$runpath_var"; then7596case "$perm_rpath " in7597*" $libdir "*) ;;7598*) perm_rpath="$perm_rpath $libdir" ;;7599esac7600fi7601case $host in7602*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)7603testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`7604case :$dllsearchpath: in7605*":$libdir:"*) ;;7606::) dllsearchpath=$libdir;;7607*) dllsearchpath="$dllsearchpath:$libdir";;7608esac7609case :$dllsearchpath: in7610*":$testbindir:"*) ;;7611::) dllsearchpath=$testbindir;;7612*) dllsearchpath="$dllsearchpath:$testbindir";;7613esac7614;;7615esac7616done7617# Substitute the hardcoded libdirs into the rpath.7618if test -n "$hardcode_libdir_separator" &&7619test -n "$hardcode_libdirs"; then7620libdir="$hardcode_libdirs"7621eval rpath=\" $hardcode_libdir_flag_spec\"7622fi7623compile_rpath="$rpath"76247625rpath=7626hardcode_libdirs=7627for libdir in $finalize_rpath; do7628if test -n "$hardcode_libdir_flag_spec"; then7629if test -n "$hardcode_libdir_separator"; then7630if test -z "$hardcode_libdirs"; then7631hardcode_libdirs="$libdir"7632else7633# Just accumulate the unique libdirs.7634case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in7635*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)7636;;7637*)7638hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"7639;;7640esac7641fi7642else7643eval flag=\"$hardcode_libdir_flag_spec\"7644rpath="$rpath $flag"7645fi7646elif test -n "$runpath_var"; then7647case "$finalize_perm_rpath " in7648*" $libdir "*) ;;7649*) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;7650esac7651fi7652done7653# Substitute the hardcoded libdirs into the rpath.7654if test -n "$hardcode_libdir_separator" &&7655test -n "$hardcode_libdirs"; then7656libdir="$hardcode_libdirs"7657eval rpath=\" $hardcode_libdir_flag_spec\"7658fi7659finalize_rpath="$rpath"76607661if test -n "$libobjs" && test "$build_old_libs" = yes; then7662# Transform all the library objects into standard objects.7663compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`7664finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`7665fi76667667func_generate_dlsyms "$outputname" "@PROGRAM@" "no"76687669# template prelinking step7670if test -n "$prelink_cmds"; then7671func_execute_cmds "$prelink_cmds" 'exit $?'7672fi76737674wrappers_required=yes7675case $host in7676*cygwin* | *mingw* )7677if test "$build_libtool_libs" != yes; then7678wrappers_required=no7679fi7680;;7681*cegcc)7682# Disable wrappers for cegcc, we are cross compiling anyway.7683wrappers_required=no7684;;7685*)7686if test "$need_relink" = no || test "$build_libtool_libs" != yes; then7687wrappers_required=no7688fi7689;;7690esac7691if test "$wrappers_required" = no; then7692# Replace the output file specification.7693compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`7694link_command="$compile_command$compile_rpath"76957696# We have no uninstalled library dependencies, so finalize right now.7697exit_status=07698func_show_eval "$link_command" 'exit_status=$?'76997700# Delete the generated files.7701if test -f "$output_objdir/${outputname}S.${objext}"; then7702func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'7703fi77047705exit $exit_status7706fi77077708if test -n "$compile_shlibpath$finalize_shlibpath"; then7709compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"7710fi7711if test -n "$finalize_shlibpath"; then7712finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"7713fi77147715compile_var=7716finalize_var=7717if test -n "$runpath_var"; then7718if test -n "$perm_rpath"; then7719# We should set the runpath_var.7720rpath=7721for dir in $perm_rpath; do7722rpath="$rpath$dir:"7723done7724compile_var="$runpath_var=\"$rpath\$$runpath_var\" "7725fi7726if test -n "$finalize_perm_rpath"; then7727# We should set the runpath_var.7728rpath=7729for dir in $finalize_perm_rpath; do7730rpath="$rpath$dir:"7731done7732finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "7733fi7734fi77357736if test "$no_install" = yes; then7737# We don't need to create a wrapper script.7738link_command="$compile_var$compile_command$compile_rpath"7739# Replace the output file specification.7740link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`7741# Delete the old output file.7742$opt_dry_run || $RM $output7743# Link the executable and exit7744func_show_eval "$link_command" 'exit $?'7745exit $EXIT_SUCCESS7746fi77477748if test "$hardcode_action" = relink; then7749# Fast installation is not supported7750link_command="$compile_var$compile_command$compile_rpath"7751relink_command="$finalize_var$finalize_command$finalize_rpath"77527753func_warning "this platform does not like uninstalled shared libraries"7754func_warning "\`$output' will be relinked during installation"7755else7756if test "$fast_install" != no; then7757link_command="$finalize_var$compile_command$finalize_rpath"7758if test "$fast_install" = yes; then7759relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`7760else7761# fast_install is set to needless7762relink_command=7763fi7764else7765link_command="$compile_var$compile_command$compile_rpath"7766relink_command="$finalize_var$finalize_command$finalize_rpath"7767fi7768fi77697770# Replace the output file specification.7771link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`77727773# Delete the old output files.7774$opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname77757776func_show_eval "$link_command" 'exit $?'77777778# Now create the wrapper script.7779func_verbose "creating $output"77807781# Quote the relink command for shipping.7782if test -n "$relink_command"; then7783# Preserve any variables that may affect compiler behavior7784for var in $variables_saved_for_relink; do7785if eval test -z \"\${$var+set}\"; then7786relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"7787elif eval var_value=\$$var; test -z "$var_value"; then7788relink_command="$var=; export $var; $relink_command"7789else7790func_quote_for_eval "$var_value"7791relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"7792fi7793done7794relink_command="(cd `pwd`; $relink_command)"7795relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`7796fi77977798# Quote $ECHO for shipping.7799if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then7800case $progpath in7801[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;7802*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;7803esac7804qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`7805else7806qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`7807fi78087809# Only actually do things if not in dry run mode.7810$opt_dry_run || {7811# win32 will think the script is a binary if it has7812# a .exe suffix, so we strip it off here.7813case $output in7814*.exe) func_stripname '' '.exe' "$output"7815output=$func_stripname_result ;;7816esac7817# test for cygwin because mv fails w/o .exe extensions7818case $host in7819*cygwin*)7820exeext=.exe7821func_stripname '' '.exe' "$outputname"7822outputname=$func_stripname_result ;;7823*) exeext= ;;7824esac7825case $host in7826*cygwin* | *mingw* )7827func_dirname_and_basename "$output" "" "."7828output_name=$func_basename_result7829output_path=$func_dirname_result7830cwrappersource="$output_path/$objdir/lt-$output_name.c"7831cwrapper="$output_path/$output_name.exe"7832$RM $cwrappersource $cwrapper7833trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 1578347835func_emit_cwrapperexe_src > $cwrappersource78367837# The wrapper executable is built using the $host compiler,7838# because it contains $host paths and files. If cross-7839# compiling, it, like the target executable, must be7840# executed on the $host or under an emulation environment.7841$opt_dry_run || {7842$LTCC $LTCFLAGS -o $cwrapper $cwrappersource7843$STRIP $cwrapper7844}78457846# Now, create the wrapper script for func_source use:7847func_ltwrapper_scriptname $cwrapper7848$RM $func_ltwrapper_scriptname_result7849trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 157850$opt_dry_run || {7851# note: this script will not be executed, so do not chmod.7852if test "x$build" = "x$host" ; then7853$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result7854else7855func_emit_wrapper no > $func_ltwrapper_scriptname_result7856fi7857}7858;;7859* )7860$RM $output7861trap "$RM $output; exit $EXIT_FAILURE" 1 2 1578627863func_emit_wrapper no > $output7864chmod +x $output7865;;7866esac7867}7868exit $EXIT_SUCCESS7869;;7870esac78717872# See if we need to build an old-fashioned archive.7873for oldlib in $oldlibs; do78747875if test "$build_libtool_libs" = convenience; then7876oldobjs="$libobjs_save $symfileobj"7877addlibs="$convenience"7878build_libtool_libs=no7879else7880if test "$build_libtool_libs" = module; then7881oldobjs="$libobjs_save"7882build_libtool_libs=no7883else7884oldobjs="$old_deplibs $non_pic_objects"7885if test "$preload" = yes && test -f "$symfileobj"; then7886oldobjs="$oldobjs $symfileobj"7887fi7888fi7889addlibs="$old_convenience"7890fi78917892if test -n "$addlibs"; then7893gentop="$output_objdir/${outputname}x"7894generated="$generated $gentop"78957896func_extract_archives $gentop $addlibs7897oldobjs="$oldobjs $func_extract_archives_result"7898fi78997900# Do each command in the archive commands.7901if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then7902cmds=$old_archive_from_new_cmds7903else79047905# Add any objects from preloaded convenience libraries7906if test -n "$dlprefiles"; then7907gentop="$output_objdir/${outputname}x"7908generated="$generated $gentop"79097910func_extract_archives $gentop $dlprefiles7911oldobjs="$oldobjs $func_extract_archives_result"7912fi79137914# POSIX demands no paths to be encoded in archives. We have7915# to avoid creating archives with duplicate basenames if we7916# might have to extract them afterwards, e.g., when creating a7917# static archive out of a convenience library, or when linking7918# the entirety of a libtool archive into another (currently7919# not supported by libtool).7920if (for obj in $oldobjs7921do7922func_basename "$obj"7923$ECHO "$func_basename_result"7924done | sort | sort -uc >/dev/null 2>&1); then7925:7926else7927$ECHO "copying selected object files to avoid basename conflicts..."7928gentop="$output_objdir/${outputname}x"7929generated="$generated $gentop"7930func_mkdir_p "$gentop"7931save_oldobjs=$oldobjs7932oldobjs=7933counter=17934for obj in $save_oldobjs7935do7936func_basename "$obj"7937objbase="$func_basename_result"7938case " $oldobjs " in7939" ") oldobjs=$obj ;;7940*[\ /]"$objbase "*)7941while :; do7942# Make sure we don't pick an alternate name that also7943# overlaps.7944newobj=lt$counter-$objbase7945func_arith $counter + 17946counter=$func_arith_result7947case " $oldobjs " in7948*[\ /]"$newobj "*) ;;7949*) if test ! -f "$gentop/$newobj"; then break; fi ;;7950esac7951done7952func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"7953oldobjs="$oldobjs $gentop/$newobj"7954;;7955*) oldobjs="$oldobjs $obj" ;;7956esac7957done7958fi7959eval cmds=\"$old_archive_cmds\"79607961func_len " $cmds"7962len=$func_len_result7963if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then7964cmds=$old_archive_cmds7965else7966# the command line is too long to link in one step, link in parts7967func_verbose "using piecewise archive linking..."7968save_RANLIB=$RANLIB7969RANLIB=:7970objlist=7971concat_cmds=7972save_oldobjs=$oldobjs7973oldobjs=7974# Is there a better way of finding the last object in the list?7975for obj in $save_oldobjs7976do7977last_oldobj=$obj7978done7979eval test_cmds=\"$old_archive_cmds\"7980func_len " $test_cmds"7981len0=$func_len_result7982len=$len07983for obj in $save_oldobjs7984do7985func_len " $obj"7986func_arith $len + $func_len_result7987len=$func_arith_result7988func_append objlist " $obj"7989if test "$len" -lt "$max_cmd_len"; then7990:7991else7992# the above command should be used before it gets too long7993oldobjs=$objlist7994if test "$obj" = "$last_oldobj" ; then7995RANLIB=$save_RANLIB7996fi7997test -z "$concat_cmds" || concat_cmds=$concat_cmds~7998eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"7999objlist=8000len=$len08001fi8002done8003RANLIB=$save_RANLIB8004oldobjs=$objlist8005if test "X$oldobjs" = "X" ; then8006eval cmds=\"\$concat_cmds\"8007else8008eval cmds=\"\$concat_cmds~\$old_archive_cmds\"8009fi8010fi8011fi8012func_execute_cmds "$cmds" 'exit $?'8013done80148015test -n "$generated" && \8016func_show_eval "${RM}r$generated"80178018# Now create the libtool archive.8019case $output in8020*.la)8021old_library=8022test "$build_old_libs" = yes && old_library="$libname.$libext"8023func_verbose "creating $output"80248025# Preserve any variables that may affect compiler behavior8026for var in $variables_saved_for_relink; do8027if eval test -z \"\${$var+set}\"; then8028relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"8029elif eval var_value=\$$var; test -z "$var_value"; then8030relink_command="$var=; export $var; $relink_command"8031else8032func_quote_for_eval "$var_value"8033relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"8034fi8035done8036# Quote the link command for shipping.8037relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"8038relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`8039if test "$hardcode_automatic" = yes ; then8040relink_command=8041fi80428043# Only create the output if not a dry run.8044$opt_dry_run || {8045for installed in no yes; do8046if test "$installed" = yes; then8047if test -z "$install_libdir"; then8048break8049fi8050output="$output_objdir/$outputname"i8051# Replace all uninstalled libtool libraries with the installed ones8052newdependency_libs=8053for deplib in $dependency_libs; do8054case $deplib in8055*.la)8056func_basename "$deplib"8057name="$func_basename_result"8058eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`8059test -z "$libdir" && \8060func_fatal_error "\`$deplib' is not a valid libtool archive"8061newdependency_libs="$newdependency_libs $libdir/$name"8062;;8063*) newdependency_libs="$newdependency_libs $deplib" ;;8064esac8065done8066dependency_libs="$newdependency_libs"8067newdlfiles=80688069for lib in $dlfiles; do8070case $lib in8071*.la)8072func_basename "$lib"8073name="$func_basename_result"8074eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`8075test -z "$libdir" && \8076func_fatal_error "\`$lib' is not a valid libtool archive"8077newdlfiles="$newdlfiles $libdir/$name"8078;;8079*) newdlfiles="$newdlfiles $lib" ;;8080esac8081done8082dlfiles="$newdlfiles"8083newdlprefiles=8084for lib in $dlprefiles; do8085case $lib in8086*.la)8087# Only pass preopened files to the pseudo-archive (for8088# eventual linking with the app. that links it) if we8089# didn't already link the preopened objects directly into8090# the library:8091func_basename "$lib"8092name="$func_basename_result"8093eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`8094test -z "$libdir" && \8095func_fatal_error "\`$lib' is not a valid libtool archive"8096newdlprefiles="$newdlprefiles $libdir/$name"8097;;8098esac8099done8100dlprefiles="$newdlprefiles"8101else8102newdlfiles=8103for lib in $dlfiles; do8104case $lib in8105[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;8106*) abs=`pwd`"/$lib" ;;8107esac8108newdlfiles="$newdlfiles $abs"8109done8110dlfiles="$newdlfiles"8111newdlprefiles=8112for lib in $dlprefiles; do8113case $lib in8114[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;8115*) abs=`pwd`"/$lib" ;;8116esac8117newdlprefiles="$newdlprefiles $abs"8118done8119dlprefiles="$newdlprefiles"8120fi8121$RM $output8122# place dlname in correct position for cygwin8123tdlname=$dlname8124case $host,$output,$installed,$module,$dlname in8125*cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;8126esac8127$ECHO > $output "\8128# $outputname - a libtool library file8129# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION8130#8131# Please DO NOT delete this file!8132# It is necessary for linking the library.81338134# The name that we can dlopen(3).8135dlname='$tdlname'81368137# Names of this library.8138library_names='$library_names'81398140# The name of the static archive.8141old_library='$old_library'81428143# Linker flags that can not go in dependency_libs.8144inherited_linker_flags='$new_inherited_linker_flags'81458146# Libraries that this one depends upon.8147dependency_libs='$dependency_libs'81488149# Names of additional weak libraries provided by this library8150weak_library_names='$weak_libs'81518152# Version information for $libname.8153current=$current8154age=$age8155revision=$revision81568157# Is this an already installed library?8158installed=$installed81598160# Should we warn about portability when linking against -modules?8161shouldnotlink=$module81628163# Files to dlopen/dlpreopen8164dlopen='$dlfiles'8165dlpreopen='$dlprefiles'81668167# Directory that this library needs to be installed in:8168libdir='$install_libdir'"8169if test "$installed" = no && test "$need_relink" = yes; then8170$ECHO >> $output "\8171relink_command=\"$relink_command\""8172fi8173done8174}81758176# Do a symbolic link so that the libtool archive can be found in8177# LD_LIBRARY_PATH before the program is installed.8178func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'8179;;8180esac8181exit $EXIT_SUCCESS8182}81838184{ test "$mode" = link || test "$mode" = relink; } &&8185func_mode_link ${1+"$@"}818681878188# func_mode_uninstall arg...8189func_mode_uninstall ()8190{8191$opt_debug8192RM="$nonopt"8193files=8194rmforce=8195exit_status=081968197# This variable tells wrapper scripts just to set variables rather8198# than running their programs.8199libtool_install_magic="$magic"82008201for arg8202do8203case $arg in8204-f) RM="$RM $arg"; rmforce=yes ;;8205-*) RM="$RM $arg" ;;8206*) files="$files $arg" ;;8207esac8208done82098210test -z "$RM" && \8211func_fatal_help "you must specify an RM program"82128213rmdirs=82148215origobjdir="$objdir"8216for file in $files; do8217func_dirname "$file" "" "."8218dir="$func_dirname_result"8219if test "X$dir" = X.; then8220objdir="$origobjdir"8221else8222objdir="$dir/$origobjdir"8223fi8224func_basename "$file"8225name="$func_basename_result"8226test "$mode" = uninstall && objdir="$dir"82278228# Remember objdir for removal later, being careful to avoid duplicates8229if test "$mode" = clean; then8230case " $rmdirs " in8231*" $objdir "*) ;;8232*) rmdirs="$rmdirs $objdir" ;;8233esac8234fi82358236# Don't error if the file doesn't exist and rm -f was used.8237if { test -L "$file"; } >/dev/null 2>&1 ||8238{ test -h "$file"; } >/dev/null 2>&1 ||8239test -f "$file"; then8240:8241elif test -d "$file"; then8242exit_status=18243continue8244elif test "$rmforce" = yes; then8245continue8246fi82478248rmfiles="$file"82498250case $name in8251*.la)8252# Possibly a libtool archive, so verify it.8253if func_lalib_p "$file"; then8254func_source $dir/$name82558256# Delete the libtool libraries and symlinks.8257for n in $library_names; do8258rmfiles="$rmfiles $objdir/$n"8259done8260test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"82618262case "$mode" in8263clean)8264case " $library_names " in8265# " " in the beginning catches empty $dlname8266*" $dlname "*) ;;8267*) rmfiles="$rmfiles $objdir/$dlname" ;;8268esac8269test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"8270;;8271uninstall)8272if test -n "$library_names"; then8273# Do each command in the postuninstall commands.8274func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'8275fi82768277if test -n "$old_library"; then8278# Do each command in the old_postuninstall commands.8279func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'8280fi8281# FIXME: should reinstall the best remaining shared library.8282;;8283esac8284fi8285;;82868287*.lo)8288# Possibly a libtool object, so verify it.8289if func_lalib_p "$file"; then82908291# Read the .lo file8292func_source $dir/$name82938294# Add PIC object to the list of files to remove.8295if test -n "$pic_object" &&8296test "$pic_object" != none; then8297rmfiles="$rmfiles $dir/$pic_object"8298fi82998300# Add non-PIC object to the list of files to remove.8301if test -n "$non_pic_object" &&8302test "$non_pic_object" != none; then8303rmfiles="$rmfiles $dir/$non_pic_object"8304fi8305fi8306;;83078308*)8309if test "$mode" = clean ; then8310noexename=$name8311case $file in8312*.exe)8313func_stripname '' '.exe' "$file"8314file=$func_stripname_result8315func_stripname '' '.exe' "$name"8316noexename=$func_stripname_result8317# $file with .exe has already been added to rmfiles,8318# add $file without .exe8319rmfiles="$rmfiles $file"8320;;8321esac8322# Do a test to see if this is a libtool program.8323if func_ltwrapper_p "$file"; then8324if func_ltwrapper_executable_p "$file"; then8325func_ltwrapper_scriptname "$file"8326relink_command=8327func_source $func_ltwrapper_scriptname_result8328rmfiles="$rmfiles $func_ltwrapper_scriptname_result"8329else8330relink_command=8331func_source $dir/$noexename8332fi83338334# note $name still contains .exe if it was in $file originally8335# as does the version of $file that was added into $rmfiles8336rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"8337if test "$fast_install" = yes && test -n "$relink_command"; then8338rmfiles="$rmfiles $objdir/lt-$name"8339fi8340if test "X$noexename" != "X$name" ; then8341rmfiles="$rmfiles $objdir/lt-${noexename}.c"8342fi8343fi8344fi8345;;8346esac8347func_show_eval "$RM $rmfiles" 'exit_status=1'8348done8349objdir="$origobjdir"83508351# Try to remove the ${objdir}s in the directories where we deleted files8352for dir in $rmdirs; do8353if test -d "$dir"; then8354func_show_eval "rmdir $dir >/dev/null 2>&1"8355fi8356done83578358exit $exit_status8359}83608361{ test "$mode" = uninstall || test "$mode" = clean; } &&8362func_mode_uninstall ${1+"$@"}83638364test -z "$mode" && {8365help="$generic_help"8366func_fatal_help "you must specify a MODE"8367}83688369test -z "$exec_cmd" && \8370func_fatal_help "invalid operation mode \`$mode'"83718372if test -n "$exec_cmd"; then8373eval exec "$exec_cmd"8374exit $EXIT_FAILURE8375fi83768377exit $exit_status837883798380# The TAGs below are defined such that we never get into a situation8381# in which we disable both kinds of libraries. Given conflicting8382# choices, we go for a static library, that is the most portable,8383# since we can't tell whether shared libraries were disabled because8384# the user asked for that or because the platform doesn't support8385# them. This is particularly important on AIX, because we don't8386# support having both static and shared libraries enabled at the same8387# time on that platform, so we default to a shared-only configuration.8388# If a disable-shared tag is given, we'll fallback to a static-only8389# configuration. But we'll never go from static-only to shared-only.83908391# ### BEGIN LIBTOOL TAG CONFIG: disable-shared8392build_libtool_libs=no8393build_old_libs=yes8394# ### END LIBTOOL TAG CONFIG: disable-shared83958396# ### BEGIN LIBTOOL TAG CONFIG: disable-static8397build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`8398# ### END LIBTOOL TAG CONFIG: disable-static83998400# Local Variables:8401# mode:shell-script8402# sh-indentation:28403# End:8404# vi:sw=28405840684078408