ltmain.sh revision d31dbc53
132b578d3Smrg# ltmain.sh - Provide generalized library-building support services. 232b578d3Smrg# NOTE: Changing this file will not affect anything until you rerun configure. 332b578d3Smrg# 4d31dbc53Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 5d31dbc53Smrg# Free Software Foundation, Inc. 632b578d3Smrg# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 732b578d3Smrg# 832b578d3Smrg# This program is free software; you can redistribute it and/or modify 932b578d3Smrg# it under the terms of the GNU General Public License as published by 1032b578d3Smrg# the Free Software Foundation; either version 2 of the License, or 1132b578d3Smrg# (at your option) any later version. 1232b578d3Smrg# 1332b578d3Smrg# This program is distributed in the hope that it will be useful, but 1432b578d3Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of 1532b578d3Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1632b578d3Smrg# General Public License for more details. 1732b578d3Smrg# 1832b578d3Smrg# You should have received a copy of the GNU General Public License 1932b578d3Smrg# along with this program; if not, write to the Free Software 2032b578d3Smrg# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 2132b578d3Smrg# 2232b578d3Smrg# As a special exception to the GNU General Public License, if you 2332b578d3Smrg# distribute this file as part of a program that contains a 2432b578d3Smrg# configuration script generated by Autoconf, you may include it under 2532b578d3Smrg# the same distribution terms that you use for the rest of that program. 2632b578d3Smrg 2732b578d3Smrgbasename="s,^.*/,,g" 2832b578d3Smrg 2932b578d3Smrg# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh 3032b578d3Smrg# is ksh but when the shell is invoked as "sh" and the current value of 3132b578d3Smrg# the _XPG environment variable is not equal to 1 (one), the special 3232b578d3Smrg# positional parameter $0, within a function call, is the name of the 3332b578d3Smrg# function. 3432b578d3Smrgprogpath="$0" 3532b578d3Smrg 3632b578d3Smrg# The name of this program: 3732b578d3Smrgprogname=`echo "$progpath" | $SED $basename` 3832b578d3Smrgmodename="$progname" 3932b578d3Smrg 4032b578d3Smrg# Global variables: 4132b578d3SmrgEXIT_SUCCESS=0 4232b578d3SmrgEXIT_FAILURE=1 4332b578d3Smrg 4432b578d3SmrgPROGRAM=ltmain.sh 4532b578d3SmrgPACKAGE=libtool 46d31dbc53SmrgVERSION=1.5.22 47d31dbc53SmrgTIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" 48d31dbc53Smrg 49d31dbc53Smrg# See if we are running on zsh, and set the options which allow our 50d31dbc53Smrg# commands through without removal of \ escapes. 51d31dbc53Smrgif test -n "${ZSH_VERSION+set}" ; then 5232b578d3Smrg setopt NO_GLOB_SUBST 5332b578d3Smrgfi 5432b578d3Smrg 5532b578d3Smrg# Check that we have a working $echo. 5632b578d3Smrgif test "X$1" = X--no-reexec; then 5732b578d3Smrg # Discard the --no-reexec flag, and continue. 5832b578d3Smrg shift 5932b578d3Smrgelif test "X$1" = X--fallback-echo; then 6032b578d3Smrg # Avoid inline document here, it may be left over 6132b578d3Smrg : 6232b578d3Smrgelif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then 6332b578d3Smrg # Yippee, $echo works! 6432b578d3Smrg : 6532b578d3Smrgelse 6632b578d3Smrg # Restart under the correct shell, and then maybe $echo will work. 6732b578d3Smrg exec $SHELL "$progpath" --no-reexec ${1+"$@"} 6832b578d3Smrgfi 6932b578d3Smrg 7032b578d3Smrgif test "X$1" = X--fallback-echo; then 7132b578d3Smrg # used as fallback echo 7232b578d3Smrg shift 7332b578d3Smrg cat <<EOF 7432b578d3Smrg$* 7532b578d3SmrgEOF 7632b578d3Smrg exit $EXIT_SUCCESS 7732b578d3Smrgfi 7832b578d3Smrg 7932b578d3Smrgdefault_mode= 8032b578d3Smrghelp="Try \`$progname --help' for more information." 8132b578d3Smrgmagic="%%%MAGIC variable%%%" 8232b578d3Smrgmkdir="mkdir" 8332b578d3Smrgmv="mv -f" 8432b578d3Smrgrm="rm -f" 8532b578d3Smrg 8632b578d3Smrg# Sed substitution that helps us do robust quoting. It backslashifies 8732b578d3Smrg# metacharacters that are still active within double-quoted strings. 8832b578d3SmrgXsed="${SED}"' -e 1s/^X//' 8932b578d3Smrgsed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' 9032b578d3Smrg# test EBCDIC or ASCII 9132b578d3Smrgcase `echo X|tr X '\101'` in 9232b578d3Smrg A) # ASCII based system 9332b578d3Smrg # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr 9432b578d3Smrg SP2NL='tr \040 \012' 9532b578d3Smrg NL2SP='tr \015\012 \040\040' 9632b578d3Smrg ;; 9732b578d3Smrg *) # EBCDIC based system 9832b578d3Smrg SP2NL='tr \100 \n' 9932b578d3Smrg NL2SP='tr \r\n \100\100' 10032b578d3Smrg ;; 10132b578d3Smrgesac 10232b578d3Smrg 10332b578d3Smrg# NLS nuisances. 10432b578d3Smrg# Only set LANG and LC_ALL to C if already set. 10532b578d3Smrg# These must not be set unconditionally because not all systems understand 10632b578d3Smrg# e.g. LANG=C (notably SCO). 10732b578d3Smrg# We save the old values to restore during execute mode. 108d31dbc53Smrgif test "${LC_ALL+set}" = set; then 109d31dbc53Smrg save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL 110d31dbc53Smrgfi 111d31dbc53Smrgif test "${LANG+set}" = set; then 112d31dbc53Smrg save_LANG="$LANG"; LANG=C; export LANG 113d31dbc53Smrgfi 11432b578d3Smrg 11532b578d3Smrg# Make sure IFS has a sensible default 11632b578d3Smrglt_nl=' 11732b578d3Smrg' 11832b578d3SmrgIFS=" $lt_nl" 11932b578d3Smrg 12032b578d3Smrgif test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then 12132b578d3Smrg $echo "$modename: not configured to build any kind of library" 1>&2 12232b578d3Smrg $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 12332b578d3Smrg exit $EXIT_FAILURE 12432b578d3Smrgfi 12532b578d3Smrg 12632b578d3Smrg# Global variables. 12732b578d3Smrgmode=$default_mode 12832b578d3Smrgnonopt= 12932b578d3Smrgprev= 13032b578d3Smrgprevopt= 13132b578d3Smrgrun= 13232b578d3Smrgshow="$echo" 13332b578d3Smrgshow_help= 13432b578d3Smrgexecute_dlfiles= 13532b578d3Smrgduplicate_deps=no 13632b578d3Smrgpreserve_args= 13732b578d3Smrglo2o="s/\\.lo\$/.${objext}/" 13832b578d3Smrgo2lo="s/\\.${objext}\$/.lo/" 13932b578d3Smrg 14032b578d3Smrg##################################### 14132b578d3Smrg# Shell function definitions: 14232b578d3Smrg# This seems to be the best place for them 14332b578d3Smrg 14432b578d3Smrg# func_mktempdir [string] 14532b578d3Smrg# Make a temporary directory that won't clash with other running 14632b578d3Smrg# libtool processes, and avoids race conditions if possible. If 14732b578d3Smrg# given, STRING is the basename for that directory. 14832b578d3Smrgfunc_mktempdir () 14932b578d3Smrg{ 15032b578d3Smrg my_template="${TMPDIR-/tmp}/${1-$progname}" 15132b578d3Smrg 15232b578d3Smrg if test "$run" = ":"; then 15332b578d3Smrg # Return a directory name, but don't create it in dry-run mode 15432b578d3Smrg my_tmpdir="${my_template}-$$" 15532b578d3Smrg else 15632b578d3Smrg 15732b578d3Smrg # If mktemp works, use that first and foremost 15832b578d3Smrg my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` 15932b578d3Smrg 16032b578d3Smrg if test ! -d "$my_tmpdir"; then 16132b578d3Smrg # Failing that, at least try and use $RANDOM to avoid a race 16232b578d3Smrg my_tmpdir="${my_template}-${RANDOM-0}$$" 16332b578d3Smrg 16432b578d3Smrg save_mktempdir_umask=`umask` 16532b578d3Smrg umask 0077 16632b578d3Smrg $mkdir "$my_tmpdir" 16732b578d3Smrg umask $save_mktempdir_umask 16832b578d3Smrg fi 16932b578d3Smrg 17032b578d3Smrg # If we're not in dry-run mode, bomb out on failure 17132b578d3Smrg test -d "$my_tmpdir" || { 17232b578d3Smrg $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 17332b578d3Smrg exit $EXIT_FAILURE 17432b578d3Smrg } 17532b578d3Smrg fi 17632b578d3Smrg 17732b578d3Smrg $echo "X$my_tmpdir" | $Xsed 17832b578d3Smrg} 17932b578d3Smrg 18032b578d3Smrg 18132b578d3Smrg# func_win32_libid arg 18232b578d3Smrg# return the library type of file 'arg' 18332b578d3Smrg# 18432b578d3Smrg# Need a lot of goo to handle *both* DLLs and import libs 18532b578d3Smrg# Has to be a shell function in order to 'eat' the argument 18632b578d3Smrg# that is supplied when $file_magic_command is called. 18732b578d3Smrgfunc_win32_libid () 18832b578d3Smrg{ 18932b578d3Smrg win32_libid_type="unknown" 19032b578d3Smrg win32_fileres=`file -L $1 2>/dev/null` 19132b578d3Smrg case $win32_fileres in 19232b578d3Smrg *ar\ archive\ import\ library*) # definitely import 19332b578d3Smrg win32_libid_type="x86 archive import" 19432b578d3Smrg ;; 19532b578d3Smrg *ar\ archive*) # could be an import, or static 19632b578d3Smrg if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ 19732b578d3Smrg $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then 19832b578d3Smrg win32_nmres=`eval $NM -f posix -A $1 | \ 199d31dbc53Smrg $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'` 20032b578d3Smrg case $win32_nmres in 20132b578d3Smrg import*) win32_libid_type="x86 archive import";; 20232b578d3Smrg *) win32_libid_type="x86 archive static";; 20332b578d3Smrg esac 20432b578d3Smrg fi 20532b578d3Smrg ;; 20632b578d3Smrg *DLL*) 20732b578d3Smrg win32_libid_type="x86 DLL" 20832b578d3Smrg ;; 20932b578d3Smrg *executable*) # but shell scripts are "executable" too... 21032b578d3Smrg case $win32_fileres in 21132b578d3Smrg *MS\ Windows\ PE\ Intel*) 21232b578d3Smrg win32_libid_type="x86 DLL" 21332b578d3Smrg ;; 21432b578d3Smrg esac 21532b578d3Smrg ;; 21632b578d3Smrg esac 21732b578d3Smrg $echo $win32_libid_type 21832b578d3Smrg} 21932b578d3Smrg 22032b578d3Smrg 22132b578d3Smrg# func_infer_tag arg 22232b578d3Smrg# Infer tagged configuration to use if any are available and 22332b578d3Smrg# if one wasn't chosen via the "--tag" command line option. 22432b578d3Smrg# Only attempt this if the compiler in the base compile 22532b578d3Smrg# command doesn't match the default compiler. 22632b578d3Smrg# arg is usually of the form 'gcc ...' 22732b578d3Smrgfunc_infer_tag () 22832b578d3Smrg{ 22932b578d3Smrg if test -n "$available_tags" && test -z "$tagname"; then 23032b578d3Smrg CC_quoted= 23132b578d3Smrg for arg in $CC; do 23232b578d3Smrg case $arg in 23332b578d3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 23432b578d3Smrg arg="\"$arg\"" 23532b578d3Smrg ;; 23632b578d3Smrg esac 23732b578d3Smrg CC_quoted="$CC_quoted $arg" 23832b578d3Smrg done 23932b578d3Smrg case $@ in 24032b578d3Smrg # Blanks in the command may have been stripped by the calling shell, 24132b578d3Smrg # but not from the CC environment variable when configure was run. 24232b578d3Smrg " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; 24332b578d3Smrg # Blanks at the start of $base_compile will cause this to fail 24432b578d3Smrg # if we don't check for them as well. 24532b578d3Smrg *) 24632b578d3Smrg for z in $available_tags; do 24732b578d3Smrg if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then 24832b578d3Smrg # Evaluate the configuration. 24932b578d3Smrg eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" 25032b578d3Smrg CC_quoted= 25132b578d3Smrg for arg in $CC; do 25232b578d3Smrg # Double-quote args containing other shell metacharacters. 25332b578d3Smrg case $arg in 25432b578d3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 25532b578d3Smrg arg="\"$arg\"" 25632b578d3Smrg ;; 25732b578d3Smrg esac 25832b578d3Smrg CC_quoted="$CC_quoted $arg" 25932b578d3Smrg done 26032b578d3Smrg case "$@ " in 26132b578d3Smrg " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) 26232b578d3Smrg # The compiler in the base compile command matches 26332b578d3Smrg # the one in the tagged configuration. 26432b578d3Smrg # Assume this is the tagged configuration we want. 26532b578d3Smrg tagname=$z 26632b578d3Smrg break 26732b578d3Smrg ;; 26832b578d3Smrg esac 26932b578d3Smrg fi 27032b578d3Smrg done 27132b578d3Smrg # If $tagname still isn't set, then no tagged configuration 27232b578d3Smrg # was found and let the user know that the "--tag" command 27332b578d3Smrg # line option must be used. 27432b578d3Smrg if test -z "$tagname"; then 27532b578d3Smrg $echo "$modename: unable to infer tagged configuration" 27632b578d3Smrg $echo "$modename: specify a tag with \`--tag'" 1>&2 27732b578d3Smrg exit $EXIT_FAILURE 27832b578d3Smrg# else 27932b578d3Smrg# $echo "$modename: using $tagname tagged configuration" 28032b578d3Smrg fi 28132b578d3Smrg ;; 28232b578d3Smrg esac 28332b578d3Smrg fi 28432b578d3Smrg} 28532b578d3Smrg 28632b578d3Smrg 28732b578d3Smrg# func_extract_an_archive dir oldlib 28832b578d3Smrgfunc_extract_an_archive () 28932b578d3Smrg{ 29032b578d3Smrg f_ex_an_ar_dir="$1"; shift 29132b578d3Smrg f_ex_an_ar_oldlib="$1" 29232b578d3Smrg 29332b578d3Smrg $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" 29432b578d3Smrg $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? 29532b578d3Smrg if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then 29632b578d3Smrg : 29732b578d3Smrg else 29832b578d3Smrg $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 29932b578d3Smrg exit $EXIT_FAILURE 30032b578d3Smrg fi 30132b578d3Smrg} 30232b578d3Smrg 30332b578d3Smrg# func_extract_archives gentop oldlib ... 30432b578d3Smrgfunc_extract_archives () 30532b578d3Smrg{ 30632b578d3Smrg my_gentop="$1"; shift 30732b578d3Smrg my_oldlibs=${1+"$@"} 30832b578d3Smrg my_oldobjs="" 30932b578d3Smrg my_xlib="" 31032b578d3Smrg my_xabs="" 31132b578d3Smrg my_xdir="" 31232b578d3Smrg my_status="" 31332b578d3Smrg 31432b578d3Smrg $show "${rm}r $my_gentop" 31532b578d3Smrg $run ${rm}r "$my_gentop" 31632b578d3Smrg $show "$mkdir $my_gentop" 31732b578d3Smrg $run $mkdir "$my_gentop" 31832b578d3Smrg my_status=$? 31932b578d3Smrg if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then 32032b578d3Smrg exit $my_status 32132b578d3Smrg fi 32232b578d3Smrg 32332b578d3Smrg for my_xlib in $my_oldlibs; do 32432b578d3Smrg # Extract the objects. 32532b578d3Smrg case $my_xlib in 32632b578d3Smrg [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; 32732b578d3Smrg *) my_xabs=`pwd`"/$my_xlib" ;; 32832b578d3Smrg esac 32932b578d3Smrg my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` 330d31dbc53Smrg my_xdir="$my_gentop/$my_xlib" 33132b578d3Smrg 33232b578d3Smrg $show "${rm}r $my_xdir" 33332b578d3Smrg $run ${rm}r "$my_xdir" 33432b578d3Smrg $show "$mkdir $my_xdir" 33532b578d3Smrg $run $mkdir "$my_xdir" 33632b578d3Smrg exit_status=$? 33732b578d3Smrg if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then 33832b578d3Smrg exit $exit_status 33932b578d3Smrg fi 34032b578d3Smrg case $host in 34132b578d3Smrg *-darwin*) 34232b578d3Smrg $show "Extracting $my_xabs" 34332b578d3Smrg # Do not bother doing anything if just a dry run 34432b578d3Smrg if test -z "$run"; then 34532b578d3Smrg darwin_orig_dir=`pwd` 34632b578d3Smrg cd $my_xdir || exit $? 34732b578d3Smrg darwin_archive=$my_xabs 34832b578d3Smrg darwin_curdir=`pwd` 34932b578d3Smrg darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` 35032b578d3Smrg darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` 35132b578d3Smrg if test -n "$darwin_arches"; then 35232b578d3Smrg darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` 35332b578d3Smrg darwin_arch= 35432b578d3Smrg $show "$darwin_base_archive has multiple architectures $darwin_arches" 35532b578d3Smrg for darwin_arch in $darwin_arches ; do 35632b578d3Smrg mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" 35732b578d3Smrg lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" 35832b578d3Smrg cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" 35932b578d3Smrg func_extract_an_archive "`pwd`" "${darwin_base_archive}" 36032b578d3Smrg cd "$darwin_curdir" 36132b578d3Smrg $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" 36232b578d3Smrg done # $darwin_arches 36332b578d3Smrg ## Okay now we have a bunch of thin objects, gotta fatten them up :) 36432b578d3Smrg darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` 36532b578d3Smrg darwin_file= 36632b578d3Smrg darwin_files= 36732b578d3Smrg for darwin_file in $darwin_filelist; do 36832b578d3Smrg darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` 36932b578d3Smrg lipo -create -output "$darwin_file" $darwin_files 37032b578d3Smrg done # $darwin_filelist 37132b578d3Smrg ${rm}r unfat-$$ 37232b578d3Smrg cd "$darwin_orig_dir" 37332b578d3Smrg else 37432b578d3Smrg cd "$darwin_orig_dir" 37532b578d3Smrg func_extract_an_archive "$my_xdir" "$my_xabs" 37632b578d3Smrg fi # $darwin_arches 37732b578d3Smrg fi # $run 37832b578d3Smrg ;; 37932b578d3Smrg *) 38032b578d3Smrg func_extract_an_archive "$my_xdir" "$my_xabs" 38132b578d3Smrg ;; 38232b578d3Smrg esac 38332b578d3Smrg my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` 38432b578d3Smrg done 38532b578d3Smrg func_extract_archives_result="$my_oldobjs" 38632b578d3Smrg} 38732b578d3Smrg# End of Shell function definitions 38832b578d3Smrg##################################### 38932b578d3Smrg 39032b578d3Smrg# Darwin sucks 39132b578d3Smrgeval std_shrext=\"$shrext_cmds\" 39232b578d3Smrg 39332b578d3Smrgdisable_libs=no 39432b578d3Smrg 39532b578d3Smrg# Parse our command line options once, thoroughly. 39632b578d3Smrgwhile test "$#" -gt 0 39732b578d3Smrgdo 39832b578d3Smrg arg="$1" 39932b578d3Smrg shift 40032b578d3Smrg 40132b578d3Smrg case $arg in 40232b578d3Smrg -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; 40332b578d3Smrg *) optarg= ;; 40432b578d3Smrg esac 40532b578d3Smrg 40632b578d3Smrg # If the previous option needs an argument, assign it. 40732b578d3Smrg if test -n "$prev"; then 40832b578d3Smrg case $prev in 40932b578d3Smrg execute_dlfiles) 41032b578d3Smrg execute_dlfiles="$execute_dlfiles $arg" 41132b578d3Smrg ;; 41232b578d3Smrg tag) 41332b578d3Smrg tagname="$arg" 41432b578d3Smrg preserve_args="${preserve_args}=$arg" 41532b578d3Smrg 41632b578d3Smrg # Check whether tagname contains only valid characters 41732b578d3Smrg case $tagname in 41832b578d3Smrg *[!-_A-Za-z0-9,/]*) 41932b578d3Smrg $echo "$progname: invalid tag name: $tagname" 1>&2 42032b578d3Smrg exit $EXIT_FAILURE 42132b578d3Smrg ;; 42232b578d3Smrg esac 42332b578d3Smrg 42432b578d3Smrg case $tagname in 42532b578d3Smrg CC) 42632b578d3Smrg # Don't test for the "default" C tag, as we know, it's there, but 42732b578d3Smrg # not specially marked. 42832b578d3Smrg ;; 42932b578d3Smrg *) 43032b578d3Smrg if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then 43132b578d3Smrg taglist="$taglist $tagname" 43232b578d3Smrg # Evaluate the configuration. 43332b578d3Smrg eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" 43432b578d3Smrg else 43532b578d3Smrg $echo "$progname: ignoring unknown tag $tagname" 1>&2 43632b578d3Smrg fi 43732b578d3Smrg ;; 43832b578d3Smrg esac 43932b578d3Smrg ;; 44032b578d3Smrg *) 44132b578d3Smrg eval "$prev=\$arg" 44232b578d3Smrg ;; 44332b578d3Smrg esac 44432b578d3Smrg 44532b578d3Smrg prev= 44632b578d3Smrg prevopt= 44732b578d3Smrg continue 44832b578d3Smrg fi 44932b578d3Smrg 45032b578d3Smrg # Have we seen a non-optional argument yet? 45132b578d3Smrg case $arg in 45232b578d3Smrg --help) 45332b578d3Smrg show_help=yes 45432b578d3Smrg ;; 45532b578d3Smrg 45632b578d3Smrg --version) 457d31dbc53Smrg $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" 458d31dbc53Smrg $echo 459d31dbc53Smrg $echo "Copyright (C) 2005 Free Software Foundation, Inc." 460d31dbc53Smrg $echo "This is free software; see the source for copying conditions. There is NO" 461d31dbc53Smrg $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 46232b578d3Smrg exit $? 46332b578d3Smrg ;; 46432b578d3Smrg 46532b578d3Smrg --config) 46632b578d3Smrg ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath 46732b578d3Smrg # Now print the configurations for the tags. 46832b578d3Smrg for tagname in $taglist; do 46932b578d3Smrg ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" 47032b578d3Smrg done 47132b578d3Smrg exit $? 47232b578d3Smrg ;; 47332b578d3Smrg 47432b578d3Smrg --debug) 47532b578d3Smrg $echo "$progname: enabling shell trace mode" 47632b578d3Smrg set -x 47732b578d3Smrg preserve_args="$preserve_args $arg" 47832b578d3Smrg ;; 47932b578d3Smrg 48032b578d3Smrg --dry-run | -n) 48132b578d3Smrg run=: 48232b578d3Smrg ;; 48332b578d3Smrg 48432b578d3Smrg --features) 48532b578d3Smrg $echo "host: $host" 48632b578d3Smrg if test "$build_libtool_libs" = yes; then 48732b578d3Smrg $echo "enable shared libraries" 48832b578d3Smrg else 48932b578d3Smrg $echo "disable shared libraries" 49032b578d3Smrg fi 49132b578d3Smrg if test "$build_old_libs" = yes; then 49232b578d3Smrg $echo "enable static libraries" 49332b578d3Smrg else 49432b578d3Smrg $echo "disable static libraries" 49532b578d3Smrg fi 49632b578d3Smrg exit $? 49732b578d3Smrg ;; 49832b578d3Smrg 49932b578d3Smrg --finish) mode="finish" ;; 50032b578d3Smrg 50132b578d3Smrg --mode) prevopt="--mode" prev=mode ;; 50232b578d3Smrg --mode=*) mode="$optarg" ;; 50332b578d3Smrg 50432b578d3Smrg --preserve-dup-deps) duplicate_deps="yes" ;; 50532b578d3Smrg 50632b578d3Smrg --quiet | --silent) 50732b578d3Smrg show=: 50832b578d3Smrg preserve_args="$preserve_args $arg" 50932b578d3Smrg ;; 51032b578d3Smrg 51132b578d3Smrg --tag) 51232b578d3Smrg prevopt="--tag" 51332b578d3Smrg prev=tag 51432b578d3Smrg preserve_args="$preserve_args --tag" 51532b578d3Smrg ;; 51632b578d3Smrg --tag=*) 51732b578d3Smrg set tag "$optarg" ${1+"$@"} 51832b578d3Smrg shift 51932b578d3Smrg prev=tag 52032b578d3Smrg preserve_args="$preserve_args --tag" 52132b578d3Smrg ;; 52232b578d3Smrg 52332b578d3Smrg -dlopen) 52432b578d3Smrg prevopt="-dlopen" 52532b578d3Smrg prev=execute_dlfiles 52632b578d3Smrg ;; 52732b578d3Smrg 52832b578d3Smrg -*) 52932b578d3Smrg $echo "$modename: unrecognized option \`$arg'" 1>&2 53032b578d3Smrg $echo "$help" 1>&2 53132b578d3Smrg exit $EXIT_FAILURE 53232b578d3Smrg ;; 53332b578d3Smrg 53432b578d3Smrg *) 53532b578d3Smrg nonopt="$arg" 53632b578d3Smrg break 53732b578d3Smrg ;; 53832b578d3Smrg esac 53932b578d3Smrgdone 54032b578d3Smrg 54132b578d3Smrgif test -n "$prevopt"; then 54232b578d3Smrg $echo "$modename: option \`$prevopt' requires an argument" 1>&2 54332b578d3Smrg $echo "$help" 1>&2 54432b578d3Smrg exit $EXIT_FAILURE 54532b578d3Smrgfi 54632b578d3Smrg 54732b578d3Smrgcase $disable_libs in 54832b578d3Smrgno) 54932b578d3Smrg ;; 55032b578d3Smrgshared) 55132b578d3Smrg build_libtool_libs=no 55232b578d3Smrg build_old_libs=yes 55332b578d3Smrg ;; 55432b578d3Smrgstatic) 55532b578d3Smrg build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` 55632b578d3Smrg ;; 55732b578d3Smrgesac 55832b578d3Smrg 55932b578d3Smrg# If this variable is set in any of the actions, the command in it 56032b578d3Smrg# will be execed at the end. This prevents here-documents from being 56132b578d3Smrg# left over by shells. 56232b578d3Smrgexec_cmd= 56332b578d3Smrg 56432b578d3Smrgif test -z "$show_help"; then 56532b578d3Smrg 56632b578d3Smrg # Infer the operation mode. 56732b578d3Smrg if test -z "$mode"; then 56832b578d3Smrg $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 56932b578d3Smrg $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 57032b578d3Smrg case $nonopt in 57132b578d3Smrg *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) 57232b578d3Smrg mode=link 57332b578d3Smrg for arg 57432b578d3Smrg do 57532b578d3Smrg case $arg in 57632b578d3Smrg -c) 57732b578d3Smrg mode=compile 57832b578d3Smrg break 57932b578d3Smrg ;; 58032b578d3Smrg esac 58132b578d3Smrg done 58232b578d3Smrg ;; 58332b578d3Smrg *db | *dbx | *strace | *truss) 58432b578d3Smrg mode=execute 58532b578d3Smrg ;; 58632b578d3Smrg *install*|cp|mv) 58732b578d3Smrg mode=install 58832b578d3Smrg ;; 58932b578d3Smrg *rm) 59032b578d3Smrg mode=uninstall 59132b578d3Smrg ;; 59232b578d3Smrg *) 59332b578d3Smrg # If we have no mode, but dlfiles were specified, then do execute mode. 59432b578d3Smrg test -n "$execute_dlfiles" && mode=execute 59532b578d3Smrg 59632b578d3Smrg # Just use the default operation mode. 59732b578d3Smrg if test -z "$mode"; then 59832b578d3Smrg if test -n "$nonopt"; then 59932b578d3Smrg $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 60032b578d3Smrg else 60132b578d3Smrg $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 60232b578d3Smrg fi 60332b578d3Smrg fi 60432b578d3Smrg ;; 60532b578d3Smrg esac 60632b578d3Smrg fi 60732b578d3Smrg 60832b578d3Smrg # Only execute mode is allowed to have -dlopen flags. 60932b578d3Smrg if test -n "$execute_dlfiles" && test "$mode" != execute; then 61032b578d3Smrg $echo "$modename: unrecognized option \`-dlopen'" 1>&2 61132b578d3Smrg $echo "$help" 1>&2 61232b578d3Smrg exit $EXIT_FAILURE 61332b578d3Smrg fi 61432b578d3Smrg 61532b578d3Smrg # Change the help message to a mode-specific one. 61632b578d3Smrg generic_help="$help" 61732b578d3Smrg help="Try \`$modename --help --mode=$mode' for more information." 61832b578d3Smrg 61932b578d3Smrg # These modes are in order of execution frequency so that they run quickly. 62032b578d3Smrg case $mode in 62132b578d3Smrg # libtool compile mode 62232b578d3Smrg compile) 62332b578d3Smrg modename="$modename: compile" 62432b578d3Smrg # Get the compilation command and the source file. 62532b578d3Smrg base_compile= 62632b578d3Smrg srcfile="$nonopt" # always keep a non-empty value in "srcfile" 62732b578d3Smrg suppress_opt=yes 62832b578d3Smrg suppress_output= 62932b578d3Smrg arg_mode=normal 63032b578d3Smrg libobj= 63132b578d3Smrg later= 63232b578d3Smrg 63332b578d3Smrg for arg 63432b578d3Smrg do 63532b578d3Smrg case $arg_mode in 63632b578d3Smrg arg ) 63732b578d3Smrg # do not "continue". Instead, add this to base_compile 63832b578d3Smrg lastarg="$arg" 63932b578d3Smrg arg_mode=normal 64032b578d3Smrg ;; 64132b578d3Smrg 64232b578d3Smrg target ) 64332b578d3Smrg libobj="$arg" 64432b578d3Smrg arg_mode=normal 64532b578d3Smrg continue 64632b578d3Smrg ;; 64732b578d3Smrg 64832b578d3Smrg normal ) 64932b578d3Smrg # Accept any command-line options. 65032b578d3Smrg case $arg in 65132b578d3Smrg -o) 65232b578d3Smrg if test -n "$libobj" ; then 65332b578d3Smrg $echo "$modename: you cannot specify \`-o' more than once" 1>&2 65432b578d3Smrg exit $EXIT_FAILURE 65532b578d3Smrg fi 65632b578d3Smrg arg_mode=target 65732b578d3Smrg continue 65832b578d3Smrg ;; 65932b578d3Smrg 66032b578d3Smrg -static | -prefer-pic | -prefer-non-pic) 66132b578d3Smrg later="$later $arg" 66232b578d3Smrg continue 66332b578d3Smrg ;; 66432b578d3Smrg 66532b578d3Smrg -no-suppress) 66632b578d3Smrg suppress_opt=no 66732b578d3Smrg continue 66832b578d3Smrg ;; 66932b578d3Smrg 67032b578d3Smrg -Xcompiler) 67132b578d3Smrg arg_mode=arg # the next one goes into the "base_compile" arg list 67232b578d3Smrg continue # The current "srcfile" will either be retained or 67332b578d3Smrg ;; # replaced later. I would guess that would be a bug. 67432b578d3Smrg 67532b578d3Smrg -Wc,*) 67632b578d3Smrg args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` 67732b578d3Smrg lastarg= 67832b578d3Smrg save_ifs="$IFS"; IFS=',' 67932b578d3Smrg for arg in $args; do 68032b578d3Smrg IFS="$save_ifs" 68132b578d3Smrg 68232b578d3Smrg # Double-quote args containing other shell metacharacters. 68332b578d3Smrg # Many Bourne shells cannot handle close brackets correctly 68432b578d3Smrg # in scan sets, so we specify it separately. 68532b578d3Smrg case $arg in 68632b578d3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 68732b578d3Smrg arg="\"$arg\"" 68832b578d3Smrg ;; 68932b578d3Smrg esac 69032b578d3Smrg lastarg="$lastarg $arg" 69132b578d3Smrg done 69232b578d3Smrg IFS="$save_ifs" 69332b578d3Smrg lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` 69432b578d3Smrg 69532b578d3Smrg # Add the arguments to base_compile. 69632b578d3Smrg base_compile="$base_compile $lastarg" 69732b578d3Smrg continue 69832b578d3Smrg ;; 69932b578d3Smrg 70032b578d3Smrg * ) 70132b578d3Smrg # Accept the current argument as the source file. 70232b578d3Smrg # The previous "srcfile" becomes the current argument. 70332b578d3Smrg # 70432b578d3Smrg lastarg="$srcfile" 70532b578d3Smrg srcfile="$arg" 70632b578d3Smrg ;; 70732b578d3Smrg esac # case $arg 70832b578d3Smrg ;; 70932b578d3Smrg esac # case $arg_mode 71032b578d3Smrg 71132b578d3Smrg # Aesthetically quote the previous argument. 71232b578d3Smrg lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` 71332b578d3Smrg 71432b578d3Smrg case $lastarg in 71532b578d3Smrg # Double-quote args containing other shell metacharacters. 71632b578d3Smrg # Many Bourne shells cannot handle close brackets correctly 71732b578d3Smrg # in scan sets, and some SunOS ksh mistreat backslash-escaping 71832b578d3Smrg # in scan sets (worked around with variable expansion), 71932b578d3Smrg # and furthermore cannot handle '|' '&' '(' ')' in scan sets 72032b578d3Smrg # at all, so we specify them separately. 72132b578d3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 72232b578d3Smrg lastarg="\"$lastarg\"" 72332b578d3Smrg ;; 72432b578d3Smrg esac 72532b578d3Smrg 72632b578d3Smrg base_compile="$base_compile $lastarg" 72732b578d3Smrg done # for arg 72832b578d3Smrg 72932b578d3Smrg case $arg_mode in 73032b578d3Smrg arg) 73132b578d3Smrg $echo "$modename: you must specify an argument for -Xcompile" 73232b578d3Smrg exit $EXIT_FAILURE 73332b578d3Smrg ;; 73432b578d3Smrg target) 73532b578d3Smrg $echo "$modename: you must specify a target with \`-o'" 1>&2 73632b578d3Smrg exit $EXIT_FAILURE 73732b578d3Smrg ;; 73832b578d3Smrg *) 73932b578d3Smrg # Get the name of the library object. 74032b578d3Smrg [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` 74132b578d3Smrg ;; 74232b578d3Smrg esac 74332b578d3Smrg 74432b578d3Smrg # Recognize several different file suffixes. 74532b578d3Smrg # If the user specifies -o file.o, it is replaced with file.lo 74632b578d3Smrg xform='[cCFSifmso]' 74732b578d3Smrg case $libobj in 74832b578d3Smrg *.ada) xform=ada ;; 74932b578d3Smrg *.adb) xform=adb ;; 75032b578d3Smrg *.ads) xform=ads ;; 75132b578d3Smrg *.asm) xform=asm ;; 75232b578d3Smrg *.c++) xform=c++ ;; 75332b578d3Smrg *.cc) xform=cc ;; 75432b578d3Smrg *.ii) xform=ii ;; 75532b578d3Smrg *.class) xform=class ;; 75632b578d3Smrg *.cpp) xform=cpp ;; 75732b578d3Smrg *.cxx) xform=cxx ;; 758d31dbc53Smrg *.f90) xform=f90 ;; 75932b578d3Smrg *.for) xform=for ;; 76032b578d3Smrg *.java) xform=java ;; 76132b578d3Smrg esac 76232b578d3Smrg 76332b578d3Smrg libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` 76432b578d3Smrg 76532b578d3Smrg case $libobj in 76632b578d3Smrg *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; 76732b578d3Smrg *) 76832b578d3Smrg $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 76932b578d3Smrg exit $EXIT_FAILURE 77032b578d3Smrg ;; 77132b578d3Smrg esac 77232b578d3Smrg 77332b578d3Smrg func_infer_tag $base_compile 77432b578d3Smrg 77532b578d3Smrg for arg in $later; do 77632b578d3Smrg case $arg in 77732b578d3Smrg -static) 77832b578d3Smrg build_old_libs=yes 77932b578d3Smrg continue 78032b578d3Smrg ;; 78132b578d3Smrg 78232b578d3Smrg -prefer-pic) 78332b578d3Smrg pic_mode=yes 78432b578d3Smrg continue 78532b578d3Smrg ;; 78632b578d3Smrg 78732b578d3Smrg -prefer-non-pic) 78832b578d3Smrg pic_mode=no 78932b578d3Smrg continue 79032b578d3Smrg ;; 79132b578d3Smrg esac 79232b578d3Smrg done 79332b578d3Smrg 79432b578d3Smrg qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` 79532b578d3Smrg case $qlibobj in 79632b578d3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 79732b578d3Smrg qlibobj="\"$qlibobj\"" ;; 79832b578d3Smrg esac 79932b578d3Smrg test "X$libobj" != "X$qlibobj" \ 80032b578d3Smrg && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ 80132b578d3Smrg && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." 80232b578d3Smrg objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` 80332b578d3Smrg xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` 80432b578d3Smrg if test "X$xdir" = "X$obj"; then 80532b578d3Smrg xdir= 80632b578d3Smrg else 80732b578d3Smrg xdir=$xdir/ 80832b578d3Smrg fi 80932b578d3Smrg lobj=${xdir}$objdir/$objname 81032b578d3Smrg 81132b578d3Smrg if test -z "$base_compile"; then 81232b578d3Smrg $echo "$modename: you must specify a compilation command" 1>&2 81332b578d3Smrg $echo "$help" 1>&2 81432b578d3Smrg exit $EXIT_FAILURE 81532b578d3Smrg fi 81632b578d3Smrg 81732b578d3Smrg # Delete any leftover library objects. 81832b578d3Smrg if test "$build_old_libs" = yes; then 81932b578d3Smrg removelist="$obj $lobj $libobj ${libobj}T" 82032b578d3Smrg else 82132b578d3Smrg removelist="$lobj $libobj ${libobj}T" 82232b578d3Smrg fi 82332b578d3Smrg 82432b578d3Smrg $run $rm $removelist 82532b578d3Smrg trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 82632b578d3Smrg 82732b578d3Smrg # On Cygwin there's no "real" PIC flag so we must build both object types 82832b578d3Smrg case $host_os in 82932b578d3Smrg cygwin* | mingw* | pw32* | os2*) 83032b578d3Smrg pic_mode=default 83132b578d3Smrg ;; 83232b578d3Smrg esac 83332b578d3Smrg if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then 83432b578d3Smrg # non-PIC code in shared libraries is not supported 83532b578d3Smrg pic_mode=default 83632b578d3Smrg fi 83732b578d3Smrg 83832b578d3Smrg # Calculate the filename of the output object if compiler does 83932b578d3Smrg # not support -o with -c 84032b578d3Smrg if test "$compiler_c_o" = no; then 84132b578d3Smrg output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} 84232b578d3Smrg lockfile="$output_obj.lock" 84332b578d3Smrg removelist="$removelist $output_obj $lockfile" 84432b578d3Smrg trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 84532b578d3Smrg else 84632b578d3Smrg output_obj= 84732b578d3Smrg need_locks=no 84832b578d3Smrg lockfile= 84932b578d3Smrg fi 85032b578d3Smrg 85132b578d3Smrg # Lock this critical section if it is needed 85232b578d3Smrg # We use this script file to make the link, it avoids creating a new file 85332b578d3Smrg if test "$need_locks" = yes; then 85432b578d3Smrg until $run ln "$progpath" "$lockfile" 2>/dev/null; do 85532b578d3Smrg $show "Waiting for $lockfile to be removed" 85632b578d3Smrg sleep 2 85732b578d3Smrg done 85832b578d3Smrg elif test "$need_locks" = warn; then 85932b578d3Smrg if test -f "$lockfile"; then 86032b578d3Smrg $echo "\ 86132b578d3Smrg*** ERROR, $lockfile exists and contains: 86232b578d3Smrg`cat $lockfile 2>/dev/null` 86332b578d3Smrg 86432b578d3SmrgThis indicates that another process is trying to use the same 86532b578d3Smrgtemporary object file, and libtool could not work around it because 86632b578d3Smrgyour compiler does not support \`-c' and \`-o' together. If you 86732b578d3Smrgrepeat this compilation, it may succeed, by chance, but you had better 86832b578d3Smrgavoid parallel builds (make -j) in this platform, or get a better 86932b578d3Smrgcompiler." 87032b578d3Smrg 87132b578d3Smrg $run $rm $removelist 87232b578d3Smrg exit $EXIT_FAILURE 87332b578d3Smrg fi 87432b578d3Smrg $echo "$srcfile" > "$lockfile" 87532b578d3Smrg fi 87632b578d3Smrg 87732b578d3Smrg if test -n "$fix_srcfile_path"; then 87832b578d3Smrg eval srcfile=\"$fix_srcfile_path\" 87932b578d3Smrg fi 88032b578d3Smrg qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` 88132b578d3Smrg case $qsrcfile in 88232b578d3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 88332b578d3Smrg qsrcfile="\"$qsrcfile\"" ;; 88432b578d3Smrg esac 88532b578d3Smrg 88632b578d3Smrg $run $rm "$libobj" "${libobj}T" 88732b578d3Smrg 88832b578d3Smrg # Create a libtool object file (analogous to a ".la" file), 88932b578d3Smrg # but don't create it if we're doing a dry run. 89032b578d3Smrg test -z "$run" && cat > ${libobj}T <<EOF 89132b578d3Smrg# $libobj - a libtool object file 89232b578d3Smrg# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP 89332b578d3Smrg# 89432b578d3Smrg# Please DO NOT delete this file! 89532b578d3Smrg# It is necessary for linking the library. 89632b578d3Smrg 89732b578d3Smrg# Name of the PIC object. 89832b578d3SmrgEOF 89932b578d3Smrg 90032b578d3Smrg # Only build a PIC object if we are building libtool libraries. 90132b578d3Smrg if test "$build_libtool_libs" = yes; then 90232b578d3Smrg # Without this assignment, base_compile gets emptied. 90332b578d3Smrg fbsd_hideous_sh_bug=$base_compile 90432b578d3Smrg 90532b578d3Smrg if test "$pic_mode" != no; then 90632b578d3Smrg command="$base_compile $qsrcfile $pic_flag" 90732b578d3Smrg else 90832b578d3Smrg # Don't build PIC code 90932b578d3Smrg command="$base_compile $qsrcfile" 91032b578d3Smrg fi 91132b578d3Smrg 91232b578d3Smrg if test ! -d "${xdir}$objdir"; then 91332b578d3Smrg $show "$mkdir ${xdir}$objdir" 91432b578d3Smrg $run $mkdir ${xdir}$objdir 91532b578d3Smrg exit_status=$? 91632b578d3Smrg if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then 91732b578d3Smrg exit $exit_status 91832b578d3Smrg fi 91932b578d3Smrg fi 92032b578d3Smrg 92132b578d3Smrg if test -z "$output_obj"; then 92232b578d3Smrg # Place PIC objects in $objdir 92332b578d3Smrg command="$command -o $lobj" 92432b578d3Smrg fi 92532b578d3Smrg 92632b578d3Smrg $run $rm "$lobj" "$output_obj" 92732b578d3Smrg 92832b578d3Smrg $show "$command" 92932b578d3Smrg if $run eval "$command"; then : 93032b578d3Smrg else 93132b578d3Smrg test -n "$output_obj" && $run $rm $removelist 93232b578d3Smrg exit $EXIT_FAILURE 93332b578d3Smrg fi 93432b578d3Smrg 93532b578d3Smrg if test "$need_locks" = warn && 93632b578d3Smrg test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then 93732b578d3Smrg $echo "\ 93832b578d3Smrg*** ERROR, $lockfile contains: 93932b578d3Smrg`cat $lockfile 2>/dev/null` 94032b578d3Smrg 94132b578d3Smrgbut it should contain: 94232b578d3Smrg$srcfile 94332b578d3Smrg 94432b578d3SmrgThis indicates that another process is trying to use the same 94532b578d3Smrgtemporary object file, and libtool could not work around it because 94632b578d3Smrgyour compiler does not support \`-c' and \`-o' together. If you 94732b578d3Smrgrepeat this compilation, it may succeed, by chance, but you had better 94832b578d3Smrgavoid parallel builds (make -j) in this platform, or get a better 94932b578d3Smrgcompiler." 95032b578d3Smrg 95132b578d3Smrg $run $rm $removelist 95232b578d3Smrg exit $EXIT_FAILURE 95332b578d3Smrg fi 95432b578d3Smrg 95532b578d3Smrg # Just move the object if needed, then go on to compile the next one 95632b578d3Smrg if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then 95732b578d3Smrg $show "$mv $output_obj $lobj" 95832b578d3Smrg if $run $mv $output_obj $lobj; then : 95932b578d3Smrg else 96032b578d3Smrg error=$? 96132b578d3Smrg $run $rm $removelist 96232b578d3Smrg exit $error 96332b578d3Smrg fi 96432b578d3Smrg fi 96532b578d3Smrg 96632b578d3Smrg # Append the name of the PIC object to the libtool object file. 96732b578d3Smrg test -z "$run" && cat >> ${libobj}T <<EOF 96832b578d3Smrgpic_object='$objdir/$objname' 96932b578d3Smrg 97032b578d3SmrgEOF 97132b578d3Smrg 97232b578d3Smrg # Allow error messages only from the first compilation. 97332b578d3Smrg if test "$suppress_opt" = yes; then 97432b578d3Smrg suppress_output=' >/dev/null 2>&1' 97532b578d3Smrg fi 97632b578d3Smrg else 97732b578d3Smrg # No PIC object so indicate it doesn't exist in the libtool 97832b578d3Smrg # object file. 97932b578d3Smrg test -z "$run" && cat >> ${libobj}T <<EOF 98032b578d3Smrgpic_object=none 98132b578d3Smrg 98232b578d3SmrgEOF 98332b578d3Smrg fi 98432b578d3Smrg 98532b578d3Smrg # Only build a position-dependent object if we build old libraries. 98632b578d3Smrg if test "$build_old_libs" = yes; then 98732b578d3Smrg if test "$pic_mode" != yes; then 98832b578d3Smrg # Don't build PIC code 98932b578d3Smrg command="$base_compile $qsrcfile" 99032b578d3Smrg else 99132b578d3Smrg command="$base_compile $qsrcfile $pic_flag" 99232b578d3Smrg fi 99332b578d3Smrg if test "$compiler_c_o" = yes; then 99432b578d3Smrg command="$command -o $obj" 99532b578d3Smrg fi 99632b578d3Smrg 99732b578d3Smrg # Suppress compiler output if we already did a PIC compilation. 99832b578d3Smrg command="$command$suppress_output" 99932b578d3Smrg $run $rm "$obj" "$output_obj" 100032b578d3Smrg $show "$command" 100132b578d3Smrg if $run eval "$command"; then : 100232b578d3Smrg else 100332b578d3Smrg $run $rm $removelist 100432b578d3Smrg exit $EXIT_FAILURE 100532b578d3Smrg fi 100632b578d3Smrg 100732b578d3Smrg if test "$need_locks" = warn && 100832b578d3Smrg test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then 100932b578d3Smrg $echo "\ 101032b578d3Smrg*** ERROR, $lockfile contains: 101132b578d3Smrg`cat $lockfile 2>/dev/null` 101232b578d3Smrg 101332b578d3Smrgbut it should contain: 101432b578d3Smrg$srcfile 101532b578d3Smrg 101632b578d3SmrgThis indicates that another process is trying to use the same 101732b578d3Smrgtemporary object file, and libtool could not work around it because 101832b578d3Smrgyour compiler does not support \`-c' and \`-o' together. If you 101932b578d3Smrgrepeat this compilation, it may succeed, by chance, but you had better 102032b578d3Smrgavoid parallel builds (make -j) in this platform, or get a better 102132b578d3Smrgcompiler." 102232b578d3Smrg 102332b578d3Smrg $run $rm $removelist 102432b578d3Smrg exit $EXIT_FAILURE 102532b578d3Smrg fi 102632b578d3Smrg 102732b578d3Smrg # Just move the object if needed 102832b578d3Smrg if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then 102932b578d3Smrg $show "$mv $output_obj $obj" 103032b578d3Smrg if $run $mv $output_obj $obj; then : 103132b578d3Smrg else 103232b578d3Smrg error=$? 103332b578d3Smrg $run $rm $removelist 103432b578d3Smrg exit $error 103532b578d3Smrg fi 103632b578d3Smrg fi 103732b578d3Smrg 103832b578d3Smrg # Append the name of the non-PIC object the libtool object file. 103932b578d3Smrg # Only append if the libtool object file exists. 104032b578d3Smrg test -z "$run" && cat >> ${libobj}T <<EOF 104132b578d3Smrg# Name of the non-PIC object. 104232b578d3Smrgnon_pic_object='$objname' 104332b578d3Smrg 104432b578d3SmrgEOF 104532b578d3Smrg else 104632b578d3Smrg # Append the name of the non-PIC object the libtool object file. 104732b578d3Smrg # Only append if the libtool object file exists. 104832b578d3Smrg test -z "$run" && cat >> ${libobj}T <<EOF 104932b578d3Smrg# Name of the non-PIC object. 105032b578d3Smrgnon_pic_object=none 105132b578d3Smrg 105232b578d3SmrgEOF 105332b578d3Smrg fi 105432b578d3Smrg 105532b578d3Smrg $run $mv "${libobj}T" "${libobj}" 105632b578d3Smrg 105732b578d3Smrg # Unlock the critical section if it was locked 105832b578d3Smrg if test "$need_locks" != no; then 105932b578d3Smrg $run $rm "$lockfile" 106032b578d3Smrg fi 106132b578d3Smrg 106232b578d3Smrg exit $EXIT_SUCCESS 106332b578d3Smrg ;; 106432b578d3Smrg 106532b578d3Smrg # libtool link mode 106632b578d3Smrg link | relink) 106732b578d3Smrg modename="$modename: link" 106832b578d3Smrg case $host in 106932b578d3Smrg *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) 107032b578d3Smrg # It is impossible to link a dll without this setting, and 107132b578d3Smrg # we shouldn't force the makefile maintainer to figure out 107232b578d3Smrg # which system we are compiling for in order to pass an extra 107332b578d3Smrg # flag for every libtool invocation. 107432b578d3Smrg # allow_undefined=no 107532b578d3Smrg 107632b578d3Smrg # FIXME: Unfortunately, there are problems with the above when trying 107732b578d3Smrg # to make a dll which has undefined symbols, in which case not 107832b578d3Smrg # even a static library is built. For now, we need to specify 107932b578d3Smrg # -no-undefined on the libtool link line when we can be certain 108032b578d3Smrg # that all symbols are satisfied, otherwise we get a static library. 108132b578d3Smrg allow_undefined=yes 108232b578d3Smrg ;; 108332b578d3Smrg *) 108432b578d3Smrg allow_undefined=yes 108532b578d3Smrg ;; 108632b578d3Smrg esac 108732b578d3Smrg libtool_args="$nonopt" 108832b578d3Smrg base_compile="$nonopt $@" 108932b578d3Smrg compile_command="$nonopt" 109032b578d3Smrg finalize_command="$nonopt" 109132b578d3Smrg 109232b578d3Smrg compile_rpath= 109332b578d3Smrg finalize_rpath= 109432b578d3Smrg compile_shlibpath= 109532b578d3Smrg finalize_shlibpath= 109632b578d3Smrg convenience= 109732b578d3Smrg old_convenience= 109832b578d3Smrg deplibs= 109932b578d3Smrg old_deplibs= 110032b578d3Smrg compiler_flags= 110132b578d3Smrg linker_flags= 110232b578d3Smrg dllsearchpath= 110332b578d3Smrg lib_search_path=`pwd` 110432b578d3Smrg inst_prefix_dir= 110532b578d3Smrg 110632b578d3Smrg avoid_version=no 110732b578d3Smrg dlfiles= 110832b578d3Smrg dlprefiles= 110932b578d3Smrg dlself=no 111032b578d3Smrg export_dynamic=no 111132b578d3Smrg export_symbols= 111232b578d3Smrg export_symbols_regex= 111332b578d3Smrg generated= 111432b578d3Smrg libobjs= 111532b578d3Smrg ltlibs= 111632b578d3Smrg module=no 111732b578d3Smrg no_install=no 111832b578d3Smrg objs= 111932b578d3Smrg non_pic_objects= 112032b578d3Smrg notinst_path= # paths that contain not-installed libtool libraries 112132b578d3Smrg precious_files_regex= 112232b578d3Smrg prefer_static_libs=no 112332b578d3Smrg preload=no 112432b578d3Smrg prev= 112532b578d3Smrg prevarg= 112632b578d3Smrg release= 112732b578d3Smrg rpath= 112832b578d3Smrg xrpath= 112932b578d3Smrg perm_rpath= 113032b578d3Smrg temp_rpath= 113132b578d3Smrg thread_safe=no 113232b578d3Smrg vinfo= 113332b578d3Smrg vinfo_number=no 113432b578d3Smrg 113532b578d3Smrg func_infer_tag $base_compile 113632b578d3Smrg 113732b578d3Smrg # We need to know -static, to get the right output filenames. 113832b578d3Smrg for arg 113932b578d3Smrg do 114032b578d3Smrg case $arg in 1141d31dbc53Smrg -all-static | -static) 1142d31dbc53Smrg if test "X$arg" = "X-all-static"; then 114332b578d3Smrg if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then 114432b578d3Smrg $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 114532b578d3Smrg fi 114632b578d3Smrg if test -n "$link_static_flag"; then 114732b578d3Smrg dlopen_self=$dlopen_self_static 114832b578d3Smrg fi 114932b578d3Smrg prefer_static_libs=yes 1150d31dbc53Smrg else 115132b578d3Smrg if test -z "$pic_flag" && test -n "$link_static_flag"; then 115232b578d3Smrg dlopen_self=$dlopen_self_static 115332b578d3Smrg fi 115432b578d3Smrg prefer_static_libs=built 1155d31dbc53Smrg fi 115632b578d3Smrg build_libtool_libs=no 115732b578d3Smrg build_old_libs=yes 115832b578d3Smrg break 115932b578d3Smrg ;; 116032b578d3Smrg esac 116132b578d3Smrg done 116232b578d3Smrg 116332b578d3Smrg # See if our shared archives depend on static archives. 116432b578d3Smrg test -n "$old_archive_from_new_cmds" && build_old_libs=yes 116532b578d3Smrg 116632b578d3Smrg # Go through the arguments, transforming them on the way. 116732b578d3Smrg while test "$#" -gt 0; do 116832b578d3Smrg arg="$1" 116932b578d3Smrg shift 117032b578d3Smrg case $arg in 117132b578d3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 117232b578d3Smrg qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test 117332b578d3Smrg ;; 117432b578d3Smrg *) qarg=$arg ;; 117532b578d3Smrg esac 117632b578d3Smrg libtool_args="$libtool_args $qarg" 117732b578d3Smrg 117832b578d3Smrg # If the previous option needs an argument, assign it. 117932b578d3Smrg if test -n "$prev"; then 118032b578d3Smrg case $prev in 118132b578d3Smrg output) 118232b578d3Smrg compile_command="$compile_command @OUTPUT@" 118332b578d3Smrg finalize_command="$finalize_command @OUTPUT@" 118432b578d3Smrg ;; 118532b578d3Smrg esac 118632b578d3Smrg 118732b578d3Smrg case $prev in 118832b578d3Smrg dlfiles|dlprefiles) 118932b578d3Smrg if test "$preload" = no; then 119032b578d3Smrg # Add the symbol object into the linking commands. 119132b578d3Smrg compile_command="$compile_command @SYMFILE@" 119232b578d3Smrg finalize_command="$finalize_command @SYMFILE@" 119332b578d3Smrg preload=yes 119432b578d3Smrg fi 119532b578d3Smrg case $arg in 119632b578d3Smrg *.la | *.lo) ;; # We handle these cases below. 119732b578d3Smrg force) 119832b578d3Smrg if test "$dlself" = no; then 119932b578d3Smrg dlself=needless 120032b578d3Smrg export_dynamic=yes 120132b578d3Smrg fi 120232b578d3Smrg prev= 120332b578d3Smrg continue 120432b578d3Smrg ;; 120532b578d3Smrg self) 120632b578d3Smrg if test "$prev" = dlprefiles; then 120732b578d3Smrg dlself=yes 120832b578d3Smrg elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then 120932b578d3Smrg dlself=yes 121032b578d3Smrg else 121132b578d3Smrg dlself=needless 121232b578d3Smrg export_dynamic=yes 121332b578d3Smrg fi 121432b578d3Smrg prev= 121532b578d3Smrg continue 121632b578d3Smrg ;; 121732b578d3Smrg *) 121832b578d3Smrg if test "$prev" = dlfiles; then 121932b578d3Smrg dlfiles="$dlfiles $arg" 122032b578d3Smrg else 122132b578d3Smrg dlprefiles="$dlprefiles $arg" 122232b578d3Smrg fi 122332b578d3Smrg prev= 122432b578d3Smrg continue 122532b578d3Smrg ;; 122632b578d3Smrg esac 122732b578d3Smrg ;; 122832b578d3Smrg expsyms) 122932b578d3Smrg export_symbols="$arg" 123032b578d3Smrg if test ! -f "$arg"; then 123132b578d3Smrg $echo "$modename: symbol file \`$arg' does not exist" 123232b578d3Smrg exit $EXIT_FAILURE 123332b578d3Smrg fi 123432b578d3Smrg prev= 123532b578d3Smrg continue 123632b578d3Smrg ;; 123732b578d3Smrg expsyms_regex) 123832b578d3Smrg export_symbols_regex="$arg" 123932b578d3Smrg prev= 124032b578d3Smrg continue 124132b578d3Smrg ;; 124232b578d3Smrg inst_prefix) 124332b578d3Smrg inst_prefix_dir="$arg" 124432b578d3Smrg prev= 124532b578d3Smrg continue 124632b578d3Smrg ;; 124732b578d3Smrg precious_regex) 124832b578d3Smrg precious_files_regex="$arg" 124932b578d3Smrg prev= 125032b578d3Smrg continue 125132b578d3Smrg ;; 125232b578d3Smrg release) 125332b578d3Smrg release="-$arg" 125432b578d3Smrg prev= 125532b578d3Smrg continue 125632b578d3Smrg ;; 125732b578d3Smrg objectlist) 125832b578d3Smrg if test -f "$arg"; then 125932b578d3Smrg save_arg=$arg 126032b578d3Smrg moreargs= 126132b578d3Smrg for fil in `cat $save_arg` 126232b578d3Smrg do 126332b578d3Smrg# moreargs="$moreargs $fil" 126432b578d3Smrg arg=$fil 126532b578d3Smrg # A libtool-controlled object. 126632b578d3Smrg 126732b578d3Smrg # Check to see that this really is a libtool object. 126832b578d3Smrg if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 126932b578d3Smrg pic_object= 127032b578d3Smrg non_pic_object= 127132b578d3Smrg 127232b578d3Smrg # Read the .lo file 127332b578d3Smrg # If there is no directory component, then add one. 127432b578d3Smrg case $arg in 127532b578d3Smrg */* | *\\*) . $arg ;; 127632b578d3Smrg *) . ./$arg ;; 127732b578d3Smrg esac 127832b578d3Smrg 127932b578d3Smrg if test -z "$pic_object" || \ 128032b578d3Smrg test -z "$non_pic_object" || 128132b578d3Smrg test "$pic_object" = none && \ 128232b578d3Smrg test "$non_pic_object" = none; then 128332b578d3Smrg $echo "$modename: cannot find name of object for \`$arg'" 1>&2 128432b578d3Smrg exit $EXIT_FAILURE 128532b578d3Smrg fi 128632b578d3Smrg 128732b578d3Smrg # Extract subdirectory from the argument. 128832b578d3Smrg xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` 128932b578d3Smrg if test "X$xdir" = "X$arg"; then 129032b578d3Smrg xdir= 129132b578d3Smrg else 129232b578d3Smrg xdir="$xdir/" 129332b578d3Smrg fi 129432b578d3Smrg 129532b578d3Smrg if test "$pic_object" != none; then 129632b578d3Smrg # Prepend the subdirectory the object is found in. 129732b578d3Smrg pic_object="$xdir$pic_object" 129832b578d3Smrg 129932b578d3Smrg if test "$prev" = dlfiles; then 130032b578d3Smrg if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then 130132b578d3Smrg dlfiles="$dlfiles $pic_object" 130232b578d3Smrg prev= 130332b578d3Smrg continue 130432b578d3Smrg else 130532b578d3Smrg # If libtool objects are unsupported, then we need to preload. 130632b578d3Smrg prev=dlprefiles 130732b578d3Smrg fi 130832b578d3Smrg fi 130932b578d3Smrg 131032b578d3Smrg # CHECK ME: I think I busted this. -Ossama 131132b578d3Smrg if test "$prev" = dlprefiles; then 131232b578d3Smrg # Preload the old-style object. 131332b578d3Smrg dlprefiles="$dlprefiles $pic_object" 131432b578d3Smrg prev= 131532b578d3Smrg fi 131632b578d3Smrg 131732b578d3Smrg # A PIC object. 131832b578d3Smrg libobjs="$libobjs $pic_object" 131932b578d3Smrg arg="$pic_object" 132032b578d3Smrg fi 132132b578d3Smrg 132232b578d3Smrg # Non-PIC object. 132332b578d3Smrg if test "$non_pic_object" != none; then 132432b578d3Smrg # Prepend the subdirectory the object is found in. 132532b578d3Smrg non_pic_object="$xdir$non_pic_object" 132632b578d3Smrg 132732b578d3Smrg # A standard non-PIC object 132832b578d3Smrg non_pic_objects="$non_pic_objects $non_pic_object" 132932b578d3Smrg if test -z "$pic_object" || test "$pic_object" = none ; then 133032b578d3Smrg arg="$non_pic_object" 133132b578d3Smrg fi 133232b578d3Smrg else 133332b578d3Smrg # If the PIC object exists, use it instead. 133432b578d3Smrg # $xdir was prepended to $pic_object above. 133532b578d3Smrg non_pic_object="$pic_object" 133632b578d3Smrg non_pic_objects="$non_pic_objects $non_pic_object" 133732b578d3Smrg fi 133832b578d3Smrg else 133932b578d3Smrg # Only an error if not doing a dry-run. 134032b578d3Smrg if test -z "$run"; then 134132b578d3Smrg $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 134232b578d3Smrg exit $EXIT_FAILURE 134332b578d3Smrg else 134432b578d3Smrg # Dry-run case. 134532b578d3Smrg 134632b578d3Smrg # Extract subdirectory from the argument. 134732b578d3Smrg xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` 134832b578d3Smrg if test "X$xdir" = "X$arg"; then 134932b578d3Smrg xdir= 135032b578d3Smrg else 135132b578d3Smrg xdir="$xdir/" 135232b578d3Smrg fi 135332b578d3Smrg 135432b578d3Smrg pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` 135532b578d3Smrg non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` 135632b578d3Smrg libobjs="$libobjs $pic_object" 135732b578d3Smrg non_pic_objects="$non_pic_objects $non_pic_object" 135832b578d3Smrg fi 135932b578d3Smrg fi 136032b578d3Smrg done 136132b578d3Smrg else 136232b578d3Smrg $echo "$modename: link input file \`$save_arg' does not exist" 136332b578d3Smrg exit $EXIT_FAILURE 136432b578d3Smrg fi 136532b578d3Smrg arg=$save_arg 136632b578d3Smrg prev= 136732b578d3Smrg continue 136832b578d3Smrg ;; 136932b578d3Smrg rpath | xrpath) 137032b578d3Smrg # We need an absolute path. 137132b578d3Smrg case $arg in 137232b578d3Smrg [\\/]* | [A-Za-z]:[\\/]*) ;; 137332b578d3Smrg *) 137432b578d3Smrg $echo "$modename: only absolute run-paths are allowed" 1>&2 137532b578d3Smrg exit $EXIT_FAILURE 137632b578d3Smrg ;; 137732b578d3Smrg esac 137832b578d3Smrg if test "$prev" = rpath; then 137932b578d3Smrg case "$rpath " in 138032b578d3Smrg *" $arg "*) ;; 138132b578d3Smrg *) rpath="$rpath $arg" ;; 138232b578d3Smrg esac 138332b578d3Smrg else 138432b578d3Smrg case "$xrpath " in 138532b578d3Smrg *" $arg "*) ;; 138632b578d3Smrg *) xrpath="$xrpath $arg" ;; 138732b578d3Smrg esac 138832b578d3Smrg fi 138932b578d3Smrg prev= 139032b578d3Smrg continue 139132b578d3Smrg ;; 139232b578d3Smrg xcompiler) 139332b578d3Smrg compiler_flags="$compiler_flags $qarg" 139432b578d3Smrg prev= 139532b578d3Smrg compile_command="$compile_command $qarg" 139632b578d3Smrg finalize_command="$finalize_command $qarg" 139732b578d3Smrg continue 139832b578d3Smrg ;; 139932b578d3Smrg xlinker) 140032b578d3Smrg linker_flags="$linker_flags $qarg" 140132b578d3Smrg compiler_flags="$compiler_flags $wl$qarg" 140232b578d3Smrg prev= 140332b578d3Smrg compile_command="$compile_command $wl$qarg" 140432b578d3Smrg finalize_command="$finalize_command $wl$qarg" 140532b578d3Smrg continue 140632b578d3Smrg ;; 140732b578d3Smrg xcclinker) 140832b578d3Smrg linker_flags="$linker_flags $qarg" 140932b578d3Smrg compiler_flags="$compiler_flags $qarg" 141032b578d3Smrg prev= 141132b578d3Smrg compile_command="$compile_command $qarg" 141232b578d3Smrg finalize_command="$finalize_command $qarg" 141332b578d3Smrg continue 141432b578d3Smrg ;; 141532b578d3Smrg shrext) 141632b578d3Smrg shrext_cmds="$arg" 141732b578d3Smrg prev= 141832b578d3Smrg continue 141932b578d3Smrg ;; 142032b578d3Smrg darwin_framework|darwin_framework_skip) 142132b578d3Smrg test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" 142232b578d3Smrg compile_command="$compile_command $arg" 142332b578d3Smrg finalize_command="$finalize_command $arg" 142432b578d3Smrg prev= 142532b578d3Smrg continue 142632b578d3Smrg ;; 142732b578d3Smrg *) 142832b578d3Smrg eval "$prev=\"\$arg\"" 142932b578d3Smrg prev= 143032b578d3Smrg continue 143132b578d3Smrg ;; 143232b578d3Smrg esac 143332b578d3Smrg fi # test -n "$prev" 143432b578d3Smrg 143532b578d3Smrg prevarg="$arg" 143632b578d3Smrg 143732b578d3Smrg case $arg in 143832b578d3Smrg -all-static) 143932b578d3Smrg if test -n "$link_static_flag"; then 144032b578d3Smrg compile_command="$compile_command $link_static_flag" 144132b578d3Smrg finalize_command="$finalize_command $link_static_flag" 144232b578d3Smrg fi 144332b578d3Smrg continue 144432b578d3Smrg ;; 144532b578d3Smrg 144632b578d3Smrg -allow-undefined) 144732b578d3Smrg # FIXME: remove this flag sometime in the future. 144832b578d3Smrg $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 144932b578d3Smrg continue 145032b578d3Smrg ;; 145132b578d3Smrg 145232b578d3Smrg -avoid-version) 145332b578d3Smrg avoid_version=yes 145432b578d3Smrg continue 145532b578d3Smrg ;; 145632b578d3Smrg 145732b578d3Smrg -dlopen) 145832b578d3Smrg prev=dlfiles 145932b578d3Smrg continue 146032b578d3Smrg ;; 146132b578d3Smrg 146232b578d3Smrg -dlpreopen) 146332b578d3Smrg prev=dlprefiles 146432b578d3Smrg continue 146532b578d3Smrg ;; 146632b578d3Smrg 146732b578d3Smrg -export-dynamic) 146832b578d3Smrg export_dynamic=yes 146932b578d3Smrg continue 147032b578d3Smrg ;; 147132b578d3Smrg 147232b578d3Smrg -export-symbols | -export-symbols-regex) 147332b578d3Smrg if test -n "$export_symbols" || test -n "$export_symbols_regex"; then 147432b578d3Smrg $echo "$modename: more than one -exported-symbols argument is not allowed" 147532b578d3Smrg exit $EXIT_FAILURE 147632b578d3Smrg fi 147732b578d3Smrg if test "X$arg" = "X-export-symbols"; then 147832b578d3Smrg prev=expsyms 147932b578d3Smrg else 148032b578d3Smrg prev=expsyms_regex 148132b578d3Smrg fi 148232b578d3Smrg continue 148332b578d3Smrg ;; 148432b578d3Smrg 148532b578d3Smrg -framework|-arch|-isysroot) 148632b578d3Smrg case " $CC " in 148732b578d3Smrg *" ${arg} ${1} "* | *" ${arg} ${1} "*) 148832b578d3Smrg prev=darwin_framework_skip ;; 148932b578d3Smrg *) compiler_flags="$compiler_flags $arg" 149032b578d3Smrg prev=darwin_framework ;; 149132b578d3Smrg esac 149232b578d3Smrg compile_command="$compile_command $arg" 149332b578d3Smrg finalize_command="$finalize_command $arg" 149432b578d3Smrg continue 149532b578d3Smrg ;; 149632b578d3Smrg 149732b578d3Smrg -inst-prefix-dir) 149832b578d3Smrg prev=inst_prefix 149932b578d3Smrg continue 150032b578d3Smrg ;; 150132b578d3Smrg 150232b578d3Smrg # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* 150332b578d3Smrg # so, if we see these flags be careful not to treat them like -L 150432b578d3Smrg -L[A-Z][A-Z]*:*) 150532b578d3Smrg case $with_gcc/$host in 150632b578d3Smrg no/*-*-irix* | /*-*-irix*) 150732b578d3Smrg compile_command="$compile_command $arg" 150832b578d3Smrg finalize_command="$finalize_command $arg" 150932b578d3Smrg ;; 151032b578d3Smrg esac 151132b578d3Smrg continue 151232b578d3Smrg ;; 151332b578d3Smrg 151432b578d3Smrg -L*) 151532b578d3Smrg dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` 151632b578d3Smrg # We need an absolute path. 151732b578d3Smrg case $dir in 151832b578d3Smrg [\\/]* | [A-Za-z]:[\\/]*) ;; 151932b578d3Smrg *) 152032b578d3Smrg absdir=`cd "$dir" && pwd` 152132b578d3Smrg if test -z "$absdir"; then 152232b578d3Smrg $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 152332b578d3Smrg absdir="$dir" 152432b578d3Smrg notinst_path="$notinst_path $dir" 152532b578d3Smrg fi 152632b578d3Smrg dir="$absdir" 152732b578d3Smrg ;; 152832b578d3Smrg esac 152932b578d3Smrg case "$deplibs " in 153032b578d3Smrg *" -L$dir "*) ;; 153132b578d3Smrg *) 153232b578d3Smrg deplibs="$deplibs -L$dir" 153332b578d3Smrg lib_search_path="$lib_search_path $dir" 153432b578d3Smrg ;; 153532b578d3Smrg esac 153632b578d3Smrg case $host in 153732b578d3Smrg *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) 153832b578d3Smrg testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` 153932b578d3Smrg case :$dllsearchpath: in 154032b578d3Smrg *":$dir:"*) ;; 154132b578d3Smrg *) dllsearchpath="$dllsearchpath:$dir";; 154232b578d3Smrg esac 154332b578d3Smrg case :$dllsearchpath: in 154432b578d3Smrg *":$testbindir:"*) ;; 154532b578d3Smrg *) dllsearchpath="$dllsearchpath:$testbindir";; 154632b578d3Smrg esac 154732b578d3Smrg ;; 154832b578d3Smrg esac 154932b578d3Smrg continue 155032b578d3Smrg ;; 155132b578d3Smrg 155232b578d3Smrg -l*) 155332b578d3Smrg if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then 155432b578d3Smrg case $host in 155532b578d3Smrg *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) 155632b578d3Smrg # These systems don't actually have a C or math library (as such) 155732b578d3Smrg continue 155832b578d3Smrg ;; 155932b578d3Smrg *-*-os2*) 156032b578d3Smrg # These systems don't actually have a C library (as such) 156132b578d3Smrg test "X$arg" = "X-lc" && continue 156232b578d3Smrg ;; 156332b578d3Smrg *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) 156432b578d3Smrg # Do not include libc due to us having libc/libc_r. 156532b578d3Smrg test "X$arg" = "X-lc" && continue 156632b578d3Smrg ;; 156732b578d3Smrg *-*-rhapsody* | *-*-darwin1.[012]) 156832b578d3Smrg # Rhapsody C and math libraries are in the System framework 156932b578d3Smrg deplibs="$deplibs -framework System" 157032b578d3Smrg continue 157132b578d3Smrg ;; 157232b578d3Smrg *-*-sco3.2v5* | *-*-sco5v6*) 157332b578d3Smrg # Causes problems with __ctype 157432b578d3Smrg test "X$arg" = "X-lc" && continue 157532b578d3Smrg ;; 157632b578d3Smrg *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) 157732b578d3Smrg # Compiler inserts libc in the correct place for threads to work 157832b578d3Smrg test "X$arg" = "X-lc" && continue 157932b578d3Smrg ;; 158032b578d3Smrg esac 158132b578d3Smrg elif test "X$arg" = "X-lc_r"; then 158232b578d3Smrg case $host in 158332b578d3Smrg *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) 158432b578d3Smrg # Do not include libc_r directly, use -pthread flag. 158532b578d3Smrg continue 158632b578d3Smrg ;; 158732b578d3Smrg esac 158832b578d3Smrg fi 158932b578d3Smrg deplibs="$deplibs $arg" 159032b578d3Smrg continue 159132b578d3Smrg ;; 159232b578d3Smrg 159332b578d3Smrg # Tru64 UNIX uses -model [arg] to determine the layout of C++ 159432b578d3Smrg # classes, name mangling, and exception handling. 159532b578d3Smrg -model) 159632b578d3Smrg compile_command="$compile_command $arg" 159732b578d3Smrg compiler_flags="$compiler_flags $arg" 159832b578d3Smrg finalize_command="$finalize_command $arg" 159932b578d3Smrg prev=xcompiler 160032b578d3Smrg continue 160132b578d3Smrg ;; 160232b578d3Smrg 1603d31dbc53Smrg -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) 160432b578d3Smrg compiler_flags="$compiler_flags $arg" 160532b578d3Smrg compile_command="$compile_command $arg" 160632b578d3Smrg finalize_command="$finalize_command $arg" 160732b578d3Smrg continue 160832b578d3Smrg ;; 160932b578d3Smrg 161032b578d3Smrg -module) 161132b578d3Smrg module=yes 161232b578d3Smrg continue 161332b578d3Smrg ;; 161432b578d3Smrg 161532b578d3Smrg # -64, -mips[0-9] enable 64-bit mode on the SGI compiler 161632b578d3Smrg # -r[0-9][0-9]* specifies the processor on the SGI compiler 161732b578d3Smrg # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler 161832b578d3Smrg # +DA*, +DD* enable 64-bit mode on the HP compiler 161932b578d3Smrg # -q* pass through compiler args for the IBM compiler 162032b578d3Smrg # -m* pass through architecture-specific compiler args for GCC 162132b578d3Smrg # -m*, -t[45]*, -txscale* pass through architecture-specific 162232b578d3Smrg # compiler args for GCC 1623d31dbc53Smrg # -pg pass through profiling flag for GCC 162432b578d3Smrg # @file GCC response files 1625d31dbc53Smrg -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ 1626d31dbc53Smrg -t[45]*|-txscale*|@*) 162732b578d3Smrg 162832b578d3Smrg # Unknown arguments in both finalize_command and compile_command need 162932b578d3Smrg # to be aesthetically quoted because they are evaled later. 163032b578d3Smrg arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` 163132b578d3Smrg case $arg in 163232b578d3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 163332b578d3Smrg arg="\"$arg\"" 163432b578d3Smrg ;; 163532b578d3Smrg esac 163632b578d3Smrg compile_command="$compile_command $arg" 163732b578d3Smrg finalize_command="$finalize_command $arg" 163832b578d3Smrg compiler_flags="$compiler_flags $arg" 163932b578d3Smrg continue 164032b578d3Smrg ;; 164132b578d3Smrg 164232b578d3Smrg -shrext) 164332b578d3Smrg prev=shrext 164432b578d3Smrg continue 164532b578d3Smrg ;; 164632b578d3Smrg 164732b578d3Smrg -no-fast-install) 164832b578d3Smrg fast_install=no 164932b578d3Smrg continue 165032b578d3Smrg ;; 165132b578d3Smrg 165232b578d3Smrg -no-install) 165332b578d3Smrg case $host in 1654d31dbc53Smrg *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) 165532b578d3Smrg # The PATH hackery in wrapper scripts is required on Windows 1656d31dbc53Smrg # in order for the loader to find any dlls it needs. 165732b578d3Smrg $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 165832b578d3Smrg $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 165932b578d3Smrg fast_install=no 166032b578d3Smrg ;; 166132b578d3Smrg *) no_install=yes ;; 166232b578d3Smrg esac 166332b578d3Smrg continue 166432b578d3Smrg ;; 166532b578d3Smrg 166632b578d3Smrg -no-undefined) 166732b578d3Smrg allow_undefined=no 166832b578d3Smrg continue 166932b578d3Smrg ;; 167032b578d3Smrg 167132b578d3Smrg -objectlist) 167232b578d3Smrg prev=objectlist 167332b578d3Smrg continue 167432b578d3Smrg ;; 167532b578d3Smrg 167632b578d3Smrg -o) prev=output ;; 167732b578d3Smrg 167832b578d3Smrg -precious-files-regex) 167932b578d3Smrg prev=precious_regex 168032b578d3Smrg continue 168132b578d3Smrg ;; 168232b578d3Smrg 168332b578d3Smrg -release) 168432b578d3Smrg prev=release 168532b578d3Smrg continue 168632b578d3Smrg ;; 168732b578d3Smrg 168832b578d3Smrg -rpath) 168932b578d3Smrg prev=rpath 169032b578d3Smrg continue 169132b578d3Smrg ;; 169232b578d3Smrg 169332b578d3Smrg -R) 169432b578d3Smrg prev=xrpath 169532b578d3Smrg continue 169632b578d3Smrg ;; 169732b578d3Smrg 169832b578d3Smrg -R*) 169932b578d3Smrg dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` 170032b578d3Smrg # We need an absolute path. 170132b578d3Smrg case $dir in 170232b578d3Smrg [\\/]* | [A-Za-z]:[\\/]*) ;; 170332b578d3Smrg *) 170432b578d3Smrg $echo "$modename: only absolute run-paths are allowed" 1>&2 170532b578d3Smrg exit $EXIT_FAILURE 170632b578d3Smrg ;; 170732b578d3Smrg esac 170832b578d3Smrg case "$xrpath " in 170932b578d3Smrg *" $dir "*) ;; 171032b578d3Smrg *) xrpath="$xrpath $dir" ;; 171132b578d3Smrg esac 171232b578d3Smrg continue 171332b578d3Smrg ;; 171432b578d3Smrg 1715d31dbc53Smrg -static) 171632b578d3Smrg # The effects of -static are defined in a previous loop. 171732b578d3Smrg # We used to do the same as -all-static on platforms that 171832b578d3Smrg # didn't have a PIC flag, but the assumption that the effects 171932b578d3Smrg # would be equivalent was wrong. It would break on at least 172032b578d3Smrg # Digital Unix and AIX. 172132b578d3Smrg continue 172232b578d3Smrg ;; 172332b578d3Smrg 172432b578d3Smrg -thread-safe) 172532b578d3Smrg thread_safe=yes 172632b578d3Smrg continue 172732b578d3Smrg ;; 172832b578d3Smrg 172932b578d3Smrg -version-info) 173032b578d3Smrg prev=vinfo 173132b578d3Smrg continue 173232b578d3Smrg ;; 173332b578d3Smrg -version-number) 173432b578d3Smrg prev=vinfo 173532b578d3Smrg vinfo_number=yes 173632b578d3Smrg continue 173732b578d3Smrg ;; 173832b578d3Smrg 173932b578d3Smrg -Wc,*) 174032b578d3Smrg args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` 174132b578d3Smrg arg= 174232b578d3Smrg save_ifs="$IFS"; IFS=',' 174332b578d3Smrg for flag in $args; do 174432b578d3Smrg IFS="$save_ifs" 174532b578d3Smrg case $flag in 174632b578d3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 174732b578d3Smrg flag="\"$flag\"" 174832b578d3Smrg ;; 174932b578d3Smrg esac 175032b578d3Smrg arg="$arg $wl$flag" 175132b578d3Smrg compiler_flags="$compiler_flags $flag" 175232b578d3Smrg done 175332b578d3Smrg IFS="$save_ifs" 175432b578d3Smrg arg=`$echo "X$arg" | $Xsed -e "s/^ //"` 175532b578d3Smrg ;; 175632b578d3Smrg 175732b578d3Smrg -Wl,*) 175832b578d3Smrg args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` 175932b578d3Smrg arg= 176032b578d3Smrg save_ifs="$IFS"; IFS=',' 176132b578d3Smrg for flag in $args; do 176232b578d3Smrg IFS="$save_ifs" 176332b578d3Smrg case $flag in 176432b578d3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 176532b578d3Smrg flag="\"$flag\"" 176632b578d3Smrg ;; 176732b578d3Smrg esac 176832b578d3Smrg arg="$arg $wl$flag" 176932b578d3Smrg compiler_flags="$compiler_flags $wl$flag" 177032b578d3Smrg linker_flags="$linker_flags $flag" 177132b578d3Smrg done 177232b578d3Smrg IFS="$save_ifs" 177332b578d3Smrg arg=`$echo "X$arg" | $Xsed -e "s/^ //"` 177432b578d3Smrg ;; 177532b578d3Smrg 177632b578d3Smrg -Xcompiler) 177732b578d3Smrg prev=xcompiler 177832b578d3Smrg continue 177932b578d3Smrg ;; 178032b578d3Smrg 178132b578d3Smrg -Xlinker) 178232b578d3Smrg prev=xlinker 178332b578d3Smrg continue 178432b578d3Smrg ;; 178532b578d3Smrg 178632b578d3Smrg -XCClinker) 178732b578d3Smrg prev=xcclinker 178832b578d3Smrg continue 178932b578d3Smrg ;; 179032b578d3Smrg 179132b578d3Smrg # Some other compiler flag. 179232b578d3Smrg -* | +*) 179332b578d3Smrg # Unknown arguments in both finalize_command and compile_command need 179432b578d3Smrg # to be aesthetically quoted because they are evaled later. 179532b578d3Smrg arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` 179632b578d3Smrg case $arg in 179732b578d3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 179832b578d3Smrg arg="\"$arg\"" 179932b578d3Smrg ;; 180032b578d3Smrg esac 180132b578d3Smrg ;; 180232b578d3Smrg 180332b578d3Smrg *.$objext) 180432b578d3Smrg # A standard object. 180532b578d3Smrg objs="$objs $arg" 180632b578d3Smrg ;; 180732b578d3Smrg 180832b578d3Smrg *.lo) 180932b578d3Smrg # A libtool-controlled object. 181032b578d3Smrg 181132b578d3Smrg # Check to see that this really is a libtool object. 181232b578d3Smrg if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 181332b578d3Smrg pic_object= 181432b578d3Smrg non_pic_object= 181532b578d3Smrg 181632b578d3Smrg # Read the .lo file 181732b578d3Smrg # If there is no directory component, then add one. 181832b578d3Smrg case $arg in 181932b578d3Smrg */* | *\\*) . $arg ;; 182032b578d3Smrg *) . ./$arg ;; 182132b578d3Smrg esac 182232b578d3Smrg 182332b578d3Smrg if test -z "$pic_object" || \ 182432b578d3Smrg test -z "$non_pic_object" || 182532b578d3Smrg test "$pic_object" = none && \ 182632b578d3Smrg test "$non_pic_object" = none; then 182732b578d3Smrg $echo "$modename: cannot find name of object for \`$arg'" 1>&2 182832b578d3Smrg exit $EXIT_FAILURE 182932b578d3Smrg fi 183032b578d3Smrg 183132b578d3Smrg # Extract subdirectory from the argument. 183232b578d3Smrg xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` 183332b578d3Smrg if test "X$xdir" = "X$arg"; then 183432b578d3Smrg xdir= 183532b578d3Smrg else 183632b578d3Smrg xdir="$xdir/" 183732b578d3Smrg fi 183832b578d3Smrg 183932b578d3Smrg if test "$pic_object" != none; then 184032b578d3Smrg # Prepend the subdirectory the object is found in. 184132b578d3Smrg pic_object="$xdir$pic_object" 184232b578d3Smrg 184332b578d3Smrg if test "$prev" = dlfiles; then 184432b578d3Smrg if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then 184532b578d3Smrg dlfiles="$dlfiles $pic_object" 184632b578d3Smrg prev= 184732b578d3Smrg continue 184832b578d3Smrg else 184932b578d3Smrg # If libtool objects are unsupported, then we need to preload. 185032b578d3Smrg prev=dlprefiles 185132b578d3Smrg fi 185232b578d3Smrg fi 185332b578d3Smrg 185432b578d3Smrg # CHECK ME: I think I busted this. -Ossama 185532b578d3Smrg if test "$prev" = dlprefiles; then 185632b578d3Smrg # Preload the old-style object. 185732b578d3Smrg dlprefiles="$dlprefiles $pic_object" 185832b578d3Smrg prev= 185932b578d3Smrg fi 186032b578d3Smrg 186132b578d3Smrg # A PIC object. 186232b578d3Smrg libobjs="$libobjs $pic_object" 186332b578d3Smrg arg="$pic_object" 186432b578d3Smrg fi 186532b578d3Smrg 186632b578d3Smrg # Non-PIC object. 186732b578d3Smrg if test "$non_pic_object" != none; then 186832b578d3Smrg # Prepend the subdirectory the object is found in. 186932b578d3Smrg non_pic_object="$xdir$non_pic_object" 187032b578d3Smrg 187132b578d3Smrg # A standard non-PIC object 187232b578d3Smrg non_pic_objects="$non_pic_objects $non_pic_object" 187332b578d3Smrg if test -z "$pic_object" || test "$pic_object" = none ; then 187432b578d3Smrg arg="$non_pic_object" 187532b578d3Smrg fi 187632b578d3Smrg else 187732b578d3Smrg # If the PIC object exists, use it instead. 187832b578d3Smrg # $xdir was prepended to $pic_object above. 187932b578d3Smrg non_pic_object="$pic_object" 188032b578d3Smrg non_pic_objects="$non_pic_objects $non_pic_object" 188132b578d3Smrg fi 188232b578d3Smrg else 188332b578d3Smrg # Only an error if not doing a dry-run. 188432b578d3Smrg if test -z "$run"; then 188532b578d3Smrg $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 188632b578d3Smrg exit $EXIT_FAILURE 188732b578d3Smrg else 188832b578d3Smrg # Dry-run case. 188932b578d3Smrg 189032b578d3Smrg # Extract subdirectory from the argument. 189132b578d3Smrg xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` 189232b578d3Smrg if test "X$xdir" = "X$arg"; then 189332b578d3Smrg xdir= 189432b578d3Smrg else 189532b578d3Smrg xdir="$xdir/" 189632b578d3Smrg fi 189732b578d3Smrg 189832b578d3Smrg pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` 189932b578d3Smrg non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` 190032b578d3Smrg libobjs="$libobjs $pic_object" 190132b578d3Smrg non_pic_objects="$non_pic_objects $non_pic_object" 190232b578d3Smrg fi 190332b578d3Smrg fi 190432b578d3Smrg ;; 190532b578d3Smrg 190632b578d3Smrg *.$libext) 190732b578d3Smrg # An archive. 190832b578d3Smrg deplibs="$deplibs $arg" 190932b578d3Smrg old_deplibs="$old_deplibs $arg" 191032b578d3Smrg continue 191132b578d3Smrg ;; 191232b578d3Smrg 191332b578d3Smrg *.la) 191432b578d3Smrg # A libtool-controlled library. 191532b578d3Smrg 191632b578d3Smrg if test "$prev" = dlfiles; then 191732b578d3Smrg # This library was specified with -dlopen. 191832b578d3Smrg dlfiles="$dlfiles $arg" 191932b578d3Smrg prev= 192032b578d3Smrg elif test "$prev" = dlprefiles; then 192132b578d3Smrg # The library was specified with -dlpreopen. 192232b578d3Smrg dlprefiles="$dlprefiles $arg" 192332b578d3Smrg prev= 192432b578d3Smrg else 192532b578d3Smrg deplibs="$deplibs $arg" 192632b578d3Smrg fi 192732b578d3Smrg continue 192832b578d3Smrg ;; 192932b578d3Smrg 193032b578d3Smrg # Some other compiler argument. 193132b578d3Smrg *) 193232b578d3Smrg # Unknown arguments in both finalize_command and compile_command need 193332b578d3Smrg # to be aesthetically quoted because they are evaled later. 193432b578d3Smrg arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` 193532b578d3Smrg case $arg in 193632b578d3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 193732b578d3Smrg arg="\"$arg\"" 193832b578d3Smrg ;; 193932b578d3Smrg esac 194032b578d3Smrg ;; 194132b578d3Smrg esac # arg 194232b578d3Smrg 194332b578d3Smrg # Now actually substitute the argument into the commands. 194432b578d3Smrg if test -n "$arg"; then 194532b578d3Smrg compile_command="$compile_command $arg" 194632b578d3Smrg finalize_command="$finalize_command $arg" 194732b578d3Smrg fi 194832b578d3Smrg done # argument parsing loop 194932b578d3Smrg 195032b578d3Smrg if test -n "$prev"; then 195132b578d3Smrg $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 195232b578d3Smrg $echo "$help" 1>&2 195332b578d3Smrg exit $EXIT_FAILURE 195432b578d3Smrg fi 195532b578d3Smrg 195632b578d3Smrg if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then 195732b578d3Smrg eval arg=\"$export_dynamic_flag_spec\" 195832b578d3Smrg compile_command="$compile_command $arg" 195932b578d3Smrg finalize_command="$finalize_command $arg" 196032b578d3Smrg fi 196132b578d3Smrg 196232b578d3Smrg oldlibs= 196332b578d3Smrg # calculate the name of the file, without its directory 196432b578d3Smrg outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` 196532b578d3Smrg libobjs_save="$libobjs" 196632b578d3Smrg 196732b578d3Smrg if test -n "$shlibpath_var"; then 196832b578d3Smrg # get the directories listed in $shlibpath_var 196932b578d3Smrg eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` 197032b578d3Smrg else 197132b578d3Smrg shlib_search_path= 197232b578d3Smrg fi 197332b578d3Smrg eval sys_lib_search_path=\"$sys_lib_search_path_spec\" 197432b578d3Smrg eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" 197532b578d3Smrg 197632b578d3Smrg output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` 197732b578d3Smrg if test "X$output_objdir" = "X$output"; then 197832b578d3Smrg output_objdir="$objdir" 197932b578d3Smrg else 198032b578d3Smrg output_objdir="$output_objdir/$objdir" 198132b578d3Smrg fi 198232b578d3Smrg # Create the object directory. 198332b578d3Smrg if test ! -d "$output_objdir"; then 198432b578d3Smrg $show "$mkdir $output_objdir" 198532b578d3Smrg $run $mkdir $output_objdir 198632b578d3Smrg exit_status=$? 198732b578d3Smrg if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then 198832b578d3Smrg exit $exit_status 198932b578d3Smrg fi 199032b578d3Smrg fi 199132b578d3Smrg 199232b578d3Smrg # Determine the type of output 199332b578d3Smrg case $output in 199432b578d3Smrg "") 199532b578d3Smrg $echo "$modename: you must specify an output file" 1>&2 199632b578d3Smrg $echo "$help" 1>&2 199732b578d3Smrg exit $EXIT_FAILURE 199832b578d3Smrg ;; 199932b578d3Smrg *.$libext) linkmode=oldlib ;; 200032b578d3Smrg *.lo | *.$objext) linkmode=obj ;; 200132b578d3Smrg *.la) linkmode=lib ;; 200232b578d3Smrg *) linkmode=prog ;; # Anything else should be a program. 200332b578d3Smrg esac 200432b578d3Smrg 200532b578d3Smrg case $host in 200632b578d3Smrg *cygwin* | *mingw* | *pw32*) 200732b578d3Smrg # don't eliminate duplications in $postdeps and $predeps 200832b578d3Smrg duplicate_compiler_generated_deps=yes 200932b578d3Smrg ;; 201032b578d3Smrg *) 201132b578d3Smrg duplicate_compiler_generated_deps=$duplicate_deps 201232b578d3Smrg ;; 201332b578d3Smrg esac 201432b578d3Smrg specialdeplibs= 201532b578d3Smrg 201632b578d3Smrg libs= 201732b578d3Smrg # Find all interdependent deplibs by searching for libraries 201832b578d3Smrg # that are linked more than once (e.g. -la -lb -la) 201932b578d3Smrg for deplib in $deplibs; do 202032b578d3Smrg if test "X$duplicate_deps" = "Xyes" ; then 202132b578d3Smrg case "$libs " in 202232b578d3Smrg *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; 202332b578d3Smrg esac 202432b578d3Smrg fi 202532b578d3Smrg libs="$libs $deplib" 202632b578d3Smrg done 202732b578d3Smrg 202832b578d3Smrg if test "$linkmode" = lib; then 202932b578d3Smrg libs="$predeps $libs $compiler_lib_search_path $postdeps" 203032b578d3Smrg 203132b578d3Smrg # Compute libraries that are listed more than once in $predeps 203232b578d3Smrg # $postdeps and mark them as special (i.e., whose duplicates are 203332b578d3Smrg # not to be eliminated). 203432b578d3Smrg pre_post_deps= 203532b578d3Smrg if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then 203632b578d3Smrg for pre_post_dep in $predeps $postdeps; do 203732b578d3Smrg case "$pre_post_deps " in 203832b578d3Smrg *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; 203932b578d3Smrg esac 204032b578d3Smrg pre_post_deps="$pre_post_deps $pre_post_dep" 204132b578d3Smrg done 204232b578d3Smrg fi 204332b578d3Smrg pre_post_deps= 204432b578d3Smrg fi 204532b578d3Smrg 204632b578d3Smrg deplibs= 204732b578d3Smrg newdependency_libs= 204832b578d3Smrg newlib_search_path= 204932b578d3Smrg need_relink=no # whether we're linking any uninstalled libtool libraries 205032b578d3Smrg notinst_deplibs= # not-installed libtool libraries 205132b578d3Smrg case $linkmode in 205232b578d3Smrg lib) 205332b578d3Smrg passes="conv link" 205432b578d3Smrg for file in $dlfiles $dlprefiles; do 205532b578d3Smrg case $file in 205632b578d3Smrg *.la) ;; 205732b578d3Smrg *) 205832b578d3Smrg $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 205932b578d3Smrg exit $EXIT_FAILURE 206032b578d3Smrg ;; 206132b578d3Smrg esac 206232b578d3Smrg done 206332b578d3Smrg ;; 206432b578d3Smrg prog) 206532b578d3Smrg compile_deplibs= 206632b578d3Smrg finalize_deplibs= 206732b578d3Smrg alldeplibs=no 206832b578d3Smrg newdlfiles= 206932b578d3Smrg newdlprefiles= 207032b578d3Smrg passes="conv scan dlopen dlpreopen link" 207132b578d3Smrg ;; 207232b578d3Smrg *) passes="conv" 207332b578d3Smrg ;; 207432b578d3Smrg esac 207532b578d3Smrg for pass in $passes; do 207632b578d3Smrg if test "$linkmode,$pass" = "lib,link" || 207732b578d3Smrg test "$linkmode,$pass" = "prog,scan"; then 207832b578d3Smrg libs="$deplibs" 207932b578d3Smrg deplibs= 208032b578d3Smrg fi 208132b578d3Smrg if test "$linkmode" = prog; then 208232b578d3Smrg case $pass in 208332b578d3Smrg dlopen) libs="$dlfiles" ;; 208432b578d3Smrg dlpreopen) libs="$dlprefiles" ;; 208532b578d3Smrg link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; 208632b578d3Smrg esac 208732b578d3Smrg fi 208832b578d3Smrg if test "$pass" = dlopen; then 208932b578d3Smrg # Collect dlpreopened libraries 209032b578d3Smrg save_deplibs="$deplibs" 209132b578d3Smrg deplibs= 209232b578d3Smrg fi 209332b578d3Smrg for deplib in $libs; do 209432b578d3Smrg lib= 209532b578d3Smrg found=no 209632b578d3Smrg case $deplib in 2097d31dbc53Smrg -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) 209832b578d3Smrg if test "$linkmode,$pass" = "prog,link"; then 209932b578d3Smrg compile_deplibs="$deplib $compile_deplibs" 210032b578d3Smrg finalize_deplibs="$deplib $finalize_deplibs" 210132b578d3Smrg else 210232b578d3Smrg compiler_flags="$compiler_flags $deplib" 210332b578d3Smrg fi 210432b578d3Smrg continue 210532b578d3Smrg ;; 210632b578d3Smrg -l*) 210732b578d3Smrg if test "$linkmode" != lib && test "$linkmode" != prog; then 210832b578d3Smrg $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 210932b578d3Smrg continue 211032b578d3Smrg fi 211132b578d3Smrg name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` 211232b578d3Smrg for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do 211332b578d3Smrg for search_ext in .la $std_shrext .so .a; do 211432b578d3Smrg # Search the libtool library 211532b578d3Smrg lib="$searchdir/lib${name}${search_ext}" 211632b578d3Smrg if test -f "$lib"; then 211732b578d3Smrg if test "$search_ext" = ".la"; then 211832b578d3Smrg found=yes 211932b578d3Smrg else 212032b578d3Smrg found=no 212132b578d3Smrg fi 212232b578d3Smrg break 2 212332b578d3Smrg fi 212432b578d3Smrg done 212532b578d3Smrg done 212632b578d3Smrg if test "$found" != yes; then 212732b578d3Smrg # deplib doesn't seem to be a libtool library 212832b578d3Smrg if test "$linkmode,$pass" = "prog,link"; then 212932b578d3Smrg compile_deplibs="$deplib $compile_deplibs" 213032b578d3Smrg finalize_deplibs="$deplib $finalize_deplibs" 213132b578d3Smrg else 213232b578d3Smrg deplibs="$deplib $deplibs" 213332b578d3Smrg test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" 213432b578d3Smrg fi 213532b578d3Smrg continue 213632b578d3Smrg else # deplib is a libtool library 213732b578d3Smrg # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, 213832b578d3Smrg # We need to do some special things here, and not later. 213932b578d3Smrg if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 214032b578d3Smrg case " $predeps $postdeps " in 214132b578d3Smrg *" $deplib "*) 214232b578d3Smrg if (${SED} -e '2q' $lib | 214332b578d3Smrg grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 214432b578d3Smrg library_names= 214532b578d3Smrg old_library= 214632b578d3Smrg case $lib in 214732b578d3Smrg */* | *\\*) . $lib ;; 214832b578d3Smrg *) . ./$lib ;; 214932b578d3Smrg esac 215032b578d3Smrg for l in $old_library $library_names; do 215132b578d3Smrg ll="$l" 215232b578d3Smrg done 215332b578d3Smrg if test "X$ll" = "X$old_library" ; then # only static version available 215432b578d3Smrg found=no 215532b578d3Smrg ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` 215632b578d3Smrg test "X$ladir" = "X$lib" && ladir="." 215732b578d3Smrg lib=$ladir/$old_library 215832b578d3Smrg if test "$linkmode,$pass" = "prog,link"; then 215932b578d3Smrg compile_deplibs="$deplib $compile_deplibs" 216032b578d3Smrg finalize_deplibs="$deplib $finalize_deplibs" 216132b578d3Smrg else 216232b578d3Smrg deplibs="$deplib $deplibs" 216332b578d3Smrg test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" 216432b578d3Smrg fi 216532b578d3Smrg continue 216632b578d3Smrg fi 216732b578d3Smrg fi 216832b578d3Smrg ;; 216932b578d3Smrg *) ;; 217032b578d3Smrg esac 217132b578d3Smrg fi 217232b578d3Smrg fi 217332b578d3Smrg ;; # -l 217432b578d3Smrg -L*) 217532b578d3Smrg case $linkmode in 217632b578d3Smrg lib) 217732b578d3Smrg deplibs="$deplib $deplibs" 217832b578d3Smrg test "$pass" = conv && continue 217932b578d3Smrg newdependency_libs="$deplib $newdependency_libs" 218032b578d3Smrg newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` 218132b578d3Smrg ;; 218232b578d3Smrg prog) 218332b578d3Smrg if test "$pass" = conv; then 218432b578d3Smrg deplibs="$deplib $deplibs" 218532b578d3Smrg continue 218632b578d3Smrg fi 218732b578d3Smrg if test "$pass" = scan; then 218832b578d3Smrg deplibs="$deplib $deplibs" 218932b578d3Smrg else 219032b578d3Smrg compile_deplibs="$deplib $compile_deplibs" 219132b578d3Smrg finalize_deplibs="$deplib $finalize_deplibs" 219232b578d3Smrg fi 219332b578d3Smrg newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` 219432b578d3Smrg ;; 219532b578d3Smrg *) 219632b578d3Smrg $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 219732b578d3Smrg ;; 219832b578d3Smrg esac # linkmode 219932b578d3Smrg continue 220032b578d3Smrg ;; # -L 220132b578d3Smrg -R*) 220232b578d3Smrg if test "$pass" = link; then 220332b578d3Smrg dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` 220432b578d3Smrg # Make sure the xrpath contains only unique directories. 220532b578d3Smrg case "$xrpath " in 220632b578d3Smrg *" $dir "*) ;; 220732b578d3Smrg *) xrpath="$xrpath $dir" ;; 220832b578d3Smrg esac 220932b578d3Smrg fi 221032b578d3Smrg deplibs="$deplib $deplibs" 221132b578d3Smrg continue 221232b578d3Smrg ;; 221332b578d3Smrg *.la) lib="$deplib" ;; 221432b578d3Smrg *.$libext) 221532b578d3Smrg if test "$pass" = conv; then 221632b578d3Smrg deplibs="$deplib $deplibs" 221732b578d3Smrg continue 221832b578d3Smrg fi 221932b578d3Smrg case $linkmode in 222032b578d3Smrg lib) 222132b578d3Smrg valid_a_lib=no 222232b578d3Smrg case $deplibs_check_method in 222332b578d3Smrg match_pattern*) 222432b578d3Smrg set dummy $deplibs_check_method 222532b578d3Smrg match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 222632b578d3Smrg if eval $echo \"$deplib\" 2>/dev/null \ 222732b578d3Smrg | $SED 10q \ 222832b578d3Smrg | $EGREP "$match_pattern_regex" > /dev/null; then 222932b578d3Smrg valid_a_lib=yes 223032b578d3Smrg fi 223132b578d3Smrg ;; 223232b578d3Smrg pass_all) 223332b578d3Smrg valid_a_lib=yes 223432b578d3Smrg ;; 223532b578d3Smrg esac 223632b578d3Smrg if test "$valid_a_lib" != yes; then 223732b578d3Smrg $echo 223832b578d3Smrg $echo "*** Warning: Trying to link with static lib archive $deplib." 223932b578d3Smrg $echo "*** I have the capability to make that library automatically link in when" 224032b578d3Smrg $echo "*** you link to this library. But I can only do this if you have a" 224132b578d3Smrg $echo "*** shared version of the library, which you do not appear to have" 224232b578d3Smrg $echo "*** because the file extensions .$libext of this argument makes me believe" 224332b578d3Smrg $echo "*** that it is just a static archive that I should not used here." 224432b578d3Smrg else 224532b578d3Smrg $echo 224632b578d3Smrg $echo "*** Warning: Linking the shared library $output against the" 224732b578d3Smrg $echo "*** static library $deplib is not portable!" 224832b578d3Smrg deplibs="$deplib $deplibs" 224932b578d3Smrg fi 225032b578d3Smrg continue 225132b578d3Smrg ;; 225232b578d3Smrg prog) 225332b578d3Smrg if test "$pass" != link; then 225432b578d3Smrg deplibs="$deplib $deplibs" 225532b578d3Smrg else 225632b578d3Smrg compile_deplibs="$deplib $compile_deplibs" 225732b578d3Smrg finalize_deplibs="$deplib $finalize_deplibs" 225832b578d3Smrg fi 225932b578d3Smrg continue 226032b578d3Smrg ;; 226132b578d3Smrg esac # linkmode 226232b578d3Smrg ;; # *.$libext 226332b578d3Smrg *.lo | *.$objext) 226432b578d3Smrg if test "$pass" = conv; then 226532b578d3Smrg deplibs="$deplib $deplibs" 226632b578d3Smrg elif test "$linkmode" = prog; then 226732b578d3Smrg if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then 226832b578d3Smrg # If there is no dlopen support or we're linking statically, 226932b578d3Smrg # we need to preload. 227032b578d3Smrg newdlprefiles="$newdlprefiles $deplib" 227132b578d3Smrg compile_deplibs="$deplib $compile_deplibs" 227232b578d3Smrg finalize_deplibs="$deplib $finalize_deplibs" 227332b578d3Smrg else 227432b578d3Smrg newdlfiles="$newdlfiles $deplib" 227532b578d3Smrg fi 227632b578d3Smrg fi 227732b578d3Smrg continue 227832b578d3Smrg ;; 227932b578d3Smrg %DEPLIBS%) 228032b578d3Smrg alldeplibs=yes 228132b578d3Smrg continue 228232b578d3Smrg ;; 228332b578d3Smrg esac # case $deplib 228432b578d3Smrg if test "$found" = yes || test -f "$lib"; then : 228532b578d3Smrg else 228632b578d3Smrg $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 228732b578d3Smrg exit $EXIT_FAILURE 228832b578d3Smrg fi 228932b578d3Smrg 229032b578d3Smrg # Check to see that this really is a libtool archive. 229132b578d3Smrg if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : 229232b578d3Smrg else 229332b578d3Smrg $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 229432b578d3Smrg exit $EXIT_FAILURE 229532b578d3Smrg fi 229632b578d3Smrg 229732b578d3Smrg ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` 229832b578d3Smrg test "X$ladir" = "X$lib" && ladir="." 229932b578d3Smrg 230032b578d3Smrg dlname= 230132b578d3Smrg dlopen= 230232b578d3Smrg dlpreopen= 230332b578d3Smrg libdir= 230432b578d3Smrg library_names= 230532b578d3Smrg old_library= 230632b578d3Smrg # If the library was installed with an old release of libtool, 230732b578d3Smrg # it will not redefine variables installed, or shouldnotlink 230832b578d3Smrg installed=yes 230932b578d3Smrg shouldnotlink=no 231032b578d3Smrg avoidtemprpath= 231132b578d3Smrg 231232b578d3Smrg 231332b578d3Smrg # Read the .la file 231432b578d3Smrg case $lib in 231532b578d3Smrg */* | *\\*) . $lib ;; 231632b578d3Smrg *) . ./$lib ;; 231732b578d3Smrg esac 231832b578d3Smrg 231932b578d3Smrg if test "$linkmode,$pass" = "lib,link" || 232032b578d3Smrg test "$linkmode,$pass" = "prog,scan" || 232132b578d3Smrg { test "$linkmode" != prog && test "$linkmode" != lib; }; then 232232b578d3Smrg test -n "$dlopen" && dlfiles="$dlfiles $dlopen" 232332b578d3Smrg test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" 232432b578d3Smrg fi 232532b578d3Smrg 232632b578d3Smrg if test "$pass" = conv; then 232732b578d3Smrg # Only check for convenience libraries 232832b578d3Smrg deplibs="$lib $deplibs" 232932b578d3Smrg if test -z "$libdir"; then 233032b578d3Smrg if test -z "$old_library"; then 233132b578d3Smrg $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 233232b578d3Smrg exit $EXIT_FAILURE 233332b578d3Smrg fi 233432b578d3Smrg # It is a libtool convenience library, so add in its objects. 233532b578d3Smrg convenience="$convenience $ladir/$objdir/$old_library" 233632b578d3Smrg old_convenience="$old_convenience $ladir/$objdir/$old_library" 233732b578d3Smrg tmp_libs= 233832b578d3Smrg for deplib in $dependency_libs; do 233932b578d3Smrg deplibs="$deplib $deplibs" 234032b578d3Smrg if test "X$duplicate_deps" = "Xyes" ; then 234132b578d3Smrg case "$tmp_libs " in 234232b578d3Smrg *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; 234332b578d3Smrg esac 234432b578d3Smrg fi 234532b578d3Smrg tmp_libs="$tmp_libs $deplib" 234632b578d3Smrg done 234732b578d3Smrg elif test "$linkmode" != prog && test "$linkmode" != lib; then 234832b578d3Smrg $echo "$modename: \`$lib' is not a convenience library" 1>&2 234932b578d3Smrg exit $EXIT_FAILURE 235032b578d3Smrg fi 235132b578d3Smrg continue 235232b578d3Smrg fi # $pass = conv 235332b578d3Smrg 235432b578d3Smrg 235532b578d3Smrg # Get the name of the library we link against. 235632b578d3Smrg linklib= 235732b578d3Smrg for l in $old_library $library_names; do 235832b578d3Smrg linklib="$l" 235932b578d3Smrg done 236032b578d3Smrg if test -z "$linklib"; then 236132b578d3Smrg $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 236232b578d3Smrg exit $EXIT_FAILURE 236332b578d3Smrg fi 236432b578d3Smrg 236532b578d3Smrg # This library was specified with -dlopen. 236632b578d3Smrg if test "$pass" = dlopen; then 236732b578d3Smrg if test -z "$libdir"; then 236832b578d3Smrg $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 236932b578d3Smrg exit $EXIT_FAILURE 237032b578d3Smrg fi 237132b578d3Smrg if test -z "$dlname" || 237232b578d3Smrg test "$dlopen_support" != yes || 237332b578d3Smrg test "$build_libtool_libs" = no; then 237432b578d3Smrg # If there is no dlname, no dlopen support or we're linking 237532b578d3Smrg # statically, we need to preload. We also need to preload any 237632b578d3Smrg # dependent libraries so libltdl's deplib preloader doesn't 237732b578d3Smrg # bomb out in the load deplibs phase. 237832b578d3Smrg dlprefiles="$dlprefiles $lib $dependency_libs" 237932b578d3Smrg else 238032b578d3Smrg newdlfiles="$newdlfiles $lib" 238132b578d3Smrg fi 238232b578d3Smrg continue 238332b578d3Smrg fi # $pass = dlopen 238432b578d3Smrg 238532b578d3Smrg # We need an absolute path. 238632b578d3Smrg case $ladir in 238732b578d3Smrg [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; 238832b578d3Smrg *) 238932b578d3Smrg abs_ladir=`cd "$ladir" && pwd` 239032b578d3Smrg if test -z "$abs_ladir"; then 239132b578d3Smrg $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 239232b578d3Smrg $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 239332b578d3Smrg abs_ladir="$ladir" 239432b578d3Smrg fi 239532b578d3Smrg ;; 239632b578d3Smrg esac 239732b578d3Smrg laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` 239832b578d3Smrg 239932b578d3Smrg # Find the relevant object directory and library name. 240032b578d3Smrg if test "X$installed" = Xyes; then 240132b578d3Smrg if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then 240232b578d3Smrg $echo "$modename: warning: library \`$lib' was moved." 1>&2 240332b578d3Smrg dir="$ladir" 240432b578d3Smrg absdir="$abs_ladir" 240532b578d3Smrg libdir="$abs_ladir" 240632b578d3Smrg else 240732b578d3Smrg dir="$libdir" 240832b578d3Smrg absdir="$libdir" 240932b578d3Smrg fi 241032b578d3Smrg test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes 241132b578d3Smrg else 241232b578d3Smrg if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then 241332b578d3Smrg dir="$ladir" 241432b578d3Smrg absdir="$abs_ladir" 241532b578d3Smrg # Remove this search path later 241632b578d3Smrg notinst_path="$notinst_path $abs_ladir" 241732b578d3Smrg else 241832b578d3Smrg dir="$ladir/$objdir" 241932b578d3Smrg absdir="$abs_ladir/$objdir" 242032b578d3Smrg # Remove this search path later 242132b578d3Smrg notinst_path="$notinst_path $abs_ladir" 242232b578d3Smrg fi 242332b578d3Smrg fi # $installed = yes 242432b578d3Smrg name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` 242532b578d3Smrg 242632b578d3Smrg # This library was specified with -dlpreopen. 242732b578d3Smrg if test "$pass" = dlpreopen; then 242832b578d3Smrg if test -z "$libdir"; then 242932b578d3Smrg $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 243032b578d3Smrg exit $EXIT_FAILURE 243132b578d3Smrg fi 243232b578d3Smrg # Prefer using a static library (so that no silly _DYNAMIC symbols 243332b578d3Smrg # are required to link). 243432b578d3Smrg if test -n "$old_library"; then 243532b578d3Smrg newdlprefiles="$newdlprefiles $dir/$old_library" 243632b578d3Smrg # Otherwise, use the dlname, so that lt_dlopen finds it. 243732b578d3Smrg elif test -n "$dlname"; then 243832b578d3Smrg newdlprefiles="$newdlprefiles $dir/$dlname" 243932b578d3Smrg else 244032b578d3Smrg newdlprefiles="$newdlprefiles $dir/$linklib" 244132b578d3Smrg fi 244232b578d3Smrg fi # $pass = dlpreopen 244332b578d3Smrg 244432b578d3Smrg if test -z "$libdir"; then 244532b578d3Smrg # Link the convenience library 244632b578d3Smrg if test "$linkmode" = lib; then 244732b578d3Smrg deplibs="$dir/$old_library $deplibs" 244832b578d3Smrg elif test "$linkmode,$pass" = "prog,link"; then 244932b578d3Smrg compile_deplibs="$dir/$old_library $compile_deplibs" 245032b578d3Smrg finalize_deplibs="$dir/$old_library $finalize_deplibs" 245132b578d3Smrg else 245232b578d3Smrg deplibs="$lib $deplibs" # used for prog,scan pass 245332b578d3Smrg fi 245432b578d3Smrg continue 245532b578d3Smrg fi 245632b578d3Smrg 245732b578d3Smrg 245832b578d3Smrg if test "$linkmode" = prog && test "$pass" != link; then 245932b578d3Smrg newlib_search_path="$newlib_search_path $ladir" 246032b578d3Smrg deplibs="$lib $deplibs" 246132b578d3Smrg 246232b578d3Smrg linkalldeplibs=no 246332b578d3Smrg if test "$link_all_deplibs" != no || test -z "$library_names" || 246432b578d3Smrg test "$build_libtool_libs" = no; then 246532b578d3Smrg linkalldeplibs=yes 246632b578d3Smrg fi 246732b578d3Smrg 246832b578d3Smrg tmp_libs= 246932b578d3Smrg for deplib in $dependency_libs; do 247032b578d3Smrg case $deplib in 247132b578d3Smrg -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test 247232b578d3Smrg esac 247332b578d3Smrg # Need to link against all dependency_libs? 247432b578d3Smrg if test "$linkalldeplibs" = yes; then 247532b578d3Smrg deplibs="$deplib $deplibs" 247632b578d3Smrg else 247732b578d3Smrg # Need to hardcode shared library paths 247832b578d3Smrg # or/and link against static libraries 247932b578d3Smrg newdependency_libs="$deplib $newdependency_libs" 248032b578d3Smrg fi 248132b578d3Smrg if test "X$duplicate_deps" = "Xyes" ; then 248232b578d3Smrg case "$tmp_libs " in 248332b578d3Smrg *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; 248432b578d3Smrg esac 248532b578d3Smrg fi 248632b578d3Smrg tmp_libs="$tmp_libs $deplib" 248732b578d3Smrg done # for deplib 248832b578d3Smrg continue 248932b578d3Smrg fi # $linkmode = prog... 249032b578d3Smrg 249132b578d3Smrg if test "$linkmode,$pass" = "prog,link"; then 249232b578d3Smrg if test -n "$library_names" && 2493d31dbc53Smrg { test "$prefer_static_libs" = no || test -z "$old_library"; }; then 249432b578d3Smrg # We need to hardcode the library path 249532b578d3Smrg if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then 249632b578d3Smrg # Make sure the rpath contains only unique directories. 249732b578d3Smrg case "$temp_rpath " in 249832b578d3Smrg *" $dir "*) ;; 249932b578d3Smrg *" $absdir "*) ;; 250032b578d3Smrg *) temp_rpath="$temp_rpath $absdir" ;; 250132b578d3Smrg esac 250232b578d3Smrg fi 250332b578d3Smrg 250432b578d3Smrg # Hardcode the library path. 250532b578d3Smrg # Skip directories that are in the system default run-time 250632b578d3Smrg # search path. 250732b578d3Smrg case " $sys_lib_dlsearch_path " in 250832b578d3Smrg *" $absdir "*) ;; 250932b578d3Smrg *) 251032b578d3Smrg case "$compile_rpath " in 251132b578d3Smrg *" $absdir "*) ;; 251232b578d3Smrg *) compile_rpath="$compile_rpath $absdir" 251332b578d3Smrg esac 251432b578d3Smrg ;; 251532b578d3Smrg esac 251632b578d3Smrg case " $sys_lib_dlsearch_path " in 251732b578d3Smrg *" $libdir "*) ;; 251832b578d3Smrg *) 251932b578d3Smrg case "$finalize_rpath " in 252032b578d3Smrg *" $libdir "*) ;; 252132b578d3Smrg *) finalize_rpath="$finalize_rpath $libdir" 252232b578d3Smrg esac 252332b578d3Smrg ;; 252432b578d3Smrg esac 252532b578d3Smrg fi # $linkmode,$pass = prog,link... 252632b578d3Smrg 252732b578d3Smrg if test "$alldeplibs" = yes && 252832b578d3Smrg { test "$deplibs_check_method" = pass_all || 252932b578d3Smrg { test "$build_libtool_libs" = yes && 253032b578d3Smrg test -n "$library_names"; }; }; then 253132b578d3Smrg # We only need to search for static libraries 253232b578d3Smrg continue 253332b578d3Smrg fi 253432b578d3Smrg fi 253532b578d3Smrg 253632b578d3Smrg link_static=no # Whether the deplib will be linked statically 253732b578d3Smrg use_static_libs=$prefer_static_libs 253832b578d3Smrg if test "$use_static_libs" = built && test "$installed" = yes ; then 253932b578d3Smrg use_static_libs=no 254032b578d3Smrg fi 254132b578d3Smrg if test -n "$library_names" && 254232b578d3Smrg { test "$use_static_libs" = no || test -z "$old_library"; }; then 254332b578d3Smrg if test "$installed" = no; then 254432b578d3Smrg notinst_deplibs="$notinst_deplibs $lib" 254532b578d3Smrg need_relink=yes 254632b578d3Smrg fi 254732b578d3Smrg # This is a shared library 254832b578d3Smrg 254932b578d3Smrg # Warn about portability, can't link against -module's on 255032b578d3Smrg # some systems (darwin) 255132b578d3Smrg if test "$shouldnotlink" = yes && test "$pass" = link ; then 255232b578d3Smrg $echo 255332b578d3Smrg if test "$linkmode" = prog; then 255432b578d3Smrg $echo "*** Warning: Linking the executable $output against the loadable module" 255532b578d3Smrg else 255632b578d3Smrg $echo "*** Warning: Linking the shared library $output against the loadable module" 255732b578d3Smrg fi 255832b578d3Smrg $echo "*** $linklib is not portable!" 255932b578d3Smrg fi 256032b578d3Smrg if test "$linkmode" = lib && 256132b578d3Smrg test "$hardcode_into_libs" = yes; then 256232b578d3Smrg # Hardcode the library path. 256332b578d3Smrg # Skip directories that are in the system default run-time 256432b578d3Smrg # search path. 256532b578d3Smrg case " $sys_lib_dlsearch_path " in 256632b578d3Smrg *" $absdir "*) ;; 256732b578d3Smrg *) 256832b578d3Smrg case "$compile_rpath " in 256932b578d3Smrg *" $absdir "*) ;; 257032b578d3Smrg *) compile_rpath="$compile_rpath $absdir" 257132b578d3Smrg esac 257232b578d3Smrg ;; 257332b578d3Smrg esac 257432b578d3Smrg case " $sys_lib_dlsearch_path " in 257532b578d3Smrg *" $libdir "*) ;; 257632b578d3Smrg *) 257732b578d3Smrg case "$finalize_rpath " in 257832b578d3Smrg *" $libdir "*) ;; 257932b578d3Smrg *) finalize_rpath="$finalize_rpath $libdir" 258032b578d3Smrg esac 258132b578d3Smrg ;; 258232b578d3Smrg esac 258332b578d3Smrg fi 258432b578d3Smrg 258532b578d3Smrg if test -n "$old_archive_from_expsyms_cmds"; then 258632b578d3Smrg # figure out the soname 258732b578d3Smrg set dummy $library_names 258832b578d3Smrg realname="$2" 258932b578d3Smrg shift; shift 259032b578d3Smrg libname=`eval \\$echo \"$libname_spec\"` 259132b578d3Smrg # use dlname if we got it. it's perfectly good, no? 259232b578d3Smrg if test -n "$dlname"; then 259332b578d3Smrg soname="$dlname" 259432b578d3Smrg elif test -n "$soname_spec"; then 259532b578d3Smrg # bleh windows 259632b578d3Smrg case $host in 259732b578d3Smrg *cygwin* | mingw*) 259832b578d3Smrg major=`expr $current - $age` 259932b578d3Smrg versuffix="-$major" 260032b578d3Smrg ;; 260132b578d3Smrg esac 260232b578d3Smrg eval soname=\"$soname_spec\" 260332b578d3Smrg else 260432b578d3Smrg soname="$realname" 260532b578d3Smrg fi 260632b578d3Smrg 260732b578d3Smrg # Make a new name for the extract_expsyms_cmds to use 260832b578d3Smrg soroot="$soname" 260932b578d3Smrg soname=`$echo $soroot | ${SED} -e 's/^.*\///'` 261032b578d3Smrg newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" 261132b578d3Smrg 261232b578d3Smrg # If the library has no export list, then create one now 261332b578d3Smrg if test -f "$output_objdir/$soname-def"; then : 261432b578d3Smrg else 261532b578d3Smrg $show "extracting exported symbol list from \`$soname'" 261632b578d3Smrg save_ifs="$IFS"; IFS='~' 261732b578d3Smrg cmds=$extract_expsyms_cmds 261832b578d3Smrg for cmd in $cmds; do 261932b578d3Smrg IFS="$save_ifs" 262032b578d3Smrg eval cmd=\"$cmd\" 262132b578d3Smrg $show "$cmd" 262232b578d3Smrg $run eval "$cmd" || exit $? 262332b578d3Smrg done 262432b578d3Smrg IFS="$save_ifs" 262532b578d3Smrg fi 262632b578d3Smrg 262732b578d3Smrg # Create $newlib 262832b578d3Smrg if test -f "$output_objdir/$newlib"; then :; else 262932b578d3Smrg $show "generating import library for \`$soname'" 263032b578d3Smrg save_ifs="$IFS"; IFS='~' 263132b578d3Smrg cmds=$old_archive_from_expsyms_cmds 263232b578d3Smrg for cmd in $cmds; do 263332b578d3Smrg IFS="$save_ifs" 263432b578d3Smrg eval cmd=\"$cmd\" 263532b578d3Smrg $show "$cmd" 263632b578d3Smrg $run eval "$cmd" || exit $? 263732b578d3Smrg done 263832b578d3Smrg IFS="$save_ifs" 263932b578d3Smrg fi 264032b578d3Smrg # make sure the library variables are pointing to the new library 264132b578d3Smrg dir=$output_objdir 264232b578d3Smrg linklib=$newlib 264332b578d3Smrg fi # test -n "$old_archive_from_expsyms_cmds" 264432b578d3Smrg 264532b578d3Smrg if test "$linkmode" = prog || test "$mode" != relink; then 264632b578d3Smrg add_shlibpath= 264732b578d3Smrg add_dir= 264832b578d3Smrg add= 264932b578d3Smrg lib_linked=yes 265032b578d3Smrg case $hardcode_action in 265132b578d3Smrg immediate | unsupported) 265232b578d3Smrg if test "$hardcode_direct" = no; then 265332b578d3Smrg add="$dir/$linklib" 265432b578d3Smrg case $host in 265532b578d3Smrg *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; 265632b578d3Smrg *-*-sysv4*uw2*) add_dir="-L$dir" ;; 265732b578d3Smrg *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ 265832b578d3Smrg *-*-unixware7*) add_dir="-L$dir" ;; 265932b578d3Smrg *-*-darwin* ) 266032b578d3Smrg # if the lib is a module then we can not link against 266132b578d3Smrg # it, someone is ignoring the new warnings I added 266232b578d3Smrg if /usr/bin/file -L $add 2> /dev/null | 266332b578d3Smrg $EGREP ": [^:]* bundle" >/dev/null ; then 266432b578d3Smrg $echo "** Warning, lib $linklib is a module, not a shared library" 266532b578d3Smrg if test -z "$old_library" ; then 266632b578d3Smrg $echo 266732b578d3Smrg $echo "** And there doesn't seem to be a static archive available" 266832b578d3Smrg $echo "** The link will probably fail, sorry" 266932b578d3Smrg else 267032b578d3Smrg add="$dir/$old_library" 267132b578d3Smrg fi 267232b578d3Smrg fi 267332b578d3Smrg esac 267432b578d3Smrg elif test "$hardcode_minus_L" = no; then 267532b578d3Smrg case $host in 267632b578d3Smrg *-*-sunos*) add_shlibpath="$dir" ;; 267732b578d3Smrg esac 267832b578d3Smrg add_dir="-L$dir" 267932b578d3Smrg add="-l$name" 268032b578d3Smrg elif test "$hardcode_shlibpath_var" = no; then 268132b578d3Smrg add_shlibpath="$dir" 268232b578d3Smrg add="-l$name" 268332b578d3Smrg else 268432b578d3Smrg lib_linked=no 268532b578d3Smrg fi 268632b578d3Smrg ;; 268732b578d3Smrg relink) 268832b578d3Smrg if test "$hardcode_direct" = yes; then 268932b578d3Smrg add="$dir/$linklib" 269032b578d3Smrg elif test "$hardcode_minus_L" = yes; then 269132b578d3Smrg add_dir="-L$dir" 269232b578d3Smrg # Try looking first in the location we're being installed to. 269332b578d3Smrg if test -n "$inst_prefix_dir"; then 269432b578d3Smrg case $libdir in 269532b578d3Smrg [\\/]*) 269632b578d3Smrg add_dir="$add_dir -L$inst_prefix_dir$libdir" 269732b578d3Smrg ;; 269832b578d3Smrg esac 269932b578d3Smrg fi 270032b578d3Smrg add="-l$name" 270132b578d3Smrg elif test "$hardcode_shlibpath_var" = yes; then 270232b578d3Smrg add_shlibpath="$dir" 270332b578d3Smrg add="-l$name" 270432b578d3Smrg else 270532b578d3Smrg lib_linked=no 270632b578d3Smrg fi 270732b578d3Smrg ;; 270832b578d3Smrg *) lib_linked=no ;; 270932b578d3Smrg esac 271032b578d3Smrg 271132b578d3Smrg if test "$lib_linked" != yes; then 271232b578d3Smrg $echo "$modename: configuration error: unsupported hardcode properties" 271332b578d3Smrg exit $EXIT_FAILURE 271432b578d3Smrg fi 271532b578d3Smrg 271632b578d3Smrg if test -n "$add_shlibpath"; then 271732b578d3Smrg case :$compile_shlibpath: in 271832b578d3Smrg *":$add_shlibpath:"*) ;; 271932b578d3Smrg *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; 272032b578d3Smrg esac 272132b578d3Smrg fi 272232b578d3Smrg if test "$linkmode" = prog; then 272332b578d3Smrg test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" 272432b578d3Smrg test -n "$add" && compile_deplibs="$add $compile_deplibs" 272532b578d3Smrg else 272632b578d3Smrg test -n "$add_dir" && deplibs="$add_dir $deplibs" 272732b578d3Smrg test -n "$add" && deplibs="$add $deplibs" 272832b578d3Smrg if test "$hardcode_direct" != yes && \ 272932b578d3Smrg test "$hardcode_minus_L" != yes && \ 273032b578d3Smrg test "$hardcode_shlibpath_var" = yes; then 273132b578d3Smrg case :$finalize_shlibpath: in 273232b578d3Smrg *":$libdir:"*) ;; 273332b578d3Smrg *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; 273432b578d3Smrg esac 273532b578d3Smrg fi 273632b578d3Smrg fi 273732b578d3Smrg fi 273832b578d3Smrg 273932b578d3Smrg if test "$linkmode" = prog || test "$mode" = relink; then 274032b578d3Smrg add_shlibpath= 274132b578d3Smrg add_dir= 274232b578d3Smrg add= 274332b578d3Smrg # Finalize command for both is simple: just hardcode it. 274432b578d3Smrg if test "$hardcode_direct" = yes; then 274532b578d3Smrg add="$libdir/$linklib" 274632b578d3Smrg elif test "$hardcode_minus_L" = yes; then 274732b578d3Smrg add_dir="-L$libdir" 274832b578d3Smrg add="-l$name" 274932b578d3Smrg elif test "$hardcode_shlibpath_var" = yes; then 275032b578d3Smrg case :$finalize_shlibpath: in 275132b578d3Smrg *":$libdir:"*) ;; 275232b578d3Smrg *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; 275332b578d3Smrg esac 275432b578d3Smrg add="-l$name" 275532b578d3Smrg elif test "$hardcode_automatic" = yes; then 275632b578d3Smrg if test -n "$inst_prefix_dir" && 275732b578d3Smrg test -f "$inst_prefix_dir$libdir/$linklib" ; then 275832b578d3Smrg add="$inst_prefix_dir$libdir/$linklib" 275932b578d3Smrg else 276032b578d3Smrg add="$libdir/$linklib" 276132b578d3Smrg fi 276232b578d3Smrg else 276332b578d3Smrg # We cannot seem to hardcode it, guess we'll fake it. 276432b578d3Smrg add_dir="-L$libdir" 276532b578d3Smrg # Try looking first in the location we're being installed to. 276632b578d3Smrg if test -n "$inst_prefix_dir"; then 276732b578d3Smrg case $libdir in 276832b578d3Smrg [\\/]*) 276932b578d3Smrg add_dir="$add_dir -L$inst_prefix_dir$libdir" 277032b578d3Smrg ;; 277132b578d3Smrg esac 277232b578d3Smrg fi 277332b578d3Smrg add="-l$name" 277432b578d3Smrg fi 277532b578d3Smrg 277632b578d3Smrg if test "$linkmode" = prog; then 277732b578d3Smrg test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" 277832b578d3Smrg test -n "$add" && finalize_deplibs="$add $finalize_deplibs" 277932b578d3Smrg else 278032b578d3Smrg test -n "$add_dir" && deplibs="$add_dir $deplibs" 278132b578d3Smrg test -n "$add" && deplibs="$add $deplibs" 278232b578d3Smrg fi 278332b578d3Smrg fi 278432b578d3Smrg elif test "$linkmode" = prog; then 278532b578d3Smrg # Here we assume that one of hardcode_direct or hardcode_minus_L 278632b578d3Smrg # is not unsupported. This is valid on all known static and 278732b578d3Smrg # shared platforms. 278832b578d3Smrg if test "$hardcode_direct" != unsupported; then 278932b578d3Smrg test -n "$old_library" && linklib="$old_library" 279032b578d3Smrg compile_deplibs="$dir/$linklib $compile_deplibs" 279132b578d3Smrg finalize_deplibs="$dir/$linklib $finalize_deplibs" 279232b578d3Smrg else 279332b578d3Smrg compile_deplibs="-l$name -L$dir $compile_deplibs" 279432b578d3Smrg finalize_deplibs="-l$name -L$dir $finalize_deplibs" 279532b578d3Smrg fi 279632b578d3Smrg elif test "$build_libtool_libs" = yes; then 279732b578d3Smrg # Not a shared library 279832b578d3Smrg if test "$deplibs_check_method" != pass_all; then 279932b578d3Smrg # We're trying link a shared library against a static one 280032b578d3Smrg # but the system doesn't support it. 280132b578d3Smrg 280232b578d3Smrg # Just print a warning and add the library to dependency_libs so 280332b578d3Smrg # that the program can be linked against the static library. 280432b578d3Smrg $echo 280532b578d3Smrg $echo "*** Warning: This system can not link to static lib archive $lib." 280632b578d3Smrg $echo "*** I have the capability to make that library automatically link in when" 280732b578d3Smrg $echo "*** you link to this library. But I can only do this if you have a" 280832b578d3Smrg $echo "*** shared version of the library, which you do not appear to have." 280932b578d3Smrg if test "$module" = yes; then 281032b578d3Smrg $echo "*** But as you try to build a module library, libtool will still create " 281132b578d3Smrg $echo "*** a static module, that should work as long as the dlopening application" 281232b578d3Smrg $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." 281332b578d3Smrg if test -z "$global_symbol_pipe"; then 281432b578d3Smrg $echo 281532b578d3Smrg $echo "*** However, this would only work if libtool was able to extract symbol" 281632b578d3Smrg $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" 281732b578d3Smrg $echo "*** not find such a program. So, this module is probably useless." 281832b578d3Smrg $echo "*** \`nm' from GNU binutils and a full rebuild may help." 281932b578d3Smrg fi 282032b578d3Smrg if test "$build_old_libs" = no; then 282132b578d3Smrg build_libtool_libs=module 282232b578d3Smrg build_old_libs=yes 282332b578d3Smrg else 282432b578d3Smrg build_libtool_libs=no 282532b578d3Smrg fi 282632b578d3Smrg fi 282732b578d3Smrg else 282832b578d3Smrg deplibs="$dir/$old_library $deplibs" 282932b578d3Smrg link_static=yes 283032b578d3Smrg fi 283132b578d3Smrg fi # link shared/static library? 283232b578d3Smrg 283332b578d3Smrg if test "$linkmode" = lib; then 283432b578d3Smrg if test -n "$dependency_libs" && 283532b578d3Smrg { test "$hardcode_into_libs" != yes || 283632b578d3Smrg test "$build_old_libs" = yes || 283732b578d3Smrg test "$link_static" = yes; }; then 283832b578d3Smrg # Extract -R from dependency_libs 283932b578d3Smrg temp_deplibs= 284032b578d3Smrg for libdir in $dependency_libs; do 284132b578d3Smrg case $libdir in 284232b578d3Smrg -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` 284332b578d3Smrg case " $xrpath " in 284432b578d3Smrg *" $temp_xrpath "*) ;; 284532b578d3Smrg *) xrpath="$xrpath $temp_xrpath";; 284632b578d3Smrg esac;; 284732b578d3Smrg *) temp_deplibs="$temp_deplibs $libdir";; 284832b578d3Smrg esac 284932b578d3Smrg done 285032b578d3Smrg dependency_libs="$temp_deplibs" 285132b578d3Smrg fi 285232b578d3Smrg 285332b578d3Smrg newlib_search_path="$newlib_search_path $absdir" 285432b578d3Smrg # Link against this library 285532b578d3Smrg test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" 285632b578d3Smrg # ... and its dependency_libs 285732b578d3Smrg tmp_libs= 285832b578d3Smrg for deplib in $dependency_libs; do 285932b578d3Smrg newdependency_libs="$deplib $newdependency_libs" 286032b578d3Smrg if test "X$duplicate_deps" = "Xyes" ; then 286132b578d3Smrg case "$tmp_libs " in 286232b578d3Smrg *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; 286332b578d3Smrg esac 286432b578d3Smrg fi 286532b578d3Smrg tmp_libs="$tmp_libs $deplib" 286632b578d3Smrg done 286732b578d3Smrg 286832b578d3Smrg if test "$link_all_deplibs" != no; then 286932b578d3Smrg # Add the search paths of all dependency libraries 287032b578d3Smrg for deplib in $dependency_libs; do 287132b578d3Smrg case $deplib in 287232b578d3Smrg -L*) path="$deplib" ;; 287332b578d3Smrg *.la) 287432b578d3Smrg dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` 287532b578d3Smrg test "X$dir" = "X$deplib" && dir="." 287632b578d3Smrg # We need an absolute path. 287732b578d3Smrg case $dir in 287832b578d3Smrg [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; 287932b578d3Smrg *) 288032b578d3Smrg absdir=`cd "$dir" && pwd` 288132b578d3Smrg if test -z "$absdir"; then 288232b578d3Smrg $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 288332b578d3Smrg absdir="$dir" 288432b578d3Smrg fi 288532b578d3Smrg ;; 288632b578d3Smrg esac 288732b578d3Smrg if grep "^installed=no" $deplib > /dev/null; then 288832b578d3Smrg path="$absdir/$objdir" 288932b578d3Smrg else 289032b578d3Smrg eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` 289132b578d3Smrg if test -z "$libdir"; then 289232b578d3Smrg $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 289332b578d3Smrg exit $EXIT_FAILURE 289432b578d3Smrg fi 289532b578d3Smrg if test "$absdir" != "$libdir"; then 289632b578d3Smrg $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 289732b578d3Smrg fi 289832b578d3Smrg path="$absdir" 289932b578d3Smrg fi 290032b578d3Smrg depdepl= 290132b578d3Smrg case $host in 290232b578d3Smrg *-*-darwin*) 290332b578d3Smrg # we do not want to link against static libs, 290432b578d3Smrg # but need to link against shared 290532b578d3Smrg eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` 290632b578d3Smrg if test -n "$deplibrary_names" ; then 290732b578d3Smrg for tmp in $deplibrary_names ; do 290832b578d3Smrg depdepl=$tmp 290932b578d3Smrg done 291032b578d3Smrg if test -f "$path/$depdepl" ; then 291132b578d3Smrg depdepl="$path/$depdepl" 291232b578d3Smrg fi 291332b578d3Smrg # do not add paths which are already there 291432b578d3Smrg case " $newlib_search_path " in 291532b578d3Smrg *" $path "*) ;; 291632b578d3Smrg *) newlib_search_path="$newlib_search_path $path";; 291732b578d3Smrg esac 291832b578d3Smrg fi 291932b578d3Smrg path="" 292032b578d3Smrg ;; 292132b578d3Smrg *) 292232b578d3Smrg path="-L$path" 292332b578d3Smrg ;; 292432b578d3Smrg esac 292532b578d3Smrg ;; 292632b578d3Smrg -l*) 292732b578d3Smrg case $host in 292832b578d3Smrg *-*-darwin*) 292932b578d3Smrg # Again, we only want to link against shared libraries 293032b578d3Smrg eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` 293132b578d3Smrg for tmp in $newlib_search_path ; do 293232b578d3Smrg if test -f "$tmp/lib$tmp_libs.dylib" ; then 293332b578d3Smrg eval depdepl="$tmp/lib$tmp_libs.dylib" 293432b578d3Smrg break 293532b578d3Smrg fi 293632b578d3Smrg done 293732b578d3Smrg path="" 293832b578d3Smrg ;; 293932b578d3Smrg *) continue ;; 294032b578d3Smrg esac 294132b578d3Smrg ;; 294232b578d3Smrg *) continue ;; 294332b578d3Smrg esac 294432b578d3Smrg case " $deplibs " in 294532b578d3Smrg *" $path "*) ;; 294632b578d3Smrg *) deplibs="$path $deplibs" ;; 294732b578d3Smrg esac 294832b578d3Smrg case " $deplibs " in 294932b578d3Smrg *" $depdepl "*) ;; 295032b578d3Smrg *) deplibs="$depdepl $deplibs" ;; 295132b578d3Smrg esac 295232b578d3Smrg done 295332b578d3Smrg fi # link_all_deplibs != no 295432b578d3Smrg fi # linkmode = lib 295532b578d3Smrg done # for deplib in $libs 295632b578d3Smrg dependency_libs="$newdependency_libs" 295732b578d3Smrg if test "$pass" = dlpreopen; then 295832b578d3Smrg # Link the dlpreopened libraries before other libraries 295932b578d3Smrg for deplib in $save_deplibs; do 296032b578d3Smrg deplibs="$deplib $deplibs" 296132b578d3Smrg done 296232b578d3Smrg fi 296332b578d3Smrg if test "$pass" != dlopen; then 296432b578d3Smrg if test "$pass" != conv; then 296532b578d3Smrg # Make sure lib_search_path contains only unique directories. 296632b578d3Smrg lib_search_path= 296732b578d3Smrg for dir in $newlib_search_path; do 296832b578d3Smrg case "$lib_search_path " in 296932b578d3Smrg *" $dir "*) ;; 297032b578d3Smrg *) lib_search_path="$lib_search_path $dir" ;; 297132b578d3Smrg esac 297232b578d3Smrg done 297332b578d3Smrg newlib_search_path= 297432b578d3Smrg fi 297532b578d3Smrg 297632b578d3Smrg if test "$linkmode,$pass" != "prog,link"; then 297732b578d3Smrg vars="deplibs" 297832b578d3Smrg else 297932b578d3Smrg vars="compile_deplibs finalize_deplibs" 298032b578d3Smrg fi 298132b578d3Smrg for var in $vars dependency_libs; do 298232b578d3Smrg # Add libraries to $var in reverse order 298332b578d3Smrg eval tmp_libs=\"\$$var\" 298432b578d3Smrg new_libs= 298532b578d3Smrg for deplib in $tmp_libs; do 298632b578d3Smrg # FIXME: Pedantically, this is the right thing to do, so 298732b578d3Smrg # that some nasty dependency loop isn't accidentally 298832b578d3Smrg # broken: 298932b578d3Smrg #new_libs="$deplib $new_libs" 299032b578d3Smrg # Pragmatically, this seems to cause very few problems in 299132b578d3Smrg # practice: 299232b578d3Smrg case $deplib in 299332b578d3Smrg -L*) new_libs="$deplib $new_libs" ;; 299432b578d3Smrg -R*) ;; 299532b578d3Smrg *) 299632b578d3Smrg # And here is the reason: when a library appears more 299732b578d3Smrg # than once as an explicit dependence of a library, or 299832b578d3Smrg # is implicitly linked in more than once by the 299932b578d3Smrg # compiler, it is considered special, and multiple 300032b578d3Smrg # occurrences thereof are not removed. Compare this 300132b578d3Smrg # with having the same library being listed as a 300232b578d3Smrg # dependency of multiple other libraries: in this case, 300332b578d3Smrg # we know (pedantically, we assume) the library does not 300432b578d3Smrg # need to be listed more than once, so we keep only the 300532b578d3Smrg # last copy. This is not always right, but it is rare 300632b578d3Smrg # enough that we require users that really mean to play 300732b578d3Smrg # such unportable linking tricks to link the library 300832b578d3Smrg # using -Wl,-lname, so that libtool does not consider it 300932b578d3Smrg # for duplicate removal. 301032b578d3Smrg case " $specialdeplibs " in 301132b578d3Smrg *" $deplib "*) new_libs="$deplib $new_libs" ;; 301232b578d3Smrg *) 301332b578d3Smrg case " $new_libs " in 301432b578d3Smrg *" $deplib "*) ;; 301532b578d3Smrg *) new_libs="$deplib $new_libs" ;; 301632b578d3Smrg esac 301732b578d3Smrg ;; 301832b578d3Smrg esac 301932b578d3Smrg ;; 302032b578d3Smrg esac 302132b578d3Smrg done 302232b578d3Smrg tmp_libs= 302332b578d3Smrg for deplib in $new_libs; do 302432b578d3Smrg case $deplib in 302532b578d3Smrg -L*) 302632b578d3Smrg case " $tmp_libs " in 302732b578d3Smrg *" $deplib "*) ;; 302832b578d3Smrg *) tmp_libs="$tmp_libs $deplib" ;; 302932b578d3Smrg esac 303032b578d3Smrg ;; 303132b578d3Smrg *) tmp_libs="$tmp_libs $deplib" ;; 303232b578d3Smrg esac 303332b578d3Smrg done 303432b578d3Smrg eval $var=\"$tmp_libs\" 303532b578d3Smrg done # for var 303632b578d3Smrg fi 303732b578d3Smrg # Last step: remove runtime libs from dependency_libs 303832b578d3Smrg # (they stay in deplibs) 303932b578d3Smrg tmp_libs= 304032b578d3Smrg for i in $dependency_libs ; do 304132b578d3Smrg case " $predeps $postdeps $compiler_lib_search_path " in 304232b578d3Smrg *" $i "*) 304332b578d3Smrg i="" 304432b578d3Smrg ;; 304532b578d3Smrg esac 304632b578d3Smrg if test -n "$i" ; then 304732b578d3Smrg tmp_libs="$tmp_libs $i" 304832b578d3Smrg fi 304932b578d3Smrg done 305032b578d3Smrg dependency_libs=$tmp_libs 305132b578d3Smrg done # for pass 305232b578d3Smrg if test "$linkmode" = prog; then 305332b578d3Smrg dlfiles="$newdlfiles" 305432b578d3Smrg dlprefiles="$newdlprefiles" 305532b578d3Smrg fi 305632b578d3Smrg 305732b578d3Smrg case $linkmode in 305832b578d3Smrg oldlib) 305932b578d3Smrg if test -n "$deplibs"; then 306032b578d3Smrg $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 306132b578d3Smrg fi 306232b578d3Smrg 306332b578d3Smrg if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then 306432b578d3Smrg $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 306532b578d3Smrg fi 306632b578d3Smrg 306732b578d3Smrg if test -n "$rpath"; then 306832b578d3Smrg $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 306932b578d3Smrg fi 307032b578d3Smrg 307132b578d3Smrg if test -n "$xrpath"; then 307232b578d3Smrg $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 307332b578d3Smrg fi 307432b578d3Smrg 307532b578d3Smrg if test -n "$vinfo"; then 307632b578d3Smrg $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 307732b578d3Smrg fi 307832b578d3Smrg 307932b578d3Smrg if test -n "$release"; then 308032b578d3Smrg $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 308132b578d3Smrg fi 308232b578d3Smrg 308332b578d3Smrg if test -n "$export_symbols" || test -n "$export_symbols_regex"; then 308432b578d3Smrg $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 308532b578d3Smrg fi 308632b578d3Smrg 308732b578d3Smrg # Now set the variables for building old libraries. 308832b578d3Smrg build_libtool_libs=no 308932b578d3Smrg oldlibs="$output" 309032b578d3Smrg objs="$objs$old_deplibs" 309132b578d3Smrg ;; 309232b578d3Smrg 309332b578d3Smrg lib) 309432b578d3Smrg # Make sure we only generate libraries of the form `libNAME.la'. 309532b578d3Smrg case $outputname in 309632b578d3Smrg lib*) 309732b578d3Smrg name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` 309832b578d3Smrg eval shared_ext=\"$shrext_cmds\" 309932b578d3Smrg eval libname=\"$libname_spec\" 310032b578d3Smrg ;; 310132b578d3Smrg *) 310232b578d3Smrg if test "$module" = no; then 310332b578d3Smrg $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 310432b578d3Smrg $echo "$help" 1>&2 310532b578d3Smrg exit $EXIT_FAILURE 310632b578d3Smrg fi 310732b578d3Smrg if test "$need_lib_prefix" != no; then 310832b578d3Smrg # Add the "lib" prefix for modules if required 310932b578d3Smrg name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` 311032b578d3Smrg eval shared_ext=\"$shrext_cmds\" 311132b578d3Smrg eval libname=\"$libname_spec\" 311232b578d3Smrg else 311332b578d3Smrg libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` 311432b578d3Smrg fi 311532b578d3Smrg ;; 311632b578d3Smrg esac 311732b578d3Smrg 311832b578d3Smrg if test -n "$objs"; then 311932b578d3Smrg if test "$deplibs_check_method" != pass_all; then 312032b578d3Smrg $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 312132b578d3Smrg exit $EXIT_FAILURE 312232b578d3Smrg else 312332b578d3Smrg $echo 312432b578d3Smrg $echo "*** Warning: Linking the shared library $output against the non-libtool" 312532b578d3Smrg $echo "*** objects $objs is not portable!" 312632b578d3Smrg libobjs="$libobjs $objs" 312732b578d3Smrg fi 312832b578d3Smrg fi 312932b578d3Smrg 313032b578d3Smrg if test "$dlself" != no; then 313132b578d3Smrg $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 313232b578d3Smrg fi 313332b578d3Smrg 313432b578d3Smrg set dummy $rpath 313532b578d3Smrg if test "$#" -gt 2; then 313632b578d3Smrg $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 313732b578d3Smrg fi 313832b578d3Smrg install_libdir="$2" 313932b578d3Smrg 314032b578d3Smrg oldlibs= 314132b578d3Smrg if test -z "$rpath"; then 314232b578d3Smrg if test "$build_libtool_libs" = yes; then 314332b578d3Smrg # Building a libtool convenience library. 314432b578d3Smrg # Some compilers have problems with a `.al' extension so 314532b578d3Smrg # convenience libraries should have the same extension an 314632b578d3Smrg # archive normally would. 314732b578d3Smrg oldlibs="$output_objdir/$libname.$libext $oldlibs" 314832b578d3Smrg build_libtool_libs=convenience 314932b578d3Smrg build_old_libs=yes 315032b578d3Smrg fi 315132b578d3Smrg 315232b578d3Smrg if test -n "$vinfo"; then 315332b578d3Smrg $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 315432b578d3Smrg fi 315532b578d3Smrg 315632b578d3Smrg if test -n "$release"; then 315732b578d3Smrg $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 315832b578d3Smrg fi 315932b578d3Smrg else 316032b578d3Smrg 316132b578d3Smrg # Parse the version information argument. 316232b578d3Smrg save_ifs="$IFS"; IFS=':' 316332b578d3Smrg set dummy $vinfo 0 0 0 316432b578d3Smrg IFS="$save_ifs" 316532b578d3Smrg 316632b578d3Smrg if test -n "$8"; then 316732b578d3Smrg $echo "$modename: too many parameters to \`-version-info'" 1>&2 316832b578d3Smrg $echo "$help" 1>&2 316932b578d3Smrg exit $EXIT_FAILURE 317032b578d3Smrg fi 317132b578d3Smrg 317232b578d3Smrg # convert absolute version numbers to libtool ages 317332b578d3Smrg # this retains compatibility with .la files and attempts 317432b578d3Smrg # to make the code below a bit more comprehensible 317532b578d3Smrg 317632b578d3Smrg case $vinfo_number in 317732b578d3Smrg yes) 317832b578d3Smrg number_major="$2" 317932b578d3Smrg number_minor="$3" 318032b578d3Smrg number_revision="$4" 318132b578d3Smrg # 318232b578d3Smrg # There are really only two kinds -- those that 318332b578d3Smrg # use the current revision as the major version 318432b578d3Smrg # and those that subtract age and use age as 318532b578d3Smrg # a minor version. But, then there is irix 318632b578d3Smrg # which has an extra 1 added just for fun 318732b578d3Smrg # 318832b578d3Smrg case $version_type in 3189d31dbc53Smrg darwin|linux|osf|windows) 319032b578d3Smrg current=`expr $number_major + $number_minor` 319132b578d3Smrg age="$number_minor" 319232b578d3Smrg revision="$number_revision" 319332b578d3Smrg ;; 319432b578d3Smrg freebsd-aout|freebsd-elf|sunos) 319532b578d3Smrg current="$number_major" 319632b578d3Smrg revision="$number_minor" 319732b578d3Smrg age="0" 319832b578d3Smrg ;; 319932b578d3Smrg irix|nonstopux) 3200d31dbc53Smrg current=`expr $number_major + $number_minor - 1` 320132b578d3Smrg age="$number_minor" 320232b578d3Smrg revision="$number_minor" 320332b578d3Smrg ;; 320432b578d3Smrg esac 320532b578d3Smrg ;; 320632b578d3Smrg no) 320732b578d3Smrg current="$2" 320832b578d3Smrg revision="$3" 320932b578d3Smrg age="$4" 321032b578d3Smrg ;; 321132b578d3Smrg esac 321232b578d3Smrg 321332b578d3Smrg # Check that each of the things are valid numbers. 321432b578d3Smrg case $current in 321532b578d3Smrg 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]) ;; 321632b578d3Smrg *) 321732b578d3Smrg $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 321832b578d3Smrg $echo "$modename: \`$vinfo' is not valid version information" 1>&2 321932b578d3Smrg exit $EXIT_FAILURE 322032b578d3Smrg ;; 322132b578d3Smrg esac 322232b578d3Smrg 322332b578d3Smrg case $revision in 322432b578d3Smrg 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]) ;; 322532b578d3Smrg *) 322632b578d3Smrg $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 322732b578d3Smrg $echo "$modename: \`$vinfo' is not valid version information" 1>&2 322832b578d3Smrg exit $EXIT_FAILURE 322932b578d3Smrg ;; 323032b578d3Smrg esac 323132b578d3Smrg 323232b578d3Smrg case $age in 323332b578d3Smrg 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]) ;; 323432b578d3Smrg *) 323532b578d3Smrg $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 323632b578d3Smrg $echo "$modename: \`$vinfo' is not valid version information" 1>&2 323732b578d3Smrg exit $EXIT_FAILURE 323832b578d3Smrg ;; 323932b578d3Smrg esac 324032b578d3Smrg 324132b578d3Smrg if test "$age" -gt "$current"; then 324232b578d3Smrg $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 324332b578d3Smrg $echo "$modename: \`$vinfo' is not valid version information" 1>&2 324432b578d3Smrg exit $EXIT_FAILURE 324532b578d3Smrg fi 324632b578d3Smrg 324732b578d3Smrg # Calculate the version variables. 324832b578d3Smrg major= 324932b578d3Smrg versuffix= 325032b578d3Smrg verstring= 325132b578d3Smrg case $version_type in 325232b578d3Smrg none) ;; 325332b578d3Smrg 325432b578d3Smrg darwin) 325532b578d3Smrg # Like Linux, but with the current version available in 325632b578d3Smrg # verstring for coding it into the library header 325732b578d3Smrg major=.`expr $current - $age` 325832b578d3Smrg versuffix="$major.$age.$revision" 325932b578d3Smrg # Darwin ld doesn't like 0 for these options... 326032b578d3Smrg minor_current=`expr $current + 1` 3261d31dbc53Smrg verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" 326232b578d3Smrg ;; 326332b578d3Smrg 326432b578d3Smrg freebsd-aout) 326532b578d3Smrg major=".$current" 326632b578d3Smrg versuffix=".$current.$revision"; 326732b578d3Smrg ;; 326832b578d3Smrg 326932b578d3Smrg freebsd-elf) 327032b578d3Smrg major=".$current" 327132b578d3Smrg versuffix=".$current"; 327232b578d3Smrg ;; 327332b578d3Smrg 327432b578d3Smrg irix | nonstopux) 3275d31dbc53Smrg major=`expr $current - $age + 1` 3276d31dbc53Smrg 327732b578d3Smrg case $version_type in 327832b578d3Smrg nonstopux) verstring_prefix=nonstopux ;; 327932b578d3Smrg *) verstring_prefix=sgi ;; 328032b578d3Smrg esac 328132b578d3Smrg verstring="$verstring_prefix$major.$revision" 328232b578d3Smrg 328332b578d3Smrg # Add in all the interfaces that we are compatible with. 328432b578d3Smrg loop=$revision 328532b578d3Smrg while test "$loop" -ne 0; do 328632b578d3Smrg iface=`expr $revision - $loop` 328732b578d3Smrg loop=`expr $loop - 1` 328832b578d3Smrg verstring="$verstring_prefix$major.$iface:$verstring" 328932b578d3Smrg done 329032b578d3Smrg 329132b578d3Smrg # Before this point, $major must not contain `.'. 329232b578d3Smrg major=.$major 329332b578d3Smrg versuffix="$major.$revision" 329432b578d3Smrg ;; 329532b578d3Smrg 329632b578d3Smrg linux) 329732b578d3Smrg major=.`expr $current - $age` 329832b578d3Smrg versuffix="$major.$age.$revision" 329932b578d3Smrg ;; 330032b578d3Smrg 330132b578d3Smrg osf) 330232b578d3Smrg major=.`expr $current - $age` 330332b578d3Smrg versuffix=".$current.$age.$revision" 330432b578d3Smrg verstring="$current.$age.$revision" 330532b578d3Smrg 330632b578d3Smrg # Add in all the interfaces that we are compatible with. 330732b578d3Smrg loop=$age 330832b578d3Smrg while test "$loop" -ne 0; do 330932b578d3Smrg iface=`expr $current - $loop` 331032b578d3Smrg loop=`expr $loop - 1` 331132b578d3Smrg verstring="$verstring:${iface}.0" 331232b578d3Smrg done 331332b578d3Smrg 331432b578d3Smrg # Make executables depend on our current version. 331532b578d3Smrg verstring="$verstring:${current}.0" 331632b578d3Smrg ;; 331732b578d3Smrg 331832b578d3Smrg sunos) 331932b578d3Smrg major=".$current" 332032b578d3Smrg versuffix=".$current.$revision" 332132b578d3Smrg ;; 332232b578d3Smrg 332332b578d3Smrg windows) 332432b578d3Smrg # Use '-' rather than '.', since we only want one 332532b578d3Smrg # extension on DOS 8.3 filesystems. 332632b578d3Smrg major=`expr $current - $age` 332732b578d3Smrg versuffix="-$major" 332832b578d3Smrg ;; 332932b578d3Smrg 333032b578d3Smrg *) 333132b578d3Smrg $echo "$modename: unknown library version type \`$version_type'" 1>&2 333232b578d3Smrg $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 333332b578d3Smrg exit $EXIT_FAILURE 333432b578d3Smrg ;; 333532b578d3Smrg esac 333632b578d3Smrg 333732b578d3Smrg # Clear the version info if we defaulted, and they specified a release. 333832b578d3Smrg if test -z "$vinfo" && test -n "$release"; then 333932b578d3Smrg major= 334032b578d3Smrg case $version_type in 334132b578d3Smrg darwin) 334232b578d3Smrg # we can't check for "0.0" in archive_cmds due to quoting 334332b578d3Smrg # problems, so we reset it completely 334432b578d3Smrg verstring= 334532b578d3Smrg ;; 334632b578d3Smrg *) 334732b578d3Smrg verstring="0.0" 334832b578d3Smrg ;; 334932b578d3Smrg esac 335032b578d3Smrg if test "$need_version" = no; then 335132b578d3Smrg versuffix= 335232b578d3Smrg else 335332b578d3Smrg versuffix=".0.0" 335432b578d3Smrg fi 335532b578d3Smrg fi 335632b578d3Smrg 335732b578d3Smrg # Remove version info from name if versioning should be avoided 335832b578d3Smrg if test "$avoid_version" = yes && test "$need_version" = no; then 335932b578d3Smrg major= 336032b578d3Smrg versuffix= 336132b578d3Smrg verstring="" 336232b578d3Smrg fi 336332b578d3Smrg 336432b578d3Smrg # Check to see if the archive will have undefined symbols. 336532b578d3Smrg if test "$allow_undefined" = yes; then 336632b578d3Smrg if test "$allow_undefined_flag" = unsupported; then 336732b578d3Smrg $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 336832b578d3Smrg build_libtool_libs=no 336932b578d3Smrg build_old_libs=yes 337032b578d3Smrg fi 337132b578d3Smrg else 337232b578d3Smrg # Don't allow undefined symbols. 337332b578d3Smrg allow_undefined_flag="$no_undefined_flag" 337432b578d3Smrg fi 337532b578d3Smrg fi 337632b578d3Smrg 337732b578d3Smrg if test "$mode" != relink; then 337832b578d3Smrg # Remove our outputs, but don't remove object files since they 337932b578d3Smrg # may have been created when compiling PIC objects. 338032b578d3Smrg removelist= 338132b578d3Smrg tempremovelist=`$echo "$output_objdir/*"` 338232b578d3Smrg for p in $tempremovelist; do 338332b578d3Smrg case $p in 338432b578d3Smrg *.$objext) 338532b578d3Smrg ;; 338632b578d3Smrg $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) 338732b578d3Smrg if test "X$precious_files_regex" != "X"; then 338832b578d3Smrg if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 338932b578d3Smrg then 339032b578d3Smrg continue 339132b578d3Smrg fi 339232b578d3Smrg fi 339332b578d3Smrg removelist="$removelist $p" 339432b578d3Smrg ;; 339532b578d3Smrg *) ;; 339632b578d3Smrg esac 339732b578d3Smrg done 339832b578d3Smrg if test -n "$removelist"; then 339932b578d3Smrg $show "${rm}r $removelist" 340032b578d3Smrg $run ${rm}r $removelist 340132b578d3Smrg fi 340232b578d3Smrg fi 340332b578d3Smrg 340432b578d3Smrg # Now set the variables for building old libraries. 340532b578d3Smrg if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then 340632b578d3Smrg oldlibs="$oldlibs $output_objdir/$libname.$libext" 340732b578d3Smrg 340832b578d3Smrg # Transform .lo files to .o files. 340932b578d3Smrg oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` 341032b578d3Smrg fi 341132b578d3Smrg 341232b578d3Smrg # Eliminate all temporary directories. 3413d31dbc53Smrg for path in $notinst_path; do 3414d31dbc53Smrg lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` 3415d31dbc53Smrg deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` 3416d31dbc53Smrg dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` 3417d31dbc53Smrg done 341832b578d3Smrg 341932b578d3Smrg if test -n "$xrpath"; then 342032b578d3Smrg # If the user specified any rpath flags, then add them. 342132b578d3Smrg temp_xrpath= 342232b578d3Smrg for libdir in $xrpath; do 342332b578d3Smrg temp_xrpath="$temp_xrpath -R$libdir" 342432b578d3Smrg case "$finalize_rpath " in 342532b578d3Smrg *" $libdir "*) ;; 342632b578d3Smrg *) finalize_rpath="$finalize_rpath $libdir" ;; 342732b578d3Smrg esac 342832b578d3Smrg done 342932b578d3Smrg if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then 343032b578d3Smrg dependency_libs="$temp_xrpath $dependency_libs" 343132b578d3Smrg fi 343232b578d3Smrg fi 343332b578d3Smrg 343432b578d3Smrg # Make sure dlfiles contains only unique files that won't be dlpreopened 343532b578d3Smrg old_dlfiles="$dlfiles" 343632b578d3Smrg dlfiles= 343732b578d3Smrg for lib in $old_dlfiles; do 343832b578d3Smrg case " $dlprefiles $dlfiles " in 343932b578d3Smrg *" $lib "*) ;; 344032b578d3Smrg *) dlfiles="$dlfiles $lib" ;; 344132b578d3Smrg esac 344232b578d3Smrg done 344332b578d3Smrg 344432b578d3Smrg # Make sure dlprefiles contains only unique files 344532b578d3Smrg old_dlprefiles="$dlprefiles" 344632b578d3Smrg dlprefiles= 344732b578d3Smrg for lib in $old_dlprefiles; do 344832b578d3Smrg case "$dlprefiles " in 344932b578d3Smrg *" $lib "*) ;; 345032b578d3Smrg *) dlprefiles="$dlprefiles $lib" ;; 345132b578d3Smrg esac 345232b578d3Smrg done 345332b578d3Smrg 345432b578d3Smrg if test "$build_libtool_libs" = yes; then 345532b578d3Smrg if test -n "$rpath"; then 345632b578d3Smrg case $host in 345732b578d3Smrg *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) 345832b578d3Smrg # these systems don't actually have a c library (as such)! 345932b578d3Smrg ;; 346032b578d3Smrg *-*-rhapsody* | *-*-darwin1.[012]) 346132b578d3Smrg # Rhapsody C library is in the System framework 346232b578d3Smrg deplibs="$deplibs -framework System" 346332b578d3Smrg ;; 346432b578d3Smrg *-*-netbsd*) 346532b578d3Smrg # Don't link with libc until the a.out ld.so is fixed. 346632b578d3Smrg ;; 346732b578d3Smrg *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) 346832b578d3Smrg # Do not include libc due to us having libc/libc_r. 346932b578d3Smrg ;; 347032b578d3Smrg *-*-sco3.2v5* | *-*-sco5v6*) 347132b578d3Smrg # Causes problems with __ctype 347232b578d3Smrg ;; 347332b578d3Smrg *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) 347432b578d3Smrg # Compiler inserts libc in the correct place for threads to work 347532b578d3Smrg ;; 347632b578d3Smrg *) 347732b578d3Smrg # Add libc to deplibs on all other systems if necessary. 347832b578d3Smrg if test "$build_libtool_need_lc" = "yes"; then 347932b578d3Smrg deplibs="$deplibs -lc" 348032b578d3Smrg fi 348132b578d3Smrg ;; 348232b578d3Smrg esac 348332b578d3Smrg fi 348432b578d3Smrg 348532b578d3Smrg # Transform deplibs into only deplibs that can be linked in shared. 348632b578d3Smrg name_save=$name 348732b578d3Smrg libname_save=$libname 348832b578d3Smrg release_save=$release 348932b578d3Smrg versuffix_save=$versuffix 349032b578d3Smrg major_save=$major 349132b578d3Smrg # I'm not sure if I'm treating the release correctly. I think 349232b578d3Smrg # release should show up in the -l (ie -lgmp5) so we don't want to 349332b578d3Smrg # add it in twice. Is that correct? 349432b578d3Smrg release="" 349532b578d3Smrg versuffix="" 349632b578d3Smrg major="" 349732b578d3Smrg newdeplibs= 349832b578d3Smrg droppeddeps=no 349932b578d3Smrg case $deplibs_check_method in 350032b578d3Smrg pass_all) 350132b578d3Smrg # Don't check for shared/static. Everything works. 350232b578d3Smrg # This might be a little naive. We might want to check 350332b578d3Smrg # whether the library exists or not. But this is on 350432b578d3Smrg # osf3 & osf4 and I'm not really sure... Just 350532b578d3Smrg # implementing what was already the behavior. 350632b578d3Smrg newdeplibs=$deplibs 350732b578d3Smrg ;; 350832b578d3Smrg test_compile) 350932b578d3Smrg # This code stresses the "libraries are programs" paradigm to its 351032b578d3Smrg # limits. Maybe even breaks it. We compile a program, linking it 351132b578d3Smrg # against the deplibs as a proxy for the library. Then we can check 351232b578d3Smrg # whether they linked in statically or dynamically with ldd. 351332b578d3Smrg $rm conftest.c 351432b578d3Smrg cat > conftest.c <<EOF 351532b578d3Smrg int main() { return 0; } 351632b578d3SmrgEOF 351732b578d3Smrg $rm conftest 3518d31dbc53Smrg $LTCC $LTCFLAGS -o conftest conftest.c $deplibs 3519d31dbc53Smrg if test "$?" -eq 0 ; then 352032b578d3Smrg ldd_output=`ldd conftest` 352132b578d3Smrg for i in $deplibs; do 352232b578d3Smrg name=`expr $i : '-l\(.*\)'` 352332b578d3Smrg # If $name is empty we are operating on a -L argument. 3524d31dbc53Smrg if test "$name" != "" && test "$name" -ne "0"; then 352532b578d3Smrg if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 352632b578d3Smrg case " $predeps $postdeps " in 352732b578d3Smrg *" $i "*) 352832b578d3Smrg newdeplibs="$newdeplibs $i" 352932b578d3Smrg i="" 353032b578d3Smrg ;; 353132b578d3Smrg esac 353232b578d3Smrg fi 353332b578d3Smrg if test -n "$i" ; then 353432b578d3Smrg libname=`eval \\$echo \"$libname_spec\"` 353532b578d3Smrg deplib_matches=`eval \\$echo \"$library_names_spec\"` 353632b578d3Smrg set dummy $deplib_matches 353732b578d3Smrg deplib_match=$2 353832b578d3Smrg if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then 353932b578d3Smrg newdeplibs="$newdeplibs $i" 354032b578d3Smrg else 354132b578d3Smrg droppeddeps=yes 354232b578d3Smrg $echo 354332b578d3Smrg $echo "*** Warning: dynamic linker does not accept needed library $i." 354432b578d3Smrg $echo "*** I have the capability to make that library automatically link in when" 354532b578d3Smrg $echo "*** you link to this library. But I can only do this if you have a" 354632b578d3Smrg $echo "*** shared version of the library, which I believe you do not have" 354732b578d3Smrg $echo "*** because a test_compile did reveal that the linker did not use it for" 354832b578d3Smrg $echo "*** its dynamic dependency list that programs get resolved with at runtime." 354932b578d3Smrg fi 355032b578d3Smrg fi 355132b578d3Smrg else 355232b578d3Smrg newdeplibs="$newdeplibs $i" 355332b578d3Smrg fi 355432b578d3Smrg done 355532b578d3Smrg else 355632b578d3Smrg # Error occurred in the first compile. Let's try to salvage 355732b578d3Smrg # the situation: Compile a separate program for each library. 355832b578d3Smrg for i in $deplibs; do 355932b578d3Smrg name=`expr $i : '-l\(.*\)'` 356032b578d3Smrg # If $name is empty we are operating on a -L argument. 356132b578d3Smrg if test "$name" != "" && test "$name" != "0"; then 356232b578d3Smrg $rm conftest 3563d31dbc53Smrg $LTCC $LTCFLAGS -o conftest conftest.c $i 3564d31dbc53Smrg # Did it work? 3565d31dbc53Smrg if test "$?" -eq 0 ; then 356632b578d3Smrg ldd_output=`ldd conftest` 356732b578d3Smrg if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 356832b578d3Smrg case " $predeps $postdeps " in 356932b578d3Smrg *" $i "*) 357032b578d3Smrg newdeplibs="$newdeplibs $i" 357132b578d3Smrg i="" 357232b578d3Smrg ;; 357332b578d3Smrg esac 357432b578d3Smrg fi 357532b578d3Smrg if test -n "$i" ; then 357632b578d3Smrg libname=`eval \\$echo \"$libname_spec\"` 357732b578d3Smrg deplib_matches=`eval \\$echo \"$library_names_spec\"` 357832b578d3Smrg set dummy $deplib_matches 357932b578d3Smrg deplib_match=$2 358032b578d3Smrg if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then 358132b578d3Smrg newdeplibs="$newdeplibs $i" 358232b578d3Smrg else 358332b578d3Smrg droppeddeps=yes 358432b578d3Smrg $echo 358532b578d3Smrg $echo "*** Warning: dynamic linker does not accept needed library $i." 358632b578d3Smrg $echo "*** I have the capability to make that library automatically link in when" 358732b578d3Smrg $echo "*** you link to this library. But I can only do this if you have a" 358832b578d3Smrg $echo "*** shared version of the library, which you do not appear to have" 358932b578d3Smrg $echo "*** because a test_compile did reveal that the linker did not use this one" 359032b578d3Smrg $echo "*** as a dynamic dependency that programs can get resolved with at runtime." 359132b578d3Smrg fi 359232b578d3Smrg fi 359332b578d3Smrg else 359432b578d3Smrg droppeddeps=yes 359532b578d3Smrg $echo 359632b578d3Smrg $echo "*** Warning! Library $i is needed by this library but I was not able to" 3597d31dbc53Smrg $echo "*** make it link in! You will probably need to install it or some" 359832b578d3Smrg $echo "*** library that it depends on before this library will be fully" 359932b578d3Smrg $echo "*** functional. Installing it before continuing would be even better." 360032b578d3Smrg fi 360132b578d3Smrg else 360232b578d3Smrg newdeplibs="$newdeplibs $i" 360332b578d3Smrg fi 360432b578d3Smrg done 360532b578d3Smrg fi 360632b578d3Smrg ;; 360732b578d3Smrg file_magic*) 360832b578d3Smrg set dummy $deplibs_check_method 360932b578d3Smrg file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 361032b578d3Smrg for a_deplib in $deplibs; do 361132b578d3Smrg name=`expr $a_deplib : '-l\(.*\)'` 361232b578d3Smrg # If $name is empty we are operating on a -L argument. 361332b578d3Smrg if test "$name" != "" && test "$name" != "0"; then 361432b578d3Smrg if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 361532b578d3Smrg case " $predeps $postdeps " in 361632b578d3Smrg *" $a_deplib "*) 361732b578d3Smrg newdeplibs="$newdeplibs $a_deplib" 361832b578d3Smrg a_deplib="" 361932b578d3Smrg ;; 362032b578d3Smrg esac 362132b578d3Smrg fi 362232b578d3Smrg if test -n "$a_deplib" ; then 362332b578d3Smrg libname=`eval \\$echo \"$libname_spec\"` 362432b578d3Smrg for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do 362532b578d3Smrg potential_libs=`ls $i/$libname[.-]* 2>/dev/null` 362632b578d3Smrg for potent_lib in $potential_libs; do 362732b578d3Smrg # Follow soft links. 362832b578d3Smrg if ls -lLd "$potent_lib" 2>/dev/null \ 362932b578d3Smrg | grep " -> " >/dev/null; then 363032b578d3Smrg continue 363132b578d3Smrg fi 363232b578d3Smrg # The statement above tries to avoid entering an 363332b578d3Smrg # endless loop below, in case of cyclic links. 363432b578d3Smrg # We might still enter an endless loop, since a link 363532b578d3Smrg # loop can be closed while we follow links, 363632b578d3Smrg # but so what? 363732b578d3Smrg potlib="$potent_lib" 363832b578d3Smrg while test -h "$potlib" 2>/dev/null; do 363932b578d3Smrg potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` 364032b578d3Smrg case $potliblink in 364132b578d3Smrg [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; 364232b578d3Smrg *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; 364332b578d3Smrg esac 364432b578d3Smrg done 364532b578d3Smrg if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ 364632b578d3Smrg | ${SED} 10q \ 364732b578d3Smrg | $EGREP "$file_magic_regex" > /dev/null; then 364832b578d3Smrg newdeplibs="$newdeplibs $a_deplib" 364932b578d3Smrg a_deplib="" 365032b578d3Smrg break 2 365132b578d3Smrg fi 365232b578d3Smrg done 365332b578d3Smrg done 365432b578d3Smrg fi 365532b578d3Smrg if test -n "$a_deplib" ; then 365632b578d3Smrg droppeddeps=yes 365732b578d3Smrg $echo 365832b578d3Smrg $echo "*** Warning: linker path does not have real file for library $a_deplib." 365932b578d3Smrg $echo "*** I have the capability to make that library automatically link in when" 366032b578d3Smrg $echo "*** you link to this library. But I can only do this if you have a" 366132b578d3Smrg $echo "*** shared version of the library, which you do not appear to have" 366232b578d3Smrg $echo "*** because I did check the linker path looking for a file starting" 366332b578d3Smrg if test -z "$potlib" ; then 366432b578d3Smrg $echo "*** with $libname but no candidates were found. (...for file magic test)" 366532b578d3Smrg else 366632b578d3Smrg $echo "*** with $libname and none of the candidates passed a file format test" 366732b578d3Smrg $echo "*** using a file magic. Last file checked: $potlib" 366832b578d3Smrg fi 366932b578d3Smrg fi 367032b578d3Smrg else 367132b578d3Smrg # Add a -L argument. 367232b578d3Smrg newdeplibs="$newdeplibs $a_deplib" 367332b578d3Smrg fi 367432b578d3Smrg done # Gone through all deplibs. 367532b578d3Smrg ;; 367632b578d3Smrg match_pattern*) 367732b578d3Smrg set dummy $deplibs_check_method 367832b578d3Smrg match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 367932b578d3Smrg for a_deplib in $deplibs; do 368032b578d3Smrg name=`expr $a_deplib : '-l\(.*\)'` 368132b578d3Smrg # If $name is empty we are operating on a -L argument. 368232b578d3Smrg if test -n "$name" && test "$name" != "0"; then 368332b578d3Smrg if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 368432b578d3Smrg case " $predeps $postdeps " in 368532b578d3Smrg *" $a_deplib "*) 368632b578d3Smrg newdeplibs="$newdeplibs $a_deplib" 368732b578d3Smrg a_deplib="" 368832b578d3Smrg ;; 368932b578d3Smrg esac 369032b578d3Smrg fi 369132b578d3Smrg if test -n "$a_deplib" ; then 369232b578d3Smrg libname=`eval \\$echo \"$libname_spec\"` 369332b578d3Smrg for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do 369432b578d3Smrg potential_libs=`ls $i/$libname[.-]* 2>/dev/null` 369532b578d3Smrg for potent_lib in $potential_libs; do 369632b578d3Smrg potlib="$potent_lib" # see symlink-check above in file_magic test 369732b578d3Smrg if eval $echo \"$potent_lib\" 2>/dev/null \ 369832b578d3Smrg | ${SED} 10q \ 369932b578d3Smrg | $EGREP "$match_pattern_regex" > /dev/null; then 370032b578d3Smrg newdeplibs="$newdeplibs $a_deplib" 370132b578d3Smrg a_deplib="" 370232b578d3Smrg break 2 370332b578d3Smrg fi 370432b578d3Smrg done 370532b578d3Smrg done 370632b578d3Smrg fi 370732b578d3Smrg if test -n "$a_deplib" ; then 370832b578d3Smrg droppeddeps=yes 370932b578d3Smrg $echo 371032b578d3Smrg $echo "*** Warning: linker path does not have real file for library $a_deplib." 371132b578d3Smrg $echo "*** I have the capability to make that library automatically link in when" 371232b578d3Smrg $echo "*** you link to this library. But I can only do this if you have a" 371332b578d3Smrg $echo "*** shared version of the library, which you do not appear to have" 371432b578d3Smrg $echo "*** because I did check the linker path looking for a file starting" 371532b578d3Smrg if test -z "$potlib" ; then 371632b578d3Smrg $echo "*** with $libname but no candidates were found. (...for regex pattern test)" 371732b578d3Smrg else 371832b578d3Smrg $echo "*** with $libname and none of the candidates passed a file format test" 371932b578d3Smrg $echo "*** using a regex pattern. Last file checked: $potlib" 372032b578d3Smrg fi 372132b578d3Smrg fi 372232b578d3Smrg else 372332b578d3Smrg # Add a -L argument. 372432b578d3Smrg newdeplibs="$newdeplibs $a_deplib" 372532b578d3Smrg fi 372632b578d3Smrg done # Gone through all deplibs. 372732b578d3Smrg ;; 372832b578d3Smrg none | unknown | *) 372932b578d3Smrg newdeplibs="" 373032b578d3Smrg tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ 373132b578d3Smrg -e 's/ -[LR][^ ]*//g'` 373232b578d3Smrg if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 373332b578d3Smrg for i in $predeps $postdeps ; do 373432b578d3Smrg # can't use Xsed below, because $i might contain '/' 373532b578d3Smrg tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` 373632b578d3Smrg done 373732b578d3Smrg fi 373832b578d3Smrg if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ 373932b578d3Smrg | grep . >/dev/null; then 374032b578d3Smrg $echo 374132b578d3Smrg if test "X$deplibs_check_method" = "Xnone"; then 374232b578d3Smrg $echo "*** Warning: inter-library dependencies are not supported in this platform." 374332b578d3Smrg else 374432b578d3Smrg $echo "*** Warning: inter-library dependencies are not known to be supported." 374532b578d3Smrg fi 374632b578d3Smrg $echo "*** All declared inter-library dependencies are being dropped." 374732b578d3Smrg droppeddeps=yes 374832b578d3Smrg fi 374932b578d3Smrg ;; 375032b578d3Smrg esac 375132b578d3Smrg versuffix=$versuffix_save 375232b578d3Smrg major=$major_save 375332b578d3Smrg release=$release_save 375432b578d3Smrg libname=$libname_save 375532b578d3Smrg name=$name_save 375632b578d3Smrg 375732b578d3Smrg case $host in 375832b578d3Smrg *-*-rhapsody* | *-*-darwin1.[012]) 375932b578d3Smrg # On Rhapsody replace the C library is the System framework 376032b578d3Smrg newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` 376132b578d3Smrg ;; 376232b578d3Smrg esac 376332b578d3Smrg 376432b578d3Smrg if test "$droppeddeps" = yes; then 376532b578d3Smrg if test "$module" = yes; then 376632b578d3Smrg $echo 376732b578d3Smrg $echo "*** Warning: libtool could not satisfy all declared inter-library" 376832b578d3Smrg $echo "*** dependencies of module $libname. Therefore, libtool will create" 376932b578d3Smrg $echo "*** a static module, that should work as long as the dlopening" 377032b578d3Smrg $echo "*** application is linked with the -dlopen flag." 377132b578d3Smrg if test -z "$global_symbol_pipe"; then 377232b578d3Smrg $echo 377332b578d3Smrg $echo "*** However, this would only work if libtool was able to extract symbol" 377432b578d3Smrg $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" 377532b578d3Smrg $echo "*** not find such a program. So, this module is probably useless." 377632b578d3Smrg $echo "*** \`nm' from GNU binutils and a full rebuild may help." 377732b578d3Smrg fi 377832b578d3Smrg if test "$build_old_libs" = no; then 377932b578d3Smrg oldlibs="$output_objdir/$libname.$libext" 378032b578d3Smrg build_libtool_libs=module 378132b578d3Smrg build_old_libs=yes 378232b578d3Smrg else 378332b578d3Smrg build_libtool_libs=no 378432b578d3Smrg fi 378532b578d3Smrg else 378632b578d3Smrg $echo "*** The inter-library dependencies that have been dropped here will be" 378732b578d3Smrg $echo "*** automatically added whenever a program is linked with this library" 378832b578d3Smrg $echo "*** or is declared to -dlopen it." 378932b578d3Smrg 379032b578d3Smrg if test "$allow_undefined" = no; then 379132b578d3Smrg $echo 379232b578d3Smrg $echo "*** Since this library must not contain undefined symbols," 379332b578d3Smrg $echo "*** because either the platform does not support them or" 379432b578d3Smrg $echo "*** it was explicitly requested with -no-undefined," 379532b578d3Smrg $echo "*** libtool will only create a static version of it." 379632b578d3Smrg if test "$build_old_libs" = no; then 379732b578d3Smrg oldlibs="$output_objdir/$libname.$libext" 379832b578d3Smrg build_libtool_libs=module 379932b578d3Smrg build_old_libs=yes 380032b578d3Smrg else 380132b578d3Smrg build_libtool_libs=no 380232b578d3Smrg fi 380332b578d3Smrg fi 380432b578d3Smrg fi 380532b578d3Smrg fi 380632b578d3Smrg # Done checking deplibs! 380732b578d3Smrg deplibs=$newdeplibs 380832b578d3Smrg fi 380932b578d3Smrg 381032b578d3Smrg 381132b578d3Smrg # move library search paths that coincide with paths to not yet 381232b578d3Smrg # installed libraries to the beginning of the library search list 381332b578d3Smrg new_libs= 381432b578d3Smrg for path in $notinst_path; do 381532b578d3Smrg case " $new_libs " in 381632b578d3Smrg *" -L$path/$objdir "*) ;; 381732b578d3Smrg *) 381832b578d3Smrg case " $deplibs " in 381932b578d3Smrg *" -L$path/$objdir "*) 382032b578d3Smrg new_libs="$new_libs -L$path/$objdir" ;; 382132b578d3Smrg esac 382232b578d3Smrg ;; 382332b578d3Smrg esac 382432b578d3Smrg done 382532b578d3Smrg for deplib in $deplibs; do 382632b578d3Smrg case $deplib in 382732b578d3Smrg -L*) 382832b578d3Smrg case " $new_libs " in 382932b578d3Smrg *" $deplib "*) ;; 383032b578d3Smrg *) new_libs="$new_libs $deplib" ;; 383132b578d3Smrg esac 383232b578d3Smrg ;; 383332b578d3Smrg *) new_libs="$new_libs $deplib" ;; 383432b578d3Smrg esac 383532b578d3Smrg done 383632b578d3Smrg deplibs="$new_libs" 383732b578d3Smrg 383832b578d3Smrg 383932b578d3Smrg # All the library-specific variables (install_libdir is set above). 384032b578d3Smrg library_names= 384132b578d3Smrg old_library= 384232b578d3Smrg dlname= 384332b578d3Smrg 384432b578d3Smrg # Test again, we may have decided not to build it any more 384532b578d3Smrg if test "$build_libtool_libs" = yes; then 384632b578d3Smrg if test "$hardcode_into_libs" = yes; then 384732b578d3Smrg # Hardcode the library paths 384832b578d3Smrg hardcode_libdirs= 384932b578d3Smrg dep_rpath= 385032b578d3Smrg rpath="$finalize_rpath" 385132b578d3Smrg test "$mode" != relink && rpath="$compile_rpath$rpath" 385232b578d3Smrg for libdir in $rpath; do 385332b578d3Smrg if test -n "$hardcode_libdir_flag_spec"; then 385432b578d3Smrg if test -n "$hardcode_libdir_separator"; then 385532b578d3Smrg if test -z "$hardcode_libdirs"; then 385632b578d3Smrg hardcode_libdirs="$libdir" 385732b578d3Smrg else 385832b578d3Smrg # Just accumulate the unique libdirs. 385932b578d3Smrg case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in 386032b578d3Smrg *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) 386132b578d3Smrg ;; 386232b578d3Smrg *) 386332b578d3Smrg hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" 386432b578d3Smrg ;; 386532b578d3Smrg esac 386632b578d3Smrg fi 386732b578d3Smrg else 386832b578d3Smrg eval flag=\"$hardcode_libdir_flag_spec\" 386932b578d3Smrg dep_rpath="$dep_rpath $flag" 387032b578d3Smrg fi 387132b578d3Smrg elif test -n "$runpath_var"; then 387232b578d3Smrg case "$perm_rpath " in 387332b578d3Smrg *" $libdir "*) ;; 387432b578d3Smrg *) perm_rpath="$perm_rpath $libdir" ;; 387532b578d3Smrg esac 387632b578d3Smrg fi 387732b578d3Smrg done 387832b578d3Smrg # Substitute the hardcoded libdirs into the rpath. 387932b578d3Smrg if test -n "$hardcode_libdir_separator" && 388032b578d3Smrg test -n "$hardcode_libdirs"; then 388132b578d3Smrg libdir="$hardcode_libdirs" 388232b578d3Smrg if test -n "$hardcode_libdir_flag_spec_ld"; then 3883d31dbc53Smrg eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" 388432b578d3Smrg else 388532b578d3Smrg eval dep_rpath=\"$hardcode_libdir_flag_spec\" 388632b578d3Smrg fi 388732b578d3Smrg fi 388832b578d3Smrg if test -n "$runpath_var" && test -n "$perm_rpath"; then 388932b578d3Smrg # We should set the runpath_var. 389032b578d3Smrg rpath= 389132b578d3Smrg for dir in $perm_rpath; do 389232b578d3Smrg rpath="$rpath$dir:" 389332b578d3Smrg done 389432b578d3Smrg eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" 389532b578d3Smrg fi 389632b578d3Smrg test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" 389732b578d3Smrg fi 389832b578d3Smrg 389932b578d3Smrg shlibpath="$finalize_shlibpath" 390032b578d3Smrg test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" 390132b578d3Smrg if test -n "$shlibpath"; then 390232b578d3Smrg eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" 390332b578d3Smrg fi 390432b578d3Smrg 390532b578d3Smrg # Get the real and link names of the library. 390632b578d3Smrg eval shared_ext=\"$shrext_cmds\" 390732b578d3Smrg eval library_names=\"$library_names_spec\" 390832b578d3Smrg set dummy $library_names 390932b578d3Smrg realname="$2" 391032b578d3Smrg shift; shift 391132b578d3Smrg 391232b578d3Smrg if test -n "$soname_spec"; then 391332b578d3Smrg eval soname=\"$soname_spec\" 391432b578d3Smrg else 391532b578d3Smrg soname="$realname" 391632b578d3Smrg fi 391732b578d3Smrg if test -z "$dlname"; then 391832b578d3Smrg dlname=$soname 391932b578d3Smrg fi 392032b578d3Smrg 392132b578d3Smrg lib="$output_objdir/$realname" 392232b578d3Smrg linknames= 392332b578d3Smrg for link 392432b578d3Smrg do 392532b578d3Smrg linknames="$linknames $link" 392632b578d3Smrg done 392732b578d3Smrg 392832b578d3Smrg # Use standard objects if they are pic 392932b578d3Smrg test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` 393032b578d3Smrg 393132b578d3Smrg # Prepare the list of exported symbols 393232b578d3Smrg if test -z "$export_symbols"; then 393332b578d3Smrg if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then 393432b578d3Smrg $show "generating symbol list for \`$libname.la'" 393532b578d3Smrg export_symbols="$output_objdir/$libname.exp" 393632b578d3Smrg $run $rm $export_symbols 393732b578d3Smrg cmds=$export_symbols_cmds 393832b578d3Smrg save_ifs="$IFS"; IFS='~' 393932b578d3Smrg for cmd in $cmds; do 394032b578d3Smrg IFS="$save_ifs" 394132b578d3Smrg eval cmd=\"$cmd\" 394232b578d3Smrg if len=`expr "X$cmd" : ".*"` && 394332b578d3Smrg test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then 394432b578d3Smrg $show "$cmd" 394532b578d3Smrg $run eval "$cmd" || exit $? 394632b578d3Smrg skipped_export=false 394732b578d3Smrg else 394832b578d3Smrg # The command line is too long to execute in one step. 394932b578d3Smrg $show "using reloadable object file for export list..." 395032b578d3Smrg skipped_export=: 395132b578d3Smrg # Break out early, otherwise skipped_export may be 395232b578d3Smrg # set to false by a later but shorter cmd. 395332b578d3Smrg break 395432b578d3Smrg fi 395532b578d3Smrg done 395632b578d3Smrg IFS="$save_ifs" 395732b578d3Smrg if test -n "$export_symbols_regex"; then 395832b578d3Smrg $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" 395932b578d3Smrg $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' 396032b578d3Smrg $show "$mv \"${export_symbols}T\" \"$export_symbols\"" 396132b578d3Smrg $run eval '$mv "${export_symbols}T" "$export_symbols"' 396232b578d3Smrg fi 396332b578d3Smrg fi 396432b578d3Smrg fi 396532b578d3Smrg 396632b578d3Smrg if test -n "$export_symbols" && test -n "$include_expsyms"; then 396732b578d3Smrg $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' 396832b578d3Smrg fi 396932b578d3Smrg 397032b578d3Smrg tmp_deplibs= 397132b578d3Smrg for test_deplib in $deplibs; do 397232b578d3Smrg case " $convenience " in 397332b578d3Smrg *" $test_deplib "*) ;; 397432b578d3Smrg *) 397532b578d3Smrg tmp_deplibs="$tmp_deplibs $test_deplib" 397632b578d3Smrg ;; 397732b578d3Smrg esac 397832b578d3Smrg done 397932b578d3Smrg deplibs="$tmp_deplibs" 398032b578d3Smrg 398132b578d3Smrg if test -n "$convenience"; then 398232b578d3Smrg if test -n "$whole_archive_flag_spec"; then 398332b578d3Smrg save_libobjs=$libobjs 398432b578d3Smrg eval libobjs=\"\$libobjs $whole_archive_flag_spec\" 398532b578d3Smrg else 398632b578d3Smrg gentop="$output_objdir/${outputname}x" 398732b578d3Smrg generated="$generated $gentop" 398832b578d3Smrg 398932b578d3Smrg func_extract_archives $gentop $convenience 399032b578d3Smrg libobjs="$libobjs $func_extract_archives_result" 399132b578d3Smrg fi 399232b578d3Smrg fi 399332b578d3Smrg 399432b578d3Smrg if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then 399532b578d3Smrg eval flag=\"$thread_safe_flag_spec\" 399632b578d3Smrg linker_flags="$linker_flags $flag" 399732b578d3Smrg fi 399832b578d3Smrg 399932b578d3Smrg # Make a backup of the uninstalled library when relinking 400032b578d3Smrg if test "$mode" = relink; then 400132b578d3Smrg $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? 400232b578d3Smrg fi 400332b578d3Smrg 400432b578d3Smrg # Do each of the archive commands. 400532b578d3Smrg if test "$module" = yes && test -n "$module_cmds" ; then 400632b578d3Smrg if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then 400732b578d3Smrg eval test_cmds=\"$module_expsym_cmds\" 400832b578d3Smrg cmds=$module_expsym_cmds 400932b578d3Smrg else 401032b578d3Smrg eval test_cmds=\"$module_cmds\" 401132b578d3Smrg cmds=$module_cmds 401232b578d3Smrg fi 401332b578d3Smrg else 401432b578d3Smrg if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then 401532b578d3Smrg eval test_cmds=\"$archive_expsym_cmds\" 401632b578d3Smrg cmds=$archive_expsym_cmds 401732b578d3Smrg else 401832b578d3Smrg eval test_cmds=\"$archive_cmds\" 401932b578d3Smrg cmds=$archive_cmds 402032b578d3Smrg fi 402132b578d3Smrg fi 402232b578d3Smrg 402332b578d3Smrg if test "X$skipped_export" != "X:" && 402432b578d3Smrg len=`expr "X$test_cmds" : ".*" 2>/dev/null` && 402532b578d3Smrg test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then 402632b578d3Smrg : 402732b578d3Smrg else 402832b578d3Smrg # The command line is too long to link in one step, link piecewise. 402932b578d3Smrg $echo "creating reloadable object files..." 403032b578d3Smrg 403132b578d3Smrg # Save the value of $output and $libobjs because we want to 403232b578d3Smrg # use them later. If we have whole_archive_flag_spec, we 403332b578d3Smrg # want to use save_libobjs as it was before 403432b578d3Smrg # whole_archive_flag_spec was expanded, because we can't 403532b578d3Smrg # assume the linker understands whole_archive_flag_spec. 403632b578d3Smrg # This may have to be revisited, in case too many 403732b578d3Smrg # convenience libraries get linked in and end up exceeding 403832b578d3Smrg # the spec. 403932b578d3Smrg if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then 404032b578d3Smrg save_libobjs=$libobjs 404132b578d3Smrg fi 404232b578d3Smrg save_output=$output 404332b578d3Smrg output_la=`$echo "X$output" | $Xsed -e "$basename"` 404432b578d3Smrg 404532b578d3Smrg # Clear the reloadable object creation command queue and 404632b578d3Smrg # initialize k to one. 404732b578d3Smrg test_cmds= 404832b578d3Smrg concat_cmds= 404932b578d3Smrg objlist= 405032b578d3Smrg delfiles= 405132b578d3Smrg last_robj= 405232b578d3Smrg k=1 405332b578d3Smrg output=$output_objdir/$output_la-${k}.$objext 405432b578d3Smrg # Loop over the list of objects to be linked. 405532b578d3Smrg for obj in $save_libobjs 405632b578d3Smrg do 405732b578d3Smrg eval test_cmds=\"$reload_cmds $objlist $last_robj\" 405832b578d3Smrg if test "X$objlist" = X || 405932b578d3Smrg { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && 406032b578d3Smrg test "$len" -le "$max_cmd_len"; }; then 406132b578d3Smrg objlist="$objlist $obj" 406232b578d3Smrg else 406332b578d3Smrg # The command $test_cmds is almost too long, add a 406432b578d3Smrg # command to the queue. 406532b578d3Smrg if test "$k" -eq 1 ; then 406632b578d3Smrg # The first file doesn't have a previous command to add. 406732b578d3Smrg eval concat_cmds=\"$reload_cmds $objlist $last_robj\" 406832b578d3Smrg else 406932b578d3Smrg # All subsequent reloadable object files will link in 407032b578d3Smrg # the last one created. 407132b578d3Smrg eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" 407232b578d3Smrg fi 407332b578d3Smrg last_robj=$output_objdir/$output_la-${k}.$objext 407432b578d3Smrg k=`expr $k + 1` 407532b578d3Smrg output=$output_objdir/$output_la-${k}.$objext 407632b578d3Smrg objlist=$obj 407732b578d3Smrg len=1 407832b578d3Smrg fi 407932b578d3Smrg done 408032b578d3Smrg # Handle the remaining objects by creating one last 408132b578d3Smrg # reloadable object file. All subsequent reloadable object 408232b578d3Smrg # files will link in the last one created. 408332b578d3Smrg test -z "$concat_cmds" || concat_cmds=$concat_cmds~ 408432b578d3Smrg eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" 408532b578d3Smrg 408632b578d3Smrg if ${skipped_export-false}; then 408732b578d3Smrg $show "generating symbol list for \`$libname.la'" 408832b578d3Smrg export_symbols="$output_objdir/$libname.exp" 408932b578d3Smrg $run $rm $export_symbols 409032b578d3Smrg libobjs=$output 409132b578d3Smrg # Append the command to create the export file. 409232b578d3Smrg eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" 409332b578d3Smrg fi 409432b578d3Smrg 409532b578d3Smrg # Set up a command to remove the reloadable object files 409632b578d3Smrg # after they are used. 409732b578d3Smrg i=0 409832b578d3Smrg while test "$i" -lt "$k" 409932b578d3Smrg do 410032b578d3Smrg i=`expr $i + 1` 410132b578d3Smrg delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" 410232b578d3Smrg done 410332b578d3Smrg 410432b578d3Smrg $echo "creating a temporary reloadable object file: $output" 410532b578d3Smrg 410632b578d3Smrg # Loop through the commands generated above and execute them. 410732b578d3Smrg save_ifs="$IFS"; IFS='~' 410832b578d3Smrg for cmd in $concat_cmds; do 410932b578d3Smrg IFS="$save_ifs" 411032b578d3Smrg $show "$cmd" 411132b578d3Smrg $run eval "$cmd" || exit $? 411232b578d3Smrg done 411332b578d3Smrg IFS="$save_ifs" 411432b578d3Smrg 411532b578d3Smrg libobjs=$output 411632b578d3Smrg # Restore the value of output. 411732b578d3Smrg output=$save_output 411832b578d3Smrg 411932b578d3Smrg if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then 412032b578d3Smrg eval libobjs=\"\$libobjs $whole_archive_flag_spec\" 412132b578d3Smrg fi 412232b578d3Smrg # Expand the library linking commands again to reset the 412332b578d3Smrg # value of $libobjs for piecewise linking. 412432b578d3Smrg 412532b578d3Smrg # Do each of the archive commands. 412632b578d3Smrg if test "$module" = yes && test -n "$module_cmds" ; then 412732b578d3Smrg if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then 412832b578d3Smrg cmds=$module_expsym_cmds 412932b578d3Smrg else 413032b578d3Smrg cmds=$module_cmds 413132b578d3Smrg fi 413232b578d3Smrg else 413332b578d3Smrg if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then 413432b578d3Smrg cmds=$archive_expsym_cmds 413532b578d3Smrg else 413632b578d3Smrg cmds=$archive_cmds 413732b578d3Smrg fi 413832b578d3Smrg fi 413932b578d3Smrg 414032b578d3Smrg # Append the command to remove the reloadable object files 414132b578d3Smrg # to the just-reset $cmds. 414232b578d3Smrg eval cmds=\"\$cmds~\$rm $delfiles\" 414332b578d3Smrg fi 414432b578d3Smrg save_ifs="$IFS"; IFS='~' 414532b578d3Smrg for cmd in $cmds; do 414632b578d3Smrg IFS="$save_ifs" 414732b578d3Smrg eval cmd=\"$cmd\" 414832b578d3Smrg $show "$cmd" 414932b578d3Smrg $run eval "$cmd" || { 415032b578d3Smrg lt_exit=$? 415132b578d3Smrg 415232b578d3Smrg # Restore the uninstalled library and exit 415332b578d3Smrg if test "$mode" = relink; then 415432b578d3Smrg $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' 415532b578d3Smrg fi 415632b578d3Smrg 415732b578d3Smrg exit $lt_exit 415832b578d3Smrg } 415932b578d3Smrg done 416032b578d3Smrg IFS="$save_ifs" 416132b578d3Smrg 416232b578d3Smrg # Restore the uninstalled library and exit 416332b578d3Smrg if test "$mode" = relink; then 416432b578d3Smrg $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? 416532b578d3Smrg 416632b578d3Smrg if test -n "$convenience"; then 416732b578d3Smrg if test -z "$whole_archive_flag_spec"; then 416832b578d3Smrg $show "${rm}r $gentop" 416932b578d3Smrg $run ${rm}r "$gentop" 417032b578d3Smrg fi 417132b578d3Smrg fi 417232b578d3Smrg 417332b578d3Smrg exit $EXIT_SUCCESS 417432b578d3Smrg fi 417532b578d3Smrg 417632b578d3Smrg # Create links to the real library. 417732b578d3Smrg for linkname in $linknames; do 417832b578d3Smrg if test "$realname" != "$linkname"; then 417932b578d3Smrg $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" 418032b578d3Smrg $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? 418132b578d3Smrg fi 418232b578d3Smrg done 418332b578d3Smrg 418432b578d3Smrg # If -module or -export-dynamic was specified, set the dlname. 418532b578d3Smrg if test "$module" = yes || test "$export_dynamic" = yes; then 418632b578d3Smrg # On all known operating systems, these are identical. 418732b578d3Smrg dlname="$soname" 418832b578d3Smrg fi 418932b578d3Smrg fi 419032b578d3Smrg ;; 419132b578d3Smrg 419232b578d3Smrg obj) 419332b578d3Smrg if test -n "$deplibs"; then 419432b578d3Smrg $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 419532b578d3Smrg fi 419632b578d3Smrg 419732b578d3Smrg if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then 419832b578d3Smrg $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 419932b578d3Smrg fi 420032b578d3Smrg 420132b578d3Smrg if test -n "$rpath"; then 420232b578d3Smrg $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 420332b578d3Smrg fi 420432b578d3Smrg 420532b578d3Smrg if test -n "$xrpath"; then 420632b578d3Smrg $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 420732b578d3Smrg fi 420832b578d3Smrg 420932b578d3Smrg if test -n "$vinfo"; then 421032b578d3Smrg $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 421132b578d3Smrg fi 421232b578d3Smrg 421332b578d3Smrg if test -n "$release"; then 421432b578d3Smrg $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 421532b578d3Smrg fi 421632b578d3Smrg 421732b578d3Smrg case $output in 421832b578d3Smrg *.lo) 421932b578d3Smrg if test -n "$objs$old_deplibs"; then 422032b578d3Smrg $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 422132b578d3Smrg exit $EXIT_FAILURE 422232b578d3Smrg fi 422332b578d3Smrg libobj="$output" 422432b578d3Smrg obj=`$echo "X$output" | $Xsed -e "$lo2o"` 422532b578d3Smrg ;; 422632b578d3Smrg *) 422732b578d3Smrg libobj= 422832b578d3Smrg obj="$output" 422932b578d3Smrg ;; 423032b578d3Smrg esac 423132b578d3Smrg 423232b578d3Smrg # Delete the old objects. 423332b578d3Smrg $run $rm $obj $libobj 423432b578d3Smrg 423532b578d3Smrg # Objects from convenience libraries. This assumes 423632b578d3Smrg # single-version convenience libraries. Whenever we create 423732b578d3Smrg # different ones for PIC/non-PIC, this we'll have to duplicate 423832b578d3Smrg # the extraction. 423932b578d3Smrg reload_conv_objs= 424032b578d3Smrg gentop= 424132b578d3Smrg # reload_cmds runs $LD directly, so let us get rid of 4242d31dbc53Smrg # -Wl from whole_archive_flag_spec 424332b578d3Smrg wl= 424432b578d3Smrg 424532b578d3Smrg if test -n "$convenience"; then 424632b578d3Smrg if test -n "$whole_archive_flag_spec"; then 4247d31dbc53Smrg eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" 424832b578d3Smrg else 424932b578d3Smrg gentop="$output_objdir/${obj}x" 425032b578d3Smrg generated="$generated $gentop" 425132b578d3Smrg 425232b578d3Smrg func_extract_archives $gentop $convenience 425332b578d3Smrg reload_conv_objs="$reload_objs $func_extract_archives_result" 425432b578d3Smrg fi 425532b578d3Smrg fi 425632b578d3Smrg 425732b578d3Smrg # Create the old-style object. 425832b578d3Smrg 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 425932b578d3Smrg 426032b578d3Smrg output="$obj" 426132b578d3Smrg cmds=$reload_cmds 426232b578d3Smrg save_ifs="$IFS"; IFS='~' 426332b578d3Smrg for cmd in $cmds; do 426432b578d3Smrg IFS="$save_ifs" 426532b578d3Smrg eval cmd=\"$cmd\" 426632b578d3Smrg $show "$cmd" 426732b578d3Smrg $run eval "$cmd" || exit $? 426832b578d3Smrg done 426932b578d3Smrg IFS="$save_ifs" 427032b578d3Smrg 427132b578d3Smrg # Exit if we aren't doing a library object file. 427232b578d3Smrg if test -z "$libobj"; then 427332b578d3Smrg if test -n "$gentop"; then 427432b578d3Smrg $show "${rm}r $gentop" 427532b578d3Smrg $run ${rm}r $gentop 427632b578d3Smrg fi 427732b578d3Smrg 427832b578d3Smrg exit $EXIT_SUCCESS 427932b578d3Smrg fi 428032b578d3Smrg 428132b578d3Smrg if test "$build_libtool_libs" != yes; then 428232b578d3Smrg if test -n "$gentop"; then 428332b578d3Smrg $show "${rm}r $gentop" 428432b578d3Smrg $run ${rm}r $gentop 428532b578d3Smrg fi 428632b578d3Smrg 428732b578d3Smrg # Create an invalid libtool object if no PIC, so that we don't 428832b578d3Smrg # accidentally link it into a program. 428932b578d3Smrg # $show "echo timestamp > $libobj" 429032b578d3Smrg # $run eval "echo timestamp > $libobj" || exit $? 429132b578d3Smrg exit $EXIT_SUCCESS 429232b578d3Smrg fi 429332b578d3Smrg 429432b578d3Smrg if test -n "$pic_flag" || test "$pic_mode" != default; then 429532b578d3Smrg # Only do commands if we really have different PIC objects. 429632b578d3Smrg reload_objs="$libobjs $reload_conv_objs" 429732b578d3Smrg output="$libobj" 429832b578d3Smrg cmds=$reload_cmds 429932b578d3Smrg save_ifs="$IFS"; IFS='~' 430032b578d3Smrg for cmd in $cmds; do 430132b578d3Smrg IFS="$save_ifs" 430232b578d3Smrg eval cmd=\"$cmd\" 430332b578d3Smrg $show "$cmd" 430432b578d3Smrg $run eval "$cmd" || exit $? 430532b578d3Smrg done 430632b578d3Smrg IFS="$save_ifs" 430732b578d3Smrg fi 430832b578d3Smrg 430932b578d3Smrg if test -n "$gentop"; then 431032b578d3Smrg $show "${rm}r $gentop" 431132b578d3Smrg $run ${rm}r $gentop 431232b578d3Smrg fi 431332b578d3Smrg 431432b578d3Smrg exit $EXIT_SUCCESS 431532b578d3Smrg ;; 431632b578d3Smrg 431732b578d3Smrg prog) 431832b578d3Smrg case $host in 431932b578d3Smrg *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; 432032b578d3Smrg esac 432132b578d3Smrg if test -n "$vinfo"; then 432232b578d3Smrg $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 432332b578d3Smrg fi 432432b578d3Smrg 432532b578d3Smrg if test -n "$release"; then 432632b578d3Smrg $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 432732b578d3Smrg fi 432832b578d3Smrg 432932b578d3Smrg if test "$preload" = yes; then 433032b578d3Smrg if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && 433132b578d3Smrg test "$dlopen_self_static" = unknown; then 433232b578d3Smrg $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." 433332b578d3Smrg fi 433432b578d3Smrg fi 433532b578d3Smrg 433632b578d3Smrg case $host in 433732b578d3Smrg *-*-rhapsody* | *-*-darwin1.[012]) 433832b578d3Smrg # On Rhapsody replace the C library is the System framework 433932b578d3Smrg compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` 434032b578d3Smrg finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` 434132b578d3Smrg ;; 434232b578d3Smrg esac 434332b578d3Smrg 434432b578d3Smrg case $host in 434532b578d3Smrg *darwin*) 434632b578d3Smrg # Don't allow lazy linking, it breaks C++ global constructors 434732b578d3Smrg if test "$tagname" = CXX ; then 434832b578d3Smrg compile_command="$compile_command ${wl}-bind_at_load" 434932b578d3Smrg finalize_command="$finalize_command ${wl}-bind_at_load" 435032b578d3Smrg fi 435132b578d3Smrg ;; 435232b578d3Smrg esac 435332b578d3Smrg 435432b578d3Smrg 435532b578d3Smrg # move library search paths that coincide with paths to not yet 435632b578d3Smrg # installed libraries to the beginning of the library search list 435732b578d3Smrg new_libs= 435832b578d3Smrg for path in $notinst_path; do 435932b578d3Smrg case " $new_libs " in 436032b578d3Smrg *" -L$path/$objdir "*) ;; 436132b578d3Smrg *) 436232b578d3Smrg case " $compile_deplibs " in 436332b578d3Smrg *" -L$path/$objdir "*) 436432b578d3Smrg new_libs="$new_libs -L$path/$objdir" ;; 436532b578d3Smrg esac 436632b578d3Smrg ;; 436732b578d3Smrg esac 436832b578d3Smrg done 436932b578d3Smrg for deplib in $compile_deplibs; do 437032b578d3Smrg case $deplib in 437132b578d3Smrg -L*) 437232b578d3Smrg case " $new_libs " in 437332b578d3Smrg *" $deplib "*) ;; 437432b578d3Smrg *) new_libs="$new_libs $deplib" ;; 437532b578d3Smrg esac 437632b578d3Smrg ;; 437732b578d3Smrg *) new_libs="$new_libs $deplib" ;; 437832b578d3Smrg esac 437932b578d3Smrg done 438032b578d3Smrg compile_deplibs="$new_libs" 438132b578d3Smrg 438232b578d3Smrg 438332b578d3Smrg compile_command="$compile_command $compile_deplibs" 438432b578d3Smrg finalize_command="$finalize_command $finalize_deplibs" 438532b578d3Smrg 438632b578d3Smrg if test -n "$rpath$xrpath"; then 438732b578d3Smrg # If the user specified any rpath flags, then add them. 438832b578d3Smrg for libdir in $rpath $xrpath; do 438932b578d3Smrg # This is the magic to use -rpath. 439032b578d3Smrg case "$finalize_rpath " in 439132b578d3Smrg *" $libdir "*) ;; 439232b578d3Smrg *) finalize_rpath="$finalize_rpath $libdir" ;; 439332b578d3Smrg esac 439432b578d3Smrg done 439532b578d3Smrg fi 439632b578d3Smrg 439732b578d3Smrg # Now hardcode the library paths 439832b578d3Smrg rpath= 439932b578d3Smrg hardcode_libdirs= 440032b578d3Smrg for libdir in $compile_rpath $finalize_rpath; do 440132b578d3Smrg if test -n "$hardcode_libdir_flag_spec"; then 440232b578d3Smrg if test -n "$hardcode_libdir_separator"; then 440332b578d3Smrg if test -z "$hardcode_libdirs"; then 440432b578d3Smrg hardcode_libdirs="$libdir" 440532b578d3Smrg else 440632b578d3Smrg # Just accumulate the unique libdirs. 440732b578d3Smrg case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in 440832b578d3Smrg *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) 440932b578d3Smrg ;; 441032b578d3Smrg *) 441132b578d3Smrg hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" 441232b578d3Smrg ;; 441332b578d3Smrg esac 441432b578d3Smrg fi 441532b578d3Smrg else 441632b578d3Smrg eval flag=\"$hardcode_libdir_flag_spec\" 441732b578d3Smrg rpath="$rpath $flag" 441832b578d3Smrg fi 441932b578d3Smrg elif test -n "$runpath_var"; then 442032b578d3Smrg case "$perm_rpath " in 442132b578d3Smrg *" $libdir "*) ;; 442232b578d3Smrg *) perm_rpath="$perm_rpath $libdir" ;; 442332b578d3Smrg esac 442432b578d3Smrg fi 442532b578d3Smrg case $host in 442632b578d3Smrg *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) 442732b578d3Smrg testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` 442832b578d3Smrg case :$dllsearchpath: in 442932b578d3Smrg *":$libdir:"*) ;; 443032b578d3Smrg *) dllsearchpath="$dllsearchpath:$libdir";; 443132b578d3Smrg esac 443232b578d3Smrg case :$dllsearchpath: in 443332b578d3Smrg *":$testbindir:"*) ;; 443432b578d3Smrg *) dllsearchpath="$dllsearchpath:$testbindir";; 443532b578d3Smrg esac 443632b578d3Smrg ;; 443732b578d3Smrg esac 443832b578d3Smrg done 443932b578d3Smrg # Substitute the hardcoded libdirs into the rpath. 444032b578d3Smrg if test -n "$hardcode_libdir_separator" && 444132b578d3Smrg test -n "$hardcode_libdirs"; then 444232b578d3Smrg libdir="$hardcode_libdirs" 444332b578d3Smrg eval rpath=\" $hardcode_libdir_flag_spec\" 444432b578d3Smrg fi 444532b578d3Smrg compile_rpath="$rpath" 444632b578d3Smrg 444732b578d3Smrg rpath= 444832b578d3Smrg hardcode_libdirs= 444932b578d3Smrg for libdir in $finalize_rpath; do 445032b578d3Smrg if test -n "$hardcode_libdir_flag_spec"; then 445132b578d3Smrg if test -n "$hardcode_libdir_separator"; then 445232b578d3Smrg if test -z "$hardcode_libdirs"; then 445332b578d3Smrg hardcode_libdirs="$libdir" 445432b578d3Smrg else 445532b578d3Smrg # Just accumulate the unique libdirs. 445632b578d3Smrg case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in 445732b578d3Smrg *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) 445832b578d3Smrg ;; 445932b578d3Smrg *) 446032b578d3Smrg hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" 446132b578d3Smrg ;; 446232b578d3Smrg esac 446332b578d3Smrg fi 446432b578d3Smrg else 446532b578d3Smrg eval flag=\"$hardcode_libdir_flag_spec\" 446632b578d3Smrg rpath="$rpath $flag" 446732b578d3Smrg fi 446832b578d3Smrg elif test -n "$runpath_var"; then 446932b578d3Smrg case "$finalize_perm_rpath " in 447032b578d3Smrg *" $libdir "*) ;; 447132b578d3Smrg *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; 447232b578d3Smrg esac 447332b578d3Smrg fi 447432b578d3Smrg done 447532b578d3Smrg # Substitute the hardcoded libdirs into the rpath. 447632b578d3Smrg if test -n "$hardcode_libdir_separator" && 447732b578d3Smrg test -n "$hardcode_libdirs"; then 447832b578d3Smrg libdir="$hardcode_libdirs" 447932b578d3Smrg eval rpath=\" $hardcode_libdir_flag_spec\" 448032b578d3Smrg fi 448132b578d3Smrg finalize_rpath="$rpath" 448232b578d3Smrg 448332b578d3Smrg if test -n "$libobjs" && test "$build_old_libs" = yes; then 448432b578d3Smrg # Transform all the library objects into standard objects. 448532b578d3Smrg compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` 448632b578d3Smrg finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` 448732b578d3Smrg fi 448832b578d3Smrg 448932b578d3Smrg dlsyms= 449032b578d3Smrg if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then 449132b578d3Smrg if test -n "$NM" && test -n "$global_symbol_pipe"; then 449232b578d3Smrg dlsyms="${outputname}S.c" 449332b578d3Smrg else 449432b578d3Smrg $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 449532b578d3Smrg fi 449632b578d3Smrg fi 449732b578d3Smrg 449832b578d3Smrg if test -n "$dlsyms"; then 449932b578d3Smrg case $dlsyms in 450032b578d3Smrg "") ;; 450132b578d3Smrg *.c) 450232b578d3Smrg # Discover the nlist of each of the dlfiles. 450332b578d3Smrg nlist="$output_objdir/${outputname}.nm" 450432b578d3Smrg 450532b578d3Smrg $show "$rm $nlist ${nlist}S ${nlist}T" 450632b578d3Smrg $run $rm "$nlist" "${nlist}S" "${nlist}T" 450732b578d3Smrg 450832b578d3Smrg # Parse the name list into a source file. 450932b578d3Smrg $show "creating $output_objdir/$dlsyms" 451032b578d3Smrg 451132b578d3Smrg test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ 451232b578d3Smrg/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ 451332b578d3Smrg/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ 451432b578d3Smrg 451532b578d3Smrg#ifdef __cplusplus 451632b578d3Smrgextern \"C\" { 451732b578d3Smrg#endif 451832b578d3Smrg 451932b578d3Smrg/* Prevent the only kind of declaration conflicts we can make. */ 452032b578d3Smrg#define lt_preloaded_symbols some_other_symbol 452132b578d3Smrg 452232b578d3Smrg/* External symbol declarations for the compiler. */\ 452332b578d3Smrg" 452432b578d3Smrg 452532b578d3Smrg if test "$dlself" = yes; then 452632b578d3Smrg $show "generating symbol list for \`$output'" 452732b578d3Smrg 452832b578d3Smrg test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" 452932b578d3Smrg 453032b578d3Smrg # Add our own program objects to the symbol list. 453132b578d3Smrg progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` 453232b578d3Smrg for arg in $progfiles; do 453332b578d3Smrg $show "extracting global C symbols from \`$arg'" 453432b578d3Smrg $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" 453532b578d3Smrg done 453632b578d3Smrg 453732b578d3Smrg if test -n "$exclude_expsyms"; then 453832b578d3Smrg $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' 453932b578d3Smrg $run eval '$mv "$nlist"T "$nlist"' 454032b578d3Smrg fi 454132b578d3Smrg 454232b578d3Smrg if test -n "$export_symbols_regex"; then 454332b578d3Smrg $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' 454432b578d3Smrg $run eval '$mv "$nlist"T "$nlist"' 454532b578d3Smrg fi 454632b578d3Smrg 454732b578d3Smrg # Prepare the list of exported symbols 454832b578d3Smrg if test -z "$export_symbols"; then 454932b578d3Smrg export_symbols="$output_objdir/$outputname.exp" 455032b578d3Smrg $run $rm $export_symbols 455132b578d3Smrg $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' 455232b578d3Smrg case $host in 455332b578d3Smrg *cygwin* | *mingw* ) 455432b578d3Smrg $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' 455532b578d3Smrg $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' 455632b578d3Smrg ;; 455732b578d3Smrg esac 455832b578d3Smrg else 455932b578d3Smrg $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' 456032b578d3Smrg $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' 456132b578d3Smrg $run eval 'mv "$nlist"T "$nlist"' 456232b578d3Smrg case $host in 456332b578d3Smrg *cygwin* | *mingw* ) 456432b578d3Smrg $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' 456532b578d3Smrg $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' 456632b578d3Smrg ;; 456732b578d3Smrg esac 456832b578d3Smrg fi 456932b578d3Smrg fi 457032b578d3Smrg 457132b578d3Smrg for arg in $dlprefiles; do 457232b578d3Smrg $show "extracting global C symbols from \`$arg'" 457332b578d3Smrg name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` 457432b578d3Smrg $run eval '$echo ": $name " >> "$nlist"' 457532b578d3Smrg $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" 457632b578d3Smrg done 457732b578d3Smrg 457832b578d3Smrg if test -z "$run"; then 457932b578d3Smrg # Make sure we have at least an empty file. 458032b578d3Smrg test -f "$nlist" || : > "$nlist" 458132b578d3Smrg 458232b578d3Smrg if test -n "$exclude_expsyms"; then 458332b578d3Smrg $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T 458432b578d3Smrg $mv "$nlist"T "$nlist" 458532b578d3Smrg fi 458632b578d3Smrg 458732b578d3Smrg # Try sorting and uniquifying the output. 458832b578d3Smrg if grep -v "^: " < "$nlist" | 458932b578d3Smrg if sort -k 3 </dev/null >/dev/null 2>&1; then 459032b578d3Smrg sort -k 3 459132b578d3Smrg else 459232b578d3Smrg sort +2 459332b578d3Smrg fi | 459432b578d3Smrg uniq > "$nlist"S; then 459532b578d3Smrg : 459632b578d3Smrg else 459732b578d3Smrg grep -v "^: " < "$nlist" > "$nlist"S 459832b578d3Smrg fi 459932b578d3Smrg 460032b578d3Smrg if test -f "$nlist"S; then 460132b578d3Smrg eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' 460232b578d3Smrg else 460332b578d3Smrg $echo '/* NONE */' >> "$output_objdir/$dlsyms" 460432b578d3Smrg fi 460532b578d3Smrg 460632b578d3Smrg $echo >> "$output_objdir/$dlsyms" "\ 460732b578d3Smrg 460832b578d3Smrg#undef lt_preloaded_symbols 460932b578d3Smrg 461032b578d3Smrg#if defined (__STDC__) && __STDC__ 461132b578d3Smrg# define lt_ptr void * 461232b578d3Smrg#else 461332b578d3Smrg# define lt_ptr char * 461432b578d3Smrg# define const 461532b578d3Smrg#endif 461632b578d3Smrg 461732b578d3Smrg/* The mapping between symbol names and symbols. */ 461832b578d3Smrg" 461932b578d3Smrg 462032b578d3Smrg case $host in 462132b578d3Smrg *cygwin* | *mingw* ) 462232b578d3Smrg $echo >> "$output_objdir/$dlsyms" "\ 462332b578d3Smrg/* DATA imports from DLLs on WIN32 can't be const, because 462432b578d3Smrg runtime relocations are performed -- see ld's documentation 462532b578d3Smrg on pseudo-relocs */ 462632b578d3Smrgstruct { 462732b578d3Smrg" 462832b578d3Smrg ;; 462932b578d3Smrg * ) 463032b578d3Smrg $echo >> "$output_objdir/$dlsyms" "\ 463132b578d3Smrgconst struct { 463232b578d3Smrg" 463332b578d3Smrg ;; 463432b578d3Smrg esac 463532b578d3Smrg 463632b578d3Smrg 463732b578d3Smrg $echo >> "$output_objdir/$dlsyms" "\ 463832b578d3Smrg const char *name; 463932b578d3Smrg lt_ptr address; 464032b578d3Smrg} 464132b578d3Smrglt_preloaded_symbols[] = 464232b578d3Smrg{\ 464332b578d3Smrg" 464432b578d3Smrg 464532b578d3Smrg eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" 464632b578d3Smrg 464732b578d3Smrg $echo >> "$output_objdir/$dlsyms" "\ 464832b578d3Smrg {0, (lt_ptr) 0} 464932b578d3Smrg}; 465032b578d3Smrg 465132b578d3Smrg/* This works around a problem in FreeBSD linker */ 465232b578d3Smrg#ifdef FREEBSD_WORKAROUND 465332b578d3Smrgstatic const void *lt_preloaded_setup() { 465432b578d3Smrg return lt_preloaded_symbols; 465532b578d3Smrg} 465632b578d3Smrg#endif 465732b578d3Smrg 465832b578d3Smrg#ifdef __cplusplus 465932b578d3Smrg} 466032b578d3Smrg#endif\ 466132b578d3Smrg" 466232b578d3Smrg fi 466332b578d3Smrg 466432b578d3Smrg pic_flag_for_symtable= 466532b578d3Smrg case $host in 466632b578d3Smrg # compiling the symbol table file with pic_flag works around 466732b578d3Smrg # a FreeBSD bug that causes programs to crash when -lm is 466832b578d3Smrg # linked before any other PIC object. But we must not use 466932b578d3Smrg # pic_flag when linking with -static. The problem exists in 467032b578d3Smrg # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. 467132b578d3Smrg *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) 467232b578d3Smrg case "$compile_command " in 467332b578d3Smrg *" -static "*) ;; 467432b578d3Smrg *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; 467532b578d3Smrg esac;; 467632b578d3Smrg *-*-hpux*) 467732b578d3Smrg case "$compile_command " in 467832b578d3Smrg *" -static "*) ;; 467932b578d3Smrg *) pic_flag_for_symtable=" $pic_flag";; 468032b578d3Smrg esac 468132b578d3Smrg esac 468232b578d3Smrg 468332b578d3Smrg # Now compile the dynamic symbol file. 468432b578d3Smrg $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" 468532b578d3Smrg $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? 468632b578d3Smrg 468732b578d3Smrg # Clean up the generated files. 468832b578d3Smrg $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" 468932b578d3Smrg $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" 469032b578d3Smrg 469132b578d3Smrg # Transform the symbol file into the correct name. 469232b578d3Smrg case $host in 469332b578d3Smrg *cygwin* | *mingw* ) 469432b578d3Smrg if test -f "$output_objdir/${outputname}.def" ; then 4695d31dbc53Smrg compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` 4696d31dbc53Smrg finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` 469732b578d3Smrg else 4698d31dbc53Smrg compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` 4699d31dbc53Smrg finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` 470032b578d3Smrg fi 470132b578d3Smrg ;; 470232b578d3Smrg * ) 4703d31dbc53Smrg compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` 4704d31dbc53Smrg finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` 470532b578d3Smrg ;; 470632b578d3Smrg esac 470732b578d3Smrg ;; 470832b578d3Smrg *) 470932b578d3Smrg $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 471032b578d3Smrg exit $EXIT_FAILURE 471132b578d3Smrg ;; 471232b578d3Smrg esac 471332b578d3Smrg else 471432b578d3Smrg # We keep going just in case the user didn't refer to 471532b578d3Smrg # lt_preloaded_symbols. The linker will fail if global_symbol_pipe 471632b578d3Smrg # really was required. 471732b578d3Smrg 471832b578d3Smrg # Nullify the symbol file. 4719d31dbc53Smrg compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` 4720d31dbc53Smrg finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` 472132b578d3Smrg fi 472232b578d3Smrg 472332b578d3Smrg if test "$need_relink" = no || test "$build_libtool_libs" != yes; then 472432b578d3Smrg # Replace the output file specification. 4725d31dbc53Smrg compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` 472632b578d3Smrg link_command="$compile_command$compile_rpath" 472732b578d3Smrg 472832b578d3Smrg # We have no uninstalled library dependencies, so finalize right now. 472932b578d3Smrg $show "$link_command" 473032b578d3Smrg $run eval "$link_command" 473132b578d3Smrg exit_status=$? 473232b578d3Smrg 473332b578d3Smrg # Delete the generated files. 473432b578d3Smrg if test -n "$dlsyms"; then 473532b578d3Smrg $show "$rm $output_objdir/${outputname}S.${objext}" 473632b578d3Smrg $run $rm "$output_objdir/${outputname}S.${objext}" 473732b578d3Smrg fi 473832b578d3Smrg 473932b578d3Smrg exit $exit_status 474032b578d3Smrg fi 474132b578d3Smrg 474232b578d3Smrg if test -n "$shlibpath_var"; then 474332b578d3Smrg # We should set the shlibpath_var 474432b578d3Smrg rpath= 474532b578d3Smrg for dir in $temp_rpath; do 474632b578d3Smrg case $dir in 474732b578d3Smrg [\\/]* | [A-Za-z]:[\\/]*) 474832b578d3Smrg # Absolute path. 474932b578d3Smrg rpath="$rpath$dir:" 475032b578d3Smrg ;; 475132b578d3Smrg *) 475232b578d3Smrg # Relative path: add a thisdir entry. 475332b578d3Smrg rpath="$rpath\$thisdir/$dir:" 475432b578d3Smrg ;; 475532b578d3Smrg esac 475632b578d3Smrg done 475732b578d3Smrg temp_rpath="$rpath" 475832b578d3Smrg fi 475932b578d3Smrg 476032b578d3Smrg if test -n "$compile_shlibpath$finalize_shlibpath"; then 476132b578d3Smrg compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" 476232b578d3Smrg fi 476332b578d3Smrg if test -n "$finalize_shlibpath"; then 476432b578d3Smrg finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" 476532b578d3Smrg fi 476632b578d3Smrg 476732b578d3Smrg compile_var= 476832b578d3Smrg finalize_var= 476932b578d3Smrg if test -n "$runpath_var"; then 477032b578d3Smrg if test -n "$perm_rpath"; then 477132b578d3Smrg # We should set the runpath_var. 477232b578d3Smrg rpath= 477332b578d3Smrg for dir in $perm_rpath; do 477432b578d3Smrg rpath="$rpath$dir:" 477532b578d3Smrg done 477632b578d3Smrg compile_var="$runpath_var=\"$rpath\$$runpath_var\" " 477732b578d3Smrg fi 477832b578d3Smrg if test -n "$finalize_perm_rpath"; then 477932b578d3Smrg # We should set the runpath_var. 478032b578d3Smrg rpath= 478132b578d3Smrg for dir in $finalize_perm_rpath; do 478232b578d3Smrg rpath="$rpath$dir:" 478332b578d3Smrg done 478432b578d3Smrg finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " 478532b578d3Smrg fi 478632b578d3Smrg fi 478732b578d3Smrg 478832b578d3Smrg if test "$no_install" = yes; then 478932b578d3Smrg # We don't need to create a wrapper script. 479032b578d3Smrg link_command="$compile_var$compile_command$compile_rpath" 479132b578d3Smrg # Replace the output file specification. 479232b578d3Smrg link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` 479332b578d3Smrg # Delete the old output file. 479432b578d3Smrg $run $rm $output 479532b578d3Smrg # Link the executable and exit 479632b578d3Smrg $show "$link_command" 479732b578d3Smrg $run eval "$link_command" || exit $? 479832b578d3Smrg exit $EXIT_SUCCESS 479932b578d3Smrg fi 480032b578d3Smrg 480132b578d3Smrg if test "$hardcode_action" = relink; then 480232b578d3Smrg # Fast installation is not supported 480332b578d3Smrg link_command="$compile_var$compile_command$compile_rpath" 480432b578d3Smrg relink_command="$finalize_var$finalize_command$finalize_rpath" 480532b578d3Smrg 480632b578d3Smrg $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 480732b578d3Smrg $echo "$modename: \`$output' will be relinked during installation" 1>&2 480832b578d3Smrg else 480932b578d3Smrg if test "$fast_install" != no; then 481032b578d3Smrg link_command="$finalize_var$compile_command$finalize_rpath" 481132b578d3Smrg if test "$fast_install" = yes; then 4812d31dbc53Smrg relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` 481332b578d3Smrg else 481432b578d3Smrg # fast_install is set to needless 481532b578d3Smrg relink_command= 481632b578d3Smrg fi 481732b578d3Smrg else 481832b578d3Smrg link_command="$compile_var$compile_command$compile_rpath" 481932b578d3Smrg relink_command="$finalize_var$finalize_command$finalize_rpath" 482032b578d3Smrg fi 482132b578d3Smrg fi 482232b578d3Smrg 482332b578d3Smrg # Replace the output file specification. 482432b578d3Smrg link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` 482532b578d3Smrg 482632b578d3Smrg # Delete the old output files. 482732b578d3Smrg $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname 482832b578d3Smrg 482932b578d3Smrg $show "$link_command" 483032b578d3Smrg $run eval "$link_command" || exit $? 483132b578d3Smrg 483232b578d3Smrg # Now create the wrapper script. 483332b578d3Smrg $show "creating $output" 483432b578d3Smrg 483532b578d3Smrg # Quote the relink command for shipping. 483632b578d3Smrg if test -n "$relink_command"; then 483732b578d3Smrg # Preserve any variables that may affect compiler behavior 483832b578d3Smrg for var in $variables_saved_for_relink; do 483932b578d3Smrg if eval test -z \"\${$var+set}\"; then 484032b578d3Smrg relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" 484132b578d3Smrg elif eval var_value=\$$var; test -z "$var_value"; then 484232b578d3Smrg relink_command="$var=; export $var; $relink_command" 484332b578d3Smrg else 484432b578d3Smrg var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` 484532b578d3Smrg relink_command="$var=\"$var_value\"; export $var; $relink_command" 484632b578d3Smrg fi 484732b578d3Smrg done 484832b578d3Smrg relink_command="(cd `pwd`; $relink_command)" 4849d31dbc53Smrg relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` 485032b578d3Smrg fi 485132b578d3Smrg 485232b578d3Smrg # Quote $echo for shipping. 485332b578d3Smrg if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then 485432b578d3Smrg case $progpath in 485532b578d3Smrg [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; 485632b578d3Smrg *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; 485732b578d3Smrg esac 485832b578d3Smrg qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` 485932b578d3Smrg else 486032b578d3Smrg qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` 486132b578d3Smrg fi 486232b578d3Smrg 486332b578d3Smrg # Only actually do things if our run command is non-null. 486432b578d3Smrg if test -z "$run"; then 486532b578d3Smrg # win32 will think the script is a binary if it has 486632b578d3Smrg # a .exe suffix, so we strip it off here. 486732b578d3Smrg case $output in 486832b578d3Smrg *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; 486932b578d3Smrg esac 487032b578d3Smrg # test for cygwin because mv fails w/o .exe extensions 487132b578d3Smrg case $host in 487232b578d3Smrg *cygwin*) 487332b578d3Smrg exeext=.exe 487432b578d3Smrg outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; 487532b578d3Smrg *) exeext= ;; 487632b578d3Smrg esac 487732b578d3Smrg case $host in 487832b578d3Smrg *cygwin* | *mingw* ) 487932b578d3Smrg output_name=`basename $output` 488032b578d3Smrg output_path=`dirname $output` 488132b578d3Smrg cwrappersource="$output_path/$objdir/lt-$output_name.c" 488232b578d3Smrg cwrapper="$output_path/$output_name.exe" 488332b578d3Smrg $rm $cwrappersource $cwrapper 488432b578d3Smrg trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 488532b578d3Smrg 488632b578d3Smrg cat > $cwrappersource <<EOF 488732b578d3Smrg 488832b578d3Smrg/* $cwrappersource - temporary wrapper executable for $objdir/$outputname 488932b578d3Smrg Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP 489032b578d3Smrg 489132b578d3Smrg The $output program cannot be directly executed until all the libtool 489232b578d3Smrg libraries that it depends on are installed. 489332b578d3Smrg 489432b578d3Smrg This wrapper executable should never be moved out of the build directory. 489532b578d3Smrg If it is, it will not operate correctly. 489632b578d3Smrg 489732b578d3Smrg Currently, it simply execs the wrapper *script* "/bin/sh $output", 489832b578d3Smrg but could eventually absorb all of the scripts functionality and 489932b578d3Smrg exec $objdir/$outputname directly. 490032b578d3Smrg*/ 490132b578d3SmrgEOF 490232b578d3Smrg cat >> $cwrappersource<<"EOF" 490332b578d3Smrg#include <stdio.h> 490432b578d3Smrg#include <stdlib.h> 490532b578d3Smrg#include <unistd.h> 490632b578d3Smrg#include <malloc.h> 490732b578d3Smrg#include <stdarg.h> 490832b578d3Smrg#include <assert.h> 490932b578d3Smrg#include <string.h> 491032b578d3Smrg#include <ctype.h> 491132b578d3Smrg#include <sys/stat.h> 491232b578d3Smrg 491332b578d3Smrg#if defined(PATH_MAX) 491432b578d3Smrg# define LT_PATHMAX PATH_MAX 491532b578d3Smrg#elif defined(MAXPATHLEN) 491632b578d3Smrg# define LT_PATHMAX MAXPATHLEN 491732b578d3Smrg#else 491832b578d3Smrg# define LT_PATHMAX 1024 491932b578d3Smrg#endif 492032b578d3Smrg 492132b578d3Smrg#ifndef DIR_SEPARATOR 492232b578d3Smrg# define DIR_SEPARATOR '/' 492332b578d3Smrg# define PATH_SEPARATOR ':' 492432b578d3Smrg#endif 492532b578d3Smrg 492632b578d3Smrg#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ 492732b578d3Smrg defined (__OS2__) 492832b578d3Smrg# define HAVE_DOS_BASED_FILE_SYSTEM 492932b578d3Smrg# ifndef DIR_SEPARATOR_2 493032b578d3Smrg# define DIR_SEPARATOR_2 '\\' 493132b578d3Smrg# endif 493232b578d3Smrg# ifndef PATH_SEPARATOR_2 493332b578d3Smrg# define PATH_SEPARATOR_2 ';' 493432b578d3Smrg# endif 493532b578d3Smrg#endif 493632b578d3Smrg 493732b578d3Smrg#ifndef DIR_SEPARATOR_2 493832b578d3Smrg# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) 493932b578d3Smrg#else /* DIR_SEPARATOR_2 */ 494032b578d3Smrg# define IS_DIR_SEPARATOR(ch) \ 494132b578d3Smrg (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) 494232b578d3Smrg#endif /* DIR_SEPARATOR_2 */ 494332b578d3Smrg 494432b578d3Smrg#ifndef PATH_SEPARATOR_2 494532b578d3Smrg# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) 494632b578d3Smrg#else /* PATH_SEPARATOR_2 */ 494732b578d3Smrg# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) 494832b578d3Smrg#endif /* PATH_SEPARATOR_2 */ 494932b578d3Smrg 495032b578d3Smrg#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) 495132b578d3Smrg#define XFREE(stale) do { \ 495232b578d3Smrg if (stale) { free ((void *) stale); stale = 0; } \ 495332b578d3Smrg} while (0) 495432b578d3Smrg 495532b578d3Smrg/* -DDEBUG is fairly common in CFLAGS. */ 495632b578d3Smrg#undef DEBUG 495732b578d3Smrg#if defined DEBUGWRAPPER 495832b578d3Smrg# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) 495932b578d3Smrg#else 496032b578d3Smrg# define DEBUG(format, ...) 496132b578d3Smrg#endif 496232b578d3Smrg 496332b578d3Smrgconst char *program_name = NULL; 496432b578d3Smrg 496532b578d3Smrgvoid * xmalloc (size_t num); 496632b578d3Smrgchar * xstrdup (const char *string); 496732b578d3Smrgconst char * base_name (const char *name); 496832b578d3Smrgchar * find_executable(const char *wrapper); 496932b578d3Smrgint check_executable(const char *path); 497032b578d3Smrgchar * strendzap(char *str, const char *pat); 497132b578d3Smrgvoid lt_fatal (const char *message, ...); 497232b578d3Smrg 497332b578d3Smrgint 497432b578d3Smrgmain (int argc, char *argv[]) 497532b578d3Smrg{ 497632b578d3Smrg char **newargz; 497732b578d3Smrg int i; 497832b578d3Smrg 497932b578d3Smrg program_name = (char *) xstrdup (base_name (argv[0])); 498032b578d3Smrg DEBUG("(main) argv[0] : %s\n",argv[0]); 498132b578d3Smrg DEBUG("(main) program_name : %s\n",program_name); 498232b578d3Smrg newargz = XMALLOC(char *, argc+2); 498332b578d3SmrgEOF 498432b578d3Smrg 498532b578d3Smrg cat >> $cwrappersource <<EOF 498632b578d3Smrg newargz[0] = (char *) xstrdup("$SHELL"); 498732b578d3SmrgEOF 498832b578d3Smrg 498932b578d3Smrg cat >> $cwrappersource <<"EOF" 499032b578d3Smrg newargz[1] = find_executable(argv[0]); 499132b578d3Smrg if (newargz[1] == NULL) 499232b578d3Smrg lt_fatal("Couldn't find %s", argv[0]); 499332b578d3Smrg DEBUG("(main) found exe at : %s\n",newargz[1]); 499432b578d3Smrg /* we know the script has the same name, without the .exe */ 499532b578d3Smrg /* so make sure newargz[1] doesn't end in .exe */ 499632b578d3Smrg strendzap(newargz[1],".exe"); 499732b578d3Smrg for (i = 1; i < argc; i++) 499832b578d3Smrg newargz[i+1] = xstrdup(argv[i]); 499932b578d3Smrg newargz[argc+1] = NULL; 500032b578d3Smrg 500132b578d3Smrg for (i=0; i<argc+1; i++) 500232b578d3Smrg { 500332b578d3Smrg DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]); 500432b578d3Smrg ; 500532b578d3Smrg } 500632b578d3Smrg 500732b578d3SmrgEOF 500832b578d3Smrg 500932b578d3Smrg case $host_os in 501032b578d3Smrg mingw*) 501132b578d3Smrg cat >> $cwrappersource <<EOF 501232b578d3Smrg execv("$SHELL",(char const **)newargz); 501332b578d3SmrgEOF 501432b578d3Smrg ;; 501532b578d3Smrg *) 501632b578d3Smrg cat >> $cwrappersource <<EOF 501732b578d3Smrg execv("$SHELL",newargz); 501832b578d3SmrgEOF 501932b578d3Smrg ;; 502032b578d3Smrg esac 502132b578d3Smrg 502232b578d3Smrg cat >> $cwrappersource <<"EOF" 502332b578d3Smrg return 127; 502432b578d3Smrg} 502532b578d3Smrg 502632b578d3Smrgvoid * 502732b578d3Smrgxmalloc (size_t num) 502832b578d3Smrg{ 502932b578d3Smrg void * p = (void *) malloc (num); 503032b578d3Smrg if (!p) 503132b578d3Smrg lt_fatal ("Memory exhausted"); 503232b578d3Smrg 503332b578d3Smrg return p; 503432b578d3Smrg} 503532b578d3Smrg 503632b578d3Smrgchar * 503732b578d3Smrgxstrdup (const char *string) 503832b578d3Smrg{ 503932b578d3Smrg return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL 504032b578d3Smrg; 504132b578d3Smrg} 504232b578d3Smrg 504332b578d3Smrgconst char * 504432b578d3Smrgbase_name (const char *name) 504532b578d3Smrg{ 504632b578d3Smrg const char *base; 504732b578d3Smrg 504832b578d3Smrg#if defined (HAVE_DOS_BASED_FILE_SYSTEM) 504932b578d3Smrg /* Skip over the disk name in MSDOS pathnames. */ 505032b578d3Smrg if (isalpha ((unsigned char)name[0]) && name[1] == ':') 505132b578d3Smrg name += 2; 505232b578d3Smrg#endif 505332b578d3Smrg 505432b578d3Smrg for (base = name; *name; name++) 505532b578d3Smrg if (IS_DIR_SEPARATOR (*name)) 505632b578d3Smrg base = name + 1; 505732b578d3Smrg return base; 505832b578d3Smrg} 505932b578d3Smrg 506032b578d3Smrgint 506132b578d3Smrgcheck_executable(const char * path) 506232b578d3Smrg{ 506332b578d3Smrg struct stat st; 506432b578d3Smrg 506532b578d3Smrg DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); 506632b578d3Smrg if ((!path) || (!*path)) 506732b578d3Smrg return 0; 506832b578d3Smrg 506932b578d3Smrg if ((stat (path, &st) >= 0) && 507032b578d3Smrg ( 507132b578d3Smrg /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ 507232b578d3Smrg#if defined (S_IXOTH) 507332b578d3Smrg ((st.st_mode & S_IXOTH) == S_IXOTH) || 507432b578d3Smrg#endif 507532b578d3Smrg#if defined (S_IXGRP) 507632b578d3Smrg ((st.st_mode & S_IXGRP) == S_IXGRP) || 507732b578d3Smrg#endif 507832b578d3Smrg ((st.st_mode & S_IXUSR) == S_IXUSR)) 507932b578d3Smrg ) 508032b578d3Smrg return 1; 508132b578d3Smrg else 508232b578d3Smrg return 0; 508332b578d3Smrg} 508432b578d3Smrg 508532b578d3Smrg/* Searches for the full path of the wrapper. Returns 508632b578d3Smrg newly allocated full path name if found, NULL otherwise */ 508732b578d3Smrgchar * 508832b578d3Smrgfind_executable (const char* wrapper) 508932b578d3Smrg{ 509032b578d3Smrg int has_slash = 0; 509132b578d3Smrg const char* p; 509232b578d3Smrg const char* p_next; 509332b578d3Smrg /* static buffer for getcwd */ 509432b578d3Smrg char tmp[LT_PATHMAX + 1]; 509532b578d3Smrg int tmp_len; 509632b578d3Smrg char* concat_name; 509732b578d3Smrg 509832b578d3Smrg DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); 509932b578d3Smrg 510032b578d3Smrg if ((wrapper == NULL) || (*wrapper == '\0')) 510132b578d3Smrg return NULL; 510232b578d3Smrg 510332b578d3Smrg /* Absolute path? */ 510432b578d3Smrg#if defined (HAVE_DOS_BASED_FILE_SYSTEM) 510532b578d3Smrg if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') 510632b578d3Smrg { 510732b578d3Smrg concat_name = xstrdup (wrapper); 510832b578d3Smrg if (check_executable(concat_name)) 510932b578d3Smrg return concat_name; 511032b578d3Smrg XFREE(concat_name); 511132b578d3Smrg } 511232b578d3Smrg else 511332b578d3Smrg { 511432b578d3Smrg#endif 511532b578d3Smrg if (IS_DIR_SEPARATOR (wrapper[0])) 511632b578d3Smrg { 511732b578d3Smrg concat_name = xstrdup (wrapper); 511832b578d3Smrg if (check_executable(concat_name)) 511932b578d3Smrg return concat_name; 512032b578d3Smrg XFREE(concat_name); 512132b578d3Smrg } 512232b578d3Smrg#if defined (HAVE_DOS_BASED_FILE_SYSTEM) 512332b578d3Smrg } 512432b578d3Smrg#endif 512532b578d3Smrg 512632b578d3Smrg for (p = wrapper; *p; p++) 512732b578d3Smrg if (*p == '/') 512832b578d3Smrg { 512932b578d3Smrg has_slash = 1; 513032b578d3Smrg break; 513132b578d3Smrg } 513232b578d3Smrg if (!has_slash) 513332b578d3Smrg { 513432b578d3Smrg /* no slashes; search PATH */ 513532b578d3Smrg const char* path = getenv ("PATH"); 513632b578d3Smrg if (path != NULL) 513732b578d3Smrg { 513832b578d3Smrg for (p = path; *p; p = p_next) 513932b578d3Smrg { 514032b578d3Smrg const char* q; 514132b578d3Smrg size_t p_len; 514232b578d3Smrg for (q = p; *q; q++) 514332b578d3Smrg if (IS_PATH_SEPARATOR(*q)) 514432b578d3Smrg break; 514532b578d3Smrg p_len = q - p; 514632b578d3Smrg p_next = (*q == '\0' ? q : q + 1); 514732b578d3Smrg if (p_len == 0) 514832b578d3Smrg { 514932b578d3Smrg /* empty path: current directory */ 515032b578d3Smrg if (getcwd (tmp, LT_PATHMAX) == NULL) 515132b578d3Smrg lt_fatal ("getcwd failed"); 515232b578d3Smrg tmp_len = strlen(tmp); 515332b578d3Smrg concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); 515432b578d3Smrg memcpy (concat_name, tmp, tmp_len); 515532b578d3Smrg concat_name[tmp_len] = '/'; 515632b578d3Smrg strcpy (concat_name + tmp_len + 1, wrapper); 515732b578d3Smrg } 515832b578d3Smrg else 515932b578d3Smrg { 516032b578d3Smrg concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); 516132b578d3Smrg memcpy (concat_name, p, p_len); 516232b578d3Smrg concat_name[p_len] = '/'; 516332b578d3Smrg strcpy (concat_name + p_len + 1, wrapper); 516432b578d3Smrg } 516532b578d3Smrg if (check_executable(concat_name)) 516632b578d3Smrg return concat_name; 516732b578d3Smrg XFREE(concat_name); 516832b578d3Smrg } 516932b578d3Smrg } 517032b578d3Smrg /* not found in PATH; assume curdir */ 517132b578d3Smrg } 517232b578d3Smrg /* Relative path | not found in path: prepend cwd */ 517332b578d3Smrg if (getcwd (tmp, LT_PATHMAX) == NULL) 517432b578d3Smrg lt_fatal ("getcwd failed"); 517532b578d3Smrg tmp_len = strlen(tmp); 517632b578d3Smrg concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); 517732b578d3Smrg memcpy (concat_name, tmp, tmp_len); 517832b578d3Smrg concat_name[tmp_len] = '/'; 517932b578d3Smrg strcpy (concat_name + tmp_len + 1, wrapper); 518032b578d3Smrg 518132b578d3Smrg if (check_executable(concat_name)) 518232b578d3Smrg return concat_name; 518332b578d3Smrg XFREE(concat_name); 518432b578d3Smrg return NULL; 518532b578d3Smrg} 518632b578d3Smrg 518732b578d3Smrgchar * 518832b578d3Smrgstrendzap(char *str, const char *pat) 518932b578d3Smrg{ 519032b578d3Smrg size_t len, patlen; 519132b578d3Smrg 519232b578d3Smrg assert(str != NULL); 519332b578d3Smrg assert(pat != NULL); 519432b578d3Smrg 519532b578d3Smrg len = strlen(str); 519632b578d3Smrg patlen = strlen(pat); 519732b578d3Smrg 519832b578d3Smrg if (patlen <= len) 519932b578d3Smrg { 520032b578d3Smrg str += len - patlen; 520132b578d3Smrg if (strcmp(str, pat) == 0) 520232b578d3Smrg *str = '\0'; 520332b578d3Smrg } 520432b578d3Smrg return str; 520532b578d3Smrg} 520632b578d3Smrg 520732b578d3Smrgstatic void 520832b578d3Smrglt_error_core (int exit_status, const char * mode, 520932b578d3Smrg const char * message, va_list ap) 521032b578d3Smrg{ 521132b578d3Smrg fprintf (stderr, "%s: %s: ", program_name, mode); 521232b578d3Smrg vfprintf (stderr, message, ap); 521332b578d3Smrg fprintf (stderr, ".\n"); 521432b578d3Smrg 521532b578d3Smrg if (exit_status >= 0) 521632b578d3Smrg exit (exit_status); 521732b578d3Smrg} 521832b578d3Smrg 521932b578d3Smrgvoid 522032b578d3Smrglt_fatal (const char *message, ...) 522132b578d3Smrg{ 522232b578d3Smrg va_list ap; 522332b578d3Smrg va_start (ap, message); 522432b578d3Smrg lt_error_core (EXIT_FAILURE, "FATAL", message, ap); 522532b578d3Smrg va_end (ap); 522632b578d3Smrg} 522732b578d3SmrgEOF 522832b578d3Smrg # we should really use a build-platform specific compiler 522932b578d3Smrg # here, but OTOH, the wrappers (shell script and this C one) 523032b578d3Smrg # are only useful if you want to execute the "real" binary. 523132b578d3Smrg # Since the "real" binary is built for $host, then this 523232b578d3Smrg # wrapper might as well be built for $host, too. 523332b578d3Smrg $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource 523432b578d3Smrg ;; 523532b578d3Smrg esac 523632b578d3Smrg $rm $output 523732b578d3Smrg trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 523832b578d3Smrg 523932b578d3Smrg $echo > $output "\ 524032b578d3Smrg#! $SHELL 524132b578d3Smrg 524232b578d3Smrg# $output - temporary wrapper script for $objdir/$outputname 524332b578d3Smrg# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP 524432b578d3Smrg# 524532b578d3Smrg# The $output program cannot be directly executed until all the libtool 524632b578d3Smrg# libraries that it depends on are installed. 524732b578d3Smrg# 524832b578d3Smrg# This wrapper script should never be moved out of the build directory. 524932b578d3Smrg# If it is, it will not operate correctly. 525032b578d3Smrg 525132b578d3Smrg# Sed substitution that helps us do robust quoting. It backslashifies 525232b578d3Smrg# metacharacters that are still active within double-quoted strings. 525332b578d3SmrgXsed='${SED} -e 1s/^X//' 525432b578d3Smrgsed_quote_subst='$sed_quote_subst' 525532b578d3Smrg 525632b578d3Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout 525732b578d3Smrg# if CDPATH is set. 525832b578d3Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH 525932b578d3Smrg 526032b578d3Smrgrelink_command=\"$relink_command\" 526132b578d3Smrg 526232b578d3Smrg# This environment variable determines our operation mode. 526332b578d3Smrgif test \"\$libtool_install_magic\" = \"$magic\"; then 526432b578d3Smrg # install mode needs the following variable: 526532b578d3Smrg notinst_deplibs='$notinst_deplibs' 526632b578d3Smrgelse 526732b578d3Smrg # When we are sourced in execute mode, \$file and \$echo are already set. 526832b578d3Smrg if test \"\$libtool_execute_magic\" != \"$magic\"; then 526932b578d3Smrg echo=\"$qecho\" 527032b578d3Smrg file=\"\$0\" 527132b578d3Smrg # Make sure echo works. 527232b578d3Smrg if test \"X\$1\" = X--no-reexec; then 527332b578d3Smrg # Discard the --no-reexec flag, and continue. 527432b578d3Smrg shift 527532b578d3Smrg elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then 527632b578d3Smrg # Yippee, \$echo works! 527732b578d3Smrg : 527832b578d3Smrg else 527932b578d3Smrg # Restart under the correct shell, and then maybe \$echo will work. 528032b578d3Smrg exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} 528132b578d3Smrg fi 528232b578d3Smrg fi\ 528332b578d3Smrg" 528432b578d3Smrg $echo >> $output "\ 528532b578d3Smrg 528632b578d3Smrg # Find the directory that this script lives in. 528732b578d3Smrg thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` 528832b578d3Smrg test \"x\$thisdir\" = \"x\$file\" && thisdir=. 528932b578d3Smrg 529032b578d3Smrg # Follow symbolic links until we get to the real thisdir. 529132b578d3Smrg file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` 529232b578d3Smrg while test -n \"\$file\"; do 529332b578d3Smrg destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` 529432b578d3Smrg 529532b578d3Smrg # If there was a directory component, then change thisdir. 529632b578d3Smrg if test \"x\$destdir\" != \"x\$file\"; then 529732b578d3Smrg case \"\$destdir\" in 529832b578d3Smrg [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; 529932b578d3Smrg *) thisdir=\"\$thisdir/\$destdir\" ;; 530032b578d3Smrg esac 530132b578d3Smrg fi 530232b578d3Smrg 530332b578d3Smrg file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` 530432b578d3Smrg file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` 530532b578d3Smrg done 530632b578d3Smrg 530732b578d3Smrg # Try to get the absolute directory name. 530832b578d3Smrg absdir=\`cd \"\$thisdir\" && pwd\` 530932b578d3Smrg test -n \"\$absdir\" && thisdir=\"\$absdir\" 531032b578d3Smrg" 531132b578d3Smrg 531232b578d3Smrg if test "$fast_install" = yes; then 531332b578d3Smrg $echo >> $output "\ 531432b578d3Smrg program=lt-'$outputname'$exeext 531532b578d3Smrg progdir=\"\$thisdir/$objdir\" 531632b578d3Smrg 531732b578d3Smrg if test ! -f \"\$progdir/\$program\" || \\ 531832b578d3Smrg { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ 531932b578d3Smrg test \"X\$file\" != \"X\$progdir/\$program\"; }; then 532032b578d3Smrg 532132b578d3Smrg file=\"\$\$-\$program\" 532232b578d3Smrg 532332b578d3Smrg if test ! -d \"\$progdir\"; then 532432b578d3Smrg $mkdir \"\$progdir\" 532532b578d3Smrg else 532632b578d3Smrg $rm \"\$progdir/\$file\" 532732b578d3Smrg fi" 532832b578d3Smrg 532932b578d3Smrg $echo >> $output "\ 533032b578d3Smrg 533132b578d3Smrg # relink executable if necessary 533232b578d3Smrg if test -n \"\$relink_command\"; then 533332b578d3Smrg if relink_command_output=\`eval \$relink_command 2>&1\`; then : 533432b578d3Smrg else 533532b578d3Smrg $echo \"\$relink_command_output\" >&2 533632b578d3Smrg $rm \"\$progdir/\$file\" 533732b578d3Smrg exit $EXIT_FAILURE 533832b578d3Smrg fi 533932b578d3Smrg fi 534032b578d3Smrg 534132b578d3Smrg $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || 534232b578d3Smrg { $rm \"\$progdir/\$program\"; 534332b578d3Smrg $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } 534432b578d3Smrg $rm \"\$progdir/\$file\" 534532b578d3Smrg fi" 534632b578d3Smrg else 534732b578d3Smrg $echo >> $output "\ 534832b578d3Smrg program='$outputname' 534932b578d3Smrg progdir=\"\$thisdir/$objdir\" 535032b578d3Smrg" 535132b578d3Smrg fi 535232b578d3Smrg 535332b578d3Smrg $echo >> $output "\ 535432b578d3Smrg 535532b578d3Smrg if test -f \"\$progdir/\$program\"; then" 535632b578d3Smrg 535732b578d3Smrg # Export our shlibpath_var if we have one. 535832b578d3Smrg if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then 535932b578d3Smrg $echo >> $output "\ 536032b578d3Smrg # Add our own library path to $shlibpath_var 536132b578d3Smrg $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" 536232b578d3Smrg 536332b578d3Smrg # Some systems cannot cope with colon-terminated $shlibpath_var 536432b578d3Smrg # The second colon is a workaround for a bug in BeOS R4 sed 536532b578d3Smrg $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` 536632b578d3Smrg 536732b578d3Smrg export $shlibpath_var 536832b578d3Smrg" 536932b578d3Smrg fi 537032b578d3Smrg 537132b578d3Smrg # fixup the dll searchpath if we need to. 537232b578d3Smrg if test -n "$dllsearchpath"; then 537332b578d3Smrg $echo >> $output "\ 537432b578d3Smrg # Add the dll search path components to the executable PATH 537532b578d3Smrg PATH=$dllsearchpath:\$PATH 537632b578d3Smrg" 537732b578d3Smrg fi 537832b578d3Smrg 537932b578d3Smrg $echo >> $output "\ 538032b578d3Smrg if test \"\$libtool_execute_magic\" != \"$magic\"; then 538132b578d3Smrg # Run the actual program with our arguments. 538232b578d3Smrg" 538332b578d3Smrg case $host in 538432b578d3Smrg # Backslashes separate directories on plain windows 538532b578d3Smrg *-*-mingw | *-*-os2*) 538632b578d3Smrg $echo >> $output "\ 538732b578d3Smrg exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} 538832b578d3Smrg" 538932b578d3Smrg ;; 539032b578d3Smrg 539132b578d3Smrg *) 539232b578d3Smrg $echo >> $output "\ 539332b578d3Smrg exec \"\$progdir/\$program\" \${1+\"\$@\"} 539432b578d3Smrg" 539532b578d3Smrg ;; 539632b578d3Smrg esac 539732b578d3Smrg $echo >> $output "\ 5398d31dbc53Smrg \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" 539932b578d3Smrg exit $EXIT_FAILURE 540032b578d3Smrg fi 540132b578d3Smrg else 540232b578d3Smrg # The program doesn't exist. 540332b578d3Smrg \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 540432b578d3Smrg \$echo \"This script is just a wrapper for \$program.\" 1>&2 540532b578d3Smrg $echo \"See the $PACKAGE documentation for more information.\" 1>&2 540632b578d3Smrg exit $EXIT_FAILURE 540732b578d3Smrg fi 540832b578d3Smrgfi\ 540932b578d3Smrg" 541032b578d3Smrg chmod +x $output 541132b578d3Smrg fi 541232b578d3Smrg exit $EXIT_SUCCESS 541332b578d3Smrg ;; 541432b578d3Smrg esac 541532b578d3Smrg 541632b578d3Smrg # See if we need to build an old-fashioned archive. 541732b578d3Smrg for oldlib in $oldlibs; do 541832b578d3Smrg 541932b578d3Smrg if test "$build_libtool_libs" = convenience; then 542032b578d3Smrg oldobjs="$libobjs_save" 542132b578d3Smrg addlibs="$convenience" 542232b578d3Smrg build_libtool_libs=no 542332b578d3Smrg else 542432b578d3Smrg if test "$build_libtool_libs" = module; then 542532b578d3Smrg oldobjs="$libobjs_save" 542632b578d3Smrg build_libtool_libs=no 542732b578d3Smrg else 542832b578d3Smrg oldobjs="$old_deplibs $non_pic_objects" 542932b578d3Smrg fi 543032b578d3Smrg addlibs="$old_convenience" 543132b578d3Smrg fi 543232b578d3Smrg 543332b578d3Smrg if test -n "$addlibs"; then 543432b578d3Smrg gentop="$output_objdir/${outputname}x" 543532b578d3Smrg generated="$generated $gentop" 543632b578d3Smrg 543732b578d3Smrg func_extract_archives $gentop $addlibs 543832b578d3Smrg oldobjs="$oldobjs $func_extract_archives_result" 543932b578d3Smrg fi 544032b578d3Smrg 544132b578d3Smrg # Do each command in the archive commands. 544232b578d3Smrg if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then 544332b578d3Smrg cmds=$old_archive_from_new_cmds 544432b578d3Smrg else 544532b578d3Smrg # POSIX demands no paths to be encoded in archives. We have 544632b578d3Smrg # to avoid creating archives with duplicate basenames if we 544732b578d3Smrg # might have to extract them afterwards, e.g., when creating a 544832b578d3Smrg # static archive out of a convenience library, or when linking 544932b578d3Smrg # the entirety of a libtool archive into another (currently 545032b578d3Smrg # not supported by libtool). 545132b578d3Smrg if (for obj in $oldobjs 545232b578d3Smrg do 545332b578d3Smrg $echo "X$obj" | $Xsed -e 's%^.*/%%' 545432b578d3Smrg done | sort | sort -uc >/dev/null 2>&1); then 545532b578d3Smrg : 545632b578d3Smrg else 545732b578d3Smrg $echo "copying selected object files to avoid basename conflicts..." 545832b578d3Smrg 545932b578d3Smrg if test -z "$gentop"; then 546032b578d3Smrg gentop="$output_objdir/${outputname}x" 546132b578d3Smrg generated="$generated $gentop" 546232b578d3Smrg 546332b578d3Smrg $show "${rm}r $gentop" 546432b578d3Smrg $run ${rm}r "$gentop" 546532b578d3Smrg $show "$mkdir $gentop" 546632b578d3Smrg $run $mkdir "$gentop" 546732b578d3Smrg exit_status=$? 546832b578d3Smrg if test "$exit_status" -ne 0 && test ! -d "$gentop"; then 546932b578d3Smrg exit $exit_status 547032b578d3Smrg fi 547132b578d3Smrg fi 547232b578d3Smrg 547332b578d3Smrg save_oldobjs=$oldobjs 547432b578d3Smrg oldobjs= 547532b578d3Smrg counter=1 547632b578d3Smrg for obj in $save_oldobjs 547732b578d3Smrg do 547832b578d3Smrg objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` 547932b578d3Smrg case " $oldobjs " in 548032b578d3Smrg " ") oldobjs=$obj ;; 548132b578d3Smrg *[\ /]"$objbase "*) 548232b578d3Smrg while :; do 548332b578d3Smrg # Make sure we don't pick an alternate name that also 548432b578d3Smrg # overlaps. 548532b578d3Smrg newobj=lt$counter-$objbase 548632b578d3Smrg counter=`expr $counter + 1` 548732b578d3Smrg case " $oldobjs " in 548832b578d3Smrg *[\ /]"$newobj "*) ;; 548932b578d3Smrg *) if test ! -f "$gentop/$newobj"; then break; fi ;; 549032b578d3Smrg esac 549132b578d3Smrg done 549232b578d3Smrg $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" 549332b578d3Smrg $run ln "$obj" "$gentop/$newobj" || 549432b578d3Smrg $run cp "$obj" "$gentop/$newobj" 549532b578d3Smrg oldobjs="$oldobjs $gentop/$newobj" 549632b578d3Smrg ;; 549732b578d3Smrg *) oldobjs="$oldobjs $obj" ;; 549832b578d3Smrg esac 549932b578d3Smrg done 550032b578d3Smrg fi 550132b578d3Smrg 550232b578d3Smrg eval cmds=\"$old_archive_cmds\" 550332b578d3Smrg 550432b578d3Smrg if len=`expr "X$cmds" : ".*"` && 550532b578d3Smrg test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then 550632b578d3Smrg cmds=$old_archive_cmds 550732b578d3Smrg else 550832b578d3Smrg # the command line is too long to link in one step, link in parts 550932b578d3Smrg $echo "using piecewise archive linking..." 551032b578d3Smrg save_RANLIB=$RANLIB 551132b578d3Smrg RANLIB=: 551232b578d3Smrg objlist= 551332b578d3Smrg concat_cmds= 551432b578d3Smrg save_oldobjs=$oldobjs 551532b578d3Smrg 551632b578d3Smrg # Is there a better way of finding the last object in the list? 551732b578d3Smrg for obj in $save_oldobjs 551832b578d3Smrg do 551932b578d3Smrg last_oldobj=$obj 552032b578d3Smrg done 552132b578d3Smrg for obj in $save_oldobjs 552232b578d3Smrg do 552332b578d3Smrg oldobjs="$objlist $obj" 552432b578d3Smrg objlist="$objlist $obj" 552532b578d3Smrg eval test_cmds=\"$old_archive_cmds\" 552632b578d3Smrg if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && 552732b578d3Smrg test "$len" -le "$max_cmd_len"; then 552832b578d3Smrg : 552932b578d3Smrg else 553032b578d3Smrg # the above command should be used before it gets too long 553132b578d3Smrg oldobjs=$objlist 553232b578d3Smrg if test "$obj" = "$last_oldobj" ; then 553332b578d3Smrg RANLIB=$save_RANLIB 553432b578d3Smrg fi 553532b578d3Smrg test -z "$concat_cmds" || concat_cmds=$concat_cmds~ 553632b578d3Smrg eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" 553732b578d3Smrg objlist= 553832b578d3Smrg fi 553932b578d3Smrg done 554032b578d3Smrg RANLIB=$save_RANLIB 554132b578d3Smrg oldobjs=$objlist 554232b578d3Smrg if test "X$oldobjs" = "X" ; then 554332b578d3Smrg eval cmds=\"\$concat_cmds\" 554432b578d3Smrg else 554532b578d3Smrg eval cmds=\"\$concat_cmds~\$old_archive_cmds\" 554632b578d3Smrg fi 554732b578d3Smrg fi 554832b578d3Smrg fi 554932b578d3Smrg save_ifs="$IFS"; IFS='~' 555032b578d3Smrg for cmd in $cmds; do 555132b578d3Smrg eval cmd=\"$cmd\" 555232b578d3Smrg IFS="$save_ifs" 555332b578d3Smrg $show "$cmd" 555432b578d3Smrg $run eval "$cmd" || exit $? 555532b578d3Smrg done 555632b578d3Smrg IFS="$save_ifs" 555732b578d3Smrg done 555832b578d3Smrg 555932b578d3Smrg if test -n "$generated"; then 556032b578d3Smrg $show "${rm}r$generated" 556132b578d3Smrg $run ${rm}r$generated 556232b578d3Smrg fi 556332b578d3Smrg 556432b578d3Smrg # Now create the libtool archive. 556532b578d3Smrg case $output in 556632b578d3Smrg *.la) 556732b578d3Smrg old_library= 556832b578d3Smrg test "$build_old_libs" = yes && old_library="$libname.$libext" 556932b578d3Smrg $show "creating $output" 557032b578d3Smrg 557132b578d3Smrg # Preserve any variables that may affect compiler behavior 557232b578d3Smrg for var in $variables_saved_for_relink; do 557332b578d3Smrg if eval test -z \"\${$var+set}\"; then 557432b578d3Smrg relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" 557532b578d3Smrg elif eval var_value=\$$var; test -z "$var_value"; then 557632b578d3Smrg relink_command="$var=; export $var; $relink_command" 557732b578d3Smrg else 557832b578d3Smrg var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` 557932b578d3Smrg relink_command="$var=\"$var_value\"; export $var; $relink_command" 558032b578d3Smrg fi 558132b578d3Smrg done 558232b578d3Smrg # Quote the link command for shipping. 558332b578d3Smrg relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" 5584d31dbc53Smrg relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` 558532b578d3Smrg if test "$hardcode_automatic" = yes ; then 558632b578d3Smrg relink_command= 558732b578d3Smrg fi 558832b578d3Smrg 558932b578d3Smrg 559032b578d3Smrg # Only create the output if not a dry run. 559132b578d3Smrg if test -z "$run"; then 559232b578d3Smrg for installed in no yes; do 559332b578d3Smrg if test "$installed" = yes; then 559432b578d3Smrg if test -z "$install_libdir"; then 559532b578d3Smrg break 559632b578d3Smrg fi 559732b578d3Smrg output="$output_objdir/$outputname"i 559832b578d3Smrg # Replace all uninstalled libtool libraries with the installed ones 559932b578d3Smrg newdependency_libs= 560032b578d3Smrg for deplib in $dependency_libs; do 560132b578d3Smrg case $deplib in 560232b578d3Smrg *.la) 560332b578d3Smrg name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` 560432b578d3Smrg eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` 560532b578d3Smrg if test -z "$libdir"; then 560632b578d3Smrg $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 560732b578d3Smrg exit $EXIT_FAILURE 560832b578d3Smrg fi 560932b578d3Smrg newdependency_libs="$newdependency_libs $libdir/$name" 561032b578d3Smrg ;; 561132b578d3Smrg *) newdependency_libs="$newdependency_libs $deplib" ;; 561232b578d3Smrg esac 561332b578d3Smrg done 561432b578d3Smrg dependency_libs="$newdependency_libs" 561532b578d3Smrg newdlfiles= 561632b578d3Smrg for lib in $dlfiles; do 561732b578d3Smrg name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` 561832b578d3Smrg eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` 561932b578d3Smrg if test -z "$libdir"; then 562032b578d3Smrg $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 562132b578d3Smrg exit $EXIT_FAILURE 562232b578d3Smrg fi 562332b578d3Smrg newdlfiles="$newdlfiles $libdir/$name" 562432b578d3Smrg done 562532b578d3Smrg dlfiles="$newdlfiles" 562632b578d3Smrg newdlprefiles= 562732b578d3Smrg for lib in $dlprefiles; do 562832b578d3Smrg name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` 562932b578d3Smrg eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` 563032b578d3Smrg if test -z "$libdir"; then 563132b578d3Smrg $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 563232b578d3Smrg exit $EXIT_FAILURE 563332b578d3Smrg fi 563432b578d3Smrg newdlprefiles="$newdlprefiles $libdir/$name" 563532b578d3Smrg done 563632b578d3Smrg dlprefiles="$newdlprefiles" 563732b578d3Smrg else 563832b578d3Smrg newdlfiles= 563932b578d3Smrg for lib in $dlfiles; do 564032b578d3Smrg case $lib in 564132b578d3Smrg [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; 564232b578d3Smrg *) abs=`pwd`"/$lib" ;; 564332b578d3Smrg esac 564432b578d3Smrg newdlfiles="$newdlfiles $abs" 564532b578d3Smrg done 564632b578d3Smrg dlfiles="$newdlfiles" 564732b578d3Smrg newdlprefiles= 564832b578d3Smrg for lib in $dlprefiles; do 564932b578d3Smrg case $lib in 565032b578d3Smrg [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; 565132b578d3Smrg *) abs=`pwd`"/$lib" ;; 565232b578d3Smrg esac 565332b578d3Smrg newdlprefiles="$newdlprefiles $abs" 565432b578d3Smrg done 565532b578d3Smrg dlprefiles="$newdlprefiles" 565632b578d3Smrg fi 565732b578d3Smrg $rm $output 565832b578d3Smrg # place dlname in correct position for cygwin 565932b578d3Smrg tdlname=$dlname 566032b578d3Smrg case $host,$output,$installed,$module,$dlname in 566132b578d3Smrg *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; 566232b578d3Smrg esac 566332b578d3Smrg $echo > $output "\ 566432b578d3Smrg# $outputname - a libtool library file 566532b578d3Smrg# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP 566632b578d3Smrg# 566732b578d3Smrg# Please DO NOT delete this file! 566832b578d3Smrg# It is necessary for linking the library. 566932b578d3Smrg 567032b578d3Smrg# The name that we can dlopen(3). 567132b578d3Smrgdlname='$tdlname' 567232b578d3Smrg 567332b578d3Smrg# Names of this library. 567432b578d3Smrglibrary_names='$library_names' 567532b578d3Smrg 567632b578d3Smrg# The name of the static archive. 567732b578d3Smrgold_library='$old_library' 567832b578d3Smrg 567932b578d3Smrg# Libraries that this one depends upon. 568032b578d3Smrgdependency_libs='$dependency_libs' 568132b578d3Smrg 568232b578d3Smrg# Version information for $libname. 568332b578d3Smrgcurrent=$current 568432b578d3Smrgage=$age 568532b578d3Smrgrevision=$revision 568632b578d3Smrg 568732b578d3Smrg# Is this an already installed library? 568832b578d3Smrginstalled=$installed 568932b578d3Smrg 569032b578d3Smrg# Should we warn about portability when linking against -modules? 569132b578d3Smrgshouldnotlink=$module 569232b578d3Smrg 569332b578d3Smrg# Files to dlopen/dlpreopen 569432b578d3Smrgdlopen='$dlfiles' 569532b578d3Smrgdlpreopen='$dlprefiles' 569632b578d3Smrg 569732b578d3Smrg# Directory that this library needs to be installed in: 569832b578d3Smrglibdir='$install_libdir'" 569932b578d3Smrg if test "$installed" = no && test "$need_relink" = yes; then 570032b578d3Smrg $echo >> $output "\ 570132b578d3Smrgrelink_command=\"$relink_command\"" 570232b578d3Smrg fi 570332b578d3Smrg done 570432b578d3Smrg fi 570532b578d3Smrg 570632b578d3Smrg # Do a symbolic link so that the libtool archive can be found in 570732b578d3Smrg # LD_LIBRARY_PATH before the program is installed. 570832b578d3Smrg $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" 570932b578d3Smrg $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? 571032b578d3Smrg ;; 571132b578d3Smrg esac 571232b578d3Smrg exit $EXIT_SUCCESS 571332b578d3Smrg ;; 571432b578d3Smrg 571532b578d3Smrg # libtool install mode 571632b578d3Smrg install) 571732b578d3Smrg modename="$modename: install" 571832b578d3Smrg 571932b578d3Smrg # There may be an optional sh(1) argument at the beginning of 572032b578d3Smrg # install_prog (especially on Windows NT). 572132b578d3Smrg if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || 572232b578d3Smrg # Allow the use of GNU shtool's install command. 572332b578d3Smrg $echo "X$nonopt" | grep shtool > /dev/null; then 572432b578d3Smrg # Aesthetically quote it. 572532b578d3Smrg arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` 572632b578d3Smrg case $arg in 572732b578d3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 572832b578d3Smrg arg="\"$arg\"" 572932b578d3Smrg ;; 573032b578d3Smrg esac 573132b578d3Smrg install_prog="$arg " 573232b578d3Smrg arg="$1" 573332b578d3Smrg shift 573432b578d3Smrg else 573532b578d3Smrg install_prog= 573632b578d3Smrg arg=$nonopt 573732b578d3Smrg fi 573832b578d3Smrg 573932b578d3Smrg # The real first argument should be the name of the installation program. 574032b578d3Smrg # Aesthetically quote it. 574132b578d3Smrg arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` 574232b578d3Smrg case $arg in 574332b578d3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 574432b578d3Smrg arg="\"$arg\"" 574532b578d3Smrg ;; 574632b578d3Smrg esac 574732b578d3Smrg install_prog="$install_prog$arg" 574832b578d3Smrg 574932b578d3Smrg # We need to accept at least all the BSD install flags. 575032b578d3Smrg dest= 575132b578d3Smrg files= 575232b578d3Smrg opts= 575332b578d3Smrg prev= 575432b578d3Smrg install_type= 575532b578d3Smrg isdir=no 575632b578d3Smrg stripme= 575732b578d3Smrg for arg 575832b578d3Smrg do 575932b578d3Smrg if test -n "$dest"; then 576032b578d3Smrg files="$files $dest" 576132b578d3Smrg dest=$arg 576232b578d3Smrg continue 576332b578d3Smrg fi 576432b578d3Smrg 576532b578d3Smrg case $arg in 576632b578d3Smrg -d) isdir=yes ;; 576732b578d3Smrg -f) 576832b578d3Smrg case " $install_prog " in 576932b578d3Smrg *[\\\ /]cp\ *) ;; 577032b578d3Smrg *) prev=$arg ;; 577132b578d3Smrg esac 577232b578d3Smrg ;; 577332b578d3Smrg -g | -m | -o) prev=$arg ;; 577432b578d3Smrg -s) 577532b578d3Smrg stripme=" -s" 577632b578d3Smrg continue 577732b578d3Smrg ;; 577832b578d3Smrg -*) 577932b578d3Smrg ;; 578032b578d3Smrg *) 578132b578d3Smrg # If the previous option needed an argument, then skip it. 578232b578d3Smrg if test -n "$prev"; then 578332b578d3Smrg prev= 578432b578d3Smrg else 578532b578d3Smrg dest=$arg 578632b578d3Smrg continue 578732b578d3Smrg fi 578832b578d3Smrg ;; 578932b578d3Smrg esac 579032b578d3Smrg 579132b578d3Smrg # Aesthetically quote the argument. 579232b578d3Smrg arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` 579332b578d3Smrg case $arg in 579432b578d3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 579532b578d3Smrg arg="\"$arg\"" 579632b578d3Smrg ;; 579732b578d3Smrg esac 579832b578d3Smrg install_prog="$install_prog $arg" 579932b578d3Smrg done 580032b578d3Smrg 580132b578d3Smrg if test -z "$install_prog"; then 580232b578d3Smrg $echo "$modename: you must specify an install program" 1>&2 580332b578d3Smrg $echo "$help" 1>&2 580432b578d3Smrg exit $EXIT_FAILURE 580532b578d3Smrg fi 580632b578d3Smrg 580732b578d3Smrg if test -n "$prev"; then 580832b578d3Smrg $echo "$modename: the \`$prev' option requires an argument" 1>&2 580932b578d3Smrg $echo "$help" 1>&2 581032b578d3Smrg exit $EXIT_FAILURE 581132b578d3Smrg fi 581232b578d3Smrg 581332b578d3Smrg if test -z "$files"; then 581432b578d3Smrg if test -z "$dest"; then 581532b578d3Smrg $echo "$modename: no file or destination specified" 1>&2 581632b578d3Smrg else 581732b578d3Smrg $echo "$modename: you must specify a destination" 1>&2 581832b578d3Smrg fi 581932b578d3Smrg $echo "$help" 1>&2 582032b578d3Smrg exit $EXIT_FAILURE 582132b578d3Smrg fi 582232b578d3Smrg 582332b578d3Smrg # Strip any trailing slash from the destination. 582432b578d3Smrg dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` 582532b578d3Smrg 582632b578d3Smrg # Check to see that the destination is a directory. 582732b578d3Smrg test -d "$dest" && isdir=yes 582832b578d3Smrg if test "$isdir" = yes; then 582932b578d3Smrg destdir="$dest" 583032b578d3Smrg destname= 583132b578d3Smrg else 583232b578d3Smrg destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` 583332b578d3Smrg test "X$destdir" = "X$dest" && destdir=. 583432b578d3Smrg destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` 583532b578d3Smrg 583632b578d3Smrg # Not a directory, so check to see that there is only one file specified. 583732b578d3Smrg set dummy $files 583832b578d3Smrg if test "$#" -gt 2; then 583932b578d3Smrg $echo "$modename: \`$dest' is not a directory" 1>&2 584032b578d3Smrg $echo "$help" 1>&2 584132b578d3Smrg exit $EXIT_FAILURE 584232b578d3Smrg fi 584332b578d3Smrg fi 584432b578d3Smrg case $destdir in 584532b578d3Smrg [\\/]* | [A-Za-z]:[\\/]*) ;; 584632b578d3Smrg *) 584732b578d3Smrg for file in $files; do 584832b578d3Smrg case $file in 584932b578d3Smrg *.lo) ;; 585032b578d3Smrg *) 585132b578d3Smrg $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 585232b578d3Smrg $echo "$help" 1>&2 585332b578d3Smrg exit $EXIT_FAILURE 585432b578d3Smrg ;; 585532b578d3Smrg esac 585632b578d3Smrg done 585732b578d3Smrg ;; 585832b578d3Smrg esac 585932b578d3Smrg 586032b578d3Smrg # This variable tells wrapper scripts just to set variables rather 586132b578d3Smrg # than running their programs. 586232b578d3Smrg libtool_install_magic="$magic" 586332b578d3Smrg 586432b578d3Smrg staticlibs= 586532b578d3Smrg future_libdirs= 586632b578d3Smrg current_libdirs= 586732b578d3Smrg for file in $files; do 586832b578d3Smrg 586932b578d3Smrg # Do each installation. 587032b578d3Smrg case $file in 587132b578d3Smrg *.$libext) 587232b578d3Smrg # Do the static libraries later. 587332b578d3Smrg staticlibs="$staticlibs $file" 587432b578d3Smrg ;; 587532b578d3Smrg 587632b578d3Smrg *.la) 587732b578d3Smrg # Check to see that this really is a libtool archive. 587832b578d3Smrg if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : 587932b578d3Smrg else 588032b578d3Smrg $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 588132b578d3Smrg $echo "$help" 1>&2 588232b578d3Smrg exit $EXIT_FAILURE 588332b578d3Smrg fi 588432b578d3Smrg 588532b578d3Smrg library_names= 588632b578d3Smrg old_library= 588732b578d3Smrg relink_command= 588832b578d3Smrg # If there is no directory component, then add one. 588932b578d3Smrg case $file in 589032b578d3Smrg */* | *\\*) . $file ;; 589132b578d3Smrg *) . ./$file ;; 589232b578d3Smrg esac 589332b578d3Smrg 589432b578d3Smrg # Add the libdir to current_libdirs if it is the destination. 589532b578d3Smrg if test "X$destdir" = "X$libdir"; then 589632b578d3Smrg case "$current_libdirs " in 589732b578d3Smrg *" $libdir "*) ;; 589832b578d3Smrg *) current_libdirs="$current_libdirs $libdir" ;; 589932b578d3Smrg esac 590032b578d3Smrg else 590132b578d3Smrg # Note the libdir as a future libdir. 590232b578d3Smrg case "$future_libdirs " in 590332b578d3Smrg *" $libdir "*) ;; 590432b578d3Smrg *) future_libdirs="$future_libdirs $libdir" ;; 590532b578d3Smrg esac 590632b578d3Smrg fi 590732b578d3Smrg 590832b578d3Smrg dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ 590932b578d3Smrg test "X$dir" = "X$file/" && dir= 591032b578d3Smrg dir="$dir$objdir" 591132b578d3Smrg 591232b578d3Smrg if test -n "$relink_command"; then 591332b578d3Smrg # Determine the prefix the user has applied to our future dir. 591432b578d3Smrg inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` 591532b578d3Smrg 591632b578d3Smrg # Don't allow the user to place us outside of our expected 591732b578d3Smrg # location b/c this prevents finding dependent libraries that 591832b578d3Smrg # are installed to the same prefix. 591932b578d3Smrg # At present, this check doesn't affect windows .dll's that 592032b578d3Smrg # are installed into $libdir/../bin (currently, that works fine) 592132b578d3Smrg # but it's something to keep an eye on. 592232b578d3Smrg if test "$inst_prefix_dir" = "$destdir"; then 592332b578d3Smrg $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 592432b578d3Smrg exit $EXIT_FAILURE 592532b578d3Smrg fi 592632b578d3Smrg 592732b578d3Smrg if test -n "$inst_prefix_dir"; then 592832b578d3Smrg # Stick the inst_prefix_dir data into the link command. 5929d31dbc53Smrg relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` 593032b578d3Smrg else 5931d31dbc53Smrg relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` 593232b578d3Smrg fi 593332b578d3Smrg 593432b578d3Smrg $echo "$modename: warning: relinking \`$file'" 1>&2 593532b578d3Smrg $show "$relink_command" 593632b578d3Smrg if $run eval "$relink_command"; then : 593732b578d3Smrg else 593832b578d3Smrg $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 593932b578d3Smrg exit $EXIT_FAILURE 594032b578d3Smrg fi 594132b578d3Smrg fi 594232b578d3Smrg 594332b578d3Smrg # See the names of the shared library. 594432b578d3Smrg set dummy $library_names 594532b578d3Smrg if test -n "$2"; then 594632b578d3Smrg realname="$2" 594732b578d3Smrg shift 594832b578d3Smrg shift 594932b578d3Smrg 595032b578d3Smrg srcname="$realname" 595132b578d3Smrg test -n "$relink_command" && srcname="$realname"T 595232b578d3Smrg 595332b578d3Smrg # Install the shared library and build the symlinks. 595432b578d3Smrg $show "$install_prog $dir/$srcname $destdir/$realname" 595532b578d3Smrg $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? 595632b578d3Smrg if test -n "$stripme" && test -n "$striplib"; then 595732b578d3Smrg $show "$striplib $destdir/$realname" 595832b578d3Smrg $run eval "$striplib $destdir/$realname" || exit $? 595932b578d3Smrg fi 596032b578d3Smrg 596132b578d3Smrg if test "$#" -gt 0; then 596232b578d3Smrg # Delete the old symlinks, and create new ones. 596332b578d3Smrg # Try `ln -sf' first, because the `ln' binary might depend on 596432b578d3Smrg # the symlink we replace! Solaris /bin/ln does not understand -f, 596532b578d3Smrg # so we also need to try rm && ln -s. 596632b578d3Smrg for linkname 596732b578d3Smrg do 596832b578d3Smrg if test "$linkname" != "$realname"; then 596932b578d3Smrg $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" 597032b578d3Smrg $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" 597132b578d3Smrg fi 597232b578d3Smrg done 597332b578d3Smrg fi 597432b578d3Smrg 597532b578d3Smrg # Do each command in the postinstall commands. 597632b578d3Smrg lib="$destdir/$realname" 597732b578d3Smrg cmds=$postinstall_cmds 597832b578d3Smrg save_ifs="$IFS"; IFS='~' 597932b578d3Smrg for cmd in $cmds; do 598032b578d3Smrg IFS="$save_ifs" 598132b578d3Smrg eval cmd=\"$cmd\" 598232b578d3Smrg $show "$cmd" 598332b578d3Smrg $run eval "$cmd" || { 598432b578d3Smrg lt_exit=$? 598532b578d3Smrg 598632b578d3Smrg # Restore the uninstalled library and exit 598732b578d3Smrg if test "$mode" = relink; then 598832b578d3Smrg $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' 598932b578d3Smrg fi 599032b578d3Smrg 599132b578d3Smrg exit $lt_exit 599232b578d3Smrg } 599332b578d3Smrg done 599432b578d3Smrg IFS="$save_ifs" 599532b578d3Smrg fi 599632b578d3Smrg 599732b578d3Smrg # Install the pseudo-library for information purposes. 599832b578d3Smrg name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` 599932b578d3Smrg instname="$dir/$name"i 600032b578d3Smrg $show "$install_prog $instname $destdir/$name" 600132b578d3Smrg $run eval "$install_prog $instname $destdir/$name" || exit $? 600232b578d3Smrg 600332b578d3Smrg # Maybe install the static library, too. 600432b578d3Smrg test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" 600532b578d3Smrg ;; 600632b578d3Smrg 600732b578d3Smrg *.lo) 600832b578d3Smrg # Install (i.e. copy) a libtool object. 600932b578d3Smrg 601032b578d3Smrg # Figure out destination file name, if it wasn't already specified. 601132b578d3Smrg if test -n "$destname"; then 601232b578d3Smrg destfile="$destdir/$destname" 601332b578d3Smrg else 601432b578d3Smrg destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` 601532b578d3Smrg destfile="$destdir/$destfile" 601632b578d3Smrg fi 601732b578d3Smrg 601832b578d3Smrg # Deduce the name of the destination old-style object file. 601932b578d3Smrg case $destfile in 602032b578d3Smrg *.lo) 602132b578d3Smrg staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` 602232b578d3Smrg ;; 602332b578d3Smrg *.$objext) 602432b578d3Smrg staticdest="$destfile" 602532b578d3Smrg destfile= 602632b578d3Smrg ;; 602732b578d3Smrg *) 602832b578d3Smrg $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 602932b578d3Smrg $echo "$help" 1>&2 603032b578d3Smrg exit $EXIT_FAILURE 603132b578d3Smrg ;; 603232b578d3Smrg esac 603332b578d3Smrg 603432b578d3Smrg # Install the libtool object if requested. 603532b578d3Smrg if test -n "$destfile"; then 603632b578d3Smrg $show "$install_prog $file $destfile" 603732b578d3Smrg $run eval "$install_prog $file $destfile" || exit $? 603832b578d3Smrg fi 603932b578d3Smrg 604032b578d3Smrg # Install the old object if enabled. 604132b578d3Smrg if test "$build_old_libs" = yes; then 604232b578d3Smrg # Deduce the name of the old-style object file. 604332b578d3Smrg staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` 604432b578d3Smrg 604532b578d3Smrg $show "$install_prog $staticobj $staticdest" 604632b578d3Smrg $run eval "$install_prog \$staticobj \$staticdest" || exit $? 604732b578d3Smrg fi 604832b578d3Smrg exit $EXIT_SUCCESS 604932b578d3Smrg ;; 605032b578d3Smrg 605132b578d3Smrg *) 605232b578d3Smrg # Figure out destination file name, if it wasn't already specified. 605332b578d3Smrg if test -n "$destname"; then 605432b578d3Smrg destfile="$destdir/$destname" 605532b578d3Smrg else 605632b578d3Smrg destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` 605732b578d3Smrg destfile="$destdir/$destfile" 605832b578d3Smrg fi 605932b578d3Smrg 606032b578d3Smrg # If the file is missing, and there is a .exe on the end, strip it 606132b578d3Smrg # because it is most likely a libtool script we actually want to 606232b578d3Smrg # install 606332b578d3Smrg stripped_ext="" 606432b578d3Smrg case $file in 606532b578d3Smrg *.exe) 606632b578d3Smrg if test ! -f "$file"; then 606732b578d3Smrg file=`$echo $file|${SED} 's,.exe$,,'` 606832b578d3Smrg stripped_ext=".exe" 606932b578d3Smrg fi 607032b578d3Smrg ;; 607132b578d3Smrg esac 607232b578d3Smrg 607332b578d3Smrg # Do a test to see if this is really a libtool program. 607432b578d3Smrg case $host in 607532b578d3Smrg *cygwin*|*mingw*) 607632b578d3Smrg wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` 607732b578d3Smrg ;; 607832b578d3Smrg *) 607932b578d3Smrg wrapper=$file 608032b578d3Smrg ;; 608132b578d3Smrg esac 608232b578d3Smrg if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then 608332b578d3Smrg notinst_deplibs= 608432b578d3Smrg relink_command= 608532b578d3Smrg 608632b578d3Smrg # Note that it is not necessary on cygwin/mingw to append a dot to 608732b578d3Smrg # foo even if both foo and FILE.exe exist: automatic-append-.exe 608832b578d3Smrg # behavior happens only for exec(3), not for open(2)! Also, sourcing 608932b578d3Smrg # `FILE.' does not work on cygwin managed mounts. 609032b578d3Smrg # 609132b578d3Smrg # If there is no directory component, then add one. 609232b578d3Smrg case $wrapper in 609332b578d3Smrg */* | *\\*) . ${wrapper} ;; 609432b578d3Smrg *) . ./${wrapper} ;; 609532b578d3Smrg esac 609632b578d3Smrg 609732b578d3Smrg # Check the variables that should have been set. 609832b578d3Smrg if test -z "$notinst_deplibs"; then 609932b578d3Smrg $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 610032b578d3Smrg exit $EXIT_FAILURE 610132b578d3Smrg fi 610232b578d3Smrg 610332b578d3Smrg finalize=yes 610432b578d3Smrg for lib in $notinst_deplibs; do 610532b578d3Smrg # Check to see that each library is installed. 610632b578d3Smrg libdir= 610732b578d3Smrg if test -f "$lib"; then 610832b578d3Smrg # If there is no directory component, then add one. 610932b578d3Smrg case $lib in 611032b578d3Smrg */* | *\\*) . $lib ;; 611132b578d3Smrg *) . ./$lib ;; 611232b578d3Smrg esac 611332b578d3Smrg fi 611432b578d3Smrg libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test 611532b578d3Smrg if test -n "$libdir" && test ! -f "$libfile"; then 611632b578d3Smrg $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 611732b578d3Smrg finalize=no 611832b578d3Smrg fi 611932b578d3Smrg done 612032b578d3Smrg 612132b578d3Smrg relink_command= 612232b578d3Smrg # Note that it is not necessary on cygwin/mingw to append a dot to 612332b578d3Smrg # foo even if both foo and FILE.exe exist: automatic-append-.exe 612432b578d3Smrg # behavior happens only for exec(3), not for open(2)! Also, sourcing 612532b578d3Smrg # `FILE.' does not work on cygwin managed mounts. 612632b578d3Smrg # 612732b578d3Smrg # If there is no directory component, then add one. 612832b578d3Smrg case $wrapper in 612932b578d3Smrg */* | *\\*) . ${wrapper} ;; 613032b578d3Smrg *) . ./${wrapper} ;; 613132b578d3Smrg esac 613232b578d3Smrg 613332b578d3Smrg outputname= 613432b578d3Smrg if test "$fast_install" = no && test -n "$relink_command"; then 613532b578d3Smrg if test "$finalize" = yes && test -z "$run"; then 613632b578d3Smrg tmpdir=`func_mktempdir` 613732b578d3Smrg file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` 613832b578d3Smrg outputname="$tmpdir/$file" 613932b578d3Smrg # Replace the output file specification. 6140d31dbc53Smrg relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` 614132b578d3Smrg 614232b578d3Smrg $show "$relink_command" 614332b578d3Smrg if $run eval "$relink_command"; then : 614432b578d3Smrg else 614532b578d3Smrg $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 614632b578d3Smrg ${rm}r "$tmpdir" 614732b578d3Smrg continue 614832b578d3Smrg fi 614932b578d3Smrg file="$outputname" 615032b578d3Smrg else 615132b578d3Smrg $echo "$modename: warning: cannot relink \`$file'" 1>&2 615232b578d3Smrg fi 615332b578d3Smrg else 615432b578d3Smrg # Install the binary that we compiled earlier. 615532b578d3Smrg file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` 615632b578d3Smrg fi 615732b578d3Smrg fi 615832b578d3Smrg 615932b578d3Smrg # remove .exe since cygwin /usr/bin/install will append another 616032b578d3Smrg # one anyway 616132b578d3Smrg case $install_prog,$host in 616232b578d3Smrg */usr/bin/install*,*cygwin*) 616332b578d3Smrg case $file:$destfile in 616432b578d3Smrg *.exe:*.exe) 616532b578d3Smrg # this is ok 616632b578d3Smrg ;; 616732b578d3Smrg *.exe:*) 616832b578d3Smrg destfile=$destfile.exe 616932b578d3Smrg ;; 617032b578d3Smrg *:*.exe) 617132b578d3Smrg destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` 617232b578d3Smrg ;; 617332b578d3Smrg esac 617432b578d3Smrg ;; 617532b578d3Smrg esac 617632b578d3Smrg $show "$install_prog$stripme $file $destfile" 617732b578d3Smrg $run eval "$install_prog\$stripme \$file \$destfile" || exit $? 617832b578d3Smrg test -n "$outputname" && ${rm}r "$tmpdir" 617932b578d3Smrg ;; 618032b578d3Smrg esac 618132b578d3Smrg done 618232b578d3Smrg 618332b578d3Smrg for file in $staticlibs; do 618432b578d3Smrg name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` 618532b578d3Smrg 618632b578d3Smrg # Set up the ranlib parameters. 618732b578d3Smrg oldlib="$destdir/$name" 618832b578d3Smrg 618932b578d3Smrg $show "$install_prog $file $oldlib" 619032b578d3Smrg $run eval "$install_prog \$file \$oldlib" || exit $? 619132b578d3Smrg 619232b578d3Smrg if test -n "$stripme" && test -n "$old_striplib"; then 619332b578d3Smrg $show "$old_striplib $oldlib" 619432b578d3Smrg $run eval "$old_striplib $oldlib" || exit $? 619532b578d3Smrg fi 619632b578d3Smrg 619732b578d3Smrg # Do each command in the postinstall commands. 619832b578d3Smrg cmds=$old_postinstall_cmds 619932b578d3Smrg save_ifs="$IFS"; IFS='~' 620032b578d3Smrg for cmd in $cmds; do 620132b578d3Smrg IFS="$save_ifs" 620232b578d3Smrg eval cmd=\"$cmd\" 620332b578d3Smrg $show "$cmd" 620432b578d3Smrg $run eval "$cmd" || exit $? 620532b578d3Smrg done 620632b578d3Smrg IFS="$save_ifs" 620732b578d3Smrg done 620832b578d3Smrg 620932b578d3Smrg if test -n "$future_libdirs"; then 621032b578d3Smrg $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 621132b578d3Smrg fi 621232b578d3Smrg 621332b578d3Smrg if test -n "$current_libdirs"; then 621432b578d3Smrg # Maybe just do a dry run. 621532b578d3Smrg test -n "$run" && current_libdirs=" -n$current_libdirs" 621632b578d3Smrg exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' 621732b578d3Smrg else 621832b578d3Smrg exit $EXIT_SUCCESS 621932b578d3Smrg fi 622032b578d3Smrg ;; 622132b578d3Smrg 622232b578d3Smrg # libtool finish mode 622332b578d3Smrg finish) 622432b578d3Smrg modename="$modename: finish" 622532b578d3Smrg libdirs="$nonopt" 622632b578d3Smrg admincmds= 622732b578d3Smrg 622832b578d3Smrg if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then 622932b578d3Smrg for dir 623032b578d3Smrg do 623132b578d3Smrg libdirs="$libdirs $dir" 623232b578d3Smrg done 623332b578d3Smrg 623432b578d3Smrg for libdir in $libdirs; do 623532b578d3Smrg if test -n "$finish_cmds"; then 623632b578d3Smrg # Do each command in the finish commands. 623732b578d3Smrg cmds=$finish_cmds 623832b578d3Smrg save_ifs="$IFS"; IFS='~' 623932b578d3Smrg for cmd in $cmds; do 624032b578d3Smrg IFS="$save_ifs" 624132b578d3Smrg eval cmd=\"$cmd\" 624232b578d3Smrg $show "$cmd" 624332b578d3Smrg $run eval "$cmd" || admincmds="$admincmds 624432b578d3Smrg $cmd" 624532b578d3Smrg done 624632b578d3Smrg IFS="$save_ifs" 624732b578d3Smrg fi 624832b578d3Smrg if test -n "$finish_eval"; then 624932b578d3Smrg # Do the single finish_eval. 625032b578d3Smrg eval cmds=\"$finish_eval\" 625132b578d3Smrg $run eval "$cmds" || admincmds="$admincmds 625232b578d3Smrg $cmds" 625332b578d3Smrg fi 625432b578d3Smrg done 625532b578d3Smrg fi 625632b578d3Smrg 625732b578d3Smrg # Exit here if they wanted silent mode. 625832b578d3Smrg test "$show" = : && exit $EXIT_SUCCESS 625932b578d3Smrg 626032b578d3Smrg $echo "X----------------------------------------------------------------------" | $Xsed 626132b578d3Smrg $echo "Libraries have been installed in:" 626232b578d3Smrg for libdir in $libdirs; do 626332b578d3Smrg $echo " $libdir" 626432b578d3Smrg done 626532b578d3Smrg $echo 626632b578d3Smrg $echo "If you ever happen to want to link against installed libraries" 626732b578d3Smrg $echo "in a given directory, LIBDIR, you must either use libtool, and" 626832b578d3Smrg $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" 626932b578d3Smrg $echo "flag during linking and do at least one of the following:" 627032b578d3Smrg if test -n "$shlibpath_var"; then 627132b578d3Smrg $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" 627232b578d3Smrg $echo " during execution" 627332b578d3Smrg fi 627432b578d3Smrg if test -n "$runpath_var"; then 627532b578d3Smrg $echo " - add LIBDIR to the \`$runpath_var' environment variable" 627632b578d3Smrg $echo " during linking" 627732b578d3Smrg fi 627832b578d3Smrg if test -n "$hardcode_libdir_flag_spec"; then 627932b578d3Smrg libdir=LIBDIR 628032b578d3Smrg eval flag=\"$hardcode_libdir_flag_spec\" 628132b578d3Smrg 628232b578d3Smrg $echo " - use the \`$flag' linker flag" 628332b578d3Smrg fi 628432b578d3Smrg if test -n "$admincmds"; then 628532b578d3Smrg $echo " - have your system administrator run these commands:$admincmds" 628632b578d3Smrg fi 628732b578d3Smrg if test -f /etc/ld.so.conf; then 628832b578d3Smrg $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" 628932b578d3Smrg fi 629032b578d3Smrg $echo 629132b578d3Smrg $echo "See any operating system documentation about shared libraries for" 629232b578d3Smrg $echo "more information, such as the ld(1) and ld.so(8) manual pages." 629332b578d3Smrg $echo "X----------------------------------------------------------------------" | $Xsed 629432b578d3Smrg exit $EXIT_SUCCESS 629532b578d3Smrg ;; 629632b578d3Smrg 629732b578d3Smrg # libtool execute mode 629832b578d3Smrg execute) 629932b578d3Smrg modename="$modename: execute" 630032b578d3Smrg 630132b578d3Smrg # The first argument is the command name. 630232b578d3Smrg cmd="$nonopt" 630332b578d3Smrg if test -z "$cmd"; then 630432b578d3Smrg $echo "$modename: you must specify a COMMAND" 1>&2 630532b578d3Smrg $echo "$help" 630632b578d3Smrg exit $EXIT_FAILURE 630732b578d3Smrg fi 630832b578d3Smrg 630932b578d3Smrg # Handle -dlopen flags immediately. 631032b578d3Smrg for file in $execute_dlfiles; do 631132b578d3Smrg if test ! -f "$file"; then 631232b578d3Smrg $echo "$modename: \`$file' is not a file" 1>&2 631332b578d3Smrg $echo "$help" 1>&2 631432b578d3Smrg exit $EXIT_FAILURE 631532b578d3Smrg fi 631632b578d3Smrg 631732b578d3Smrg dir= 631832b578d3Smrg case $file in 631932b578d3Smrg *.la) 632032b578d3Smrg # Check to see that this really is a libtool archive. 632132b578d3Smrg if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : 632232b578d3Smrg else 632332b578d3Smrg $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 632432b578d3Smrg $echo "$help" 1>&2 632532b578d3Smrg exit $EXIT_FAILURE 632632b578d3Smrg fi 632732b578d3Smrg 632832b578d3Smrg # Read the libtool library. 632932b578d3Smrg dlname= 633032b578d3Smrg library_names= 633132b578d3Smrg 633232b578d3Smrg # If there is no directory component, then add one. 633332b578d3Smrg case $file in 633432b578d3Smrg */* | *\\*) . $file ;; 633532b578d3Smrg *) . ./$file ;; 633632b578d3Smrg esac 633732b578d3Smrg 633832b578d3Smrg # Skip this library if it cannot be dlopened. 633932b578d3Smrg if test -z "$dlname"; then 634032b578d3Smrg # Warn if it was a shared library. 634132b578d3Smrg test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" 634232b578d3Smrg continue 634332b578d3Smrg fi 634432b578d3Smrg 634532b578d3Smrg dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` 634632b578d3Smrg test "X$dir" = "X$file" && dir=. 634732b578d3Smrg 634832b578d3Smrg if test -f "$dir/$objdir/$dlname"; then 634932b578d3Smrg dir="$dir/$objdir" 635032b578d3Smrg else 6351d31dbc53Smrg $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 6352d31dbc53Smrg exit $EXIT_FAILURE 635332b578d3Smrg fi 635432b578d3Smrg ;; 635532b578d3Smrg 635632b578d3Smrg *.lo) 635732b578d3Smrg # Just add the directory containing the .lo file. 635832b578d3Smrg dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` 635932b578d3Smrg test "X$dir" = "X$file" && dir=. 636032b578d3Smrg ;; 636132b578d3Smrg 636232b578d3Smrg *) 636332b578d3Smrg $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 636432b578d3Smrg continue 636532b578d3Smrg ;; 636632b578d3Smrg esac 636732b578d3Smrg 636832b578d3Smrg # Get the absolute pathname. 636932b578d3Smrg absdir=`cd "$dir" && pwd` 637032b578d3Smrg test -n "$absdir" && dir="$absdir" 637132b578d3Smrg 637232b578d3Smrg # Now add the directory to shlibpath_var. 637332b578d3Smrg if eval "test -z \"\$$shlibpath_var\""; then 637432b578d3Smrg eval "$shlibpath_var=\"\$dir\"" 637532b578d3Smrg else 637632b578d3Smrg eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" 637732b578d3Smrg fi 637832b578d3Smrg done 637932b578d3Smrg 638032b578d3Smrg # This variable tells wrapper scripts just to set shlibpath_var 638132b578d3Smrg # rather than running their programs. 638232b578d3Smrg libtool_execute_magic="$magic" 638332b578d3Smrg 638432b578d3Smrg # Check if any of the arguments is a wrapper script. 638532b578d3Smrg args= 638632b578d3Smrg for file 638732b578d3Smrg do 638832b578d3Smrg case $file in 638932b578d3Smrg -*) ;; 639032b578d3Smrg *) 639132b578d3Smrg # Do a test to see if this is really a libtool program. 639232b578d3Smrg if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 639332b578d3Smrg # If there is no directory component, then add one. 639432b578d3Smrg case $file in 639532b578d3Smrg */* | *\\*) . $file ;; 639632b578d3Smrg *) . ./$file ;; 639732b578d3Smrg esac 639832b578d3Smrg 639932b578d3Smrg # Transform arg to wrapped name. 640032b578d3Smrg file="$progdir/$program" 640132b578d3Smrg fi 640232b578d3Smrg ;; 640332b578d3Smrg esac 640432b578d3Smrg # Quote arguments (to preserve shell metacharacters). 640532b578d3Smrg file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` 640632b578d3Smrg args="$args \"$file\"" 640732b578d3Smrg done 640832b578d3Smrg 640932b578d3Smrg if test -z "$run"; then 641032b578d3Smrg if test -n "$shlibpath_var"; then 641132b578d3Smrg # Export the shlibpath_var. 641232b578d3Smrg eval "export $shlibpath_var" 641332b578d3Smrg fi 641432b578d3Smrg 641532b578d3Smrg # Restore saved environment variables 6416d31dbc53Smrg if test "${save_LC_ALL+set}" = set; then 6417d31dbc53Smrg LC_ALL="$save_LC_ALL"; export LC_ALL 6418d31dbc53Smrg fi 6419d31dbc53Smrg if test "${save_LANG+set}" = set; then 6420d31dbc53Smrg LANG="$save_LANG"; export LANG 6421d31dbc53Smrg fi 642232b578d3Smrg 642332b578d3Smrg # Now prepare to actually exec the command. 642432b578d3Smrg exec_cmd="\$cmd$args" 642532b578d3Smrg else 642632b578d3Smrg # Display what would be done. 642732b578d3Smrg if test -n "$shlibpath_var"; then 642832b578d3Smrg eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" 642932b578d3Smrg $echo "export $shlibpath_var" 643032b578d3Smrg fi 643132b578d3Smrg $echo "$cmd$args" 643232b578d3Smrg exit $EXIT_SUCCESS 643332b578d3Smrg fi 643432b578d3Smrg ;; 643532b578d3Smrg 643632b578d3Smrg # libtool clean and uninstall mode 643732b578d3Smrg clean | uninstall) 643832b578d3Smrg modename="$modename: $mode" 643932b578d3Smrg rm="$nonopt" 644032b578d3Smrg files= 644132b578d3Smrg rmforce= 644232b578d3Smrg exit_status=0 644332b578d3Smrg 644432b578d3Smrg # This variable tells wrapper scripts just to set variables rather 644532b578d3Smrg # than running their programs. 644632b578d3Smrg libtool_install_magic="$magic" 644732b578d3Smrg 644832b578d3Smrg for arg 644932b578d3Smrg do 645032b578d3Smrg case $arg in 645132b578d3Smrg -f) rm="$rm $arg"; rmforce=yes ;; 645232b578d3Smrg -*) rm="$rm $arg" ;; 645332b578d3Smrg *) files="$files $arg" ;; 645432b578d3Smrg esac 645532b578d3Smrg done 645632b578d3Smrg 645732b578d3Smrg if test -z "$rm"; then 645832b578d3Smrg $echo "$modename: you must specify an RM program" 1>&2 645932b578d3Smrg $echo "$help" 1>&2 646032b578d3Smrg exit $EXIT_FAILURE 646132b578d3Smrg fi 646232b578d3Smrg 646332b578d3Smrg rmdirs= 646432b578d3Smrg 646532b578d3Smrg origobjdir="$objdir" 646632b578d3Smrg for file in $files; do 646732b578d3Smrg dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` 646832b578d3Smrg if test "X$dir" = "X$file"; then 646932b578d3Smrg dir=. 647032b578d3Smrg objdir="$origobjdir" 647132b578d3Smrg else 647232b578d3Smrg objdir="$dir/$origobjdir" 647332b578d3Smrg fi 647432b578d3Smrg name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` 647532b578d3Smrg test "$mode" = uninstall && objdir="$dir" 647632b578d3Smrg 647732b578d3Smrg # Remember objdir for removal later, being careful to avoid duplicates 647832b578d3Smrg if test "$mode" = clean; then 647932b578d3Smrg case " $rmdirs " in 648032b578d3Smrg *" $objdir "*) ;; 648132b578d3Smrg *) rmdirs="$rmdirs $objdir" ;; 648232b578d3Smrg esac 648332b578d3Smrg fi 648432b578d3Smrg 648532b578d3Smrg # Don't error if the file doesn't exist and rm -f was used. 648632b578d3Smrg if (test -L "$file") >/dev/null 2>&1 \ 648732b578d3Smrg || (test -h "$file") >/dev/null 2>&1 \ 648832b578d3Smrg || test -f "$file"; then 648932b578d3Smrg : 649032b578d3Smrg elif test -d "$file"; then 649132b578d3Smrg exit_status=1 649232b578d3Smrg continue 649332b578d3Smrg elif test "$rmforce" = yes; then 649432b578d3Smrg continue 649532b578d3Smrg fi 649632b578d3Smrg 649732b578d3Smrg rmfiles="$file" 649832b578d3Smrg 649932b578d3Smrg case $name in 650032b578d3Smrg *.la) 650132b578d3Smrg # Possibly a libtool archive, so verify it. 650232b578d3Smrg if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 650332b578d3Smrg . $dir/$name 650432b578d3Smrg 650532b578d3Smrg # Delete the libtool libraries and symlinks. 650632b578d3Smrg for n in $library_names; do 650732b578d3Smrg rmfiles="$rmfiles $objdir/$n" 650832b578d3Smrg done 650932b578d3Smrg test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" 651032b578d3Smrg 651132b578d3Smrg case "$mode" in 651232b578d3Smrg clean) 651332b578d3Smrg case " $library_names " in 651432b578d3Smrg # " " in the beginning catches empty $dlname 651532b578d3Smrg *" $dlname "*) ;; 651632b578d3Smrg *) rmfiles="$rmfiles $objdir/$dlname" ;; 651732b578d3Smrg esac 651832b578d3Smrg test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" 651932b578d3Smrg ;; 652032b578d3Smrg uninstall) 652132b578d3Smrg if test -n "$library_names"; then 652232b578d3Smrg # Do each command in the postuninstall commands. 652332b578d3Smrg cmds=$postuninstall_cmds 652432b578d3Smrg save_ifs="$IFS"; IFS='~' 652532b578d3Smrg for cmd in $cmds; do 652632b578d3Smrg IFS="$save_ifs" 652732b578d3Smrg eval cmd=\"$cmd\" 652832b578d3Smrg $show "$cmd" 652932b578d3Smrg $run eval "$cmd" 653032b578d3Smrg if test "$?" -ne 0 && test "$rmforce" != yes; then 653132b578d3Smrg exit_status=1 653232b578d3Smrg fi 653332b578d3Smrg done 653432b578d3Smrg IFS="$save_ifs" 653532b578d3Smrg fi 653632b578d3Smrg 653732b578d3Smrg if test -n "$old_library"; then 653832b578d3Smrg # Do each command in the old_postuninstall commands. 653932b578d3Smrg cmds=$old_postuninstall_cmds 654032b578d3Smrg save_ifs="$IFS"; IFS='~' 654132b578d3Smrg for cmd in $cmds; do 654232b578d3Smrg IFS="$save_ifs" 654332b578d3Smrg eval cmd=\"$cmd\" 654432b578d3Smrg $show "$cmd" 654532b578d3Smrg $run eval "$cmd" 654632b578d3Smrg if test "$?" -ne 0 && test "$rmforce" != yes; then 654732b578d3Smrg exit_status=1 654832b578d3Smrg fi 654932b578d3Smrg done 655032b578d3Smrg IFS="$save_ifs" 655132b578d3Smrg fi 655232b578d3Smrg # FIXME: should reinstall the best remaining shared library. 655332b578d3Smrg ;; 655432b578d3Smrg esac 655532b578d3Smrg fi 655632b578d3Smrg ;; 655732b578d3Smrg 655832b578d3Smrg *.lo) 655932b578d3Smrg # Possibly a libtool object, so verify it. 656032b578d3Smrg if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 656132b578d3Smrg 656232b578d3Smrg # Read the .lo file 656332b578d3Smrg . $dir/$name 656432b578d3Smrg 656532b578d3Smrg # Add PIC object to the list of files to remove. 656632b578d3Smrg if test -n "$pic_object" \ 656732b578d3Smrg && test "$pic_object" != none; then 656832b578d3Smrg rmfiles="$rmfiles $dir/$pic_object" 656932b578d3Smrg fi 657032b578d3Smrg 657132b578d3Smrg # Add non-PIC object to the list of files to remove. 657232b578d3Smrg if test -n "$non_pic_object" \ 657332b578d3Smrg && test "$non_pic_object" != none; then 657432b578d3Smrg rmfiles="$rmfiles $dir/$non_pic_object" 657532b578d3Smrg fi 657632b578d3Smrg fi 657732b578d3Smrg ;; 657832b578d3Smrg 657932b578d3Smrg *) 658032b578d3Smrg if test "$mode" = clean ; then 658132b578d3Smrg noexename=$name 658232b578d3Smrg case $file in 658332b578d3Smrg *.exe) 658432b578d3Smrg file=`$echo $file|${SED} 's,.exe$,,'` 658532b578d3Smrg noexename=`$echo $name|${SED} 's,.exe$,,'` 658632b578d3Smrg # $file with .exe has already been added to rmfiles, 658732b578d3Smrg # add $file without .exe 658832b578d3Smrg rmfiles="$rmfiles $file" 658932b578d3Smrg ;; 659032b578d3Smrg esac 659132b578d3Smrg # Do a test to see if this is a libtool program. 659232b578d3Smrg if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 659332b578d3Smrg relink_command= 659432b578d3Smrg . $dir/$noexename 659532b578d3Smrg 659632b578d3Smrg # note $name still contains .exe if it was in $file originally 659732b578d3Smrg # as does the version of $file that was added into $rmfiles 659832b578d3Smrg rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" 659932b578d3Smrg if test "$fast_install" = yes && test -n "$relink_command"; then 660032b578d3Smrg rmfiles="$rmfiles $objdir/lt-$name" 660132b578d3Smrg fi 660232b578d3Smrg if test "X$noexename" != "X$name" ; then 660332b578d3Smrg rmfiles="$rmfiles $objdir/lt-${noexename}.c" 660432b578d3Smrg fi 660532b578d3Smrg fi 660632b578d3Smrg fi 660732b578d3Smrg ;; 660832b578d3Smrg esac 660932b578d3Smrg $show "$rm $rmfiles" 661032b578d3Smrg $run $rm $rmfiles || exit_status=1 661132b578d3Smrg done 661232b578d3Smrg objdir="$origobjdir" 661332b578d3Smrg 661432b578d3Smrg # Try to remove the ${objdir}s in the directories where we deleted files 661532b578d3Smrg for dir in $rmdirs; do 661632b578d3Smrg if test -d "$dir"; then 661732b578d3Smrg $show "rmdir $dir" 661832b578d3Smrg $run rmdir $dir >/dev/null 2>&1 661932b578d3Smrg fi 662032b578d3Smrg done 662132b578d3Smrg 662232b578d3Smrg exit $exit_status 662332b578d3Smrg ;; 662432b578d3Smrg 662532b578d3Smrg "") 662632b578d3Smrg $echo "$modename: you must specify a MODE" 1>&2 662732b578d3Smrg $echo "$generic_help" 1>&2 662832b578d3Smrg exit $EXIT_FAILURE 662932b578d3Smrg ;; 663032b578d3Smrg esac 663132b578d3Smrg 663232b578d3Smrg if test -z "$exec_cmd"; then 663332b578d3Smrg $echo "$modename: invalid operation mode \`$mode'" 1>&2 663432b578d3Smrg $echo "$generic_help" 1>&2 663532b578d3Smrg exit $EXIT_FAILURE 663632b578d3Smrg fi 663732b578d3Smrgfi # test -z "$show_help" 663832b578d3Smrg 663932b578d3Smrgif test -n "$exec_cmd"; then 664032b578d3Smrg eval exec $exec_cmd 664132b578d3Smrg exit $EXIT_FAILURE 664232b578d3Smrgfi 664332b578d3Smrg 664432b578d3Smrg# We need to display help for each of the modes. 664532b578d3Smrgcase $mode in 664632b578d3Smrg"") $echo \ 664732b578d3Smrg"Usage: $modename [OPTION]... [MODE-ARG]... 664832b578d3Smrg 664932b578d3SmrgProvide generalized library-building support services. 665032b578d3Smrg 665132b578d3Smrg --config show all configuration variables 665232b578d3Smrg --debug enable verbose shell tracing 665332b578d3Smrg-n, --dry-run display commands without modifying any files 665432b578d3Smrg --features display basic configuration information and exit 665532b578d3Smrg --finish same as \`--mode=finish' 665632b578d3Smrg --help display this help message and exit 665732b578d3Smrg --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] 665832b578d3Smrg --quiet same as \`--silent' 665932b578d3Smrg --silent don't print informational messages 666032b578d3Smrg --tag=TAG use configuration variables from tag TAG 666132b578d3Smrg --version print version information 666232b578d3Smrg 666332b578d3SmrgMODE must be one of the following: 666432b578d3Smrg 666532b578d3Smrg clean remove files from the build directory 666632b578d3Smrg compile compile a source file into a libtool object 666732b578d3Smrg execute automatically set library path, then run a program 666832b578d3Smrg finish complete the installation of libtool libraries 666932b578d3Smrg install install libraries or executables 667032b578d3Smrg link create a library or an executable 667132b578d3Smrg uninstall remove libraries from an installed directory 667232b578d3Smrg 667332b578d3SmrgMODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for 667432b578d3Smrga more detailed description of MODE. 667532b578d3Smrg 667632b578d3SmrgReport bugs to <bug-libtool@gnu.org>." 667732b578d3Smrg exit $EXIT_SUCCESS 667832b578d3Smrg ;; 667932b578d3Smrg 668032b578d3Smrgclean) 668132b578d3Smrg $echo \ 668232b578d3Smrg"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... 668332b578d3Smrg 668432b578d3SmrgRemove files from the build directory. 668532b578d3Smrg 668632b578d3SmrgRM is the name of the program to use to delete files associated with each FILE 668732b578d3Smrg(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed 668832b578d3Smrgto RM. 668932b578d3Smrg 669032b578d3SmrgIf FILE is a libtool library, object or program, all the files associated 669132b578d3Smrgwith it are deleted. Otherwise, only FILE itself is deleted using RM." 669232b578d3Smrg ;; 669332b578d3Smrg 669432b578d3Smrgcompile) 669532b578d3Smrg $echo \ 669632b578d3Smrg"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE 669732b578d3Smrg 669832b578d3SmrgCompile a source file into a libtool library object. 669932b578d3Smrg 670032b578d3SmrgThis mode accepts the following additional options: 670132b578d3Smrg 670232b578d3Smrg -o OUTPUT-FILE set the output file name to OUTPUT-FILE 670332b578d3Smrg -prefer-pic try to building PIC objects only 670432b578d3Smrg -prefer-non-pic try to building non-PIC objects only 670532b578d3Smrg -static always build a \`.o' file suitable for static linking 670632b578d3Smrg 670732b578d3SmrgCOMPILE-COMMAND is a command to be used in creating a \`standard' object file 670832b578d3Smrgfrom the given SOURCEFILE. 670932b578d3Smrg 671032b578d3SmrgThe output file name is determined by removing the directory component from 671132b578d3SmrgSOURCEFILE, then substituting the C source code suffix \`.c' with the 671232b578d3Smrglibrary object suffix, \`.lo'." 671332b578d3Smrg ;; 671432b578d3Smrg 671532b578d3Smrgexecute) 671632b578d3Smrg $echo \ 671732b578d3Smrg"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... 671832b578d3Smrg 671932b578d3SmrgAutomatically set library path, then run a program. 672032b578d3Smrg 672132b578d3SmrgThis mode accepts the following additional options: 672232b578d3Smrg 672332b578d3Smrg -dlopen FILE add the directory containing FILE to the library path 672432b578d3Smrg 672532b578d3SmrgThis mode sets the library path environment variable according to \`-dlopen' 672632b578d3Smrgflags. 672732b578d3Smrg 672832b578d3SmrgIf any of the ARGS are libtool executable wrappers, then they are translated 672932b578d3Smrginto their corresponding uninstalled binary, and any of their required library 673032b578d3Smrgdirectories are added to the library path. 673132b578d3Smrg 673232b578d3SmrgThen, COMMAND is executed, with ARGS as arguments." 673332b578d3Smrg ;; 673432b578d3Smrg 673532b578d3Smrgfinish) 673632b578d3Smrg $echo \ 673732b578d3Smrg"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... 673832b578d3Smrg 673932b578d3SmrgComplete the installation of libtool libraries. 674032b578d3Smrg 674132b578d3SmrgEach LIBDIR is a directory that contains libtool libraries. 674232b578d3Smrg 674332b578d3SmrgThe commands that this mode executes may require superuser privileges. Use 674432b578d3Smrgthe \`--dry-run' option if you just want to see what would be executed." 674532b578d3Smrg ;; 674632b578d3Smrg 674732b578d3Smrginstall) 674832b578d3Smrg $echo \ 674932b578d3Smrg"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... 675032b578d3Smrg 675132b578d3SmrgInstall executables or libraries. 675232b578d3Smrg 675332b578d3SmrgINSTALL-COMMAND is the installation command. The first component should be 675432b578d3Smrgeither the \`install' or \`cp' program. 675532b578d3Smrg 675632b578d3SmrgThe rest of the components are interpreted as arguments to that command (only 675732b578d3SmrgBSD-compatible install options are recognized)." 675832b578d3Smrg ;; 675932b578d3Smrg 676032b578d3Smrglink) 676132b578d3Smrg $echo \ 676232b578d3Smrg"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... 676332b578d3Smrg 676432b578d3SmrgLink object files or libraries together to form another library, or to 676532b578d3Smrgcreate an executable program. 676632b578d3Smrg 676732b578d3SmrgLINK-COMMAND is a command using the C compiler that you would use to create 676832b578d3Smrga program from several object files. 676932b578d3Smrg 677032b578d3SmrgThe following components of LINK-COMMAND are treated specially: 677132b578d3Smrg 677232b578d3Smrg -all-static do not do any dynamic linking at all 677332b578d3Smrg -avoid-version do not add a version suffix if possible 677432b578d3Smrg -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime 677532b578d3Smrg -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols 677632b578d3Smrg -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) 677732b578d3Smrg -export-symbols SYMFILE 6778d31dbc53Smrg try to export only the symbols listed in SYMFILE 677932b578d3Smrg -export-symbols-regex REGEX 6780d31dbc53Smrg try to export only the symbols matching REGEX 678132b578d3Smrg -LLIBDIR search LIBDIR for required installed libraries 678232b578d3Smrg -lNAME OUTPUT-FILE requires the installed library libNAME 678332b578d3Smrg -module build a library that can dlopened 678432b578d3Smrg -no-fast-install disable the fast-install mode 678532b578d3Smrg -no-install link a not-installable executable 678632b578d3Smrg -no-undefined declare that a library does not refer to external symbols 678732b578d3Smrg -o OUTPUT-FILE create OUTPUT-FILE from the specified objects 678832b578d3Smrg -objectlist FILE Use a list of object files found in FILE to specify objects 678932b578d3Smrg -precious-files-regex REGEX 679032b578d3Smrg don't remove output files matching REGEX 679132b578d3Smrg -release RELEASE specify package release information 679232b578d3Smrg -rpath LIBDIR the created library will eventually be installed in LIBDIR 679332b578d3Smrg -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries 6794d31dbc53Smrg -static do not do any dynamic linking of libtool libraries 679532b578d3Smrg -version-info CURRENT[:REVISION[:AGE]] 6796d31dbc53Smrg specify library version info [each variable defaults to 0] 679732b578d3Smrg 679832b578d3SmrgAll other options (arguments beginning with \`-') are ignored. 679932b578d3Smrg 680032b578d3SmrgEvery other argument is treated as a filename. Files ending in \`.la' are 680132b578d3Smrgtreated as uninstalled libtool libraries, other files are standard or library 680232b578d3Smrgobject files. 680332b578d3Smrg 680432b578d3SmrgIf the OUTPUT-FILE ends in \`.la', then a libtool library is created, 680532b578d3Smrgonly library objects (\`.lo' files) may be specified, and \`-rpath' is 680632b578d3Smrgrequired, except when creating a convenience library. 680732b578d3Smrg 680832b578d3SmrgIf OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created 680932b578d3Smrgusing \`ar' and \`ranlib', or on Windows using \`lib'. 681032b578d3Smrg 681132b578d3SmrgIf OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file 681232b578d3Smrgis created, otherwise an executable program is created." 681332b578d3Smrg ;; 681432b578d3Smrg 681532b578d3Smrguninstall) 681632b578d3Smrg $echo \ 681732b578d3Smrg"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... 681832b578d3Smrg 681932b578d3SmrgRemove libraries from an installation directory. 682032b578d3Smrg 682132b578d3SmrgRM is the name of the program to use to delete files associated with each FILE 682232b578d3Smrg(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed 682332b578d3Smrgto RM. 682432b578d3Smrg 682532b578d3SmrgIf FILE is a libtool library, all the files associated with it are deleted. 682632b578d3SmrgOtherwise, only FILE itself is deleted using RM." 682732b578d3Smrg ;; 682832b578d3Smrg 682932b578d3Smrg*) 683032b578d3Smrg $echo "$modename: invalid operation mode \`$mode'" 1>&2 683132b578d3Smrg $echo "$help" 1>&2 683232b578d3Smrg exit $EXIT_FAILURE 683332b578d3Smrg ;; 683432b578d3Smrgesac 683532b578d3Smrg 683632b578d3Smrg$echo 683732b578d3Smrg$echo "Try \`$modename --help' for more information about other modes." 683832b578d3Smrg 683932b578d3Smrgexit $? 684032b578d3Smrg 684132b578d3Smrg# The TAGs below are defined such that we never get into a situation 684232b578d3Smrg# in which we disable both kinds of libraries. Given conflicting 684332b578d3Smrg# choices, we go for a static library, that is the most portable, 684432b578d3Smrg# since we can't tell whether shared libraries were disabled because 684532b578d3Smrg# the user asked for that or because the platform doesn't support 684632b578d3Smrg# them. This is particularly important on AIX, because we don't 684732b578d3Smrg# support having both static and shared libraries enabled at the same 684832b578d3Smrg# time on that platform, so we default to a shared-only configuration. 684932b578d3Smrg# If a disable-shared tag is given, we'll fallback to a static-only 685032b578d3Smrg# configuration. But we'll never go from static-only to shared-only. 685132b578d3Smrg 685232b578d3Smrg# ### BEGIN LIBTOOL TAG CONFIG: disable-shared 685332b578d3Smrgdisable_libs=shared 685432b578d3Smrg# ### END LIBTOOL TAG CONFIG: disable-shared 685532b578d3Smrg 685632b578d3Smrg# ### BEGIN LIBTOOL TAG CONFIG: disable-static 685732b578d3Smrgdisable_libs=static 685832b578d3Smrg# ### END LIBTOOL TAG CONFIG: disable-static 685932b578d3Smrg 686032b578d3Smrg# Local Variables: 686132b578d3Smrg# mode:shell-script 686232b578d3Smrg# sh-indentation:2 686332b578d3Smrg# End: 6864