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.2.25 2003/08/01 19:08:35) Debian$Rev: 49 $"
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|tr A '\301'` in
74 A
) # 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
100 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
101 $echo "$modename: not configured to build any kind of library" 1>&2
102 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
115 lo2o
="s/\\.lo\$/.${objext}/"
116 o2lo
="s/\\.${objext}\$/.lo/"
118 #####################################
119 # Shell function definitions:
120 # This seems to be the best place for them
122 # Need a lot of goo to handle *both* DLLs and import libs
123 # Has to be a shell function in order to 'eat' the argument
124 # that is supplied when $file_magic_command is called.
126 win32_libid_type
="unknown"
127 win32_fileres
=`file -L $1 2>/dev/null`
128 case $win32_fileres in
129 *ar\ archive\ import\ library
*) # definitely import
130 win32_libid_type
="x86 archive import"
132 *ar\ archive
*) # could be an import, or static
133 if eval $OBJDUMP -f $1 |
$SED -e '10q' 2>/dev
/null | \
134 grep -E 'file format pe-i386(.*architecture: i386)?' >/dev
/null
; then
135 win32_nmres
=`eval $NM -f posix -A $1 | \
136 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
137 if test "X$win32_nmres" = "Ximport" ; then
138 win32_libid_type
="x86 archive import"
140 win32_libid_type
="x86 archive static"
145 win32_libid_type
="x86 DLL"
147 *executable
*) # but shell scripts are "executable" too...
148 case $win32_fileres in
149 *MS\ Windows\ PE\ Intel
*)
150 win32_libid_type
="x86 DLL"
155 $echo $win32_libid_type
158 # End of Shell function definitions
159 #####################################
161 # Parse our command line options once, thoroughly.
162 while test "$#" -gt 0
168 -*=*) optarg
=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
172 # If the previous option needs an argument, assign it.
173 if test -n "$prev"; then
176 execute_dlfiles
="$execute_dlfiles $arg"
181 # Check whether tagname contains only valid characters
184 $echo "$progname: invalid tag name: $tagname" 1>&2
191 # Don't test for the "default" C tag, as we know, it's there, but
192 # not specially marked.
195 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev
/null
; then
196 taglist
="$taglist $tagname"
197 # Evaluate the configuration.
198 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
200 $echo "$progname: ignoring unknown tag $tagname" 1>&2
215 # Have we seen a non-optional argument yet?
222 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
224 $echo "Copyright (C) 2003 Free Software Foundation, Inc."
225 $echo "This is free software; see the source for copying conditions. There is NO"
226 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
231 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
232 # Now print the configurations for the tags.
233 for tagname
in $taglist; do
234 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
240 $echo "$progname: enabling shell trace mode"
250 if test "$build_libtool_libs" = yes; then
251 $echo "enable shared libraries"
253 $echo "disable shared libraries"
255 if test "$build_old_libs" = yes; then
256 $echo "enable static libraries"
258 $echo "disable static libraries"
263 --finish) mode
="finish" ;;
265 --mode) prevopt
="--mode" prev
=mode
;;
266 --mode=*) mode
="$optarg" ;;
268 --preserve-dup-deps) duplicate_deps
="yes" ;;
274 --tag) prevopt
="--tag" prev
=tag
;;
276 set tag
"$optarg" ${1+"$@"}
287 $echo "$modename: unrecognized option \`$arg'" 1>&2
299 if test -n "$prevopt"; then
300 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
305 # If this variable is set in any of the actions, the command in it
306 # will be execed at the end. This prevents here-documents from being
307 # left over by shells.
310 if test -z "$show_help"; then
312 # Infer the operation mode.
313 if test -z "$mode"; then
314 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
315 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
317 *cc | cc
* |
*++ | gcc
* |
*-gcc* | g
++* | xlc
*)
329 *db |
*dbx |
*strace |
*truss
)
339 # If we have no mode, but dlfiles were specified, then do execute mode.
340 test -n "$execute_dlfiles" && mode
=execute
342 # Just use the default operation mode.
343 if test -z "$mode"; then
344 if test -n "$nonopt"; then
345 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
347 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
354 # Only execute mode is allowed to have -dlopen flags.
355 if test -n "$execute_dlfiles" && test "$mode" != execute
; then
356 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
361 # Change the help message to a mode-specific one.
363 help="Try \`$modename --help --mode=$mode' for more information."
365 # These modes are in order of execution frequency so that they run quickly.
367 # libtool compile mode
369 modename
="$modename: compile"
370 # Get the compilation command and the source file.
372 srcfile
="$nonopt" # always keep a non-empty value in "srcfile"
381 # do not "continue". Instead, add this to base_compile
393 # Accept any command-line options.
396 if test -n "$libobj" ; then
397 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
420 arg_mode
=arg
# the next one goes into the "base_compile" arg list
421 continue # The current "srcfile" will either be retained or
422 ;; # replaced later. I would guess that would be a bug.
425 args
=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
427 save_ifs
="$IFS"; IFS
=','
431 # Double-quote args containing other shell metacharacters.
432 # Many Bourne shells cannot handle close brackets correctly
433 # in scan sets, so we specify it separately.
435 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
439 lastarg
="$lastarg $arg"
442 lastarg
=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
444 # Add the arguments to base_compile.
445 base_compile
="$base_compile $lastarg"
450 # Accept the current argument as the source file.
451 # The previous "srcfile" becomes the current argument.
458 esac # case $arg_mode
460 # Aesthetically quote the previous argument.
461 lastarg
=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
464 # Double-quote args containing other shell metacharacters.
465 # Many Bourne shells cannot handle close brackets correctly
466 # in scan sets, so we specify it separately.
467 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
468 lastarg
="\"$lastarg\""
472 base_compile
="$base_compile $lastarg"
477 $echo "$modename: you must specify an argument for -Xcompile"
481 $echo "$modename: you must specify a target with \`-o'" 1>&2
485 # Get the name of the library object.
486 [ -z "$libobj" ] && libobj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
490 # Recognize several different file suffixes.
491 # If the user specifies -o file.o, it is replaced with file.lo
501 *.class
) xform
=class
;;
506 *.java
) xform
=java
;;
509 libobj
=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
512 *.lo
) obj
=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
514 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
519 # Infer tagged configuration to use if any are available and
520 # if one wasn't chosen via the "--tag" command line option.
521 # Only attempt this if the compiler in the base compile
522 # command doesn't match the default compiler.
523 if test -n "$available_tags" && test -z "$tagname"; then
524 case $base_compile in
525 # Blanks in the command may have been stripped by the calling shell,
526 # but not from the CC environment variable when configure was run.
527 " $CC "* |
"$CC "* |
" `$echo $CC` "* |
"`$echo $CC` "*) ;;
528 # Blanks at the start of $base_compile will cause this to fail
529 # if we don't check for them as well.
531 for z
in $available_tags; do
532 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev
/null
; then
533 # Evaluate the configuration.
534 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
535 case "$base_compile " in
536 "$CC "* |
" $CC "* |
"`$echo $CC` "* |
" `$echo $CC` "*)
537 # The compiler in the base compile command matches
538 # the one in the tagged configuration.
539 # Assume this is the tagged configuration we want.
546 # If $tagname still isn't set, then no tagged configuration
547 # was found and let the user know that the "--tag" command
548 # line option must be used.
549 if test -z "$tagname"; then
550 $echo "$modename: unable to infer tagged configuration"
551 $echo "$modename: specify a tag with \`--tag'" 1>&2
554 # $echo "$modename: using $tagname tagged configuration"
560 objname
=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
561 xdir
=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
562 if test "X$xdir" = "X$obj"; then
567 lobj
=${xdir}$objdir/$objname
569 if test -z "$base_compile"; then
570 $echo "$modename: you must specify a compilation command" 1>&2
575 # Delete any leftover library objects.
576 if test "$build_old_libs" = yes; then
577 removelist
="$obj $lobj $libobj ${libobj}T"
579 removelist
="$lobj $libobj ${libobj}T"
583 trap "$run $rm $removelist; exit 1" 1 2 15
585 # On Cygwin there's no "real" PIC flag so we must build both object types
587 cygwin
* | mingw
* | pw32
* | os2
*)
591 if test "$pic_mode" = no
&& test "$deplibs_check_method" != pass_all
; then
592 # non-PIC code in shared libraries is not supported
596 # Calculate the filename of the output object if compiler does
597 # not support -o with -c
598 if test "$compiler_c_o" = no
; then
599 output_obj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.
${objext}
600 lockfile
="$output_obj.lock"
601 removelist
="$removelist $output_obj $lockfile"
602 trap "$run $rm $removelist; exit 1" 1 2 15
609 # Lock this critical section if it is needed
610 # We use this script file to make the link, it avoids creating a new file
611 if test "$need_locks" = yes; then
612 until $run ln "$0" "$lockfile" 2>/dev
/null
; do
613 $show "Waiting for $lockfile to be removed"
616 elif test "$need_locks" = warn
; then
617 if test -f "$lockfile"; then
619 *** ERROR, $lockfile exists and contains:
620 `cat $lockfile 2>/dev/null`
622 This indicates that another process is trying to use the same
623 temporary object file, and libtool could not work around it because
624 your compiler does not support \`-c' and \`-o' together. If you
625 repeat this compilation, it may succeed, by chance, but you had better
626 avoid parallel builds (make -j) in this platform, or get a better
632 $echo $srcfile > "$lockfile"
635 if test -n "$fix_srcfile_path"; then
636 eval srcfile
=\"$fix_srcfile_path\"
639 $run $rm "$libobj" "${libobj}T"
641 # Create a libtool object file (analogous to a ".la" file),
642 # but don't create it if we're doing a dry run.
643 test -z "$run" && cat > ${libobj}T
<<EOF
644 # $libobj - a libtool object file
645 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
647 # Please DO NOT delete this file!
648 # It is necessary for linking the library.
650 # Name of the PIC object.
653 # Only build a PIC object if we are building libtool libraries.
654 if test "$build_libtool_libs" = yes; then
655 # Without this assignment, base_compile gets emptied.
656 fbsd_hideous_sh_bug
=$base_compile
658 if test "$pic_mode" != no
; then
659 command="$base_compile $srcfile $pic_flag"
661 # Don't build PIC code
662 command="$base_compile $srcfile"
665 if test ! -d "${xdir}$objdir"; then
666 $show "$mkdir ${xdir}$objdir"
667 $run $mkdir ${xdir}$objdir
669 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
674 if test -z "$output_obj"; then
675 # Place PIC objects in $objdir
676 command="$command -o $lobj"
679 $run $rm "$lobj" "$output_obj"
682 if $run eval "$command"; then :
684 test -n "$output_obj" && $run $rm $removelist
688 if test "$need_locks" = warn
&&
689 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
691 *** ERROR, $lockfile contains:
692 `cat $lockfile 2>/dev/null`
694 but it should contain:
697 This indicates that another process is trying to use the same
698 temporary object file, and libtool could not work around it because
699 your compiler does not support \`-c' and \`-o' together. If you
700 repeat this compilation, it may succeed, by chance, but you had better
701 avoid parallel builds (make -j) in this platform, or get a better
708 # Just move the object if needed, then go on to compile the next one
709 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
710 $show "$mv $output_obj $lobj"
711 if $run $mv $output_obj $lobj; then :
719 # Append the name of the PIC object to the libtool object file.
720 test -z "$run" && cat >> ${libobj}T
<<EOF
721 pic_object='$objdir/$objname'
725 # Allow error messages only from the first compilation.
726 suppress_output
=' >/dev/null 2>&1'
728 # No PIC object so indicate it doesn't exist in the libtool
730 test -z "$run" && cat >> ${libobj}T
<<EOF
736 # Only build a position-dependent object if we build old libraries.
737 if test "$build_old_libs" = yes; then
738 if test "$pic_mode" != yes; then
739 # Don't build PIC code
740 command="$base_compile $srcfile"
742 command="$base_compile $srcfile $pic_flag"
744 if test "$compiler_c_o" = yes; then
745 command="$command -o $obj"
748 # Suppress compiler output if we already did a PIC compilation.
749 command="$command$suppress_output"
750 $run $rm "$obj" "$output_obj"
752 if $run eval "$command"; then :
758 if test "$need_locks" = warn
&&
759 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
761 *** ERROR, $lockfile contains:
762 `cat $lockfile 2>/dev/null`
764 but it should contain:
767 This indicates that another process is trying to use the same
768 temporary object file, and libtool could not work around it because
769 your compiler does not support \`-c' and \`-o' together. If you
770 repeat this compilation, it may succeed, by chance, but you had better
771 avoid parallel builds (make -j) in this platform, or get a better
778 # Just move the object if needed
779 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
780 $show "$mv $output_obj $obj"
781 if $run $mv $output_obj $obj; then :
789 # Append the name of the non-PIC object the libtool object file.
790 # Only append if the libtool object file exists.
791 test -z "$run" && cat >> ${libobj}T
<<EOF
792 # Name of the non-PIC object.
793 non_pic_object='$objname'
797 # Append the name of the non-PIC object the libtool object file.
798 # Only append if the libtool object file exists.
799 test -z "$run" && cat >> ${libobj}T
<<EOF
800 # Name of the non-PIC object.
806 $run $mv "${libobj}T" "${libobj}"
808 # Unlock the critical section if it was locked
809 if test "$need_locks" != no
; then
818 modename
="$modename: link"
820 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
821 # It is impossible to link a dll without this setting, and
822 # we shouldn't force the makefile maintainer to figure out
823 # which system we are compiling for in order to pass an extra
824 # flag for every libtool invocation.
827 # FIXME: Unfortunately, there are problems with the above when trying
828 # to make a dll which has undefined symbols, in which case not
829 # even a static library is built. For now, we need to specify
830 # -no-undefined on the libtool link line when we can be certain
831 # that all symbols are satisfied, otherwise we get a static library.
838 libtool_args
="$nonopt"
839 base_compile
="$nonopt"
840 compile_command
="$nonopt"
841 finalize_command
="$nonopt"
854 lib_search_path
=`pwd`
863 export_symbols_regex
=
871 prefer_static_libs
=no
884 # We need to know -static, to get the right output filenames.
888 -all-static |
-static)
889 if test "X$arg" = "X-all-static"; then
890 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
891 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
893 if test -n "$link_static_flag"; then
894 dlopen_self
=$dlopen_self_static
897 if test -z "$pic_flag" && test -n "$link_static_flag"; then
898 dlopen_self
=$dlopen_self_static
901 build_libtool_libs
=no
903 prefer_static_libs
=yes
909 # See if our shared archives depend on static archives.
910 test -n "$old_archive_from_new_cmds" && build_old_libs
=yes
912 # Go through the arguments, transforming them on the way.
913 while test "$#" -gt 0; do
915 base_compile
="$base_compile $arg"
918 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
919 qarg
=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
923 libtool_args
="$libtool_args $qarg"
925 # If the previous option needs an argument, assign it.
926 if test -n "$prev"; then
929 compile_command
="$compile_command @OUTPUT@"
930 finalize_command
="$finalize_command @OUTPUT@"
936 if test "$preload" = no
; then
937 # Add the symbol object into the linking commands.
938 compile_command
="$compile_command @SYMFILE@"
939 finalize_command
="$finalize_command @SYMFILE@"
943 *.la |
*.lo
) ;; # We handle these cases below.
945 if test "$dlself" = no
; then
953 if test "$prev" = dlprefiles
; then
955 elif test "$prev" = dlfiles
&& test "$dlopen_self" != yes; then
965 if test "$prev" = dlfiles
; then
966 dlfiles
="$dlfiles $arg"
968 dlprefiles
="$dlprefiles $arg"
976 export_symbols
="$arg"
977 if test ! -f "$arg"; then
978 $echo "$modename: symbol file \`$arg' does not exist"
985 export_symbols_regex
="$arg"
990 inst_prefix_dir
="$arg"
1000 if test -f "$arg"; then
1003 for fil
in `cat $save_arg`
1005 # moreargs="$moreargs $fil"
1007 # A libtool-controlled object.
1009 # Check to see that this really is a libtool object.
1010 if (${SED} -e '2q' $arg |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1015 # If there is no directory component, then add one.
1017 */* |
*\\*) .
$arg ;;
1021 if test -z "$pic_object" || \
1022 test -z "$non_pic_object" ||
1023 test "$pic_object" = none
&& \
1024 test "$non_pic_object" = none
; then
1025 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1029 # Extract subdirectory from the argument.
1030 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1031 if test "X$xdir" = "X$arg"; then
1037 if test "$pic_object" != none
; then
1038 # Prepend the subdirectory the object is found in.
1039 pic_object
="$xdir$pic_object"
1041 if test "$prev" = dlfiles
; then
1042 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1043 dlfiles
="$dlfiles $pic_object"
1047 # If libtool objects are unsupported, then we need to preload.
1052 # CHECK ME: I think I busted this. -Ossama
1053 if test "$prev" = dlprefiles
; then
1054 # Preload the old-style object.
1055 dlprefiles
="$dlprefiles $pic_object"
1060 libobjs
="$libobjs $pic_object"
1065 if test "$non_pic_object" != none
; then
1066 # Prepend the subdirectory the object is found in.
1067 non_pic_object
="$xdir$non_pic_object"
1069 # A standard non-PIC object
1070 non_pic_objects
="$non_pic_objects $non_pic_object"
1071 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1072 arg
="$non_pic_object"
1076 # Only an error if not doing a dry-run.
1077 if test -z "$run"; then
1078 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1083 # Extract subdirectory from the argument.
1084 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1085 if test "X$xdir" = "X$arg"; then
1091 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1092 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1093 libobjs
="$libobjs $pic_object"
1094 non_pic_objects
="$non_pic_objects $non_pic_object"
1099 $echo "$modename: link input file \`$save_arg' does not exist"
1107 # We need an absolute path.
1109 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1111 $echo "$modename: only absolute run-paths are allowed" 1>&2
1115 if test "$prev" = rpath
; then
1118 *) rpath
="$rpath $arg" ;;
1123 *) xrpath
="$xrpath $arg" ;;
1130 compiler_flags
="$compiler_flags $qarg"
1132 compile_command
="$compile_command $qarg"
1133 finalize_command
="$finalize_command $qarg"
1137 linker_flags
="$linker_flags $qarg"
1138 compiler_flags
="$compiler_flags $wl$qarg"
1140 compile_command
="$compile_command $wl$qarg"
1141 finalize_command
="$finalize_command $wl$qarg"
1145 linker_flags
="$linker_flags $qarg"
1146 compiler_flags
="$compiler_flags $qarg"
1148 compile_command
="$compile_command $qarg"
1149 finalize_command
="$finalize_command $qarg"
1153 eval "$prev=\"\$arg\""
1158 fi # test -n "$prev"
1164 if test -n "$link_static_flag"; then
1165 compile_command
="$compile_command $link_static_flag"
1166 finalize_command
="$finalize_command $link_static_flag"
1172 # FIXME: remove this flag sometime in the future.
1173 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1197 -export-symbols |
-export-symbols-regex)
1198 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
1199 $echo "$modename: more than one -exported-symbols argument is not allowed"
1202 if test "X$arg" = "X-export-symbols"; then
1215 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1216 # so, if we see these flags be careful not to treat them like -L
1218 case $with_gcc/$host in
1219 no
/*-*-irix* |
/*-*-irix*)
1220 compile_command
="$compile_command $arg"
1221 finalize_command
="$finalize_command $arg"
1228 dir
=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1229 # We need an absolute path.
1231 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1233 absdir
=`cd "$dir" && pwd`
1234 if test -z "$absdir"; then
1235 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1244 deplibs
="$deplibs -L$dir"
1245 lib_search_path
="$lib_search_path $dir"
1249 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1250 case :$dllsearchpath: in
1252 *) dllsearchpath
="$dllsearchpath:$dir";;
1260 if test "X$arg" = "X-lc" ||
test "X$arg" = "X-lm"; then
1262 *-*-cygwin* |
*-*-pw32* |
*-*-beos*)
1263 # These systems don't actually have a C or math library (as such)
1266 *-*-mingw* |
*-*-os2*)
1267 # These systems don't actually have a C library (as such)
1268 test "X$arg" = "X-lc" && continue
1270 *-*-openbsd* |
*-*-freebsd*)
1271 # Do not include libc due to us having libc/libc_r.
1272 test "X$arg" = "X-lc" && continue
1274 *-*-rhapsody* |
*-*-darwin1.
[012])
1275 # Rhapsody C and math libraries are in the System framework
1276 deplibs
="$deplibs -framework System"
1279 elif test "X$arg" = "X-lc_r"; then
1281 *-*-openbsd* |
*-*-freebsd*)
1282 # Do not include libc_r directly, use -pthread flag.
1287 deplibs
="$deplibs $arg"
1296 # gcc -m* arguments should be passed to the linker via $compiler_flags
1297 # in order to pass architecture information to the linker
1298 # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
1299 # but this is not reliable with gcc because gcc may use -mfoo to
1300 # select a different linker, different libraries, etc, while
1301 # -Wl,-mfoo simply passes -mfoo to the linker.
1303 # Unknown arguments in both finalize_command and compile_command need
1304 # to be aesthetically quoted because they are evaled later.
1305 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1307 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1311 compile_command
="$compile_command $arg"
1312 finalize_command
="$finalize_command $arg"
1313 if test "$with_gcc" = "yes" ; then
1314 compiler_flags
="$compiler_flags $arg"
1331 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1332 # The PATH hackery in wrapper scripts is required on Windows
1333 # in order for the loader to find any dlls it needs.
1334 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1335 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1338 *) no_install
=yes ;;
1371 dir
=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1372 # We need an absolute path.
1374 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1376 $echo "$modename: only absolute run-paths are allowed" 1>&2
1382 *) xrpath
="$xrpath $dir" ;;
1388 # The effects of -static are defined in a previous loop.
1389 # We used to do the same as -all-static on platforms that
1390 # didn't have a PIC flag, but the assumption that the effects
1391 # would be equivalent was wrong. It would break on at least
1392 # Digital Unix and AIX.
1412 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1414 save_ifs
="$IFS"; IFS
=','
1415 for flag
in $args; do
1418 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1423 compiler_flags
="$compiler_flags $flag"
1426 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1430 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1432 save_ifs
="$IFS"; IFS
=','
1433 for flag
in $args; do
1436 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1441 compiler_flags
="$compiler_flags $wl$flag"
1442 linker_flags
="$linker_flags $flag"
1445 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1463 # Some other compiler flag.
1465 # Unknown arguments in both finalize_command and compile_command need
1466 # to be aesthetically quoted because they are evaled later.
1467 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1469 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1476 # A standard object.
1481 # A libtool-controlled object.
1483 # Check to see that this really is a libtool object.
1484 if (${SED} -e '2q' $arg |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1489 # If there is no directory component, then add one.
1491 */* |
*\\*) .
$arg ;;
1495 if test -z "$pic_object" || \
1496 test -z "$non_pic_object" ||
1497 test "$pic_object" = none
&& \
1498 test "$non_pic_object" = none
; then
1499 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1503 # Extract subdirectory from the argument.
1504 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1505 if test "X$xdir" = "X$arg"; then
1511 if test "$pic_object" != none
; then
1512 # Prepend the subdirectory the object is found in.
1513 pic_object
="$xdir$pic_object"
1515 if test "$prev" = dlfiles
; then
1516 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1517 dlfiles
="$dlfiles $pic_object"
1521 # If libtool objects are unsupported, then we need to preload.
1526 # CHECK ME: I think I busted this. -Ossama
1527 if test "$prev" = dlprefiles
; then
1528 # Preload the old-style object.
1529 dlprefiles
="$dlprefiles $pic_object"
1534 libobjs
="$libobjs $pic_object"
1539 if test "$non_pic_object" != none
; then
1540 # Prepend the subdirectory the object is found in.
1541 non_pic_object
="$xdir$non_pic_object"
1543 # A standard non-PIC object
1544 non_pic_objects
="$non_pic_objects $non_pic_object"
1545 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1546 arg
="$non_pic_object"
1550 # Only an error if not doing a dry-run.
1551 if test -z "$run"; then
1552 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1557 # Extract subdirectory from the argument.
1558 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1559 if test "X$xdir" = "X$arg"; then
1565 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1566 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1567 libobjs
="$libobjs $pic_object"
1568 non_pic_objects
="$non_pic_objects $non_pic_object"
1575 deplibs
="$deplibs $arg"
1576 old_deplibs
="$old_deplibs $arg"
1581 # A libtool-controlled library.
1583 if test "$prev" = dlfiles
; then
1584 # This library was specified with -dlopen.
1585 dlfiles
="$dlfiles $arg"
1587 elif test "$prev" = dlprefiles
; then
1588 # The library was specified with -dlpreopen.
1589 dlprefiles
="$dlprefiles $arg"
1592 deplibs
="$deplibs $arg"
1597 # Some other compiler argument.
1599 # Unknown arguments in both finalize_command and compile_command need
1600 # to be aesthetically quoted because they are evaled later.
1601 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1603 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1610 # Now actually substitute the argument into the commands.
1611 if test -n "$arg"; then
1612 compile_command
="$compile_command $arg"
1613 finalize_command
="$finalize_command $arg"
1615 done # argument parsing loop
1617 if test -n "$prev"; then
1618 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1623 # Infer tagged configuration to use if any are available and
1624 # if one wasn't chosen via the "--tag" command line option.
1625 # Only attempt this if the compiler in the base link
1626 # command doesn't match the default compiler.
1627 if test -n "$available_tags" && test -z "$tagname"; then
1628 case $base_compile in
1629 # Blanks in the command may have been stripped by the calling shell,
1630 # but not from the CC environment variable when configure was run.
1631 "$CC "* |
" $CC "* |
"`$echo $CC` "* |
" `$echo $CC` "*) ;;
1632 # Blanks at the start of $base_compile will cause this to fail
1633 # if we don't check for them as well.
1635 for z
in $available_tags; do
1636 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev
/null
; then
1637 # Evaluate the configuration.
1638 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
1639 case $base_compile in
1640 "$CC "* |
" $CC "* |
"`$echo $CC` "* |
" `$echo $CC` "*)
1641 # The compiler in $compile_command matches
1642 # the one in the tagged configuration.
1643 # Assume this is the tagged configuration we want.
1650 # If $tagname still isn't set, then no tagged configuration
1651 # was found and let the user know that the "--tag" command
1652 # line option must be used.
1653 if test -z "$tagname"; then
1654 $echo "$modename: unable to infer tagged configuration"
1655 $echo "$modename: specify a tag with \`--tag'" 1>&2
1658 # $echo "$modename: using $tagname tagged configuration"
1664 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1665 eval arg
=\"$export_dynamic_flag_spec\"
1666 compile_command
="$compile_command $arg"
1667 finalize_command
="$finalize_command $arg"
1671 # calculate the name of the file, without its directory
1672 outputname
=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1673 libobjs_save
="$libobjs"
1675 if test -n "$shlibpath_var"; then
1676 # get the directories listed in $shlibpath_var
1677 eval shlib_search_path
=\
`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1681 eval sys_lib_search_path
=\"$sys_lib_search_path_spec\"
1682 eval sys_lib_dlsearch_path
=\"$sys_lib_dlsearch_path_spec\"
1684 output_objdir
=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1685 if test "X$output_objdir" = "X$output"; then
1686 output_objdir
="$objdir"
1688 output_objdir
="$output_objdir/$objdir"
1690 # Create the object directory.
1691 if test ! -d "$output_objdir"; then
1692 $show "$mkdir $output_objdir"
1693 $run $mkdir $output_objdir
1695 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1700 # Determine the type of output
1703 $echo "$modename: you must specify an output file" 1>&2
1707 *.
$libext) linkmode
=oldlib
;;
1708 *.lo |
*.
$objext) linkmode
=obj
;;
1709 *.la
) linkmode
=lib
;;
1710 *) linkmode
=prog
;; # Anything else should be a program.
1714 *cygwin
* |
*mingw
* |
*pw32
*)
1715 # don't eliminate duplcations in $postdeps and $predeps
1716 duplicate_compiler_generated_deps
=yes
1719 duplicate_compiler_generated_deps
=$duplicate_deps
1725 # Find all interdependent deplibs by searching for libraries
1726 # that are linked more than once (e.g. -la -lb -la)
1727 for deplib
in $deplibs; do
1728 if test "X$duplicate_deps" = "Xyes" ; then
1730 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
1733 libs
="$libs $deplib"
1736 if test "$linkmode" = lib
; then
1737 libs
="$predeps $libs $compiler_lib_search_path $postdeps"
1739 # Compute libraries that are listed more than once in $predeps
1740 # $postdeps and mark them as special (i.e., whose duplicates are
1741 # not to be eliminated).
1743 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
1744 for pre_post_dep
in $predeps $postdeps; do
1745 case "$pre_post_deps " in
1746 *" $pre_post_dep "*) specialdeplibs
="$specialdeplibs $pre_post_deps" ;;
1748 pre_post_deps
="$pre_post_deps $pre_post_dep"
1757 need_relink
=no
# whether we're linking any uninstalled libtool libraries
1758 notinst_deplibs
= # not-installed libtool libraries
1759 notinst_path
= # paths that contain not-installed libtool libraries
1763 for file in $dlfiles $dlprefiles; do
1767 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1779 passes
="conv scan dlopen dlpreopen link"
1784 for pass
in $passes; do
1785 if test "$linkmode,$pass" = "lib,link" ||
1786 test "$linkmode,$pass" = "prog,scan"; then
1790 if test "$linkmode" = prog
; then
1792 dlopen
) libs
="$dlfiles" ;;
1793 dlpreopen
) libs
="$dlprefiles" ;;
1794 link
) libs
="$deplibs %DEPLIBS% $dependency_libs" ;;
1797 if test "$pass" = dlopen
; then
1798 # Collect dlpreopened libraries
1799 save_deplibs
="$deplibs"
1802 for deplib
in $libs; do
1807 if test "$linkmode" != lib
&& test "$linkmode" != prog
; then
1808 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1811 if test "$pass" = conv
; then
1812 deplibs
="$deplib $deplibs"
1815 name
=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1816 for searchdir
in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1817 for search_ext
in .la
$shrext .so .a
; do
1818 # Search the libtool library
1819 lib
="$searchdir/lib${name}${search_ext}"
1820 if test -f "$lib"; then
1821 if test "$search_ext" = ".la"; then
1830 if test "$found" != yes; then
1831 # deplib doesn't seem to be a libtool library
1832 if test "$linkmode,$pass" = "prog,link"; then
1833 compile_deplibs
="$deplib $compile_deplibs"
1834 finalize_deplibs
="$deplib $finalize_deplibs"
1836 deplibs
="$deplib $deplibs"
1837 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
1840 else # deplib is a libtool library
1841 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
1842 # We need to do some special things here, and not later.
1843 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
1844 case " $predeps $postdeps " in
1846 if (${SED} -e '2q' $lib |
1847 grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1851 */* |
*\\*) .
$lib ;;
1854 for l
in $old_library $library_names; do
1857 if test "X$ll" = "X$old_library" ; then # only static version available
1859 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1860 test "X$ladir" = "X$lib" && ladir
="."
1861 lib
=$ladir/$old_library
1862 if test "$linkmode,$pass" = "prog,link"; then
1863 compile_deplibs
="$deplib $compile_deplibs"
1864 finalize_deplibs
="$deplib $finalize_deplibs"
1866 deplibs
="$deplib $deplibs"
1867 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
1881 deplibs
="$deplib $deplibs"
1882 test "$pass" = conv
&& continue
1883 newdependency_libs
="$deplib $newdependency_libs"
1884 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1887 if test "$pass" = conv
; then
1888 deplibs
="$deplib $deplibs"
1891 if test "$pass" = scan
; then
1892 deplibs
="$deplib $deplibs"
1893 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1895 compile_deplibs
="$deplib $compile_deplibs"
1896 finalize_deplibs
="$deplib $finalize_deplibs"
1900 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1906 if test "$pass" = link
; then
1907 dir
=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1908 # Make sure the xrpath contains only unique directories.
1911 *) xrpath
="$xrpath $dir" ;;
1914 deplibs
="$deplib $deplibs"
1917 *.la
) lib
="$deplib" ;;
1919 if test "$pass" = conv
; then
1920 deplibs
="$deplib $deplibs"
1925 if test "$deplibs_check_method" != pass_all
; then
1927 $echo "*** Warning: Trying to link with static lib archive $deplib."
1928 $echo "*** I have the capability to make that library automatically link in when"
1929 $echo "*** you link to this library. But I can only do this if you have a"
1930 $echo "*** shared version of the library, which you do not appear to have"
1931 $echo "*** because the file extensions .$libext of this argument makes me believe"
1932 $echo "*** that it is just a static archive that I should not used here."
1935 $echo "*** Warning: Linking the shared library $output against the"
1936 $echo "*** static library $deplib is not portable!"
1937 deplibs
="$deplib $deplibs"
1942 if test "$pass" != link
; then
1943 deplibs
="$deplib $deplibs"
1945 compile_deplibs
="$deplib $compile_deplibs"
1946 finalize_deplibs
="$deplib $finalize_deplibs"
1953 if test "$pass" = conv
; then
1954 deplibs
="$deplib $deplibs"
1955 elif test "$linkmode" = prog
; then
1956 if test "$pass" = dlpreopen ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
1957 # If there is no dlopen support or we're linking statically,
1958 # we need to preload.
1959 newdlprefiles
="$newdlprefiles $deplib"
1960 compile_deplibs
="$deplib $compile_deplibs"
1961 finalize_deplibs
="$deplib $finalize_deplibs"
1963 newdlfiles
="$newdlfiles $deplib"
1973 if test "$found" = yes ||
test -f "$lib"; then :
1975 $echo "$modename: cannot find the library \`$lib'" 1>&2
1979 # Check to see that this really is a libtool archive.
1980 if (${SED} -e '2q' $lib |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
1982 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1986 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1987 test "X$ladir" = "X$lib" && ladir
="."
1995 # If the library was installed with an old release of libtool,
1996 # it will not redefine variables installed, or shouldnotlink
2002 */* |
*\\*) .
$lib ;;
2006 if test "$linkmode,$pass" = "lib,link" ||
2007 test "$linkmode,$pass" = "prog,scan" ||
2008 { test "$linkmode" != prog
&& test "$linkmode" != lib
; }; then
2009 test -n "$dlopen" && dlfiles
="$dlfiles $dlopen"
2010 test -n "$dlpreopen" && dlprefiles
="$dlprefiles $dlpreopen"
2013 if test "$pass" = conv
; then
2014 # Only check for convenience libraries
2015 deplibs
="$lib $deplibs"
2016 if test -z "$libdir"; then
2017 if test -z "$old_library"; then
2018 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2021 # It is a libtool convenience library, so add in its objects.
2022 convenience
="$convenience $ladir/$objdir/$old_library"
2023 old_convenience
="$old_convenience $ladir/$objdir/$old_library"
2025 for deplib
in $dependency_libs; do
2026 deplibs
="$deplib $deplibs"
2027 if test "X$duplicate_deps" = "Xyes" ; then
2028 case "$tmp_libs " in
2029 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2032 tmp_libs
="$tmp_libs $deplib"
2034 elif test "$linkmode" != prog
&& test "$linkmode" != lib
; then
2035 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2042 # Get the name of the library we link against.
2044 for l
in $old_library $library_names; do
2047 if test -z "$linklib"; then
2048 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2052 # This library was specified with -dlopen.
2053 if test "$pass" = dlopen
; then
2054 if test -z "$libdir"; then
2055 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2058 if test -z "$dlname" ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
2059 # If there is no dlname, no dlopen support or we're linking
2060 # statically, we need to preload. We also need to preload any
2061 # dependent libraries so libltdl's deplib preloader doesn't
2062 # bomb out in the load deplibs phase.
2063 dlprefiles
="$dlprefiles $lib $dependency_libs"
2065 newdlfiles
="$newdlfiles $lib"
2070 # We need an absolute path.
2072 [\\/]* |
[A-Za-z
]:[\\/]*) abs_ladir
="$ladir" ;;
2074 abs_ladir
=`cd "$ladir" && pwd`
2075 if test -z "$abs_ladir"; then
2076 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2077 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2082 laname
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2084 # Find the relevant object directory and library name.
2085 if test "X$installed" = Xyes
; then
2086 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2087 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2096 dir
="$ladir/$objdir"
2097 absdir
="$abs_ladir/$objdir"
2098 # Remove this search path later
2099 notinst_path
="$notinst_path $abs_ladir"
2100 fi # $installed = yes
2101 name
=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2103 # This library was specified with -dlpreopen.
2104 if test "$pass" = dlpreopen
; then
2105 if test -z "$libdir"; then
2106 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2109 # Prefer using a static library (so that no silly _DYNAMIC symbols
2110 # are required to link).
2111 if test -n "$old_library"; then
2112 newdlprefiles
="$newdlprefiles $dir/$old_library"
2113 # Otherwise, use the dlname, so that lt_dlopen finds it.
2114 elif test -n "$dlname"; then
2115 newdlprefiles
="$newdlprefiles $dir/$dlname"
2117 newdlprefiles
="$newdlprefiles $dir/$linklib"
2119 fi # $pass = dlpreopen
2121 if test -z "$libdir"; then
2122 # Link the convenience library
2123 if test "$linkmode" = lib
; then
2124 deplibs
="$dir/$old_library $deplibs"
2125 elif test "$linkmode,$pass" = "prog,link"; then
2126 compile_deplibs
="$dir/$old_library $compile_deplibs"
2127 finalize_deplibs
="$dir/$old_library $finalize_deplibs"
2129 deplibs
="$lib $deplibs" # used for prog,scan pass
2135 if test "$linkmode" = prog
&& test "$pass" != link
; then
2136 newlib_search_path
="$newlib_search_path $ladir"
2137 deplibs
="$lib $deplibs"
2140 if test "$link_all_deplibs" != no ||
test -z "$library_names" ||
2141 test "$build_libtool_libs" = no
; then
2146 for deplib
in $dependency_libs; do
2148 -L*) newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2150 # Need to link against all dependency_libs?
2151 if test "$linkalldeplibs" = yes; then
2152 deplibs
="$deplib $deplibs"
2154 # Need to hardcode shared library paths
2155 # or/and link against static libraries
2156 newdependency_libs
="$deplib $newdependency_libs"
2158 if test "X$duplicate_deps" = "Xyes" ; then
2159 case "$tmp_libs " in
2160 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2163 tmp_libs
="$tmp_libs $deplib"
2166 fi # $linkmode = prog...
2168 if test "$linkmode,$pass" = "prog,link"; then
2169 if test -n "$library_names" &&
2170 { test "$prefer_static_libs" = no ||
test -z "$old_library"; }; then
2171 # We need to hardcode the library path
2172 if test -n "$shlibpath_var"; then
2173 # Make sure the rpath contains only unique directories.
2174 case "$temp_rpath " in
2177 *) temp_rpath
="$temp_rpath $dir" ;;
2181 # Hardcode the library path.
2182 # Skip directories that are in the system default run-time
2184 case " $sys_lib_dlsearch_path " in
2187 case "$compile_rpath " in
2189 *) compile_rpath
="$compile_rpath $absdir"
2193 case " $sys_lib_dlsearch_path " in
2196 case "$finalize_rpath " in
2198 *) finalize_rpath
="$finalize_rpath $libdir"
2202 fi # $linkmode,$pass = prog,link...
2204 if test "$alldeplibs" = yes &&
2205 { test "$deplibs_check_method" = pass_all ||
2206 { test "$build_libtool_libs" = yes &&
2207 test -n "$library_names"; }; }; then
2208 # We only need to search for static libraries
2213 link_static
=no
# Whether the deplib will be linked statically
2214 if test -n "$library_names" &&
2215 { test "$prefer_static_libs" = no ||
test -z "$old_library"; }; then
2216 if test "$installed" = no
; then
2217 notinst_deplibs
="$notinst_deplibs $lib"
2220 # This is a shared library
2222 # Warn about portability, can't link against -module's on some systems (darwin)
2223 if test "$shouldnotlink" = yes && test "$pass" = link
; then
2225 if test "$linkmode" = prog
; then
2226 $echo "*** Warning: Linking the executable $output against the loadable module"
2228 $echo "*** Warning: Linking the shared library $output against the loadable module"
2230 $echo "*** $linklib is not portable!"
2232 if test "$linkmode" = lib
&&
2233 test "$hardcode_into_libs" = yes; then
2234 # Hardcode the library path.
2235 # Skip directories that are in the system default run-time
2237 case " $sys_lib_dlsearch_path " in
2240 case "$compile_rpath " in
2242 *) compile_rpath
="$compile_rpath $absdir"
2246 case " $sys_lib_dlsearch_path " in
2249 case "$finalize_rpath " in
2251 *) finalize_rpath
="$finalize_rpath $libdir"
2257 if test -n "$old_archive_from_expsyms_cmds"; then
2258 # figure out the soname
2259 set dummy
$library_names
2262 libname
=`eval \\$echo \"$libname_spec\"`
2263 # use dlname if we got it. it's perfectly good, no?
2264 if test -n "$dlname"; then
2266 elif test -n "$soname_spec"; then
2270 major
=`expr $current - $age`
2274 eval soname
=\"$soname_spec\"
2279 # Make a new name for the extract_expsyms_cmds to use
2281 soname
=`$echo $soroot | ${SED} -e 's/^.*\///'`
2282 newlib
="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2284 # If the library has no export list, then create one now
2285 if test -f "$output_objdir/$soname-def"; then :
2287 $show "extracting exported symbol list from \`$soname'"
2288 save_ifs
="$IFS"; IFS
='~'
2289 eval cmds
=\"$extract_expsyms_cmds\"
2290 for cmd
in $cmds; do
2293 $run eval "$cmd" ||
exit $?
2299 if test -f "$output_objdir/$newlib"; then :; else
2300 $show "generating import library for \`$soname'"
2301 save_ifs
="$IFS"; IFS
='~'
2302 eval cmds
=\"$old_archive_from_expsyms_cmds\"
2303 for cmd
in $cmds; do
2306 $run eval "$cmd" ||
exit $?
2310 # make sure the library variables are pointing to the new library
2313 fi # test -n "$old_archive_from_expsyms_cmds"
2315 if test "$linkmode" = prog ||
test "$mode" != relink
; then
2320 case $hardcode_action in
2321 immediate | unsupported
)
2322 if test "$hardcode_direct" = no
; then
2325 *-*-sco3.2v5
* ) add_dir
="-L$dir" ;;
2327 # if the lib is a module then we can not link against it, someone
2328 # is ignoring the new warnings I added
2329 if /usr
/bin
/file -L $add 2> /dev
/null |
grep "bundle" >/dev
/null
; then
2330 $echo "** Warning, lib $linklib is a module, not a shared library"
2331 if test -z "$old_library" ; then
2333 $echo "** And there doesn't seem to be a static archive available"
2334 $echo "** The link will probably fail, sorry"
2336 add
="$dir/$old_library"
2340 elif test "$hardcode_minus_L" = no
; then
2342 *-*-sunos*) add_shlibpath
="$dir" ;;
2346 elif test "$hardcode_shlibpath_var" = no
; then
2347 add_shlibpath
="$dir"
2354 if test "$hardcode_direct" = yes; then
2356 elif test "$hardcode_minus_L" = yes; then
2358 # Try looking first in the location we're being installed to.
2359 if test -n "$inst_prefix_dir"; then
2362 add_dir
="$add_dir -L$inst_prefix_dir$libdir"
2367 elif test "$hardcode_shlibpath_var" = yes; then
2368 add_shlibpath
="$dir"
2377 if test "$lib_linked" != yes; then
2378 $echo "$modename: configuration error: unsupported hardcode properties"
2382 if test -n "$add_shlibpath"; then
2383 case :$compile_shlibpath: in
2384 *":$add_shlibpath:"*) ;;
2385 *) compile_shlibpath
="$compile_shlibpath$add_shlibpath:" ;;
2388 if test "$linkmode" = prog
; then
2389 test -n "$add_dir" && compile_deplibs
="$add_dir $compile_deplibs"
2390 test -n "$add" && compile_deplibs
="$add $compile_deplibs"
2392 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2393 test -n "$add" && deplibs
="$add $deplibs"
2394 if test "$hardcode_direct" != yes && \
2395 test "$hardcode_minus_L" != yes && \
2396 test "$hardcode_shlibpath_var" = yes; then
2397 case :$finalize_shlibpath: in
2399 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2405 if test "$linkmode" = prog ||
test "$mode" = relink
; then
2409 # Finalize command for both is simple: just hardcode it.
2410 if test "$hardcode_direct" = yes; then
2411 add
="$libdir/$linklib"
2412 elif test "$hardcode_minus_L" = yes; then
2415 elif test "$hardcode_shlibpath_var" = yes; then
2416 case :$finalize_shlibpath: in
2418 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2421 elif test "$hardcode_automatic" = yes; then
2422 if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then
2423 add
="$inst_prefix_dir$libdir/$linklib"
2425 add
="$libdir/$linklib"
2428 # We cannot seem to hardcode it, guess we'll fake it.
2430 # Try looking first in the location we're being installed to.
2431 if test -n "$inst_prefix_dir"; then
2434 add_dir
="$add_dir -L$inst_prefix_dir$libdir"
2441 if test "$linkmode" = prog
; then
2442 test -n "$add_dir" && finalize_deplibs
="$add_dir $finalize_deplibs"
2443 test -n "$add" && finalize_deplibs
="$add $finalize_deplibs"
2445 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2446 test -n "$add" && deplibs
="$add $deplibs"
2449 elif test "$linkmode" = prog
; then
2450 # Here we assume that one of hardcode_direct or hardcode_minus_L
2451 # is not unsupported. This is valid on all known static and
2453 if test "$hardcode_direct" != unsupported
; then
2454 test -n "$old_library" && linklib
="$old_library"
2455 compile_deplibs
="$dir/$linklib $compile_deplibs"
2456 finalize_deplibs
="$dir/$linklib $finalize_deplibs"
2458 compile_deplibs
="-l$name -L$dir $compile_deplibs"
2459 finalize_deplibs
="-l$name -L$dir $finalize_deplibs"
2461 elif test "$build_libtool_libs" = yes; then
2462 # Not a shared library
2463 if test "$deplibs_check_method" != pass_all
; then
2464 # We're trying link a shared library against a static one
2465 # but the system doesn't support it.
2467 # Just print a warning and add the library to dependency_libs so
2468 # that the program can be linked against the static library.
2470 $echo "*** Warning: This system can not link to static lib archive $lib."
2471 $echo "*** I have the capability to make that library automatically link in when"
2472 $echo "*** you link to this library. But I can only do this if you have a"
2473 $echo "*** shared version of the library, which you do not appear to have."
2474 if test "$module" = yes; then
2475 $echo "*** But as you try to build a module library, libtool will still create "
2476 $echo "*** a static module, that should work as long as the dlopening application"
2477 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2478 if test -z "$global_symbol_pipe"; then
2480 $echo "*** However, this would only work if libtool was able to extract symbol"
2481 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2482 $echo "*** not find such a program. So, this module is probably useless."
2483 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2485 if test "$build_old_libs" = no
; then
2486 build_libtool_libs
=module
2489 build_libtool_libs
=no
2493 convenience
="$convenience $dir/$old_library"
2494 old_convenience
="$old_convenience $dir/$old_library"
2495 deplibs
="$dir/$old_library $deplibs"
2498 fi # link shared/static library?
2500 if test "$linkmode" = lib
; then
2501 if test -n "$dependency_libs" &&
2502 { test "$hardcode_into_libs" != yes ||
test "$build_old_libs" = yes ||
2503 test "$link_static" = yes; }; then
2504 # Extract -R from dependency_libs
2506 for libdir
in $dependency_libs; do
2508 -R*) temp_xrpath
=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2510 *" $temp_xrpath "*) ;;
2511 *) xrpath
="$xrpath $temp_xrpath";;
2513 *) temp_deplibs
="$temp_deplibs $libdir";;
2516 dependency_libs
="$temp_deplibs"
2519 newlib_search_path
="$newlib_search_path $absdir"
2520 # Link against this library
2521 test "$link_static" = no
&& newdependency_libs
="$abs_ladir/$laname $newdependency_libs"
2522 # ... and its dependency_libs
2524 for deplib
in $dependency_libs; do
2525 newdependency_libs
="$deplib $newdependency_libs"
2526 if test "X$duplicate_deps" = "Xyes" ; then
2527 case "$tmp_libs " in
2528 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2531 tmp_libs
="$tmp_libs $deplib"
2534 if test "$link_all_deplibs" != no
; then
2535 # Add the search paths of all dependency libraries
2536 for deplib
in $dependency_libs; do
2538 -L*) path
="$deplib" ;;
2540 dir
=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2541 test "X$dir" = "X$deplib" && dir
="."
2542 # We need an absolute path.
2544 [\\/]* |
[A-Za-z
]:[\\/]*) absdir
="$dir" ;;
2546 absdir
=`cd "$dir" && pwd`
2547 if test -z "$absdir"; then
2548 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2553 if grep "^installed=no" $deplib > /dev
/null
; then
2554 path
="$absdir/$objdir"
2556 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2557 if test -z "$libdir"; then
2558 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2561 if test "$absdir" != "$libdir"; then
2562 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2569 # we do not want to link against static libs, but need to link against shared
2570 eval deplibrary_names
=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2571 if test -n "$deplibrary_names" ; then
2572 for tmp
in $deplibrary_names ; do
2575 if test -f "$path/$depdepl" ; then
2576 depdepl
="$path/$depdepl"
2578 # do not add paths which are already there
2579 case " $newlib_search_path " in
2581 *) newlib_search_path
="$newlib_search_path $path";;
2595 # Again, we only want to link against shared libraries
2596 eval tmp_libs
=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2597 for tmp
in $newlib_search_path ; do
2598 if test -f "$tmp/lib$tmp_libs.dylib" ; then
2599 eval depdepl
="$tmp/lib$tmp_libs.dylib"
2610 case " $deplibs " in
2612 *) deplibs
="$deplibs $depdepl" ;;
2614 case " $deplibs " in
2616 *) deplibs
="$deplibs $path" ;;
2619 fi # link_all_deplibs != no
2621 done # for deplib in $libs
2622 dependency_libs
="$newdependency_libs"
2623 if test "$pass" = dlpreopen
; then
2624 # Link the dlpreopened libraries before other libraries
2625 for deplib
in $save_deplibs; do
2626 deplibs
="$deplib $deplibs"
2629 if test "$pass" != dlopen
; then
2630 if test "$pass" != conv
; then
2631 # Make sure lib_search_path contains only unique directories.
2633 for dir
in $newlib_search_path; do
2634 case "$lib_search_path " in
2636 *) lib_search_path
="$lib_search_path $dir" ;;
2642 if test "$linkmode,$pass" != "prog,link"; then
2645 vars
="compile_deplibs finalize_deplibs"
2647 for var
in $vars dependency_libs
; do
2648 # Add libraries to $var in reverse order
2649 eval tmp_libs
=\"\$
$var\"
2651 for deplib
in $tmp_libs; do
2652 # FIXME: Pedantically, this is the right thing to do, so
2653 # that some nasty dependency loop isn't accidentally
2655 #new_libs="$deplib $new_libs"
2656 # Pragmatically, this seems to cause very few problems in
2659 -L*) new_libs
="$deplib $new_libs" ;;
2662 # And here is the reason: when a library appears more
2663 # than once as an explicit dependence of a library, or
2664 # is implicitly linked in more than once by the
2665 # compiler, it is considered special, and multiple
2666 # occurrences thereof are not removed. Compare this
2667 # with having the same library being listed as a
2668 # dependency of multiple other libraries: in this case,
2669 # we know (pedantically, we assume) the library does not
2670 # need to be listed more than once, so we keep only the
2671 # last copy. This is not always right, but it is rare
2672 # enough that we require users that really mean to play
2673 # such unportable linking tricks to link the library
2674 # using -Wl,-lname, so that libtool does not consider it
2675 # for duplicate removal.
2676 case " $specialdeplibs " in
2677 *" $deplib "*) new_libs
="$deplib $new_libs" ;;
2679 case " $new_libs " in
2681 *) new_libs
="$deplib $new_libs" ;;
2689 for deplib
in $new_libs; do
2692 case " $tmp_libs " in
2694 *) tmp_libs
="$tmp_libs $deplib" ;;
2697 *) tmp_libs
="$tmp_libs $deplib" ;;
2700 eval $var=\"$tmp_libs\"
2703 # Last step: remove runtime libs from dependency_libs (they stay in deplibs)
2705 for i
in $dependency_libs ; do
2706 case " $predeps $postdeps $compiler_lib_search_path " in
2711 if test -n "$i" ; then
2712 tmp_libs
="$tmp_libs $i"
2715 dependency_libs
=$tmp_libs
2717 if test "$linkmode" = prog
; then
2718 dlfiles
="$newdlfiles"
2719 dlprefiles
="$newdlprefiles"
2724 if test -n "$deplibs"; then
2725 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2728 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
2729 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2732 if test -n "$rpath"; then
2733 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2736 if test -n "$xrpath"; then
2737 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2740 if test -n "$vinfo"; then
2741 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
2744 if test -n "$release"; then
2745 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2748 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
2749 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2752 # Now set the variables for building old libraries.
2753 build_libtool_libs
=no
2755 objs
="$objs$old_deplibs"
2759 # Make sure we only generate libraries of the form `libNAME.la'.
2762 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2763 eval shared_ext
=\"$shrext\"
2764 eval libname
=\"$libname_spec\"
2767 if test "$module" = no
; then
2768 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2772 if test "$need_lib_prefix" != no
; then
2773 # Add the "lib" prefix for modules if required
2774 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2775 eval shared_ext
=\"$shrext\"
2776 eval libname
=\"$libname_spec\"
2778 libname
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2783 if test -n "$objs"; then
2784 if test "$deplibs_check_method" != pass_all
; then
2785 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2789 $echo "*** Warning: Linking the shared library $output against the non-libtool"
2790 $echo "*** objects $objs is not portable!"
2791 libobjs
="$libobjs $objs"
2795 if test "$dlself" != no
; then
2796 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2800 if test "$#" -gt 2; then
2801 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2806 if test -z "$rpath"; then
2807 if test "$build_libtool_libs" = yes; then
2808 # Building a libtool convenience library.
2809 # Some compilers have problems with a `.al' extension so
2810 # convenience libraries should have the same extension an
2811 # archive normally would.
2812 oldlibs
="$output_objdir/$libname.$libext $oldlibs"
2813 build_libtool_libs
=convenience
2817 if test -n "$vinfo"; then
2818 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
2821 if test -n "$release"; then
2822 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2826 # Parse the version information argument.
2827 save_ifs
="$IFS"; IFS
=':'
2828 set dummy
$vinfo 0 0 0
2831 if test -n "$8"; then
2832 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2837 # convert absolute version numbers to libtool ages
2838 # this retains compatibility with .la files and attempts
2839 # to make the code below a bit more comprehensible
2841 case $vinfo_number in
2845 number_revision
="$4"
2847 # There are really only two kinds -- those that
2848 # use the current revision as the major version
2849 # and those that subtract age and use age as
2850 # a minor version. But, then there is irix
2851 # which has an extra 1 added just for fun
2853 case $version_type in
2854 darwin|linux|osf|windows
)
2855 current
=`expr $number_major + $number_minor`
2857 revision
="$number_revision"
2859 freebsd-aout|freebsd-elf|sunos
)
2860 current
="$number_major"
2861 revision
="$number_minor"
2865 current
=`expr $number_major + $number_minor - 1`
2867 revision
="$number_minor"
2878 # Check that each of the things are valid numbers.
2880 0 |
[1-9] |
[1-9][0-9] |
[1-9][0-9][0-9]) ;;
2882 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2883 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2889 0 |
[1-9] |
[1-9][0-9] |
[1-9][0-9][0-9]) ;;
2891 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2892 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2898 0 |
[1-9] |
[1-9][0-9] |
[1-9][0-9][0-9]) ;;
2900 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2901 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2906 if test "$age" -gt "$current"; then
2907 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2908 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2912 # Calculate the version variables.
2916 case $version_type in
2920 # Like Linux, but with the current version available in
2921 # verstring for coding it into the library header
2922 major
=.
`expr $current - $age`
2923 versuffix
="$major.$age.$revision"
2924 # Darwin ld doesn't like 0 for these options...
2925 minor_current
=`expr $current + 1`
2926 verstring
="-compatibility_version $minor_current -current_version $minor_current.$revision"
2931 versuffix
=".$current.$revision";
2936 versuffix
=".$current";
2940 major
=`expr $current - $age + 1`
2942 case $version_type in
2943 nonstopux
) verstring_prefix
=nonstopux
;;
2944 *) verstring_prefix
=sgi
;;
2946 verstring
="$verstring_prefix$major.$revision"
2948 # Add in all the interfaces that we are compatible with.
2950 while test "$loop" -ne 0; do
2951 iface
=`expr $revision - $loop`
2952 loop
=`expr $loop - 1`
2953 verstring
="$verstring_prefix$major.$iface:$verstring"
2956 # Before this point, $major must not contain `.'.
2958 versuffix
="$major.$revision"
2962 major
=.
`expr $current - $age`
2963 versuffix
="$major.$age.$revision"
2967 major
=.
`expr $current - $age`
2968 versuffix
=".$current.$age.$revision"
2969 verstring
="$current.$age.$revision"
2971 # Add in all the interfaces that we are compatible with.
2973 while test "$loop" -ne 0; do
2974 iface
=`expr $current - $loop`
2975 loop
=`expr $loop - 1`
2976 verstring
="$verstring:${iface}.0"
2979 # Make executables depend on our current version.
2980 verstring
="$verstring:${current}.0"
2985 versuffix
=".$current.$revision"
2989 # Use '-' rather than '.', since we only want one
2990 # extension on DOS 8.3 filesystems.
2991 major
=`expr $current - $age`
2996 $echo "$modename: unknown library version type \`$version_type'" 1>&2
2997 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3002 # Clear the version info if we defaulted, and they specified a release.
3003 if test -z "$vinfo" && test -n "$release"; then
3005 case $version_type in
3007 # we can't check for "0.0" in archive_cmds due to quoting
3008 # problems, so we reset it completely
3015 if test "$need_version" = no
; then
3022 # Remove version info from name if versioning should be avoided
3023 if test "$avoid_version" = yes && test "$need_version" = no
; then
3029 # Check to see if the archive will have undefined symbols.
3030 if test "$allow_undefined" = yes; then
3031 if test "$allow_undefined_flag" = unsupported
; then
3032 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3033 build_libtool_libs
=no
3037 # Don't allow undefined symbols.
3038 allow_undefined_flag
="$no_undefined_flag"
3042 if test "$mode" != relink
; then
3043 # Remove our outputs, but don't remove object files since they
3044 # may have been created when compiling PIC objects.
3046 tempremovelist
=`$echo "$output_objdir/*"`
3047 for p
in $tempremovelist; do
3051 $output_objdir/$outputname |
$output_objdir/$libname.
* |
$output_objdir/${libname}${release}.
*)
3052 removelist
="$removelist $p"
3057 if test -n "$removelist"; then
3058 $show "${rm}r $removelist"
3059 $run ${rm}r
$removelist
3063 # Now set the variables for building old libraries.
3064 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience
; then
3065 oldlibs
="$oldlibs $output_objdir/$libname.$libext"
3067 # Transform .lo files to .o files.
3068 oldobjs
="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3071 # Eliminate all temporary directories.
3072 for path
in $notinst_path; do
3073 lib_search_path
=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3074 deplibs
=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3075 dependency_libs
=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3078 if test -n "$xrpath"; then
3079 # If the user specified any rpath flags, then add them.
3081 for libdir
in $xrpath; do
3082 temp_xrpath
="$temp_xrpath -R$libdir"
3083 case "$finalize_rpath " in
3085 *) finalize_rpath
="$finalize_rpath $libdir" ;;
3088 if test "$hardcode_into_libs" != yes ||
test "$build_old_libs" = yes; then
3089 dependency_libs
="$temp_xrpath $dependency_libs"
3093 # Make sure dlfiles contains only unique files that won't be dlpreopened
3094 old_dlfiles
="$dlfiles"
3096 for lib
in $old_dlfiles; do
3097 case " $dlprefiles $dlfiles " in
3099 *) dlfiles
="$dlfiles $lib" ;;
3103 # Make sure dlprefiles contains only unique files
3104 old_dlprefiles
="$dlprefiles"
3106 for lib
in $old_dlprefiles; do
3107 case "$dlprefiles " in
3109 *) dlprefiles
="$dlprefiles $lib" ;;
3113 if test "$build_libtool_libs" = yes; then
3114 if test -n "$rpath"; then
3116 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2* |
*-*-beos*)
3117 # these systems don't actually have a c library (as such)!
3119 *-*-rhapsody* |
*-*-darwin1.
[012])
3120 # Rhapsody C library is in the System framework
3121 deplibs
="$deplibs -framework System"
3124 # Don't link with libc until the a.out ld.so is fixed.
3126 *-*-openbsd* |
*-*-freebsd*)
3127 # Do not include libc due to us having libc/libc_r.
3128 test "X$arg" = "X-lc" && continue
3131 # Add libc to deplibs on all other systems if necessary.
3132 if test "$build_libtool_need_lc" = "yes"; then
3133 deplibs
="$deplibs -lc"
3139 # Transform deplibs into only deplibs that can be linked in shared.
3141 libname_save
=$libname
3142 release_save
=$release
3143 versuffix_save
=$versuffix
3145 # I'm not sure if I'm treating the release correctly. I think
3146 # release should show up in the -l (ie -lgmp5) so we don't want to
3147 # add it in twice. Is that correct?
3153 case $deplibs_check_method in
3155 # Don't check for shared/static. Everything works.
3156 # This might be a little naive. We might want to check
3157 # whether the library exists or not. But this is on
3158 # osf3 & osf4 and I'm not really sure... Just
3159 # implementing what was already the behavior.
3163 # This code stresses the "libraries are programs" paradigm to its
3164 # limits. Maybe even breaks it. We compile a program, linking it
3165 # against the deplibs as a proxy for the library. Then we can check
3166 # whether they linked in statically or dynamically with ldd.
3168 cat > conftest.c
<<EOF
3169 int main() { return 0; }
3172 $LTCC -o conftest conftest.c
$deplibs
3173 if test "$?" -eq 0 ; then
3174 ldd_output
=`ldd conftest`
3175 for i
in $deplibs; do
3176 name
="`expr $i : '-l\(.*\)'`"
3177 # If $name is empty we are operating on a -L argument.
3178 if test "$name" != "" && test "$name" -ne "0"; then
3179 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3180 case " $predeps $postdeps " in
3182 newdeplibs
="$newdeplibs $i"
3187 if test -n "$i" ; then
3188 libname
=`eval \\$echo \"$libname_spec\"`
3189 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
3190 set dummy
$deplib_matches
3192 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3193 newdeplibs
="$newdeplibs $i"
3197 $echo "*** Warning: dynamic linker does not accept needed library $i."
3198 $echo "*** I have the capability to make that library automatically link in when"
3199 $echo "*** you link to this library. But I can only do this if you have a"
3200 $echo "*** shared version of the library, which I believe you do not have"
3201 $echo "*** because a test_compile did reveal that the linker did not use it for"
3202 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3206 newdeplibs
="$newdeplibs $i"
3210 # Error occurred in the first compile. Let's try to salvage
3211 # the situation: Compile a separate program for each library.
3212 for i
in $deplibs; do
3213 name
="`expr $i : '-l\(.*\)'`"
3214 # If $name is empty we are operating on a -L argument.
3215 if test "$name" != "" && test "$name" != "0"; then
3217 $LTCC -o conftest conftest.c
$i
3219 if test "$?" -eq 0 ; then
3220 ldd_output
=`ldd conftest`
3221 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3222 case " $predeps $postdeps " in
3224 newdeplibs
="$newdeplibs $i"
3229 if test -n "$i" ; then
3230 libname
=`eval \\$echo \"$libname_spec\"`
3231 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
3232 set dummy
$deplib_matches
3234 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3235 newdeplibs
="$newdeplibs $i"
3239 $echo "*** Warning: dynamic linker does not accept needed library $i."
3240 $echo "*** I have the capability to make that library automatically link in when"
3241 $echo "*** you link to this library. But I can only do this if you have a"
3242 $echo "*** shared version of the library, which you do not appear to have"
3243 $echo "*** because a test_compile did reveal that the linker did not use this one"
3244 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3250 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3251 $echo "*** make it link in! You will probably need to install it or some"
3252 $echo "*** library that it depends on before this library will be fully"
3253 $echo "*** functional. Installing it before continuing would be even better."
3256 newdeplibs
="$newdeplibs $i"
3262 set dummy
$deplibs_check_method
3263 file_magic_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3264 for a_deplib
in $deplibs; do
3265 name
="`expr $a_deplib : '-l\(.*\)'`"
3266 # If $name is empty we are operating on a -L argument.
3267 if test "$name" != "" && test "$name" != "0"; then
3268 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3269 case " $predeps $postdeps " in
3271 newdeplibs
="$newdeplibs $a_deplib"
3276 if test -n "$a_deplib" ; then
3277 libname
=`eval \\$echo \"$libname_spec\"`
3278 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3279 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
3280 for potent_lib
in $potential_libs; do
3281 # Follow soft links.
3282 if ls -lLd "$potent_lib" 2>/dev
/null \
3283 |
grep " -> " >/dev
/null
; then
3286 # The statement above tries to avoid entering an
3287 # endless loop below, in case of cyclic links.
3288 # We might still enter an endless loop, since a link
3289 # loop can be closed while we follow links,
3291 potlib
="$potent_lib"
3292 while test -h "$potlib" 2>/dev
/null
; do
3293 potliblink
=`ls -ld $potlib | ${SED} 's/.* -> //'`
3295 [\\/]* |
[A-Za-z
]:[\\/]*) potlib
="$potliblink";;
3296 *) potlib
=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3299 if eval $file_magic_cmd \"\
$potlib\" 2>/dev
/null \
3301 |
$EGREP "$file_magic_regex" > /dev
/null
; then
3302 newdeplibs
="$newdeplibs $a_deplib"
3309 if test -n "$a_deplib" ; then
3312 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3313 $echo "*** I have the capability to make that library automatically link in when"
3314 $echo "*** you link to this library. But I can only do this if you have a"
3315 $echo "*** shared version of the library, which you do not appear to have"
3316 $echo "*** because I did check the linker path looking for a file starting"
3317 if test -z "$potlib" ; then
3318 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3320 $echo "*** with $libname and none of the candidates passed a file format test"
3321 $echo "*** using a file magic. Last file checked: $potlib"
3325 # Add a -L argument.
3326 newdeplibs
="$newdeplibs $a_deplib"
3328 done # Gone through all deplibs.
3331 set dummy
$deplibs_check_method
3332 match_pattern_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3333 for a_deplib
in $deplibs; do
3334 name
="`expr $a_deplib : '-l\(.*\)'`"
3335 # If $name is empty we are operating on a -L argument.
3336 if test -n "$name" && test "$name" != "0"; then
3337 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3338 case " $predeps $postdeps " in
3340 newdeplibs
="$newdeplibs $a_deplib"
3345 if test -n "$a_deplib" ; then
3346 libname
=`eval \\$echo \"$libname_spec\"`
3347 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3348 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
3349 for potent_lib
in $potential_libs; do
3350 potlib
="$potent_lib" # see symlink-check above in file_magic test
3351 if eval $echo \"$potent_lib\" 2>/dev
/null \
3353 |
$EGREP "$match_pattern_regex" > /dev
/null
; then
3354 newdeplibs
="$newdeplibs $a_deplib"
3361 if test -n "$a_deplib" ; then
3364 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3365 $echo "*** I have the capability to make that library automatically link in when"
3366 $echo "*** you link to this library. But I can only do this if you have a"
3367 $echo "*** shared version of the library, which you do not appear to have"
3368 $echo "*** because I did check the linker path looking for a file starting"
3369 if test -z "$potlib" ; then
3370 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3372 $echo "*** with $libname and none of the candidates passed a file format test"
3373 $echo "*** using a regex pattern. Last file checked: $potlib"
3377 # Add a -L argument.
3378 newdeplibs
="$newdeplibs $a_deplib"
3380 done # Gone through all deplibs.
3384 tmp_deplibs
=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3385 -e 's/ -[LR][^ ]*//g'`
3386 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3387 for i
in $predeps $postdeps ; do
3388 # can't use Xsed below, because $i might contain '/'
3389 tmp_deplibs
=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3392 if $echo "X $tmp_deplibs" |
$Xsed -e 's/[ ]//g' \
3393 |
grep .
>/dev
/null
; then
3395 if test "X$deplibs_check_method" = "Xnone"; then
3396 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3398 $echo "*** Warning: inter-library dependencies are not known to be supported."
3400 $echo "*** All declared inter-library dependencies are being dropped."
3405 versuffix
=$versuffix_save
3407 release
=$release_save
3408 libname
=$libname_save
3412 *-*-rhapsody* |
*-*-darwin1.
[012])
3413 # On Rhapsody replace the C library is the System framework
3414 newdeplibs
=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3418 if test "$droppeddeps" = yes; then
3419 if test "$module" = yes; then
3421 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3422 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3423 $echo "*** a static module, that should work as long as the dlopening"
3424 $echo "*** application is linked with the -dlopen flag."
3425 if test -z "$global_symbol_pipe"; then
3427 $echo "*** However, this would only work if libtool was able to extract symbol"
3428 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3429 $echo "*** not find such a program. So, this module is probably useless."
3430 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3432 if test "$build_old_libs" = no
; then
3433 oldlibs
="$output_objdir/$libname.$libext"
3434 build_libtool_libs
=module
3437 build_libtool_libs
=no
3440 $echo "*** The inter-library dependencies that have been dropped here will be"
3441 $echo "*** automatically added whenever a program is linked with this library"
3442 $echo "*** or is declared to -dlopen it."
3444 if test "$allow_undefined" = no
; then
3446 $echo "*** Since this library must not contain undefined symbols,"
3447 $echo "*** because either the platform does not support them or"
3448 $echo "*** it was explicitly requested with -no-undefined,"
3449 $echo "*** libtool will only create a static version of it."
3450 if test "$build_old_libs" = no
; then
3451 oldlibs
="$output_objdir/$libname.$libext"
3452 build_libtool_libs
=module
3455 build_libtool_libs
=no
3460 # Done checking deplibs!
3464 # All the library-specific variables (install_libdir is set above).
3469 # Test again, we may have decided not to build it any more
3470 if test "$build_libtool_libs" = yes; then
3471 if test "$hardcode_into_libs" = yes; then
3472 # Hardcode the library paths
3475 rpath
="$finalize_rpath"
3476 test "$mode" != relink
&& rpath
="$compile_rpath$rpath"
3477 for libdir
in $rpath; do
3478 if test -n "$hardcode_libdir_flag_spec"; then
3479 if test -n "$hardcode_libdir_separator"; then
3480 if test -z "$hardcode_libdirs"; then
3481 hardcode_libdirs
="$libdir"
3483 # Just accumulate the unique libdirs.
3484 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3485 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3488 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3493 eval flag
=\"$hardcode_libdir_flag_spec\"
3494 dep_rpath
="$dep_rpath $flag"
3496 elif test -n "$runpath_var"; then
3497 case "$perm_rpath " in
3499 *) perm_rpath
="$perm_rpath $libdir" ;;
3503 # Substitute the hardcoded libdirs into the rpath.
3504 if test -n "$hardcode_libdir_separator" &&
3505 test -n "$hardcode_libdirs"; then
3506 libdir
="$hardcode_libdirs"
3507 if test -n "$hardcode_libdir_flag_spec_ld"; then
3508 eval dep_rpath
=\"$hardcode_libdir_flag_spec_ld\"
3510 eval dep_rpath
=\"$hardcode_libdir_flag_spec\"
3513 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3514 # We should set the runpath_var.
3516 for dir
in $perm_rpath; do
3519 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3521 test -n "$dep_rpath" && deplibs
="$dep_rpath $deplibs"
3524 shlibpath
="$finalize_shlibpath"
3525 test "$mode" != relink
&& shlibpath
="$compile_shlibpath$shlibpath"
3526 if test -n "$shlibpath"; then
3527 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3530 # Get the real and link names of the library.
3531 eval shared_ext
=\"$shrext\"
3532 eval library_names
=\"$library_names_spec\"
3533 set dummy
$library_names
3537 if test -n "$soname_spec"; then
3538 eval soname
=\"$soname_spec\"
3542 if test -z "$dlname"; then
3546 lib
="$output_objdir/$realname"
3549 linknames
="$linknames $link"
3552 # Use standard objects if they are pic
3553 test -z "$pic_flag" && libobjs
=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3555 # Prepare the list of exported symbols
3556 if test -z "$export_symbols"; then
3557 if test "$always_export_symbols" = yes ||
test -n "$export_symbols_regex"; then
3558 $show "generating symbol list for \`$libname.la'"
3559 export_symbols
="$output_objdir/$libname.exp"
3560 $run $rm $export_symbols
3561 eval cmds
=\"$export_symbols_cmds\"
3562 save_ifs
="$IFS"; IFS
='~'
3563 for cmd
in $cmds; do
3565 if len
=`expr "X$cmd" : ".*"` &&
3566 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
3568 $run eval "$cmd" ||
exit $?
3569 skipped_export
=false
3571 # The command line is too long to execute in one step.
3572 $show "using reloadable object file for export list..."
3577 if test -n "$export_symbols_regex"; then
3578 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3579 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3580 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3581 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3586 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3587 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3591 for test_deplib
in $deplibs; do
3592 case " $convenience " in
3593 *" $test_deplib "*) ;;
3595 tmp_deplibs
="$tmp_deplibs $test_deplib"
3599 deplibs
="$tmp_deplibs"
3601 if test -n "$convenience"; then
3602 if test -n "$whole_archive_flag_spec"; then
3603 save_libobjs
=$libobjs
3604 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
3606 gentop
="$output_objdir/${outputname}x"
3607 $show "${rm}r $gentop"
3608 $run ${rm}r
"$gentop"
3609 $show "$mkdir $gentop"
3610 $run $mkdir "$gentop"
3612 if test "$status" -ne 0 && test ! -d "$gentop"; then
3615 generated
="$generated $gentop"
3617 for xlib
in $convenience; do
3618 # Extract the objects.
3620 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
3621 *) xabs
=`pwd`"/$xlib" ;;
3623 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3624 xdir
="$gentop/$xlib"
3626 $show "${rm}r $xdir"
3628 $show "$mkdir $xdir"
3631 if test "$status" -ne 0 && test ! -d "$xdir"; then
3634 # We will extract separately just the conflicting names and we will no
3635 # longer touch any unique names. It is faster to leave these extract
3636 # automatically by $AR in one run.
3637 $show "(cd $xdir && $AR x $xabs)"
3638 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
3639 if ($AR t
"$xabs" |
sort |
sort -uc >/dev
/null
2>&1); then
3642 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3643 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3644 $AR t
"$xabs" |
sort |
uniq -cd |
while read -r count name
3647 while test "$i" -le "$count"
3649 # Put our $i before any first dot (extension)
3650 # Never overwrite any file
3652 while test "X$name_to" = "X$name" ||
test -f "$xdir/$name_to"
3654 name_to
=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3656 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3657 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" ||
exit $?
3663 libobjs
="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3668 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3669 eval flag
=\"$thread_safe_flag_spec\"
3670 linker_flags
="$linker_flags $flag"
3673 # Make a backup of the uninstalled library when relinking
3674 if test "$mode" = relink
; then
3675 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' ||
exit $?
3678 # Do each of the archive commands.
3679 if test "$module" = yes && test -n "$module_cmds" ; then
3680 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3681 eval cmds
=\"$module_expsym_cmds\"
3683 eval cmds
=\"$module_cmds\"
3686 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3687 eval cmds
=\"$archive_expsym_cmds\"
3689 eval cmds
=\"$archive_cmds\"
3693 if test "X$skipped_export" != "X:" && len
=`expr "X$cmds" : ".*"` &&
3694 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
3697 # The command line is too long to link in one step, link piecewise.
3698 $echo "creating reloadable object files..."
3700 # Save the value of $output and $libobjs because we want to
3701 # use them later. If we have whole_archive_flag_spec, we
3702 # want to use save_libobjs as it was before
3703 # whole_archive_flag_spec was expanded, because we can't
3704 # assume the linker understands whole_archive_flag_spec.
3705 # This may have to be revisited, in case too many
3706 # convenience libraries get linked in and end up exceeding
3708 if test -z "$convenience" ||
test -z "$whole_archive_flag_spec"; then
3709 save_libobjs
=$libobjs
3713 # Clear the reloadable object creation command queue and
3714 # initialize k to one.
3721 output
=$output_objdir/$save_output-${k}.
$objext
3722 # Loop over the list of objects to be linked.
3723 for obj
in $save_libobjs
3725 eval test_cmds
=\"$reload_cmds $objlist $last_robj\"
3726 if test "X$objlist" = X ||
3727 { len
=`expr "X$test_cmds" : ".*"` &&
3728 test "$len" -le "$max_cmd_len"; }; then
3729 objlist
="$objlist $obj"
3731 # The command $test_cmds is almost too long, add a
3732 # command to the queue.
3733 if test "$k" -eq 1 ; then
3734 # The first file doesn't have a previous command to add.
3735 eval concat_cmds
=\"$reload_cmds $objlist $last_robj\"
3737 # All subsequent reloadable object files will link in
3738 # the last one created.
3739 eval concat_cmds
=\"\
$concat_cmds~
$reload_cmds $objlist $last_robj\"
3741 last_robj
=$output_objdir/$save_output-${k}.
$objext
3743 output
=$output_objdir/$save_output-${k}.
$objext
3748 # Handle the remaining objects by creating one last
3749 # reloadable object file. All subsequent reloadable object
3750 # files will link in the last one created.
3751 test -z "$concat_cmds" || concat_cmds
=$concat_cmds~
3752 eval concat_cmds
=\"\
${concat_cmds}$reload_cmds $objlist $last_robj\"
3754 if ${skipped_export-false}; then
3755 $show "generating symbol list for \`$libname.la'"
3756 export_symbols
="$output_objdir/$libname.exp"
3757 $run $rm $export_symbols
3759 # Append the command to create the export file.
3760 eval concat_cmds
=\"\
$concat_cmds~
$export_symbols_cmds\"
3763 # Set up a command to remove the reloadale object files
3764 # after they are used.
3766 while test "$i" -lt "$k"
3769 delfiles
="$delfiles $output_objdir/$save_output-${i}.$objext"
3772 $echo "creating a temporary reloadable object file: $output"
3774 # Loop through the commands generated above and execute them.
3775 save_ifs
="$IFS"; IFS
='~'
3776 for cmd
in $concat_cmds; do
3779 $run eval "$cmd" ||
exit $?
3784 # Restore the value of output.
3787 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3788 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
3790 # Expand the library linking commands again to reset the
3791 # value of $libobjs for piecewise linking.
3793 # Do each of the archive commands.
3794 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3795 eval cmds
=\"$archive_expsym_cmds\"
3797 eval cmds
=\"$archive_cmds\"
3800 # Append the command to remove the reloadable object files
3801 # to the just-reset $cmds.
3802 eval cmds
=\"\
$cmds~
$rm $delfiles\"
3804 save_ifs
="$IFS"; IFS
='~'
3805 for cmd
in $cmds; do
3808 $run eval "$cmd" ||
exit $?
3812 # Restore the uninstalled library and exit
3813 if test "$mode" = relink
; then
3814 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' ||
exit $?
3818 # Create links to the real library.
3819 for linkname
in $linknames; do
3820 if test "$realname" != "$linkname"; then
3821 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3822 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' ||
exit $?
3826 # If -module or -export-dynamic was specified, set the dlname.
3827 if test "$module" = yes ||
test "$export_dynamic" = yes; then
3828 # On all known operating systems, these are identical.
3835 if test -n "$deplibs"; then
3836 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3839 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
3840 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3843 if test -n "$rpath"; then
3844 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3847 if test -n "$xrpath"; then
3848 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3851 if test -n "$vinfo"; then
3852 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3855 if test -n "$release"; then
3856 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3861 if test -n "$objs$old_deplibs"; then
3862 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3866 obj
=`$echo "X$output" | $Xsed -e "$lo2o"`
3874 # Delete the old objects.
3875 $run $rm $obj $libobj
3877 # Objects from convenience libraries. This assumes
3878 # single-version convenience libraries. Whenever we create
3879 # different ones for PIC/non-PIC, this we'll have to duplicate
3883 # reload_cmds runs $LD directly, so let us get rid of
3884 # -Wl from whole_archive_flag_spec
3887 if test -n "$convenience"; then
3888 if test -n "$whole_archive_flag_spec"; then
3889 eval reload_conv_objs
=\"\
$reload_objs $whole_archive_flag_spec\"
3891 gentop
="$output_objdir/${obj}x"
3892 $show "${rm}r $gentop"
3893 $run ${rm}r
"$gentop"
3894 $show "$mkdir $gentop"
3895 $run $mkdir "$gentop"
3897 if test "$status" -ne 0 && test ! -d "$gentop"; then
3900 generated
="$generated $gentop"
3902 for xlib
in $convenience; do
3903 # Extract the objects.
3905 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
3906 *) xabs
=`pwd`"/$xlib" ;;
3908 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3909 xdir
="$gentop/$xlib"
3911 $show "${rm}r $xdir"
3913 $show "$mkdir $xdir"
3916 if test "$status" -ne 0 && test ! -d "$xdir"; then
3919 # We will extract separately just the conflicting names and we will no
3920 # longer touch any unique names. It is faster to leave these extract
3921 # automatically by $AR in one run.
3922 $show "(cd $xdir && $AR x $xabs)"
3923 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
3924 if ($AR t
"$xabs" |
sort |
sort -uc >/dev
/null
2>&1); then
3927 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3928 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3929 $AR t
"$xabs" |
sort |
uniq -cd |
while read -r count name
3932 while test "$i" -le "$count"
3934 # Put our $i before any first dot (extension)
3935 # Never overwrite any file
3937 while test "X$name_to" = "X$name" ||
test -f "$xdir/$name_to"
3939 name_to
=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3941 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3942 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" ||
exit $?
3948 reload_conv_objs
="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3953 # Create the old-style object.
3954 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
3957 eval cmds
=\"$reload_cmds\"
3958 save_ifs
="$IFS"; IFS
='~'
3959 for cmd
in $cmds; do
3962 $run eval "$cmd" ||
exit $?
3966 # Exit if we aren't doing a library object file.
3967 if test -z "$libobj"; then
3968 if test -n "$gentop"; then
3969 $show "${rm}r $gentop"
3976 if test "$build_libtool_libs" != yes; then
3977 if test -n "$gentop"; then
3978 $show "${rm}r $gentop"
3982 # Create an invalid libtool object if no PIC, so that we don't
3983 # accidentally link it into a program.
3984 # $show "echo timestamp > $libobj"
3985 # $run eval "echo timestamp > $libobj" || exit $?
3989 if test -n "$pic_flag" ||
test "$pic_mode" != default
; then
3990 # Only do commands if we really have different PIC objects.
3991 reload_objs
="$libobjs $reload_conv_objs"
3993 eval cmds
=\"$reload_cmds\"
3994 save_ifs
="$IFS"; IFS
='~'
3995 for cmd
in $cmds; do
3998 $run eval "$cmd" ||
exit $?
4003 if test -n "$gentop"; then
4004 $show "${rm}r $gentop"
4013 *cygwin
*) output
=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4015 if test -n "$vinfo"; then
4016 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4019 if test -n "$release"; then
4020 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4023 if test "$preload" = yes; then
4024 if test "$dlopen_support" = unknown
&& test "$dlopen_self" = unknown
&&
4025 test "$dlopen_self_static" = unknown
; then
4026 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4031 *-*-rhapsody* |
*-*-darwin1.
[012])
4032 # On Rhapsody replace the C library is the System framework
4033 compile_deplibs
=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4034 finalize_deplibs
=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4040 # Don't allow lazy linking, it breaks C++ global constructors
4041 if test "$tagname" = CXX
; then
4042 compile_command
="$compile_command ${wl}-bind_at_load"
4043 finalize_command
="$finalize_command ${wl}-bind_at_load"
4048 compile_command
="$compile_command $compile_deplibs"
4049 finalize_command
="$finalize_command $finalize_deplibs"
4051 if test -n "$rpath$xrpath"; then
4052 # If the user specified any rpath flags, then add them.
4053 for libdir
in $rpath $xrpath; do
4054 # This is the magic to use -rpath.
4055 case "$finalize_rpath " in
4057 *) finalize_rpath
="$finalize_rpath $libdir" ;;
4062 # Now hardcode the library paths
4065 for libdir
in $compile_rpath $finalize_rpath; do
4066 if test -n "$hardcode_libdir_flag_spec"; then
4067 if test -n "$hardcode_libdir_separator"; then
4068 if test -z "$hardcode_libdirs"; then
4069 hardcode_libdirs
="$libdir"
4071 # Just accumulate the unique libdirs.
4072 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4073 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4076 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4081 eval flag
=\"$hardcode_libdir_flag_spec\"
4082 rpath
="$rpath $flag"
4084 elif test -n "$runpath_var"; then
4085 case "$perm_rpath " in
4087 *) perm_rpath
="$perm_rpath $libdir" ;;
4091 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
4092 case :$dllsearchpath: in
4094 *) dllsearchpath
="$dllsearchpath:$libdir";;
4099 # Substitute the hardcoded libdirs into the rpath.
4100 if test -n "$hardcode_libdir_separator" &&
4101 test -n "$hardcode_libdirs"; then
4102 libdir
="$hardcode_libdirs"
4103 eval rpath
=\" $hardcode_libdir_flag_spec\"
4105 compile_rpath
="$rpath"
4109 for libdir
in $finalize_rpath; do
4110 if test -n "$hardcode_libdir_flag_spec"; then
4111 if test -n "$hardcode_libdir_separator"; then
4112 if test -z "$hardcode_libdirs"; then
4113 hardcode_libdirs
="$libdir"
4115 # Just accumulate the unique libdirs.
4116 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4117 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4120 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4125 eval flag
=\"$hardcode_libdir_flag_spec\"
4126 rpath
="$rpath $flag"
4128 elif test -n "$runpath_var"; then
4129 case "$finalize_perm_rpath " in
4131 *) finalize_perm_rpath
="$finalize_perm_rpath $libdir" ;;
4135 # Substitute the hardcoded libdirs into the rpath.
4136 if test -n "$hardcode_libdir_separator" &&
4137 test -n "$hardcode_libdirs"; then
4138 libdir
="$hardcode_libdirs"
4139 eval rpath
=\" $hardcode_libdir_flag_spec\"
4141 finalize_rpath
="$rpath"
4143 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4144 # Transform all the library objects into standard objects.
4145 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4146 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4150 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
4151 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4152 dlsyms
="${outputname}S.c"
4154 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4158 if test -n "$dlsyms"; then
4162 # Discover the nlist of each of the dlfiles.
4163 nlist
="$output_objdir/${outputname}.nm"
4165 $show "$rm $nlist ${nlist}S ${nlist}T"
4166 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4168 # Parse the name list into a source file.
4169 $show "creating $output_objdir/$dlsyms"
4171 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4172 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4173 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4179 /* Prevent the only kind of declaration conflicts we can make. */
4180 #define lt_preloaded_symbols some_other_symbol
4182 /* External symbol declarations for the compiler. */\
4185 if test "$dlself" = yes; then
4186 $show "generating symbol list for \`$output'"
4188 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4190 # Add our own program objects to the symbol list.
4191 progfiles
=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4192 for arg
in $progfiles; do
4193 $show "extracting global C symbols from \`$arg'"
4194 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4197 if test -n "$exclude_expsyms"; then
4198 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4199 $run eval '$mv "$nlist"T "$nlist"'
4202 if test -n "$export_symbols_regex"; then
4203 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4204 $run eval '$mv "$nlist"T "$nlist"'
4207 # Prepare the list of exported symbols
4208 if test -z "$export_symbols"; then
4209 export_symbols
="$output_objdir/$output.exp"
4210 $run $rm $export_symbols
4211 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4213 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
4214 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
4215 $run eval 'mv "$nlist"T "$nlist"'
4219 for arg
in $dlprefiles; do
4220 $show "extracting global C symbols from \`$arg'"
4221 name
=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4222 $run eval '$echo ": $name " >> "$nlist"'
4223 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4226 if test -z "$run"; then
4227 # Make sure we have at least an empty file.
4228 test -f "$nlist" ||
: > "$nlist"
4230 if test -n "$exclude_expsyms"; then
4231 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4232 $mv "$nlist"T
"$nlist"
4235 # Try sorting and uniquifying the output.
4236 if grep -v "^: " < "$nlist" |
4237 if sort -k 3 </dev
/null
>/dev
/null
2>&1; then
4242 uniq > "$nlist"S
; then
4245 grep -v "^: " < "$nlist" > "$nlist"S
4248 if test -f "$nlist"S
; then
4249 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4251 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4254 $echo >> "$output_objdir/$dlsyms" "\
4256 #undef lt_preloaded_symbols
4258 #if defined (__STDC__) && __STDC__
4259 # define lt_ptr void *
4261 # define lt_ptr char *
4265 /* The mapping between symbol names and symbols. */
4270 lt_preloaded_symbols[] =
4274 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4276 $echo >> "$output_objdir/$dlsyms" "\
4280 /* This works around a problem in FreeBSD linker */
4281 #ifdef FREEBSD_WORKAROUND
4282 static const void *lt_preloaded_setup() {
4283 return lt_preloaded_symbols;
4293 pic_flag_for_symtable
=
4295 # compiling the symbol table file with pic_flag works around
4296 # a FreeBSD bug that causes programs to crash when -lm is
4297 # linked before any other PIC object. But we must not use
4298 # pic_flag when linking with -static. The problem exists in
4299 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4300 *-*-freebsd2*|
*-*-freebsd3.0
*|
*-*-freebsdelf3.0
*)
4301 case "$compile_command " in
4303 *) pic_flag_for_symtable
=" $pic_flag -DFREEBSD_WORKAROUND";;
4306 case "$compile_command " in
4308 *) pic_flag_for_symtable
=" $pic_flag";;
4312 # Now compile the dynamic symbol file.
4313 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4314 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' ||
exit $?
4316 # Clean up the generated files.
4317 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4318 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4320 # Transform the symbol file into the correct name.
4321 compile_command
=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4322 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4325 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4330 # We keep going just in case the user didn't refer to
4331 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4332 # really was required.
4334 # Nullify the symbol file.
4335 compile_command
=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4336 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4339 if test "$need_relink" = no ||
test "$build_libtool_libs" != yes; then
4340 # Replace the output file specification.
4341 compile_command
=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4342 link_command
="$compile_command$compile_rpath"
4344 # We have no uninstalled library dependencies, so finalize right now.
4345 $show "$link_command"
4346 $run eval "$link_command"
4349 # Delete the generated files.
4350 if test -n "$dlsyms"; then
4351 $show "$rm $output_objdir/${outputname}S.${objext}"
4352 $run $rm "$output_objdir/${outputname}S.${objext}"
4358 if test -n "$shlibpath_var"; then
4359 # We should set the shlibpath_var
4361 for dir
in $temp_rpath; do
4363 [\\/]* |
[A-Za-z
]:[\\/]*)
4368 # Relative path: add a thisdir entry.
4369 rpath
="$rpath\$thisdir/$dir:"
4376 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4377 compile_command
="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4379 if test -n "$finalize_shlibpath"; then
4380 finalize_command
="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4385 if test -n "$runpath_var"; then
4386 if test -n "$perm_rpath"; then
4387 # We should set the runpath_var.
4389 for dir
in $perm_rpath; do
4392 compile_var
="$runpath_var=\"$rpath\$$runpath_var\" "
4394 if test -n "$finalize_perm_rpath"; then
4395 # We should set the runpath_var.
4397 for dir
in $finalize_perm_rpath; do
4400 finalize_var
="$runpath_var=\"$rpath\$$runpath_var\" "
4404 if test "$no_install" = yes; then
4405 # We don't need to create a wrapper script.
4406 link_command
="$compile_var$compile_command$compile_rpath"
4407 # Replace the output file specification.
4408 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4409 # Delete the old output file.
4411 # Link the executable and exit
4412 $show "$link_command"
4413 $run eval "$link_command" ||
exit $?
4417 if test "$hardcode_action" = relink
; then
4418 # Fast installation is not supported
4419 link_command
="$compile_var$compile_command$compile_rpath"
4420 relink_command
="$finalize_var$finalize_command$finalize_rpath"
4422 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4423 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4425 if test "$fast_install" != no
; then
4426 link_command
="$finalize_var$compile_command$finalize_rpath"
4427 if test "$fast_install" = yes; then
4428 relink_command
=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4430 # fast_install is set to needless
4434 link_command
="$compile_var$compile_command$compile_rpath"
4435 relink_command
="$finalize_var$finalize_command$finalize_rpath"
4439 # Replace the output file specification.
4440 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4442 # Delete the old output files.
4443 $run $rm $output $output_objdir/$outputname $output_objdir/lt-
$outputname
4445 $show "$link_command"
4446 $run eval "$link_command" ||
exit $?
4448 # Now create the wrapper script.
4449 $show "creating $output"
4451 # Quote the relink command for shipping.
4452 if test -n "$relink_command"; then
4453 # Preserve any variables that may affect compiler behavior
4454 for var
in $variables_saved_for_relink; do
4455 if eval test -z \"\
${$var+set}\"; then
4456 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4457 elif eval var_value
=\$
$var; test -z "$var_value"; then
4458 relink_command
="$var=; export $var; $relink_command"
4460 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4461 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
4464 relink_command
="(cd `pwd`; $relink_command)"
4465 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4468 # Quote $echo for shipping.
4469 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
4471 [\\/]* |
[A-Za-z
]:[\\/]*) qecho
="$SHELL $0 --fallback-echo";;
4472 *) qecho
="$SHELL `pwd`/$0 --fallback-echo";;
4474 qecho
=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4476 qecho
=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4479 # Only actually do things if our run command is non-null.
4480 if test -z "$run"; then
4481 # win32 will think the script is a binary if it has
4482 # a .exe suffix, so we strip it off here.
4484 *.exe
) output
=`$echo $output|${SED} 's,.exe$,,'` ;;
4486 # test for cygwin because mv fails w/o .exe extensions
4490 outputname
=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4494 *cygwin
* |
*mingw
* )
4495 cwrappersource
=`$echo ${objdir}/lt-${output}.c`
4496 cwrapper
=`$echo ${output}.exe`
4497 $rm $cwrappersource $cwrapper
4498 trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
4500 cat > $cwrappersource <<EOF
4502 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4503 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4505 The $output program cannot be directly executed until all the libtool
4506 libraries that it depends on are installed.
4508 This wrapper executable should never be moved out of the build directory.
4509 If it is, it will not operate correctly.
4511 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4512 but could eventually absorb all of the scripts functionality and
4513 exec $objdir/$outputname directly.
4516 cat >> $cwrappersource<<"EOF"
4524 #if defined(PATH_MAX)
4525 # define LT_PATHMAX PATH_MAX
4526 #elif defined(MAXPATHLEN)
4527 # define LT_PATHMAX MAXPATHLEN
4529 # define LT_PATHMAX 1024
4532 #ifndef DIR_SEPARATOR
4533 #define DIR_SEPARATOR '/'
4536 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4538 #define HAVE_DOS_BASED_FILE_SYSTEM
4539 #ifndef DIR_SEPARATOR_2
4540 #define DIR_SEPARATOR_2 '\\'
4544 #ifndef DIR_SEPARATOR_2
4545 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4546 #else /* DIR_SEPARATOR_2 */
4547 # define IS_DIR_SEPARATOR(ch) \
4548 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4549 #endif /* DIR_SEPARATOR_2 */
4551 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4552 #define XFREE(stale) do { \
4553 if (stale) { free ((void *) stale); stale = 0; } \
4556 const char *program_name = NULL;
4558 void * xmalloc (size_t num);
4559 char * xstrdup (const char *string);
4560 char * basename (const char *name);
4561 char * fnqualify(const char *path);
4562 char * strendzap(char *str, const char *pat);
4563 void lt_fatal (const char *message, ...);
4566 main (int argc, char *argv[])
4571 program_name = (char *) xstrdup ((char *) basename (argv[0]));
4572 newargz = XMALLOC(char *, argc+2);
4575 cat >> $cwrappersource <<EOF
4576 newargz[0] = "$SHELL";
4579 cat >> $cwrappersource <<"EOF"
4580 newargz
[1] = fnqualify
(argv
[0]);
4581 /* we know the
script has the same name
, without the .exe
*/
4582 /* so
make sure newargz
[1] doesn
't end in .exe */
4583 strendzap(newargz[1],".exe");
4584 for (i = 1; i < argc; i++)
4585 newargz[i+1] = xstrdup(argv[i]);
4586 newargz[argc+1] = NULL;
4589 cat >> $cwrappersource <<EOF
4590 execv("$SHELL",newargz);
4593 cat >> $cwrappersource <<"EOF"
4597 xmalloc (size_t num)
4599 void * p = (void *) malloc (num);
4601 lt_fatal ("Memory exhausted");
4607 xstrdup (const char *string)
4609 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4614 basename (const char *name)
4618 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4619 /* Skip over the disk name in MSDOS pathnames. */
4620 if (isalpha (name[0]) && name[1] == ':')
4624 for (base = name; *name; name++)
4625 if (IS_DIR_SEPARATOR (*name))
4627 return (char *) base;
4631 fnqualify(const char *path)
4635 char tmp[LT_PATHMAX + 1];
4637 assert(path != NULL);
4639 /* Is it qualified already? */
4640 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4641 if (isalpha (path[0]) && path[1] == ':')
4642 return xstrdup (path);
4644 if (IS_DIR_SEPARATOR (path[0]))
4645 return xstrdup (path);
4647 /* prepend the current directory */
4648 /* doesn't handle
'~' */
4649 if (getcwd
(tmp
, LT_PATHMAX
) == NULL
)
4650 lt_fatal
("getcwd failed");
4651 size
= strlen
(tmp
) + 1 + strlen
(path
) + 1; /* +2 for '/' and
'\0' */
4652 p
= XMALLOC
(char
, size
);
4653 sprintf
(p
, "%s%c%s", tmp
, DIR_SEPARATOR
, path
);
4658 strendzap
(char
*str
, const char
*pat
)
4662 assert
(str
!= NULL
);
4663 assert
(pat
!= NULL
);
4666 patlen
= strlen
(pat
);
4670 str
+= len
- patlen
;
4671 if (strcmp
(str
, pat
) == 0)
4678 lt_error_core
(int exit_status
, const char
* mode
,
4679 const char
* message
, va_list ap
)
4681 fprintf
(stderr
, "%s: %s: ", program_name
, mode
);
4682 vfprintf
(stderr
, message
, ap
);
4683 fprintf
(stderr
, ".\n");
4685 if (exit_status
>= 0)
4690 lt_fatal
(const char
*message
, ...
)
4693 va_start
(ap
, message
);
4694 lt_error_core
(EXIT_FAILURE
, "FATAL", message
, ap
);
4698 # we should really use a build-platform specific compiler
4699 # here, but OTOH, the wrappers (shell script and this C one)
4700 # are only useful if you want to execute the "real" binary.
4701 # Since the "real" binary is built for $host, then this
4702 # wrapper might as well be built for $host, too.
4703 $run $LTCC -s -o $cwrapper $cwrappersource
4707 trap "$rm $output; exit 1" 1 2 15
4712 # $output - temporary wrapper script for $objdir/$outputname
4713 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4715 # The $output program cannot be directly executed until all the libtool
4716 # libraries that it depends on are installed.
4718 # This wrapper script should never be moved out of the build directory.
4719 # If it is, it will not operate correctly.
4721 # Sed substitution that helps us do robust quoting. It backslashifies
4722 # metacharacters that are still active within double-quoted strings.
4723 Xsed='${SED} -e 1s/^X//'
4724 sed_quote_subst='$sed_quote_subst'
4726 # The HP-UX ksh and POSIX shell print the target directory to stdout
4728 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
4730 relink_command=\"$relink_command\"
4732 # This environment variable determines our operation mode.
4733 if test \"\$libtool_install_magic\" = \"$magic\"; then
4734 # install mode needs the following variable:
4735 notinst_deplibs='$notinst_deplibs'
4737 # When we are sourced in execute mode, \$file and \$echo are already set.
4738 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4741 # Make sure echo works.
4742 if test \"X\$1\" = X--no-reexec; then
4743 # Discard the --no-reexec flag, and continue.
4745 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4746 # Yippee, \$echo works!
4749 # Restart under the correct shell, and then maybe \$echo will work.
4750 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4756 # Find the directory that this script lives in.
4757 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4758 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4760 # Follow symbolic links until we get to the real thisdir.
4761 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4762 while test -n \"\$file\"; do
4763 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4765 # If there was a directory component, then change thisdir.
4766 if test \"x\$destdir\" != \"x\$file\"; then
4767 case \"\$destdir\" in
4768 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4769 *) thisdir=\"\$thisdir/\$destdir\" ;;
4773 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4774 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
4777 # Try to get the absolute directory name.
4778 absdir=\`cd \"\$thisdir\" && pwd\`
4779 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4782 if test "$fast_install" = yes; then
4784 program=lt-'$outputname'$exeext
4785 progdir=\"\$thisdir/$objdir\"
4787 if test ! -f \"\$progdir/\$program\" || \\
4788 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4789 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4791 file=\"\$\$-\$program\"
4793 if test ! -d \"\$progdir\"; then
4794 $mkdir \"\$progdir\"
4796 $rm \"\$progdir/\$file\"
4801 # relink executable if necessary
4802 if test -n \"\$relink_command\"; then
4803 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4805 $echo \"\$relink_command_output\" >&2
4806 $rm \"\$progdir/\$file\"
4811 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4812 { $rm \"\$progdir/\$program\";
4813 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4814 $rm \"\$progdir/\$file\"
4818 program='$outputname'
4819 progdir=\"\$thisdir/$objdir\"
4825 if test -f \"\$progdir/\$program\"; then"
4827 # Export our shlibpath_var if we have one.
4828 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4830 # Add our own library path to $shlibpath_var
4831 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4833 # Some systems cannot cope with colon-terminated $shlibpath_var
4834 # The second colon is a workaround for a bug in BeOS R4 sed
4835 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4837 export $shlibpath_var
4841 # fixup the dll searchpath if we need to.
4842 if test -n "$dllsearchpath"; then
4844 # Add the dll search path components to the executable PATH
4845 PATH=$dllsearchpath:\$PATH
4850 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4851 # Run the actual program with our arguments.
4854 # Backslashes separate directories on plain windows
4855 *-*-mingw |
*-*-os2*)
4857 exec \$progdir\\\\\$program \${1+\"\$@\"}
4863 exec \$progdir/\$program \${1+\"\$@\"}
4868 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4872 # The program doesn't exist.
4873 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4874 \$echo \"This script is just a wrapper for \$program.\" 1>&2
4875 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
4886 # See if we need to build an old-fashioned archive.
4887 for oldlib
in $oldlibs; do
4889 if test "$build_libtool_libs" = convenience
; then
4890 oldobjs
="$libobjs_save"
4891 addlibs
="$convenience"
4892 build_libtool_libs
=no
4894 if test "$build_libtool_libs" = module
; then
4895 oldobjs
="$libobjs_save"
4896 build_libtool_libs
=no
4898 oldobjs
="$old_deplibs $non_pic_objects"
4900 addlibs
="$old_convenience"
4903 if test -n "$addlibs"; then
4904 gentop
="$output_objdir/${outputname}x"
4905 $show "${rm}r $gentop"
4906 $run ${rm}r
"$gentop"
4907 $show "$mkdir $gentop"
4908 $run $mkdir "$gentop"
4910 if test "$status" -ne 0 && test ! -d "$gentop"; then
4913 generated
="$generated $gentop"
4915 # Add in members from convenience archives.
4916 for xlib
in $addlibs; do
4917 # Extract the objects.
4919 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
4920 *) xabs
=`pwd`"/$xlib" ;;
4922 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4923 xdir
="$gentop/$xlib"
4925 $show "${rm}r $xdir"
4927 $show "$mkdir $xdir"
4930 if test "$status" -ne 0 && test ! -d "$xdir"; then
4933 # We will extract separately just the conflicting names and we will no
4934 # longer touch any unique names. It is faster to leave these extract
4935 # automatically by $AR in one run.
4936 $show "(cd $xdir && $AR x $xabs)"
4937 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
4938 if ($AR t
"$xabs" |
sort |
sort -uc >/dev
/null
2>&1); then
4941 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
4942 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
4943 $AR t
"$xabs" |
sort |
uniq -cd |
while read -r count name
4946 while test "$i" -le "$count"
4948 # Put our $i before any first dot (extension)
4949 # Never overwrite any file
4951 while test "X$name_to" = "X$name" ||
test -f "$xdir/$name_to"
4953 name_to
=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
4955 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
4956 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" ||
exit $?
4962 oldobjs
="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
4966 # Do each command in the archive commands.
4967 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
4968 eval cmds
=\"$old_archive_from_new_cmds\"
4970 eval cmds
=\"$old_archive_cmds\"
4972 if len
=`expr "X$cmds" : ".*"` &&
4973 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
4976 # the command line is too long to link in one step, link in parts
4977 $echo "using piecewise archive linking..."
4982 save_oldobjs
=$oldobjs
4983 # GNU ar 2.10+ was changed to match POSIX; thus no paths are
4984 # encoded into archives. This makes 'ar r' malfunction in
4985 # this piecewise linking case whenever conflicting object
4986 # names appear in distinct ar calls; check, warn and compensate.
4987 if (for obj
in $save_oldobjs
4989 $echo "X$obj" |
$Xsed -e 's%^.*/%%'
4990 done |
sort |
sort -uc >/dev
/null
2>&1); then
4993 $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
4994 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
4997 # Is there a better way of finding the last object in the list?
4998 for obj
in $save_oldobjs
5002 for obj
in $save_oldobjs
5004 oldobjs
="$objlist $obj"
5005 objlist
="$objlist $obj"
5006 eval test_cmds
=\"$old_archive_cmds\"
5007 if len
=`expr "X$test_cmds" : ".*"` &&
5008 test "$len" -le "$max_cmd_len"; then
5011 # the above command should be used before it gets too long
5013 if test "$obj" = "$last_oldobj" ; then
5016 test -z "$concat_cmds" || concat_cmds
=$concat_cmds~
5017 eval concat_cmds
=\"\
${concat_cmds}$old_archive_cmds\"
5023 if test "X$oldobjs" = "X" ; then
5024 eval cmds
=\"\
$concat_cmds\"
5026 eval cmds
=\"\
$concat_cmds~
$old_archive_cmds\"
5030 save_ifs
="$IFS"; IFS
='~'
5031 for cmd
in $cmds; do
5034 $run eval "$cmd" ||
exit $?
5039 if test -n "$generated"; then
5040 $show "${rm}r$generated"
5041 $run ${rm}r
$generated
5044 # Now create the libtool archive.
5048 test "$build_old_libs" = yes && old_library
="$libname.$libext"
5049 $show "creating $output"
5051 # Preserve any variables that may affect compiler behavior
5052 for var
in $variables_saved_for_relink; do
5053 if eval test -z \"\
${$var+set}\"; then
5054 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5055 elif eval var_value
=\$
$var; test -z "$var_value"; then
5056 relink_command
="$var=; export $var; $relink_command"
5058 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5059 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
5062 # Quote the link command for shipping.
5063 relink_command
="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
5064 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5065 if test "$hardcode_automatic" = yes ; then
5068 # Only create the output if not a dry run.
5069 if test -z "$run"; then
5070 for installed
in no
yes; do
5071 if test "$installed" = yes; then
5072 if test -z "$install_libdir"; then
5075 output
="$output_objdir/$outputname"i
5076 # Replace all uninstalled libtool libraries with the installed ones
5078 for deplib
in $dependency_libs; do
5081 name
=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5082 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5083 if test -z "$libdir"; then
5084 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5087 newdependency_libs
="$newdependency_libs $libdir/$name"
5089 *) newdependency_libs
="$newdependency_libs $deplib" ;;
5092 dependency_libs
="$newdependency_libs"
5094 for lib
in $dlfiles; do
5095 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5096 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5097 if test -z "$libdir"; then
5098 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5101 newdlfiles
="$newdlfiles $libdir/$name"
5103 dlfiles
="$newdlfiles"
5105 for lib
in $dlprefiles; do
5106 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5107 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5108 if test -z "$libdir"; then
5109 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5112 newdlprefiles
="$newdlprefiles $libdir/$name"
5114 dlprefiles
="$newdlprefiles"
5117 for lib
in $dlfiles; do
5119 [\\/]* |
[A-Za-z
]:[\\/]*) abs
="$lib" ;;
5120 *) abs
=`pwd`"/$lib" ;;
5122 newdlfiles
="$newdlfiles $abs"
5124 dlfiles
="$newdlfiles"
5126 for lib
in $dlprefiles; do
5128 [\\/]* |
[A-Za-z
]:[\\/]*) abs
="$lib" ;;
5129 *) abs
=`pwd`"/$lib" ;;
5131 newdlprefiles
="$newdlprefiles $abs"
5133 dlprefiles
="$newdlprefiles"
5136 # place dlname in correct position for cygwin
5138 case $host,$output,$installed,$module,$dlname in
5139 *cygwin
*,*lai
,yes,no
,*.dll |
*mingw
*,*lai
,yes,no
,*.dll
) tdlname
=..
/bin
/$dlname ;;
5142 # $outputname - a libtool library file
5143 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5145 # Please DO NOT delete this file!
5146 # It is necessary for linking the library.
5148 # The name that we can dlopen(3).
5151 # Names of this library.
5152 library_names='$library_names'
5154 # The name of the static archive.
5155 old_library='$old_library'
5157 # Libraries that this one depends upon.
5158 dependency_libs='$dependency_libs'
5160 # Version information for $libname.
5165 # Is this an already installed library?
5166 installed=$installed
5168 # Should we warn about portability when linking against -modules?
5169 shouldnotlink=$module
5171 # Files to dlopen/dlpreopen
5173 dlpreopen='$dlprefiles'
5175 # Directory that this library needs to be installed in:
5176 libdir='$install_libdir'"
5177 if test "$installed" = no
&& test "$need_relink" = yes; then
5179 relink_command=\"$relink_command\""
5184 # Do a symbolic link so that the libtool archive can be found in
5185 # LD_LIBRARY_PATH before the program is installed.
5186 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5187 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' ||
exit $?
5193 # libtool install mode
5195 modename
="$modename: install"
5197 # There may be an optional sh(1) argument at the beginning of
5198 # install_prog (especially on Windows NT).
5199 if test "$nonopt" = "$SHELL" ||
test "$nonopt" = /bin
/sh ||
5200 # Allow the use of GNU shtool's install command.
5201 $echo "X$nonopt" |
$Xsed |
grep shtool
> /dev
/null
; then
5202 # Aesthetically quote it.
5203 arg
=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5205 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5209 install_prog
="$arg "
5217 # The real first argument should be the name of the installation program.
5218 # Aesthetically quote it.
5219 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5221 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5225 install_prog
="$install_prog$arg"
5227 # We need to accept at least all the BSD install flags.
5237 if test -n "$dest"; then
5238 files
="$files $dest"
5256 # If the previous option needed an argument, then skip it.
5257 if test -n "$prev"; then
5266 # Aesthetically quote the argument.
5267 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5269 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5273 install_prog
="$install_prog $arg"
5276 if test -z "$install_prog"; then
5277 $echo "$modename: you must specify an install program" 1>&2
5282 if test -n "$prev"; then
5283 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5288 if test -z "$files"; then
5289 if test -z "$dest"; then
5290 $echo "$modename: no file or destination specified" 1>&2
5292 $echo "$modename: you must specify a destination" 1>&2
5298 # Strip any trailing slash from the destination.
5299 dest
=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5301 # Check to see that the destination is a directory.
5302 test -d "$dest" && isdir
=yes
5303 if test "$isdir" = yes; then
5307 destdir
=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5308 test "X$destdir" = "X$dest" && destdir
=.
5309 destname
=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5311 # Not a directory, so check to see that there is only one file specified.
5313 if test "$#" -gt 2; then
5314 $echo "$modename: \`$dest' is not a directory" 1>&2
5320 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
5322 for file in $files; do
5326 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5335 # This variable tells wrapper scripts just to set variables rather
5336 # than running their programs.
5337 libtool_install_magic
="$magic"
5342 for file in $files; do
5344 # Do each installation.
5347 # Do the static libraries later.
5348 staticlibs
="$staticlibs $file"
5352 # Check to see that this really is a libtool archive.
5353 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
5355 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5363 # If there is no directory component, then add one.
5365 */* |
*\\*) .
$file ;;
5369 # Add the libdir to current_libdirs if it is the destination.
5370 if test "X$destdir" = "X$libdir"; then
5371 case "$current_libdirs " in
5373 *) current_libdirs
="$current_libdirs $libdir" ;;
5376 # Note the libdir as a future libdir.
5377 case "$future_libdirs " in
5379 *) future_libdirs
="$future_libdirs $libdir" ;;
5383 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5384 test "X$dir" = "X$file/" && dir
=
5387 if test -n "$relink_command"; then
5388 # Determine the prefix the user has applied to our future dir.
5389 inst_prefix_dir
=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5391 # Don't allow the user to place us outside of our expected
5392 # location b/c this prevents finding dependent libraries that
5393 # are installed to the same prefix.
5394 # At present, this check doesn't affect windows .dll's that
5395 # are installed into $libdir/../bin (currently, that works fine)
5396 # but it's something to keep an eye on.
5397 if test "$inst_prefix_dir" = "$destdir"; then
5398 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5402 if test -n "$inst_prefix_dir"; then
5403 # Stick the inst_prefix_dir data into the link command.
5404 relink_command
=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5406 relink_command
=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5409 $echo "$modename: warning: relinking \`$file'" 1>&2
5410 $show "$relink_command"
5411 if $run eval "$relink_command"; then :
5413 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5418 # See the names of the shared library.
5419 set dummy
$library_names
5420 if test -n "$2"; then
5426 test -n "$relink_command" && srcname
="$realname"T
5428 # Install the shared library and build the symlinks.
5429 $show "$install_prog $dir/$srcname $destdir/$realname"
5430 $run eval "$install_prog $dir/$srcname $destdir/$realname" ||
exit $?
5431 if test -n "$stripme" && test -n "$striplib"; then
5432 $show "$striplib $destdir/$realname"
5433 $run eval "$striplib $destdir/$realname" ||
exit $?
5436 if test "$#" -gt 0; then
5437 # Delete the old symlinks, and create new ones.
5440 if test "$linkname" != "$realname"; then
5441 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5442 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5447 # Do each command in the postinstall commands.
5448 lib
="$destdir/$realname"
5449 eval cmds
=\"$postinstall_cmds\"
5450 save_ifs
="$IFS"; IFS
='~'
5451 for cmd
in $cmds; do
5454 $run eval "$cmd" ||
exit $?
5459 # Install the pseudo-library for information purposes.
5460 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5461 instname
="$dir/$name"i
5462 $show "$install_prog $instname $destdir/$name"
5463 $run eval "$install_prog $instname $destdir/$name" ||
exit $?
5465 # Maybe install the static library, too.
5466 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
5470 # Install (i.e. copy) a libtool object.
5472 # Figure out destination file name, if it wasn't already specified.
5473 if test -n "$destname"; then
5474 destfile
="$destdir/$destname"
5476 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5477 destfile
="$destdir/$destfile"
5480 # Deduce the name of the destination old-style object file.
5483 staticdest
=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5486 staticdest
="$destfile"
5490 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5496 # Install the libtool object if requested.
5497 if test -n "$destfile"; then
5498 $show "$install_prog $file $destfile"
5499 $run eval "$install_prog $file $destfile" ||
exit $?
5502 # Install the old object if enabled.
5503 if test "$build_old_libs" = yes; then
5504 # Deduce the name of the old-style object file.
5505 staticobj
=`$echo "X$file" | $Xsed -e "$lo2o"`
5507 $show "$install_prog $staticobj $staticdest"
5508 $run eval "$install_prog \$staticobj \$staticdest" ||
exit $?
5514 # Figure out destination file name, if it wasn't already specified.
5515 if test -n "$destname"; then
5516 destfile
="$destdir/$destname"
5518 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5519 destfile
="$destdir/$destfile"
5522 # If the file is missing, and there is a .exe on the end, strip it
5523 # because it is most likely a libtool script we actually want to
5528 if test ! -f "$file"; then
5529 file=`$echo $file|${SED} 's,.exe$,,'`
5535 # Do a test to see if this is really a libtool program.
5538 wrapper
=`$echo $file | ${SED} -e 's,.exe$,,'`
5544 if (${SED} -e '4q' $wrapper |
grep "^# Generated by .*$PACKAGE")>/dev
/null
2>&1; then
5548 # To insure that "foo" is sourced, and not "foo.exe",
5549 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5550 # which disallows the automatic-append-.exe behavior.
5552 *cygwin
* |
*mingw
*) wrapperdot
=${wrapper}.
;;
5553 *) wrapperdot
=${wrapper} ;;
5555 # If there is no directory component, then add one.
5557 */* |
*\\*) .
${wrapperdot} ;;
5558 *) . .
/${wrapperdot} ;;
5561 # Check the variables that should have been set.
5562 if test -z "$notinst_deplibs"; then
5563 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5568 for lib
in $notinst_deplibs; do
5569 # Check to see that each library is installed.
5571 if test -f "$lib"; then
5572 # If there is no directory component, then add one.
5574 */* |
*\\*) .
$lib ;;
5578 libfile
="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5579 if test -n "$libdir" && test ! -f "$libfile"; then
5580 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5586 # To insure that "foo" is sourced, and not "foo.exe",
5587 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5588 # which disallows the automatic-append-.exe behavior.
5590 *cygwin
* |
*mingw
*) wrapperdot
=${wrapper}.
;;
5591 *) wrapperdot
=${wrapper} ;;
5593 # If there is no directory component, then add one.
5595 */* |
*\\*) .
${wrapperdot} ;;
5596 *) . .
/${wrapperdot} ;;
5600 if test "$fast_install" = no
&& test -n "$relink_command"; then
5601 if test "$finalize" = yes && test -z "$run"; then
5603 test -n "$TMPDIR" && tmpdir
="$TMPDIR"
5604 tmpdir
="$tmpdir/libtool-$$"
5605 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
5607 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5610 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5611 outputname
="$tmpdir/$file"
5612 # Replace the output file specification.
5613 relink_command
=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5615 $show "$relink_command"
5616 if $run eval "$relink_command"; then :
5618 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5624 $echo "$modename: warning: cannot relink \`$file'" 1>&2
5627 # Install the binary that we compiled earlier.
5628 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5632 # remove .exe since cygwin /usr/bin/install will append another
5634 case $install_prog,$host in
5635 */usr
/bin
/install*,*cygwin
*)
5636 case $file:$destfile in
5641 destfile
=$destfile.exe
5644 destfile
=`$echo $destfile | ${SED} -e 's,.exe$,,'`
5649 $show "$install_prog$stripme $file $destfile"
5650 $run eval "$install_prog\$stripme \$file \$destfile" ||
exit $?
5651 test -n "$outputname" && ${rm}r
"$tmpdir"
5656 for file in $staticlibs; do
5657 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5659 # Set up the ranlib parameters.
5660 oldlib
="$destdir/$name"
5662 $show "$install_prog $file $oldlib"
5663 $run eval "$install_prog \$file \$oldlib" ||
exit $?
5665 if test -n "$stripme" && test -n "$striplib"; then
5666 $show "$old_striplib $oldlib"
5667 $run eval "$old_striplib $oldlib" ||
exit $?
5670 # Do each command in the postinstall commands.
5671 eval cmds
=\"$old_postinstall_cmds\"
5672 save_ifs
="$IFS"; IFS
='~'
5673 for cmd
in $cmds; do
5676 $run eval "$cmd" ||
exit $?
5681 if test -n "$future_libdirs"; then
5682 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5685 if test -n "$current_libdirs"; then
5686 # Maybe just do a dry run.
5687 test -n "$run" && current_libdirs
=" -n$current_libdirs"
5688 exec_cmd
='$SHELL $0 --finish$current_libdirs'
5694 # libtool finish mode
5696 modename
="$modename: finish"
5700 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5703 libdirs
="$libdirs $dir"
5706 for libdir
in $libdirs; do
5707 if test -n "$finish_cmds"; then
5708 # Do each command in the finish commands.
5709 eval cmds
=\"$finish_cmds\"
5710 save_ifs
="$IFS"; IFS
='~'
5711 for cmd
in $cmds; do
5714 $run eval "$cmd" || admincmds
="$admincmds
5719 if test -n "$finish_eval"; then
5720 # Do the single finish_eval.
5721 eval cmds
=\"$finish_eval\"
5722 $run eval "$cmds" || admincmds
="$admincmds
5728 # Exit here if they wanted silent mode.
5729 test "$show" = : && exit 0
5731 $echo "----------------------------------------------------------------------"
5732 $echo "Libraries have been installed in:"
5733 for libdir
in $libdirs; do
5737 $echo "If you ever happen to want to link against installed libraries"
5738 $echo "in a given directory, LIBDIR, you must either use libtool, and"
5739 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5740 $echo "flag during linking and do at least one of the following:"
5741 if test -n "$shlibpath_var"; then
5742 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5743 $echo " during execution"
5745 if test -n "$runpath_var"; then
5746 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
5747 $echo " during linking"
5749 if test -n "$hardcode_libdir_flag_spec"; then
5751 eval flag
=\"$hardcode_libdir_flag_spec\"
5753 $echo " - use the \`$flag' linker flag"
5755 if test -n "$admincmds"; then
5756 $echo " - have your system administrator run these commands:$admincmds"
5758 if test -f /etc
/ld.so.conf
; then
5759 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5762 $echo "See any operating system documentation about shared libraries for"
5763 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
5764 $echo "----------------------------------------------------------------------"
5768 # libtool execute mode
5770 modename
="$modename: execute"
5772 # The first argument is the command name.
5774 if test -z "$cmd"; then
5775 $echo "$modename: you must specify a COMMAND" 1>&2
5780 # Handle -dlopen flags immediately.
5781 for file in $execute_dlfiles; do
5782 if test ! -f "$file"; then
5783 $echo "$modename: \`$file' is not a file" 1>&2
5791 # Check to see that this really is a libtool archive.
5792 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
5794 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5799 # Read the libtool library.
5803 # If there is no directory component, then add one.
5805 */* |
*\\*) .
$file ;;
5809 # Skip this library if it cannot be dlopened.
5810 if test -z "$dlname"; then
5811 # Warn if it was a shared library.
5812 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
5816 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5817 test "X$dir" = "X$file" && dir
=.
5819 if test -f "$dir/$objdir/$dlname"; then
5822 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5828 # Just add the directory containing the .lo file.
5829 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5830 test "X$dir" = "X$file" && dir
=.
5834 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
5839 # Get the absolute pathname.
5840 absdir
=`cd "$dir" && pwd`
5841 test -n "$absdir" && dir
="$absdir"
5843 # Now add the directory to shlibpath_var.
5844 if eval "test -z \"\$$shlibpath_var\""; then
5845 eval "$shlibpath_var=\"\$dir\""
5847 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
5851 # This variable tells wrapper scripts just to set shlibpath_var
5852 # rather than running their programs.
5853 libtool_execute_magic
="$magic"
5855 # Check if any of the arguments is a wrapper script.
5862 # Do a test to see if this is really a libtool program.
5863 if (${SED} -e '4q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
5864 # If there is no directory component, then add one.
5866 */* |
*\\*) .
$file ;;
5870 # Transform arg to wrapped name.
5871 file="$progdir/$program"
5875 # Quote arguments (to preserve shell metacharacters).
5876 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
5877 args
="$args \"$file\""
5880 if test -z "$run"; then
5881 if test -n "$shlibpath_var"; then
5882 # Export the shlibpath_var.
5883 eval "export $shlibpath_var"
5886 # Restore saved environment variables
5887 if test "${save_LC_ALL+set}" = set; then
5888 LC_ALL
="$save_LC_ALL"; export LC_ALL
5890 if test "${save_LANG+set}" = set; then
5891 LANG
="$save_LANG"; export LANG
5894 # Now prepare to actually exec the command.
5895 exec_cmd
="\$cmd$args"
5897 # Display what would be done.
5898 if test -n "$shlibpath_var"; then
5899 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
5900 $echo "export $shlibpath_var"
5907 # libtool clean and uninstall mode
5909 modename
="$modename: $mode"
5915 # This variable tells wrapper scripts just to set variables rather
5916 # than running their programs.
5917 libtool_install_magic
="$magic"
5922 -f) rm="$rm $arg"; rmforce
=yes ;;
5923 -*) rm="$rm $arg" ;;
5924 *) files
="$files $arg" ;;
5928 if test -z "$rm"; then
5929 $echo "$modename: you must specify an RM program" 1>&2
5936 origobjdir
="$objdir"
5937 for file in $files; do
5938 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5939 if test "X$dir" = "X$file"; then
5941 objdir
="$origobjdir"
5943 objdir
="$dir/$origobjdir"
5945 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5946 test "$mode" = uninstall
&& objdir
="$dir"
5948 # Remember objdir for removal later, being careful to avoid duplicates
5949 if test "$mode" = clean
; then
5952 *) rmdirs
="$rmdirs $objdir" ;;
5956 # Don't error if the file doesn't exist and rm -f was used.
5957 if (test -L "$file") >/dev
/null
2>&1 \
5958 ||
(test -h "$file") >/dev
/null
2>&1 \
5959 ||
test -f "$file"; then
5961 elif test -d "$file"; then
5964 elif test "$rmforce" = yes; then
5972 # Possibly a libtool archive, so verify it.
5973 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
5976 # Delete the libtool libraries and symlinks.
5977 for n
in $library_names; do
5978 rmfiles
="$rmfiles $objdir/$n"
5980 test -n "$old_library" && rmfiles
="$rmfiles $objdir/$old_library"
5981 test "$mode" = clean
&& rmfiles
="$rmfiles $objdir/$name $objdir/${name}i"
5983 if test "$mode" = uninstall
; then
5984 if test -n "$library_names"; then
5985 # Do each command in the postuninstall commands.
5986 eval cmds
=\"$postuninstall_cmds\"
5987 save_ifs
="$IFS"; IFS
='~'
5988 for cmd
in $cmds; do
5992 if test "$?" -ne 0 && test "$rmforce" != yes; then
5999 if test -n "$old_library"; then
6000 # Do each command in the old_postuninstall commands.
6001 eval cmds
=\"$old_postuninstall_cmds\"
6002 save_ifs
="$IFS"; IFS
='~'
6003 for cmd
in $cmds; do
6007 if test "$?" -ne 0 && test "$rmforce" != yes; then
6013 # FIXME: should reinstall the best remaining shared library.
6019 # Possibly a libtool object, so verify it.
6020 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6025 # Add PIC object to the list of files to remove.
6026 if test -n "$pic_object" \
6027 && test "$pic_object" != none
; then
6028 rmfiles
="$rmfiles $dir/$pic_object"
6031 # Add non-PIC object to the list of files to remove.
6032 if test -n "$non_pic_object" \
6033 && test "$non_pic_object" != none
; then
6034 rmfiles
="$rmfiles $dir/$non_pic_object"
6040 if test "$mode" = clean
; then
6044 file=`$echo $file|${SED} 's,.exe$,,'`
6045 noexename
=`$echo $name|${SED} 's,.exe$,,'`
6046 # $file with .exe has already been added to rmfiles,
6047 # add $file without .exe
6048 rmfiles
="$rmfiles $file"
6051 # Do a test to see if this is a libtool program.
6052 if (${SED} -e '4q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6056 # note $name still contains .exe if it was in $file originally
6057 # as does the version of $file that was added into $rmfiles
6058 rmfiles
="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6059 if test "$fast_install" = yes && test -n "$relink_command"; then
6060 rmfiles
="$rmfiles $objdir/lt-$name"
6062 if test "X$noexename" != "X$name" ; then
6063 rmfiles
="$rmfiles $objdir/lt-${noexename}.c"
6069 $show "$rm $rmfiles"
6070 $run $rm $rmfiles || exit_status
=1
6072 objdir
="$origobjdir"
6074 # Try to remove the ${objdir}s in the directories where we deleted files
6075 for dir
in $rmdirs; do
6076 if test -d "$dir"; then
6078 $run rmdir $dir >/dev
/null
2>&1
6086 $echo "$modename: you must specify a MODE" 1>&2
6087 $echo "$generic_help" 1>&2
6092 if test -z "$exec_cmd"; then
6093 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6094 $echo "$generic_help" 1>&2
6097 fi # test -z "$show_help"
6099 if test -n "$exec_cmd"; then
6104 # We need to display help for each of the modes.
6107 "Usage: $modename [OPTION]... [MODE-ARG]...
6109 Provide generalized library-building support services.
6111 --config show all configuration variables
6112 --debug enable verbose shell tracing
6113 -n, --dry-run display commands without modifying any files
6114 --features display basic configuration information and exit
6115 --finish same as \`--mode=finish'
6116 --help display this help message and exit
6117 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6118 --quiet same as \`--silent'
6119 --silent don't print informational messages
6120 --tag=TAG use configuration variables from tag TAG
6121 --version print version information
6123 MODE must be one of the following:
6125 clean remove files from the build directory
6126 compile compile a source file into a libtool object
6127 execute automatically set library path, then run a program
6128 finish complete the installation of libtool libraries
6129 install install libraries or executables
6130 link create a library or an executable
6131 uninstall remove libraries from an installed directory
6133 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6134 a more detailed description of MODE.
6136 Report bugs to <bug-libtool@gnu.org>."
6142 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6144 Remove files from the build directory.
6146 RM is the name of the program to use to delete files associated with each FILE
6147 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6150 If FILE is a libtool library, object or program, all the files associated
6151 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6156 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6158 Compile a source file into a libtool library object.
6160 This mode accepts the following additional options:
6162 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6163 -prefer-pic try to building PIC objects only
6164 -prefer-non-pic try to building non-PIC objects only
6165 -static always build a \`.o' file suitable for static linking
6167 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6168 from the given SOURCEFILE.
6170 The output file name is determined by removing the directory component from
6171 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6172 library object suffix, \`.lo'."
6177 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6179 Automatically set library path, then run a program.
6181 This mode accepts the following additional options:
6183 -dlopen FILE add the directory containing FILE to the library path
6185 This mode sets the library path environment variable according to \`-dlopen'
6188 If any of the ARGS are libtool executable wrappers, then they are translated
6189 into their corresponding uninstalled binary, and any of their required library
6190 directories are added to the library path.
6192 Then, COMMAND is executed, with ARGS as arguments."
6197 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6199 Complete the installation of libtool libraries.
6201 Each LIBDIR is a directory that contains libtool libraries.
6203 The commands that this mode executes may require superuser privileges. Use
6204 the \`--dry-run' option if you just want to see what would be executed."
6209 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6211 Install executables or libraries.
6213 INSTALL-COMMAND is the installation command. The first component should be
6214 either the \`install' or \`cp' program.
6216 The rest of the components are interpreted as arguments to that command (only
6217 BSD-compatible install options are recognized)."
6222 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6224 Link object files or libraries together to form another library, or to
6225 create an executable program.
6227 LINK-COMMAND is a command using the C compiler that you would use to create
6228 a program from several object files.
6230 The following components of LINK-COMMAND are treated specially:
6232 -all-static do not do any dynamic linking at all
6233 -avoid-version do not add a version suffix if possible
6234 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6235 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6236 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6237 -export-symbols SYMFILE
6238 try to export only the symbols listed in SYMFILE
6239 -export-symbols-regex REGEX
6240 try to export only the symbols matching REGEX
6241 -LLIBDIR search LIBDIR for required installed libraries
6242 -lNAME OUTPUT-FILE requires the installed library libNAME
6243 -module build a library that can dlopened
6244 -no-fast-install disable the fast-install mode
6245 -no-install link a not-installable executable
6246 -no-undefined declare that a library does not refer to external symbols
6247 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6248 -objectlist FILE Use a list of object files found in FILE to specify objects
6249 -release RELEASE specify package release information
6250 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6251 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6252 -static do not do any dynamic linking of libtool libraries
6253 -version-info CURRENT[:REVISION[:AGE]]
6254 specify library version info [each variable defaults to 0]
6256 All other options (arguments beginning with \`-') are ignored.
6258 Every other argument is treated as a filename. Files ending in \`.la' are
6259 treated as uninstalled libtool libraries, other files are standard or library
6262 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6263 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6264 required, except when creating a convenience library.
6266 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6267 using \`ar' and \`ranlib', or on Windows using \`lib'.
6269 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6270 is created, otherwise an executable program is created."
6275 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6277 Remove libraries from an installation directory.
6279 RM is the name of the program to use to delete files associated with each FILE
6280 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6283 If FILE is a libtool library, all the files associated with it are deleted.
6284 Otherwise, only FILE itself is deleted using RM."
6288 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6295 $echo "Try \`$modename --help' for more information about other modes."
6299 # The TAGs below are defined such that we never get into a situation
6300 # in which we disable both kinds of libraries. Given conflicting
6301 # choices, we go for a static library, that is the most portable,
6302 # since we can't tell whether shared libraries were disabled because
6303 # the user asked for that or because the platform doesn't support
6304 # them. This is particularly important on AIX, because we don't
6305 # support having both static and shared libraries enabled at the same
6306 # time on that platform, so we default to a shared-only configuration.
6307 # If a disable-shared tag is given, we'll fallback to a static-only
6308 # configuration. But we'll never go from static-only to shared-only.
6310 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6311 build_libtool_libs
=no
6313 # ### END LIBTOOL TAG CONFIG: disable-shared
6315 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6316 build_old_libs
=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6317 # ### END LIBTOOL TAG CONFIG: disable-static