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