1 1.1 lukem # ltmain.sh - Provide generalized library-building support services. 2 1.1 lukem # NOTE: Changing this file will not affect anything until you rerun configure. 3 1.1 lukem # 4 1.1 lukem # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 5 1.1 lukem # 2007, 2008 Free Software Foundation, Inc. 6 1.1 lukem # Originally by Gordon Matzigkeit <gord (at] gnu.ai.mit.edu>, 1996 7 1.1 lukem # 8 1.1 lukem # This program is free software; you can redistribute it and/or modify 9 1.1 lukem # it under the terms of the GNU General Public License as published by 10 1.1 lukem # the Free Software Foundation; either version 2 of the License, or 11 1.1 lukem # (at your option) any later version. 12 1.1 lukem # 13 1.1 lukem # This program is distributed in the hope that it will be useful, but 14 1.1 lukem # WITHOUT ANY WARRANTY; without even the implied warranty of 15 1.1 lukem # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 1.1 lukem # General Public License for more details. 17 1.1 lukem # 18 1.1 lukem # You should have received a copy of the GNU General Public License 19 1.1 lukem # along with this program; if not, write to the Free Software 20 1.1 lukem # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 21 1.1 lukem # 22 1.1 lukem # As a special exception to the GNU General Public License, if you 23 1.1 lukem # distribute this file as part of a program that contains a 24 1.1 lukem # configuration script generated by Autoconf, you may include it under 25 1.1 lukem # the same distribution terms that you use for the rest of that program. 26 1.1 lukem 27 1.1 lukem basename="s,^.*/,,g" 28 1.1 lukem 29 1.1 lukem # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh 30 1.1 lukem # is ksh but when the shell is invoked as "sh" and the current value of 31 1.1 lukem # the _XPG environment variable is not equal to 1 (one), the special 32 1.1 lukem # positional parameter $0, within a function call, is the name of the 33 1.1 lukem # function. 34 1.1 lukem progpath="$0" 35 1.1 lukem 36 1.1 lukem # The name of this program: 37 1.1 lukem progname=`echo "$progpath" | $SED $basename` 38 1.1 lukem modename="$progname" 39 1.1 lukem 40 1.1 lukem # Global variables: 41 1.1 lukem EXIT_SUCCESS=0 42 1.1 lukem EXIT_FAILURE=1 43 1.1 lukem 44 1.1 lukem PROGRAM=ltmain.sh 45 1.1 lukem PACKAGE=libtool 46 1.1 lukem VERSION=1.5.26 47 1.1 lukem TIMESTAMP=" (1.1220.2.492 2008/01/30 06:40:56)" 48 1.1 lukem 49 1.1 lukem # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). 50 1.1 lukem if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then 51 1.1 lukem emulate sh 52 1.1 lukem NULLCMD=: 53 1.1 lukem # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which 54 1.1 lukem # is contrary to our usage. Disable this feature. 55 1.1 lukem alias -g '${1+"$@"}'='"$@"' 56 1.1 lukem setopt NO_GLOB_SUBST 57 1.1 lukem else 58 1.1 lukem case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac 59 1.1 lukem fi 60 1.1 lukem BIN_SH=xpg4; export BIN_SH # for Tru64 61 1.1 lukem DUALCASE=1; export DUALCASE # for MKS sh 62 1.1 lukem 63 1.2 agc # Check that we have a working $ECHO. 64 1.1 lukem if test "X$1" = X--no-reexec; then 65 1.1 lukem # Discard the --no-reexec flag, and continue. 66 1.1 lukem shift 67 1.1 lukem elif test "X$1" = X--fallback-echo; then 68 1.1 lukem # Avoid inline document here, it may be left over 69 1.1 lukem : 70 1.2 agc elif test "X`($ECHO '\t') 2>/dev/null`" = 'X\t'; then 71 1.2 agc # Yippee, $ECHO works! 72 1.1 lukem : 73 1.1 lukem else 74 1.2 agc # Restart under the correct shell, and then maybe $ECHO will work. 75 1.1 lukem exec $SHELL "$progpath" --no-reexec ${1+"$@"} 76 1.1 lukem fi 77 1.1 lukem 78 1.1 lukem if test "X$1" = X--fallback-echo; then 79 1.1 lukem # used as fallback echo 80 1.1 lukem shift 81 1.1 lukem cat <<EOF 82 1.1 lukem $* 83 1.1 lukem EOF 84 1.1 lukem exit $EXIT_SUCCESS 85 1.1 lukem fi 86 1.1 lukem 87 1.1 lukem default_mode= 88 1.1 lukem help="Try \`$progname --help' for more information." 89 1.1 lukem magic="%%%MAGIC variable%%%" 90 1.1 lukem mkdir="mkdir" 91 1.1 lukem mv="mv -f" 92 1.1 lukem rm="rm -f" 93 1.1 lukem 94 1.1 lukem # Sed substitution that helps us do robust quoting. It backslashifies 95 1.1 lukem # metacharacters that are still active within double-quoted strings. 96 1.1 lukem Xsed="${SED}"' -e 1s/^X//' 97 1.1 lukem sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' 98 1.1 lukem # test EBCDIC or ASCII 99 1.1 lukem case `echo X|tr X '\101'` in 100 1.1 lukem A) # ASCII based system 101 1.1 lukem # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr 102 1.1 lukem SP2NL='tr \040 \012' 103 1.1 lukem NL2SP='tr \015\012 \040\040' 104 1.1 lukem ;; 105 1.1 lukem *) # EBCDIC based system 106 1.1 lukem SP2NL='tr \100 \n' 107 1.1 lukem NL2SP='tr \r\n \100\100' 108 1.1 lukem ;; 109 1.1 lukem esac 110 1.1 lukem 111 1.1 lukem # NLS nuisances. 112 1.1 lukem # Only set LANG and LC_ALL to C if already set. 113 1.1 lukem # These must not be set unconditionally because not all systems understand 114 1.1 lukem # e.g. LANG=C (notably SCO). 115 1.1 lukem # We save the old values to restore during execute mode. 116 1.1 lukem lt_env= 117 1.1 lukem for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES 118 1.1 lukem do 119 1.1 lukem eval "if test \"\${$lt_var+set}\" = set; then 120 1.1 lukem save_$lt_var=\$$lt_var 121 1.1 lukem lt_env=\"$lt_var=\$$lt_var \$lt_env\" 122 1.1 lukem $lt_var=C 123 1.1 lukem export $lt_var 124 1.1 lukem fi" 125 1.1 lukem done 126 1.1 lukem 127 1.1 lukem if test -n "$lt_env"; then 128 1.1 lukem lt_env="env $lt_env" 129 1.1 lukem fi 130 1.1 lukem 131 1.1 lukem # Make sure IFS has a sensible default 132 1.1 lukem lt_nl=' 133 1.1 lukem ' 134 1.1 lukem IFS=" $lt_nl" 135 1.1 lukem 136 1.1 lukem if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then 137 1.2 agc $ECHO "$modename: not configured to build any kind of library" 1>&2 138 1.2 agc $ECHO "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 139 1.1 lukem exit $EXIT_FAILURE 140 1.1 lukem fi 141 1.1 lukem 142 1.1 lukem # Global variables. 143 1.1 lukem mode=$default_mode 144 1.1 lukem nonopt= 145 1.1 lukem prev= 146 1.1 lukem prevopt= 147 1.1 lukem run= 148 1.2 agc show="$ECHO" 149 1.1 lukem show_help= 150 1.1 lukem execute_dlfiles= 151 1.1 lukem duplicate_deps=no 152 1.1 lukem preserve_args= 153 1.1 lukem lo2o="s/\\.lo\$/.${objext}/" 154 1.1 lukem o2lo="s/\\.${objext}\$/.lo/" 155 1.1 lukem extracted_archives= 156 1.1 lukem extracted_serial=0 157 1.1 lukem 158 1.1 lukem ##################################### 159 1.1 lukem # Shell function definitions: 160 1.1 lukem # This seems to be the best place for them 161 1.1 lukem 162 1.1 lukem # func_mktempdir [string] 163 1.1 lukem # Make a temporary directory that won't clash with other running 164 1.1 lukem # libtool processes, and avoids race conditions if possible. If 165 1.1 lukem # given, STRING is the basename for that directory. 166 1.1 lukem func_mktempdir () 167 1.1 lukem { 168 1.1 lukem my_template="${TMPDIR-/tmp}/${1-$progname}" 169 1.1 lukem 170 1.1 lukem if test "$run" = ":"; then 171 1.1 lukem # Return a directory name, but don't create it in dry-run mode 172 1.1 lukem my_tmpdir="${my_template}-$$" 173 1.1 lukem else 174 1.1 lukem 175 1.1 lukem # If mktemp works, use that first and foremost 176 1.1 lukem my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` 177 1.1 lukem 178 1.1 lukem if test ! -d "$my_tmpdir"; then 179 1.1 lukem # Failing that, at least try and use $RANDOM to avoid a race 180 1.1 lukem my_tmpdir="${my_template}-${RANDOM-0}$$" 181 1.1 lukem 182 1.1 lukem save_mktempdir_umask=`umask` 183 1.1 lukem umask 0077 184 1.1 lukem $mkdir "$my_tmpdir" 185 1.1 lukem umask $save_mktempdir_umask 186 1.1 lukem fi 187 1.1 lukem 188 1.1 lukem # If we're not in dry-run mode, bomb out on failure 189 1.1 lukem test -d "$my_tmpdir" || { 190 1.2 agc $ECHO "cannot create temporary directory \`$my_tmpdir'" 1>&2 191 1.1 lukem exit $EXIT_FAILURE 192 1.1 lukem } 193 1.1 lukem fi 194 1.1 lukem 195 1.2 agc $ECHO "X$my_tmpdir" | $Xsed 196 1.1 lukem } 197 1.1 lukem 198 1.1 lukem 199 1.1 lukem # func_win32_libid arg 200 1.1 lukem # return the library type of file 'arg' 201 1.1 lukem # 202 1.1 lukem # Need a lot of goo to handle *both* DLLs and import libs 203 1.1 lukem # Has to be a shell function in order to 'eat' the argument 204 1.1 lukem # that is supplied when $file_magic_command is called. 205 1.1 lukem func_win32_libid () 206 1.1 lukem { 207 1.1 lukem win32_libid_type="unknown" 208 1.1 lukem win32_fileres=`file -L $1 2>/dev/null` 209 1.1 lukem case $win32_fileres in 210 1.1 lukem *ar\ archive\ import\ library*) # definitely import 211 1.1 lukem win32_libid_type="x86 archive import" 212 1.1 lukem ;; 213 1.1 lukem *ar\ archive*) # could be an import, or static 214 1.1 lukem if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ 215 1.1 lukem $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then 216 1.1 lukem win32_nmres=`eval $NM -f posix -A $1 | \ 217 1.1 lukem $SED -n -e '1,100{ 218 1.1 lukem / I /{ 219 1.1 lukem s,.*,import, 220 1.1 lukem p 221 1.1 lukem q 222 1.1 lukem } 223 1.1 lukem }'` 224 1.1 lukem case $win32_nmres in 225 1.1 lukem import*) win32_libid_type="x86 archive import";; 226 1.1 lukem *) win32_libid_type="x86 archive static";; 227 1.1 lukem esac 228 1.1 lukem fi 229 1.1 lukem ;; 230 1.1 lukem *DLL*) 231 1.1 lukem win32_libid_type="x86 DLL" 232 1.1 lukem ;; 233 1.1 lukem *executable*) # but shell scripts are "executable" too... 234 1.1 lukem case $win32_fileres in 235 1.1 lukem *MS\ Windows\ PE\ Intel*) 236 1.1 lukem win32_libid_type="x86 DLL" 237 1.1 lukem ;; 238 1.1 lukem esac 239 1.1 lukem ;; 240 1.1 lukem esac 241 1.2 agc $ECHO $win32_libid_type 242 1.1 lukem } 243 1.1 lukem 244 1.1 lukem 245 1.1 lukem # func_infer_tag arg 246 1.1 lukem # Infer tagged configuration to use if any are available and 247 1.1 lukem # if one wasn't chosen via the "--tag" command line option. 248 1.1 lukem # Only attempt this if the compiler in the base compile 249 1.1 lukem # command doesn't match the default compiler. 250 1.1 lukem # arg is usually of the form 'gcc ...' 251 1.1 lukem func_infer_tag () 252 1.1 lukem { 253 1.1 lukem # Set the commonly-used compilers for some tags. 254 1.1 lukem tag_compilers_CC="*cc *xlc" 255 1.1 lukem tag_compilers_CXX="*++ *CC" 256 1.1 lukem tag_compilers_F77="*77 *fort" 257 1.2 agc base_compiler=`set -- "$@"; $ECHO $1` 258 1.1 lukem # If $tagname still isn't set, then try to infer if the default 259 1.1 lukem # "CC" tag applies by matching up the base compile command to some 260 1.1 lukem # compilers commonly used for the "CC" tag. 261 1.1 lukem if test -z "$tagname"; then 262 1.1 lukem z=CC 263 1.1 lukem eval "tag_compilers=\$tag_compilers_${z}" 264 1.1 lukem if test -n "$tag_compilers"; then 265 1.1 lukem for zp in $tag_compilers; do 266 1.1 lukem case $base_compiler in 267 1.1 lukem $zp) 268 1.1 lukem # The compiler in the base compile command matches 269 1.1 lukem # one of the common compilers for the current tag. 270 1.1 lukem # Assume this is the tagged configuration we want. 271 1.1 lukem tagname=$z 272 1.1 lukem break 273 1.1 lukem ;; 274 1.1 lukem esac 275 1.1 lukem done 276 1.1 lukem fi 277 1.1 lukem fi 278 1.1 lukem if test -n "$available_tags" && test -z "$tagname"; then 279 1.1 lukem CC_quoted= 280 1.1 lukem for arg in $CC; do 281 1.1 lukem case $arg in 282 1.1 lukem *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 283 1.1 lukem arg="\"$arg\"" 284 1.1 lukem ;; 285 1.1 lukem esac 286 1.1 lukem CC_quoted="$CC_quoted $arg" 287 1.1 lukem done 288 1.1 lukem case $@ in 289 1.1 lukem # Blanks in the command may have been stripped by the calling shell, 290 1.1 lukem # but not from the CC environment variable when configure was run. 291 1.2 agc " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;; 292 1.1 lukem # Blanks at the start of $base_compile will cause this to fail 293 1.1 lukem # if we don't check for them as well. 294 1.1 lukem *) 295 1.1 lukem for z in $available_tags; do 296 1.1 lukem if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then 297 1.1 lukem # Evaluate the configuration. 298 1.1 lukem eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" 299 1.1 lukem CC_quoted= 300 1.1 lukem for arg in $CC; do 301 1.1 lukem # Double-quote args containing other shell metacharacters. 302 1.1 lukem case $arg in 303 1.1 lukem *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 304 1.1 lukem arg="\"$arg\"" 305 1.1 lukem ;; 306 1.1 lukem esac 307 1.1 lukem CC_quoted="$CC_quoted $arg" 308 1.1 lukem done 309 1.1 lukem case "$@ " in 310 1.2 agc " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) 311 1.1 lukem # The compiler in the base compile command matches 312 1.1 lukem # the one in the tagged configuration. 313 1.1 lukem # Assume this is the tagged configuration we want. 314 1.1 lukem tagname=$z 315 1.1 lukem break 316 1.1 lukem ;; 317 1.1 lukem esac 318 1.1 lukem # If $tagname still isn't set, then try to infer it by 319 1.1 lukem # matching up the base compile command to some compilers 320 1.1 lukem # commonly used for certain tags. 321 1.2 agc base_compiler=`set -- "$@"; $ECHO $1` 322 1.1 lukem eval "tag_compilers=\$tag_compilers_${z}" 323 1.1 lukem if test -n "$tag_compilers"; then 324 1.1 lukem for zp in $tag_compilers; do 325 1.1 lukem case $base_compiler in 326 1.1 lukem $zp) 327 1.1 lukem # The compiler in the base compile command matches 328 1.1 lukem # one of the common compilers for the current tag. 329 1.1 lukem # Assume this is the tagged configuration we want. 330 1.1 lukem tagname=$z 331 1.1 lukem break 332 1.1 lukem ;; 333 1.1 lukem esac 334 1.1 lukem done 335 1.1 lukem if test -n "$tagname"; then 336 1.1 lukem break 337 1.1 lukem fi 338 1.1 lukem fi 339 1.1 lukem fi 340 1.1 lukem done 341 1.1 lukem # If $tagname still isn't set, then no tagged configuration 342 1.1 lukem # was found and let the user know that the "--tag" command 343 1.1 lukem # line option must be used. 344 1.1 lukem if test -z "$tagname"; then 345 1.2 agc $ECHO "$modename: unable to infer tagged configuration" 346 1.2 agc $ECHO "$modename: specify a tag with \`--tag'" 1>&2 347 1.1 lukem exit $EXIT_FAILURE 348 1.1 lukem # else 349 1.2 agc # $ECHO "$modename: using $tagname tagged configuration" 350 1.1 lukem fi 351 1.1 lukem ;; 352 1.1 lukem esac 353 1.1 lukem fi 354 1.1 lukem } 355 1.1 lukem 356 1.1 lukem 357 1.1 lukem # func_extract_an_archive dir oldlib 358 1.1 lukem func_extract_an_archive () 359 1.1 lukem { 360 1.1 lukem f_ex_an_ar_dir="$1"; shift 361 1.1 lukem f_ex_an_ar_oldlib="$1" 362 1.1 lukem 363 1.1 lukem $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" 364 1.1 lukem $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? 365 1.1 lukem if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then 366 1.1 lukem : 367 1.1 lukem else 368 1.2 agc $ECHO "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 369 1.1 lukem exit $EXIT_FAILURE 370 1.1 lukem fi 371 1.1 lukem } 372 1.1 lukem 373 1.1 lukem # func_extract_archives gentop oldlib ... 374 1.1 lukem func_extract_archives () 375 1.1 lukem { 376 1.1 lukem my_gentop="$1"; shift 377 1.1 lukem my_oldlibs=${1+"$@"} 378 1.1 lukem my_oldobjs="" 379 1.1 lukem my_xlib="" 380 1.1 lukem my_xabs="" 381 1.1 lukem my_xdir="" 382 1.1 lukem my_status="" 383 1.1 lukem 384 1.1 lukem $show "${rm}r $my_gentop" 385 1.1 lukem $run ${rm}r "$my_gentop" 386 1.1 lukem $show "$mkdir $my_gentop" 387 1.1 lukem $run $mkdir "$my_gentop" 388 1.1 lukem my_status=$? 389 1.1 lukem if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then 390 1.1 lukem exit $my_status 391 1.1 lukem fi 392 1.1 lukem 393 1.1 lukem for my_xlib in $my_oldlibs; do 394 1.1 lukem # Extract the objects. 395 1.1 lukem case $my_xlib in 396 1.1 lukem [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; 397 1.1 lukem *) my_xabs=`pwd`"/$my_xlib" ;; 398 1.1 lukem esac 399 1.2 agc my_xlib=`$ECHO "X$my_xlib" | $Xsed -e 's%^.*/%%'` 400 1.1 lukem my_xlib_u=$my_xlib 401 1.1 lukem while :; do 402 1.1 lukem case " $extracted_archives " in 403 1.1 lukem *" $my_xlib_u "*) 404 1.1 lukem extracted_serial=`expr $extracted_serial + 1` 405 1.1 lukem my_xlib_u=lt$extracted_serial-$my_xlib ;; 406 1.1 lukem *) break ;; 407 1.1 lukem esac 408 1.1 lukem done 409 1.1 lukem extracted_archives="$extracted_archives $my_xlib_u" 410 1.1 lukem my_xdir="$my_gentop/$my_xlib_u" 411 1.1 lukem 412 1.1 lukem $show "${rm}r $my_xdir" 413 1.1 lukem $run ${rm}r "$my_xdir" 414 1.1 lukem $show "$mkdir $my_xdir" 415 1.1 lukem $run $mkdir "$my_xdir" 416 1.1 lukem exit_status=$? 417 1.1 lukem if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then 418 1.1 lukem exit $exit_status 419 1.1 lukem fi 420 1.1 lukem case $host in 421 1.1 lukem *-darwin*) 422 1.1 lukem $show "Extracting $my_xabs" 423 1.1 lukem # Do not bother doing anything if just a dry run 424 1.1 lukem if test -z "$run"; then 425 1.1 lukem darwin_orig_dir=`pwd` 426 1.1 lukem cd $my_xdir || exit $? 427 1.1 lukem darwin_archive=$my_xabs 428 1.1 lukem darwin_curdir=`pwd` 429 1.2 agc darwin_base_archive=`$ECHO "X$darwin_archive" | $Xsed -e 's%^.*/%%'` 430 1.1 lukem darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` 431 1.1 lukem if test -n "$darwin_arches"; then 432 1.1 lukem darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` 433 1.1 lukem darwin_arch= 434 1.1 lukem $show "$darwin_base_archive has multiple architectures $darwin_arches" 435 1.1 lukem for darwin_arch in $darwin_arches ; do 436 1.1 lukem mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" 437 1.1 lukem lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" 438 1.1 lukem cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" 439 1.1 lukem func_extract_an_archive "`pwd`" "${darwin_base_archive}" 440 1.1 lukem cd "$darwin_curdir" 441 1.1 lukem $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" 442 1.1 lukem done # $darwin_arches 443 1.1 lukem ## Okay now we have a bunch of thin objects, gotta fatten them up :) 444 1.1 lukem darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` 445 1.1 lukem darwin_file= 446 1.1 lukem darwin_files= 447 1.1 lukem for darwin_file in $darwin_filelist; do 448 1.1 lukem darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` 449 1.1 lukem lipo -create -output "$darwin_file" $darwin_files 450 1.1 lukem done # $darwin_filelist 451 1.1 lukem ${rm}r unfat-$$ 452 1.1 lukem cd "$darwin_orig_dir" 453 1.1 lukem else 454 1.1 lukem cd "$darwin_orig_dir" 455 1.1 lukem func_extract_an_archive "$my_xdir" "$my_xabs" 456 1.1 lukem fi # $darwin_arches 457 1.1 lukem fi # $run 458 1.1 lukem ;; 459 1.1 lukem *) 460 1.1 lukem func_extract_an_archive "$my_xdir" "$my_xabs" 461 1.1 lukem ;; 462 1.1 lukem esac 463 1.1 lukem my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` 464 1.1 lukem done 465 1.1 lukem func_extract_archives_result="$my_oldobjs" 466 1.1 lukem } 467 1.1 lukem # End of Shell function definitions 468 1.1 lukem ##################################### 469 1.1 lukem 470 1.1 lukem # Darwin sucks 471 1.1 lukem eval std_shrext=\"$shrext_cmds\" 472 1.1 lukem 473 1.1 lukem disable_libs=no 474 1.1 lukem 475 1.1 lukem # Parse our command line options once, thoroughly. 476 1.1 lukem while test "$#" -gt 0 477 1.1 lukem do 478 1.1 lukem arg="$1" 479 1.1 lukem shift 480 1.1 lukem 481 1.1 lukem case $arg in 482 1.2 agc -*=*) optarg=`$ECHO "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; 483 1.1 lukem *) optarg= ;; 484 1.1 lukem esac 485 1.1 lukem 486 1.1 lukem # If the previous option needs an argument, assign it. 487 1.1 lukem if test -n "$prev"; then 488 1.1 lukem case $prev in 489 1.1 lukem execute_dlfiles) 490 1.1 lukem execute_dlfiles="$execute_dlfiles $arg" 491 1.1 lukem ;; 492 1.1 lukem tag) 493 1.1 lukem tagname="$arg" 494 1.1 lukem preserve_args="${preserve_args}=$arg" 495 1.1 lukem 496 1.1 lukem # Check whether tagname contains only valid characters 497 1.1 lukem case $tagname in 498 1.1 lukem *[!-_A-Za-z0-9,/]*) 499 1.2 agc $ECHO "$progname: invalid tag name: $tagname" 1>&2 500 1.1 lukem exit $EXIT_FAILURE 501 1.1 lukem ;; 502 1.1 lukem esac 503 1.1 lukem 504 1.1 lukem case $tagname in 505 1.1 lukem CC) 506 1.1 lukem # Don't test for the "default" C tag, as we know, it's there, but 507 1.1 lukem # not specially marked. 508 1.1 lukem ;; 509 1.1 lukem *) 510 1.1 lukem if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then 511 1.1 lukem taglist="$taglist $tagname" 512 1.1 lukem # Evaluate the configuration. 513 1.1 lukem eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" 514 1.1 lukem else 515 1.2 agc $ECHO "$progname: ignoring unknown tag $tagname" 1>&2 516 1.1 lukem fi 517 1.1 lukem ;; 518 1.1 lukem esac 519 1.1 lukem ;; 520 1.1 lukem *) 521 1.1 lukem eval "$prev=\$arg" 522 1.1 lukem ;; 523 1.1 lukem esac 524 1.1 lukem 525 1.1 lukem prev= 526 1.1 lukem prevopt= 527 1.1 lukem continue 528 1.1 lukem fi 529 1.1 lukem 530 1.1 lukem # Have we seen a non-optional argument yet? 531 1.1 lukem case $arg in 532 1.1 lukem --help) 533 1.1 lukem show_help=yes 534 1.1 lukem ;; 535 1.1 lukem 536 1.1 lukem --version) 537 1.1 lukem echo "\ 538 1.1 lukem $PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP 539 1.1 lukem 540 1.1 lukem Copyright (C) 2008 Free Software Foundation, Inc. 541 1.1 lukem This is free software; see the source for copying conditions. There is NO 542 1.1 lukem warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 543 1.1 lukem exit $? 544 1.1 lukem ;; 545 1.1 lukem 546 1.1 lukem --config) 547 1.1 lukem ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath 548 1.1 lukem # Now print the configurations for the tags. 549 1.1 lukem for tagname in $taglist; do 550 1.1 lukem ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" 551 1.1 lukem done 552 1.1 lukem exit $? 553 1.1 lukem ;; 554 1.1 lukem 555 1.1 lukem --debug) 556 1.2 agc $ECHO "$progname: enabling shell trace mode" 557 1.1 lukem set -x 558 1.1 lukem preserve_args="$preserve_args $arg" 559 1.1 lukem ;; 560 1.1 lukem 561 1.1 lukem --dry-run | -n) 562 1.1 lukem run=: 563 1.1 lukem ;; 564 1.1 lukem 565 1.1 lukem --features) 566 1.2 agc $ECHO "host: $host" 567 1.1 lukem if test "$build_libtool_libs" = yes; then 568 1.2 agc $ECHO "enable shared libraries" 569 1.1 lukem else 570 1.2 agc $ECHO "disable shared libraries" 571 1.1 lukem fi 572 1.1 lukem if test "$build_old_libs" = yes; then 573 1.2 agc $ECHO "enable static libraries" 574 1.1 lukem else 575 1.2 agc $ECHO "disable static libraries" 576 1.1 lukem fi 577 1.1 lukem exit $? 578 1.1 lukem ;; 579 1.1 lukem 580 1.1 lukem --finish) mode="finish" ;; 581 1.1 lukem 582 1.1 lukem --mode) prevopt="--mode" prev=mode ;; 583 1.1 lukem --mode=*) mode="$optarg" ;; 584 1.1 lukem 585 1.1 lukem --preserve-dup-deps) duplicate_deps="yes" ;; 586 1.1 lukem 587 1.1 lukem --quiet | --silent) 588 1.1 lukem show=: 589 1.1 lukem preserve_args="$preserve_args $arg" 590 1.1 lukem ;; 591 1.1 lukem 592 1.1 lukem --tag) 593 1.1 lukem prevopt="--tag" 594 1.1 lukem prev=tag 595 1.1 lukem preserve_args="$preserve_args --tag" 596 1.1 lukem ;; 597 1.1 lukem --tag=*) 598 1.1 lukem set tag "$optarg" ${1+"$@"} 599 1.1 lukem shift 600 1.1 lukem prev=tag 601 1.1 lukem preserve_args="$preserve_args --tag" 602 1.1 lukem ;; 603 1.1 lukem 604 1.1 lukem -dlopen) 605 1.1 lukem prevopt="-dlopen" 606 1.1 lukem prev=execute_dlfiles 607 1.1 lukem ;; 608 1.1 lukem 609 1.1 lukem -*) 610 1.2 agc $ECHO "$modename: unrecognized option \`$arg'" 1>&2 611 1.2 agc $ECHO "$help" 1>&2 612 1.1 lukem exit $EXIT_FAILURE 613 1.1 lukem ;; 614 1.1 lukem 615 1.1 lukem *) 616 1.1 lukem nonopt="$arg" 617 1.1 lukem break 618 1.1 lukem ;; 619 1.1 lukem esac 620 1.1 lukem done 621 1.1 lukem 622 1.1 lukem if test -n "$prevopt"; then 623 1.2 agc $ECHO "$modename: option \`$prevopt' requires an argument" 1>&2 624 1.2 agc $ECHO "$help" 1>&2 625 1.1 lukem exit $EXIT_FAILURE 626 1.1 lukem fi 627 1.1 lukem 628 1.1 lukem case $disable_libs in 629 1.1 lukem no) 630 1.1 lukem ;; 631 1.1 lukem shared) 632 1.1 lukem build_libtool_libs=no 633 1.1 lukem build_old_libs=yes 634 1.1 lukem ;; 635 1.1 lukem static) 636 1.1 lukem build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` 637 1.1 lukem ;; 638 1.1 lukem esac 639 1.1 lukem 640 1.1 lukem # If this variable is set in any of the actions, the command in it 641 1.1 lukem # will be execed at the end. This prevents here-documents from being 642 1.1 lukem # left over by shells. 643 1.1 lukem exec_cmd= 644 1.1 lukem 645 1.1 lukem if test -z "$show_help"; then 646 1.1 lukem 647 1.1 lukem # Infer the operation mode. 648 1.1 lukem if test -z "$mode"; then 649 1.2 agc $ECHO "*** Warning: inferring the mode of operation is deprecated." 1>&2 650 1.2 agc $ECHO "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 651 1.1 lukem case $nonopt in 652 1.1 lukem *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc* | *CC) 653 1.1 lukem mode=link 654 1.1 lukem for arg 655 1.1 lukem do 656 1.1 lukem case $arg in 657 1.1 lukem -c) 658 1.1 lukem mode=compile 659 1.1 lukem break 660 1.1 lukem ;; 661 1.1 lukem esac 662 1.1 lukem done 663 1.1 lukem ;; 664 1.1 lukem *db | *dbx | *strace | *truss) 665 1.1 lukem mode=execute 666 1.1 lukem ;; 667 1.1 lukem *install*|cp|mv) 668 1.1 lukem mode=install 669 1.1 lukem ;; 670 1.1 lukem *rm) 671 1.1 lukem mode=uninstall 672 1.1 lukem ;; 673 1.1 lukem *) 674 1.1 lukem # If we have no mode, but dlfiles were specified, then do execute mode. 675 1.1 lukem test -n "$execute_dlfiles" && mode=execute 676 1.1 lukem 677 1.1 lukem # Just use the default operation mode. 678 1.1 lukem if test -z "$mode"; then 679 1.1 lukem if test -n "$nonopt"; then 680 1.2 agc $ECHO "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 681 1.1 lukem else 682 1.2 agc $ECHO "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 683 1.1 lukem fi 684 1.1 lukem fi 685 1.1 lukem ;; 686 1.1 lukem esac 687 1.1 lukem fi 688 1.1 lukem 689 1.1 lukem # Only execute mode is allowed to have -dlopen flags. 690 1.1 lukem if test -n "$execute_dlfiles" && test "$mode" != execute; then 691 1.2 agc $ECHO "$modename: unrecognized option \`-dlopen'" 1>&2 692 1.2 agc $ECHO "$help" 1>&2 693 1.1 lukem exit $EXIT_FAILURE 694 1.1 lukem fi 695 1.1 lukem 696 1.1 lukem # Change the help message to a mode-specific one. 697 1.1 lukem generic_help="$help" 698 1.1 lukem help="Try \`$modename --help --mode=$mode' for more information." 699 1.1 lukem 700 1.1 lukem # These modes are in order of execution frequency so that they run quickly. 701 1.1 lukem case $mode in 702 1.1 lukem # libtool compile mode 703 1.1 lukem compile) 704 1.1 lukem modename="$modename: compile" 705 1.1 lukem # Get the compilation command and the source file. 706 1.1 lukem base_compile= 707 1.1 lukem srcfile="$nonopt" # always keep a non-empty value in "srcfile" 708 1.1 lukem suppress_opt=yes 709 1.1 lukem suppress_output= 710 1.1 lukem arg_mode=normal 711 1.1 lukem libobj= 712 1.1 lukem later= 713 1.1 lukem 714 1.1 lukem for arg 715 1.1 lukem do 716 1.1 lukem case $arg_mode in 717 1.1 lukem arg ) 718 1.1 lukem # do not "continue". Instead, add this to base_compile 719 1.1 lukem lastarg="$arg" 720 1.1 lukem arg_mode=normal 721 1.1 lukem ;; 722 1.1 lukem 723 1.1 lukem target ) 724 1.1 lukem libobj="$arg" 725 1.1 lukem arg_mode=normal 726 1.1 lukem continue 727 1.1 lukem ;; 728 1.1 lukem 729 1.1 lukem normal ) 730 1.1 lukem # Accept any command-line options. 731 1.1 lukem case $arg in 732 1.1 lukem -o) 733 1.1 lukem if test -n "$libobj" ; then 734 1.2 agc $ECHO "$modename: you cannot specify \`-o' more than once" 1>&2 735 1.1 lukem exit $EXIT_FAILURE 736 1.1 lukem fi 737 1.1 lukem arg_mode=target 738 1.1 lukem continue 739 1.1 lukem ;; 740 1.1 lukem 741 1.1 lukem -static | -prefer-pic | -prefer-non-pic) 742 1.1 lukem later="$later $arg" 743 1.1 lukem continue 744 1.1 lukem ;; 745 1.1 lukem 746 1.1 lukem -no-suppress) 747 1.1 lukem suppress_opt=no 748 1.1 lukem continue 749 1.1 lukem ;; 750 1.1 lukem 751 1.1 lukem -Xcompiler) 752 1.1 lukem arg_mode=arg # the next one goes into the "base_compile" arg list 753 1.1 lukem continue # The current "srcfile" will either be retained or 754 1.1 lukem ;; # replaced later. I would guess that would be a bug. 755 1.1 lukem 756 1.1 lukem -Wc,*) 757 1.2 agc args=`$ECHO "X$arg" | $Xsed -e "s/^-Wc,//"` 758 1.1 lukem lastarg= 759 1.1 lukem save_ifs="$IFS"; IFS=',' 760 1.1 lukem for arg in $args; do 761 1.1 lukem IFS="$save_ifs" 762 1.1 lukem 763 1.1 lukem # Double-quote args containing other shell metacharacters. 764 1.1 lukem # Many Bourne shells cannot handle close brackets correctly 765 1.1 lukem # in scan sets, so we specify it separately. 766 1.1 lukem case $arg in 767 1.1 lukem *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 768 1.1 lukem arg="\"$arg\"" 769 1.1 lukem ;; 770 1.1 lukem esac 771 1.1 lukem lastarg="$lastarg $arg" 772 1.1 lukem done 773 1.1 lukem IFS="$save_ifs" 774 1.2 agc lastarg=`$ECHO "X$lastarg" | $Xsed -e "s/^ //"` 775 1.1 lukem 776 1.1 lukem # Add the arguments to base_compile. 777 1.1 lukem base_compile="$base_compile $lastarg" 778 1.1 lukem continue 779 1.1 lukem ;; 780 1.1 lukem 781 1.1 lukem * ) 782 1.1 lukem # Accept the current argument as the source file. 783 1.1 lukem # The previous "srcfile" becomes the current argument. 784 1.1 lukem # 785 1.1 lukem lastarg="$srcfile" 786 1.1 lukem srcfile="$arg" 787 1.1 lukem ;; 788 1.1 lukem esac # case $arg 789 1.1 lukem ;; 790 1.1 lukem esac # case $arg_mode 791 1.1 lukem 792 1.1 lukem # Aesthetically quote the previous argument. 793 1.2 agc lastarg=`$ECHO "X$lastarg" | $Xsed -e "$sed_quote_subst"` 794 1.1 lukem 795 1.1 lukem case $lastarg in 796 1.1 lukem # Double-quote args containing other shell metacharacters. 797 1.1 lukem # Many Bourne shells cannot handle close brackets correctly 798 1.1 lukem # in scan sets, and some SunOS ksh mistreat backslash-escaping 799 1.1 lukem # in scan sets (worked around with variable expansion), 800 1.1 lukem # and furthermore cannot handle '|' '&' '(' ')' in scan sets 801 1.1 lukem # at all, so we specify them separately. 802 1.1 lukem *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 803 1.1 lukem lastarg="\"$lastarg\"" 804 1.1 lukem ;; 805 1.1 lukem esac 806 1.1 lukem 807 1.1 lukem base_compile="$base_compile $lastarg" 808 1.1 lukem done # for arg 809 1.1 lukem 810 1.1 lukem case $arg_mode in 811 1.1 lukem arg) 812 1.2 agc $ECHO "$modename: you must specify an argument for -Xcompile" 813 1.1 lukem exit $EXIT_FAILURE 814 1.1 lukem ;; 815 1.1 lukem target) 816 1.2 agc $ECHO "$modename: you must specify a target with \`-o'" 1>&2 817 1.1 lukem exit $EXIT_FAILURE 818 1.1 lukem ;; 819 1.1 lukem *) 820 1.1 lukem # Get the name of the library object. 821 1.2 agc [ -z "$libobj" ] && libobj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%'` 822 1.1 lukem ;; 823 1.1 lukem esac 824 1.1 lukem 825 1.1 lukem # Recognize several different file suffixes. 826 1.1 lukem # If the user specifies -o file.o, it is replaced with file.lo 827 1.1 lukem xform='[cCFSifmso]' 828 1.1 lukem case $libobj in 829 1.1 lukem *.ada) xform=ada ;; 830 1.1 lukem *.adb) xform=adb ;; 831 1.1 lukem *.ads) xform=ads ;; 832 1.1 lukem *.asm) xform=asm ;; 833 1.1 lukem *.c++) xform=c++ ;; 834 1.1 lukem *.cc) xform=cc ;; 835 1.1 lukem *.ii) xform=ii ;; 836 1.1 lukem *.class) xform=class ;; 837 1.1 lukem *.cpp) xform=cpp ;; 838 1.1 lukem *.cxx) xform=cxx ;; 839 1.1 lukem *.[fF][09]?) xform=[fF][09]. ;; 840 1.1 lukem *.for) xform=for ;; 841 1.1 lukem *.java) xform=java ;; 842 1.1 lukem *.obj) xform=obj ;; 843 1.1 lukem *.sx) xform=sx ;; 844 1.1 lukem esac 845 1.1 lukem 846 1.2 agc libobj=`$ECHO "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` 847 1.1 lukem 848 1.1 lukem case $libobj in 849 1.2 agc *.lo) obj=`$ECHO "X$libobj" | $Xsed -e "$lo2o"` ;; 850 1.1 lukem *) 851 1.2 agc $ECHO "$modename: cannot determine name of library object from \`$libobj'" 1>&2 852 1.1 lukem exit $EXIT_FAILURE 853 1.1 lukem ;; 854 1.1 lukem esac 855 1.1 lukem 856 1.1 lukem func_infer_tag $base_compile 857 1.1 lukem 858 1.1 lukem for arg in $later; do 859 1.1 lukem case $arg in 860 1.1 lukem -static) 861 1.1 lukem build_old_libs=yes 862 1.1 lukem continue 863 1.1 lukem ;; 864 1.1 lukem 865 1.1 lukem -prefer-pic) 866 1.1 lukem pic_mode=yes 867 1.1 lukem continue 868 1.1 lukem ;; 869 1.1 lukem 870 1.1 lukem -prefer-non-pic) 871 1.1 lukem pic_mode=no 872 1.1 lukem continue 873 1.1 lukem ;; 874 1.1 lukem esac 875 1.1 lukem done 876 1.1 lukem 877 1.2 agc qlibobj=`$ECHO "X$libobj" | $Xsed -e "$sed_quote_subst"` 878 1.1 lukem case $qlibobj in 879 1.1 lukem *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 880 1.1 lukem qlibobj="\"$qlibobj\"" ;; 881 1.1 lukem esac 882 1.1 lukem test "X$libobj" != "X$qlibobj" \ 883 1.2 agc && $ECHO "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ 884 1.2 agc && $ECHO "$modename: libobj name \`$libobj' may not contain shell special characters." 885 1.2 agc objname=`$ECHO "X$obj" | $Xsed -e 's%^.*/%%'` 886 1.2 agc xdir=`$ECHO "X$obj" | $Xsed -e 's%/[^/]*$%%'` 887 1.1 lukem if test "X$xdir" = "X$obj"; then 888 1.1 lukem xdir= 889 1.1 lukem else 890 1.1 lukem xdir=$xdir/ 891 1.1 lukem fi 892 1.1 lukem lobj=${xdir}$objdir/$objname 893 1.1 lukem 894 1.1 lukem if test -z "$base_compile"; then 895 1.2 agc $ECHO "$modename: you must specify a compilation command" 1>&2 896 1.2 agc $ECHO "$help" 1>&2 897 1.1 lukem exit $EXIT_FAILURE 898 1.1 lukem fi 899 1.1 lukem 900 1.1 lukem # Delete any leftover library objects. 901 1.1 lukem if test "$build_old_libs" = yes; then 902 1.1 lukem removelist="$obj $lobj $libobj ${libobj}T" 903 1.1 lukem else 904 1.1 lukem removelist="$lobj $libobj ${libobj}T" 905 1.1 lukem fi 906 1.1 lukem 907 1.1 lukem $run $rm $removelist 908 1.1 lukem trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 909 1.1 lukem 910 1.1 lukem # On Cygwin there's no "real" PIC flag so we must build both object types 911 1.1 lukem case $host_os in 912 1.1 lukem cygwin* | mingw* | pw32* | os2*) 913 1.1 lukem pic_mode=default 914 1.1 lukem ;; 915 1.1 lukem esac 916 1.1 lukem if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then 917 1.1 lukem # non-PIC code in shared libraries is not supported 918 1.1 lukem pic_mode=default 919 1.1 lukem fi 920 1.1 lukem 921 1.1 lukem # Calculate the filename of the output object if compiler does 922 1.1 lukem # not support -o with -c 923 1.1 lukem if test "$compiler_c_o" = no; then 924 1.2 agc output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} 925 1.1 lukem lockfile="$output_obj.lock" 926 1.1 lukem removelist="$removelist $output_obj $lockfile" 927 1.1 lukem trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 928 1.1 lukem else 929 1.1 lukem output_obj= 930 1.1 lukem need_locks=no 931 1.1 lukem lockfile= 932 1.1 lukem fi 933 1.1 lukem 934 1.1 lukem # Lock this critical section if it is needed 935 1.1 lukem # We use this script file to make the link, it avoids creating a new file 936 1.1 lukem if test "$need_locks" = yes; then 937 1.1 lukem until $run ln "$progpath" "$lockfile" 2>/dev/null; do 938 1.1 lukem $show "Waiting for $lockfile to be removed" 939 1.1 lukem sleep 2 940 1.1 lukem done 941 1.1 lukem elif test "$need_locks" = warn; then 942 1.1 lukem if test -f "$lockfile"; then 943 1.2 agc $ECHO "\ 944 1.1 lukem *** ERROR, $lockfile exists and contains: 945 1.1 lukem `cat $lockfile 2>/dev/null` 946 1.1 lukem 947 1.1 lukem This indicates that another process is trying to use the same 948 1.1 lukem temporary object file, and libtool could not work around it because 949 1.1 lukem your compiler does not support \`-c' and \`-o' together. If you 950 1.1 lukem repeat this compilation, it may succeed, by chance, but you had better 951 1.1 lukem avoid parallel builds (make -j) in this platform, or get a better 952 1.1 lukem compiler." 953 1.1 lukem 954 1.1 lukem $run $rm $removelist 955 1.1 lukem exit $EXIT_FAILURE 956 1.1 lukem fi 957 1.2 agc $ECHO "$srcfile" > "$lockfile" 958 1.1 lukem fi 959 1.1 lukem 960 1.1 lukem if test -n "$fix_srcfile_path"; then 961 1.1 lukem eval srcfile=\"$fix_srcfile_path\" 962 1.1 lukem fi 963 1.2 agc qsrcfile=`$ECHO "X$srcfile" | $Xsed -e "$sed_quote_subst"` 964 1.1 lukem case $qsrcfile in 965 1.1 lukem *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 966 1.1 lukem qsrcfile="\"$qsrcfile\"" ;; 967 1.1 lukem esac 968 1.1 lukem 969 1.1 lukem $run $rm "$libobj" "${libobj}T" 970 1.1 lukem 971 1.1 lukem # Create a libtool object file (analogous to a ".la" file), 972 1.1 lukem # but don't create it if we're doing a dry run. 973 1.1 lukem test -z "$run" && cat > ${libobj}T <<EOF 974 1.1 lukem # $libobj - a libtool object file 975 1.1 lukem # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP 976 1.1 lukem # 977 1.1 lukem # Please DO NOT delete this file! 978 1.1 lukem # It is necessary for linking the library. 979 1.1 lukem 980 1.1 lukem # Name of the PIC object. 981 1.1 lukem EOF 982 1.1 lukem 983 1.1 lukem # Only build a PIC object if we are building libtool libraries. 984 1.1 lukem if test "$build_libtool_libs" = yes; then 985 1.1 lukem # Without this assignment, base_compile gets emptied. 986 1.1 lukem fbsd_hideous_sh_bug=$base_compile 987 1.1 lukem 988 1.1 lukem if test "$pic_mode" != no; then 989 1.1 lukem command="$base_compile $qsrcfile $pic_flag" 990 1.1 lukem else 991 1.1 lukem # Don't build PIC code 992 1.1 lukem command="$base_compile $qsrcfile" 993 1.1 lukem fi 994 1.1 lukem 995 1.1 lukem if test ! -d "${xdir}$objdir"; then 996 1.1 lukem $show "$mkdir ${xdir}$objdir" 997 1.1 lukem $run $mkdir ${xdir}$objdir 998 1.1 lukem exit_status=$? 999 1.1 lukem if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then 1000 1.1 lukem exit $exit_status 1001 1.1 lukem fi 1002 1.1 lukem fi 1003 1.1 lukem 1004 1.1 lukem if test -z "$output_obj"; then 1005 1.1 lukem # Place PIC objects in $objdir 1006 1.1 lukem command="$command -o $lobj" 1007 1.1 lukem fi 1008 1.1 lukem 1009 1.1 lukem $run $rm "$lobj" "$output_obj" 1010 1.1 lukem 1011 1.1 lukem $show "$command" 1012 1.1 lukem if $run eval $lt_env "$command"; then : 1013 1.1 lukem else 1014 1.1 lukem test -n "$output_obj" && $run $rm $removelist 1015 1.1 lukem exit $EXIT_FAILURE 1016 1.1 lukem fi 1017 1.1 lukem 1018 1.1 lukem if test "$need_locks" = warn && 1019 1.1 lukem test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then 1020 1.2 agc $ECHO "\ 1021 1.1 lukem *** ERROR, $lockfile contains: 1022 1.1 lukem `cat $lockfile 2>/dev/null` 1023 1.1 lukem 1024 1.1 lukem but it should contain: 1025 1.1 lukem $srcfile 1026 1.1 lukem 1027 1.1 lukem This indicates that another process is trying to use the same 1028 1.1 lukem temporary object file, and libtool could not work around it because 1029 1.1 lukem your compiler does not support \`-c' and \`-o' together. If you 1030 1.1 lukem repeat this compilation, it may succeed, by chance, but you had better 1031 1.1 lukem avoid parallel builds (make -j) in this platform, or get a better 1032 1.1 lukem compiler." 1033 1.1 lukem 1034 1.1 lukem $run $rm $removelist 1035 1.1 lukem exit $EXIT_FAILURE 1036 1.1 lukem fi 1037 1.1 lukem 1038 1.1 lukem # Just move the object if needed, then go on to compile the next one 1039 1.1 lukem if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then 1040 1.1 lukem $show "$mv $output_obj $lobj" 1041 1.1 lukem if $run $mv $output_obj $lobj; then : 1042 1.1 lukem else 1043 1.1 lukem error=$? 1044 1.1 lukem $run $rm $removelist 1045 1.1 lukem exit $error 1046 1.1 lukem fi 1047 1.1 lukem fi 1048 1.1 lukem 1049 1.1 lukem # Append the name of the PIC object to the libtool object file. 1050 1.1 lukem test -z "$run" && cat >> ${libobj}T <<EOF 1051 1.1 lukem pic_object='$objdir/$objname' 1052 1.1 lukem 1053 1.1 lukem EOF 1054 1.1 lukem 1055 1.1 lukem # Allow error messages only from the first compilation. 1056 1.1 lukem if test "$suppress_opt" = yes; then 1057 1.1 lukem suppress_output=' >/dev/null 2>&1' 1058 1.1 lukem fi 1059 1.1 lukem else 1060 1.1 lukem # No PIC object so indicate it doesn't exist in the libtool 1061 1.1 lukem # object file. 1062 1.1 lukem test -z "$run" && cat >> ${libobj}T <<EOF 1063 1.1 lukem pic_object=none 1064 1.1 lukem 1065 1.1 lukem EOF 1066 1.1 lukem fi 1067 1.1 lukem 1068 1.1 lukem # Only build a position-dependent object if we build old libraries. 1069 1.1 lukem if test "$build_old_libs" = yes; then 1070 1.1 lukem if test "$pic_mode" != yes; then 1071 1.1 lukem # Don't build PIC code 1072 1.1 lukem command="$base_compile $qsrcfile" 1073 1.1 lukem else 1074 1.1 lukem command="$base_compile $qsrcfile $pic_flag" 1075 1.1 lukem fi 1076 1.1 lukem if test "$compiler_c_o" = yes; then 1077 1.1 lukem command="$command -o $obj" 1078 1.1 lukem fi 1079 1.1 lukem 1080 1.1 lukem # Suppress compiler output if we already did a PIC compilation. 1081 1.1 lukem command="$command$suppress_output" 1082 1.1 lukem $run $rm "$obj" "$output_obj" 1083 1.1 lukem $show "$command" 1084 1.1 lukem if $run eval $lt_env "$command"; then : 1085 1.1 lukem else 1086 1.1 lukem $run $rm $removelist 1087 1.1 lukem exit $EXIT_FAILURE 1088 1.1 lukem fi 1089 1.1 lukem 1090 1.1 lukem if test "$need_locks" = warn && 1091 1.1 lukem test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then 1092 1.2 agc $ECHO "\ 1093 1.1 lukem *** ERROR, $lockfile contains: 1094 1.1 lukem `cat $lockfile 2>/dev/null` 1095 1.1 lukem 1096 1.1 lukem but it should contain: 1097 1.1 lukem $srcfile 1098 1.1 lukem 1099 1.1 lukem This indicates that another process is trying to use the same 1100 1.1 lukem temporary object file, and libtool could not work around it because 1101 1.1 lukem your compiler does not support \`-c' and \`-o' together. If you 1102 1.1 lukem repeat this compilation, it may succeed, by chance, but you had better 1103 1.1 lukem avoid parallel builds (make -j) in this platform, or get a better 1104 1.1 lukem compiler." 1105 1.1 lukem 1106 1.1 lukem $run $rm $removelist 1107 1.1 lukem exit $EXIT_FAILURE 1108 1.1 lukem fi 1109 1.1 lukem 1110 1.1 lukem # Just move the object if needed 1111 1.1 lukem if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then 1112 1.1 lukem $show "$mv $output_obj $obj" 1113 1.1 lukem if $run $mv $output_obj $obj; then : 1114 1.1 lukem else 1115 1.1 lukem error=$? 1116 1.1 lukem $run $rm $removelist 1117 1.1 lukem exit $error 1118 1.1 lukem fi 1119 1.1 lukem fi 1120 1.1 lukem 1121 1.1 lukem # Append the name of the non-PIC object the libtool object file. 1122 1.1 lukem # Only append if the libtool object file exists. 1123 1.1 lukem test -z "$run" && cat >> ${libobj}T <<EOF 1124 1.1 lukem # Name of the non-PIC object. 1125 1.1 lukem non_pic_object='$objname' 1126 1.1 lukem 1127 1.1 lukem EOF 1128 1.1 lukem else 1129 1.1 lukem # Append the name of the non-PIC object the libtool object file. 1130 1.1 lukem # Only append if the libtool object file exists. 1131 1.1 lukem test -z "$run" && cat >> ${libobj}T <<EOF 1132 1.1 lukem # Name of the non-PIC object. 1133 1.1 lukem non_pic_object=none 1134 1.1 lukem 1135 1.1 lukem EOF 1136 1.1 lukem fi 1137 1.1 lukem 1138 1.1 lukem $run $mv "${libobj}T" "${libobj}" 1139 1.1 lukem 1140 1.1 lukem # Unlock the critical section if it was locked 1141 1.1 lukem if test "$need_locks" != no; then 1142 1.1 lukem $run $rm "$lockfile" 1143 1.1 lukem fi 1144 1.1 lukem 1145 1.1 lukem exit $EXIT_SUCCESS 1146 1.1 lukem ;; 1147 1.1 lukem 1148 1.1 lukem # libtool link mode 1149 1.1 lukem link | relink) 1150 1.1 lukem modename="$modename: link" 1151 1.1 lukem case $host in 1152 1.1 lukem *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) 1153 1.1 lukem # It is impossible to link a dll without this setting, and 1154 1.1 lukem # we shouldn't force the makefile maintainer to figure out 1155 1.1 lukem # which system we are compiling for in order to pass an extra 1156 1.1 lukem # flag for every libtool invocation. 1157 1.1 lukem # allow_undefined=no 1158 1.1 lukem 1159 1.1 lukem # FIXME: Unfortunately, there are problems with the above when trying 1160 1.1 lukem # to make a dll which has undefined symbols, in which case not 1161 1.1 lukem # even a static library is built. For now, we need to specify 1162 1.1 lukem # -no-undefined on the libtool link line when we can be certain 1163 1.1 lukem # that all symbols are satisfied, otherwise we get a static library. 1164 1.1 lukem allow_undefined=yes 1165 1.1 lukem ;; 1166 1.1 lukem *) 1167 1.1 lukem allow_undefined=yes 1168 1.1 lukem ;; 1169 1.1 lukem esac 1170 1.1 lukem libtool_args="$nonopt" 1171 1.1 lukem base_compile="$nonopt $@" 1172 1.1 lukem compile_command="$nonopt" 1173 1.1 lukem finalize_command="$nonopt" 1174 1.1 lukem 1175 1.1 lukem compile_rpath= 1176 1.1 lukem finalize_rpath= 1177 1.1 lukem compile_shlibpath= 1178 1.1 lukem finalize_shlibpath= 1179 1.1 lukem convenience= 1180 1.1 lukem old_convenience= 1181 1.1 lukem deplibs= 1182 1.1 lukem old_deplibs= 1183 1.1 lukem compiler_flags= 1184 1.1 lukem linker_flags= 1185 1.1 lukem dllsearchpath= 1186 1.1 lukem lib_search_path=`pwd` 1187 1.1 lukem inst_prefix_dir= 1188 1.1 lukem 1189 1.1 lukem avoid_version=no 1190 1.1 lukem dlfiles= 1191 1.1 lukem dlprefiles= 1192 1.1 lukem dlself=no 1193 1.1 lukem export_dynamic=no 1194 1.1 lukem export_symbols= 1195 1.1 lukem export_symbols_regex= 1196 1.1 lukem generated= 1197 1.1 lukem libobjs= 1198 1.1 lukem ltlibs= 1199 1.1 lukem module=no 1200 1.1 lukem no_install=no 1201 1.1 lukem objs= 1202 1.1 lukem non_pic_objects= 1203 1.1 lukem notinst_path= # paths that contain not-installed libtool libraries 1204 1.1 lukem precious_files_regex= 1205 1.1 lukem prefer_static_libs=no 1206 1.1 lukem preload=no 1207 1.1 lukem prev= 1208 1.1 lukem prevarg= 1209 1.1 lukem release= 1210 1.1 lukem rpath= 1211 1.1 lukem xrpath= 1212 1.1 lukem perm_rpath= 1213 1.1 lukem temp_rpath= 1214 1.1 lukem thread_safe=no 1215 1.1 lukem vinfo= 1216 1.1 lukem vinfo_number=no 1217 1.1 lukem single_module="${wl}-single_module" 1218 1.1 lukem 1219 1.1 lukem func_infer_tag $base_compile 1220 1.1 lukem 1221 1.1 lukem # We need to know -static, to get the right output filenames. 1222 1.1 lukem for arg 1223 1.1 lukem do 1224 1.1 lukem case $arg in 1225 1.1 lukem -all-static | -static | -static-libtool-libs) 1226 1.1 lukem case $arg in 1227 1.1 lukem -all-static) 1228 1.1 lukem if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then 1229 1.2 agc $ECHO "$modename: warning: complete static linking is impossible in this configuration" 1>&2 1230 1.1 lukem fi 1231 1.1 lukem if test -n "$link_static_flag"; then 1232 1.1 lukem dlopen_self=$dlopen_self_static 1233 1.1 lukem fi 1234 1.1 lukem prefer_static_libs=yes 1235 1.1 lukem ;; 1236 1.1 lukem -static) 1237 1.1 lukem if test -z "$pic_flag" && test -n "$link_static_flag"; then 1238 1.1 lukem dlopen_self=$dlopen_self_static 1239 1.1 lukem fi 1240 1.1 lukem prefer_static_libs=built 1241 1.1 lukem ;; 1242 1.1 lukem -static-libtool-libs) 1243 1.1 lukem if test -z "$pic_flag" && test -n "$link_static_flag"; then 1244 1.1 lukem dlopen_self=$dlopen_self_static 1245 1.1 lukem fi 1246 1.1 lukem prefer_static_libs=yes 1247 1.1 lukem ;; 1248 1.1 lukem esac 1249 1.1 lukem build_libtool_libs=no 1250 1.1 lukem build_old_libs=yes 1251 1.1 lukem break 1252 1.1 lukem ;; 1253 1.1 lukem esac 1254 1.1 lukem done 1255 1.1 lukem 1256 1.1 lukem # See if our shared archives depend on static archives. 1257 1.1 lukem test -n "$old_archive_from_new_cmds" && build_old_libs=yes 1258 1.1 lukem 1259 1.1 lukem # Go through the arguments, transforming them on the way. 1260 1.1 lukem while test "$#" -gt 0; do 1261 1.1 lukem arg="$1" 1262 1.1 lukem shift 1263 1.1 lukem case $arg in 1264 1.1 lukem *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 1265 1.2 agc qarg=\"`$ECHO "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test 1266 1.1 lukem ;; 1267 1.1 lukem *) qarg=$arg ;; 1268 1.1 lukem esac 1269 1.1 lukem libtool_args="$libtool_args $qarg" 1270 1.1 lukem 1271 1.1 lukem # If the previous option needs an argument, assign it. 1272 1.1 lukem if test -n "$prev"; then 1273 1.1 lukem case $prev in 1274 1.1 lukem output) 1275 1.1 lukem compile_command="$compile_command @OUTPUT@" 1276 1.1 lukem finalize_command="$finalize_command @OUTPUT@" 1277 1.1 lukem ;; 1278 1.1 lukem esac 1279 1.1 lukem 1280 1.1 lukem case $prev in 1281 1.1 lukem dlfiles|dlprefiles) 1282 1.1 lukem if test "$preload" = no; then 1283 1.1 lukem # Add the symbol object into the linking commands. 1284 1.1 lukem compile_command="$compile_command @SYMFILE@" 1285 1.1 lukem finalize_command="$finalize_command @SYMFILE@" 1286 1.1 lukem preload=yes 1287 1.1 lukem fi 1288 1.1 lukem case $arg in 1289 1.1 lukem *.la | *.lo) ;; # We handle these cases below. 1290 1.1 lukem force) 1291 1.1 lukem if test "$dlself" = no; then 1292 1.1 lukem dlself=needless 1293 1.1 lukem export_dynamic=yes 1294 1.1 lukem fi 1295 1.1 lukem prev= 1296 1.1 lukem continue 1297 1.1 lukem ;; 1298 1.1 lukem self) 1299 1.1 lukem if test "$prev" = dlprefiles; then 1300 1.1 lukem dlself=yes 1301 1.1 lukem elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then 1302 1.1 lukem dlself=yes 1303 1.1 lukem else 1304 1.1 lukem dlself=needless 1305 1.1 lukem export_dynamic=yes 1306 1.1 lukem fi 1307 1.1 lukem prev= 1308 1.1 lukem continue 1309 1.1 lukem ;; 1310 1.1 lukem *) 1311 1.1 lukem if test "$prev" = dlfiles; then 1312 1.1 lukem dlfiles="$dlfiles $arg" 1313 1.1 lukem else 1314 1.1 lukem dlprefiles="$dlprefiles $arg" 1315 1.1 lukem fi 1316 1.1 lukem prev= 1317 1.1 lukem continue 1318 1.1 lukem ;; 1319 1.1 lukem esac 1320 1.1 lukem ;; 1321 1.1 lukem expsyms) 1322 1.1 lukem export_symbols="$arg" 1323 1.1 lukem if test ! -f "$arg"; then 1324 1.2 agc $ECHO "$modename: symbol file \`$arg' does not exist" 1325 1.1 lukem exit $EXIT_FAILURE 1326 1.1 lukem fi 1327 1.1 lukem prev= 1328 1.1 lukem continue 1329 1.1 lukem ;; 1330 1.1 lukem expsyms_regex) 1331 1.1 lukem export_symbols_regex="$arg" 1332 1.1 lukem prev= 1333 1.1 lukem continue 1334 1.1 lukem ;; 1335 1.1 lukem inst_prefix) 1336 1.1 lukem inst_prefix_dir="$arg" 1337 1.1 lukem prev= 1338 1.1 lukem continue 1339 1.1 lukem ;; 1340 1.1 lukem precious_regex) 1341 1.1 lukem precious_files_regex="$arg" 1342 1.1 lukem prev= 1343 1.1 lukem continue 1344 1.1 lukem ;; 1345 1.1 lukem release) 1346 1.1 lukem release="-$arg" 1347 1.1 lukem prev= 1348 1.1 lukem continue 1349 1.1 lukem ;; 1350 1.1 lukem objectlist) 1351 1.1 lukem if test -f "$arg"; then 1352 1.1 lukem save_arg=$arg 1353 1.1 lukem moreargs= 1354 1.1 lukem for fil in `cat $save_arg` 1355 1.1 lukem do 1356 1.1 lukem # moreargs="$moreargs $fil" 1357 1.1 lukem arg=$fil 1358 1.1 lukem # A libtool-controlled object. 1359 1.1 lukem 1360 1.1 lukem # Check to see that this really is a libtool object. 1361 1.1 lukem if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 1362 1.1 lukem pic_object= 1363 1.1 lukem non_pic_object= 1364 1.1 lukem 1365 1.1 lukem # Read the .lo file 1366 1.1 lukem # If there is no directory component, then add one. 1367 1.1 lukem case $arg in 1368 1.1 lukem */* | *\\*) . $arg ;; 1369 1.1 lukem *) . ./$arg ;; 1370 1.1 lukem esac 1371 1.1 lukem 1372 1.1 lukem if test -z "$pic_object" || \ 1373 1.1 lukem test -z "$non_pic_object" || 1374 1.1 lukem test "$pic_object" = none && \ 1375 1.1 lukem test "$non_pic_object" = none; then 1376 1.2 agc $ECHO "$modename: cannot find name of object for \`$arg'" 1>&2 1377 1.1 lukem exit $EXIT_FAILURE 1378 1.1 lukem fi 1379 1.1 lukem 1380 1.1 lukem # Extract subdirectory from the argument. 1381 1.2 agc xdir=`$ECHO "X$arg" | $Xsed -e 's%/[^/]*$%%'` 1382 1.1 lukem if test "X$xdir" = "X$arg"; then 1383 1.1 lukem xdir= 1384 1.1 lukem else 1385 1.1 lukem xdir="$xdir/" 1386 1.1 lukem fi 1387 1.1 lukem 1388 1.1 lukem if test "$pic_object" != none; then 1389 1.1 lukem # Prepend the subdirectory the object is found in. 1390 1.1 lukem pic_object="$xdir$pic_object" 1391 1.1 lukem 1392 1.1 lukem if test "$prev" = dlfiles; then 1393 1.1 lukem if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then 1394 1.1 lukem dlfiles="$dlfiles $pic_object" 1395 1.1 lukem prev= 1396 1.1 lukem continue 1397 1.1 lukem else 1398 1.1 lukem # If libtool objects are unsupported, then we need to preload. 1399 1.1 lukem prev=dlprefiles 1400 1.1 lukem fi 1401 1.1 lukem fi 1402 1.1 lukem 1403 1.1 lukem # CHECK ME: I think I busted this. -Ossama 1404 1.1 lukem if test "$prev" = dlprefiles; then 1405 1.1 lukem # Preload the old-style object. 1406 1.1 lukem dlprefiles="$dlprefiles $pic_object" 1407 1.1 lukem prev= 1408 1.1 lukem fi 1409 1.1 lukem 1410 1.1 lukem # A PIC object. 1411 1.1 lukem libobjs="$libobjs $pic_object" 1412 1.1 lukem arg="$pic_object" 1413 1.1 lukem fi 1414 1.1 lukem 1415 1.1 lukem # Non-PIC object. 1416 1.1 lukem if test "$non_pic_object" != none; then 1417 1.1 lukem # Prepend the subdirectory the object is found in. 1418 1.1 lukem non_pic_object="$xdir$non_pic_object" 1419 1.1 lukem 1420 1.1 lukem # A standard non-PIC object 1421 1.1 lukem non_pic_objects="$non_pic_objects $non_pic_object" 1422 1.1 lukem if test -z "$pic_object" || test "$pic_object" = none ; then 1423 1.1 lukem arg="$non_pic_object" 1424 1.1 lukem fi 1425 1.1 lukem else 1426 1.1 lukem # If the PIC object exists, use it instead. 1427 1.1 lukem # $xdir was prepended to $pic_object above. 1428 1.1 lukem non_pic_object="$pic_object" 1429 1.1 lukem non_pic_objects="$non_pic_objects $non_pic_object" 1430 1.1 lukem fi 1431 1.1 lukem else 1432 1.1 lukem # Only an error if not doing a dry-run. 1433 1.1 lukem if test -z "$run"; then 1434 1.2 agc $ECHO "$modename: \`$arg' is not a valid libtool object" 1>&2 1435 1.1 lukem exit $EXIT_FAILURE 1436 1.1 lukem else 1437 1.1 lukem # Dry-run case. 1438 1.1 lukem 1439 1.1 lukem # Extract subdirectory from the argument. 1440 1.2 agc xdir=`$ECHO "X$arg" | $Xsed -e 's%/[^/]*$%%'` 1441 1.1 lukem if test "X$xdir" = "X$arg"; then 1442 1.1 lukem xdir= 1443 1.1 lukem else 1444 1.1 lukem xdir="$xdir/" 1445 1.1 lukem fi 1446 1.1 lukem 1447 1.2 agc pic_object=`$ECHO "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` 1448 1.2 agc non_pic_object=`$ECHO "X${xdir}${arg}" | $Xsed -e "$lo2o"` 1449 1.1 lukem libobjs="$libobjs $pic_object" 1450 1.1 lukem non_pic_objects="$non_pic_objects $non_pic_object" 1451 1.1 lukem fi 1452 1.1 lukem fi 1453 1.1 lukem done 1454 1.1 lukem else 1455 1.2 agc $ECHO "$modename: link input file \`$save_arg' does not exist" 1456 1.1 lukem exit $EXIT_FAILURE 1457 1.1 lukem fi 1458 1.1 lukem arg=$save_arg 1459 1.1 lukem prev= 1460 1.1 lukem continue 1461 1.1 lukem ;; 1462 1.1 lukem rpath | xrpath) 1463 1.1 lukem # We need an absolute path. 1464 1.1 lukem case $arg in 1465 1.1 lukem [\\/]* | [A-Za-z]:[\\/]*) ;; 1466 1.1 lukem *) 1467 1.2 agc $ECHO "$modename: only absolute run-paths are allowed" 1>&2 1468 1.1 lukem exit $EXIT_FAILURE 1469 1.1 lukem ;; 1470 1.1 lukem esac 1471 1.1 lukem # Canonicalise the pathname 1472 1.1 lukem tmp="" 1473 1.1 lukem while test "$arg" != "$tmp" 1474 1.1 lukem do 1475 1.1 lukem tmp=$arg 1476 1.2 agc arg=`$ECHO "X$arg" | $Xsed -e 's%[^/.][^/.]*/\.\.%%g' -e 's%/\./%/%g' -e 's%//*%/%g' -e 's%/$%%g'` 1477 1.1 lukem done 1478 1.1 lukem if test "$prev" = rpath; then 1479 1.1 lukem case "$rpath " in 1480 1.1 lukem *" $arg "*) ;; 1481 1.1 lukem *) rpath="$rpath $arg" ;; 1482 1.1 lukem esac 1483 1.1 lukem else 1484 1.1 lukem case "$xrpath " in 1485 1.1 lukem *" $arg "*) ;; 1486 1.1 lukem *) xrpath="$xrpath $arg" ;; 1487 1.1 lukem esac 1488 1.1 lukem fi 1489 1.1 lukem prev= 1490 1.1 lukem continue 1491 1.1 lukem ;; 1492 1.1 lukem xcompiler) 1493 1.1 lukem compiler_flags="$compiler_flags $qarg" 1494 1.1 lukem prev= 1495 1.1 lukem compile_command="$compile_command $qarg" 1496 1.1 lukem finalize_command="$finalize_command $qarg" 1497 1.1 lukem continue 1498 1.1 lukem ;; 1499 1.1 lukem xlinker) 1500 1.1 lukem linker_flags="$linker_flags $qarg" 1501 1.1 lukem compiler_flags="$compiler_flags $wl$qarg" 1502 1.1 lukem prev= 1503 1.1 lukem compile_command="$compile_command $wl$qarg" 1504 1.1 lukem finalize_command="$finalize_command $wl$qarg" 1505 1.1 lukem continue 1506 1.1 lukem ;; 1507 1.1 lukem xcclinker) 1508 1.1 lukem linker_flags="$linker_flags $qarg" 1509 1.1 lukem compiler_flags="$compiler_flags $qarg" 1510 1.1 lukem prev= 1511 1.1 lukem compile_command="$compile_command $qarg" 1512 1.1 lukem finalize_command="$finalize_command $qarg" 1513 1.1 lukem continue 1514 1.1 lukem ;; 1515 1.1 lukem shrext) 1516 1.1 lukem shrext_cmds="$arg" 1517 1.1 lukem prev= 1518 1.1 lukem continue 1519 1.1 lukem ;; 1520 1.1 lukem darwin_framework|darwin_framework_skip) 1521 1.1 lukem test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" 1522 1.1 lukem compile_command="$compile_command $arg" 1523 1.1 lukem finalize_command="$finalize_command $arg" 1524 1.1 lukem prev= 1525 1.1 lukem continue 1526 1.1 lukem ;; 1527 1.1 lukem *) 1528 1.1 lukem eval "$prev=\"\$arg\"" 1529 1.1 lukem prev= 1530 1.1 lukem continue 1531 1.1 lukem ;; 1532 1.1 lukem esac 1533 1.1 lukem fi # test -n "$prev" 1534 1.1 lukem 1535 1.1 lukem prevarg="$arg" 1536 1.1 lukem 1537 1.1 lukem case $arg in 1538 1.1 lukem -all-static) 1539 1.1 lukem if test -n "$link_static_flag"; then 1540 1.1 lukem compile_command="$compile_command $link_static_flag" 1541 1.1 lukem finalize_command="$finalize_command $link_static_flag" 1542 1.1 lukem fi 1543 1.1 lukem continue 1544 1.1 lukem ;; 1545 1.1 lukem 1546 1.1 lukem -allow-undefined) 1547 1.1 lukem # FIXME: remove this flag sometime in the future. 1548 1.2 agc $ECHO "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 1549 1.1 lukem continue 1550 1.1 lukem ;; 1551 1.1 lukem 1552 1.1 lukem -avoid-version) 1553 1.1 lukem avoid_version=yes 1554 1.1 lukem continue 1555 1.1 lukem ;; 1556 1.1 lukem 1557 1.1 lukem -dlopen) 1558 1.1 lukem prev=dlfiles 1559 1.1 lukem continue 1560 1.1 lukem ;; 1561 1.1 lukem 1562 1.1 lukem -dlpreopen) 1563 1.1 lukem prev=dlprefiles 1564 1.1 lukem continue 1565 1.1 lukem ;; 1566 1.1 lukem 1567 1.1 lukem -export-dynamic) 1568 1.1 lukem export_dynamic=yes 1569 1.1 lukem continue 1570 1.1 lukem ;; 1571 1.1 lukem 1572 1.1 lukem -export-symbols | -export-symbols-regex) 1573 1.1 lukem if test -n "$export_symbols" || test -n "$export_symbols_regex"; then 1574 1.2 agc $ECHO "$modename: more than one -exported-symbols argument is not allowed" 1575 1.1 lukem exit $EXIT_FAILURE 1576 1.1 lukem fi 1577 1.1 lukem if test "X$arg" = "X-export-symbols"; then 1578 1.1 lukem prev=expsyms 1579 1.1 lukem else 1580 1.1 lukem prev=expsyms_regex 1581 1.1 lukem fi 1582 1.1 lukem continue 1583 1.1 lukem ;; 1584 1.1 lukem 1585 1.1 lukem -framework|-arch|-isysroot) 1586 1.1 lukem case " $CC " in 1587 1.1 lukem *" ${arg} ${1} "* | *" ${arg} ${1} "*) 1588 1.1 lukem prev=darwin_framework_skip ;; 1589 1.1 lukem *) compiler_flags="$compiler_flags $arg" 1590 1.1 lukem prev=darwin_framework ;; 1591 1.1 lukem esac 1592 1.1 lukem compile_command="$compile_command $arg" 1593 1.1 lukem finalize_command="$finalize_command $arg" 1594 1.1 lukem continue 1595 1.1 lukem ;; 1596 1.1 lukem 1597 1.1 lukem -inst-prefix-dir) 1598 1.1 lukem prev=inst_prefix 1599 1.1 lukem continue 1600 1.1 lukem ;; 1601 1.1 lukem 1602 1.1 lukem # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* 1603 1.1 lukem # so, if we see these flags be careful not to treat them like -L 1604 1.1 lukem -L[A-Z][A-Z]*:*) 1605 1.1 lukem case $with_gcc/$host in 1606 1.1 lukem no/*-*-irix* | /*-*-irix*) 1607 1.1 lukem compile_command="$compile_command $arg" 1608 1.1 lukem finalize_command="$finalize_command $arg" 1609 1.1 lukem ;; 1610 1.1 lukem esac 1611 1.1 lukem continue 1612 1.1 lukem ;; 1613 1.1 lukem 1614 1.1 lukem -L*) 1615 1.2 agc dir=`$ECHO "X$arg" | $Xsed -e 's/^-L//'` 1616 1.1 lukem # We need an absolute path. 1617 1.1 lukem case $dir in 1618 1.1 lukem [\\/]* | [A-Za-z]:[\\/]*) ;; 1619 1.1 lukem *) 1620 1.1 lukem absdir=`cd "$dir" && pwd` 1621 1.1 lukem if test -z "$absdir"; then 1622 1.2 agc $ECHO "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 1623 1.1 lukem absdir="$dir" 1624 1.1 lukem notinst_path="$notinst_path $dir" 1625 1.1 lukem fi 1626 1.1 lukem dir="$absdir" 1627 1.1 lukem ;; 1628 1.1 lukem esac 1629 1.1 lukem case "$deplibs " in 1630 1.1 lukem *" -L$dir "*) ;; 1631 1.1 lukem *) 1632 1.1 lukem deplibs="$deplibs -L$dir" 1633 1.1 lukem lib_search_path="$lib_search_path $dir" 1634 1.1 lukem ;; 1635 1.1 lukem esac 1636 1.1 lukem case $host in 1637 1.1 lukem *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) 1638 1.2 agc testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'` 1639 1.1 lukem case :$dllsearchpath: in 1640 1.1 lukem *":$dir:"*) ;; 1641 1.1 lukem *) dllsearchpath="$dllsearchpath:$dir";; 1642 1.1 lukem esac 1643 1.1 lukem case :$dllsearchpath: in 1644 1.1 lukem *":$testbindir:"*) ;; 1645 1.1 lukem *) dllsearchpath="$dllsearchpath:$testbindir";; 1646 1.1 lukem esac 1647 1.1 lukem ;; 1648 1.1 lukem esac 1649 1.1 lukem continue 1650 1.1 lukem ;; 1651 1.1 lukem 1652 1.1 lukem -l*) 1653 1.1 lukem if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then 1654 1.1 lukem case $host in 1655 1.1 lukem *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) 1656 1.1 lukem # These systems don't actually have a C or math library (as such) 1657 1.1 lukem continue 1658 1.1 lukem ;; 1659 1.1 lukem *-*-os2*) 1660 1.1 lukem # These systems don't actually have a C library (as such) 1661 1.1 lukem test "X$arg" = "X-lc" && continue 1662 1.1 lukem ;; 1663 1.1 lukem *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) 1664 1.1 lukem # Do not include libc due to us having libc/libc_r. 1665 1.1 lukem test "X$arg" = "X-lc" && continue 1666 1.1 lukem ;; 1667 1.1 lukem *-*-rhapsody* | *-*-darwin1.[012]) 1668 1.1 lukem # Rhapsody C and math libraries are in the System framework 1669 1.1 lukem deplibs="$deplibs -framework System" 1670 1.1 lukem continue 1671 1.1 lukem ;; 1672 1.1 lukem *-*-sco3.2v5* | *-*-sco5v6*) 1673 1.1 lukem # Causes problems with __ctype 1674 1.1 lukem test "X$arg" = "X-lc" && continue 1675 1.1 lukem ;; 1676 1.1 lukem *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) 1677 1.1 lukem # Compiler inserts libc in the correct place for threads to work 1678 1.1 lukem test "X$arg" = "X-lc" && continue 1679 1.1 lukem ;; 1680 1.1 lukem esac 1681 1.1 lukem elif test "X$arg" = "X-lc_r"; then 1682 1.1 lukem case $host in 1683 1.1 lukem *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) 1684 1.1 lukem # Do not include libc_r directly, use -pthread flag. 1685 1.1 lukem continue 1686 1.1 lukem ;; 1687 1.1 lukem esac 1688 1.1 lukem fi 1689 1.1 lukem deplibs="$deplibs $arg" 1690 1.1 lukem continue 1691 1.1 lukem ;; 1692 1.1 lukem 1693 1.1 lukem # Tru64 UNIX uses -model [arg] to determine the layout of C++ 1694 1.1 lukem # classes, name mangling, and exception handling. 1695 1.1 lukem -model) 1696 1.1 lukem compile_command="$compile_command $arg" 1697 1.1 lukem compiler_flags="$compiler_flags $arg" 1698 1.1 lukem finalize_command="$finalize_command $arg" 1699 1.1 lukem prev=xcompiler 1700 1.1 lukem continue 1701 1.1 lukem ;; 1702 1.1 lukem 1703 1.1 lukem -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) 1704 1.1 lukem compiler_flags="$compiler_flags $arg" 1705 1.1 lukem compile_command="$compile_command $arg" 1706 1.1 lukem finalize_command="$finalize_command $arg" 1707 1.1 lukem case $host:$arg in 1708 1.1 lukem *-*-dragonfly*:-pthread) 1709 1.1 lukem # pkgsrc hack to use -pthread in .la file for final linking 1710 1.1 lukem deplibs="$deplibs $arg" 1711 1.1 lukem ;; 1712 1.1 lukem esac 1713 1.1 lukem continue 1714 1.1 lukem ;; 1715 1.1 lukem 1716 1.1 lukem -multi_module) 1717 1.1 lukem single_module="${wl}-multi_module" 1718 1.1 lukem continue 1719 1.1 lukem ;; 1720 1.1 lukem 1721 1.1 lukem -module) 1722 1.1 lukem module=yes 1723 1.1 lukem continue 1724 1.1 lukem ;; 1725 1.1 lukem 1726 1.1 lukem # -64, -mips[0-9] enable 64-bit mode on the SGI compiler 1727 1.1 lukem # -r[0-9][0-9]* specifies the processor on the SGI compiler 1728 1.1 lukem # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler 1729 1.1 lukem # +DA*, +DD* enable 64-bit mode on the HP compiler 1730 1.1 lukem # -q* pass through compiler args for the IBM compiler 1731 1.1 lukem # -m* pass through architecture-specific compiler args for GCC 1732 1.1 lukem # -m*, -t[45]*, -txscale* pass through architecture-specific 1733 1.1 lukem # compiler args for GCC 1734 1.1 lukem # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC 1735 1.1 lukem # -F/path gives path to uninstalled frameworks, gcc on darwin 1736 1.1 lukem # @file GCC response files 1737 1.1 lukem -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ 1738 1.1 lukem -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) 1739 1.1 lukem 1740 1.1 lukem # Unknown arguments in both finalize_command and compile_command need 1741 1.1 lukem # to be aesthetically quoted because they are evaled later. 1742 1.2 agc arg=`$ECHO "X$arg" | $Xsed -e "$sed_quote_subst"` 1743 1.1 lukem case $arg in 1744 1.1 lukem *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 1745 1.1 lukem arg="\"$arg\"" 1746 1.1 lukem ;; 1747 1.1 lukem esac 1748 1.1 lukem compile_command="$compile_command $arg" 1749 1.1 lukem finalize_command="$finalize_command $arg" 1750 1.1 lukem compiler_flags="$compiler_flags $arg" 1751 1.1 lukem continue 1752 1.1 lukem ;; 1753 1.1 lukem 1754 1.1 lukem -shrext) 1755 1.1 lukem prev=shrext 1756 1.1 lukem continue 1757 1.1 lukem ;; 1758 1.1 lukem 1759 1.1 lukem -no-fast-install) 1760 1.1 lukem fast_install=no 1761 1.1 lukem continue 1762 1.1 lukem ;; 1763 1.1 lukem 1764 1.1 lukem -no-install) 1765 1.1 lukem case $host in 1766 1.1 lukem *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*) 1767 1.1 lukem # The PATH hackery in wrapper scripts is required on Windows 1768 1.1 lukem # and Darwin in order for the loader to find any dlls it needs. 1769 1.2 agc $ECHO "$modename: warning: \`-no-install' is ignored for $host" 1>&2 1770 1.2 agc $ECHO "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 1771 1.1 lukem fast_install=no 1772 1.1 lukem ;; 1773 1.1 lukem *) no_install=yes ;; 1774 1.1 lukem esac 1775 1.1 lukem continue 1776 1.1 lukem ;; 1777 1.1 lukem 1778 1.1 lukem -no-undefined) 1779 1.1 lukem allow_undefined=no 1780 1.1 lukem continue 1781 1.1 lukem ;; 1782 1.1 lukem 1783 1.1 lukem -objectlist) 1784 1.1 lukem prev=objectlist 1785 1.1 lukem continue 1786 1.1 lukem ;; 1787 1.1 lukem 1788 1.1 lukem -o) prev=output ;; 1789 1.1 lukem 1790 1.1 lukem -precious-files-regex) 1791 1.1 lukem prev=precious_regex 1792 1.1 lukem continue 1793 1.1 lukem ;; 1794 1.1 lukem 1795 1.1 lukem -release) 1796 1.1 lukem prev=release 1797 1.1 lukem continue 1798 1.1 lukem ;; 1799 1.1 lukem 1800 1.1 lukem -rpath) 1801 1.1 lukem prev=rpath 1802 1.1 lukem continue 1803 1.1 lukem ;; 1804 1.1 lukem 1805 1.1 lukem -R) 1806 1.1 lukem prev=xrpath 1807 1.1 lukem continue 1808 1.1 lukem ;; 1809 1.1 lukem 1810 1.1 lukem -R*) 1811 1.2 agc dir=`$ECHO "X$arg" | $Xsed -e 's/^-R//'` 1812 1.1 lukem # We need an absolute path. 1813 1.1 lukem case $dir in 1814 1.1 lukem [\\/]* | [A-Za-z]:[\\/]*) ;; 1815 1.1 lukem *) 1816 1.2 agc $ECHO "$modename: only absolute run-paths are allowed" 1>&2 1817 1.1 lukem exit $EXIT_FAILURE 1818 1.1 lukem ;; 1819 1.1 lukem esac 1820 1.1 lukem case "$xrpath " in 1821 1.1 lukem *" $dir "*) ;; 1822 1.1 lukem *) xrpath="$xrpath $dir" ;; 1823 1.1 lukem esac 1824 1.1 lukem continue 1825 1.1 lukem ;; 1826 1.1 lukem 1827 1.1 lukem -static | -static-libtool-libs) 1828 1.1 lukem # The effects of -static are defined in a previous loop. 1829 1.1 lukem # We used to do the same as -all-static on platforms that 1830 1.1 lukem # didn't have a PIC flag, but the assumption that the effects 1831 1.1 lukem # would be equivalent was wrong. It would break on at least 1832 1.1 lukem # Digital Unix and AIX. 1833 1.1 lukem continue 1834 1.1 lukem ;; 1835 1.1 lukem 1836 1.1 lukem -thread-safe) 1837 1.1 lukem thread_safe=yes 1838 1.1 lukem continue 1839 1.1 lukem ;; 1840 1.1 lukem 1841 1.1 lukem -version-info) 1842 1.1 lukem prev=vinfo 1843 1.1 lukem continue 1844 1.1 lukem ;; 1845 1.1 lukem -version-number) 1846 1.1 lukem prev=vinfo 1847 1.1 lukem vinfo_number=yes 1848 1.1 lukem continue 1849 1.1 lukem ;; 1850 1.1 lukem 1851 1.1 lukem -Wc,*) 1852 1.2 agc args=`$ECHO "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` 1853 1.1 lukem arg= 1854 1.1 lukem save_ifs="$IFS"; IFS=',' 1855 1.1 lukem for flag in $args; do 1856 1.1 lukem IFS="$save_ifs" 1857 1.1 lukem case $flag in 1858 1.1 lukem *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 1859 1.1 lukem flag="\"$flag\"" 1860 1.1 lukem ;; 1861 1.1 lukem esac 1862 1.1 lukem arg="$arg $wl$flag" 1863 1.1 lukem compiler_flags="$compiler_flags $flag" 1864 1.1 lukem done 1865 1.1 lukem IFS="$save_ifs" 1866 1.2 agc arg=`$ECHO "X$arg" | $Xsed -e "s/^ //"` 1867 1.1 lukem ;; 1868 1.1 lukem 1869 1.1 lukem -Wl,*) 1870 1.2 agc args=`$ECHO "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` 1871 1.1 lukem arg= 1872 1.1 lukem save_ifs="$IFS"; IFS=',' 1873 1.1 lukem for flag in $args; do 1874 1.1 lukem IFS="$save_ifs" 1875 1.1 lukem case $flag in 1876 1.1 lukem *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 1877 1.1 lukem flag="\"$flag\"" 1878 1.1 lukem ;; 1879 1.1 lukem esac 1880 1.1 lukem arg="$arg $wl$flag" 1881 1.1 lukem compiler_flags="$compiler_flags $wl$flag" 1882 1.1 lukem linker_flags="$linker_flags $flag" 1883 1.1 lukem done 1884 1.1 lukem IFS="$save_ifs" 1885 1.2 agc arg=`$ECHO "X$arg" | $Xsed -e "s/^ //"` 1886 1.1 lukem ;; 1887 1.1 lukem 1888 1.1 lukem -Xcompiler) 1889 1.1 lukem prev=xcompiler 1890 1.1 lukem continue 1891 1.1 lukem ;; 1892 1.1 lukem 1893 1.1 lukem -Xlinker) 1894 1.1 lukem prev=xlinker 1895 1.1 lukem continue 1896 1.1 lukem ;; 1897 1.1 lukem 1898 1.1 lukem -XCClinker) 1899 1.1 lukem prev=xcclinker 1900 1.1 lukem continue 1901 1.1 lukem ;; 1902 1.1 lukem 1903 1.1 lukem # Some other compiler flag. 1904 1.1 lukem -* | +*) 1905 1.1 lukem # Unknown arguments in both finalize_command and compile_command need 1906 1.1 lukem # to be aesthetically quoted because they are evaled later. 1907 1.2 agc arg=`$ECHO "X$arg" | $Xsed -e "$sed_quote_subst"` 1908 1.1 lukem case $arg in 1909 1.1 lukem *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 1910 1.1 lukem arg="\"$arg\"" 1911 1.1 lukem ;; 1912 1.1 lukem esac 1913 1.1 lukem ;; 1914 1.1 lukem 1915 1.1 lukem *.$objext) 1916 1.1 lukem # A standard object. 1917 1.1 lukem objs="$objs $arg" 1918 1.1 lukem ;; 1919 1.1 lukem 1920 1.1 lukem *.lo) 1921 1.1 lukem # A libtool-controlled object. 1922 1.1 lukem 1923 1.1 lukem # Check to see that this really is a libtool object. 1924 1.1 lukem if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 1925 1.1 lukem pic_object= 1926 1.1 lukem non_pic_object= 1927 1.1 lukem 1928 1.1 lukem # Read the .lo file 1929 1.1 lukem # If there is no directory component, then add one. 1930 1.1 lukem case $arg in 1931 1.1 lukem */* | *\\*) . $arg ;; 1932 1.1 lukem *) . ./$arg ;; 1933 1.1 lukem esac 1934 1.1 lukem 1935 1.1 lukem if test -z "$pic_object" || \ 1936 1.1 lukem test -z "$non_pic_object" || 1937 1.1 lukem test "$pic_object" = none && \ 1938 1.1 lukem test "$non_pic_object" = none; then 1939 1.2 agc $ECHO "$modename: cannot find name of object for \`$arg'" 1>&2 1940 1.1 lukem exit $EXIT_FAILURE 1941 1.1 lukem fi 1942 1.1 lukem 1943 1.1 lukem # Extract subdirectory from the argument. 1944 1.2 agc xdir=`$ECHO "X$arg" | $Xsed -e 's%/[^/]*$%%'` 1945 1.1 lukem if test "X$xdir" = "X$arg"; then 1946 1.1 lukem xdir= 1947 1.1 lukem else 1948 1.1 lukem xdir="$xdir/" 1949 1.1 lukem fi 1950 1.1 lukem 1951 1.1 lukem if test "$pic_object" != none; then 1952 1.1 lukem # Prepend the subdirectory the object is found in. 1953 1.1 lukem pic_object="$xdir$pic_object" 1954 1.1 lukem 1955 1.1 lukem if test "$prev" = dlfiles; then 1956 1.1 lukem if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then 1957 1.1 lukem dlfiles="$dlfiles $pic_object" 1958 1.1 lukem prev= 1959 1.1 lukem continue 1960 1.1 lukem else 1961 1.1 lukem # If libtool objects are unsupported, then we need to preload. 1962 1.1 lukem prev=dlprefiles 1963 1.1 lukem fi 1964 1.1 lukem fi 1965 1.1 lukem 1966 1.1 lukem # CHECK ME: I think I busted this. -Ossama 1967 1.1 lukem if test "$prev" = dlprefiles; then 1968 1.1 lukem # Preload the old-style object. 1969 1.1 lukem dlprefiles="$dlprefiles $pic_object" 1970 1.1 lukem prev= 1971 1.1 lukem fi 1972 1.1 lukem 1973 1.1 lukem # A PIC object. 1974 1.1 lukem libobjs="$libobjs $pic_object" 1975 1.1 lukem arg="$pic_object" 1976 1.1 lukem fi 1977 1.1 lukem 1978 1.1 lukem # Non-PIC object. 1979 1.1 lukem if test "$non_pic_object" != none; then 1980 1.1 lukem # Prepend the subdirectory the object is found in. 1981 1.1 lukem non_pic_object="$xdir$non_pic_object" 1982 1.1 lukem 1983 1.1 lukem # A standard non-PIC object 1984 1.1 lukem non_pic_objects="$non_pic_objects $non_pic_object" 1985 1.1 lukem if test -z "$pic_object" || test "$pic_object" = none ; then 1986 1.1 lukem arg="$non_pic_object" 1987 1.1 lukem fi 1988 1.1 lukem else 1989 1.1 lukem # If the PIC object exists, use it instead. 1990 1.1 lukem # $xdir was prepended to $pic_object above. 1991 1.1 lukem non_pic_object="$pic_object" 1992 1.1 lukem non_pic_objects="$non_pic_objects $non_pic_object" 1993 1.1 lukem fi 1994 1.1 lukem else 1995 1.1 lukem # Only an error if not doing a dry-run. 1996 1.1 lukem if test -z "$run"; then 1997 1.2 agc $ECHO "$modename: \`$arg' is not a valid libtool object" 1>&2 1998 1.1 lukem exit $EXIT_FAILURE 1999 1.1 lukem else 2000 1.1 lukem # Dry-run case. 2001 1.1 lukem 2002 1.1 lukem # Extract subdirectory from the argument. 2003 1.2 agc xdir=`$ECHO "X$arg" | $Xsed -e 's%/[^/]*$%%'` 2004 1.1 lukem if test "X$xdir" = "X$arg"; then 2005 1.1 lukem xdir= 2006 1.1 lukem else 2007 1.1 lukem xdir="$xdir/" 2008 1.1 lukem fi 2009 1.1 lukem 2010 1.2 agc pic_object=`$ECHO "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` 2011 1.2 agc non_pic_object=`$ECHO "X${xdir}${arg}" | $Xsed -e "$lo2o"` 2012 1.1 lukem libobjs="$libobjs $pic_object" 2013 1.1 lukem non_pic_objects="$non_pic_objects $non_pic_object" 2014 1.1 lukem fi 2015 1.1 lukem fi 2016 1.1 lukem ;; 2017 1.1 lukem 2018 1.1 lukem *.$libext) 2019 1.1 lukem # An archive. 2020 1.1 lukem deplibs="$deplibs $arg" 2021 1.1 lukem old_deplibs="$old_deplibs $arg" 2022 1.1 lukem continue 2023 1.1 lukem ;; 2024 1.1 lukem 2025 1.1 lukem *.la) 2026 1.1 lukem # A libtool-controlled library. 2027 1.1 lukem 2028 1.1 lukem if test "$prev" = dlfiles; then 2029 1.1 lukem # This library was specified with -dlopen. 2030 1.1 lukem dlfiles="$dlfiles $arg" 2031 1.1 lukem prev= 2032 1.1 lukem elif test "$prev" = dlprefiles; then 2033 1.1 lukem # The library was specified with -dlpreopen. 2034 1.1 lukem dlprefiles="$dlprefiles $arg" 2035 1.1 lukem prev= 2036 1.1 lukem else 2037 1.1 lukem deplibs="$deplibs $arg" 2038 1.1 lukem fi 2039 1.1 lukem continue 2040 1.1 lukem ;; 2041 1.1 lukem 2042 1.1 lukem # Some other compiler argument. 2043 1.1 lukem *) 2044 1.1 lukem # Unknown arguments in both finalize_command and compile_command need 2045 1.1 lukem # to be aesthetically quoted because they are evaled later. 2046 1.2 agc arg=`$ECHO "X$arg" | $Xsed -e "$sed_quote_subst"` 2047 1.1 lukem case $arg in 2048 1.1 lukem *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 2049 1.1 lukem arg="\"$arg\"" 2050 1.1 lukem ;; 2051 1.1 lukem esac 2052 1.1 lukem ;; 2053 1.1 lukem esac # arg 2054 1.1 lukem 2055 1.1 lukem # Now actually substitute the argument into the commands. 2056 1.1 lukem if test -n "$arg"; then 2057 1.1 lukem compile_command="$compile_command $arg" 2058 1.1 lukem finalize_command="$finalize_command $arg" 2059 1.1 lukem fi 2060 1.1 lukem done # argument parsing loop 2061 1.1 lukem 2062 1.1 lukem if test -n "$prev"; then 2063 1.2 agc $ECHO "$modename: the \`$prevarg' option requires an argument" 1>&2 2064 1.2 agc $ECHO "$help" 1>&2 2065 1.1 lukem exit $EXIT_FAILURE 2066 1.1 lukem fi 2067 1.1 lukem 2068 1.1 lukem if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then 2069 1.1 lukem eval arg=\"$export_dynamic_flag_spec\" 2070 1.1 lukem compile_command="$compile_command $arg" 2071 1.1 lukem finalize_command="$finalize_command $arg" 2072 1.1 lukem fi 2073 1.1 lukem 2074 1.1 lukem oldlibs= 2075 1.1 lukem # calculate the name of the file, without its directory 2076 1.2 agc outputname=`$ECHO "X$output" | $Xsed -e 's%^.*/%%'` 2077 1.1 lukem libobjs_save="$libobjs" 2078 1.1 lukem 2079 1.1 lukem if test -n "$shlibpath_var"; then 2080 1.1 lukem # get the directories listed in $shlibpath_var 2081 1.2 agc eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` 2082 1.1 lukem else 2083 1.1 lukem shlib_search_path= 2084 1.1 lukem fi 2085 1.1 lukem eval sys_lib_search_path=\"$sys_lib_search_path_spec\" 2086 1.1 lukem eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" 2087 1.1 lukem 2088 1.2 agc output_objdir=`$ECHO "X$output" | $Xsed -e 's%/[^/]*$%%'` 2089 1.1 lukem if test "X$output_objdir" = "X$output"; then 2090 1.1 lukem output_objdir="$objdir" 2091 1.1 lukem else 2092 1.1 lukem output_objdir="$output_objdir/$objdir" 2093 1.1 lukem fi 2094 1.1 lukem # Create the object directory. 2095 1.1 lukem if test ! -d "$output_objdir"; then 2096 1.1 lukem $show "$mkdir $output_objdir" 2097 1.1 lukem $run $mkdir $output_objdir 2098 1.1 lukem exit_status=$? 2099 1.1 lukem if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then 2100 1.1 lukem exit $exit_status 2101 1.1 lukem fi 2102 1.1 lukem fi 2103 1.1 lukem 2104 1.1 lukem # Determine the type of output 2105 1.1 lukem case $output in 2106 1.1 lukem "") 2107 1.2 agc $ECHO "$modename: you must specify an output file" 1>&2 2108 1.2 agc $ECHO "$help" 1>&2 2109 1.1 lukem exit $EXIT_FAILURE 2110 1.1 lukem ;; 2111 1.1 lukem *.$libext) linkmode=oldlib ;; 2112 1.1 lukem *.lo | *.$objext) linkmode=obj ;; 2113 1.1 lukem *.la) linkmode=lib ;; 2114 1.1 lukem *) linkmode=prog ;; # Anything else should be a program. 2115 1.1 lukem esac 2116 1.1 lukem 2117 1.1 lukem case $host in 2118 1.1 lukem *cygwin* | *mingw* | *pw32*) 2119 1.1 lukem # don't eliminate duplications in $postdeps and $predeps 2120 1.1 lukem duplicate_compiler_generated_deps=yes 2121 1.1 lukem ;; 2122 1.1 lukem *) 2123 1.1 lukem duplicate_compiler_generated_deps=$duplicate_deps 2124 1.1 lukem ;; 2125 1.1 lukem esac 2126 1.1 lukem specialdeplibs= 2127 1.1 lukem 2128 1.1 lukem libs= 2129 1.1 lukem # Find all interdependent deplibs by searching for libraries 2130 1.1 lukem # that are linked more than once (e.g. -la -lb -la) 2131 1.1 lukem for deplib in $deplibs; do 2132 1.1 lukem if test "X$duplicate_deps" = "Xyes" ; then 2133 1.1 lukem case "$libs " in 2134 1.1 lukem *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; 2135 1.1 lukem esac 2136 1.1 lukem fi 2137 1.1 lukem libs="$libs $deplib" 2138 1.1 lukem done 2139 1.1 lukem 2140 1.1 lukem if test "$linkmode" = lib; then 2141 1.1 lukem libs="$predeps $libs $compiler_lib_search_path $postdeps" 2142 1.1 lukem 2143 1.1 lukem # Compute libraries that are listed more than once in $predeps 2144 1.1 lukem # $postdeps and mark them as special (i.e., whose duplicates are 2145 1.1 lukem # not to be eliminated). 2146 1.1 lukem pre_post_deps= 2147 1.1 lukem if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then 2148 1.1 lukem for pre_post_dep in $predeps $postdeps; do 2149 1.1 lukem case "$pre_post_deps " in 2150 1.1 lukem *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; 2151 1.1 lukem esac 2152 1.1 lukem pre_post_deps="$pre_post_deps $pre_post_dep" 2153 1.1 lukem done 2154 1.1 lukem fi 2155 1.1 lukem pre_post_deps= 2156 1.1 lukem fi 2157 1.1 lukem 2158 1.1 lukem deplibs= 2159 1.1 lukem newdependency_libs= 2160 1.1 lukem newlib_search_path= 2161 1.1 lukem need_relink=no # whether we're linking any uninstalled libtool libraries 2162 1.1 lukem notinst_deplibs= # not-installed libtool libraries 2163 1.1 lukem case $linkmode in 2164 1.1 lukem lib) 2165 1.1 lukem passes="conv link" 2166 1.1 lukem for file in $dlfiles $dlprefiles; do 2167 1.1 lukem case $file in 2168 1.1 lukem *.la) ;; 2169 1.1 lukem *) 2170 1.2 agc $ECHO "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 2171 1.1 lukem exit $EXIT_FAILURE 2172 1.1 lukem ;; 2173 1.1 lukem esac 2174 1.1 lukem done 2175 1.1 lukem ;; 2176 1.1 lukem prog) 2177 1.1 lukem compile_deplibs= 2178 1.1 lukem finalize_deplibs= 2179 1.1 lukem alldeplibs=no 2180 1.1 lukem newdlfiles= 2181 1.1 lukem newdlprefiles= 2182 1.1 lukem passes="conv scan dlopen dlpreopen link" 2183 1.1 lukem ;; 2184 1.1 lukem *) passes="conv" 2185 1.1 lukem ;; 2186 1.1 lukem esac 2187 1.1 lukem for pass in $passes; do 2188 1.1 lukem if test "$linkmode,$pass" = "lib,link" || 2189 1.1 lukem test "$linkmode,$pass" = "prog,scan"; then 2190 1.1 lukem libs="$deplibs" 2191 1.1 lukem deplibs= 2192 1.1 lukem fi 2193 1.1 lukem if test "$linkmode" = prog; then 2194 1.1 lukem case $pass in 2195 1.1 lukem dlopen) libs="$dlfiles" ;; 2196 1.1 lukem dlpreopen) libs="$dlprefiles" ;; 2197 1.1 lukem link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; 2198 1.1 lukem esac 2199 1.1 lukem fi 2200 1.1 lukem if test "$pass" = dlopen; then 2201 1.1 lukem # Collect dlpreopened libraries 2202 1.1 lukem save_deplibs="$deplibs" 2203 1.1 lukem deplibs= 2204 1.1 lukem fi 2205 1.1 lukem for deplib in $libs; do 2206 1.1 lukem lib= 2207 1.1 lukem found=no 2208 1.1 lukem case $deplib in 2209 1.1 lukem -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) 2210 1.1 lukem if test "$linkmode,$pass" = "prog,link"; then 2211 1.1 lukem compile_deplibs="$deplib $compile_deplibs" 2212 1.1 lukem finalize_deplibs="$deplib $finalize_deplibs" 2213 1.1 lukem else 2214 1.1 lukem compiler_flags="$compiler_flags $deplib" 2215 1.1 lukem fi 2216 1.1 lukem case $host:$deplib in 2217 1.1 lukem *-*-dragonfly*:-pthread) 2218 1.1 lukem # pkgsrc hack to use -pthread in .la file for final linking 2219 1.1 lukem case $linkmode in 2220 1.1 lukem lib) 2221 1.1 lukem deplibs="$deplib $deplibs" 2222 1.1 lukem test "$pass" = conv && continue 2223 1.1 lukem newdependency_libs="$deplib $newdependency_libs" 2224 1.1 lukem ;; 2225 1.1 lukem prog) 2226 1.1 lukem if test "$pass" = conv; then 2227 1.1 lukem deplibs="$deplib $deplibs" 2228 1.1 lukem continue 2229 1.1 lukem fi 2230 1.1 lukem if test "$pass" = scan; then 2231 1.1 lukem deplibs="$deplib $deplibs" 2232 1.1 lukem else 2233 1.1 lukem compile_deplibs="$deplib $compile_deplibs" 2234 1.1 lukem finalize_deplibs="$deplib $finalize_deplibs" 2235 1.1 lukem fi 2236 1.1 lukem ;; 2237 1.1 lukem esac 2238 1.1 lukem ;; 2239 1.1 lukem esac 2240 1.1 lukem continue 2241 1.1 lukem ;; 2242 1.1 lukem -l*) 2243 1.1 lukem if test "$linkmode" != lib && test "$linkmode" != prog; then 2244 1.2 agc $ECHO "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 2245 1.1 lukem continue 2246 1.1 lukem fi 2247 1.2 agc name=`$ECHO "X$deplib" | $Xsed -e 's/^-l//'` 2248 1.1 lukem if test "$linkmode" = lib; then 2249 1.1 lukem searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" 2250 1.1 lukem else 2251 1.1 lukem searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" 2252 1.1 lukem fi 2253 1.1 lukem for searchdir in $searchdirs; do 2254 1.1 lukem for search_ext in .la $std_shrext .so .a; do 2255 1.1 lukem # Search the libtool library 2256 1.1 lukem lib="$searchdir/lib${name}${search_ext}" 2257 1.1 lukem if test -f "$lib"; then 2258 1.1 lukem if test "$search_ext" = ".la"; then 2259 1.1 lukem found=yes 2260 1.1 lukem else 2261 1.1 lukem found=no 2262 1.1 lukem fi 2263 1.1 lukem break 2 2264 1.1 lukem fi 2265 1.1 lukem done 2266 1.1 lukem done 2267 1.1 lukem if test "$found" != yes; then 2268 1.1 lukem # deplib doesn't seem to be a libtool library 2269 1.1 lukem if test "$linkmode,$pass" = "prog,link"; then 2270 1.1 lukem compile_deplibs="$deplib $compile_deplibs" 2271 1.1 lukem finalize_deplibs="$deplib $finalize_deplibs" 2272 1.1 lukem else 2273 1.1 lukem deplibs="$deplib $deplibs" 2274 1.1 lukem test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" 2275 1.1 lukem fi 2276 1.1 lukem continue 2277 1.1 lukem else # deplib is a libtool library 2278 1.1 lukem # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, 2279 1.1 lukem # We need to do some special things here, and not later. 2280 1.1 lukem if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 2281 1.1 lukem case " $predeps $postdeps " in 2282 1.1 lukem *" $deplib "*) 2283 1.1 lukem if (${SED} -e '2q' $lib | 2284 1.1 lukem grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 2285 1.1 lukem library_names= 2286 1.1 lukem old_library= 2287 1.1 lukem case $lib in 2288 1.1 lukem */* | *\\*) . $lib ;; 2289 1.1 lukem *) . ./$lib ;; 2290 1.1 lukem esac 2291 1.1 lukem for l in $old_library $library_names; do 2292 1.1 lukem ll="$l" 2293 1.1 lukem done 2294 1.1 lukem if test "X$ll" = "X$old_library" ; then # only static version available 2295 1.1 lukem found=no 2296 1.2 agc ladir=`$ECHO "X$lib" | $Xsed -e 's%/[^/]*$%%'` 2297 1.1 lukem test "X$ladir" = "X$lib" && ladir="." 2298 1.1 lukem lib=$ladir/$old_library 2299 1.1 lukem if test "$linkmode,$pass" = "prog,link"; then 2300 1.1 lukem compile_deplibs="$deplib $compile_deplibs" 2301 1.1 lukem finalize_deplibs="$deplib $finalize_deplibs" 2302 1.1 lukem else 2303 1.1 lukem deplibs="$deplib $deplibs" 2304 1.1 lukem test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" 2305 1.1 lukem fi 2306 1.1 lukem continue 2307 1.1 lukem fi 2308 1.1 lukem fi 2309 1.1 lukem ;; 2310 1.1 lukem *) ;; 2311 1.1 lukem esac 2312 1.1 lukem fi 2313 1.1 lukem fi 2314 1.1 lukem ;; # -l 2315 1.1 lukem -L*) 2316 1.1 lukem case $linkmode in 2317 1.1 lukem lib) 2318 1.1 lukem deplibs="$deplib $deplibs" 2319 1.1 lukem test "$pass" = conv && continue 2320 1.1 lukem newdependency_libs="$deplib $newdependency_libs" 2321 1.2 agc newlib_search_path="$newlib_search_path "`$ECHO "X$deplib" | $Xsed -e 's/^-L//'` 2322 1.1 lukem ;; 2323 1.1 lukem prog) 2324 1.1 lukem if test "$pass" = conv; then 2325 1.1 lukem deplibs="$deplib $deplibs" 2326 1.1 lukem continue 2327 1.1 lukem fi 2328 1.1 lukem if test "$pass" = scan; then 2329 1.1 lukem deplibs="$deplib $deplibs" 2330 1.1 lukem else 2331 1.1 lukem compile_deplibs="$deplib $compile_deplibs" 2332 1.1 lukem finalize_deplibs="$deplib $finalize_deplibs" 2333 1.1 lukem fi 2334 1.2 agc newlib_search_path="$newlib_search_path "`$ECHO "X$deplib" | $Xsed -e 's/^-L//'` 2335 1.1 lukem ;; 2336 1.1 lukem *) 2337 1.2 agc $ECHO "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 2338 1.1 lukem ;; 2339 1.1 lukem esac # linkmode 2340 1.1 lukem continue 2341 1.1 lukem ;; # -L 2342 1.1 lukem -R*) 2343 1.1 lukem if test "$pass" = link; then 2344 1.2 agc dir=`$ECHO "X$deplib" | $Xsed -e 's/^-R//'` 2345 1.1 lukem # Make sure the xrpath contains only unique directories. 2346 1.1 lukem case "$xrpath " in 2347 1.1 lukem *" $dir "*) ;; 2348 1.1 lukem *) xrpath="$xrpath $dir" ;; 2349 1.1 lukem esac 2350 1.1 lukem fi 2351 1.1 lukem deplibs="$deplib $deplibs" 2352 1.1 lukem continue 2353 1.1 lukem ;; 2354 1.1 lukem *.la) lib="$deplib" ;; 2355 1.1 lukem *.$libext) 2356 1.1 lukem if test "$pass" = conv; then 2357 1.1 lukem deplibs="$deplib $deplibs" 2358 1.1 lukem continue 2359 1.1 lukem fi 2360 1.1 lukem case $linkmode in 2361 1.1 lukem lib) 2362 1.1 lukem valid_a_lib=no 2363 1.1 lukem case $deplibs_check_method in 2364 1.1 lukem match_pattern*) 2365 1.1 lukem set dummy $deplibs_check_method 2366 1.1 lukem match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 2367 1.2 agc if eval $ECHO \"$deplib\" 2>/dev/null \ 2368 1.1 lukem | $SED 10q \ 2369 1.1 lukem | $EGREP "$match_pattern_regex" > /dev/null; then 2370 1.1 lukem valid_a_lib=yes 2371 1.1 lukem fi 2372 1.1 lukem ;; 2373 1.1 lukem pass_all) 2374 1.1 lukem valid_a_lib=yes 2375 1.1 lukem ;; 2376 1.1 lukem esac 2377 1.1 lukem if test "$valid_a_lib" != yes; then 2378 1.2 agc $ECHO 2379 1.2 agc $ECHO "*** Warning: Trying to link with static lib archive $deplib." 2380 1.2 agc $ECHO "*** I have the capability to make that library automatically link in when" 2381 1.2 agc $ECHO "*** you link to this library. But I can only do this if you have a" 2382 1.2 agc $ECHO "*** shared version of the library, which you do not appear to have" 2383 1.2 agc $ECHO "*** because the file extensions .$libext of this argument makes me believe" 2384 1.2 agc $ECHO "*** that it is just a static archive that I should not used here." 2385 1.1 lukem else 2386 1.2 agc $ECHO 2387 1.2 agc $ECHO "*** Warning: Linking the shared library $output against the" 2388 1.2 agc $ECHO "*** static library $deplib is not portable!" 2389 1.1 lukem deplibs="$deplib $deplibs" 2390 1.1 lukem fi 2391 1.1 lukem continue 2392 1.1 lukem ;; 2393 1.1 lukem prog) 2394 1.1 lukem if test "$pass" != link; then 2395 1.1 lukem deplibs="$deplib $deplibs" 2396 1.1 lukem else 2397 1.1 lukem compile_deplibs="$deplib $compile_deplibs" 2398 1.1 lukem finalize_deplibs="$deplib $finalize_deplibs" 2399 1.1 lukem fi 2400 1.1 lukem continue 2401 1.1 lukem ;; 2402 1.1 lukem esac # linkmode 2403 1.1 lukem ;; # *.$libext 2404 1.1 lukem *.lo | *.$objext) 2405 1.1 lukem if test "$pass" = conv; then 2406 1.1 lukem deplibs="$deplib $deplibs" 2407 1.1 lukem elif test "$linkmode" = prog; then 2408 1.1 lukem if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then 2409 1.1 lukem # If there is no dlopen support or we're linking statically, 2410 1.1 lukem # we need to preload. 2411 1.1 lukem newdlprefiles="$newdlprefiles $deplib" 2412 1.1 lukem compile_deplibs="$deplib $compile_deplibs" 2413 1.1 lukem finalize_deplibs="$deplib $finalize_deplibs" 2414 1.1 lukem else 2415 1.1 lukem newdlfiles="$newdlfiles $deplib" 2416 1.1 lukem fi 2417 1.1 lukem fi 2418 1.1 lukem continue 2419 1.1 lukem ;; 2420 1.1 lukem %DEPLIBS%) 2421 1.1 lukem alldeplibs=yes 2422 1.1 lukem continue 2423 1.1 lukem ;; 2424 1.1 lukem esac # case $deplib 2425 1.1 lukem if test "$found" = yes || test -f "$lib"; then : 2426 1.1 lukem else 2427 1.2 agc $ECHO "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 2428 1.1 lukem exit $EXIT_FAILURE 2429 1.1 lukem fi 2430 1.1 lukem 2431 1.1 lukem # Check to see that this really is a libtool archive. 2432 1.1 lukem if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : 2433 1.1 lukem else 2434 1.2 agc $ECHO "$modename: \`$lib' is not a valid libtool archive" 1>&2 2435 1.1 lukem exit $EXIT_FAILURE 2436 1.1 lukem fi 2437 1.1 lukem 2438 1.2 agc ladir=`$ECHO "X$lib" | $Xsed -e 's%/[^/]*$%%'` 2439 1.1 lukem test "X$ladir" = "X$lib" && ladir="." 2440 1.1 lukem 2441 1.1 lukem dlname= 2442 1.1 lukem dlopen= 2443 1.1 lukem dlpreopen= 2444 1.1 lukem libdir= 2445 1.1 lukem library_names= 2446 1.1 lukem old_library= 2447 1.1 lukem # If the library was installed with an old release of libtool, 2448 1.1 lukem # it will not redefine variables installed, or shouldnotlink 2449 1.1 lukem installed=yes 2450 1.1 lukem shouldnotlink=no 2451 1.1 lukem avoidtemprpath= 2452 1.1 lukem 2453 1.1 lukem 2454 1.1 lukem # Read the .la file 2455 1.1 lukem case $lib in 2456 1.1 lukem */* | *\\*) . $lib ;; 2457 1.1 lukem *) . ./$lib ;; 2458 1.1 lukem esac 2459 1.1 lukem 2460 1.1 lukem if test "$linkmode,$pass" = "lib,link" || 2461 1.1 lukem test "$linkmode,$pass" = "prog,scan" || 2462 1.1 lukem { test "$linkmode" != prog && test "$linkmode" != lib; }; then 2463 1.1 lukem test -n "$dlopen" && dlfiles="$dlfiles $dlopen" 2464 1.1 lukem test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" 2465 1.1 lukem fi 2466 1.1 lukem 2467 1.1 lukem if test "$pass" = conv; then 2468 1.1 lukem # Only check for convenience libraries 2469 1.1 lukem deplibs="$lib $deplibs" 2470 1.1 lukem if test -z "$libdir"; then 2471 1.1 lukem if test -z "$old_library"; then 2472 1.2 agc $ECHO "$modename: cannot find name of link library for \`$lib'" 1>&2 2473 1.1 lukem exit $EXIT_FAILURE 2474 1.1 lukem fi 2475 1.1 lukem # It is a libtool convenience library, so add in its objects. 2476 1.1 lukem convenience="$convenience $ladir/$objdir/$old_library" 2477 1.1 lukem old_convenience="$old_convenience $ladir/$objdir/$old_library" 2478 1.1 lukem tmp_libs= 2479 1.1 lukem for deplib in $dependency_libs; do 2480 1.1 lukem deplibs="$deplib $deplibs" 2481 1.1 lukem if test "X$duplicate_deps" = "Xyes" ; then 2482 1.1 lukem case "$tmp_libs " in 2483 1.1 lukem *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; 2484 1.1 lukem esac 2485 1.1 lukem fi 2486 1.1 lukem tmp_libs="$tmp_libs $deplib" 2487 1.1 lukem done 2488 1.1 lukem elif test "$linkmode" != prog && test "$linkmode" != lib; then 2489 1.2 agc $ECHO "$modename: \`$lib' is not a convenience library" 1>&2 2490 1.1 lukem exit $EXIT_FAILURE 2491 1.1 lukem fi 2492 1.1 lukem continue 2493 1.1 lukem fi # $pass = conv 2494 1.1 lukem 2495 1.1 lukem 2496 1.1 lukem # Get the name of the library we link against. 2497 1.1 lukem linklib= 2498 1.1 lukem for l in $old_library $library_names; do 2499 1.1 lukem linklib="$l" 2500 1.1 lukem done 2501 1.1 lukem if test -z "$linklib"; then 2502 1.2 agc $ECHO "$modename: cannot find name of link library for \`$lib'" 1>&2 2503 1.1 lukem exit $EXIT_FAILURE 2504 1.1 lukem fi 2505 1.1 lukem 2506 1.1 lukem # This library was specified with -dlopen. 2507 1.1 lukem if test "$pass" = dlopen; then 2508 1.1 lukem if test -z "$libdir"; then 2509 1.2 agc $ECHO "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 2510 1.1 lukem exit $EXIT_FAILURE 2511 1.1 lukem fi 2512 1.1 lukem if test -z "$dlname" || 2513 1.1 lukem test "$dlopen_support" != yes || 2514 1.1 lukem test "$build_libtool_libs" = no; then 2515 1.1 lukem # If there is no dlname, no dlopen support or we're linking 2516 1.1 lukem # statically, we need to preload. We also need to preload any 2517 1.1 lukem # dependent libraries so libltdl's deplib preloader doesn't 2518 1.1 lukem # bomb out in the load deplibs phase. 2519 1.1 lukem dlprefiles="$dlprefiles $lib $dependency_libs" 2520 1.1 lukem else 2521 1.1 lukem newdlfiles="$newdlfiles $lib" 2522 1.1 lukem fi 2523 1.1 lukem continue 2524 1.1 lukem fi # $pass = dlopen 2525 1.1 lukem 2526 1.1 lukem # We need an absolute path. 2527 1.1 lukem case $ladir in 2528 1.1 lukem [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; 2529 1.1 lukem *) 2530 1.1 lukem abs_ladir=`cd "$ladir" && pwd` 2531 1.1 lukem if test -z "$abs_ladir"; then 2532 1.2 agc $ECHO "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 2533 1.2 agc $ECHO "$modename: passing it literally to the linker, although it might fail" 1>&2 2534 1.1 lukem abs_ladir="$ladir" 2535 1.1 lukem fi 2536 1.1 lukem ;; 2537 1.1 lukem esac 2538 1.2 agc laname=`$ECHO "X$lib" | $Xsed -e 's%^.*/%%'` 2539 1.1 lukem 2540 1.1 lukem # Find the relevant object directory and library name. 2541 1.1 lukem if test "X$installed" = Xyes; then 2542 1.1 lukem if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then 2543 1.2 agc $ECHO "$modename: warning: library \`$lib' was moved." 1>&2 2544 1.1 lukem dir="$ladir" 2545 1.1 lukem absdir="$abs_ladir" 2546 1.1 lukem libdir="$abs_ladir" 2547 1.1 lukem else 2548 1.1 lukem dir="$libdir" 2549 1.1 lukem absdir="$libdir" 2550 1.1 lukem fi 2551 1.1 lukem test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes 2552 1.1 lukem else 2553 1.1 lukem if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then 2554 1.1 lukem dir="$ladir" 2555 1.1 lukem absdir="$abs_ladir" 2556 1.1 lukem # Remove this search path later 2557 1.1 lukem notinst_path="$notinst_path $abs_ladir" 2558 1.1 lukem else 2559 1.1 lukem dir="$ladir/$objdir" 2560 1.1 lukem absdir="$abs_ladir/$objdir" 2561 1.1 lukem # Remove this search path later 2562 1.1 lukem notinst_path="$notinst_path $abs_ladir" 2563 1.1 lukem fi 2564 1.1 lukem fi # $installed = yes 2565 1.2 agc name=`$ECHO "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` 2566 1.1 lukem 2567 1.1 lukem # This library was specified with -dlpreopen. 2568 1.1 lukem if test "$pass" = dlpreopen; then 2569 1.1 lukem if test -z "$libdir"; then 2570 1.2 agc $ECHO "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 2571 1.1 lukem exit $EXIT_FAILURE 2572 1.1 lukem fi 2573 1.1 lukem # Prefer using a static library (so that no silly _DYNAMIC symbols 2574 1.1 lukem # are required to link). 2575 1.1 lukem if test -n "$old_library"; then 2576 1.1 lukem newdlprefiles="$newdlprefiles $dir/$old_library" 2577 1.1 lukem # Otherwise, use the dlname, so that lt_dlopen finds it. 2578 1.1 lukem elif test -n "$dlname"; then 2579 1.1 lukem newdlprefiles="$newdlprefiles $dir/$dlname" 2580 1.1 lukem else 2581 1.1 lukem newdlprefiles="$newdlprefiles $dir/$linklib" 2582 1.1 lukem fi 2583 1.1 lukem fi # $pass = dlpreopen 2584 1.1 lukem 2585 1.1 lukem if test -z "$libdir"; then 2586 1.1 lukem # Link the convenience library 2587 1.1 lukem if test "$linkmode" = lib; then 2588 1.1 lukem deplibs="$dir/$old_library $deplibs" 2589 1.1 lukem elif test "$linkmode,$pass" = "prog,link"; then 2590 1.1 lukem compile_deplibs="$dir/$old_library $compile_deplibs" 2591 1.1 lukem finalize_deplibs="$dir/$old_library $finalize_deplibs" 2592 1.1 lukem else 2593 1.1 lukem deplibs="$lib $deplibs" # used for prog,scan pass 2594 1.1 lukem fi 2595 1.1 lukem continue 2596 1.1 lukem fi 2597 1.1 lukem 2598 1.1 lukem 2599 1.1 lukem if test "$linkmode" = prog && test "$pass" != link; then 2600 1.1 lukem newlib_search_path="$newlib_search_path $ladir" 2601 1.1 lukem deplibs="$lib $deplibs" 2602 1.1 lukem 2603 1.1 lukem linkalldeplibs=no 2604 1.1 lukem if test "$link_all_deplibs" != no || test -z "$library_names" || 2605 1.1 lukem test "$build_libtool_libs" = no; then 2606 1.1 lukem linkalldeplibs=yes 2607 1.1 lukem fi 2608 1.1 lukem 2609 1.1 lukem tmp_libs= 2610 1.1 lukem for deplib in $dependency_libs; do 2611 1.1 lukem case $deplib in 2612 1.2 agc -L*) newlib_search_path="$newlib_search_path "`$ECHO "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test 2613 1.1 lukem esac 2614 1.1 lukem # Need to link against all dependency_libs? 2615 1.1 lukem if test "$linkalldeplibs" = yes; then 2616 1.1 lukem deplibs="$deplib $deplibs" 2617 1.1 lukem else 2618 1.1 lukem # Need to hardcode shared library paths 2619 1.1 lukem # or/and link against static libraries 2620 1.1 lukem newdependency_libs="$deplib $newdependency_libs" 2621 1.1 lukem fi 2622 1.1 lukem if test "X$duplicate_deps" = "Xyes" ; then 2623 1.1 lukem case "$tmp_libs " in 2624 1.1 lukem *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; 2625 1.1 lukem esac 2626 1.1 lukem fi 2627 1.1 lukem tmp_libs="$tmp_libs $deplib" 2628 1.1 lukem done # for deplib 2629 1.1 lukem continue 2630 1.1 lukem fi # $linkmode = prog... 2631 1.1 lukem 2632 1.1 lukem if test "$linkmode,$pass" = "prog,link"; then 2633 1.1 lukem if test -n "$library_names" && 2634 1.1 lukem { { test "$prefer_static_libs" = no || 2635 1.1 lukem test "$prefer_static_libs,$installed" = "built,yes"; } || 2636 1.1 lukem test -z "$old_library"; }; then 2637 1.1 lukem # We need to hardcode the library path 2638 1.1 lukem if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then 2639 1.1 lukem # Make sure the rpath contains only unique directories. 2640 1.1 lukem case "$temp_rpath " in 2641 1.1 lukem *" $dir "*) ;; 2642 1.1 lukem *" $absdir "*) ;; 2643 1.1 lukem *) temp_rpath="$temp_rpath $absdir" ;; 2644 1.1 lukem esac 2645 1.1 lukem fi 2646 1.1 lukem 2647 1.1 lukem # Hardcode the library path. 2648 1.1 lukem # Skip directories that are in the system default run-time 2649 1.1 lukem # search path. 2650 1.1 lukem case " $sys_lib_dlsearch_path " in 2651 1.1 lukem *" $absdir "*) ;; 2652 1.1 lukem *) 2653 1.1 lukem case "$compile_rpath " in 2654 1.1 lukem *" $absdir "*) ;; 2655 1.1 lukem *) compile_rpath="$compile_rpath $absdir" 2656 1.1 lukem esac 2657 1.1 lukem ;; 2658 1.1 lukem esac 2659 1.1 lukem case " $sys_lib_dlsearch_path " in 2660 1.1 lukem *" $libdir "*) ;; 2661 1.1 lukem *) 2662 1.1 lukem case "$finalize_rpath " in 2663 1.1 lukem *" $libdir "*) ;; 2664 1.1 lukem *) finalize_rpath="$finalize_rpath $libdir" 2665 1.1 lukem esac 2666 1.1 lukem ;; 2667 1.1 lukem esac 2668 1.1 lukem fi # $linkmode,$pass = prog,link... 2669 1.1 lukem 2670 1.1 lukem if test "$alldeplibs" = yes && 2671 1.1 lukem { test "$deplibs_check_method" = pass_all || 2672 1.1 lukem { test "$build_libtool_libs" = yes && 2673 1.1 lukem test -n "$library_names"; }; }; then 2674 1.1 lukem # We only need to search for static libraries 2675 1.1 lukem continue 2676 1.1 lukem fi 2677 1.1 lukem fi 2678 1.1 lukem 2679 1.1 lukem link_static=no # Whether the deplib will be linked statically 2680 1.1 lukem use_static_libs=$prefer_static_libs 2681 1.1 lukem if test "$use_static_libs" = built && test "$installed" = yes ; then 2682 1.1 lukem use_static_libs=no 2683 1.1 lukem fi 2684 1.1 lukem if test -n "$library_names" && 2685 1.1 lukem { test "$use_static_libs" = no || test -z "$old_library"; }; then 2686 1.1 lukem if test "$installed" = no; then 2687 1.1 lukem notinst_deplibs="$notinst_deplibs $lib" 2688 1.1 lukem need_relink=yes 2689 1.1 lukem fi 2690 1.1 lukem # This is a shared library 2691 1.1 lukem 2692 1.1 lukem # Warn about portability, can't link against -module's on 2693 1.1 lukem # some systems (darwin) 2694 1.1 lukem if test "$shouldnotlink" = yes && test "$pass" = link ; then 2695 1.2 agc $ECHO 2696 1.1 lukem if test "$linkmode" = prog; then 2697 1.2 agc $ECHO "*** Warning: Linking the executable $output against the loadable module" 2698 1.1 lukem else 2699 1.2 agc $ECHO "*** Warning: Linking the shared library $output against the loadable module" 2700 1.1 lukem fi 2701 1.2 agc $ECHO "*** $linklib is not portable!" 2702 1.1 lukem fi 2703 1.1 lukem if test "$linkmode" = lib && 2704 1.1 lukem test "$hardcode_into_libs" = yes; then 2705 1.1 lukem # Hardcode the library path. 2706 1.1 lukem # Skip directories that are in the system default run-time 2707 1.1 lukem # search path. 2708 1.1 lukem case " $sys_lib_dlsearch_path " in 2709 1.1 lukem *" $absdir "*) ;; 2710 1.1 lukem *) 2711 1.1 lukem case "$compile_rpath " in 2712 1.1 lukem *" $absdir "*) ;; 2713 1.1 lukem *) compile_rpath="$compile_rpath $absdir" 2714 1.1 lukem esac 2715 1.1 lukem ;; 2716 1.1 lukem esac 2717 1.1 lukem case " $sys_lib_dlsearch_path " in 2718 1.1 lukem *" $libdir "*) ;; 2719 1.1 lukem *) 2720 1.1 lukem case "$finalize_rpath " in 2721 1.1 lukem *" $libdir "*) ;; 2722 1.1 lukem *) finalize_rpath="$finalize_rpath $libdir" 2723 1.1 lukem esac 2724 1.1 lukem ;; 2725 1.1 lukem esac 2726 1.1 lukem fi 2727 1.1 lukem 2728 1.1 lukem if test -n "$old_archive_from_expsyms_cmds"; then 2729 1.1 lukem # figure out the soname 2730 1.1 lukem set dummy $library_names 2731 1.1 lukem realname="$2" 2732 1.1 lukem shift; shift 2733 1.2 agc libname=`eval \\$ECHO \"$libname_spec\"` 2734 1.1 lukem # use dlname if we got it. it's perfectly good, no? 2735 1.1 lukem if test -n "$dlname"; then 2736 1.1 lukem soname="$dlname" 2737 1.1 lukem elif test -n "$soname_spec"; then 2738 1.1 lukem # bleh windows 2739 1.1 lukem case $host in 2740 1.1 lukem *cygwin* | mingw*) 2741 1.1 lukem major=`expr $current - $age` 2742 1.1 lukem versuffix="-$major" 2743 1.1 lukem ;; 2744 1.1 lukem esac 2745 1.1 lukem eval soname=\"$soname_spec\" 2746 1.1 lukem else 2747 1.1 lukem soname="$realname" 2748 1.1 lukem fi 2749 1.1 lukem 2750 1.1 lukem # Make a new name for the extract_expsyms_cmds to use 2751 1.1 lukem soroot="$soname" 2752 1.2 agc soname=`$ECHO $soroot | ${SED} -e 's/^.*\///'` 2753 1.2 agc newlib="libimp-`$ECHO $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" 2754 1.1 lukem 2755 1.1 lukem # If the library has no export list, then create one now 2756 1.1 lukem if test -f "$output_objdir/$soname-def"; then : 2757 1.1 lukem else 2758 1.1 lukem $show "extracting exported symbol list from \`$soname'" 2759 1.1 lukem save_ifs="$IFS"; IFS='~' 2760 1.1 lukem cmds=$extract_expsyms_cmds 2761 1.1 lukem for cmd in $cmds; do 2762 1.1 lukem IFS="$save_ifs" 2763 1.1 lukem eval cmd=\"$cmd\" 2764 1.1 lukem $show "$cmd" 2765 1.1 lukem $run eval "$cmd" || exit $? 2766 1.1 lukem done 2767 1.1 lukem IFS="$save_ifs" 2768 1.1 lukem fi 2769 1.1 lukem 2770 1.1 lukem # Create $newlib 2771 1.1 lukem if test -f "$output_objdir/$newlib"; then :; else 2772 1.1 lukem $show "generating import library for \`$soname'" 2773 1.1 lukem save_ifs="$IFS"; IFS='~' 2774 1.1 lukem cmds=$old_archive_from_expsyms_cmds 2775 1.1 lukem for cmd in $cmds; do 2776 1.1 lukem IFS="$save_ifs" 2777 1.1 lukem eval cmd=\"$cmd\" 2778 1.1 lukem $show "$cmd" 2779 1.1 lukem $run eval "$cmd" || exit $? 2780 1.1 lukem done 2781 1.1 lukem IFS="$save_ifs" 2782 1.1 lukem fi 2783 1.1 lukem # make sure the library variables are pointing to the new library 2784 1.1 lukem dir=$output_objdir 2785 1.1 lukem linklib=$newlib 2786 1.1 lukem fi # test -n "$old_archive_from_expsyms_cmds" 2787 1.1 lukem 2788 1.1 lukem if test "$linkmode" = prog || test "$mode" != relink; then 2789 1.1 lukem add_shlibpath= 2790 1.1 lukem add_dir= 2791 1.1 lukem add= 2792 1.1 lukem lib_linked=yes 2793 1.1 lukem case $hardcode_action in 2794 1.1 lukem immediate | unsupported) 2795 1.1 lukem if test "$hardcode_direct" = no; then 2796 1.1 lukem add="$dir/$linklib" 2797 1.1 lukem case $host in 2798 1.1 lukem *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; 2799 1.1 lukem *-*-sysv4*uw2*) add_dir="-L$dir" ;; 2800 1.1 lukem *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ 2801 1.1 lukem *-*-unixware7*) add_dir="-L$dir" ;; 2802 1.1 lukem *-*-darwin* ) 2803 1.1 lukem # if the lib is a module then we can not link against 2804 1.1 lukem # it, someone is ignoring the new warnings I added 2805 1.1 lukem if /usr/bin/file -L $add 2> /dev/null | 2806 1.1 lukem $EGREP ": [^:]* bundle" >/dev/null ; then 2807 1.2 agc $ECHO "** Warning, lib $linklib is a module, not a shared library" 2808 1.1 lukem if test -z "$old_library" ; then 2809 1.2 agc $ECHO 2810 1.2 agc $ECHO "** And there doesn't seem to be a static archive available" 2811 1.2 agc $ECHO "** The link will probably fail, sorry" 2812 1.1 lukem else 2813 1.1 lukem add="$dir/$old_library" 2814 1.1 lukem fi 2815 1.1 lukem fi 2816 1.1 lukem esac 2817 1.1 lukem elif test "$hardcode_minus_L" = no; then 2818 1.1 lukem case $host in 2819 1.1 lukem *-*-sunos*) add_shlibpath="$dir" ;; 2820 1.1 lukem esac 2821 1.1 lukem add_dir="-L$dir" 2822 1.1 lukem add="-l$name" 2823 1.1 lukem elif test "$hardcode_shlibpath_var" = no; then 2824 1.1 lukem add_shlibpath="$dir" 2825 1.1 lukem add="-l$name" 2826 1.1 lukem else 2827 1.1 lukem lib_linked=no 2828 1.1 lukem fi 2829 1.1 lukem ;; 2830 1.1 lukem relink) 2831 1.1 lukem if test "$hardcode_direct" = yes; then 2832 1.1 lukem add="$dir/$linklib" 2833 1.1 lukem elif test "$hardcode_minus_L" = yes; then 2834 1.1 lukem add_dir="-L$dir" 2835 1.1 lukem # Try looking first in the location we're being installed to. 2836 1.1 lukem if test -n "$inst_prefix_dir"; then 2837 1.1 lukem case $libdir in 2838 1.1 lukem [\\/]*) 2839 1.1 lukem add_dir="$add_dir -L$inst_prefix_dir$libdir" 2840 1.1 lukem ;; 2841 1.1 lukem esac 2842 1.1 lukem fi 2843 1.1 lukem add="-l$name" 2844 1.1 lukem elif test "$hardcode_shlibpath_var" = yes; then 2845 1.1 lukem add_shlibpath="$dir" 2846 1.1 lukem add="-l$name" 2847 1.1 lukem else 2848 1.1 lukem lib_linked=no 2849 1.1 lukem fi 2850 1.1 lukem ;; 2851 1.1 lukem *) lib_linked=no ;; 2852 1.1 lukem esac 2853 1.1 lukem 2854 1.1 lukem if test "$lib_linked" != yes; then 2855 1.2 agc $ECHO "$modename: configuration error: unsupported hardcode properties" 2856 1.1 lukem exit $EXIT_FAILURE 2857 1.1 lukem fi 2858 1.1 lukem 2859 1.1 lukem if test -n "$add_shlibpath"; then 2860 1.1 lukem case :$compile_shlibpath: in 2861 1.1 lukem *":$add_shlibpath:"*) ;; 2862 1.1 lukem *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; 2863 1.1 lukem esac 2864 1.1 lukem fi 2865 1.1 lukem if test "$linkmode" = prog; then 2866 1.1 lukem test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" 2867 1.1 lukem test -n "$add" && compile_deplibs="$add $compile_deplibs" 2868 1.1 lukem else 2869 1.1 lukem test -n "$add_dir" && deplibs="$add_dir $deplibs" 2870 1.1 lukem test -n "$add" && deplibs="$add $deplibs" 2871 1.1 lukem if test "$hardcode_direct" != yes && \ 2872 1.1 lukem test "$hardcode_minus_L" != yes && \ 2873 1.1 lukem test "$hardcode_shlibpath_var" = yes; then 2874 1.1 lukem case :$finalize_shlibpath: in 2875 1.1 lukem *":$libdir:"*) ;; 2876 1.1 lukem *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; 2877 1.1 lukem esac 2878 1.1 lukem fi 2879 1.1 lukem fi 2880 1.1 lukem fi 2881 1.1 lukem 2882 1.1 lukem if test "$linkmode" = prog || test "$mode" = relink; then 2883 1.1 lukem add_shlibpath= 2884 1.1 lukem add_dir= 2885 1.1 lukem add= 2886 1.1 lukem # Finalize command for both is simple: just hardcode it. 2887 1.1 lukem if test "$hardcode_direct" = yes; then 2888 1.1 lukem add="$libdir/$linklib" 2889 1.1 lukem elif test "$hardcode_minus_L" = yes; then 2890 1.1 lukem add_dir="-L$libdir" 2891 1.1 lukem add="-l$name" 2892 1.1 lukem elif test "$hardcode_shlibpath_var" = yes; then 2893 1.1 lukem case :$finalize_shlibpath: in 2894 1.1 lukem *":$libdir:"*) ;; 2895 1.1 lukem *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; 2896 1.1 lukem esac 2897 1.1 lukem add="-l$name" 2898 1.1 lukem elif test "$hardcode_automatic" = yes; then 2899 1.1 lukem if test -n "$inst_prefix_dir" && 2900 1.1 lukem test -f "$inst_prefix_dir$libdir/$linklib" ; then 2901 1.1 lukem add="$inst_prefix_dir$libdir/$linklib" 2902 1.1 lukem else 2903 1.1 lukem add="$libdir/$linklib" 2904 1.1 lukem fi 2905 1.1 lukem else 2906 1.1 lukem # We cannot seem to hardcode it, guess we'll fake it. 2907 1.1 lukem add_dir="-L$libdir" 2908 1.1 lukem # Try looking first in the location we're being installed to. 2909 1.1 lukem if test -n "$inst_prefix_dir"; then 2910 1.1 lukem case $libdir in 2911 1.1 lukem [\\/]*) 2912 1.1 lukem add_dir="$add_dir -L$inst_prefix_dir$libdir" 2913 1.1 lukem ;; 2914 1.1 lukem esac 2915 1.1 lukem fi 2916 1.1 lukem add="-l$name" 2917 1.1 lukem fi 2918 1.1 lukem 2919 1.1 lukem if test "$linkmode" = prog; then 2920 1.1 lukem test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" 2921 1.1 lukem test -n "$add" && finalize_deplibs="$add $finalize_deplibs" 2922 1.1 lukem else 2923 1.1 lukem test -n "$add_dir" && deplibs="$add_dir $deplibs" 2924 1.1 lukem test -n "$add" && deplibs="$add $deplibs" 2925 1.1 lukem fi 2926 1.1 lukem fi 2927 1.1 lukem elif test "$linkmode" = prog; then 2928 1.1 lukem # Here we assume that one of hardcode_direct or hardcode_minus_L 2929 1.1 lukem # is not unsupported. This is valid on all known static and 2930 1.1 lukem # shared platforms. 2931 1.1 lukem if test "$hardcode_direct" != unsupported; then 2932 1.1 lukem test -n "$old_library" && linklib="$old_library" 2933 1.1 lukem compile_deplibs="$dir/$linklib $compile_deplibs" 2934 1.1 lukem finalize_deplibs="$dir/$linklib $finalize_deplibs" 2935 1.1 lukem else 2936 1.1 lukem compile_deplibs="-l$name -L$dir $compile_deplibs" 2937 1.1 lukem finalize_deplibs="-l$name -L$dir $finalize_deplibs" 2938 1.1 lukem fi 2939 1.1 lukem elif test "$build_libtool_libs" = yes; then 2940 1.1 lukem # Not a shared library 2941 1.1 lukem if test "$deplibs_check_method" != pass_all; then 2942 1.1 lukem # We're trying link a shared library against a static one 2943 1.1 lukem # but the system doesn't support it. 2944 1.1 lukem 2945 1.1 lukem # Just print a warning and add the library to dependency_libs so 2946 1.1 lukem # that the program can be linked against the static library. 2947 1.2 agc $ECHO 2948 1.2 agc $ECHO "*** Warning: This system can not link to static lib archive $lib." 2949 1.2 agc $ECHO "*** I have the capability to make that library automatically link in when" 2950 1.2 agc $ECHO "*** you link to this library. But I can only do this if you have a" 2951 1.2 agc $ECHO "*** shared version of the library, which you do not appear to have." 2952 1.1 lukem if test "$module" = yes; then 2953 1.2 agc $ECHO "*** But as you try to build a module library, libtool will still create " 2954 1.2 agc $ECHO "*** a static module, that should work as long as the dlopening application" 2955 1.2 agc $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime." 2956 1.1 lukem if test -z "$global_symbol_pipe"; then 2957 1.2 agc $ECHO 2958 1.2 agc $ECHO "*** However, this would only work if libtool was able to extract symbol" 2959 1.2 agc $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" 2960 1.2 agc $ECHO "*** not find such a program. So, this module is probably useless." 2961 1.2 agc $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." 2962 1.1 lukem fi 2963 1.1 lukem if test "$build_old_libs" = no; then 2964 1.1 lukem build_libtool_libs=module 2965 1.1 lukem build_old_libs=yes 2966 1.1 lukem else 2967 1.1 lukem build_libtool_libs=no 2968 1.1 lukem fi 2969 1.1 lukem fi 2970 1.1 lukem else 2971 1.1 lukem deplibs="$dir/$old_library $deplibs" 2972 1.1 lukem link_static=yes 2973 1.1 lukem fi 2974 1.1 lukem fi # link shared/static library? 2975 1.1 lukem 2976 1.1 lukem if test "$linkmode" = lib; then 2977 1.1 lukem if test -n "$dependency_libs" && 2978 1.1 lukem { test "$hardcode_into_libs" != yes || 2979 1.1 lukem test "$build_old_libs" = yes || 2980 1.1 lukem test "$link_static" = yes; }; then 2981 1.1 lukem # Extract -R from dependency_libs 2982 1.1 lukem temp_deplibs= 2983 1.1 lukem for libdir in $dependency_libs; do 2984 1.1 lukem case $libdir in 2985 1.2 agc -R*) temp_xrpath=`$ECHO "X$libdir" | $Xsed -e 's/^-R//'` 2986 1.1 lukem case " $xrpath " in 2987 1.1 lukem *" $temp_xrpath "*) ;; 2988 1.1 lukem *) xrpath="$xrpath $temp_xrpath";; 2989 1.1 lukem esac;; 2990 1.1 lukem *) temp_deplibs="$temp_deplibs $libdir";; 2991 1.1 lukem esac 2992 1.1 lukem done 2993 1.1 lukem dependency_libs="$temp_deplibs" 2994 1.1 lukem fi 2995 1.1 lukem 2996 1.1 lukem newlib_search_path="$newlib_search_path $absdir" 2997 1.1 lukem # Link against this library 2998 1.1 lukem test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" 2999 1.1 lukem # ... and its dependency_libs 3000 1.1 lukem tmp_libs= 3001 1.1 lukem for deplib in $dependency_libs; do 3002 1.1 lukem newdependency_libs="$deplib $newdependency_libs" 3003 1.1 lukem if test "X$duplicate_deps" = "Xyes" ; then 3004 1.1 lukem case "$tmp_libs " in 3005 1.1 lukem *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; 3006 1.1 lukem esac 3007 1.1 lukem fi 3008 1.1 lukem tmp_libs="$tmp_libs $deplib" 3009 1.1 lukem done 3010 1.1 lukem 3011 1.1 lukem if test "$link_all_deplibs" != no; then 3012 1.1 lukem # Add the search paths of all dependency libraries 3013 1.1 lukem for deplib in $dependency_libs; do 3014 1.1 lukem case $deplib in 3015 1.1 lukem -L*) path="$deplib" ;; 3016 1.1 lukem *.la) 3017 1.2 agc dir=`$ECHO "X$deplib" | $Xsed -e 's%/[^/]*$%%'` 3018 1.1 lukem test "X$dir" = "X$deplib" && dir="." 3019 1.1 lukem # We need an absolute path. 3020 1.1 lukem case $dir in 3021 1.1 lukem [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; 3022 1.1 lukem *) 3023 1.1 lukem absdir=`cd "$dir" && pwd` 3024 1.1 lukem if test -z "$absdir"; then 3025 1.2 agc $ECHO "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 3026 1.1 lukem absdir="$dir" 3027 1.1 lukem fi 3028 1.1 lukem ;; 3029 1.1 lukem esac 3030 1.1 lukem if grep "^installed=no" $deplib > /dev/null; then 3031 1.1 lukem path="$absdir/$objdir" 3032 1.1 lukem else 3033 1.1 lukem eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` 3034 1.1 lukem if test -z "$libdir"; then 3035 1.2 agc $ECHO "$modename: \`$deplib' is not a valid libtool archive" 1>&2 3036 1.1 lukem exit $EXIT_FAILURE 3037 1.1 lukem fi 3038 1.1 lukem if test "$absdir" != "$libdir"; then 3039 1.2 agc $ECHO "$modename: warning: \`$deplib' seems to be moved" 1>&2 3040 1.1 lukem fi 3041 1.1 lukem path="$absdir" 3042 1.1 lukem fi 3043 1.1 lukem depdepl= 3044 1.1 lukem case $host in 3045 1.1 lukem *-*-darwin*) 3046 1.1 lukem # we do not want to link against static libs, 3047 1.1 lukem # but need to link against shared 3048 1.1 lukem eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` 3049 1.1 lukem eval deplibdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` 3050 1.1 lukem if test -n "$deplibrary_names" ; then 3051 1.1 lukem for tmp in $deplibrary_names ; do 3052 1.1 lukem depdepl=$tmp 3053 1.1 lukem done 3054 1.1 lukem if test -f "$deplibdir/$depdepl" ; then 3055 1.1 lukem depdepl="$deplibdir/$depdepl" 3056 1.1 lukem elif test -f "$path/$depdepl" ; then 3057 1.1 lukem depdepl="$path/$depdepl" 3058 1.1 lukem else 3059 1.1 lukem # Can't find it, oh well... 3060 1.1 lukem depdepl= 3061 1.1 lukem fi 3062 1.1 lukem # do not add paths which are already there 3063 1.1 lukem case " $newlib_search_path " in 3064 1.1 lukem *" $path "*) ;; 3065 1.1 lukem *) newlib_search_path="$newlib_search_path $path";; 3066 1.1 lukem esac 3067 1.1 lukem fi 3068 1.1 lukem path="" 3069 1.1 lukem ;; 3070 1.1 lukem *) 3071 1.1 lukem path="-L$path" 3072 1.1 lukem ;; 3073 1.1 lukem esac 3074 1.1 lukem ;; 3075 1.1 lukem -l*) 3076 1.1 lukem case $host in 3077 1.1 lukem *-*-darwin*) 3078 1.1 lukem # Again, we only want to link against shared libraries 3079 1.2 agc eval tmp_libs=`$ECHO "X$deplib" | $Xsed -e "s,^\-l,,"` 3080 1.1 lukem for tmp in $newlib_search_path ; do 3081 1.1 lukem if test -f "$tmp/lib$tmp_libs.dylib" ; then 3082 1.1 lukem eval depdepl="$tmp/lib$tmp_libs.dylib" 3083 1.1 lukem break 3084 1.1 lukem fi 3085 1.1 lukem done 3086 1.1 lukem path="" 3087 1.1 lukem ;; 3088 1.1 lukem *) continue ;; 3089 1.1 lukem esac 3090 1.1 lukem ;; 3091 1.1 lukem *) continue ;; 3092 1.1 lukem esac 3093 1.1 lukem case " $deplibs " in 3094 1.1 lukem *" $path "*) ;; 3095 1.1 lukem *) deplibs="$path $deplibs" ;; 3096 1.1 lukem esac 3097 1.1 lukem case " $deplibs " in 3098 1.1 lukem *" $depdepl "*) ;; 3099 1.1 lukem *) deplibs="$depdepl $deplibs" ;; 3100 1.1 lukem esac 3101 1.1 lukem done 3102 1.1 lukem fi # link_all_deplibs != no 3103 1.1 lukem fi # linkmode = lib 3104 1.1 lukem done # for deplib in $libs 3105 1.1 lukem dependency_libs="$newdependency_libs" 3106 1.1 lukem if test "$pass" = dlpreopen; then 3107 1.1 lukem # Link the dlpreopened libraries before other libraries 3108 1.1 lukem for deplib in $save_deplibs; do 3109 1.1 lukem deplibs="$deplib $deplibs" 3110 1.1 lukem done 3111 1.1 lukem fi 3112 1.1 lukem if test "$pass" != dlopen; then 3113 1.1 lukem if test "$pass" != conv; then 3114 1.1 lukem # Make sure lib_search_path contains only unique directories. 3115 1.1 lukem lib_search_path= 3116 1.1 lukem for dir in $newlib_search_path; do 3117 1.1 lukem case "$lib_search_path " in 3118 1.1 lukem *" $dir "*) ;; 3119 1.1 lukem *) lib_search_path="$lib_search_path $dir" ;; 3120 1.1 lukem esac 3121 1.1 lukem done 3122 1.1 lukem newlib_search_path= 3123 1.1 lukem fi 3124 1.1 lukem 3125 1.1 lukem if test "$linkmode,$pass" != "prog,link"; then 3126 1.1 lukem vars="deplibs" 3127 1.1 lukem else 3128 1.1 lukem vars="compile_deplibs finalize_deplibs" 3129 1.1 lukem fi 3130 1.1 lukem for var in $vars dependency_libs; do 3131 1.1 lukem # Add libraries to $var in reverse order 3132 1.1 lukem eval tmp_libs=\"\$$var\" 3133 1.1 lukem new_libs= 3134 1.1 lukem for deplib in $tmp_libs; do 3135 1.1 lukem # FIXME: Pedantically, this is the right thing to do, so 3136 1.1 lukem # that some nasty dependency loop isn't accidentally 3137 1.1 lukem # broken: 3138 1.1 lukem #new_libs="$deplib $new_libs" 3139 1.1 lukem # Pragmatically, this seems to cause very few problems in 3140 1.1 lukem # practice: 3141 1.1 lukem case $deplib in 3142 1.1 lukem -L*) new_libs="$deplib $new_libs" ;; 3143 1.1 lukem -R*) ;; 3144 1.1 lukem *) 3145 1.1 lukem # And here is the reason: when a library appears more 3146 1.1 lukem # than once as an explicit dependence of a library, or 3147 1.1 lukem # is implicitly linked in more than once by the 3148 1.1 lukem # compiler, it is considered special, and multiple 3149 1.1 lukem # occurrences thereof are not removed. Compare this 3150 1.1 lukem # with having the same library being listed as a 3151 1.1 lukem # dependency of multiple other libraries: in this case, 3152 1.1 lukem # we know (pedantically, we assume) the library does not 3153 1.1 lukem # need to be listed more than once, so we keep only the 3154 1.1 lukem # last copy. This is not always right, but it is rare 3155 1.1 lukem # enough that we require users that really mean to play 3156 1.1 lukem # such unportable linking tricks to link the library 3157 1.1 lukem # using -Wl,-lname, so that libtool does not consider it 3158 1.1 lukem # for duplicate removal. 3159 1.1 lukem case " $specialdeplibs " in 3160 1.1 lukem *" $deplib "*) new_libs="$deplib $new_libs" ;; 3161 1.1 lukem *) 3162 1.1 lukem case " $new_libs " in 3163 1.1 lukem *" $deplib "*) ;; 3164 1.1 lukem *) new_libs="$deplib $new_libs" ;; 3165 1.1 lukem esac 3166 1.1 lukem ;; 3167 1.1 lukem esac 3168 1.1 lukem ;; 3169 1.1 lukem esac 3170 1.1 lukem done 3171 1.1 lukem tmp_libs= 3172 1.1 lukem for deplib in $new_libs; do 3173 1.1 lukem case $deplib in 3174 1.1 lukem -L*) 3175 1.1 lukem case " $tmp_libs " in 3176 1.1 lukem *" $deplib "*) ;; 3177 1.1 lukem *) tmp_libs="$tmp_libs $deplib" ;; 3178 1.1 lukem esac 3179 1.1 lukem ;; 3180 1.1 lukem *) tmp_libs="$tmp_libs $deplib" ;; 3181 1.1 lukem esac 3182 1.1 lukem done 3183 1.1 lukem eval $var=\"$tmp_libs\" 3184 1.1 lukem done # for var 3185 1.1 lukem fi 3186 1.1 lukem # Last step: remove runtime libs from dependency_libs 3187 1.1 lukem # (they stay in deplibs) 3188 1.1 lukem tmp_libs= 3189 1.1 lukem for i in $dependency_libs ; do 3190 1.1 lukem case " $predeps $postdeps $compiler_lib_search_path " in 3191 1.1 lukem *" $i "*) 3192 1.1 lukem i="" 3193 1.1 lukem ;; 3194 1.1 lukem esac 3195 1.1 lukem if test -n "$i" ; then 3196 1.1 lukem tmp_libs="$tmp_libs $i" 3197 1.1 lukem fi 3198 1.1 lukem done 3199 1.1 lukem dependency_libs=$tmp_libs 3200 1.1 lukem done # for pass 3201 1.1 lukem if test "$linkmode" = prog; then 3202 1.1 lukem dlfiles="$newdlfiles" 3203 1.1 lukem dlprefiles="$newdlprefiles" 3204 1.1 lukem fi 3205 1.1 lukem 3206 1.1 lukem case $linkmode in 3207 1.1 lukem oldlib) 3208 1.1 lukem case " $deplibs" in 3209 1.1 lukem *\ -l* | *\ -L*) 3210 1.2 agc $ECHO "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 ;; 3211 1.1 lukem esac 3212 1.1 lukem 3213 1.1 lukem if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then 3214 1.2 agc $ECHO "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 3215 1.1 lukem fi 3216 1.1 lukem 3217 1.1 lukem if test -n "$rpath"; then 3218 1.2 agc $ECHO "$modename: warning: \`-rpath' is ignored for archives" 1>&2 3219 1.1 lukem fi 3220 1.1 lukem 3221 1.1 lukem if test -n "$xrpath"; then 3222 1.2 agc $ECHO "$modename: warning: \`-R' is ignored for archives" 1>&2 3223 1.1 lukem fi 3224 1.1 lukem 3225 1.1 lukem if test -n "$vinfo"; then 3226 1.2 agc $ECHO "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 3227 1.1 lukem fi 3228 1.1 lukem 3229 1.1 lukem if test -n "$release"; then 3230 1.2 agc $ECHO "$modename: warning: \`-release' is ignored for archives" 1>&2 3231 1.1 lukem fi 3232 1.1 lukem 3233 1.1 lukem if test -n "$export_symbols" || test -n "$export_symbols_regex"; then 3234 1.2 agc $ECHO "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 3235 1.1 lukem fi 3236 1.1 lukem 3237 1.1 lukem # Now set the variables for building old libraries. 3238 1.1 lukem build_libtool_libs=no 3239 1.1 lukem oldlibs="$output" 3240 1.1 lukem objs="$objs$old_deplibs" 3241 1.1 lukem ;; 3242 1.1 lukem 3243 1.1 lukem lib) 3244 1.1 lukem # Make sure we only generate libraries of the form `libNAME.la'. 3245 1.1 lukem case $outputname in 3246 1.1 lukem lib*) 3247 1.2 agc name=`$ECHO "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` 3248 1.1 lukem eval shared_ext=\"$shrext_cmds\" 3249 1.1 lukem eval libname=\"$libname_spec\" 3250 1.1 lukem ;; 3251 1.1 lukem *) 3252 1.1 lukem if test "$module" = no; then 3253 1.2 agc $ECHO "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 3254 1.2 agc $ECHO "$help" 1>&2 3255 1.1 lukem exit $EXIT_FAILURE 3256 1.1 lukem fi 3257 1.1 lukem if test "$need_lib_prefix" != no; then 3258 1.1 lukem # Add the "lib" prefix for modules if required 3259 1.2 agc name=`$ECHO "X$outputname" | $Xsed -e 's/\.la$//'` 3260 1.1 lukem eval shared_ext=\"$shrext_cmds\" 3261 1.1 lukem eval libname=\"$libname_spec\" 3262 1.1 lukem else 3263 1.2 agc libname=`$ECHO "X$outputname" | $Xsed -e 's/\.la$//'` 3264 1.1 lukem fi 3265 1.1 lukem ;; 3266 1.1 lukem esac 3267 1.1 lukem 3268 1.1 lukem if test -n "$objs"; then 3269 1.1 lukem if test "$deplibs_check_method" != pass_all; then 3270 1.2 agc $ECHO "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 3271 1.1 lukem exit $EXIT_FAILURE 3272 1.1 lukem else 3273 1.2 agc $ECHO 3274 1.2 agc $ECHO "*** Warning: Linking the shared library $output against the non-libtool" 3275 1.2 agc $ECHO "*** objects $objs is not portable!" 3276 1.1 lukem libobjs="$libobjs $objs" 3277 1.1 lukem fi 3278 1.1 lukem fi 3279 1.1 lukem 3280 1.1 lukem if test "$dlself" != no; then 3281 1.2 agc $ECHO "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 3282 1.1 lukem fi 3283 1.1 lukem 3284 1.1 lukem set dummy $rpath 3285 1.1 lukem if test "$#" -gt 2; then 3286 1.2 agc $ECHO "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 3287 1.1 lukem fi 3288 1.1 lukem install_libdir="$2" 3289 1.1 lukem 3290 1.1 lukem oldlibs= 3291 1.1 lukem if test -z "$rpath"; then 3292 1.1 lukem if test "$build_libtool_libs" = yes; then 3293 1.1 lukem # Building a libtool convenience library. 3294 1.1 lukem # Some compilers have problems with a `.al' extension so 3295 1.1 lukem # convenience libraries should have the same extension an 3296 1.1 lukem # archive normally would. 3297 1.1 lukem oldlibs="$output_objdir/$libname.$libext $oldlibs" 3298 1.1 lukem build_libtool_libs=convenience 3299 1.1 lukem build_old_libs=yes 3300 1.1 lukem fi 3301 1.1 lukem 3302 1.1 lukem if test -n "$vinfo"; then 3303 1.2 agc $ECHO "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 3304 1.1 lukem fi 3305 1.1 lukem 3306 1.1 lukem if test -n "$release"; then 3307 1.2 agc $ECHO "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 3308 1.1 lukem fi 3309 1.1 lukem else 3310 1.1 lukem 3311 1.1 lukem # Parse the version information argument. 3312 1.1 lukem save_ifs="$IFS"; IFS=':' 3313 1.1 lukem set dummy $vinfo 0 0 0 3314 1.1 lukem IFS="$save_ifs" 3315 1.1 lukem 3316 1.1 lukem if test -n "$8"; then 3317 1.2 agc $ECHO "$modename: too many parameters to \`-version-info'" 1>&2 3318 1.2 agc $ECHO "$help" 1>&2 3319 1.1 lukem exit $EXIT_FAILURE 3320 1.1 lukem fi 3321 1.1 lukem 3322 1.1 lukem # convert absolute version numbers to libtool ages 3323 1.1 lukem # this retains compatibility with .la files and attempts 3324 1.1 lukem # to make the code below a bit more comprehensible 3325 1.1 lukem 3326 1.1 lukem case $vinfo_number in 3327 1.1 lukem yes) 3328 1.1 lukem number_major="$2" 3329 1.1 lukem number_minor="$3" 3330 1.1 lukem number_revision="$4" 3331 1.1 lukem # 3332 1.1 lukem # There are really only two kinds -- those that 3333 1.1 lukem # use the current revision as the major version 3334 1.1 lukem # and those that subtract age and use age as 3335 1.1 lukem # a minor version. But, then there is irix 3336 1.1 lukem # which has an extra 1 added just for fun 3337 1.1 lukem # 3338 1.1 lukem case $version_type in 3339 1.1 lukem darwin|linux|osf|windows|none) 3340 1.1 lukem current=`expr $number_major + $number_minor` 3341 1.1 lukem age="$number_minor" 3342 1.1 lukem revision="$number_revision" 3343 1.1 lukem ;; 3344 1.1 lukem freebsd-aout|freebsd-elf|sunos) 3345 1.1 lukem current="$number_major" 3346 1.1 lukem revision="$number_minor" 3347 1.1 lukem age="0" 3348 1.1 lukem ;; 3349 1.1 lukem irix|nonstopux) 3350 1.1 lukem current=`expr $number_major + $number_minor` 3351 1.1 lukem age="$number_minor" 3352 1.1 lukem revision="$number_minor" 3353 1.1 lukem lt_irix_increment=no 3354 1.1 lukem ;; 3355 1.1 lukem esac 3356 1.1 lukem ;; 3357 1.1 lukem no) 3358 1.1 lukem current="$2" 3359 1.1 lukem revision="$3" 3360 1.1 lukem age="$4" 3361 1.1 lukem ;; 3362 1.1 lukem esac 3363 1.1 lukem 3364 1.1 lukem # Check that each of the things are valid numbers. 3365 1.1 lukem case $current in 3366 1.1 lukem 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]) ;; 3367 1.1 lukem *) 3368 1.2 agc $ECHO "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 3369 1.2 agc $ECHO "$modename: \`$vinfo' is not valid version information" 1>&2 3370 1.1 lukem exit $EXIT_FAILURE 3371 1.1 lukem ;; 3372 1.1 lukem esac 3373 1.1 lukem 3374 1.1 lukem case $revision in 3375 1.1 lukem 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]) ;; 3376 1.1 lukem *) 3377 1.2 agc $ECHO "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 3378 1.2 agc $ECHO "$modename: \`$vinfo' is not valid version information" 1>&2 3379 1.1 lukem exit $EXIT_FAILURE 3380 1.1 lukem ;; 3381 1.1 lukem esac 3382 1.1 lukem 3383 1.1 lukem case $age in 3384 1.1 lukem 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]) ;; 3385 1.1 lukem *) 3386 1.2 agc $ECHO "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 3387 1.2 agc $ECHO "$modename: \`$vinfo' is not valid version information" 1>&2 3388 1.1 lukem exit $EXIT_FAILURE 3389 1.1 lukem ;; 3390 1.1 lukem esac 3391 1.1 lukem 3392 1.1 lukem if test "$age" -gt "$current"; then 3393 1.2 agc $ECHO "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 3394 1.2 agc $ECHO "$modename: \`$vinfo' is not valid version information" 1>&2 3395 1.1 lukem exit $EXIT_FAILURE 3396 1.1 lukem fi 3397 1.1 lukem 3398 1.1 lukem # Calculate the version variables. 3399 1.1 lukem major= 3400 1.1 lukem versuffix= 3401 1.1 lukem versuffix2= 3402 1.1 lukem verstring= 3403 1.1 lukem case $version_type in 3404 1.1 lukem none) ;; 3405 1.1 lukem 3406 1.1 lukem darwin) 3407 1.1 lukem # Like Linux, but with the current version available in 3408 1.1 lukem # verstring for coding it into the library header 3409 1.1 lukem major=.`expr $current - $age` 3410 1.1 lukem versuffix="$major.$age.$revision" 3411 1.1 lukem # Darwin ld doesn't like 0 for these options... 3412 1.1 lukem minor_current=`expr $current + 1` 3413 1.1 lukem xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" 3414 1.1 lukem verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" 3415 1.1 lukem ;; 3416 1.1 lukem 3417 1.1 lukem freebsd-aout) 3418 1.1 lukem major=".$current" 3419 1.1 lukem versuffix=".$current.$revision"; 3420 1.1 lukem ;; 3421 1.1 lukem 3422 1.1 lukem freebsd-elf) 3423 1.1 lukem major=".$current" 3424 1.1 lukem versuffix=".$current"; 3425 1.1 lukem ;; 3426 1.1 lukem 3427 1.1 lukem irix | nonstopux) 3428 1.1 lukem if test "X$lt_irix_increment" = "Xno"; then 3429 1.1 lukem major=`expr $current - $age` 3430 1.1 lukem else 3431 1.1 lukem major=`expr $current - $age + 1` 3432 1.1 lukem fi 3433 1.1 lukem case $version_type in 3434 1.1 lukem nonstopux) verstring_prefix=nonstopux ;; 3435 1.1 lukem *) verstring_prefix=sgi ;; 3436 1.1 lukem esac 3437 1.1 lukem verstring="$verstring_prefix$major.$revision" 3438 1.1 lukem 3439 1.1 lukem # Add in all the interfaces that we are compatible with. 3440 1.1 lukem loop=$revision 3441 1.1 lukem while test "$loop" -ne 0; do 3442 1.1 lukem iface=`expr $revision - $loop` 3443 1.1 lukem loop=`expr $loop - 1` 3444 1.1 lukem verstring="$verstring_prefix$major.$iface:$verstring" 3445 1.1 lukem done 3446 1.1 lukem 3447 1.1 lukem # Before this point, $major must not contain `.'. 3448 1.1 lukem major=.$major 3449 1.1 lukem versuffix="$major.$revision" 3450 1.1 lukem ;; 3451 1.1 lukem 3452 1.1 lukem linux) 3453 1.1 lukem major=.`expr $current - $age` 3454 1.1 lukem versuffix="$major.$age.$revision" 3455 1.1 lukem versuffix2="$major.$age" 3456 1.1 lukem ;; 3457 1.1 lukem 3458 1.1 lukem osf) 3459 1.1 lukem major=.`expr $current - $age` 3460 1.1 lukem versuffix=".$current.$age.$revision" 3461 1.1 lukem verstring="$current.$age.$revision" 3462 1.1 lukem 3463 1.1 lukem # Add in all the interfaces that we are compatible with. 3464 1.1 lukem loop=$age 3465 1.1 lukem while test "$loop" -ne 0; do 3466 1.1 lukem iface=`expr $current - $loop` 3467 1.1 lukem loop=`expr $loop - 1` 3468 1.1 lukem verstring="$verstring:${iface}.0" 3469 1.1 lukem done 3470 1.1 lukem 3471 1.1 lukem # Make executables depend on our current version. 3472 1.1 lukem verstring="$verstring:${current}.0" 3473 1.1 lukem ;; 3474 1.1 lukem 3475 1.1 lukem sunos) 3476 1.1 lukem major=".$current" 3477 1.1 lukem versuffix=".$current.$revision" 3478 1.1 lukem ;; 3479 1.1 lukem 3480 1.1 lukem windows) 3481 1.1 lukem # Use '-' rather than '.', since we only want one 3482 1.1 lukem # extension on DOS 8.3 filesystems. 3483 1.1 lukem major=`expr $current - $age` 3484 1.1 lukem versuffix="-$major" 3485 1.1 lukem ;; 3486 1.1 lukem 3487 1.1 lukem *) 3488 1.2 agc $ECHO "$modename: unknown library version type \`$version_type'" 1>&2 3489 1.2 agc $ECHO "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 3490 1.1 lukem exit $EXIT_FAILURE 3491 1.1 lukem ;; 3492 1.1 lukem esac 3493 1.1 lukem 3494 1.1 lukem # Clear the version info if we defaulted, and they specified a release. 3495 1.1 lukem if test -z "$vinfo" && test -n "$release"; then 3496 1.1 lukem major= 3497 1.1 lukem case $version_type in 3498 1.1 lukem darwin) 3499 1.1 lukem # we can't check for "0.0" in archive_cmds due to quoting 3500 1.1 lukem # problems, so we reset it completely 3501 1.1 lukem verstring= 3502 1.1 lukem ;; 3503 1.1 lukem *) 3504 1.1 lukem verstring="0.0" 3505 1.1 lukem ;; 3506 1.1 lukem esac 3507 1.1 lukem if test "$need_version" = no; then 3508 1.1 lukem versuffix= 3509 1.1 lukem else 3510 1.1 lukem versuffix=".0.0" 3511 1.1 lukem fi 3512 1.1 lukem fi 3513 1.1 lukem 3514 1.1 lukem # Remove version info from name if versioning should be avoided 3515 1.1 lukem if test "$avoid_version" = yes && test "$need_version" = no; then 3516 1.1 lukem major= 3517 1.1 lukem versuffix= 3518 1.1 lukem versuffix2= 3519 1.1 lukem verstring="" 3520 1.1 lukem fi 3521 1.1 lukem 3522 1.1 lukem # Check to see if the archive will have undefined symbols. 3523 1.1 lukem if test "$allow_undefined" = yes; then 3524 1.1 lukem if test "$allow_undefined_flag" = unsupported; then 3525 1.2 agc $ECHO "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 3526 1.1 lukem build_libtool_libs=no 3527 1.1 lukem build_old_libs=yes 3528 1.1 lukem fi 3529 1.1 lukem else 3530 1.1 lukem # Don't allow undefined symbols. 3531 1.1 lukem allow_undefined_flag="$no_undefined_flag" 3532 1.1 lukem fi 3533 1.1 lukem fi 3534 1.1 lukem 3535 1.1 lukem if test "$mode" != relink; then 3536 1.1 lukem # Remove our outputs, but don't remove object files since they 3537 1.1 lukem # may have been created when compiling PIC objects. 3538 1.1 lukem removelist= 3539 1.2 agc tempremovelist=`$ECHO "$output_objdir/*"` 3540 1.1 lukem for p in $tempremovelist; do 3541 1.1 lukem case $p in 3542 1.1 lukem *.$objext) 3543 1.1 lukem ;; 3544 1.1 lukem $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) 3545 1.1 lukem if test "X$precious_files_regex" != "X"; then 3546 1.1 lukem if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 3547 1.1 lukem then 3548 1.1 lukem continue 3549 1.1 lukem fi 3550 1.1 lukem fi 3551 1.1 lukem removelist="$removelist $p" 3552 1.1 lukem ;; 3553 1.1 lukem *) ;; 3554 1.1 lukem esac 3555 1.1 lukem done 3556 1.1 lukem if test -n "$removelist"; then 3557 1.1 lukem $show "${rm}r $removelist" 3558 1.1 lukem $run ${rm}r $removelist 3559 1.1 lukem fi 3560 1.1 lukem fi 3561 1.1 lukem 3562 1.1 lukem # Now set the variables for building old libraries. 3563 1.1 lukem if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then 3564 1.1 lukem oldlibs="$oldlibs $output_objdir/$libname.$libext" 3565 1.1 lukem 3566 1.1 lukem # Transform .lo files to .o files. 3567 1.2 agc oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` 3568 1.1 lukem fi 3569 1.1 lukem 3570 1.1 lukem # Eliminate all temporary directories. 3571 1.1 lukem #for path in $notinst_path; do 3572 1.2 agc # lib_search_path=`$ECHO "$lib_search_path " | ${SED} -e "s% $path % %g"` 3573 1.2 agc # deplibs=`$ECHO "$deplibs " | ${SED} -e "s% -L$path % %g"` 3574 1.2 agc # dependency_libs=`$ECHO "$dependency_libs " | ${SED} -e "s% -L$path % %g"` 3575 1.1 lukem #done 3576 1.1 lukem 3577 1.1 lukem if test -n "$xrpath"; then 3578 1.1 lukem # If the user specified any rpath flags, then add them. 3579 1.1 lukem temp_xrpath= 3580 1.1 lukem for libdir in $xrpath; do 3581 1.1 lukem temp_xrpath="$temp_xrpath -R$libdir" 3582 1.1 lukem case "$finalize_rpath " in 3583 1.1 lukem *" $libdir "*) ;; 3584 1.1 lukem *) finalize_rpath="$finalize_rpath $libdir" ;; 3585 1.1 lukem esac 3586 1.1 lukem done 3587 1.1 lukem if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then 3588 1.1 lukem dependency_libs="$temp_xrpath $dependency_libs" 3589 1.1 lukem fi 3590 1.1 lukem fi 3591 1.1 lukem 3592 1.1 lukem # Make sure dlfiles contains only unique files that won't be dlpreopened 3593 1.1 lukem old_dlfiles="$dlfiles" 3594 1.1 lukem dlfiles= 3595 1.1 lukem for lib in $old_dlfiles; do 3596 1.1 lukem case " $dlprefiles $dlfiles " in 3597 1.1 lukem *" $lib "*) ;; 3598 1.1 lukem *) dlfiles="$dlfiles $lib" ;; 3599 1.1 lukem esac 3600 1.1 lukem done 3601 1.1 lukem 3602 1.1 lukem # Make sure dlprefiles contains only unique files 3603 1.1 lukem old_dlprefiles="$dlprefiles" 3604 1.1 lukem dlprefiles= 3605 1.1 lukem for lib in $old_dlprefiles; do 3606 1.1 lukem case "$dlprefiles " in 3607 1.1 lukem *" $lib "*) ;; 3608 1.1 lukem *) dlprefiles="$dlprefiles $lib" ;; 3609 1.1 lukem esac 3610 1.1 lukem done 3611 1.1 lukem 3612 1.1 lukem if test "$build_libtool_libs" = yes; then 3613 1.1 lukem if test -n "$rpath"; then 3614 1.1 lukem case $host in 3615 1.1 lukem *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) 3616 1.1 lukem # these systems don't actually have a c library (as such)! 3617 1.1 lukem ;; 3618 1.1 lukem *-*-rhapsody* | *-*-darwin1.[012]) 3619 1.1 lukem # Rhapsody C library is in the System framework 3620 1.1 lukem deplibs="$deplibs -framework System" 3621 1.1 lukem ;; 3622 1.1 lukem *-*-netbsd*) 3623 1.1 lukem # Don't link with libc until the a.out ld.so is fixed. 3624 1.1 lukem ;; 3625 1.1 lukem *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) 3626 1.1 lukem # Do not include libc due to us having libc/libc_r. 3627 1.1 lukem ;; 3628 1.1 lukem *-*-sco3.2v5* | *-*-sco5v6*) 3629 1.1 lukem # Causes problems with __ctype 3630 1.1 lukem ;; 3631 1.1 lukem *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) 3632 1.1 lukem # Compiler inserts libc in the correct place for threads to work 3633 1.1 lukem ;; 3634 1.1 lukem *) 3635 1.1 lukem # Add libc to deplibs on all other systems if necessary. 3636 1.1 lukem if test "$build_libtool_need_lc" = "yes"; then 3637 1.1 lukem deplibs="$deplibs -lc" 3638 1.1 lukem fi 3639 1.1 lukem ;; 3640 1.1 lukem esac 3641 1.1 lukem fi 3642 1.1 lukem 3643 1.1 lukem # Transform deplibs into only deplibs that can be linked in shared. 3644 1.1 lukem name_save=$name 3645 1.1 lukem libname_save=$libname 3646 1.1 lukem release_save=$release 3647 1.1 lukem versuffix_save=$versuffix 3648 1.1 lukem major_save=$major 3649 1.1 lukem # I'm not sure if I'm treating the release correctly. I think 3650 1.1 lukem # release should show up in the -l (ie -lgmp5) so we don't want to 3651 1.1 lukem # add it in twice. Is that correct? 3652 1.1 lukem release="" 3653 1.1 lukem versuffix="" 3654 1.1 lukem major="" 3655 1.1 lukem newdeplibs= 3656 1.1 lukem droppeddeps=no 3657 1.1 lukem case $deplibs_check_method in 3658 1.1 lukem pass_all) 3659 1.1 lukem # Don't check for shared/static. Everything works. 3660 1.1 lukem # This might be a little naive. We might want to check 3661 1.1 lukem # whether the library exists or not. But this is on 3662 1.1 lukem # osf3 & osf4 and I'm not really sure... Just 3663 1.1 lukem # implementing what was already the behavior. 3664 1.1 lukem newdeplibs=$deplibs 3665 1.1 lukem ;; 3666 1.1 lukem test_compile) 3667 1.1 lukem # This code stresses the "libraries are programs" paradigm to its 3668 1.1 lukem # limits. Maybe even breaks it. We compile a program, linking it 3669 1.1 lukem # against the deplibs as a proxy for the library. Then we can check 3670 1.1 lukem # whether they linked in statically or dynamically with ldd. 3671 1.1 lukem $rm conftest.c 3672 1.1 lukem cat > conftest.c <<EOF 3673 1.1 lukem int main() { return 0; } 3674 1.1 lukem EOF 3675 1.1 lukem $rm conftest 3676 1.1 lukem if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then 3677 1.1 lukem ldd_output=`ldd conftest` 3678 1.1 lukem for i in $deplibs; do 3679 1.1 lukem name=`expr $i : '-l\(.*\)'` 3680 1.1 lukem # If $name is empty we are operating on a -L argument. 3681 1.1 lukem if test "$name" != "" && test "$name" != "0"; then 3682 1.1 lukem if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 3683 1.1 lukem case " $predeps $postdeps " in 3684 1.1 lukem *" $i "*) 3685 1.1 lukem newdeplibs="$newdeplibs $i" 3686 1.1 lukem i="" 3687 1.1 lukem ;; 3688 1.1 lukem esac 3689 1.1 lukem fi 3690 1.1 lukem if test -n "$i" ; then 3691 1.2 agc libname=`eval \\$ECHO \"$libname_spec\"` 3692 1.2 agc deplib_matches=`eval \\$ECHO \"$library_names_spec\"` 3693 1.1 lukem set dummy $deplib_matches 3694 1.1 lukem deplib_match=$2 3695 1.1 lukem if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then 3696 1.1 lukem newdeplibs="$newdeplibs $i" 3697 1.1 lukem else 3698 1.1 lukem droppeddeps=yes 3699 1.2 agc $ECHO 3700 1.2 agc $ECHO "*** Warning: dynamic linker does not accept needed library $i." 3701 1.2 agc $ECHO "*** I have the capability to make that library automatically link in when" 3702 1.2 agc $ECHO "*** you link to this library. But I can only do this if you have a" 3703 1.2 agc $ECHO "*** shared version of the library, which I believe you do not have" 3704 1.2 agc $ECHO "*** because a test_compile did reveal that the linker did not use it for" 3705 1.2 agc $ECHO "*** its dynamic dependency list that programs get resolved with at runtime." 3706 1.1 lukem fi 3707 1.1 lukem fi 3708 1.1 lukem else 3709 1.1 lukem newdeplibs="$newdeplibs $i" 3710 1.1 lukem fi 3711 1.1 lukem done 3712 1.1 lukem else 3713 1.1 lukem # Error occurred in the first compile. Let's try to salvage 3714 1.1 lukem # the situation: Compile a separate program for each library. 3715 1.1 lukem for i in $deplibs; do 3716 1.1 lukem name=`expr $i : '-l\(.*\)'` 3717 1.1 lukem # If $name is empty we are operating on a -L argument. 3718 1.1 lukem if test "$name" != "" && test "$name" != "0"; then 3719 1.1 lukem $rm conftest 3720 1.1 lukem if $LTCC $LTCFLAGS -o conftest conftest.c $i; then 3721 1.1 lukem ldd_output=`ldd conftest` 3722 1.1 lukem if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 3723 1.1 lukem case " $predeps $postdeps " in 3724 1.1 lukem *" $i "*) 3725 1.1 lukem newdeplibs="$newdeplibs $i" 3726 1.1 lukem i="" 3727 1.1 lukem ;; 3728 1.1 lukem esac 3729 1.1 lukem fi 3730 1.1 lukem if test -n "$i" ; then 3731 1.2 agc libname=`eval \\$ECHO \"$libname_spec\"` 3732 1.2 agc deplib_matches=`eval \\$ECHO \"$library_names_spec\"` 3733 1.1 lukem set dummy $deplib_matches 3734 1.1 lukem deplib_match=$2 3735 1.1 lukem if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then 3736 1.1 lukem newdeplibs="$newdeplibs $i" 3737 1.1 lukem else 3738 1.1 lukem droppeddeps=yes 3739 1.2 agc $ECHO 3740 1.2 agc $ECHO "*** Warning: dynamic linker does not accept needed library $i." 3741 1.2 agc $ECHO "*** I have the capability to make that library automatically link in when" 3742 1.2 agc $ECHO "*** you link to this library. But I can only do this if you have a" 3743 1.2 agc $ECHO "*** shared version of the library, which you do not appear to have" 3744 1.2 agc $ECHO "*** because a test_compile did reveal that the linker did not use this one" 3745 1.2 agc $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime." 3746 1.1 lukem fi 3747 1.1 lukem fi 3748 1.1 lukem else 3749 1.1 lukem droppeddeps=yes 3750 1.2 agc $ECHO 3751 1.2 agc $ECHO "*** Warning! Library $i is needed by this library but I was not able to" 3752 1.2 agc $ECHO "*** make it link in! You will probably need to install it or some" 3753 1.2 agc $ECHO "*** library that it depends on before this library will be fully" 3754 1.2 agc $ECHO "*** functional. Installing it before continuing would be even better." 3755 1.1 lukem fi 3756 1.1 lukem else 3757 1.1 lukem newdeplibs="$newdeplibs $i" 3758 1.1 lukem fi 3759 1.1 lukem done 3760 1.1 lukem fi 3761 1.1 lukem ;; 3762 1.1 lukem file_magic*) 3763 1.1 lukem set dummy $deplibs_check_method 3764 1.1 lukem file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 3765 1.1 lukem for a_deplib in $deplibs; do 3766 1.1 lukem name=`expr $a_deplib : '-l\(.*\)'` 3767 1.1 lukem # If $name is empty we are operating on a -L argument. 3768 1.1 lukem if test "$name" != "" && test "$name" != "0"; then 3769 1.1 lukem if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 3770 1.1 lukem case " $predeps $postdeps " in 3771 1.1 lukem *" $a_deplib "*) 3772 1.1 lukem newdeplibs="$newdeplibs $a_deplib" 3773 1.1 lukem a_deplib="" 3774 1.1 lukem ;; 3775 1.1 lukem esac 3776 1.1 lukem fi 3777 1.1 lukem if test -n "$a_deplib" ; then 3778 1.2 agc libname=`eval \\$ECHO \"$libname_spec\"` 3779 1.1 lukem for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do 3780 1.1 lukem potential_libs=`ls $i/$libname[.-]* 2>/dev/null` 3781 1.1 lukem for potent_lib in $potential_libs; do 3782 1.1 lukem # Follow soft links. 3783 1.1 lukem if ls -lLd "$potent_lib" 2>/dev/null \ 3784 1.1 lukem | grep " -> " >/dev/null; then 3785 1.1 lukem continue 3786 1.1 lukem fi 3787 1.1 lukem # The statement above tries to avoid entering an 3788 1.1 lukem # endless loop below, in case of cyclic links. 3789 1.1 lukem # We might still enter an endless loop, since a link 3790 1.1 lukem # loop can be closed while we follow links, 3791 1.1 lukem # but so what? 3792 1.1 lukem potlib="$potent_lib" 3793 1.1 lukem while test -h "$potlib" 2>/dev/null; do 3794 1.1 lukem potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` 3795 1.1 lukem case $potliblink in 3796 1.1 lukem [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; 3797 1.2 agc *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; 3798 1.1 lukem esac 3799 1.1 lukem done 3800 1.1 lukem if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ 3801 1.1 lukem | ${SED} 10q \ 3802 1.1 lukem | $EGREP "$file_magic_regex" > /dev/null; then 3803 1.1 lukem newdeplibs="$newdeplibs $a_deplib" 3804 1.1 lukem a_deplib="" 3805 1.1 lukem break 2 3806 1.1 lukem fi 3807 1.1 lukem done 3808 1.1 lukem done 3809 1.1 lukem fi 3810 1.1 lukem if test -n "$a_deplib" ; then 3811 1.1 lukem droppeddeps=yes 3812 1.2 agc $ECHO 3813 1.2 agc $ECHO "*** Warning: linker path does not have real file for library $a_deplib." 3814 1.2 agc $ECHO "*** I have the capability to make that library automatically link in when" 3815 1.2 agc $ECHO "*** you link to this library. But I can only do this if you have a" 3816 1.2 agc $ECHO "*** shared version of the library, which you do not appear to have" 3817 1.2 agc $ECHO "*** because I did check the linker path looking for a file starting" 3818 1.1 lukem if test -z "$potlib" ; then 3819 1.2 agc $ECHO "*** with $libname but no candidates were found. (...for file magic test)" 3820 1.1 lukem else 3821 1.2 agc $ECHO "*** with $libname and none of the candidates passed a file format test" 3822 1.2 agc $ECHO "*** using a file magic. Last file checked: $potlib" 3823 1.1 lukem fi 3824 1.1 lukem fi 3825 1.1 lukem else 3826 1.1 lukem # Add a -L argument. 3827 1.1 lukem newdeplibs="$newdeplibs $a_deplib" 3828 1.1 lukem fi 3829 1.1 lukem done # Gone through all deplibs. 3830 1.1 lukem ;; 3831 1.1 lukem match_pattern*) 3832 1.1 lukem set dummy $deplibs_check_method 3833 1.1 lukem match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 3834 1.1 lukem for a_deplib in $deplibs; do 3835 1.1 lukem name=`expr $a_deplib : '-l\(.*\)'` 3836 1.1 lukem # If $name is empty we are operating on a -L argument. 3837 1.1 lukem if test -n "$name" && test "$name" != "0"; then 3838 1.1 lukem if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 3839 1.1 lukem case " $predeps $postdeps " in 3840 1.1 lukem *" $a_deplib "*) 3841 1.1 lukem newdeplibs="$newdeplibs $a_deplib" 3842 1.1 lukem a_deplib="" 3843 1.1 lukem ;; 3844 1.1 lukem esac 3845 1.1 lukem fi 3846 1.1 lukem if test -n "$a_deplib" ; then 3847 1.2 agc libname=`eval \\$ECHO \"$libname_spec\"` 3848 1.1 lukem for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do 3849 1.1 lukem potential_libs=`ls $i/$libname[.-]* 2>/dev/null` 3850 1.1 lukem for potent_lib in $potential_libs; do 3851 1.1 lukem potlib="$potent_lib" # see symlink-check above in file_magic test 3852 1.2 agc if eval $ECHO \"$potent_lib\" 2>/dev/null \ 3853 1.1 lukem | ${SED} 10q \ 3854 1.1 lukem | $EGREP "$match_pattern_regex" > /dev/null; then 3855 1.1 lukem newdeplibs="$newdeplibs $a_deplib" 3856 1.1 lukem a_deplib="" 3857 1.1 lukem break 2 3858 1.1 lukem fi 3859 1.1 lukem done 3860 1.1 lukem done 3861 1.1 lukem fi 3862 1.1 lukem if test -n "$a_deplib" ; then 3863 1.1 lukem droppeddeps=yes 3864 1.2 agc $ECHO 3865 1.2 agc $ECHO "*** Warning: linker path does not have real file for library $a_deplib." 3866 1.2 agc $ECHO "*** I have the capability to make that library automatically link in when" 3867 1.2 agc $ECHO "*** you link to this library. But I can only do this if you have a" 3868 1.2 agc $ECHO "*** shared version of the library, which you do not appear to have" 3869 1.2 agc $ECHO "*** because I did check the linker path looking for a file starting" 3870 1.1 lukem if test -z "$potlib" ; then 3871 1.2 agc $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" 3872 1.1 lukem else 3873 1.2 agc $ECHO "*** with $libname and none of the candidates passed a file format test" 3874 1.2 agc $ECHO "*** using a regex pattern. Last file checked: $potlib" 3875 1.1 lukem fi 3876 1.1 lukem fi 3877 1.1 lukem else 3878 1.1 lukem # Add a -L argument. 3879 1.1 lukem newdeplibs="$newdeplibs $a_deplib" 3880 1.1 lukem fi 3881 1.1 lukem done # Gone through all deplibs. 3882 1.1 lukem ;; 3883 1.1 lukem none | unknown | *) 3884 1.1 lukem newdeplibs="" 3885 1.2 agc tmp_deplibs=`$ECHO "X $deplibs" | $Xsed -e 's/ -lc$//' \ 3886 1.1 lukem -e 's/ -[LR][^ ]*//g'` 3887 1.1 lukem if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 3888 1.1 lukem for i in $predeps $postdeps ; do 3889 1.1 lukem # can't use Xsed below, because $i might contain '/' 3890 1.2 agc tmp_deplibs=`$ECHO "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` 3891 1.1 lukem done 3892 1.1 lukem fi 3893 1.2 agc if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ 3894 1.1 lukem | grep . >/dev/null; then 3895 1.2 agc $ECHO 3896 1.1 lukem if test "X$deplibs_check_method" = "Xnone"; then 3897 1.2 agc $ECHO "*** Warning: inter-library dependencies are not supported in this platform." 3898 1.1 lukem else 3899 1.2 agc $ECHO "*** Warning: inter-library dependencies are not known to be supported." 3900 1.1 lukem fi 3901 1.2 agc $ECHO "*** All declared inter-library dependencies are being dropped." 3902 1.1 lukem droppeddeps=yes 3903 1.1 lukem fi 3904 1.1 lukem ;; 3905 1.1 lukem esac 3906 1.1 lukem versuffix=$versuffix_save 3907 1.1 lukem major=$major_save 3908 1.1 lukem release=$release_save 3909 1.1 lukem libname=$libname_save 3910 1.1 lukem name=$name_save 3911 1.1 lukem 3912 1.1 lukem case $host in 3913 1.1 lukem *-*-rhapsody* | *-*-darwin1.[012]) 3914 1.1 lukem # On Rhapsody replace the C library is the System framework 3915 1.2 agc newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` 3916 1.1 lukem ;; 3917 1.1 lukem esac 3918 1.1 lukem 3919 1.1 lukem if test "$droppeddeps" = yes; then 3920 1.1 lukem if test "$module" = yes; then 3921 1.2 agc $ECHO 3922 1.2 agc $ECHO "*** Warning: libtool could not satisfy all declared inter-library" 3923 1.2 agc $ECHO "*** dependencies of module $libname. Therefore, libtool will create" 3924 1.2 agc $ECHO "*** a static module, that should work as long as the dlopening" 3925 1.2 agc $ECHO "*** application is linked with the -dlopen flag." 3926 1.1 lukem if test -z "$global_symbol_pipe"; then 3927 1.2 agc $ECHO 3928 1.2 agc $ECHO "*** However, this would only work if libtool was able to extract symbol" 3929 1.2 agc $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" 3930 1.2 agc $ECHO "*** not find such a program. So, this module is probably useless." 3931 1.2 agc $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." 3932 1.1 lukem fi 3933 1.1 lukem if test "$build_old_libs" = no; then 3934 1.1 lukem oldlibs="$output_objdir/$libname.$libext" 3935 1.1 lukem build_libtool_libs=module 3936 1.1 lukem build_old_libs=yes 3937 1.1 lukem else 3938 1.1 lukem build_libtool_libs=no 3939 1.1 lukem fi 3940 1.1 lukem else 3941 1.2 agc $ECHO "*** The inter-library dependencies that have been dropped here will be" 3942 1.2 agc $ECHO "*** automatically added whenever a program is linked with this library" 3943 1.2 agc $ECHO "*** or is declared to -dlopen it." 3944 1.1 lukem 3945 1.1 lukem if test "$allow_undefined" = no; then 3946 1.2 agc $ECHO 3947 1.2 agc $ECHO "*** Since this library must not contain undefined symbols," 3948 1.2 agc $ECHO "*** because either the platform does not support them or" 3949 1.2 agc $ECHO "*** it was explicitly requested with -no-undefined," 3950 1.2 agc $ECHO "*** libtool will only create a static version of it." 3951 1.1 lukem if test "$build_old_libs" = no; then 3952 1.1 lukem oldlibs="$output_objdir/$libname.$libext" 3953 1.1 lukem build_libtool_libs=module 3954 1.1 lukem build_old_libs=yes 3955 1.1 lukem else 3956 1.1 lukem build_libtool_libs=no 3957 1.1 lukem fi 3958 1.1 lukem fi 3959 1.1 lukem fi 3960 1.1 lukem fi 3961 1.1 lukem # Done checking deplibs! 3962 1.1 lukem deplibs=$newdeplibs 3963 1.1 lukem fi 3964 1.1 lukem 3965 1.1 lukem 3966 1.1 lukem # move library search paths that coincide with paths to not yet 3967 1.1 lukem # installed libraries to the beginning of the library search list 3968 1.1 lukem new_libs= 3969 1.1 lukem for path in $notinst_path; do 3970 1.1 lukem case " $new_libs " in 3971 1.1 lukem *" -L$path/$objdir "*) ;; 3972 1.1 lukem *) 3973 1.1 lukem case " $deplibs " in 3974 1.1 lukem *" -L$path/$objdir "*) 3975 1.1 lukem new_libs="$new_libs -L$path/$objdir" ;; 3976 1.1 lukem esac 3977 1.1 lukem ;; 3978 1.1 lukem esac 3979 1.1 lukem done 3980 1.1 lukem for deplib in $deplibs; do 3981 1.1 lukem case $deplib in 3982 1.1 lukem -L*) 3983 1.1 lukem case " $new_libs " in 3984 1.1 lukem *" $deplib "*) ;; 3985 1.1 lukem *) new_libs="$new_libs $deplib" ;; 3986 1.1 lukem esac 3987 1.1 lukem ;; 3988 1.1 lukem *) new_libs="$new_libs $deplib" ;; 3989 1.1 lukem esac 3990 1.1 lukem done 3991 1.1 lukem deplibs="$new_libs" 3992 1.1 lukem 3993 1.1 lukem 3994 1.1 lukem # All the library-specific variables (install_libdir is set above). 3995 1.1 lukem library_names= 3996 1.1 lukem old_library= 3997 1.1 lukem dlname= 3998 1.1 lukem 3999 1.1 lukem # Test again, we may have decided not to build it any more 4000 1.1 lukem if test "$build_libtool_libs" = yes; then 4001 1.1 lukem if test "$hardcode_into_libs" = yes; then 4002 1.1 lukem # Hardcode the library paths 4003 1.1 lukem hardcode_libdirs= 4004 1.1 lukem dep_rpath= 4005 1.1 lukem rpath="$finalize_rpath" 4006 1.1 lukem test "$mode" != relink && rpath="$compile_rpath$rpath" 4007 1.1 lukem for libdir in $rpath; do 4008 1.1 lukem if test -n "$hardcode_libdir_flag_spec"; then 4009 1.1 lukem if test -n "$hardcode_libdir_separator"; then 4010 1.1 lukem if test -z "$hardcode_libdirs"; then 4011 1.1 lukem hardcode_libdirs="$libdir" 4012 1.1 lukem else 4013 1.1 lukem # Just accumulate the unique libdirs. 4014 1.1 lukem case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in 4015 1.1 lukem *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) 4016 1.1 lukem ;; 4017 1.1 lukem *) 4018 1.1 lukem hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" 4019 1.1 lukem ;; 4020 1.1 lukem esac 4021 1.1 lukem fi 4022 1.1 lukem else 4023 1.1 lukem eval flag=\"$hardcode_libdir_flag_spec\" 4024 1.1 lukem dep_rpath="$dep_rpath $flag" 4025 1.1 lukem fi 4026 1.1 lukem elif test -n "$runpath_var"; then 4027 1.1 lukem case "$perm_rpath " in 4028 1.1 lukem *" $libdir "*) ;; 4029 1.1 lukem *) perm_rpath="$perm_rpath $libdir" ;; 4030 1.1 lukem esac 4031 1.1 lukem fi 4032 1.1 lukem done 4033 1.1 lukem # Substitute the hardcoded libdirs into the rpath. 4034 1.1 lukem if test -n "$hardcode_libdir_separator" && 4035 1.1 lukem test -n "$hardcode_libdirs"; then 4036 1.1 lukem libdir="$hardcode_libdirs" 4037 1.1 lukem if test -n "$hardcode_libdir_flag_spec_ld"; then 4038 1.1 lukem case $archive_cmds in 4039 1.1 lukem *\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;; 4040 1.1 lukem *) eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;; 4041 1.1 lukem esac 4042 1.1 lukem else 4043 1.1 lukem eval dep_rpath=\"$hardcode_libdir_flag_spec\" 4044 1.1 lukem fi 4045 1.1 lukem fi 4046 1.1 lukem if test -n "$runpath_var" && test -n "$perm_rpath"; then 4047 1.1 lukem # We should set the runpath_var. 4048 1.1 lukem rpath= 4049 1.1 lukem for dir in $perm_rpath; do 4050 1.1 lukem rpath="$rpath$dir:" 4051 1.1 lukem done 4052 1.1 lukem eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" 4053 1.1 lukem fi 4054 1.1 lukem test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" 4055 1.1 lukem fi 4056 1.1 lukem 4057 1.1 lukem shlibpath="$finalize_shlibpath" 4058 1.1 lukem test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" 4059 1.1 lukem if test -n "$shlibpath"; then 4060 1.1 lukem eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" 4061 1.1 lukem fi 4062 1.1 lukem 4063 1.1 lukem # Get the real and link names of the library. 4064 1.1 lukem eval shared_ext=\"$shrext_cmds\" 4065 1.1 lukem eval library_names=\"$library_names_spec\" 4066 1.1 lukem set dummy $library_names 4067 1.1 lukem realname="$2" 4068 1.1 lukem shift; shift 4069 1.1 lukem 4070 1.1 lukem if test -n "$soname_spec"; then 4071 1.1 lukem eval soname=\"$soname_spec\" 4072 1.1 lukem else 4073 1.1 lukem soname="$realname" 4074 1.1 lukem fi 4075 1.1 lukem if test -z "$dlname"; then 4076 1.1 lukem dlname=$soname 4077 1.1 lukem fi 4078 1.1 lukem 4079 1.1 lukem lib="$output_objdir/$realname" 4080 1.1 lukem linknames= 4081 1.1 lukem for link 4082 1.1 lukem do 4083 1.1 lukem linknames="$linknames $link" 4084 1.1 lukem done 4085 1.1 lukem 4086 1.1 lukem # Use standard objects if they are pic 4087 1.2 agc test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` 4088 1.1 lukem 4089 1.1 lukem # Prepare the list of exported symbols 4090 1.1 lukem if test -z "$export_symbols"; then 4091 1.1 lukem if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then 4092 1.1 lukem $show "generating symbol list for \`$libname.la'" 4093 1.1 lukem export_symbols="$output_objdir/$libname.exp" 4094 1.1 lukem $run $rm $export_symbols 4095 1.1 lukem cmds=$export_symbols_cmds 4096 1.1 lukem save_ifs="$IFS"; IFS='~' 4097 1.1 lukem for cmd in $cmds; do 4098 1.1 lukem IFS="$save_ifs" 4099 1.1 lukem eval cmd=\"$cmd\" 4100 1.1 lukem if len=`expr "X$cmd" : ".*"` && 4101 1.1 lukem test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then 4102 1.1 lukem $show "$cmd" 4103 1.1 lukem $run eval "$cmd" || exit $? 4104 1.1 lukem skipped_export=false 4105 1.1 lukem else 4106 1.1 lukem # The command line is too long to execute in one step. 4107 1.1 lukem $show "using reloadable object file for export list..." 4108 1.1 lukem skipped_export=: 4109 1.1 lukem # Break out early, otherwise skipped_export may be 4110 1.1 lukem # set to false by a later but shorter cmd. 4111 1.1 lukem break 4112 1.1 lukem fi 4113 1.1 lukem done 4114 1.1 lukem IFS="$save_ifs" 4115 1.1 lukem if test -n "$export_symbols_regex"; then 4116 1.1 lukem $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" 4117 1.1 lukem $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' 4118 1.1 lukem $show "$mv \"${export_symbols}T\" \"$export_symbols\"" 4119 1.1 lukem $run eval '$mv "${export_symbols}T" "$export_symbols"' 4120 1.1 lukem fi 4121 1.1 lukem fi 4122 1.1 lukem fi 4123 1.1 lukem 4124 1.1 lukem if test -n "$export_symbols" && test -n "$include_expsyms"; then 4125 1.2 agc $run eval '$ECHO "X$include_expsyms" | $SP2NL >> "$export_symbols"' 4126 1.1 lukem fi 4127 1.1 lukem 4128 1.1 lukem tmp_deplibs= 4129 1.1 lukem for test_deplib in $deplibs; do 4130 1.1 lukem case " $convenience " in 4131 1.1 lukem *" $test_deplib "*) ;; 4132 1.1 lukem *) 4133 1.1 lukem tmp_deplibs="$tmp_deplibs $test_deplib" 4134 1.1 lukem ;; 4135 1.1 lukem esac 4136 1.1 lukem done 4137 1.1 lukem deplibs="$tmp_deplibs" 4138 1.1 lukem 4139 1.1 lukem if test -n "$convenience"; then 4140 1.1 lukem if test -n "$whole_archive_flag_spec"; then 4141 1.1 lukem save_libobjs=$libobjs 4142 1.1 lukem eval libobjs=\"\$libobjs $whole_archive_flag_spec\" 4143 1.1 lukem else 4144 1.1 lukem gentop="$output_objdir/${outputname}x" 4145 1.1 lukem generated="$generated $gentop" 4146 1.1 lukem 4147 1.1 lukem func_extract_archives $gentop $convenience 4148 1.1 lukem libobjs="$libobjs $func_extract_archives_result" 4149 1.1 lukem fi 4150 1.1 lukem fi 4151 1.1 lukem 4152 1.1 lukem if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then 4153 1.1 lukem eval flag=\"$thread_safe_flag_spec\" 4154 1.1 lukem linker_flags="$linker_flags $flag" 4155 1.1 lukem fi 4156 1.1 lukem 4157 1.1 lukem # Make a backup of the uninstalled library when relinking 4158 1.1 lukem if test "$mode" = relink; then 4159 1.1 lukem $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? 4160 1.1 lukem fi 4161 1.1 lukem 4162 1.1 lukem # Do each of the archive commands. 4163 1.1 lukem if test "$module" = yes && test -n "$module_cmds" ; then 4164 1.1 lukem if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then 4165 1.1 lukem eval test_cmds=\"$module_expsym_cmds\" 4166 1.1 lukem cmds=$module_expsym_cmds 4167 1.1 lukem else 4168 1.1 lukem eval test_cmds=\"$module_cmds\" 4169 1.1 lukem cmds=$module_cmds 4170 1.1 lukem fi 4171 1.1 lukem else 4172 1.1 lukem if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then 4173 1.1 lukem eval test_cmds=\"$archive_expsym_cmds\" 4174 1.1 lukem cmds=$archive_expsym_cmds 4175 1.1 lukem else 4176 1.1 lukem eval test_cmds=\"$archive_cmds\" 4177 1.1 lukem cmds=$archive_cmds 4178 1.1 lukem fi 4179 1.1 lukem fi 4180 1.1 lukem 4181 1.1 lukem if test "X$skipped_export" != "X:" && 4182 1.1 lukem len=`expr "X$test_cmds" : ".*" 2>/dev/null` && 4183 1.1 lukem test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then 4184 1.1 lukem : 4185 1.1 lukem else 4186 1.1 lukem # The command line is too long to link in one step, link piecewise. 4187 1.2 agc $ECHO "creating reloadable object files..." 4188 1.1 lukem 4189 1.1 lukem # Save the value of $output and $libobjs because we want to 4190 1.1 lukem # use them later. If we have whole_archive_flag_spec, we 4191 1.1 lukem # want to use save_libobjs as it was before 4192 1.1 lukem # whole_archive_flag_spec was expanded, because we can't 4193 1.1 lukem # assume the linker understands whole_archive_flag_spec. 4194 1.1 lukem # This may have to be revisited, in case too many 4195 1.1 lukem # convenience libraries get linked in and end up exceeding 4196 1.1 lukem # the spec. 4197 1.1 lukem if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then 4198 1.1 lukem save_libobjs=$libobjs 4199 1.1 lukem fi 4200 1.1 lukem save_output=$output 4201 1.2 agc output_la=`$ECHO "X$output" | $Xsed -e "$basename"` 4202 1.1 lukem 4203 1.1 lukem # Clear the reloadable object creation command queue and 4204 1.1 lukem # initialize k to one. 4205 1.1 lukem test_cmds= 4206 1.1 lukem concat_cmds= 4207 1.1 lukem objlist= 4208 1.1 lukem delfiles= 4209 1.1 lukem last_robj= 4210 1.1 lukem k=1 4211 1.1 lukem output=$output_objdir/$output_la-${k}.$objext 4212 1.1 lukem # Loop over the list of objects to be linked. 4213 1.1 lukem for obj in $save_libobjs 4214 1.1 lukem do 4215 1.1 lukem eval test_cmds=\"$reload_cmds $objlist $last_robj\" 4216 1.1 lukem if test "X$objlist" = X || 4217 1.1 lukem { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && 4218 1.1 lukem test "$len" -le "$max_cmd_len"; }; then 4219 1.1 lukem objlist="$objlist $obj" 4220 1.1 lukem else 4221 1.1 lukem # The command $test_cmds is almost too long, add a 4222 1.1 lukem # command to the queue. 4223 1.1 lukem if test "$k" -eq 1 ; then 4224 1.1 lukem # The first file doesn't have a previous command to add. 4225 1.1 lukem eval concat_cmds=\"$reload_cmds $objlist $last_robj\" 4226 1.1 lukem else 4227 1.1 lukem # All subsequent reloadable object files will link in 4228 1.1 lukem # the last one created. 4229 1.1 lukem eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" 4230 1.1 lukem fi 4231 1.1 lukem last_robj=$output_objdir/$output_la-${k}.$objext 4232 1.1 lukem k=`expr $k + 1` 4233 1.1 lukem output=$output_objdir/$output_la-${k}.$objext 4234 1.1 lukem objlist=$obj 4235 1.1 lukem len=1 4236 1.1 lukem fi 4237 1.1 lukem done 4238 1.1 lukem # Handle the remaining objects by creating one last 4239 1.1 lukem # reloadable object file. All subsequent reloadable object 4240 1.1 lukem # files will link in the last one created. 4241 1.1 lukem test -z "$concat_cmds" || concat_cmds=$concat_cmds~ 4242 1.1 lukem eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" 4243 1.1 lukem 4244 1.1 lukem if ${skipped_export-false}; then 4245 1.1 lukem $show "generating symbol list for \`$libname.la'" 4246 1.1 lukem export_symbols="$output_objdir/$libname.exp" 4247 1.1 lukem $run $rm $export_symbols 4248 1.1 lukem libobjs=$output 4249 1.1 lukem # Append the command to create the export file. 4250 1.1 lukem eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" 4251 1.1 lukem fi 4252 1.1 lukem 4253 1.1 lukem # Set up a command to remove the reloadable object files 4254 1.1 lukem # after they are used. 4255 1.1 lukem i=0 4256 1.1 lukem while test "$i" -lt "$k" 4257 1.1 lukem do 4258 1.1 lukem i=`expr $i + 1` 4259 1.1 lukem delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" 4260 1.1 lukem done 4261 1.1 lukem 4262 1.2 agc $ECHO "creating a temporary reloadable object file: $output" 4263 1.1 lukem 4264 1.1 lukem # Loop through the commands generated above and execute them. 4265 1.1 lukem save_ifs="$IFS"; IFS='~' 4266 1.1 lukem for cmd in $concat_cmds; do 4267 1.1 lukem IFS="$save_ifs" 4268 1.1 lukem $show "$cmd" 4269 1.1 lukem $run eval "$cmd" || exit $? 4270 1.1 lukem done 4271 1.1 lukem IFS="$save_ifs" 4272 1.1 lukem 4273 1.1 lukem libobjs=$output 4274 1.1 lukem # Restore the value of output. 4275 1.1 lukem output=$save_output 4276 1.1 lukem 4277 1.1 lukem if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then 4278 1.1 lukem eval libobjs=\"\$libobjs $whole_archive_flag_spec\" 4279 1.1 lukem fi 4280 1.1 lukem # Expand the library linking commands again to reset the 4281 1.1 lukem # value of $libobjs for piecewise linking. 4282 1.1 lukem 4283 1.1 lukem # Do each of the archive commands. 4284 1.1 lukem if test "$module" = yes && test -n "$module_cmds" ; then 4285 1.1 lukem if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then 4286 1.1 lukem cmds=$module_expsym_cmds 4287 1.1 lukem else 4288 1.1 lukem cmds=$module_cmds 4289 1.1 lukem fi 4290 1.1 lukem else 4291 1.1 lukem if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then 4292 1.1 lukem cmds=$archive_expsym_cmds 4293 1.1 lukem else 4294 1.1 lukem cmds=$archive_cmds 4295 1.1 lukem fi 4296 1.1 lukem fi 4297 1.1 lukem 4298 1.1 lukem # Append the command to remove the reloadable object files 4299 1.1 lukem # to the just-reset $cmds. 4300 1.1 lukem eval cmds=\"\$cmds~\$rm $delfiles\" 4301 1.1 lukem fi 4302 1.1 lukem save_ifs="$IFS"; IFS='~' 4303 1.1 lukem for cmd in $cmds; do 4304 1.1 lukem IFS="$save_ifs" 4305 1.1 lukem eval cmd=\"$cmd\" 4306 1.1 lukem $show "$cmd" 4307 1.1 lukem $run eval "$cmd" || { 4308 1.1 lukem lt_exit=$? 4309 1.1 lukem 4310 1.1 lukem # Restore the uninstalled library and exit 4311 1.1 lukem if test "$mode" = relink; then 4312 1.1 lukem $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' 4313 1.1 lukem fi 4314 1.1 lukem 4315 1.1 lukem exit $lt_exit 4316 1.1 lukem } 4317 1.1 lukem done 4318 1.1 lukem IFS="$save_ifs" 4319 1.1 lukem 4320 1.1 lukem # Restore the uninstalled library and exit 4321 1.1 lukem if test "$mode" = relink; then 4322 1.1 lukem $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? 4323 1.1 lukem 4324 1.1 lukem if test -n "$convenience"; then 4325 1.1 lukem if test -z "$whole_archive_flag_spec"; then 4326 1.1 lukem $show "${rm}r $gentop" 4327 1.1 lukem $run ${rm}r "$gentop" 4328 1.1 lukem fi 4329 1.1 lukem fi 4330 1.1 lukem 4331 1.1 lukem exit $EXIT_SUCCESS 4332 1.1 lukem fi 4333 1.1 lukem 4334 1.1 lukem # Create links to the real library. 4335 1.1 lukem for linkname in $linknames; do 4336 1.1 lukem if test "$realname" != "$linkname"; then 4337 1.1 lukem $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" 4338 1.1 lukem $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? 4339 1.1 lukem fi 4340 1.1 lukem done 4341 1.1 lukem 4342 1.1 lukem # If -module or -export-dynamic was specified, set the dlname. 4343 1.1 lukem if test "$module" = yes || test "$export_dynamic" = yes; then 4344 1.1 lukem # On all known operating systems, these are identical. 4345 1.1 lukem dlname="$soname" 4346 1.1 lukem fi 4347 1.1 lukem fi 4348 1.1 lukem ;; 4349 1.1 lukem 4350 1.1 lukem obj) 4351 1.1 lukem case " $deplibs" in 4352 1.1 lukem *\ -l* | *\ -L*) 4353 1.2 agc $ECHO "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 ;; 4354 1.1 lukem esac 4355 1.1 lukem 4356 1.1 lukem if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then 4357 1.2 agc $ECHO "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 4358 1.1 lukem fi 4359 1.1 lukem 4360 1.1 lukem if test -n "$rpath"; then 4361 1.2 agc $ECHO "$modename: warning: \`-rpath' is ignored for objects" 1>&2 4362 1.1 lukem fi 4363 1.1 lukem 4364 1.1 lukem if test -n "$xrpath"; then 4365 1.2 agc $ECHO "$modename: warning: \`-R' is ignored for objects" 1>&2 4366 1.1 lukem fi 4367 1.1 lukem 4368 1.1 lukem if test -n "$vinfo"; then 4369 1.2 agc $ECHO "$modename: warning: \`-version-info' is ignored for objects" 1>&2 4370 1.1 lukem fi 4371 1.1 lukem 4372 1.1 lukem if test -n "$release"; then 4373 1.2 agc $ECHO "$modename: warning: \`-release' is ignored for objects" 1>&2 4374 1.1 lukem fi 4375 1.1 lukem 4376 1.1 lukem case $output in 4377 1.1 lukem *.lo) 4378 1.1 lukem if test -n "$objs$old_deplibs"; then 4379 1.2 agc $ECHO "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 4380 1.1 lukem exit $EXIT_FAILURE 4381 1.1 lukem fi 4382 1.1 lukem libobj="$output" 4383 1.2 agc obj=`$ECHO "X$output" | $Xsed -e "$lo2o"` 4384 1.1 lukem ;; 4385 1.1 lukem *) 4386 1.1 lukem libobj= 4387 1.1 lukem obj="$output" 4388 1.1 lukem ;; 4389 1.1 lukem esac 4390 1.1 lukem 4391 1.1 lukem # Delete the old objects. 4392 1.1 lukem $run $rm $obj $libobj 4393 1.1 lukem 4394 1.1 lukem # Objects from convenience libraries. This assumes 4395 1.1 lukem # single-version convenience libraries. Whenever we create 4396 1.1 lukem # different ones for PIC/non-PIC, this we'll have to duplicate 4397 1.1 lukem # the extraction. 4398 1.1 lukem reload_conv_objs= 4399 1.1 lukem gentop= 4400 1.1 lukem # reload_cmds runs $LD directly, so let us get rid of 4401 1.1 lukem # -Wl from whole_archive_flag_spec and hope we can get by with 4402 1.1 lukem # turning comma into space.. 4403 1.1 lukem wl= 4404 1.1 lukem 4405 1.1 lukem if test -n "$convenience"; then 4406 1.1 lukem if test -n "$whole_archive_flag_spec"; then 4407 1.1 lukem eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" 4408 1.2 agc reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` 4409 1.1 lukem else 4410 1.1 lukem gentop="$output_objdir/${obj}x" 4411 1.1 lukem generated="$generated $gentop" 4412 1.1 lukem 4413 1.1 lukem func_extract_archives $gentop $convenience 4414 1.1 lukem reload_conv_objs="$reload_objs $func_extract_archives_result" 4415 1.1 lukem fi 4416 1.1 lukem fi 4417 1.1 lukem 4418 1.1 lukem # Create the old-style object. 4419 1.2 agc 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 4420 1.1 lukem 4421 1.1 lukem output="$obj" 4422 1.1 lukem cmds=$reload_cmds 4423 1.1 lukem save_ifs="$IFS"; IFS='~' 4424 1.1 lukem for cmd in $cmds; do 4425 1.1 lukem IFS="$save_ifs" 4426 1.1 lukem eval cmd=\"$cmd\" 4427 1.1 lukem $show "$cmd" 4428 1.1 lukem $run eval "$cmd" || exit $? 4429 1.1 lukem done 4430 1.1 lukem IFS="$save_ifs" 4431 1.1 lukem 4432 1.1 lukem # Exit if we aren't doing a library object file. 4433 1.1 lukem if test -z "$libobj"; then 4434 1.1 lukem if test -n "$gentop"; then 4435 1.1 lukem $show "${rm}r $gentop" 4436 1.1 lukem $run ${rm}r $gentop 4437 1.1 lukem fi 4438 1.1 lukem 4439 1.1 lukem exit $EXIT_SUCCESS 4440 1.1 lukem fi 4441 1.1 lukem 4442 1.1 lukem if test "$build_libtool_libs" != yes; then 4443 1.1 lukem if test -n "$gentop"; then 4444 1.1 lukem $show "${rm}r $gentop" 4445 1.1 lukem $run ${rm}r $gentop 4446 1.1 lukem fi 4447 1.1 lukem 4448 1.1 lukem # Create an invalid libtool object if no PIC, so that we don't 4449 1.1 lukem # accidentally link it into a program. 4450 1.1 lukem # $show "echo timestamp > $libobj" 4451 1.1 lukem # $run eval "echo timestamp > $libobj" || exit $? 4452 1.1 lukem exit $EXIT_SUCCESS 4453 1.1 lukem fi 4454 1.1 lukem 4455 1.1 lukem if test -n "$pic_flag" || test "$pic_mode" != default; then 4456 1.1 lukem # Only do commands if we really have different PIC objects. 4457 1.1 lukem reload_objs="$libobjs $reload_conv_objs" 4458 1.1 lukem output="$libobj" 4459 1.1 lukem cmds=$reload_cmds 4460 1.1 lukem save_ifs="$IFS"; IFS='~' 4461 1.1 lukem for cmd in $cmds; do 4462 1.1 lukem IFS="$save_ifs" 4463 1.1 lukem eval cmd=\"$cmd\" 4464 1.1 lukem $show "$cmd" 4465 1.1 lukem $run eval "$cmd" || exit $? 4466 1.1 lukem done 4467 1.1 lukem IFS="$save_ifs" 4468 1.1 lukem fi 4469 1.1 lukem 4470 1.1 lukem if test -n "$gentop"; then 4471 1.1 lukem $show "${rm}r $gentop" 4472 1.1 lukem $run ${rm}r $gentop 4473 1.1 lukem fi 4474 1.1 lukem 4475 1.1 lukem exit $EXIT_SUCCESS 4476 1.1 lukem ;; 4477 1.1 lukem 4478 1.1 lukem prog) 4479 1.1 lukem case $host in 4480 1.2 agc *cygwin*) output=`$ECHO $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; 4481 1.1 lukem esac 4482 1.1 lukem if test -n "$vinfo"; then 4483 1.2 agc $ECHO "$modename: warning: \`-version-info' is ignored for programs" 1>&2 4484 1.1 lukem fi 4485 1.1 lukem 4486 1.1 lukem if test -n "$release"; then 4487 1.2 agc $ECHO "$modename: warning: \`-release' is ignored for programs" 1>&2 4488 1.1 lukem fi 4489 1.1 lukem 4490 1.1 lukem if test "$preload" = yes; then 4491 1.1 lukem if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && 4492 1.1 lukem test "$dlopen_self_static" = unknown; then 4493 1.2 agc $ECHO "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." 4494 1.1 lukem fi 4495 1.1 lukem fi 4496 1.1 lukem 4497 1.1 lukem case $host in 4498 1.1 lukem *-*-rhapsody* | *-*-darwin1.[012]) 4499 1.1 lukem # On Rhapsody replace the C library is the System framework 4500 1.2 agc compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` 4501 1.2 agc finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` 4502 1.1 lukem ;; 4503 1.1 lukem esac 4504 1.1 lukem 4505 1.1 lukem case $host in 4506 1.1 lukem *darwin*) 4507 1.1 lukem # Don't allow lazy linking, it breaks C++ global constructors 4508 1.1 lukem if test "$tagname" = CXX ; then 4509 1.1 lukem compile_command="$compile_command ${wl}-bind_at_load" 4510 1.1 lukem finalize_command="$finalize_command ${wl}-bind_at_load" 4511 1.1 lukem fi 4512 1.1 lukem ;; 4513 1.1 lukem esac 4514 1.1 lukem 4515 1.1 lukem 4516 1.1 lukem # move library search paths that coincide with paths to not yet 4517 1.1 lukem # installed libraries to the beginning of the library search list 4518 1.1 lukem new_libs= 4519 1.1 lukem for path in $notinst_path; do 4520 1.1 lukem case " $new_libs " in 4521 1.1 lukem *" -L$path/$objdir "*) ;; 4522 1.1 lukem *) 4523 1.1 lukem case " $compile_deplibs " in 4524 1.1 lukem *" -L$path/$objdir "*) 4525 1.1 lukem new_libs="$new_libs -L$path/$objdir" ;; 4526 1.1 lukem esac 4527 1.1 lukem ;; 4528 1.1 lukem esac 4529 1.1 lukem done 4530 1.1 lukem for deplib in $compile_deplibs; do 4531 1.1 lukem case $deplib in 4532 1.1 lukem -L*) 4533 1.1 lukem case " $new_libs " in 4534 1.1 lukem *" $deplib "*) ;; 4535 1.1 lukem *) new_libs="$new_libs $deplib" ;; 4536 1.1 lukem esac 4537 1.1 lukem ;; 4538 1.1 lukem *) new_libs="$new_libs $deplib" ;; 4539 1.1 lukem esac 4540 1.1 lukem done 4541 1.1 lukem compile_deplibs="$new_libs" 4542 1.1 lukem 4543 1.1 lukem 4544 1.1 lukem compile_command="$compile_command $compile_deplibs" 4545 1.1 lukem finalize_command="$finalize_command $finalize_deplibs" 4546 1.1 lukem 4547 1.1 lukem if test -n "$rpath$xrpath"; then 4548 1.1 lukem # If the user specified any rpath flags, then add them. 4549 1.1 lukem for libdir in $rpath $xrpath; do 4550 1.1 lukem # This is the magic to use -rpath. 4551 1.1 lukem case "$finalize_rpath " in 4552 1.1 lukem *" $libdir "*) ;; 4553 1.1 lukem *) finalize_rpath="$finalize_rpath $libdir" ;; 4554 1.1 lukem esac 4555 1.1 lukem done 4556 1.1 lukem fi 4557 1.1 lukem 4558 1.1 lukem # Now hardcode the library paths 4559 1.1 lukem rpath= 4560 1.1 lukem hardcode_libdirs= 4561 1.1 lukem for libdir in $compile_rpath $finalize_rpath; do 4562 1.1 lukem if test -n "$hardcode_libdir_flag_spec"; then 4563 1.1 lukem if test -n "$hardcode_libdir_separator"; then 4564 1.1 lukem if test -z "$hardcode_libdirs"; then 4565 1.1 lukem hardcode_libdirs="$libdir" 4566 1.1 lukem else 4567 1.1 lukem # Just accumulate the unique libdirs. 4568 1.1 lukem case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in 4569 1.1 lukem *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) 4570 1.1 lukem ;; 4571 1.1 lukem *) 4572 1.1 lukem hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" 4573 1.1 lukem ;; 4574 1.1 lukem esac 4575 1.1 lukem fi 4576 1.1 lukem else 4577 1.1 lukem eval flag=\"$hardcode_libdir_flag_spec\" 4578 1.1 lukem rpath="$rpath $flag" 4579 1.1 lukem fi 4580 1.1 lukem elif test -n "$runpath_var"; then 4581 1.1 lukem case "$perm_rpath " in 4582 1.1 lukem *" $libdir "*) ;; 4583 1.1 lukem *) perm_rpath="$perm_rpath $libdir" ;; 4584 1.1 lukem esac 4585 1.1 lukem fi 4586 1.1 lukem case $host in 4587 1.1 lukem *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) 4588 1.2 agc testbindir=`$ECHO "X$libdir" | $Xsed -e 's*/lib$*/bin*'` 4589 1.1 lukem case :$dllsearchpath: in 4590 1.1 lukem *":$libdir:"*) ;; 4591 1.1 lukem *) dllsearchpath="$dllsearchpath:$libdir";; 4592 1.1 lukem esac 4593 1.1 lukem case :$dllsearchpath: in 4594 1.1 lukem *":$testbindir:"*) ;; 4595 1.1 lukem *) dllsearchpath="$dllsearchpath:$testbindir";; 4596 1.1 lukem esac 4597 1.1 lukem ;; 4598 1.1 lukem esac 4599 1.1 lukem done 4600 1.1 lukem # Substitute the hardcoded libdirs into the rpath. 4601 1.1 lukem if test -n "$hardcode_libdir_separator" && 4602 1.1 lukem test -n "$hardcode_libdirs"; then 4603 1.1 lukem libdir="$hardcode_libdirs" 4604 1.1 lukem eval rpath=\" $hardcode_libdir_flag_spec\" 4605 1.1 lukem fi 4606 1.1 lukem compile_rpath="$rpath" 4607 1.1 lukem 4608 1.1 lukem rpath= 4609 1.1 lukem hardcode_libdirs= 4610 1.1 lukem for libdir in $finalize_rpath; do 4611 1.1 lukem if test -n "$hardcode_libdir_flag_spec"; then 4612 1.1 lukem if test -n "$hardcode_libdir_separator"; then 4613 1.1 lukem if test -z "$hardcode_libdirs"; then 4614 1.1 lukem hardcode_libdirs="$libdir" 4615 1.1 lukem else 4616 1.1 lukem # Just accumulate the unique libdirs. 4617 1.1 lukem case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in 4618 1.1 lukem *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) 4619 1.1 lukem ;; 4620 1.1 lukem *) 4621 1.1 lukem hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" 4622 1.1 lukem ;; 4623 1.1 lukem esac 4624 1.1 lukem fi 4625 1.1 lukem else 4626 1.1 lukem eval flag=\"$hardcode_libdir_flag_spec\" 4627 1.1 lukem rpath="$rpath $flag" 4628 1.1 lukem fi 4629 1.1 lukem elif test -n "$runpath_var"; then 4630 1.1 lukem case "$finalize_perm_rpath " in 4631 1.1 lukem *" $libdir "*) ;; 4632 1.1 lukem *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; 4633 1.1 lukem esac 4634 1.1 lukem fi 4635 1.1 lukem done 4636 1.1 lukem # Substitute the hardcoded libdirs into the rpath. 4637 1.1 lukem if test -n "$hardcode_libdir_separator" && 4638 1.1 lukem test -n "$hardcode_libdirs"; then 4639 1.1 lukem libdir="$hardcode_libdirs" 4640 1.1 lukem eval rpath=\" $hardcode_libdir_flag_spec\" 4641 1.1 lukem fi 4642 1.1 lukem finalize_rpath="$rpath" 4643 1.1 lukem 4644 1.1 lukem if test -n "$libobjs" && test "$build_old_libs" = yes; then 4645 1.1 lukem # Transform all the library objects into standard objects. 4646 1.2 agc compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` 4647 1.2 agc finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` 4648 1.1 lukem fi 4649 1.1 lukem 4650 1.1 lukem dlsyms= 4651 1.1 lukem if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then 4652 1.1 lukem if test -n "$NM" && test -n "$global_symbol_pipe"; then 4653 1.1 lukem dlsyms="${outputname}S.c" 4654 1.1 lukem else 4655 1.2 agc $ECHO "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 4656 1.1 lukem fi 4657 1.1 lukem fi 4658 1.1 lukem 4659 1.1 lukem if test -n "$dlsyms"; then 4660 1.1 lukem case $dlsyms in 4661 1.1 lukem "") ;; 4662 1.1 lukem *.c) 4663 1.1 lukem # Discover the nlist of each of the dlfiles. 4664 1.1 lukem nlist="$output_objdir/${outputname}.nm" 4665 1.1 lukem 4666 1.1 lukem $show "$rm $nlist ${nlist}S ${nlist}T" 4667 1.1 lukem $run $rm "$nlist" "${nlist}S" "${nlist}T" 4668 1.1 lukem 4669 1.1 lukem # Parse the name list into a source file. 4670 1.1 lukem $show "creating $output_objdir/$dlsyms" 4671 1.1 lukem 4672 1.2 agc test -z "$run" && $ECHO > "$output_objdir/$dlsyms" "\ 4673 1.1 lukem /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ 4674 1.1 lukem /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ 4675 1.1 lukem 4676 1.1 lukem #ifdef __cplusplus 4677 1.1 lukem extern \"C\" { 4678 1.1 lukem #endif 4679 1.1 lukem 4680 1.1 lukem /* Prevent the only kind of declaration conflicts we can make. */ 4681 1.1 lukem #define lt_preloaded_symbols some_other_symbol 4682 1.1 lukem 4683 1.1 lukem /* External symbol declarations for the compiler. */\ 4684 1.1 lukem " 4685 1.1 lukem 4686 1.1 lukem if test "$dlself" = yes; then 4687 1.1 lukem $show "generating symbol list for \`$output'" 4688 1.1 lukem 4689 1.2 agc test -z "$run" && $ECHO ': @PROGRAM@ ' > "$nlist" 4690 1.1 lukem 4691 1.1 lukem # Add our own program objects to the symbol list. 4692 1.2 agc progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` 4693 1.1 lukem for arg in $progfiles; do 4694 1.1 lukem $show "extracting global C symbols from \`$arg'" 4695 1.1 lukem $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" 4696 1.1 lukem done 4697 1.1 lukem 4698 1.1 lukem if test -n "$exclude_expsyms"; then 4699 1.1 lukem $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' 4700 1.1 lukem $run eval '$mv "$nlist"T "$nlist"' 4701 1.1 lukem fi 4702 1.1 lukem 4703 1.1 lukem if test -n "$export_symbols_regex"; then 4704 1.1 lukem $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' 4705 1.1 lukem $run eval '$mv "$nlist"T "$nlist"' 4706 1.1 lukem fi 4707 1.1 lukem 4708 1.1 lukem # Prepare the list of exported symbols 4709 1.1 lukem if test -z "$export_symbols"; then 4710 1.1 lukem export_symbols="$output_objdir/$outputname.exp" 4711 1.1 lukem $run $rm $export_symbols 4712 1.1 lukem $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' 4713 1.1 lukem case $host in 4714 1.1 lukem *cygwin* | *mingw* ) 4715 1.1 lukem $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' 4716 1.1 lukem $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' 4717 1.1 lukem ;; 4718 1.1 lukem esac 4719 1.1 lukem else 4720 1.1 lukem $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' 4721 1.1 lukem $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' 4722 1.1 lukem $run eval 'mv "$nlist"T "$nlist"' 4723 1.1 lukem case $host in 4724 1.1 lukem *cygwin* | *mingw* ) 4725 1.1 lukem $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' 4726 1.1 lukem $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' 4727 1.1 lukem ;; 4728 1.1 lukem esac 4729 1.1 lukem fi 4730 1.1 lukem fi 4731 1.1 lukem 4732 1.1 lukem for arg in $dlprefiles; do 4733 1.1 lukem $show "extracting global C symbols from \`$arg'" 4734 1.2 agc name=`$ECHO "$arg" | ${SED} -e 's%^.*/%%'` 4735 1.2 agc $run eval '$ECHO ": $name " >> "$nlist"' 4736 1.1 lukem $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" 4737 1.1 lukem done 4738 1.1 lukem 4739 1.1 lukem if test -z "$run"; then 4740 1.1 lukem # Make sure we have at least an empty file. 4741 1.1 lukem test -f "$nlist" || : > "$nlist" 4742 1.1 lukem 4743 1.1 lukem if test -n "$exclude_expsyms"; then 4744 1.1 lukem $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T 4745 1.1 lukem $mv "$nlist"T "$nlist" 4746 1.1 lukem fi 4747 1.1 lukem 4748 1.1 lukem # Try sorting and uniquifying the output. 4749 1.1 lukem if grep -v "^: " < "$nlist" | 4750 1.1 lukem if sort -k 3 </dev/null >/dev/null 2>&1; then 4751 1.1 lukem sort -k 3 4752 1.1 lukem else 4753 1.1 lukem sort +2 4754 1.1 lukem fi | 4755 1.1 lukem uniq > "$nlist"S; then 4756 1.1 lukem : 4757 1.1 lukem else 4758 1.1 lukem grep -v "^: " < "$nlist" > "$nlist"S 4759 1.1 lukem fi 4760 1.1 lukem 4761 1.1 lukem if test -f "$nlist"S; then 4762 1.1 lukem eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' 4763 1.1 lukem else 4764 1.2 agc $ECHO '/* NONE */' >> "$output_objdir/$dlsyms" 4765 1.1 lukem fi 4766 1.1 lukem 4767 1.2 agc $ECHO >> "$output_objdir/$dlsyms" "\ 4768 1.1 lukem 4769 1.1 lukem #undef lt_preloaded_symbols 4770 1.1 lukem 4771 1.1 lukem #if defined (__STDC__) && __STDC__ 4772 1.1 lukem # define lt_ptr void * 4773 1.1 lukem #else 4774 1.1 lukem # define lt_ptr char * 4775 1.1 lukem # define const 4776 1.1 lukem #endif 4777 1.1 lukem 4778 1.1 lukem /* The mapping between symbol names and symbols. */ 4779 1.1 lukem " 4780 1.1 lukem 4781 1.1 lukem case $host in 4782 1.1 lukem *cygwin* | *mingw* ) 4783 1.2 agc $ECHO >> "$output_objdir/$dlsyms" "\ 4784 1.1 lukem /* DATA imports from DLLs on WIN32 can't be const, because 4785 1.1 lukem runtime relocations are performed -- see ld's documentation 4786 1.1 lukem on pseudo-relocs */ 4787 1.1 lukem struct { 4788 1.1 lukem " 4789 1.1 lukem ;; 4790 1.1 lukem * ) 4791 1.2 agc $ECHO >> "$output_objdir/$dlsyms" "\ 4792 1.1 lukem const struct { 4793 1.1 lukem " 4794 1.1 lukem ;; 4795 1.1 lukem esac 4796 1.1 lukem 4797 1.1 lukem 4798 1.2 agc $ECHO >> "$output_objdir/$dlsyms" "\ 4799 1.1 lukem const char *name; 4800 1.1 lukem lt_ptr address; 4801 1.1 lukem } 4802 1.1 lukem lt_preloaded_symbols[] = 4803 1.1 lukem {\ 4804 1.1 lukem " 4805 1.1 lukem 4806 1.1 lukem eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" 4807 1.1 lukem 4808 1.2 agc $ECHO >> "$output_objdir/$dlsyms" "\ 4809 1.1 lukem {0, (lt_ptr) 0} 4810 1.1 lukem }; 4811 1.1 lukem 4812 1.1 lukem /* This works around a problem in FreeBSD linker */ 4813 1.1 lukem #ifdef FREEBSD_WORKAROUND 4814 1.1 lukem static const void *lt_preloaded_setup() { 4815 1.1 lukem return lt_preloaded_symbols; 4816 1.1 lukem } 4817 1.1 lukem #endif 4818 1.1 lukem 4819 1.1 lukem #ifdef __cplusplus 4820 1.1 lukem } 4821 1.1 lukem #endif\ 4822 1.1 lukem " 4823 1.1 lukem fi 4824 1.1 lukem 4825 1.1 lukem pic_flag_for_symtable= 4826 1.1 lukem case $host in 4827 1.1 lukem # compiling the symbol table file with pic_flag works around 4828 1.1 lukem # a FreeBSD bug that causes programs to crash when -lm is 4829 1.1 lukem # linked before any other PIC object. But we must not use 4830 1.1 lukem # pic_flag when linking with -static. The problem exists in 4831 1.1 lukem # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. 4832 1.1 lukem *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) 4833 1.1 lukem case "$compile_command " in 4834 1.1 lukem *" -static "*) ;; 4835 1.1 lukem *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; 4836 1.1 lukem esac;; 4837 1.1 lukem *-*-hpux*) 4838 1.1 lukem case "$compile_command " in 4839 1.1 lukem *" -static "*) ;; 4840 1.1 lukem *) pic_flag_for_symtable=" $pic_flag";; 4841 1.1 lukem esac 4842 1.1 lukem esac 4843 1.1 lukem 4844 1.1 lukem # Now compile the dynamic symbol file. 4845 1.1 lukem $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" 4846 1.1 lukem $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? 4847 1.1 lukem 4848 1.1 lukem # Clean up the generated files. 4849 1.1 lukem $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" 4850 1.1 lukem $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" 4851 1.1 lukem 4852 1.1 lukem # Transform the symbol file into the correct name. 4853 1.1 lukem case $host in 4854 1.1 lukem *cygwin* | *mingw* ) 4855 1.1 lukem if test -f "$output_objdir/${outputname}.def" ; then 4856 1.2 agc compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` 4857 1.2 agc finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` 4858 1.1 lukem else 4859 1.2 agc compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` 4860 1.2 agc finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` 4861 1.1 lukem fi 4862 1.1 lukem ;; 4863 1.1 lukem * ) 4864 1.2 agc compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` 4865 1.2 agc finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` 4866 1.1 lukem ;; 4867 1.1 lukem esac 4868 1.1 lukem ;; 4869 1.1 lukem *) 4870 1.2 agc $ECHO "$modename: unknown suffix for \`$dlsyms'" 1>&2 4871 1.1 lukem exit $EXIT_FAILURE 4872 1.1 lukem ;; 4873 1.1 lukem esac 4874 1.1 lukem else 4875 1.1 lukem # We keep going just in case the user didn't refer to 4876 1.1 lukem # lt_preloaded_symbols. The linker will fail if global_symbol_pipe 4877 1.1 lukem # really was required. 4878 1.1 lukem 4879 1.1 lukem # Nullify the symbol file. 4880 1.2 agc compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` 4881 1.2 agc finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` 4882 1.1 lukem fi 4883 1.1 lukem 4884 1.1 lukem if test "$need_relink" = no || test "$build_libtool_libs" != yes; then 4885 1.1 lukem # Replace the output file specification. 4886 1.2 agc compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP` 4887 1.1 lukem link_command="$compile_command$compile_rpath" 4888 1.1 lukem 4889 1.1 lukem # We have no uninstalled library dependencies, so finalize right now. 4890 1.1 lukem $show "$link_command" 4891 1.1 lukem $run eval "$link_command" 4892 1.1 lukem exit_status=$? 4893 1.1 lukem 4894 1.1 lukem # Delete the generated files. 4895 1.1 lukem if test -n "$dlsyms"; then 4896 1.1 lukem $show "$rm $output_objdir/${outputname}S.${objext}" 4897 1.1 lukem $run $rm "$output_objdir/${outputname}S.${objext}" 4898 1.1 lukem fi 4899 1.1 lukem 4900 1.1 lukem exit $exit_status 4901 1.1 lukem fi 4902 1.1 lukem 4903 1.1 lukem if test -n "$shlibpath_var"; then 4904 1.1 lukem # We should set the shlibpath_var 4905 1.1 lukem rpath= 4906 1.1 lukem for dir in $temp_rpath; do 4907 1.1 lukem case $dir in 4908 1.1 lukem [\\/]* | [A-Za-z]:[\\/]*) 4909 1.1 lukem # Absolute path. 4910 1.1 lukem rpath="$rpath$dir:" 4911 1.1 lukem ;; 4912 1.1 lukem *) 4913 1.1 lukem # Relative path: add a thisdir entry. 4914 1.1 lukem rpath="$rpath\$thisdir/$dir:" 4915 1.1 lukem ;; 4916 1.1 lukem esac 4917 1.1 lukem done 4918 1.1 lukem temp_rpath="$rpath" 4919 1.1 lukem fi 4920 1.1 lukem 4921 1.1 lukem if test -n "$compile_shlibpath$finalize_shlibpath"; then 4922 1.1 lukem compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" 4923 1.1 lukem fi 4924 1.1 lukem if test -n "$finalize_shlibpath"; then 4925 1.1 lukem finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" 4926 1.1 lukem fi 4927 1.1 lukem 4928 1.1 lukem compile_var= 4929 1.1 lukem finalize_var= 4930 1.1 lukem if test -n "$runpath_var"; then 4931 1.1 lukem if test -n "$perm_rpath"; then 4932 1.1 lukem # We should set the runpath_var. 4933 1.1 lukem rpath= 4934 1.1 lukem for dir in $perm_rpath; do 4935 1.1 lukem rpath="$rpath$dir:" 4936 1.1 lukem done 4937 1.1 lukem compile_var="$runpath_var=\"$rpath\$$runpath_var\" " 4938 1.1 lukem fi 4939 1.1 lukem if test -n "$finalize_perm_rpath"; then 4940 1.1 lukem # We should set the runpath_var. 4941 1.1 lukem rpath= 4942 1.1 lukem for dir in $finalize_perm_rpath; do 4943 1.1 lukem rpath="$rpath$dir:" 4944 1.1 lukem done 4945 1.1 lukem finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " 4946 1.1 lukem fi 4947 1.1 lukem fi 4948 1.1 lukem 4949 1.1 lukem if test "$no_install" = yes; then 4950 1.1 lukem # We don't need to create a wrapper script. 4951 1.1 lukem link_command="$compile_var$compile_command$compile_rpath" 4952 1.1 lukem # Replace the output file specification. 4953 1.2 agc link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` 4954 1.1 lukem # Delete the old output file. 4955 1.1 lukem $run $rm $output 4956 1.1 lukem # Link the executable and exit 4957 1.1 lukem $show "$link_command" 4958 1.1 lukem $run eval "$link_command" || exit $? 4959 1.1 lukem exit $EXIT_SUCCESS 4960 1.1 lukem fi 4961 1.1 lukem 4962 1.1 lukem if test "$hardcode_action" = relink; then 4963 1.1 lukem # Fast installation is not supported 4964 1.1 lukem link_command="$compile_var$compile_command$compile_rpath" 4965 1.1 lukem relink_command="$finalize_var$finalize_command$finalize_rpath" 4966 1.1 lukem 4967 1.2 agc $ECHO "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 4968 1.2 agc $ECHO "$modename: \`$output' will be relinked during installation" 1>&2 4969 1.1 lukem else 4970 1.1 lukem if test "$fast_install" != no; then 4971 1.1 lukem link_command="$finalize_var$compile_command$finalize_rpath" 4972 1.1 lukem if test "$fast_install" = yes; then 4973 1.2 agc relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP` 4974 1.1 lukem else 4975 1.1 lukem # fast_install is set to needless 4976 1.1 lukem relink_command= 4977 1.1 lukem fi 4978 1.1 lukem else 4979 1.1 lukem link_command="$compile_var$compile_command$compile_rpath" 4980 1.1 lukem relink_command="$finalize_var$finalize_command$finalize_rpath" 4981 1.1 lukem fi 4982 1.1 lukem fi 4983 1.1 lukem 4984 1.1 lukem # Replace the output file specification. 4985 1.2 agc link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` 4986 1.1 lukem 4987 1.1 lukem # Delete the old output files. 4988 1.1 lukem $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname 4989 1.1 lukem 4990 1.1 lukem $show "$link_command" 4991 1.1 lukem $run eval "$link_command" || exit $? 4992 1.1 lukem 4993 1.1 lukem # Now create the wrapper script. 4994 1.1 lukem $show "creating $output" 4995 1.1 lukem 4996 1.1 lukem # Quote the relink command for shipping. 4997 1.1 lukem if test -n "$relink_command"; then 4998 1.1 lukem # Preserve any variables that may affect compiler behavior 4999 1.1 lukem for var in $variables_saved_for_relink; do 5000 1.1 lukem if eval test -z \"\${$var+set}\"; then 5001 1.1 lukem relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" 5002 1.1 lukem elif eval var_value=\$$var; test -z "$var_value"; then 5003 1.1 lukem relink_command="$var=; export $var; $relink_command" 5004 1.1 lukem else 5005 1.2 agc var_value=`$ECHO "X$var_value" | $Xsed -e "$sed_quote_subst"` 5006 1.1 lukem relink_command="$var=\"$var_value\"; export $var; $relink_command" 5007 1.1 lukem fi 5008 1.1 lukem done 5009 1.1 lukem relink_command="(cd `pwd`; $relink_command)" 5010 1.2 agc relink_command=`$ECHO "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` 5011 1.1 lukem fi 5012 1.1 lukem 5013 1.2 agc # Quote $ECHO for shipping. 5014 1.2 agc if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then 5015 1.1 lukem case $progpath in 5016 1.1 lukem [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; 5017 1.1 lukem *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; 5018 1.1 lukem esac 5019 1.2 agc qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"` 5020 1.1 lukem else 5021 1.2 agc qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"` 5022 1.1 lukem fi 5023 1.1 lukem 5024 1.1 lukem # Only actually do things if our run command is non-null. 5025 1.1 lukem if test -z "$run"; then 5026 1.1 lukem # win32 will think the script is a binary if it has 5027 1.1 lukem # a .exe suffix, so we strip it off here. 5028 1.1 lukem case $output in 5029 1.2 agc *.exe) output=`$ECHO $output|${SED} 's,.exe$,,'` ;; 5030 1.1 lukem esac 5031 1.1 lukem # test for cygwin because mv fails w/o .exe extensions 5032 1.1 lukem case $host in 5033 1.1 lukem *cygwin*) 5034 1.1 lukem exeext=.exe 5035 1.2 agc outputname=`$ECHO $outputname|${SED} 's,.exe$,,'` ;; 5036 1.1 lukem *) exeext= ;; 5037 1.1 lukem esac 5038 1.1 lukem case $host in 5039 1.1 lukem *cygwin* | *mingw* ) 5040 1.1 lukem output_name=`basename $output` 5041 1.1 lukem output_path=`dirname $output` 5042 1.1 lukem cwrappersource="$output_path/$objdir/lt-$output_name.c" 5043 1.1 lukem cwrapper="$output_path/$output_name.exe" 5044 1.1 lukem $rm $cwrappersource $cwrapper 5045 1.1 lukem trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 5046 1.1 lukem 5047 1.1 lukem cat > $cwrappersource <<EOF 5048 1.1 lukem 5049 1.1 lukem /* $cwrappersource - temporary wrapper executable for $objdir/$outputname 5050 1.1 lukem Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP 5051 1.1 lukem 5052 1.1 lukem The $output program cannot be directly executed until all the libtool 5053 1.1 lukem libraries that it depends on are installed. 5054 1.1 lukem 5055 1.1 lukem This wrapper executable should never be moved out of the build directory. 5056 1.1 lukem If it is, it will not operate correctly. 5057 1.1 lukem 5058 1.1 lukem Currently, it simply execs the wrapper *script* "/bin/sh $output", 5059 1.1 lukem but could eventually absorb all of the scripts functionality and 5060 1.1 lukem exec $objdir/$outputname directly. 5061 1.1 lukem */ 5062 1.1 lukem EOF 5063 1.1 lukem cat >> $cwrappersource<<"EOF" 5064 1.1 lukem #include <stdio.h> 5065 1.1 lukem #include <stdlib.h> 5066 1.1 lukem #include <unistd.h> 5067 1.1 lukem #include <malloc.h> 5068 1.1 lukem #include <stdarg.h> 5069 1.1 lukem #include <assert.h> 5070 1.1 lukem #include <string.h> 5071 1.1 lukem #include <ctype.h> 5072 1.1 lukem #include <sys/stat.h> 5073 1.1 lukem 5074 1.1 lukem #if defined(PATH_MAX) 5075 1.1 lukem # define LT_PATHMAX PATH_MAX 5076 1.1 lukem #elif defined(MAXPATHLEN) 5077 1.1 lukem # define LT_PATHMAX MAXPATHLEN 5078 1.1 lukem #else 5079 1.1 lukem # define LT_PATHMAX 1024 5080 1.1 lukem #endif 5081 1.1 lukem 5082 1.1 lukem #ifndef DIR_SEPARATOR 5083 1.1 lukem # define DIR_SEPARATOR '/' 5084 1.1 lukem # define PATH_SEPARATOR ':' 5085 1.1 lukem #endif 5086 1.1 lukem 5087 1.1 lukem #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ 5088 1.1 lukem defined (__OS2__) 5089 1.1 lukem # define HAVE_DOS_BASED_FILE_SYSTEM 5090 1.1 lukem # ifndef DIR_SEPARATOR_2 5091 1.1 lukem # define DIR_SEPARATOR_2 '\\' 5092 1.1 lukem # endif 5093 1.1 lukem # ifndef PATH_SEPARATOR_2 5094 1.1 lukem # define PATH_SEPARATOR_2 ';' 5095 1.1 lukem # endif 5096 1.1 lukem #endif 5097 1.1 lukem 5098 1.1 lukem #ifndef DIR_SEPARATOR_2 5099 1.1 lukem # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) 5100 1.1 lukem #else /* DIR_SEPARATOR_2 */ 5101 1.1 lukem # define IS_DIR_SEPARATOR(ch) \ 5102 1.1 lukem (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) 5103 1.1 lukem #endif /* DIR_SEPARATOR_2 */ 5104 1.1 lukem 5105 1.1 lukem #ifndef PATH_SEPARATOR_2 5106 1.1 lukem # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) 5107 1.1 lukem #else /* PATH_SEPARATOR_2 */ 5108 1.1 lukem # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) 5109 1.1 lukem #endif /* PATH_SEPARATOR_2 */ 5110 1.1 lukem 5111 1.1 lukem #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) 5112 1.1 lukem #define XFREE(stale) do { \ 5113 1.1 lukem if (stale) { free ((void *) stale); stale = 0; } \ 5114 1.1 lukem } while (0) 5115 1.1 lukem 5116 1.1 lukem /* -DDEBUG is fairly common in CFLAGS. */ 5117 1.1 lukem #undef DEBUG 5118 1.1 lukem #if defined DEBUGWRAPPER 5119 1.1 lukem # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) 5120 1.1 lukem #else 5121 1.1 lukem # define DEBUG(format, ...) 5122 1.1 lukem #endif 5123 1.1 lukem 5124 1.1 lukem const char *program_name = NULL; 5125 1.1 lukem 5126 1.1 lukem void * xmalloc (size_t num); 5127 1.1 lukem char * xstrdup (const char *string); 5128 1.1 lukem const char * base_name (const char *name); 5129 1.1 lukem char * find_executable(const char *wrapper); 5130 1.1 lukem int check_executable(const char *path); 5131 1.1 lukem char * strendzap(char *str, const char *pat); 5132 1.1 lukem void lt_fatal (const char *message, ...); 5133 1.1 lukem 5134 1.1 lukem int 5135 1.1 lukem main (int argc, char *argv[]) 5136 1.1 lukem { 5137 1.1 lukem char **newargz; 5138 1.1 lukem int i; 5139 1.1 lukem 5140 1.1 lukem program_name = (char *) xstrdup (base_name (argv[0])); 5141 1.1 lukem DEBUG("(main) argv[0] : %s\n",argv[0]); 5142 1.1 lukem DEBUG("(main) program_name : %s\n",program_name); 5143 1.1 lukem newargz = XMALLOC(char *, argc+2); 5144 1.1 lukem EOF 5145 1.1 lukem 5146 1.1 lukem cat >> $cwrappersource <<EOF 5147 1.1 lukem newargz[0] = (char *) xstrdup("$SHELL"); 5148 1.1 lukem EOF 5149 1.1 lukem 5150 1.1 lukem cat >> $cwrappersource <<"EOF" 5151 1.1 lukem newargz[1] = find_executable(argv[0]); 5152 1.1 lukem if (newargz[1] == NULL) 5153 1.1 lukem lt_fatal("Couldn't find %s", argv[0]); 5154 1.1 lukem DEBUG("(main) found exe at : %s\n",newargz[1]); 5155 1.1 lukem /* we know the script has the same name, without the .exe */ 5156 1.1 lukem /* so make sure newargz[1] doesn't end in .exe */ 5157 1.1 lukem strendzap(newargz[1],".exe"); 5158 1.1 lukem for (i = 1; i < argc; i++) 5159 1.1 lukem newargz[i+1] = xstrdup(argv[i]); 5160 1.1 lukem newargz[argc+1] = NULL; 5161 1.1 lukem 5162 1.1 lukem for (i=0; i<argc+1; i++) 5163 1.1 lukem { 5164 1.1 lukem DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]); 5165 1.1 lukem ; 5166 1.1 lukem } 5167 1.1 lukem 5168 1.1 lukem EOF 5169 1.1 lukem 5170 1.1 lukem case $host_os in 5171 1.1 lukem mingw*) 5172 1.1 lukem cat >> $cwrappersource <<EOF 5173 1.1 lukem execv("$SHELL",(char const **)newargz); 5174 1.1 lukem EOF 5175 1.1 lukem ;; 5176 1.1 lukem *) 5177 1.1 lukem cat >> $cwrappersource <<EOF 5178 1.1 lukem execv("$SHELL",newargz); 5179 1.1 lukem EOF 5180 1.1 lukem ;; 5181 1.1 lukem esac 5182 1.1 lukem 5183 1.1 lukem cat >> $cwrappersource <<"EOF" 5184 1.1 lukem return 127; 5185 1.1 lukem } 5186 1.1 lukem 5187 1.1 lukem void * 5188 1.1 lukem xmalloc (size_t num) 5189 1.1 lukem { 5190 1.1 lukem void * p = (void *) malloc (num); 5191 1.1 lukem if (!p) 5192 1.1 lukem lt_fatal ("Memory exhausted"); 5193 1.1 lukem 5194 1.1 lukem return p; 5195 1.1 lukem } 5196 1.1 lukem 5197 1.1 lukem char * 5198 1.1 lukem xstrdup (const char *string) 5199 1.1 lukem { 5200 1.1 lukem return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL 5201 1.1 lukem ; 5202 1.1 lukem } 5203 1.1 lukem 5204 1.1 lukem const char * 5205 1.1 lukem base_name (const char *name) 5206 1.1 lukem { 5207 1.1 lukem const char *base; 5208 1.1 lukem 5209 1.1 lukem #if defined (HAVE_DOS_BASED_FILE_SYSTEM) 5210 1.1 lukem /* Skip over the disk name in MSDOS pathnames. */ 5211 1.1 lukem if (isalpha ((unsigned char)name[0]) && name[1] == ':') 5212 1.1 lukem name += 2; 5213 1.1 lukem #endif 5214 1.1 lukem 5215 1.1 lukem for (base = name; *name; name++) 5216 1.1 lukem if (IS_DIR_SEPARATOR (*name)) 5217 1.1 lukem base = name + 1; 5218 1.1 lukem return base; 5219 1.1 lukem } 5220 1.1 lukem 5221 1.1 lukem int 5222 1.1 lukem check_executable(const char * path) 5223 1.1 lukem { 5224 1.1 lukem struct stat st; 5225 1.1 lukem 5226 1.1 lukem DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); 5227 1.1 lukem if ((!path) || (!*path)) 5228 1.1 lukem return 0; 5229 1.1 lukem 5230 1.1 lukem if ((stat (path, &st) >= 0) && 5231 1.1 lukem ( 5232 1.1 lukem /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ 5233 1.1 lukem #if defined (S_IXOTH) 5234 1.1 lukem ((st.st_mode & S_IXOTH) == S_IXOTH) || 5235 1.1 lukem #endif 5236 1.1 lukem #if defined (S_IXGRP) 5237 1.1 lukem ((st.st_mode & S_IXGRP) == S_IXGRP) || 5238 1.1 lukem #endif 5239 1.1 lukem ((st.st_mode & S_IXUSR) == S_IXUSR)) 5240 1.1 lukem ) 5241 1.1 lukem return 1; 5242 1.1 lukem else 5243 1.1 lukem return 0; 5244 1.1 lukem } 5245 1.1 lukem 5246 1.1 lukem /* Searches for the full path of the wrapper. Returns 5247 1.1 lukem newly allocated full path name if found, NULL otherwise */ 5248 1.1 lukem char * 5249 1.1 lukem find_executable (const char* wrapper) 5250 1.1 lukem { 5251 1.1 lukem int has_slash = 0; 5252 1.1 lukem const char* p; 5253 1.1 lukem const char* p_next; 5254 1.1 lukem /* static buffer for getcwd */ 5255 1.1 lukem char tmp[LT_PATHMAX + 1]; 5256 1.1 lukem int tmp_len; 5257 1.1 lukem char* concat_name; 5258 1.1 lukem 5259 1.1 lukem DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); 5260 1.1 lukem 5261 1.1 lukem if ((wrapper == NULL) || (*wrapper == '\0')) 5262 1.1 lukem return NULL; 5263 1.1 lukem 5264 1.1 lukem /* Absolute path? */ 5265 1.1 lukem #if defined (HAVE_DOS_BASED_FILE_SYSTEM) 5266 1.1 lukem if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') 5267 1.1 lukem { 5268 1.1 lukem concat_name = xstrdup (wrapper); 5269 1.1 lukem if (check_executable(concat_name)) 5270 1.1 lukem return concat_name; 5271 1.1 lukem XFREE(concat_name); 5272 1.1 lukem } 5273 1.1 lukem else 5274 1.1 lukem { 5275 1.1 lukem #endif 5276 1.1 lukem if (IS_DIR_SEPARATOR (wrapper[0])) 5277 1.1 lukem { 5278 1.1 lukem concat_name = xstrdup (wrapper); 5279 1.1 lukem if (check_executable(concat_name)) 5280 1.1 lukem return concat_name; 5281 1.1 lukem XFREE(concat_name); 5282 1.1 lukem } 5283 1.1 lukem #if defined (HAVE_DOS_BASED_FILE_SYSTEM) 5284 1.1 lukem } 5285 1.1 lukem #endif 5286 1.1 lukem 5287 1.1 lukem for (p = wrapper; *p; p++) 5288 1.1 lukem if (*p == '/') 5289 1.1 lukem { 5290 1.1 lukem has_slash = 1; 5291 1.1 lukem break; 5292 1.1 lukem } 5293 1.1 lukem if (!has_slash) 5294 1.1 lukem { 5295 1.1 lukem /* no slashes; search PATH */ 5296 1.1 lukem const char* path = getenv ("PATH"); 5297 1.1 lukem if (path != NULL) 5298 1.1 lukem { 5299 1.1 lukem for (p = path; *p; p = p_next) 5300 1.1 lukem { 5301 1.1 lukem const char* q; 5302 1.1 lukem size_t p_len; 5303 1.1 lukem for (q = p; *q; q++) 5304 1.1 lukem if (IS_PATH_SEPARATOR(*q)) 5305 1.1 lukem break; 5306 1.1 lukem p_len = q - p; 5307 1.1 lukem p_next = (*q == '\0' ? q : q + 1); 5308 1.1 lukem if (p_len == 0) 5309 1.1 lukem { 5310 1.1 lukem /* empty path: current directory */ 5311 1.1 lukem if (getcwd (tmp, LT_PATHMAX) == NULL) 5312 1.1 lukem lt_fatal ("getcwd failed"); 5313 1.1 lukem tmp_len = strlen(tmp); 5314 1.1 lukem concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); 5315 1.1 lukem memcpy (concat_name, tmp, tmp_len); 5316 1.1 lukem concat_name[tmp_len] = '/'; 5317 1.1 lukem strcpy (concat_name + tmp_len + 1, wrapper); 5318 1.1 lukem } 5319 1.1 lukem else 5320 1.1 lukem { 5321 1.1 lukem concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); 5322 1.1 lukem memcpy (concat_name, p, p_len); 5323 1.1 lukem concat_name[p_len] = '/'; 5324 1.1 lukem strcpy (concat_name + p_len + 1, wrapper); 5325 1.1 lukem } 5326 1.1 lukem if (check_executable(concat_name)) 5327 1.1 lukem return concat_name; 5328 1.1 lukem XFREE(concat_name); 5329 1.1 lukem } 5330 1.1 lukem } 5331 1.1 lukem /* not found in PATH; assume curdir */ 5332 1.1 lukem } 5333 1.1 lukem /* Relative path | not found in path: prepend cwd */ 5334 1.1 lukem if (getcwd (tmp, LT_PATHMAX) == NULL) 5335 1.1 lukem lt_fatal ("getcwd failed"); 5336 1.1 lukem tmp_len = strlen(tmp); 5337 1.1 lukem concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); 5338 1.1 lukem memcpy (concat_name, tmp, tmp_len); 5339 1.1 lukem concat_name[tmp_len] = '/'; 5340 1.1 lukem strcpy (concat_name + tmp_len + 1, wrapper); 5341 1.1 lukem 5342 1.1 lukem if (check_executable(concat_name)) 5343 1.1 lukem return concat_name; 5344 1.1 lukem XFREE(concat_name); 5345 1.1 lukem return NULL; 5346 1.1 lukem } 5347 1.1 lukem 5348 1.1 lukem char * 5349 1.1 lukem strendzap(char *str, const char *pat) 5350 1.1 lukem { 5351 1.1 lukem size_t len, patlen; 5352 1.1 lukem 5353 1.1 lukem assert(str != NULL); 5354 1.1 lukem assert(pat != NULL); 5355 1.1 lukem 5356 1.1 lukem len = strlen(str); 5357 1.1 lukem patlen = strlen(pat); 5358 1.1 lukem 5359 1.1 lukem if (patlen <= len) 5360 1.1 lukem { 5361 1.1 lukem str += len - patlen; 5362 1.1 lukem if (strcmp(str, pat) == 0) 5363 1.1 lukem *str = '\0'; 5364 1.1 lukem } 5365 1.1 lukem return str; 5366 1.1 lukem } 5367 1.1 lukem 5368 1.1 lukem static void 5369 1.1 lukem lt_error_core (int exit_status, const char * mode, 5370 1.1 lukem const char * message, va_list ap) 5371 1.1 lukem { 5372 1.1 lukem fprintf (stderr, "%s: %s: ", program_name, mode); 5373 1.1 lukem vfprintf (stderr, message, ap); 5374 1.1 lukem fprintf (stderr, ".\n"); 5375 1.1 lukem 5376 1.1 lukem if (exit_status >= 0) 5377 1.1 lukem exit (exit_status); 5378 1.1 lukem } 5379 1.1 lukem 5380 1.1 lukem void 5381 1.1 lukem lt_fatal (const char *message, ...) 5382 1.1 lukem { 5383 1.1 lukem va_list ap; 5384 1.1 lukem va_start (ap, message); 5385 1.1 lukem lt_error_core (EXIT_FAILURE, "FATAL", message, ap); 5386 1.1 lukem va_end (ap); 5387 1.1 lukem } 5388 1.1 lukem EOF 5389 1.1 lukem # we should really use a build-platform specific compiler 5390 1.1 lukem # here, but OTOH, the wrappers (shell script and this C one) 5391 1.1 lukem # are only useful if you want to execute the "real" binary. 5392 1.1 lukem # Since the "real" binary is built for $host, then this 5393 1.1 lukem # wrapper might as well be built for $host, too. 5394 1.1 lukem $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource 5395 1.1 lukem ;; 5396 1.1 lukem esac 5397 1.1 lukem $rm $output 5398 1.1 lukem trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 5399 1.1 lukem 5400 1.2 agc $ECHO > $output "\ 5401 1.1 lukem #! $SHELL 5402 1.1 lukem 5403 1.1 lukem # $output - temporary wrapper script for $objdir/$outputname 5404 1.1 lukem # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP 5405 1.1 lukem # 5406 1.1 lukem # The $output program cannot be directly executed until all the libtool 5407 1.1 lukem # libraries that it depends on are installed. 5408 1.1 lukem # 5409 1.1 lukem # This wrapper script should never be moved out of the build directory. 5410 1.1 lukem # If it is, it will not operate correctly. 5411 1.1 lukem 5412 1.1 lukem # Sed substitution that helps us do robust quoting. It backslashifies 5413 1.1 lukem # metacharacters that are still active within double-quoted strings. 5414 1.1 lukem Xsed='${SED} -e 1s/^X//' 5415 1.1 lukem sed_quote_subst='$sed_quote_subst' 5416 1.1 lukem 5417 1.1 lukem # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). 5418 1.1 lukem if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then 5419 1.1 lukem emulate sh 5420 1.1 lukem NULLCMD=: 5421 1.1 lukem # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which 5422 1.1 lukem # is contrary to our usage. Disable this feature. 5423 1.1 lukem alias -g '\${1+\"\$@\"}'='\"\$@\"' 5424 1.1 lukem setopt NO_GLOB_SUBST 5425 1.1 lukem else 5426 1.1 lukem case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac 5427 1.1 lukem fi 5428 1.1 lukem BIN_SH=xpg4; export BIN_SH # for Tru64 5429 1.1 lukem DUALCASE=1; export DUALCASE # for MKS sh 5430 1.1 lukem 5431 1.1 lukem # The HP-UX ksh and POSIX shell print the target directory to stdout 5432 1.1 lukem # if CDPATH is set. 5433 1.1 lukem (unset CDPATH) >/dev/null 2>&1 && unset CDPATH 5434 1.1 lukem 5435 1.1 lukem relink_command=\"$relink_command\" 5436 1.1 lukem 5437 1.1 lukem # This environment variable determines our operation mode. 5438 1.1 lukem if test \"\$libtool_install_magic\" = \"$magic\"; then 5439 1.1 lukem # install mode needs the following variable: 5440 1.1 lukem notinst_deplibs='$notinst_deplibs' 5441 1.1 lukem else 5442 1.2 agc # When we are sourced in execute mode, \$file and \$ECHO are already set. 5443 1.1 lukem if test \"\$libtool_execute_magic\" != \"$magic\"; then 5444 1.1 lukem echo=\"$qecho\" 5445 1.1 lukem file=\"\$0\" 5446 1.1 lukem # Make sure echo works. 5447 1.1 lukem if test \"X\$1\" = X--no-reexec; then 5448 1.1 lukem # Discard the --no-reexec flag, and continue. 5449 1.1 lukem shift 5450 1.2 agc elif test \"X\`(\$ECHO '\t') 2>/dev/null\`\" = 'X\t'; then 5451 1.2 agc # Yippee, \$ECHO works! 5452 1.1 lukem : 5453 1.1 lukem else 5454 1.2 agc # Restart under the correct shell, and then maybe \$ECHO will work. 5455 1.1 lukem exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} 5456 1.1 lukem fi 5457 1.1 lukem fi\ 5458 1.1 lukem " 5459 1.2 agc $ECHO >> $output "\ 5460 1.1 lukem 5461 1.1 lukem # Find the directory that this script lives in. 5462 1.2 agc thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` 5463 1.1 lukem test \"x\$thisdir\" = \"x\$file\" && thisdir=. 5464 1.1 lukem 5465 1.1 lukem # Follow symbolic links until we get to the real thisdir. 5466 1.1 lukem file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` 5467 1.1 lukem while test -n \"\$file\"; do 5468 1.2 agc destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` 5469 1.1 lukem 5470 1.1 lukem # If there was a directory component, then change thisdir. 5471 1.1 lukem if test \"x\$destdir\" != \"x\$file\"; then 5472 1.1 lukem case \"\$destdir\" in 5473 1.1 lukem [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; 5474 1.1 lukem *) thisdir=\"\$thisdir/\$destdir\" ;; 5475 1.1 lukem esac 5476 1.1 lukem fi 5477 1.1 lukem 5478 1.2 agc file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\` 5479 1.1 lukem file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` 5480 1.1 lukem done 5481 1.1 lukem 5482 1.1 lukem # Try to get the absolute directory name. 5483 1.1 lukem absdir=\`cd \"\$thisdir\" && pwd\` 5484 1.1 lukem test -n \"\$absdir\" && thisdir=\"\$absdir\" 5485 1.1 lukem " 5486 1.1 lukem 5487 1.1 lukem if test "$fast_install" = yes; then 5488 1.2 agc $ECHO >> $output "\ 5489 1.1 lukem program=lt-'$outputname'$exeext 5490 1.1 lukem progdir=\"\$thisdir/$objdir\" 5491 1.1 lukem 5492 1.1 lukem if test ! -f \"\$progdir/\$program\" || \\ 5493 1.1 lukem { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ 5494 1.1 lukem test \"X\$file\" != \"X\$progdir/\$program\"; }; then 5495 1.1 lukem 5496 1.1 lukem file=\"\$\$-\$program\" 5497 1.1 lukem 5498 1.1 lukem if test ! -d \"\$progdir\"; then 5499 1.1 lukem $mkdir \"\$progdir\" 5500 1.1 lukem else 5501 1.1 lukem $rm \"\$progdir/\$file\" 5502 1.1 lukem fi" 5503 1.1 lukem 5504 1.2 agc $ECHO >> $output "\ 5505 1.1 lukem 5506 1.1 lukem # relink executable if necessary 5507 1.1 lukem if test -n \"\$relink_command\"; then 5508 1.1 lukem if relink_command_output=\`eval \$relink_command 2>&1\`; then : 5509 1.1 lukem else 5510 1.2 agc $ECHO \"\$relink_command_output\" >&2 5511 1.1 lukem $rm \"\$progdir/\$file\" 5512 1.1 lukem exit $EXIT_FAILURE 5513 1.1 lukem fi 5514 1.1 lukem fi 5515 1.1 lukem 5516 1.1 lukem $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || 5517 1.1 lukem { $rm \"\$progdir/\$program\"; 5518 1.1 lukem $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } 5519 1.1 lukem $rm \"\$progdir/\$file\" 5520 1.1 lukem fi" 5521 1.1 lukem else 5522 1.2 agc $ECHO >> $output "\ 5523 1.1 lukem program='$outputname' 5524 1.1 lukem progdir=\"\$thisdir/$objdir\" 5525 1.1 lukem " 5526 1.1 lukem fi 5527 1.1 lukem 5528 1.2 agc $ECHO >> $output "\ 5529 1.1 lukem 5530 1.1 lukem if test -f \"\$progdir/\$program\"; then" 5531 1.1 lukem 5532 1.1 lukem # Export our shlibpath_var if we have one. 5533 1.1 lukem if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then 5534 1.2 agc $ECHO >> $output "\ 5535 1.1 lukem # Add our own library path to $shlibpath_var 5536 1.1 lukem $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" 5537 1.1 lukem 5538 1.1 lukem # Some systems cannot cope with colon-terminated $shlibpath_var 5539 1.1 lukem # The second colon is a workaround for a bug in BeOS R4 sed 5540 1.2 agc $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` 5541 1.1 lukem 5542 1.1 lukem export $shlibpath_var 5543 1.1 lukem " 5544 1.1 lukem fi 5545 1.1 lukem 5546 1.1 lukem # fixup the dll searchpath if we need to. 5547 1.1 lukem if test -n "$dllsearchpath"; then 5548 1.2 agc $ECHO >> $output "\ 5549 1.1 lukem # Add the dll search path components to the executable PATH 5550 1.1 lukem PATH=$dllsearchpath:\$PATH 5551 1.1 lukem " 5552 1.1 lukem fi 5553 1.1 lukem 5554 1.2 agc $ECHO >> $output "\ 5555 1.1 lukem if test \"\$libtool_execute_magic\" != \"$magic\"; then 5556 1.1 lukem # Run the actual program with our arguments. 5557 1.1 lukem " 5558 1.1 lukem case $host in 5559 1.1 lukem # Backslashes separate directories on plain windows 5560 1.1 lukem *-*-mingw | *-*-os2*) 5561 1.2 agc $ECHO >> $output "\ 5562 1.1 lukem exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} 5563 1.1 lukem " 5564 1.1 lukem ;; 5565 1.1 lukem 5566 1.1 lukem *) 5567 1.2 agc $ECHO >> $output "\ 5568 1.1 lukem exec \"\$progdir/\$program\" \${1+\"\$@\"} 5569 1.1 lukem " 5570 1.1 lukem ;; 5571 1.1 lukem esac 5572 1.2 agc $ECHO >> $output "\ 5573 1.2 agc \$ECHO \"\$0: cannot exec \$program \$*\" 5574 1.1 lukem exit $EXIT_FAILURE 5575 1.1 lukem fi 5576 1.1 lukem else 5577 1.1 lukem # The program doesn't exist. 5578 1.2 agc \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 5579 1.2 agc \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 5580 1.2 agc $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 5581 1.1 lukem exit $EXIT_FAILURE 5582 1.1 lukem fi 5583 1.1 lukem fi\ 5584 1.1 lukem " 5585 1.1 lukem chmod +x $output 5586 1.1 lukem fi 5587 1.1 lukem exit $EXIT_SUCCESS 5588 1.1 lukem ;; 5589 1.1 lukem esac 5590 1.1 lukem 5591 1.1 lukem # See if we need to build an old-fashioned archive. 5592 1.1 lukem for oldlib in $oldlibs; do 5593 1.1 lukem 5594 1.1 lukem if test "$build_libtool_libs" = convenience; then 5595 1.1 lukem oldobjs="$libobjs_save" 5596 1.1 lukem addlibs="$convenience" 5597 1.1 lukem build_libtool_libs=no 5598 1.1 lukem else 5599 1.1 lukem if test "$build_libtool_libs" = module; then 5600 1.1 lukem oldobjs="$libobjs_save" 5601 1.1 lukem build_libtool_libs=no 5602 1.1 lukem else 5603 1.1 lukem oldobjs="$old_deplibs $non_pic_objects" 5604 1.1 lukem fi 5605 1.1 lukem addlibs="$old_convenience" 5606 1.1 lukem fi 5607 1.1 lukem 5608 1.1 lukem if test -n "$addlibs"; then 5609 1.1 lukem gentop="$output_objdir/${outputname}x" 5610 1.1 lukem generated="$generated $gentop" 5611 1.1 lukem 5612 1.1 lukem func_extract_archives $gentop $addlibs 5613 1.1 lukem oldobjs="$oldobjs $func_extract_archives_result" 5614 1.1 lukem fi 5615 1.1 lukem 5616 1.1 lukem # Do each command in the archive commands. 5617 1.1 lukem if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then 5618 1.1 lukem cmds=$old_archive_from_new_cmds 5619 1.1 lukem else 5620 1.1 lukem # POSIX demands no paths to be encoded in archives. We have 5621 1.1 lukem # to avoid creating archives with duplicate basenames if we 5622 1.1 lukem # might have to extract them afterwards, e.g., when creating a 5623 1.1 lukem # static archive out of a convenience library, or when linking 5624 1.1 lukem # the entirety of a libtool archive into another (currently 5625 1.1 lukem # not supported by libtool). 5626 1.1 lukem if (for obj in $oldobjs 5627 1.1 lukem do 5628 1.2 agc $ECHO "X$obj" | $Xsed -e 's%^.*/%%' 5629 1.1 lukem done | sort | sort -uc >/dev/null 2>&1); then 5630 1.1 lukem : 5631 1.1 lukem else 5632 1.2 agc $ECHO "copying selected object files to avoid basename conflicts..." 5633 1.1 lukem 5634 1.1 lukem if test -z "$gentop"; then 5635 1.1 lukem gentop="$output_objdir/${outputname}x" 5636 1.1 lukem generated="$generated $gentop" 5637 1.1 lukem 5638 1.1 lukem $show "${rm}r $gentop" 5639 1.1 lukem $run ${rm}r "$gentop" 5640 1.1 lukem $show "$mkdir $gentop" 5641 1.1 lukem $run $mkdir "$gentop" 5642 1.1 lukem exit_status=$? 5643 1.1 lukem if test "$exit_status" -ne 0 && test ! -d "$gentop"; then 5644 1.1 lukem exit $exit_status 5645 1.1 lukem fi 5646 1.1 lukem fi 5647 1.1 lukem 5648 1.1 lukem save_oldobjs=$oldobjs 5649 1.1 lukem oldobjs= 5650 1.1 lukem counter=1 5651 1.1 lukem for obj in $save_oldobjs 5652 1.1 lukem do 5653 1.2 agc objbase=`$ECHO "X$obj" | $Xsed -e 's%^.*/%%'` 5654 1.1 lukem case " $oldobjs " in 5655 1.1 lukem " ") oldobjs=$obj ;; 5656 1.1 lukem *[\ /]"$objbase "*) 5657 1.1 lukem while :; do 5658 1.1 lukem # Make sure we don't pick an alternate name that also 5659 1.1 lukem # overlaps. 5660 1.1 lukem newobj=lt$counter-$objbase 5661 1.1 lukem counter=`expr $counter + 1` 5662 1.1 lukem case " $oldobjs " in 5663 1.1 lukem *[\ /]"$newobj "*) ;; 5664 1.1 lukem *) if test ! -f "$gentop/$newobj"; then break; fi ;; 5665 1.1 lukem esac 5666 1.1 lukem done 5667 1.1 lukem $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" 5668 1.1 lukem $run ln "$obj" "$gentop/$newobj" || 5669 1.1 lukem $run cp "$obj" "$gentop/$newobj" 5670 1.1 lukem oldobjs="$oldobjs $gentop/$newobj" 5671 1.1 lukem ;; 5672 1.1 lukem *) oldobjs="$oldobjs $obj" ;; 5673 1.1 lukem esac 5674 1.1 lukem done 5675 1.1 lukem fi 5676 1.1 lukem 5677 1.1 lukem eval cmds=\"$old_archive_cmds\" 5678 1.1 lukem 5679 1.1 lukem if len=`expr "X$cmds" : ".*"` && 5680 1.1 lukem test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then 5681 1.1 lukem cmds=$old_archive_cmds 5682 1.1 lukem else 5683 1.1 lukem # the command line is too long to link in one step, link in parts 5684 1.2 agc $ECHO "using piecewise archive linking..." 5685 1.1 lukem save_RANLIB=$RANLIB 5686 1.1 lukem RANLIB=: 5687 1.1 lukem objlist= 5688 1.1 lukem concat_cmds= 5689 1.1 lukem save_oldobjs=$oldobjs 5690 1.1 lukem 5691 1.1 lukem # Is there a better way of finding the last object in the list? 5692 1.1 lukem for obj in $save_oldobjs 5693 1.1 lukem do 5694 1.1 lukem last_oldobj=$obj 5695 1.1 lukem done 5696 1.1 lukem for obj in $save_oldobjs 5697 1.1 lukem do 5698 1.1 lukem oldobjs="$objlist $obj" 5699 1.1 lukem objlist="$objlist $obj" 5700 1.1 lukem eval test_cmds=\"$old_archive_cmds\" 5701 1.1 lukem if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && 5702 1.1 lukem test "$len" -le "$max_cmd_len"; then 5703 1.1 lukem : 5704 1.1 lukem else 5705 1.1 lukem # the above command should be used before it gets too long 5706 1.1 lukem oldobjs=$objlist 5707 1.1 lukem if test "$obj" = "$last_oldobj" ; then 5708 1.1 lukem RANLIB=$save_RANLIB 5709 1.1 lukem fi 5710 1.1 lukem test -z "$concat_cmds" || concat_cmds=$concat_cmds~ 5711 1.1 lukem eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" 5712 1.1 lukem objlist= 5713 1.1 lukem fi 5714 1.1 lukem done 5715 1.1 lukem RANLIB=$save_RANLIB 5716 1.1 lukem oldobjs=$objlist 5717 1.1 lukem if test "X$oldobjs" = "X" ; then 5718 1.1 lukem eval cmds=\"\$concat_cmds\" 5719 1.1 lukem else 5720 1.1 lukem eval cmds=\"\$concat_cmds~\$old_archive_cmds\" 5721 1.1 lukem fi 5722 1.1 lukem fi 5723 1.1 lukem fi 5724 1.1 lukem save_ifs="$IFS"; IFS='~' 5725 1.1 lukem for cmd in $cmds; do 5726 1.1 lukem eval cmd=\"$cmd\" 5727 1.1 lukem IFS="$save_ifs" 5728 1.1 lukem $show "$cmd" 5729 1.1 lukem $run eval "$cmd" || exit $? 5730 1.1 lukem done 5731 1.1 lukem IFS="$save_ifs" 5732 1.1 lukem done 5733 1.1 lukem 5734 1.1 lukem if test -n "$generated"; then 5735 1.1 lukem $show "${rm}r$generated" 5736 1.1 lukem $run ${rm}r$generated 5737 1.1 lukem fi 5738 1.1 lukem 5739 1.1 lukem # Now create the libtool archive. 5740 1.1 lukem case $output in 5741 1.1 lukem *.la) 5742 1.1 lukem old_library= 5743 1.1 lukem test "$build_old_libs" = yes && old_library="$libname.$libext" 5744 1.1 lukem $show "creating $output" 5745 1.1 lukem 5746 1.1 lukem # Preserve any variables that may affect compiler behavior 5747 1.1 lukem for var in $variables_saved_for_relink; do 5748 1.1 lukem if eval test -z \"\${$var+set}\"; then 5749 1.1 lukem relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" 5750 1.1 lukem elif eval var_value=\$$var; test -z "$var_value"; then 5751 1.1 lukem relink_command="$var=; export $var; $relink_command" 5752 1.1 lukem else 5753 1.2 agc var_value=`$ECHO "X$var_value" | $Xsed -e "$sed_quote_subst"` 5754 1.1 lukem relink_command="$var=\"$var_value\"; export $var; $relink_command" 5755 1.1 lukem fi 5756 1.1 lukem done 5757 1.1 lukem # Quote the link command for shipping. 5758 1.1 lukem relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" 5759 1.2 agc relink_command=`$ECHO "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` 5760 1.1 lukem if test "$hardcode_automatic" = yes ; then 5761 1.1 lukem relink_command= 5762 1.1 lukem fi 5763 1.1 lukem 5764 1.1 lukem 5765 1.1 lukem # Only create the output if not a dry run. 5766 1.1 lukem if test -z "$run"; then 5767 1.1 lukem for installed in no yes; do 5768 1.1 lukem if test "$installed" = yes; then 5769 1.1 lukem if test -z "$install_libdir"; then 5770 1.1 lukem break 5771 1.1 lukem fi 5772 1.1 lukem output="$output_objdir/$outputname"i 5773 1.1 lukem # Replace all uninstalled libtool libraries with the installed ones 5774 1.1 lukem newdependency_libs= 5775 1.1 lukem for deplib in $dependency_libs; do 5776 1.1 lukem case $deplib in 5777 1.1 lukem *.la) 5778 1.2 agc name=`$ECHO "X$deplib" | $Xsed -e 's%^.*/%%'` 5779 1.1 lukem eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` 5780 1.1 lukem if test -z "$libdir"; then 5781 1.2 agc $ECHO "$modename: \`$deplib' is not a valid libtool archive" 1>&2 5782 1.1 lukem exit $EXIT_FAILURE 5783 1.1 lukem fi 5784 1.1 lukem newdependency_libs="$newdependency_libs $libdir/$name" 5785 1.1 lukem ;; 5786 1.1 lukem *) newdependency_libs="$newdependency_libs $deplib" ;; 5787 1.1 lukem esac 5788 1.1 lukem done 5789 1.1 lukem dependency_libs="$newdependency_libs" 5790 1.1 lukem newdlfiles= 5791 1.1 lukem for lib in $dlfiles; do 5792 1.2 agc name=`$ECHO "X$lib" | $Xsed -e 's%^.*/%%'` 5793 1.1 lukem eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` 5794 1.1 lukem if test -z "$libdir"; then 5795 1.2 agc $ECHO "$modename: \`$lib' is not a valid libtool archive" 1>&2 5796 1.1 lukem exit $EXIT_FAILURE 5797 1.1 lukem fi 5798 1.1 lukem newdlfiles="$newdlfiles $libdir/$name" 5799 1.1 lukem done 5800 1.1 lukem dlfiles="$newdlfiles" 5801 1.1 lukem newdlprefiles= 5802 1.1 lukem for lib in $dlprefiles; do 5803 1.2 agc name=`$ECHO "X$lib" | $Xsed -e 's%^.*/%%'` 5804 1.1 lukem eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` 5805 1.1 lukem if test -z "$libdir"; then 5806 1.2 agc $ECHO "$modename: \`$lib' is not a valid libtool archive" 1>&2 5807 1.1 lukem exit $EXIT_FAILURE 5808 1.1 lukem fi 5809 1.1 lukem newdlprefiles="$newdlprefiles $libdir/$name" 5810 1.1 lukem done 5811 1.1 lukem dlprefiles="$newdlprefiles" 5812 1.1 lukem else 5813 1.1 lukem newdlfiles= 5814 1.1 lukem for lib in $dlfiles; do 5815 1.1 lukem case $lib in 5816 1.1 lukem [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; 5817 1.1 lukem *) abs=`pwd`"/$lib" ;; 5818 1.1 lukem esac 5819 1.1 lukem newdlfiles="$newdlfiles $abs" 5820 1.1 lukem done 5821 1.1 lukem dlfiles="$newdlfiles" 5822 1.1 lukem newdlprefiles= 5823 1.1 lukem for lib in $dlprefiles; do 5824 1.1 lukem case $lib in 5825 1.1 lukem [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; 5826 1.1 lukem *) abs=`pwd`"/$lib" ;; 5827 1.1 lukem esac 5828 1.1 lukem newdlprefiles="$newdlprefiles $abs" 5829 1.1 lukem done 5830 1.1 lukem dlprefiles="$newdlprefiles" 5831 1.1 lukem fi 5832 1.1 lukem $rm $output 5833 1.1 lukem # place dlname in correct position for cygwin 5834 1.1 lukem tdlname=$dlname 5835 1.1 lukem case $host,$output,$installed,$module,$dlname in 5836 1.1 lukem *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; 5837 1.1 lukem esac 5838 1.2 agc $ECHO > $output "\ 5839 1.1 lukem # $outputname - a libtool library file 5840 1.1 lukem # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP 5841 1.1 lukem # 5842 1.1 lukem # Please DO NOT delete this file! 5843 1.1 lukem # It is necessary for linking the library. 5844 1.1 lukem 5845 1.1 lukem # The name that we can dlopen(3). 5846 1.1 lukem dlname='$tdlname' 5847 1.1 lukem 5848 1.1 lukem # Names of this library. 5849 1.1 lukem library_names='$library_names' 5850 1.1 lukem 5851 1.1 lukem # The name of the static archive. 5852 1.1 lukem old_library='$old_library' 5853 1.1 lukem 5854 1.1 lukem # Libraries that this one depends upon. 5855 1.1 lukem dependency_libs='$dependency_libs' 5856 1.1 lukem 5857 1.1 lukem # Version information for $libname. 5858 1.1 lukem current=$current 5859 1.1 lukem age=$age 5860 1.1 lukem revision=$revision 5861 1.1 lukem 5862 1.1 lukem # Is this an already installed library? 5863 1.1 lukem installed=$installed 5864 1.1 lukem 5865 1.1 lukem # Should we warn about portability when linking against -modules? 5866 1.1 lukem shouldnotlink=$module 5867 1.1 lukem 5868 1.1 lukem # Files to dlopen/dlpreopen 5869 1.1 lukem dlopen='$dlfiles' 5870 1.1 lukem dlpreopen='$dlprefiles' 5871 1.1 lukem 5872 1.1 lukem # Directory that this library needs to be installed in: 5873 1.1 lukem libdir='$install_libdir'" 5874 1.1 lukem if test "$installed" = no && test "$need_relink" = yes; then 5875 1.2 agc $ECHO >> $output "\ 5876 1.1 lukem relink_command=\"$relink_command\"" 5877 1.1 lukem fi 5878 1.1 lukem done 5879 1.1 lukem fi 5880 1.1 lukem 5881 1.1 lukem # Do a symbolic link so that the libtool archive can be found in 5882 1.1 lukem # LD_LIBRARY_PATH before the program is installed. 5883 1.1 lukem $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" 5884 1.1 lukem $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? 5885 1.1 lukem ;; 5886 1.1 lukem esac 5887 1.1 lukem exit $EXIT_SUCCESS 5888 1.1 lukem ;; 5889 1.1 lukem 5890 1.1 lukem # libtool install mode 5891 1.1 lukem install) 5892 1.1 lukem modename="$modename: install" 5893 1.1 lukem 5894 1.1 lukem # There may be an optional sh(1) argument at the beginning of 5895 1.1 lukem # install_prog (especially on Windows NT). 5896 1.1 lukem if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || 5897 1.1 lukem # Allow the use of GNU shtool's install command. 5898 1.2 agc $ECHO "X$nonopt" | grep shtool > /dev/null; then 5899 1.1 lukem # Aesthetically quote it. 5900 1.2 agc arg=`$ECHO "X$nonopt" | $Xsed -e "$sed_quote_subst"` 5901 1.1 lukem case $arg in 5902 1.1 lukem *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 5903 1.1 lukem arg="\"$arg\"" 5904 1.1 lukem ;; 5905 1.1 lukem esac 5906 1.1 lukem install_prog="$arg " 5907 1.1 lukem arg="$1" 5908 1.1 lukem shift 5909 1.1 lukem else 5910 1.1 lukem install_prog= 5911 1.1 lukem arg=$nonopt 5912 1.1 lukem fi 5913 1.1 lukem 5914 1.1 lukem # The real first argument should be the name of the installation program. 5915 1.1 lukem # Aesthetically quote it. 5916 1.2 agc arg=`$ECHO "X$arg" | $Xsed -e "$sed_quote_subst"` 5917 1.1 lukem case $arg in 5918 1.1 lukem *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 5919 1.1 lukem arg="\"$arg\"" 5920 1.1 lukem ;; 5921 1.1 lukem esac 5922 1.1 lukem install_prog="$install_prog$arg" 5923 1.1 lukem 5924 1.1 lukem # We need to accept at least all the BSD install flags. 5925 1.1 lukem dest= 5926 1.1 lukem files= 5927 1.1 lukem opts= 5928 1.1 lukem prev= 5929 1.1 lukem install_type= 5930 1.1 lukem isdir=no 5931 1.1 lukem stripme= 5932 1.1 lukem for arg 5933 1.1 lukem do 5934 1.1 lukem if test -n "$dest"; then 5935 1.1 lukem files="$files $dest" 5936 1.1 lukem dest=$arg 5937 1.1 lukem continue 5938 1.1 lukem fi 5939 1.1 lukem 5940 1.1 lukem case $arg in 5941 1.1 lukem -d) isdir=yes ;; 5942 1.1 lukem -f) 5943 1.1 lukem case " $install_prog " in 5944 1.1 lukem *[\\\ /]cp\ *) ;; 5945 1.1 lukem *) prev=$arg ;; 5946 1.1 lukem esac 5947 1.1 lukem ;; 5948 1.1 lukem -g | -m | -o) prev=$arg ;; 5949 1.1 lukem -s) 5950 1.1 lukem stripme=" -s" 5951 1.1 lukem continue 5952 1.1 lukem ;; 5953 1.1 lukem -*) 5954 1.1 lukem ;; 5955 1.1 lukem *) 5956 1.1 lukem # If the previous option needed an argument, then skip it. 5957 1.1 lukem if test -n "$prev"; then 5958 1.1 lukem prev= 5959 1.1 lukem else 5960 1.1 lukem dest=$arg 5961 1.1 lukem continue 5962 1.1 lukem fi 5963 1.1 lukem ;; 5964 1.1 lukem esac 5965 1.1 lukem 5966 1.1 lukem # Aesthetically quote the argument. 5967 1.2 agc arg=`$ECHO "X$arg" | $Xsed -e "$sed_quote_subst"` 5968 1.1 lukem case $arg in 5969 1.1 lukem *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 5970 1.1 lukem arg="\"$arg\"" 5971 1.1 lukem ;; 5972 1.1 lukem esac 5973 1.1 lukem install_prog="$install_prog $arg" 5974 1.1 lukem done 5975 1.1 lukem 5976 1.1 lukem if test -z "$install_prog"; then 5977 1.2 agc $ECHO "$modename: you must specify an install program" 1>&2 5978 1.2 agc $ECHO "$help" 1>&2 5979 1.1 lukem exit $EXIT_FAILURE 5980 1.1 lukem fi 5981 1.1 lukem 5982 1.1 lukem if test -n "$prev"; then 5983 1.2 agc $ECHO "$modename: the \`$prev' option requires an argument" 1>&2 5984 1.2 agc $ECHO "$help" 1>&2 5985 1.1 lukem exit $EXIT_FAILURE 5986 1.1 lukem fi 5987 1.1 lukem 5988 1.1 lukem if test -z "$files"; then 5989 1.1 lukem if test -z "$dest"; then 5990 1.2 agc $ECHO "$modename: no file or destination specified" 1>&2 5991 1.1 lukem else 5992 1.2 agc $ECHO "$modename: you must specify a destination" 1>&2 5993 1.1 lukem fi 5994 1.2 agc $ECHO "$help" 1>&2 5995 1.1 lukem exit $EXIT_FAILURE 5996 1.1 lukem fi 5997 1.1 lukem 5998 1.1 lukem # Canonicalise the pathname: 5999 1.1 lukem # - remove foo/../ 6000 1.1 lukem # - replace // 6001 1.1 lukem # - remove /./ 6002 1.1 lukem # - strip any trailing / 6003 1.1 lukem tmp="" 6004 1.1 lukem while test "$dest" != "$tmp"; do 6005 1.1 lukem tmp=$dest 6006 1.2 agc dest=`$ECHO "X$dest" | $Xsed -e 's%[^/.][^/.]*/\.\.%%g' -e 's%/\./%/%g' -e 's%//*%/%g' -e 's%/$%%g'` 6007 1.1 lukem done 6008 1.1 lukem 6009 1.1 lukem # Check to see that the destination is a directory. 6010 1.1 lukem test -d "$dest" && isdir=yes 6011 1.1 lukem if test "$isdir" = yes; then 6012 1.1 lukem destdir="$dest" 6013 1.1 lukem destname= 6014 1.1 lukem else 6015 1.2 agc destdir=`$ECHO "X$dest" | $Xsed -e 's%/[^/]*$%%'` 6016 1.1 lukem test "X$destdir" = "X$dest" && destdir=. 6017 1.2 agc destname=`$ECHO "X$dest" | $Xsed -e 's%^.*/%%'` 6018 1.1 lukem 6019 1.1 lukem # Not a directory, so check to see that there is only one file specified. 6020 1.1 lukem set dummy $files 6021 1.1 lukem if test "$#" -gt 2; then 6022 1.2 agc $ECHO "$modename: \`$dest' is not a directory" 1>&2 6023 1.2 agc $ECHO "$help" 1>&2 6024 1.1 lukem exit $EXIT_FAILURE 6025 1.1 lukem fi 6026 1.1 lukem fi 6027 1.1 lukem case $destdir in 6028 1.1 lukem [\\/]* | [A-Za-z]:[\\/]*) ;; 6029 1.1 lukem *) 6030 1.1 lukem for file in $files; do 6031 1.1 lukem case $file in 6032 1.1 lukem *.lo) ;; 6033 1.1 lukem *) 6034 1.2 agc $ECHO "$modename: \`$destdir' must be an absolute directory name" 1>&2 6035 1.2 agc $ECHO "$help" 1>&2 6036 1.1 lukem exit $EXIT_FAILURE 6037 1.1 lukem ;; 6038 1.1 lukem esac 6039 1.1 lukem done 6040 1.1 lukem ;; 6041 1.1 lukem esac 6042 1.1 lukem 6043 1.1 lukem # This variable tells wrapper scripts just to set variables rather 6044 1.1 lukem # than running their programs. 6045 1.1 lukem libtool_install_magic="$magic" 6046 1.1 lukem 6047 1.1 lukem staticlibs= 6048 1.1 lukem future_libdirs= 6049 1.1 lukem current_libdirs= 6050 1.1 lukem for file in $files; do 6051 1.1 lukem 6052 1.1 lukem # Do each installation. 6053 1.1 lukem case $file in 6054 1.1 lukem *.$libext) 6055 1.1 lukem # Do the static libraries later. 6056 1.1 lukem staticlibs="$staticlibs $file" 6057 1.1 lukem ;; 6058 1.1 lukem 6059 1.1 lukem *.la) 6060 1.1 lukem # Check to see that this really is a libtool archive. 6061 1.1 lukem if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : 6062 1.1 lukem else 6063 1.2 agc $ECHO "$modename: \`$file' is not a valid libtool archive" 1>&2 6064 1.2 agc $ECHO "$help" 1>&2 6065 1.1 lukem exit $EXIT_FAILURE 6066 1.1 lukem fi 6067 1.1 lukem 6068 1.1 lukem library_names= 6069 1.1 lukem old_library= 6070 1.1 lukem relink_command= 6071 1.1 lukem # If there is no directory component, then add one. 6072 1.1 lukem case $file in 6073 1.1 lukem */* | *\\*) . $file ;; 6074 1.1 lukem *) . ./$file ;; 6075 1.1 lukem esac 6076 1.1 lukem 6077 1.1 lukem # Add the libdir to current_libdirs if it is the destination. 6078 1.1 lukem if test "X$destdir" = "X$libdir"; then 6079 1.1 lukem case "$current_libdirs " in 6080 1.1 lukem *" $libdir "*) ;; 6081 1.1 lukem *) current_libdirs="$current_libdirs $libdir" ;; 6082 1.1 lukem esac 6083 1.1 lukem else 6084 1.1 lukem # Note the libdir as a future libdir. 6085 1.1 lukem case "$future_libdirs " in 6086 1.1 lukem *" $libdir "*) ;; 6087 1.1 lukem *) future_libdirs="$future_libdirs $libdir" ;; 6088 1.1 lukem esac 6089 1.1 lukem fi 6090 1.1 lukem 6091 1.2 agc dir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'`/ 6092 1.1 lukem test "X$dir" = "X$file/" && dir= 6093 1.1 lukem dir="$dir$objdir" 6094 1.1 lukem 6095 1.1 lukem if test -n "$relink_command"; then 6096 1.1 lukem # Determine the prefix the user has applied to our future dir. 6097 1.2 agc inst_prefix_dir=`$ECHO "$destdir" | $SED "s%$libdir\$%%"` 6098 1.1 lukem 6099 1.1 lukem # Don't allow the user to place us outside of our expected 6100 1.1 lukem # location b/c this prevents finding dependent libraries that 6101 1.1 lukem # are installed to the same prefix. 6102 1.1 lukem # At present, this check doesn't affect windows .dll's that 6103 1.1 lukem # are installed into $libdir/../bin (currently, that works fine) 6104 1.1 lukem # but it's something to keep an eye on. 6105 1.1 lukem if test "$inst_prefix_dir" = "$destdir"; then 6106 1.2 agc $ECHO "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 6107 1.1 lukem exit $EXIT_FAILURE 6108 1.1 lukem fi 6109 1.1 lukem 6110 1.1 lukem if test -n "$inst_prefix_dir"; then 6111 1.1 lukem # Stick the inst_prefix_dir data into the link command. 6112 1.2 agc relink_command=`$ECHO "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP` 6113 1.1 lukem else 6114 1.2 agc relink_command=`$ECHO "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP` 6115 1.1 lukem fi 6116 1.1 lukem 6117 1.2 agc $ECHO "$modename: warning: relinking \`$file'" 1>&2 6118 1.1 lukem $show "$relink_command" 6119 1.1 lukem if $run eval "$relink_command"; then : 6120 1.1 lukem else 6121 1.2 agc $ECHO "$modename: error: relink \`$file' with the above command before installing it" 1>&2 6122 1.1 lukem exit $EXIT_FAILURE 6123 1.1 lukem fi 6124 1.1 lukem fi 6125 1.1 lukem 6126 1.1 lukem # See the names of the shared library. 6127 1.1 lukem set dummy $library_names 6128 1.1 lukem if test -n "$2"; then 6129 1.1 lukem realname="$2" 6130 1.1 lukem shift 6131 1.1 lukem shift 6132 1.1 lukem 6133 1.1 lukem srcname="$realname" 6134 1.1 lukem test -n "$relink_command" && srcname="$realname"T 6135 1.1 lukem 6136 1.1 lukem # Install the shared library and build the symlinks. 6137 1.1 lukem $show "$install_prog $dir/$srcname $destdir/$realname" 6138 1.1 lukem $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? 6139 1.1 lukem if test -n "$stripme" && test -n "$striplib"; then 6140 1.1 lukem $show "$striplib $destdir/$realname" 6141 1.1 lukem $run eval "$striplib $destdir/$realname" || exit $? 6142 1.1 lukem fi 6143 1.1 lukem 6144 1.1 lukem if test "$#" -gt 0; then 6145 1.1 lukem # Delete the old symlinks, and create new ones. 6146 1.1 lukem # Try `ln -sf' first, because the `ln' binary might depend on 6147 1.1 lukem # the symlink we replace! Solaris /bin/ln does not understand -f, 6148 1.1 lukem # so we also need to try rm && ln -s. 6149 1.1 lukem for linkname 6150 1.1 lukem do 6151 1.1 lukem if test "$linkname" != "$realname"; then 6152 1.1 lukem $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" 6153 1.1 lukem $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" 6154 1.1 lukem fi 6155 1.1 lukem done 6156 1.1 lukem fi 6157 1.1 lukem 6158 1.1 lukem # Do each command in the postinstall commands. 6159 1.1 lukem lib="$destdir/$realname" 6160 1.1 lukem cmds=$postinstall_cmds 6161 1.1 lukem save_ifs="$IFS"; IFS='~' 6162 1.1 lukem for cmd in $cmds; do 6163 1.1 lukem IFS="$save_ifs" 6164 1.1 lukem eval cmd=\"$cmd\" 6165 1.1 lukem $show "$cmd" 6166 1.1 lukem $run eval "$cmd" || { 6167 1.1 lukem lt_exit=$? 6168 1.1 lukem 6169 1.1 lukem # Restore the uninstalled library and exit 6170 1.1 lukem if test "$mode" = relink; then 6171 1.1 lukem $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' 6172 1.1 lukem fi 6173 1.1 lukem 6174 1.1 lukem exit $lt_exit 6175 1.1 lukem } 6176 1.1 lukem done 6177 1.1 lukem IFS="$save_ifs" 6178 1.1 lukem fi 6179 1.1 lukem 6180 1.1 lukem # Install the pseudo-library for information purposes. 6181 1.2 agc name=`$ECHO "X$file" | $Xsed -e 's%^.*/%%'` 6182 1.1 lukem instname="$dir/$name"i 6183 1.1 lukem $show "$install_prog $instname $destdir/$name" 6184 1.1 lukem $run eval "$install_prog $instname $destdir/$name" || exit $? 6185 1.1 lukem 6186 1.1 lukem # Maybe install the static library, too. 6187 1.1 lukem test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" 6188 1.1 lukem ;; 6189 1.1 lukem 6190 1.1 lukem *.lo) 6191 1.1 lukem # Install (i.e. copy) a libtool object. 6192 1.1 lukem 6193 1.1 lukem # Figure out destination file name, if it wasn't already specified. 6194 1.1 lukem if test -n "$destname"; then 6195 1.1 lukem destfile="$destdir/$destname" 6196 1.1 lukem else 6197 1.2 agc destfile=`$ECHO "X$file" | $Xsed -e 's%^.*/%%'` 6198 1.1 lukem destfile="$destdir/$destfile" 6199 1.1 lukem fi 6200 1.1 lukem 6201 1.1 lukem # Deduce the name of the destination old-style object file. 6202 1.1 lukem case $destfile in 6203 1.1 lukem *.lo) 6204 1.2 agc staticdest=`$ECHO "X$destfile" | $Xsed -e "$lo2o"` 6205 1.1 lukem ;; 6206 1.1 lukem *.$objext) 6207 1.1 lukem staticdest="$destfile" 6208 1.1 lukem destfile= 6209 1.1 lukem ;; 6210 1.1 lukem *) 6211 1.2 agc $ECHO "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 6212 1.2 agc $ECHO "$help" 1>&2 6213 1.1 lukem exit $EXIT_FAILURE 6214 1.1 lukem ;; 6215 1.1 lukem esac 6216 1.1 lukem 6217 1.1 lukem # Install the libtool object if requested. 6218 1.1 lukem if test -n "$destfile"; then 6219 1.1 lukem $show "$install_prog $file $destfile" 6220 1.1 lukem $run eval "$install_prog $file $destfile" || exit $? 6221 1.1 lukem fi 6222 1.1 lukem 6223 1.1 lukem # Install the old object if enabled. 6224 1.1 lukem if test "$build_old_libs" = yes; then 6225 1.1 lukem # Deduce the name of the old-style object file. 6226 1.2 agc staticobj=`$ECHO "X$file" | $Xsed -e "$lo2o"` 6227 1.1 lukem 6228 1.1 lukem $show "$install_prog $staticobj $staticdest" 6229 1.1 lukem $run eval "$install_prog \$staticobj \$staticdest" || exit $? 6230 1.1 lukem fi 6231 1.1 lukem exit $EXIT_SUCCESS 6232 1.1 lukem ;; 6233 1.1 lukem 6234 1.1 lukem *) 6235 1.1 lukem # Figure out destination file name, if it wasn't already specified. 6236 1.1 lukem if test -n "$destname"; then 6237 1.1 lukem destfile="$destdir/$destname" 6238 1.1 lukem else 6239 1.2 agc destfile=`$ECHO "X$file" | $Xsed -e 's%^.*/%%'` 6240 1.1 lukem destfile="$destdir/$destfile" 6241 1.1 lukem fi 6242 1.1 lukem 6243 1.1 lukem # If the file is missing, and there is a .exe on the end, strip it 6244 1.1 lukem # because it is most likely a libtool script we actually want to 6245 1.1 lukem # install 6246 1.1 lukem stripped_ext="" 6247 1.1 lukem case $file in 6248 1.1 lukem *.exe) 6249 1.1 lukem if test ! -f "$file"; then 6250 1.2 agc file=`$ECHO $file|${SED} 's,.exe$,,'` 6251 1.1 lukem stripped_ext=".exe" 6252 1.1 lukem fi 6253 1.1 lukem ;; 6254 1.1 lukem esac 6255 1.1 lukem 6256 1.1 lukem # Do a test to see if this is really a libtool program. 6257 1.1 lukem case $host in 6258 1.1 lukem *cygwin*|*mingw*) 6259 1.2 agc wrapper=`$ECHO $file | ${SED} -e 's,.exe$,,'` 6260 1.1 lukem ;; 6261 1.1 lukem *) 6262 1.1 lukem wrapper=$file 6263 1.1 lukem ;; 6264 1.1 lukem esac 6265 1.1 lukem if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then 6266 1.1 lukem notinst_deplibs= 6267 1.1 lukem relink_command= 6268 1.1 lukem 6269 1.1 lukem # Note that it is not necessary on cygwin/mingw to append a dot to 6270 1.1 lukem # foo even if both foo and FILE.exe exist: automatic-append-.exe 6271 1.1 lukem # behavior happens only for exec(3), not for open(2)! Also, sourcing 6272 1.1 lukem # `FILE.' does not work on cygwin managed mounts. 6273 1.1 lukem # 6274 1.1 lukem # If there is no directory component, then add one. 6275 1.1 lukem case $wrapper in 6276 1.1 lukem */* | *\\*) . ${wrapper} ;; 6277 1.1 lukem *) . ./${wrapper} ;; 6278 1.1 lukem esac 6279 1.1 lukem 6280 1.1 lukem # Check the variables that should have been set. 6281 1.1 lukem if test -z "$notinst_deplibs"; then 6282 1.2 agc $ECHO "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 6283 1.1 lukem exit $EXIT_FAILURE 6284 1.1 lukem fi 6285 1.1 lukem 6286 1.1 lukem finalize=yes 6287 1.1 lukem for lib in $notinst_deplibs; do 6288 1.1 lukem # Check to see that each library is installed. 6289 1.1 lukem libdir= 6290 1.1 lukem if test -f "$lib"; then 6291 1.1 lukem # If there is no directory component, then add one. 6292 1.1 lukem case $lib in 6293 1.1 lukem */* | *\\*) . $lib ;; 6294 1.1 lukem *) . ./$lib ;; 6295 1.1 lukem esac 6296 1.1 lukem fi 6297 1.2 agc libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test 6298 1.1 lukem if test -n "$libdir" && test ! -f "$libfile"; then 6299 1.2 agc $ECHO "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 6300 1.1 lukem finalize=no 6301 1.1 lukem fi 6302 1.1 lukem done 6303 1.1 lukem 6304 1.1 lukem relink_command= 6305 1.1 lukem # Note that it is not necessary on cygwin/mingw to append a dot to 6306 1.1 lukem # foo even if both foo and FILE.exe exist: automatic-append-.exe 6307 1.1 lukem # behavior happens only for exec(3), not for open(2)! Also, sourcing 6308 1.1 lukem # `FILE.' does not work on cygwin managed mounts. 6309 1.1 lukem # 6310 1.1 lukem # If there is no directory component, then add one. 6311 1.1 lukem case $wrapper in 6312 1.1 lukem */* | *\\*) . ${wrapper} ;; 6313 1.1 lukem *) . ./${wrapper} ;; 6314 1.1 lukem esac 6315 1.1 lukem 6316 1.1 lukem outputname= 6317 1.1 lukem if test "$fast_install" = no && test -n "$relink_command"; then 6318 1.1 lukem if test "$finalize" = yes && test -z "$run"; then 6319 1.1 lukem tmpdir=`func_mktempdir` 6320 1.2 agc file=`$ECHO "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` 6321 1.1 lukem outputname="$tmpdir/$file" 6322 1.1 lukem # Replace the output file specification. 6323 1.2 agc relink_command=`$ECHO "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP` 6324 1.1 lukem 6325 1.1 lukem $show "$relink_command" 6326 1.1 lukem if $run eval "$relink_command"; then : 6327 1.1 lukem else 6328 1.2 agc $ECHO "$modename: error: relink \`$file' with the above command before installing it" 1>&2 6329 1.1 lukem ${rm}r "$tmpdir" 6330 1.1 lukem continue 6331 1.1 lukem fi 6332 1.1 lukem file="$outputname" 6333 1.1 lukem else 6334 1.2 agc $ECHO "$modename: warning: cannot relink \`$file'" 1>&2 6335 1.1 lukem fi 6336 1.1 lukem else 6337 1.1 lukem # Install the binary that we compiled earlier. 6338 1.2 agc file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` 6339 1.1 lukem fi 6340 1.1 lukem fi 6341 1.1 lukem 6342 1.1 lukem # remove .exe since cygwin /usr/bin/install will append another 6343 1.1 lukem # one anyway 6344 1.1 lukem case $install_prog,$host in 6345 1.1 lukem */usr/bin/install*,*cygwin*) 6346 1.1 lukem case $file:$destfile in 6347 1.1 lukem *.exe:*.exe) 6348 1.1 lukem # this is ok 6349 1.1 lukem ;; 6350 1.1 lukem *.exe:*) 6351 1.1 lukem destfile=$destfile.exe 6352 1.1 lukem ;; 6353 1.1 lukem *:*.exe) 6354 1.2 agc destfile=`$ECHO $destfile | ${SED} -e 's,.exe$,,'` 6355 1.1 lukem ;; 6356 1.1 lukem esac 6357 1.1 lukem ;; 6358 1.1 lukem esac 6359 1.1 lukem $show "$install_prog$stripme $file $destfile" 6360 1.1 lukem $run eval "$install_prog\$stripme \$file \$destfile" || exit $? 6361 1.1 lukem test -n "$outputname" && ${rm}r "$tmpdir" 6362 1.1 lukem ;; 6363 1.1 lukem esac 6364 1.1 lukem done 6365 1.1 lukem 6366 1.1 lukem for file in $staticlibs; do 6367 1.2 agc name=`$ECHO "X$file" | $Xsed -e 's%^.*/%%'` 6368 1.1 lukem 6369 1.1 lukem # Set up the ranlib parameters. 6370 1.1 lukem oldlib="$destdir/$name" 6371 1.1 lukem 6372 1.1 lukem $show "$install_prog $file $oldlib" 6373 1.1 lukem $run eval "$install_prog \$file \$oldlib" || exit $? 6374 1.1 lukem 6375 1.1 lukem if test -n "$stripme" && test -n "$old_striplib"; then 6376 1.1 lukem $show "$old_striplib $oldlib" 6377 1.1 lukem $run eval "$old_striplib $oldlib" || exit $? 6378 1.1 lukem fi 6379 1.1 lukem 6380 1.1 lukem # Do each command in the postinstall commands. 6381 1.1 lukem cmds=$old_postinstall_cmds 6382 1.1 lukem save_ifs="$IFS"; IFS='~' 6383 1.1 lukem for cmd in $cmds; do 6384 1.1 lukem IFS="$save_ifs" 6385 1.1 lukem eval cmd=\"$cmd\" 6386 1.1 lukem $show "$cmd" 6387 1.1 lukem $run eval "$cmd" || exit $? 6388 1.1 lukem done 6389 1.1 lukem IFS="$save_ifs" 6390 1.1 lukem done 6391 1.1 lukem 6392 1.1 lukem if test -n "$future_libdirs"; then 6393 1.2 agc $ECHO "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 6394 1.1 lukem fi 6395 1.1 lukem 6396 1.1 lukem if test -n "$current_libdirs"; then 6397 1.1 lukem # Maybe just do a dry run. 6398 1.1 lukem test -n "$run" && current_libdirs=" -n$current_libdirs" 6399 1.1 lukem exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' 6400 1.1 lukem else 6401 1.1 lukem exit $EXIT_SUCCESS 6402 1.1 lukem fi 6403 1.1 lukem ;; 6404 1.1 lukem 6405 1.1 lukem # libtool finish mode 6406 1.1 lukem finish) 6407 1.1 lukem modename="$modename: finish" 6408 1.1 lukem libdirs="$nonopt" 6409 1.1 lukem admincmds= 6410 1.1 lukem 6411 1.1 lukem if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then 6412 1.1 lukem for dir 6413 1.1 lukem do 6414 1.1 lukem libdirs="$libdirs $dir" 6415 1.1 lukem done 6416 1.1 lukem 6417 1.1 lukem for libdir in $libdirs; do 6418 1.1 lukem if test -n "$finish_cmds"; then 6419 1.1 lukem # Do each command in the finish commands. 6420 1.1 lukem cmds=$finish_cmds 6421 1.1 lukem save_ifs="$IFS"; IFS='~' 6422 1.1 lukem for cmd in $cmds; do 6423 1.1 lukem IFS="$save_ifs" 6424 1.1 lukem eval cmd=\"$cmd\" 6425 1.1 lukem $show "$cmd" 6426 1.1 lukem $run eval "$cmd" || admincmds="$admincmds 6427 1.1 lukem $cmd" 6428 1.1 lukem done 6429 1.1 lukem IFS="$save_ifs" 6430 1.1 lukem fi 6431 1.1 lukem if test -n "$finish_eval"; then 6432 1.1 lukem # Do the single finish_eval. 6433 1.1 lukem eval cmds=\"$finish_eval\" 6434 1.1 lukem $run eval "$cmds" || admincmds="$admincmds 6435 1.1 lukem $cmds" 6436 1.1 lukem fi 6437 1.1 lukem done 6438 1.1 lukem fi 6439 1.1 lukem 6440 1.1 lukem # Exit here if they wanted silent mode. 6441 1.1 lukem test "$show" = : && exit $EXIT_SUCCESS 6442 1.1 lukem 6443 1.2 agc $ECHO "X----------------------------------------------------------------------" | $Xsed 6444 1.2 agc $ECHO "Libraries have been installed in:" 6445 1.1 lukem for libdir in $libdirs; do 6446 1.2 agc $ECHO " $libdir" 6447 1.1 lukem done 6448 1.2 agc $ECHO 6449 1.2 agc $ECHO "If you ever happen to want to link against installed libraries" 6450 1.2 agc $ECHO "in a given directory, LIBDIR, you must either use libtool, and" 6451 1.2 agc $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'" 6452 1.2 agc $ECHO "flag during linking and do at least one of the following:" 6453 1.1 lukem if test -n "$shlibpath_var"; then 6454 1.2 agc $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable" 6455 1.2 agc $ECHO " during execution" 6456 1.1 lukem fi 6457 1.1 lukem if test -n "$runpath_var"; then 6458 1.2 agc $ECHO " - add LIBDIR to the \`$runpath_var' environment variable" 6459 1.2 agc $ECHO " during linking" 6460 1.1 lukem fi 6461 1.1 lukem if test -n "$hardcode_libdir_flag_spec"; then 6462 1.1 lukem libdir=LIBDIR 6463 1.1 lukem eval flag=\"$hardcode_libdir_flag_spec\" 6464 1.1 lukem 6465 1.2 agc $ECHO " - use the \`$flag' linker flag" 6466 1.1 lukem fi 6467 1.1 lukem if test -n "$admincmds"; then 6468 1.2 agc $ECHO " - have your system administrator run these commands:$admincmds" 6469 1.1 lukem fi 6470 1.1 lukem if test -f /etc/ld.so.conf; then 6471 1.2 agc $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" 6472 1.1 lukem fi 6473 1.2 agc $ECHO 6474 1.2 agc $ECHO "See any operating system documentation about shared libraries for" 6475 1.2 agc $ECHO "more information, such as the ld(1) and ld.so(8) manual pages." 6476 1.2 agc $ECHO "X----------------------------------------------------------------------" | $Xsed 6477 1.1 lukem exit $EXIT_SUCCESS 6478 1.1 lukem ;; 6479 1.1 lukem 6480 1.1 lukem # libtool execute mode 6481 1.1 lukem execute) 6482 1.1 lukem modename="$modename: execute" 6483 1.1 lukem 6484 1.1 lukem # The first argument is the command name. 6485 1.1 lukem cmd="$nonopt" 6486 1.1 lukem if test -z "$cmd"; then 6487 1.2 agc $ECHO "$modename: you must specify a COMMAND" 1>&2 6488 1.2 agc $ECHO "$help" 6489 1.1 lukem exit $EXIT_FAILURE 6490 1.1 lukem fi 6491 1.1 lukem 6492 1.1 lukem # Handle -dlopen flags immediately. 6493 1.1 lukem for file in $execute_dlfiles; do 6494 1.1 lukem if test ! -f "$file"; then 6495 1.2 agc $ECHO "$modename: \`$file' is not a file" 1>&2 6496 1.2 agc $ECHO "$help" 1>&2 6497 1.1 lukem exit $EXIT_FAILURE 6498 1.1 lukem fi 6499 1.1 lukem 6500 1.1 lukem dir= 6501 1.1 lukem case $file in 6502 1.1 lukem *.la) 6503 1.1 lukem # Check to see that this really is a libtool archive. 6504 1.1 lukem if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : 6505 1.1 lukem else 6506 1.2 agc $ECHO "$modename: \`$lib' is not a valid libtool archive" 1>&2 6507 1.2 agc $ECHO "$help" 1>&2 6508 1.1 lukem exit $EXIT_FAILURE 6509 1.1 lukem fi 6510 1.1 lukem 6511 1.1 lukem # Read the libtool library. 6512 1.1 lukem dlname= 6513 1.1 lukem library_names= 6514 1.1 lukem 6515 1.1 lukem # If there is no directory component, then add one. 6516 1.1 lukem case $file in 6517 1.1 lukem */* | *\\*) . $file ;; 6518 1.1 lukem *) . ./$file ;; 6519 1.1 lukem esac 6520 1.1 lukem 6521 1.1 lukem # Skip this library if it cannot be dlopened. 6522 1.1 lukem if test -z "$dlname"; then 6523 1.1 lukem # Warn if it was a shared library. 6524 1.2 agc test -n "$library_names" && $ECHO "$modename: warning: \`$file' was not linked with \`-export-dynamic'" 6525 1.1 lukem continue 6526 1.1 lukem fi 6527 1.1 lukem 6528 1.2 agc dir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'` 6529 1.1 lukem test "X$dir" = "X$file" && dir=. 6530 1.1 lukem 6531 1.1 lukem if test -f "$dir/$objdir/$dlname"; then 6532 1.1 lukem dir="$dir/$objdir" 6533 1.1 lukem else 6534 1.1 lukem if test ! -f "$dir/$dlname"; then 6535 1.2 agc $ECHO "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 6536 1.1 lukem exit $EXIT_FAILURE 6537 1.1 lukem fi 6538 1.1 lukem fi 6539 1.1 lukem ;; 6540 1.1 lukem 6541 1.1 lukem *.lo) 6542 1.1 lukem # Just add the directory containing the .lo file. 6543 1.2 agc dir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'` 6544 1.1 lukem test "X$dir" = "X$file" && dir=. 6545 1.1 lukem ;; 6546 1.1 lukem 6547 1.1 lukem *) 6548 1.2 agc $ECHO "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 6549 1.1 lukem continue 6550 1.1 lukem ;; 6551 1.1 lukem esac 6552 1.1 lukem 6553 1.1 lukem # Get the absolute pathname. 6554 1.1 lukem absdir=`cd "$dir" && pwd` 6555 1.1 lukem test -n "$absdir" && dir="$absdir" 6556 1.1 lukem 6557 1.1 lukem # Now add the directory to shlibpath_var. 6558 1.1 lukem if eval "test -z \"\$$shlibpath_var\""; then 6559 1.1 lukem eval "$shlibpath_var=\"\$dir\"" 6560 1.1 lukem else 6561 1.1 lukem eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" 6562 1.1 lukem fi 6563 1.1 lukem done 6564 1.1 lukem 6565 1.1 lukem # This variable tells wrapper scripts just to set shlibpath_var 6566 1.1 lukem # rather than running their programs. 6567 1.1 lukem libtool_execute_magic="$magic" 6568 1.1 lukem 6569 1.1 lukem # Check if any of the arguments is a wrapper script. 6570 1.1 lukem args= 6571 1.1 lukem for file 6572 1.1 lukem do 6573 1.1 lukem case $file in 6574 1.1 lukem -*) ;; 6575 1.1 lukem *) 6576 1.1 lukem # Do a test to see if this is really a libtool program. 6577 1.1 lukem if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 6578 1.1 lukem # If there is no directory component, then add one. 6579 1.1 lukem case $file in 6580 1.1 lukem */* | *\\*) . $file ;; 6581 1.1 lukem *) . ./$file ;; 6582 1.1 lukem esac 6583 1.1 lukem 6584 1.1 lukem # Transform arg to wrapped name. 6585 1.1 lukem file="$progdir/$program" 6586 1.1 lukem fi 6587 1.1 lukem ;; 6588 1.1 lukem esac 6589 1.1 lukem # Quote arguments (to preserve shell metacharacters). 6590 1.2 agc file=`$ECHO "X$file" | $Xsed -e "$sed_quote_subst"` 6591 1.1 lukem args="$args \"$file\"" 6592 1.1 lukem done 6593 1.1 lukem 6594 1.1 lukem if test -z "$run"; then 6595 1.1 lukem if test -n "$shlibpath_var"; then 6596 1.1 lukem # Export the shlibpath_var. 6597 1.1 lukem eval "export $shlibpath_var" 6598 1.1 lukem fi 6599 1.1 lukem 6600 1.1 lukem # Restore saved environment variables 6601 1.1 lukem for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES 6602 1.1 lukem do 6603 1.1 lukem eval "if test \"\${save_$lt_var+set}\" = set; then 6604 1.1 lukem $lt_var=\$save_$lt_var; export $lt_var 6605 1.1 lukem fi" 6606 1.1 lukem done 6607 1.1 lukem 6608 1.1 lukem # Now prepare to actually exec the command. 6609 1.1 lukem exec_cmd="\$cmd$args" 6610 1.1 lukem else 6611 1.1 lukem # Display what would be done. 6612 1.1 lukem if test -n "$shlibpath_var"; then 6613 1.2 agc eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" 6614 1.2 agc $ECHO "export $shlibpath_var" 6615 1.1 lukem fi 6616 1.2 agc $ECHO "$cmd$args" 6617 1.1 lukem exit $EXIT_SUCCESS 6618 1.1 lukem fi 6619 1.1 lukem ;; 6620 1.1 lukem 6621 1.1 lukem # libtool clean and uninstall mode 6622 1.1 lukem clean | uninstall) 6623 1.1 lukem modename="$modename: $mode" 6624 1.1 lukem rm="$nonopt" 6625 1.1 lukem files= 6626 1.1 lukem rmforce= 6627 1.1 lukem exit_status=0 6628 1.1 lukem 6629 1.1 lukem # This variable tells wrapper scripts just to set variables rather 6630 1.1 lukem # than running their programs. 6631 1.1 lukem libtool_install_magic="$magic" 6632 1.1 lukem 6633 1.1 lukem for arg 6634 1.1 lukem do 6635 1.1 lukem case $arg in 6636 1.1 lukem -f) rm="$rm $arg"; rmforce=yes ;; 6637 1.1 lukem -*) rm="$rm $arg" ;; 6638 1.1 lukem *) files="$files $arg" ;; 6639 1.1 lukem esac 6640 1.1 lukem done 6641 1.1 lukem 6642 1.1 lukem if test -z "$rm"; then 6643 1.2 agc $ECHO "$modename: you must specify an RM program" 1>&2 6644 1.2 agc $ECHO "$help" 1>&2 6645 1.1 lukem exit $EXIT_FAILURE 6646 1.1 lukem fi 6647 1.1 lukem 6648 1.1 lukem rmdirs= 6649 1.1 lukem 6650 1.1 lukem origobjdir="$objdir" 6651 1.1 lukem for file in $files; do 6652 1.2 agc dir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'` 6653 1.1 lukem if test "X$dir" = "X$file"; then 6654 1.1 lukem dir=. 6655 1.1 lukem objdir="$origobjdir" 6656 1.1 lukem else 6657 1.1 lukem objdir="$dir/$origobjdir" 6658 1.1 lukem fi 6659 1.2 agc name=`$ECHO "X$file" | $Xsed -e 's%^.*/%%'` 6660 1.1 lukem test "$mode" = uninstall && objdir="$dir" 6661 1.1 lukem 6662 1.1 lukem # Remember objdir for removal later, being careful to avoid duplicates 6663 1.1 lukem if test "$mode" = clean; then 6664 1.1 lukem case " $rmdirs " in 6665 1.1 lukem *" $objdir "*) ;; 6666 1.1 lukem *) rmdirs="$rmdirs $objdir" ;; 6667 1.1 lukem esac 6668 1.1 lukem fi 6669 1.1 lukem 6670 1.1 lukem # Don't error if the file doesn't exist and rm -f was used. 6671 1.1 lukem if (test -L "$file") >/dev/null 2>&1 \ 6672 1.1 lukem || (test -h "$file") >/dev/null 2>&1 \ 6673 1.1 lukem || test -f "$file"; then 6674 1.1 lukem : 6675 1.1 lukem elif test -d "$file"; then 6676 1.1 lukem exit_status=1 6677 1.1 lukem continue 6678 1.1 lukem elif test "$rmforce" = yes; then 6679 1.1 lukem continue 6680 1.1 lukem fi 6681 1.1 lukem 6682 1.1 lukem rmfiles="$file" 6683 1.1 lukem 6684 1.1 lukem case $name in 6685 1.1 lukem *.la) 6686 1.1 lukem # Possibly a libtool archive, so verify it. 6687 1.1 lukem if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 6688 1.1 lukem . $dir/$name 6689 1.1 lukem 6690 1.1 lukem # Delete the libtool libraries and symlinks. 6691 1.1 lukem for n in $library_names; do 6692 1.1 lukem rmfiles="$rmfiles $objdir/$n" 6693 1.1 lukem done 6694 1.1 lukem test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" 6695 1.1 lukem 6696 1.1 lukem case "$mode" in 6697 1.1 lukem clean) 6698 1.1 lukem case " $library_names " in 6699 1.1 lukem # " " in the beginning catches empty $dlname 6700 1.1 lukem *" $dlname "*) ;; 6701 1.1 lukem *) rmfiles="$rmfiles $objdir/$dlname" ;; 6702 1.1 lukem esac 6703 1.1 lukem test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" 6704 1.1 lukem ;; 6705 1.1 lukem uninstall) 6706 1.1 lukem if test -n "$library_names"; then 6707 1.1 lukem # Do each command in the postuninstall commands. 6708 1.1 lukem cmds=$postuninstall_cmds 6709 1.1 lukem save_ifs="$IFS"; IFS='~' 6710 1.1 lukem for cmd in $cmds; do 6711 1.1 lukem IFS="$save_ifs" 6712 1.1 lukem eval cmd=\"$cmd\" 6713 1.1 lukem $show "$cmd" 6714 1.1 lukem $run eval "$cmd" 6715 1.1 lukem if test "$?" -ne 0 && test "$rmforce" != yes; then 6716 1.1 lukem exit_status=1 6717 1.1 lukem fi 6718 1.1 lukem done 6719 1.1 lukem IFS="$save_ifs" 6720 1.1 lukem fi 6721 1.1 lukem 6722 1.1 lukem if test -n "$old_library"; then 6723 1.1 lukem # Do each command in the old_postuninstall commands. 6724 1.1 lukem cmds=$old_postuninstall_cmds 6725 1.1 lukem save_ifs="$IFS"; IFS='~' 6726 1.1 lukem for cmd in $cmds; do 6727 1.1 lukem IFS="$save_ifs" 6728 1.1 lukem eval cmd=\"$cmd\" 6729 1.1 lukem $show "$cmd" 6730 1.1 lukem $run eval "$cmd" 6731 1.1 lukem if test "$?" -ne 0 && test "$rmforce" != yes; then 6732 1.1 lukem exit_status=1 6733 1.1 lukem fi 6734 1.1 lukem done 6735 1.1 lukem IFS="$save_ifs" 6736 1.1 lukem fi 6737 1.1 lukem # FIXME: should reinstall the best remaining shared library. 6738 1.1 lukem ;; 6739 1.1 lukem esac 6740 1.1 lukem fi 6741 1.1 lukem ;; 6742 1.1 lukem 6743 1.1 lukem *.lo) 6744 1.1 lukem # Possibly a libtool object, so verify it. 6745 1.1 lukem if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 6746 1.1 lukem 6747 1.1 lukem # Read the .lo file 6748 1.1 lukem . $dir/$name 6749 1.1 lukem 6750 1.1 lukem # Add PIC object to the list of files to remove. 6751 1.1 lukem if test -n "$pic_object" \ 6752 1.1 lukem && test "$pic_object" != none; then 6753 1.1 lukem rmfiles="$rmfiles $dir/$pic_object" 6754 1.1 lukem fi 6755 1.1 lukem 6756 1.1 lukem # Add non-PIC object to the list of files to remove. 6757 1.1 lukem if test -n "$non_pic_object" \ 6758 1.1 lukem && test "$non_pic_object" != none; then 6759 1.1 lukem rmfiles="$rmfiles $dir/$non_pic_object" 6760 1.1 lukem fi 6761 1.1 lukem fi 6762 1.1 lukem ;; 6763 1.1 lukem 6764 1.1 lukem *) 6765 1.1 lukem if test "$mode" = clean ; then 6766 1.1 lukem noexename=$name 6767 1.1 lukem case $file in 6768 1.1 lukem *.exe) 6769 1.2 agc file=`$ECHO $file|${SED} 's,.exe$,,'` 6770 1.2 agc noexename=`$ECHO $name|${SED} 's,.exe$,,'` 6771 1.1 lukem # $file with .exe has already been added to rmfiles, 6772 1.1 lukem # add $file without .exe 6773 1.1 lukem rmfiles="$rmfiles $file" 6774 1.1 lukem ;; 6775 1.1 lukem esac 6776 1.1 lukem # Do a test to see if this is a libtool program. 6777 1.1 lukem if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 6778 1.1 lukem relink_command= 6779 1.1 lukem . $dir/$noexename 6780 1.1 lukem 6781 1.1 lukem # note $name still contains .exe if it was in $file originally 6782 1.1 lukem # as does the version of $file that was added into $rmfiles 6783 1.1 lukem rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" 6784 1.1 lukem if test "$fast_install" = yes && test -n "$relink_command"; then 6785 1.1 lukem rmfiles="$rmfiles $objdir/lt-$name" 6786 1.1 lukem fi 6787 1.1 lukem if test "X$noexename" != "X$name" ; then 6788 1.1 lukem rmfiles="$rmfiles $objdir/lt-${noexename}.c" 6789 1.1 lukem fi 6790 1.1 lukem fi 6791 1.1 lukem fi 6792 1.1 lukem ;; 6793 1.1 lukem esac 6794 1.1 lukem $show "$rm $rmfiles" 6795 1.1 lukem $run $rm $rmfiles || exit_status=1 6796 1.1 lukem done 6797 1.1 lukem objdir="$origobjdir" 6798 1.1 lukem 6799 1.1 lukem # Try to remove the ${objdir}s in the directories where we deleted files 6800 1.1 lukem for dir in $rmdirs; do 6801 1.1 lukem if test -d "$dir"; then 6802 1.1 lukem $show "rmdir $dir" 6803 1.1 lukem $run rmdir $dir >/dev/null 2>&1 6804 1.1 lukem fi 6805 1.1 lukem done 6806 1.1 lukem 6807 1.1 lukem exit $exit_status 6808 1.1 lukem ;; 6809 1.1 lukem 6810 1.1 lukem "") 6811 1.2 agc $ECHO "$modename: you must specify a MODE" 1>&2 6812 1.2 agc $ECHO "$generic_help" 1>&2 6813 1.1 lukem exit $EXIT_FAILURE 6814 1.1 lukem ;; 6815 1.1 lukem esac 6816 1.1 lukem 6817 1.1 lukem if test -z "$exec_cmd"; then 6818 1.2 agc $ECHO "$modename: invalid operation mode \`$mode'" 1>&2 6819 1.2 agc $ECHO "$generic_help" 1>&2 6820 1.1 lukem exit $EXIT_FAILURE 6821 1.1 lukem fi 6822 1.1 lukem fi # test -z "$show_help" 6823 1.1 lukem 6824 1.1 lukem if test -n "$exec_cmd"; then 6825 1.1 lukem eval exec $exec_cmd 6826 1.1 lukem exit $EXIT_FAILURE 6827 1.1 lukem fi 6828 1.1 lukem 6829 1.1 lukem # We need to display help for each of the modes. 6830 1.1 lukem case $mode in 6831 1.2 agc "") $ECHO \ 6832 1.1 lukem "Usage: $modename [OPTION]... [MODE-ARG]... 6833 1.1 lukem 6834 1.1 lukem Provide generalized library-building support services. 6835 1.1 lukem 6836 1.1 lukem --config show all configuration variables 6837 1.1 lukem --debug enable verbose shell tracing 6838 1.1 lukem -n, --dry-run display commands without modifying any files 6839 1.1 lukem --features display basic configuration information and exit 6840 1.1 lukem --finish same as \`--mode=finish' 6841 1.1 lukem --help display this help message and exit 6842 1.1 lukem --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] 6843 1.1 lukem --quiet same as \`--silent' 6844 1.1 lukem --silent don't print informational messages 6845 1.1 lukem --tag=TAG use configuration variables from tag TAG 6846 1.1 lukem --version print version information 6847 1.1 lukem 6848 1.1 lukem MODE must be one of the following: 6849 1.1 lukem 6850 1.1 lukem clean remove files from the build directory 6851 1.1 lukem compile compile a source file into a libtool object 6852 1.1 lukem execute automatically set library path, then run a program 6853 1.1 lukem finish complete the installation of libtool libraries 6854 1.1 lukem install install libraries or executables 6855 1.1 lukem link create a library or an executable 6856 1.1 lukem uninstall remove libraries from an installed directory 6857 1.1 lukem 6858 1.1 lukem MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for 6859 1.1 lukem a more detailed description of MODE. 6860 1.1 lukem 6861 1.1 lukem Report bugs to <bug-libtool (at] gnu.org>." 6862 1.1 lukem exit $EXIT_SUCCESS 6863 1.1 lukem ;; 6864 1.1 lukem 6865 1.1 lukem clean) 6866 1.2 agc $ECHO \ 6867 1.1 lukem "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... 6868 1.1 lukem 6869 1.1 lukem Remove files from the build directory. 6870 1.1 lukem 6871 1.1 lukem RM is the name of the program to use to delete files associated with each FILE 6872 1.1 lukem (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed 6873 1.1 lukem to RM. 6874 1.1 lukem 6875 1.1 lukem If FILE is a libtool library, object or program, all the files associated 6876 1.1 lukem with it are deleted. Otherwise, only FILE itself is deleted using RM." 6877 1.1 lukem ;; 6878 1.1 lukem 6879 1.1 lukem compile) 6880 1.2 agc $ECHO \ 6881 1.1 lukem "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE 6882 1.1 lukem 6883 1.1 lukem Compile a source file into a libtool library object. 6884 1.1 lukem 6885 1.1 lukem This mode accepts the following additional options: 6886 1.1 lukem 6887 1.1 lukem -o OUTPUT-FILE set the output file name to OUTPUT-FILE 6888 1.1 lukem -prefer-pic try to building PIC objects only 6889 1.1 lukem -prefer-non-pic try to building non-PIC objects only 6890 1.1 lukem -static always build a \`.o' file suitable for static linking 6891 1.1 lukem 6892 1.1 lukem COMPILE-COMMAND is a command to be used in creating a \`standard' object file 6893 1.1 lukem from the given SOURCEFILE. 6894 1.1 lukem 6895 1.1 lukem The output file name is determined by removing the directory component from 6896 1.1 lukem SOURCEFILE, then substituting the C source code suffix \`.c' with the 6897 1.1 lukem library object suffix, \`.lo'." 6898 1.1 lukem ;; 6899 1.1 lukem 6900 1.1 lukem execute) 6901 1.2 agc $ECHO \ 6902 1.1 lukem "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... 6903 1.1 lukem 6904 1.1 lukem Automatically set library path, then run a program. 6905 1.1 lukem 6906 1.1 lukem This mode accepts the following additional options: 6907 1.1 lukem 6908 1.1 lukem -dlopen FILE add the directory containing FILE to the library path 6909 1.1 lukem 6910 1.1 lukem This mode sets the library path environment variable according to \`-dlopen' 6911 1.1 lukem flags. 6912 1.1 lukem 6913 1.1 lukem If any of the ARGS are libtool executable wrappers, then they are translated 6914 1.1 lukem into their corresponding uninstalled binary, and any of their required library 6915 1.1 lukem directories are added to the library path. 6916 1.1 lukem 6917 1.1 lukem Then, COMMAND is executed, with ARGS as arguments." 6918 1.1 lukem ;; 6919 1.1 lukem 6920 1.1 lukem finish) 6921 1.2 agc $ECHO \ 6922 1.1 lukem "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... 6923 1.1 lukem 6924 1.1 lukem Complete the installation of libtool libraries. 6925 1.1 lukem 6926 1.1 lukem Each LIBDIR is a directory that contains libtool libraries. 6927 1.1 lukem 6928 1.1 lukem The commands that this mode executes may require superuser privileges. Use 6929 1.1 lukem the \`--dry-run' option if you just want to see what would be executed." 6930 1.1 lukem ;; 6931 1.1 lukem 6932 1.1 lukem install) 6933 1.2 agc $ECHO \ 6934 1.1 lukem "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... 6935 1.1 lukem 6936 1.1 lukem Install executables or libraries. 6937 1.1 lukem 6938 1.1 lukem INSTALL-COMMAND is the installation command. The first component should be 6939 1.1 lukem either the \`install' or \`cp' program. 6940 1.1 lukem 6941 1.1 lukem The rest of the components are interpreted as arguments to that command (only 6942 1.1 lukem BSD-compatible install options are recognized)." 6943 1.1 lukem ;; 6944 1.1 lukem 6945 1.1 lukem link) 6946 1.2 agc $ECHO \ 6947 1.1 lukem "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... 6948 1.1 lukem 6949 1.1 lukem Link object files or libraries together to form another library, or to 6950 1.1 lukem create an executable program. 6951 1.1 lukem 6952 1.1 lukem LINK-COMMAND is a command using the C compiler that you would use to create 6953 1.1 lukem a program from several object files. 6954 1.1 lukem 6955 1.1 lukem The following components of LINK-COMMAND are treated specially: 6956 1.1 lukem 6957 1.1 lukem -all-static do not do any dynamic linking at all 6958 1.1 lukem -avoid-version do not add a version suffix if possible 6959 1.1 lukem -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime 6960 1.1 lukem -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols 6961 1.1 lukem -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) 6962 1.1 lukem -export-symbols SYMFILE 6963 1.1 lukem try to export only the symbols listed in SYMFILE 6964 1.1 lukem -export-symbols-regex REGEX 6965 1.1 lukem try to export only the symbols matching REGEX 6966 1.1 lukem -LLIBDIR search LIBDIR for required installed libraries 6967 1.1 lukem -lNAME OUTPUT-FILE requires the installed library libNAME 6968 1.1 lukem -module build a library that can dlopened 6969 1.1 lukem -no-fast-install disable the fast-install mode 6970 1.1 lukem -no-install link a not-installable executable 6971 1.1 lukem -no-undefined declare that a library does not refer to external symbols 6972 1.1 lukem -o OUTPUT-FILE create OUTPUT-FILE from the specified objects 6973 1.1 lukem -objectlist FILE Use a list of object files found in FILE to specify objects 6974 1.1 lukem -precious-files-regex REGEX 6975 1.1 lukem don't remove output files matching REGEX 6976 1.1 lukem -release RELEASE specify package release information 6977 1.1 lukem -rpath LIBDIR the created library will eventually be installed in LIBDIR 6978 1.1 lukem -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries 6979 1.1 lukem -static do not do any dynamic linking of uninstalled libtool libraries 6980 1.1 lukem -static-libtool-libs 6981 1.1 lukem do not do any dynamic linking of libtool libraries 6982 1.1 lukem -version-info CURRENT[:REVISION[:AGE]] 6983 1.1 lukem specify library version info [each variable defaults to 0] 6984 1.1 lukem 6985 1.1 lukem All other options (arguments beginning with \`-') are ignored. 6986 1.1 lukem 6987 1.1 lukem Every other argument is treated as a filename. Files ending in \`.la' are 6988 1.1 lukem treated as uninstalled libtool libraries, other files are standard or library 6989 1.1 lukem object files. 6990 1.1 lukem 6991 1.1 lukem If the OUTPUT-FILE ends in \`.la', then a libtool library is created, 6992 1.1 lukem only library objects (\`.lo' files) may be specified, and \`-rpath' is 6993 1.1 lukem required, except when creating a convenience library. 6994 1.1 lukem 6995 1.1 lukem If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created 6996 1.1 lukem using \`ar' and \`ranlib', or on Windows using \`lib'. 6997 1.1 lukem 6998 1.1 lukem If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file 6999 1.1 lukem is created, otherwise an executable program is created." 7000 1.1 lukem ;; 7001 1.1 lukem 7002 1.1 lukem uninstall) 7003 1.2 agc $ECHO \ 7004 1.1 lukem "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... 7005 1.1 lukem 7006 1.1 lukem Remove libraries from an installation directory. 7007 1.1 lukem 7008 1.1 lukem RM is the name of the program to use to delete files associated with each FILE 7009 1.1 lukem (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed 7010 1.1 lukem to RM. 7011 1.1 lukem 7012 1.1 lukem If FILE is a libtool library, all the files associated with it are deleted. 7013 1.1 lukem Otherwise, only FILE itself is deleted using RM." 7014 1.1 lukem ;; 7015 1.1 lukem 7016 1.1 lukem *) 7017 1.2 agc $ECHO "$modename: invalid operation mode \`$mode'" 1>&2 7018 1.2 agc $ECHO "$help" 1>&2 7019 1.1 lukem exit $EXIT_FAILURE 7020 1.1 lukem ;; 7021 1.1 lukem esac 7022 1.1 lukem 7023 1.2 agc $ECHO 7024 1.2 agc $ECHO "Try \`$modename --help' for more information about other modes." 7025 1.1 lukem 7026 1.1 lukem exit $? 7027 1.1 lukem 7028 1.1 lukem # The TAGs below are defined such that we never get into a situation 7029 1.1 lukem # in which we disable both kinds of libraries. Given conflicting 7030 1.1 lukem # choices, we go for a static library, that is the most portable, 7031 1.1 lukem # since we can't tell whether shared libraries were disabled because 7032 1.1 lukem # the user asked for that or because the platform doesn't support 7033 1.1 lukem # them. This is particularly important on AIX, because we don't 7034 1.1 lukem # support having both static and shared libraries enabled at the same 7035 1.1 lukem # time on that platform, so we default to a shared-only configuration. 7036 1.1 lukem # If a disable-shared tag is given, we'll fallback to a static-only 7037 1.1 lukem # configuration. But we'll never go from static-only to shared-only. 7038 1.1 lukem 7039 1.1 lukem # ### BEGIN LIBTOOL TAG CONFIG: disable-shared 7040 1.1 lukem disable_libs=shared 7041 1.1 lukem # ### END LIBTOOL TAG CONFIG: disable-shared 7042 1.1 lukem 7043 1.1 lukem # ### BEGIN LIBTOOL TAG CONFIG: disable-static 7044 1.1 lukem disable_libs=static 7045 1.1 lukem # ### END LIBTOOL TAG CONFIG: disable-static 7046 1.1 lukem 7047 1.1 lukem # Local Variables: 7048 1.1 lukem # mode:shell-script 7049 1.1 lukem # sh-indentation:2 7050 1.1 lukem # End: 7051