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