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