Merge lp:~ubuntu-branches/ubuntu/natty/gtksourceview3/natty-201104070312 into lp:ubuntu/natty/gtksourceview3

Proposed by James Westby
Status: Merged
Merged at revision: 11
Proposed branch: lp:~ubuntu-branches/ubuntu/natty/gtksourceview3/natty-201104070312
Merge into: lp:ubuntu/natty/gtksourceview3
Diff against target: 8759 lines (+8748/-0) (has conflicts)
1 file modified
.pc/99_ltmain_as-needed.patch/ltmain.sh (+8748/-0)
Text conflict in .pc/99_ltmain_as-needed.patch/ltmain.sh
To merge this branch: bzr merge lp:~ubuntu-branches/ubuntu/natty/gtksourceview3/natty-201104070312
Reviewer Review Type Date Requested Status
Ubuntu Development Team Pending
Review via email: mp+56681@code.launchpad.net

Description of the change

The package history in the archive and the history in the bzr branch differ. As the archive is authoritative the history of lp:ubuntu/natty/gtksourceview3 now reflects that and the old bzr branch has been pushed to lp:~ubuntu-branches/ubuntu/natty/gtksourceview3/natty-201104070312. A merge should be performed if necessary.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.pc/99_ltmain_as-needed.patch/ltmain.sh'
--- .pc/99_ltmain_as-needed.patch/ltmain.sh 2011-04-06 17:25:57 +0000
+++ .pc/99_ltmain_as-needed.patch/ltmain.sh 2011-04-07 03:16:31 +0000
@@ -1,3 +1,4 @@
1<<<<<<< TREE
12
2# libtool (GNU libtool) 2.43# libtool (GNU libtool) 2.4
3# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 19964# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
@@ -9634,3 +9635,8750 @@
9634# End:9635# End:
9635# vi:sw=29636# vi:sw=2
96369637
9638=======
9639# Generated from ltmain.m4sh.
9640
9641# libtool (GNU libtool) 2.2.10
9642# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
9643
9644# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
9645# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
9646# This is free software; see the source for copying conditions. There is NO
9647# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9648
9649# GNU Libtool is free software; you can redistribute it and/or modify
9650# it under the terms of the GNU General Public License as published by
9651# the Free Software Foundation; either version 2 of the License, or
9652# (at your option) any later version.
9653#
9654# As a special exception to the GNU General Public License,
9655# if you distribute this file as part of a program or library that
9656# is built using GNU Libtool, you may include this file under the
9657# same distribution terms that you use for the rest of that program.
9658#
9659# GNU Libtool is distributed in the hope that it will be useful, but
9660# WITHOUT ANY WARRANTY; without even the implied warranty of
9661# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9662# General Public License for more details.
9663#
9664# You should have received a copy of the GNU General Public License
9665# along with GNU Libtool; see the file COPYING. If not, a copy
9666# can be downloaded from http://www.gnu.org/licenses/gpl.html,
9667# or obtained by writing to the Free Software Foundation, Inc.,
9668# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
9669
9670# Usage: $progname [OPTION]... [MODE-ARG]...
9671#
9672# Provide generalized library-building support services.
9673#
9674# --config show all configuration variables
9675# --debug enable verbose shell tracing
9676# -n, --dry-run display commands without modifying any files
9677# --features display basic configuration information and exit
9678# --mode=MODE use operation mode MODE
9679# --preserve-dup-deps don't remove duplicate dependency libraries
9680# --quiet, --silent don't print informational messages
9681# --no-quiet, --no-silent
9682# print informational messages (default)
9683# --tag=TAG use configuration variables from tag TAG
9684# -v, --verbose print more informational messages than default
9685# --no-verbose don't print the extra informational messages
9686# --version print version information
9687# -h, --help, --help-all print short, long, or detailed help message
9688#
9689# MODE must be one of the following:
9690#
9691# clean remove files from the build directory
9692# compile compile a source file into a libtool object
9693# execute automatically set library path, then run a program
9694# finish complete the installation of libtool libraries
9695# install install libraries or executables
9696# link create a library or an executable
9697# uninstall remove libraries from an installed directory
9698#
9699# MODE-ARGS vary depending on the MODE. When passed as first option,
9700# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
9701# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
9702#
9703# When reporting a bug, please describe a test case to reproduce it and
9704# include the following information:
9705#
9706# host-triplet: $host
9707# shell: $SHELL
9708# compiler: $LTCC
9709# compiler flags: $LTCFLAGS
9710# linker: $LD (gnu? $with_gnu_ld)
9711# $progname: (GNU libtool) 2.2.10
9712# automake: $automake_version
9713# autoconf: $autoconf_version
9714#
9715# Report bugs to <bug-libtool@gnu.org>.
9716
9717PROGRAM=libtool
9718PACKAGE=libtool
9719VERSION=2.2.10
9720TIMESTAMP=""
9721package_revision=1.3175
9722
9723# Be Bourne compatible
9724if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
9725 emulate sh
9726 NULLCMD=:
9727 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
9728 # is contrary to our usage. Disable this feature.
9729 alias -g '${1+"$@"}'='"$@"'
9730 setopt NO_GLOB_SUBST
9731else
9732 case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
9733fi
9734BIN_SH=xpg4; export BIN_SH # for Tru64
9735DUALCASE=1; export DUALCASE # for MKS sh
9736
9737# A function that is used when there is no print builtin or printf.
9738func_fallback_echo ()
9739{
9740 eval 'cat <<_LTECHO_EOF
9741$1
9742_LTECHO_EOF'
9743}
9744
9745# NLS nuisances: We save the old values to restore during execute mode.
9746lt_user_locale=
9747lt_safe_locale=
9748for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
9749do
9750 eval "if test \"\${$lt_var+set}\" = set; then
9751 save_$lt_var=\$$lt_var
9752 $lt_var=C
9753 export $lt_var
9754 lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
9755 lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
9756 fi"
9757done
9758LC_ALL=C
9759LANGUAGE=C
9760export LANGUAGE LC_ALL
9761
9762$lt_unset CDPATH
9763
9764
9765# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
9766# is ksh but when the shell is invoked as "sh" and the current value of
9767# the _XPG environment variable is not equal to 1 (one), the special
9768# positional parameter $0, within a function call, is the name of the
9769# function.
9770progpath="$0"
9771
9772
9773
9774: ${CP="cp -f"}
9775test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
9776: ${EGREP="/bin/grep -E"}
9777: ${FGREP="/bin/grep -F"}
9778: ${GREP="/bin/grep"}
9779: ${LN_S="ln -s"}
9780: ${MAKE="make"}
9781: ${MKDIR="mkdir"}
9782: ${MV="mv -f"}
9783: ${RM="rm -f"}
9784: ${SED="/bin/sed"}
9785: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
9786: ${Xsed="$SED -e 1s/^X//"}
9787
9788# Global variables:
9789EXIT_SUCCESS=0
9790EXIT_FAILURE=1
9791EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
9792EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
9793
9794exit_status=$EXIT_SUCCESS
9795
9796# Make sure IFS has a sensible default
9797lt_nl='
9798'
9799IFS=" $lt_nl"
9800
9801dirname="s,/[^/]*$,,"
9802basename="s,^.*/,,"
9803
9804# func_dirname_and_basename file append nondir_replacement
9805# perform func_basename and func_dirname in a single function
9806# call:
9807# dirname: Compute the dirname of FILE. If nonempty,
9808# add APPEND to the result, otherwise set result
9809# to NONDIR_REPLACEMENT.
9810# value returned in "$func_dirname_result"
9811# basename: Compute filename of FILE.
9812# value retuned in "$func_basename_result"
9813# Implementation must be kept synchronized with func_dirname
9814# and func_basename. For efficiency, we do not delegate to
9815# those functions but instead duplicate the functionality here.
9816func_dirname_and_basename ()
9817{
9818 # Extract subdirectory from the argument.
9819 func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
9820 if test "X$func_dirname_result" = "X${1}"; then
9821 func_dirname_result="${3}"
9822 else
9823 func_dirname_result="$func_dirname_result${2}"
9824 fi
9825 func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
9826}
9827
9828# Generated shell functions inserted here.
9829
9830# These SED scripts presuppose an absolute path with a trailing slash.
9831pathcar='s,^/\([^/]*\).*$,\1,'
9832pathcdr='s,^/[^/]*,,'
9833removedotparts=':dotsl
9834 s@/\./@/@g
9835 t dotsl
9836 s,/\.$,/,'
9837collapseslashes='s@/\{1,\}@/@g'
9838finalslash='s,/*$,/,'
9839
9840# func_normal_abspath PATH
9841# Remove doubled-up and trailing slashes, "." path components,
9842# and cancel out any ".." path components in PATH after making
9843# it an absolute path.
9844# value returned in "$func_normal_abspath_result"
9845func_normal_abspath ()
9846{
9847 # Start from root dir and reassemble the path.
9848 func_normal_abspath_result=
9849 func_normal_abspath_tpath=$1
9850 func_normal_abspath_altnamespace=
9851 case $func_normal_abspath_tpath in
9852 "")
9853 # Empty path, that just means $cwd.
9854 func_stripname '' '/' "`pwd`"
9855 func_normal_abspath_result=$func_stripname_result
9856 return
9857 ;;
9858 # The next three entries are used to spot a run of precisely
9859 # two leading slashes without using negated character classes;
9860 # we take advantage of case's first-match behaviour.
9861 ///*)
9862 # Unusual form of absolute path, do nothing.
9863 ;;
9864 //*)
9865 # Not necessarily an ordinary path; POSIX reserves leading '//'
9866 # and for example Cygwin uses it to access remote file shares
9867 # over CIFS/SMB, so we conserve a leading double slash if found.
9868 func_normal_abspath_altnamespace=/
9869 ;;
9870 /*)
9871 # Absolute path, do nothing.
9872 ;;
9873 *)
9874 # Relative path, prepend $cwd.
9875 func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
9876 ;;
9877 esac
9878 # Cancel out all the simple stuff to save iterations. We also want
9879 # the path to end with a slash for ease of parsing, so make sure
9880 # there is one (and only one) here.
9881 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
9882 -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
9883 while :; do
9884 # Processed it all yet?
9885 if test "$func_normal_abspath_tpath" = / ; then
9886 # If we ascended to the root using ".." the result may be empty now.
9887 if test -z "$func_normal_abspath_result" ; then
9888 func_normal_abspath_result=/
9889 fi
9890 break
9891 fi
9892 func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
9893 -e "$pathcar"`
9894 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
9895 -e "$pathcdr"`
9896 # Figure out what to do with it
9897 case $func_normal_abspath_tcomponent in
9898 "")
9899 # Trailing empty path component, ignore it.
9900 ;;
9901 ..)
9902 # Parent dir; strip last assembled component from result.
9903 func_dirname "$func_normal_abspath_result"
9904 func_normal_abspath_result=$func_dirname_result
9905 ;;
9906 *)
9907 # Actual path component, append it.
9908 func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
9909 ;;
9910 esac
9911 done
9912 # Restore leading double-slash if one was found on entry.
9913 func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
9914}
9915
9916# func_relative_path SRCDIR DSTDIR
9917# generates a relative path from SRCDIR to DSTDIR, with a trailing
9918# slash if non-empty, suitable for immediately appending a filename
9919# without needing to append a separator.
9920# value returned in "$func_relative_path_result"
9921func_relative_path ()
9922{
9923 func_relative_path_result=
9924 func_normal_abspath "$1"
9925 func_relative_path_tlibdir=$func_normal_abspath_result
9926 func_normal_abspath "$2"
9927 func_relative_path_tbindir=$func_normal_abspath_result
9928
9929 # Ascend the tree starting from libdir
9930 while :; do
9931 # check if we have found a prefix of bindir
9932 case $func_relative_path_tbindir in
9933 $func_relative_path_tlibdir)
9934 # found an exact match
9935 func_relative_path_tcancelled=
9936 break
9937 ;;
9938 $func_relative_path_tlibdir*)
9939 # found a matching prefix
9940 func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
9941 func_relative_path_tcancelled=$func_stripname_result
9942 if test -z "$func_relative_path_result"; then
9943 func_relative_path_result=.
9944 fi
9945 break
9946 ;;
9947 *)
9948 func_dirname $func_relative_path_tlibdir
9949 func_relative_path_tlibdir=${func_dirname_result}
9950 if test "x$func_relative_path_tlibdir" = x ; then
9951 # Have to descend all the way to the root!
9952 func_relative_path_result=../$func_relative_path_result
9953 func_relative_path_tcancelled=$func_relative_path_tbindir
9954 break
9955 fi
9956 func_relative_path_result=../$func_relative_path_result
9957 ;;
9958 esac
9959 done
9960
9961 # Now calculate path; take care to avoid doubling-up slashes.
9962 func_stripname '' '/' "$func_relative_path_result"
9963 func_relative_path_result=$func_stripname_result
9964 func_stripname '/' '/' "$func_relative_path_tcancelled"
9965 if test "x$func_stripname_result" != x ; then
9966 func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
9967 fi
9968
9969 # Normalisation. If bindir is libdir, return empty string,
9970 # else relative path ending with a slash; either way, target
9971 # file name can be directly appended.
9972 if test ! -z "$func_relative_path_result"; then
9973 func_stripname './' '' "$func_relative_path_result/"
9974 func_relative_path_result=$func_stripname_result
9975 fi
9976}
9977
9978# The name of this program:
9979func_dirname_and_basename "$progpath"
9980progname=$func_basename_result
9981
9982# Make sure we have an absolute path for reexecution:
9983case $progpath in
9984 [\\/]*|[A-Za-z]:\\*) ;;
9985 *[\\/]*)
9986 progdir=$func_dirname_result
9987 progdir=`cd "$progdir" && pwd`
9988 progpath="$progdir/$progname"
9989 ;;
9990 *)
9991 save_IFS="$IFS"
9992 IFS=:
9993 for progdir in $PATH; do
9994 IFS="$save_IFS"
9995 test -x "$progdir/$progname" && break
9996 done
9997 IFS="$save_IFS"
9998 test -n "$progdir" || progdir=`pwd`
9999 progpath="$progdir/$progname"
10000 ;;
10001esac
10002
10003# Sed substitution that helps us do robust quoting. It backslashifies
10004# metacharacters that are still active within double-quoted strings.
10005Xsed="${SED}"' -e 1s/^X//'
10006sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
10007
10008# Same as above, but do not quote variable references.
10009double_quote_subst='s/\(["`\\]\)/\\\1/g'
10010
10011# Re-`\' parameter expansions in output of double_quote_subst that were
10012# `\'-ed in input to the same. If an odd number of `\' preceded a '$'
10013# in input to double_quote_subst, that '$' was protected from expansion.
10014# Since each input `\' is now two `\'s, look for any number of runs of
10015# four `\'s followed by two `\'s and then a '$'. `\' that '$'.
10016bs='\\'
10017bs2='\\\\'
10018bs4='\\\\\\\\'
10019dollar='\$'
10020sed_double_backslash="\
10021 s/$bs4/&\\
10022/g
10023 s/^$bs2$dollar/$bs&/
10024 s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
10025 s/\n//g"
10026
10027# Standard options:
10028opt_dry_run=false
10029opt_help=false
10030opt_quiet=false
10031opt_verbose=false
10032opt_warning=:
10033
10034# func_echo arg...
10035# Echo program name prefixed message, along with the current mode
10036# name if it has been set yet.
10037func_echo ()
10038{
10039 $ECHO "$progname${mode+: }$mode: $*"
10040}
10041
10042# func_verbose arg...
10043# Echo program name prefixed message in verbose mode only.
10044func_verbose ()
10045{
10046 $opt_verbose && func_echo ${1+"$@"}
10047
10048 # A bug in bash halts the script if the last line of a function
10049 # fails when set -e is in force, so we need another command to
10050 # work around that:
10051 :
10052}
10053
10054# func_echo_all arg...
10055# Invoke $ECHO with all args, space-separated.
10056func_echo_all ()
10057{
10058 $ECHO "$*"
10059}
10060
10061# func_error arg...
10062# Echo program name prefixed message to standard error.
10063func_error ()
10064{
10065 $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
10066}
10067
10068# func_warning arg...
10069# Echo program name prefixed warning message to standard error.
10070func_warning ()
10071{
10072 $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
10073
10074 # bash bug again:
10075 :
10076}
10077
10078# func_fatal_error arg...
10079# Echo program name prefixed message to standard error, and exit.
10080func_fatal_error ()
10081{
10082 func_error ${1+"$@"}
10083 exit $EXIT_FAILURE
10084}
10085
10086# func_fatal_help arg...
10087# Echo program name prefixed message to standard error, followed by
10088# a help hint, and exit.
10089func_fatal_help ()
10090{
10091 func_error ${1+"$@"}
10092 func_fatal_error "$help"
10093}
10094help="Try \`$progname --help' for more information." ## default
10095
10096
10097# func_grep expression filename
10098# Check whether EXPRESSION matches any line of FILENAME, without output.
10099func_grep ()
10100{
10101 $GREP "$1" "$2" >/dev/null 2>&1
10102}
10103
10104
10105# func_mkdir_p directory-path
10106# Make sure the entire path to DIRECTORY-PATH is available.
10107func_mkdir_p ()
10108{
10109 my_directory_path="$1"
10110 my_dir_list=
10111
10112 if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
10113
10114 # Protect directory names starting with `-'
10115 case $my_directory_path in
10116 -*) my_directory_path="./$my_directory_path" ;;
10117 esac
10118
10119 # While some portion of DIR does not yet exist...
10120 while test ! -d "$my_directory_path"; do
10121 # ...make a list in topmost first order. Use a colon delimited
10122 # list incase some portion of path contains whitespace.
10123 my_dir_list="$my_directory_path:$my_dir_list"
10124
10125 # If the last portion added has no slash in it, the list is done
10126 case $my_directory_path in */*) ;; *) break ;; esac
10127
10128 # ...otherwise throw away the child directory and loop
10129 my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
10130 done
10131 my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
10132
10133 save_mkdir_p_IFS="$IFS"; IFS=':'
10134 for my_dir in $my_dir_list; do
10135 IFS="$save_mkdir_p_IFS"
10136 # mkdir can fail with a `File exist' error if two processes
10137 # try to create one of the directories concurrently. Don't
10138 # stop in that case!
10139 $MKDIR "$my_dir" 2>/dev/null || :
10140 done
10141 IFS="$save_mkdir_p_IFS"
10142
10143 # Bail out if we (or some other process) failed to create a directory.
10144 test -d "$my_directory_path" || \
10145 func_fatal_error "Failed to create \`$1'"
10146 fi
10147}
10148
10149
10150# func_mktempdir [string]
10151# Make a temporary directory that won't clash with other running
10152# libtool processes, and avoids race conditions if possible. If
10153# given, STRING is the basename for that directory.
10154func_mktempdir ()
10155{
10156 my_template="${TMPDIR-/tmp}/${1-$progname}"
10157
10158 if test "$opt_dry_run" = ":"; then
10159 # Return a directory name, but don't create it in dry-run mode
10160 my_tmpdir="${my_template}-$$"
10161 else
10162
10163 # If mktemp works, use that first and foremost
10164 my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
10165
10166 if test ! -d "$my_tmpdir"; then
10167 # Failing that, at least try and use $RANDOM to avoid a race
10168 my_tmpdir="${my_template}-${RANDOM-0}$$"
10169
10170 save_mktempdir_umask=`umask`
10171 umask 0077
10172 $MKDIR "$my_tmpdir"
10173 umask $save_mktempdir_umask
10174 fi
10175
10176 # If we're not in dry-run mode, bomb out on failure
10177 test -d "$my_tmpdir" || \
10178 func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
10179 fi
10180
10181 $ECHO "$my_tmpdir"
10182}
10183
10184
10185# func_quote_for_eval arg
10186# Aesthetically quote ARG to be evaled later.
10187# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
10188# is double-quoted, suitable for a subsequent eval, whereas
10189# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
10190# which are still active within double quotes backslashified.
10191func_quote_for_eval ()
10192{
10193 case $1 in
10194 *[\\\`\"\$]*)
10195 func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
10196 *)
10197 func_quote_for_eval_unquoted_result="$1" ;;
10198 esac
10199
10200 case $func_quote_for_eval_unquoted_result in
10201 # Double-quote args containing shell metacharacters to delay
10202 # word splitting, command substitution and and variable
10203 # expansion for a subsequent eval.
10204 # Many Bourne shells cannot handle close brackets correctly
10205 # in scan sets, so we specify it separately.
10206 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
10207 func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
10208 ;;
10209 *)
10210 func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
10211 esac
10212}
10213
10214
10215# func_quote_for_expand arg
10216# Aesthetically quote ARG to be evaled later; same as above,
10217# but do not quote variable references.
10218func_quote_for_expand ()
10219{
10220 case $1 in
10221 *[\\\`\"]*)
10222 my_arg=`$ECHO "$1" | $SED \
10223 -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
10224 *)
10225 my_arg="$1" ;;
10226 esac
10227
10228 case $my_arg in
10229 # Double-quote args containing shell metacharacters to delay
10230 # word splitting and command substitution for a subsequent eval.
10231 # Many Bourne shells cannot handle close brackets correctly
10232 # in scan sets, so we specify it separately.
10233 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
10234 my_arg="\"$my_arg\""
10235 ;;
10236 esac
10237
10238 func_quote_for_expand_result="$my_arg"
10239}
10240
10241
10242# func_show_eval cmd [fail_exp]
10243# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
10244# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
10245# is given, then evaluate it.
10246func_show_eval ()
10247{
10248 my_cmd="$1"
10249 my_fail_exp="${2-:}"
10250
10251 ${opt_silent-false} || {
10252 func_quote_for_expand "$my_cmd"
10253 eval "func_echo $func_quote_for_expand_result"
10254 }
10255
10256 if ${opt_dry_run-false}; then :; else
10257 eval "$my_cmd"
10258 my_status=$?
10259 if test "$my_status" -eq 0; then :; else
10260 eval "(exit $my_status); $my_fail_exp"
10261 fi
10262 fi
10263}
10264
10265
10266# func_show_eval_locale cmd [fail_exp]
10267# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
10268# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
10269# is given, then evaluate it. Use the saved locale for evaluation.
10270func_show_eval_locale ()
10271{
10272 my_cmd="$1"
10273 my_fail_exp="${2-:}"
10274
10275 ${opt_silent-false} || {
10276 func_quote_for_expand "$my_cmd"
10277 eval "func_echo $func_quote_for_expand_result"
10278 }
10279
10280 if ${opt_dry_run-false}; then :; else
10281 eval "$lt_user_locale
10282 $my_cmd"
10283 my_status=$?
10284 eval "$lt_safe_locale"
10285 if test "$my_status" -eq 0; then :; else
10286 eval "(exit $my_status); $my_fail_exp"
10287 fi
10288 fi
10289}
10290
10291
10292# func_version
10293# Echo version message to standard output and exit.
10294func_version ()
10295{
10296 $SED -n '/(C)/!b go
10297 :more
10298 /\./!{
10299 N
10300 s/\n# / /
10301 b more
10302 }
10303 :go
10304 /^# '$PROGRAM' (GNU /,/# warranty; / {
10305 s/^# //
10306 s/^# *$//
10307 s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
10308 p
10309 }' < "$progpath"
10310 exit $?
10311}
10312
10313# func_usage
10314# Echo short help message to standard output and exit.
10315func_usage ()
10316{
10317 $SED -n '/^# Usage:/,/^# *.*--help/ {
10318 s/^# //
10319 s/^# *$//
10320 s/\$progname/'$progname'/
10321 p
10322 }' < "$progpath"
10323 echo
10324 $ECHO "run \`$progname --help | more' for full usage"
10325 exit $?
10326}
10327
10328# func_help [NOEXIT]
10329# Echo long help message to standard output and exit,
10330# unless 'noexit' is passed as argument.
10331func_help ()
10332{
10333 $SED -n '/^# Usage:/,/# Report bugs to/ {
10334 s/^# //
10335 s/^# *$//
10336 s*\$progname*'$progname'*
10337 s*\$host*'"$host"'*
10338 s*\$SHELL*'"$SHELL"'*
10339 s*\$LTCC*'"$LTCC"'*
10340 s*\$LTCFLAGS*'"$LTCFLAGS"'*
10341 s*\$LD*'"$LD"'*
10342 s/\$with_gnu_ld/'"$with_gnu_ld"'/
10343 s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
10344 s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
10345 p
10346 }' < "$progpath"
10347 ret=$?
10348 if test -z "$1"; then
10349 exit $ret
10350 fi
10351}
10352
10353# func_missing_arg argname
10354# Echo program name prefixed message to standard error and set global
10355# exit_cmd.
10356func_missing_arg ()
10357{
10358 func_error "missing argument for $1."
10359 exit_cmd=exit
10360}
10361
10362exit_cmd=:
10363
10364
10365
10366
10367
10368
10369magic="%%%MAGIC variable%%%"
10370magic_exe="%%%MAGIC EXE variable%%%"
10371
10372# Global variables.
10373# $mode is unset
10374nonopt=
10375execute_dlfiles=
10376preserve_args=
10377lo2o="s/\\.lo\$/.${objext}/"
10378o2lo="s/\\.${objext}\$/.lo/"
10379extracted_archives=
10380extracted_serial=0
10381
10382opt_dry_run=false
10383opt_duplicate_deps=false
10384opt_silent=false
10385opt_debug=:
10386
10387# If this variable is set in any of the actions, the command in it
10388# will be execed at the end. This prevents here-documents from being
10389# left over by shells.
10390exec_cmd=
10391
10392# func_fatal_configuration arg...
10393# Echo program name prefixed message to standard error, followed by
10394# a configuration failure hint, and exit.
10395func_fatal_configuration ()
10396{
10397 func_error ${1+"$@"}
10398 func_error "See the $PACKAGE documentation for more information."
10399 func_fatal_error "Fatal configuration error."
10400}
10401
10402
10403# func_config
10404# Display the configuration for all the tags in this script.
10405func_config ()
10406{
10407 re_begincf='^# ### BEGIN LIBTOOL'
10408 re_endcf='^# ### END LIBTOOL'
10409
10410 # Default configuration.
10411 $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
10412
10413 # Now print the configurations for the tags.
10414 for tagname in $taglist; do
10415 $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
10416 done
10417
10418 exit $?
10419}
10420
10421# func_features
10422# Display the features supported by this script.
10423func_features ()
10424{
10425 echo "host: $host"
10426 if test "$build_libtool_libs" = yes; then
10427 echo "enable shared libraries"
10428 else
10429 echo "disable shared libraries"
10430 fi
10431 if test "$build_old_libs" = yes; then
10432 echo "enable static libraries"
10433 else
10434 echo "disable static libraries"
10435 fi
10436
10437 exit $?
10438}
10439
10440# func_enable_tag tagname
10441# Verify that TAGNAME is valid, and either flag an error and exit, or
10442# enable the TAGNAME tag. We also add TAGNAME to the global $taglist
10443# variable here.
10444func_enable_tag ()
10445{
10446 # Global variable:
10447 tagname="$1"
10448
10449 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
10450 re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
10451 sed_extractcf="/$re_begincf/,/$re_endcf/p"
10452
10453 # Validate tagname.
10454 case $tagname in
10455 *[!-_A-Za-z0-9,/]*)
10456 func_fatal_error "invalid tag name: $tagname"
10457 ;;
10458 esac
10459
10460 # Don't test for the "default" C tag, as we know it's
10461 # there but not specially marked.
10462 case $tagname in
10463 CC) ;;
10464 *)
10465 if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
10466 taglist="$taglist $tagname"
10467
10468 # Evaluate the configuration. Be careful to quote the path
10469 # and the sed script, to avoid splitting on whitespace, but
10470 # also don't use non-portable quotes within backquotes within
10471 # quotes we have to do it in 2 steps:
10472 extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
10473 eval "$extractedcf"
10474 else
10475 func_error "ignoring unknown tag $tagname"
10476 fi
10477 ;;
10478 esac
10479}
10480
10481# Parse options once, thoroughly. This comes as soon as possible in
10482# the script to make things like `libtool --version' happen quickly.
10483{
10484
10485 # Shorthand for --mode=foo, only valid as the first argument
10486 case $1 in
10487 clean|clea|cle|cl)
10488 shift; set dummy --mode clean ${1+"$@"}; shift
10489 ;;
10490 compile|compil|compi|comp|com|co|c)
10491 shift; set dummy --mode compile ${1+"$@"}; shift
10492 ;;
10493 execute|execut|execu|exec|exe|ex|e)
10494 shift; set dummy --mode execute ${1+"$@"}; shift
10495 ;;
10496 finish|finis|fini|fin|fi|f)
10497 shift; set dummy --mode finish ${1+"$@"}; shift
10498 ;;
10499 install|instal|insta|inst|ins|in|i)
10500 shift; set dummy --mode install ${1+"$@"}; shift
10501 ;;
10502 link|lin|li|l)
10503 shift; set dummy --mode link ${1+"$@"}; shift
10504 ;;
10505 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
10506 shift; set dummy --mode uninstall ${1+"$@"}; shift
10507 ;;
10508 esac
10509
10510 # Parse non-mode specific arguments:
10511 while test "$#" -gt 0; do
10512 opt="$1"
10513 shift
10514
10515 case $opt in
10516 --config) func_config ;;
10517
10518 --debug) preserve_args="$preserve_args $opt"
10519 func_echo "enabling shell trace mode"
10520 opt_debug='set -x'
10521 $opt_debug
10522 ;;
10523
10524 -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break
10525 execute_dlfiles="$execute_dlfiles $1"
10526 shift
10527 ;;
10528
10529 --dry-run | -n) opt_dry_run=: ;;
10530 --features) func_features ;;
10531 --finish) mode="finish" ;;
10532
10533 --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break
10534 case $1 in
10535 # Valid mode arguments:
10536 clean) ;;
10537 compile) ;;
10538 execute) ;;
10539 finish) ;;
10540 install) ;;
10541 link) ;;
10542 relink) ;;
10543 uninstall) ;;
10544
10545 # Catch anything else as an error
10546 *) func_error "invalid argument for $opt"
10547 exit_cmd=exit
10548 break
10549 ;;
10550 esac
10551
10552 mode="$1"
10553 shift
10554 ;;
10555
10556 --preserve-dup-deps)
10557 opt_duplicate_deps=: ;;
10558
10559 --quiet|--silent) preserve_args="$preserve_args $opt"
10560 opt_silent=:
10561 opt_verbose=false
10562 ;;
10563
10564 --no-quiet|--no-silent)
10565 preserve_args="$preserve_args $opt"
10566 opt_silent=false
10567 ;;
10568
10569 --verbose| -v) preserve_args="$preserve_args $opt"
10570 opt_silent=false
10571 opt_verbose=:
10572 ;;
10573
10574 --no-verbose) preserve_args="$preserve_args $opt"
10575 opt_verbose=false
10576 ;;
10577
10578 --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break
10579 preserve_args="$preserve_args $opt $1"
10580 func_enable_tag "$1" # tagname is set here
10581 shift
10582 ;;
10583
10584 # Separate optargs to long options:
10585 -dlopen=*|--mode=*|--tag=*)
10586 func_opt_split "$opt"
10587 set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
10588 shift
10589 ;;
10590
10591 -\?|-h) func_usage ;;
10592 --help) opt_help=: ;;
10593 --help-all) opt_help=': help-all' ;;
10594 --version) func_version ;;
10595
10596 -*) func_fatal_help "unrecognized option \`$opt'" ;;
10597
10598 *) nonopt="$opt"
10599 break
10600 ;;
10601 esac
10602 done
10603
10604
10605 case $host in
10606 *cygwin* | *mingw* | *pw32* | *cegcc*)
10607 # don't eliminate duplications in $postdeps and $predeps
10608 opt_duplicate_compiler_generated_deps=:
10609 ;;
10610 *)
10611 opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
10612 ;;
10613 esac
10614
10615 # Having warned about all mis-specified options, bail out if
10616 # anything was wrong.
10617 $exit_cmd $EXIT_FAILURE
10618}
10619
10620# func_check_version_match
10621# Ensure that we are using m4 macros, and libtool script from the same
10622# release of libtool.
10623func_check_version_match ()
10624{
10625 if test "$package_revision" != "$macro_revision"; then
10626 if test "$VERSION" != "$macro_version"; then
10627 if test -z "$macro_version"; then
10628 cat >&2 <<_LT_EOF
10629$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
10630$progname: definition of this LT_INIT comes from an older release.
10631$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
10632$progname: and run autoconf again.
10633_LT_EOF
10634 else
10635 cat >&2 <<_LT_EOF
10636$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
10637$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
10638$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
10639$progname: and run autoconf again.
10640_LT_EOF
10641 fi
10642 else
10643 cat >&2 <<_LT_EOF
10644$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
10645$progname: but the definition of this LT_INIT comes from revision $macro_revision.
10646$progname: You should recreate aclocal.m4 with macros from revision $package_revision
10647$progname: of $PACKAGE $VERSION and run autoconf again.
10648_LT_EOF
10649 fi
10650
10651 exit $EXIT_MISMATCH
10652 fi
10653}
10654
10655
10656## ----------- ##
10657## Main. ##
10658## ----------- ##
10659
10660$opt_help || {
10661 # Sanity checks first:
10662 func_check_version_match
10663
10664 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
10665 func_fatal_configuration "not configured to build any kind of library"
10666 fi
10667
10668 test -z "$mode" && func_fatal_error "error: you must specify a MODE."
10669
10670
10671 # Darwin sucks
10672 eval std_shrext=\"$shrext_cmds\"
10673
10674
10675 # Only execute mode is allowed to have -dlopen flags.
10676 if test -n "$execute_dlfiles" && test "$mode" != execute; then
10677 func_error "unrecognized option \`-dlopen'"
10678 $ECHO "$help" 1>&2
10679 exit $EXIT_FAILURE
10680 fi
10681
10682 # Change the help message to a mode-specific one.
10683 generic_help="$help"
10684 help="Try \`$progname --help --mode=$mode' for more information."
10685}
10686
10687
10688# func_lalib_p file
10689# True iff FILE is a libtool `.la' library or `.lo' object file.
10690# This function is only a basic sanity check; it will hardly flush out
10691# determined imposters.
10692func_lalib_p ()
10693{
10694 test -f "$1" &&
10695 $SED -e 4q "$1" 2>/dev/null \
10696 | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
10697}
10698
10699# func_lalib_unsafe_p file
10700# True iff FILE is a libtool `.la' library or `.lo' object file.
10701# This function implements the same check as func_lalib_p without
10702# resorting to external programs. To this end, it redirects stdin and
10703# closes it afterwards, without saving the original file descriptor.
10704# As a safety measure, use it only where a negative result would be
10705# fatal anyway. Works if `file' does not exist.
10706func_lalib_unsafe_p ()
10707{
10708 lalib_p=no
10709 if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
10710 for lalib_p_l in 1 2 3 4
10711 do
10712 read lalib_p_line
10713 case "$lalib_p_line" in
10714 \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
10715 esac
10716 done
10717 exec 0<&5 5<&-
10718 fi
10719 test "$lalib_p" = yes
10720}
10721
10722# func_ltwrapper_script_p file
10723# True iff FILE is a libtool wrapper script
10724# This function is only a basic sanity check; it will hardly flush out
10725# determined imposters.
10726func_ltwrapper_script_p ()
10727{
10728 func_lalib_p "$1"
10729}
10730
10731# func_ltwrapper_executable_p file
10732# True iff FILE is a libtool wrapper executable
10733# This function is only a basic sanity check; it will hardly flush out
10734# determined imposters.
10735func_ltwrapper_executable_p ()
10736{
10737 func_ltwrapper_exec_suffix=
10738 case $1 in
10739 *.exe) ;;
10740 *) func_ltwrapper_exec_suffix=.exe ;;
10741 esac
10742 $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
10743}
10744
10745# func_ltwrapper_scriptname file
10746# Assumes file is an ltwrapper_executable
10747# uses $file to determine the appropriate filename for a
10748# temporary ltwrapper_script.
10749func_ltwrapper_scriptname ()
10750{
10751 func_ltwrapper_scriptname_result=""
10752 if func_ltwrapper_executable_p "$1"; then
10753 func_dirname_and_basename "$1" "" "."
10754 func_stripname '' '.exe' "$func_basename_result"
10755 func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
10756 fi
10757}
10758
10759# func_ltwrapper_p file
10760# True iff FILE is a libtool wrapper script or wrapper executable
10761# This function is only a basic sanity check; it will hardly flush out
10762# determined imposters.
10763func_ltwrapper_p ()
10764{
10765 func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
10766}
10767
10768
10769# func_execute_cmds commands fail_cmd
10770# Execute tilde-delimited COMMANDS.
10771# If FAIL_CMD is given, eval that upon failure.
10772# FAIL_CMD may read-access the current command in variable CMD!
10773func_execute_cmds ()
10774{
10775 $opt_debug
10776 save_ifs=$IFS; IFS='~'
10777 for cmd in $1; do
10778 IFS=$save_ifs
10779 eval cmd=\"$cmd\"
10780 func_show_eval "$cmd" "${2-:}"
10781 done
10782 IFS=$save_ifs
10783}
10784
10785
10786# func_source file
10787# Source FILE, adding directory component if necessary.
10788# Note that it is not necessary on cygwin/mingw to append a dot to
10789# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
10790# behavior happens only for exec(3), not for open(2)! Also, sourcing
10791# `FILE.' does not work on cygwin managed mounts.
10792func_source ()
10793{
10794 $opt_debug
10795 case $1 in
10796 */* | *\\*) . "$1" ;;
10797 *) . "./$1" ;;
10798 esac
10799}
10800
10801
10802# func_infer_tag arg
10803# Infer tagged configuration to use if any are available and
10804# if one wasn't chosen via the "--tag" command line option.
10805# Only attempt this if the compiler in the base compile
10806# command doesn't match the default compiler.
10807# arg is usually of the form 'gcc ...'
10808func_infer_tag ()
10809{
10810 $opt_debug
10811 if test -n "$available_tags" && test -z "$tagname"; then
10812 CC_quoted=
10813 for arg in $CC; do
10814 func_quote_for_eval "$arg"
10815 CC_quoted="$CC_quoted $func_quote_for_eval_result"
10816 done
10817 CC_expanded=`func_echo_all $CC`
10818 CC_quoted_expanded=`func_echo_all $CC_quoted`
10819 case $@ in
10820 # Blanks in the command may have been stripped by the calling shell,
10821 # but not from the CC environment variable when configure was run.
10822 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
10823 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
10824 # Blanks at the start of $base_compile will cause this to fail
10825 # if we don't check for them as well.
10826 *)
10827 for z in $available_tags; do
10828 if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
10829 # Evaluate the configuration.
10830 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
10831 CC_quoted=
10832 for arg in $CC; do
10833 # Double-quote args containing other shell metacharacters.
10834 func_quote_for_eval "$arg"
10835 CC_quoted="$CC_quoted $func_quote_for_eval_result"
10836 done
10837 CC_expanded=`func_echo_all $CC`
10838 CC_quoted_expanded=`func_echo_all $CC_quoted`
10839 case "$@ " in
10840 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
10841 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
10842 # The compiler in the base compile command matches
10843 # the one in the tagged configuration.
10844 # Assume this is the tagged configuration we want.
10845 tagname=$z
10846 break
10847 ;;
10848 esac
10849 fi
10850 done
10851 # If $tagname still isn't set, then no tagged configuration
10852 # was found and let the user know that the "--tag" command
10853 # line option must be used.
10854 if test -z "$tagname"; then
10855 func_echo "unable to infer tagged configuration"
10856 func_fatal_error "specify a tag with \`--tag'"
10857# else
10858# func_verbose "using $tagname tagged configuration"
10859 fi
10860 ;;
10861 esac
10862 fi
10863}
10864
10865
10866
10867# func_write_libtool_object output_name pic_name nonpic_name
10868# Create a libtool object file (analogous to a ".la" file),
10869# but don't create it if we're doing a dry run.
10870func_write_libtool_object ()
10871{
10872 write_libobj=${1}
10873 if test "$build_libtool_libs" = yes; then
10874 write_lobj=\'${2}\'
10875 else
10876 write_lobj=none
10877 fi
10878
10879 if test "$build_old_libs" = yes; then
10880 write_oldobj=\'${3}\'
10881 else
10882 write_oldobj=none
10883 fi
10884
10885 $opt_dry_run || {
10886 cat >${write_libobj}T <<EOF
10887# $write_libobj - a libtool object file
10888# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
10889#
10890# Please DO NOT delete this file!
10891# It is necessary for linking the library.
10892
10893# Name of the PIC object.
10894pic_object=$write_lobj
10895
10896# Name of the non-PIC object
10897non_pic_object=$write_oldobj
10898
10899EOF
10900 $MV "${write_libobj}T" "${write_libobj}"
10901 }
10902}
10903
10904# func_mode_compile arg...
10905func_mode_compile ()
10906{
10907 $opt_debug
10908 # Get the compilation command and the source file.
10909 base_compile=
10910 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
10911 suppress_opt=yes
10912 suppress_output=
10913 arg_mode=normal
10914 libobj=
10915 later=
10916 pie_flag=
10917
10918 for arg
10919 do
10920 case $arg_mode in
10921 arg )
10922 # do not "continue". Instead, add this to base_compile
10923 lastarg="$arg"
10924 arg_mode=normal
10925 ;;
10926
10927 target )
10928 libobj="$arg"
10929 arg_mode=normal
10930 continue
10931 ;;
10932
10933 normal )
10934 # Accept any command-line options.
10935 case $arg in
10936 -o)
10937 test -n "$libobj" && \
10938 func_fatal_error "you cannot specify \`-o' more than once"
10939 arg_mode=target
10940 continue
10941 ;;
10942
10943 -pie | -fpie | -fPIE)
10944 pie_flag="$pie_flag $arg"
10945 continue
10946 ;;
10947
10948 -shared | -static | -prefer-pic | -prefer-non-pic)
10949 later="$later $arg"
10950 continue
10951 ;;
10952
10953 -no-suppress)
10954 suppress_opt=no
10955 continue
10956 ;;
10957
10958 -Xcompiler)
10959 arg_mode=arg # the next one goes into the "base_compile" arg list
10960 continue # The current "srcfile" will either be retained or
10961 ;; # replaced later. I would guess that would be a bug.
10962
10963 -Wc,*)
10964 func_stripname '-Wc,' '' "$arg"
10965 args=$func_stripname_result
10966 lastarg=
10967 save_ifs="$IFS"; IFS=','
10968 for arg in $args; do
10969 IFS="$save_ifs"
10970 func_quote_for_eval "$arg"
10971 lastarg="$lastarg $func_quote_for_eval_result"
10972 done
10973 IFS="$save_ifs"
10974 func_stripname ' ' '' "$lastarg"
10975 lastarg=$func_stripname_result
10976
10977 # Add the arguments to base_compile.
10978 base_compile="$base_compile $lastarg"
10979 continue
10980 ;;
10981
10982 *)
10983 # Accept the current argument as the source file.
10984 # The previous "srcfile" becomes the current argument.
10985 #
10986 lastarg="$srcfile"
10987 srcfile="$arg"
10988 ;;
10989 esac # case $arg
10990 ;;
10991 esac # case $arg_mode
10992
10993 # Aesthetically quote the previous argument.
10994 func_quote_for_eval "$lastarg"
10995 base_compile="$base_compile $func_quote_for_eval_result"
10996 done # for arg
10997
10998 case $arg_mode in
10999 arg)
11000 func_fatal_error "you must specify an argument for -Xcompile"
11001 ;;
11002 target)
11003 func_fatal_error "you must specify a target with \`-o'"
11004 ;;
11005 *)
11006 # Get the name of the library object.
11007 test -z "$libobj" && {
11008 func_basename "$srcfile"
11009 libobj="$func_basename_result"
11010 }
11011 ;;
11012 esac
11013
11014 # Recognize several different file suffixes.
11015 # If the user specifies -o file.o, it is replaced with file.lo
11016 case $libobj in
11017 *.[cCFSifmso] | \
11018 *.ada | *.adb | *.ads | *.asm | \
11019 *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
11020 *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup)
11021 func_xform "$libobj"
11022 libobj=$func_xform_result
11023 ;;
11024 esac
11025
11026 case $libobj in
11027 *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
11028 *)
11029 func_fatal_error "cannot determine name of library object from \`$libobj'"
11030 ;;
11031 esac
11032
11033 func_infer_tag $base_compile
11034
11035 for arg in $later; do
11036 case $arg in
11037 -shared)
11038 test "$build_libtool_libs" != yes && \
11039 func_fatal_configuration "can not build a shared library"
11040 build_old_libs=no
11041 continue
11042 ;;
11043
11044 -static)
11045 build_libtool_libs=no
11046 build_old_libs=yes
11047 continue
11048 ;;
11049
11050 -prefer-pic)
11051 pic_mode=yes
11052 continue
11053 ;;
11054
11055 -prefer-non-pic)
11056 pic_mode=no
11057 continue
11058 ;;
11059 esac
11060 done
11061
11062 func_quote_for_eval "$libobj"
11063 test "X$libobj" != "X$func_quote_for_eval_result" \
11064 && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
11065 && func_warning "libobj name \`$libobj' may not contain shell special characters."
11066 func_dirname_and_basename "$obj" "/" ""
11067 objname="$func_basename_result"
11068 xdir="$func_dirname_result"
11069 lobj=${xdir}$objdir/$objname
11070
11071 test -z "$base_compile" && \
11072 func_fatal_help "you must specify a compilation command"
11073
11074 # Delete any leftover library objects.
11075 if test "$build_old_libs" = yes; then
11076 removelist="$obj $lobj $libobj ${libobj}T"
11077 else
11078 removelist="$lobj $libobj ${libobj}T"
11079 fi
11080
11081 # On Cygwin there's no "real" PIC flag so we must build both object types
11082 case $host_os in
11083 cygwin* | mingw* | pw32* | os2* | cegcc*)
11084 pic_mode=default
11085 ;;
11086 esac
11087 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
11088 # non-PIC code in shared libraries is not supported
11089 pic_mode=default
11090 fi
11091
11092 # Calculate the filename of the output object if compiler does
11093 # not support -o with -c
11094 if test "$compiler_c_o" = no; then
11095 output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
11096 lockfile="$output_obj.lock"
11097 else
11098 output_obj=
11099 need_locks=no
11100 lockfile=
11101 fi
11102
11103 # Lock this critical section if it is needed
11104 # We use this script file to make the link, it avoids creating a new file
11105 if test "$need_locks" = yes; then
11106 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
11107 func_echo "Waiting for $lockfile to be removed"
11108 sleep 2
11109 done
11110 elif test "$need_locks" = warn; then
11111 if test -f "$lockfile"; then
11112 $ECHO "\
11113*** ERROR, $lockfile exists and contains:
11114`cat $lockfile 2>/dev/null`
11115
11116This indicates that another process is trying to use the same
11117temporary object file, and libtool could not work around it because
11118your compiler does not support \`-c' and \`-o' together. If you
11119repeat this compilation, it may succeed, by chance, but you had better
11120avoid parallel builds (make -j) in this platform, or get a better
11121compiler."
11122
11123 $opt_dry_run || $RM $removelist
11124 exit $EXIT_FAILURE
11125 fi
11126 removelist="$removelist $output_obj"
11127 $ECHO "$srcfile" > "$lockfile"
11128 fi
11129
11130 $opt_dry_run || $RM $removelist
11131 removelist="$removelist $lockfile"
11132 trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
11133
11134 if test -n "$fix_srcfile_path"; then
11135 eval srcfile=\"$fix_srcfile_path\"
11136 fi
11137 func_quote_for_eval "$srcfile"
11138 qsrcfile=$func_quote_for_eval_result
11139
11140 # Only build a PIC object if we are building libtool libraries.
11141 if test "$build_libtool_libs" = yes; then
11142 # Without this assignment, base_compile gets emptied.
11143 fbsd_hideous_sh_bug=$base_compile
11144
11145 if test "$pic_mode" != no; then
11146 command="$base_compile $qsrcfile $pic_flag"
11147 else
11148 # Don't build PIC code
11149 command="$base_compile $qsrcfile"
11150 fi
11151
11152 func_mkdir_p "$xdir$objdir"
11153
11154 if test -z "$output_obj"; then
11155 # Place PIC objects in $objdir
11156 command="$command -o $lobj"
11157 fi
11158
11159 func_show_eval_locale "$command" \
11160 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
11161
11162 if test "$need_locks" = warn &&
11163 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
11164 $ECHO "\
11165*** ERROR, $lockfile contains:
11166`cat $lockfile 2>/dev/null`
11167
11168but it should contain:
11169$srcfile
11170
11171This indicates that another process is trying to use the same
11172temporary object file, and libtool could not work around it because
11173your compiler does not support \`-c' and \`-o' together. If you
11174repeat this compilation, it may succeed, by chance, but you had better
11175avoid parallel builds (make -j) in this platform, or get a better
11176compiler."
11177
11178 $opt_dry_run || $RM $removelist
11179 exit $EXIT_FAILURE
11180 fi
11181
11182 # Just move the object if needed, then go on to compile the next one
11183 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
11184 func_show_eval '$MV "$output_obj" "$lobj"' \
11185 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
11186 fi
11187
11188 # Allow error messages only from the first compilation.
11189 if test "$suppress_opt" = yes; then
11190 suppress_output=' >/dev/null 2>&1'
11191 fi
11192 fi
11193
11194 # Only build a position-dependent object if we build old libraries.
11195 if test "$build_old_libs" = yes; then
11196 if test "$pic_mode" != yes; then
11197 # Don't build PIC code
11198 command="$base_compile $qsrcfile$pie_flag"
11199 else
11200 command="$base_compile $qsrcfile $pic_flag"
11201 fi
11202 if test "$compiler_c_o" = yes; then
11203 command="$command -o $obj"
11204 fi
11205
11206 # Suppress compiler output if we already did a PIC compilation.
11207 command="$command$suppress_output"
11208 func_show_eval_locale "$command" \
11209 '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
11210
11211 if test "$need_locks" = warn &&
11212 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
11213 $ECHO "\
11214*** ERROR, $lockfile contains:
11215`cat $lockfile 2>/dev/null`
11216
11217but it should contain:
11218$srcfile
11219
11220This indicates that another process is trying to use the same
11221temporary object file, and libtool could not work around it because
11222your compiler does not support \`-c' and \`-o' together. If you
11223repeat this compilation, it may succeed, by chance, but you had better
11224avoid parallel builds (make -j) in this platform, or get a better
11225compiler."
11226
11227 $opt_dry_run || $RM $removelist
11228 exit $EXIT_FAILURE
11229 fi
11230
11231 # Just move the object if needed
11232 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
11233 func_show_eval '$MV "$output_obj" "$obj"' \
11234 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
11235 fi
11236 fi
11237
11238 $opt_dry_run || {
11239 func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
11240
11241 # Unlock the critical section if it was locked
11242 if test "$need_locks" != no; then
11243 removelist=$lockfile
11244 $RM "$lockfile"
11245 fi
11246 }
11247
11248 exit $EXIT_SUCCESS
11249}
11250
11251$opt_help || {
11252 test "$mode" = compile && func_mode_compile ${1+"$@"}
11253}
11254
11255func_mode_help ()
11256{
11257 # We need to display help for each of the modes.
11258 case $mode in
11259 "")
11260 # Generic help is extracted from the usage comments
11261 # at the start of this file.
11262 func_help
11263 ;;
11264
11265 clean)
11266 $ECHO \
11267"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
11268
11269Remove files from the build directory.
11270
11271RM is the name of the program to use to delete files associated with each FILE
11272(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
11273to RM.
11274
11275If FILE is a libtool library, object or program, all the files associated
11276with it are deleted. Otherwise, only FILE itself is deleted using RM."
11277 ;;
11278
11279 compile)
11280 $ECHO \
11281"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
11282
11283Compile a source file into a libtool library object.
11284
11285This mode accepts the following additional options:
11286
11287 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
11288 -no-suppress do not suppress compiler output for multiple passes
11289 -prefer-pic try to build PIC objects only
11290 -prefer-non-pic try to build non-PIC objects only
11291 -shared do not build a \`.o' file suitable for static linking
11292 -static only build a \`.o' file suitable for static linking
11293 -Wc,FLAG pass FLAG directly to the compiler
11294
11295COMPILE-COMMAND is a command to be used in creating a \`standard' object file
11296from the given SOURCEFILE.
11297
11298The output file name is determined by removing the directory component from
11299SOURCEFILE, then substituting the C source code suffix \`.c' with the
11300library object suffix, \`.lo'."
11301 ;;
11302
11303 execute)
11304 $ECHO \
11305"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
11306
11307Automatically set library path, then run a program.
11308
11309This mode accepts the following additional options:
11310
11311 -dlopen FILE add the directory containing FILE to the library path
11312
11313This mode sets the library path environment variable according to \`-dlopen'
11314flags.
11315
11316If any of the ARGS are libtool executable wrappers, then they are translated
11317into their corresponding uninstalled binary, and any of their required library
11318directories are added to the library path.
11319
11320Then, COMMAND is executed, with ARGS as arguments."
11321 ;;
11322
11323 finish)
11324 $ECHO \
11325"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
11326
11327Complete the installation of libtool libraries.
11328
11329Each LIBDIR is a directory that contains libtool libraries.
11330
11331The commands that this mode executes may require superuser privileges. Use
11332the \`--dry-run' option if you just want to see what would be executed."
11333 ;;
11334
11335 install)
11336 $ECHO \
11337"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
11338
11339Install executables or libraries.
11340
11341INSTALL-COMMAND is the installation command. The first component should be
11342either the \`install' or \`cp' program.
11343
11344The following components of INSTALL-COMMAND are treated specially:
11345
11346 -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
11347
11348The rest of the components are interpreted as arguments to that command (only
11349BSD-compatible install options are recognized)."
11350 ;;
11351
11352 link)
11353 $ECHO \
11354"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
11355
11356Link object files or libraries together to form another library, or to
11357create an executable program.
11358
11359LINK-COMMAND is a command using the C compiler that you would use to create
11360a program from several object files.
11361
11362The following components of LINK-COMMAND are treated specially:
11363
11364 -all-static do not do any dynamic linking at all
11365 -avoid-version do not add a version suffix if possible
11366 -bindir BINDIR specify path to binaries directory (for systems where
11367 libraries must be found in the PATH setting at runtime)
11368 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
11369 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
11370 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
11371 -export-symbols SYMFILE
11372 try to export only the symbols listed in SYMFILE
11373 -export-symbols-regex REGEX
11374 try to export only the symbols matching REGEX
11375 -LLIBDIR search LIBDIR for required installed libraries
11376 -lNAME OUTPUT-FILE requires the installed library libNAME
11377 -module build a library that can dlopened
11378 -no-fast-install disable the fast-install mode
11379 -no-install link a not-installable executable
11380 -no-undefined declare that a library does not refer to external symbols
11381 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
11382 -objectlist FILE Use a list of object files found in FILE to specify objects
11383 -precious-files-regex REGEX
11384 don't remove output files matching REGEX
11385 -release RELEASE specify package release information
11386 -rpath LIBDIR the created library will eventually be installed in LIBDIR
11387 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
11388 -shared only do dynamic linking of libtool libraries
11389 -shrext SUFFIX override the standard shared library file extension
11390 -static do not do any dynamic linking of uninstalled libtool libraries
11391 -static-libtool-libs
11392 do not do any dynamic linking of libtool libraries
11393 -version-info CURRENT[:REVISION[:AGE]]
11394 specify library version info [each variable defaults to 0]
11395 -weak LIBNAME declare that the target provides the LIBNAME interface
11396 -Wc,FLAG
11397 -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
11398 -Wl,FLAG
11399 -Xlinker FLAG pass linker-specific FLAG directly to the linker
11400 -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
11401
11402All other options (arguments beginning with \`-') are ignored.
11403
11404Every other argument is treated as a filename. Files ending in \`.la' are
11405treated as uninstalled libtool libraries, other files are standard or library
11406object files.
11407
11408If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
11409only library objects (\`.lo' files) may be specified, and \`-rpath' is
11410required, except when creating a convenience library.
11411
11412If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
11413using \`ar' and \`ranlib', or on Windows using \`lib'.
11414
11415If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
11416is created, otherwise an executable program is created."
11417 ;;
11418
11419 uninstall)
11420 $ECHO \
11421"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
11422
11423Remove libraries from an installation directory.
11424
11425RM is the name of the program to use to delete files associated with each FILE
11426(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
11427to RM.
11428
11429If FILE is a libtool library, all the files associated with it are deleted.
11430Otherwise, only FILE itself is deleted using RM."
11431 ;;
11432
11433 *)
11434 func_fatal_help "invalid operation mode \`$mode'"
11435 ;;
11436 esac
11437
11438 echo
11439 $ECHO "Try \`$progname --help' for more information about other modes."
11440}
11441
11442# Now that we've collected a possible --mode arg, show help if necessary
11443if $opt_help; then
11444 if test "$opt_help" = :; then
11445 func_mode_help
11446 else
11447 {
11448 func_help noexit
11449 for mode in compile link execute install finish uninstall clean; do
11450 func_mode_help
11451 done
11452 } | sed -n '1p; 2,$s/^Usage:/ or: /p'
11453 {
11454 func_help noexit
11455 for mode in compile link execute install finish uninstall clean; do
11456 echo
11457 func_mode_help
11458 done
11459 } |
11460 sed '1d
11461 /^When reporting/,/^Report/{
11462 H
11463 d
11464 }
11465 $x
11466 /information about other modes/d
11467 /more detailed .*MODE/d
11468 s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
11469 fi
11470 exit $?
11471fi
11472
11473
11474# func_mode_execute arg...
11475func_mode_execute ()
11476{
11477 $opt_debug
11478 # The first argument is the command name.
11479 cmd="$nonopt"
11480 test -z "$cmd" && \
11481 func_fatal_help "you must specify a COMMAND"
11482
11483 # Handle -dlopen flags immediately.
11484 for file in $execute_dlfiles; do
11485 test -f "$file" \
11486 || func_fatal_help "\`$file' is not a file"
11487
11488 dir=
11489 case $file in
11490 *.la)
11491 # Check to see that this really is a libtool archive.
11492 func_lalib_unsafe_p "$file" \
11493 || func_fatal_help "\`$lib' is not a valid libtool archive"
11494
11495 # Read the libtool library.
11496 dlname=
11497 library_names=
11498 func_source "$file"
11499
11500 # Skip this library if it cannot be dlopened.
11501 if test -z "$dlname"; then
11502 # Warn if it was a shared library.
11503 test -n "$library_names" && \
11504 func_warning "\`$file' was not linked with \`-export-dynamic'"
11505 continue
11506 fi
11507
11508 func_dirname "$file" "" "."
11509 dir="$func_dirname_result"
11510
11511 if test -f "$dir/$objdir/$dlname"; then
11512 dir="$dir/$objdir"
11513 else
11514 if test ! -f "$dir/$dlname"; then
11515 func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
11516 fi
11517 fi
11518 ;;
11519
11520 *.lo)
11521 # Just add the directory containing the .lo file.
11522 func_dirname "$file" "" "."
11523 dir="$func_dirname_result"
11524 ;;
11525
11526 *)
11527 func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
11528 continue
11529 ;;
11530 esac
11531
11532 # Get the absolute pathname.
11533 absdir=`cd "$dir" && pwd`
11534 test -n "$absdir" && dir="$absdir"
11535
11536 # Now add the directory to shlibpath_var.
11537 if eval "test -z \"\$$shlibpath_var\""; then
11538 eval "$shlibpath_var=\"\$dir\""
11539 else
11540 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
11541 fi
11542 done
11543
11544 # This variable tells wrapper scripts just to set shlibpath_var
11545 # rather than running their programs.
11546 libtool_execute_magic="$magic"
11547
11548 # Check if any of the arguments is a wrapper script.
11549 args=
11550 for file
11551 do
11552 case $file in
11553 -* | *.la | *.lo ) ;;
11554 *)
11555 # Do a test to see if this is really a libtool program.
11556 if func_ltwrapper_script_p "$file"; then
11557 func_source "$file"
11558 # Transform arg to wrapped name.
11559 file="$progdir/$program"
11560 elif func_ltwrapper_executable_p "$file"; then
11561 func_ltwrapper_scriptname "$file"
11562 func_source "$func_ltwrapper_scriptname_result"
11563 # Transform arg to wrapped name.
11564 file="$progdir/$program"
11565 fi
11566 ;;
11567 esac
11568 # Quote arguments (to preserve shell metacharacters).
11569 func_quote_for_eval "$file"
11570 args="$args $func_quote_for_eval_result"
11571 done
11572
11573 if test "X$opt_dry_run" = Xfalse; then
11574 if test -n "$shlibpath_var"; then
11575 # Export the shlibpath_var.
11576 eval "export $shlibpath_var"
11577 fi
11578
11579 # Restore saved environment variables
11580 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
11581 do
11582 eval "if test \"\${save_$lt_var+set}\" = set; then
11583 $lt_var=\$save_$lt_var; export $lt_var
11584 else
11585 $lt_unset $lt_var
11586 fi"
11587 done
11588
11589 # Now prepare to actually exec the command.
11590 exec_cmd="\$cmd$args"
11591 else
11592 # Display what would be done.
11593 if test -n "$shlibpath_var"; then
11594 eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
11595 echo "export $shlibpath_var"
11596 fi
11597 $ECHO "$cmd$args"
11598 exit $EXIT_SUCCESS
11599 fi
11600}
11601
11602test "$mode" = execute && func_mode_execute ${1+"$@"}
11603
11604
11605# func_mode_finish arg...
11606func_mode_finish ()
11607{
11608 $opt_debug
11609 libdirs="$nonopt"
11610 admincmds=
11611
11612 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
11613 for dir
11614 do
11615 libdirs="$libdirs $dir"
11616 done
11617
11618 for libdir in $libdirs; do
11619 if test -n "$finish_cmds"; then
11620 # Do each command in the finish commands.
11621 func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
11622'"$cmd"'"'
11623 fi
11624 if test -n "$finish_eval"; then
11625 # Do the single finish_eval.
11626 eval cmds=\"$finish_eval\"
11627 $opt_dry_run || eval "$cmds" || admincmds="$admincmds
11628 $cmds"
11629 fi
11630 done
11631 fi
11632
11633 # Exit here if they wanted silent mode.
11634 $opt_silent && exit $EXIT_SUCCESS
11635
11636 echo "----------------------------------------------------------------------"
11637 echo "Libraries have been installed in:"
11638 for libdir in $libdirs; do
11639 $ECHO " $libdir"
11640 done
11641 echo
11642 echo "If you ever happen to want to link against installed libraries"
11643 echo "in a given directory, LIBDIR, you must either use libtool, and"
11644 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
11645 echo "flag during linking and do at least one of the following:"
11646 if test -n "$shlibpath_var"; then
11647 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
11648 echo " during execution"
11649 fi
11650 if test -n "$runpath_var"; then
11651 echo " - add LIBDIR to the \`$runpath_var' environment variable"
11652 echo " during linking"
11653 fi
11654 if test -n "$hardcode_libdir_flag_spec"; then
11655 libdir=LIBDIR
11656 eval flag=\"$hardcode_libdir_flag_spec\"
11657
11658 $ECHO " - use the \`$flag' linker flag"
11659 fi
11660 if test -n "$admincmds"; then
11661 $ECHO " - have your system administrator run these commands:$admincmds"
11662 fi
11663 if test -f /etc/ld.so.conf; then
11664 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
11665 fi
11666 echo
11667
11668 echo "See any operating system documentation about shared libraries for"
11669 case $host in
11670 solaris2.[6789]|solaris2.1[0-9])
11671 echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
11672 echo "pages."
11673 ;;
11674 *)
11675 echo "more information, such as the ld(1) and ld.so(8) manual pages."
11676 ;;
11677 esac
11678 echo "----------------------------------------------------------------------"
11679 exit $EXIT_SUCCESS
11680}
11681
11682test "$mode" = finish && func_mode_finish ${1+"$@"}
11683
11684
11685# func_mode_install arg...
11686func_mode_install ()
11687{
11688 $opt_debug
11689 # There may be an optional sh(1) argument at the beginning of
11690 # install_prog (especially on Windows NT).
11691 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
11692 # Allow the use of GNU shtool's install command.
11693 case $nonopt in *shtool*) :;; *) false;; esac; then
11694 # Aesthetically quote it.
11695 func_quote_for_eval "$nonopt"
11696 install_prog="$func_quote_for_eval_result "
11697 arg=$1
11698 shift
11699 else
11700 install_prog=
11701 arg=$nonopt
11702 fi
11703
11704 # The real first argument should be the name of the installation program.
11705 # Aesthetically quote it.
11706 func_quote_for_eval "$arg"
11707 install_prog="$install_prog$func_quote_for_eval_result"
11708 install_shared_prog=$install_prog
11709 case " $install_prog " in
11710 *[\\\ /]cp\ *) install_cp=: ;;
11711 *) install_cp=false ;;
11712 esac
11713
11714 # We need to accept at least all the BSD install flags.
11715 dest=
11716 files=
11717 opts=
11718 prev=
11719 install_type=
11720 isdir=no
11721 stripme=
11722 no_mode=:
11723 for arg
11724 do
11725 arg2=
11726 if test -n "$dest"; then
11727 files="$files $dest"
11728 dest=$arg
11729 continue
11730 fi
11731
11732 case $arg in
11733 -d) isdir=yes ;;
11734 -f)
11735 if $install_cp; then :; else
11736 prev=$arg
11737 fi
11738 ;;
11739 -g | -m | -o)
11740 prev=$arg
11741 ;;
11742 -s)
11743 stripme=" -s"
11744 continue
11745 ;;
11746 -*)
11747 ;;
11748 *)
11749 # If the previous option needed an argument, then skip it.
11750 if test -n "$prev"; then
11751 if test "x$prev" = x-m && test -n "$install_override_mode"; then
11752 arg2=$install_override_mode
11753 no_mode=false
11754 fi
11755 prev=
11756 else
11757 dest=$arg
11758 continue
11759 fi
11760 ;;
11761 esac
11762
11763 # Aesthetically quote the argument.
11764 func_quote_for_eval "$arg"
11765 install_prog="$install_prog $func_quote_for_eval_result"
11766 if test -n "$arg2"; then
11767 func_quote_for_eval "$arg2"
11768 fi
11769 install_shared_prog="$install_shared_prog $func_quote_for_eval_result"
11770 done
11771
11772 test -z "$install_prog" && \
11773 func_fatal_help "you must specify an install program"
11774
11775 test -n "$prev" && \
11776 func_fatal_help "the \`$prev' option requires an argument"
11777
11778 if test -n "$install_override_mode" && $no_mode; then
11779 if $install_cp; then :; else
11780 func_quote_for_eval "$install_override_mode"
11781 install_shared_prog="$install_shared_prog -m $func_quote_for_eval_result"
11782 fi
11783 fi
11784
11785 if test -z "$files"; then
11786 if test -z "$dest"; then
11787 func_fatal_help "no file or destination specified"
11788 else
11789 func_fatal_help "you must specify a destination"
11790 fi
11791 fi
11792
11793 # Strip any trailing slash from the destination.
11794 func_stripname '' '/' "$dest"
11795 dest=$func_stripname_result
11796
11797 # Check to see that the destination is a directory.
11798 test -d "$dest" && isdir=yes
11799 if test "$isdir" = yes; then
11800 destdir="$dest"
11801 destname=
11802 else
11803 func_dirname_and_basename "$dest" "" "."
11804 destdir="$func_dirname_result"
11805 destname="$func_basename_result"
11806
11807 # Not a directory, so check to see that there is only one file specified.
11808 set dummy $files; shift
11809 test "$#" -gt 1 && \
11810 func_fatal_help "\`$dest' is not a directory"
11811 fi
11812 case $destdir in
11813 [\\/]* | [A-Za-z]:[\\/]*) ;;
11814 *)
11815 for file in $files; do
11816 case $file in
11817 *.lo) ;;
11818 *)
11819 func_fatal_help "\`$destdir' must be an absolute directory name"
11820 ;;
11821 esac
11822 done
11823 ;;
11824 esac
11825
11826 # This variable tells wrapper scripts just to set variables rather
11827 # than running their programs.
11828 libtool_install_magic="$magic"
11829
11830 staticlibs=
11831 future_libdirs=
11832 current_libdirs=
11833 for file in $files; do
11834
11835 # Do each installation.
11836 case $file in
11837 *.$libext)
11838 # Do the static libraries later.
11839 staticlibs="$staticlibs $file"
11840 ;;
11841
11842 *.la)
11843 # Check to see that this really is a libtool archive.
11844 func_lalib_unsafe_p "$file" \
11845 || func_fatal_help "\`$file' is not a valid libtool archive"
11846
11847 library_names=
11848 old_library=
11849 relink_command=
11850 func_source "$file"
11851
11852 # Add the libdir to current_libdirs if it is the destination.
11853 if test "X$destdir" = "X$libdir"; then
11854 case "$current_libdirs " in
11855 *" $libdir "*) ;;
11856 *) current_libdirs="$current_libdirs $libdir" ;;
11857 esac
11858 else
11859 # Note the libdir as a future libdir.
11860 case "$future_libdirs " in
11861 *" $libdir "*) ;;
11862 *) future_libdirs="$future_libdirs $libdir" ;;
11863 esac
11864 fi
11865
11866 func_dirname "$file" "/" ""
11867 dir="$func_dirname_result"
11868 dir="$dir$objdir"
11869
11870 if test -n "$relink_command"; then
11871 # Determine the prefix the user has applied to our future dir.
11872 inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
11873
11874 # Don't allow the user to place us outside of our expected
11875 # location b/c this prevents finding dependent libraries that
11876 # are installed to the same prefix.
11877 # At present, this check doesn't affect windows .dll's that
11878 # are installed into $libdir/../bin (currently, that works fine)
11879 # but it's something to keep an eye on.
11880 test "$inst_prefix_dir" = "$destdir" && \
11881 func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
11882
11883 if test -n "$inst_prefix_dir"; then
11884 # Stick the inst_prefix_dir data into the link command.
11885 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
11886 else
11887 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
11888 fi
11889
11890 func_warning "relinking \`$file'"
11891 func_show_eval "$relink_command" \
11892 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
11893 fi
11894
11895 # See the names of the shared library.
11896 set dummy $library_names; shift
11897 if test -n "$1"; then
11898 realname="$1"
11899 shift
11900
11901 srcname="$realname"
11902 test -n "$relink_command" && srcname="$realname"T
11903
11904 # Install the shared library and build the symlinks.
11905 func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
11906 'exit $?'
11907 tstripme="$stripme"
11908 case $host_os in
11909 cygwin* | mingw* | pw32* | cegcc*)
11910 case $realname in
11911 *.dll.a)
11912 tstripme=""
11913 ;;
11914 esac
11915 ;;
11916 esac
11917 if test -n "$tstripme" && test -n "$striplib"; then
11918 func_show_eval "$striplib $destdir/$realname" 'exit $?'
11919 fi
11920
11921 if test "$#" -gt 0; then
11922 # Delete the old symlinks, and create new ones.
11923 # Try `ln -sf' first, because the `ln' binary might depend on
11924 # the symlink we replace! Solaris /bin/ln does not understand -f,
11925 # so we also need to try rm && ln -s.
11926 for linkname
11927 do
11928 test "$linkname" != "$realname" \
11929 && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
11930 done
11931 fi
11932
11933 # Do each command in the postinstall commands.
11934 lib="$destdir/$realname"
11935 func_execute_cmds "$postinstall_cmds" 'exit $?'
11936 fi
11937
11938 # Install the pseudo-library for information purposes.
11939 func_basename "$file"
11940 name="$func_basename_result"
11941 instname="$dir/$name"i
11942 func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
11943
11944 # Maybe install the static library, too.
11945 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
11946 ;;
11947
11948 *.lo)
11949 # Install (i.e. copy) a libtool object.
11950
11951 # Figure out destination file name, if it wasn't already specified.
11952 if test -n "$destname"; then
11953 destfile="$destdir/$destname"
11954 else
11955 func_basename "$file"
11956 destfile="$func_basename_result"
11957 destfile="$destdir/$destfile"
11958 fi
11959
11960 # Deduce the name of the destination old-style object file.
11961 case $destfile in
11962 *.lo)
11963 func_lo2o "$destfile"
11964 staticdest=$func_lo2o_result
11965 ;;
11966 *.$objext)
11967 staticdest="$destfile"
11968 destfile=
11969 ;;
11970 *)
11971 func_fatal_help "cannot copy a libtool object to \`$destfile'"
11972 ;;
11973 esac
11974
11975 # Install the libtool object if requested.
11976 test -n "$destfile" && \
11977 func_show_eval "$install_prog $file $destfile" 'exit $?'
11978
11979 # Install the old object if enabled.
11980 if test "$build_old_libs" = yes; then
11981 # Deduce the name of the old-style object file.
11982 func_lo2o "$file"
11983 staticobj=$func_lo2o_result
11984 func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
11985 fi
11986 exit $EXIT_SUCCESS
11987 ;;
11988
11989 *)
11990 # Figure out destination file name, if it wasn't already specified.
11991 if test -n "$destname"; then
11992 destfile="$destdir/$destname"
11993 else
11994 func_basename "$file"
11995 destfile="$func_basename_result"
11996 destfile="$destdir/$destfile"
11997 fi
11998
11999 # If the file is missing, and there is a .exe on the end, strip it
12000 # because it is most likely a libtool script we actually want to
12001 # install
12002 stripped_ext=""
12003 case $file in
12004 *.exe)
12005 if test ! -f "$file"; then
12006 func_stripname '' '.exe' "$file"
12007 file=$func_stripname_result
12008 stripped_ext=".exe"
12009 fi
12010 ;;
12011 esac
12012
12013 # Do a test to see if this is really a libtool program.
12014 case $host in
12015 *cygwin* | *mingw*)
12016 if func_ltwrapper_executable_p "$file"; then
12017 func_ltwrapper_scriptname "$file"
12018 wrapper=$func_ltwrapper_scriptname_result
12019 else
12020 func_stripname '' '.exe' "$file"
12021 wrapper=$func_stripname_result
12022 fi
12023 ;;
12024 *)
12025 wrapper=$file
12026 ;;
12027 esac
12028 if func_ltwrapper_script_p "$wrapper"; then
12029 notinst_deplibs=
12030 relink_command=
12031
12032 func_source "$wrapper"
12033
12034 # Check the variables that should have been set.
12035 test -z "$generated_by_libtool_version" && \
12036 func_fatal_error "invalid libtool wrapper script \`$wrapper'"
12037
12038 finalize=yes
12039 for lib in $notinst_deplibs; do
12040 # Check to see that each library is installed.
12041 libdir=
12042 if test -f "$lib"; then
12043 func_source "$lib"
12044 fi
12045 libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
12046 if test -n "$libdir" && test ! -f "$libfile"; then
12047 func_warning "\`$lib' has not been installed in \`$libdir'"
12048 finalize=no
12049 fi
12050 done
12051
12052 relink_command=
12053 func_source "$wrapper"
12054
12055 outputname=
12056 if test "$fast_install" = no && test -n "$relink_command"; then
12057 $opt_dry_run || {
12058 if test "$finalize" = yes; then
12059 tmpdir=`func_mktempdir`
12060 func_basename "$file$stripped_ext"
12061 file="$func_basename_result"
12062 outputname="$tmpdir/$file"
12063 # Replace the output file specification.
12064 relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
12065
12066 $opt_silent || {
12067 func_quote_for_expand "$relink_command"
12068 eval "func_echo $func_quote_for_expand_result"
12069 }
12070 if eval "$relink_command"; then :
12071 else
12072 func_error "error: relink \`$file' with the above command before installing it"
12073 $opt_dry_run || ${RM}r "$tmpdir"
12074 continue
12075 fi
12076 file="$outputname"
12077 else
12078 func_warning "cannot relink \`$file'"
12079 fi
12080 }
12081 else
12082 # Install the binary that we compiled earlier.
12083 file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
12084 fi
12085 fi
12086
12087 # remove .exe since cygwin /usr/bin/install will append another
12088 # one anyway
12089 case $install_prog,$host in
12090 */usr/bin/install*,*cygwin*)
12091 case $file:$destfile in
12092 *.exe:*.exe)
12093 # this is ok
12094 ;;
12095 *.exe:*)
12096 destfile=$destfile.exe
12097 ;;
12098 *:*.exe)
12099 func_stripname '' '.exe' "$destfile"
12100 destfile=$func_stripname_result
12101 ;;
12102 esac
12103 ;;
12104 esac
12105 func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
12106 $opt_dry_run || if test -n "$outputname"; then
12107 ${RM}r "$tmpdir"
12108 fi
12109 ;;
12110 esac
12111 done
12112
12113 for file in $staticlibs; do
12114 func_basename "$file"
12115 name="$func_basename_result"
12116
12117 # Set up the ranlib parameters.
12118 oldlib="$destdir/$name"
12119
12120 func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
12121
12122 if test -n "$stripme" && test -n "$old_striplib"; then
12123 func_show_eval "$old_striplib $oldlib" 'exit $?'
12124 fi
12125
12126 # Do each command in the postinstall commands.
12127 func_execute_cmds "$old_postinstall_cmds" 'exit $?'
12128 done
12129
12130 test -n "$future_libdirs" && \
12131 func_warning "remember to run \`$progname --finish$future_libdirs'"
12132
12133 if test -n "$current_libdirs"; then
12134 # Maybe just do a dry run.
12135 $opt_dry_run && current_libdirs=" -n$current_libdirs"
12136 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
12137 else
12138 exit $EXIT_SUCCESS
12139 fi
12140}
12141
12142test "$mode" = install && func_mode_install ${1+"$@"}
12143
12144
12145# func_generate_dlsyms outputname originator pic_p
12146# Extract symbols from dlprefiles and create ${outputname}S.o with
12147# a dlpreopen symbol table.
12148func_generate_dlsyms ()
12149{
12150 $opt_debug
12151 my_outputname="$1"
12152 my_originator="$2"
12153 my_pic_p="${3-no}"
12154 my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
12155 my_dlsyms=
12156
12157 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
12158 if test -n "$NM" && test -n "$global_symbol_pipe"; then
12159 my_dlsyms="${my_outputname}S.c"
12160 else
12161 func_error "not configured to extract global symbols from dlpreopened files"
12162 fi
12163 fi
12164
12165 if test -n "$my_dlsyms"; then
12166 case $my_dlsyms in
12167 "") ;;
12168 *.c)
12169 # Discover the nlist of each of the dlfiles.
12170 nlist="$output_objdir/${my_outputname}.nm"
12171
12172 func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
12173
12174 # Parse the name list into a source file.
12175 func_verbose "creating $output_objdir/$my_dlsyms"
12176
12177 $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
12178/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
12179/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
12180
12181#ifdef __cplusplus
12182extern \"C\" {
12183#endif
12184
12185#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
12186#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
12187#endif
12188
12189/* External symbol declarations for the compiler. */\
12190"
12191
12192 if test "$dlself" = yes; then
12193 func_verbose "generating symbol list for \`$output'"
12194
12195 $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
12196
12197 # Add our own program objects to the symbol list.
12198 progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
12199 for progfile in $progfiles; do
12200 func_verbose "extracting global C symbols from \`$progfile'"
12201 $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
12202 done
12203
12204 if test -n "$exclude_expsyms"; then
12205 $opt_dry_run || {
12206 eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
12207 eval '$MV "$nlist"T "$nlist"'
12208 }
12209 fi
12210
12211 if test -n "$export_symbols_regex"; then
12212 $opt_dry_run || {
12213 eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
12214 eval '$MV "$nlist"T "$nlist"'
12215 }
12216 fi
12217
12218 # Prepare the list of exported symbols
12219 if test -z "$export_symbols"; then
12220 export_symbols="$output_objdir/$outputname.exp"
12221 $opt_dry_run || {
12222 $RM $export_symbols
12223 eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
12224 case $host in
12225 *cygwin* | *mingw* | *cegcc* )
12226 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
12227 eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
12228 ;;
12229 esac
12230 }
12231 else
12232 $opt_dry_run || {
12233 eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
12234 eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
12235 eval '$MV "$nlist"T "$nlist"'
12236 case $host in
12237 *cygwin* | *mingw* | *cegcc* )
12238 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
12239 eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
12240 ;;
12241 esac
12242 }
12243 fi
12244 fi
12245
12246 for dlprefile in $dlprefiles; do
12247 func_verbose "extracting global C symbols from \`$dlprefile'"
12248 func_basename "$dlprefile"
12249 name="$func_basename_result"
12250 $opt_dry_run || {
12251 eval '$ECHO ": $name " >> "$nlist"'
12252 eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
12253 }
12254 done
12255
12256 $opt_dry_run || {
12257 # Make sure we have at least an empty file.
12258 test -f "$nlist" || : > "$nlist"
12259
12260 if test -n "$exclude_expsyms"; then
12261 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
12262 $MV "$nlist"T "$nlist"
12263 fi
12264
12265 # Try sorting and uniquifying the output.
12266 if $GREP -v "^: " < "$nlist" |
12267 if sort -k 3 </dev/null >/dev/null 2>&1; then
12268 sort -k 3
12269 else
12270 sort +2
12271 fi |
12272 uniq > "$nlist"S; then
12273 :
12274 else
12275 $GREP -v "^: " < "$nlist" > "$nlist"S
12276 fi
12277
12278 if test -f "$nlist"S; then
12279 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
12280 else
12281 echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
12282 fi
12283
12284 echo >> "$output_objdir/$my_dlsyms" "\
12285
12286/* The mapping between symbol names and symbols. */
12287typedef struct {
12288 const char *name;
12289 void *address;
12290} lt_dlsymlist;
12291"
12292 case $host in
12293 *cygwin* | *mingw* | *cegcc* )
12294 echo >> "$output_objdir/$my_dlsyms" "\
12295/* DATA imports from DLLs on WIN32 con't be const, because
12296 runtime relocations are performed -- see ld's documentation
12297 on pseudo-relocs. */"
12298 lt_dlsym_const= ;;
12299 *osf5*)
12300 echo >> "$output_objdir/$my_dlsyms" "\
12301/* This system does not cope well with relocations in const data */"
12302 lt_dlsym_const= ;;
12303 *)
12304 lt_dlsym_const=const ;;
12305 esac
12306
12307 echo >> "$output_objdir/$my_dlsyms" "\
12308extern $lt_dlsym_const lt_dlsymlist
12309lt_${my_prefix}_LTX_preloaded_symbols[];
12310$lt_dlsym_const lt_dlsymlist
12311lt_${my_prefix}_LTX_preloaded_symbols[] =
12312{\
12313 { \"$my_originator\", (void *) 0 },"
12314
12315 case $need_lib_prefix in
12316 no)
12317 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
12318 ;;
12319 *)
12320 eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
12321 ;;
12322 esac
12323 echo >> "$output_objdir/$my_dlsyms" "\
12324 {0, (void *) 0}
12325};
12326
12327/* This works around a problem in FreeBSD linker */
12328#ifdef FREEBSD_WORKAROUND
12329static const void *lt_preloaded_setup() {
12330 return lt_${my_prefix}_LTX_preloaded_symbols;
12331}
12332#endif
12333
12334#ifdef __cplusplus
12335}
12336#endif\
12337"
12338 } # !$opt_dry_run
12339
12340 pic_flag_for_symtable=
12341 case "$compile_command " in
12342 *" -static "*) ;;
12343 *)
12344 case $host in
12345 # compiling the symbol table file with pic_flag works around
12346 # a FreeBSD bug that causes programs to crash when -lm is
12347 # linked before any other PIC object. But we must not use
12348 # pic_flag when linking with -static. The problem exists in
12349 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
12350 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
12351 pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
12352 *-*-hpux*)
12353 pic_flag_for_symtable=" $pic_flag" ;;
12354 *)
12355 if test "X$my_pic_p" != Xno; then
12356 pic_flag_for_symtable=" $pic_flag"
12357 fi
12358 ;;
12359 esac
12360 ;;
12361 esac
12362 symtab_cflags=
12363 for arg in $LTCFLAGS; do
12364 case $arg in
12365 -pie | -fpie | -fPIE) ;;
12366 *) symtab_cflags="$symtab_cflags $arg" ;;
12367 esac
12368 done
12369
12370 # Now compile the dynamic symbol file.
12371 func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
12372
12373 # Clean up the generated files.
12374 func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
12375
12376 # Transform the symbol file into the correct name.
12377 symfileobj="$output_objdir/${my_outputname}S.$objext"
12378 case $host in
12379 *cygwin* | *mingw* | *cegcc* )
12380 if test -f "$output_objdir/$my_outputname.def"; then
12381 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
12382 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
12383 else
12384 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
12385 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
12386 fi
12387 ;;
12388 *)
12389 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
12390 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
12391 ;;
12392 esac
12393 ;;
12394 *)
12395 func_fatal_error "unknown suffix for \`$my_dlsyms'"
12396 ;;
12397 esac
12398 else
12399 # We keep going just in case the user didn't refer to
12400 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
12401 # really was required.
12402
12403 # Nullify the symbol file.
12404 compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
12405 finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
12406 fi
12407}
12408
12409# func_win32_libid arg
12410# return the library type of file 'arg'
12411#
12412# Need a lot of goo to handle *both* DLLs and import libs
12413# Has to be a shell function in order to 'eat' the argument
12414# that is supplied when $file_magic_command is called.
12415# Despite the name, also deal with 64 bit binaries.
12416func_win32_libid ()
12417{
12418 $opt_debug
12419 win32_libid_type="unknown"
12420 win32_fileres=`file -L $1 2>/dev/null`
12421 case $win32_fileres in
12422 *ar\ archive\ import\ library*) # definitely import
12423 win32_libid_type="x86 archive import"
12424 ;;
12425 *ar\ archive*) # could be an import, or static
12426 # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
12427 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
12428 $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
12429 win32_nmres=`eval $NM -f posix -A $1 |
12430 $SED -n -e '
12431 1,100{
12432 / I /{
12433 s,.*,import,
12434 p
12435 q
12436 }
12437 }'`
12438 case $win32_nmres in
12439 import*) win32_libid_type="x86 archive import";;
12440 *) win32_libid_type="x86 archive static";;
12441 esac
12442 fi
12443 ;;
12444 *DLL*)
12445 win32_libid_type="x86 DLL"
12446 ;;
12447 *executable*) # but shell scripts are "executable" too...
12448 case $win32_fileres in
12449 *MS\ Windows\ PE\ Intel*)
12450 win32_libid_type="x86 DLL"
12451 ;;
12452 esac
12453 ;;
12454 esac
12455 $ECHO "$win32_libid_type"
12456}
12457
12458
12459
12460# func_extract_an_archive dir oldlib
12461func_extract_an_archive ()
12462{
12463 $opt_debug
12464 f_ex_an_ar_dir="$1"; shift
12465 f_ex_an_ar_oldlib="$1"
12466 if test "$lock_old_archive_extraction" = yes; then
12467 lockfile=$f_ex_an_ar_oldlib.lock
12468 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
12469 func_echo "Waiting for $lockfile to be removed"
12470 sleep 2
12471 done
12472 fi
12473 func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
12474 'stat=$?; rm -f "$lockfile"; exit $stat'
12475 if test "$lock_old_archive_extraction" = yes; then
12476 $opt_dry_run || rm -f "$lockfile"
12477 fi
12478 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
12479 :
12480 else
12481 func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
12482 fi
12483}
12484
12485
12486# func_extract_archives gentop oldlib ...
12487func_extract_archives ()
12488{
12489 $opt_debug
12490 my_gentop="$1"; shift
12491 my_oldlibs=${1+"$@"}
12492 my_oldobjs=""
12493 my_xlib=""
12494 my_xabs=""
12495 my_xdir=""
12496
12497 for my_xlib in $my_oldlibs; do
12498 # Extract the objects.
12499 case $my_xlib in
12500 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
12501 *) my_xabs=`pwd`"/$my_xlib" ;;
12502 esac
12503 func_basename "$my_xlib"
12504 my_xlib="$func_basename_result"
12505 my_xlib_u=$my_xlib
12506 while :; do
12507 case " $extracted_archives " in
12508 *" $my_xlib_u "*)
12509 func_arith $extracted_serial + 1
12510 extracted_serial=$func_arith_result
12511 my_xlib_u=lt$extracted_serial-$my_xlib ;;
12512 *) break ;;
12513 esac
12514 done
12515 extracted_archives="$extracted_archives $my_xlib_u"
12516 my_xdir="$my_gentop/$my_xlib_u"
12517
12518 func_mkdir_p "$my_xdir"
12519
12520 case $host in
12521 *-darwin*)
12522 func_verbose "Extracting $my_xabs"
12523 # Do not bother doing anything if just a dry run
12524 $opt_dry_run || {
12525 darwin_orig_dir=`pwd`
12526 cd $my_xdir || exit $?
12527 darwin_archive=$my_xabs
12528 darwin_curdir=`pwd`
12529 darwin_base_archive=`basename "$darwin_archive"`
12530 darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
12531 if test -n "$darwin_arches"; then
12532 darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
12533 darwin_arch=
12534 func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
12535 for darwin_arch in $darwin_arches ; do
12536 func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
12537 $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
12538 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
12539 func_extract_an_archive "`pwd`" "${darwin_base_archive}"
12540 cd "$darwin_curdir"
12541 $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
12542 done # $darwin_arches
12543 ## Okay now we've a bunch of thin objects, gotta fatten them up :)
12544 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
12545 darwin_file=
12546 darwin_files=
12547 for darwin_file in $darwin_filelist; do
12548 darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
12549 $LIPO -create -output "$darwin_file" $darwin_files
12550 done # $darwin_filelist
12551 $RM -rf unfat-$$
12552 cd "$darwin_orig_dir"
12553 else
12554 cd $darwin_orig_dir
12555 func_extract_an_archive "$my_xdir" "$my_xabs"
12556 fi # $darwin_arches
12557 } # !$opt_dry_run
12558 ;;
12559 *)
12560 func_extract_an_archive "$my_xdir" "$my_xabs"
12561 ;;
12562 esac
12563 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
12564 done
12565
12566 func_extract_archives_result="$my_oldobjs"
12567}
12568
12569
12570# func_emit_wrapper [arg=no]
12571#
12572# Emit a libtool wrapper script on stdout.
12573# Don't directly open a file because we may want to
12574# incorporate the script contents within a cygwin/mingw
12575# wrapper executable. Must ONLY be called from within
12576# func_mode_link because it depends on a number of variables
12577# set therein.
12578#
12579# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
12580# variable will take. If 'yes', then the emitted script
12581# will assume that the directory in which it is stored is
12582# the $objdir directory. This is a cygwin/mingw-specific
12583# behavior.
12584func_emit_wrapper ()
12585{
12586 func_emit_wrapper_arg1=${1-no}
12587
12588 $ECHO "\
12589#! $SHELL
12590
12591# $output - temporary wrapper script for $objdir/$outputname
12592# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
12593#
12594# The $output program cannot be directly executed until all the libtool
12595# libraries that it depends on are installed.
12596#
12597# This wrapper script should never be moved out of the build directory.
12598# If it is, it will not operate correctly.
12599
12600# Sed substitution that helps us do robust quoting. It backslashifies
12601# metacharacters that are still active within double-quoted strings.
12602sed_quote_subst='$sed_quote_subst'
12603
12604# Be Bourne compatible
12605if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
12606 emulate sh
12607 NULLCMD=:
12608 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
12609 # is contrary to our usage. Disable this feature.
12610 alias -g '\${1+\"\$@\"}'='\"\$@\"'
12611 setopt NO_GLOB_SUBST
12612else
12613 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
12614fi
12615BIN_SH=xpg4; export BIN_SH # for Tru64
12616DUALCASE=1; export DUALCASE # for MKS sh
12617
12618# The HP-UX ksh and POSIX shell print the target directory to stdout
12619# if CDPATH is set.
12620(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
12621
12622relink_command=\"$relink_command\"
12623
12624# This environment variable determines our operation mode.
12625if test \"\$libtool_install_magic\" = \"$magic\"; then
12626 # install mode needs the following variables:
12627 generated_by_libtool_version='$macro_version'
12628 notinst_deplibs='$notinst_deplibs'
12629else
12630 # When we are sourced in execute mode, \$file and \$ECHO are already set.
12631 if test \"\$libtool_execute_magic\" != \"$magic\"; then
12632 file=\"\$0\""
12633
12634 qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
12635 $ECHO "\
12636
12637# A function that is used when there is no print builtin or printf.
12638func_fallback_echo ()
12639{
12640 eval 'cat <<_LTECHO_EOF
12641\$1
12642_LTECHO_EOF'
12643}
12644 ECHO=\"$qECHO\"
12645 fi
12646
12647# Very basic option parsing. These options are (a) specific to
12648# the libtool wrapper, (b) are identical between the wrapper
12649# /script/ and the wrapper /executable/ which is used only on
12650# windows platforms, and (c) all begin with the string "--lt-"
12651# (application programs are unlikely to have options which match
12652# this pattern).
12653#
12654# There are only two supported options: --lt-debug and
12655# --lt-dump-script. There is, deliberately, no --lt-help.
12656#
12657# The first argument to this parsing function should be the
12658# script's $0 value, followed by "$@".
12659lt_option_debug=
12660func_parse_lt_options ()
12661{
12662 lt_script_arg0=\$0
12663 shift
12664 for lt_opt
12665 do
12666 case \"\$lt_opt\" in
12667 --lt-debug) lt_option_debug=1 ;;
12668 --lt-dump-script)
12669 lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
12670 test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
12671 lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
12672 cat \"\$lt_dump_D/\$lt_dump_F\"
12673 exit 0
12674 ;;
12675 --lt-*)
12676 \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
12677 exit 1
12678 ;;
12679 esac
12680 done
12681
12682 # Print the debug banner immediately:
12683 if test -n \"\$lt_option_debug\"; then
12684 echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
12685 fi
12686}
12687
12688# Used when --lt-debug. Prints its arguments to stdout
12689# (redirection is the responsibility of the caller)
12690func_lt_dump_args ()
12691{
12692 lt_dump_args_N=1;
12693 for lt_arg
12694 do
12695 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
12696 lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
12697 done
12698}
12699
12700# Core function for launching the target application
12701func_exec_program_core ()
12702{
12703"
12704 case $host in
12705 # Backslashes separate directories on plain windows
12706 *-*-mingw | *-*-os2* | *-cegcc*)
12707 $ECHO "\
12708 if test -n \"\$lt_option_debug\"; then
12709 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
12710 func_lt_dump_args \${1+\"\$@\"} 1>&2
12711 fi
12712 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
12713"
12714 ;;
12715
12716 *)
12717 $ECHO "\
12718 if test -n \"\$lt_option_debug\"; then
12719 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
12720 func_lt_dump_args \${1+\"\$@\"} 1>&2
12721 fi
12722 exec \"\$progdir/\$program\" \${1+\"\$@\"}
12723"
12724 ;;
12725 esac
12726 $ECHO "\
12727 \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
12728 exit 1
12729}
12730
12731# A function to encapsulate launching the target application
12732# Strips options in the --lt-* namespace from \$@ and
12733# launches target application with the remaining arguments.
12734func_exec_program ()
12735{
12736 for lt_wr_arg
12737 do
12738 case \$lt_wr_arg in
12739 --lt-*) ;;
12740 *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
12741 esac
12742 shift
12743 done
12744 func_exec_program_core \${1+\"\$@\"}
12745}
12746
12747 # Parse options
12748 func_parse_lt_options \"\$0\" \${1+\"\$@\"}
12749
12750 # Find the directory that this script lives in.
12751 thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
12752 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
12753
12754 # Follow symbolic links until we get to the real thisdir.
12755 file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
12756 while test -n \"\$file\"; do
12757 destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
12758
12759 # If there was a directory component, then change thisdir.
12760 if test \"x\$destdir\" != \"x\$file\"; then
12761 case \"\$destdir\" in
12762 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
12763 *) thisdir=\"\$thisdir/\$destdir\" ;;
12764 esac
12765 fi
12766
12767 file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
12768 file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
12769 done
12770
12771 # Usually 'no', except on cygwin/mingw when embedded into
12772 # the cwrapper.
12773 WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
12774 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
12775 # special case for '.'
12776 if test \"\$thisdir\" = \".\"; then
12777 thisdir=\`pwd\`
12778 fi
12779 # remove .libs from thisdir
12780 case \"\$thisdir\" in
12781 *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
12782 $objdir ) thisdir=. ;;
12783 esac
12784 fi
12785
12786 # Try to get the absolute directory name.
12787 absdir=\`cd \"\$thisdir\" && pwd\`
12788 test -n \"\$absdir\" && thisdir=\"\$absdir\"
12789"
12790
12791 if test "$fast_install" = yes; then
12792 $ECHO "\
12793 program=lt-'$outputname'$exeext
12794 progdir=\"\$thisdir/$objdir\"
12795
12796 if test ! -f \"\$progdir/\$program\" ||
12797 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
12798 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
12799
12800 file=\"\$\$-\$program\"
12801
12802 if test ! -d \"\$progdir\"; then
12803 $MKDIR \"\$progdir\"
12804 else
12805 $RM \"\$progdir/\$file\"
12806 fi"
12807
12808 $ECHO "\
12809
12810 # relink executable if necessary
12811 if test -n \"\$relink_command\"; then
12812 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
12813 else
12814 $ECHO \"\$relink_command_output\" >&2
12815 $RM \"\$progdir/\$file\"
12816 exit 1
12817 fi
12818 fi
12819
12820 $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
12821 { $RM \"\$progdir/\$program\";
12822 $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
12823 $RM \"\$progdir/\$file\"
12824 fi"
12825 else
12826 $ECHO "\
12827 program='$outputname'
12828 progdir=\"\$thisdir/$objdir\"
12829"
12830 fi
12831
12832 $ECHO "\
12833
12834 if test -f \"\$progdir/\$program\"; then"
12835
12836 # Export our shlibpath_var if we have one.
12837 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
12838 $ECHO "\
12839 # Add our own library path to $shlibpath_var
12840 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
12841
12842 # Some systems cannot cope with colon-terminated $shlibpath_var
12843 # The second colon is a workaround for a bug in BeOS R4 sed
12844 $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
12845
12846 export $shlibpath_var
12847"
12848 fi
12849
12850 # fixup the dll searchpath if we need to.
12851 if test -n "$dllsearchpath"; then
12852 $ECHO "\
12853 # Add the dll search path components to the executable PATH
12854 PATH=$dllsearchpath:\$PATH
12855"
12856 fi
12857
12858 $ECHO "\
12859 if test \"\$libtool_execute_magic\" != \"$magic\"; then
12860 # Run the actual program with our arguments.
12861 func_exec_program \${1+\"\$@\"}
12862 fi
12863 else
12864 # The program doesn't exist.
12865 \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
12866 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
12867 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
12868 exit 1
12869 fi
12870fi\
12871"
12872}
12873
12874
12875# func_to_host_path arg
12876#
12877# Convert paths to host format when used with build tools.
12878# Intended for use with "native" mingw (where libtool itself
12879# is running under the msys shell), or in the following cross-
12880# build environments:
12881# $build $host
12882# mingw (msys) mingw [e.g. native]
12883# cygwin mingw
12884# *nix + wine mingw
12885# where wine is equipped with the `winepath' executable.
12886# In the native mingw case, the (msys) shell automatically
12887# converts paths for any non-msys applications it launches,
12888# but that facility isn't available from inside the cwrapper.
12889# Similar accommodations are necessary for $host mingw and
12890# $build cygwin. Calling this function does no harm for other
12891# $host/$build combinations not listed above.
12892#
12893# ARG is the path (on $build) that should be converted to
12894# the proper representation for $host. The result is stored
12895# in $func_to_host_path_result.
12896func_to_host_path ()
12897{
12898 func_to_host_path_result="$1"
12899 if test -n "$1"; then
12900 case $host in
12901 *mingw* )
12902 lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
12903 case $build in
12904 *mingw* ) # actually, msys
12905 # awkward: cmd appends spaces to result
12906 func_to_host_path_result=`( cmd //c echo "$1" ) 2>/dev/null |
12907 $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
12908 ;;
12909 *cygwin* )
12910 func_to_host_path_result=`cygpath -w "$1" |
12911 $SED -e "$lt_sed_naive_backslashify"`
12912 ;;
12913 * )
12914 # Unfortunately, winepath does not exit with a non-zero
12915 # error code, so we are forced to check the contents of
12916 # stdout. On the other hand, if the command is not
12917 # found, the shell will set an exit code of 127 and print
12918 # *an error message* to stdout. So we must check for both
12919 # error code of zero AND non-empty stdout, which explains
12920 # the odd construction:
12921 func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
12922 if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
12923 func_to_host_path_result=`$ECHO "$func_to_host_path_tmp1" |
12924 $SED -e "$lt_sed_naive_backslashify"`
12925 else
12926 # Allow warning below.
12927 func_to_host_path_result=
12928 fi
12929 ;;
12930 esac
12931 if test -z "$func_to_host_path_result" ; then
12932 func_error "Could not determine host path corresponding to"
12933 func_error " \`$1'"
12934 func_error "Continuing, but uninstalled executables may not work."
12935 # Fallback:
12936 func_to_host_path_result="$1"
12937 fi
12938 ;;
12939 esac
12940 fi
12941}
12942# end: func_to_host_path
12943
12944# func_to_host_pathlist arg
12945#
12946# Convert pathlists to host format when used with build tools.
12947# See func_to_host_path(), above. This function supports the
12948# following $build/$host combinations (but does no harm for
12949# combinations not listed here):
12950# $build $host
12951# mingw (msys) mingw [e.g. native]
12952# cygwin mingw
12953# *nix + wine mingw
12954#
12955# Path separators are also converted from $build format to
12956# $host format. If ARG begins or ends with a path separator
12957# character, it is preserved (but converted to $host format)
12958# on output.
12959#
12960# ARG is a pathlist (on $build) that should be converted to
12961# the proper representation on $host. The result is stored
12962# in $func_to_host_pathlist_result.
12963func_to_host_pathlist ()
12964{
12965 func_to_host_pathlist_result="$1"
12966 if test -n "$1"; then
12967 case $host in
12968 *mingw* )
12969 lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
12970 # Remove leading and trailing path separator characters from
12971 # ARG. msys behavior is inconsistent here, cygpath turns them
12972 # into '.;' and ';.', and winepath ignores them completely.
12973 func_stripname : : "$1"
12974 func_to_host_pathlist_tmp1=$func_stripname_result
12975 case $build in
12976 *mingw* ) # Actually, msys.
12977 # Awkward: cmd appends spaces to result.
12978 func_to_host_pathlist_result=`
12979 ( cmd //c echo "$func_to_host_pathlist_tmp1" ) 2>/dev/null |
12980 $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
12981 ;;
12982 *cygwin* )
12983 func_to_host_pathlist_result=`cygpath -w -p "$func_to_host_pathlist_tmp1" |
12984 $SED -e "$lt_sed_naive_backslashify"`
12985 ;;
12986 * )
12987 # unfortunately, winepath doesn't convert pathlists
12988 func_to_host_pathlist_result=""
12989 func_to_host_pathlist_oldIFS=$IFS
12990 IFS=:
12991 for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
12992 IFS=$func_to_host_pathlist_oldIFS
12993 if test -n "$func_to_host_pathlist_f" ; then
12994 func_to_host_path "$func_to_host_pathlist_f"
12995 if test -n "$func_to_host_path_result" ; then
12996 if test -z "$func_to_host_pathlist_result" ; then
12997 func_to_host_pathlist_result="$func_to_host_path_result"
12998 else
12999 func_append func_to_host_pathlist_result ";$func_to_host_path_result"
13000 fi
13001 fi
13002 fi
13003 done
13004 IFS=$func_to_host_pathlist_oldIFS
13005 ;;
13006 esac
13007 if test -z "$func_to_host_pathlist_result"; then
13008 func_error "Could not determine the host path(s) corresponding to"
13009 func_error " \`$1'"
13010 func_error "Continuing, but uninstalled executables may not work."
13011 # Fallback. This may break if $1 contains DOS-style drive
13012 # specifications. The fix is not to complicate the expression
13013 # below, but for the user to provide a working wine installation
13014 # with winepath so that path translation in the cross-to-mingw
13015 # case works properly.
13016 lt_replace_pathsep_nix_to_dos="s|:|;|g"
13017 func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
13018 $SED -e "$lt_replace_pathsep_nix_to_dos"`
13019 fi
13020 # Now, add the leading and trailing path separators back
13021 case "$1" in
13022 :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
13023 ;;
13024 esac
13025 case "$1" in
13026 *: ) func_append func_to_host_pathlist_result ";"
13027 ;;
13028 esac
13029 ;;
13030 esac
13031 fi
13032}
13033# end: func_to_host_pathlist
13034
13035# func_emit_cwrapperexe_src
13036# emit the source code for a wrapper executable on stdout
13037# Must ONLY be called from within func_mode_link because
13038# it depends on a number of variable set therein.
13039func_emit_cwrapperexe_src ()
13040{
13041 cat <<EOF
13042
13043/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
13044 Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
13045
13046 The $output program cannot be directly executed until all the libtool
13047 libraries that it depends on are installed.
13048
13049 This wrapper executable should never be moved out of the build directory.
13050 If it is, it will not operate correctly.
13051*/
13052EOF
13053 cat <<"EOF"
13054#ifdef _MSC_VER
13055# define _CRT_SECURE_NO_DEPRECATE 1
13056#endif
13057#include <stdio.h>
13058#include <stdlib.h>
13059#ifdef _MSC_VER
13060# include <direct.h>
13061# include <process.h>
13062# include <io.h>
13063#else
13064# include <unistd.h>
13065# include <stdint.h>
13066# ifdef __CYGWIN__
13067# include <io.h>
13068# endif
13069#endif
13070#include <malloc.h>
13071#include <stdarg.h>
13072#include <assert.h>
13073#include <string.h>
13074#include <ctype.h>
13075#include <errno.h>
13076#include <fcntl.h>
13077#include <sys/stat.h>
13078
13079/* declarations of non-ANSI functions */
13080#if defined(__MINGW32__)
13081# ifdef __STRICT_ANSI__
13082int _putenv (const char *);
13083# endif
13084#elif defined(__CYGWIN__)
13085# ifdef __STRICT_ANSI__
13086char *realpath (const char *, char *);
13087int putenv (char *);
13088int setenv (const char *, const char *, int);
13089# endif
13090/* #elif defined (other platforms) ... */
13091#endif
13092
13093/* portability defines, excluding path handling macros */
13094#if defined(_MSC_VER)
13095# define setmode _setmode
13096# define stat _stat
13097# define chmod _chmod
13098# define getcwd _getcwd
13099# define putenv _putenv
13100# define S_IXUSR _S_IEXEC
13101# ifndef _INTPTR_T_DEFINED
13102# define _INTPTR_T_DEFINED
13103# define intptr_t int
13104# endif
13105#elif defined(__MINGW32__)
13106# define setmode _setmode
13107# define stat _stat
13108# define chmod _chmod
13109# define getcwd _getcwd
13110# define putenv _putenv
13111#elif defined(__CYGWIN__)
13112# define HAVE_SETENV
13113# define FOPEN_WB "wb"
13114/* #elif defined (other platforms) ... */
13115#endif
13116
13117#if defined(PATH_MAX)
13118# define LT_PATHMAX PATH_MAX
13119#elif defined(MAXPATHLEN)
13120# define LT_PATHMAX MAXPATHLEN
13121#else
13122# define LT_PATHMAX 1024
13123#endif
13124
13125#ifndef S_IXOTH
13126# define S_IXOTH 0
13127#endif
13128#ifndef S_IXGRP
13129# define S_IXGRP 0
13130#endif
13131
13132/* path handling portability macros */
13133#ifndef DIR_SEPARATOR
13134# define DIR_SEPARATOR '/'
13135# define PATH_SEPARATOR ':'
13136#endif
13137
13138#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
13139 defined (__OS2__)
13140# define HAVE_DOS_BASED_FILE_SYSTEM
13141# define FOPEN_WB "wb"
13142# ifndef DIR_SEPARATOR_2
13143# define DIR_SEPARATOR_2 '\\'
13144# endif
13145# ifndef PATH_SEPARATOR_2
13146# define PATH_SEPARATOR_2 ';'
13147# endif
13148#endif
13149
13150#ifndef DIR_SEPARATOR_2
13151# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
13152#else /* DIR_SEPARATOR_2 */
13153# define IS_DIR_SEPARATOR(ch) \
13154 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
13155#endif /* DIR_SEPARATOR_2 */
13156
13157#ifndef PATH_SEPARATOR_2
13158# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
13159#else /* PATH_SEPARATOR_2 */
13160# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
13161#endif /* PATH_SEPARATOR_2 */
13162
13163#ifndef FOPEN_WB
13164# define FOPEN_WB "w"
13165#endif
13166#ifndef _O_BINARY
13167# define _O_BINARY 0
13168#endif
13169
13170#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
13171#define XFREE(stale) do { \
13172 if (stale) { free ((void *) stale); stale = 0; } \
13173} while (0)
13174
13175#if defined(LT_DEBUGWRAPPER)
13176static int lt_debug = 1;
13177#else
13178static int lt_debug = 0;
13179#endif
13180
13181const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
13182
13183void *xmalloc (size_t num);
13184char *xstrdup (const char *string);
13185const char *base_name (const char *name);
13186char *find_executable (const char *wrapper);
13187char *chase_symlinks (const char *pathspec);
13188int make_executable (const char *path);
13189int check_executable (const char *path);
13190char *strendzap (char *str, const char *pat);
13191void lt_debugprintf (const char *file, int line, const char *fmt, ...);
13192void lt_fatal (const char *file, int line, const char *message, ...);
13193static const char *nonnull (const char *s);
13194static const char *nonempty (const char *s);
13195void lt_setenv (const char *name, const char *value);
13196char *lt_extend_str (const char *orig_value, const char *add, int to_end);
13197void lt_update_exe_path (const char *name, const char *value);
13198void lt_update_lib_path (const char *name, const char *value);
13199char **prepare_spawn (char **argv);
13200void lt_dump_script (FILE *f);
13201EOF
13202
13203 cat <<EOF
13204const char * MAGIC_EXE = "$magic_exe";
13205const char * LIB_PATH_VARNAME = "$shlibpath_var";
13206EOF
13207
13208 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
13209 func_to_host_pathlist "$temp_rpath"
13210 cat <<EOF
13211const char * LIB_PATH_VALUE = "$func_to_host_pathlist_result";
13212EOF
13213 else
13214 cat <<"EOF"
13215const char * LIB_PATH_VALUE = "";
13216EOF
13217 fi
13218
13219 if test -n "$dllsearchpath"; then
13220 func_to_host_pathlist "$dllsearchpath:"
13221 cat <<EOF
13222const char * EXE_PATH_VARNAME = "PATH";
13223const char * EXE_PATH_VALUE = "$func_to_host_pathlist_result";
13224EOF
13225 else
13226 cat <<"EOF"
13227const char * EXE_PATH_VARNAME = "";
13228const char * EXE_PATH_VALUE = "";
13229EOF
13230 fi
13231
13232 if test "$fast_install" = yes; then
13233 cat <<EOF
13234const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
13235EOF
13236 else
13237 cat <<EOF
13238const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
13239EOF
13240 fi
13241
13242
13243 cat <<"EOF"
13244
13245#define LTWRAPPER_OPTION_PREFIX "--lt-"
13246
13247static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
13248static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
13249static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
13250
13251int
13252main (int argc, char *argv[])
13253{
13254 char **newargz;
13255 int newargc;
13256 char *tmp_pathspec;
13257 char *actual_cwrapper_path;
13258 char *actual_cwrapper_name;
13259 char *target_name;
13260 char *lt_argv_zero;
13261 intptr_t rval = 127;
13262
13263 int i;
13264
13265 program_name = (char *) xstrdup (base_name (argv[0]));
13266 newargz = XMALLOC (char *, argc + 1);
13267
13268 /* very simple arg parsing; don't want to rely on getopt
13269 * also, copy all non cwrapper options to newargz, except
13270 * argz[0], which is handled differently
13271 */
13272 newargc=0;
13273 for (i = 1; i < argc; i++)
13274 {
13275 if (strcmp (argv[i], dumpscript_opt) == 0)
13276 {
13277EOF
13278 case "$host" in
13279 *mingw* | *cygwin* )
13280 # make stdout use "unix" line endings
13281 echo " setmode(1,_O_BINARY);"
13282 ;;
13283 esac
13284
13285 cat <<"EOF"
13286 lt_dump_script (stdout);
13287 return 0;
13288 }
13289 if (strcmp (argv[i], debug_opt) == 0)
13290 {
13291 lt_debug = 1;
13292 continue;
13293 }
13294 if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
13295 {
13296 /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
13297 namespace, but it is not one of the ones we know about and
13298 have already dealt with, above (inluding dump-script), then
13299 report an error. Otherwise, targets might begin to believe
13300 they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
13301 namespace. The first time any user complains about this, we'll
13302 need to make LTWRAPPER_OPTION_PREFIX a configure-time option
13303 or a configure.ac-settable value.
13304 */
13305 lt_fatal (__FILE__, __LINE__,
13306 "unrecognized %s option: '%s'",
13307 ltwrapper_option_prefix, argv[i]);
13308 }
13309 /* otherwise ... */
13310 newargz[++newargc] = xstrdup (argv[i]);
13311 }
13312 newargz[++newargc] = NULL;
13313
13314EOF
13315 cat <<EOF
13316 /* The GNU banner must be the first non-error debug message */
13317 lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
13318EOF
13319 cat <<"EOF"
13320 lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
13321 lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
13322
13323 tmp_pathspec = find_executable (argv[0]);
13324 if (tmp_pathspec == NULL)
13325 lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
13326 lt_debugprintf (__FILE__, __LINE__,
13327 "(main) found exe (before symlink chase) at: %s\n",
13328 tmp_pathspec);
13329
13330 actual_cwrapper_path = chase_symlinks (tmp_pathspec);
13331 lt_debugprintf (__FILE__, __LINE__,
13332 "(main) found exe (after symlink chase) at: %s\n",
13333 actual_cwrapper_path);
13334 XFREE (tmp_pathspec);
13335
13336 actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
13337 strendzap (actual_cwrapper_path, actual_cwrapper_name);
13338
13339 /* wrapper name transforms */
13340 strendzap (actual_cwrapper_name, ".exe");
13341 tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
13342 XFREE (actual_cwrapper_name);
13343 actual_cwrapper_name = tmp_pathspec;
13344 tmp_pathspec = 0;
13345
13346 /* target_name transforms -- use actual target program name; might have lt- prefix */
13347 target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
13348 strendzap (target_name, ".exe");
13349 tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
13350 XFREE (target_name);
13351 target_name = tmp_pathspec;
13352 tmp_pathspec = 0;
13353
13354 lt_debugprintf (__FILE__, __LINE__,
13355 "(main) libtool target name: %s\n",
13356 target_name);
13357EOF
13358
13359 cat <<EOF
13360 newargz[0] =
13361 XMALLOC (char, (strlen (actual_cwrapper_path) +
13362 strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
13363 strcpy (newargz[0], actual_cwrapper_path);
13364 strcat (newargz[0], "$objdir");
13365 strcat (newargz[0], "/");
13366EOF
13367
13368 cat <<"EOF"
13369 /* stop here, and copy so we don't have to do this twice */
13370 tmp_pathspec = xstrdup (newargz[0]);
13371
13372 /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
13373 strcat (newargz[0], actual_cwrapper_name);
13374
13375 /* DO want the lt- prefix here if it exists, so use target_name */
13376 lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
13377 XFREE (tmp_pathspec);
13378 tmp_pathspec = NULL;
13379EOF
13380
13381 case $host_os in
13382 mingw*)
13383 cat <<"EOF"
13384 {
13385 char* p;
13386 while ((p = strchr (newargz[0], '\\')) != NULL)
13387 {
13388 *p = '/';
13389 }
13390 while ((p = strchr (lt_argv_zero, '\\')) != NULL)
13391 {
13392 *p = '/';
13393 }
13394 }
13395EOF
13396 ;;
13397 esac
13398
13399 cat <<"EOF"
13400 XFREE (target_name);
13401 XFREE (actual_cwrapper_path);
13402 XFREE (actual_cwrapper_name);
13403
13404 lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
13405 lt_setenv ("DUALCASE", "1"); /* for MSK sh */
13406 lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
13407 lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
13408
13409 lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
13410 nonnull (lt_argv_zero));
13411 for (i = 0; i < newargc; i++)
13412 {
13413 lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
13414 i, nonnull (newargz[i]));
13415 }
13416
13417EOF
13418
13419 case $host_os in
13420 mingw*)
13421 cat <<"EOF"
13422 /* execv doesn't actually work on mingw as expected on unix */
13423 newargz = prepare_spawn (newargz);
13424 rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
13425 if (rval == -1)
13426 {
13427 /* failed to start process */
13428 lt_debugprintf (__FILE__, __LINE__,
13429 "(main) failed to launch target \"%s\": %s\n",
13430 lt_argv_zero, nonnull (strerror (errno)));
13431 return 127;
13432 }
13433 return rval;
13434EOF
13435 ;;
13436 *)
13437 cat <<"EOF"
13438 execv (lt_argv_zero, newargz);
13439 return rval; /* =127, but avoids unused variable warning */
13440EOF
13441 ;;
13442 esac
13443
13444 cat <<"EOF"
13445}
13446
13447void *
13448xmalloc (size_t num)
13449{
13450 void *p = (void *) malloc (num);
13451 if (!p)
13452 lt_fatal (__FILE__, __LINE__, "memory exhausted");
13453
13454 return p;
13455}
13456
13457char *
13458xstrdup (const char *string)
13459{
13460 return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
13461 string) : NULL;
13462}
13463
13464const char *
13465base_name (const char *name)
13466{
13467 const char *base;
13468
13469#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
13470 /* Skip over the disk name in MSDOS pathnames. */
13471 if (isalpha ((unsigned char) name[0]) && name[1] == ':')
13472 name += 2;
13473#endif
13474
13475 for (base = name; *name; name++)
13476 if (IS_DIR_SEPARATOR (*name))
13477 base = name + 1;
13478 return base;
13479}
13480
13481int
13482check_executable (const char *path)
13483{
13484 struct stat st;
13485
13486 lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
13487 nonempty (path));
13488 if ((!path) || (!*path))
13489 return 0;
13490
13491 if ((stat (path, &st) >= 0)
13492 && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
13493 return 1;
13494 else
13495 return 0;
13496}
13497
13498int
13499make_executable (const char *path)
13500{
13501 int rval = 0;
13502 struct stat st;
13503
13504 lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
13505 nonempty (path));
13506 if ((!path) || (!*path))
13507 return 0;
13508
13509 if (stat (path, &st) >= 0)
13510 {
13511 rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
13512 }
13513 return rval;
13514}
13515
13516/* Searches for the full path of the wrapper. Returns
13517 newly allocated full path name if found, NULL otherwise
13518 Does not chase symlinks, even on platforms that support them.
13519*/
13520char *
13521find_executable (const char *wrapper)
13522{
13523 int has_slash = 0;
13524 const char *p;
13525 const char *p_next;
13526 /* static buffer for getcwd */
13527 char tmp[LT_PATHMAX + 1];
13528 int tmp_len;
13529 char *concat_name;
13530
13531 lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
13532 nonempty (wrapper));
13533
13534 if ((wrapper == NULL) || (*wrapper == '\0'))
13535 return NULL;
13536
13537 /* Absolute path? */
13538#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
13539 if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
13540 {
13541 concat_name = xstrdup (wrapper);
13542 if (check_executable (concat_name))
13543 return concat_name;
13544 XFREE (concat_name);
13545 }
13546 else
13547 {
13548#endif
13549 if (IS_DIR_SEPARATOR (wrapper[0]))
13550 {
13551 concat_name = xstrdup (wrapper);
13552 if (check_executable (concat_name))
13553 return concat_name;
13554 XFREE (concat_name);
13555 }
13556#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
13557 }
13558#endif
13559
13560 for (p = wrapper; *p; p++)
13561 if (*p == '/')
13562 {
13563 has_slash = 1;
13564 break;
13565 }
13566 if (!has_slash)
13567 {
13568 /* no slashes; search PATH */
13569 const char *path = getenv ("PATH");
13570 if (path != NULL)
13571 {
13572 for (p = path; *p; p = p_next)
13573 {
13574 const char *q;
13575 size_t p_len;
13576 for (q = p; *q; q++)
13577 if (IS_PATH_SEPARATOR (*q))
13578 break;
13579 p_len = q - p;
13580 p_next = (*q == '\0' ? q : q + 1);
13581 if (p_len == 0)
13582 {
13583 /* empty path: current directory */
13584 if (getcwd (tmp, LT_PATHMAX) == NULL)
13585 lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
13586 nonnull (strerror (errno)));
13587 tmp_len = strlen (tmp);
13588 concat_name =
13589 XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
13590 memcpy (concat_name, tmp, tmp_len);
13591 concat_name[tmp_len] = '/';
13592 strcpy (concat_name + tmp_len + 1, wrapper);
13593 }
13594 else
13595 {
13596 concat_name =
13597 XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
13598 memcpy (concat_name, p, p_len);
13599 concat_name[p_len] = '/';
13600 strcpy (concat_name + p_len + 1, wrapper);
13601 }
13602 if (check_executable (concat_name))
13603 return concat_name;
13604 XFREE (concat_name);
13605 }
13606 }
13607 /* not found in PATH; assume curdir */
13608 }
13609 /* Relative path | not found in path: prepend cwd */
13610 if (getcwd (tmp, LT_PATHMAX) == NULL)
13611 lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
13612 nonnull (strerror (errno)));
13613 tmp_len = strlen (tmp);
13614 concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
13615 memcpy (concat_name, tmp, tmp_len);
13616 concat_name[tmp_len] = '/';
13617 strcpy (concat_name + tmp_len + 1, wrapper);
13618
13619 if (check_executable (concat_name))
13620 return concat_name;
13621 XFREE (concat_name);
13622 return NULL;
13623}
13624
13625char *
13626chase_symlinks (const char *pathspec)
13627{
13628#ifndef S_ISLNK
13629 return xstrdup (pathspec);
13630#else
13631 char buf[LT_PATHMAX];
13632 struct stat s;
13633 char *tmp_pathspec = xstrdup (pathspec);
13634 char *p;
13635 int has_symlinks = 0;
13636 while (strlen (tmp_pathspec) && !has_symlinks)
13637 {
13638 lt_debugprintf (__FILE__, __LINE__,
13639 "checking path component for symlinks: %s\n",
13640 tmp_pathspec);
13641 if (lstat (tmp_pathspec, &s) == 0)
13642 {
13643 if (S_ISLNK (s.st_mode) != 0)
13644 {
13645 has_symlinks = 1;
13646 break;
13647 }
13648
13649 /* search backwards for last DIR_SEPARATOR */
13650 p = tmp_pathspec + strlen (tmp_pathspec) - 1;
13651 while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
13652 p--;
13653 if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
13654 {
13655 /* no more DIR_SEPARATORS left */
13656 break;
13657 }
13658 *p = '\0';
13659 }
13660 else
13661 {
13662 lt_fatal (__FILE__, __LINE__,
13663 "error accessing file \"%s\": %s",
13664 tmp_pathspec, nonnull (strerror (errno)));
13665 }
13666 }
13667 XFREE (tmp_pathspec);
13668
13669 if (!has_symlinks)
13670 {
13671 return xstrdup (pathspec);
13672 }
13673
13674 tmp_pathspec = realpath (pathspec, buf);
13675 if (tmp_pathspec == 0)
13676 {
13677 lt_fatal (__FILE__, __LINE__,
13678 "could not follow symlinks for %s", pathspec);
13679 }
13680 return xstrdup (tmp_pathspec);
13681#endif
13682}
13683
13684char *
13685strendzap (char *str, const char *pat)
13686{
13687 size_t len, patlen;
13688
13689 assert (str != NULL);
13690 assert (pat != NULL);
13691
13692 len = strlen (str);
13693 patlen = strlen (pat);
13694
13695 if (patlen <= len)
13696 {
13697 str += len - patlen;
13698 if (strcmp (str, pat) == 0)
13699 *str = '\0';
13700 }
13701 return str;
13702}
13703
13704void
13705lt_debugprintf (const char *file, int line, const char *fmt, ...)
13706{
13707 va_list args;
13708 if (lt_debug)
13709 {
13710 (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
13711 va_start (args, fmt);
13712 (void) vfprintf (stderr, fmt, args);
13713 va_end (args);
13714 }
13715}
13716
13717static void
13718lt_error_core (int exit_status, const char *file,
13719 int line, const char *mode,
13720 const char *message, va_list ap)
13721{
13722 fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
13723 vfprintf (stderr, message, ap);
13724 fprintf (stderr, ".\n");
13725
13726 if (exit_status >= 0)
13727 exit (exit_status);
13728}
13729
13730void
13731lt_fatal (const char *file, int line, const char *message, ...)
13732{
13733 va_list ap;
13734 va_start (ap, message);
13735 lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
13736 va_end (ap);
13737}
13738
13739static const char *
13740nonnull (const char *s)
13741{
13742 return s ? s : "(null)";
13743}
13744
13745static const char *
13746nonempty (const char *s)
13747{
13748 return (s && !*s) ? "(empty)" : nonnull (s);
13749}
13750
13751void
13752lt_setenv (const char *name, const char *value)
13753{
13754 lt_debugprintf (__FILE__, __LINE__,
13755 "(lt_setenv) setting '%s' to '%s'\n",
13756 nonnull (name), nonnull (value));
13757 {
13758#ifdef HAVE_SETENV
13759 /* always make a copy, for consistency with !HAVE_SETENV */
13760 char *str = xstrdup (value);
13761 setenv (name, str, 1);
13762#else
13763 int len = strlen (name) + 1 + strlen (value) + 1;
13764 char *str = XMALLOC (char, len);
13765 sprintf (str, "%s=%s", name, value);
13766 if (putenv (str) != EXIT_SUCCESS)
13767 {
13768 XFREE (str);
13769 }
13770#endif
13771 }
13772}
13773
13774char *
13775lt_extend_str (const char *orig_value, const char *add, int to_end)
13776{
13777 char *new_value;
13778 if (orig_value && *orig_value)
13779 {
13780 int orig_value_len = strlen (orig_value);
13781 int add_len = strlen (add);
13782 new_value = XMALLOC (char, add_len + orig_value_len + 1);
13783 if (to_end)
13784 {
13785 strcpy (new_value, orig_value);
13786 strcpy (new_value + orig_value_len, add);
13787 }
13788 else
13789 {
13790 strcpy (new_value, add);
13791 strcpy (new_value + add_len, orig_value);
13792 }
13793 }
13794 else
13795 {
13796 new_value = xstrdup (add);
13797 }
13798 return new_value;
13799}
13800
13801void
13802lt_update_exe_path (const char *name, const char *value)
13803{
13804 lt_debugprintf (__FILE__, __LINE__,
13805 "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
13806 nonnull (name), nonnull (value));
13807
13808 if (name && *name && value && *value)
13809 {
13810 char *new_value = lt_extend_str (getenv (name), value, 0);
13811 /* some systems can't cope with a ':'-terminated path #' */
13812 int len = strlen (new_value);
13813 while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
13814 {
13815 new_value[len-1] = '\0';
13816 }
13817 lt_setenv (name, new_value);
13818 XFREE (new_value);
13819 }
13820}
13821
13822void
13823lt_update_lib_path (const char *name, const char *value)
13824{
13825 lt_debugprintf (__FILE__, __LINE__,
13826 "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
13827 nonnull (name), nonnull (value));
13828
13829 if (name && *name && value && *value)
13830 {
13831 char *new_value = lt_extend_str (getenv (name), value, 0);
13832 lt_setenv (name, new_value);
13833 XFREE (new_value);
13834 }
13835}
13836
13837EOF
13838 case $host_os in
13839 mingw*)
13840 cat <<"EOF"
13841
13842/* Prepares an argument vector before calling spawn().
13843 Note that spawn() does not by itself call the command interpreter
13844 (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
13845 ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
13846 GetVersionEx(&v);
13847 v.dwPlatformId == VER_PLATFORM_WIN32_NT;
13848 }) ? "cmd.exe" : "command.com").
13849 Instead it simply concatenates the arguments, separated by ' ', and calls
13850 CreateProcess(). We must quote the arguments since Win32 CreateProcess()
13851 interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
13852 special way:
13853 - Space and tab are interpreted as delimiters. They are not treated as
13854 delimiters if they are surrounded by double quotes: "...".
13855 - Unescaped double quotes are removed from the input. Their only effect is
13856 that within double quotes, space and tab are treated like normal
13857 characters.
13858 - Backslashes not followed by double quotes are not special.
13859 - But 2*n+1 backslashes followed by a double quote become
13860 n backslashes followed by a double quote (n >= 0):
13861 \" -> "
13862 \\\" -> \"
13863 \\\\\" -> \\"
13864 */
13865#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
13866#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
13867char **
13868prepare_spawn (char **argv)
13869{
13870 size_t argc;
13871 char **new_argv;
13872 size_t i;
13873
13874 /* Count number of arguments. */
13875 for (argc = 0; argv[argc] != NULL; argc++)
13876 ;
13877
13878 /* Allocate new argument vector. */
13879 new_argv = XMALLOC (char *, argc + 1);
13880
13881 /* Put quoted arguments into the new argument vector. */
13882 for (i = 0; i < argc; i++)
13883 {
13884 const char *string = argv[i];
13885
13886 if (string[0] == '\0')
13887 new_argv[i] = xstrdup ("\"\"");
13888 else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
13889 {
13890 int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
13891 size_t length;
13892 unsigned int backslashes;
13893 const char *s;
13894 char *quoted_string;
13895 char *p;
13896
13897 length = 0;
13898 backslashes = 0;
13899 if (quote_around)
13900 length++;
13901 for (s = string; *s != '\0'; s++)
13902 {
13903 char c = *s;
13904 if (c == '"')
13905 length += backslashes + 1;
13906 length++;
13907 if (c == '\\')
13908 backslashes++;
13909 else
13910 backslashes = 0;
13911 }
13912 if (quote_around)
13913 length += backslashes + 1;
13914
13915 quoted_string = XMALLOC (char, length + 1);
13916
13917 p = quoted_string;
13918 backslashes = 0;
13919 if (quote_around)
13920 *p++ = '"';
13921 for (s = string; *s != '\0'; s++)
13922 {
13923 char c = *s;
13924 if (c == '"')
13925 {
13926 unsigned int j;
13927 for (j = backslashes + 1; j > 0; j--)
13928 *p++ = '\\';
13929 }
13930 *p++ = c;
13931 if (c == '\\')
13932 backslashes++;
13933 else
13934 backslashes = 0;
13935 }
13936 if (quote_around)
13937 {
13938 unsigned int j;
13939 for (j = backslashes; j > 0; j--)
13940 *p++ = '\\';
13941 *p++ = '"';
13942 }
13943 *p = '\0';
13944
13945 new_argv[i] = quoted_string;
13946 }
13947 else
13948 new_argv[i] = (char *) string;
13949 }
13950 new_argv[argc] = NULL;
13951
13952 return new_argv;
13953}
13954EOF
13955 ;;
13956 esac
13957
13958 cat <<"EOF"
13959void lt_dump_script (FILE* f)
13960{
13961EOF
13962 func_emit_wrapper yes |
13963 $SED -e 's/\([\\"]\)/\\\1/g' \
13964 -e 's/^/ fputs ("/' -e 's/$/\\n", f);/'
13965
13966 cat <<"EOF"
13967}
13968EOF
13969}
13970# end: func_emit_cwrapperexe_src
13971
13972# func_win32_import_lib_p ARG
13973# True if ARG is an import lib, as indicated by $file_magic_cmd
13974func_win32_import_lib_p ()
13975{
13976 $opt_debug
13977 case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
13978 *import*) : ;;
13979 *) false ;;
13980 esac
13981}
13982
13983# func_mode_link arg...
13984func_mode_link ()
13985{
13986 $opt_debug
13987 case $host in
13988 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
13989 # It is impossible to link a dll without this setting, and
13990 # we shouldn't force the makefile maintainer to figure out
13991 # which system we are compiling for in order to pass an extra
13992 # flag for every libtool invocation.
13993 # allow_undefined=no
13994
13995 # FIXME: Unfortunately, there are problems with the above when trying
13996 # to make a dll which has undefined symbols, in which case not
13997 # even a static library is built. For now, we need to specify
13998 # -no-undefined on the libtool link line when we can be certain
13999 # that all symbols are satisfied, otherwise we get a static library.
14000 allow_undefined=yes
14001 ;;
14002 *)
14003 allow_undefined=yes
14004 ;;
14005 esac
14006 libtool_args=$nonopt
14007 base_compile="$nonopt $@"
14008 compile_command=$nonopt
14009 finalize_command=$nonopt
14010
14011 compile_rpath=
14012 finalize_rpath=
14013 compile_shlibpath=
14014 finalize_shlibpath=
14015 convenience=
14016 old_convenience=
14017 deplibs=
14018 old_deplibs=
14019 compiler_flags=
14020 linker_flags=
14021 dllsearchpath=
14022 lib_search_path=`pwd`
14023 inst_prefix_dir=
14024 new_inherited_linker_flags=
14025
14026 avoid_version=no
14027 bindir=
14028 dlfiles=
14029 dlprefiles=
14030 dlself=no
14031 export_dynamic=no
14032 export_symbols=
14033 export_symbols_regex=
14034 generated=
14035 libobjs=
14036 ltlibs=
14037 module=no
14038 no_install=no
14039 objs=
14040 non_pic_objects=
14041 precious_files_regex=
14042 prefer_static_libs=no
14043 preload=no
14044 prev=
14045 prevarg=
14046 release=
14047 rpath=
14048 xrpath=
14049 perm_rpath=
14050 temp_rpath=
14051 thread_safe=no
14052 vinfo=
14053 vinfo_number=no
14054 weak_libs=
14055 single_module="${wl}-single_module"
14056 func_infer_tag $base_compile
14057
14058 # We need to know -static, to get the right output filenames.
14059 for arg
14060 do
14061 case $arg in
14062 -shared)
14063 test "$build_libtool_libs" != yes && \
14064 func_fatal_configuration "can not build a shared library"
14065 build_old_libs=no
14066 break
14067 ;;
14068 -all-static | -static | -static-libtool-libs)
14069 case $arg in
14070 -all-static)
14071 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
14072 func_warning "complete static linking is impossible in this configuration"
14073 fi
14074 if test -n "$link_static_flag"; then
14075 dlopen_self=$dlopen_self_static
14076 fi
14077 prefer_static_libs=yes
14078 ;;
14079 -static)
14080 if test -z "$pic_flag" && test -n "$link_static_flag"; then
14081 dlopen_self=$dlopen_self_static
14082 fi
14083 prefer_static_libs=built
14084 ;;
14085 -static-libtool-libs)
14086 if test -z "$pic_flag" && test -n "$link_static_flag"; then
14087 dlopen_self=$dlopen_self_static
14088 fi
14089 prefer_static_libs=yes
14090 ;;
14091 esac
14092 build_libtool_libs=no
14093 build_old_libs=yes
14094 break
14095 ;;
14096 esac
14097 done
14098
14099 # See if our shared archives depend on static archives.
14100 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
14101
14102 # Go through the arguments, transforming them on the way.
14103 while test "$#" -gt 0; do
14104 arg="$1"
14105 shift
14106 func_quote_for_eval "$arg"
14107 qarg=$func_quote_for_eval_unquoted_result
14108 func_append libtool_args " $func_quote_for_eval_result"
14109
14110 # If the previous option needs an argument, assign it.
14111 if test -n "$prev"; then
14112 case $prev in
14113 output)
14114 func_append compile_command " @OUTPUT@"
14115 func_append finalize_command " @OUTPUT@"
14116 ;;
14117 esac
14118
14119 case $prev in
14120 bindir)
14121 bindir="$arg"
14122 prev=
14123 continue
14124 ;;
14125 dlfiles|dlprefiles)
14126 if test "$preload" = no; then
14127 # Add the symbol object into the linking commands.
14128 func_append compile_command " @SYMFILE@"
14129 func_append finalize_command " @SYMFILE@"
14130 preload=yes
14131 fi
14132 case $arg in
14133 *.la | *.lo) ;; # We handle these cases below.
14134 force)
14135 if test "$dlself" = no; then
14136 dlself=needless
14137 export_dynamic=yes
14138 fi
14139 prev=
14140 continue
14141 ;;
14142 self)
14143 if test "$prev" = dlprefiles; then
14144 dlself=yes
14145 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
14146 dlself=yes
14147 else
14148 dlself=needless
14149 export_dynamic=yes
14150 fi
14151 prev=
14152 continue
14153 ;;
14154 *)
14155 if test "$prev" = dlfiles; then
14156 dlfiles="$dlfiles $arg"
14157 else
14158 dlprefiles="$dlprefiles $arg"
14159 fi
14160 prev=
14161 continue
14162 ;;
14163 esac
14164 ;;
14165 expsyms)
14166 export_symbols="$arg"
14167 test -f "$arg" \
14168 || func_fatal_error "symbol file \`$arg' does not exist"
14169 prev=
14170 continue
14171 ;;
14172 expsyms_regex)
14173 export_symbols_regex="$arg"
14174 prev=
14175 continue
14176 ;;
14177 framework)
14178 case $host in
14179 *-*-darwin*)
14180 case "$deplibs " in
14181 *" $qarg.ltframework "*) ;;
14182 *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
14183 ;;
14184 esac
14185 ;;
14186 esac
14187 prev=
14188 continue
14189 ;;
14190 inst_prefix)
14191 inst_prefix_dir="$arg"
14192 prev=
14193 continue
14194 ;;
14195 objectlist)
14196 if test -f "$arg"; then
14197 save_arg=$arg
14198 moreargs=
14199 for fil in `cat "$save_arg"`
14200 do
14201# moreargs="$moreargs $fil"
14202 arg=$fil
14203 # A libtool-controlled object.
14204
14205 # Check to see that this really is a libtool object.
14206 if func_lalib_unsafe_p "$arg"; then
14207 pic_object=
14208 non_pic_object=
14209
14210 # Read the .lo file
14211 func_source "$arg"
14212
14213 if test -z "$pic_object" ||
14214 test -z "$non_pic_object" ||
14215 test "$pic_object" = none &&
14216 test "$non_pic_object" = none; then
14217 func_fatal_error "cannot find name of object for \`$arg'"
14218 fi
14219
14220 # Extract subdirectory from the argument.
14221 func_dirname "$arg" "/" ""
14222 xdir="$func_dirname_result"
14223
14224 if test "$pic_object" != none; then
14225 # Prepend the subdirectory the object is found in.
14226 pic_object="$xdir$pic_object"
14227
14228 if test "$prev" = dlfiles; then
14229 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
14230 dlfiles="$dlfiles $pic_object"
14231 prev=
14232 continue
14233 else
14234 # If libtool objects are unsupported, then we need to preload.
14235 prev=dlprefiles
14236 fi
14237 fi
14238
14239 # CHECK ME: I think I busted this. -Ossama
14240 if test "$prev" = dlprefiles; then
14241 # Preload the old-style object.
14242 dlprefiles="$dlprefiles $pic_object"
14243 prev=
14244 fi
14245
14246 # A PIC object.
14247 func_append libobjs " $pic_object"
14248 arg="$pic_object"
14249 fi
14250
14251 # Non-PIC object.
14252 if test "$non_pic_object" != none; then
14253 # Prepend the subdirectory the object is found in.
14254 non_pic_object="$xdir$non_pic_object"
14255
14256 # A standard non-PIC object
14257 func_append non_pic_objects " $non_pic_object"
14258 if test -z "$pic_object" || test "$pic_object" = none ; then
14259 arg="$non_pic_object"
14260 fi
14261 else
14262 # If the PIC object exists, use it instead.
14263 # $xdir was prepended to $pic_object above.
14264 non_pic_object="$pic_object"
14265 func_append non_pic_objects " $non_pic_object"
14266 fi
14267 else
14268 # Only an error if not doing a dry-run.
14269 if $opt_dry_run; then
14270 # Extract subdirectory from the argument.
14271 func_dirname "$arg" "/" ""
14272 xdir="$func_dirname_result"
14273
14274 func_lo2o "$arg"
14275 pic_object=$xdir$objdir/$func_lo2o_result
14276 non_pic_object=$xdir$func_lo2o_result
14277 func_append libobjs " $pic_object"
14278 func_append non_pic_objects " $non_pic_object"
14279 else
14280 func_fatal_error "\`$arg' is not a valid libtool object"
14281 fi
14282 fi
14283 done
14284 else
14285 func_fatal_error "link input file \`$arg' does not exist"
14286 fi
14287 arg=$save_arg
14288 prev=
14289 continue
14290 ;;
14291 precious_regex)
14292 precious_files_regex="$arg"
14293 prev=
14294 continue
14295 ;;
14296 release)
14297 release="-$arg"
14298 prev=
14299 continue
14300 ;;
14301 rpath | xrpath)
14302 # We need an absolute path.
14303 case $arg in
14304 [\\/]* | [A-Za-z]:[\\/]*) ;;
14305 *)
14306 func_fatal_error "only absolute run-paths are allowed"
14307 ;;
14308 esac
14309 if test "$prev" = rpath; then
14310 case "$rpath " in
14311 *" $arg "*) ;;
14312 *) rpath="$rpath $arg" ;;
14313 esac
14314 else
14315 case "$xrpath " in
14316 *" $arg "*) ;;
14317 *) xrpath="$xrpath $arg" ;;
14318 esac
14319 fi
14320 prev=
14321 continue
14322 ;;
14323 shrext)
14324 shrext_cmds="$arg"
14325 prev=
14326 continue
14327 ;;
14328 weak)
14329 weak_libs="$weak_libs $arg"
14330 prev=
14331 continue
14332 ;;
14333 xcclinker)
14334 linker_flags="$linker_flags $qarg"
14335 compiler_flags="$compiler_flags $qarg"
14336 prev=
14337 func_append compile_command " $qarg"
14338 func_append finalize_command " $qarg"
14339 continue
14340 ;;
14341 xcompiler)
14342 compiler_flags="$compiler_flags $qarg"
14343 prev=
14344 func_append compile_command " $qarg"
14345 func_append finalize_command " $qarg"
14346 continue
14347 ;;
14348 xlinker)
14349 linker_flags="$linker_flags $qarg"
14350 compiler_flags="$compiler_flags $wl$qarg"
14351 prev=
14352 func_append compile_command " $wl$qarg"
14353 func_append finalize_command " $wl$qarg"
14354 continue
14355 ;;
14356 *)
14357 eval "$prev=\"\$arg\""
14358 prev=
14359 continue
14360 ;;
14361 esac
14362 fi # test -n "$prev"
14363
14364 prevarg="$arg"
14365
14366 case $arg in
14367 -all-static)
14368 if test -n "$link_static_flag"; then
14369 # See comment for -static flag below, for more details.
14370 func_append compile_command " $link_static_flag"
14371 func_append finalize_command " $link_static_flag"
14372 fi
14373 continue
14374 ;;
14375
14376 -allow-undefined)
14377 # FIXME: remove this flag sometime in the future.
14378 func_fatal_error "\`-allow-undefined' must not be used because it is the default"
14379 ;;
14380
14381 -avoid-version)
14382 avoid_version=yes
14383 continue
14384 ;;
14385
14386 -bindir)
14387 prev=bindir
14388 continue
14389 ;;
14390
14391 -dlopen)
14392 prev=dlfiles
14393 continue
14394 ;;
14395
14396 -dlpreopen)
14397 prev=dlprefiles
14398 continue
14399 ;;
14400
14401 -export-dynamic)
14402 export_dynamic=yes
14403 continue
14404 ;;
14405
14406 -export-symbols | -export-symbols-regex)
14407 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
14408 func_fatal_error "more than one -exported-symbols argument is not allowed"
14409 fi
14410 if test "X$arg" = "X-export-symbols"; then
14411 prev=expsyms
14412 else
14413 prev=expsyms_regex
14414 fi
14415 continue
14416 ;;
14417
14418 -framework)
14419 prev=framework
14420 continue
14421 ;;
14422
14423 -inst-prefix-dir)
14424 prev=inst_prefix
14425 continue
14426 ;;
14427
14428 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
14429 # so, if we see these flags be careful not to treat them like -L
14430 -L[A-Z][A-Z]*:*)
14431 case $with_gcc/$host in
14432 no/*-*-irix* | /*-*-irix*)
14433 func_append compile_command " $arg"
14434 func_append finalize_command " $arg"
14435 ;;
14436 esac
14437 continue
14438 ;;
14439
14440 -L*)
14441 func_stripname '-L' '' "$arg"
14442 dir=$func_stripname_result
14443 if test -z "$dir"; then
14444 if test "$#" -gt 0; then
14445 func_fatal_error "require no space between \`-L' and \`$1'"
14446 else
14447 func_fatal_error "need path for \`-L' option"
14448 fi
14449 fi
14450 # We need an absolute path.
14451 case $dir in
14452 [\\/]* | [A-Za-z]:[\\/]*) ;;
14453 *)
14454 absdir=`cd "$dir" && pwd`
14455 test -z "$absdir" && \
14456 func_fatal_error "cannot determine absolute directory name of \`$dir'"
14457 dir="$absdir"
14458 ;;
14459 esac
14460 case "$deplibs " in
14461 *" -L$dir "*) ;;
14462 *)
14463 deplibs="$deplibs -L$dir"
14464 lib_search_path="$lib_search_path $dir"
14465 ;;
14466 esac
14467 case $host in
14468 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
14469 testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
14470 case :$dllsearchpath: in
14471 *":$dir:"*) ;;
14472 ::) dllsearchpath=$dir;;
14473 *) dllsearchpath="$dllsearchpath:$dir";;
14474 esac
14475 case :$dllsearchpath: in
14476 *":$testbindir:"*) ;;
14477 ::) dllsearchpath=$testbindir;;
14478 *) dllsearchpath="$dllsearchpath:$testbindir";;
14479 esac
14480 ;;
14481 esac
14482 continue
14483 ;;
14484
14485 -l*)
14486 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
14487 case $host in
14488 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
14489 # These systems don't actually have a C or math library (as such)
14490 continue
14491 ;;
14492 *-*-os2*)
14493 # These systems don't actually have a C library (as such)
14494 test "X$arg" = "X-lc" && continue
14495 ;;
14496 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
14497 # Do not include libc due to us having libc/libc_r.
14498 test "X$arg" = "X-lc" && continue
14499 ;;
14500 *-*-rhapsody* | *-*-darwin1.[012])
14501 # Rhapsody C and math libraries are in the System framework
14502 deplibs="$deplibs System.ltframework"
14503 continue
14504 ;;
14505 *-*-sco3.2v5* | *-*-sco5v6*)
14506 # Causes problems with __ctype
14507 test "X$arg" = "X-lc" && continue
14508 ;;
14509 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
14510 # Compiler inserts libc in the correct place for threads to work
14511 test "X$arg" = "X-lc" && continue
14512 ;;
14513 esac
14514 elif test "X$arg" = "X-lc_r"; then
14515 case $host in
14516 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
14517 # Do not include libc_r directly, use -pthread flag.
14518 continue
14519 ;;
14520 esac
14521 fi
14522 deplibs="$deplibs $arg"
14523 continue
14524 ;;
14525
14526 -module)
14527 module=yes
14528 continue
14529 ;;
14530
14531 # Tru64 UNIX uses -model [arg] to determine the layout of C++
14532 # classes, name mangling, and exception handling.
14533 # Darwin uses the -arch flag to determine output architecture.
14534 -model|-arch|-isysroot)
14535 compiler_flags="$compiler_flags $arg"
14536 func_append compile_command " $arg"
14537 func_append finalize_command " $arg"
14538 prev=xcompiler
14539 continue
14540 ;;
14541
14542 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
14543 compiler_flags="$compiler_flags $arg"
14544 func_append compile_command " $arg"
14545 func_append finalize_command " $arg"
14546 case "$new_inherited_linker_flags " in
14547 *" $arg "*) ;;
14548 * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
14549 esac
14550 continue
14551 ;;
14552
14553 -multi_module)
14554 single_module="${wl}-multi_module"
14555 continue
14556 ;;
14557
14558 -no-fast-install)
14559 fast_install=no
14560 continue
14561 ;;
14562
14563 -no-install)
14564 case $host in
14565 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
14566 # The PATH hackery in wrapper scripts is required on Windows
14567 # and Darwin in order for the loader to find any dlls it needs.
14568 func_warning "\`-no-install' is ignored for $host"
14569 func_warning "assuming \`-no-fast-install' instead"
14570 fast_install=no
14571 ;;
14572 *) no_install=yes ;;
14573 esac
14574 continue
14575 ;;
14576
14577 -no-undefined)
14578 allow_undefined=no
14579 continue
14580 ;;
14581
14582 -objectlist)
14583 prev=objectlist
14584 continue
14585 ;;
14586
14587 -o) prev=output ;;
14588
14589 -precious-files-regex)
14590 prev=precious_regex
14591 continue
14592 ;;
14593
14594 -release)
14595 prev=release
14596 continue
14597 ;;
14598
14599 -rpath)
14600 prev=rpath
14601 continue
14602 ;;
14603
14604 -R)
14605 prev=xrpath
14606 continue
14607 ;;
14608
14609 -R*)
14610 func_stripname '-R' '' "$arg"
14611 dir=$func_stripname_result
14612 # We need an absolute path.
14613 case $dir in
14614 [\\/]* | [A-Za-z]:[\\/]*) ;;
14615 *)
14616 func_fatal_error "only absolute run-paths are allowed"
14617 ;;
14618 esac
14619 case "$xrpath " in
14620 *" $dir "*) ;;
14621 *) xrpath="$xrpath $dir" ;;
14622 esac
14623 continue
14624 ;;
14625
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: