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