You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
9655 lines
277 KiB
9655 lines
277 KiB
|
|
# libtool (GNU libtool) 2.4.2
|
|
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
|
|
|
|
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
|
|
# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
|
|
# This is free software; see the source for copying conditions. There is NO
|
|
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
# GNU Libtool is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# As a special exception to the GNU General Public License,
|
|
# if you distribute this file as part of a program or library that
|
|
# is built using GNU Libtool, you may include this file under the
|
|
# same distribution terms that you use for the rest of that program.
|
|
#
|
|
# GNU Libtool is distributed in the hope that it will be useful, but
|
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
# General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with GNU Libtool; see the file COPYING. If not, a copy
|
|
# can be downloaded from http://www.gnu.org/licenses/gpl.html,
|
|
# or obtained by writing to the Free Software Foundation, Inc.,
|
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
# Usage: $progname [OPTION]... [MODE-ARG]...
|
|
#
|
|
# Provide generalized library-building support services.
|
|
#
|
|
# --config show all configuration variables
|
|
# --debug enable verbose shell tracing
|
|
# -n, --dry-run display commands without modifying any files
|
|
# --features display basic configuration information and exit
|
|
# --mode=MODE use operation mode MODE
|
|
# --preserve-dup-deps don't remove duplicate dependency libraries
|
|
# --quiet, --silent don't print informational messages
|
|
# --no-quiet, --no-silent
|
|
# print informational messages (default)
|
|
# --no-warn don't display warning messages
|
|
# --tag=TAG use configuration variables from tag TAG
|
|
# -v, --verbose print more informational messages than default
|
|
# --no-verbose don't print the extra informational messages
|
|
# --version print version information
|
|
# -h, --help, --help-all print short, long, or detailed help message
|
|
#
|
|
# MODE must be one of the following:
|
|
#
|
|
# clean remove files from the build directory
|
|
# compile compile a source file into a libtool object
|
|
# execute automatically set library path, then run a program
|
|
# finish complete the installation of libtool libraries
|
|
# install install libraries or executables
|
|
# link create a library or an executable
|
|
# uninstall remove libraries from an installed directory
|
|
#
|
|
# MODE-ARGS vary depending on the MODE. When passed as first option,
|
|
# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
|
|
# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
|
|
#
|
|
# When reporting a bug, please describe a test case to reproduce it and
|
|
# include the following information:
|
|
#
|
|
# host-triplet: $host
|
|
# shell: $SHELL
|
|
# compiler: $LTCC
|
|
# compiler flags: $LTCFLAGS
|
|
# linker: $LD (gnu? $with_gnu_ld)
|
|
# $progname: (GNU libtool) 2.4.2
|
|
# automake: $automake_version
|
|
# autoconf: $autoconf_version
|
|
#
|
|
# Report bugs to <bug-libtool@gnu.org>.
|
|
# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
|
|
# General help using GNU software: <http://www.gnu.org/gethelp/>.
|
|
|
|
PROGRAM=libtool
|
|
PACKAGE=libtool
|
|
VERSION=2.4.2
|
|
TIMESTAMP=""
|
|
package_revision=1.3337
|
|
|
|
# Be Bourne compatible
|
|
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
|
|
emulate sh
|
|
NULLCMD=:
|
|
# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
|
|
# is contrary to our usage. Disable this feature.
|
|
alias -g '${1+"$@"}'='"$@"'
|
|
setopt NO_GLOB_SUBST
|
|
else
|
|
case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
|
|
fi
|
|
BIN_SH=xpg4; export BIN_SH # for Tru64
|
|
DUALCASE=1; export DUALCASE # for MKS sh
|
|
|
|
# A function that is used when there is no print builtin or printf.
|
|
func_fallback_echo ()
|
|
{
|
|
eval 'cat <<_LTECHO_EOF
|
|
$1
|
|
_LTECHO_EOF'
|
|
}
|
|
|
|
# NLS nuisances: We save the old values to restore during execute mode.
|
|
lt_user_locale=
|
|
lt_safe_locale=
|
|
for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
|
|
do
|
|
eval "if test \"\${$lt_var+set}\" = set; then
|
|
save_$lt_var=\$$lt_var
|
|
$lt_var=C
|
|
export $lt_var
|
|
lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
|
|
lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
|
|
fi"
|
|
done
|
|
LC_ALL=C
|
|
LANGUAGE=C
|
|
export LANGUAGE LC_ALL
|
|
|
|
$lt_unset CDPATH
|
|
|
|
|
|
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
|
|
# is ksh but when the shell is invoked as "sh" and the current value of
|
|
# the _XPG environment variable is not equal to 1 (one), the special
|
|
# positional parameter $0, within a function call, is the name of the
|
|
# function.
|
|
progpath="$0"
|
|
|
|
|
|
|
|
: ${CP="cp -f"}
|
|
test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
|
|
: ${MAKE="make"}
|
|
: ${MKDIR="mkdir"}
|
|
: ${MV="mv -f"}
|
|
: ${RM="rm -f"}
|
|
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
|
|
: ${Xsed="$SED -e 1s/^X//"}
|
|
|
|
# Global variables:
|
|
EXIT_SUCCESS=0
|
|
EXIT_FAILURE=1
|
|
EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
|
|
EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
|
|
|
|
exit_status=$EXIT_SUCCESS
|
|
|
|
# Make sure IFS has a sensible default
|
|
lt_nl='
|
|
'
|
|
IFS=" $lt_nl"
|
|
|
|
dirname="s,/[^/]*$,,"
|
|
basename="s,^.*/,,"
|
|
|
|
# func_dirname file append nondir_replacement
|
|
# Compute the dirname of FILE. If nonempty, add APPEND to the result,
|
|
# otherwise set result to NONDIR_REPLACEMENT.
|
|
func_dirname ()
|
|
{
|
|
func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
|
|
if test "X$func_dirname_result" = "X${1}"; then
|
|
func_dirname_result="${3}"
|
|
else
|
|
func_dirname_result="$func_dirname_result${2}"
|
|
fi
|
|
} # func_dirname may be replaced by extended shell implementation
|
|
|
|
|
|
# func_basename file
|
|
func_basename ()
|
|
{
|
|
func_basename_result=`$ECHO "${1}" | $SED "$basename"`
|
|
} # func_basename may be replaced by extended shell implementation
|
|
|
|
|
|
# func_dirname_and_basename file append nondir_replacement
|
|
# perform func_basename and func_dirname in a single function
|
|
# call:
|
|
# dirname: Compute the dirname of FILE. If nonempty,
|
|
# add APPEND to the result, otherwise set result
|
|
# to NONDIR_REPLACEMENT.
|
|
# value returned in "$func_dirname_result"
|
|
# basename: Compute filename of FILE.
|
|
# value retuned in "$func_basename_result"
|
|
# Implementation must be kept synchronized with func_dirname
|
|
# and func_basename. For efficiency, we do not delegate to
|
|
# those functions but instead duplicate the functionality here.
|
|
func_dirname_and_basename ()
|
|
{
|
|
# Extract subdirectory from the argument.
|
|
func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
|
|
if test "X$func_dirname_result" = "X${1}"; then
|
|
func_dirname_result="${3}"
|
|
else
|
|
func_dirname_result="$func_dirname_result${2}"
|
|
fi
|
|
func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
|
|
} # func_dirname_and_basename may be replaced by extended shell implementation
|
|
|
|
|
|
# func_stripname prefix suffix name
|
|
# strip PREFIX and SUFFIX off of NAME.
|
|
# PREFIX and SUFFIX must not contain globbing or regex special
|
|
# characters, hashes, percent signs, but SUFFIX may contain a leading
|
|
# dot (in which case that matches only a dot).
|
|
# func_strip_suffix prefix name
|
|
func_stripname ()
|
|
{
|
|
case ${2} in
|
|
.*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
|
|
*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
|
|
esac
|
|
} # func_stripname may be replaced by extended shell implementation
|
|
|
|
|
|
# These SED scripts presuppose an absolute path with a trailing slash.
|
|
pathcar='s,^/\([^/]*\).*$,\1,'
|
|
pathcdr='s,^/[^/]*,,'
|
|
removedotparts=':dotsl
|
|
s@/\./@/@g
|
|
t dotsl
|
|
s,/\.$,/,'
|
|
collapseslashes='s@/\{1,\}@/@g'
|
|
finalslash='s,/*$,/,'
|
|
|
|
# func_normal_abspath PATH
|
|
# Remove doubled-up and trailing slashes, "." path components,
|
|
# and cancel out any ".." path components in PATH after making
|
|
# it an absolute path.
|
|
# value returned in "$func_normal_abspath_result"
|
|
func_normal_abspath ()
|
|
{
|
|
# Start from root dir and reassemble the path.
|
|
func_normal_abspath_result=
|
|
func_normal_abspath_tpath=$1
|
|
func_normal_abspath_altnamespace=
|
|
case $func_normal_abspath_tpath in
|
|
"")
|
|
# Empty path, that just means $cwd.
|
|
func_stripname '' '/' "`pwd`"
|
|
func_normal_abspath_result=$func_stripname_result
|
|
return
|
|
;;
|
|
# The next three entries are used to spot a run of precisely
|
|
# two leading slashes without using negated character classes;
|
|
# we take advantage of case's first-match behaviour.
|
|
///*)
|
|
# Unusual form of absolute path, do nothing.
|
|
;;
|
|
//*)
|
|
# Not necessarily an ordinary path; POSIX reserves leading '//'
|
|
# and for example Cygwin uses it to access remote file shares
|
|
# over CIFS/SMB, so we conserve a leading double slash if found.
|
|
func_normal_abspath_altnamespace=/
|
|
;;
|
|
/*)
|
|
# Absolute path, do nothing.
|
|
;;
|
|
*)
|
|
# Relative path, prepend $cwd.
|
|
func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
|
|
;;
|
|
esac
|
|
# Cancel out all the simple stuff to save iterations. We also want
|
|
# the path to end with a slash for ease of parsing, so make sure
|
|
# there is one (and only one) here.
|
|
func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
|
|
-e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
|
|
while :; do
|
|
# Processed it all yet?
|
|
if test "$func_normal_abspath_tpath" = / ; then
|
|
# If we ascended to the root using ".." the result may be empty now.
|
|
if test -z "$func_normal_abspath_result" ; then
|
|
func_normal_abspath_result=/
|
|
fi
|
|
break
|
|
fi
|
|
func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
|
|
-e "$pathcar"`
|
|
func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
|
|
-e "$pathcdr"`
|
|
# Figure out what to do with it
|
|
case $func_normal_abspath_tcomponent in
|
|
"")
|
|
# Trailing empty path component, ignore it.
|
|
;;
|
|
..)
|
|
# Parent dir; strip last assembled component from result.
|
|
func_dirname "$func_normal_abspath_result"
|
|
func_normal_abspath_result=$func_dirname_result
|
|
;;
|
|
*)
|
|
# Actual path component, append it.
|
|
func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
|
|
;;
|
|
esac
|
|
done
|
|
# Restore leading double-slash if one was found on entry.
|
|
func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
|
|
}
|
|
|
|
# func_relative_path SRCDIR DSTDIR
|
|
# generates a relative path from SRCDIR to DSTDIR, with a trailing
|
|
# slash if non-empty, suitable for immediately appending a filename
|
|
# without needing to append a separator.
|
|
# value returned in "$func_relative_path_result"
|
|
func_relative_path ()
|
|
{
|
|
func_relative_path_result=
|
|
func_normal_abspath "$1"
|
|
func_relative_path_tlibdir=$func_normal_abspath_result
|
|
func_normal_abspath "$2"
|
|
func_relative_path_tbindir=$func_normal_abspath_result
|
|
|
|
# Ascend the tree starting from libdir
|
|
while :; do
|
|
# check if we have found a prefix of bindir
|
|
case $func_relative_path_tbindir in
|
|
$func_relative_path_tlibdir)
|
|
# found an exact match
|