Changeset 3377 for trunk/psLib/ltmain.sh
- Timestamp:
- Mar 5, 2005, 11:53:03 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/ltmain.sh (modified) (226 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/ltmain.sh
r3239 r3377 2 2 # NOTE: Changing this file will not affect anything until you rerun configure. 3 3 # 4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 , 2003, 20044 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 5 5 # Free Software Foundation, Inc. 6 6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 … … 25 25 # the same distribution terms that you use for the rest of that program. 26 26 27 basename="s,^.*/,,g"28 29 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh30 # is ksh but when the shell is invoked as "sh" and the current value of31 # the _XPG environment variable is not equal to 1 (one), the special32 # positional parameter $0, within a function call, is the name of the33 # function.34 progpath="$0"35 36 # The name of this program:37 progname=`echo "$progpath" | $SED $basename`38 modename="$progname"39 40 # Global variables:41 EXIT_SUCCESS=042 EXIT_FAILURE=143 44 PROGRAM=ltmain.sh45 PACKAGE=libtool46 VERSION=1.5.847 TIMESTAMP=" (1.1220.2.118 2004/08/07 12:24:38)"48 49 # See if we are running on zsh, and set the options which allow our50 # commands through without removal of \ escapes.51 if test -n "${ZSH_VERSION+set}" ; then52 setopt NO_GLOB_SUBST53 fi54 55 27 # Check that we have a working $echo. 56 28 if test "X$1" = X--no-reexec; then … … 65 37 else 66 38 # Restart under the correct shell, and then maybe $echo will work. 67 exec $SHELL "$ progpath" --no-reexec ${1+"$@"}39 exec $SHELL "$0" --no-reexec ${1+"$@"} 68 40 fi 69 41 … … 74 46 $* 75 47 EOF 76 exit $EXIT_SUCCESS48 exit 0 77 49 fi 50 51 # define SED for historic ltconfig's generated by Libtool 1.3 52 test -z "$SED" && SED=sed 53 54 # The name of this program. 55 progname=`$echo "$0" | ${SED} 's%^.*/%%'` 56 modename="$progname" 57 58 # Constants. 59 PROGRAM=ltmain.sh 60 PACKAGE=libtool 61 VERSION=1.4.3 62 TIMESTAMP=" (1.922.2.111 2002/10/23 02:54:36)" 78 63 79 64 default_mode= … … 88 73 Xsed="${SED}"' -e 1s/^X//' 89 74 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' 90 # test EBCDIC or ASCII 91 case `echo A| tr A '\301'` in92 A) # EBCDIC based system93 SP2NL="tr '\100' '\n'" 94 NL2SP="tr '\r\n' '\100\100'" 95 ;; 96 *) # Assume ASCII based system 97 SP2NL="tr '\040' '\012'" 98 NL2SP="tr '\015\012' '\040\040'" 99 ;; 100 esac 75 # test EBCDIC or ASCII 76 case `echo A|od -x` in 77 *[Cc]1*) # EBCDIC based system 78 SP2NL="tr '\100' '\n'" 79 NL2SP="tr '\r\n' '\100\100'" 80 ;; 81 *) # Assume ASCII based system 82 SP2NL="tr '\040' '\012'" 83 NL2SP="tr '\015\012' '\040\040'" 84 ;; 85 esac 101 86 102 87 # NLS nuisances. … … 113 98 114 99 # Make sure IFS has a sensible default 115 : ${IFS=" 116 "} 100 : ${IFS=" "} 117 101 118 102 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then 119 $echo "$modename: not configured to build any kind of library" 1>&2120 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2121 exit $EXIT_FAILURE103 echo "$modename: not configured to build any kind of library" 1>&2 104 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 105 exit 1 122 106 fi 123 107 … … 134 118 o2lo="s/\\.${objext}\$/.lo/" 135 119 136 #####################################137 # Shell function definitions:138 # This seems to be the best place for them139 140 # func_win32_libid arg141 # return the library type of file 'arg'142 #143 # Need a lot of goo to handle *both* DLLs and import libs144 # Has to be a shell function in order to 'eat' the argument145 # that is supplied when $file_magic_command is called.146 func_win32_libid () {147 win32_libid_type="unknown"148 win32_fileres=`file -L $1 2>/dev/null`149 case $win32_fileres in150 *ar\ archive\ import\ library*) # definitely import151 win32_libid_type="x86 archive import"152 ;;153 *ar\ archive*) # could be an import, or static154 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \155 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then156 win32_nmres=`eval $NM -f posix -A $1 | \157 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`158 if test "X$win32_nmres" = "Ximport" ; then159 win32_libid_type="x86 archive import"160 else161 win32_libid_type="x86 archive static"162 fi163 fi164 ;;165 *DLL*)166 win32_libid_type="x86 DLL"167 ;;168 *executable*) # but shell scripts are "executable" too...169 case $win32_fileres in170 *MS\ Windows\ PE\ Intel*)171 win32_libid_type="x86 DLL"172 ;;173 esac174 ;;175 esac176 $echo $win32_libid_type177 }178 179 180 # func_infer_tag arg181 # Infer tagged configuration to use if any are available and182 # if one wasn't chosen via the "--tag" command line option.183 # Only attempt this if the compiler in the base compile184 # command doesn't match the default compiler.185 # arg is usually of the form 'gcc ...'186 func_infer_tag () {187 if test -n "$available_tags" && test -z "$tagname"; then188 CC_quoted=189 for arg in $CC; do190 case $arg in191 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")192 arg="\"$arg\""193 ;;194 esac195 CC_quoted="$CC_quoted $arg"196 done197 case $@ in198 # Blanks in the command may have been stripped by the calling shell,199 # but not from the CC environment variable when configure was run.200 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;201 # Blanks at the start of $base_compile will cause this to fail202 # if we don't check for them as well.203 *)204 for z in $available_tags; do205 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then206 # Evaluate the configuration.207 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"208 CC_quoted=209 for arg in $CC; do210 # Double-quote args containing other shell metacharacters.211 case $arg in212 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")213 arg="\"$arg\""214 ;;215 esac216 CC_quoted="$CC_quoted $arg"217 done218 case "$@ " in219 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)220 # The compiler in the base compile command matches221 # the one in the tagged configuration.222 # Assume this is the tagged configuration we want.223 tagname=$z224 break225 ;;226 esac227 fi228 done229 # If $tagname still isn't set, then no tagged configuration230 # was found and let the user know that the "--tag" command231 # line option must be used.232 if test -z "$tagname"; then233 $echo "$modename: unable to infer tagged configuration"234 $echo "$modename: specify a tag with \`--tag'" 1>&2235 exit $EXIT_FAILURE236 # else237 # $echo "$modename: using $tagname tagged configuration"238 fi239 ;;240 esac241 fi242 }243 244 245 # func_extract_archives gentop oldlib ...246 func_extract_archives () {247 my_gentop="$1"; shift248 my_oldlibs=${1+"$@"}249 my_oldobjs=""250 my_xlib=""251 my_xabs=""252 my_xdir=""253 my_status=""254 255 $show "${rm}r $my_gentop"256 $run ${rm}r "$my_gentop"257 $show "$mkdir $my_gentop"258 $run $mkdir "$my_gentop"259 my_status=$?260 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then261 exit $my_status262 fi263 264 for my_xlib in $my_oldlibs; do265 # Extract the objects.266 case $my_xlib in267 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;268 *) my_xabs=`pwd`"/$my_xlib" ;;269 esac270 my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`271 my_xdir="$my_gentop/$my_xlib"272 273 $show "${rm}r $my_xdir"274 $run ${rm}r "$my_xdir"275 $show "$mkdir $my_xdir"276 $run $mkdir "$my_xdir"277 status=$?278 if test "$status" -ne 0 && test ! -d "$my_xdir"; then279 exit $status280 fi281 case $host in282 *-darwin*)283 $show "Extracting $my_xabs"284 # Do not bother doing anything if just a dry run285 if test -z "$run"; then286 darwin_orig_dir=`pwd`287 cd $my_xdir || exit $?288 darwin_archive=$my_xabs289 darwin_curdir=`pwd`290 darwin_base_archive=`basename $darwin_archive`291 darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`292 if test -n "$darwin_arches"; then293 darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`294 darwin_arch=295 $show "$darwin_base_archive has multiple architectures $darwin_arches"296 for darwin_arch in $darwin_arches ; do297 mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"298 lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"299 # Remove the table of contents from the thin files.300 $AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF 2>/dev/null || true301 $AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF\ SORTED 2>/dev/null || true302 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"303 $AR -xo "${darwin_base_archive}"304 rm "${darwin_base_archive}"305 cd "$darwin_curdir"306 done # $darwin_arches307 ## Okay now we have a bunch of thin objects, gotta fatten them up :)308 darwin_filelist=`find unfat-$$ -type f | xargs basename | sort -u | $NL2SP`309 darwin_file=310 darwin_files=311 for darwin_file in $darwin_filelist; do312 darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`313 lipo -create -output "$darwin_file" $darwin_files314 done # $darwin_filelist315 rm -rf unfat-$$316 cd "$darwin_orig_dir"317 else318 cd $darwin_orig_dir319 (cd $my_xdir && $AR x $my_xabs) || exit $?320 fi # $darwin_arches321 fi # $run322 ;;323 *)324 # We will extract separately just the conflicting names and we will325 # no longer touch any unique names. It is faster to leave these326 # extract automatically by $AR in one run.327 $show "(cd $my_xdir && $AR x $my_xabs)"328 $run eval "(cd \$my_xdir && $AR x \$my_xabs)" || exit $?329 if ($AR t "$my_xabs" | sort | sort -uc >/dev/null 2>&1); then330 :331 else332 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2333 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2334 $AR t "$my_xabs" | sort | uniq -cd | while read -r count name335 do336 i=1337 while test "$i" -le "$count"338 do339 # Put our $i before any first dot (extension)340 # Never overwrite any file341 name_to="$name"342 while test "X$name_to" = "X$name" || test -f "$my_xdir/$name_to"343 do344 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`345 done346 $show "(cd $my_xdir && $AR xN $i $my_xabs '$name' && $mv '$name' '$name_to')"347 $run eval "(cd \$my_xdir && $AR xN $i \$my_xabs '$name' && $mv '$name' '$name_to')" || exit $?348 i=`expr $i + 1`349 done350 done351 fi352 ;;353 esac354 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`355 done356 357 func_extract_archives_result="$my_oldobjs"358 }359 # End of Shell function definitions360 #####################################361 362 # Darwin sucks363 eval std_shrext=\"$shrext_cmds\"364 365 120 # Parse our command line options once, thoroughly. 366 while test "$#"-gt 0121 while test $# -gt 0 367 122 do 368 123 arg="$1" … … 380 135 execute_dlfiles="$execute_dlfiles $arg" 381 136 ;; 382 tag)383 tagname="$arg"384 preserve_args="${preserve_args}=$arg"385 386 # Check whether tagname contains only valid characters387 case $tagname in388 *[!-_A-Za-z0-9,/]*)389 $echo "$progname: invalid tag name: $tagname" 1>&2390 exit $EXIT_FAILURE391 ;;392 esac393 394 case $tagname in395 CC)396 # Don't test for the "default" C tag, as we know, it's there, but397 # not specially marked.398 ;;399 *)400 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then401 taglist="$taglist $tagname"402 # Evaluate the configuration.403 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"404 else405 $echo "$progname: ignoring unknown tag $tagname" 1>&2406 fi407 ;;408 esac409 ;;410 137 *) 411 138 eval "$prev=\$arg" … … 425 152 426 153 --version) 427 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" 428 $echo 429 $echo "Copyright (C) 2003 Free Software Foundation, Inc." 430 $echo "This is free software; see the source for copying conditions. There is NO" 431 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 432 exit $EXIT_SUCCESS 154 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" 155 exit 0 433 156 ;; 434 157 435 158 --config) 436 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath 437 # Now print the configurations for the tags. 438 for tagname in $taglist; do 439 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" 440 done 441 exit $EXIT_SUCCESS 159 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 160 exit 0 442 161 ;; 443 162 444 163 --debug) 445 $echo "$progname: enabling shell trace mode"164 echo "$progname: enabling shell trace mode" 446 165 set -x 447 preserve_args="$preserve_args $arg"448 166 ;; 449 167 … … 453 171 454 172 --features) 455 $echo "host: $host"173 echo "host: $host" 456 174 if test "$build_libtool_libs" = yes; then 457 $echo "enable shared libraries"175 echo "enable shared libraries" 458 176 else 459 $echo "disable shared libraries"177 echo "disable shared libraries" 460 178 fi 461 179 if test "$build_old_libs" = yes; then 462 $echo "enable static libraries"180 echo "enable static libraries" 463 181 else 464 $echo "disable static libraries"182 echo "disable static libraries" 465 183 fi 466 exit $EXIT_SUCCESS184 exit 0 467 185 ;; 468 186 … … 476 194 --quiet | --silent) 477 195 show=: 478 preserve_args="$preserve_args $arg"479 ;;480 481 --tag) prevopt="--tag" prev=tag ;;482 --tag=*)483 set tag "$optarg" ${1+"$@"}484 shift485 prev=tag486 preserve_args="$preserve_args --tag"487 196 ;; 488 197 … … 495 204 $echo "$modename: unrecognized option \`$arg'" 1>&2 496 205 $echo "$help" 1>&2 497 exit $EXIT_FAILURE206 exit 1 498 207 ;; 499 208 … … 508 217 $echo "$modename: option \`$prevopt' requires an argument" 1>&2 509 218 $echo "$help" 1>&2 510 exit $EXIT_FAILURE219 exit 1 511 220 fi 512 221 … … 520 229 # Infer the operation mode. 521 230 if test -z "$mode"; then 522 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2523 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2524 231 case $nonopt in 525 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)232 *cc | *++ | gcc* | *-gcc* | xlc*) 526 233 mode=link 527 234 for arg … … 564 271 $echo "$modename: unrecognized option \`-dlopen'" 1>&2 565 272 $echo "$help" 1>&2 566 exit $EXIT_FAILURE273 exit 1 567 274 fi 568 275 … … 578 285 # Get the compilation command and the source file. 579 286 base_compile= 580 srcfile="$nonopt" # always keep a non-empty value in "srcfile" 581 suppress_opt=yes 287 prev= 288 lastarg= 289 srcfile="$nonopt" 582 290 suppress_output= 583 arg_mode=normal 584 libobj= 585 later= 586 291 292 user_target=no 587 293 for arg 588 294 do 589 case "$arg_mode" in 590 arg ) 591 # do not "continue". Instead, add this to base_compile 592 lastarg="$arg" 593 arg_mode=normal 594 ;; 595 596 target ) 295 case $prev in 296 "") ;; 297 xcompiler) 298 # Aesthetically quote the previous argument. 299 prev= 300 lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` 301 302 case $arg in 303 # Double-quote args containing other shell metacharacters. 304 # Many Bourne shells cannot handle close brackets correctly 305 # in scan sets, so we specify it separately. 306 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 307 arg="\"$arg\"" 308 ;; 309 esac 310 311 # Add the previous argument to base_compile. 312 if test -z "$base_compile"; then 313 base_compile="$lastarg" 314 else 315 base_compile="$base_compile $lastarg" 316 fi 317 continue 318 ;; 319 esac 320 321 # Accept any command-line options. 322 case $arg in 323 -o) 324 if test "$user_target" != "no"; then 325 $echo "$modename: you cannot specify \`-o' more than once" 1>&2 326 exit 1 327 fi 328 user_target=next 329 ;; 330 331 -static) 332 build_old_libs=yes 333 continue 334 ;; 335 336 -prefer-pic) 337 pic_mode=yes 338 continue 339 ;; 340 341 -prefer-non-pic) 342 pic_mode=no 343 continue 344 ;; 345 346 -Xcompiler) 347 prev=xcompiler 348 continue 349 ;; 350 351 -Wc,*) 352 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` 353 lastarg= 354 save_ifs="$IFS"; IFS=',' 355 for arg in $args; do 356 IFS="$save_ifs" 357 358 # Double-quote args containing other shell metacharacters. 359 # Many Bourne shells cannot handle close brackets correctly 360 # in scan sets, so we specify it separately. 361 case $arg in 362 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 363 arg="\"$arg\"" 364 ;; 365 esac 366 lastarg="$lastarg $arg" 367 done 368 IFS="$save_ifs" 369 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` 370 371 # Add the arguments to base_compile. 372 if test -z "$base_compile"; then 373 base_compile="$lastarg" 374 else 375 base_compile="$base_compile $lastarg" 376 fi 377 continue 378 ;; 379 esac 380 381 case $user_target in 382 next) 383 # The next one is the -o target name 384 user_target=yes 385 continue 386 ;; 387 yes) 388 # We got the output file 389 user_target=set 597 390 libobj="$arg" 598 arg_mode=normal599 391 continue 600 392 ;; 601 602 normal ) 603 # Accept any command-line options. 604 case $arg in 605 -o) 606 if test -n "$libobj" ; then 607 $echo "$modename: you cannot specify \`-o' more than once" 1>&2 608 exit $EXIT_FAILURE 609 fi 610 arg_mode=target 611 continue 612 ;; 613 614 -static | -prefer-pic | -prefer-non-pic) 615 later="$later $arg" 616 continue 617 ;; 618 619 -no-suppress) 620 suppress_opt=no 621 continue 622 ;; 623 624 -Xcompiler) 625 arg_mode=arg # the next one goes into the "base_compile" arg list 626 continue # The current "srcfile" will either be retained or 627 ;; # replaced later. I would guess that would be a bug. 628 629 -Wc,*) 630 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` 631 lastarg= 632 save_ifs="$IFS"; IFS=',' 633 for arg in $args; do 634 IFS="$save_ifs" 635 636 # Double-quote args containing other shell metacharacters. 637 # Many Bourne shells cannot handle close brackets correctly 638 # in scan sets, so we specify it separately. 639 case $arg in 640 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 641 arg="\"$arg\"" 642 ;; 643 esac 644 lastarg="$lastarg $arg" 645 done 646 IFS="$save_ifs" 647 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` 648 649 # Add the arguments to base_compile. 650 base_compile="$base_compile $lastarg" 651 continue 652 ;; 653 654 * ) 655 # Accept the current argument as the source file. 656 # The previous "srcfile" becomes the current argument. 657 # 658 lastarg="$srcfile" 659 srcfile="$arg" 660 ;; 661 esac # case $arg 662 ;; 663 esac # case $arg_mode 393 esac 394 395 # Accept the current argument as the source file. 396 lastarg="$srcfile" 397 srcfile="$arg" 664 398 665 399 # Aesthetically quote the previous argument. 400 401 # Backslashify any backslashes, double quotes, and dollar signs. 402 # These are the only characters that are still specially 403 # interpreted inside of double-quoted scrings. 666 404 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` 667 405 668 case $lastarg in669 406 # Double-quote args containing other shell metacharacters. 670 407 # Many Bourne shells cannot handle close brackets correctly 671 408 # in scan sets, so we specify it separately. 409 case $lastarg in 672 410 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 673 411 lastarg="\"$lastarg\"" … … 675 413 esac 676 414 677 base_compile="$base_compile $lastarg" 678 done # for arg 679 680 case $arg_mode in 681 arg) 682 $echo "$modename: you must specify an argument for -Xcompile" 683 exit $EXIT_FAILURE 415 # Add the previous argument to base_compile. 416 if test -z "$base_compile"; then 417 base_compile="$lastarg" 418 else 419 base_compile="$base_compile $lastarg" 420 fi 421 done 422 423 case $user_target in 424 set) 684 425 ;; 685 target)686 $echo "$modename: you must specify a target with \`-o'" 1>&2687 exit $EXIT_FAILURE426 no) 427 # Get the name of the library object. 428 libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` 688 429 ;; 689 430 *) 690 # Get the name of the library object.691 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`431 $echo "$modename: you must specify a target with \`-o'" 1>&2 432 exit 1 692 433 ;; 693 434 esac … … 695 436 # Recognize several different file suffixes. 696 437 # If the user specifies -o file.o, it is replaced with file.lo 697 xform='[cCFS ifmso]'438 xform='[cCFSfmso]' 698 439 case $libobj in 699 440 *.ada) xform=ada ;; … … 703 444 *.c++) xform=c++ ;; 704 445 *.cc) xform=cc ;; 705 *.ii) xform=ii ;;706 *.class) xform=class ;;707 446 *.cpp) xform=cpp ;; 708 447 *.cxx) xform=cxx ;; 709 448 *.f90) xform=f90 ;; 710 449 *.for) xform=for ;; 711 *.java) xform=java ;;712 450 esac 713 451 … … 718 456 *) 719 457 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 720 exit $EXIT_FAILURE458 exit 1 721 459 ;; 722 460 esac 723 724 func_infer_tag $base_compile725 726 for arg in $later; do727 case $arg in728 -static)729 build_old_libs=yes730 continue731 ;;732 733 -prefer-pic)734 pic_mode=yes735 continue736 ;;737 738 -prefer-non-pic)739 pic_mode=no740 continue741 ;;742 esac743 done744 745 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`746 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`747 if test "X$xdir" = "X$obj"; then748 xdir=749 else750 xdir=$xdir/751 fi752 lobj=${xdir}$objdir/$objname753 461 754 462 if test -z "$base_compile"; then 755 463 $echo "$modename: you must specify a compilation command" 1>&2 756 464 $echo "$help" 1>&2 757 exit $EXIT_FAILURE465 exit 1 758 466 fi 759 467 760 468 # Delete any leftover library objects. 761 469 if test "$build_old_libs" = yes; then 762 removelist="$obj $l obj $libobj ${libobj}T"470 removelist="$obj $libobj" 763 471 else 764 removelist="$l obj $libobj ${libobj}T"472 removelist="$libobj" 765 473 fi 766 474 767 475 $run $rm $removelist 768 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15476 trap "$run $rm $removelist; exit 1" 1 2 15 769 477 770 478 # On Cygwin there's no "real" PIC flag so we must build both object types … … 785 493 lockfile="$output_obj.lock" 786 494 removelist="$removelist $output_obj $lockfile" 787 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15495 trap "$run $rm $removelist; exit 1" 1 2 15 788 496 else 789 output_obj=790 497 need_locks=no 791 498 lockfile= … … 795 502 # We use this script file to make the link, it avoids creating a new file 796 503 if test "$need_locks" = yes; then 797 until $run ln "$ progpath" "$lockfile" 2>/dev/null; do504 until $run ln "$0" "$lockfile" 2>/dev/null; do 798 505 $show "Waiting for $lockfile to be removed" 799 506 sleep 2 … … 801 508 elif test "$need_locks" = warn; then 802 509 if test -f "$lockfile"; then 803 $echo "\510 echo "\ 804 511 *** ERROR, $lockfile exists and contains: 805 512 `cat $lockfile 2>/dev/null` … … 813 520 814 521 $run $rm $removelist 815 exit $EXIT_FAILURE816 fi 817 $echo $srcfile > "$lockfile"522 exit 1 523 fi 524 echo $srcfile > "$lockfile" 818 525 fi 819 526 … … 821 528 eval srcfile=\"$fix_srcfile_path\" 822 529 fi 823 824 $run $rm "$libobj" "${libobj}T"825 826 # Create a libtool object file (analogous to a ".la" file),827 # but don't create it if we're doing a dry run.828 test -z "$run" && cat > ${libobj}T <<EOF829 # $libobj - a libtool object file830 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP831 #832 # Please DO NOT delete this file!833 # It is necessary for linking the library.834 835 # Name of the PIC object.836 EOF837 530 838 531 # Only build a PIC object if we are building libtool libraries. … … 842 535 843 536 if test "$pic_mode" != no; then 844 command="$base_compile $srcfile $pic_flag" 537 # All platforms use -DPIC, to notify preprocessed assembler code. 538 command="$base_compile $srcfile $pic_flag -DPIC" 845 539 else 846 540 # Don't build PIC code 847 541 command="$base_compile $srcfile" 848 542 fi 849 850 if test ! -d "${xdir}$objdir"; then 851 $show "$mkdir ${xdir}$objdir" 852 $run $mkdir ${xdir}$objdir 853 status=$? 854 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then 855 exit $status 856 fi 857 fi 858 859 if test -z "$output_obj"; then 860 # Place PIC objects in $objdir 861 command="$command -o $lobj" 862 fi 863 864 $run $rm "$lobj" "$output_obj" 865 543 if test "$build_old_libs" = yes; then 544 lo_libobj="$libobj" 545 dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` 546 if test "X$dir" = "X$libobj"; then 547 dir="$objdir" 548 else 549 dir="$dir/$objdir" 550 fi 551 libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` 552 553 if test -d "$dir"; then 554 $show "$rm $libobj" 555 $run $rm $libobj 556 else 557 $show "$mkdir $dir" 558 $run $mkdir $dir 559 status=$? 560 if test $status -ne 0 && test ! -d $dir; then 561 exit $status 562 fi 563 fi 564 fi 565 if test "$compiler_o_lo" = yes; then 566 output_obj="$libobj" 567 command="$command -o $output_obj" 568 elif test "$compiler_c_o" = yes; then 569 output_obj="$obj" 570 command="$command -o $output_obj" 571 fi 572 573 $run $rm "$output_obj" 866 574 $show "$command" 867 575 if $run eval "$command"; then : 868 576 else 869 577 test -n "$output_obj" && $run $rm $removelist 870 exit $EXIT_FAILURE578 exit 1 871 579 fi 872 580 873 581 if test "$need_locks" = warn && 874 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then875 $echo "\582 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then 583 echo "\ 876 584 *** ERROR, $lockfile contains: 877 585 `cat $lockfile 2>/dev/null` … … 888 596 889 597 $run $rm $removelist 890 exit $EXIT_FAILURE598 exit 1 891 599 fi 892 600 893 601 # Just move the object if needed, then go on to compile the next one 894 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then895 $show "$mv $output_obj $l obj"896 if $run $mv $output_obj $l obj; then :602 if test x"$output_obj" != x"$libobj"; then 603 $show "$mv $output_obj $libobj" 604 if $run $mv $output_obj $libobj; then : 897 605 else 898 606 error=$? … … 902 610 fi 903 611 904 # Append the name of the PIC object to the libtool object file. 905 test -z "$run" && cat >> ${libobj}T <<EOF 906 pic_object='$objdir/$objname' 907 908 EOF 612 # If we have no pic_flag, then copy the object into place and finish. 613 if (test -z "$pic_flag" || test "$pic_mode" != default) && 614 test "$build_old_libs" = yes; then 615 # Rename the .lo from within objdir to obj 616 if test -f $obj; then 617 $show $rm $obj 618 $run $rm $obj 619 fi 620 621 $show "$mv $libobj $obj" 622 if $run $mv $libobj $obj; then : 623 else 624 error=$? 625 $run $rm $removelist 626 exit $error 627 fi 628 629 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` 630 if test "X$xdir" = "X$obj"; then 631 xdir="." 632 else 633 xdir="$xdir" 634 fi 635 baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"` 636 libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` 637 # Now arrange that obj and lo_libobj become the same file 638 $show "(cd $xdir && $LN_S $baseobj $libobj)" 639 if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then 640 # Unlock the critical section if it was locked 641 if test "$need_locks" != no; then 642 $run $rm "$lockfile" 643 fi 644 exit 0 645 else 646 error=$? 647 $run $rm $removelist 648 exit $error 649 fi 650 fi 909 651 910 652 # Allow error messages only from the first compilation. 911 if test "$suppress_opt" = yes; then 912 suppress_output=' >/dev/null 2>&1' 913 fi 914 else 915 # No PIC object so indicate it doesn't exist in the libtool 916 # object file. 917 test -z "$run" && cat >> ${libobj}T <<EOF 918 pic_object=none 919 920 EOF 653 suppress_output=' >/dev/null 2>&1' 921 654 fi 922 655 … … 927 660 command="$base_compile $srcfile" 928 661 else 929 command="$base_compile $srcfile $pic_flag" 662 # All platforms use -DPIC, to notify preprocessed assembler code. 663 command="$base_compile $srcfile $pic_flag -DPIC" 930 664 fi 931 665 if test "$compiler_c_o" = yes; then 932 666 command="$command -o $obj" 667 output_obj="$obj" 933 668 fi 934 669 935 670 # Suppress compiler output if we already did a PIC compilation. 936 671 command="$command$suppress_output" 937 $run $rm "$o bj" "$output_obj"672 $run $rm "$output_obj" 938 673 $show "$command" 939 674 if $run eval "$command"; then : 940 675 else 941 676 $run $rm $removelist 942 exit $EXIT_FAILURE677 exit 1 943 678 fi 944 679 945 680 if test "$need_locks" = warn && 946 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then947 $echo "\681 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then 682 echo "\ 948 683 *** ERROR, $lockfile contains: 949 684 `cat $lockfile 2>/dev/null` … … 960 695 961 696 $run $rm $removelist 962 exit $EXIT_FAILURE697 exit 1 963 698 fi 964 699 965 700 # Just move the object if needed 966 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then701 if test x"$output_obj" != x"$obj"; then 967 702 $show "$mv $output_obj $obj" 968 703 if $run $mv $output_obj $obj; then : … … 974 709 fi 975 710 976 # Append the name of the non-PIC object the libtool object file.977 # Only append if the libtool object file exists.978 test -z "$run" && cat >> ${libobj}T <<EOF979 # Name of the non-PIC object. 980 non_pic_object='$objname' 981 982 EOF 983 else 984 # Append the name of the non-PIC object the libtool object file. 985 # Only append if the libtool object file exists. 986 test -z "$run" && cat >> ${libobj}T <<EOF 987 # Name of the non-PIC object. 988 non_pic_object=none 989 990 EOF 711 # Create an invalid libtool object if no PIC, so that we do not 712 # accidentally link it into a program. 713 if test "$build_libtool_libs" != yes; then 714 $show "echo timestamp > $libobj" 715 $run eval "echo timestamp > \$libobj" || exit $? 716 else 717 # Move the .lo from within objdir 718 $show "$mv $libobj $lo_libobj" 719 if $run $mv $libobj $lo_libobj; then : 720 else 721 error=$? 722 $run $rm $removelist 723 exit $error 724 fi 725 fi 991 726 fi 992 993 $run $mv "${libobj}T" "${libobj}"994 727 995 728 # Unlock the critical section if it was locked … … 998 731 fi 999 732 1000 exit $EXIT_SUCCESS733 exit 0 1001 734 ;; 1002 735 … … 1009 742 # we shouldn't force the makefile maintainer to figure out 1010 743 # which system we are compiling for in order to pass an extra 1011 # flag for every libtool invo cation.744 # flag for every libtool invokation. 1012 745 # allow_undefined=no 1013 746 … … 1024 757 esac 1025 758 libtool_args="$nonopt" 1026 base_compile="$nonopt $@"1027 759 compile_command="$nonopt" 1028 760 finalize_command="$nonopt" … … 1055 787 no_install=no 1056 788 objs= 1057 non_pic_objects=1058 precious_files_regex=1059 789 prefer_static_libs=no 1060 790 preload=no … … 1068 798 thread_safe=no 1069 799 vinfo= 1070 vinfo_number=no1071 1072 func_infer_tag $base_compile1073 800 1074 801 # We need to know -static, to get the right output filenames. … … 1101 828 1102 829 # Go through the arguments, transforming them on the way. 1103 while test "$#"-gt 0; do830 while test $# -gt 0; do 1104 831 arg="$1" 1105 832 shift … … 1166 893 if test ! -f "$arg"; then 1167 894 $echo "$modename: symbol file \`$arg' does not exist" 1168 exit $EXIT_FAILURE895 exit 1 1169 896 fi 1170 897 prev= … … 1176 903 continue 1177 904 ;; 1178 inst_prefix)905 inst_prefix) 1179 906 inst_prefix_dir="$arg" 1180 907 prev= 1181 908 continue 1182 909 ;; 1183 precious_regex)1184 precious_files_regex="$arg"1185 prev=1186 continue1187 ;;1188 910 release) 1189 911 release="-$arg" 1190 prev=1191 continue1192 ;;1193 objectlist)1194 if test -f "$arg"; then1195 save_arg=$arg1196 moreargs=1197 for fil in `cat $save_arg`1198 do1199 # moreargs="$moreargs $fil"1200 arg=$fil1201 # A libtool-controlled object.1202 1203 # Check to see that this really is a libtool object.1204 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then1205 pic_object=1206 non_pic_object=1207 1208 # Read the .lo file1209 # If there is no directory component, then add one.1210 case $arg in1211 */* | *\\*) . $arg ;;1212 *) . ./$arg ;;1213 esac1214 1215 if test -z "$pic_object" || \1216 test -z "$non_pic_object" ||1217 test "$pic_object" = none && \1218 test "$non_pic_object" = none; then1219 $echo "$modename: cannot find name of object for \`$arg'" 1>&21220 exit $EXIT_FAILURE1221 fi1222 1223 # Extract subdirectory from the argument.1224 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`1225 if test "X$xdir" = "X$arg"; then1226 xdir=1227 else1228 xdir="$xdir/"1229 fi1230 1231 if test "$pic_object" != none; then1232 # Prepend the subdirectory the object is found in.1233 pic_object="$xdir$pic_object"1234 1235 if test "$prev" = dlfiles; then1236 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then1237 dlfiles="$dlfiles $pic_object"1238 prev=1239 continue1240 else1241 # If libtool objects are unsupported, then we need to preload.1242 prev=dlprefiles1243 fi1244 fi1245 1246 # CHECK ME: I think I busted this. -Ossama1247 if test "$prev" = dlprefiles; then1248 # Preload the old-style object.1249 dlprefiles="$dlprefiles $pic_object"1250 prev=1251 fi1252 1253 # A PIC object.1254 libobjs="$libobjs $pic_object"1255 arg="$pic_object"1256 fi1257 1258 # Non-PIC object.1259 if test "$non_pic_object" != none; then1260 # Prepend the subdirectory the object is found in.1261 non_pic_object="$xdir$non_pic_object"1262 1263 # A standard non-PIC object1264 non_pic_objects="$non_pic_objects $non_pic_object"1265 if test -z "$pic_object" || test "$pic_object" = none ; then1266 arg="$non_pic_object"1267 fi1268 fi1269 else1270 # Only an error if not doing a dry-run.1271 if test -z "$run"; then1272 $echo "$modename: \`$arg' is not a valid libtool object" 1>&21273 exit $EXIT_FAILURE1274 else1275 # Dry-run case.1276 1277 # Extract subdirectory from the argument.1278 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`1279 if test "X$xdir" = "X$arg"; then1280 xdir=1281 else1282 xdir="$xdir/"1283 fi1284 1285 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`1286 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`1287 libobjs="$libobjs $pic_object"1288 non_pic_objects="$non_pic_objects $non_pic_object"1289 fi1290 fi1291 done1292 else1293 $echo "$modename: link input file \`$save_arg' does not exist"1294 exit $EXIT_FAILURE1295 fi1296 arg=$save_arg1297 912 prev= 1298 913 continue … … 1304 919 *) 1305 920 $echo "$modename: only absolute run-paths are allowed" 1>&2 1306 exit $EXIT_FAILURE921 exit 1 1307 922 ;; 1308 923 esac … … 1336 951 continue 1337 952 ;; 1338 xcclinker)1339 linker_flags="$linker_flags $qarg"1340 compiler_flags="$compiler_flags $qarg"1341 prev=1342 compile_command="$compile_command $qarg"1343 finalize_command="$finalize_command $qarg"1344 continue1345 ;;1346 shrext)1347 shrext_cmds="$arg"1348 prev=1349 continue1350 ;;1351 953 *) 1352 954 eval "$prev=\"\$arg\"" … … 1355 957 ;; 1356 958 esac 1357 fi # test -n "$prev"959 fi # test -n $prev 1358 960 1359 961 prevarg="$arg" … … 1397 999 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then 1398 1000 $echo "$modename: more than one -exported-symbols argument is not allowed" 1399 exit $EXIT_FAILURE1001 exit 1 1400 1002 fi 1401 1003 if test "X$arg" = "X-export-symbols"; then … … 1416 1018 -L[A-Z][A-Z]*:*) 1417 1019 case $with_gcc/$host in 1418 no/*-*-irix* | /*-*-irix*)1020 no/*-*-irix* | no/*-*-nonstopux*) 1419 1021 compile_command="$compile_command $arg" 1420 1022 finalize_command="$finalize_command $arg" … … 1433 1035 if test -z "$absdir"; then 1434 1036 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 1435 exit $EXIT_FAILURE1037 exit 1 1436 1038 fi 1437 1039 dir="$absdir" … … 1471 1073 test "X$arg" = "X-lc" && continue 1472 1074 ;; 1473 *-*-rhapsody* | *-*-darwin1.[012]) 1474 # Rhapsody C and math libraries are in the System framework 1475 deplibs="$deplibs -framework System" 1075 esac 1076 elif test "X$arg" = "X-lc_r"; then 1077 case $host in 1078 *-*-openbsd* | *-*-freebsd*) 1079 # Do not include libc_r directly, use -pthread flag. 1476 1080 continue 1081 ;; 1477 1082 esac 1478 elif test "X$arg" = "X-lc_r"; then1479 case $host in1480 *-*-openbsd* | *-*-freebsd*)1481 # Do not include libc_r directly, use -pthread flag.1482 continue1483 ;;1484 esac1485 1083 fi 1486 1084 deplibs="$deplibs $arg" … … 1488 1086 ;; 1489 1087 1490 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)1491 deplibs="$deplibs $arg"1492 continue1493 ;;1494 1495 1088 -module) 1496 1089 module=yes 1497 continue1498 ;;1499 1500 # gcc -m* arguments should be passed to the linker via $compiler_flags1501 # in order to pass architecture information to the linker1502 # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo1503 # but this is not reliable with gcc because gcc may use -mfoo to1504 # select a different linker, different libraries, etc, while1505 # -Wl,-mfoo simply passes -mfoo to the linker.1506 -m*)1507 # Unknown arguments in both finalize_command and compile_command need1508 # to be aesthetically quoted because they are evaled later.1509 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`1510 case $arg in1511 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")1512 arg="\"$arg\""1513 ;;1514 esac1515 compile_command="$compile_command $arg"1516 finalize_command="$finalize_command $arg"1517 if test "$with_gcc" = "yes" ; then1518 compiler_flags="$compiler_flags $arg"1519 fi1520 continue1521 ;;1522 1523 -shrext)1524 prev=shrext1525 1090 continue 1526 1091 ;; … … 1550 1115 ;; 1551 1116 1552 -objectlist)1553 prev=objectlist1554 continue1555 ;;1556 1557 1117 -o) prev=output ;; 1558 1559 -precious-files-regex)1560 prev=precious_regex1561 continue1562 ;;1563 1118 1564 1119 -release) … … 1584 1139 *) 1585 1140 $echo "$modename: only absolute run-paths are allowed" 1>&2 1586 exit $EXIT_FAILURE1141 exit 1 1587 1142 ;; 1588 1143 esac … … 1610 1165 -version-info) 1611 1166 prev=vinfo 1612 continue1613 ;;1614 -version-number)1615 prev=vinfo1616 vinfo_number=yes1617 1167 continue 1618 1168 ;; … … 1665 1215 ;; 1666 1216 1667 -XCClinker)1668 prev=xcclinker1669 continue1670 ;;1671 1672 1217 # Some other compiler flag. 1673 1218 -* | +*) … … 1682 1227 ;; 1683 1228 1684 *.$objext) 1685 # A standard object. 1686 objs="$objs $arg" 1687 ;; 1688 1689 *.lo) 1690 # A libtool-controlled object. 1691 1692 # Check to see that this really is a libtool object. 1693 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 1694 pic_object= 1695 non_pic_object= 1696 1697 # Read the .lo file 1698 # If there is no directory component, then add one. 1229 *.lo | *.$objext) 1230 # A library or standard object. 1231 if test "$prev" = dlfiles; then 1232 # This file was specified with -dlopen. 1233 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then 1234 dlfiles="$dlfiles $arg" 1235 prev= 1236 continue 1237 else 1238 # If libtool objects are unsupported, then we need to preload. 1239 prev=dlprefiles 1240 fi 1241 fi 1242 1243 if test "$prev" = dlprefiles; then 1244 # Preload the old-style object. 1245 dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"` 1246 prev= 1247 else 1699 1248 case $arg in 1700 * /* | *\\*) . $arg;;1701 *) . ./$arg;;1249 *.lo) libobjs="$libobjs $arg" ;; 1250 *) objs="$objs $arg" ;; 1702 1251 esac 1703 1704 if test -z "$pic_object" || \1705 test -z "$non_pic_object" ||1706 test "$pic_object" = none && \1707 test "$non_pic_object" = none; then1708 $echo "$modename: cannot find name of object for \`$arg'" 1>&21709 exit $EXIT_FAILURE1710 fi1711 1712 # Extract subdirectory from the argument.1713 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`1714 if test "X$xdir" = "X$arg"; then1715 xdir=1716 else1717 xdir="$xdir/"1718 fi1719 1720 if test "$pic_object" != none; then1721 # Prepend the subdirectory the object is found in.1722 pic_object="$xdir$pic_object"1723 1724 if test "$prev" = dlfiles; then1725 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then1726 dlfiles="$dlfiles $pic_object"1727 prev=1728 continue1729 else1730 # If libtool objects are unsupported, then we need to preload.1731 prev=dlprefiles1732 fi1733 fi1734 1735 # CHECK ME: I think I busted this. -Ossama1736 if test "$prev" = dlprefiles; then1737 # Preload the old-style object.1738 dlprefiles="$dlprefiles $pic_object"1739 prev=1740 fi1741 1742 # A PIC object.1743 libobjs="$libobjs $pic_object"1744 arg="$pic_object"1745 fi1746 1747 # Non-PIC object.1748 if test "$non_pic_object" != none; then1749 # Prepend the subdirectory the object is found in.1750 non_pic_object="$xdir$non_pic_object"1751 1752 # A standard non-PIC object1753 non_pic_objects="$non_pic_objects $non_pic_object"1754 if test -z "$pic_object" || test "$pic_object" = none ; then1755 arg="$non_pic_object"1756 fi1757 fi1758 else1759 # Only an error if not doing a dry-run.1760 if test -z "$run"; then1761 $echo "$modename: \`$arg' is not a valid libtool object" 1>&21762 exit $EXIT_FAILURE1763 else1764 # Dry-run case.1765 1766 # Extract subdirectory from the argument.1767 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`1768 if test "X$xdir" = "X$arg"; then1769 xdir=1770 else1771 xdir="$xdir/"1772 fi1773 1774 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`1775 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`1776 libobjs="$libobjs $pic_object"1777 non_pic_objects="$non_pic_objects $non_pic_object"1778 fi1779 1252 fi 1780 1253 ;; … … 1827 1300 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 1828 1301 $echo "$help" 1>&2 1829 exit $EXIT_FAILURE1302 exit 1 1830 1303 fi 1831 1304 … … 1836 1309 fi 1837 1310 1838 oldlibs=1839 1311 # calculate the name of the file, without its directory 1840 1312 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` … … 1857 1329 fi 1858 1330 # Create the object directory. 1859 if test ! -d "$output_objdir"; then1331 if test ! -d $output_objdir; then 1860 1332 $show "$mkdir $output_objdir" 1861 1333 $run $mkdir $output_objdir 1862 1334 status=$? 1863 if test "$status" -ne 0 && test ! -d "$output_objdir"; then1335 if test $status -ne 0 && test ! -d $output_objdir; then 1864 1336 exit $status 1865 1337 fi … … 1871 1343 $echo "$modename: you must specify an output file" 1>&2 1872 1344 $echo "$help" 1>&2 1873 exit $EXIT_FAILURE1345 exit 1 1874 1346 ;; 1875 1347 *.$libext) linkmode=oldlib ;; … … 1879 1351 esac 1880 1352 1881 case $host in1882 *cygwin* | *mingw* | *pw32*)1883 # don't eliminate duplications in $postdeps and $predeps1884 duplicate_compiler_generated_deps=yes1885 ;;1886 *)1887 duplicate_compiler_generated_deps=$duplicate_deps1888 ;;1889 esac1890 1353 specialdeplibs= 1891 1892 1354 libs= 1893 1355 # Find all interdependent deplibs by searching for libraries … … 1901 1363 libs="$libs $deplib" 1902 1364 done 1903 1904 if test "$linkmode" = lib; then1905 libs="$predeps $libs $compiler_lib_search_path $postdeps"1906 1907 # Compute libraries that are listed more than once in $predeps1908 # $postdeps and mark them as special (i.e., whose duplicates are1909 # not to be eliminated).1910 pre_post_deps=1911 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then1912 for pre_post_dep in $predeps $postdeps; do1913 case "$pre_post_deps " in1914 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;1915 esac1916 pre_post_deps="$pre_post_deps $pre_post_dep"1917 done1918 fi1919 pre_post_deps=1920 fi1921 1922 1365 deplibs= 1923 1366 newdependency_libs= … … 1934 1377 *) 1935 1378 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 1936 exit $EXIT_FAILURE1379 exit 1 1937 1380 ;; 1938 1381 esac … … 1951 1394 esac 1952 1395 for pass in $passes; do 1953 if test "$linkmode,$pass" = "lib,link" || 1954 test "$linkmode,$pass" = "prog,scan"; then 1955 libs="$deplibs" 1956 deplibs= 1957 fi 1958 if test "$linkmode" = prog; then 1396 if test $linkmode = prog; then 1397 # Determine which files to process 1959 1398 case $pass in 1960 dlopen) libs="$dlfiles" ;; 1399 dlopen) 1400 libs="$dlfiles" 1401 save_deplibs="$deplibs" # Collect dlpreopened libraries 1402 deplibs= 1403 ;; 1961 1404 dlpreopen) libs="$dlprefiles" ;; 1962 1405 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; 1963 1406 esac 1964 fi1965 if test "$pass" = dlopen; then1966 # Collect dlpreopened libraries1967 save_deplibs="$deplibs"1968 deplibs=1969 1407 fi 1970 1408 for deplib in $libs; do … … 1972 1410 found=no 1973 1411 case $deplib in 1974 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)1975 if test "$linkmode,$pass" = "prog,link"; then1976 compile_deplibs="$deplib $compile_deplibs"1977 finalize_deplibs="$deplib $finalize_deplibs"1978 else1979 deplibs="$deplib $deplibs"1980 fi1981 continue1982 ;;1983 1412 -l*) 1984 if test "$linkmode" != lib && test "$linkmode" != prog; then1985 $echo "$modename: warning: \`-l' is ignored for archives/objects " 1>&21413 if test $linkmode = oldlib && test $linkmode = obj; then 1414 $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2 1986 1415 continue 1987 1416 fi 1988 if test "$pass"= conv; then1417 if test $pass = conv; then 1989 1418 deplibs="$deplib $deplibs" 1990 1419 continue … … 1992 1421 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` 1993 1422 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do 1994 for search_ext in .la $std_shrext .so .a; do 1995 # Search the libtool library 1996 lib="$searchdir/lib${name}${search_ext}" 1997 if test -f "$lib"; then 1998 if test "$search_ext" = ".la"; then 1999 found=yes 2000 else 2001 found=no 2002 fi 2003 break 2 2004 fi 2005 done 1423 # Search the libtool library 1424 lib="$searchdir/lib${name}.la" 1425 if test -f "$lib"; then 1426 found=yes 1427 break 1428 fi 2006 1429 done 2007 1430 if test "$found" != yes; then … … 2012 1435 else 2013 1436 deplibs="$deplib $deplibs" 2014 test "$linkmode"= lib && newdependency_libs="$deplib $newdependency_libs"1437 test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs" 2015 1438 fi 2016 1439 continue 2017 else # deplib is a libtool library2018 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,2019 # We need to do some special things here, and not later.2020 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then2021 case " $predeps $postdeps " in2022 *" $deplib "*)2023 if (${SED} -e '2q' $lib |2024 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then2025 library_names=2026 old_library=2027 case $lib in2028 */* | *\\*) . $lib ;;2029 *) . ./$lib ;;2030 esac2031 for l in $old_library $library_names; do2032 ll="$l"2033 done2034 if test "X$ll" = "X$old_library" ; then # only static version available2035 found=no2036 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`2037 test "X$ladir" = "X$lib" && ladir="."2038 lib=$ladir/$old_library2039 if test "$linkmode,$pass" = "prog,link"; then2040 compile_deplibs="$deplib $compile_deplibs"2041 finalize_deplibs="$deplib $finalize_deplibs"2042 else2043 deplibs="$deplib $deplibs"2044 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"2045 fi2046 continue2047 fi2048 fi2049 ;;2050 *) ;;2051 esac2052 fi2053 1440 fi 2054 1441 ;; # -l … … 2057 1444 lib) 2058 1445 deplibs="$deplib $deplibs" 2059 test "$pass"= conv && continue1446 test $pass = conv && continue 2060 1447 newdependency_libs="$deplib $newdependency_libs" 2061 1448 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` 2062 1449 ;; 2063 1450 prog) 2064 if test "$pass"= conv; then1451 if test $pass = conv; then 2065 1452 deplibs="$deplib $deplibs" 2066 1453 continue 2067 1454 fi 2068 if test "$pass"= scan; then1455 if test $pass = scan; then 2069 1456 deplibs="$deplib $deplibs" 1457 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` 2070 1458 else 2071 1459 compile_deplibs="$deplib $compile_deplibs" 2072 1460 finalize_deplibs="$deplib $finalize_deplibs" 2073 1461 fi 2074 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`2075 1462 ;; 2076 1463 *) 2077 $echo "$modename: warning: \`-L' is ignored for archives/objects " 1>&21464 $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2 2078 1465 ;; 2079 1466 esac # linkmode … … 2081 1468 ;; # -L 2082 1469 -R*) 2083 if test "$pass"= link; then1470 if test $pass = link; then 2084 1471 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` 2085 1472 # Make sure the xrpath contains only unique directories. … … 2094 1481 *.la) lib="$deplib" ;; 2095 1482 *.$libext) 2096 if test "$pass"= conv; then1483 if test $pass = conv; then 2097 1484 deplibs="$deplib $deplibs" 2098 1485 continue … … 2100 1487 case $linkmode in 2101 1488 lib) 2102 valid_a_lib=no 2103 case $deplibs_check_method in 2104 match_pattern*) 2105 set dummy $deplibs_check_method 2106 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 2107 if eval $echo \"$deplib\" 2>/dev/null \ 2108 | $SED 10q \ 2109 | $EGREP "$match_pattern_regex" > /dev/null; then 2110 valid_a_lib=yes 2111 fi 2112 ;; 2113 pass_all) 2114 valid_a_lib=yes 2115 ;; 2116 esac 2117 if test "$valid_a_lib" != yes; then 2118 $echo 2119 $echo "*** Warning: Trying to link with static lib archive $deplib." 2120 $echo "*** I have the capability to make that library automatically link in when" 2121 $echo "*** you link to this library. But I can only do this if you have a" 2122 $echo "*** shared version of the library, which you do not appear to have" 2123 $echo "*** because the file extensions .$libext of this argument makes me believe" 2124 $echo "*** that it is just a static archive that I should not used here." 1489 if test "$deplibs_check_method" != pass_all; then 1490 echo 1491 echo "*** Warning: Trying to link with static lib archive $deplib." 1492 echo "*** I have the capability to make that library automatically link in when" 1493 echo "*** you link to this library. But I can only do this if you have a" 1494 echo "*** shared version of the library, which you do not appear to have" 1495 echo "*** because the file extensions .$libext of this argument makes me believe" 1496 echo "*** that it is just a static archive that I should not used here." 2125 1497 else 2126 $echo2127 $echo "*** Warning: Linking the shared library $output against the"2128 $echo "*** static library $deplib is not portable!"1498 echo 1499 echo "*** Warning: Linking the shared library $output against the" 1500 echo "*** static library $deplib is not portable!" 2129 1501 deplibs="$deplib $deplibs" 2130 1502 fi … … 2132 1504 ;; 2133 1505 prog) 2134 if test "$pass"!= link; then1506 if test $pass != link; then 2135 1507 deplibs="$deplib $deplibs" 2136 1508 else … … 2143 1515 ;; # *.$libext 2144 1516 *.lo | *.$objext) 2145 if test "$pass" = conv; then 2146 deplibs="$deplib $deplibs" 2147 elif test "$linkmode" = prog; then 2148 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then 2149 # If there is no dlopen support or we're linking statically, 2150 # we need to preload. 2151 newdlprefiles="$newdlprefiles $deplib" 2152 compile_deplibs="$deplib $compile_deplibs" 2153 finalize_deplibs="$deplib $finalize_deplibs" 2154 else 2155 newdlfiles="$newdlfiles $deplib" 2156 fi 1517 if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then 1518 # If there is no dlopen support or we're linking statically, 1519 # we need to preload. 1520 newdlprefiles="$newdlprefiles $deplib" 1521 compile_deplibs="$deplib $compile_deplibs" 1522 finalize_deplibs="$deplib $finalize_deplibs" 1523 else 1524 newdlfiles="$newdlfiles $deplib" 2157 1525 fi 2158 1526 continue … … 2163 1531 ;; 2164 1532 esac # case $deplib 2165 if test "$found"= yes || test -f "$lib"; then :1533 if test $found = yes || test -f "$lib"; then : 2166 1534 else 2167 1535 $echo "$modename: cannot find the library \`$lib'" 1>&2 2168 exit $EXIT_FAILURE1536 exit 1 2169 1537 fi 2170 1538 2171 1539 # Check to see that this really is a libtool archive. 2172 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :1540 if (${SED} -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : 2173 1541 else 2174 1542 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 2175 exit $EXIT_FAILURE1543 exit 1 2176 1544 fi 2177 1545 … … 2186 1554 old_library= 2187 1555 # If the library was installed with an old release of libtool, 2188 # it will not redefine variable s installed, or shouldnotlink1556 # it will not redefine variable installed. 2189 1557 installed=yes 2190 shouldnotlink=no2191 1558 2192 1559 # Read the .la file … … 2198 1565 if test "$linkmode,$pass" = "lib,link" || 2199 1566 test "$linkmode,$pass" = "prog,scan" || 2200 { test "$linkmode" != prog && test "$linkmode" != lib; }; then 1567 { test $linkmode = oldlib && test $linkmode = obj; }; then 1568 # Add dl[pre]opened files of deplib 2201 1569 test -n "$dlopen" && dlfiles="$dlfiles $dlopen" 2202 1570 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" 2203 1571 fi 2204 1572 2205 if test "$pass"= conv; then1573 if test $pass = conv; then 2206 1574 # Only check for convenience libraries 2207 1575 deplibs="$lib $deplibs" … … 2209 1577 if test -z "$old_library"; then 2210 1578 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 2211 exit $EXIT_FAILURE1579 exit 1 2212 1580 fi 2213 1581 # It is a libtool convenience library, so add in its objects. … … 2224 1592 tmp_libs="$tmp_libs $deplib" 2225 1593 done 2226 elif test "$linkmode" != prog && test "$linkmode"!= lib; then1594 elif test $linkmode != prog && test $linkmode != lib; then 2227 1595 $echo "$modename: \`$lib' is not a convenience library" 1>&2 2228 exit $EXIT_FAILURE1596 exit 1 2229 1597 fi 2230 1598 continue 2231 1599 fi # $pass = conv 2232 2233 1600 2234 1601 # Get the name of the library we link against. … … 2239 1606 if test -z "$linklib"; then 2240 1607 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 2241 exit $EXIT_FAILURE1608 exit 1 2242 1609 fi 2243 1610 2244 1611 # This library was specified with -dlopen. 2245 if test "$pass"= dlopen; then1612 if test $pass = dlopen; then 2246 1613 if test -z "$libdir"; then 2247 1614 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 2248 exit $EXIT_FAILURE 2249 fi 2250 if test -z "$dlname" || 2251 test "$dlopen_support" != yes || 2252 test "$build_libtool_libs" = no; then 1615 exit 1 1616 fi 1617 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then 2253 1618 # If there is no dlname, no dlopen support or we're linking 2254 # statically, we need to preload. We also need to preload any 2255 # dependent libraries so libltdl's deplib preloader doesn't 2256 # bomb out in the load deplibs phase. 2257 dlprefiles="$dlprefiles $lib $dependency_libs" 1619 # statically, we need to preload. 1620 dlprefiles="$dlprefiles $lib" 2258 1621 else 2259 1622 newdlfiles="$newdlfiles $lib" … … 2288 1651 fi 2289 1652 else 2290 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then 2291 dir="$ladir" 2292 absdir="$abs_ladir" 2293 # Remove this search path later 2294 notinst_path="$notinst_path $abs_ladir" 2295 else 2296 dir="$ladir/$objdir" 2297 absdir="$abs_ladir/$objdir" 2298 # Remove this search path later 2299 notinst_path="$notinst_path $abs_ladir" 2300 fi 1653 dir="$ladir/$objdir" 1654 absdir="$abs_ladir/$objdir" 1655 # Remove this search path later 1656 notinst_path="$notinst_path $abs_ladir" 2301 1657 fi # $installed = yes 2302 1658 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` 2303 1659 2304 1660 # This library was specified with -dlpreopen. 2305 if test "$pass"= dlpreopen; then1661 if test $pass = dlpreopen; then 2306 1662 if test -z "$libdir"; then 2307 1663 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 2308 exit $EXIT_FAILURE1664 exit 1 2309 1665 fi 2310 1666 # Prefer using a static library (so that no silly _DYNAMIC symbols … … 2322 1678 if test -z "$libdir"; then 2323 1679 # Link the convenience library 2324 if test "$linkmode"= lib; then1680 if test $linkmode = lib; then 2325 1681 deplibs="$dir/$old_library $deplibs" 2326 1682 elif test "$linkmode,$pass" = "prog,link"; then … … 2328 1684 finalize_deplibs="$dir/$old_library $finalize_deplibs" 2329 1685 else 2330 deplibs="$lib $deplibs" # used for prog,scan pass1686 deplibs="$lib $deplibs" 2331 1687 fi 2332 1688 continue 2333 1689 fi 2334 1690 2335 2336 if test "$linkmode" = prog && test "$pass" != link; then 1691 if test $linkmode = prog && test $pass != link; then 2337 1692 newlib_search_path="$newlib_search_path $ladir" 2338 1693 deplibs="$lib $deplibs" … … 2350 1705 esac 2351 1706 # Need to link against all dependency_libs? 2352 if test "$linkalldeplibs"= yes; then1707 if test $linkalldeplibs = yes; then 2353 1708 deplibs="$deplib $deplibs" 2354 1709 else … … 2367 1722 fi # $linkmode = prog... 2368 1723 2369 if test "$linkmode,$pass" = "prog,link"; then 2370 if test -n "$library_names" && 2371 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then 2372 # We need to hardcode the library path 2373 if test -n "$shlibpath_var"; then 2374 # Make sure the rpath contains only unique directories. 2375 case "$temp_rpath " in 2376 *" $dir "*) ;; 2377 *" $absdir "*) ;; 2378 *) temp_rpath="$temp_rpath $dir" ;; 2379 esac 2380 fi 2381 1724 link_static=no # Whether the deplib will be linked statically 1725 if test -n "$library_names" && 1726 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then 1727 # Link against this shared library 1728 1729 if test "$linkmode,$pass" = "prog,link" || 1730 { test $linkmode = lib && test $hardcode_into_libs = yes; }; then 2382 1731 # Hardcode the library path. 2383 1732 # Skip directories that are in the system default run-time … … 2401 1750 ;; 2402 1751 esac 1752 if test $linkmode = prog; then 1753 # We need to hardcode the library path 1754 if test -n "$shlibpath_var"; then 1755 # Make sure the rpath contains only unique directories. 1756 case "$temp_rpath " in 1757 *" $dir "*) ;; 1758 *" $absdir "*) ;; 1759 *) temp_rpath="$temp_rpath $dir" ;; 1760 esac 1761 fi 1762 fi 2403 1763 fi # $linkmode,$pass = prog,link... 2404 1764 … … 2410 1770 continue 2411 1771 fi 2412 fi 2413 2414 link_static=no # Whether the deplib will be linked statically 2415 if test -n "$library_names" && 2416 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then 1772 2417 1773 if test "$installed" = no; then 2418 1774 notinst_deplibs="$notinst_deplibs $lib" 2419 1775 need_relink=yes 2420 fi2421 # This is a shared library2422 2423 # Warn about portability, can't link against -module's on2424 # some systems (darwin)2425 if test "$shouldnotlink" = yes && test "$pass" = link ; then2426 $echo2427 if test "$linkmode" = prog; then2428 $echo "*** Warning: Linking the executable $output against the loadable module"2429 else2430 $echo "*** Warning: Linking the shared library $output against the loadable module"2431 fi2432 $echo "*** $linklib is not portable!"2433 fi2434 if test "$linkmode" = lib &&2435 test "$hardcode_into_libs" = yes; then2436 # Hardcode the library path.2437 # Skip directories that are in the system default run-time2438 # search path.2439 case " $sys_lib_dlsearch_path " in2440 *" $absdir "*) ;;2441 *)2442 case "$compile_rpath " in2443 *" $absdir "*) ;;2444 *) compile_rpath="$compile_rpath $absdir"2445 esac2446 ;;2447 esac2448 case " $sys_lib_dlsearch_path " in2449 *" $libdir "*) ;;2450 *)2451 case "$finalize_rpath " in2452 *" $libdir "*) ;;2453 *) finalize_rpath="$finalize_rpath $libdir"2454 esac2455 ;;2456 esac2457 1776 fi 2458 1777 … … 2469 1788 # bleh windows 2470 1789 case $host in 2471 *cygwin* | mingw*)1790 *cygwin*) 2472 1791 major=`expr $current - $age` 2473 1792 versuffix="-$major" … … 2481 1800 # Make a new name for the extract_expsyms_cmds to use 2482 1801 soroot="$soname" 2483 soname=` $echo $soroot | ${SED} -e 's/^.*\///'`2484 newlib="libimp-` $echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"1802 soname=`echo $soroot | ${SED} -e 's/^.*\///'` 1803 newlib="libimp-`echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" 2485 1804 2486 1805 # If the library has no export list, then create one now … … 2489 1808 $show "extracting exported symbol list from \`$soname'" 2490 1809 save_ifs="$IFS"; IFS='~' 2491 cmds=$extract_expsyms_cmds1810 eval cmds=\"$extract_expsyms_cmds\" 2492 1811 for cmd in $cmds; do 2493 1812 IFS="$save_ifs" 2494 eval cmd=\"$cmd\"2495 1813 $show "$cmd" 2496 1814 $run eval "$cmd" || exit $? … … 2503 1821 $show "generating import library for \`$soname'" 2504 1822 save_ifs="$IFS"; IFS='~' 2505 cmds=$old_archive_from_expsyms_cmds1823 eval cmds=\"$old_archive_from_expsyms_cmds\" 2506 1824 for cmd in $cmds; do 2507 1825 IFS="$save_ifs" 2508 eval cmd=\"$cmd\"2509 1826 $show "$cmd" 2510 1827 $run eval "$cmd" || exit $? … … 2515 1832 dir=$output_objdir 2516 1833 linklib=$newlib 2517 fi # test -n "$old_archive_from_expsyms_cmds"2518 2519 if test "$linkmode"= prog || test "$mode" != relink; then1834 fi # test -n $old_archive_from_expsyms_cmds 1835 1836 if test $linkmode = prog || test "$mode" != relink; then 2520 1837 add_shlibpath= 2521 1838 add_dir= … … 2526 1843 if test "$hardcode_direct" = no; then 2527 1844 add="$dir/$linklib" 2528 case $host in2529 *-*-sco3.2v5* ) add_dir="-L$dir" ;;2530 *-*-darwin* )2531 # if the lib is a module then we can not link against2532 # it, someone is ignoring the new warnings I added2533 if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then2534 $echo "** Warning, lib $linklib is a module, not a shared library"2535 if test -z "$old_library" ; then2536 $echo2537 $echo "** And there doesn't seem to be a static archive available"2538 $echo "** The link will probably fail, sorry"2539 else2540 add="$dir/$old_library"2541 fi2542 fi2543 esac2544 1845 elif test "$hardcode_minus_L" = no; then 2545 1846 case $host in … … 2560 1861 elif test "$hardcode_minus_L" = yes; then 2561 1862 add_dir="-L$dir" 2562 # Try looking first in the location we're being installed to.2563 if test -n "$inst_prefix_dir"; then2564 case "$libdir" in2565 [\\/]*)2566 add_dir="$add_dir -L$inst_prefix_dir$libdir"2567 ;;2568 esac2569 fi2570 1863 add="-l$name" 2571 1864 elif test "$hardcode_shlibpath_var" = yes; then … … 2581 1874 if test "$lib_linked" != yes; then 2582 1875 $echo "$modename: configuration error: unsupported hardcode properties" 2583 exit $EXIT_FAILURE1876 exit 1 2584 1877 fi 2585 1878 … … 2590 1883 esac 2591 1884 fi 2592 if test "$linkmode"= prog; then1885 if test $linkmode = prog; then 2593 1886 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" 2594 1887 test -n "$add" && compile_deplibs="$add $compile_deplibs" … … 2607 1900 fi 2608 1901 2609 if test "$linkmode"= prog || test "$mode" = relink; then1902 if test $linkmode = prog || test "$mode" = relink; then 2610 1903 add_shlibpath= 2611 1904 add_dir= … … 2615 1908 add="$libdir/$linklib" 2616 1909 elif test "$hardcode_minus_L" = yes; then 2617 add_dir="-L$libdir" 1910 # Try looking first in the location we're being installed to. 1911 add_dir= 1912 if test -n "$inst_prefix_dir"; then 1913 case "$libdir" in 1914 [\\/]*) 1915 add_dir="-L$inst_prefix_dir$libdir" 1916 ;; 1917 esac 1918 fi 1919 add_dir="$add_dir -L$libdir" 2618 1920 add="-l$name" 2619 1921 elif test "$hardcode_shlibpath_var" = yes; then … … 2623 1925 esac 2624 1926 add="-l$name" 2625 elif test "$hardcode_automatic" = yes; then2626 if test -n "$inst_prefix_dir" &&2627 test -f "$inst_prefix_dir$libdir/$linklib" ; then2628 add="$inst_prefix_dir$libdir/$linklib"2629 else2630 add="$libdir/$linklib"2631 fi2632 1927 else 2633 1928 # We cannot seem to hardcode it, guess we'll fake it. 2634 add_dir="-L$libdir"2635 1929 # Try looking first in the location we're being installed to. 1930 add_dir= 2636 1931 if test -n "$inst_prefix_dir"; then 2637 1932 case "$libdir" in 2638 [\\/]*)2639 add_dir="$add_dir-L$inst_prefix_dir$libdir"2640 ;;1933 [\\/]*) 1934 add_dir="-L$inst_prefix_dir$libdir" 1935 ;; 2641 1936 esac 2642 1937 fi 1938 add_dir="$add_dir -L$libdir" 2643 1939 add="-l$name" 2644 1940 fi 2645 1941 2646 if test "$linkmode"= prog; then1942 if test $linkmode = prog; then 2647 1943 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" 2648 1944 test -n "$add" && finalize_deplibs="$add $finalize_deplibs" … … 2652 1948 fi 2653 1949 fi 2654 elif test "$linkmode" = prog; then 1950 elif test $linkmode = prog; then 1951 if test "$alldeplibs" = yes && 1952 { test "$deplibs_check_method" = pass_all || 1953 { test "$build_libtool_libs" = yes && 1954 test -n "$library_names"; }; }; then 1955 # We only need to search for static libraries 1956 continue 1957 fi 1958 1959 # Try to link the static library 2655 1960 # Here we assume that one of hardcode_direct or hardcode_minus_L 2656 1961 # is not unsupported. This is valid on all known static and … … 2672 1977 # Just print a warning and add the library to dependency_libs so 2673 1978 # that the program can be linked against the static library. 2674 $echo2675 $echo "*** Warning: This system can not link to static lib archive $lib."2676 $echo "*** I have the capability to make that library automatically link in when"2677 $echo "*** you link to this library. But I can only do this if you have a"2678 $echo "*** shared version of the library, which you do not appear to have."1979 echo 1980 echo "*** Warning: This system can not link to static lib archive $lib." 1981 echo "*** I have the capability to make that library automatically link in when" 1982 echo "*** you link to this library. But I can only do this if you have a" 1983 echo "*** shared version of the library, which you do not appear to have." 2679 1984 if test "$module" = yes; then 2680 $echo "*** But as you try to build a module library, libtool will still create "2681 $echo "*** a static module, that should work as long as the dlopening application"2682 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."1985 echo "*** But as you try to build a module library, libtool will still create " 1986 echo "*** a static module, that should work as long as the dlopening application" 1987 echo "*** is linked with the -dlopen flag to resolve symbols at runtime." 2683 1988 if test -z "$global_symbol_pipe"; then 2684 $echo2685 $echo "*** However, this would only work if libtool was able to extract symbol"2686 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"2687 $echo "*** not find such a program. So, this module is probably useless."2688 $echo "*** \`nm' from GNU binutils and a full rebuild may help."1989 echo 1990 echo "*** However, this would only work if libtool was able to extract symbol" 1991 echo "*** lists from a program, using \`nm' or equivalent, but libtool could" 1992 echo "*** not find such a program. So, this module is probably useless." 1993 echo "*** \`nm' from GNU binutils and a full rebuild may help." 2689 1994 fi 2690 1995 if test "$build_old_libs" = no; then … … 2703 2008 fi # link shared/static library? 2704 2009 2705 if test "$linkmode"= lib; then2010 if test $linkmode = lib; then 2706 2011 if test -n "$dependency_libs" && 2707 { test "$hardcode_into_libs" != yes || 2708 test "$build_old_libs" = yes || 2709 test "$link_static" = yes; }; then 2012 { test $hardcode_into_libs != yes || test $build_old_libs = yes || 2013 test $link_static = yes; }; then 2710 2014 # Extract -R from dependency_libs 2711 2015 temp_deplibs= … … 2738 2042 done 2739 2043 2740 if test "$link_all_deplibs"!= no; then2044 if test $link_all_deplibs != no; then 2741 2045 # Add the search paths of all dependency libraries 2742 2046 for deplib in $dependency_libs; do … … 2758 2062 esac 2759 2063 if grep "^installed=no" $deplib > /dev/null; then 2760 path=" $absdir/$objdir"2064 path="-L$absdir/$objdir" 2761 2065 else 2762 2066 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` 2763 2067 if test -z "$libdir"; then 2764 2068 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 2765 exit $EXIT_FAILURE2069 exit 1 2766 2070 fi 2767 2071 if test "$absdir" != "$libdir"; then 2768 2072 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 2769 2073 fi 2770 path=" $absdir"2074 path="-L$absdir" 2771 2075 fi 2772 depdepl=2773 case $host in2774 *-*-darwin*)2775 # we do not want to link against static libs,2776 # but need to link against shared2777 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`2778 if test -n "$deplibrary_names" ; then2779 for tmp in $deplibrary_names ; do2780 depdepl=$tmp2781 done2782 if test -f "$path/$depdepl" ; then2783 depdepl="$path/$depdepl"2784 fi2785 # do not add paths which are already there2786 case " $newlib_search_path " in2787 *" $path "*) ;;2788 *) newlib_search_path="$newlib_search_path $path";;2789 esac2790 fi2791 path=""2792 ;;2793 *)2794 path="-L$path"2795 ;;2796 esac2797 ;;2798 -l*)2799 case $host in2800 *-*-darwin*)2801 # Again, we only want to link against shared libraries2802 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`2803 for tmp in $newlib_search_path ; do2804 if test -f "$tmp/lib$tmp_libs.dylib" ; then2805 eval depdepl="$tmp/lib$tmp_libs.dylib"2806 break2807 fi2808 done2809 path=""2810 ;;2811 *) continue ;;2812 esac2813 2076 ;; 2814 2077 *) continue ;; 2815 esac2816 case " $deplibs " in2817 *" $depdepl "*) ;;2818 *) deplibs="$depdepl $deplibs" ;;2819 2078 esac 2820 2079 case " $deplibs " in … … 2826 2085 fi # linkmode = lib 2827 2086 done # for deplib in $libs 2828 dependency_libs="$newdependency_libs" 2829 if test "$pass" = dlpreopen; then 2087 if test $pass = dlpreopen; then 2830 2088 # Link the dlpreopened libraries before other libraries 2831 2089 for deplib in $save_deplibs; do … … 2833 2091 done 2834 2092 fi 2835 if test "$pass" != dlopen; then 2836 if test "$pass" != conv; then 2093 if test $pass != dlopen; then 2094 test $pass != scan && dependency_libs="$newdependency_libs" 2095 if test $pass != conv; then 2837 2096 # Make sure lib_search_path contains only unique directories. 2838 2097 lib_search_path= … … 2856 2115 new_libs= 2857 2116 for deplib in $tmp_libs; do 2858 # FIXME: Pedantically, this is the right thing to do, so2859 # that some nasty dependency loop isn't accidentally2860 # broken:2861 #new_libs="$deplib $new_libs"2862 # Pragmatically, this seems to cause very few problems in2863 # practice:2864 2117 case $deplib in 2865 2118 -L*) new_libs="$deplib $new_libs" ;; 2866 -R*) ;;2867 2119 *) 2868 # And here is the reason: when a library appears more2869 # than once as an explicit dependence of a library, or2870 # is implicitly linked in more than once by the2871 # compiler, it is considered special, and multiple2872 # occurrences thereof are not removed. Compare this2873 # with having the same library being listed as a2874 # dependency of multiple other libraries: in this case,2875 # we know (pedantically, we assume) the library does not2876 # need to be listed more than once, so we keep only the2877 # last copy. This is not always right, but it is rare2878 # enough that we require users that really mean to play2879 # such unportable linking tricks to link the library2880 # using -Wl,-lname, so that libtool does not consider it2881 # for duplicate removal.2882 2120 case " $specialdeplibs " in 2883 2121 *" $deplib "*) new_libs="$deplib $new_libs" ;; … … 2907 2145 done # for var 2908 2146 fi 2909 # Last step: remove runtime libs from dependency_libs 2910 # (they stay in deplibs) 2911 tmp_libs= 2912 for i in $dependency_libs ; do 2913 case " $predeps $postdeps $compiler_lib_search_path " in 2914 *" $i "*) 2915 i="" 2916 ;; 2917 esac 2918 if test -n "$i" ; then 2919 tmp_libs="$tmp_libs $i" 2920 fi 2921 done 2922 dependency_libs=$tmp_libs 2147 if test "$pass" = "conv" && 2148 { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then 2149 libs="$deplibs" # reset libs 2150 deplibs= 2151 fi 2923 2152 done # for pass 2924 if test "$linkmode"= prog; then2153 if test $linkmode = prog; then 2925 2154 dlfiles="$newdlfiles" 2926 2155 dlprefiles="$newdlprefiles" … … 2929 2158 case $linkmode in 2930 2159 oldlib) 2931 if test -n "$deplibs"; then2932 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&22933 fi2934 2935 2160 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then 2936 2161 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 … … 2946 2171 2947 2172 if test -n "$vinfo"; then 2948 $echo "$modename: warning: \`-version-info /-version-number' is ignored for archives" 1>&22173 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2 2949 2174 fi 2950 2175 … … 2968 2193 lib*) 2969 2194 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` 2970 eval shared_ext=\"$shrext_cmds\"2971 2195 eval libname=\"$libname_spec\" 2972 2196 ;; … … 2975 2199 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 2976 2200 $echo "$help" 1>&2 2977 exit $EXIT_FAILURE2201 exit 1 2978 2202 fi 2979 2203 if test "$need_lib_prefix" != no; then 2980 2204 # Add the "lib" prefix for modules if required 2981 2205 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` 2982 eval shared_ext=\"$shrext_cmds\"2983 2206 eval libname=\"$libname_spec\" 2984 2207 else … … 2991 2214 if test "$deplibs_check_method" != pass_all; then 2992 2215 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 2993 exit $EXIT_FAILURE2216 exit 1 2994 2217 else 2995 $echo2996 $echo "*** Warning: Linking the shared library $output against the non-libtool"2997 $echo "*** objects $objs is not portable!"2218 echo 2219 echo "*** Warning: Linking the shared library $output against the non-libtool" 2220 echo "*** objects $objs is not portable!" 2998 2221 libobjs="$libobjs $objs" 2999 2222 fi … … 3005 2228 3006 2229 set dummy $rpath 3007 if test "$#"-gt 2; then2230 if test $# -gt 2; then 3008 2231 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 3009 2232 fi … … 3014 2237 if test "$build_libtool_libs" = yes; then 3015 2238 # Building a libtool convenience library. 3016 # Some compilers have problems with a `.al' extension so 3017 # convenience libraries should have the same extension an 3018 # archive normally would. 2239 libext=al 3019 2240 oldlibs="$output_objdir/$libname.$libext $oldlibs" 3020 2241 build_libtool_libs=convenience … … 3023 2244 3024 2245 if test -n "$vinfo"; then 3025 $echo "$modename: warning: \`-version-info /-version-number' is ignored for convenience libraries" 1>&22246 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2 3026 2247 fi 3027 2248 … … 3039 2260 $echo "$modename: too many parameters to \`-version-info'" 1>&2 3040 2261 $echo "$help" 1>&2 3041 exit $EXIT_FAILURE 3042 fi 3043 3044 # convert absolute version numbers to libtool ages 3045 # this retains compatibility with .la files and attempts 3046 # to make the code below a bit more comprehensible 3047 3048 case $vinfo_number in 3049 yes) 3050 number_major="$2" 3051 number_minor="$3" 3052 number_revision="$4" 3053 # 3054 # There are really only two kinds -- those that 3055 # use the current revision as the major version 3056 # and those that subtract age and use age as 3057 # a minor version. But, then there is irix 3058 # which has an extra 1 added just for fun 3059 # 3060 case $version_type in 3061 darwin|linux|osf|windows) 3062 current=`expr $number_major + $number_minor` 3063 age="$number_minor" 3064 revision="$number_revision" 3065 ;; 3066 freebsd-aout|freebsd-elf|sunos) 3067 current="$number_major" 3068 revision="$number_minor" 3069 age="0" 3070 ;; 3071 irix|nonstopux) 3072 current=`expr $number_major + $number_minor - 1` 3073 age="$number_minor" 3074 revision="$number_minor" 3075 ;; 3076 esac 3077 ;; 3078 no) 3079 current="$2" 3080 revision="$3" 3081 age="$4" 3082 ;; 3083 esac 2262 exit 1 2263 fi 2264 2265 current="$2" 2266 revision="$3" 2267 age="$4" 3084 2268 3085 2269 # Check that each of the things are valid numbers. 3086 2270 case $current in 3087 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;2271 [0-9]*) ;; 3088 2272 *) 3089 2273 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 3090 2274 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 3091 exit $EXIT_FAILURE2275 exit 1 3092 2276 ;; 3093 2277 esac 3094 2278 3095 2279 case $revision in 3096 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;2280 [0-9]*) ;; 3097 2281 *) 3098 2282 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 3099 2283 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 3100 exit $EXIT_FAILURE2284 exit 1 3101 2285 ;; 3102 2286 esac 3103 2287 3104 2288 case $age in 3105 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;2289 [0-9]*) ;; 3106 2290 *) 3107 2291 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 3108 2292 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 3109 exit $EXIT_FAILURE2293 exit 1 3110 2294 ;; 3111 2295 esac 3112 2296 3113 if test "$age" -gt "$current"; then2297 if test $age -gt $current; then 3114 2298 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 3115 2299 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 3116 exit $EXIT_FAILURE2300 exit 1 3117 2301 fi 3118 2302 … … 3131 2315 # Darwin ld doesn't like 0 for these options... 3132 2316 minor_current=`expr $current + 1` 3133 verstring=" ${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"2317 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" 3134 2318 ;; 3135 2319 … … 3155 2339 # Add in all the interfaces that we are compatible with. 3156 2340 loop=$revision 3157 while test "$loop" -ne0; do2341 while test $loop != 0; do 3158 2342 iface=`expr $revision - $loop` 3159 2343 loop=`expr $loop - 1` … … 3178 2362 # Add in all the interfaces that we are compatible with. 3179 2363 loop=$age 3180 while test "$loop" -ne0; do2364 while test $loop != 0; do 3181 2365 iface=`expr $current - $loop` 3182 2366 loop=`expr $loop - 1` … … 3202 2386 *) 3203 2387 $echo "$modename: unknown library version type \`$version_type'" 1>&2 3204 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&23205 exit $EXIT_FAILURE2388 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 2389 exit 1 3206 2390 ;; 3207 2391 esac … … 3210 2394 if test -z "$vinfo" && test -n "$release"; then 3211 2395 major= 2396 verstring="0.0" 3212 2397 case $version_type in 3213 2398 darwin) 3214 2399 # we can't check for "0.0" in archive_cmds due to quoting 3215 2400 # problems, so we reset it completely 3216 verstring= 2401 verstring="" 3217 2402 ;; 3218 2403 *) … … 3248 2433 3249 2434 if test "$mode" != relink; then 3250 # Remove our outputs, but don't remove object files since they 3251 # may have been created when compiling PIC objects. 3252 removelist= 3253 tempremovelist=`$echo "$output_objdir/*"` 3254 for p in $tempremovelist; do 3255 case $p in 3256 *.$objext) 3257 ;; 3258 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) 3259 if test "X$precious_files_regex" != "X"; then 3260 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 3261 then 3262 continue 3263 fi 3264 fi 3265 removelist="$removelist $p" 3266 ;; 3267 *) ;; 3268 esac 3269 done 3270 if test -n "$removelist"; then 3271 $show "${rm}r $removelist" 3272 $run ${rm}r $removelist 3273 fi 2435 # Remove our outputs. 2436 $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*" 2437 $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.* 3274 2438 fi 3275 2439 … … 3284 2448 # Eliminate all temporary directories. 3285 2449 for path in $notinst_path; do 3286 lib_search_path=` $echo "$lib_search_path " | ${SED} -e 's% $path % %g'`3287 deplibs=` $echo "$deplibs " | ${SED} -e 's% -L$path % %g'`3288 dependency_libs=` $echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`2450 lib_search_path=`echo "$lib_search_path " | ${SED} -e 's% $path % %g'` 2451 deplibs=`echo "$deplibs " | ${SED} -e 's% -L$path % %g'` 2452 dependency_libs=`echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'` 3289 2453 done 3290 2454 … … 3299 2463 esac 3300 2464 done 3301 if test "$hardcode_into_libs" != yes || test "$build_old_libs"= yes; then2465 if test $hardcode_into_libs != yes || test $build_old_libs = yes; then 3302 2466 dependency_libs="$temp_xrpath $dependency_libs" 3303 2467 fi … … 3339 2503 *-*-openbsd* | *-*-freebsd*) 3340 2504 # Do not include libc due to us having libc/libc_r. 3341 test "X$arg" = "X-lc" && continue3342 2505 ;; 3343 *)2506 *) 3344 2507 # Add libc to deplibs on all other systems if necessary. 3345 if test "$build_libtool_need_lc"= "yes"; then2508 if test $build_libtool_need_lc = "yes"; then 3346 2509 deplibs="$deplibs -lc" 3347 2510 fi … … 3370 2533 # whether the library exists or not. But this is on 3371 2534 # osf3 & osf4 and I'm not really sure... Just 3372 # implementing what was already the behavio r.2535 # implementing what was already the behaviour. 3373 2536 newdeplibs=$deplibs 3374 2537 ;; … … 3383 2546 EOF 3384 2547 $rm conftest 3385 $ LTCC -o conftest conftest.c $deplibs3386 if test "$?"-eq 0 ; then2548 $CC -o conftest conftest.c $deplibs 2549 if test $? -eq 0 ; then 3387 2550 ldd_output=`ldd conftest` 3388 2551 for i in $deplibs; do 3389 2552 name="`expr $i : '-l\(.*\)'`" 3390 2553 # If $name is empty we are operating on a -L argument. 3391 if test "$name" != "" && test "$name" -ne "0"; then 3392 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 3393 case " $predeps $postdeps " in 3394 *" $i "*) 3395 newdeplibs="$newdeplibs $i" 3396 i="" 3397 ;; 3398 esac 3399 fi 3400 if test -n "$i" ; then 2554 if test -n "$name" && test "$name" != "0"; then 2555 libname=`eval \\$echo \"$libname_spec\"` 2556 deplib_matches=`eval \\$echo \"$library_names_spec\"` 2557 set dummy $deplib_matches 2558 deplib_match=$2 2559 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then 2560 newdeplibs="$newdeplibs $i" 2561 else 2562 droppeddeps=yes 2563 echo 2564 echo "*** Warning: dynamic linker does not accept needed library $i." 2565 echo "*** I have the capability to make that library automatically link in when" 2566 echo "*** you link to this library. But I can only do this if you have a" 2567 echo "*** shared version of the library, which I believe you do not have" 2568 echo "*** because a test_compile did reveal that the linker did not use it for" 2569 echo "*** its dynamic dependency list that programs get resolved with at runtime." 2570 fi 2571 else 2572 newdeplibs="$newdeplibs $i" 2573 fi 2574 done 2575 else 2576 # Error occured in the first compile. Let's try to salvage 2577 # the situation: Compile a separate program for each library. 2578 for i in $deplibs; do 2579 name="`expr $i : '-l\(.*\)'`" 2580 # If $name is empty we are operating on a -L argument. 2581 if test -n "$name" && test "$name" != "0"; then 2582 $rm conftest 2583 $CC -o conftest conftest.c $i 2584 # Did it work? 2585 if test $? -eq 0 ; then 2586 ldd_output=`ldd conftest` 3401 2587 libname=`eval \\$echo \"$libname_spec\"` 3402 2588 deplib_matches=`eval \\$echo \"$library_names_spec\"` … … 3407 2593 else 3408 2594 droppeddeps=yes 3409 $echo 3410 $echo "*** Warning: dynamic linker does not accept needed library $i." 3411 $echo "*** I have the capability to make that library automatically link in when" 3412 $echo "*** you link to this library. But I can only do this if you have a" 3413 $echo "*** shared version of the library, which I believe you do not have" 3414 $echo "*** because a test_compile did reveal that the linker did not use it for" 3415 $echo "*** its dynamic dependency list that programs get resolved with at runtime." 3416 fi 3417 fi 3418 else 3419 newdeplibs="$newdeplibs $i" 3420 fi 3421 done 3422 else 3423 # Error occurred in the first compile. Let's try to salvage 3424 # the situation: Compile a separate program for each library. 3425 for i in $deplibs; do 3426 name="`expr $i : '-l\(.*\)'`" 3427 # If $name is empty we are operating on a -L argument. 3428 if test "$name" != "" && test "$name" != "0"; then 3429 $rm conftest 3430 $LTCC -o conftest conftest.c $i 3431 # Did it work? 3432 if test "$?" -eq 0 ; then 3433 ldd_output=`ldd conftest` 3434 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 3435 case " $predeps $postdeps " in 3436 *" $i "*) 3437 newdeplibs="$newdeplibs $i" 3438 i="" 3439 ;; 3440 esac 3441 fi 3442 if test -n "$i" ; then 3443 libname=`eval \\$echo \"$libname_spec\"` 3444 deplib_matches=`eval \\$echo \"$library_names_spec\"` 3445 set dummy $deplib_matches 3446 deplib_match=$2 3447 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then 3448 newdeplibs="$newdeplibs $i" 3449 else 3450 droppeddeps=yes 3451 $echo 3452 $echo "*** Warning: dynamic linker does not accept needed library $i." 3453 $echo "*** I have the capability to make that library automatically link in when" 3454 $echo "*** you link to this library. But I can only do this if you have a" 3455 $echo "*** shared version of the library, which you do not appear to have" 3456 $echo "*** because a test_compile did reveal that the linker did not use this one" 3457 $echo "*** as a dynamic dependency that programs can get resolved with at runtime." 3458 fi 2595 echo 2596 echo "*** Warning: dynamic linker does not accept needed library $i." 2597 echo "*** I have the capability to make that library automatically link in when" 2598 echo "*** you link to this library. But I can only do this if you have a" 2599 echo "*** shared version of the library, which you do not appear to have" 2600 echo "*** because a test_compile did reveal that the linker did not use this one" 2601 echo "*** as a dynamic dependency that programs can get resolved with at runtime." 3459 2602 fi 3460 2603 else 3461 2604 droppeddeps=yes 3462 $echo3463 $echo "*** Warning! Library $i is needed by this library but I was not able to"3464 $echo "*** make it link in! You will probably need to install it or some"3465 $echo "*** library that it depends on before this library will be fully"3466 $echo "*** functional. Installing it before continuing would be even better."2605 echo 2606 echo "*** Warning! Library $i is needed by this library but I was not able to" 2607 echo "*** make it link in! You will probably need to install it or some" 2608 echo "*** library that it depends on before this library will be fully" 2609 echo "*** functional. Installing it before continuing would be even better." 3467 2610 fi 3468 2611 else … … 3478 2621 name="`expr $a_deplib : '-l\(.*\)'`" 3479 2622 # If $name is empty we are operating on a -L argument. 3480 if test "$name" != "" && test "$name" != "0"; then 3481 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 3482 case " $predeps $postdeps " in 3483 *" $a_deplib "*) 3484 newdeplibs="$newdeplibs $a_deplib" 3485 a_deplib="" 3486 ;; 3487 esac 3488 fi 3489 if test -n "$a_deplib" ; then 3490 libname=`eval \\$echo \"$libname_spec\"` 3491 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do 3492 potential_libs=`ls $i/$libname[.-]* 2>/dev/null` 3493 for potent_lib in $potential_libs; do 2623 if test -n "$name" && test "$name" != "0"; then 2624 libname=`eval \\$echo \"$libname_spec\"` 2625 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do 2626 potential_libs=`ls $i/$libname[.-]* 2>/dev/null` 2627 for potent_lib in $potential_libs; do 3494 2628 # Follow soft links. 3495 2629 if ls -lLd "$potent_lib" 2>/dev/null \ … … 3512 2646 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ 3513 2647 | ${SED} 10q \ 3514 | $EGREP"$file_magic_regex" > /dev/null; then2648 | egrep "$file_magic_regex" > /dev/null; then 3515 2649 newdeplibs="$newdeplibs $a_deplib" 3516 2650 a_deplib="" 3517 2651 break 2 3518 2652 fi 3519 done 3520 done 3521 fi 2653 done 2654 done 3522 2655 if test -n "$a_deplib" ; then 3523 2656 droppeddeps=yes 3524 $echo3525 $echo "*** Warning: linker path does not have real file for library $a_deplib."3526 $echo "*** I have the capability to make that library automatically link in when"3527 $echo "*** you link to this library. But I can only do this if you have a"3528 $echo "*** shared version of the library, which you do not appear to have"3529 $echo "*** because I did check the linker path looking for a file starting"2657 echo 2658 echo "*** Warning: linker path does not have real file for library $a_deplib." 2659 echo "*** I have the capability to make that library automatically link in when" 2660 echo "*** you link to this library. But I can only do this if you have a" 2661 echo "*** shared version of the library, which you do not appear to have" 2662 echo "*** because I did check the linker path looking for a file starting" 3530 2663 if test -z "$potlib" ; then 3531 $echo "*** with $libname but no candidates were found. (...for file magic test)"2664 echo "*** with $libname but no candidates were found. (...for file magic test)" 3532 2665 else 3533 $echo "*** with $libname and none of the candidates passed a file format test"3534 $echo "*** using a file magic. Last file checked: $potlib"2666 echo "*** with $libname and none of the candidates passed a file format test" 2667 echo "*** using a file magic. Last file checked: $potlib" 3535 2668 fi 3536 2669 fi … … 3548 2681 # If $name is empty we are operating on a -L argument. 3549 2682 if test -n "$name" && test "$name" != "0"; then 3550 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 3551 case " $predeps $postdeps " in 3552 *" $a_deplib "*) 3553 newdeplibs="$newdeplibs $a_deplib" 3554 a_deplib="" 3555 ;; 3556 esac 3557 fi 3558 if test -n "$a_deplib" ; then 3559 libname=`eval \\$echo \"$libname_spec\"` 3560 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do 3561 potential_libs=`ls $i/$libname[.-]* 2>/dev/null` 3562 for potent_lib in $potential_libs; do 3563 potlib="$potent_lib" # see symlink-check above in file_magic test 3564 if eval $echo \"$potent_lib\" 2>/dev/null \ 3565 | ${SED} 10q \ 3566 | $EGREP "$match_pattern_regex" > /dev/null; then 3567 newdeplibs="$newdeplibs $a_deplib" 3568 a_deplib="" 3569 break 2 3570 fi 3571 done 2683 libname=`eval \\$echo \"$libname_spec\"` 2684 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do 2685 potential_libs=`ls $i/$libname[.-]* 2>/dev/null` 2686 for potent_lib in $potential_libs; do 2687 potlib="$potent_lib" # see symlink-check below in file_magic test 2688 if eval echo \"$potent_lib\" 2>/dev/null \ 2689 | ${SED} 10q \ 2690 | egrep "$match_pattern_regex" > /dev/null; then 2691 newdeplibs="$newdeplibs $a_deplib" 2692 a_deplib="" 2693 break 2 2694 fi 3572 2695 done 3573 fi2696 done 3574 2697 if test -n "$a_deplib" ; then 3575 2698 droppeddeps=yes 3576 $echo3577 $echo "*** Warning: linker path does not have real file for library $a_deplib."3578 $echo "*** I have the capability to make that library automatically link in when"3579 $echo "*** you link to this library. But I can only do this if you have a"3580 $echo "*** shared version of the library, which you do not appear to have"3581 $echo "*** because I did check the linker path looking for a file starting"2699 echo 2700 echo "*** Warning: linker path does not have real file for library $a_deplib." 2701 echo "*** I have the capability to make that library automatically link in when" 2702 echo "*** you link to this library. But I can only do this if you have a" 2703 echo "*** shared version of the library, which you do not appear to have" 2704 echo "*** because I did check the linker path looking for a file starting" 3582 2705 if test -z "$potlib" ; then 3583 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"2706 echo "*** with $libname but no candidates were found. (...for regex pattern test)" 3584 2707 else 3585 $echo "*** with $libname and none of the candidates passed a file format test"3586 $echo "*** using a regex pattern. Last file checked: $potlib"2708 echo "*** with $libname and none of the candidates passed a file format test" 2709 echo "*** using a regex pattern. Last file checked: $potlib" 3587 2710 fi 3588 2711 fi … … 3595 2718 none | unknown | *) 3596 2719 newdeplibs="" 3597 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ 3598 -e 's/ -[LR][^ ]*//g'` 3599 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 3600 for i in $predeps $postdeps ; do 3601 # can't use Xsed below, because $i might contain '/' 3602 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` 3603 done 3604 fi 3605 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ 3606 | grep . >/dev/null; then 3607 $echo 2720 if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ 2721 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' | 2722 grep . >/dev/null; then 2723 echo 3608 2724 if test "X$deplibs_check_method" = "Xnone"; then 3609 $echo "*** Warning: inter-library dependencies are not supported in this platform."2725 echo "*** Warning: inter-library dependencies are not supported in this platform." 3610 2726 else 3611 $echo "*** Warning: inter-library dependencies are not known to be supported."2727 echo "*** Warning: inter-library dependencies are not known to be supported." 3612 2728 fi 3613 $echo "*** All declared inter-library dependencies are being dropped."2729 echo "*** All declared inter-library dependencies are being dropped." 3614 2730 droppeddeps=yes 3615 2731 fi … … 3631 2747 if test "$droppeddeps" = yes; then 3632 2748 if test "$module" = yes; then 3633 $echo3634 $echo "*** Warning: libtool could not satisfy all declared inter-library"3635 $echo "*** dependencies of module $libname. Therefore, libtool will create"3636 $echo "*** a static module, that should work as long as the dlopening"3637 $echo "*** application is linked with the -dlopen flag."2749 echo 2750 echo "*** Warning: libtool could not satisfy all declared inter-library" 2751 echo "*** dependencies of module $libname. Therefore, libtool will create" 2752 echo "*** a static module, that should work as long as the dlopening" 2753 echo "*** application is linked with the -dlopen flag." 3638 2754 if test -z "$global_symbol_pipe"; then 3639 $echo3640 $echo "*** However, this would only work if libtool was able to extract symbol"3641 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"3642 $echo "*** not find such a program. So, this module is probably useless."3643 $echo "*** \`nm' from GNU binutils and a full rebuild may help."2755 echo 2756 echo "*** However, this would only work if libtool was able to extract symbol" 2757 echo "*** lists from a program, using \`nm' or equivalent, but libtool could" 2758 echo "*** not find such a program. So, this module is probably useless." 2759 echo "*** \`nm' from GNU binutils and a full rebuild may help." 3644 2760 fi 3645 2761 if test "$build_old_libs" = no; then … … 3651 2767 fi 3652 2768 else 3653 $echo "*** The inter-library dependencies that have been dropped here will be"3654 $echo "*** automatically added whenever a program is linked with this library"3655 $echo "*** or is declared to -dlopen it."3656 3657 if test "$allow_undefined"= no; then3658 $echo3659 $echo "*** Since this library must not contain undefined symbols,"3660 $echo "*** because either the platform does not support them or"3661 $echo "*** it was explicitly requested with -no-undefined,"3662 $echo "*** libtool will only create a static version of it."2769 echo "*** The inter-library dependencies that have been dropped here will be" 2770 echo "*** automatically added whenever a program is linked with this library" 2771 echo "*** or is declared to -dlopen it." 2772 2773 if test $allow_undefined = no; then 2774 echo 2775 echo "*** Since this library must not contain undefined symbols," 2776 echo "*** because either the platform does not support them or" 2777 echo "*** it was explicitly requested with -no-undefined," 2778 echo "*** libtool will only create a static version of it." 3663 2779 if test "$build_old_libs" = no; then 3664 2780 oldlibs="$output_objdir/$libname.$libext" … … 3682 2798 # Test again, we may have decided not to build it any more 3683 2799 if test "$build_libtool_libs" = yes; then 3684 if test "$hardcode_into_libs"= yes; then2800 if test $hardcode_into_libs = yes; then 3685 2801 # Hardcode the library paths 3686 2802 hardcode_libdirs= … … 3718 2834 test -n "$hardcode_libdirs"; then 3719 2835 libdir="$hardcode_libdirs" 3720 if test -n "$hardcode_libdir_flag_spec_ld"; then 3721 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" 3722 else 3723 eval dep_rpath=\"$hardcode_libdir_flag_spec\" 3724 fi 2836 eval dep_rpath=\"$hardcode_libdir_flag_spec\" 3725 2837 fi 3726 2838 if test -n "$runpath_var" && test -n "$perm_rpath"; then … … 3742 2854 3743 2855 # Get the real and link names of the library. 3744 eval shared_ext=\"$shrext_cmds\"3745 2856 eval library_names=\"$library_names_spec\" 3746 2857 set dummy $library_names … … 3753 2864 soname="$realname" 3754 2865 fi 3755 if test -z "$dlname"; then 3756 dlname=$soname 3757 fi 2866 test -z "$dlname" && dlname=$soname 3758 2867 3759 2868 lib="$output_objdir/$realname" … … 3761 2870 do 3762 2871 linknames="$linknames $link" 2872 done 2873 2874 # Ensure that we have .o objects for linkers which dislike .lo 2875 # (e.g. aix) in case we are running --disable-static 2876 for obj in $libobjs; do 2877 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` 2878 if test "X$xdir" = "X$obj"; then 2879 xdir="." 2880 else 2881 xdir="$xdir" 2882 fi 2883 baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` 2884 oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` 2885 if test ! -f $xdir/$oldobj; then 2886 $show "(cd $xdir && ${LN_S} $baseobj $oldobj)" 2887 $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $? 2888 fi 3763 2889 done 3764 2890 … … 3772 2898 export_symbols="$output_objdir/$libname.exp" 3773 2899 $run $rm $export_symbols 3774 cmds=$export_symbols_cmds2900 eval cmds=\"$export_symbols_cmds\" 3775 2901 save_ifs="$IFS"; IFS='~' 3776 2902 for cmd in $cmds; do 3777 2903 IFS="$save_ifs" 3778 eval cmd=\"$cmd\" 3779 if len=`expr "X$cmd" : ".*"` && 3780 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then 3781 $show "$cmd" 3782 $run eval "$cmd" || exit $? 3783 skipped_export=false 3784 else 3785 # The command line is too long to execute in one step. 3786 $show "using reloadable object file for export list..." 3787 skipped_export=: 3788 fi 2904 $show "$cmd" 2905 $run eval "$cmd" || exit $? 3789 2906 done 3790 2907 IFS="$save_ifs" 3791 2908 if test -n "$export_symbols_regex"; then 3792 $show " $EGREP-e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""3793 $run eval ' $EGREP-e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'2909 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" 2910 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' 3794 2911 $show "$mv \"${export_symbols}T\" \"$export_symbols\"" 3795 2912 $run eval '$mv "${export_symbols}T" "$export_symbols"' … … 3802 2919 fi 3803 2920 3804 tmp_deplibs=3805 for test_deplib in $deplibs; do3806 case " $convenience " in3807 *" $test_deplib "*) ;;3808 *)3809 tmp_deplibs="$tmp_deplibs $test_deplib"3810 ;;3811 esac3812 done3813 deplibs="$tmp_deplibs"3814 3815 2921 if test -n "$convenience"; then 3816 2922 if test -n "$whole_archive_flag_spec"; then 3817 save_libobjs=$libobjs3818 2923 eval libobjs=\"\$libobjs $whole_archive_flag_spec\" 3819 2924 else 3820 2925 gentop="$output_objdir/${outputname}x" 2926 $show "${rm}r $gentop" 2927 $run ${rm}r "$gentop" 2928 $show "mkdir $gentop" 2929 $run mkdir "$gentop" 2930 status=$? 2931 if test $status -ne 0 && test ! -d "$gentop"; then 2932 exit $status 2933 fi 3821 2934 generated="$generated $gentop" 3822 2935 3823 func_extract_archives $gentop $convenience 3824 libobjs="$libobjs $func_extract_archives_result" 3825 fi 3826 fi 3827 2936 for xlib in $convenience; do 2937 # Extract the objects. 2938 case $xlib in 2939 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; 2940 *) xabs=`pwd`"/$xlib" ;; 2941 esac 2942 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` 2943 xdir="$gentop/$xlib" 2944 2945 $show "${rm}r $xdir" 2946 $run ${rm}r "$xdir" 2947 $show "mkdir $xdir" 2948 $run mkdir "$xdir" 2949 status=$? 2950 if test $status -ne 0 && test ! -d "$xdir"; then 2951 exit $status 2952 fi 2953 $show "(cd $xdir && $AR x $xabs)" 2954 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? 2955 2956 libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` 2957 done 2958 fi 2959 fi 2960 3828 2961 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then 3829 2962 eval flag=\"$thread_safe_flag_spec\" … … 3837 2970 3838 2971 # Do each of the archive commands. 3839 if test "$module" = yes && test -n "$module_cmds" ; then 3840 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then 3841 eval test_cmds=\"$module_expsym_cmds\" 3842 cmds=$module_expsym_cmds 3843 else 3844 eval test_cmds=\"$module_cmds\" 3845 cmds=$module_cmds 3846 fi 2972 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then 2973 eval cmds=\"$archive_expsym_cmds\" 3847 2974 else 3848 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then 3849 eval test_cmds=\"$archive_expsym_cmds\" 3850 cmds=$archive_expsym_cmds 3851 else 3852 eval test_cmds=\"$archive_cmds\" 3853 cmds=$archive_cmds 3854 fi 3855 fi 3856 3857 if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` && 3858 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then 3859 : 3860 else 3861 # The command line is too long to link in one step, link piecewise. 3862 $echo "creating reloadable object files..." 3863 3864 # Save the value of $output and $libobjs because we want to 3865 # use them later. If we have whole_archive_flag_spec, we 3866 # want to use save_libobjs as it was before 3867 # whole_archive_flag_spec was expanded, because we can't 3868 # assume the linker understands whole_archive_flag_spec. 3869 # This may have to be revisited, in case too many 3870 # convenience libraries get linked in and end up exceeding 3871 # the spec. 3872 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then 3873 save_libobjs=$libobjs 3874 fi 3875 save_output=$output 3876 3877 # Clear the reloadable object creation command queue and 3878 # initialize k to one. 3879 test_cmds= 3880 concat_cmds= 3881 objlist= 3882 delfiles= 3883 last_robj= 3884 k=1 3885 output=$output_objdir/$save_output-${k}.$objext 3886 # Loop over the list of objects to be linked. 3887 for obj in $save_libobjs 3888 do 3889 eval test_cmds=\"$reload_cmds $objlist $last_robj\" 3890 if test "X$objlist" = X || 3891 { len=`expr "X$test_cmds" : ".*"` && 3892 test "$len" -le "$max_cmd_len"; }; then 3893 objlist="$objlist $obj" 3894 else 3895 # The command $test_cmds is almost too long, add a 3896 # command to the queue. 3897 if test "$k" -eq 1 ; then 3898 # The first file doesn't have a previous command to add. 3899 eval concat_cmds=\"$reload_cmds $objlist $last_robj\" 3900 else 3901 # All subsequent reloadable object files will link in 3902 # the last one created. 3903 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" 2975 save_deplibs="$deplibs" 2976 for conv in $convenience; do 2977 tmp_deplibs= 2978 for test_deplib in $deplibs; do 2979 if test "$test_deplib" != "$conv"; then 2980 tmp_deplibs="$tmp_deplibs $test_deplib" 3904 2981 fi 3905 last_robj=$output_objdir/$save_output-${k}.$objext 3906 k=`expr $k + 1` 3907 output=$output_objdir/$save_output-${k}.$objext 3908 objlist=$obj 3909 len=1 3910 fi 2982 done 2983 deplibs="$tmp_deplibs" 3911 2984 done 3912 # Handle the remaining objects by creating one last 3913 # reloadable object file. All subsequent reloadable object 3914 # files will link in the last one created. 3915 test -z "$concat_cmds" || concat_cmds=$concat_cmds~ 3916 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" 3917 3918 if ${skipped_export-false}; then 3919 $show "generating symbol list for \`$libname.la'" 3920 export_symbols="$output_objdir/$libname.exp" 3921 $run $rm $export_symbols 3922 libobjs=$output 3923 # Append the command to create the export file. 3924 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" 3925 fi 3926 3927 # Set up a command to remove the reloadale object files 3928 # after they are used. 3929 i=0 3930 while test "$i" -lt "$k" 3931 do 3932 i=`expr $i + 1` 3933 delfiles="$delfiles $output_objdir/$save_output-${i}.$objext" 3934 done 3935 3936 $echo "creating a temporary reloadable object file: $output" 3937 3938 # Loop through the commands generated above and execute them. 3939 save_ifs="$IFS"; IFS='~' 3940 for cmd in $concat_cmds; do 3941 IFS="$save_ifs" 3942 $show "$cmd" 3943 $run eval "$cmd" || exit $? 3944 done 3945 IFS="$save_ifs" 3946 3947 libobjs=$output 3948 # Restore the value of output. 3949 output=$save_output 3950 3951 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then 3952 eval libobjs=\"\$libobjs $whole_archive_flag_spec\" 3953 fi 3954 # Expand the library linking commands again to reset the 3955 # value of $libobjs for piecewise linking. 3956 3957 # Do each of the archive commands. 3958 if test "$module" = yes && test -n "$module_cmds" ; then 3959 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then 3960 cmds=$module_expsym_cmds 3961 else 3962 cmds=$module_cmds 3963 fi 3964 else 3965 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then 3966 cmds=$archive_expsym_cmds 3967 else 3968 cmds=$archive_cmds 3969 fi 3970 fi 3971 3972 # Append the command to remove the reloadable object files 3973 # to the just-reset $cmds. 3974 eval cmds=\"\$cmds~\$rm $delfiles\" 2985 eval cmds=\"$archive_cmds\" 2986 deplibs="$save_deplibs" 3975 2987 fi 3976 2988 save_ifs="$IFS"; IFS='~' 3977 2989 for cmd in $cmds; do 3978 2990 IFS="$save_ifs" 3979 eval cmd=\"$cmd\"3980 2991 $show "$cmd" 3981 2992 $run eval "$cmd" || exit $? … … 3986 2997 if test "$mode" = relink; then 3987 2998 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? 3988 exit $EXIT_SUCCESS2999 exit 0 3989 3000 fi 3990 3001 … … 4034 3045 if test -n "$objs$old_deplibs"; then 4035 3046 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 4036 exit $EXIT_FAILURE3047 exit 1 4037 3048 fi 4038 3049 libobj="$output" … … 4063 3074 else 4064 3075 gentop="$output_objdir/${obj}x" 3076 $show "${rm}r $gentop" 3077 $run ${rm}r "$gentop" 3078 $show "mkdir $gentop" 3079 $run mkdir "$gentop" 3080 status=$? 3081 if test $status -ne 0 && test ! -d "$gentop"; then 3082 exit $status 3083 fi 4065 3084 generated="$generated $gentop" 4066 3085 4067 func_extract_archives $gentop $convenience 4068 reload_conv_objs="$reload_objs $func_extract_archives_result" 3086 for xlib in $convenience; do 3087 # Extract the objects. 3088 case $xlib in 3089 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; 3090 *) xabs=`pwd`"/$xlib" ;; 3091 esac 3092 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` 3093 xdir="$gentop/$xlib" 3094 3095 $show "${rm}r $xdir" 3096 $run ${rm}r "$xdir" 3097 $show "mkdir $xdir" 3098 $run mkdir "$xdir" 3099 status=$? 3100 if test $status -ne 0 && test ! -d "$xdir"; then 3101 exit $status 3102 fi 3103 $show "(cd $xdir && $AR x $xabs)" 3104 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? 3105 3106 reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` 3107 done 4069 3108 fi 4070 3109 fi … … 4074 3113 4075 3114 output="$obj" 4076 cmds=$reload_cmds3115 eval cmds=\"$reload_cmds\" 4077 3116 save_ifs="$IFS"; IFS='~' 4078 3117 for cmd in $cmds; do 4079 3118 IFS="$save_ifs" 4080 eval cmd=\"$cmd\"4081 3119 $show "$cmd" 4082 3120 $run eval "$cmd" || exit $? … … 4091 3129 fi 4092 3130 4093 exit $EXIT_SUCCESS3131 exit 0 4094 3132 fi 4095 3133 … … 4102 3140 # Create an invalid libtool object if no PIC, so that we don't 4103 3141 # accidentally link it into a program. 4104 #$show "echo timestamp > $libobj"4105 #$run eval "echo timestamp > $libobj" || exit $?4106 exit $EXIT_SUCCESS3142 $show "echo timestamp > $libobj" 3143 $run eval "echo timestamp > $libobj" || exit $? 3144 exit 0 4107 3145 fi 4108 3146 … … 4111 3149 reload_objs="$libobjs $reload_conv_objs" 4112 3150 output="$libobj" 4113 cmds=$reload_cmds3151 eval cmds=\"$reload_cmds\" 4114 3152 save_ifs="$IFS"; IFS='~' 4115 3153 for cmd in $cmds; do 4116 3154 IFS="$save_ifs" 4117 eval cmd=\"$cmd\"4118 3155 $show "$cmd" 4119 3156 $run eval "$cmd" || exit $? 4120 3157 done 4121 3158 IFS="$save_ifs" 3159 else 3160 # Just create a symlink. 3161 $show $rm $libobj 3162 $run $rm $libobj 3163 xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` 3164 if test "X$xdir" = "X$libobj"; then 3165 xdir="." 3166 else 3167 xdir="$xdir" 3168 fi 3169 baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` 3170 oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` 3171 $show "(cd $xdir && $LN_S $oldobj $baseobj)" 3172 $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $? 4122 3173 fi 4123 3174 … … 4127 3178 fi 4128 3179 4129 exit $EXIT_SUCCESS3180 exit 0 4130 3181 ;; 4131 3182 4132 3183 prog) 4133 3184 case $host in 4134 *cygwin*) output=` $echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;3185 *cygwin*) output=`echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; 4135 3186 esac 4136 3187 if test -n "$vinfo"; then … … 4154 3205 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` 4155 3206 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` 4156 ;; 4157 esac 4158 4159 case $host in 4160 *darwin*) 4161 # Don't allow lazy linking, it breaks C++ global constructors 4162 if test "$tagname" = CXX ; then 4163 compile_command="$compile_command ${wl}-bind_at_load" 4164 finalize_command="$finalize_command ${wl}-bind_at_load" 4165 fi 4166 ;; 3207 case $host in 3208 *darwin*) 3209 # Don't allow lazy linking, it breaks C++ global constructors 3210 compile_command="$compile_command ${wl}-bind_at_load" 3211 finalize_command="$finalize_command ${wl}-bind_at_load" 3212 ;; 3213 esac 3214 ;; 4167 3215 esac 4168 3216 … … 4317 3365 4318 3366 if test -n "$exclude_expsyms"; then 4319 $run eval ' $EGREP-v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'3367 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' 4320 3368 $run eval '$mv "$nlist"T "$nlist"' 4321 3369 fi 4322 3370 4323 3371 if test -n "$export_symbols_regex"; then 4324 $run eval ' $EGREP-e "$export_symbols_regex" "$nlist" > "$nlist"T'3372 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T' 4325 3373 $run eval '$mv "$nlist"T "$nlist"' 4326 3374 fi … … 4340 3388 for arg in $dlprefiles; do 4341 3389 $show "extracting global C symbols from \`$arg'" 4342 name=` $echo "$arg" | ${SED} -e 's%^.*/%%'`4343 $run eval ' $echo ": $name " >> "$nlist"'3390 name=`echo "$arg" | ${SED} -e 's%^.*/%%'` 3391 $run eval 'echo ": $name " >> "$nlist"' 4344 3392 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" 4345 3393 done … … 4350 3398 4351 3399 if test -n "$exclude_expsyms"; then 4352 $EGREP-v " ($exclude_expsyms)$" "$nlist" > "$nlist"T3400 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T 4353 3401 $mv "$nlist"T "$nlist" 4354 3402 fi … … 4370 3418 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' 4371 3419 else 4372 $echo '/* NONE */' >> "$output_objdir/$dlsyms"3420 echo '/* NONE */' >> "$output_objdir/$dlsyms" 4373 3421 fi 4374 3422 … … 4422 3470 case "$compile_command " in 4423 3471 *" -static "*) ;; 4424 *) pic_flag_for_symtable=" $pic_flag -D FREEBSD_WORKAROUND";;3472 *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";; 4425 3473 esac;; 4426 3474 *-*-hpux*) 4427 3475 case "$compile_command " in 4428 3476 *" -static "*) ;; 4429 *) pic_flag_for_symtable=" $pic_flag ";;3477 *) pic_flag_for_symtable=" $pic_flag -DPIC";; 4430 3478 esac 4431 3479 esac 4432 3480 4433 3481 # Now compile the dynamic symbol file. 4434 $show "(cd $output_objdir && $ LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"4435 $run eval '(cd $output_objdir && $ LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?3482 $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" 3483 $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? 4436 3484 4437 3485 # Clean up the generated files. … … 4445 3493 *) 4446 3494 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 4447 exit $EXIT_FAILURE3495 exit 1 4448 3496 ;; 4449 3497 esac … … 4458 3506 fi 4459 3507 4460 if test "$need_relink"= no || test "$build_libtool_libs" != yes; then3508 if test $need_relink = no || test "$build_libtool_libs" != yes; then 4461 3509 # Replace the output file specification. 4462 3510 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` … … 4533 3581 $show "$link_command" 4534 3582 $run eval "$link_command" || exit $? 4535 exit $EXIT_SUCCESS3583 exit 0 4536 3584 fi 4537 3585 … … 4588 3636 4589 3637 # Quote $echo for shipping. 4590 if test "X$echo" = "X$SHELL $ progpath--fallback-echo"; then4591 case $ progpathin4592 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $ progpath--fallback-echo";;4593 *) qecho="$SHELL `pwd`/$ progpath--fallback-echo";;3638 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then 3639 case $0 in 3640 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; 3641 *) qecho="$SHELL `pwd`/$0 --fallback-echo";; 4594 3642 esac 4595 3643 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` … … 4603 3651 # a .exe suffix, so we strip it off here. 4604 3652 case $output in 4605 *.exe) output=` $echo $output|${SED} 's,.exe$,,'` ;;3653 *.exe) output=`echo $output|${SED} 's,.exe$,,'` ;; 4606 3654 esac 4607 3655 # test for cygwin because mv fails w/o .exe extensions 4608 3656 case $host in 4609 *cygwin*) 4610 exeext=.exe 4611 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; 3657 *cygwin*) exeext=.exe ;; 4612 3658 *) exeext= ;; 4613 3659 esac 4614 case $host in4615 *cygwin* | *mingw* )4616 cwrappersource=`$echo ${objdir}/lt-${output}.c`4617 cwrapper=`$echo ${output}.exe`4618 $rm $cwrappersource $cwrapper4619 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 154620 4621 cat > $cwrappersource <<EOF4622 4623 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname4624 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP4625 4626 The $output program cannot be directly executed until all the libtool4627 libraries that it depends on are installed.4628 4629 This wrapper executable should never be moved out of the build directory.4630 If it is, it will not operate correctly.4631 4632 Currently, it simply execs the wrapper *script* "/bin/sh $output",4633 but could eventually absorb all of the scripts functionality and4634 exec $objdir/$outputname directly.4635 */4636 EOF4637 cat >> $cwrappersource<<"EOF"4638 #include <stdio.h>4639 #include <stdlib.h>4640 #include <unistd.h>4641 #include <malloc.h>4642 #include <stdarg.h>4643 #include <assert.h>4644 4645 #if defined(PATH_MAX)4646 # define LT_PATHMAX PATH_MAX4647 #elif defined(MAXPATHLEN)4648 # define LT_PATHMAX MAXPATHLEN4649 #else4650 # define LT_PATHMAX 10244651 #endif4652 4653 #ifndef DIR_SEPARATOR4654 #define DIR_SEPARATOR '/'4655 #endif4656 4657 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \4658 defined (__OS2__)4659 #define HAVE_DOS_BASED_FILE_SYSTEM4660 #ifndef DIR_SEPARATOR_24661 #define DIR_SEPARATOR_2 '\\'4662 #endif4663 #endif4664 4665 #ifndef DIR_SEPARATOR_24666 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)4667 #else /* DIR_SEPARATOR_2 */4668 # define IS_DIR_SEPARATOR(ch) \4669 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))4670 #endif /* DIR_SEPARATOR_2 */4671 4672 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))4673 #define XFREE(stale) do { \4674 if (stale) { free ((void *) stale); stale = 0; } \4675 } while (0)4676 4677 const char *program_name = NULL;4678 4679 void * xmalloc (size_t num);4680 char * xstrdup (const char *string);4681 char * basename (const char *name);4682 char * fnqualify(const char *path);4683 char * strendzap(char *str, const char *pat);4684 void lt_fatal (const char *message, ...);4685 4686 int4687 main (int argc, char *argv[])4688 {4689 char **newargz;4690 int i;4691 4692 program_name = (char *) xstrdup ((char *) basename (argv[0]));4693 newargz = XMALLOC(char *, argc+2);4694 EOF4695 4696 cat >> $cwrappersource <<EOF4697 newargz[0] = "$SHELL";4698 EOF4699 4700 cat >> $cwrappersource <<"EOF"4701 newargz[1] = fnqualify(argv[0]);4702 /* we know the script has the same name, without the .exe */4703 /* so make sure newargz[1] doesn't end in .exe */4704 strendzap(newargz[1],".exe");4705 for (i = 1; i < argc; i++)4706 newargz[i+1] = xstrdup(argv[i]);4707 newargz[argc+1] = NULL;4708 EOF4709 4710 cat >> $cwrappersource <<EOF4711 execv("$SHELL",newargz);4712 EOF4713 4714 cat >> $cwrappersource <<"EOF"4715 }4716 4717 void *4718 xmalloc (size_t num)4719 {4720 void * p = (void *) malloc (num);4721 if (!p)4722 lt_fatal ("Memory exhausted");4723 4724 return p;4725 }4726 4727 char *4728 xstrdup (const char *string)4729 {4730 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL4731 ;4732 }4733 4734 char *4735 basename (const char *name)4736 {4737 const char *base;4738 4739 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)4740 /* Skip over the disk name in MSDOS pathnames. */4741 if (isalpha (name[0]) && name[1] == ':')4742 name += 2;4743 #endif4744 4745 for (base = name; *name; name++)4746 if (IS_DIR_SEPARATOR (*name))4747 base = name + 1;4748 return (char *) base;4749 }4750 4751 char *4752 fnqualify(const char *path)4753 {4754 size_t size;4755 char *p;4756 char tmp[LT_PATHMAX + 1];4757 4758 assert(path != NULL);4759 4760 /* Is it qualified already? */4761 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)4762 if (isalpha (path[0]) && path[1] == ':')4763 return xstrdup (path);4764 #endif4765 if (IS_DIR_SEPARATOR (path[0]))4766 return xstrdup (path);4767 4768 /* prepend the current directory */4769 /* doesn't handle '~' */4770 if (getcwd (tmp, LT_PATHMAX) == NULL)4771 lt_fatal ("getcwd failed");4772 size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */4773 p = XMALLOC(char, size);4774 sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);4775 return p;4776 }4777 4778 char *4779 strendzap(char *str, const char *pat)4780 {4781 size_t len, patlen;4782 4783 assert(str != NULL);4784 assert(pat != NULL);4785 4786 len = strlen(str);4787 patlen = strlen(pat);4788 4789 if (patlen <= len)4790 {4791 str += len - patlen;4792 if (strcmp(str, pat) == 0)4793 *str = '\0';4794 }4795 return str;4796 }4797 4798 static void4799 lt_error_core (int exit_status, const char * mode,4800 const char * message, va_list ap)4801 {4802 fprintf (stderr, "%s: %s: ", program_name, mode);4803 vfprintf (stderr, message, ap);4804 fprintf (stderr, ".\n");4805 4806 if (exit_status >= 0)4807 exit (exit_status);4808 }4809 4810 void4811 lt_fatal (const char *message, ...)4812 {4813 va_list ap;4814 va_start (ap, message);4815 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);4816 va_end (ap);4817 }4818 EOF4819 # we should really use a build-platform specific compiler4820 # here, but OTOH, the wrappers (shell script and this C one)4821 # are only useful if you want to execute the "real" binary.4822 # Since the "real" binary is built for $host, then this4823 # wrapper might as well be built for $host, too.4824 $run $LTCC -s -o $cwrapper $cwrappersource4825 ;;4826 esac4827 3660 $rm $output 4828 trap "$rm $output; exit $EXIT_FAILURE" 1 2 153661 trap "$rm $output; exit 1" 1 2 15 4829 3662 4830 3663 $echo > $output "\ … … 4842 3675 # Sed substitution that helps us do robust quoting. It backslashifies 4843 3676 # metacharacters that are still active within double-quoted strings. 4844 Xsed= '${SED}-e 1s/^X//'3677 Xsed="${SED}"' -e 1s/^X//' 4845 3678 sed_quote_subst='$sed_quote_subst' 4846 3679 4847 3680 # The HP-UX ksh and POSIX shell print the target directory to stdout 4848 3681 # if CDPATH is set. 4849 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH 3682 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi 4850 3683 4851 3684 relink_command=\"$relink_command\" … … 4902 3735 4903 3736 if test "$fast_install" = yes; then 4904 $echo >> $output "\3737 echo >> $output "\ 4905 3738 program=lt-'$outputname'$exeext 4906 3739 progdir=\"\$thisdir/$objdir\" … … 4918 3751 fi" 4919 3752 4920 $echo >> $output "\3753 echo >> $output "\ 4921 3754 4922 3755 # relink executable if necessary … … 4926 3759 $echo \"\$relink_command_output\" >&2 4927 3760 $rm \"\$progdir/\$file\" 4928 exit $EXIT_FAILURE3761 exit 1 4929 3762 fi 4930 3763 fi … … 4936 3769 fi" 4937 3770 else 4938 $echo >> $output "\3771 echo >> $output "\ 4939 3772 program='$outputname' 4940 3773 progdir=\"\$thisdir/$objdir\" … … 4942 3775 fi 4943 3776 4944 $echo >> $output "\3777 echo >> $output "\ 4945 3778 4946 3779 if test -f \"\$progdir/\$program\"; then" … … 4953 3786 4954 3787 # Some systems cannot cope with colon-terminated $shlibpath_var 4955 # The second colon is a workaround for a bug in BeOS R4 sed3788 # The second colon is a workaround for a bug in BeOS R4 ${SED} 4956 3789 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` 4957 3790 … … 4973 3806 " 4974 3807 case $host in 3808 # win32 systems need to use the prog path for dll 3809 # lookup to work 3810 *-*-cygwin* | *-*-pw32*) 3811 $echo >> $output "\ 3812 exec \$progdir/\$program \${1+\"\$@\"} 3813 " 3814 ;; 3815 4975 3816 # Backslashes separate directories on plain windows 4976 3817 *-*-mingw | *-*-os2*) … … 4982 3823 *) 4983 3824 $echo >> $output "\ 4984 exec \$progdir/\$program \${1+\"\$@\"} 3825 # Export the path to the program. 3826 PATH=\"\$progdir:\$PATH\" 3827 export PATH 3828 3829 exec \$program \${1+\"\$@\"} 4985 3830 " 4986 3831 ;; … … 4988 3833 $echo >> $output "\ 4989 3834 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" 4990 exit $EXIT_FAILURE3835 exit 1 4991 3836 fi 4992 3837 else … … 4994 3839 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 4995 3840 \$echo \"This script is just a wrapper for \$program.\" 1>&2 4996 $echo \"See the $PACKAGE documentation for more information.\" 1>&24997 exit $EXIT_FAILURE3841 echo \"See the $PACKAGE documentation for more information.\" 1>&2 3842 exit 1 4998 3843 fi 4999 3844 fi\ … … 5001 3846 chmod +x $output 5002 3847 fi 5003 exit $EXIT_SUCCESS3848 exit 0 5004 3849 ;; 5005 3850 esac … … 5017 3862 build_libtool_libs=no 5018 3863 else 5019 oldobjs="$o ld_deplibs $non_pic_objects"3864 oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP` 5020 3865 fi 5021 3866 addlibs="$old_convenience" … … 5024 3869 if test -n "$addlibs"; then 5025 3870 gentop="$output_objdir/${outputname}x" 3871 $show "${rm}r $gentop" 3872 $run ${rm}r "$gentop" 3873 $show "mkdir $gentop" 3874 $run mkdir "$gentop" 3875 status=$? 3876 if test $status -ne 0 && test ! -d "$gentop"; then 3877 exit $status 3878 fi 5026 3879 generated="$generated $gentop" 5027 3880 5028 func_extract_archives $gentop $addlibs 5029 oldobjs="$oldobjs $func_extract_archives_result" 3881 # Add in members from convenience archives. 3882 for xlib in $addlibs; do 3883 # Extract the objects. 3884 case $xlib in 3885 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; 3886 *) xabs=`pwd`"/$xlib" ;; 3887 esac 3888 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` 3889 xdir="$gentop/$xlib" 3890 3891 $show "${rm}r $xdir" 3892 $run ${rm}r "$xdir" 3893 $show "mkdir $xdir" 3894 $run mkdir "$xdir" 3895 status=$? 3896 if test $status -ne 0 && test ! -d "$xdir"; then 3897 exit $status 3898 fi 3899 $show "(cd $xdir && $AR x $xabs)" 3900 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? 3901 3902 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` 3903 done 5030 3904 fi 5031 3905 5032 3906 # Do each command in the archive commands. 5033 3907 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then 5034 cmds=$old_archive_from_new_cmds 3908 eval cmds=\"$old_archive_from_new_cmds\" 5035 3909 else 3910 # Ensure that we have .o objects in place in case we decided 3911 # not to build a shared library, and have fallen back to building 3912 # static libs even though --disable-static was passed! 3913 for oldobj in $oldobjs; do 3914 if test ! -f $oldobj; then 3915 xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'` 3916 if test "X$xdir" = "X$oldobj"; then 3917 xdir="." 3918 else 3919 xdir="$xdir" 3920 fi 3921 baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'` 3922 obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` 3923 $show "(cd $xdir && ${LN_S} $obj $baseobj)" 3924 $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $? 3925 fi 3926 done 3927 5036 3928 eval cmds=\"$old_archive_cmds\" 5037 5038 if len=`expr "X$cmds" : ".*"` &&5039 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then5040 cmds=$old_archive_cmds5041 else5042 # the command line is too long to link in one step, link in parts5043 $echo "using piecewise archive linking..."5044 save_RANLIB=$RANLIB5045 RANLIB=:5046 objlist=5047 concat_cmds=5048 save_oldobjs=$oldobjs5049 # GNU ar 2.10+ was changed to match POSIX; thus no paths are5050 # encoded into archives. This makes 'ar r' malfunction in5051 # this piecewise linking case whenever conflicting object5052 # names appear in distinct ar calls; check, warn and compensate.5053 if (for obj in $save_oldobjs5054 do5055 $echo "X$obj" | $Xsed -e 's%^.*/%%'5056 done | sort | sort -uc >/dev/null 2>&1); then5057 :5058 else5059 $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&25060 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&25061 AR_FLAGS=cq5062 fi5063 # Is there a better way of finding the last object in the list?5064 for obj in $save_oldobjs5065 do5066 last_oldobj=$obj5067 done5068 for obj in $save_oldobjs5069 do5070 oldobjs="$objlist $obj"5071 objlist="$objlist $obj"5072 eval test_cmds=\"$old_archive_cmds\"5073 if len=`expr "X$test_cmds" : ".*"` &&5074 test "$len" -le "$max_cmd_len"; then5075 :5076 else5077 # the above command should be used before it gets too long5078 oldobjs=$objlist5079 if test "$obj" = "$last_oldobj" ; then5080 RANLIB=$save_RANLIB5081 fi5082 test -z "$concat_cmds" || concat_cmds=$concat_cmds~5083 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"5084 objlist=5085 fi5086 done5087 RANLIB=$save_RANLIB5088 oldobjs=$objlist5089 if test "X$oldobjs" = "X" ; then5090 eval cmds=\"\$concat_cmds\"5091 else5092 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"5093 fi5094 fi5095 3929 fi 5096 3930 save_ifs="$IFS"; IFS='~' 5097 3931 for cmd in $cmds; do 5098 eval cmd=\"$cmd\"5099 3932 IFS="$save_ifs" 5100 3933 $show "$cmd" … … 5128 3961 done 5129 3962 # Quote the link command for shipping. 5130 relink_command="(cd `pwd`; $SHELL $ progpath $preserve_args--mode=relink $libtool_args @inst_prefix_dir@)"3963 relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)" 5131 3964 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` 5132 if test "$hardcode_automatic" = yes ; then5133 relink_command=5134 fi5135 5136 3965 5137 3966 # Only create the output if not a dry run. … … 5152 3981 if test -z "$libdir"; then 5153 3982 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 5154 exit $EXIT_FAILURE3983 exit 1 5155 3984 fi 5156 3985 newdependency_libs="$newdependency_libs $libdir/$name" … … 5166 3995 if test -z "$libdir"; then 5167 3996 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 5168 exit $EXIT_FAILURE3997 exit 1 5169 3998 fi 5170 3999 newdlfiles="$newdlfiles $libdir/$name" … … 5177 4006 if test -z "$libdir"; then 5178 4007 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 5179 exit $EXIT_FAILURE4008 exit 1 5180 4009 fi 5181 4010 newdlprefiles="$newdlprefiles $libdir/$name" 5182 4011 done 5183 4012 dlprefiles="$newdlprefiles" 5184 else5185 newdlfiles=5186 for lib in $dlfiles; do5187 case $lib in5188 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;5189 *) abs=`pwd`"/$lib" ;;5190 esac5191 newdlfiles="$newdlfiles $abs"5192 done5193 dlfiles="$newdlfiles"5194 newdlprefiles=5195 for lib in $dlprefiles; do5196 case $lib in5197 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;5198 *) abs=`pwd`"/$lib" ;;5199 esac5200 newdlprefiles="$newdlprefiles $abs"5201 done5202 dlprefiles="$newdlprefiles"5203 4013 fi 5204 4014 $rm $output … … 5206 4016 tdlname=$dlname 5207 4017 case $host,$output,$installed,$module,$dlname in 5208 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;4018 *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; 5209 4019 esac 5210 4020 $echo > $output "\ … … 5235 4045 installed=$installed 5236 4046 5237 # Should we warn about portability when linking against -modules?5238 shouldnotlink=$module5239 5240 4047 # Files to dlopen/dlpreopen 5241 4048 dlopen='$dlfiles' … … 5244 4051 # Directory that this library needs to be installed in: 5245 4052 libdir='$install_libdir'" 5246 if test "$installed" = no && test "$need_relink"= yes; then4053 if test "$installed" = no && test $need_relink = yes; then 5247 4054 $echo >> $output "\ 5248 4055 relink_command=\"$relink_command\"" … … 5257 4064 ;; 5258 4065 esac 5259 exit $EXIT_SUCCESS4066 exit 0 5260 4067 ;; 5261 4068 … … 5346 4153 $echo "$modename: you must specify an install program" 1>&2 5347 4154 $echo "$help" 1>&2 5348 exit $EXIT_FAILURE4155 exit 1 5349 4156 fi 5350 4157 … … 5352 4159 $echo "$modename: the \`$prev' option requires an argument" 1>&2 5353 4160 $echo "$help" 1>&2 5354 exit $EXIT_FAILURE4161 exit 1 5355 4162 fi 5356 4163 … … 5362 4169 fi 5363 4170 $echo "$help" 1>&2 5364 exit $EXIT_FAILURE4171 exit 1 5365 4172 fi 5366 4173 … … 5380 4187 # Not a directory, so check to see that there is only one file specified. 5381 4188 set dummy $files 5382 if test "$#"-gt 2; then4189 if test $# -gt 2; then 5383 4190 $echo "$modename: \`$dest' is not a directory" 1>&2 5384 4191 $echo "$help" 1>&2 5385 exit $EXIT_FAILURE4192 exit 1 5386 4193 fi 5387 4194 fi … … 5395 4202 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 5396 4203 $echo "$help" 1>&2 5397 exit $EXIT_FAILURE4204 exit 1 5398 4205 ;; 5399 4206 esac … … 5420 4227 *.la) 5421 4228 # Check to see that this really is a libtool archive. 5422 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :4229 if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : 5423 4230 else 5424 4231 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 5425 4232 $echo "$help" 1>&2 5426 exit $EXIT_FAILURE4233 exit 1 5427 4234 fi 5428 4235 … … 5456 4263 if test -n "$relink_command"; then 5457 4264 # Determine the prefix the user has applied to our future dir. 5458 inst_prefix_dir=`$echo "$destdir" | $SED"s%$libdir\$%%"`4265 inst_prefix_dir=`$echo "$destdir" | sed "s%$libdir\$%%"` 5459 4266 5460 4267 # Don't allow the user to place us outside of our expected 5461 4268 # location b/c this prevents finding dependent libraries that 5462 4269 # are installed to the same prefix. 5463 # At present, this check doesn't affect windows .dll's that5464 # are installed into $libdir/../bin (currently, that works fine)5465 # but it's something to keep an eye on.5466 4270 if test "$inst_prefix_dir" = "$destdir"; then 5467 4271 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 5468 exit $EXIT_FAILURE4272 exit 1 5469 4273 fi 5470 4274 5471 4275 if test -n "$inst_prefix_dir"; then 5472 4276 # Stick the inst_prefix_dir data into the link command. 5473 relink_command=`$echo "$relink_command" | $SED"s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`4277 relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` 5474 4278 else 5475 relink_command=`$echo "$relink_command" | $SED"s%@inst_prefix_dir@%%"`4279 relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"` 5476 4280 fi 5477 4281 … … 5481 4285 else 5482 4286 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 5483 exit $EXIT_FAILURE4287 exit 1 5484 4288 fi 5485 4289 fi … … 5503 4307 fi 5504 4308 5505 if test "$#"-gt 0; then4309 if test $# -gt 0; then 5506 4310 # Delete the old symlinks, and create new ones. 5507 4311 for linkname … … 5516 4320 # Do each command in the postinstall commands. 5517 4321 lib="$destdir/$realname" 5518 cmds=$postinstall_cmds4322 eval cmds=\"$postinstall_cmds\" 5519 4323 save_ifs="$IFS"; IFS='~' 5520 4324 for cmd in $cmds; do 5521 4325 IFS="$save_ifs" 5522 eval cmd=\"$cmd\"5523 4326 $show "$cmd" 5524 4327 $run eval "$cmd" || exit $? … … 5560 4363 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 5561 4364 $echo "$help" 1>&2 5562 exit $EXIT_FAILURE4365 exit 1 5563 4366 ;; 5564 4367 esac … … 5578 4381 $run eval "$install_prog \$staticobj \$staticdest" || exit $? 5579 4382 fi 5580 exit $EXIT_SUCCESS4383 exit 0 5581 4384 ;; 5582 4385 … … 5590 4393 fi 5591 4394 5592 # If the file is missing, and there is a .exe on the end, strip it5593 # because it is most likely a libtool script we actually want to5594 # install5595 stripped_ext=""5596 case $file in5597 *.exe)5598 if test ! -f "$file"; then5599 file=`$echo $file|${SED} 's,.exe$,,'`5600 stripped_ext=".exe"5601 fi5602 ;;5603 esac5604 5605 4395 # Do a test to see if this is really a libtool program. 5606 4396 case $host in 5607 4397 *cygwin*|*mingw*) 5608 wrapper=` $echo $file | ${SED} -e 's,.exe$,,'`4398 wrapper=`echo $file | ${SED} -e 's,.exe$,,'` 5609 4399 ;; 5610 4400 *) … … 5612 4402 ;; 5613 4403 esac 5614 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then4404 if (${SED} -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then 5615 4405 notinst_deplibs= 5616 4406 relink_command= 5617 4407 5618 # To insure that "foo" is sourced, and not "foo.exe",5619 # finese the cygwin/MSYS system by explicitly sourcing "foo."5620 # which disallows the automatic-append-.exe behavior.5621 case $build in5622 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;5623 *) wrapperdot=${wrapper} ;;5624 esac5625 4408 # If there is no directory component, then add one. 5626 4409 case $file in 5627 */* | *\\*) . $ {wrapperdot};;5628 *) . ./$ {wrapperdot};;4410 */* | *\\*) . $wrapper ;; 4411 *) . ./$wrapper ;; 5629 4412 esac 5630 4413 … … 5632 4415 if test -z "$notinst_deplibs"; then 5633 4416 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 5634 exit $EXIT_FAILURE4417 exit 1 5635 4418 fi 5636 4419 … … 5654 4437 5655 4438 relink_command= 5656 # To insure that "foo" is sourced, and not "foo.exe",5657 # finese the cygwin/MSYS system by explicitly sourcing "foo."5658 # which disallows the automatic-append-.exe behavior.5659 case $build in5660 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;5661 *) wrapperdot=${wrapper} ;;5662 esac5663 4439 # If there is no directory component, then add one. 5664 4440 case $file in 5665 */* | *\\*) . $ {wrapperdot};;5666 *) . ./$ {wrapperdot};;4441 */* | *\\*) . $wrapper ;; 4442 *) . ./$wrapper ;; 5667 4443 esac 5668 4444 … … 5672 4448 tmpdir="/tmp" 5673 4449 test -n "$TMPDIR" && tmpdir="$TMPDIR" 5674 tmpdir="$tmpdir/libtool-$$" 5675 save_umask=`umask` 5676 umask 0077 5677 if $mkdir "$tmpdir"; then 5678 umask $save_umask 4450 tmpdir_mktemp=`mktemp -d $tmpdir/libtool-XXXXXX 2> /dev/null` 4451 if test $? = 0 ; then 4452 tmpdir="$tmpdir_mktemp" 4453 unset tmpdir_mktemp 4454 else 4455 tmpdir="$tmpdir/libtool-$$" 4456 fi 4457 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : 5679 4458 else 5680 umask $save_umask5681 4459 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 5682 4460 continue 5683 4461 fi 5684 file=`$echo "X$file $stripped_ext" | $Xsed -e 's%^.*/%%'`4462 file=`$echo "X$file" | $Xsed -e 's%^.*/%%'` 5685 4463 outputname="$tmpdir/$file" 5686 4464 # Replace the output file specification. … … 5700 4478 else 5701 4479 # Install the binary that we compiled earlier. 5702 file=`$echo "X$file $stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`4480 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` 5703 4481 fi 5704 4482 fi … … 5707 4485 # one anyways 5708 4486 case $install_prog,$host in 5709 */usr/bin/install*,*cygwin*)4487 /usr/bin/install*,*cygwin*) 5710 4488 case $file:$destfile in 5711 4489 *.exe:*.exe) … … 5716 4494 ;; 5717 4495 *:*.exe) 5718 destfile=` $echo $destfile | ${SED} -e 's,.exe$,,'`4496 destfile=`echo $destfile | ${SED} -e 's,.exe$,,'` 5719 4497 ;; 5720 4498 esac … … 5737 4515 $run eval "$install_prog \$file \$oldlib" || exit $? 5738 4516 5739 if test -n "$stripme" && test -n "$ old_striplib"; then4517 if test -n "$stripme" && test -n "$striplib"; then 5740 4518 $show "$old_striplib $oldlib" 5741 4519 $run eval "$old_striplib $oldlib" || exit $? … … 5743 4521 5744 4522 # Do each command in the postinstall commands. 5745 cmds=$old_postinstall_cmds4523 eval cmds=\"$old_postinstall_cmds\" 5746 4524 save_ifs="$IFS"; IFS='~' 5747 4525 for cmd in $cmds; do 5748 4526 IFS="$save_ifs" 5749 eval cmd=\"$cmd\"5750 4527 $show "$cmd" 5751 4528 $run eval "$cmd" || exit $? … … 5761 4538 # Maybe just do a dry run. 5762 4539 test -n "$run" && current_libdirs=" -n$current_libdirs" 5763 exec_cmd='$SHELL $ progpath $preserve_args--finish$current_libdirs'4540 exec_cmd='$SHELL $0 --finish$current_libdirs' 5764 4541 else 5765 exit $EXIT_SUCCESS4542 exit 0 5766 4543 fi 5767 4544 ;; … … 5782 4559 if test -n "$finish_cmds"; then 5783 4560 # Do each command in the finish commands. 5784 cmds=$finish_cmds4561 eval cmds=\"$finish_cmds\" 5785 4562 save_ifs="$IFS"; IFS='~' 5786 4563 for cmd in $cmds; do 5787 4564 IFS="$save_ifs" 5788 eval cmd=\"$cmd\"5789 4565 $show "$cmd" 5790 4566 $run eval "$cmd" || admincmds="$admincmds … … 5803 4579 5804 4580 # Exit here if they wanted silent mode. 5805 test "$show" = : && exit $EXIT_SUCCESS5806 5807 $echo "----------------------------------------------------------------------"5808 $echo "Libraries have been installed in:"4581 test "$show" = ":" && exit 0 4582 4583 echo "----------------------------------------------------------------------" 4584 echo "Libraries have been installed in:" 5809 4585 for libdir in $libdirs; do 5810 $echo " $libdir"4586 echo " $libdir" 5811 4587 done 5812 $echo5813 $echo "If you ever happen to want to link against installed libraries"5814 $echo "in a given directory, LIBDIR, you must either use libtool, and"5815 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"5816 $echo "flag during linking and do at least one of the following:"4588 echo 4589 echo "If you ever happen to want to link against installed libraries" 4590 echo "in a given directory, LIBDIR, you must either use libtool, and" 4591 echo "specify the full pathname of the library, or use the \`-LLIBDIR'" 4592 echo "flag during linking and do at least one of the following:" 5817 4593 if test -n "$shlibpath_var"; then 5818 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"5819 $echo " during execution"4594 echo " - add LIBDIR to the \`$shlibpath_var' environment variable" 4595 echo " during execution" 5820 4596 fi 5821 4597 if test -n "$runpath_var"; then 5822 $echo " - add LIBDIR to the \`$runpath_var' environment variable"5823 $echo " during linking"4598 echo " - add LIBDIR to the \`$runpath_var' environment variable" 4599 echo " during linking" 5824 4600 fi 5825 4601 if test -n "$hardcode_libdir_flag_spec"; then … … 5827 4603 eval flag=\"$hardcode_libdir_flag_spec\" 5828 4604 5829 $echo " - use the \`$flag' linker flag"4605 echo " - use the \`$flag' linker flag" 5830 4606 fi 5831 4607 if test -n "$admincmds"; then 5832 $echo " - have your system administrator run these commands:$admincmds"4608 echo " - have your system administrator run these commands:$admincmds" 5833 4609 fi 5834 4610 if test -f /etc/ld.so.conf; then 5835 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"4611 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" 5836 4612 fi 5837 $echo5838 $echo "See any operating system documentation about shared libraries for"5839 $echo "more information, such as the ld(1) and ld.so(8) manual pages."5840 $echo "----------------------------------------------------------------------"5841 exit $EXIT_SUCCESS4613 echo 4614 echo "See any operating system documentation about shared libraries for" 4615 echo "more information, such as the ld(1) and ld.so(8) manual pages." 4616 echo "----------------------------------------------------------------------" 4617 exit 0 5842 4618 ;; 5843 4619 … … 5851 4627 $echo "$modename: you must specify a COMMAND" 1>&2 5852 4628 $echo "$help" 5853 exit $EXIT_FAILURE4629 exit 1 5854 4630 fi 5855 4631 … … 5859 4635 $echo "$modename: \`$file' is not a file" 1>&2 5860 4636 $echo "$help" 1>&2 5861 exit $EXIT_FAILURE4637 exit 1 5862 4638 fi 5863 4639 … … 5866 4642 *.la) 5867 4643 # Check to see that this really is a libtool archive. 5868 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :4644 if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : 5869 4645 else 5870 4646 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 5871 4647 $echo "$help" 1>&2 5872 exit $EXIT_FAILURE4648 exit 1 5873 4649 fi 5874 4650 … … 5897 4673 else 5898 4674 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 5899 exit $EXIT_FAILURE4675 exit 1 5900 4676 fi 5901 4677 ;; … … 5937 4713 *) 5938 4714 # Do a test to see if this is really a libtool program. 5939 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then4715 if (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 5940 4716 # If there is no directory component, then add one. 5941 4717 case $file in … … 5960 4736 fi 5961 4737 5962 # Restore saved enviro nment variables4738 # Restore saved enviroment variables 5963 4739 if test "${save_LC_ALL+set}" = set; then 5964 4740 LC_ALL="$save_LC_ALL"; export LC_ALL … … 5969 4745 5970 4746 # Now prepare to actually exec the command. 5971 exec_cmd="\ "\$cmd\"$args"4747 exec_cmd="\$cmd$args" 5972 4748 else 5973 4749 # Display what would be done. … … 5976 4752 $echo "export $shlibpath_var" 5977 4753 fi 5978 eval \$echo \"\$cmd\"$args5979 exit $EXIT_SUCCESS4754 $echo "$cmd$args" 4755 exit 0 5980 4756 fi 5981 4757 ;; … … 6005 4781 $echo "$modename: you must specify an RM program" 1>&2 6006 4782 $echo "$help" 1>&2 6007 exit $EXIT_FAILURE4783 exit 1 6008 4784 fi 6009 4785 6010 4786 rmdirs= 6011 4787 6012 origobjdir="$objdir"6013 4788 for file in $files; do 6014 4789 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` 6015 4790 if test "X$dir" = "X$file"; then 6016 4791 dir=. 6017 objdir="$o rigobjdir"4792 objdir="$objdir" 6018 4793 else 6019 objdir="$dir/$o rigobjdir"4794 objdir="$dir/$objdir" 6020 4795 fi 6021 4796 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` 6022 test "$mode"= uninstall && objdir="$dir"4797 test $mode = uninstall && objdir="$dir" 6023 4798 6024 4799 # Remember objdir for removal later, being careful to avoid duplicates 6025 if test "$mode"= clean; then4800 if test $mode = clean; then 6026 4801 case " $rmdirs " in 6027 4802 *" $objdir "*) ;; … … 6047 4822 *.la) 6048 4823 # Possibly a libtool archive, so verify it. 6049 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then4824 if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 6050 4825 . $dir/$name 6051 4826 … … 6055 4830 done 6056 4831 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" 6057 test "$mode"= clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"6058 6059 if test "$mode"= uninstall; then4832 test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" 4833 4834 if test $mode = uninstall; then 6060 4835 if test -n "$library_names"; then 6061 4836 # Do each command in the postuninstall commands. 6062 cmds=$postuninstall_cmds4837 eval cmds=\"$postuninstall_cmds\" 6063 4838 save_ifs="$IFS"; IFS='~' 6064 4839 for cmd in $cmds; do 6065 4840 IFS="$save_ifs" 6066 eval cmd=\"$cmd\"6067 4841 $show "$cmd" 6068 4842 $run eval "$cmd" 6069 if test "$?" -ne0 && test "$rmforce" != yes; then4843 if test $? != 0 && test "$rmforce" != yes; then 6070 4844 exit_status=1 6071 4845 fi … … 6076 4850 if test -n "$old_library"; then 6077 4851 # Do each command in the old_postuninstall commands. 6078 cmds=$old_postuninstall_cmds4852 eval cmds=\"$old_postuninstall_cmds\" 6079 4853 save_ifs="$IFS"; IFS='~' 6080 4854 for cmd in $cmds; do 6081 4855 IFS="$save_ifs" 6082 eval cmd=\"$cmd\"6083 4856 $show "$cmd" 6084 4857 $run eval "$cmd" 6085 if test "$?" -ne0 && test "$rmforce" != yes; then4858 if test $? != 0 && test "$rmforce" != yes; then 6086 4859 exit_status=1 6087 4860 fi … … 6095 4868 6096 4869 *.lo) 6097 # Possibly a libtool object, so verify it. 6098 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 6099 6100 # Read the .lo file 6101 . $dir/$name 6102 6103 # Add PIC object to the list of files to remove. 6104 if test -n "$pic_object" \ 6105 && test "$pic_object" != none; then 6106 rmfiles="$rmfiles $dir/$pic_object" 6107 fi 6108 6109 # Add non-PIC object to the list of files to remove. 6110 if test -n "$non_pic_object" \ 6111 && test "$non_pic_object" != none; then 6112 rmfiles="$rmfiles $dir/$non_pic_object" 6113 fi 4870 if test "$build_old_libs" = yes; then 4871 oldobj=`$echo "X$name" | $Xsed -e "$lo2o"` 4872 rmfiles="$rmfiles $dir/$oldobj" 6114 4873 fi 6115 4874 ;; 6116 4875 6117 4876 *) 6118 if test "$mode" = clean ; then 6119 noexename=$name 6120 case $file in 6121 *.exe) 6122 file=`$echo $file|${SED} 's,.exe$,,'` 6123 noexename=`$echo $name|${SED} 's,.exe$,,'` 6124 # $file with .exe has already been added to rmfiles, 6125 # add $file without .exe 6126 rmfiles="$rmfiles $file" 6127 ;; 6128 esac 6129 # Do a test to see if this is a libtool program. 6130 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 6131 relink_command= 6132 . $dir/$noexename 6133 6134 # note $name still contains .exe if it was in $file originally 6135 # as does the version of $file that was added into $rmfiles 6136 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" 6137 if test "$fast_install" = yes && test -n "$relink_command"; then 6138 rmfiles="$rmfiles $objdir/lt-$name" 6139 fi 6140 if test "X$noexename" != "X$name" ; then 6141 rmfiles="$rmfiles $objdir/lt-${noexename}.c" 6142 fi 4877 # Do a test to see if this is a libtool program. 4878 if test $mode = clean && 4879 (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 4880 relink_command= 4881 . $dir/$file 4882 4883 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" 4884 if test "$fast_install" = yes && test -n "$relink_command"; then 4885 rmfiles="$rmfiles $objdir/lt-$name" 6143 4886 fi 6144 4887 fi … … 6148 4891 $run $rm $rmfiles || exit_status=1 6149 4892 done 6150 objdir="$origobjdir"6151 4893 6152 4894 # Try to remove the ${objdir}s in the directories where we deleted files … … 6164 4906 $echo "$modename: you must specify a MODE" 1>&2 6165 4907 $echo "$generic_help" 1>&2 6166 exit $EXIT_FAILURE4908 exit 1 6167 4909 ;; 6168 4910 esac … … 6171 4913 $echo "$modename: invalid operation mode \`$mode'" 1>&2 6172 4914 $echo "$generic_help" 1>&2 6173 exit $EXIT_FAILURE4915 exit 1 6174 4916 fi 6175 4917 fi # test -z "$show_help" … … 6177 4919 if test -n "$exec_cmd"; then 6178 4920 eval exec $exec_cmd 6179 exit $EXIT_FAILURE4921 exit 1 6180 4922 fi 6181 4923 … … 6196 4938 --quiet same as \`--silent' 6197 4939 --silent don't print informational messages 6198 --tag=TAG use configuration variables from tag TAG6199 4940 --version print version information 6200 4941 … … 6210 4951 6211 4952 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for 6212 a more detailed description of MODE. 6213 6214 Report bugs to <bug-libtool@gnu.org>." 6215 exit $EXIT_SUCCESS 4953 a more detailed description of MODE." 4954 exit 0 6216 4955 ;; 6217 4956 … … 6324 5063 -no-undefined declare that a library does not refer to external symbols 6325 5064 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects 6326 -objectlist FILE Use a list of object files found in FILE to specify objects6327 -precious-files-regex REGEX6328 don't remove output files matching REGEX6329 5065 -release RELEASE specify package release information 6330 5066 -rpath LIBDIR the created library will eventually be installed in LIBDIR … … 6368 5104 $echo "$modename: invalid operation mode \`$mode'" 1>&2 6369 5105 $echo "$help" 1>&2 6370 exit $EXIT_FAILURE5106 exit 1 6371 5107 ;; 6372 5108 esac 6373 5109 6374 $echo5110 echo 6375 5111 $echo "Try \`$modename --help' for more information about other modes." 6376 5112 6377 exit $EXIT_SUCCESS 6378 6379 # The TAGs below are defined such that we never get into a situation 6380 # in which we disable both kinds of libraries. Given conflicting 6381 # choices, we go for a static library, that is the most portable, 6382 # since we can't tell whether shared libraries were disabled because 6383 # the user asked for that or because the platform doesn't support 6384 # them. This is particularly important on AIX, because we don't 6385 # support having both static and shared libraries enabled at the same 6386 # time on that platform, so we default to a shared-only configuration. 6387 # If a disable-shared tag is given, we'll fallback to a static-only 6388 # configuration. But we'll never go from static-only to shared-only. 6389 6390 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared 6391 build_libtool_libs=no 6392 build_old_libs=yes 6393 # ### END LIBTOOL TAG CONFIG: disable-shared 6394 6395 # ### BEGIN LIBTOOL TAG CONFIG: disable-static 6396 build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac` 6397 # ### END LIBTOOL TAG CONFIG: disable-static 5113 exit 0 6398 5114 6399 5115 # Local Variables:
Note:
See TracChangeset
for help on using the changeset viewer.
