Changeset 3199 for trunk/psLib/ltmain.sh
- Timestamp:
- Feb 11, 2005, 1:55:58 PM (21 years ago)
- Location:
- trunk/psLib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib
- Property svn:ignore
-
old new 3 3 lib 4 4 man 5 include 5 6 pslib.kdevelop.* 6 7 docs
-
- Property svn:ignore
-
trunk/psLib/ltmain.sh
r3123 r3199 2 2 # NOTE: Changing this file will not affect anything until you rerun configure. 3 3 # 4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003 , 20044 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003 5 5 # Free Software Foundation, Inc. 6 6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 … … 25 25 # the same distribution terms that you use for the rest of that program. 26 26 27 basename="s,^.*/,,g"28 29 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh30 # is ksh but when the shell is invoked as "sh" and the current value of31 # the _XPG environment variable is not equal to 1 (one), the special32 # positional parameter $0, within a function call, is the name of the33 # function.34 progpath="$0"35 36 # The name of this program:37 progname=`echo "$progpath" | $SED $basename`38 modename="$progname"39 40 # Global variables:41 EXIT_SUCCESS=042 EXIT_FAILURE=143 44 PROGRAM=ltmain.sh45 PACKAGE=libtool46 VERSION=1.5.847 TIMESTAMP=" (1.1220.2.118 2004/08/07 12:24:38)"48 49 # See if we are running on zsh, and set the options which allow our50 # commands through without removal of \ escapes.51 if test -n "${ZSH_VERSION+set}" ; then52 setopt NO_GLOB_SUBST53 fi54 55 27 # Check that we have a working $echo. 56 28 if test "X$1" = X--no-reexec; then … … 65 37 else 66 38 # Restart under the correct shell, and then maybe $echo will work. 67 exec $SHELL "$ progpath" --no-reexec ${1+"$@"}39 exec $SHELL "$0" --no-reexec ${1+"$@"} 68 40 fi 69 41 … … 74 46 $* 75 47 EOF 76 exit $EXIT_SUCCESS48 exit 0 77 49 fi 50 51 # The name of this program. 52 progname=`$echo "$0" | ${SED} 's%^.*/%%'` 53 modename="$progname" 54 55 # Constants. 56 PROGRAM=ltmain.sh 57 PACKAGE=libtool 58 VERSION=1.5 59 TIMESTAMP=" (1.1220 2003/04/05 19:32:58)" 78 60 79 61 default_mode= … … 89 71 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' 90 72 # test EBCDIC or ASCII 91 case `echo A| tr A '\301'` in92 A) # EBCDIC based system73 case `echo A|od -x` in 74 *[Cc]1*) # EBCDIC based system 93 75 SP2NL="tr '\100' '\n'" 94 76 NL2SP="tr '\r\n' '\100\100'" … … 113 95 114 96 # Make sure IFS has a sensible default 115 : ${IFS=" 116 "} 97 : ${IFS=" "} 117 98 118 99 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then 119 100 $echo "$modename: not configured to build any kind of library" 1>&2 120 101 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 121 exit $EXIT_FAILURE102 exit 1 122 103 fi 123 104 … … 138 119 # This seems to be the best place for them 139 120 140 # func_win32_libid arg141 # return the library type of file 'arg'142 #143 121 # Need a lot of goo to handle *both* DLLs and import libs 144 122 # Has to be a shell function in order to 'eat' the argument 145 123 # that is supplied when $file_magic_command is called. 146 func_win32_libid () {124 win32_libid () { 147 125 win32_libid_type="unknown" 148 126 win32_fileres=`file -L $1 2>/dev/null` … … 153 131 *ar\ archive*) # could be an import, or static 154 132 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ 155 $EGREP -e'file format pe-i386(.*architecture: i386)?' >/dev/null ; then133 grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then 156 134 win32_nmres=`eval $NM -f posix -A $1 | \ 157 135 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'` … … 163 141 fi 164 142 ;; 165 *DLL*) 143 *DLL*) 166 144 win32_libid_type="x86 DLL" 167 145 ;; … … 177 155 } 178 156 179 180 # func_infer_tag arg181 # Infer tagged configuration to use if any are available and182 # if one wasn't chosen via the "--tag" command line option.183 # Only attempt this if the compiler in the base compile184 # command doesn't match the default compiler.185 # arg is usually of the form 'gcc ...'186 func_infer_tag () {187 if test -n "$available_tags" && test -z "$tagname"; then188 CC_quoted=189 for arg in $CC; do190 case $arg in191 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")192 arg="\"$arg\""193 ;;194 esac195 CC_quoted="$CC_quoted $arg"196 done197 case $@ in198 # Blanks in the command may have been stripped by the calling shell,199 # but not from the CC environment variable when configure was run.200 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;201 # Blanks at the start of $base_compile will cause this to fail202 # if we don't check for them as well.203 *)204 for z in $available_tags; do205 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then206 # Evaluate the configuration.207 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"208 CC_quoted=209 for arg in $CC; do210 # Double-quote args containing other shell metacharacters.211 case $arg in212 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")213 arg="\"$arg\""214 ;;215 esac216 CC_quoted="$CC_quoted $arg"217 done218 case "$@ " in219 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)220 # The compiler in the base compile command matches221 # the one in the tagged configuration.222 # Assume this is the tagged configuration we want.223 tagname=$z224 break225 ;;226 esac227 fi228 done229 # If $tagname still isn't set, then no tagged configuration230 # was found and let the user know that the "--tag" command231 # line option must be used.232 if test -z "$tagname"; then233 $echo "$modename: unable to infer tagged configuration"234 $echo "$modename: specify a tag with \`--tag'" 1>&2235 exit $EXIT_FAILURE236 # else237 # $echo "$modename: using $tagname tagged configuration"238 fi239 ;;240 esac241 fi242 }243 244 245 # func_extract_archives gentop oldlib ...246 func_extract_archives () {247 my_gentop="$1"; shift248 my_oldlibs=${1+"$@"}249 my_oldobjs=""250 my_xlib=""251 my_xabs=""252 my_xdir=""253 my_status=""254 255 $show "${rm}r $my_gentop"256 $run ${rm}r "$my_gentop"257 $show "$mkdir $my_gentop"258 $run $mkdir "$my_gentop"259 my_status=$?260 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then261 exit $my_status262 fi263 264 for my_xlib in $my_oldlibs; do265 # Extract the objects.266 case $my_xlib in267 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;268 *) my_xabs=`pwd`"/$my_xlib" ;;269 esac270 my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`271 my_xdir="$my_gentop/$my_xlib"272 273 $show "${rm}r $my_xdir"274 $run ${rm}r "$my_xdir"275 $show "$mkdir $my_xdir"276 $run $mkdir "$my_xdir"277 status=$?278 if test "$status" -ne 0 && test ! -d "$my_xdir"; then279 exit $status280 fi281 case $host in282 *-darwin*)283 $show "Extracting $my_xabs"284 # Do not bother doing anything if just a dry run285 if test -z "$run"; then286 darwin_orig_dir=`pwd`287 cd $my_xdir || exit $?288 darwin_archive=$my_xabs289 darwin_curdir=`pwd`290 darwin_base_archive=`basename $darwin_archive`291 darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`292 if test -n "$darwin_arches"; then293 darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`294 darwin_arch=295 $show "$darwin_base_archive has multiple architectures $darwin_arches"296 for darwin_arch in $darwin_arches ; do297 mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"298 lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"299 # Remove the table of contents from the thin files.300 $AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF 2>/dev/null || true301 $AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF\ SORTED 2>/dev/null || true302 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"303 $AR -xo "${darwin_base_archive}"304 rm "${darwin_base_archive}"305 cd "$darwin_curdir"306 done # $darwin_arches307 ## Okay now we have a bunch of thin objects, gotta fatten them up :)308 darwin_filelist=`find unfat-$$ -type f | xargs basename | sort -u | $NL2SP`309 darwin_file=310 darwin_files=311 for darwin_file in $darwin_filelist; do312 darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`313 lipo -create -output "$darwin_file" $darwin_files314 done # $darwin_filelist315 rm -rf unfat-$$316 cd "$darwin_orig_dir"317 else318 cd $darwin_orig_dir319 (cd $my_xdir && $AR x $my_xabs) || exit $?320 fi # $darwin_arches321 fi # $run322 ;;323 *)324 # We will extract separately just the conflicting names and we will325 # no longer touch any unique names. It is faster to leave these326 # extract automatically by $AR in one run.327 $show "(cd $my_xdir && $AR x $my_xabs)"328 $run eval "(cd \$my_xdir && $AR x \$my_xabs)" || exit $?329 if ($AR t "$my_xabs" | sort | sort -uc >/dev/null 2>&1); then330 :331 else332 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2333 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2334 $AR t "$my_xabs" | sort | uniq -cd | while read -r count name335 do336 i=1337 while test "$i" -le "$count"338 do339 # Put our $i before any first dot (extension)340 # Never overwrite any file341 name_to="$name"342 while test "X$name_to" = "X$name" || test -f "$my_xdir/$name_to"343 do344 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`345 done346 $show "(cd $my_xdir && $AR xN $i $my_xabs '$name' && $mv '$name' '$name_to')"347 $run eval "(cd \$my_xdir && $AR xN $i \$my_xabs '$name' && $mv '$name' '$name_to')" || exit $?348 i=`expr $i + 1`349 done350 done351 fi352 ;;353 esac354 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`355 done356 357 func_extract_archives_result="$my_oldobjs"358 }359 157 # End of Shell function definitions 360 158 ##################################### 361 362 # Darwin sucks363 eval std_shrext=\"$shrext_cmds\"364 159 365 160 # Parse our command line options once, thoroughly. … … 382 177 tag) 383 178 tagname="$arg" 384 preserve_args="${preserve_args}=$arg"385 179 386 180 # Check whether tagname contains only valid characters … … 388 182 *[!-_A-Za-z0-9,/]*) 389 183 $echo "$progname: invalid tag name: $tagname" 1>&2 390 exit $EXIT_FAILURE184 exit 1 391 185 ;; 392 186 esac … … 398 192 ;; 399 193 *) 400 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$ progpath" > /dev/null; then194 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then 401 195 taglist="$taglist $tagname" 402 196 # Evaluate the configuration. 403 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $ progpath`"197 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`" 404 198 else 405 199 $echo "$progname: ignoring unknown tag $tagname" 1>&2 … … 430 224 $echo "This is free software; see the source for copying conditions. There is NO" 431 225 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 432 exit $EXIT_SUCCESS226 exit 0 433 227 ;; 434 228 435 229 --config) 436 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $ progpath230 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 437 231 # Now print the configurations for the tags. 438 232 for tagname in $taglist; do 439 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$ progpath"233 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0" 440 234 done 441 exit $EXIT_SUCCESS235 exit 0 442 236 ;; 443 237 … … 445 239 $echo "$progname: enabling shell trace mode" 446 240 set -x 447 preserve_args="$preserve_args $arg"448 241 ;; 449 242 … … 464 257 $echo "disable static libraries" 465 258 fi 466 exit $EXIT_SUCCESS259 exit 0 467 260 ;; 468 261 … … 476 269 --quiet | --silent) 477 270 show=: 478 preserve_args="$preserve_args $arg"479 271 ;; 480 272 … … 484 276 shift 485 277 prev=tag 486 preserve_args="$preserve_args --tag"487 278 ;; 488 279 … … 495 286 $echo "$modename: unrecognized option \`$arg'" 1>&2 496 287 $echo "$help" 1>&2 497 exit $EXIT_FAILURE288 exit 1 498 289 ;; 499 290 … … 508 299 $echo "$modename: option \`$prevopt' requires an argument" 1>&2 509 300 $echo "$help" 1>&2 510 exit $EXIT_FAILURE301 exit 1 511 302 fi 512 303 … … 517 308 518 309 if test -z "$show_help"; then 310 archargs= 311 case $host in 312 *-*-darwin*) 313 # For darwin, separate arch arguments and apply them to all compile/link 314 # commands 315 doarch= 316 for arg; do 317 if test -n "$doarch"; then 318 archargs="$archargs -arch $arg" 319 doarch= 320 continue 321 fi 322 case $arg in 323 -arch) doarch=y;; 324 esac 325 done 326 esac 519 327 520 328 # Infer the operation mode. … … 564 372 $echo "$modename: unrecognized option \`-dlopen'" 1>&2 565 373 $echo "$help" 1>&2 566 exit $EXIT_FAILURE374 exit 1 567 375 fi 568 376 … … 579 387 base_compile= 580 388 srcfile="$nonopt" # always keep a non-empty value in "srcfile" 581 suppress_opt=yes582 389 suppress_output= 583 390 arg_mode=normal 584 391 libobj= 585 later=586 392 587 393 for arg … … 606 412 if test -n "$libobj" ; then 607 413 $echo "$modename: you cannot specify \`-o' more than once" 1>&2 608 exit $EXIT_FAILURE414 exit 1 609 415 fi 610 416 arg_mode=target … … 612 418 ;; 613 419 614 -static | -prefer-pic | -prefer-non-pic)615 later="$later $arg"420 -static) 421 build_old_libs=yes 616 422 continue 617 423 ;; 618 424 619 -no-suppress) 620 suppress_opt=no 425 -prefer-pic) 426 pic_mode=yes 427 continue 428 ;; 429 430 -prefer-non-pic) 431 pic_mode=no 621 432 continue 622 433 ;; … … 631 442 lastarg= 632 443 save_ifs="$IFS"; IFS=',' 633 for arg in $args; do444 for arg in $args; do 634 445 IFS="$save_ifs" 635 446 … … 681 492 arg) 682 493 $echo "$modename: you must specify an argument for -Xcompile" 683 exit $EXIT_FAILURE494 exit 1 684 495 ;; 685 496 target) 686 497 $echo "$modename: you must specify a target with \`-o'" 1>&2 687 exit $EXIT_FAILURE498 exit 1 688 499 ;; 689 500 *) … … 718 529 *) 719 530 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 720 exit $EXIT_FAILURE531 exit 1 721 532 ;; 722 533 esac 723 534 724 func_infer_tag $base_compile 725 726 for arg in $later; do 727 case $arg in 728 -static) 729 build_old_libs=yes 730 continue 731 ;; 732 733 -prefer-pic) 734 pic_mode=yes 735 continue 736 ;; 737 738 -prefer-non-pic) 739 pic_mode=no 740 continue 535 # Infer tagged configuration to use if any are available and 536 # if one wasn't chosen via the "--tag" command line option. 537 # Only attempt this if the compiler in the base compile 538 # command doesn't match the default compiler. 539 if test -n "$available_tags" && test -z "$tagname"; then 540 case $base_compile in 541 # Blanks in the command may have been stripped by the calling shell, 542 # but not from the CC environment variable when configure was run. 543 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;; 544 # Blanks at the start of $base_compile will cause this to fail 545 # if we don't check for them as well. 546 *) 547 for z in $available_tags; do 548 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then 549 # Evaluate the configuration. 550 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`" 551 case "$base_compile " in 552 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) 553 # The compiler in the base compile command matches 554 # the one in the tagged configuration. 555 # Assume this is the tagged configuration we want. 556 tagname=$z 557 break 558 ;; 559 esac 560 fi 561 done 562 # If $tagname still isn't set, then no tagged configuration 563 # was found and let the user know that the "--tag" command 564 # line option must be used. 565 if test -z "$tagname"; then 566 $echo "$modename: unable to infer tagged configuration" 567 $echo "$modename: specify a tag with \`--tag'" 1>&2 568 exit 1 569 # else 570 # $echo "$modename: using $tagname tagged configuration" 571 fi 741 572 ;; 742 573 esac 743 done574 fi 744 575 745 576 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` … … 755 586 $echo "$modename: you must specify a compilation command" 1>&2 756 587 $echo "$help" 1>&2 757 exit $EXIT_FAILURE588 exit 1 758 589 fi 759 590 … … 766 597 767 598 $run $rm $removelist 768 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15599 trap "$run $rm $removelist; exit 1" 1 2 15 769 600 770 601 # On Cygwin there's no "real" PIC flag so we must build both object types … … 785 616 lockfile="$output_obj.lock" 786 617 removelist="$removelist $output_obj $lockfile" 787 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15618 trap "$run $rm $removelist; exit 1" 1 2 15 788 619 else 789 620 output_obj= … … 795 626 # We use this script file to make the link, it avoids creating a new file 796 627 if test "$need_locks" = yes; then 797 until $run ln "$ progpath" "$lockfile" 2>/dev/null; do628 until $run ln "$0" "$lockfile" 2>/dev/null; do 798 629 $show "Waiting for $lockfile to be removed" 799 630 sleep 2 … … 813 644 814 645 $run $rm $removelist 815 exit $EXIT_FAILURE646 exit 1 816 647 fi 817 648 $echo $srcfile > "$lockfile" … … 868 699 else 869 700 test -n "$output_obj" && $run $rm $removelist 870 exit $EXIT_FAILURE701 exit 1 871 702 fi 872 703 … … 888 719 889 720 $run $rm $removelist 890 exit $EXIT_FAILURE721 exit 1 891 722 fi 892 723 … … 909 740 910 741 # Allow error messages only from the first compilation. 911 if test "$suppress_opt" = yes; then 912 suppress_output=' >/dev/null 2>&1' 913 fi 742 suppress_output=' >/dev/null 2>&1' 914 743 else 915 744 # No PIC object so indicate it doesn't exist in the libtool … … 940 769 else 941 770 $run $rm $removelist 942 exit $EXIT_FAILURE771 exit 1 943 772 fi 944 773 … … 960 789 961 790 $run $rm $removelist 962 exit $EXIT_FAILURE791 exit 1 963 792 fi 964 793 … … 998 827 fi 999 828 1000 exit $EXIT_SUCCESS829 exit 0 1001 830 ;; 1002 831 … … 1024 853 esac 1025 854 libtool_args="$nonopt" 1026 base_compile="$nonopt $@"855 base_compile="$nonopt" 1027 856 compile_command="$nonopt" 1028 857 finalize_command="$nonopt" … … 1056 885 objs= 1057 886 non_pic_objects= 1058 precious_files_regex=1059 887 prefer_static_libs=no 1060 888 preload=no … … 1070 898 vinfo_number=no 1071 899 1072 func_infer_tag $base_compile1073 1074 900 # We need to know -static, to get the right output filenames. 1075 901 for arg … … 1103 929 while test "$#" -gt 0; do 1104 930 arg="$1" 931 base_compile="$base_compile $arg" 1105 932 shift 1106 933 case $arg in … … 1166 993 if test ! -f "$arg"; then 1167 994 $echo "$modename: symbol file \`$arg' does not exist" 1168 exit $EXIT_FAILURE995 exit 1 1169 996 fi 1170 997 prev= … … 1178 1005 inst_prefix) 1179 1006 inst_prefix_dir="$arg" 1180 prev=1181 continue1182 ;;1183 precious_regex)1184 precious_files_regex="$arg"1185 1007 prev= 1186 1008 continue … … 1218 1040 test "$non_pic_object" = none; then 1219 1041 $echo "$modename: cannot find name of object for \`$arg'" 1>&2 1220 exit $EXIT_FAILURE1042 exit 1 1221 1043 fi 1222 1044 … … 1271 1093 if test -z "$run"; then 1272 1094 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 1273 exit $EXIT_FAILURE1095 exit 1 1274 1096 else 1275 1097 # Dry-run case. … … 1292 1114 else 1293 1115 $echo "$modename: link input file \`$save_arg' does not exist" 1294 exit $EXIT_FAILURE1116 exit 1 1295 1117 fi 1296 1118 arg=$save_arg … … 1304 1126 *) 1305 1127 $echo "$modename: only absolute run-paths are allowed" 1>&2 1306 exit $EXIT_FAILURE1128 exit 1 1307 1129 ;; 1308 1130 esac … … 1344 1166 continue 1345 1167 ;; 1346 shrext)1347 shrext_cmds="$arg"1348 prev=1349 continue1350 ;;1351 1168 *) 1352 1169 eval "$prev=\"\$arg\"" … … 1397 1214 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then 1398 1215 $echo "$modename: more than one -exported-symbols argument is not allowed" 1399 exit $EXIT_FAILURE1216 exit 1 1400 1217 fi 1401 1218 if test "X$arg" = "X-export-symbols"; then … … 1433 1250 if test -z "$absdir"; then 1434 1251 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 1435 exit $EXIT_FAILURE1252 exit 1 1436 1253 fi 1437 1254 dir="$absdir" … … 1488 1305 ;; 1489 1306 1490 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)1491 deplibs="$deplibs $arg"1492 continue1493 ;;1494 1495 1307 -module) 1496 1308 module=yes … … 1557 1369 -o) prev=output ;; 1558 1370 1559 -precious-files-regex)1560 prev=precious_regex1561 continue1562 ;;1563 1564 1371 -release) 1565 1372 prev=release … … 1584 1391 *) 1585 1392 $echo "$modename: only absolute run-paths are allowed" 1>&2 1586 exit $EXIT_FAILURE1393 exit 1 1587 1394 ;; 1588 1395 esac … … 1707 1514 test "$non_pic_object" = none; then 1708 1515 $echo "$modename: cannot find name of object for \`$arg'" 1>&2 1709 exit $EXIT_FAILURE1516 exit 1 1710 1517 fi 1711 1518 … … 1760 1567 if test -z "$run"; then 1761 1568 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 1762 exit $EXIT_FAILURE1569 exit 1 1763 1570 else 1764 1571 # Dry-run case. … … 1827 1634 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 1828 1635 $echo "$help" 1>&2 1829 exit $EXIT_FAILURE 1636 exit 1 1637 fi 1638 1639 # Infer tagged configuration to use if any are available and 1640 # if one wasn't chosen via the "--tag" command line option. 1641 # Only attempt this if the compiler in the base link 1642 # command doesn't match the default compiler. 1643 if test -n "$available_tags" && test -z "$tagname"; then 1644 case $base_compile in 1645 # Blanks in the command may have been stripped by the calling shell, 1646 # but not from the CC environment variable when configure was run. 1647 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;; 1648 # Blanks at the start of $base_compile will cause this to fail 1649 # if we don't check for them as well. 1650 *) 1651 for z in $available_tags; do 1652 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then 1653 # Evaluate the configuration. 1654 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`" 1655 case $base_compile in 1656 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) 1657 # The compiler in $compile_command matches 1658 # the one in the tagged configuration. 1659 # Assume this is the tagged configuration we want. 1660 tagname=$z 1661 break 1662 ;; 1663 esac 1664 fi 1665 done 1666 # If $tagname still isn't set, then no tagged configuration 1667 # was found and let the user know that the "--tag" command 1668 # line option must be used. 1669 if test -z "$tagname"; then 1670 $echo "$modename: unable to infer tagged configuration" 1671 $echo "$modename: specify a tag with \`--tag'" 1>&2 1672 exit 1 1673 # else 1674 # $echo "$modename: using $tagname tagged configuration" 1675 fi 1676 ;; 1677 esac 1830 1678 fi 1831 1679 … … 1871 1719 $echo "$modename: you must specify an output file" 1>&2 1872 1720 $echo "$help" 1>&2 1873 exit $EXIT_FAILURE1721 exit 1 1874 1722 ;; 1875 1723 *.$libext) linkmode=oldlib ;; … … 1881 1729 case $host in 1882 1730 *cygwin* | *mingw* | *pw32*) 1883 # don't eliminate dupl ications in $postdeps and $predeps1731 # don't eliminate duplcations in $postdeps and $predeps 1884 1732 duplicate_compiler_generated_deps=yes 1885 1733 ;; … … 1934 1782 *) 1935 1783 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 1936 exit $EXIT_FAILURE1784 exit 1 1937 1785 ;; 1938 1786 esac … … 1972 1820 found=no 1973 1821 case $deplib in 1974 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)1975 if test "$linkmode,$pass" = "prog,link"; then1976 compile_deplibs="$deplib $compile_deplibs"1977 finalize_deplibs="$deplib $finalize_deplibs"1978 else1979 deplibs="$deplib $deplibs"1980 fi1981 continue1982 ;;1983 1822 -l*) 1984 1823 if test "$linkmode" != lib && test "$linkmode" != prog; then … … 1992 1831 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` 1993 1832 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do 1994 for search_ext in .la $std_shrext .so .a; do 1995 # Search the libtool library 1996 lib="$searchdir/lib${name}${search_ext}" 1997 if test -f "$lib"; then 1998 if test "$search_ext" = ".la"; then 1999 found=yes 2000 else 2001 found=no 2002 fi 2003 break 2 2004 fi 2005 done 1833 # Search the libtool library 1834 lib="$searchdir/lib${name}.la" 1835 if test -f "$lib"; then 1836 found=yes 1837 break 1838 fi 2006 1839 done 2007 1840 if test "$found" != yes; then … … 2068 1901 if test "$pass" = scan; then 2069 1902 deplibs="$deplib $deplibs" 1903 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` 2070 1904 else 2071 1905 compile_deplibs="$deplib $compile_deplibs" 2072 1906 finalize_deplibs="$deplib $finalize_deplibs" 2073 1907 fi 2074 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`2075 1908 ;; 2076 1909 *) … … 2100 1933 case $linkmode in 2101 1934 lib) 2102 valid_a_lib=no 2103 case $deplibs_check_method in 2104 match_pattern*) 2105 set dummy $deplibs_check_method 2106 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 2107 if eval $echo \"$deplib\" 2>/dev/null \ 2108 | $SED 10q \ 2109 | $EGREP "$match_pattern_regex" > /dev/null; then 2110 valid_a_lib=yes 2111 fi 2112 ;; 2113 pass_all) 2114 valid_a_lib=yes 2115 ;; 2116 esac 2117 if test "$valid_a_lib" != yes; then 1935 if test "$deplibs_check_method" != pass_all; then 2118 1936 $echo 2119 1937 $echo "*** Warning: Trying to link with static lib archive $deplib." … … 2166 1984 else 2167 1985 $echo "$modename: cannot find the library \`$lib'" 1>&2 2168 exit $EXIT_FAILURE1986 exit 1 2169 1987 fi 2170 1988 … … 2173 1991 else 2174 1992 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 2175 exit $EXIT_FAILURE1993 exit 1 2176 1994 fi 2177 1995 … … 2209 2027 if test -z "$old_library"; then 2210 2028 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 2211 exit $EXIT_FAILURE2029 exit 1 2212 2030 fi 2213 2031 # It is a libtool convenience library, so add in its objects. … … 2226 2044 elif test "$linkmode" != prog && test "$linkmode" != lib; then 2227 2045 $echo "$modename: \`$lib' is not a convenience library" 1>&2 2228 exit $EXIT_FAILURE2046 exit 1 2229 2047 fi 2230 2048 continue 2231 2049 fi # $pass = conv 2232 2050 2233 2051 2234 2052 # Get the name of the library we link against. 2235 2053 linklib= … … 2239 2057 if test -z "$linklib"; then 2240 2058 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 2241 exit $EXIT_FAILURE2059 exit 1 2242 2060 fi 2243 2061 … … 2246 2064 if test -z "$libdir"; then 2247 2065 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 2248 exit $EXIT_FAILURE 2249 fi 2250 if test -z "$dlname" || 2251 test "$dlopen_support" != yes || 2252 test "$build_libtool_libs" = no; then 2066 exit 1 2067 fi 2068 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then 2253 2069 # If there is no dlname, no dlopen support or we're linking 2254 2070 # statically, we need to preload. We also need to preload any … … 2288 2104 fi 2289 2105 else 2290 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then 2291 dir="$ladir" 2292 absdir="$abs_ladir" 2293 # Remove this search path later 2294 notinst_path="$notinst_path $abs_ladir" 2295 else 2296 dir="$ladir/$objdir" 2297 absdir="$abs_ladir/$objdir" 2298 # Remove this search path later 2299 notinst_path="$notinst_path $abs_ladir" 2300 fi 2106 dir="$ladir/$objdir" 2107 absdir="$abs_ladir/$objdir" 2108 # Remove this search path later 2109 notinst_path="$notinst_path $abs_ladir" 2301 2110 fi # $installed = yes 2302 2111 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` … … 2306 2115 if test -z "$libdir"; then 2307 2116 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 2308 exit $EXIT_FAILURE2117 exit 1 2309 2118 fi 2310 2119 # Prefer using a static library (so that no silly _DYNAMIC symbols … … 2333 2142 fi 2334 2143 2335 2144 2336 2145 if test "$linkmode" = prog && test "$pass" != link; then 2337 2146 newlib_search_path="$newlib_search_path $ladir" … … 2420 2229 fi 2421 2230 # This is a shared library 2422 2423 # Warn about portability, can't link against -module's on 2424 # some systems (darwin) 2425 if test "$shouldnotlink" = yes && test "$pass" = link ; then 2231 2232 # Warn about portability, can't link against -module's on some systems (darwin) 2233 if test "$shouldnotlink" = yes && test "$pass" = link ; then 2426 2234 $echo 2427 2235 if test "$linkmode" = prog; then … … 2430 2238 $echo "*** Warning: Linking the shared library $output against the loadable module" 2431 2239 fi 2432 $echo "*** $linklib is not portable!" 2433 fi 2240 $echo "*** $linklib is not portable!" 2241 fi 2434 2242 if test "$linkmode" = lib && 2435 2243 test "$hardcode_into_libs" = yes; then … … 2488 2296 else 2489 2297 $show "extracting exported symbol list from \`$soname'" 2490 save_ifs="$IFS"; IFS= '~'2491 cmds=$extract_expsyms_cmds2298 save_ifs="$IFS"; IFS=$_S_ 2299 eval cmds=\"$extract_expsyms_cmds\" 2492 2300 for cmd in $cmds; do 2493 2301 IFS="$save_ifs" 2494 eval cmd=\"$cmd\"2495 2302 $show "$cmd" 2496 2303 $run eval "$cmd" || exit $? … … 2502 2309 if test -f "$output_objdir/$newlib"; then :; else 2503 2310 $show "generating import library for \`$soname'" 2504 save_ifs="$IFS"; IFS= '~'2505 cmds=$old_archive_from_expsyms_cmds2311 save_ifs="$IFS"; IFS=$_S_ 2312 eval cmds=\"$old_archive_from_expsyms_cmds\" 2506 2313 for cmd in $cmds; do 2507 2314 IFS="$save_ifs" 2508 eval cmd=\"$cmd\"2509 2315 $show "$cmd" 2510 2316 $run eval "$cmd" || exit $? … … 2529 2335 *-*-sco3.2v5* ) add_dir="-L$dir" ;; 2530 2336 *-*-darwin* ) 2531 # if the lib is a module then we can not link against 2532 # i t, someone is ignoring the new warnings I added2533 if /usr/bin/file -L $add 2> /dev/null | $EGREP"bundle" >/dev/null ; then2337 # if the lib is a module then we can not link against it, someone 2338 # is ignoring the new warnings I added 2339 if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then 2534 2340 $echo "** Warning, lib $linklib is a module, not a shared library" 2535 2341 if test -z "$old_library" ; then … … 2539 2345 else 2540 2346 add="$dir/$old_library" 2541 fi 2347 fi 2542 2348 fi 2543 2349 esac … … 2564 2370 case "$libdir" in 2565 2371 [\\/]*) 2566 add_dir=" $add_dir -L$inst_prefix_dir$libdir"2372 add_dir="-L$inst_prefix_dir$libdir $add_dir" 2567 2373 ;; 2568 2374 esac … … 2581 2387 if test "$lib_linked" != yes; then 2582 2388 $echo "$modename: configuration error: unsupported hardcode properties" 2583 exit $EXIT_FAILURE2389 exit 1 2584 2390 fi 2585 2391 … … 2624 2430 add="-l$name" 2625 2431 elif test "$hardcode_automatic" = yes; then 2626 if test -n "$inst_prefix_dir" && 2627 test -f "$inst_prefix_dir$libdir/$linklib" ; then 2432 if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then 2628 2433 add="$inst_prefix_dir$libdir/$linklib" 2629 2434 else … … 2637 2442 case "$libdir" in 2638 2443 [\\/]*) 2639 add_dir=" $add_dir -L$inst_prefix_dir$libdir"2444 add_dir="-L$inst_prefix_dir$libdir $add_dir" 2640 2445 ;; 2641 2446 esac … … 2705 2510 if test "$linkmode" = lib; then 2706 2511 if test -n "$dependency_libs" && 2707 { test "$hardcode_into_libs" != yes || 2708 test "$build_old_libs" = yes || 2512 { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || 2709 2513 test "$link_static" = yes; }; then 2710 2514 # Extract -R from dependency_libs … … 2763 2567 if test -z "$libdir"; then 2764 2568 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 2765 exit $EXIT_FAILURE2569 exit 1 2766 2570 fi 2767 2571 if test "$absdir" != "$libdir"; then … … 2773 2577 case $host in 2774 2578 *-*-darwin*) 2775 # we do not want to link against static libs, 2776 # but need to link against shared 2579 # we do not want to link against static libs, but need to link against shared 2777 2580 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` 2778 2581 if test -n "$deplibrary_names" ; then … … 2782 2585 if test -f "$path/$depdepl" ; then 2783 2586 depdepl="$path/$depdepl" 2784 fi 2785 # do not add paths which are already there 2786 case " $newlib_search_path " in 2787 *" $path "*) ;; 2788 *) newlib_search_path="$newlib_search_path $path";; 2789 esac 2587 fi 2588 newlib_search_path="$newlib_search_path $path" 2589 path="" 2790 2590 fi 2791 path=""2792 2591 ;; 2793 2592 *) 2794 path="-L$path" 2795 ;; 2796 esac 2593 path="-L$path" 2797 2594 ;; 2798 -l*) 2595 esac 2596 2597 ;; 2598 -l*) 2799 2599 case $host in 2800 2600 *-*-darwin*) 2801 # Again, we only want to link against shared libraries2802 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`2803 for tmp in $newlib_search_path ; do2804 if test -f "$tmp/lib$tmp_libs.dylib" ; then2805 eval depdepl="$tmp/lib$tmp_libs.dylib"2806 break2807 fi2808 done2809 path=""2601 # Again, we only want to link against shared libraries 2602 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` 2603 for tmp in $newlib_search_path ; do 2604 if test -f "$tmp/lib$tmp_libs.dylib" ; then 2605 eval depdepl="$tmp/lib$tmp_libs.dylib" 2606 break 2607 fi 2608 done 2609 path="" 2810 2610 ;; 2811 2611 *) continue ;; 2812 esac 2612 esac 2813 2613 ;; 2814 2614 *) continue ;; … … 2816 2616 case " $deplibs " in 2817 2617 *" $depdepl "*) ;; 2818 *) deplibs="$dep depl $deplibs" ;;2819 esac 2618 *) deplibs="$deplibs $depdepl" ;; 2619 esac 2820 2620 case " $deplibs " in 2821 2621 *" $path "*) ;; … … 2907 2707 done # for var 2908 2708 fi 2909 # Last step: remove runtime libs from dependency_libs 2910 # (they stay in deplibs) 2709 # Last step: remove runtime libs from dependency_libs (they stay in deplibs) 2911 2710 tmp_libs= 2912 2711 for i in $dependency_libs ; do … … 2968 2767 lib*) 2969 2768 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` 2970 eval shared_ext=\"$shrext _cmds\"2769 eval shared_ext=\"$shrext\" 2971 2770 eval libname=\"$libname_spec\" 2972 2771 ;; … … 2975 2774 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 2976 2775 $echo "$help" 1>&2 2977 exit $EXIT_FAILURE2776 exit 1 2978 2777 fi 2979 2778 if test "$need_lib_prefix" != no; then 2980 2779 # Add the "lib" prefix for modules if required 2981 2780 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` 2982 eval shared_ext=\"$shrext _cmds\"2781 eval shared_ext=\"$shrext\" 2983 2782 eval libname=\"$libname_spec\" 2984 2783 else … … 2991 2790 if test "$deplibs_check_method" != pass_all; then 2992 2791 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 2993 exit $EXIT_FAILURE2792 exit 1 2994 2793 else 2995 2794 $echo … … 3039 2838 $echo "$modename: too many parameters to \`-version-info'" 1>&2 3040 2839 $echo "$help" 1>&2 3041 exit $EXIT_FAILURE2840 exit 1 3042 2841 fi 3043 2842 … … 3045 2844 # this retains compatibility with .la files and attempts 3046 2845 # to make the code below a bit more comprehensible 3047 2846 3048 2847 case $vinfo_number in 3049 2848 yes) … … 3089 2888 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 3090 2889 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 3091 exit $EXIT_FAILURE2890 exit 1 3092 2891 ;; 3093 2892 esac … … 3098 2897 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 3099 2898 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 3100 exit $EXIT_FAILURE2899 exit 1 3101 2900 ;; 3102 2901 esac … … 3107 2906 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 3108 2907 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 3109 exit $EXIT_FAILURE2908 exit 1 3110 2909 ;; 3111 2910 esac … … 3114 2913 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 3115 2914 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 3116 exit $EXIT_FAILURE2915 exit 1 3117 2916 fi 3118 2917 … … 3131 2930 # Darwin ld doesn't like 0 for these options... 3132 2931 minor_current=`expr $current + 1` 3133 verstring=" ${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"2932 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" 3134 2933 ;; 3135 2934 … … 3203 3002 $echo "$modename: unknown library version type \`$version_type'" 1>&2 3204 3003 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 3205 exit $EXIT_FAILURE3004 exit 1 3206 3005 ;; 3207 3006 esac … … 3257 3056 ;; 3258 3057 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) 3259 if test "X$precious_files_regex" != "X"; then3260 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&13261 then3262 continue3263 fi3264 fi3265 3058 removelist="$removelist $p" 3266 3059 ;; … … 3383 3176 EOF 3384 3177 $rm conftest 3385 $LTCC -o conftest conftest.c $deplibs3178 $LTCC $archargs -o conftest conftest.c $deplibs 3386 3179 if test "$?" -eq 0 ; then 3387 3180 ldd_output=`ldd conftest` … … 3428 3221 if test "$name" != "" && test "$name" != "0"; then 3429 3222 $rm conftest 3430 $LTCC -o conftest conftest.c $i3223 $LTCC $archargs -o conftest conftest.c $i 3431 3224 # Did it work? 3432 3225 if test "$?" -eq 0 ; then … … 3742 3535 3743 3536 # Get the real and link names of the library. 3744 eval shared_ext=\"$shrext _cmds\"3537 eval shared_ext=\"$shrext\" 3745 3538 eval library_names=\"$library_names_spec\" 3746 3539 set dummy $library_names … … 3772 3565 export_symbols="$output_objdir/$libname.exp" 3773 3566 $run $rm $export_symbols 3774 cmds=$export_symbols_cmds3775 save_ifs="$IFS"; IFS= '~'3567 eval cmds=\"$export_symbols_cmds\" 3568 save_ifs="$IFS"; IFS=$_S_ 3776 3569 for cmd in $cmds; do 3777 3570 IFS="$save_ifs" 3778 eval cmd=\"$cmd\"3779 3571 if len=`expr "X$cmd" : ".*"` && 3780 3572 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then … … 3806 3598 case " $convenience " in 3807 3599 *" $test_deplib "*) ;; 3808 *) 3600 *) 3809 3601 tmp_deplibs="$tmp_deplibs $test_deplib" 3810 3602 ;; 3811 3603 esac 3812 3604 done 3813 deplibs="$tmp_deplibs" 3605 deplibs="$tmp_deplibs" 3814 3606 3815 3607 if test -n "$convenience"; then … … 3819 3611 else 3820 3612 gentop="$output_objdir/${outputname}x" 3613 $show "${rm}r $gentop" 3614 $run ${rm}r "$gentop" 3615 $show "$mkdir $gentop" 3616 $run $mkdir "$gentop" 3617 status=$? 3618 if test "$status" -ne 0 && test ! -d "$gentop"; then 3619 exit $status 3620 fi 3821 3621 generated="$generated $gentop" 3822 3622 3823 func_extract_archives $gentop $convenience 3824 libobjs="$libobjs $func_extract_archives_result" 3825 fi 3826 fi 3827 3623 for xlib in $convenience; do 3624 # Extract the objects. 3625 case $xlib in 3626 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; 3627 *) xabs=`pwd`"/$xlib" ;; 3628 esac 3629 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` 3630 xdir="$gentop/$xlib" 3631 3632 $show "${rm}r $xdir" 3633 $run ${rm}r "$xdir" 3634 $show "$mkdir $xdir" 3635 $run $mkdir "$xdir" 3636 status=$? 3637 if test "$status" -ne 0 && test ! -d "$xdir"; then 3638 exit $status 3639 fi 3640 case $host in 3641 *-*-darwin*) 3642 # ranlib-ed archives of fat binaries are converted to a fat xabs that 3643 # ar can't use. So we to split the fat xabs into non-fat ones to unpack. 3644 # We can't deal with duplicate names, since 'ar xN' and 'uniq -cd' don't work. 3645 d_archs=`lipo -info $xabs 2> /dev/null | grep '^Architectures' | sed 's/^.*: //'` 3646 if test -n "$d_archs"; then 3647 $echo "$modename: manually unpacking fat archive $xabs" 1>&2 3648 d_name=`basename $xabs` 3649 d_dir="/tmp/fat_ar.$$" 3650 d_files='' 3651 3652 for d_arch in $d_archs; do 3653 d_archdir="$d_dir/$d_arch" 3654 $show "$mkdir -p $d_archdir" 3655 $run $mkdir -p "$d_archdir" 3656 3657 $show "lipo -thin $d_arch $xabs -o $d_dir/$d_name" 3658 $run lipo -thin $d_arch "$xabs" -o "$d_dir/$d_name" 3659 3660 $show "(cd $d_archdir && $AR x $d_dir/$d_name)" 3661 $run eval "(cd \$d_archdir && \$AR x \$d_dir/\$d_name)" || exit $? 3662 3663 $show "${rm} $d_dir/$d_name" 3664 $run ${rm} "$d_dir/$d_name" 3665 done 3666 3667 # Can't deal with blanks in file names 3668 $run eval "d_files=\`find \$d_dir -type f | sed -e 's,.*/,,' -e '/ /d' | sort -u\`" || exit $? 3669 3670 for d_file in $d_files; do 3671 $run eval "d_f=\`find \$d_dir -name \$d_file -print\`" || exit $? 3672 $show "lipo -create $d_f -o $xdir/$d_file" 3673 $run eval "lipo -create \$d_f -o \"\$xdir/\$d_file\"" || exit $? 3674 done 3675 3676 $show "${rm}r $d_dir" 3677 $run ${rm}r "$d_dir" 3678 else 3679 $show "(cd $xdir && $AR x $xabs)" 3680 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? 3681 fi 3682 ;; 3683 *) 3684 # We will extract separately just the conflicting names and we will no 3685 # longer touch any unique names. It is faster to leave these extract 3686 # automatically by $AR in one run. 3687 $show "(cd $xdir && $AR x $xabs)" 3688 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? 3689 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then 3690 : 3691 else 3692 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 3693 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 3694 $AR t "$xabs" | sort | uniq -cd | while read -r count name 3695 do 3696 i=1 3697 while test "$i" -le "$count" 3698 do 3699 # Put our $i before any first dot (extension) 3700 # Never overwrite any file 3701 name_to="$name" 3702 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" 3703 do 3704 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` 3705 done 3706 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" 3707 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? 3708 i=`expr $i + 1` 3709 done 3710 done 3711 fi 3712 ;; 3713 esac 3714 3715 libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` 3716 done 3717 fi 3718 fi 3719 3828 3720 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then 3829 3721 eval flag=\"$thread_safe_flag_spec\" … … 3839 3731 if test "$module" = yes && test -n "$module_cmds" ; then 3840 3732 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then 3841 eval test_cmds=\"$module_expsym_cmds\" 3842 cmds=$module_expsym_cmds 3733 eval cmds=\"$module_expsym_cmds\" 3843 3734 else 3844 eval test_cmds=\"$module_cmds\" 3845 cmds=$module_cmds 3735 eval cmds=\"$module_cmds\" 3846 3736 fi 3847 3737 else 3848 3738 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then 3849 eval test_cmds=\"$archive_expsym_cmds\" 3850 cmds=$archive_expsym_cmds 3739 eval cmds=\"$archive_expsym_cmds\" 3851 3740 else 3852 eval test_cmds=\"$archive_cmds\" 3853 cmds=$archive_cmds 3854 fi 3855 fi 3856 3857 if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` && 3741 eval cmds=\"$archive_cmds\" 3742 fi 3743 fi 3744 3745 if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` && 3858 3746 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then 3859 3747 : … … 3901 3789 # All subsequent reloadable object files will link in 3902 3790 # the last one created. 3903 eval concat_cmds=\"\$concat_cmds ~$reload_cmds $objlist $last_robj\"3791 eval concat_cmds=\"\$concat_cmds${_S_}$reload_cmds $objlist $last_robj\" 3904 3792 fi 3905 3793 last_robj=$output_objdir/$save_output-${k}.$objext … … 3913 3801 # reloadable object file. All subsequent reloadable object 3914 3802 # files will link in the last one created. 3915 test -z "$concat_cmds" || concat_cmds=$concat_cmds ~3803 test -z "$concat_cmds" || concat_cmds=$concat_cmds${_S_} 3916 3804 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" 3917 3805 … … 3922 3810 libobjs=$output 3923 3811 # Append the command to create the export file. 3924 eval concat_cmds=\"\$concat_cmds ~$export_symbols_cmds\"3812 eval concat_cmds=\"\$concat_cmds${_S_}$export_symbols_cmds\" 3925 3813 fi 3926 3814 … … 3937 3825 3938 3826 # Loop through the commands generated above and execute them. 3939 save_ifs="$IFS"; IFS= '~'3827 save_ifs="$IFS"; IFS=$_S_ 3940 3828 for cmd in $concat_cmds; do 3941 3829 IFS="$save_ifs" … … 3956 3844 3957 3845 # Do each of the archive commands. 3958 if test "$module" = yes && test -n "$module_cmds" ; then 3959 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then 3960 cmds=$module_expsym_cmds 3961 else 3962 cmds=$module_cmds 3963 fi 3846 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then 3847 eval cmds=\"$archive_expsym_cmds\" 3964 3848 else 3965 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then 3966 cmds=$archive_expsym_cmds 3967 else 3968 cmds=$archive_cmds 3969 fi 3849 eval cmds=\"$archive_cmds\" 3970 3850 fi 3971 3851 3972 3852 # Append the command to remove the reloadable object files 3973 3853 # to the just-reset $cmds. 3974 eval cmds=\"\$cmds ~\$rm $delfiles\"3975 fi 3976 save_ifs="$IFS"; IFS= '~'3854 eval cmds=\"\$cmds${_S_}$rm $delfiles\" 3855 fi 3856 save_ifs="$IFS"; IFS=$_S_ 3977 3857 for cmd in $cmds; do 3978 3858 IFS="$save_ifs" 3979 eval cmd=\"$cmd\"3980 3859 $show "$cmd" 3981 3860 $run eval "$cmd" || exit $? … … 3986 3865 if test "$mode" = relink; then 3987 3866 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? 3988 exit $EXIT_SUCCESS3867 exit 0 3989 3868 fi 3990 3869 … … 4034 3913 if test -n "$objs$old_deplibs"; then 4035 3914 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 4036 exit $EXIT_FAILURE3915 exit 1 4037 3916 fi 4038 3917 libobj="$output" … … 4063 3942 else 4064 3943 gentop="$output_objdir/${obj}x" 3944 $show "${rm}r $gentop" 3945 $run ${rm}r "$gentop" 3946 $show "$mkdir $gentop" 3947 $run $mkdir "$gentop" 3948 status=$? 3949 if test "$status" -ne 0 && test ! -d "$gentop"; then 3950 exit $status 3951 fi 4065 3952 generated="$generated $gentop" 4066 3953 4067 func_extract_archives $gentop $convenience 4068 reload_conv_objs="$reload_objs $func_extract_archives_result" 3954 for xlib in $convenience; do 3955 # Extract the objects. 3956 case $xlib in 3957 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; 3958 *) xabs=`pwd`"/$xlib" ;; 3959 esac 3960 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` 3961 xdir="$gentop/$xlib" 3962 3963 $show "${rm}r $xdir" 3964 $run ${rm}r "$xdir" 3965 $show "$mkdir $xdir" 3966 $run $mkdir "$xdir" 3967 status=$? 3968 if test "$status" -ne 0 && test ! -d "$xdir"; then 3969 exit $status 3970 fi 3971 case $host in 3972 *-*-darwin*) 3973 # ranlib-ed archives of fat binaries are converted to a fat xabs that 3974 # ar can't use. So we to split the fat xabs into non-fat ones to unpack. 3975 # We can't deal with duplicate names, since 'ar xN' and 'uniq -cd' don't work. 3976 d_archs=`lipo -info $xabs 2> /dev/null | grep '^Architectures' | sed 's/^.*: //'` 3977 if test -n "$d_archs"; then 3978 $echo "$modename: manually unpacking fat archive $xabs" 1>&2 3979 d_name=`basename $xabs` 3980 d_dir="/tmp/fat_ar.$$" 3981 d_files='' 3982 3983 for d_arch in $d_archs; do 3984 d_archdir="$d_dir/$d_arch" 3985 $show "$mkdir -p $d_archdir" 3986 $run $mkdir -p "$d_archdir" 3987 3988 $show "lipo -thin $d_arch $xabs -o $d_dir/$d_name" 3989 $run lipo -thin $d_arch "$xabs" -o "$d_dir/$d_name" 3990 3991 $show "(cd $d_archdir && $AR x $d_dir/$d_name)" 3992 $run eval "(cd \$d_archdir && \$AR x \$d_dir/\$d_name)" || exit $? 3993 3994 $show "${rm} $d_dir/$d_name" 3995 $run ${rm} "$d_dir/$d_name" 3996 done 3997 3998 # Can't deal with blanks in file names 3999 $run eval "d_files=\`find \$d_dir -type f | sed -e 's,.*/,,' -e '/ /d' | sort -u\`" || exit $? 4000 4001 for d_file in $d_files; do 4002 $run eval "d_f=\`find \$d_dir -name \$d_file -print\`" || exit $? 4003 $show "lipo -create $d_f -o $xdir/$d_file" 4004 $run eval "lipo -create \$d_f -o \"\$xdir/\$d_file\"" || exit $? 4005 done 4006 4007 $show "${rm}r $d_dir" 4008 $run ${rm}r "$d_dir" 4009 else 4010 $show "(cd $xdir && $AR x $xabs)" 4011 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? 4012 fi 4013 ;; 4014 *) 4015 # We will extract separately just the conflicting names and we will no 4016 # longer touch any unique names. It is faster to leave these extract 4017 # automatically by $AR in one run. 4018 $show "(cd $xdir && $AR x $xabs)" 4019 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? 4020 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then 4021 : 4022 else 4023 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 4024 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 4025 $AR t "$xabs" | sort | uniq -cd | while read -r count name 4026 do 4027 i=1 4028 while test "$i" -le "$count" 4029 do 4030 # Put our $i before any first dot (extension) 4031 # Never overwrite any file 4032 name_to="$name" 4033 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" 4034 do 4035 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` 4036 done 4037 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" 4038 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? 4039 i=`expr $i + 1` 4040 done 4041 done 4042 fi 4043 ;; 4044 esac 4045 4046 reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` 4047 done 4069 4048 fi 4070 4049 fi … … 4074 4053 4075 4054 output="$obj" 4076 cmds=$reload_cmds4077 save_ifs="$IFS"; IFS= '~'4055 eval cmds=\"$reload_cmds\" 4056 save_ifs="$IFS"; IFS=$_S_ 4078 4057 for cmd in $cmds; do 4079 4058 IFS="$save_ifs" 4080 eval cmd=\"$cmd\"4081 4059 $show "$cmd" 4082 4060 $run eval "$cmd" || exit $? … … 4091 4069 fi 4092 4070 4093 exit $EXIT_SUCCESS4071 exit 0 4094 4072 fi 4095 4073 … … 4104 4082 # $show "echo timestamp > $libobj" 4105 4083 # $run eval "echo timestamp > $libobj" || exit $? 4106 exit $EXIT_SUCCESS4084 exit 0 4107 4085 fi 4108 4086 … … 4111 4089 reload_objs="$libobjs $reload_conv_objs" 4112 4090 output="$libobj" 4113 cmds=$reload_cmds4114 save_ifs="$IFS"; IFS= '~'4091 eval cmds=\"$reload_cmds\" 4092 save_ifs="$IFS"; IFS=$_S_ 4115 4093 for cmd in $cmds; do 4116 4094 IFS="$save_ifs" 4117 eval cmd=\"$cmd\"4118 4095 $show "$cmd" 4119 4096 $run eval "$cmd" || exit $? … … 4127 4104 fi 4128 4105 4129 exit $EXIT_SUCCESS4106 exit 0 4130 4107 ;; 4131 4108 … … 4432 4409 4433 4410 # Now compile the dynamic symbol file. 4434 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"4435 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?4411 $show "(cd $output_objdir && $LTCC $archargs -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" 4412 $run eval '(cd $output_objdir && $LTCC $archargs -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? 4436 4413 4437 4414 # Clean up the generated files. … … 4445 4422 *) 4446 4423 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 4447 exit $EXIT_FAILURE4424 exit 1 4448 4425 ;; 4449 4426 esac … … 4533 4510 $show "$link_command" 4534 4511 $run eval "$link_command" || exit $? 4535 exit $EXIT_SUCCESS4512 exit 0 4536 4513 fi 4537 4514 … … 4588 4565 4589 4566 # Quote $echo for shipping. 4590 if test "X$echo" = "X$SHELL $ progpath--fallback-echo"; then4591 case $ progpathin4592 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $ progpath--fallback-echo";;4593 *) qecho="$SHELL `pwd`/$ progpath--fallback-echo";;4567 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then 4568 case $0 in 4569 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; 4570 *) qecho="$SHELL `pwd`/$0 --fallback-echo";; 4594 4571 esac 4595 4572 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` … … 4617 4594 cwrapper=`$echo ${output}.exe` 4618 4595 $rm $cwrappersource $cwrapper 4619 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 154596 trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15 4620 4597 4621 4598 cat > $cwrappersource <<EOF … … 4626 4603 The $output program cannot be directly executed until all the libtool 4627 4604 libraries that it depends on are installed. 4628 4605 4629 4606 This wrapper executable should never be moved out of the build directory. 4630 4607 If it is, it will not operate correctly. … … 4658 4635 defined (__OS2__) 4659 4636 #define HAVE_DOS_BASED_FILE_SYSTEM 4660 #ifndef DIR_SEPARATOR_2 4637 #ifndef DIR_SEPARATOR_2 4661 4638 #define DIR_SEPARATOR_2 '\\' 4662 4639 #endif … … 4689 4666 char **newargz; 4690 4667 int i; 4691 4668 4692 4669 program_name = (char *) xstrdup ((char *) basename (argv[0])); 4693 4670 newargz = XMALLOC(char *, argc+2); … … 4702 4679 /* we know the script has the same name, without the .exe */ 4703 4680 /* so make sure newargz[1] doesn't end in .exe */ 4704 strendzap(newargz[1],".exe"); 4681 strendzap(newargz[1],".exe"); 4705 4682 for (i = 1; i < argc; i++) 4706 4683 newargz[i+1] = xstrdup(argv[i]); … … 4725 4702 } 4726 4703 4727 char * 4704 char * 4728 4705 xstrdup (const char *string) 4729 4706 { … … 4739 4716 #if defined (HAVE_DOS_BASED_FILE_SYSTEM) 4740 4717 /* Skip over the disk name in MSDOS pathnames. */ 4741 if (isalpha (name[0]) && name[1] == ':') 4718 if (isalpha (name[0]) && name[1] == ':') 4742 4719 name += 2; 4743 4720 #endif … … 4749 4726 } 4750 4727 4751 char * 4728 char * 4752 4729 fnqualify(const char *path) 4753 4730 { … … 4777 4754 4778 4755 char * 4779 strendzap(char *str, const char *pat) 4756 strendzap(char *str, const char *pat) 4780 4757 { 4781 4758 size_t len, patlen; … … 4797 4774 4798 4775 static void 4799 lt_error_core (int exit_status, const char * mode, 4776 lt_error_core (int exit_status, const char * mode, 4800 4777 const char * message, va_list ap) 4801 4778 { … … 4822 4799 # Since the "real" binary is built for $host, then this 4823 4800 # wrapper might as well be built for $host, too. 4824 $run $LTCC -s -o $cwrapper $cwrappersource4801 $run $LTCC $archargs -s -o $cwrapper $cwrappersource 4825 4802 ;; 4826 4803 esac 4827 4804 $rm $output 4828 trap "$rm $output; exit $EXIT_FAILURE" 1 2 154805 trap "$rm $output; exit 1" 1 2 15 4829 4806 4830 4807 $echo > $output "\ … … 4847 4824 # The HP-UX ksh and POSIX shell print the target directory to stdout 4848 4825 # if CDPATH is set. 4849 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH 4826 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi 4850 4827 4851 4828 relink_command=\"$relink_command\" … … 4926 4903 $echo \"\$relink_command_output\" >&2 4927 4904 $rm \"\$progdir/\$file\" 4928 exit $EXIT_FAILURE4905 exit 1 4929 4906 fi 4930 4907 fi … … 4988 4965 $echo >> $output "\ 4989 4966 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" 4990 exit $EXIT_FAILURE4967 exit 1 4991 4968 fi 4992 4969 else … … 4995 4972 \$echo \"This script is just a wrapper for \$program.\" 1>&2 4996 4973 $echo \"See the $PACKAGE documentation for more information.\" 1>&2 4997 exit $EXIT_FAILURE4974 exit 1 4998 4975 fi 4999 4976 fi\ … … 5001 4978 chmod +x $output 5002 4979 fi 5003 exit $EXIT_SUCCESS4980 exit 0 5004 4981 ;; 5005 4982 esac … … 5024 5001 if test -n "$addlibs"; then 5025 5002 gentop="$output_objdir/${outputname}x" 5003 $show "${rm}r $gentop" 5004 $run ${rm}r "$gentop" 5005 $show "$mkdir $gentop" 5006 $run $mkdir "$gentop" 5007 status=$? 5008 if test "$status" -ne 0 && test ! -d "$gentop"; then 5009 exit $status 5010 fi 5026 5011 generated="$generated $gentop" 5027 5012 5028 func_extract_archives $gentop $addlibs 5029 oldobjs="$oldobjs $func_extract_archives_result" 5013 # Add in members from convenience archives. 5014 for xlib in $addlibs; do 5015 # Extract the objects. 5016 case $xlib in 5017 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; 5018 *) xabs=`pwd`"/$xlib" ;; 5019 esac 5020 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` 5021 xdir="$gentop/$xlib" 5022 5023 $show "${rm}r $xdir" 5024 $run ${rm}r "$xdir" 5025 $show "$mkdir $xdir" 5026 $run $mkdir "$xdir" 5027 status=$? 5028 if test "$status" -ne 0 && test ! -d "$xdir"; then 5029 exit $status 5030 fi 5031 case $host in 5032 *-*-darwin*) 5033 # ranlib-ed archives of fat binaries are converted to a fat xabs that 5034 # ar can't use. So we to split the fat xabs into non-fat ones to unpack. 5035 # We can't deal with duplicate names, since 'ar xN' and 'uniq -cd' don't work. 5036 d_archs=`lipo -info $xabs 2> /dev/null | grep '^Architectures' | sed 's/^.*: //'` 5037 if test -n "$d_archs"; then 5038 $echo "$modename: manually unpacking fat archive $xabs" 1>&2 5039 d_name=`basename $xabs` 5040 d_dir="/tmp/fat_ar.$$" 5041 d_files='' 5042 5043 for d_arch in $d_archs; do 5044 d_archdir="$d_dir/$d_arch" 5045 $show "$mkdir -p $d_archdir" 5046 $run $mkdir -p "$d_archdir" 5047 5048 $show "lipo -thin $d_arch $xabs -o $d_dir/$d_name" 5049 $run lipo -thin $d_arch "$xabs" -o "$d_dir/$d_name" 5050 5051 $show "(cd $d_archdir && $AR x $d_dir/$d_name)" 5052 $run eval "(cd \$d_archdir && \$AR x \$d_dir/\$d_name)" || exit $? 5053 5054 $show "${rm} $d_dir/$d_name" 5055 $run ${rm} "$d_dir/$d_name" 5056 done 5057 5058 # Can't deal with blanks in file names 5059 $run eval "d_files=\`find \$d_dir -type f | sed -e 's,.*/,,' -e '/ /d' | sort -u\`" || exit $? 5060 5061 for d_file in $d_files; do 5062 $run eval "d_f=\`find \$d_dir -name \$d_file -print\`" || exit $? 5063 $show "lipo -create $d_f -o $xdir/$d_file" 5064 $run eval "lipo -create \$d_f -o \"\$xdir/\$d_file\"" || exit $? 5065 done 5066 5067 $show "${rm}r $d_dir" 5068 $run ${rm}r "$d_dir" 5069 else 5070 $show "(cd $xdir && $AR x $xabs)" 5071 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? 5072 fi 5073 ;; 5074 *) 5075 # We will extract separately just the conflicting names and we will no 5076 # longer touch any unique names. It is faster to leave these extract 5077 # automatically by $AR in one run. 5078 $show "(cd $xdir && $AR x $xabs)" 5079 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? 5080 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then 5081 : 5082 else 5083 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 5084 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 5085 $AR t "$xabs" | sort | uniq -cd | while read -r count name 5086 do 5087 i=1 5088 while test "$i" -le "$count" 5089 do 5090 # Put our $i before any first dot (extension) 5091 # Never overwrite any file 5092 name_to="$name" 5093 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" 5094 do 5095 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` 5096 done 5097 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" 5098 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? 5099 i=`expr $i + 1` 5100 done 5101 done 5102 fi 5103 ;; 5104 esac 5105 5106 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` 5107 done 5030 5108 fi 5031 5109 5032 5110 # Do each command in the archive commands. 5033 5111 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then 5034 cmds=$old_archive_from_new_cmds 5112 eval cmds=\"$old_archive_from_new_cmds\" 5035 5113 else 5036 5114 eval cmds=\"$old_archive_cmds\" … … 5038 5116 if len=`expr "X$cmds" : ".*"` && 5039 5117 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then 5040 cmds=$old_archive_cmds5118 : 5041 5119 else 5042 5120 # the command line is too long to link in one step, link in parts … … 5065 5143 do 5066 5144 last_oldobj=$obj 5067 done 5145 done 5068 5146 for obj in $save_oldobjs 5069 5147 do … … 5079 5157 if test "$obj" = "$last_oldobj" ; then 5080 5158 RANLIB=$save_RANLIB 5081 fi 5082 test -z "$concat_cmds" || concat_cmds=$concat_cmds ~5159 fi 5160 test -z "$concat_cmds" || concat_cmds=$concat_cmds${_S_} 5083 5161 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" 5084 5162 objlist= … … 5090 5168 eval cmds=\"\$concat_cmds\" 5091 5169 else 5092 eval cmds=\"\$concat_cmds ~\$old_archive_cmds\"5093 fi 5094 fi 5095 fi 5096 save_ifs="$IFS"; IFS= '~'5170 eval cmds=\"\$concat_cmds${_S_}$old_archive_cmds\" 5171 fi 5172 fi 5173 fi 5174 save_ifs="$IFS"; IFS=$_S_ 5097 5175 for cmd in $cmds; do 5098 eval cmd=\"$cmd\"5099 5176 IFS="$save_ifs" 5100 5177 $show "$cmd" … … 5128 5205 done 5129 5206 # Quote the link command for shipping. 5130 relink_command="(cd `pwd`; $SHELL $ progpath $preserve_args--mode=relink $libtool_args @inst_prefix_dir@)"5207 relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)" 5131 5208 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` 5132 if test "$hardcode_automatic" = yes ; then5133 relink_command=5134 fi5135 5136 5209 5137 5210 # Only create the output if not a dry run. … … 5152 5225 if test -z "$libdir"; then 5153 5226 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 5154 exit $EXIT_FAILURE5227 exit 1 5155 5228 fi 5156 5229 newdependency_libs="$newdependency_libs $libdir/$name" … … 5166 5239 if test -z "$libdir"; then 5167 5240 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 5168 exit $EXIT_FAILURE5241 exit 1 5169 5242 fi 5170 5243 newdlfiles="$newdlfiles $libdir/$name" … … 5177 5250 if test -z "$libdir"; then 5178 5251 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 5179 exit $EXIT_FAILURE5252 exit 1 5180 5253 fi 5181 5254 newdlprefiles="$newdlprefiles $libdir/$name" 5182 done5183 dlprefiles="$newdlprefiles"5184 else5185 newdlfiles=5186 for lib in $dlfiles; do5187 case $lib in5188 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;5189 *) abs=`pwd`"/$lib" ;;5190 esac5191 newdlfiles="$newdlfiles $abs"5192 done5193 dlfiles="$newdlfiles"5194 newdlprefiles=5195 for lib in $dlprefiles; do5196 case $lib in5197 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;5198 *) abs=`pwd`"/$lib" ;;5199 esac5200 newdlprefiles="$newdlprefiles $abs"5201 5255 done 5202 5256 dlprefiles="$newdlprefiles" … … 5257 5311 ;; 5258 5312 esac 5259 exit $EXIT_SUCCESS5313 exit 0 5260 5314 ;; 5261 5315 … … 5346 5400 $echo "$modename: you must specify an install program" 1>&2 5347 5401 $echo "$help" 1>&2 5348 exit $EXIT_FAILURE5402 exit 1 5349 5403 fi 5350 5404 … … 5352 5406 $echo "$modename: the \`$prev' option requires an argument" 1>&2 5353 5407 $echo "$help" 1>&2 5354 exit $EXIT_FAILURE5408 exit 1 5355 5409 fi 5356 5410 … … 5362 5416 fi 5363 5417 $echo "$help" 1>&2 5364 exit $EXIT_FAILURE5418 exit 1 5365 5419 fi 5366 5420 … … 5383 5437 $echo "$modename: \`$dest' is not a directory" 1>&2 5384 5438 $echo "$help" 1>&2 5385 exit $EXIT_FAILURE5439 exit 1 5386 5440 fi 5387 5441 fi … … 5395 5449 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 5396 5450 $echo "$help" 1>&2 5397 exit $EXIT_FAILURE5451 exit 1 5398 5452 ;; 5399 5453 esac … … 5424 5478 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 5425 5479 $echo "$help" 1>&2 5426 exit $EXIT_FAILURE5480 exit 1 5427 5481 fi 5428 5482 … … 5466 5520 if test "$inst_prefix_dir" = "$destdir"; then 5467 5521 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 5468 exit $EXIT_FAILURE5522 exit 1 5469 5523 fi 5470 5524 … … 5481 5535 else 5482 5536 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 5483 exit $EXIT_FAILURE5537 exit 1 5484 5538 fi 5485 5539 fi … … 5516 5570 # Do each command in the postinstall commands. 5517 5571 lib="$destdir/$realname" 5518 cmds=$postinstall_cmds5519 save_ifs="$IFS"; IFS= '~'5572 eval cmds=\"$postinstall_cmds\" 5573 save_ifs="$IFS"; IFS=$_S_ 5520 5574 for cmd in $cmds; do 5521 5575 IFS="$save_ifs" 5522 eval cmd=\"$cmd\"5523 5576 $show "$cmd" 5524 5577 $run eval "$cmd" || exit $? … … 5560 5613 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 5561 5614 $echo "$help" 1>&2 5562 exit $EXIT_FAILURE5615 exit 1 5563 5616 ;; 5564 5617 esac … … 5578 5631 $run eval "$install_prog \$staticobj \$staticdest" || exit $? 5579 5632 fi 5580 exit $EXIT_SUCCESS5633 exit 0 5581 5634 ;; 5582 5635 … … 5632 5685 if test -z "$notinst_deplibs"; then 5633 5686 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 5634 exit $EXIT_FAILURE5687 exit 1 5635 5688 fi 5636 5689 … … 5673 5726 test -n "$TMPDIR" && tmpdir="$TMPDIR" 5674 5727 tmpdir="$tmpdir/libtool-$$" 5675 save_umask=`umask` 5676 umask 0077 5677 if $mkdir "$tmpdir"; then 5678 umask $save_umask 5728 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : 5679 5729 else 5680 umask $save_umask5681 5730 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 5682 5731 continue … … 5737 5786 $run eval "$install_prog \$file \$oldlib" || exit $? 5738 5787 5739 if test -n "$stripme" && test -n "$ old_striplib"; then5788 if test -n "$stripme" && test -n "$striplib"; then 5740 5789 $show "$old_striplib $oldlib" 5741 5790 $run eval "$old_striplib $oldlib" || exit $? … … 5743 5792 5744 5793 # Do each command in the postinstall commands. 5745 cmds=$old_postinstall_cmds5746 save_ifs="$IFS"; IFS= '~'5794 eval cmds=\"$old_postinstall_cmds\" 5795 save_ifs="$IFS"; IFS=$_S_ 5747 5796 for cmd in $cmds; do 5748 5797 IFS="$save_ifs" 5749 eval cmd=\"$cmd\"5750 5798 $show "$cmd" 5751 5799 $run eval "$cmd" || exit $? … … 5761 5809 # Maybe just do a dry run. 5762 5810 test -n "$run" && current_libdirs=" -n$current_libdirs" 5763 exec_cmd='$SHELL $ progpath $preserve_args--finish$current_libdirs'5811 exec_cmd='$SHELL $0 --finish$current_libdirs' 5764 5812 else 5765 exit $EXIT_SUCCESS5813 exit 0 5766 5814 fi 5767 5815 ;; … … 5782 5830 if test -n "$finish_cmds"; then 5783 5831 # Do each command in the finish commands. 5784 cmds=$finish_cmds5785 save_ifs="$IFS"; IFS= '~'5832 eval cmds=\"$finish_cmds\" 5833 save_ifs="$IFS"; IFS=$_S_ 5786 5834 for cmd in $cmds; do 5787 5835 IFS="$save_ifs" 5788 eval cmd=\"$cmd\"5789 5836 $show "$cmd" 5790 5837 $run eval "$cmd" || admincmds="$admincmds … … 5803 5850 5804 5851 # Exit here if they wanted silent mode. 5805 test "$show" = : && exit $EXIT_SUCCESS5852 test "$show" = : && exit 0 5806 5853 5807 5854 $echo "----------------------------------------------------------------------" … … 5839 5886 $echo "more information, such as the ld(1) and ld.so(8) manual pages." 5840 5887 $echo "----------------------------------------------------------------------" 5841 exit $EXIT_SUCCESS5888 exit 0 5842 5889 ;; 5843 5890 … … 5851 5898 $echo "$modename: you must specify a COMMAND" 1>&2 5852 5899 $echo "$help" 5853 exit $EXIT_FAILURE5900 exit 1 5854 5901 fi 5855 5902 … … 5859 5906 $echo "$modename: \`$file' is not a file" 1>&2 5860 5907 $echo "$help" 1>&2 5861 exit $EXIT_FAILURE5908 exit 1 5862 5909 fi 5863 5910 … … 5870 5917 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 5871 5918 $echo "$help" 1>&2 5872 exit $EXIT_FAILURE5919 exit 1 5873 5920 fi 5874 5921 … … 5897 5944 else 5898 5945 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 5899 exit $EXIT_FAILURE5946 exit 1 5900 5947 fi 5901 5948 ;; … … 5969 6016 5970 6017 # Now prepare to actually exec the command. 5971 exec_cmd="\ "\$cmd\"$args"6018 exec_cmd="\$cmd$args" 5972 6019 else 5973 6020 # Display what would be done. … … 5976 6023 $echo "export $shlibpath_var" 5977 6024 fi 5978 eval \$echo \"\$cmd\"$args5979 exit $EXIT_SUCCESS6025 $echo "$cmd$args" 6026 exit 0 5980 6027 fi 5981 6028 ;; … … 6005 6052 $echo "$modename: you must specify an RM program" 1>&2 6006 6053 $echo "$help" 1>&2 6007 exit $EXIT_FAILURE6054 exit 1 6008 6055 fi 6009 6056 … … 6060 6107 if test -n "$library_names"; then 6061 6108 # Do each command in the postuninstall commands. 6062 cmds=$postuninstall_cmds6063 save_ifs="$IFS"; IFS= '~'6109 eval cmds=\"$postuninstall_cmds\" 6110 save_ifs="$IFS"; IFS=$_S_ 6064 6111 for cmd in $cmds; do 6065 6112 IFS="$save_ifs" 6066 eval cmd=\"$cmd\"6067 6113 $show "$cmd" 6068 6114 $run eval "$cmd" … … 6076 6122 if test -n "$old_library"; then 6077 6123 # Do each command in the old_postuninstall commands. 6078 cmds=$old_postuninstall_cmds6079 save_ifs="$IFS"; IFS= '~'6124 eval cmds=\"$old_postuninstall_cmds\" 6125 save_ifs="$IFS"; IFS=$_S_ 6080 6126 for cmd in $cmds; do 6081 6127 IFS="$save_ifs" 6082 eval cmd=\"$cmd\"6083 6128 $show "$cmd" 6084 6129 $run eval "$cmd" … … 6119 6164 noexename=$name 6120 6165 case $file in 6121 *.exe) 6166 *.exe) 6122 6167 file=`$echo $file|${SED} 's,.exe$,,'` 6123 6168 noexename=`$echo $name|${SED} 's,.exe$,,'` … … 6164 6209 $echo "$modename: you must specify a MODE" 1>&2 6165 6210 $echo "$generic_help" 1>&2 6166 exit $EXIT_FAILURE6211 exit 1 6167 6212 ;; 6168 6213 esac … … 6171 6216 $echo "$modename: invalid operation mode \`$mode'" 1>&2 6172 6217 $echo "$generic_help" 1>&2 6173 exit $EXIT_FAILURE6218 exit 1 6174 6219 fi 6175 6220 fi # test -z "$show_help" … … 6177 6222 if test -n "$exec_cmd"; then 6178 6223 eval exec $exec_cmd 6179 exit $EXIT_FAILURE6224 exit 1 6180 6225 fi 6181 6226 … … 6213 6258 6214 6259 Report bugs to <bug-libtool@gnu.org>." 6215 exit $EXIT_SUCCESS6260 exit 0 6216 6261 ;; 6217 6262 … … 6325 6370 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects 6326 6371 -objectlist FILE Use a list of object files found in FILE to specify objects 6327 -precious-files-regex REGEX6328 don't remove output files matching REGEX6329 6372 -release RELEASE specify package release information 6330 6373 -rpath LIBDIR the created library will eventually be installed in LIBDIR … … 6368 6411 $echo "$modename: invalid operation mode \`$mode'" 1>&2 6369 6412 $echo "$help" 1>&2 6370 exit $EXIT_FAILURE6413 exit 1 6371 6414 ;; 6372 6415 esac … … 6375 6418 $echo "Try \`$modename --help' for more information about other modes." 6376 6419 6377 exit $EXIT_SUCCESS6420 exit 0 6378 6421 6379 6422 # The TAGs below are defined such that we never get into a situation
Note:
See TracChangeset
for help on using the changeset viewer.
