1#! /bin/sh 2 3# libtoolT - Provide generalized library-building support services. 4# Generated automatically by (GNU ntfs-3g 2009.3.8) 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="/bin/sed" 34 35# Sed that helps us avoid accidentally triggering echo(1) options like -n. 36Xsed="/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=" CXX F77" 44 45# ### BEGIN LIBTOOL CONFIG 46 47# Libtool was configured on host dev3: 48 49# Shell to use when invoking shell scripts. 50SHELL="/bin/sh" 51 52# Whether or not to build shared libraries. 53build_libtool_libs=no 54 55# Whether or not to build static libraries. 56build_old_libs=yes 57 58# Whether or not to add -lc for building shared libraries. 59build_libtool_need_lc=no 60 61# Whether or not to disallow shared libs when runtime libs are static 62allow_libtool_libs_with_static_runtimes=no 63 64# Whether or not to optimize for fast installation. 65fast_install=yes 66 67# The host system. 68host_alias=mipsel 69host=mipsel-unknown-elf 70host_os=elf 71 72# The build system. 73build_alias=mipsel-linux-uclibc 74build=mipsel-unknown-linux-uclibc 75build_os=linux-uclibc 76 77# An echo program that does not interpret backslashes. 78echo="echo" 79 80# The archiver. 81AR="ar" 82AR_FLAGS="cru" 83 84# A C compiler. 85LTCC="mipsel-uclibc-gcc" 86 87# LTCC compiler flags. 88LTCFLAGS="-g -O2" 89 90# A language-specific compiler. 91CC="mipsel-uclibc-gcc" 92 93# Is the compiler the GNU C compiler? 94with_gcc=yes 95 96gcc_dir=`gcc -print-file-name=. | /bin/sed 's,/\.$,,'` 97gcc_ver=`gcc -dumpversion` 98 99# An ERE matcher. 100EGREP="/bin/grep -E" 101 102# The linker used to build libraries. 103LD="/opt/brcm/hndtools-mipsel-linux-3.2.3/mipsel-linux/bin/ld" 104 105# Whether we need hard or soft links. 106LN_S="ln -s" 107 108# A BSD-compatible nm program. 109NM="nm" 110 111# A symbol stripping program 112STRIP="strip" 113 114# Used to examine libraries when file_magic_cmd begins "file" 115MAGIC_CMD=file 116 117# Used on cygwin: DLL creation program. 118DLLTOOL="dlltool" 119 120# Used on cygwin: object dumper. 121OBJDUMP="objdump" 122 123# Used on cygwin: assembler. 124AS="as" 125 126# The name of the directory that contains temporary libtool files. 127objdir=.libs 128 129# How to create reloadable object files. 130reload_flag=" -r" 131reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs" 132 133# How to pass a linker flag through the compiler. 134wl="-Wl," 135 136# Object file suffix (normally "o"). 137objext="o" 138 139# Old archive suffix (normally "a"). 140libext="a" 141 142# Shared library suffix (normally ".so"). 143shrext_cmds='.so' 144 145# Executable file suffix (normally ""). 146exeext="" 147 148# Additional compiler flags for building library objects. 149pic_flag=" -fPIC -DPIC" 150pic_mode=default 151 152# What is the maximum length of a command? 153max_cmd_len=32768 154 155# Does compiler simultaneously support -c and -o options? 156compiler_c_o="yes" 157 158# Must we lock files when doing compilation? 159need_locks="no" 160 161# Do we need the lib prefix for modules? 162need_lib_prefix=unknown 163 164# Do we need a version for libraries? 165need_version=unknown 166 167# Whether dlopen is supported. 168dlopen_support=unknown 169 170# Whether dlopen of programs is supported. 171dlopen_self=unknown 172 173# Whether dlopen of statically linked programs is supported. 174dlopen_self_static=unknown 175 176# Compiler flag to prevent dynamic linking. 177link_static_flag="-static" 178 179# Compiler flag to turn off builtin functions. 180no_builtin_flag=" -fno-builtin -fno-rtti -fno-exceptions" 181 182# Compiler flag to allow reflexive dlopens. 183export_dynamic_flag_spec="\${wl}--export-dynamic" 184 185# Compiler flag to generate shared objects directly from archives. 186whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive" 187 188# Compiler flag to generate thread-safe objects. 189thread_safe_flag_spec="" 190 191# Library versioning type. 192version_type=none 193 194# Format of library name prefix. 195libname_spec="lib\$name" 196 197# List of archive names. First name is the real one, the rest are links. 198# The last name is the one that the linker finds with -lNAME. 199library_names_spec="" 200 201# The coded name of the library, if different from the real name. 202soname_spec="" 203 204# Commands used to build and install an old-style archive. 205RANLIB="ranlib" 206old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib" 207old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib" 208old_postuninstall_cmds="" 209 210# Create an old-style archive from a shared archive. 211old_archive_from_new_cmds="" 212 213# Create a temporary old-style archive to link instead of a shared archive. 214old_archive_from_expsyms_cmds="" 215 216# Commands used to build and install a shared archive. 217archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib" 218archive_expsym_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib" 219postinstall_cmds="" 220postuninstall_cmds="" 221 222# Commands used to build a loadable module (assumed same as above if empty) 223module_cmds="" 224module_expsym_cmds="" 225 226# Commands to strip libraries. 227old_striplib="strip --strip-debug" 228striplib="strip --strip-unneeded" 229 230# Dependencies to place before the objects being linked to create a 231# shared library. 232predep_objects=`echo "" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"` 233 234# Dependencies to place after the objects being linked to create a 235# shared library. 236postdep_objects=`echo "" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"` 237 238# Dependencies to place before the objects being linked to create a 239# shared library. 240predeps="" 241 242# Dependencies to place after the objects being linked to create a 243# shared library. 244postdeps="" 245 246# The library search path used internally by the compiler when linking 247# a shared library. 248compiler_lib_search_path=`echo "" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"` 249 250# Method to check whether dependent libraries are shared objects. 251deplibs_check_method="unknown" 252 253# Command to use when deplibs_check_method == file_magic. 254file_magic_cmd="\$MAGIC_CMD" 255 256# Flag that allows shared libraries with undefined symbols to be built. 257allow_undefined_flag="" 258 259# Flag that forces no undefined symbols. 260no_undefined_flag="" 261 262# Commands used to finish a libtool library installation in a directory. 263finish_cmds="" 264 265# Same as above, but a single script fragment to be evaled but not shown. 266finish_eval="" 267 268# Take the output of nm and produce a listing of raw symbols and C names. 269global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'" 270 271# Transform the output of nm in a proper C declaration 272global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'" 273 274# Transform the output of nm in a C name address pair 275global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'" 276 277# This is the shared library runtime path variable. 278runpath_var=LD_RUN_PATH 279 280# This is the shared library path variable. 281shlibpath_var= 282 283# Is shlibpath searched before the hard-coded library search path? 284shlibpath_overrides_runpath=unknown 285 286# How to hardcode a shared library path into an executable. 287hardcode_action=immediate 288 289# Whether we should hardcode library paths into libraries. 290hardcode_into_libs=no 291 292# Flag to hardcode $libdir into a binary during linking. 293# This must work even if $libdir does not exist. 294hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir" 295 296# If ld is used when linking, flag to hardcode $libdir into 297# a binary during linking. This must work even if $libdir does 298# not exist. 299hardcode_libdir_flag_spec_ld="" 300 301# Whether we need a single -rpath flag with a separated argument. 302hardcode_libdir_separator="" 303 304# Set to yes if using DIR/libNAME during linking hardcodes DIR into the 305# resulting binary. 306hardcode_direct=no 307 308# Set to yes if using the -LDIR flag during linking hardcodes DIR into the 309# resulting binary. 310hardcode_minus_L=no 311 312# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into 313# the resulting binary. 314hardcode_shlibpath_var=unsupported 315 316# Set to yes if building a shared library automatically hardcodes DIR into the library 317# and all subsequent libraries and executables linked against it. 318hardcode_automatic=no 319 320# Variables whose values should be saved in libtool wrapper scripts and 321# restored at relink time. 322variables_saved_for_relink="PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" 323 324# Whether libtool must link a program against all its dependency libraries. 325link_all_deplibs=unknown 326 327# Compile-time system search path for libraries 328sys_lib_search_path_spec=`echo " /opt/brcm/hndtools-mipsel-linux-3.2.3/lib/gcc-lib/mipsel-linux/3.2.3/ /usr/lib/gcc/mipsel-linux/3.2.3/ /opt/brcm/hndtools-mipsel-linux-3.2.3/lib/gcc-lib/mipsel-linux/3.2.3/../../../../mipsel-linux/lib/mipsel-linux/3.2.3/ /opt/brcm/hndtools-mipsel-linux-3.2.3/lib/gcc-lib/mipsel-linux/3.2.3/../../../../mipsel-linux/lib/" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"` 329 330# Run-time system search path for libraries 331sys_lib_dlsearch_path_spec="/lib /usr/lib" 332 333# Fix the shell variable $srcfile for the compiler. 334fix_srcfile_path="" 335 336# Set to yes if exported symbols are required. 337always_export_symbols=no 338 339# The commands to list exported symbols. 340export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols" 341 342# The commands to extract the exported symbol list from a shared archive. 343extract_expsyms_cmds="" 344 345# Symbols that should not be listed in the preloaded symbols. 346exclude_expsyms="_GLOBAL_OFFSET_TABLE_" 347 348# Symbols that must always be exported. 349include_expsyms="" 350 351# ### END LIBTOOL CONFIG 352 353# ltmain.sh - Provide generalized library-building support services. 354# NOTE: Changing this file will not affect anything until you rerun configure. 355# 356# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 357# Free Software Foundation, Inc. 358# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 359# 360# This program is free software; you can redistribute it and/or modify 361# it under the terms of the GNU General Public License as published by 362# the Free Software Foundation; either version 2 of the License, or 363# (at your option) any later version. 364# 365# This program is distributed in the hope that it will be useful, but 366# WITHOUT ANY WARRANTY; without even the implied warranty of 367# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 368# General Public License for more details. 369# 370# You should have received a copy of the GNU General Public License 371# along with this program; if not, write to the Free Software 372# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 373# 374# As a special exception to the GNU General Public License, if you 375# distribute this file as part of a program that contains a 376# configuration script generated by Autoconf, you may include it under 377# the same distribution terms that you use for the rest of that program. 378 379basename="s,^.*/,,g" 380 381# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh 382# is ksh but when the shell is invoked as "sh" and the current value of 383# the _XPG environment variable is not equal to 1 (one), the special 384# positional parameter $0, within a function call, is the name of the 385# function. 386progpath="$0" 387 388# define SED for historic ltconfig's generated by Libtool 1.3 389test -z "$SED" && SED=sed 390 391# The name of this program: 392progname=`echo "$progpath" | $SED $basename` 393modename="$progname" 394 395# Global variables: 396EXIT_SUCCESS=0 397EXIT_FAILURE=1 398 399PROGRAM=ltmain.sh 400PACKAGE=libtool 401VERSION=1.5.22 402TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" 403 404# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). 405if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then 406 emulate sh 407 NULLCMD=: 408 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which 409 # is contrary to our usage. Disable this feature. 410 alias -g '${1+"$@"}'='"$@"' 411 setopt NO_GLOB_SUBST 412else 413 case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac 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. 469for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES 470do 471 eval "if test \"\${$lt_var+set}\" = set; then 472 save_$lt_var=\$$lt_var 473 $lt_var=C 474 export $lt_var 475 fi" 476done 477 478# Make sure IFS has a sensible default 479lt_nl=' 480' 481IFS=" $lt_nl" 482 483if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then 484 $echo "$modename: not configured to build any kind of library" 1>&2 485 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 486 exit $EXIT_FAILURE 487fi 488 489# Global variables. 490mode=$default_mode 491nonopt= 492prev= 493prevopt= 494run= 495show="$echo" 496show_help= 497execute_dlfiles= 498duplicate_deps=no 499preserve_args= 500lo2o="s/\\.lo\$/.${objext}/" 501o2lo="s/\\.${objext}\$/.lo/" 502extracted_archives= 503extracted_serial=0 504 505##################################### 506# Shell function definitions: 507# This seems to be the best place for them 508 509# func_mktempdir [string] 510# Make a temporary directory that won't clash with other running 511# libtool processes, and avoids race conditions if possible. If 512# given, STRING is the basename for that directory. 513func_mktempdir () 514{ 515 my_template="${TMPDIR-/tmp}/${1-$progname}" 516 517 if test "$run" = ":"; then 518 # Return a directory name, but don't create it in dry-run mode 519 my_tmpdir="${my_template}-$$" 520 else 521 522 # If mktemp works, use that first and foremost 523 my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` 524 525 if test ! -d "$my_tmpdir"; then 526 # Failing that, at least try and use $RANDOM to avoid a race 527 my_tmpdir="${my_template}-${RANDOM-0}$$" 528 529 save_mktempdir_umask=`umask` 530 umask 0077 531 $mkdir "$my_tmpdir" 532 umask $save_mktempdir_umask 533 fi 534 535 # If we're not in dry-run mode, bomb out on failure 536 test -d "$my_tmpdir" || { 537 $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 538 exit $EXIT_FAILURE 539 } 540 fi 541 542 $echo "X$my_tmpdir" | $Xsed 543} 544 545 546# func_win32_libid arg 547# return the library type of file 'arg' 548# 549# Need a lot of goo to handle *both* DLLs and import libs 550# Has to be a shell function in order to 'eat' the argument 551# that is supplied when $file_magic_command is called. 552func_win32_libid () 553{ 554 win32_libid_type="unknown" 555 win32_fileres=`file -L $1 2>/dev/null` 556 case $win32_fileres in 557 *ar\ archive\ import\ library*) # definitely import 558 win32_libid_type="x86 archive import" 559 ;; 560 *ar\ archive*) # could be an import, or static 561 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ 562 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then 563 win32_nmres=`eval $NM -f posix -A $1 | \ 564 $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'` 565 case $win32_nmres in 566 import*) win32_libid_type="x86 archive import";; 567 *) win32_libid_type="x86 archive static";; 568 esac 569 fi 570 ;; 571 *DLL*) 572 win32_libid_type="x86 DLL" 573 ;; 574 *executable*) # but shell scripts are "executable" too... 575 case $win32_fileres in 576 *MS\ Windows\ PE\ Intel*) 577 win32_libid_type="x86 DLL" 578 ;; 579 esac 580 ;; 581 esac 582 $echo $win32_libid_type 583} 584 585 586# func_infer_tag arg 587# Infer tagged configuration to use if any are available and 588# if one wasn't chosen via the "--tag" command line option. 589# Only attempt this if the compiler in the base compile 590# command doesn't match the default compiler. 591# arg is usually of the form 'gcc ...' 592func_infer_tag () 593{ 594 if test -n "$available_tags" && test -z "$tagname"; then 595 CC_quoted= 596 for arg in $CC; do 597 case $arg in 598 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 599 arg="\"$arg\"" 600 ;; 601 esac 602 CC_quoted="$CC_quoted $arg" 603 done 604 case $@ in 605 # Blanks in the command may have been stripped by the calling shell, 606 # but not from the CC environment variable when configure was run. 607 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; 608 # Blanks at the start of $base_compile will cause this to fail 609 # if we don't check for them as well. 610 *) 611 for z in $available_tags; do 612 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then 613 # Evaluate the configuration. 614 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" 615 CC_quoted= 616 for arg in $CC; do 617 # Double-quote args containing other shell metacharacters. 618 case $arg in 619 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 620 arg="\"$arg\"" 621 ;; 622 esac 623 CC_quoted="$CC_quoted $arg" 624 done 625 case "$@ " in 626 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) 627 # The compiler in the base compile command matches 628 # the one in the tagged configuration. 629 # Assume this is the tagged configuration we want. 630 tagname=$z 631 break 632 ;; 633 esac 634 fi 635 done 636 # If $tagname still isn't set, then no tagged configuration 637 # was found and let the user know that the "--tag" command 638 # line option must be used. 639 if test -z "$tagname"; then 640 $echo "$modename: unable to infer tagged configuration" 641 $echo "$modename: specify a tag with \`--tag'" 1>&2 642 exit $EXIT_FAILURE 643# else 644# $echo "$modename: using $tagname tagged configuration" 645 fi 646 ;; 647 esac 648 fi 649} 650 651 652# func_extract_an_archive dir oldlib 653func_extract_an_archive () 654{ 655 f_ex_an_ar_dir="$1"; shift 656 f_ex_an_ar_oldlib="$1" 657 658 $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" 659 $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? 660 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then 661 : 662 else 663 $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 664 exit $EXIT_FAILURE 665 fi 666} 667 668# func_extract_archives gentop oldlib ... 669func_extract_archives () 670{ 671 my_gentop="$1"; shift 672 my_oldlibs=${1+"$@"} 673 my_oldobjs="" 674 my_xlib="" 675 my_xabs="" 676 my_xdir="" 677 my_status="" 678 679 $show "${rm}r $my_gentop" 680 $run ${rm}r "$my_gentop" 681 $show "$mkdir $my_gentop" 682 $run $mkdir "$my_gentop" 683 my_status=$? 684 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then 685 exit $my_status 686 fi 687 688 for my_xlib in $my_oldlibs; do 689 # Extract the objects. 690 case $my_xlib in 691 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; 692 *) my_xabs=`pwd`"/$my_xlib" ;; 693 esac 694 my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` 695 my_xlib_u=$my_xlib 696 while :; do 697 case " $extracted_archives " in 698 *" $my_xlib_u "*) 699 extracted_serial=`expr $extracted_serial + 1` 700 my_xlib_u=lt$extracted_serial-$my_xlib ;; 701 *) break ;; 702 esac 703 done 704 extracted_archives="$extracted_archives $my_xlib_u" 705 my_xdir="$my_gentop/$my_xlib_u" 706 707 $show "${rm}r $my_xdir" 708 $run ${rm}r "$my_xdir" 709 $show "$mkdir $my_xdir" 710 $run $mkdir "$my_xdir" 711 exit_status=$? 712 if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then 713 exit $exit_status 714 fi 715 case $host in 716 *-darwin*) 717 $show "Extracting $my_xabs" 718 # Do not bother doing anything if just a dry run 719 if test -z "$run"; then 720 darwin_orig_dir=`pwd` 721 cd $my_xdir || exit $? 722 darwin_archive=$my_xabs 723 darwin_curdir=`pwd` 724 darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` 725 darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` 726 if test -n "$darwin_arches"; then 727 darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` 728 darwin_arch= 729 $show "$darwin_base_archive has multiple architectures $darwin_arches" 730 for darwin_arch in $darwin_arches ; do 731 mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" 732 lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" 733 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" 734 func_extract_an_archive "`pwd`" "${darwin_base_archive}" 735 cd "$darwin_curdir" 736 $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" 737 done # $darwin_arches 738 ## Okay now we have a bunch of thin objects, gotta fatten them up :) 739 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` 740 darwin_file= 741 darwin_files= 742 for darwin_file in $darwin_filelist; do 743 darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` 744 lipo -create -output "$darwin_file" $darwin_files 745 done # $darwin_filelist 746 ${rm}r unfat-$$ 747 cd "$darwin_orig_dir" 748 else 749 cd "$darwin_orig_dir" 750 func_extract_an_archive "$my_xdir" "$my_xabs" 751 fi # $darwin_arches 752 fi # $run 753 ;; 754 *) 755 func_extract_an_archive "$my_xdir" "$my_xabs" 756 ;; 757 esac 758 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` 759 done 760 func_extract_archives_result="$my_oldobjs" 761} 762# End of Shell function definitions 763##################################### 764 765# Darwin sucks 766#eval std_shrext=\"$shrext_cmds\" 767 768# And fixing for Darwin sucks for everybody else 769if test -z "$shrext_cmds" && test -n "$shrext"; then 770 eval shrext_cmds=\"$shrext\" 771fi 772 773eval std_shrext=\"$shrext_cmds\" 774 775# This value is evaluated to 32768, so place it here as a compatilibity hack 776# because older libtool.m4 didn't define this variable 777test -z "$max_cmd_len" && max_cmd_len=32768 778 779disable_libs=no 780 781# Parse our command line options once, thoroughly. 782while test "$#" -gt 0 783do 784 arg="$1" 785 shift 786 787 case $arg in 788 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; 789 *) optarg= ;; 790 esac 791 792 # If the previous option needs an argument, assign it. 793 if test -n "$prev"; then 794 case $prev in 795 execute_dlfiles) 796 execute_dlfiles="$execute_dlfiles $arg" 797 ;; 798 tag) 799 tagname="$arg" 800 preserve_args="${preserve_args}=$arg" 801 802 # Check whether tagname contains only valid characters 803 case $tagname in 804 *[!-_A-Za-z0-9,/]*) 805 $echo "$progname: invalid tag name: $tagname" 1>&2 806 exit $EXIT_FAILURE 807 ;; 808 esac 809 810 case $tagname in 811 CC) 812 # Don't test for the "default" C tag, as we know, it's there, but 813 # not specially marked. 814 ;; 815 *) 816 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then 817 taglist="$taglist $tagname" 818 # Evaluate the configuration. 819 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" 820 else 821 $echo "$progname: ignoring unknown tag $tagname" 1>&2 822 fi 823 ;; 824 esac 825 ;; 826 *) 827 eval "$prev=\$arg" 828 ;; 829 esac 830 831 prev= 832 prevopt= 833 continue 834 fi 835 836 # Have we seen a non-optional argument yet? 837 case $arg in 838 --help) 839 show_help=yes 840 ;; 841 842 --version) 843 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" 844 $echo 845 $echo "Copyright (C) 2005 Free Software Foundation, Inc." 846 $echo "This is free software; see the source for copying conditions. There is NO" 847 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 848 exit $? 849 ;; 850 851 --config) 852 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath 853 # Now print the configurations for the tags. 854 for tagname in $taglist; do 855 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" 856 done 857 exit $? 858 ;; 859 860 --debug) 861 $echo "$progname: enabling shell trace mode" 862 set -x 863 preserve_args="$preserve_args $arg" 864 ;; 865 866 --dry-run | -n) 867 run=: 868 ;; 869 870 --features) 871 $echo "host: $host" 872 if test "$build_libtool_libs" = yes; then 873 $echo "enable shared libraries" 874 else 875 $echo "disable shared libraries" 876 fi 877 if test "$build_old_libs" = yes; then 878 $echo "enable static libraries" 879 else 880 $echo "disable static libraries" 881 fi 882 exit $? 883 ;; 884 885 --finish) mode="finish" ;; 886 887 --mode) prevopt="--mode" prev=mode ;; 888 --mode=*) mode="$optarg" ;; 889 890 --preserve-dup-deps) duplicate_deps="yes" ;; 891 892 --quiet | --silent) 893 show=: 894 preserve_args="$preserve_args $arg" 895 ;; 896 897 --tag) 898 prevopt="--tag" 899 prev=tag 900 preserve_args="$preserve_args --tag" 901 ;; 902 --tag=*) 903 set tag "$optarg" ${1+"$@"} 904 shift 905 prev=tag 906 preserve_args="$preserve_args --tag" 907 ;; 908 909 -dlopen) 910 prevopt="-dlopen" 911 prev=execute_dlfiles 912 ;; 913 914 -*) 915 $echo "$modename: unrecognized option \`$arg'" 1>&2 916 $echo "$help" 1>&2 917 exit $EXIT_FAILURE 918 ;; 919 920 *) 921 nonopt="$arg" 922 break 923 ;; 924 esac 925done 926 927if test -n "$prevopt"; then 928 $echo "$modename: option \`$prevopt' requires an argument" 1>&2 929 $echo "$help" 1>&2 930 exit $EXIT_FAILURE 931fi 932 933case $disable_libs in 934no) 935 ;; 936shared) 937 build_libtool_libs=no 938 build_old_libs=yes 939 ;; 940static) 941 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` 942 ;; 943esac 944 945# If this variable is set in any of the actions, the command in it 946# will be execed at the end. This prevents here-documents from being 947# left over by shells. 948exec_cmd= 949 950if test -z "$show_help"; then 951 952 # Infer the operation mode. 953 if test -z "$mode"; then 954 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 955 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 956 case $nonopt in 957 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) 958 mode=link 959 for arg 960 do 961 case $arg in 962 -c) 963 mode=compile 964 break 965 ;; 966 esac 967 done 968 ;; 969 *db | *dbx | *strace | *truss) 970 mode=execute 971 ;; 972 *install*|cp|mv) 973 mode=install 974 ;; 975 *rm) 976 mode=uninstall 977 ;; 978 *) 979 # If we have no mode, but dlfiles were specified, then do execute mode. 980 test -n "$execute_dlfiles" && mode=execute 981 982 # Just use the default operation mode. 983 if test -z "$mode"; then 984 if test -n "$nonopt"; then 985 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 986 else 987 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 988 fi 989 fi 990 ;; 991 esac 992 fi 993 994 # Only execute mode is allowed to have -dlopen flags. 995 if test -n "$execute_dlfiles" && test "$mode" != execute; then 996 $echo "$modename: unrecognized option \`-dlopen'" 1>&2 997 $echo "$help" 1>&2 998 exit $EXIT_FAILURE 999 fi 1000 1001 # Change the help message to a mode-specific one. 1002 generic_help="$help" 1003 help="Try \`$modename --help --mode=$mode' for more information." 1004 1005 # These modes are in order of execution frequency so that they run quickly. 1006 case $mode in 1007 # libtool compile mode 1008 compile) 1009 modename="$modename: compile" 1010 # Get the compilation command and the source file. 1011 base_compile= 1012 srcfile="$nonopt" # always keep a non-empty value in "srcfile" 1013 suppress_opt=yes 1014 suppress_output= 1015 arg_mode=normal 1016 libobj= 1017 later= 1018 1019 for arg 1020 do 1021 case $arg_mode in 1022 arg ) 1023 # do not "continue". Instead, add this to base_compile 1024 lastarg="$arg" 1025 arg_mode=normal 1026 ;; 1027 1028 target ) 1029 libobj="$arg" 1030 arg_mode=normal 1031 continue 1032 ;; 1033 1034 normal ) 1035 # Accept any command-line options. 1036 case $arg in 1037 -o) 1038 if test -n "$libobj" ; then 1039 $echo "$modename: you cannot specify \`-o' more than once" 1>&2 1040 exit $EXIT_FAILURE 1041 fi 1042 arg_mode=target 1043 continue 1044 ;; 1045 1046 -static | -prefer-pic | -prefer-non-pic) 1047 later="$later $arg" 1048 continue 1049 ;; 1050 1051 -no-suppress) 1052 suppress_opt=no 1053 continue 1054 ;; 1055 1056 -Xcompiler) 1057 arg_mode=arg # the next one goes into the "base_compile" arg list 1058 continue # The current "srcfile" will either be retained or 1059 ;; # replaced later. I would guess that would be a bug. 1060 1061 -Wc,*) 1062 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` 1063 lastarg= 1064 save_ifs="$IFS"; IFS=',' 1065 for arg in $args; do 1066 IFS="$save_ifs" 1067 1068 # Double-quote args containing other shell metacharacters. 1069 # Many Bourne shells cannot handle close brackets correctly 1070 # in scan sets, so we specify it separately. 1071 case $arg in 1072 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 1073 arg="\"$arg\"" 1074 ;; 1075 esac 1076 lastarg="$lastarg $arg" 1077 done 1078 IFS="$save_ifs" 1079 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` 1080 1081 # Add the arguments to base_compile. 1082 base_compile="$base_compile $lastarg" 1083 continue 1084 ;; 1085 1086 * ) 1087 # Accept the current argument as the source file. 1088 # The previous "srcfile" becomes the current argument. 1089 # 1090 lastarg="$srcfile" 1091 srcfile="$arg" 1092 ;; 1093 esac # case $arg 1094 ;; 1095 esac # case $arg_mode 1096 1097 # Aesthetically quote the previous argument. 1098 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` 1099 1100 case $lastarg in 1101 # Double-quote args containing other shell metacharacters. 1102 # Many Bourne shells cannot handle close brackets correctly 1103 # in scan sets, and some SunOS ksh mistreat backslash-escaping 1104 # in scan sets (worked around with variable expansion), 1105 # and furthermore cannot handle '|' '&' '(' ')' in scan sets 1106 # at all, so we specify them separately. 1107 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 1108 lastarg="\"$lastarg\"" 1109 ;; 1110 esac 1111 1112 base_compile="$base_compile $lastarg" 1113 done # for arg 1114 1115 case $arg_mode in 1116 arg) 1117 $echo "$modename: you must specify an argument for -Xcompile" 1118 exit $EXIT_FAILURE 1119 ;; 1120 target) 1121 $echo "$modename: you must specify a target with \`-o'" 1>&2 1122 exit $EXIT_FAILURE 1123 ;; 1124 *) 1125 # Get the name of the library object. 1126 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` 1127 ;; 1128 esac 1129 1130 # Recognize several different file suffixes. 1131 # If the user specifies -o file.o, it is replaced with file.lo 1132 xform='[cCFSifmso]' 1133 case $libobj in 1134 *.ada) xform=ada ;; 1135 *.adb) xform=adb ;; 1136 *.ads) xform=ads ;; 1137 *.asm) xform=asm ;; 1138 *.c++) xform=c++ ;; 1139 *.cc) xform=cc ;; 1140 *.ii) xform=ii ;; 1141 *.class) xform=class ;; 1142 *.cpp) xform=cpp ;; 1143 *.cxx) xform=cxx ;; 1144 *.f90) xform=f90 ;; 1145 *.for) xform=for ;; 1146 *.java) xform=java ;; 1147 *.obj) xform=obj ;; 1148 esac 1149 1150 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` 1151 1152 case $libobj in 1153 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; 1154 *) 1155 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 1156 exit $EXIT_FAILURE 1157 ;; 1158 esac 1159 1160 func_infer_tag $base_compile 1161 1162 for arg in $later; do 1163 case $arg in 1164 -static) 1165 build_old_libs=yes 1166 continue 1167 ;; 1168 1169 -prefer-pic) 1170 pic_mode=yes 1171 continue 1172 ;; 1173 1174 -prefer-non-pic) 1175 pic_mode=no 1176 continue 1177 ;; 1178 esac 1179 done 1180 1181 qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` 1182 case $qlibobj in 1183 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 1184 qlibobj="\"$qlibobj\"" ;; 1185 esac 1186 test "X$libobj" != "X$qlibobj" \ 1187 && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ 1188 && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." 1189 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` 1190 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` 1191 if test "X$xdir" = "X$obj"; then 1192 xdir= 1193 else 1194 xdir=$xdir/ 1195 fi 1196 lobj=${xdir}$objdir/$objname 1197 1198 if test -z "$base_compile"; then 1199 $echo "$modename: you must specify a compilation command" 1>&2 1200 $echo "$help" 1>&2 1201 exit $EXIT_FAILURE 1202 fi 1203 1204 # Delete any leftover library objects. 1205 if test "$build_old_libs" = yes; then 1206 removelist="$obj $lobj $libobj ${libobj}T" 1207 else 1208 removelist="$lobj $libobj ${libobj}T" 1209 fi 1210 1211 $run $rm $removelist 1212 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 1213 1214 # On Cygwin there's no "real" PIC flag so we must build both object types 1215 case $host_os in 1216 cygwin* | mingw* | pw32* | os2*) 1217 pic_mode=default 1218 ;; 1219 esac 1220 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then 1221 # non-PIC code in shared libraries is not supported 1222 pic_mode=default 1223 fi 1224 1225 # Calculate the filename of the output object if compiler does 1226 # not support -o with -c 1227 if test "$compiler_c_o" = no; then 1228 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} 1229 lockfile="$output_obj.lock" 1230 removelist="$removelist $output_obj $lockfile" 1231 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 1232 else 1233 output_obj= 1234 need_locks=no 1235 lockfile= 1236 fi 1237 1238 # Lock this critical section if it is needed 1239 # We use this script file to make the link, it avoids creating a new file 1240 if test "$need_locks" = yes; then 1241 until $run ln "$progpath" "$lockfile" 2>/dev/null; do 1242 $show "Waiting for $lockfile to be removed" 1243 sleep 2 1244 done 1245 elif test "$need_locks" = warn; then 1246 if test -f "$lockfile"; then 1247 $echo "\ 1248*** ERROR, $lockfile exists and contains: 1249`cat $lockfile 2>/dev/null` 1250 1251This indicates that another process is trying to use the same 1252temporary object file, and libtool could not work around it because 1253your compiler does not support \`-c' and \`-o' together. If you 1254repeat this compilation, it may succeed, by chance, but you had better 1255avoid parallel builds (make -j) in this platform, or get a better 1256compiler." 1257 1258 $run $rm $removelist 1259 exit $EXIT_FAILURE 1260 fi 1261 $echo "$srcfile" > "$lockfile" 1262 fi 1263 1264 if test -n "$fix_srcfile_path"; then 1265 eval srcfile=\"$fix_srcfile_path\" 1266 fi 1267 qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` 1268 case $qsrcfile in 1269 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 1270 qsrcfile="\"$qsrcfile\"" ;; 1271 esac 1272 1273 $run $rm "$libobj" "${libobj}T" 1274 1275 # Create a libtool object file (analogous to a ".la" file), 1276 # but don't create it if we're doing a dry run. 1277 test -z "$run" && cat > ${libobj}T <<EOF 1278# $libobj - a libtool object file 1279# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP 1280# 1281# Please DO NOT delete this file! 1282# It is necessary for linking the library. 1283 1284# Name of the PIC object. 1285EOF 1286 1287 # Only build a PIC object if we are building libtool libraries. 1288 if test "$build_libtool_libs" = yes; then 1289 # Without this assignment, base_compile gets emptied. 1290 fbsd_hideous_sh_bug=$base_compile 1291 1292 if test "$pic_mode" != no; then 1293 command="$base_compile $qsrcfile $pic_flag" 1294 else 1295 # Don't build PIC code 1296 command="$base_compile $qsrcfile" 1297 fi 1298 1299 if test ! -d "${xdir}$objdir"; then 1300 $show "$mkdir ${xdir}$objdir" 1301 $run $mkdir ${xdir}$objdir 1302 exit_status=$? 1303 if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then 1304 exit $exit_status 1305 fi 1306 fi 1307 1308 if test -z "$output_obj"; then 1309 # Place PIC objects in $objdir 1310 command="$command -o $lobj" 1311 fi 1312 1313 $run $rm "$lobj" "$output_obj" 1314 1315 $show "$command" 1316 if $run eval "$command"; then : 1317 else 1318 test -n "$output_obj" && $run $rm $removelist 1319 exit $EXIT_FAILURE 1320 fi 1321 1322 if test "$need_locks" = warn && 1323 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then 1324 $echo "\ 1325*** ERROR, $lockfile contains: 1326`cat $lockfile 2>/dev/null` 1327 1328but it should contain: 1329$srcfile 1330 1331This indicates that another process is trying to use the same 1332temporary object file, and libtool could not work around it because 1333your compiler does not support \`-c' and \`-o' together. If you 1334repeat this compilation, it may succeed, by chance, but you had better 1335avoid parallel builds (make -j) in this platform, or get a better 1336compiler." 1337 1338 $run $rm $removelist 1339 exit $EXIT_FAILURE 1340 fi 1341 1342 # Just move the object if needed, then go on to compile the next one 1343 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then 1344 $show "$mv $output_obj $lobj" 1345 if $run $mv $output_obj $lobj; then : 1346 else 1347 error=$? 1348 $run $rm $removelist 1349 exit $error 1350 fi 1351 fi 1352 1353 # Append the name of the PIC object to the libtool object file. 1354 test -z "$run" && cat >> ${libobj}T <<EOF 1355pic_object='$objdir/$objname' 1356 1357EOF 1358 1359 # Allow error messages only from the first compilation. 1360 if test "$suppress_opt" = yes; then 1361 suppress_output=' >/dev/null 2>&1' 1362 fi 1363 else 1364 # No PIC object so indicate it doesn't exist in the libtool 1365 # object file. 1366 test -z "$run" && cat >> ${libobj}T <<EOF 1367pic_object=none 1368 1369EOF 1370 fi 1371 1372 # Only build a position-dependent object if we build old libraries. 1373 if test "$build_old_libs" = yes; then 1374 if test "$pic_mode" != yes; then 1375 # Don't build PIC code 1376 command="$base_compile $qsrcfile" 1377 else 1378 command="$base_compile $qsrcfile $pic_flag" 1379 fi 1380 if test "$compiler_c_o" = yes; then 1381 command="$command -o $obj" 1382 fi 1383 1384 # Suppress compiler output if we already did a PIC compilation. 1385 command="$command$suppress_output" 1386 $run $rm "$obj" "$output_obj" 1387 $show "$command" 1388 if $run eval "$command"; then : 1389 else 1390 $run $rm $removelist 1391 exit $EXIT_FAILURE 1392 fi 1393 1394 if test "$need_locks" = warn && 1395 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then 1396 $echo "\ 1397*** ERROR, $lockfile contains: 1398`cat $lockfile 2>/dev/null` 1399 1400but it should contain: 1401$srcfile 1402 1403This indicates that another process is trying to use the same 1404temporary object file, and libtool could not work around it because 1405your compiler does not support \`-c' and \`-o' together. If you 1406repeat this compilation, it may succeed, by chance, but you had better 1407avoid parallel builds (make -j) in this platform, or get a better 1408compiler." 1409 1410 $run $rm $removelist 1411 exit $EXIT_FAILURE 1412 fi 1413 1414 # Just move the object if needed 1415 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then 1416 $show "$mv $output_obj $obj" 1417 if $run $mv $output_obj $obj; then : 1418 else 1419 error=$? 1420 $run $rm $removelist 1421 exit $error 1422 fi 1423 fi 1424 1425 # Append the name of the non-PIC object the libtool object file. 1426 # Only append if the libtool object file exists. 1427 test -z "$run" && cat >> ${libobj}T <<EOF 1428# Name of the non-PIC object. 1429non_pic_object='$objname' 1430 1431EOF 1432 else 1433 # Append the name of the non-PIC object the libtool object file. 1434 # Only append if the libtool object file exists. 1435 test -z "$run" && cat >> ${libobj}T <<EOF 1436# Name of the non-PIC object. 1437non_pic_object=none 1438 1439EOF 1440 fi 1441 1442 $run $mv "${libobj}T" "${libobj}" 1443 1444 # Unlock the critical section if it was locked 1445 if test "$need_locks" != no; then 1446 $run $rm "$lockfile" 1447 fi 1448 1449 exit $EXIT_SUCCESS 1450 ;; 1451 1452 # libtool link mode 1453 link | relink) 1454 modename="$modename: link" 1455 case $host in 1456 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) 1457 # It is impossible to link a dll without this setting, and 1458 # we shouldn't force the makefile maintainer to figure out 1459 # which system we are compiling for in order to pass an extra 1460 # flag for every libtool invocation. 1461 # allow_undefined=no 1462 1463 # FIXME: Unfortunately, there are problems with the above when trying 1464 # to make a dll which has undefined symbols, in which case not 1465 # even a static library is built. For now, we need to specify 1466 # -no-undefined on the libtool link line when we can be certain 1467 # that all symbols are satisfied, otherwise we get a static library. 1468 allow_undefined=yes 1469 ;; 1470 *) 1471 allow_undefined=yes 1472 ;; 1473 esac 1474 libtool_args="$nonopt" 1475 base_compile="$nonopt $@" 1476 compile_command="$nonopt" 1477 finalize_command="$nonopt" 1478 1479 compile_rpath= 1480 finalize_rpath= 1481 compile_shlibpath= 1482 finalize_shlibpath= 1483 convenience= 1484 old_convenience= 1485 deplibs= 1486 old_deplibs= 1487 compiler_flags= 1488 linker_flags= 1489 dllsearchpath= 1490 lib_search_path=`pwd` 1491 inst_prefix_dir= 1492 1493 avoid_version=no 1494 dlfiles= 1495 dlprefiles= 1496 dlself=no 1497 export_dynamic=no 1498 export_symbols= 1499 export_symbols_regex= 1500 generated= 1501 libobjs= 1502 ltlibs= 1503 module=no 1504 no_install=no 1505 objs= 1506 non_pic_objects= 1507 notinst_path= # paths that contain not-installed libtool libraries 1508 precious_files_regex= 1509 prefer_static_libs=no 1510 preload=no 1511 prev= 1512 prevarg= 1513 release= 1514 rpath= 1515 xrpath= 1516 perm_rpath= 1517 temp_rpath= 1518 thread_safe=no 1519 vinfo= 1520 vinfo_number=no 1521 1522 func_infer_tag $base_compile 1523 1524 # We need to know -static, to get the right output filenames. 1525 for arg 1526 do 1527 case $arg in 1528 -all-static | -static | -static-libtool-libs) 1529 case $arg in 1530 -all-static) 1531 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then 1532 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 1533 fi 1534 if test -n "$link_static_flag"; then 1535 dlopen_self=$dlopen_self_static 1536 fi 1537 prefer_static_libs=yes 1538 ;; 1539 -static) 1540 if test -z "$pic_flag" && test -n "$link_static_flag"; then 1541 dlopen_self=$dlopen_self_static 1542 fi 1543 prefer_static_libs=built 1544 ;; 1545 -static-libtool-libs) 1546 if test -z "$pic_flag" && test -n "$link_static_flag"; then 1547 dlopen_self=$dlopen_self_static 1548 fi 1549 prefer_static_libs=yes 1550 ;; 1551 esac 1552 build_libtool_libs=no 1553 build_old_libs=yes 1554 break 1555 ;; 1556 esac 1557 done 1558 1559 # See if our shared archives depend on static archives. 1560 test -n "$old_archive_from_new_cmds" && build_old_libs=yes 1561 1562 # Go through the arguments, transforming them on the way. 1563 while test "$#" -gt 0; do 1564 arg="$1" 1565 shift 1566 case $arg in 1567 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 1568 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test 1569 ;; 1570 *) qarg=$arg ;; 1571 esac 1572 libtool_args="$libtool_args $qarg" 1573 1574 # If the previous option needs an argument, assign it. 1575 if test -n "$prev"; then 1576 case $prev in 1577 output) 1578 compile_command="$compile_command @OUTPUT@" 1579 finalize_command="$finalize_command @OUTPUT@" 1580 ;; 1581 esac 1582 1583 case $prev in 1584 dlfiles|dlprefiles) 1585 if test "$preload" = no; then 1586 # Add the symbol object into the linking commands. 1587 compile_command="$compile_command @SYMFILE@" 1588 finalize_command="$finalize_command @SYMFILE@" 1589 preload=yes 1590 fi 1591 case $arg in 1592 *.la | *.lo) ;; # We handle these cases below. 1593 force) 1594 if test "$dlself" = no; then 1595 dlself=needless 1596 export_dynamic=yes 1597 fi 1598 prev= 1599 continue 1600 ;; 1601 self) 1602 if test "$prev" = dlprefiles; then 1603 dlself=yes 1604 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then 1605 dlself=yes 1606 else 1607 dlself=needless 1608 export_dynamic=yes 1609 fi 1610 prev= 1611 continue 1612 ;; 1613 *) 1614 if test "$prev" = dlfiles; then 1615 dlfiles="$dlfiles $arg" 1616 else 1617 dlprefiles="$dlprefiles $arg" 1618 fi 1619 prev= 1620 continue 1621 ;; 1622 esac 1623 ;; 1624 expsyms) 1625 export_symbols="$arg" 1626 if test ! -f "$arg"; then 1627 $echo "$modename: symbol file \`$arg' does not exist" 1628 exit $EXIT_FAILURE 1629 fi 1630 prev= 1631 continue 1632 ;; 1633 expsyms_regex) 1634 export_symbols_regex="$arg" 1635 prev= 1636 continue 1637 ;; 1638 inst_prefix) 1639 inst_prefix_dir="$arg" 1640 prev= 1641 continue 1642 ;; 1643 precious_regex) 1644 precious_files_regex="$arg" 1645 prev= 1646 continue 1647 ;; 1648 release) 1649 release="-$arg" 1650 prev= 1651 continue 1652 ;; 1653 objectlist) 1654 if test -f "$arg"; then 1655 save_arg=$arg 1656 moreargs= 1657 for fil in `cat $save_arg` 1658 do 1659# moreargs="$moreargs $fil" 1660 arg=$fil 1661 # A libtool-controlled object. 1662 1663 # Check to see that this really is a libtool object. 1664 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 1665 pic_object= 1666 non_pic_object= 1667 1668 # Read the .lo file 1669 # If there is no directory component, then add one. 1670 case $arg in 1671 */* | *\\*) . $arg ;; 1672 *) . ./$arg ;; 1673 esac 1674 1675 if test -z "$pic_object" || \ 1676 test -z "$non_pic_object" || 1677 test "$pic_object" = none && \ 1678 test "$non_pic_object" = none; then 1679 $echo "$modename: cannot find name of object for \`$arg'" 1>&2 1680 exit $EXIT_FAILURE 1681 fi 1682 1683 # Extract subdirectory from the argument. 1684 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` 1685 if test "X$xdir" = "X$arg"; then 1686 xdir= 1687 else 1688 xdir="$xdir/" 1689 fi 1690 1691 if test "$pic_object" != none; then 1692 # Prepend the subdirectory the object is found in. 1693 pic_object="$xdir$pic_object" 1694 1695 if test "$prev" = dlfiles; then 1696 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then 1697 dlfiles="$dlfiles $pic_object" 1698 prev= 1699 continue 1700 else 1701 # If libtool objects are unsupported, then we need to preload. 1702 prev=dlprefiles 1703 fi 1704 fi 1705 1706 # CHECK ME: I think I busted this. -Ossama 1707 if test "$prev" = dlprefiles; then 1708 # Preload the old-style object. 1709 dlprefiles="$dlprefiles $pic_object" 1710 prev= 1711 fi 1712 1713 # A PIC object. 1714 libobjs="$libobjs $pic_object" 1715 arg="$pic_object" 1716 fi 1717 1718 # Non-PIC object. 1719 if test "$non_pic_object" != none; then 1720 # Prepend the subdirectory the object is found in. 1721 non_pic_object="$xdir$non_pic_object" 1722 1723 # A standard non-PIC object 1724 non_pic_objects="$non_pic_objects $non_pic_object" 1725 if test -z "$pic_object" || test "$pic_object" = none ; then 1726 arg="$non_pic_object" 1727 fi 1728 else 1729 # If the PIC object exists, use it instead. 1730 # $xdir was prepended to $pic_object above. 1731 non_pic_object="$pic_object" 1732 non_pic_objects="$non_pic_objects $non_pic_object" 1733 fi 1734 else 1735 # Only an error if not doing a dry-run. 1736 if test -z "$run"; then 1737 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 1738 exit $EXIT_FAILURE 1739 else 1740 # Dry-run case. 1741 1742 # Extract subdirectory from the argument. 1743 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` 1744 if test "X$xdir" = "X$arg"; then 1745 xdir= 1746 else 1747 xdir="$xdir/" 1748 fi 1749 1750 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` 1751 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` 1752 libobjs="$libobjs $pic_object" 1753 non_pic_objects="$non_pic_objects $non_pic_object" 1754 fi 1755 fi 1756 done 1757 else 1758 $echo "$modename: link input file \`$save_arg' does not exist" 1759 exit $EXIT_FAILURE 1760 fi 1761 arg=$save_arg 1762 prev= 1763 continue 1764 ;; 1765 rpath | xrpath) 1766 # We need an absolute path. 1767 case $arg in 1768 [\\/]* | [A-Za-z]:[\\/]*) ;; 1769 *) 1770 $echo "$modename: only absolute run-paths are allowed" 1>&2 1771 exit $EXIT_FAILURE 1772 ;; 1773 esac 1774 if test "$prev" = rpath; then 1775 case "$rpath " in 1776 *" $arg "*) ;; 1777 *) rpath="$rpath $arg" ;; 1778 esac 1779 else 1780 case "$xrpath " in 1781 *" $arg "*) ;; 1782 *) xrpath="$xrpath $arg" ;; 1783 esac 1784 fi 1785 prev= 1786 continue 1787 ;; 1788 xcompiler) 1789 compiler_flags="$compiler_flags $qarg" 1790 prev= 1791 compile_command="$compile_command $qarg" 1792 finalize_command="$finalize_command $qarg" 1793 continue 1794 ;; 1795 xlinker) 1796 linker_flags="$linker_flags $qarg" 1797 compiler_flags="$compiler_flags $wl$qarg" 1798 prev= 1799 compile_command="$compile_command $wl$qarg" 1800 finalize_command="$finalize_command $wl$qarg" 1801 continue 1802 ;; 1803 xcclinker) 1804 linker_flags="$linker_flags $qarg" 1805 compiler_flags="$compiler_flags $qarg" 1806 prev= 1807 compile_command="$compile_command $qarg" 1808 finalize_command="$finalize_command $qarg" 1809 continue 1810 ;; 1811 shrext) 1812 shrext_cmds="$arg" 1813 prev= 1814 continue 1815 ;; 1816 darwin_framework|darwin_framework_skip) 1817 test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" 1818 compile_command="$compile_command $arg" 1819 finalize_command="$finalize_command $arg" 1820 prev= 1821 continue 1822 ;; 1823 *) 1824 eval "$prev=\"\$arg\"" 1825 prev= 1826 continue 1827 ;; 1828 esac 1829 fi # test -n "$prev" 1830 1831 prevarg="$arg" 1832 1833 case $arg in 1834 -all-static) 1835 if test -n "$link_static_flag"; then 1836 compile_command="$compile_command $link_static_flag" 1837 finalize_command="$finalize_command $link_static_flag" 1838 fi 1839 continue 1840 ;; 1841 1842 -allow-undefined) 1843 # FIXME: remove this flag sometime in the future. 1844 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 1845 continue 1846 ;; 1847 1848 -avoid-version) 1849 avoid_version=yes 1850 continue 1851 ;; 1852 1853 -dlopen) 1854 prev=dlfiles 1855 continue 1856 ;; 1857 1858 -dlpreopen) 1859 prev=dlprefiles 1860 continue 1861 ;; 1862 1863 -export-dynamic) 1864 export_dynamic=yes 1865 continue 1866 ;; 1867 1868 -export-symbols | -export-symbols-regex) 1869 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then 1870 $echo "$modename: more than one -exported-symbols argument is not allowed" 1871 exit $EXIT_FAILURE 1872 fi 1873 if test "X$arg" = "X-export-symbols"; then 1874 prev=expsyms 1875 else 1876 prev=expsyms_regex 1877 fi 1878 continue 1879 ;; 1880 1881 -framework|-arch|-isysroot) 1882 case " $CC " in 1883 *" ${arg} ${1} "* | *" ${arg} ${1} "*) 1884 prev=darwin_framework_skip ;; 1885 *) compiler_flags="$compiler_flags $arg" 1886 prev=darwin_framework ;; 1887 esac 1888 compile_command="$compile_command $arg" 1889 finalize_command="$finalize_command $arg" 1890 continue 1891 ;; 1892 1893 -inst-prefix-dir) 1894 prev=inst_prefix 1895 continue 1896 ;; 1897 1898 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* 1899 # so, if we see these flags be careful not to treat them like -L 1900 -L[A-Z][A-Z]*:*) 1901 case $with_gcc/$host in 1902 no/*-*-irix* | /*-*-irix*) 1903 compile_command="$compile_command $arg" 1904 finalize_command="$finalize_command $arg" 1905 ;; 1906 esac 1907 continue 1908 ;; 1909 1910 -L*) 1911 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` 1912 # We need an absolute path. 1913 case $dir in 1914 [\\/]* | [A-Za-z]:[\\/]*) ;; 1915 *) 1916 absdir=`cd "$dir" && pwd` 1917 if test -z "$absdir"; then 1918 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 1919 absdir="$dir" 1920 notinst_path="$notinst_path $dir" 1921 fi 1922 dir="$absdir" 1923 ;; 1924 esac 1925 case "$deplibs " in 1926 *" -L$dir "*) ;; 1927 *) 1928 deplibs="$deplibs -L$dir" 1929 lib_search_path="$lib_search_path $dir" 1930 ;; 1931 esac 1932 case $host in 1933 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) 1934 testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` 1935 case :$dllsearchpath: in 1936 *":$dir:"*) ;; 1937 *) dllsearchpath="$dllsearchpath:$dir";; 1938 esac 1939 case :$dllsearchpath: in 1940 *":$testbindir:"*) ;; 1941 *) dllsearchpath="$dllsearchpath:$testbindir";; 1942 esac 1943 ;; 1944 esac 1945 continue 1946 ;; 1947 1948 -l*) 1949 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then 1950 case $host in 1951 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) 1952 # These systems don't actually have a C or math library (as such) 1953 continue 1954 ;; 1955 *-*-os2*) 1956 # These systems don't actually have a C library (as such) 1957 test "X$arg" = "X-lc" && continue 1958 ;; 1959 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) 1960 # Do not include libc due to us having libc/libc_r. 1961 test "X$arg" = "X-lc" && continue 1962 ;; 1963 *-*-rhapsody* | *-*-darwin1.[012]) 1964 # Rhapsody C and math libraries are in the System framework 1965 deplibs="$deplibs -framework System" 1966 continue 1967 ;; 1968 *-*-sco3.2v5* | *-*-sco5v6*) 1969 # Causes problems with __ctype 1970 test "X$arg" = "X-lc" && continue 1971 ;; 1972 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) 1973 # Compiler inserts libc in the correct place for threads to work 1974 test "X$arg" = "X-lc" && continue 1975 ;; 1976 esac 1977 elif test "X$arg" = "X-lc_r"; then 1978 case $host in 1979 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) 1980 # Do not include libc_r directly, use -pthread flag. 1981 continue 1982 ;; 1983 esac 1984 fi 1985 deplibs="$deplibs $arg" 1986 continue 1987 ;; 1988 1989 # Tru64 UNIX uses -model [arg] to determine the layout of C++ 1990 # classes, name mangling, and exception handling. 1991 -model) 1992 compile_command="$compile_command $arg" 1993 compiler_flags="$compiler_flags $arg" 1994 finalize_command="$finalize_command $arg" 1995 prev=xcompiler 1996 continue 1997 ;; 1998 1999 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) 2000 compiler_flags="$compiler_flags $arg" 2001 compile_command="$compile_command $arg" 2002 finalize_command="$finalize_command $arg" 2003 continue 2004 ;; 2005 2006 -module) 2007 module=yes 2008 continue 2009 ;; 2010 2011 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler 2012 # -r[0-9][0-9]* specifies the processor on the SGI compiler 2013 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler 2014 # +DA*, +DD* enable 64-bit mode on the HP compiler 2015 # -q* pass through compiler args for the IBM compiler 2016 # -m* pass through architecture-specific compiler args for GCC 2017 # -m*, -t[45]*, -txscale* pass through architecture-specific 2018 # compiler args for GCC 2019 # -pg pass through profiling flag for GCC 2020 # @file GCC response files 2021 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ 2022 -t[45]*|-txscale*|@*) 2023 2024 # Unknown arguments in both finalize_command and compile_command need 2025 # to be aesthetically quoted because they are evaled later. 2026 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` 2027 case $arg in 2028 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 2029 arg="\"$arg\"" 2030 ;; 2031 esac 2032 compile_command="$compile_command $arg" 2033 finalize_command="$finalize_command $arg" 2034 compiler_flags="$compiler_flags $arg" 2035 continue 2036 ;; 2037 2038 -shrext) 2039 prev=shrext 2040 continue 2041 ;; 2042 2043 -no-fast-install) 2044 fast_install=no 2045 continue 2046 ;; 2047 2048 -no-install) 2049 case $host in 2050 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) 2051 # The PATH hackery in wrapper scripts is required on Windows 2052 # in order for the loader to find any dlls it needs. 2053 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 2054 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 2055 fast_install=no 2056 ;; 2057 *) no_install=yes ;; 2058 esac 2059 continue 2060 ;; 2061 2062 -no-undefined) 2063 allow_undefined=no 2064 continue 2065 ;; 2066 2067 -objectlist) 2068 prev=objectlist 2069 continue 2070 ;; 2071 2072 -o) prev=output ;; 2073 2074 -precious-files-regex) 2075 prev=precious_regex 2076 continue 2077 ;; 2078 2079 -release) 2080 prev=release 2081 continue 2082 ;; 2083 2084 -rpath) 2085 prev=rpath 2086 continue 2087 ;; 2088 2089 -R) 2090 prev=xrpath 2091 continue 2092 ;; 2093 2094 -R*) 2095 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` 2096 # We need an absolute path. 2097 case $dir in 2098 [\\/]* | [A-Za-z]:[\\/]*) ;; 2099 *) 2100 $echo "$modename: only absolute run-paths are allowed" 1>&2 2101 exit $EXIT_FAILURE 2102 ;; 2103 esac 2104 case "$xrpath " in 2105 *" $dir "*) ;; 2106 *) xrpath="$xrpath $dir" ;; 2107 esac 2108 continue 2109 ;; 2110 2111 -static | -static-libtool-libs) 2112 # The effects of -static are defined in a previous loop. 2113 # We used to do the same as -all-static on platforms that 2114 # didn't have a PIC flag, but the assumption that the effects 2115 # would be equivalent was wrong. It would break on at least 2116 # Digital Unix and AIX. 2117 continue 2118 ;; 2119 2120 -thread-safe) 2121 thread_safe=yes 2122 continue 2123 ;; 2124 2125 -version-info) 2126 prev=vinfo 2127 continue 2128 ;; 2129 -version-number) 2130 prev=vinfo 2131 vinfo_number=yes 2132 continue 2133 ;; 2134 2135 -Wc,*) 2136 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` 2137 arg= 2138 save_ifs="$IFS"; IFS=',' 2139 for flag in $args; do 2140 IFS="$save_ifs" 2141 case $flag in 2142 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 2143 flag="\"$flag\"" 2144 ;; 2145 esac 2146 arg="$arg $wl$flag" 2147 compiler_flags="$compiler_flags $flag" 2148 done 2149 IFS="$save_ifs" 2150 arg=`$echo "X$arg" | $Xsed -e "s/^ //"` 2151 ;; 2152 2153 -Wl,*) 2154 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` 2155 arg= 2156 save_ifs="$IFS"; IFS=',' 2157 for flag in $args; do 2158 IFS="$save_ifs" 2159 case $flag in 2160 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 2161 flag="\"$flag\"" 2162 ;; 2163 esac 2164 arg="$arg $wl$flag" 2165 compiler_flags="$compiler_flags $wl$flag" 2166 linker_flags="$linker_flags $flag" 2167 done 2168 IFS="$save_ifs" 2169 arg=`$echo "X$arg" | $Xsed -e "s/^ //"` 2170 ;; 2171 2172 -Xcompiler) 2173 prev=xcompiler 2174 continue 2175 ;; 2176 2177 -Xlinker) 2178 prev=xlinker 2179 continue 2180 ;; 2181 2182 -XCClinker) 2183 prev=xcclinker 2184 continue 2185 ;; 2186 2187 # Some other compiler flag. 2188 -* | +*) 2189 # Unknown arguments in both finalize_command and compile_command need 2190 # to be aesthetically quoted because they are evaled later. 2191 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` 2192 case $arg in 2193 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 2194 arg="\"$arg\"" 2195 ;; 2196 esac 2197 ;; 2198 2199 *.$objext) 2200 # A standard object. 2201 objs="$objs $arg" 2202 ;; 2203 2204 *.lo) 2205 # A libtool-controlled object. 2206 2207 # Check to see that this really is a libtool object. 2208 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 2209 pic_object= 2210 non_pic_object= 2211 2212 # Read the .lo file 2213 # If there is no directory component, then add one. 2214 case $arg in 2215 */* | *\\*) . $arg ;; 2216 *) . ./$arg ;; 2217 esac 2218 2219 if test -z "$pic_object" || \ 2220 test -z "$non_pic_object" || 2221 test "$pic_object" = none && \ 2222 test "$non_pic_object" = none; then 2223 $echo "$modename: cannot find name of object for \`$arg'" 1>&2 2224 exit $EXIT_FAILURE 2225 fi 2226 2227 # Extract subdirectory from the argument. 2228 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` 2229 if test "X$xdir" = "X$arg"; then 2230 xdir= 2231 else 2232 xdir="$xdir/" 2233 fi 2234 2235 if test "$pic_object" != none; then 2236 # Prepend the subdirectory the object is found in. 2237 pic_object="$xdir$pic_object" 2238 2239 if test "$prev" = dlfiles; then 2240 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then 2241 dlfiles="$dlfiles $pic_object" 2242 prev= 2243 continue 2244 else 2245 # If libtool objects are unsupported, then we need to preload. 2246 prev=dlprefiles 2247 fi 2248 fi 2249 2250 # CHECK ME: I think I busted this. -Ossama 2251 if test "$prev" = dlprefiles; then 2252 # Preload the old-style object. 2253 dlprefiles="$dlprefiles $pic_object" 2254 prev= 2255 fi 2256 2257 # A PIC object. 2258 libobjs="$libobjs $pic_object" 2259 arg="$pic_object" 2260 fi 2261 2262 # Non-PIC object. 2263 if test "$non_pic_object" != none; then 2264 # Prepend the subdirectory the object is found in. 2265 non_pic_object="$xdir$non_pic_object" 2266 2267 # A standard non-PIC object 2268 non_pic_objects="$non_pic_objects $non_pic_object" 2269 if test -z "$pic_object" || test "$pic_object" = none ; then 2270 arg="$non_pic_object" 2271 fi 2272 else 2273 # If the PIC object exists, use it instead. 2274 # $xdir was prepended to $pic_object above. 2275 non_pic_object="$pic_object" 2276 non_pic_objects="$non_pic_objects $non_pic_object" 2277 fi 2278 else 2279 # Only an error if not doing a dry-run. 2280 if test -z "$run"; then 2281 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 2282 exit $EXIT_FAILURE 2283 else 2284 # Dry-run case. 2285 2286 # Extract subdirectory from the argument. 2287 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` 2288 if test "X$xdir" = "X$arg"; then 2289 xdir= 2290 else 2291 xdir="$xdir/" 2292 fi 2293 2294 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` 2295 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` 2296 libobjs="$libobjs $pic_object" 2297 non_pic_objects="$non_pic_objects $non_pic_object" 2298 fi 2299 fi 2300 ;; 2301 2302 *.$libext) 2303 # An archive. 2304 deplibs="$deplibs $arg" 2305 old_deplibs="$old_deplibs $arg" 2306 continue 2307 ;; 2308 2309 *.la) 2310 # A libtool-controlled library. 2311 2312 if test "$prev" = dlfiles; then 2313 # This library was specified with -dlopen. 2314 dlfiles="$dlfiles $arg" 2315 prev= 2316 elif test "$prev" = dlprefiles; then 2317 # The library was specified with -dlpreopen. 2318 dlprefiles="$dlprefiles $arg" 2319 prev= 2320 else 2321 deplibs="$deplibs $arg" 2322 fi 2323 continue 2324 ;; 2325 2326 # Some other compiler argument. 2327 *) 2328 # Unknown arguments in both finalize_command and compile_command need 2329 # to be aesthetically quoted because they are evaled later. 2330 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` 2331 case $arg in 2332 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 2333 arg="\"$arg\"" 2334 ;; 2335 esac 2336 ;; 2337 esac # arg 2338 2339 # Now actually substitute the argument into the commands. 2340 if test -n "$arg"; then 2341 compile_command="$compile_command $arg" 2342 finalize_command="$finalize_command $arg" 2343 fi 2344 done # argument parsing loop 2345 2346 if test -n "$prev"; then 2347 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 2348 $echo "$help" 1>&2 2349 exit $EXIT_FAILURE 2350 fi 2351 2352 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then 2353 eval arg=\"$export_dynamic_flag_spec\" 2354 compile_command="$compile_command $arg" 2355 finalize_command="$finalize_command $arg" 2356 fi 2357 2358 oldlibs= 2359 # calculate the name of the file, without its directory 2360 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` 2361 libobjs_save="$libobjs" 2362 2363 if test -n "$shlibpath_var"; then 2364 # get the directories listed in $shlibpath_var 2365 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` 2366 else 2367 shlib_search_path= 2368 fi 2369 eval sys_lib_search_path=\"$sys_lib_search_path_spec\" 2370 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" 2371 2372 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` 2373 if test "X$output_objdir" = "X$output"; then 2374 output_objdir="$objdir" 2375 else 2376 output_objdir="$output_objdir/$objdir" 2377 fi 2378 # Create the object directory. 2379 if test ! -d "$output_objdir"; then 2380 $show "$mkdir $output_objdir" 2381 $run $mkdir $output_objdir 2382 exit_status=$? 2383 if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then 2384 exit $exit_status 2385 fi 2386 fi 2387 2388 # Determine the type of output 2389 case $output in 2390 "") 2391 $echo "$modename: you must specify an output file" 1>&2 2392 $echo "$help" 1>&2 2393 exit $EXIT_FAILURE 2394 ;; 2395 *.$libext) linkmode=oldlib ;; 2396 *.lo | *.$objext) linkmode=obj ;; 2397 *.la) linkmode=lib ;; 2398 *) linkmode=prog ;; # Anything else should be a program. 2399 esac 2400 2401 case $host in 2402 *cygwin* | *mingw* | *pw32*) 2403 # don't eliminate duplications in $postdeps and $predeps 2404 duplicate_compiler_generated_deps=yes 2405 ;; 2406 *) 2407 duplicate_compiler_generated_deps=$duplicate_deps 2408 ;; 2409 esac 2410 specialdeplibs= 2411 2412 libs= 2413 # Find all interdependent deplibs by searching for libraries 2414 # that are linked more than once (e.g. -la -lb -la) 2415 for deplib in $deplibs; do 2416 if test "X$duplicate_deps" = "Xyes" ; then 2417 case "$libs " in 2418 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; 2419 esac 2420 fi 2421 libs="$libs $deplib" 2422 done 2423 2424 if test "$linkmode" = lib; then 2425 libs="$predeps $libs $compiler_lib_search_path $postdeps" 2426 2427 # Compute libraries that are listed more than once in $predeps 2428 # $postdeps and mark them as special (i.e., whose duplicates are 2429 # not to be eliminated). 2430 pre_post_deps= 2431 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then 2432 for pre_post_dep in $predeps $postdeps; do 2433 case "$pre_post_deps " in 2434 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; 2435 esac 2436 pre_post_deps="$pre_post_deps $pre_post_dep" 2437 done 2438 fi 2439 pre_post_deps= 2440 fi 2441 2442 deplibs= 2443 newdependency_libs= 2444 newlib_search_path= 2445 need_relink=no # whether we're linking any uninstalled libtool libraries 2446 notinst_deplibs= # not-installed libtool libraries 2447 case $linkmode in 2448 lib) 2449 passes="conv link" 2450 for file in $dlfiles $dlprefiles; do 2451 case $file in 2452 *.la) ;; 2453 *) 2454 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 2455 exit $EXIT_FAILURE 2456 ;; 2457 esac 2458 done 2459 ;; 2460 prog) 2461 compile_deplibs= 2462 finalize_deplibs= 2463 alldeplibs=no 2464 newdlfiles= 2465 newdlprefiles= 2466 passes="conv scan dlopen dlpreopen link" 2467 ;; 2468 *) passes="conv" 2469 ;; 2470 esac 2471 for pass in $passes; do 2472 if test "$linkmode,$pass" = "lib,link" || 2473 test "$linkmode,$pass" = "prog,scan"; then 2474 libs="$deplibs" 2475 deplibs= 2476 fi 2477 if test "$linkmode" = prog; then 2478 case $pass in 2479 dlopen) libs="$dlfiles" ;; 2480 dlpreopen) libs="$dlprefiles" ;; 2481 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; 2482 esac 2483 fi 2484 if test "$pass" = dlopen; then 2485 # Collect dlpreopened libraries 2486 save_deplibs="$deplibs" 2487 deplibs= 2488 fi 2489 for deplib in $libs; do 2490 lib= 2491 found=no 2492 case $deplib in 2493 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) 2494 if test "$linkmode,$pass" = "prog,link"; then 2495 compile_deplibs="$deplib $compile_deplibs" 2496 finalize_deplibs="$deplib $finalize_deplibs" 2497 else 2498 compiler_flags="$compiler_flags $deplib" 2499 fi 2500 continue 2501 ;; 2502 -l*) 2503 if test "$linkmode" != lib && test "$linkmode" != prog; then 2504 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 2505 continue 2506 fi 2507 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` 2508 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do 2509 for search_ext in .la $std_shrext .so .a; do 2510 # Search the libtool library 2511 lib="$searchdir/lib${name}${search_ext}" 2512 if test -f "$lib"; then 2513 if test "$search_ext" = ".la"; then 2514 found=yes 2515 else 2516 found=no 2517 fi 2518 break 2 2519 fi 2520 done 2521 done 2522 if test "$found" != yes; then 2523 # deplib doesn't seem to be a libtool library 2524 if test "$linkmode,$pass" = "prog,link"; then 2525 compile_deplibs="$deplib $compile_deplibs" 2526 finalize_deplibs="$deplib $finalize_deplibs" 2527 else 2528 deplibs="$deplib $deplibs" 2529 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" 2530 fi 2531 continue 2532 else # deplib is a libtool library 2533 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, 2534 # We need to do some special things here, and not later. 2535 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 2536 case " $predeps $postdeps " in 2537 *" $deplib "*) 2538 if (${SED} -e '2q' $lib | 2539 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 2540 library_names= 2541 old_library= 2542 case $lib in 2543 */* | *\\*) . $lib ;; 2544 *) . ./$lib ;; 2545 esac 2546 for l in $old_library $library_names; do 2547 ll="$l" 2548 done 2549 if test "X$ll" = "X$old_library" ; then # only static version available 2550 found=no 2551 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` 2552 test "X$ladir" = "X$lib" && ladir="." 2553 lib=$ladir/$old_library 2554 if test "$linkmode,$pass" = "prog,link"; then 2555 compile_deplibs="$deplib $compile_deplibs" 2556 finalize_deplibs="$deplib $finalize_deplibs" 2557 else 2558 deplibs="$deplib $deplibs" 2559 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" 2560 fi 2561 continue 2562 fi 2563 fi 2564 ;; 2565 *) ;; 2566 esac 2567 fi 2568 fi 2569 ;; # -l 2570 -L*) 2571 case $linkmode in 2572 lib) 2573 deplibs="$deplib $deplibs" 2574 test "$pass" = conv && continue 2575 newdependency_libs="$deplib $newdependency_libs" 2576 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` 2577 ;; 2578 prog) 2579 if test "$pass" = conv; then 2580 deplibs="$deplib $deplibs" 2581 continue 2582 fi 2583 if test "$pass" = scan; then 2584 deplibs="$deplib $deplibs" 2585 else 2586 compile_deplibs="$deplib $compile_deplibs" 2587 finalize_deplibs="$deplib $finalize_deplibs" 2588 fi 2589 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` 2590 ;; 2591 *) 2592 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 2593 ;; 2594 esac # linkmode 2595 continue 2596 ;; # -L 2597 -R*) 2598 if test "$pass" = link; then 2599 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` 2600 # Make sure the xrpath contains only unique directories. 2601 case "$xrpath " in 2602 *" $dir "*) ;; 2603 *) xrpath="$xrpath $dir" ;; 2604 esac 2605 fi 2606 deplibs="$deplib $deplibs" 2607 continue 2608 ;; 2609 *.la) lib="$deplib" ;; 2610 *.$libext) 2611 if test "$pass" = conv; then 2612 deplibs="$deplib $deplibs" 2613 continue 2614 fi 2615 case $linkmode in 2616 lib) 2617 valid_a_lib=no 2618 case $deplibs_check_method in 2619 match_pattern*) 2620 set dummy $deplibs_check_method 2621 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 2622 if eval $echo \"$deplib\" 2>/dev/null \ 2623 | $SED 10q \ 2624 | $EGREP "$match_pattern_regex" > /dev/null; then 2625 valid_a_lib=yes 2626 fi 2627 ;; 2628 pass_all) 2629 valid_a_lib=yes 2630 ;; 2631 esac 2632 if test "$valid_a_lib" != yes; then 2633 $echo 2634 $echo "*** Warning: Trying to link with static lib archive $deplib." 2635 $echo "*** I have the capability to make that library automatically link in when" 2636 $echo "*** you link to this library. But I can only do this if you have a" 2637 $echo "*** shared version of the library, which you do not appear to have" 2638 $echo "*** because the file extensions .$libext of this argument makes me believe" 2639 $echo "*** that it is just a static archive that I should not used here." 2640 else 2641 $echo 2642 $echo "*** Warning: Linking the shared library $output against the" 2643 $echo "*** static library $deplib is not portable!" 2644 deplibs="$deplib $deplibs" 2645 fi 2646 continue 2647 ;; 2648 prog) 2649 if test "$pass" != link; then 2650 deplibs="$deplib $deplibs" 2651 else 2652 compile_deplibs="$deplib $compile_deplibs" 2653 finalize_deplibs="$deplib $finalize_deplibs" 2654 fi 2655 continue 2656 ;; 2657 esac # linkmode 2658 ;; # *.$libext 2659 *.lo | *.$objext) 2660 if test "$pass" = conv; then 2661 deplibs="$deplib $deplibs" 2662 elif test "$linkmode" = prog; then 2663 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then 2664 # If there is no dlopen support or we're linking statically, 2665 # we need to preload. 2666 newdlprefiles="$newdlprefiles $deplib" 2667 compile_deplibs="$deplib $compile_deplibs" 2668 finalize_deplibs="$deplib $finalize_deplibs" 2669 else 2670 newdlfiles="$newdlfiles $deplib" 2671 fi 2672 fi 2673 continue 2674 ;; 2675 %DEPLIBS%) 2676 alldeplibs=yes 2677 continue 2678 ;; 2679 esac # case $deplib 2680 if test "$found" = yes || test -f "$lib"; then : 2681 else 2682 $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 2683 exit $EXIT_FAILURE 2684 fi 2685 2686 # Check to see that this really is a libtool archive. 2687 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : 2688 else 2689 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 2690 exit $EXIT_FAILURE 2691 fi 2692 2693 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` 2694 test "X$ladir" = "X$lib" && ladir="." 2695 2696 dlname= 2697 dlopen= 2698 dlpreopen= 2699 libdir= 2700 library_names= 2701 old_library= 2702 # If the library was installed with an old release of libtool, 2703 # it will not redefine variables installed, or shouldnotlink 2704 installed=yes 2705 shouldnotlink=no 2706 avoidtemprpath= 2707 2708 2709 # Read the .la file 2710 case $lib in 2711 */* | *\\*) . $lib ;; 2712 *) . ./$lib ;; 2713 esac 2714 2715 if test "$linkmode,$pass" = "lib,link" || 2716 test "$linkmode,$pass" = "prog,scan" || 2717 { test "$linkmode" != prog && test "$linkmode" != lib; }; then 2718 test -n "$dlopen" && dlfiles="$dlfiles $dlopen" 2719 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" 2720 fi 2721 2722 if test "$pass" = conv; then 2723 # Only check for convenience libraries 2724 deplibs="$lib $deplibs" 2725 if test -z "$libdir"; then 2726 if test -z "$old_library"; then 2727 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 2728 exit $EXIT_FAILURE 2729 fi 2730 # It is a libtool convenience library, so add in its objects. 2731 convenience="$convenience $ladir/$objdir/$old_library" 2732 old_convenience="$old_convenience $ladir/$objdir/$old_library" 2733 tmp_libs= 2734 for deplib in $dependency_libs; do 2735 deplibs="$deplib $deplibs" 2736 if test "X$duplicate_deps" = "Xyes" ; then 2737 case "$tmp_libs " in 2738 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; 2739 esac 2740 fi 2741 tmp_libs="$tmp_libs $deplib" 2742 done 2743 elif test "$linkmode" != prog && test "$linkmode" != lib; then 2744 $echo "$modename: \`$lib' is not a convenience library" 1>&2 2745 exit $EXIT_FAILURE 2746 fi 2747 continue 2748 fi # $pass = conv 2749 2750 2751 # Get the name of the library we link against. 2752 linklib= 2753 for l in $old_library $library_names; do 2754 linklib="$l" 2755 done 2756 if test -z "$linklib"; then 2757 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 2758 exit $EXIT_FAILURE 2759 fi 2760 2761 # This library was specified with -dlopen. 2762 if test "$pass" = dlopen; then 2763 if test -z "$libdir"; then 2764 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 2765 exit $EXIT_FAILURE 2766 fi 2767 if test -z "$dlname" || 2768 test "$dlopen_support" != yes || 2769 test "$build_libtool_libs" = no; then 2770 # If there is no dlname, no dlopen support or we're linking 2771 # statically, we need to preload. We also need to preload any 2772 # dependent libraries so libltdl's deplib preloader doesn't 2773 # bomb out in the load deplibs phase. 2774 dlprefiles="$dlprefiles $lib $dependency_libs" 2775 else 2776 newdlfiles="$newdlfiles $lib" 2777 fi 2778 continue 2779 fi # $pass = dlopen 2780 2781 # We need an absolute path. 2782 case $ladir in 2783 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; 2784 *) 2785 abs_ladir=`cd "$ladir" && pwd` 2786 if test -z "$abs_ladir"; then 2787 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 2788 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 2789 abs_ladir="$ladir" 2790 fi 2791 ;; 2792 esac 2793 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` 2794 2795 # Find the relevant object directory and library name. 2796 if test "X$installed" = Xyes; then 2797 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then 2798 $echo "$modename: warning: library \`$lib' was moved." 1>&2 2799 dir="$ladir" 2800 absdir="$abs_ladir" 2801 libdir="$abs_ladir" 2802 else 2803 dir="$libdir" 2804 absdir="$libdir" 2805 fi 2806 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes 2807 else 2808 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then 2809 dir="$ladir" 2810 absdir="$abs_ladir" 2811 # Remove this search path later 2812 notinst_path="$notinst_path $abs_ladir" 2813 else 2814 dir="$ladir/$objdir" 2815 absdir="$abs_ladir/$objdir" 2816 # Remove this search path later 2817 notinst_path="$notinst_path $abs_ladir" 2818 fi 2819 fi # $installed = yes 2820 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` 2821 2822 # This library was specified with -dlpreopen. 2823 if test "$pass" = dlpreopen; then 2824 if test -z "$libdir"; then 2825 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 2826 exit $EXIT_FAILURE 2827 fi 2828 # Prefer using a static library (so that no silly _DYNAMIC symbols 2829 # are required to link). 2830 if test -n "$old_library"; then 2831 newdlprefiles="$newdlprefiles $dir/$old_library" 2832 # Otherwise, use the dlname, so that lt_dlopen finds it. 2833 elif test -n "$dlname"; then 2834 newdlprefiles="$newdlprefiles $dir/$dlname" 2835 else 2836 newdlprefiles="$newdlprefiles $dir/$linklib" 2837 fi 2838 fi # $pass = dlpreopen 2839 2840 if test -z "$libdir"; then 2841 # Link the convenience library 2842 if test "$linkmode" = lib; then 2843 deplibs="$dir/$old_library $deplibs" 2844 elif test "$linkmode,$pass" = "prog,link"; then 2845 compile_deplibs="$dir/$old_library $compile_deplibs" 2846 finalize_deplibs="$dir/$old_library $finalize_deplibs" 2847 else 2848 deplibs="$lib $deplibs" # used for prog,scan pass 2849 fi 2850 continue 2851 fi 2852 2853 2854 if test "$linkmode" = prog && test "$pass" != link; then 2855 newlib_search_path="$newlib_search_path $ladir" 2856 deplibs="$lib $deplibs" 2857 2858 linkalldeplibs=no 2859 if test "$link_all_deplibs" != no || test -z "$library_names" || 2860 test "$build_libtool_libs" = no; then 2861 linkalldeplibs=yes 2862 fi 2863 2864 tmp_libs= 2865 for deplib in $dependency_libs; do 2866 case $deplib in 2867 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test 2868 esac 2869 # Need to link against all dependency_libs? 2870 if test "$linkalldeplibs" = yes; then 2871 deplibs="$deplib $deplibs" 2872 else 2873 # Need to hardcode shared library paths 2874 # or/and link against static libraries 2875 newdependency_libs="$deplib $newdependency_libs" 2876 fi 2877 if test "X$duplicate_deps" = "Xyes" ; then 2878 case "$tmp_libs " in 2879 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; 2880 esac 2881 fi 2882 tmp_libs="$tmp_libs $deplib" 2883 done # for deplib 2884 continue 2885 fi # $linkmode = prog... 2886 2887 if test "$linkmode,$pass" = "prog,link"; then 2888 if test -n "$library_names" && 2889 { { test "$prefer_static_libs" = no || 2890 test "$prefer_static_libs,$installed" = "built,yes"; } || 2891 test -z "$old_library"; }; then 2892 # We need to hardcode the library path 2893 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then 2894 # Make sure the rpath contains only unique directories. 2895 case "$temp_rpath " in 2896 *" $dir "*) ;; 2897 *" $absdir "*) ;; 2898 *) temp_rpath="$temp_rpath $absdir" ;; 2899 esac 2900 fi 2901 2902 # Hardcode the library path. 2903 # Skip directories that are in the system default run-time 2904 # search path. 2905 case " $sys_lib_dlsearch_path " in 2906 *" $absdir "*) ;; 2907 *) 2908 case "$compile_rpath " in 2909 *" $absdir "*) ;; 2910 *) compile_rpath="$compile_rpath $absdir" 2911 esac 2912 ;; 2913 esac 2914 case " $sys_lib_dlsearch_path " in 2915 *" $libdir "*) ;; 2916 *) 2917 case "$finalize_rpath " in 2918 *" $libdir "*) ;; 2919 *) finalize_rpath="$finalize_rpath $libdir" 2920 esac 2921 ;; 2922 esac 2923 fi # $linkmode,$pass = prog,link... 2924 2925 if test "$alldeplibs" = yes && 2926 { test "$deplibs_check_method" = pass_all || 2927 { test "$build_libtool_libs" = yes && 2928 test -n "$library_names"; }; }; then 2929 # We only need to search for static libraries 2930 continue 2931 fi 2932 fi 2933 2934 link_static=no # Whether the deplib will be linked statically 2935 use_static_libs=$prefer_static_libs 2936 if test "$use_static_libs" = built && test "$installed" = yes ; then 2937 use_static_libs=no 2938 fi 2939 if test -n "$library_names" && 2940 { test "$use_static_libs" = no || test -z "$old_library"; }; then 2941 if test "$installed" = no; then 2942 notinst_deplibs="$notinst_deplibs $lib" 2943 need_relink=yes 2944 fi 2945 # This is a shared library 2946 2947 # Warn about portability, can't link against -module's on 2948 # some systems (darwin) 2949 if test "$shouldnotlink" = yes && test "$pass" = link ; then 2950 $echo 2951 if test "$linkmode" = prog; then 2952 $echo "*** Warning: Linking the executable $output against the loadable module" 2953 else 2954 $echo "*** Warning: Linking the shared library $output against the loadable module" 2955 fi 2956 $echo "*** $linklib is not portable!" 2957 fi 2958 if test "$linkmode" = lib && 2959 test "$hardcode_into_libs" = yes; then 2960 # Hardcode the library path. 2961 # Skip directories that are in the system default run-time 2962 # search path. 2963 case " $sys_lib_dlsearch_path " in 2964 *" $absdir "*) ;; 2965 *) 2966 case "$compile_rpath " in 2967 *" $absdir "*) ;; 2968 *) compile_rpath="$compile_rpath $absdir" 2969 esac 2970 ;; 2971 esac 2972 case " $sys_lib_dlsearch_path " in 2973 *" $libdir "*) ;; 2974 *) 2975 case "$finalize_rpath " in 2976 *" $libdir "*) ;; 2977 *) finalize_rpath="$finalize_rpath $libdir" 2978 esac 2979 ;; 2980 esac 2981 fi 2982 2983 if test -n "$old_archive_from_expsyms_cmds"; then 2984 # figure out the soname 2985 set dummy $library_names 2986 realname="$2" 2987 shift; shift 2988 libname=`eval \\$echo \"$libname_spec\"` 2989 # use dlname if we got it. it's perfectly good, no? 2990 if test -n "$dlname"; then 2991 soname="$dlname" 2992 elif test -n "$soname_spec"; then 2993 # bleh windows 2994 case $host in 2995 *cygwin* | mingw*) 2996 major=`expr $current - $age` 2997 versuffix="-$major" 2998 ;; 2999 esac 3000 eval soname=\"$soname_spec\" 3001 else 3002 soname="$realname" 3003 fi 3004 3005 # Make a new name for the extract_expsyms_cmds to use 3006 soroot="$soname" 3007 soname=`$echo $soroot | ${SED} -e 's/^.*\///'` 3008 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" 3009 3010 # If the library has no export list, then create one now 3011 if test -f "$output_objdir/$soname-def"; then : 3012 else 3013 $show "extracting exported symbol list from \`$soname'" 3014 save_ifs="$IFS"; IFS='~' 3015 cmds=$extract_expsyms_cmds 3016 for cmd in $cmds; do 3017 IFS="$save_ifs" 3018 eval cmd=\"$cmd\" 3019 $show "$cmd" 3020 $run eval "$cmd" || exit $? 3021 done 3022 IFS="$save_ifs" 3023 fi 3024 3025 # Create $newlib 3026 if test -f "$output_objdir/$newlib"; then :; else 3027 $show "generating import library for \`$soname'" 3028 save_ifs="$IFS"; IFS='~' 3029 cmds=$old_archive_from_expsyms_cmds 3030 for cmd in $cmds; do 3031 IFS="$save_ifs" 3032 eval cmd=\"$cmd\" 3033 $show "$cmd" 3034 $run eval "$cmd" || exit $? 3035 done 3036 IFS="$save_ifs" 3037 fi 3038 # make sure the library variables are pointing to the new library 3039 dir=$output_objdir 3040 linklib=$newlib 3041 fi # test -n "$old_archive_from_expsyms_cmds" 3042 3043 if test "$linkmode" = prog || test "$mode" != relink; then 3044 add_shlibpath= 3045 add_dir= 3046 add= 3047 lib_linked=yes 3048 case $hardcode_action in 3049 immediate | unsupported) 3050 if test "$hardcode_direct" = no; then 3051 add="$dir/$linklib" 3052 case $host in 3053 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; 3054 *-*-sysv4*uw2*) add_dir="-L$dir" ;; 3055 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ 3056 *-*-unixware7*) add_dir="-L$dir" ;; 3057 *-*-darwin* ) 3058 # if the lib is a module then we can not link against 3059 # it, someone is ignoring the new warnings I added 3060 if /usr/bin/file -L $add 2> /dev/null | 3061 $EGREP ": [^:]* bundle" >/dev/null ; then 3062 $echo "** Warning, lib $linklib is a module, not a shared library" 3063 if test -z "$old_library" ; then 3064 $echo 3065 $echo "** And there doesn't seem to be a static archive available" 3066 $echo "** The link will probably fail, sorry" 3067 else 3068 add="$dir/$old_library" 3069 fi 3070 fi 3071 esac 3072 elif test "$hardcode_minus_L" = no; then 3073 case $host in 3074 *-*-sunos*) add_shlibpath="$dir" ;; 3075 esac 3076 add_dir="-L$dir" 3077 add="-l$name" 3078 elif test "$hardcode_shlibpath_var" = no; then 3079 add_shlibpath="$dir" 3080 add="-l$name" 3081 else 3082 lib_linked=no 3083 fi 3084 ;; 3085 relink) 3086 if test "$hardcode_direct" = yes; then 3087 add="$dir/$linklib" 3088 elif test "$hardcode_minus_L" = yes; then 3089 add_dir="-L$dir" 3090 # Try looking first in the location we're being installed to. 3091 if test -n "$inst_prefix_dir"; then 3092 case $libdir in 3093 [\\/]*) 3094 add_dir="$add_dir -L$inst_prefix_dir$libdir" 3095 ;; 3096 esac 3097 fi 3098 add="-l$name" 3099 elif test "$hardcode_shlibpath_var" = yes; then 3100 add_shlibpath="$dir" 3101 add="-l$name" 3102 else 3103 lib_linked=no 3104 fi 3105 ;; 3106 *) lib_linked=no ;; 3107 esac 3108 3109 if test "$lib_linked" != yes; then 3110 $echo "$modename: configuration error: unsupported hardcode properties" 3111 exit $EXIT_FAILURE 3112 fi 3113 3114 if test -n "$add_shlibpath"; then 3115 case :$compile_shlibpath: in 3116 *":$add_shlibpath:"*) ;; 3117 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; 3118 esac 3119 fi 3120 if test "$linkmode" = prog; then 3121 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" 3122 test -n "$add" && compile_deplibs="$add $compile_deplibs" 3123 else 3124 test -n "$add_dir" && deplibs="$add_dir $deplibs" 3125 test -n "$add" && deplibs="$add $deplibs" 3126 if test "$hardcode_direct" != yes && \ 3127 test "$hardcode_minus_L" != yes && \ 3128 test "$hardcode_shlibpath_var" = yes; then 3129 case :$finalize_shlibpath: in 3130 *":$libdir:"*) ;; 3131 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; 3132 esac 3133 fi 3134 fi 3135 fi 3136 3137 if test "$linkmode" = prog || test "$mode" = relink; then 3138 add_shlibpath= 3139 add_dir= 3140 add= 3141 # Finalize command for both is simple: just hardcode it. 3142 if test "$hardcode_direct" = yes; then 3143 add="$libdir/$linklib" 3144 elif test "$hardcode_minus_L" = yes; then 3145 add_dir="-L$libdir" 3146 add="-l$name" 3147 elif test "$hardcode_shlibpath_var" = yes; then 3148 case :$finalize_shlibpath: in 3149 *":$libdir:"*) ;; 3150 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; 3151 esac 3152 add="-l$name" 3153 elif test "$hardcode_automatic" = yes; then 3154 if test -n "$inst_prefix_dir" && 3155 test -f "$inst_prefix_dir$libdir/$linklib" ; then 3156 add="$inst_prefix_dir$libdir/$linklib" 3157 else 3158 add="$libdir/$linklib" 3159 fi 3160 else 3161 # We cannot seem to hardcode it, guess we'll fake it. 3162 add_dir="-L$libdir" 3163 # Try looking first in the location we're being installed to. 3164 if test -n "$inst_prefix_dir"; then 3165 case $libdir in 3166 [\\/]*) 3167 add_dir="$add_dir -L$inst_prefix_dir$libdir" 3168 ;; 3169 esac 3170 fi 3171 add="-l$name" 3172 fi 3173 3174 if test "$linkmode" = prog; then 3175 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" 3176 test -n "$add" && finalize_deplibs="$add $finalize_deplibs" 3177 else 3178 test -n "$add_dir" && deplibs="$add_dir $deplibs" 3179 test -n "$add" && deplibs="$add $deplibs" 3180 fi 3181 fi 3182 elif test "$linkmode" = prog; then 3183 # Here we assume that one of hardcode_direct or hardcode_minus_L 3184 # is not unsupported. This is valid on all known static and 3185 # shared platforms. 3186 if test "$hardcode_direct" != unsupported; then 3187 test -n "$old_library" && linklib="$old_library" 3188 compile_deplibs="$dir/$linklib $compile_deplibs" 3189 finalize_deplibs="$dir/$linklib $finalize_deplibs" 3190 else 3191 compile_deplibs="-l$name -L$dir $compile_deplibs" 3192 finalize_deplibs="-l$name -L$dir $finalize_deplibs" 3193 fi 3194 elif test "$build_libtool_libs" = yes; then 3195 # Not a shared library 3196 if test "$deplibs_check_method" != pass_all; then 3197 # We're trying link a shared library against a static one 3198 # but the system doesn't support it. 3199 3200 # Just print a warning and add the library to dependency_libs so 3201 # that the program can be linked against the static library. 3202 $echo 3203 $echo "*** Warning: This system can not link to static lib archive $lib." 3204 $echo "*** I have the capability to make that library automatically link in when" 3205 $echo "*** you link to this library. But I can only do this if you have a" 3206 $echo "*** shared version of the library, which you do not appear to have." 3207 if test "$module" = yes; then 3208 $echo "*** But as you try to build a module library, libtool will still create " 3209 $echo "*** a static module, that should work as long as the dlopening application" 3210 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." 3211 if test -z "$global_symbol_pipe"; then 3212 $echo 3213 $echo "*** However, this would only work if libtool was able to extract symbol" 3214 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" 3215 $echo "*** not find such a program. So, this module is probably useless." 3216 $echo "*** \`nm' from GNU binutils and a full rebuild may help." 3217 fi 3218 if test "$build_old_libs" = no; then 3219 build_libtool_libs=module 3220 build_old_libs=yes 3221 else 3222 build_libtool_libs=no 3223 fi 3224 fi 3225 else 3226 deplibs="$dir/$old_library $deplibs" 3227 link_static=yes 3228 fi 3229 fi # link shared/static library? 3230 3231 if test "$linkmode" = lib; then 3232 if test -n "$dependency_libs" && 3233 { test "$hardcode_into_libs" != yes || 3234 test "$build_old_libs" = yes || 3235 test "$link_static" = yes; }; then 3236 # Extract -R from dependency_libs 3237 temp_deplibs= 3238 for libdir in $dependency_libs; do 3239 case $libdir in 3240 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` 3241 case " $xrpath " in 3242 *" $temp_xrpath "*) ;; 3243 *) xrpath="$xrpath $temp_xrpath";; 3244 esac;; 3245 *) temp_deplibs="$temp_deplibs $libdir";; 3246 esac 3247 done 3248 dependency_libs="$temp_deplibs" 3249 fi 3250 3251 newlib_search_path="$newlib_search_path $absdir" 3252 # Link against this library 3253 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" 3254 # ... and its dependency_libs 3255 tmp_libs= 3256 for deplib in $dependency_libs; do 3257 newdependency_libs="$deplib $newdependency_libs" 3258 if test "X$duplicate_deps" = "Xyes" ; then 3259 case "$tmp_libs " in 3260 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; 3261 esac 3262 fi 3263 tmp_libs="$tmp_libs $deplib" 3264 done 3265 3266 if test "$link_all_deplibs" != no; then 3267 # Add the search paths of all dependency libraries 3268 for deplib in $dependency_libs; do 3269 case $deplib in 3270 -L*) path="$deplib" ;; 3271 *.la) 3272 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` 3273 test "X$dir" = "X$deplib" && dir="." 3274 # We need an absolute path. 3275 case $dir in 3276 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; 3277 *) 3278 absdir=`cd "$dir" && pwd` 3279 if test -z "$absdir"; then 3280 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 3281 absdir="$dir" 3282 fi 3283 ;; 3284 esac 3285 if grep "^installed=no" $deplib > /dev/null; then 3286 path="$absdir/$objdir" 3287 else 3288 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` 3289 if test -z "$libdir"; then 3290 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 3291 exit $EXIT_FAILURE 3292 fi 3293 if test "$absdir" != "$libdir"; then 3294 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 3295 fi 3296 path="$absdir" 3297 fi 3298 depdepl= 3299 case $host in 3300 *-*-darwin*) 3301 # we do not want to link against static libs, 3302 # but need to link against shared 3303 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` 3304 if test -n "$deplibrary_names" ; then 3305 for tmp in $deplibrary_names ; do 3306 depdepl=$tmp 3307 done 3308 if test -f "$path/$depdepl" ; then 3309 depdepl="$path/$depdepl" 3310 fi 3311 # do not add paths which are already there 3312 case " $newlib_search_path " in 3313 *" $path "*) ;; 3314 *) newlib_search_path="$newlib_search_path $path";; 3315 esac 3316 fi 3317 path="" 3318 ;; 3319 *) 3320 path="-L$path" 3321 ;; 3322 esac 3323 ;; 3324 -l*) 3325 case $host in 3326 *-*-darwin*) 3327 # Again, we only want to link against shared libraries 3328 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` 3329 for tmp in $newlib_search_path ; do 3330 if test -f "$tmp/lib$tmp_libs.dylib" ; then 3331 eval depdepl="$tmp/lib$tmp_libs.dylib" 3332 break 3333 fi 3334 done 3335 path="" 3336 ;; 3337 *) continue ;; 3338 esac 3339 ;; 3340 *) continue ;; 3341 esac 3342 case " $deplibs " in 3343 *" $path "*) ;; 3344 *) deplibs="$path $deplibs" ;; 3345 esac 3346 case " $deplibs " in 3347 *" $depdepl "*) ;; 3348 *) deplibs="$depdepl $deplibs" ;; 3349 esac 3350 done 3351 fi # link_all_deplibs != no 3352 fi # linkmode = lib 3353 done # for deplib in $libs 3354 dependency_libs="$newdependency_libs" 3355 if test "$pass" = dlpreopen; then 3356 # Link the dlpreopened libraries before other libraries 3357 for deplib in $save_deplibs; do 3358 deplibs="$deplib $deplibs" 3359 done 3360 fi 3361 if test "$pass" != dlopen; then 3362 if test "$pass" != conv; then 3363 # Make sure lib_search_path contains only unique directories. 3364 lib_search_path= 3365 for dir in $newlib_search_path; do 3366 case "$lib_search_path " in 3367 *" $dir "*) ;; 3368 *) lib_search_path="$lib_search_path $dir" ;; 3369 esac 3370 done 3371 newlib_search_path= 3372 fi 3373 3374 if test "$linkmode,$pass" != "prog,link"; then 3375 vars="deplibs" 3376 else 3377 vars="compile_deplibs finalize_deplibs" 3378 fi 3379 for var in $vars dependency_libs; do 3380 # Add libraries to $var in reverse order 3381 eval tmp_libs=\"\$$var\" 3382 new_libs= 3383 for deplib in $tmp_libs; do 3384 # FIXME: Pedantically, this is the right thing to do, so 3385 # that some nasty dependency loop isn't accidentally 3386 # broken: 3387 #new_libs="$deplib $new_libs" 3388 # Pragmatically, this seems to cause very few problems in 3389 # practice: 3390 case $deplib in 3391 -L*) new_libs="$deplib $new_libs" ;; 3392 -R*) ;; 3393 *) 3394 # And here is the reason: when a library appears more 3395 # than once as an explicit dependence of a library, or 3396 # is implicitly linked in more than once by the 3397 # compiler, it is considered special, and multiple 3398 # occurrences thereof are not removed. Compare this 3399 # with having the same library being listed as a 3400 # dependency of multiple other libraries: in this case, 3401 # we know (pedantically, we assume) the library does not 3402 # need to be listed more than once, so we keep only the 3403 # last copy. This is not always right, but it is rare 3404 # enough that we require users that really mean to play 3405 # such unportable linking tricks to link the library 3406 # using -Wl,-lname, so that libtool does not consider it 3407 # for duplicate removal. 3408 case " $specialdeplibs " in 3409 *" $deplib "*) new_libs="$deplib $new_libs" ;; 3410 *) 3411 case " $new_libs " in 3412 *" $deplib "*) ;; 3413 *) new_libs="$deplib $new_libs" ;; 3414 esac 3415 ;; 3416 esac 3417 ;; 3418 esac 3419 done 3420 tmp_libs= 3421 for deplib in $new_libs; do 3422 case $deplib in 3423 -L*) 3424 case " $tmp_libs " in 3425 *" $deplib "*) ;; 3426 *) tmp_libs="$tmp_libs $deplib" ;; 3427 esac 3428 ;; 3429 *) tmp_libs="$tmp_libs $deplib" ;; 3430 esac 3431 done 3432 eval $var=\"$tmp_libs\" 3433 done # for var 3434 fi 3435 # Last step: remove runtime libs from dependency_libs 3436 # (they stay in deplibs) 3437 tmp_libs= 3438 for i in $dependency_libs ; do 3439 case " $predeps $postdeps $compiler_lib_search_path " in 3440 *" $i "*) 3441 i="" 3442 ;; 3443 esac 3444 if test -n "$i" ; then 3445 tmp_libs="$tmp_libs $i" 3446 fi 3447 done 3448 dependency_libs=$tmp_libs 3449 done # for pass 3450 if test "$linkmode" = prog; then 3451 dlfiles="$newdlfiles" 3452 dlprefiles="$newdlprefiles" 3453 fi 3454 3455 case $linkmode in 3456 oldlib) 3457 if test -n "$deplibs"; then 3458 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 3459 fi 3460 3461 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then 3462 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 3463 fi 3464 3465 if test -n "$rpath"; then 3466 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 3467 fi 3468 3469 if test -n "$xrpath"; then 3470 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 3471 fi 3472 3473 if test -n "$vinfo"; then 3474 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 3475 fi 3476 3477 if test -n "$release"; then 3478 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 3479 fi 3480 3481 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then 3482 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 3483 fi 3484 3485 # Now set the variables for building old libraries. 3486 build_libtool_libs=no 3487 oldlibs="$output" 3488 objs="$objs$old_deplibs" 3489 ;; 3490 3491 lib) 3492 # Make sure we only generate libraries of the form `libNAME.la'. 3493 case $outputname in 3494 lib*) 3495 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` 3496 eval shared_ext=\"$shrext_cmds\" 3497 eval libname=\"$libname_spec\" 3498 ;; 3499 *) 3500 if test "$module" = no; then 3501 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 3502 $echo "$help" 1>&2 3503 exit $EXIT_FAILURE 3504 fi 3505 if test "$need_lib_prefix" != no; then 3506 # Add the "lib" prefix for modules if required 3507 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` 3508 eval shared_ext=\"$shrext_cmds\" 3509 eval libname=\"$libname_spec\" 3510 else 3511 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` 3512 fi 3513 ;; 3514 esac 3515 3516 if test -n "$objs"; then 3517 if test "$deplibs_check_method" != pass_all; then 3518 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 3519 exit $EXIT_FAILURE 3520 else 3521 $echo 3522 $echo "*** Warning: Linking the shared library $output against the non-libtool" 3523 $echo "*** objects $objs is not portable!" 3524 libobjs="$libobjs $objs" 3525 fi 3526 fi 3527 3528 if test "$dlself" != no; then 3529 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 3530 fi 3531 3532 set dummy $rpath 3533 if test "$#" -gt 2; then 3534 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 3535 fi 3536 install_libdir="$2" 3537 3538 oldlibs= 3539 if test -z "$rpath"; then 3540 if test "$build_libtool_libs" = yes; then 3541 # Building a libtool convenience library. 3542 # Some compilers have problems with a `.al' extension so 3543 # convenience libraries should have the same extension an 3544 # archive normally would. 3545 oldlibs="$output_objdir/$libname.$libext $oldlibs" 3546 build_libtool_libs=convenience 3547 build_old_libs=yes 3548 fi 3549 3550 if test -n "$vinfo"; then 3551 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 3552 fi 3553 3554 if test -n "$release"; then 3555 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 3556 fi 3557 else 3558 3559 # Parse the version information argument. 3560 save_ifs="$IFS"; IFS=':' 3561 set dummy $vinfo 0 0 0 3562 IFS="$save_ifs" 3563 3564 if test -n "$8"; then 3565 $echo "$modename: too many parameters to \`-version-info'" 1>&2 3566 $echo "$help" 1>&2 3567 exit $EXIT_FAILURE 3568 fi 3569 3570 # convert absolute version numbers to libtool ages 3571 # this retains compatibility with .la files and attempts 3572 # to make the code below a bit more comprehensible 3573 3574 case $vinfo_number in 3575 yes) 3576 number_major="$2" 3577 number_minor="$3" 3578 number_revision="$4" 3579 # 3580 # There are really only two kinds -- those that 3581 # use the current revision as the major version 3582 # and those that subtract age and use age as 3583 # a minor version. But, then there is irix 3584 # which has an extra 1 added just for fun 3585 # 3586 case $version_type in 3587 darwin|linux|osf|windows|none) 3588 current=`expr $number_major + $number_minor` 3589 age="$number_minor" 3590 revision="$number_revision" 3591 ;; 3592 freebsd-aout|freebsd-elf|sunos) 3593 current="$number_major" 3594 revision="$number_minor" 3595 age="0" 3596 ;; 3597 irix|nonstopux) 3598 current=`expr $number_major + $number_minor - 1` 3599 age="$number_minor" 3600 revision="$number_minor" 3601 ;; 3602 esac 3603 ;; 3604 no) 3605 current="$2" 3606 revision="$3" 3607 age="$4" 3608 ;; 3609 esac 3610 3611 # Check that each of the things are valid numbers. 3612 case $current in 3613 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]) ;; 3614 *) 3615 $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 3616 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 3617 exit $EXIT_FAILURE 3618 ;; 3619 esac 3620 3621 case $revision in 3622 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]) ;; 3623 *) 3624 $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 3625 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 3626 exit $EXIT_FAILURE 3627 ;; 3628 esac 3629 3630 case $age in 3631 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]) ;; 3632 *) 3633 $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 3634 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 3635 exit $EXIT_FAILURE 3636 ;; 3637 esac 3638 3639 if test "$age" -gt "$current"; then 3640 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 3641 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 3642 exit $EXIT_FAILURE 3643 fi 3644 3645 # Calculate the version variables. 3646 major= 3647 versuffix= 3648 verstring= 3649 case $version_type in 3650 none) ;; 3651 3652 darwin) 3653 # Like Linux, but with the current version available in 3654 # verstring for coding it into the library header 3655 major=.`expr $current - $age` 3656 versuffix="$major.$age.$revision" 3657 # Darwin ld doesn't like 0 for these options... 3658 minor_current=`expr $current + 1` 3659 verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" 3660 ;; 3661 3662 freebsd-aout) 3663 major=".$current" 3664 versuffix=".$current.$revision"; 3665 ;; 3666 3667 freebsd-elf) 3668 major=".$current" 3669 versuffix=".$current"; 3670 ;; 3671 3672 irix | nonstopux) 3673 major=`expr $current - $age + 1` 3674 3675 case $version_type in 3676 nonstopux) verstring_prefix=nonstopux ;; 3677 *) verstring_prefix=sgi ;; 3678 esac 3679 verstring="$verstring_prefix$major.$revision" 3680 3681 # Add in all the interfaces that we are compatible with. 3682 loop=$revision 3683 while test "$loop" -ne 0; do 3684 iface=`expr $revision - $loop` 3685 loop=`expr $loop - 1` 3686 verstring="$verstring_prefix$major.$iface:$verstring" 3687 done 3688 3689 # Before this point, $major must not contain `.'. 3690 major=.$major 3691 versuffix="$major.$revision" 3692 ;; 3693 3694 linux) 3695 major=.`expr $current - $age` 3696 versuffix="$major.$age.$revision" 3697 ;; 3698 3699 osf) 3700 major=.`expr $current - $age` 3701 versuffix=".$current.$age.$revision" 3702 verstring="$current.$age.$revision" 3703 3704 # Add in all the interfaces that we are compatible with. 3705 loop=$age 3706 while test "$loop" -ne 0; do 3707 iface=`expr $current - $loop` 3708 loop=`expr $loop - 1` 3709 verstring="$verstring:${iface}.0" 3710 done 3711 3712 # Make executables depend on our current version. 3713 verstring="$verstring:${current}.0" 3714 ;; 3715 3716 sunos) 3717 major=".$current" 3718 versuffix=".$current.$revision" 3719 ;; 3720 3721 windows) 3722 # Use '-' rather than '.', since we only want one 3723 # extension on DOS 8.3 filesystems. 3724 major=`expr $current - $age` 3725 versuffix="-$major" 3726 ;; 3727 3728 *) 3729 $echo "$modename: unknown library version type \`$version_type'" 1>&2 3730 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 3731 exit $EXIT_FAILURE 3732 ;; 3733 esac 3734 3735 # Clear the version info if we defaulted, and they specified a release. 3736 if test -z "$vinfo" && test -n "$release"; then 3737 major= 3738 case $version_type in 3739 darwin) 3740 # we can't check for "0.0" in archive_cmds due to quoting 3741 # problems, so we reset it completely 3742 verstring= 3743 ;; 3744 *) 3745 verstring="0.0" 3746 ;; 3747 esac 3748 if test "$need_version" = no; then 3749 versuffix= 3750 else 3751 versuffix=".0.0" 3752 fi 3753 fi 3754 3755 # Remove version info from name if versioning should be avoided 3756 if test "$avoid_version" = yes && test "$need_version" = no; then 3757 major= 3758 versuffix= 3759 verstring="" 3760 fi 3761 3762 # Check to see if the archive will have undefined symbols. 3763 if test "$allow_undefined" = yes; then 3764 if test "$allow_undefined_flag" = unsupported; then 3765 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 3766 build_libtool_libs=no 3767 build_old_libs=yes 3768 fi 3769 else 3770 # Don't allow undefined symbols. 3771 allow_undefined_flag="$no_undefined_flag" 3772 fi 3773 fi 3774 3775 if test "$mode" != relink; then 3776 # Remove our outputs, but don't remove object files since they 3777 # may have been created when compiling PIC objects. 3778 removelist= 3779 tempremovelist=`$echo "$output_objdir/*"` 3780 for p in $tempremovelist; do 3781 case $p in 3782 *.$objext) 3783 ;; 3784 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) 3785 if test "X$precious_files_regex" != "X"; then 3786 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 3787 then 3788 continue 3789 fi 3790 fi 3791 removelist="$removelist $p" 3792 ;; 3793 *) ;; 3794 esac 3795 done 3796 if test -n "$removelist"; then 3797 $show "${rm}r $removelist" 3798 $run ${rm}r $removelist 3799 fi 3800 fi 3801 3802 # Now set the variables for building old libraries. 3803 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then 3804 oldlibs="$oldlibs $output_objdir/$libname.$libext" 3805 3806 # Transform .lo files to .o files. 3807 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` 3808 fi 3809 3810 # Eliminate all temporary directories. 3811# for path in $notinst_path; do 3812# lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` 3813# deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` 3814# dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` 3815# done 3816 3817 if test -n "$xrpath"; then 3818 # If the user specified any rpath flags, then add them. 3819 temp_xrpath= 3820 for libdir in $xrpath; do 3821 temp_xrpath="$temp_xrpath -R$libdir" 3822 case "$finalize_rpath " in 3823 *" $libdir "*) ;; 3824 *) finalize_rpath="$finalize_rpath $libdir" ;; 3825 esac 3826 done 3827 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then 3828 dependency_libs="$temp_xrpath $dependency_libs" 3829 fi 3830 fi 3831 3832 # Make sure dlfiles contains only unique files that won't be dlpreopened 3833 old_dlfiles="$dlfiles" 3834 dlfiles= 3835 for lib in $old_dlfiles; do 3836 case " $dlprefiles $dlfiles " in 3837 *" $lib "*) ;; 3838 *) dlfiles="$dlfiles $lib" ;; 3839 esac 3840 done 3841 3842 # Make sure dlprefiles contains only unique files 3843 old_dlprefiles="$dlprefiles" 3844 dlprefiles= 3845 for lib in $old_dlprefiles; do 3846 case "$dlprefiles " in 3847 *" $lib "*) ;; 3848 *) dlprefiles="$dlprefiles $lib" ;; 3849 esac 3850 done 3851 3852 if test "$build_libtool_libs" = yes; then 3853 if test -n "$rpath"; then 3854 case $host in 3855 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) 3856 # these systems don't actually have a c library (as such)! 3857 ;; 3858 *-*-rhapsody* | *-*-darwin1.[012]) 3859 # Rhapsody C library is in the System framework 3860 deplibs="$deplibs -framework System" 3861 ;; 3862 *-*-netbsd*) 3863 # Don't link with libc until the a.out ld.so is fixed. 3864 ;; 3865 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) 3866 # Do not include libc due to us having libc/libc_r. 3867 ;; 3868 *-*-sco3.2v5* | *-*-sco5v6*) 3869 # Causes problems with __ctype 3870 ;; 3871 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) 3872 # Compiler inserts libc in the correct place for threads to work 3873 ;; 3874 *) 3875 # Add libc to deplibs on all other systems if necessary. 3876 if test "$build_libtool_need_lc" = "yes"; then 3877 deplibs="$deplibs -lc" 3878 fi 3879 ;; 3880 esac 3881 fi 3882 3883 # Transform deplibs into only deplibs that can be linked in shared. 3884 name_save=$name 3885 libname_save=$libname 3886 release_save=$release 3887 versuffix_save=$versuffix 3888 major_save=$major 3889 # I'm not sure if I'm treating the release correctly. I think 3890 # release should show up in the -l (ie -lgmp5) so we don't want to 3891 # add it in twice. Is that correct? 3892 release="" 3893 versuffix="" 3894 major="" 3895 newdeplibs= 3896 droppeddeps=no 3897 case $deplibs_check_method in 3898 pass_all) 3899 # Don't check for shared/static. Everything works. 3900 # This might be a little naive. We might want to check 3901 # whether the library exists or not. But this is on 3902 # osf3 & osf4 and I'm not really sure... Just 3903 # implementing what was already the behavior. 3904 newdeplibs=$deplibs 3905 ;; 3906 test_compile) 3907 # This code stresses the "libraries are programs" paradigm to its 3908 # limits. Maybe even breaks it. We compile a program, linking it 3909 # against the deplibs as a proxy for the library. Then we can check 3910 # whether they linked in statically or dynamically with ldd. 3911 $rm conftest.c 3912 cat > conftest.c <<EOF 3913 int main() { return 0; } 3914EOF 3915 $rm conftest 3916 if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then 3917 ldd_output=`ldd conftest` 3918 for i in $deplibs; do 3919 name=`expr $i : '-l\(.*\)'` 3920 # If $name is empty we are operating on a -L argument. 3921 if test "$name" != "" && test "$name" != "0"; then 3922 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 3923 case " $predeps $postdeps " in 3924 *" $i "*) 3925 newdeplibs="$newdeplibs $i" 3926 i="" 3927 ;; 3928 esac 3929 fi 3930 if test -n "$i" ; then 3931 libname=`eval \\$echo \"$libname_spec\"` 3932 deplib_matches=`eval \\$echo \"$library_names_spec\"` 3933 set dummy $deplib_matches 3934 deplib_match=$2 3935 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then 3936 newdeplibs="$newdeplibs $i" 3937 else 3938 droppeddeps=yes 3939 $echo 3940 $echo "*** Warning: dynamic linker does not accept needed library $i." 3941 $echo "*** I have the capability to make that library automatically link in when" 3942 $echo "*** you link to this library. But I can only do this if you have a" 3943 $echo "*** shared version of the library, which I believe you do not have" 3944 $echo "*** because a test_compile did reveal that the linker did not use it for" 3945 $echo "*** its dynamic dependency list that programs get resolved with at runtime." 3946 fi 3947 fi 3948 else 3949 newdeplibs="$newdeplibs $i" 3950 fi 3951 done 3952 else 3953 # Error occurred in the first compile. Let's try to salvage 3954 # the situation: Compile a separate program for each library. 3955 for i in $deplibs; do 3956 name=`expr $i : '-l\(.*\)'` 3957 # If $name is empty we are operating on a -L argument. 3958 if test "$name" != "" && test "$name" != "0"; then 3959 $rm conftest 3960 if $LTCC $LTCFLAGS -o conftest conftest.c $i; then 3961 ldd_output=`ldd conftest` 3962 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 3963 case " $predeps $postdeps " in 3964 *" $i "*) 3965 newdeplibs="$newdeplibs $i" 3966 i="" 3967 ;; 3968 esac 3969 fi 3970 if test -n "$i" ; then 3971 libname=`eval \\$echo \"$libname_spec\"` 3972 deplib_matches=`eval \\$echo \"$library_names_spec\"` 3973 set dummy $deplib_matches 3974 deplib_match=$2 3975 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then 3976 newdeplibs="$newdeplibs $i" 3977 else 3978 droppeddeps=yes 3979 $echo 3980 $echo "*** Warning: dynamic linker does not accept needed library $i." 3981 $echo "*** I have the capability to make that library automatically link in when" 3982 $echo "*** you link to this library. But I can only do this if you have a" 3983 $echo "*** shared version of the library, which you do not appear to have" 3984 $echo "*** because a test_compile did reveal that the linker did not use this one" 3985 $echo "*** as a dynamic dependency that programs can get resolved with at runtime." 3986 fi 3987 fi 3988 else 3989 droppeddeps=yes 3990 $echo 3991 $echo "*** Warning! Library $i is needed by this library but I was not able to" 3992 $echo "*** make it link in! You will probably need to install it or some" 3993 $echo "*** library that it depends on before this library will be fully" 3994 $echo "*** functional. Installing it before continuing would be even better." 3995 fi 3996 else 3997 newdeplibs="$newdeplibs $i" 3998 fi 3999 done 4000 fi 4001 ;; 4002 file_magic*) 4003 set dummy $deplibs_check_method 4004 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 4005 for a_deplib in $deplibs; do 4006 name=`expr $a_deplib : '-l\(.*\)'` 4007 # If $name is empty we are operating on a -L argument. 4008 if test "$name" != "" && test "$name" != "0"; then 4009 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 4010 case " $predeps $postdeps " in 4011 *" $a_deplib "*) 4012 newdeplibs="$newdeplibs $a_deplib" 4013 a_deplib="" 4014 ;; 4015 esac 4016 fi 4017 if test -n "$a_deplib" ; then 4018 libname=`eval \\$echo \"$libname_spec\"` 4019 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do 4020 potential_libs=`ls $i/$libname[.-]* 2>/dev/null` 4021 for potent_lib in $potential_libs; do 4022 # Follow soft links. 4023 if ls -lLd "$potent_lib" 2>/dev/null \ 4024 | grep " -> " >/dev/null; then 4025 continue 4026 fi 4027 # The statement above tries to avoid entering an 4028 # endless loop below, in case of cyclic links. 4029 # We might still enter an endless loop, since a link 4030 # loop can be closed while we follow links, 4031 # but so what? 4032 potlib="$potent_lib" 4033 while test -h "$potlib" 2>/dev/null; do 4034 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` 4035 case $potliblink in 4036 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; 4037 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; 4038 esac 4039 done 4040 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ 4041 | ${SED} 10q \ 4042 | $EGREP "$file_magic_regex" > /dev/null; then 4043 newdeplibs="$newdeplibs $a_deplib" 4044 a_deplib="" 4045 break 2 4046 fi 4047 done 4048 done 4049 fi 4050 if test -n "$a_deplib" ; then 4051 droppeddeps=yes 4052 $echo 4053 $echo "*** Warning: linker path does not have real file for library $a_deplib." 4054 $echo "*** I have the capability to make that library automatically link in when" 4055 $echo "*** you link to this library. But I can only do this if you have a" 4056 $echo "*** shared version of the library, which you do not appear to have" 4057 $echo "*** because I did check the linker path looking for a file starting" 4058 if test -z "$potlib" ; then 4059 $echo "*** with $libname but no candidates were found. (...for file magic test)" 4060 else 4061 $echo "*** with $libname and none of the candidates passed a file format test" 4062 $echo "*** using a file magic. Last file checked: $potlib" 4063 fi 4064 fi 4065 else 4066 # Add a -L argument. 4067 newdeplibs="$newdeplibs $a_deplib" 4068 fi 4069 done # Gone through all deplibs. 4070 ;; 4071 match_pattern*) 4072 set dummy $deplibs_check_method 4073 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 4074 for a_deplib in $deplibs; do 4075 name=`expr $a_deplib : '-l\(.*\)'` 4076 # If $name is empty we are operating on a -L argument. 4077 if test -n "$name" && test "$name" != "0"; then 4078 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 4079 case " $predeps $postdeps " in 4080 *" $a_deplib "*) 4081 newdeplibs="$newdeplibs $a_deplib" 4082 a_deplib="" 4083 ;; 4084 esac 4085 fi 4086 if test -n "$a_deplib" ; then 4087 libname=`eval \\$echo \"$libname_spec\"` 4088 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do 4089 potential_libs=`ls $i/$libname[.-]* 2>/dev/null` 4090 for potent_lib in $potential_libs; do 4091 potlib="$potent_lib" # see symlink-check above in file_magic test 4092 if eval $echo \"$potent_lib\" 2>/dev/null \ 4093 | ${SED} 10q \ 4094 | $EGREP "$match_pattern_regex" > /dev/null; then 4095 newdeplibs="$newdeplibs $a_deplib" 4096 a_deplib="" 4097 break 2 4098 fi 4099 done 4100 done 4101 fi 4102 if test -n "$a_deplib" ; then 4103 droppeddeps=yes 4104 $echo 4105 $echo "*** Warning: linker path does not have real file for library $a_deplib." 4106 $echo "*** I have the capability to make that library automatically link in when" 4107 $echo "*** you link to this library. But I can only do this if you have a" 4108 $echo "*** shared version of the library, which you do not appear to have" 4109 $echo "*** because I did check the linker path looking for a file starting" 4110 if test -z "$potlib" ; then 4111 $echo "*** with $libname but no candidates were found. (...for regex pattern test)" 4112 else 4113 $echo "*** with $libname and none of the candidates passed a file format test" 4114 $echo "*** using a regex pattern. Last file checked: $potlib" 4115 fi 4116 fi 4117 else 4118 # Add a -L argument. 4119 newdeplibs="$newdeplibs $a_deplib" 4120 fi 4121 done # Gone through all deplibs. 4122 ;; 4123 none | unknown | *) 4124 newdeplibs="" 4125 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ 4126 -e 's/ -[LR][^ ]*//g'` 4127 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 4128 for i in $predeps $postdeps ; do 4129 # can't use Xsed below, because $i might contain '/' 4130 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` 4131 done 4132 fi 4133 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ 4134 | grep . >/dev/null; then 4135 $echo 4136 if test "X$deplibs_check_method" = "Xnone"; then 4137 $echo "*** Warning: inter-library dependencies are not supported in this platform." 4138 else 4139 $echo "*** Warning: inter-library dependencies are not known to be supported." 4140 fi 4141 $echo "*** All declared inter-library dependencies are being dropped." 4142 droppeddeps=yes 4143 fi 4144 ;; 4145 esac 4146 versuffix=$versuffix_save 4147 major=$major_save 4148 release=$release_save 4149 libname=$libname_save 4150 name=$name_save 4151 4152 case $host in 4153 *-*-rhapsody* | *-*-darwin1.[012]) 4154 # On Rhapsody replace the C library is the System framework 4155 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` 4156 ;; 4157 esac 4158 4159 if test "$droppeddeps" = yes; then 4160 if test "$module" = yes; then 4161 $echo 4162 $echo "*** Warning: libtool could not satisfy all declared inter-library" 4163 $echo "*** dependencies of module $libname. Therefore, libtool will create" 4164 $echo "*** a static module, that should work as long as the dlopening" 4165 $echo "*** application is linked with the -dlopen flag." 4166 if test -z "$global_symbol_pipe"; then 4167 $echo 4168 $echo "*** However, this would only work if libtool was able to extract symbol" 4169 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" 4170 $echo "*** not find such a program. So, this module is probably useless." 4171 $echo "*** \`nm' from GNU binutils and a full rebuild may help." 4172 fi 4173 if test "$build_old_libs" = no; then 4174 oldlibs="$output_objdir/$libname.$libext" 4175 build_libtool_libs=module 4176 build_old_libs=yes 4177 else 4178 build_libtool_libs=no 4179 fi 4180 else 4181 $echo "*** The inter-library dependencies that have been dropped here will be" 4182 $echo "*** automatically added whenever a program is linked with this library" 4183 $echo "*** or is declared to -dlopen it." 4184 4185 if test "$allow_undefined" = no; then 4186 $echo 4187 $echo "*** Since this library must not contain undefined symbols," 4188 $echo "*** because either the platform does not support them or" 4189 $echo "*** it was explicitly requested with -no-undefined," 4190 $echo "*** libtool will only create a static version of it." 4191 if test "$build_old_libs" = no; then 4192 oldlibs="$output_objdir/$libname.$libext" 4193 build_libtool_libs=module 4194 build_old_libs=yes 4195 else 4196 build_libtool_libs=no 4197 fi 4198 fi 4199 fi 4200 fi 4201 # Done checking deplibs! 4202 deplibs=$newdeplibs 4203 fi 4204 4205 4206 # move library search paths that coincide with paths to not yet 4207 # installed libraries to the beginning of the library search list 4208 new_libs= 4209 for path in $notinst_path; do 4210 case " $new_libs " in 4211 *" -L$path/$objdir "*) ;; 4212 *) 4213 case " $deplibs " in 4214 *" -L$path/$objdir "*) 4215 new_libs="$new_libs -L$path/$objdir" ;; 4216 esac 4217 ;; 4218 esac 4219 done 4220 for deplib in $deplibs; do 4221 case $deplib in 4222 -L*) 4223 case " $new_libs " in 4224 *" $deplib "*) ;; 4225 *) new_libs="$new_libs $deplib" ;; 4226 esac 4227 ;; 4228 *) new_libs="$new_libs $deplib" ;; 4229 esac 4230 done 4231 deplibs="$new_libs" 4232 4233 4234 # All the library-specific variables (install_libdir is set above). 4235 library_names= 4236 old_library= 4237 dlname= 4238 4239 # Test again, we may have decided not to build it any more 4240 if test "$build_libtool_libs" = yes; then 4241 if test "$hardcode_into_libs" = yes; then 4242 # Hardcode the library paths 4243 hardcode_libdirs= 4244 dep_rpath= 4245 rpath="$finalize_rpath" 4246 test "$mode" != relink && rpath="$compile_rpath$rpath" 4247 for libdir in $rpath; do 4248 if test -n "$hardcode_libdir_flag_spec"; then 4249 if test -n "$hardcode_libdir_separator"; then 4250 if test -z "$hardcode_libdirs"; then 4251 hardcode_libdirs="$libdir" 4252 else 4253 # Just accumulate the unique libdirs. 4254 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in 4255 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) 4256 ;; 4257 *) 4258 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" 4259 ;; 4260 esac 4261 fi 4262 else 4263 eval flag=\"$hardcode_libdir_flag_spec\" 4264 dep_rpath="$dep_rpath $flag" 4265 fi 4266 elif test -n "$runpath_var"; then 4267 case "$perm_rpath " in 4268 *" $libdir "*) ;; 4269 *) perm_rpath="$perm_rpath $libdir" ;; 4270 esac 4271 fi 4272 done 4273 # Substitute the hardcoded libdirs into the rpath. 4274 if test -n "$hardcode_libdir_separator" && 4275 test -n "$hardcode_libdirs"; then 4276 libdir="$hardcode_libdirs" 4277 if test -n "$hardcode_libdir_flag_spec_ld"; then 4278 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" 4279 else 4280 eval dep_rpath=\"$hardcode_libdir_flag_spec\" 4281 fi 4282 fi 4283 if test -n "$runpath_var" && test -n "$perm_rpath"; then 4284 # We should set the runpath_var. 4285 rpath= 4286 for dir in $perm_rpath; do 4287 rpath="$rpath$dir:" 4288 done 4289 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" 4290 fi 4291 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" 4292 fi 4293 4294 shlibpath="$finalize_shlibpath" 4295 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" 4296 if test -n "$shlibpath"; then 4297 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" 4298 fi 4299 4300 # Get the real and link names of the library. 4301 eval shared_ext=\"$shrext_cmds\" 4302 eval library_names=\"$library_names_spec\" 4303 set dummy $library_names 4304 realname="$2" 4305 shift; shift 4306 4307 if test -n "$soname_spec"; then 4308 eval soname=\"$soname_spec\" 4309 else 4310 soname="$realname" 4311 fi 4312 if test -z "$dlname"; then 4313 dlname=$soname 4314 fi 4315 4316 lib="$output_objdir/$realname" 4317 linknames= 4318 for link 4319 do 4320 linknames="$linknames $link" 4321 done 4322 4323 # Use standard objects if they are pic 4324 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` 4325 4326 # Prepare the list of exported symbols 4327 if test -z "$export_symbols"; then 4328 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then 4329 $show "generating symbol list for \`$libname.la'" 4330 export_symbols="$output_objdir/$libname.exp" 4331 $run $rm $export_symbols 4332 cmds=$export_symbols_cmds 4333 save_ifs="$IFS"; IFS='~' 4334 for cmd in $cmds; do 4335 IFS="$save_ifs" 4336 eval cmd=\"$cmd\" 4337 if len=`expr "X$cmd" : ".*"` && 4338 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then 4339 $show "$cmd" 4340 $run eval "$cmd" || exit $? 4341 skipped_export=false 4342 else 4343 # The command line is too long to execute in one step. 4344 $show "using reloadable object file for export list..." 4345 skipped_export=: 4346 # Break out early, otherwise skipped_export may be 4347 # set to false by a later but shorter cmd. 4348 break 4349 fi 4350 done 4351 IFS="$save_ifs" 4352 if test -n "$export_symbols_regex"; then 4353 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" 4354 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' 4355 $show "$mv \"${export_symbols}T\" \"$export_symbols\"" 4356 $run eval '$mv "${export_symbols}T" "$export_symbols"' 4357 fi 4358 fi 4359 fi 4360 4361 if test -n "$export_symbols" && test -n "$include_expsyms"; then 4362 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' 4363 fi 4364 4365 tmp_deplibs= 4366 inst_prefix_arg= 4367 for test_deplib in $deplibs; do 4368 case " $convenience " in 4369 *" $test_deplib "*) ;; 4370 *) 4371 if test -n "$inst_prefix_dir" && (echo "$test_deplib" | grep -- "$inst_prefix_dir" >/dev/null); then 4372 inst_prefix_arg="$inst_prefix_arg $test_deplib" 4373 else 4374 tmp_deplibs="$tmp_deplibs $test_deplib" 4375 fi 4376 ;; 4377 esac 4378 done 4379 deplibs="$tmp_deplibs" 4380 if test -n "$inst_prefix_arg"; then 4381 deplibs="$inst_prefix_arg $deplibs" 4382 fi 4383 4384 if test -n "$convenience"; then 4385 if test -n "$whole_archive_flag_spec"; then 4386 save_libobjs=$libobjs 4387 eval libobjs=\"\$libobjs $whole_archive_flag_spec\" 4388 else 4389 gentop="$output_objdir/${outputname}x" 4390 generated="$generated $gentop" 4391 4392 func_extract_archives $gentop $convenience 4393 libobjs="$libobjs $func_extract_archives_result" 4394 fi 4395 fi 4396 4397 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then 4398 eval flag=\"$thread_safe_flag_spec\" 4399 linker_flags="$linker_flags $flag" 4400 fi 4401 4402 # Make a backup of the uninstalled library when relinking 4403 if test "$mode" = relink; then 4404 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? 4405 fi 4406 4407 # Do each of the archive commands. 4408 if test "$module" = yes && test -n "$module_cmds" ; then 4409 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then 4410 eval test_cmds=\"$module_expsym_cmds\" 4411 cmds=$module_expsym_cmds 4412 else 4413 eval test_cmds=\"$module_cmds\" 4414 cmds=$module_cmds 4415 fi 4416 else 4417 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then 4418 eval test_cmds=\"$archive_expsym_cmds\" 4419 cmds=$archive_expsym_cmds 4420 else 4421 eval test_cmds=\"$archive_cmds\" 4422 cmds=$archive_cmds 4423 fi 4424 fi 4425 4426 if test "X$skipped_export" != "X:" && 4427 len=`expr "X$test_cmds" : ".*" 2>/dev/null` && 4428 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then 4429 : 4430 else 4431 # The command line is too long to link in one step, link piecewise. 4432 $echo "creating reloadable object files..." 4433 4434 # Save the value of $output and $libobjs because we want to 4435 # use them later. If we have whole_archive_flag_spec, we 4436 # want to use save_libobjs as it was before 4437 # whole_archive_flag_spec was expanded, because we can't 4438 # assume the linker understands whole_archive_flag_spec. 4439 # This may have to be revisited, in case too many 4440 # convenience libraries get linked in and end up exceeding 4441 # the spec. 4442 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then 4443 save_libobjs=$libobjs 4444 fi 4445 save_output=$output 4446 output_la=`$echo "X$output" | $Xsed -e "$basename"` 4447 4448 # Clear the reloadable object creation command queue and 4449 # initialize k to one. 4450 test_cmds= 4451 concat_cmds= 4452 objlist= 4453 delfiles= 4454 last_robj= 4455 k=1 4456 output=$output_objdir/$output_la-${k}.$objext 4457 # Loop over the list of objects to be linked. 4458 for obj in $save_libobjs 4459 do 4460 eval test_cmds=\"$reload_cmds $objlist $last_robj\" 4461 if test "X$objlist" = X || 4462 { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && 4463 test "$len" -le "$max_cmd_len"; }; then 4464 objlist="$objlist $obj" 4465 else 4466 # The command $test_cmds is almost too long, add a 4467 # command to the queue. 4468 if test "$k" -eq 1 ; then 4469 # The first file doesn't have a previous command to add. 4470 eval concat_cmds=\"$reload_cmds $objlist $last_robj\" 4471 else 4472 # All subsequent reloadable object files will link in 4473 # the last one created. 4474 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" 4475 fi 4476 last_robj=$output_objdir/$output_la-${k}.$objext 4477 k=`expr $k + 1` 4478 output=$output_objdir/$output_la-${k}.$objext 4479 objlist=$obj 4480 len=1 4481 fi 4482 done 4483 # Handle the remaining objects by creating one last 4484 # reloadable object file. All subsequent reloadable object 4485 # files will link in the last one created. 4486 test -z "$concat_cmds" || concat_cmds=$concat_cmds~ 4487 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" 4488 4489 if ${skipped_export-false}; then 4490 $show "generating symbol list for \`$libname.la'" 4491 export_symbols="$output_objdir/$libname.exp" 4492 $run $rm $export_symbols 4493 libobjs=$output 4494 # Append the command to create the export file. 4495 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" 4496 fi 4497 4498 # Set up a command to remove the reloadable object files 4499 # after they are used. 4500 i=0 4501 while test "$i" -lt "$k" 4502 do 4503 i=`expr $i + 1` 4504 delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" 4505 done 4506 4507 $echo "creating a temporary reloadable object file: $output" 4508 4509 # Loop through the commands generated above and execute them. 4510 save_ifs="$IFS"; IFS='~' 4511 for cmd in $concat_cmds; do 4512 IFS="$save_ifs" 4513 $show "$cmd" 4514 $run eval "$cmd" || exit $? 4515 done 4516 IFS="$save_ifs" 4517 4518 libobjs=$output 4519 # Restore the value of output. 4520 output=$save_output 4521 4522 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then 4523 eval libobjs=\"\$libobjs $whole_archive_flag_spec\" 4524 fi 4525 # Expand the library linking commands again to reset the 4526 # value of $libobjs for piecewise linking. 4527 4528 # Do each of the archive commands. 4529 if test "$module" = yes && test -n "$module_cmds" ; then 4530 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then 4531 cmds=$module_expsym_cmds 4532 else 4533 cmds=$module_cmds 4534 fi 4535 else 4536 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then 4537 cmds=$archive_expsym_cmds 4538 else 4539 cmds=$archive_cmds 4540 fi 4541 fi 4542 4543 # Append the command to remove the reloadable object files 4544 # to the just-reset $cmds. 4545 eval cmds=\"\$cmds~\$rm $delfiles\" 4546 fi 4547 save_ifs="$IFS"; IFS='~' 4548 for cmd in $cmds; do 4549 IFS="$save_ifs" 4550 eval cmd=\"$cmd\" 4551 $show "$cmd" 4552 $run eval "$cmd" || { 4553 lt_exit=$? 4554 4555 # Restore the uninstalled library and exit 4556 if test "$mode" = relink; then 4557 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' 4558 fi 4559 4560 exit $lt_exit 4561 } 4562 done 4563 IFS="$save_ifs" 4564 4565 # Restore the uninstalled library and exit 4566 if test "$mode" = relink; then 4567 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? 4568 4569 if test -n "$convenience"; then 4570 if test -z "$whole_archive_flag_spec"; then 4571 $show "${rm}r $gentop" 4572 $run ${rm}r "$gentop" 4573 fi 4574 fi 4575 4576 exit $EXIT_SUCCESS 4577 fi 4578 4579 # Create links to the real library. 4580 for linkname in $linknames; do 4581 if test "$realname" != "$linkname"; then 4582 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" 4583 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? 4584 fi 4585 done 4586 4587 # If -module or -export-dynamic was specified, set the dlname. 4588 if test "$module" = yes || test "$export_dynamic" = yes; then 4589 # On all known operating systems, these are identical. 4590 dlname="$soname" 4591 fi 4592 fi 4593 ;; 4594 4595 obj) 4596 if test -n "$deplibs"; then 4597 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 4598 fi 4599 4600 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then 4601 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 4602 fi 4603 4604 if test -n "$rpath"; then 4605 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 4606 fi 4607 4608 if test -n "$xrpath"; then 4609 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 4610 fi 4611 4612 if test -n "$vinfo"; then 4613 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 4614 fi 4615 4616 if test -n "$release"; then 4617 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 4618 fi 4619 4620 case $output in 4621 *.lo) 4622 if test -n "$objs$old_deplibs"; then 4623 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 4624 exit $EXIT_FAILURE 4625 fi 4626 libobj="$output" 4627 obj=`$echo "X$output" | $Xsed -e "$lo2o"` 4628 ;; 4629 *) 4630 libobj= 4631 obj="$output" 4632 ;; 4633 esac 4634 4635 # Delete the old objects. 4636 $run $rm $obj $libobj 4637 4638 # Objects from convenience libraries. This assumes 4639 # single-version convenience libraries. Whenever we create 4640 # different ones for PIC/non-PIC, this we'll have to duplicate 4641 # the extraction. 4642 reload_conv_objs= 4643 gentop= 4644 # reload_cmds runs $LD directly, so let us get rid of 4645 # -Wl from whole_archive_flag_spec and hope we can get by with 4646 # turning comma into space.. 4647 wl= 4648 4649 if test -n "$convenience"; then 4650 if test -n "$whole_archive_flag_spec"; then 4651 eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" 4652 reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` 4653 else 4654 gentop="$output_objdir/${obj}x" 4655 generated="$generated $gentop" 4656 4657 func_extract_archives $gentop $convenience 4658 reload_conv_objs="$reload_objs $func_extract_archives_result" 4659 fi 4660 fi 4661 4662 # Create the old-style object. 4663 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 4664 4665 output="$obj" 4666 cmds=$reload_cmds 4667 save_ifs="$IFS"; IFS='~' 4668 for cmd in $cmds; do 4669 IFS="$save_ifs" 4670 eval cmd=\"$cmd\" 4671 $show "$cmd" 4672 $run eval "$cmd" || exit $? 4673 done 4674 IFS="$save_ifs" 4675 4676 # Exit if we aren't doing a library object file. 4677 if test -z "$libobj"; then 4678 if test -n "$gentop"; then 4679 $show "${rm}r $gentop" 4680 $run ${rm}r $gentop 4681 fi 4682 4683 exit $EXIT_SUCCESS 4684 fi 4685 4686 if test "$build_libtool_libs" != yes; then 4687 if test -n "$gentop"; then 4688 $show "${rm}r $gentop" 4689 $run ${rm}r $gentop 4690 fi 4691 4692 # Create an invalid libtool object if no PIC, so that we don't 4693 # accidentally link it into a program. 4694 # $show "echo timestamp > $libobj" 4695 # $run eval "echo timestamp > $libobj" || exit $? 4696 exit $EXIT_SUCCESS 4697 fi 4698 4699 if test -n "$pic_flag" || test "$pic_mode" != default; then 4700 # Only do commands if we really have different PIC objects. 4701 reload_objs="$libobjs $reload_conv_objs" 4702 output="$libobj" 4703 cmds=$reload_cmds 4704 save_ifs="$IFS"; IFS='~' 4705 for cmd in $cmds; do 4706 IFS="$save_ifs" 4707 eval cmd=\"$cmd\" 4708 $show "$cmd" 4709 $run eval "$cmd" || exit $? 4710 done 4711 IFS="$save_ifs" 4712 fi 4713 4714 if test -n "$gentop"; then 4715 $show "${rm}r $gentop" 4716 $run ${rm}r $gentop 4717 fi 4718 4719 exit $EXIT_SUCCESS 4720 ;; 4721 4722 prog) 4723 case $host in 4724 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; 4725 esac 4726 if test -n "$vinfo"; then 4727 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 4728 fi 4729 4730 if test -n "$release"; then 4731 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 4732 fi 4733 4734 if test "$preload" = yes; then 4735 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && 4736 test "$dlopen_self_static" = unknown; then 4737 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." 4738 fi 4739 fi 4740 4741 case $host in 4742 *-*-rhapsody* | *-*-darwin1.[012]) 4743 # On Rhapsody replace the C library is the System framework 4744 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` 4745 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` 4746 ;; 4747 esac 4748 4749 case $host in 4750 *darwin*) 4751 # Don't allow lazy linking, it breaks C++ global constructors 4752 if test "$tagname" = CXX ; then 4753 compile_command="$compile_command ${wl}-bind_at_load" 4754 finalize_command="$finalize_command ${wl}-bind_at_load" 4755 fi 4756 ;; 4757 esac 4758 4759 4760 # move library search paths that coincide with paths to not yet 4761 # installed libraries to the beginning of the library search list 4762 new_libs= 4763 for path in $notinst_path; do 4764 case " $new_libs " in 4765 *" -L$path/$objdir "*) ;; 4766 *) 4767 case " $compile_deplibs " in 4768 *" -L$path/$objdir "*) 4769 new_libs="$new_libs -L$path/$objdir" ;; 4770 esac 4771 ;; 4772 esac 4773 done 4774 for deplib in $compile_deplibs; do 4775 case $deplib in 4776 -L*) 4777 case " $new_libs " in 4778 *" $deplib "*) ;; 4779 *) new_libs="$new_libs $deplib" ;; 4780 esac 4781 ;; 4782 *) new_libs="$new_libs $deplib" ;; 4783 esac 4784 done 4785 compile_deplibs="$new_libs" 4786 4787 4788 compile_command="$compile_command $compile_deplibs" 4789 finalize_command="$finalize_command $finalize_deplibs" 4790 4791 if test -n "$rpath$xrpath"; then 4792 # If the user specified any rpath flags, then add them. 4793 for libdir in $rpath $xrpath; do 4794 # This is the magic to use -rpath. 4795 case "$finalize_rpath " in 4796 *" $libdir "*) ;; 4797 *) finalize_rpath="$finalize_rpath $libdir" ;; 4798 esac 4799 done 4800 fi 4801 4802 # Now hardcode the library paths 4803 rpath= 4804 hardcode_libdirs= 4805 for libdir in $compile_rpath $finalize_rpath; do 4806 if test -n "$hardcode_libdir_flag_spec"; then 4807 if test -n "$hardcode_libdir_separator"; then 4808 if test -z "$hardcode_libdirs"; then 4809 hardcode_libdirs="$libdir" 4810 else 4811 # Just accumulate the unique libdirs. 4812 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in 4813 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) 4814 ;; 4815 *) 4816 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" 4817 ;; 4818 esac 4819 fi 4820 else 4821 eval flag=\"$hardcode_libdir_flag_spec\" 4822 rpath="$rpath $flag" 4823 fi 4824 elif test -n "$runpath_var"; then 4825 case "$perm_rpath " in 4826 *" $libdir "*) ;; 4827 *) perm_rpath="$perm_rpath $libdir" ;; 4828 esac 4829 fi 4830 case $host in 4831 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) 4832 testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` 4833 case :$dllsearchpath: in 4834 *":$libdir:"*) ;; 4835 *) dllsearchpath="$dllsearchpath:$libdir";; 4836 esac 4837 case :$dllsearchpath: in 4838 *":$testbindir:"*) ;; 4839 *) dllsearchpath="$dllsearchpath:$testbindir";; 4840 esac 4841 ;; 4842 esac 4843 done 4844 # Substitute the hardcoded libdirs into the rpath. 4845 if test -n "$hardcode_libdir_separator" && 4846 test -n "$hardcode_libdirs"; then 4847 libdir="$hardcode_libdirs" 4848 eval rpath=\" $hardcode_libdir_flag_spec\" 4849 fi 4850 compile_rpath="$rpath" 4851 4852 rpath= 4853 hardcode_libdirs= 4854 for libdir in $finalize_rpath; do 4855 if test -n "$hardcode_libdir_flag_spec"; then 4856 if test -n "$hardcode_libdir_separator"; then 4857 if test -z "$hardcode_libdirs"; then 4858 hardcode_libdirs="$libdir" 4859 else 4860 # Just accumulate the unique libdirs. 4861 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in 4862 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) 4863 ;; 4864 *) 4865 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" 4866 ;; 4867 esac 4868 fi 4869 else 4870 eval flag=\"$hardcode_libdir_flag_spec\" 4871 rpath="$rpath $flag" 4872 fi 4873 elif test -n "$runpath_var"; then 4874 case "$finalize_perm_rpath " in 4875 *" $libdir "*) ;; 4876 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; 4877 esac 4878 fi 4879 done 4880 # Substitute the hardcoded libdirs into the rpath. 4881 if test -n "$hardcode_libdir_separator" && 4882 test -n "$hardcode_libdirs"; then 4883 libdir="$hardcode_libdirs" 4884 eval rpath=\" $hardcode_libdir_flag_spec\" 4885 fi 4886 finalize_rpath="$rpath" 4887 4888 if test -n "$libobjs" && test "$build_old_libs" = yes; then 4889 # Transform all the library objects into standard objects. 4890 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` 4891 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` 4892 fi 4893 4894 dlsyms= 4895 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then 4896 if test -n "$NM" && test -n "$global_symbol_pipe"; then 4897 dlsyms="${outputname}S.c" 4898 else 4899 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 4900 fi 4901 fi 4902 4903 if test -n "$dlsyms"; then 4904 case $dlsyms in 4905 "") ;; 4906 *.c) 4907 # Discover the nlist of each of the dlfiles. 4908 nlist="$output_objdir/${outputname}.nm" 4909 4910 $show "$rm $nlist ${nlist}S ${nlist}T" 4911 $run $rm "$nlist" "${nlist}S" "${nlist}T" 4912 4913 # Parse the name list into a source file. 4914 $show "creating $output_objdir/$dlsyms" 4915 4916 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ 4917/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ 4918/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ 4919 4920#ifdef __cplusplus 4921extern \"C\" { 4922#endif 4923 4924/* Prevent the only kind of declaration conflicts we can make. */ 4925#define lt_preloaded_symbols some_other_symbol 4926 4927/* External symbol declarations for the compiler. */\ 4928" 4929 4930 if test "$dlself" = yes; then 4931 $show "generating symbol list for \`$output'" 4932 4933 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" 4934 4935 # Add our own program objects to the symbol list. 4936 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` 4937 for arg in $progfiles; do 4938 $show "extracting global C symbols from \`$arg'" 4939 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" 4940 done 4941 4942 if test -n "$exclude_expsyms"; then 4943 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' 4944 $run eval '$mv "$nlist"T "$nlist"' 4945 fi 4946 4947 if test -n "$export_symbols_regex"; then 4948 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' 4949 $run eval '$mv "$nlist"T "$nlist"' 4950 fi 4951 4952 # Prepare the list of exported symbols 4953 if test -z "$export_symbols"; then 4954 export_symbols="$output_objdir/$outputname.exp" 4955 $run $rm $export_symbols 4956 $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' 4957 case $host in 4958 *cygwin* | *mingw* ) 4959 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' 4960 $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' 4961 ;; 4962 esac 4963 else 4964 $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' 4965 $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' 4966 $run eval 'mv "$nlist"T "$nlist"' 4967 case $host in 4968 *cygwin* | *mingw* ) 4969 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' 4970 $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' 4971 ;; 4972 esac 4973 fi 4974 fi 4975 4976 for arg in $dlprefiles; do 4977 $show "extracting global C symbols from \`$arg'" 4978 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` 4979 $run eval '$echo ": $name " >> "$nlist"' 4980 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" 4981 done 4982 4983 if test -z "$run"; then 4984 # Make sure we have at least an empty file. 4985 test -f "$nlist" || : > "$nlist" 4986 4987 if test -n "$exclude_expsyms"; then 4988 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T 4989 $mv "$nlist"T "$nlist" 4990 fi 4991 4992 # Try sorting and uniquifying the output. 4993 if grep -v "^: " < "$nlist" | 4994 if sort -k 3 </dev/null >/dev/null 2>&1; then 4995 sort -k 3 4996 else 4997 sort +2 4998 fi | 4999 uniq > "$nlist"S; then 5000 : 5001 else 5002 grep -v "^: " < "$nlist" > "$nlist"S 5003 fi 5004 5005 if test -f "$nlist"S; then 5006 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' 5007 else 5008 $echo '/* NONE */' >> "$output_objdir/$dlsyms" 5009 fi 5010 5011 $echo >> "$output_objdir/$dlsyms" "\ 5012 5013#undef lt_preloaded_symbols 5014 5015#if defined (__STDC__) && __STDC__ 5016# define lt_ptr void * 5017#else 5018# define lt_ptr char * 5019# define const 5020#endif 5021 5022/* The mapping between symbol names and symbols. */ 5023" 5024 5025 case $host in 5026 *cygwin* | *mingw* ) 5027 $echo >> "$output_objdir/$dlsyms" "\ 5028/* DATA imports from DLLs on WIN32 can't be const, because 5029 runtime relocations are performed -- see ld's documentation 5030 on pseudo-relocs */ 5031struct { 5032" 5033 ;; 5034 * ) 5035 $echo >> "$output_objdir/$dlsyms" "\ 5036const struct { 5037" 5038 ;; 5039 esac 5040 5041 5042 $echo >> "$output_objdir/$dlsyms" "\ 5043 const char *name; 5044 lt_ptr address; 5045} 5046lt_preloaded_symbols[] = 5047{\ 5048" 5049 5050 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" 5051 5052 $echo >> "$output_objdir/$dlsyms" "\ 5053 {0, (lt_ptr) 0} 5054}; 5055 5056/* This works around a problem in FreeBSD linker */ 5057#ifdef FREEBSD_WORKAROUND 5058static const void *lt_preloaded_setup() { 5059 return lt_preloaded_symbols; 5060} 5061#endif 5062 5063#ifdef __cplusplus 5064} 5065#endif\ 5066" 5067 fi 5068 5069 pic_flag_for_symtable= 5070 case $host in 5071 # compiling the symbol table file with pic_flag works around 5072 # a FreeBSD bug that causes programs to crash when -lm is 5073 # linked before any other PIC object. But we must not use 5074 # pic_flag when linking with -static. The problem exists in 5075 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. 5076 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) 5077 case "$compile_command " in 5078 *" -static "*) ;; 5079 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; 5080 esac;; 5081 *-*-hpux*) 5082 case "$compile_command " in 5083 *" -static "*) ;; 5084 *) pic_flag_for_symtable=" $pic_flag";; 5085 esac 5086 esac 5087 5088 # Now compile the dynamic symbol file. 5089 $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" 5090 $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? 5091 5092 # Clean up the generated files. 5093 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" 5094 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" 5095 5096 # Transform the symbol file into the correct name. 5097 case $host in 5098 *cygwin* | *mingw* ) 5099 if test -f "$output_objdir/${outputname}.def" ; then 5100 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` 5101 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` 5102 else 5103 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` 5104 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` 5105 fi 5106 ;; 5107 * ) 5108 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` 5109 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` 5110 ;; 5111 esac 5112 ;; 5113 *) 5114 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 5115 exit $EXIT_FAILURE 5116 ;; 5117 esac 5118 else 5119 # We keep going just in case the user didn't refer to 5120 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe 5121 # really was required. 5122 5123 # Nullify the symbol file. 5124 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` 5125 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` 5126 fi 5127 5128 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then 5129 # Replace the output file specification. 5130 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP` 5131 link_command="$compile_command$compile_rpath" 5132 5133 # We have no uninstalled library dependencies, so finalize right now. 5134 $show "$link_command" 5135 $run eval "$link_command" 5136 exit_status=$? 5137 5138 # Delete the generated files. 5139 if test -n "$dlsyms"; then 5140 $show "$rm $output_objdir/${outputname}S.${objext}" 5141 $run $rm "$output_objdir/${outputname}S.${objext}" 5142 fi 5143 5144 exit $exit_status 5145 fi 5146 5147 if test -n "$shlibpath_var"; then 5148 # We should set the shlibpath_var 5149 rpath= 5150 for dir in $temp_rpath; do 5151 case $dir in 5152 [\\/]* | [A-Za-z]:[\\/]*) 5153 # Absolute path. 5154 rpath="$rpath$dir:" 5155 ;; 5156 *) 5157 # Relative path: add a thisdir entry. 5158 rpath="$rpath\$thisdir/$dir:" 5159 ;; 5160 esac 5161 done 5162 temp_rpath="$rpath" 5163 fi 5164 5165 if test -n "$compile_shlibpath$finalize_shlibpath"; then 5166 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" 5167 fi 5168 if test -n "$finalize_shlibpath"; then 5169 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" 5170 fi 5171 5172 compile_var= 5173 finalize_var= 5174 if test -n "$runpath_var"; then 5175 if test -n "$perm_rpath"; then 5176 # We should set the runpath_var. 5177 rpath= 5178 for dir in $perm_rpath; do 5179 rpath="$rpath$dir:" 5180 done 5181 compile_var="$runpath_var=\"$rpath\$$runpath_var\" " 5182 fi 5183 if test -n "$finalize_perm_rpath"; then 5184 # We should set the runpath_var. 5185 rpath= 5186 for dir in $finalize_perm_rpath; do 5187 rpath="$rpath$dir:" 5188 done 5189 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " 5190 fi 5191 fi 5192 5193 if test "$no_install" = yes; then 5194 # We don't need to create a wrapper script. 5195 link_command="$compile_var$compile_command$compile_rpath" 5196 # Replace the output file specification. 5197 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` 5198 # Delete the old output file. 5199 $run $rm $output 5200 # Link the executable and exit 5201 $show "$link_command" 5202 $run eval "$link_command" || exit $? 5203 exit $EXIT_SUCCESS 5204 fi 5205 5206 if test "$hardcode_action" = relink; then 5207 # Fast installation is not supported 5208 link_command="$compile_var$compile_command$compile_rpath" 5209 relink_command="$finalize_var$finalize_command$finalize_rpath" 5210 5211 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 5212 $echo "$modename: \`$output' will be relinked during installation" 1>&2 5213 else 5214 if test "$fast_install" != no; then 5215 link_command="$finalize_var$compile_command$finalize_rpath" 5216 if test "$fast_install" = yes; then 5217 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP` 5218 else 5219 # fast_install is set to needless 5220 relink_command= 5221 fi 5222 else 5223 link_command="$compile_var$compile_command$compile_rpath" 5224 relink_command="$finalize_var$finalize_command$finalize_rpath" 5225 fi 5226 fi 5227 5228 # Replace the output file specification. 5229 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` 5230 5231 # Delete the old output files. 5232 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname 5233 5234 $show "$link_command" 5235 $run eval "$link_command" || exit $? 5236 5237 # Now create the wrapper script. 5238 $show "creating $output" 5239 5240 # Quote the relink command for shipping. 5241 if test -n "$relink_command"; then 5242 # Preserve any variables that may affect compiler behavior 5243 for var in $variables_saved_for_relink; do 5244 if eval test -z \"\${$var+set}\"; then 5245 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" 5246 elif eval var_value=\$$var; test -z "$var_value"; then 5247 relink_command="$var=; export $var; $relink_command" 5248 else 5249 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` 5250 relink_command="$var=\"$var_value\"; export $var; $relink_command" 5251 fi 5252 done 5253 relink_command="(cd `pwd`; $relink_command)" 5254 relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` 5255 fi 5256 5257 # Quote $echo for shipping. 5258 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then 5259 case $progpath in 5260 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; 5261 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; 5262 esac 5263 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` 5264 else 5265 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` 5266 fi 5267 5268 # Only actually do things if our run command is non-null. 5269 if test -z "$run"; then 5270 # win32 will think the script is a binary if it has 5271 # a .exe suffix, so we strip it off here. 5272 case $output in 5273 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; 5274 esac 5275 # test for cygwin because mv fails w/o .exe extensions 5276 case $host in 5277 *cygwin*) 5278 exeext=.exe 5279 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; 5280 *) exeext= ;; 5281 esac 5282 case $host in 5283 *cygwin* | *mingw* ) 5284 output_name=`basename $output` 5285 output_path=`dirname $output` 5286 cwrappersource="$output_path/$objdir/lt-$output_name.c" 5287 cwrapper="$output_path/$output_name.exe" 5288 $rm $cwrappersource $cwrapper 5289 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 5290 5291 cat > $cwrappersource <<EOF 5292 5293/* $cwrappersource - temporary wrapper executable for $objdir/$outputname 5294 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP 5295 5296 The $output program cannot be directly executed until all the libtool 5297 libraries that it depends on are installed. 5298 5299 This wrapper executable should never be moved out of the build directory. 5300 If it is, it will not operate correctly. 5301 5302 Currently, it simply execs the wrapper *script* "/bin/sh $output", 5303 but could eventually absorb all of the scripts functionality and 5304 exec $objdir/$outputname directly. 5305*/ 5306EOF 5307 cat >> $cwrappersource<<"EOF" 5308#include <stdio.h> 5309#include <stdlib.h> 5310#include <unistd.h> 5311#include <malloc.h> 5312#include <stdarg.h> 5313#include <assert.h> 5314#include <string.h> 5315#include <ctype.h> 5316#include <sys/stat.h> 5317 5318#if defined(PATH_MAX) 5319# define LT_PATHMAX PATH_MAX 5320#elif defined(MAXPATHLEN) 5321# define LT_PATHMAX MAXPATHLEN 5322#else 5323# define LT_PATHMAX 1024 5324#endif 5325 5326#ifndef DIR_SEPARATOR 5327# define DIR_SEPARATOR '/' 5328# define PATH_SEPARATOR ':' 5329#endif 5330 5331#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ 5332 defined (__OS2__) 5333# define HAVE_DOS_BASED_FILE_SYSTEM 5334# ifndef DIR_SEPARATOR_2 5335# define DIR_SEPARATOR_2 '\\' 5336# endif 5337# ifndef PATH_SEPARATOR_2 5338# define PATH_SEPARATOR_2 ';' 5339# endif 5340#endif 5341 5342#ifndef DIR_SEPARATOR_2 5343# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) 5344#else /* DIR_SEPARATOR_2 */ 5345# define IS_DIR_SEPARATOR(ch) \ 5346 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) 5347#endif /* DIR_SEPARATOR_2 */ 5348 5349#ifndef PATH_SEPARATOR_2 5350# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) 5351#else /* PATH_SEPARATOR_2 */ 5352# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) 5353#endif /* PATH_SEPARATOR_2 */ 5354 5355#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) 5356#define XFREE(stale) do { \ 5357 if (stale) { free ((void *) stale); stale = 0; } \ 5358} while (0) 5359 5360/* -DDEBUG is fairly common in CFLAGS. */ 5361#undef DEBUG 5362#if defined DEBUGWRAPPER 5363# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) 5364#else 5365# define DEBUG(format, ...) 5366#endif 5367 5368const char *program_name = NULL; 5369 5370void * xmalloc (size_t num); 5371char * xstrdup (const char *string); 5372const char * base_name (const char *name); 5373char * find_executable(const char *wrapper); 5374int check_executable(const char *path); 5375char * strendzap(char *str, const char *pat); 5376void lt_fatal (const char *message, ...); 5377 5378int 5379main (int argc, char *argv[]) 5380{ 5381 char **newargz; 5382 int i; 5383 5384 program_name = (char *) xstrdup (base_name (argv[0])); 5385 DEBUG("(main) argv[0] : %s\n",argv[0]); 5386 DEBUG("(main) program_name : %s\n",program_name); 5387 newargz = XMALLOC(char *, argc+2); 5388EOF 5389 5390 cat >> $cwrappersource <<EOF 5391 newargz[0] = (char *) xstrdup("$SHELL"); 5392EOF 5393 5394 cat >> $cwrappersource <<"EOF" 5395 newargz[1] = find_executable(argv[0]); 5396 if (newargz[1] == NULL) 5397 lt_fatal("Couldn't find %s", argv[0]); 5398 DEBUG("(main) found exe at : %s\n",newargz[1]); 5399 /* we know the script has the same name, without the .exe */ 5400 /* so make sure newargz[1] doesn't end in .exe */ 5401 strendzap(newargz[1],".exe"); 5402 for (i = 1; i < argc; i++) 5403 newargz[i+1] = xstrdup(argv[i]); 5404 newargz[argc+1] = NULL; 5405 5406 for (i=0; i<argc+1; i++) 5407 { 5408 DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]); 5409 ; 5410 } 5411 5412EOF 5413 5414 case $host_os in 5415 mingw*) 5416 cat >> $cwrappersource <<EOF 5417 execv("$SHELL",(char const **)newargz); 5418EOF 5419 ;; 5420 *) 5421 cat >> $cwrappersource <<EOF 5422 execv("$SHELL",newargz); 5423EOF 5424 ;; 5425 esac 5426 5427 cat >> $cwrappersource <<"EOF" 5428 return 127; 5429} 5430 5431void * 5432xmalloc (size_t num) 5433{ 5434 void * p = (void *) malloc (num); 5435 if (!p) 5436 lt_fatal ("Memory exhausted"); 5437 5438 return p; 5439} 5440 5441char * 5442xstrdup (const char *string) 5443{ 5444 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL 5445; 5446} 5447 5448const char * 5449base_name (const char *name) 5450{ 5451 const char *base; 5452 5453#if defined (HAVE_DOS_BASED_FILE_SYSTEM) 5454 /* Skip over the disk name in MSDOS pathnames. */ 5455 if (isalpha ((unsigned char)name[0]) && name[1] == ':') 5456 name += 2; 5457#endif 5458 5459 for (base = name; *name; name++) 5460 if (IS_DIR_SEPARATOR (*name)) 5461 base = name + 1; 5462 return base; 5463} 5464 5465int 5466check_executable(const char * path) 5467{ 5468 struct stat st; 5469 5470 DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); 5471 if ((!path) || (!*path)) 5472 return 0; 5473 5474 if ((stat (path, &st) >= 0) && 5475 ( 5476 /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ 5477#if defined (S_IXOTH) 5478 ((st.st_mode & S_IXOTH) == S_IXOTH) || 5479#endif 5480#if defined (S_IXGRP) 5481 ((st.st_mode & S_IXGRP) == S_IXGRP) || 5482#endif 5483 ((st.st_mode & S_IXUSR) == S_IXUSR)) 5484 ) 5485 return 1; 5486 else 5487 return 0; 5488} 5489 5490/* Searches for the full path of the wrapper. Returns 5491 newly allocated full path name if found, NULL otherwise */ 5492char * 5493find_executable (const char* wrapper) 5494{ 5495 int has_slash = 0; 5496 const char* p; 5497 const char* p_next; 5498 /* static buffer for getcwd */ 5499 char tmp[LT_PATHMAX + 1]; 5500 int tmp_len; 5501 char* concat_name; 5502 5503 DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); 5504 5505 if ((wrapper == NULL) || (*wrapper == '\0')) 5506 return NULL; 5507 5508 /* Absolute path? */ 5509#if defined (HAVE_DOS_BASED_FILE_SYSTEM) 5510 if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') 5511 { 5512 concat_name = xstrdup (wrapper); 5513 if (check_executable(concat_name)) 5514 return concat_name; 5515 XFREE(concat_name); 5516 } 5517 else 5518 { 5519#endif 5520 if (IS_DIR_SEPARATOR (wrapper[0])) 5521 { 5522 concat_name = xstrdup (wrapper); 5523 if (check_executable(concat_name)) 5524 return concat_name; 5525 XFREE(concat_name); 5526 } 5527#if defined (HAVE_DOS_BASED_FILE_SYSTEM) 5528 } 5529#endif 5530 5531 for (p = wrapper; *p; p++) 5532 if (*p == '/') 5533 { 5534 has_slash = 1; 5535 break; 5536 } 5537 if (!has_slash) 5538 { 5539 /* no slashes; search PATH */ 5540 const char* path = getenv ("PATH"); 5541 if (path != NULL) 5542 { 5543 for (p = path; *p; p = p_next) 5544 { 5545 const char* q; 5546 size_t p_len; 5547 for (q = p; *q; q++) 5548 if (IS_PATH_SEPARATOR(*q)) 5549 break; 5550 p_len = q - p; 5551 p_next = (*q == '\0' ? q : q + 1); 5552 if (p_len == 0) 5553 { 5554 /* empty path: current directory */ 5555 if (getcwd (tmp, LT_PATHMAX) == NULL) 5556 lt_fatal ("getcwd failed"); 5557 tmp_len = strlen(tmp); 5558 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); 5559 memcpy (concat_name, tmp, tmp_len); 5560 concat_name[tmp_len] = '/'; 5561 strcpy (concat_name + tmp_len + 1, wrapper); 5562 } 5563 else 5564 { 5565 concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); 5566 memcpy (concat_name, p, p_len); 5567 concat_name[p_len] = '/'; 5568 strcpy (concat_name + p_len + 1, wrapper); 5569 } 5570 if (check_executable(concat_name)) 5571 return concat_name; 5572 XFREE(concat_name); 5573 } 5574 } 5575 /* not found in PATH; assume curdir */ 5576 } 5577 /* Relative path | not found in path: prepend cwd */ 5578 if (getcwd (tmp, LT_PATHMAX) == NULL) 5579 lt_fatal ("getcwd failed"); 5580 tmp_len = strlen(tmp); 5581 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); 5582 memcpy (concat_name, tmp, tmp_len); 5583 concat_name[tmp_len] = '/'; 5584 strcpy (concat_name + tmp_len + 1, wrapper); 5585 5586 if (check_executable(concat_name)) 5587 return concat_name; 5588 XFREE(concat_name); 5589 return NULL; 5590} 5591 5592char * 5593strendzap(char *str, const char *pat) 5594{ 5595 size_t len, patlen; 5596 5597 assert(str != NULL); 5598 assert(pat != NULL); 5599 5600 len = strlen(str); 5601 patlen = strlen(pat); 5602 5603 if (patlen <= len) 5604 { 5605 str += len - patlen; 5606 if (strcmp(str, pat) == 0) 5607 *str = '\0'; 5608 } 5609 return str; 5610} 5611 5612static void 5613lt_error_core (int exit_status, const char * mode, 5614 const char * message, va_list ap) 5615{ 5616 fprintf (stderr, "%s: %s: ", program_name, mode); 5617 vfprintf (stderr, message, ap); 5618 fprintf (stderr, ".\n"); 5619 5620 if (exit_status >= 0) 5621 exit (exit_status); 5622} 5623 5624void 5625lt_fatal (const char *message, ...) 5626{ 5627 va_list ap; 5628 va_start (ap, message); 5629 lt_error_core (EXIT_FAILURE, "FATAL", message, ap); 5630 va_end (ap); 5631} 5632EOF 5633 # we should really use a build-platform specific compiler 5634 # here, but OTOH, the wrappers (shell script and this C one) 5635 # are only useful if you want to execute the "real" binary. 5636 # Since the "real" binary is built for $host, then this 5637 # wrapper might as well be built for $host, too. 5638 $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource 5639 ;; 5640 esac 5641 $rm $output 5642 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 5643 5644 $echo > $output "\ 5645#! $SHELL 5646 5647# $output - temporary wrapper script for $objdir/$outputname 5648# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP 5649# 5650# The $output program cannot be directly executed until all the libtool 5651# libraries that it depends on are installed. 5652# 5653# This wrapper script should never be moved out of the build directory. 5654# If it is, it will not operate correctly. 5655 5656# Sed substitution that helps us do robust quoting. It backslashifies 5657# metacharacters that are still active within double-quoted strings. 5658Xsed='${SED} -e 1s/^X//' 5659sed_quote_subst='$sed_quote_subst' 5660 5661# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). 5662if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then 5663 emulate sh 5664 NULLCMD=: 5665 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which 5666 # is contrary to our usage. Disable this feature. 5667 alias -g '\${1+\"\$@\"}'='\"\$@\"' 5668 setopt NO_GLOB_SUBST 5669else 5670 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac 5671fi 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 \$*\" 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" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` 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" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP` 6347 else 6348 relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP` 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" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP` 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 for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES 6834 do 6835 eval "if test \"\${save_$lt_var+set}\" = set; then 6836 $lt_var=\$save_$lt_var; export $lt_var 6837 else 6838 $lt_unset $lt_var 6839 fi" 6840 done 6841 6842 6843 # Now prepare to actually exec the command. 6844 exec_cmd="\$cmd$args" 6845 else 6846 # Display what would be done. 6847 if test -n "$shlibpath_var"; then 6848 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" 6849 $echo "export $shlibpath_var" 6850 fi 6851 $echo "$cmd$args" 6852 exit $EXIT_SUCCESS 6853 fi 6854 ;; 6855 6856 # libtool clean and uninstall mode 6857 clean | uninstall) 6858 modename="$modename: $mode" 6859 rm="$nonopt" 6860 files= 6861 rmforce= 6862 exit_status=0 6863 6864 # This variable tells wrapper scripts just to set variables rather 6865 # than running their programs. 6866 libtool_install_magic="$magic" 6867 6868 for arg 6869 do 6870 case $arg in 6871 -f) rm="$rm $arg"; rmforce=yes ;; 6872 -*) rm="$rm $arg" ;; 6873 *) files="$files $arg" ;; 6874 esac 6875 done 6876 6877 if test -z "$rm"; then 6878 $echo "$modename: you must specify an RM program" 1>&2 6879 $echo "$help" 1>&2 6880 exit $EXIT_FAILURE 6881 fi 6882 6883 rmdirs= 6884 6885 origobjdir="$objdir" 6886 for file in $files; do 6887 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` 6888 if test "X$dir" = "X$file"; then 6889 dir=. 6890 objdir="$origobjdir" 6891 else 6892 objdir="$dir/$origobjdir" 6893 fi 6894 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` 6895 test "$mode" = uninstall && objdir="$dir" 6896 6897 # Remember objdir for removal later, being careful to avoid duplicates 6898 if test "$mode" = clean; then 6899 case " $rmdirs " in 6900 *" $objdir "*) ;; 6901 *) rmdirs="$rmdirs $objdir" ;; 6902 esac 6903 fi 6904 6905 # Don't error if the file doesn't exist and rm -f was used. 6906 if (test -L "$file") >/dev/null 2>&1 \ 6907 || (test -h "$file") >/dev/null 2>&1 \ 6908 || test -f "$file"; then 6909 : 6910 elif test -d "$file"; then 6911 exit_status=1 6912 continue 6913 elif test "$rmforce" = yes; then 6914 continue 6915 fi 6916 6917 rmfiles="$file" 6918 6919 case $name in 6920 *.la) 6921 # Possibly a libtool archive, so verify it. 6922 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 6923 . $dir/$name 6924 6925 # Delete the libtool libraries and symlinks. 6926 for n in $library_names; do 6927 rmfiles="$rmfiles $objdir/$n" 6928 done 6929 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" 6930 6931 case "$mode" in 6932 clean) 6933 case " $library_names " in 6934 # " " in the beginning catches empty $dlname 6935 *" $dlname "*) ;; 6936 *) rmfiles="$rmfiles $objdir/$dlname" ;; 6937 esac 6938 test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" 6939 ;; 6940 uninstall) 6941 if test -n "$library_names"; then 6942 # Do each command in the postuninstall commands. 6943 cmds=$postuninstall_cmds 6944 save_ifs="$IFS"; IFS='~' 6945 for cmd in $cmds; do 6946 IFS="$save_ifs" 6947 eval cmd=\"$cmd\" 6948 $show "$cmd" 6949 $run eval "$cmd" 6950 if test "$?" -ne 0 && test "$rmforce" != yes; then 6951 exit_status=1 6952 fi 6953 done 6954 IFS="$save_ifs" 6955 fi 6956 6957 if test -n "$old_library"; then 6958 # Do each command in the old_postuninstall commands. 6959 cmds=$old_postuninstall_cmds 6960 save_ifs="$IFS"; IFS='~' 6961 for cmd in $cmds; do 6962 IFS="$save_ifs" 6963 eval cmd=\"$cmd\" 6964 $show "$cmd" 6965 $run eval "$cmd" 6966 if test "$?" -ne 0 && test "$rmforce" != yes; then 6967 exit_status=1 6968 fi 6969 done 6970 IFS="$save_ifs" 6971 fi 6972 # FIXME: should reinstall the best remaining shared library. 6973 ;; 6974 esac 6975 fi 6976 ;; 6977 6978 *.lo) 6979 # Possibly a libtool object, so verify it. 6980 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 6981 6982 # Read the .lo file 6983 . $dir/$name 6984 6985 # Add PIC object to the list of files to remove. 6986 if test -n "$pic_object" \ 6987 && test "$pic_object" != none; then 6988 rmfiles="$rmfiles $dir/$pic_object" 6989 fi 6990 6991 # Add non-PIC object to the list of files to remove. 6992 if test -n "$non_pic_object" \ 6993 && test "$non_pic_object" != none; then 6994 rmfiles="$rmfiles $dir/$non_pic_object" 6995 fi 6996 fi 6997 ;; 6998 6999 *) 7000 if test "$mode" = clean ; then 7001 noexename=$name 7002 case $file in 7003 *.exe) 7004 file=`$echo $file|${SED} 's,.exe$,,'` 7005 noexename=`$echo $name|${SED} 's,.exe$,,'` 7006 # $file with .exe has already been added to rmfiles, 7007 # add $file without .exe 7008 rmfiles="$rmfiles $file" 7009 ;; 7010 esac 7011 # Do a test to see if this is a libtool program. 7012 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 7013 relink_command= 7014 . $dir/$noexename 7015 7016 # note $name still contains .exe if it was in $file originally 7017 # as does the version of $file that was added into $rmfiles 7018 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" 7019 if test "$fast_install" = yes && test -n "$relink_command"; then 7020 rmfiles="$rmfiles $objdir/lt-$name" 7021 fi 7022 if test "X$noexename" != "X$name" ; then 7023 rmfiles="$rmfiles $objdir/lt-${noexename}.c" 7024 fi 7025 fi 7026 fi 7027 ;; 7028 esac 7029 $show "$rm $rmfiles" 7030 $run $rm $rmfiles || exit_status=1 7031 done 7032 objdir="$origobjdir" 7033 7034 # Try to remove the ${objdir}s in the directories where we deleted files 7035 for dir in $rmdirs; do 7036 if test -d "$dir"; then 7037 $show "rmdir $dir" 7038 $run rmdir $dir >/dev/null 2>&1 7039 fi 7040 done 7041 7042 exit $exit_status 7043 ;; 7044 7045 "") 7046 $echo "$modename: you must specify a MODE" 1>&2 7047 $echo "$generic_help" 1>&2 7048 exit $EXIT_FAILURE 7049 ;; 7050 esac 7051 7052 if test -z "$exec_cmd"; then 7053 $echo "$modename: invalid operation mode \`$mode'" 1>&2 7054 $echo "$generic_help" 1>&2 7055 exit $EXIT_FAILURE 7056 fi 7057fi # test -z "$show_help" 7058 7059if test -n "$exec_cmd"; then 7060 eval exec $exec_cmd 7061 exit $EXIT_FAILURE 7062fi 7063 7064# We need to display help for each of the modes. 7065case $mode in 7066"") $echo \ 7067"Usage: $modename [OPTION]... [MODE-ARG]... 7068 7069Provide generalized library-building support services. 7070 7071 --config show all configuration variables 7072 --debug enable verbose shell tracing 7073-n, --dry-run display commands without modifying any files 7074 --features display basic configuration information and exit 7075 --finish same as \`--mode=finish' 7076 --help display this help message and exit 7077 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] 7078 --quiet same as \`--silent' 7079 --silent don't print informational messages 7080 --tag=TAG use configuration variables from tag TAG 7081 --version print version information 7082 7083MODE must be one of the following: 7084 7085 clean remove files from the build directory 7086 compile compile a source file into a libtool object 7087 execute automatically set library path, then run a program 7088 finish complete the installation of libtool libraries 7089 install install libraries or executables 7090 link create a library or an executable 7091 uninstall remove libraries from an installed directory 7092 7093MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for 7094a more detailed description of MODE. 7095 7096Report bugs to <bug-libtool@gnu.org>." 7097 exit $EXIT_SUCCESS 7098 ;; 7099 7100clean) 7101 $echo \ 7102"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... 7103 7104Remove files from the build directory. 7105 7106RM is the name of the program to use to delete files associated with each FILE 7107(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed 7108to RM. 7109 7110If FILE is a libtool library, object or program, all the files associated 7111with it are deleted. Otherwise, only FILE itself is deleted using RM." 7112 ;; 7113 7114compile) 7115 $echo \ 7116"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE 7117 7118Compile a source file into a libtool library object. 7119 7120This mode accepts the following additional options: 7121 7122 -o OUTPUT-FILE set the output file name to OUTPUT-FILE 7123 -prefer-pic try to building PIC objects only 7124 -prefer-non-pic try to building non-PIC objects only 7125 -static always build a \`.o' file suitable for static linking 7126 7127COMPILE-COMMAND is a command to be used in creating a \`standard' object file 7128from the given SOURCEFILE. 7129 7130The output file name is determined by removing the directory component from 7131SOURCEFILE, then substituting the C source code suffix \`.c' with the 7132library object suffix, \`.lo'." 7133 ;; 7134 7135execute) 7136 $echo \ 7137"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... 7138 7139Automatically set library path, then run a program. 7140 7141This mode accepts the following additional options: 7142 7143 -dlopen FILE add the directory containing FILE to the library path 7144 7145This mode sets the library path environment variable according to \`-dlopen' 7146flags. 7147 7148If any of the ARGS are libtool executable wrappers, then they are translated 7149into their corresponding uninstalled binary, and any of their required library 7150directories are added to the library path. 7151 7152Then, COMMAND is executed, with ARGS as arguments." 7153 ;; 7154 7155finish) 7156 $echo \ 7157"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... 7158 7159Complete the installation of libtool libraries. 7160 7161Each LIBDIR is a directory that contains libtool libraries. 7162 7163The commands that this mode executes may require superuser privileges. Use 7164the \`--dry-run' option if you just want to see what would be executed." 7165 ;; 7166 7167install) 7168 $echo \ 7169"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... 7170 7171Install executables or libraries. 7172 7173INSTALL-COMMAND is the installation command. The first component should be 7174either the \`install' or \`cp' program. 7175 7176The rest of the components are interpreted as arguments to that command (only 7177BSD-compatible install options are recognized)." 7178 ;; 7179 7180link) 7181 $echo \ 7182"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... 7183 7184Link object files or libraries together to form another library, or to 7185create an executable program. 7186 7187LINK-COMMAND is a command using the C compiler that you would use to create 7188a program from several object files. 7189 7190The following components of LINK-COMMAND are treated specially: 7191 7192 -all-static do not do any dynamic linking at all 7193 -avoid-version do not add a version suffix if possible 7194 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime 7195 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols 7196 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) 7197 -export-symbols SYMFILE 7198 try to export only the symbols listed in SYMFILE 7199 -export-symbols-regex REGEX 7200 try to export only the symbols matching REGEX 7201 -LLIBDIR search LIBDIR for required installed libraries 7202 -lNAME OUTPUT-FILE requires the installed library libNAME 7203 -module build a library that can dlopened 7204 -no-fast-install disable the fast-install mode 7205 -no-install link a not-installable executable 7206 -no-undefined declare that a library does not refer to external symbols 7207 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects 7208 -objectlist FILE Use a list of object files found in FILE to specify objects 7209 -precious-files-regex REGEX 7210 don't remove output files matching REGEX 7211 -release RELEASE specify package release information 7212 -rpath LIBDIR the created library will eventually be installed in LIBDIR 7213 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries 7214 -static do not do any dynamic linking of uninstalled libtool libraries 7215 -static-libtool-libs 7216 do not do any dynamic linking of libtool libraries 7217 -version-info CURRENT[:REVISION[:AGE]] 7218 specify library version info [each variable defaults to 0] 7219 7220All other options (arguments beginning with \`-') are ignored. 7221 7222Every other argument is treated as a filename. Files ending in \`.la' are 7223treated as uninstalled libtool libraries, other files are standard or library 7224object files. 7225 7226If the OUTPUT-FILE ends in \`.la', then a libtool library is created, 7227only library objects (\`.lo' files) may be specified, and \`-rpath' is 7228required, except when creating a convenience library. 7229 7230If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created 7231using \`ar' and \`ranlib', or on Windows using \`lib'. 7232 7233If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file 7234is created, otherwise an executable program is created." 7235 ;; 7236 7237uninstall) 7238 $echo \ 7239"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... 7240 7241Remove libraries from an installation directory. 7242 7243RM is the name of the program to use to delete files associated with each FILE 7244(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed 7245to RM. 7246 7247If FILE is a libtool library, all the files associated with it are deleted. 7248Otherwise, only FILE itself is deleted using RM." 7249 ;; 7250 7251*) 7252 $echo "$modename: invalid operation mode \`$mode'" 1>&2 7253 $echo "$help" 1>&2 7254 exit $EXIT_FAILURE 7255 ;; 7256esac 7257 7258$echo 7259$echo "Try \`$modename --help' for more information about other modes." 7260 7261exit $? 7262 7263# The TAGs below are defined such that we never get into a situation 7264# in which we disable both kinds of libraries. Given conflicting 7265# choices, we go for a static library, that is the most portable, 7266# since we can't tell whether shared libraries were disabled because 7267# the user asked for that or because the platform doesn't support 7268# them. This is particularly important on AIX, because we don't 7269# support having both static and shared libraries enabled at the same 7270# time on that platform, so we default to a shared-only configuration. 7271# If a disable-shared tag is given, we'll fallback to a static-only 7272# configuration. But we'll never go from static-only to shared-only. 7273 7274# ### BEGIN LIBTOOL TAG CONFIG: disable-shared 7275disable_libs=shared 7276# ### END LIBTOOL TAG CONFIG: disable-shared 7277 7278# ### BEGIN LIBTOOL TAG CONFIG: disable-static 7279disable_libs=static 7280# ### END LIBTOOL TAG CONFIG: disable-static 7281 7282# Local Variables: 7283# mode:shell-script 7284# sh-indentation:2 7285# End: 7286# ### BEGIN LIBTOOL TAG CONFIG: CXX 7287 7288# Libtool was configured on host dev3: 7289 7290# Shell to use when invoking shell scripts. 7291SHELL="/bin/sh" 7292 7293# Whether or not to build shared libraries. 7294build_libtool_libs=no 7295 7296# Whether or not to build static libraries. 7297build_old_libs=yes 7298 7299# Whether or not to add -lc for building shared libraries. 7300build_libtool_need_lc=no 7301 7302# Whether or not to disallow shared libs when runtime libs are static 7303allow_libtool_libs_with_static_runtimes=no 7304 7305# Whether or not to optimize for fast installation. 7306fast_install=needless 7307 7308# The host system. 7309host_alias=mipsel 7310host=mipsel-unknown-elf 7311host_os=elf 7312 7313# The build system. 7314build_alias=mipsel-linux-uclibc 7315build=mipsel-unknown-linux-uclibc 7316build_os=linux-uclibc 7317 7318# An echo program that does not interpret backslashes. 7319echo="echo" 7320 7321# The archiver. 7322AR="ar" 7323AR_FLAGS="cru" 7324 7325# A C compiler. 7326LTCC="mipsel-uclibc-gcc" 7327 7328# LTCC compiler flags. 7329LTCFLAGS="-g -O2" 7330 7331# A language-specific compiler. 7332CC="g++" 7333 7334# Is the compiler the GNU C compiler? 7335with_gcc=yes 7336 7337gcc_dir=`gcc -print-file-name=. | /bin/sed 's,/\.$,,'` 7338gcc_ver=`gcc -dumpversion` 7339 7340# An ERE matcher. 7341EGREP="/bin/grep -E" 7342 7343# The linker used to build libraries. 7344LD="/opt/brcm/hndtools-mipsel-linux-3.2.3/mipsel-linux/bin/ld" 7345 7346# Whether we need hard or soft links. 7347LN_S="ln -s" 7348 7349# A BSD-compatible nm program. 7350NM="nm" 7351 7352# A symbol stripping program 7353STRIP="strip" 7354 7355# Used to examine libraries when file_magic_cmd begins "file" 7356MAGIC_CMD=file 7357 7358# Used on cygwin: DLL creation program. 7359DLLTOOL="dlltool" 7360 7361# Used on cygwin: object dumper. 7362OBJDUMP="objdump" 7363 7364# Used on cygwin: assembler. 7365AS="as" 7366 7367# The name of the directory that contains temporary libtool files. 7368objdir=.libs 7369 7370# How to create reloadable object files. 7371reload_flag=" -r" 7372reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs" 7373 7374# How to pass a linker flag through the compiler. 7375wl="-Wl," 7376 7377# Object file suffix (normally "o"). 7378objext="o" 7379 7380# Old archive suffix (normally "a"). 7381libext="a" 7382 7383# Shared library suffix (normally ".so"). 7384shrext_cmds='.so' 7385 7386# Executable file suffix (normally ""). 7387exeext="" 7388 7389# Additional compiler flags for building library objects. 7390pic_flag=" -fPIC -DPIC" 7391pic_mode=default 7392 7393# What is the maximum length of a command? 7394max_cmd_len=32768 7395 7396# Does compiler simultaneously support -c and -o options? 7397compiler_c_o="yes" 7398 7399# Must we lock files when doing compilation? 7400need_locks="no" 7401 7402# Do we need the lib prefix for modules? 7403need_lib_prefix=unknown 7404 7405# Do we need a version for libraries? 7406need_version=unknown 7407 7408# Whether dlopen is supported. 7409dlopen_support=unknown 7410 7411# Whether dlopen of programs is supported. 7412dlopen_self=unknown 7413 7414# Whether dlopen of statically linked programs is supported. 7415dlopen_self_static=unknown 7416 7417# Compiler flag to prevent dynamic linking. 7418link_static_flag="-static" 7419 7420# Compiler flag to turn off builtin functions. 7421no_builtin_flag=" -fno-builtin" 7422 7423# Compiler flag to allow reflexive dlopens. 7424export_dynamic_flag_spec="\${wl}--export-dynamic" 7425 7426# Compiler flag to generate shared objects directly from archives. 7427whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive" 7428 7429# Compiler flag to generate thread-safe objects. 7430thread_safe_flag_spec="" 7431 7432# Library versioning type. 7433version_type=none 7434 7435# Format of library name prefix. 7436libname_spec="lib\$name" 7437 7438# List of archive names. First name is the real one, the rest are links. 7439# The last name is the one that the linker finds with -lNAME. 7440library_names_spec="" 7441 7442# The coded name of the library, if different from the real name. 7443soname_spec="" 7444 7445# Commands used to build and install an old-style archive. 7446RANLIB="ranlib" 7447old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib" 7448old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib" 7449old_postuninstall_cmds="" 7450 7451# Create an old-style archive from a shared archive. 7452old_archive_from_new_cmds="" 7453 7454# Create a temporary old-style archive to link instead of a shared archive. 7455old_archive_from_expsyms_cmds="" 7456 7457# Commands used to build and install a shared archive. 7458archive_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib" 7459archive_expsym_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib" 7460postinstall_cmds="" 7461postuninstall_cmds="" 7462 7463# Commands used to build a loadable module (assumed same as above if empty) 7464module_cmds="" 7465module_expsym_cmds="" 7466 7467# Commands to strip libraries. 7468old_striplib="strip --strip-debug" 7469striplib="strip --strip-unneeded" 7470 7471# Dependencies to place before the objects being linked to create a 7472# shared library. 7473predep_objects=`echo "/usr/lib/gcc/i386-redhat-linux/4.1.1/../../../crti.o /usr/lib/gcc/i386-redhat-linux/4.1.1/crtbeginS.o" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"` 7474 7475# Dependencies to place after the objects being linked to create a 7476# shared library. 7477postdep_objects=`echo "/usr/lib/gcc/i386-redhat-linux/4.1.1/crtendS.o /usr/lib/gcc/i386-redhat-linux/4.1.1/../../../crtn.o" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"` 7478 7479# Dependencies to place before the objects being linked to create a 7480# shared library. 7481predeps="" 7482 7483# Dependencies to place after the objects being linked to create a 7484# shared library. 7485postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s" 7486 7487# The library search path used internally by the compiler when linking 7488# a shared library. 7489compiler_lib_search_path=`echo "-L/usr/lib/gcc/i386-redhat-linux/4.1.1 -L/usr/lib/gcc/i386-redhat-linux/4.1.1 -L/usr/lib/gcc/i386-redhat-linux/4.1.1/../../.." | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"` 7490 7491# Method to check whether dependent libraries are shared objects. 7492deplibs_check_method="unknown" 7493 7494# Command to use when deplibs_check_method == file_magic. 7495file_magic_cmd="\$MAGIC_CMD" 7496 7497# Flag that allows shared libraries with undefined symbols to be built. 7498allow_undefined_flag="" 7499 7500# Flag that forces no undefined symbols. 7501no_undefined_flag="" 7502 7503# Commands used to finish a libtool library installation in a directory. 7504finish_cmds="" 7505 7506# Same as above, but a single script fragment to be evaled but not shown. 7507finish_eval="" 7508 7509# Take the output of nm and produce a listing of raw symbols and C names. 7510global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'" 7511 7512# Transform the output of nm in a proper C declaration 7513global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'" 7514 7515# Transform the output of nm in a C name address pair 7516global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'" 7517 7518# This is the shared library runtime path variable. 7519runpath_var=LD_RUN_PATH 7520 7521# This is the shared library path variable. 7522shlibpath_var= 7523 7524# Is shlibpath searched before the hard-coded library search path? 7525shlibpath_overrides_runpath=unknown 7526 7527# How to hardcode a shared library path into an executable. 7528hardcode_action=immediate 7529 7530# Whether we should hardcode library paths into libraries. 7531hardcode_into_libs=no 7532 7533# Flag to hardcode $libdir into a binary during linking. 7534# This must work even if $libdir does not exist. 7535hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir" 7536 7537# If ld is used when linking, flag to hardcode $libdir into 7538# a binary during linking. This must work even if $libdir does 7539# not exist. 7540hardcode_libdir_flag_spec_ld="" 7541 7542# Whether we need a single -rpath flag with a separated argument. 7543hardcode_libdir_separator="" 7544 7545# Set to yes if using DIR/libNAME during linking hardcodes DIR into the 7546# resulting binary. 7547hardcode_direct=no 7548 7549# Set to yes if using the -LDIR flag during linking hardcodes DIR into the 7550# resulting binary. 7551hardcode_minus_L=no 7552 7553# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into 7554# the resulting binary. 7555hardcode_shlibpath_var=unsupported 7556 7557# Set to yes if building a shared library automatically hardcodes DIR into the library 7558# and all subsequent libraries and executables linked against it. 7559hardcode_automatic=no 7560 7561# Variables whose values should be saved in libtool wrapper scripts and 7562# restored at relink time. 7563variables_saved_for_relink="PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" 7564 7565# Whether libtool must link a program against all its dependency libraries. 7566link_all_deplibs=unknown 7567 7568# Compile-time system search path for libraries 7569sys_lib_search_path_spec=`echo " /usr/lib/gcc/i386-redhat-linux/4.1.1/ /usr/lib/gcc/i386-redhat-linux/4.1.1/ /usr/lib/gcc/i386-redhat-linux/4.1.1/../../../../i386-redhat-linux/lib/i386-redhat-linux/4.1.1/ /usr/lib/gcc/i386-redhat-linux/4.1.1/../../../../i386-redhat-linux/lib/ /usr/lib/gcc/i386-redhat-linux/4.1.1/../../../i386-redhat-linux/4.1.1/ /usr/lib/gcc/i386-redhat-linux/4.1.1/../../../ /lib/i386-redhat-linux/4.1.1/ /lib/ /usr/lib/i386-redhat-linux/4.1.1/ /usr/lib/" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"` 7570 7571# Run-time system search path for libraries 7572sys_lib_dlsearch_path_spec="/lib /usr/lib" 7573 7574# Fix the shell variable $srcfile for the compiler. 7575fix_srcfile_path="" 7576 7577# Set to yes if exported symbols are required. 7578always_export_symbols=no 7579 7580# The commands to list exported symbols. 7581export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols" 7582 7583# The commands to extract the exported symbol list from a shared archive. 7584extract_expsyms_cmds="" 7585 7586# Symbols that should not be listed in the preloaded symbols. 7587exclude_expsyms="" 7588 7589# Symbols that must always be exported. 7590include_expsyms="" 7591 7592# ### END LIBTOOL TAG CONFIG: CXX 7593 7594# ### BEGIN LIBTOOL TAG CONFIG: F77 7595 7596# Libtool was configured on host dev3: 7597 7598# Shell to use when invoking shell scripts. 7599SHELL="/bin/sh" 7600 7601# Whether or not to build shared libraries. 7602build_libtool_libs=no 7603 7604# Whether or not to build static libraries. 7605build_old_libs=yes 7606 7607# Whether or not to add -lc for building shared libraries. 7608build_libtool_need_lc=no 7609 7610# Whether or not to disallow shared libs when runtime libs are static 7611allow_libtool_libs_with_static_runtimes=no 7612 7613# Whether or not to optimize for fast installation. 7614fast_install=needless 7615 7616# The host system. 7617host_alias=mipsel 7618host=mipsel-unknown-elf 7619host_os=elf 7620 7621# The build system. 7622build_alias=mipsel-linux-uclibc 7623build=mipsel-unknown-linux-uclibc 7624build_os=linux-uclibc 7625 7626# An echo program that does not interpret backslashes. 7627echo="echo" 7628 7629# The archiver. 7630AR="ar" 7631AR_FLAGS="cru" 7632 7633# A C compiler. 7634LTCC="mipsel-uclibc-gcc" 7635 7636# LTCC compiler flags. 7637LTCFLAGS="-g -O2" 7638 7639# A language-specific compiler. 7640CC="gfortran" 7641 7642# Is the compiler the GNU C compiler? 7643with_gcc=yes 7644 7645gcc_dir=`gcc -print-file-name=. | /bin/sed 's,/\.$,,'` 7646gcc_ver=`gcc -dumpversion` 7647 7648# An ERE matcher. 7649EGREP="/bin/grep -E" 7650 7651# The linker used to build libraries. 7652LD="/opt/brcm/hndtools-mipsel-linux-3.2.3/mipsel-linux/bin/ld" 7653 7654# Whether we need hard or soft links. 7655LN_S="ln -s" 7656 7657# A BSD-compatible nm program. 7658NM="nm" 7659 7660# A symbol stripping program 7661STRIP="strip" 7662 7663# Used to examine libraries when file_magic_cmd begins "file" 7664MAGIC_CMD=file 7665 7666# Used on cygwin: DLL creation program. 7667DLLTOOL="dlltool" 7668 7669# Used on cygwin: object dumper. 7670OBJDUMP="objdump" 7671 7672# Used on cygwin: assembler. 7673AS="as" 7674 7675# The name of the directory that contains temporary libtool files. 7676objdir=.libs 7677 7678# How to create reloadable object files. 7679reload_flag=" -r" 7680reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs" 7681 7682# How to pass a linker flag through the compiler. 7683wl="-Wl," 7684 7685# Object file suffix (normally "o"). 7686objext="o" 7687 7688# Old archive suffix (normally "a"). 7689libext="a" 7690 7691# Shared library suffix (normally ".so"). 7692shrext_cmds='.so' 7693 7694# Executable file suffix (normally ""). 7695exeext="" 7696 7697# Additional compiler flags for building library objects. 7698pic_flag=" -fPIC" 7699pic_mode=default 7700 7701# What is the maximum length of a command? 7702max_cmd_len=32768 7703 7704# Does compiler simultaneously support -c and -o options? 7705compiler_c_o="yes" 7706 7707# Must we lock files when doing compilation? 7708need_locks="no" 7709 7710# Do we need the lib prefix for modules? 7711need_lib_prefix=unknown 7712 7713# Do we need a version for libraries? 7714need_version=unknown 7715 7716# Whether dlopen is supported. 7717dlopen_support=unknown 7718 7719# Whether dlopen of programs is supported. 7720dlopen_self=unknown 7721 7722# Whether dlopen of statically linked programs is supported. 7723dlopen_self_static=unknown 7724 7725# Compiler flag to prevent dynamic linking. 7726link_static_flag="-static" 7727 7728# Compiler flag to turn off builtin functions. 7729no_builtin_flag="" 7730 7731# Compiler flag to allow reflexive dlopens. 7732export_dynamic_flag_spec="\${wl}--export-dynamic" 7733 7734# Compiler flag to generate shared objects directly from archives. 7735whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive" 7736 7737# Compiler flag to generate thread-safe objects. 7738thread_safe_flag_spec="" 7739 7740# Library versioning type. 7741version_type=none 7742 7743# Format of library name prefix. 7744libname_spec="lib\$name" 7745 7746# List of archive names. First name is the real one, the rest are links. 7747# The last name is the one that the linker finds with -lNAME. 7748library_names_spec="" 7749 7750# The coded name of the library, if different from the real name. 7751soname_spec="" 7752 7753# Commands used to build and install an old-style archive. 7754RANLIB="ranlib" 7755old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib" 7756old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib" 7757old_postuninstall_cmds="" 7758 7759# Create an old-style archive from a shared archive. 7760old_archive_from_new_cmds="" 7761 7762# Create a temporary old-style archive to link instead of a shared archive. 7763old_archive_from_expsyms_cmds="" 7764 7765# Commands used to build and install a shared archive. 7766archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib" 7767archive_expsym_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib" 7768postinstall_cmds="" 7769postuninstall_cmds="" 7770 7771# Commands used to build a loadable module (assumed same as above if empty) 7772module_cmds="" 7773module_expsym_cmds="" 7774 7775# Commands to strip libraries. 7776old_striplib="strip --strip-debug" 7777striplib="strip --strip-unneeded" 7778 7779# Dependencies to place before the objects being linked to create a 7780# shared library. 7781predep_objects=`echo "" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"` 7782 7783# Dependencies to place after the objects being linked to create a 7784# shared library. 7785postdep_objects=`echo "" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"` 7786 7787# Dependencies to place before the objects being linked to create a 7788# shared library. 7789predeps="" 7790 7791# Dependencies to place after the objects being linked to create a 7792# shared library. 7793postdeps="" 7794 7795# The library search path used internally by the compiler when linking 7796# a shared library. 7797compiler_lib_search_path=`echo "" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"` 7798 7799# Method to check whether dependent libraries are shared objects. 7800deplibs_check_method="unknown" 7801 7802# Command to use when deplibs_check_method == file_magic. 7803file_magic_cmd="\$MAGIC_CMD" 7804 7805# Flag that allows shared libraries with undefined symbols to be built. 7806allow_undefined_flag="" 7807 7808# Flag that forces no undefined symbols. 7809no_undefined_flag="" 7810 7811# Commands used to finish a libtool library installation in a directory. 7812finish_cmds="" 7813 7814# Same as above, but a single script fragment to be evaled but not shown. 7815finish_eval="" 7816 7817# Take the output of nm and produce a listing of raw symbols and C names. 7818global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'" 7819 7820# Transform the output of nm in a proper C declaration 7821global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'" 7822 7823# Transform the output of nm in a C name address pair 7824global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'" 7825 7826# This is the shared library runtime path variable. 7827runpath_var=LD_RUN_PATH 7828 7829# This is the shared library path variable. 7830shlibpath_var= 7831 7832# Is shlibpath searched before the hard-coded library search path? 7833shlibpath_overrides_runpath=unknown 7834 7835# How to hardcode a shared library path into an executable. 7836hardcode_action=immediate 7837 7838# Whether we should hardcode library paths into libraries. 7839hardcode_into_libs=no 7840 7841# Flag to hardcode $libdir into a binary during linking. 7842# This must work even if $libdir does not exist. 7843hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir" 7844 7845# If ld is used when linking, flag to hardcode $libdir into 7846# a binary during linking. This must work even if $libdir does 7847# not exist. 7848hardcode_libdir_flag_spec_ld="" 7849 7850# Whether we need a single -rpath flag with a separated argument. 7851hardcode_libdir_separator="" 7852 7853# Set to yes if using DIR/libNAME during linking hardcodes DIR into the 7854# resulting binary. 7855hardcode_direct=no 7856 7857# Set to yes if using the -LDIR flag during linking hardcodes DIR into the 7858# resulting binary. 7859hardcode_minus_L=no 7860 7861# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into 7862# the resulting binary. 7863hardcode_shlibpath_var=unsupported 7864 7865# Set to yes if building a shared library automatically hardcodes DIR into the library 7866# and all subsequent libraries and executables linked against it. 7867hardcode_automatic=no 7868 7869# Variables whose values should be saved in libtool wrapper scripts and 7870# restored at relink time. 7871variables_saved_for_relink="PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" 7872 7873# Whether libtool must link a program against all its dependency libraries. 7874link_all_deplibs=unknown 7875 7876# Compile-time system search path for libraries 7877sys_lib_search_path_spec=`echo " /usr/lib/gcc/i386-redhat-linux/4.1.1/ /usr/lib/gcc/i386-redhat-linux/4.1.1/ /usr/lib/gcc/i386-redhat-linux/4.1.1/../../../../i386-redhat-linux/lib/i386-redhat-linux/4.1.1/ /usr/lib/gcc/i386-redhat-linux/4.1.1/../../../../i386-redhat-linux/lib/ /usr/lib/gcc/i386-redhat-linux/4.1.1/../../../i386-redhat-linux/4.1.1/ /usr/lib/gcc/i386-redhat-linux/4.1.1/../../../ /lib/i386-redhat-linux/4.1.1/ /lib/ /usr/lib/i386-redhat-linux/4.1.1/ /usr/lib/" | $SED -e "s@${gcc_dir}@\${gcc_dir}@g;s@${gcc_ver}@\${gcc_ver}@g"` 7878 7879# Run-time system search path for libraries 7880sys_lib_dlsearch_path_spec="/lib /usr/lib" 7881 7882# Fix the shell variable $srcfile for the compiler. 7883fix_srcfile_path="" 7884 7885# Set to yes if exported symbols are required. 7886always_export_symbols=no 7887 7888# The commands to list exported symbols. 7889export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols" 7890 7891# The commands to extract the exported symbol list from a shared archive. 7892extract_expsyms_cmds="" 7893 7894# Symbols that should not be listed in the preloaded symbols. 7895exclude_expsyms="_GLOBAL_OFFSET_TABLE_" 7896 7897# Symbols that must always be exported. 7898include_expsyms="" 7899 7900# ### END LIBTOOL TAG CONFIG: F77 7901 7902