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.60 2004/01/25 12:25:08)"
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"
180 preserve_args
="${preserve_args}=$arg"
182 # Check whether tagname contains only valid characters
185 $echo "$progname: invalid tag name: $tagname" 1>&2
192 # Don't test for the "default" C tag, as we know, it's there, but
193 # not specially marked.
196 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev
/null
; then
197 taglist
="$taglist $tagname"
198 # Evaluate the configuration.
199 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
201 $echo "$progname: ignoring unknown tag $tagname" 1>&2
216 # Have we seen a non-optional argument yet?
223 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
225 $echo "Copyright (C) 2003 Free Software Foundation, Inc."
226 $echo "This is free software; see the source for copying conditions. There is NO"
227 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
232 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
233 # Now print the configurations for the tags.
234 for tagname
in $taglist; do
235 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
241 $echo "$progname: enabling shell trace mode"
243 preserve_args
="$preserve_args $arg"
252 if test "$build_libtool_libs" = yes; then
253 $echo "enable shared libraries"
255 $echo "disable shared libraries"
257 if test "$build_old_libs" = yes; then
258 $echo "enable static libraries"
260 $echo "disable static libraries"
265 --finish) mode
="finish" ;;
267 --mode) prevopt
="--mode" prev
=mode
;;
268 --mode=*) mode
="$optarg" ;;
270 --preserve-dup-deps) duplicate_deps
="yes" ;;
274 preserve_args
="$preserve_args $arg"
277 --tag) prevopt
="--tag" prev
=tag
;;
279 set tag
"$optarg" ${1+"$@"}
282 preserve_args
="$preserve_args --tag"
291 $echo "$modename: unrecognized option \`$arg'" 1>&2
303 if test -n "$prevopt"; then
304 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
309 # If this variable is set in any of the actions, the command in it
310 # will be execed at the end. This prevents here-documents from being
311 # left over by shells.
314 if test -z "$show_help"; then
316 # Infer the operation mode.
317 if test -z "$mode"; then
318 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
319 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
321 *cc | cc
* |
*++ | gcc
* |
*-gcc* | g
++* | xlc
*)
333 *db |
*dbx |
*strace |
*truss
)
343 # If we have no mode, but dlfiles were specified, then do execute mode.
344 test -n "$execute_dlfiles" && mode
=execute
346 # Just use the default operation mode.
347 if test -z "$mode"; then
348 if test -n "$nonopt"; then
349 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
351 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
358 # Only execute mode is allowed to have -dlopen flags.
359 if test -n "$execute_dlfiles" && test "$mode" != execute
; then
360 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
365 # Change the help message to a mode-specific one.
367 help="Try \`$modename --help --mode=$mode' for more information."
369 # These modes are in order of execution frequency so that they run quickly.
371 # libtool compile mode
373 modename
="$modename: compile"
374 # Get the compilation command and the source file.
376 srcfile
="$nonopt" # always keep a non-empty value in "srcfile"
387 # do not "continue". Instead, add this to base_compile
399 # Accept any command-line options.
402 if test -n "$libobj" ; then
403 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
410 -static |
-prefer-pic |
-prefer-non-pic)
421 arg_mode
=arg
# the next one goes into the "base_compile" arg list
422 continue # The current "srcfile" will either be retained or
423 ;; # replaced later. I would guess that would be a bug.
426 args
=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
428 save_ifs
="$IFS"; IFS
=','
432 # Double-quote args containing other shell metacharacters.
433 # Many Bourne shells cannot handle close brackets correctly
434 # in scan sets, so we specify it separately.
436 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
440 lastarg
="$lastarg $arg"
443 lastarg
=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
445 # Add the arguments to base_compile.
446 base_compile
="$base_compile $lastarg"
451 # Accept the current argument as the source file.
452 # The previous "srcfile" becomes the current argument.
459 esac # case $arg_mode
461 # Aesthetically quote the previous argument.
462 lastarg
=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
465 # Double-quote args containing other shell metacharacters.
466 # Many Bourne shells cannot handle close brackets correctly
467 # in scan sets, so we specify it separately.
468 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
469 lastarg
="\"$lastarg\""
473 base_compile
="$base_compile $lastarg"
478 $echo "$modename: you must specify an argument for -Xcompile"
482 $echo "$modename: you must specify a target with \`-o'" 1>&2
486 # Get the name of the library object.
487 [ -z "$libobj" ] && libobj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
491 # Recognize several different file suffixes.
492 # If the user specifies -o file.o, it is replaced with file.lo
502 *.class
) xform
=class
;;
507 *.java
) xform
=java
;;
510 libobj
=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
513 *.lo
) obj
=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
515 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
520 # Infer tagged configuration to use if any are available and
521 # if one wasn't chosen via the "--tag" command line option.
522 # Only attempt this if the compiler in the base compile
523 # command doesn't match the default compiler.
524 if test -n "$available_tags" && test -z "$tagname"; then
525 case $base_compile in
526 # Blanks in the command may have been stripped by the calling shell,
527 # but not from the CC environment variable when configure was run.
528 " $CC "* |
"$CC "* |
" `$echo $CC` "* |
"`$echo $CC` "*) ;;
529 # Blanks at the start of $base_compile will cause this to fail
530 # if we don't check for them as well.
532 for z
in $available_tags; do
533 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev
/null
; then
534 # Evaluate the configuration.
535 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
536 case "$base_compile " in
537 "$CC "* |
" $CC "* |
"`$echo $CC` "* |
" `$echo $CC` "*)
538 # The compiler in the base compile command matches
539 # the one in the tagged configuration.
540 # Assume this is the tagged configuration we want.
547 # If $tagname still isn't set, then no tagged configuration
548 # was found and let the user know that the "--tag" command
549 # line option must be used.
550 if test -z "$tagname"; then
551 $echo "$modename: unable to infer tagged configuration"
552 $echo "$modename: specify a tag with \`--tag'" 1>&2
555 # $echo "$modename: using $tagname tagged configuration"
561 for arg
in $later; do
580 objname
=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
581 xdir
=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
582 if test "X$xdir" = "X$obj"; then
587 lobj
=${xdir}$objdir/$objname
589 if test -z "$base_compile"; then
590 $echo "$modename: you must specify a compilation command" 1>&2
595 # Delete any leftover library objects.
596 if test "$build_old_libs" = yes; then
597 removelist
="$obj $lobj $libobj ${libobj}T"
599 removelist
="$lobj $libobj ${libobj}T"
603 trap "$run $rm $removelist; exit 1" 1 2 15
605 # On Cygwin there's no "real" PIC flag so we must build both object types
607 cygwin
* | mingw
* | pw32
* | os2
*)
611 if test "$pic_mode" = no
&& test "$deplibs_check_method" != pass_all
; then
612 # non-PIC code in shared libraries is not supported
616 # Calculate the filename of the output object if compiler does
617 # not support -o with -c
618 if test "$compiler_c_o" = no
; then
619 output_obj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.
${objext}
620 lockfile
="$output_obj.lock"
621 removelist
="$removelist $output_obj $lockfile"
622 trap "$run $rm $removelist; exit 1" 1 2 15
629 # Lock this critical section if it is needed
630 # We use this script file to make the link, it avoids creating a new file
631 if test "$need_locks" = yes; then
632 until $run ln "$0" "$lockfile" 2>/dev
/null
; do
633 $show "Waiting for $lockfile to be removed"
636 elif test "$need_locks" = warn
; then
637 if test -f "$lockfile"; then
639 *** ERROR, $lockfile exists and contains:
640 `cat $lockfile 2>/dev/null`
642 This indicates that another process is trying to use the same
643 temporary object file, and libtool could not work around it because
644 your compiler does not support \`-c' and \`-o' together. If you
645 repeat this compilation, it may succeed, by chance, but you had better
646 avoid parallel builds (make -j) in this platform, or get a better
652 $echo $srcfile > "$lockfile"
655 if test -n "$fix_srcfile_path"; then
656 eval srcfile
=\"$fix_srcfile_path\"
659 $run $rm "$libobj" "${libobj}T"
661 # Create a libtool object file (analogous to a ".la" file),
662 # but don't create it if we're doing a dry run.
663 test -z "$run" && cat > ${libobj}T
<<EOF
664 # $libobj - a libtool object file
665 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
667 # Please DO NOT delete this file!
668 # It is necessary for linking the library.
670 # Name of the PIC object.
673 # Only build a PIC object if we are building libtool libraries.
674 if test "$build_libtool_libs" = yes; then
675 # Without this assignment, base_compile gets emptied.
676 fbsd_hideous_sh_bug
=$base_compile
678 if test "$pic_mode" != no
; then
679 command="$base_compile $srcfile $pic_flag"
681 # Don't build PIC code
682 command="$base_compile $srcfile"
685 if test ! -d "${xdir}$objdir"; then
686 $show "$mkdir ${xdir}$objdir"
687 $run $mkdir ${xdir}$objdir
689 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
694 if test -z "$output_obj"; then
695 # Place PIC objects in $objdir
696 command="$command -o $lobj"
699 $run $rm "$lobj" "$output_obj"
702 if $run eval "$command"; then :
704 test -n "$output_obj" && $run $rm $removelist
708 if test "$need_locks" = warn
&&
709 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
711 *** ERROR, $lockfile contains:
712 `cat $lockfile 2>/dev/null`
714 but it should contain:
717 This indicates that another process is trying to use the same
718 temporary object file, and libtool could not work around it because
719 your compiler does not support \`-c' and \`-o' together. If you
720 repeat this compilation, it may succeed, by chance, but you had better
721 avoid parallel builds (make -j) in this platform, or get a better
728 # Just move the object if needed, then go on to compile the next one
729 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
730 $show "$mv $output_obj $lobj"
731 if $run $mv $output_obj $lobj; then :
739 # Append the name of the PIC object to the libtool object file.
740 test -z "$run" && cat >> ${libobj}T
<<EOF
741 pic_object='$objdir/$objname'
745 # Allow error messages only from the first compilation.
746 if test "$suppress_opt" = yes; then
747 suppress_output
=' >/dev/null 2>&1'
750 # No PIC object so indicate it doesn't exist in the libtool
752 test -z "$run" && cat >> ${libobj}T
<<EOF
758 # Only build a position-dependent object if we build old libraries.
759 if test "$build_old_libs" = yes; then
760 if test "$pic_mode" != yes; then
761 # Don't build PIC code
762 command="$base_compile $srcfile"
764 command="$base_compile $srcfile $pic_flag"
766 if test "$compiler_c_o" = yes; then
767 command="$command -o $obj"
770 # Suppress compiler output if we already did a PIC compilation.
771 command="$command$suppress_output"
772 $run $rm "$obj" "$output_obj"
774 if $run eval "$command"; then :
780 if test "$need_locks" = warn
&&
781 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
783 *** ERROR, $lockfile contains:
784 `cat $lockfile 2>/dev/null`
786 but it should contain:
789 This indicates that another process is trying to use the same
790 temporary object file, and libtool could not work around it because
791 your compiler does not support \`-c' and \`-o' together. If you
792 repeat this compilation, it may succeed, by chance, but you had better
793 avoid parallel builds (make -j) in this platform, or get a better
800 # Just move the object if needed
801 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
802 $show "$mv $output_obj $obj"
803 if $run $mv $output_obj $obj; then :
811 # Append the name of the non-PIC object the libtool object file.
812 # Only append if the libtool object file exists.
813 test -z "$run" && cat >> ${libobj}T
<<EOF
814 # Name of the non-PIC object.
815 non_pic_object='$objname'
819 # Append the name of the non-PIC object the libtool object file.
820 # Only append if the libtool object file exists.
821 test -z "$run" && cat >> ${libobj}T
<<EOF
822 # Name of the non-PIC object.
828 $run $mv "${libobj}T" "${libobj}"
830 # Unlock the critical section if it was locked
831 if test "$need_locks" != no
; then
840 modename
="$modename: link"
842 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
843 # It is impossible to link a dll without this setting, and
844 # we shouldn't force the makefile maintainer to figure out
845 # which system we are compiling for in order to pass an extra
846 # flag for every libtool invocation.
849 # FIXME: Unfortunately, there are problems with the above when trying
850 # to make a dll which has undefined symbols, in which case not
851 # even a static library is built. For now, we need to specify
852 # -no-undefined on the libtool link line when we can be certain
853 # that all symbols are satisfied, otherwise we get a static library.
860 libtool_args
="$nonopt"
861 base_compile
="$nonopt $@"
862 compile_command
="$nonopt"
863 finalize_command
="$nonopt"
876 lib_search_path
=`pwd`
885 export_symbols_regex
=
893 precious_files_regex
=
894 prefer_static_libs
=no
907 # Infer tagged configuration to use if any are available and
908 # if one wasn't chosen via the "--tag" command line option.
909 # Only attempt this if the compiler in the base link
910 # command doesn't match the default compiler.
911 if test -n "$available_tags" && test -z "$tagname"; then
912 case $base_compile in
913 # Blanks in the command may have been stripped by the calling shell,
914 # but not from the CC environment variable when configure was run.
915 "$CC "* |
" $CC "* |
"`$echo $CC` "* |
" `$echo $CC` "*) ;;
916 # Blanks at the start of $base_compile will cause this to fail
917 # if we don't check for them as well.
919 for z
in $available_tags; do
920 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev
/null
; then
921 # Evaluate the configuration.
922 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
923 case $base_compile in
924 "$CC "* |
" $CC "* |
"`$echo $CC` "* |
" `$echo $CC` "*)
925 # The compiler in $compile_command matches
926 # the one in the tagged configuration.
927 # Assume this is the tagged configuration we want.
934 # If $tagname still isn't set, then no tagged configuration
935 # was found and let the user know that the "--tag" command
936 # line option must be used.
937 if test -z "$tagname"; then
938 $echo "$modename: unable to infer tagged configuration"
939 $echo "$modename: specify a tag with \`--tag'" 1>&2
942 # $echo "$modename: using $tagname tagged configuration"
948 # We need to know -static, to get the right output filenames.
952 -all-static |
-static)
953 if test "X$arg" = "X-all-static"; then
954 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
955 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
957 if test -n "$link_static_flag"; then
958 dlopen_self
=$dlopen_self_static
961 if test -z "$pic_flag" && test -n "$link_static_flag"; then
962 dlopen_self
=$dlopen_self_static
965 build_libtool_libs
=no
967 prefer_static_libs
=yes
973 # See if our shared archives depend on static archives.
974 test -n "$old_archive_from_new_cmds" && build_old_libs
=yes
976 # Go through the arguments, transforming them on the way.
977 while test "$#" -gt 0; do
981 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
982 qarg
=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
986 libtool_args
="$libtool_args $qarg"
988 # If the previous option needs an argument, assign it.
989 if test -n "$prev"; then
992 compile_command
="$compile_command @OUTPUT@"
993 finalize_command
="$finalize_command @OUTPUT@"
999 if test "$preload" = no
; then
1000 # Add the symbol object into the linking commands.
1001 compile_command
="$compile_command @SYMFILE@"
1002 finalize_command
="$finalize_command @SYMFILE@"
1006 *.la |
*.lo
) ;; # We handle these cases below.
1008 if test "$dlself" = no
; then
1016 if test "$prev" = dlprefiles
; then
1018 elif test "$prev" = dlfiles
&& test "$dlopen_self" != yes; then
1028 if test "$prev" = dlfiles
; then
1029 dlfiles
="$dlfiles $arg"
1031 dlprefiles
="$dlprefiles $arg"
1039 export_symbols
="$arg"
1040 if test ! -f "$arg"; then
1041 $echo "$modename: symbol file \`$arg' does not exist"
1048 export_symbols_regex
="$arg"
1053 inst_prefix_dir
="$arg"
1058 precious_files_regex
="$arg"
1068 if test -f "$arg"; then
1071 for fil
in `cat $save_arg`
1073 # moreargs="$moreargs $fil"
1075 # A libtool-controlled object.
1077 # Check to see that this really is a libtool object.
1078 if (${SED} -e '2q' $arg |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1083 # If there is no directory component, then add one.
1085 */* |
*\\*) .
$arg ;;
1089 if test -z "$pic_object" || \
1090 test -z "$non_pic_object" ||
1091 test "$pic_object" = none
&& \
1092 test "$non_pic_object" = none
; then
1093 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1097 # Extract subdirectory from the argument.
1098 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1099 if test "X$xdir" = "X$arg"; then
1105 if test "$pic_object" != none
; then
1106 # Prepend the subdirectory the object is found in.
1107 pic_object
="$xdir$pic_object"
1109 if test "$prev" = dlfiles
; then
1110 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1111 dlfiles
="$dlfiles $pic_object"
1115 # If libtool objects are unsupported, then we need to preload.
1120 # CHECK ME: I think I busted this. -Ossama
1121 if test "$prev" = dlprefiles
; then
1122 # Preload the old-style object.
1123 dlprefiles
="$dlprefiles $pic_object"
1128 libobjs
="$libobjs $pic_object"
1133 if test "$non_pic_object" != none
; then
1134 # Prepend the subdirectory the object is found in.
1135 non_pic_object
="$xdir$non_pic_object"
1137 # A standard non-PIC object
1138 non_pic_objects
="$non_pic_objects $non_pic_object"
1139 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1140 arg
="$non_pic_object"
1144 # Only an error if not doing a dry-run.
1145 if test -z "$run"; then
1146 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1151 # Extract subdirectory from the argument.
1152 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1153 if test "X$xdir" = "X$arg"; then
1159 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1160 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1161 libobjs
="$libobjs $pic_object"
1162 non_pic_objects
="$non_pic_objects $non_pic_object"
1167 $echo "$modename: link input file \`$save_arg' does not exist"
1175 # We need an absolute path.
1177 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1179 $echo "$modename: only absolute run-paths are allowed" 1>&2
1183 if test "$prev" = rpath
; then
1186 *) rpath
="$rpath $arg" ;;
1191 *) xrpath
="$xrpath $arg" ;;
1198 compiler_flags
="$compiler_flags $qarg"
1200 compile_command
="$compile_command $qarg"
1201 finalize_command
="$finalize_command $qarg"
1205 linker_flags
="$linker_flags $qarg"
1206 compiler_flags
="$compiler_flags $wl$qarg"
1208 compile_command
="$compile_command $wl$qarg"
1209 finalize_command
="$finalize_command $wl$qarg"
1213 linker_flags
="$linker_flags $qarg"
1214 compiler_flags
="$compiler_flags $qarg"
1216 compile_command
="$compile_command $qarg"
1217 finalize_command
="$finalize_command $qarg"
1221 eval "$prev=\"\$arg\""
1226 fi # test -n "$prev"
1232 if test -n "$link_static_flag"; then
1233 compile_command
="$compile_command $link_static_flag"
1234 finalize_command
="$finalize_command $link_static_flag"
1240 # FIXME: remove this flag sometime in the future.
1241 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1265 -export-symbols |
-export-symbols-regex)
1266 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
1267 $echo "$modename: more than one -exported-symbols argument is not allowed"
1270 if test "X$arg" = "X-export-symbols"; then
1283 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1284 # so, if we see these flags be careful not to treat them like -L
1286 case $with_gcc/$host in
1287 no
/*-*-irix* |
/*-*-irix*)
1288 compile_command
="$compile_command $arg"
1289 finalize_command
="$finalize_command $arg"
1296 dir
=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1297 # We need an absolute path.
1299 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1301 absdir
=`cd "$dir" && pwd`
1302 if test -z "$absdir"; then
1303 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1312 deplibs
="$deplibs -L$dir"
1313 lib_search_path
="$lib_search_path $dir"
1317 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1318 case :$dllsearchpath: in
1320 *) dllsearchpath
="$dllsearchpath:$dir";;
1328 if test "X$arg" = "X-lc" ||
test "X$arg" = "X-lm"; then
1330 *-*-cygwin* |
*-*-pw32* |
*-*-beos*)
1331 # These systems don't actually have a C or math library (as such)
1334 *-*-mingw* |
*-*-os2*)
1335 # These systems don't actually have a C library (as such)
1336 test "X$arg" = "X-lc" && continue
1338 *-*-openbsd* |
*-*-freebsd*)
1339 # Do not include libc due to us having libc/libc_r.
1340 test "X$arg" = "X-lc" && continue
1342 *-*-rhapsody* |
*-*-darwin1.
[012])
1343 # Rhapsody C and math libraries are in the System framework
1344 deplibs
="$deplibs -framework System"
1347 elif test "X$arg" = "X-lc_r"; then
1349 *-*-openbsd* |
*-*-freebsd*)
1350 # Do not include libc_r directly, use -pthread flag.
1355 deplibs
="$deplibs $arg"
1359 -mt|
-mthreads|
-kthread|
-Kthread|
-pthread|
-pthreads|
--thread-safe)
1360 deplibs
="$deplibs $arg"
1369 # gcc -m* arguments should be passed to the linker via $compiler_flags
1370 # in order to pass architecture information to the linker
1371 # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
1372 # but this is not reliable with gcc because gcc may use -mfoo to
1373 # select a different linker, different libraries, etc, while
1374 # -Wl,-mfoo simply passes -mfoo to the linker.
1376 # Unknown arguments in both finalize_command and compile_command need
1377 # to be aesthetically quoted because they are evaled later.
1378 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1380 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1384 compile_command
="$compile_command $arg"
1385 finalize_command
="$finalize_command $arg"
1386 if test "$with_gcc" = "yes" ; then
1387 compiler_flags
="$compiler_flags $arg"
1404 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1405 # The PATH hackery in wrapper scripts is required on Windows
1406 # in order for the loader to find any dlls it needs.
1407 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1408 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1411 *) no_install
=yes ;;
1428 -precious-files-regex)
1449 dir
=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1450 # We need an absolute path.
1452 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1454 $echo "$modename: only absolute run-paths are allowed" 1>&2
1460 *) xrpath
="$xrpath $dir" ;;
1466 # The effects of -static are defined in a previous loop.
1467 # We used to do the same as -all-static on platforms that
1468 # didn't have a PIC flag, but the assumption that the effects
1469 # would be equivalent was wrong. It would break on at least
1470 # Digital Unix and AIX.
1490 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1492 save_ifs
="$IFS"; IFS
=','
1493 for flag
in $args; do
1496 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1501 compiler_flags
="$compiler_flags $flag"
1504 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1508 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1510 save_ifs
="$IFS"; IFS
=','
1511 for flag
in $args; do
1514 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1519 compiler_flags
="$compiler_flags $wl$flag"
1520 linker_flags
="$linker_flags $flag"
1523 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1541 # Some other compiler flag.
1543 # Unknown arguments in both finalize_command and compile_command need
1544 # to be aesthetically quoted because they are evaled later.
1545 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1547 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1554 # A standard object.
1559 # A libtool-controlled object.
1561 # Check to see that this really is a libtool object.
1562 if (${SED} -e '2q' $arg |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1567 # If there is no directory component, then add one.
1569 */* |
*\\*) .
$arg ;;
1573 if test -z "$pic_object" || \
1574 test -z "$non_pic_object" ||
1575 test "$pic_object" = none
&& \
1576 test "$non_pic_object" = none
; then
1577 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1581 # Extract subdirectory from the argument.
1582 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1583 if test "X$xdir" = "X$arg"; then
1589 if test "$pic_object" != none
; then
1590 # Prepend the subdirectory the object is found in.
1591 pic_object
="$xdir$pic_object"
1593 if test "$prev" = dlfiles
; then
1594 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1595 dlfiles
="$dlfiles $pic_object"
1599 # If libtool objects are unsupported, then we need to preload.
1604 # CHECK ME: I think I busted this. -Ossama
1605 if test "$prev" = dlprefiles
; then
1606 # Preload the old-style object.
1607 dlprefiles
="$dlprefiles $pic_object"
1612 libobjs
="$libobjs $pic_object"
1617 if test "$non_pic_object" != none
; then
1618 # Prepend the subdirectory the object is found in.
1619 non_pic_object
="$xdir$non_pic_object"
1621 # A standard non-PIC object
1622 non_pic_objects
="$non_pic_objects $non_pic_object"
1623 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1624 arg
="$non_pic_object"
1628 # Only an error if not doing a dry-run.
1629 if test -z "$run"; then
1630 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1635 # Extract subdirectory from the argument.
1636 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1637 if test "X$xdir" = "X$arg"; then
1643 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1644 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1645 libobjs
="$libobjs $pic_object"
1646 non_pic_objects
="$non_pic_objects $non_pic_object"
1653 deplibs
="$deplibs $arg"
1654 old_deplibs
="$old_deplibs $arg"
1659 # A libtool-controlled library.
1661 if test "$prev" = dlfiles
; then
1662 # This library was specified with -dlopen.
1663 dlfiles
="$dlfiles $arg"
1665 elif test "$prev" = dlprefiles
; then
1666 # The library was specified with -dlpreopen.
1667 dlprefiles
="$dlprefiles $arg"
1670 deplibs
="$deplibs $arg"
1675 # Some other compiler argument.
1677 # Unknown arguments in both finalize_command and compile_command need
1678 # to be aesthetically quoted because they are evaled later.
1679 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1681 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1688 # Now actually substitute the argument into the commands.
1689 if test -n "$arg"; then
1690 compile_command
="$compile_command $arg"
1691 finalize_command
="$finalize_command $arg"
1693 done # argument parsing loop
1695 if test -n "$prev"; then
1696 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1701 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1702 eval arg
=\"$export_dynamic_flag_spec\"
1703 compile_command
="$compile_command $arg"
1704 finalize_command
="$finalize_command $arg"
1708 # calculate the name of the file, without its directory
1709 outputname
=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1710 libobjs_save
="$libobjs"
1712 if test -n "$shlibpath_var"; then
1713 # get the directories listed in $shlibpath_var
1714 eval shlib_search_path
=\
`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1718 eval sys_lib_search_path
=\"$sys_lib_search_path_spec\"
1719 eval sys_lib_dlsearch_path
=\"$sys_lib_dlsearch_path_spec\"
1721 output_objdir
=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1722 if test "X$output_objdir" = "X$output"; then
1723 output_objdir
="$objdir"
1725 output_objdir
="$output_objdir/$objdir"
1727 # Create the object directory.
1728 if test ! -d "$output_objdir"; then
1729 $show "$mkdir $output_objdir"
1730 $run $mkdir $output_objdir
1732 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1737 # Determine the type of output
1740 $echo "$modename: you must specify an output file" 1>&2
1744 *.
$libext) linkmode
=oldlib
;;
1745 *.lo |
*.
$objext) linkmode
=obj
;;
1746 *.la
) linkmode
=lib
;;
1747 *) linkmode
=prog
;; # Anything else should be a program.
1751 *cygwin
* |
*mingw
* |
*pw32
*)
1752 # don't eliminate duplcations in $postdeps and $predeps
1753 duplicate_compiler_generated_deps
=yes
1756 duplicate_compiler_generated_deps
=$duplicate_deps
1762 # Find all interdependent deplibs by searching for libraries
1763 # that are linked more than once (e.g. -la -lb -la)
1764 for deplib
in $deplibs; do
1765 if test "X$duplicate_deps" = "Xyes" ; then
1767 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
1770 libs
="$libs $deplib"
1773 if test "$linkmode" = lib
; then
1774 libs
="$predeps $libs $compiler_lib_search_path $postdeps"
1776 # Compute libraries that are listed more than once in $predeps
1777 # $postdeps and mark them as special (i.e., whose duplicates are
1778 # not to be eliminated).
1780 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
1781 for pre_post_dep
in $predeps $postdeps; do
1782 case "$pre_post_deps " in
1783 *" $pre_post_dep "*) specialdeplibs
="$specialdeplibs $pre_post_deps" ;;
1785 pre_post_deps
="$pre_post_deps $pre_post_dep"
1794 need_relink
=no
# whether we're linking any uninstalled libtool libraries
1795 notinst_deplibs
= # not-installed libtool libraries
1796 notinst_path
= # paths that contain not-installed libtool libraries
1800 for file in $dlfiles $dlprefiles; do
1804 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1816 passes
="conv scan dlopen dlpreopen link"
1821 for pass
in $passes; do
1822 if test "$linkmode,$pass" = "lib,link" ||
1823 test "$linkmode,$pass" = "prog,scan"; then
1827 if test "$linkmode" = prog
; then
1829 dlopen
) libs
="$dlfiles" ;;
1830 dlpreopen
) libs
="$dlprefiles" ;;
1831 link
) libs
="$deplibs %DEPLIBS% $dependency_libs" ;;
1834 if test "$pass" = dlopen
; then
1835 # Collect dlpreopened libraries
1836 save_deplibs
="$deplibs"
1839 for deplib
in $libs; do
1843 -mt|
-mthreads|
-kthread|
-Kthread|
-pthread|
-pthreads|
--thread-safe)
1844 if test "$linkmode,$pass" = "prog,link"; then
1845 compile_deplibs
="$deplib $compile_deplibs"
1846 finalize_deplibs
="$deplib $finalize_deplibs"
1848 deplibs
="$deplib $deplibs"
1853 if test "$linkmode" != lib
&& test "$linkmode" != prog
; then
1854 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1857 if test "$pass" = conv
; then
1858 deplibs
="$deplib $deplibs"
1861 name
=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1862 for searchdir
in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1863 for search_ext
in .la
$shrext .so .a
; do
1864 # Search the libtool library
1865 lib
="$searchdir/lib${name}${search_ext}"
1866 if test -f "$lib"; then
1867 if test "$search_ext" = ".la"; then
1876 if test "$found" != yes; then
1877 # deplib doesn't seem to be a libtool library
1878 if test "$linkmode,$pass" = "prog,link"; then
1879 compile_deplibs
="$deplib $compile_deplibs"
1880 finalize_deplibs
="$deplib $finalize_deplibs"
1882 deplibs
="$deplib $deplibs"
1883 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
1886 else # deplib is a libtool library
1887 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
1888 # We need to do some special things here, and not later.
1889 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
1890 case " $predeps $postdeps " in
1892 if (${SED} -e '2q' $lib |
1893 grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1897 */* |
*\\*) .
$lib ;;
1900 for l
in $old_library $library_names; do
1903 if test "X$ll" = "X$old_library" ; then # only static version available
1905 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1906 test "X$ladir" = "X$lib" && ladir
="."
1907 lib
=$ladir/$old_library
1908 if test "$linkmode,$pass" = "prog,link"; then
1909 compile_deplibs
="$deplib $compile_deplibs"
1910 finalize_deplibs
="$deplib $finalize_deplibs"
1912 deplibs
="$deplib $deplibs"
1913 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
1927 deplibs
="$deplib $deplibs"
1928 test "$pass" = conv
&& continue
1929 newdependency_libs
="$deplib $newdependency_libs"
1930 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1933 if test "$pass" = conv
; then
1934 deplibs
="$deplib $deplibs"
1937 if test "$pass" = scan
; then
1938 deplibs
="$deplib $deplibs"
1939 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1941 compile_deplibs
="$deplib $compile_deplibs"
1942 finalize_deplibs
="$deplib $finalize_deplibs"
1946 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1952 if test "$pass" = link
; then
1953 dir
=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1954 # Make sure the xrpath contains only unique directories.
1957 *) xrpath
="$xrpath $dir" ;;
1960 deplibs
="$deplib $deplibs"
1963 *.la
) lib
="$deplib" ;;
1965 if test "$pass" = conv
; then
1966 deplibs
="$deplib $deplibs"
1971 if test "$deplibs_check_method" != pass_all
; then
1973 $echo "*** Warning: Trying to link with static lib archive $deplib."
1974 $echo "*** I have the capability to make that library automatically link in when"
1975 $echo "*** you link to this library. But I can only do this if you have a"
1976 $echo "*** shared version of the library, which you do not appear to have"
1977 $echo "*** because the file extensions .$libext of this argument makes me believe"
1978 $echo "*** that it is just a static archive that I should not used here."
1981 $echo "*** Warning: Linking the shared library $output against the"
1982 $echo "*** static library $deplib is not portable!"
1983 deplibs
="$deplib $deplibs"
1988 if test "$pass" != link
; then
1989 deplibs
="$deplib $deplibs"
1991 compile_deplibs
="$deplib $compile_deplibs"
1992 finalize_deplibs
="$deplib $finalize_deplibs"
1999 if test "$pass" = conv
; then
2000 deplibs
="$deplib $deplibs"
2001 elif test "$linkmode" = prog
; then
2002 if test "$pass" = dlpreopen ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
2003 # If there is no dlopen support or we're linking statically,
2004 # we need to preload.
2005 newdlprefiles
="$newdlprefiles $deplib"
2006 compile_deplibs
="$deplib $compile_deplibs"
2007 finalize_deplibs
="$deplib $finalize_deplibs"
2009 newdlfiles
="$newdlfiles $deplib"
2019 if test "$found" = yes ||
test -f "$lib"; then :
2021 $echo "$modename: cannot find the library \`$lib'" 1>&2
2025 # Check to see that this really is a libtool archive.
2026 if (${SED} -e '2q' $lib |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
2028 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2032 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2033 test "X$ladir" = "X$lib" && ladir
="."
2041 # If the library was installed with an old release of libtool,
2042 # it will not redefine variables installed, or shouldnotlink
2048 */* |
*\\*) .
$lib ;;
2052 if test "$linkmode,$pass" = "lib,link" ||
2053 test "$linkmode,$pass" = "prog,scan" ||
2054 { test "$linkmode" != prog
&& test "$linkmode" != lib
; }; then
2055 test -n "$dlopen" && dlfiles
="$dlfiles $dlopen"
2056 test -n "$dlpreopen" && dlprefiles
="$dlprefiles $dlpreopen"
2059 if test "$pass" = conv
; then
2060 # Only check for convenience libraries
2061 deplibs
="$lib $deplibs"
2062 if test -z "$libdir"; then
2063 if test -z "$old_library"; then
2064 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2067 # It is a libtool convenience library, so add in its objects.
2068 convenience
="$convenience $ladir/$objdir/$old_library"
2069 old_convenience
="$old_convenience $ladir/$objdir/$old_library"
2071 for deplib
in $dependency_libs; do
2072 deplibs
="$deplib $deplibs"
2073 if test "X$duplicate_deps" = "Xyes" ; then
2074 case "$tmp_libs " in
2075 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2078 tmp_libs
="$tmp_libs $deplib"
2080 elif test "$linkmode" != prog
&& test "$linkmode" != lib
; then
2081 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2088 # Get the name of the library we link against.
2090 for l
in $old_library $library_names; do
2093 if test -z "$linklib"; then
2094 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2098 # This library was specified with -dlopen.
2099 if test "$pass" = dlopen
; then
2100 if test -z "$libdir"; then
2101 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2104 if test -z "$dlname" ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
2105 # If there is no dlname, no dlopen support or we're linking
2106 # statically, we need to preload. We also need to preload any
2107 # dependent libraries so libltdl's deplib preloader doesn't
2108 # bomb out in the load deplibs phase.
2109 dlprefiles
="$dlprefiles $lib $dependency_libs"
2111 newdlfiles
="$newdlfiles $lib"
2116 # We need an absolute path.
2118 [\\/]* |
[A-Za-z
]:[\\/]*) abs_ladir
="$ladir" ;;
2120 abs_ladir
=`cd "$ladir" && pwd`
2121 if test -z "$abs_ladir"; then
2122 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2123 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2128 laname
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2130 # Find the relevant object directory and library name.
2131 if test "X$installed" = Xyes
; then
2132 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2133 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2142 dir
="$ladir/$objdir"
2143 absdir
="$abs_ladir/$objdir"
2144 # Remove this search path later
2145 notinst_path
="$notinst_path $abs_ladir"
2146 fi # $installed = yes
2147 name
=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2149 # This library was specified with -dlpreopen.
2150 if test "$pass" = dlpreopen
; then
2151 if test -z "$libdir"; then
2152 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2155 # Prefer using a static library (so that no silly _DYNAMIC symbols
2156 # are required to link).
2157 if test -n "$old_library"; then
2158 newdlprefiles
="$newdlprefiles $dir/$old_library"
2159 # Otherwise, use the dlname, so that lt_dlopen finds it.
2160 elif test -n "$dlname"; then
2161 newdlprefiles
="$newdlprefiles $dir/$dlname"
2163 newdlprefiles
="$newdlprefiles $dir/$linklib"
2165 fi # $pass = dlpreopen
2167 if test -z "$libdir"; then
2168 # Link the convenience library
2169 if test "$linkmode" = lib
; then
2170 deplibs
="$dir/$old_library $deplibs"
2171 elif test "$linkmode,$pass" = "prog,link"; then
2172 compile_deplibs
="$dir/$old_library $compile_deplibs"
2173 finalize_deplibs
="$dir/$old_library $finalize_deplibs"
2175 deplibs
="$lib $deplibs" # used for prog,scan pass
2181 if test "$linkmode" = prog
&& test "$pass" != link
; then
2182 newlib_search_path
="$newlib_search_path $ladir"
2183 deplibs
="$lib $deplibs"
2186 if test "$link_all_deplibs" != no ||
test -z "$library_names" ||
2187 test "$build_libtool_libs" = no
; then
2192 for deplib
in $dependency_libs; do
2194 -L*) newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2196 # Need to link against all dependency_libs?
2197 if test "$linkalldeplibs" = yes; then
2198 deplibs
="$deplib $deplibs"
2200 # Need to hardcode shared library paths
2201 # or/and link against static libraries
2202 newdependency_libs
="$deplib $newdependency_libs"
2204 if test "X$duplicate_deps" = "Xyes" ; then
2205 case "$tmp_libs " in
2206 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2209 tmp_libs
="$tmp_libs $deplib"
2212 fi # $linkmode = prog...
2214 if test "$linkmode,$pass" = "prog,link"; then
2215 if test -n "$library_names" &&
2216 { test "$prefer_static_libs" = no ||
test -z "$old_library"; }; then
2217 # We need to hardcode the library path
2218 if test -n "$shlibpath_var"; then
2219 # Make sure the rpath contains only unique directories.
2220 case "$temp_rpath " in
2223 *) temp_rpath
="$temp_rpath $dir" ;;
2227 # Hardcode the library path.
2228 # Skip directories that are in the system default run-time
2230 case " $sys_lib_dlsearch_path " in
2233 case "$compile_rpath " in
2235 *) compile_rpath
="$compile_rpath $absdir"
2239 case " $sys_lib_dlsearch_path " in
2242 case "$finalize_rpath " in
2244 *) finalize_rpath
="$finalize_rpath $libdir"
2248 fi # $linkmode,$pass = prog,link...
2250 if test "$alldeplibs" = yes &&
2251 { test "$deplibs_check_method" = pass_all ||
2252 { test "$build_libtool_libs" = yes &&
2253 test -n "$library_names"; }; }; then
2254 # We only need to search for static libraries
2259 link_static
=no
# Whether the deplib will be linked statically
2260 if test -n "$library_names" &&
2261 { test "$prefer_static_libs" = no ||
test -z "$old_library"; }; then
2262 if test "$installed" = no
; then
2263 notinst_deplibs
="$notinst_deplibs $lib"
2266 # This is a shared library
2268 # Warn about portability, can't link against -module's on some systems (darwin)
2269 if test "$shouldnotlink" = yes && test "$pass" = link
; then
2271 if test "$linkmode" = prog
; then
2272 $echo "*** Warning: Linking the executable $output against the loadable module"
2274 $echo "*** Warning: Linking the shared library $output against the loadable module"
2276 $echo "*** $linklib is not portable!"
2278 if test "$linkmode" = lib
&&
2279 test "$hardcode_into_libs" = yes; then
2280 # Hardcode the library path.
2281 # Skip directories that are in the system default run-time
2283 case " $sys_lib_dlsearch_path " in
2286 case "$compile_rpath " in
2288 *) compile_rpath
="$compile_rpath $absdir"
2292 case " $sys_lib_dlsearch_path " in
2295 case "$finalize_rpath " in
2297 *) finalize_rpath
="$finalize_rpath $libdir"
2303 if test -n "$old_archive_from_expsyms_cmds"; then
2304 # figure out the soname
2305 set dummy
$library_names
2308 libname
=`eval \\$echo \"$libname_spec\"`
2309 # use dlname if we got it. it's perfectly good, no?
2310 if test -n "$dlname"; then
2312 elif test -n "$soname_spec"; then
2316 major
=`expr $current - $age`
2320 eval soname
=\"$soname_spec\"
2325 # Make a new name for the extract_expsyms_cmds to use
2327 soname
=`$echo $soroot | ${SED} -e 's/^.*\///'`
2328 newlib
="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2330 # If the library has no export list, then create one now
2331 if test -f "$output_objdir/$soname-def"; then :
2333 $show "extracting exported symbol list from \`$soname'"
2334 save_ifs
="$IFS"; IFS
='~'
2335 cmds
=$extract_expsyms_cmds
2336 for cmd
in $cmds; do
2340 $run eval "$cmd" ||
exit $?
2346 if test -f "$output_objdir/$newlib"; then :; else
2347 $show "generating import library for \`$soname'"
2348 save_ifs
="$IFS"; IFS
='~'
2349 cmds
=$old_archive_from_expsyms_cmds
2350 for cmd
in $cmds; do
2354 $run eval "$cmd" ||
exit $?
2358 # make sure the library variables are pointing to the new library
2361 fi # test -n "$old_archive_from_expsyms_cmds"
2363 if test "$linkmode" = prog ||
test "$mode" != relink
; then
2368 case $hardcode_action in
2369 immediate | unsupported
)
2370 if test "$hardcode_direct" = no
; then
2373 *-*-sco3.2v5
* ) add_dir
="-L$dir" ;;
2375 # if the lib is a module then we can not link against it, someone
2376 # is ignoring the new warnings I added
2377 if /usr
/bin
/file -L $add 2> /dev
/null |
grep "bundle" >/dev
/null
; then
2378 $echo "** Warning, lib $linklib is a module, not a shared library"
2379 if test -z "$old_library" ; then
2381 $echo "** And there doesn't seem to be a static archive available"
2382 $echo "** The link will probably fail, sorry"
2384 add
="$dir/$old_library"
2388 elif test "$hardcode_minus_L" = no
; then
2390 *-*-sunos*) add_shlibpath
="$dir" ;;
2394 elif test "$hardcode_shlibpath_var" = no
; then
2395 add_shlibpath
="$dir"
2402 if test "$hardcode_direct" = yes; then
2404 elif test "$hardcode_minus_L" = yes; then
2406 # Try looking first in the location we're being installed to.
2407 if test -n "$inst_prefix_dir"; then
2410 add_dir
="$add_dir -L$inst_prefix_dir$libdir"
2415 elif test "$hardcode_shlibpath_var" = yes; then
2416 add_shlibpath
="$dir"
2425 if test "$lib_linked" != yes; then
2426 $echo "$modename: configuration error: unsupported hardcode properties"
2430 if test -n "$add_shlibpath"; then
2431 case :$compile_shlibpath: in
2432 *":$add_shlibpath:"*) ;;
2433 *) compile_shlibpath
="$compile_shlibpath$add_shlibpath:" ;;
2436 if test "$linkmode" = prog
; then
2437 test -n "$add_dir" && compile_deplibs
="$add_dir $compile_deplibs"
2438 test -n "$add" && compile_deplibs
="$add $compile_deplibs"
2440 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2441 test -n "$add" && deplibs
="$add $deplibs"
2442 if test "$hardcode_direct" != yes && \
2443 test "$hardcode_minus_L" != yes && \
2444 test "$hardcode_shlibpath_var" = yes; then
2445 case :$finalize_shlibpath: in
2447 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2453 if test "$linkmode" = prog ||
test "$mode" = relink
; then
2457 # Finalize command for both is simple: just hardcode it.
2458 if test "$hardcode_direct" = yes; then
2459 add
="$libdir/$linklib"
2460 elif test "$hardcode_minus_L" = yes; then
2463 elif test "$hardcode_shlibpath_var" = yes; then
2464 case :$finalize_shlibpath: in
2466 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2469 elif test "$hardcode_automatic" = yes; then
2470 if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then
2471 add
="$inst_prefix_dir$libdir/$linklib"
2473 add
="$libdir/$linklib"
2476 # We cannot seem to hardcode it, guess we'll fake it.
2478 # Try looking first in the location we're being installed to.
2479 if test -n "$inst_prefix_dir"; then
2482 add_dir
="$add_dir -L$inst_prefix_dir$libdir"
2489 if test "$linkmode" = prog
; then
2490 test -n "$add_dir" && finalize_deplibs
="$add_dir $finalize_deplibs"
2491 test -n "$add" && finalize_deplibs
="$add $finalize_deplibs"
2493 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2494 test -n "$add" && deplibs
="$add $deplibs"
2497 elif test "$linkmode" = prog
; then
2498 # Here we assume that one of hardcode_direct or hardcode_minus_L
2499 # is not unsupported. This is valid on all known static and
2501 if test "$hardcode_direct" != unsupported
; then
2502 test -n "$old_library" && linklib
="$old_library"
2503 compile_deplibs
="$dir/$linklib $compile_deplibs"
2504 finalize_deplibs
="$dir/$linklib $finalize_deplibs"
2506 compile_deplibs
="-l$name -L$dir $compile_deplibs"
2507 finalize_deplibs
="-l$name -L$dir $finalize_deplibs"
2509 elif test "$build_libtool_libs" = yes; then
2510 # Not a shared library
2511 if test "$deplibs_check_method" != pass_all
; then
2512 # We're trying link a shared library against a static one
2513 # but the system doesn't support it.
2515 # Just print a warning and add the library to dependency_libs so
2516 # that the program can be linked against the static library.
2518 $echo "*** Warning: This system can not link to static lib archive $lib."
2519 $echo "*** I have the capability to make that library automatically link in when"
2520 $echo "*** you link to this library. But I can only do this if you have a"
2521 $echo "*** shared version of the library, which you do not appear to have."
2522 if test "$module" = yes; then
2523 $echo "*** But as you try to build a module library, libtool will still create "
2524 $echo "*** a static module, that should work as long as the dlopening application"
2525 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2526 if test -z "$global_symbol_pipe"; then
2528 $echo "*** However, this would only work if libtool was able to extract symbol"
2529 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2530 $echo "*** not find such a program. So, this module is probably useless."
2531 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2533 if test "$build_old_libs" = no
; then
2534 build_libtool_libs
=module
2537 build_libtool_libs
=no
2541 convenience
="$convenience $dir/$old_library"
2542 old_convenience
="$old_convenience $dir/$old_library"
2543 deplibs
="$dir/$old_library $deplibs"
2546 fi # link shared/static library?
2548 if test "$linkmode" = lib
; then
2549 if test -n "$dependency_libs" &&
2550 { test "$hardcode_into_libs" != yes ||
test "$build_old_libs" = yes ||
2551 test "$link_static" = yes; }; then
2552 # Extract -R from dependency_libs
2554 for libdir
in $dependency_libs; do
2556 -R*) temp_xrpath
=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2558 *" $temp_xrpath "*) ;;
2559 *) xrpath
="$xrpath $temp_xrpath";;
2561 *) temp_deplibs
="$temp_deplibs $libdir";;
2564 dependency_libs
="$temp_deplibs"
2567 newlib_search_path
="$newlib_search_path $absdir"
2568 # Link against this library
2569 test "$link_static" = no
&& newdependency_libs
="$abs_ladir/$laname $newdependency_libs"
2570 # ... and its dependency_libs
2572 for deplib
in $dependency_libs; do
2573 newdependency_libs
="$deplib $newdependency_libs"
2574 if test "X$duplicate_deps" = "Xyes" ; then
2575 case "$tmp_libs " in
2576 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2579 tmp_libs
="$tmp_libs $deplib"
2582 if test "$link_all_deplibs" != no
; then
2583 # Add the search paths of all dependency libraries
2584 for deplib
in $dependency_libs; do
2586 -L*) path
="$deplib" ;;
2588 dir
=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2589 test "X$dir" = "X$deplib" && dir
="."
2590 # We need an absolute path.
2592 [\\/]* |
[A-Za-z
]:[\\/]*) absdir
="$dir" ;;
2594 absdir
=`cd "$dir" && pwd`
2595 if test -z "$absdir"; then
2596 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2601 if grep "^installed=no" $deplib > /dev
/null
; then
2602 path
="$absdir/$objdir"
2604 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2605 if test -z "$libdir"; then
2606 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2609 if test "$absdir" != "$libdir"; then
2610 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2617 # we do not want to link against static libs, but need to link against shared
2618 eval deplibrary_names
=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2619 if test -n "$deplibrary_names" ; then
2620 for tmp
in $deplibrary_names ; do
2623 if test -f "$path/$depdepl" ; then
2624 depdepl
="$path/$depdepl"
2626 # do not add paths which are already there
2627 case " $newlib_search_path " in
2629 *) newlib_search_path
="$newlib_search_path $path";;
2643 # Again, we only want to link against shared libraries
2644 eval tmp_libs
=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2645 for tmp
in $newlib_search_path ; do
2646 if test -f "$tmp/lib$tmp_libs.dylib" ; then
2647 eval depdepl
="$tmp/lib$tmp_libs.dylib"
2658 case " $deplibs " in
2660 *) deplibs
="$deplibs $depdepl" ;;
2662 case " $deplibs " in
2664 *) deplibs
="$deplibs $path" ;;
2667 fi # link_all_deplibs != no
2669 done # for deplib in $libs
2670 dependency_libs
="$newdependency_libs"
2671 if test "$pass" = dlpreopen
; then
2672 # Link the dlpreopened libraries before other libraries
2673 for deplib
in $save_deplibs; do
2674 deplibs
="$deplib $deplibs"
2677 if test "$pass" != dlopen
; then
2678 if test "$pass" != conv
; then
2679 # Make sure lib_search_path contains only unique directories.
2681 for dir
in $newlib_search_path; do
2682 case "$lib_search_path " in
2684 *) lib_search_path
="$lib_search_path $dir" ;;
2690 if test "$linkmode,$pass" != "prog,link"; then
2693 vars
="compile_deplibs finalize_deplibs"
2695 for var
in $vars dependency_libs
; do
2696 # Add libraries to $var in reverse order
2697 eval tmp_libs
=\"\$
$var\"
2699 for deplib
in $tmp_libs; do
2700 # FIXME: Pedantically, this is the right thing to do, so
2701 # that some nasty dependency loop isn't accidentally
2703 #new_libs="$deplib $new_libs"
2704 # Pragmatically, this seems to cause very few problems in
2707 -L*) new_libs
="$deplib $new_libs" ;;
2710 # And here is the reason: when a library appears more
2711 # than once as an explicit dependence of a library, or
2712 # is implicitly linked in more than once by the
2713 # compiler, it is considered special, and multiple
2714 # occurrences thereof are not removed. Compare this
2715 # with having the same library being listed as a
2716 # dependency of multiple other libraries: in this case,
2717 # we know (pedantically, we assume) the library does not
2718 # need to be listed more than once, so we keep only the
2719 # last copy. This is not always right, but it is rare
2720 # enough that we require users that really mean to play
2721 # such unportable linking tricks to link the library
2722 # using -Wl,-lname, so that libtool does not consider it
2723 # for duplicate removal.
2724 case " $specialdeplibs " in
2725 *" $deplib "*) new_libs
="$deplib $new_libs" ;;
2727 case " $new_libs " in
2729 *) new_libs
="$deplib $new_libs" ;;
2737 for deplib
in $new_libs; do
2740 case " $tmp_libs " in
2742 *) tmp_libs
="$tmp_libs $deplib" ;;
2745 *) tmp_libs
="$tmp_libs $deplib" ;;
2748 eval $var=\"$tmp_libs\"
2751 # Last step: remove runtime libs from dependency_libs (they stay in deplibs)
2753 for i
in $dependency_libs ; do
2754 case " $predeps $postdeps $compiler_lib_search_path " in
2759 if test -n "$i" ; then
2760 tmp_libs
="$tmp_libs $i"
2763 dependency_libs
=$tmp_libs
2765 if test "$linkmode" = prog
; then
2766 dlfiles
="$newdlfiles"
2767 dlprefiles
="$newdlprefiles"
2772 if test -n "$deplibs"; then
2773 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2776 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
2777 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2780 if test -n "$rpath"; then
2781 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2784 if test -n "$xrpath"; then
2785 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2788 if test -n "$vinfo"; then
2789 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
2792 if test -n "$release"; then
2793 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2796 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
2797 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2800 # Now set the variables for building old libraries.
2801 build_libtool_libs
=no
2803 objs
="$objs$old_deplibs"
2807 # Make sure we only generate libraries of the form `libNAME.la'.
2810 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2811 eval shared_ext
=\"$shrext\"
2812 eval libname
=\"$libname_spec\"
2815 if test "$module" = no
; then
2816 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2820 if test "$need_lib_prefix" != no
; then
2821 # Add the "lib" prefix for modules if required
2822 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2823 eval shared_ext
=\"$shrext\"
2824 eval libname
=\"$libname_spec\"
2826 libname
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2831 if test -n "$objs"; then
2832 if test "$deplibs_check_method" != pass_all
; then
2833 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2837 $echo "*** Warning: Linking the shared library $output against the non-libtool"
2838 $echo "*** objects $objs is not portable!"
2839 libobjs
="$libobjs $objs"
2843 if test "$dlself" != no
; then
2844 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2848 if test "$#" -gt 2; then
2849 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2854 if test -z "$rpath"; then
2855 if test "$build_libtool_libs" = yes; then
2856 # Building a libtool convenience library.
2857 # Some compilers have problems with a `.al' extension so
2858 # convenience libraries should have the same extension an
2859 # archive normally would.
2860 oldlibs
="$output_objdir/$libname.$libext $oldlibs"
2861 build_libtool_libs
=convenience
2865 if test -n "$vinfo"; then
2866 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
2869 if test -n "$release"; then
2870 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2874 # Parse the version information argument.
2875 save_ifs
="$IFS"; IFS
=':'
2876 set dummy
$vinfo 0 0 0
2879 if test -n "$8"; then
2880 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2885 # convert absolute version numbers to libtool ages
2886 # this retains compatibility with .la files and attempts
2887 # to make the code below a bit more comprehensible
2889 case $vinfo_number in
2893 number_revision
="$4"
2895 # There are really only two kinds -- those that
2896 # use the current revision as the major version
2897 # and those that subtract age and use age as
2898 # a minor version. But, then there is irix
2899 # which has an extra 1 added just for fun
2901 case $version_type in
2902 darwin|linux|osf|windows
)
2903 current
=`expr $number_major + $number_minor`
2905 revision
="$number_revision"
2907 freebsd-aout|freebsd-elf|sunos
)
2908 current
="$number_major"
2909 revision
="$number_minor"
2913 current
=`expr $number_major + $number_minor - 1`
2915 revision
="$number_minor"
2926 # Check that each of the things are valid numbers.
2928 0 |
[1-9] |
[1-9][0-9] |
[1-9][0-9][0-9]) ;;
2930 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2931 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2937 0 |
[1-9] |
[1-9][0-9] |
[1-9][0-9][0-9]) ;;
2939 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2940 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2946 0 |
[1-9] |
[1-9][0-9] |
[1-9][0-9][0-9]) ;;
2948 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2949 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2954 if test "$age" -gt "$current"; then
2955 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2956 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2960 # Calculate the version variables.
2964 case $version_type in
2968 # Like Linux, but with the current version available in
2969 # verstring for coding it into the library header
2970 major
=.
`expr $current - $age`
2971 versuffix
="$major.$age.$revision"
2972 # Darwin ld doesn't like 0 for these options...
2973 minor_current
=`expr $current + 1`
2974 verstring
="-compatibility_version $minor_current -current_version $minor_current.$revision"
2979 versuffix
=".$current.$revision";
2984 versuffix
=".$current";
2988 major
=`expr $current - $age + 1`
2990 case $version_type in
2991 nonstopux
) verstring_prefix
=nonstopux
;;
2992 *) verstring_prefix
=sgi
;;
2994 verstring
="$verstring_prefix$major.$revision"
2996 # Add in all the interfaces that we are compatible with.
2998 while test "$loop" -ne 0; do
2999 iface
=`expr $revision - $loop`
3000 loop
=`expr $loop - 1`
3001 verstring
="$verstring_prefix$major.$iface:$verstring"
3004 # Before this point, $major must not contain `.'.
3006 versuffix
="$major.$revision"
3010 major
=.
`expr $current - $age`
3011 versuffix
="$major.$age.$revision"
3015 major
=.
`expr $current - $age`
3016 versuffix
=".$current.$age.$revision"
3017 verstring
="$current.$age.$revision"
3019 # Add in all the interfaces that we are compatible with.
3021 while test "$loop" -ne 0; do
3022 iface
=`expr $current - $loop`
3023 loop
=`expr $loop - 1`
3024 verstring
="$verstring:${iface}.0"
3027 # Make executables depend on our current version.
3028 verstring
="$verstring:${current}.0"
3033 versuffix
=".$current.$revision"
3037 # Use '-' rather than '.', since we only want one
3038 # extension on DOS 8.3 filesystems.
3039 major
=`expr $current - $age`
3044 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3045 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3050 # Clear the version info if we defaulted, and they specified a release.
3051 if test -z "$vinfo" && test -n "$release"; then
3053 case $version_type in
3055 # we can't check for "0.0" in archive_cmds due to quoting
3056 # problems, so we reset it completely
3063 if test "$need_version" = no
; then
3070 # Remove version info from name if versioning should be avoided
3071 if test "$avoid_version" = yes && test "$need_version" = no
; then
3077 # Check to see if the archive will have undefined symbols.
3078 if test "$allow_undefined" = yes; then
3079 if test "$allow_undefined_flag" = unsupported
; then
3080 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3081 build_libtool_libs
=no
3085 # Don't allow undefined symbols.
3086 allow_undefined_flag
="$no_undefined_flag"
3090 if test "$mode" != relink
; then
3091 # Remove our outputs, but don't remove object files since they
3092 # may have been created when compiling PIC objects.
3094 tempremovelist
=`$echo "$output_objdir/*"`
3095 for p
in $tempremovelist; do
3099 $output_objdir/$outputname |
$output_objdir/$libname.
* |
$output_objdir/${libname}${release}.
*)
3100 if echo $p |
$EGREP -e "$precious_files_regex" >/dev
/null
2>&1
3104 removelist
="$removelist $p"
3109 if test -n "$removelist"; then
3110 $show "${rm}r $removelist"
3111 $run ${rm}r
$removelist
3115 # Now set the variables for building old libraries.
3116 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience
; then
3117 oldlibs
="$oldlibs $output_objdir/$libname.$libext"
3119 # Transform .lo files to .o files.
3120 oldobjs
="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3123 # Eliminate all temporary directories.
3124 for path
in $notinst_path; do
3125 lib_search_path
=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3126 deplibs
=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3127 dependency_libs
=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3130 if test -n "$xrpath"; then
3131 # If the user specified any rpath flags, then add them.
3133 for libdir
in $xrpath; do
3134 temp_xrpath
="$temp_xrpath -R$libdir"
3135 case "$finalize_rpath " in
3137 *) finalize_rpath
="$finalize_rpath $libdir" ;;
3140 if test "$hardcode_into_libs" != yes ||
test "$build_old_libs" = yes; then
3141 dependency_libs
="$temp_xrpath $dependency_libs"
3145 # Make sure dlfiles contains only unique files that won't be dlpreopened
3146 old_dlfiles
="$dlfiles"
3148 for lib
in $old_dlfiles; do
3149 case " $dlprefiles $dlfiles " in
3151 *) dlfiles
="$dlfiles $lib" ;;
3155 # Make sure dlprefiles contains only unique files
3156 old_dlprefiles
="$dlprefiles"
3158 for lib
in $old_dlprefiles; do
3159 case "$dlprefiles " in
3161 *) dlprefiles
="$dlprefiles $lib" ;;
3165 if test "$build_libtool_libs" = yes; then
3166 if test -n "$rpath"; then
3168 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2* |
*-*-beos*)
3169 # these systems don't actually have a c library (as such)!
3171 *-*-rhapsody* |
*-*-darwin1.
[012])
3172 # Rhapsody C library is in the System framework
3173 deplibs
="$deplibs -framework System"
3176 # Don't link with libc until the a.out ld.so is fixed.
3178 *-*-openbsd* |
*-*-freebsd*)
3179 # Do not include libc due to us having libc/libc_r.
3180 test "X$arg" = "X-lc" && continue
3183 # Add libc to deplibs on all other systems if necessary.
3184 if test "$build_libtool_need_lc" = "yes"; then
3185 deplibs
="$deplibs -lc"
3191 # Transform deplibs into only deplibs that can be linked in shared.
3193 libname_save
=$libname
3194 release_save
=$release
3195 versuffix_save
=$versuffix
3197 # I'm not sure if I'm treating the release correctly. I think
3198 # release should show up in the -l (ie -lgmp5) so we don't want to
3199 # add it in twice. Is that correct?
3205 case $deplibs_check_method in
3207 # Don't check for shared/static. Everything works.
3208 # This might be a little naive. We might want to check
3209 # whether the library exists or not. But this is on
3210 # osf3 & osf4 and I'm not really sure... Just
3211 # implementing what was already the behavior.
3215 # This code stresses the "libraries are programs" paradigm to its
3216 # limits. Maybe even breaks it. We compile a program, linking it
3217 # against the deplibs as a proxy for the library. Then we can check
3218 # whether they linked in statically or dynamically with ldd.
3220 cat > conftest.c
<<EOF
3221 int main() { return 0; }
3224 $LTCC -o conftest conftest.c
$deplibs
3225 if test "$?" -eq 0 ; then
3226 ldd_output
=`ldd conftest`
3227 for i
in $deplibs; do
3228 name
="`expr $i : '-l\(.*\)'`"
3229 # If $name is empty we are operating on a -L argument.
3230 if test "$name" != "" && test "$name" -ne "0"; then
3231 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3232 case " $predeps $postdeps " in
3234 newdeplibs
="$newdeplibs $i"
3239 if test -n "$i" ; then
3240 libname
=`eval \\$echo \"$libname_spec\"`
3241 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
3242 set dummy
$deplib_matches
3244 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3245 newdeplibs
="$newdeplibs $i"
3249 $echo "*** Warning: dynamic linker does not accept needed library $i."
3250 $echo "*** I have the capability to make that library automatically link in when"
3251 $echo "*** you link to this library. But I can only do this if you have a"
3252 $echo "*** shared version of the library, which I believe you do not have"
3253 $echo "*** because a test_compile did reveal that the linker did not use it for"
3254 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3258 newdeplibs
="$newdeplibs $i"
3262 # Error occurred in the first compile. Let's try to salvage
3263 # the situation: Compile a separate program for each library.
3264 for i
in $deplibs; do
3265 name
="`expr $i : '-l\(.*\)'`"
3266 # If $name is empty we are operating on a -L argument.
3267 if test "$name" != "" && test "$name" != "0"; then
3269 $LTCC -o conftest conftest.c
$i
3271 if test "$?" -eq 0 ; then
3272 ldd_output
=`ldd conftest`
3273 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3274 case " $predeps $postdeps " in
3276 newdeplibs
="$newdeplibs $i"
3281 if test -n "$i" ; then
3282 libname
=`eval \\$echo \"$libname_spec\"`
3283 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
3284 set dummy
$deplib_matches
3286 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3287 newdeplibs
="$newdeplibs $i"
3291 $echo "*** Warning: dynamic linker does not accept needed library $i."
3292 $echo "*** I have the capability to make that library automatically link in when"
3293 $echo "*** you link to this library. But I can only do this if you have a"
3294 $echo "*** shared version of the library, which you do not appear to have"
3295 $echo "*** because a test_compile did reveal that the linker did not use this one"
3296 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3302 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3303 $echo "*** make it link in! You will probably need to install it or some"
3304 $echo "*** library that it depends on before this library will be fully"
3305 $echo "*** functional. Installing it before continuing would be even better."
3308 newdeplibs
="$newdeplibs $i"
3314 set dummy
$deplibs_check_method
3315 file_magic_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3316 for a_deplib
in $deplibs; do
3317 name
="`expr $a_deplib : '-l\(.*\)'`"
3318 # If $name is empty we are operating on a -L argument.
3319 if test "$name" != "" && test "$name" != "0"; then
3320 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3321 case " $predeps $postdeps " in
3323 newdeplibs
="$newdeplibs $a_deplib"
3328 if test -n "$a_deplib" ; then
3329 libname
=`eval \\$echo \"$libname_spec\"`
3330 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3331 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
3332 for potent_lib
in $potential_libs; do
3333 # Follow soft links.
3334 if ls -lLd "$potent_lib" 2>/dev
/null \
3335 |
grep " -> " >/dev
/null
; then
3338 # The statement above tries to avoid entering an
3339 # endless loop below, in case of cyclic links.
3340 # We might still enter an endless loop, since a link
3341 # loop can be closed while we follow links,
3343 potlib
="$potent_lib"
3344 while test -h "$potlib" 2>/dev
/null
; do
3345 potliblink
=`ls -ld $potlib | ${SED} 's/.* -> //'`
3347 [\\/]* |
[A-Za-z
]:[\\/]*) potlib
="$potliblink";;
3348 *) potlib
=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3351 if eval $file_magic_cmd \"\
$potlib\" 2>/dev
/null \
3353 |
$EGREP "$file_magic_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 file magic test)"
3372 $echo "*** with $libname and none of the candidates passed a file format test"
3373 $echo "*** using a file magic. Last file checked: $potlib"
3377 # Add a -L argument.
3378 newdeplibs
="$newdeplibs $a_deplib"
3380 done # Gone through all deplibs.
3383 set dummy
$deplibs_check_method
3384 match_pattern_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3385 for a_deplib
in $deplibs; do
3386 name
="`expr $a_deplib : '-l\(.*\)'`"
3387 # If $name is empty we are operating on a -L argument.
3388 if test -n "$name" && test "$name" != "0"; then
3389 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3390 case " $predeps $postdeps " in
3392 newdeplibs
="$newdeplibs $a_deplib"
3397 if test -n "$a_deplib" ; then
3398 libname
=`eval \\$echo \"$libname_spec\"`
3399 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3400 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
3401 for potent_lib
in $potential_libs; do
3402 potlib
="$potent_lib" # see symlink-check above in file_magic test
3403 if eval $echo \"$potent_lib\" 2>/dev
/null \
3405 |
$EGREP "$match_pattern_regex" > /dev
/null
; then
3406 newdeplibs
="$newdeplibs $a_deplib"
3413 if test -n "$a_deplib" ; then
3416 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3417 $echo "*** I have the capability to make that library automatically link in when"
3418 $echo "*** you link to this library. But I can only do this if you have a"
3419 $echo "*** shared version of the library, which you do not appear to have"
3420 $echo "*** because I did check the linker path looking for a file starting"
3421 if test -z "$potlib" ; then
3422 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3424 $echo "*** with $libname and none of the candidates passed a file format test"
3425 $echo "*** using a regex pattern. Last file checked: $potlib"
3429 # Add a -L argument.
3430 newdeplibs
="$newdeplibs $a_deplib"
3432 done # Gone through all deplibs.
3436 tmp_deplibs
=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3437 -e 's/ -[LR][^ ]*//g'`
3438 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3439 for i
in $predeps $postdeps ; do
3440 # can't use Xsed below, because $i might contain '/'
3441 tmp_deplibs
=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3444 if $echo "X $tmp_deplibs" |
$Xsed -e 's/[ ]//g' \
3445 |
grep .
>/dev
/null
; then
3447 if test "X$deplibs_check_method" = "Xnone"; then
3448 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3450 $echo "*** Warning: inter-library dependencies are not known to be supported."
3452 $echo "*** All declared inter-library dependencies are being dropped."
3457 versuffix
=$versuffix_save
3459 release
=$release_save
3460 libname
=$libname_save
3464 *-*-rhapsody* |
*-*-darwin1.
[012])
3465 # On Rhapsody replace the C library is the System framework
3466 newdeplibs
=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3470 if test "$droppeddeps" = yes; then
3471 if test "$module" = yes; then
3473 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3474 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3475 $echo "*** a static module, that should work as long as the dlopening"
3476 $echo "*** application is linked with the -dlopen flag."
3477 if test -z "$global_symbol_pipe"; then
3479 $echo "*** However, this would only work if libtool was able to extract symbol"
3480 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3481 $echo "*** not find such a program. So, this module is probably useless."
3482 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3484 if test "$build_old_libs" = no
; then
3485 oldlibs
="$output_objdir/$libname.$libext"
3486 build_libtool_libs
=module
3489 build_libtool_libs
=no
3492 $echo "*** The inter-library dependencies that have been dropped here will be"
3493 $echo "*** automatically added whenever a program is linked with this library"
3494 $echo "*** or is declared to -dlopen it."
3496 if test "$allow_undefined" = no
; then
3498 $echo "*** Since this library must not contain undefined symbols,"
3499 $echo "*** because either the platform does not support them or"
3500 $echo "*** it was explicitly requested with -no-undefined,"
3501 $echo "*** libtool will only create a static version of it."
3502 if test "$build_old_libs" = no
; then
3503 oldlibs
="$output_objdir/$libname.$libext"
3504 build_libtool_libs
=module
3507 build_libtool_libs
=no
3512 # Done checking deplibs!
3516 # All the library-specific variables (install_libdir is set above).
3521 # Test again, we may have decided not to build it any more
3522 if test "$build_libtool_libs" = yes; then
3523 if test "$hardcode_into_libs" = yes; then
3524 # Hardcode the library paths
3527 rpath
="$finalize_rpath"
3528 test "$mode" != relink
&& rpath
="$compile_rpath$rpath"
3529 for libdir
in $rpath; do
3530 if test -n "$hardcode_libdir_flag_spec"; then
3531 if test -n "$hardcode_libdir_separator"; then
3532 if test -z "$hardcode_libdirs"; then
3533 hardcode_libdirs
="$libdir"
3535 # Just accumulate the unique libdirs.
3536 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3537 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3540 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3545 eval flag
=\"$hardcode_libdir_flag_spec\"
3546 dep_rpath
="$dep_rpath $flag"
3548 elif test -n "$runpath_var"; then
3549 case "$perm_rpath " in
3551 *) perm_rpath
="$perm_rpath $libdir" ;;
3555 # Substitute the hardcoded libdirs into the rpath.
3556 if test -n "$hardcode_libdir_separator" &&
3557 test -n "$hardcode_libdirs"; then
3558 libdir
="$hardcode_libdirs"
3559 if test -n "$hardcode_libdir_flag_spec_ld"; then
3560 eval dep_rpath
=\"$hardcode_libdir_flag_spec_ld\"
3562 eval dep_rpath
=\"$hardcode_libdir_flag_spec\"
3565 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3566 # We should set the runpath_var.
3568 for dir
in $perm_rpath; do
3571 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3573 test -n "$dep_rpath" && deplibs
="$dep_rpath $deplibs"
3576 shlibpath
="$finalize_shlibpath"
3577 test "$mode" != relink
&& shlibpath
="$compile_shlibpath$shlibpath"
3578 if test -n "$shlibpath"; then
3579 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3582 # Get the real and link names of the library.
3583 eval shared_ext
=\"$shrext\"
3584 eval library_names
=\"$library_names_spec\"
3585 set dummy
$library_names
3589 if test -n "$soname_spec"; then
3590 eval soname
=\"$soname_spec\"
3594 if test -z "$dlname"; then
3598 lib
="$output_objdir/$realname"
3601 linknames
="$linknames $link"
3604 # Use standard objects if they are pic
3605 test -z "$pic_flag" && libobjs
=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3607 # Prepare the list of exported symbols
3608 if test -z "$export_symbols"; then
3609 if test "$always_export_symbols" = yes ||
test -n "$export_symbols_regex"; then
3610 $show "generating symbol list for \`$libname.la'"
3611 export_symbols
="$output_objdir/$libname.exp"
3612 $run $rm $export_symbols
3613 cmds
=$export_symbols_cmds
3614 save_ifs
="$IFS"; IFS
='~'
3615 for cmd
in $cmds; do
3618 if len
=`expr "X$cmd" : ".*"` &&
3619 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
3621 $run eval "$cmd" ||
exit $?
3622 skipped_export
=false
3624 # The command line is too long to execute in one step.
3625 $show "using reloadable object file for export list..."
3630 if test -n "$export_symbols_regex"; then
3631 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3632 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3633 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3634 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3639 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3640 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3644 for test_deplib
in $deplibs; do
3645 case " $convenience " in
3646 *" $test_deplib "*) ;;
3648 tmp_deplibs
="$tmp_deplibs $test_deplib"
3652 deplibs
="$tmp_deplibs"
3654 if test -n "$convenience"; then
3655 if test -n "$whole_archive_flag_spec"; then
3656 save_libobjs
=$libobjs
3657 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
3659 gentop
="$output_objdir/${outputname}x"
3660 $show "${rm}r $gentop"
3661 $run ${rm}r
"$gentop"
3662 $show "$mkdir $gentop"
3663 $run $mkdir "$gentop"
3665 if test "$status" -ne 0 && test ! -d "$gentop"; then
3668 generated
="$generated $gentop"
3670 for xlib
in $convenience; do
3671 # Extract the objects.
3673 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
3674 *) xabs
=`pwd`"/$xlib" ;;
3676 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3677 xdir
="$gentop/$xlib"
3679 $show "${rm}r $xdir"
3681 $show "$mkdir $xdir"
3684 if test "$status" -ne 0 && test ! -d "$xdir"; then
3687 # We will extract separately just the conflicting names and we will no
3688 # longer touch any unique names. It is faster to leave these extract
3689 # automatically by $AR in one run.
3690 $show "(cd $xdir && $AR x $xabs)"
3691 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
3692 if ($AR t
"$xabs" |
sort |
sort -uc >/dev
/null
2>&1); then
3695 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3696 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3697 $AR t
"$xabs" |
sort |
uniq -cd |
while read -r count name
3700 while test "$i" -le "$count"
3702 # Put our $i before any first dot (extension)
3703 # Never overwrite any file
3705 while test "X$name_to" = "X$name" ||
test -f "$xdir/$name_to"
3707 name_to
=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3709 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3710 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" ||
exit $?
3716 libobjs
="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3721 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3722 eval flag
=\"$thread_safe_flag_spec\"
3723 linker_flags
="$linker_flags $flag"
3726 # Make a backup of the uninstalled library when relinking
3727 if test "$mode" = relink
; then
3728 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' ||
exit $?
3731 # Do each of the archive commands.
3732 if test "$module" = yes && test -n "$module_cmds" ; then
3733 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3734 eval test_cmds
=\"$module_expsym_cmds\"
3735 cmds
=$module_expsym_cmds
3737 eval test_cmds
=\"$module_cmds\"
3741 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3742 eval test_cmds
=\"$archive_expsym_cmds\"
3743 cmds
=$archive_expsym_cmds
3745 eval test_cmds
=\"$archive_cmds\"
3750 if test "X$skipped_export" != "X:" && len
=`expr "X$test_cmds" : ".*"` &&
3751 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
3754 # The command line is too long to link in one step, link piecewise.
3755 $echo "creating reloadable object files..."
3757 # Save the value of $output and $libobjs because we want to
3758 # use them later. If we have whole_archive_flag_spec, we
3759 # want to use save_libobjs as it was before
3760 # whole_archive_flag_spec was expanded, because we can't
3761 # assume the linker understands whole_archive_flag_spec.
3762 # This may have to be revisited, in case too many
3763 # convenience libraries get linked in and end up exceeding
3765 if test -z "$convenience" ||
test -z "$whole_archive_flag_spec"; then
3766 save_libobjs
=$libobjs
3770 # Clear the reloadable object creation command queue and
3771 # initialize k to one.
3778 output
=$output_objdir/$save_output-${k}.
$objext
3779 # Loop over the list of objects to be linked.
3780 for obj
in $save_libobjs
3782 eval test_cmds
=\"$reload_cmds $objlist $last_robj\"
3783 if test "X$objlist" = X ||
3784 { len
=`expr "X$test_cmds" : ".*"` &&
3785 test "$len" -le "$max_cmd_len"; }; then
3786 objlist
="$objlist $obj"
3788 # The command $test_cmds is almost too long, add a
3789 # command to the queue.
3790 if test "$k" -eq 1 ; then
3791 # The first file doesn't have a previous command to add.
3792 eval concat_cmds
=\"$reload_cmds $objlist $last_robj\"
3794 # All subsequent reloadable object files will link in
3795 # the last one created.
3796 eval concat_cmds
=\"\
$concat_cmds~
$reload_cmds $objlist $last_robj\"
3798 last_robj
=$output_objdir/$save_output-${k}.
$objext
3800 output
=$output_objdir/$save_output-${k}.
$objext
3805 # Handle the remaining objects by creating one last
3806 # reloadable object file. All subsequent reloadable object
3807 # files will link in the last one created.
3808 test -z "$concat_cmds" || concat_cmds
=$concat_cmds~
3809 eval concat_cmds
=\"\
${concat_cmds}$reload_cmds $objlist $last_robj\"
3811 if ${skipped_export-false}; then
3812 $show "generating symbol list for \`$libname.la'"
3813 export_symbols
="$output_objdir/$libname.exp"
3814 $run $rm $export_symbols
3816 # Append the command to create the export file.
3817 eval concat_cmds
=\"\
$concat_cmds~
$export_symbols_cmds\"
3820 # Set up a command to remove the reloadale object files
3821 # after they are used.
3823 while test "$i" -lt "$k"
3826 delfiles
="$delfiles $output_objdir/$save_output-${i}.$objext"
3829 $echo "creating a temporary reloadable object file: $output"
3831 # Loop through the commands generated above and execute them.
3832 save_ifs
="$IFS"; IFS
='~'
3833 for cmd
in $concat_cmds; do
3837 $run eval "$cmd" ||
exit $?
3842 # Restore the value of output.
3845 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3846 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
3848 # Expand the library linking commands again to reset the
3849 # value of $libobjs for piecewise linking.
3851 # Do each of the archive commands.
3852 if test "$module" = yes && test -n "$module_cmds" ; then
3853 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3854 cmds
=$module_expsym_cmds
3859 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3860 cmds
=$archive_expsym_cmds
3866 # Append the command to remove the reloadable object files
3867 # to the just-reset $cmds.
3868 eval cmds
=\"\
$cmds~\
$rm $delfiles\"
3870 save_ifs
="$IFS"; IFS
='~'
3871 for cmd
in $cmds; do
3875 $run eval "$cmd" ||
exit $?
3879 # Restore the uninstalled library and exit
3880 if test "$mode" = relink
; then
3881 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' ||
exit $?
3885 # Create links to the real library.
3886 for linkname
in $linknames; do
3887 if test "$realname" != "$linkname"; then
3888 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3889 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' ||
exit $?
3893 # If -module or -export-dynamic was specified, set the dlname.
3894 if test "$module" = yes ||
test "$export_dynamic" = yes; then
3895 # On all known operating systems, these are identical.
3902 if test -n "$deplibs"; then
3903 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3906 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
3907 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3910 if test -n "$rpath"; then
3911 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3914 if test -n "$xrpath"; then
3915 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3918 if test -n "$vinfo"; then
3919 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3922 if test -n "$release"; then
3923 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3928 if test -n "$objs$old_deplibs"; then
3929 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3933 obj
=`$echo "X$output" | $Xsed -e "$lo2o"`
3941 # Delete the old objects.
3942 $run $rm $obj $libobj
3944 # Objects from convenience libraries. This assumes
3945 # single-version convenience libraries. Whenever we create
3946 # different ones for PIC/non-PIC, this we'll have to duplicate
3950 # reload_cmds runs $LD directly, so let us get rid of
3951 # -Wl from whole_archive_flag_spec
3954 if test -n "$convenience"; then
3955 if test -n "$whole_archive_flag_spec"; then
3956 eval reload_conv_objs
=\"\
$reload_objs $whole_archive_flag_spec\"
3958 gentop
="$output_objdir/${obj}x"
3959 $show "${rm}r $gentop"
3960 $run ${rm}r
"$gentop"
3961 $show "$mkdir $gentop"
3962 $run $mkdir "$gentop"
3964 if test "$status" -ne 0 && test ! -d "$gentop"; then
3967 generated
="$generated $gentop"
3969 for xlib
in $convenience; do
3970 # Extract the objects.
3972 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
3973 *) xabs
=`pwd`"/$xlib" ;;
3975 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3976 xdir
="$gentop/$xlib"
3978 $show "${rm}r $xdir"
3980 $show "$mkdir $xdir"
3983 if test "$status" -ne 0 && test ! -d "$xdir"; then
3986 # We will extract separately just the conflicting names and we will no
3987 # longer touch any unique names. It is faster to leave these extract
3988 # automatically by $AR in one run.
3989 $show "(cd $xdir && $AR x $xabs)"
3990 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
3991 if ($AR t
"$xabs" |
sort |
sort -uc >/dev
/null
2>&1); then
3994 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3995 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3996 $AR t
"$xabs" |
sort |
uniq -cd |
while read -r count name
3999 while test "$i" -le "$count"
4001 # Put our $i before any first dot (extension)
4002 # Never overwrite any file
4004 while test "X$name_to" = "X$name" ||
test -f "$xdir/$name_to"
4006 name_to
=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
4008 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
4009 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" ||
exit $?
4015 reload_conv_objs
="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
4020 # Create the old-style object.
4021 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
4025 save_ifs
="$IFS"; IFS
='~'
4026 for cmd
in $cmds; do
4030 $run eval "$cmd" ||
exit $?
4034 # Exit if we aren't doing a library object file.
4035 if test -z "$libobj"; then
4036 if test -n "$gentop"; then
4037 $show "${rm}r $gentop"
4044 if test "$build_libtool_libs" != yes; then
4045 if test -n "$gentop"; then
4046 $show "${rm}r $gentop"
4050 # Create an invalid libtool object if no PIC, so that we don't
4051 # accidentally link it into a program.
4052 # $show "echo timestamp > $libobj"
4053 # $run eval "echo timestamp > $libobj" || exit $?
4057 if test -n "$pic_flag" ||
test "$pic_mode" != default
; then
4058 # Only do commands if we really have different PIC objects.
4059 reload_objs
="$libobjs $reload_conv_objs"
4062 save_ifs
="$IFS"; IFS
='~'
4063 for cmd
in $cmds; do
4067 $run eval "$cmd" ||
exit $?
4072 if test -n "$gentop"; then
4073 $show "${rm}r $gentop"
4082 *cygwin
*) output
=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4084 if test -n "$vinfo"; then
4085 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4088 if test -n "$release"; then
4089 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4092 if test "$preload" = yes; then
4093 if test "$dlopen_support" = unknown
&& test "$dlopen_self" = unknown
&&
4094 test "$dlopen_self_static" = unknown
; then
4095 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4100 *-*-rhapsody* |
*-*-darwin1.
[012])
4101 # On Rhapsody replace the C library is the System framework
4102 compile_deplibs
=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4103 finalize_deplibs
=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4109 # Don't allow lazy linking, it breaks C++ global constructors
4110 if test "$tagname" = CXX
; then
4111 compile_command
="$compile_command ${wl}-bind_at_load"
4112 finalize_command
="$finalize_command ${wl}-bind_at_load"
4117 compile_command
="$compile_command $compile_deplibs"
4118 finalize_command
="$finalize_command $finalize_deplibs"
4120 if test -n "$rpath$xrpath"; then
4121 # If the user specified any rpath flags, then add them.
4122 for libdir
in $rpath $xrpath; do
4123 # This is the magic to use -rpath.
4124 case "$finalize_rpath " in
4126 *) finalize_rpath
="$finalize_rpath $libdir" ;;
4131 # Now hardcode the library paths
4134 for libdir
in $compile_rpath $finalize_rpath; do
4135 if test -n "$hardcode_libdir_flag_spec"; then
4136 if test -n "$hardcode_libdir_separator"; then
4137 if test -z "$hardcode_libdirs"; then
4138 hardcode_libdirs
="$libdir"
4140 # Just accumulate the unique libdirs.
4141 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4142 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4145 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4150 eval flag
=\"$hardcode_libdir_flag_spec\"
4151 rpath
="$rpath $flag"
4153 elif test -n "$runpath_var"; then
4154 case "$perm_rpath " in
4156 *) perm_rpath
="$perm_rpath $libdir" ;;
4160 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
4161 case :$dllsearchpath: in
4163 *) dllsearchpath
="$dllsearchpath:$libdir";;
4168 # Substitute the hardcoded libdirs into the rpath.
4169 if test -n "$hardcode_libdir_separator" &&
4170 test -n "$hardcode_libdirs"; then
4171 libdir
="$hardcode_libdirs"
4172 eval rpath
=\" $hardcode_libdir_flag_spec\"
4174 compile_rpath
="$rpath"
4178 for libdir
in $finalize_rpath; do
4179 if test -n "$hardcode_libdir_flag_spec"; then
4180 if test -n "$hardcode_libdir_separator"; then
4181 if test -z "$hardcode_libdirs"; then
4182 hardcode_libdirs
="$libdir"
4184 # Just accumulate the unique libdirs.
4185 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4186 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4189 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4194 eval flag
=\"$hardcode_libdir_flag_spec\"
4195 rpath
="$rpath $flag"
4197 elif test -n "$runpath_var"; then
4198 case "$finalize_perm_rpath " in
4200 *) finalize_perm_rpath
="$finalize_perm_rpath $libdir" ;;
4204 # Substitute the hardcoded libdirs into the rpath.
4205 if test -n "$hardcode_libdir_separator" &&
4206 test -n "$hardcode_libdirs"; then
4207 libdir
="$hardcode_libdirs"
4208 eval rpath
=\" $hardcode_libdir_flag_spec\"
4210 finalize_rpath
="$rpath"
4212 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4213 # Transform all the library objects into standard objects.
4214 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4215 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4219 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
4220 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4221 dlsyms
="${outputname}S.c"
4223 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4227 if test -n "$dlsyms"; then
4231 # Discover the nlist of each of the dlfiles.
4232 nlist
="$output_objdir/${outputname}.nm"
4234 $show "$rm $nlist ${nlist}S ${nlist}T"
4235 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4237 # Parse the name list into a source file.
4238 $show "creating $output_objdir/$dlsyms"
4240 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4241 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4242 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4248 /* Prevent the only kind of declaration conflicts we can make. */
4249 #define lt_preloaded_symbols some_other_symbol
4251 /* External symbol declarations for the compiler. */\
4254 if test "$dlself" = yes; then
4255 $show "generating symbol list for \`$output'"
4257 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4259 # Add our own program objects to the symbol list.
4260 progfiles
=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4261 for arg
in $progfiles; do
4262 $show "extracting global C symbols from \`$arg'"
4263 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4266 if test -n "$exclude_expsyms"; then
4267 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4268 $run eval '$mv "$nlist"T "$nlist"'
4271 if test -n "$export_symbols_regex"; then
4272 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4273 $run eval '$mv "$nlist"T "$nlist"'
4276 # Prepare the list of exported symbols
4277 if test -z "$export_symbols"; then
4278 export_symbols
="$output_objdir/$output.exp"
4279 $run $rm $export_symbols
4280 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4282 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
4283 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
4284 $run eval 'mv "$nlist"T "$nlist"'
4288 for arg
in $dlprefiles; do
4289 $show "extracting global C symbols from \`$arg'"
4290 name
=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4291 $run eval '$echo ": $name " >> "$nlist"'
4292 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4295 if test -z "$run"; then
4296 # Make sure we have at least an empty file.
4297 test -f "$nlist" ||
: > "$nlist"
4299 if test -n "$exclude_expsyms"; then
4300 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4301 $mv "$nlist"T
"$nlist"
4304 # Try sorting and uniquifying the output.
4305 if grep -v "^: " < "$nlist" |
4306 if sort -k 3 </dev
/null
>/dev
/null
2>&1; then
4311 uniq > "$nlist"S
; then
4314 grep -v "^: " < "$nlist" > "$nlist"S
4317 if test -f "$nlist"S
; then
4318 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4320 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4323 $echo >> "$output_objdir/$dlsyms" "\
4325 #undef lt_preloaded_symbols
4327 #if defined (__STDC__) && __STDC__
4328 # define lt_ptr void *
4330 # define lt_ptr char *
4334 /* The mapping between symbol names and symbols. */
4339 lt_preloaded_symbols[] =
4343 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4345 $echo >> "$output_objdir/$dlsyms" "\
4349 /* This works around a problem in FreeBSD linker */
4350 #ifdef FREEBSD_WORKAROUND
4351 static const void *lt_preloaded_setup() {
4352 return lt_preloaded_symbols;
4362 pic_flag_for_symtable
=
4364 # compiling the symbol table file with pic_flag works around
4365 # a FreeBSD bug that causes programs to crash when -lm is
4366 # linked before any other PIC object. But we must not use
4367 # pic_flag when linking with -static. The problem exists in
4368 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4369 *-*-freebsd2*|
*-*-freebsd3.0
*|
*-*-freebsdelf3.0
*)
4370 case "$compile_command " in
4372 *) pic_flag_for_symtable
=" $pic_flag -DFREEBSD_WORKAROUND";;
4375 case "$compile_command " in
4377 *) pic_flag_for_symtable
=" $pic_flag";;
4381 # Now compile the dynamic symbol file.
4382 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4383 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' ||
exit $?
4385 # Clean up the generated files.
4386 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4387 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4389 # Transform the symbol file into the correct name.
4390 compile_command
=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4391 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4394 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4399 # We keep going just in case the user didn't refer to
4400 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4401 # really was required.
4403 # Nullify the symbol file.
4404 compile_command
=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4405 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4408 if test "$need_relink" = no ||
test "$build_libtool_libs" != yes; then
4409 # Replace the output file specification.
4410 compile_command
=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4411 link_command
="$compile_command$compile_rpath"
4413 # We have no uninstalled library dependencies, so finalize right now.
4414 $show "$link_command"
4415 $run eval "$link_command"
4418 # Delete the generated files.
4419 if test -n "$dlsyms"; then
4420 $show "$rm $output_objdir/${outputname}S.${objext}"
4421 $run $rm "$output_objdir/${outputname}S.${objext}"
4427 if test -n "$shlibpath_var"; then
4428 # We should set the shlibpath_var
4430 for dir
in $temp_rpath; do
4432 [\\/]* |
[A-Za-z
]:[\\/]*)
4437 # Relative path: add a thisdir entry.
4438 rpath
="$rpath\$thisdir/$dir:"
4445 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4446 compile_command
="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4448 if test -n "$finalize_shlibpath"; then
4449 finalize_command
="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4454 if test -n "$runpath_var"; then
4455 if test -n "$perm_rpath"; then
4456 # We should set the runpath_var.
4458 for dir
in $perm_rpath; do
4461 compile_var
="$runpath_var=\"$rpath\$$runpath_var\" "
4463 if test -n "$finalize_perm_rpath"; then
4464 # We should set the runpath_var.
4466 for dir
in $finalize_perm_rpath; do
4469 finalize_var
="$runpath_var=\"$rpath\$$runpath_var\" "
4473 if test "$no_install" = yes; then
4474 # We don't need to create a wrapper script.
4475 link_command
="$compile_var$compile_command$compile_rpath"
4476 # Replace the output file specification.
4477 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4478 # Delete the old output file.
4480 # Link the executable and exit
4481 $show "$link_command"
4482 $run eval "$link_command" ||
exit $?
4486 if test "$hardcode_action" = relink
; then
4487 # Fast installation is not supported
4488 link_command
="$compile_var$compile_command$compile_rpath"
4489 relink_command
="$finalize_var$finalize_command$finalize_rpath"
4491 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4492 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4494 if test "$fast_install" != no
; then
4495 link_command
="$finalize_var$compile_command$finalize_rpath"
4496 if test "$fast_install" = yes; then
4497 relink_command
=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4499 # fast_install is set to needless
4503 link_command
="$compile_var$compile_command$compile_rpath"
4504 relink_command
="$finalize_var$finalize_command$finalize_rpath"
4508 # Replace the output file specification.
4509 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4511 # Delete the old output files.
4512 $run $rm $output $output_objdir/$outputname $output_objdir/lt-
$outputname
4514 $show "$link_command"
4515 $run eval "$link_command" ||
exit $?
4517 # Now create the wrapper script.
4518 $show "creating $output"
4520 # Quote the relink command for shipping.
4521 if test -n "$relink_command"; then
4522 # Preserve any variables that may affect compiler behavior
4523 for var
in $variables_saved_for_relink; do
4524 if eval test -z \"\
${$var+set}\"; then
4525 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4526 elif eval var_value
=\$
$var; test -z "$var_value"; then
4527 relink_command
="$var=; export $var; $relink_command"
4529 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4530 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
4533 relink_command
="(cd `pwd`; $relink_command)"
4534 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4537 # Quote $echo for shipping.
4538 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
4540 [\\/]* |
[A-Za-z
]:[\\/]*) qecho
="$SHELL $0 --fallback-echo";;
4541 *) qecho
="$SHELL `pwd`/$0 --fallback-echo";;
4543 qecho
=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4545 qecho
=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4548 # Only actually do things if our run command is non-null.
4549 if test -z "$run"; then
4550 # win32 will think the script is a binary if it has
4551 # a .exe suffix, so we strip it off here.
4553 *.exe
) output
=`$echo $output|${SED} 's,.exe$,,'` ;;
4555 # test for cygwin because mv fails w/o .exe extensions
4559 outputname
=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4563 *cygwin
* |
*mingw
* )
4564 cwrappersource
=`$echo ${objdir}/lt-${output}.c`
4565 cwrapper
=`$echo ${output}.exe`
4566 $rm $cwrappersource $cwrapper
4567 trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
4569 cat > $cwrappersource <<EOF
4571 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4572 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4574 The $output program cannot be directly executed until all the libtool
4575 libraries that it depends on are installed.
4577 This wrapper executable should never be moved out of the build directory.
4578 If it is, it will not operate correctly.
4580 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4581 but could eventually absorb all of the scripts functionality and
4582 exec $objdir/$outputname directly.
4585 cat >> $cwrappersource<<"EOF"
4593 #if defined(PATH_MAX)
4594 # define LT_PATHMAX PATH_MAX
4595 #elif defined(MAXPATHLEN)
4596 # define LT_PATHMAX MAXPATHLEN
4598 # define LT_PATHMAX 1024
4601 #ifndef DIR_SEPARATOR
4602 #define DIR_SEPARATOR '/'
4605 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4607 #define HAVE_DOS_BASED_FILE_SYSTEM
4608 #ifndef DIR_SEPARATOR_2
4609 #define DIR_SEPARATOR_2 '\\'
4613 #ifndef DIR_SEPARATOR_2
4614 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4615 #else /* DIR_SEPARATOR_2 */
4616 # define IS_DIR_SEPARATOR(ch) \
4617 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4618 #endif /* DIR_SEPARATOR_2 */
4620 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4621 #define XFREE(stale) do { \
4622 if (stale) { free ((void *) stale); stale = 0; } \
4625 const char *program_name = NULL;
4627 void * xmalloc (size_t num);
4628 char * xstrdup (const char *string);
4629 char * basename (const char *name);
4630 char * fnqualify(const char *path);
4631 char * strendzap(char *str, const char *pat);
4632 void lt_fatal (const char *message, ...);
4635 main (int argc, char *argv[])
4640 program_name = (char *) xstrdup ((char *) basename (argv[0]));
4641 newargz = XMALLOC(char *, argc+2);
4644 cat >> $cwrappersource <<EOF
4645 newargz[0] = "$SHELL";
4648 cat >> $cwrappersource <<"EOF"
4649 newargz
[1] = fnqualify
(argv
[0]);
4650 /* we know the
script has the same name
, without the .exe
*/
4651 /* so
make sure newargz
[1] doesn
't end in .exe */
4652 strendzap(newargz[1],".exe");
4653 for (i = 1; i < argc; i++)
4654 newargz[i+1] = xstrdup(argv[i]);
4655 newargz[argc+1] = NULL;
4658 cat >> $cwrappersource <<EOF
4659 execv("$SHELL",newargz);
4662 cat >> $cwrappersource <<"EOF"
4666 xmalloc (size_t num)
4668 void * p = (void *) malloc (num);
4670 lt_fatal ("Memory exhausted");
4676 xstrdup (const char *string)
4678 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4683 basename (const char *name)
4687 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4688 /* Skip over the disk name in MSDOS pathnames. */
4689 if (isalpha (name[0]) && name[1] == ':')
4693 for (base = name; *name; name++)
4694 if (IS_DIR_SEPARATOR (*name))
4696 return (char *) base;
4700 fnqualify(const char *path)
4704 char tmp[LT_PATHMAX + 1];
4706 assert(path != NULL);
4708 /* Is it qualified already? */
4709 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4710 if (isalpha (path[0]) && path[1] == ':')
4711 return xstrdup (path);
4713 if (IS_DIR_SEPARATOR (path[0]))
4714 return xstrdup (path);
4716 /* prepend the current directory */
4717 /* doesn't handle
'~' */
4718 if (getcwd
(tmp
, LT_PATHMAX
) == NULL
)
4719 lt_fatal
("getcwd failed");
4720 size
= strlen
(tmp
) + 1 + strlen
(path
) + 1; /* +2 for '/' and
'\0' */
4721 p
= XMALLOC
(char
, size
);
4722 sprintf
(p
, "%s%c%s", tmp
, DIR_SEPARATOR
, path
);
4727 strendzap
(char
*str
, const char
*pat
)
4731 assert
(str
!= NULL
);
4732 assert
(pat
!= NULL
);
4735 patlen
= strlen
(pat
);
4739 str
+= len
- patlen
;
4740 if (strcmp
(str
, pat
) == 0)
4747 lt_error_core
(int exit_status
, const char
* mode
,
4748 const char
* message
, va_list ap
)
4750 fprintf
(stderr
, "%s: %s: ", program_name
, mode
);
4751 vfprintf
(stderr
, message
, ap
);
4752 fprintf
(stderr
, ".\n");
4754 if (exit_status
>= 0)
4759 lt_fatal
(const char
*message
, ...
)
4762 va_start
(ap
, message
);
4763 lt_error_core
(EXIT_FAILURE
, "FATAL", message
, ap
);
4767 # we should really use a build-platform specific compiler
4768 # here, but OTOH, the wrappers (shell script and this C one)
4769 # are only useful if you want to execute the "real" binary.
4770 # Since the "real" binary is built for $host, then this
4771 # wrapper might as well be built for $host, too.
4772 $run $LTCC -s -o $cwrapper $cwrappersource
4776 trap "$rm $output; exit 1" 1 2 15
4781 # $output - temporary wrapper script for $objdir/$outputname
4782 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4784 # The $output program cannot be directly executed until all the libtool
4785 # libraries that it depends on are installed.
4787 # This wrapper script should never be moved out of the build directory.
4788 # If it is, it will not operate correctly.
4790 # Sed substitution that helps us do robust quoting. It backslashifies
4791 # metacharacters that are still active within double-quoted strings.
4792 Xsed='${SED} -e 1s/^X//'
4793 sed_quote_subst='$sed_quote_subst'
4795 # The HP-UX ksh and POSIX shell print the target directory to stdout
4797 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
4799 relink_command=\"$relink_command\"
4801 # This environment variable determines our operation mode.
4802 if test \"\$libtool_install_magic\" = \"$magic\"; then
4803 # install mode needs the following variable:
4804 notinst_deplibs='$notinst_deplibs'
4806 # When we are sourced in execute mode, \$file and \$echo are already set.
4807 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4810 # Make sure echo works.
4811 if test \"X\$1\" = X--no-reexec; then
4812 # Discard the --no-reexec flag, and continue.
4814 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4815 # Yippee, \$echo works!
4818 # Restart under the correct shell, and then maybe \$echo will work.
4819 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4825 # Find the directory that this script lives in.
4826 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4827 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4829 # Follow symbolic links until we get to the real thisdir.
4830 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4831 while test -n \"\$file\"; do
4832 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4834 # If there was a directory component, then change thisdir.
4835 if test \"x\$destdir\" != \"x\$file\"; then
4836 case \"\$destdir\" in
4837 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4838 *) thisdir=\"\$thisdir/\$destdir\" ;;
4842 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4843 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
4846 # Try to get the absolute directory name.
4847 absdir=\`cd \"\$thisdir\" && pwd\`
4848 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4851 if test "$fast_install" = yes; then
4853 program=lt-'$outputname'$exeext
4854 progdir=\"\$thisdir/$objdir\"
4856 if test ! -f \"\$progdir/\$program\" || \\
4857 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4858 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4860 file=\"\$\$-\$program\"
4862 if test ! -d \"\$progdir\"; then
4863 $mkdir \"\$progdir\"
4865 $rm \"\$progdir/\$file\"
4870 # relink executable if necessary
4871 if test -n \"\$relink_command\"; then
4872 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4874 $echo \"\$relink_command_output\" >&2
4875 $rm \"\$progdir/\$file\"
4880 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4881 { $rm \"\$progdir/\$program\";
4882 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4883 $rm \"\$progdir/\$file\"
4887 program='$outputname'
4888 progdir=\"\$thisdir/$objdir\"
4894 if test -f \"\$progdir/\$program\"; then"
4896 # Export our shlibpath_var if we have one.
4897 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4899 # Add our own library path to $shlibpath_var
4900 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4902 # Some systems cannot cope with colon-terminated $shlibpath_var
4903 # The second colon is a workaround for a bug in BeOS R4 sed
4904 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4906 export $shlibpath_var
4910 # fixup the dll searchpath if we need to.
4911 if test -n "$dllsearchpath"; then
4913 # Add the dll search path components to the executable PATH
4914 PATH=$dllsearchpath:\$PATH
4919 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4920 # Run the actual program with our arguments.
4923 # Backslashes separate directories on plain windows
4924 *-*-mingw |
*-*-os2*)
4926 exec \$progdir\\\\\$program \${1+\"\$@\"}
4932 exec \$progdir/\$program \${1+\"\$@\"}
4937 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4941 # The program doesn't exist.
4942 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4943 \$echo \"This script is just a wrapper for \$program.\" 1>&2
4944 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
4955 # See if we need to build an old-fashioned archive.
4956 for oldlib
in $oldlibs; do
4958 if test "$build_libtool_libs" = convenience
; then
4959 oldobjs
="$libobjs_save"
4960 addlibs
="$convenience"
4961 build_libtool_libs
=no
4963 if test "$build_libtool_libs" = module
; then
4964 oldobjs
="$libobjs_save"
4965 build_libtool_libs
=no
4967 oldobjs
="$old_deplibs $non_pic_objects"
4969 addlibs
="$old_convenience"
4972 if test -n "$addlibs"; then
4973 gentop
="$output_objdir/${outputname}x"
4974 $show "${rm}r $gentop"
4975 $run ${rm}r
"$gentop"
4976 $show "$mkdir $gentop"
4977 $run $mkdir "$gentop"
4979 if test "$status" -ne 0 && test ! -d "$gentop"; then
4982 generated
="$generated $gentop"
4984 # Add in members from convenience archives.
4985 for xlib
in $addlibs; do
4986 # Extract the objects.
4988 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
4989 *) xabs
=`pwd`"/$xlib" ;;
4991 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4992 xdir
="$gentop/$xlib"
4994 $show "${rm}r $xdir"
4996 $show "$mkdir $xdir"
4999 if test "$status" -ne 0 && test ! -d "$xdir"; then
5002 # We will extract separately just the conflicting names and we will no
5003 # longer touch any unique names. It is faster to leave these extract
5004 # automatically by $AR in one run.
5005 $show "(cd $xdir && $AR x $xabs)"
5006 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
5007 if ($AR t
"$xabs" |
sort |
sort -uc >/dev
/null
2>&1); then
5010 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
5011 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
5012 $AR t
"$xabs" |
sort |
uniq -cd |
while read -r count name
5015 while test "$i" -le "$count"
5017 # Put our $i before any first dot (extension)
5018 # Never overwrite any file
5020 while test "X$name_to" = "X$name" ||
test -f "$xdir/$name_to"
5022 name_to
=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
5024 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
5025 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" ||
exit $?
5031 oldobjs
="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
5035 # Do each command in the archive commands.
5036 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5037 cmds
=$old_archive_from_new_cmds
5039 eval cmds
=\"$old_archive_cmds\"
5041 if len
=`expr "X$cmds" : ".*"` &&
5042 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
5043 cmds
=$old_archive_cmds
5045 # the command line is too long to link in one step, link in parts
5046 $echo "using piecewise archive linking..."
5051 save_oldobjs
=$oldobjs
5052 # GNU ar 2.10+ was changed to match POSIX; thus no paths are
5053 # encoded into archives. This makes 'ar r' malfunction in
5054 # this piecewise linking case whenever conflicting object
5055 # names appear in distinct ar calls; check, warn and compensate.
5056 if (for obj
in $save_oldobjs
5058 $echo "X$obj" |
$Xsed -e 's%^.*/%%'
5059 done |
sort |
sort -uc >/dev
/null
2>&1); then
5062 $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
5063 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
5066 # Is there a better way of finding the last object in the list?
5067 for obj
in $save_oldobjs
5071 for obj
in $save_oldobjs
5073 oldobjs
="$objlist $obj"
5074 objlist
="$objlist $obj"
5075 eval test_cmds
=\"$old_archive_cmds\"
5076 if len
=`expr "X$test_cmds" : ".*"` &&
5077 test "$len" -le "$max_cmd_len"; then
5080 # the above command should be used before it gets too long
5082 if test "$obj" = "$last_oldobj" ; then
5085 test -z "$concat_cmds" || concat_cmds
=$concat_cmds~
5086 eval concat_cmds
=\"\
${concat_cmds}$old_archive_cmds\"
5092 if test "X$oldobjs" = "X" ; then
5093 eval cmds
=\"\
$concat_cmds\"
5095 eval cmds
=\"\
$concat_cmds~\
$old_archive_cmds\"
5099 save_ifs
="$IFS"; IFS
='~'
5100 for cmd
in $cmds; do
5104 $run eval "$cmd" ||
exit $?
5109 if test -n "$generated"; then
5110 $show "${rm}r$generated"
5111 $run ${rm}r
$generated
5114 # Now create the libtool archive.
5118 test "$build_old_libs" = yes && old_library
="$libname.$libext"
5119 $show "creating $output"
5121 # Preserve any variables that may affect compiler behavior
5122 for var
in $variables_saved_for_relink; do
5123 if eval test -z \"\
${$var+set}\"; then
5124 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5125 elif eval var_value
=\$
$var; test -z "$var_value"; then
5126 relink_command
="$var=; export $var; $relink_command"
5128 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5129 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
5132 # Quote the link command for shipping.
5133 relink_command
="(cd `pwd`; $SHELL $0 $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5134 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5135 if test "$hardcode_automatic" = yes ; then
5138 # Only create the output if not a dry run.
5139 if test -z "$run"; then
5140 for installed
in no
yes; do
5141 if test "$installed" = yes; then
5142 if test -z "$install_libdir"; then
5145 output
="$output_objdir/$outputname"i
5146 # Replace all uninstalled libtool libraries with the installed ones
5148 for deplib
in $dependency_libs; do
5151 name
=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5152 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5153 if test -z "$libdir"; then
5154 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5157 newdependency_libs
="$newdependency_libs $libdir/$name"
5159 *) newdependency_libs
="$newdependency_libs $deplib" ;;
5162 dependency_libs
="$newdependency_libs"
5164 for lib
in $dlfiles; do
5165 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5166 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5167 if test -z "$libdir"; then
5168 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5171 newdlfiles
="$newdlfiles $libdir/$name"
5173 dlfiles
="$newdlfiles"
5175 for lib
in $dlprefiles; do
5176 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5177 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5178 if test -z "$libdir"; then
5179 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5182 newdlprefiles
="$newdlprefiles $libdir/$name"
5184 dlprefiles
="$newdlprefiles"
5187 for lib
in $dlfiles; do
5189 [\\/]* |
[A-Za-z
]:[\\/]*) abs
="$lib" ;;
5190 *) abs
=`pwd`"/$lib" ;;
5192 newdlfiles
="$newdlfiles $abs"
5194 dlfiles
="$newdlfiles"
5196 for lib
in $dlprefiles; do
5198 [\\/]* |
[A-Za-z
]:[\\/]*) abs
="$lib" ;;
5199 *) abs
=`pwd`"/$lib" ;;
5201 newdlprefiles
="$newdlprefiles $abs"
5203 dlprefiles
="$newdlprefiles"
5206 # place dlname in correct position for cygwin
5208 case $host,$output,$installed,$module,$dlname in
5209 *cygwin
*,*lai
,yes,no
,*.dll |
*mingw
*,*lai
,yes,no
,*.dll
) tdlname
=..
/bin
/$dlname ;;
5212 # $outputname - a libtool library file
5213 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5215 # Please DO NOT delete this file!
5216 # It is necessary for linking the library.
5218 # The name that we can dlopen(3).
5221 # Names of this library.
5222 library_names='$library_names'
5224 # The name of the static archive.
5225 old_library='$old_library'
5227 # Libraries that this one depends upon.
5228 dependency_libs='$dependency_libs'
5230 # Version information for $libname.
5235 # Is this an already installed library?
5236 installed=$installed
5238 # Should we warn about portability when linking against -modules?
5239 shouldnotlink=$module
5241 # Files to dlopen/dlpreopen
5243 dlpreopen='$dlprefiles'
5245 # Directory that this library needs to be installed in:
5246 libdir='$install_libdir'"
5247 if test "$installed" = no
&& test "$need_relink" = yes; then
5249 relink_command=\"$relink_command\""
5254 # Do a symbolic link so that the libtool archive can be found in
5255 # LD_LIBRARY_PATH before the program is installed.
5256 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5257 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' ||
exit $?
5263 # libtool install mode
5265 modename
="$modename: install"
5267 # There may be an optional sh(1) argument at the beginning of
5268 # install_prog (especially on Windows NT).
5269 if test "$nonopt" = "$SHELL" ||
test "$nonopt" = /bin
/sh ||
5270 # Allow the use of GNU shtool's install command.
5271 $echo "X$nonopt" |
$Xsed |
grep shtool
> /dev
/null
; then
5272 # Aesthetically quote it.
5273 arg
=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5275 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5279 install_prog
="$arg "
5287 # The real first argument should be the name of the installation program.
5288 # Aesthetically quote it.
5289 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5291 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5295 install_prog
="$install_prog$arg"
5297 # We need to accept at least all the BSD install flags.
5307 if test -n "$dest"; then
5308 files
="$files $dest"
5326 # If the previous option needed an argument, then skip it.
5327 if test -n "$prev"; then
5336 # Aesthetically quote the argument.
5337 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5339 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5343 install_prog
="$install_prog $arg"
5346 if test -z "$install_prog"; then
5347 $echo "$modename: you must specify an install program" 1>&2
5352 if test -n "$prev"; then
5353 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5358 if test -z "$files"; then
5359 if test -z "$dest"; then
5360 $echo "$modename: no file or destination specified" 1>&2
5362 $echo "$modename: you must specify a destination" 1>&2
5368 # Strip any trailing slash from the destination.
5369 dest
=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5371 # Check to see that the destination is a directory.
5372 test -d "$dest" && isdir
=yes
5373 if test "$isdir" = yes; then
5377 destdir
=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5378 test "X$destdir" = "X$dest" && destdir
=.
5379 destname
=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5381 # Not a directory, so check to see that there is only one file specified.
5383 if test "$#" -gt 2; then
5384 $echo "$modename: \`$dest' is not a directory" 1>&2
5390 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
5392 for file in $files; do
5396 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5405 # This variable tells wrapper scripts just to set variables rather
5406 # than running their programs.
5407 libtool_install_magic
="$magic"
5412 for file in $files; do
5414 # Do each installation.
5417 # Do the static libraries later.
5418 staticlibs
="$staticlibs $file"
5422 # Check to see that this really is a libtool archive.
5423 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
5425 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5433 # If there is no directory component, then add one.
5435 */* |
*\\*) .
$file ;;
5439 # Add the libdir to current_libdirs if it is the destination.
5440 if test "X$destdir" = "X$libdir"; then
5441 case "$current_libdirs " in
5443 *) current_libdirs
="$current_libdirs $libdir" ;;
5446 # Note the libdir as a future libdir.
5447 case "$future_libdirs " in
5449 *) future_libdirs
="$future_libdirs $libdir" ;;
5453 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5454 test "X$dir" = "X$file/" && dir
=
5457 if test -n "$relink_command"; then
5458 # Determine the prefix the user has applied to our future dir.
5459 inst_prefix_dir
=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5461 # Don't allow the user to place us outside of our expected
5462 # location b/c this prevents finding dependent libraries that
5463 # are installed to the same prefix.
5464 # At present, this check doesn't affect windows .dll's that
5465 # are installed into $libdir/../bin (currently, that works fine)
5466 # but it's something to keep an eye on.
5467 if test "$inst_prefix_dir" = "$destdir"; then
5468 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5472 if test -n "$inst_prefix_dir"; then
5473 # Stick the inst_prefix_dir data into the link command.
5474 relink_command
=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5476 relink_command
=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5479 $echo "$modename: warning: relinking \`$file'" 1>&2
5480 $show "$relink_command"
5481 if $run eval "$relink_command"; then :
5483 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5488 # See the names of the shared library.
5489 set dummy
$library_names
5490 if test -n "$2"; then
5496 test -n "$relink_command" && srcname
="$realname"T
5498 # Install the shared library and build the symlinks.
5499 $show "$install_prog $dir/$srcname $destdir/$realname"
5500 $run eval "$install_prog $dir/$srcname $destdir/$realname" ||
exit $?
5501 if test -n "$stripme" && test -n "$striplib"; then
5502 $show "$striplib $destdir/$realname"
5503 $run eval "$striplib $destdir/$realname" ||
exit $?
5506 if test "$#" -gt 0; then
5507 # Delete the old symlinks, and create new ones.
5510 if test "$linkname" != "$realname"; then
5511 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5512 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5517 # Do each command in the postinstall commands.
5518 lib
="$destdir/$realname"
5519 cmds
=$postinstall_cmds
5520 save_ifs
="$IFS"; IFS
='~'
5521 for cmd
in $cmds; do
5525 $run eval "$cmd" ||
exit $?
5530 # Install the pseudo-library for information purposes.
5531 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5532 instname
="$dir/$name"i
5533 $show "$install_prog $instname $destdir/$name"
5534 $run eval "$install_prog $instname $destdir/$name" ||
exit $?
5536 # Maybe install the static library, too.
5537 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
5541 # Install (i.e. copy) a libtool object.
5543 # Figure out destination file name, if it wasn't already specified.
5544 if test -n "$destname"; then
5545 destfile
="$destdir/$destname"
5547 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5548 destfile
="$destdir/$destfile"
5551 # Deduce the name of the destination old-style object file.
5554 staticdest
=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5557 staticdest
="$destfile"
5561 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5567 # Install the libtool object if requested.
5568 if test -n "$destfile"; then
5569 $show "$install_prog $file $destfile"
5570 $run eval "$install_prog $file $destfile" ||
exit $?
5573 # Install the old object if enabled.
5574 if test "$build_old_libs" = yes; then
5575 # Deduce the name of the old-style object file.
5576 staticobj
=`$echo "X$file" | $Xsed -e "$lo2o"`
5578 $show "$install_prog $staticobj $staticdest"
5579 $run eval "$install_prog \$staticobj \$staticdest" ||
exit $?
5585 # Figure out destination file name, if it wasn't already specified.
5586 if test -n "$destname"; then
5587 destfile
="$destdir/$destname"
5589 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5590 destfile
="$destdir/$destfile"
5593 # If the file is missing, and there is a .exe on the end, strip it
5594 # because it is most likely a libtool script we actually want to
5599 if test ! -f "$file"; then
5600 file=`$echo $file|${SED} 's,.exe$,,'`
5606 # Do a test to see if this is really a libtool program.
5609 wrapper
=`$echo $file | ${SED} -e 's,.exe$,,'`
5615 if (${SED} -e '4q' $wrapper |
grep "^# Generated by .*$PACKAGE")>/dev
/null
2>&1; then
5619 # To insure that "foo" is sourced, and not "foo.exe",
5620 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5621 # which disallows the automatic-append-.exe behavior.
5623 *cygwin
* |
*mingw
*) wrapperdot
=${wrapper}.
;;
5624 *) wrapperdot
=${wrapper} ;;
5626 # If there is no directory component, then add one.
5628 */* |
*\\*) .
${wrapperdot} ;;
5629 *) . .
/${wrapperdot} ;;
5632 # Check the variables that should have been set.
5633 if test -z "$notinst_deplibs"; then
5634 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5639 for lib
in $notinst_deplibs; do
5640 # Check to see that each library is installed.
5642 if test -f "$lib"; then
5643 # If there is no directory component, then add one.
5645 */* |
*\\*) .
$lib ;;
5649 libfile
="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5650 if test -n "$libdir" && test ! -f "$libfile"; then
5651 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5657 # To insure that "foo" is sourced, and not "foo.exe",
5658 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5659 # which disallows the automatic-append-.exe behavior.
5661 *cygwin
* |
*mingw
*) wrapperdot
=${wrapper}.
;;
5662 *) wrapperdot
=${wrapper} ;;
5664 # If there is no directory component, then add one.
5666 */* |
*\\*) .
${wrapperdot} ;;
5667 *) . .
/${wrapperdot} ;;
5671 if test "$fast_install" = no
&& test -n "$relink_command"; then
5672 if test "$finalize" = yes && test -z "$run"; then
5674 test -n "$TMPDIR" && tmpdir
="$TMPDIR"
5675 tmpdir
="$tmpdir/libtool-$$"
5676 if $mkdir "$tmpdir" && chmod 700 "$tmpdir"; then :
5678 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5681 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5682 outputname
="$tmpdir/$file"
5683 # Replace the output file specification.
5684 relink_command
=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5686 $show "$relink_command"
5687 if $run eval "$relink_command"; then :
5689 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5695 $echo "$modename: warning: cannot relink \`$file'" 1>&2
5698 # Install the binary that we compiled earlier.
5699 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5703 # remove .exe since cygwin /usr/bin/install will append another
5705 case $install_prog,$host in
5706 */usr
/bin
/install*,*cygwin
*)
5707 case $file:$destfile in
5712 destfile
=$destfile.exe
5715 destfile
=`$echo $destfile | ${SED} -e 's,.exe$,,'`
5720 $show "$install_prog$stripme $file $destfile"
5721 $run eval "$install_prog\$stripme \$file \$destfile" ||
exit $?
5722 test -n "$outputname" && ${rm}r
"$tmpdir"
5727 for file in $staticlibs; do
5728 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5730 # Set up the ranlib parameters.
5731 oldlib
="$destdir/$name"
5733 $show "$install_prog $file $oldlib"
5734 $run eval "$install_prog \$file \$oldlib" ||
exit $?
5736 if test -n "$stripme" && test -n "$old_striplib"; then
5737 $show "$old_striplib $oldlib"
5738 $run eval "$old_striplib $oldlib" ||
exit $?
5741 # Do each command in the postinstall commands.
5742 cmds
=$old_postinstall_cmds
5743 save_ifs
="$IFS"; IFS
='~'
5744 for cmd
in $cmds; do
5748 $run eval "$cmd" ||
exit $?
5753 if test -n "$future_libdirs"; then
5754 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5757 if test -n "$current_libdirs"; then
5758 # Maybe just do a dry run.
5759 test -n "$run" && current_libdirs
=" -n$current_libdirs"
5760 exec_cmd
='$SHELL $0 $preserve_args --finish$current_libdirs'
5766 # libtool finish mode
5768 modename
="$modename: finish"
5772 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5775 libdirs
="$libdirs $dir"
5778 for libdir
in $libdirs; do
5779 if test -n "$finish_cmds"; then
5780 # Do each command in the finish commands.
5782 save_ifs
="$IFS"; IFS
='~'
5783 for cmd
in $cmds; do
5787 $run eval "$cmd" || admincmds
="$admincmds
5792 if test -n "$finish_eval"; then
5793 # Do the single finish_eval.
5794 eval cmds
=\"$finish_eval\"
5795 $run eval "$cmds" || admincmds
="$admincmds
5801 # Exit here if they wanted silent mode.
5802 test "$show" = : && exit 0
5804 $echo "----------------------------------------------------------------------"
5805 $echo "Libraries have been installed in:"
5806 for libdir
in $libdirs; do
5810 $echo "If you ever happen to want to link against installed libraries"
5811 $echo "in a given directory, LIBDIR, you must either use libtool, and"
5812 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5813 $echo "flag during linking and do at least one of the following:"
5814 if test -n "$shlibpath_var"; then
5815 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5816 $echo " during execution"
5818 if test -n "$runpath_var"; then
5819 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
5820 $echo " during linking"
5822 if test -n "$hardcode_libdir_flag_spec"; then
5824 eval flag
=\"$hardcode_libdir_flag_spec\"
5826 $echo " - use the \`$flag' linker flag"
5828 if test -n "$admincmds"; then
5829 $echo " - have your system administrator run these commands:$admincmds"
5831 if test -f /etc
/ld.so.conf
; then
5832 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5835 $echo "See any operating system documentation about shared libraries for"
5836 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
5837 $echo "----------------------------------------------------------------------"
5841 # libtool execute mode
5843 modename
="$modename: execute"
5845 # The first argument is the command name.
5847 if test -z "$cmd"; then
5848 $echo "$modename: you must specify a COMMAND" 1>&2
5853 # Handle -dlopen flags immediately.
5854 for file in $execute_dlfiles; do
5855 if test ! -f "$file"; then
5856 $echo "$modename: \`$file' is not a file" 1>&2
5864 # Check to see that this really is a libtool archive.
5865 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
5867 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5872 # Read the libtool library.
5876 # If there is no directory component, then add one.
5878 */* |
*\\*) .
$file ;;
5882 # Skip this library if it cannot be dlopened.
5883 if test -z "$dlname"; then
5884 # Warn if it was a shared library.
5885 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
5889 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5890 test "X$dir" = "X$file" && dir
=.
5892 if test -f "$dir/$objdir/$dlname"; then
5895 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5901 # Just add the directory containing the .lo file.
5902 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5903 test "X$dir" = "X$file" && dir
=.
5907 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
5912 # Get the absolute pathname.
5913 absdir
=`cd "$dir" && pwd`
5914 test -n "$absdir" && dir
="$absdir"
5916 # Now add the directory to shlibpath_var.
5917 if eval "test -z \"\$$shlibpath_var\""; then
5918 eval "$shlibpath_var=\"\$dir\""
5920 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
5924 # This variable tells wrapper scripts just to set shlibpath_var
5925 # rather than running their programs.
5926 libtool_execute_magic
="$magic"
5928 # Check if any of the arguments is a wrapper script.
5935 # Do a test to see if this is really a libtool program.
5936 if (${SED} -e '4q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
5937 # If there is no directory component, then add one.
5939 */* |
*\\*) .
$file ;;
5943 # Transform arg to wrapped name.
5944 file="$progdir/$program"
5948 # Quote arguments (to preserve shell metacharacters).
5949 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
5950 args
="$args \"$file\""
5953 if test -z "$run"; then
5954 if test -n "$shlibpath_var"; then
5955 # Export the shlibpath_var.
5956 eval "export $shlibpath_var"
5959 # Restore saved environment variables
5960 if test "${save_LC_ALL+set}" = set; then
5961 LC_ALL
="$save_LC_ALL"; export LC_ALL
5963 if test "${save_LANG+set}" = set; then
5964 LANG
="$save_LANG"; export LANG
5967 # Now prepare to actually exec the command.
5968 exec_cmd
="\$cmd$args"
5970 # Display what would be done.
5971 if test -n "$shlibpath_var"; then
5972 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
5973 $echo "export $shlibpath_var"
5980 # libtool clean and uninstall mode
5982 modename
="$modename: $mode"
5988 # This variable tells wrapper scripts just to set variables rather
5989 # than running their programs.
5990 libtool_install_magic
="$magic"
5995 -f) rm="$rm $arg"; rmforce
=yes ;;
5996 -*) rm="$rm $arg" ;;
5997 *) files
="$files $arg" ;;
6001 if test -z "$rm"; then
6002 $echo "$modename: you must specify an RM program" 1>&2
6009 origobjdir
="$objdir"
6010 for file in $files; do
6011 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6012 if test "X$dir" = "X$file"; then
6014 objdir
="$origobjdir"
6016 objdir
="$dir/$origobjdir"
6018 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6019 test "$mode" = uninstall
&& objdir
="$dir"
6021 # Remember objdir for removal later, being careful to avoid duplicates
6022 if test "$mode" = clean
; then
6025 *) rmdirs
="$rmdirs $objdir" ;;
6029 # Don't error if the file doesn't exist and rm -f was used.
6030 if (test -L "$file") >/dev
/null
2>&1 \
6031 ||
(test -h "$file") >/dev
/null
2>&1 \
6032 ||
test -f "$file"; then
6034 elif test -d "$file"; then
6037 elif test "$rmforce" = yes; then
6045 # Possibly a libtool archive, so verify it.
6046 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6049 # Delete the libtool libraries and symlinks.
6050 for n
in $library_names; do
6051 rmfiles
="$rmfiles $objdir/$n"
6053 test -n "$old_library" && rmfiles
="$rmfiles $objdir/$old_library"
6054 test "$mode" = clean
&& rmfiles
="$rmfiles $objdir/$name $objdir/${name}i"
6056 if test "$mode" = uninstall
; then
6057 if test -n "$library_names"; then
6058 # Do each command in the postuninstall commands.
6059 cmds
=$postuninstall_cmds
6060 save_ifs
="$IFS"; IFS
='~'
6061 for cmd
in $cmds; do
6066 if test "$?" -ne 0 && test "$rmforce" != yes; then
6073 if test -n "$old_library"; then
6074 # Do each command in the old_postuninstall commands.
6075 cmds
=$old_postuninstall_cmds
6076 save_ifs
="$IFS"; IFS
='~'
6077 for cmd
in $cmds; do
6082 if test "$?" -ne 0 && test "$rmforce" != yes; then
6088 # FIXME: should reinstall the best remaining shared library.
6094 # Possibly a libtool object, so verify it.
6095 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6100 # Add PIC object to the list of files to remove.
6101 if test -n "$pic_object" \
6102 && test "$pic_object" != none
; then
6103 rmfiles
="$rmfiles $dir/$pic_object"
6106 # Add non-PIC object to the list of files to remove.
6107 if test -n "$non_pic_object" \
6108 && test "$non_pic_object" != none
; then
6109 rmfiles
="$rmfiles $dir/$non_pic_object"
6115 if test "$mode" = clean
; then
6119 file=`$echo $file|${SED} 's,.exe$,,'`
6120 noexename
=`$echo $name|${SED} 's,.exe$,,'`
6121 # $file with .exe has already been added to rmfiles,
6122 # add $file without .exe
6123 rmfiles
="$rmfiles $file"
6126 # Do a test to see if this is a libtool program.
6127 if (${SED} -e '4q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6131 # note $name still contains .exe if it was in $file originally
6132 # as does the version of $file that was added into $rmfiles
6133 rmfiles
="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6134 if test "$fast_install" = yes && test -n "$relink_command"; then
6135 rmfiles
="$rmfiles $objdir/lt-$name"
6137 if test "X$noexename" != "X$name" ; then
6138 rmfiles
="$rmfiles $objdir/lt-${noexename}.c"
6144 $show "$rm $rmfiles"
6145 $run $rm $rmfiles || exit_status
=1
6147 objdir
="$origobjdir"
6149 # Try to remove the ${objdir}s in the directories where we deleted files
6150 for dir
in $rmdirs; do
6151 if test -d "$dir"; then
6153 $run rmdir $dir >/dev
/null
2>&1
6161 $echo "$modename: you must specify a MODE" 1>&2
6162 $echo "$generic_help" 1>&2
6167 if test -z "$exec_cmd"; then
6168 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6169 $echo "$generic_help" 1>&2
6172 fi # test -z "$show_help"
6174 if test -n "$exec_cmd"; then
6179 # We need to display help for each of the modes.
6182 "Usage: $modename [OPTION]... [MODE-ARG]...
6184 Provide generalized library-building support services.
6186 --config show all configuration variables
6187 --debug enable verbose shell tracing
6188 -n, --dry-run display commands without modifying any files
6189 --features display basic configuration information and exit
6190 --finish same as \`--mode=finish'
6191 --help display this help message and exit
6192 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6193 --quiet same as \`--silent'
6194 --silent don't print informational messages
6195 --tag=TAG use configuration variables from tag TAG
6196 --version print version information
6198 MODE must be one of the following:
6200 clean remove files from the build directory
6201 compile compile a source file into a libtool object
6202 execute automatically set library path, then run a program
6203 finish complete the installation of libtool libraries
6204 install install libraries or executables
6205 link create a library or an executable
6206 uninstall remove libraries from an installed directory
6208 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6209 a more detailed description of MODE.
6211 Report bugs to <bug-libtool@gnu.org>."
6217 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6219 Remove files from the build directory.
6221 RM is the name of the program to use to delete files associated with each FILE
6222 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6225 If FILE is a libtool library, object or program, all the files associated
6226 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6231 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6233 Compile a source file into a libtool library object.
6235 This mode accepts the following additional options:
6237 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6238 -prefer-pic try to building PIC objects only
6239 -prefer-non-pic try to building non-PIC objects only
6240 -static always build a \`.o' file suitable for static linking
6242 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6243 from the given SOURCEFILE.
6245 The output file name is determined by removing the directory component from
6246 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6247 library object suffix, \`.lo'."
6252 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6254 Automatically set library path, then run a program.
6256 This mode accepts the following additional options:
6258 -dlopen FILE add the directory containing FILE to the library path
6260 This mode sets the library path environment variable according to \`-dlopen'
6263 If any of the ARGS are libtool executable wrappers, then they are translated
6264 into their corresponding uninstalled binary, and any of their required library
6265 directories are added to the library path.
6267 Then, COMMAND is executed, with ARGS as arguments."
6272 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6274 Complete the installation of libtool libraries.
6276 Each LIBDIR is a directory that contains libtool libraries.
6278 The commands that this mode executes may require superuser privileges. Use
6279 the \`--dry-run' option if you just want to see what would be executed."
6284 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6286 Install executables or libraries.
6288 INSTALL-COMMAND is the installation command. The first component should be
6289 either the \`install' or \`cp' program.
6291 The rest of the components are interpreted as arguments to that command (only
6292 BSD-compatible install options are recognized)."
6297 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6299 Link object files or libraries together to form another library, or to
6300 create an executable program.
6302 LINK-COMMAND is a command using the C compiler that you would use to create
6303 a program from several object files.
6305 The following components of LINK-COMMAND are treated specially:
6307 -all-static do not do any dynamic linking at all
6308 -avoid-version do not add a version suffix if possible
6309 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6310 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6311 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6312 -export-symbols SYMFILE
6313 try to export only the symbols listed in SYMFILE
6314 -export-symbols-regex REGEX
6315 try to export only the symbols matching REGEX
6316 -LLIBDIR search LIBDIR for required installed libraries
6317 -lNAME OUTPUT-FILE requires the installed library libNAME
6318 -module build a library that can dlopened
6319 -no-fast-install disable the fast-install mode
6320 -no-install link a not-installable executable
6321 -no-undefined declare that a library does not refer to external symbols
6322 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6323 -objectlist FILE Use a list of object files found in FILE to specify objects
6324 -precious-files-regex REGEX
6325 don't remove output files matching REGEX
6326 -release RELEASE specify package release information
6327 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6328 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6329 -static do not do any dynamic linking of libtool libraries
6330 -version-info CURRENT[:REVISION[:AGE]]
6331 specify library version info [each variable defaults to 0]
6333 All other options (arguments beginning with \`-') are ignored.
6335 Every other argument is treated as a filename. Files ending in \`.la' are
6336 treated as uninstalled libtool libraries, other files are standard or library
6339 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6340 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6341 required, except when creating a convenience library.
6343 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6344 using \`ar' and \`ranlib', or on Windows using \`lib'.
6346 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6347 is created, otherwise an executable program is created."
6352 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6354 Remove libraries from an installation directory.
6356 RM is the name of the program to use to delete files associated with each FILE
6357 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6360 If FILE is a libtool library, all the files associated with it are deleted.
6361 Otherwise, only FILE itself is deleted using RM."
6365 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6372 $echo "Try \`$modename --help' for more information about other modes."
6376 # The TAGs below are defined such that we never get into a situation
6377 # in which we disable both kinds of libraries. Given conflicting
6378 # choices, we go for a static library, that is the most portable,
6379 # since we can't tell whether shared libraries were disabled because
6380 # the user asked for that or because the platform doesn't support
6381 # them. This is particularly important on AIX, because we don't
6382 # support having both static and shared libraries enabled at the same
6383 # time on that platform, so we default to a shared-only configuration.
6384 # If a disable-shared tag is given, we'll fallback to a static-only
6385 # configuration. But we'll never go from static-only to shared-only.
6387 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6388 build_libtool_libs
=no
6390 # ### END LIBTOOL TAG CONFIG: disable-shared
6392 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6393 build_old_libs
=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6394 # ### END LIBTOOL TAG CONFIG: disable-static