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