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