1 # ltmain.sh - Provide generalized library-building support services.
2 # NOTE: Changing this file will not affect anything until you rerun configure.
4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003
5 # Free Software Foundation, Inc.
6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 # As a special exception to the GNU General Public License, if you
23 # distribute this file as part of a program that contains a
24 # configuration script generated by Autoconf, you may include it under
25 # the same distribution terms that you use for the rest of that program.
27 # Check that we have a working $echo.
28 if test "X$1" = X--no-reexec
; then
29 # Discard the --no-reexec flag, and continue.
31 elif test "X$1" = X--fallback-echo
; then
32 # Avoid inline document here, it may be left over
34 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
35 # Yippee, $echo works!
38 # Restart under the correct shell, and then maybe $echo will work.
39 exec $SHELL "$0" --no-reexec ${1+"$@"}
42 if test "X$1" = X--fallback-echo
; then
43 # used as fallback echo
51 # The name of this program.
52 progname
=`$echo "$0" | ${SED} 's%^.*/%%'`
59 TIMESTAMP
=" (1.1220 2003/04/05 19:32:58)"
62 help="Try \`$progname --help' for more information."
63 magic
="%%%MAGIC variable%%%"
68 # Sed substitution that helps us do robust quoting. It backslashifies
69 # metacharacters that are still active within double-quoted strings.
70 Xsed
="${SED}"' -e 1s/^X//'
71 sed_quote_subst
='s/\([\\`\\"$\\\\]\)/\\\1/g'
72 # test EBCDIC or ASCII
73 case `echo A|od -x` in
74 *[Cc
]1*) # EBCDIC based system
75 SP2NL
="tr '\100' '\n'"
76 NL2SP
="tr '\r\n' '\100\100'"
78 *) # Assume ASCII based system
79 SP2NL
="tr '\040' '\012'"
80 NL2SP
="tr '\015\012' '\040\040'"
85 # Only set LANG and LC_ALL to C if already set.
86 # These must not be set unconditionally because not all systems understand
87 # e.g. LANG=C (notably SCO).
88 # We save the old values to restore during execute mode.
89 if test "${LC_ALL+set}" = set; then
90 save_LC_ALL
="$LC_ALL"; LC_ALL
=C
; export LC_ALL
92 if test "${LANG+set}" = set; then
93 save_LANG
="$LANG"; LANG
=C
; export LANG
96 # Make sure IFS has a sensible default
99 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
100 $echo "$modename: not configured to build any kind of library" 1>&2
101 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
114 lo2o
="s/\\.lo\$/.${objext}/"
115 o2lo
="s/\\.${objext}\$/.lo/"
117 #####################################
118 # Shell function definitions:
119 # This seems to be the best place for them
121 # Need a lot of goo to handle *both* DLLs and import libs
122 # Has to be a shell function in order to 'eat' the argument
123 # that is supplied when $file_magic_command is called.
125 win32_libid_type
="unknown"
126 win32_fileres
=`file -L $1 2>/dev/null`
127 case $win32_fileres in
128 *ar\ archive\ import\ library
*) # definitely import
129 win32_libid_type
="x86 archive import"
131 *ar\ archive
*) # could be an import, or static
132 if eval $OBJDUMP -f $1 |
$SED -e '10q' 2>/dev
/null | \
133 grep -E 'file format pe-i386(.*architecture: i386)?' >/dev
/null
; then
134 win32_nmres
=`eval $NM -f posix -A $1 | \
135 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
136 if test "X$win32_nmres" = "Ximport" ; then
137 win32_libid_type
="x86 archive import"
139 win32_libid_type
="x86 archive static"
144 win32_libid_type
="x86 DLL"
146 *executable
*) # but shell scripts are "executable" too...
147 case $win32_fileres in
148 *MS\ Windows\ PE\ Intel
*)
149 win32_libid_type
="x86 DLL"
154 $echo $win32_libid_type
157 # End of Shell function definitions
158 #####################################
160 # Parse our command line options once, thoroughly.
161 while test "$#" -gt 0
167 -*=*) optarg
=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
171 # If the previous option needs an argument, assign it.
172 if test -n "$prev"; then
175 execute_dlfiles
="$execute_dlfiles $arg"
180 # Check whether tagname contains only valid characters
183 $echo "$progname: invalid tag name: $tagname" 1>&2
190 # Don't test for the "default" C tag, as we know, it's there, but
191 # not specially marked.
194 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev
/null
; then
195 taglist
="$taglist $tagname"
196 # Evaluate the configuration.
197 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
199 $echo "$progname: ignoring unknown tag $tagname" 1>&2
214 # Have we seen a non-optional argument yet?
221 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
223 $echo "Copyright (C) 2003 Free Software Foundation, Inc."
224 $echo "This is free software; see the source for copying conditions. There is NO"
225 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
230 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
231 # Now print the configurations for the tags.
232 for tagname
in $taglist; do
233 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
239 $echo "$progname: enabling shell trace mode"
249 if test "$build_libtool_libs" = yes; then
250 $echo "enable shared libraries"
252 $echo "disable shared libraries"
254 if test "$build_old_libs" = yes; then
255 $echo "enable static libraries"
257 $echo "disable static libraries"
262 --finish) mode
="finish" ;;
264 --mode) prevopt
="--mode" prev
=mode
;;
265 --mode=*) mode
="$optarg" ;;
267 --preserve-dup-deps) duplicate_deps
="yes" ;;
273 --tag) prevopt
="--tag" prev
=tag
;;
275 set tag
"$optarg" ${1+"$@"}
286 $echo "$modename: unrecognized option \`$arg'" 1>&2
298 if test -n "$prevopt"; then
299 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
304 # If this variable is set in any of the actions, the command in it
305 # will be execed at the end. This prevents here-documents from being
306 # left over by shells.
309 if test -z "$show_help"; then
313 # For darwin, separate arch arguments and apply them to all compile/link
318 if test -n "$doarch"; then
319 archargs
="$archargs -arch $arg"
329 # Infer the operation mode.
330 if test -z "$mode"; then
331 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
332 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
334 *cc | cc
* |
*++ | gcc
* |
*-gcc* | g
++* | xlc
*)
346 *db |
*dbx |
*strace |
*truss
)
356 # If we have no mode, but dlfiles were specified, then do execute mode.
357 test -n "$execute_dlfiles" && mode
=execute
359 # Just use the default operation mode.
360 if test -z "$mode"; then
361 if test -n "$nonopt"; then
362 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
364 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
371 # Only execute mode is allowed to have -dlopen flags.
372 if test -n "$execute_dlfiles" && test "$mode" != execute
; then
373 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
378 # Change the help message to a mode-specific one.
380 help="Try \`$modename --help --mode=$mode' for more information."
382 # These modes are in order of execution frequency so that they run quickly.
384 # libtool compile mode
386 modename
="$modename: compile"
387 # Get the compilation command and the source file.
389 srcfile
="$nonopt" # always keep a non-empty value in "srcfile"
398 # do not "continue". Instead, add this to base_compile
410 # Accept any command-line options.
413 if test -n "$libobj" ; then
414 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
437 arg_mode
=arg
# the next one goes into the "base_compile" arg list
438 continue # The current "srcfile" will either be retained or
439 ;; # replaced later. I would guess that would be a bug.
442 args
=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
444 save_ifs
="$IFS"; IFS
=','
448 # Double-quote args containing other shell metacharacters.
449 # Many Bourne shells cannot handle close brackets correctly
450 # in scan sets, so we specify it separately.
452 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
456 lastarg
="$lastarg $arg"
459 lastarg
=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
461 # Add the arguments to base_compile.
462 base_compile
="$base_compile $lastarg"
467 # Accept the current argument as the source file.
468 # The previous "srcfile" becomes the current argument.
475 esac # case $arg_mode
477 # Aesthetically quote the previous argument.
478 lastarg
=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
481 # Double-quote args containing other shell metacharacters.
482 # Many Bourne shells cannot handle close brackets correctly
483 # in scan sets, so we specify it separately.
484 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
485 lastarg
="\"$lastarg\""
489 base_compile
="$base_compile $lastarg"
494 $echo "$modename: you must specify an argument for -Xcompile"
498 $echo "$modename: you must specify a target with \`-o'" 1>&2
502 # Get the name of the library object.
503 [ -z "$libobj" ] && libobj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
507 # Recognize several different file suffixes.
508 # If the user specifies -o file.o, it is replaced with file.lo
518 *.class
) xform
=class
;;
523 *.java
) xform
=java
;;
526 libobj
=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
529 *.lo
) obj
=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
531 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
536 # Infer tagged configuration to use if any are available and
537 # if one wasn't chosen via the "--tag" command line option.
538 # Only attempt this if the compiler in the base compile
539 # command doesn't match the default compiler.
540 if test -n "$available_tags" && test -z "$tagname"; then
541 case $base_compile in
542 # Blanks in the command may have been stripped by the calling shell,
543 # but not from the CC environment variable when configure was run.
544 " $CC "* |
"$CC "* |
" `$echo $CC` "* |
"`$echo $CC` "*) ;;
545 # Blanks at the start of $base_compile will cause this to fail
546 # if we don't check for them as well.
548 for z
in $available_tags; do
549 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev
/null
; then
550 # Evaluate the configuration.
551 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
552 case "$base_compile " in
553 "$CC "* |
" $CC "* |
"`$echo $CC` "* |
" `$echo $CC` "*)
554 # The compiler in the base compile command matches
555 # the one in the tagged configuration.
556 # Assume this is the tagged configuration we want.
563 # If $tagname still isn't set, then no tagged configuration
564 # was found and let the user know that the "--tag" command
565 # line option must be used.
566 if test -z "$tagname"; then
567 $echo "$modename: unable to infer tagged configuration"
568 $echo "$modename: specify a tag with \`--tag'" 1>&2
571 # $echo "$modename: using $tagname tagged configuration"
577 objname
=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
578 xdir
=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
579 if test "X$xdir" = "X$obj"; then
584 lobj
=${xdir}$objdir/$objname
586 if test -z "$base_compile"; then
587 $echo "$modename: you must specify a compilation command" 1>&2
592 # Delete any leftover library objects.
593 if test "$build_old_libs" = yes; then
594 removelist
="$obj $lobj $libobj ${libobj}T"
596 removelist
="$lobj $libobj ${libobj}T"
600 trap "$run $rm $removelist; exit 1" 1 2 15
602 # On Cygwin there's no "real" PIC flag so we must build both object types
604 cygwin
* | mingw
* | pw32
* | os2
*)
608 if test "$pic_mode" = no
&& test "$deplibs_check_method" != pass_all
; then
609 # non-PIC code in shared libraries is not supported
613 # Calculate the filename of the output object if compiler does
614 # not support -o with -c
615 if test "$compiler_c_o" = no
; then
616 output_obj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.
${objext}
617 lockfile
="$output_obj.lock"
618 removelist
="$removelist $output_obj $lockfile"
619 trap "$run $rm $removelist; exit 1" 1 2 15
626 # Lock this critical section if it is needed
627 # We use this script file to make the link, it avoids creating a new file
628 if test "$need_locks" = yes; then
629 until $run ln "$0" "$lockfile" 2>/dev
/null
; do
630 $show "Waiting for $lockfile to be removed"
633 elif test "$need_locks" = warn
; then
634 if test -f "$lockfile"; then
636 *** ERROR, $lockfile exists and contains:
637 `cat $lockfile 2>/dev/null`
639 This indicates that another process is trying to use the same
640 temporary object file, and libtool could not work around it because
641 your compiler does not support \`-c' and \`-o' together. If you
642 repeat this compilation, it may succeed, by chance, but you had better
643 avoid parallel builds (make -j) in this platform, or get a better
649 $echo $srcfile > "$lockfile"
652 if test -n "$fix_srcfile_path"; then
653 eval srcfile
=\"$fix_srcfile_path\"
656 $run $rm "$libobj" "${libobj}T"
658 # Create a libtool object file (analogous to a ".la" file),
659 # but don't create it if we're doing a dry run.
660 test -z "$run" && cat > ${libobj}T
<<EOF
661 # $libobj - a libtool object file
662 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
664 # Please DO NOT delete this file!
665 # It is necessary for linking the library.
667 # Name of the PIC object.
670 # Only build a PIC object if we are building libtool libraries.
671 if test "$build_libtool_libs" = yes; then
672 # Without this assignment, base_compile gets emptied.
673 fbsd_hideous_sh_bug
=$base_compile
675 if test "$pic_mode" != no
; then
676 command="$base_compile $srcfile $pic_flag"
678 # Don't build PIC code
679 command="$base_compile $srcfile"
682 if test ! -d "${xdir}$objdir"; then
683 $show "$mkdir ${xdir}$objdir"
684 $run $mkdir ${xdir}$objdir
686 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
691 if test -z "$output_obj"; then
692 # Place PIC objects in $objdir
693 command="$command -o $lobj"
696 $run $rm "$lobj" "$output_obj"
699 if $run eval "$command"; then :
701 test -n "$output_obj" && $run $rm $removelist
705 if test "$need_locks" = warn
&&
706 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
708 *** ERROR, $lockfile contains:
709 `cat $lockfile 2>/dev/null`
711 but it should contain:
714 This indicates that another process is trying to use the same
715 temporary object file, and libtool could not work around it because
716 your compiler does not support \`-c' and \`-o' together. If you
717 repeat this compilation, it may succeed, by chance, but you had better
718 avoid parallel builds (make -j) in this platform, or get a better
725 # Just move the object if needed, then go on to compile the next one
726 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
727 $show "$mv $output_obj $lobj"
728 if $run $mv $output_obj $lobj; then :
736 # Append the name of the PIC object to the libtool object file.
737 test -z "$run" && cat >> ${libobj}T
<<EOF
738 pic_object='$objdir/$objname'
742 # Allow error messages only from the first compilation.
743 suppress_output
=' >/dev/null 2>&1'
745 # No PIC object so indicate it doesn't exist in the libtool
747 test -z "$run" && cat >> ${libobj}T
<<EOF
753 # Only build a position-dependent object if we build old libraries.
754 if test "$build_old_libs" = yes; then
755 if test "$pic_mode" != yes; then
756 # Don't build PIC code
757 command="$base_compile $srcfile"
759 command="$base_compile $srcfile $pic_flag"
761 if test "$compiler_c_o" = yes; then
762 command="$command -o $obj"
765 # Suppress compiler output if we already did a PIC compilation.
766 command="$command$suppress_output"
767 $run $rm "$obj" "$output_obj"
769 if $run eval "$command"; then :
775 if test "$need_locks" = warn
&&
776 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
778 *** ERROR, $lockfile contains:
779 `cat $lockfile 2>/dev/null`
781 but it should contain:
784 This indicates that another process is trying to use the same
785 temporary object file, and libtool could not work around it because
786 your compiler does not support \`-c' and \`-o' together. If you
787 repeat this compilation, it may succeed, by chance, but you had better
788 avoid parallel builds (make -j) in this platform, or get a better
795 # Just move the object if needed
796 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
797 $show "$mv $output_obj $obj"
798 if $run $mv $output_obj $obj; then :
806 # Append the name of the non-PIC object the libtool object file.
807 # Only append if the libtool object file exists.
808 test -z "$run" && cat >> ${libobj}T
<<EOF
809 # Name of the non-PIC object.
810 non_pic_object='$objname'
814 # Append the name of the non-PIC object the libtool object file.
815 # Only append if the libtool object file exists.
816 test -z "$run" && cat >> ${libobj}T
<<EOF
817 # Name of the non-PIC object.
823 $run $mv "${libobj}T" "${libobj}"
825 # Unlock the critical section if it was locked
826 if test "$need_locks" != no
; then
835 modename
="$modename: link"
837 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
838 # It is impossible to link a dll without this setting, and
839 # we shouldn't force the makefile maintainer to figure out
840 # which system we are compiling for in order to pass an extra
841 # flag for every libtool invocation.
844 # FIXME: Unfortunately, there are problems with the above when trying
845 # to make a dll which has undefined symbols, in which case not
846 # even a static library is built. For now, we need to specify
847 # -no-undefined on the libtool link line when we can be certain
848 # that all symbols are satisfied, otherwise we get a static library.
855 libtool_args
="$nonopt"
856 base_compile
="$nonopt"
857 compile_command
="$nonopt"
858 finalize_command
="$nonopt"
871 lib_search_path
=`pwd`
880 export_symbols_regex
=
888 prefer_static_libs
=no
901 # We need to know -static, to get the right output filenames.
905 -all-static |
-static)
906 if test "X$arg" = "X-all-static"; then
907 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
908 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
910 if test -n "$link_static_flag"; then
911 dlopen_self
=$dlopen_self_static
914 if test -z "$pic_flag" && test -n "$link_static_flag"; then
915 dlopen_self
=$dlopen_self_static
918 build_libtool_libs
=no
920 prefer_static_libs
=yes
926 # See if our shared archives depend on static archives.
927 test -n "$old_archive_from_new_cmds" && build_old_libs
=yes
929 # Go through the arguments, transforming them on the way.
930 while test "$#" -gt 0; do
932 base_compile
="$base_compile $arg"
935 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
936 qarg
=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
940 libtool_args
="$libtool_args $qarg"
942 # If the previous option needs an argument, assign it.
943 if test -n "$prev"; then
946 compile_command
="$compile_command @OUTPUT@"
947 finalize_command
="$finalize_command @OUTPUT@"
953 if test "$preload" = no
; then
954 # Add the symbol object into the linking commands.
955 compile_command
="$compile_command @SYMFILE@"
956 finalize_command
="$finalize_command @SYMFILE@"
960 *.la |
*.lo
) ;; # We handle these cases below.
962 if test "$dlself" = no
; then
970 if test "$prev" = dlprefiles
; then
972 elif test "$prev" = dlfiles
&& test "$dlopen_self" != yes; then
982 if test "$prev" = dlfiles
; then
983 dlfiles
="$dlfiles $arg"
985 dlprefiles
="$dlprefiles $arg"
993 export_symbols
="$arg"
994 if test ! -f "$arg"; then
995 $echo "$modename: symbol file \`$arg' does not exist"
1002 export_symbols_regex
="$arg"
1007 inst_prefix_dir
="$arg"
1017 if test -f "$arg"; then
1020 for fil
in `cat $save_arg`
1022 # moreargs="$moreargs $fil"
1024 # A libtool-controlled object.
1026 # Check to see that this really is a libtool object.
1027 if (${SED} -e '2q' $arg |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1032 # If there is no directory component, then add one.
1034 */* |
*\\*) .
$arg ;;
1038 if test -z "$pic_object" || \
1039 test -z "$non_pic_object" ||
1040 test "$pic_object" = none
&& \
1041 test "$non_pic_object" = none
; then
1042 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1046 # Extract subdirectory from the argument.
1047 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1048 if test "X$xdir" = "X$arg"; then
1054 if test "$pic_object" != none
; then
1055 # Prepend the subdirectory the object is found in.
1056 pic_object
="$xdir$pic_object"
1058 if test "$prev" = dlfiles
; then
1059 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1060 dlfiles
="$dlfiles $pic_object"
1064 # If libtool objects are unsupported, then we need to preload.
1069 # CHECK ME: I think I busted this. -Ossama
1070 if test "$prev" = dlprefiles
; then
1071 # Preload the old-style object.
1072 dlprefiles
="$dlprefiles $pic_object"
1077 libobjs
="$libobjs $pic_object"
1082 if test "$non_pic_object" != none
; then
1083 # Prepend the subdirectory the object is found in.
1084 non_pic_object
="$xdir$non_pic_object"
1086 # A standard non-PIC object
1087 non_pic_objects
="$non_pic_objects $non_pic_object"
1088 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1089 arg
="$non_pic_object"
1093 # Only an error if not doing a dry-run.
1094 if test -z "$run"; then
1095 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1100 # Extract subdirectory from the argument.
1101 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1102 if test "X$xdir" = "X$arg"; then
1108 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1109 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1110 libobjs
="$libobjs $pic_object"
1111 non_pic_objects
="$non_pic_objects $non_pic_object"
1116 $echo "$modename: link input file \`$save_arg' does not exist"
1124 # We need an absolute path.
1126 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1128 $echo "$modename: only absolute run-paths are allowed" 1>&2
1132 if test "$prev" = rpath
; then
1135 *) rpath
="$rpath $arg" ;;
1140 *) xrpath
="$xrpath $arg" ;;
1147 compiler_flags
="$compiler_flags $qarg"
1149 compile_command
="$compile_command $qarg"
1150 finalize_command
="$finalize_command $qarg"
1154 linker_flags
="$linker_flags $qarg"
1155 compiler_flags
="$compiler_flags $wl$qarg"
1157 compile_command
="$compile_command $wl$qarg"
1158 finalize_command
="$finalize_command $wl$qarg"
1162 linker_flags
="$linker_flags $qarg"
1163 compiler_flags
="$compiler_flags $qarg"
1165 compile_command
="$compile_command $qarg"
1166 finalize_command
="$finalize_command $qarg"
1170 eval "$prev=\"\$arg\""
1175 fi # test -n "$prev"
1181 if test -n "$link_static_flag"; then
1182 compile_command
="$compile_command $link_static_flag"
1183 finalize_command
="$finalize_command $link_static_flag"
1189 # FIXME: remove this flag sometime in the future.
1190 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1214 -export-symbols |
-export-symbols-regex)
1215 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
1216 $echo "$modename: more than one -exported-symbols argument is not allowed"
1219 if test "X$arg" = "X-export-symbols"; then
1232 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1233 # so, if we see these flags be careful not to treat them like -L
1235 case $with_gcc/$host in
1236 no
/*-*-irix* |
/*-*-irix*)
1237 compile_command
="$compile_command $arg"
1238 finalize_command
="$finalize_command $arg"
1245 dir
=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1246 # We need an absolute path.
1248 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1250 absdir
=`cd "$dir" && pwd`
1251 if test -z "$absdir"; then
1252 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1261 deplibs
="$deplibs -L$dir"
1262 lib_search_path
="$lib_search_path $dir"
1266 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1267 case :$dllsearchpath: in
1269 *) dllsearchpath
="$dllsearchpath:$dir";;
1277 if test "X$arg" = "X-lc" ||
test "X$arg" = "X-lm"; then
1279 *-*-cygwin* |
*-*-pw32* |
*-*-beos*)
1280 # These systems don't actually have a C or math library (as such)
1283 *-*-mingw* |
*-*-os2*)
1284 # These systems don't actually have a C library (as such)
1285 test "X$arg" = "X-lc" && continue
1287 *-*-openbsd* |
*-*-freebsd*)
1288 # Do not include libc due to us having libc/libc_r.
1289 test "X$arg" = "X-lc" && continue
1291 *-*-rhapsody* |
*-*-darwin1.
[012])
1292 # Rhapsody C and math libraries are in the System framework
1293 deplibs
="$deplibs -framework System"
1296 elif test "X$arg" = "X-lc_r"; then
1298 *-*-openbsd* |
*-*-freebsd*)
1299 # Do not include libc_r directly, use -pthread flag.
1304 deplibs
="$deplibs $arg"
1313 # gcc -m* arguments should be passed to the linker via $compiler_flags
1314 # in order to pass architecture information to the linker
1315 # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
1316 # but this is not reliable with gcc because gcc may use -mfoo to
1317 # select a different linker, different libraries, etc, while
1318 # -Wl,-mfoo simply passes -mfoo to the linker.
1320 # Unknown arguments in both finalize_command and compile_command need
1321 # to be aesthetically quoted because they are evaled later.
1322 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1324 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1328 compile_command
="$compile_command $arg"
1329 finalize_command
="$finalize_command $arg"
1330 if test "$with_gcc" = "yes" ; then
1331 compiler_flags
="$compiler_flags $arg"
1348 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1349 # The PATH hackery in wrapper scripts is required on Windows
1350 # in order for the loader to find any dlls it needs.
1351 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1352 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1355 *) no_install
=yes ;;
1388 dir
=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1389 # We need an absolute path.
1391 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1393 $echo "$modename: only absolute run-paths are allowed" 1>&2
1399 *) xrpath
="$xrpath $dir" ;;
1405 # The effects of -static are defined in a previous loop.
1406 # We used to do the same as -all-static on platforms that
1407 # didn't have a PIC flag, but the assumption that the effects
1408 # would be equivalent was wrong. It would break on at least
1409 # Digital Unix and AIX.
1429 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1431 save_ifs
="$IFS"; IFS
=','
1432 for flag
in $args; do
1435 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1440 compiler_flags
="$compiler_flags $flag"
1443 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1447 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1449 save_ifs
="$IFS"; IFS
=','
1450 for flag
in $args; do
1453 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1458 compiler_flags
="$compiler_flags $wl$flag"
1459 linker_flags
="$linker_flags $flag"
1462 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1480 # Some other compiler flag.
1482 # Unknown arguments in both finalize_command and compile_command need
1483 # to be aesthetically quoted because they are evaled later.
1484 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1486 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1493 # A standard object.
1498 # A libtool-controlled object.
1500 # Check to see that this really is a libtool object.
1501 if (${SED} -e '2q' $arg |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1506 # If there is no directory component, then add one.
1508 */* |
*\\*) .
$arg ;;
1512 if test -z "$pic_object" || \
1513 test -z "$non_pic_object" ||
1514 test "$pic_object" = none
&& \
1515 test "$non_pic_object" = none
; then
1516 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1520 # Extract subdirectory from the argument.
1521 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1522 if test "X$xdir" = "X$arg"; then
1528 if test "$pic_object" != none
; then
1529 # Prepend the subdirectory the object is found in.
1530 pic_object
="$xdir$pic_object"
1532 if test "$prev" = dlfiles
; then
1533 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1534 dlfiles
="$dlfiles $pic_object"
1538 # If libtool objects are unsupported, then we need to preload.
1543 # CHECK ME: I think I busted this. -Ossama
1544 if test "$prev" = dlprefiles
; then
1545 # Preload the old-style object.
1546 dlprefiles
="$dlprefiles $pic_object"
1551 libobjs
="$libobjs $pic_object"
1556 if test "$non_pic_object" != none
; then
1557 # Prepend the subdirectory the object is found in.
1558 non_pic_object
="$xdir$non_pic_object"
1560 # A standard non-PIC object
1561 non_pic_objects
="$non_pic_objects $non_pic_object"
1562 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1563 arg
="$non_pic_object"
1567 # Only an error if not doing a dry-run.
1568 if test -z "$run"; then
1569 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1574 # Extract subdirectory from the argument.
1575 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1576 if test "X$xdir" = "X$arg"; then
1582 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1583 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1584 libobjs
="$libobjs $pic_object"
1585 non_pic_objects
="$non_pic_objects $non_pic_object"
1592 deplibs
="$deplibs $arg"
1593 old_deplibs
="$old_deplibs $arg"
1598 # A libtool-controlled library.
1600 if test "$prev" = dlfiles
; then
1601 # This library was specified with -dlopen.
1602 dlfiles
="$dlfiles $arg"
1604 elif test "$prev" = dlprefiles
; then
1605 # The library was specified with -dlpreopen.
1606 dlprefiles
="$dlprefiles $arg"
1609 deplibs
="$deplibs $arg"
1614 # Some other compiler argument.
1616 # Unknown arguments in both finalize_command and compile_command need
1617 # to be aesthetically quoted because they are evaled later.
1618 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1620 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1627 # Now actually substitute the argument into the commands.
1628 if test -n "$arg"; then
1629 compile_command
="$compile_command $arg"
1630 finalize_command
="$finalize_command $arg"
1632 done # argument parsing loop
1634 if test -n "$prev"; then
1635 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1640 # Infer tagged configuration to use if any are available and
1641 # if one wasn't chosen via the "--tag" command line option.
1642 # Only attempt this if the compiler in the base link
1643 # command doesn't match the default compiler.
1644 if test -n "$available_tags" && test -z "$tagname"; then
1645 case $base_compile in
1646 # Blanks in the command may have been stripped by the calling shell,
1647 # but not from the CC environment variable when configure was run.
1648 "$CC "* |
" $CC "* |
"`$echo $CC` "* |
" `$echo $CC` "*) ;;
1649 # Blanks at the start of $base_compile will cause this to fail
1650 # if we don't check for them as well.
1652 for z
in $available_tags; do
1653 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev
/null
; then
1654 # Evaluate the configuration.
1655 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
1656 case $base_compile in
1657 "$CC "* |
" $CC "* |
"`$echo $CC` "* |
" `$echo $CC` "*)
1658 # The compiler in $compile_command matches
1659 # the one in the tagged configuration.
1660 # Assume this is the tagged configuration we want.
1667 # If $tagname still isn't set, then no tagged configuration
1668 # was found and let the user know that the "--tag" command
1669 # line option must be used.
1670 if test -z "$tagname"; then
1671 $echo "$modename: unable to infer tagged configuration"
1672 $echo "$modename: specify a tag with \`--tag'" 1>&2
1675 # $echo "$modename: using $tagname tagged configuration"
1681 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1682 eval arg
=\"$export_dynamic_flag_spec\"
1683 compile_command
="$compile_command $arg"
1684 finalize_command
="$finalize_command $arg"
1688 # calculate the name of the file, without its directory
1689 outputname
=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1690 libobjs_save
="$libobjs"
1692 if test -n "$shlibpath_var"; then
1693 # get the directories listed in $shlibpath_var
1694 eval shlib_search_path
=\
`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1698 eval sys_lib_search_path
=\"$sys_lib_search_path_spec\"
1699 eval sys_lib_dlsearch_path
=\"$sys_lib_dlsearch_path_spec\"
1701 output_objdir
=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1702 if test "X$output_objdir" = "X$output"; then
1703 output_objdir
="$objdir"
1705 output_objdir
="$output_objdir/$objdir"
1707 # Create the object directory.
1708 if test ! -d "$output_objdir"; then
1709 $show "$mkdir $output_objdir"
1710 $run $mkdir $output_objdir
1712 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1717 # Determine the type of output
1720 $echo "$modename: you must specify an output file" 1>&2
1724 *.
$libext) linkmode
=oldlib
;;
1725 *.lo |
*.
$objext) linkmode
=obj
;;
1726 *.la
) linkmode
=lib
;;
1727 *) linkmode
=prog
;; # Anything else should be a program.
1731 *cygwin
* |
*mingw
* |
*pw32
*)
1732 # don't eliminate duplcations in $postdeps and $predeps
1733 duplicate_compiler_generated_deps
=yes
1736 duplicate_compiler_generated_deps
=$duplicate_deps
1742 # Find all interdependent deplibs by searching for libraries
1743 # that are linked more than once (e.g. -la -lb -la)
1744 for deplib
in $deplibs; do
1745 if test "X$duplicate_deps" = "Xyes" ; then
1747 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
1750 libs
="$libs $deplib"
1753 if test "$linkmode" = lib
; then
1754 libs
="$predeps $libs $compiler_lib_search_path $postdeps"
1756 # Compute libraries that are listed more than once in $predeps
1757 # $postdeps and mark them as special (i.e., whose duplicates are
1758 # not to be eliminated).
1760 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
1761 for pre_post_dep
in $predeps $postdeps; do
1762 case "$pre_post_deps " in
1763 *" $pre_post_dep "*) specialdeplibs
="$specialdeplibs $pre_post_deps" ;;
1765 pre_post_deps
="$pre_post_deps $pre_post_dep"
1774 need_relink
=no
# whether we're linking any uninstalled libtool libraries
1775 notinst_deplibs
= # not-installed libtool libraries
1776 notinst_path
= # paths that contain not-installed libtool libraries
1780 for file in $dlfiles $dlprefiles; do
1784 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1796 passes
="conv scan dlopen dlpreopen link"
1801 for pass
in $passes; do
1802 if test "$linkmode,$pass" = "lib,link" ||
1803 test "$linkmode,$pass" = "prog,scan"; then
1807 if test "$linkmode" = prog
; then
1809 dlopen
) libs
="$dlfiles" ;;
1810 dlpreopen
) libs
="$dlprefiles" ;;
1811 link
) libs
="$deplibs %DEPLIBS% $dependency_libs" ;;
1814 if test "$pass" = dlopen
; then
1815 # Collect dlpreopened libraries
1816 save_deplibs
="$deplibs"
1819 for deplib
in $libs; do
1824 if test "$linkmode" != lib
&& test "$linkmode" != prog
; then
1825 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1828 if test "$pass" = conv
; then
1829 deplibs
="$deplib $deplibs"
1832 name
=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1833 for searchdir
in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1834 # Search the libtool library
1835 lib
="$searchdir/lib${name}.la"
1836 if test -f "$lib"; then
1841 if test "$found" != yes; then
1842 # deplib doesn't seem to be a libtool library
1843 if test "$linkmode,$pass" = "prog,link"; then
1844 compile_deplibs
="$deplib $compile_deplibs"
1845 finalize_deplibs
="$deplib $finalize_deplibs"
1847 deplibs
="$deplib $deplibs"
1848 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
1851 else # deplib is a libtool library
1852 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
1853 # We need to do some special things here, and not later.
1854 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
1855 case " $predeps $postdeps " in
1857 if (${SED} -e '2q' $lib |
1858 grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1862 */* |
*\\*) .
$lib ;;
1865 for l
in $old_library $library_names; do
1868 if test "X$ll" = "X$old_library" ; then # only static version available
1870 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1871 test "X$ladir" = "X$lib" && ladir
="."
1872 lib
=$ladir/$old_library
1873 if test "$linkmode,$pass" = "prog,link"; then
1874 compile_deplibs
="$deplib $compile_deplibs"
1875 finalize_deplibs
="$deplib $finalize_deplibs"
1877 deplibs
="$deplib $deplibs"
1878 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
1892 deplibs
="$deplib $deplibs"
1893 test "$pass" = conv
&& continue
1894 newdependency_libs
="$deplib $newdependency_libs"
1895 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1898 if test "$pass" = conv
; then
1899 deplibs
="$deplib $deplibs"
1902 if test "$pass" = scan
; then
1903 deplibs
="$deplib $deplibs"
1904 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1906 compile_deplibs
="$deplib $compile_deplibs"
1907 finalize_deplibs
="$deplib $finalize_deplibs"
1911 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1917 if test "$pass" = link
; then
1918 dir
=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1919 # Make sure the xrpath contains only unique directories.
1922 *) xrpath
="$xrpath $dir" ;;
1925 deplibs
="$deplib $deplibs"
1928 *.la
) lib
="$deplib" ;;
1930 if test "$pass" = conv
; then
1931 deplibs
="$deplib $deplibs"
1936 if test "$deplibs_check_method" != pass_all
; then
1938 $echo "*** Warning: Trying to link with static lib archive $deplib."
1939 $echo "*** I have the capability to make that library automatically link in when"
1940 $echo "*** you link to this library. But I can only do this if you have a"
1941 $echo "*** shared version of the library, which you do not appear to have"
1942 $echo "*** because the file extensions .$libext of this argument makes me believe"
1943 $echo "*** that it is just a static archive that I should not used here."
1946 $echo "*** Warning: Linking the shared library $output against the"
1947 $echo "*** static library $deplib is not portable!"
1948 deplibs
="$deplib $deplibs"
1953 if test "$pass" != link
; then
1954 deplibs
="$deplib $deplibs"
1956 compile_deplibs
="$deplib $compile_deplibs"
1957 finalize_deplibs
="$deplib $finalize_deplibs"
1964 if test "$pass" = conv
; then
1965 deplibs
="$deplib $deplibs"
1966 elif test "$linkmode" = prog
; then
1967 if test "$pass" = dlpreopen ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
1968 # If there is no dlopen support or we're linking statically,
1969 # we need to preload.
1970 newdlprefiles
="$newdlprefiles $deplib"
1971 compile_deplibs
="$deplib $compile_deplibs"
1972 finalize_deplibs
="$deplib $finalize_deplibs"
1974 newdlfiles
="$newdlfiles $deplib"
1984 if test "$found" = yes ||
test -f "$lib"; then :
1986 $echo "$modename: cannot find the library \`$lib'" 1>&2
1990 # Check to see that this really is a libtool archive.
1991 if (${SED} -e '2q' $lib |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
1993 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1997 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1998 test "X$ladir" = "X$lib" && ladir
="."
2006 # If the library was installed with an old release of libtool,
2007 # it will not redefine variables installed, or shouldnotlink
2013 */* |
*\\*) .
$lib ;;
2017 if test "$linkmode,$pass" = "lib,link" ||
2018 test "$linkmode,$pass" = "prog,scan" ||
2019 { test "$linkmode" != prog
&& test "$linkmode" != lib
; }; then
2020 test -n "$dlopen" && dlfiles
="$dlfiles $dlopen"
2021 test -n "$dlpreopen" && dlprefiles
="$dlprefiles $dlpreopen"
2024 if test "$pass" = conv
; then
2025 # Only check for convenience libraries
2026 deplibs
="$lib $deplibs"
2027 if test -z "$libdir"; then
2028 if test -z "$old_library"; then
2029 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2032 # It is a libtool convenience library, so add in its objects.
2033 convenience
="$convenience $ladir/$objdir/$old_library"
2034 old_convenience
="$old_convenience $ladir/$objdir/$old_library"
2036 for deplib
in $dependency_libs; do
2037 deplibs
="$deplib $deplibs"
2038 if test "X$duplicate_deps" = "Xyes" ; then
2039 case "$tmp_libs " in
2040 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2043 tmp_libs
="$tmp_libs $deplib"
2045 elif test "$linkmode" != prog
&& test "$linkmode" != lib
; then
2046 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2053 # Get the name of the library we link against.
2055 for l
in $old_library $library_names; do
2058 if test -z "$linklib"; then
2059 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2063 # This library was specified with -dlopen.
2064 if test "$pass" = dlopen
; then
2065 if test -z "$libdir"; then
2066 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2069 if test -z "$dlname" ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
2070 # If there is no dlname, no dlopen support or we're linking
2071 # statically, we need to preload. We also need to preload any
2072 # dependent libraries so libltdl's deplib preloader doesn't
2073 # bomb out in the load deplibs phase.
2074 dlprefiles
="$dlprefiles $lib $dependency_libs"
2076 newdlfiles
="$newdlfiles $lib"
2081 # We need an absolute path.
2083 [\\/]* |
[A-Za-z
]:[\\/]*) abs_ladir
="$ladir" ;;
2085 abs_ladir
=`cd "$ladir" && pwd`
2086 if test -z "$abs_ladir"; then
2087 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2088 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2093 laname
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2095 # Find the relevant object directory and library name.
2096 if test "X$installed" = Xyes
; then
2097 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2098 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2107 dir
="$ladir/$objdir"
2108 absdir
="$abs_ladir/$objdir"
2109 # Remove this search path later
2110 notinst_path
="$notinst_path $abs_ladir"
2111 fi # $installed = yes
2112 name
=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2114 # This library was specified with -dlpreopen.
2115 if test "$pass" = dlpreopen
; then
2116 if test -z "$libdir"; then
2117 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2120 # Prefer using a static library (so that no silly _DYNAMIC symbols
2121 # are required to link).
2122 if test -n "$old_library"; then
2123 newdlprefiles
="$newdlprefiles $dir/$old_library"
2124 # Otherwise, use the dlname, so that lt_dlopen finds it.
2125 elif test -n "$dlname"; then
2126 newdlprefiles
="$newdlprefiles $dir/$dlname"
2128 newdlprefiles
="$newdlprefiles $dir/$linklib"
2130 fi # $pass = dlpreopen
2132 if test -z "$libdir"; then
2133 # Link the convenience library
2134 if test "$linkmode" = lib
; then
2135 deplibs
="$dir/$old_library $deplibs"
2136 elif test "$linkmode,$pass" = "prog,link"; then
2137 compile_deplibs
="$dir/$old_library $compile_deplibs"
2138 finalize_deplibs
="$dir/$old_library $finalize_deplibs"
2140 deplibs
="$lib $deplibs" # used for prog,scan pass
2146 if test "$linkmode" = prog
&& test "$pass" != link
; then
2147 newlib_search_path
="$newlib_search_path $ladir"
2148 deplibs
="$lib $deplibs"
2151 if test "$link_all_deplibs" != no ||
test -z "$library_names" ||
2152 test "$build_libtool_libs" = no
; then
2157 for deplib
in $dependency_libs; do
2159 -L*) newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2161 # Need to link against all dependency_libs?
2162 if test "$linkalldeplibs" = yes; then
2163 deplibs
="$deplib $deplibs"
2165 # Need to hardcode shared library paths
2166 # or/and link against static libraries
2167 newdependency_libs
="$deplib $newdependency_libs"
2169 if test "X$duplicate_deps" = "Xyes" ; then
2170 case "$tmp_libs " in
2171 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2174 tmp_libs
="$tmp_libs $deplib"
2177 fi # $linkmode = prog...
2179 if test "$linkmode,$pass" = "prog,link"; then
2180 if test -n "$library_names" &&
2181 { test "$prefer_static_libs" = no ||
test -z "$old_library"; }; then
2182 # We need to hardcode the library path
2183 if test -n "$shlibpath_var"; then
2184 # Make sure the rpath contains only unique directories.
2185 case "$temp_rpath " in
2188 *) temp_rpath
="$temp_rpath $dir" ;;
2192 # Hardcode the library path.
2193 # Skip directories that are in the system default run-time
2195 case " $sys_lib_dlsearch_path " in
2198 case "$compile_rpath " in
2200 *) compile_rpath
="$compile_rpath $absdir"
2204 case " $sys_lib_dlsearch_path " in
2207 case "$finalize_rpath " in
2209 *) finalize_rpath
="$finalize_rpath $libdir"
2213 fi # $linkmode,$pass = prog,link...
2215 if test "$alldeplibs" = yes &&
2216 { test "$deplibs_check_method" = pass_all ||
2217 { test "$build_libtool_libs" = yes &&
2218 test -n "$library_names"; }; }; then
2219 # We only need to search for static libraries
2224 link_static
=no
# Whether the deplib will be linked statically
2225 if test -n "$library_names" &&
2226 { test "$prefer_static_libs" = no ||
test -z "$old_library"; }; then
2227 if test "$installed" = no
; then
2228 notinst_deplibs
="$notinst_deplibs $lib"
2231 # This is a shared library
2233 # Warn about portability, can't link against -module's on some systems (darwin)
2234 if test "$shouldnotlink" = yes && test "$pass" = link
; then
2236 if test "$linkmode" = prog
; then
2237 $echo "*** Warning: Linking the executable $output against the loadable module"
2239 $echo "*** Warning: Linking the shared library $output against the loadable module"
2241 $echo "*** $linklib is not portable!"
2243 if test "$linkmode" = lib
&&
2244 test "$hardcode_into_libs" = yes; then
2245 # Hardcode the library path.
2246 # Skip directories that are in the system default run-time
2248 case " $sys_lib_dlsearch_path " in
2251 case "$compile_rpath " in
2253 *) compile_rpath
="$compile_rpath $absdir"
2257 case " $sys_lib_dlsearch_path " in
2260 case "$finalize_rpath " in
2262 *) finalize_rpath
="$finalize_rpath $libdir"
2268 if test -n "$old_archive_from_expsyms_cmds"; then
2269 # figure out the soname
2270 set dummy
$library_names
2273 libname
=`eval \\$echo \"$libname_spec\"`
2274 # use dlname if we got it. it's perfectly good, no?
2275 if test -n "$dlname"; then
2277 elif test -n "$soname_spec"; then
2281 major
=`expr $current - $age`
2285 eval soname
=\"$soname_spec\"
2290 # Make a new name for the extract_expsyms_cmds to use
2292 soname
=`$echo $soroot | ${SED} -e 's/^.*\///'`
2293 newlib
="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2295 # If the library has no export list, then create one now
2296 if test -f "$output_objdir/$soname-def"; then :
2298 $show "extracting exported symbol list from \`$soname'"
2299 save_ifs
="$IFS"; IFS
=$_S_
2300 eval cmds
=\"$extract_expsyms_cmds\"
2301 for cmd
in $cmds; do
2304 $run eval "$cmd" ||
exit $?
2310 if test -f "$output_objdir/$newlib"; then :; else
2311 $show "generating import library for \`$soname'"
2312 save_ifs
="$IFS"; IFS
=$_S_
2313 eval cmds
=\"$old_archive_from_expsyms_cmds\"
2314 for cmd
in $cmds; do
2317 $run eval "$cmd" ||
exit $?
2321 # make sure the library variables are pointing to the new library
2324 fi # test -n "$old_archive_from_expsyms_cmds"
2326 if test "$linkmode" = prog ||
test "$mode" != relink
; then
2331 case $hardcode_action in
2332 immediate | unsupported
)
2333 if test "$hardcode_direct" = no
; then
2336 *-*-sco3.2v5
* ) add_dir
="-L$dir" ;;
2338 # if the lib is a module then we can not link against it, someone
2339 # is ignoring the new warnings I added
2340 if /usr
/bin
/file -L $add 2> /dev
/null |
grep "bundle" >/dev
/null
; then
2341 $echo "** Warning, lib $linklib is a module, not a shared library"
2342 if test -z "$old_library" ; then
2344 $echo "** And there doesn't seem to be a static archive available"
2345 $echo "** The link will probably fail, sorry"
2347 add
="$dir/$old_library"
2351 elif test "$hardcode_minus_L" = no
; then
2353 *-*-sunos*) add_shlibpath
="$dir" ;;
2357 elif test "$hardcode_shlibpath_var" = no
; then
2358 add_shlibpath
="$dir"
2365 if test "$hardcode_direct" = yes; then
2367 elif test "$hardcode_minus_L" = yes; then
2369 # Try looking first in the location we're being installed to.
2370 if test -n "$inst_prefix_dir"; then
2373 add_dir
="-L$inst_prefix_dir$libdir $add_dir"
2378 elif test "$hardcode_shlibpath_var" = yes; then
2379 add_shlibpath
="$dir"
2388 if test "$lib_linked" != yes; then
2389 $echo "$modename: configuration error: unsupported hardcode properties"
2393 if test -n "$add_shlibpath"; then
2394 case :$compile_shlibpath: in
2395 *":$add_shlibpath:"*) ;;
2396 *) compile_shlibpath
="$compile_shlibpath$add_shlibpath:" ;;
2399 if test "$linkmode" = prog
; then
2400 test -n "$add_dir" && compile_deplibs
="$add_dir $compile_deplibs"
2401 test -n "$add" && compile_deplibs
="$add $compile_deplibs"
2403 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2404 test -n "$add" && deplibs
="$add $deplibs"
2405 if test "$hardcode_direct" != yes && \
2406 test "$hardcode_minus_L" != yes && \
2407 test "$hardcode_shlibpath_var" = yes; then
2408 case :$finalize_shlibpath: in
2410 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2416 if test "$linkmode" = prog ||
test "$mode" = relink
; then
2420 # Finalize command for both is simple: just hardcode it.
2421 if test "$hardcode_direct" = yes; then
2422 add
="$libdir/$linklib"
2423 elif test "$hardcode_minus_L" = yes; then
2426 elif test "$hardcode_shlibpath_var" = yes; then
2427 case :$finalize_shlibpath: in
2429 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2432 elif test "$hardcode_automatic" = yes; then
2433 if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then
2434 add
="$inst_prefix_dir$libdir/$linklib"
2436 add
="$libdir/$linklib"
2439 # We cannot seem to hardcode it, guess we'll fake it.
2441 # Try looking first in the location we're being installed to.
2442 if test -n "$inst_prefix_dir"; then
2445 add_dir
="-L$inst_prefix_dir$libdir $add_dir"
2452 if test "$linkmode" = prog
; then
2453 test -n "$add_dir" && finalize_deplibs
="$add_dir $finalize_deplibs"
2454 test -n "$add" && finalize_deplibs
="$add $finalize_deplibs"
2456 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2457 test -n "$add" && deplibs
="$add $deplibs"
2460 elif test "$linkmode" = prog
; then
2461 # Here we assume that one of hardcode_direct or hardcode_minus_L
2462 # is not unsupported. This is valid on all known static and
2464 if test "$hardcode_direct" != unsupported
; then
2465 test -n "$old_library" && linklib
="$old_library"
2466 compile_deplibs
="$dir/$linklib $compile_deplibs"
2467 finalize_deplibs
="$dir/$linklib $finalize_deplibs"
2469 compile_deplibs
="-l$name -L$dir $compile_deplibs"
2470 finalize_deplibs
="-l$name -L$dir $finalize_deplibs"
2472 elif test "$build_libtool_libs" = yes; then
2473 # Not a shared library
2474 if test "$deplibs_check_method" != pass_all
; then
2475 # We're trying link a shared library against a static one
2476 # but the system doesn't support it.
2478 # Just print a warning and add the library to dependency_libs so
2479 # that the program can be linked against the static library.
2481 $echo "*** Warning: This system can not link to static lib archive $lib."
2482 $echo "*** I have the capability to make that library automatically link in when"
2483 $echo "*** you link to this library. But I can only do this if you have a"
2484 $echo "*** shared version of the library, which you do not appear to have."
2485 if test "$module" = yes; then
2486 $echo "*** But as you try to build a module library, libtool will still create "
2487 $echo "*** a static module, that should work as long as the dlopening application"
2488 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2489 if test -z "$global_symbol_pipe"; then
2491 $echo "*** However, this would only work if libtool was able to extract symbol"
2492 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2493 $echo "*** not find such a program. So, this module is probably useless."
2494 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2496 if test "$build_old_libs" = no
; then
2497 build_libtool_libs
=module
2500 build_libtool_libs
=no
2504 convenience
="$convenience $dir/$old_library"
2505 old_convenience
="$old_convenience $dir/$old_library"
2506 deplibs
="$dir/$old_library $deplibs"
2509 fi # link shared/static library?
2511 if test "$linkmode" = lib
; then
2512 if test -n "$dependency_libs" &&
2513 { test "$hardcode_into_libs" != yes ||
test "$build_old_libs" = yes ||
2514 test "$link_static" = yes; }; then
2515 # Extract -R from dependency_libs
2517 for libdir
in $dependency_libs; do
2519 -R*) temp_xrpath
=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2521 *" $temp_xrpath "*) ;;
2522 *) xrpath
="$xrpath $temp_xrpath";;
2524 *) temp_deplibs
="$temp_deplibs $libdir";;
2527 dependency_libs
="$temp_deplibs"
2530 newlib_search_path
="$newlib_search_path $absdir"
2531 # Link against this library
2532 test "$link_static" = no
&& newdependency_libs
="$abs_ladir/$laname $newdependency_libs"
2533 # ... and its dependency_libs
2535 for deplib
in $dependency_libs; do
2536 newdependency_libs
="$deplib $newdependency_libs"
2537 if test "X$duplicate_deps" = "Xyes" ; then
2538 case "$tmp_libs " in
2539 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2542 tmp_libs
="$tmp_libs $deplib"
2545 if test "$link_all_deplibs" != no
; then
2546 # Add the search paths of all dependency libraries
2547 for deplib
in $dependency_libs; do
2549 -L*) path
="$deplib" ;;
2551 dir
=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2552 test "X$dir" = "X$deplib" && dir
="."
2553 # We need an absolute path.
2555 [\\/]* |
[A-Za-z
]:[\\/]*) absdir
="$dir" ;;
2557 absdir
=`cd "$dir" && pwd`
2558 if test -z "$absdir"; then
2559 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2564 if grep "^installed=no" $deplib > /dev
/null
; then
2565 path
="$absdir/$objdir"
2567 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2568 if test -z "$libdir"; then
2569 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2572 if test "$absdir" != "$libdir"; then
2573 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2580 # we do not want to link against static libs, but need to link against shared
2581 eval deplibrary_names
=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2582 if test -n "$deplibrary_names" ; then
2583 for tmp
in $deplibrary_names ; do
2586 if test -f "$path/$depdepl" ; then
2587 depdepl
="$path/$depdepl"
2589 newlib_search_path
="$newlib_search_path $path"
2602 # Again, we only want to link against shared libraries
2603 eval tmp_libs
=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2604 for tmp
in $newlib_search_path ; do
2605 if test -f "$tmp/lib$tmp_libs.dylib" ; then
2606 eval depdepl
="$tmp/lib$tmp_libs.dylib"
2617 case " $deplibs " in
2619 *) deplibs
="$deplibs $depdepl" ;;
2621 case " $deplibs " in
2623 *) deplibs
="$deplibs $path" ;;
2626 fi # link_all_deplibs != no
2628 done # for deplib in $libs
2629 dependency_libs
="$newdependency_libs"
2630 if test "$pass" = dlpreopen
; then
2631 # Link the dlpreopened libraries before other libraries
2632 for deplib
in $save_deplibs; do
2633 deplibs
="$deplib $deplibs"
2636 if test "$pass" != dlopen
; then
2637 if test "$pass" != conv
; then
2638 # Make sure lib_search_path contains only unique directories.
2640 for dir
in $newlib_search_path; do
2641 case "$lib_search_path " in
2643 *) lib_search_path
="$lib_search_path $dir" ;;
2649 if test "$linkmode,$pass" != "prog,link"; then
2652 vars
="compile_deplibs finalize_deplibs"
2654 for var
in $vars dependency_libs
; do
2655 # Add libraries to $var in reverse order
2656 eval tmp_libs
=\"\$
$var\"
2658 for deplib
in $tmp_libs; do
2659 # FIXME: Pedantically, this is the right thing to do, so
2660 # that some nasty dependency loop isn't accidentally
2662 #new_libs="$deplib $new_libs"
2663 # Pragmatically, this seems to cause very few problems in
2666 -L*) new_libs
="$deplib $new_libs" ;;
2669 # And here is the reason: when a library appears more
2670 # than once as an explicit dependence of a library, or
2671 # is implicitly linked in more than once by the
2672 # compiler, it is considered special, and multiple
2673 # occurrences thereof are not removed. Compare this
2674 # with having the same library being listed as a
2675 # dependency of multiple other libraries: in this case,
2676 # we know (pedantically, we assume) the library does not
2677 # need to be listed more than once, so we keep only the
2678 # last copy. This is not always right, but it is rare
2679 # enough that we require users that really mean to play
2680 # such unportable linking tricks to link the library
2681 # using -Wl,-lname, so that libtool does not consider it
2682 # for duplicate removal.
2683 case " $specialdeplibs " in
2684 *" $deplib "*) new_libs
="$deplib $new_libs" ;;
2686 case " $new_libs " in
2688 *) new_libs
="$deplib $new_libs" ;;
2696 for deplib
in $new_libs; do
2699 case " $tmp_libs " in
2701 *) tmp_libs
="$tmp_libs $deplib" ;;
2704 *) tmp_libs
="$tmp_libs $deplib" ;;
2707 eval $var=\"$tmp_libs\"
2710 # Last step: remove runtime libs from dependency_libs (they stay in deplibs)
2712 for i
in $dependency_libs ; do
2713 case " $predeps $postdeps $compiler_lib_search_path " in
2718 if test -n "$i" ; then
2719 tmp_libs
="$tmp_libs $i"
2722 dependency_libs
=$tmp_libs
2724 if test "$linkmode" = prog
; then
2725 dlfiles
="$newdlfiles"
2726 dlprefiles
="$newdlprefiles"
2731 if test -n "$deplibs"; then
2732 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2735 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
2736 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2739 if test -n "$rpath"; then
2740 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2743 if test -n "$xrpath"; then
2744 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2747 if test -n "$vinfo"; then
2748 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
2751 if test -n "$release"; then
2752 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2755 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
2756 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2759 # Now set the variables for building old libraries.
2760 build_libtool_libs
=no
2762 objs
="$objs$old_deplibs"
2766 # Make sure we only generate libraries of the form `libNAME.la'.
2769 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2770 eval shared_ext
=\"$shrext\"
2771 eval libname
=\"$libname_spec\"
2774 if test "$module" = no
; then
2775 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2779 if test "$need_lib_prefix" != no
; then
2780 # Add the "lib" prefix for modules if required
2781 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2782 eval shared_ext
=\"$shrext\"
2783 eval libname
=\"$libname_spec\"
2785 libname
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2790 if test -n "$objs"; then
2791 if test "$deplibs_check_method" != pass_all
; then
2792 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2796 $echo "*** Warning: Linking the shared library $output against the non-libtool"
2797 $echo "*** objects $objs is not portable!"
2798 libobjs
="$libobjs $objs"
2802 if test "$dlself" != no
; then
2803 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2807 if test "$#" -gt 2; then
2808 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2813 if test -z "$rpath"; then
2814 if test "$build_libtool_libs" = yes; then
2815 # Building a libtool convenience library.
2816 # Some compilers have problems with a `.al' extension so
2817 # convenience libraries should have the same extension an
2818 # archive normally would.
2819 oldlibs
="$output_objdir/$libname.$libext $oldlibs"
2820 build_libtool_libs
=convenience
2824 if test -n "$vinfo"; then
2825 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
2828 if test -n "$release"; then
2829 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2833 # Parse the version information argument.
2834 save_ifs
="$IFS"; IFS
=':'
2835 set dummy
$vinfo 0 0 0
2838 if test -n "$8"; then
2839 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2844 # convert absolute version numbers to libtool ages
2845 # this retains compatibility with .la files and attempts
2846 # to make the code below a bit more comprehensible
2848 case $vinfo_number in
2852 number_revision
="$4"
2854 # There are really only two kinds -- those that
2855 # use the current revision as the major version
2856 # and those that subtract age and use age as
2857 # a minor version. But, then there is irix
2858 # which has an extra 1 added just for fun
2860 case $version_type in
2861 darwin|linux|osf|windows
)
2862 current
=`expr $number_major + $number_minor`
2864 revision
="$number_revision"
2866 freebsd-aout|freebsd-elf|sunos
)
2867 current
="$number_major"
2868 revision
="$number_minor"
2872 current
=`expr $number_major + $number_minor - 1`
2874 revision
="$number_minor"
2885 # Check that each of the things are valid numbers.
2887 0 |
[1-9] |
[1-9][0-9] |
[1-9][0-9][0-9]) ;;
2889 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2890 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2896 0 |
[1-9] |
[1-9][0-9] |
[1-9][0-9][0-9]) ;;
2898 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2899 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2905 0 |
[1-9] |
[1-9][0-9] |
[1-9][0-9][0-9]) ;;
2907 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2908 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2913 if test "$age" -gt "$current"; then
2914 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2915 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2919 # Calculate the version variables.
2923 case $version_type in
2927 # Like Linux, but with the current version available in
2928 # verstring for coding it into the library header
2929 major
=.
`expr $current - $age`
2930 versuffix
="$major.$age.$revision"
2931 # Darwin ld doesn't like 0 for these options...
2932 minor_current
=`expr $current + 1`
2933 verstring
="-compatibility_version $minor_current -current_version $minor_current.$revision"
2938 versuffix
=".$current.$revision";
2943 versuffix
=".$current";
2947 major
=`expr $current - $age + 1`
2949 case $version_type in
2950 nonstopux
) verstring_prefix
=nonstopux
;;
2951 *) verstring_prefix
=sgi
;;
2953 verstring
="$verstring_prefix$major.$revision"
2955 # Add in all the interfaces that we are compatible with.
2957 while test "$loop" -ne 0; do
2958 iface
=`expr $revision - $loop`
2959 loop
=`expr $loop - 1`
2960 verstring
="$verstring_prefix$major.$iface:$verstring"
2963 # Before this point, $major must not contain `.'.
2965 versuffix
="$major.$revision"
2969 major
=.
`expr $current - $age`
2970 versuffix
="$major.$age.$revision"
2974 major
=.
`expr $current - $age`
2975 versuffix
=".$current.$age.$revision"
2976 verstring
="$current.$age.$revision"
2978 # Add in all the interfaces that we are compatible with.
2980 while test "$loop" -ne 0; do
2981 iface
=`expr $current - $loop`
2982 loop
=`expr $loop - 1`
2983 verstring
="$verstring:${iface}.0"
2986 # Make executables depend on our current version.
2987 verstring
="$verstring:${current}.0"
2992 versuffix
=".$current.$revision"
2996 # Use '-' rather than '.', since we only want one
2997 # extension on DOS 8.3 filesystems.
2998 major
=`expr $current - $age`
3003 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3004 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3009 # Clear the version info if we defaulted, and they specified a release.
3010 if test -z "$vinfo" && test -n "$release"; then
3012 case $version_type in
3014 # we can't check for "0.0" in archive_cmds due to quoting
3015 # problems, so we reset it completely
3022 if test "$need_version" = no
; then
3029 # Remove version info from name if versioning should be avoided
3030 if test "$avoid_version" = yes && test "$need_version" = no
; then
3036 # Check to see if the archive will have undefined symbols.
3037 if test "$allow_undefined" = yes; then
3038 if test "$allow_undefined_flag" = unsupported
; then
3039 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3040 build_libtool_libs
=no
3044 # Don't allow undefined symbols.
3045 allow_undefined_flag
="$no_undefined_flag"
3049 if test "$mode" != relink
; then
3050 # Remove our outputs, but don't remove object files since they
3051 # may have been created when compiling PIC objects.
3053 tempremovelist
=`$echo "$output_objdir/*"`
3054 for p
in $tempremovelist; do
3058 $output_objdir/$outputname |
$output_objdir/$libname.
* |
$output_objdir/${libname}${release}.
*)
3059 removelist
="$removelist $p"
3064 if test -n "$removelist"; then
3065 $show "${rm}r $removelist"
3066 $run ${rm}r
$removelist
3070 # Now set the variables for building old libraries.
3071 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience
; then
3072 oldlibs
="$oldlibs $output_objdir/$libname.$libext"
3074 # Transform .lo files to .o files.
3075 oldobjs
="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3078 # Eliminate all temporary directories.
3079 for path
in $notinst_path; do
3080 lib_search_path
=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3081 deplibs
=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3082 dependency_libs
=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3085 if test -n "$xrpath"; then
3086 # If the user specified any rpath flags, then add them.
3088 for libdir
in $xrpath; do
3089 temp_xrpath
="$temp_xrpath -R$libdir"
3090 case "$finalize_rpath " in
3092 *) finalize_rpath
="$finalize_rpath $libdir" ;;
3095 if test "$hardcode_into_libs" != yes ||
test "$build_old_libs" = yes; then
3096 dependency_libs
="$temp_xrpath $dependency_libs"
3100 # Make sure dlfiles contains only unique files that won't be dlpreopened
3101 old_dlfiles
="$dlfiles"
3103 for lib
in $old_dlfiles; do
3104 case " $dlprefiles $dlfiles " in
3106 *) dlfiles
="$dlfiles $lib" ;;
3110 # Make sure dlprefiles contains only unique files
3111 old_dlprefiles
="$dlprefiles"
3113 for lib
in $old_dlprefiles; do
3114 case "$dlprefiles " in
3116 *) dlprefiles
="$dlprefiles $lib" ;;
3120 if test "$build_libtool_libs" = yes; then
3121 if test -n "$rpath"; then
3123 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2* |
*-*-beos*)
3124 # these systems don't actually have a c library (as such)!
3126 *-*-rhapsody* |
*-*-darwin1.
[012])
3127 # Rhapsody C library is in the System framework
3128 deplibs
="$deplibs -framework System"
3131 # Don't link with libc until the a.out ld.so is fixed.
3133 *-*-openbsd* |
*-*-freebsd*)
3134 # Do not include libc due to us having libc/libc_r.
3135 test "X$arg" = "X-lc" && continue
3138 # Add libc to deplibs on all other systems if necessary.
3139 if test "$build_libtool_need_lc" = "yes"; then
3140 deplibs
="$deplibs -lc"
3146 # Transform deplibs into only deplibs that can be linked in shared.
3148 libname_save
=$libname
3149 release_save
=$release
3150 versuffix_save
=$versuffix
3152 # I'm not sure if I'm treating the release correctly. I think
3153 # release should show up in the -l (ie -lgmp5) so we don't want to
3154 # add it in twice. Is that correct?
3160 case $deplibs_check_method in
3162 # Don't check for shared/static. Everything works.
3163 # This might be a little naive. We might want to check
3164 # whether the library exists or not. But this is on
3165 # osf3 & osf4 and I'm not really sure... Just
3166 # implementing what was already the behavior.
3170 # This code stresses the "libraries are programs" paradigm to its
3171 # limits. Maybe even breaks it. We compile a program, linking it
3172 # against the deplibs as a proxy for the library. Then we can check
3173 # whether they linked in statically or dynamically with ldd.
3175 cat > conftest.c
<<EOF
3176 int main() { return 0; }
3179 $LTCC $archargs -o conftest conftest.c
$deplibs
3180 if test "$?" -eq 0 ; then
3181 ldd_output
=`ldd conftest`
3182 for i
in $deplibs; do
3183 name
="`expr $i : '-l\(.*\)'`"
3184 # If $name is empty we are operating on a -L argument.
3185 if test "$name" != "" && test "$name" -ne "0"; then
3186 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3187 case " $predeps $postdeps " in
3189 newdeplibs
="$newdeplibs $i"
3194 if test -n "$i" ; then
3195 libname
=`eval \\$echo \"$libname_spec\"`
3196 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
3197 set dummy
$deplib_matches
3199 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3200 newdeplibs
="$newdeplibs $i"
3204 $echo "*** Warning: dynamic linker does not accept needed library $i."
3205 $echo "*** I have the capability to make that library automatically link in when"
3206 $echo "*** you link to this library. But I can only do this if you have a"
3207 $echo "*** shared version of the library, which I believe you do not have"
3208 $echo "*** because a test_compile did reveal that the linker did not use it for"
3209 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3213 newdeplibs
="$newdeplibs $i"
3217 # Error occurred in the first compile. Let's try to salvage
3218 # the situation: Compile a separate program for each library.
3219 for i
in $deplibs; do
3220 name
="`expr $i : '-l\(.*\)'`"
3221 # If $name is empty we are operating on a -L argument.
3222 if test "$name" != "" && test "$name" != "0"; then
3224 $LTCC $archargs -o conftest conftest.c
$i
3226 if test "$?" -eq 0 ; then
3227 ldd_output
=`ldd conftest`
3228 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3229 case " $predeps $postdeps " in
3231 newdeplibs
="$newdeplibs $i"
3236 if test -n "$i" ; then
3237 libname
=`eval \\$echo \"$libname_spec\"`
3238 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
3239 set dummy
$deplib_matches
3241 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3242 newdeplibs
="$newdeplibs $i"
3246 $echo "*** Warning: dynamic linker does not accept needed library $i."
3247 $echo "*** I have the capability to make that library automatically link in when"
3248 $echo "*** you link to this library. But I can only do this if you have a"
3249 $echo "*** shared version of the library, which you do not appear to have"
3250 $echo "*** because a test_compile did reveal that the linker did not use this one"
3251 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3257 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3258 $echo "*** make it link in! You will probably need to install it or some"
3259 $echo "*** library that it depends on before this library will be fully"
3260 $echo "*** functional. Installing it before continuing would be even better."
3263 newdeplibs
="$newdeplibs $i"
3269 set dummy
$deplibs_check_method
3270 file_magic_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3271 for a_deplib
in $deplibs; do
3272 name
="`expr $a_deplib : '-l\(.*\)'`"
3273 # If $name is empty we are operating on a -L argument.
3274 if test "$name" != "" && test "$name" != "0"; then
3275 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3276 case " $predeps $postdeps " in
3278 newdeplibs
="$newdeplibs $a_deplib"
3283 if test -n "$a_deplib" ; then
3284 libname
=`eval \\$echo \"$libname_spec\"`
3285 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3286 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
3287 for potent_lib
in $potential_libs; do
3288 # Follow soft links.
3289 if ls -lLd "$potent_lib" 2>/dev
/null \
3290 |
grep " -> " >/dev
/null
; then
3293 # The statement above tries to avoid entering an
3294 # endless loop below, in case of cyclic links.
3295 # We might still enter an endless loop, since a link
3296 # loop can be closed while we follow links,
3298 potlib
="$potent_lib"
3299 while test -h "$potlib" 2>/dev
/null
; do
3300 potliblink
=`ls -ld $potlib | ${SED} 's/.* -> //'`
3302 [\\/]* |
[A-Za-z
]:[\\/]*) potlib
="$potliblink";;
3303 *) potlib
=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3306 if eval $file_magic_cmd \"\
$potlib\" 2>/dev
/null \
3308 |
$EGREP "$file_magic_regex" > /dev
/null
; then
3309 newdeplibs
="$newdeplibs $a_deplib"
3316 if test -n "$a_deplib" ; then
3319 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3320 $echo "*** I have the capability to make that library automatically link in when"
3321 $echo "*** you link to this library. But I can only do this if you have a"
3322 $echo "*** shared version of the library, which you do not appear to have"
3323 $echo "*** because I did check the linker path looking for a file starting"
3324 if test -z "$potlib" ; then
3325 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3327 $echo "*** with $libname and none of the candidates passed a file format test"
3328 $echo "*** using a file magic. Last file checked: $potlib"
3332 # Add a -L argument.
3333 newdeplibs
="$newdeplibs $a_deplib"
3335 done # Gone through all deplibs.
3338 set dummy
$deplibs_check_method
3339 match_pattern_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3340 for a_deplib
in $deplibs; do
3341 name
="`expr $a_deplib : '-l\(.*\)'`"
3342 # If $name is empty we are operating on a -L argument.
3343 if test -n "$name" && test "$name" != "0"; then
3344 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3345 case " $predeps $postdeps " in
3347 newdeplibs
="$newdeplibs $a_deplib"
3352 if test -n "$a_deplib" ; then
3353 libname
=`eval \\$echo \"$libname_spec\"`
3354 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3355 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
3356 for potent_lib
in $potential_libs; do
3357 potlib
="$potent_lib" # see symlink-check above in file_magic test
3358 if eval $echo \"$potent_lib\" 2>/dev
/null \
3360 |
$EGREP "$match_pattern_regex" > /dev
/null
; then
3361 newdeplibs
="$newdeplibs $a_deplib"
3368 if test -n "$a_deplib" ; then
3371 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3372 $echo "*** I have the capability to make that library automatically link in when"
3373 $echo "*** you link to this library. But I can only do this if you have a"
3374 $echo "*** shared version of the library, which you do not appear to have"
3375 $echo "*** because I did check the linker path looking for a file starting"
3376 if test -z "$potlib" ; then
3377 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3379 $echo "*** with $libname and none of the candidates passed a file format test"
3380 $echo "*** using a regex pattern. Last file checked: $potlib"
3384 # Add a -L argument.
3385 newdeplibs
="$newdeplibs $a_deplib"
3387 done # Gone through all deplibs.
3391 tmp_deplibs
=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3392 -e 's/ -[LR][^ ]*//g'`
3393 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3394 for i
in $predeps $postdeps ; do
3395 # can't use Xsed below, because $i might contain '/'
3396 tmp_deplibs
=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3399 if $echo "X $tmp_deplibs" |
$Xsed -e 's/[ ]//g' \
3400 |
grep .
>/dev
/null
; then
3402 if test "X$deplibs_check_method" = "Xnone"; then
3403 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3405 $echo "*** Warning: inter-library dependencies are not known to be supported."
3407 $echo "*** All declared inter-library dependencies are being dropped."
3412 versuffix
=$versuffix_save
3414 release
=$release_save
3415 libname
=$libname_save
3419 *-*-rhapsody* |
*-*-darwin1.
[012])
3420 # On Rhapsody replace the C library is the System framework
3421 newdeplibs
=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3425 if test "$droppeddeps" = yes; then
3426 if test "$module" = yes; then
3428 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3429 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3430 $echo "*** a static module, that should work as long as the dlopening"
3431 $echo "*** application is linked with the -dlopen flag."
3432 if test -z "$global_symbol_pipe"; then
3434 $echo "*** However, this would only work if libtool was able to extract symbol"
3435 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3436 $echo "*** not find such a program. So, this module is probably useless."
3437 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3439 if test "$build_old_libs" = no
; then
3440 oldlibs
="$output_objdir/$libname.$libext"
3441 build_libtool_libs
=module
3444 build_libtool_libs
=no
3447 $echo "*** The inter-library dependencies that have been dropped here will be"
3448 $echo "*** automatically added whenever a program is linked with this library"
3449 $echo "*** or is declared to -dlopen it."
3451 if test "$allow_undefined" = no
; then
3453 $echo "*** Since this library must not contain undefined symbols,"
3454 $echo "*** because either the platform does not support them or"
3455 $echo "*** it was explicitly requested with -no-undefined,"
3456 $echo "*** libtool will only create a static version of it."
3457 if test "$build_old_libs" = no
; then
3458 oldlibs
="$output_objdir/$libname.$libext"
3459 build_libtool_libs
=module
3462 build_libtool_libs
=no
3467 # Done checking deplibs!
3471 # All the library-specific variables (install_libdir is set above).
3476 # Test again, we may have decided not to build it any more
3477 if test "$build_libtool_libs" = yes; then
3478 if test "$hardcode_into_libs" = yes; then
3479 # Hardcode the library paths
3482 rpath
="$finalize_rpath"
3483 test "$mode" != relink
&& rpath
="$compile_rpath$rpath"
3484 for libdir
in $rpath; do
3485 if test -n "$hardcode_libdir_flag_spec"; then
3486 if test -n "$hardcode_libdir_separator"; then
3487 if test -z "$hardcode_libdirs"; then
3488 hardcode_libdirs
="$libdir"
3490 # Just accumulate the unique libdirs.
3491 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3492 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3495 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3500 eval flag
=\"$hardcode_libdir_flag_spec\"
3501 dep_rpath
="$dep_rpath $flag"
3503 elif test -n "$runpath_var"; then
3504 case "$perm_rpath " in
3506 *) perm_rpath
="$perm_rpath $libdir" ;;
3510 # Substitute the hardcoded libdirs into the rpath.
3511 if test -n "$hardcode_libdir_separator" &&
3512 test -n "$hardcode_libdirs"; then
3513 libdir
="$hardcode_libdirs"
3514 if test -n "$hardcode_libdir_flag_spec_ld"; then
3515 eval dep_rpath
=\"$hardcode_libdir_flag_spec_ld\"
3517 eval dep_rpath
=\"$hardcode_libdir_flag_spec\"
3520 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3521 # We should set the runpath_var.
3523 for dir
in $perm_rpath; do
3526 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3528 test -n "$dep_rpath" && deplibs
="$dep_rpath $deplibs"
3531 shlibpath
="$finalize_shlibpath"
3532 test "$mode" != relink
&& shlibpath
="$compile_shlibpath$shlibpath"
3533 if test -n "$shlibpath"; then
3534 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3537 # Get the real and link names of the library.
3538 eval shared_ext
=\"$shrext\"
3539 eval library_names
=\"$library_names_spec\"
3540 set dummy
$library_names
3544 if test -n "$soname_spec"; then
3545 eval soname
=\"$soname_spec\"
3549 if test -z "$dlname"; then
3553 lib
="$output_objdir/$realname"
3556 linknames
="$linknames $link"
3559 # Use standard objects if they are pic
3560 test -z "$pic_flag" && libobjs
=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3562 # Prepare the list of exported symbols
3563 if test -z "$export_symbols"; then
3564 if test "$always_export_symbols" = yes ||
test -n "$export_symbols_regex"; then
3565 $show "generating symbol list for \`$libname.la'"
3566 export_symbols
="$output_objdir/$libname.exp"
3567 $run $rm $export_symbols
3568 eval cmds
=\"$export_symbols_cmds\"
3569 save_ifs
="$IFS"; IFS
=$_S_
3570 for cmd
in $cmds; do
3572 if len
=`expr "X$cmd" : ".*"` &&
3573 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
3575 $run eval "$cmd" ||
exit $?
3576 skipped_export
=false
3578 # The command line is too long to execute in one step.
3579 $show "using reloadable object file for export list..."
3584 if test -n "$export_symbols_regex"; then
3585 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3586 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3587 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3588 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3593 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3594 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3598 for test_deplib
in $deplibs; do
3599 case " $convenience " in
3600 *" $test_deplib "*) ;;
3602 tmp_deplibs
="$tmp_deplibs $test_deplib"
3606 deplibs
="$tmp_deplibs"
3608 if test -n "$convenience"; then
3609 if test -n "$whole_archive_flag_spec"; then
3610 save_libobjs
=$libobjs
3611 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
3613 gentop
="$output_objdir/${outputname}x"
3614 $show "${rm}r $gentop"
3615 $run ${rm}r
"$gentop"
3616 $show "$mkdir $gentop"
3617 $run $mkdir "$gentop"
3619 if test "$status" -ne 0 && test ! -d "$gentop"; then
3622 generated
="$generated $gentop"
3624 for xlib
in $convenience; do
3625 # Extract the objects.
3627 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
3628 *) xabs
=`pwd`"/$xlib" ;;
3630 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3631 xdir
="$gentop/$xlib"
3633 $show "${rm}r $xdir"
3635 $show "$mkdir $xdir"
3638 if test "$status" -ne 0 && test ! -d "$xdir"; then
3643 # ranlib-ed archives of fat binaries are converted to a fat xabs that
3644 # ar can't use. So we to split the fat xabs into non-fat ones to unpack.
3645 # We can't deal with duplicate names, since 'ar xN' and 'uniq -cd' don't work.
3646 d_archs
=`lipo -info $xabs 2> /dev/null | grep '^Architectures' | sed 's/^.*: //'`
3647 if test -n "$d_archs"; then
3648 $echo "$modename: manually unpacking fat archive $xabs" 1>&2
3649 d_name
=`basename $xabs`
3650 d_dir
="/tmp/fat_ar.$$"
3653 for d_arch
in $d_archs; do
3654 d_archdir
="$d_dir/$d_arch"
3655 $show "$mkdir -p $d_archdir"
3656 $run $mkdir -p "$d_archdir"
3658 $show "lipo -thin $d_arch $xabs -o $d_dir/$d_name"
3659 $run lipo
-thin $d_arch "$xabs" -o "$d_dir/$d_name"
3661 $show "(cd $d_archdir && $AR x $d_dir/$d_name)"
3662 $run eval "(cd \$d_archdir && \$AR x \$d_dir/\$d_name)" ||
exit $?
3664 $show "${rm} $d_dir/$d_name"
3665 $run ${rm} "$d_dir/$d_name"
3668 # Can't deal with blanks in file names
3669 $run eval "d_files=\`find \$d_dir -type f | sed -e 's,.*/,,' -e '/ /d' | sort -u\`" ||
exit $?
3671 for d_file
in $d_files; do
3672 $run eval "d_f=\`find \$d_dir -name \$d_file -print\`" ||
exit $?
3673 $show "lipo -create $d_f -o $xdir/$d_file"
3674 $run eval "lipo -create \$d_f -o \"\$xdir/\$d_file\"" ||
exit $?
3677 $show "${rm}r $d_dir"
3678 $run ${rm}r
"$d_dir"
3680 $show "(cd $xdir && $AR x $xabs)"
3681 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
3685 # We will extract separately just the conflicting names and we will no
3686 # longer touch any unique names. It is faster to leave these extract
3687 # automatically by $AR in one run.
3688 $show "(cd $xdir && $AR x $xabs)"
3689 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
3690 if ($AR t
"$xabs" |
sort |
sort -uc >/dev
/null
2>&1); then
3693 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3694 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3695 $AR t
"$xabs" |
sort |
uniq -cd |
while read -r count name
3698 while test "$i" -le "$count"
3700 # Put our $i before any first dot (extension)
3701 # Never overwrite any file
3703 while test "X$name_to" = "X$name" ||
test -f "$xdir/$name_to"
3705 name_to
=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3707 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3708 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" ||
exit $?
3716 libobjs
="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3721 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3722 eval flag
=\"$thread_safe_flag_spec\"
3723 linker_flags
="$linker_flags $flag"
3726 # Make a backup of the uninstalled library when relinking
3727 if test "$mode" = relink
; then
3728 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' ||
exit $?
3731 # Do each of the archive commands.
3732 if test "$module" = yes && test -n "$module_cmds" ; then
3733 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3734 eval cmds
=\"$module_expsym_cmds\"
3736 eval cmds
=\"$module_cmds\"
3739 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3740 eval cmds
=\"$archive_expsym_cmds\"
3742 eval cmds
=\"$archive_cmds\"
3746 if test "X$skipped_export" != "X:" && len
=`expr "X$cmds" : ".*"` &&
3747 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
3750 # The command line is too long to link in one step, link piecewise.
3751 $echo "creating reloadable object files..."
3753 # Save the value of $output and $libobjs because we want to
3754 # use them later. If we have whole_archive_flag_spec, we
3755 # want to use save_libobjs as it was before
3756 # whole_archive_flag_spec was expanded, because we can't
3757 # assume the linker understands whole_archive_flag_spec.
3758 # This may have to be revisited, in case too many
3759 # convenience libraries get linked in and end up exceeding
3761 if test -z "$convenience" ||
test -z "$whole_archive_flag_spec"; then
3762 save_libobjs
=$libobjs
3766 # Clear the reloadable object creation command queue and
3767 # initialize k to one.
3774 output
=$output_objdir/$save_output-${k}.
$objext
3775 # Loop over the list of objects to be linked.
3776 for obj
in $save_libobjs
3778 eval test_cmds
=\"$reload_cmds $objlist $last_robj\"
3779 if test "X$objlist" = X ||
3780 { len
=`expr "X$test_cmds" : ".*"` &&
3781 test "$len" -le "$max_cmd_len"; }; then
3782 objlist
="$objlist $obj"
3784 # The command $test_cmds is almost too long, add a
3785 # command to the queue.
3786 if test "$k" -eq 1 ; then
3787 # The first file doesn't have a previous command to add.
3788 eval concat_cmds
=\"$reload_cmds $objlist $last_robj\"
3790 # All subsequent reloadable object files will link in
3791 # the last one created.
3792 eval concat_cmds
=\"\
$concat_cmds${_S_}$reload_cmds $objlist $last_robj\"
3794 last_robj
=$output_objdir/$save_output-${k}.
$objext
3796 output
=$output_objdir/$save_output-${k}.
$objext
3801 # Handle the remaining objects by creating one last
3802 # reloadable object file. All subsequent reloadable object
3803 # files will link in the last one created.
3804 test -z "$concat_cmds" || concat_cmds
=$concat_cmds${_S_}
3805 eval concat_cmds
=\"\
${concat_cmds}$reload_cmds $objlist $last_robj\"
3807 if ${skipped_export-false}; then
3808 $show "generating symbol list for \`$libname.la'"
3809 export_symbols
="$output_objdir/$libname.exp"
3810 $run $rm $export_symbols
3812 # Append the command to create the export file.
3813 eval concat_cmds
=\"\
$concat_cmds${_S_}$export_symbols_cmds\"
3816 # Set up a command to remove the reloadale object files
3817 # after they are used.
3819 while test "$i" -lt "$k"
3822 delfiles
="$delfiles $output_objdir/$save_output-${i}.$objext"
3825 $echo "creating a temporary reloadable object file: $output"
3827 # Loop through the commands generated above and execute them.
3828 save_ifs
="$IFS"; IFS
=$_S_
3829 for cmd
in $concat_cmds; do
3832 $run eval "$cmd" ||
exit $?
3837 # Restore the value of output.
3840 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3841 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
3843 # Expand the library linking commands again to reset the
3844 # value of $libobjs for piecewise linking.
3846 # Do each of the archive commands.
3847 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3848 eval cmds
=\"$archive_expsym_cmds\"
3850 eval cmds
=\"$archive_cmds\"
3853 # Append the command to remove the reloadable object files
3854 # to the just-reset $cmds.
3855 eval cmds
=\"\
$cmds${_S_}$rm $delfiles\"
3857 save_ifs
="$IFS"; IFS
=$_S_
3858 for cmd
in $cmds; do
3861 $run eval "$cmd" ||
exit $?
3865 # Restore the uninstalled library and exit
3866 if test "$mode" = relink
; then
3867 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' ||
exit $?
3871 # Create links to the real library.
3872 for linkname
in $linknames; do
3873 if test "$realname" != "$linkname"; then
3874 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3875 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' ||
exit $?
3879 # If -module or -export-dynamic was specified, set the dlname.
3880 if test "$module" = yes ||
test "$export_dynamic" = yes; then
3881 # On all known operating systems, these are identical.
3888 if test -n "$deplibs"; then
3889 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3892 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
3893 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3896 if test -n "$rpath"; then
3897 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3900 if test -n "$xrpath"; then
3901 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3904 if test -n "$vinfo"; then
3905 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3908 if test -n "$release"; then
3909 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3914 if test -n "$objs$old_deplibs"; then
3915 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3919 obj
=`$echo "X$output" | $Xsed -e "$lo2o"`
3927 # Delete the old objects.
3928 $run $rm $obj $libobj
3930 # Objects from convenience libraries. This assumes
3931 # single-version convenience libraries. Whenever we create
3932 # different ones for PIC/non-PIC, this we'll have to duplicate
3936 # reload_cmds runs $LD directly, so let us get rid of
3937 # -Wl from whole_archive_flag_spec
3940 if test -n "$convenience"; then
3941 if test -n "$whole_archive_flag_spec"; then
3942 eval reload_conv_objs
=\"\
$reload_objs $whole_archive_flag_spec\"
3944 gentop
="$output_objdir/${obj}x"
3945 $show "${rm}r $gentop"
3946 $run ${rm}r
"$gentop"
3947 $show "$mkdir $gentop"
3948 $run $mkdir "$gentop"
3950 if test "$status" -ne 0 && test ! -d "$gentop"; then
3953 generated
="$generated $gentop"
3955 for xlib
in $convenience; do
3956 # Extract the objects.
3958 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
3959 *) xabs
=`pwd`"/$xlib" ;;
3961 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3962 xdir
="$gentop/$xlib"
3964 $show "${rm}r $xdir"
3966 $show "$mkdir $xdir"
3969 if test "$status" -ne 0 && test ! -d "$xdir"; then
3974 # ranlib-ed archives of fat binaries are converted to a fat xabs that
3975 # ar can't use. So we to split the fat xabs into non-fat ones to unpack.
3976 # We can't deal with duplicate names, since 'ar xN' and 'uniq -cd' don't work.
3977 d_archs
=`lipo -info $xabs 2> /dev/null | grep '^Architectures' | sed 's/^.*: //'`
3978 if test -n "$d_archs"; then
3979 $echo "$modename: manually unpacking fat archive $xabs" 1>&2
3980 d_name
=`basename $xabs`
3981 d_dir
="/tmp/fat_ar.$$"
3984 for d_arch
in $d_archs; do
3985 d_archdir
="$d_dir/$d_arch"
3986 $show "$mkdir -p $d_archdir"
3987 $run $mkdir -p "$d_archdir"
3989 $show "lipo -thin $d_arch $xabs -o $d_dir/$d_name"
3990 $run lipo
-thin $d_arch "$xabs" -o "$d_dir/$d_name"
3992 $show "(cd $d_archdir && $AR x $d_dir/$d_name)"
3993 $run eval "(cd \$d_archdir && \$AR x \$d_dir/\$d_name)" ||
exit $?
3995 $show "${rm} $d_dir/$d_name"
3996 $run ${rm} "$d_dir/$d_name"
3999 # Can't deal with blanks in file names
4000 $run eval "d_files=\`find \$d_dir -type f | sed -e 's,.*/,,' -e '/ /d' | sort -u\`" ||
exit $?
4002 for d_file
in $d_files; do
4003 $run eval "d_f=\`find \$d_dir -name \$d_file -print\`" ||
exit $?
4004 $show "lipo -create $d_f -o $xdir/$d_file"
4005 $run eval "lipo -create \$d_f -o \"\$xdir/\$d_file\"" ||
exit $?
4008 $show "${rm}r $d_dir"
4009 $run ${rm}r
"$d_dir"
4011 $show "(cd $xdir && $AR x $xabs)"
4012 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
4016 # We will extract separately just the conflicting names and we will no
4017 # longer touch any unique names. It is faster to leave these extract
4018 # automatically by $AR in one run.
4019 $show "(cd $xdir && $AR x $xabs)"
4020 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
4021 if ($AR t
"$xabs" |
sort |
sort -uc >/dev
/null
2>&1); then
4024 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
4025 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
4026 $AR t
"$xabs" |
sort |
uniq -cd |
while read -r count name
4029 while test "$i" -le "$count"
4031 # Put our $i before any first dot (extension)
4032 # Never overwrite any file
4034 while test "X$name_to" = "X$name" ||
test -f "$xdir/$name_to"
4036 name_to
=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
4038 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
4039 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" ||
exit $?
4047 reload_conv_objs
="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
4052 # Create the old-style object.
4053 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
4056 eval cmds
=\"$reload_cmds\"
4057 save_ifs
="$IFS"; IFS
=$_S_
4058 for cmd
in $cmds; do
4061 $run eval "$cmd" ||
exit $?
4065 # Exit if we aren't doing a library object file.
4066 if test -z "$libobj"; then
4067 if test -n "$gentop"; then
4068 $show "${rm}r $gentop"
4075 if test "$build_libtool_libs" != yes; then
4076 if test -n "$gentop"; then
4077 $show "${rm}r $gentop"
4081 # Create an invalid libtool object if no PIC, so that we don't
4082 # accidentally link it into a program.
4083 # $show "echo timestamp > $libobj"
4084 # $run eval "echo timestamp > $libobj" || exit $?
4088 if test -n "$pic_flag" ||
test "$pic_mode" != default
; then
4089 # Only do commands if we really have different PIC objects.
4090 reload_objs
="$libobjs $reload_conv_objs"
4092 eval cmds
=\"$reload_cmds\"
4093 save_ifs
="$IFS"; IFS
=$_S_
4094 for cmd
in $cmds; do
4097 $run eval "$cmd" ||
exit $?
4102 if test -n "$gentop"; then
4103 $show "${rm}r $gentop"
4112 *cygwin
*) output
=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4114 if test -n "$vinfo"; then
4115 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4118 if test -n "$release"; then
4119 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4122 if test "$preload" = yes; then
4123 if test "$dlopen_support" = unknown
&& test "$dlopen_self" = unknown
&&
4124 test "$dlopen_self_static" = unknown
; then
4125 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4130 *-*-rhapsody* |
*-*-darwin1.
[012])
4131 # On Rhapsody replace the C library is the System framework
4132 compile_deplibs
=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4133 finalize_deplibs
=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4139 # Don't allow lazy linking, it breaks C++ global constructors
4140 if test "$tagname" = CXX
; then
4141 compile_command
="$compile_command ${wl}-bind_at_load"
4142 finalize_command
="$finalize_command ${wl}-bind_at_load"
4147 compile_command
="$compile_command $compile_deplibs"
4148 finalize_command
="$finalize_command $finalize_deplibs"
4150 if test -n "$rpath$xrpath"; then
4151 # If the user specified any rpath flags, then add them.
4152 for libdir
in $rpath $xrpath; do
4153 # This is the magic to use -rpath.
4154 case "$finalize_rpath " in
4156 *) finalize_rpath
="$finalize_rpath $libdir" ;;
4161 # Now hardcode the library paths
4164 for libdir
in $compile_rpath $finalize_rpath; do
4165 if test -n "$hardcode_libdir_flag_spec"; then
4166 if test -n "$hardcode_libdir_separator"; then
4167 if test -z "$hardcode_libdirs"; then
4168 hardcode_libdirs
="$libdir"
4170 # Just accumulate the unique libdirs.
4171 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4172 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4175 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4180 eval flag
=\"$hardcode_libdir_flag_spec\"
4181 rpath
="$rpath $flag"
4183 elif test -n "$runpath_var"; then
4184 case "$perm_rpath " in
4186 *) perm_rpath
="$perm_rpath $libdir" ;;
4190 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
4191 case :$dllsearchpath: in
4193 *) dllsearchpath
="$dllsearchpath:$libdir";;
4198 # Substitute the hardcoded libdirs into the rpath.
4199 if test -n "$hardcode_libdir_separator" &&
4200 test -n "$hardcode_libdirs"; then
4201 libdir
="$hardcode_libdirs"
4202 eval rpath
=\" $hardcode_libdir_flag_spec\"
4204 compile_rpath
="$rpath"
4208 for libdir
in $finalize_rpath; do
4209 if test -n "$hardcode_libdir_flag_spec"; then
4210 if test -n "$hardcode_libdir_separator"; then
4211 if test -z "$hardcode_libdirs"; then
4212 hardcode_libdirs
="$libdir"
4214 # Just accumulate the unique libdirs.
4215 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4216 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4219 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4224 eval flag
=\"$hardcode_libdir_flag_spec\"
4225 rpath
="$rpath $flag"
4227 elif test -n "$runpath_var"; then
4228 case "$finalize_perm_rpath " in
4230 *) finalize_perm_rpath
="$finalize_perm_rpath $libdir" ;;
4234 # Substitute the hardcoded libdirs into the rpath.
4235 if test -n "$hardcode_libdir_separator" &&
4236 test -n "$hardcode_libdirs"; then
4237 libdir
="$hardcode_libdirs"
4238 eval rpath
=\" $hardcode_libdir_flag_spec\"
4240 finalize_rpath
="$rpath"
4242 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4243 # Transform all the library objects into standard objects.
4244 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4245 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4249 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
4250 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4251 dlsyms
="${outputname}S.c"
4253 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4257 if test -n "$dlsyms"; then
4261 # Discover the nlist of each of the dlfiles.
4262 nlist
="$output_objdir/${outputname}.nm"
4264 $show "$rm $nlist ${nlist}S ${nlist}T"
4265 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4267 # Parse the name list into a source file.
4268 $show "creating $output_objdir/$dlsyms"
4270 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4271 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4272 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4278 /* Prevent the only kind of declaration conflicts we can make. */
4279 #define lt_preloaded_symbols some_other_symbol
4281 /* External symbol declarations for the compiler. */\
4284 if test "$dlself" = yes; then
4285 $show "generating symbol list for \`$output'"
4287 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4289 # Add our own program objects to the symbol list.
4290 progfiles
=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4291 for arg
in $progfiles; do
4292 $show "extracting global C symbols from \`$arg'"
4293 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4296 if test -n "$exclude_expsyms"; then
4297 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4298 $run eval '$mv "$nlist"T "$nlist"'
4301 if test -n "$export_symbols_regex"; then
4302 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4303 $run eval '$mv "$nlist"T "$nlist"'
4306 # Prepare the list of exported symbols
4307 if test -z "$export_symbols"; then
4308 export_symbols
="$output_objdir/$output.exp"
4309 $run $rm $export_symbols
4310 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4312 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
4313 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
4314 $run eval 'mv "$nlist"T "$nlist"'
4318 for arg
in $dlprefiles; do
4319 $show "extracting global C symbols from \`$arg'"
4320 name
=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4321 $run eval '$echo ": $name " >> "$nlist"'
4322 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4325 if test -z "$run"; then
4326 # Make sure we have at least an empty file.
4327 test -f "$nlist" ||
: > "$nlist"
4329 if test -n "$exclude_expsyms"; then
4330 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4331 $mv "$nlist"T
"$nlist"
4334 # Try sorting and uniquifying the output.
4335 if grep -v "^: " < "$nlist" |
4336 if sort -k 3 </dev
/null
>/dev
/null
2>&1; then
4341 uniq > "$nlist"S
; then
4344 grep -v "^: " < "$nlist" > "$nlist"S
4347 if test -f "$nlist"S
; then
4348 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4350 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4353 $echo >> "$output_objdir/$dlsyms" "\
4355 #undef lt_preloaded_symbols
4357 #if defined (__STDC__) && __STDC__
4358 # define lt_ptr void *
4360 # define lt_ptr char *
4364 /* The mapping between symbol names and symbols. */
4369 lt_preloaded_symbols[] =
4373 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4375 $echo >> "$output_objdir/$dlsyms" "\
4379 /* This works around a problem in FreeBSD linker */
4380 #ifdef FREEBSD_WORKAROUND
4381 static const void *lt_preloaded_setup() {
4382 return lt_preloaded_symbols;
4392 pic_flag_for_symtable
=
4394 # compiling the symbol table file with pic_flag works around
4395 # a FreeBSD bug that causes programs to crash when -lm is
4396 # linked before any other PIC object. But we must not use
4397 # pic_flag when linking with -static. The problem exists in
4398 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4399 *-*-freebsd2*|
*-*-freebsd3.0
*|
*-*-freebsdelf3.0
*)
4400 case "$compile_command " in
4402 *) pic_flag_for_symtable
=" $pic_flag -DFREEBSD_WORKAROUND";;
4405 case "$compile_command " in
4407 *) pic_flag_for_symtable
=" $pic_flag";;
4411 # Now compile the dynamic symbol file.
4412 $show "(cd $output_objdir && $LTCC $archargs -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4413 $run eval '(cd $output_objdir && $LTCC $archargs -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' ||
exit $?
4415 # Clean up the generated files.
4416 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4417 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4419 # Transform the symbol file into the correct name.
4420 compile_command
=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4421 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4424 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4429 # We keep going just in case the user didn't refer to
4430 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4431 # really was required.
4433 # Nullify the symbol file.
4434 compile_command
=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4435 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4438 if test "$need_relink" = no ||
test "$build_libtool_libs" != yes; then
4439 # Replace the output file specification.
4440 compile_command
=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4441 link_command
="$compile_command$compile_rpath"
4443 # We have no uninstalled library dependencies, so finalize right now.
4444 $show "$link_command"
4445 $run eval "$link_command"
4448 # Delete the generated files.
4449 if test -n "$dlsyms"; then
4450 $show "$rm $output_objdir/${outputname}S.${objext}"
4451 $run $rm "$output_objdir/${outputname}S.${objext}"
4457 if test -n "$shlibpath_var"; then
4458 # We should set the shlibpath_var
4460 for dir
in $temp_rpath; do
4462 [\\/]* |
[A-Za-z
]:[\\/]*)
4467 # Relative path: add a thisdir entry.
4468 rpath
="$rpath\$thisdir/$dir:"
4475 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4476 compile_command
="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4478 if test -n "$finalize_shlibpath"; then
4479 finalize_command
="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4484 if test -n "$runpath_var"; then
4485 if test -n "$perm_rpath"; then
4486 # We should set the runpath_var.
4488 for dir
in $perm_rpath; do
4491 compile_var
="$runpath_var=\"$rpath\$$runpath_var\" "
4493 if test -n "$finalize_perm_rpath"; then
4494 # We should set the runpath_var.
4496 for dir
in $finalize_perm_rpath; do
4499 finalize_var
="$runpath_var=\"$rpath\$$runpath_var\" "
4503 if test "$no_install" = yes; then
4504 # We don't need to create a wrapper script.
4505 link_command
="$compile_var$compile_command$compile_rpath"
4506 # Replace the output file specification.
4507 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4508 # Delete the old output file.
4510 # Link the executable and exit
4511 $show "$link_command"
4512 $run eval "$link_command" ||
exit $?
4516 if test "$hardcode_action" = relink
; then
4517 # Fast installation is not supported
4518 link_command
="$compile_var$compile_command$compile_rpath"
4519 relink_command
="$finalize_var$finalize_command$finalize_rpath"
4521 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4522 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4524 if test "$fast_install" != no
; then
4525 link_command
="$finalize_var$compile_command$finalize_rpath"
4526 if test "$fast_install" = yes; then
4527 relink_command
=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4529 # fast_install is set to needless
4533 link_command
="$compile_var$compile_command$compile_rpath"
4534 relink_command
="$finalize_var$finalize_command$finalize_rpath"
4538 # Replace the output file specification.
4539 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4541 # Delete the old output files.
4542 $run $rm $output $output_objdir/$outputname $output_objdir/lt-
$outputname
4544 $show "$link_command"
4545 $run eval "$link_command" ||
exit $?
4547 # Now create the wrapper script.
4548 $show "creating $output"
4550 # Quote the relink command for shipping.
4551 if test -n "$relink_command"; then
4552 # Preserve any variables that may affect compiler behavior
4553 for var
in $variables_saved_for_relink; do
4554 if eval test -z \"\
${$var+set}\"; then
4555 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4556 elif eval var_value
=\$
$var; test -z "$var_value"; then
4557 relink_command
="$var=; export $var; $relink_command"
4559 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4560 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
4563 relink_command
="(cd `pwd`; $relink_command)"
4564 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4567 # Quote $echo for shipping.
4568 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
4570 [\\/]* |
[A-Za-z
]:[\\/]*) qecho
="$SHELL $0 --fallback-echo";;
4571 *) qecho
="$SHELL `pwd`/$0 --fallback-echo";;
4573 qecho
=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4575 qecho
=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4578 # Only actually do things if our run command is non-null.
4579 if test -z "$run"; then
4580 # win32 will think the script is a binary if it has
4581 # a .exe suffix, so we strip it off here.
4583 *.exe
) output
=`$echo $output|${SED} 's,.exe$,,'` ;;
4585 # test for cygwin because mv fails w/o .exe extensions
4589 outputname
=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4593 *cygwin
* |
*mingw
* )
4594 cwrappersource
=`$echo ${objdir}/lt-${output}.c`
4595 cwrapper
=`$echo ${output}.exe`
4596 $rm $cwrappersource $cwrapper
4597 trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
4599 cat > $cwrappersource <<EOF
4601 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4602 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4604 The $output program cannot be directly executed until all the libtool
4605 libraries that it depends on are installed.
4607 This wrapper executable should never be moved out of the build directory.
4608 If it is, it will not operate correctly.
4610 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4611 but could eventually absorb all of the scripts functionality and
4612 exec $objdir/$outputname directly.
4615 cat >> $cwrappersource<<"EOF"
4623 #if defined(PATH_MAX)
4624 # define LT_PATHMAX PATH_MAX
4625 #elif defined(MAXPATHLEN)
4626 # define LT_PATHMAX MAXPATHLEN
4628 # define LT_PATHMAX 1024
4631 #ifndef DIR_SEPARATOR
4632 #define DIR_SEPARATOR '/'
4635 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4637 #define HAVE_DOS_BASED_FILE_SYSTEM
4638 #ifndef DIR_SEPARATOR_2
4639 #define DIR_SEPARATOR_2 '\\'
4643 #ifndef DIR_SEPARATOR_2
4644 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4645 #else /* DIR_SEPARATOR_2 */
4646 # define IS_DIR_SEPARATOR(ch) \
4647 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4648 #endif /* DIR_SEPARATOR_2 */
4650 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4651 #define XFREE(stale) do { \
4652 if (stale) { free ((void *) stale); stale = 0; } \
4655 const char *program_name = NULL;
4657 void * xmalloc (size_t num);
4658 char * xstrdup (const char *string);
4659 char * basename (const char *name);
4660 char * fnqualify(const char *path);
4661 char * strendzap(char *str, const char *pat);
4662 void lt_fatal (const char *message, ...);
4665 main (int argc, char *argv[])
4670 program_name = (char *) xstrdup ((char *) basename (argv[0]));
4671 newargz = XMALLOC(char *, argc+2);
4674 cat >> $cwrappersource <<EOF
4675 newargz[0] = "$SHELL";
4678 cat >> $cwrappersource <<"EOF"
4679 newargz
[1] = fnqualify
(argv
[0]);
4680 /* we know the
script has the same name
, without the .exe
*/
4681 /* so
make sure newargz
[1] doesn
't end in .exe */
4682 strendzap(newargz[1],".exe");
4683 for (i = 1; i < argc; i++)
4684 newargz[i+1] = xstrdup(argv[i]);
4685 newargz[argc+1] = NULL;
4688 cat >> $cwrappersource <<EOF
4689 execv("$SHELL",newargz);
4692 cat >> $cwrappersource <<"EOF"
4696 xmalloc (size_t num)
4698 void * p = (void *) malloc (num);
4700 lt_fatal ("Memory exhausted");
4706 xstrdup (const char *string)
4708 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4713 basename (const char *name)
4717 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4718 /* Skip over the disk name in MSDOS pathnames. */
4719 if (isalpha (name[0]) && name[1] == ':')
4723 for (base = name; *name; name++)
4724 if (IS_DIR_SEPARATOR (*name))
4726 return (char *) base;
4730 fnqualify(const char *path)
4734 char tmp[LT_PATHMAX + 1];
4736 assert(path != NULL);
4738 /* Is it qualified already? */
4739 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4740 if (isalpha (path[0]) && path[1] == ':')
4741 return xstrdup (path);
4743 if (IS_DIR_SEPARATOR (path[0]))
4744 return xstrdup (path);
4746 /* prepend the current directory */
4747 /* doesn't handle
'~' */
4748 if (getcwd
(tmp
, LT_PATHMAX
) == NULL
)
4749 lt_fatal
("getcwd failed");
4750 size
= strlen
(tmp
) + 1 + strlen
(path
) + 1; /* +2 for '/' and
'\0' */
4751 p
= XMALLOC
(char
, size
);
4752 sprintf
(p
, "%s%c%s", tmp
, DIR_SEPARATOR
, path
);
4757 strendzap
(char
*str
, const char
*pat
)
4761 assert
(str
!= NULL
);
4762 assert
(pat
!= NULL
);
4765 patlen
= strlen
(pat
);
4769 str
+= len
- patlen
;
4770 if (strcmp
(str
, pat
) == 0)
4777 lt_error_core
(int exit_status
, const char
* mode
,
4778 const char
* message
, va_list ap
)
4780 fprintf
(stderr
, "%s: %s: ", program_name
, mode
);
4781 vfprintf
(stderr
, message
, ap
);
4782 fprintf
(stderr
, ".\n");
4784 if (exit_status
>= 0)
4789 lt_fatal
(const char
*message
, ...
)
4792 va_start
(ap
, message
);
4793 lt_error_core
(EXIT_FAILURE
, "FATAL", message
, ap
);
4797 # we should really use a build-platform specific compiler
4798 # here, but OTOH, the wrappers (shell script and this C one)
4799 # are only useful if you want to execute the "real" binary.
4800 # Since the "real" binary is built for $host, then this
4801 # wrapper might as well be built for $host, too.
4802 $run $LTCC $archargs -s -o $cwrapper $cwrappersource
4806 trap "$rm $output; exit 1" 1 2 15
4811 # $output - temporary wrapper script for $objdir/$outputname
4812 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4814 # The $output program cannot be directly executed until all the libtool
4815 # libraries that it depends on are installed.
4817 # This wrapper script should never be moved out of the build directory.
4818 # If it is, it will not operate correctly.
4820 # Sed substitution that helps us do robust quoting. It backslashifies
4821 # metacharacters that are still active within double-quoted strings.
4822 Xsed='${SED} -e 1s/^X//'
4823 sed_quote_subst='$sed_quote_subst'
4825 # The HP-UX ksh and POSIX shell print the target directory to stdout
4827 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
4829 relink_command=\"$relink_command\"
4831 # This environment variable determines our operation mode.
4832 if test \"\$libtool_install_magic\" = \"$magic\"; then
4833 # install mode needs the following variable:
4834 notinst_deplibs='$notinst_deplibs'
4836 # When we are sourced in execute mode, \$file and \$echo are already set.
4837 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4840 # Make sure echo works.
4841 if test \"X\$1\" = X--no-reexec; then
4842 # Discard the --no-reexec flag, and continue.
4844 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4845 # Yippee, \$echo works!
4848 # Restart under the correct shell, and then maybe \$echo will work.
4849 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4855 # Find the directory that this script lives in.
4856 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4857 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4859 # Follow symbolic links until we get to the real thisdir.
4860 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4861 while test -n \"\$file\"; do
4862 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4864 # If there was a directory component, then change thisdir.
4865 if test \"x\$destdir\" != \"x\$file\"; then
4866 case \"\$destdir\" in
4867 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4868 *) thisdir=\"\$thisdir/\$destdir\" ;;
4872 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4873 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
4876 # Try to get the absolute directory name.
4877 absdir=\`cd \"\$thisdir\" && pwd\`
4878 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4881 if test "$fast_install" = yes; then
4883 program=lt-'$outputname'$exeext
4884 progdir=\"\$thisdir/$objdir\"
4886 if test ! -f \"\$progdir/\$program\" || \\
4887 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4888 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4890 file=\"\$\$-\$program\"
4892 if test ! -d \"\$progdir\"; then
4893 $mkdir \"\$progdir\"
4895 $rm \"\$progdir/\$file\"
4900 # relink executable if necessary
4901 if test -n \"\$relink_command\"; then
4902 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4904 $echo \"\$relink_command_output\" >&2
4905 $rm \"\$progdir/\$file\"
4910 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4911 { $rm \"\$progdir/\$program\";
4912 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4913 $rm \"\$progdir/\$file\"
4917 program='$outputname'
4918 progdir=\"\$thisdir/$objdir\"
4924 if test -f \"\$progdir/\$program\"; then"
4926 # Export our shlibpath_var if we have one.
4927 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4929 # Add our own library path to $shlibpath_var
4930 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4932 # Some systems cannot cope with colon-terminated $shlibpath_var
4933 # The second colon is a workaround for a bug in BeOS R4 sed
4934 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4936 export $shlibpath_var
4940 # fixup the dll searchpath if we need to.
4941 if test -n "$dllsearchpath"; then
4943 # Add the dll search path components to the executable PATH
4944 PATH=$dllsearchpath:\$PATH
4949 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4950 # Run the actual program with our arguments.
4953 # Backslashes separate directories on plain windows
4954 *-*-mingw |
*-*-os2*)
4956 exec \$progdir\\\\\$program \${1+\"\$@\"}
4962 exec \$progdir/\$program \${1+\"\$@\"}
4967 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4971 # The program doesn't exist.
4972 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4973 \$echo \"This script is just a wrapper for \$program.\" 1>&2
4974 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
4985 # See if we need to build an old-fashioned archive.
4986 for oldlib
in $oldlibs; do
4988 if test "$build_libtool_libs" = convenience
; then
4989 oldobjs
="$libobjs_save"
4990 addlibs
="$convenience"
4991 build_libtool_libs
=no
4993 if test "$build_libtool_libs" = module
; then
4994 oldobjs
="$libobjs_save"
4995 build_libtool_libs
=no
4997 oldobjs
="$old_deplibs $non_pic_objects"
4999 addlibs
="$old_convenience"
5002 if test -n "$addlibs"; then
5003 gentop
="$output_objdir/${outputname}x"
5004 $show "${rm}r $gentop"
5005 $run ${rm}r
"$gentop"
5006 $show "$mkdir $gentop"
5007 $run $mkdir "$gentop"
5009 if test "$status" -ne 0 && test ! -d "$gentop"; then
5012 generated
="$generated $gentop"
5014 # Add in members from convenience archives.
5015 for xlib
in $addlibs; do
5016 # Extract the objects.
5018 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
5019 *) xabs
=`pwd`"/$xlib" ;;
5021 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
5022 xdir
="$gentop/$xlib"
5024 $show "${rm}r $xdir"
5026 $show "$mkdir $xdir"
5029 if test "$status" -ne 0 && test ! -d "$xdir"; then
5034 # ranlib-ed archives of fat binaries are converted to a fat xabs that
5035 # ar can't use. So we to split the fat xabs into non-fat ones to unpack.
5036 # We can't deal with duplicate names, since 'ar xN' and 'uniq -cd' don't work.
5037 d_archs
=`lipo -info $xabs 2> /dev/null | grep '^Architectures' | sed 's/^.*: //'`
5038 if test -n "$d_archs"; then
5039 $echo "$modename: manually unpacking fat archive $xabs" 1>&2
5040 d_name
=`basename $xabs`
5041 d_dir
="/tmp/fat_ar.$$"
5044 for d_arch
in $d_archs; do
5045 d_archdir
="$d_dir/$d_arch"
5046 $show "$mkdir -p $d_archdir"
5047 $run $mkdir -p "$d_archdir"
5049 $show "lipo -thin $d_arch $xabs -o $d_dir/$d_name"
5050 $run lipo
-thin $d_arch "$xabs" -o "$d_dir/$d_name"
5052 $show "(cd $d_archdir && $AR x $d_dir/$d_name)"
5053 $run eval "(cd \$d_archdir && \$AR x \$d_dir/\$d_name)" ||
exit $?
5055 $show "${rm} $d_dir/$d_name"
5056 $run ${rm} "$d_dir/$d_name"
5059 # Can't deal with blanks in file names
5060 $run eval "d_files=\`find \$d_dir -type f | sed -e 's,.*/,,' -e '/ /d' | sort -u\`" ||
exit $?
5062 for d_file
in $d_files; do
5063 $run eval "d_f=\`find \$d_dir -name \$d_file -print\`" ||
exit $?
5064 $show "lipo -create $d_f -o $xdir/$d_file"
5065 $run eval "lipo -create \$d_f -o \"\$xdir/\$d_file\"" ||
exit $?
5068 $show "${rm}r $d_dir"
5069 $run ${rm}r
"$d_dir"
5071 $show "(cd $xdir && $AR x $xabs)"
5072 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
5076 # We will extract separately just the conflicting names and we will no
5077 # longer touch any unique names. It is faster to leave these extract
5078 # automatically by $AR in one run.
5079 $show "(cd $xdir && $AR x $xabs)"
5080 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
5081 if ($AR t
"$xabs" |
sort |
sort -uc >/dev
/null
2>&1); then
5084 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
5085 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
5086 $AR t
"$xabs" |
sort |
uniq -cd |
while read -r count name
5089 while test "$i" -le "$count"
5091 # Put our $i before any first dot (extension)
5092 # Never overwrite any file
5094 while test "X$name_to" = "X$name" ||
test -f "$xdir/$name_to"
5096 name_to
=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
5098 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
5099 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" ||
exit $?
5107 oldobjs
="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
5111 # Do each command in the archive commands.
5112 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5113 eval cmds
=\"$old_archive_from_new_cmds\"
5115 eval cmds
=\"$old_archive_cmds\"
5117 if len
=`expr "X$cmds" : ".*"` &&
5118 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
5121 # the command line is too long to link in one step, link in parts
5122 $echo "using piecewise archive linking..."
5127 save_oldobjs
=$oldobjs
5128 # GNU ar 2.10+ was changed to match POSIX; thus no paths are
5129 # encoded into archives. This makes 'ar r' malfunction in
5130 # this piecewise linking case whenever conflicting object
5131 # names appear in distinct ar calls; check, warn and compensate.
5132 if (for obj
in $save_oldobjs
5134 $echo "X$obj" |
$Xsed -e 's%^.*/%%'
5135 done |
sort |
sort -uc >/dev
/null
2>&1); then
5138 $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
5139 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
5142 # Is there a better way of finding the last object in the list?
5143 for obj
in $save_oldobjs
5147 for obj
in $save_oldobjs
5149 oldobjs
="$objlist $obj"
5150 objlist
="$objlist $obj"
5151 eval test_cmds
=\"$old_archive_cmds\"
5152 if len
=`expr "X$test_cmds" : ".*"` &&
5153 test "$len" -le "$max_cmd_len"; then
5156 # the above command should be used before it gets too long
5158 if test "$obj" = "$last_oldobj" ; then
5161 test -z "$concat_cmds" || concat_cmds
=$concat_cmds${_S_}
5162 eval concat_cmds
=\"\
${concat_cmds}$old_archive_cmds\"
5168 if test "X$oldobjs" = "X" ; then
5169 eval cmds
=\"\
$concat_cmds\"
5171 eval cmds
=\"\
$concat_cmds${_S_}$old_archive_cmds\"
5175 save_ifs
="$IFS"; IFS
=$_S_
5176 for cmd
in $cmds; do
5179 $run eval "$cmd" ||
exit $?
5184 if test -n "$generated"; then
5185 $show "${rm}r$generated"
5186 $run ${rm}r
$generated
5189 # Now create the libtool archive.
5193 test "$build_old_libs" = yes && old_library
="$libname.$libext"
5194 $show "creating $output"
5196 # Preserve any variables that may affect compiler behavior
5197 for var
in $variables_saved_for_relink; do
5198 if eval test -z \"\
${$var+set}\"; then
5199 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5200 elif eval var_value
=\$
$var; test -z "$var_value"; then
5201 relink_command
="$var=; export $var; $relink_command"
5203 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5204 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
5207 # Quote the link command for shipping.
5208 relink_command
="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
5209 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5211 # Only create the output if not a dry run.
5212 if test -z "$run"; then
5213 for installed
in no
yes; do
5214 if test "$installed" = yes; then
5215 if test -z "$install_libdir"; then
5218 output
="$output_objdir/$outputname"i
5219 # Replace all uninstalled libtool libraries with the installed ones
5221 for deplib
in $dependency_libs; do
5224 name
=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5225 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5226 if test -z "$libdir"; then
5227 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5230 newdependency_libs
="$newdependency_libs $libdir/$name"
5232 *) newdependency_libs
="$newdependency_libs $deplib" ;;
5235 dependency_libs
="$newdependency_libs"
5237 for lib
in $dlfiles; do
5238 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5239 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5240 if test -z "$libdir"; then
5241 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5244 newdlfiles
="$newdlfiles $libdir/$name"
5246 dlfiles
="$newdlfiles"
5248 for lib
in $dlprefiles; do
5249 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5250 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5251 if test -z "$libdir"; then
5252 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5255 newdlprefiles
="$newdlprefiles $libdir/$name"
5257 dlprefiles
="$newdlprefiles"
5260 # place dlname in correct position for cygwin
5262 case $host,$output,$installed,$module,$dlname in
5263 *cygwin
*,*lai
,yes,no
,*.dll |
*mingw
*,*lai
,yes,no
,*.dll
) tdlname
=..
/bin
/$dlname ;;
5266 # $outputname - a libtool library file
5267 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5269 # Please DO NOT delete this file!
5270 # It is necessary for linking the library.
5272 # The name that we can dlopen(3).
5275 # Names of this library.
5276 library_names='$library_names'
5278 # The name of the static archive.
5279 old_library='$old_library'
5281 # Libraries that this one depends upon.
5282 dependency_libs='$dependency_libs'
5284 # Version information for $libname.
5289 # Is this an already installed library?
5290 installed=$installed
5292 # Should we warn about portability when linking against -modules?
5293 shouldnotlink=$module
5295 # Files to dlopen/dlpreopen
5297 dlpreopen='$dlprefiles'
5299 # Directory that this library needs to be installed in:
5300 libdir='$install_libdir'"
5301 if test "$installed" = no
&& test "$need_relink" = yes; then
5303 relink_command=\"$relink_command\""
5308 # Do a symbolic link so that the libtool archive can be found in
5309 # LD_LIBRARY_PATH before the program is installed.
5310 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5311 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' ||
exit $?
5317 # libtool install mode
5319 modename
="$modename: install"
5321 # There may be an optional sh(1) argument at the beginning of
5322 # install_prog (especially on Windows NT).
5323 if test "$nonopt" = "$SHELL" ||
test "$nonopt" = /bin
/sh ||
5324 # Allow the use of GNU shtool's install command.
5325 $echo "X$nonopt" |
$Xsed |
grep shtool
> /dev
/null
; then
5326 # Aesthetically quote it.
5327 arg
=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5329 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5333 install_prog
="$arg "
5341 # The real first argument should be the name of the installation program.
5342 # Aesthetically quote it.
5343 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5345 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5349 install_prog
="$install_prog$arg"
5351 # We need to accept at least all the BSD install flags.
5361 if test -n "$dest"; then
5362 files
="$files $dest"
5380 # If the previous option needed an argument, then skip it.
5381 if test -n "$prev"; then
5390 # Aesthetically quote the argument.
5391 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5393 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5397 install_prog
="$install_prog $arg"
5400 if test -z "$install_prog"; then
5401 $echo "$modename: you must specify an install program" 1>&2
5406 if test -n "$prev"; then
5407 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5412 if test -z "$files"; then
5413 if test -z "$dest"; then
5414 $echo "$modename: no file or destination specified" 1>&2
5416 $echo "$modename: you must specify a destination" 1>&2
5422 # Strip any trailing slash from the destination.
5423 dest
=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5425 # Check to see that the destination is a directory.
5426 test -d "$dest" && isdir
=yes
5427 if test "$isdir" = yes; then
5431 destdir
=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5432 test "X$destdir" = "X$dest" && destdir
=.
5433 destname
=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5435 # Not a directory, so check to see that there is only one file specified.
5437 if test "$#" -gt 2; then
5438 $echo "$modename: \`$dest' is not a directory" 1>&2
5444 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
5446 for file in $files; do
5450 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5459 # This variable tells wrapper scripts just to set variables rather
5460 # than running their programs.
5461 libtool_install_magic
="$magic"
5466 for file in $files; do
5468 # Do each installation.
5471 # Do the static libraries later.
5472 staticlibs
="$staticlibs $file"
5476 # Check to see that this really is a libtool archive.
5477 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
5479 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5487 # If there is no directory component, then add one.
5489 */* |
*\\*) .
$file ;;
5493 # Add the libdir to current_libdirs if it is the destination.
5494 if test "X$destdir" = "X$libdir"; then
5495 case "$current_libdirs " in
5497 *) current_libdirs
="$current_libdirs $libdir" ;;
5500 # Note the libdir as a future libdir.
5501 case "$future_libdirs " in
5503 *) future_libdirs
="$future_libdirs $libdir" ;;
5507 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5508 test "X$dir" = "X$file/" && dir
=
5511 if test -n "$relink_command"; then
5512 # Determine the prefix the user has applied to our future dir.
5513 inst_prefix_dir
=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5515 # Don't allow the user to place us outside of our expected
5516 # location b/c this prevents finding dependent libraries that
5517 # are installed to the same prefix.
5518 # At present, this check doesn't affect windows .dll's that
5519 # are installed into $libdir/../bin (currently, that works fine)
5520 # but it's something to keep an eye on.
5521 if test "$inst_prefix_dir" = "$destdir"; then
5522 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5526 if test -n "$inst_prefix_dir"; then
5527 # Stick the inst_prefix_dir data into the link command.
5528 relink_command
=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5530 relink_command
=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5533 $echo "$modename: warning: relinking \`$file'" 1>&2
5534 $show "$relink_command"
5535 if $run eval "$relink_command"; then :
5537 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5542 # See the names of the shared library.
5543 set dummy
$library_names
5544 if test -n "$2"; then
5550 test -n "$relink_command" && srcname
="$realname"T
5552 # Install the shared library and build the symlinks.
5553 $show "$install_prog $dir/$srcname $destdir/$realname"
5554 $run eval "$install_prog $dir/$srcname $destdir/$realname" ||
exit $?
5555 if test -n "$stripme" && test -n "$striplib"; then
5556 $show "$striplib $destdir/$realname"
5557 $run eval "$striplib $destdir/$realname" ||
exit $?
5560 if test "$#" -gt 0; then
5561 # Delete the old symlinks, and create new ones.
5564 if test "$linkname" != "$realname"; then
5565 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5566 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5571 # Do each command in the postinstall commands.
5572 lib
="$destdir/$realname"
5573 eval cmds
=\"$postinstall_cmds\"
5574 save_ifs
="$IFS"; IFS
=$_S_
5575 for cmd
in $cmds; do
5578 $run eval "$cmd" ||
exit $?
5583 # Install the pseudo-library for information purposes.
5584 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5585 instname
="$dir/$name"i
5586 $show "$install_prog $instname $destdir/$name"
5587 $run eval "$install_prog $instname $destdir/$name" ||
exit $?
5589 # Maybe install the static library, too.
5590 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
5594 # Install (i.e. copy) a libtool object.
5596 # Figure out destination file name, if it wasn't already specified.
5597 if test -n "$destname"; then
5598 destfile
="$destdir/$destname"
5600 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5601 destfile
="$destdir/$destfile"
5604 # Deduce the name of the destination old-style object file.
5607 staticdest
=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5610 staticdest
="$destfile"
5614 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5620 # Install the libtool object if requested.
5621 if test -n "$destfile"; then
5622 $show "$install_prog $file $destfile"
5623 $run eval "$install_prog $file $destfile" ||
exit $?
5626 # Install the old object if enabled.
5627 if test "$build_old_libs" = yes; then
5628 # Deduce the name of the old-style object file.
5629 staticobj
=`$echo "X$file" | $Xsed -e "$lo2o"`
5631 $show "$install_prog $staticobj $staticdest"
5632 $run eval "$install_prog \$staticobj \$staticdest" ||
exit $?
5638 # Figure out destination file name, if it wasn't already specified.
5639 if test -n "$destname"; then
5640 destfile
="$destdir/$destname"
5642 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5643 destfile
="$destdir/$destfile"
5646 # If the file is missing, and there is a .exe on the end, strip it
5647 # because it is most likely a libtool script we actually want to
5652 if test ! -f "$file"; then
5653 file=`$echo $file|${SED} 's,.exe$,,'`
5659 # Do a test to see if this is really a libtool program.
5662 wrapper
=`$echo $file | ${SED} -e 's,.exe$,,'`
5668 if (${SED} -e '4q' $wrapper |
grep "^# Generated by .*$PACKAGE")>/dev
/null
2>&1; then
5672 # To insure that "foo" is sourced, and not "foo.exe",
5673 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5674 # which disallows the automatic-append-.exe behavior.
5676 *cygwin
* |
*mingw
*) wrapperdot
=${wrapper}.
;;
5677 *) wrapperdot
=${wrapper} ;;
5679 # If there is no directory component, then add one.
5681 */* |
*\\*) .
${wrapperdot} ;;
5682 *) . .
/${wrapperdot} ;;
5685 # Check the variables that should have been set.
5686 if test -z "$notinst_deplibs"; then
5687 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5692 for lib
in $notinst_deplibs; do
5693 # Check to see that each library is installed.
5695 if test -f "$lib"; then
5696 # If there is no directory component, then add one.
5698 */* |
*\\*) .
$lib ;;
5702 libfile
="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5703 if test -n "$libdir" && test ! -f "$libfile"; then
5704 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5710 # To insure that "foo" is sourced, and not "foo.exe",
5711 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5712 # which disallows the automatic-append-.exe behavior.
5714 *cygwin
* |
*mingw
*) wrapperdot
=${wrapper}.
;;
5715 *) wrapperdot
=${wrapper} ;;
5717 # If there is no directory component, then add one.
5719 */* |
*\\*) .
${wrapperdot} ;;
5720 *) . .
/${wrapperdot} ;;
5724 if test "$fast_install" = no
&& test -n "$relink_command"; then
5725 if test "$finalize" = yes && test -z "$run"; then
5727 test -n "$TMPDIR" && tmpdir
="$TMPDIR"
5728 tmpdir
="$tmpdir/libtool-$$"
5729 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
5731 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5734 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5735 outputname
="$tmpdir/$file"
5736 # Replace the output file specification.
5737 relink_command
=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5739 $show "$relink_command"
5740 if $run eval "$relink_command"; then :
5742 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5748 $echo "$modename: warning: cannot relink \`$file'" 1>&2
5751 # Install the binary that we compiled earlier.
5752 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5756 # remove .exe since cygwin /usr/bin/install will append another
5758 case $install_prog,$host in
5759 */usr
/bin
/install*,*cygwin
*)
5760 case $file:$destfile in
5765 destfile
=$destfile.exe
5768 destfile
=`$echo $destfile | ${SED} -e 's,.exe$,,'`
5773 $show "$install_prog$stripme $file $destfile"
5774 $run eval "$install_prog\$stripme \$file \$destfile" ||
exit $?
5775 test -n "$outputname" && ${rm}r
"$tmpdir"
5780 for file in $staticlibs; do
5781 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5783 # Set up the ranlib parameters.
5784 oldlib
="$destdir/$name"
5786 $show "$install_prog $file $oldlib"
5787 $run eval "$install_prog \$file \$oldlib" ||
exit $?
5789 if test -n "$stripme" && test -n "$striplib"; then
5790 $show "$old_striplib $oldlib"
5791 $run eval "$old_striplib $oldlib" ||
exit $?
5794 # Do each command in the postinstall commands.
5795 eval cmds
=\"$old_postinstall_cmds\"
5796 save_ifs
="$IFS"; IFS
=$_S_
5797 for cmd
in $cmds; do
5800 $run eval "$cmd" ||
exit $?
5805 if test -n "$future_libdirs"; then
5806 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5809 if test -n "$current_libdirs"; then
5810 # Maybe just do a dry run.
5811 test -n "$run" && current_libdirs
=" -n$current_libdirs"
5812 exec_cmd
='$SHELL $0 --finish$current_libdirs'
5818 # libtool finish mode
5820 modename
="$modename: finish"
5824 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5827 libdirs
="$libdirs $dir"
5830 for libdir
in $libdirs; do
5831 if test -n "$finish_cmds"; then
5832 # Do each command in the finish commands.
5833 eval cmds
=\"$finish_cmds\"
5834 save_ifs
="$IFS"; IFS
=$_S_
5835 for cmd
in $cmds; do
5838 $run eval "$cmd" || admincmds
="$admincmds
5843 if test -n "$finish_eval"; then
5844 # Do the single finish_eval.
5845 eval cmds
=\"$finish_eval\"
5846 $run eval "$cmds" || admincmds
="$admincmds
5852 # Exit here if they wanted silent mode.
5853 test "$show" = : && exit 0
5855 $echo "----------------------------------------------------------------------"
5856 $echo "Libraries have been installed in:"
5857 for libdir
in $libdirs; do
5861 $echo "If you ever happen to want to link against installed libraries"
5862 $echo "in a given directory, LIBDIR, you must either use libtool, and"
5863 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5864 $echo "flag during linking and do at least one of the following:"
5865 if test -n "$shlibpath_var"; then
5866 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5867 $echo " during execution"
5869 if test -n "$runpath_var"; then
5870 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
5871 $echo " during linking"
5873 if test -n "$hardcode_libdir_flag_spec"; then
5875 eval flag
=\"$hardcode_libdir_flag_spec\"
5877 $echo " - use the \`$flag' linker flag"
5879 if test -n "$admincmds"; then
5880 $echo " - have your system administrator run these commands:$admincmds"
5882 if test -f /etc
/ld.so.conf
; then
5883 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5886 $echo "See any operating system documentation about shared libraries for"
5887 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
5888 $echo "----------------------------------------------------------------------"
5892 # libtool execute mode
5894 modename
="$modename: execute"
5896 # The first argument is the command name.
5898 if test -z "$cmd"; then
5899 $echo "$modename: you must specify a COMMAND" 1>&2
5904 # Handle -dlopen flags immediately.
5905 for file in $execute_dlfiles; do
5906 if test ! -f "$file"; then
5907 $echo "$modename: \`$file' is not a file" 1>&2
5915 # Check to see that this really is a libtool archive.
5916 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
5918 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5923 # Read the libtool library.
5927 # If there is no directory component, then add one.
5929 */* |
*\\*) .
$file ;;
5933 # Skip this library if it cannot be dlopened.
5934 if test -z "$dlname"; then
5935 # Warn if it was a shared library.
5936 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
5940 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5941 test "X$dir" = "X$file" && dir
=.
5943 if test -f "$dir/$objdir/$dlname"; then
5946 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5952 # Just add the directory containing the .lo file.
5953 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5954 test "X$dir" = "X$file" && dir
=.
5958 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
5963 # Get the absolute pathname.
5964 absdir
=`cd "$dir" && pwd`
5965 test -n "$absdir" && dir
="$absdir"
5967 # Now add the directory to shlibpath_var.
5968 if eval "test -z \"\$$shlibpath_var\""; then
5969 eval "$shlibpath_var=\"\$dir\""
5971 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
5975 # This variable tells wrapper scripts just to set shlibpath_var
5976 # rather than running their programs.
5977 libtool_execute_magic
="$magic"
5979 # Check if any of the arguments is a wrapper script.
5986 # Do a test to see if this is really a libtool program.
5987 if (${SED} -e '4q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
5988 # If there is no directory component, then add one.
5990 */* |
*\\*) .
$file ;;
5994 # Transform arg to wrapped name.
5995 file="$progdir/$program"
5999 # Quote arguments (to preserve shell metacharacters).
6000 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6001 args
="$args \"$file\""
6004 if test -z "$run"; then
6005 if test -n "$shlibpath_var"; then
6006 # Export the shlibpath_var.
6007 eval "export $shlibpath_var"
6010 # Restore saved environment variables
6011 if test "${save_LC_ALL+set}" = set; then
6012 LC_ALL
="$save_LC_ALL"; export LC_ALL
6014 if test "${save_LANG+set}" = set; then
6015 LANG
="$save_LANG"; export LANG
6018 # Now prepare to actually exec the command.
6019 exec_cmd
="\$cmd$args"
6021 # Display what would be done.
6022 if test -n "$shlibpath_var"; then
6023 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6024 $echo "export $shlibpath_var"
6031 # libtool clean and uninstall mode
6033 modename
="$modename: $mode"
6039 # This variable tells wrapper scripts just to set variables rather
6040 # than running their programs.
6041 libtool_install_magic
="$magic"
6046 -f) rm="$rm $arg"; rmforce
=yes ;;
6047 -*) rm="$rm $arg" ;;
6048 *) files
="$files $arg" ;;
6052 if test -z "$rm"; then
6053 $echo "$modename: you must specify an RM program" 1>&2
6060 origobjdir
="$objdir"
6061 for file in $files; do
6062 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6063 if test "X$dir" = "X$file"; then
6065 objdir
="$origobjdir"
6067 objdir
="$dir/$origobjdir"
6069 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6070 test "$mode" = uninstall
&& objdir
="$dir"
6072 # Remember objdir for removal later, being careful to avoid duplicates
6073 if test "$mode" = clean
; then
6076 *) rmdirs
="$rmdirs $objdir" ;;
6080 # Don't error if the file doesn't exist and rm -f was used.
6081 if (test -L "$file") >/dev
/null
2>&1 \
6082 ||
(test -h "$file") >/dev
/null
2>&1 \
6083 ||
test -f "$file"; then
6085 elif test -d "$file"; then
6088 elif test "$rmforce" = yes; then
6096 # Possibly a libtool archive, so verify it.
6097 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6100 # Delete the libtool libraries and symlinks.
6101 for n
in $library_names; do
6102 rmfiles
="$rmfiles $objdir/$n"
6104 test -n "$old_library" && rmfiles
="$rmfiles $objdir/$old_library"
6105 test "$mode" = clean
&& rmfiles
="$rmfiles $objdir/$name $objdir/${name}i"
6107 if test "$mode" = uninstall
; then
6108 if test -n "$library_names"; then
6109 # Do each command in the postuninstall commands.
6110 eval cmds
=\"$postuninstall_cmds\"
6111 save_ifs
="$IFS"; IFS
=$_S_
6112 for cmd
in $cmds; do
6116 if test "$?" -ne 0 && test "$rmforce" != yes; then
6123 if test -n "$old_library"; then
6124 # Do each command in the old_postuninstall commands.
6125 eval cmds
=\"$old_postuninstall_cmds\"
6126 save_ifs
="$IFS"; IFS
=$_S_
6127 for cmd
in $cmds; do
6131 if test "$?" -ne 0 && test "$rmforce" != yes; then
6137 # FIXME: should reinstall the best remaining shared library.
6143 # Possibly a libtool object, so verify it.
6144 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6149 # Add PIC object to the list of files to remove.
6150 if test -n "$pic_object" \
6151 && test "$pic_object" != none
; then
6152 rmfiles
="$rmfiles $dir/$pic_object"
6155 # Add non-PIC object to the list of files to remove.
6156 if test -n "$non_pic_object" \
6157 && test "$non_pic_object" != none
; then
6158 rmfiles
="$rmfiles $dir/$non_pic_object"
6164 if test "$mode" = clean
; then
6168 file=`$echo $file|${SED} 's,.exe$,,'`
6169 noexename
=`$echo $name|${SED} 's,.exe$,,'`
6170 # $file with .exe has already been added to rmfiles,
6171 # add $file without .exe
6172 rmfiles
="$rmfiles $file"
6175 # Do a test to see if this is a libtool program.
6176 if (${SED} -e '4q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6180 # note $name still contains .exe if it was in $file originally
6181 # as does the version of $file that was added into $rmfiles
6182 rmfiles
="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6183 if test "$fast_install" = yes && test -n "$relink_command"; then
6184 rmfiles
="$rmfiles $objdir/lt-$name"
6186 if test "X$noexename" != "X$name" ; then
6187 rmfiles
="$rmfiles $objdir/lt-${noexename}.c"
6193 $show "$rm $rmfiles"
6194 $run $rm $rmfiles || exit_status
=1
6196 objdir
="$origobjdir"
6198 # Try to remove the ${objdir}s in the directories where we deleted files
6199 for dir
in $rmdirs; do
6200 if test -d "$dir"; then
6202 $run rmdir $dir >/dev
/null
2>&1
6210 $echo "$modename: you must specify a MODE" 1>&2
6211 $echo "$generic_help" 1>&2
6216 if test -z "$exec_cmd"; then
6217 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6218 $echo "$generic_help" 1>&2
6221 fi # test -z "$show_help"
6223 if test -n "$exec_cmd"; then
6228 # We need to display help for each of the modes.
6231 "Usage: $modename [OPTION]... [MODE-ARG]...
6233 Provide generalized library-building support services.
6235 --config show all configuration variables
6236 --debug enable verbose shell tracing
6237 -n, --dry-run display commands without modifying any files
6238 --features display basic configuration information and exit
6239 --finish same as \`--mode=finish'
6240 --help display this help message and exit
6241 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6242 --quiet same as \`--silent'
6243 --silent don't print informational messages
6244 --tag=TAG use configuration variables from tag TAG
6245 --version print version information
6247 MODE must be one of the following:
6249 clean remove files from the build directory
6250 compile compile a source file into a libtool object
6251 execute automatically set library path, then run a program
6252 finish complete the installation of libtool libraries
6253 install install libraries or executables
6254 link create a library or an executable
6255 uninstall remove libraries from an installed directory
6257 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6258 a more detailed description of MODE.
6260 Report bugs to <bug-libtool@gnu.org>."
6266 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6268 Remove files from the build directory.
6270 RM is the name of the program to use to delete files associated with each FILE
6271 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6274 If FILE is a libtool library, object or program, all the files associated
6275 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6280 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6282 Compile a source file into a libtool library object.
6284 This mode accepts the following additional options:
6286 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6287 -prefer-pic try to building PIC objects only
6288 -prefer-non-pic try to building non-PIC objects only
6289 -static always build a \`.o' file suitable for static linking
6291 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6292 from the given SOURCEFILE.
6294 The output file name is determined by removing the directory component from
6295 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6296 library object suffix, \`.lo'."
6301 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6303 Automatically set library path, then run a program.
6305 This mode accepts the following additional options:
6307 -dlopen FILE add the directory containing FILE to the library path
6309 This mode sets the library path environment variable according to \`-dlopen'
6312 If any of the ARGS are libtool executable wrappers, then they are translated
6313 into their corresponding uninstalled binary, and any of their required library
6314 directories are added to the library path.
6316 Then, COMMAND is executed, with ARGS as arguments."
6321 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6323 Complete the installation of libtool libraries.
6325 Each LIBDIR is a directory that contains libtool libraries.
6327 The commands that this mode executes may require superuser privileges. Use
6328 the \`--dry-run' option if you just want to see what would be executed."
6333 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6335 Install executables or libraries.
6337 INSTALL-COMMAND is the installation command. The first component should be
6338 either the \`install' or \`cp' program.
6340 The rest of the components are interpreted as arguments to that command (only
6341 BSD-compatible install options are recognized)."
6346 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6348 Link object files or libraries together to form another library, or to
6349 create an executable program.
6351 LINK-COMMAND is a command using the C compiler that you would use to create
6352 a program from several object files.
6354 The following components of LINK-COMMAND are treated specially:
6356 -all-static do not do any dynamic linking at all
6357 -avoid-version do not add a version suffix if possible
6358 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6359 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6360 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6361 -export-symbols SYMFILE
6362 try to export only the symbols listed in SYMFILE
6363 -export-symbols-regex REGEX
6364 try to export only the symbols matching REGEX
6365 -LLIBDIR search LIBDIR for required installed libraries
6366 -lNAME OUTPUT-FILE requires the installed library libNAME
6367 -module build a library that can dlopened
6368 -no-fast-install disable the fast-install mode
6369 -no-install link a not-installable executable
6370 -no-undefined declare that a library does not refer to external symbols
6371 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6372 -objectlist FILE Use a list of object files found in FILE to specify objects
6373 -release RELEASE specify package release information
6374 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6375 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6376 -static do not do any dynamic linking of libtool libraries
6377 -version-info CURRENT[:REVISION[:AGE]]
6378 specify library version info [each variable defaults to 0]
6380 All other options (arguments beginning with \`-') are ignored.
6382 Every other argument is treated as a filename. Files ending in \`.la' are
6383 treated as uninstalled libtool libraries, other files are standard or library
6386 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6387 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6388 required, except when creating a convenience library.
6390 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6391 using \`ar' and \`ranlib', or on Windows using \`lib'.
6393 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6394 is created, otherwise an executable program is created."
6399 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6401 Remove libraries from an installation directory.
6403 RM is the name of the program to use to delete files associated with each FILE
6404 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6407 If FILE is a libtool library, all the files associated with it are deleted.
6408 Otherwise, only FILE itself is deleted using RM."
6412 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6419 $echo "Try \`$modename --help' for more information about other modes."
6423 # The TAGs below are defined such that we never get into a situation
6424 # in which we disable both kinds of libraries. Given conflicting
6425 # choices, we go for a static library, that is the most portable,
6426 # since we can't tell whether shared libraries were disabled because
6427 # the user asked for that or because the platform doesn't support
6428 # them. This is particularly important on AIX, because we don't
6429 # support having both static and shared libraries enabled at the same
6430 # time on that platform, so we default to a shared-only configuration.
6431 # If a disable-shared tag is given, we'll fallback to a static-only
6432 # configuration. But we'll never go from static-only to shared-only.
6434 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6435 build_libtool_libs
=no
6437 # ### END LIBTOOL TAG CONFIG: disable-shared
6439 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6440 build_old_libs
=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6441 # ### END LIBTOOL TAG CONFIG: disable-static