comparison kdiff3/admin/ltmain.sh @ 14:415083d043f3

KDiff3 version 0.9.70
author joachim99
date Mon, 06 Oct 2003 19:19:11 +0000
parents 53b8ecbce0cb
children efe33e938730
comparison
equal deleted inserted replaced
13:266aeefa1b11 14:415083d043f3
1 # ltmain.sh - Provide generalized library-building support services. 1 # ltmain.sh - Provide generalized library-building support services.
2 # NOTE: Changing this file will not affect anything until you rerun ltconfig. 2 # NOTE: Changing this file will not affect anything until you rerun configure.
3 # 3 #
4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
5 # Free Software Foundation, Inc. 5 # Free Software Foundation, Inc.
6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7 # 7 #
47 EOF 47 EOF
48 exit 0 48 exit 0
49 fi 49 fi
50 50
51 # The name of this program. 51 # The name of this program.
52 progname=`$echo "$0" | sed 's%^.*/%%'` 52 progname=`$echo "$0" | ${SED} 's%^.*/%%'`
53 modename="$progname" 53 modename="$progname"
54 54
55 # Constants. 55 # Constants.
56 PROGRAM=ltmain.sh 56 PROGRAM=ltmain.sh
57 PACKAGE=libtool 57 PACKAGE=libtool
58 VERSION=1.4a 58 VERSION=1.4e
59 TIMESTAMP=" (1.641.2.206mm 2001/04/03 21:47:47)" 59 TIMESTAMP=" (1.1090 2002/02/07 19:54:36)"
60 60
61 default_mode= 61 default_mode=
62 help="Try \`$progname --help' for more information." 62 help="Try \`$progname --help' for more information."
63 magic="%%%MAGIC variable%%%" 63 magic="%%%MAGIC variable%%%"
64 mkdir="mkdir" 64 mkdir="mkdir"
65 mv="mv -f" 65 mv="mv -f"
66 rm="rm -f" 66 rm="rm -f"
67 67
68 # Sed substitution that helps us do robust quoting. It backslashifies 68 # Sed substitution that helps us do robust quoting. It backslashifies
69 # metacharacters that are still active within double-quoted strings. 69 # metacharacters that are still active within double-quoted strings.
70 Xsed='sed -e 1s/^X//' 70 Xsed="${SED}"' -e 1s/^X//'
71 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' 71 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
72 SP2NL='tr \040 \012' 72 SP2NL='tr \040 \012'
73 NL2SP='tr \015\012 \040\040' 73 NL2SP='tr \015\012 \040\040'
74 74
75 # NLS nuisances. 75 # NLS nuisances.
82 fi 82 fi
83 if test "${LANG+set}" = set; then 83 if test "${LANG+set}" = set; then
84 save_LANG="$LANG"; LANG=C; export LANG 84 save_LANG="$LANG"; LANG=C; export LANG
85 fi 85 fi
86 86
87 if test "$LTCONFIG_VERSION" != "$VERSION"; then 87 # Make sure IFS has a sensible default
88 echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2 88 : ${IFS=" "}
89 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
90 exit 1
91 fi
92 89
93 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then 90 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
94 echo "$modename: not configured to build any kind of library" 1>&2 91 echo "$modename: not configured to build any kind of library" 1>&2
95 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 92 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
96 exit 1 93 exit 1
107 execute_dlfiles= 104 execute_dlfiles=
108 lo2o="s/\\.lo\$/.${objext}/" 105 lo2o="s/\\.lo\$/.${objext}/"
109 o2lo="s/\\.${objext}\$/.lo/" 106 o2lo="s/\\.${objext}\$/.lo/"
110 107
111 # Parse our command line options once, thoroughly. 108 # Parse our command line options once, thoroughly.
112 while test $# -gt 0 109 while test "$#" -gt 0
113 do 110 do
114 arg="$1" 111 arg="$1"
115 shift 112 shift
116 113
117 case $arg in 114 case $arg in
131 # Check whether tagname contains only valid characters 128 # Check whether tagname contains only valid characters
132 case $tagname in 129 case $tagname in
133 *[!-_A-Za-z0-9,/]*) 130 *[!-_A-Za-z0-9,/]*)
134 echo "$progname: invalid tag name: $tagname" 1>&2 131 echo "$progname: invalid tag name: $tagname" 1>&2
135 exit 1 132 exit 1
136 ;; 133 ;;
137 esac 134 esac
138 135
139 if grep "^### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then 136 case $tagname in
140 taglist="$taglist $tagname" 137 CC)
141 # Evaluate the configuration. 138 # Don't test for the "default" C tag, as we know, it's there, but
142 eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`" 139 # not specially marked.
143 else 140 ;;
144 echo "$progname: ignoring unknown tag $tagname" 1>&2 141 *)
145 fi 142 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
143 taglist="$taglist $tagname"
144 # Evaluate the configuration.
145 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
146 else
147 echo "$progname: ignoring unknown tag $tagname" 1>&2
148 fi
149 ;;
150 esac
146 ;; 151 ;;
147 *) 152 *)
148 eval "$prev=\$arg" 153 eval "$prev=\$arg"
149 ;; 154 ;;
150 esac 155 esac
160 show_help=yes 165 show_help=yes
161 ;; 166 ;;
162 167
163 --version) 168 --version)
164 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" 169 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
170 echo
171 echo "Copyright 1996, 1997, 1998, 1999, 2000, 2001"
172 echo "Free Software Foundation, Inc."
173 echo "This is free software; see the source for copying conditions. There is NO"
174 echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
165 exit 0 175 exit 0
166 ;; 176 ;;
167 177
168 --config) 178 --config)
169 sed -n -e '/^### BEGIN LIBTOOL CONFIG/,/^### END LIBTOOL CONFIG/p' < "$0" 179 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
170 # Now print the configurations for the tags. 180 # Now print the configurations for the tags.
171 for tagname in $taglist; do 181 for tagname in $taglist; do
172 sed -n -e "/^### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0" 182 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
173 done 183 done
174 exit 0 184 exit 0
175 ;; 185 ;;
176 186
177 --debug) 187 --debug)
201 --finish) mode="finish" ;; 211 --finish) mode="finish" ;;
202 212
203 --mode) prevopt="--mode" prev=mode ;; 213 --mode) prevopt="--mode" prev=mode ;;
204 --mode=*) mode="$optarg" ;; 214 --mode=*) mode="$optarg" ;;
205 215
216 --preserve-dup-deps) duplicate_deps="yes" ;;
217
206 --quiet | --silent) 218 --quiet | --silent)
207 show=: 219 show=:
208 ;; 220 ;;
209 221
210 --tag) prevopt="--tag" prev=tag ;; 222 --tag) prevopt="--tag" prev=tag ;;
235 if test -n "$prevopt"; then 247 if test -n "$prevopt"; then
236 $echo "$modename: option \`$prevopt' requires an argument" 1>&2 248 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
237 $echo "$help" 1>&2 249 $echo "$help" 1>&2
238 exit 1 250 exit 1
239 fi 251 fi
252
253 # If this variable is set in any of the actions, the command in it
254 # will be execed at the end. This prevents here-documents from being
255 # left over by shells.
256 exec_cmd=
240 257
241 if test -z "$show_help"; then 258 if test -z "$show_help"; then
242 259
243 # Infer the operation mode. 260 # Infer the operation mode.
244 if test -z "$mode"; then 261 if test -z "$mode"; then
363 ;; 380 ;;
364 381
365 -Wc,*) 382 -Wc,*)
366 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` 383 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
367 lastarg= 384 lastarg=
368 IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' 385 save_ifs="$IFS"; IFS=','
369 for arg in $args; do 386 for arg in $args; do
370 IFS="$save_ifs" 387 IFS="$save_ifs"
371 388
372 # Double-quote args containing other shell metacharacters. 389 # Double-quote args containing other shell metacharacters.
373 # Many Bourne shells cannot handle close brackets correctly 390 # Many Bourne shells cannot handle close brackets correctly
447 ;; 464 ;;
448 esac 465 esac
449 466
450 # Recognize several different file suffixes. 467 # Recognize several different file suffixes.
451 # If the user specifies -o file.o, it is replaced with file.lo 468 # If the user specifies -o file.o, it is replaced with file.lo
452 xform='[cCFSfmso]' 469 xform='[cCFSifmso]'
453 case $libobj in 470 case $libobj in
454 *.ada) xform=ada ;; 471 *.ada) xform=ada ;;
455 *.adb) xform=adb ;; 472 *.adb) xform=adb ;;
456 *.ads) xform=ads ;; 473 *.ads) xform=ads ;;
457 *.asm) xform=asm ;; 474 *.asm) xform=asm ;;
458 *.c++) xform=c++ ;; 475 *.c++) xform=c++ ;;
459 *.cc) xform=cc ;; 476 *.cc) xform=cc ;;
477 *.ii) xform=ii ;;
460 *.class) xform=class ;; 478 *.class) xform=class ;;
461 *.cpp) xform=cpp ;; 479 *.cpp) xform=cpp ;;
462 *.cxx) xform=cxx ;; 480 *.cxx) xform=cxx ;;
463 *.f90) xform=f90 ;; 481 *.f90) xform=f90 ;;
464 *.for) xform=for ;; 482 *.for) xform=for ;;
478 # Infer tagged configuration to use if any are available and 496 # Infer tagged configuration to use if any are available and
479 # if one wasn't chosen via the "--tag" command line option. 497 # if one wasn't chosen via the "--tag" command line option.
480 # Only attempt this if the compiler in the base compile 498 # Only attempt this if the compiler in the base compile
481 # command doesn't match the default compiler. 499 # command doesn't match the default compiler.
482 if test -n "$available_tags" && test -z "$tagname"; then 500 if test -n "$available_tags" && test -z "$tagname"; then
483 case $base_compile in 501 case "$base_compile " in
484 "$CC "*) ;; 502 "$CC "*) ;;
485 # Blanks in the command may have been stripped by the calling shell, 503 # Blanks in the command may have been stripped by the calling shell,
486 # but not from the CC environment variable when ltconfig was run. 504 # but not from the CC environment variable when ltconfig was run.
487 "`$echo $CC` "*) ;; 505 "`$echo $CC` "*) ;;
488 *) 506 *)
489 for z in $available_tags; do 507 for z in $available_tags; do
490 if grep "^### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then 508 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
491 # Evaluate the configuration. 509 # Evaluate the configuration.
492 eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`" 510 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
493 case $base_compile in 511 case "$base_compile " in
494 "$CC "*) 512 "$CC "*)
495 # The compiler in the base compile command matches 513 # The compiler in the base compile command matches
496 # the one in the tagged configuration. 514 # the one in the tagged configuration.
497 # Assume this is the tagged configuration we want. 515 # Assume this is the tagged configuration we want.
498 tagname=$z 516 tagname=$z
499 break 517 break
500 ;; 518 ;;
501 "`$echo $CC` "*) 519 "`$echo $CC` "*)
502 tagname=$z 520 tagname=$z
503 break 521 break
504 ;; 522 ;;
505 esac 523 esac
506 fi 524 fi
507 done 525 done
508 # If $tagname still isn't set, then no tagged configuration 526 # If $tagname still isn't set, then no tagged configuration
509 # was found and let the user know that the "--tag" command 527 # was found and let the user know that the "--tag" command
510 # line option must be used. 528 # line option must be used.
511 if test -z "$tagname"; then 529 if test -z "$tagname"; then
512 echo "$modename: unable to infer tagged configuration" 530 echo "$modename: unable to infer tagged configuration"
513 echo "$modename: specify a tag with \`--tag'" 1>&2 531 echo "$modename: specify a tag with \`--tag'" 1>&2
514 exit 1 532 exit 1
515 # else 533 # else
516 # echo "$modename: using $tagname tagged configuration" 534 # echo "$modename: using $tagname tagged configuration"
517 fi 535 fi
518 ;; 536 ;;
519 esac 537 esac
520 fi 538 fi
521 539
522 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` 540 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
548 case $host_os in 566 case $host_os in
549 cygwin* | mingw* | pw32* | os2*) 567 cygwin* | mingw* | pw32* | os2*)
550 pic_mode=default 568 pic_mode=default
551 ;; 569 ;;
552 esac 570 esac
553 if test $pic_mode = no && test "$deplibs_check_method" != pass_all; then 571 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
554 # non-PIC code in shared libraries is not supported 572 # non-PIC code in shared libraries is not supported
555 pic_mode=default 573 pic_mode=default
556 fi 574 fi
557 575
558 # Calculate the filename of the output object if compiler does 576 # Calculate the filename of the output object if compiler does
622 else 640 else
623 # Don't build PIC code 641 # Don't build PIC code
624 command="$base_compile $srcfile" 642 command="$base_compile $srcfile"
625 fi 643 fi
626 644
627 if test ! -d ${xdir}$objdir; then 645 if test ! -d "${xdir}$objdir"; then
628 $show "$mkdir ${xdir}$objdir" 646 $show "$mkdir ${xdir}$objdir"
629 $run $mkdir ${xdir}$objdir 647 $run $mkdir ${xdir}$objdir
630 status=$? 648 status=$?
631 if test $status -ne 0 && test ! -d ${xdir}$objdir; then 649 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
632 exit $status 650 exit $status
633 fi 651 fi
634 fi 652 fi
635 653
636 if test -z "$output_obj"; then 654 if test -z "$output_obj"; then
637 # Place PIC objects in $objdir 655 # Place PIC objects in $objdir
638 command="$command -o $lobj" 656 command="$command -o $lobj"
639 fi 657 fi
640 658
641 $run $rm "$lobj" "$output_obj" 659 $run $rm "$lobj" "$output_obj"
642 660
643 $show "$command" 661 $show "$command"
646 test -n "$output_obj" && $run $rm $removelist 664 test -n "$output_obj" && $run $rm $removelist
647 exit 1 665 exit 1
648 fi 666 fi
649 667
650 if test "$need_locks" = warn && 668 if test "$need_locks" = warn &&
651 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then 669 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
652 echo "\ 670 echo "\
653 *** ERROR, $lockfile contains: 671 *** ERROR, $lockfile contains:
654 `cat $lockfile 2>/dev/null` 672 `cat $lockfile 2>/dev/null`
655 673
656 but it should contain: 674 but it should contain:
666 $run $rm $removelist 684 $run $rm $removelist
667 exit 1 685 exit 1
668 fi 686 fi
669 687
670 # Just move the object if needed, then go on to compile the next one 688 # Just move the object if needed, then go on to compile the next one
671 if test -n "$output_obj" && test "x$output_obj" != "x$lobj"; then 689 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
672 $show "$mv $output_obj $lobj" 690 $show "$mv $output_obj $lobj"
673 if $run $mv $output_obj $lobj; then : 691 if $run $mv $output_obj $lobj; then :
674 else 692 else
675 error=$? 693 error=$?
676 $run $rm $removelist 694 $run $rm $removelist
716 $run $rm $removelist 734 $run $rm $removelist
717 exit 1 735 exit 1
718 fi 736 fi
719 737
720 if test "$need_locks" = warn && 738 if test "$need_locks" = warn &&
721 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then 739 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
722 echo "\ 740 echo "\
723 *** ERROR, $lockfile contains: 741 *** ERROR, $lockfile contains:
724 `cat $lockfile 2>/dev/null` 742 `cat $lockfile 2>/dev/null`
725 743
726 but it should contain: 744 but it should contain:
736 $run $rm $removelist 754 $run $rm $removelist
737 exit 1 755 exit 1
738 fi 756 fi
739 757
740 # Just move the object if needed 758 # Just move the object if needed
741 if test -n "$output_obj" && test "x$output_obj" != "x$obj"; then 759 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
742 $show "$mv $output_obj $obj" 760 $show "$mv $output_obj $obj"
743 if $run $mv $output_obj $obj; then : 761 if $run $mv $output_obj $obj; then :
744 else 762 else
745 error=$? 763 error=$?
746 $run $rm $removelist 764 $run $rm $removelist
869 887
870 # See if our shared archives depend on static archives. 888 # See if our shared archives depend on static archives.
871 test -n "$old_archive_from_new_cmds" && build_old_libs=yes 889 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
872 890
873 # Go through the arguments, transforming them on the way. 891 # Go through the arguments, transforming them on the way.
874 while test $# -gt 0; do 892 while test "$#" -gt 0; do
875 arg="$1" 893 arg="$1"
876 base_compile="$base_compile $arg" 894 base_compile="$base_compile $arg"
877 shift 895 shift
878 case $arg in 896 case $arg in
879 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 897 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
952 prev= 970 prev=
953 continue 971 continue
954 ;; 972 ;;
955 objectlist) 973 objectlist)
956 if test -f "$arg"; then 974 if test -f "$arg"; then
957 save_arg=$arg 975 save_arg=$arg
958 moreargs= 976 moreargs=
959 for fil in `cat $save_arg` 977 for fil in `cat $save_arg`
960 do 978 do
961 # moreargs="$moreargs $fil" 979 # moreargs="$moreargs $fil"
962 arg=$fil 980 arg=$fil
963 # A libtool-controlled object. 981 # A libtool-controlled object.
964 982
965 # Check to see that this really is a libtool object. 983 # Check to see that this really is a libtool object.
966 if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 984 if (${SED} -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
967 pic_object= 985 pic_object=
968 non_pic_object= 986 non_pic_object=
969 987
970 # Read the .lo file 988 # Read the .lo file
971 # If there is no directory component, then add one. 989 # If there is no directory component, then add one.
972 case $arg in 990 case $arg in
973 */* | *\\*) . $arg ;; 991 */* | *\\*) . $arg ;;
974 *) . ./$arg ;; 992 *) . ./$arg ;;
975 esac 993 esac
976 994
977 if test -z "$pic_object" || \ 995 if test -z "$pic_object" || \
978 test -z "$non_pic_object" || 996 test -z "$non_pic_object" ||
979 test "$pic_object" = none && \ 997 test "$pic_object" = none && \
980 test "$non_pic_object" = none; then 998 test "$non_pic_object" = none; then
981 $echo "$modename: cannot find name of object for \`$arg'" 1>&2 999 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
982 exit 1 1000 exit 1
983 fi 1001 fi
984 1002
985 # Extract subdirectory from the argument. 1003 # Extract subdirectory from the argument.
986 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` 1004 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
987 if test "X$xdir" = "X$arg"; then 1005 if test "X$xdir" = "X$arg"; then
988 xdir= 1006 xdir=
989 else 1007 else
990 xdir="$xdir/" 1008 xdir="$xdir/"
991 fi 1009 fi
992 1010
993 if test "$pic_object" != none; then 1011 if test "$pic_object" != none; then
994 # Prepend the subdirectory the object is found in. 1012 # Prepend the subdirectory the object is found in.
995 pic_object="$xdir$pic_object" 1013 pic_object="$xdir$pic_object"
996 1014
997 if test "$prev" = dlfiles; then 1015 if test "$prev" = dlfiles; then
998 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then 1016 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
999 dlfiles="$dlfiles $pic_object" 1017 dlfiles="$dlfiles $pic_object"
1000 prev= 1018 prev=
1001 continue 1019 continue
1002 else 1020 else
1003 # If libtool objects are unsupported, then we need to preload. 1021 # If libtool objects are unsupported, then we need to preload.
1004 prev=dlprefiles 1022 prev=dlprefiles
1005 fi 1023 fi
1006 fi 1024 fi
1007 1025
1008 # CHECK ME: I think I busted this. -Ossama 1026 # CHECK ME: I think I busted this. -Ossama
1009 if test "$prev" = dlprefiles; then 1027 if test "$prev" = dlprefiles; then
1010 # Preload the old-style object. 1028 # Preload the old-style object.
1011 dlprefiles="$dlprefiles $pic_object" 1029 dlprefiles="$dlprefiles $pic_object"
1012 prev= 1030 prev=
1013 fi 1031 fi
1014 1032
1015 # A PIC object. 1033 # A PIC object.
1016 libobjs="$libobjs $pic_object" 1034 libobjs="$libobjs $pic_object"
1017 arg="$pic_object" 1035 arg="$pic_object"
1018 fi 1036 fi
1019 1037
1020 # Non-PIC object. 1038 # Non-PIC object.
1021 if test "$non_pic_object" != none; then 1039 if test "$non_pic_object" != none; then
1022 # Prepend the subdirectory the object is found in. 1040 # Prepend the subdirectory the object is found in.
1023 non_pic_object="$xdir$non_pic_object" 1041 non_pic_object="$xdir$non_pic_object"
1024 1042
1025 # A standard non-PIC object 1043 # A standard non-PIC object
1026 non_pic_objects="$non_pic_objects $non_pic_object" 1044 non_pic_objects="$non_pic_objects $non_pic_object"
1027 if test -z "$pic_object" || test "$pic_object" = none ; then 1045 if test -z "$pic_object" || test "$pic_object" = none ; then
1028 arg="$non_pic_object" 1046 arg="$non_pic_object"
1029 fi 1047 fi
1030 fi 1048 fi
1031 else 1049 else
1032 # Only an error if not doing a dry-run. 1050 # Only an error if not doing a dry-run.
1033 if test -z "$run"; then 1051 if test -z "$run"; then
1034 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 1052 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1035 exit 1 1053 exit 1
1036 else 1054 else
1037 # Dry-run case. 1055 # Dry-run case.
1038 1056
1039 # Extract subdirectory from the argument. 1057 # Extract subdirectory from the argument.
1040 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` 1058 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1041 if test "X$xdir" = "X$arg"; then 1059 if test "X$xdir" = "X$arg"; then
1042 xdir= 1060 xdir=
1043 else 1061 else
1044 xdir="$xdir/" 1062 xdir="$xdir/"
1045 fi 1063 fi
1046 1064
1047 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` 1065 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1048 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` 1066 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1049 libobjs="$libobjs $pic_object" 1067 libobjs="$libobjs $pic_object"
1050 non_pic_objects="$non_pic_objects $non_pic_object" 1068 non_pic_objects="$non_pic_objects $non_pic_object"
1051 fi 1069 fi
1052 fi 1070 fi
1053 done 1071 done
1054 else 1072 else
1055 $echo "$modename: link input file \`$save_arg' does not exist" 1073 $echo "$modename: link input file \`$save_arg' does not exist"
1056 exit 1 1074 exit 1
1057 fi 1075 fi
1058 arg=$save_arg 1076 arg=$save_arg
1059 prev= 1077 prev=
1060 continue 1078 continue
1061 ;; 1079 ;;
1062 rpath | xrpath) 1080 rpath | xrpath)
1063 # We need an absolute path. 1081 # We need an absolute path.
1101 eval "$prev=\"\$arg\"" 1119 eval "$prev=\"\$arg\""
1102 prev= 1120 prev=
1103 continue 1121 continue
1104 ;; 1122 ;;
1105 esac 1123 esac
1106 fi 1124 fi # test -n "$prev"
1107 1125
1108 prevarg="$arg" 1126 prevarg="$arg"
1109 1127
1110 case $arg in 1128 case $arg in
1111 -all-static) 1129 -all-static)
1142 continue 1160 continue
1143 ;; 1161 ;;
1144 1162
1145 -export-symbols | -export-symbols-regex) 1163 -export-symbols | -export-symbols-regex)
1146 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then 1164 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1147 $echo "$modename: not more than one -exported-symbols argument allowed" 1165 $echo "$modename: more than one -exported-symbols argument is not allowed"
1148 exit 1 1166 exit 1
1149 fi 1167 fi
1150 if test "X$arg" = "X-export-symbols"; then 1168 if test "X$arg" = "X-export-symbols"; then
1151 prev=expsyms 1169 prev=expsyms
1152 else 1170 else
1157 1175
1158 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* 1176 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1159 # so, if we see these flags be careful not to treat them like -L 1177 # so, if we see these flags be careful not to treat them like -L
1160 -L[A-Z][A-Z]*:*) 1178 -L[A-Z][A-Z]*:*)
1161 case $with_gcc/$host in 1179 case $with_gcc/$host in
1162 no/*-*-irix*) 1180 no/*-*-irix* | /*-*-irix*)
1163 compile_command="$compile_command $arg" 1181 compile_command="$compile_command $arg"
1164 finalize_command="$finalize_command $arg" 1182 finalize_command="$finalize_command $arg"
1165 ;; 1183 ;;
1166 esac 1184 esac
1167 continue 1185 continue
1168 ;; 1186 ;;
1169 1187
1170 -L*) 1188 -L*)
1171 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` 1189 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1172 # We need an absolute path. 1190 # We need an absolute path.
1173 case $dir in 1191 case $dir in
1174 [\\/]* | [A-Za-z]:[\\/]*) ;; 1192 [\\/]* | [A-Za-z]:[\\/]*) ;;
1198 esac 1216 esac
1199 continue 1217 continue
1200 ;; 1218 ;;
1201 1219
1202 -l*) 1220 -l*)
1203 if test "$arg" = "-lc"; then 1221 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1204 case $host in 1222 case $host in
1205 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) 1223 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1206 # These systems don't actually have c library (as such) 1224 # These systems don't actually have a C or math library (as such)
1207 continue 1225 continue
1208 ;; 1226 ;;
1227 *-*-mingw* | *-*-os2*)
1228 # These systems don't actually have a C library (as such)
1229 test "X$arg" = "X-lc" && continue
1230 ;;
1231 *-*-openbsd* | *-*-freebsd*)
1232 # Do not include libc due to us having libc/libc_r.
1233 test "X$arg" = "X-lc" && continue
1234 ;;
1209 *-*-rhapsody* | *-*-darwin1.[012]) 1235 *-*-rhapsody* | *-*-darwin1.[012])
1210 # Rhapsody C library is in the System framework 1236 # Rhapsody C and math libraries are in the System framework
1211 deplibs="$deplibs -framework System" 1237 deplibs="$deplibs -framework System"
1212 continue 1238 continue
1213 ;;
1214 esac 1239 esac
1215 elif test "$arg" = "-lm"; then 1240 elif test "X$arg" = "X-lc_r"; then
1216 case $host in 1241 case $host in
1217 *-*-cygwin* | *-*-pw32* | *-*-beos*) 1242 *-*-openbsd* | *-*-freebsd*)
1218 # These systems don't actually have math library (as such) 1243 # Do not include libc_r directly, use -pthread flag.
1219 continue 1244 continue
1220 ;; 1245 ;;
1221 *-*-rhapsody* | *-*-darwin1.[012]) 1246 esac
1222 # Rhapsody math library is in the System framework
1223 deplibs="$deplibs -framework System"
1224 continue
1225 ;;
1226 esac
1227 fi 1247 fi
1228 deplibs="$deplibs $arg" 1248 deplibs="$deplibs $arg"
1229 continue 1249 continue
1230 ;; 1250 ;;
1231 1251
1246 # in order for the loader to find any dlls it needs. 1266 # in order for the loader to find any dlls it needs.
1247 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 1267 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1248 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 1268 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1249 fast_install=no 1269 fast_install=no
1250 ;; 1270 ;;
1251 *) 1271 *) no_install=yes ;;
1252 no_install=yes
1253 ;;
1254 esac 1272 esac
1255 continue 1273 continue
1256 ;; 1274 ;;
1257 1275
1258 -no-undefined) 1276 -no-undefined)
1298 esac 1316 esac
1299 continue 1317 continue
1300 ;; 1318 ;;
1301 1319
1302 -static) 1320 -static)
1303 # The effects of -static are defined in a previous loop. 1321 # The effects of -static are defined in a previous loop.
1304 # We used to do the same as -all-static on platforms that 1322 # We used to do the same as -all-static on platforms that
1305 # didn't have a PIC flag, but the assumption that the effects 1323 # didn't have a PIC flag, but the assumption that the effects
1306 # would be equivalent was wrong. It would break on at least 1324 # would be equivalent was wrong. It would break on at least
1307 # Digital Unix and AIX. 1325 # Digital Unix and AIX.
1308 continue 1326 continue
1319 ;; 1337 ;;
1320 1338
1321 -Wc,*) 1339 -Wc,*)
1322 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` 1340 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1323 arg= 1341 arg=
1324 IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' 1342 save_ifs="$IFS"; IFS=','
1325 for flag in $args; do 1343 for flag in $args; do
1326 IFS="$save_ifs" 1344 IFS="$save_ifs"
1327 case $flag in 1345 case $flag in
1328 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 1346 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1329 flag="\"$flag\"" 1347 flag="\"$flag\""
1337 ;; 1355 ;;
1338 1356
1339 -Wl,*) 1357 -Wl,*)
1340 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` 1358 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1341 arg= 1359 arg=
1342 IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' 1360 save_ifs="$IFS"; IFS=','
1343 for flag in $args; do 1361 for flag in $args; do
1344 IFS="$save_ifs" 1362 IFS="$save_ifs"
1345 case $flag in 1363 case $flag in
1346 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 1364 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1347 flag="\"$flag\"" 1365 flag="\"$flag\""
1385 1403
1386 *.lo) 1404 *.lo)
1387 # A libtool-controlled object. 1405 # A libtool-controlled object.
1388 1406
1389 # Check to see that this really is a libtool object. 1407 # Check to see that this really is a libtool object.
1390 if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 1408 if (${SED} -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1391 pic_object= 1409 pic_object=
1392 non_pic_object= 1410 non_pic_object=
1393 1411
1394 # Read the .lo file 1412 # Read the .lo file
1395 # If there is no directory component, then add one. 1413 # If there is no directory component, then add one.
1396 case $arg in 1414 case $arg in
1397 */* | *\\*) . $arg ;; 1415 */* | *\\*) . $arg ;;
1398 *) . ./$arg ;; 1416 *) . ./$arg ;;
1399 esac 1417 esac
1400 1418
1401 if test -z "$pic_object" || \ 1419 if test -z "$pic_object" || \
1402 test -z "$non_pic_object" || 1420 test -z "$non_pic_object" ||
1403 test "$pic_object" = none && \ 1421 test "$pic_object" = none && \
1404 test "$non_pic_object" = none; then 1422 test "$non_pic_object" = none; then
1405 $echo "$modename: cannot find name of object for \`$arg'" 1>&2 1423 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1406 exit 1 1424 exit 1
1407 fi 1425 fi
1408 1426
1409 # Extract subdirectory from the argument. 1427 # Extract subdirectory from the argument.
1410 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` 1428 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1411 if test "X$xdir" = "X$arg"; then 1429 if test "X$xdir" = "X$arg"; then
1412 xdir= 1430 xdir=
1413 else 1431 else
1414 xdir="$xdir/" 1432 xdir="$xdir/"
1415 fi 1433 fi
1416 1434
1417 if test "$pic_object" != none; then 1435 if test "$pic_object" != none; then
1418 # Prepend the subdirectory the object is found in. 1436 # Prepend the subdirectory the object is found in.
1419 pic_object="$xdir$pic_object" 1437 pic_object="$xdir$pic_object"
1420 1438
1421 if test "$prev" = dlfiles; then 1439 if test "$prev" = dlfiles; then
1422 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then 1440 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1423 dlfiles="$dlfiles $pic_object" 1441 dlfiles="$dlfiles $pic_object"
1424 prev= 1442 prev=
1425 continue 1443 continue
1426 else 1444 else
1427 # If libtool objects are unsupported, then we need to preload. 1445 # If libtool objects are unsupported, then we need to preload.
1428 prev=dlprefiles 1446 prev=dlprefiles
1429 fi 1447 fi
1430 fi 1448 fi
1431 1449
1432 # CHECK ME: I think I busted this. -Ossama 1450 # CHECK ME: I think I busted this. -Ossama
1433 if test "$prev" = dlprefiles; then 1451 if test "$prev" = dlprefiles; then
1434 # Preload the old-style object. 1452 # Preload the old-style object.
1435 dlprefiles="$dlprefiles $pic_object" 1453 dlprefiles="$dlprefiles $pic_object"
1436 prev= 1454 prev=
1437 fi 1455 fi
1438 1456
1439 # A PIC object. 1457 # A PIC object.
1440 libobjs="$libobjs $pic_object" 1458 libobjs="$libobjs $pic_object"
1441 arg="$pic_object" 1459 arg="$pic_object"
1442 fi 1460 fi
1443 1461
1444 # Non-PIC object. 1462 # Non-PIC object.
1445 if test "$non_pic_object" != none; then 1463 if test "$non_pic_object" != none; then
1446 # Prepend the subdirectory the object is found in. 1464 # Prepend the subdirectory the object is found in.
1447 non_pic_object="$xdir$non_pic_object" 1465 non_pic_object="$xdir$non_pic_object"
1448 1466
1449 # A standard non-PIC object 1467 # A standard non-PIC object
1450 non_pic_objects="$non_pic_objects $non_pic_object" 1468 non_pic_objects="$non_pic_objects $non_pic_object"
1451 if test -z "$pic_object" || test "$pic_object" = none ; then 1469 if test -z "$pic_object" || test "$pic_object" = none ; then
1452 arg="$non_pic_object" 1470 arg="$non_pic_object"
1453 fi 1471 fi
1454 fi 1472 fi
1455 else 1473 else
1456 # Only an error if not doing a dry-run. 1474 # Only an error if not doing a dry-run.
1457 if test -z "$run"; then 1475 if test -z "$run"; then
1458 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 1476 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1459 exit 1 1477 exit 1
1460 else 1478 else
1461 # Dry-run case. 1479 # Dry-run case.
1462 1480
1463 # Extract subdirectory from the argument. 1481 # Extract subdirectory from the argument.
1464 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` 1482 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1465 if test "X$xdir" = "X$arg"; then 1483 if test "X$xdir" = "X$arg"; then
1466 xdir= 1484 xdir=
1467 else 1485 else
1468 xdir="$xdir/" 1486 xdir="$xdir/"
1469 fi 1487 fi
1470 1488
1471 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` 1489 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1472 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` 1490 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1473 libobjs="$libobjs $pic_object" 1491 libobjs="$libobjs $pic_object"
1474 non_pic_objects="$non_pic_objects $non_pic_object" 1492 non_pic_objects="$non_pic_objects $non_pic_object"
1475 fi 1493 fi
1476 fi 1494 fi
1477 ;; 1495 ;;
1478 1496
1479 *.$libext) 1497 *.$libext)
1480 # An archive. 1498 # An archive.
1510 arg="\"$arg\"" 1528 arg="\"$arg\""
1511 ;; 1529 ;;
1512 esac 1530 esac
1513 add_flags="$add_flags $arg" 1531 add_flags="$add_flags $arg"
1514 ;; 1532 ;;
1515 esac 1533 esac # arg
1516 1534
1517 # Now actually substitute the argument into the commands. 1535 # Now actually substitute the argument into the commands.
1518 if test -n "$arg"; then 1536 if test -n "$arg"; then
1519 compile_command="$compile_command $arg" 1537 compile_command="$compile_command $arg"
1520 finalize_command="$finalize_command $arg" 1538 finalize_command="$finalize_command $arg"
1521 fi 1539 fi
1522 done 1540 done # argument parsing loop
1523 1541
1524 if test -n "$prev"; then 1542 if test -n "$prev"; then
1525 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 1543 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1526 $echo "$help" 1>&2 1544 $echo "$help" 1>&2
1527 exit 1 1545 exit 1
1536 "$CC "*) ;; 1554 "$CC "*) ;;
1537 # Blanks in the command may have been stripped by the calling shell, 1555 # Blanks in the command may have been stripped by the calling shell,
1538 # but not from the CC environment variable when ltconfig was run. 1556 # but not from the CC environment variable when ltconfig was run.
1539 "`$echo $CC` "*) ;; 1557 "`$echo $CC` "*) ;;
1540 *) 1558 *)
1541 for z in $available_tags; do 1559 for z in $available_tags; do
1542 if grep "^### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then 1560 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
1543 # Evaluate the configuration. 1561 # Evaluate the configuration.
1544 eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`" 1562 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
1545 case $base_compile in 1563 case $base_compile in
1546 "$CC "*) 1564 "$CC "*)
1547 # The compiler in $compile_command matches 1565 # The compiler in $compile_command matches
1548 # the one in the tagged configuration. 1566 # the one in the tagged configuration.
1549 # Assume this is the tagged configuration we want. 1567 # Assume this is the tagged configuration we want.
1550 tagname=$z 1568 tagname=$z
1551 break 1569 break
1552 ;; 1570 ;;
1553 "`$echo $CC` "*) 1571 "`$echo $CC` "*)
1554 tagname=$z 1572 tagname=$z
1555 break 1573 break
1556 ;; 1574 ;;
1557 esac 1575 esac
1558 fi 1576 fi
1559 done 1577 done
1560 # If $tagname still isn't set, then no tagged configuration 1578 # If $tagname still isn't set, then no tagged configuration
1561 # was found and let the user know that the "--tag" command 1579 # was found and let the user know that the "--tag" command
1562 # line option must be used. 1580 # line option must be used.
1563 if test -z "$tagname"; then 1581 if test -z "$tagname"; then
1564 echo "$modename: unable to infer tagged configuration" 1582 echo "$modename: unable to infer tagged configuration"
1565 echo "$modename: specify a tag with \`--tag'" 1>&2 1583 echo "$modename: specify a tag with \`--tag'" 1>&2
1566 exit 1 1584 exit 1
1567 # else 1585 # else
1568 # echo "$modename: using $tagname tagged configuration" 1586 # echo "$modename: using $tagname tagged configuration"
1569 fi 1587 fi
1570 ;; 1588 ;;
1571 esac 1589 esac
1572 fi 1590 fi
1573 1591
1574 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then 1592 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1596 output_objdir="$objdir" 1614 output_objdir="$objdir"
1597 else 1615 else
1598 output_objdir="$output_objdir/$objdir" 1616 output_objdir="$output_objdir/$objdir"
1599 fi 1617 fi
1600 # Create the object directory. 1618 # Create the object directory.
1601 if test ! -d $output_objdir; then 1619 if test ! -d "$output_objdir"; then
1602 $show "$mkdir $output_objdir" 1620 $show "$mkdir $output_objdir"
1603 $run $mkdir $output_objdir 1621 $run $mkdir $output_objdir
1604 status=$? 1622 status=$?
1605 if test $status -ne 0 && test ! -d $output_objdir; then 1623 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1606 exit $status 1624 exit $status
1607 fi 1625 fi
1608 fi 1626 fi
1609 1627
1610 # Determine the type of output 1628 # Determine the type of output
1623 specialdeplibs= 1641 specialdeplibs=
1624 libs= 1642 libs=
1625 # Find all interdependent deplibs by searching for libraries 1643 # Find all interdependent deplibs by searching for libraries
1626 # that are linked more than once (e.g. -la -lb -la) 1644 # that are linked more than once (e.g. -la -lb -la)
1627 for deplib in $deplibs; do 1645 for deplib in $deplibs; do
1628 case "$libs " in 1646 if test "X$duplicate_deps" = "Xyes" ; then
1629 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; 1647 case "$libs " in
1630 esac 1648 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1649 esac
1650 fi
1631 libs="$libs $deplib" 1651 libs="$libs $deplib"
1632 done 1652 done
1633 1653
1634 if test $linkmode = lib; then 1654 if test "$linkmode" = lib; then
1635 libs="$predeps $libs $compiler_lib_search_path $postdeps" 1655 libs="$predeps $libs $compiler_lib_search_path $postdeps"
1656
1657 # Compute libraries that are listed more than once in $predeps
1658 # $postdeps and mark them as special (i.e., whose duplicates are
1659 # not to be eliminated).
1660 pre_post_deps=
1661 if test "X$duplicate_deps" = "Xyes" ; then
1662 for pre_post_dep in $predeps $postdeps; do
1663 case "$pre_post_deps " in
1664 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
1665 esac
1666 pre_post_deps="$pre_post_deps $pre_post_dep"
1667 done
1668 fi
1669 pre_post_deps=
1636 fi 1670 fi
1637 1671
1638 deplibs= 1672 deplibs=
1639 newdependency_libs= 1673 newdependency_libs=
1640 newlib_search_path= 1674 newlib_search_path=
1641 need_relink=no # whether we're linking any uninstalled libtool libraries 1675 need_relink=no # whether we're linking any uninstalled libtool libraries
1642 uninst_deplibs= # uninstalled libtool libraries 1676 notinst_deplibs= # not-installed libtool libraries
1643 uninst_path= # paths that contain uninstalled libtool libraries 1677 notinst_path= # paths that contain not-installed libtool libraries
1644 case $linkmode in 1678 case $linkmode in
1645 lib) 1679 lib)
1646 passes="conv link" 1680 passes="conv link"
1647 for file in $dlfiles $dlprefiles; do 1681 for file in $dlfiles $dlprefiles; do
1648 case $file in 1682 case $file in
1660 alldeplibs=no 1694 alldeplibs=no
1661 newdlfiles= 1695 newdlfiles=
1662 newdlprefiles= 1696 newdlprefiles=
1663 passes="conv scan dlopen dlpreopen link" 1697 passes="conv scan dlopen dlpreopen link"
1664 ;; 1698 ;;
1665 *) passes="conv" 1699 *) passes="conv"
1666 ;; 1700 ;;
1667 esac 1701 esac
1668 for pass in $passes; do 1702 for pass in $passes; do
1669 if test "$linkmode,$pass" = "lib,link" || 1703 if test "$linkmode,$pass" = "lib,link" ||
1670 test "$linkmode,$pass" = "prog,scan"; then 1704 test "$linkmode,$pass" = "prog,scan"; then
1671 libs="$deplibs" 1705 libs="$deplibs"
1672 deplibs= 1706 deplibs=
1673 fi 1707 fi
1674 if test $linkmode = prog; then 1708 if test "$linkmode" = prog; then
1675 case $pass in 1709 case $pass in
1676 dlopen) libs="$dlfiles" ;; 1710 dlopen) libs="$dlfiles" ;;
1677 dlpreopen) libs="$dlprefiles" ;; 1711 dlpreopen) libs="$dlprefiles" ;;
1678 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; 1712 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1679 esac 1713 esac
1680 fi 1714 fi
1681 if test $pass = dlopen; then 1715 if test "$pass" = dlopen; then
1682 # Collect dlpreopened libraries 1716 # Collect dlpreopened libraries
1683 save_deplibs="$deplibs" 1717 save_deplibs="$deplibs"
1684 deplibs= 1718 deplibs=
1685 fi 1719 fi
1686 for deplib in $libs; do 1720 for deplib in $libs; do
1687 lib= 1721 lib=
1688 found=no 1722 found=no
1689 case $deplib in 1723 case $deplib in
1690 -l*) 1724 -l*)
1691 if test $linkmode != lib && test $linkmode != prog; then 1725 if test "$linkmode" != lib && test "$linkmode" != prog; then
1692 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 1726 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1693 continue 1727 continue
1694 fi 1728 fi
1695 if test $pass = conv; then 1729 if test "$pass" = conv && test "$allow_undefined" = yes; then
1696 deplibs="$deplib $deplibs" 1730 deplibs="$deplib $deplibs"
1697 continue 1731 continue
1698 fi 1732 fi
1699 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` 1733 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1700 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do 1734 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1704 found=yes 1738 found=yes
1705 break 1739 break
1706 fi 1740 fi
1707 done 1741 done
1708 if test "$found" != yes; then 1742 if test "$found" != yes; then
1743 # deplib doesn't seem to be a libtool library
1709 if test "$linkmode,$pass" = "prog,link"; then 1744 if test "$linkmode,$pass" = "prog,link"; then
1710 compile_deplibs="$deplib $compile_deplibs" 1745 compile_deplibs="$deplib $compile_deplibs"
1711 finalize_deplibs="$deplib $finalize_deplibs" 1746 finalize_deplibs="$deplib $finalize_deplibs"
1712 else 1747 else
1713 deplibs="$deplib $deplibs" 1748 deplibs="$deplib $deplibs"
1714 test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs" 1749 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1715 fi 1750 fi
1716 continue 1751 continue
1717 fi 1752 fi
1718 ;; 1753 ;; # -l
1719 -L*) 1754 -L*)
1720 case $linkmode in 1755 case $linkmode in
1721 lib) 1756 lib)
1722 deplibs="$deplib $deplibs" 1757 deplibs="$deplib $deplibs"
1723 test $pass = conv && continue 1758 test "$pass" = conv && continue
1724 newdependency_libs="$deplib $newdependency_libs" 1759 newdependency_libs="$deplib $newdependency_libs"
1725 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` 1760 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1726 ;; 1761 ;;
1727 prog) 1762 prog)
1728 if test $pass = conv; then 1763 if test "$pass" = conv; then
1729 deplibs="$deplib $deplibs" 1764 deplibs="$deplib $deplibs"
1730 continue 1765 continue
1731 fi 1766 fi
1732 if test $pass = scan; then 1767 if test "$pass" = scan; then
1733 deplibs="$deplib $deplibs" 1768 deplibs="$deplib $deplibs"
1734 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` 1769 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1735 else 1770 else
1736 compile_deplibs="$deplib $compile_deplibs" 1771 compile_deplibs="$deplib $compile_deplibs"
1737 finalize_deplibs="$deplib $finalize_deplibs" 1772 finalize_deplibs="$deplib $finalize_deplibs"
1738 fi 1773 fi
1739 ;; 1774 ;;
1740 *) 1775 *)
1741 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 1776 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1742 ;; 1777 ;;
1743 esac 1778 esac # linkmode
1744 continue 1779 continue
1745 ;; 1780 ;; # -L
1746 -R*) 1781 -R*)
1747 if test $pass = link; then 1782 if test "$pass" = link; then
1748 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` 1783 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1749 # Make sure the xrpath contains only unique directories. 1784 # Make sure the xrpath contains only unique directories.
1750 case "$xrpath " in 1785 case "$xrpath " in
1751 *" $dir "*) ;; 1786 *" $dir "*) ;;
1752 *) xrpath="$xrpath $dir" ;; 1787 *) xrpath="$xrpath $dir" ;;
1755 deplibs="$deplib $deplibs" 1790 deplibs="$deplib $deplibs"
1756 continue 1791 continue
1757 ;; 1792 ;;
1758 *.la) lib="$deplib" ;; 1793 *.la) lib="$deplib" ;;
1759 *.$libext) 1794 *.$libext)
1760 if test $pass = conv; then 1795 if test "$pass" = conv; then
1761 deplibs="$deplib $deplibs" 1796 deplibs="$deplib $deplibs"
1762 continue 1797 continue
1763 fi 1798 fi
1764 case $linkmode in 1799 case $linkmode in
1765 lib) 1800 lib)
1766 if test "$deplibs_check_method" != pass_all; then 1801 if test "$deplibs_check_method" != pass_all; then
1767 echo 1802 echo
1768 echo "*** Warning: This library needs some functionality provided by $deplib." 1803 echo "*** Warning: Trying to link with static lib archive $deplib."
1769 echo "*** I have the capability to make that library automatically link in when" 1804 echo "*** I have the capability to make that library automatically link in when"
1770 echo "*** you link to this library. But I can only do this if you have a" 1805 echo "*** you link to this library. But I can only do this if you have a"
1771 echo "*** shared version of the library, which you do not appear to have." 1806 echo "*** shared version of the library, which you do not appear to have"
1807 echo "*** because the file extensions .$libext of this argument makes me believe"
1808 echo "*** that it is just a static archive that I should not used here."
1772 else 1809 else
1773 echo 1810 echo
1774 echo "*** Warning: Linking the shared library $output against the" 1811 echo "*** Warning: Linking the shared library $output against the"
1775 echo "*** static library $deplib is not portable!" 1812 echo "*** static library $deplib is not portable!"
1776 deplibs="$deplib $deplibs" 1813 deplibs="$deplib $deplibs"
1777 fi 1814 fi
1778 continue 1815 continue
1779 ;; 1816 ;;
1780 prog) 1817 prog)
1781 if test $pass != link; then 1818 if test "$pass" != link; then
1782 deplibs="$deplib $deplibs" 1819 deplibs="$deplib $deplibs"
1783 else 1820 else
1784 compile_deplibs="$deplib $compile_deplibs" 1821 compile_deplibs="$deplib $compile_deplibs"
1785 finalize_deplibs="$deplib $finalize_deplibs" 1822 finalize_deplibs="$deplib $finalize_deplibs"
1786 fi 1823 fi
1787 continue 1824 continue
1788 ;; 1825 ;;
1789 esac 1826 esac # linkmode
1790 ;; 1827 ;; # *.$libext
1791 *.lo | *.$objext) 1828 *.lo | *.$objext)
1792 if test $pass = conv; then 1829 if test "$pass" = conv; then
1793 deplibs="$deplib $deplibs" 1830 deplibs="$deplib $deplibs"
1794 elif test $linkmode = prog; then 1831 elif test "$linkmode" = prog; then
1795 if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then 1832 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1796 # If there is no dlopen support or we're linking statically, 1833 # If there is no dlopen support or we're linking statically,
1797 # we need to preload. 1834 # we need to preload.
1798 newdlprefiles="$newdlprefiles $deplib" 1835 newdlprefiles="$newdlprefiles $deplib"
1799 compile_deplibs="$deplib $compile_deplibs" 1836 compile_deplibs="$deplib $compile_deplibs"
1800 finalize_deplibs="$deplib $finalize_deplibs" 1837 finalize_deplibs="$deplib $finalize_deplibs"
1806 ;; 1843 ;;
1807 %DEPLIBS%) 1844 %DEPLIBS%)
1808 alldeplibs=yes 1845 alldeplibs=yes
1809 continue 1846 continue
1810 ;; 1847 ;;
1811 esac 1848 esac # case $deplib
1812 if test $found = yes || test -f "$lib"; then : 1849 if test "$found" = yes || test -f "$lib"; then :
1813 else 1850 else
1814 $echo "$modename: cannot find the library \`$lib'" 1>&2 1851 $echo "$modename: cannot find the library \`$lib'" 1>&2
1815 exit 1 1852 exit 1
1816 fi 1853 fi
1817 1854
1818 # Check to see that this really is a libtool archive. 1855 # Check to see that this really is a libtool archive.
1819 if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : 1856 if (${SED} -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1820 else 1857 else
1821 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 1858 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1822 exit 1 1859 exit 1
1823 fi 1860 fi
1824 1861
1841 *) . ./$lib ;; 1878 *) . ./$lib ;;
1842 esac 1879 esac
1843 1880
1844 if test "$linkmode,$pass" = "lib,link" || 1881 if test "$linkmode,$pass" = "lib,link" ||
1845 test "$linkmode,$pass" = "prog,scan" || 1882 test "$linkmode,$pass" = "prog,scan" ||
1846 { test $linkmode != prog && test $linkmode != lib; }; then 1883 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
1847 test -n "$dlopen" && dlfiles="$dlfiles $dlopen" 1884 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
1848 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" 1885 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
1849 fi 1886 fi
1850 1887
1851 if test $pass = conv; then 1888 if test "$pass" = conv; then
1852 # only check for convenience libraries 1889 # Only check for convenience libraries
1853 deplibs="$lib $deplibs" 1890 deplibs="$lib $deplibs"
1891 tmp_libs=
1892 for deplib in $dependency_libs; do
1893 #echo "Adding $deplib to \$deplibs"
1894 deplibs="$deplib $deplibs"
1895 if test "X$duplicate_deps" = "Xyes" ; then
1896 case "$tmp_libs " in
1897 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1898 esac
1899 fi
1900 tmp_libs="$tmp_libs $deplib"
1901 done
1854 if test -z "$libdir"; then 1902 if test -z "$libdir"; then
1855 if test -z "$old_library"; then 1903 if test -z "$old_library"; then
1856 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 1904 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1857 exit 1 1905 exit 1
1858 fi 1906 fi
1859 # It is a libtool convenience library, so add in its objects. 1907 # It is a libtool convenience library, so add in its objects.
1860 convenience="$convenience $ladir/$objdir/$old_library" 1908 convenience="$convenience $ladir/$objdir/$old_library"
1861 old_convenience="$old_convenience $ladir/$objdir/$old_library" 1909 old_convenience="$old_convenience $ladir/$objdir/$old_library"
1862 tmp_libs= 1910 elif test "$linkmode" != prog && test "$linkmode" != lib; then
1863 for deplib in $dependency_libs; do
1864 deplibs="$deplib $deplibs"
1865 case "$tmp_libs " in
1866 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1867 esac
1868 tmp_libs="$tmp_libs $deplib"
1869 done
1870 elif test $linkmode != prog && test $linkmode != lib; then
1871 $echo "$modename: \`$lib' is not a convenience library" 1>&2 1911 $echo "$modename: \`$lib' is not a convenience library" 1>&2
1872 exit 1 1912 exit 1
1873 fi 1913 fi
1874 continue 1914 continue
1875 fi 1915 fi # $pass = conv
1876 1916
1877 # Get the name of the library we link against. 1917 # Get the name of the library we link against.
1878 linklib= 1918 linklib=
1879 for l in $old_library $library_names; do 1919 for l in $old_library $library_names; do
1880 linklib="$l" 1920 linklib="$l"
1883 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 1923 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1884 exit 1 1924 exit 1
1885 fi 1925 fi
1886 1926
1887 # This library was specified with -dlopen. 1927 # This library was specified with -dlopen.
1888 if test $pass = dlopen; then 1928 if test "$pass" = dlopen; then
1889 if test -z "$libdir"; then 1929 if test -z "$libdir"; then
1890 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 1930 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
1891 exit 1 1931 exit 1
1892 fi 1932 fi
1893 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then 1933 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1898 dlprefiles="$dlprefiles $lib $dependency_libs" 1938 dlprefiles="$dlprefiles $lib $dependency_libs"
1899 else 1939 else
1900 newdlfiles="$newdlfiles $lib" 1940 newdlfiles="$newdlfiles $lib"
1901 fi 1941 fi
1902 continue 1942 continue
1903 fi 1943 fi # $pass = dlopen
1904 1944
1905 # We need an absolute path. 1945 # We need an absolute path.
1906 case $ladir in 1946 case $ladir in
1907 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; 1947 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
1908 *) 1948 *)
1929 fi 1969 fi
1930 else 1970 else
1931 dir="$ladir/$objdir" 1971 dir="$ladir/$objdir"
1932 absdir="$abs_ladir/$objdir" 1972 absdir="$abs_ladir/$objdir"
1933 # Remove this search path later 1973 # Remove this search path later
1934 uninst_path="$uninst_path $abs_ladir" 1974 notinst_path="$notinst_path $abs_ladir"
1935 fi 1975 fi # $installed = yes
1936 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` 1976 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1937 1977
1938 # This library was specified with -dlpreopen. 1978 # This library was specified with -dlpreopen.
1939 if test $pass = dlpreopen; then 1979 if test "$pass" = dlpreopen; then
1940 if test -z "$libdir"; then 1980 if test -z "$libdir"; then
1941 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 1981 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
1942 exit 1 1982 exit 1
1943 fi 1983 fi
1944 # Prefer using a static library (so that no silly _DYNAMIC symbols 1984 # Prefer using a static library (so that no silly _DYNAMIC symbols
1949 elif test -n "$dlname"; then 1989 elif test -n "$dlname"; then
1950 newdlprefiles="$newdlprefiles $dir/$dlname" 1990 newdlprefiles="$newdlprefiles $dir/$dlname"
1951 else 1991 else
1952 newdlprefiles="$newdlprefiles $dir/$linklib" 1992 newdlprefiles="$newdlprefiles $dir/$linklib"
1953 fi 1993 fi
1954 fi 1994 fi # $pass = dlpreopen
1955 1995
1956 if test -z "$libdir"; then 1996 if test -z "$libdir"; then
1957 # link the convenience library 1997 # Link the convenience library
1958 if test $linkmode = lib; then 1998 if test "$linkmode" = lib; then
1959 deplibs="$dir/$old_library $deplibs" 1999 deplibs="$dir/$old_library $deplibs"
1960 elif test "$linkmode,$pass" = "prog,link"; then 2000 elif test "$linkmode,$pass" = "prog,link"; then
1961 compile_deplibs="$dir/$old_library $compile_deplibs" 2001 compile_deplibs="$dir/$old_library $compile_deplibs"
1962 finalize_deplibs="$dir/$old_library $finalize_deplibs" 2002 finalize_deplibs="$dir/$old_library $finalize_deplibs"
1963 else 2003 else
1964 deplibs="$lib $deplibs" # used for prog,scan pass 2004 deplibs="$lib $deplibs" # used for prog,scan pass
1965 fi 2005 fi
1966 continue 2006 continue
1967 fi 2007 fi
1968 2008
1969 if test $linkmode = prog && test $pass != link; then 2009 if test "$linkmode" = prog && test "$pass" != link; then
1970 newlib_search_path="$newlib_search_path $ladir" 2010 newlib_search_path="$newlib_search_path $ladir"
1971 deplibs="$lib $deplibs" 2011 deplibs="$lib $deplibs"
1972 2012
1973 linkalldeplibs=no 2013 linkalldeplibs=no
1974 if test "$link_all_deplibs" != no || test -z "$library_names" || 2014 if test "$link_all_deplibs" != no || test -z "$library_names" ||
1980 for deplib in $dependency_libs; do 2020 for deplib in $dependency_libs; do
1981 case $deplib in 2021 case $deplib in
1982 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test 2022 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
1983 esac 2023 esac
1984 # Need to link against all dependency_libs? 2024 # Need to link against all dependency_libs?
1985 if test $linkalldeplibs = yes; then 2025 if test "$linkalldeplibs" = yes; then
1986 deplibs="$deplib $deplibs" 2026 deplibs="$deplib $deplibs"
1987 else 2027 else
1988 # Need to hardcode shared library paths 2028 # Need to hardcode shared library paths
1989 # or/and link against static libraries 2029 # or/and link against static libraries
1990 newdependency_libs="$deplib $newdependency_libs" 2030 newdependency_libs="$deplib $newdependency_libs"
1991 fi 2031 fi
1992 case "$tmp_libs " in 2032 if test "X$duplicate_deps" = "Xyes" ; then
1993 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; 2033 case "$tmp_libs " in
1994 esac 2034 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2035 esac
2036 fi
1995 tmp_libs="$tmp_libs $deplib" 2037 tmp_libs="$tmp_libs $deplib"
1996 done 2038 done # for deplib
1997 continue 2039 continue
1998 fi 2040 fi # $linkmode = prog...
1999 2041
2000 if test "$linkmode,$pass" = "prog,link"; then 2042 if test "$linkmode,$pass" = "prog,link"; then
2001 if test -n "$library_names" && 2043 if test -n "$library_names" &&
2002 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then 2044 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2003 # We need to hardcode the library path 2045 # We need to hardcode the library path
2008 *" $absdir "*) ;; 2050 *" $absdir "*) ;;
2009 *) temp_rpath="$temp_rpath $dir" ;; 2051 *) temp_rpath="$temp_rpath $dir" ;;
2010 esac 2052 esac
2011 fi 2053 fi
2012 2054
2013 # Hardcode the library path.
2014 # Skip directories that are in the system default run-time
2015 # search path.
2016 case " $sys_lib_dlsearch_path " in
2017 *" $absdir "*) ;;
2018 *)
2019 case "$compile_rpath " in
2020 *" $absdir "*) ;;
2021 *) compile_rpath="$compile_rpath $absdir"
2022 esac
2023 ;;
2024 esac
2025
2026 case " $sys_lib_dlsearch_path " in
2027 *" $libdir "*) ;;
2028 *)
2029 case "$finalize_rpath " in
2030 *" $libdir "*) ;;
2031 *) finalize_rpath="$finalize_rpath $libdir"
2032 esac
2033 ;;
2034 esac
2035 fi
2036
2037 if test "$alldeplibs" = yes &&
2038 { test "$deplibs_check_method" = pass_all ||
2039 { test "$build_libtool_libs" = yes &&
2040 test -n "$library_names"; }; }; then
2041 # We only need to search for static libraries
2042 continue
2043 fi
2044 fi
2045
2046 link_static=no # Whether the deplib will be linked statically
2047 if test -n "$library_names" &&
2048 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2049 if test "$installed" = no; then
2050 uninst_deplibs="$uninst_deplibs $lib"
2051 need_relink=yes
2052 fi
2053 # This is a shared library
2054 if test $linkmode = lib && test "$hardcode_into_libs" = all; then
2055 # Hardcode the library path. 2055 # Hardcode the library path.
2056 # Skip directories that are in the system default run-time 2056 # Skip directories that are in the system default run-time
2057 # search path. 2057 # search path.
2058 case " $sys_lib_dlsearch_path " in 2058 case " $sys_lib_dlsearch_path " in
2059 *" $absdir "*) ;; 2059 *" $absdir "*) ;;
2071 *" $libdir "*) ;; 2071 *" $libdir "*) ;;
2072 *) finalize_rpath="$finalize_rpath $libdir" 2072 *) finalize_rpath="$finalize_rpath $libdir"
2073 esac 2073 esac
2074 ;; 2074 ;;
2075 esac 2075 esac
2076 fi # $linkmode,$pass = prog,link...
2077
2078 if test "$alldeplibs" = yes &&
2079 { test "$deplibs_check_method" = pass_all ||
2080 { test "$build_libtool_libs" = yes &&
2081 test -n "$library_names"; }; }; then
2082 # We only need to search for static libraries
2083 continue
2084 fi
2085 fi
2086
2087 link_static=no # Whether the deplib will be linked statically
2088 if test -n "$library_names" &&
2089 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2090 if test "$installed" = no; then
2091 notinst_deplibs="$notinst_deplibs $lib"
2092 need_relink=yes
2093 fi
2094 # This is a shared library
2095 if test "$linkmode" = lib &&
2096 test "$hardcode_into_libs" = yes; then
2097 # Hardcode the library path.
2098 # Skip directories that are in the system default run-time
2099 # search path.
2100 case " $sys_lib_dlsearch_path " in
2101 *" $absdir "*) ;;
2102 *)
2103 case "$compile_rpath " in
2104 *" $absdir "*) ;;
2105 *) compile_rpath="$compile_rpath $absdir"
2106 esac
2107 ;;
2108 esac
2109 case " $sys_lib_dlsearch_path " in
2110 *" $libdir "*) ;;
2111 *)
2112 case "$finalize_rpath " in
2113 *" $libdir "*) ;;
2114 *) finalize_rpath="$finalize_rpath $libdir"
2115 esac
2116 ;;
2117 esac
2076 fi 2118 fi
2077 2119
2078 if test -n "$old_archive_from_expsyms_cmds"; then 2120 if test -n "$old_archive_from_expsyms_cmds"; then
2079 # figure out the soname 2121 # figure out the soname
2080 set dummy $library_names 2122 set dummy $library_names
2097 soname="$realname" 2139 soname="$realname"
2098 fi 2140 fi
2099 2141
2100 # Make a new name for the extract_expsyms_cmds to use 2142 # Make a new name for the extract_expsyms_cmds to use
2101 soroot="$soname" 2143 soroot="$soname"
2102 soname=`echo $soroot | sed -e 's/^.*\///'` 2144 soname=`echo $soroot | ${SED} -e 's/^.*\///'`
2103 newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a" 2145 newlib="libimp-`echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2104 2146
2105 # If the library has no export list, then create one now 2147 # If the library has no export list, then create one now
2106 if test -f "$output_objdir/$soname-def"; then : 2148 if test -f "$output_objdir/$soname-def"; then :
2107 else 2149 else
2108 $show "extracting exported symbol list from \`$soname'" 2150 $show "extracting exported symbol list from \`$soname'"
2109 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' 2151 save_ifs="$IFS"; IFS='~'
2110 eval cmds=\"$extract_expsyms_cmds\" 2152 eval cmds=\"$extract_expsyms_cmds\"
2111 for cmd in $cmds; do 2153 for cmd in $cmds; do
2112 IFS="$save_ifs" 2154 IFS="$save_ifs"
2113 $show "$cmd" 2155 $show "$cmd"
2114 $run eval "$cmd" || exit $? 2156 $run eval "$cmd" || exit $?
2117 fi 2159 fi
2118 2160
2119 # Create $newlib 2161 # Create $newlib
2120 if test -f "$output_objdir/$newlib"; then :; else 2162 if test -f "$output_objdir/$newlib"; then :; else
2121 $show "generating import library for \`$soname'" 2163 $show "generating import library for \`$soname'"
2122 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' 2164 save_ifs="$IFS"; IFS='~'
2123 eval cmds=\"$old_archive_from_expsyms_cmds\" 2165 eval cmds=\"$old_archive_from_expsyms_cmds\"
2124 for cmd in $cmds; do 2166 for cmd in $cmds; do
2125 IFS="$save_ifs" 2167 IFS="$save_ifs"
2126 $show "$cmd" 2168 $show "$cmd"
2127 $run eval "$cmd" || exit $? 2169 $run eval "$cmd" || exit $?
2129 IFS="$save_ifs" 2171 IFS="$save_ifs"
2130 fi 2172 fi
2131 # make sure the library variables are pointing to the new library 2173 # make sure the library variables are pointing to the new library
2132 dir=$output_objdir 2174 dir=$output_objdir
2133 linklib=$newlib 2175 linklib=$newlib
2134 fi 2176 fi # test -n "$old_archive_from_expsyms_cmds"
2135 2177
2136 if test $linkmode = prog || test "$mode" != relink; then 2178 if test "$linkmode" = prog || test "$mode" != relink; then
2137 add_shlibpath= 2179 add_shlibpath=
2138 add_dir= 2180 add_dir=
2139 add= 2181 add=
2140 lib_linked=yes 2182 lib_linked=yes
2141 case $hardcode_action in 2183 case $hardcode_action in
2180 case :$compile_shlibpath: in 2222 case :$compile_shlibpath: in
2181 *":$add_shlibpath:"*) ;; 2223 *":$add_shlibpath:"*) ;;
2182 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; 2224 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2183 esac 2225 esac
2184 fi 2226 fi
2185 if test $linkmode = prog; then 2227 if test "$linkmode" = prog; then
2186 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" 2228 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2187 test -n "$add" && compile_deplibs="$add $compile_deplibs" 2229 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2188 else 2230 else
2189 test -n "$add_dir" && deplibs="$add_dir $deplibs" 2231 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2190 test -n "$add" && deplibs="$add $deplibs" 2232 test -n "$add" && deplibs="$add $deplibs"
2197 esac 2239 esac
2198 fi 2240 fi
2199 fi 2241 fi
2200 fi 2242 fi
2201 2243
2202 if test $linkmode = prog || test "$mode" = relink; then 2244 if test "$linkmode" = prog || test "$mode" = relink; then
2203 add_shlibpath= 2245 add_shlibpath=
2204 add_dir= 2246 add_dir=
2205 add= 2247 add=
2206 # Finalize command for both is simple: just hardcode it. 2248 # Finalize command for both is simple: just hardcode it.
2207 if test "$hardcode_direct" = yes; then 2249 if test "$hardcode_direct" = yes; then
2219 # We cannot seem to hardcode it, guess we'll fake it. 2261 # We cannot seem to hardcode it, guess we'll fake it.
2220 add_dir="-L$libdir" 2262 add_dir="-L$libdir"
2221 add="-l$name" 2263 add="-l$name"
2222 fi 2264 fi
2223 2265
2224 if test $linkmode = prog; then 2266 if test "$linkmode" = prog; then
2225 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" 2267 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2226 test -n "$add" && finalize_deplibs="$add $finalize_deplibs" 2268 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2227 else 2269 else
2228 test -n "$add_dir" && deplibs="$add_dir $deplibs" 2270 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2229 test -n "$add" && deplibs="$add $deplibs" 2271 test -n "$add" && deplibs="$add $deplibs"
2230 fi 2272 fi
2231 fi 2273 fi
2232 elif test $linkmode = prog; then 2274 elif test "$linkmode" = prog; then
2233 # Here we assume that one of hardcode_direct or hardcode_minus_L 2275 # Here we assume that one of hardcode_direct or hardcode_minus_L
2234 # is not unsupported. This is valid on all known static and 2276 # is not unsupported. This is valid on all known static and
2235 # shared platforms. 2277 # shared platforms.
2236 if test "$hardcode_direct" != unsupported; then 2278 if test "$hardcode_direct" != unsupported; then
2237 test -n "$old_library" && linklib="$old_library" 2279 test -n "$old_library" && linklib="$old_library"
2244 elif test "$build_libtool_libs" = yes; then 2286 elif test "$build_libtool_libs" = yes; then
2245 # Not a shared library 2287 # Not a shared library
2246 if test "$deplibs_check_method" != pass_all; then 2288 if test "$deplibs_check_method" != pass_all; then
2247 # We're trying link a shared library against a static one 2289 # We're trying link a shared library against a static one
2248 # but the system doesn't support it. 2290 # but the system doesn't support it.
2291
2249 # Just print a warning and add the library to dependency_libs so 2292 # Just print a warning and add the library to dependency_libs so
2250 # that the program can be linked against the static library. 2293 # that the program can be linked against the static library.
2251 echo 2294 echo
2252 echo "*** Warning: This library needs some functionality provided by $lib." 2295 echo "*** Warning: This system can not link to static lib archive $lib."
2253 echo "*** I have the capability to make that library automatically link in when" 2296 echo "*** I have the capability to make that library automatically link in when"
2254 echo "*** you link to this library. But I can only do this if you have a" 2297 echo "*** you link to this library. But I can only do this if you have a"
2255 echo "*** shared version of the library, which you do not appear to have." 2298 echo "*** shared version of the library, which you do not appear to have."
2299 if test "$module" = yes; then
2300 echo "*** But as you try to build a module library, libtool will still create "
2301 echo "*** a static module, that should work as long as the dlopening application"
2302 echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2303 if test -z "$global_symbol_pipe"; then
2304 echo
2305 echo "*** However, this would only work if libtool was able to extract symbol"
2306 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2307 echo "*** not find such a program. So, this module is probably useless."
2308 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2309 fi
2310 if test "$build_old_libs" = no; then
2311 build_libtool_libs=module
2312 build_old_libs=yes
2313 else
2314 build_libtool_libs=no
2315 fi
2316 fi
2256 else 2317 else
2257 convenience="$convenience $dir/$old_library" 2318 convenience="$convenience $dir/$old_library"
2258 old_convenience="$old_convenience $dir/$old_library" 2319 old_convenience="$old_convenience $dir/$old_library"
2259 deplibs="$dir/$old_library $deplibs" 2320 deplibs="$dir/$old_library $deplibs"
2260 link_static=yes 2321 link_static=yes
2261 fi 2322 fi
2262 fi 2323 fi # link shared/static library?
2263 2324
2264 if test $linkmode = lib; then 2325 if test "$linkmode" = lib; then
2265 if test -n "$dependency_libs" && 2326 #if test -n "$dependency_libs" &&
2266 { test $hardcode_into_libs != yes || test $build_old_libs = yes || 2327 # { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
2267 test $link_static = yes; }; then 2328 # test "$link_static" = yes; }; then
2268 # Extract -R from dependency_libs 2329 # Extract -R from dependency_libs
2269 temp_deplibs= 2330 temp_deplibs=
2270 for libdir in $dependency_libs; do 2331 for libdir in $dependency_libs; do
2271 case $libdir in 2332 case $libdir in
2272 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` 2333 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2276 esac;; 2337 esac;;
2277 *) temp_deplibs="$temp_deplibs $libdir";; 2338 *) temp_deplibs="$temp_deplibs $libdir";;
2278 esac 2339 esac
2279 done 2340 done
2280 dependency_libs="$temp_deplibs" 2341 dependency_libs="$temp_deplibs"
2281 fi 2342 #fi
2282 2343
2283 newlib_search_path="$newlib_search_path $absdir" 2344 newlib_search_path="$newlib_search_path $absdir"
2284 # Link against this library 2345 # Link against this library
2285 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" 2346 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2286 # ... and its dependency_libs 2347 # ... and its dependency_libs
2287 tmp_libs= 2348 tmp_libs=
2288 for deplib in $dependency_libs; do 2349 for deplib in $dependency_libs; do
2289 newdependency_libs="$deplib $newdependency_libs" 2350 newdependency_libs="$deplib $newdependency_libs"
2290 case "$tmp_libs " in 2351 if test "X$duplicate_deps" = "Xyes" ; then
2291 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; 2352 case "$tmp_libs " in
2292 esac 2353 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2354 esac
2355 fi
2293 tmp_libs="$tmp_libs $deplib" 2356 tmp_libs="$tmp_libs $deplib"
2294 done 2357 done
2295 2358
2296 if test $link_all_deplibs != no; then 2359 if test "$link_all_deplibs" != no; then
2297 # Add the search paths of all dependency libraries 2360 # Add the search paths of all dependency libraries
2298 for deplib in $dependency_libs; do 2361 for deplib in $dependency_libs; do
2299 case $deplib in 2362 case $deplib in
2300 -L*) path="$deplib" ;; 2363 -L*) path="$deplib" ;;
2301 *.la) 2364 *.la)
2313 ;; 2376 ;;
2314 esac 2377 esac
2315 if grep "^installed=no" $deplib > /dev/null; then 2378 if grep "^installed=no" $deplib > /dev/null; then
2316 path="-L$absdir/$objdir" 2379 path="-L$absdir/$objdir"
2317 else 2380 else
2318 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` 2381 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2319 if test -z "$libdir"; then 2382 if test -z "$libdir"; then
2320 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 2383 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2321 exit 1 2384 exit 1
2322 fi
2323 if test "$absdir" != "$libdir"; then
2324 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2325 fi 2385 fi
2326 path="-L$absdir" 2386 path="-L$absdir"
2327 fi 2387 fi
2328 ;; 2388 ;;
2329 *) continue ;; 2389 *) continue ;;
2330 esac 2390 esac
2331 case " $deplibs " in 2391 case " $deplibs " in
2332 *" $path "*) ;; 2392 *" $path "*) ;;
2333 *) deplibs="$path $deplibs" ;; 2393 *) deplibs="$deplibs $path" ;;
2334 esac 2394 esac
2335 done 2395 done
2336 fi 2396 fi # link_all_deplibs != no
2337 fi 2397 fi # linkmode = lib
2338 done 2398 done # for deplib in $libs
2339 dependency_libs="$newdependency_libs" 2399 dependency_libs="$newdependency_libs"
2340 if test $pass = dlpreopen; then 2400 if test "$pass" = dlpreopen; then
2341 # Link the dlpreopened libraries before other libraries 2401 # Link the dlpreopened libraries before other libraries
2342 for deplib in $save_deplibs; do 2402 for deplib in $save_deplibs; do
2343 deplibs="$deplib $deplibs" 2403 deplibs="$deplib $deplibs"
2344 done 2404 done
2345 fi 2405 fi
2346 if test $pass != dlopen; then 2406 if test "$pass" != dlopen; then
2347 if test $pass != conv; then 2407 if test "$pass" != conv; then
2348 # Make sure lib_search_path contains only unique directories. 2408 # Make sure lib_search_path contains only unique directories.
2349 lib_search_path= 2409 lib_search_path=
2350 for dir in $newlib_search_path; do 2410 for dir in $newlib_search_path; do
2351 case "$lib_search_path " in 2411 case "$lib_search_path " in
2352 *" $dir "*) ;; 2412 *" $dir "*) ;;
2360 vars="deplibs" 2420 vars="deplibs"
2361 else 2421 else
2362 vars="compile_deplibs finalize_deplibs" 2422 vars="compile_deplibs finalize_deplibs"
2363 fi 2423 fi
2364 for var in $vars dependency_libs; do 2424 for var in $vars dependency_libs; do
2365 # Make sure that $var contains only unique libraries 2425 # Add libraries to $var in reverse order
2366 # and add them in reverse order
2367 eval tmp_libs=\"\$$var\" 2426 eval tmp_libs=\"\$$var\"
2368 new_libs= 2427 new_libs=
2369 for deplib in $tmp_libs; do 2428 for deplib in $tmp_libs; do
2370 case "$deplib" in 2429 # FIXME: Pedantically, this is the right thing to do, so
2430 # that some nasty dependency loop isn't accidentally
2431 # broken:
2432 #new_libs="$deplib $new_libs"
2433 # Pragmatically, this seems to cause very few problems in
2434 # practice:
2435 case $deplib in
2371 -L*) new_libs="$deplib $new_libs" ;; 2436 -L*) new_libs="$deplib $new_libs" ;;
2372 *) 2437 *)
2438 # And here is the reason: when a library appears more
2439 # than once as an explicit dependence of a library, or
2440 # is implicitly linked in more than once by the
2441 # compiler, it is considered special, and multiple
2442 # occurrences thereof are not removed. Compare this
2443 # with having the same library being listed as a
2444 # dependency of multiple other libraries: in this case,
2445 # we know (pedantically, we assume) the library does not
2446 # need to be listed more than once, so we keep only the
2447 # last copy. This is not always right, but it is rare
2448 # enough that we require users that really mean to play
2449 # such unportable linking tricks to link the library
2450 # using -Wl,-lname, so that libtool does not consider it
2451 # for duplicate removal.
2373 case " $specialdeplibs " in 2452 case " $specialdeplibs " in
2374 *" $deplib "*) new_libs="$deplib $new_libs" ;; 2453 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2375 *) 2454 *)
2376 case " $new_libs " in 2455 case " $new_libs " in
2377 *" $deplib "*) ;; 2456 *" $deplib "*) ;;
2389 case " $tmp_libs " in 2468 case " $tmp_libs " in
2390 *" $deplib "*) ;; 2469 *" $deplib "*) ;;
2391 *) tmp_libs="$tmp_libs $deplib" ;; 2470 *) tmp_libs="$tmp_libs $deplib" ;;
2392 esac 2471 esac
2393 ;; 2472 ;;
2473 -R*)
2474 temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2475 case " $xrpath " in
2476 *" $temp_xrpath "*) ;;
2477 *) xrpath="$xrpath $temp_xrpath";;
2478 esac;;
2394 *) tmp_libs="$tmp_libs $deplib" ;; 2479 *) tmp_libs="$tmp_libs $deplib" ;;
2395 esac 2480 esac
2396 done 2481 done
2397 eval $var=\"$tmp_libs\" 2482 eval $var=\"$tmp_libs\"
2398 done 2483 done # for var
2399 fi 2484 fi
2400 done 2485 done # for pass
2401 if test $linkmode = prog; then 2486 if test "$linkmode" = prog; then
2402 dlfiles="$newdlfiles" 2487 dlfiles="$newdlfiles"
2403 dlprefiles="$newdlprefiles" 2488 dlprefiles="$newdlprefiles"
2404 fi 2489 fi
2405 2490
2406 case $linkmode in 2491 case $linkmode in
2477 if test "$dlself" != no; then 2562 if test "$dlself" != no; then
2478 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 2563 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2479 fi 2564 fi
2480 2565
2481 set dummy $rpath 2566 set dummy $rpath
2482 if test $# -gt 2; then 2567 if test "$#" -gt 2; then
2483 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 2568 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2484 fi 2569 fi
2485 install_libdir="$2" 2570 install_libdir="$2"
2486 2571
2487 oldlibs= 2572 oldlibs=
2488 if test -z "$rpath"; then 2573 if test -z "$rpath"; then
2489 if test "$build_libtool_libs" = yes; then 2574 if test "$build_libtool_libs" = yes; then
2490 # Building a libtool convenience library. 2575 # Building a libtool convenience library.
2491 # Some compilers have problems with a `.al' extension so 2576 # Some compilers have problems with a `.al' extension so
2492 # convenience libraries should have the same extension an 2577 # convenience libraries should have the same extension an
2493 # archive normally would. 2578 # archive normally would.
2494 oldlibs="$output_objdir/$libname.$libext $oldlibs" 2579 oldlibs="$output_objdir/$libname.$libext $oldlibs"
2495 build_libtool_libs=convenience 2580 build_libtool_libs=convenience
2496 build_old_libs=yes 2581 build_old_libs=yes
2497 fi 2582 fi
2498 2583
2504 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 2589 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2505 fi 2590 fi
2506 else 2591 else
2507 2592
2508 # Parse the version information argument. 2593 # Parse the version information argument.
2509 IFS="${IFS= }"; save_ifs="$IFS"; IFS=':' 2594 save_ifs="$IFS"; IFS=':'
2510 set dummy $vinfo 0 0 0 2595 set dummy $vinfo 0 0 0
2511 IFS="$save_ifs" 2596 IFS="$save_ifs"
2512 2597
2513 if test -n "$8"; then 2598 if test -n "$8"; then
2514 $echo "$modename: too many parameters to \`-version-info'" 1>&2 2599 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2520 revision="$3" 2605 revision="$3"
2521 age="$4" 2606 age="$4"
2522 2607
2523 # Check that each of the things are valid numbers. 2608 # Check that each of the things are valid numbers.
2524 case $current in 2609 case $current in
2525 0 | [1-9] | [1-9][0-9]*) ;; 2610 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2526 *) 2611 *)
2527 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 2612 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2528 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 2613 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2529 exit 1 2614 exit 1
2530 ;; 2615 ;;
2531 esac 2616 esac
2532 2617
2533 case $revision in 2618 case $revision in
2534 0 | [1-9] | [1-9][0-9]*) ;; 2619 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2535 *) 2620 *)
2536 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 2621 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2537 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 2622 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2538 exit 1 2623 exit 1
2539 ;; 2624 ;;
2540 esac 2625 esac
2541 2626
2542 case $age in 2627 case $age in
2543 0 | [1-9] | [1-9][0-9]*) ;; 2628 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2544 *) 2629 *)
2545 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 2630 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2546 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 2631 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2547 exit 1 2632 exit 1
2548 ;; 2633 ;;
2549 esac 2634 esac
2550 2635
2551 if test $age -gt $current; then 2636 if test "$age" -gt "$current"; then
2552 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 2637 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2553 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 2638 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2554 exit 1 2639 exit 1
2555 fi 2640 fi
2556 2641
2579 freebsd-elf) 2664 freebsd-elf)
2580 major=".$current" 2665 major=".$current"
2581 versuffix=".$current"; 2666 versuffix=".$current";
2582 ;; 2667 ;;
2583 2668
2584 irix) 2669 irix | nonstopux)
2670 case $version_type in
2671 nonstopux) verstring_prefix=nonstopux ;;
2672 *) verstring_prefix=sgi ;;
2673 esac
2674 verstring="$verstring_prefix$major.$revision"
2675
2585 major=`expr $current - $age + 1` 2676 major=`expr $current - $age + 1`
2586 verstring="sgi$major.$revision"
2587 2677
2588 # Add in all the interfaces that we are compatible with. 2678 # Add in all the interfaces that we are compatible with.
2589 loop=$revision 2679 loop=$revision
2590 while test $loop != 0; do 2680 while test "$loop" -ne 0; do
2591 iface=`expr $revision - $loop` 2681 iface=`expr $revision - $loop`
2592 loop=`expr $loop - 1` 2682 loop=`expr $loop - 1`
2593 verstring="sgi$major.$iface:$verstring" 2683 verstring="$verstring_prefix$major.$iface:$verstring"
2594 done 2684 done
2595 2685
2596 # Before this point, $major must not contain `.'. 2686 # Before this point, $major must not contain `.'.
2597 major=.$major 2687 major=.$major
2598 versuffix="$major.$revision" 2688 versuffix="$major.$revision"
2608 versuffix=".$current.$age.$revision" 2698 versuffix=".$current.$age.$revision"
2609 verstring="$current.$age.$revision" 2699 verstring="$current.$age.$revision"
2610 2700
2611 # Add in all the interfaces that we are compatible with. 2701 # Add in all the interfaces that we are compatible with.
2612 loop=$age 2702 loop=$age
2613 while test $loop != 0; do 2703 while test "$loop" -ne 0; do
2614 iface=`expr $current - $loop` 2704 iface=`expr $current - $loop`
2615 loop=`expr $loop - 1` 2705 loop=`expr $loop - 1`
2616 verstring="$verstring:${iface}.0" 2706 verstring="$verstring:${iface}.0"
2617 done 2707 done
2618 2708
2640 esac 2730 esac
2641 2731
2642 # Clear the version info if we defaulted, and they specified a release. 2732 # Clear the version info if we defaulted, and they specified a release.
2643 if test -z "$vinfo" && test -n "$release"; then 2733 if test -z "$vinfo" && test -n "$release"; then
2644 major= 2734 major=
2645 verstring="0.0" 2735 case $version_type in
2736 darwin)
2737 # we can't check for "0.0" in archive_cmds due to quoting
2738 # problems, so we reset it completely
2739 verstring=
2740 ;;
2741 *)
2742 verstring="0.0"
2743 ;;
2744 esac
2646 if test "$need_version" = no; then 2745 if test "$need_version" = no; then
2647 versuffix= 2746 versuffix=
2648 else 2747 else
2649 versuffix=".0.0" 2748 versuffix=".0.0"
2650 fi 2749 fi
2670 fi 2769 fi
2671 fi 2770 fi
2672 2771
2673 if test "$mode" != relink; then 2772 if test "$mode" != relink; then
2674 # Remove our outputs, but don't remove object files since they 2773 # Remove our outputs, but don't remove object files since they
2675 # may have been created when compiling PIC objects. 2774 # may have been created when compiling PIC objects.
2676 removelist= 2775 removelist=
2677 tempremovelist=`echo "$output_objdir/*"` 2776 tempremovelist=`echo "$output_objdir/*"`
2678 for p in $tempremovelist; do 2777 for p in $tempremovelist; do
2679 case $p in 2778 case $p in
2680 *.$objext) 2779 *.$objext)
2681 ;; 2780 ;;
2682 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) 2781 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
2683 removelist="$removelist $p" 2782 removelist="$removelist $p"
2684 ;; 2783 ;;
2685 *) ;; 2784 *) ;;
2686 esac 2785 esac
2687 done 2786 done
2688 if test -n "$removelist"; then 2787 if test -n "$removelist"; then
2689 $show "${rm}r $removelist" 2788 $show "${rm}r $removelist"
2690 $run ${rm}r $removelist 2789 $run ${rm}r $removelist
2691 fi 2790 fi
2692 fi 2791 fi
2693 2792
2694 # Now set the variables for building old libraries. 2793 # Now set the variables for building old libraries.
2695 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then 2794 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
2696 oldlibs="$oldlibs $output_objdir/$libname.$libext" 2795 oldlibs="$oldlibs $output_objdir/$libname.$libext"
2698 # Transform .lo files to .o files. 2797 # Transform .lo files to .o files.
2699 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` 2798 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2700 fi 2799 fi
2701 2800
2702 # Eliminate all temporary directories. 2801 # Eliminate all temporary directories.
2703 for path in $uninst_path; do 2802 for path in $notinst_path; do
2704 lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'` 2803 lib_search_path=`echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
2705 deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'` 2804 deplibs=`echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
2706 dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'` 2805 dependency_libs=`echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
2707 done 2806 done
2708 2807
2709 if test -n "$xrpath"; then 2808 if test -n "$xrpath"; then
2710 # If the user specified any rpath flags, then add them. 2809 # If the user specified any rpath flags, then add them.
2711 temp_xrpath= 2810 temp_xrpath=
2714 case "$finalize_rpath " in 2813 case "$finalize_rpath " in
2715 *" $libdir "*) ;; 2814 *" $libdir "*) ;;
2716 *) finalize_rpath="$finalize_rpath $libdir" ;; 2815 *) finalize_rpath="$finalize_rpath $libdir" ;;
2717 esac 2816 esac
2718 done 2817 done
2719 if test $hardcode_into_libs != yes || test $build_old_libs = yes; then 2818 if true || test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
2720 dependency_libs="$temp_xrpath $dependency_libs" 2819 dependency_libs="$temp_xrpath $dependency_libs"
2721 fi 2820 fi
2722 fi 2821 fi
2723 2822
2724 # Make sure dlfiles contains only unique files that won't be dlpreopened 2823 # Make sure dlfiles contains only unique files that won't be dlpreopened
2749 ;; 2848 ;;
2750 *-*-rhapsody* | *-*-darwin1.[012]) 2849 *-*-rhapsody* | *-*-darwin1.[012])
2751 # Rhapsody C library is in the System framework 2850 # Rhapsody C library is in the System framework
2752 deplibs="$deplibs -framework System" 2851 deplibs="$deplibs -framework System"
2753 ;; 2852 ;;
2754 *) 2853 *-*-netbsd*)
2755 # Add libc to deplibs on all other systems if necessary. 2854 # Don't link with libc until the a.out ld.so is fixed.
2756 if test $build_libtool_need_lc = "yes"; then 2855 ;;
2757 deplibs="$deplibs -lc" 2856 *-*-openbsd* | *-*-freebsd*)
2758 fi 2857 # Do not include libc due to us having libc/libc_r.
2858 test "X$arg" = "X-lc" && continue
2859 ;;
2860 *)
2861 # Add libc to deplibs on all other systems if necessary.
2862 if test "$build_libtool_need_lc" = "yes"; then
2863 deplibs="$deplibs -lc"
2864 fi
2759 ;; 2865 ;;
2760 esac 2866 esac
2761 fi 2867 fi
2762 2868
2763 # Transform deplibs into only deplibs that can be linked in shared. 2869 # Transform deplibs into only deplibs that can be linked in shared.
2792 cat > conftest.c <<EOF 2898 cat > conftest.c <<EOF
2793 int main() { return 0; } 2899 int main() { return 0; }
2794 EOF 2900 EOF
2795 $rm conftest 2901 $rm conftest
2796 $LTCC -o conftest conftest.c $deplibs 2902 $LTCC -o conftest conftest.c $deplibs
2797 if test $? -eq 0 ; then 2903 if test "$?" -eq 0 ; then
2798 ldd_output=`ldd conftest` 2904 ldd_output=`ldd conftest`
2799 for i in $deplibs; do 2905 for i in $deplibs; do
2800 name="`expr $i : '-l\(.*\)'`" 2906 name="`expr $i : '-l\(.*\)'`"
2801 # If $name is empty we are operating on a -L argument. 2907 # If $name is empty we are operating on a -L argument.
2802 if test "$name" != "" -a "$name" != "0"; then 2908 if test "$name" != "" && test "$name" -ne "0"; then
2803 libname=`eval \\$echo \"$libname_spec\"` 2909 libname=`eval \\$echo \"$libname_spec\"`
2804 deplib_matches=`eval \\$echo \"$library_names_spec\"` 2910 deplib_matches=`eval \\$echo \"$library_names_spec\"`
2805 set dummy $deplib_matches 2911 set dummy $deplib_matches
2806 deplib_match=$2 2912 deplib_match=$2
2807 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then 2913 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2808 newdeplibs="$newdeplibs $i" 2914 newdeplibs="$newdeplibs $i"
2809 else 2915 else
2810 droppeddeps=yes 2916 droppeddeps=yes
2811 echo 2917 echo
2812 echo "*** Warning: This library needs some functionality provided by $i." 2918 echo "*** Warning: dynamic linker does not accept needed library $i."
2813 echo "*** I have the capability to make that library automatically link in when" 2919 echo "*** I have the capability to make that library automatically link in when"
2814 echo "*** you link to this library. But I can only do this if you have a" 2920 echo "*** you link to this library. But I can only do this if you have a"
2815 echo "*** shared version of the library, which you do not appear to have." 2921 echo "*** shared version of the library, which I believe you do not have"
2922 echo "*** because a test_compile did reveal that the linker did not use it for"
2923 echo "*** its dynamic dependency list that programs get resolved with at runtime."
2816 fi 2924 fi
2817 else 2925 else
2818 newdeplibs="$newdeplibs $i" 2926 newdeplibs="$newdeplibs $i"
2819 fi 2927 fi
2820 done 2928 done
2821 else 2929 else
2822 # Error occured in the first compile. Let's try to salvage the situation: 2930 # Error occured in the first compile. Let's try to salvage
2823 # Compile a seperate program for each library. 2931 # the situation: Compile a separate program for each library.
2824 for i in $deplibs; do 2932 for i in $deplibs; do
2825 name="`expr $i : '-l\(.*\)'`" 2933 name="`expr $i : '-l\(.*\)'`"
2826 # If $name is empty we are operating on a -L argument. 2934 # If $name is empty we are operating on a -L argument.
2827 if test "$name" != "" -a "$name" != "0"; then 2935 if test "$name" != "" && test "$name" != "0"; then
2828 $rm conftest 2936 $rm conftest
2829 $LTCC -o conftest conftest.c $i 2937 $LTCC -o conftest conftest.c $i
2830 # Did it work? 2938 # Did it work?
2831 if test $? -eq 0 ; then 2939 if test "$?" -eq 0 ; then
2832 ldd_output=`ldd conftest` 2940 ldd_output=`ldd conftest`
2833 libname=`eval \\$echo \"$libname_spec\"` 2941 libname=`eval \\$echo \"$libname_spec\"`
2834 deplib_matches=`eval \\$echo \"$library_names_spec\"` 2942 deplib_matches=`eval \\$echo \"$library_names_spec\"`
2835 set dummy $deplib_matches 2943 set dummy $deplib_matches
2836 deplib_match=$2 2944 deplib_match=$2
2837 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then 2945 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2838 newdeplibs="$newdeplibs $i" 2946 newdeplibs="$newdeplibs $i"
2839 else 2947 else
2840 droppeddeps=yes 2948 droppeddeps=yes
2841 echo 2949 echo
2842 echo "*** Warning: This library needs some functionality provided by $i." 2950 echo "*** Warning: dynamic linker does not accept needed library $i."
2843 echo "*** I have the capability to make that library automatically link in when" 2951 echo "*** I have the capability to make that library automatically link in when"
2844 echo "*** you link to this library. But I can only do this if you have a" 2952 echo "*** you link to this library. But I can only do this if you have a"
2845 echo "*** shared version of the library, which you do not appear to have." 2953 echo "*** shared version of the library, which you do not appear to have"
2954 echo "*** because a test_compile did reveal that the linker did not use this one"
2955 echo "*** as a dynamic dependency that programs can get resolved with at runtime."
2846 fi 2956 fi
2847 else 2957 else
2848 droppeddeps=yes 2958 droppeddeps=yes
2849 echo 2959 echo
2850 echo "*** Warning! Library $i is needed by this library but I was not able to" 2960 echo "*** Warning! Library $i is needed by this library but I was not able to"
2862 set dummy $deplibs_check_method 2972 set dummy $deplibs_check_method
2863 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 2973 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2864 for a_deplib in $deplibs; do 2974 for a_deplib in $deplibs; do
2865 name="`expr $a_deplib : '-l\(.*\)'`" 2975 name="`expr $a_deplib : '-l\(.*\)'`"
2866 # If $name is empty we are operating on a -L argument. 2976 # If $name is empty we are operating on a -L argument.
2867 if test "$name" != "" -a "$name" != "0"; then 2977 if test "$name" != "" && test "$name" != "0"; then
2868 libname=`eval \\$echo \"$libname_spec\"` 2978 libname=`eval \\$echo \"$libname_spec\"`
2869 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do 2979 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2870 potential_libs=`ls $i/$libname[.-]* 2>/dev/null` 2980 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2871 for potent_lib in $potential_libs; do 2981 for potent_lib in $potential_libs; do
2872 # Follow soft links. 2982 # Follow soft links.
2879 # We might still enter an endless loop, since a link 2989 # We might still enter an endless loop, since a link
2880 # loop can be closed while we follow links, 2990 # loop can be closed while we follow links,
2881 # but so what? 2991 # but so what?
2882 potlib="$potent_lib" 2992 potlib="$potent_lib"
2883 while test -h "$potlib" 2>/dev/null; do 2993 while test -h "$potlib" 2>/dev/null; do
2884 potliblink=`ls -ld $potlib | sed 's/.* -> //'` 2994 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
2885 case $potliblink in 2995 case $potliblink in
2886 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; 2996 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
2887 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; 2997 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2888 esac 2998 esac
2889 done 2999 done
2890 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ 3000 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
2891 | sed 10q \ 3001 | ${SED} 10q \
2892 | egrep "$file_magic_regex" > /dev/null; then 3002 | egrep "$file_magic_regex" > /dev/null; then
2893 newdeplibs="$newdeplibs $a_deplib" 3003 newdeplibs="$newdeplibs $a_deplib"
2894 a_deplib="" 3004 a_deplib=""
2895 break 2 3005 break 2
2896 fi 3006 fi
2897 done 3007 done
2898 done 3008 done
2899 if test -n "$a_deplib" ; then 3009 if test -n "$a_deplib" ; then
2900 droppeddeps=yes 3010 droppeddeps=yes
2901 echo 3011 echo
2902 echo "*** Warning: This library needs some functionality provided by $a_deplib." 3012 echo "*** Warning: linker path does not have real file for library $a_deplib."
2903 echo "*** I have the capability to make that library automatically link in when" 3013 echo "*** I have the capability to make that library automatically link in when"
2904 echo "*** you link to this library. But I can only do this if you have a" 3014 echo "*** you link to this library. But I can only do this if you have a"
2905 echo "*** shared version of the library, which you do not appear to have." 3015 echo "*** shared version of the library, which you do not appear to have"
3016 echo "*** because I did check the linker path looking for a file starting"
3017 if test -z "$potlib" ; then
3018 echo "*** with $libname but no candidates were found. (...for file magic test)"
3019 else
3020 echo "*** with $libname and none of the candidates passed a file format test"
3021 echo "*** using a file magic. Last file checked: $potlib"
3022 fi
3023 fi
3024 else
3025 # Add a -L argument.
3026 newdeplibs="$newdeplibs $a_deplib"
3027 fi
3028 done # Gone through all deplibs.
3029 ;;
3030 match_pattern*)
3031 set dummy $deplibs_check_method
3032 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3033 for a_deplib in $deplibs; do
3034 name="`expr $a_deplib : '-l\(.*\)'`"
3035 # If $name is empty we are operating on a -L argument.
3036 if test -n "$name" && test "$name" != "0"; then
3037 libname=`eval \\$echo \"$libname_spec\"`
3038 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3039 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3040 for potent_lib in $potential_libs; do
3041 potlib="$potent_lib" # see symlink-check above in file_magic test
3042 if eval echo \"$potent_lib\" 2>/dev/null \
3043 | ${SED} 10q \
3044 | egrep "$match_pattern_regex" > /dev/null; then
3045 newdeplibs="$newdeplibs $a_deplib"
3046 a_deplib=""
3047 break 2
3048 fi
3049 done
3050 done
3051 if test -n "$a_deplib" ; then
3052 droppeddeps=yes
3053 echo
3054 echo "*** Warning: linker path does not have real file for library $a_deplib."
3055 echo "*** I have the capability to make that library automatically link in when"
3056 echo "*** you link to this library. But I can only do this if you have a"
3057 echo "*** shared version of the library, which you do not appear to have"
3058 echo "*** because I did check the linker path looking for a file starting"
3059 if test -z "$potlib" ; then
3060 echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3061 else
3062 echo "*** with $libname and none of the candidates passed a file format test"
3063 echo "*** using a regex pattern. Last file checked: $potlib"
3064 fi
2906 fi 3065 fi
2907 else 3066 else
2908 # Add a -L argument. 3067 # Add a -L argument.
2909 newdeplibs="$newdeplibs $a_deplib" 3068 newdeplibs="$newdeplibs $a_deplib"
2910 fi 3069 fi
2929 versuffix=$versuffix_save 3088 versuffix=$versuffix_save
2930 major=$major_save 3089 major=$major_save
2931 release=$release_save 3090 release=$release_save
2932 libname=$libname_save 3091 libname=$libname_save
2933 name=$name_save 3092 name=$name_save
3093
3094 case $host in
3095 *-*-rhapsody* | *-*-darwin1.[012])
3096 # On Rhapsody replace the C library is the System framework
3097 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3098 ;;
3099 esac
2934 3100
2935 if test "$droppeddeps" = yes; then 3101 if test "$droppeddeps" = yes; then
2936 if test "$module" = yes; then 3102 if test "$module" = yes; then
2937 echo 3103 echo
2938 echo "*** Warning: libtool could not satisfy all declared inter-library" 3104 echo "*** Warning: libtool could not satisfy all declared inter-library"
2956 else 3122 else
2957 echo "*** The inter-library dependencies that have been dropped here will be" 3123 echo "*** The inter-library dependencies that have been dropped here will be"
2958 echo "*** automatically added whenever a program is linked with this library" 3124 echo "*** automatically added whenever a program is linked with this library"
2959 echo "*** or is declared to -dlopen it." 3125 echo "*** or is declared to -dlopen it."
2960 3126
2961 if test $allow_undefined = no; then 3127 if test "$allow_undefined" = no; then
2962 echo 3128 echo
2963 echo "*** Since this library must not contain undefined symbols," 3129 echo "*** Since this library must not contain undefined symbols,"
2964 echo "*** because either the platform does not support them or" 3130 echo "*** because either the platform does not support them or"
2965 echo "*** it was explicitly requested with -no-undefined," 3131 echo "*** it was explicitly requested with -no-undefined,"
2966 echo "*** libtool will only create a static version of it." 3132 echo "*** libtool will only create a static version of it."
2983 old_library= 3149 old_library=
2984 dlname= 3150 dlname=
2985 3151
2986 # Test again, we may have decided not to build it any more 3152 # Test again, we may have decided not to build it any more
2987 if test "$build_libtool_libs" = yes; then 3153 if test "$build_libtool_libs" = yes; then
2988 if test $hardcode_into_libs = yes; then 3154 if test "$hardcode_into_libs" = yes; then
2989 # Hardcode the library paths 3155 # Hardcode the library paths
2990 hardcode_libdirs= 3156 hardcode_libdirs=
2991 dep_rpath= 3157 dep_rpath=
2992 rpath="$finalize_rpath" 3158 rpath="$finalize_rpath"
2993 test "$mode" != relink && rpath="$compile_rpath$rpath" 3159 test "$mode" != relink && test "$fast_install" = no && rpath="$compile_rpath$rpath"
2994 for libdir in $rpath; do 3160 for libdir in $rpath; do
2995 if test -n "$hardcode_libdir_flag_spec"; then 3161 if test -n "$hardcode_libdir_flag_spec"; then
2996 if test -n "$hardcode_libdir_separator"; then 3162 if test -n "$hardcode_libdir_separator"; then
2997 if test -z "$hardcode_libdirs"; then 3163 if test -z "$hardcode_libdirs"; then
2998 hardcode_libdirs="$libdir" 3164 hardcode_libdirs="$libdir"
3049 if test -n "$soname_spec"; then 3215 if test -n "$soname_spec"; then
3050 eval soname=\"$soname_spec\" 3216 eval soname=\"$soname_spec\"
3051 else 3217 else
3052 soname="$realname" 3218 soname="$realname"
3053 fi 3219 fi
3054 if test x$dlname = x; then 3220 if test -z "$dlname"; then
3055 dlname=$soname 3221 dlname=$soname
3056 fi 3222 fi
3057 3223
3058 lib="$output_objdir/$realname" 3224 lib="$output_objdir/$realname"
3059 for link 3225 for link
3060 do 3226 do
3061 linknames="$linknames $link" 3227 linknames="$linknames $link"
3062 done 3228 done
3063
3064 # # Ensure that we have .o objects for linkers which dislike .lo
3065 # # (e.g. aix) in case we are running --disable-static
3066 # for obj in $libobjs; do
3067 # xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
3068 # if test "X$xdir" = "X$obj"; then
3069 # xdir="."
3070 # else
3071 # xdir="$xdir"
3072 # fi
3073 # baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
3074 # oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3075 # if test ! -f $xdir/$oldobj && test "$baseobj" != "$oldobj"; then
3076 # $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
3077 # $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
3078 # fi
3079 # done
3080 3229
3081 # Use standard objects if they are pic 3230 # Use standard objects if they are pic
3082 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` 3231 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3083 3232
3084 # Prepare the list of exported symbols 3233 # Prepare the list of exported symbols
3086 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then 3235 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3087 $show "generating symbol list for \`$libname.la'" 3236 $show "generating symbol list for \`$libname.la'"
3088 export_symbols="$output_objdir/$libname.exp" 3237 export_symbols="$output_objdir/$libname.exp"
3089 $run $rm $export_symbols 3238 $run $rm $export_symbols
3090 eval cmds=\"$export_symbols_cmds\" 3239 eval cmds=\"$export_symbols_cmds\"
3091 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' 3240 save_ifs="$IFS"; IFS='~'
3092 for cmd in $cmds; do 3241 for cmd in $cmds; do
3093 IFS="$save_ifs" 3242 IFS="$save_ifs"
3094 $show "$cmd" 3243 $show "$cmd"
3095 $run eval "$cmd" || exit $? 3244 $run eval "$cmd" || exit $?
3096 done 3245 done
3117 $show "${rm}r $gentop" 3266 $show "${rm}r $gentop"
3118 $run ${rm}r "$gentop" 3267 $run ${rm}r "$gentop"
3119 $show "$mkdir $gentop" 3268 $show "$mkdir $gentop"
3120 $run $mkdir "$gentop" 3269 $run $mkdir "$gentop"
3121 status=$? 3270 status=$?
3122 if test $status -ne 0 && test ! -d "$gentop"; then 3271 if test "$status" -ne 0 && test ! -d "$gentop"; then
3123 exit $status 3272 exit $status
3124 fi 3273 fi
3125 generated="$generated $gentop" 3274 generated="$generated $gentop"
3126 3275
3127 for xlib in $convenience; do 3276 for xlib in $convenience; do
3136 $show "${rm}r $xdir" 3285 $show "${rm}r $xdir"
3137 $run ${rm}r "$xdir" 3286 $run ${rm}r "$xdir"
3138 $show "$mkdir $xdir" 3287 $show "$mkdir $xdir"
3139 $run $mkdir "$xdir" 3288 $run $mkdir "$xdir"
3140 status=$? 3289 status=$?
3141 if test $status -ne 0 && test ! -d "$xdir"; then 3290 if test "$status" -ne 0 && test ! -d "$xdir"; then
3142 exit $status 3291 exit $status
3143 fi 3292 fi
3144 $show "(cd $xdir && $AR x $xabs)" 3293 $show "(cd $xdir && $AR x $xabs)"
3145 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? 3294 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3146 3295
3153 eval flag=\"$thread_safe_flag_spec\" 3302 eval flag=\"$thread_safe_flag_spec\"
3154 linker_flags="$linker_flags $flag" 3303 linker_flags="$linker_flags $flag"
3155 fi 3304 fi
3156 3305
3157 # Make a backup of the uninstalled library when relinking 3306 # Make a backup of the uninstalled library when relinking
3158 if test "$mode" = relink && test "$hardcode_into_libs" = all; then 3307 if test "$mode" = relink; then
3159 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? 3308 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3160 fi 3309 fi
3161 3310
3162 # Add all flags from the command line. We here create a library, 3311 # Add all flags from the command line. We here create a library,
3163 # but those flags were only added to compile_command and 3312 # but those flags were only added to compile_command and
3172 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then 3321 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3173 eval cmds=\"$archive_expsym_cmds\" 3322 eval cmds=\"$archive_expsym_cmds\"
3174 else 3323 else
3175 eval cmds=\"$archive_cmds\" 3324 eval cmds=\"$archive_cmds\"
3176 fi 3325 fi
3177 if len=`expr "X$cmds" : ".*"` && 3326
3178 test $len -le $max_cmd_len; then 3327 if len=`expr "X$cmds" : ".*"` &&
3179 : 3328 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3180 else 3329 :
3330 else
3181 # The command line is too long to link in one step, link piecewise. 3331 # The command line is too long to link in one step, link piecewise.
3182 $echo "creating reloadable object files..." 3332 $echo "creating reloadable object files..."
3183 3333
3184 # Save the value of $output and $libobjs because we want to 3334 # Save the value of $output and $libobjs because we want to
3185 # use them later. If we have whole_archive_flag_spec, we 3335 # use them later. If we have whole_archive_flag_spec, we
3186 # want to use save_libobjs as it was before 3336 # want to use save_libobjs as it was before
3187 # whole_archive_flag_spec was expanded, because we can't 3337 # whole_archive_flag_spec was expanded, because we can't
3190 # convenience libraries get linked in and end up exceeding 3340 # convenience libraries get linked in and end up exceeding
3191 # the spec. 3341 # the spec.
3192 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then 3342 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3193 save_libobjs=$libobjs 3343 save_libobjs=$libobjs
3194 fi 3344 fi
3195 save_output=$output 3345 save_output=$output
3196 3346
3197 # Clear the reloadable object creation command queue and 3347 # Clear the reloadable object creation command queue and
3198 # initialize k to one. 3348 # initialize k to one.
3199 test_cmds= 3349 test_cmds=
3200 concat_cmds= 3350 concat_cmds=
3201 objlist= 3351 objlist=
3202 delfiles= 3352 delfiles=
3203 last_robj= 3353 last_robj=
3204 k=1 3354 k=1
3205 output=$output_objdir/$save_output-${k}.$objext 3355 output=$output_objdir/$save_output-${k}.$objext
3206 # Loop over the list of objects to be linked. 3356 # Loop over the list of objects to be linked.
3207 for obj in $save_libobjs 3357 for obj in $save_libobjs
3208 do 3358 do
3209 eval test_cmds=\"$reload_cmds $objlist $last_robj\" 3359 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3210 if test "X$objlist" = X || 3360 if test "X$objlist" = X ||
3211 { len=`expr "X$test_cmds" : ".*"` && 3361 { len=`expr "X$test_cmds" : ".*"` &&
3212 test $len -le $max_cmd_len; }; then 3362 test "$len" -le "$max_cmd_len"; }; then
3213 objlist="$objlist $obj" 3363 objlist="$objlist $obj"
3214 else 3364 else
3215 # The command $test_cmds is almost too long, add a 3365 # The command $test_cmds is almost too long, add a
3216 # command to the queue. 3366 # command to the queue.
3217 if test $k -eq 1 ; then 3367 if test "$k" -eq 1 ; then
3218 # The first file doesn't have a previous command to add. 3368 # The first file doesn't have a previous command to add.
3219 eval concat_cmds=\"$reload_cmds $objlist $last_robj\" 3369 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3220 else 3370 else
3221 # All subsequent reloadable object files will link in 3371 # All subsequent reloadable object files will link in
3222 # the last one created. 3372 # the last one created.
3223 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" 3373 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3224 fi 3374 fi
3225 last_robj=$output_objdir/$save_output-${k}.$objext 3375 last_robj=$output_objdir/$save_output-${k}.$objext
3226 k=`expr $k + 1` 3376 k=`expr $k + 1`
3227 output=$output_objdir/$save_output-${k}.$objext 3377 output=$output_objdir/$save_output-${k}.$objext
3228 objlist=$obj 3378 objlist=$obj
3229 len=1 3379 len=1
3230 fi 3380 fi
3231 done 3381 done
3232 # Handle the remaining objects by creating one last 3382 # Handle the remaining objects by creating one last
3233 # reloadable object file. All subsequent reloadable object 3383 # reloadable object file. All subsequent reloadable object
3234 # files will link in the last one created. 3384 # files will link in the last one created.
3235 test -z "$concat_cmds" || concat_cmds=$concat_cmds~ 3385 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3236 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" 3386 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3237 3387
3238 # Set up a command to remove the reloadale object files 3388 # Set up a command to remove the reloadale object files
3239 # after they are used. 3389 # after they are used.
3240 i=0 3390 i=0
3241 while test $i -lt $k 3391 while test "$i" -lt "$k"
3242 do 3392 do
3243 i=`expr $i + 1` 3393 i=`expr $i + 1`
3244 delfiles="$delfiles $output_objdir/$save_output-${i}.$objext" 3394 delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
3245 done 3395 done
3246 3396
3247 $echo "creating a temporary reloadable object file: $output" 3397 $echo "creating a temporary reloadable object file: $output"
3248 3398
3249 # Loop through the commands generated above and execute them. 3399 # Loop through the commands generated above and execute them.
3250 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' 3400 save_ifs="$IFS"; IFS='~'
3251 for cmd in $concat_cmds; do 3401 for cmd in $concat_cmds; do
3252 IFS="$save_ifs" 3402 IFS="$save_ifs"
3253 $show "$cmd" 3403 $show "$cmd"
3254 $run eval "$cmd" || exit $? 3404 $run eval "$cmd" || exit $?
3255 done 3405 done
3256 IFS="$save_ifs" 3406 IFS="$save_ifs"
3257 3407
3258 libobjs=$output 3408 libobjs=$output
3259 # Restore the value of output. 3409 # Restore the value of output.
3260 output=$save_output 3410 output=$save_output
3261 3411
3262 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then 3412 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3263 eval libobjs=\"\$libobjs $whole_archive_flag_spec\" 3413 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3264 fi 3414 fi
3265 # Expand the library linking commands again to reset the 3415 # Expand the library linking commands again to reset the
3266 # value of $libobjs for piecewise linking. 3416 # value of $libobjs for piecewise linking.
3267 3417
3268 # Do each of the archive commands. 3418 # Do each of the archive commands.
3269 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then 3419 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3270 eval cmds=\"$archive_expsym_cmds\" 3420 eval cmds=\"$archive_expsym_cmds\"
3271 else 3421 else
3272 eval cmds=\"$archive_cmds\" 3422 eval cmds=\"$archive_cmds\"
3273 fi 3423 fi
3274 3424
3275 # Append the command to remove the reloadable object files 3425 # Append the command to remove the reloadable object files
3276 # to the just-reset $cmds. 3426 # to the just-reset $cmds.
3277 eval cmds=\"\$cmds~$rm $delfiles\" 3427 eval cmds=\"\$cmds~$rm $delfiles\"
3278 fi 3428 fi
3279 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' 3429 save_ifs="$IFS"; IFS='~'
3280 for cmd in $cmds; do 3430 for cmd in $cmds; do
3281 IFS="$save_ifs" 3431 IFS="$save_ifs"
3282 $show "$cmd" 3432 $show "$cmd"
3283 $run eval "$cmd" || exit $? 3433 $run eval "$cmd" || exit $?
3284 done 3434 done
3285 IFS="$save_ifs" 3435 IFS="$save_ifs"
3286 3436
3287 # Restore the uninstalled library and exit 3437 # Restore the uninstalled library and exit
3288 if test "$mode" = relink && test "$hardcode_into_libs" = all; then 3438 if test "$mode" = relink; then
3289 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? 3439 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3290 exit 0 3440 exit 0
3291 fi 3441 fi
3292 3442
3293 # Create links to the real library. 3443 # Create links to the real library.
3367 $show "${rm}r $gentop" 3517 $show "${rm}r $gentop"
3368 $run ${rm}r "$gentop" 3518 $run ${rm}r "$gentop"
3369 $show "$mkdir $gentop" 3519 $show "$mkdir $gentop"
3370 $run $mkdir "$gentop" 3520 $run $mkdir "$gentop"
3371 status=$? 3521 status=$?
3372 if test $status -ne 0 && test ! -d "$gentop"; then 3522 if test "$status" -ne 0 && test ! -d "$gentop"; then
3373 exit $status 3523 exit $status
3374 fi 3524 fi
3375 generated="$generated $gentop" 3525 generated="$generated $gentop"
3376 3526
3377 for xlib in $convenience; do 3527 for xlib in $convenience; do
3386 $show "${rm}r $xdir" 3536 $show "${rm}r $xdir"
3387 $run ${rm}r "$xdir" 3537 $run ${rm}r "$xdir"
3388 $show "$mkdir $xdir" 3538 $show "$mkdir $xdir"
3389 $run $mkdir "$xdir" 3539 $run $mkdir "$xdir"
3390 status=$? 3540 status=$?
3391 if test $status -ne 0 && test ! -d "$xdir"; then 3541 if test "$status" -ne 0 && test ! -d "$xdir"; then
3392 exit $status 3542 exit $status
3393 fi 3543 fi
3394 $show "(cd $xdir && $AR x $xabs)" 3544 $show "(cd $xdir && $AR x $xabs)"
3395 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? 3545 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3396 3546
3402 # Create the old-style object. 3552 # Create the old-style object.
3403 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 3553 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
3404 3554
3405 output="$obj" 3555 output="$obj"
3406 eval cmds=\"$reload_cmds\" 3556 eval cmds=\"$reload_cmds\"
3407 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' 3557 save_ifs="$IFS"; IFS='~'
3408 for cmd in $cmds; do 3558 for cmd in $cmds; do
3409 IFS="$save_ifs" 3559 IFS="$save_ifs"
3410 $show "$cmd" 3560 $show "$cmd"
3411 $run eval "$cmd" || exit $? 3561 $run eval "$cmd" || exit $?
3412 done 3562 done
3438 if test -n "$pic_flag" || test "$pic_mode" != default; then 3588 if test -n "$pic_flag" || test "$pic_mode" != default; then
3439 # Only do commands if we really have different PIC objects. 3589 # Only do commands if we really have different PIC objects.
3440 reload_objs="$libobjs $reload_conv_objs" 3590 reload_objs="$libobjs $reload_conv_objs"
3441 output="$libobj" 3591 output="$libobj"
3442 eval cmds=\"$reload_cmds\" 3592 eval cmds=\"$reload_cmds\"
3443 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' 3593 save_ifs="$IFS"; IFS='~'
3444 for cmd in $cmds; do 3594 for cmd in $cmds; do
3445 IFS="$save_ifs" 3595 IFS="$save_ifs"
3446 $show "$cmd" 3596 $show "$cmd"
3447 $run eval "$cmd" || exit $? 3597 $run eval "$cmd" || exit $?
3448 done 3598 done
3449 IFS="$save_ifs" 3599 IFS="$save_ifs"
3450 # else
3451 # # Just create a symlink.
3452 # $show $rm $libobj
3453 # $run $rm $libobj
3454 # xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
3455 # if test "X$xdir" = "X$libobj"; then
3456 # xdir="."
3457 # else
3458 # xdir="$xdir"
3459 # fi
3460 # baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
3461 # oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3462 # $show "(cd $xdir && $LN_S $oldobj $baseobj)"
3463 # $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
3464 fi 3600 fi
3465 3601
3466 if test -n "$gentop"; then 3602 if test -n "$gentop"; then
3467 $show "${rm}r $gentop" 3603 $show "${rm}r $gentop"
3468 $run ${rm}r $gentop 3604 $run ${rm}r $gentop
3471 exit 0 3607 exit 0
3472 ;; 3608 ;;
3473 3609
3474 prog) 3610 prog)
3475 case $host in 3611 case $host in
3476 *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;; 3612 *cygwin*) output=`echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
3477 esac 3613 esac
3478 if test -n "$vinfo"; then 3614 if test -n "$vinfo"; then
3479 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 3615 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
3480 fi 3616 fi
3481 3617
3487 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && 3623 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
3488 test "$dlopen_self_static" = unknown; then 3624 test "$dlopen_self_static" = unknown; then
3489 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." 3625 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
3490 fi 3626 fi
3491 fi 3627 fi
3628
3629 case $host in
3630 *-*-rhapsody* | *-*-darwin1.[012])
3631 # On Rhapsody replace the C library is the System framework
3632 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3633 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3634 ;;
3635 esac
3492 3636
3493 compile_command="$compile_command $compile_deplibs" 3637 compile_command="$compile_command $compile_deplibs"
3494 finalize_command="$finalize_command $finalize_deplibs" 3638 finalize_command="$finalize_command $finalize_deplibs"
3495 3639
3496 if test -n "$rpath$xrpath"; then 3640 if test -n "$rpath$xrpath"; then
3583 libdir="$hardcode_libdirs" 3727 libdir="$hardcode_libdirs"
3584 eval rpath=\" $hardcode_libdir_flag_spec\" 3728 eval rpath=\" $hardcode_libdir_flag_spec\"
3585 fi 3729 fi
3586 finalize_rpath="$rpath" 3730 finalize_rpath="$rpath"
3587 3731
3732 if test -n "$libobjs" && test "$build_old_libs" = yes; then
3733 # Transform all the library objects into standard objects.
3734 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3735 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3736 fi
3737
3588 dlsyms= 3738 dlsyms=
3589 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then 3739 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3590 if test -n "$NM" && test -n "$global_symbol_pipe"; then 3740 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3591 dlsyms="${outputname}S.c" 3741 dlsyms="${outputname}S.c"
3592 else 3742 else
3625 $show "generating symbol list for \`$output'" 3775 $show "generating symbol list for \`$output'"
3626 3776
3627 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" 3777 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
3628 3778
3629 # Add our own program objects to the symbol list. 3779 # Add our own program objects to the symbol list.
3630 progfiles="$objs$old_deplibs" 3780 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3631 for arg in $progfiles; do 3781 for arg in $progfiles; do
3632 $show "extracting global C symbols from \`$arg'" 3782 $show "extracting global C symbols from \`$arg'"
3633 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" 3783 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3634 done 3784 done
3635 3785
3645 3795
3646 # Prepare the list of exported symbols 3796 # Prepare the list of exported symbols
3647 if test -z "$export_symbols"; then 3797 if test -z "$export_symbols"; then
3648 export_symbols="$output_objdir/$output.exp" 3798 export_symbols="$output_objdir/$output.exp"
3649 $run $rm $export_symbols 3799 $run $rm $export_symbols
3650 $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' 3800 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3651 else 3801 else
3652 $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' 3802 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3653 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' 3803 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
3654 $run eval 'mv "$nlist"T "$nlist"' 3804 $run eval 'mv "$nlist"T "$nlist"'
3655 fi 3805 fi
3656 fi 3806 fi
3657 3807
3658 for arg in $dlprefiles; do 3808 for arg in $dlprefiles; do
3659 $show "extracting global C symbols from \`$arg'" 3809 $show "extracting global C symbols from \`$arg'"
3660 name=`echo "$arg" | sed -e 's%^.*/%%'` 3810 name=`echo "$arg" | ${SED} -e 's%^.*/%%'`
3661 $run eval 'echo ": $name " >> "$nlist"' 3811 $run eval 'echo ": $name " >> "$nlist"'
3662 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" 3812 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3663 done 3813 done
3664 3814
3665 if test -z "$run"; then 3815 if test -z "$run"; then
3687 $echo >> "$output_objdir/$dlsyms" "\ 3837 $echo >> "$output_objdir/$dlsyms" "\
3688 3838
3689 #undef lt_preloaded_symbols 3839 #undef lt_preloaded_symbols
3690 3840
3691 #if defined (__STDC__) && __STDC__ 3841 #if defined (__STDC__) && __STDC__
3692 # define lt_ptr_t void * 3842 # define lt_ptr void *
3693 #else 3843 #else
3694 # define lt_ptr_t char * 3844 # define lt_ptr char *
3695 # define const 3845 # define const
3696 #endif 3846 #endif
3697 3847
3698 /* The mapping between symbol names and symbols. */ 3848 /* The mapping between symbol names and symbols. */
3699 const struct { 3849 const struct {
3700 const char *name; 3850 const char *name;
3701 lt_ptr_t address; 3851 lt_ptr address;
3702 } 3852 }
3703 lt_preloaded_symbols[] = 3853 lt_preloaded_symbols[] =
3704 {\ 3854 {\
3705 " 3855 "
3706 3856
3707 sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \ 3857 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
3708 -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
3709 < "$nlist" >> "$output_objdir/$dlsyms"
3710 3858
3711 $echo >> "$output_objdir/$dlsyms" "\ 3859 $echo >> "$output_objdir/$dlsyms" "\
3712 {0, (lt_ptr_t) 0} 3860 {0, (lt_ptr) 0}
3713 }; 3861 };
3714 3862
3715 /* This works around a problem in FreeBSD linker */ 3863 /* This works around a problem in FreeBSD linker */
3716 #ifdef FREEBSD_WORKAROUND 3864 #ifdef FREEBSD_WORKAROUND
3717 static const void *lt_preloaded_setup() { 3865 static const void *lt_preloaded_setup() {
3780 *-*-aix4* | *-*-aix5*) 3928 *-*-aix4* | *-*-aix5*)
3781 compile_command=`$echo "X$compile_command $wl-brtl" | $Xsed -e "s/\$CC/\$CC $wl-bnolibpath/1"` 3929 compile_command=`$echo "X$compile_command $wl-brtl" | $Xsed -e "s/\$CC/\$CC $wl-bnolibpath/1"`
3782 finalize_command=`$echo "X$finalize_command $wl-brtl" | $Xsed -e "s/\$CC/\$CC $wl-bnolibpath/1"` ;; 3930 finalize_command=`$echo "X$finalize_command $wl-brtl" | $Xsed -e "s/\$CC/\$CC $wl-bnolibpath/1"` ;;
3783 esac 3931 esac
3784 3932
3785 if test $need_relink = no || test "$build_libtool_libs" != yes; then 3933 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
3786 # Replace the output file specification. 3934 # Replace the output file specification.
3787 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` 3935 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3788 link_command="$compile_command$compile_rpath" 3936 link_command="$compile_command$compile_rpath"
3789 3937
3790 # We have no uninstalled library dependencies, so finalize right now. 3938 # We have no uninstalled library dependencies, so finalize right now.
3905 else 4053 else
3906 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` 4054 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
3907 relink_command="$var=\"$var_value\"; export $var; $relink_command" 4055 relink_command="$var=\"$var_value\"; export $var; $relink_command"
3908 fi 4056 fi
3909 done 4057 done
3910 relink_command="cd `pwd`; $relink_command" 4058 relink_command="(cd `pwd`; $relink_command)"
3911 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` 4059 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3912 fi 4060 fi
3913 4061
3914 # Quote $echo for shipping. 4062 # Quote $echo for shipping.
3915 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then 4063 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
3925 # Only actually do things if our run command is non-null. 4073 # Only actually do things if our run command is non-null.
3926 if test -z "$run"; then 4074 if test -z "$run"; then
3927 # win32 will think the script is a binary if it has 4075 # win32 will think the script is a binary if it has
3928 # a .exe suffix, so we strip it off here. 4076 # a .exe suffix, so we strip it off here.
3929 case $output in 4077 case $output in
3930 *.exe) output=`echo $output|sed 's,.exe$,,'` ;; 4078 *.exe) output=`echo $output|${SED} 's,.exe$,,'` ;;
3931 esac 4079 esac
3932 # test for cygwin because mv fails w/o .exe extensions 4080 # test for cygwin because mv fails w/o .exe extensions
3933 case $host in 4081 case $host in
3934 *cygwin*) exeext=.exe ;; 4082 *cygwin*) exeext=.exe ;;
3935 *) exeext= ;; 4083 *) exeext= ;;
3949 # This wrapper script should never be moved out of the build directory. 4097 # This wrapper script should never be moved out of the build directory.
3950 # If it is, it will not operate correctly. 4098 # If it is, it will not operate correctly.
3951 4099
3952 # Sed substitution that helps us do robust quoting. It backslashifies 4100 # Sed substitution that helps us do robust quoting. It backslashifies
3953 # metacharacters that are still active within double-quoted strings. 4101 # metacharacters that are still active within double-quoted strings.
3954 Xsed='sed -e 1s/^X//' 4102 Xsed='${SED} -e 1s/^X//'
3955 sed_quote_subst='$sed_quote_subst' 4103 sed_quote_subst='$sed_quote_subst'
3956 4104
3957 # The HP-UX ksh and POSIX shell print the target directory to stdout 4105 # The HP-UX ksh and POSIX shell print the target directory to stdout
3958 # if CDPATH is set. 4106 # if CDPATH is set.
3959 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi 4107 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
3961 relink_command=\"$relink_command\" 4109 relink_command=\"$relink_command\"
3962 4110
3963 # This environment variable determines our operation mode. 4111 # This environment variable determines our operation mode.
3964 if test \"\$libtool_install_magic\" = \"$magic\"; then 4112 if test \"\$libtool_install_magic\" = \"$magic\"; then
3965 # install mode needs the following variable: 4113 # install mode needs the following variable:
3966 uninst_deplibs='$uninst_deplibs' 4114 notinst_deplibs='$notinst_deplibs'
3967 else 4115 else
3968 # When we are sourced in execute mode, \$file and \$echo are already set. 4116 # When we are sourced in execute mode, \$file and \$echo are already set.
3969 if test \"\$libtool_execute_magic\" != \"$magic\"; then 4117 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3970 echo=\"$qecho\" 4118 echo=\"$qecho\"
3971 file=\"\$0\" 4119 file=\"\$0\"
3987 # Find the directory that this script lives in. 4135 # Find the directory that this script lives in.
3988 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` 4136 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
3989 test \"x\$thisdir\" = \"x\$file\" && thisdir=. 4137 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3990 4138
3991 # Follow symbolic links until we get to the real thisdir. 4139 # Follow symbolic links until we get to the real thisdir.
3992 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\` 4140 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
3993 while test -n \"\$file\"; do 4141 while test -n \"\$file\"; do
3994 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` 4142 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
3995 4143
3996 # If there was a directory component, then change thisdir. 4144 # If there was a directory component, then change thisdir.
3997 if test \"x\$destdir\" != \"x\$file\"; then 4145 if test \"x\$destdir\" != \"x\$file\"; then
4000 *) thisdir=\"\$thisdir/\$destdir\" ;; 4148 *) thisdir=\"\$thisdir/\$destdir\" ;;
4001 esac 4149 esac
4002 fi 4150 fi
4003 4151
4004 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` 4152 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4005 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\` 4153 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
4006 done 4154 done
4007 4155
4008 # Try to get the absolute directory name. 4156 # Try to get the absolute directory name.
4009 absdir=\`cd \"\$thisdir\" && pwd\` 4157 absdir=\`cd \"\$thisdir\" && pwd\`
4010 test -n \"\$absdir\" && thisdir=\"\$absdir\" 4158 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4014 echo >> $output "\ 4162 echo >> $output "\
4015 program=lt-'$outputname'$exeext 4163 program=lt-'$outputname'$exeext
4016 progdir=\"\$thisdir/$objdir\" 4164 progdir=\"\$thisdir/$objdir\"
4017 4165
4018 if test ! -f \"\$progdir/\$program\" || \\ 4166 if test ! -f \"\$progdir/\$program\" || \\
4019 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\ 4167 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4020 test \"X\$file\" != \"X\$progdir/\$program\"; }; then 4168 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4021 4169
4022 file=\"\$\$-\$program\" 4170 file=\"\$\$-\$program\"
4023 4171
4024 if test ! -d \"\$progdir\"; then 4172 if test ! -d \"\$progdir\"; then
4029 4177
4030 echo >> $output "\ 4178 echo >> $output "\
4031 4179
4032 # relink executable if necessary 4180 # relink executable if necessary
4033 if test -n \"\$relink_command\"; then 4181 if test -n \"\$relink_command\"; then
4034 if (eval \$relink_command); then : 4182 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4035 else 4183 else
4184 $echo \"\$relink_command_output\" >&2
4036 $rm \"\$progdir/\$file\" 4185 $rm \"\$progdir/\$file\"
4037 exit 1 4186 exit 1
4038 fi 4187 fi
4039 fi 4188 fi
4040 4189
4135 else 4284 else
4136 if test "$build_libtool_libs" = module; then 4285 if test "$build_libtool_libs" = module; then
4137 oldobjs="$libobjs_save" 4286 oldobjs="$libobjs_save"
4138 build_libtool_libs=no 4287 build_libtool_libs=no
4139 else 4288 else
4140 oldobjs="$objs$old_deplibs $non_pic_objects" 4289 #oldobjs="$oldobjs$old_deplibs $non_pic_objects"
4290 oldobjs="$old_deplibs $non_pic_objects"
4141 fi 4291 fi
4142 addlibs="$old_convenience" 4292 addlibs="$old_convenience"
4143 fi 4293 fi
4144 4294
4145 if test -n "$addlibs"; then 4295 if test -n "$addlibs"; then
4147 $show "${rm}r $gentop" 4297 $show "${rm}r $gentop"
4148 $run ${rm}r "$gentop" 4298 $run ${rm}r "$gentop"
4149 $show "$mkdir $gentop" 4299 $show "$mkdir $gentop"
4150 $run $mkdir "$gentop" 4300 $run $mkdir "$gentop"
4151 status=$? 4301 status=$?
4152 if test $status -ne 0 && test ! -d "$gentop"; then 4302 if test "$status" -ne 0 && test ! -d "$gentop"; then
4153 exit $status 4303 exit $status
4154 fi 4304 fi
4155 generated="$generated $gentop" 4305 generated="$generated $gentop"
4156 4306
4157 # Add in members from convenience archives. 4307 # Add in members from convenience archives.
4167 $show "${rm}r $xdir" 4317 $show "${rm}r $xdir"
4168 $run ${rm}r "$xdir" 4318 $run ${rm}r "$xdir"
4169 $show "$mkdir $xdir" 4319 $show "$mkdir $xdir"
4170 $run $mkdir "$xdir" 4320 $run $mkdir "$xdir"
4171 status=$? 4321 status=$?
4172 if test $status -ne 0 && test ! -d "$xdir"; then 4322 if test "$status" -ne 0 && test ! -d "$xdir"; then
4173 exit $status 4323 exit $status
4174 fi 4324 fi
4175 $show "(cd $xdir && $AR x $xabs)" 4325 $show "(cd $xdir && $AR x $xabs)"
4176 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? 4326 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4177 4327
4178 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print | $NL2SP` 4328 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
4179 done 4329 done
4180 fi 4330 fi
4331
4332 compiler_flags="$compiler_flags $add_flags"
4181 4333
4182 # Do each command in the archive commands. 4334 # Do each command in the archive commands.
4183 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then 4335 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
4184 eval cmds=\"$old_archive_from_new_cmds\" 4336 eval cmds=\"$old_archive_from_new_cmds\"
4185 else 4337 else
4186 # # Ensure that we have .o objects in place in case we decided 4338 eval cmds=\"$old_archive_cmds\"
4187 # # not to build a shared library, and have fallen back to building 4339
4188 # # static libs even though --disable-static was passed! 4340 if len=`expr "X$cmds" : ".*"` &&
4189 # for oldobj in $oldobjs; do 4341 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4190 # if test ! -f $oldobj; then 4342 :
4191 # xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'` 4343 else
4192 # if test "X$xdir" = "X$oldobj"; then 4344 # the command line is too long to link in one step, link in parts
4193 # xdir="." 4345 $echo "using piecewise archive linking..."
4194 # else
4195 # xdir="$xdir"
4196 # fi
4197 # baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
4198 # obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
4199 # $show "(cd $xdir && ${LN_S} $obj $baseobj)"
4200 # $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
4201 # fi
4202 # done
4203
4204 compiler_flags="$compiler_flags $add_flags"
4205 eval cmds=\"$old_archive_cmds\"
4206
4207 if len=`expr "X$cmds" : ".*"` &&
4208 test $len -le $max_cmd_len; then
4209 :
4210 else
4211 # the command line is too long to link in one step, link in parts
4212 $echo "using piecewise archive linking..."
4213 save_RANLIB=$RANLIB 4346 save_RANLIB=$RANLIB
4214 RANLIB=: 4347 RANLIB=:
4215 objlist= 4348 objlist=
4216 concat_cmds= 4349 concat_cmds=
4217 save_oldobjs=$oldobjs 4350 save_oldobjs=$oldobjs
4218 for obj in $save_oldobjs 4351 for obj in $save_oldobjs
4219 do 4352 do
4220 oldobjs="$objlist $obj" 4353 oldobjs="$objlist $obj"
4221 objlist="$objlist $obj" 4354 objlist="$objlist $obj"
4222 eval test_cmds=\"$old_archive_cmds\" 4355 eval test_cmds=\"$old_archive_cmds\"
4223 if len=`expr "X$test_cmds" : ".*"` && 4356 if len=`expr "X$test_cmds" : ".*"` &&
4224 test $len -le $max_cmd_len; then 4357 test "$len" -le "$max_cmd_len"; then
4225 : 4358 :
4226 else 4359 else
4227 # the above command should be used before it gets too long 4360 # the above command should be used before it gets too long
4228 oldobjs=$objlist 4361 oldobjs=$objlist
4229 test -z "$concat_cmds" || concat_cmds=$concat_cmds~ 4362 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
4230 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" 4363 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
4231 objlist= 4364 objlist=
4232 fi 4365 fi
4233 done 4366 done
4234 RANLIB=$save_RANLIB 4367 RANLIB=$save_RANLIB
4235 oldobjs=$objlist 4368 oldobjs=$objlist
4236 eval cmds=\"\$concat_cmds~$old_archive_cmds\" 4369 eval cmds=\"\$concat_cmds~$old_archive_cmds\"
4237 fi 4370 fi
4238 fi 4371 fi
4239 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' 4372 save_ifs="$IFS"; IFS='~'
4240 for cmd in $cmds; do 4373 for cmd in $cmds; do
4241 IFS="$save_ifs" 4374 IFS="$save_ifs"
4242 $show "$cmd" 4375 $show "$cmd"
4243 $run eval "$cmd" || exit $? 4376 $run eval "$cmd" || exit $?
4244 done 4377 done
4267 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` 4400 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4268 relink_command="$var=\"$var_value\"; export $var; $relink_command" 4401 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4269 fi 4402 fi
4270 done 4403 done
4271 # Quote the link command for shipping. 4404 # Quote the link command for shipping.
4272 relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args" 4405 relink_command="($relink_command; cd `pwd`; $SHELL $0 --mode=relink $libtool_args)"
4273 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` 4406 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4274 4407
4275 # Only create the output if not a dry run. 4408 # Only create the output if not a dry run.
4276 if test -z "$run"; then 4409 if test -z "$run"; then
4277 for installed in no yes; do 4410 for installed in no yes; do
4284 newdependency_libs= 4417 newdependency_libs=
4285 for deplib in $dependency_libs; do 4418 for deplib in $dependency_libs; do
4286 case $deplib in 4419 case $deplib in
4287 *.la) 4420 *.la)
4288 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` 4421 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
4289 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` 4422 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
4290 if test -z "$libdir"; then 4423 if test -z "$libdir"; then
4291 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 4424 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
4292 exit 1 4425 exit 1
4293 fi 4426 fi
4294 newdependency_libs="$newdependency_libs $libdir/$name" 4427 newdependency_libs="$newdependency_libs $libdir/$name"
4298 done 4431 done
4299 dependency_libs="$newdependency_libs" 4432 dependency_libs="$newdependency_libs"
4300 newdlfiles= 4433 newdlfiles=
4301 for lib in $dlfiles; do 4434 for lib in $dlfiles; do
4302 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` 4435 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4303 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` 4436 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4304 if test -z "$libdir"; then 4437 if test -z "$libdir"; then
4305 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 4438 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4306 exit 1 4439 exit 1
4307 fi 4440 fi
4308 newdlfiles="$newdlfiles $libdir/$name" 4441 newdlfiles="$newdlfiles $libdir/$name"
4309 done 4442 done
4310 dlfiles="$newdlfiles" 4443 dlfiles="$newdlfiles"
4311 newdlprefiles= 4444 newdlprefiles=
4312 for lib in $dlprefiles; do 4445 for lib in $dlprefiles; do
4313 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` 4446 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4314 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` 4447 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4315 if test -z "$libdir"; then 4448 if test -z "$libdir"; then
4316 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 4449 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4317 exit 1 4450 exit 1
4318 fi 4451 fi
4319 newdlprefiles="$newdlprefiles $libdir/$name" 4452 newdlprefiles="$newdlprefiles $libdir/$name"
4357 dlopen='$dlfiles' 4490 dlopen='$dlfiles'
4358 dlpreopen='$dlprefiles' 4491 dlpreopen='$dlprefiles'
4359 4492
4360 # Directory that this library needs to be installed in: 4493 # Directory that this library needs to be installed in:
4361 libdir='$install_libdir'" 4494 libdir='$install_libdir'"
4362 if test $hardcode_into_libs = all && 4495 if test "$installed" = no && test "$need_relink" = yes && test "$fast_install" = no; then
4363 test "$installed" = no && test $need_relink = yes; then
4364 $echo >> $output "\ 4496 $echo >> $output "\
4365 relink_command=\"$relink_command\"" 4497 relink_command=\"$relink_command\""
4366 fi 4498 fi
4367 done 4499 done
4368 fi 4500 fi
4494 test "X$destdir" = "X$dest" && destdir=. 4626 test "X$destdir" = "X$dest" && destdir=.
4495 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` 4627 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
4496 4628
4497 # Not a directory, so check to see that there is only one file specified. 4629 # Not a directory, so check to see that there is only one file specified.
4498 set dummy $files 4630 set dummy $files
4499 if test $# -gt 2; then 4631 if test "$#" -gt 2; then
4500 $echo "$modename: \`$dest' is not a directory" 1>&2 4632 $echo "$modename: \`$dest' is not a directory" 1>&2
4501 $echo "$help" 1>&2 4633 $echo "$help" 1>&2
4502 exit 1 4634 exit 1
4503 fi 4635 fi
4504 fi 4636 fi
4534 staticlibs="$staticlibs $file" 4666 staticlibs="$staticlibs $file"
4535 ;; 4667 ;;
4536 4668
4537 *.la) 4669 *.la)
4538 # Check to see that this really is a libtool archive. 4670 # Check to see that this really is a libtool archive.
4539 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : 4671 if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4540 else 4672 else
4541 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 4673 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
4542 $echo "$help" 1>&2 4674 $echo "$help" 1>&2
4543 exit 1 4675 exit 1
4544 fi 4676 fi
4568 4700
4569 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ 4701 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
4570 test "X$dir" = "X$file/" && dir= 4702 test "X$dir" = "X$file/" && dir=
4571 dir="$dir$objdir" 4703 dir="$dir$objdir"
4572 4704
4573 if test "$hardcode_into_libs" = all && test -n "$relink_command"; then 4705 if test -n "$relink_command"; then
4574 $echo "$modename: warning: relinking \`$file'" 1>&2 4706 $echo "$modename: warning: relinking \`$file'" 1>&2
4575 $show "$relink_command" 4707 $show "$relink_command"
4576 if $run eval "$relink_command"; then : 4708 if $run eval "$relink_command"; then :
4577 else 4709 else
4578 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 4710 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4586 realname="$2" 4718 realname="$2"
4587 shift 4719 shift
4588 shift 4720 shift
4589 4721
4590 srcname="$realname" 4722 srcname="$realname"
4591 test "$hardcode_into_libs" = all && test -n "$relink_command" && srcname="$realname"T 4723 test -n "$relink_command" && srcname="$realname"T
4592 4724
4593 # Install the shared library and build the symlinks. 4725 # Install the shared library and build the symlinks.
4594 $show "$install_prog $dir/$srcname $destdir/$realname" 4726 $show "$install_prog $dir/$srcname $destdir/$realname"
4595 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? 4727 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
4596 if test -n "$stripme" && test -n "$striplib"; then 4728 if test -n "$stripme" && test -n "$striplib"; then
4597 $show "$striplib $destdir/$realname" 4729 $show "$striplib $destdir/$realname"
4598 $run eval "$striplib $destdir/$realname" || exit $? 4730 $run eval "$striplib $destdir/$realname" || exit $?
4599 fi 4731 fi
4600 4732
4601 if test $# -gt 0; then 4733 if test "$#" -gt 0; then
4602 # Delete the old symlinks, and create new ones. 4734 # Delete the old symlinks, and create new ones.
4603 for linkname 4735 for linkname
4604 do 4736 do
4605 if test "$linkname" != "$realname"; then 4737 if test "$linkname" != "$realname"; then
4606 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" 4738 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4610 fi 4742 fi
4611 4743
4612 # Do each command in the postinstall commands. 4744 # Do each command in the postinstall commands.
4613 lib="$destdir/$realname" 4745 lib="$destdir/$realname"
4614 eval cmds=\"$postinstall_cmds\" 4746 eval cmds=\"$postinstall_cmds\"
4615 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' 4747 save_ifs="$IFS"; IFS='~'
4616 for cmd in $cmds; do 4748 for cmd in $cmds; do
4617 IFS="$save_ifs" 4749 IFS="$save_ifs"
4618 $show "$cmd" 4750 $show "$cmd"
4619 $run eval "$cmd" || exit $? 4751 $run eval "$cmd" || exit $?
4620 done 4752 done
4683 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` 4815 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4684 destfile="$destdir/$destfile" 4816 destfile="$destdir/$destfile"
4685 fi 4817 fi
4686 4818
4687 # Do a test to see if this is really a libtool program. 4819 # Do a test to see if this is really a libtool program.
4688 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 4820 case $host in
4689 uninst_deplibs= 4821 *cygwin*|*mingw*)
4822 wrapper=`echo $file | ${SED} -e 's,.exe$,,'`
4823 ;;
4824 *)
4825 wrapper=$file
4826 ;;
4827 esac
4828 if (${SED} -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
4829 notinst_deplibs=
4690 relink_command= 4830 relink_command=
4691 4831
4692 # If there is no directory component, then add one. 4832 # If there is no directory component, then add one.
4693 case $file in 4833 case $file in
4694 */* | *\\*) . $file ;; 4834 */* | *\\*) . $wrapper ;;
4695 *) . ./$file ;; 4835 *) . ./$wrapper ;;
4696 esac 4836 esac
4697 4837
4698 # Check the variables that should have been set. 4838 # Check the variables that should have been set.
4699 if test -z "$uninst_deplibs"; then 4839 if test -z "$notinst_deplibs"; then
4700 $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2 4840 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
4701 exit 1 4841 exit 1
4702 fi 4842 fi
4703 4843
4704 finalize=yes 4844 finalize=yes
4705 for lib in $uninst_deplibs; do 4845 for lib in $notinst_deplibs; do
4706 # Check to see that each library is installed. 4846 # Check to see that each library is installed.
4707 libdir= 4847 libdir=
4708 if test -f "$lib"; then 4848 if test -f "$lib"; then
4709 # If there is no directory component, then add one. 4849 # If there is no directory component, then add one.
4710 case $lib in 4850 case $lib in
4757 # Install the binary that we compiled earlier. 4897 # Install the binary that we compiled earlier.
4758 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` 4898 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
4759 fi 4899 fi
4760 fi 4900 fi
4761 4901
4762
4763 # remove .exe since cygwin /usr/bin/install will append another 4902 # remove .exe since cygwin /usr/bin/install will append another
4764 # one anyways 4903 # one anyways
4765 case $install_prog,$host in 4904 case $install_prog,$host in
4766 */usr/bin/install*,*cygwin*) 4905 */usr/bin/install*,*cygwin*)
4767 case $file:$destfile in 4906 case $file:$destfile in
4770 ;; 4909 ;;
4771 *.exe:*) 4910 *.exe:*)
4772 destfile=$destfile.exe 4911 destfile=$destfile.exe
4773 ;; 4912 ;;
4774 *:*.exe) 4913 *:*.exe)
4775 destfile=`echo $destfile | sed -e 's,.exe$,,'` 4914 destfile=`echo $destfile | ${SED} -e 's,.exe$,,'`
4776 ;; 4915 ;;
4777 esac 4916 esac
4778 ;; 4917 ;;
4779 esac 4918 esac
4780
4781 $show "$install_prog$stripme $file $destfile" 4919 $show "$install_prog$stripme $file $destfile"
4782 $run eval "$install_prog\$stripme \$file \$destfile" || exit $? 4920 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
4783 test -n "$outputname" && ${rm}r "$tmpdir" 4921 test -n "$outputname" && ${rm}r "$tmpdir"
4784 ;; 4922 ;;
4785 esac 4923 esac
4799 $run eval "$old_striplib $oldlib" || exit $? 4937 $run eval "$old_striplib $oldlib" || exit $?
4800 fi 4938 fi
4801 4939
4802 # Do each command in the postinstall commands. 4940 # Do each command in the postinstall commands.
4803 eval cmds=\"$old_postinstall_cmds\" 4941 eval cmds=\"$old_postinstall_cmds\"
4804 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' 4942 save_ifs="$IFS"; IFS='~'
4805 for cmd in $cmds; do 4943 for cmd in $cmds; do
4806 IFS="$save_ifs" 4944 IFS="$save_ifs"
4807 $show "$cmd" 4945 $show "$cmd"
4808 $run eval "$cmd" || exit $? 4946 $run eval "$cmd" || exit $?
4809 done 4947 done
4815 fi 4953 fi
4816 4954
4817 if test -n "$current_libdirs"; then 4955 if test -n "$current_libdirs"; then
4818 # Maybe just do a dry run. 4956 # Maybe just do a dry run.
4819 test -n "$run" && current_libdirs=" -n$current_libdirs" 4957 test -n "$run" && current_libdirs=" -n$current_libdirs"
4820 exec $SHELL $0 --finish$current_libdirs 4958 exec_cmd='$SHELL $0 --finish$current_libdirs'
4821 exit 1 4959 else
4960 exit 0
4822 fi 4961 fi
4823
4824 exit 0
4825 ;; 4962 ;;
4826 4963
4827 # libtool finish mode 4964 # libtool finish mode
4828 finish) 4965 finish)
4829 modename="$modename: finish" 4966 modename="$modename: finish"
4838 4975
4839 for libdir in $libdirs; do 4976 for libdir in $libdirs; do
4840 if test -n "$finish_cmds"; then 4977 if test -n "$finish_cmds"; then
4841 # Do each command in the finish commands. 4978 # Do each command in the finish commands.
4842 eval cmds=\"$finish_cmds\" 4979 eval cmds=\"$finish_cmds\"
4843 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' 4980 save_ifs="$IFS"; IFS='~'
4844 for cmd in $cmds; do 4981 for cmd in $cmds; do
4845 IFS="$save_ifs" 4982 IFS="$save_ifs"
4846 $show "$cmd" 4983 $show "$cmd"
4847 $run eval "$cmd" || admincmds="$admincmds 4984 $run eval "$cmd" || admincmds="$admincmds
4848 $cmd" 4985 $cmd"
4867 echo " $libdir" 5004 echo " $libdir"
4868 done 5005 done
4869 echo 5006 echo
4870 echo "If you ever happen to want to link against installed libraries" 5007 echo "If you ever happen to want to link against installed libraries"
4871 echo "in a given directory, LIBDIR, you must either use libtool, and" 5008 echo "in a given directory, LIBDIR, you must either use libtool, and"
4872 echo "specify the full pathname of the library, or use \`-LLIBDIR'" 5009 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
4873 echo "flag during linking and do at least one of the following:" 5010 echo "flag during linking and do at least one of the following:"
4874 if test -n "$shlibpath_var"; then 5011 if test -n "$shlibpath_var"; then
4875 echo " - add LIBDIR to the \`$shlibpath_var' environment variable" 5012 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
4876 echo " during execution" 5013 echo " during execution"
4877 fi 5014 fi
4920 5057
4921 dir= 5058 dir=
4922 case $file in 5059 case $file in
4923 *.la) 5060 *.la)
4924 # Check to see that this really is a libtool archive. 5061 # Check to see that this really is a libtool archive.
4925 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : 5062 if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4926 else 5063 else
4927 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 5064 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4928 $echo "$help" 1>&2 5065 $echo "$help" 1>&2
4929 exit 1 5066 exit 1
4930 fi 5067 fi
4991 do 5128 do
4992 case $file in 5129 case $file in
4993 -*) ;; 5130 -*) ;;
4994 *) 5131 *)
4995 # Do a test to see if this is really a libtool program. 5132 # Do a test to see if this is really a libtool program.
4996 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 5133 if (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4997 # If there is no directory component, then add one. 5134 # If there is no directory component, then add one.
4998 case $file in 5135 case $file in
4999 */* | *\\*) . $file ;; 5136 */* | *\\*) . $file ;;
5000 *) . ./$file ;; 5137 *) . ./$file ;;
5001 esac 5138 esac
5022 fi 5159 fi
5023 if test "${save_LANG+set}" = set; then 5160 if test "${save_LANG+set}" = set; then
5024 LANG="$save_LANG"; export LANG 5161 LANG="$save_LANG"; export LANG
5025 fi 5162 fi
5026 5163
5027 # Now actually exec the command. 5164 # Now prepare to actually exec the command.
5028 eval "exec \$cmd$args" 5165 exec_cmd="\$cmd$args"
5029
5030 $echo "$modename: cannot exec \$cmd$args"
5031 exit 1
5032 else 5166 else
5033 # Display what would be done. 5167 # Display what would be done.
5034 if test -n "$shlibpath_var"; then 5168 if test -n "$shlibpath_var"; then
5035 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" 5169 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
5036 $echo "export $shlibpath_var" 5170 $echo "export $shlibpath_var"
5043 # libtool clean and uninstall mode 5177 # libtool clean and uninstall mode
5044 clean | uninstall) 5178 clean | uninstall)
5045 modename="$modename: $mode" 5179 modename="$modename: $mode"
5046 rm="$nonopt" 5180 rm="$nonopt"
5047 files= 5181 files=
5182 rmforce=
5183 exit_status=0
5048 5184
5049 # This variable tells wrapper scripts just to set variables rather 5185 # This variable tells wrapper scripts just to set variables rather
5050 # than running their programs. 5186 # than running their programs.
5051 libtool_install_magic="$magic" 5187 libtool_install_magic="$magic"
5052 5188
5053 for arg 5189 for arg
5054 do 5190 do
5055 case $arg in 5191 case $arg in
5192 -f) rm="$rm $arg"; rmforce=yes ;;
5056 -*) rm="$rm $arg" ;; 5193 -*) rm="$rm $arg" ;;
5057 *) files="$files $arg" ;; 5194 *) files="$files $arg" ;;
5058 esac 5195 esac
5059 done 5196 done
5060 5197
5073 objdir="$objdir" 5210 objdir="$objdir"
5074 else 5211 else
5075 objdir="$dir/$objdir" 5212 objdir="$dir/$objdir"
5076 fi 5213 fi
5077 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` 5214 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5078 test $mode = uninstall && objdir="$dir" 5215 test "$mode" = uninstall && objdir="$dir"
5079 5216
5080 # Remember objdir for removal later, being careful to avoid duplicates 5217 # Remember objdir for removal later, being careful to avoid duplicates
5081 if test $mode = clean; then 5218 if test "$mode" = clean; then
5082 case " $rmdirs " in 5219 case " $rmdirs " in
5083 *" $objdir "*) ;; 5220 *" $objdir "*) ;;
5084 *) rmdirs="$rmdirs $objdir" ;; 5221 *) rmdirs="$rmdirs $objdir" ;;
5085 esac 5222 esac
5086 fi 5223 fi
5087 5224
5225 # Don't error if the file doesn't exist and rm -f was used.
5226 if (test -L "$file") >/dev/null 2>&1 \
5227 || (test -h "$file") >/dev/null 2>&1 \
5228 || test -f "$file"; then
5229 :
5230 elif test -d "$file"; then
5231 exit_status=1
5232 continue
5233 elif test "$rmforce" = yes; then
5234 continue
5235 fi
5236
5088 rmfiles="$file" 5237 rmfiles="$file"
5089 5238
5090 case $name in 5239 case $name in
5091 *.la) 5240 *.la)
5092 # Possibly a libtool archive, so verify it. 5241 # Possibly a libtool archive, so verify it.
5093 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 5242 if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5094 . $dir/$name 5243 . $dir/$name
5095 5244
5096 # Delete the libtool libraries and symlinks. 5245 # Delete the libtool libraries and symlinks.
5097 for n in $library_names; do 5246 for n in $library_names; do
5098 rmfiles="$rmfiles $objdir/$n" 5247 rmfiles="$rmfiles $objdir/$n"
5099 done 5248 done
5100 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" 5249 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
5101 test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" 5250 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
5102 5251
5103 if test $mode = uninstall; then 5252 if test "$mode" = uninstall; then
5104 if test -n "$library_names"; then 5253 if test -n "$library_names"; then
5105 # Do each command in the postuninstall commands. 5254 # Do each command in the postuninstall commands.
5106 eval cmds=\"$postuninstall_cmds\" 5255 eval cmds=\"$postuninstall_cmds\"
5107 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' 5256 save_ifs="$IFS"; IFS='~'
5108 for cmd in $cmds; do 5257 for cmd in $cmds; do
5109 IFS="$save_ifs" 5258 IFS="$save_ifs"
5110 $show "$cmd" 5259 $show "$cmd"
5111 $run eval "$cmd" 5260 $run eval "$cmd"
5261 if test "$?" -ne 0 && test "$rmforce" != yes; then
5262 exit_status=1
5263 fi
5112 done 5264 done
5113 IFS="$save_ifs" 5265 IFS="$save_ifs"
5114 fi 5266 fi
5115 5267
5116 if test -n "$old_library"; then 5268 if test -n "$old_library"; then
5117 # Do each command in the old_postuninstall commands. 5269 # Do each command in the old_postuninstall commands.
5118 eval cmds=\"$old_postuninstall_cmds\" 5270 eval cmds=\"$old_postuninstall_cmds\"
5119 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' 5271 save_ifs="$IFS"; IFS='~'
5120 for cmd in $cmds; do 5272 for cmd in $cmds; do
5121 IFS="$save_ifs" 5273 IFS="$save_ifs"
5122 $show "$cmd" 5274 $show "$cmd"
5123 $run eval "$cmd" 5275 $run eval "$cmd"
5276 if test "$?" -ne 0 && test "$rmforce" != yes; then
5277 exit_status=1
5278 fi
5124 done 5279 done
5125 IFS="$save_ifs" 5280 IFS="$save_ifs"
5126 fi 5281 fi
5127 # FIXME: should reinstall the best remaining shared library. 5282 # FIXME: should reinstall the best remaining shared library.
5128 fi 5283 fi
5129 fi 5284 fi
5130 ;; 5285 ;;
5131 5286
5132 *.lo) 5287 *.lo)
5133 # Possibly a libtool object, so verify it. 5288 # Possibly a libtool object, so verify it.
5134 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 5289 if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5135 5290
5136 # Read the .lo file 5291 # Read the .lo file
5137 . $dir/$name 5292 . $dir/$name
5138 5293
5139 # Add PIC object to the list of files to remove. 5294 # Add PIC object to the list of files to remove.
5140 if test -n "$pic_object" \ 5295 if test -n "$pic_object" \
5141 && test "$pic_object" != none; then 5296 && test "$pic_object" != none; then
5142 rmfiles="$rmfiles $dir/$pic_object" 5297 rmfiles="$rmfiles $dir/$pic_object"
5143 fi 5298 fi
5144 5299
5145 # Add non-PIC object to the list of files to remove. 5300 # Add non-PIC object to the list of files to remove.
5146 if test -n "$non_pic_object" \ 5301 if test -n "$non_pic_object" \
5147 && test "$non_pic_object" != none; then 5302 && test "$non_pic_object" != none; then
5148 rmfiles="$rmfiles $dir/$non_pic_object" 5303 rmfiles="$rmfiles $dir/$non_pic_object"
5149 fi 5304 fi
5150 fi 5305 fi
5151 ;; 5306 ;;
5152 5307
5153 *) 5308 *)
5154 # Do a test to see if this is a libtool program. 5309 # Do a test to see if this is a libtool program.
5155 if test $mode = clean && 5310 if test "$mode" = clean &&
5156 (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 5311 (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5157 relink_command= 5312 relink_command=
5158 . $dir/$file 5313 . $dir/$file
5159 5314
5160 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" 5315 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
5161 if test "$fast_install" = yes && test -n "$relink_command"; then 5316 if test "$fast_install" = yes && test -n "$relink_command"; then
5163 fi 5318 fi
5164 fi 5319 fi
5165 ;; 5320 ;;
5166 esac 5321 esac
5167 $show "$rm $rmfiles" 5322 $show "$rm $rmfiles"
5168 $run $rm $rmfiles 5323 $run $rm $rmfiles || exit_status=1
5169 done 5324 done
5170 5325
5171 # Try to remove the ${objdir}s in the directories where we deleted files 5326 # Try to remove the ${objdir}s in the directories where we deleted files
5172 for dir in $rmdirs; do 5327 for dir in $rmdirs; do
5173 if test -d "$dir"; then 5328 if test -d "$dir"; then
5174 $show "rmdir $dir" 5329 $show "rmdir $dir"
5175 $run rmdir $dir >/dev/null 2>&1 5330 $run rmdir $dir >/dev/null 2>&1
5176 fi 5331 fi
5177 done 5332 done
5178 5333
5179 exit 0 5334 exit $exit_status
5180 ;; 5335 ;;
5181 5336
5182 "") 5337 "")
5183 $echo "$modename: you must specify a MODE" 1>&2 5338 $echo "$modename: you must specify a MODE" 1>&2
5184 $echo "$generic_help" 1>&2 5339 $echo "$generic_help" 1>&2
5185 exit 1 5340 exit 1
5186 ;; 5341 ;;
5187 esac 5342 esac
5188 5343
5189 $echo "$modename: invalid operation mode \`$mode'" 1>&2 5344 if test -z "$exec_cmd"; then
5190 $echo "$generic_help" 1>&2 5345 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5346 $echo "$generic_help" 1>&2
5347 exit 1
5348 fi
5349 fi # test -z "$show_help"
5350
5351 if test -n "$exec_cmd"; then
5352 eval exec $exec_cmd
5191 exit 1 5353 exit 1
5192 fi # test -z "$show_help" 5354 fi
5193 5355
5194 # We need to display help for each of the modes. 5356 # We need to display help for each of the modes.
5195 case $mode in 5357 case $mode in
5196 "") $echo \ 5358 "") $echo \
5197 "Usage: $modename [OPTION]... [MODE-ARG]... 5359 "Usage: $modename [OPTION]... [MODE-ARG]...
5246 Compile a source file into a libtool library object. 5408 Compile a source file into a libtool library object.
5247 5409
5248 This mode accepts the following additional options: 5410 This mode accepts the following additional options:
5249 5411
5250 -o OUTPUT-FILE set the output file name to OUTPUT-FILE 5412 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
5413 -prefer-pic try to building PIC objects only
5414 -prefer-non-pic try to building non-PIC objects only
5251 -static always build a \`.o' file suitable for static linking 5415 -static always build a \`.o' file suitable for static linking
5252 5416
5253 COMPILE-COMMAND is a command to be used in creating a \`standard' object file 5417 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
5254 from the given SOURCEFILE. 5418 from the given SOURCEFILE.
5255 5419
5391 # support having both static and shared libraries enabled at the same 5555 # support having both static and shared libraries enabled at the same
5392 # time on that platform, so we default to a shared-only configuration. 5556 # time on that platform, so we default to a shared-only configuration.
5393 # If a disable-shared tag is given, we'll fallback to a static-only 5557 # If a disable-shared tag is given, we'll fallback to a static-only
5394 # configuration. But we'll never go from static-only to shared-only. 5558 # configuration. But we'll never go from static-only to shared-only.
5395 5559
5396 ### BEGIN LIBTOOL TAG CONFIG: disable-shared 5560 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
5397 build_libtool_libs=no 5561 build_libtool_libs=no
5398 build_old_libs=yes 5562 build_old_libs=yes
5399 ### END LIBTOOL TAG CONFIG: disable-shared 5563 # ### END LIBTOOL TAG CONFIG: disable-shared
5400 5564
5401 ### BEGIN LIBTOOL TAG CONFIG: disable-static 5565 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
5402 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` 5566 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
5403 ### END LIBTOOL TAG CONFIG: disable-static 5567 # ### END LIBTOOL TAG CONFIG: disable-static
5404 5568
5405 # Local Variables: 5569 # Local Variables:
5406 # mode:shell-script 5570 # mode:shell-script
5407 # sh-indentation:2 5571 # sh-indentation:2
5408 # End: 5572 # End: