1# ltmain.sh - Provide generalized library-building support services. 2# NOTE: Changing this file will not affect anything until you rerun ltconfig. 3# 4# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 5# Free Software Foundation, Inc. 6# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 7# 8# This program is free software; you can redistribute it and/or modify 9# it under the terms of the GNU General Public License as published by 10# the Free Software Foundation; either version 2 of the License, or 11# (at your option) any later version. 12# 13# This program is distributed in the hope that it will be useful, but 14# WITHOUT ANY WARRANTY; without even the implied warranty of 15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16# General Public License for more details. 17# 18# You should have received a copy of the GNU General Public License 19# along with this program; if not, write to the Free Software 20# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21# 22# As a special exception to the GNU General Public License, if you 23# distribute this file as part of a program that contains a 24# configuration script generated by Autoconf, you may include it under 25# the same distribution terms that you use for the rest of that program. 26 27# Check that we have a working $echo. 28if test "X$1" = X--no-reexec; then 29 # Discard the --no-reexec flag, and continue. 30 shift 31elif test "X$1" = X--fallback-echo; then 32 # Avoid inline document here, it may be left over 33 : 34elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then 35 # Yippee, $echo works! 36 : 37else 38 # Restart under the correct shell, and then maybe $echo will work. 39 exec $SHELL "$0" --no-reexec ${1+"$@"} 40fi 41 42if test "X$1" = X--fallback-echo; then 43 # used as fallback echo 44 shift 45 cat <<EOF 46$* 47EOF 48 exit 0 49fi 50 51# The name of this program. 52progname=`$echo "$0" | sed 's%^.*/%%'` 53modename="$progname" 54 55# Constants. 56PROGRAM=ltmain.sh 57PACKAGE=libtool 58VERSION=1.4a 59TIMESTAMP=" (1.641.2.206mm 2001/04/03 21:47:47)" 60 61default_mode= 62help="Try \`$progname --help' for more information." 63magic="%%%MAGIC variable%%%" 64mkdir="mkdir" 65mv="mv -f" 66rm="rm -f" 67 68# Sed substitution that helps us do robust quoting. It backslashifies 69# metacharacters that are still active within double-quoted strings. 70Xsed='sed -e 1s/^X//' 71sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' 72SP2NL='tr \040 \012' 73NL2SP='tr \015\012 \040\040' 74 75# NLS nuisances. 76# Only set LANG and LC_ALL to C if already set. 77# These must not be set unconditionally because not all systems understand 78# e.g. LANG=C (notably SCO). 79# We save the old values to restore during execute mode. 80if test "${LC_ALL+set}" = set; then 81 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL 82fi 83if test "${LANG+set}" = set; then 84 save_LANG="$LANG"; LANG=C; export LANG 85fi 86 87if test "$LTCONFIG_VERSION" != "$VERSION"; then 88 echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2 89 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 90 exit 1 91fi 92 93if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then 94 echo "$modename: not configured to build any kind of library" 1>&2 95 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 96 exit 1 97fi 98 99# Global variables. 100mode=$default_mode 101nonopt= 102prev= 103prevopt= 104run= 105show="$echo" 106show_help= 107execute_dlfiles= 108lo2o="s/\\.lo\$/.${objext}/" 109o2lo="s/\\.${objext}\$/.lo/" 110 111# Parse our command line options once, thoroughly. 112while test $# -gt 0 113do 114 arg="$1" 115 shift 116 117 case $arg in 118 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; 119 *) optarg= ;; 120 esac 121 122 # If the previous option needs an argument, assign it. 123 if test -n "$prev"; then 124 case $prev in 125 execute_dlfiles) 126 execute_dlfiles="$execute_dlfiles $arg" 127 ;; 128 tag) 129 tagname="$arg" 130 131 # Check whether tagname contains only valid characters 132 case $tagname in 133 *[!-_A-Za-z0-9,/]*) 134 echo "$progname: invalid tag name: $tagname" 1>&2 135 exit 1 136 ;; 137 esac 138 139 if grep "^### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then 140 taglist="$taglist $tagname" 141 # Evaluate the configuration. 142 eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`" 143 else 144 echo "$progname: ignoring unknown tag $tagname" 1>&2 145 fi 146 ;; 147 *) 148 eval "$prev=\$arg" 149 ;; 150 esac 151 152 prev= 153 prevopt= 154 continue 155 fi 156 157 # Have we seen a non-optional argument yet? 158 case $arg in 159 --help) 160 show_help=yes 161 ;; 162 163 --version) 164 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" 165 exit 0 166 ;; 167 168 --config) 169 sed -n -e '/^### BEGIN LIBTOOL CONFIG/,/^### END LIBTOOL CONFIG/p' < "$0" 170 # Now print the configurations for the tags. 171 for tagname in $taglist; do 172 sed -n -e "/^### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0" 173 done 174 exit 0 175 ;; 176 177 --debug) 178 echo "$progname: enabling shell trace mode" 179 set -x 180 ;; 181 182 --dry-run | -n) 183 run=: 184 ;; 185 186 --features) 187 echo "host: $host" 188 if test "$build_libtool_libs" = yes; then 189 echo "enable shared libraries" 190 else 191 echo "disable shared libraries" 192 fi 193 if test "$build_old_libs" = yes; then 194 echo "enable static libraries" 195 else 196 echo "disable static libraries" 197 fi 198 exit 0 199 ;; 200 201 --finish) mode="finish" ;; 202 203 --mode) prevopt="--mode" prev=mode ;; 204 --mode=*) mode="$optarg" ;; 205 206 --quiet | --silent) 207 show=: 208 ;; 209 210 --tag) prevopt="--tag" prev=tag ;; 211 --tag=*) 212 set tag "$optarg" ${1+"$@"} 213 shift 214 prev=tag 215 ;; 216 217 -dlopen) 218 prevopt="-dlopen" 219 prev=execute_dlfiles 220 ;; 221 222 -*) 223 $echo "$modename: unrecognized option \`$arg'" 1>&2 224 $echo "$help" 1>&2 225 exit 1 226 ;; 227 228 *) 229 nonopt="$arg" 230 break 231 ;; 232 esac 233done 234 235if test -n "$prevopt"; then 236 $echo "$modename: option \`$prevopt' requires an argument" 1>&2 237 $echo "$help" 1>&2 238 exit 1 239fi 240 241if test -z "$show_help"; then 242 243 # Infer the operation mode. 244 if test -z "$mode"; then 245 case $nonopt in 246 *cc | *++ | gcc* | *-gcc*) 247 mode=link 248 for arg 249 do 250 case $arg in 251 -c) 252 mode=compile 253 break 254 ;; 255 esac 256 done 257 ;; 258 *db | *dbx | *strace | *truss) 259 mode=execute 260 ;; 261 *install*|cp|mv) 262 mode=install 263 ;; 264 *rm) 265 mode=uninstall 266 ;; 267 *) 268 # If we have no mode, but dlfiles were specified, then do execute mode. 269 test -n "$execute_dlfiles" && mode=execute 270 271 # Just use the default operation mode. 272 if test -z "$mode"; then 273 if test -n "$nonopt"; then 274 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 275 else 276 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 277 fi 278 fi 279 ;; 280 esac 281 fi 282 283 # Only execute mode is allowed to have -dlopen flags. 284 if test -n "$execute_dlfiles" && test "$mode" != execute; then 285 $echo "$modename: unrecognized option \`-dlopen'" 1>&2 286 $echo "$help" 1>&2 287 exit 1 288 fi 289 290 # Change the help message to a mode-specific one. 291 generic_help="$help" 292 help="Try \`$modename --help --mode=$mode' for more information." 293 294 # These modes are in order of execution frequency so that they run quickly. 295 case $mode in 296 # libtool compile mode 297 compile) 298 modename="$modename: compile" 299 # Get the compilation command and the source file. 300 base_compile= 301 prev= 302 lastarg= 303 srcfile="$nonopt" 304 suppress_output= 305 306 user_target=no 307 for arg 308 do 309 case $prev in 310 "") ;; 311 xcompiler) 312 # Aesthetically quote the previous argument. 313 prev= 314 lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` 315 316 case $arg in 317 # Double-quote args containing other shell metacharacters. 318 # Many Bourne shells cannot handle close brackets correctly 319 # in scan sets, so we specify it separately. 320 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 321 arg="\"$arg\"" 322 ;; 323 esac 324 325 # Add the previous argument to base_compile. 326 if test -z "$base_compile"; then 327 base_compile="$lastarg" 328 else 329 base_compile="$base_compile $lastarg" 330 fi 331 continue 332 ;; 333 esac 334 335 # Accept any command-line options. 336 case $arg in 337 -o) 338 if test "$user_target" != "no"; then 339 $echo "$modename: you cannot specify \`-o' more than once" 1>&2 340 exit 1 341 fi 342 user_target=next 343 ;; 344 345 -static) 346 build_old_libs=yes 347 continue 348 ;; 349 350 -prefer-pic) 351 pic_mode=yes 352 continue 353 ;; 354 355 -prefer-non-pic) 356 pic_mode=no 357 continue 358 ;; 359 360 -Xcompiler) 361 prev=xcompiler 362 continue 363 ;; 364 365 -Wc,*) 366 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` 367 lastarg= 368 IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' 369 for arg in $args; do 370 IFS="$save_ifs" 371 372 # Double-quote args containing other shell metacharacters. 373 # Many Bourne shells cannot handle close brackets correctly 374 # in scan sets, so we specify it separately. 375 case $arg in 376 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 377 arg="\"$arg\"" 378 ;; 379 esac 380 lastarg="$lastarg $arg" 381 done 382 IFS="$save_ifs" 383 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` 384 385 # Add the arguments to base_compile. 386 if test -z "$base_compile"; then 387 base_compile="$lastarg" 388 else 389 base_compile="$base_compile $lastarg" 390 fi 391 continue 392 ;; 393 esac 394 395 case $user_target in 396 next) 397 # The next one is the -o target name 398 user_target=yes 399 continue 400 ;; 401 yes) 402 # We got the output file 403 user_target=set 404 libobj="$arg" 405 continue 406 ;; 407 esac 408 409 # Accept the current argument as the source file. 410 lastarg="$srcfile" 411 srcfile="$arg" 412 413 # Aesthetically quote the previous argument. 414 415 # Backslashify any backslashes, double quotes, and dollar signs. 416 # These are the only characters that are still specially 417 # interpreted inside of double-quoted scrings. 418 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` 419 420 # Double-quote args containing other shell metacharacters. 421 # Many Bourne shells cannot handle close brackets correctly 422 # in scan sets, so we specify it separately. 423 case $lastarg in 424 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 425 lastarg="\"$lastarg\"" 426 ;; 427 esac 428 429 # Add the previous argument to base_compile. 430 if test -z "$base_compile"; then 431 base_compile="$lastarg" 432 else 433 base_compile="$base_compile $lastarg" 434 fi 435 done 436 437 case $user_target in 438 set) 439 ;; 440 no) 441 # Get the name of the library object. 442 libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` 443 ;; 444 *) 445 $echo "$modename: you must specify a target with \`-o'" 1>&2 446 exit 1 447 ;; 448 esac 449 450 # Recognize several different file suffixes. 451 # If the user specifies -o file.o, it is replaced with file.lo 452 xform='[cCFSfmso]' 453 case $libobj in 454 *.ada) xform=ada ;; 455 *.adb) xform=adb ;; 456 *.ads) xform=ads ;; 457 *.asm) xform=asm ;; 458 *.c++) xform=c++ ;; 459 *.cc) xform=cc ;; 460 *.class) xform=class ;; 461 *.cpp) xform=cpp ;; 462 *.cxx) xform=cxx ;; 463 *.f90) xform=f90 ;; 464 *.for) xform=for ;; 465 *.java) xform=java ;; 466 esac 467 468 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` 469 470 case $libobj in 471 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; 472 *) 473 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 474 exit 1 475 ;; 476 esac 477 478 # Infer tagged configuration to use if any are available and 479 # if one wasn't chosen via the "--tag" command line option. 480 # Only attempt this if the compiler in the base compile 481 # command doesn't match the default compiler. 482 if test -n "$available_tags" && test -z "$tagname"; then 483 case $base_compile in 484 "$CC "*) ;; 485 # Blanks in the command may have been stripped by the calling shell, 486 # but not from the CC environment variable when ltconfig was run. 487 "`$echo $CC` "*) ;; 488 *) 489 for z in $available_tags; do 490 if grep "^### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then 491 # Evaluate the configuration. 492 eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`" 493 case $base_compile in 494 "$CC "*) 495 # The compiler in the base compile command matches 496 # the one in the tagged configuration. 497 # Assume this is the tagged configuration we want. 498 tagname=$z 499 break 500 ;; 501 "`$echo $CC` "*) 502 tagname=$z 503 break 504 ;; 505 esac 506 fi 507 done 508 # If $tagname still isn't set, then no tagged configuration 509 # was found and let the user know that the "--tag" command 510 # line option must be used. 511 if test -z "$tagname"; then 512 echo "$modename: unable to infer tagged configuration" 513 echo "$modename: specify a tag with \`--tag'" 1>&2 514 exit 1 515# else 516# echo "$modename: using $tagname tagged configuration" 517 fi 518 ;; 519 esac 520 fi 521 522 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` 523 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` 524 if test "X$xdir" = "X$obj"; then 525 xdir= 526 else 527 xdir=$xdir/ 528 fi 529 lobj=${xdir}$objdir/$objname 530 531 if test -z "$base_compile"; then 532 $echo "$modename: you must specify a compilation command" 1>&2 533 $echo "$help" 1>&2 534 exit 1 535 fi 536 537 # Delete any leftover library objects. 538 if test "$build_old_libs" = yes; then 539 removelist="$obj $lobj $libobj ${libobj}T" 540 else 541 removelist="$lobj $libobj ${libobj}T" 542 fi 543 544 $run $rm $removelist 545 trap "$run $rm $removelist; exit 1" 1 2 15 546 547 # On Cygwin there's no "real" PIC flag so we must build both object types 548 case $host_os in 549 cygwin* | mingw* | pw32* | os2*) 550 pic_mode=default 551 ;; 552 esac 553 if test $pic_mode = no && test "$deplibs_check_method" != pass_all; then 554 # non-PIC code in shared libraries is not supported 555 pic_mode=default 556 fi 557 558 # Calculate the filename of the output object if compiler does 559 # not support -o with -c 560 if test "$compiler_c_o" = no; then 561 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} 562 lockfile="$output_obj.lock" 563 removelist="$removelist $output_obj $lockfile" 564 trap "$run $rm $removelist; exit 1" 1 2 15 565 else 566 output_obj= 567 need_locks=no 568 lockfile= 569 fi 570 571 # Lock this critical section if it is needed 572 # We use this script file to make the link, it avoids creating a new file 573 if test "$need_locks" = yes; then 574 until $run ln "$0" "$lockfile" 2>/dev/null; do 575 $show "Waiting for $lockfile to be removed" 576 sleep 2 577 done 578 elif test "$need_locks" = warn; then 579 if test -f "$lockfile"; then 580 echo "\ 581*** ERROR, $lockfile exists and contains: 582`cat $lockfile 2>/dev/null` 583 584This indicates that another process is trying to use the same 585temporary object file, and libtool could not work around it because 586your compiler does not support \`-c' and \`-o' together. If you 587repeat this compilation, it may succeed, by chance, but you had better 588avoid parallel builds (make -j) in this platform, or get a better 589compiler." 590 591 $run $rm $removelist 592 exit 1 593 fi 594 echo $srcfile > "$lockfile" 595 fi 596 597 if test -n "$fix_srcfile_path"; then 598 eval srcfile=\"$fix_srcfile_path\" 599 fi 600 601 $run $rm "$libobj" "${libobj}T" 602 603 # Create a libtool object file (analogous to a ".la" file), 604 # but don't create it if we're doing a dry run. 605 test -z "$run" && cat > ${libobj}T <<EOF 606# $libobj - a libtool object file 607# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP 608# 609# Please DO NOT delete this file! 610# It is necessary for linking the library. 611 612# Name of the PIC object. 613EOF 614 615 # Only build a PIC object if we are building libtool libraries. 616 if test "$build_libtool_libs" = yes; then 617 # Without this assignment, base_compile gets emptied. 618 fbsd_hideous_sh_bug=$base_compile 619 620 if test "$pic_mode" != no; then 621 command="$base_compile $srcfile $pic_flag" 622 else 623 # Don't build PIC code 624 command="$base_compile $srcfile" 625 fi 626 627 if test ! -d ${xdir}$objdir; then 628 $show "$mkdir ${xdir}$objdir" 629 $run $mkdir ${xdir}$objdir 630 status=$? 631 if test $status -ne 0 && test ! -d ${xdir}$objdir; then 632 exit $status 633 fi 634 fi 635 636 if test -z "$output_obj"; then 637 # Place PIC objects in $objdir 638 command="$command -o $lobj" 639 fi 640 641 $run $rm "$lobj" "$output_obj" 642 643 $show "$command" 644 if $run eval "$command"; then : 645 else 646 test -n "$output_obj" && $run $rm $removelist 647 exit 1 648 fi 649 650 if test "$need_locks" = warn && 651 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then 652 echo "\ 653*** ERROR, $lockfile contains: 654`cat $lockfile 2>/dev/null` 655 656but it should contain: 657$srcfile 658 659This indicates that another process is trying to use the same 660temporary object file, and libtool could not work around it because 661your compiler does not support \`-c' and \`-o' together. If you 662repeat this compilation, it may succeed, by chance, but you had better 663avoid parallel builds (make -j) in this platform, or get a better 664compiler." 665 666 $run $rm $removelist 667 exit 1 668 fi 669 670 # Just move the object if needed, then go on to compile the next one 671 if test -n "$output_obj" && test "x$output_obj" != "x$lobj"; then 672 $show "$mv $output_obj $lobj" 673 if $run $mv $output_obj $lobj; then : 674 else 675 error=$? 676 $run $rm $removelist 677 exit $error 678 fi 679 fi 680 681 # Append the name of the PIC object to the libtool object file. 682 test -z "$run" && cat >> ${libobj}T <<EOF 683pic_object='$objdir/$objname' 684 685EOF 686 687 # Allow error messages only from the first compilation. 688 suppress_output=' >/dev/null 2>&1' 689 else 690 # No PIC object so indicate it doesn't exist in the libtool 691 # object file. 692 test -z "$run" && cat >> ${libobj}T <<EOF 693pic_object=none 694 695EOF 696 fi 697 698 # Only build a position-dependent object if we build old libraries. 699 if test "$build_old_libs" = yes; then 700 if test "$pic_mode" != yes; then 701 # Don't build PIC code 702 command="$base_compile $srcfile" 703 else 704 command="$base_compile $srcfile $pic_flag" 705 fi 706 if test "$compiler_c_o" = yes; then 707 command="$command -o $obj" 708 fi 709 710 # Suppress compiler output if we already did a PIC compilation. 711 command="$command$suppress_output" 712 $run $rm "$obj" "$output_obj" 713 $show "$command" 714 if $run eval "$command"; then : 715 else 716 $run $rm $removelist 717 exit 1 718 fi 719 720 if test "$need_locks" = warn && 721 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then 722 echo "\ 723*** ERROR, $lockfile contains: 724`cat $lockfile 2>/dev/null` 725 726but it should contain: 727$srcfile 728 729This indicates that another process is trying to use the same 730temporary object file, and libtool could not work around it because 731your compiler does not support \`-c' and \`-o' together. If you 732repeat this compilation, it may succeed, by chance, but you had better 733avoid parallel builds (make -j) in this platform, or get a better 734compiler." 735 736 $run $rm $removelist 737 exit 1 738 fi 739 740 # Just move the object if needed 741 if test -n "$output_obj" && test "x$output_obj" != "x$obj"; then 742 $show "$mv $output_obj $obj" 743 if $run $mv $output_obj $obj; then : 744 else 745 error=$? 746 $run $rm $removelist 747 exit $error 748 fi 749 fi 750 751 # Append the name of the non-PIC object the libtool object file. 752 # Only append if the libtool object file exists. 753 test -z "$run" && cat >> ${libobj}T <<EOF 754# Name of the non-PIC object. 755non_pic_object='$objname' 756 757EOF 758 else 759 # Append the name of the non-PIC object the libtool object file. 760 # Only append if the libtool object file exists. 761 test -z "$run" && cat >> ${libobj}T <<EOF 762# Name of the non-PIC object. 763non_pic_object=none 764 765EOF 766 fi 767 768 $run $mv "${libobj}T" "${libobj}" 769 770 # Unlock the critical section if it was locked 771 if test "$need_locks" != no; then 772 $run $rm "$lockfile" 773 fi 774 775 exit 0 776 ;; 777 778 # libtool link mode 779 link | relink) 780 modename="$modename: link" 781 case $host in 782 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) 783 # It is impossible to link a dll without this setting, and 784 # we shouldn't force the makefile maintainer to figure out 785 # which system we are compiling for in order to pass an extra 786 # flag for every libtool invokation. 787 # allow_undefined=no 788 789 # FIXME: Unfortunately, there are problems with the above when trying 790 # to make a dll which has undefined symbols, in which case not 791 # even a static library is built. For now, we need to specify 792 # -no-undefined on the libtool link line when we can be certain 793 # that all symbols are satisfied, otherwise we get a static library. 794 allow_undefined=yes 795 ;; 796 *) 797 allow_undefined=yes 798 ;; 799 esac 800 libtool_args="$nonopt" 801 base_compile="$nonopt" 802 compile_command="$nonopt" 803 finalize_command="$nonopt" 804 805 compile_rpath= 806 finalize_rpath= 807 compile_shlibpath= 808 finalize_shlibpath= 809 convenience= 810 old_convenience= 811 deplibs= 812 old_deplibs= 813 add_flags= 814 compiler_flags= 815 linker_flags= 816 dllsearchpath= 817 lib_search_path=`pwd` 818 819 avoid_version=no 820 dlfiles= 821 dlprefiles= 822 dlself=no 823 export_dynamic=no 824 export_symbols= 825 export_symbols_regex= 826 generated= 827 libobjs= 828 ltlibs= 829 module=no 830 no_install=no 831 objs= 832 non_pic_objects= 833 prefer_static_libs=no 834 preload=no 835 prev= 836 prevarg= 837 release= 838 rpath= 839 xrpath= 840 perm_rpath= 841 temp_rpath= 842 thread_safe=no 843 vinfo= 844 845 # We need to know -static, to get the right output filenames. 846 for arg 847 do 848 case $arg in 849 -all-static | -static) 850 if test "X$arg" = "X-all-static"; then 851 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then 852 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 853 fi 854 if test -n "$link_static_flag"; then 855 dlopen_self=$dlopen_self_static 856 fi 857 else 858 if test -z "$pic_flag" && test -n "$link_static_flag"; then 859 dlopen_self=$dlopen_self_static 860 fi 861 fi 862 build_libtool_libs=no 863 build_old_libs=yes 864 prefer_static_libs=yes 865 break 866 ;; 867 esac 868 done 869 870 # See if our shared archives depend on static archives. 871 test -n "$old_archive_from_new_cmds" && build_old_libs=yes 872 873 # Go through the arguments, transforming them on the way. 874 while test $# -gt 0; do 875 arg="$1" 876 base_compile="$base_compile $arg" 877 shift 878 case $arg in 879 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 880 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test 881 ;; 882 *) qarg=$arg ;; 883 esac 884 libtool_args="$libtool_args $qarg" 885 886 # If the previous option needs an argument, assign it. 887 if test -n "$prev"; then 888 case $prev in 889 output) 890 compile_command="$compile_command @OUTPUT@" 891 finalize_command="$finalize_command @OUTPUT@" 892 ;; 893 esac 894 895 case $prev in 896 dlfiles|dlprefiles) 897 if test "$preload" = no; then 898 # Add the symbol object into the linking commands. 899 compile_command="$compile_command @SYMFILE@" 900 finalize_command="$finalize_command @SYMFILE@" 901 preload=yes 902 fi 903 case $arg in 904 *.la | *.lo) ;; # We handle these cases below. 905 force) 906 if test "$dlself" = no; then 907 dlself=needless 908 export_dynamic=yes 909 fi 910 prev= 911 continue 912 ;; 913 self) 914 if test "$prev" = dlprefiles; then 915 dlself=yes 916 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then 917 dlself=yes 918 else 919 dlself=needless 920 export_dynamic=yes 921 fi 922 prev= 923 continue 924 ;; 925 *) 926 if test "$prev" = dlfiles; then 927 dlfiles="$dlfiles $arg" 928 else 929 dlprefiles="$dlprefiles $arg" 930 fi 931 prev= 932 continue 933 ;; 934 esac 935 ;; 936 expsyms) 937 export_symbols="$arg" 938 if test ! -f "$arg"; then 939 $echo "$modename: symbol file \`$arg' does not exist" 940 exit 1 941 fi 942 prev= 943 continue 944 ;; 945 expsyms_regex) 946 export_symbols_regex="$arg" 947 prev= 948 continue 949 ;; 950 release) 951 release="-$arg" 952 prev= 953 continue 954 ;; 955 objectlist) 956 if test -f "$arg"; then 957 save_arg=$arg 958 moreargs= 959 for fil in `cat $save_arg` 960 do 961# moreargs="$moreargs $fil" 962 arg=$fil 963 # A libtool-controlled object. 964 965 # Check to see that this really is a libtool object. 966 if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 967 pic_object= 968 non_pic_object= 969 970 # Read the .lo file 971 # If there is no directory component, then add one. 972 case $arg in 973 */* | *\\*) . $arg ;; 974 *) . ./$arg ;; 975 esac 976 977 if test -z "$pic_object" || \ 978 test -z "$non_pic_object" || 979 test "$pic_object" = none && \ 980 test "$non_pic_object" = none; then 981 $echo "$modename: cannot find name of object for \`$arg'" 1>&2 982 exit 1 983 fi 984 985 # Extract subdirectory from the argument. 986 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` 987 if test "X$xdir" = "X$arg"; then 988 xdir= 989 else 990 xdir="$xdir/" 991 fi 992 993 if test "$pic_object" != none; then 994 # Prepend the subdirectory the object is found in. 995 pic_object="$xdir$pic_object" 996 997 if test "$prev" = dlfiles; then 998 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then 999 dlfiles="$dlfiles $pic_object" 1000 prev= 1001 continue 1002 else 1003 # If libtool objects are unsupported, then we need to preload. 1004 prev=dlprefiles 1005 fi 1006 fi 1007 1008 # CHECK ME: I think I busted this. -Ossama 1009 if test "$prev" = dlprefiles; then 1010 # Preload the old-style object. 1011 dlprefiles="$dlprefiles $pic_object" 1012 prev= 1013 fi 1014 1015 # A PIC object. 1016 libobjs="$libobjs $pic_object" 1017 arg="$pic_object" 1018 fi 1019 1020 # Non-PIC object. 1021 if test "$non_pic_object" != none; then 1022 # Prepend the subdirectory the object is found in. 1023 non_pic_object="$xdir$non_pic_object" 1024 1025 # A standard non-PIC object 1026 non_pic_objects="$non_pic_objects $non_pic_object" 1027 if test -z "$pic_object" || test "$pic_object" = none ; then 1028 arg="$non_pic_object" 1029 fi 1030 fi 1031 else 1032 # Only an error if not doing a dry-run. 1033 if test -z "$run"; then 1034 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 1035 exit 1 1036 else 1037 # Dry-run case. 1038 1039 # Extract subdirectory from the argument. 1040 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` 1041 if test "X$xdir" = "X$arg"; then 1042 xdir= 1043 else 1044 xdir="$xdir/" 1045 fi 1046 1047 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` 1048 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` 1049 libobjs="$libobjs $pic_object" 1050 non_pic_objects="$non_pic_objects $non_pic_object" 1051 fi 1052 fi 1053 done 1054 else 1055 $echo "$modename: link input file \`$save_arg' does not exist" 1056 exit 1 1057 fi 1058 arg=$save_arg 1059 prev= 1060 continue 1061 ;; 1062 rpath | xrpath) 1063 # We need an absolute path. 1064 case $arg in 1065 [\\/]* | [A-Za-z]:[\\/]*) ;; 1066 *) 1067 $echo "$modename: only absolute run-paths are allowed" 1>&2 1068 exit 1 1069 ;; 1070 esac 1071 if test "$prev" = rpath; then 1072 case "$rpath " in 1073 *" $arg "*) ;; 1074 *) rpath="$rpath $arg" ;; 1075 esac 1076 else 1077 case "$xrpath " in 1078 *" $arg "*) ;; 1079 *) xrpath="$xrpath $arg" ;; 1080 esac 1081 fi 1082 prev= 1083 continue 1084 ;; 1085 xcompiler) 1086 compiler_flags="$compiler_flags $qarg" 1087 prev= 1088 compile_command="$compile_command $qarg" 1089 finalize_command="$finalize_command $qarg" 1090 continue 1091 ;; 1092 xlinker) 1093 linker_flags="$linker_flags $qarg" 1094 compiler_flags="$compiler_flags $wl$qarg" 1095 prev= 1096 compile_command="$compile_command $wl$qarg" 1097 finalize_command="$finalize_command $wl$qarg" 1098 continue 1099 ;; 1100 *) 1101 eval "$prev=\"\$arg\"" 1102 prev= 1103 continue 1104 ;; 1105 esac 1106 fi 1107 1108 prevarg="$arg" 1109 1110 case $arg in 1111 -all-static) 1112 if test -n "$link_static_flag"; then 1113 compile_command="$compile_command $link_static_flag" 1114 finalize_command="$finalize_command $link_static_flag" 1115 fi 1116 continue 1117 ;; 1118 1119 -allow-undefined) 1120 # FIXME: remove this flag sometime in the future. 1121 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 1122 continue 1123 ;; 1124 1125 -avoid-version) 1126 avoid_version=yes 1127 continue 1128 ;; 1129 1130 -dlopen) 1131 prev=dlfiles 1132 continue 1133 ;; 1134 1135 -dlpreopen) 1136 prev=dlprefiles 1137 continue 1138 ;; 1139 1140 -export-dynamic) 1141 export_dynamic=yes 1142 continue 1143 ;; 1144 1145 -export-symbols | -export-symbols-regex) 1146 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then 1147 $echo "$modename: not more than one -exported-symbols argument allowed" 1148 exit 1 1149 fi 1150 if test "X$arg" = "X-export-symbols"; then 1151 prev=expsyms 1152 else 1153 prev=expsyms_regex 1154 fi 1155 continue 1156 ;; 1157 1158 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* 1159 # so, if we see these flags be careful not to treat them like -L 1160 -L[A-Z][A-Z]*:*) 1161 case $with_gcc/$host in 1162 no/*-*-irix*) 1163 compile_command="$compile_command $arg" 1164 finalize_command="$finalize_command $arg" 1165 ;; 1166 esac 1167 continue 1168 ;; 1169 1170 -L*) 1171 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` 1172 # We need an absolute path. 1173 case $dir in 1174 [\\/]* | [A-Za-z]:[\\/]*) ;; 1175 *) 1176 absdir=`cd "$dir" && pwd` 1177 if test -z "$absdir"; then 1178 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 1179 exit 1 1180 fi 1181 dir="$absdir" 1182 ;; 1183 esac 1184 case "$deplibs " in 1185 *" -L$dir "*) ;; 1186 *) 1187 deplibs="$deplibs -L$dir" 1188 lib_search_path="$lib_search_path $dir" 1189 ;; 1190 esac 1191 case $host in 1192 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) 1193 case :$dllsearchpath: in 1194 *":$dir:"*) ;; 1195 *) dllsearchpath="$dllsearchpath:$dir";; 1196 esac 1197 ;; 1198 esac 1199 continue 1200 ;; 1201 1202 -l*) 1203 if test "$arg" = "-lc"; then 1204 case $host in 1205 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) 1206 # These systems don't actually have c library (as such) 1207 continue 1208 ;; 1209 *-*-rhapsody* | *-*-darwin1.[012]) 1210 # Rhapsody C library is in the System framework 1211 deplibs="$deplibs -framework System" 1212 continue 1213 ;; 1214 esac 1215 elif test "$arg" = "-lm"; then 1216 case $host in 1217 *-*-cygwin* | *-*-pw32* | *-*-beos*) 1218 # These systems don't actually have math library (as such) 1219 continue 1220 ;; 1221 *-*-rhapsody* | *-*-darwin1.[012]) 1222 # Rhapsody math library is in the System framework 1223 deplibs="$deplibs -framework System" 1224 continue 1225 ;; 1226 esac 1227 fi 1228 deplibs="$deplibs $arg" 1229 continue 1230 ;; 1231 1232 -module) 1233 module=yes 1234 continue 1235 ;; 1236 1237 -no-fast-install) 1238 fast_install=no 1239 continue 1240 ;; 1241 1242 -no-install) 1243 case $host in 1244 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) 1245 # The PATH hackery in wrapper scripts is required on Windows 1246 # in order for the loader to find any dlls it needs. 1247 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 1248 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 1249 fast_install=no 1250 ;; 1251 *) 1252 no_install=yes 1253 ;; 1254 esac 1255 continue 1256 ;; 1257 1258 -no-undefined) 1259 allow_undefined=no 1260 continue 1261 ;; 1262 1263 -objectlist) 1264 prev=objectlist 1265 continue 1266 ;; 1267 1268 -o) prev=output ;; 1269 1270 -release) 1271 prev=release 1272 continue 1273 ;; 1274 1275 -rpath) 1276 prev=rpath 1277 continue 1278 ;; 1279 1280 -R) 1281 prev=xrpath 1282 continue 1283 ;; 1284 1285 -R*) 1286 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` 1287 # We need an absolute path. 1288 case $dir in 1289 [\\/]* | [A-Za-z]:[\\/]*) ;; 1290 *) 1291 $echo "$modename: only absolute run-paths are allowed" 1>&2 1292 exit 1 1293 ;; 1294 esac 1295 case "$xrpath " in 1296 *" $dir "*) ;; 1297 *) xrpath="$xrpath $dir" ;; 1298 esac 1299 continue 1300 ;; 1301 1302 -static) 1303 # The effects of -static are defined in a previous loop. 1304 # We used to do the same as -all-static on platforms that 1305 # didn't have a PIC flag, but the assumption that the effects 1306 # would be equivalent was wrong. It would break on at least 1307 # Digital Unix and AIX. 1308 continue 1309 ;; 1310 1311 -thread-safe) 1312 thread_safe=yes 1313 continue 1314 ;; 1315 1316 -version-info) 1317 prev=vinfo 1318 continue 1319 ;; 1320 1321 -Wc,*) 1322 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` 1323 arg= 1324 IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' 1325 for flag in $args; do 1326 IFS="$save_ifs" 1327 case $flag in 1328 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 1329 flag="\"$flag\"" 1330 ;; 1331 esac 1332 arg="$arg $wl$flag" 1333 compiler_flags="$compiler_flags $flag" 1334 done 1335 IFS="$save_ifs" 1336 arg=`$echo "X$arg" | $Xsed -e "s/^ //"` 1337 ;; 1338 1339 -Wl,*) 1340 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` 1341 arg= 1342 IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' 1343 for flag in $args; do 1344 IFS="$save_ifs" 1345 case $flag in 1346 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 1347 flag="\"$flag\"" 1348 ;; 1349 esac 1350 arg="$arg $wl$flag" 1351 compiler_flags="$compiler_flags $wl$flag" 1352 linker_flags="$linker_flags $flag" 1353 done 1354 IFS="$save_ifs" 1355 arg=`$echo "X$arg" | $Xsed -e "s/^ //"` 1356 ;; 1357 1358 -Xcompiler) 1359 prev=xcompiler 1360 continue 1361 ;; 1362 1363 -Xlinker) 1364 prev=xlinker 1365 continue 1366 ;; 1367 1368 # Some other compiler flag. 1369 -* | +*) 1370 # Unknown arguments in both finalize_command and compile_command need 1371 # to be aesthetically quoted because they are evaled later. 1372 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` 1373 case $arg in 1374 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 1375 arg="\"$arg\"" 1376 ;; 1377 esac 1378 add_flags="$add_flags $arg" 1379 ;; 1380 1381 *.$objext) 1382 # A standard object. 1383 objs="$objs $arg" 1384 ;; 1385 1386 *.lo) 1387 # A libtool-controlled object. 1388 1389 # Check to see that this really is a libtool object. 1390 if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 1391 pic_object= 1392 non_pic_object= 1393 1394 # Read the .lo file 1395 # If there is no directory component, then add one. 1396 case $arg in 1397 */* | *\\*) . $arg ;; 1398 *) . ./$arg ;; 1399 esac 1400 1401 if test -z "$pic_object" || \ 1402 test -z "$non_pic_object" || 1403 test "$pic_object" = none && \ 1404 test "$non_pic_object" = none; then 1405 $echo "$modename: cannot find name of object for \`$arg'" 1>&2 1406 exit 1 1407 fi 1408 1409 # Extract subdirectory from the argument. 1410 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` 1411 if test "X$xdir" = "X$arg"; then 1412 xdir= 1413 else 1414 xdir="$xdir/" 1415 fi 1416 1417 if test "$pic_object" != none; then 1418 # Prepend the subdirectory the object is found in. 1419 pic_object="$xdir$pic_object" 1420 1421 if test "$prev" = dlfiles; then 1422 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then 1423 dlfiles="$dlfiles $pic_object" 1424 prev= 1425 continue 1426 else 1427 # If libtool objects are unsupported, then we need to preload. 1428 prev=dlprefiles 1429 fi 1430 fi 1431 1432 # CHECK ME: I think I busted this. -Ossama 1433 if test "$prev" = dlprefiles; then 1434 # Preload the old-style object. 1435 dlprefiles="$dlprefiles $pic_object" 1436 prev= 1437 fi 1438 1439 # A PIC object. 1440 libobjs="$libobjs $pic_object" 1441 arg="$pic_object" 1442 fi 1443 1444 # Non-PIC object. 1445 if test "$non_pic_object" != none; then 1446 # Prepend the subdirectory the object is found in. 1447 non_pic_object="$xdir$non_pic_object" 1448 1449 # A standard non-PIC object 1450 non_pic_objects="$non_pic_objects $non_pic_object" 1451 if test -z "$pic_object" || test "$pic_object" = none ; then 1452 arg="$non_pic_object" 1453 fi 1454 fi 1455 else 1456 # Only an error if not doing a dry-run. 1457 if test -z "$run"; then 1458 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 1459 exit 1 1460 else 1461 # Dry-run case. 1462 1463 # Extract subdirectory from the argument. 1464 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` 1465 if test "X$xdir" = "X$arg"; then 1466 xdir= 1467 else 1468 xdir="$xdir/" 1469 fi 1470 1471 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` 1472 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` 1473 libobjs="$libobjs $pic_object" 1474 non_pic_objects="$non_pic_objects $non_pic_object" 1475 fi 1476 fi 1477 ;; 1478 1479 *.$libext) 1480 # An archive. 1481 deplibs="$deplibs $arg" 1482 old_deplibs="$old_deplibs $arg" 1483 continue 1484 ;; 1485 1486 *.la) 1487 # A libtool-controlled library. 1488 1489 if test "$prev" = dlfiles; then 1490 # This library was specified with -dlopen. 1491 dlfiles="$dlfiles $arg" 1492 prev= 1493 elif test "$prev" = dlprefiles; then 1494 # The library was specified with -dlpreopen. 1495 dlprefiles="$dlprefiles $arg" 1496 prev= 1497 else 1498 deplibs="$deplibs $arg" 1499 fi 1500 continue 1501 ;; 1502 1503 # Some other compiler argument. 1504 *) 1505 # Unknown arguments in both finalize_command and compile_command need 1506 # to be aesthetically quoted because they are evaled later. 1507 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` 1508 case $arg in 1509 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 1510 arg="\"$arg\"" 1511 ;; 1512 esac 1513 add_flags="$add_flags $arg" 1514 ;; 1515 esac 1516 1517 # Now actually substitute the argument into the commands. 1518 if test -n "$arg"; then 1519 compile_command="$compile_command $arg" 1520 finalize_command="$finalize_command $arg" 1521 fi 1522 done 1523 1524 if test -n "$prev"; then 1525 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 1526 $echo "$help" 1>&2 1527 exit 1 1528 fi 1529 1530 # Infer tagged configuration to use if any are available and 1531 # if one wasn't chosen via the "--tag" command line option. 1532 # Only attempt this if the compiler in the base link 1533 # command doesn't match the default compiler. 1534 if test -n "$available_tags" && test -z "$tagname"; then 1535 case $base_compile in 1536 "$CC "*) ;; 1537 # Blanks in the command may have been stripped by the calling shell, 1538 # but not from the CC environment variable when ltconfig was run. 1539 "`$echo $CC` "*) ;; 1540 *) 1541 for z in $available_tags; do 1542 if grep "^### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then 1543 # Evaluate the configuration. 1544 eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`" 1545 case $base_compile in 1546 "$CC "*) 1547 # The compiler in $compile_command matches 1548 # the one in the tagged configuration. 1549 # Assume this is the tagged configuration we want. 1550 tagname=$z 1551 break 1552 ;; 1553 "`$echo $CC` "*) 1554 tagname=$z 1555 break 1556 ;; 1557 esac 1558 fi 1559 done 1560 # If $tagname still isn't set, then no tagged configuration 1561 # was found and let the user know that the "--tag" command 1562 # line option must be used. 1563 if test -z "$tagname"; then 1564 echo "$modename: unable to infer tagged configuration" 1565 echo "$modename: specify a tag with \`--tag'" 1>&2 1566 exit 1 1567# else 1568# echo "$modename: using $tagname tagged configuration" 1569 fi 1570 ;; 1571 esac 1572 fi 1573 1574 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then 1575 eval arg=\"$export_dynamic_flag_spec\" 1576 compile_command="$compile_command $arg" 1577 finalize_command="$finalize_command $arg" 1578 fi 1579 1580 oldlibs= 1581 # calculate the name of the file, without its directory 1582 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` 1583 libobjs_save="$libobjs" 1584 1585 if test -n "$shlibpath_var"; then 1586 # get the directories listed in $shlibpath_var 1587 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` 1588 else 1589 shlib_search_path= 1590 fi 1591 eval sys_lib_search_path=\"$sys_lib_search_path_spec\" 1592 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" 1593 1594 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` 1595 if test "X$output_objdir" = "X$output"; then 1596 output_objdir="$objdir" 1597 else 1598 output_objdir="$output_objdir/$objdir" 1599 fi 1600 # Create the object directory. 1601 if test ! -d $output_objdir; then 1602 $show "$mkdir $output_objdir" 1603 $run $mkdir $output_objdir 1604 status=$? 1605 if test $status -ne 0 && test ! -d $output_objdir; then 1606 exit $status 1607 fi 1608 fi 1609 1610 # Determine the type of output 1611 case $output in 1612 "") 1613 $echo "$modename: you must specify an output file" 1>&2 1614 $echo "$help" 1>&2 1615 exit 1 1616 ;; 1617 *.$libext) linkmode=oldlib ;; 1618 *.lo | *.$objext) linkmode=obj ;; 1619 *.la) linkmode=lib ;; 1620 *) linkmode=prog ;; # Anything else should be a program. 1621 esac 1622 1623 specialdeplibs= 1624 libs= 1625 # Find all interdependent deplibs by searching for libraries 1626 # that are linked more than once (e.g. -la -lb -la) 1627 for deplib in $deplibs; do 1628 case "$libs " in 1629 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; 1630 esac 1631 libs="$libs $deplib" 1632 done 1633 1634 if test $linkmode = lib; then 1635 libs="$predeps $libs $compiler_lib_search_path $postdeps" 1636 fi 1637 1638 deplibs= 1639 newdependency_libs= 1640 newlib_search_path= 1641 need_relink=no # whether we're linking any uninstalled libtool libraries 1642 uninst_deplibs= # uninstalled libtool libraries 1643 uninst_path= # paths that contain uninstalled libtool libraries 1644 case $linkmode in 1645 lib) 1646 passes="conv link" 1647 for file in $dlfiles $dlprefiles; do 1648 case $file in 1649 *.la) ;; 1650 *) 1651 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 1652 exit 1 1653 ;; 1654 esac 1655 done 1656 ;; 1657 prog) 1658 compile_deplibs= 1659 finalize_deplibs= 1660 alldeplibs=no 1661 newdlfiles= 1662 newdlprefiles= 1663 passes="conv scan dlopen dlpreopen link" 1664 ;; 1665 *) passes="conv" 1666 ;; 1667 esac 1668 for pass in $passes; do 1669 if test "$linkmode,$pass" = "lib,link" || 1670 test "$linkmode,$pass" = "prog,scan"; then 1671 libs="$deplibs" 1672 deplibs= 1673 fi 1674 if test $linkmode = prog; then 1675 case $pass in 1676 dlopen) libs="$dlfiles" ;; 1677 dlpreopen) libs="$dlprefiles" ;; 1678 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; 1679 esac 1680 fi 1681 if test $pass = dlopen; then 1682 # Collect dlpreopened libraries 1683 save_deplibs="$deplibs" 1684 deplibs= 1685 fi 1686 for deplib in $libs; do 1687 lib= 1688 found=no 1689 case $deplib in 1690 -l*) 1691 if test $linkmode != lib && test $linkmode != prog; then 1692 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 1693 continue 1694 fi 1695 if test $pass = conv; then 1696 deplibs="$deplib $deplibs" 1697 continue 1698 fi 1699 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` 1700 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do 1701 # Search the libtool library 1702 lib="$searchdir/lib${name}.la" 1703 if test -f "$lib"; then 1704 found=yes 1705 break 1706 fi 1707 done 1708 if test "$found" != yes; then 1709 if test "$linkmode,$pass" = "prog,link"; then 1710 compile_deplibs="$deplib $compile_deplibs" 1711 finalize_deplibs="$deplib $finalize_deplibs" 1712 else 1713 deplibs="$deplib $deplibs" 1714 test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs" 1715 fi 1716 continue 1717 fi 1718 ;; 1719 -L*) 1720 case $linkmode in 1721 lib) 1722 deplibs="$deplib $deplibs" 1723 test $pass = conv && continue 1724 newdependency_libs="$deplib $newdependency_libs" 1725 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` 1726 ;; 1727 prog) 1728 if test $pass = conv; then 1729 deplibs="$deplib $deplibs" 1730 continue 1731 fi 1732 if test $pass = scan; then 1733 deplibs="$deplib $deplibs" 1734 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` 1735 else 1736 compile_deplibs="$deplib $compile_deplibs" 1737 finalize_deplibs="$deplib $finalize_deplibs" 1738 fi 1739 ;; 1740 *) 1741 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 1742 ;; 1743 esac 1744 continue 1745 ;; 1746 -R*) 1747 if test $pass = link; then 1748 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` 1749 # Make sure the xrpath contains only unique directories. 1750 case "$xrpath " in 1751 *" $dir "*) ;; 1752 *) xrpath="$xrpath $dir" ;; 1753 esac 1754 fi 1755 deplibs="$deplib $deplibs" 1756 continue 1757 ;; 1758 *.la) lib="$deplib" ;; 1759 *.$libext) 1760 if test $pass = conv; then 1761 deplibs="$deplib $deplibs" 1762 continue 1763 fi 1764 case $linkmode in 1765 lib) 1766 if test "$deplibs_check_method" != pass_all; then 1767 echo 1768 echo "*** Warning: This library needs some functionality provided by $deplib." 1769 echo "*** I have the capability to make that library automatically link in when" 1770 echo "*** you link to this library. But I can only do this if you have a" 1771 echo "*** shared version of the library, which you do not appear to have." 1772 else 1773 echo 1774 echo "*** Warning: Linking the shared library $output against the" 1775 echo "*** static library $deplib is not portable!" 1776 deplibs="$deplib $deplibs" 1777 fi 1778 continue 1779 ;; 1780 prog) 1781 if test $pass != link; then 1782 deplibs="$deplib $deplibs" 1783 else 1784 compile_deplibs="$deplib $compile_deplibs" 1785 finalize_deplibs="$deplib $finalize_deplibs" 1786 fi 1787 continue 1788 ;; 1789 esac 1790 ;; 1791 *.lo | *.$objext) 1792 if test $pass = conv; then 1793 deplibs="$deplib $deplibs" 1794 elif test $linkmode = prog; then 1795 if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then 1796 # If there is no dlopen support or we're linking statically, 1797 # we need to preload. 1798 newdlprefiles="$newdlprefiles $deplib" 1799 compile_deplibs="$deplib $compile_deplibs" 1800 finalize_deplibs="$deplib $finalize_deplibs" 1801 else 1802 newdlfiles="$newdlfiles $deplib" 1803 fi 1804 fi 1805 continue 1806 ;; 1807 %DEPLIBS%) 1808 alldeplibs=yes 1809 continue 1810 ;; 1811 esac 1812 if test $found = yes || test -f "$lib"; then : 1813 else 1814 $echo "$modename: cannot find the library \`$lib'" 1>&2 1815 exit 1 1816 fi 1817 1818 # Check to see that this really is a libtool archive. 1819 if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : 1820 else 1821 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 1822 exit 1 1823 fi 1824 1825 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` 1826 test "X$ladir" = "X$lib" && ladir="." 1827 1828 dlname= 1829 dlopen= 1830 dlpreopen= 1831 libdir= 1832 library_names= 1833 old_library= 1834 # If the library was installed with an old release of libtool, 1835 # it will not redefine variable installed. 1836 installed=yes 1837 1838 # Read the .la file 1839 case $lib in 1840 */* | *\\*) . $lib ;; 1841 *) . ./$lib ;; 1842 esac 1843 1844 if test "$linkmode,$pass" = "lib,link" || 1845 test "$linkmode,$pass" = "prog,scan" || 1846 { test $linkmode != prog && test $linkmode != lib; }; then 1847 test -n "$dlopen" && dlfiles="$dlfiles $dlopen" 1848 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" 1849 fi 1850 1851 if test $pass = conv; then 1852 # only check for convenience libraries 1853 deplibs="$lib $deplibs" 1854 if test -z "$libdir"; then 1855 if test -z "$old_library"; then 1856 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 1857 exit 1 1858 fi 1859 # It is a libtool convenience library, so add in its objects. 1860 convenience="$convenience $ladir/$objdir/$old_library" 1861 old_convenience="$old_convenience $ladir/$objdir/$old_library" 1862 tmp_libs= 1863 for deplib in $dependency_libs; do 1864 deplibs="$deplib $deplibs" 1865 case "$tmp_libs " in 1866 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; 1867 esac 1868 tmp_libs="$tmp_libs $deplib" 1869 done 1870 elif test $linkmode != prog && test $linkmode != lib; then 1871 $echo "$modename: \`$lib' is not a convenience library" 1>&2 1872 exit 1 1873 fi 1874 continue 1875 fi 1876 1877 # Get the name of the library we link against. 1878 linklib= 1879 for l in $old_library $library_names; do 1880 linklib="$l" 1881 done 1882 if test -z "$linklib"; then 1883 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 1884 exit 1 1885 fi 1886 1887 # This library was specified with -dlopen. 1888 if test $pass = dlopen; then 1889 if test -z "$libdir"; then 1890 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 1891 exit 1 1892 fi 1893 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then 1894 # If there is no dlname, no dlopen support or we're linking 1895 # statically, we need to preload. We also need to preload any 1896 # dependent libraries so libltdl's deplib preloader doesn't 1897 # bomb out in the load deplibs phase. 1898 dlprefiles="$dlprefiles $lib $dependency_libs" 1899 else 1900 newdlfiles="$newdlfiles $lib" 1901 fi 1902 continue 1903 fi 1904 1905 # We need an absolute path. 1906 case $ladir in 1907 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; 1908 *) 1909 abs_ladir=`cd "$ladir" && pwd` 1910 if test -z "$abs_ladir"; then 1911 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 1912 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 1913 abs_ladir="$ladir" 1914 fi 1915 ;; 1916 esac 1917 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` 1918 1919 # Find the relevant object directory and library name. 1920 if test "X$installed" = Xyes; then 1921 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then 1922 $echo "$modename: warning: library \`$lib' was moved." 1>&2 1923 dir="$ladir" 1924 absdir="$abs_ladir" 1925 libdir="$abs_ladir" 1926 else 1927 dir="$libdir" 1928 absdir="$libdir" 1929 fi 1930 else 1931 dir="$ladir/$objdir" 1932 absdir="$abs_ladir/$objdir" 1933 # Remove this search path later 1934 uninst_path="$uninst_path $abs_ladir" 1935 fi 1936 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` 1937 1938 # This library was specified with -dlpreopen. 1939 if test $pass = dlpreopen; then 1940 if test -z "$libdir"; then 1941 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 1942 exit 1 1943 fi 1944 # Prefer using a static library (so that no silly _DYNAMIC symbols 1945 # are required to link). 1946 if test -n "$old_library"; then 1947 newdlprefiles="$newdlprefiles $dir/$old_library" 1948 # Otherwise, use the dlname, so that lt_dlopen finds it. 1949 elif test -n "$dlname"; then 1950 newdlprefiles="$newdlprefiles $dir/$dlname" 1951 else 1952 newdlprefiles="$newdlprefiles $dir/$linklib" 1953 fi 1954 fi 1955 1956 if test -z "$libdir"; then 1957 # link the convenience library 1958 if test $linkmode = lib; then 1959 deplibs="$dir/$old_library $deplibs" 1960 elif test "$linkmode,$pass" = "prog,link"; then 1961 compile_deplibs="$dir/$old_library $compile_deplibs" 1962 finalize_deplibs="$dir/$old_library $finalize_deplibs" 1963 else 1964 deplibs="$lib $deplibs" # used for prog,scan pass 1965 fi 1966 continue 1967 fi 1968 1969 if test $linkmode = prog && test $pass != link; then 1970 newlib_search_path="$newlib_search_path $ladir" 1971 deplibs="$lib $deplibs" 1972 1973 linkalldeplibs=no 1974 if test "$link_all_deplibs" != no || test -z "$library_names" || 1975 test "$build_libtool_libs" = no; then 1976 linkalldeplibs=yes 1977 fi 1978 1979 tmp_libs= 1980 for deplib in $dependency_libs; do 1981 case $deplib in 1982 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test 1983 esac 1984 # Need to link against all dependency_libs? 1985 if test $linkalldeplibs = yes; then 1986 deplibs="$deplib $deplibs" 1987 else 1988 # Need to hardcode shared library paths 1989 # or/and link against static libraries 1990 newdependency_libs="$deplib $newdependency_libs" 1991 fi 1992 case "$tmp_libs " in 1993 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; 1994 esac 1995 tmp_libs="$tmp_libs $deplib" 1996 done 1997 continue 1998 fi 1999 2000 if test "$linkmode,$pass" = "prog,link"; then 2001 if test -n "$library_names" && 2002 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then 2003 # We need to hardcode the library path 2004 if test -n "$shlibpath_var"; then 2005 # Make sure the rpath contains only unique directories. 2006 case "$temp_rpath " in 2007 *" $dir "*) ;; 2008 *" $absdir "*) ;; 2009 *) temp_rpath="$temp_rpath $dir" ;; 2010 esac 2011 fi 2012 2013 # Hardcode the library path. 2014 # Skip directories that are in the system default run-time 2015 # search path. 2016 case " $sys_lib_dlsearch_path " in 2017 *" $absdir "*) ;; 2018 *) 2019 case "$compile_rpath " in 2020 *" $absdir "*) ;; 2021 *) compile_rpath="$compile_rpath $absdir" 2022 esac 2023 ;; 2024 esac 2025 2026 case " $sys_lib_dlsearch_path " in 2027 *" $libdir "*) ;; 2028 *) 2029 case "$finalize_rpath " in 2030 *" $libdir "*) ;; 2031 *) finalize_rpath="$finalize_rpath $libdir" 2032 esac 2033 ;; 2034 esac 2035 fi 2036 2037 if test "$alldeplibs" = yes && 2038 { test "$deplibs_check_method" = pass_all || 2039 { test "$build_libtool_libs" = yes && 2040 test -n "$library_names"; }; }; then 2041 # We only need to search for static libraries 2042 continue 2043 fi 2044 fi 2045 2046 link_static=no # Whether the deplib will be linked statically 2047 if test -n "$library_names" && 2048 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then 2049 if test "$installed" = no; then 2050 uninst_deplibs="$uninst_deplibs $lib" 2051 need_relink=yes 2052 fi 2053 # This is a shared library 2054 if test $linkmode = lib && test "$hardcode_into_libs" = all; then 2055 # Hardcode the library path. 2056 # Skip directories that are in the system default run-time 2057 # search path. 2058 case " $sys_lib_dlsearch_path " in 2059 *" $absdir "*) ;; 2060 *) 2061 case "$compile_rpath " in 2062 *" $absdir "*) ;; 2063 *) compile_rpath="$compile_rpath $absdir" 2064 esac 2065 ;; 2066 esac 2067 case " $sys_lib_dlsearch_path " in 2068 *" $libdir "*) ;; 2069 *) 2070 case "$finalize_rpath " in 2071 *" $libdir "*) ;; 2072 *) finalize_rpath="$finalize_rpath $libdir" 2073 esac 2074 ;; 2075 esac 2076 fi 2077 2078 if test -n "$old_archive_from_expsyms_cmds"; then 2079 # figure out the soname 2080 set dummy $library_names 2081 realname="$2" 2082 shift; shift 2083 libname=`eval \\$echo \"$libname_spec\"` 2084 # use dlname if we got it. it's perfectly good, no? 2085 if test -n "$dlname"; then 2086 soname="$dlname" 2087 elif test -n "$soname_spec"; then 2088 # bleh windows 2089 case $host in 2090 *cygwin*) 2091 major=`expr $current - $age` 2092 versuffix="-$major" 2093 ;; 2094 esac 2095 eval soname=\"$soname_spec\" 2096 else 2097 soname="$realname" 2098 fi 2099 2100 # Make a new name for the extract_expsyms_cmds to use 2101 soroot="$soname" 2102 soname=`echo $soroot | sed -e 's/^.*\///'` 2103 newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a" 2104 2105 # If the library has no export list, then create one now 2106 if test -f "$output_objdir/$soname-def"; then : 2107 else 2108 $show "extracting exported symbol list from \`$soname'" 2109 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' 2110 eval cmds=\"$extract_expsyms_cmds\" 2111 for cmd in $cmds; do 2112 IFS="$save_ifs" 2113 $show "$cmd" 2114 $run eval "$cmd" || exit $? 2115 done 2116 IFS="$save_ifs" 2117 fi 2118 2119 # Create $newlib 2120 if test -f "$output_objdir/$newlib"; then :; else 2121 $show "generating import library for \`$soname'" 2122 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' 2123 eval cmds=\"$old_archive_from_expsyms_cmds\" 2124 for cmd in $cmds; do 2125 IFS="$save_ifs" 2126 $show "$cmd" 2127 $run eval "$cmd" || exit $? 2128 done 2129 IFS="$save_ifs" 2130 fi 2131 # make sure the library variables are pointing to the new library 2132 dir=$output_objdir 2133 linklib=$newlib 2134 fi 2135 2136 if test $linkmode = prog || test "$mode" != relink; then 2137 add_shlibpath= 2138 add_dir= 2139 add= 2140 lib_linked=yes 2141 case $hardcode_action in 2142 immediate | unsupported) 2143 if test "$hardcode_direct" = no; then 2144 add="$dir/$linklib" 2145 elif test "$hardcode_minus_L" = no; then 2146 case $host in 2147 *-*-sunos*) add_shlibpath="$dir" ;; 2148 esac 2149 add_dir="-L$dir" 2150 add="-l$name" 2151 elif test "$hardcode_shlibpath_var" = no; then 2152 add_shlibpath="$dir" 2153 add="-l$name" 2154 else 2155 lib_linked=no 2156 fi 2157 ;; 2158 relink) 2159 if test "$hardcode_direct" = yes; then 2160 add="$dir/$linklib" 2161 elif test "$hardcode_minus_L" = yes; then 2162 add_dir="-L$dir" 2163 add="-l$name" 2164 elif test "$hardcode_shlibpath_var" = yes; then 2165 add_shlibpath="$dir" 2166 add="-l$name" 2167 else 2168 lib_linked=no 2169 fi 2170 ;; 2171 *) lib_linked=no ;; 2172 esac 2173 2174 if test "$lib_linked" != yes; then 2175 $echo "$modename: configuration error: unsupported hardcode properties" 2176 exit 1 2177 fi 2178 2179 if test -n "$add_shlibpath"; then 2180 case :$compile_shlibpath: in 2181 *":$add_shlibpath:"*) ;; 2182 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; 2183 esac 2184 fi 2185 if test $linkmode = prog; then 2186 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" 2187 test -n "$add" && compile_deplibs="$add $compile_deplibs" 2188 else 2189 test -n "$add_dir" && deplibs="$add_dir $deplibs" 2190 test -n "$add" && deplibs="$add $deplibs" 2191 if test "$hardcode_direct" != yes && \ 2192 test "$hardcode_minus_L" != yes && \ 2193 test "$hardcode_shlibpath_var" = yes; then 2194 case :$finalize_shlibpath: in 2195 *":$libdir:"*) ;; 2196 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; 2197 esac 2198 fi 2199 fi 2200 fi 2201 2202 if test $linkmode = prog || test "$mode" = relink; then 2203 add_shlibpath= 2204 add_dir= 2205 add= 2206 # Finalize command for both is simple: just hardcode it. 2207 if test "$hardcode_direct" = yes; then 2208 add="$libdir/$linklib" 2209 elif test "$hardcode_minus_L" = yes; then 2210 add_dir="-L$libdir" 2211 add="-l$name" 2212 elif test "$hardcode_shlibpath_var" = yes; then 2213 case :$finalize_shlibpath: in 2214 *":$libdir:"*) ;; 2215 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; 2216 esac 2217 add="-l$name" 2218 else 2219 # We cannot seem to hardcode it, guess we'll fake it. 2220 add_dir="-L$libdir" 2221 add="-l$name" 2222 fi 2223 2224 if test $linkmode = prog; then 2225 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" 2226 test -n "$add" && finalize_deplibs="$add $finalize_deplibs" 2227 else 2228 test -n "$add_dir" && deplibs="$add_dir $deplibs" 2229 test -n "$add" && deplibs="$add $deplibs" 2230 fi 2231 fi 2232 elif test $linkmode = prog; then 2233 # Here we assume that one of hardcode_direct or hardcode_minus_L 2234 # is not unsupported. This is valid on all known static and 2235 # shared platforms. 2236 if test "$hardcode_direct" != unsupported; then 2237 test -n "$old_library" && linklib="$old_library" 2238 compile_deplibs="$dir/$linklib $compile_deplibs" 2239 finalize_deplibs="$dir/$linklib $finalize_deplibs" 2240 else 2241 compile_deplibs="-l$name -L$dir $compile_deplibs" 2242 finalize_deplibs="-l$name -L$dir $finalize_deplibs" 2243 fi 2244 elif test "$build_libtool_libs" = yes; then 2245 # Not a shared library 2246 if test "$deplibs_check_method" != pass_all; then 2247 # We're trying link a shared library against a static one 2248 # but the system doesn't support it. 2249 # Just print a warning and add the library to dependency_libs so 2250 # that the program can be linked against the static library. 2251 echo 2252 echo "*** Warning: This library needs some functionality provided by $lib." 2253 echo "*** I have the capability to make that library automatically link in when" 2254 echo "*** you link to this library. But I can only do this if you have a" 2255 echo "*** shared version of the library, which you do not appear to have." 2256 else 2257 convenience="$convenience $dir/$old_library" 2258 old_convenience="$old_convenience $dir/$old_library" 2259 deplibs="$dir/$old_library $deplibs" 2260 link_static=yes 2261 fi 2262 fi 2263 2264 if test $linkmode = lib; then 2265 if test -n "$dependency_libs" && 2266 { test $hardcode_into_libs != yes || test $build_old_libs = yes || 2267 test $link_static = yes; }; then 2268 # Extract -R from dependency_libs 2269 temp_deplibs= 2270 for libdir in $dependency_libs; do 2271 case $libdir in 2272 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` 2273 case " $xrpath " in 2274 *" $temp_xrpath "*) ;; 2275 *) xrpath="$xrpath $temp_xrpath";; 2276 esac;; 2277 *) temp_deplibs="$temp_deplibs $libdir";; 2278 esac 2279 done 2280 dependency_libs="$temp_deplibs" 2281 fi 2282 2283 newlib_search_path="$newlib_search_path $absdir" 2284 # Link against this library 2285 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" 2286 # ... and its dependency_libs 2287 tmp_libs= 2288 for deplib in $dependency_libs; do 2289 newdependency_libs="$deplib $newdependency_libs" 2290 case "$tmp_libs " in 2291 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; 2292 esac 2293 tmp_libs="$tmp_libs $deplib" 2294 done 2295 2296 if test $link_all_deplibs != no; then 2297 # Add the search paths of all dependency libraries 2298 for deplib in $dependency_libs; do 2299 case $deplib in 2300 -L*) path="$deplib" ;; 2301 *.la) 2302 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` 2303 test "X$dir" = "X$deplib" && dir="." 2304 # We need an absolute path. 2305 case $dir in 2306 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; 2307 *) 2308 absdir=`cd "$dir" && pwd` 2309 if test -z "$absdir"; then 2310 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 2311 absdir="$dir" 2312 fi 2313 ;; 2314 esac 2315 if grep "^installed=no" $deplib > /dev/null; then 2316 path="-L$absdir/$objdir" 2317 else 2318 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` 2319 if test -z "$libdir"; then 2320 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 2321 exit 1 2322 fi 2323 if test "$absdir" != "$libdir"; then 2324 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 2325 fi 2326 path="-L$absdir" 2327 fi 2328 ;; 2329 *) continue ;; 2330 esac 2331 case " $deplibs " in 2332 *" $path "*) ;; 2333 *) deplibs="$path $deplibs" ;; 2334 esac 2335 done 2336 fi 2337 fi 2338 done 2339 dependency_libs="$newdependency_libs" 2340 if test $pass = dlpreopen; then 2341 # Link the dlpreopened libraries before other libraries 2342 for deplib in $save_deplibs; do 2343 deplibs="$deplib $deplibs" 2344 done 2345 fi 2346 if test $pass != dlopen; then 2347 if test $pass != conv; then 2348 # Make sure lib_search_path contains only unique directories. 2349 lib_search_path= 2350 for dir in $newlib_search_path; do 2351 case "$lib_search_path " in 2352 *" $dir "*) ;; 2353 *) lib_search_path="$lib_search_path $dir" ;; 2354 esac 2355 done 2356 newlib_search_path= 2357 fi 2358 2359 if test "$linkmode,$pass" != "prog,link"; then 2360 vars="deplibs" 2361 else 2362 vars="compile_deplibs finalize_deplibs" 2363 fi 2364 for var in $vars dependency_libs; do 2365 # Make sure that $var contains only unique libraries 2366 # and add them in reverse order 2367 eval tmp_libs=\"\$$var\" 2368 new_libs= 2369 for deplib in $tmp_libs; do 2370 case "$deplib" in 2371 -L*) new_libs="$deplib $new_libs" ;; 2372 *) 2373 case " $specialdeplibs " in 2374 *" $deplib "*) new_libs="$deplib $new_libs" ;; 2375 *) 2376 case " $new_libs " in 2377 *" $deplib "*) ;; 2378 *) new_libs="$deplib $new_libs" ;; 2379 esac 2380 ;; 2381 esac 2382 ;; 2383 esac 2384 done 2385 tmp_libs= 2386 for deplib in $new_libs; do 2387 case $deplib in 2388 -L*) 2389 case " $tmp_libs " in 2390 *" $deplib "*) ;; 2391 *) tmp_libs="$tmp_libs $deplib" ;; 2392 esac 2393 ;; 2394 *) tmp_libs="$tmp_libs $deplib" ;; 2395 esac 2396 done 2397 eval $var=\"$tmp_libs\" 2398 done 2399 fi 2400 done 2401 if test $linkmode = prog; then 2402 dlfiles="$newdlfiles" 2403 dlprefiles="$newdlprefiles" 2404 fi 2405 2406 case $linkmode in 2407 oldlib) 2408 if test -n "$deplibs"; then 2409 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 2410 fi 2411 2412 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then 2413 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 2414 fi 2415 2416 if test -n "$rpath"; then 2417 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 2418 fi 2419 2420 if test -n "$xrpath"; then 2421 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 2422 fi 2423 2424 if test -n "$vinfo"; then 2425 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2 2426 fi 2427 2428 if test -n "$release"; then 2429 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 2430 fi 2431 2432 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then 2433 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 2434 fi 2435 2436 # Now set the variables for building old libraries. 2437 build_libtool_libs=no 2438 oldlibs="$output" 2439 objs="$objs$old_deplibs" 2440 ;; 2441 2442 lib) 2443 # Make sure we only generate libraries of the form `libNAME.la'. 2444 case $outputname in 2445 lib*) 2446 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` 2447 eval libname=\"$libname_spec\" 2448 ;; 2449 *) 2450 if test "$module" = no; then 2451 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 2452 $echo "$help" 1>&2 2453 exit 1 2454 fi 2455 if test "$need_lib_prefix" != no; then 2456 # Add the "lib" prefix for modules if required 2457 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` 2458 eval libname=\"$libname_spec\" 2459 else 2460 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` 2461 fi 2462 ;; 2463 esac 2464 2465 if test -n "$objs"; then 2466 if test "$deplibs_check_method" != pass_all; then 2467 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 2468 exit 1 2469 else 2470 echo 2471 echo "*** Warning: Linking the shared library $output against the non-libtool" 2472 echo "*** objects $objs is not portable!" 2473 libobjs="$libobjs $objs" 2474 fi 2475 fi 2476 2477 if test "$dlself" != no; then 2478 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 2479 fi 2480 2481 set dummy $rpath 2482 if test $# -gt 2; then 2483 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 2484 fi 2485 install_libdir="$2" 2486 2487 oldlibs= 2488 if test -z "$rpath"; then 2489 if test "$build_libtool_libs" = yes; then 2490 # Building a libtool convenience library. 2491 # Some compilers have problems with a `.al' extension so 2492 # convenience libraries should have the same extension an 2493 # archive normally would. 2494 oldlibs="$output_objdir/$libname.$libext $oldlibs" 2495 build_libtool_libs=convenience 2496 build_old_libs=yes 2497 fi 2498 2499 if test -n "$vinfo"; then 2500 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2 2501 fi 2502 2503 if test -n "$release"; then 2504 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 2505 fi 2506 else 2507 2508 # Parse the version information argument. 2509 IFS="${IFS= }"; save_ifs="$IFS"; IFS=':' 2510 set dummy $vinfo 0 0 0 2511 IFS="$save_ifs" 2512 2513 if test -n "$8"; then 2514 $echo "$modename: too many parameters to \`-version-info'" 1>&2 2515 $echo "$help" 1>&2 2516 exit 1 2517 fi 2518 2519 current="$2" 2520 revision="$3" 2521 age="$4" 2522 2523 # Check that each of the things are valid numbers. 2524 case $current in 2525 0 | [1-9] | [1-9][0-9]*) ;; 2526 *) 2527 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 2528 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 2529 exit 1 2530 ;; 2531 esac 2532 2533 case $revision in 2534 0 | [1-9] | [1-9][0-9]*) ;; 2535 *) 2536 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 2537 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 2538 exit 1 2539 ;; 2540 esac 2541 2542 case $age in 2543 0 | [1-9] | [1-9][0-9]*) ;; 2544 *) 2545 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 2546 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 2547 exit 1 2548 ;; 2549 esac 2550 2551 if test $age -gt $current; then 2552 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 2553 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 2554 exit 1 2555 fi 2556 2557 # Calculate the version variables. 2558 major= 2559 versuffix= 2560 verstring= 2561 case $version_type in 2562 none) ;; 2563 2564 darwin) 2565 # Like Linux, but with the current version available in 2566 # verstring for coding it into the library header 2567 major=.`expr $current - $age` 2568 versuffix="$major.$age.$revision" 2569 # Darwin ld doesn't like 0 for these options... 2570 minor_current=`expr $current + 1` 2571 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" 2572 ;; 2573 2574 freebsd-aout) 2575 major=".$current" 2576 versuffix=".$current.$revision"; 2577 ;; 2578 2579 freebsd-elf) 2580 major=".$current" 2581 versuffix=".$current"; 2582 ;; 2583 2584 irix) 2585 major=`expr $current - $age + 1` 2586 verstring="sgi$major.$revision" 2587 2588 # Add in all the interfaces that we are compatible with. 2589 loop=$revision 2590 while test $loop != 0; do 2591 iface=`expr $revision - $loop` 2592 loop=`expr $loop - 1` 2593 verstring="sgi$major.$iface:$verstring" 2594 done 2595 2596 # Before this point, $major must not contain `.'. 2597 major=.$major 2598 versuffix="$major.$revision" 2599 ;; 2600 2601 linux) 2602 major=.`expr $current - $age` 2603 versuffix="$major.$age.$revision" 2604 ;; 2605 2606 osf) 2607 major=`expr $current - $age` 2608 versuffix=".$current.$age.$revision" 2609 verstring="$current.$age.$revision" 2610 2611 # Add in all the interfaces that we are compatible with. 2612 loop=$age 2613 while test $loop != 0; do 2614 iface=`expr $current - $loop` 2615 loop=`expr $loop - 1` 2616 verstring="$verstring:${iface}.0" 2617 done 2618 2619 # Make executables depend on our current version. 2620 verstring="$verstring:${current}.0" 2621 ;; 2622 2623 sunos) 2624 major=".$current" 2625 versuffix=".$current.$revision" 2626 ;; 2627 2628 windows) 2629 # Use '-' rather than '.', since we only want one 2630 # extension on DOS 8.3 filesystems. 2631 major=`expr $current - $age` 2632 versuffix="-$major" 2633 ;; 2634 2635 *) 2636 $echo "$modename: unknown library version type \`$version_type'" 1>&2 2637 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 2638 exit 1 2639 ;; 2640 esac 2641 2642 # Clear the version info if we defaulted, and they specified a release. 2643 if test -z "$vinfo" && test -n "$release"; then 2644 major= 2645 verstring="0.0" 2646 if test "$need_version" = no; then 2647 versuffix= 2648 else 2649 versuffix=".0.0" 2650 fi 2651 fi 2652 2653 # Remove version info from name if versioning should be avoided 2654 if test "$avoid_version" = yes && test "$need_version" = no; then 2655 major= 2656 versuffix= 2657 verstring="" 2658 fi 2659 2660 # Check to see if the archive will have undefined symbols. 2661 if test "$allow_undefined" = yes; then 2662 if test "$allow_undefined_flag" = unsupported; then 2663 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 2664 build_libtool_libs=no 2665 build_old_libs=yes 2666 fi 2667 else 2668 # Don't allow undefined symbols. 2669 allow_undefined_flag="$no_undefined_flag" 2670 fi 2671 fi 2672 2673 if test "$mode" != relink; then 2674 # Remove our outputs, but don't remove object files since they 2675 # may have been created when compiling PIC objects. 2676 removelist= 2677 tempremovelist=`echo "$output_objdir/*"` 2678 for p in $tempremovelist; do 2679 case $p in 2680 *.$objext) 2681 ;; 2682 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) 2683 removelist="$removelist $p" 2684 ;; 2685 *) ;; 2686 esac 2687 done 2688 if test -n "$removelist"; then 2689 $show "${rm}r $removelist" 2690 $run ${rm}r $removelist 2691 fi 2692 fi 2693 2694 # Now set the variables for building old libraries. 2695 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then 2696 oldlibs="$oldlibs $output_objdir/$libname.$libext" 2697 2698 # Transform .lo files to .o files. 2699 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` 2700 fi 2701 2702 # Eliminate all temporary directories. 2703 for path in $uninst_path; do 2704 lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'` 2705 deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'` 2706 dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'` 2707 done 2708 2709 if test -n "$xrpath"; then 2710 # If the user specified any rpath flags, then add them. 2711 temp_xrpath= 2712 for libdir in $xrpath; do 2713 temp_xrpath="$temp_xrpath -R$libdir" 2714 case "$finalize_rpath " in 2715 *" $libdir "*) ;; 2716 *) finalize_rpath="$finalize_rpath $libdir" ;; 2717 esac 2718 done 2719 if test $hardcode_into_libs != yes || test $build_old_libs = yes; then 2720 dependency_libs="$temp_xrpath $dependency_libs" 2721 fi 2722 fi 2723 2724 # Make sure dlfiles contains only unique files that won't be dlpreopened 2725 old_dlfiles="$dlfiles" 2726 dlfiles= 2727 for lib in $old_dlfiles; do 2728 case " $dlprefiles $dlfiles " in 2729 *" $lib "*) ;; 2730 *) dlfiles="$dlfiles $lib" ;; 2731 esac 2732 done 2733 2734 # Make sure dlprefiles contains only unique files 2735 old_dlprefiles="$dlprefiles" 2736 dlprefiles= 2737 for lib in $old_dlprefiles; do 2738 case "$dlprefiles " in 2739 *" $lib "*) ;; 2740 *) dlprefiles="$dlprefiles $lib" ;; 2741 esac 2742 done 2743 2744 if test "$build_libtool_libs" = yes; then 2745 if test -n "$rpath"; then 2746 case $host in 2747 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) 2748 # these systems don't actually have a c library (as such)! 2749 ;; 2750 *-*-rhapsody* | *-*-darwin1.[012]) 2751 # Rhapsody C library is in the System framework 2752 deplibs="$deplibs -framework System" 2753 ;; 2754 *) 2755 # Add libc to deplibs on all other systems if necessary. 2756 if test $build_libtool_need_lc = "yes"; then 2757 deplibs="$deplibs -lc" 2758 fi 2759 ;; 2760 esac 2761 fi 2762 2763 # Transform deplibs into only deplibs that can be linked in shared. 2764 name_save=$name 2765 libname_save=$libname 2766 release_save=$release 2767 versuffix_save=$versuffix 2768 major_save=$major 2769 # I'm not sure if I'm treating the release correctly. I think 2770 # release should show up in the -l (ie -lgmp5) so we don't want to 2771 # add it in twice. Is that correct? 2772 release="" 2773 versuffix="" 2774 major="" 2775 newdeplibs= 2776 droppeddeps=no 2777 case $deplibs_check_method in 2778 pass_all) 2779 # Don't check for shared/static. Everything works. 2780 # This might be a little naive. We might want to check 2781 # whether the library exists or not. But this is on 2782 # osf3 & osf4 and I'm not really sure... Just 2783 # implementing what was already the behaviour. 2784 newdeplibs=$deplibs 2785 ;; 2786 test_compile) 2787 # This code stresses the "libraries are programs" paradigm to its 2788 # limits. Maybe even breaks it. We compile a program, linking it 2789 # against the deplibs as a proxy for the library. Then we can check 2790 # whether they linked in statically or dynamically with ldd. 2791 $rm conftest.c 2792 cat > conftest.c <<EOF 2793 int main() { return 0; } 2794EOF 2795 $rm conftest 2796 $LTCC -o conftest conftest.c $deplibs 2797 if test $? -eq 0 ; then 2798 ldd_output=`ldd conftest` 2799 for i in $deplibs; do 2800 name="`expr $i : '-l\(.*\)'`" 2801 # If $name is empty we are operating on a -L argument. 2802 if test "$name" != "" -a "$name" != "0"; then 2803 libname=`eval \\$echo \"$libname_spec\"` 2804 deplib_matches=`eval \\$echo \"$library_names_spec\"` 2805 set dummy $deplib_matches 2806 deplib_match=$2 2807 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then 2808 newdeplibs="$newdeplibs $i" 2809 else 2810 droppeddeps=yes 2811 echo 2812 echo "*** Warning: This library needs some functionality provided by $i." 2813 echo "*** I have the capability to make that library automatically link in when" 2814 echo "*** you link to this library. But I can only do this if you have a" 2815 echo "*** shared version of the library, which you do not appear to have." 2816 fi 2817 else 2818 newdeplibs="$newdeplibs $i" 2819 fi 2820 done 2821 else 2822 # Error occured in the first compile. Let's try to salvage the situation: 2823 # Compile a seperate program for each library. 2824 for i in $deplibs; do 2825 name="`expr $i : '-l\(.*\)'`" 2826 # If $name is empty we are operating on a -L argument. 2827 if test "$name" != "" -a "$name" != "0"; then 2828 $rm conftest 2829 $LTCC -o conftest conftest.c $i 2830 # Did it work? 2831 if test $? -eq 0 ; then 2832 ldd_output=`ldd conftest` 2833 libname=`eval \\$echo \"$libname_spec\"` 2834 deplib_matches=`eval \\$echo \"$library_names_spec\"` 2835 set dummy $deplib_matches 2836 deplib_match=$2 2837 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then 2838 newdeplibs="$newdeplibs $i" 2839 else 2840 droppeddeps=yes 2841 echo 2842 echo "*** Warning: This library needs some functionality provided by $i." 2843 echo "*** I have the capability to make that library automatically link in when" 2844 echo "*** you link to this library. But I can only do this if you have a" 2845 echo "*** shared version of the library, which you do not appear to have." 2846 fi 2847 else 2848 droppeddeps=yes 2849 echo 2850 echo "*** Warning! Library $i is needed by this library but I was not able to" 2851 echo "*** make it link in! You will probably need to install it or some" 2852 echo "*** library that it depends on before this library will be fully" 2853 echo "*** functional. Installing it before continuing would be even better." 2854 fi 2855 else 2856 newdeplibs="$newdeplibs $i" 2857 fi 2858 done 2859 fi 2860 ;; 2861 file_magic*) 2862 set dummy $deplibs_check_method 2863 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 2864 for a_deplib in $deplibs; do 2865 name="`expr $a_deplib : '-l\(.*\)'`" 2866 # If $name is empty we are operating on a -L argument. 2867 if test "$name" != "" -a "$name" != "0"; then 2868 libname=`eval \\$echo \"$libname_spec\"` 2869 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do 2870 potential_libs=`ls $i/$libname[.-]* 2>/dev/null` 2871 for potent_lib in $potential_libs; do 2872 # Follow soft links. 2873 if ls -lLd "$potent_lib" 2>/dev/null \ 2874 | grep " -> " >/dev/null; then 2875 continue 2876 fi 2877 # The statement above tries to avoid entering an 2878 # endless loop below, in case of cyclic links. 2879 # We might still enter an endless loop, since a link 2880 # loop can be closed while we follow links, 2881 # but so what? 2882 potlib="$potent_lib" 2883 while test -h "$potlib" 2>/dev/null; do 2884 potliblink=`ls -ld $potlib | sed 's/.* -> //'` 2885 case $potliblink in 2886 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; 2887 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; 2888 esac 2889 done 2890 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ 2891 | sed 10q \ 2892 | egrep "$file_magic_regex" > /dev/null; then 2893 newdeplibs="$newdeplibs $a_deplib" 2894 a_deplib="" 2895 break 2 2896 fi 2897 done 2898 done 2899 if test -n "$a_deplib" ; then 2900 droppeddeps=yes 2901 echo 2902 echo "*** Warning: This library needs some functionality provided by $a_deplib." 2903 echo "*** I have the capability to make that library automatically link in when" 2904 echo "*** you link to this library. But I can only do this if you have a" 2905 echo "*** shared version of the library, which you do not appear to have." 2906 fi 2907 else 2908 # Add a -L argument. 2909 newdeplibs="$newdeplibs $a_deplib" 2910 fi 2911 done # Gone through all deplibs. 2912 ;; 2913 none | unknown | *) 2914 newdeplibs="" 2915 if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ 2916 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' | 2917 grep . >/dev/null; then 2918 echo 2919 if test "X$deplibs_check_method" = "Xnone"; then 2920 echo "*** Warning: inter-library dependencies are not supported in this platform." 2921 else 2922 echo "*** Warning: inter-library dependencies are not known to be supported." 2923 fi 2924 echo "*** All declared inter-library dependencies are being dropped." 2925 droppeddeps=yes 2926 fi 2927 ;; 2928 esac 2929 versuffix=$versuffix_save 2930 major=$major_save 2931 release=$release_save 2932 libname=$libname_save 2933 name=$name_save 2934 2935 if test "$droppeddeps" = yes; then 2936 if test "$module" = yes; then 2937 echo 2938 echo "*** Warning: libtool could not satisfy all declared inter-library" 2939 echo "*** dependencies of module $libname. Therefore, libtool will create" 2940 echo "*** a static module, that should work as long as the dlopening" 2941 echo "*** application is linked with the -dlopen flag." 2942 if test -z "$global_symbol_pipe"; then 2943 echo 2944 echo "*** However, this would only work if libtool was able to extract symbol" 2945 echo "*** lists from a program, using \`nm' or equivalent, but libtool could" 2946 echo "*** not find such a program. So, this module is probably useless." 2947 echo "*** \`nm' from GNU binutils and a full rebuild may help." 2948 fi 2949 if test "$build_old_libs" = no; then 2950 oldlibs="$output_objdir/$libname.$libext" 2951 build_libtool_libs=module 2952 build_old_libs=yes 2953 else 2954 build_libtool_libs=no 2955 fi 2956 else 2957 echo "*** The inter-library dependencies that have been dropped here will be" 2958 echo "*** automatically added whenever a program is linked with this library" 2959 echo "*** or is declared to -dlopen it." 2960 2961 if test $allow_undefined = no; then 2962 echo 2963 echo "*** Since this library must not contain undefined symbols," 2964 echo "*** because either the platform does not support them or" 2965 echo "*** it was explicitly requested with -no-undefined," 2966 echo "*** libtool will only create a static version of it." 2967 if test "$build_old_libs" = no; then 2968 oldlibs="$output_objdir/$libname.$libext" 2969 build_libtool_libs=module 2970 build_old_libs=yes 2971 else 2972 build_libtool_libs=no 2973 fi 2974 fi 2975 fi 2976 fi 2977 # Done checking deplibs! 2978 deplibs=$newdeplibs 2979 fi 2980 2981 # All the library-specific variables (install_libdir is set above). 2982 library_names= 2983 old_library= 2984 dlname= 2985 2986 # Test again, we may have decided not to build it any more 2987 if test "$build_libtool_libs" = yes; then 2988 if test $hardcode_into_libs = yes; then 2989 # Hardcode the library paths 2990 hardcode_libdirs= 2991 dep_rpath= 2992 rpath="$finalize_rpath" 2993 test "$mode" != relink && rpath="$compile_rpath$rpath" 2994 for libdir in $rpath; do 2995 if test -n "$hardcode_libdir_flag_spec"; then 2996 if test -n "$hardcode_libdir_separator"; then 2997 if test -z "$hardcode_libdirs"; then 2998 hardcode_libdirs="$libdir" 2999 else 3000 # Just accumulate the unique libdirs. 3001 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in 3002 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) 3003 ;; 3004 *) 3005 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" 3006 ;; 3007 esac 3008 fi 3009 else 3010 eval flag=\"$hardcode_libdir_flag_spec\" 3011 dep_rpath="$dep_rpath $flag" 3012 fi 3013 elif test -n "$runpath_var"; then 3014 case "$perm_rpath " in 3015 *" $libdir "*) ;; 3016 *) perm_rpath="$perm_rpath $libdir" ;; 3017 esac 3018 fi 3019 done 3020 # Substitute the hardcoded libdirs into the rpath. 3021 if test -n "$hardcode_libdir_separator" && 3022 test -n "$hardcode_libdirs"; then 3023 libdir="$hardcode_libdirs" 3024 eval dep_rpath=\"$hardcode_libdir_flag_spec\" 3025 fi 3026 if test -n "$runpath_var" && test -n "$perm_rpath"; then 3027 # We should set the runpath_var. 3028 rpath= 3029 for dir in $perm_rpath; do 3030 rpath="$rpath$dir:" 3031 done 3032 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" 3033 fi 3034 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" 3035 fi 3036 3037 shlibpath="$finalize_shlibpath" 3038 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" 3039 if test -n "$shlibpath"; then 3040 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" 3041 fi 3042 3043 # Get the real and link names of the library. 3044 eval library_names=\"$library_names_spec\" 3045 set dummy $library_names 3046 realname="$2" 3047 shift; shift 3048 3049 if test -n "$soname_spec"; then 3050 eval soname=\"$soname_spec\" 3051 else 3052 soname="$realname" 3053 fi 3054 if test x$dlname = x; then 3055 dlname=$soname 3056 fi 3057 3058 lib="$output_objdir/$realname" 3059 for link 3060 do 3061 linknames="$linknames $link" 3062 done 3063 3064# # Ensure that we have .o objects for linkers which dislike .lo 3065# # (e.g. aix) in case we are running --disable-static 3066# for obj in $libobjs; do 3067# xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` 3068# if test "X$xdir" = "X$obj"; then 3069# xdir="." 3070# else 3071# xdir="$xdir" 3072# fi 3073# baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` 3074# oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` 3075# if test ! -f $xdir/$oldobj && test "$baseobj" != "$oldobj"; then 3076# $show "(cd $xdir && ${LN_S} $baseobj $oldobj)" 3077# $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $? 3078# fi 3079# done 3080 3081 # Use standard objects if they are pic 3082 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` 3083 3084 # Prepare the list of exported symbols 3085 if test -z "$export_symbols"; then 3086 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then 3087 $show "generating symbol list for \`$libname.la'" 3088 export_symbols="$output_objdir/$libname.exp" 3089 $run $rm $export_symbols 3090 eval cmds=\"$export_symbols_cmds\" 3091 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' 3092 for cmd in $cmds; do 3093 IFS="$save_ifs" 3094 $show "$cmd" 3095 $run eval "$cmd" || exit $? 3096 done 3097 IFS="$save_ifs" 3098 if test -n "$export_symbols_regex"; then 3099 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" 3100 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' 3101 $show "$mv \"${export_symbols}T\" \"$export_symbols\"" 3102 $run eval '$mv "${export_symbols}T" "$export_symbols"' 3103 fi 3104 fi 3105 fi 3106 3107 if test -n "$export_symbols" && test -n "$include_expsyms"; then 3108 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' 3109 fi 3110 3111 if test -n "$convenience"; then 3112 if test -n "$whole_archive_flag_spec"; then 3113 save_libobjs=$libobjs 3114 eval libobjs=\"\$libobjs $whole_archive_flag_spec\" 3115 else 3116 gentop="$output_objdir/${outputname}x" 3117 $show "${rm}r $gentop" 3118 $run ${rm}r "$gentop" 3119 $show "$mkdir $gentop" 3120 $run $mkdir "$gentop" 3121 status=$? 3122 if test $status -ne 0 && test ! -d "$gentop"; then 3123 exit $status 3124 fi 3125 generated="$generated $gentop" 3126 3127 for xlib in $convenience; do 3128 # Extract the objects. 3129 case $xlib in 3130 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; 3131 *) xabs=`pwd`"/$xlib" ;; 3132 esac 3133 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` 3134 xdir="$gentop/$xlib" 3135 3136 $show "${rm}r $xdir" 3137 $run ${rm}r "$xdir" 3138 $show "$mkdir $xdir" 3139 $run $mkdir "$xdir" 3140 status=$? 3141 if test $status -ne 0 && test ! -d "$xdir"; then 3142 exit $status 3143 fi 3144 $show "(cd $xdir && $AR x $xabs)" 3145 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? 3146 3147 libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` 3148 done 3149 fi 3150 fi 3151 3152 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then 3153 eval flag=\"$thread_safe_flag_spec\" 3154 linker_flags="$linker_flags $flag" 3155 fi 3156 3157 # Make a backup of the uninstalled library when relinking 3158 if test "$mode" = relink && test "$hardcode_into_libs" = all; then 3159 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? 3160 fi 3161 3162 # Add all flags from the command line. We here create a library, 3163 # but those flags were only added to compile_command and 3164 # finalize_command, which are only used when creating executables. 3165 # So do it by hand here. 3166 compiler_flags="$compiler_flags $add_flags" 3167 # Only add it to commands which use CC, instead of LD, i.e. 3168 # only to $compiler_flags 3169 #linker_flags="$linker_flags $add_flags" 3170 3171 # Do each of the archive commands. 3172 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then 3173 eval cmds=\"$archive_expsym_cmds\" 3174 else 3175 eval cmds=\"$archive_cmds\" 3176 fi 3177 if len=`expr "X$cmds" : ".*"` && 3178 test $len -le $max_cmd_len; then 3179 : 3180 else 3181 # The command line is too long to link in one step, link piecewise. 3182 $echo "creating reloadable object files..." 3183 3184 # Save the value of $output and $libobjs because we want to 3185 # use them later. If we have whole_archive_flag_spec, we 3186 # want to use save_libobjs as it was before 3187 # whole_archive_flag_spec was expanded, because we can't 3188 # assume the linker understands whole_archive_flag_spec. 3189 # This may have to be revisited, in case too many 3190 # convenience libraries get linked in and end up exceeding 3191 # the spec. 3192 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then 3193 save_libobjs=$libobjs 3194 fi 3195 save_output=$output 3196 3197 # Clear the reloadable object creation command queue and 3198 # initialize k to one. 3199 test_cmds= 3200 concat_cmds= 3201 objlist= 3202 delfiles= 3203 last_robj= 3204 k=1 3205 output=$output_objdir/$save_output-${k}.$objext 3206 # Loop over the list of objects to be linked. 3207 for obj in $save_libobjs 3208 do 3209 eval test_cmds=\"$reload_cmds $objlist $last_robj\" 3210 if test "X$objlist" = X || 3211 { len=`expr "X$test_cmds" : ".*"` && 3212 test $len -le $max_cmd_len; }; then 3213 objlist="$objlist $obj" 3214 else 3215 # The command $test_cmds is almost too long, add a 3216 # command to the queue. 3217 if test $k -eq 1 ; then 3218 # The first file doesn't have a previous command to add. 3219 eval concat_cmds=\"$reload_cmds $objlist $last_robj\" 3220 else 3221 # All subsequent reloadable object files will link in 3222 # the last one created. 3223 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" 3224 fi 3225 last_robj=$output_objdir/$save_output-${k}.$objext 3226 k=`expr $k + 1` 3227 output=$output_objdir/$save_output-${k}.$objext 3228 objlist=$obj 3229 len=1 3230 fi 3231 done 3232 # Handle the remaining objects by creating one last 3233 # reloadable object file. All subsequent reloadable object 3234 # files will link in the last one created. 3235 test -z "$concat_cmds" || concat_cmds=$concat_cmds~ 3236 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" 3237 3238 # Set up a command to remove the reloadale object files 3239 # after they are used. 3240 i=0 3241 while test $i -lt $k 3242 do 3243 i=`expr $i + 1` 3244 delfiles="$delfiles $output_objdir/$save_output-${i}.$objext" 3245 done 3246 3247 $echo "creating a temporary reloadable object file: $output" 3248 3249 # Loop through the commands generated above and execute them. 3250 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' 3251 for cmd in $concat_cmds; do 3252 IFS="$save_ifs" 3253 $show "$cmd" 3254 $run eval "$cmd" || exit $? 3255 done 3256 IFS="$save_ifs" 3257 3258 libobjs=$output 3259 # Restore the value of output. 3260 output=$save_output 3261 3262 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then 3263 eval libobjs=\"\$libobjs $whole_archive_flag_spec\" 3264 fi 3265 # Expand the library linking commands again to reset the 3266 # value of $libobjs for piecewise linking. 3267 3268 # Do each of the archive commands. 3269 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then 3270 eval cmds=\"$archive_expsym_cmds\" 3271 else 3272 eval cmds=\"$archive_cmds\" 3273 fi 3274 3275 # Append the command to remove the reloadable object files 3276 # to the just-reset $cmds. 3277 eval cmds=\"\$cmds~$rm $delfiles\" 3278 fi 3279 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' 3280 for cmd in $cmds; do 3281 IFS="$save_ifs" 3282 $show "$cmd" 3283 $run eval "$cmd" || exit $? 3284 done 3285 IFS="$save_ifs" 3286 3287 # Restore the uninstalled library and exit 3288 if test "$mode" = relink && test "$hardcode_into_libs" = all; then 3289 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? 3290 exit 0 3291 fi 3292 3293 # Create links to the real library. 3294 for linkname in $linknames; do 3295 if test "$realname" != "$linkname"; then 3296 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" 3297 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? 3298 fi 3299 done 3300 3301 # If -module or -export-dynamic was specified, set the dlname. 3302 if test "$module" = yes || test "$export_dynamic" = yes; then 3303 # On all known operating systems, these are identical. 3304 dlname="$soname" 3305 fi 3306 fi 3307 ;; 3308 3309 obj) 3310 if test -n "$deplibs"; then 3311 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 3312 fi 3313 3314 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then 3315 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 3316 fi 3317 3318 if test -n "$rpath"; then 3319 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 3320 fi 3321 3322 if test -n "$xrpath"; then 3323 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 3324 fi 3325 3326 if test -n "$vinfo"; then 3327 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 3328 fi 3329 3330 if test -n "$release"; then 3331 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 3332 fi 3333 3334 case $output in 3335 *.lo) 3336 if test -n "$objs$old_deplibs"; then 3337 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 3338 exit 1 3339 fi 3340 libobj="$output" 3341 obj=`$echo "X$output" | $Xsed -e "$lo2o"` 3342 ;; 3343 *) 3344 libobj= 3345 obj="$output" 3346 ;; 3347 esac 3348 3349 # Delete the old objects. 3350 $run $rm $obj $libobj 3351 3352 # Objects from convenience libraries. This assumes 3353 # single-version convenience libraries. Whenever we create 3354 # different ones for PIC/non-PIC, this we'll have to duplicate 3355 # the extraction. 3356 reload_conv_objs= 3357 gentop= 3358 # reload_cmds runs $LD directly, so let us get rid of 3359 # -Wl from whole_archive_flag_spec 3360 wl= 3361 3362 if test -n "$convenience"; then 3363 if test -n "$whole_archive_flag_spec"; then 3364 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" 3365 else 3366 gentop="$output_objdir/${obj}x" 3367 $show "${rm}r $gentop" 3368 $run ${rm}r "$gentop" 3369 $show "$mkdir $gentop" 3370 $run $mkdir "$gentop" 3371 status=$? 3372 if test $status -ne 0 && test ! -d "$gentop"; then 3373 exit $status 3374 fi 3375 generated="$generated $gentop" 3376 3377 for xlib in $convenience; do 3378 # Extract the objects. 3379 case $xlib in 3380 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; 3381 *) xabs=`pwd`"/$xlib" ;; 3382 esac 3383 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` 3384 xdir="$gentop/$xlib" 3385 3386 $show "${rm}r $xdir" 3387 $run ${rm}r "$xdir" 3388 $show "$mkdir $xdir" 3389 $run $mkdir "$xdir" 3390 status=$? 3391 if test $status -ne 0 && test ! -d "$xdir"; then 3392 exit $status 3393 fi 3394 $show "(cd $xdir && $AR x $xabs)" 3395 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? 3396 3397 reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` 3398 done 3399 fi 3400 fi 3401 3402 # Create the old-style object. 3403 reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test 3404 3405 output="$obj" 3406 eval cmds=\"$reload_cmds\" 3407 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' 3408 for cmd in $cmds; do 3409 IFS="$save_ifs" 3410 $show "$cmd" 3411 $run eval "$cmd" || exit $? 3412 done 3413 IFS="$save_ifs" 3414 3415 # Exit if we aren't doing a library object file. 3416 if test -z "$libobj"; then 3417 if test -n "$gentop"; then 3418 $show "${rm}r $gentop" 3419 $run ${rm}r $gentop 3420 fi 3421 3422 exit 0 3423 fi 3424 3425 if test "$build_libtool_libs" != yes; then 3426 if test -n "$gentop"; then 3427 $show "${rm}r $gentop" 3428 $run ${rm}r $gentop 3429 fi 3430 3431 # Create an invalid libtool object if no PIC, so that we don't 3432 # accidentally link it into a program. 3433 # $show "echo timestamp > $libobj" 3434 # $run eval "echo timestamp > $libobj" || exit $? 3435 exit 0 3436 fi 3437 3438 if test -n "$pic_flag" || test "$pic_mode" != default; then 3439 # Only do commands if we really have different PIC objects. 3440 reload_objs="$libobjs $reload_conv_objs" 3441 output="$libobj" 3442 eval cmds=\"$reload_cmds\" 3443 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' 3444 for cmd in $cmds; do 3445 IFS="$save_ifs" 3446 $show "$cmd" 3447 $run eval "$cmd" || exit $? 3448 done 3449 IFS="$save_ifs" 3450# else 3451# # Just create a symlink. 3452# $show $rm $libobj 3453# $run $rm $libobj 3454# xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` 3455# if test "X$xdir" = "X$libobj"; then 3456# xdir="." 3457# else 3458# xdir="$xdir" 3459# fi 3460# baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` 3461# oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` 3462# $show "(cd $xdir && $LN_S $oldobj $baseobj)" 3463# $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $? 3464 fi 3465 3466 if test -n "$gentop"; then 3467 $show "${rm}r $gentop" 3468 $run ${rm}r $gentop 3469 fi 3470 3471 exit 0 3472 ;; 3473 3474 prog) 3475 case $host in 3476 *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;; 3477 esac 3478 if test -n "$vinfo"; then 3479 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 3480 fi 3481 3482 if test -n "$release"; then 3483 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 3484 fi 3485 3486 if test "$preload" = yes; then 3487 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && 3488 test "$dlopen_self_static" = unknown; then 3489 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." 3490 fi 3491 fi 3492 3493 compile_command="$compile_command $compile_deplibs" 3494 finalize_command="$finalize_command $finalize_deplibs" 3495 3496 if test -n "$rpath$xrpath"; then 3497 # If the user specified any rpath flags, then add them. 3498 for libdir in $rpath $xrpath; do 3499 # This is the magic to use -rpath. 3500 case "$finalize_rpath " in 3501 *" $libdir "*) ;; 3502 *) finalize_rpath="$finalize_rpath $libdir" ;; 3503 esac 3504 done 3505 fi 3506 3507 # Now hardcode the library paths 3508 rpath= 3509 hardcode_libdirs= 3510 for libdir in $compile_rpath $finalize_rpath; do 3511 if test -n "$hardcode_libdir_flag_spec"; then 3512 if test -n "$hardcode_libdir_separator"; then 3513 if test -z "$hardcode_libdirs"; then 3514 hardcode_libdirs="$libdir" 3515 else 3516 # Just accumulate the unique libdirs. 3517 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in 3518 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) 3519 ;; 3520 *) 3521 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" 3522 ;; 3523 esac 3524 fi 3525 else 3526 eval flag=\"$hardcode_libdir_flag_spec\" 3527 rpath="$rpath $flag" 3528 fi 3529 elif test -n "$runpath_var"; then 3530 case "$perm_rpath " in 3531 *" $libdir "*) ;; 3532 *) perm_rpath="$perm_rpath $libdir" ;; 3533 esac 3534 fi 3535 case $host in 3536 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) 3537 case :$dllsearchpath: in 3538 *":$libdir:"*) ;; 3539 *) dllsearchpath="$dllsearchpath:$libdir";; 3540 esac 3541 ;; 3542 esac 3543 done 3544 # Substitute the hardcoded libdirs into the rpath. 3545 if test -n "$hardcode_libdir_separator" && 3546 test -n "$hardcode_libdirs"; then 3547 libdir="$hardcode_libdirs" 3548 eval rpath=\" $hardcode_libdir_flag_spec\" 3549 fi 3550 compile_rpath="$rpath" 3551 3552 rpath= 3553 hardcode_libdirs= 3554 for libdir in $finalize_rpath; do 3555 if test -n "$hardcode_libdir_flag_spec"; then 3556 if test -n "$hardcode_libdir_separator"; then 3557 if test -z "$hardcode_libdirs"; then 3558 hardcode_libdirs="$libdir" 3559 else 3560 # Just accumulate the unique libdirs. 3561 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in 3562 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) 3563 ;; 3564 *) 3565 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" 3566 ;; 3567 esac 3568 fi 3569 else 3570 eval flag=\"$hardcode_libdir_flag_spec\" 3571 rpath="$rpath $flag" 3572 fi 3573 elif test -n "$runpath_var"; then 3574 case "$finalize_perm_rpath " in 3575 *" $libdir "*) ;; 3576 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; 3577 esac 3578 fi 3579 done 3580 # Substitute the hardcoded libdirs into the rpath. 3581 if test -n "$hardcode_libdir_separator" && 3582 test -n "$hardcode_libdirs"; then 3583 libdir="$hardcode_libdirs" 3584 eval rpath=\" $hardcode_libdir_flag_spec\" 3585 fi 3586 finalize_rpath="$rpath" 3587 3588 dlsyms= 3589 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then 3590 if test -n "$NM" && test -n "$global_symbol_pipe"; then 3591 dlsyms="${outputname}S.c" 3592 else 3593 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 3594 fi 3595 fi 3596 3597 if test -n "$dlsyms"; then 3598 case $dlsyms in 3599 "") ;; 3600 *.c) 3601 # Discover the nlist of each of the dlfiles. 3602 nlist="$output_objdir/${outputname}.nm" 3603 3604 $show "$rm $nlist ${nlist}S ${nlist}T" 3605 $run $rm "$nlist" "${nlist}S" "${nlist}T" 3606 3607 # Parse the name list into a source file. 3608 $show "creating $output_objdir/$dlsyms" 3609 3610 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ 3611/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ 3612/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ 3613 3614#ifdef __cplusplus 3615extern \"C\" { 3616#endif 3617 3618/* Prevent the only kind of declaration conflicts we can make. */ 3619#define lt_preloaded_symbols some_other_symbol 3620 3621/* External symbol declarations for the compiler. */\ 3622" 3623 3624 if test "$dlself" = yes; then 3625 $show "generating symbol list for \`$output'" 3626 3627 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" 3628 3629 # Add our own program objects to the symbol list. 3630 progfiles="$objs$old_deplibs" 3631 for arg in $progfiles; do 3632 $show "extracting global C symbols from \`$arg'" 3633 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" 3634 done 3635 3636 if test -n "$exclude_expsyms"; then 3637 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' 3638 $run eval '$mv "$nlist"T "$nlist"' 3639 fi 3640 3641 if test -n "$export_symbols_regex"; then 3642 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T' 3643 $run eval '$mv "$nlist"T "$nlist"' 3644 fi 3645 3646 # Prepare the list of exported symbols 3647 if test -z "$export_symbols"; then 3648 export_symbols="$output_objdir/$output.exp" 3649 $run $rm $export_symbols 3650 $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' 3651 else 3652 $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' 3653 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' 3654 $run eval 'mv "$nlist"T "$nlist"' 3655 fi 3656 fi 3657 3658 for arg in $dlprefiles; do 3659 $show "extracting global C symbols from \`$arg'" 3660 name=`echo "$arg" | sed -e 's%^.*/%%'` 3661 $run eval 'echo ": $name " >> "$nlist"' 3662 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" 3663 done 3664 3665 if test -z "$run"; then 3666 # Make sure we have at least an empty file. 3667 test -f "$nlist" || : > "$nlist" 3668 3669 if test -n "$exclude_expsyms"; then 3670 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T 3671 $mv "$nlist"T "$nlist" 3672 fi 3673 3674 # Try sorting and uniquifying the output. 3675 if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then 3676 : 3677 else 3678 grep -v "^: " < "$nlist" > "$nlist"S 3679 fi 3680 3681 if test -f "$nlist"S; then 3682 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' 3683 else 3684 echo '/* NONE */' >> "$output_objdir/$dlsyms" 3685 fi 3686 3687 $echo >> "$output_objdir/$dlsyms" "\ 3688 3689#undef lt_preloaded_symbols 3690 3691#if defined (__STDC__) && __STDC__ 3692# define lt_ptr_t void * 3693#else 3694# define lt_ptr_t char * 3695# define const 3696#endif 3697 3698/* The mapping between symbol names and symbols. */ 3699const struct { 3700 const char *name; 3701 lt_ptr_t address; 3702} 3703lt_preloaded_symbols[] = 3704{\ 3705" 3706 3707 sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \ 3708 -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \ 3709 < "$nlist" >> "$output_objdir/$dlsyms" 3710 3711 $echo >> "$output_objdir/$dlsyms" "\ 3712 {0, (lt_ptr_t) 0} 3713}; 3714 3715/* This works around a problem in FreeBSD linker */ 3716#ifdef FREEBSD_WORKAROUND 3717static const void *lt_preloaded_setup() { 3718 return lt_preloaded_symbols; 3719} 3720#endif 3721 3722#ifdef __cplusplus 3723} 3724#endif\ 3725" 3726 fi 3727 3728 pic_flag_for_symtable= 3729 case $host in 3730 # compiling the symbol table file with pic_flag works around 3731 # a FreeBSD bug that causes programs to crash when -lm is 3732 # linked before any other PIC object. But we must not use 3733 # pic_flag when linking with -static. The problem exists in 3734 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. 3735 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) 3736 case "$compile_command " in 3737 *" -static "*) ;; 3738 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; 3739 esac;; 3740 *-*-hpux*) 3741 case "$compile_command " in 3742 *" -static "*) ;; 3743 *) pic_flag_for_symtable=" $pic_flag";; 3744 esac 3745 esac 3746 3747 # Now compile the dynamic symbol file. 3748 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" 3749 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? 3750 3751 # Clean up the generated files. 3752 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" 3753 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" 3754 3755 # Transform the symbol file into the correct name. 3756 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` 3757 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` 3758 ;; 3759 *) 3760 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 3761 exit 1 3762 ;; 3763 esac 3764 else 3765 # We keep going just in case the user didn't refer to 3766 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe 3767 # really was required. 3768 3769 # Nullify the symbol file. 3770 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` 3771 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` 3772 fi 3773 3774 # AIX runtime linking requires linking programs with -Wl,-brtl and libs with -Wl,-G 3775 # Also add -bnolibpath to the beginning of the link line, to clear the hardcoded runpath. 3776 # Otherwise, things like the -L path to libgcc.a are accidentally hardcoded by ld. 3777 # This does not apply on AIX for ia64, which uses a SysV linker. 3778 case "$host" in 3779 ia64-*-aix5*) ;; 3780 *-*-aix4* | *-*-aix5*) 3781 compile_command=`$echo "X$compile_command $wl-brtl" | $Xsed -e "s/\$CC/\$CC $wl-bnolibpath/1"` 3782 finalize_command=`$echo "X$finalize_command $wl-brtl" | $Xsed -e "s/\$CC/\$CC $wl-bnolibpath/1"` ;; 3783 esac 3784 3785 if test $need_relink = no || test "$build_libtool_libs" != yes; then 3786 # Replace the output file specification. 3787 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` 3788 link_command="$compile_command$compile_rpath" 3789 3790 # We have no uninstalled library dependencies, so finalize right now. 3791 $show "$link_command" 3792 $run eval "$link_command" 3793 status=$? 3794 3795 # Delete the generated files. 3796 if test -n "$dlsyms"; then 3797 $show "$rm $output_objdir/${outputname}S.${objext}" 3798 $run $rm "$output_objdir/${outputname}S.${objext}" 3799 fi 3800 3801 exit $status 3802 fi 3803 3804 if test -n "$shlibpath_var"; then 3805 # We should set the shlibpath_var 3806 rpath= 3807 for dir in $temp_rpath; do 3808 case $dir in 3809 [\\/]* | [A-Za-z]:[\\/]*) 3810 # Absolute path. 3811 rpath="$rpath$dir:" 3812 ;; 3813 *) 3814 # Relative path: add a thisdir entry. 3815 rpath="$rpath\$thisdir/$dir:" 3816 ;; 3817 esac 3818 done 3819 temp_rpath="$rpath" 3820 fi 3821 3822 if test -n "$compile_shlibpath$finalize_shlibpath"; then 3823 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" 3824 fi 3825 if test -n "$finalize_shlibpath"; then 3826 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" 3827 fi 3828 3829 compile_var= 3830 finalize_var= 3831 if test -n "$runpath_var"; then 3832 if test -n "$perm_rpath"; then 3833 # We should set the runpath_var. 3834 rpath= 3835 for dir in $perm_rpath; do 3836 rpath="$rpath$dir:" 3837 done 3838 compile_var="$runpath_var=\"$rpath\$$runpath_var\" " 3839 fi 3840 if test -n "$finalize_perm_rpath"; then 3841 # We should set the runpath_var. 3842 rpath= 3843 for dir in $finalize_perm_rpath; do 3844 rpath="$rpath$dir:" 3845 done 3846 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " 3847 fi 3848 fi 3849 3850 if test "$no_install" = yes; then 3851 # We don't need to create a wrapper script. 3852 link_command="$compile_var$compile_command$compile_rpath" 3853 # Replace the output file specification. 3854 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` 3855 # Delete the old output file. 3856 $run $rm $output 3857 # Link the executable and exit 3858 $show "$link_command" 3859 $run eval "$link_command" || exit $? 3860 exit 0 3861 fi 3862 3863 if test "$hardcode_action" = relink; then 3864 # Fast installation is not supported 3865 link_command="$compile_var$compile_command$compile_rpath" 3866 relink_command="$finalize_var$finalize_command$finalize_rpath" 3867 3868 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 3869 $echo "$modename: \`$output' will be relinked during installation" 1>&2 3870 else 3871 if test "$fast_install" != no; then 3872 link_command="$finalize_var$compile_command$finalize_rpath" 3873 if test "$fast_install" = yes; then 3874 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` 3875 else 3876 # fast_install is set to needless 3877 relink_command= 3878 fi 3879 else 3880 link_command="$compile_var$compile_command$compile_rpath" 3881 relink_command="$finalize_var$finalize_command$finalize_rpath" 3882 fi 3883 fi 3884 3885 # Replace the output file specification. 3886 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` 3887 3888 # Delete the old output files. 3889 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname 3890 3891 $show "$link_command" 3892 $run eval "$link_command" || exit $? 3893 3894 # Now create the wrapper script. 3895 $show "creating $output" 3896 3897 # Quote the relink command for shipping. 3898 if test -n "$relink_command"; then 3899 # Preserve any variables that may affect compiler behavior 3900 for var in $variables_saved_for_relink; do 3901 if eval test -z \"\${$var+set}\"; then 3902 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" 3903 elif eval var_value=\$$var; test -z "$var_value"; then 3904 relink_command="$var=; export $var; $relink_command" 3905 else 3906 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` 3907 relink_command="$var=\"$var_value\"; export $var; $relink_command" 3908 fi 3909 done 3910 relink_command="cd `pwd`; $relink_command" 3911 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` 3912 fi 3913 3914 # Quote $echo for shipping. 3915 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then 3916 case $0 in 3917 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; 3918 *) qecho="$SHELL `pwd`/$0 --fallback-echo";; 3919 esac 3920 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` 3921 else 3922 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` 3923 fi 3924 3925 # Only actually do things if our run command is non-null. 3926 if test -z "$run"; then 3927 # win32 will think the script is a binary if it has 3928 # a .exe suffix, so we strip it off here. 3929 case $output in 3930 *.exe) output=`echo $output|sed 's,.exe$,,'` ;; 3931 esac 3932 # test for cygwin because mv fails w/o .exe extensions 3933 case $host in 3934 *cygwin*) exeext=.exe ;; 3935 *) exeext= ;; 3936 esac 3937 $rm $output 3938 trap "$rm $output; exit 1" 1 2 15 3939 3940 $echo > $output "\ 3941#! $SHELL 3942 3943# $output - temporary wrapper script for $objdir/$outputname 3944# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP 3945# 3946# The $output program cannot be directly executed until all the libtool 3947# libraries that it depends on are installed. 3948# 3949# This wrapper script should never be moved out of the build directory. 3950# If it is, it will not operate correctly. 3951 3952# Sed substitution that helps us do robust quoting. It backslashifies 3953# metacharacters that are still active within double-quoted strings. 3954Xsed='sed -e 1s/^X//' 3955sed_quote_subst='$sed_quote_subst' 3956 3957# The HP-UX ksh and POSIX shell print the target directory to stdout 3958# if CDPATH is set. 3959if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi 3960 3961relink_command=\"$relink_command\" 3962 3963# This environment variable determines our operation mode. 3964if test \"\$libtool_install_magic\" = \"$magic\"; then 3965 # install mode needs the following variable: 3966 uninst_deplibs='$uninst_deplibs' 3967else 3968 # When we are sourced in execute mode, \$file and \$echo are already set. 3969 if test \"\$libtool_execute_magic\" != \"$magic\"; then 3970 echo=\"$qecho\" 3971 file=\"\$0\" 3972 # Make sure echo works. 3973 if test \"X\$1\" = X--no-reexec; then 3974 # Discard the --no-reexec flag, and continue. 3975 shift 3976 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then 3977 # Yippee, \$echo works! 3978 : 3979 else 3980 # Restart under the correct shell, and then maybe \$echo will work. 3981 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} 3982 fi 3983 fi\ 3984" 3985 $echo >> $output "\ 3986 3987 # Find the directory that this script lives in. 3988 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` 3989 test \"x\$thisdir\" = \"x\$file\" && thisdir=. 3990 3991 # Follow symbolic links until we get to the real thisdir. 3992 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\` 3993 while test -n \"\$file\"; do 3994 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` 3995 3996 # If there was a directory component, then change thisdir. 3997 if test \"x\$destdir\" != \"x\$file\"; then 3998 case \"\$destdir\" in 3999 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; 4000 *) thisdir=\"\$thisdir/\$destdir\" ;; 4001 esac 4002 fi 4003 4004 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` 4005 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\` 4006 done 4007 4008 # Try to get the absolute directory name. 4009 absdir=\`cd \"\$thisdir\" && pwd\` 4010 test -n \"\$absdir\" && thisdir=\"\$absdir\" 4011" 4012 4013 if test "$fast_install" = yes; then 4014 echo >> $output "\ 4015 program=lt-'$outputname'$exeext 4016 progdir=\"\$thisdir/$objdir\" 4017 4018 if test ! -f \"\$progdir/\$program\" || \\ 4019 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\ 4020 test \"X\$file\" != \"X\$progdir/\$program\"; }; then 4021 4022 file=\"\$\$-\$program\" 4023 4024 if test ! -d \"\$progdir\"; then 4025 $mkdir \"\$progdir\" 4026 else 4027 $rm \"\$progdir/\$file\" 4028 fi" 4029 4030 echo >> $output "\ 4031 4032 # relink executable if necessary 4033 if test -n \"\$relink_command\"; then 4034 if (eval \$relink_command); then : 4035 else 4036 $rm \"\$progdir/\$file\" 4037 exit 1 4038 fi 4039 fi 4040 4041 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || 4042 { $rm \"\$progdir/\$program\"; 4043 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } 4044 $rm \"\$progdir/\$file\" 4045 fi" 4046 else 4047 echo >> $output "\ 4048 program='$outputname' 4049 progdir=\"\$thisdir/$objdir\" 4050" 4051 fi 4052 4053 echo >> $output "\ 4054 4055 if test -f \"\$progdir/\$program\"; then" 4056 4057 # Export our shlibpath_var if we have one. 4058 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then 4059 $echo >> $output "\ 4060 # Add our own library path to $shlibpath_var 4061 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" 4062 4063 # Some systems cannot cope with colon-terminated $shlibpath_var 4064 # The second colon is a workaround for a bug in BeOS R4 sed 4065 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` 4066 4067 export $shlibpath_var 4068" 4069 fi 4070 4071 # fixup the dll searchpath if we need to. 4072 if test -n "$dllsearchpath"; then 4073 $echo >> $output "\ 4074 # Add the dll search path components to the executable PATH 4075 PATH=$dllsearchpath:\$PATH 4076" 4077 fi 4078 4079 $echo >> $output "\ 4080 if test \"\$libtool_execute_magic\" != \"$magic\"; then 4081 # Run the actual program with our arguments. 4082" 4083 case $host in 4084 # win32 systems need to use the prog path for dll 4085 # lookup to work 4086 *-*-cygwin* | *-*-pw32*) 4087 $echo >> $output "\ 4088 exec \$progdir/\$program \${1+\"\$@\"} 4089" 4090 ;; 4091 4092 # Backslashes separate directories on plain windows 4093 *-*-mingw | *-*-os2*) 4094 $echo >> $output "\ 4095 exec \$progdir\\\\\$program \${1+\"\$@\"} 4096" 4097 ;; 4098 4099 *) 4100 $echo >> $output "\ 4101 # Export the path to the program. 4102 PATH=\"\$progdir:\$PATH\" 4103 export PATH 4104 4105 exec \$program \${1+\"\$@\"} 4106" 4107 ;; 4108 esac 4109 $echo >> $output "\ 4110 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" 4111 exit 1 4112 fi 4113 else 4114 # The program doesn't exist. 4115 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 4116 \$echo \"This script is just a wrapper for \$program.\" 1>&2 4117 echo \"See the $PACKAGE documentation for more information.\" 1>&2 4118 exit 1 4119 fi 4120fi\ 4121" 4122 chmod +x $output 4123 fi 4124 exit 0 4125 ;; 4126 esac 4127 4128 # See if we need to build an old-fashioned archive. 4129 for oldlib in $oldlibs; do 4130 4131 if test "$build_libtool_libs" = convenience; then 4132 oldobjs="$libobjs_save" 4133 addlibs="$convenience" 4134 build_libtool_libs=no 4135 else 4136 if test "$build_libtool_libs" = module; then 4137 oldobjs="$libobjs_save" 4138 build_libtool_libs=no 4139 else 4140 oldobjs="$objs$old_deplibs $non_pic_objects" 4141 fi 4142 addlibs="$old_convenience" 4143 fi 4144 4145 if test -n "$addlibs"; then 4146 gentop="$output_objdir/${outputname}x" 4147 $show "${rm}r $gentop" 4148 $run ${rm}r "$gentop" 4149 $show "$mkdir $gentop" 4150 $run $mkdir "$gentop" 4151 status=$? 4152 if test $status -ne 0 && test ! -d "$gentop"; then 4153 exit $status 4154 fi 4155 generated="$generated $gentop" 4156 4157 # Add in members from convenience archives. 4158 for xlib in $addlibs; do 4159 # Extract the objects. 4160 case $xlib in 4161 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; 4162 *) xabs=`pwd`"/$xlib" ;; 4163 esac 4164 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` 4165 xdir="$gentop/$xlib" 4166 4167 $show "${rm}r $xdir" 4168 $run ${rm}r "$xdir" 4169 $show "$mkdir $xdir" 4170 $run $mkdir "$xdir" 4171 status=$? 4172 if test $status -ne 0 && test ! -d "$xdir"; then 4173 exit $status 4174 fi 4175 $show "(cd $xdir && $AR x $xabs)" 4176 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? 4177 4178 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print | $NL2SP` 4179 done 4180 fi 4181 4182 # Do each command in the archive commands. 4183 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then 4184 eval cmds=\"$old_archive_from_new_cmds\" 4185 else 4186# # Ensure that we have .o objects in place in case we decided 4187# # not to build a shared library, and have fallen back to building 4188# # static libs even though --disable-static was passed! 4189# for oldobj in $oldobjs; do 4190# if test ! -f $oldobj; then 4191# xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'` 4192# if test "X$xdir" = "X$oldobj"; then 4193# xdir="." 4194# else 4195# xdir="$xdir" 4196# fi 4197# baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'` 4198# obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` 4199# $show "(cd $xdir && ${LN_S} $obj $baseobj)" 4200# $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $? 4201# fi 4202# done 4203 4204 compiler_flags="$compiler_flags $add_flags" 4205 eval cmds=\"$old_archive_cmds\" 4206 4207 if len=`expr "X$cmds" : ".*"` && 4208 test $len -le $max_cmd_len; then 4209 : 4210 else 4211 # the command line is too long to link in one step, link in parts 4212 $echo "using piecewise archive linking..." 4213 save_RANLIB=$RANLIB 4214 RANLIB=: 4215 objlist= 4216 concat_cmds= 4217 save_oldobjs=$oldobjs 4218 for obj in $save_oldobjs 4219 do 4220 oldobjs="$objlist $obj" 4221 objlist="$objlist $obj" 4222 eval test_cmds=\"$old_archive_cmds\" 4223 if len=`expr "X$test_cmds" : ".*"` && 4224 test $len -le $max_cmd_len; then 4225 : 4226 else 4227 # the above command should be used before it gets too long 4228 oldobjs=$objlist 4229 test -z "$concat_cmds" || concat_cmds=$concat_cmds~ 4230 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" 4231 objlist= 4232 fi 4233 done 4234 RANLIB=$save_RANLIB 4235 oldobjs=$objlist 4236 eval cmds=\"\$concat_cmds~$old_archive_cmds\" 4237 fi 4238 fi 4239 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' 4240 for cmd in $cmds; do 4241 IFS="$save_ifs" 4242 $show "$cmd" 4243 $run eval "$cmd" || exit $? 4244 done 4245 IFS="$save_ifs" 4246 done 4247 4248 if test -n "$generated"; then 4249 $show "${rm}r$generated" 4250 $run ${rm}r$generated 4251 fi 4252 4253 # Now create the libtool archive. 4254 case $output in 4255 *.la) 4256 old_library= 4257 test "$build_old_libs" = yes && old_library="$libname.$libext" 4258 $show "creating $output" 4259 4260 # Preserve any variables that may affect compiler behavior 4261 for var in $variables_saved_for_relink; do 4262 if eval test -z \"\${$var+set}\"; then 4263 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" 4264 elif eval var_value=\$$var; test -z "$var_value"; then 4265 relink_command="$var=; export $var; $relink_command" 4266 else 4267 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` 4268 relink_command="$var=\"$var_value\"; export $var; $relink_command" 4269 fi 4270 done 4271 # Quote the link command for shipping. 4272 relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args" 4273 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` 4274 4275 # Only create the output if not a dry run. 4276 if test -z "$run"; then 4277 for installed in no yes; do 4278 if test "$installed" = yes; then 4279 if test -z "$install_libdir"; then 4280 break 4281 fi 4282 output="$output_objdir/$outputname"i 4283 # Replace all uninstalled libtool libraries with the installed ones 4284 newdependency_libs= 4285 for deplib in $dependency_libs; do 4286 case $deplib in 4287 *.la) 4288 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` 4289 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` 4290 if test -z "$libdir"; then 4291 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 4292 exit 1 4293 fi 4294 newdependency_libs="$newdependency_libs $libdir/$name" 4295 ;; 4296 *) newdependency_libs="$newdependency_libs $deplib" ;; 4297 esac 4298 done 4299 dependency_libs="$newdependency_libs" 4300 newdlfiles= 4301 for lib in $dlfiles; do 4302 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` 4303 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` 4304 if test -z "$libdir"; then 4305 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 4306 exit 1 4307 fi 4308 newdlfiles="$newdlfiles $libdir/$name" 4309 done 4310 dlfiles="$newdlfiles" 4311 newdlprefiles= 4312 for lib in $dlprefiles; do 4313 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` 4314 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` 4315 if test -z "$libdir"; then 4316 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 4317 exit 1 4318 fi 4319 newdlprefiles="$newdlprefiles $libdir/$name" 4320 done 4321 dlprefiles="$newdlprefiles" 4322 fi 4323 $rm $output 4324 # place dlname in correct position for cygwin 4325 tdlname=$dlname 4326 case $host,$output,$installed,$module,$dlname in 4327 *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; 4328 esac 4329 $echo > $output "\ 4330# $outputname - a libtool library file 4331# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP 4332# 4333# Please DO NOT delete this file! 4334# It is necessary for linking the library. 4335 4336# The name that we can dlopen(3). 4337dlname='$tdlname' 4338 4339# Names of this library. 4340library_names='$library_names' 4341 4342# The name of the static archive. 4343old_library='$old_library' 4344 4345# Libraries that this one depends upon. 4346dependency_libs='$dependency_libs' 4347 4348# Version information for $libname. 4349current=$current 4350age=$age 4351revision=$revision 4352 4353# Is this an already installed library? 4354installed=$installed 4355 4356# Files to dlopen/dlpreopen 4357dlopen='$dlfiles' 4358dlpreopen='$dlprefiles' 4359 4360# Directory that this library needs to be installed in: 4361libdir='$install_libdir'" 4362 if test $hardcode_into_libs = all && 4363 test "$installed" = no && test $need_relink = yes; then 4364 $echo >> $output "\ 4365relink_command=\"$relink_command\"" 4366 fi 4367 done 4368 fi 4369 4370 # Do a symbolic link so that the libtool archive can be found in 4371 # LD_LIBRARY_PATH before the program is installed. 4372 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" 4373 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? 4374 ;; 4375 esac 4376 exit 0 4377 ;; 4378 4379 # libtool install mode 4380 install) 4381 modename="$modename: install" 4382 4383 # There may be an optional sh(1) argument at the beginning of 4384 # install_prog (especially on Windows NT). 4385 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || 4386 # Allow the use of GNU shtool's install command. 4387 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then 4388 # Aesthetically quote it. 4389 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` 4390 case $arg in 4391 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) 4392 arg="\"$arg\"" 4393 ;; 4394 esac 4395 install_prog="$arg " 4396 arg="$1" 4397 shift 4398 else 4399 install_prog= 4400 arg="$nonopt" 4401 fi 4402 4403 # The real first argument should be the name of the installation program. 4404 # Aesthetically quote it. 4405 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` 4406 case $arg in 4407 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) 4408 arg="\"$arg\"" 4409 ;; 4410 esac 4411 install_prog="$install_prog$arg" 4412 4413 # We need to accept at least all the BSD install flags. 4414 dest= 4415 files= 4416 opts= 4417 prev= 4418 install_type= 4419 isdir=no 4420 stripme= 4421 for arg 4422 do 4423 if test -n "$dest"; then 4424 files="$files $dest" 4425 dest="$arg" 4426 continue 4427 fi 4428 4429 case $arg in 4430 -d) isdir=yes ;; 4431 -f) prev="-f" ;; 4432 -g) prev="-g" ;; 4433 -m) prev="-m" ;; 4434 -o) prev="-o" ;; 4435 -s) 4436 stripme=" -s" 4437 continue 4438 ;; 4439 -*) ;; 4440 4441 *) 4442 # If the previous option needed an argument, then skip it. 4443 if test -n "$prev"; then 4444 prev= 4445 else 4446 dest="$arg" 4447 continue 4448 fi 4449 ;; 4450 esac 4451 4452 # Aesthetically quote the argument. 4453 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` 4454 case $arg in 4455 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) 4456 arg="\"$arg\"" 4457 ;; 4458 esac 4459 install_prog="$install_prog $arg" 4460 done 4461 4462 if test -z "$install_prog"; then 4463 $echo "$modename: you must specify an install program" 1>&2 4464 $echo "$help" 1>&2 4465 exit 1 4466 fi 4467 4468 if test -n "$prev"; then 4469 $echo "$modename: the \`$prev' option requires an argument" 1>&2 4470 $echo "$help" 1>&2 4471 exit 1 4472 fi 4473 4474 if test -z "$files"; then 4475 if test -z "$dest"; then 4476 $echo "$modename: no file or destination specified" 1>&2 4477 else 4478 $echo "$modename: you must specify a destination" 1>&2 4479 fi 4480 $echo "$help" 1>&2 4481 exit 1 4482 fi 4483 4484 # Strip any trailing slash from the destination. 4485 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` 4486 4487 # Check to see that the destination is a directory. 4488 test -d "$dest" && isdir=yes 4489 if test "$isdir" = yes; then 4490 destdir="$dest" 4491 destname= 4492 else 4493 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` 4494 test "X$destdir" = "X$dest" && destdir=. 4495 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` 4496 4497 # Not a directory, so check to see that there is only one file specified. 4498 set dummy $files 4499 if test $# -gt 2; then 4500 $echo "$modename: \`$dest' is not a directory" 1>&2 4501 $echo "$help" 1>&2 4502 exit 1 4503 fi 4504 fi 4505 case $destdir in 4506 [\\/]* | [A-Za-z]:[\\/]*) ;; 4507 *) 4508 for file in $files; do 4509 case $file in 4510 *.lo) ;; 4511 *) 4512 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 4513 $echo "$help" 1>&2 4514 exit 1 4515 ;; 4516 esac 4517 done 4518 ;; 4519 esac 4520 4521 # This variable tells wrapper scripts just to set variables rather 4522 # than running their programs. 4523 libtool_install_magic="$magic" 4524 4525 staticlibs= 4526 future_libdirs= 4527 current_libdirs= 4528 for file in $files; do 4529 4530 # Do each installation. 4531 case $file in 4532 *.$libext) 4533 # Do the static libraries later. 4534 staticlibs="$staticlibs $file" 4535 ;; 4536 4537 *.la) 4538 # Check to see that this really is a libtool archive. 4539 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : 4540 else 4541 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 4542 $echo "$help" 1>&2 4543 exit 1 4544 fi 4545 4546 library_names= 4547 old_library= 4548 relink_command= 4549 # If there is no directory component, then add one. 4550 case $file in 4551 */* | *\\*) . $file ;; 4552 *) . ./$file ;; 4553 esac 4554 4555 # Add the libdir to current_libdirs if it is the destination. 4556 if test "X$destdir" = "X$libdir"; then 4557 case "$current_libdirs " in 4558 *" $libdir "*) ;; 4559 *) current_libdirs="$current_libdirs $libdir" ;; 4560 esac 4561 else 4562 # Note the libdir as a future libdir. 4563 case "$future_libdirs " in 4564 *" $libdir "*) ;; 4565 *) future_libdirs="$future_libdirs $libdir" ;; 4566 esac 4567 fi 4568 4569 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ 4570 test "X$dir" = "X$file/" && dir= 4571 dir="$dir$objdir" 4572 4573 if test "$hardcode_into_libs" = all && test -n "$relink_command"; then 4574 $echo "$modename: warning: relinking \`$file'" 1>&2 4575 $show "$relink_command" 4576 if $run eval "$relink_command"; then : 4577 else 4578 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 4579 continue 4580 fi 4581 fi 4582 4583 # See the names of the shared library. 4584 set dummy $library_names 4585 if test -n "$2"; then 4586 realname="$2" 4587 shift 4588 shift 4589 4590 srcname="$realname" 4591 test "$hardcode_into_libs" = all && test -n "$relink_command" && srcname="$realname"T 4592 4593 # Install the shared library and build the symlinks. 4594 $show "$install_prog $dir/$srcname $destdir/$realname" 4595 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? 4596 if test -n "$stripme" && test -n "$striplib"; then 4597 $show "$striplib $destdir/$realname" 4598 $run eval "$striplib $destdir/$realname" || exit $? 4599 fi 4600 4601 if test $# -gt 0; then 4602 # Delete the old symlinks, and create new ones. 4603 for linkname 4604 do 4605 if test "$linkname" != "$realname"; then 4606 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" 4607 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" 4608 fi 4609 done 4610 fi 4611 4612 # Do each command in the postinstall commands. 4613 lib="$destdir/$realname" 4614 eval cmds=\"$postinstall_cmds\" 4615 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' 4616 for cmd in $cmds; do 4617 IFS="$save_ifs" 4618 $show "$cmd" 4619 $run eval "$cmd" || exit $? 4620 done 4621 IFS="$save_ifs" 4622 fi 4623 4624 # Install the pseudo-library for information purposes. 4625 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` 4626 instname="$dir/$name"i 4627 $show "$install_prog $instname $destdir/$name" 4628 $run eval "$install_prog $instname $destdir/$name" || exit $? 4629 4630 # Maybe install the static library, too. 4631 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" 4632 ;; 4633 4634 *.lo) 4635 # Install (i.e. copy) a libtool object. 4636 4637 # Figure out destination file name, if it wasn't already specified. 4638 if test -n "$destname"; then 4639 destfile="$destdir/$destname" 4640 else 4641 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` 4642 destfile="$destdir/$destfile" 4643 fi 4644 4645 # Deduce the name of the destination old-style object file. 4646 case $destfile in 4647 *.lo) 4648 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` 4649 ;; 4650 *.$objext) 4651 staticdest="$destfile" 4652 destfile= 4653 ;; 4654 *) 4655 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 4656 $echo "$help" 1>&2 4657 exit 1 4658 ;; 4659 esac 4660 4661 # Install the libtool object if requested. 4662 if test -n "$destfile"; then 4663 $show "$install_prog $file $destfile" 4664 $run eval "$install_prog $file $destfile" || exit $? 4665 fi 4666 4667 # Install the old object if enabled. 4668 if test "$build_old_libs" = yes; then 4669 # Deduce the name of the old-style object file. 4670 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` 4671 4672 $show "$install_prog $staticobj $staticdest" 4673 $run eval "$install_prog \$staticobj \$staticdest" || exit $? 4674 fi 4675 exit 0 4676 ;; 4677 4678 *) 4679 # Figure out destination file name, if it wasn't already specified. 4680 if test -n "$destname"; then 4681 destfile="$destdir/$destname" 4682 else 4683 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` 4684 destfile="$destdir/$destfile" 4685 fi 4686 4687 # Do a test to see if this is really a libtool program. 4688 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 4689 uninst_deplibs= 4690 relink_command= 4691 4692 # If there is no directory component, then add one. 4693 case $file in 4694 */* | *\\*) . $file ;; 4695 *) . ./$file ;; 4696 esac 4697 4698 # Check the variables that should have been set. 4699 if test -z "$uninst_deplibs"; then 4700 $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2 4701 exit 1 4702 fi 4703 4704 finalize=yes 4705 for lib in $uninst_deplibs; do 4706 # Check to see that each library is installed. 4707 libdir= 4708 if test -f "$lib"; then 4709 # If there is no directory component, then add one. 4710 case $lib in 4711 */* | *\\*) . $lib ;; 4712 *) . ./$lib ;; 4713 esac 4714 fi 4715 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test 4716 if test -n "$libdir" && test ! -f "$libfile"; then 4717 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 4718 finalize=no 4719 fi 4720 done 4721 4722 relink_command= 4723 # If there is no directory component, then add one. 4724 case $file in 4725 */* | *\\*) . $file ;; 4726 *) . ./$file ;; 4727 esac 4728 4729 outputname= 4730 if test "$fast_install" = no && test -n "$relink_command"; then 4731 if test "$finalize" = yes && test -z "$run"; then 4732 tmpdir="/tmp" 4733 test -n "$TMPDIR" && tmpdir="$TMPDIR" 4734 tmpdir="$tmpdir/libtool-$$" 4735 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : 4736 else 4737 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 4738 continue 4739 fi 4740 file=`$echo "X$file" | $Xsed -e 's%^.*/%%'` 4741 outputname="$tmpdir/$file" 4742 # Replace the output file specification. 4743 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` 4744 4745 $show "$relink_command" 4746 if $run eval "$relink_command"; then : 4747 else 4748 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 4749 ${rm}r "$tmpdir" 4750 continue 4751 fi 4752 file="$outputname" 4753 else 4754 $echo "$modename: warning: cannot relink \`$file'" 1>&2 4755 fi 4756 else 4757 # Install the binary that we compiled earlier. 4758 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` 4759 fi 4760 fi 4761 4762 4763 # remove .exe since cygwin /usr/bin/install will append another 4764 # one anyways 4765 case $install_prog,$host in 4766 */usr/bin/install*,*cygwin*) 4767 case $file:$destfile in 4768 *.exe:*.exe) 4769 # this is ok 4770 ;; 4771 *.exe:*) 4772 destfile=$destfile.exe 4773 ;; 4774 *:*.exe) 4775 destfile=`echo $destfile | sed -e 's,.exe$,,'` 4776 ;; 4777 esac 4778 ;; 4779 esac 4780 4781 $show "$install_prog$stripme $file $destfile" 4782 $run eval "$install_prog\$stripme \$file \$destfile" || exit $? 4783 test -n "$outputname" && ${rm}r "$tmpdir" 4784 ;; 4785 esac 4786 done 4787 4788 for file in $staticlibs; do 4789 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` 4790 4791 # Set up the ranlib parameters. 4792 oldlib="$destdir/$name" 4793 4794 $show "$install_prog $file $oldlib" 4795 $run eval "$install_prog \$file \$oldlib" || exit $? 4796 4797 if test -n "$stripme" && test -n "$striplib"; then 4798 $show "$old_striplib $oldlib" 4799 $run eval "$old_striplib $oldlib" || exit $? 4800 fi 4801 4802 # Do each command in the postinstall commands. 4803 eval cmds=\"$old_postinstall_cmds\" 4804 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' 4805 for cmd in $cmds; do 4806 IFS="$save_ifs" 4807 $show "$cmd" 4808 $run eval "$cmd" || exit $? 4809 done 4810 IFS="$save_ifs" 4811 done 4812 4813 if test -n "$future_libdirs"; then 4814 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 4815 fi 4816 4817 if test -n "$current_libdirs"; then 4818 # Maybe just do a dry run. 4819 test -n "$run" && current_libdirs=" -n$current_libdirs" 4820 exec $SHELL $0 --finish$current_libdirs 4821 exit 1 4822 fi 4823 4824 exit 0 4825 ;; 4826 4827 # libtool finish mode 4828 finish) 4829 modename="$modename: finish" 4830 libdirs="$nonopt" 4831 admincmds= 4832 4833 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then 4834 for dir 4835 do 4836 libdirs="$libdirs $dir" 4837 done 4838 4839 for libdir in $libdirs; do 4840 if test -n "$finish_cmds"; then 4841 # Do each command in the finish commands. 4842 eval cmds=\"$finish_cmds\" 4843 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' 4844 for cmd in $cmds; do 4845 IFS="$save_ifs" 4846 $show "$cmd" 4847 $run eval "$cmd" || admincmds="$admincmds 4848 $cmd" 4849 done 4850 IFS="$save_ifs" 4851 fi 4852 if test -n "$finish_eval"; then 4853 # Do the single finish_eval. 4854 eval cmds=\"$finish_eval\" 4855 $run eval "$cmds" || admincmds="$admincmds 4856 $cmds" 4857 fi 4858 done 4859 fi 4860 4861 # Exit here if they wanted silent mode. 4862 exit 0 4863 4864 echo "----------------------------------------------------------------------" 4865 echo "Libraries have been installed in:" 4866 for libdir in $libdirs; do 4867 echo " $libdir" 4868 done 4869 echo 4870 echo "If you ever happen to want to link against installed libraries" 4871 echo "in a given directory, LIBDIR, you must either use libtool, and" 4872 echo "specify the full pathname of the library, or use \`-LLIBDIR'" 4873 echo "flag during linking and do at least one of the following:" 4874 if test -n "$shlibpath_var"; then 4875 echo " - add LIBDIR to the \`$shlibpath_var' environment variable" 4876 echo " during execution" 4877 fi 4878 if test -n "$runpath_var"; then 4879 echo " - add LIBDIR to the \`$runpath_var' environment variable" 4880 echo " during linking" 4881 fi 4882 if test -n "$hardcode_libdir_flag_spec"; then 4883 libdir=LIBDIR 4884 eval flag=\"$hardcode_libdir_flag_spec\" 4885 4886 echo " - use the \`$flag' linker flag" 4887 fi 4888 if test -n "$admincmds"; then 4889 echo " - have your system administrator run these commands:$admincmds" 4890 fi 4891 if test -f /etc/ld.so.conf; then 4892 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" 4893 fi 4894 echo 4895 echo "See any operating system documentation about shared libraries for" 4896 echo "more information, such as the ld(1) and ld.so(8) manual pages." 4897 echo "----------------------------------------------------------------------" 4898 exit 0 4899 ;; 4900 4901 # libtool execute mode 4902 execute) 4903 modename="$modename: execute" 4904 4905 # The first argument is the command name. 4906 cmd="$nonopt" 4907 if test -z "$cmd"; then 4908 $echo "$modename: you must specify a COMMAND" 1>&2 4909 $echo "$help" 4910 exit 1 4911 fi 4912 4913 # Handle -dlopen flags immediately. 4914 for file in $execute_dlfiles; do 4915 if test ! -f "$file"; then 4916 $echo "$modename: \`$file' is not a file" 1>&2 4917 $echo "$help" 1>&2 4918 exit 1 4919 fi 4920 4921 dir= 4922 case $file in 4923 *.la) 4924 # Check to see that this really is a libtool archive. 4925 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : 4926 else 4927 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 4928 $echo "$help" 1>&2 4929 exit 1 4930 fi 4931 4932 # Read the libtool library. 4933 dlname= 4934 library_names= 4935 4936 # If there is no directory component, then add one. 4937 case $file in 4938 */* | *\\*) . $file ;; 4939 *) . ./$file ;; 4940 esac 4941 4942 # Skip this library if it cannot be dlopened. 4943 if test -z "$dlname"; then 4944 # Warn if it was a shared library. 4945 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" 4946 continue 4947 fi 4948 4949 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` 4950 test "X$dir" = "X$file" && dir=. 4951 4952 if test -f "$dir/$objdir/$dlname"; then 4953 dir="$dir/$objdir" 4954 else 4955 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 4956 exit 1 4957 fi 4958 ;; 4959 4960 *.lo) 4961 # Just add the directory containing the .lo file. 4962 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` 4963 test "X$dir" = "X$file" && dir=. 4964 ;; 4965 4966 *) 4967 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 4968 continue 4969 ;; 4970 esac 4971 4972 # Get the absolute pathname. 4973 absdir=`cd "$dir" && pwd` 4974 test -n "$absdir" && dir="$absdir" 4975 4976 # Now add the directory to shlibpath_var. 4977 if eval "test -z \"\$$shlibpath_var\""; then 4978 eval "$shlibpath_var=\"\$dir\"" 4979 else 4980 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" 4981 fi 4982 done 4983 4984 # This variable tells wrapper scripts just to set shlibpath_var 4985 # rather than running their programs. 4986 libtool_execute_magic="$magic" 4987 4988 # Check if any of the arguments is a wrapper script. 4989 args= 4990 for file 4991 do 4992 case $file in 4993 -*) ;; 4994 *) 4995 # Do a test to see if this is really a libtool program. 4996 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 4997 # If there is no directory component, then add one. 4998 case $file in 4999 */* | *\\*) . $file ;; 5000 *) . ./$file ;; 5001 esac 5002 5003 # Transform arg to wrapped name. 5004 file="$progdir/$program" 5005 fi 5006 ;; 5007 esac 5008 # Quote arguments (to preserve shell metacharacters). 5009 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` 5010 args="$args \"$file\"" 5011 done 5012 5013 if test -z "$run"; then 5014 if test -n "$shlibpath_var"; then 5015 # Export the shlibpath_var. 5016 eval "export $shlibpath_var" 5017 fi 5018 5019 # Restore saved enviroment variables 5020 if test "${save_LC_ALL+set}" = set; then 5021 LC_ALL="$save_LC_ALL"; export LC_ALL 5022 fi 5023 if test "${save_LANG+set}" = set; then 5024 LANG="$save_LANG"; export LANG 5025 fi 5026 5027 # Now actually exec the command. 5028 eval "exec \$cmd$args" 5029 5030 $echo "$modename: cannot exec \$cmd$args" 5031 exit 1 5032 else 5033 # Display what would be done. 5034 if test -n "$shlibpath_var"; then 5035 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" 5036 $echo "export $shlibpath_var" 5037 fi 5038 $echo "$cmd$args" 5039 exit 0 5040 fi 5041 ;; 5042 5043 # libtool clean and uninstall mode 5044 clean | uninstall) 5045 modename="$modename: $mode" 5046 rm="$nonopt" 5047 files= 5048 5049 # This variable tells wrapper scripts just to set variables rather 5050 # than running their programs. 5051 libtool_install_magic="$magic" 5052 5053 for arg 5054 do 5055 case $arg in 5056 -*) rm="$rm $arg" ;; 5057 *) files="$files $arg" ;; 5058 esac 5059 done 5060 5061 if test -z "$rm"; then 5062 $echo "$modename: you must specify an RM program" 1>&2 5063 $echo "$help" 1>&2 5064 exit 1 5065 fi 5066 5067 rmdirs= 5068 5069 for file in $files; do 5070 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` 5071 if test "X$dir" = "X$file"; then 5072 dir=. 5073 objdir="$objdir" 5074 else 5075 objdir="$dir/$objdir" 5076 fi 5077 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` 5078 test $mode = uninstall && objdir="$dir" 5079 5080 # Remember objdir for removal later, being careful to avoid duplicates 5081 if test $mode = clean; then 5082 case " $rmdirs " in 5083 *" $objdir "*) ;; 5084 *) rmdirs="$rmdirs $objdir" ;; 5085 esac 5086 fi 5087 5088 rmfiles="$file" 5089 5090 case $name in 5091 *.la) 5092 # Possibly a libtool archive, so verify it. 5093 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 5094 . $dir/$name 5095 5096 # Delete the libtool libraries and symlinks. 5097 for n in $library_names; do 5098 rmfiles="$rmfiles $objdir/$n" 5099 done 5100 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" 5101 test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" 5102 5103 if test $mode = uninstall; then 5104 if test -n "$library_names"; then 5105 # Do each command in the postuninstall commands. 5106 eval cmds=\"$postuninstall_cmds\" 5107 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' 5108 for cmd in $cmds; do 5109 IFS="$save_ifs" 5110 $show "$cmd" 5111 $run eval "$cmd" 5112 done 5113 IFS="$save_ifs" 5114 fi 5115 5116 if test -n "$old_library"; then 5117 # Do each command in the old_postuninstall commands. 5118 eval cmds=\"$old_postuninstall_cmds\" 5119 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' 5120 for cmd in $cmds; do 5121 IFS="$save_ifs" 5122 $show "$cmd" 5123 $run eval "$cmd" 5124 done 5125 IFS="$save_ifs" 5126 fi 5127 # FIXME: should reinstall the best remaining shared library. 5128 fi 5129 fi 5130 ;; 5131 5132 *.lo) 5133 # Possibly a libtool object, so verify it. 5134 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 5135 5136 # Read the .lo file 5137 . $dir/$name 5138 5139 # Add PIC object to the list of files to remove. 5140 if test -n "$pic_object" \ 5141 && test "$pic_object" != none; then 5142 rmfiles="$rmfiles $dir/$pic_object" 5143 fi 5144 5145 # Add non-PIC object to the list of files to remove. 5146 if test -n "$non_pic_object" \ 5147 && test "$non_pic_object" != none; then 5148 rmfiles="$rmfiles $dir/$non_pic_object" 5149 fi 5150 fi 5151 ;; 5152 5153 *) 5154 # Do a test to see if this is a libtool program. 5155 if test $mode = clean && 5156 (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 5157 relink_command= 5158 . $dir/$file 5159 5160 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" 5161 if test "$fast_install" = yes && test -n "$relink_command"; then 5162 rmfiles="$rmfiles $objdir/lt-$name" 5163 fi 5164 fi 5165 ;; 5166 esac 5167 $show "$rm $rmfiles" 5168 $run $rm $rmfiles 5169 done 5170 5171 # Try to remove the ${objdir}s in the directories where we deleted files 5172 for dir in $rmdirs; do 5173 if test -d "$dir"; then 5174 $show "rmdir $dir" 5175 $run rmdir $dir >/dev/null 2>&1 5176 fi 5177 done 5178 5179 exit 0 5180 ;; 5181 5182 "") 5183 $echo "$modename: you must specify a MODE" 1>&2 5184 $echo "$generic_help" 1>&2 5185 exit 1 5186 ;; 5187 esac 5188 5189 $echo "$modename: invalid operation mode \`$mode'" 1>&2 5190 $echo "$generic_help" 1>&2 5191 exit 1 5192fi # test -z "$show_help" 5193 5194# We need to display help for each of the modes. 5195case $mode in 5196"") $echo \ 5197"Usage: $modename [OPTION]... [MODE-ARG]... 5198 5199Provide generalized library-building support services. 5200 5201 --config show all configuration variables 5202 --debug enable verbose shell tracing 5203-n, --dry-run display commands without modifying any files 5204 --features display basic configuration information and exit 5205 --finish same as \`--mode=finish' 5206 --help display this help message and exit 5207 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] 5208 --quiet same as \`--silent' 5209 --silent don't print informational messages 5210 --tag=TAG use configuration variables from tag TAG 5211 --version print version information 5212 5213MODE must be one of the following: 5214 5215 clean remove files from the build directory 5216 compile compile a source file into a libtool object 5217 execute automatically set library path, then run a program 5218 finish complete the installation of libtool libraries 5219 install install libraries or executables 5220 link create a library or an executable 5221 uninstall remove libraries from an installed directory 5222 5223MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for 5224a more detailed description of MODE." 5225 exit 0 5226 ;; 5227 5228clean) 5229 $echo \ 5230"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... 5231 5232Remove files from the build directory. 5233 5234RM is the name of the program to use to delete files associated with each FILE 5235(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed 5236to RM. 5237 5238If FILE is a libtool library, object or program, all the files associated 5239with it are deleted. Otherwise, only FILE itself is deleted using RM." 5240 ;; 5241 5242compile) 5243 $echo \ 5244"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE 5245 5246Compile a source file into a libtool library object. 5247 5248This mode accepts the following additional options: 5249 5250 -o OUTPUT-FILE set the output file name to OUTPUT-FILE 5251 -static always build a \`.o' file suitable for static linking 5252 5253COMPILE-COMMAND is a command to be used in creating a \`standard' object file 5254from the given SOURCEFILE. 5255 5256The output file name is determined by removing the directory component from 5257SOURCEFILE, then substituting the C source code suffix \`.c' with the 5258library object suffix, \`.lo'." 5259 ;; 5260 5261execute) 5262 $echo \ 5263"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... 5264 5265Automatically set library path, then run a program. 5266 5267This mode accepts the following additional options: 5268 5269 -dlopen FILE add the directory containing FILE to the library path 5270 5271This mode sets the library path environment variable according to \`-dlopen' 5272flags. 5273 5274If any of the ARGS are libtool executable wrappers, then they are translated 5275into their corresponding uninstalled binary, and any of their required library 5276directories are added to the library path. 5277 5278Then, COMMAND is executed, with ARGS as arguments." 5279 ;; 5280 5281finish) 5282 $echo \ 5283"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... 5284 5285Complete the installation of libtool libraries. 5286 5287Each LIBDIR is a directory that contains libtool libraries. 5288 5289The commands that this mode executes may require superuser privileges. Use 5290the \`--dry-run' option if you just want to see what would be executed." 5291 ;; 5292 5293install) 5294 $echo \ 5295"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... 5296 5297Install executables or libraries. 5298 5299INSTALL-COMMAND is the installation command. The first component should be 5300either the \`install' or \`cp' program. 5301 5302The rest of the components are interpreted as arguments to that command (only 5303BSD-compatible install options are recognized)." 5304 ;; 5305 5306link) 5307 $echo \ 5308"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... 5309 5310Link object files or libraries together to form another library, or to 5311create an executable program. 5312 5313LINK-COMMAND is a command using the C compiler that you would use to create 5314a program from several object files. 5315 5316The following components of LINK-COMMAND are treated specially: 5317 5318 -all-static do not do any dynamic linking at all 5319 -avoid-version do not add a version suffix if possible 5320 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime 5321 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols 5322 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) 5323 -export-symbols SYMFILE 5324 try to export only the symbols listed in SYMFILE 5325 -export-symbols-regex REGEX 5326 try to export only the symbols matching REGEX 5327 -LLIBDIR search LIBDIR for required installed libraries 5328 -lNAME OUTPUT-FILE requires the installed library libNAME 5329 -module build a library that can dlopened 5330 -no-fast-install disable the fast-install mode 5331 -no-install link a not-installable executable 5332 -no-undefined declare that a library does not refer to external symbols 5333 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects 5334 -objectlist FILE Use a list of object files found in FILE to specify objects 5335 -release RELEASE specify package release information 5336 -rpath LIBDIR the created library will eventually be installed in LIBDIR 5337 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries 5338 -static do not do any dynamic linking of libtool libraries 5339 -version-info CURRENT[:REVISION[:AGE]] 5340 specify library version info [each variable defaults to 0] 5341 5342All other options (arguments beginning with \`-') are ignored. 5343 5344Every other argument is treated as a filename. Files ending in \`.la' are 5345treated as uninstalled libtool libraries, other files are standard or library 5346object files. 5347 5348If the OUTPUT-FILE ends in \`.la', then a libtool library is created, 5349only library objects (\`.lo' files) may be specified, and \`-rpath' is 5350required, except when creating a convenience library. 5351 5352If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created 5353using \`ar' and \`ranlib', or on Windows using \`lib'. 5354 5355If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file 5356is created, otherwise an executable program is created." 5357 ;; 5358 5359uninstall) 5360 $echo \ 5361"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... 5362 5363Remove libraries from an installation directory. 5364 5365RM is the name of the program to use to delete files associated with each FILE 5366(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed 5367to RM. 5368 5369If FILE is a libtool library, all the files associated with it are deleted. 5370Otherwise, only FILE itself is deleted using RM." 5371 ;; 5372 5373*) 5374 $echo "$modename: invalid operation mode \`$mode'" 1>&2 5375 $echo "$help" 1>&2 5376 exit 1 5377 ;; 5378esac 5379 5380echo 5381$echo "Try \`$modename --help' for more information about other modes." 5382 5383exit 0 5384 5385# The TAGs below are defined such that we never get into a situation 5386# in which we disable both kinds of libraries. Given conflicting 5387# choices, we go for a static library, that is the most portable, 5388# since we can't tell whether shared libraries were disabled because 5389# the user asked for that or because the platform doesn't support 5390# them. This is particularly important on AIX, because we don't 5391# support having both static and shared libraries enabled at the same 5392# time on that platform, so we default to a shared-only configuration. 5393# If a disable-shared tag is given, we'll fallback to a static-only 5394# configuration. But we'll never go from static-only to shared-only. 5395 5396### BEGIN LIBTOOL TAG CONFIG: disable-shared 5397build_libtool_libs=no 5398build_old_libs=yes 5399### END LIBTOOL TAG CONFIG: disable-shared 5400 5401### BEGIN LIBTOOL TAG CONFIG: disable-static 5402build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` 5403### END LIBTOOL TAG CONFIG: disable-static 5404 5405# Local Variables: 5406# mode:shell-script 5407# sh-indentation:2 5408# End: 5409