ltmain.sh revision 3da084b3
13da084b3Smrg# ltmain.sh - Provide generalized library-building support services. 23da084b3Smrg# NOTE: Changing this file will not affect anything until you rerun configure. 33da084b3Smrg# 43da084b3Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 53da084b3Smrg# Free Software Foundation, Inc. 63da084b3Smrg# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 73da084b3Smrg# 83da084b3Smrg# This program is free software; you can redistribute it and/or modify 93da084b3Smrg# it under the terms of the GNU General Public License as published by 103da084b3Smrg# the Free Software Foundation; either version 2 of the License, or 113da084b3Smrg# (at your option) any later version. 123da084b3Smrg# 133da084b3Smrg# This program is distributed in the hope that it will be useful, but 143da084b3Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of 153da084b3Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 163da084b3Smrg# General Public License for more details. 173da084b3Smrg# 183da084b3Smrg# You should have received a copy of the GNU General Public License 193da084b3Smrg# along with this program; if not, write to the Free Software 203da084b3Smrg# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 213da084b3Smrg# 223da084b3Smrg# As a special exception to the GNU General Public License, if you 233da084b3Smrg# distribute this file as part of a program that contains a 243da084b3Smrg# configuration script generated by Autoconf, you may include it under 253da084b3Smrg# the same distribution terms that you use for the rest of that program. 263da084b3Smrg 273da084b3Smrgbasename="s,^.*/,,g" 283da084b3Smrg 293da084b3Smrg# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh 303da084b3Smrg# is ksh but when the shell is invoked as "sh" and the current value of 313da084b3Smrg# the _XPG environment variable is not equal to 1 (one), the special 323da084b3Smrg# positional parameter $0, within a function call, is the name of the 333da084b3Smrg# function. 343da084b3Smrgprogpath="$0" 353da084b3Smrg 363da084b3Smrg# The name of this program: 373da084b3Smrgprogname=`echo "$progpath" | $SED $basename` 383da084b3Smrgmodename="$progname" 393da084b3Smrg 403da084b3Smrg# Global variables: 413da084b3SmrgEXIT_SUCCESS=0 423da084b3SmrgEXIT_FAILURE=1 433da084b3Smrg 443da084b3SmrgPROGRAM=ltmain.sh 453da084b3SmrgPACKAGE=libtool 463da084b3SmrgVERSION="1.5.22 Debian 1.5.22-4" 473da084b3SmrgTIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" 483da084b3Smrg 493da084b3Smrg# See if we are running on zsh, and set the options which allow our 503da084b3Smrg# commands through without removal of \ escapes. 513da084b3Smrgif test -n "${ZSH_VERSION+set}" ; then 523da084b3Smrg setopt NO_GLOB_SUBST 533da084b3Smrgfi 543da084b3Smrg 553da084b3Smrg# Check that we have a working $echo. 563da084b3Smrgif test "X$1" = X--no-reexec; then 573da084b3Smrg # Discard the --no-reexec flag, and continue. 583da084b3Smrg shift 593da084b3Smrgelif test "X$1" = X--fallback-echo; then 603da084b3Smrg # Avoid inline document here, it may be left over 613da084b3Smrg : 623da084b3Smrgelif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then 633da084b3Smrg # Yippee, $echo works! 643da084b3Smrg : 653da084b3Smrgelse 663da084b3Smrg # Restart under the correct shell, and then maybe $echo will work. 673da084b3Smrg exec $SHELL "$progpath" --no-reexec ${1+"$@"} 683da084b3Smrgfi 693da084b3Smrg 703da084b3Smrgif test "X$1" = X--fallback-echo; then 713da084b3Smrg # used as fallback echo 723da084b3Smrg shift 733da084b3Smrg cat <<EOF 743da084b3Smrg$* 753da084b3SmrgEOF 763da084b3Smrg exit $EXIT_SUCCESS 773da084b3Smrgfi 783da084b3Smrg 793da084b3Smrgdefault_mode= 803da084b3Smrghelp="Try \`$progname --help' for more information." 813da084b3Smrgmagic="%%%MAGIC variable%%%" 823da084b3Smrgmkdir="mkdir" 833da084b3Smrgmv="mv -f" 843da084b3Smrgrm="rm -f" 853da084b3Smrg 863da084b3Smrg# Sed substitution that helps us do robust quoting. It backslashifies 873da084b3Smrg# metacharacters that are still active within double-quoted strings. 883da084b3SmrgXsed="${SED}"' -e 1s/^X//' 893da084b3Smrgsed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' 903da084b3Smrg# test EBCDIC or ASCII 913da084b3Smrgcase `echo X|tr X '\101'` in 923da084b3Smrg A) # ASCII based system 933da084b3Smrg # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr 943da084b3Smrg SP2NL='tr \040 \012' 953da084b3Smrg NL2SP='tr \015\012 \040\040' 963da084b3Smrg ;; 973da084b3Smrg *) # EBCDIC based system 983da084b3Smrg SP2NL='tr \100 \n' 993da084b3Smrg NL2SP='tr \r\n \100\100' 1003da084b3Smrg ;; 1013da084b3Smrgesac 1023da084b3Smrg 1033da084b3Smrg# NLS nuisances. 1043da084b3Smrg# Only set LANG and LC_ALL to C if already set. 1053da084b3Smrg# These must not be set unconditionally because not all systems understand 1063da084b3Smrg# e.g. LANG=C (notably SCO). 1073da084b3Smrg# We save the old values to restore during execute mode. 1083da084b3Smrgif test "${LC_ALL+set}" = set; then 1093da084b3Smrg save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL 1103da084b3Smrgfi 1113da084b3Smrgif test "${LANG+set}" = set; then 1123da084b3Smrg save_LANG="$LANG"; LANG=C; export LANG 1133da084b3Smrgfi 1143da084b3Smrg 1153da084b3Smrg# Make sure IFS has a sensible default 1163da084b3Smrglt_nl=' 1173da084b3Smrg' 1183da084b3SmrgIFS=" $lt_nl" 1193da084b3Smrg 1203da084b3Smrgif test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then 1213da084b3Smrg $echo "$modename: not configured to build any kind of library" 1>&2 1223da084b3Smrg $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 1233da084b3Smrg exit $EXIT_FAILURE 1243da084b3Smrgfi 1253da084b3Smrg 1263da084b3Smrg# Global variables. 1273da084b3Smrgmode=$default_mode 1283da084b3Smrgnonopt= 1293da084b3Smrgprev= 1303da084b3Smrgprevopt= 1313da084b3Smrgrun= 1323da084b3Smrgshow="$echo" 1333da084b3Smrgshow_help= 1343da084b3Smrgexecute_dlfiles= 1353da084b3Smrgduplicate_deps=no 1363da084b3Smrgpreserve_args= 1373da084b3Smrglo2o="s/\\.lo\$/.${objext}/" 1383da084b3Smrgo2lo="s/\\.${objext}\$/.lo/" 1393da084b3Smrg 1403da084b3Smrg##################################### 1413da084b3Smrg# Shell function definitions: 1423da084b3Smrg# This seems to be the best place for them 1433da084b3Smrg 1443da084b3Smrg# func_mktempdir [string] 1453da084b3Smrg# Make a temporary directory that won't clash with other running 1463da084b3Smrg# libtool processes, and avoids race conditions if possible. If 1473da084b3Smrg# given, STRING is the basename for that directory. 1483da084b3Smrgfunc_mktempdir () 1493da084b3Smrg{ 1503da084b3Smrg my_template="${TMPDIR-/tmp}/${1-$progname}" 1513da084b3Smrg 1523da084b3Smrg if test "$run" = ":"; then 1533da084b3Smrg # Return a directory name, but don't create it in dry-run mode 1543da084b3Smrg my_tmpdir="${my_template}-$$" 1553da084b3Smrg else 1563da084b3Smrg 1573da084b3Smrg # If mktemp works, use that first and foremost 1583da084b3Smrg my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` 1593da084b3Smrg 1603da084b3Smrg if test ! -d "$my_tmpdir"; then 1613da084b3Smrg # Failing that, at least try and use $RANDOM to avoid a race 1623da084b3Smrg my_tmpdir="${my_template}-${RANDOM-0}$$" 1633da084b3Smrg 1643da084b3Smrg save_mktempdir_umask=`umask` 1653da084b3Smrg umask 0077 1663da084b3Smrg $mkdir "$my_tmpdir" 1673da084b3Smrg umask $save_mktempdir_umask 1683da084b3Smrg fi 1693da084b3Smrg 1703da084b3Smrg # If we're not in dry-run mode, bomb out on failure 1713da084b3Smrg test -d "$my_tmpdir" || { 1723da084b3Smrg $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 1733da084b3Smrg exit $EXIT_FAILURE 1743da084b3Smrg } 1753da084b3Smrg fi 1763da084b3Smrg 1773da084b3Smrg $echo "X$my_tmpdir" | $Xsed 1783da084b3Smrg} 1793da084b3Smrg 1803da084b3Smrg 1813da084b3Smrg# func_win32_libid arg 1823da084b3Smrg# return the library type of file 'arg' 1833da084b3Smrg# 1843da084b3Smrg# Need a lot of goo to handle *both* DLLs and import libs 1853da084b3Smrg# Has to be a shell function in order to 'eat' the argument 1863da084b3Smrg# that is supplied when $file_magic_command is called. 1873da084b3Smrgfunc_win32_libid () 1883da084b3Smrg{ 1893da084b3Smrg win32_libid_type="unknown" 1903da084b3Smrg win32_fileres=`file -L $1 2>/dev/null` 1913da084b3Smrg case $win32_fileres in 1923da084b3Smrg *ar\ archive\ import\ library*) # definitely import 1933da084b3Smrg win32_libid_type="x86 archive import" 1943da084b3Smrg ;; 1953da084b3Smrg *ar\ archive*) # could be an import, or static 1963da084b3Smrg if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ 1973da084b3Smrg $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then 1983da084b3Smrg win32_nmres=`eval $NM -f posix -A $1 | \ 1993da084b3Smrg $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'` 2003da084b3Smrg case $win32_nmres in 2013da084b3Smrg import*) win32_libid_type="x86 archive import";; 2023da084b3Smrg *) win32_libid_type="x86 archive static";; 2033da084b3Smrg esac 2043da084b3Smrg fi 2053da084b3Smrg ;; 2063da084b3Smrg *DLL*) 2073da084b3Smrg win32_libid_type="x86 DLL" 2083da084b3Smrg ;; 2093da084b3Smrg *executable*) # but shell scripts are "executable" too... 2103da084b3Smrg case $win32_fileres in 2113da084b3Smrg *MS\ Windows\ PE\ Intel*) 2123da084b3Smrg win32_libid_type="x86 DLL" 2133da084b3Smrg ;; 2143da084b3Smrg esac 2153da084b3Smrg ;; 2163da084b3Smrg esac 2173da084b3Smrg $echo $win32_libid_type 2183da084b3Smrg} 2193da084b3Smrg 2203da084b3Smrg 2213da084b3Smrg# func_infer_tag arg 2223da084b3Smrg# Infer tagged configuration to use if any are available and 2233da084b3Smrg# if one wasn't chosen via the "--tag" command line option. 2243da084b3Smrg# Only attempt this if the compiler in the base compile 2253da084b3Smrg# command doesn't match the default compiler. 2263da084b3Smrg# arg is usually of the form 'gcc ...' 2273da084b3Smrgfunc_infer_tag () 2283da084b3Smrg{ 2293da084b3Smrg if test -n "$available_tags" && test -z "$tagname"; then 2303da084b3Smrg CC_quoted= 2313da084b3Smrg for arg in $CC; do 2323da084b3Smrg case $arg in 2333da084b3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 2343da084b3Smrg arg="\"$arg\"" 2353da084b3Smrg ;; 2363da084b3Smrg esac 2373da084b3Smrg CC_quoted="$CC_quoted $arg" 2383da084b3Smrg done 2393da084b3Smrg case $@ in 2403da084b3Smrg # Blanks in the command may have been stripped by the calling shell, 2413da084b3Smrg # but not from the CC environment variable when configure was run. 2423da084b3Smrg " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; 2433da084b3Smrg # Blanks at the start of $base_compile will cause this to fail 2443da084b3Smrg # if we don't check for them as well. 2453da084b3Smrg *) 2463da084b3Smrg for z in $available_tags; do 2473da084b3Smrg if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then 2483da084b3Smrg # Evaluate the configuration. 2493da084b3Smrg eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" 2503da084b3Smrg CC_quoted= 2513da084b3Smrg for arg in $CC; do 2523da084b3Smrg # Double-quote args containing other shell metacharacters. 2533da084b3Smrg case $arg in 2543da084b3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 2553da084b3Smrg arg="\"$arg\"" 2563da084b3Smrg ;; 2573da084b3Smrg esac 2583da084b3Smrg CC_quoted="$CC_quoted $arg" 2593da084b3Smrg done 2603da084b3Smrg case "$@ " in 2613da084b3Smrg " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) 2623da084b3Smrg # The compiler in the base compile command matches 2633da084b3Smrg # the one in the tagged configuration. 2643da084b3Smrg # Assume this is the tagged configuration we want. 2653da084b3Smrg tagname=$z 2663da084b3Smrg break 2673da084b3Smrg ;; 2683da084b3Smrg esac 2693da084b3Smrg fi 2703da084b3Smrg done 2713da084b3Smrg # If $tagname still isn't set, then no tagged configuration 2723da084b3Smrg # was found and let the user know that the "--tag" command 2733da084b3Smrg # line option must be used. 2743da084b3Smrg if test -z "$tagname"; then 2753da084b3Smrg $echo "$modename: unable to infer tagged configuration" 2763da084b3Smrg $echo "$modename: specify a tag with \`--tag'" 1>&2 2773da084b3Smrg exit $EXIT_FAILURE 2783da084b3Smrg# else 2793da084b3Smrg# $echo "$modename: using $tagname tagged configuration" 2803da084b3Smrg fi 2813da084b3Smrg ;; 2823da084b3Smrg esac 2833da084b3Smrg fi 2843da084b3Smrg} 2853da084b3Smrg 2863da084b3Smrg 2873da084b3Smrg# func_extract_an_archive dir oldlib 2883da084b3Smrgfunc_extract_an_archive () 2893da084b3Smrg{ 2903da084b3Smrg f_ex_an_ar_dir="$1"; shift 2913da084b3Smrg f_ex_an_ar_oldlib="$1" 2923da084b3Smrg 2933da084b3Smrg $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" 2943da084b3Smrg $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? 2953da084b3Smrg if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then 2963da084b3Smrg : 2973da084b3Smrg else 2983da084b3Smrg $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 2993da084b3Smrg exit $EXIT_FAILURE 3003da084b3Smrg fi 3013da084b3Smrg} 3023da084b3Smrg 3033da084b3Smrg# func_extract_archives gentop oldlib ... 3043da084b3Smrgfunc_extract_archives () 3053da084b3Smrg{ 3063da084b3Smrg my_gentop="$1"; shift 3073da084b3Smrg my_oldlibs=${1+"$@"} 3083da084b3Smrg my_oldobjs="" 3093da084b3Smrg my_xlib="" 3103da084b3Smrg my_xabs="" 3113da084b3Smrg my_xdir="" 3123da084b3Smrg my_status="" 3133da084b3Smrg 3143da084b3Smrg $show "${rm}r $my_gentop" 3153da084b3Smrg $run ${rm}r "$my_gentop" 3163da084b3Smrg $show "$mkdir $my_gentop" 3173da084b3Smrg $run $mkdir "$my_gentop" 3183da084b3Smrg my_status=$? 3193da084b3Smrg if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then 3203da084b3Smrg exit $my_status 3213da084b3Smrg fi 3223da084b3Smrg 3233da084b3Smrg for my_xlib in $my_oldlibs; do 3243da084b3Smrg # Extract the objects. 3253da084b3Smrg case $my_xlib in 3263da084b3Smrg [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; 3273da084b3Smrg *) my_xabs=`pwd`"/$my_xlib" ;; 3283da084b3Smrg esac 3293da084b3Smrg my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` 3303da084b3Smrg my_xdir="$my_gentop/$my_xlib" 3313da084b3Smrg 3323da084b3Smrg $show "${rm}r $my_xdir" 3333da084b3Smrg $run ${rm}r "$my_xdir" 3343da084b3Smrg $show "$mkdir $my_xdir" 3353da084b3Smrg $run $mkdir "$my_xdir" 3363da084b3Smrg exit_status=$? 3373da084b3Smrg if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then 3383da084b3Smrg exit $exit_status 3393da084b3Smrg fi 3403da084b3Smrg case $host in 3413da084b3Smrg *-darwin*) 3423da084b3Smrg $show "Extracting $my_xabs" 3433da084b3Smrg # Do not bother doing anything if just a dry run 3443da084b3Smrg if test -z "$run"; then 3453da084b3Smrg darwin_orig_dir=`pwd` 3463da084b3Smrg cd $my_xdir || exit $? 3473da084b3Smrg darwin_archive=$my_xabs 3483da084b3Smrg darwin_curdir=`pwd` 3493da084b3Smrg darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` 3503da084b3Smrg darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` 3513da084b3Smrg if test -n "$darwin_arches"; then 3523da084b3Smrg darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` 3533da084b3Smrg darwin_arch= 3543da084b3Smrg $show "$darwin_base_archive has multiple architectures $darwin_arches" 3553da084b3Smrg for darwin_arch in $darwin_arches ; do 3563da084b3Smrg mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" 3573da084b3Smrg lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" 3583da084b3Smrg cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" 3593da084b3Smrg func_extract_an_archive "`pwd`" "${darwin_base_archive}" 3603da084b3Smrg cd "$darwin_curdir" 3613da084b3Smrg $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" 3623da084b3Smrg done # $darwin_arches 3633da084b3Smrg ## Okay now we have a bunch of thin objects, gotta fatten them up :) 3643da084b3Smrg darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` 3653da084b3Smrg darwin_file= 3663da084b3Smrg darwin_files= 3673da084b3Smrg for darwin_file in $darwin_filelist; do 3683da084b3Smrg darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` 3693da084b3Smrg lipo -create -output "$darwin_file" $darwin_files 3703da084b3Smrg done # $darwin_filelist 3713da084b3Smrg ${rm}r unfat-$$ 3723da084b3Smrg cd "$darwin_orig_dir" 3733da084b3Smrg else 3743da084b3Smrg cd "$darwin_orig_dir" 3753da084b3Smrg func_extract_an_archive "$my_xdir" "$my_xabs" 3763da084b3Smrg fi # $darwin_arches 3773da084b3Smrg fi # $run 3783da084b3Smrg ;; 3793da084b3Smrg *) 3803da084b3Smrg func_extract_an_archive "$my_xdir" "$my_xabs" 3813da084b3Smrg ;; 3823da084b3Smrg esac 3833da084b3Smrg my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` 3843da084b3Smrg done 3853da084b3Smrg func_extract_archives_result="$my_oldobjs" 3863da084b3Smrg} 3873da084b3Smrg# End of Shell function definitions 3883da084b3Smrg##################################### 3893da084b3Smrg 3903da084b3Smrg# Darwin sucks 3913da084b3Smrgeval std_shrext=\"$shrext_cmds\" 3923da084b3Smrg 3933da084b3Smrgdisable_libs=no 3943da084b3Smrg 3953da084b3Smrg# Parse our command line options once, thoroughly. 3963da084b3Smrgwhile test "$#" -gt 0 3973da084b3Smrgdo 3983da084b3Smrg arg="$1" 3993da084b3Smrg shift 4003da084b3Smrg 4013da084b3Smrg case $arg in 4023da084b3Smrg -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; 4033da084b3Smrg *) optarg= ;; 4043da084b3Smrg esac 4053da084b3Smrg 4063da084b3Smrg # If the previous option needs an argument, assign it. 4073da084b3Smrg if test -n "$prev"; then 4083da084b3Smrg case $prev in 4093da084b3Smrg execute_dlfiles) 4103da084b3Smrg execute_dlfiles="$execute_dlfiles $arg" 4113da084b3Smrg ;; 4123da084b3Smrg tag) 4133da084b3Smrg tagname="$arg" 4143da084b3Smrg preserve_args="${preserve_args}=$arg" 4153da084b3Smrg 4163da084b3Smrg # Check whether tagname contains only valid characters 4173da084b3Smrg case $tagname in 4183da084b3Smrg *[!-_A-Za-z0-9,/]*) 4193da084b3Smrg $echo "$progname: invalid tag name: $tagname" 1>&2 4203da084b3Smrg exit $EXIT_FAILURE 4213da084b3Smrg ;; 4223da084b3Smrg esac 4233da084b3Smrg 4243da084b3Smrg case $tagname in 4253da084b3Smrg CC) 4263da084b3Smrg # Don't test for the "default" C tag, as we know, it's there, but 4273da084b3Smrg # not specially marked. 4283da084b3Smrg ;; 4293da084b3Smrg *) 4303da084b3Smrg if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then 4313da084b3Smrg taglist="$taglist $tagname" 4323da084b3Smrg # Evaluate the configuration. 4333da084b3Smrg eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" 4343da084b3Smrg else 4353da084b3Smrg $echo "$progname: ignoring unknown tag $tagname" 1>&2 4363da084b3Smrg fi 4373da084b3Smrg ;; 4383da084b3Smrg esac 4393da084b3Smrg ;; 4403da084b3Smrg *) 4413da084b3Smrg eval "$prev=\$arg" 4423da084b3Smrg ;; 4433da084b3Smrg esac 4443da084b3Smrg 4453da084b3Smrg prev= 4463da084b3Smrg prevopt= 4473da084b3Smrg continue 4483da084b3Smrg fi 4493da084b3Smrg 4503da084b3Smrg # Have we seen a non-optional argument yet? 4513da084b3Smrg case $arg in 4523da084b3Smrg --help) 4533da084b3Smrg show_help=yes 4543da084b3Smrg ;; 4553da084b3Smrg 4563da084b3Smrg --version) 4573da084b3Smrg $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" 4583da084b3Smrg $echo 4593da084b3Smrg $echo "Copyright (C) 2005 Free Software Foundation, Inc." 4603da084b3Smrg $echo "This is free software; see the source for copying conditions. There is NO" 4613da084b3Smrg $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 4623da084b3Smrg exit $? 4633da084b3Smrg ;; 4643da084b3Smrg 4653da084b3Smrg --config) 4663da084b3Smrg ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath 4673da084b3Smrg # Now print the configurations for the tags. 4683da084b3Smrg for tagname in $taglist; do 4693da084b3Smrg ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" 4703da084b3Smrg done 4713da084b3Smrg exit $? 4723da084b3Smrg ;; 4733da084b3Smrg 4743da084b3Smrg --debug) 4753da084b3Smrg $echo "$progname: enabling shell trace mode" 4763da084b3Smrg set -x 4773da084b3Smrg preserve_args="$preserve_args $arg" 4783da084b3Smrg ;; 4793da084b3Smrg 4803da084b3Smrg --dry-run | -n) 4813da084b3Smrg run=: 4823da084b3Smrg ;; 4833da084b3Smrg 4843da084b3Smrg --features) 4853da084b3Smrg $echo "host: $host" 4863da084b3Smrg if test "$build_libtool_libs" = yes; then 4873da084b3Smrg $echo "enable shared libraries" 4883da084b3Smrg else 4893da084b3Smrg $echo "disable shared libraries" 4903da084b3Smrg fi 4913da084b3Smrg if test "$build_old_libs" = yes; then 4923da084b3Smrg $echo "enable static libraries" 4933da084b3Smrg else 4943da084b3Smrg $echo "disable static libraries" 4953da084b3Smrg fi 4963da084b3Smrg exit $? 4973da084b3Smrg ;; 4983da084b3Smrg 4993da084b3Smrg --finish) mode="finish" ;; 5003da084b3Smrg 5013da084b3Smrg --mode) prevopt="--mode" prev=mode ;; 5023da084b3Smrg --mode=*) mode="$optarg" ;; 5033da084b3Smrg 5043da084b3Smrg --preserve-dup-deps) duplicate_deps="yes" ;; 5053da084b3Smrg 5063da084b3Smrg --quiet | --silent) 5073da084b3Smrg show=: 5083da084b3Smrg preserve_args="$preserve_args $arg" 5093da084b3Smrg ;; 5103da084b3Smrg 5113da084b3Smrg --tag) 5123da084b3Smrg prevopt="--tag" 5133da084b3Smrg prev=tag 5143da084b3Smrg preserve_args="$preserve_args --tag" 5153da084b3Smrg ;; 5163da084b3Smrg --tag=*) 5173da084b3Smrg set tag "$optarg" ${1+"$@"} 5183da084b3Smrg shift 5193da084b3Smrg prev=tag 5203da084b3Smrg preserve_args="$preserve_args --tag" 5213da084b3Smrg ;; 5223da084b3Smrg 5233da084b3Smrg -dlopen) 5243da084b3Smrg prevopt="-dlopen" 5253da084b3Smrg prev=execute_dlfiles 5263da084b3Smrg ;; 5273da084b3Smrg 5283da084b3Smrg -*) 5293da084b3Smrg $echo "$modename: unrecognized option \`$arg'" 1>&2 5303da084b3Smrg $echo "$help" 1>&2 5313da084b3Smrg exit $EXIT_FAILURE 5323da084b3Smrg ;; 5333da084b3Smrg 5343da084b3Smrg *) 5353da084b3Smrg nonopt="$arg" 5363da084b3Smrg break 5373da084b3Smrg ;; 5383da084b3Smrg esac 5393da084b3Smrgdone 5403da084b3Smrg 5413da084b3Smrgif test -n "$prevopt"; then 5423da084b3Smrg $echo "$modename: option \`$prevopt' requires an argument" 1>&2 5433da084b3Smrg $echo "$help" 1>&2 5443da084b3Smrg exit $EXIT_FAILURE 5453da084b3Smrgfi 5463da084b3Smrg 5473da084b3Smrgcase $disable_libs in 5483da084b3Smrgno) 5493da084b3Smrg ;; 5503da084b3Smrgshared) 5513da084b3Smrg build_libtool_libs=no 5523da084b3Smrg build_old_libs=yes 5533da084b3Smrg ;; 5543da084b3Smrgstatic) 5553da084b3Smrg build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` 5563da084b3Smrg ;; 5573da084b3Smrgesac 5583da084b3Smrg 5593da084b3Smrg# If this variable is set in any of the actions, the command in it 5603da084b3Smrg# will be execed at the end. This prevents here-documents from being 5613da084b3Smrg# left over by shells. 5623da084b3Smrgexec_cmd= 5633da084b3Smrg 5643da084b3Smrgif test -z "$show_help"; then 5653da084b3Smrg 5663da084b3Smrg # Infer the operation mode. 5673da084b3Smrg if test -z "$mode"; then 5683da084b3Smrg $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 5693da084b3Smrg $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 5703da084b3Smrg case $nonopt in 5713da084b3Smrg *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) 5723da084b3Smrg mode=link 5733da084b3Smrg for arg 5743da084b3Smrg do 5753da084b3Smrg case $arg in 5763da084b3Smrg -c) 5773da084b3Smrg mode=compile 5783da084b3Smrg break 5793da084b3Smrg ;; 5803da084b3Smrg esac 5813da084b3Smrg done 5823da084b3Smrg ;; 5833da084b3Smrg *db | *dbx | *strace | *truss) 5843da084b3Smrg mode=execute 5853da084b3Smrg ;; 5863da084b3Smrg *install*|cp|mv) 5873da084b3Smrg mode=install 5883da084b3Smrg ;; 5893da084b3Smrg *rm) 5903da084b3Smrg mode=uninstall 5913da084b3Smrg ;; 5923da084b3Smrg *) 5933da084b3Smrg # If we have no mode, but dlfiles were specified, then do execute mode. 5943da084b3Smrg test -n "$execute_dlfiles" && mode=execute 5953da084b3Smrg 5963da084b3Smrg # Just use the default operation mode. 5973da084b3Smrg if test -z "$mode"; then 5983da084b3Smrg if test -n "$nonopt"; then 5993da084b3Smrg $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 6003da084b3Smrg else 6013da084b3Smrg $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 6023da084b3Smrg fi 6033da084b3Smrg fi 6043da084b3Smrg ;; 6053da084b3Smrg esac 6063da084b3Smrg fi 6073da084b3Smrg 6083da084b3Smrg # Only execute mode is allowed to have -dlopen flags. 6093da084b3Smrg if test -n "$execute_dlfiles" && test "$mode" != execute; then 6103da084b3Smrg $echo "$modename: unrecognized option \`-dlopen'" 1>&2 6113da084b3Smrg $echo "$help" 1>&2 6123da084b3Smrg exit $EXIT_FAILURE 6133da084b3Smrg fi 6143da084b3Smrg 6153da084b3Smrg # Change the help message to a mode-specific one. 6163da084b3Smrg generic_help="$help" 6173da084b3Smrg help="Try \`$modename --help --mode=$mode' for more information." 6183da084b3Smrg 6193da084b3Smrg # These modes are in order of execution frequency so that they run quickly. 6203da084b3Smrg case $mode in 6213da084b3Smrg # libtool compile mode 6223da084b3Smrg compile) 6233da084b3Smrg modename="$modename: compile" 6243da084b3Smrg # Get the compilation command and the source file. 6253da084b3Smrg base_compile= 6263da084b3Smrg srcfile="$nonopt" # always keep a non-empty value in "srcfile" 6273da084b3Smrg suppress_opt=yes 6283da084b3Smrg suppress_output= 6293da084b3Smrg arg_mode=normal 6303da084b3Smrg libobj= 6313da084b3Smrg later= 6323da084b3Smrg 6333da084b3Smrg for arg 6343da084b3Smrg do 6353da084b3Smrg case $arg_mode in 6363da084b3Smrg arg ) 6373da084b3Smrg # do not "continue". Instead, add this to base_compile 6383da084b3Smrg lastarg="$arg" 6393da084b3Smrg arg_mode=normal 6403da084b3Smrg ;; 6413da084b3Smrg 6423da084b3Smrg target ) 6433da084b3Smrg libobj="$arg" 6443da084b3Smrg arg_mode=normal 6453da084b3Smrg continue 6463da084b3Smrg ;; 6473da084b3Smrg 6483da084b3Smrg normal ) 6493da084b3Smrg # Accept any command-line options. 6503da084b3Smrg case $arg in 6513da084b3Smrg -o) 6523da084b3Smrg if test -n "$libobj" ; then 6533da084b3Smrg $echo "$modename: you cannot specify \`-o' more than once" 1>&2 6543da084b3Smrg exit $EXIT_FAILURE 6553da084b3Smrg fi 6563da084b3Smrg arg_mode=target 6573da084b3Smrg continue 6583da084b3Smrg ;; 6593da084b3Smrg 6603da084b3Smrg -static | -prefer-pic | -prefer-non-pic) 6613da084b3Smrg later="$later $arg" 6623da084b3Smrg continue 6633da084b3Smrg ;; 6643da084b3Smrg 6653da084b3Smrg -no-suppress) 6663da084b3Smrg suppress_opt=no 6673da084b3Smrg continue 6683da084b3Smrg ;; 6693da084b3Smrg 6703da084b3Smrg -Xcompiler) 6713da084b3Smrg arg_mode=arg # the next one goes into the "base_compile" arg list 6723da084b3Smrg continue # The current "srcfile" will either be retained or 6733da084b3Smrg ;; # replaced later. I would guess that would be a bug. 6743da084b3Smrg 6753da084b3Smrg -Wc,*) 6763da084b3Smrg args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` 6773da084b3Smrg lastarg= 6783da084b3Smrg save_ifs="$IFS"; IFS=',' 6793da084b3Smrg for arg in $args; do 6803da084b3Smrg IFS="$save_ifs" 6813da084b3Smrg 6823da084b3Smrg # Double-quote args containing other shell metacharacters. 6833da084b3Smrg # Many Bourne shells cannot handle close brackets correctly 6843da084b3Smrg # in scan sets, so we specify it separately. 6853da084b3Smrg case $arg in 6863da084b3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 6873da084b3Smrg arg="\"$arg\"" 6883da084b3Smrg ;; 6893da084b3Smrg esac 6903da084b3Smrg lastarg="$lastarg $arg" 6913da084b3Smrg done 6923da084b3Smrg IFS="$save_ifs" 6933da084b3Smrg lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` 6943da084b3Smrg 6953da084b3Smrg # Add the arguments to base_compile. 6963da084b3Smrg base_compile="$base_compile $lastarg" 6973da084b3Smrg continue 6983da084b3Smrg ;; 6993da084b3Smrg 7003da084b3Smrg * ) 7013da084b3Smrg # Accept the current argument as the source file. 7023da084b3Smrg # The previous "srcfile" becomes the current argument. 7033da084b3Smrg # 7043da084b3Smrg lastarg="$srcfile" 7053da084b3Smrg srcfile="$arg" 7063da084b3Smrg ;; 7073da084b3Smrg esac # case $arg 7083da084b3Smrg ;; 7093da084b3Smrg esac # case $arg_mode 7103da084b3Smrg 7113da084b3Smrg # Aesthetically quote the previous argument. 7123da084b3Smrg lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` 7133da084b3Smrg 7143da084b3Smrg case $lastarg in 7153da084b3Smrg # Double-quote args containing other shell metacharacters. 7163da084b3Smrg # Many Bourne shells cannot handle close brackets correctly 7173da084b3Smrg # in scan sets, and some SunOS ksh mistreat backslash-escaping 7183da084b3Smrg # in scan sets (worked around with variable expansion), 7193da084b3Smrg # and furthermore cannot handle '|' '&' '(' ')' in scan sets 7203da084b3Smrg # at all, so we specify them separately. 7213da084b3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 7223da084b3Smrg lastarg="\"$lastarg\"" 7233da084b3Smrg ;; 7243da084b3Smrg esac 7253da084b3Smrg 7263da084b3Smrg base_compile="$base_compile $lastarg" 7273da084b3Smrg done # for arg 7283da084b3Smrg 7293da084b3Smrg case $arg_mode in 7303da084b3Smrg arg) 7313da084b3Smrg $echo "$modename: you must specify an argument for -Xcompile" 7323da084b3Smrg exit $EXIT_FAILURE 7333da084b3Smrg ;; 7343da084b3Smrg target) 7353da084b3Smrg $echo "$modename: you must specify a target with \`-o'" 1>&2 7363da084b3Smrg exit $EXIT_FAILURE 7373da084b3Smrg ;; 7383da084b3Smrg *) 7393da084b3Smrg # Get the name of the library object. 7403da084b3Smrg [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` 7413da084b3Smrg ;; 7423da084b3Smrg esac 7433da084b3Smrg 7443da084b3Smrg # Recognize several different file suffixes. 7453da084b3Smrg # If the user specifies -o file.o, it is replaced with file.lo 7463da084b3Smrg xform='[cCFSifmso]' 7473da084b3Smrg case $libobj in 7483da084b3Smrg *.ada) xform=ada ;; 7493da084b3Smrg *.adb) xform=adb ;; 7503da084b3Smrg *.ads) xform=ads ;; 7513da084b3Smrg *.asm) xform=asm ;; 7523da084b3Smrg *.c++) xform=c++ ;; 7533da084b3Smrg *.cc) xform=cc ;; 7543da084b3Smrg *.ii) xform=ii ;; 7553da084b3Smrg *.class) xform=class ;; 7563da084b3Smrg *.cpp) xform=cpp ;; 7573da084b3Smrg *.cxx) xform=cxx ;; 7583da084b3Smrg *.f90) xform=f90 ;; 7593da084b3Smrg *.for) xform=for ;; 7603da084b3Smrg *.java) xform=java ;; 7613da084b3Smrg esac 7623da084b3Smrg 7633da084b3Smrg libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` 7643da084b3Smrg 7653da084b3Smrg case $libobj in 7663da084b3Smrg *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; 7673da084b3Smrg *) 7683da084b3Smrg $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 7693da084b3Smrg exit $EXIT_FAILURE 7703da084b3Smrg ;; 7713da084b3Smrg esac 7723da084b3Smrg 7733da084b3Smrg func_infer_tag $base_compile 7743da084b3Smrg 7753da084b3Smrg for arg in $later; do 7763da084b3Smrg case $arg in 7773da084b3Smrg -static) 7783da084b3Smrg build_old_libs=yes 7793da084b3Smrg continue 7803da084b3Smrg ;; 7813da084b3Smrg 7823da084b3Smrg -prefer-pic) 7833da084b3Smrg pic_mode=yes 7843da084b3Smrg continue 7853da084b3Smrg ;; 7863da084b3Smrg 7873da084b3Smrg -prefer-non-pic) 7883da084b3Smrg pic_mode=no 7893da084b3Smrg continue 7903da084b3Smrg ;; 7913da084b3Smrg esac 7923da084b3Smrg done 7933da084b3Smrg 7943da084b3Smrg qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` 7953da084b3Smrg case $qlibobj in 7963da084b3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 7973da084b3Smrg qlibobj="\"$qlibobj\"" ;; 7983da084b3Smrg esac 7993da084b3Smrg test "X$libobj" != "X$qlibobj" \ 8003da084b3Smrg && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ 8013da084b3Smrg && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." 8023da084b3Smrg objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` 8033da084b3Smrg xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` 8043da084b3Smrg if test "X$xdir" = "X$obj"; then 8053da084b3Smrg xdir= 8063da084b3Smrg else 8073da084b3Smrg xdir=$xdir/ 8083da084b3Smrg fi 8093da084b3Smrg lobj=${xdir}$objdir/$objname 8103da084b3Smrg 8113da084b3Smrg if test -z "$base_compile"; then 8123da084b3Smrg $echo "$modename: you must specify a compilation command" 1>&2 8133da084b3Smrg $echo "$help" 1>&2 8143da084b3Smrg exit $EXIT_FAILURE 8153da084b3Smrg fi 8163da084b3Smrg 8173da084b3Smrg # Delete any leftover library objects. 8183da084b3Smrg if test "$build_old_libs" = yes; then 8193da084b3Smrg removelist="$obj $lobj $libobj ${libobj}T" 8203da084b3Smrg else 8213da084b3Smrg removelist="$lobj $libobj ${libobj}T" 8223da084b3Smrg fi 8233da084b3Smrg 8243da084b3Smrg $run $rm $removelist 8253da084b3Smrg trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 8263da084b3Smrg 8273da084b3Smrg # On Cygwin there's no "real" PIC flag so we must build both object types 8283da084b3Smrg case $host_os in 8293da084b3Smrg cygwin* | mingw* | pw32* | os2*) 8303da084b3Smrg pic_mode=default 8313da084b3Smrg ;; 8323da084b3Smrg esac 8333da084b3Smrg if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then 8343da084b3Smrg # non-PIC code in shared libraries is not supported 8353da084b3Smrg pic_mode=default 8363da084b3Smrg fi 8373da084b3Smrg 8383da084b3Smrg # Calculate the filename of the output object if compiler does 8393da084b3Smrg # not support -o with -c 8403da084b3Smrg if test "$compiler_c_o" = no; then 8413da084b3Smrg output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} 8423da084b3Smrg lockfile="$output_obj.lock" 8433da084b3Smrg removelist="$removelist $output_obj $lockfile" 8443da084b3Smrg trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 8453da084b3Smrg else 8463da084b3Smrg output_obj= 8473da084b3Smrg need_locks=no 8483da084b3Smrg lockfile= 8493da084b3Smrg fi 8503da084b3Smrg 8513da084b3Smrg # Lock this critical section if it is needed 8523da084b3Smrg # We use this script file to make the link, it avoids creating a new file 8533da084b3Smrg if test "$need_locks" = yes; then 8543da084b3Smrg until $run ln "$progpath" "$lockfile" 2>/dev/null; do 8553da084b3Smrg $show "Waiting for $lockfile to be removed" 8563da084b3Smrg sleep 2 8573da084b3Smrg done 8583da084b3Smrg elif test "$need_locks" = warn; then 8593da084b3Smrg if test -f "$lockfile"; then 8603da084b3Smrg $echo "\ 8613da084b3Smrg*** ERROR, $lockfile exists and contains: 8623da084b3Smrg`cat $lockfile 2>/dev/null` 8633da084b3Smrg 8643da084b3SmrgThis indicates that another process is trying to use the same 8653da084b3Smrgtemporary object file, and libtool could not work around it because 8663da084b3Smrgyour compiler does not support \`-c' and \`-o' together. If you 8673da084b3Smrgrepeat this compilation, it may succeed, by chance, but you had better 8683da084b3Smrgavoid parallel builds (make -j) in this platform, or get a better 8693da084b3Smrgcompiler." 8703da084b3Smrg 8713da084b3Smrg $run $rm $removelist 8723da084b3Smrg exit $EXIT_FAILURE 8733da084b3Smrg fi 8743da084b3Smrg $echo "$srcfile" > "$lockfile" 8753da084b3Smrg fi 8763da084b3Smrg 8773da084b3Smrg if test -n "$fix_srcfile_path"; then 8783da084b3Smrg eval srcfile=\"$fix_srcfile_path\" 8793da084b3Smrg fi 8803da084b3Smrg qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` 8813da084b3Smrg case $qsrcfile in 8823da084b3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 8833da084b3Smrg qsrcfile="\"$qsrcfile\"" ;; 8843da084b3Smrg esac 8853da084b3Smrg 8863da084b3Smrg $run $rm "$libobj" "${libobj}T" 8873da084b3Smrg 8883da084b3Smrg # Create a libtool object file (analogous to a ".la" file), 8893da084b3Smrg # but don't create it if we're doing a dry run. 8903da084b3Smrg test -z "$run" && cat > ${libobj}T <<EOF 8913da084b3Smrg# $libobj - a libtool object file 8923da084b3Smrg# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP 8933da084b3Smrg# 8943da084b3Smrg# Please DO NOT delete this file! 8953da084b3Smrg# It is necessary for linking the library. 8963da084b3Smrg 8973da084b3Smrg# Name of the PIC object. 8983da084b3SmrgEOF 8993da084b3Smrg 9003da084b3Smrg # Only build a PIC object if we are building libtool libraries. 9013da084b3Smrg if test "$build_libtool_libs" = yes; then 9023da084b3Smrg # Without this assignment, base_compile gets emptied. 9033da084b3Smrg fbsd_hideous_sh_bug=$base_compile 9043da084b3Smrg 9053da084b3Smrg if test "$pic_mode" != no; then 9063da084b3Smrg command="$base_compile $qsrcfile $pic_flag" 9073da084b3Smrg else 9083da084b3Smrg # Don't build PIC code 9093da084b3Smrg command="$base_compile $qsrcfile" 9103da084b3Smrg fi 9113da084b3Smrg 9123da084b3Smrg if test ! -d "${xdir}$objdir"; then 9133da084b3Smrg $show "$mkdir ${xdir}$objdir" 9143da084b3Smrg $run $mkdir ${xdir}$objdir 9153da084b3Smrg exit_status=$? 9163da084b3Smrg if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then 9173da084b3Smrg exit $exit_status 9183da084b3Smrg fi 9193da084b3Smrg fi 9203da084b3Smrg 9213da084b3Smrg if test -z "$output_obj"; then 9223da084b3Smrg # Place PIC objects in $objdir 9233da084b3Smrg command="$command -o $lobj" 9243da084b3Smrg fi 9253da084b3Smrg 9263da084b3Smrg $run $rm "$lobj" "$output_obj" 9273da084b3Smrg 9283da084b3Smrg $show "$command" 9293da084b3Smrg if $run eval "$command"; then : 9303da084b3Smrg else 9313da084b3Smrg test -n "$output_obj" && $run $rm $removelist 9323da084b3Smrg exit $EXIT_FAILURE 9333da084b3Smrg fi 9343da084b3Smrg 9353da084b3Smrg if test "$need_locks" = warn && 9363da084b3Smrg test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then 9373da084b3Smrg $echo "\ 9383da084b3Smrg*** ERROR, $lockfile contains: 9393da084b3Smrg`cat $lockfile 2>/dev/null` 9403da084b3Smrg 9413da084b3Smrgbut it should contain: 9423da084b3Smrg$srcfile 9433da084b3Smrg 9443da084b3SmrgThis indicates that another process is trying to use the same 9453da084b3Smrgtemporary object file, and libtool could not work around it because 9463da084b3Smrgyour compiler does not support \`-c' and \`-o' together. If you 9473da084b3Smrgrepeat this compilation, it may succeed, by chance, but you had better 9483da084b3Smrgavoid parallel builds (make -j) in this platform, or get a better 9493da084b3Smrgcompiler." 9503da084b3Smrg 9513da084b3Smrg $run $rm $removelist 9523da084b3Smrg exit $EXIT_FAILURE 9533da084b3Smrg fi 9543da084b3Smrg 9553da084b3Smrg # Just move the object if needed, then go on to compile the next one 9563da084b3Smrg if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then 9573da084b3Smrg $show "$mv $output_obj $lobj" 9583da084b3Smrg if $run $mv $output_obj $lobj; then : 9593da084b3Smrg else 9603da084b3Smrg error=$? 9613da084b3Smrg $run $rm $removelist 9623da084b3Smrg exit $error 9633da084b3Smrg fi 9643da084b3Smrg fi 9653da084b3Smrg 9663da084b3Smrg # Append the name of the PIC object to the libtool object file. 9673da084b3Smrg test -z "$run" && cat >> ${libobj}T <<EOF 9683da084b3Smrgpic_object='$objdir/$objname' 9693da084b3Smrg 9703da084b3SmrgEOF 9713da084b3Smrg 9723da084b3Smrg # Allow error messages only from the first compilation. 9733da084b3Smrg if test "$suppress_opt" = yes; then 9743da084b3Smrg suppress_output=' >/dev/null 2>&1' 9753da084b3Smrg fi 9763da084b3Smrg else 9773da084b3Smrg # No PIC object so indicate it doesn't exist in the libtool 9783da084b3Smrg # object file. 9793da084b3Smrg test -z "$run" && cat >> ${libobj}T <<EOF 9803da084b3Smrgpic_object=none 9813da084b3Smrg 9823da084b3SmrgEOF 9833da084b3Smrg fi 9843da084b3Smrg 9853da084b3Smrg # Only build a position-dependent object if we build old libraries. 9863da084b3Smrg if test "$build_old_libs" = yes; then 9873da084b3Smrg if test "$pic_mode" != yes; then 9883da084b3Smrg # Don't build PIC code 9893da084b3Smrg command="$base_compile $qsrcfile" 9903da084b3Smrg else 9913da084b3Smrg command="$base_compile $qsrcfile $pic_flag" 9923da084b3Smrg fi 9933da084b3Smrg if test "$compiler_c_o" = yes; then 9943da084b3Smrg command="$command -o $obj" 9953da084b3Smrg fi 9963da084b3Smrg 9973da084b3Smrg # Suppress compiler output if we already did a PIC compilation. 9983da084b3Smrg command="$command$suppress_output" 9993da084b3Smrg $run $rm "$obj" "$output_obj" 10003da084b3Smrg $show "$command" 10013da084b3Smrg if $run eval "$command"; then : 10023da084b3Smrg else 10033da084b3Smrg $run $rm $removelist 10043da084b3Smrg exit $EXIT_FAILURE 10053da084b3Smrg fi 10063da084b3Smrg 10073da084b3Smrg if test "$need_locks" = warn && 10083da084b3Smrg test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then 10093da084b3Smrg $echo "\ 10103da084b3Smrg*** ERROR, $lockfile contains: 10113da084b3Smrg`cat $lockfile 2>/dev/null` 10123da084b3Smrg 10133da084b3Smrgbut it should contain: 10143da084b3Smrg$srcfile 10153da084b3Smrg 10163da084b3SmrgThis indicates that another process is trying to use the same 10173da084b3Smrgtemporary object file, and libtool could not work around it because 10183da084b3Smrgyour compiler does not support \`-c' and \`-o' together. If you 10193da084b3Smrgrepeat this compilation, it may succeed, by chance, but you had better 10203da084b3Smrgavoid parallel builds (make -j) in this platform, or get a better 10213da084b3Smrgcompiler." 10223da084b3Smrg 10233da084b3Smrg $run $rm $removelist 10243da084b3Smrg exit $EXIT_FAILURE 10253da084b3Smrg fi 10263da084b3Smrg 10273da084b3Smrg # Just move the object if needed 10283da084b3Smrg if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then 10293da084b3Smrg $show "$mv $output_obj $obj" 10303da084b3Smrg if $run $mv $output_obj $obj; then : 10313da084b3Smrg else 10323da084b3Smrg error=$? 10333da084b3Smrg $run $rm $removelist 10343da084b3Smrg exit $error 10353da084b3Smrg fi 10363da084b3Smrg fi 10373da084b3Smrg 10383da084b3Smrg # Append the name of the non-PIC object the libtool object file. 10393da084b3Smrg # Only append if the libtool object file exists. 10403da084b3Smrg test -z "$run" && cat >> ${libobj}T <<EOF 10413da084b3Smrg# Name of the non-PIC object. 10423da084b3Smrgnon_pic_object='$objname' 10433da084b3Smrg 10443da084b3SmrgEOF 10453da084b3Smrg else 10463da084b3Smrg # Append the name of the non-PIC object the libtool object file. 10473da084b3Smrg # Only append if the libtool object file exists. 10483da084b3Smrg test -z "$run" && cat >> ${libobj}T <<EOF 10493da084b3Smrg# Name of the non-PIC object. 10503da084b3Smrgnon_pic_object=none 10513da084b3Smrg 10523da084b3SmrgEOF 10533da084b3Smrg fi 10543da084b3Smrg 10553da084b3Smrg $run $mv "${libobj}T" "${libobj}" 10563da084b3Smrg 10573da084b3Smrg # Unlock the critical section if it was locked 10583da084b3Smrg if test "$need_locks" != no; then 10593da084b3Smrg $run $rm "$lockfile" 10603da084b3Smrg fi 10613da084b3Smrg 10623da084b3Smrg exit $EXIT_SUCCESS 10633da084b3Smrg ;; 10643da084b3Smrg 10653da084b3Smrg # libtool link mode 10663da084b3Smrg link | relink) 10673da084b3Smrg modename="$modename: link" 10683da084b3Smrg case $host in 10693da084b3Smrg *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) 10703da084b3Smrg # It is impossible to link a dll without this setting, and 10713da084b3Smrg # we shouldn't force the makefile maintainer to figure out 10723da084b3Smrg # which system we are compiling for in order to pass an extra 10733da084b3Smrg # flag for every libtool invocation. 10743da084b3Smrg # allow_undefined=no 10753da084b3Smrg 10763da084b3Smrg # FIXME: Unfortunately, there are problems with the above when trying 10773da084b3Smrg # to make a dll which has undefined symbols, in which case not 10783da084b3Smrg # even a static library is built. For now, we need to specify 10793da084b3Smrg # -no-undefined on the libtool link line when we can be certain 10803da084b3Smrg # that all symbols are satisfied, otherwise we get a static library. 10813da084b3Smrg allow_undefined=yes 10823da084b3Smrg ;; 10833da084b3Smrg *) 10843da084b3Smrg allow_undefined=yes 10853da084b3Smrg ;; 10863da084b3Smrg esac 10873da084b3Smrg libtool_args="$nonopt" 10883da084b3Smrg base_compile="$nonopt $@" 10893da084b3Smrg compile_command="$nonopt" 10903da084b3Smrg finalize_command="$nonopt" 10913da084b3Smrg 10923da084b3Smrg compile_rpath= 10933da084b3Smrg finalize_rpath= 10943da084b3Smrg compile_shlibpath= 10953da084b3Smrg finalize_shlibpath= 10963da084b3Smrg convenience= 10973da084b3Smrg old_convenience= 10983da084b3Smrg deplibs= 10993da084b3Smrg old_deplibs= 11003da084b3Smrg compiler_flags= 11013da084b3Smrg linker_flags= 11023da084b3Smrg dllsearchpath= 11033da084b3Smrg lib_search_path=`pwd` 11043da084b3Smrg inst_prefix_dir= 11053da084b3Smrg 11063da084b3Smrg avoid_version=no 11073da084b3Smrg dlfiles= 11083da084b3Smrg dlprefiles= 11093da084b3Smrg dlself=no 11103da084b3Smrg export_dynamic=no 11113da084b3Smrg export_symbols= 11123da084b3Smrg export_symbols_regex= 11133da084b3Smrg generated= 11143da084b3Smrg libobjs= 11153da084b3Smrg ltlibs= 11163da084b3Smrg module=no 11173da084b3Smrg no_install=no 11183da084b3Smrg objs= 11193da084b3Smrg non_pic_objects= 11203da084b3Smrg notinst_path= # paths that contain not-installed libtool libraries 11213da084b3Smrg precious_files_regex= 11223da084b3Smrg prefer_static_libs=no 11233da084b3Smrg preload=no 11243da084b3Smrg prev= 11253da084b3Smrg prevarg= 11263da084b3Smrg release= 11273da084b3Smrg rpath= 11283da084b3Smrg xrpath= 11293da084b3Smrg perm_rpath= 11303da084b3Smrg temp_rpath= 11313da084b3Smrg thread_safe=no 11323da084b3Smrg vinfo= 11333da084b3Smrg vinfo_number=no 11343da084b3Smrg 11353da084b3Smrg func_infer_tag $base_compile 11363da084b3Smrg 11373da084b3Smrg # We need to know -static, to get the right output filenames. 11383da084b3Smrg for arg 11393da084b3Smrg do 11403da084b3Smrg case $arg in 11413da084b3Smrg -all-static | -static) 11423da084b3Smrg if test "X$arg" = "X-all-static"; then 11433da084b3Smrg if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then 11443da084b3Smrg $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 11453da084b3Smrg fi 11463da084b3Smrg if test -n "$link_static_flag"; then 11473da084b3Smrg dlopen_self=$dlopen_self_static 11483da084b3Smrg fi 11493da084b3Smrg prefer_static_libs=yes 11503da084b3Smrg else 11513da084b3Smrg if test -z "$pic_flag" && test -n "$link_static_flag"; then 11523da084b3Smrg dlopen_self=$dlopen_self_static 11533da084b3Smrg fi 11543da084b3Smrg prefer_static_libs=built 11553da084b3Smrg fi 11563da084b3Smrg build_libtool_libs=no 11573da084b3Smrg build_old_libs=yes 11583da084b3Smrg break 11593da084b3Smrg ;; 11603da084b3Smrg esac 11613da084b3Smrg done 11623da084b3Smrg 11633da084b3Smrg # See if our shared archives depend on static archives. 11643da084b3Smrg test -n "$old_archive_from_new_cmds" && build_old_libs=yes 11653da084b3Smrg 11663da084b3Smrg # Go through the arguments, transforming them on the way. 11673da084b3Smrg while test "$#" -gt 0; do 11683da084b3Smrg arg="$1" 11693da084b3Smrg shift 11703da084b3Smrg case $arg in 11713da084b3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 11723da084b3Smrg qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test 11733da084b3Smrg ;; 11743da084b3Smrg *) qarg=$arg ;; 11753da084b3Smrg esac 11763da084b3Smrg libtool_args="$libtool_args $qarg" 11773da084b3Smrg 11783da084b3Smrg # If the previous option needs an argument, assign it. 11793da084b3Smrg if test -n "$prev"; then 11803da084b3Smrg case $prev in 11813da084b3Smrg output) 11823da084b3Smrg compile_command="$compile_command @OUTPUT@" 11833da084b3Smrg finalize_command="$finalize_command @OUTPUT@" 11843da084b3Smrg ;; 11853da084b3Smrg esac 11863da084b3Smrg 11873da084b3Smrg case $prev in 11883da084b3Smrg dlfiles|dlprefiles) 11893da084b3Smrg if test "$preload" = no; then 11903da084b3Smrg # Add the symbol object into the linking commands. 11913da084b3Smrg compile_command="$compile_command @SYMFILE@" 11923da084b3Smrg finalize_command="$finalize_command @SYMFILE@" 11933da084b3Smrg preload=yes 11943da084b3Smrg fi 11953da084b3Smrg case $arg in 11963da084b3Smrg *.la | *.lo) ;; # We handle these cases below. 11973da084b3Smrg force) 11983da084b3Smrg if test "$dlself" = no; then 11993da084b3Smrg dlself=needless 12003da084b3Smrg export_dynamic=yes 12013da084b3Smrg fi 12023da084b3Smrg prev= 12033da084b3Smrg continue 12043da084b3Smrg ;; 12053da084b3Smrg self) 12063da084b3Smrg if test "$prev" = dlprefiles; then 12073da084b3Smrg dlself=yes 12083da084b3Smrg elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then 12093da084b3Smrg dlself=yes 12103da084b3Smrg else 12113da084b3Smrg dlself=needless 12123da084b3Smrg export_dynamic=yes 12133da084b3Smrg fi 12143da084b3Smrg prev= 12153da084b3Smrg continue 12163da084b3Smrg ;; 12173da084b3Smrg *) 12183da084b3Smrg if test "$prev" = dlfiles; then 12193da084b3Smrg dlfiles="$dlfiles $arg" 12203da084b3Smrg else 12213da084b3Smrg dlprefiles="$dlprefiles $arg" 12223da084b3Smrg fi 12233da084b3Smrg prev= 12243da084b3Smrg continue 12253da084b3Smrg ;; 12263da084b3Smrg esac 12273da084b3Smrg ;; 12283da084b3Smrg expsyms) 12293da084b3Smrg export_symbols="$arg" 12303da084b3Smrg if test ! -f "$arg"; then 12313da084b3Smrg $echo "$modename: symbol file \`$arg' does not exist" 12323da084b3Smrg exit $EXIT_FAILURE 12333da084b3Smrg fi 12343da084b3Smrg prev= 12353da084b3Smrg continue 12363da084b3Smrg ;; 12373da084b3Smrg expsyms_regex) 12383da084b3Smrg export_symbols_regex="$arg" 12393da084b3Smrg prev= 12403da084b3Smrg continue 12413da084b3Smrg ;; 12423da084b3Smrg inst_prefix) 12433da084b3Smrg inst_prefix_dir="$arg" 12443da084b3Smrg prev= 12453da084b3Smrg continue 12463da084b3Smrg ;; 12473da084b3Smrg precious_regex) 12483da084b3Smrg precious_files_regex="$arg" 12493da084b3Smrg prev= 12503da084b3Smrg continue 12513da084b3Smrg ;; 12523da084b3Smrg release) 12533da084b3Smrg release="-$arg" 12543da084b3Smrg prev= 12553da084b3Smrg continue 12563da084b3Smrg ;; 12573da084b3Smrg objectlist) 12583da084b3Smrg if test -f "$arg"; then 12593da084b3Smrg save_arg=$arg 12603da084b3Smrg moreargs= 12613da084b3Smrg for fil in `cat $save_arg` 12623da084b3Smrg do 12633da084b3Smrg# moreargs="$moreargs $fil" 12643da084b3Smrg arg=$fil 12653da084b3Smrg # A libtool-controlled object. 12663da084b3Smrg 12673da084b3Smrg # Check to see that this really is a libtool object. 12683da084b3Smrg if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 12693da084b3Smrg pic_object= 12703da084b3Smrg non_pic_object= 12713da084b3Smrg 12723da084b3Smrg # Read the .lo file 12733da084b3Smrg # If there is no directory component, then add one. 12743da084b3Smrg case $arg in 12753da084b3Smrg */* | *\\*) . $arg ;; 12763da084b3Smrg *) . ./$arg ;; 12773da084b3Smrg esac 12783da084b3Smrg 12793da084b3Smrg if test -z "$pic_object" || \ 12803da084b3Smrg test -z "$non_pic_object" || 12813da084b3Smrg test "$pic_object" = none && \ 12823da084b3Smrg test "$non_pic_object" = none; then 12833da084b3Smrg $echo "$modename: cannot find name of object for \`$arg'" 1>&2 12843da084b3Smrg exit $EXIT_FAILURE 12853da084b3Smrg fi 12863da084b3Smrg 12873da084b3Smrg # Extract subdirectory from the argument. 12883da084b3Smrg xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` 12893da084b3Smrg if test "X$xdir" = "X$arg"; then 12903da084b3Smrg xdir= 12913da084b3Smrg else 12923da084b3Smrg xdir="$xdir/" 12933da084b3Smrg fi 12943da084b3Smrg 12953da084b3Smrg if test "$pic_object" != none; then 12963da084b3Smrg # Prepend the subdirectory the object is found in. 12973da084b3Smrg pic_object="$xdir$pic_object" 12983da084b3Smrg 12993da084b3Smrg if test "$prev" = dlfiles; then 13003da084b3Smrg if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then 13013da084b3Smrg dlfiles="$dlfiles $pic_object" 13023da084b3Smrg prev= 13033da084b3Smrg continue 13043da084b3Smrg else 13053da084b3Smrg # If libtool objects are unsupported, then we need to preload. 13063da084b3Smrg prev=dlprefiles 13073da084b3Smrg fi 13083da084b3Smrg fi 13093da084b3Smrg 13103da084b3Smrg # CHECK ME: I think I busted this. -Ossama 13113da084b3Smrg if test "$prev" = dlprefiles; then 13123da084b3Smrg # Preload the old-style object. 13133da084b3Smrg dlprefiles="$dlprefiles $pic_object" 13143da084b3Smrg prev= 13153da084b3Smrg fi 13163da084b3Smrg 13173da084b3Smrg # A PIC object. 13183da084b3Smrg libobjs="$libobjs $pic_object" 13193da084b3Smrg arg="$pic_object" 13203da084b3Smrg fi 13213da084b3Smrg 13223da084b3Smrg # Non-PIC object. 13233da084b3Smrg if test "$non_pic_object" != none; then 13243da084b3Smrg # Prepend the subdirectory the object is found in. 13253da084b3Smrg non_pic_object="$xdir$non_pic_object" 13263da084b3Smrg 13273da084b3Smrg # A standard non-PIC object 13283da084b3Smrg non_pic_objects="$non_pic_objects $non_pic_object" 13293da084b3Smrg if test -z "$pic_object" || test "$pic_object" = none ; then 13303da084b3Smrg arg="$non_pic_object" 13313da084b3Smrg fi 13323da084b3Smrg else 13333da084b3Smrg # If the PIC object exists, use it instead. 13343da084b3Smrg # $xdir was prepended to $pic_object above. 13353da084b3Smrg non_pic_object="$pic_object" 13363da084b3Smrg non_pic_objects="$non_pic_objects $non_pic_object" 13373da084b3Smrg fi 13383da084b3Smrg else 13393da084b3Smrg # Only an error if not doing a dry-run. 13403da084b3Smrg if test -z "$run"; then 13413da084b3Smrg $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 13423da084b3Smrg exit $EXIT_FAILURE 13433da084b3Smrg else 13443da084b3Smrg # Dry-run case. 13453da084b3Smrg 13463da084b3Smrg # Extract subdirectory from the argument. 13473da084b3Smrg xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` 13483da084b3Smrg if test "X$xdir" = "X$arg"; then 13493da084b3Smrg xdir= 13503da084b3Smrg else 13513da084b3Smrg xdir="$xdir/" 13523da084b3Smrg fi 13533da084b3Smrg 13543da084b3Smrg pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` 13553da084b3Smrg non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` 13563da084b3Smrg libobjs="$libobjs $pic_object" 13573da084b3Smrg non_pic_objects="$non_pic_objects $non_pic_object" 13583da084b3Smrg fi 13593da084b3Smrg fi 13603da084b3Smrg done 13613da084b3Smrg else 13623da084b3Smrg $echo "$modename: link input file \`$save_arg' does not exist" 13633da084b3Smrg exit $EXIT_FAILURE 13643da084b3Smrg fi 13653da084b3Smrg arg=$save_arg 13663da084b3Smrg prev= 13673da084b3Smrg continue 13683da084b3Smrg ;; 13693da084b3Smrg rpath | xrpath) 13703da084b3Smrg # We need an absolute path. 13713da084b3Smrg case $arg in 13723da084b3Smrg [\\/]* | [A-Za-z]:[\\/]*) ;; 13733da084b3Smrg *) 13743da084b3Smrg $echo "$modename: only absolute run-paths are allowed" 1>&2 13753da084b3Smrg exit $EXIT_FAILURE 13763da084b3Smrg ;; 13773da084b3Smrg esac 13783da084b3Smrg if test "$prev" = rpath; then 13793da084b3Smrg case "$rpath " in 13803da084b3Smrg *" $arg "*) ;; 13813da084b3Smrg *) rpath="$rpath $arg" ;; 13823da084b3Smrg esac 13833da084b3Smrg else 13843da084b3Smrg case "$xrpath " in 13853da084b3Smrg *" $arg "*) ;; 13863da084b3Smrg *) xrpath="$xrpath $arg" ;; 13873da084b3Smrg esac 13883da084b3Smrg fi 13893da084b3Smrg prev= 13903da084b3Smrg continue 13913da084b3Smrg ;; 13923da084b3Smrg xcompiler) 13933da084b3Smrg compiler_flags="$compiler_flags $qarg" 13943da084b3Smrg prev= 13953da084b3Smrg compile_command="$compile_command $qarg" 13963da084b3Smrg finalize_command="$finalize_command $qarg" 13973da084b3Smrg continue 13983da084b3Smrg ;; 13993da084b3Smrg xlinker) 14003da084b3Smrg linker_flags="$linker_flags $qarg" 14013da084b3Smrg compiler_flags="$compiler_flags $wl$qarg" 14023da084b3Smrg prev= 14033da084b3Smrg compile_command="$compile_command $wl$qarg" 14043da084b3Smrg finalize_command="$finalize_command $wl$qarg" 14053da084b3Smrg continue 14063da084b3Smrg ;; 14073da084b3Smrg xcclinker) 14083da084b3Smrg linker_flags="$linker_flags $qarg" 14093da084b3Smrg compiler_flags="$compiler_flags $qarg" 14103da084b3Smrg prev= 14113da084b3Smrg compile_command="$compile_command $qarg" 14123da084b3Smrg finalize_command="$finalize_command $qarg" 14133da084b3Smrg continue 14143da084b3Smrg ;; 14153da084b3Smrg shrext) 14163da084b3Smrg shrext_cmds="$arg" 14173da084b3Smrg prev= 14183da084b3Smrg continue 14193da084b3Smrg ;; 14203da084b3Smrg darwin_framework|darwin_framework_skip) 14213da084b3Smrg test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" 14223da084b3Smrg compile_command="$compile_command $arg" 14233da084b3Smrg finalize_command="$finalize_command $arg" 14243da084b3Smrg prev= 14253da084b3Smrg continue 14263da084b3Smrg ;; 14273da084b3Smrg *) 14283da084b3Smrg eval "$prev=\"\$arg\"" 14293da084b3Smrg prev= 14303da084b3Smrg continue 14313da084b3Smrg ;; 14323da084b3Smrg esac 14333da084b3Smrg fi # test -n "$prev" 14343da084b3Smrg 14353da084b3Smrg prevarg="$arg" 14363da084b3Smrg 14373da084b3Smrg case $arg in 14383da084b3Smrg -all-static) 14393da084b3Smrg if test -n "$link_static_flag"; then 14403da084b3Smrg compile_command="$compile_command $link_static_flag" 14413da084b3Smrg finalize_command="$finalize_command $link_static_flag" 14423da084b3Smrg fi 14433da084b3Smrg continue 14443da084b3Smrg ;; 14453da084b3Smrg 14463da084b3Smrg -allow-undefined) 14473da084b3Smrg # FIXME: remove this flag sometime in the future. 14483da084b3Smrg $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 14493da084b3Smrg continue 14503da084b3Smrg ;; 14513da084b3Smrg 14523da084b3Smrg -avoid-version) 14533da084b3Smrg avoid_version=yes 14543da084b3Smrg continue 14553da084b3Smrg ;; 14563da084b3Smrg 14573da084b3Smrg -dlopen) 14583da084b3Smrg prev=dlfiles 14593da084b3Smrg continue 14603da084b3Smrg ;; 14613da084b3Smrg 14623da084b3Smrg -dlpreopen) 14633da084b3Smrg prev=dlprefiles 14643da084b3Smrg continue 14653da084b3Smrg ;; 14663da084b3Smrg 14673da084b3Smrg -export-dynamic) 14683da084b3Smrg export_dynamic=yes 14693da084b3Smrg continue 14703da084b3Smrg ;; 14713da084b3Smrg 14723da084b3Smrg -export-symbols | -export-symbols-regex) 14733da084b3Smrg if test -n "$export_symbols" || test -n "$export_symbols_regex"; then 14743da084b3Smrg $echo "$modename: more than one -exported-symbols argument is not allowed" 14753da084b3Smrg exit $EXIT_FAILURE 14763da084b3Smrg fi 14773da084b3Smrg if test "X$arg" = "X-export-symbols"; then 14783da084b3Smrg prev=expsyms 14793da084b3Smrg else 14803da084b3Smrg prev=expsyms_regex 14813da084b3Smrg fi 14823da084b3Smrg continue 14833da084b3Smrg ;; 14843da084b3Smrg 14853da084b3Smrg -framework|-arch|-isysroot) 14863da084b3Smrg case " $CC " in 14873da084b3Smrg *" ${arg} ${1} "* | *" ${arg} ${1} "*) 14883da084b3Smrg prev=darwin_framework_skip ;; 14893da084b3Smrg *) compiler_flags="$compiler_flags $arg" 14903da084b3Smrg prev=darwin_framework ;; 14913da084b3Smrg esac 14923da084b3Smrg compile_command="$compile_command $arg" 14933da084b3Smrg finalize_command="$finalize_command $arg" 14943da084b3Smrg continue 14953da084b3Smrg ;; 14963da084b3Smrg 14973da084b3Smrg -inst-prefix-dir) 14983da084b3Smrg prev=inst_prefix 14993da084b3Smrg continue 15003da084b3Smrg ;; 15013da084b3Smrg 15023da084b3Smrg # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* 15033da084b3Smrg # so, if we see these flags be careful not to treat them like -L 15043da084b3Smrg -L[A-Z][A-Z]*:*) 15053da084b3Smrg case $with_gcc/$host in 15063da084b3Smrg no/*-*-irix* | /*-*-irix*) 15073da084b3Smrg compile_command="$compile_command $arg" 15083da084b3Smrg finalize_command="$finalize_command $arg" 15093da084b3Smrg ;; 15103da084b3Smrg esac 15113da084b3Smrg continue 15123da084b3Smrg ;; 15133da084b3Smrg 15143da084b3Smrg -L*) 15153da084b3Smrg dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` 15163da084b3Smrg # We need an absolute path. 15173da084b3Smrg case $dir in 15183da084b3Smrg [\\/]* | [A-Za-z]:[\\/]*) ;; 15193da084b3Smrg *) 15203da084b3Smrg absdir=`cd "$dir" && pwd` 15213da084b3Smrg if test -z "$absdir"; then 15223da084b3Smrg $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 15233da084b3Smrg absdir="$dir" 15243da084b3Smrg notinst_path="$notinst_path $dir" 15253da084b3Smrg fi 15263da084b3Smrg dir="$absdir" 15273da084b3Smrg ;; 15283da084b3Smrg esac 15293da084b3Smrg case "$deplibs " in 15303da084b3Smrg *" -L$dir "*) ;; 15313da084b3Smrg *) 15323da084b3Smrg deplibs="$deplibs -L$dir" 15333da084b3Smrg lib_search_path="$lib_search_path $dir" 15343da084b3Smrg ;; 15353da084b3Smrg esac 15363da084b3Smrg case $host in 15373da084b3Smrg *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) 15383da084b3Smrg testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` 15393da084b3Smrg case :$dllsearchpath: in 15403da084b3Smrg *":$dir:"*) ;; 15413da084b3Smrg *) dllsearchpath="$dllsearchpath:$dir";; 15423da084b3Smrg esac 15433da084b3Smrg case :$dllsearchpath: in 15443da084b3Smrg *":$testbindir:"*) ;; 15453da084b3Smrg *) dllsearchpath="$dllsearchpath:$testbindir";; 15463da084b3Smrg esac 15473da084b3Smrg ;; 15483da084b3Smrg esac 15493da084b3Smrg continue 15503da084b3Smrg ;; 15513da084b3Smrg 15523da084b3Smrg -l*) 15533da084b3Smrg if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then 15543da084b3Smrg case $host in 15553da084b3Smrg *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) 15563da084b3Smrg # These systems don't actually have a C or math library (as such) 15573da084b3Smrg continue 15583da084b3Smrg ;; 15593da084b3Smrg *-*-os2*) 15603da084b3Smrg # These systems don't actually have a C library (as such) 15613da084b3Smrg test "X$arg" = "X-lc" && continue 15623da084b3Smrg ;; 15633da084b3Smrg *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) 15643da084b3Smrg # Do not include libc due to us having libc/libc_r. 15653da084b3Smrg test "X$arg" = "X-lc" && continue 15663da084b3Smrg ;; 15673da084b3Smrg *-*-rhapsody* | *-*-darwin1.[012]) 15683da084b3Smrg # Rhapsody C and math libraries are in the System framework 15693da084b3Smrg deplibs="$deplibs -framework System" 15703da084b3Smrg continue 15713da084b3Smrg ;; 15723da084b3Smrg *-*-sco3.2v5* | *-*-sco5v6*) 15733da084b3Smrg # Causes problems with __ctype 15743da084b3Smrg test "X$arg" = "X-lc" && continue 15753da084b3Smrg ;; 15763da084b3Smrg *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) 15773da084b3Smrg # Compiler inserts libc in the correct place for threads to work 15783da084b3Smrg test "X$arg" = "X-lc" && continue 15793da084b3Smrg ;; 15803da084b3Smrg esac 15813da084b3Smrg elif test "X$arg" = "X-lc_r"; then 15823da084b3Smrg case $host in 15833da084b3Smrg *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) 15843da084b3Smrg # Do not include libc_r directly, use -pthread flag. 15853da084b3Smrg continue 15863da084b3Smrg ;; 15873da084b3Smrg esac 15883da084b3Smrg fi 15893da084b3Smrg deplibs="$deplibs $arg" 15903da084b3Smrg continue 15913da084b3Smrg ;; 15923da084b3Smrg 15933da084b3Smrg # Tru64 UNIX uses -model [arg] to determine the layout of C++ 15943da084b3Smrg # classes, name mangling, and exception handling. 15953da084b3Smrg -model) 15963da084b3Smrg compile_command="$compile_command $arg" 15973da084b3Smrg compiler_flags="$compiler_flags $arg" 15983da084b3Smrg finalize_command="$finalize_command $arg" 15993da084b3Smrg prev=xcompiler 16003da084b3Smrg continue 16013da084b3Smrg ;; 16023da084b3Smrg 16033da084b3Smrg -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) 16043da084b3Smrg compiler_flags="$compiler_flags $arg" 16053da084b3Smrg compile_command="$compile_command $arg" 16063da084b3Smrg finalize_command="$finalize_command $arg" 16073da084b3Smrg continue 16083da084b3Smrg ;; 16093da084b3Smrg 16103da084b3Smrg -module) 16113da084b3Smrg module=yes 16123da084b3Smrg continue 16133da084b3Smrg ;; 16143da084b3Smrg 16153da084b3Smrg # -64, -mips[0-9] enable 64-bit mode on the SGI compiler 16163da084b3Smrg # -r[0-9][0-9]* specifies the processor on the SGI compiler 16173da084b3Smrg # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler 16183da084b3Smrg # +DA*, +DD* enable 64-bit mode on the HP compiler 16193da084b3Smrg # -q* pass through compiler args for the IBM compiler 16203da084b3Smrg # -m* pass through architecture-specific compiler args for GCC 16213da084b3Smrg # -m*, -t[45]*, -txscale* pass through architecture-specific 16223da084b3Smrg # compiler args for GCC 16233da084b3Smrg # -pg pass through profiling flag for GCC 16243da084b3Smrg # @file GCC response files 16253da084b3Smrg -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ 16263da084b3Smrg -t[45]*|-txscale*|@*) 16273da084b3Smrg 16283da084b3Smrg # Unknown arguments in both finalize_command and compile_command need 16293da084b3Smrg # to be aesthetically quoted because they are evaled later. 16303da084b3Smrg arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` 16313da084b3Smrg case $arg in 16323da084b3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 16333da084b3Smrg arg="\"$arg\"" 16343da084b3Smrg ;; 16353da084b3Smrg esac 16363da084b3Smrg compile_command="$compile_command $arg" 16373da084b3Smrg finalize_command="$finalize_command $arg" 16383da084b3Smrg compiler_flags="$compiler_flags $arg" 16393da084b3Smrg continue 16403da084b3Smrg ;; 16413da084b3Smrg 16423da084b3Smrg -shrext) 16433da084b3Smrg prev=shrext 16443da084b3Smrg continue 16453da084b3Smrg ;; 16463da084b3Smrg 16473da084b3Smrg -no-fast-install) 16483da084b3Smrg fast_install=no 16493da084b3Smrg continue 16503da084b3Smrg ;; 16513da084b3Smrg 16523da084b3Smrg -no-install) 16533da084b3Smrg case $host in 16543da084b3Smrg *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) 16553da084b3Smrg # The PATH hackery in wrapper scripts is required on Windows 16563da084b3Smrg # in order for the loader to find any dlls it needs. 16573da084b3Smrg $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 16583da084b3Smrg $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 16593da084b3Smrg fast_install=no 16603da084b3Smrg ;; 16613da084b3Smrg *) no_install=yes ;; 16623da084b3Smrg esac 16633da084b3Smrg continue 16643da084b3Smrg ;; 16653da084b3Smrg 16663da084b3Smrg -no-undefined) 16673da084b3Smrg allow_undefined=no 16683da084b3Smrg continue 16693da084b3Smrg ;; 16703da084b3Smrg 16713da084b3Smrg -objectlist) 16723da084b3Smrg prev=objectlist 16733da084b3Smrg continue 16743da084b3Smrg ;; 16753da084b3Smrg 16763da084b3Smrg -o) prev=output ;; 16773da084b3Smrg 16783da084b3Smrg -precious-files-regex) 16793da084b3Smrg prev=precious_regex 16803da084b3Smrg continue 16813da084b3Smrg ;; 16823da084b3Smrg 16833da084b3Smrg -release) 16843da084b3Smrg prev=release 16853da084b3Smrg continue 16863da084b3Smrg ;; 16873da084b3Smrg 16883da084b3Smrg -rpath) 16893da084b3Smrg prev=rpath 16903da084b3Smrg continue 16913da084b3Smrg ;; 16923da084b3Smrg 16933da084b3Smrg -R) 16943da084b3Smrg prev=xrpath 16953da084b3Smrg continue 16963da084b3Smrg ;; 16973da084b3Smrg 16983da084b3Smrg -R*) 16993da084b3Smrg dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` 17003da084b3Smrg # We need an absolute path. 17013da084b3Smrg case $dir in 17023da084b3Smrg [\\/]* | [A-Za-z]:[\\/]*) ;; 17033da084b3Smrg *) 17043da084b3Smrg $echo "$modename: only absolute run-paths are allowed" 1>&2 17053da084b3Smrg exit $EXIT_FAILURE 17063da084b3Smrg ;; 17073da084b3Smrg esac 17083da084b3Smrg case "$xrpath " in 17093da084b3Smrg *" $dir "*) ;; 17103da084b3Smrg *) xrpath="$xrpath $dir" ;; 17113da084b3Smrg esac 17123da084b3Smrg continue 17133da084b3Smrg ;; 17143da084b3Smrg 17153da084b3Smrg -static) 17163da084b3Smrg # The effects of -static are defined in a previous loop. 17173da084b3Smrg # We used to do the same as -all-static on platforms that 17183da084b3Smrg # didn't have a PIC flag, but the assumption that the effects 17193da084b3Smrg # would be equivalent was wrong. It would break on at least 17203da084b3Smrg # Digital Unix and AIX. 17213da084b3Smrg continue 17223da084b3Smrg ;; 17233da084b3Smrg 17243da084b3Smrg -thread-safe) 17253da084b3Smrg thread_safe=yes 17263da084b3Smrg continue 17273da084b3Smrg ;; 17283da084b3Smrg 17293da084b3Smrg -version-info) 17303da084b3Smrg prev=vinfo 17313da084b3Smrg continue 17323da084b3Smrg ;; 17333da084b3Smrg -version-number) 17343da084b3Smrg prev=vinfo 17353da084b3Smrg vinfo_number=yes 17363da084b3Smrg continue 17373da084b3Smrg ;; 17383da084b3Smrg 17393da084b3Smrg -Wc,*) 17403da084b3Smrg args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` 17413da084b3Smrg arg= 17423da084b3Smrg save_ifs="$IFS"; IFS=',' 17433da084b3Smrg for flag in $args; do 17443da084b3Smrg IFS="$save_ifs" 17453da084b3Smrg case $flag in 17463da084b3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 17473da084b3Smrg flag="\"$flag\"" 17483da084b3Smrg ;; 17493da084b3Smrg esac 17503da084b3Smrg arg="$arg $wl$flag" 17513da084b3Smrg compiler_flags="$compiler_flags $flag" 17523da084b3Smrg done 17533da084b3Smrg IFS="$save_ifs" 17543da084b3Smrg arg=`$echo "X$arg" | $Xsed -e "s/^ //"` 17553da084b3Smrg ;; 17563da084b3Smrg 17573da084b3Smrg -Wl,*) 17583da084b3Smrg args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` 17593da084b3Smrg arg= 17603da084b3Smrg save_ifs="$IFS"; IFS=',' 17613da084b3Smrg for flag in $args; do 17623da084b3Smrg IFS="$save_ifs" 17633da084b3Smrg case $flag in 17643da084b3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 17653da084b3Smrg flag="\"$flag\"" 17663da084b3Smrg ;; 17673da084b3Smrg esac 17683da084b3Smrg arg="$arg $wl$flag" 17693da084b3Smrg compiler_flags="$compiler_flags $wl$flag" 17703da084b3Smrg linker_flags="$linker_flags $flag" 17713da084b3Smrg done 17723da084b3Smrg IFS="$save_ifs" 17733da084b3Smrg arg=`$echo "X$arg" | $Xsed -e "s/^ //"` 17743da084b3Smrg ;; 17753da084b3Smrg 17763da084b3Smrg -Xcompiler) 17773da084b3Smrg prev=xcompiler 17783da084b3Smrg continue 17793da084b3Smrg ;; 17803da084b3Smrg 17813da084b3Smrg -Xlinker) 17823da084b3Smrg prev=xlinker 17833da084b3Smrg continue 17843da084b3Smrg ;; 17853da084b3Smrg 17863da084b3Smrg -XCClinker) 17873da084b3Smrg prev=xcclinker 17883da084b3Smrg continue 17893da084b3Smrg ;; 17903da084b3Smrg 17913da084b3Smrg # Some other compiler flag. 17923da084b3Smrg -* | +*) 17933da084b3Smrg # Unknown arguments in both finalize_command and compile_command need 17943da084b3Smrg # to be aesthetically quoted because they are evaled later. 17953da084b3Smrg arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` 17963da084b3Smrg case $arg in 17973da084b3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 17983da084b3Smrg arg="\"$arg\"" 17993da084b3Smrg ;; 18003da084b3Smrg esac 18013da084b3Smrg ;; 18023da084b3Smrg 18033da084b3Smrg *.$objext) 18043da084b3Smrg # A standard object. 18053da084b3Smrg objs="$objs $arg" 18063da084b3Smrg ;; 18073da084b3Smrg 18083da084b3Smrg *.lo) 18093da084b3Smrg # A libtool-controlled object. 18103da084b3Smrg 18113da084b3Smrg # Check to see that this really is a libtool object. 18123da084b3Smrg if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 18133da084b3Smrg pic_object= 18143da084b3Smrg non_pic_object= 18153da084b3Smrg 18163da084b3Smrg # Read the .lo file 18173da084b3Smrg # If there is no directory component, then add one. 18183da084b3Smrg case $arg in 18193da084b3Smrg */* | *\\*) . $arg ;; 18203da084b3Smrg *) . ./$arg ;; 18213da084b3Smrg esac 18223da084b3Smrg 18233da084b3Smrg if test -z "$pic_object" || \ 18243da084b3Smrg test -z "$non_pic_object" || 18253da084b3Smrg test "$pic_object" = none && \ 18263da084b3Smrg test "$non_pic_object" = none; then 18273da084b3Smrg $echo "$modename: cannot find name of object for \`$arg'" 1>&2 18283da084b3Smrg exit $EXIT_FAILURE 18293da084b3Smrg fi 18303da084b3Smrg 18313da084b3Smrg # Extract subdirectory from the argument. 18323da084b3Smrg xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` 18333da084b3Smrg if test "X$xdir" = "X$arg"; then 18343da084b3Smrg xdir= 18353da084b3Smrg else 18363da084b3Smrg xdir="$xdir/" 18373da084b3Smrg fi 18383da084b3Smrg 18393da084b3Smrg if test "$pic_object" != none; then 18403da084b3Smrg # Prepend the subdirectory the object is found in. 18413da084b3Smrg pic_object="$xdir$pic_object" 18423da084b3Smrg 18433da084b3Smrg if test "$prev" = dlfiles; then 18443da084b3Smrg if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then 18453da084b3Smrg dlfiles="$dlfiles $pic_object" 18463da084b3Smrg prev= 18473da084b3Smrg continue 18483da084b3Smrg else 18493da084b3Smrg # If libtool objects are unsupported, then we need to preload. 18503da084b3Smrg prev=dlprefiles 18513da084b3Smrg fi 18523da084b3Smrg fi 18533da084b3Smrg 18543da084b3Smrg # CHECK ME: I think I busted this. -Ossama 18553da084b3Smrg if test "$prev" = dlprefiles; then 18563da084b3Smrg # Preload the old-style object. 18573da084b3Smrg dlprefiles="$dlprefiles $pic_object" 18583da084b3Smrg prev= 18593da084b3Smrg fi 18603da084b3Smrg 18613da084b3Smrg # A PIC object. 18623da084b3Smrg libobjs="$libobjs $pic_object" 18633da084b3Smrg arg="$pic_object" 18643da084b3Smrg fi 18653da084b3Smrg 18663da084b3Smrg # Non-PIC object. 18673da084b3Smrg if test "$non_pic_object" != none; then 18683da084b3Smrg # Prepend the subdirectory the object is found in. 18693da084b3Smrg non_pic_object="$xdir$non_pic_object" 18703da084b3Smrg 18713da084b3Smrg # A standard non-PIC object 18723da084b3Smrg non_pic_objects="$non_pic_objects $non_pic_object" 18733da084b3Smrg if test -z "$pic_object" || test "$pic_object" = none ; then 18743da084b3Smrg arg="$non_pic_object" 18753da084b3Smrg fi 18763da084b3Smrg else 18773da084b3Smrg # If the PIC object exists, use it instead. 18783da084b3Smrg # $xdir was prepended to $pic_object above. 18793da084b3Smrg non_pic_object="$pic_object" 18803da084b3Smrg non_pic_objects="$non_pic_objects $non_pic_object" 18813da084b3Smrg fi 18823da084b3Smrg else 18833da084b3Smrg # Only an error if not doing a dry-run. 18843da084b3Smrg if test -z "$run"; then 18853da084b3Smrg $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 18863da084b3Smrg exit $EXIT_FAILURE 18873da084b3Smrg else 18883da084b3Smrg # Dry-run case. 18893da084b3Smrg 18903da084b3Smrg # Extract subdirectory from the argument. 18913da084b3Smrg xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` 18923da084b3Smrg if test "X$xdir" = "X$arg"; then 18933da084b3Smrg xdir= 18943da084b3Smrg else 18953da084b3Smrg xdir="$xdir/" 18963da084b3Smrg fi 18973da084b3Smrg 18983da084b3Smrg pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` 18993da084b3Smrg non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` 19003da084b3Smrg libobjs="$libobjs $pic_object" 19013da084b3Smrg non_pic_objects="$non_pic_objects $non_pic_object" 19023da084b3Smrg fi 19033da084b3Smrg fi 19043da084b3Smrg ;; 19053da084b3Smrg 19063da084b3Smrg *.$libext) 19073da084b3Smrg # An archive. 19083da084b3Smrg deplibs="$deplibs $arg" 19093da084b3Smrg old_deplibs="$old_deplibs $arg" 19103da084b3Smrg continue 19113da084b3Smrg ;; 19123da084b3Smrg 19133da084b3Smrg *.la) 19143da084b3Smrg # A libtool-controlled library. 19153da084b3Smrg 19163da084b3Smrg if test "$prev" = dlfiles; then 19173da084b3Smrg # This library was specified with -dlopen. 19183da084b3Smrg dlfiles="$dlfiles $arg" 19193da084b3Smrg prev= 19203da084b3Smrg elif test "$prev" = dlprefiles; then 19213da084b3Smrg # The library was specified with -dlpreopen. 19223da084b3Smrg dlprefiles="$dlprefiles $arg" 19233da084b3Smrg prev= 19243da084b3Smrg else 19253da084b3Smrg deplibs="$deplibs $arg" 19263da084b3Smrg fi 19273da084b3Smrg continue 19283da084b3Smrg ;; 19293da084b3Smrg 19303da084b3Smrg # Some other compiler argument. 19313da084b3Smrg *) 19323da084b3Smrg # Unknown arguments in both finalize_command and compile_command need 19333da084b3Smrg # to be aesthetically quoted because they are evaled later. 19343da084b3Smrg arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` 19353da084b3Smrg case $arg in 19363da084b3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 19373da084b3Smrg arg="\"$arg\"" 19383da084b3Smrg ;; 19393da084b3Smrg esac 19403da084b3Smrg ;; 19413da084b3Smrg esac # arg 19423da084b3Smrg 19433da084b3Smrg # Now actually substitute the argument into the commands. 19443da084b3Smrg if test -n "$arg"; then 19453da084b3Smrg compile_command="$compile_command $arg" 19463da084b3Smrg finalize_command="$finalize_command $arg" 19473da084b3Smrg fi 19483da084b3Smrg done # argument parsing loop 19493da084b3Smrg 19503da084b3Smrg if test -n "$prev"; then 19513da084b3Smrg $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 19523da084b3Smrg $echo "$help" 1>&2 19533da084b3Smrg exit $EXIT_FAILURE 19543da084b3Smrg fi 19553da084b3Smrg 19563da084b3Smrg if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then 19573da084b3Smrg eval arg=\"$export_dynamic_flag_spec\" 19583da084b3Smrg compile_command="$compile_command $arg" 19593da084b3Smrg finalize_command="$finalize_command $arg" 19603da084b3Smrg fi 19613da084b3Smrg 19623da084b3Smrg oldlibs= 19633da084b3Smrg # calculate the name of the file, without its directory 19643da084b3Smrg outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` 19653da084b3Smrg libobjs_save="$libobjs" 19663da084b3Smrg 19673da084b3Smrg if test -n "$shlibpath_var"; then 19683da084b3Smrg # get the directories listed in $shlibpath_var 19693da084b3Smrg eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` 19703da084b3Smrg else 19713da084b3Smrg shlib_search_path= 19723da084b3Smrg fi 19733da084b3Smrg eval sys_lib_search_path=\"$sys_lib_search_path_spec\" 19743da084b3Smrg eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" 19753da084b3Smrg 19763da084b3Smrg output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` 19773da084b3Smrg if test "X$output_objdir" = "X$output"; then 19783da084b3Smrg output_objdir="$objdir" 19793da084b3Smrg else 19803da084b3Smrg output_objdir="$output_objdir/$objdir" 19813da084b3Smrg fi 19823da084b3Smrg # Create the object directory. 19833da084b3Smrg if test ! -d "$output_objdir"; then 19843da084b3Smrg $show "$mkdir $output_objdir" 19853da084b3Smrg $run $mkdir $output_objdir 19863da084b3Smrg exit_status=$? 19873da084b3Smrg if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then 19883da084b3Smrg exit $exit_status 19893da084b3Smrg fi 19903da084b3Smrg fi 19913da084b3Smrg 19923da084b3Smrg # Determine the type of output 19933da084b3Smrg case $output in 19943da084b3Smrg "") 19953da084b3Smrg $echo "$modename: you must specify an output file" 1>&2 19963da084b3Smrg $echo "$help" 1>&2 19973da084b3Smrg exit $EXIT_FAILURE 19983da084b3Smrg ;; 19993da084b3Smrg *.$libext) linkmode=oldlib ;; 20003da084b3Smrg *.lo | *.$objext) linkmode=obj ;; 20013da084b3Smrg *.la) linkmode=lib ;; 20023da084b3Smrg *) linkmode=prog ;; # Anything else should be a program. 20033da084b3Smrg esac 20043da084b3Smrg 20053da084b3Smrg case $host in 20063da084b3Smrg *cygwin* | *mingw* | *pw32*) 20073da084b3Smrg # don't eliminate duplications in $postdeps and $predeps 20083da084b3Smrg duplicate_compiler_generated_deps=yes 20093da084b3Smrg ;; 20103da084b3Smrg *) 20113da084b3Smrg duplicate_compiler_generated_deps=$duplicate_deps 20123da084b3Smrg ;; 20133da084b3Smrg esac 20143da084b3Smrg specialdeplibs= 20153da084b3Smrg 20163da084b3Smrg libs= 20173da084b3Smrg # Find all interdependent deplibs by searching for libraries 20183da084b3Smrg # that are linked more than once (e.g. -la -lb -la) 20193da084b3Smrg for deplib in $deplibs; do 20203da084b3Smrg if test "X$duplicate_deps" = "Xyes" ; then 20213da084b3Smrg case "$libs " in 20223da084b3Smrg *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; 20233da084b3Smrg esac 20243da084b3Smrg fi 20253da084b3Smrg libs="$libs $deplib" 20263da084b3Smrg done 20273da084b3Smrg 20283da084b3Smrg if test "$linkmode" = lib; then 20293da084b3Smrg libs="$predeps $libs $compiler_lib_search_path $postdeps" 20303da084b3Smrg 20313da084b3Smrg # Compute libraries that are listed more than once in $predeps 20323da084b3Smrg # $postdeps and mark them as special (i.e., whose duplicates are 20333da084b3Smrg # not to be eliminated). 20343da084b3Smrg pre_post_deps= 20353da084b3Smrg if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then 20363da084b3Smrg for pre_post_dep in $predeps $postdeps; do 20373da084b3Smrg case "$pre_post_deps " in 20383da084b3Smrg *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; 20393da084b3Smrg esac 20403da084b3Smrg pre_post_deps="$pre_post_deps $pre_post_dep" 20413da084b3Smrg done 20423da084b3Smrg fi 20433da084b3Smrg pre_post_deps= 20443da084b3Smrg fi 20453da084b3Smrg 20463da084b3Smrg deplibs= 20473da084b3Smrg newdependency_libs= 20483da084b3Smrg newlib_search_path= 20493da084b3Smrg need_relink=no # whether we're linking any uninstalled libtool libraries 20503da084b3Smrg notinst_deplibs= # not-installed libtool libraries 20513da084b3Smrg case $linkmode in 20523da084b3Smrg lib) 20533da084b3Smrg passes="conv link" 20543da084b3Smrg for file in $dlfiles $dlprefiles; do 20553da084b3Smrg case $file in 20563da084b3Smrg *.la) ;; 20573da084b3Smrg *) 20583da084b3Smrg $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 20593da084b3Smrg exit $EXIT_FAILURE 20603da084b3Smrg ;; 20613da084b3Smrg esac 20623da084b3Smrg done 20633da084b3Smrg ;; 20643da084b3Smrg prog) 20653da084b3Smrg compile_deplibs= 20663da084b3Smrg finalize_deplibs= 20673da084b3Smrg alldeplibs=no 20683da084b3Smrg newdlfiles= 20693da084b3Smrg newdlprefiles= 20703da084b3Smrg passes="conv scan dlopen dlpreopen link" 20713da084b3Smrg ;; 20723da084b3Smrg *) passes="conv" 20733da084b3Smrg ;; 20743da084b3Smrg esac 20753da084b3Smrg for pass in $passes; do 20763da084b3Smrg if test "$linkmode,$pass" = "lib,link" || 20773da084b3Smrg test "$linkmode,$pass" = "prog,scan"; then 20783da084b3Smrg libs="$deplibs" 20793da084b3Smrg deplibs= 20803da084b3Smrg fi 20813da084b3Smrg if test "$linkmode" = prog; then 20823da084b3Smrg case $pass in 20833da084b3Smrg dlopen) libs="$dlfiles" ;; 20843da084b3Smrg dlpreopen) libs="$dlprefiles" ;; 20853da084b3Smrg link) 20863da084b3Smrg libs="$deplibs %DEPLIBS%" 20873da084b3Smrg test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" 20883da084b3Smrg ;; 20893da084b3Smrg esac 20903da084b3Smrg fi 20913da084b3Smrg if test "$pass" = dlopen; then 20923da084b3Smrg # Collect dlpreopened libraries 20933da084b3Smrg save_deplibs="$deplibs" 20943da084b3Smrg deplibs= 20953da084b3Smrg fi 20963da084b3Smrg for deplib in $libs; do 20973da084b3Smrg lib= 20983da084b3Smrg found=no 20993da084b3Smrg case $deplib in 21003da084b3Smrg -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) 21013da084b3Smrg if test "$linkmode,$pass" = "prog,link"; then 21023da084b3Smrg compile_deplibs="$deplib $compile_deplibs" 21033da084b3Smrg finalize_deplibs="$deplib $finalize_deplibs" 21043da084b3Smrg else 21053da084b3Smrg compiler_flags="$compiler_flags $deplib" 21063da084b3Smrg fi 21073da084b3Smrg continue 21083da084b3Smrg ;; 21093da084b3Smrg -l*) 21103da084b3Smrg if test "$linkmode" != lib && test "$linkmode" != prog; then 21113da084b3Smrg $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 21123da084b3Smrg continue 21133da084b3Smrg fi 21143da084b3Smrg name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` 21153da084b3Smrg for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do 21163da084b3Smrg for search_ext in .la $std_shrext .so .a; do 21173da084b3Smrg # Search the libtool library 21183da084b3Smrg lib="$searchdir/lib${name}${search_ext}" 21193da084b3Smrg if test -f "$lib"; then 21203da084b3Smrg if test "$search_ext" = ".la"; then 21213da084b3Smrg found=yes 21223da084b3Smrg else 21233da084b3Smrg found=no 21243da084b3Smrg fi 21253da084b3Smrg break 2 21263da084b3Smrg fi 21273da084b3Smrg done 21283da084b3Smrg done 21293da084b3Smrg if test "$found" != yes; then 21303da084b3Smrg # deplib doesn't seem to be a libtool library 21313da084b3Smrg if test "$linkmode,$pass" = "prog,link"; then 21323da084b3Smrg compile_deplibs="$deplib $compile_deplibs" 21333da084b3Smrg finalize_deplibs="$deplib $finalize_deplibs" 21343da084b3Smrg else 21353da084b3Smrg deplibs="$deplib $deplibs" 21363da084b3Smrg test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" 21373da084b3Smrg fi 21383da084b3Smrg continue 21393da084b3Smrg else # deplib is a libtool library 21403da084b3Smrg # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, 21413da084b3Smrg # We need to do some special things here, and not later. 21423da084b3Smrg if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 21433da084b3Smrg case " $predeps $postdeps " in 21443da084b3Smrg *" $deplib "*) 21453da084b3Smrg if (${SED} -e '2q' $lib | 21463da084b3Smrg grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 21473da084b3Smrg library_names= 21483da084b3Smrg old_library= 21493da084b3Smrg case $lib in 21503da084b3Smrg */* | *\\*) . $lib ;; 21513da084b3Smrg *) . ./$lib ;; 21523da084b3Smrg esac 21533da084b3Smrg for l in $old_library $library_names; do 21543da084b3Smrg ll="$l" 21553da084b3Smrg done 21563da084b3Smrg if test "X$ll" = "X$old_library" ; then # only static version available 21573da084b3Smrg found=no 21583da084b3Smrg ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` 21593da084b3Smrg test "X$ladir" = "X$lib" && ladir="." 21603da084b3Smrg lib=$ladir/$old_library 21613da084b3Smrg if test "$linkmode,$pass" = "prog,link"; then 21623da084b3Smrg compile_deplibs="$deplib $compile_deplibs" 21633da084b3Smrg finalize_deplibs="$deplib $finalize_deplibs" 21643da084b3Smrg else 21653da084b3Smrg deplibs="$deplib $deplibs" 21663da084b3Smrg test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" 21673da084b3Smrg fi 21683da084b3Smrg continue 21693da084b3Smrg fi 21703da084b3Smrg fi 21713da084b3Smrg ;; 21723da084b3Smrg *) ;; 21733da084b3Smrg esac 21743da084b3Smrg fi 21753da084b3Smrg fi 21763da084b3Smrg ;; # -l 21773da084b3Smrg -L*) 21783da084b3Smrg case $linkmode in 21793da084b3Smrg lib) 21803da084b3Smrg deplibs="$deplib $deplibs" 21813da084b3Smrg test "$pass" = conv && continue 21823da084b3Smrg newdependency_libs="$deplib $newdependency_libs" 21833da084b3Smrg newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` 21843da084b3Smrg ;; 21853da084b3Smrg prog) 21863da084b3Smrg if test "$pass" = conv; then 21873da084b3Smrg deplibs="$deplib $deplibs" 21883da084b3Smrg continue 21893da084b3Smrg fi 21903da084b3Smrg if test "$pass" = scan; then 21913da084b3Smrg deplibs="$deplib $deplibs" 21923da084b3Smrg else 21933da084b3Smrg compile_deplibs="$deplib $compile_deplibs" 21943da084b3Smrg finalize_deplibs="$deplib $finalize_deplibs" 21953da084b3Smrg fi 21963da084b3Smrg newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` 21973da084b3Smrg ;; 21983da084b3Smrg *) 21993da084b3Smrg $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 22003da084b3Smrg ;; 22013da084b3Smrg esac # linkmode 22023da084b3Smrg continue 22033da084b3Smrg ;; # -L 22043da084b3Smrg -R*) 22053da084b3Smrg if test "$pass" = link; then 22063da084b3Smrg dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` 22073da084b3Smrg # Make sure the xrpath contains only unique directories. 22083da084b3Smrg case "$xrpath " in 22093da084b3Smrg *" $dir "*) ;; 22103da084b3Smrg *) xrpath="$xrpath $dir" ;; 22113da084b3Smrg esac 22123da084b3Smrg fi 22133da084b3Smrg deplibs="$deplib $deplibs" 22143da084b3Smrg continue 22153da084b3Smrg ;; 22163da084b3Smrg *.la) lib="$deplib" ;; 22173da084b3Smrg *.$libext) 22183da084b3Smrg if test "$pass" = conv; then 22193da084b3Smrg deplibs="$deplib $deplibs" 22203da084b3Smrg continue 22213da084b3Smrg fi 22223da084b3Smrg case $linkmode in 22233da084b3Smrg lib) 22243da084b3Smrg valid_a_lib=no 22253da084b3Smrg case $deplibs_check_method in 22263da084b3Smrg match_pattern*) 22273da084b3Smrg set dummy $deplibs_check_method 22283da084b3Smrg match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 22293da084b3Smrg if eval $echo \"$deplib\" 2>/dev/null \ 22303da084b3Smrg | $SED 10q \ 22313da084b3Smrg | $EGREP "$match_pattern_regex" > /dev/null; then 22323da084b3Smrg valid_a_lib=yes 22333da084b3Smrg fi 22343da084b3Smrg ;; 22353da084b3Smrg pass_all) 22363da084b3Smrg valid_a_lib=yes 22373da084b3Smrg ;; 22383da084b3Smrg esac 22393da084b3Smrg if test "$valid_a_lib" != yes; then 22403da084b3Smrg $echo 22413da084b3Smrg $echo "*** Warning: Trying to link with static lib archive $deplib." 22423da084b3Smrg $echo "*** I have the capability to make that library automatically link in when" 22433da084b3Smrg $echo "*** you link to this library. But I can only do this if you have a" 22443da084b3Smrg $echo "*** shared version of the library, which you do not appear to have" 22453da084b3Smrg $echo "*** because the file extensions .$libext of this argument makes me believe" 22463da084b3Smrg $echo "*** that it is just a static archive that I should not used here." 22473da084b3Smrg else 22483da084b3Smrg $echo 22493da084b3Smrg $echo "*** Warning: Linking the shared library $output against the" 22503da084b3Smrg $echo "*** static library $deplib is not portable!" 22513da084b3Smrg deplibs="$deplib $deplibs" 22523da084b3Smrg fi 22533da084b3Smrg continue 22543da084b3Smrg ;; 22553da084b3Smrg prog) 22563da084b3Smrg if test "$pass" != link; then 22573da084b3Smrg deplibs="$deplib $deplibs" 22583da084b3Smrg else 22593da084b3Smrg compile_deplibs="$deplib $compile_deplibs" 22603da084b3Smrg finalize_deplibs="$deplib $finalize_deplibs" 22613da084b3Smrg fi 22623da084b3Smrg continue 22633da084b3Smrg ;; 22643da084b3Smrg esac # linkmode 22653da084b3Smrg ;; # *.$libext 22663da084b3Smrg *.lo | *.$objext) 22673da084b3Smrg if test "$pass" = conv; then 22683da084b3Smrg deplibs="$deplib $deplibs" 22693da084b3Smrg elif test "$linkmode" = prog; then 22703da084b3Smrg if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then 22713da084b3Smrg # If there is no dlopen support or we're linking statically, 22723da084b3Smrg # we need to preload. 22733da084b3Smrg newdlprefiles="$newdlprefiles $deplib" 22743da084b3Smrg compile_deplibs="$deplib $compile_deplibs" 22753da084b3Smrg finalize_deplibs="$deplib $finalize_deplibs" 22763da084b3Smrg else 22773da084b3Smrg newdlfiles="$newdlfiles $deplib" 22783da084b3Smrg fi 22793da084b3Smrg fi 22803da084b3Smrg continue 22813da084b3Smrg ;; 22823da084b3Smrg %DEPLIBS%) 22833da084b3Smrg alldeplibs=yes 22843da084b3Smrg continue 22853da084b3Smrg ;; 22863da084b3Smrg esac # case $deplib 22873da084b3Smrg if test "$found" = yes || test -f "$lib"; then : 22883da084b3Smrg else 22893da084b3Smrg $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 22903da084b3Smrg exit $EXIT_FAILURE 22913da084b3Smrg fi 22923da084b3Smrg 22933da084b3Smrg # Check to see that this really is a libtool archive. 22943da084b3Smrg if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : 22953da084b3Smrg else 22963da084b3Smrg $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 22973da084b3Smrg exit $EXIT_FAILURE 22983da084b3Smrg fi 22993da084b3Smrg 23003da084b3Smrg ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` 23013da084b3Smrg test "X$ladir" = "X$lib" && ladir="." 23023da084b3Smrg 23033da084b3Smrg dlname= 23043da084b3Smrg dlopen= 23053da084b3Smrg dlpreopen= 23063da084b3Smrg libdir= 23073da084b3Smrg library_names= 23083da084b3Smrg old_library= 23093da084b3Smrg # If the library was installed with an old release of libtool, 23103da084b3Smrg # it will not redefine variables installed, or shouldnotlink 23113da084b3Smrg installed=yes 23123da084b3Smrg shouldnotlink=no 23133da084b3Smrg avoidtemprpath= 23143da084b3Smrg 23153da084b3Smrg 23163da084b3Smrg # Read the .la file 23173da084b3Smrg case $lib in 23183da084b3Smrg */* | *\\*) . $lib ;; 23193da084b3Smrg *) . ./$lib ;; 23203da084b3Smrg esac 23213da084b3Smrg 23223da084b3Smrg if test "$linkmode,$pass" = "lib,link" || 23233da084b3Smrg test "$linkmode,$pass" = "prog,scan" || 23243da084b3Smrg { test "$linkmode" != prog && test "$linkmode" != lib; }; then 23253da084b3Smrg test -n "$dlopen" && dlfiles="$dlfiles $dlopen" 23263da084b3Smrg test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" 23273da084b3Smrg fi 23283da084b3Smrg 23293da084b3Smrg if test "$pass" = conv; then 23303da084b3Smrg # Only check for convenience libraries 23313da084b3Smrg deplibs="$lib $deplibs" 23323da084b3Smrg if test -z "$libdir"; then 23333da084b3Smrg if test -z "$old_library"; then 23343da084b3Smrg $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 23353da084b3Smrg exit $EXIT_FAILURE 23363da084b3Smrg fi 23373da084b3Smrg # It is a libtool convenience library, so add in its objects. 23383da084b3Smrg convenience="$convenience $ladir/$objdir/$old_library" 23393da084b3Smrg old_convenience="$old_convenience $ladir/$objdir/$old_library" 23403da084b3Smrg tmp_libs= 23413da084b3Smrg for deplib in $dependency_libs; do 23423da084b3Smrg deplibs="$deplib $deplibs" 23433da084b3Smrg if test "X$duplicate_deps" = "Xyes" ; then 23443da084b3Smrg case "$tmp_libs " in 23453da084b3Smrg *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; 23463da084b3Smrg esac 23473da084b3Smrg fi 23483da084b3Smrg tmp_libs="$tmp_libs $deplib" 23493da084b3Smrg done 23503da084b3Smrg elif test "$linkmode" != prog && test "$linkmode" != lib; then 23513da084b3Smrg $echo "$modename: \`$lib' is not a convenience library" 1>&2 23523da084b3Smrg exit $EXIT_FAILURE 23533da084b3Smrg fi 23543da084b3Smrg continue 23553da084b3Smrg fi # $pass = conv 23563da084b3Smrg 23573da084b3Smrg 23583da084b3Smrg # Get the name of the library we link against. 23593da084b3Smrg linklib= 23603da084b3Smrg for l in $old_library $library_names; do 23613da084b3Smrg linklib="$l" 23623da084b3Smrg done 23633da084b3Smrg if test -z "$linklib"; then 23643da084b3Smrg $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 23653da084b3Smrg exit $EXIT_FAILURE 23663da084b3Smrg fi 23673da084b3Smrg 23683da084b3Smrg # This library was specified with -dlopen. 23693da084b3Smrg if test "$pass" = dlopen; then 23703da084b3Smrg if test -z "$libdir"; then 23713da084b3Smrg $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 23723da084b3Smrg exit $EXIT_FAILURE 23733da084b3Smrg fi 23743da084b3Smrg if test -z "$dlname" || 23753da084b3Smrg test "$dlopen_support" != yes || 23763da084b3Smrg test "$build_libtool_libs" = no; then 23773da084b3Smrg # If there is no dlname, no dlopen support or we're linking 23783da084b3Smrg # statically, we need to preload. We also need to preload any 23793da084b3Smrg # dependent libraries so libltdl's deplib preloader doesn't 23803da084b3Smrg # bomb out in the load deplibs phase. 23813da084b3Smrg dlprefiles="$dlprefiles $lib $dependency_libs" 23823da084b3Smrg else 23833da084b3Smrg newdlfiles="$newdlfiles $lib" 23843da084b3Smrg fi 23853da084b3Smrg continue 23863da084b3Smrg fi # $pass = dlopen 23873da084b3Smrg 23883da084b3Smrg # We need an absolute path. 23893da084b3Smrg case $ladir in 23903da084b3Smrg [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; 23913da084b3Smrg *) 23923da084b3Smrg abs_ladir=`cd "$ladir" && pwd` 23933da084b3Smrg if test -z "$abs_ladir"; then 23943da084b3Smrg $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 23953da084b3Smrg $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 23963da084b3Smrg abs_ladir="$ladir" 23973da084b3Smrg fi 23983da084b3Smrg ;; 23993da084b3Smrg esac 24003da084b3Smrg laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` 24013da084b3Smrg 24023da084b3Smrg # Find the relevant object directory and library name. 24033da084b3Smrg if test "X$installed" = Xyes; then 24043da084b3Smrg if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then 24053da084b3Smrg $echo "$modename: warning: library \`$lib' was moved." 1>&2 24063da084b3Smrg dir="$ladir" 24073da084b3Smrg absdir="$abs_ladir" 24083da084b3Smrg libdir="$abs_ladir" 24093da084b3Smrg else 24103da084b3Smrg dir="$libdir" 24113da084b3Smrg absdir="$libdir" 24123da084b3Smrg fi 24133da084b3Smrg test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes 24143da084b3Smrg else 24153da084b3Smrg if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then 24163da084b3Smrg dir="$ladir" 24173da084b3Smrg absdir="$abs_ladir" 24183da084b3Smrg # Remove this search path later 24193da084b3Smrg notinst_path="$notinst_path $abs_ladir" 24203da084b3Smrg else 24213da084b3Smrg dir="$ladir/$objdir" 24223da084b3Smrg absdir="$abs_ladir/$objdir" 24233da084b3Smrg # Remove this search path later 24243da084b3Smrg notinst_path="$notinst_path $abs_ladir" 24253da084b3Smrg fi 24263da084b3Smrg fi # $installed = yes 24273da084b3Smrg name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` 24283da084b3Smrg 24293da084b3Smrg # This library was specified with -dlpreopen. 24303da084b3Smrg if test "$pass" = dlpreopen; then 24313da084b3Smrg if test -z "$libdir"; then 24323da084b3Smrg $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 24333da084b3Smrg exit $EXIT_FAILURE 24343da084b3Smrg fi 24353da084b3Smrg # Prefer using a static library (so that no silly _DYNAMIC symbols 24363da084b3Smrg # are required to link). 24373da084b3Smrg if test -n "$old_library"; then 24383da084b3Smrg newdlprefiles="$newdlprefiles $dir/$old_library" 24393da084b3Smrg # Otherwise, use the dlname, so that lt_dlopen finds it. 24403da084b3Smrg elif test -n "$dlname"; then 24413da084b3Smrg newdlprefiles="$newdlprefiles $dir/$dlname" 24423da084b3Smrg else 24433da084b3Smrg newdlprefiles="$newdlprefiles $dir/$linklib" 24443da084b3Smrg fi 24453da084b3Smrg fi # $pass = dlpreopen 24463da084b3Smrg 24473da084b3Smrg if test -z "$libdir"; then 24483da084b3Smrg # Link the convenience library 24493da084b3Smrg if test "$linkmode" = lib; then 24503da084b3Smrg deplibs="$dir/$old_library $deplibs" 24513da084b3Smrg elif test "$linkmode,$pass" = "prog,link"; then 24523da084b3Smrg compile_deplibs="$dir/$old_library $compile_deplibs" 24533da084b3Smrg finalize_deplibs="$dir/$old_library $finalize_deplibs" 24543da084b3Smrg else 24553da084b3Smrg deplibs="$lib $deplibs" # used for prog,scan pass 24563da084b3Smrg fi 24573da084b3Smrg continue 24583da084b3Smrg fi 24593da084b3Smrg 24603da084b3Smrg 24613da084b3Smrg if test "$linkmode" = prog && test "$pass" != link; then 24623da084b3Smrg newlib_search_path="$newlib_search_path $ladir" 24633da084b3Smrg deplibs="$lib $deplibs" 24643da084b3Smrg 24653da084b3Smrg linkalldeplibs=no 24663da084b3Smrg if test "$link_all_deplibs" != no || test -z "$library_names" || 24673da084b3Smrg test "$build_libtool_libs" = no; then 24683da084b3Smrg linkalldeplibs=yes 24693da084b3Smrg fi 24703da084b3Smrg 24713da084b3Smrg tmp_libs= 24723da084b3Smrg for deplib in $dependency_libs; do 24733da084b3Smrg case $deplib in 24743da084b3Smrg -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test 24753da084b3Smrg esac 24763da084b3Smrg # Need to link against all dependency_libs? 24773da084b3Smrg if test "$linkalldeplibs" = yes; then 24783da084b3Smrg deplibs="$deplib $deplibs" 24793da084b3Smrg else 24803da084b3Smrg # Need to hardcode shared library paths 24813da084b3Smrg # or/and link against static libraries 24823da084b3Smrg newdependency_libs="$deplib $newdependency_libs" 24833da084b3Smrg fi 24843da084b3Smrg if test "X$duplicate_deps" = "Xyes" ; then 24853da084b3Smrg case "$tmp_libs " in 24863da084b3Smrg *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; 24873da084b3Smrg esac 24883da084b3Smrg fi 24893da084b3Smrg tmp_libs="$tmp_libs $deplib" 24903da084b3Smrg done # for deplib 24913da084b3Smrg continue 24923da084b3Smrg fi # $linkmode = prog... 24933da084b3Smrg 24943da084b3Smrg if test "$linkmode,$pass" = "prog,link"; then 24953da084b3Smrg if test -n "$library_names" && 24963da084b3Smrg { test "$prefer_static_libs" = no || test -z "$old_library"; }; then 24973da084b3Smrg # We need to hardcode the library path 24983da084b3Smrg if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then 24993da084b3Smrg # Make sure the rpath contains only unique directories. 25003da084b3Smrg case "$temp_rpath " in 25013da084b3Smrg *" $dir "*) ;; 25023da084b3Smrg *" $absdir "*) ;; 25033da084b3Smrg *) temp_rpath="$temp_rpath $absdir" ;; 25043da084b3Smrg esac 25053da084b3Smrg fi 25063da084b3Smrg 25073da084b3Smrg # Hardcode the library path. 25083da084b3Smrg # Skip directories that are in the system default run-time 25093da084b3Smrg # search path. 25103da084b3Smrg case " $sys_lib_dlsearch_path " in 25113da084b3Smrg *" $absdir "*) ;; 25123da084b3Smrg *) 25133da084b3Smrg case "$compile_rpath " in 25143da084b3Smrg *" $absdir "*) ;; 25153da084b3Smrg *) compile_rpath="$compile_rpath $absdir" 25163da084b3Smrg esac 25173da084b3Smrg ;; 25183da084b3Smrg esac 25193da084b3Smrg case " $sys_lib_dlsearch_path " in 25203da084b3Smrg *" $libdir "*) ;; 25213da084b3Smrg *) 25223da084b3Smrg case "$finalize_rpath " in 25233da084b3Smrg *" $libdir "*) ;; 25243da084b3Smrg *) finalize_rpath="$finalize_rpath $libdir" 25253da084b3Smrg esac 25263da084b3Smrg ;; 25273da084b3Smrg esac 25283da084b3Smrg fi # $linkmode,$pass = prog,link... 25293da084b3Smrg 25303da084b3Smrg if test "$alldeplibs" = yes && 25313da084b3Smrg { test "$deplibs_check_method" = pass_all || 25323da084b3Smrg { test "$build_libtool_libs" = yes && 25333da084b3Smrg test -n "$library_names"; }; }; then 25343da084b3Smrg # We only need to search for static libraries 25353da084b3Smrg continue 25363da084b3Smrg fi 25373da084b3Smrg fi 25383da084b3Smrg 25393da084b3Smrg link_static=no # Whether the deplib will be linked statically 25403da084b3Smrg use_static_libs=$prefer_static_libs 25413da084b3Smrg if test "$use_static_libs" = built && test "$installed" = yes ; then 25423da084b3Smrg use_static_libs=no 25433da084b3Smrg fi 25443da084b3Smrg if test -n "$library_names" && 25453da084b3Smrg { test "$use_static_libs" = no || test -z "$old_library"; }; then 25463da084b3Smrg if test "$installed" = no; then 25473da084b3Smrg notinst_deplibs="$notinst_deplibs $lib" 25483da084b3Smrg need_relink=yes 25493da084b3Smrg fi 25503da084b3Smrg # This is a shared library 25513da084b3Smrg 25523da084b3Smrg # Warn about portability, can't link against -module's on 25533da084b3Smrg # some systems (darwin) 25543da084b3Smrg if test "$shouldnotlink" = yes && test "$pass" = link ; then 25553da084b3Smrg $echo 25563da084b3Smrg if test "$linkmode" = prog; then 25573da084b3Smrg $echo "*** Warning: Linking the executable $output against the loadable module" 25583da084b3Smrg else 25593da084b3Smrg $echo "*** Warning: Linking the shared library $output against the loadable module" 25603da084b3Smrg fi 25613da084b3Smrg $echo "*** $linklib is not portable!" 25623da084b3Smrg fi 25633da084b3Smrg if test "$linkmode" = lib && 25643da084b3Smrg test "$hardcode_into_libs" = yes; then 25653da084b3Smrg # Hardcode the library path. 25663da084b3Smrg # Skip directories that are in the system default run-time 25673da084b3Smrg # search path. 25683da084b3Smrg case " $sys_lib_dlsearch_path " in 25693da084b3Smrg *" $absdir "*) ;; 25703da084b3Smrg *) 25713da084b3Smrg case "$compile_rpath " in 25723da084b3Smrg *" $absdir "*) ;; 25733da084b3Smrg *) compile_rpath="$compile_rpath $absdir" 25743da084b3Smrg esac 25753da084b3Smrg ;; 25763da084b3Smrg esac 25773da084b3Smrg case " $sys_lib_dlsearch_path " in 25783da084b3Smrg *" $libdir "*) ;; 25793da084b3Smrg *) 25803da084b3Smrg case "$finalize_rpath " in 25813da084b3Smrg *" $libdir "*) ;; 25823da084b3Smrg *) finalize_rpath="$finalize_rpath $libdir" 25833da084b3Smrg esac 25843da084b3Smrg ;; 25853da084b3Smrg esac 25863da084b3Smrg fi 25873da084b3Smrg 25883da084b3Smrg if test -n "$old_archive_from_expsyms_cmds"; then 25893da084b3Smrg # figure out the soname 25903da084b3Smrg set dummy $library_names 25913da084b3Smrg realname="$2" 25923da084b3Smrg shift; shift 25933da084b3Smrg libname=`eval \\$echo \"$libname_spec\"` 25943da084b3Smrg # use dlname if we got it. it's perfectly good, no? 25953da084b3Smrg if test -n "$dlname"; then 25963da084b3Smrg soname="$dlname" 25973da084b3Smrg elif test -n "$soname_spec"; then 25983da084b3Smrg # bleh windows 25993da084b3Smrg case $host in 26003da084b3Smrg *cygwin* | mingw*) 26013da084b3Smrg major=`expr $current - $age` 26023da084b3Smrg versuffix="-$major" 26033da084b3Smrg ;; 26043da084b3Smrg esac 26053da084b3Smrg eval soname=\"$soname_spec\" 26063da084b3Smrg else 26073da084b3Smrg soname="$realname" 26083da084b3Smrg fi 26093da084b3Smrg 26103da084b3Smrg # Make a new name for the extract_expsyms_cmds to use 26113da084b3Smrg soroot="$soname" 26123da084b3Smrg soname=`$echo $soroot | ${SED} -e 's/^.*\///'` 26133da084b3Smrg newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" 26143da084b3Smrg 26153da084b3Smrg # If the library has no export list, then create one now 26163da084b3Smrg if test -f "$output_objdir/$soname-def"; then : 26173da084b3Smrg else 26183da084b3Smrg $show "extracting exported symbol list from \`$soname'" 26193da084b3Smrg save_ifs="$IFS"; IFS='~' 26203da084b3Smrg cmds=$extract_expsyms_cmds 26213da084b3Smrg for cmd in $cmds; do 26223da084b3Smrg IFS="$save_ifs" 26233da084b3Smrg eval cmd=\"$cmd\" 26243da084b3Smrg $show "$cmd" 26253da084b3Smrg $run eval "$cmd" || exit $? 26263da084b3Smrg done 26273da084b3Smrg IFS="$save_ifs" 26283da084b3Smrg fi 26293da084b3Smrg 26303da084b3Smrg # Create $newlib 26313da084b3Smrg if test -f "$output_objdir/$newlib"; then :; else 26323da084b3Smrg $show "generating import library for \`$soname'" 26333da084b3Smrg save_ifs="$IFS"; IFS='~' 26343da084b3Smrg cmds=$old_archive_from_expsyms_cmds 26353da084b3Smrg for cmd in $cmds; do 26363da084b3Smrg IFS="$save_ifs" 26373da084b3Smrg eval cmd=\"$cmd\" 26383da084b3Smrg $show "$cmd" 26393da084b3Smrg $run eval "$cmd" || exit $? 26403da084b3Smrg done 26413da084b3Smrg IFS="$save_ifs" 26423da084b3Smrg fi 26433da084b3Smrg # make sure the library variables are pointing to the new library 26443da084b3Smrg dir=$output_objdir 26453da084b3Smrg linklib=$newlib 26463da084b3Smrg fi # test -n "$old_archive_from_expsyms_cmds" 26473da084b3Smrg 26483da084b3Smrg if test "$linkmode" = prog || test "$mode" != relink; then 26493da084b3Smrg add_shlibpath= 26503da084b3Smrg add_dir= 26513da084b3Smrg add= 26523da084b3Smrg lib_linked=yes 26533da084b3Smrg case $hardcode_action in 26543da084b3Smrg immediate | unsupported) 26553da084b3Smrg if test "$hardcode_direct" = no; then 26563da084b3Smrg add="$dir/$linklib" 26573da084b3Smrg case $host in 26583da084b3Smrg *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; 26593da084b3Smrg *-*-sysv4*uw2*) add_dir="-L$dir" ;; 26603da084b3Smrg *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ 26613da084b3Smrg *-*-unixware7*) add_dir="-L$dir" ;; 26623da084b3Smrg *-*-darwin* ) 26633da084b3Smrg # if the lib is a module then we can not link against 26643da084b3Smrg # it, someone is ignoring the new warnings I added 26653da084b3Smrg if /usr/bin/file -L $add 2> /dev/null | 26663da084b3Smrg $EGREP ": [^:]* bundle" >/dev/null ; then 26673da084b3Smrg $echo "** Warning, lib $linklib is a module, not a shared library" 26683da084b3Smrg if test -z "$old_library" ; then 26693da084b3Smrg $echo 26703da084b3Smrg $echo "** And there doesn't seem to be a static archive available" 26713da084b3Smrg $echo "** The link will probably fail, sorry" 26723da084b3Smrg else 26733da084b3Smrg add="$dir/$old_library" 26743da084b3Smrg fi 26753da084b3Smrg fi 26763da084b3Smrg esac 26773da084b3Smrg elif test "$hardcode_minus_L" = no; then 26783da084b3Smrg case $host in 26793da084b3Smrg *-*-sunos*) add_shlibpath="$dir" ;; 26803da084b3Smrg esac 26813da084b3Smrg add_dir="-L$dir" 26823da084b3Smrg add="-l$name" 26833da084b3Smrg elif test "$hardcode_shlibpath_var" = no; then 26843da084b3Smrg add_shlibpath="$dir" 26853da084b3Smrg add="-l$name" 26863da084b3Smrg else 26873da084b3Smrg lib_linked=no 26883da084b3Smrg fi 26893da084b3Smrg ;; 26903da084b3Smrg relink) 26913da084b3Smrg if test "$hardcode_direct" = yes; then 26923da084b3Smrg add="$dir/$linklib" 26933da084b3Smrg elif test "$hardcode_minus_L" = yes; then 26943da084b3Smrg add_dir="-L$dir" 26953da084b3Smrg # Try looking first in the location we're being installed to. 26963da084b3Smrg if test -n "$inst_prefix_dir"; then 26973da084b3Smrg case $libdir in 26983da084b3Smrg [\\/]*) 26993da084b3Smrg add_dir="$add_dir -L$inst_prefix_dir$libdir" 27003da084b3Smrg ;; 27013da084b3Smrg esac 27023da084b3Smrg fi 27033da084b3Smrg add="-l$name" 27043da084b3Smrg elif test "$hardcode_shlibpath_var" = yes; then 27053da084b3Smrg add_shlibpath="$dir" 27063da084b3Smrg add="-l$name" 27073da084b3Smrg else 27083da084b3Smrg lib_linked=no 27093da084b3Smrg fi 27103da084b3Smrg ;; 27113da084b3Smrg *) lib_linked=no ;; 27123da084b3Smrg esac 27133da084b3Smrg 27143da084b3Smrg if test "$lib_linked" != yes; then 27153da084b3Smrg $echo "$modename: configuration error: unsupported hardcode properties" 27163da084b3Smrg exit $EXIT_FAILURE 27173da084b3Smrg fi 27183da084b3Smrg 27193da084b3Smrg if test -n "$add_shlibpath"; then 27203da084b3Smrg case :$compile_shlibpath: in 27213da084b3Smrg *":$add_shlibpath:"*) ;; 27223da084b3Smrg *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; 27233da084b3Smrg esac 27243da084b3Smrg fi 27253da084b3Smrg if test "$linkmode" = prog; then 27263da084b3Smrg test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" 27273da084b3Smrg test -n "$add" && compile_deplibs="$add $compile_deplibs" 27283da084b3Smrg else 27293da084b3Smrg test -n "$add_dir" && deplibs="$add_dir $deplibs" 27303da084b3Smrg test -n "$add" && deplibs="$add $deplibs" 27313da084b3Smrg if test "$hardcode_direct" != yes && \ 27323da084b3Smrg test "$hardcode_minus_L" != yes && \ 27333da084b3Smrg test "$hardcode_shlibpath_var" = yes; then 27343da084b3Smrg case :$finalize_shlibpath: in 27353da084b3Smrg *":$libdir:"*) ;; 27363da084b3Smrg *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; 27373da084b3Smrg esac 27383da084b3Smrg fi 27393da084b3Smrg fi 27403da084b3Smrg fi 27413da084b3Smrg 27423da084b3Smrg if test "$linkmode" = prog || test "$mode" = relink; then 27433da084b3Smrg add_shlibpath= 27443da084b3Smrg add_dir= 27453da084b3Smrg add= 27463da084b3Smrg # Finalize command for both is simple: just hardcode it. 27473da084b3Smrg if test "$hardcode_direct" = yes; then 27483da084b3Smrg add="$libdir/$linklib" 27493da084b3Smrg elif test "$hardcode_minus_L" = yes; then 27503da084b3Smrg add_dir="-L$libdir" 27513da084b3Smrg add="-l$name" 27523da084b3Smrg elif test "$hardcode_shlibpath_var" = yes; then 27533da084b3Smrg case :$finalize_shlibpath: in 27543da084b3Smrg *":$libdir:"*) ;; 27553da084b3Smrg *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; 27563da084b3Smrg esac 27573da084b3Smrg add="-l$name" 27583da084b3Smrg elif test "$hardcode_automatic" = yes; then 27593da084b3Smrg if test -n "$inst_prefix_dir" && 27603da084b3Smrg test -f "$inst_prefix_dir$libdir/$linklib" ; then 27613da084b3Smrg add="$inst_prefix_dir$libdir/$linklib" 27623da084b3Smrg else 27633da084b3Smrg add="$libdir/$linklib" 27643da084b3Smrg fi 27653da084b3Smrg else 27663da084b3Smrg # We cannot seem to hardcode it, guess we'll fake it. 27673da084b3Smrg add_dir="-L$libdir" 27683da084b3Smrg # Try looking first in the location we're being installed to. 27693da084b3Smrg if test -n "$inst_prefix_dir"; then 27703da084b3Smrg case $libdir in 27713da084b3Smrg [\\/]*) 27723da084b3Smrg add_dir="$add_dir -L$inst_prefix_dir$libdir" 27733da084b3Smrg ;; 27743da084b3Smrg esac 27753da084b3Smrg fi 27763da084b3Smrg add="-l$name" 27773da084b3Smrg fi 27783da084b3Smrg 27793da084b3Smrg if test "$linkmode" = prog; then 27803da084b3Smrg test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" 27813da084b3Smrg test -n "$add" && finalize_deplibs="$add $finalize_deplibs" 27823da084b3Smrg else 27833da084b3Smrg test -n "$add_dir" && deplibs="$add_dir $deplibs" 27843da084b3Smrg test -n "$add" && deplibs="$add $deplibs" 27853da084b3Smrg fi 27863da084b3Smrg fi 27873da084b3Smrg elif test "$linkmode" = prog; then 27883da084b3Smrg # Here we assume that one of hardcode_direct or hardcode_minus_L 27893da084b3Smrg # is not unsupported. This is valid on all known static and 27903da084b3Smrg # shared platforms. 27913da084b3Smrg if test "$hardcode_direct" != unsupported; then 27923da084b3Smrg test -n "$old_library" && linklib="$old_library" 27933da084b3Smrg compile_deplibs="$dir/$linklib $compile_deplibs" 27943da084b3Smrg finalize_deplibs="$dir/$linklib $finalize_deplibs" 27953da084b3Smrg else 27963da084b3Smrg compile_deplibs="-l$name -L$dir $compile_deplibs" 27973da084b3Smrg finalize_deplibs="-l$name -L$dir $finalize_deplibs" 27983da084b3Smrg fi 27993da084b3Smrg elif test "$build_libtool_libs" = yes; then 28003da084b3Smrg # Not a shared library 28013da084b3Smrg if test "$deplibs_check_method" != pass_all; then 28023da084b3Smrg # We're trying link a shared library against a static one 28033da084b3Smrg # but the system doesn't support it. 28043da084b3Smrg 28053da084b3Smrg # Just print a warning and add the library to dependency_libs so 28063da084b3Smrg # that the program can be linked against the static library. 28073da084b3Smrg $echo 28083da084b3Smrg $echo "*** Warning: This system can not link to static lib archive $lib." 28093da084b3Smrg $echo "*** I have the capability to make that library automatically link in when" 28103da084b3Smrg $echo "*** you link to this library. But I can only do this if you have a" 28113da084b3Smrg $echo "*** shared version of the library, which you do not appear to have." 28123da084b3Smrg if test "$module" = yes; then 28133da084b3Smrg $echo "*** But as you try to build a module library, libtool will still create " 28143da084b3Smrg $echo "*** a static module, that should work as long as the dlopening application" 28153da084b3Smrg $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." 28163da084b3Smrg if test -z "$global_symbol_pipe"; then 28173da084b3Smrg $echo 28183da084b3Smrg $echo "*** However, this would only work if libtool was able to extract symbol" 28193da084b3Smrg $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" 28203da084b3Smrg $echo "*** not find such a program. So, this module is probably useless." 28213da084b3Smrg $echo "*** \`nm' from GNU binutils and a full rebuild may help." 28223da084b3Smrg fi 28233da084b3Smrg if test "$build_old_libs" = no; then 28243da084b3Smrg build_libtool_libs=module 28253da084b3Smrg build_old_libs=yes 28263da084b3Smrg else 28273da084b3Smrg build_libtool_libs=no 28283da084b3Smrg fi 28293da084b3Smrg fi 28303da084b3Smrg else 28313da084b3Smrg deplibs="$dir/$old_library $deplibs" 28323da084b3Smrg link_static=yes 28333da084b3Smrg fi 28343da084b3Smrg fi # link shared/static library? 28353da084b3Smrg 28363da084b3Smrg if test "$linkmode" = lib; then 28373da084b3Smrg if test -n "$dependency_libs" && 28383da084b3Smrg { test "$hardcode_into_libs" != yes || 28393da084b3Smrg test "$build_old_libs" = yes || 28403da084b3Smrg test "$link_static" = yes; }; then 28413da084b3Smrg # Extract -R from dependency_libs 28423da084b3Smrg temp_deplibs= 28433da084b3Smrg for libdir in $dependency_libs; do 28443da084b3Smrg case $libdir in 28453da084b3Smrg -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` 28463da084b3Smrg case " $xrpath " in 28473da084b3Smrg *" $temp_xrpath "*) ;; 28483da084b3Smrg *) xrpath="$xrpath $temp_xrpath";; 28493da084b3Smrg esac;; 28503da084b3Smrg *) temp_deplibs="$temp_deplibs $libdir";; 28513da084b3Smrg esac 28523da084b3Smrg done 28533da084b3Smrg dependency_libs="$temp_deplibs" 28543da084b3Smrg fi 28553da084b3Smrg 28563da084b3Smrg newlib_search_path="$newlib_search_path $absdir" 28573da084b3Smrg # Link against this library 28583da084b3Smrg test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" 28593da084b3Smrg # ... and its dependency_libs 28603da084b3Smrg tmp_libs= 28613da084b3Smrg for deplib in $dependency_libs; do 28623da084b3Smrg newdependency_libs="$deplib $newdependency_libs" 28633da084b3Smrg if test "X$duplicate_deps" = "Xyes" ; then 28643da084b3Smrg case "$tmp_libs " in 28653da084b3Smrg *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; 28663da084b3Smrg esac 28673da084b3Smrg fi 28683da084b3Smrg tmp_libs="$tmp_libs $deplib" 28693da084b3Smrg done 28703da084b3Smrg 28713da084b3Smrg if test "$link_all_deplibs" != no; then 28723da084b3Smrg # Add the search paths of all dependency libraries 28733da084b3Smrg for deplib in $dependency_libs; do 28743da084b3Smrg case $deplib in 28753da084b3Smrg -L*) path="$deplib" ;; 28763da084b3Smrg *.la) 28773da084b3Smrg dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` 28783da084b3Smrg test "X$dir" = "X$deplib" && dir="." 28793da084b3Smrg # We need an absolute path. 28803da084b3Smrg case $dir in 28813da084b3Smrg [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; 28823da084b3Smrg *) 28833da084b3Smrg absdir=`cd "$dir" && pwd` 28843da084b3Smrg if test -z "$absdir"; then 28853da084b3Smrg $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 28863da084b3Smrg absdir="$dir" 28873da084b3Smrg fi 28883da084b3Smrg ;; 28893da084b3Smrg esac 28903da084b3Smrg if grep "^installed=no" $deplib > /dev/null; then 28913da084b3Smrg path="$absdir/$objdir" 28923da084b3Smrg else 28933da084b3Smrg eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` 28943da084b3Smrg if test -z "$libdir"; then 28953da084b3Smrg $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 28963da084b3Smrg exit $EXIT_FAILURE 28973da084b3Smrg fi 28983da084b3Smrg if test "$absdir" != "$libdir"; then 28993da084b3Smrg $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 29003da084b3Smrg fi 29013da084b3Smrg path="$absdir" 29023da084b3Smrg fi 29033da084b3Smrg depdepl= 29043da084b3Smrg case $host in 29053da084b3Smrg *-*-darwin*) 29063da084b3Smrg # we do not want to link against static libs, 29073da084b3Smrg # but need to link against shared 29083da084b3Smrg eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` 29093da084b3Smrg if test -n "$deplibrary_names" ; then 29103da084b3Smrg for tmp in $deplibrary_names ; do 29113da084b3Smrg depdepl=$tmp 29123da084b3Smrg done 29133da084b3Smrg if test -f "$path/$depdepl" ; then 29143da084b3Smrg depdepl="$path/$depdepl" 29153da084b3Smrg fi 29163da084b3Smrg # do not add paths which are already there 29173da084b3Smrg case " $newlib_search_path " in 29183da084b3Smrg *" $path "*) ;; 29193da084b3Smrg *) newlib_search_path="$newlib_search_path $path";; 29203da084b3Smrg esac 29213da084b3Smrg fi 29223da084b3Smrg path="" 29233da084b3Smrg ;; 29243da084b3Smrg *) 29253da084b3Smrg path="-L$path" 29263da084b3Smrg ;; 29273da084b3Smrg esac 29283da084b3Smrg ;; 29293da084b3Smrg -l*) 29303da084b3Smrg case $host in 29313da084b3Smrg *-*-darwin*) 29323da084b3Smrg # Again, we only want to link against shared libraries 29333da084b3Smrg eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` 29343da084b3Smrg for tmp in $newlib_search_path ; do 29353da084b3Smrg if test -f "$tmp/lib$tmp_libs.dylib" ; then 29363da084b3Smrg eval depdepl="$tmp/lib$tmp_libs.dylib" 29373da084b3Smrg break 29383da084b3Smrg fi 29393da084b3Smrg done 29403da084b3Smrg path="" 29413da084b3Smrg ;; 29423da084b3Smrg *) continue ;; 29433da084b3Smrg esac 29443da084b3Smrg ;; 29453da084b3Smrg *) continue ;; 29463da084b3Smrg esac 29473da084b3Smrg case " $deplibs " in 29483da084b3Smrg *" $path "*) ;; 29493da084b3Smrg *) deplibs="$path $deplibs" ;; 29503da084b3Smrg esac 29513da084b3Smrg case " $deplibs " in 29523da084b3Smrg *" $depdepl "*) ;; 29533da084b3Smrg *) deplibs="$depdepl $deplibs" ;; 29543da084b3Smrg esac 29553da084b3Smrg done 29563da084b3Smrg fi # link_all_deplibs != no 29573da084b3Smrg fi # linkmode = lib 29583da084b3Smrg done # for deplib in $libs 29593da084b3Smrg dependency_libs="$newdependency_libs" 29603da084b3Smrg if test "$pass" = dlpreopen; then 29613da084b3Smrg # Link the dlpreopened libraries before other libraries 29623da084b3Smrg for deplib in $save_deplibs; do 29633da084b3Smrg deplibs="$deplib $deplibs" 29643da084b3Smrg done 29653da084b3Smrg fi 29663da084b3Smrg if test "$pass" != dlopen; then 29673da084b3Smrg if test "$pass" != conv; then 29683da084b3Smrg # Make sure lib_search_path contains only unique directories. 29693da084b3Smrg lib_search_path= 29703da084b3Smrg for dir in $newlib_search_path; do 29713da084b3Smrg case "$lib_search_path " in 29723da084b3Smrg *" $dir "*) ;; 29733da084b3Smrg *) lib_search_path="$lib_search_path $dir" ;; 29743da084b3Smrg esac 29753da084b3Smrg done 29763da084b3Smrg newlib_search_path= 29773da084b3Smrg fi 29783da084b3Smrg 29793da084b3Smrg if test "$linkmode,$pass" != "prog,link"; then 29803da084b3Smrg vars="deplibs" 29813da084b3Smrg else 29823da084b3Smrg vars="compile_deplibs finalize_deplibs" 29833da084b3Smrg fi 29843da084b3Smrg for var in $vars dependency_libs; do 29853da084b3Smrg # Add libraries to $var in reverse order 29863da084b3Smrg eval tmp_libs=\"\$$var\" 29873da084b3Smrg new_libs= 29883da084b3Smrg for deplib in $tmp_libs; do 29893da084b3Smrg # FIXME: Pedantically, this is the right thing to do, so 29903da084b3Smrg # that some nasty dependency loop isn't accidentally 29913da084b3Smrg # broken: 29923da084b3Smrg #new_libs="$deplib $new_libs" 29933da084b3Smrg # Pragmatically, this seems to cause very few problems in 29943da084b3Smrg # practice: 29953da084b3Smrg case $deplib in 29963da084b3Smrg -L*) new_libs="$deplib $new_libs" ;; 29973da084b3Smrg -R*) ;; 29983da084b3Smrg *) 29993da084b3Smrg # And here is the reason: when a library appears more 30003da084b3Smrg # than once as an explicit dependence of a library, or 30013da084b3Smrg # is implicitly linked in more than once by the 30023da084b3Smrg # compiler, it is considered special, and multiple 30033da084b3Smrg # occurrences thereof are not removed. Compare this 30043da084b3Smrg # with having the same library being listed as a 30053da084b3Smrg # dependency of multiple other libraries: in this case, 30063da084b3Smrg # we know (pedantically, we assume) the library does not 30073da084b3Smrg # need to be listed more than once, so we keep only the 30083da084b3Smrg # last copy. This is not always right, but it is rare 30093da084b3Smrg # enough that we require users that really mean to play 30103da084b3Smrg # such unportable linking tricks to link the library 30113da084b3Smrg # using -Wl,-lname, so that libtool does not consider it 30123da084b3Smrg # for duplicate removal. 30133da084b3Smrg case " $specialdeplibs " in 30143da084b3Smrg *" $deplib "*) new_libs="$deplib $new_libs" ;; 30153da084b3Smrg *) 30163da084b3Smrg case " $new_libs " in 30173da084b3Smrg *" $deplib "*) ;; 30183da084b3Smrg *) new_libs="$deplib $new_libs" ;; 30193da084b3Smrg esac 30203da084b3Smrg ;; 30213da084b3Smrg esac 30223da084b3Smrg ;; 30233da084b3Smrg esac 30243da084b3Smrg done 30253da084b3Smrg tmp_libs= 30263da084b3Smrg for deplib in $new_libs; do 30273da084b3Smrg case $deplib in 30283da084b3Smrg -L*) 30293da084b3Smrg case " $tmp_libs " in 30303da084b3Smrg *" $deplib "*) ;; 30313da084b3Smrg *) tmp_libs="$tmp_libs $deplib" ;; 30323da084b3Smrg esac 30333da084b3Smrg ;; 30343da084b3Smrg *) tmp_libs="$tmp_libs $deplib" ;; 30353da084b3Smrg esac 30363da084b3Smrg done 30373da084b3Smrg eval $var=\"$tmp_libs\" 30383da084b3Smrg done # for var 30393da084b3Smrg fi 30403da084b3Smrg # Last step: remove runtime libs from dependency_libs 30413da084b3Smrg # (they stay in deplibs) 30423da084b3Smrg tmp_libs= 30433da084b3Smrg for i in $dependency_libs ; do 30443da084b3Smrg case " $predeps $postdeps $compiler_lib_search_path " in 30453da084b3Smrg *" $i "*) 30463da084b3Smrg i="" 30473da084b3Smrg ;; 30483da084b3Smrg esac 30493da084b3Smrg if test -n "$i" ; then 30503da084b3Smrg tmp_libs="$tmp_libs $i" 30513da084b3Smrg fi 30523da084b3Smrg done 30533da084b3Smrg dependency_libs=$tmp_libs 30543da084b3Smrg done # for pass 30553da084b3Smrg if test "$linkmode" = prog; then 30563da084b3Smrg dlfiles="$newdlfiles" 30573da084b3Smrg dlprefiles="$newdlprefiles" 30583da084b3Smrg fi 30593da084b3Smrg 30603da084b3Smrg case $linkmode in 30613da084b3Smrg oldlib) 30623da084b3Smrg if test -n "$deplibs"; then 30633da084b3Smrg $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 30643da084b3Smrg fi 30653da084b3Smrg 30663da084b3Smrg if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then 30673da084b3Smrg $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 30683da084b3Smrg fi 30693da084b3Smrg 30703da084b3Smrg if test -n "$rpath"; then 30713da084b3Smrg $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 30723da084b3Smrg fi 30733da084b3Smrg 30743da084b3Smrg if test -n "$xrpath"; then 30753da084b3Smrg $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 30763da084b3Smrg fi 30773da084b3Smrg 30783da084b3Smrg if test -n "$vinfo"; then 30793da084b3Smrg $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 30803da084b3Smrg fi 30813da084b3Smrg 30823da084b3Smrg if test -n "$release"; then 30833da084b3Smrg $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 30843da084b3Smrg fi 30853da084b3Smrg 30863da084b3Smrg if test -n "$export_symbols" || test -n "$export_symbols_regex"; then 30873da084b3Smrg $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 30883da084b3Smrg fi 30893da084b3Smrg 30903da084b3Smrg # Now set the variables for building old libraries. 30913da084b3Smrg build_libtool_libs=no 30923da084b3Smrg oldlibs="$output" 30933da084b3Smrg objs="$objs$old_deplibs" 30943da084b3Smrg ;; 30953da084b3Smrg 30963da084b3Smrg lib) 30973da084b3Smrg # Make sure we only generate libraries of the form `libNAME.la'. 30983da084b3Smrg case $outputname in 30993da084b3Smrg lib*) 31003da084b3Smrg name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` 31013da084b3Smrg eval shared_ext=\"$shrext_cmds\" 31023da084b3Smrg eval libname=\"$libname_spec\" 31033da084b3Smrg ;; 31043da084b3Smrg *) 31053da084b3Smrg if test "$module" = no; then 31063da084b3Smrg $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 31073da084b3Smrg $echo "$help" 1>&2 31083da084b3Smrg exit $EXIT_FAILURE 31093da084b3Smrg fi 31103da084b3Smrg if test "$need_lib_prefix" != no; then 31113da084b3Smrg # Add the "lib" prefix for modules if required 31123da084b3Smrg name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` 31133da084b3Smrg eval shared_ext=\"$shrext_cmds\" 31143da084b3Smrg eval libname=\"$libname_spec\" 31153da084b3Smrg else 31163da084b3Smrg libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` 31173da084b3Smrg fi 31183da084b3Smrg ;; 31193da084b3Smrg esac 31203da084b3Smrg 31213da084b3Smrg if test -n "$objs"; then 31223da084b3Smrg if test "$deplibs_check_method" != pass_all; then 31233da084b3Smrg $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 31243da084b3Smrg exit $EXIT_FAILURE 31253da084b3Smrg else 31263da084b3Smrg $echo 31273da084b3Smrg $echo "*** Warning: Linking the shared library $output against the non-libtool" 31283da084b3Smrg $echo "*** objects $objs is not portable!" 31293da084b3Smrg libobjs="$libobjs $objs" 31303da084b3Smrg fi 31313da084b3Smrg fi 31323da084b3Smrg 31333da084b3Smrg if test "$dlself" != no; then 31343da084b3Smrg $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 31353da084b3Smrg fi 31363da084b3Smrg 31373da084b3Smrg set dummy $rpath 31383da084b3Smrg if test "$#" -gt 2; then 31393da084b3Smrg $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 31403da084b3Smrg fi 31413da084b3Smrg install_libdir="$2" 31423da084b3Smrg 31433da084b3Smrg oldlibs= 31443da084b3Smrg if test -z "$rpath"; then 31453da084b3Smrg if test "$build_libtool_libs" = yes; then 31463da084b3Smrg # Building a libtool convenience library. 31473da084b3Smrg # Some compilers have problems with a `.al' extension so 31483da084b3Smrg # convenience libraries should have the same extension an 31493da084b3Smrg # archive normally would. 31503da084b3Smrg oldlibs="$output_objdir/$libname.$libext $oldlibs" 31513da084b3Smrg build_libtool_libs=convenience 31523da084b3Smrg build_old_libs=yes 31533da084b3Smrg fi 31543da084b3Smrg 31553da084b3Smrg if test -n "$vinfo"; then 31563da084b3Smrg $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 31573da084b3Smrg fi 31583da084b3Smrg 31593da084b3Smrg if test -n "$release"; then 31603da084b3Smrg $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 31613da084b3Smrg fi 31623da084b3Smrg else 31633da084b3Smrg 31643da084b3Smrg # Parse the version information argument. 31653da084b3Smrg save_ifs="$IFS"; IFS=':' 31663da084b3Smrg set dummy $vinfo 0 0 0 31673da084b3Smrg IFS="$save_ifs" 31683da084b3Smrg 31693da084b3Smrg if test -n "$8"; then 31703da084b3Smrg $echo "$modename: too many parameters to \`-version-info'" 1>&2 31713da084b3Smrg $echo "$help" 1>&2 31723da084b3Smrg exit $EXIT_FAILURE 31733da084b3Smrg fi 31743da084b3Smrg 31753da084b3Smrg # convert absolute version numbers to libtool ages 31763da084b3Smrg # this retains compatibility with .la files and attempts 31773da084b3Smrg # to make the code below a bit more comprehensible 31783da084b3Smrg 31793da084b3Smrg case $vinfo_number in 31803da084b3Smrg yes) 31813da084b3Smrg number_major="$2" 31823da084b3Smrg number_minor="$3" 31833da084b3Smrg number_revision="$4" 31843da084b3Smrg # 31853da084b3Smrg # There are really only two kinds -- those that 31863da084b3Smrg # use the current revision as the major version 31873da084b3Smrg # and those that subtract age and use age as 31883da084b3Smrg # a minor version. But, then there is irix 31893da084b3Smrg # which has an extra 1 added just for fun 31903da084b3Smrg # 31913da084b3Smrg case $version_type in 31923da084b3Smrg darwin|linux|osf|windows) 31933da084b3Smrg current=`expr $number_major + $number_minor` 31943da084b3Smrg age="$number_minor" 31953da084b3Smrg revision="$number_revision" 31963da084b3Smrg ;; 31973da084b3Smrg freebsd-aout|freebsd-elf|sunos) 31983da084b3Smrg current="$number_major" 31993da084b3Smrg revision="$number_minor" 32003da084b3Smrg age="0" 32013da084b3Smrg ;; 32023da084b3Smrg irix|nonstopux) 32033da084b3Smrg current=`expr $number_major + $number_minor - 1` 32043da084b3Smrg age="$number_minor" 32053da084b3Smrg revision="$number_minor" 32063da084b3Smrg ;; 32073da084b3Smrg *) 32083da084b3Smrg $echo "$modename: unknown library version type \`$version_type'" 1>&2 32093da084b3Smrg $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 32103da084b3Smrg exit $EXIT_FAILURE 32113da084b3Smrg ;; 32123da084b3Smrg esac 32133da084b3Smrg ;; 32143da084b3Smrg no) 32153da084b3Smrg current="$2" 32163da084b3Smrg revision="$3" 32173da084b3Smrg age="$4" 32183da084b3Smrg ;; 32193da084b3Smrg esac 32203da084b3Smrg 32213da084b3Smrg # Check that each of the things are valid numbers. 32223da084b3Smrg case $current in 32233da084b3Smrg 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; 32243da084b3Smrg *) 32253da084b3Smrg $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 32263da084b3Smrg $echo "$modename: \`$vinfo' is not valid version information" 1>&2 32273da084b3Smrg exit $EXIT_FAILURE 32283da084b3Smrg ;; 32293da084b3Smrg esac 32303da084b3Smrg 32313da084b3Smrg case $revision in 32323da084b3Smrg 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; 32333da084b3Smrg *) 32343da084b3Smrg $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 32353da084b3Smrg $echo "$modename: \`$vinfo' is not valid version information" 1>&2 32363da084b3Smrg exit $EXIT_FAILURE 32373da084b3Smrg ;; 32383da084b3Smrg esac 32393da084b3Smrg 32403da084b3Smrg case $age in 32413da084b3Smrg 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; 32423da084b3Smrg *) 32433da084b3Smrg $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 32443da084b3Smrg $echo "$modename: \`$vinfo' is not valid version information" 1>&2 32453da084b3Smrg exit $EXIT_FAILURE 32463da084b3Smrg ;; 32473da084b3Smrg esac 32483da084b3Smrg 32493da084b3Smrg if test "$age" -gt "$current"; then 32503da084b3Smrg $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 32513da084b3Smrg $echo "$modename: \`$vinfo' is not valid version information" 1>&2 32523da084b3Smrg exit $EXIT_FAILURE 32533da084b3Smrg fi 32543da084b3Smrg 32553da084b3Smrg # Calculate the version variables. 32563da084b3Smrg major= 32573da084b3Smrg versuffix= 32583da084b3Smrg verstring= 32593da084b3Smrg case $version_type in 32603da084b3Smrg none) ;; 32613da084b3Smrg 32623da084b3Smrg darwin) 32633da084b3Smrg # Like Linux, but with the current version available in 32643da084b3Smrg # verstring for coding it into the library header 32653da084b3Smrg major=.`expr $current - $age` 32663da084b3Smrg versuffix="$major.$age.$revision" 32673da084b3Smrg # Darwin ld doesn't like 0 for these options... 32683da084b3Smrg minor_current=`expr $current + 1` 32693da084b3Smrg verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" 32703da084b3Smrg ;; 32713da084b3Smrg 32723da084b3Smrg freebsd-aout) 32733da084b3Smrg major=".$current" 32743da084b3Smrg versuffix=".$current.$revision"; 32753da084b3Smrg ;; 32763da084b3Smrg 32773da084b3Smrg freebsd-elf) 32783da084b3Smrg major=".$current" 32793da084b3Smrg versuffix=".$current"; 32803da084b3Smrg ;; 32813da084b3Smrg 32823da084b3Smrg irix | nonstopux) 32833da084b3Smrg major=`expr $current - $age + 1` 32843da084b3Smrg 32853da084b3Smrg case $version_type in 32863da084b3Smrg nonstopux) verstring_prefix=nonstopux ;; 32873da084b3Smrg *) verstring_prefix=sgi ;; 32883da084b3Smrg esac 32893da084b3Smrg verstring="$verstring_prefix$major.$revision" 32903da084b3Smrg 32913da084b3Smrg # Add in all the interfaces that we are compatible with. 32923da084b3Smrg loop=$revision 32933da084b3Smrg while test "$loop" -ne 0; do 32943da084b3Smrg iface=`expr $revision - $loop` 32953da084b3Smrg loop=`expr $loop - 1` 32963da084b3Smrg verstring="$verstring_prefix$major.$iface:$verstring" 32973da084b3Smrg done 32983da084b3Smrg 32993da084b3Smrg # Before this point, $major must not contain `.'. 33003da084b3Smrg major=.$major 33013da084b3Smrg versuffix="$major.$revision" 33023da084b3Smrg ;; 33033da084b3Smrg 33043da084b3Smrg linux) 33053da084b3Smrg major=.`expr $current - $age` 33063da084b3Smrg versuffix="$major.$age.$revision" 33073da084b3Smrg ;; 33083da084b3Smrg 33093da084b3Smrg osf) 33103da084b3Smrg major=.`expr $current - $age` 33113da084b3Smrg versuffix=".$current.$age.$revision" 33123da084b3Smrg verstring="$current.$age.$revision" 33133da084b3Smrg 33143da084b3Smrg # Add in all the interfaces that we are compatible with. 33153da084b3Smrg loop=$age 33163da084b3Smrg while test "$loop" -ne 0; do 33173da084b3Smrg iface=`expr $current - $loop` 33183da084b3Smrg loop=`expr $loop - 1` 33193da084b3Smrg verstring="$verstring:${iface}.0" 33203da084b3Smrg done 33213da084b3Smrg 33223da084b3Smrg # Make executables depend on our current version. 33233da084b3Smrg verstring="$verstring:${current}.0" 33243da084b3Smrg ;; 33253da084b3Smrg 33263da084b3Smrg sunos) 33273da084b3Smrg major=".$current" 33283da084b3Smrg versuffix=".$current.$revision" 33293da084b3Smrg ;; 33303da084b3Smrg 33313da084b3Smrg windows) 33323da084b3Smrg # Use '-' rather than '.', since we only want one 33333da084b3Smrg # extension on DOS 8.3 filesystems. 33343da084b3Smrg major=`expr $current - $age` 33353da084b3Smrg versuffix="-$major" 33363da084b3Smrg ;; 33373da084b3Smrg 33383da084b3Smrg *) 33393da084b3Smrg $echo "$modename: unknown library version type \`$version_type'" 1>&2 33403da084b3Smrg $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 33413da084b3Smrg exit $EXIT_FAILURE 33423da084b3Smrg ;; 33433da084b3Smrg esac 33443da084b3Smrg 33453da084b3Smrg # Clear the version info if we defaulted, and they specified a release. 33463da084b3Smrg if test -z "$vinfo" && test -n "$release"; then 33473da084b3Smrg major= 33483da084b3Smrg case $version_type in 33493da084b3Smrg darwin) 33503da084b3Smrg # we can't check for "0.0" in archive_cmds due to quoting 33513da084b3Smrg # problems, so we reset it completely 33523da084b3Smrg verstring= 33533da084b3Smrg ;; 33543da084b3Smrg *) 33553da084b3Smrg verstring="0.0" 33563da084b3Smrg ;; 33573da084b3Smrg esac 33583da084b3Smrg if test "$need_version" = no; then 33593da084b3Smrg versuffix= 33603da084b3Smrg else 33613da084b3Smrg versuffix=".0.0" 33623da084b3Smrg fi 33633da084b3Smrg fi 33643da084b3Smrg 33653da084b3Smrg # Remove version info from name if versioning should be avoided 33663da084b3Smrg if test "$avoid_version" = yes && test "$need_version" = no; then 33673da084b3Smrg major= 33683da084b3Smrg versuffix= 33693da084b3Smrg verstring="" 33703da084b3Smrg fi 33713da084b3Smrg 33723da084b3Smrg # Check to see if the archive will have undefined symbols. 33733da084b3Smrg if test "$allow_undefined" = yes; then 33743da084b3Smrg if test "$allow_undefined_flag" = unsupported; then 33753da084b3Smrg $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 33763da084b3Smrg build_libtool_libs=no 33773da084b3Smrg build_old_libs=yes 33783da084b3Smrg fi 33793da084b3Smrg else 33803da084b3Smrg # Don't allow undefined symbols. 33813da084b3Smrg allow_undefined_flag="$no_undefined_flag" 33823da084b3Smrg fi 33833da084b3Smrg fi 33843da084b3Smrg 33853da084b3Smrg if test "$mode" != relink; then 33863da084b3Smrg # Remove our outputs, but don't remove object files since they 33873da084b3Smrg # may have been created when compiling PIC objects. 33883da084b3Smrg removelist= 33893da084b3Smrg tempremovelist=`$echo "$output_objdir/*"` 33903da084b3Smrg for p in $tempremovelist; do 33913da084b3Smrg case $p in 33923da084b3Smrg *.$objext) 33933da084b3Smrg ;; 33943da084b3Smrg $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) 33953da084b3Smrg if test "X$precious_files_regex" != "X"; then 33963da084b3Smrg if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 33973da084b3Smrg then 33983da084b3Smrg continue 33993da084b3Smrg fi 34003da084b3Smrg fi 34013da084b3Smrg removelist="$removelist $p" 34023da084b3Smrg ;; 34033da084b3Smrg *) ;; 34043da084b3Smrg esac 34053da084b3Smrg done 34063da084b3Smrg if test -n "$removelist"; then 34073da084b3Smrg $show "${rm}r $removelist" 34083da084b3Smrg $run ${rm}r $removelist 34093da084b3Smrg fi 34103da084b3Smrg fi 34113da084b3Smrg 34123da084b3Smrg # Now set the variables for building old libraries. 34133da084b3Smrg if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then 34143da084b3Smrg oldlibs="$oldlibs $output_objdir/$libname.$libext" 34153da084b3Smrg 34163da084b3Smrg # Transform .lo files to .o files. 34173da084b3Smrg oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` 34183da084b3Smrg fi 34193da084b3Smrg 34203da084b3Smrg # Eliminate all temporary directories. 34213da084b3Smrg for path in $notinst_path; do 34223da084b3Smrg lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` 34233da084b3Smrg deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` 34243da084b3Smrg dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` 34253da084b3Smrg done 34263da084b3Smrg 34273da084b3Smrg if test -n "$xrpath"; then 34283da084b3Smrg # If the user specified any rpath flags, then add them. 34293da084b3Smrg temp_xrpath= 34303da084b3Smrg for libdir in $xrpath; do 34313da084b3Smrg temp_xrpath="$temp_xrpath -R$libdir" 34323da084b3Smrg case "$finalize_rpath " in 34333da084b3Smrg *" $libdir "*) ;; 34343da084b3Smrg *) finalize_rpath="$finalize_rpath $libdir" ;; 34353da084b3Smrg esac 34363da084b3Smrg done 34373da084b3Smrg if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then 34383da084b3Smrg dependency_libs="$temp_xrpath $dependency_libs" 34393da084b3Smrg fi 34403da084b3Smrg fi 34413da084b3Smrg 34423da084b3Smrg # Make sure dlfiles contains only unique files that won't be dlpreopened 34433da084b3Smrg old_dlfiles="$dlfiles" 34443da084b3Smrg dlfiles= 34453da084b3Smrg for lib in $old_dlfiles; do 34463da084b3Smrg case " $dlprefiles $dlfiles " in 34473da084b3Smrg *" $lib "*) ;; 34483da084b3Smrg *) dlfiles="$dlfiles $lib" ;; 34493da084b3Smrg esac 34503da084b3Smrg done 34513da084b3Smrg 34523da084b3Smrg # Make sure dlprefiles contains only unique files 34533da084b3Smrg old_dlprefiles="$dlprefiles" 34543da084b3Smrg dlprefiles= 34553da084b3Smrg for lib in $old_dlprefiles; do 34563da084b3Smrg case "$dlprefiles " in 34573da084b3Smrg *" $lib "*) ;; 34583da084b3Smrg *) dlprefiles="$dlprefiles $lib" ;; 34593da084b3Smrg esac 34603da084b3Smrg done 34613da084b3Smrg 34623da084b3Smrg if test "$build_libtool_libs" = yes; then 34633da084b3Smrg if test -n "$rpath"; then 34643da084b3Smrg case $host in 34653da084b3Smrg *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) 34663da084b3Smrg # these systems don't actually have a c library (as such)! 34673da084b3Smrg ;; 34683da084b3Smrg *-*-rhapsody* | *-*-darwin1.[012]) 34693da084b3Smrg # Rhapsody C library is in the System framework 34703da084b3Smrg deplibs="$deplibs -framework System" 34713da084b3Smrg ;; 34723da084b3Smrg *-*-netbsd*) 34733da084b3Smrg # Don't link with libc until the a.out ld.so is fixed. 34743da084b3Smrg ;; 34753da084b3Smrg *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) 34763da084b3Smrg # Do not include libc due to us having libc/libc_r. 34773da084b3Smrg ;; 34783da084b3Smrg *-*-sco3.2v5* | *-*-sco5v6*) 34793da084b3Smrg # Causes problems with __ctype 34803da084b3Smrg ;; 34813da084b3Smrg *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) 34823da084b3Smrg # Compiler inserts libc in the correct place for threads to work 34833da084b3Smrg ;; 34843da084b3Smrg *) 34853da084b3Smrg # Add libc to deplibs on all other systems if necessary. 34863da084b3Smrg if test "$build_libtool_need_lc" = "yes"; then 34873da084b3Smrg deplibs="$deplibs -lc" 34883da084b3Smrg fi 34893da084b3Smrg ;; 34903da084b3Smrg esac 34913da084b3Smrg fi 34923da084b3Smrg 34933da084b3Smrg # Transform deplibs into only deplibs that can be linked in shared. 34943da084b3Smrg name_save=$name 34953da084b3Smrg libname_save=$libname 34963da084b3Smrg release_save=$release 34973da084b3Smrg versuffix_save=$versuffix 34983da084b3Smrg major_save=$major 34993da084b3Smrg # I'm not sure if I'm treating the release correctly. I think 35003da084b3Smrg # release should show up in the -l (ie -lgmp5) so we don't want to 35013da084b3Smrg # add it in twice. Is that correct? 35023da084b3Smrg release="" 35033da084b3Smrg versuffix="" 35043da084b3Smrg major="" 35053da084b3Smrg newdeplibs= 35063da084b3Smrg droppeddeps=no 35073da084b3Smrg case $deplibs_check_method in 35083da084b3Smrg pass_all) 35093da084b3Smrg # Don't check for shared/static. Everything works. 35103da084b3Smrg # This might be a little naive. We might want to check 35113da084b3Smrg # whether the library exists or not. But this is on 35123da084b3Smrg # osf3 & osf4 and I'm not really sure... Just 35133da084b3Smrg # implementing what was already the behavior. 35143da084b3Smrg newdeplibs=$deplibs 35153da084b3Smrg ;; 35163da084b3Smrg test_compile) 35173da084b3Smrg # This code stresses the "libraries are programs" paradigm to its 35183da084b3Smrg # limits. Maybe even breaks it. We compile a program, linking it 35193da084b3Smrg # against the deplibs as a proxy for the library. Then we can check 35203da084b3Smrg # whether they linked in statically or dynamically with ldd. 35213da084b3Smrg $rm conftest.c 35223da084b3Smrg cat > conftest.c <<EOF 35233da084b3Smrg int main() { return 0; } 35243da084b3SmrgEOF 35253da084b3Smrg $rm conftest 35263da084b3Smrg $LTCC $LTCFLAGS -o conftest conftest.c $deplibs 35273da084b3Smrg if test "$?" -eq 0 ; then 35283da084b3Smrg ldd_output=`ldd conftest` 35293da084b3Smrg for i in $deplibs; do 35303da084b3Smrg name=`expr $i : '-l\(.*\)'` 35313da084b3Smrg # If $name is empty we are operating on a -L argument. 35323da084b3Smrg if test "$name" != "" && test "$name" -ne "0"; then 35333da084b3Smrg if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 35343da084b3Smrg case " $predeps $postdeps " in 35353da084b3Smrg *" $i "*) 35363da084b3Smrg newdeplibs="$newdeplibs $i" 35373da084b3Smrg i="" 35383da084b3Smrg ;; 35393da084b3Smrg esac 35403da084b3Smrg fi 35413da084b3Smrg if test -n "$i" ; then 35423da084b3Smrg libname=`eval \\$echo \"$libname_spec\"` 35433da084b3Smrg deplib_matches=`eval \\$echo \"$library_names_spec\"` 35443da084b3Smrg set dummy $deplib_matches 35453da084b3Smrg deplib_match=$2 35463da084b3Smrg if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then 35473da084b3Smrg newdeplibs="$newdeplibs $i" 35483da084b3Smrg else 35493da084b3Smrg droppeddeps=yes 35503da084b3Smrg $echo 35513da084b3Smrg $echo "*** Warning: dynamic linker does not accept needed library $i." 35523da084b3Smrg $echo "*** I have the capability to make that library automatically link in when" 35533da084b3Smrg $echo "*** you link to this library. But I can only do this if you have a" 35543da084b3Smrg $echo "*** shared version of the library, which I believe you do not have" 35553da084b3Smrg $echo "*** because a test_compile did reveal that the linker did not use it for" 35563da084b3Smrg $echo "*** its dynamic dependency list that programs get resolved with at runtime." 35573da084b3Smrg fi 35583da084b3Smrg fi 35593da084b3Smrg else 35603da084b3Smrg newdeplibs="$newdeplibs $i" 35613da084b3Smrg fi 35623da084b3Smrg done 35633da084b3Smrg else 35643da084b3Smrg # Error occurred in the first compile. Let's try to salvage 35653da084b3Smrg # the situation: Compile a separate program for each library. 35663da084b3Smrg for i in $deplibs; do 35673da084b3Smrg name=`expr $i : '-l\(.*\)'` 35683da084b3Smrg # If $name is empty we are operating on a -L argument. 35693da084b3Smrg if test "$name" != "" && test "$name" != "0"; then 35703da084b3Smrg $rm conftest 35713da084b3Smrg $LTCC $LTCFLAGS -o conftest conftest.c $i 35723da084b3Smrg # Did it work? 35733da084b3Smrg if test "$?" -eq 0 ; then 35743da084b3Smrg ldd_output=`ldd conftest` 35753da084b3Smrg if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 35763da084b3Smrg case " $predeps $postdeps " in 35773da084b3Smrg *" $i "*) 35783da084b3Smrg newdeplibs="$newdeplibs $i" 35793da084b3Smrg i="" 35803da084b3Smrg ;; 35813da084b3Smrg esac 35823da084b3Smrg fi 35833da084b3Smrg if test -n "$i" ; then 35843da084b3Smrg libname=`eval \\$echo \"$libname_spec\"` 35853da084b3Smrg deplib_matches=`eval \\$echo \"$library_names_spec\"` 35863da084b3Smrg set dummy $deplib_matches 35873da084b3Smrg deplib_match=$2 35883da084b3Smrg if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then 35893da084b3Smrg newdeplibs="$newdeplibs $i" 35903da084b3Smrg else 35913da084b3Smrg droppeddeps=yes 35923da084b3Smrg $echo 35933da084b3Smrg $echo "*** Warning: dynamic linker does not accept needed library $i." 35943da084b3Smrg $echo "*** I have the capability to make that library automatically link in when" 35953da084b3Smrg $echo "*** you link to this library. But I can only do this if you have a" 35963da084b3Smrg $echo "*** shared version of the library, which you do not appear to have" 35973da084b3Smrg $echo "*** because a test_compile did reveal that the linker did not use this one" 35983da084b3Smrg $echo "*** as a dynamic dependency that programs can get resolved with at runtime." 35993da084b3Smrg fi 36003da084b3Smrg fi 36013da084b3Smrg else 36023da084b3Smrg droppeddeps=yes 36033da084b3Smrg $echo 36043da084b3Smrg $echo "*** Warning! Library $i is needed by this library but I was not able to" 36053da084b3Smrg $echo "*** make it link in! You will probably need to install it or some" 36063da084b3Smrg $echo "*** library that it depends on before this library will be fully" 36073da084b3Smrg $echo "*** functional. Installing it before continuing would be even better." 36083da084b3Smrg fi 36093da084b3Smrg else 36103da084b3Smrg newdeplibs="$newdeplibs $i" 36113da084b3Smrg fi 36123da084b3Smrg done 36133da084b3Smrg fi 36143da084b3Smrg ;; 36153da084b3Smrg file_magic*) 36163da084b3Smrg set dummy $deplibs_check_method 36173da084b3Smrg file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 36183da084b3Smrg for a_deplib in $deplibs; do 36193da084b3Smrg name=`expr $a_deplib : '-l\(.*\)'` 36203da084b3Smrg # If $name is empty we are operating on a -L argument. 36213da084b3Smrg if test "$name" != "" && test "$name" != "0"; then 36223da084b3Smrg if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 36233da084b3Smrg case " $predeps $postdeps " in 36243da084b3Smrg *" $a_deplib "*) 36253da084b3Smrg newdeplibs="$newdeplibs $a_deplib" 36263da084b3Smrg a_deplib="" 36273da084b3Smrg ;; 36283da084b3Smrg esac 36293da084b3Smrg fi 36303da084b3Smrg if test -n "$a_deplib" ; then 36313da084b3Smrg libname=`eval \\$echo \"$libname_spec\"` 36323da084b3Smrg for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do 36333da084b3Smrg potential_libs=`ls $i/$libname[.-]* 2>/dev/null` 36343da084b3Smrg for potent_lib in $potential_libs; do 36353da084b3Smrg # Follow soft links. 36363da084b3Smrg if ls -lLd "$potent_lib" 2>/dev/null \ 36373da084b3Smrg | grep " -> " >/dev/null; then 36383da084b3Smrg continue 36393da084b3Smrg fi 36403da084b3Smrg # The statement above tries to avoid entering an 36413da084b3Smrg # endless loop below, in case of cyclic links. 36423da084b3Smrg # We might still enter an endless loop, since a link 36433da084b3Smrg # loop can be closed while we follow links, 36443da084b3Smrg # but so what? 36453da084b3Smrg potlib="$potent_lib" 36463da084b3Smrg while test -h "$potlib" 2>/dev/null; do 36473da084b3Smrg potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` 36483da084b3Smrg case $potliblink in 36493da084b3Smrg [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; 36503da084b3Smrg *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; 36513da084b3Smrg esac 36523da084b3Smrg done 36533da084b3Smrg if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ 36543da084b3Smrg | ${SED} 10q \ 36553da084b3Smrg | $EGREP "$file_magic_regex" > /dev/null; then 36563da084b3Smrg newdeplibs="$newdeplibs $a_deplib" 36573da084b3Smrg a_deplib="" 36583da084b3Smrg break 2 36593da084b3Smrg fi 36603da084b3Smrg done 36613da084b3Smrg done 36623da084b3Smrg fi 36633da084b3Smrg if test -n "$a_deplib" ; then 36643da084b3Smrg droppeddeps=yes 36653da084b3Smrg $echo 36663da084b3Smrg $echo "*** Warning: linker path does not have real file for library $a_deplib." 36673da084b3Smrg $echo "*** I have the capability to make that library automatically link in when" 36683da084b3Smrg $echo "*** you link to this library. But I can only do this if you have a" 36693da084b3Smrg $echo "*** shared version of the library, which you do not appear to have" 36703da084b3Smrg $echo "*** because I did check the linker path looking for a file starting" 36713da084b3Smrg if test -z "$potlib" ; then 36723da084b3Smrg $echo "*** with $libname but no candidates were found. (...for file magic test)" 36733da084b3Smrg else 36743da084b3Smrg $echo "*** with $libname and none of the candidates passed a file format test" 36753da084b3Smrg $echo "*** using a file magic. Last file checked: $potlib" 36763da084b3Smrg fi 36773da084b3Smrg fi 36783da084b3Smrg else 36793da084b3Smrg # Add a -L argument. 36803da084b3Smrg newdeplibs="$newdeplibs $a_deplib" 36813da084b3Smrg fi 36823da084b3Smrg done # Gone through all deplibs. 36833da084b3Smrg ;; 36843da084b3Smrg match_pattern*) 36853da084b3Smrg set dummy $deplibs_check_method 36863da084b3Smrg match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 36873da084b3Smrg for a_deplib in $deplibs; do 36883da084b3Smrg name=`expr $a_deplib : '-l\(.*\)'` 36893da084b3Smrg # If $name is empty we are operating on a -L argument. 36903da084b3Smrg if test -n "$name" && test "$name" != "0"; then 36913da084b3Smrg if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 36923da084b3Smrg case " $predeps $postdeps " in 36933da084b3Smrg *" $a_deplib "*) 36943da084b3Smrg newdeplibs="$newdeplibs $a_deplib" 36953da084b3Smrg a_deplib="" 36963da084b3Smrg ;; 36973da084b3Smrg esac 36983da084b3Smrg fi 36993da084b3Smrg if test -n "$a_deplib" ; then 37003da084b3Smrg libname=`eval \\$echo \"$libname_spec\"` 37013da084b3Smrg for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do 37023da084b3Smrg potential_libs=`ls $i/$libname[.-]* 2>/dev/null` 37033da084b3Smrg for potent_lib in $potential_libs; do 37043da084b3Smrg potlib="$potent_lib" # see symlink-check above in file_magic test 37053da084b3Smrg if eval $echo \"$potent_lib\" 2>/dev/null \ 37063da084b3Smrg | ${SED} 10q \ 37073da084b3Smrg | $EGREP "$match_pattern_regex" > /dev/null; then 37083da084b3Smrg newdeplibs="$newdeplibs $a_deplib" 37093da084b3Smrg a_deplib="" 37103da084b3Smrg break 2 37113da084b3Smrg fi 37123da084b3Smrg done 37133da084b3Smrg done 37143da084b3Smrg fi 37153da084b3Smrg if test -n "$a_deplib" ; then 37163da084b3Smrg droppeddeps=yes 37173da084b3Smrg $echo 37183da084b3Smrg $echo "*** Warning: linker path does not have real file for library $a_deplib." 37193da084b3Smrg $echo "*** I have the capability to make that library automatically link in when" 37203da084b3Smrg $echo "*** you link to this library. But I can only do this if you have a" 37213da084b3Smrg $echo "*** shared version of the library, which you do not appear to have" 37223da084b3Smrg $echo "*** because I did check the linker path looking for a file starting" 37233da084b3Smrg if test -z "$potlib" ; then 37243da084b3Smrg $echo "*** with $libname but no candidates were found. (...for regex pattern test)" 37253da084b3Smrg else 37263da084b3Smrg $echo "*** with $libname and none of the candidates passed a file format test" 37273da084b3Smrg $echo "*** using a regex pattern. Last file checked: $potlib" 37283da084b3Smrg fi 37293da084b3Smrg fi 37303da084b3Smrg else 37313da084b3Smrg # Add a -L argument. 37323da084b3Smrg newdeplibs="$newdeplibs $a_deplib" 37333da084b3Smrg fi 37343da084b3Smrg done # Gone through all deplibs. 37353da084b3Smrg ;; 37363da084b3Smrg none | unknown | *) 37373da084b3Smrg newdeplibs="" 37383da084b3Smrg tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ 37393da084b3Smrg -e 's/ -[LR][^ ]*//g'` 37403da084b3Smrg if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 37413da084b3Smrg for i in $predeps $postdeps ; do 37423da084b3Smrg # can't use Xsed below, because $i might contain '/' 37433da084b3Smrg tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` 37443da084b3Smrg done 37453da084b3Smrg fi 37463da084b3Smrg if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ 37473da084b3Smrg | grep . >/dev/null; then 37483da084b3Smrg $echo 37493da084b3Smrg if test "X$deplibs_check_method" = "Xnone"; then 37503da084b3Smrg $echo "*** Warning: inter-library dependencies are not supported in this platform." 37513da084b3Smrg else 37523da084b3Smrg $echo "*** Warning: inter-library dependencies are not known to be supported." 37533da084b3Smrg fi 37543da084b3Smrg $echo "*** All declared inter-library dependencies are being dropped." 37553da084b3Smrg droppeddeps=yes 37563da084b3Smrg fi 37573da084b3Smrg ;; 37583da084b3Smrg esac 37593da084b3Smrg versuffix=$versuffix_save 37603da084b3Smrg major=$major_save 37613da084b3Smrg release=$release_save 37623da084b3Smrg libname=$libname_save 37633da084b3Smrg name=$name_save 37643da084b3Smrg 37653da084b3Smrg case $host in 37663da084b3Smrg *-*-rhapsody* | *-*-darwin1.[012]) 37673da084b3Smrg # On Rhapsody replace the C library is the System framework 37683da084b3Smrg newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` 37693da084b3Smrg ;; 37703da084b3Smrg esac 37713da084b3Smrg 37723da084b3Smrg if test "$droppeddeps" = yes; then 37733da084b3Smrg if test "$module" = yes; then 37743da084b3Smrg $echo 37753da084b3Smrg $echo "*** Warning: libtool could not satisfy all declared inter-library" 37763da084b3Smrg $echo "*** dependencies of module $libname. Therefore, libtool will create" 37773da084b3Smrg $echo "*** a static module, that should work as long as the dlopening" 37783da084b3Smrg $echo "*** application is linked with the -dlopen flag." 37793da084b3Smrg if test -z "$global_symbol_pipe"; then 37803da084b3Smrg $echo 37813da084b3Smrg $echo "*** However, this would only work if libtool was able to extract symbol" 37823da084b3Smrg $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" 37833da084b3Smrg $echo "*** not find such a program. So, this module is probably useless." 37843da084b3Smrg $echo "*** \`nm' from GNU binutils and a full rebuild may help." 37853da084b3Smrg fi 37863da084b3Smrg if test "$build_old_libs" = no; then 37873da084b3Smrg oldlibs="$output_objdir/$libname.$libext" 37883da084b3Smrg build_libtool_libs=module 37893da084b3Smrg build_old_libs=yes 37903da084b3Smrg else 37913da084b3Smrg build_libtool_libs=no 37923da084b3Smrg fi 37933da084b3Smrg else 37943da084b3Smrg $echo "*** The inter-library dependencies that have been dropped here will be" 37953da084b3Smrg $echo "*** automatically added whenever a program is linked with this library" 37963da084b3Smrg $echo "*** or is declared to -dlopen it." 37973da084b3Smrg 37983da084b3Smrg if test "$allow_undefined" = no; then 37993da084b3Smrg $echo 38003da084b3Smrg $echo "*** Since this library must not contain undefined symbols," 38013da084b3Smrg $echo "*** because either the platform does not support them or" 38023da084b3Smrg $echo "*** it was explicitly requested with -no-undefined," 38033da084b3Smrg $echo "*** libtool will only create a static version of it." 38043da084b3Smrg if test "$build_old_libs" = no; then 38053da084b3Smrg oldlibs="$output_objdir/$libname.$libext" 38063da084b3Smrg build_libtool_libs=module 38073da084b3Smrg build_old_libs=yes 38083da084b3Smrg else 38093da084b3Smrg build_libtool_libs=no 38103da084b3Smrg fi 38113da084b3Smrg fi 38123da084b3Smrg fi 38133da084b3Smrg fi 38143da084b3Smrg # Done checking deplibs! 38153da084b3Smrg deplibs=$newdeplibs 38163da084b3Smrg fi 38173da084b3Smrg 38183da084b3Smrg 38193da084b3Smrg # move library search paths that coincide with paths to not yet 38203da084b3Smrg # installed libraries to the beginning of the library search list 38213da084b3Smrg new_libs= 38223da084b3Smrg for path in $notinst_path; do 38233da084b3Smrg case " $new_libs " in 38243da084b3Smrg *" -L$path/$objdir "*) ;; 38253da084b3Smrg *) 38263da084b3Smrg case " $deplibs " in 38273da084b3Smrg *" -L$path/$objdir "*) 38283da084b3Smrg new_libs="$new_libs -L$path/$objdir" ;; 38293da084b3Smrg esac 38303da084b3Smrg ;; 38313da084b3Smrg esac 38323da084b3Smrg done 38333da084b3Smrg for deplib in $deplibs; do 38343da084b3Smrg case $deplib in 38353da084b3Smrg -L*) 38363da084b3Smrg case " $new_libs " in 38373da084b3Smrg *" $deplib "*) ;; 38383da084b3Smrg *) new_libs="$new_libs $deplib" ;; 38393da084b3Smrg esac 38403da084b3Smrg ;; 38413da084b3Smrg *) new_libs="$new_libs $deplib" ;; 38423da084b3Smrg esac 38433da084b3Smrg done 38443da084b3Smrg deplibs="$new_libs" 38453da084b3Smrg 38463da084b3Smrg 38473da084b3Smrg # All the library-specific variables (install_libdir is set above). 38483da084b3Smrg library_names= 38493da084b3Smrg old_library= 38503da084b3Smrg dlname= 38513da084b3Smrg 38523da084b3Smrg # Test again, we may have decided not to build it any more 38533da084b3Smrg if test "$build_libtool_libs" = yes; then 38543da084b3Smrg if test "$hardcode_into_libs" = yes; then 38553da084b3Smrg # Hardcode the library paths 38563da084b3Smrg hardcode_libdirs= 38573da084b3Smrg dep_rpath= 38583da084b3Smrg rpath="$finalize_rpath" 38593da084b3Smrg test "$mode" != relink && rpath="$compile_rpath$rpath" 38603da084b3Smrg for libdir in $rpath; do 38613da084b3Smrg if test -n "$hardcode_libdir_flag_spec"; then 38623da084b3Smrg if test -n "$hardcode_libdir_separator"; then 38633da084b3Smrg if test -z "$hardcode_libdirs"; then 38643da084b3Smrg hardcode_libdirs="$libdir" 38653da084b3Smrg else 38663da084b3Smrg # Just accumulate the unique libdirs. 38673da084b3Smrg case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in 38683da084b3Smrg *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) 38693da084b3Smrg ;; 38703da084b3Smrg *) 38713da084b3Smrg hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" 38723da084b3Smrg ;; 38733da084b3Smrg esac 38743da084b3Smrg fi 38753da084b3Smrg else 38763da084b3Smrg eval flag=\"$hardcode_libdir_flag_spec\" 38773da084b3Smrg dep_rpath="$dep_rpath $flag" 38783da084b3Smrg fi 38793da084b3Smrg elif test -n "$runpath_var"; then 38803da084b3Smrg case "$perm_rpath " in 38813da084b3Smrg *" $libdir "*) ;; 38823da084b3Smrg *) perm_rpath="$perm_rpath $libdir" ;; 38833da084b3Smrg esac 38843da084b3Smrg fi 38853da084b3Smrg done 38863da084b3Smrg # Substitute the hardcoded libdirs into the rpath. 38873da084b3Smrg if test -n "$hardcode_libdir_separator" && 38883da084b3Smrg test -n "$hardcode_libdirs"; then 38893da084b3Smrg libdir="$hardcode_libdirs" 38903da084b3Smrg if test -n "$hardcode_libdir_flag_spec_ld"; then 38913da084b3Smrg eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" 38923da084b3Smrg else 38933da084b3Smrg eval dep_rpath=\"$hardcode_libdir_flag_spec\" 38943da084b3Smrg fi 38953da084b3Smrg fi 38963da084b3Smrg if test -n "$runpath_var" && test -n "$perm_rpath"; then 38973da084b3Smrg # We should set the runpath_var. 38983da084b3Smrg rpath= 38993da084b3Smrg for dir in $perm_rpath; do 39003da084b3Smrg rpath="$rpath$dir:" 39013da084b3Smrg done 39023da084b3Smrg eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" 39033da084b3Smrg fi 39043da084b3Smrg test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" 39053da084b3Smrg fi 39063da084b3Smrg 39073da084b3Smrg shlibpath="$finalize_shlibpath" 39083da084b3Smrg test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" 39093da084b3Smrg if test -n "$shlibpath"; then 39103da084b3Smrg eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" 39113da084b3Smrg fi 39123da084b3Smrg 39133da084b3Smrg # Get the real and link names of the library. 39143da084b3Smrg eval shared_ext=\"$shrext_cmds\" 39153da084b3Smrg eval library_names=\"$library_names_spec\" 39163da084b3Smrg set dummy $library_names 39173da084b3Smrg realname="$2" 39183da084b3Smrg shift; shift 39193da084b3Smrg 39203da084b3Smrg if test -n "$soname_spec"; then 39213da084b3Smrg eval soname=\"$soname_spec\" 39223da084b3Smrg else 39233da084b3Smrg soname="$realname" 39243da084b3Smrg fi 39253da084b3Smrg if test -z "$dlname"; then 39263da084b3Smrg dlname=$soname 39273da084b3Smrg fi 39283da084b3Smrg 39293da084b3Smrg lib="$output_objdir/$realname" 39303da084b3Smrg linknames= 39313da084b3Smrg for link 39323da084b3Smrg do 39333da084b3Smrg linknames="$linknames $link" 39343da084b3Smrg done 39353da084b3Smrg 39363da084b3Smrg # Use standard objects if they are pic 39373da084b3Smrg test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` 39383da084b3Smrg 39393da084b3Smrg # Prepare the list of exported symbols 39403da084b3Smrg if test -z "$export_symbols"; then 39413da084b3Smrg if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then 39423da084b3Smrg $show "generating symbol list for \`$libname.la'" 39433da084b3Smrg export_symbols="$output_objdir/$libname.exp" 39443da084b3Smrg $run $rm $export_symbols 39453da084b3Smrg cmds=$export_symbols_cmds 39463da084b3Smrg save_ifs="$IFS"; IFS='~' 39473da084b3Smrg for cmd in $cmds; do 39483da084b3Smrg IFS="$save_ifs" 39493da084b3Smrg eval cmd=\"$cmd\" 39503da084b3Smrg if len=`expr "X$cmd" : ".*"` && 39513da084b3Smrg test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then 39523da084b3Smrg $show "$cmd" 39533da084b3Smrg $run eval "$cmd" || exit $? 39543da084b3Smrg skipped_export=false 39553da084b3Smrg else 39563da084b3Smrg # The command line is too long to execute in one step. 39573da084b3Smrg $show "using reloadable object file for export list..." 39583da084b3Smrg skipped_export=: 39593da084b3Smrg # Break out early, otherwise skipped_export may be 39603da084b3Smrg # set to false by a later but shorter cmd. 39613da084b3Smrg break 39623da084b3Smrg fi 39633da084b3Smrg done 39643da084b3Smrg IFS="$save_ifs" 39653da084b3Smrg if test -n "$export_symbols_regex"; then 39663da084b3Smrg $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" 39673da084b3Smrg $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' 39683da084b3Smrg $show "$mv \"${export_symbols}T\" \"$export_symbols\"" 39693da084b3Smrg $run eval '$mv "${export_symbols}T" "$export_symbols"' 39703da084b3Smrg fi 39713da084b3Smrg fi 39723da084b3Smrg fi 39733da084b3Smrg 39743da084b3Smrg if test -n "$export_symbols" && test -n "$include_expsyms"; then 39753da084b3Smrg $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' 39763da084b3Smrg fi 39773da084b3Smrg 39783da084b3Smrg tmp_deplibs= 39793da084b3Smrg for test_deplib in $deplibs; do 39803da084b3Smrg case " $convenience " in 39813da084b3Smrg *" $test_deplib "*) ;; 39823da084b3Smrg *) 39833da084b3Smrg tmp_deplibs="$tmp_deplibs $test_deplib" 39843da084b3Smrg ;; 39853da084b3Smrg esac 39863da084b3Smrg done 39873da084b3Smrg deplibs="$tmp_deplibs" 39883da084b3Smrg 39893da084b3Smrg if test -n "$convenience"; then 39903da084b3Smrg if test -n "$whole_archive_flag_spec"; then 39913da084b3Smrg save_libobjs=$libobjs 39923da084b3Smrg eval libobjs=\"\$libobjs $whole_archive_flag_spec\" 39933da084b3Smrg else 39943da084b3Smrg gentop="$output_objdir/${outputname}x" 39953da084b3Smrg generated="$generated $gentop" 39963da084b3Smrg 39973da084b3Smrg func_extract_archives $gentop $convenience 39983da084b3Smrg libobjs="$libobjs $func_extract_archives_result" 39993da084b3Smrg fi 40003da084b3Smrg fi 40013da084b3Smrg 40023da084b3Smrg if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then 40033da084b3Smrg eval flag=\"$thread_safe_flag_spec\" 40043da084b3Smrg linker_flags="$linker_flags $flag" 40053da084b3Smrg fi 40063da084b3Smrg 40073da084b3Smrg # Make a backup of the uninstalled library when relinking 40083da084b3Smrg if test "$mode" = relink; then 40093da084b3Smrg $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? 40103da084b3Smrg fi 40113da084b3Smrg 40123da084b3Smrg # Do each of the archive commands. 40133da084b3Smrg if test "$module" = yes && test -n "$module_cmds" ; then 40143da084b3Smrg if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then 40153da084b3Smrg eval test_cmds=\"$module_expsym_cmds\" 40163da084b3Smrg cmds=$module_expsym_cmds 40173da084b3Smrg else 40183da084b3Smrg eval test_cmds=\"$module_cmds\" 40193da084b3Smrg cmds=$module_cmds 40203da084b3Smrg fi 40213da084b3Smrg else 40223da084b3Smrg if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then 40233da084b3Smrg eval test_cmds=\"$archive_expsym_cmds\" 40243da084b3Smrg cmds=$archive_expsym_cmds 40253da084b3Smrg else 40263da084b3Smrg eval test_cmds=\"$archive_cmds\" 40273da084b3Smrg cmds=$archive_cmds 40283da084b3Smrg fi 40293da084b3Smrg fi 40303da084b3Smrg 40313da084b3Smrg if test "X$skipped_export" != "X:" && 40323da084b3Smrg len=`expr "X$test_cmds" : ".*" 2>/dev/null` && 40333da084b3Smrg test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then 40343da084b3Smrg : 40353da084b3Smrg else 40363da084b3Smrg # The command line is too long to link in one step, link piecewise. 40373da084b3Smrg $echo "creating reloadable object files..." 40383da084b3Smrg 40393da084b3Smrg # Save the value of $output and $libobjs because we want to 40403da084b3Smrg # use them later. If we have whole_archive_flag_spec, we 40413da084b3Smrg # want to use save_libobjs as it was before 40423da084b3Smrg # whole_archive_flag_spec was expanded, because we can't 40433da084b3Smrg # assume the linker understands whole_archive_flag_spec. 40443da084b3Smrg # This may have to be revisited, in case too many 40453da084b3Smrg # convenience libraries get linked in and end up exceeding 40463da084b3Smrg # the spec. 40473da084b3Smrg if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then 40483da084b3Smrg save_libobjs=$libobjs 40493da084b3Smrg fi 40503da084b3Smrg save_output=$output 40513da084b3Smrg output_la=`$echo "X$output" | $Xsed -e "$basename"` 40523da084b3Smrg 40533da084b3Smrg # Clear the reloadable object creation command queue and 40543da084b3Smrg # initialize k to one. 40553da084b3Smrg test_cmds= 40563da084b3Smrg concat_cmds= 40573da084b3Smrg objlist= 40583da084b3Smrg delfiles= 40593da084b3Smrg last_robj= 40603da084b3Smrg k=1 40613da084b3Smrg output=$output_objdir/$output_la-${k}.$objext 40623da084b3Smrg # Loop over the list of objects to be linked. 40633da084b3Smrg for obj in $save_libobjs 40643da084b3Smrg do 40653da084b3Smrg eval test_cmds=\"$reload_cmds $objlist $last_robj\" 40663da084b3Smrg if test "X$objlist" = X || 40673da084b3Smrg { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && 40683da084b3Smrg test "$len" -le "$max_cmd_len"; }; then 40693da084b3Smrg objlist="$objlist $obj" 40703da084b3Smrg else 40713da084b3Smrg # The command $test_cmds is almost too long, add a 40723da084b3Smrg # command to the queue. 40733da084b3Smrg if test "$k" -eq 1 ; then 40743da084b3Smrg # The first file doesn't have a previous command to add. 40753da084b3Smrg eval concat_cmds=\"$reload_cmds $objlist $last_robj\" 40763da084b3Smrg else 40773da084b3Smrg # All subsequent reloadable object files will link in 40783da084b3Smrg # the last one created. 40793da084b3Smrg eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" 40803da084b3Smrg fi 40813da084b3Smrg last_robj=$output_objdir/$output_la-${k}.$objext 40823da084b3Smrg k=`expr $k + 1` 40833da084b3Smrg output=$output_objdir/$output_la-${k}.$objext 40843da084b3Smrg objlist=$obj 40853da084b3Smrg len=1 40863da084b3Smrg fi 40873da084b3Smrg done 40883da084b3Smrg # Handle the remaining objects by creating one last 40893da084b3Smrg # reloadable object file. All subsequent reloadable object 40903da084b3Smrg # files will link in the last one created. 40913da084b3Smrg test -z "$concat_cmds" || concat_cmds=$concat_cmds~ 40923da084b3Smrg eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" 40933da084b3Smrg 40943da084b3Smrg if ${skipped_export-false}; then 40953da084b3Smrg $show "generating symbol list for \`$libname.la'" 40963da084b3Smrg export_symbols="$output_objdir/$libname.exp" 40973da084b3Smrg $run $rm $export_symbols 40983da084b3Smrg libobjs=$output 40993da084b3Smrg # Append the command to create the export file. 41003da084b3Smrg eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" 41013da084b3Smrg fi 41023da084b3Smrg 41033da084b3Smrg # Set up a command to remove the reloadable object files 41043da084b3Smrg # after they are used. 41053da084b3Smrg i=0 41063da084b3Smrg while test "$i" -lt "$k" 41073da084b3Smrg do 41083da084b3Smrg i=`expr $i + 1` 41093da084b3Smrg delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" 41103da084b3Smrg done 41113da084b3Smrg 41123da084b3Smrg $echo "creating a temporary reloadable object file: $output" 41133da084b3Smrg 41143da084b3Smrg # Loop through the commands generated above and execute them. 41153da084b3Smrg save_ifs="$IFS"; IFS='~' 41163da084b3Smrg for cmd in $concat_cmds; do 41173da084b3Smrg IFS="$save_ifs" 41183da084b3Smrg $show "$cmd" 41193da084b3Smrg $run eval "$cmd" || exit $? 41203da084b3Smrg done 41213da084b3Smrg IFS="$save_ifs" 41223da084b3Smrg 41233da084b3Smrg libobjs=$output 41243da084b3Smrg # Restore the value of output. 41253da084b3Smrg output=$save_output 41263da084b3Smrg 41273da084b3Smrg if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then 41283da084b3Smrg eval libobjs=\"\$libobjs $whole_archive_flag_spec\" 41293da084b3Smrg fi 41303da084b3Smrg # Expand the library linking commands again to reset the 41313da084b3Smrg # value of $libobjs for piecewise linking. 41323da084b3Smrg 41333da084b3Smrg # Do each of the archive commands. 41343da084b3Smrg if test "$module" = yes && test -n "$module_cmds" ; then 41353da084b3Smrg if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then 41363da084b3Smrg cmds=$module_expsym_cmds 41373da084b3Smrg else 41383da084b3Smrg cmds=$module_cmds 41393da084b3Smrg fi 41403da084b3Smrg else 41413da084b3Smrg if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then 41423da084b3Smrg cmds=$archive_expsym_cmds 41433da084b3Smrg else 41443da084b3Smrg cmds=$archive_cmds 41453da084b3Smrg fi 41463da084b3Smrg fi 41473da084b3Smrg 41483da084b3Smrg # Append the command to remove the reloadable object files 41493da084b3Smrg # to the just-reset $cmds. 41503da084b3Smrg eval cmds=\"\$cmds~\$rm $delfiles\" 41513da084b3Smrg fi 41523da084b3Smrg save_ifs="$IFS"; IFS='~' 41533da084b3Smrg for cmd in $cmds; do 41543da084b3Smrg IFS="$save_ifs" 41553da084b3Smrg eval cmd=\"$cmd\" 41563da084b3Smrg $show "$cmd" 41573da084b3Smrg $run eval "$cmd" || { 41583da084b3Smrg lt_exit=$? 41593da084b3Smrg 41603da084b3Smrg # Restore the uninstalled library and exit 41613da084b3Smrg if test "$mode" = relink; then 41623da084b3Smrg $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' 41633da084b3Smrg fi 41643da084b3Smrg 41653da084b3Smrg exit $lt_exit 41663da084b3Smrg } 41673da084b3Smrg done 41683da084b3Smrg IFS="$save_ifs" 41693da084b3Smrg 41703da084b3Smrg # Restore the uninstalled library and exit 41713da084b3Smrg if test "$mode" = relink; then 41723da084b3Smrg $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? 41733da084b3Smrg 41743da084b3Smrg if test -n "$convenience"; then 41753da084b3Smrg if test -z "$whole_archive_flag_spec"; then 41763da084b3Smrg $show "${rm}r $gentop" 41773da084b3Smrg $run ${rm}r "$gentop" 41783da084b3Smrg fi 41793da084b3Smrg fi 41803da084b3Smrg 41813da084b3Smrg exit $EXIT_SUCCESS 41823da084b3Smrg fi 41833da084b3Smrg 41843da084b3Smrg # Create links to the real library. 41853da084b3Smrg for linkname in $linknames; do 41863da084b3Smrg if test "$realname" != "$linkname"; then 41873da084b3Smrg $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" 41883da084b3Smrg $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? 41893da084b3Smrg fi 41903da084b3Smrg done 41913da084b3Smrg 41923da084b3Smrg # If -module or -export-dynamic was specified, set the dlname. 41933da084b3Smrg if test "$module" = yes || test "$export_dynamic" = yes; then 41943da084b3Smrg # On all known operating systems, these are identical. 41953da084b3Smrg dlname="$soname" 41963da084b3Smrg fi 41973da084b3Smrg fi 41983da084b3Smrg ;; 41993da084b3Smrg 42003da084b3Smrg obj) 42013da084b3Smrg if test -n "$deplibs"; then 42023da084b3Smrg $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 42033da084b3Smrg fi 42043da084b3Smrg 42053da084b3Smrg if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then 42063da084b3Smrg $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 42073da084b3Smrg fi 42083da084b3Smrg 42093da084b3Smrg if test -n "$rpath"; then 42103da084b3Smrg $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 42113da084b3Smrg fi 42123da084b3Smrg 42133da084b3Smrg if test -n "$xrpath"; then 42143da084b3Smrg $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 42153da084b3Smrg fi 42163da084b3Smrg 42173da084b3Smrg if test -n "$vinfo"; then 42183da084b3Smrg $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 42193da084b3Smrg fi 42203da084b3Smrg 42213da084b3Smrg if test -n "$release"; then 42223da084b3Smrg $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 42233da084b3Smrg fi 42243da084b3Smrg 42253da084b3Smrg case $output in 42263da084b3Smrg *.lo) 42273da084b3Smrg if test -n "$objs$old_deplibs"; then 42283da084b3Smrg $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 42293da084b3Smrg exit $EXIT_FAILURE 42303da084b3Smrg fi 42313da084b3Smrg libobj="$output" 42323da084b3Smrg obj=`$echo "X$output" | $Xsed -e "$lo2o"` 42333da084b3Smrg ;; 42343da084b3Smrg *) 42353da084b3Smrg libobj= 42363da084b3Smrg obj="$output" 42373da084b3Smrg ;; 42383da084b3Smrg esac 42393da084b3Smrg 42403da084b3Smrg # Delete the old objects. 42413da084b3Smrg $run $rm $obj $libobj 42423da084b3Smrg 42433da084b3Smrg # Objects from convenience libraries. This assumes 42443da084b3Smrg # single-version convenience libraries. Whenever we create 42453da084b3Smrg # different ones for PIC/non-PIC, this we'll have to duplicate 42463da084b3Smrg # the extraction. 42473da084b3Smrg reload_conv_objs= 42483da084b3Smrg gentop= 42493da084b3Smrg # reload_cmds runs $LD directly, so let us get rid of 42503da084b3Smrg # -Wl from whole_archive_flag_spec 42513da084b3Smrg wl= 42523da084b3Smrg 42533da084b3Smrg if test -n "$convenience"; then 42543da084b3Smrg if test -n "$whole_archive_flag_spec"; then 42553da084b3Smrg eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" 42563da084b3Smrg else 42573da084b3Smrg gentop="$output_objdir/${obj}x" 42583da084b3Smrg generated="$generated $gentop" 42593da084b3Smrg 42603da084b3Smrg func_extract_archives $gentop $convenience 42613da084b3Smrg reload_conv_objs="$reload_objs $func_extract_archives_result" 42623da084b3Smrg fi 42633da084b3Smrg fi 42643da084b3Smrg 42653da084b3Smrg # Create the old-style object. 42663da084b3Smrg reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test 42673da084b3Smrg 42683da084b3Smrg output="$obj" 42693da084b3Smrg cmds=$reload_cmds 42703da084b3Smrg save_ifs="$IFS"; IFS='~' 42713da084b3Smrg for cmd in $cmds; do 42723da084b3Smrg IFS="$save_ifs" 42733da084b3Smrg eval cmd=\"$cmd\" 42743da084b3Smrg $show "$cmd" 42753da084b3Smrg $run eval "$cmd" || exit $? 42763da084b3Smrg done 42773da084b3Smrg IFS="$save_ifs" 42783da084b3Smrg 42793da084b3Smrg # Exit if we aren't doing a library object file. 42803da084b3Smrg if test -z "$libobj"; then 42813da084b3Smrg if test -n "$gentop"; then 42823da084b3Smrg $show "${rm}r $gentop" 42833da084b3Smrg $run ${rm}r $gentop 42843da084b3Smrg fi 42853da084b3Smrg 42863da084b3Smrg exit $EXIT_SUCCESS 42873da084b3Smrg fi 42883da084b3Smrg 42893da084b3Smrg if test "$build_libtool_libs" != yes; then 42903da084b3Smrg if test -n "$gentop"; then 42913da084b3Smrg $show "${rm}r $gentop" 42923da084b3Smrg $run ${rm}r $gentop 42933da084b3Smrg fi 42943da084b3Smrg 42953da084b3Smrg # Create an invalid libtool object if no PIC, so that we don't 42963da084b3Smrg # accidentally link it into a program. 42973da084b3Smrg # $show "echo timestamp > $libobj" 42983da084b3Smrg # $run eval "echo timestamp > $libobj" || exit $? 42993da084b3Smrg exit $EXIT_SUCCESS 43003da084b3Smrg fi 43013da084b3Smrg 43023da084b3Smrg if test -n "$pic_flag" || test "$pic_mode" != default; then 43033da084b3Smrg # Only do commands if we really have different PIC objects. 43043da084b3Smrg reload_objs="$libobjs $reload_conv_objs" 43053da084b3Smrg output="$libobj" 43063da084b3Smrg cmds=$reload_cmds 43073da084b3Smrg save_ifs="$IFS"; IFS='~' 43083da084b3Smrg for cmd in $cmds; do 43093da084b3Smrg IFS="$save_ifs" 43103da084b3Smrg eval cmd=\"$cmd\" 43113da084b3Smrg $show "$cmd" 43123da084b3Smrg $run eval "$cmd" || exit $? 43133da084b3Smrg done 43143da084b3Smrg IFS="$save_ifs" 43153da084b3Smrg fi 43163da084b3Smrg 43173da084b3Smrg if test -n "$gentop"; then 43183da084b3Smrg $show "${rm}r $gentop" 43193da084b3Smrg $run ${rm}r $gentop 43203da084b3Smrg fi 43213da084b3Smrg 43223da084b3Smrg exit $EXIT_SUCCESS 43233da084b3Smrg ;; 43243da084b3Smrg 43253da084b3Smrg prog) 43263da084b3Smrg case $host in 43273da084b3Smrg *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; 43283da084b3Smrg esac 43293da084b3Smrg if test -n "$vinfo"; then 43303da084b3Smrg $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 43313da084b3Smrg fi 43323da084b3Smrg 43333da084b3Smrg if test -n "$release"; then 43343da084b3Smrg $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 43353da084b3Smrg fi 43363da084b3Smrg 43373da084b3Smrg if test "$preload" = yes; then 43383da084b3Smrg if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && 43393da084b3Smrg test "$dlopen_self_static" = unknown; then 43403da084b3Smrg $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." 43413da084b3Smrg fi 43423da084b3Smrg fi 43433da084b3Smrg 43443da084b3Smrg case $host in 43453da084b3Smrg *-*-rhapsody* | *-*-darwin1.[012]) 43463da084b3Smrg # On Rhapsody replace the C library is the System framework 43473da084b3Smrg compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` 43483da084b3Smrg finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` 43493da084b3Smrg ;; 43503da084b3Smrg esac 43513da084b3Smrg 43523da084b3Smrg case $host in 43533da084b3Smrg *darwin*) 43543da084b3Smrg # Don't allow lazy linking, it breaks C++ global constructors 43553da084b3Smrg if test "$tagname" = CXX ; then 43563da084b3Smrg compile_command="$compile_command ${wl}-bind_at_load" 43573da084b3Smrg finalize_command="$finalize_command ${wl}-bind_at_load" 43583da084b3Smrg fi 43593da084b3Smrg ;; 43603da084b3Smrg esac 43613da084b3Smrg 43623da084b3Smrg 43633da084b3Smrg # move library search paths that coincide with paths to not yet 43643da084b3Smrg # installed libraries to the beginning of the library search list 43653da084b3Smrg new_libs= 43663da084b3Smrg for path in $notinst_path; do 43673da084b3Smrg case " $new_libs " in 43683da084b3Smrg *" -L$path/$objdir "*) ;; 43693da084b3Smrg *) 43703da084b3Smrg case " $compile_deplibs " in 43713da084b3Smrg *" -L$path/$objdir "*) 43723da084b3Smrg new_libs="$new_libs -L$path/$objdir" ;; 43733da084b3Smrg esac 43743da084b3Smrg ;; 43753da084b3Smrg esac 43763da084b3Smrg done 43773da084b3Smrg for deplib in $compile_deplibs; do 43783da084b3Smrg case $deplib in 43793da084b3Smrg -L*) 43803da084b3Smrg case " $new_libs " in 43813da084b3Smrg *" $deplib "*) ;; 43823da084b3Smrg *) new_libs="$new_libs $deplib" ;; 43833da084b3Smrg esac 43843da084b3Smrg ;; 43853da084b3Smrg *) new_libs="$new_libs $deplib" ;; 43863da084b3Smrg esac 43873da084b3Smrg done 43883da084b3Smrg compile_deplibs="$new_libs" 43893da084b3Smrg 43903da084b3Smrg 43913da084b3Smrg compile_command="$compile_command $compile_deplibs" 43923da084b3Smrg finalize_command="$finalize_command $finalize_deplibs" 43933da084b3Smrg 43943da084b3Smrg if test -n "$rpath$xrpath"; then 43953da084b3Smrg # If the user specified any rpath flags, then add them. 43963da084b3Smrg for libdir in $rpath $xrpath; do 43973da084b3Smrg # This is the magic to use -rpath. 43983da084b3Smrg case "$finalize_rpath " in 43993da084b3Smrg *" $libdir "*) ;; 44003da084b3Smrg *) finalize_rpath="$finalize_rpath $libdir" ;; 44013da084b3Smrg esac 44023da084b3Smrg done 44033da084b3Smrg fi 44043da084b3Smrg 44053da084b3Smrg # Now hardcode the library paths 44063da084b3Smrg rpath= 44073da084b3Smrg hardcode_libdirs= 44083da084b3Smrg for libdir in $compile_rpath $finalize_rpath; do 44093da084b3Smrg if test -n "$hardcode_libdir_flag_spec"; then 44103da084b3Smrg if test -n "$hardcode_libdir_separator"; then 44113da084b3Smrg if test -z "$hardcode_libdirs"; then 44123da084b3Smrg hardcode_libdirs="$libdir" 44133da084b3Smrg else 44143da084b3Smrg # Just accumulate the unique libdirs. 44153da084b3Smrg case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in 44163da084b3Smrg *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) 44173da084b3Smrg ;; 44183da084b3Smrg *) 44193da084b3Smrg hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" 44203da084b3Smrg ;; 44213da084b3Smrg esac 44223da084b3Smrg fi 44233da084b3Smrg else 44243da084b3Smrg eval flag=\"$hardcode_libdir_flag_spec\" 44253da084b3Smrg rpath="$rpath $flag" 44263da084b3Smrg fi 44273da084b3Smrg elif test -n "$runpath_var"; then 44283da084b3Smrg case "$perm_rpath " in 44293da084b3Smrg *" $libdir "*) ;; 44303da084b3Smrg *) perm_rpath="$perm_rpath $libdir" ;; 44313da084b3Smrg esac 44323da084b3Smrg fi 44333da084b3Smrg case $host in 44343da084b3Smrg *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) 44353da084b3Smrg testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` 44363da084b3Smrg case :$dllsearchpath: in 44373da084b3Smrg *":$libdir:"*) ;; 44383da084b3Smrg *) dllsearchpath="$dllsearchpath:$libdir";; 44393da084b3Smrg esac 44403da084b3Smrg case :$dllsearchpath: in 44413da084b3Smrg *":$testbindir:"*) ;; 44423da084b3Smrg *) dllsearchpath="$dllsearchpath:$testbindir";; 44433da084b3Smrg esac 44443da084b3Smrg ;; 44453da084b3Smrg esac 44463da084b3Smrg done 44473da084b3Smrg # Substitute the hardcoded libdirs into the rpath. 44483da084b3Smrg if test -n "$hardcode_libdir_separator" && 44493da084b3Smrg test -n "$hardcode_libdirs"; then 44503da084b3Smrg libdir="$hardcode_libdirs" 44513da084b3Smrg eval rpath=\" $hardcode_libdir_flag_spec\" 44523da084b3Smrg fi 44533da084b3Smrg compile_rpath="$rpath" 44543da084b3Smrg 44553da084b3Smrg rpath= 44563da084b3Smrg hardcode_libdirs= 44573da084b3Smrg for libdir in $finalize_rpath; do 44583da084b3Smrg if test -n "$hardcode_libdir_flag_spec"; then 44593da084b3Smrg if test -n "$hardcode_libdir_separator"; then 44603da084b3Smrg if test -z "$hardcode_libdirs"; then 44613da084b3Smrg hardcode_libdirs="$libdir" 44623da084b3Smrg else 44633da084b3Smrg # Just accumulate the unique libdirs. 44643da084b3Smrg case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in 44653da084b3Smrg *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) 44663da084b3Smrg ;; 44673da084b3Smrg *) 44683da084b3Smrg hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" 44693da084b3Smrg ;; 44703da084b3Smrg esac 44713da084b3Smrg fi 44723da084b3Smrg else 44733da084b3Smrg eval flag=\"$hardcode_libdir_flag_spec\" 44743da084b3Smrg rpath="$rpath $flag" 44753da084b3Smrg fi 44763da084b3Smrg elif test -n "$runpath_var"; then 44773da084b3Smrg case "$finalize_perm_rpath " in 44783da084b3Smrg *" $libdir "*) ;; 44793da084b3Smrg *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; 44803da084b3Smrg esac 44813da084b3Smrg fi 44823da084b3Smrg done 44833da084b3Smrg # Substitute the hardcoded libdirs into the rpath. 44843da084b3Smrg if test -n "$hardcode_libdir_separator" && 44853da084b3Smrg test -n "$hardcode_libdirs"; then 44863da084b3Smrg libdir="$hardcode_libdirs" 44873da084b3Smrg eval rpath=\" $hardcode_libdir_flag_spec\" 44883da084b3Smrg fi 44893da084b3Smrg finalize_rpath="$rpath" 44903da084b3Smrg 44913da084b3Smrg if test -n "$libobjs" && test "$build_old_libs" = yes; then 44923da084b3Smrg # Transform all the library objects into standard objects. 44933da084b3Smrg compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` 44943da084b3Smrg finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` 44953da084b3Smrg fi 44963da084b3Smrg 44973da084b3Smrg dlsyms= 44983da084b3Smrg if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then 44993da084b3Smrg if test -n "$NM" && test -n "$global_symbol_pipe"; then 45003da084b3Smrg dlsyms="${outputname}S.c" 45013da084b3Smrg else 45023da084b3Smrg $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 45033da084b3Smrg fi 45043da084b3Smrg fi 45053da084b3Smrg 45063da084b3Smrg if test -n "$dlsyms"; then 45073da084b3Smrg case $dlsyms in 45083da084b3Smrg "") ;; 45093da084b3Smrg *.c) 45103da084b3Smrg # Discover the nlist of each of the dlfiles. 45113da084b3Smrg nlist="$output_objdir/${outputname}.nm" 45123da084b3Smrg 45133da084b3Smrg $show "$rm $nlist ${nlist}S ${nlist}T" 45143da084b3Smrg $run $rm "$nlist" "${nlist}S" "${nlist}T" 45153da084b3Smrg 45163da084b3Smrg # Parse the name list into a source file. 45173da084b3Smrg $show "creating $output_objdir/$dlsyms" 45183da084b3Smrg 45193da084b3Smrg test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ 45203da084b3Smrg/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ 45213da084b3Smrg/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ 45223da084b3Smrg 45233da084b3Smrg#ifdef __cplusplus 45243da084b3Smrgextern \"C\" { 45253da084b3Smrg#endif 45263da084b3Smrg 45273da084b3Smrg/* Prevent the only kind of declaration conflicts we can make. */ 45283da084b3Smrg#define lt_preloaded_symbols some_other_symbol 45293da084b3Smrg 45303da084b3Smrg/* External symbol declarations for the compiler. */\ 45313da084b3Smrg" 45323da084b3Smrg 45333da084b3Smrg if test "$dlself" = yes; then 45343da084b3Smrg $show "generating symbol list for \`$output'" 45353da084b3Smrg 45363da084b3Smrg test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" 45373da084b3Smrg 45383da084b3Smrg # Add our own program objects to the symbol list. 45393da084b3Smrg progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` 45403da084b3Smrg for arg in $progfiles; do 45413da084b3Smrg $show "extracting global C symbols from \`$arg'" 45423da084b3Smrg $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" 45433da084b3Smrg done 45443da084b3Smrg 45453da084b3Smrg if test -n "$exclude_expsyms"; then 45463da084b3Smrg $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' 45473da084b3Smrg $run eval '$mv "$nlist"T "$nlist"' 45483da084b3Smrg fi 45493da084b3Smrg 45503da084b3Smrg if test -n "$export_symbols_regex"; then 45513da084b3Smrg $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' 45523da084b3Smrg $run eval '$mv "$nlist"T "$nlist"' 45533da084b3Smrg fi 45543da084b3Smrg 45553da084b3Smrg # Prepare the list of exported symbols 45563da084b3Smrg if test -z "$export_symbols"; then 45573da084b3Smrg export_symbols="$output_objdir/$outputname.exp" 45583da084b3Smrg $run $rm $export_symbols 45593da084b3Smrg $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' 45603da084b3Smrg case $host in 45613da084b3Smrg *cygwin* | *mingw* ) 45623da084b3Smrg $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' 45633da084b3Smrg $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' 45643da084b3Smrg ;; 45653da084b3Smrg esac 45663da084b3Smrg else 45673da084b3Smrg $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' 45683da084b3Smrg $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' 45693da084b3Smrg $run eval 'mv "$nlist"T "$nlist"' 45703da084b3Smrg case $host in 45713da084b3Smrg *cygwin* | *mingw* ) 45723da084b3Smrg $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' 45733da084b3Smrg $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' 45743da084b3Smrg ;; 45753da084b3Smrg esac 45763da084b3Smrg fi 45773da084b3Smrg fi 45783da084b3Smrg 45793da084b3Smrg for arg in $dlprefiles; do 45803da084b3Smrg $show "extracting global C symbols from \`$arg'" 45813da084b3Smrg name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` 45823da084b3Smrg $run eval '$echo ": $name " >> "$nlist"' 45833da084b3Smrg $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" 45843da084b3Smrg done 45853da084b3Smrg 45863da084b3Smrg if test -z "$run"; then 45873da084b3Smrg # Make sure we have at least an empty file. 45883da084b3Smrg test -f "$nlist" || : > "$nlist" 45893da084b3Smrg 45903da084b3Smrg if test -n "$exclude_expsyms"; then 45913da084b3Smrg $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T 45923da084b3Smrg $mv "$nlist"T "$nlist" 45933da084b3Smrg fi 45943da084b3Smrg 45953da084b3Smrg # Try sorting and uniquifying the output. 45963da084b3Smrg if grep -v "^: " < "$nlist" | 45973da084b3Smrg if sort -k 3 </dev/null >/dev/null 2>&1; then 45983da084b3Smrg sort -k 3 45993da084b3Smrg else 46003da084b3Smrg sort +2 46013da084b3Smrg fi | 46023da084b3Smrg uniq > "$nlist"S; then 46033da084b3Smrg : 46043da084b3Smrg else 46053da084b3Smrg grep -v "^: " < "$nlist" > "$nlist"S 46063da084b3Smrg fi 46073da084b3Smrg 46083da084b3Smrg if test -f "$nlist"S; then 46093da084b3Smrg eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' 46103da084b3Smrg else 46113da084b3Smrg $echo '/* NONE */' >> "$output_objdir/$dlsyms" 46123da084b3Smrg fi 46133da084b3Smrg 46143da084b3Smrg $echo >> "$output_objdir/$dlsyms" "\ 46153da084b3Smrg 46163da084b3Smrg#undef lt_preloaded_symbols 46173da084b3Smrg 46183da084b3Smrg#if defined (__STDC__) && __STDC__ 46193da084b3Smrg# define lt_ptr void * 46203da084b3Smrg#else 46213da084b3Smrg# define lt_ptr char * 46223da084b3Smrg# define const 46233da084b3Smrg#endif 46243da084b3Smrg 46253da084b3Smrg/* The mapping between symbol names and symbols. */ 46263da084b3Smrg" 46273da084b3Smrg 46283da084b3Smrg case $host in 46293da084b3Smrg *cygwin* | *mingw* ) 46303da084b3Smrg $echo >> "$output_objdir/$dlsyms" "\ 46313da084b3Smrg/* DATA imports from DLLs on WIN32 can't be const, because 46323da084b3Smrg runtime relocations are performed -- see ld's documentation 46333da084b3Smrg on pseudo-relocs */ 46343da084b3Smrgstruct { 46353da084b3Smrg" 46363da084b3Smrg ;; 46373da084b3Smrg * ) 46383da084b3Smrg $echo >> "$output_objdir/$dlsyms" "\ 46393da084b3Smrgconst struct { 46403da084b3Smrg" 46413da084b3Smrg ;; 46423da084b3Smrg esac 46433da084b3Smrg 46443da084b3Smrg 46453da084b3Smrg $echo >> "$output_objdir/$dlsyms" "\ 46463da084b3Smrg const char *name; 46473da084b3Smrg lt_ptr address; 46483da084b3Smrg} 46493da084b3Smrglt_preloaded_symbols[] = 46503da084b3Smrg{\ 46513da084b3Smrg" 46523da084b3Smrg 46533da084b3Smrg eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" 46543da084b3Smrg 46553da084b3Smrg $echo >> "$output_objdir/$dlsyms" "\ 46563da084b3Smrg {0, (lt_ptr) 0} 46573da084b3Smrg}; 46583da084b3Smrg 46593da084b3Smrg/* This works around a problem in FreeBSD linker */ 46603da084b3Smrg#ifdef FREEBSD_WORKAROUND 46613da084b3Smrgstatic const void *lt_preloaded_setup() { 46623da084b3Smrg return lt_preloaded_symbols; 46633da084b3Smrg} 46643da084b3Smrg#endif 46653da084b3Smrg 46663da084b3Smrg#ifdef __cplusplus 46673da084b3Smrg} 46683da084b3Smrg#endif\ 46693da084b3Smrg" 46703da084b3Smrg fi 46713da084b3Smrg 46723da084b3Smrg pic_flag_for_symtable= 46733da084b3Smrg case $host in 46743da084b3Smrg # compiling the symbol table file with pic_flag works around 46753da084b3Smrg # a FreeBSD bug that causes programs to crash when -lm is 46763da084b3Smrg # linked before any other PIC object. But we must not use 46773da084b3Smrg # pic_flag when linking with -static. The problem exists in 46783da084b3Smrg # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. 46793da084b3Smrg *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) 46803da084b3Smrg case "$compile_command " in 46813da084b3Smrg *" -static "*) ;; 46823da084b3Smrg *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; 46833da084b3Smrg esac;; 46843da084b3Smrg *-*-hpux*) 46853da084b3Smrg case "$compile_command " in 46863da084b3Smrg *" -static "*) ;; 46873da084b3Smrg *) pic_flag_for_symtable=" $pic_flag";; 46883da084b3Smrg esac 46893da084b3Smrg esac 46903da084b3Smrg 46913da084b3Smrg # Now compile the dynamic symbol file. 46923da084b3Smrg $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" 46933da084b3Smrg $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? 46943da084b3Smrg 46953da084b3Smrg # Clean up the generated files. 46963da084b3Smrg $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" 46973da084b3Smrg $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" 46983da084b3Smrg 46993da084b3Smrg # Transform the symbol file into the correct name. 47003da084b3Smrg case $host in 47013da084b3Smrg *cygwin* | *mingw* ) 47023da084b3Smrg if test -f "$output_objdir/${outputname}.def" ; then 47033da084b3Smrg compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` 47043da084b3Smrg finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` 47053da084b3Smrg else 47063da084b3Smrg compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` 47073da084b3Smrg finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` 47083da084b3Smrg fi 47093da084b3Smrg ;; 47103da084b3Smrg * ) 47113da084b3Smrg compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` 47123da084b3Smrg finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` 47133da084b3Smrg ;; 47143da084b3Smrg esac 47153da084b3Smrg ;; 47163da084b3Smrg *) 47173da084b3Smrg $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 47183da084b3Smrg exit $EXIT_FAILURE 47193da084b3Smrg ;; 47203da084b3Smrg esac 47213da084b3Smrg else 47223da084b3Smrg # We keep going just in case the user didn't refer to 47233da084b3Smrg # lt_preloaded_symbols. The linker will fail if global_symbol_pipe 47243da084b3Smrg # really was required. 47253da084b3Smrg 47263da084b3Smrg # Nullify the symbol file. 47273da084b3Smrg compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` 47283da084b3Smrg finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` 47293da084b3Smrg fi 47303da084b3Smrg 47313da084b3Smrg if test "$need_relink" = no || test "$build_libtool_libs" != yes; then 47323da084b3Smrg # Replace the output file specification. 47333da084b3Smrg compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` 47343da084b3Smrg link_command="$compile_command$compile_rpath" 47353da084b3Smrg 47363da084b3Smrg # We have no uninstalled library dependencies, so finalize right now. 47373da084b3Smrg $show "$link_command" 47383da084b3Smrg $run eval "$link_command" 47393da084b3Smrg exit_status=$? 47403da084b3Smrg 47413da084b3Smrg # Delete the generated files. 47423da084b3Smrg if test -n "$dlsyms"; then 47433da084b3Smrg $show "$rm $output_objdir/${outputname}S.${objext}" 47443da084b3Smrg $run $rm "$output_objdir/${outputname}S.${objext}" 47453da084b3Smrg fi 47463da084b3Smrg 47473da084b3Smrg exit $exit_status 47483da084b3Smrg fi 47493da084b3Smrg 47503da084b3Smrg if test -n "$shlibpath_var"; then 47513da084b3Smrg # We should set the shlibpath_var 47523da084b3Smrg rpath= 47533da084b3Smrg for dir in $temp_rpath; do 47543da084b3Smrg case $dir in 47553da084b3Smrg [\\/]* | [A-Za-z]:[\\/]*) 47563da084b3Smrg # Absolute path. 47573da084b3Smrg rpath="$rpath$dir:" 47583da084b3Smrg ;; 47593da084b3Smrg *) 47603da084b3Smrg # Relative path: add a thisdir entry. 47613da084b3Smrg rpath="$rpath\$thisdir/$dir:" 47623da084b3Smrg ;; 47633da084b3Smrg esac 47643da084b3Smrg done 47653da084b3Smrg temp_rpath="$rpath" 47663da084b3Smrg fi 47673da084b3Smrg 47683da084b3Smrg if test -n "$compile_shlibpath$finalize_shlibpath"; then 47693da084b3Smrg compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" 47703da084b3Smrg fi 47713da084b3Smrg if test -n "$finalize_shlibpath"; then 47723da084b3Smrg finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" 47733da084b3Smrg fi 47743da084b3Smrg 47753da084b3Smrg compile_var= 47763da084b3Smrg finalize_var= 47773da084b3Smrg if test -n "$runpath_var"; then 47783da084b3Smrg if test -n "$perm_rpath"; then 47793da084b3Smrg # We should set the runpath_var. 47803da084b3Smrg rpath= 47813da084b3Smrg for dir in $perm_rpath; do 47823da084b3Smrg rpath="$rpath$dir:" 47833da084b3Smrg done 47843da084b3Smrg compile_var="$runpath_var=\"$rpath\$$runpath_var\" " 47853da084b3Smrg fi 47863da084b3Smrg if test -n "$finalize_perm_rpath"; then 47873da084b3Smrg # We should set the runpath_var. 47883da084b3Smrg rpath= 47893da084b3Smrg for dir in $finalize_perm_rpath; do 47903da084b3Smrg rpath="$rpath$dir:" 47913da084b3Smrg done 47923da084b3Smrg finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " 47933da084b3Smrg fi 47943da084b3Smrg fi 47953da084b3Smrg 47963da084b3Smrg if test "$no_install" = yes; then 47973da084b3Smrg # We don't need to create a wrapper script. 47983da084b3Smrg link_command="$compile_var$compile_command$compile_rpath" 47993da084b3Smrg # Replace the output file specification. 48003da084b3Smrg link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` 48013da084b3Smrg # Delete the old output file. 48023da084b3Smrg $run $rm $output 48033da084b3Smrg # Link the executable and exit 48043da084b3Smrg $show "$link_command" 48053da084b3Smrg $run eval "$link_command" || exit $? 48063da084b3Smrg exit $EXIT_SUCCESS 48073da084b3Smrg fi 48083da084b3Smrg 48093da084b3Smrg if test "$hardcode_action" = relink; then 48103da084b3Smrg # Fast installation is not supported 48113da084b3Smrg link_command="$compile_var$compile_command$compile_rpath" 48123da084b3Smrg relink_command="$finalize_var$finalize_command$finalize_rpath" 48133da084b3Smrg 48143da084b3Smrg $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 48153da084b3Smrg $echo "$modename: \`$output' will be relinked during installation" 1>&2 48163da084b3Smrg else 48173da084b3Smrg if test "$fast_install" != no; then 48183da084b3Smrg link_command="$finalize_var$compile_command$finalize_rpath" 48193da084b3Smrg if test "$fast_install" = yes; then 48203da084b3Smrg relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` 48213da084b3Smrg else 48223da084b3Smrg # fast_install is set to needless 48233da084b3Smrg relink_command= 48243da084b3Smrg fi 48253da084b3Smrg else 48263da084b3Smrg link_command="$compile_var$compile_command$compile_rpath" 48273da084b3Smrg relink_command="$finalize_var$finalize_command$finalize_rpath" 48283da084b3Smrg fi 48293da084b3Smrg fi 48303da084b3Smrg 48313da084b3Smrg # Replace the output file specification. 48323da084b3Smrg link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` 48333da084b3Smrg 48343da084b3Smrg # Delete the old output files. 48353da084b3Smrg $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname 48363da084b3Smrg 48373da084b3Smrg $show "$link_command" 48383da084b3Smrg $run eval "$link_command" || exit $? 48393da084b3Smrg 48403da084b3Smrg # Now create the wrapper script. 48413da084b3Smrg $show "creating $output" 48423da084b3Smrg 48433da084b3Smrg # Quote the relink command for shipping. 48443da084b3Smrg if test -n "$relink_command"; then 48453da084b3Smrg # Preserve any variables that may affect compiler behavior 48463da084b3Smrg for var in $variables_saved_for_relink; do 48473da084b3Smrg if eval test -z \"\${$var+set}\"; then 48483da084b3Smrg relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" 48493da084b3Smrg elif eval var_value=\$$var; test -z "$var_value"; then 48503da084b3Smrg relink_command="$var=; export $var; $relink_command" 48513da084b3Smrg else 48523da084b3Smrg var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` 48533da084b3Smrg relink_command="$var=\"$var_value\"; export $var; $relink_command" 48543da084b3Smrg fi 48553da084b3Smrg done 48563da084b3Smrg relink_command="(cd `pwd`; $relink_command)" 48573da084b3Smrg relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` 48583da084b3Smrg fi 48593da084b3Smrg 48603da084b3Smrg # Quote $echo for shipping. 48613da084b3Smrg if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then 48623da084b3Smrg case $progpath in 48633da084b3Smrg [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; 48643da084b3Smrg *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; 48653da084b3Smrg esac 48663da084b3Smrg qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` 48673da084b3Smrg else 48683da084b3Smrg qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` 48693da084b3Smrg fi 48703da084b3Smrg 48713da084b3Smrg # Only actually do things if our run command is non-null. 48723da084b3Smrg if test -z "$run"; then 48733da084b3Smrg # win32 will think the script is a binary if it has 48743da084b3Smrg # a .exe suffix, so we strip it off here. 48753da084b3Smrg case $output in 48763da084b3Smrg *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; 48773da084b3Smrg esac 48783da084b3Smrg # test for cygwin because mv fails w/o .exe extensions 48793da084b3Smrg case $host in 48803da084b3Smrg *cygwin*) 48813da084b3Smrg exeext=.exe 48823da084b3Smrg outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; 48833da084b3Smrg *) exeext= ;; 48843da084b3Smrg esac 48853da084b3Smrg case $host in 48863da084b3Smrg *cygwin* | *mingw* ) 48873da084b3Smrg output_name=`basename $output` 48883da084b3Smrg output_path=`dirname $output` 48893da084b3Smrg cwrappersource="$output_path/$objdir/lt-$output_name.c" 48903da084b3Smrg cwrapper="$output_path/$output_name.exe" 48913da084b3Smrg $rm $cwrappersource $cwrapper 48923da084b3Smrg trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 48933da084b3Smrg 48943da084b3Smrg cat > $cwrappersource <<EOF 48953da084b3Smrg 48963da084b3Smrg/* $cwrappersource - temporary wrapper executable for $objdir/$outputname 48973da084b3Smrg Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP 48983da084b3Smrg 48993da084b3Smrg The $output program cannot be directly executed until all the libtool 49003da084b3Smrg libraries that it depends on are installed. 49013da084b3Smrg 49023da084b3Smrg This wrapper executable should never be moved out of the build directory. 49033da084b3Smrg If it is, it will not operate correctly. 49043da084b3Smrg 49053da084b3Smrg Currently, it simply execs the wrapper *script* "/bin/sh $output", 49063da084b3Smrg but could eventually absorb all of the scripts functionality and 49073da084b3Smrg exec $objdir/$outputname directly. 49083da084b3Smrg*/ 49093da084b3SmrgEOF 49103da084b3Smrg cat >> $cwrappersource<<"EOF" 49113da084b3Smrg#include <stdio.h> 49123da084b3Smrg#include <stdlib.h> 49133da084b3Smrg#include <unistd.h> 49143da084b3Smrg#include <malloc.h> 49153da084b3Smrg#include <stdarg.h> 49163da084b3Smrg#include <assert.h> 49173da084b3Smrg#include <string.h> 49183da084b3Smrg#include <ctype.h> 49193da084b3Smrg#include <sys/stat.h> 49203da084b3Smrg 49213da084b3Smrg#if defined(PATH_MAX) 49223da084b3Smrg# define LT_PATHMAX PATH_MAX 49233da084b3Smrg#elif defined(MAXPATHLEN) 49243da084b3Smrg# define LT_PATHMAX MAXPATHLEN 49253da084b3Smrg#else 49263da084b3Smrg# define LT_PATHMAX 1024 49273da084b3Smrg#endif 49283da084b3Smrg 49293da084b3Smrg#ifndef DIR_SEPARATOR 49303da084b3Smrg# define DIR_SEPARATOR '/' 49313da084b3Smrg# define PATH_SEPARATOR ':' 49323da084b3Smrg#endif 49333da084b3Smrg 49343da084b3Smrg#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ 49353da084b3Smrg defined (__OS2__) 49363da084b3Smrg# define HAVE_DOS_BASED_FILE_SYSTEM 49373da084b3Smrg# ifndef DIR_SEPARATOR_2 49383da084b3Smrg# define DIR_SEPARATOR_2 '\\' 49393da084b3Smrg# endif 49403da084b3Smrg# ifndef PATH_SEPARATOR_2 49413da084b3Smrg# define PATH_SEPARATOR_2 ';' 49423da084b3Smrg# endif 49433da084b3Smrg#endif 49443da084b3Smrg 49453da084b3Smrg#ifndef DIR_SEPARATOR_2 49463da084b3Smrg# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) 49473da084b3Smrg#else /* DIR_SEPARATOR_2 */ 49483da084b3Smrg# define IS_DIR_SEPARATOR(ch) \ 49493da084b3Smrg (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) 49503da084b3Smrg#endif /* DIR_SEPARATOR_2 */ 49513da084b3Smrg 49523da084b3Smrg#ifndef PATH_SEPARATOR_2 49533da084b3Smrg# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) 49543da084b3Smrg#else /* PATH_SEPARATOR_2 */ 49553da084b3Smrg# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) 49563da084b3Smrg#endif /* PATH_SEPARATOR_2 */ 49573da084b3Smrg 49583da084b3Smrg#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) 49593da084b3Smrg#define XFREE(stale) do { \ 49603da084b3Smrg if (stale) { free ((void *) stale); stale = 0; } \ 49613da084b3Smrg} while (0) 49623da084b3Smrg 49633da084b3Smrg/* -DDEBUG is fairly common in CFLAGS. */ 49643da084b3Smrg#undef DEBUG 49653da084b3Smrg#if defined DEBUGWRAPPER 49663da084b3Smrg# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) 49673da084b3Smrg#else 49683da084b3Smrg# define DEBUG(format, ...) 49693da084b3Smrg#endif 49703da084b3Smrg 49713da084b3Smrgconst char *program_name = NULL; 49723da084b3Smrg 49733da084b3Smrgvoid * xmalloc (size_t num); 49743da084b3Smrgchar * xstrdup (const char *string); 49753da084b3Smrgconst char * base_name (const char *name); 49763da084b3Smrgchar * find_executable(const char *wrapper); 49773da084b3Smrgint check_executable(const char *path); 49783da084b3Smrgchar * strendzap(char *str, const char *pat); 49793da084b3Smrgvoid lt_fatal (const char *message, ...); 49803da084b3Smrg 49813da084b3Smrgint 49823da084b3Smrgmain (int argc, char *argv[]) 49833da084b3Smrg{ 49843da084b3Smrg char **newargz; 49853da084b3Smrg int i; 49863da084b3Smrg 49873da084b3Smrg program_name = (char *) xstrdup (base_name (argv[0])); 49883da084b3Smrg DEBUG("(main) argv[0] : %s\n",argv[0]); 49893da084b3Smrg DEBUG("(main) program_name : %s\n",program_name); 49903da084b3Smrg newargz = XMALLOC(char *, argc+2); 49913da084b3SmrgEOF 49923da084b3Smrg 49933da084b3Smrg cat >> $cwrappersource <<EOF 49943da084b3Smrg newargz[0] = (char *) xstrdup("$SHELL"); 49953da084b3SmrgEOF 49963da084b3Smrg 49973da084b3Smrg cat >> $cwrappersource <<"EOF" 49983da084b3Smrg newargz[1] = find_executable(argv[0]); 49993da084b3Smrg if (newargz[1] == NULL) 50003da084b3Smrg lt_fatal("Couldn't find %s", argv[0]); 50013da084b3Smrg DEBUG("(main) found exe at : %s\n",newargz[1]); 50023da084b3Smrg /* we know the script has the same name, without the .exe */ 50033da084b3Smrg /* so make sure newargz[1] doesn't end in .exe */ 50043da084b3Smrg strendzap(newargz[1],".exe"); 50053da084b3Smrg for (i = 1; i < argc; i++) 50063da084b3Smrg newargz[i+1] = xstrdup(argv[i]); 50073da084b3Smrg newargz[argc+1] = NULL; 50083da084b3Smrg 50093da084b3Smrg for (i=0; i<argc+1; i++) 50103da084b3Smrg { 50113da084b3Smrg DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]); 50123da084b3Smrg ; 50133da084b3Smrg } 50143da084b3Smrg 50153da084b3SmrgEOF 50163da084b3Smrg 50173da084b3Smrg case $host_os in 50183da084b3Smrg mingw*) 50193da084b3Smrg cat >> $cwrappersource <<EOF 50203da084b3Smrg execv("$SHELL",(char const **)newargz); 50213da084b3SmrgEOF 50223da084b3Smrg ;; 50233da084b3Smrg *) 50243da084b3Smrg cat >> $cwrappersource <<EOF 50253da084b3Smrg execv("$SHELL",newargz); 50263da084b3SmrgEOF 50273da084b3Smrg ;; 50283da084b3Smrg esac 50293da084b3Smrg 50303da084b3Smrg cat >> $cwrappersource <<"EOF" 50313da084b3Smrg return 127; 50323da084b3Smrg} 50333da084b3Smrg 50343da084b3Smrgvoid * 50353da084b3Smrgxmalloc (size_t num) 50363da084b3Smrg{ 50373da084b3Smrg void * p = (void *) malloc (num); 50383da084b3Smrg if (!p) 50393da084b3Smrg lt_fatal ("Memory exhausted"); 50403da084b3Smrg 50413da084b3Smrg return p; 50423da084b3Smrg} 50433da084b3Smrg 50443da084b3Smrgchar * 50453da084b3Smrgxstrdup (const char *string) 50463da084b3Smrg{ 50473da084b3Smrg return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL 50483da084b3Smrg; 50493da084b3Smrg} 50503da084b3Smrg 50513da084b3Smrgconst char * 50523da084b3Smrgbase_name (const char *name) 50533da084b3Smrg{ 50543da084b3Smrg const char *base; 50553da084b3Smrg 50563da084b3Smrg#if defined (HAVE_DOS_BASED_FILE_SYSTEM) 50573da084b3Smrg /* Skip over the disk name in MSDOS pathnames. */ 50583da084b3Smrg if (isalpha ((unsigned char)name[0]) && name[1] == ':') 50593da084b3Smrg name += 2; 50603da084b3Smrg#endif 50613da084b3Smrg 50623da084b3Smrg for (base = name; *name; name++) 50633da084b3Smrg if (IS_DIR_SEPARATOR (*name)) 50643da084b3Smrg base = name + 1; 50653da084b3Smrg return base; 50663da084b3Smrg} 50673da084b3Smrg 50683da084b3Smrgint 50693da084b3Smrgcheck_executable(const char * path) 50703da084b3Smrg{ 50713da084b3Smrg struct stat st; 50723da084b3Smrg 50733da084b3Smrg DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); 50743da084b3Smrg if ((!path) || (!*path)) 50753da084b3Smrg return 0; 50763da084b3Smrg 50773da084b3Smrg if ((stat (path, &st) >= 0) && 50783da084b3Smrg ( 50793da084b3Smrg /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ 50803da084b3Smrg#if defined (S_IXOTH) 50813da084b3Smrg ((st.st_mode & S_IXOTH) == S_IXOTH) || 50823da084b3Smrg#endif 50833da084b3Smrg#if defined (S_IXGRP) 50843da084b3Smrg ((st.st_mode & S_IXGRP) == S_IXGRP) || 50853da084b3Smrg#endif 50863da084b3Smrg ((st.st_mode & S_IXUSR) == S_IXUSR)) 50873da084b3Smrg ) 50883da084b3Smrg return 1; 50893da084b3Smrg else 50903da084b3Smrg return 0; 50913da084b3Smrg} 50923da084b3Smrg 50933da084b3Smrg/* Searches for the full path of the wrapper. Returns 50943da084b3Smrg newly allocated full path name if found, NULL otherwise */ 50953da084b3Smrgchar * 50963da084b3Smrgfind_executable (const char* wrapper) 50973da084b3Smrg{ 50983da084b3Smrg int has_slash = 0; 50993da084b3Smrg const char* p; 51003da084b3Smrg const char* p_next; 51013da084b3Smrg /* static buffer for getcwd */ 51023da084b3Smrg char tmp[LT_PATHMAX + 1]; 51033da084b3Smrg int tmp_len; 51043da084b3Smrg char* concat_name; 51053da084b3Smrg 51063da084b3Smrg DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); 51073da084b3Smrg 51083da084b3Smrg if ((wrapper == NULL) || (*wrapper == '\0')) 51093da084b3Smrg return NULL; 51103da084b3Smrg 51113da084b3Smrg /* Absolute path? */ 51123da084b3Smrg#if defined (HAVE_DOS_BASED_FILE_SYSTEM) 51133da084b3Smrg if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') 51143da084b3Smrg { 51153da084b3Smrg concat_name = xstrdup (wrapper); 51163da084b3Smrg if (check_executable(concat_name)) 51173da084b3Smrg return concat_name; 51183da084b3Smrg XFREE(concat_name); 51193da084b3Smrg } 51203da084b3Smrg else 51213da084b3Smrg { 51223da084b3Smrg#endif 51233da084b3Smrg if (IS_DIR_SEPARATOR (wrapper[0])) 51243da084b3Smrg { 51253da084b3Smrg concat_name = xstrdup (wrapper); 51263da084b3Smrg if (check_executable(concat_name)) 51273da084b3Smrg return concat_name; 51283da084b3Smrg XFREE(concat_name); 51293da084b3Smrg } 51303da084b3Smrg#if defined (HAVE_DOS_BASED_FILE_SYSTEM) 51313da084b3Smrg } 51323da084b3Smrg#endif 51333da084b3Smrg 51343da084b3Smrg for (p = wrapper; *p; p++) 51353da084b3Smrg if (*p == '/') 51363da084b3Smrg { 51373da084b3Smrg has_slash = 1; 51383da084b3Smrg break; 51393da084b3Smrg } 51403da084b3Smrg if (!has_slash) 51413da084b3Smrg { 51423da084b3Smrg /* no slashes; search PATH */ 51433da084b3Smrg const char* path = getenv ("PATH"); 51443da084b3Smrg if (path != NULL) 51453da084b3Smrg { 51463da084b3Smrg for (p = path; *p; p = p_next) 51473da084b3Smrg { 51483da084b3Smrg const char* q; 51493da084b3Smrg size_t p_len; 51503da084b3Smrg for (q = p; *q; q++) 51513da084b3Smrg if (IS_PATH_SEPARATOR(*q)) 51523da084b3Smrg break; 51533da084b3Smrg p_len = q - p; 51543da084b3Smrg p_next = (*q == '\0' ? q : q + 1); 51553da084b3Smrg if (p_len == 0) 51563da084b3Smrg { 51573da084b3Smrg /* empty path: current directory */ 51583da084b3Smrg if (getcwd (tmp, LT_PATHMAX) == NULL) 51593da084b3Smrg lt_fatal ("getcwd failed"); 51603da084b3Smrg tmp_len = strlen(tmp); 51613da084b3Smrg concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); 51623da084b3Smrg memcpy (concat_name, tmp, tmp_len); 51633da084b3Smrg concat_name[tmp_len] = '/'; 51643da084b3Smrg strcpy (concat_name + tmp_len + 1, wrapper); 51653da084b3Smrg } 51663da084b3Smrg else 51673da084b3Smrg { 51683da084b3Smrg concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); 51693da084b3Smrg memcpy (concat_name, p, p_len); 51703da084b3Smrg concat_name[p_len] = '/'; 51713da084b3Smrg strcpy (concat_name + p_len + 1, wrapper); 51723da084b3Smrg } 51733da084b3Smrg if (check_executable(concat_name)) 51743da084b3Smrg return concat_name; 51753da084b3Smrg XFREE(concat_name); 51763da084b3Smrg } 51773da084b3Smrg } 51783da084b3Smrg /* not found in PATH; assume curdir */ 51793da084b3Smrg } 51803da084b3Smrg /* Relative path | not found in path: prepend cwd */ 51813da084b3Smrg if (getcwd (tmp, LT_PATHMAX) == NULL) 51823da084b3Smrg lt_fatal ("getcwd failed"); 51833da084b3Smrg tmp_len = strlen(tmp); 51843da084b3Smrg concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); 51853da084b3Smrg memcpy (concat_name, tmp, tmp_len); 51863da084b3Smrg concat_name[tmp_len] = '/'; 51873da084b3Smrg strcpy (concat_name + tmp_len + 1, wrapper); 51883da084b3Smrg 51893da084b3Smrg if (check_executable(concat_name)) 51903da084b3Smrg return concat_name; 51913da084b3Smrg XFREE(concat_name); 51923da084b3Smrg return NULL; 51933da084b3Smrg} 51943da084b3Smrg 51953da084b3Smrgchar * 51963da084b3Smrgstrendzap(char *str, const char *pat) 51973da084b3Smrg{ 51983da084b3Smrg size_t len, patlen; 51993da084b3Smrg 52003da084b3Smrg assert(str != NULL); 52013da084b3Smrg assert(pat != NULL); 52023da084b3Smrg 52033da084b3Smrg len = strlen(str); 52043da084b3Smrg patlen = strlen(pat); 52053da084b3Smrg 52063da084b3Smrg if (patlen <= len) 52073da084b3Smrg { 52083da084b3Smrg str += len - patlen; 52093da084b3Smrg if (strcmp(str, pat) == 0) 52103da084b3Smrg *str = '\0'; 52113da084b3Smrg } 52123da084b3Smrg return str; 52133da084b3Smrg} 52143da084b3Smrg 52153da084b3Smrgstatic void 52163da084b3Smrglt_error_core (int exit_status, const char * mode, 52173da084b3Smrg const char * message, va_list ap) 52183da084b3Smrg{ 52193da084b3Smrg fprintf (stderr, "%s: %s: ", program_name, mode); 52203da084b3Smrg vfprintf (stderr, message, ap); 52213da084b3Smrg fprintf (stderr, ".\n"); 52223da084b3Smrg 52233da084b3Smrg if (exit_status >= 0) 52243da084b3Smrg exit (exit_status); 52253da084b3Smrg} 52263da084b3Smrg 52273da084b3Smrgvoid 52283da084b3Smrglt_fatal (const char *message, ...) 52293da084b3Smrg{ 52303da084b3Smrg va_list ap; 52313da084b3Smrg va_start (ap, message); 52323da084b3Smrg lt_error_core (EXIT_FAILURE, "FATAL", message, ap); 52333da084b3Smrg va_end (ap); 52343da084b3Smrg} 52353da084b3SmrgEOF 52363da084b3Smrg # we should really use a build-platform specific compiler 52373da084b3Smrg # here, but OTOH, the wrappers (shell script and this C one) 52383da084b3Smrg # are only useful if you want to execute the "real" binary. 52393da084b3Smrg # Since the "real" binary is built for $host, then this 52403da084b3Smrg # wrapper might as well be built for $host, too. 52413da084b3Smrg $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource 52423da084b3Smrg ;; 52433da084b3Smrg esac 52443da084b3Smrg $rm $output 52453da084b3Smrg trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 52463da084b3Smrg 52473da084b3Smrg $echo > $output "\ 52483da084b3Smrg#! $SHELL 52493da084b3Smrg 52503da084b3Smrg# $output - temporary wrapper script for $objdir/$outputname 52513da084b3Smrg# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP 52523da084b3Smrg# 52533da084b3Smrg# The $output program cannot be directly executed until all the libtool 52543da084b3Smrg# libraries that it depends on are installed. 52553da084b3Smrg# 52563da084b3Smrg# This wrapper script should never be moved out of the build directory. 52573da084b3Smrg# If it is, it will not operate correctly. 52583da084b3Smrg 52593da084b3Smrg# Sed substitution that helps us do robust quoting. It backslashifies 52603da084b3Smrg# metacharacters that are still active within double-quoted strings. 52613da084b3SmrgXsed='${SED} -e 1s/^X//' 52623da084b3Smrgsed_quote_subst='$sed_quote_subst' 52633da084b3Smrg 52643da084b3Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout 52653da084b3Smrg# if CDPATH is set. 52663da084b3Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH 52673da084b3Smrg 52683da084b3Smrgrelink_command=\"$relink_command\" 52693da084b3Smrg 52703da084b3Smrg# This environment variable determines our operation mode. 52713da084b3Smrgif test \"\$libtool_install_magic\" = \"$magic\"; then 52723da084b3Smrg # install mode needs the following variable: 52733da084b3Smrg notinst_deplibs='$notinst_deplibs' 52743da084b3Smrgelse 52753da084b3Smrg # When we are sourced in execute mode, \$file and \$echo are already set. 52763da084b3Smrg if test \"\$libtool_execute_magic\" != \"$magic\"; then 52773da084b3Smrg echo=\"$qecho\" 52783da084b3Smrg file=\"\$0\" 52793da084b3Smrg # Make sure echo works. 52803da084b3Smrg if test \"X\$1\" = X--no-reexec; then 52813da084b3Smrg # Discard the --no-reexec flag, and continue. 52823da084b3Smrg shift 52833da084b3Smrg elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then 52843da084b3Smrg # Yippee, \$echo works! 52853da084b3Smrg : 52863da084b3Smrg else 52873da084b3Smrg # Restart under the correct shell, and then maybe \$echo will work. 52883da084b3Smrg exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} 52893da084b3Smrg fi 52903da084b3Smrg fi\ 52913da084b3Smrg" 52923da084b3Smrg $echo >> $output "\ 52933da084b3Smrg 52943da084b3Smrg # Find the directory that this script lives in. 52953da084b3Smrg thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` 52963da084b3Smrg test \"x\$thisdir\" = \"x\$file\" && thisdir=. 52973da084b3Smrg 52983da084b3Smrg # Follow symbolic links until we get to the real thisdir. 52993da084b3Smrg file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` 53003da084b3Smrg while test -n \"\$file\"; do 53013da084b3Smrg destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` 53023da084b3Smrg 53033da084b3Smrg # If there was a directory component, then change thisdir. 53043da084b3Smrg if test \"x\$destdir\" != \"x\$file\"; then 53053da084b3Smrg case \"\$destdir\" in 53063da084b3Smrg [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; 53073da084b3Smrg *) thisdir=\"\$thisdir/\$destdir\" ;; 53083da084b3Smrg esac 53093da084b3Smrg fi 53103da084b3Smrg 53113da084b3Smrg file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` 53123da084b3Smrg file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` 53133da084b3Smrg done 53143da084b3Smrg 53153da084b3Smrg # Try to get the absolute directory name. 53163da084b3Smrg absdir=\`cd \"\$thisdir\" && pwd\` 53173da084b3Smrg test -n \"\$absdir\" && thisdir=\"\$absdir\" 53183da084b3Smrg" 53193da084b3Smrg 53203da084b3Smrg if test "$fast_install" = yes; then 53213da084b3Smrg $echo >> $output "\ 53223da084b3Smrg program=lt-'$outputname'$exeext 53233da084b3Smrg progdir=\"\$thisdir/$objdir\" 53243da084b3Smrg 53253da084b3Smrg if test ! -f \"\$progdir/\$program\" || \\ 53263da084b3Smrg { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ 53273da084b3Smrg test \"X\$file\" != \"X\$progdir/\$program\"; }; then 53283da084b3Smrg 53293da084b3Smrg file=\"\$\$-\$program\" 53303da084b3Smrg 53313da084b3Smrg if test ! -d \"\$progdir\"; then 53323da084b3Smrg $mkdir \"\$progdir\" 53333da084b3Smrg else 53343da084b3Smrg $rm \"\$progdir/\$file\" 53353da084b3Smrg fi" 53363da084b3Smrg 53373da084b3Smrg $echo >> $output "\ 53383da084b3Smrg 53393da084b3Smrg # relink executable if necessary 53403da084b3Smrg if test -n \"\$relink_command\"; then 53413da084b3Smrg if relink_command_output=\`eval \$relink_command 2>&1\`; then : 53423da084b3Smrg else 53433da084b3Smrg $echo \"\$relink_command_output\" >&2 53443da084b3Smrg $rm \"\$progdir/\$file\" 53453da084b3Smrg exit $EXIT_FAILURE 53463da084b3Smrg fi 53473da084b3Smrg fi 53483da084b3Smrg 53493da084b3Smrg $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || 53503da084b3Smrg { $rm \"\$progdir/\$program\"; 53513da084b3Smrg $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } 53523da084b3Smrg $rm \"\$progdir/\$file\" 53533da084b3Smrg fi" 53543da084b3Smrg else 53553da084b3Smrg $echo >> $output "\ 53563da084b3Smrg program='$outputname' 53573da084b3Smrg progdir=\"\$thisdir/$objdir\" 53583da084b3Smrg" 53593da084b3Smrg fi 53603da084b3Smrg 53613da084b3Smrg $echo >> $output "\ 53623da084b3Smrg 53633da084b3Smrg if test -f \"\$progdir/\$program\"; then" 53643da084b3Smrg 53653da084b3Smrg # Export our shlibpath_var if we have one. 53663da084b3Smrg if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then 53673da084b3Smrg $echo >> $output "\ 53683da084b3Smrg # Add our own library path to $shlibpath_var 53693da084b3Smrg $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" 53703da084b3Smrg 53713da084b3Smrg # Some systems cannot cope with colon-terminated $shlibpath_var 53723da084b3Smrg # The second colon is a workaround for a bug in BeOS R4 sed 53733da084b3Smrg $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` 53743da084b3Smrg 53753da084b3Smrg export $shlibpath_var 53763da084b3Smrg" 53773da084b3Smrg fi 53783da084b3Smrg 53793da084b3Smrg # fixup the dll searchpath if we need to. 53803da084b3Smrg if test -n "$dllsearchpath"; then 53813da084b3Smrg $echo >> $output "\ 53823da084b3Smrg # Add the dll search path components to the executable PATH 53833da084b3Smrg PATH=$dllsearchpath:\$PATH 53843da084b3Smrg" 53853da084b3Smrg fi 53863da084b3Smrg 53873da084b3Smrg $echo >> $output "\ 53883da084b3Smrg if test \"\$libtool_execute_magic\" != \"$magic\"; then 53893da084b3Smrg # Run the actual program with our arguments. 53903da084b3Smrg" 53913da084b3Smrg case $host in 53923da084b3Smrg # Backslashes separate directories on plain windows 53933da084b3Smrg *-*-mingw | *-*-os2*) 53943da084b3Smrg $echo >> $output "\ 53953da084b3Smrg exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} 53963da084b3Smrg" 53973da084b3Smrg ;; 53983da084b3Smrg 53993da084b3Smrg *) 54003da084b3Smrg $echo >> $output "\ 54013da084b3Smrg exec \"\$progdir/\$program\" \${1+\"\$@\"} 54023da084b3Smrg" 54033da084b3Smrg ;; 54043da084b3Smrg esac 54053da084b3Smrg $echo >> $output "\ 54063da084b3Smrg \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" 54073da084b3Smrg exit $EXIT_FAILURE 54083da084b3Smrg fi 54093da084b3Smrg else 54103da084b3Smrg # The program doesn't exist. 54113da084b3Smrg \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 54123da084b3Smrg \$echo \"This script is just a wrapper for \$program.\" 1>&2 54133da084b3Smrg $echo \"See the $PACKAGE documentation for more information.\" 1>&2 54143da084b3Smrg exit $EXIT_FAILURE 54153da084b3Smrg fi 54163da084b3Smrgfi\ 54173da084b3Smrg" 54183da084b3Smrg chmod +x $output 54193da084b3Smrg fi 54203da084b3Smrg exit $EXIT_SUCCESS 54213da084b3Smrg ;; 54223da084b3Smrg esac 54233da084b3Smrg 54243da084b3Smrg # See if we need to build an old-fashioned archive. 54253da084b3Smrg for oldlib in $oldlibs; do 54263da084b3Smrg 54273da084b3Smrg if test "$build_libtool_libs" = convenience; then 54283da084b3Smrg oldobjs="$libobjs_save" 54293da084b3Smrg addlibs="$convenience" 54303da084b3Smrg build_libtool_libs=no 54313da084b3Smrg else 54323da084b3Smrg if test "$build_libtool_libs" = module; then 54333da084b3Smrg oldobjs="$libobjs_save" 54343da084b3Smrg build_libtool_libs=no 54353da084b3Smrg else 54363da084b3Smrg oldobjs="$old_deplibs $non_pic_objects" 54373da084b3Smrg fi 54383da084b3Smrg addlibs="$old_convenience" 54393da084b3Smrg fi 54403da084b3Smrg 54413da084b3Smrg if test -n "$addlibs"; then 54423da084b3Smrg gentop="$output_objdir/${outputname}x" 54433da084b3Smrg generated="$generated $gentop" 54443da084b3Smrg 54453da084b3Smrg func_extract_archives $gentop $addlibs 54463da084b3Smrg oldobjs="$oldobjs $func_extract_archives_result" 54473da084b3Smrg fi 54483da084b3Smrg 54493da084b3Smrg # Do each command in the archive commands. 54503da084b3Smrg if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then 54513da084b3Smrg cmds=$old_archive_from_new_cmds 54523da084b3Smrg else 54533da084b3Smrg # POSIX demands no paths to be encoded in archives. We have 54543da084b3Smrg # to avoid creating archives with duplicate basenames if we 54553da084b3Smrg # might have to extract them afterwards, e.g., when creating a 54563da084b3Smrg # static archive out of a convenience library, or when linking 54573da084b3Smrg # the entirety of a libtool archive into another (currently 54583da084b3Smrg # not supported by libtool). 54593da084b3Smrg if (for obj in $oldobjs 54603da084b3Smrg do 54613da084b3Smrg $echo "X$obj" | $Xsed -e 's%^.*/%%' 54623da084b3Smrg done | sort | sort -uc >/dev/null 2>&1); then 54633da084b3Smrg : 54643da084b3Smrg else 54653da084b3Smrg $echo "copying selected object files to avoid basename conflicts..." 54663da084b3Smrg 54673da084b3Smrg if test -z "$gentop"; then 54683da084b3Smrg gentop="$output_objdir/${outputname}x" 54693da084b3Smrg generated="$generated $gentop" 54703da084b3Smrg 54713da084b3Smrg $show "${rm}r $gentop" 54723da084b3Smrg $run ${rm}r "$gentop" 54733da084b3Smrg $show "$mkdir $gentop" 54743da084b3Smrg $run $mkdir "$gentop" 54753da084b3Smrg exit_status=$? 54763da084b3Smrg if test "$exit_status" -ne 0 && test ! -d "$gentop"; then 54773da084b3Smrg exit $exit_status 54783da084b3Smrg fi 54793da084b3Smrg fi 54803da084b3Smrg 54813da084b3Smrg save_oldobjs=$oldobjs 54823da084b3Smrg oldobjs= 54833da084b3Smrg counter=1 54843da084b3Smrg for obj in $save_oldobjs 54853da084b3Smrg do 54863da084b3Smrg objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` 54873da084b3Smrg case " $oldobjs " in 54883da084b3Smrg " ") oldobjs=$obj ;; 54893da084b3Smrg *[\ /]"$objbase "*) 54903da084b3Smrg while :; do 54913da084b3Smrg # Make sure we don't pick an alternate name that also 54923da084b3Smrg # overlaps. 54933da084b3Smrg newobj=lt$counter-$objbase 54943da084b3Smrg counter=`expr $counter + 1` 54953da084b3Smrg case " $oldobjs " in 54963da084b3Smrg *[\ /]"$newobj "*) ;; 54973da084b3Smrg *) if test ! -f "$gentop/$newobj"; then break; fi ;; 54983da084b3Smrg esac 54993da084b3Smrg done 55003da084b3Smrg $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" 55013da084b3Smrg $run ln "$obj" "$gentop/$newobj" || 55023da084b3Smrg $run cp "$obj" "$gentop/$newobj" 55033da084b3Smrg oldobjs="$oldobjs $gentop/$newobj" 55043da084b3Smrg ;; 55053da084b3Smrg *) oldobjs="$oldobjs $obj" ;; 55063da084b3Smrg esac 55073da084b3Smrg done 55083da084b3Smrg fi 55093da084b3Smrg 55103da084b3Smrg eval cmds=\"$old_archive_cmds\" 55113da084b3Smrg 55123da084b3Smrg if len=`expr "X$cmds" : ".*"` && 55133da084b3Smrg test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then 55143da084b3Smrg cmds=$old_archive_cmds 55153da084b3Smrg else 55163da084b3Smrg # the command line is too long to link in one step, link in parts 55173da084b3Smrg $echo "using piecewise archive linking..." 55183da084b3Smrg save_RANLIB=$RANLIB 55193da084b3Smrg RANLIB=: 55203da084b3Smrg objlist= 55213da084b3Smrg concat_cmds= 55223da084b3Smrg save_oldobjs=$oldobjs 55233da084b3Smrg 55243da084b3Smrg # Is there a better way of finding the last object in the list? 55253da084b3Smrg for obj in $save_oldobjs 55263da084b3Smrg do 55273da084b3Smrg last_oldobj=$obj 55283da084b3Smrg done 55293da084b3Smrg for obj in $save_oldobjs 55303da084b3Smrg do 55313da084b3Smrg oldobjs="$objlist $obj" 55323da084b3Smrg objlist="$objlist $obj" 55333da084b3Smrg eval test_cmds=\"$old_archive_cmds\" 55343da084b3Smrg if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && 55353da084b3Smrg test "$len" -le "$max_cmd_len"; then 55363da084b3Smrg : 55373da084b3Smrg else 55383da084b3Smrg # the above command should be used before it gets too long 55393da084b3Smrg oldobjs=$objlist 55403da084b3Smrg if test "$obj" = "$last_oldobj" ; then 55413da084b3Smrg RANLIB=$save_RANLIB 55423da084b3Smrg fi 55433da084b3Smrg test -z "$concat_cmds" || concat_cmds=$concat_cmds~ 55443da084b3Smrg eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" 55453da084b3Smrg objlist= 55463da084b3Smrg fi 55473da084b3Smrg done 55483da084b3Smrg RANLIB=$save_RANLIB 55493da084b3Smrg oldobjs=$objlist 55503da084b3Smrg if test "X$oldobjs" = "X" ; then 55513da084b3Smrg eval cmds=\"\$concat_cmds\" 55523da084b3Smrg else 55533da084b3Smrg eval cmds=\"\$concat_cmds~\$old_archive_cmds\" 55543da084b3Smrg fi 55553da084b3Smrg fi 55563da084b3Smrg fi 55573da084b3Smrg save_ifs="$IFS"; IFS='~' 55583da084b3Smrg for cmd in $cmds; do 55593da084b3Smrg eval cmd=\"$cmd\" 55603da084b3Smrg IFS="$save_ifs" 55613da084b3Smrg $show "$cmd" 55623da084b3Smrg $run eval "$cmd" || exit $? 55633da084b3Smrg done 55643da084b3Smrg IFS="$save_ifs" 55653da084b3Smrg done 55663da084b3Smrg 55673da084b3Smrg if test -n "$generated"; then 55683da084b3Smrg $show "${rm}r$generated" 55693da084b3Smrg $run ${rm}r$generated 55703da084b3Smrg fi 55713da084b3Smrg 55723da084b3Smrg # Now create the libtool archive. 55733da084b3Smrg case $output in 55743da084b3Smrg *.la) 55753da084b3Smrg old_library= 55763da084b3Smrg test "$build_old_libs" = yes && old_library="$libname.$libext" 55773da084b3Smrg $show "creating $output" 55783da084b3Smrg 55793da084b3Smrg # Preserve any variables that may affect compiler behavior 55803da084b3Smrg for var in $variables_saved_for_relink; do 55813da084b3Smrg if eval test -z \"\${$var+set}\"; then 55823da084b3Smrg relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" 55833da084b3Smrg elif eval var_value=\$$var; test -z "$var_value"; then 55843da084b3Smrg relink_command="$var=; export $var; $relink_command" 55853da084b3Smrg else 55863da084b3Smrg var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` 55873da084b3Smrg relink_command="$var=\"$var_value\"; export $var; $relink_command" 55883da084b3Smrg fi 55893da084b3Smrg done 55903da084b3Smrg # Quote the link command for shipping. 55913da084b3Smrg relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" 55923da084b3Smrg relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` 55933da084b3Smrg if test "$hardcode_automatic" = yes ; then 55943da084b3Smrg relink_command= 55953da084b3Smrg fi 55963da084b3Smrg 55973da084b3Smrg 55983da084b3Smrg # Only create the output if not a dry run. 55993da084b3Smrg if test -z "$run"; then 56003da084b3Smrg for installed in no yes; do 56013da084b3Smrg if test "$installed" = yes; then 56023da084b3Smrg if test -z "$install_libdir"; then 56033da084b3Smrg break 56043da084b3Smrg fi 56053da084b3Smrg output="$output_objdir/$outputname"i 56063da084b3Smrg # Replace all uninstalled libtool libraries with the installed ones 56073da084b3Smrg newdependency_libs= 56083da084b3Smrg for deplib in $dependency_libs; do 56093da084b3Smrg case $deplib in 56103da084b3Smrg *.la) 56113da084b3Smrg name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` 56123da084b3Smrg eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` 56133da084b3Smrg if test -z "$libdir"; then 56143da084b3Smrg $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 56153da084b3Smrg exit $EXIT_FAILURE 56163da084b3Smrg fi 56173da084b3Smrg newdependency_libs="$newdependency_libs $libdir/$name" 56183da084b3Smrg ;; 56193da084b3Smrg *) newdependency_libs="$newdependency_libs $deplib" ;; 56203da084b3Smrg esac 56213da084b3Smrg done 56223da084b3Smrg dependency_libs="$newdependency_libs" 56233da084b3Smrg newdlfiles= 56243da084b3Smrg for lib in $dlfiles; do 56253da084b3Smrg name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` 56263da084b3Smrg eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` 56273da084b3Smrg if test -z "$libdir"; then 56283da084b3Smrg $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 56293da084b3Smrg exit $EXIT_FAILURE 56303da084b3Smrg fi 56313da084b3Smrg newdlfiles="$newdlfiles $libdir/$name" 56323da084b3Smrg done 56333da084b3Smrg dlfiles="$newdlfiles" 56343da084b3Smrg newdlprefiles= 56353da084b3Smrg for lib in $dlprefiles; do 56363da084b3Smrg name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` 56373da084b3Smrg eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` 56383da084b3Smrg if test -z "$libdir"; then 56393da084b3Smrg $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 56403da084b3Smrg exit $EXIT_FAILURE 56413da084b3Smrg fi 56423da084b3Smrg newdlprefiles="$newdlprefiles $libdir/$name" 56433da084b3Smrg done 56443da084b3Smrg dlprefiles="$newdlprefiles" 56453da084b3Smrg else 56463da084b3Smrg newdlfiles= 56473da084b3Smrg for lib in $dlfiles; do 56483da084b3Smrg case $lib in 56493da084b3Smrg [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; 56503da084b3Smrg *) abs=`pwd`"/$lib" ;; 56513da084b3Smrg esac 56523da084b3Smrg newdlfiles="$newdlfiles $abs" 56533da084b3Smrg done 56543da084b3Smrg dlfiles="$newdlfiles" 56553da084b3Smrg newdlprefiles= 56563da084b3Smrg for lib in $dlprefiles; do 56573da084b3Smrg case $lib in 56583da084b3Smrg [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; 56593da084b3Smrg *) abs=`pwd`"/$lib" ;; 56603da084b3Smrg esac 56613da084b3Smrg newdlprefiles="$newdlprefiles $abs" 56623da084b3Smrg done 56633da084b3Smrg dlprefiles="$newdlprefiles" 56643da084b3Smrg fi 56653da084b3Smrg $rm $output 56663da084b3Smrg # place dlname in correct position for cygwin 56673da084b3Smrg tdlname=$dlname 56683da084b3Smrg case $host,$output,$installed,$module,$dlname in 56693da084b3Smrg *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; 56703da084b3Smrg esac 56713da084b3Smrg $echo > $output "\ 56723da084b3Smrg# $outputname - a libtool library file 56733da084b3Smrg# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP 56743da084b3Smrg# 56753da084b3Smrg# Please DO NOT delete this file! 56763da084b3Smrg# It is necessary for linking the library. 56773da084b3Smrg 56783da084b3Smrg# The name that we can dlopen(3). 56793da084b3Smrgdlname='$tdlname' 56803da084b3Smrg 56813da084b3Smrg# Names of this library. 56823da084b3Smrglibrary_names='$library_names' 56833da084b3Smrg 56843da084b3Smrg# The name of the static archive. 56853da084b3Smrgold_library='$old_library' 56863da084b3Smrg 56873da084b3Smrg# Libraries that this one depends upon. 56883da084b3Smrgdependency_libs='$dependency_libs' 56893da084b3Smrg 56903da084b3Smrg# Version information for $libname. 56913da084b3Smrgcurrent=$current 56923da084b3Smrgage=$age 56933da084b3Smrgrevision=$revision 56943da084b3Smrg 56953da084b3Smrg# Is this an already installed library? 56963da084b3Smrginstalled=$installed 56973da084b3Smrg 56983da084b3Smrg# Should we warn about portability when linking against -modules? 56993da084b3Smrgshouldnotlink=$module 57003da084b3Smrg 57013da084b3Smrg# Files to dlopen/dlpreopen 57023da084b3Smrgdlopen='$dlfiles' 57033da084b3Smrgdlpreopen='$dlprefiles' 57043da084b3Smrg 57053da084b3Smrg# Directory that this library needs to be installed in: 57063da084b3Smrglibdir='$install_libdir'" 57073da084b3Smrg if test "$installed" = no && test "$need_relink" = yes; then 57083da084b3Smrg $echo >> $output "\ 57093da084b3Smrgrelink_command=\"$relink_command\"" 57103da084b3Smrg fi 57113da084b3Smrg done 57123da084b3Smrg fi 57133da084b3Smrg 57143da084b3Smrg # Do a symbolic link so that the libtool archive can be found in 57153da084b3Smrg # LD_LIBRARY_PATH before the program is installed. 57163da084b3Smrg $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" 57173da084b3Smrg $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? 57183da084b3Smrg ;; 57193da084b3Smrg esac 57203da084b3Smrg exit $EXIT_SUCCESS 57213da084b3Smrg ;; 57223da084b3Smrg 57233da084b3Smrg # libtool install mode 57243da084b3Smrg install) 57253da084b3Smrg modename="$modename: install" 57263da084b3Smrg 57273da084b3Smrg # There may be an optional sh(1) argument at the beginning of 57283da084b3Smrg # install_prog (especially on Windows NT). 57293da084b3Smrg if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || 57303da084b3Smrg # Allow the use of GNU shtool's install command. 57313da084b3Smrg $echo "X$nonopt" | grep shtool > /dev/null; then 57323da084b3Smrg # Aesthetically quote it. 57333da084b3Smrg arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` 57343da084b3Smrg case $arg in 57353da084b3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 57363da084b3Smrg arg="\"$arg\"" 57373da084b3Smrg ;; 57383da084b3Smrg esac 57393da084b3Smrg install_prog="$arg " 57403da084b3Smrg arg="$1" 57413da084b3Smrg shift 57423da084b3Smrg else 57433da084b3Smrg install_prog= 57443da084b3Smrg arg=$nonopt 57453da084b3Smrg fi 57463da084b3Smrg 57473da084b3Smrg # The real first argument should be the name of the installation program. 57483da084b3Smrg # Aesthetically quote it. 57493da084b3Smrg arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` 57503da084b3Smrg case $arg in 57513da084b3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 57523da084b3Smrg arg="\"$arg\"" 57533da084b3Smrg ;; 57543da084b3Smrg esac 57553da084b3Smrg install_prog="$install_prog$arg" 57563da084b3Smrg 57573da084b3Smrg # We need to accept at least all the BSD install flags. 57583da084b3Smrg dest= 57593da084b3Smrg files= 57603da084b3Smrg opts= 57613da084b3Smrg prev= 57623da084b3Smrg install_type= 57633da084b3Smrg isdir=no 57643da084b3Smrg stripme= 57653da084b3Smrg for arg 57663da084b3Smrg do 57673da084b3Smrg if test -n "$dest"; then 57683da084b3Smrg files="$files $dest" 57693da084b3Smrg dest=$arg 57703da084b3Smrg continue 57713da084b3Smrg fi 57723da084b3Smrg 57733da084b3Smrg case $arg in 57743da084b3Smrg -d) isdir=yes ;; 57753da084b3Smrg -f) 57763da084b3Smrg case " $install_prog " in 57773da084b3Smrg *[\\\ /]cp\ *) ;; 57783da084b3Smrg *) prev=$arg ;; 57793da084b3Smrg esac 57803da084b3Smrg ;; 57813da084b3Smrg -g | -m | -o) prev=$arg ;; 57823da084b3Smrg -s) 57833da084b3Smrg stripme=" -s" 57843da084b3Smrg continue 57853da084b3Smrg ;; 57863da084b3Smrg -*) 57873da084b3Smrg ;; 57883da084b3Smrg *) 57893da084b3Smrg # If the previous option needed an argument, then skip it. 57903da084b3Smrg if test -n "$prev"; then 57913da084b3Smrg prev= 57923da084b3Smrg else 57933da084b3Smrg dest=$arg 57943da084b3Smrg continue 57953da084b3Smrg fi 57963da084b3Smrg ;; 57973da084b3Smrg esac 57983da084b3Smrg 57993da084b3Smrg # Aesthetically quote the argument. 58003da084b3Smrg arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` 58013da084b3Smrg case $arg in 58023da084b3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 58033da084b3Smrg arg="\"$arg\"" 58043da084b3Smrg ;; 58053da084b3Smrg esac 58063da084b3Smrg install_prog="$install_prog $arg" 58073da084b3Smrg done 58083da084b3Smrg 58093da084b3Smrg if test -z "$install_prog"; then 58103da084b3Smrg $echo "$modename: you must specify an install program" 1>&2 58113da084b3Smrg $echo "$help" 1>&2 58123da084b3Smrg exit $EXIT_FAILURE 58133da084b3Smrg fi 58143da084b3Smrg 58153da084b3Smrg if test -n "$prev"; then 58163da084b3Smrg $echo "$modename: the \`$prev' option requires an argument" 1>&2 58173da084b3Smrg $echo "$help" 1>&2 58183da084b3Smrg exit $EXIT_FAILURE 58193da084b3Smrg fi 58203da084b3Smrg 58213da084b3Smrg if test -z "$files"; then 58223da084b3Smrg if test -z "$dest"; then 58233da084b3Smrg $echo "$modename: no file or destination specified" 1>&2 58243da084b3Smrg else 58253da084b3Smrg $echo "$modename: you must specify a destination" 1>&2 58263da084b3Smrg fi 58273da084b3Smrg $echo "$help" 1>&2 58283da084b3Smrg exit $EXIT_FAILURE 58293da084b3Smrg fi 58303da084b3Smrg 58313da084b3Smrg # Strip any trailing slash from the destination. 58323da084b3Smrg dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` 58333da084b3Smrg 58343da084b3Smrg # Check to see that the destination is a directory. 58353da084b3Smrg test -d "$dest" && isdir=yes 58363da084b3Smrg if test "$isdir" = yes; then 58373da084b3Smrg destdir="$dest" 58383da084b3Smrg destname= 58393da084b3Smrg else 58403da084b3Smrg destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` 58413da084b3Smrg test "X$destdir" = "X$dest" && destdir=. 58423da084b3Smrg destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` 58433da084b3Smrg 58443da084b3Smrg # Not a directory, so check to see that there is only one file specified. 58453da084b3Smrg set dummy $files 58463da084b3Smrg if test "$#" -gt 2; then 58473da084b3Smrg $echo "$modename: \`$dest' is not a directory" 1>&2 58483da084b3Smrg $echo "$help" 1>&2 58493da084b3Smrg exit $EXIT_FAILURE 58503da084b3Smrg fi 58513da084b3Smrg fi 58523da084b3Smrg case $destdir in 58533da084b3Smrg [\\/]* | [A-Za-z]:[\\/]*) ;; 58543da084b3Smrg *) 58553da084b3Smrg for file in $files; do 58563da084b3Smrg case $file in 58573da084b3Smrg *.lo) ;; 58583da084b3Smrg *) 58593da084b3Smrg $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 58603da084b3Smrg $echo "$help" 1>&2 58613da084b3Smrg exit $EXIT_FAILURE 58623da084b3Smrg ;; 58633da084b3Smrg esac 58643da084b3Smrg done 58653da084b3Smrg ;; 58663da084b3Smrg esac 58673da084b3Smrg 58683da084b3Smrg # This variable tells wrapper scripts just to set variables rather 58693da084b3Smrg # than running their programs. 58703da084b3Smrg libtool_install_magic="$magic" 58713da084b3Smrg 58723da084b3Smrg staticlibs= 58733da084b3Smrg future_libdirs= 58743da084b3Smrg current_libdirs= 58753da084b3Smrg for file in $files; do 58763da084b3Smrg 58773da084b3Smrg # Do each installation. 58783da084b3Smrg case $file in 58793da084b3Smrg *.$libext) 58803da084b3Smrg # Do the static libraries later. 58813da084b3Smrg staticlibs="$staticlibs $file" 58823da084b3Smrg ;; 58833da084b3Smrg 58843da084b3Smrg *.la) 58853da084b3Smrg # Check to see that this really is a libtool archive. 58863da084b3Smrg if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : 58873da084b3Smrg else 58883da084b3Smrg $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 58893da084b3Smrg $echo "$help" 1>&2 58903da084b3Smrg exit $EXIT_FAILURE 58913da084b3Smrg fi 58923da084b3Smrg 58933da084b3Smrg library_names= 58943da084b3Smrg old_library= 58953da084b3Smrg relink_command= 58963da084b3Smrg # If there is no directory component, then add one. 58973da084b3Smrg case $file in 58983da084b3Smrg */* | *\\*) . $file ;; 58993da084b3Smrg *) . ./$file ;; 59003da084b3Smrg esac 59013da084b3Smrg 59023da084b3Smrg # Add the libdir to current_libdirs if it is the destination. 59033da084b3Smrg if test "X$destdir" = "X$libdir"; then 59043da084b3Smrg case "$current_libdirs " in 59053da084b3Smrg *" $libdir "*) ;; 59063da084b3Smrg *) current_libdirs="$current_libdirs $libdir" ;; 59073da084b3Smrg esac 59083da084b3Smrg else 59093da084b3Smrg # Note the libdir as a future libdir. 59103da084b3Smrg case "$future_libdirs " in 59113da084b3Smrg *" $libdir "*) ;; 59123da084b3Smrg *) future_libdirs="$future_libdirs $libdir" ;; 59133da084b3Smrg esac 59143da084b3Smrg fi 59153da084b3Smrg 59163da084b3Smrg dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ 59173da084b3Smrg test "X$dir" = "X$file/" && dir= 59183da084b3Smrg dir="$dir$objdir" 59193da084b3Smrg 59203da084b3Smrg if test -n "$relink_command"; then 59213da084b3Smrg # Determine the prefix the user has applied to our future dir. 59223da084b3Smrg inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` 59233da084b3Smrg 59243da084b3Smrg # Don't allow the user to place us outside of our expected 59253da084b3Smrg # location b/c this prevents finding dependent libraries that 59263da084b3Smrg # are installed to the same prefix. 59273da084b3Smrg # At present, this check doesn't affect windows .dll's that 59283da084b3Smrg # are installed into $libdir/../bin (currently, that works fine) 59293da084b3Smrg # but it's something to keep an eye on. 59303da084b3Smrg if test "$inst_prefix_dir" = "$destdir"; then 59313da084b3Smrg $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 59323da084b3Smrg exit $EXIT_FAILURE 59333da084b3Smrg fi 59343da084b3Smrg 59353da084b3Smrg if test -n "$inst_prefix_dir"; then 59363da084b3Smrg # Stick the inst_prefix_dir data into the link command. 59373da084b3Smrg relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` 59383da084b3Smrg else 59393da084b3Smrg relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` 59403da084b3Smrg fi 59413da084b3Smrg 59423da084b3Smrg $echo "$modename: warning: relinking \`$file'" 1>&2 59433da084b3Smrg $show "$relink_command" 59443da084b3Smrg if $run eval "$relink_command"; then : 59453da084b3Smrg else 59463da084b3Smrg $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 59473da084b3Smrg exit $EXIT_FAILURE 59483da084b3Smrg fi 59493da084b3Smrg fi 59503da084b3Smrg 59513da084b3Smrg # See the names of the shared library. 59523da084b3Smrg set dummy $library_names 59533da084b3Smrg if test -n "$2"; then 59543da084b3Smrg realname="$2" 59553da084b3Smrg shift 59563da084b3Smrg shift 59573da084b3Smrg 59583da084b3Smrg srcname="$realname" 59593da084b3Smrg test -n "$relink_command" && srcname="$realname"T 59603da084b3Smrg 59613da084b3Smrg # Install the shared library and build the symlinks. 59623da084b3Smrg $show "$install_prog $dir/$srcname $destdir/$realname" 59633da084b3Smrg $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? 59643da084b3Smrg if test -n "$stripme" && test -n "$striplib"; then 59653da084b3Smrg $show "$striplib $destdir/$realname" 59663da084b3Smrg $run eval "$striplib $destdir/$realname" || exit $? 59673da084b3Smrg fi 59683da084b3Smrg 59693da084b3Smrg if test "$#" -gt 0; then 59703da084b3Smrg # Delete the old symlinks, and create new ones. 59713da084b3Smrg # Try `ln -sf' first, because the `ln' binary might depend on 59723da084b3Smrg # the symlink we replace! Solaris /bin/ln does not understand -f, 59733da084b3Smrg # so we also need to try rm && ln -s. 59743da084b3Smrg for linkname 59753da084b3Smrg do 59763da084b3Smrg if test "$linkname" != "$realname"; then 59773da084b3Smrg $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" 59783da084b3Smrg $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" 59793da084b3Smrg fi 59803da084b3Smrg done 59813da084b3Smrg fi 59823da084b3Smrg 59833da084b3Smrg # Do each command in the postinstall commands. 59843da084b3Smrg lib="$destdir/$realname" 59853da084b3Smrg cmds=$postinstall_cmds 59863da084b3Smrg save_ifs="$IFS"; IFS='~' 59873da084b3Smrg for cmd in $cmds; do 59883da084b3Smrg IFS="$save_ifs" 59893da084b3Smrg eval cmd=\"$cmd\" 59903da084b3Smrg $show "$cmd" 59913da084b3Smrg $run eval "$cmd" || { 59923da084b3Smrg lt_exit=$? 59933da084b3Smrg 59943da084b3Smrg # Restore the uninstalled library and exit 59953da084b3Smrg if test "$mode" = relink; then 59963da084b3Smrg $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' 59973da084b3Smrg fi 59983da084b3Smrg 59993da084b3Smrg exit $lt_exit 60003da084b3Smrg } 60013da084b3Smrg done 60023da084b3Smrg IFS="$save_ifs" 60033da084b3Smrg fi 60043da084b3Smrg 60053da084b3Smrg # Install the pseudo-library for information purposes. 60063da084b3Smrg name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` 60073da084b3Smrg instname="$dir/$name"i 60083da084b3Smrg $show "$install_prog $instname $destdir/$name" 60093da084b3Smrg $run eval "$install_prog $instname $destdir/$name" || exit $? 60103da084b3Smrg 60113da084b3Smrg # Maybe install the static library, too. 60123da084b3Smrg test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" 60133da084b3Smrg ;; 60143da084b3Smrg 60153da084b3Smrg *.lo) 60163da084b3Smrg # Install (i.e. copy) a libtool object. 60173da084b3Smrg 60183da084b3Smrg # Figure out destination file name, if it wasn't already specified. 60193da084b3Smrg if test -n "$destname"; then 60203da084b3Smrg destfile="$destdir/$destname" 60213da084b3Smrg else 60223da084b3Smrg destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` 60233da084b3Smrg destfile="$destdir/$destfile" 60243da084b3Smrg fi 60253da084b3Smrg 60263da084b3Smrg # Deduce the name of the destination old-style object file. 60273da084b3Smrg case $destfile in 60283da084b3Smrg *.lo) 60293da084b3Smrg staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` 60303da084b3Smrg ;; 60313da084b3Smrg *.$objext) 60323da084b3Smrg staticdest="$destfile" 60333da084b3Smrg destfile= 60343da084b3Smrg ;; 60353da084b3Smrg *) 60363da084b3Smrg $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 60373da084b3Smrg $echo "$help" 1>&2 60383da084b3Smrg exit $EXIT_FAILURE 60393da084b3Smrg ;; 60403da084b3Smrg esac 60413da084b3Smrg 60423da084b3Smrg # Install the libtool object if requested. 60433da084b3Smrg if test -n "$destfile"; then 60443da084b3Smrg $show "$install_prog $file $destfile" 60453da084b3Smrg $run eval "$install_prog $file $destfile" || exit $? 60463da084b3Smrg fi 60473da084b3Smrg 60483da084b3Smrg # Install the old object if enabled. 60493da084b3Smrg if test "$build_old_libs" = yes; then 60503da084b3Smrg # Deduce the name of the old-style object file. 60513da084b3Smrg staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` 60523da084b3Smrg 60533da084b3Smrg $show "$install_prog $staticobj $staticdest" 60543da084b3Smrg $run eval "$install_prog \$staticobj \$staticdest" || exit $? 60553da084b3Smrg fi 60563da084b3Smrg exit $EXIT_SUCCESS 60573da084b3Smrg ;; 60583da084b3Smrg 60593da084b3Smrg *) 60603da084b3Smrg # Figure out destination file name, if it wasn't already specified. 60613da084b3Smrg if test -n "$destname"; then 60623da084b3Smrg destfile="$destdir/$destname" 60633da084b3Smrg else 60643da084b3Smrg destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` 60653da084b3Smrg destfile="$destdir/$destfile" 60663da084b3Smrg fi 60673da084b3Smrg 60683da084b3Smrg # If the file is missing, and there is a .exe on the end, strip it 60693da084b3Smrg # because it is most likely a libtool script we actually want to 60703da084b3Smrg # install 60713da084b3Smrg stripped_ext="" 60723da084b3Smrg case $file in 60733da084b3Smrg *.exe) 60743da084b3Smrg if test ! -f "$file"; then 60753da084b3Smrg file=`$echo $file|${SED} 's,.exe$,,'` 60763da084b3Smrg stripped_ext=".exe" 60773da084b3Smrg fi 60783da084b3Smrg ;; 60793da084b3Smrg esac 60803da084b3Smrg 60813da084b3Smrg # Do a test to see if this is really a libtool program. 60823da084b3Smrg case $host in 60833da084b3Smrg *cygwin*|*mingw*) 60843da084b3Smrg wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` 60853da084b3Smrg ;; 60863da084b3Smrg *) 60873da084b3Smrg wrapper=$file 60883da084b3Smrg ;; 60893da084b3Smrg esac 60903da084b3Smrg if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then 60913da084b3Smrg notinst_deplibs= 60923da084b3Smrg relink_command= 60933da084b3Smrg 60943da084b3Smrg # Note that it is not necessary on cygwin/mingw to append a dot to 60953da084b3Smrg # foo even if both foo and FILE.exe exist: automatic-append-.exe 60963da084b3Smrg # behavior happens only for exec(3), not for open(2)! Also, sourcing 60973da084b3Smrg # `FILE.' does not work on cygwin managed mounts. 60983da084b3Smrg # 60993da084b3Smrg # If there is no directory component, then add one. 61003da084b3Smrg case $wrapper in 61013da084b3Smrg */* | *\\*) . ${wrapper} ;; 61023da084b3Smrg *) . ./${wrapper} ;; 61033da084b3Smrg esac 61043da084b3Smrg 61053da084b3Smrg # Check the variables that should have been set. 61063da084b3Smrg if test -z "$notinst_deplibs"; then 61073da084b3Smrg $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 61083da084b3Smrg exit $EXIT_FAILURE 61093da084b3Smrg fi 61103da084b3Smrg 61113da084b3Smrg finalize=yes 61123da084b3Smrg for lib in $notinst_deplibs; do 61133da084b3Smrg # Check to see that each library is installed. 61143da084b3Smrg libdir= 61153da084b3Smrg if test -f "$lib"; then 61163da084b3Smrg # If there is no directory component, then add one. 61173da084b3Smrg case $lib in 61183da084b3Smrg */* | *\\*) . $lib ;; 61193da084b3Smrg *) . ./$lib ;; 61203da084b3Smrg esac 61213da084b3Smrg fi 61223da084b3Smrg libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test 61233da084b3Smrg if test -n "$libdir" && test ! -f "$libfile"; then 61243da084b3Smrg $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 61253da084b3Smrg finalize=no 61263da084b3Smrg fi 61273da084b3Smrg done 61283da084b3Smrg 61293da084b3Smrg relink_command= 61303da084b3Smrg # Note that it is not necessary on cygwin/mingw to append a dot to 61313da084b3Smrg # foo even if both foo and FILE.exe exist: automatic-append-.exe 61323da084b3Smrg # behavior happens only for exec(3), not for open(2)! Also, sourcing 61333da084b3Smrg # `FILE.' does not work on cygwin managed mounts. 61343da084b3Smrg # 61353da084b3Smrg # If there is no directory component, then add one. 61363da084b3Smrg case $wrapper in 61373da084b3Smrg */* | *\\*) . ${wrapper} ;; 61383da084b3Smrg *) . ./${wrapper} ;; 61393da084b3Smrg esac 61403da084b3Smrg 61413da084b3Smrg outputname= 61423da084b3Smrg if test "$fast_install" = no && test -n "$relink_command"; then 61433da084b3Smrg if test "$finalize" = yes && test -z "$run"; then 61443da084b3Smrg tmpdir=`func_mktempdir` 61453da084b3Smrg file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` 61463da084b3Smrg outputname="$tmpdir/$file" 61473da084b3Smrg # Replace the output file specification. 61483da084b3Smrg relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` 61493da084b3Smrg 61503da084b3Smrg $show "$relink_command" 61513da084b3Smrg if $run eval "$relink_command"; then : 61523da084b3Smrg else 61533da084b3Smrg $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 61543da084b3Smrg ${rm}r "$tmpdir" 61553da084b3Smrg continue 61563da084b3Smrg fi 61573da084b3Smrg file="$outputname" 61583da084b3Smrg else 61593da084b3Smrg $echo "$modename: warning: cannot relink \`$file'" 1>&2 61603da084b3Smrg fi 61613da084b3Smrg else 61623da084b3Smrg # Install the binary that we compiled earlier. 61633da084b3Smrg file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` 61643da084b3Smrg fi 61653da084b3Smrg fi 61663da084b3Smrg 61673da084b3Smrg # remove .exe since cygwin /usr/bin/install will append another 61683da084b3Smrg # one anyway 61693da084b3Smrg case $install_prog,$host in 61703da084b3Smrg */usr/bin/install*,*cygwin*) 61713da084b3Smrg case $file:$destfile in 61723da084b3Smrg *.exe:*.exe) 61733da084b3Smrg # this is ok 61743da084b3Smrg ;; 61753da084b3Smrg *.exe:*) 61763da084b3Smrg destfile=$destfile.exe 61773da084b3Smrg ;; 61783da084b3Smrg *:*.exe) 61793da084b3Smrg destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` 61803da084b3Smrg ;; 61813da084b3Smrg esac 61823da084b3Smrg ;; 61833da084b3Smrg esac 61843da084b3Smrg $show "$install_prog$stripme $file $destfile" 61853da084b3Smrg $run eval "$install_prog\$stripme \$file \$destfile" || exit $? 61863da084b3Smrg test -n "$outputname" && ${rm}r "$tmpdir" 61873da084b3Smrg ;; 61883da084b3Smrg esac 61893da084b3Smrg done 61903da084b3Smrg 61913da084b3Smrg for file in $staticlibs; do 61923da084b3Smrg name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` 61933da084b3Smrg 61943da084b3Smrg # Set up the ranlib parameters. 61953da084b3Smrg oldlib="$destdir/$name" 61963da084b3Smrg 61973da084b3Smrg $show "$install_prog $file $oldlib" 61983da084b3Smrg $run eval "$install_prog \$file \$oldlib" || exit $? 61993da084b3Smrg 62003da084b3Smrg if test -n "$stripme" && test -n "$old_striplib"; then 62013da084b3Smrg $show "$old_striplib $oldlib" 62023da084b3Smrg $run eval "$old_striplib $oldlib" || exit $? 62033da084b3Smrg fi 62043da084b3Smrg 62053da084b3Smrg # Do each command in the postinstall commands. 62063da084b3Smrg cmds=$old_postinstall_cmds 62073da084b3Smrg save_ifs="$IFS"; IFS='~' 62083da084b3Smrg for cmd in $cmds; do 62093da084b3Smrg IFS="$save_ifs" 62103da084b3Smrg eval cmd=\"$cmd\" 62113da084b3Smrg $show "$cmd" 62123da084b3Smrg $run eval "$cmd" || exit $? 62133da084b3Smrg done 62143da084b3Smrg IFS="$save_ifs" 62153da084b3Smrg done 62163da084b3Smrg 62173da084b3Smrg if test -n "$future_libdirs"; then 62183da084b3Smrg $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 62193da084b3Smrg fi 62203da084b3Smrg 62213da084b3Smrg if test -n "$current_libdirs"; then 62223da084b3Smrg # Maybe just do a dry run. 62233da084b3Smrg test -n "$run" && current_libdirs=" -n$current_libdirs" 62243da084b3Smrg exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' 62253da084b3Smrg else 62263da084b3Smrg exit $EXIT_SUCCESS 62273da084b3Smrg fi 62283da084b3Smrg ;; 62293da084b3Smrg 62303da084b3Smrg # libtool finish mode 62313da084b3Smrg finish) 62323da084b3Smrg modename="$modename: finish" 62333da084b3Smrg libdirs="$nonopt" 62343da084b3Smrg admincmds= 62353da084b3Smrg 62363da084b3Smrg if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then 62373da084b3Smrg for dir 62383da084b3Smrg do 62393da084b3Smrg libdirs="$libdirs $dir" 62403da084b3Smrg done 62413da084b3Smrg 62423da084b3Smrg for libdir in $libdirs; do 62433da084b3Smrg if test -n "$finish_cmds"; then 62443da084b3Smrg # Do each command in the finish commands. 62453da084b3Smrg cmds=$finish_cmds 62463da084b3Smrg save_ifs="$IFS"; IFS='~' 62473da084b3Smrg for cmd in $cmds; do 62483da084b3Smrg IFS="$save_ifs" 62493da084b3Smrg eval cmd=\"$cmd\" 62503da084b3Smrg $show "$cmd" 62513da084b3Smrg $run eval "$cmd" || admincmds="$admincmds 62523da084b3Smrg $cmd" 62533da084b3Smrg done 62543da084b3Smrg IFS="$save_ifs" 62553da084b3Smrg fi 62563da084b3Smrg if test -n "$finish_eval"; then 62573da084b3Smrg # Do the single finish_eval. 62583da084b3Smrg eval cmds=\"$finish_eval\" 62593da084b3Smrg $run eval "$cmds" || admincmds="$admincmds 62603da084b3Smrg $cmds" 62613da084b3Smrg fi 62623da084b3Smrg done 62633da084b3Smrg fi 62643da084b3Smrg 62653da084b3Smrg # Exit here if they wanted silent mode. 62663da084b3Smrg test "$show" = : && exit $EXIT_SUCCESS 62673da084b3Smrg 62683da084b3Smrg $echo "X----------------------------------------------------------------------" | $Xsed 62693da084b3Smrg $echo "Libraries have been installed in:" 62703da084b3Smrg for libdir in $libdirs; do 62713da084b3Smrg $echo " $libdir" 62723da084b3Smrg done 62733da084b3Smrg $echo 62743da084b3Smrg $echo "If you ever happen to want to link against installed libraries" 62753da084b3Smrg $echo "in a given directory, LIBDIR, you must either use libtool, and" 62763da084b3Smrg $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" 62773da084b3Smrg $echo "flag during linking and do at least one of the following:" 62783da084b3Smrg if test -n "$shlibpath_var"; then 62793da084b3Smrg $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" 62803da084b3Smrg $echo " during execution" 62813da084b3Smrg fi 62823da084b3Smrg if test -n "$runpath_var"; then 62833da084b3Smrg $echo " - add LIBDIR to the \`$runpath_var' environment variable" 62843da084b3Smrg $echo " during linking" 62853da084b3Smrg fi 62863da084b3Smrg if test -n "$hardcode_libdir_flag_spec"; then 62873da084b3Smrg libdir=LIBDIR 62883da084b3Smrg eval flag=\"$hardcode_libdir_flag_spec\" 62893da084b3Smrg 62903da084b3Smrg $echo " - use the \`$flag' linker flag" 62913da084b3Smrg fi 62923da084b3Smrg if test -n "$admincmds"; then 62933da084b3Smrg $echo " - have your system administrator run these commands:$admincmds" 62943da084b3Smrg fi 62953da084b3Smrg if test -f /etc/ld.so.conf; then 62963da084b3Smrg $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" 62973da084b3Smrg fi 62983da084b3Smrg $echo 62993da084b3Smrg $echo "See any operating system documentation about shared libraries for" 63003da084b3Smrg $echo "more information, such as the ld(1) and ld.so(8) manual pages." 63013da084b3Smrg $echo "X----------------------------------------------------------------------" | $Xsed 63023da084b3Smrg exit $EXIT_SUCCESS 63033da084b3Smrg ;; 63043da084b3Smrg 63053da084b3Smrg # libtool execute mode 63063da084b3Smrg execute) 63073da084b3Smrg modename="$modename: execute" 63083da084b3Smrg 63093da084b3Smrg # The first argument is the command name. 63103da084b3Smrg cmd="$nonopt" 63113da084b3Smrg if test -z "$cmd"; then 63123da084b3Smrg $echo "$modename: you must specify a COMMAND" 1>&2 63133da084b3Smrg $echo "$help" 63143da084b3Smrg exit $EXIT_FAILURE 63153da084b3Smrg fi 63163da084b3Smrg 63173da084b3Smrg # Handle -dlopen flags immediately. 63183da084b3Smrg for file in $execute_dlfiles; do 63193da084b3Smrg if test ! -f "$file"; then 63203da084b3Smrg $echo "$modename: \`$file' is not a file" 1>&2 63213da084b3Smrg $echo "$help" 1>&2 63223da084b3Smrg exit $EXIT_FAILURE 63233da084b3Smrg fi 63243da084b3Smrg 63253da084b3Smrg dir= 63263da084b3Smrg case $file in 63273da084b3Smrg *.la) 63283da084b3Smrg # Check to see that this really is a libtool archive. 63293da084b3Smrg if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : 63303da084b3Smrg else 63313da084b3Smrg $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 63323da084b3Smrg $echo "$help" 1>&2 63333da084b3Smrg exit $EXIT_FAILURE 63343da084b3Smrg fi 63353da084b3Smrg 63363da084b3Smrg # Read the libtool library. 63373da084b3Smrg dlname= 63383da084b3Smrg library_names= 63393da084b3Smrg 63403da084b3Smrg # If there is no directory component, then add one. 63413da084b3Smrg case $file in 63423da084b3Smrg */* | *\\*) . $file ;; 63433da084b3Smrg *) . ./$file ;; 63443da084b3Smrg esac 63453da084b3Smrg 63463da084b3Smrg # Skip this library if it cannot be dlopened. 63473da084b3Smrg if test -z "$dlname"; then 63483da084b3Smrg # Warn if it was a shared library. 63493da084b3Smrg test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" 63503da084b3Smrg continue 63513da084b3Smrg fi 63523da084b3Smrg 63533da084b3Smrg dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` 63543da084b3Smrg test "X$dir" = "X$file" && dir=. 63553da084b3Smrg 63563da084b3Smrg if test -f "$dir/$objdir/$dlname"; then 63573da084b3Smrg dir="$dir/$objdir" 63583da084b3Smrg else 63593da084b3Smrg $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 63603da084b3Smrg exit $EXIT_FAILURE 63613da084b3Smrg fi 63623da084b3Smrg ;; 63633da084b3Smrg 63643da084b3Smrg *.lo) 63653da084b3Smrg # Just add the directory containing the .lo file. 63663da084b3Smrg dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` 63673da084b3Smrg test "X$dir" = "X$file" && dir=. 63683da084b3Smrg ;; 63693da084b3Smrg 63703da084b3Smrg *) 63713da084b3Smrg $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 63723da084b3Smrg continue 63733da084b3Smrg ;; 63743da084b3Smrg esac 63753da084b3Smrg 63763da084b3Smrg # Get the absolute pathname. 63773da084b3Smrg absdir=`cd "$dir" && pwd` 63783da084b3Smrg test -n "$absdir" && dir="$absdir" 63793da084b3Smrg 63803da084b3Smrg # Now add the directory to shlibpath_var. 63813da084b3Smrg if eval "test -z \"\$$shlibpath_var\""; then 63823da084b3Smrg eval "$shlibpath_var=\"\$dir\"" 63833da084b3Smrg else 63843da084b3Smrg eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" 63853da084b3Smrg fi 63863da084b3Smrg done 63873da084b3Smrg 63883da084b3Smrg # This variable tells wrapper scripts just to set shlibpath_var 63893da084b3Smrg # rather than running their programs. 63903da084b3Smrg libtool_execute_magic="$magic" 63913da084b3Smrg 63923da084b3Smrg # Check if any of the arguments is a wrapper script. 63933da084b3Smrg args= 63943da084b3Smrg for file 63953da084b3Smrg do 63963da084b3Smrg case $file in 63973da084b3Smrg -*) ;; 63983da084b3Smrg *) 63993da084b3Smrg # Do a test to see if this is really a libtool program. 64003da084b3Smrg if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 64013da084b3Smrg # If there is no directory component, then add one. 64023da084b3Smrg case $file in 64033da084b3Smrg */* | *\\*) . $file ;; 64043da084b3Smrg *) . ./$file ;; 64053da084b3Smrg esac 64063da084b3Smrg 64073da084b3Smrg # Transform arg to wrapped name. 64083da084b3Smrg file="$progdir/$program" 64093da084b3Smrg fi 64103da084b3Smrg ;; 64113da084b3Smrg esac 64123da084b3Smrg # Quote arguments (to preserve shell metacharacters). 64133da084b3Smrg file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` 64143da084b3Smrg args="$args \"$file\"" 64153da084b3Smrg done 64163da084b3Smrg 64173da084b3Smrg if test -z "$run"; then 64183da084b3Smrg if test -n "$shlibpath_var"; then 64193da084b3Smrg # Export the shlibpath_var. 64203da084b3Smrg eval "export $shlibpath_var" 64213da084b3Smrg fi 64223da084b3Smrg 64233da084b3Smrg # Restore saved environment variables 64243da084b3Smrg if test "${save_LC_ALL+set}" = set; then 64253da084b3Smrg LC_ALL="$save_LC_ALL"; export LC_ALL 64263da084b3Smrg fi 64273da084b3Smrg if test "${save_LANG+set}" = set; then 64283da084b3Smrg LANG="$save_LANG"; export LANG 64293da084b3Smrg fi 64303da084b3Smrg 64313da084b3Smrg # Now prepare to actually exec the command. 64323da084b3Smrg exec_cmd="\$cmd$args" 64333da084b3Smrg else 64343da084b3Smrg # Display what would be done. 64353da084b3Smrg if test -n "$shlibpath_var"; then 64363da084b3Smrg eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" 64373da084b3Smrg $echo "export $shlibpath_var" 64383da084b3Smrg fi 64393da084b3Smrg $echo "$cmd$args" 64403da084b3Smrg exit $EXIT_SUCCESS 64413da084b3Smrg fi 64423da084b3Smrg ;; 64433da084b3Smrg 64443da084b3Smrg # libtool clean and uninstall mode 64453da084b3Smrg clean | uninstall) 64463da084b3Smrg modename="$modename: $mode" 64473da084b3Smrg rm="$nonopt" 64483da084b3Smrg files= 64493da084b3Smrg rmforce= 64503da084b3Smrg exit_status=0 64513da084b3Smrg 64523da084b3Smrg # This variable tells wrapper scripts just to set variables rather 64533da084b3Smrg # than running their programs. 64543da084b3Smrg libtool_install_magic="$magic" 64553da084b3Smrg 64563da084b3Smrg for arg 64573da084b3Smrg do 64583da084b3Smrg case $arg in 64593da084b3Smrg -f) rm="$rm $arg"; rmforce=yes ;; 64603da084b3Smrg -*) rm="$rm $arg" ;; 64613da084b3Smrg *) files="$files $arg" ;; 64623da084b3Smrg esac 64633da084b3Smrg done 64643da084b3Smrg 64653da084b3Smrg if test -z "$rm"; then 64663da084b3Smrg $echo "$modename: you must specify an RM program" 1>&2 64673da084b3Smrg $echo "$help" 1>&2 64683da084b3Smrg exit $EXIT_FAILURE 64693da084b3Smrg fi 64703da084b3Smrg 64713da084b3Smrg rmdirs= 64723da084b3Smrg 64733da084b3Smrg origobjdir="$objdir" 64743da084b3Smrg for file in $files; do 64753da084b3Smrg dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` 64763da084b3Smrg if test "X$dir" = "X$file"; then 64773da084b3Smrg dir=. 64783da084b3Smrg objdir="$origobjdir" 64793da084b3Smrg else 64803da084b3Smrg objdir="$dir/$origobjdir" 64813da084b3Smrg fi 64823da084b3Smrg name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` 64833da084b3Smrg test "$mode" = uninstall && objdir="$dir" 64843da084b3Smrg 64853da084b3Smrg # Remember objdir for removal later, being careful to avoid duplicates 64863da084b3Smrg if test "$mode" = clean; then 64873da084b3Smrg case " $rmdirs " in 64883da084b3Smrg *" $objdir "*) ;; 64893da084b3Smrg *) rmdirs="$rmdirs $objdir" ;; 64903da084b3Smrg esac 64913da084b3Smrg fi 64923da084b3Smrg 64933da084b3Smrg # Don't error if the file doesn't exist and rm -f was used. 64943da084b3Smrg if (test -L "$file") >/dev/null 2>&1 \ 64953da084b3Smrg || (test -h "$file") >/dev/null 2>&1 \ 64963da084b3Smrg || test -f "$file"; then 64973da084b3Smrg : 64983da084b3Smrg elif test -d "$file"; then 64993da084b3Smrg exit_status=1 65003da084b3Smrg continue 65013da084b3Smrg elif test "$rmforce" = yes; then 65023da084b3Smrg continue 65033da084b3Smrg fi 65043da084b3Smrg 65053da084b3Smrg rmfiles="$file" 65063da084b3Smrg 65073da084b3Smrg case $name in 65083da084b3Smrg *.la) 65093da084b3Smrg # Possibly a libtool archive, so verify it. 65103da084b3Smrg if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 65113da084b3Smrg . $dir/$name 65123da084b3Smrg 65133da084b3Smrg # Delete the libtool libraries and symlinks. 65143da084b3Smrg for n in $library_names; do 65153da084b3Smrg rmfiles="$rmfiles $objdir/$n" 65163da084b3Smrg done 65173da084b3Smrg test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" 65183da084b3Smrg 65193da084b3Smrg case "$mode" in 65203da084b3Smrg clean) 65213da084b3Smrg case " $library_names " in 65223da084b3Smrg # " " in the beginning catches empty $dlname 65233da084b3Smrg *" $dlname "*) ;; 65243da084b3Smrg *) rmfiles="$rmfiles $objdir/$dlname" ;; 65253da084b3Smrg esac 65263da084b3Smrg test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" 65273da084b3Smrg ;; 65283da084b3Smrg uninstall) 65293da084b3Smrg if test -n "$library_names"; then 65303da084b3Smrg # Do each command in the postuninstall commands. 65313da084b3Smrg cmds=$postuninstall_cmds 65323da084b3Smrg save_ifs="$IFS"; IFS='~' 65333da084b3Smrg for cmd in $cmds; do 65343da084b3Smrg IFS="$save_ifs" 65353da084b3Smrg eval cmd=\"$cmd\" 65363da084b3Smrg $show "$cmd" 65373da084b3Smrg $run eval "$cmd" 65383da084b3Smrg if test "$?" -ne 0 && test "$rmforce" != yes; then 65393da084b3Smrg exit_status=1 65403da084b3Smrg fi 65413da084b3Smrg done 65423da084b3Smrg IFS="$save_ifs" 65433da084b3Smrg fi 65443da084b3Smrg 65453da084b3Smrg if test -n "$old_library"; then 65463da084b3Smrg # Do each command in the old_postuninstall commands. 65473da084b3Smrg cmds=$old_postuninstall_cmds 65483da084b3Smrg save_ifs="$IFS"; IFS='~' 65493da084b3Smrg for cmd in $cmds; do 65503da084b3Smrg IFS="$save_ifs" 65513da084b3Smrg eval cmd=\"$cmd\" 65523da084b3Smrg $show "$cmd" 65533da084b3Smrg $run eval "$cmd" 65543da084b3Smrg if test "$?" -ne 0 && test "$rmforce" != yes; then 65553da084b3Smrg exit_status=1 65563da084b3Smrg fi 65573da084b3Smrg done 65583da084b3Smrg IFS="$save_ifs" 65593da084b3Smrg fi 65603da084b3Smrg # FIXME: should reinstall the best remaining shared library. 65613da084b3Smrg ;; 65623da084b3Smrg esac 65633da084b3Smrg fi 65643da084b3Smrg ;; 65653da084b3Smrg 65663da084b3Smrg *.lo) 65673da084b3Smrg # Possibly a libtool object, so verify it. 65683da084b3Smrg if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 65693da084b3Smrg 65703da084b3Smrg # Read the .lo file 65713da084b3Smrg . $dir/$name 65723da084b3Smrg 65733da084b3Smrg # Add PIC object to the list of files to remove. 65743da084b3Smrg if test -n "$pic_object" \ 65753da084b3Smrg && test "$pic_object" != none; then 65763da084b3Smrg rmfiles="$rmfiles $dir/$pic_object" 65773da084b3Smrg fi 65783da084b3Smrg 65793da084b3Smrg # Add non-PIC object to the list of files to remove. 65803da084b3Smrg if test -n "$non_pic_object" \ 65813da084b3Smrg && test "$non_pic_object" != none; then 65823da084b3Smrg rmfiles="$rmfiles $dir/$non_pic_object" 65833da084b3Smrg fi 65843da084b3Smrg fi 65853da084b3Smrg ;; 65863da084b3Smrg 65873da084b3Smrg *) 65883da084b3Smrg if test "$mode" = clean ; then 65893da084b3Smrg noexename=$name 65903da084b3Smrg case $file in 65913da084b3Smrg *.exe) 65923da084b3Smrg file=`$echo $file|${SED} 's,.exe$,,'` 65933da084b3Smrg noexename=`$echo $name|${SED} 's,.exe$,,'` 65943da084b3Smrg # $file with .exe has already been added to rmfiles, 65953da084b3Smrg # add $file without .exe 65963da084b3Smrg rmfiles="$rmfiles $file" 65973da084b3Smrg ;; 65983da084b3Smrg esac 65993da084b3Smrg # Do a test to see if this is a libtool program. 66003da084b3Smrg if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 66013da084b3Smrg relink_command= 66023da084b3Smrg . $dir/$noexename 66033da084b3Smrg 66043da084b3Smrg # note $name still contains .exe if it was in $file originally 66053da084b3Smrg # as does the version of $file that was added into $rmfiles 66063da084b3Smrg rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" 66073da084b3Smrg if test "$fast_install" = yes && test -n "$relink_command"; then 66083da084b3Smrg rmfiles="$rmfiles $objdir/lt-$name" 66093da084b3Smrg fi 66103da084b3Smrg if test "X$noexename" != "X$name" ; then 66113da084b3Smrg rmfiles="$rmfiles $objdir/lt-${noexename}.c" 66123da084b3Smrg fi 66133da084b3Smrg fi 66143da084b3Smrg fi 66153da084b3Smrg ;; 66163da084b3Smrg esac 66173da084b3Smrg $show "$rm $rmfiles" 66183da084b3Smrg $run $rm $rmfiles || exit_status=1 66193da084b3Smrg done 66203da084b3Smrg objdir="$origobjdir" 66213da084b3Smrg 66223da084b3Smrg # Try to remove the ${objdir}s in the directories where we deleted files 66233da084b3Smrg for dir in $rmdirs; do 66243da084b3Smrg if test -d "$dir"; then 66253da084b3Smrg $show "rmdir $dir" 66263da084b3Smrg $run rmdir $dir >/dev/null 2>&1 66273da084b3Smrg fi 66283da084b3Smrg done 66293da084b3Smrg 66303da084b3Smrg exit $exit_status 66313da084b3Smrg ;; 66323da084b3Smrg 66333da084b3Smrg "") 66343da084b3Smrg $echo "$modename: you must specify a MODE" 1>&2 66353da084b3Smrg $echo "$generic_help" 1>&2 66363da084b3Smrg exit $EXIT_FAILURE 66373da084b3Smrg ;; 66383da084b3Smrg esac 66393da084b3Smrg 66403da084b3Smrg if test -z "$exec_cmd"; then 66413da084b3Smrg $echo "$modename: invalid operation mode \`$mode'" 1>&2 66423da084b3Smrg $echo "$generic_help" 1>&2 66433da084b3Smrg exit $EXIT_FAILURE 66443da084b3Smrg fi 66453da084b3Smrgfi # test -z "$show_help" 66463da084b3Smrg 66473da084b3Smrgif test -n "$exec_cmd"; then 66483da084b3Smrg eval exec $exec_cmd 66493da084b3Smrg exit $EXIT_FAILURE 66503da084b3Smrgfi 66513da084b3Smrg 66523da084b3Smrg# We need to display help for each of the modes. 66533da084b3Smrgcase $mode in 66543da084b3Smrg"") $echo \ 66553da084b3Smrg"Usage: $modename [OPTION]... [MODE-ARG]... 66563da084b3Smrg 66573da084b3SmrgProvide generalized library-building support services. 66583da084b3Smrg 66593da084b3Smrg --config show all configuration variables 66603da084b3Smrg --debug enable verbose shell tracing 66613da084b3Smrg-n, --dry-run display commands without modifying any files 66623da084b3Smrg --features display basic configuration information and exit 66633da084b3Smrg --finish same as \`--mode=finish' 66643da084b3Smrg --help display this help message and exit 66653da084b3Smrg --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] 66663da084b3Smrg --quiet same as \`--silent' 66673da084b3Smrg --silent don't print informational messages 66683da084b3Smrg --tag=TAG use configuration variables from tag TAG 66693da084b3Smrg --version print version information 66703da084b3Smrg 66713da084b3SmrgMODE must be one of the following: 66723da084b3Smrg 66733da084b3Smrg clean remove files from the build directory 66743da084b3Smrg compile compile a source file into a libtool object 66753da084b3Smrg execute automatically set library path, then run a program 66763da084b3Smrg finish complete the installation of libtool libraries 66773da084b3Smrg install install libraries or executables 66783da084b3Smrg link create a library or an executable 66793da084b3Smrg uninstall remove libraries from an installed directory 66803da084b3Smrg 66813da084b3SmrgMODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for 66823da084b3Smrga more detailed description of MODE. 66833da084b3Smrg 66843da084b3SmrgReport bugs to <bug-libtool@gnu.org>." 66853da084b3Smrg exit $EXIT_SUCCESS 66863da084b3Smrg ;; 66873da084b3Smrg 66883da084b3Smrgclean) 66893da084b3Smrg $echo \ 66903da084b3Smrg"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... 66913da084b3Smrg 66923da084b3SmrgRemove files from the build directory. 66933da084b3Smrg 66943da084b3SmrgRM is the name of the program to use to delete files associated with each FILE 66953da084b3Smrg(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed 66963da084b3Smrgto RM. 66973da084b3Smrg 66983da084b3SmrgIf FILE is a libtool library, object or program, all the files associated 66993da084b3Smrgwith it are deleted. Otherwise, only FILE itself is deleted using RM." 67003da084b3Smrg ;; 67013da084b3Smrg 67023da084b3Smrgcompile) 67033da084b3Smrg $echo \ 67043da084b3Smrg"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE 67053da084b3Smrg 67063da084b3SmrgCompile a source file into a libtool library object. 67073da084b3Smrg 67083da084b3SmrgThis mode accepts the following additional options: 67093da084b3Smrg 67103da084b3Smrg -o OUTPUT-FILE set the output file name to OUTPUT-FILE 67113da084b3Smrg -prefer-pic try to building PIC objects only 67123da084b3Smrg -prefer-non-pic try to building non-PIC objects only 67133da084b3Smrg -static always build a \`.o' file suitable for static linking 67143da084b3Smrg 67153da084b3SmrgCOMPILE-COMMAND is a command to be used in creating a \`standard' object file 67163da084b3Smrgfrom the given SOURCEFILE. 67173da084b3Smrg 67183da084b3SmrgThe output file name is determined by removing the directory component from 67193da084b3SmrgSOURCEFILE, then substituting the C source code suffix \`.c' with the 67203da084b3Smrglibrary object suffix, \`.lo'." 67213da084b3Smrg ;; 67223da084b3Smrg 67233da084b3Smrgexecute) 67243da084b3Smrg $echo \ 67253da084b3Smrg"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... 67263da084b3Smrg 67273da084b3SmrgAutomatically set library path, then run a program. 67283da084b3Smrg 67293da084b3SmrgThis mode accepts the following additional options: 67303da084b3Smrg 67313da084b3Smrg -dlopen FILE add the directory containing FILE to the library path 67323da084b3Smrg 67333da084b3SmrgThis mode sets the library path environment variable according to \`-dlopen' 67343da084b3Smrgflags. 67353da084b3Smrg 67363da084b3SmrgIf any of the ARGS are libtool executable wrappers, then they are translated 67373da084b3Smrginto their corresponding uninstalled binary, and any of their required library 67383da084b3Smrgdirectories are added to the library path. 67393da084b3Smrg 67403da084b3SmrgThen, COMMAND is executed, with ARGS as arguments." 67413da084b3Smrg ;; 67423da084b3Smrg 67433da084b3Smrgfinish) 67443da084b3Smrg $echo \ 67453da084b3Smrg"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... 67463da084b3Smrg 67473da084b3SmrgComplete the installation of libtool libraries. 67483da084b3Smrg 67493da084b3SmrgEach LIBDIR is a directory that contains libtool libraries. 67503da084b3Smrg 67513da084b3SmrgThe commands that this mode executes may require superuser privileges. Use 67523da084b3Smrgthe \`--dry-run' option if you just want to see what would be executed." 67533da084b3Smrg ;; 67543da084b3Smrg 67553da084b3Smrginstall) 67563da084b3Smrg $echo \ 67573da084b3Smrg"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... 67583da084b3Smrg 67593da084b3SmrgInstall executables or libraries. 67603da084b3Smrg 67613da084b3SmrgINSTALL-COMMAND is the installation command. The first component should be 67623da084b3Smrgeither the \`install' or \`cp' program. 67633da084b3Smrg 67643da084b3SmrgThe rest of the components are interpreted as arguments to that command (only 67653da084b3SmrgBSD-compatible install options are recognized)." 67663da084b3Smrg ;; 67673da084b3Smrg 67683da084b3Smrglink) 67693da084b3Smrg $echo \ 67703da084b3Smrg"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... 67713da084b3Smrg 67723da084b3SmrgLink object files or libraries together to form another library, or to 67733da084b3Smrgcreate an executable program. 67743da084b3Smrg 67753da084b3SmrgLINK-COMMAND is a command using the C compiler that you would use to create 67763da084b3Smrga program from several object files. 67773da084b3Smrg 67783da084b3SmrgThe following components of LINK-COMMAND are treated specially: 67793da084b3Smrg 67803da084b3Smrg -all-static do not do any dynamic linking at all 67813da084b3Smrg -avoid-version do not add a version suffix if possible 67823da084b3Smrg -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime 67833da084b3Smrg -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols 67843da084b3Smrg -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) 67853da084b3Smrg -export-symbols SYMFILE 67863da084b3Smrg try to export only the symbols listed in SYMFILE 67873da084b3Smrg -export-symbols-regex REGEX 67883da084b3Smrg try to export only the symbols matching REGEX 67893da084b3Smrg -LLIBDIR search LIBDIR for required installed libraries 67903da084b3Smrg -lNAME OUTPUT-FILE requires the installed library libNAME 67913da084b3Smrg -module build a library that can dlopened 67923da084b3Smrg -no-fast-install disable the fast-install mode 67933da084b3Smrg -no-install link a not-installable executable 67943da084b3Smrg -no-undefined declare that a library does not refer to external symbols 67953da084b3Smrg -o OUTPUT-FILE create OUTPUT-FILE from the specified objects 67963da084b3Smrg -objectlist FILE Use a list of object files found in FILE to specify objects 67973da084b3Smrg -precious-files-regex REGEX 67983da084b3Smrg don't remove output files matching REGEX 67993da084b3Smrg -release RELEASE specify package release information 68003da084b3Smrg -rpath LIBDIR the created library will eventually be installed in LIBDIR 68013da084b3Smrg -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries 68023da084b3Smrg -static do not do any dynamic linking of libtool libraries 68033da084b3Smrg -version-info CURRENT[:REVISION[:AGE]] 68043da084b3Smrg specify library version info [each variable defaults to 0] 68053da084b3Smrg 68063da084b3SmrgAll other options (arguments beginning with \`-') are ignored. 68073da084b3Smrg 68083da084b3SmrgEvery other argument is treated as a filename. Files ending in \`.la' are 68093da084b3Smrgtreated as uninstalled libtool libraries, other files are standard or library 68103da084b3Smrgobject files. 68113da084b3Smrg 68123da084b3SmrgIf the OUTPUT-FILE ends in \`.la', then a libtool library is created, 68133da084b3Smrgonly library objects (\`.lo' files) may be specified, and \`-rpath' is 68143da084b3Smrgrequired, except when creating a convenience library. 68153da084b3Smrg 68163da084b3SmrgIf OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created 68173da084b3Smrgusing \`ar' and \`ranlib', or on Windows using \`lib'. 68183da084b3Smrg 68193da084b3SmrgIf OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file 68203da084b3Smrgis created, otherwise an executable program is created." 68213da084b3Smrg ;; 68223da084b3Smrg 68233da084b3Smrguninstall) 68243da084b3Smrg $echo \ 68253da084b3Smrg"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... 68263da084b3Smrg 68273da084b3SmrgRemove libraries from an installation directory. 68283da084b3Smrg 68293da084b3SmrgRM is the name of the program to use to delete files associated with each FILE 68303da084b3Smrg(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed 68313da084b3Smrgto RM. 68323da084b3Smrg 68333da084b3SmrgIf FILE is a libtool library, all the files associated with it are deleted. 68343da084b3SmrgOtherwise, only FILE itself is deleted using RM." 68353da084b3Smrg ;; 68363da084b3Smrg 68373da084b3Smrg*) 68383da084b3Smrg $echo "$modename: invalid operation mode \`$mode'" 1>&2 68393da084b3Smrg $echo "$help" 1>&2 68403da084b3Smrg exit $EXIT_FAILURE 68413da084b3Smrg ;; 68423da084b3Smrgesac 68433da084b3Smrg 68443da084b3Smrg$echo 68453da084b3Smrg$echo "Try \`$modename --help' for more information about other modes." 68463da084b3Smrg 68473da084b3Smrgexit $? 68483da084b3Smrg 68493da084b3Smrg# The TAGs below are defined such that we never get into a situation 68503da084b3Smrg# in which we disable both kinds of libraries. Given conflicting 68513da084b3Smrg# choices, we go for a static library, that is the most portable, 68523da084b3Smrg# since we can't tell whether shared libraries were disabled because 68533da084b3Smrg# the user asked for that or because the platform doesn't support 68543da084b3Smrg# them. This is particularly important on AIX, because we don't 68553da084b3Smrg# support having both static and shared libraries enabled at the same 68563da084b3Smrg# time on that platform, so we default to a shared-only configuration. 68573da084b3Smrg# If a disable-shared tag is given, we'll fallback to a static-only 68583da084b3Smrg# configuration. But we'll never go from static-only to shared-only. 68593da084b3Smrg 68603da084b3Smrg# ### BEGIN LIBTOOL TAG CONFIG: disable-shared 68613da084b3Smrgdisable_libs=shared 68623da084b3Smrg# ### END LIBTOOL TAG CONFIG: disable-shared 68633da084b3Smrg 68643da084b3Smrg# ### BEGIN LIBTOOL TAG CONFIG: disable-static 68653da084b3Smrgdisable_libs=static 68663da084b3Smrg# ### END LIBTOOL TAG CONFIG: disable-static 68673da084b3Smrg 68683da084b3Smrg# Local Variables: 68693da084b3Smrg# mode:shell-script 68703da084b3Smrg# sh-indentation:2 68713da084b3Smrg# End: 6872