ltmain.sh revision f67b85aa
1943345d3Smrg# ltmain.sh - Provide generalized library-building support services. 2943345d3Smrg# NOTE: Changing this file will not affect anything until you rerun configure. 3943345d3Smrg# 4943345d3Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 5943345d3Smrg# Free Software Foundation, Inc. 6943345d3Smrg# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 7943345d3Smrg# 8943345d3Smrg# This program is free software; you can redistribute it and/or modify 9943345d3Smrg# it under the terms of the GNU General Public License as published by 10943345d3Smrg# the Free Software Foundation; either version 2 of the License, or 11943345d3Smrg# (at your option) any later version. 12943345d3Smrg# 13943345d3Smrg# This program is distributed in the hope that it will be useful, but 14943345d3Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of 15943345d3Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16943345d3Smrg# General Public License for more details. 17943345d3Smrg# 18943345d3Smrg# You should have received a copy of the GNU General Public License 19943345d3Smrg# along with this program; if not, write to the Free Software 20943345d3Smrg# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 21943345d3Smrg# 22943345d3Smrg# As a special exception to the GNU General Public License, if you 23943345d3Smrg# distribute this file as part of a program that contains a 24943345d3Smrg# configuration script generated by Autoconf, you may include it under 25943345d3Smrg# the same distribution terms that you use for the rest of that program. 26943345d3Smrg 27943345d3Smrgbasename="s,^.*/,,g" 28943345d3Smrg 29943345d3Smrg# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh 30943345d3Smrg# is ksh but when the shell is invoked as "sh" and the current value of 31943345d3Smrg# the _XPG environment variable is not equal to 1 (one), the special 32943345d3Smrg# positional parameter $0, within a function call, is the name of the 33943345d3Smrg# function. 34943345d3Smrgprogpath="$0" 35943345d3Smrg 36943345d3Smrg# The name of this program: 37943345d3Smrgprogname=`echo "$progpath" | $SED $basename` 38943345d3Smrgmodename="$progname" 39943345d3Smrg 40943345d3Smrg# Global variables: 41943345d3SmrgEXIT_SUCCESS=0 42943345d3SmrgEXIT_FAILURE=1 43943345d3Smrg 44943345d3SmrgPROGRAM=ltmain.sh 45943345d3SmrgPACKAGE=libtool 46943345d3SmrgVERSION=1.5.22 47943345d3SmrgTIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" 48943345d3Smrg 49f67b85aaSmrg# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). 50f67b85aaSmrgif test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then 51f67b85aaSmrg emulate sh 52f67b85aaSmrg NULLCMD=: 53f67b85aaSmrg # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which 54f67b85aaSmrg # is contrary to our usage. Disable this feature. 55f67b85aaSmrg alias -g '${1+"$@"}'='"$@"' 56943345d3Smrg setopt NO_GLOB_SUBST 57f67b85aaSmrgelse 58f67b85aaSmrg case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac 59943345d3Smrgfi 60943345d3Smrg 61943345d3Smrg# Check that we have a working $echo. 62943345d3Smrgif test "X$1" = X--no-reexec; then 63943345d3Smrg # Discard the --no-reexec flag, and continue. 64943345d3Smrg shift 65943345d3Smrgelif test "X$1" = X--fallback-echo; then 66943345d3Smrg # Avoid inline document here, it may be left over 67943345d3Smrg : 68943345d3Smrgelif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then 69943345d3Smrg # Yippee, $echo works! 70943345d3Smrg : 71943345d3Smrgelse 72943345d3Smrg # Restart under the correct shell, and then maybe $echo will work. 73943345d3Smrg exec $SHELL "$progpath" --no-reexec ${1+"$@"} 74943345d3Smrgfi 75943345d3Smrg 76943345d3Smrgif test "X$1" = X--fallback-echo; then 77943345d3Smrg # used as fallback echo 78943345d3Smrg shift 79943345d3Smrg cat <<EOF 80943345d3Smrg$* 81943345d3SmrgEOF 82943345d3Smrg exit $EXIT_SUCCESS 83943345d3Smrgfi 84943345d3Smrg 85943345d3Smrgdefault_mode= 86943345d3Smrghelp="Try \`$progname --help' for more information." 87943345d3Smrgmagic="%%%MAGIC variable%%%" 88943345d3Smrgmkdir="mkdir" 89943345d3Smrgmv="mv -f" 90943345d3Smrgrm="rm -f" 91943345d3Smrg 92943345d3Smrg# Sed substitution that helps us do robust quoting. It backslashifies 93943345d3Smrg# metacharacters that are still active within double-quoted strings. 94943345d3SmrgXsed="${SED}"' -e 1s/^X//' 95943345d3Smrgsed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' 96943345d3Smrg# test EBCDIC or ASCII 97943345d3Smrgcase `echo X|tr X '\101'` in 98943345d3Smrg A) # ASCII based system 99943345d3Smrg # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr 100943345d3Smrg SP2NL='tr \040 \012' 101943345d3Smrg NL2SP='tr \015\012 \040\040' 102943345d3Smrg ;; 103943345d3Smrg *) # EBCDIC based system 104943345d3Smrg SP2NL='tr \100 \n' 105943345d3Smrg NL2SP='tr \r\n \100\100' 106943345d3Smrg ;; 107943345d3Smrgesac 108943345d3Smrg 109943345d3Smrg# NLS nuisances. 110943345d3Smrg# Only set LANG and LC_ALL to C if already set. 111943345d3Smrg# These must not be set unconditionally because not all systems understand 112943345d3Smrg# e.g. LANG=C (notably SCO). 113943345d3Smrg# We save the old values to restore during execute mode. 114f67b85aaSmrgfor lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES 115f67b85aaSmrgdo 116f67b85aaSmrg eval "if test \"\${$lt_var+set}\" = set; then 117f67b85aaSmrg save_$lt_var=\$$lt_var 118f67b85aaSmrg $lt_var=C 119f67b85aaSmrg export $lt_var 120f67b85aaSmrg fi" 121f67b85aaSmrgdone 122943345d3Smrg 123943345d3Smrg# Make sure IFS has a sensible default 124943345d3Smrglt_nl=' 125943345d3Smrg' 126943345d3SmrgIFS=" $lt_nl" 127943345d3Smrg 128943345d3Smrgif test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then 129943345d3Smrg $echo "$modename: not configured to build any kind of library" 1>&2 130943345d3Smrg $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 131943345d3Smrg exit $EXIT_FAILURE 132943345d3Smrgfi 133943345d3Smrg 134943345d3Smrg# Global variables. 135943345d3Smrgmode=$default_mode 136943345d3Smrgnonopt= 137943345d3Smrgprev= 138943345d3Smrgprevopt= 139943345d3Smrgrun= 140943345d3Smrgshow="$echo" 141943345d3Smrgshow_help= 142943345d3Smrgexecute_dlfiles= 143943345d3Smrgduplicate_deps=no 144943345d3Smrgpreserve_args= 145943345d3Smrglo2o="s/\\.lo\$/.${objext}/" 146943345d3Smrgo2lo="s/\\.${objext}\$/.lo/" 147f67b85aaSmrgextracted_archives= 148f67b85aaSmrgextracted_serial=0 149943345d3Smrg 150943345d3Smrg##################################### 151943345d3Smrg# Shell function definitions: 152943345d3Smrg# This seems to be the best place for them 153943345d3Smrg 154943345d3Smrg# func_mktempdir [string] 155943345d3Smrg# Make a temporary directory that won't clash with other running 156943345d3Smrg# libtool processes, and avoids race conditions if possible. If 157943345d3Smrg# given, STRING is the basename for that directory. 158943345d3Smrgfunc_mktempdir () 159943345d3Smrg{ 160943345d3Smrg my_template="${TMPDIR-/tmp}/${1-$progname}" 161943345d3Smrg 162943345d3Smrg if test "$run" = ":"; then 163943345d3Smrg # Return a directory name, but don't create it in dry-run mode 164943345d3Smrg my_tmpdir="${my_template}-$$" 165943345d3Smrg else 166943345d3Smrg 167943345d3Smrg # If mktemp works, use that first and foremost 168943345d3Smrg my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` 169943345d3Smrg 170943345d3Smrg if test ! -d "$my_tmpdir"; then 171943345d3Smrg # Failing that, at least try and use $RANDOM to avoid a race 172943345d3Smrg my_tmpdir="${my_template}-${RANDOM-0}$$" 173943345d3Smrg 174943345d3Smrg save_mktempdir_umask=`umask` 175943345d3Smrg umask 0077 176943345d3Smrg $mkdir "$my_tmpdir" 177943345d3Smrg umask $save_mktempdir_umask 178943345d3Smrg fi 179943345d3Smrg 180943345d3Smrg # If we're not in dry-run mode, bomb out on failure 181943345d3Smrg test -d "$my_tmpdir" || { 182943345d3Smrg $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 183943345d3Smrg exit $EXIT_FAILURE 184943345d3Smrg } 185943345d3Smrg fi 186943345d3Smrg 187943345d3Smrg $echo "X$my_tmpdir" | $Xsed 188943345d3Smrg} 189943345d3Smrg 190943345d3Smrg 191943345d3Smrg# func_win32_libid arg 192943345d3Smrg# return the library type of file 'arg' 193943345d3Smrg# 194943345d3Smrg# Need a lot of goo to handle *both* DLLs and import libs 195943345d3Smrg# Has to be a shell function in order to 'eat' the argument 196943345d3Smrg# that is supplied when $file_magic_command is called. 197943345d3Smrgfunc_win32_libid () 198943345d3Smrg{ 199943345d3Smrg win32_libid_type="unknown" 200943345d3Smrg win32_fileres=`file -L $1 2>/dev/null` 201943345d3Smrg case $win32_fileres in 202943345d3Smrg *ar\ archive\ import\ library*) # definitely import 203943345d3Smrg win32_libid_type="x86 archive import" 204943345d3Smrg ;; 205943345d3Smrg *ar\ archive*) # could be an import, or static 206943345d3Smrg if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ 207943345d3Smrg $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then 208943345d3Smrg win32_nmres=`eval $NM -f posix -A $1 | \ 209943345d3Smrg $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'` 210943345d3Smrg case $win32_nmres in 211943345d3Smrg import*) win32_libid_type="x86 archive import";; 212943345d3Smrg *) win32_libid_type="x86 archive static";; 213943345d3Smrg esac 214943345d3Smrg fi 215943345d3Smrg ;; 216943345d3Smrg *DLL*) 217943345d3Smrg win32_libid_type="x86 DLL" 218943345d3Smrg ;; 219943345d3Smrg *executable*) # but shell scripts are "executable" too... 220943345d3Smrg case $win32_fileres in 221943345d3Smrg *MS\ Windows\ PE\ Intel*) 222943345d3Smrg win32_libid_type="x86 DLL" 223943345d3Smrg ;; 224943345d3Smrg esac 225943345d3Smrg ;; 226943345d3Smrg esac 227943345d3Smrg $echo $win32_libid_type 228943345d3Smrg} 229943345d3Smrg 230943345d3Smrg 231943345d3Smrg# func_infer_tag arg 232943345d3Smrg# Infer tagged configuration to use if any are available and 233943345d3Smrg# if one wasn't chosen via the "--tag" command line option. 234943345d3Smrg# Only attempt this if the compiler in the base compile 235943345d3Smrg# command doesn't match the default compiler. 236943345d3Smrg# arg is usually of the form 'gcc ...' 237943345d3Smrgfunc_infer_tag () 238943345d3Smrg{ 239943345d3Smrg if test -n "$available_tags" && test -z "$tagname"; then 240943345d3Smrg CC_quoted= 241943345d3Smrg for arg in $CC; do 242943345d3Smrg case $arg in 243943345d3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 244943345d3Smrg arg="\"$arg\"" 245943345d3Smrg ;; 246943345d3Smrg esac 247943345d3Smrg CC_quoted="$CC_quoted $arg" 248943345d3Smrg done 249943345d3Smrg case $@ in 250943345d3Smrg # Blanks in the command may have been stripped by the calling shell, 251943345d3Smrg # but not from the CC environment variable when configure was run. 252943345d3Smrg " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; 253943345d3Smrg # Blanks at the start of $base_compile will cause this to fail 254943345d3Smrg # if we don't check for them as well. 255943345d3Smrg *) 256943345d3Smrg for z in $available_tags; do 257943345d3Smrg if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then 258943345d3Smrg # Evaluate the configuration. 259943345d3Smrg eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" 260943345d3Smrg CC_quoted= 261943345d3Smrg for arg in $CC; do 262943345d3Smrg # Double-quote args containing other shell metacharacters. 263943345d3Smrg case $arg in 264943345d3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 265943345d3Smrg arg="\"$arg\"" 266943345d3Smrg ;; 267943345d3Smrg esac 268943345d3Smrg CC_quoted="$CC_quoted $arg" 269943345d3Smrg done 270943345d3Smrg case "$@ " in 271943345d3Smrg " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) 272943345d3Smrg # The compiler in the base compile command matches 273943345d3Smrg # the one in the tagged configuration. 274943345d3Smrg # Assume this is the tagged configuration we want. 275943345d3Smrg tagname=$z 276943345d3Smrg break 277943345d3Smrg ;; 278943345d3Smrg esac 279943345d3Smrg fi 280943345d3Smrg done 281943345d3Smrg # If $tagname still isn't set, then no tagged configuration 282943345d3Smrg # was found and let the user know that the "--tag" command 283943345d3Smrg # line option must be used. 284943345d3Smrg if test -z "$tagname"; then 285943345d3Smrg $echo "$modename: unable to infer tagged configuration" 286943345d3Smrg $echo "$modename: specify a tag with \`--tag'" 1>&2 287943345d3Smrg exit $EXIT_FAILURE 288943345d3Smrg# else 289943345d3Smrg# $echo "$modename: using $tagname tagged configuration" 290943345d3Smrg fi 291943345d3Smrg ;; 292943345d3Smrg esac 293943345d3Smrg fi 294943345d3Smrg} 295943345d3Smrg 296943345d3Smrg 297943345d3Smrg# func_extract_an_archive dir oldlib 298943345d3Smrgfunc_extract_an_archive () 299943345d3Smrg{ 300943345d3Smrg f_ex_an_ar_dir="$1"; shift 301943345d3Smrg f_ex_an_ar_oldlib="$1" 302943345d3Smrg 303943345d3Smrg $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" 304943345d3Smrg $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? 305943345d3Smrg if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then 306943345d3Smrg : 307943345d3Smrg else 308943345d3Smrg $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 309943345d3Smrg exit $EXIT_FAILURE 310943345d3Smrg fi 311943345d3Smrg} 312943345d3Smrg 313943345d3Smrg# func_extract_archives gentop oldlib ... 314943345d3Smrgfunc_extract_archives () 315943345d3Smrg{ 316943345d3Smrg my_gentop="$1"; shift 317943345d3Smrg my_oldlibs=${1+"$@"} 318943345d3Smrg my_oldobjs="" 319943345d3Smrg my_xlib="" 320943345d3Smrg my_xabs="" 321943345d3Smrg my_xdir="" 322943345d3Smrg my_status="" 323943345d3Smrg 324943345d3Smrg $show "${rm}r $my_gentop" 325943345d3Smrg $run ${rm}r "$my_gentop" 326943345d3Smrg $show "$mkdir $my_gentop" 327943345d3Smrg $run $mkdir "$my_gentop" 328943345d3Smrg my_status=$? 329943345d3Smrg if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then 330943345d3Smrg exit $my_status 331943345d3Smrg fi 332943345d3Smrg 333943345d3Smrg for my_xlib in $my_oldlibs; do 334943345d3Smrg # Extract the objects. 335943345d3Smrg case $my_xlib in 336943345d3Smrg [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; 337943345d3Smrg *) my_xabs=`pwd`"/$my_xlib" ;; 338943345d3Smrg esac 339943345d3Smrg my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` 340f67b85aaSmrg my_xlib_u=$my_xlib 341f67b85aaSmrg while :; do 342f67b85aaSmrg case " $extracted_archives " in 343f67b85aaSmrg *" $my_xlib_u "*) 344f67b85aaSmrg extracted_serial=`expr $extracted_serial + 1` 345f67b85aaSmrg my_xlib_u=lt$extracted_serial-$my_xlib ;; 346f67b85aaSmrg *) break ;; 347f67b85aaSmrg esac 348f67b85aaSmrg done 349f67b85aaSmrg extracted_archives="$extracted_archives $my_xlib_u" 350f67b85aaSmrg my_xdir="$my_gentop/$my_xlib_u" 351943345d3Smrg 352943345d3Smrg $show "${rm}r $my_xdir" 353943345d3Smrg $run ${rm}r "$my_xdir" 354943345d3Smrg $show "$mkdir $my_xdir" 355943345d3Smrg $run $mkdir "$my_xdir" 356943345d3Smrg exit_status=$? 357943345d3Smrg if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then 358943345d3Smrg exit $exit_status 359943345d3Smrg fi 360943345d3Smrg case $host in 361943345d3Smrg *-darwin*) 362943345d3Smrg $show "Extracting $my_xabs" 363943345d3Smrg # Do not bother doing anything if just a dry run 364943345d3Smrg if test -z "$run"; then 365943345d3Smrg darwin_orig_dir=`pwd` 366943345d3Smrg cd $my_xdir || exit $? 367943345d3Smrg darwin_archive=$my_xabs 368943345d3Smrg darwin_curdir=`pwd` 369943345d3Smrg darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` 370943345d3Smrg darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` 371943345d3Smrg if test -n "$darwin_arches"; then 372943345d3Smrg darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` 373943345d3Smrg darwin_arch= 374943345d3Smrg $show "$darwin_base_archive has multiple architectures $darwin_arches" 375943345d3Smrg for darwin_arch in $darwin_arches ; do 376943345d3Smrg mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" 377943345d3Smrg lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" 378943345d3Smrg cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" 379943345d3Smrg func_extract_an_archive "`pwd`" "${darwin_base_archive}" 380943345d3Smrg cd "$darwin_curdir" 381943345d3Smrg $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" 382943345d3Smrg done # $darwin_arches 383943345d3Smrg ## Okay now we have a bunch of thin objects, gotta fatten them up :) 384943345d3Smrg darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` 385943345d3Smrg darwin_file= 386943345d3Smrg darwin_files= 387943345d3Smrg for darwin_file in $darwin_filelist; do 388943345d3Smrg darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` 389943345d3Smrg lipo -create -output "$darwin_file" $darwin_files 390943345d3Smrg done # $darwin_filelist 391943345d3Smrg ${rm}r unfat-$$ 392943345d3Smrg cd "$darwin_orig_dir" 393943345d3Smrg else 394943345d3Smrg cd "$darwin_orig_dir" 395943345d3Smrg func_extract_an_archive "$my_xdir" "$my_xabs" 396943345d3Smrg fi # $darwin_arches 397943345d3Smrg fi # $run 398943345d3Smrg ;; 399943345d3Smrg *) 400943345d3Smrg func_extract_an_archive "$my_xdir" "$my_xabs" 401943345d3Smrg ;; 402943345d3Smrg esac 403943345d3Smrg my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` 404943345d3Smrg done 405943345d3Smrg func_extract_archives_result="$my_oldobjs" 406943345d3Smrg} 407943345d3Smrg# End of Shell function definitions 408943345d3Smrg##################################### 409943345d3Smrg 410943345d3Smrg# Darwin sucks 411943345d3Smrgeval std_shrext=\"$shrext_cmds\" 412943345d3Smrg 413943345d3Smrgdisable_libs=no 414943345d3Smrg 415943345d3Smrg# Parse our command line options once, thoroughly. 416943345d3Smrgwhile test "$#" -gt 0 417943345d3Smrgdo 418943345d3Smrg arg="$1" 419943345d3Smrg shift 420943345d3Smrg 421943345d3Smrg case $arg in 422943345d3Smrg -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; 423943345d3Smrg *) optarg= ;; 424943345d3Smrg esac 425943345d3Smrg 426943345d3Smrg # If the previous option needs an argument, assign it. 427943345d3Smrg if test -n "$prev"; then 428943345d3Smrg case $prev in 429943345d3Smrg execute_dlfiles) 430943345d3Smrg execute_dlfiles="$execute_dlfiles $arg" 431943345d3Smrg ;; 432943345d3Smrg tag) 433943345d3Smrg tagname="$arg" 434943345d3Smrg preserve_args="${preserve_args}=$arg" 435943345d3Smrg 436943345d3Smrg # Check whether tagname contains only valid characters 437943345d3Smrg case $tagname in 438943345d3Smrg *[!-_A-Za-z0-9,/]*) 439943345d3Smrg $echo "$progname: invalid tag name: $tagname" 1>&2 440943345d3Smrg exit $EXIT_FAILURE 441943345d3Smrg ;; 442943345d3Smrg esac 443943345d3Smrg 444943345d3Smrg case $tagname in 445943345d3Smrg CC) 446943345d3Smrg # Don't test for the "default" C tag, as we know, it's there, but 447943345d3Smrg # not specially marked. 448943345d3Smrg ;; 449943345d3Smrg *) 450943345d3Smrg if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then 451943345d3Smrg taglist="$taglist $tagname" 452943345d3Smrg # Evaluate the configuration. 453943345d3Smrg eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" 454943345d3Smrg else 455943345d3Smrg $echo "$progname: ignoring unknown tag $tagname" 1>&2 456943345d3Smrg fi 457943345d3Smrg ;; 458943345d3Smrg esac 459943345d3Smrg ;; 460943345d3Smrg *) 461943345d3Smrg eval "$prev=\$arg" 462943345d3Smrg ;; 463943345d3Smrg esac 464943345d3Smrg 465943345d3Smrg prev= 466943345d3Smrg prevopt= 467943345d3Smrg continue 468943345d3Smrg fi 469943345d3Smrg 470943345d3Smrg # Have we seen a non-optional argument yet? 471943345d3Smrg case $arg in 472943345d3Smrg --help) 473943345d3Smrg show_help=yes 474943345d3Smrg ;; 475943345d3Smrg 476943345d3Smrg --version) 477943345d3Smrg $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" 478943345d3Smrg $echo 479943345d3Smrg $echo "Copyright (C) 2005 Free Software Foundation, Inc." 480943345d3Smrg $echo "This is free software; see the source for copying conditions. There is NO" 481943345d3Smrg $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 482943345d3Smrg exit $? 483943345d3Smrg ;; 484943345d3Smrg 485943345d3Smrg --config) 486943345d3Smrg ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath 487943345d3Smrg # Now print the configurations for the tags. 488943345d3Smrg for tagname in $taglist; do 489943345d3Smrg ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" 490943345d3Smrg done 491943345d3Smrg exit $? 492943345d3Smrg ;; 493943345d3Smrg 494943345d3Smrg --debug) 495943345d3Smrg $echo "$progname: enabling shell trace mode" 496943345d3Smrg set -x 497943345d3Smrg preserve_args="$preserve_args $arg" 498943345d3Smrg ;; 499943345d3Smrg 500943345d3Smrg --dry-run | -n) 501943345d3Smrg run=: 502943345d3Smrg ;; 503943345d3Smrg 504943345d3Smrg --features) 505943345d3Smrg $echo "host: $host" 506943345d3Smrg if test "$build_libtool_libs" = yes; then 507943345d3Smrg $echo "enable shared libraries" 508943345d3Smrg else 509943345d3Smrg $echo "disable shared libraries" 510943345d3Smrg fi 511943345d3Smrg if test "$build_old_libs" = yes; then 512943345d3Smrg $echo "enable static libraries" 513943345d3Smrg else 514943345d3Smrg $echo "disable static libraries" 515943345d3Smrg fi 516943345d3Smrg exit $? 517943345d3Smrg ;; 518943345d3Smrg 519943345d3Smrg --finish) mode="finish" ;; 520943345d3Smrg 521943345d3Smrg --mode) prevopt="--mode" prev=mode ;; 522943345d3Smrg --mode=*) mode="$optarg" ;; 523943345d3Smrg 524943345d3Smrg --preserve-dup-deps) duplicate_deps="yes" ;; 525943345d3Smrg 526943345d3Smrg --quiet | --silent) 527943345d3Smrg show=: 528943345d3Smrg preserve_args="$preserve_args $arg" 529943345d3Smrg ;; 530943345d3Smrg 531943345d3Smrg --tag) 532943345d3Smrg prevopt="--tag" 533943345d3Smrg prev=tag 534943345d3Smrg preserve_args="$preserve_args --tag" 535943345d3Smrg ;; 536943345d3Smrg --tag=*) 537943345d3Smrg set tag "$optarg" ${1+"$@"} 538943345d3Smrg shift 539943345d3Smrg prev=tag 540943345d3Smrg preserve_args="$preserve_args --tag" 541943345d3Smrg ;; 542943345d3Smrg 543943345d3Smrg -dlopen) 544943345d3Smrg prevopt="-dlopen" 545943345d3Smrg prev=execute_dlfiles 546943345d3Smrg ;; 547943345d3Smrg 548943345d3Smrg -*) 549943345d3Smrg $echo "$modename: unrecognized option \`$arg'" 1>&2 550943345d3Smrg $echo "$help" 1>&2 551943345d3Smrg exit $EXIT_FAILURE 552943345d3Smrg ;; 553943345d3Smrg 554943345d3Smrg *) 555943345d3Smrg nonopt="$arg" 556943345d3Smrg break 557943345d3Smrg ;; 558943345d3Smrg esac 559943345d3Smrgdone 560943345d3Smrg 561943345d3Smrgif test -n "$prevopt"; then 562943345d3Smrg $echo "$modename: option \`$prevopt' requires an argument" 1>&2 563943345d3Smrg $echo "$help" 1>&2 564943345d3Smrg exit $EXIT_FAILURE 565943345d3Smrgfi 566943345d3Smrg 567943345d3Smrgcase $disable_libs in 568943345d3Smrgno) 569943345d3Smrg ;; 570943345d3Smrgshared) 571943345d3Smrg build_libtool_libs=no 572943345d3Smrg build_old_libs=yes 573943345d3Smrg ;; 574943345d3Smrgstatic) 575943345d3Smrg build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` 576943345d3Smrg ;; 577943345d3Smrgesac 578943345d3Smrg 579943345d3Smrg# If this variable is set in any of the actions, the command in it 580943345d3Smrg# will be execed at the end. This prevents here-documents from being 581943345d3Smrg# left over by shells. 582943345d3Smrgexec_cmd= 583943345d3Smrg 584943345d3Smrgif test -z "$show_help"; then 585943345d3Smrg 586943345d3Smrg # Infer the operation mode. 587943345d3Smrg if test -z "$mode"; then 588943345d3Smrg $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 589943345d3Smrg $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 590943345d3Smrg case $nonopt in 591943345d3Smrg *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) 592943345d3Smrg mode=link 593943345d3Smrg for arg 594943345d3Smrg do 595943345d3Smrg case $arg in 596943345d3Smrg -c) 597943345d3Smrg mode=compile 598943345d3Smrg break 599943345d3Smrg ;; 600943345d3Smrg esac 601943345d3Smrg done 602943345d3Smrg ;; 603943345d3Smrg *db | *dbx | *strace | *truss) 604943345d3Smrg mode=execute 605943345d3Smrg ;; 606943345d3Smrg *install*|cp|mv) 607943345d3Smrg mode=install 608943345d3Smrg ;; 609943345d3Smrg *rm) 610943345d3Smrg mode=uninstall 611943345d3Smrg ;; 612943345d3Smrg *) 613943345d3Smrg # If we have no mode, but dlfiles were specified, then do execute mode. 614943345d3Smrg test -n "$execute_dlfiles" && mode=execute 615943345d3Smrg 616943345d3Smrg # Just use the default operation mode. 617943345d3Smrg if test -z "$mode"; then 618943345d3Smrg if test -n "$nonopt"; then 619943345d3Smrg $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 620943345d3Smrg else 621943345d3Smrg $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 622943345d3Smrg fi 623943345d3Smrg fi 624943345d3Smrg ;; 625943345d3Smrg esac 626943345d3Smrg fi 627943345d3Smrg 628943345d3Smrg # Only execute mode is allowed to have -dlopen flags. 629943345d3Smrg if test -n "$execute_dlfiles" && test "$mode" != execute; then 630943345d3Smrg $echo "$modename: unrecognized option \`-dlopen'" 1>&2 631943345d3Smrg $echo "$help" 1>&2 632943345d3Smrg exit $EXIT_FAILURE 633943345d3Smrg fi 634943345d3Smrg 635943345d3Smrg # Change the help message to a mode-specific one. 636943345d3Smrg generic_help="$help" 637943345d3Smrg help="Try \`$modename --help --mode=$mode' for more information." 638943345d3Smrg 639943345d3Smrg # These modes are in order of execution frequency so that they run quickly. 640943345d3Smrg case $mode in 641943345d3Smrg # libtool compile mode 642943345d3Smrg compile) 643943345d3Smrg modename="$modename: compile" 644943345d3Smrg # Get the compilation command and the source file. 645943345d3Smrg base_compile= 646943345d3Smrg srcfile="$nonopt" # always keep a non-empty value in "srcfile" 647943345d3Smrg suppress_opt=yes 648943345d3Smrg suppress_output= 649943345d3Smrg arg_mode=normal 650943345d3Smrg libobj= 651943345d3Smrg later= 652943345d3Smrg 653943345d3Smrg for arg 654943345d3Smrg do 655943345d3Smrg case $arg_mode in 656943345d3Smrg arg ) 657943345d3Smrg # do not "continue". Instead, add this to base_compile 658943345d3Smrg lastarg="$arg" 659943345d3Smrg arg_mode=normal 660943345d3Smrg ;; 661943345d3Smrg 662943345d3Smrg target ) 663943345d3Smrg libobj="$arg" 664943345d3Smrg arg_mode=normal 665943345d3Smrg continue 666943345d3Smrg ;; 667943345d3Smrg 668943345d3Smrg normal ) 669943345d3Smrg # Accept any command-line options. 670943345d3Smrg case $arg in 671943345d3Smrg -o) 672943345d3Smrg if test -n "$libobj" ; then 673943345d3Smrg $echo "$modename: you cannot specify \`-o' more than once" 1>&2 674943345d3Smrg exit $EXIT_FAILURE 675943345d3Smrg fi 676943345d3Smrg arg_mode=target 677943345d3Smrg continue 678943345d3Smrg ;; 679943345d3Smrg 680943345d3Smrg -static | -prefer-pic | -prefer-non-pic) 681943345d3Smrg later="$later $arg" 682943345d3Smrg continue 683943345d3Smrg ;; 684943345d3Smrg 685943345d3Smrg -no-suppress) 686943345d3Smrg suppress_opt=no 687943345d3Smrg continue 688943345d3Smrg ;; 689943345d3Smrg 690943345d3Smrg -Xcompiler) 691943345d3Smrg arg_mode=arg # the next one goes into the "base_compile" arg list 692943345d3Smrg continue # The current "srcfile" will either be retained or 693943345d3Smrg ;; # replaced later. I would guess that would be a bug. 694943345d3Smrg 695943345d3Smrg -Wc,*) 696943345d3Smrg args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` 697943345d3Smrg lastarg= 698943345d3Smrg save_ifs="$IFS"; IFS=',' 699943345d3Smrg for arg in $args; do 700943345d3Smrg IFS="$save_ifs" 701943345d3Smrg 702943345d3Smrg # Double-quote args containing other shell metacharacters. 703943345d3Smrg # Many Bourne shells cannot handle close brackets correctly 704943345d3Smrg # in scan sets, so we specify it separately. 705943345d3Smrg case $arg in 706943345d3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 707943345d3Smrg arg="\"$arg\"" 708943345d3Smrg ;; 709943345d3Smrg esac 710943345d3Smrg lastarg="$lastarg $arg" 711943345d3Smrg done 712943345d3Smrg IFS="$save_ifs" 713943345d3Smrg lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` 714943345d3Smrg 715943345d3Smrg # Add the arguments to base_compile. 716943345d3Smrg base_compile="$base_compile $lastarg" 717943345d3Smrg continue 718943345d3Smrg ;; 719943345d3Smrg 720943345d3Smrg * ) 721943345d3Smrg # Accept the current argument as the source file. 722943345d3Smrg # The previous "srcfile" becomes the current argument. 723943345d3Smrg # 724943345d3Smrg lastarg="$srcfile" 725943345d3Smrg srcfile="$arg" 726943345d3Smrg ;; 727943345d3Smrg esac # case $arg 728943345d3Smrg ;; 729943345d3Smrg esac # case $arg_mode 730943345d3Smrg 731943345d3Smrg # Aesthetically quote the previous argument. 732943345d3Smrg lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` 733943345d3Smrg 734943345d3Smrg case $lastarg in 735943345d3Smrg # Double-quote args containing other shell metacharacters. 736943345d3Smrg # Many Bourne shells cannot handle close brackets correctly 737943345d3Smrg # in scan sets, and some SunOS ksh mistreat backslash-escaping 738943345d3Smrg # in scan sets (worked around with variable expansion), 739943345d3Smrg # and furthermore cannot handle '|' '&' '(' ')' in scan sets 740943345d3Smrg # at all, so we specify them separately. 741943345d3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 742943345d3Smrg lastarg="\"$lastarg\"" 743943345d3Smrg ;; 744943345d3Smrg esac 745943345d3Smrg 746943345d3Smrg base_compile="$base_compile $lastarg" 747943345d3Smrg done # for arg 748943345d3Smrg 749943345d3Smrg case $arg_mode in 750943345d3Smrg arg) 751943345d3Smrg $echo "$modename: you must specify an argument for -Xcompile" 752943345d3Smrg exit $EXIT_FAILURE 753943345d3Smrg ;; 754943345d3Smrg target) 755943345d3Smrg $echo "$modename: you must specify a target with \`-o'" 1>&2 756943345d3Smrg exit $EXIT_FAILURE 757943345d3Smrg ;; 758943345d3Smrg *) 759943345d3Smrg # Get the name of the library object. 760943345d3Smrg [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` 761943345d3Smrg ;; 762943345d3Smrg esac 763943345d3Smrg 764943345d3Smrg # Recognize several different file suffixes. 765943345d3Smrg # If the user specifies -o file.o, it is replaced with file.lo 766943345d3Smrg xform='[cCFSifmso]' 767943345d3Smrg case $libobj in 768943345d3Smrg *.ada) xform=ada ;; 769943345d3Smrg *.adb) xform=adb ;; 770943345d3Smrg *.ads) xform=ads ;; 771943345d3Smrg *.asm) xform=asm ;; 772943345d3Smrg *.c++) xform=c++ ;; 773943345d3Smrg *.cc) xform=cc ;; 774943345d3Smrg *.ii) xform=ii ;; 775943345d3Smrg *.class) xform=class ;; 776943345d3Smrg *.cpp) xform=cpp ;; 777943345d3Smrg *.cxx) xform=cxx ;; 778943345d3Smrg *.f90) xform=f90 ;; 779943345d3Smrg *.for) xform=for ;; 780943345d3Smrg *.java) xform=java ;; 781f67b85aaSmrg *.obj) xform=obj ;; 782943345d3Smrg esac 783943345d3Smrg 784943345d3Smrg libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` 785943345d3Smrg 786943345d3Smrg case $libobj in 787943345d3Smrg *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; 788943345d3Smrg *) 789943345d3Smrg $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 790943345d3Smrg exit $EXIT_FAILURE 791943345d3Smrg ;; 792943345d3Smrg esac 793943345d3Smrg 794943345d3Smrg func_infer_tag $base_compile 795943345d3Smrg 796943345d3Smrg for arg in $later; do 797943345d3Smrg case $arg in 798943345d3Smrg -static) 799943345d3Smrg build_old_libs=yes 800943345d3Smrg continue 801943345d3Smrg ;; 802943345d3Smrg 803943345d3Smrg -prefer-pic) 804943345d3Smrg pic_mode=yes 805943345d3Smrg continue 806943345d3Smrg ;; 807943345d3Smrg 808943345d3Smrg -prefer-non-pic) 809943345d3Smrg pic_mode=no 810943345d3Smrg continue 811943345d3Smrg ;; 812943345d3Smrg esac 813943345d3Smrg done 814943345d3Smrg 815943345d3Smrg qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` 816943345d3Smrg case $qlibobj in 817943345d3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 818943345d3Smrg qlibobj="\"$qlibobj\"" ;; 819943345d3Smrg esac 820943345d3Smrg test "X$libobj" != "X$qlibobj" \ 821943345d3Smrg && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ 822943345d3Smrg && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." 823943345d3Smrg objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` 824943345d3Smrg xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` 825943345d3Smrg if test "X$xdir" = "X$obj"; then 826943345d3Smrg xdir= 827943345d3Smrg else 828943345d3Smrg xdir=$xdir/ 829943345d3Smrg fi 830943345d3Smrg lobj=${xdir}$objdir/$objname 831943345d3Smrg 832943345d3Smrg if test -z "$base_compile"; then 833943345d3Smrg $echo "$modename: you must specify a compilation command" 1>&2 834943345d3Smrg $echo "$help" 1>&2 835943345d3Smrg exit $EXIT_FAILURE 836943345d3Smrg fi 837943345d3Smrg 838943345d3Smrg # Delete any leftover library objects. 839943345d3Smrg if test "$build_old_libs" = yes; then 840943345d3Smrg removelist="$obj $lobj $libobj ${libobj}T" 841943345d3Smrg else 842943345d3Smrg removelist="$lobj $libobj ${libobj}T" 843943345d3Smrg fi 844943345d3Smrg 845943345d3Smrg $run $rm $removelist 846943345d3Smrg trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 847943345d3Smrg 848943345d3Smrg # On Cygwin there's no "real" PIC flag so we must build both object types 849943345d3Smrg case $host_os in 850943345d3Smrg cygwin* | mingw* | pw32* | os2*) 851943345d3Smrg pic_mode=default 852943345d3Smrg ;; 853943345d3Smrg esac 854943345d3Smrg if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then 855943345d3Smrg # non-PIC code in shared libraries is not supported 856943345d3Smrg pic_mode=default 857943345d3Smrg fi 858943345d3Smrg 859943345d3Smrg # Calculate the filename of the output object if compiler does 860943345d3Smrg # not support -o with -c 861943345d3Smrg if test "$compiler_c_o" = no; then 862943345d3Smrg output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} 863943345d3Smrg lockfile="$output_obj.lock" 864943345d3Smrg removelist="$removelist $output_obj $lockfile" 865943345d3Smrg trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 866943345d3Smrg else 867943345d3Smrg output_obj= 868943345d3Smrg need_locks=no 869943345d3Smrg lockfile= 870943345d3Smrg fi 871943345d3Smrg 872943345d3Smrg # Lock this critical section if it is needed 873943345d3Smrg # We use this script file to make the link, it avoids creating a new file 874943345d3Smrg if test "$need_locks" = yes; then 875943345d3Smrg until $run ln "$progpath" "$lockfile" 2>/dev/null; do 876943345d3Smrg $show "Waiting for $lockfile to be removed" 877943345d3Smrg sleep 2 878943345d3Smrg done 879943345d3Smrg elif test "$need_locks" = warn; then 880943345d3Smrg if test -f "$lockfile"; then 881943345d3Smrg $echo "\ 882943345d3Smrg*** ERROR, $lockfile exists and contains: 883943345d3Smrg`cat $lockfile 2>/dev/null` 884943345d3Smrg 885943345d3SmrgThis indicates that another process is trying to use the same 886943345d3Smrgtemporary object file, and libtool could not work around it because 887943345d3Smrgyour compiler does not support \`-c' and \`-o' together. If you 888943345d3Smrgrepeat this compilation, it may succeed, by chance, but you had better 889943345d3Smrgavoid parallel builds (make -j) in this platform, or get a better 890943345d3Smrgcompiler." 891943345d3Smrg 892943345d3Smrg $run $rm $removelist 893943345d3Smrg exit $EXIT_FAILURE 894943345d3Smrg fi 895943345d3Smrg $echo "$srcfile" > "$lockfile" 896943345d3Smrg fi 897943345d3Smrg 898943345d3Smrg if test -n "$fix_srcfile_path"; then 899943345d3Smrg eval srcfile=\"$fix_srcfile_path\" 900943345d3Smrg fi 901943345d3Smrg qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` 902943345d3Smrg case $qsrcfile in 903943345d3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 904943345d3Smrg qsrcfile="\"$qsrcfile\"" ;; 905943345d3Smrg esac 906943345d3Smrg 907943345d3Smrg $run $rm "$libobj" "${libobj}T" 908943345d3Smrg 909943345d3Smrg # Create a libtool object file (analogous to a ".la" file), 910943345d3Smrg # but don't create it if we're doing a dry run. 911943345d3Smrg test -z "$run" && cat > ${libobj}T <<EOF 912943345d3Smrg# $libobj - a libtool object file 913943345d3Smrg# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP 914943345d3Smrg# 915943345d3Smrg# Please DO NOT delete this file! 916943345d3Smrg# It is necessary for linking the library. 917943345d3Smrg 918943345d3Smrg# Name of the PIC object. 919943345d3SmrgEOF 920943345d3Smrg 921943345d3Smrg # Only build a PIC object if we are building libtool libraries. 922943345d3Smrg if test "$build_libtool_libs" = yes; then 923943345d3Smrg # Without this assignment, base_compile gets emptied. 924943345d3Smrg fbsd_hideous_sh_bug=$base_compile 925943345d3Smrg 926943345d3Smrg if test "$pic_mode" != no; then 927943345d3Smrg command="$base_compile $qsrcfile $pic_flag" 928943345d3Smrg else 929943345d3Smrg # Don't build PIC code 930943345d3Smrg command="$base_compile $qsrcfile" 931943345d3Smrg fi 932943345d3Smrg 933943345d3Smrg if test ! -d "${xdir}$objdir"; then 934943345d3Smrg $show "$mkdir ${xdir}$objdir" 935943345d3Smrg $run $mkdir ${xdir}$objdir 936943345d3Smrg exit_status=$? 937943345d3Smrg if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then 938943345d3Smrg exit $exit_status 939943345d3Smrg fi 940943345d3Smrg fi 941943345d3Smrg 942943345d3Smrg if test -z "$output_obj"; then 943943345d3Smrg # Place PIC objects in $objdir 944943345d3Smrg command="$command -o $lobj" 945943345d3Smrg fi 946943345d3Smrg 947943345d3Smrg $run $rm "$lobj" "$output_obj" 948943345d3Smrg 949943345d3Smrg $show "$command" 950943345d3Smrg if $run eval "$command"; then : 951943345d3Smrg else 952943345d3Smrg test -n "$output_obj" && $run $rm $removelist 953943345d3Smrg exit $EXIT_FAILURE 954943345d3Smrg fi 955943345d3Smrg 956943345d3Smrg if test "$need_locks" = warn && 957943345d3Smrg test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then 958943345d3Smrg $echo "\ 959943345d3Smrg*** ERROR, $lockfile contains: 960943345d3Smrg`cat $lockfile 2>/dev/null` 961943345d3Smrg 962943345d3Smrgbut it should contain: 963943345d3Smrg$srcfile 964943345d3Smrg 965943345d3SmrgThis indicates that another process is trying to use the same 966943345d3Smrgtemporary object file, and libtool could not work around it because 967943345d3Smrgyour compiler does not support \`-c' and \`-o' together. If you 968943345d3Smrgrepeat this compilation, it may succeed, by chance, but you had better 969943345d3Smrgavoid parallel builds (make -j) in this platform, or get a better 970943345d3Smrgcompiler." 971943345d3Smrg 972943345d3Smrg $run $rm $removelist 973943345d3Smrg exit $EXIT_FAILURE 974943345d3Smrg fi 975943345d3Smrg 976943345d3Smrg # Just move the object if needed, then go on to compile the next one 977943345d3Smrg if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then 978943345d3Smrg $show "$mv $output_obj $lobj" 979943345d3Smrg if $run $mv $output_obj $lobj; then : 980943345d3Smrg else 981943345d3Smrg error=$? 982943345d3Smrg $run $rm $removelist 983943345d3Smrg exit $error 984943345d3Smrg fi 985943345d3Smrg fi 986943345d3Smrg 987943345d3Smrg # Append the name of the PIC object to the libtool object file. 988943345d3Smrg test -z "$run" && cat >> ${libobj}T <<EOF 989943345d3Smrgpic_object='$objdir/$objname' 990943345d3Smrg 991943345d3SmrgEOF 992943345d3Smrg 993943345d3Smrg # Allow error messages only from the first compilation. 994943345d3Smrg if test "$suppress_opt" = yes; then 995943345d3Smrg suppress_output=' >/dev/null 2>&1' 996943345d3Smrg fi 997943345d3Smrg else 998943345d3Smrg # No PIC object so indicate it doesn't exist in the libtool 999943345d3Smrg # object file. 1000943345d3Smrg test -z "$run" && cat >> ${libobj}T <<EOF 1001943345d3Smrgpic_object=none 1002943345d3Smrg 1003943345d3SmrgEOF 1004943345d3Smrg fi 1005943345d3Smrg 1006943345d3Smrg # Only build a position-dependent object if we build old libraries. 1007943345d3Smrg if test "$build_old_libs" = yes; then 1008943345d3Smrg if test "$pic_mode" != yes; then 1009943345d3Smrg # Don't build PIC code 1010943345d3Smrg command="$base_compile $qsrcfile" 1011943345d3Smrg else 1012943345d3Smrg command="$base_compile $qsrcfile $pic_flag" 1013943345d3Smrg fi 1014943345d3Smrg if test "$compiler_c_o" = yes; then 1015943345d3Smrg command="$command -o $obj" 1016943345d3Smrg fi 1017943345d3Smrg 1018943345d3Smrg # Suppress compiler output if we already did a PIC compilation. 1019943345d3Smrg command="$command$suppress_output" 1020943345d3Smrg $run $rm "$obj" "$output_obj" 1021943345d3Smrg $show "$command" 1022943345d3Smrg if $run eval "$command"; then : 1023943345d3Smrg else 1024943345d3Smrg $run $rm $removelist 1025943345d3Smrg exit $EXIT_FAILURE 1026943345d3Smrg fi 1027943345d3Smrg 1028943345d3Smrg if test "$need_locks" = warn && 1029943345d3Smrg test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then 1030943345d3Smrg $echo "\ 1031943345d3Smrg*** ERROR, $lockfile contains: 1032943345d3Smrg`cat $lockfile 2>/dev/null` 1033943345d3Smrg 1034943345d3Smrgbut it should contain: 1035943345d3Smrg$srcfile 1036943345d3Smrg 1037943345d3SmrgThis indicates that another process is trying to use the same 1038943345d3Smrgtemporary object file, and libtool could not work around it because 1039943345d3Smrgyour compiler does not support \`-c' and \`-o' together. If you 1040943345d3Smrgrepeat this compilation, it may succeed, by chance, but you had better 1041943345d3Smrgavoid parallel builds (make -j) in this platform, or get a better 1042943345d3Smrgcompiler." 1043943345d3Smrg 1044943345d3Smrg $run $rm $removelist 1045943345d3Smrg exit $EXIT_FAILURE 1046943345d3Smrg fi 1047943345d3Smrg 1048943345d3Smrg # Just move the object if needed 1049943345d3Smrg if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then 1050943345d3Smrg $show "$mv $output_obj $obj" 1051943345d3Smrg if $run $mv $output_obj $obj; then : 1052943345d3Smrg else 1053943345d3Smrg error=$? 1054943345d3Smrg $run $rm $removelist 1055943345d3Smrg exit $error 1056943345d3Smrg fi 1057943345d3Smrg fi 1058943345d3Smrg 1059943345d3Smrg # Append the name of the non-PIC object the libtool object file. 1060943345d3Smrg # Only append if the libtool object file exists. 1061943345d3Smrg test -z "$run" && cat >> ${libobj}T <<EOF 1062943345d3Smrg# Name of the non-PIC object. 1063943345d3Smrgnon_pic_object='$objname' 1064943345d3Smrg 1065943345d3SmrgEOF 1066943345d3Smrg else 1067943345d3Smrg # Append the name of the non-PIC object the libtool object file. 1068943345d3Smrg # Only append if the libtool object file exists. 1069943345d3Smrg test -z "$run" && cat >> ${libobj}T <<EOF 1070943345d3Smrg# Name of the non-PIC object. 1071943345d3Smrgnon_pic_object=none 1072943345d3Smrg 1073943345d3SmrgEOF 1074943345d3Smrg fi 1075943345d3Smrg 1076943345d3Smrg $run $mv "${libobj}T" "${libobj}" 1077943345d3Smrg 1078943345d3Smrg # Unlock the critical section if it was locked 1079943345d3Smrg if test "$need_locks" != no; then 1080943345d3Smrg $run $rm "$lockfile" 1081943345d3Smrg fi 1082943345d3Smrg 1083943345d3Smrg exit $EXIT_SUCCESS 1084943345d3Smrg ;; 1085943345d3Smrg 1086943345d3Smrg # libtool link mode 1087943345d3Smrg link | relink) 1088943345d3Smrg modename="$modename: link" 1089943345d3Smrg case $host in 1090943345d3Smrg *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) 1091943345d3Smrg # It is impossible to link a dll without this setting, and 1092943345d3Smrg # we shouldn't force the makefile maintainer to figure out 1093943345d3Smrg # which system we are compiling for in order to pass an extra 1094943345d3Smrg # flag for every libtool invocation. 1095943345d3Smrg # allow_undefined=no 1096943345d3Smrg 1097943345d3Smrg # FIXME: Unfortunately, there are problems with the above when trying 1098943345d3Smrg # to make a dll which has undefined symbols, in which case not 1099943345d3Smrg # even a static library is built. For now, we need to specify 1100943345d3Smrg # -no-undefined on the libtool link line when we can be certain 1101943345d3Smrg # that all symbols are satisfied, otherwise we get a static library. 1102943345d3Smrg allow_undefined=yes 1103943345d3Smrg ;; 1104943345d3Smrg *) 1105943345d3Smrg allow_undefined=yes 1106943345d3Smrg ;; 1107943345d3Smrg esac 1108943345d3Smrg libtool_args="$nonopt" 1109943345d3Smrg base_compile="$nonopt $@" 1110943345d3Smrg compile_command="$nonopt" 1111943345d3Smrg finalize_command="$nonopt" 1112943345d3Smrg 1113943345d3Smrg compile_rpath= 1114943345d3Smrg finalize_rpath= 1115943345d3Smrg compile_shlibpath= 1116943345d3Smrg finalize_shlibpath= 1117943345d3Smrg convenience= 1118943345d3Smrg old_convenience= 1119943345d3Smrg deplibs= 1120943345d3Smrg old_deplibs= 1121943345d3Smrg compiler_flags= 1122943345d3Smrg linker_flags= 1123943345d3Smrg dllsearchpath= 1124943345d3Smrg lib_search_path=`pwd` 1125943345d3Smrg inst_prefix_dir= 1126943345d3Smrg 1127943345d3Smrg avoid_version=no 1128943345d3Smrg dlfiles= 1129943345d3Smrg dlprefiles= 1130943345d3Smrg dlself=no 1131943345d3Smrg export_dynamic=no 1132943345d3Smrg export_symbols= 1133943345d3Smrg export_symbols_regex= 1134943345d3Smrg generated= 1135943345d3Smrg libobjs= 1136943345d3Smrg ltlibs= 1137943345d3Smrg module=no 1138943345d3Smrg no_install=no 1139943345d3Smrg objs= 1140943345d3Smrg non_pic_objects= 1141943345d3Smrg notinst_path= # paths that contain not-installed libtool libraries 1142943345d3Smrg precious_files_regex= 1143943345d3Smrg prefer_static_libs=no 1144943345d3Smrg preload=no 1145943345d3Smrg prev= 1146943345d3Smrg prevarg= 1147943345d3Smrg release= 1148943345d3Smrg rpath= 1149943345d3Smrg xrpath= 1150943345d3Smrg perm_rpath= 1151943345d3Smrg temp_rpath= 1152943345d3Smrg thread_safe=no 1153943345d3Smrg vinfo= 1154943345d3Smrg vinfo_number=no 1155943345d3Smrg 1156943345d3Smrg func_infer_tag $base_compile 1157943345d3Smrg 1158943345d3Smrg # We need to know -static, to get the right output filenames. 1159943345d3Smrg for arg 1160943345d3Smrg do 1161943345d3Smrg case $arg in 1162f67b85aaSmrg -all-static | -static | -static-libtool-libs) 1163f67b85aaSmrg case $arg in 1164f67b85aaSmrg -all-static) 1165943345d3Smrg if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then 1166943345d3Smrg $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 1167943345d3Smrg fi 1168943345d3Smrg if test -n "$link_static_flag"; then 1169943345d3Smrg dlopen_self=$dlopen_self_static 1170943345d3Smrg fi 1171943345d3Smrg prefer_static_libs=yes 1172f67b85aaSmrg ;; 1173f67b85aaSmrg -static) 1174943345d3Smrg if test -z "$pic_flag" && test -n "$link_static_flag"; then 1175943345d3Smrg dlopen_self=$dlopen_self_static 1176943345d3Smrg fi 1177943345d3Smrg prefer_static_libs=built 1178f67b85aaSmrg ;; 1179f67b85aaSmrg -static-libtool-libs) 1180f67b85aaSmrg if test -z "$pic_flag" && test -n "$link_static_flag"; then 1181f67b85aaSmrg dlopen_self=$dlopen_self_static 1182f67b85aaSmrg fi 1183f67b85aaSmrg prefer_static_libs=yes 1184f67b85aaSmrg ;; 1185f67b85aaSmrg esac 1186943345d3Smrg build_libtool_libs=no 1187943345d3Smrg build_old_libs=yes 1188943345d3Smrg break 1189943345d3Smrg ;; 1190943345d3Smrg esac 1191943345d3Smrg done 1192943345d3Smrg 1193943345d3Smrg # See if our shared archives depend on static archives. 1194943345d3Smrg test -n "$old_archive_from_new_cmds" && build_old_libs=yes 1195943345d3Smrg 1196943345d3Smrg # Go through the arguments, transforming them on the way. 1197943345d3Smrg while test "$#" -gt 0; do 1198943345d3Smrg arg="$1" 1199943345d3Smrg shift 1200943345d3Smrg case $arg in 1201943345d3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 1202943345d3Smrg qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test 1203943345d3Smrg ;; 1204943345d3Smrg *) qarg=$arg ;; 1205943345d3Smrg esac 1206943345d3Smrg libtool_args="$libtool_args $qarg" 1207943345d3Smrg 1208943345d3Smrg # If the previous option needs an argument, assign it. 1209943345d3Smrg if test -n "$prev"; then 1210943345d3Smrg case $prev in 1211943345d3Smrg output) 1212943345d3Smrg compile_command="$compile_command @OUTPUT@" 1213943345d3Smrg finalize_command="$finalize_command @OUTPUT@" 1214943345d3Smrg ;; 1215943345d3Smrg esac 1216943345d3Smrg 1217943345d3Smrg case $prev in 1218943345d3Smrg dlfiles|dlprefiles) 1219943345d3Smrg if test "$preload" = no; then 1220943345d3Smrg # Add the symbol object into the linking commands. 1221943345d3Smrg compile_command="$compile_command @SYMFILE@" 1222943345d3Smrg finalize_command="$finalize_command @SYMFILE@" 1223943345d3Smrg preload=yes 1224943345d3Smrg fi 1225943345d3Smrg case $arg in 1226943345d3Smrg *.la | *.lo) ;; # We handle these cases below. 1227943345d3Smrg force) 1228943345d3Smrg if test "$dlself" = no; then 1229943345d3Smrg dlself=needless 1230943345d3Smrg export_dynamic=yes 1231943345d3Smrg fi 1232943345d3Smrg prev= 1233943345d3Smrg continue 1234943345d3Smrg ;; 1235943345d3Smrg self) 1236943345d3Smrg if test "$prev" = dlprefiles; then 1237943345d3Smrg dlself=yes 1238943345d3Smrg elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then 1239943345d3Smrg dlself=yes 1240943345d3Smrg else 1241943345d3Smrg dlself=needless 1242943345d3Smrg export_dynamic=yes 1243943345d3Smrg fi 1244943345d3Smrg prev= 1245943345d3Smrg continue 1246943345d3Smrg ;; 1247943345d3Smrg *) 1248943345d3Smrg if test "$prev" = dlfiles; then 1249943345d3Smrg dlfiles="$dlfiles $arg" 1250943345d3Smrg else 1251943345d3Smrg dlprefiles="$dlprefiles $arg" 1252943345d3Smrg fi 1253943345d3Smrg prev= 1254943345d3Smrg continue 1255943345d3Smrg ;; 1256943345d3Smrg esac 1257943345d3Smrg ;; 1258943345d3Smrg expsyms) 1259943345d3Smrg export_symbols="$arg" 1260943345d3Smrg if test ! -f "$arg"; then 1261943345d3Smrg $echo "$modename: symbol file \`$arg' does not exist" 1262943345d3Smrg exit $EXIT_FAILURE 1263943345d3Smrg fi 1264943345d3Smrg prev= 1265943345d3Smrg continue 1266943345d3Smrg ;; 1267943345d3Smrg expsyms_regex) 1268943345d3Smrg export_symbols_regex="$arg" 1269943345d3Smrg prev= 1270943345d3Smrg continue 1271943345d3Smrg ;; 1272943345d3Smrg inst_prefix) 1273943345d3Smrg inst_prefix_dir="$arg" 1274943345d3Smrg prev= 1275943345d3Smrg continue 1276943345d3Smrg ;; 1277943345d3Smrg precious_regex) 1278943345d3Smrg precious_files_regex="$arg" 1279943345d3Smrg prev= 1280943345d3Smrg continue 1281943345d3Smrg ;; 1282943345d3Smrg release) 1283943345d3Smrg release="-$arg" 1284943345d3Smrg prev= 1285943345d3Smrg continue 1286943345d3Smrg ;; 1287943345d3Smrg objectlist) 1288943345d3Smrg if test -f "$arg"; then 1289943345d3Smrg save_arg=$arg 1290943345d3Smrg moreargs= 1291943345d3Smrg for fil in `cat $save_arg` 1292943345d3Smrg do 1293943345d3Smrg# moreargs="$moreargs $fil" 1294943345d3Smrg arg=$fil 1295943345d3Smrg # A libtool-controlled object. 1296943345d3Smrg 1297943345d3Smrg # Check to see that this really is a libtool object. 1298943345d3Smrg if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 1299943345d3Smrg pic_object= 1300943345d3Smrg non_pic_object= 1301943345d3Smrg 1302943345d3Smrg # Read the .lo file 1303943345d3Smrg # If there is no directory component, then add one. 1304943345d3Smrg case $arg in 1305943345d3Smrg */* | *\\*) . $arg ;; 1306943345d3Smrg *) . ./$arg ;; 1307943345d3Smrg esac 1308943345d3Smrg 1309943345d3Smrg if test -z "$pic_object" || \ 1310943345d3Smrg test -z "$non_pic_object" || 1311943345d3Smrg test "$pic_object" = none && \ 1312943345d3Smrg test "$non_pic_object" = none; then 1313943345d3Smrg $echo "$modename: cannot find name of object for \`$arg'" 1>&2 1314943345d3Smrg exit $EXIT_FAILURE 1315943345d3Smrg fi 1316943345d3Smrg 1317943345d3Smrg # Extract subdirectory from the argument. 1318943345d3Smrg xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` 1319943345d3Smrg if test "X$xdir" = "X$arg"; then 1320943345d3Smrg xdir= 1321943345d3Smrg else 1322943345d3Smrg xdir="$xdir/" 1323943345d3Smrg fi 1324943345d3Smrg 1325943345d3Smrg if test "$pic_object" != none; then 1326943345d3Smrg # Prepend the subdirectory the object is found in. 1327943345d3Smrg pic_object="$xdir$pic_object" 1328943345d3Smrg 1329943345d3Smrg if test "$prev" = dlfiles; then 1330943345d3Smrg if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then 1331943345d3Smrg dlfiles="$dlfiles $pic_object" 1332943345d3Smrg prev= 1333943345d3Smrg continue 1334943345d3Smrg else 1335943345d3Smrg # If libtool objects are unsupported, then we need to preload. 1336943345d3Smrg prev=dlprefiles 1337943345d3Smrg fi 1338943345d3Smrg fi 1339943345d3Smrg 1340943345d3Smrg # CHECK ME: I think I busted this. -Ossama 1341943345d3Smrg if test "$prev" = dlprefiles; then 1342943345d3Smrg # Preload the old-style object. 1343943345d3Smrg dlprefiles="$dlprefiles $pic_object" 1344943345d3Smrg prev= 1345943345d3Smrg fi 1346943345d3Smrg 1347943345d3Smrg # A PIC object. 1348943345d3Smrg libobjs="$libobjs $pic_object" 1349943345d3Smrg arg="$pic_object" 1350943345d3Smrg fi 1351943345d3Smrg 1352943345d3Smrg # Non-PIC object. 1353943345d3Smrg if test "$non_pic_object" != none; then 1354943345d3Smrg # Prepend the subdirectory the object is found in. 1355943345d3Smrg non_pic_object="$xdir$non_pic_object" 1356943345d3Smrg 1357943345d3Smrg # A standard non-PIC object 1358943345d3Smrg non_pic_objects="$non_pic_objects $non_pic_object" 1359943345d3Smrg if test -z "$pic_object" || test "$pic_object" = none ; then 1360943345d3Smrg arg="$non_pic_object" 1361943345d3Smrg fi 1362943345d3Smrg else 1363943345d3Smrg # If the PIC object exists, use it instead. 1364943345d3Smrg # $xdir was prepended to $pic_object above. 1365943345d3Smrg non_pic_object="$pic_object" 1366943345d3Smrg non_pic_objects="$non_pic_objects $non_pic_object" 1367943345d3Smrg fi 1368943345d3Smrg else 1369943345d3Smrg # Only an error if not doing a dry-run. 1370943345d3Smrg if test -z "$run"; then 1371943345d3Smrg $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 1372943345d3Smrg exit $EXIT_FAILURE 1373943345d3Smrg else 1374943345d3Smrg # Dry-run case. 1375943345d3Smrg 1376943345d3Smrg # Extract subdirectory from the argument. 1377943345d3Smrg xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` 1378943345d3Smrg if test "X$xdir" = "X$arg"; then 1379943345d3Smrg xdir= 1380943345d3Smrg else 1381943345d3Smrg xdir="$xdir/" 1382943345d3Smrg fi 1383943345d3Smrg 1384943345d3Smrg pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` 1385943345d3Smrg non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` 1386943345d3Smrg libobjs="$libobjs $pic_object" 1387943345d3Smrg non_pic_objects="$non_pic_objects $non_pic_object" 1388943345d3Smrg fi 1389943345d3Smrg fi 1390943345d3Smrg done 1391943345d3Smrg else 1392943345d3Smrg $echo "$modename: link input file \`$save_arg' does not exist" 1393943345d3Smrg exit $EXIT_FAILURE 1394943345d3Smrg fi 1395943345d3Smrg arg=$save_arg 1396943345d3Smrg prev= 1397943345d3Smrg continue 1398943345d3Smrg ;; 1399943345d3Smrg rpath | xrpath) 1400943345d3Smrg # We need an absolute path. 1401943345d3Smrg case $arg in 1402943345d3Smrg [\\/]* | [A-Za-z]:[\\/]*) ;; 1403943345d3Smrg *) 1404943345d3Smrg $echo "$modename: only absolute run-paths are allowed" 1>&2 1405943345d3Smrg exit $EXIT_FAILURE 1406943345d3Smrg ;; 1407943345d3Smrg esac 1408943345d3Smrg if test "$prev" = rpath; then 1409943345d3Smrg case "$rpath " in 1410943345d3Smrg *" $arg "*) ;; 1411943345d3Smrg *) rpath="$rpath $arg" ;; 1412943345d3Smrg esac 1413943345d3Smrg else 1414943345d3Smrg case "$xrpath " in 1415943345d3Smrg *" $arg "*) ;; 1416943345d3Smrg *) xrpath="$xrpath $arg" ;; 1417943345d3Smrg esac 1418943345d3Smrg fi 1419943345d3Smrg prev= 1420943345d3Smrg continue 1421943345d3Smrg ;; 1422943345d3Smrg xcompiler) 1423943345d3Smrg compiler_flags="$compiler_flags $qarg" 1424943345d3Smrg prev= 1425943345d3Smrg compile_command="$compile_command $qarg" 1426943345d3Smrg finalize_command="$finalize_command $qarg" 1427943345d3Smrg continue 1428943345d3Smrg ;; 1429943345d3Smrg xlinker) 1430943345d3Smrg linker_flags="$linker_flags $qarg" 1431943345d3Smrg compiler_flags="$compiler_flags $wl$qarg" 1432943345d3Smrg prev= 1433943345d3Smrg compile_command="$compile_command $wl$qarg" 1434943345d3Smrg finalize_command="$finalize_command $wl$qarg" 1435943345d3Smrg continue 1436943345d3Smrg ;; 1437943345d3Smrg xcclinker) 1438943345d3Smrg linker_flags="$linker_flags $qarg" 1439943345d3Smrg compiler_flags="$compiler_flags $qarg" 1440943345d3Smrg prev= 1441943345d3Smrg compile_command="$compile_command $qarg" 1442943345d3Smrg finalize_command="$finalize_command $qarg" 1443943345d3Smrg continue 1444943345d3Smrg ;; 1445943345d3Smrg shrext) 1446943345d3Smrg shrext_cmds="$arg" 1447943345d3Smrg prev= 1448943345d3Smrg continue 1449943345d3Smrg ;; 1450943345d3Smrg darwin_framework|darwin_framework_skip) 1451943345d3Smrg test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" 1452943345d3Smrg compile_command="$compile_command $arg" 1453943345d3Smrg finalize_command="$finalize_command $arg" 1454943345d3Smrg prev= 1455943345d3Smrg continue 1456943345d3Smrg ;; 1457943345d3Smrg *) 1458943345d3Smrg eval "$prev=\"\$arg\"" 1459943345d3Smrg prev= 1460943345d3Smrg continue 1461943345d3Smrg ;; 1462943345d3Smrg esac 1463943345d3Smrg fi # test -n "$prev" 1464943345d3Smrg 1465943345d3Smrg prevarg="$arg" 1466943345d3Smrg 1467943345d3Smrg case $arg in 1468943345d3Smrg -all-static) 1469943345d3Smrg if test -n "$link_static_flag"; then 1470943345d3Smrg compile_command="$compile_command $link_static_flag" 1471943345d3Smrg finalize_command="$finalize_command $link_static_flag" 1472943345d3Smrg fi 1473943345d3Smrg continue 1474943345d3Smrg ;; 1475943345d3Smrg 1476943345d3Smrg -allow-undefined) 1477943345d3Smrg # FIXME: remove this flag sometime in the future. 1478943345d3Smrg $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 1479943345d3Smrg continue 1480943345d3Smrg ;; 1481943345d3Smrg 1482943345d3Smrg -avoid-version) 1483943345d3Smrg avoid_version=yes 1484943345d3Smrg continue 1485943345d3Smrg ;; 1486943345d3Smrg 1487943345d3Smrg -dlopen) 1488943345d3Smrg prev=dlfiles 1489943345d3Smrg continue 1490943345d3Smrg ;; 1491943345d3Smrg 1492943345d3Smrg -dlpreopen) 1493943345d3Smrg prev=dlprefiles 1494943345d3Smrg continue 1495943345d3Smrg ;; 1496943345d3Smrg 1497943345d3Smrg -export-dynamic) 1498943345d3Smrg export_dynamic=yes 1499943345d3Smrg continue 1500943345d3Smrg ;; 1501943345d3Smrg 1502943345d3Smrg -export-symbols | -export-symbols-regex) 1503943345d3Smrg if test -n "$export_symbols" || test -n "$export_symbols_regex"; then 1504943345d3Smrg $echo "$modename: more than one -exported-symbols argument is not allowed" 1505943345d3Smrg exit $EXIT_FAILURE 1506943345d3Smrg fi 1507943345d3Smrg if test "X$arg" = "X-export-symbols"; then 1508943345d3Smrg prev=expsyms 1509943345d3Smrg else 1510943345d3Smrg prev=expsyms_regex 1511943345d3Smrg fi 1512943345d3Smrg continue 1513943345d3Smrg ;; 1514943345d3Smrg 1515943345d3Smrg -framework|-arch|-isysroot) 1516943345d3Smrg case " $CC " in 1517943345d3Smrg *" ${arg} ${1} "* | *" ${arg} ${1} "*) 1518943345d3Smrg prev=darwin_framework_skip ;; 1519943345d3Smrg *) compiler_flags="$compiler_flags $arg" 1520943345d3Smrg prev=darwin_framework ;; 1521943345d3Smrg esac 1522943345d3Smrg compile_command="$compile_command $arg" 1523943345d3Smrg finalize_command="$finalize_command $arg" 1524943345d3Smrg continue 1525943345d3Smrg ;; 1526943345d3Smrg 1527943345d3Smrg -inst-prefix-dir) 1528943345d3Smrg prev=inst_prefix 1529943345d3Smrg continue 1530943345d3Smrg ;; 1531943345d3Smrg 1532943345d3Smrg # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* 1533943345d3Smrg # so, if we see these flags be careful not to treat them like -L 1534943345d3Smrg -L[A-Z][A-Z]*:*) 1535943345d3Smrg case $with_gcc/$host in 1536943345d3Smrg no/*-*-irix* | /*-*-irix*) 1537943345d3Smrg compile_command="$compile_command $arg" 1538943345d3Smrg finalize_command="$finalize_command $arg" 1539943345d3Smrg ;; 1540943345d3Smrg esac 1541943345d3Smrg continue 1542943345d3Smrg ;; 1543943345d3Smrg 1544943345d3Smrg -L*) 1545943345d3Smrg dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` 1546943345d3Smrg # We need an absolute path. 1547943345d3Smrg case $dir in 1548943345d3Smrg [\\/]* | [A-Za-z]:[\\/]*) ;; 1549943345d3Smrg *) 1550943345d3Smrg absdir=`cd "$dir" && pwd` 1551943345d3Smrg if test -z "$absdir"; then 1552943345d3Smrg $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 1553943345d3Smrg absdir="$dir" 1554943345d3Smrg notinst_path="$notinst_path $dir" 1555943345d3Smrg fi 1556943345d3Smrg dir="$absdir" 1557943345d3Smrg ;; 1558943345d3Smrg esac 1559943345d3Smrg case "$deplibs " in 1560943345d3Smrg *" -L$dir "*) ;; 1561943345d3Smrg *) 1562943345d3Smrg deplibs="$deplibs -L$dir" 1563943345d3Smrg lib_search_path="$lib_search_path $dir" 1564943345d3Smrg ;; 1565943345d3Smrg esac 1566943345d3Smrg case $host in 1567943345d3Smrg *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) 1568943345d3Smrg testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` 1569943345d3Smrg case :$dllsearchpath: in 1570943345d3Smrg *":$dir:"*) ;; 1571943345d3Smrg *) dllsearchpath="$dllsearchpath:$dir";; 1572943345d3Smrg esac 1573943345d3Smrg case :$dllsearchpath: in 1574943345d3Smrg *":$testbindir:"*) ;; 1575943345d3Smrg *) dllsearchpath="$dllsearchpath:$testbindir";; 1576943345d3Smrg esac 1577943345d3Smrg ;; 1578943345d3Smrg esac 1579943345d3Smrg continue 1580943345d3Smrg ;; 1581943345d3Smrg 1582943345d3Smrg -l*) 1583943345d3Smrg if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then 1584943345d3Smrg case $host in 1585943345d3Smrg *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) 1586943345d3Smrg # These systems don't actually have a C or math library (as such) 1587943345d3Smrg continue 1588943345d3Smrg ;; 1589943345d3Smrg *-*-os2*) 1590943345d3Smrg # These systems don't actually have a C library (as such) 1591943345d3Smrg test "X$arg" = "X-lc" && continue 1592943345d3Smrg ;; 1593943345d3Smrg *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) 1594943345d3Smrg # Do not include libc due to us having libc/libc_r. 1595943345d3Smrg test "X$arg" = "X-lc" && continue 1596943345d3Smrg ;; 1597943345d3Smrg *-*-rhapsody* | *-*-darwin1.[012]) 1598943345d3Smrg # Rhapsody C and math libraries are in the System framework 1599943345d3Smrg deplibs="$deplibs -framework System" 1600943345d3Smrg continue 1601943345d3Smrg ;; 1602943345d3Smrg *-*-sco3.2v5* | *-*-sco5v6*) 1603943345d3Smrg # Causes problems with __ctype 1604943345d3Smrg test "X$arg" = "X-lc" && continue 1605943345d3Smrg ;; 1606943345d3Smrg *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) 1607943345d3Smrg # Compiler inserts libc in the correct place for threads to work 1608943345d3Smrg test "X$arg" = "X-lc" && continue 1609943345d3Smrg ;; 1610943345d3Smrg esac 1611943345d3Smrg elif test "X$arg" = "X-lc_r"; then 1612943345d3Smrg case $host in 1613943345d3Smrg *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) 1614943345d3Smrg # Do not include libc_r directly, use -pthread flag. 1615943345d3Smrg continue 1616943345d3Smrg ;; 1617943345d3Smrg esac 1618943345d3Smrg fi 1619943345d3Smrg deplibs="$deplibs $arg" 1620943345d3Smrg continue 1621943345d3Smrg ;; 1622943345d3Smrg 1623943345d3Smrg # Tru64 UNIX uses -model [arg] to determine the layout of C++ 1624943345d3Smrg # classes, name mangling, and exception handling. 1625943345d3Smrg -model) 1626943345d3Smrg compile_command="$compile_command $arg" 1627943345d3Smrg compiler_flags="$compiler_flags $arg" 1628943345d3Smrg finalize_command="$finalize_command $arg" 1629943345d3Smrg prev=xcompiler 1630943345d3Smrg continue 1631943345d3Smrg ;; 1632943345d3Smrg 1633943345d3Smrg -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) 1634943345d3Smrg compiler_flags="$compiler_flags $arg" 1635943345d3Smrg compile_command="$compile_command $arg" 1636943345d3Smrg finalize_command="$finalize_command $arg" 1637943345d3Smrg continue 1638943345d3Smrg ;; 1639943345d3Smrg 1640943345d3Smrg -module) 1641943345d3Smrg module=yes 1642943345d3Smrg continue 1643943345d3Smrg ;; 1644943345d3Smrg 1645943345d3Smrg # -64, -mips[0-9] enable 64-bit mode on the SGI compiler 1646943345d3Smrg # -r[0-9][0-9]* specifies the processor on the SGI compiler 1647943345d3Smrg # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler 1648943345d3Smrg # +DA*, +DD* enable 64-bit mode on the HP compiler 1649943345d3Smrg # -q* pass through compiler args for the IBM compiler 1650943345d3Smrg # -m* pass through architecture-specific compiler args for GCC 1651943345d3Smrg # -m*, -t[45]*, -txscale* pass through architecture-specific 1652943345d3Smrg # compiler args for GCC 1653943345d3Smrg # -pg pass through profiling flag for GCC 1654943345d3Smrg # @file GCC response files 1655943345d3Smrg -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ 1656943345d3Smrg -t[45]*|-txscale*|@*) 1657943345d3Smrg 1658943345d3Smrg # Unknown arguments in both finalize_command and compile_command need 1659943345d3Smrg # to be aesthetically quoted because they are evaled later. 1660943345d3Smrg arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` 1661943345d3Smrg case $arg in 1662943345d3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 1663943345d3Smrg arg="\"$arg\"" 1664943345d3Smrg ;; 1665943345d3Smrg esac 1666943345d3Smrg compile_command="$compile_command $arg" 1667943345d3Smrg finalize_command="$finalize_command $arg" 1668943345d3Smrg compiler_flags="$compiler_flags $arg" 1669943345d3Smrg continue 1670943345d3Smrg ;; 1671943345d3Smrg 1672943345d3Smrg -shrext) 1673943345d3Smrg prev=shrext 1674943345d3Smrg continue 1675943345d3Smrg ;; 1676943345d3Smrg 1677943345d3Smrg -no-fast-install) 1678943345d3Smrg fast_install=no 1679943345d3Smrg continue 1680943345d3Smrg ;; 1681943345d3Smrg 1682943345d3Smrg -no-install) 1683943345d3Smrg case $host in 1684943345d3Smrg *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) 1685943345d3Smrg # The PATH hackery in wrapper scripts is required on Windows 1686943345d3Smrg # in order for the loader to find any dlls it needs. 1687943345d3Smrg $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 1688943345d3Smrg $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 1689943345d3Smrg fast_install=no 1690943345d3Smrg ;; 1691943345d3Smrg *) no_install=yes ;; 1692943345d3Smrg esac 1693943345d3Smrg continue 1694943345d3Smrg ;; 1695943345d3Smrg 1696943345d3Smrg -no-undefined) 1697943345d3Smrg allow_undefined=no 1698943345d3Smrg continue 1699943345d3Smrg ;; 1700943345d3Smrg 1701943345d3Smrg -objectlist) 1702943345d3Smrg prev=objectlist 1703943345d3Smrg continue 1704943345d3Smrg ;; 1705943345d3Smrg 1706943345d3Smrg -o) prev=output ;; 1707943345d3Smrg 1708943345d3Smrg -precious-files-regex) 1709943345d3Smrg prev=precious_regex 1710943345d3Smrg continue 1711943345d3Smrg ;; 1712943345d3Smrg 1713943345d3Smrg -release) 1714943345d3Smrg prev=release 1715943345d3Smrg continue 1716943345d3Smrg ;; 1717943345d3Smrg 1718943345d3Smrg -rpath) 1719943345d3Smrg prev=rpath 1720943345d3Smrg continue 1721943345d3Smrg ;; 1722943345d3Smrg 1723943345d3Smrg -R) 1724943345d3Smrg prev=xrpath 1725943345d3Smrg continue 1726943345d3Smrg ;; 1727943345d3Smrg 1728943345d3Smrg -R*) 1729943345d3Smrg dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` 1730943345d3Smrg # We need an absolute path. 1731943345d3Smrg case $dir in 1732943345d3Smrg [\\/]* | [A-Za-z]:[\\/]*) ;; 1733943345d3Smrg *) 1734943345d3Smrg $echo "$modename: only absolute run-paths are allowed" 1>&2 1735943345d3Smrg exit $EXIT_FAILURE 1736943345d3Smrg ;; 1737943345d3Smrg esac 1738943345d3Smrg case "$xrpath " in 1739943345d3Smrg *" $dir "*) ;; 1740943345d3Smrg *) xrpath="$xrpath $dir" ;; 1741943345d3Smrg esac 1742943345d3Smrg continue 1743943345d3Smrg ;; 1744943345d3Smrg 1745f67b85aaSmrg -static | -static-libtool-libs) 1746943345d3Smrg # The effects of -static are defined in a previous loop. 1747943345d3Smrg # We used to do the same as -all-static on platforms that 1748943345d3Smrg # didn't have a PIC flag, but the assumption that the effects 1749943345d3Smrg # would be equivalent was wrong. It would break on at least 1750943345d3Smrg # Digital Unix and AIX. 1751943345d3Smrg continue 1752943345d3Smrg ;; 1753943345d3Smrg 1754943345d3Smrg -thread-safe) 1755943345d3Smrg thread_safe=yes 1756943345d3Smrg continue 1757943345d3Smrg ;; 1758943345d3Smrg 1759943345d3Smrg -version-info) 1760943345d3Smrg prev=vinfo 1761943345d3Smrg continue 1762943345d3Smrg ;; 1763943345d3Smrg -version-number) 1764943345d3Smrg prev=vinfo 1765943345d3Smrg vinfo_number=yes 1766943345d3Smrg continue 1767943345d3Smrg ;; 1768943345d3Smrg 1769943345d3Smrg -Wc,*) 1770943345d3Smrg args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` 1771943345d3Smrg arg= 1772943345d3Smrg save_ifs="$IFS"; IFS=',' 1773943345d3Smrg for flag in $args; do 1774943345d3Smrg IFS="$save_ifs" 1775943345d3Smrg case $flag in 1776943345d3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 1777943345d3Smrg flag="\"$flag\"" 1778943345d3Smrg ;; 1779943345d3Smrg esac 1780943345d3Smrg arg="$arg $wl$flag" 1781943345d3Smrg compiler_flags="$compiler_flags $flag" 1782943345d3Smrg done 1783943345d3Smrg IFS="$save_ifs" 1784943345d3Smrg arg=`$echo "X$arg" | $Xsed -e "s/^ //"` 1785943345d3Smrg ;; 1786943345d3Smrg 1787943345d3Smrg -Wl,*) 1788943345d3Smrg args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` 1789943345d3Smrg arg= 1790943345d3Smrg save_ifs="$IFS"; IFS=',' 1791943345d3Smrg for flag in $args; do 1792943345d3Smrg IFS="$save_ifs" 1793943345d3Smrg case $flag in 1794943345d3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 1795943345d3Smrg flag="\"$flag\"" 1796943345d3Smrg ;; 1797943345d3Smrg esac 1798943345d3Smrg arg="$arg $wl$flag" 1799943345d3Smrg compiler_flags="$compiler_flags $wl$flag" 1800943345d3Smrg linker_flags="$linker_flags $flag" 1801943345d3Smrg done 1802943345d3Smrg IFS="$save_ifs" 1803943345d3Smrg arg=`$echo "X$arg" | $Xsed -e "s/^ //"` 1804943345d3Smrg ;; 1805943345d3Smrg 1806943345d3Smrg -Xcompiler) 1807943345d3Smrg prev=xcompiler 1808943345d3Smrg continue 1809943345d3Smrg ;; 1810943345d3Smrg 1811943345d3Smrg -Xlinker) 1812943345d3Smrg prev=xlinker 1813943345d3Smrg continue 1814943345d3Smrg ;; 1815943345d3Smrg 1816943345d3Smrg -XCClinker) 1817943345d3Smrg prev=xcclinker 1818943345d3Smrg continue 1819943345d3Smrg ;; 1820943345d3Smrg 1821943345d3Smrg # Some other compiler flag. 1822943345d3Smrg -* | +*) 1823943345d3Smrg # Unknown arguments in both finalize_command and compile_command need 1824943345d3Smrg # to be aesthetically quoted because they are evaled later. 1825943345d3Smrg arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` 1826943345d3Smrg case $arg in 1827943345d3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 1828943345d3Smrg arg="\"$arg\"" 1829943345d3Smrg ;; 1830943345d3Smrg esac 1831943345d3Smrg ;; 1832943345d3Smrg 1833943345d3Smrg *.$objext) 1834943345d3Smrg # A standard object. 1835943345d3Smrg objs="$objs $arg" 1836943345d3Smrg ;; 1837943345d3Smrg 1838943345d3Smrg *.lo) 1839943345d3Smrg # A libtool-controlled object. 1840943345d3Smrg 1841943345d3Smrg # Check to see that this really is a libtool object. 1842943345d3Smrg if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 1843943345d3Smrg pic_object= 1844943345d3Smrg non_pic_object= 1845943345d3Smrg 1846943345d3Smrg # Read the .lo file 1847943345d3Smrg # If there is no directory component, then add one. 1848943345d3Smrg case $arg in 1849943345d3Smrg */* | *\\*) . $arg ;; 1850943345d3Smrg *) . ./$arg ;; 1851943345d3Smrg esac 1852943345d3Smrg 1853943345d3Smrg if test -z "$pic_object" || \ 1854943345d3Smrg test -z "$non_pic_object" || 1855943345d3Smrg test "$pic_object" = none && \ 1856943345d3Smrg test "$non_pic_object" = none; then 1857943345d3Smrg $echo "$modename: cannot find name of object for \`$arg'" 1>&2 1858943345d3Smrg exit $EXIT_FAILURE 1859943345d3Smrg fi 1860943345d3Smrg 1861943345d3Smrg # Extract subdirectory from the argument. 1862943345d3Smrg xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` 1863943345d3Smrg if test "X$xdir" = "X$arg"; then 1864943345d3Smrg xdir= 1865943345d3Smrg else 1866943345d3Smrg xdir="$xdir/" 1867943345d3Smrg fi 1868943345d3Smrg 1869943345d3Smrg if test "$pic_object" != none; then 1870943345d3Smrg # Prepend the subdirectory the object is found in. 1871943345d3Smrg pic_object="$xdir$pic_object" 1872943345d3Smrg 1873943345d3Smrg if test "$prev" = dlfiles; then 1874943345d3Smrg if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then 1875943345d3Smrg dlfiles="$dlfiles $pic_object" 1876943345d3Smrg prev= 1877943345d3Smrg continue 1878943345d3Smrg else 1879943345d3Smrg # If libtool objects are unsupported, then we need to preload. 1880943345d3Smrg prev=dlprefiles 1881943345d3Smrg fi 1882943345d3Smrg fi 1883943345d3Smrg 1884943345d3Smrg # CHECK ME: I think I busted this. -Ossama 1885943345d3Smrg if test "$prev" = dlprefiles; then 1886943345d3Smrg # Preload the old-style object. 1887943345d3Smrg dlprefiles="$dlprefiles $pic_object" 1888943345d3Smrg prev= 1889943345d3Smrg fi 1890943345d3Smrg 1891943345d3Smrg # A PIC object. 1892943345d3Smrg libobjs="$libobjs $pic_object" 1893943345d3Smrg arg="$pic_object" 1894943345d3Smrg fi 1895943345d3Smrg 1896943345d3Smrg # Non-PIC object. 1897943345d3Smrg if test "$non_pic_object" != none; then 1898943345d3Smrg # Prepend the subdirectory the object is found in. 1899943345d3Smrg non_pic_object="$xdir$non_pic_object" 1900943345d3Smrg 1901943345d3Smrg # A standard non-PIC object 1902943345d3Smrg non_pic_objects="$non_pic_objects $non_pic_object" 1903943345d3Smrg if test -z "$pic_object" || test "$pic_object" = none ; then 1904943345d3Smrg arg="$non_pic_object" 1905943345d3Smrg fi 1906943345d3Smrg else 1907943345d3Smrg # If the PIC object exists, use it instead. 1908943345d3Smrg # $xdir was prepended to $pic_object above. 1909943345d3Smrg non_pic_object="$pic_object" 1910943345d3Smrg non_pic_objects="$non_pic_objects $non_pic_object" 1911943345d3Smrg fi 1912943345d3Smrg else 1913943345d3Smrg # Only an error if not doing a dry-run. 1914943345d3Smrg if test -z "$run"; then 1915943345d3Smrg $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 1916943345d3Smrg exit $EXIT_FAILURE 1917943345d3Smrg else 1918943345d3Smrg # Dry-run case. 1919943345d3Smrg 1920943345d3Smrg # Extract subdirectory from the argument. 1921943345d3Smrg xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` 1922943345d3Smrg if test "X$xdir" = "X$arg"; then 1923943345d3Smrg xdir= 1924943345d3Smrg else 1925943345d3Smrg xdir="$xdir/" 1926943345d3Smrg fi 1927943345d3Smrg 1928943345d3Smrg pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` 1929943345d3Smrg non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` 1930943345d3Smrg libobjs="$libobjs $pic_object" 1931943345d3Smrg non_pic_objects="$non_pic_objects $non_pic_object" 1932943345d3Smrg fi 1933943345d3Smrg fi 1934943345d3Smrg ;; 1935943345d3Smrg 1936943345d3Smrg *.$libext) 1937943345d3Smrg # An archive. 1938943345d3Smrg deplibs="$deplibs $arg" 1939943345d3Smrg old_deplibs="$old_deplibs $arg" 1940943345d3Smrg continue 1941943345d3Smrg ;; 1942943345d3Smrg 1943943345d3Smrg *.la) 1944943345d3Smrg # A libtool-controlled library. 1945943345d3Smrg 1946943345d3Smrg if test "$prev" = dlfiles; then 1947943345d3Smrg # This library was specified with -dlopen. 1948943345d3Smrg dlfiles="$dlfiles $arg" 1949943345d3Smrg prev= 1950943345d3Smrg elif test "$prev" = dlprefiles; then 1951943345d3Smrg # The library was specified with -dlpreopen. 1952943345d3Smrg dlprefiles="$dlprefiles $arg" 1953943345d3Smrg prev= 1954943345d3Smrg else 1955943345d3Smrg deplibs="$deplibs $arg" 1956943345d3Smrg fi 1957943345d3Smrg continue 1958943345d3Smrg ;; 1959943345d3Smrg 1960943345d3Smrg # Some other compiler argument. 1961943345d3Smrg *) 1962943345d3Smrg # Unknown arguments in both finalize_command and compile_command need 1963943345d3Smrg # to be aesthetically quoted because they are evaled later. 1964943345d3Smrg arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` 1965943345d3Smrg case $arg in 1966943345d3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 1967943345d3Smrg arg="\"$arg\"" 1968943345d3Smrg ;; 1969943345d3Smrg esac 1970943345d3Smrg ;; 1971943345d3Smrg esac # arg 1972943345d3Smrg 1973943345d3Smrg # Now actually substitute the argument into the commands. 1974943345d3Smrg if test -n "$arg"; then 1975943345d3Smrg compile_command="$compile_command $arg" 1976943345d3Smrg finalize_command="$finalize_command $arg" 1977943345d3Smrg fi 1978943345d3Smrg done # argument parsing loop 1979943345d3Smrg 1980943345d3Smrg if test -n "$prev"; then 1981943345d3Smrg $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 1982943345d3Smrg $echo "$help" 1>&2 1983943345d3Smrg exit $EXIT_FAILURE 1984943345d3Smrg fi 1985943345d3Smrg 1986943345d3Smrg if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then 1987943345d3Smrg eval arg=\"$export_dynamic_flag_spec\" 1988943345d3Smrg compile_command="$compile_command $arg" 1989943345d3Smrg finalize_command="$finalize_command $arg" 1990943345d3Smrg fi 1991943345d3Smrg 1992943345d3Smrg oldlibs= 1993943345d3Smrg # calculate the name of the file, without its directory 1994943345d3Smrg outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` 1995943345d3Smrg libobjs_save="$libobjs" 1996943345d3Smrg 1997943345d3Smrg if test -n "$shlibpath_var"; then 1998943345d3Smrg # get the directories listed in $shlibpath_var 1999943345d3Smrg eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` 2000943345d3Smrg else 2001943345d3Smrg shlib_search_path= 2002943345d3Smrg fi 2003943345d3Smrg eval sys_lib_search_path=\"$sys_lib_search_path_spec\" 2004943345d3Smrg eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" 2005943345d3Smrg 2006943345d3Smrg output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` 2007943345d3Smrg if test "X$output_objdir" = "X$output"; then 2008943345d3Smrg output_objdir="$objdir" 2009943345d3Smrg else 2010943345d3Smrg output_objdir="$output_objdir/$objdir" 2011943345d3Smrg fi 2012943345d3Smrg # Create the object directory. 2013943345d3Smrg if test ! -d "$output_objdir"; then 2014943345d3Smrg $show "$mkdir $output_objdir" 2015943345d3Smrg $run $mkdir $output_objdir 2016943345d3Smrg exit_status=$? 2017943345d3Smrg if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then 2018943345d3Smrg exit $exit_status 2019943345d3Smrg fi 2020943345d3Smrg fi 2021943345d3Smrg 2022943345d3Smrg # Determine the type of output 2023943345d3Smrg case $output in 2024943345d3Smrg "") 2025943345d3Smrg $echo "$modename: you must specify an output file" 1>&2 2026943345d3Smrg $echo "$help" 1>&2 2027943345d3Smrg exit $EXIT_FAILURE 2028943345d3Smrg ;; 2029943345d3Smrg *.$libext) linkmode=oldlib ;; 2030943345d3Smrg *.lo | *.$objext) linkmode=obj ;; 2031943345d3Smrg *.la) linkmode=lib ;; 2032943345d3Smrg *) linkmode=prog ;; # Anything else should be a program. 2033943345d3Smrg esac 2034943345d3Smrg 2035943345d3Smrg case $host in 2036943345d3Smrg *cygwin* | *mingw* | *pw32*) 2037943345d3Smrg # don't eliminate duplications in $postdeps and $predeps 2038943345d3Smrg duplicate_compiler_generated_deps=yes 2039943345d3Smrg ;; 2040943345d3Smrg *) 2041943345d3Smrg duplicate_compiler_generated_deps=$duplicate_deps 2042943345d3Smrg ;; 2043943345d3Smrg esac 2044943345d3Smrg specialdeplibs= 2045943345d3Smrg 2046943345d3Smrg libs= 2047943345d3Smrg # Find all interdependent deplibs by searching for libraries 2048943345d3Smrg # that are linked more than once (e.g. -la -lb -la) 2049943345d3Smrg for deplib in $deplibs; do 2050943345d3Smrg if test "X$duplicate_deps" = "Xyes" ; then 2051943345d3Smrg case "$libs " in 2052943345d3Smrg *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; 2053943345d3Smrg esac 2054943345d3Smrg fi 2055943345d3Smrg libs="$libs $deplib" 2056943345d3Smrg done 2057943345d3Smrg 2058943345d3Smrg if test "$linkmode" = lib; then 2059943345d3Smrg libs="$predeps $libs $compiler_lib_search_path $postdeps" 2060943345d3Smrg 2061943345d3Smrg # Compute libraries that are listed more than once in $predeps 2062943345d3Smrg # $postdeps and mark them as special (i.e., whose duplicates are 2063943345d3Smrg # not to be eliminated). 2064943345d3Smrg pre_post_deps= 2065943345d3Smrg if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then 2066943345d3Smrg for pre_post_dep in $predeps $postdeps; do 2067943345d3Smrg case "$pre_post_deps " in 2068943345d3Smrg *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; 2069943345d3Smrg esac 2070943345d3Smrg pre_post_deps="$pre_post_deps $pre_post_dep" 2071943345d3Smrg done 2072943345d3Smrg fi 2073943345d3Smrg pre_post_deps= 2074943345d3Smrg fi 2075943345d3Smrg 2076943345d3Smrg deplibs= 2077943345d3Smrg newdependency_libs= 2078943345d3Smrg newlib_search_path= 2079943345d3Smrg need_relink=no # whether we're linking any uninstalled libtool libraries 2080943345d3Smrg notinst_deplibs= # not-installed libtool libraries 2081943345d3Smrg case $linkmode in 2082943345d3Smrg lib) 2083943345d3Smrg passes="conv link" 2084943345d3Smrg for file in $dlfiles $dlprefiles; do 2085943345d3Smrg case $file in 2086943345d3Smrg *.la) ;; 2087943345d3Smrg *) 2088943345d3Smrg $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 2089943345d3Smrg exit $EXIT_FAILURE 2090943345d3Smrg ;; 2091943345d3Smrg esac 2092943345d3Smrg done 2093943345d3Smrg ;; 2094943345d3Smrg prog) 2095943345d3Smrg compile_deplibs= 2096943345d3Smrg finalize_deplibs= 2097943345d3Smrg alldeplibs=no 2098943345d3Smrg newdlfiles= 2099943345d3Smrg newdlprefiles= 2100943345d3Smrg passes="conv scan dlopen dlpreopen link" 2101943345d3Smrg ;; 2102943345d3Smrg *) passes="conv" 2103943345d3Smrg ;; 2104943345d3Smrg esac 2105943345d3Smrg for pass in $passes; do 2106943345d3Smrg if test "$linkmode,$pass" = "lib,link" || 2107943345d3Smrg test "$linkmode,$pass" = "prog,scan"; then 2108943345d3Smrg libs="$deplibs" 2109943345d3Smrg deplibs= 2110943345d3Smrg fi 2111943345d3Smrg if test "$linkmode" = prog; then 2112943345d3Smrg case $pass in 2113943345d3Smrg dlopen) libs="$dlfiles" ;; 2114943345d3Smrg dlpreopen) libs="$dlprefiles" ;; 2115943345d3Smrg link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; 2116943345d3Smrg esac 2117943345d3Smrg fi 2118943345d3Smrg if test "$pass" = dlopen; then 2119943345d3Smrg # Collect dlpreopened libraries 2120943345d3Smrg save_deplibs="$deplibs" 2121943345d3Smrg deplibs= 2122943345d3Smrg fi 2123943345d3Smrg for deplib in $libs; do 2124943345d3Smrg lib= 2125943345d3Smrg found=no 2126943345d3Smrg case $deplib in 2127943345d3Smrg -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) 2128943345d3Smrg if test "$linkmode,$pass" = "prog,link"; then 2129943345d3Smrg compile_deplibs="$deplib $compile_deplibs" 2130943345d3Smrg finalize_deplibs="$deplib $finalize_deplibs" 2131943345d3Smrg else 2132943345d3Smrg compiler_flags="$compiler_flags $deplib" 2133943345d3Smrg fi 2134943345d3Smrg continue 2135943345d3Smrg ;; 2136943345d3Smrg -l*) 2137943345d3Smrg if test "$linkmode" != lib && test "$linkmode" != prog; then 2138943345d3Smrg $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 2139943345d3Smrg continue 2140943345d3Smrg fi 2141943345d3Smrg name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` 2142943345d3Smrg for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do 2143943345d3Smrg for search_ext in .la $std_shrext .so .a; do 2144943345d3Smrg # Search the libtool library 2145943345d3Smrg lib="$searchdir/lib${name}${search_ext}" 2146943345d3Smrg if test -f "$lib"; then 2147943345d3Smrg if test "$search_ext" = ".la"; then 2148943345d3Smrg found=yes 2149943345d3Smrg else 2150943345d3Smrg found=no 2151943345d3Smrg fi 2152943345d3Smrg break 2 2153943345d3Smrg fi 2154943345d3Smrg done 2155943345d3Smrg done 2156943345d3Smrg if test "$found" != yes; then 2157943345d3Smrg # deplib doesn't seem to be a libtool library 2158943345d3Smrg if test "$linkmode,$pass" = "prog,link"; then 2159943345d3Smrg compile_deplibs="$deplib $compile_deplibs" 2160943345d3Smrg finalize_deplibs="$deplib $finalize_deplibs" 2161943345d3Smrg else 2162943345d3Smrg deplibs="$deplib $deplibs" 2163943345d3Smrg test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" 2164943345d3Smrg fi 2165943345d3Smrg continue 2166943345d3Smrg else # deplib is a libtool library 2167943345d3Smrg # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, 2168943345d3Smrg # We need to do some special things here, and not later. 2169943345d3Smrg if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 2170943345d3Smrg case " $predeps $postdeps " in 2171943345d3Smrg *" $deplib "*) 2172943345d3Smrg if (${SED} -e '2q' $lib | 2173943345d3Smrg grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 2174943345d3Smrg library_names= 2175943345d3Smrg old_library= 2176943345d3Smrg case $lib in 2177943345d3Smrg */* | *\\*) . $lib ;; 2178943345d3Smrg *) . ./$lib ;; 2179943345d3Smrg esac 2180943345d3Smrg for l in $old_library $library_names; do 2181943345d3Smrg ll="$l" 2182943345d3Smrg done 2183943345d3Smrg if test "X$ll" = "X$old_library" ; then # only static version available 2184943345d3Smrg found=no 2185943345d3Smrg ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` 2186943345d3Smrg test "X$ladir" = "X$lib" && ladir="." 2187943345d3Smrg lib=$ladir/$old_library 2188943345d3Smrg if test "$linkmode,$pass" = "prog,link"; then 2189943345d3Smrg compile_deplibs="$deplib $compile_deplibs" 2190943345d3Smrg finalize_deplibs="$deplib $finalize_deplibs" 2191943345d3Smrg else 2192943345d3Smrg deplibs="$deplib $deplibs" 2193943345d3Smrg test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" 2194943345d3Smrg fi 2195943345d3Smrg continue 2196943345d3Smrg fi 2197943345d3Smrg fi 2198943345d3Smrg ;; 2199943345d3Smrg *) ;; 2200943345d3Smrg esac 2201943345d3Smrg fi 2202943345d3Smrg fi 2203943345d3Smrg ;; # -l 2204943345d3Smrg -L*) 2205943345d3Smrg case $linkmode in 2206943345d3Smrg lib) 2207943345d3Smrg deplibs="$deplib $deplibs" 2208943345d3Smrg test "$pass" = conv && continue 2209943345d3Smrg newdependency_libs="$deplib $newdependency_libs" 2210943345d3Smrg newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` 2211943345d3Smrg ;; 2212943345d3Smrg prog) 2213943345d3Smrg if test "$pass" = conv; then 2214943345d3Smrg deplibs="$deplib $deplibs" 2215943345d3Smrg continue 2216943345d3Smrg fi 2217943345d3Smrg if test "$pass" = scan; then 2218943345d3Smrg deplibs="$deplib $deplibs" 2219943345d3Smrg else 2220943345d3Smrg compile_deplibs="$deplib $compile_deplibs" 2221943345d3Smrg finalize_deplibs="$deplib $finalize_deplibs" 2222943345d3Smrg fi 2223943345d3Smrg newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` 2224943345d3Smrg ;; 2225943345d3Smrg *) 2226943345d3Smrg $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 2227943345d3Smrg ;; 2228943345d3Smrg esac # linkmode 2229943345d3Smrg continue 2230943345d3Smrg ;; # -L 2231943345d3Smrg -R*) 2232943345d3Smrg if test "$pass" = link; then 2233943345d3Smrg dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` 2234943345d3Smrg # Make sure the xrpath contains only unique directories. 2235943345d3Smrg case "$xrpath " in 2236943345d3Smrg *" $dir "*) ;; 2237943345d3Smrg *) xrpath="$xrpath $dir" ;; 2238943345d3Smrg esac 2239943345d3Smrg fi 2240943345d3Smrg deplibs="$deplib $deplibs" 2241943345d3Smrg continue 2242943345d3Smrg ;; 2243943345d3Smrg *.la) lib="$deplib" ;; 2244943345d3Smrg *.$libext) 2245943345d3Smrg if test "$pass" = conv; then 2246943345d3Smrg deplibs="$deplib $deplibs" 2247943345d3Smrg continue 2248943345d3Smrg fi 2249943345d3Smrg case $linkmode in 2250943345d3Smrg lib) 2251943345d3Smrg valid_a_lib=no 2252943345d3Smrg case $deplibs_check_method in 2253943345d3Smrg match_pattern*) 2254943345d3Smrg set dummy $deplibs_check_method 2255943345d3Smrg match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 2256943345d3Smrg if eval $echo \"$deplib\" 2>/dev/null \ 2257943345d3Smrg | $SED 10q \ 2258943345d3Smrg | $EGREP "$match_pattern_regex" > /dev/null; then 2259943345d3Smrg valid_a_lib=yes 2260943345d3Smrg fi 2261943345d3Smrg ;; 2262943345d3Smrg pass_all) 2263943345d3Smrg valid_a_lib=yes 2264943345d3Smrg ;; 2265943345d3Smrg esac 2266943345d3Smrg if test "$valid_a_lib" != yes; then 2267943345d3Smrg $echo 2268943345d3Smrg $echo "*** Warning: Trying to link with static lib archive $deplib." 2269943345d3Smrg $echo "*** I have the capability to make that library automatically link in when" 2270943345d3Smrg $echo "*** you link to this library. But I can only do this if you have a" 2271943345d3Smrg $echo "*** shared version of the library, which you do not appear to have" 2272943345d3Smrg $echo "*** because the file extensions .$libext of this argument makes me believe" 2273943345d3Smrg $echo "*** that it is just a static archive that I should not used here." 2274943345d3Smrg else 2275943345d3Smrg $echo 2276943345d3Smrg $echo "*** Warning: Linking the shared library $output against the" 2277943345d3Smrg $echo "*** static library $deplib is not portable!" 2278943345d3Smrg deplibs="$deplib $deplibs" 2279943345d3Smrg fi 2280943345d3Smrg continue 2281943345d3Smrg ;; 2282943345d3Smrg prog) 2283943345d3Smrg if test "$pass" != link; then 2284943345d3Smrg deplibs="$deplib $deplibs" 2285943345d3Smrg else 2286943345d3Smrg compile_deplibs="$deplib $compile_deplibs" 2287943345d3Smrg finalize_deplibs="$deplib $finalize_deplibs" 2288943345d3Smrg fi 2289943345d3Smrg continue 2290943345d3Smrg ;; 2291943345d3Smrg esac # linkmode 2292943345d3Smrg ;; # *.$libext 2293943345d3Smrg *.lo | *.$objext) 2294943345d3Smrg if test "$pass" = conv; then 2295943345d3Smrg deplibs="$deplib $deplibs" 2296943345d3Smrg elif test "$linkmode" = prog; then 2297943345d3Smrg if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then 2298943345d3Smrg # If there is no dlopen support or we're linking statically, 2299943345d3Smrg # we need to preload. 2300943345d3Smrg newdlprefiles="$newdlprefiles $deplib" 2301943345d3Smrg compile_deplibs="$deplib $compile_deplibs" 2302943345d3Smrg finalize_deplibs="$deplib $finalize_deplibs" 2303943345d3Smrg else 2304943345d3Smrg newdlfiles="$newdlfiles $deplib" 2305943345d3Smrg fi 2306943345d3Smrg fi 2307943345d3Smrg continue 2308943345d3Smrg ;; 2309943345d3Smrg %DEPLIBS%) 2310943345d3Smrg alldeplibs=yes 2311943345d3Smrg continue 2312943345d3Smrg ;; 2313943345d3Smrg esac # case $deplib 2314943345d3Smrg if test "$found" = yes || test -f "$lib"; then : 2315943345d3Smrg else 2316943345d3Smrg $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 2317943345d3Smrg exit $EXIT_FAILURE 2318943345d3Smrg fi 2319943345d3Smrg 2320943345d3Smrg # Check to see that this really is a libtool archive. 2321943345d3Smrg if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : 2322943345d3Smrg else 2323943345d3Smrg $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 2324943345d3Smrg exit $EXIT_FAILURE 2325943345d3Smrg fi 2326943345d3Smrg 2327943345d3Smrg ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` 2328943345d3Smrg test "X$ladir" = "X$lib" && ladir="." 2329943345d3Smrg 2330943345d3Smrg dlname= 2331943345d3Smrg dlopen= 2332943345d3Smrg dlpreopen= 2333943345d3Smrg libdir= 2334943345d3Smrg library_names= 2335943345d3Smrg old_library= 2336943345d3Smrg # If the library was installed with an old release of libtool, 2337943345d3Smrg # it will not redefine variables installed, or shouldnotlink 2338943345d3Smrg installed=yes 2339943345d3Smrg shouldnotlink=no 2340943345d3Smrg avoidtemprpath= 2341943345d3Smrg 2342943345d3Smrg 2343943345d3Smrg # Read the .la file 2344943345d3Smrg case $lib in 2345943345d3Smrg */* | *\\*) . $lib ;; 2346943345d3Smrg *) . ./$lib ;; 2347943345d3Smrg esac 2348943345d3Smrg 2349943345d3Smrg if test "$linkmode,$pass" = "lib,link" || 2350943345d3Smrg test "$linkmode,$pass" = "prog,scan" || 2351943345d3Smrg { test "$linkmode" != prog && test "$linkmode" != lib; }; then 2352943345d3Smrg test -n "$dlopen" && dlfiles="$dlfiles $dlopen" 2353943345d3Smrg test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" 2354943345d3Smrg fi 2355943345d3Smrg 2356943345d3Smrg if test "$pass" = conv; then 2357943345d3Smrg # Only check for convenience libraries 2358943345d3Smrg deplibs="$lib $deplibs" 2359943345d3Smrg if test -z "$libdir"; then 2360943345d3Smrg if test -z "$old_library"; then 2361943345d3Smrg $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 2362943345d3Smrg exit $EXIT_FAILURE 2363943345d3Smrg fi 2364943345d3Smrg # It is a libtool convenience library, so add in its objects. 2365943345d3Smrg convenience="$convenience $ladir/$objdir/$old_library" 2366943345d3Smrg old_convenience="$old_convenience $ladir/$objdir/$old_library" 2367943345d3Smrg tmp_libs= 2368943345d3Smrg for deplib in $dependency_libs; do 2369943345d3Smrg deplibs="$deplib $deplibs" 2370943345d3Smrg if test "X$duplicate_deps" = "Xyes" ; then 2371943345d3Smrg case "$tmp_libs " in 2372943345d3Smrg *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; 2373943345d3Smrg esac 2374943345d3Smrg fi 2375943345d3Smrg tmp_libs="$tmp_libs $deplib" 2376943345d3Smrg done 2377943345d3Smrg elif test "$linkmode" != prog && test "$linkmode" != lib; then 2378943345d3Smrg $echo "$modename: \`$lib' is not a convenience library" 1>&2 2379943345d3Smrg exit $EXIT_FAILURE 2380943345d3Smrg fi 2381943345d3Smrg continue 2382943345d3Smrg fi # $pass = conv 2383943345d3Smrg 2384943345d3Smrg 2385943345d3Smrg # Get the name of the library we link against. 2386943345d3Smrg linklib= 2387943345d3Smrg for l in $old_library $library_names; do 2388943345d3Smrg linklib="$l" 2389943345d3Smrg done 2390943345d3Smrg if test -z "$linklib"; then 2391943345d3Smrg $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 2392943345d3Smrg exit $EXIT_FAILURE 2393943345d3Smrg fi 2394943345d3Smrg 2395943345d3Smrg # This library was specified with -dlopen. 2396943345d3Smrg if test "$pass" = dlopen; then 2397943345d3Smrg if test -z "$libdir"; then 2398943345d3Smrg $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 2399943345d3Smrg exit $EXIT_FAILURE 2400943345d3Smrg fi 2401943345d3Smrg if test -z "$dlname" || 2402943345d3Smrg test "$dlopen_support" != yes || 2403943345d3Smrg test "$build_libtool_libs" = no; then 2404943345d3Smrg # If there is no dlname, no dlopen support or we're linking 2405943345d3Smrg # statically, we need to preload. We also need to preload any 2406943345d3Smrg # dependent libraries so libltdl's deplib preloader doesn't 2407943345d3Smrg # bomb out in the load deplibs phase. 2408943345d3Smrg dlprefiles="$dlprefiles $lib $dependency_libs" 2409943345d3Smrg else 2410943345d3Smrg newdlfiles="$newdlfiles $lib" 2411943345d3Smrg fi 2412943345d3Smrg continue 2413943345d3Smrg fi # $pass = dlopen 2414943345d3Smrg 2415943345d3Smrg # We need an absolute path. 2416943345d3Smrg case $ladir in 2417943345d3Smrg [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; 2418943345d3Smrg *) 2419943345d3Smrg abs_ladir=`cd "$ladir" && pwd` 2420943345d3Smrg if test -z "$abs_ladir"; then 2421943345d3Smrg $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 2422943345d3Smrg $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 2423943345d3Smrg abs_ladir="$ladir" 2424943345d3Smrg fi 2425943345d3Smrg ;; 2426943345d3Smrg esac 2427943345d3Smrg laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` 2428943345d3Smrg 2429943345d3Smrg # Find the relevant object directory and library name. 2430943345d3Smrg if test "X$installed" = Xyes; then 2431943345d3Smrg if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then 2432943345d3Smrg $echo "$modename: warning: library \`$lib' was moved." 1>&2 2433943345d3Smrg dir="$ladir" 2434943345d3Smrg absdir="$abs_ladir" 2435943345d3Smrg libdir="$abs_ladir" 2436943345d3Smrg else 2437943345d3Smrg dir="$libdir" 2438943345d3Smrg absdir="$libdir" 2439943345d3Smrg fi 2440943345d3Smrg test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes 2441943345d3Smrg else 2442943345d3Smrg if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then 2443943345d3Smrg dir="$ladir" 2444943345d3Smrg absdir="$abs_ladir" 2445943345d3Smrg # Remove this search path later 2446943345d3Smrg notinst_path="$notinst_path $abs_ladir" 2447943345d3Smrg else 2448943345d3Smrg dir="$ladir/$objdir" 2449943345d3Smrg absdir="$abs_ladir/$objdir" 2450943345d3Smrg # Remove this search path later 2451943345d3Smrg notinst_path="$notinst_path $abs_ladir" 2452943345d3Smrg fi 2453943345d3Smrg fi # $installed = yes 2454943345d3Smrg name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` 2455943345d3Smrg 2456943345d3Smrg # This library was specified with -dlpreopen. 2457943345d3Smrg if test "$pass" = dlpreopen; then 2458943345d3Smrg if test -z "$libdir"; then 2459943345d3Smrg $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 2460943345d3Smrg exit $EXIT_FAILURE 2461943345d3Smrg fi 2462943345d3Smrg # Prefer using a static library (so that no silly _DYNAMIC symbols 2463943345d3Smrg # are required to link). 2464943345d3Smrg if test -n "$old_library"; then 2465943345d3Smrg newdlprefiles="$newdlprefiles $dir/$old_library" 2466943345d3Smrg # Otherwise, use the dlname, so that lt_dlopen finds it. 2467943345d3Smrg elif test -n "$dlname"; then 2468943345d3Smrg newdlprefiles="$newdlprefiles $dir/$dlname" 2469943345d3Smrg else 2470943345d3Smrg newdlprefiles="$newdlprefiles $dir/$linklib" 2471943345d3Smrg fi 2472943345d3Smrg fi # $pass = dlpreopen 2473943345d3Smrg 2474943345d3Smrg if test -z "$libdir"; then 2475943345d3Smrg # Link the convenience library 2476943345d3Smrg if test "$linkmode" = lib; then 2477943345d3Smrg deplibs="$dir/$old_library $deplibs" 2478943345d3Smrg elif test "$linkmode,$pass" = "prog,link"; then 2479943345d3Smrg compile_deplibs="$dir/$old_library $compile_deplibs" 2480943345d3Smrg finalize_deplibs="$dir/$old_library $finalize_deplibs" 2481943345d3Smrg else 2482943345d3Smrg deplibs="$lib $deplibs" # used for prog,scan pass 2483943345d3Smrg fi 2484943345d3Smrg continue 2485943345d3Smrg fi 2486943345d3Smrg 2487943345d3Smrg 2488943345d3Smrg if test "$linkmode" = prog && test "$pass" != link; then 2489943345d3Smrg newlib_search_path="$newlib_search_path $ladir" 2490943345d3Smrg deplibs="$lib $deplibs" 2491943345d3Smrg 2492943345d3Smrg linkalldeplibs=no 2493943345d3Smrg if test "$link_all_deplibs" != no || test -z "$library_names" || 2494943345d3Smrg test "$build_libtool_libs" = no; then 2495943345d3Smrg linkalldeplibs=yes 2496943345d3Smrg fi 2497943345d3Smrg 2498943345d3Smrg tmp_libs= 2499943345d3Smrg for deplib in $dependency_libs; do 2500943345d3Smrg case $deplib in 2501943345d3Smrg -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test 2502943345d3Smrg esac 2503943345d3Smrg # Need to link against all dependency_libs? 2504943345d3Smrg if test "$linkalldeplibs" = yes; then 2505943345d3Smrg deplibs="$deplib $deplibs" 2506943345d3Smrg else 2507943345d3Smrg # Need to hardcode shared library paths 2508943345d3Smrg # or/and link against static libraries 2509943345d3Smrg newdependency_libs="$deplib $newdependency_libs" 2510943345d3Smrg fi 2511943345d3Smrg if test "X$duplicate_deps" = "Xyes" ; then 2512943345d3Smrg case "$tmp_libs " in 2513943345d3Smrg *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; 2514943345d3Smrg esac 2515943345d3Smrg fi 2516943345d3Smrg tmp_libs="$tmp_libs $deplib" 2517943345d3Smrg done # for deplib 2518943345d3Smrg continue 2519943345d3Smrg fi # $linkmode = prog... 2520943345d3Smrg 2521943345d3Smrg if test "$linkmode,$pass" = "prog,link"; then 2522943345d3Smrg if test -n "$library_names" && 2523f67b85aaSmrg { { test "$prefer_static_libs" = no || 2524f67b85aaSmrg test "$prefer_static_libs,$installed" = "built,yes"; } || 2525f67b85aaSmrg test -z "$old_library"; }; then 2526943345d3Smrg # We need to hardcode the library path 2527943345d3Smrg if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then 2528943345d3Smrg # Make sure the rpath contains only unique directories. 2529943345d3Smrg case "$temp_rpath " in 2530943345d3Smrg *" $dir "*) ;; 2531943345d3Smrg *" $absdir "*) ;; 2532943345d3Smrg *) temp_rpath="$temp_rpath $absdir" ;; 2533943345d3Smrg esac 2534943345d3Smrg fi 2535943345d3Smrg 2536943345d3Smrg # Hardcode the library path. 2537943345d3Smrg # Skip directories that are in the system default run-time 2538943345d3Smrg # search path. 2539943345d3Smrg case " $sys_lib_dlsearch_path " in 2540943345d3Smrg *" $absdir "*) ;; 2541943345d3Smrg *) 2542943345d3Smrg case "$compile_rpath " in 2543943345d3Smrg *" $absdir "*) ;; 2544943345d3Smrg *) compile_rpath="$compile_rpath $absdir" 2545943345d3Smrg esac 2546943345d3Smrg ;; 2547943345d3Smrg esac 2548943345d3Smrg case " $sys_lib_dlsearch_path " in 2549943345d3Smrg *" $libdir "*) ;; 2550943345d3Smrg *) 2551943345d3Smrg case "$finalize_rpath " in 2552943345d3Smrg *" $libdir "*) ;; 2553943345d3Smrg *) finalize_rpath="$finalize_rpath $libdir" 2554943345d3Smrg esac 2555943345d3Smrg ;; 2556943345d3Smrg esac 2557943345d3Smrg fi # $linkmode,$pass = prog,link... 2558943345d3Smrg 2559943345d3Smrg if test "$alldeplibs" = yes && 2560943345d3Smrg { test "$deplibs_check_method" = pass_all || 2561943345d3Smrg { test "$build_libtool_libs" = yes && 2562943345d3Smrg test -n "$library_names"; }; }; then 2563943345d3Smrg # We only need to search for static libraries 2564943345d3Smrg continue 2565943345d3Smrg fi 2566943345d3Smrg fi 2567943345d3Smrg 2568943345d3Smrg link_static=no # Whether the deplib will be linked statically 2569943345d3Smrg use_static_libs=$prefer_static_libs 2570943345d3Smrg if test "$use_static_libs" = built && test "$installed" = yes ; then 2571943345d3Smrg use_static_libs=no 2572943345d3Smrg fi 2573943345d3Smrg if test -n "$library_names" && 2574943345d3Smrg { test "$use_static_libs" = no || test -z "$old_library"; }; then 2575943345d3Smrg if test "$installed" = no; then 2576943345d3Smrg notinst_deplibs="$notinst_deplibs $lib" 2577943345d3Smrg need_relink=yes 2578943345d3Smrg fi 2579943345d3Smrg # This is a shared library 2580943345d3Smrg 2581943345d3Smrg # Warn about portability, can't link against -module's on 2582943345d3Smrg # some systems (darwin) 2583943345d3Smrg if test "$shouldnotlink" = yes && test "$pass" = link ; then 2584943345d3Smrg $echo 2585943345d3Smrg if test "$linkmode" = prog; then 2586943345d3Smrg $echo "*** Warning: Linking the executable $output against the loadable module" 2587943345d3Smrg else 2588943345d3Smrg $echo "*** Warning: Linking the shared library $output against the loadable module" 2589943345d3Smrg fi 2590943345d3Smrg $echo "*** $linklib is not portable!" 2591943345d3Smrg fi 2592943345d3Smrg if test "$linkmode" = lib && 2593943345d3Smrg test "$hardcode_into_libs" = yes; then 2594943345d3Smrg # Hardcode the library path. 2595943345d3Smrg # Skip directories that are in the system default run-time 2596943345d3Smrg # search path. 2597943345d3Smrg case " $sys_lib_dlsearch_path " in 2598943345d3Smrg *" $absdir "*) ;; 2599943345d3Smrg *) 2600943345d3Smrg case "$compile_rpath " in 2601943345d3Smrg *" $absdir "*) ;; 2602943345d3Smrg *) compile_rpath="$compile_rpath $absdir" 2603943345d3Smrg esac 2604943345d3Smrg ;; 2605943345d3Smrg esac 2606943345d3Smrg case " $sys_lib_dlsearch_path " in 2607943345d3Smrg *" $libdir "*) ;; 2608943345d3Smrg *) 2609943345d3Smrg case "$finalize_rpath " in 2610943345d3Smrg *" $libdir "*) ;; 2611943345d3Smrg *) finalize_rpath="$finalize_rpath $libdir" 2612943345d3Smrg esac 2613943345d3Smrg ;; 2614943345d3Smrg esac 2615943345d3Smrg fi 2616943345d3Smrg 2617943345d3Smrg if test -n "$old_archive_from_expsyms_cmds"; then 2618943345d3Smrg # figure out the soname 2619943345d3Smrg set dummy $library_names 2620943345d3Smrg realname="$2" 2621943345d3Smrg shift; shift 2622943345d3Smrg libname=`eval \\$echo \"$libname_spec\"` 2623943345d3Smrg # use dlname if we got it. it's perfectly good, no? 2624943345d3Smrg if test -n "$dlname"; then 2625943345d3Smrg soname="$dlname" 2626943345d3Smrg elif test -n "$soname_spec"; then 2627943345d3Smrg # bleh windows 2628943345d3Smrg case $host in 2629943345d3Smrg *cygwin* | mingw*) 2630943345d3Smrg major=`expr $current - $age` 2631943345d3Smrg versuffix="-$major" 2632943345d3Smrg ;; 2633943345d3Smrg esac 2634943345d3Smrg eval soname=\"$soname_spec\" 2635943345d3Smrg else 2636943345d3Smrg soname="$realname" 2637943345d3Smrg fi 2638943345d3Smrg 2639943345d3Smrg # Make a new name for the extract_expsyms_cmds to use 2640943345d3Smrg soroot="$soname" 2641943345d3Smrg soname=`$echo $soroot | ${SED} -e 's/^.*\///'` 2642943345d3Smrg newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" 2643943345d3Smrg 2644943345d3Smrg # If the library has no export list, then create one now 2645943345d3Smrg if test -f "$output_objdir/$soname-def"; then : 2646943345d3Smrg else 2647943345d3Smrg $show "extracting exported symbol list from \`$soname'" 2648943345d3Smrg save_ifs="$IFS"; IFS='~' 2649943345d3Smrg cmds=$extract_expsyms_cmds 2650943345d3Smrg for cmd in $cmds; do 2651943345d3Smrg IFS="$save_ifs" 2652943345d3Smrg eval cmd=\"$cmd\" 2653943345d3Smrg $show "$cmd" 2654943345d3Smrg $run eval "$cmd" || exit $? 2655943345d3Smrg done 2656943345d3Smrg IFS="$save_ifs" 2657943345d3Smrg fi 2658943345d3Smrg 2659943345d3Smrg # Create $newlib 2660943345d3Smrg if test -f "$output_objdir/$newlib"; then :; else 2661943345d3Smrg $show "generating import library for \`$soname'" 2662943345d3Smrg save_ifs="$IFS"; IFS='~' 2663943345d3Smrg cmds=$old_archive_from_expsyms_cmds 2664943345d3Smrg for cmd in $cmds; do 2665943345d3Smrg IFS="$save_ifs" 2666943345d3Smrg eval cmd=\"$cmd\" 2667943345d3Smrg $show "$cmd" 2668943345d3Smrg $run eval "$cmd" || exit $? 2669943345d3Smrg done 2670943345d3Smrg IFS="$save_ifs" 2671943345d3Smrg fi 2672943345d3Smrg # make sure the library variables are pointing to the new library 2673943345d3Smrg dir=$output_objdir 2674943345d3Smrg linklib=$newlib 2675943345d3Smrg fi # test -n "$old_archive_from_expsyms_cmds" 2676943345d3Smrg 2677943345d3Smrg if test "$linkmode" = prog || test "$mode" != relink; then 2678943345d3Smrg add_shlibpath= 2679943345d3Smrg add_dir= 2680943345d3Smrg add= 2681943345d3Smrg lib_linked=yes 2682943345d3Smrg case $hardcode_action in 2683943345d3Smrg immediate | unsupported) 2684943345d3Smrg if test "$hardcode_direct" = no; then 2685943345d3Smrg add="$dir/$linklib" 2686943345d3Smrg case $host in 2687943345d3Smrg *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; 2688943345d3Smrg *-*-sysv4*uw2*) add_dir="-L$dir" ;; 2689943345d3Smrg *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ 2690943345d3Smrg *-*-unixware7*) add_dir="-L$dir" ;; 2691943345d3Smrg *-*-darwin* ) 2692943345d3Smrg # if the lib is a module then we can not link against 2693943345d3Smrg # it, someone is ignoring the new warnings I added 2694943345d3Smrg if /usr/bin/file -L $add 2> /dev/null | 2695943345d3Smrg $EGREP ": [^:]* bundle" >/dev/null ; then 2696943345d3Smrg $echo "** Warning, lib $linklib is a module, not a shared library" 2697943345d3Smrg if test -z "$old_library" ; then 2698943345d3Smrg $echo 2699943345d3Smrg $echo "** And there doesn't seem to be a static archive available" 2700943345d3Smrg $echo "** The link will probably fail, sorry" 2701943345d3Smrg else 2702943345d3Smrg add="$dir/$old_library" 2703943345d3Smrg fi 2704943345d3Smrg fi 2705943345d3Smrg esac 2706943345d3Smrg elif test "$hardcode_minus_L" = no; then 2707943345d3Smrg case $host in 2708943345d3Smrg *-*-sunos*) add_shlibpath="$dir" ;; 2709943345d3Smrg esac 2710943345d3Smrg add_dir="-L$dir" 2711943345d3Smrg add="-l$name" 2712943345d3Smrg elif test "$hardcode_shlibpath_var" = no; then 2713943345d3Smrg add_shlibpath="$dir" 2714943345d3Smrg add="-l$name" 2715943345d3Smrg else 2716943345d3Smrg lib_linked=no 2717943345d3Smrg fi 2718943345d3Smrg ;; 2719943345d3Smrg relink) 2720943345d3Smrg if test "$hardcode_direct" = yes; then 2721943345d3Smrg add="$dir/$linklib" 2722943345d3Smrg elif test "$hardcode_minus_L" = yes; then 2723943345d3Smrg add_dir="-L$dir" 2724943345d3Smrg # Try looking first in the location we're being installed to. 2725943345d3Smrg if test -n "$inst_prefix_dir"; then 2726943345d3Smrg case $libdir in 2727943345d3Smrg [\\/]*) 2728943345d3Smrg add_dir="$add_dir -L$inst_prefix_dir$libdir" 2729943345d3Smrg ;; 2730943345d3Smrg esac 2731943345d3Smrg fi 2732943345d3Smrg add="-l$name" 2733943345d3Smrg elif test "$hardcode_shlibpath_var" = yes; then 2734943345d3Smrg add_shlibpath="$dir" 2735943345d3Smrg add="-l$name" 2736943345d3Smrg else 2737943345d3Smrg lib_linked=no 2738943345d3Smrg fi 2739943345d3Smrg ;; 2740943345d3Smrg *) lib_linked=no ;; 2741943345d3Smrg esac 2742943345d3Smrg 2743943345d3Smrg if test "$lib_linked" != yes; then 2744943345d3Smrg $echo "$modename: configuration error: unsupported hardcode properties" 2745943345d3Smrg exit $EXIT_FAILURE 2746943345d3Smrg fi 2747943345d3Smrg 2748943345d3Smrg if test -n "$add_shlibpath"; then 2749943345d3Smrg case :$compile_shlibpath: in 2750943345d3Smrg *":$add_shlibpath:"*) ;; 2751943345d3Smrg *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; 2752943345d3Smrg esac 2753943345d3Smrg fi 2754943345d3Smrg if test "$linkmode" = prog; then 2755943345d3Smrg test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" 2756943345d3Smrg test -n "$add" && compile_deplibs="$add $compile_deplibs" 2757943345d3Smrg else 2758943345d3Smrg test -n "$add_dir" && deplibs="$add_dir $deplibs" 2759943345d3Smrg test -n "$add" && deplibs="$add $deplibs" 2760943345d3Smrg if test "$hardcode_direct" != yes && \ 2761943345d3Smrg test "$hardcode_minus_L" != yes && \ 2762943345d3Smrg test "$hardcode_shlibpath_var" = yes; then 2763943345d3Smrg case :$finalize_shlibpath: in 2764943345d3Smrg *":$libdir:"*) ;; 2765943345d3Smrg *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; 2766943345d3Smrg esac 2767943345d3Smrg fi 2768943345d3Smrg fi 2769943345d3Smrg fi 2770943345d3Smrg 2771943345d3Smrg if test "$linkmode" = prog || test "$mode" = relink; then 2772943345d3Smrg add_shlibpath= 2773943345d3Smrg add_dir= 2774943345d3Smrg add= 2775943345d3Smrg # Finalize command for both is simple: just hardcode it. 2776943345d3Smrg if test "$hardcode_direct" = yes; then 2777943345d3Smrg add="$libdir/$linklib" 2778943345d3Smrg elif test "$hardcode_minus_L" = yes; then 2779943345d3Smrg add_dir="-L$libdir" 2780943345d3Smrg add="-l$name" 2781943345d3Smrg elif test "$hardcode_shlibpath_var" = yes; then 2782943345d3Smrg case :$finalize_shlibpath: in 2783943345d3Smrg *":$libdir:"*) ;; 2784943345d3Smrg *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; 2785943345d3Smrg esac 2786943345d3Smrg add="-l$name" 2787943345d3Smrg elif test "$hardcode_automatic" = yes; then 2788943345d3Smrg if test -n "$inst_prefix_dir" && 2789943345d3Smrg test -f "$inst_prefix_dir$libdir/$linklib" ; then 2790943345d3Smrg add="$inst_prefix_dir$libdir/$linklib" 2791943345d3Smrg else 2792943345d3Smrg add="$libdir/$linklib" 2793943345d3Smrg fi 2794943345d3Smrg else 2795943345d3Smrg # We cannot seem to hardcode it, guess we'll fake it. 2796943345d3Smrg add_dir="-L$libdir" 2797943345d3Smrg # Try looking first in the location we're being installed to. 2798943345d3Smrg if test -n "$inst_prefix_dir"; then 2799943345d3Smrg case $libdir in 2800943345d3Smrg [\\/]*) 2801943345d3Smrg add_dir="$add_dir -L$inst_prefix_dir$libdir" 2802943345d3Smrg ;; 2803943345d3Smrg esac 2804943345d3Smrg fi 2805943345d3Smrg add="-l$name" 2806943345d3Smrg fi 2807943345d3Smrg 2808943345d3Smrg if test "$linkmode" = prog; then 2809943345d3Smrg test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" 2810943345d3Smrg test -n "$add" && finalize_deplibs="$add $finalize_deplibs" 2811943345d3Smrg else 2812943345d3Smrg test -n "$add_dir" && deplibs="$add_dir $deplibs" 2813943345d3Smrg test -n "$add" && deplibs="$add $deplibs" 2814943345d3Smrg fi 2815943345d3Smrg fi 2816943345d3Smrg elif test "$linkmode" = prog; then 2817943345d3Smrg # Here we assume that one of hardcode_direct or hardcode_minus_L 2818943345d3Smrg # is not unsupported. This is valid on all known static and 2819943345d3Smrg # shared platforms. 2820943345d3Smrg if test "$hardcode_direct" != unsupported; then 2821943345d3Smrg test -n "$old_library" && linklib="$old_library" 2822943345d3Smrg compile_deplibs="$dir/$linklib $compile_deplibs" 2823943345d3Smrg finalize_deplibs="$dir/$linklib $finalize_deplibs" 2824943345d3Smrg else 2825943345d3Smrg compile_deplibs="-l$name -L$dir $compile_deplibs" 2826943345d3Smrg finalize_deplibs="-l$name -L$dir $finalize_deplibs" 2827943345d3Smrg fi 2828943345d3Smrg elif test "$build_libtool_libs" = yes; then 2829943345d3Smrg # Not a shared library 2830943345d3Smrg if test "$deplibs_check_method" != pass_all; then 2831943345d3Smrg # We're trying link a shared library against a static one 2832943345d3Smrg # but the system doesn't support it. 2833943345d3Smrg 2834943345d3Smrg # Just print a warning and add the library to dependency_libs so 2835943345d3Smrg # that the program can be linked against the static library. 2836943345d3Smrg $echo 2837943345d3Smrg $echo "*** Warning: This system can not link to static lib archive $lib." 2838943345d3Smrg $echo "*** I have the capability to make that library automatically link in when" 2839943345d3Smrg $echo "*** you link to this library. But I can only do this if you have a" 2840943345d3Smrg $echo "*** shared version of the library, which you do not appear to have." 2841943345d3Smrg if test "$module" = yes; then 2842943345d3Smrg $echo "*** But as you try to build a module library, libtool will still create " 2843943345d3Smrg $echo "*** a static module, that should work as long as the dlopening application" 2844943345d3Smrg $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." 2845943345d3Smrg if test -z "$global_symbol_pipe"; then 2846943345d3Smrg $echo 2847943345d3Smrg $echo "*** However, this would only work if libtool was able to extract symbol" 2848943345d3Smrg $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" 2849943345d3Smrg $echo "*** not find such a program. So, this module is probably useless." 2850943345d3Smrg $echo "*** \`nm' from GNU binutils and a full rebuild may help." 2851943345d3Smrg fi 2852943345d3Smrg if test "$build_old_libs" = no; then 2853943345d3Smrg build_libtool_libs=module 2854943345d3Smrg build_old_libs=yes 2855943345d3Smrg else 2856943345d3Smrg build_libtool_libs=no 2857943345d3Smrg fi 2858943345d3Smrg fi 2859943345d3Smrg else 2860943345d3Smrg deplibs="$dir/$old_library $deplibs" 2861943345d3Smrg link_static=yes 2862943345d3Smrg fi 2863943345d3Smrg fi # link shared/static library? 2864943345d3Smrg 2865943345d3Smrg if test "$linkmode" = lib; then 2866943345d3Smrg if test -n "$dependency_libs" && 2867943345d3Smrg { test "$hardcode_into_libs" != yes || 2868943345d3Smrg test "$build_old_libs" = yes || 2869943345d3Smrg test "$link_static" = yes; }; then 2870943345d3Smrg # Extract -R from dependency_libs 2871943345d3Smrg temp_deplibs= 2872943345d3Smrg for libdir in $dependency_libs; do 2873943345d3Smrg case $libdir in 2874943345d3Smrg -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` 2875943345d3Smrg case " $xrpath " in 2876943345d3Smrg *" $temp_xrpath "*) ;; 2877943345d3Smrg *) xrpath="$xrpath $temp_xrpath";; 2878943345d3Smrg esac;; 2879943345d3Smrg *) temp_deplibs="$temp_deplibs $libdir";; 2880943345d3Smrg esac 2881943345d3Smrg done 2882943345d3Smrg dependency_libs="$temp_deplibs" 2883943345d3Smrg fi 2884943345d3Smrg 2885943345d3Smrg newlib_search_path="$newlib_search_path $absdir" 2886943345d3Smrg # Link against this library 2887943345d3Smrg test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" 2888943345d3Smrg # ... and its dependency_libs 2889943345d3Smrg tmp_libs= 2890943345d3Smrg for deplib in $dependency_libs; do 2891943345d3Smrg newdependency_libs="$deplib $newdependency_libs" 2892943345d3Smrg if test "X$duplicate_deps" = "Xyes" ; then 2893943345d3Smrg case "$tmp_libs " in 2894943345d3Smrg *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; 2895943345d3Smrg esac 2896943345d3Smrg fi 2897943345d3Smrg tmp_libs="$tmp_libs $deplib" 2898943345d3Smrg done 2899943345d3Smrg 2900943345d3Smrg if test "$link_all_deplibs" != no; then 2901943345d3Smrg # Add the search paths of all dependency libraries 2902943345d3Smrg for deplib in $dependency_libs; do 2903943345d3Smrg case $deplib in 2904943345d3Smrg -L*) path="$deplib" ;; 2905943345d3Smrg *.la) 2906943345d3Smrg dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` 2907943345d3Smrg test "X$dir" = "X$deplib" && dir="." 2908943345d3Smrg # We need an absolute path. 2909943345d3Smrg case $dir in 2910943345d3Smrg [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; 2911943345d3Smrg *) 2912943345d3Smrg absdir=`cd "$dir" && pwd` 2913943345d3Smrg if test -z "$absdir"; then 2914943345d3Smrg $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 2915943345d3Smrg absdir="$dir" 2916943345d3Smrg fi 2917943345d3Smrg ;; 2918943345d3Smrg esac 2919943345d3Smrg if grep "^installed=no" $deplib > /dev/null; then 2920943345d3Smrg path="$absdir/$objdir" 2921943345d3Smrg else 2922943345d3Smrg eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` 2923943345d3Smrg if test -z "$libdir"; then 2924943345d3Smrg $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 2925943345d3Smrg exit $EXIT_FAILURE 2926943345d3Smrg fi 2927943345d3Smrg if test "$absdir" != "$libdir"; then 2928943345d3Smrg $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 2929943345d3Smrg fi 2930943345d3Smrg path="$absdir" 2931943345d3Smrg fi 2932943345d3Smrg depdepl= 2933943345d3Smrg case $host in 2934943345d3Smrg *-*-darwin*) 2935943345d3Smrg # we do not want to link against static libs, 2936943345d3Smrg # but need to link against shared 2937943345d3Smrg eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` 2938943345d3Smrg if test -n "$deplibrary_names" ; then 2939943345d3Smrg for tmp in $deplibrary_names ; do 2940943345d3Smrg depdepl=$tmp 2941943345d3Smrg done 2942943345d3Smrg if test -f "$path/$depdepl" ; then 2943943345d3Smrg depdepl="$path/$depdepl" 2944943345d3Smrg fi 2945943345d3Smrg # do not add paths which are already there 2946943345d3Smrg case " $newlib_search_path " in 2947943345d3Smrg *" $path "*) ;; 2948943345d3Smrg *) newlib_search_path="$newlib_search_path $path";; 2949943345d3Smrg esac 2950943345d3Smrg fi 2951943345d3Smrg path="" 2952943345d3Smrg ;; 2953943345d3Smrg *) 2954943345d3Smrg path="-L$path" 2955943345d3Smrg ;; 2956943345d3Smrg esac 2957943345d3Smrg ;; 2958943345d3Smrg -l*) 2959943345d3Smrg case $host in 2960943345d3Smrg *-*-darwin*) 2961943345d3Smrg # Again, we only want to link against shared libraries 2962943345d3Smrg eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` 2963943345d3Smrg for tmp in $newlib_search_path ; do 2964943345d3Smrg if test -f "$tmp/lib$tmp_libs.dylib" ; then 2965943345d3Smrg eval depdepl="$tmp/lib$tmp_libs.dylib" 2966943345d3Smrg break 2967943345d3Smrg fi 2968943345d3Smrg done 2969943345d3Smrg path="" 2970943345d3Smrg ;; 2971943345d3Smrg *) continue ;; 2972943345d3Smrg esac 2973943345d3Smrg ;; 2974943345d3Smrg *) continue ;; 2975943345d3Smrg esac 2976943345d3Smrg case " $deplibs " in 2977943345d3Smrg *" $path "*) ;; 2978943345d3Smrg *) deplibs="$path $deplibs" ;; 2979943345d3Smrg esac 2980943345d3Smrg case " $deplibs " in 2981943345d3Smrg *" $depdepl "*) ;; 2982943345d3Smrg *) deplibs="$depdepl $deplibs" ;; 2983943345d3Smrg esac 2984943345d3Smrg done 2985943345d3Smrg fi # link_all_deplibs != no 2986943345d3Smrg fi # linkmode = lib 2987943345d3Smrg done # for deplib in $libs 2988943345d3Smrg dependency_libs="$newdependency_libs" 2989943345d3Smrg if test "$pass" = dlpreopen; then 2990943345d3Smrg # Link the dlpreopened libraries before other libraries 2991943345d3Smrg for deplib in $save_deplibs; do 2992943345d3Smrg deplibs="$deplib $deplibs" 2993943345d3Smrg done 2994943345d3Smrg fi 2995943345d3Smrg if test "$pass" != dlopen; then 2996943345d3Smrg if test "$pass" != conv; then 2997943345d3Smrg # Make sure lib_search_path contains only unique directories. 2998943345d3Smrg lib_search_path= 2999943345d3Smrg for dir in $newlib_search_path; do 3000943345d3Smrg case "$lib_search_path " in 3001943345d3Smrg *" $dir "*) ;; 3002943345d3Smrg *) lib_search_path="$lib_search_path $dir" ;; 3003943345d3Smrg esac 3004943345d3Smrg done 3005943345d3Smrg newlib_search_path= 3006943345d3Smrg fi 3007943345d3Smrg 3008943345d3Smrg if test "$linkmode,$pass" != "prog,link"; then 3009943345d3Smrg vars="deplibs" 3010943345d3Smrg else 3011943345d3Smrg vars="compile_deplibs finalize_deplibs" 3012943345d3Smrg fi 3013943345d3Smrg for var in $vars dependency_libs; do 3014943345d3Smrg # Add libraries to $var in reverse order 3015943345d3Smrg eval tmp_libs=\"\$$var\" 3016943345d3Smrg new_libs= 3017943345d3Smrg for deplib in $tmp_libs; do 3018943345d3Smrg # FIXME: Pedantically, this is the right thing to do, so 3019943345d3Smrg # that some nasty dependency loop isn't accidentally 3020943345d3Smrg # broken: 3021943345d3Smrg #new_libs="$deplib $new_libs" 3022943345d3Smrg # Pragmatically, this seems to cause very few problems in 3023943345d3Smrg # practice: 3024943345d3Smrg case $deplib in 3025943345d3Smrg -L*) new_libs="$deplib $new_libs" ;; 3026943345d3Smrg -R*) ;; 3027943345d3Smrg *) 3028943345d3Smrg # And here is the reason: when a library appears more 3029943345d3Smrg # than once as an explicit dependence of a library, or 3030943345d3Smrg # is implicitly linked in more than once by the 3031943345d3Smrg # compiler, it is considered special, and multiple 3032943345d3Smrg # occurrences thereof are not removed. Compare this 3033943345d3Smrg # with having the same library being listed as a 3034943345d3Smrg # dependency of multiple other libraries: in this case, 3035943345d3Smrg # we know (pedantically, we assume) the library does not 3036943345d3Smrg # need to be listed more than once, so we keep only the 3037943345d3Smrg # last copy. This is not always right, but it is rare 3038943345d3Smrg # enough that we require users that really mean to play 3039943345d3Smrg # such unportable linking tricks to link the library 3040943345d3Smrg # using -Wl,-lname, so that libtool does not consider it 3041943345d3Smrg # for duplicate removal. 3042943345d3Smrg case " $specialdeplibs " in 3043943345d3Smrg *" $deplib "*) new_libs="$deplib $new_libs" ;; 3044943345d3Smrg *) 3045943345d3Smrg case " $new_libs " in 3046943345d3Smrg *" $deplib "*) ;; 3047943345d3Smrg *) new_libs="$deplib $new_libs" ;; 3048943345d3Smrg esac 3049943345d3Smrg ;; 3050943345d3Smrg esac 3051943345d3Smrg ;; 3052943345d3Smrg esac 3053943345d3Smrg done 3054943345d3Smrg tmp_libs= 3055943345d3Smrg for deplib in $new_libs; do 3056943345d3Smrg case $deplib in 3057943345d3Smrg -L*) 3058943345d3Smrg case " $tmp_libs " in 3059943345d3Smrg *" $deplib "*) ;; 3060943345d3Smrg *) tmp_libs="$tmp_libs $deplib" ;; 3061943345d3Smrg esac 3062943345d3Smrg ;; 3063943345d3Smrg *) tmp_libs="$tmp_libs $deplib" ;; 3064943345d3Smrg esac 3065943345d3Smrg done 3066943345d3Smrg eval $var=\"$tmp_libs\" 3067943345d3Smrg done # for var 3068943345d3Smrg fi 3069943345d3Smrg # Last step: remove runtime libs from dependency_libs 3070943345d3Smrg # (they stay in deplibs) 3071943345d3Smrg tmp_libs= 3072943345d3Smrg for i in $dependency_libs ; do 3073943345d3Smrg case " $predeps $postdeps $compiler_lib_search_path " in 3074943345d3Smrg *" $i "*) 3075943345d3Smrg i="" 3076943345d3Smrg ;; 3077943345d3Smrg esac 3078943345d3Smrg if test -n "$i" ; then 3079943345d3Smrg tmp_libs="$tmp_libs $i" 3080943345d3Smrg fi 3081943345d3Smrg done 3082943345d3Smrg dependency_libs=$tmp_libs 3083943345d3Smrg done # for pass 3084943345d3Smrg if test "$linkmode" = prog; then 3085943345d3Smrg dlfiles="$newdlfiles" 3086943345d3Smrg dlprefiles="$newdlprefiles" 3087943345d3Smrg fi 3088943345d3Smrg 3089943345d3Smrg case $linkmode in 3090943345d3Smrg oldlib) 3091943345d3Smrg if test -n "$deplibs"; then 3092943345d3Smrg $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 3093943345d3Smrg fi 3094943345d3Smrg 3095943345d3Smrg if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then 3096943345d3Smrg $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 3097943345d3Smrg fi 3098943345d3Smrg 3099943345d3Smrg if test -n "$rpath"; then 3100943345d3Smrg $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 3101943345d3Smrg fi 3102943345d3Smrg 3103943345d3Smrg if test -n "$xrpath"; then 3104943345d3Smrg $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 3105943345d3Smrg fi 3106943345d3Smrg 3107943345d3Smrg if test -n "$vinfo"; then 3108943345d3Smrg $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 3109943345d3Smrg fi 3110943345d3Smrg 3111943345d3Smrg if test -n "$release"; then 3112943345d3Smrg $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 3113943345d3Smrg fi 3114943345d3Smrg 3115943345d3Smrg if test -n "$export_symbols" || test -n "$export_symbols_regex"; then 3116943345d3Smrg $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 3117943345d3Smrg fi 3118943345d3Smrg 3119943345d3Smrg # Now set the variables for building old libraries. 3120943345d3Smrg build_libtool_libs=no 3121943345d3Smrg oldlibs="$output" 3122943345d3Smrg objs="$objs$old_deplibs" 3123943345d3Smrg ;; 3124943345d3Smrg 3125943345d3Smrg lib) 3126943345d3Smrg # Make sure we only generate libraries of the form `libNAME.la'. 3127943345d3Smrg case $outputname in 3128943345d3Smrg lib*) 3129943345d3Smrg name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` 3130943345d3Smrg eval shared_ext=\"$shrext_cmds\" 3131943345d3Smrg eval libname=\"$libname_spec\" 3132943345d3Smrg ;; 3133943345d3Smrg *) 3134943345d3Smrg if test "$module" = no; then 3135943345d3Smrg $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 3136943345d3Smrg $echo "$help" 1>&2 3137943345d3Smrg exit $EXIT_FAILURE 3138943345d3Smrg fi 3139943345d3Smrg if test "$need_lib_prefix" != no; then 3140943345d3Smrg # Add the "lib" prefix for modules if required 3141943345d3Smrg name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` 3142943345d3Smrg eval shared_ext=\"$shrext_cmds\" 3143943345d3Smrg eval libname=\"$libname_spec\" 3144943345d3Smrg else 3145943345d3Smrg libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` 3146943345d3Smrg fi 3147943345d3Smrg ;; 3148943345d3Smrg esac 3149943345d3Smrg 3150943345d3Smrg if test -n "$objs"; then 3151943345d3Smrg if test "$deplibs_check_method" != pass_all; then 3152943345d3Smrg $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 3153943345d3Smrg exit $EXIT_FAILURE 3154943345d3Smrg else 3155943345d3Smrg $echo 3156943345d3Smrg $echo "*** Warning: Linking the shared library $output against the non-libtool" 3157943345d3Smrg $echo "*** objects $objs is not portable!" 3158943345d3Smrg libobjs="$libobjs $objs" 3159943345d3Smrg fi 3160943345d3Smrg fi 3161943345d3Smrg 3162943345d3Smrg if test "$dlself" != no; then 3163943345d3Smrg $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 3164943345d3Smrg fi 3165943345d3Smrg 3166943345d3Smrg set dummy $rpath 3167943345d3Smrg if test "$#" -gt 2; then 3168943345d3Smrg $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 3169943345d3Smrg fi 3170943345d3Smrg install_libdir="$2" 3171943345d3Smrg 3172943345d3Smrg oldlibs= 3173943345d3Smrg if test -z "$rpath"; then 3174943345d3Smrg if test "$build_libtool_libs" = yes; then 3175943345d3Smrg # Building a libtool convenience library. 3176943345d3Smrg # Some compilers have problems with a `.al' extension so 3177943345d3Smrg # convenience libraries should have the same extension an 3178943345d3Smrg # archive normally would. 3179943345d3Smrg oldlibs="$output_objdir/$libname.$libext $oldlibs" 3180943345d3Smrg build_libtool_libs=convenience 3181943345d3Smrg build_old_libs=yes 3182943345d3Smrg fi 3183943345d3Smrg 3184943345d3Smrg if test -n "$vinfo"; then 3185943345d3Smrg $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 3186943345d3Smrg fi 3187943345d3Smrg 3188943345d3Smrg if test -n "$release"; then 3189943345d3Smrg $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 3190943345d3Smrg fi 3191943345d3Smrg else 3192943345d3Smrg 3193943345d3Smrg # Parse the version information argument. 3194943345d3Smrg save_ifs="$IFS"; IFS=':' 3195943345d3Smrg set dummy $vinfo 0 0 0 3196943345d3Smrg IFS="$save_ifs" 3197943345d3Smrg 3198943345d3Smrg if test -n "$8"; then 3199943345d3Smrg $echo "$modename: too many parameters to \`-version-info'" 1>&2 3200943345d3Smrg $echo "$help" 1>&2 3201943345d3Smrg exit $EXIT_FAILURE 3202943345d3Smrg fi 3203943345d3Smrg 3204943345d3Smrg # convert absolute version numbers to libtool ages 3205943345d3Smrg # this retains compatibility with .la files and attempts 3206943345d3Smrg # to make the code below a bit more comprehensible 3207943345d3Smrg 3208943345d3Smrg case $vinfo_number in 3209943345d3Smrg yes) 3210943345d3Smrg number_major="$2" 3211943345d3Smrg number_minor="$3" 3212943345d3Smrg number_revision="$4" 3213943345d3Smrg # 3214943345d3Smrg # There are really only two kinds -- those that 3215943345d3Smrg # use the current revision as the major version 3216943345d3Smrg # and those that subtract age and use age as 3217943345d3Smrg # a minor version. But, then there is irix 3218943345d3Smrg # which has an extra 1 added just for fun 3219943345d3Smrg # 3220943345d3Smrg case $version_type in 3221f67b85aaSmrg darwin|linux|osf|windows|none) 3222943345d3Smrg current=`expr $number_major + $number_minor` 3223943345d3Smrg age="$number_minor" 3224943345d3Smrg revision="$number_revision" 3225943345d3Smrg ;; 3226943345d3Smrg freebsd-aout|freebsd-elf|sunos) 3227943345d3Smrg current="$number_major" 3228943345d3Smrg revision="$number_minor" 3229943345d3Smrg age="0" 3230943345d3Smrg ;; 3231943345d3Smrg irix|nonstopux) 3232943345d3Smrg current=`expr $number_major + $number_minor - 1` 3233943345d3Smrg age="$number_minor" 3234943345d3Smrg revision="$number_minor" 3235943345d3Smrg ;; 3236943345d3Smrg esac 3237943345d3Smrg ;; 3238943345d3Smrg no) 3239943345d3Smrg current="$2" 3240943345d3Smrg revision="$3" 3241943345d3Smrg age="$4" 3242943345d3Smrg ;; 3243943345d3Smrg esac 3244943345d3Smrg 3245943345d3Smrg # Check that each of the things are valid numbers. 3246943345d3Smrg case $current in 3247943345d3Smrg 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]) ;; 3248943345d3Smrg *) 3249943345d3Smrg $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 3250943345d3Smrg $echo "$modename: \`$vinfo' is not valid version information" 1>&2 3251943345d3Smrg exit $EXIT_FAILURE 3252943345d3Smrg ;; 3253943345d3Smrg esac 3254943345d3Smrg 3255943345d3Smrg case $revision in 3256943345d3Smrg 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]) ;; 3257943345d3Smrg *) 3258943345d3Smrg $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 3259943345d3Smrg $echo "$modename: \`$vinfo' is not valid version information" 1>&2 3260943345d3Smrg exit $EXIT_FAILURE 3261943345d3Smrg ;; 3262943345d3Smrg esac 3263943345d3Smrg 3264943345d3Smrg case $age in 3265943345d3Smrg 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]) ;; 3266943345d3Smrg *) 3267943345d3Smrg $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 3268943345d3Smrg $echo "$modename: \`$vinfo' is not valid version information" 1>&2 3269943345d3Smrg exit $EXIT_FAILURE 3270943345d3Smrg ;; 3271943345d3Smrg esac 3272943345d3Smrg 3273943345d3Smrg if test "$age" -gt "$current"; then 3274943345d3Smrg $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 3275943345d3Smrg $echo "$modename: \`$vinfo' is not valid version information" 1>&2 3276943345d3Smrg exit $EXIT_FAILURE 3277943345d3Smrg fi 3278943345d3Smrg 3279943345d3Smrg # Calculate the version variables. 3280943345d3Smrg major= 3281943345d3Smrg versuffix= 3282943345d3Smrg verstring= 3283943345d3Smrg case $version_type in 3284943345d3Smrg none) ;; 3285943345d3Smrg 3286943345d3Smrg darwin) 3287943345d3Smrg # Like Linux, but with the current version available in 3288943345d3Smrg # verstring for coding it into the library header 3289943345d3Smrg major=.`expr $current - $age` 3290943345d3Smrg versuffix="$major.$age.$revision" 3291943345d3Smrg # Darwin ld doesn't like 0 for these options... 3292943345d3Smrg minor_current=`expr $current + 1` 3293943345d3Smrg verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" 3294943345d3Smrg ;; 3295943345d3Smrg 3296943345d3Smrg freebsd-aout) 3297943345d3Smrg major=".$current" 3298943345d3Smrg versuffix=".$current.$revision"; 3299943345d3Smrg ;; 3300943345d3Smrg 3301943345d3Smrg freebsd-elf) 3302943345d3Smrg major=".$current" 3303943345d3Smrg versuffix=".$current"; 3304943345d3Smrg ;; 3305943345d3Smrg 3306943345d3Smrg irix | nonstopux) 3307943345d3Smrg major=`expr $current - $age + 1` 3308943345d3Smrg 3309943345d3Smrg case $version_type in 3310943345d3Smrg nonstopux) verstring_prefix=nonstopux ;; 3311943345d3Smrg *) verstring_prefix=sgi ;; 3312943345d3Smrg esac 3313943345d3Smrg verstring="$verstring_prefix$major.$revision" 3314943345d3Smrg 3315943345d3Smrg # Add in all the interfaces that we are compatible with. 3316943345d3Smrg loop=$revision 3317943345d3Smrg while test "$loop" -ne 0; do 3318943345d3Smrg iface=`expr $revision - $loop` 3319943345d3Smrg loop=`expr $loop - 1` 3320943345d3Smrg verstring="$verstring_prefix$major.$iface:$verstring" 3321943345d3Smrg done 3322943345d3Smrg 3323943345d3Smrg # Before this point, $major must not contain `.'. 3324943345d3Smrg major=.$major 3325943345d3Smrg versuffix="$major.$revision" 3326943345d3Smrg ;; 3327943345d3Smrg 3328943345d3Smrg linux) 3329943345d3Smrg major=.`expr $current - $age` 3330943345d3Smrg versuffix="$major.$age.$revision" 3331943345d3Smrg ;; 3332943345d3Smrg 3333943345d3Smrg osf) 3334943345d3Smrg major=.`expr $current - $age` 3335943345d3Smrg versuffix=".$current.$age.$revision" 3336943345d3Smrg verstring="$current.$age.$revision" 3337943345d3Smrg 3338943345d3Smrg # Add in all the interfaces that we are compatible with. 3339943345d3Smrg loop=$age 3340943345d3Smrg while test "$loop" -ne 0; do 3341943345d3Smrg iface=`expr $current - $loop` 3342943345d3Smrg loop=`expr $loop - 1` 3343943345d3Smrg verstring="$verstring:${iface}.0" 3344943345d3Smrg done 3345943345d3Smrg 3346943345d3Smrg # Make executables depend on our current version. 3347943345d3Smrg verstring="$verstring:${current}.0" 3348943345d3Smrg ;; 3349943345d3Smrg 3350943345d3Smrg sunos) 3351943345d3Smrg major=".$current" 3352943345d3Smrg versuffix=".$current.$revision" 3353943345d3Smrg ;; 3354943345d3Smrg 3355943345d3Smrg windows) 3356943345d3Smrg # Use '-' rather than '.', since we only want one 3357943345d3Smrg # extension on DOS 8.3 filesystems. 3358943345d3Smrg major=`expr $current - $age` 3359943345d3Smrg versuffix="-$major" 3360943345d3Smrg ;; 3361943345d3Smrg 3362943345d3Smrg *) 3363943345d3Smrg $echo "$modename: unknown library version type \`$version_type'" 1>&2 3364943345d3Smrg $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 3365943345d3Smrg exit $EXIT_FAILURE 3366943345d3Smrg ;; 3367943345d3Smrg esac 3368943345d3Smrg 3369943345d3Smrg # Clear the version info if we defaulted, and they specified a release. 3370943345d3Smrg if test -z "$vinfo" && test -n "$release"; then 3371943345d3Smrg major= 3372943345d3Smrg case $version_type in 3373943345d3Smrg darwin) 3374943345d3Smrg # we can't check for "0.0" in archive_cmds due to quoting 3375943345d3Smrg # problems, so we reset it completely 3376943345d3Smrg verstring= 3377943345d3Smrg ;; 3378943345d3Smrg *) 3379943345d3Smrg verstring="0.0" 3380943345d3Smrg ;; 3381943345d3Smrg esac 3382943345d3Smrg if test "$need_version" = no; then 3383943345d3Smrg versuffix= 3384943345d3Smrg else 3385943345d3Smrg versuffix=".0.0" 3386943345d3Smrg fi 3387943345d3Smrg fi 3388943345d3Smrg 3389943345d3Smrg # Remove version info from name if versioning should be avoided 3390943345d3Smrg if test "$avoid_version" = yes && test "$need_version" = no; then 3391943345d3Smrg major= 3392943345d3Smrg versuffix= 3393943345d3Smrg verstring="" 3394943345d3Smrg fi 3395943345d3Smrg 3396943345d3Smrg # Check to see if the archive will have undefined symbols. 3397943345d3Smrg if test "$allow_undefined" = yes; then 3398943345d3Smrg if test "$allow_undefined_flag" = unsupported; then 3399943345d3Smrg $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 3400943345d3Smrg build_libtool_libs=no 3401943345d3Smrg build_old_libs=yes 3402943345d3Smrg fi 3403943345d3Smrg else 3404943345d3Smrg # Don't allow undefined symbols. 3405943345d3Smrg allow_undefined_flag="$no_undefined_flag" 3406943345d3Smrg fi 3407943345d3Smrg fi 3408943345d3Smrg 3409943345d3Smrg if test "$mode" != relink; then 3410943345d3Smrg # Remove our outputs, but don't remove object files since they 3411943345d3Smrg # may have been created when compiling PIC objects. 3412943345d3Smrg removelist= 3413943345d3Smrg tempremovelist=`$echo "$output_objdir/*"` 3414943345d3Smrg for p in $tempremovelist; do 3415943345d3Smrg case $p in 3416943345d3Smrg *.$objext) 3417943345d3Smrg ;; 3418943345d3Smrg $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) 3419943345d3Smrg if test "X$precious_files_regex" != "X"; then 3420943345d3Smrg if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 3421943345d3Smrg then 3422943345d3Smrg continue 3423943345d3Smrg fi 3424943345d3Smrg fi 3425943345d3Smrg removelist="$removelist $p" 3426943345d3Smrg ;; 3427943345d3Smrg *) ;; 3428943345d3Smrg esac 3429943345d3Smrg done 3430943345d3Smrg if test -n "$removelist"; then 3431943345d3Smrg $show "${rm}r $removelist" 3432943345d3Smrg $run ${rm}r $removelist 3433943345d3Smrg fi 3434943345d3Smrg fi 3435943345d3Smrg 3436943345d3Smrg # Now set the variables for building old libraries. 3437943345d3Smrg if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then 3438943345d3Smrg oldlibs="$oldlibs $output_objdir/$libname.$libext" 3439943345d3Smrg 3440943345d3Smrg # Transform .lo files to .o files. 3441943345d3Smrg oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` 3442943345d3Smrg fi 3443943345d3Smrg 3444943345d3Smrg # Eliminate all temporary directories. 3445f67b85aaSmrg# for path in $notinst_path; do 3446f67b85aaSmrg# lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` 3447f67b85aaSmrg# deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` 3448f67b85aaSmrg# dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` 3449f67b85aaSmrg# done 3450943345d3Smrg 3451943345d3Smrg if test -n "$xrpath"; then 3452943345d3Smrg # If the user specified any rpath flags, then add them. 3453943345d3Smrg temp_xrpath= 3454943345d3Smrg for libdir in $xrpath; do 3455943345d3Smrg temp_xrpath="$temp_xrpath -R$libdir" 3456943345d3Smrg case "$finalize_rpath " in 3457943345d3Smrg *" $libdir "*) ;; 3458943345d3Smrg *) finalize_rpath="$finalize_rpath $libdir" ;; 3459943345d3Smrg esac 3460943345d3Smrg done 3461943345d3Smrg if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then 3462943345d3Smrg dependency_libs="$temp_xrpath $dependency_libs" 3463943345d3Smrg fi 3464943345d3Smrg fi 3465943345d3Smrg 3466943345d3Smrg # Make sure dlfiles contains only unique files that won't be dlpreopened 3467943345d3Smrg old_dlfiles="$dlfiles" 3468943345d3Smrg dlfiles= 3469943345d3Smrg for lib in $old_dlfiles; do 3470943345d3Smrg case " $dlprefiles $dlfiles " in 3471943345d3Smrg *" $lib "*) ;; 3472943345d3Smrg *) dlfiles="$dlfiles $lib" ;; 3473943345d3Smrg esac 3474943345d3Smrg done 3475943345d3Smrg 3476943345d3Smrg # Make sure dlprefiles contains only unique files 3477943345d3Smrg old_dlprefiles="$dlprefiles" 3478943345d3Smrg dlprefiles= 3479943345d3Smrg for lib in $old_dlprefiles; do 3480943345d3Smrg case "$dlprefiles " in 3481943345d3Smrg *" $lib "*) ;; 3482943345d3Smrg *) dlprefiles="$dlprefiles $lib" ;; 3483943345d3Smrg esac 3484943345d3Smrg done 3485943345d3Smrg 3486943345d3Smrg if test "$build_libtool_libs" = yes; then 3487943345d3Smrg if test -n "$rpath"; then 3488943345d3Smrg case $host in 3489943345d3Smrg *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) 3490943345d3Smrg # these systems don't actually have a c library (as such)! 3491943345d3Smrg ;; 3492943345d3Smrg *-*-rhapsody* | *-*-darwin1.[012]) 3493943345d3Smrg # Rhapsody C library is in the System framework 3494943345d3Smrg deplibs="$deplibs -framework System" 3495943345d3Smrg ;; 3496943345d3Smrg *-*-netbsd*) 3497943345d3Smrg # Don't link with libc until the a.out ld.so is fixed. 3498943345d3Smrg ;; 3499943345d3Smrg *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) 3500943345d3Smrg # Do not include libc due to us having libc/libc_r. 3501943345d3Smrg ;; 3502943345d3Smrg *-*-sco3.2v5* | *-*-sco5v6*) 3503943345d3Smrg # Causes problems with __ctype 3504943345d3Smrg ;; 3505943345d3Smrg *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) 3506943345d3Smrg # Compiler inserts libc in the correct place for threads to work 3507943345d3Smrg ;; 3508943345d3Smrg *) 3509943345d3Smrg # Add libc to deplibs on all other systems if necessary. 3510943345d3Smrg if test "$build_libtool_need_lc" = "yes"; then 3511943345d3Smrg deplibs="$deplibs -lc" 3512943345d3Smrg fi 3513943345d3Smrg ;; 3514943345d3Smrg esac 3515943345d3Smrg fi 3516943345d3Smrg 3517943345d3Smrg # Transform deplibs into only deplibs that can be linked in shared. 3518943345d3Smrg name_save=$name 3519943345d3Smrg libname_save=$libname 3520943345d3Smrg release_save=$release 3521943345d3Smrg versuffix_save=$versuffix 3522943345d3Smrg major_save=$major 3523943345d3Smrg # I'm not sure if I'm treating the release correctly. I think 3524943345d3Smrg # release should show up in the -l (ie -lgmp5) so we don't want to 3525943345d3Smrg # add it in twice. Is that correct? 3526943345d3Smrg release="" 3527943345d3Smrg versuffix="" 3528943345d3Smrg major="" 3529943345d3Smrg newdeplibs= 3530943345d3Smrg droppeddeps=no 3531943345d3Smrg case $deplibs_check_method in 3532943345d3Smrg pass_all) 3533943345d3Smrg # Don't check for shared/static. Everything works. 3534943345d3Smrg # This might be a little naive. We might want to check 3535943345d3Smrg # whether the library exists or not. But this is on 3536943345d3Smrg # osf3 & osf4 and I'm not really sure... Just 3537943345d3Smrg # implementing what was already the behavior. 3538943345d3Smrg newdeplibs=$deplibs 3539943345d3Smrg ;; 3540943345d3Smrg test_compile) 3541943345d3Smrg # This code stresses the "libraries are programs" paradigm to its 3542943345d3Smrg # limits. Maybe even breaks it. We compile a program, linking it 3543943345d3Smrg # against the deplibs as a proxy for the library. Then we can check 3544943345d3Smrg # whether they linked in statically or dynamically with ldd. 3545943345d3Smrg $rm conftest.c 3546943345d3Smrg cat > conftest.c <<EOF 3547943345d3Smrg int main() { return 0; } 3548943345d3SmrgEOF 3549943345d3Smrg $rm conftest 3550f67b85aaSmrg if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then 3551943345d3Smrg ldd_output=`ldd conftest` 3552943345d3Smrg for i in $deplibs; do 3553943345d3Smrg name=`expr $i : '-l\(.*\)'` 3554943345d3Smrg # If $name is empty we are operating on a -L argument. 3555f67b85aaSmrg if test "$name" != "" && test "$name" != "0"; then 3556943345d3Smrg if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 3557943345d3Smrg case " $predeps $postdeps " in 3558943345d3Smrg *" $i "*) 3559943345d3Smrg newdeplibs="$newdeplibs $i" 3560943345d3Smrg i="" 3561943345d3Smrg ;; 3562943345d3Smrg esac 3563943345d3Smrg fi 3564943345d3Smrg if test -n "$i" ; then 3565943345d3Smrg libname=`eval \\$echo \"$libname_spec\"` 3566943345d3Smrg deplib_matches=`eval \\$echo \"$library_names_spec\"` 3567943345d3Smrg set dummy $deplib_matches 3568943345d3Smrg deplib_match=$2 3569943345d3Smrg if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then 3570943345d3Smrg newdeplibs="$newdeplibs $i" 3571943345d3Smrg else 3572943345d3Smrg droppeddeps=yes 3573943345d3Smrg $echo 3574943345d3Smrg $echo "*** Warning: dynamic linker does not accept needed library $i." 3575943345d3Smrg $echo "*** I have the capability to make that library automatically link in when" 3576943345d3Smrg $echo "*** you link to this library. But I can only do this if you have a" 3577943345d3Smrg $echo "*** shared version of the library, which I believe you do not have" 3578943345d3Smrg $echo "*** because a test_compile did reveal that the linker did not use it for" 3579943345d3Smrg $echo "*** its dynamic dependency list that programs get resolved with at runtime." 3580943345d3Smrg fi 3581943345d3Smrg fi 3582943345d3Smrg else 3583943345d3Smrg newdeplibs="$newdeplibs $i" 3584943345d3Smrg fi 3585943345d3Smrg done 3586943345d3Smrg else 3587943345d3Smrg # Error occurred in the first compile. Let's try to salvage 3588943345d3Smrg # the situation: Compile a separate program for each library. 3589943345d3Smrg for i in $deplibs; do 3590943345d3Smrg name=`expr $i : '-l\(.*\)'` 3591943345d3Smrg # If $name is empty we are operating on a -L argument. 3592943345d3Smrg if test "$name" != "" && test "$name" != "0"; then 3593943345d3Smrg $rm conftest 3594f67b85aaSmrg if $LTCC $LTCFLAGS -o conftest conftest.c $i; then 3595943345d3Smrg ldd_output=`ldd conftest` 3596943345d3Smrg if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 3597943345d3Smrg case " $predeps $postdeps " in 3598943345d3Smrg *" $i "*) 3599943345d3Smrg newdeplibs="$newdeplibs $i" 3600943345d3Smrg i="" 3601943345d3Smrg ;; 3602943345d3Smrg esac 3603943345d3Smrg fi 3604943345d3Smrg if test -n "$i" ; then 3605943345d3Smrg libname=`eval \\$echo \"$libname_spec\"` 3606943345d3Smrg deplib_matches=`eval \\$echo \"$library_names_spec\"` 3607943345d3Smrg set dummy $deplib_matches 3608943345d3Smrg deplib_match=$2 3609943345d3Smrg if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then 3610943345d3Smrg newdeplibs="$newdeplibs $i" 3611943345d3Smrg else 3612943345d3Smrg droppeddeps=yes 3613943345d3Smrg $echo 3614943345d3Smrg $echo "*** Warning: dynamic linker does not accept needed library $i." 3615943345d3Smrg $echo "*** I have the capability to make that library automatically link in when" 3616943345d3Smrg $echo "*** you link to this library. But I can only do this if you have a" 3617943345d3Smrg $echo "*** shared version of the library, which you do not appear to have" 3618943345d3Smrg $echo "*** because a test_compile did reveal that the linker did not use this one" 3619943345d3Smrg $echo "*** as a dynamic dependency that programs can get resolved with at runtime." 3620943345d3Smrg fi 3621943345d3Smrg fi 3622943345d3Smrg else 3623943345d3Smrg droppeddeps=yes 3624943345d3Smrg $echo 3625943345d3Smrg $echo "*** Warning! Library $i is needed by this library but I was not able to" 3626f67b85aaSmrg $echo "*** make it link in! You will probably need to install it or some" 3627943345d3Smrg $echo "*** library that it depends on before this library will be fully" 3628943345d3Smrg $echo "*** functional. Installing it before continuing would be even better." 3629943345d3Smrg fi 3630943345d3Smrg else 3631943345d3Smrg newdeplibs="$newdeplibs $i" 3632943345d3Smrg fi 3633943345d3Smrg done 3634943345d3Smrg fi 3635943345d3Smrg ;; 3636943345d3Smrg file_magic*) 3637943345d3Smrg set dummy $deplibs_check_method 3638943345d3Smrg file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 3639943345d3Smrg for a_deplib in $deplibs; do 3640943345d3Smrg name=`expr $a_deplib : '-l\(.*\)'` 3641943345d3Smrg # If $name is empty we are operating on a -L argument. 3642943345d3Smrg if test "$name" != "" && test "$name" != "0"; then 3643943345d3Smrg if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 3644943345d3Smrg case " $predeps $postdeps " in 3645943345d3Smrg *" $a_deplib "*) 3646943345d3Smrg newdeplibs="$newdeplibs $a_deplib" 3647943345d3Smrg a_deplib="" 3648943345d3Smrg ;; 3649943345d3Smrg esac 3650943345d3Smrg fi 3651943345d3Smrg if test -n "$a_deplib" ; then 3652943345d3Smrg libname=`eval \\$echo \"$libname_spec\"` 3653943345d3Smrg for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do 3654943345d3Smrg potential_libs=`ls $i/$libname[.-]* 2>/dev/null` 3655943345d3Smrg for potent_lib in $potential_libs; do 3656943345d3Smrg # Follow soft links. 3657943345d3Smrg if ls -lLd "$potent_lib" 2>/dev/null \ 3658943345d3Smrg | grep " -> " >/dev/null; then 3659943345d3Smrg continue 3660943345d3Smrg fi 3661943345d3Smrg # The statement above tries to avoid entering an 3662943345d3Smrg # endless loop below, in case of cyclic links. 3663943345d3Smrg # We might still enter an endless loop, since a link 3664943345d3Smrg # loop can be closed while we follow links, 3665943345d3Smrg # but so what? 3666943345d3Smrg potlib="$potent_lib" 3667943345d3Smrg while test -h "$potlib" 2>/dev/null; do 3668943345d3Smrg potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` 3669943345d3Smrg case $potliblink in 3670943345d3Smrg [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; 3671943345d3Smrg *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; 3672943345d3Smrg esac 3673943345d3Smrg done 3674943345d3Smrg if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ 3675943345d3Smrg | ${SED} 10q \ 3676943345d3Smrg | $EGREP "$file_magic_regex" > /dev/null; then 3677943345d3Smrg newdeplibs="$newdeplibs $a_deplib" 3678943345d3Smrg a_deplib="" 3679943345d3Smrg break 2 3680943345d3Smrg fi 3681943345d3Smrg done 3682943345d3Smrg done 3683943345d3Smrg fi 3684943345d3Smrg if test -n "$a_deplib" ; then 3685943345d3Smrg droppeddeps=yes 3686943345d3Smrg $echo 3687943345d3Smrg $echo "*** Warning: linker path does not have real file for library $a_deplib." 3688943345d3Smrg $echo "*** I have the capability to make that library automatically link in when" 3689943345d3Smrg $echo "*** you link to this library. But I can only do this if you have a" 3690943345d3Smrg $echo "*** shared version of the library, which you do not appear to have" 3691943345d3Smrg $echo "*** because I did check the linker path looking for a file starting" 3692943345d3Smrg if test -z "$potlib" ; then 3693943345d3Smrg $echo "*** with $libname but no candidates were found. (...for file magic test)" 3694943345d3Smrg else 3695943345d3Smrg $echo "*** with $libname and none of the candidates passed a file format test" 3696943345d3Smrg $echo "*** using a file magic. Last file checked: $potlib" 3697943345d3Smrg fi 3698943345d3Smrg fi 3699943345d3Smrg else 3700943345d3Smrg # Add a -L argument. 3701943345d3Smrg newdeplibs="$newdeplibs $a_deplib" 3702943345d3Smrg fi 3703943345d3Smrg done # Gone through all deplibs. 3704943345d3Smrg ;; 3705943345d3Smrg match_pattern*) 3706943345d3Smrg set dummy $deplibs_check_method 3707943345d3Smrg match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 3708943345d3Smrg for a_deplib in $deplibs; do 3709943345d3Smrg name=`expr $a_deplib : '-l\(.*\)'` 3710943345d3Smrg # If $name is empty we are operating on a -L argument. 3711943345d3Smrg if test -n "$name" && test "$name" != "0"; then 3712943345d3Smrg if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 3713943345d3Smrg case " $predeps $postdeps " in 3714943345d3Smrg *" $a_deplib "*) 3715943345d3Smrg newdeplibs="$newdeplibs $a_deplib" 3716943345d3Smrg a_deplib="" 3717943345d3Smrg ;; 3718943345d3Smrg esac 3719943345d3Smrg fi 3720943345d3Smrg if test -n "$a_deplib" ; then 3721943345d3Smrg libname=`eval \\$echo \"$libname_spec\"` 3722943345d3Smrg for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do 3723943345d3Smrg potential_libs=`ls $i/$libname[.-]* 2>/dev/null` 3724943345d3Smrg for potent_lib in $potential_libs; do 3725943345d3Smrg potlib="$potent_lib" # see symlink-check above in file_magic test 3726943345d3Smrg if eval $echo \"$potent_lib\" 2>/dev/null \ 3727943345d3Smrg | ${SED} 10q \ 3728943345d3Smrg | $EGREP "$match_pattern_regex" > /dev/null; then 3729943345d3Smrg newdeplibs="$newdeplibs $a_deplib" 3730943345d3Smrg a_deplib="" 3731943345d3Smrg break 2 3732943345d3Smrg fi 3733943345d3Smrg done 3734943345d3Smrg done 3735943345d3Smrg fi 3736943345d3Smrg if test -n "$a_deplib" ; then 3737943345d3Smrg droppeddeps=yes 3738943345d3Smrg $echo 3739943345d3Smrg $echo "*** Warning: linker path does not have real file for library $a_deplib." 3740943345d3Smrg $echo "*** I have the capability to make that library automatically link in when" 3741943345d3Smrg $echo "*** you link to this library. But I can only do this if you have a" 3742943345d3Smrg $echo "*** shared version of the library, which you do not appear to have" 3743943345d3Smrg $echo "*** because I did check the linker path looking for a file starting" 3744943345d3Smrg if test -z "$potlib" ; then 3745943345d3Smrg $echo "*** with $libname but no candidates were found. (...for regex pattern test)" 3746943345d3Smrg else 3747943345d3Smrg $echo "*** with $libname and none of the candidates passed a file format test" 3748943345d3Smrg $echo "*** using a regex pattern. Last file checked: $potlib" 3749943345d3Smrg fi 3750943345d3Smrg fi 3751943345d3Smrg else 3752943345d3Smrg # Add a -L argument. 3753943345d3Smrg newdeplibs="$newdeplibs $a_deplib" 3754943345d3Smrg fi 3755943345d3Smrg done # Gone through all deplibs. 3756943345d3Smrg ;; 3757943345d3Smrg none | unknown | *) 3758943345d3Smrg newdeplibs="" 3759943345d3Smrg tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ 3760943345d3Smrg -e 's/ -[LR][^ ]*//g'` 3761943345d3Smrg if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 3762943345d3Smrg for i in $predeps $postdeps ; do 3763943345d3Smrg # can't use Xsed below, because $i might contain '/' 3764943345d3Smrg tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` 3765943345d3Smrg done 3766943345d3Smrg fi 3767943345d3Smrg if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ 3768943345d3Smrg | grep . >/dev/null; then 3769943345d3Smrg $echo 3770943345d3Smrg if test "X$deplibs_check_method" = "Xnone"; then 3771943345d3Smrg $echo "*** Warning: inter-library dependencies are not supported in this platform." 3772943345d3Smrg else 3773943345d3Smrg $echo "*** Warning: inter-library dependencies are not known to be supported." 3774943345d3Smrg fi 3775943345d3Smrg $echo "*** All declared inter-library dependencies are being dropped." 3776943345d3Smrg droppeddeps=yes 3777943345d3Smrg fi 3778943345d3Smrg ;; 3779943345d3Smrg esac 3780943345d3Smrg versuffix=$versuffix_save 3781943345d3Smrg major=$major_save 3782943345d3Smrg release=$release_save 3783943345d3Smrg libname=$libname_save 3784943345d3Smrg name=$name_save 3785943345d3Smrg 3786943345d3Smrg case $host in 3787943345d3Smrg *-*-rhapsody* | *-*-darwin1.[012]) 3788943345d3Smrg # On Rhapsody replace the C library is the System framework 3789943345d3Smrg newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` 3790943345d3Smrg ;; 3791943345d3Smrg esac 3792943345d3Smrg 3793943345d3Smrg if test "$droppeddeps" = yes; then 3794943345d3Smrg if test "$module" = yes; then 3795943345d3Smrg $echo 3796943345d3Smrg $echo "*** Warning: libtool could not satisfy all declared inter-library" 3797943345d3Smrg $echo "*** dependencies of module $libname. Therefore, libtool will create" 3798943345d3Smrg $echo "*** a static module, that should work as long as the dlopening" 3799943345d3Smrg $echo "*** application is linked with the -dlopen flag." 3800943345d3Smrg if test -z "$global_symbol_pipe"; then 3801943345d3Smrg $echo 3802943345d3Smrg $echo "*** However, this would only work if libtool was able to extract symbol" 3803943345d3Smrg $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" 3804943345d3Smrg $echo "*** not find such a program. So, this module is probably useless." 3805943345d3Smrg $echo "*** \`nm' from GNU binutils and a full rebuild may help." 3806943345d3Smrg fi 3807943345d3Smrg if test "$build_old_libs" = no; then 3808943345d3Smrg oldlibs="$output_objdir/$libname.$libext" 3809943345d3Smrg build_libtool_libs=module 3810943345d3Smrg build_old_libs=yes 3811943345d3Smrg else 3812943345d3Smrg build_libtool_libs=no 3813943345d3Smrg fi 3814943345d3Smrg else 3815943345d3Smrg $echo "*** The inter-library dependencies that have been dropped here will be" 3816943345d3Smrg $echo "*** automatically added whenever a program is linked with this library" 3817943345d3Smrg $echo "*** or is declared to -dlopen it." 3818943345d3Smrg 3819943345d3Smrg if test "$allow_undefined" = no; then 3820943345d3Smrg $echo 3821943345d3Smrg $echo "*** Since this library must not contain undefined symbols," 3822943345d3Smrg $echo "*** because either the platform does not support them or" 3823943345d3Smrg $echo "*** it was explicitly requested with -no-undefined," 3824943345d3Smrg $echo "*** libtool will only create a static version of it." 3825943345d3Smrg if test "$build_old_libs" = no; then 3826943345d3Smrg oldlibs="$output_objdir/$libname.$libext" 3827943345d3Smrg build_libtool_libs=module 3828943345d3Smrg build_old_libs=yes 3829943345d3Smrg else 3830943345d3Smrg build_libtool_libs=no 3831943345d3Smrg fi 3832943345d3Smrg fi 3833943345d3Smrg fi 3834943345d3Smrg fi 3835943345d3Smrg # Done checking deplibs! 3836943345d3Smrg deplibs=$newdeplibs 3837943345d3Smrg fi 3838943345d3Smrg 3839943345d3Smrg 3840943345d3Smrg # move library search paths that coincide with paths to not yet 3841943345d3Smrg # installed libraries to the beginning of the library search list 3842943345d3Smrg new_libs= 3843943345d3Smrg for path in $notinst_path; do 3844943345d3Smrg case " $new_libs " in 3845943345d3Smrg *" -L$path/$objdir "*) ;; 3846943345d3Smrg *) 3847943345d3Smrg case " $deplibs " in 3848943345d3Smrg *" -L$path/$objdir "*) 3849943345d3Smrg new_libs="$new_libs -L$path/$objdir" ;; 3850943345d3Smrg esac 3851943345d3Smrg ;; 3852943345d3Smrg esac 3853943345d3Smrg done 3854943345d3Smrg for deplib in $deplibs; do 3855943345d3Smrg case $deplib in 3856943345d3Smrg -L*) 3857943345d3Smrg case " $new_libs " in 3858943345d3Smrg *" $deplib "*) ;; 3859943345d3Smrg *) new_libs="$new_libs $deplib" ;; 3860943345d3Smrg esac 3861943345d3Smrg ;; 3862943345d3Smrg *) new_libs="$new_libs $deplib" ;; 3863943345d3Smrg esac 3864943345d3Smrg done 3865943345d3Smrg deplibs="$new_libs" 3866943345d3Smrg 3867943345d3Smrg 3868943345d3Smrg # All the library-specific variables (install_libdir is set above). 3869943345d3Smrg library_names= 3870943345d3Smrg old_library= 3871943345d3Smrg dlname= 3872943345d3Smrg 3873943345d3Smrg # Test again, we may have decided not to build it any more 3874943345d3Smrg if test "$build_libtool_libs" = yes; then 3875943345d3Smrg if test "$hardcode_into_libs" = yes; then 3876943345d3Smrg # Hardcode the library paths 3877943345d3Smrg hardcode_libdirs= 3878943345d3Smrg dep_rpath= 3879943345d3Smrg rpath="$finalize_rpath" 3880943345d3Smrg test "$mode" != relink && rpath="$compile_rpath$rpath" 3881943345d3Smrg for libdir in $rpath; do 3882943345d3Smrg if test -n "$hardcode_libdir_flag_spec"; then 3883943345d3Smrg if test -n "$hardcode_libdir_separator"; then 3884943345d3Smrg if test -z "$hardcode_libdirs"; then 3885943345d3Smrg hardcode_libdirs="$libdir" 3886943345d3Smrg else 3887943345d3Smrg # Just accumulate the unique libdirs. 3888943345d3Smrg case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in 3889943345d3Smrg *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) 3890943345d3Smrg ;; 3891943345d3Smrg *) 3892943345d3Smrg hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" 3893943345d3Smrg ;; 3894943345d3Smrg esac 3895943345d3Smrg fi 3896943345d3Smrg else 3897943345d3Smrg eval flag=\"$hardcode_libdir_flag_spec\" 3898943345d3Smrg dep_rpath="$dep_rpath $flag" 3899943345d3Smrg fi 3900943345d3Smrg elif test -n "$runpath_var"; then 3901943345d3Smrg case "$perm_rpath " in 3902943345d3Smrg *" $libdir "*) ;; 3903943345d3Smrg *) perm_rpath="$perm_rpath $libdir" ;; 3904943345d3Smrg esac 3905943345d3Smrg fi 3906943345d3Smrg done 3907943345d3Smrg # Substitute the hardcoded libdirs into the rpath. 3908943345d3Smrg if test -n "$hardcode_libdir_separator" && 3909943345d3Smrg test -n "$hardcode_libdirs"; then 3910943345d3Smrg libdir="$hardcode_libdirs" 3911943345d3Smrg if test -n "$hardcode_libdir_flag_spec_ld"; then 3912943345d3Smrg eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" 3913943345d3Smrg else 3914943345d3Smrg eval dep_rpath=\"$hardcode_libdir_flag_spec\" 3915943345d3Smrg fi 3916943345d3Smrg fi 3917943345d3Smrg if test -n "$runpath_var" && test -n "$perm_rpath"; then 3918943345d3Smrg # We should set the runpath_var. 3919943345d3Smrg rpath= 3920943345d3Smrg for dir in $perm_rpath; do 3921943345d3Smrg rpath="$rpath$dir:" 3922943345d3Smrg done 3923943345d3Smrg eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" 3924943345d3Smrg fi 3925943345d3Smrg test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" 3926943345d3Smrg fi 3927943345d3Smrg 3928943345d3Smrg shlibpath="$finalize_shlibpath" 3929943345d3Smrg test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" 3930943345d3Smrg if test -n "$shlibpath"; then 3931943345d3Smrg eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" 3932943345d3Smrg fi 3933943345d3Smrg 3934943345d3Smrg # Get the real and link names of the library. 3935943345d3Smrg eval shared_ext=\"$shrext_cmds\" 3936943345d3Smrg eval library_names=\"$library_names_spec\" 3937943345d3Smrg set dummy $library_names 3938943345d3Smrg realname="$2" 3939943345d3Smrg shift; shift 3940943345d3Smrg 3941943345d3Smrg if test -n "$soname_spec"; then 3942943345d3Smrg eval soname=\"$soname_spec\" 3943943345d3Smrg else 3944943345d3Smrg soname="$realname" 3945943345d3Smrg fi 3946943345d3Smrg if test -z "$dlname"; then 3947943345d3Smrg dlname=$soname 3948943345d3Smrg fi 3949943345d3Smrg 3950943345d3Smrg lib="$output_objdir/$realname" 3951943345d3Smrg linknames= 3952943345d3Smrg for link 3953943345d3Smrg do 3954943345d3Smrg linknames="$linknames $link" 3955943345d3Smrg done 3956943345d3Smrg 3957943345d3Smrg # Use standard objects if they are pic 3958943345d3Smrg test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` 3959943345d3Smrg 3960943345d3Smrg # Prepare the list of exported symbols 3961943345d3Smrg if test -z "$export_symbols"; then 3962943345d3Smrg if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then 3963943345d3Smrg $show "generating symbol list for \`$libname.la'" 3964943345d3Smrg export_symbols="$output_objdir/$libname.exp" 3965943345d3Smrg $run $rm $export_symbols 3966943345d3Smrg cmds=$export_symbols_cmds 3967943345d3Smrg save_ifs="$IFS"; IFS='~' 3968943345d3Smrg for cmd in $cmds; do 3969943345d3Smrg IFS="$save_ifs" 3970943345d3Smrg eval cmd=\"$cmd\" 3971943345d3Smrg if len=`expr "X$cmd" : ".*"` && 3972943345d3Smrg test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then 3973943345d3Smrg $show "$cmd" 3974943345d3Smrg $run eval "$cmd" || exit $? 3975943345d3Smrg skipped_export=false 3976943345d3Smrg else 3977943345d3Smrg # The command line is too long to execute in one step. 3978943345d3Smrg $show "using reloadable object file for export list..." 3979943345d3Smrg skipped_export=: 3980943345d3Smrg # Break out early, otherwise skipped_export may be 3981943345d3Smrg # set to false by a later but shorter cmd. 3982943345d3Smrg break 3983943345d3Smrg fi 3984943345d3Smrg done 3985943345d3Smrg IFS="$save_ifs" 3986943345d3Smrg if test -n "$export_symbols_regex"; then 3987943345d3Smrg $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" 3988943345d3Smrg $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' 3989943345d3Smrg $show "$mv \"${export_symbols}T\" \"$export_symbols\"" 3990943345d3Smrg $run eval '$mv "${export_symbols}T" "$export_symbols"' 3991943345d3Smrg fi 3992943345d3Smrg fi 3993943345d3Smrg fi 3994943345d3Smrg 3995943345d3Smrg if test -n "$export_symbols" && test -n "$include_expsyms"; then 3996943345d3Smrg $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' 3997943345d3Smrg fi 3998943345d3Smrg 3999943345d3Smrg tmp_deplibs= 4000943345d3Smrg for test_deplib in $deplibs; do 4001943345d3Smrg case " $convenience " in 4002943345d3Smrg *" $test_deplib "*) ;; 4003943345d3Smrg *) 4004943345d3Smrg tmp_deplibs="$tmp_deplibs $test_deplib" 4005943345d3Smrg ;; 4006943345d3Smrg esac 4007943345d3Smrg done 4008943345d3Smrg deplibs="$tmp_deplibs" 4009943345d3Smrg 4010943345d3Smrg if test -n "$convenience"; then 4011943345d3Smrg if test -n "$whole_archive_flag_spec"; then 4012943345d3Smrg save_libobjs=$libobjs 4013943345d3Smrg eval libobjs=\"\$libobjs $whole_archive_flag_spec\" 4014943345d3Smrg else 4015943345d3Smrg gentop="$output_objdir/${outputname}x" 4016943345d3Smrg generated="$generated $gentop" 4017943345d3Smrg 4018943345d3Smrg func_extract_archives $gentop $convenience 4019943345d3Smrg libobjs="$libobjs $func_extract_archives_result" 4020943345d3Smrg fi 4021943345d3Smrg fi 4022943345d3Smrg 4023943345d3Smrg if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then 4024943345d3Smrg eval flag=\"$thread_safe_flag_spec\" 4025943345d3Smrg linker_flags="$linker_flags $flag" 4026943345d3Smrg fi 4027943345d3Smrg 4028943345d3Smrg # Make a backup of the uninstalled library when relinking 4029943345d3Smrg if test "$mode" = relink; then 4030943345d3Smrg $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? 4031943345d3Smrg fi 4032943345d3Smrg 4033943345d3Smrg # Do each of the archive commands. 4034943345d3Smrg if test "$module" = yes && test -n "$module_cmds" ; then 4035943345d3Smrg if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then 4036943345d3Smrg eval test_cmds=\"$module_expsym_cmds\" 4037943345d3Smrg cmds=$module_expsym_cmds 4038943345d3Smrg else 4039943345d3Smrg eval test_cmds=\"$module_cmds\" 4040943345d3Smrg cmds=$module_cmds 4041943345d3Smrg fi 4042943345d3Smrg else 4043943345d3Smrg if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then 4044943345d3Smrg eval test_cmds=\"$archive_expsym_cmds\" 4045943345d3Smrg cmds=$archive_expsym_cmds 4046943345d3Smrg else 4047943345d3Smrg eval test_cmds=\"$archive_cmds\" 4048943345d3Smrg cmds=$archive_cmds 4049943345d3Smrg fi 4050943345d3Smrg fi 4051943345d3Smrg 4052943345d3Smrg if test "X$skipped_export" != "X:" && 4053943345d3Smrg len=`expr "X$test_cmds" : ".*" 2>/dev/null` && 4054943345d3Smrg test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then 4055943345d3Smrg : 4056943345d3Smrg else 4057943345d3Smrg # The command line is too long to link in one step, link piecewise. 4058943345d3Smrg $echo "creating reloadable object files..." 4059943345d3Smrg 4060943345d3Smrg # Save the value of $output and $libobjs because we want to 4061943345d3Smrg # use them later. If we have whole_archive_flag_spec, we 4062943345d3Smrg # want to use save_libobjs as it was before 4063943345d3Smrg # whole_archive_flag_spec was expanded, because we can't 4064943345d3Smrg # assume the linker understands whole_archive_flag_spec. 4065943345d3Smrg # This may have to be revisited, in case too many 4066943345d3Smrg # convenience libraries get linked in and end up exceeding 4067943345d3Smrg # the spec. 4068943345d3Smrg if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then 4069943345d3Smrg save_libobjs=$libobjs 4070943345d3Smrg fi 4071943345d3Smrg save_output=$output 4072943345d3Smrg output_la=`$echo "X$output" | $Xsed -e "$basename"` 4073943345d3Smrg 4074943345d3Smrg # Clear the reloadable object creation command queue and 4075943345d3Smrg # initialize k to one. 4076943345d3Smrg test_cmds= 4077943345d3Smrg concat_cmds= 4078943345d3Smrg objlist= 4079943345d3Smrg delfiles= 4080943345d3Smrg last_robj= 4081943345d3Smrg k=1 4082943345d3Smrg output=$output_objdir/$output_la-${k}.$objext 4083943345d3Smrg # Loop over the list of objects to be linked. 4084943345d3Smrg for obj in $save_libobjs 4085943345d3Smrg do 4086943345d3Smrg eval test_cmds=\"$reload_cmds $objlist $last_robj\" 4087943345d3Smrg if test "X$objlist" = X || 4088943345d3Smrg { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && 4089943345d3Smrg test "$len" -le "$max_cmd_len"; }; then 4090943345d3Smrg objlist="$objlist $obj" 4091943345d3Smrg else 4092943345d3Smrg # The command $test_cmds is almost too long, add a 4093943345d3Smrg # command to the queue. 4094943345d3Smrg if test "$k" -eq 1 ; then 4095943345d3Smrg # The first file doesn't have a previous command to add. 4096943345d3Smrg eval concat_cmds=\"$reload_cmds $objlist $last_robj\" 4097943345d3Smrg else 4098943345d3Smrg # All subsequent reloadable object files will link in 4099943345d3Smrg # the last one created. 4100943345d3Smrg eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" 4101943345d3Smrg fi 4102943345d3Smrg last_robj=$output_objdir/$output_la-${k}.$objext 4103943345d3Smrg k=`expr $k + 1` 4104943345d3Smrg output=$output_objdir/$output_la-${k}.$objext 4105943345d3Smrg objlist=$obj 4106943345d3Smrg len=1 4107943345d3Smrg fi 4108943345d3Smrg done 4109943345d3Smrg # Handle the remaining objects by creating one last 4110943345d3Smrg # reloadable object file. All subsequent reloadable object 4111943345d3Smrg # files will link in the last one created. 4112943345d3Smrg test -z "$concat_cmds" || concat_cmds=$concat_cmds~ 4113943345d3Smrg eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" 4114943345d3Smrg 4115943345d3Smrg if ${skipped_export-false}; then 4116943345d3Smrg $show "generating symbol list for \`$libname.la'" 4117943345d3Smrg export_symbols="$output_objdir/$libname.exp" 4118943345d3Smrg $run $rm $export_symbols 4119943345d3Smrg libobjs=$output 4120943345d3Smrg # Append the command to create the export file. 4121943345d3Smrg eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" 4122943345d3Smrg fi 4123943345d3Smrg 4124943345d3Smrg # Set up a command to remove the reloadable object files 4125943345d3Smrg # after they are used. 4126943345d3Smrg i=0 4127943345d3Smrg while test "$i" -lt "$k" 4128943345d3Smrg do 4129943345d3Smrg i=`expr $i + 1` 4130943345d3Smrg delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" 4131943345d3Smrg done 4132943345d3Smrg 4133943345d3Smrg $echo "creating a temporary reloadable object file: $output" 4134943345d3Smrg 4135943345d3Smrg # Loop through the commands generated above and execute them. 4136943345d3Smrg save_ifs="$IFS"; IFS='~' 4137943345d3Smrg for cmd in $concat_cmds; do 4138943345d3Smrg IFS="$save_ifs" 4139943345d3Smrg $show "$cmd" 4140943345d3Smrg $run eval "$cmd" || exit $? 4141943345d3Smrg done 4142943345d3Smrg IFS="$save_ifs" 4143943345d3Smrg 4144943345d3Smrg libobjs=$output 4145943345d3Smrg # Restore the value of output. 4146943345d3Smrg output=$save_output 4147943345d3Smrg 4148943345d3Smrg if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then 4149943345d3Smrg eval libobjs=\"\$libobjs $whole_archive_flag_spec\" 4150943345d3Smrg fi 4151943345d3Smrg # Expand the library linking commands again to reset the 4152943345d3Smrg # value of $libobjs for piecewise linking. 4153943345d3Smrg 4154943345d3Smrg # Do each of the archive commands. 4155943345d3Smrg if test "$module" = yes && test -n "$module_cmds" ; then 4156943345d3Smrg if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then 4157943345d3Smrg cmds=$module_expsym_cmds 4158943345d3Smrg else 4159943345d3Smrg cmds=$module_cmds 4160943345d3Smrg fi 4161943345d3Smrg else 4162943345d3Smrg if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then 4163943345d3Smrg cmds=$archive_expsym_cmds 4164943345d3Smrg else 4165943345d3Smrg cmds=$archive_cmds 4166943345d3Smrg fi 4167943345d3Smrg fi 4168943345d3Smrg 4169943345d3Smrg # Append the command to remove the reloadable object files 4170943345d3Smrg # to the just-reset $cmds. 4171943345d3Smrg eval cmds=\"\$cmds~\$rm $delfiles\" 4172943345d3Smrg fi 4173943345d3Smrg save_ifs="$IFS"; IFS='~' 4174943345d3Smrg for cmd in $cmds; do 4175943345d3Smrg IFS="$save_ifs" 4176943345d3Smrg eval cmd=\"$cmd\" 4177943345d3Smrg $show "$cmd" 4178943345d3Smrg $run eval "$cmd" || { 4179943345d3Smrg lt_exit=$? 4180943345d3Smrg 4181943345d3Smrg # Restore the uninstalled library and exit 4182943345d3Smrg if test "$mode" = relink; then 4183943345d3Smrg $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' 4184943345d3Smrg fi 4185943345d3Smrg 4186943345d3Smrg exit $lt_exit 4187943345d3Smrg } 4188943345d3Smrg done 4189943345d3Smrg IFS="$save_ifs" 4190943345d3Smrg 4191943345d3Smrg # Restore the uninstalled library and exit 4192943345d3Smrg if test "$mode" = relink; then 4193943345d3Smrg $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? 4194943345d3Smrg 4195943345d3Smrg if test -n "$convenience"; then 4196943345d3Smrg if test -z "$whole_archive_flag_spec"; then 4197943345d3Smrg $show "${rm}r $gentop" 4198943345d3Smrg $run ${rm}r "$gentop" 4199943345d3Smrg fi 4200943345d3Smrg fi 4201943345d3Smrg 4202943345d3Smrg exit $EXIT_SUCCESS 4203943345d3Smrg fi 4204943345d3Smrg 4205943345d3Smrg # Create links to the real library. 4206943345d3Smrg for linkname in $linknames; do 4207943345d3Smrg if test "$realname" != "$linkname"; then 4208943345d3Smrg $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" 4209943345d3Smrg $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? 4210943345d3Smrg fi 4211943345d3Smrg done 4212943345d3Smrg 4213943345d3Smrg # If -module or -export-dynamic was specified, set the dlname. 4214943345d3Smrg if test "$module" = yes || test "$export_dynamic" = yes; then 4215943345d3Smrg # On all known operating systems, these are identical. 4216943345d3Smrg dlname="$soname" 4217943345d3Smrg fi 4218943345d3Smrg fi 4219943345d3Smrg ;; 4220943345d3Smrg 4221943345d3Smrg obj) 4222943345d3Smrg if test -n "$deplibs"; then 4223943345d3Smrg $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 4224943345d3Smrg fi 4225943345d3Smrg 4226943345d3Smrg if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then 4227943345d3Smrg $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 4228943345d3Smrg fi 4229943345d3Smrg 4230943345d3Smrg if test -n "$rpath"; then 4231943345d3Smrg $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 4232943345d3Smrg fi 4233943345d3Smrg 4234943345d3Smrg if test -n "$xrpath"; then 4235943345d3Smrg $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 4236943345d3Smrg fi 4237943345d3Smrg 4238943345d3Smrg if test -n "$vinfo"; then 4239943345d3Smrg $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 4240943345d3Smrg fi 4241943345d3Smrg 4242943345d3Smrg if test -n "$release"; then 4243943345d3Smrg $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 4244943345d3Smrg fi 4245943345d3Smrg 4246943345d3Smrg case $output in 4247943345d3Smrg *.lo) 4248943345d3Smrg if test -n "$objs$old_deplibs"; then 4249943345d3Smrg $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 4250943345d3Smrg exit $EXIT_FAILURE 4251943345d3Smrg fi 4252943345d3Smrg libobj="$output" 4253943345d3Smrg obj=`$echo "X$output" | $Xsed -e "$lo2o"` 4254943345d3Smrg ;; 4255943345d3Smrg *) 4256943345d3Smrg libobj= 4257943345d3Smrg obj="$output" 4258943345d3Smrg ;; 4259943345d3Smrg esac 4260943345d3Smrg 4261943345d3Smrg # Delete the old objects. 4262943345d3Smrg $run $rm $obj $libobj 4263943345d3Smrg 4264943345d3Smrg # Objects from convenience libraries. This assumes 4265943345d3Smrg # single-version convenience libraries. Whenever we create 4266943345d3Smrg # different ones for PIC/non-PIC, this we'll have to duplicate 4267943345d3Smrg # the extraction. 4268943345d3Smrg reload_conv_objs= 4269943345d3Smrg gentop= 4270943345d3Smrg # reload_cmds runs $LD directly, so let us get rid of 4271f67b85aaSmrg # -Wl from whole_archive_flag_spec and hope we can get by with 4272f67b85aaSmrg # turning comma into space.. 4273943345d3Smrg wl= 4274943345d3Smrg 4275943345d3Smrg if test -n "$convenience"; then 4276943345d3Smrg if test -n "$whole_archive_flag_spec"; then 4277f67b85aaSmrg eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" 4278f67b85aaSmrg reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` 4279943345d3Smrg else 4280943345d3Smrg gentop="$output_objdir/${obj}x" 4281943345d3Smrg generated="$generated $gentop" 4282943345d3Smrg 4283943345d3Smrg func_extract_archives $gentop $convenience 4284943345d3Smrg reload_conv_objs="$reload_objs $func_extract_archives_result" 4285943345d3Smrg fi 4286943345d3Smrg fi 4287943345d3Smrg 4288943345d3Smrg # Create the old-style object. 4289943345d3Smrg 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 4290943345d3Smrg 4291943345d3Smrg output="$obj" 4292943345d3Smrg cmds=$reload_cmds 4293943345d3Smrg save_ifs="$IFS"; IFS='~' 4294943345d3Smrg for cmd in $cmds; do 4295943345d3Smrg IFS="$save_ifs" 4296943345d3Smrg eval cmd=\"$cmd\" 4297943345d3Smrg $show "$cmd" 4298943345d3Smrg $run eval "$cmd" || exit $? 4299943345d3Smrg done 4300943345d3Smrg IFS="$save_ifs" 4301943345d3Smrg 4302943345d3Smrg # Exit if we aren't doing a library object file. 4303943345d3Smrg if test -z "$libobj"; then 4304943345d3Smrg if test -n "$gentop"; then 4305943345d3Smrg $show "${rm}r $gentop" 4306943345d3Smrg $run ${rm}r $gentop 4307943345d3Smrg fi 4308943345d3Smrg 4309943345d3Smrg exit $EXIT_SUCCESS 4310943345d3Smrg fi 4311943345d3Smrg 4312943345d3Smrg if test "$build_libtool_libs" != yes; then 4313943345d3Smrg if test -n "$gentop"; then 4314943345d3Smrg $show "${rm}r $gentop" 4315943345d3Smrg $run ${rm}r $gentop 4316943345d3Smrg fi 4317943345d3Smrg 4318943345d3Smrg # Create an invalid libtool object if no PIC, so that we don't 4319943345d3Smrg # accidentally link it into a program. 4320943345d3Smrg # $show "echo timestamp > $libobj" 4321943345d3Smrg # $run eval "echo timestamp > $libobj" || exit $? 4322943345d3Smrg exit $EXIT_SUCCESS 4323943345d3Smrg fi 4324943345d3Smrg 4325943345d3Smrg if test -n "$pic_flag" || test "$pic_mode" != default; then 4326943345d3Smrg # Only do commands if we really have different PIC objects. 4327943345d3Smrg reload_objs="$libobjs $reload_conv_objs" 4328943345d3Smrg output="$libobj" 4329943345d3Smrg cmds=$reload_cmds 4330943345d3Smrg save_ifs="$IFS"; IFS='~' 4331943345d3Smrg for cmd in $cmds; do 4332943345d3Smrg IFS="$save_ifs" 4333943345d3Smrg eval cmd=\"$cmd\" 4334943345d3Smrg $show "$cmd" 4335943345d3Smrg $run eval "$cmd" || exit $? 4336943345d3Smrg done 4337943345d3Smrg IFS="$save_ifs" 4338943345d3Smrg fi 4339943345d3Smrg 4340943345d3Smrg if test -n "$gentop"; then 4341943345d3Smrg $show "${rm}r $gentop" 4342943345d3Smrg $run ${rm}r $gentop 4343943345d3Smrg fi 4344943345d3Smrg 4345943345d3Smrg exit $EXIT_SUCCESS 4346943345d3Smrg ;; 4347943345d3Smrg 4348943345d3Smrg prog) 4349943345d3Smrg case $host in 4350943345d3Smrg *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; 4351943345d3Smrg esac 4352943345d3Smrg if test -n "$vinfo"; then 4353943345d3Smrg $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 4354943345d3Smrg fi 4355943345d3Smrg 4356943345d3Smrg if test -n "$release"; then 4357943345d3Smrg $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 4358943345d3Smrg fi 4359943345d3Smrg 4360943345d3Smrg if test "$preload" = yes; then 4361943345d3Smrg if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && 4362943345d3Smrg test "$dlopen_self_static" = unknown; then 4363943345d3Smrg $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." 4364943345d3Smrg fi 4365943345d3Smrg fi 4366943345d3Smrg 4367943345d3Smrg case $host in 4368943345d3Smrg *-*-rhapsody* | *-*-darwin1.[012]) 4369943345d3Smrg # On Rhapsody replace the C library is the System framework 4370943345d3Smrg compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` 4371943345d3Smrg finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` 4372943345d3Smrg ;; 4373943345d3Smrg esac 4374943345d3Smrg 4375943345d3Smrg case $host in 4376943345d3Smrg *darwin*) 4377943345d3Smrg # Don't allow lazy linking, it breaks C++ global constructors 4378943345d3Smrg if test "$tagname" = CXX ; then 4379943345d3Smrg compile_command="$compile_command ${wl}-bind_at_load" 4380943345d3Smrg finalize_command="$finalize_command ${wl}-bind_at_load" 4381943345d3Smrg fi 4382943345d3Smrg ;; 4383943345d3Smrg esac 4384943345d3Smrg 4385943345d3Smrg 4386943345d3Smrg # move library search paths that coincide with paths to not yet 4387943345d3Smrg # installed libraries to the beginning of the library search list 4388943345d3Smrg new_libs= 4389943345d3Smrg for path in $notinst_path; do 4390943345d3Smrg case " $new_libs " in 4391943345d3Smrg *" -L$path/$objdir "*) ;; 4392943345d3Smrg *) 4393943345d3Smrg case " $compile_deplibs " in 4394943345d3Smrg *" -L$path/$objdir "*) 4395943345d3Smrg new_libs="$new_libs -L$path/$objdir" ;; 4396943345d3Smrg esac 4397943345d3Smrg ;; 4398943345d3Smrg esac 4399943345d3Smrg done 4400943345d3Smrg for deplib in $compile_deplibs; do 4401943345d3Smrg case $deplib in 4402943345d3Smrg -L*) 4403943345d3Smrg case " $new_libs " in 4404943345d3Smrg *" $deplib "*) ;; 4405943345d3Smrg *) new_libs="$new_libs $deplib" ;; 4406943345d3Smrg esac 4407943345d3Smrg ;; 4408943345d3Smrg *) new_libs="$new_libs $deplib" ;; 4409943345d3Smrg esac 4410943345d3Smrg done 4411943345d3Smrg compile_deplibs="$new_libs" 4412943345d3Smrg 4413943345d3Smrg 4414943345d3Smrg compile_command="$compile_command $compile_deplibs" 4415943345d3Smrg finalize_command="$finalize_command $finalize_deplibs" 4416943345d3Smrg 4417943345d3Smrg if test -n "$rpath$xrpath"; then 4418943345d3Smrg # If the user specified any rpath flags, then add them. 4419943345d3Smrg for libdir in $rpath $xrpath; do 4420943345d3Smrg # This is the magic to use -rpath. 4421943345d3Smrg case "$finalize_rpath " in 4422943345d3Smrg *" $libdir "*) ;; 4423943345d3Smrg *) finalize_rpath="$finalize_rpath $libdir" ;; 4424943345d3Smrg esac 4425943345d3Smrg done 4426943345d3Smrg fi 4427943345d3Smrg 4428943345d3Smrg # Now hardcode the library paths 4429943345d3Smrg rpath= 4430943345d3Smrg hardcode_libdirs= 4431943345d3Smrg for libdir in $compile_rpath $finalize_rpath; do 4432943345d3Smrg if test -n "$hardcode_libdir_flag_spec"; then 4433943345d3Smrg if test -n "$hardcode_libdir_separator"; then 4434943345d3Smrg if test -z "$hardcode_libdirs"; then 4435943345d3Smrg hardcode_libdirs="$libdir" 4436943345d3Smrg else 4437943345d3Smrg # Just accumulate the unique libdirs. 4438943345d3Smrg case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in 4439943345d3Smrg *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) 4440943345d3Smrg ;; 4441943345d3Smrg *) 4442943345d3Smrg hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" 4443943345d3Smrg ;; 4444943345d3Smrg esac 4445943345d3Smrg fi 4446943345d3Smrg else 4447943345d3Smrg eval flag=\"$hardcode_libdir_flag_spec\" 4448943345d3Smrg rpath="$rpath $flag" 4449943345d3Smrg fi 4450943345d3Smrg elif test -n "$runpath_var"; then 4451943345d3Smrg case "$perm_rpath " in 4452943345d3Smrg *" $libdir "*) ;; 4453943345d3Smrg *) perm_rpath="$perm_rpath $libdir" ;; 4454943345d3Smrg esac 4455943345d3Smrg fi 4456943345d3Smrg case $host in 4457943345d3Smrg *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) 4458943345d3Smrg testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` 4459943345d3Smrg case :$dllsearchpath: in 4460943345d3Smrg *":$libdir:"*) ;; 4461943345d3Smrg *) dllsearchpath="$dllsearchpath:$libdir";; 4462943345d3Smrg esac 4463943345d3Smrg case :$dllsearchpath: in 4464943345d3Smrg *":$testbindir:"*) ;; 4465943345d3Smrg *) dllsearchpath="$dllsearchpath:$testbindir";; 4466943345d3Smrg esac 4467943345d3Smrg ;; 4468943345d3Smrg esac 4469943345d3Smrg done 4470943345d3Smrg # Substitute the hardcoded libdirs into the rpath. 4471943345d3Smrg if test -n "$hardcode_libdir_separator" && 4472943345d3Smrg test -n "$hardcode_libdirs"; then 4473943345d3Smrg libdir="$hardcode_libdirs" 4474943345d3Smrg eval rpath=\" $hardcode_libdir_flag_spec\" 4475943345d3Smrg fi 4476943345d3Smrg compile_rpath="$rpath" 4477943345d3Smrg 4478943345d3Smrg rpath= 4479943345d3Smrg hardcode_libdirs= 4480943345d3Smrg for libdir in $finalize_rpath; do 4481943345d3Smrg if test -n "$hardcode_libdir_flag_spec"; then 4482943345d3Smrg if test -n "$hardcode_libdir_separator"; then 4483943345d3Smrg if test -z "$hardcode_libdirs"; then 4484943345d3Smrg hardcode_libdirs="$libdir" 4485943345d3Smrg else 4486943345d3Smrg # Just accumulate the unique libdirs. 4487943345d3Smrg case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in 4488943345d3Smrg *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) 4489943345d3Smrg ;; 4490943345d3Smrg *) 4491943345d3Smrg hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" 4492943345d3Smrg ;; 4493943345d3Smrg esac 4494943345d3Smrg fi 4495943345d3Smrg else 4496943345d3Smrg eval flag=\"$hardcode_libdir_flag_spec\" 4497943345d3Smrg rpath="$rpath $flag" 4498943345d3Smrg fi 4499943345d3Smrg elif test -n "$runpath_var"; then 4500943345d3Smrg case "$finalize_perm_rpath " in 4501943345d3Smrg *" $libdir "*) ;; 4502943345d3Smrg *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; 4503943345d3Smrg esac 4504943345d3Smrg fi 4505943345d3Smrg done 4506943345d3Smrg # Substitute the hardcoded libdirs into the rpath. 4507943345d3Smrg if test -n "$hardcode_libdir_separator" && 4508943345d3Smrg test -n "$hardcode_libdirs"; then 4509943345d3Smrg libdir="$hardcode_libdirs" 4510943345d3Smrg eval rpath=\" $hardcode_libdir_flag_spec\" 4511943345d3Smrg fi 4512943345d3Smrg finalize_rpath="$rpath" 4513943345d3Smrg 4514943345d3Smrg if test -n "$libobjs" && test "$build_old_libs" = yes; then 4515943345d3Smrg # Transform all the library objects into standard objects. 4516943345d3Smrg compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` 4517943345d3Smrg finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` 4518943345d3Smrg fi 4519943345d3Smrg 4520943345d3Smrg dlsyms= 4521943345d3Smrg if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then 4522943345d3Smrg if test -n "$NM" && test -n "$global_symbol_pipe"; then 4523943345d3Smrg dlsyms="${outputname}S.c" 4524943345d3Smrg else 4525943345d3Smrg $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 4526943345d3Smrg fi 4527943345d3Smrg fi 4528943345d3Smrg 4529943345d3Smrg if test -n "$dlsyms"; then 4530943345d3Smrg case $dlsyms in 4531943345d3Smrg "") ;; 4532943345d3Smrg *.c) 4533943345d3Smrg # Discover the nlist of each of the dlfiles. 4534943345d3Smrg nlist="$output_objdir/${outputname}.nm" 4535943345d3Smrg 4536943345d3Smrg $show "$rm $nlist ${nlist}S ${nlist}T" 4537943345d3Smrg $run $rm "$nlist" "${nlist}S" "${nlist}T" 4538943345d3Smrg 4539943345d3Smrg # Parse the name list into a source file. 4540943345d3Smrg $show "creating $output_objdir/$dlsyms" 4541943345d3Smrg 4542943345d3Smrg test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ 4543943345d3Smrg/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ 4544943345d3Smrg/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ 4545943345d3Smrg 4546943345d3Smrg#ifdef __cplusplus 4547943345d3Smrgextern \"C\" { 4548943345d3Smrg#endif 4549943345d3Smrg 4550943345d3Smrg/* Prevent the only kind of declaration conflicts we can make. */ 4551943345d3Smrg#define lt_preloaded_symbols some_other_symbol 4552943345d3Smrg 4553943345d3Smrg/* External symbol declarations for the compiler. */\ 4554943345d3Smrg" 4555943345d3Smrg 4556943345d3Smrg if test "$dlself" = yes; then 4557943345d3Smrg $show "generating symbol list for \`$output'" 4558943345d3Smrg 4559943345d3Smrg test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" 4560943345d3Smrg 4561943345d3Smrg # Add our own program objects to the symbol list. 4562943345d3Smrg progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` 4563943345d3Smrg for arg in $progfiles; do 4564943345d3Smrg $show "extracting global C symbols from \`$arg'" 4565943345d3Smrg $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" 4566943345d3Smrg done 4567943345d3Smrg 4568943345d3Smrg if test -n "$exclude_expsyms"; then 4569943345d3Smrg $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' 4570943345d3Smrg $run eval '$mv "$nlist"T "$nlist"' 4571943345d3Smrg fi 4572943345d3Smrg 4573943345d3Smrg if test -n "$export_symbols_regex"; then 4574943345d3Smrg $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' 4575943345d3Smrg $run eval '$mv "$nlist"T "$nlist"' 4576943345d3Smrg fi 4577943345d3Smrg 4578943345d3Smrg # Prepare the list of exported symbols 4579943345d3Smrg if test -z "$export_symbols"; then 4580943345d3Smrg export_symbols="$output_objdir/$outputname.exp" 4581943345d3Smrg $run $rm $export_symbols 4582943345d3Smrg $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' 4583943345d3Smrg case $host in 4584943345d3Smrg *cygwin* | *mingw* ) 4585943345d3Smrg $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' 4586943345d3Smrg $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' 4587943345d3Smrg ;; 4588943345d3Smrg esac 4589943345d3Smrg else 4590943345d3Smrg $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' 4591943345d3Smrg $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' 4592943345d3Smrg $run eval 'mv "$nlist"T "$nlist"' 4593943345d3Smrg case $host in 4594943345d3Smrg *cygwin* | *mingw* ) 4595943345d3Smrg $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' 4596943345d3Smrg $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' 4597943345d3Smrg ;; 4598943345d3Smrg esac 4599943345d3Smrg fi 4600943345d3Smrg fi 4601943345d3Smrg 4602943345d3Smrg for arg in $dlprefiles; do 4603943345d3Smrg $show "extracting global C symbols from \`$arg'" 4604943345d3Smrg name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` 4605943345d3Smrg $run eval '$echo ": $name " >> "$nlist"' 4606943345d3Smrg $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" 4607943345d3Smrg done 4608943345d3Smrg 4609943345d3Smrg if test -z "$run"; then 4610943345d3Smrg # Make sure we have at least an empty file. 4611943345d3Smrg test -f "$nlist" || : > "$nlist" 4612943345d3Smrg 4613943345d3Smrg if test -n "$exclude_expsyms"; then 4614943345d3Smrg $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T 4615943345d3Smrg $mv "$nlist"T "$nlist" 4616943345d3Smrg fi 4617943345d3Smrg 4618943345d3Smrg # Try sorting and uniquifying the output. 4619943345d3Smrg if grep -v "^: " < "$nlist" | 4620943345d3Smrg if sort -k 3 </dev/null >/dev/null 2>&1; then 4621943345d3Smrg sort -k 3 4622943345d3Smrg else 4623943345d3Smrg sort +2 4624943345d3Smrg fi | 4625943345d3Smrg uniq > "$nlist"S; then 4626943345d3Smrg : 4627943345d3Smrg else 4628943345d3Smrg grep -v "^: " < "$nlist" > "$nlist"S 4629943345d3Smrg fi 4630943345d3Smrg 4631943345d3Smrg if test -f "$nlist"S; then 4632943345d3Smrg eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' 4633943345d3Smrg else 4634943345d3Smrg $echo '/* NONE */' >> "$output_objdir/$dlsyms" 4635943345d3Smrg fi 4636943345d3Smrg 4637943345d3Smrg $echo >> "$output_objdir/$dlsyms" "\ 4638943345d3Smrg 4639943345d3Smrg#undef lt_preloaded_symbols 4640943345d3Smrg 4641943345d3Smrg#if defined (__STDC__) && __STDC__ 4642943345d3Smrg# define lt_ptr void * 4643943345d3Smrg#else 4644943345d3Smrg# define lt_ptr char * 4645943345d3Smrg# define const 4646943345d3Smrg#endif 4647943345d3Smrg 4648943345d3Smrg/* The mapping between symbol names and symbols. */ 4649943345d3Smrg" 4650943345d3Smrg 4651943345d3Smrg case $host in 4652943345d3Smrg *cygwin* | *mingw* ) 4653943345d3Smrg $echo >> "$output_objdir/$dlsyms" "\ 4654943345d3Smrg/* DATA imports from DLLs on WIN32 can't be const, because 4655943345d3Smrg runtime relocations are performed -- see ld's documentation 4656943345d3Smrg on pseudo-relocs */ 4657943345d3Smrgstruct { 4658943345d3Smrg" 4659943345d3Smrg ;; 4660943345d3Smrg * ) 4661943345d3Smrg $echo >> "$output_objdir/$dlsyms" "\ 4662943345d3Smrgconst struct { 4663943345d3Smrg" 4664943345d3Smrg ;; 4665943345d3Smrg esac 4666943345d3Smrg 4667943345d3Smrg 4668943345d3Smrg $echo >> "$output_objdir/$dlsyms" "\ 4669943345d3Smrg const char *name; 4670943345d3Smrg lt_ptr address; 4671943345d3Smrg} 4672943345d3Smrglt_preloaded_symbols[] = 4673943345d3Smrg{\ 4674943345d3Smrg" 4675943345d3Smrg 4676943345d3Smrg eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" 4677943345d3Smrg 4678943345d3Smrg $echo >> "$output_objdir/$dlsyms" "\ 4679943345d3Smrg {0, (lt_ptr) 0} 4680943345d3Smrg}; 4681943345d3Smrg 4682943345d3Smrg/* This works around a problem in FreeBSD linker */ 4683943345d3Smrg#ifdef FREEBSD_WORKAROUND 4684943345d3Smrgstatic const void *lt_preloaded_setup() { 4685943345d3Smrg return lt_preloaded_symbols; 4686943345d3Smrg} 4687943345d3Smrg#endif 4688943345d3Smrg 4689943345d3Smrg#ifdef __cplusplus 4690943345d3Smrg} 4691943345d3Smrg#endif\ 4692943345d3Smrg" 4693943345d3Smrg fi 4694943345d3Smrg 4695943345d3Smrg pic_flag_for_symtable= 4696943345d3Smrg case $host in 4697943345d3Smrg # compiling the symbol table file with pic_flag works around 4698943345d3Smrg # a FreeBSD bug that causes programs to crash when -lm is 4699943345d3Smrg # linked before any other PIC object. But we must not use 4700943345d3Smrg # pic_flag when linking with -static. The problem exists in 4701943345d3Smrg # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. 4702943345d3Smrg *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) 4703943345d3Smrg case "$compile_command " in 4704943345d3Smrg *" -static "*) ;; 4705943345d3Smrg *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; 4706943345d3Smrg esac;; 4707943345d3Smrg *-*-hpux*) 4708943345d3Smrg case "$compile_command " in 4709943345d3Smrg *" -static "*) ;; 4710943345d3Smrg *) pic_flag_for_symtable=" $pic_flag";; 4711943345d3Smrg esac 4712943345d3Smrg esac 4713943345d3Smrg 4714943345d3Smrg # Now compile the dynamic symbol file. 4715943345d3Smrg $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" 4716943345d3Smrg $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? 4717943345d3Smrg 4718943345d3Smrg # Clean up the generated files. 4719943345d3Smrg $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" 4720943345d3Smrg $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" 4721943345d3Smrg 4722943345d3Smrg # Transform the symbol file into the correct name. 4723943345d3Smrg case $host in 4724943345d3Smrg *cygwin* | *mingw* ) 4725943345d3Smrg if test -f "$output_objdir/${outputname}.def" ; then 4726f67b85aaSmrg compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` 4727f67b85aaSmrg finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` 4728943345d3Smrg else 4729f67b85aaSmrg compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` 4730f67b85aaSmrg finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` 4731943345d3Smrg fi 4732943345d3Smrg ;; 4733943345d3Smrg * ) 4734f67b85aaSmrg compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` 4735f67b85aaSmrg finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` 4736943345d3Smrg ;; 4737943345d3Smrg esac 4738943345d3Smrg ;; 4739943345d3Smrg *) 4740943345d3Smrg $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 4741943345d3Smrg exit $EXIT_FAILURE 4742943345d3Smrg ;; 4743943345d3Smrg esac 4744943345d3Smrg else 4745943345d3Smrg # We keep going just in case the user didn't refer to 4746943345d3Smrg # lt_preloaded_symbols. The linker will fail if global_symbol_pipe 4747943345d3Smrg # really was required. 4748943345d3Smrg 4749943345d3Smrg # Nullify the symbol file. 4750f67b85aaSmrg compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` 4751f67b85aaSmrg finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` 4752943345d3Smrg fi 4753943345d3Smrg 4754943345d3Smrg if test "$need_relink" = no || test "$build_libtool_libs" != yes; then 4755943345d3Smrg # Replace the output file specification. 4756f67b85aaSmrg compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP` 4757943345d3Smrg link_command="$compile_command$compile_rpath" 4758943345d3Smrg 4759943345d3Smrg # We have no uninstalled library dependencies, so finalize right now. 4760943345d3Smrg $show "$link_command" 4761943345d3Smrg $run eval "$link_command" 4762943345d3Smrg exit_status=$? 4763943345d3Smrg 4764943345d3Smrg # Delete the generated files. 4765943345d3Smrg if test -n "$dlsyms"; then 4766943345d3Smrg $show "$rm $output_objdir/${outputname}S.${objext}" 4767943345d3Smrg $run $rm "$output_objdir/${outputname}S.${objext}" 4768943345d3Smrg fi 4769943345d3Smrg 4770943345d3Smrg exit $exit_status 4771943345d3Smrg fi 4772943345d3Smrg 4773943345d3Smrg if test -n "$shlibpath_var"; then 4774943345d3Smrg # We should set the shlibpath_var 4775943345d3Smrg rpath= 4776943345d3Smrg for dir in $temp_rpath; do 4777943345d3Smrg case $dir in 4778943345d3Smrg [\\/]* | [A-Za-z]:[\\/]*) 4779943345d3Smrg # Absolute path. 4780943345d3Smrg rpath="$rpath$dir:" 4781943345d3Smrg ;; 4782943345d3Smrg *) 4783943345d3Smrg # Relative path: add a thisdir entry. 4784943345d3Smrg rpath="$rpath\$thisdir/$dir:" 4785943345d3Smrg ;; 4786943345d3Smrg esac 4787943345d3Smrg done 4788943345d3Smrg temp_rpath="$rpath" 4789943345d3Smrg fi 4790943345d3Smrg 4791943345d3Smrg if test -n "$compile_shlibpath$finalize_shlibpath"; then 4792943345d3Smrg compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" 4793943345d3Smrg fi 4794943345d3Smrg if test -n "$finalize_shlibpath"; then 4795943345d3Smrg finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" 4796943345d3Smrg fi 4797943345d3Smrg 4798943345d3Smrg compile_var= 4799943345d3Smrg finalize_var= 4800943345d3Smrg if test -n "$runpath_var"; then 4801943345d3Smrg if test -n "$perm_rpath"; then 4802943345d3Smrg # We should set the runpath_var. 4803943345d3Smrg rpath= 4804943345d3Smrg for dir in $perm_rpath; do 4805943345d3Smrg rpath="$rpath$dir:" 4806943345d3Smrg done 4807943345d3Smrg compile_var="$runpath_var=\"$rpath\$$runpath_var\" " 4808943345d3Smrg fi 4809943345d3Smrg if test -n "$finalize_perm_rpath"; then 4810943345d3Smrg # We should set the runpath_var. 4811943345d3Smrg rpath= 4812943345d3Smrg for dir in $finalize_perm_rpath; do 4813943345d3Smrg rpath="$rpath$dir:" 4814943345d3Smrg done 4815943345d3Smrg finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " 4816943345d3Smrg fi 4817943345d3Smrg fi 4818943345d3Smrg 4819943345d3Smrg if test "$no_install" = yes; then 4820943345d3Smrg # We don't need to create a wrapper script. 4821943345d3Smrg link_command="$compile_var$compile_command$compile_rpath" 4822943345d3Smrg # Replace the output file specification. 4823943345d3Smrg link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` 4824943345d3Smrg # Delete the old output file. 4825943345d3Smrg $run $rm $output 4826943345d3Smrg # Link the executable and exit 4827943345d3Smrg $show "$link_command" 4828943345d3Smrg $run eval "$link_command" || exit $? 4829943345d3Smrg exit $EXIT_SUCCESS 4830943345d3Smrg fi 4831943345d3Smrg 4832943345d3Smrg if test "$hardcode_action" = relink; then 4833943345d3Smrg # Fast installation is not supported 4834943345d3Smrg link_command="$compile_var$compile_command$compile_rpath" 4835943345d3Smrg relink_command="$finalize_var$finalize_command$finalize_rpath" 4836943345d3Smrg 4837943345d3Smrg $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 4838943345d3Smrg $echo "$modename: \`$output' will be relinked during installation" 1>&2 4839943345d3Smrg else 4840943345d3Smrg if test "$fast_install" != no; then 4841943345d3Smrg link_command="$finalize_var$compile_command$finalize_rpath" 4842943345d3Smrg if test "$fast_install" = yes; then 4843f67b85aaSmrg relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP` 4844943345d3Smrg else 4845943345d3Smrg # fast_install is set to needless 4846943345d3Smrg relink_command= 4847943345d3Smrg fi 4848943345d3Smrg else 4849943345d3Smrg link_command="$compile_var$compile_command$compile_rpath" 4850943345d3Smrg relink_command="$finalize_var$finalize_command$finalize_rpath" 4851943345d3Smrg fi 4852943345d3Smrg fi 4853943345d3Smrg 4854943345d3Smrg # Replace the output file specification. 4855943345d3Smrg link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` 4856943345d3Smrg 4857943345d3Smrg # Delete the old output files. 4858943345d3Smrg $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname 4859943345d3Smrg 4860943345d3Smrg $show "$link_command" 4861943345d3Smrg $run eval "$link_command" || exit $? 4862943345d3Smrg 4863943345d3Smrg # Now create the wrapper script. 4864943345d3Smrg $show "creating $output" 4865943345d3Smrg 4866943345d3Smrg # Quote the relink command for shipping. 4867943345d3Smrg if test -n "$relink_command"; then 4868943345d3Smrg # Preserve any variables that may affect compiler behavior 4869943345d3Smrg for var in $variables_saved_for_relink; do 4870943345d3Smrg if eval test -z \"\${$var+set}\"; then 4871943345d3Smrg relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" 4872943345d3Smrg elif eval var_value=\$$var; test -z "$var_value"; then 4873943345d3Smrg relink_command="$var=; export $var; $relink_command" 4874943345d3Smrg else 4875943345d3Smrg var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` 4876943345d3Smrg relink_command="$var=\"$var_value\"; export $var; $relink_command" 4877943345d3Smrg fi 4878943345d3Smrg done 4879943345d3Smrg relink_command="(cd `pwd`; $relink_command)" 4880f67b85aaSmrg relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` 4881943345d3Smrg fi 4882943345d3Smrg 4883943345d3Smrg # Quote $echo for shipping. 4884943345d3Smrg if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then 4885943345d3Smrg case $progpath in 4886943345d3Smrg [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; 4887943345d3Smrg *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; 4888943345d3Smrg esac 4889943345d3Smrg qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` 4890943345d3Smrg else 4891943345d3Smrg qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` 4892943345d3Smrg fi 4893943345d3Smrg 4894943345d3Smrg # Only actually do things if our run command is non-null. 4895943345d3Smrg if test -z "$run"; then 4896943345d3Smrg # win32 will think the script is a binary if it has 4897943345d3Smrg # a .exe suffix, so we strip it off here. 4898943345d3Smrg case $output in 4899943345d3Smrg *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; 4900943345d3Smrg esac 4901943345d3Smrg # test for cygwin because mv fails w/o .exe extensions 4902943345d3Smrg case $host in 4903943345d3Smrg *cygwin*) 4904943345d3Smrg exeext=.exe 4905943345d3Smrg outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; 4906943345d3Smrg *) exeext= ;; 4907943345d3Smrg esac 4908943345d3Smrg case $host in 4909943345d3Smrg *cygwin* | *mingw* ) 4910943345d3Smrg output_name=`basename $output` 4911943345d3Smrg output_path=`dirname $output` 4912943345d3Smrg cwrappersource="$output_path/$objdir/lt-$output_name.c" 4913943345d3Smrg cwrapper="$output_path/$output_name.exe" 4914943345d3Smrg $rm $cwrappersource $cwrapper 4915943345d3Smrg trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 4916943345d3Smrg 4917943345d3Smrg cat > $cwrappersource <<EOF 4918943345d3Smrg 4919943345d3Smrg/* $cwrappersource - temporary wrapper executable for $objdir/$outputname 4920943345d3Smrg Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP 4921943345d3Smrg 4922943345d3Smrg The $output program cannot be directly executed until all the libtool 4923943345d3Smrg libraries that it depends on are installed. 4924943345d3Smrg 4925943345d3Smrg This wrapper executable should never be moved out of the build directory. 4926943345d3Smrg If it is, it will not operate correctly. 4927943345d3Smrg 4928943345d3Smrg Currently, it simply execs the wrapper *script* "/bin/sh $output", 4929943345d3Smrg but could eventually absorb all of the scripts functionality and 4930943345d3Smrg exec $objdir/$outputname directly. 4931943345d3Smrg*/ 4932943345d3SmrgEOF 4933943345d3Smrg cat >> $cwrappersource<<"EOF" 4934943345d3Smrg#include <stdio.h> 4935943345d3Smrg#include <stdlib.h> 4936943345d3Smrg#include <unistd.h> 4937943345d3Smrg#include <malloc.h> 4938943345d3Smrg#include <stdarg.h> 4939943345d3Smrg#include <assert.h> 4940943345d3Smrg#include <string.h> 4941943345d3Smrg#include <ctype.h> 4942943345d3Smrg#include <sys/stat.h> 4943943345d3Smrg 4944943345d3Smrg#if defined(PATH_MAX) 4945943345d3Smrg# define LT_PATHMAX PATH_MAX 4946943345d3Smrg#elif defined(MAXPATHLEN) 4947943345d3Smrg# define LT_PATHMAX MAXPATHLEN 4948943345d3Smrg#else 4949943345d3Smrg# define LT_PATHMAX 1024 4950943345d3Smrg#endif 4951943345d3Smrg 4952943345d3Smrg#ifndef DIR_SEPARATOR 4953943345d3Smrg# define DIR_SEPARATOR '/' 4954943345d3Smrg# define PATH_SEPARATOR ':' 4955943345d3Smrg#endif 4956943345d3Smrg 4957943345d3Smrg#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ 4958943345d3Smrg defined (__OS2__) 4959943345d3Smrg# define HAVE_DOS_BASED_FILE_SYSTEM 4960943345d3Smrg# ifndef DIR_SEPARATOR_2 4961943345d3Smrg# define DIR_SEPARATOR_2 '\\' 4962943345d3Smrg# endif 4963943345d3Smrg# ifndef PATH_SEPARATOR_2 4964943345d3Smrg# define PATH_SEPARATOR_2 ';' 4965943345d3Smrg# endif 4966943345d3Smrg#endif 4967943345d3Smrg 4968943345d3Smrg#ifndef DIR_SEPARATOR_2 4969943345d3Smrg# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) 4970943345d3Smrg#else /* DIR_SEPARATOR_2 */ 4971943345d3Smrg# define IS_DIR_SEPARATOR(ch) \ 4972943345d3Smrg (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) 4973943345d3Smrg#endif /* DIR_SEPARATOR_2 */ 4974943345d3Smrg 4975943345d3Smrg#ifndef PATH_SEPARATOR_2 4976943345d3Smrg# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) 4977943345d3Smrg#else /* PATH_SEPARATOR_2 */ 4978943345d3Smrg# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) 4979943345d3Smrg#endif /* PATH_SEPARATOR_2 */ 4980943345d3Smrg 4981943345d3Smrg#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) 4982943345d3Smrg#define XFREE(stale) do { \ 4983943345d3Smrg if (stale) { free ((void *) stale); stale = 0; } \ 4984943345d3Smrg} while (0) 4985943345d3Smrg 4986943345d3Smrg/* -DDEBUG is fairly common in CFLAGS. */ 4987943345d3Smrg#undef DEBUG 4988943345d3Smrg#if defined DEBUGWRAPPER 4989943345d3Smrg# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) 4990943345d3Smrg#else 4991943345d3Smrg# define DEBUG(format, ...) 4992943345d3Smrg#endif 4993943345d3Smrg 4994943345d3Smrgconst char *program_name = NULL; 4995943345d3Smrg 4996943345d3Smrgvoid * xmalloc (size_t num); 4997943345d3Smrgchar * xstrdup (const char *string); 4998943345d3Smrgconst char * base_name (const char *name); 4999943345d3Smrgchar * find_executable(const char *wrapper); 5000943345d3Smrgint check_executable(const char *path); 5001943345d3Smrgchar * strendzap(char *str, const char *pat); 5002943345d3Smrgvoid lt_fatal (const char *message, ...); 5003943345d3Smrg 5004943345d3Smrgint 5005943345d3Smrgmain (int argc, char *argv[]) 5006943345d3Smrg{ 5007943345d3Smrg char **newargz; 5008943345d3Smrg int i; 5009943345d3Smrg 5010943345d3Smrg program_name = (char *) xstrdup (base_name (argv[0])); 5011943345d3Smrg DEBUG("(main) argv[0] : %s\n",argv[0]); 5012943345d3Smrg DEBUG("(main) program_name : %s\n",program_name); 5013943345d3Smrg newargz = XMALLOC(char *, argc+2); 5014943345d3SmrgEOF 5015943345d3Smrg 5016943345d3Smrg cat >> $cwrappersource <<EOF 5017943345d3Smrg newargz[0] = (char *) xstrdup("$SHELL"); 5018943345d3SmrgEOF 5019943345d3Smrg 5020943345d3Smrg cat >> $cwrappersource <<"EOF" 5021943345d3Smrg newargz[1] = find_executable(argv[0]); 5022943345d3Smrg if (newargz[1] == NULL) 5023943345d3Smrg lt_fatal("Couldn't find %s", argv[0]); 5024943345d3Smrg DEBUG("(main) found exe at : %s\n",newargz[1]); 5025943345d3Smrg /* we know the script has the same name, without the .exe */ 5026943345d3Smrg /* so make sure newargz[1] doesn't end in .exe */ 5027943345d3Smrg strendzap(newargz[1],".exe"); 5028943345d3Smrg for (i = 1; i < argc; i++) 5029943345d3Smrg newargz[i+1] = xstrdup(argv[i]); 5030943345d3Smrg newargz[argc+1] = NULL; 5031943345d3Smrg 5032943345d3Smrg for (i=0; i<argc+1; i++) 5033943345d3Smrg { 5034943345d3Smrg DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]); 5035943345d3Smrg ; 5036943345d3Smrg } 5037943345d3Smrg 5038943345d3SmrgEOF 5039943345d3Smrg 5040943345d3Smrg case $host_os in 5041943345d3Smrg mingw*) 5042943345d3Smrg cat >> $cwrappersource <<EOF 5043943345d3Smrg execv("$SHELL",(char const **)newargz); 5044943345d3SmrgEOF 5045943345d3Smrg ;; 5046943345d3Smrg *) 5047943345d3Smrg cat >> $cwrappersource <<EOF 5048943345d3Smrg execv("$SHELL",newargz); 5049943345d3SmrgEOF 5050943345d3Smrg ;; 5051943345d3Smrg esac 5052943345d3Smrg 5053943345d3Smrg cat >> $cwrappersource <<"EOF" 5054943345d3Smrg return 127; 5055943345d3Smrg} 5056943345d3Smrg 5057943345d3Smrgvoid * 5058943345d3Smrgxmalloc (size_t num) 5059943345d3Smrg{ 5060943345d3Smrg void * p = (void *) malloc (num); 5061943345d3Smrg if (!p) 5062943345d3Smrg lt_fatal ("Memory exhausted"); 5063943345d3Smrg 5064943345d3Smrg return p; 5065943345d3Smrg} 5066943345d3Smrg 5067943345d3Smrgchar * 5068943345d3Smrgxstrdup (const char *string) 5069943345d3Smrg{ 5070943345d3Smrg return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL 5071943345d3Smrg; 5072943345d3Smrg} 5073943345d3Smrg 5074943345d3Smrgconst char * 5075943345d3Smrgbase_name (const char *name) 5076943345d3Smrg{ 5077943345d3Smrg const char *base; 5078943345d3Smrg 5079943345d3Smrg#if defined (HAVE_DOS_BASED_FILE_SYSTEM) 5080943345d3Smrg /* Skip over the disk name in MSDOS pathnames. */ 5081943345d3Smrg if (isalpha ((unsigned char)name[0]) && name[1] == ':') 5082943345d3Smrg name += 2; 5083943345d3Smrg#endif 5084943345d3Smrg 5085943345d3Smrg for (base = name; *name; name++) 5086943345d3Smrg if (IS_DIR_SEPARATOR (*name)) 5087943345d3Smrg base = name + 1; 5088943345d3Smrg return base; 5089943345d3Smrg} 5090943345d3Smrg 5091943345d3Smrgint 5092943345d3Smrgcheck_executable(const char * path) 5093943345d3Smrg{ 5094943345d3Smrg struct stat st; 5095943345d3Smrg 5096943345d3Smrg DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); 5097943345d3Smrg if ((!path) || (!*path)) 5098943345d3Smrg return 0; 5099943345d3Smrg 5100943345d3Smrg if ((stat (path, &st) >= 0) && 5101943345d3Smrg ( 5102943345d3Smrg /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ 5103943345d3Smrg#if defined (S_IXOTH) 5104943345d3Smrg ((st.st_mode & S_IXOTH) == S_IXOTH) || 5105943345d3Smrg#endif 5106943345d3Smrg#if defined (S_IXGRP) 5107943345d3Smrg ((st.st_mode & S_IXGRP) == S_IXGRP) || 5108943345d3Smrg#endif 5109943345d3Smrg ((st.st_mode & S_IXUSR) == S_IXUSR)) 5110943345d3Smrg ) 5111943345d3Smrg return 1; 5112943345d3Smrg else 5113943345d3Smrg return 0; 5114943345d3Smrg} 5115943345d3Smrg 5116943345d3Smrg/* Searches for the full path of the wrapper. Returns 5117943345d3Smrg newly allocated full path name if found, NULL otherwise */ 5118943345d3Smrgchar * 5119943345d3Smrgfind_executable (const char* wrapper) 5120943345d3Smrg{ 5121943345d3Smrg int has_slash = 0; 5122943345d3Smrg const char* p; 5123943345d3Smrg const char* p_next; 5124943345d3Smrg /* static buffer for getcwd */ 5125943345d3Smrg char tmp[LT_PATHMAX + 1]; 5126943345d3Smrg int tmp_len; 5127943345d3Smrg char* concat_name; 5128943345d3Smrg 5129943345d3Smrg DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); 5130943345d3Smrg 5131943345d3Smrg if ((wrapper == NULL) || (*wrapper == '\0')) 5132943345d3Smrg return NULL; 5133943345d3Smrg 5134943345d3Smrg /* Absolute path? */ 5135943345d3Smrg#if defined (HAVE_DOS_BASED_FILE_SYSTEM) 5136943345d3Smrg if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') 5137943345d3Smrg { 5138943345d3Smrg concat_name = xstrdup (wrapper); 5139943345d3Smrg if (check_executable(concat_name)) 5140943345d3Smrg return concat_name; 5141943345d3Smrg XFREE(concat_name); 5142943345d3Smrg } 5143943345d3Smrg else 5144943345d3Smrg { 5145943345d3Smrg#endif 5146943345d3Smrg if (IS_DIR_SEPARATOR (wrapper[0])) 5147943345d3Smrg { 5148943345d3Smrg concat_name = xstrdup (wrapper); 5149943345d3Smrg if (check_executable(concat_name)) 5150943345d3Smrg return concat_name; 5151943345d3Smrg XFREE(concat_name); 5152943345d3Smrg } 5153943345d3Smrg#if defined (HAVE_DOS_BASED_FILE_SYSTEM) 5154943345d3Smrg } 5155943345d3Smrg#endif 5156943345d3Smrg 5157943345d3Smrg for (p = wrapper; *p; p++) 5158943345d3Smrg if (*p == '/') 5159943345d3Smrg { 5160943345d3Smrg has_slash = 1; 5161943345d3Smrg break; 5162943345d3Smrg } 5163943345d3Smrg if (!has_slash) 5164943345d3Smrg { 5165943345d3Smrg /* no slashes; search PATH */ 5166943345d3Smrg const char* path = getenv ("PATH"); 5167943345d3Smrg if (path != NULL) 5168943345d3Smrg { 5169943345d3Smrg for (p = path; *p; p = p_next) 5170943345d3Smrg { 5171943345d3Smrg const char* q; 5172943345d3Smrg size_t p_len; 5173943345d3Smrg for (q = p; *q; q++) 5174943345d3Smrg if (IS_PATH_SEPARATOR(*q)) 5175943345d3Smrg break; 5176943345d3Smrg p_len = q - p; 5177943345d3Smrg p_next = (*q == '\0' ? q : q + 1); 5178943345d3Smrg if (p_len == 0) 5179943345d3Smrg { 5180943345d3Smrg /* empty path: current directory */ 5181943345d3Smrg if (getcwd (tmp, LT_PATHMAX) == NULL) 5182943345d3Smrg lt_fatal ("getcwd failed"); 5183943345d3Smrg tmp_len = strlen(tmp); 5184943345d3Smrg concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); 5185943345d3Smrg memcpy (concat_name, tmp, tmp_len); 5186943345d3Smrg concat_name[tmp_len] = '/'; 5187943345d3Smrg strcpy (concat_name + tmp_len + 1, wrapper); 5188943345d3Smrg } 5189943345d3Smrg else 5190943345d3Smrg { 5191943345d3Smrg concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); 5192943345d3Smrg memcpy (concat_name, p, p_len); 5193943345d3Smrg concat_name[p_len] = '/'; 5194943345d3Smrg strcpy (concat_name + p_len + 1, wrapper); 5195943345d3Smrg } 5196943345d3Smrg if (check_executable(concat_name)) 5197943345d3Smrg return concat_name; 5198943345d3Smrg XFREE(concat_name); 5199943345d3Smrg } 5200943345d3Smrg } 5201943345d3Smrg /* not found in PATH; assume curdir */ 5202943345d3Smrg } 5203943345d3Smrg /* Relative path | not found in path: prepend cwd */ 5204943345d3Smrg if (getcwd (tmp, LT_PATHMAX) == NULL) 5205943345d3Smrg lt_fatal ("getcwd failed"); 5206943345d3Smrg tmp_len = strlen(tmp); 5207943345d3Smrg concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); 5208943345d3Smrg memcpy (concat_name, tmp, tmp_len); 5209943345d3Smrg concat_name[tmp_len] = '/'; 5210943345d3Smrg strcpy (concat_name + tmp_len + 1, wrapper); 5211943345d3Smrg 5212943345d3Smrg if (check_executable(concat_name)) 5213943345d3Smrg return concat_name; 5214943345d3Smrg XFREE(concat_name); 5215943345d3Smrg return NULL; 5216943345d3Smrg} 5217943345d3Smrg 5218943345d3Smrgchar * 5219943345d3Smrgstrendzap(char *str, const char *pat) 5220943345d3Smrg{ 5221943345d3Smrg size_t len, patlen; 5222943345d3Smrg 5223943345d3Smrg assert(str != NULL); 5224943345d3Smrg assert(pat != NULL); 5225943345d3Smrg 5226943345d3Smrg len = strlen(str); 5227943345d3Smrg patlen = strlen(pat); 5228943345d3Smrg 5229943345d3Smrg if (patlen <= len) 5230943345d3Smrg { 5231943345d3Smrg str += len - patlen; 5232943345d3Smrg if (strcmp(str, pat) == 0) 5233943345d3Smrg *str = '\0'; 5234943345d3Smrg } 5235943345d3Smrg return str; 5236943345d3Smrg} 5237943345d3Smrg 5238943345d3Smrgstatic void 5239943345d3Smrglt_error_core (int exit_status, const char * mode, 5240943345d3Smrg const char * message, va_list ap) 5241943345d3Smrg{ 5242943345d3Smrg fprintf (stderr, "%s: %s: ", program_name, mode); 5243943345d3Smrg vfprintf (stderr, message, ap); 5244943345d3Smrg fprintf (stderr, ".\n"); 5245943345d3Smrg 5246943345d3Smrg if (exit_status >= 0) 5247943345d3Smrg exit (exit_status); 5248943345d3Smrg} 5249943345d3Smrg 5250943345d3Smrgvoid 5251943345d3Smrglt_fatal (const char *message, ...) 5252943345d3Smrg{ 5253943345d3Smrg va_list ap; 5254943345d3Smrg va_start (ap, message); 5255943345d3Smrg lt_error_core (EXIT_FAILURE, "FATAL", message, ap); 5256943345d3Smrg va_end (ap); 5257943345d3Smrg} 5258943345d3SmrgEOF 5259943345d3Smrg # we should really use a build-platform specific compiler 5260943345d3Smrg # here, but OTOH, the wrappers (shell script and this C one) 5261943345d3Smrg # are only useful if you want to execute the "real" binary. 5262943345d3Smrg # Since the "real" binary is built for $host, then this 5263943345d3Smrg # wrapper might as well be built for $host, too. 5264943345d3Smrg $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource 5265943345d3Smrg ;; 5266943345d3Smrg esac 5267943345d3Smrg $rm $output 5268943345d3Smrg trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 5269943345d3Smrg 5270943345d3Smrg $echo > $output "\ 5271943345d3Smrg#! $SHELL 5272943345d3Smrg 5273943345d3Smrg# $output - temporary wrapper script for $objdir/$outputname 5274943345d3Smrg# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP 5275943345d3Smrg# 5276943345d3Smrg# The $output program cannot be directly executed until all the libtool 5277943345d3Smrg# libraries that it depends on are installed. 5278943345d3Smrg# 5279943345d3Smrg# This wrapper script should never be moved out of the build directory. 5280943345d3Smrg# If it is, it will not operate correctly. 5281943345d3Smrg 5282943345d3Smrg# Sed substitution that helps us do robust quoting. It backslashifies 5283943345d3Smrg# metacharacters that are still active within double-quoted strings. 5284943345d3SmrgXsed='${SED} -e 1s/^X//' 5285943345d3Smrgsed_quote_subst='$sed_quote_subst' 5286943345d3Smrg 5287f67b85aaSmrg# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). 5288f67b85aaSmrgif test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then 5289f67b85aaSmrg emulate sh 5290f67b85aaSmrg NULLCMD=: 5291f67b85aaSmrg # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which 5292f67b85aaSmrg # is contrary to our usage. Disable this feature. 5293f67b85aaSmrg alias -g '\${1+\"\$@\"}'='\"\$@\"' 5294f67b85aaSmrg setopt NO_GLOB_SUBST 5295f67b85aaSmrgelse 5296f67b85aaSmrg case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac 5297f67b85aaSmrgfi 5298f67b85aaSmrg 5299943345d3Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout 5300943345d3Smrg# if CDPATH is set. 5301943345d3Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH 5302943345d3Smrg 5303943345d3Smrgrelink_command=\"$relink_command\" 5304943345d3Smrg 5305943345d3Smrg# This environment variable determines our operation mode. 5306943345d3Smrgif test \"\$libtool_install_magic\" = \"$magic\"; then 5307943345d3Smrg # install mode needs the following variable: 5308943345d3Smrg notinst_deplibs='$notinst_deplibs' 5309943345d3Smrgelse 5310943345d3Smrg # When we are sourced in execute mode, \$file and \$echo are already set. 5311943345d3Smrg if test \"\$libtool_execute_magic\" != \"$magic\"; then 5312943345d3Smrg echo=\"$qecho\" 5313943345d3Smrg file=\"\$0\" 5314943345d3Smrg # Make sure echo works. 5315943345d3Smrg if test \"X\$1\" = X--no-reexec; then 5316943345d3Smrg # Discard the --no-reexec flag, and continue. 5317943345d3Smrg shift 5318943345d3Smrg elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then 5319943345d3Smrg # Yippee, \$echo works! 5320943345d3Smrg : 5321943345d3Smrg else 5322943345d3Smrg # Restart under the correct shell, and then maybe \$echo will work. 5323943345d3Smrg exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} 5324943345d3Smrg fi 5325943345d3Smrg fi\ 5326943345d3Smrg" 5327943345d3Smrg $echo >> $output "\ 5328943345d3Smrg 5329943345d3Smrg # Find the directory that this script lives in. 5330943345d3Smrg thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` 5331943345d3Smrg test \"x\$thisdir\" = \"x\$file\" && thisdir=. 5332943345d3Smrg 5333943345d3Smrg # Follow symbolic links until we get to the real thisdir. 5334943345d3Smrg file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` 5335943345d3Smrg while test -n \"\$file\"; do 5336943345d3Smrg destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` 5337943345d3Smrg 5338943345d3Smrg # If there was a directory component, then change thisdir. 5339943345d3Smrg if test \"x\$destdir\" != \"x\$file\"; then 5340943345d3Smrg case \"\$destdir\" in 5341943345d3Smrg [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; 5342943345d3Smrg *) thisdir=\"\$thisdir/\$destdir\" ;; 5343943345d3Smrg esac 5344943345d3Smrg fi 5345943345d3Smrg 5346943345d3Smrg file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` 5347943345d3Smrg file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` 5348943345d3Smrg done 5349943345d3Smrg 5350943345d3Smrg # Try to get the absolute directory name. 5351943345d3Smrg absdir=\`cd \"\$thisdir\" && pwd\` 5352943345d3Smrg test -n \"\$absdir\" && thisdir=\"\$absdir\" 5353943345d3Smrg" 5354943345d3Smrg 5355943345d3Smrg if test "$fast_install" = yes; then 5356943345d3Smrg $echo >> $output "\ 5357943345d3Smrg program=lt-'$outputname'$exeext 5358943345d3Smrg progdir=\"\$thisdir/$objdir\" 5359943345d3Smrg 5360943345d3Smrg if test ! -f \"\$progdir/\$program\" || \\ 5361943345d3Smrg { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ 5362943345d3Smrg test \"X\$file\" != \"X\$progdir/\$program\"; }; then 5363943345d3Smrg 5364943345d3Smrg file=\"\$\$-\$program\" 5365943345d3Smrg 5366943345d3Smrg if test ! -d \"\$progdir\"; then 5367943345d3Smrg $mkdir \"\$progdir\" 5368943345d3Smrg else 5369943345d3Smrg $rm \"\$progdir/\$file\" 5370943345d3Smrg fi" 5371943345d3Smrg 5372943345d3Smrg $echo >> $output "\ 5373943345d3Smrg 5374943345d3Smrg # relink executable if necessary 5375943345d3Smrg if test -n \"\$relink_command\"; then 5376943345d3Smrg if relink_command_output=\`eval \$relink_command 2>&1\`; then : 5377943345d3Smrg else 5378943345d3Smrg $echo \"\$relink_command_output\" >&2 5379943345d3Smrg $rm \"\$progdir/\$file\" 5380943345d3Smrg exit $EXIT_FAILURE 5381943345d3Smrg fi 5382943345d3Smrg fi 5383943345d3Smrg 5384943345d3Smrg $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || 5385943345d3Smrg { $rm \"\$progdir/\$program\"; 5386943345d3Smrg $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } 5387943345d3Smrg $rm \"\$progdir/\$file\" 5388943345d3Smrg fi" 5389943345d3Smrg else 5390943345d3Smrg $echo >> $output "\ 5391943345d3Smrg program='$outputname' 5392943345d3Smrg progdir=\"\$thisdir/$objdir\" 5393943345d3Smrg" 5394943345d3Smrg fi 5395943345d3Smrg 5396943345d3Smrg $echo >> $output "\ 5397943345d3Smrg 5398943345d3Smrg if test -f \"\$progdir/\$program\"; then" 5399943345d3Smrg 5400943345d3Smrg # Export our shlibpath_var if we have one. 5401943345d3Smrg if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then 5402943345d3Smrg $echo >> $output "\ 5403943345d3Smrg # Add our own library path to $shlibpath_var 5404943345d3Smrg $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" 5405943345d3Smrg 5406943345d3Smrg # Some systems cannot cope with colon-terminated $shlibpath_var 5407943345d3Smrg # The second colon is a workaround for a bug in BeOS R4 sed 5408943345d3Smrg $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` 5409943345d3Smrg 5410943345d3Smrg export $shlibpath_var 5411943345d3Smrg" 5412943345d3Smrg fi 5413943345d3Smrg 5414943345d3Smrg # fixup the dll searchpath if we need to. 5415943345d3Smrg if test -n "$dllsearchpath"; then 5416943345d3Smrg $echo >> $output "\ 5417943345d3Smrg # Add the dll search path components to the executable PATH 5418943345d3Smrg PATH=$dllsearchpath:\$PATH 5419943345d3Smrg" 5420943345d3Smrg fi 5421943345d3Smrg 5422943345d3Smrg $echo >> $output "\ 5423943345d3Smrg if test \"\$libtool_execute_magic\" != \"$magic\"; then 5424943345d3Smrg # Run the actual program with our arguments. 5425943345d3Smrg" 5426943345d3Smrg case $host in 5427943345d3Smrg # Backslashes separate directories on plain windows 5428943345d3Smrg *-*-mingw | *-*-os2*) 5429943345d3Smrg $echo >> $output "\ 5430943345d3Smrg exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} 5431943345d3Smrg" 5432943345d3Smrg ;; 5433943345d3Smrg 5434943345d3Smrg *) 5435943345d3Smrg $echo >> $output "\ 5436943345d3Smrg exec \"\$progdir/\$program\" \${1+\"\$@\"} 5437943345d3Smrg" 5438943345d3Smrg ;; 5439943345d3Smrg esac 5440943345d3Smrg $echo >> $output "\ 5441f67b85aaSmrg \$echo \"\$0: cannot exec \$program \$*\" 5442943345d3Smrg exit $EXIT_FAILURE 5443943345d3Smrg fi 5444943345d3Smrg else 5445943345d3Smrg # The program doesn't exist. 5446943345d3Smrg \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 5447943345d3Smrg \$echo \"This script is just a wrapper for \$program.\" 1>&2 5448943345d3Smrg $echo \"See the $PACKAGE documentation for more information.\" 1>&2 5449943345d3Smrg exit $EXIT_FAILURE 5450943345d3Smrg fi 5451943345d3Smrgfi\ 5452943345d3Smrg" 5453943345d3Smrg chmod +x $output 5454943345d3Smrg fi 5455943345d3Smrg exit $EXIT_SUCCESS 5456943345d3Smrg ;; 5457943345d3Smrg esac 5458943345d3Smrg 5459943345d3Smrg # See if we need to build an old-fashioned archive. 5460943345d3Smrg for oldlib in $oldlibs; do 5461943345d3Smrg 5462943345d3Smrg if test "$build_libtool_libs" = convenience; then 5463943345d3Smrg oldobjs="$libobjs_save" 5464943345d3Smrg addlibs="$convenience" 5465943345d3Smrg build_libtool_libs=no 5466943345d3Smrg else 5467943345d3Smrg if test "$build_libtool_libs" = module; then 5468943345d3Smrg oldobjs="$libobjs_save" 5469943345d3Smrg build_libtool_libs=no 5470943345d3Smrg else 5471943345d3Smrg oldobjs="$old_deplibs $non_pic_objects" 5472943345d3Smrg fi 5473943345d3Smrg addlibs="$old_convenience" 5474943345d3Smrg fi 5475943345d3Smrg 5476943345d3Smrg if test -n "$addlibs"; then 5477943345d3Smrg gentop="$output_objdir/${outputname}x" 5478943345d3Smrg generated="$generated $gentop" 5479943345d3Smrg 5480943345d3Smrg func_extract_archives $gentop $addlibs 5481943345d3Smrg oldobjs="$oldobjs $func_extract_archives_result" 5482943345d3Smrg fi 5483943345d3Smrg 5484943345d3Smrg # Do each command in the archive commands. 5485943345d3Smrg if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then 5486943345d3Smrg cmds=$old_archive_from_new_cmds 5487943345d3Smrg else 5488943345d3Smrg # POSIX demands no paths to be encoded in archives. We have 5489943345d3Smrg # to avoid creating archives with duplicate basenames if we 5490943345d3Smrg # might have to extract them afterwards, e.g., when creating a 5491943345d3Smrg # static archive out of a convenience library, or when linking 5492943345d3Smrg # the entirety of a libtool archive into another (currently 5493943345d3Smrg # not supported by libtool). 5494943345d3Smrg if (for obj in $oldobjs 5495943345d3Smrg do 5496943345d3Smrg $echo "X$obj" | $Xsed -e 's%^.*/%%' 5497943345d3Smrg done | sort | sort -uc >/dev/null 2>&1); then 5498943345d3Smrg : 5499943345d3Smrg else 5500943345d3Smrg $echo "copying selected object files to avoid basename conflicts..." 5501943345d3Smrg 5502943345d3Smrg if test -z "$gentop"; then 5503943345d3Smrg gentop="$output_objdir/${outputname}x" 5504943345d3Smrg generated="$generated $gentop" 5505943345d3Smrg 5506943345d3Smrg $show "${rm}r $gentop" 5507943345d3Smrg $run ${rm}r "$gentop" 5508943345d3Smrg $show "$mkdir $gentop" 5509943345d3Smrg $run $mkdir "$gentop" 5510943345d3Smrg exit_status=$? 5511943345d3Smrg if test "$exit_status" -ne 0 && test ! -d "$gentop"; then 5512943345d3Smrg exit $exit_status 5513943345d3Smrg fi 5514943345d3Smrg fi 5515943345d3Smrg 5516943345d3Smrg save_oldobjs=$oldobjs 5517943345d3Smrg oldobjs= 5518943345d3Smrg counter=1 5519943345d3Smrg for obj in $save_oldobjs 5520943345d3Smrg do 5521943345d3Smrg objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` 5522943345d3Smrg case " $oldobjs " in 5523943345d3Smrg " ") oldobjs=$obj ;; 5524943345d3Smrg *[\ /]"$objbase "*) 5525943345d3Smrg while :; do 5526943345d3Smrg # Make sure we don't pick an alternate name that also 5527943345d3Smrg # overlaps. 5528943345d3Smrg newobj=lt$counter-$objbase 5529943345d3Smrg counter=`expr $counter + 1` 5530943345d3Smrg case " $oldobjs " in 5531943345d3Smrg *[\ /]"$newobj "*) ;; 5532943345d3Smrg *) if test ! -f "$gentop/$newobj"; then break; fi ;; 5533943345d3Smrg esac 5534943345d3Smrg done 5535943345d3Smrg $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" 5536943345d3Smrg $run ln "$obj" "$gentop/$newobj" || 5537943345d3Smrg $run cp "$obj" "$gentop/$newobj" 5538943345d3Smrg oldobjs="$oldobjs $gentop/$newobj" 5539943345d3Smrg ;; 5540943345d3Smrg *) oldobjs="$oldobjs $obj" ;; 5541943345d3Smrg esac 5542943345d3Smrg done 5543943345d3Smrg fi 5544943345d3Smrg 5545943345d3Smrg eval cmds=\"$old_archive_cmds\" 5546943345d3Smrg 5547943345d3Smrg if len=`expr "X$cmds" : ".*"` && 5548943345d3Smrg test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then 5549943345d3Smrg cmds=$old_archive_cmds 5550943345d3Smrg else 5551943345d3Smrg # the command line is too long to link in one step, link in parts 5552943345d3Smrg $echo "using piecewise archive linking..." 5553943345d3Smrg save_RANLIB=$RANLIB 5554943345d3Smrg RANLIB=: 5555943345d3Smrg objlist= 5556943345d3Smrg concat_cmds= 5557943345d3Smrg save_oldobjs=$oldobjs 5558943345d3Smrg 5559943345d3Smrg # Is there a better way of finding the last object in the list? 5560943345d3Smrg for obj in $save_oldobjs 5561943345d3Smrg do 5562943345d3Smrg last_oldobj=$obj 5563943345d3Smrg done 5564943345d3Smrg for obj in $save_oldobjs 5565943345d3Smrg do 5566943345d3Smrg oldobjs="$objlist $obj" 5567943345d3Smrg objlist="$objlist $obj" 5568943345d3Smrg eval test_cmds=\"$old_archive_cmds\" 5569943345d3Smrg if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && 5570943345d3Smrg test "$len" -le "$max_cmd_len"; then 5571943345d3Smrg : 5572943345d3Smrg else 5573943345d3Smrg # the above command should be used before it gets too long 5574943345d3Smrg oldobjs=$objlist 5575943345d3Smrg if test "$obj" = "$last_oldobj" ; then 5576943345d3Smrg RANLIB=$save_RANLIB 5577943345d3Smrg fi 5578943345d3Smrg test -z "$concat_cmds" || concat_cmds=$concat_cmds~ 5579943345d3Smrg eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" 5580943345d3Smrg objlist= 5581943345d3Smrg fi 5582943345d3Smrg done 5583943345d3Smrg RANLIB=$save_RANLIB 5584943345d3Smrg oldobjs=$objlist 5585943345d3Smrg if test "X$oldobjs" = "X" ; then 5586943345d3Smrg eval cmds=\"\$concat_cmds\" 5587943345d3Smrg else 5588943345d3Smrg eval cmds=\"\$concat_cmds~\$old_archive_cmds\" 5589943345d3Smrg fi 5590943345d3Smrg fi 5591943345d3Smrg fi 5592943345d3Smrg save_ifs="$IFS"; IFS='~' 5593943345d3Smrg for cmd in $cmds; do 5594943345d3Smrg eval cmd=\"$cmd\" 5595943345d3Smrg IFS="$save_ifs" 5596943345d3Smrg $show "$cmd" 5597943345d3Smrg $run eval "$cmd" || exit $? 5598943345d3Smrg done 5599943345d3Smrg IFS="$save_ifs" 5600943345d3Smrg done 5601943345d3Smrg 5602943345d3Smrg if test -n "$generated"; then 5603943345d3Smrg $show "${rm}r$generated" 5604943345d3Smrg $run ${rm}r$generated 5605943345d3Smrg fi 5606943345d3Smrg 5607943345d3Smrg # Now create the libtool archive. 5608943345d3Smrg case $output in 5609943345d3Smrg *.la) 5610943345d3Smrg old_library= 5611943345d3Smrg test "$build_old_libs" = yes && old_library="$libname.$libext" 5612943345d3Smrg $show "creating $output" 5613943345d3Smrg 5614943345d3Smrg # Preserve any variables that may affect compiler behavior 5615943345d3Smrg for var in $variables_saved_for_relink; do 5616943345d3Smrg if eval test -z \"\${$var+set}\"; then 5617943345d3Smrg relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" 5618943345d3Smrg elif eval var_value=\$$var; test -z "$var_value"; then 5619943345d3Smrg relink_command="$var=; export $var; $relink_command" 5620943345d3Smrg else 5621943345d3Smrg var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` 5622943345d3Smrg relink_command="$var=\"$var_value\"; export $var; $relink_command" 5623943345d3Smrg fi 5624943345d3Smrg done 5625943345d3Smrg # Quote the link command for shipping. 5626943345d3Smrg relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" 5627f67b85aaSmrg relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` 5628943345d3Smrg if test "$hardcode_automatic" = yes ; then 5629943345d3Smrg relink_command= 5630943345d3Smrg fi 5631943345d3Smrg 5632943345d3Smrg 5633943345d3Smrg # Only create the output if not a dry run. 5634943345d3Smrg if test -z "$run"; then 5635943345d3Smrg for installed in no yes; do 5636943345d3Smrg if test "$installed" = yes; then 5637943345d3Smrg if test -z "$install_libdir"; then 5638943345d3Smrg break 5639943345d3Smrg fi 5640943345d3Smrg output="$output_objdir/$outputname"i 5641943345d3Smrg # Replace all uninstalled libtool libraries with the installed ones 5642943345d3Smrg newdependency_libs= 5643943345d3Smrg for deplib in $dependency_libs; do 5644943345d3Smrg case $deplib in 5645943345d3Smrg *.la) 5646943345d3Smrg name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` 5647943345d3Smrg eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` 5648943345d3Smrg if test -z "$libdir"; then 5649943345d3Smrg $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 5650943345d3Smrg exit $EXIT_FAILURE 5651943345d3Smrg fi 5652943345d3Smrg newdependency_libs="$newdependency_libs $libdir/$name" 5653943345d3Smrg ;; 5654943345d3Smrg *) newdependency_libs="$newdependency_libs $deplib" ;; 5655943345d3Smrg esac 5656943345d3Smrg done 5657943345d3Smrg dependency_libs="$newdependency_libs" 5658943345d3Smrg newdlfiles= 5659943345d3Smrg for lib in $dlfiles; do 5660943345d3Smrg name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` 5661943345d3Smrg eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` 5662943345d3Smrg if test -z "$libdir"; then 5663943345d3Smrg $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 5664943345d3Smrg exit $EXIT_FAILURE 5665943345d3Smrg fi 5666943345d3Smrg newdlfiles="$newdlfiles $libdir/$name" 5667943345d3Smrg done 5668943345d3Smrg dlfiles="$newdlfiles" 5669943345d3Smrg newdlprefiles= 5670943345d3Smrg for lib in $dlprefiles; do 5671943345d3Smrg name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` 5672943345d3Smrg eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` 5673943345d3Smrg if test -z "$libdir"; then 5674943345d3Smrg $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 5675943345d3Smrg exit $EXIT_FAILURE 5676943345d3Smrg fi 5677943345d3Smrg newdlprefiles="$newdlprefiles $libdir/$name" 5678943345d3Smrg done 5679943345d3Smrg dlprefiles="$newdlprefiles" 5680943345d3Smrg else 5681943345d3Smrg newdlfiles= 5682943345d3Smrg for lib in $dlfiles; do 5683943345d3Smrg case $lib in 5684943345d3Smrg [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; 5685943345d3Smrg *) abs=`pwd`"/$lib" ;; 5686943345d3Smrg esac 5687943345d3Smrg newdlfiles="$newdlfiles $abs" 5688943345d3Smrg done 5689943345d3Smrg dlfiles="$newdlfiles" 5690943345d3Smrg newdlprefiles= 5691943345d3Smrg for lib in $dlprefiles; do 5692943345d3Smrg case $lib in 5693943345d3Smrg [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; 5694943345d3Smrg *) abs=`pwd`"/$lib" ;; 5695943345d3Smrg esac 5696943345d3Smrg newdlprefiles="$newdlprefiles $abs" 5697943345d3Smrg done 5698943345d3Smrg dlprefiles="$newdlprefiles" 5699943345d3Smrg fi 5700943345d3Smrg $rm $output 5701943345d3Smrg # place dlname in correct position for cygwin 5702943345d3Smrg tdlname=$dlname 5703943345d3Smrg case $host,$output,$installed,$module,$dlname in 5704943345d3Smrg *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; 5705943345d3Smrg esac 5706943345d3Smrg $echo > $output "\ 5707943345d3Smrg# $outputname - a libtool library file 5708943345d3Smrg# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP 5709943345d3Smrg# 5710943345d3Smrg# Please DO NOT delete this file! 5711943345d3Smrg# It is necessary for linking the library. 5712943345d3Smrg 5713943345d3Smrg# The name that we can dlopen(3). 5714943345d3Smrgdlname='$tdlname' 5715943345d3Smrg 5716943345d3Smrg# Names of this library. 5717943345d3Smrglibrary_names='$library_names' 5718943345d3Smrg 5719943345d3Smrg# The name of the static archive. 5720943345d3Smrgold_library='$old_library' 5721943345d3Smrg 5722943345d3Smrg# Libraries that this one depends upon. 5723943345d3Smrgdependency_libs='$dependency_libs' 5724943345d3Smrg 5725943345d3Smrg# Version information for $libname. 5726943345d3Smrgcurrent=$current 5727943345d3Smrgage=$age 5728943345d3Smrgrevision=$revision 5729943345d3Smrg 5730943345d3Smrg# Is this an already installed library? 5731943345d3Smrginstalled=$installed 5732943345d3Smrg 5733943345d3Smrg# Should we warn about portability when linking against -modules? 5734943345d3Smrgshouldnotlink=$module 5735943345d3Smrg 5736943345d3Smrg# Files to dlopen/dlpreopen 5737943345d3Smrgdlopen='$dlfiles' 5738943345d3Smrgdlpreopen='$dlprefiles' 5739943345d3Smrg 5740943345d3Smrg# Directory that this library needs to be installed in: 5741943345d3Smrglibdir='$install_libdir'" 5742943345d3Smrg if test "$installed" = no && test "$need_relink" = yes; then 5743943345d3Smrg $echo >> $output "\ 5744943345d3Smrgrelink_command=\"$relink_command\"" 5745943345d3Smrg fi 5746943345d3Smrg done 5747943345d3Smrg fi 5748943345d3Smrg 5749943345d3Smrg # Do a symbolic link so that the libtool archive can be found in 5750943345d3Smrg # LD_LIBRARY_PATH before the program is installed. 5751943345d3Smrg $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" 5752943345d3Smrg $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? 5753943345d3Smrg ;; 5754943345d3Smrg esac 5755943345d3Smrg exit $EXIT_SUCCESS 5756943345d3Smrg ;; 5757943345d3Smrg 5758943345d3Smrg # libtool install mode 5759943345d3Smrg install) 5760943345d3Smrg modename="$modename: install" 5761943345d3Smrg 5762943345d3Smrg # There may be an optional sh(1) argument at the beginning of 5763943345d3Smrg # install_prog (especially on Windows NT). 5764943345d3Smrg if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || 5765943345d3Smrg # Allow the use of GNU shtool's install command. 5766943345d3Smrg $echo "X$nonopt" | grep shtool > /dev/null; then 5767943345d3Smrg # Aesthetically quote it. 5768943345d3Smrg arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` 5769943345d3Smrg case $arg in 5770943345d3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 5771943345d3Smrg arg="\"$arg\"" 5772943345d3Smrg ;; 5773943345d3Smrg esac 5774943345d3Smrg install_prog="$arg " 5775943345d3Smrg arg="$1" 5776943345d3Smrg shift 5777943345d3Smrg else 5778943345d3Smrg install_prog= 5779943345d3Smrg arg=$nonopt 5780943345d3Smrg fi 5781943345d3Smrg 5782943345d3Smrg # The real first argument should be the name of the installation program. 5783943345d3Smrg # Aesthetically quote it. 5784943345d3Smrg arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` 5785943345d3Smrg case $arg in 5786943345d3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 5787943345d3Smrg arg="\"$arg\"" 5788943345d3Smrg ;; 5789943345d3Smrg esac 5790943345d3Smrg install_prog="$install_prog$arg" 5791943345d3Smrg 5792943345d3Smrg # We need to accept at least all the BSD install flags. 5793943345d3Smrg dest= 5794943345d3Smrg files= 5795943345d3Smrg opts= 5796943345d3Smrg prev= 5797943345d3Smrg install_type= 5798943345d3Smrg isdir=no 5799943345d3Smrg stripme= 5800943345d3Smrg for arg 5801943345d3Smrg do 5802943345d3Smrg if test -n "$dest"; then 5803943345d3Smrg files="$files $dest" 5804943345d3Smrg dest=$arg 5805943345d3Smrg continue 5806943345d3Smrg fi 5807943345d3Smrg 5808943345d3Smrg case $arg in 5809943345d3Smrg -d) isdir=yes ;; 5810943345d3Smrg -f) 5811943345d3Smrg case " $install_prog " in 5812943345d3Smrg *[\\\ /]cp\ *) ;; 5813943345d3Smrg *) prev=$arg ;; 5814943345d3Smrg esac 5815943345d3Smrg ;; 5816943345d3Smrg -g | -m | -o) prev=$arg ;; 5817943345d3Smrg -s) 5818943345d3Smrg stripme=" -s" 5819943345d3Smrg continue 5820943345d3Smrg ;; 5821943345d3Smrg -*) 5822943345d3Smrg ;; 5823943345d3Smrg *) 5824943345d3Smrg # If the previous option needed an argument, then skip it. 5825943345d3Smrg if test -n "$prev"; then 5826943345d3Smrg prev= 5827943345d3Smrg else 5828943345d3Smrg dest=$arg 5829943345d3Smrg continue 5830943345d3Smrg fi 5831943345d3Smrg ;; 5832943345d3Smrg esac 5833943345d3Smrg 5834943345d3Smrg # Aesthetically quote the argument. 5835943345d3Smrg arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` 5836943345d3Smrg case $arg in 5837943345d3Smrg *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 5838943345d3Smrg arg="\"$arg\"" 5839943345d3Smrg ;; 5840943345d3Smrg esac 5841943345d3Smrg install_prog="$install_prog $arg" 5842943345d3Smrg done 5843943345d3Smrg 5844943345d3Smrg if test -z "$install_prog"; then 5845943345d3Smrg $echo "$modename: you must specify an install program" 1>&2 5846943345d3Smrg $echo "$help" 1>&2 5847943345d3Smrg exit $EXIT_FAILURE 5848943345d3Smrg fi 5849943345d3Smrg 5850943345d3Smrg if test -n "$prev"; then 5851943345d3Smrg $echo "$modename: the \`$prev' option requires an argument" 1>&2 5852943345d3Smrg $echo "$help" 1>&2 5853943345d3Smrg exit $EXIT_FAILURE 5854943345d3Smrg fi 5855943345d3Smrg 5856943345d3Smrg if test -z "$files"; then 5857943345d3Smrg if test -z "$dest"; then 5858943345d3Smrg $echo "$modename: no file or destination specified" 1>&2 5859943345d3Smrg else 5860943345d3Smrg $echo "$modename: you must specify a destination" 1>&2 5861943345d3Smrg fi 5862943345d3Smrg $echo "$help" 1>&2 5863943345d3Smrg exit $EXIT_FAILURE 5864943345d3Smrg fi 5865943345d3Smrg 5866943345d3Smrg # Strip any trailing slash from the destination. 5867943345d3Smrg dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` 5868943345d3Smrg 5869943345d3Smrg # Check to see that the destination is a directory. 5870943345d3Smrg test -d "$dest" && isdir=yes 5871943345d3Smrg if test "$isdir" = yes; then 5872943345d3Smrg destdir="$dest" 5873943345d3Smrg destname= 5874943345d3Smrg else 5875943345d3Smrg destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` 5876943345d3Smrg test "X$destdir" = "X$dest" && destdir=. 5877943345d3Smrg destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` 5878943345d3Smrg 5879943345d3Smrg # Not a directory, so check to see that there is only one file specified. 5880943345d3Smrg set dummy $files 5881943345d3Smrg if test "$#" -gt 2; then 5882943345d3Smrg $echo "$modename: \`$dest' is not a directory" 1>&2 5883943345d3Smrg $echo "$help" 1>&2 5884943345d3Smrg exit $EXIT_FAILURE 5885943345d3Smrg fi 5886943345d3Smrg fi 5887943345d3Smrg case $destdir in 5888943345d3Smrg [\\/]* | [A-Za-z]:[\\/]*) ;; 5889943345d3Smrg *) 5890943345d3Smrg for file in $files; do 5891943345d3Smrg case $file in 5892943345d3Smrg *.lo) ;; 5893943345d3Smrg *) 5894943345d3Smrg $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 5895943345d3Smrg $echo "$help" 1>&2 5896943345d3Smrg exit $EXIT_FAILURE 5897943345d3Smrg ;; 5898943345d3Smrg esac 5899943345d3Smrg done 5900943345d3Smrg ;; 5901943345d3Smrg esac 5902943345d3Smrg 5903943345d3Smrg # This variable tells wrapper scripts just to set variables rather 5904943345d3Smrg # than running their programs. 5905943345d3Smrg libtool_install_magic="$magic" 5906943345d3Smrg 5907943345d3Smrg staticlibs= 5908943345d3Smrg future_libdirs= 5909943345d3Smrg current_libdirs= 5910943345d3Smrg for file in $files; do 5911943345d3Smrg 5912943345d3Smrg # Do each installation. 5913943345d3Smrg case $file in 5914943345d3Smrg *.$libext) 5915943345d3Smrg # Do the static libraries later. 5916943345d3Smrg staticlibs="$staticlibs $file" 5917943345d3Smrg ;; 5918943345d3Smrg 5919943345d3Smrg *.la) 5920943345d3Smrg # Check to see that this really is a libtool archive. 5921943345d3Smrg if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : 5922943345d3Smrg else 5923943345d3Smrg $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 5924943345d3Smrg $echo "$help" 1>&2 5925943345d3Smrg exit $EXIT_FAILURE 5926943345d3Smrg fi 5927943345d3Smrg 5928943345d3Smrg library_names= 5929943345d3Smrg old_library= 5930943345d3Smrg relink_command= 5931943345d3Smrg # If there is no directory component, then add one. 5932943345d3Smrg case $file in 5933943345d3Smrg */* | *\\*) . $file ;; 5934943345d3Smrg *) . ./$file ;; 5935943345d3Smrg esac 5936943345d3Smrg 5937943345d3Smrg # Add the libdir to current_libdirs if it is the destination. 5938943345d3Smrg if test "X$destdir" = "X$libdir"; then 5939943345d3Smrg case "$current_libdirs " in 5940943345d3Smrg *" $libdir "*) ;; 5941943345d3Smrg *) current_libdirs="$current_libdirs $libdir" ;; 5942943345d3Smrg esac 5943943345d3Smrg else 5944943345d3Smrg # Note the libdir as a future libdir. 5945943345d3Smrg case "$future_libdirs " in 5946943345d3Smrg *" $libdir "*) ;; 5947943345d3Smrg *) future_libdirs="$future_libdirs $libdir" ;; 5948943345d3Smrg esac 5949943345d3Smrg fi 5950943345d3Smrg 5951943345d3Smrg dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ 5952943345d3Smrg test "X$dir" = "X$file/" && dir= 5953943345d3Smrg dir="$dir$objdir" 5954943345d3Smrg 5955943345d3Smrg if test -n "$relink_command"; then 5956943345d3Smrg # Determine the prefix the user has applied to our future dir. 5957943345d3Smrg inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` 5958943345d3Smrg 5959943345d3Smrg # Don't allow the user to place us outside of our expected 5960943345d3Smrg # location b/c this prevents finding dependent libraries that 5961943345d3Smrg # are installed to the same prefix. 5962943345d3Smrg # At present, this check doesn't affect windows .dll's that 5963943345d3Smrg # are installed into $libdir/../bin (currently, that works fine) 5964943345d3Smrg # but it's something to keep an eye on. 5965943345d3Smrg if test "$inst_prefix_dir" = "$destdir"; then 5966943345d3Smrg $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 5967943345d3Smrg exit $EXIT_FAILURE 5968943345d3Smrg fi 5969943345d3Smrg 5970943345d3Smrg if test -n "$inst_prefix_dir"; then 5971943345d3Smrg # Stick the inst_prefix_dir data into the link command. 5972f67b85aaSmrg relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP` 5973943345d3Smrg else 5974f67b85aaSmrg relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP` 5975943345d3Smrg fi 5976943345d3Smrg 5977943345d3Smrg $echo "$modename: warning: relinking \`$file'" 1>&2 5978943345d3Smrg $show "$relink_command" 5979943345d3Smrg if $run eval "$relink_command"; then : 5980943345d3Smrg else 5981943345d3Smrg $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 5982943345d3Smrg exit $EXIT_FAILURE 5983943345d3Smrg fi 5984943345d3Smrg fi 5985943345d3Smrg 5986943345d3Smrg # See the names of the shared library. 5987943345d3Smrg set dummy $library_names 5988943345d3Smrg if test -n "$2"; then 5989943345d3Smrg realname="$2" 5990943345d3Smrg shift 5991943345d3Smrg shift 5992943345d3Smrg 5993943345d3Smrg srcname="$realname" 5994943345d3Smrg test -n "$relink_command" && srcname="$realname"T 5995943345d3Smrg 5996943345d3Smrg # Install the shared library and build the symlinks. 5997943345d3Smrg $show "$install_prog $dir/$srcname $destdir/$realname" 5998943345d3Smrg $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? 5999943345d3Smrg if test -n "$stripme" && test -n "$striplib"; then 6000943345d3Smrg $show "$striplib $destdir/$realname" 6001943345d3Smrg $run eval "$striplib $destdir/$realname" || exit $? 6002943345d3Smrg fi 6003943345d3Smrg 6004943345d3Smrg if test "$#" -gt 0; then 6005943345d3Smrg # Delete the old symlinks, and create new ones. 6006943345d3Smrg # Try `ln -sf' first, because the `ln' binary might depend on 6007943345d3Smrg # the symlink we replace! Solaris /bin/ln does not understand -f, 6008943345d3Smrg # so we also need to try rm && ln -s. 6009943345d3Smrg for linkname 6010943345d3Smrg do 6011943345d3Smrg if test "$linkname" != "$realname"; then 6012943345d3Smrg $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" 6013943345d3Smrg $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" 6014943345d3Smrg fi 6015943345d3Smrg done 6016943345d3Smrg fi 6017943345d3Smrg 6018943345d3Smrg # Do each command in the postinstall commands. 6019943345d3Smrg lib="$destdir/$realname" 6020943345d3Smrg cmds=$postinstall_cmds 6021943345d3Smrg save_ifs="$IFS"; IFS='~' 6022943345d3Smrg for cmd in $cmds; do 6023943345d3Smrg IFS="$save_ifs" 6024943345d3Smrg eval cmd=\"$cmd\" 6025943345d3Smrg $show "$cmd" 6026943345d3Smrg $run eval "$cmd" || { 6027943345d3Smrg lt_exit=$? 6028943345d3Smrg 6029943345d3Smrg # Restore the uninstalled library and exit 6030943345d3Smrg if test "$mode" = relink; then 6031943345d3Smrg $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' 6032943345d3Smrg fi 6033943345d3Smrg 6034943345d3Smrg exit $lt_exit 6035943345d3Smrg } 6036943345d3Smrg done 6037943345d3Smrg IFS="$save_ifs" 6038943345d3Smrg fi 6039943345d3Smrg 6040943345d3Smrg # Install the pseudo-library for information purposes. 6041943345d3Smrg name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` 6042943345d3Smrg instname="$dir/$name"i 6043943345d3Smrg $show "$install_prog $instname $destdir/$name" 6044943345d3Smrg $run eval "$install_prog $instname $destdir/$name" || exit $? 6045943345d3Smrg 6046943345d3Smrg # Maybe install the static library, too. 6047943345d3Smrg test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" 6048943345d3Smrg ;; 6049943345d3Smrg 6050943345d3Smrg *.lo) 6051943345d3Smrg # Install (i.e. copy) a libtool object. 6052943345d3Smrg 6053943345d3Smrg # Figure out destination file name, if it wasn't already specified. 6054943345d3Smrg if test -n "$destname"; then 6055943345d3Smrg destfile="$destdir/$destname" 6056943345d3Smrg else 6057943345d3Smrg destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` 6058943345d3Smrg destfile="$destdir/$destfile" 6059943345d3Smrg fi 6060943345d3Smrg 6061943345d3Smrg # Deduce the name of the destination old-style object file. 6062943345d3Smrg case $destfile in 6063943345d3Smrg *.lo) 6064943345d3Smrg staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` 6065943345d3Smrg ;; 6066943345d3Smrg *.$objext) 6067943345d3Smrg staticdest="$destfile" 6068943345d3Smrg destfile= 6069943345d3Smrg ;; 6070943345d3Smrg *) 6071943345d3Smrg $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 6072943345d3Smrg $echo "$help" 1>&2 6073943345d3Smrg exit $EXIT_FAILURE 6074943345d3Smrg ;; 6075943345d3Smrg esac 6076943345d3Smrg 6077943345d3Smrg # Install the libtool object if requested. 6078943345d3Smrg if test -n "$destfile"; then 6079943345d3Smrg $show "$install_prog $file $destfile" 6080943345d3Smrg $run eval "$install_prog $file $destfile" || exit $? 6081943345d3Smrg fi 6082943345d3Smrg 6083943345d3Smrg # Install the old object if enabled. 6084943345d3Smrg if test "$build_old_libs" = yes; then 6085943345d3Smrg # Deduce the name of the old-style object file. 6086943345d3Smrg staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` 6087943345d3Smrg 6088943345d3Smrg $show "$install_prog $staticobj $staticdest" 6089943345d3Smrg $run eval "$install_prog \$staticobj \$staticdest" || exit $? 6090943345d3Smrg fi 6091943345d3Smrg exit $EXIT_SUCCESS 6092943345d3Smrg ;; 6093943345d3Smrg 6094943345d3Smrg *) 6095943345d3Smrg # Figure out destination file name, if it wasn't already specified. 6096943345d3Smrg if test -n "$destname"; then 6097943345d3Smrg destfile="$destdir/$destname" 6098943345d3Smrg else 6099943345d3Smrg destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` 6100943345d3Smrg destfile="$destdir/$destfile" 6101943345d3Smrg fi 6102943345d3Smrg 6103943345d3Smrg # If the file is missing, and there is a .exe on the end, strip it 6104943345d3Smrg # because it is most likely a libtool script we actually want to 6105943345d3Smrg # install 6106943345d3Smrg stripped_ext="" 6107943345d3Smrg case $file in 6108943345d3Smrg *.exe) 6109943345d3Smrg if test ! -f "$file"; then 6110943345d3Smrg file=`$echo $file|${SED} 's,.exe$,,'` 6111943345d3Smrg stripped_ext=".exe" 6112943345d3Smrg fi 6113943345d3Smrg ;; 6114943345d3Smrg esac 6115943345d3Smrg 6116943345d3Smrg # Do a test to see if this is really a libtool program. 6117943345d3Smrg case $host in 6118943345d3Smrg *cygwin*|*mingw*) 6119943345d3Smrg wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` 6120943345d3Smrg ;; 6121943345d3Smrg *) 6122943345d3Smrg wrapper=$file 6123943345d3Smrg ;; 6124943345d3Smrg esac 6125943345d3Smrg if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then 6126943345d3Smrg notinst_deplibs= 6127943345d3Smrg relink_command= 6128943345d3Smrg 6129943345d3Smrg # Note that it is not necessary on cygwin/mingw to append a dot to 6130943345d3Smrg # foo even if both foo and FILE.exe exist: automatic-append-.exe 6131943345d3Smrg # behavior happens only for exec(3), not for open(2)! Also, sourcing 6132943345d3Smrg # `FILE.' does not work on cygwin managed mounts. 6133943345d3Smrg # 6134943345d3Smrg # If there is no directory component, then add one. 6135943345d3Smrg case $wrapper in 6136943345d3Smrg */* | *\\*) . ${wrapper} ;; 6137943345d3Smrg *) . ./${wrapper} ;; 6138943345d3Smrg esac 6139943345d3Smrg 6140943345d3Smrg # Check the variables that should have been set. 6141943345d3Smrg if test -z "$notinst_deplibs"; then 6142943345d3Smrg $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 6143943345d3Smrg exit $EXIT_FAILURE 6144943345d3Smrg fi 6145943345d3Smrg 6146943345d3Smrg finalize=yes 6147943345d3Smrg for lib in $notinst_deplibs; do 6148943345d3Smrg # Check to see that each library is installed. 6149943345d3Smrg libdir= 6150943345d3Smrg if test -f "$lib"; then 6151943345d3Smrg # If there is no directory component, then add one. 6152943345d3Smrg case $lib in 6153943345d3Smrg */* | *\\*) . $lib ;; 6154943345d3Smrg *) . ./$lib ;; 6155943345d3Smrg esac 6156943345d3Smrg fi 6157943345d3Smrg libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test 6158943345d3Smrg if test -n "$libdir" && test ! -f "$libfile"; then 6159943345d3Smrg $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 6160943345d3Smrg finalize=no 6161943345d3Smrg fi 6162943345d3Smrg done 6163943345d3Smrg 6164943345d3Smrg relink_command= 6165943345d3Smrg # Note that it is not necessary on cygwin/mingw to append a dot to 6166943345d3Smrg # foo even if both foo and FILE.exe exist: automatic-append-.exe 6167943345d3Smrg # behavior happens only for exec(3), not for open(2)! Also, sourcing 6168943345d3Smrg # `FILE.' does not work on cygwin managed mounts. 6169943345d3Smrg # 6170943345d3Smrg # If there is no directory component, then add one. 6171943345d3Smrg case $wrapper in 6172943345d3Smrg */* | *\\*) . ${wrapper} ;; 6173943345d3Smrg *) . ./${wrapper} ;; 6174943345d3Smrg esac 6175943345d3Smrg 6176943345d3Smrg outputname= 6177943345d3Smrg if test "$fast_install" = no && test -n "$relink_command"; then 6178943345d3Smrg if test "$finalize" = yes && test -z "$run"; then 6179943345d3Smrg tmpdir=`func_mktempdir` 6180943345d3Smrg file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` 6181943345d3Smrg outputname="$tmpdir/$file" 6182943345d3Smrg # Replace the output file specification. 6183f67b85aaSmrg relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP` 6184943345d3Smrg 6185943345d3Smrg $show "$relink_command" 6186943345d3Smrg if $run eval "$relink_command"; then : 6187943345d3Smrg else 6188943345d3Smrg $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 6189943345d3Smrg ${rm}r "$tmpdir" 6190943345d3Smrg continue 6191943345d3Smrg fi 6192943345d3Smrg file="$outputname" 6193943345d3Smrg else 6194943345d3Smrg $echo "$modename: warning: cannot relink \`$file'" 1>&2 6195943345d3Smrg fi 6196943345d3Smrg else 6197943345d3Smrg # Install the binary that we compiled earlier. 6198943345d3Smrg file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` 6199943345d3Smrg fi 6200943345d3Smrg fi 6201943345d3Smrg 6202943345d3Smrg # remove .exe since cygwin /usr/bin/install will append another 6203943345d3Smrg # one anyway 6204943345d3Smrg case $install_prog,$host in 6205943345d3Smrg */usr/bin/install*,*cygwin*) 6206943345d3Smrg case $file:$destfile in 6207943345d3Smrg *.exe:*.exe) 6208943345d3Smrg # this is ok 6209943345d3Smrg ;; 6210943345d3Smrg *.exe:*) 6211943345d3Smrg destfile=$destfile.exe 6212943345d3Smrg ;; 6213943345d3Smrg *:*.exe) 6214943345d3Smrg destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` 6215943345d3Smrg ;; 6216943345d3Smrg esac 6217943345d3Smrg ;; 6218943345d3Smrg esac 6219943345d3Smrg $show "$install_prog$stripme $file $destfile" 6220943345d3Smrg $run eval "$install_prog\$stripme \$file \$destfile" || exit $? 6221943345d3Smrg test -n "$outputname" && ${rm}r "$tmpdir" 6222943345d3Smrg ;; 6223943345d3Smrg esac 6224943345d3Smrg done 6225943345d3Smrg 6226943345d3Smrg for file in $staticlibs; do 6227943345d3Smrg name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` 6228943345d3Smrg 6229943345d3Smrg # Set up the ranlib parameters. 6230943345d3Smrg oldlib="$destdir/$name" 6231943345d3Smrg 6232943345d3Smrg $show "$install_prog $file $oldlib" 6233943345d3Smrg $run eval "$install_prog \$file \$oldlib" || exit $? 6234943345d3Smrg 6235943345d3Smrg if test -n "$stripme" && test -n "$old_striplib"; then 6236943345d3Smrg $show "$old_striplib $oldlib" 6237943345d3Smrg $run eval "$old_striplib $oldlib" || exit $? 6238943345d3Smrg fi 6239943345d3Smrg 6240943345d3Smrg # Do each command in the postinstall commands. 6241943345d3Smrg cmds=$old_postinstall_cmds 6242943345d3Smrg save_ifs="$IFS"; IFS='~' 6243943345d3Smrg for cmd in $cmds; do 6244943345d3Smrg IFS="$save_ifs" 6245943345d3Smrg eval cmd=\"$cmd\" 6246943345d3Smrg $show "$cmd" 6247943345d3Smrg $run eval "$cmd" || exit $? 6248943345d3Smrg done 6249943345d3Smrg IFS="$save_ifs" 6250943345d3Smrg done 6251943345d3Smrg 6252943345d3Smrg if test -n "$future_libdirs"; then 6253943345d3Smrg $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 6254943345d3Smrg fi 6255943345d3Smrg 6256943345d3Smrg if test -n "$current_libdirs"; then 6257943345d3Smrg # Maybe just do a dry run. 6258943345d3Smrg test -n "$run" && current_libdirs=" -n$current_libdirs" 6259943345d3Smrg exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' 6260943345d3Smrg else 6261943345d3Smrg exit $EXIT_SUCCESS 6262943345d3Smrg fi 6263943345d3Smrg ;; 6264943345d3Smrg 6265943345d3Smrg # libtool finish mode 6266943345d3Smrg finish) 6267943345d3Smrg modename="$modename: finish" 6268943345d3Smrg libdirs="$nonopt" 6269943345d3Smrg admincmds= 6270943345d3Smrg 6271943345d3Smrg if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then 6272943345d3Smrg for dir 6273943345d3Smrg do 6274943345d3Smrg libdirs="$libdirs $dir" 6275943345d3Smrg done 6276943345d3Smrg 6277943345d3Smrg for libdir in $libdirs; do 6278943345d3Smrg if test -n "$finish_cmds"; then 6279943345d3Smrg # Do each command in the finish commands. 6280943345d3Smrg cmds=$finish_cmds 6281943345d3Smrg save_ifs="$IFS"; IFS='~' 6282943345d3Smrg for cmd in $cmds; do 6283943345d3Smrg IFS="$save_ifs" 6284943345d3Smrg eval cmd=\"$cmd\" 6285943345d3Smrg $show "$cmd" 6286943345d3Smrg $run eval "$cmd" || admincmds="$admincmds 6287943345d3Smrg $cmd" 6288943345d3Smrg done 6289943345d3Smrg IFS="$save_ifs" 6290943345d3Smrg fi 6291943345d3Smrg if test -n "$finish_eval"; then 6292943345d3Smrg # Do the single finish_eval. 6293943345d3Smrg eval cmds=\"$finish_eval\" 6294943345d3Smrg $run eval "$cmds" || admincmds="$admincmds 6295943345d3Smrg $cmds" 6296943345d3Smrg fi 6297943345d3Smrg done 6298943345d3Smrg fi 6299943345d3Smrg 6300943345d3Smrg # Exit here if they wanted silent mode. 6301943345d3Smrg test "$show" = : && exit $EXIT_SUCCESS 6302943345d3Smrg 6303943345d3Smrg $echo "X----------------------------------------------------------------------" | $Xsed 6304943345d3Smrg $echo "Libraries have been installed in:" 6305943345d3Smrg for libdir in $libdirs; do 6306943345d3Smrg $echo " $libdir" 6307943345d3Smrg done 6308943345d3Smrg $echo 6309943345d3Smrg $echo "If you ever happen to want to link against installed libraries" 6310943345d3Smrg $echo "in a given directory, LIBDIR, you must either use libtool, and" 6311943345d3Smrg $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" 6312943345d3Smrg $echo "flag during linking and do at least one of the following:" 6313943345d3Smrg if test -n "$shlibpath_var"; then 6314943345d3Smrg $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" 6315943345d3Smrg $echo " during execution" 6316943345d3Smrg fi 6317943345d3Smrg if test -n "$runpath_var"; then 6318943345d3Smrg $echo " - add LIBDIR to the \`$runpath_var' environment variable" 6319943345d3Smrg $echo " during linking" 6320943345d3Smrg fi 6321943345d3Smrg if test -n "$hardcode_libdir_flag_spec"; then 6322943345d3Smrg libdir=LIBDIR 6323943345d3Smrg eval flag=\"$hardcode_libdir_flag_spec\" 6324943345d3Smrg 6325943345d3Smrg $echo " - use the \`$flag' linker flag" 6326943345d3Smrg fi 6327943345d3Smrg if test -n "$admincmds"; then 6328943345d3Smrg $echo " - have your system administrator run these commands:$admincmds" 6329943345d3Smrg fi 6330943345d3Smrg if test -f /etc/ld.so.conf; then 6331943345d3Smrg $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" 6332943345d3Smrg fi 6333943345d3Smrg $echo 6334943345d3Smrg $echo "See any operating system documentation about shared libraries for" 6335943345d3Smrg $echo "more information, such as the ld(1) and ld.so(8) manual pages." 6336943345d3Smrg $echo "X----------------------------------------------------------------------" | $Xsed 6337943345d3Smrg exit $EXIT_SUCCESS 6338943345d3Smrg ;; 6339943345d3Smrg 6340943345d3Smrg # libtool execute mode 6341943345d3Smrg execute) 6342943345d3Smrg modename="$modename: execute" 6343943345d3Smrg 6344943345d3Smrg # The first argument is the command name. 6345943345d3Smrg cmd="$nonopt" 6346943345d3Smrg if test -z "$cmd"; then 6347943345d3Smrg $echo "$modename: you must specify a COMMAND" 1>&2 6348943345d3Smrg $echo "$help" 6349943345d3Smrg exit $EXIT_FAILURE 6350943345d3Smrg fi 6351943345d3Smrg 6352943345d3Smrg # Handle -dlopen flags immediately. 6353943345d3Smrg for file in $execute_dlfiles; do 6354943345d3Smrg if test ! -f "$file"; then 6355943345d3Smrg $echo "$modename: \`$file' is not a file" 1>&2 6356943345d3Smrg $echo "$help" 1>&2 6357943345d3Smrg exit $EXIT_FAILURE 6358943345d3Smrg fi 6359943345d3Smrg 6360943345d3Smrg dir= 6361943345d3Smrg case $file in 6362943345d3Smrg *.la) 6363943345d3Smrg # Check to see that this really is a libtool archive. 6364943345d3Smrg if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : 6365943345d3Smrg else 6366943345d3Smrg $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 6367943345d3Smrg $echo "$help" 1>&2 6368943345d3Smrg exit $EXIT_FAILURE 6369943345d3Smrg fi 6370943345d3Smrg 6371943345d3Smrg # Read the libtool library. 6372943345d3Smrg dlname= 6373943345d3Smrg library_names= 6374943345d3Smrg 6375943345d3Smrg # If there is no directory component, then add one. 6376943345d3Smrg case $file in 6377943345d3Smrg */* | *\\*) . $file ;; 6378943345d3Smrg *) . ./$file ;; 6379943345d3Smrg esac 6380943345d3Smrg 6381943345d3Smrg # Skip this library if it cannot be dlopened. 6382943345d3Smrg if test -z "$dlname"; then 6383943345d3Smrg # Warn if it was a shared library. 6384943345d3Smrg test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" 6385943345d3Smrg continue 6386943345d3Smrg fi 6387943345d3Smrg 6388943345d3Smrg dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` 6389943345d3Smrg test "X$dir" = "X$file" && dir=. 6390943345d3Smrg 6391943345d3Smrg if test -f "$dir/$objdir/$dlname"; then 6392943345d3Smrg dir="$dir/$objdir" 6393943345d3Smrg else 6394943345d3Smrg $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 6395943345d3Smrg exit $EXIT_FAILURE 6396943345d3Smrg fi 6397943345d3Smrg ;; 6398943345d3Smrg 6399943345d3Smrg *.lo) 6400943345d3Smrg # Just add the directory containing the .lo file. 6401943345d3Smrg dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` 6402943345d3Smrg test "X$dir" = "X$file" && dir=. 6403943345d3Smrg ;; 6404943345d3Smrg 6405943345d3Smrg *) 6406943345d3Smrg $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 6407943345d3Smrg continue 6408943345d3Smrg ;; 6409943345d3Smrg esac 6410943345d3Smrg 6411943345d3Smrg # Get the absolute pathname. 6412943345d3Smrg absdir=`cd "$dir" && pwd` 6413943345d3Smrg test -n "$absdir" && dir="$absdir" 6414943345d3Smrg 6415943345d3Smrg # Now add the directory to shlibpath_var. 6416943345d3Smrg if eval "test -z \"\$$shlibpath_var\""; then 6417943345d3Smrg eval "$shlibpath_var=\"\$dir\"" 6418943345d3Smrg else 6419943345d3Smrg eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" 6420943345d3Smrg fi 6421943345d3Smrg done 6422943345d3Smrg 6423943345d3Smrg # This variable tells wrapper scripts just to set shlibpath_var 6424943345d3Smrg # rather than running their programs. 6425943345d3Smrg libtool_execute_magic="$magic" 6426943345d3Smrg 6427943345d3Smrg # Check if any of the arguments is a wrapper script. 6428943345d3Smrg args= 6429943345d3Smrg for file 6430943345d3Smrg do 6431943345d3Smrg case $file in 6432943345d3Smrg -*) ;; 6433943345d3Smrg *) 6434943345d3Smrg # Do a test to see if this is really a libtool program. 6435943345d3Smrg if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 6436943345d3Smrg # If there is no directory component, then add one. 6437943345d3Smrg case $file in 6438943345d3Smrg */* | *\\*) . $file ;; 6439943345d3Smrg *) . ./$file ;; 6440943345d3Smrg esac 6441943345d3Smrg 6442943345d3Smrg # Transform arg to wrapped name. 6443943345d3Smrg file="$progdir/$program" 6444943345d3Smrg fi 6445943345d3Smrg ;; 6446943345d3Smrg esac 6447943345d3Smrg # Quote arguments (to preserve shell metacharacters). 6448943345d3Smrg file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` 6449943345d3Smrg args="$args \"$file\"" 6450943345d3Smrg done 6451943345d3Smrg 6452943345d3Smrg if test -z "$run"; then 6453943345d3Smrg if test -n "$shlibpath_var"; then 6454943345d3Smrg # Export the shlibpath_var. 6455943345d3Smrg eval "export $shlibpath_var" 6456943345d3Smrg fi 6457943345d3Smrg 6458943345d3Smrg # Restore saved environment variables 6459f67b85aaSmrg for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES 6460f67b85aaSmrg do 6461f67b85aaSmrg eval "if test \"\${save_$lt_var+set}\" = set; then 6462f67b85aaSmrg $lt_var=\$save_$lt_var; export $lt_var 6463f67b85aaSmrg fi" 6464f67b85aaSmrg done 6465f67b85aaSmrg 6466943345d3Smrg 6467943345d3Smrg # Now prepare to actually exec the command. 6468943345d3Smrg exec_cmd="\$cmd$args" 6469943345d3Smrg else 6470943345d3Smrg # Display what would be done. 6471943345d3Smrg if test -n "$shlibpath_var"; then 6472943345d3Smrg eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" 6473943345d3Smrg $echo "export $shlibpath_var" 6474943345d3Smrg fi 6475943345d3Smrg $echo "$cmd$args" 6476943345d3Smrg exit $EXIT_SUCCESS 6477943345d3Smrg fi 6478943345d3Smrg ;; 6479943345d3Smrg 6480943345d3Smrg # libtool clean and uninstall mode 6481943345d3Smrg clean | uninstall) 6482943345d3Smrg modename="$modename: $mode" 6483943345d3Smrg rm="$nonopt" 6484943345d3Smrg files= 6485943345d3Smrg rmforce= 6486943345d3Smrg exit_status=0 6487943345d3Smrg 6488943345d3Smrg # This variable tells wrapper scripts just to set variables rather 6489943345d3Smrg # than running their programs. 6490943345d3Smrg libtool_install_magic="$magic" 6491943345d3Smrg 6492943345d3Smrg for arg 6493943345d3Smrg do 6494943345d3Smrg case $arg in 6495943345d3Smrg -f) rm="$rm $arg"; rmforce=yes ;; 6496943345d3Smrg -*) rm="$rm $arg" ;; 6497943345d3Smrg *) files="$files $arg" ;; 6498943345d3Smrg esac 6499943345d3Smrg done 6500943345d3Smrg 6501943345d3Smrg if test -z "$rm"; then 6502943345d3Smrg $echo "$modename: you must specify an RM program" 1>&2 6503943345d3Smrg $echo "$help" 1>&2 6504943345d3Smrg exit $EXIT_FAILURE 6505943345d3Smrg fi 6506943345d3Smrg 6507943345d3Smrg rmdirs= 6508943345d3Smrg 6509943345d3Smrg origobjdir="$objdir" 6510943345d3Smrg for file in $files; do 6511943345d3Smrg dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` 6512943345d3Smrg if test "X$dir" = "X$file"; then 6513943345d3Smrg dir=. 6514943345d3Smrg objdir="$origobjdir" 6515943345d3Smrg else 6516943345d3Smrg objdir="$dir/$origobjdir" 6517943345d3Smrg fi 6518943345d3Smrg name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` 6519943345d3Smrg test "$mode" = uninstall && objdir="$dir" 6520943345d3Smrg 6521943345d3Smrg # Remember objdir for removal later, being careful to avoid duplicates 6522943345d3Smrg if test "$mode" = clean; then 6523943345d3Smrg case " $rmdirs " in 6524943345d3Smrg *" $objdir "*) ;; 6525943345d3Smrg *) rmdirs="$rmdirs $objdir" ;; 6526943345d3Smrg esac 6527943345d3Smrg fi 6528943345d3Smrg 6529943345d3Smrg # Don't error if the file doesn't exist and rm -f was used. 6530943345d3Smrg if (test -L "$file") >/dev/null 2>&1 \ 6531943345d3Smrg || (test -h "$file") >/dev/null 2>&1 \ 6532943345d3Smrg || test -f "$file"; then 6533943345d3Smrg : 6534943345d3Smrg elif test -d "$file"; then 6535943345d3Smrg exit_status=1 6536943345d3Smrg continue 6537943345d3Smrg elif test "$rmforce" = yes; then 6538943345d3Smrg continue 6539943345d3Smrg fi 6540943345d3Smrg 6541943345d3Smrg rmfiles="$file" 6542943345d3Smrg 6543943345d3Smrg case $name in 6544943345d3Smrg *.la) 6545943345d3Smrg # Possibly a libtool archive, so verify it. 6546943345d3Smrg if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 6547943345d3Smrg . $dir/$name 6548943345d3Smrg 6549943345d3Smrg # Delete the libtool libraries and symlinks. 6550943345d3Smrg for n in $library_names; do 6551943345d3Smrg rmfiles="$rmfiles $objdir/$n" 6552943345d3Smrg done 6553943345d3Smrg test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" 6554943345d3Smrg 6555943345d3Smrg case "$mode" in 6556943345d3Smrg clean) 6557943345d3Smrg case " $library_names " in 6558943345d3Smrg # " " in the beginning catches empty $dlname 6559943345d3Smrg *" $dlname "*) ;; 6560943345d3Smrg *) rmfiles="$rmfiles $objdir/$dlname" ;; 6561943345d3Smrg esac 6562943345d3Smrg test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" 6563943345d3Smrg ;; 6564943345d3Smrg uninstall) 6565943345d3Smrg if test -n "$library_names"; then 6566943345d3Smrg # Do each command in the postuninstall commands. 6567943345d3Smrg cmds=$postuninstall_cmds 6568943345d3Smrg save_ifs="$IFS"; IFS='~' 6569943345d3Smrg for cmd in $cmds; do 6570943345d3Smrg IFS="$save_ifs" 6571943345d3Smrg eval cmd=\"$cmd\" 6572943345d3Smrg $show "$cmd" 6573943345d3Smrg $run eval "$cmd" 6574943345d3Smrg if test "$?" -ne 0 && test "$rmforce" != yes; then 6575943345d3Smrg exit_status=1 6576943345d3Smrg fi 6577943345d3Smrg done 6578943345d3Smrg IFS="$save_ifs" 6579943345d3Smrg fi 6580943345d3Smrg 6581943345d3Smrg if test -n "$old_library"; then 6582943345d3Smrg # Do each command in the old_postuninstall commands. 6583943345d3Smrg cmds=$old_postuninstall_cmds 6584943345d3Smrg save_ifs="$IFS"; IFS='~' 6585943345d3Smrg for cmd in $cmds; do 6586943345d3Smrg IFS="$save_ifs" 6587943345d3Smrg eval cmd=\"$cmd\" 6588943345d3Smrg $show "$cmd" 6589943345d3Smrg $run eval "$cmd" 6590943345d3Smrg if test "$?" -ne 0 && test "$rmforce" != yes; then 6591943345d3Smrg exit_status=1 6592943345d3Smrg fi 6593943345d3Smrg done 6594943345d3Smrg IFS="$save_ifs" 6595943345d3Smrg fi 6596943345d3Smrg # FIXME: should reinstall the best remaining shared library. 6597943345d3Smrg ;; 6598943345d3Smrg esac 6599943345d3Smrg fi 6600943345d3Smrg ;; 6601943345d3Smrg 6602943345d3Smrg *.lo) 6603943345d3Smrg # Possibly a libtool object, so verify it. 6604943345d3Smrg if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 6605943345d3Smrg 6606943345d3Smrg # Read the .lo file 6607943345d3Smrg . $dir/$name 6608943345d3Smrg 6609943345d3Smrg # Add PIC object to the list of files to remove. 6610943345d3Smrg if test -n "$pic_object" \ 6611943345d3Smrg && test "$pic_object" != none; then 6612943345d3Smrg rmfiles="$rmfiles $dir/$pic_object" 6613943345d3Smrg fi 6614943345d3Smrg 6615943345d3Smrg # Add non-PIC object to the list of files to remove. 6616943345d3Smrg if test -n "$non_pic_object" \ 6617943345d3Smrg && test "$non_pic_object" != none; then 6618943345d3Smrg rmfiles="$rmfiles $dir/$non_pic_object" 6619943345d3Smrg fi 6620943345d3Smrg fi 6621943345d3Smrg ;; 6622943345d3Smrg 6623943345d3Smrg *) 6624943345d3Smrg if test "$mode" = clean ; then 6625943345d3Smrg noexename=$name 6626943345d3Smrg case $file in 6627943345d3Smrg *.exe) 6628943345d3Smrg file=`$echo $file|${SED} 's,.exe$,,'` 6629943345d3Smrg noexename=`$echo $name|${SED} 's,.exe$,,'` 6630943345d3Smrg # $file with .exe has already been added to rmfiles, 6631943345d3Smrg # add $file without .exe 6632943345d3Smrg rmfiles="$rmfiles $file" 6633943345d3Smrg ;; 6634943345d3Smrg esac 6635943345d3Smrg # Do a test to see if this is a libtool program. 6636943345d3Smrg if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 6637943345d3Smrg relink_command= 6638943345d3Smrg . $dir/$noexename 6639943345d3Smrg 6640943345d3Smrg # note $name still contains .exe if it was in $file originally 6641943345d3Smrg # as does the version of $file that was added into $rmfiles 6642943345d3Smrg rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" 6643943345d3Smrg if test "$fast_install" = yes && test -n "$relink_command"; then 6644943345d3Smrg rmfiles="$rmfiles $objdir/lt-$name" 6645943345d3Smrg fi 6646943345d3Smrg if test "X$noexename" != "X$name" ; then 6647943345d3Smrg rmfiles="$rmfiles $objdir/lt-${noexename}.c" 6648943345d3Smrg fi 6649943345d3Smrg fi 6650943345d3Smrg fi 6651943345d3Smrg ;; 6652943345d3Smrg esac 6653943345d3Smrg $show "$rm $rmfiles" 6654943345d3Smrg $run $rm $rmfiles || exit_status=1 6655943345d3Smrg done 6656943345d3Smrg objdir="$origobjdir" 6657943345d3Smrg 6658943345d3Smrg # Try to remove the ${objdir}s in the directories where we deleted files 6659943345d3Smrg for dir in $rmdirs; do 6660943345d3Smrg if test -d "$dir"; then 6661943345d3Smrg $show "rmdir $dir" 6662943345d3Smrg $run rmdir $dir >/dev/null 2>&1 6663943345d3Smrg fi 6664943345d3Smrg done 6665943345d3Smrg 6666943345d3Smrg exit $exit_status 6667943345d3Smrg ;; 6668943345d3Smrg 6669943345d3Smrg "") 6670943345d3Smrg $echo "$modename: you must specify a MODE" 1>&2 6671943345d3Smrg $echo "$generic_help" 1>&2 6672943345d3Smrg exit $EXIT_FAILURE 6673943345d3Smrg ;; 6674943345d3Smrg esac 6675943345d3Smrg 6676943345d3Smrg if test -z "$exec_cmd"; then 6677943345d3Smrg $echo "$modename: invalid operation mode \`$mode'" 1>&2 6678943345d3Smrg $echo "$generic_help" 1>&2 6679943345d3Smrg exit $EXIT_FAILURE 6680943345d3Smrg fi 6681943345d3Smrgfi # test -z "$show_help" 6682943345d3Smrg 6683943345d3Smrgif test -n "$exec_cmd"; then 6684943345d3Smrg eval exec $exec_cmd 6685943345d3Smrg exit $EXIT_FAILURE 6686943345d3Smrgfi 6687943345d3Smrg 6688943345d3Smrg# We need to display help for each of the modes. 6689943345d3Smrgcase $mode in 6690943345d3Smrg"") $echo \ 6691943345d3Smrg"Usage: $modename [OPTION]... [MODE-ARG]... 6692943345d3Smrg 6693943345d3SmrgProvide generalized library-building support services. 6694943345d3Smrg 6695943345d3Smrg --config show all configuration variables 6696943345d3Smrg --debug enable verbose shell tracing 6697943345d3Smrg-n, --dry-run display commands without modifying any files 6698943345d3Smrg --features display basic configuration information and exit 6699943345d3Smrg --finish same as \`--mode=finish' 6700943345d3Smrg --help display this help message and exit 6701943345d3Smrg --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] 6702943345d3Smrg --quiet same as \`--silent' 6703943345d3Smrg --silent don't print informational messages 6704943345d3Smrg --tag=TAG use configuration variables from tag TAG 6705943345d3Smrg --version print version information 6706943345d3Smrg 6707943345d3SmrgMODE must be one of the following: 6708943345d3Smrg 6709943345d3Smrg clean remove files from the build directory 6710943345d3Smrg compile compile a source file into a libtool object 6711943345d3Smrg execute automatically set library path, then run a program 6712943345d3Smrg finish complete the installation of libtool libraries 6713943345d3Smrg install install libraries or executables 6714943345d3Smrg link create a library or an executable 6715943345d3Smrg uninstall remove libraries from an installed directory 6716943345d3Smrg 6717943345d3SmrgMODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for 6718943345d3Smrga more detailed description of MODE. 6719943345d3Smrg 6720943345d3SmrgReport bugs to <bug-libtool@gnu.org>." 6721943345d3Smrg exit $EXIT_SUCCESS 6722943345d3Smrg ;; 6723943345d3Smrg 6724943345d3Smrgclean) 6725943345d3Smrg $echo \ 6726943345d3Smrg"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... 6727943345d3Smrg 6728943345d3SmrgRemove files from the build directory. 6729943345d3Smrg 6730943345d3SmrgRM is the name of the program to use to delete files associated with each FILE 6731943345d3Smrg(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed 6732943345d3Smrgto RM. 6733943345d3Smrg 6734943345d3SmrgIf FILE is a libtool library, object or program, all the files associated 6735943345d3Smrgwith it are deleted. Otherwise, only FILE itself is deleted using RM." 6736943345d3Smrg ;; 6737943345d3Smrg 6738943345d3Smrgcompile) 6739943345d3Smrg $echo \ 6740943345d3Smrg"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE 6741943345d3Smrg 6742943345d3SmrgCompile a source file into a libtool library object. 6743943345d3Smrg 6744943345d3SmrgThis mode accepts the following additional options: 6745943345d3Smrg 6746943345d3Smrg -o OUTPUT-FILE set the output file name to OUTPUT-FILE 6747943345d3Smrg -prefer-pic try to building PIC objects only 6748943345d3Smrg -prefer-non-pic try to building non-PIC objects only 6749943345d3Smrg -static always build a \`.o' file suitable for static linking 6750943345d3Smrg 6751943345d3SmrgCOMPILE-COMMAND is a command to be used in creating a \`standard' object file 6752943345d3Smrgfrom the given SOURCEFILE. 6753943345d3Smrg 6754943345d3SmrgThe output file name is determined by removing the directory component from 6755943345d3SmrgSOURCEFILE, then substituting the C source code suffix \`.c' with the 6756943345d3Smrglibrary object suffix, \`.lo'." 6757943345d3Smrg ;; 6758943345d3Smrg 6759943345d3Smrgexecute) 6760943345d3Smrg $echo \ 6761943345d3Smrg"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... 6762943345d3Smrg 6763943345d3SmrgAutomatically set library path, then run a program. 6764943345d3Smrg 6765943345d3SmrgThis mode accepts the following additional options: 6766943345d3Smrg 6767943345d3Smrg -dlopen FILE add the directory containing FILE to the library path 6768943345d3Smrg 6769943345d3SmrgThis mode sets the library path environment variable according to \`-dlopen' 6770943345d3Smrgflags. 6771943345d3Smrg 6772943345d3SmrgIf any of the ARGS are libtool executable wrappers, then they are translated 6773943345d3Smrginto their corresponding uninstalled binary, and any of their required library 6774943345d3Smrgdirectories are added to the library path. 6775943345d3Smrg 6776943345d3SmrgThen, COMMAND is executed, with ARGS as arguments." 6777943345d3Smrg ;; 6778943345d3Smrg 6779943345d3Smrgfinish) 6780943345d3Smrg $echo \ 6781943345d3Smrg"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... 6782943345d3Smrg 6783943345d3SmrgComplete the installation of libtool libraries. 6784943345d3Smrg 6785943345d3SmrgEach LIBDIR is a directory that contains libtool libraries. 6786943345d3Smrg 6787943345d3SmrgThe commands that this mode executes may require superuser privileges. Use 6788943345d3Smrgthe \`--dry-run' option if you just want to see what would be executed." 6789943345d3Smrg ;; 6790943345d3Smrg 6791943345d3Smrginstall) 6792943345d3Smrg $echo \ 6793943345d3Smrg"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... 6794943345d3Smrg 6795943345d3SmrgInstall executables or libraries. 6796943345d3Smrg 6797943345d3SmrgINSTALL-COMMAND is the installation command. The first component should be 6798943345d3Smrgeither the \`install' or \`cp' program. 6799943345d3Smrg 6800943345d3SmrgThe rest of the components are interpreted as arguments to that command (only 6801943345d3SmrgBSD-compatible install options are recognized)." 6802943345d3Smrg ;; 6803943345d3Smrg 6804943345d3Smrglink) 6805943345d3Smrg $echo \ 6806943345d3Smrg"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... 6807943345d3Smrg 6808943345d3SmrgLink object files or libraries together to form another library, or to 6809943345d3Smrgcreate an executable program. 6810943345d3Smrg 6811943345d3SmrgLINK-COMMAND is a command using the C compiler that you would use to create 6812943345d3Smrga program from several object files. 6813943345d3Smrg 6814943345d3SmrgThe following components of LINK-COMMAND are treated specially: 6815943345d3Smrg 6816943345d3Smrg -all-static do not do any dynamic linking at all 6817943345d3Smrg -avoid-version do not add a version suffix if possible 6818943345d3Smrg -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime 6819943345d3Smrg -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols 6820943345d3Smrg -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) 6821943345d3Smrg -export-symbols SYMFILE 6822f67b85aaSmrg try to export only the symbols listed in SYMFILE 6823943345d3Smrg -export-symbols-regex REGEX 6824f67b85aaSmrg try to export only the symbols matching REGEX 6825943345d3Smrg -LLIBDIR search LIBDIR for required installed libraries 6826943345d3Smrg -lNAME OUTPUT-FILE requires the installed library libNAME 6827943345d3Smrg -module build a library that can dlopened 6828943345d3Smrg -no-fast-install disable the fast-install mode 6829943345d3Smrg -no-install link a not-installable executable 6830943345d3Smrg -no-undefined declare that a library does not refer to external symbols 6831943345d3Smrg -o OUTPUT-FILE create OUTPUT-FILE from the specified objects 6832943345d3Smrg -objectlist FILE Use a list of object files found in FILE to specify objects 6833943345d3Smrg -precious-files-regex REGEX 6834943345d3Smrg don't remove output files matching REGEX 6835943345d3Smrg -release RELEASE specify package release information 6836943345d3Smrg -rpath LIBDIR the created library will eventually be installed in LIBDIR 6837943345d3Smrg -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries 6838f67b85aaSmrg -static do not do any dynamic linking of uninstalled libtool libraries 6839f67b85aaSmrg -static-libtool-libs 6840f67b85aaSmrg do not do any dynamic linking of libtool libraries 6841943345d3Smrg -version-info CURRENT[:REVISION[:AGE]] 6842f67b85aaSmrg specify library version info [each variable defaults to 0] 6843943345d3Smrg 6844943345d3SmrgAll other options (arguments beginning with \`-') are ignored. 6845943345d3Smrg 6846943345d3SmrgEvery other argument is treated as a filename. Files ending in \`.la' are 6847943345d3Smrgtreated as uninstalled libtool libraries, other files are standard or library 6848943345d3Smrgobject files. 6849943345d3Smrg 6850943345d3SmrgIf the OUTPUT-FILE ends in \`.la', then a libtool library is created, 6851943345d3Smrgonly library objects (\`.lo' files) may be specified, and \`-rpath' is 6852943345d3Smrgrequired, except when creating a convenience library. 6853943345d3Smrg 6854943345d3SmrgIf OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created 6855943345d3Smrgusing \`ar' and \`ranlib', or on Windows using \`lib'. 6856943345d3Smrg 6857943345d3SmrgIf OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file 6858943345d3Smrgis created, otherwise an executable program is created." 6859943345d3Smrg ;; 6860943345d3Smrg 6861943345d3Smrguninstall) 6862943345d3Smrg $echo \ 6863943345d3Smrg"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... 6864943345d3Smrg 6865943345d3SmrgRemove libraries from an installation directory. 6866943345d3Smrg 6867943345d3SmrgRM is the name of the program to use to delete files associated with each FILE 6868943345d3Smrg(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed 6869943345d3Smrgto RM. 6870943345d3Smrg 6871943345d3SmrgIf FILE is a libtool library, all the files associated with it are deleted. 6872943345d3SmrgOtherwise, only FILE itself is deleted using RM." 6873943345d3Smrg ;; 6874943345d3Smrg 6875943345d3Smrg*) 6876943345d3Smrg $echo "$modename: invalid operation mode \`$mode'" 1>&2 6877943345d3Smrg $echo "$help" 1>&2 6878943345d3Smrg exit $EXIT_FAILURE 6879943345d3Smrg ;; 6880943345d3Smrgesac 6881943345d3Smrg 6882943345d3Smrg$echo 6883943345d3Smrg$echo "Try \`$modename --help' for more information about other modes." 6884943345d3Smrg 6885943345d3Smrgexit $? 6886943345d3Smrg 6887943345d3Smrg# The TAGs below are defined such that we never get into a situation 6888943345d3Smrg# in which we disable both kinds of libraries. Given conflicting 6889943345d3Smrg# choices, we go for a static library, that is the most portable, 6890943345d3Smrg# since we can't tell whether shared libraries were disabled because 6891943345d3Smrg# the user asked for that or because the platform doesn't support 6892943345d3Smrg# them. This is particularly important on AIX, because we don't 6893943345d3Smrg# support having both static and shared libraries enabled at the same 6894943345d3Smrg# time on that platform, so we default to a shared-only configuration. 6895943345d3Smrg# If a disable-shared tag is given, we'll fallback to a static-only 6896943345d3Smrg# configuration. But we'll never go from static-only to shared-only. 6897943345d3Smrg 6898943345d3Smrg# ### BEGIN LIBTOOL TAG CONFIG: disable-shared 6899943345d3Smrgdisable_libs=shared 6900943345d3Smrg# ### END LIBTOOL TAG CONFIG: disable-shared 6901943345d3Smrg 6902943345d3Smrg# ### BEGIN LIBTOOL TAG CONFIG: disable-static 6903943345d3Smrgdisable_libs=static 6904943345d3Smrg# ### END LIBTOOL TAG CONFIG: disable-static 6905943345d3Smrg 6906943345d3Smrg# Local Variables: 6907943345d3Smrg# mode:shell-script 6908943345d3Smrg# sh-indentation:2 6909943345d3Smrg# End: 6910