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
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.1192 2003/02/18 05:15:03)"
63 help="Try \`$progname --help' for more information."
64 magic
="%%%MAGIC variable%%%"
69 # Sed substitution that helps us do robust quoting. It backslashifies
70 # metacharacters that are still active within double-quoted strings.
71 Xsed
="${SED}"' -e 1s/^X//'
72 sed_quote_subst
='s/\([\\`\\"$\\\\]\)/\\\1/g'
73 # test EBCDIC or ASCII
74 case `echo A|od -x` in
75 *[Cc
]1*) # EBCDIC based system
76 SP2NL
="tr '\100' '\n'"
77 NL2SP
="tr '\r\n' '\100\100'"
79 *) # Assume ASCII based system
80 SP2NL
="tr '\040' '\012'"
81 NL2SP
="tr '\015\012' '\040\040'"
86 # Only set LANG and LC_ALL to C if already set.
87 # These must not be set unconditionally because not all systems understand
88 # e.g. LANG=C (notably SCO).
89 # We save the old values to restore during execute mode.
90 if test "${LC_ALL+set}" = set; then
91 save_LC_ALL
="$LC_ALL"; LC_ALL
=C
; export LC_ALL
93 if test "${LANG+set}" = set; then
94 save_LANG
="$LANG"; LANG
=C
; export LANG
97 # 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 |
head -n 10 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 #####################################
162 # Parse our command line options once, thoroughly.
163 while test "$#" -gt 0
169 -*=*) optarg
=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
173 # If the previous option needs an argument, assign it.
174 if test -n "$prev"; then
177 execute_dlfiles
="$execute_dlfiles $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 1996, 1997, 1998, 1999, 2000, 2001"
226 echo "Free Software Foundation, Inc."
227 echo "This is free software; see the source for copying conditions. There is NO"
228 echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
233 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
234 # Now print the configurations for the tags.
235 for tagname
in $taglist; do
236 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
242 echo "$progname: enabling shell trace mode"
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" ;;
276 --tag) prevopt
="--tag" prev
=tag
;;
278 set tag
"$optarg" ${1+"$@"}
289 $echo "$modename: unrecognized option \`$arg'" 1>&2
301 if test -n "$prevopt"; then
302 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
307 # If this variable is set in any of the actions, the command in it
308 # will be execed at the end. This prevents here-documents from being
309 # left over by shells.
312 if test -z "$show_help"; then
314 # Infer the operation mode.
315 if test -z "$mode"; then
316 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
317 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
319 *cc | cc
* |
*++ | gcc
* |
*-gcc* | g
++* | xlc
*)
331 *db |
*dbx |
*strace |
*truss
)
341 # If we have no mode, but dlfiles were specified, then do execute mode.
342 test -n "$execute_dlfiles" && mode
=execute
344 # Just use the default operation mode.
345 if test -z "$mode"; then
346 if test -n "$nonopt"; then
347 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
349 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
356 # Only execute mode is allowed to have -dlopen flags.
357 if test -n "$execute_dlfiles" && test "$mode" != execute
; then
358 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
363 # Change the help message to a mode-specific one.
365 help="Try \`$modename --help --mode=$mode' for more information."
367 # These modes are in order of execution frequency so that they run quickly.
369 # libtool compile mode
371 modename
="$modename: compile"
372 # Get the compilation command and the source file.
374 srcfile
="$nonopt" # always keep a non-empty value in "srcfile"
383 # do not "continue". Instead, add this to base_compile
395 # Accept any command-line options.
398 if test -n "$libobj" ; then
399 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
422 arg_mode
=arg
# the next one goes into the "base_compile" arg list
423 continue # The current "srcfile" will either be retained or
424 ;; # replaced later. I would guess that would be a bug.
427 args
=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
429 save_ifs
="$IFS"; IFS
=','
433 # Double-quote args containing other shell metacharacters.
434 # Many Bourne shells cannot handle close brackets correctly
435 # in scan sets, so we specify it separately.
437 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
441 lastarg
="$lastarg $arg"
444 lastarg
=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
446 # Add the arguments to base_compile.
447 base_compile
="$base_compile $lastarg"
452 # Accept the current argument as the source file.
453 # The previous "srcfile" becomes the current argument.
460 esac # case $arg_mode
462 # Aesthetically quote the previous argument.
463 lastarg
=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
466 # Double-quote args containing other shell metacharacters.
467 # Many Bourne shells cannot handle close brackets correctly
468 # in scan sets, so we specify it separately.
469 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
470 lastarg
="\"$lastarg\""
474 base_compile
="$base_compile $lastarg"
479 $echo "$modename: you must specify an argument for -Xcompile"
483 $echo "$modename: you must specify a target with \`-o'" 1>&2
487 # Get the name of the library object.
488 [ -z "$libobj" ] && libobj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
492 # Recognize several different file suffixes.
493 # If the user specifies -o file.o, it is replaced with file.lo
503 *.class
) xform
=class
;;
508 *.java
) xform
=java
;;
511 libobj
=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
514 *.lo
) obj
=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
516 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
521 # Infer tagged configuration to use if any are available and
522 # if one wasn't chosen via the "--tag" command line option.
523 # Only attempt this if the compiler in the base compile
524 # command doesn't match the default compiler.
525 if test -n "$available_tags" && test -z "$tagname"; then
526 case $base_compile in
527 # Blanks in the command may have been stripped by the calling shell,
528 # but not from the CC environment variable when configure was run.
529 " $CC "* |
"$CC "* |
" `$echo $CC` "* |
"`$echo $CC` "*) ;;
530 # Blanks at the start of $base_compile will cause this to fail
531 # if we don't check for them as well.
533 for z
in $available_tags; do
534 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev
/null
; then
535 # Evaluate the configuration.
536 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
537 case "$base_compile " in
538 "$CC "* |
" $CC "* |
"`$echo $CC` "* |
" `$echo $CC` "*)
539 # The compiler in the base compile command matches
540 # the one in the tagged configuration.
541 # Assume this is the tagged configuration we want.
548 # If $tagname still isn't set, then no tagged configuration
549 # was found and let the user know that the "--tag" command
550 # line option must be used.
551 if test -z "$tagname"; then
552 echo "$modename: unable to infer tagged configuration"
553 echo "$modename: specify a tag with \`--tag'" 1>&2
556 # echo "$modename: using $tagname tagged configuration"
562 objname
=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
563 xdir
=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
564 if test "X$xdir" = "X$obj"; then
569 lobj
=${xdir}$objdir/$objname
571 if test -z "$base_compile"; then
572 $echo "$modename: you must specify a compilation command" 1>&2
577 # Delete any leftover library objects.
578 if test "$build_old_libs" = yes; then
579 removelist
="$obj $lobj $libobj ${libobj}T"
581 removelist
="$lobj $libobj ${libobj}T"
585 trap "$run $rm $removelist; exit 1" 1 2 15
587 # On Cygwin there's no "real" PIC flag so we must build both object types
589 cygwin
* | mingw
* | pw32
* | os2
*)
593 if test "$pic_mode" = no
&& test "$deplibs_check_method" != pass_all
; then
594 # non-PIC code in shared libraries is not supported
598 # Calculate the filename of the output object if compiler does
599 # not support -o with -c
600 if test "$compiler_c_o" = no
; then
601 output_obj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.
${objext}
602 lockfile
="$output_obj.lock"
603 removelist
="$removelist $output_obj $lockfile"
604 trap "$run $rm $removelist; exit 1" 1 2 15
611 # Lock this critical section if it is needed
612 # We use this script file to make the link, it avoids creating a new file
613 if test "$need_locks" = yes; then
614 until $run ln "$0" "$lockfile" 2>/dev
/null
; do
615 $show "Waiting for $lockfile to be removed"
618 elif test "$need_locks" = warn
; then
619 if test -f "$lockfile"; then
621 *** ERROR, $lockfile exists and contains:
622 `cat $lockfile 2>/dev/null`
624 This indicates that another process is trying to use the same
625 temporary object file, and libtool could not work around it because
626 your compiler does not support \`-c' and \`-o' together. If you
627 repeat this compilation, it may succeed, by chance, but you had better
628 avoid parallel builds (make -j) in this platform, or get a better
634 echo $srcfile > "$lockfile"
637 if test -n "$fix_srcfile_path"; then
638 eval srcfile
=\"$fix_srcfile_path\"
641 $run $rm "$libobj" "${libobj}T"
643 # Create a libtool object file (analogous to a ".la" file),
644 # but don't create it if we're doing a dry run.
645 test -z "$run" && cat > ${libobj}T
<<EOF
646 # $libobj - a libtool object file
647 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
649 # Please DO NOT delete this file!
650 # It is necessary for linking the library.
652 # Name of the PIC object.
655 # Only build a PIC object if we are building libtool libraries.
656 if test "$build_libtool_libs" = yes; then
657 # Without this assignment, base_compile gets emptied.
658 fbsd_hideous_sh_bug
=$base_compile
660 if test "$pic_mode" != no
; then
661 command="$base_compile $srcfile $pic_flag"
663 # Don't build PIC code
664 command="$base_compile $srcfile"
667 if test ! -d "${xdir}$objdir"; then
668 $show "$mkdir ${xdir}$objdir"
669 $run $mkdir ${xdir}$objdir
671 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
676 if test -z "$output_obj"; then
677 # Place PIC objects in $objdir
678 command="$command -o $lobj"
681 $run $rm "$lobj" "$output_obj"
684 if $run eval "$command"; then :
686 test -n "$output_obj" && $run $rm $removelist
690 if test "$need_locks" = warn
&&
691 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
693 *** ERROR, $lockfile contains:
694 `cat $lockfile 2>/dev/null`
696 but it should contain:
699 This indicates that another process is trying to use the same
700 temporary object file, and libtool could not work around it because
701 your compiler does not support \`-c' and \`-o' together. If you
702 repeat this compilation, it may succeed, by chance, but you had better
703 avoid parallel builds (make -j) in this platform, or get a better
710 # Just move the object if needed, then go on to compile the next one
711 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
712 $show "$mv $output_obj $lobj"
713 if $run $mv $output_obj $lobj; then :
721 # Append the name of the PIC object to the libtool object file.
722 test -z "$run" && cat >> ${libobj}T
<<EOF
723 pic_object='$objdir/$objname'
727 # Allow error messages only from the first compilation.
728 suppress_output
=' >/dev/null 2>&1'
730 # No PIC object so indicate it doesn't exist in the libtool
732 test -z "$run" && cat >> ${libobj}T
<<EOF
738 # Only build a position-dependent object if we build old libraries.
739 if test "$build_old_libs" = yes; then
740 if test "$pic_mode" != yes; then
741 # Don't build PIC code
742 command="$base_compile $srcfile"
744 command="$base_compile $srcfile $pic_flag"
746 if test "$compiler_c_o" = yes; then
747 command="$command -o $obj"
750 # Suppress compiler output if we already did a PIC compilation.
751 command="$command$suppress_output"
752 $run $rm "$obj" "$output_obj"
754 if $run eval "$command"; then :
760 if test "$need_locks" = warn
&&
761 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
763 *** ERROR, $lockfile contains:
764 `cat $lockfile 2>/dev/null`
766 but it should contain:
769 This indicates that another process is trying to use the same
770 temporary object file, and libtool could not work around it because
771 your compiler does not support \`-c' and \`-o' together. If you
772 repeat this compilation, it may succeed, by chance, but you had better
773 avoid parallel builds (make -j) in this platform, or get a better
780 # Just move the object if needed
781 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
782 $show "$mv $output_obj $obj"
783 if $run $mv $output_obj $obj; then :
791 # Append the name of the non-PIC object the libtool object file.
792 # Only append if the libtool object file exists.
793 test -z "$run" && cat >> ${libobj}T
<<EOF
794 # Name of the non-PIC object.
795 non_pic_object='$objname'
799 # Append the name of the non-PIC object the libtool object file.
800 # Only append if the libtool object file exists.
801 test -z "$run" && cat >> ${libobj}T
<<EOF
802 # Name of the non-PIC object.
808 $run $mv "${libobj}T" "${libobj}"
810 # Unlock the critical section if it was locked
811 if test "$need_locks" != no
; then
820 modename
="$modename: link"
822 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
823 # It is impossible to link a dll without this setting, and
824 # we shouldn't force the makefile maintainer to figure out
825 # which system we are compiling for in order to pass an extra
826 # flag for every libtool invocation.
829 # FIXME: Unfortunately, there are problems with the above when trying
830 # to make a dll which has undefined symbols, in which case not
831 # even a static library is built. For now, we need to specify
832 # -no-undefined on the libtool link line when we can be certain
833 # that all symbols are satisfied, otherwise we get a static library.
840 libtool_args
="$nonopt"
841 base_compile
="$nonopt"
842 compile_command
="$nonopt"
843 finalize_command
="$nonopt"
856 lib_search_path
=`pwd`
865 export_symbols_regex
=
873 prefer_static_libs
=no
886 # We need to know -static, to get the right output filenames.
890 -all-static |
-static)
891 if test "X$arg" = "X-all-static"; then
892 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
893 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
895 if test -n "$link_static_flag"; then
896 dlopen_self
=$dlopen_self_static
899 if test -z "$pic_flag" && test -n "$link_static_flag"; then
900 dlopen_self
=$dlopen_self_static
903 build_libtool_libs
=no
905 prefer_static_libs
=yes
911 # See if our shared archives depend on static archives.
912 test -n "$old_archive_from_new_cmds" && build_old_libs
=yes
914 # Go through the arguments, transforming them on the way.
915 while test "$#" -gt 0; do
917 base_compile
="$base_compile $arg"
920 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
921 qarg
=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
925 libtool_args
="$libtool_args $qarg"
927 # If the previous option needs an argument, assign it.
928 if test -n "$prev"; then
931 compile_command
="$compile_command @OUTPUT@"
932 finalize_command
="$finalize_command @OUTPUT@"
938 if test "$preload" = no
; then
939 # Add the symbol object into the linking commands.
940 compile_command
="$compile_command @SYMFILE@"
941 finalize_command
="$finalize_command @SYMFILE@"
945 *.la |
*.lo
) ;; # We handle these cases below.
947 if test "$dlself" = no
; then
955 if test "$prev" = dlprefiles
; then
957 elif test "$prev" = dlfiles
&& test "$dlopen_self" != yes; then
967 if test "$prev" = dlfiles
; then
968 dlfiles
="$dlfiles $arg"
970 dlprefiles
="$dlprefiles $arg"
978 export_symbols
="$arg"
979 if test ! -f "$arg"; then
980 $echo "$modename: symbol file \`$arg' does not exist"
987 export_symbols_regex
="$arg"
992 inst_prefix_dir
="$arg"
1002 if test -f "$arg"; then
1005 for fil
in `cat $save_arg`
1007 # moreargs="$moreargs $fil"
1009 # A libtool-controlled object.
1011 # Check to see that this really is a libtool object.
1012 if (${SED} -e '2q' $arg |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1017 # If there is no directory component, then add one.
1019 */* |
*\\*) .
$arg ;;
1023 if test -z "$pic_object" || \
1024 test -z "$non_pic_object" ||
1025 test "$pic_object" = none
&& \
1026 test "$non_pic_object" = none
; then
1027 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1031 # Extract subdirectory from the argument.
1032 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1033 if test "X$xdir" = "X$arg"; then
1039 if test "$pic_object" != none
; then
1040 # Prepend the subdirectory the object is found in.
1041 pic_object
="$xdir$pic_object"
1043 if test "$prev" = dlfiles
; then
1044 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1045 dlfiles
="$dlfiles $pic_object"
1049 # If libtool objects are unsupported, then we need to preload.
1054 # CHECK ME: I think I busted this. -Ossama
1055 if test "$prev" = dlprefiles
; then
1056 # Preload the old-style object.
1057 dlprefiles
="$dlprefiles $pic_object"
1062 libobjs
="$libobjs $pic_object"
1067 if test "$non_pic_object" != none
; then
1068 # Prepend the subdirectory the object is found in.
1069 non_pic_object
="$xdir$non_pic_object"
1071 # A standard non-PIC object
1072 non_pic_objects
="$non_pic_objects $non_pic_object"
1073 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1074 arg
="$non_pic_object"
1078 # Only an error if not doing a dry-run.
1079 if test -z "$run"; then
1080 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1085 # Extract subdirectory from the argument.
1086 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1087 if test "X$xdir" = "X$arg"; then
1093 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1094 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1095 libobjs
="$libobjs $pic_object"
1096 non_pic_objects
="$non_pic_objects $non_pic_object"
1101 $echo "$modename: link input file \`$save_arg' does not exist"
1109 # We need an absolute path.
1111 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1113 $echo "$modename: only absolute run-paths are allowed" 1>&2
1117 if test "$prev" = rpath
; then
1120 *) rpath
="$rpath $arg" ;;
1125 *) xrpath
="$xrpath $arg" ;;
1132 compiler_flags
="$compiler_flags $qarg"
1134 compile_command
="$compile_command $qarg"
1135 finalize_command
="$finalize_command $qarg"
1139 linker_flags
="$linker_flags $qarg"
1140 compiler_flags
="$compiler_flags $wl$qarg"
1142 compile_command
="$compile_command $wl$qarg"
1143 finalize_command
="$finalize_command $wl$qarg"
1147 linker_flags
="$linker_flags $qarg"
1148 compiler_flags
="$compiler_flags $qarg"
1150 compile_command
="$compile_command $qarg"
1151 finalize_command
="$finalize_command $qarg"
1155 eval "$prev=\"\$arg\""
1160 fi # test -n "$prev"
1166 if test -n "$link_static_flag"; then
1167 compile_command
="$compile_command $link_static_flag"
1168 finalize_command
="$finalize_command $link_static_flag"
1174 # FIXME: remove this flag sometime in the future.
1175 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1199 -export-symbols |
-export-symbols-regex)
1200 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
1201 $echo "$modename: more than one -exported-symbols argument is not allowed"
1204 if test "X$arg" = "X-export-symbols"; then
1217 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1218 # so, if we see these flags be careful not to treat them like -L
1220 case $with_gcc/$host in
1221 no
/*-*-irix* |
/*-*-irix*)
1222 compile_command
="$compile_command $arg"
1223 finalize_command
="$finalize_command $arg"
1230 dir
=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1231 # We need an absolute path.
1233 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1235 absdir
=`cd "$dir" && pwd`
1236 if test -z "$absdir"; then
1237 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1246 deplibs
="$deplibs -L$dir"
1247 lib_search_path
="$lib_search_path $dir"
1251 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1252 case :$dllsearchpath: in
1254 *) dllsearchpath
="$dllsearchpath:$dir";;
1262 if test "X$arg" = "X-lc" ||
test "X$arg" = "X-lm"; then
1264 *-*-cygwin* |
*-*-pw32* |
*-*-beos*)
1265 # These systems don't actually have a C or math library (as such)
1268 *-*-mingw* |
*-*-os2*)
1269 # These systems don't actually have a C library (as such)
1270 test "X$arg" = "X-lc" && continue
1272 *-*-openbsd* |
*-*-freebsd*)
1273 # Do not include libc due to us having libc/libc_r.
1274 test "X$arg" = "X-lc" && continue
1276 *-*-rhapsody* |
*-*-darwin1.
[012])
1277 # Rhapsody C and math libraries are in the System framework
1278 deplibs
="$deplibs -framework System"
1281 elif test "X$arg" = "X-lc_r"; then
1283 *-*-openbsd* |
*-*-freebsd*)
1284 # Do not include libc_r directly, use -pthread flag.
1289 deplibs
="$deplibs $arg"
1298 # gcc -m* arguments should be passed to the linker via $compiler_flags
1299 # in order to pass architecture information to the linker
1300 # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
1301 # but this is not reliable with gcc because gcc may use -mfoo to
1302 # select a different linker, different libraries, etc, while
1303 # -Wl,-mfoo simply passes -mfoo to the linker.
1305 # Unknown arguments in both finalize_command and compile_command need
1306 # to be aesthetically quoted because they are evaled later.
1307 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1309 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1313 compile_command
="$compile_command $arg"
1314 finalize_command
="$finalize_command $arg"
1315 if test "$with_gcc" = "yes" ; then
1316 compiler_flags
="$compiler_flags $arg"
1333 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1334 # The PATH hackery in wrapper scripts is required on Windows
1335 # in order for the loader to find any dlls it needs.
1336 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1337 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1340 *) no_install
=yes ;;
1373 dir
=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1374 # We need an absolute path.
1376 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1378 $echo "$modename: only absolute run-paths are allowed" 1>&2
1384 *) xrpath
="$xrpath $dir" ;;
1390 # The effects of -static are defined in a previous loop.
1391 # We used to do the same as -all-static on platforms that
1392 # didn't have a PIC flag, but the assumption that the effects
1393 # would be equivalent was wrong. It would break on at least
1394 # Digital Unix and AIX.
1414 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1416 save_ifs
="$IFS"; IFS
=','
1417 for flag
in $args; do
1420 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1425 compiler_flags
="$compiler_flags $flag"
1428 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1432 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1434 save_ifs
="$IFS"; IFS
=','
1435 for flag
in $args; do
1438 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1443 compiler_flags
="$compiler_flags $wl$flag"
1444 linker_flags
="$linker_flags $flag"
1447 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1465 # Some other compiler flag.
1467 # Unknown arguments in both finalize_command and compile_command need
1468 # to be aesthetically quoted because they are evaled later.
1469 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1471 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1478 # A standard object.
1483 # A libtool-controlled object.
1485 # Check to see that this really is a libtool object.
1486 if (${SED} -e '2q' $arg |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1491 # If there is no directory component, then add one.
1493 */* |
*\\*) .
$arg ;;
1497 if test -z "$pic_object" || \
1498 test -z "$non_pic_object" ||
1499 test "$pic_object" = none
&& \
1500 test "$non_pic_object" = none
; then
1501 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1505 # Extract subdirectory from the argument.
1506 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1507 if test "X$xdir" = "X$arg"; then
1513 if test "$pic_object" != none
; then
1514 # Prepend the subdirectory the object is found in.
1515 pic_object
="$xdir$pic_object"
1517 if test "$prev" = dlfiles
; then
1518 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1519 dlfiles
="$dlfiles $pic_object"
1523 # If libtool objects are unsupported, then we need to preload.
1528 # CHECK ME: I think I busted this. -Ossama
1529 if test "$prev" = dlprefiles
; then
1530 # Preload the old-style object.
1531 dlprefiles
="$dlprefiles $pic_object"
1536 libobjs
="$libobjs $pic_object"
1541 if test "$non_pic_object" != none
; then
1542 # Prepend the subdirectory the object is found in.
1543 non_pic_object
="$xdir$non_pic_object"
1545 # A standard non-PIC object
1546 non_pic_objects
="$non_pic_objects $non_pic_object"
1547 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1548 arg
="$non_pic_object"
1552 # Only an error if not doing a dry-run.
1553 if test -z "$run"; then
1554 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1559 # Extract subdirectory from the argument.
1560 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1561 if test "X$xdir" = "X$arg"; then
1567 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1568 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1569 libobjs
="$libobjs $pic_object"
1570 non_pic_objects
="$non_pic_objects $non_pic_object"
1577 deplibs
="$deplibs $arg"
1578 old_deplibs
="$old_deplibs $arg"
1583 # A libtool-controlled library.
1585 if test "$prev" = dlfiles
; then
1586 # This library was specified with -dlopen.
1587 dlfiles
="$dlfiles $arg"
1589 elif test "$prev" = dlprefiles
; then
1590 # The library was specified with -dlpreopen.
1591 dlprefiles
="$dlprefiles $arg"
1594 deplibs
="$deplibs $arg"
1599 # Some other compiler argument.
1601 # Unknown arguments in both finalize_command and compile_command need
1602 # to be aesthetically quoted because they are evaled later.
1603 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1605 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1612 # Now actually substitute the argument into the commands.
1613 if test -n "$arg"; then
1614 compile_command
="$compile_command $arg"
1615 finalize_command
="$finalize_command $arg"
1617 done # argument parsing loop
1619 if test -n "$prev"; then
1620 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1625 # Infer tagged configuration to use if any are available and
1626 # if one wasn't chosen via the "--tag" command line option.
1627 # Only attempt this if the compiler in the base link
1628 # command doesn't match the default compiler.
1629 if test -n "$available_tags" && test -z "$tagname"; then
1630 case $base_compile in
1631 # Blanks in the command may have been stripped by the calling shell,
1632 # but not from the CC environment variable when configure was run.
1633 "$CC "* |
" $CC "* |
"`$echo $CC` "* |
" `$echo $CC` "*) ;;
1634 # Blanks at the start of $base_compile will cause this to fail
1635 # if we don't check for them as well.
1637 for z
in $available_tags; do
1638 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev
/null
; then
1639 # Evaluate the configuration.
1640 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
1641 case $base_compile in
1642 "$CC "* |
" $CC "* |
"`$echo $CC` "* |
" `$echo $CC` "*)
1643 # The compiler in $compile_command matches
1644 # the one in the tagged configuration.
1645 # Assume this is the tagged configuration we want.
1652 # If $tagname still isn't set, then no tagged configuration
1653 # was found and let the user know that the "--tag" command
1654 # line option must be used.
1655 if test -z "$tagname"; then
1656 echo "$modename: unable to infer tagged configuration"
1657 echo "$modename: specify a tag with \`--tag'" 1>&2
1660 # echo "$modename: using $tagname tagged configuration"
1666 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1667 eval arg
=\"$export_dynamic_flag_spec\"
1668 compile_command
="$compile_command $arg"
1669 finalize_command
="$finalize_command $arg"
1673 # calculate the name of the file, without its directory
1674 outputname
=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1675 libobjs_save
="$libobjs"
1677 if test -n "$shlibpath_var"; then
1678 # get the directories listed in $shlibpath_var
1679 eval shlib_search_path
=\
`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1683 eval sys_lib_search_path
=\"$sys_lib_search_path_spec\"
1684 eval sys_lib_dlsearch_path
=\"$sys_lib_dlsearch_path_spec\"
1686 output_objdir
=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1687 if test "X$output_objdir" = "X$output"; then
1688 output_objdir
="$objdir"
1690 output_objdir
="$output_objdir/$objdir"
1692 # Create the object directory.
1693 if test ! -d "$output_objdir"; then
1694 $show "$mkdir $output_objdir"
1695 $run $mkdir $output_objdir
1697 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1702 # Determine the type of output
1705 $echo "$modename: you must specify an output file" 1>&2
1709 *.
$libext) linkmode
=oldlib
;;
1710 *.lo |
*.
$objext) linkmode
=obj
;;
1711 *.la
) linkmode
=lib
;;
1712 *) linkmode
=prog
;; # Anything else should be a program.
1716 *cygwin
* |
*mingw
* |
*pw32
*)
1717 # don't eliminate duplcations in $postdeps and $predeps
1718 duplicate_compiler_generated_deps
=yes
1721 duplicate_compiler_generated_deps
=$duplicate_deps
1727 # Find all interdependent deplibs by searching for libraries
1728 # that are linked more than once (e.g. -la -lb -la)
1729 for deplib
in $deplibs; do
1730 if test "X$duplicate_deps" = "Xyes" ; then
1732 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
1735 libs
="$libs $deplib"
1738 if test "$linkmode" = lib
; then
1739 libs
="$predeps $libs $compiler_lib_search_path $postdeps"
1741 # Compute libraries that are listed more than once in $predeps
1742 # $postdeps and mark them as special (i.e., whose duplicates are
1743 # not to be eliminated).
1745 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
1746 for pre_post_dep
in $predeps $postdeps; do
1747 case "$pre_post_deps " in
1748 *" $pre_post_dep "*) specialdeplibs
="$specialdeplibs $pre_post_deps" ;;
1750 pre_post_deps
="$pre_post_deps $pre_post_dep"
1759 need_relink
=no
# whether we're linking any uninstalled libtool libraries
1760 notinst_deplibs
= # not-installed libtool libraries
1761 notinst_path
= # paths that contain not-installed libtool libraries
1765 for file in $dlfiles $dlprefiles; do
1769 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1781 passes
="conv scan dlopen dlpreopen link"
1786 for pass
in $passes; do
1787 if test "$linkmode,$pass" = "lib,link" ||
1788 test "$linkmode,$pass" = "prog,scan"; then
1792 if test "$linkmode" = prog
; then
1794 dlopen
) libs
="$dlfiles" ;;
1795 dlpreopen
) libs
="$dlprefiles" ;;
1796 link
) libs
="$deplibs %DEPLIBS% $dependency_libs" ;;
1799 if test "$pass" = dlopen
; then
1800 # Collect dlpreopened libraries
1801 save_deplibs
="$deplibs"
1804 for deplib
in $libs; do
1809 if test "$linkmode" != lib
&& test "$linkmode" != prog
; then
1810 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1813 if test "$pass" = conv
; then
1814 deplibs
="$deplib $deplibs"
1817 name
=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1818 for searchdir
in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1819 # Search the libtool library
1820 lib
="$searchdir/lib${name}.la"
1821 if test -f "$lib"; then
1826 if test "$found" != yes; then
1827 # deplib doesn't seem to be a libtool library
1828 if test "$linkmode,$pass" = "prog,link"; then
1829 compile_deplibs
="$deplib $compile_deplibs"
1830 finalize_deplibs
="$deplib $finalize_deplibs"
1832 deplibs
="$deplib $deplibs"
1833 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
1836 else # deplib is a libtool library
1837 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
1838 # We need to do some special things here, and not later.
1839 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
1840 case " $predeps $postdeps " in
1842 if (${SED} -e '2q' $lib |
1843 grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1847 */* |
*\\*) .
$lib ;;
1850 for l
in $old_library $library_names; do
1853 if test "X$ll" = "X$old_library" ; then # only static version available
1855 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1856 test "X$ladir" = "X$lib" && ladir
="."
1857 lib
=$ladir/$old_library
1858 if test "$linkmode,$pass" = "prog,link"; then
1859 compile_deplibs
="$deplib $compile_deplibs"
1860 finalize_deplibs
="$deplib $finalize_deplibs"
1862 deplibs
="$deplib $deplibs"
1863 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
1877 deplibs
="$deplib $deplibs"
1878 test "$pass" = conv
&& continue
1879 newdependency_libs
="$deplib $newdependency_libs"
1880 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1883 if test "$pass" = conv
; then
1884 deplibs
="$deplib $deplibs"
1887 if test "$pass" = scan
; then
1888 deplibs
="$deplib $deplibs"
1889 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1891 compile_deplibs
="$deplib $compile_deplibs"
1892 finalize_deplibs
="$deplib $finalize_deplibs"
1896 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1902 if test "$pass" = link
; then
1903 dir
=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1904 # Make sure the xrpath contains only unique directories.
1907 *) xrpath
="$xrpath $dir" ;;
1910 deplibs
="$deplib $deplibs"
1913 *.la
) lib
="$deplib" ;;
1915 if test "$pass" = conv
; then
1916 deplibs
="$deplib $deplibs"
1921 if test "$deplibs_check_method" != pass_all
; then
1923 echo "*** Warning: Trying to link with static lib archive $deplib."
1924 echo "*** I have the capability to make that library automatically link in when"
1925 echo "*** you link to this library. But I can only do this if you have a"
1926 echo "*** shared version of the library, which you do not appear to have"
1927 echo "*** because the file extensions .$libext of this argument makes me believe"
1928 echo "*** that it is just a static archive that I should not used here."
1931 echo "*** Warning: Linking the shared library $output against the"
1932 echo "*** static library $deplib is not portable!"
1933 deplibs
="$deplib $deplibs"
1938 if test "$pass" != link
; then
1939 deplibs
="$deplib $deplibs"
1941 compile_deplibs
="$deplib $compile_deplibs"
1942 finalize_deplibs
="$deplib $finalize_deplibs"
1949 if test "$pass" = conv
; then
1950 deplibs
="$deplib $deplibs"
1951 elif test "$linkmode" = prog
; then
1952 if test "$pass" = dlpreopen ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
1953 # If there is no dlopen support or we're linking statically,
1954 # we need to preload.
1955 newdlprefiles
="$newdlprefiles $deplib"
1956 compile_deplibs
="$deplib $compile_deplibs"
1957 finalize_deplibs
="$deplib $finalize_deplibs"
1959 newdlfiles
="$newdlfiles $deplib"
1969 if test "$found" = yes ||
test -f "$lib"; then :
1971 $echo "$modename: cannot find the library \`$lib'" 1>&2
1975 # Check to see that this really is a libtool archive.
1976 if (${SED} -e '2q' $lib |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
1978 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1982 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1983 test "X$ladir" = "X$lib" && ladir
="."
1991 # If the library was installed with an old release of libtool,
1992 # it will not redefine variable installed.
1997 */* |
*\\*) .
$lib ;;
2001 if test "$linkmode,$pass" = "lib,link" ||
2002 test "$linkmode,$pass" = "prog,scan" ||
2003 { test "$linkmode" != prog
&& test "$linkmode" != lib
; }; then
2004 test -n "$dlopen" && dlfiles
="$dlfiles $dlopen"
2005 test -n "$dlpreopen" && dlprefiles
="$dlprefiles $dlpreopen"
2008 if test "$pass" = conv
; then
2009 # Only check for convenience libraries
2010 deplibs
="$lib $deplibs"
2011 if test -z "$libdir"; then
2012 if test -z "$old_library"; then
2013 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2016 # It is a libtool convenience library, so add in its objects.
2017 convenience
="$convenience $ladir/$objdir/$old_library"
2018 old_convenience
="$old_convenience $ladir/$objdir/$old_library"
2020 for deplib
in $dependency_libs; do
2021 deplibs
="$deplib $deplibs"
2022 if test "X$duplicate_deps" = "Xyes" ; then
2023 case "$tmp_libs " in
2024 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2027 tmp_libs
="$tmp_libs $deplib"
2029 elif test "$linkmode" != prog
&& test "$linkmode" != lib
; then
2030 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2036 # Get the name of the library we link against.
2038 for l
in $old_library $library_names; do
2041 if test -z "$linklib"; then
2042 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2046 # This library was specified with -dlopen.
2047 if test "$pass" = dlopen
; then
2048 if test -z "$libdir"; then
2049 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2052 if test -z "$dlname" ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
2053 # If there is no dlname, no dlopen support or we're linking
2054 # statically, we need to preload. We also need to preload any
2055 # dependent libraries so libltdl's deplib preloader doesn't
2056 # bomb out in the load deplibs phase.
2057 dlprefiles
="$dlprefiles $lib $dependency_libs"
2059 newdlfiles
="$newdlfiles $lib"
2064 # We need an absolute path.
2066 [\\/]* |
[A-Za-z
]:[\\/]*) abs_ladir
="$ladir" ;;
2068 abs_ladir
=`cd "$ladir" && pwd`
2069 if test -z "$abs_ladir"; then
2070 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2071 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2076 laname
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2078 # Find the relevant object directory and library name.
2079 if test "X$installed" = Xyes
; then
2080 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2081 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2090 dir
="$ladir/$objdir"
2091 absdir
="$abs_ladir/$objdir"
2092 # Remove this search path later
2093 notinst_path
="$notinst_path $abs_ladir"
2094 fi # $installed = yes
2095 name
=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2097 # This library was specified with -dlpreopen.
2098 if test "$pass" = dlpreopen
; then
2099 if test -z "$libdir"; then
2100 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2103 # Prefer using a static library (so that no silly _DYNAMIC symbols
2104 # are required to link).
2105 if test -n "$old_library"; then
2106 newdlprefiles
="$newdlprefiles $dir/$old_library"
2107 # Otherwise, use the dlname, so that lt_dlopen finds it.
2108 elif test -n "$dlname"; then
2109 newdlprefiles
="$newdlprefiles $dir/$dlname"
2111 newdlprefiles
="$newdlprefiles $dir/$linklib"
2113 fi # $pass = dlpreopen
2115 if test -z "$libdir"; then
2116 # Link the convenience library
2117 if test "$linkmode" = lib
; then
2118 deplibs
="$dir/$old_library $deplibs"
2119 elif test "$linkmode,$pass" = "prog,link"; then
2120 compile_deplibs
="$dir/$old_library $compile_deplibs"
2121 finalize_deplibs
="$dir/$old_library $finalize_deplibs"
2123 deplibs
="$lib $deplibs" # used for prog,scan pass
2128 if test "$linkmode" = prog
&& test "$pass" != link
; then
2129 newlib_search_path
="$newlib_search_path $ladir"
2130 deplibs
="$lib $deplibs"
2133 if test "$link_all_deplibs" != no ||
test -z "$library_names" ||
2134 test "$build_libtool_libs" = no
; then
2139 for deplib
in $dependency_libs; do
2141 -L*) newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2143 # Need to link against all dependency_libs?
2144 if test "$linkalldeplibs" = yes; then
2145 deplibs
="$deplib $deplibs"
2147 # Need to hardcode shared library paths
2148 # or/and link against static libraries
2149 newdependency_libs
="$deplib $newdependency_libs"
2151 if test "X$duplicate_deps" = "Xyes" ; then
2152 case "$tmp_libs " in
2153 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2156 tmp_libs
="$tmp_libs $deplib"
2159 fi # $linkmode = prog...
2161 if test "$linkmode,$pass" = "prog,link"; then
2162 if test -n "$library_names" &&
2163 { test "$prefer_static_libs" = no ||
test -z "$old_library"; }; then
2164 # We need to hardcode the library path
2165 if test -n "$shlibpath_var"; then
2166 # Make sure the rpath contains only unique directories.
2167 case "$temp_rpath " in
2170 *) temp_rpath
="$temp_rpath $dir" ;;
2174 # Hardcode the library path.
2175 # Skip directories that are in the system default run-time
2177 case " $sys_lib_dlsearch_path " in
2180 case "$compile_rpath " in
2182 *) compile_rpath
="$compile_rpath $absdir"
2186 case " $sys_lib_dlsearch_path " in
2189 case "$finalize_rpath " in
2191 *) finalize_rpath
="$finalize_rpath $libdir"
2195 fi # $linkmode,$pass = prog,link...
2197 if test "$alldeplibs" = yes &&
2198 { test "$deplibs_check_method" = pass_all ||
2199 { test "$build_libtool_libs" = yes &&
2200 test -n "$library_names"; }; }; then
2201 # We only need to search for static libraries
2206 link_static
=no
# Whether the deplib will be linked statically
2207 if test -n "$library_names" &&
2208 { test "$prefer_static_libs" = no ||
test -z "$old_library"; }; then
2209 if test "$installed" = no
; then
2210 notinst_deplibs
="$notinst_deplibs $lib"
2213 # This is a shared library
2214 if test "$linkmode" = lib
&&
2215 test "$hardcode_into_libs" = yes; then
2216 # Hardcode the library path.
2217 # Skip directories that are in the system default run-time
2219 case " $sys_lib_dlsearch_path " in
2222 case "$compile_rpath " in
2224 *) compile_rpath
="$compile_rpath $absdir"
2228 case " $sys_lib_dlsearch_path " in
2231 case "$finalize_rpath " in
2233 *) finalize_rpath
="$finalize_rpath $libdir"
2239 if test -n "$old_archive_from_expsyms_cmds"; then
2240 # figure out the soname
2241 set dummy
$library_names
2244 libname
=`eval \\$echo \"$libname_spec\"`
2245 # use dlname if we got it. it's perfectly good, no?
2246 if test -n "$dlname"; then
2248 elif test -n "$soname_spec"; then
2252 major
=`expr $current - $age`
2256 eval soname
=\"$soname_spec\"
2261 # Make a new name for the extract_expsyms_cmds to use
2263 soname
=`echo $soroot | ${SED} -e 's/^.*\///'`
2264 newlib
="libimp-`echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2266 # If the library has no export list, then create one now
2267 if test -f "$output_objdir/$soname-def"; then :
2269 $show "extracting exported symbol list from \`$soname'"
2270 save_ifs
="$IFS"; IFS
='~'
2271 eval cmds
=\"$extract_expsyms_cmds\"
2272 for cmd
in $cmds; do
2275 $run eval "$cmd" ||
exit $?
2281 if test -f "$output_objdir/$newlib"; then :; else
2282 $show "generating import library for \`$soname'"
2283 save_ifs
="$IFS"; IFS
='~'
2284 eval cmds
=\"$old_archive_from_expsyms_cmds\"
2285 for cmd
in $cmds; do
2288 $run eval "$cmd" ||
exit $?
2292 # make sure the library variables are pointing to the new library
2295 fi # test -n "$old_archive_from_expsyms_cmds"
2297 if test "$linkmode" = prog ||
test "$mode" != relink
; then
2302 case $hardcode_action in
2303 immediate | unsupported
)
2304 if test "$hardcode_direct" = no
; then
2306 *-*-sco3.2v5
* ) add_dir
="-L$dir" ;;
2309 elif test "$hardcode_minus_L" = no
; then
2311 *-*-sunos*) add_shlibpath
="$dir" ;;
2315 elif test "$hardcode_shlibpath_var" = no
; then
2316 add_shlibpath
="$dir"
2323 if test "$hardcode_direct" = yes; then
2325 elif test "$hardcode_minus_L" = yes; then
2327 # Try looking first in the location we're being installed to.
2328 if test -n "$inst_prefix_dir"; then
2331 add_dir
="-L$inst_prefix_dir$libdir $add_dir"
2336 elif test "$hardcode_shlibpath_var" = yes; then
2337 add_shlibpath
="$dir"
2346 if test "$lib_linked" != yes; then
2347 $echo "$modename: configuration error: unsupported hardcode properties"
2351 if test -n "$add_shlibpath"; then
2352 case :$compile_shlibpath: in
2353 *":$add_shlibpath:"*) ;;
2354 *) compile_shlibpath
="$compile_shlibpath$add_shlibpath:" ;;
2357 if test "$linkmode" = prog
; then
2358 test -n "$add_dir" && compile_deplibs
="$add_dir $compile_deplibs"
2359 test -n "$add" && compile_deplibs
="$add $compile_deplibs"
2361 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2362 test -n "$add" && deplibs
="$add $deplibs"
2363 if test "$hardcode_direct" != yes && \
2364 test "$hardcode_minus_L" != yes && \
2365 test "$hardcode_shlibpath_var" = yes; then
2366 case :$finalize_shlibpath: in
2368 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2374 if test "$linkmode" = prog ||
test "$mode" = relink
; then
2378 # Finalize command for both is simple: just hardcode it.
2379 if test "$hardcode_direct" = yes; then
2380 add
="$libdir/$linklib"
2381 elif test "$hardcode_minus_L" = yes; then
2384 elif test "$hardcode_shlibpath_var" = yes; then
2385 case :$finalize_shlibpath: in
2387 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2391 # We cannot seem to hardcode it, guess we'll fake it.
2393 # Try looking first in the location we're being installed to.
2394 if test -n "$inst_prefix_dir"; then
2397 add_dir
="-L$inst_prefix_dir$libdir $add_dir"
2404 if test "$linkmode" = prog
; then
2405 test -n "$add_dir" && finalize_deplibs
="$add_dir $finalize_deplibs"
2406 test -n "$add" && finalize_deplibs
="$add $finalize_deplibs"
2408 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2409 test -n "$add" && deplibs
="$add $deplibs"
2412 elif test "$linkmode" = prog
; then
2413 # Here we assume that one of hardcode_direct or hardcode_minus_L
2414 # is not unsupported. This is valid on all known static and
2416 if test "$hardcode_direct" != unsupported
; then
2417 test -n "$old_library" && linklib
="$old_library"
2418 compile_deplibs
="$dir/$linklib $compile_deplibs"
2419 finalize_deplibs
="$dir/$linklib $finalize_deplibs"
2421 compile_deplibs
="-l$name -L$dir $compile_deplibs"
2422 finalize_deplibs
="-l$name -L$dir $finalize_deplibs"
2424 elif test "$build_libtool_libs" = yes; then
2425 # Not a shared library
2426 if test "$deplibs_check_method" != pass_all
; then
2427 # We're trying link a shared library against a static one
2428 # but the system doesn't support it.
2430 # Just print a warning and add the library to dependency_libs so
2431 # that the program can be linked against the static library.
2433 echo "*** Warning: This system can not link to static lib archive $lib."
2434 echo "*** I have the capability to make that library automatically link in when"
2435 echo "*** you link to this library. But I can only do this if you have a"
2436 echo "*** shared version of the library, which you do not appear to have."
2437 if test "$module" = yes; then
2438 echo "*** But as you try to build a module library, libtool will still create "
2439 echo "*** a static module, that should work as long as the dlopening application"
2440 echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2441 if test -z "$global_symbol_pipe"; then
2443 echo "*** However, this would only work if libtool was able to extract symbol"
2444 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2445 echo "*** not find such a program. So, this module is probably useless."
2446 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2448 if test "$build_old_libs" = no
; then
2449 build_libtool_libs
=module
2452 build_libtool_libs
=no
2456 convenience
="$convenience $dir/$old_library"
2457 old_convenience
="$old_convenience $dir/$old_library"
2458 deplibs
="$dir/$old_library $deplibs"
2461 fi # link shared/static library?
2463 if test "$linkmode" = lib
; then
2464 if test -n "$dependency_libs" &&
2465 { test "$hardcode_into_libs" != yes ||
test "$build_old_libs" = yes ||
2466 test "$link_static" = yes; }; then
2467 # Extract -R from dependency_libs
2469 for libdir
in $dependency_libs; do
2471 -R*) temp_xrpath
=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2473 *" $temp_xrpath "*) ;;
2474 *) xrpath
="$xrpath $temp_xrpath";;
2476 *) temp_deplibs
="$temp_deplibs $libdir";;
2479 dependency_libs
="$temp_deplibs"
2482 newlib_search_path
="$newlib_search_path $absdir"
2483 # Link against this library
2484 test "$link_static" = no
&& newdependency_libs
="$abs_ladir/$laname $newdependency_libs"
2485 # ... and its dependency_libs
2487 for deplib
in $dependency_libs; do
2488 newdependency_libs
="$deplib $newdependency_libs"
2489 if test "X$duplicate_deps" = "Xyes" ; then
2490 case "$tmp_libs " in
2491 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2494 tmp_libs
="$tmp_libs $deplib"
2497 if test "$link_all_deplibs" != no
; then
2498 # Add the search paths of all dependency libraries
2499 for deplib
in $dependency_libs; do
2501 -L*) path
="$deplib" ;;
2503 dir
=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2504 test "X$dir" = "X$deplib" && dir
="."
2505 # We need an absolute path.
2507 [\\/]* |
[A-Za-z
]:[\\/]*) absdir
="$dir" ;;
2509 absdir
=`cd "$dir" && pwd`
2510 if test -z "$absdir"; then
2511 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2516 if grep "^installed=no" $deplib > /dev
/null
; then
2517 path
="-L$absdir/$objdir"
2519 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2520 if test -z "$libdir"; then
2521 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2524 if test "$absdir" != "$libdir"; then
2525 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2532 case " $deplibs " in
2534 *) deplibs
="$deplibs $path" ;;
2537 fi # link_all_deplibs != no
2539 done # for deplib in $libs
2540 dependency_libs
="$newdependency_libs"
2541 if test "$pass" = dlpreopen
; then
2542 # Link the dlpreopened libraries before other libraries
2543 for deplib
in $save_deplibs; do
2544 deplibs
="$deplib $deplibs"
2547 if test "$pass" != dlopen
; then
2548 if test "$pass" != conv
; then
2549 # Make sure lib_search_path contains only unique directories.
2551 for dir
in $newlib_search_path; do
2552 case "$lib_search_path " in
2554 *) lib_search_path
="$lib_search_path $dir" ;;
2560 if test "$linkmode,$pass" != "prog,link"; then
2563 vars
="compile_deplibs finalize_deplibs"
2565 for var
in $vars dependency_libs
; do
2566 # Add libraries to $var in reverse order
2567 eval tmp_libs
=\"\$
$var\"
2569 for deplib
in $tmp_libs; do
2570 # FIXME: Pedantically, this is the right thing to do, so
2571 # that some nasty dependency loop isn't accidentally
2573 #new_libs="$deplib $new_libs"
2574 # Pragmatically, this seems to cause very few problems in
2577 -L*) new_libs
="$deplib $new_libs" ;;
2579 # And here is the reason: when a library appears more
2580 # than once as an explicit dependence of a library, or
2581 # is implicitly linked in more than once by the
2582 # compiler, it is considered special, and multiple
2583 # occurrences thereof are not removed. Compare this
2584 # with having the same library being listed as a
2585 # dependency of multiple other libraries: in this case,
2586 # we know (pedantically, we assume) the library does not
2587 # need to be listed more than once, so we keep only the
2588 # last copy. This is not always right, but it is rare
2589 # enough that we require users that really mean to play
2590 # such unportable linking tricks to link the library
2591 # using -Wl,-lname, so that libtool does not consider it
2592 # for duplicate removal.
2593 case " $specialdeplibs " in
2594 *" $deplib "*) new_libs
="$deplib $new_libs" ;;
2596 case " $new_libs " in
2598 *) new_libs
="$deplib $new_libs" ;;
2606 for deplib
in $new_libs; do
2609 case " $tmp_libs " in
2611 *) tmp_libs
="$tmp_libs $deplib" ;;
2614 *) tmp_libs
="$tmp_libs $deplib" ;;
2617 eval $var=\"$tmp_libs\"
2620 # Last step: remove runtime libs from dependency_libs (they stay in deplibs)
2622 for i
in $dependency_libs ; do
2623 case " $predeps $postdeps $compiler_lib_search_path " in
2628 if test -n "$i" ; then
2629 tmp_libs
="$tmp_libs $i"
2632 dependency_libs
=$tmp_libs
2634 if test "$linkmode" = prog
; then
2635 dlfiles
="$newdlfiles"
2636 dlprefiles
="$newdlprefiles"
2641 if test -n "$deplibs"; then
2642 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2645 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
2646 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2649 if test -n "$rpath"; then
2650 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2653 if test -n "$xrpath"; then
2654 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2657 if test -n "$vinfo"; then
2658 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
2661 if test -n "$release"; then
2662 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2665 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
2666 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2669 # Now set the variables for building old libraries.
2670 build_libtool_libs
=no
2672 objs
="$objs$old_deplibs"
2676 # Make sure we only generate libraries of the form `libNAME.la'.
2679 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2680 eval shared_ext
=\"$shrext\"
2681 eval libname
=\"$libname_spec\"
2684 if test "$module" = no
; then
2685 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2689 if test "$need_lib_prefix" != no
; then
2690 # Add the "lib" prefix for modules if required
2691 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2692 eval shared_ext
=\"$shrext\"
2693 eval libname
=\"$libname_spec\"
2695 libname
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2700 if test -n "$objs"; then
2701 if test "$deplibs_check_method" != pass_all
; then
2702 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2706 echo "*** Warning: Linking the shared library $output against the non-libtool"
2707 echo "*** objects $objs is not portable!"
2708 libobjs
="$libobjs $objs"
2712 if test "$dlself" != no
; then
2713 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2717 if test "$#" -gt 2; then
2718 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2723 if test -z "$rpath"; then
2724 if test "$build_libtool_libs" = yes; then
2725 # Building a libtool convenience library.
2726 # Some compilers have problems with a `.al' extension so
2727 # convenience libraries should have the same extension an
2728 # archive normally would.
2729 oldlibs
="$output_objdir/$libname.$libext $oldlibs"
2730 build_libtool_libs
=convenience
2734 if test -n "$vinfo"; then
2735 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
2738 if test -n "$release"; then
2739 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2743 # Parse the version information argument.
2744 save_ifs
="$IFS"; IFS
=':'
2745 set dummy
$vinfo 0 0 0
2748 if test -n "$8"; then
2749 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2754 # convert absolute version numbers to libtool ages
2755 # this retains compatibility with .la files and attempts
2756 # to make the code below a bit more comprehensible
2758 case $vinfo_number in
2762 number_revision
="$4"
2764 # There are really only two kinds -- those that
2765 # use the current revision as the major version
2766 # and those that subtract age and use age as
2767 # a minor version. But, then there is irix
2768 # which has an extra 1 added just for fun
2770 case $version_type in
2771 darwin|linux|osf|windows
)
2772 current
=`expr $number_major + $number_minor`
2774 revision
="$number_revision"
2776 freebsd-aout|freebsd-elf|sunos
)
2777 current
="$number_major"
2778 revision
="$number_minor"
2782 current
=`expr $number_major + $number_minor - 1`
2784 revision
="$number_minor"
2794 # Check that each of the things are valid numbers.
2796 0 |
[1-9] |
[1-9][0-9] |
[1-9][0-9][0-9]) ;;
2798 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2799 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2805 0 |
[1-9] |
[1-9][0-9] |
[1-9][0-9][0-9]) ;;
2807 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2808 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2814 0 |
[1-9] |
[1-9][0-9] |
[1-9][0-9][0-9]) ;;
2816 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2817 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2822 if test "$age" -gt "$current"; then
2823 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2824 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2828 # Calculate the version variables.
2832 case $version_type in
2836 # Like Linux, but with the current version available in
2837 # verstring for coding it into the library header
2838 major
=.
`expr $current - $age`
2839 versuffix
="$major.$age.$revision"
2840 # Darwin ld doesn't like 0 for these options...
2841 minor_current
=`expr $current + 1`
2842 verstring
="-compatibility_version $minor_current -current_version $minor_current.$revision"
2847 versuffix
=".$current.$revision";
2852 versuffix
=".$current";
2856 major
=`expr $current - $age + 1`
2858 case $version_type in
2859 nonstopux
) verstring_prefix
=nonstopux
;;
2860 *) verstring_prefix
=sgi
;;
2862 verstring
="$verstring_prefix$major.$revision"
2864 # Add in all the interfaces that we are compatible with.
2866 while test "$loop" -ne 0; do
2867 iface
=`expr $revision - $loop`
2868 loop
=`expr $loop - 1`
2869 verstring
="$verstring_prefix$major.$iface:$verstring"
2872 # Before this point, $major must not contain `.'.
2874 versuffix
="$major.$revision"
2878 major
=.
`expr $current - $age`
2879 versuffix
="$major.$age.$revision"
2883 major
=.
`expr $current - $age`
2884 versuffix
=".$current.$age.$revision"
2885 verstring
="$current.$age.$revision"
2887 # Add in all the interfaces that we are compatible with.
2889 while test "$loop" -ne 0; do
2890 iface
=`expr $current - $loop`
2891 loop
=`expr $loop - 1`
2892 verstring
="$verstring:${iface}.0"
2895 # Make executables depend on our current version.
2896 verstring
="$verstring:${current}.0"
2901 versuffix
=".$current.$revision"
2905 # Use '-' rather than '.', since we only want one
2906 # extension on DOS 8.3 filesystems.
2907 major
=`expr $current - $age`
2912 $echo "$modename: unknown library version type \`$version_type'" 1>&2
2913 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2918 # Clear the version info if we defaulted, and they specified a release.
2919 if test -z "$vinfo" && test -n "$release"; then
2921 case $version_type in
2923 # we can't check for "0.0" in archive_cmds due to quoting
2924 # problems, so we reset it completely
2931 if test "$need_version" = no
; then
2938 # Remove version info from name if versioning should be avoided
2939 if test "$avoid_version" = yes && test "$need_version" = no
; then
2945 # Check to see if the archive will have undefined symbols.
2946 if test "$allow_undefined" = yes; then
2947 if test "$allow_undefined_flag" = unsupported
; then
2948 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
2949 build_libtool_libs
=no
2953 # Don't allow undefined symbols.
2954 allow_undefined_flag
="$no_undefined_flag"
2958 if test "$mode" != relink
; then
2959 # Remove our outputs, but don't remove object files since they
2960 # may have been created when compiling PIC objects.
2962 tempremovelist
=`echo "$output_objdir/*"`
2963 for p
in $tempremovelist; do
2967 $output_objdir/$outputname |
$output_objdir/$libname.
* |
$output_objdir/${libname}${release}.
*)
2968 removelist
="$removelist $p"
2973 if test -n "$removelist"; then
2974 $show "${rm}r $removelist"
2975 $run ${rm}r
$removelist
2979 # Now set the variables for building old libraries.
2980 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience
; then
2981 oldlibs
="$oldlibs $output_objdir/$libname.$libext"
2983 # Transform .lo files to .o files.
2984 oldobjs
="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2987 # Eliminate all temporary directories.
2988 for path
in $notinst_path; do
2989 lib_search_path
=`echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
2990 deplibs
=`echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
2991 dependency_libs
=`echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
2994 if test -n "$xrpath"; then
2995 # If the user specified any rpath flags, then add them.
2997 for libdir
in $xrpath; do
2998 temp_xrpath
="$temp_xrpath -R$libdir"
2999 case "$finalize_rpath " in
3001 *) finalize_rpath
="$finalize_rpath $libdir" ;;
3004 if test "$hardcode_into_libs" != yes ||
test "$build_old_libs" = yes; then
3005 dependency_libs
="$temp_xrpath $dependency_libs"
3009 # Make sure dlfiles contains only unique files that won't be dlpreopened
3010 old_dlfiles
="$dlfiles"
3012 for lib
in $old_dlfiles; do
3013 case " $dlprefiles $dlfiles " in
3015 *) dlfiles
="$dlfiles $lib" ;;
3019 # Make sure dlprefiles contains only unique files
3020 old_dlprefiles
="$dlprefiles"
3022 for lib
in $old_dlprefiles; do
3023 case "$dlprefiles " in
3025 *) dlprefiles
="$dlprefiles $lib" ;;
3029 if test "$build_libtool_libs" = yes; then
3030 if test -n "$rpath"; then
3032 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2* |
*-*-beos*)
3033 # these systems don't actually have a c library (as such)!
3035 *-*-rhapsody* |
*-*-darwin1.
[012])
3036 # Rhapsody C library is in the System framework
3037 deplibs
="$deplibs -framework System"
3040 # Don't link with libc until the a.out ld.so is fixed.
3042 *-*-openbsd* |
*-*-freebsd*)
3043 # Do not include libc due to us having libc/libc_r.
3044 test "X$arg" = "X-lc" && continue
3047 # Add libc to deplibs on all other systems if necessary.
3048 if test "$build_libtool_need_lc" = "yes"; then
3049 deplibs
="$deplibs -lc"
3055 # Transform deplibs into only deplibs that can be linked in shared.
3057 libname_save
=$libname
3058 release_save
=$release
3059 versuffix_save
=$versuffix
3061 # I'm not sure if I'm treating the release correctly. I think
3062 # release should show up in the -l (ie -lgmp5) so we don't want to
3063 # add it in twice. Is that correct?
3069 case $deplibs_check_method in
3071 # Don't check for shared/static. Everything works.
3072 # This might be a little naive. We might want to check
3073 # whether the library exists or not. But this is on
3074 # osf3 & osf4 and I'm not really sure... Just
3075 # implementing what was already the behavior.
3079 # This code stresses the "libraries are programs" paradigm to its
3080 # limits. Maybe even breaks it. We compile a program, linking it
3081 # against the deplibs as a proxy for the library. Then we can check
3082 # whether they linked in statically or dynamically with ldd.
3084 cat > conftest.c
<<EOF
3085 int main() { return 0; }
3088 $LTCC -o conftest conftest.c
$deplibs
3089 if test "$?" -eq 0 ; then
3090 ldd_output
=`ldd conftest`
3091 for i
in $deplibs; do
3092 name
="`expr $i : '-l\(.*\)'`"
3093 # If $name is empty we are operating on a -L argument.
3094 if test "$name" != "" && test "$name" -ne "0"; then
3095 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3096 case " $predeps $postdeps " in
3098 newdeplibs
="$newdeplibs $i"
3103 if test -n "$i" ; then
3104 libname
=`eval \\$echo \"$libname_spec\"`
3105 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
3106 set dummy
$deplib_matches
3108 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3109 newdeplibs
="$newdeplibs $i"
3113 echo "*** Warning: dynamic linker does not accept needed library $i."
3114 echo "*** I have the capability to make that library automatically link in when"
3115 echo "*** you link to this library. But I can only do this if you have a"
3116 echo "*** shared version of the library, which I believe you do not have"
3117 echo "*** because a test_compile did reveal that the linker did not use it for"
3118 echo "*** its dynamic dependency list that programs get resolved with at runtime."
3122 newdeplibs
="$newdeplibs $i"
3126 # Error occurred in the first compile. Let's try to salvage
3127 # the situation: Compile a separate program for each library.
3128 for i
in $deplibs; do
3129 name
="`expr $i : '-l\(.*\)'`"
3130 # If $name is empty we are operating on a -L argument.
3131 if test "$name" != "" && test "$name" != "0"; then
3133 $LTCC -o conftest conftest.c
$i
3135 if test "$?" -eq 0 ; then
3136 ldd_output
=`ldd conftest`
3137 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3138 case " $predeps $postdeps " in
3140 newdeplibs
="$newdeplibs $i"
3145 if test -n "$i" ; then
3146 libname
=`eval \\$echo \"$libname_spec\"`
3147 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
3148 set dummy
$deplib_matches
3150 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3151 newdeplibs
="$newdeplibs $i"
3155 echo "*** Warning: dynamic linker does not accept needed library $i."
3156 echo "*** I have the capability to make that library automatically link in when"
3157 echo "*** you link to this library. But I can only do this if you have a"
3158 echo "*** shared version of the library, which you do not appear to have"
3159 echo "*** because a test_compile did reveal that the linker did not use this one"
3160 echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3166 echo "*** Warning! Library $i is needed by this library but I was not able to"
3167 echo "*** make it link in! You will probably need to install it or some"
3168 echo "*** library that it depends on before this library will be fully"
3169 echo "*** functional. Installing it before continuing would be even better."
3172 newdeplibs
="$newdeplibs $i"
3178 set dummy
$deplibs_check_method
3179 file_magic_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3180 for a_deplib
in $deplibs; do
3181 name
="`expr $a_deplib : '-l\(.*\)'`"
3182 # If $name is empty we are operating on a -L argument.
3183 if test "$name" != "" && test "$name" != "0"; then
3184 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3185 case " $predeps $postdeps " in
3187 newdeplibs
="$newdeplibs $a_deplib"
3192 if test -n "$a_deplib" ; then
3193 libname
=`eval \\$echo \"$libname_spec\"`
3194 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3195 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
3196 for potent_lib
in $potential_libs; do
3197 # Follow soft links.
3198 if ls -lLd "$potent_lib" 2>/dev
/null \
3199 |
grep " -> " >/dev
/null
; then
3202 # The statement above tries to avoid entering an
3203 # endless loop below, in case of cyclic links.
3204 # We might still enter an endless loop, since a link
3205 # loop can be closed while we follow links,
3207 potlib
="$potent_lib"
3208 while test -h "$potlib" 2>/dev
/null
; do
3209 potliblink
=`ls -ld $potlib | ${SED} 's/.* -> //'`
3211 [\\/]* |
[A-Za-z
]:[\\/]*) potlib
="$potliblink";;
3212 *) potlib
=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3215 if eval $file_magic_cmd \"\
$potlib\" 2>/dev
/null \
3217 |
$EGREP "$file_magic_regex" > /dev
/null
; then
3218 newdeplibs
="$newdeplibs $a_deplib"
3225 if test -n "$a_deplib" ; then
3228 echo "*** Warning: linker path does not have real file for library $a_deplib."
3229 echo "*** I have the capability to make that library automatically link in when"
3230 echo "*** you link to this library. But I can only do this if you have a"
3231 echo "*** shared version of the library, which you do not appear to have"
3232 echo "*** because I did check the linker path looking for a file starting"
3233 if test -z "$potlib" ; then
3234 echo "*** with $libname but no candidates were found. (...for file magic test)"
3236 echo "*** with $libname and none of the candidates passed a file format test"
3237 echo "*** using a file magic. Last file checked: $potlib"
3241 # Add a -L argument.
3242 newdeplibs
="$newdeplibs $a_deplib"
3244 done # Gone through all deplibs.
3247 set dummy
$deplibs_check_method
3248 match_pattern_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3249 for a_deplib
in $deplibs; do
3250 name
="`expr $a_deplib : '-l\(.*\)'`"
3251 # If $name is empty we are operating on a -L argument.
3252 if test -n "$name" && test "$name" != "0"; then
3253 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3254 case " $predeps $postdeps " in
3256 newdeplibs
="$newdeplibs $a_deplib"
3261 if test -n "$a_deplib" ; then
3262 libname
=`eval \\$echo \"$libname_spec\"`
3263 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3264 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
3265 for potent_lib
in $potential_libs; do
3266 potlib
="$potent_lib" # see symlink-check above in file_magic test
3267 if eval echo \"$potent_lib\" 2>/dev
/null \
3269 |
$EGREP "$match_pattern_regex" > /dev
/null
; then
3270 newdeplibs
="$newdeplibs $a_deplib"
3277 if test -n "$a_deplib" ; then
3280 echo "*** Warning: linker path does not have real file for library $a_deplib."
3281 echo "*** I have the capability to make that library automatically link in when"
3282 echo "*** you link to this library. But I can only do this if you have a"
3283 echo "*** shared version of the library, which you do not appear to have"
3284 echo "*** because I did check the linker path looking for a file starting"
3285 if test -z "$potlib" ; then
3286 echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3288 echo "*** with $libname and none of the candidates passed a file format test"
3289 echo "*** using a regex pattern. Last file checked: $potlib"
3293 # Add a -L argument.
3294 newdeplibs
="$newdeplibs $a_deplib"
3296 done # Gone through all deplibs.
3300 tmp_deplibs
=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3301 -e 's/ -[LR][^ ]*//g'`
3302 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3303 for i
in $predeps $postdeps ; do
3304 # can't use Xsed below, because $i might contain '/'
3305 tmp_deplibs
=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3308 if $echo "X $tmp_deplibs" |
$Xsed -e 's/[ ]//g' \
3309 |
grep .
>/dev
/null
; then
3311 if test "X$deplibs_check_method" = "Xnone"; then
3312 echo "*** Warning: inter-library dependencies are not supported in this platform."
3314 echo "*** Warning: inter-library dependencies are not known to be supported."
3316 echo "*** All declared inter-library dependencies are being dropped."
3321 versuffix
=$versuffix_save
3323 release
=$release_save
3324 libname
=$libname_save
3328 *-*-rhapsody* |
*-*-darwin1.
[012])
3329 # On Rhapsody replace the C library is the System framework
3330 newdeplibs
=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3334 if test "$droppeddeps" = yes; then
3335 if test "$module" = yes; then
3337 echo "*** Warning: libtool could not satisfy all declared inter-library"
3338 echo "*** dependencies of module $libname. Therefore, libtool will create"
3339 echo "*** a static module, that should work as long as the dlopening"
3340 echo "*** application is linked with the -dlopen flag."
3341 if test -z "$global_symbol_pipe"; then
3343 echo "*** However, this would only work if libtool was able to extract symbol"
3344 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3345 echo "*** not find such a program. So, this module is probably useless."
3346 echo "*** \`nm' from GNU binutils and a full rebuild may help."
3348 if test "$build_old_libs" = no
; then
3349 oldlibs
="$output_objdir/$libname.$libext"
3350 build_libtool_libs
=module
3353 build_libtool_libs
=no
3356 echo "*** The inter-library dependencies that have been dropped here will be"
3357 echo "*** automatically added whenever a program is linked with this library"
3358 echo "*** or is declared to -dlopen it."
3360 if test "$allow_undefined" = no
; then
3362 echo "*** Since this library must not contain undefined symbols,"
3363 echo "*** because either the platform does not support them or"
3364 echo "*** it was explicitly requested with -no-undefined,"
3365 echo "*** libtool will only create a static version of it."
3366 if test "$build_old_libs" = no
; then
3367 oldlibs
="$output_objdir/$libname.$libext"
3368 build_libtool_libs
=module
3371 build_libtool_libs
=no
3376 # Done checking deplibs!
3380 # All the library-specific variables (install_libdir is set above).
3385 # Test again, we may have decided not to build it any more
3386 if test "$build_libtool_libs" = yes; then
3387 if test "$hardcode_into_libs" = yes; then
3388 # Hardcode the library paths
3391 rpath
="$finalize_rpath"
3392 test "$mode" != relink
&& rpath
="$compile_rpath$rpath"
3393 for libdir
in $rpath; do
3394 if test -n "$hardcode_libdir_flag_spec"; then
3395 if test -n "$hardcode_libdir_separator"; then
3396 if test -z "$hardcode_libdirs"; then
3397 hardcode_libdirs
="$libdir"
3399 # Just accumulate the unique libdirs.
3400 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3401 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3404 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3409 eval flag
=\"$hardcode_libdir_flag_spec\"
3410 dep_rpath
="$dep_rpath $flag"
3412 elif test -n "$runpath_var"; then
3413 case "$perm_rpath " in
3415 *) perm_rpath
="$perm_rpath $libdir" ;;
3419 # Substitute the hardcoded libdirs into the rpath.
3420 if test -n "$hardcode_libdir_separator" &&
3421 test -n "$hardcode_libdirs"; then
3422 libdir
="$hardcode_libdirs"
3423 if test -n "$hardcode_libdir_flag_spec_ld"; then
3424 eval dep_rpath
=\"$hardcode_libdir_flag_spec_ld\"
3426 eval dep_rpath
=\"$hardcode_libdir_flag_spec\"
3429 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3430 # We should set the runpath_var.
3432 for dir
in $perm_rpath; do
3435 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3437 test -n "$dep_rpath" && deplibs
="$dep_rpath $deplibs"
3440 shlibpath
="$finalize_shlibpath"
3441 test "$mode" != relink
&& shlibpath
="$compile_shlibpath$shlibpath"
3442 if test -n "$shlibpath"; then
3443 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3446 # Get the real and link names of the library.
3447 eval shared_ext
=\"$shrext\"
3448 eval library_names
=\"$library_names_spec\"
3449 set dummy
$library_names
3453 if test -n "$soname_spec"; then
3454 eval soname
=\"$soname_spec\"
3458 if test -z "$dlname"; then
3462 lib
="$output_objdir/$realname"
3465 linknames
="$linknames $link"
3468 # Use standard objects if they are pic
3469 test -z "$pic_flag" && libobjs
=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3471 # Prepare the list of exported symbols
3472 if test -z "$export_symbols"; then
3473 if test "$always_export_symbols" = yes ||
test -n "$export_symbols_regex"; then
3474 $show "generating symbol list for \`$libname.la'"
3475 export_symbols
="$output_objdir/$libname.exp"
3476 $run $rm $export_symbols
3477 eval cmds
=\"$export_symbols_cmds\"
3478 save_ifs
="$IFS"; IFS
='~'
3479 for cmd
in $cmds; do
3481 if len
=`expr "X$cmd" : ".*"` &&
3482 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
3484 $run eval "$cmd" ||
exit $?
3485 skipped_export
=false
3487 # The command line is too long to execute in one step.
3488 $show "using reloadable object file for export list..."
3493 if test -n "$export_symbols_regex"; then
3494 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3495 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3496 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3497 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3502 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3503 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3506 if test -n "$convenience"; then
3507 if test -n "$whole_archive_flag_spec"; then
3508 save_libobjs
=$libobjs
3509 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
3511 gentop
="$output_objdir/${outputname}x"
3512 $show "${rm}r $gentop"
3513 $run ${rm}r
"$gentop"
3514 $show "$mkdir $gentop"
3515 $run $mkdir "$gentop"
3517 if test "$status" -ne 0 && test ! -d "$gentop"; then
3520 generated
="$generated $gentop"
3522 for xlib
in $convenience; do
3523 # Extract the objects.
3525 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
3526 *) xabs
=`pwd`"/$xlib" ;;
3528 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3529 xdir
="$gentop/$xlib"
3531 $show "${rm}r $xdir"
3533 $show "$mkdir $xdir"
3536 if test "$status" -ne 0 && test ! -d "$xdir"; then
3539 # We will extract separately just the conflicting names and we will no
3540 # longer touch any unique names. It is faster to leave these extract
3541 # automatically by $AR in one run.
3542 $show "(cd $xdir && $AR x $xabs)"
3543 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
3544 if ($AR t
"$xabs" |
sort |
sort -uc >/dev
/null
2>&1); then
3547 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3548 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3549 $AR t
"$xabs" |
sort |
uniq -cd |
while read -r count name
3552 while test "$i" -le "$count"
3554 # Put our $i before any first dot (extension)
3555 # Never overwrite any file
3557 while test "X$name_to" = "X$name" ||
test -f "$xdir/$name_to"
3559 name_to
=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3561 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3562 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" ||
exit $?
3568 libobjs
="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3573 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3574 eval flag
=\"$thread_safe_flag_spec\"
3575 linker_flags
="$linker_flags $flag"
3578 # Make a backup of the uninstalled library when relinking
3579 if test "$mode" = relink
; then
3580 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' ||
exit $?
3583 # Do each of the archive commands.
3584 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3585 eval cmds
=\"$archive_expsym_cmds\"
3587 save_deplibs
="$deplibs"
3588 for conv
in $convenience; do
3590 for test_deplib
in $deplibs; do
3591 if test "$test_deplib" != "$conv"; then
3592 tmp_deplibs
="$tmp_deplibs $test_deplib"
3595 deplibs
="$tmp_deplibs"
3597 eval cmds
=\"$archive_cmds\"
3598 deplibs
="$save_deplibs"
3601 if test "X$skipped_export" != "X:" && len
=`expr "X$cmds" : ".*"` &&
3602 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
3605 # The command line is too long to link in one step, link piecewise.
3606 $echo "creating reloadable object files..."
3608 # Save the value of $output and $libobjs because we want to
3609 # use them later. If we have whole_archive_flag_spec, we
3610 # want to use save_libobjs as it was before
3611 # whole_archive_flag_spec was expanded, because we can't
3612 # assume the linker understands whole_archive_flag_spec.
3613 # This may have to be revisited, in case too many
3614 # convenience libraries get linked in and end up exceeding
3616 if test -z "$convenience" ||
test -z "$whole_archive_flag_spec"; then
3617 save_libobjs
=$libobjs
3621 # Clear the reloadable object creation command queue and
3622 # initialize k to one.
3629 output
=$output_objdir/$save_output-${k}.
$objext
3630 # Loop over the list of objects to be linked.
3631 for obj
in $save_libobjs
3633 eval test_cmds
=\"$reload_cmds $objlist $last_robj\"
3634 if test "X$objlist" = X ||
3635 { len
=`expr "X$test_cmds" : ".*"` &&
3636 test "$len" -le "$max_cmd_len"; }; then
3637 objlist
="$objlist $obj"
3639 # The command $test_cmds is almost too long, add a
3640 # command to the queue.
3641 if test "$k" -eq 1 ; then
3642 # The first file doesn't have a previous command to add.
3643 eval concat_cmds
=\"$reload_cmds $objlist $last_robj\"
3645 # All subsequent reloadable object files will link in
3646 # the last one created.
3647 eval concat_cmds
=\"\
$concat_cmds~
$reload_cmds $objlist $last_robj\"
3649 last_robj
=$output_objdir/$save_output-${k}.
$objext
3651 output
=$output_objdir/$save_output-${k}.
$objext
3656 # Handle the remaining objects by creating one last
3657 # reloadable object file. All subsequent reloadable object
3658 # files will link in the last one created.
3659 test -z "$concat_cmds" || concat_cmds
=$concat_cmds~
3660 eval concat_cmds
=\"\
${concat_cmds}$reload_cmds $objlist $last_robj\"
3662 if ${skipped_export-false}; then
3663 $show "generating symbol list for \`$libname.la'"
3664 export_symbols
="$output_objdir/$libname.exp"
3665 $run $rm $export_symbols
3667 # Append the command to create the export file.
3668 eval concat_cmds
=\"\
$concat_cmds~
$export_symbols_cmds\"
3671 # Set up a command to remove the reloadale object files
3672 # after they are used.
3674 while test "$i" -lt "$k"
3677 delfiles
="$delfiles $output_objdir/$save_output-${i}.$objext"
3680 $echo "creating a temporary reloadable object file: $output"
3682 # Loop through the commands generated above and execute them.
3683 save_ifs
="$IFS"; IFS
='~'
3684 for cmd
in $concat_cmds; do
3687 $run eval "$cmd" ||
exit $?
3692 # Restore the value of output.
3695 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3696 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
3698 # Expand the library linking commands again to reset the
3699 # value of $libobjs for piecewise linking.
3701 # Do each of the archive commands.
3702 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3703 eval cmds
=\"$archive_expsym_cmds\"
3705 eval cmds
=\"$archive_cmds\"
3708 # Append the command to remove the reloadable object files
3709 # to the just-reset $cmds.
3710 eval cmds
=\"\
$cmds~
$rm $delfiles\"
3712 save_ifs
="$IFS"; IFS
='~'
3713 for cmd
in $cmds; do
3716 $run eval "$cmd" ||
exit $?
3720 # Restore the uninstalled library and exit
3721 if test "$mode" = relink
; then
3722 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' ||
exit $?
3726 # Create links to the real library.
3727 for linkname
in $linknames; do
3728 if test "$realname" != "$linkname"; then
3729 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3730 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' ||
exit $?
3734 # If -module or -export-dynamic was specified, set the dlname.
3735 if test "$module" = yes ||
test "$export_dynamic" = yes; then
3736 # On all known operating systems, these are identical.
3743 if test -n "$deplibs"; then
3744 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3747 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
3748 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3751 if test -n "$rpath"; then
3752 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3755 if test -n "$xrpath"; then
3756 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3759 if test -n "$vinfo"; then
3760 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3763 if test -n "$release"; then
3764 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3769 if test -n "$objs$old_deplibs"; then
3770 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3774 obj
=`$echo "X$output" | $Xsed -e "$lo2o"`
3782 # Delete the old objects.
3783 $run $rm $obj $libobj
3785 # Objects from convenience libraries. This assumes
3786 # single-version convenience libraries. Whenever we create
3787 # different ones for PIC/non-PIC, this we'll have to duplicate
3791 # reload_cmds runs $LD directly, so let us get rid of
3792 # -Wl from whole_archive_flag_spec
3795 if test -n "$convenience"; then
3796 if test -n "$whole_archive_flag_spec"; then
3797 eval reload_conv_objs
=\"\
$reload_objs $whole_archive_flag_spec\"
3799 gentop
="$output_objdir/${obj}x"
3800 $show "${rm}r $gentop"
3801 $run ${rm}r
"$gentop"
3802 $show "$mkdir $gentop"
3803 $run $mkdir "$gentop"
3805 if test "$status" -ne 0 && test ! -d "$gentop"; then
3808 generated
="$generated $gentop"
3810 for xlib
in $convenience; do
3811 # Extract the objects.
3813 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
3814 *) xabs
=`pwd`"/$xlib" ;;
3816 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3817 xdir
="$gentop/$xlib"
3819 $show "${rm}r $xdir"
3821 $show "$mkdir $xdir"
3824 if test "$status" -ne 0 && test ! -d "$xdir"; then
3827 # We will extract separately just the conflicting names and we will no
3828 # longer touch any unique names. It is faster to leave these extract
3829 # automatically by $AR in one run.
3830 $show "(cd $xdir && $AR x $xabs)"
3831 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
3832 if ($AR t
"$xabs" |
sort |
sort -uc >/dev
/null
2>&1); then
3835 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3836 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3837 $AR t
"$xabs" |
sort |
uniq -cd |
while read -r count name
3840 while test "$i" -le "$count"
3842 # Put our $i before any first dot (extension)
3843 # Never overwrite any file
3845 while test "X$name_to" = "X$name" ||
test -f "$xdir/$name_to"
3847 name_to
=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3849 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3850 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" ||
exit $?
3856 reload_conv_objs
="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3861 # Create the old-style object.
3862 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
3865 eval cmds
=\"$reload_cmds\"
3866 save_ifs
="$IFS"; IFS
='~'
3867 for cmd
in $cmds; do
3870 $run eval "$cmd" ||
exit $?
3874 # Exit if we aren't doing a library object file.
3875 if test -z "$libobj"; then
3876 if test -n "$gentop"; then
3877 $show "${rm}r $gentop"
3884 if test "$build_libtool_libs" != yes; then
3885 if test -n "$gentop"; then
3886 $show "${rm}r $gentop"
3890 # Create an invalid libtool object if no PIC, so that we don't
3891 # accidentally link it into a program.
3892 # $show "echo timestamp > $libobj"
3893 # $run eval "echo timestamp > $libobj" || exit $?
3897 if test -n "$pic_flag" ||
test "$pic_mode" != default
; then
3898 # Only do commands if we really have different PIC objects.
3899 reload_objs
="$libobjs $reload_conv_objs"
3901 eval cmds
=\"$reload_cmds\"
3902 save_ifs
="$IFS"; IFS
='~'
3903 for cmd
in $cmds; do
3906 $run eval "$cmd" ||
exit $?
3911 if test -n "$gentop"; then
3912 $show "${rm}r $gentop"
3921 *cygwin
*) output
=`echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
3923 if test -n "$vinfo"; then
3924 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
3927 if test -n "$release"; then
3928 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
3931 if test "$preload" = yes; then
3932 if test "$dlopen_support" = unknown
&& test "$dlopen_self" = unknown
&&
3933 test "$dlopen_self_static" = unknown
; then
3934 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
3939 *-*-rhapsody* |
*-*-darwin1.
[012])
3940 # On Rhapsody replace the C library is the System framework
3941 compile_deplibs
=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3942 finalize_deplibs
=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3948 # Don't allow lazy linking, it breaks C++ global constructors
3949 compile_command
="$compile_command ${wl}-bind_at_load"
3950 finalize_command
="$finalize_command ${wl}-bind_at_load"
3954 compile_command
="$compile_command $compile_deplibs"
3955 finalize_command
="$finalize_command $finalize_deplibs"
3957 if test -n "$rpath$xrpath"; then
3958 # If the user specified any rpath flags, then add them.
3959 for libdir
in $rpath $xrpath; do
3960 # This is the magic to use -rpath.
3961 case "$finalize_rpath " in
3963 *) finalize_rpath
="$finalize_rpath $libdir" ;;
3968 # Now hardcode the library paths
3971 for libdir
in $compile_rpath $finalize_rpath; do
3972 if test -n "$hardcode_libdir_flag_spec"; then
3973 if test -n "$hardcode_libdir_separator"; then
3974 if test -z "$hardcode_libdirs"; then
3975 hardcode_libdirs
="$libdir"
3977 # Just accumulate the unique libdirs.
3978 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3979 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3982 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3987 eval flag
=\"$hardcode_libdir_flag_spec\"
3988 rpath
="$rpath $flag"
3990 elif test -n "$runpath_var"; then
3991 case "$perm_rpath " in
3993 *) perm_rpath
="$perm_rpath $libdir" ;;
3997 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
3998 case :$dllsearchpath: in
4000 *) dllsearchpath
="$dllsearchpath:$libdir";;
4005 # Substitute the hardcoded libdirs into the rpath.
4006 if test -n "$hardcode_libdir_separator" &&
4007 test -n "$hardcode_libdirs"; then
4008 libdir
="$hardcode_libdirs"
4009 eval rpath
=\" $hardcode_libdir_flag_spec\"
4011 compile_rpath
="$rpath"
4015 for libdir
in $finalize_rpath; do
4016 if test -n "$hardcode_libdir_flag_spec"; then
4017 if test -n "$hardcode_libdir_separator"; then
4018 if test -z "$hardcode_libdirs"; then
4019 hardcode_libdirs
="$libdir"
4021 # Just accumulate the unique libdirs.
4022 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4023 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4026 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4031 eval flag
=\"$hardcode_libdir_flag_spec\"
4032 rpath
="$rpath $flag"
4034 elif test -n "$runpath_var"; then
4035 case "$finalize_perm_rpath " in
4037 *) finalize_perm_rpath
="$finalize_perm_rpath $libdir" ;;
4041 # Substitute the hardcoded libdirs into the rpath.
4042 if test -n "$hardcode_libdir_separator" &&
4043 test -n "$hardcode_libdirs"; then
4044 libdir
="$hardcode_libdirs"
4045 eval rpath
=\" $hardcode_libdir_flag_spec\"
4047 finalize_rpath
="$rpath"
4049 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4050 # Transform all the library objects into standard objects.
4051 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4052 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4056 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
4057 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4058 dlsyms
="${outputname}S.c"
4060 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4064 if test -n "$dlsyms"; then
4068 # Discover the nlist of each of the dlfiles.
4069 nlist
="$output_objdir/${outputname}.nm"
4071 $show "$rm $nlist ${nlist}S ${nlist}T"
4072 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4074 # Parse the name list into a source file.
4075 $show "creating $output_objdir/$dlsyms"
4077 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4078 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4079 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4085 /* Prevent the only kind of declaration conflicts we can make. */
4086 #define lt_preloaded_symbols some_other_symbol
4088 /* External symbol declarations for the compiler. */\
4091 if test "$dlself" = yes; then
4092 $show "generating symbol list for \`$output'"
4094 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4096 # Add our own program objects to the symbol list.
4097 progfiles
=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4098 for arg
in $progfiles; do
4099 $show "extracting global C symbols from \`$arg'"
4100 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4103 if test -n "$exclude_expsyms"; then
4104 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4105 $run eval '$mv "$nlist"T "$nlist"'
4108 if test -n "$export_symbols_regex"; then
4109 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4110 $run eval '$mv "$nlist"T "$nlist"'
4113 # Prepare the list of exported symbols
4114 if test -z "$export_symbols"; then
4115 export_symbols
="$output_objdir/$output.exp"
4116 $run $rm $export_symbols
4117 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4119 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
4120 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
4121 $run eval 'mv "$nlist"T "$nlist"'
4125 for arg
in $dlprefiles; do
4126 $show "extracting global C symbols from \`$arg'"
4127 name
=`echo "$arg" | ${SED} -e 's%^.*/%%'`
4128 $run eval 'echo ": $name " >> "$nlist"'
4129 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4132 if test -z "$run"; then
4133 # Make sure we have at least an empty file.
4134 test -f "$nlist" ||
: > "$nlist"
4136 if test -n "$exclude_expsyms"; then
4137 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4138 $mv "$nlist"T
"$nlist"
4141 # Try sorting and uniquifying the output.
4142 if grep -v "^: " < "$nlist" |
4143 if sort -k 3 </dev
/null
>/dev
/null
2>&1; then
4148 uniq > "$nlist"S
; then
4151 grep -v "^: " < "$nlist" > "$nlist"S
4154 if test -f "$nlist"S
; then
4155 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4157 echo '/* NONE */' >> "$output_objdir/$dlsyms"
4160 $echo >> "$output_objdir/$dlsyms" "\
4162 #undef lt_preloaded_symbols
4164 #if defined (__STDC__) && __STDC__
4165 # define lt_ptr void *
4167 # define lt_ptr char *
4171 /* The mapping between symbol names and symbols. */
4176 lt_preloaded_symbols[] =
4180 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4182 $echo >> "$output_objdir/$dlsyms" "\
4186 /* This works around a problem in FreeBSD linker */
4187 #ifdef FREEBSD_WORKAROUND
4188 static const void *lt_preloaded_setup() {
4189 return lt_preloaded_symbols;
4199 pic_flag_for_symtable
=
4201 # compiling the symbol table file with pic_flag works around
4202 # a FreeBSD bug that causes programs to crash when -lm is
4203 # linked before any other PIC object. But we must not use
4204 # pic_flag when linking with -static. The problem exists in
4205 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4206 *-*-freebsd2*|
*-*-freebsd3.0
*|
*-*-freebsdelf3.0
*)
4207 case "$compile_command " in
4209 *) pic_flag_for_symtable
=" $pic_flag -DFREEBSD_WORKAROUND";;
4212 case "$compile_command " in
4214 *) pic_flag_for_symtable
=" $pic_flag";;
4218 # Now compile the dynamic symbol file.
4219 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4220 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' ||
exit $?
4222 # Clean up the generated files.
4223 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4224 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4226 # Transform the symbol file into the correct name.
4227 compile_command
=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4228 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4231 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4236 # We keep going just in case the user didn't refer to
4237 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4238 # really was required.
4240 # Nullify the symbol file.
4241 compile_command
=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4242 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4245 if test "$need_relink" = no ||
test "$build_libtool_libs" != yes; then
4246 # Replace the output file specification.
4247 compile_command
=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4248 link_command
="$compile_command$compile_rpath"
4250 # We have no uninstalled library dependencies, so finalize right now.
4251 $show "$link_command"
4252 $run eval "$link_command"
4255 # Delete the generated files.
4256 if test -n "$dlsyms"; then
4257 $show "$rm $output_objdir/${outputname}S.${objext}"
4258 $run $rm "$output_objdir/${outputname}S.${objext}"
4264 if test -n "$shlibpath_var"; then
4265 # We should set the shlibpath_var
4267 for dir
in $temp_rpath; do
4269 [\\/]* |
[A-Za-z
]:[\\/]*)
4274 # Relative path: add a thisdir entry.
4275 rpath
="$rpath\$thisdir/$dir:"
4282 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4283 compile_command
="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4285 if test -n "$finalize_shlibpath"; then
4286 finalize_command
="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4291 if test -n "$runpath_var"; then
4292 if test -n "$perm_rpath"; then
4293 # We should set the runpath_var.
4295 for dir
in $perm_rpath; do
4298 compile_var
="$runpath_var=\"$rpath\$$runpath_var\" "
4300 if test -n "$finalize_perm_rpath"; then
4301 # We should set the runpath_var.
4303 for dir
in $finalize_perm_rpath; do
4306 finalize_var
="$runpath_var=\"$rpath\$$runpath_var\" "
4310 if test "$no_install" = yes; then
4311 # We don't need to create a wrapper script.
4312 link_command
="$compile_var$compile_command$compile_rpath"
4313 # Replace the output file specification.
4314 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4315 # Delete the old output file.
4317 # Link the executable and exit
4318 $show "$link_command"
4319 $run eval "$link_command" ||
exit $?
4323 if test "$hardcode_action" = relink
; then
4324 # Fast installation is not supported
4325 link_command
="$compile_var$compile_command$compile_rpath"
4326 relink_command
="$finalize_var$finalize_command$finalize_rpath"
4328 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4329 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4331 if test "$fast_install" != no
; then
4332 link_command
="$finalize_var$compile_command$finalize_rpath"
4333 if test "$fast_install" = yes; then
4334 relink_command
=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4336 # fast_install is set to needless
4340 link_command
="$compile_var$compile_command$compile_rpath"
4341 relink_command
="$finalize_var$finalize_command$finalize_rpath"
4345 # Replace the output file specification.
4346 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4348 # Delete the old output files.
4349 $run $rm $output $output_objdir/$outputname $output_objdir/lt-
$outputname
4351 $show "$link_command"
4352 $run eval "$link_command" ||
exit $?
4354 # Now create the wrapper script.
4355 $show "creating $output"
4357 # Quote the relink command for shipping.
4358 if test -n "$relink_command"; then
4359 # Preserve any variables that may affect compiler behavior
4360 for var
in $variables_saved_for_relink; do
4361 if eval test -z \"\
${$var+set}\"; then
4362 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4363 elif eval var_value
=\$
$var; test -z "$var_value"; then
4364 relink_command
="$var=; export $var; $relink_command"
4366 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4367 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
4370 relink_command
="(cd `pwd`; $relink_command)"
4371 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4374 # Quote $echo for shipping.
4375 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
4377 [\\/]* |
[A-Za-z
]:[\\/]*) qecho
="$SHELL $0 --fallback-echo";;
4378 *) qecho
="$SHELL `pwd`/$0 --fallback-echo";;
4380 qecho
=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4382 qecho
=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4385 # Only actually do things if our run command is non-null.
4386 if test -z "$run"; then
4387 # win32 will think the script is a binary if it has
4388 # a .exe suffix, so we strip it off here.
4390 *.exe
) output
=`echo $output|${SED} 's,.exe$,,'` ;;
4392 # test for cygwin because mv fails w/o .exe extensions
4396 outputname
=`echo $outputname|${SED} 's,.exe$,,'` ;;
4400 *cygwin
* |
*mingw
* )
4401 cwrappersource
=`echo ${objdir}/lt-${output}.c`
4402 cwrapper
=`echo ${output}.exe`
4403 $rm $cwrappersource $cwrapper
4404 trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
4406 cat > $cwrappersource <<EOF
4408 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4409 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4411 The $output program cannot be directly executed until all the libtool
4412 libraries that it depends on are installed.
4414 This wrapper executable should never be moved out of the build directory.
4415 If it is, it will not operate correctly.
4417 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4418 but could eventually absorb all of the scripts functionality and
4419 exec $objdir/$outputname directly.
4422 cat >> $cwrappersource<<"EOF"
4430 #if defined(PATH_MAX)
4431 # define LT_PATHMAX PATH_MAX
4432 #elif defined(MAXPATHLEN)
4433 # define LT_PATHMAX MAXPATHLEN
4435 # define LT_PATHMAX 1024
4438 #ifndef DIR_SEPARATOR
4439 #define DIR_SEPARATOR '/'
4442 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4444 #define HAVE_DOS_BASED_FILE_SYSTEM
4445 #ifndef DIR_SEPARATOR_2
4446 #define DIR_SEPARATOR_2 '\\'
4450 #ifndef DIR_SEPARATOR_2
4451 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4452 #else /* DIR_SEPARATOR_2 */
4453 # define IS_DIR_SEPARATOR(ch) \
4454 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4455 #endif /* DIR_SEPARATOR_2 */
4457 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4458 #define XFREE(stale) do { \
4459 if (stale) { free ((void *) stale); stale = 0; } \
4462 const char *program_name = NULL;
4464 void * xmalloc (size_t num);
4465 char * xstrdup (const char *string);
4466 char * basename (const char *name);
4467 char * fnqualify(const char *path);
4468 char * strendzap(char *str, const char *pat);
4469 void lt_fatal (const char *message, ...);
4472 main (int argc, char *argv[])
4477 program_name = (char *) xstrdup ((char *) basename (argv[0]));
4478 newargz = XMALLOC(char *, argc+2);
4481 cat >> $cwrappersource <<EOF
4482 newargz[0] = "$SHELL";
4485 cat >> $cwrappersource <<"EOF"
4486 newargz
[1] = fnqualify
(argv
[0]);
4487 /* we know the
script has the same name
, without the .exe
*/
4488 /* so
make sure newargz
[1] doesn
't end in .exe */
4489 strendzap(newargz[1],".exe");
4490 for (i = 1; i < argc; i++)
4491 newargz[i+1] = xstrdup(argv[i]);
4492 newargz[argc+1] = NULL;
4495 cat >> $cwrappersource <<EOF
4496 execv("$SHELL",newargz);
4499 cat >> $cwrappersource <<"EOF"
4503 xmalloc (size_t num)
4505 void * p = (void *) malloc (num);
4507 lt_fatal ("Memory exhausted");
4513 xstrdup (const char *string)
4515 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4520 basename (const char *name)
4524 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4525 /* Skip over the disk name in MSDOS pathnames. */
4526 if (isalpha (name[0]) && name[1] == ':')
4530 for (base = name; *name; name++)
4531 if (IS_DIR_SEPARATOR (*name))
4533 return (char *) base;
4537 fnqualify(const char *path)
4541 char tmp[LT_PATHMAX + 1];
4543 assert(path != NULL);
4545 /* Is it qualified already? */
4546 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4547 if (isalpha (path[0]) && path[1] == ':')
4548 return xstrdup (path);
4550 if (IS_DIR_SEPARATOR (path[0]))
4551 return xstrdup (path);
4553 /* prepend the current directory */
4554 /* doesn't handle
'~' */
4555 if (getcwd
(tmp
, LT_PATHMAX
) == NULL
)
4556 lt_fatal
("getcwd failed");
4557 size
= strlen
(tmp
) + 1 + strlen
(path
) + 1; /* +2 for '/' and
'\0' */
4558 p
= XMALLOC
(char
, size
);
4559 sprintf
(p
, "%s%c%s", tmp
, DIR_SEPARATOR
, path
);
4564 strendzap
(char
*str
, const char
*pat
)
4568 assert
(str
!= NULL
);
4569 assert
(pat
!= NULL
);
4572 patlen
= strlen
(pat
);
4576 str
+= len
- patlen
;
4577 if (strcmp
(str
, pat
) == 0)
4584 lt_error_core
(int exit_status
, const char
* mode
,
4585 const char
* message
, va_list ap
)
4587 fprintf
(stderr
, "%s: %s: ", program_name
, mode
);
4588 vfprintf
(stderr
, message
, ap
);
4589 fprintf
(stderr
, ".\n");
4591 if (exit_status
>= 0)
4596 lt_fatal
(const char
*message
, ...
)
4599 va_start
(ap
, message
);
4600 lt_error_core
(EXIT_FAILURE
, "FATAL", message
, ap
);
4604 # we should really use a build-platform specific compiler
4605 # here, but OTOH, the wrappers (shell script and this C one)
4606 # are only useful if you want to execute the "real" binary.
4607 # Since the "real" binary is built for $host, then this
4608 # wrapper might as well be built for $host, too.
4609 $run $LTCC -s -o $cwrapper $cwrappersource
4613 trap "$rm $output; exit 1" 1 2 15
4618 # $output - temporary wrapper script for $objdir/$outputname
4619 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4621 # The $output program cannot be directly executed until all the libtool
4622 # libraries that it depends on are installed.
4624 # This wrapper script should never be moved out of the build directory.
4625 # If it is, it will not operate correctly.
4627 # Sed substitution that helps us do robust quoting. It backslashifies
4628 # metacharacters that are still active within double-quoted strings.
4629 Xsed='${SED} -e 1s/^X//'
4630 sed_quote_subst='$sed_quote_subst'
4632 # The HP-UX ksh and POSIX shell print the target directory to stdout
4634 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
4636 relink_command=\"$relink_command\"
4638 # This environment variable determines our operation mode.
4639 if test \"\$libtool_install_magic\" = \"$magic\"; then
4640 # install mode needs the following variable:
4641 notinst_deplibs='$notinst_deplibs'
4643 # When we are sourced in execute mode, \$file and \$echo are already set.
4644 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4647 # Make sure echo works.
4648 if test \"X\$1\" = X--no-reexec; then
4649 # Discard the --no-reexec flag, and continue.
4651 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4652 # Yippee, \$echo works!
4655 # Restart under the correct shell, and then maybe \$echo will work.
4656 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4662 # Find the directory that this script lives in.
4663 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4664 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4666 # Follow symbolic links until we get to the real thisdir.
4667 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4668 while test -n \"\$file\"; do
4669 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4671 # If there was a directory component, then change thisdir.
4672 if test \"x\$destdir\" != \"x\$file\"; then
4673 case \"\$destdir\" in
4674 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4675 *) thisdir=\"\$thisdir/\$destdir\" ;;
4679 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4680 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
4683 # Try to get the absolute directory name.
4684 absdir=\`cd \"\$thisdir\" && pwd\`
4685 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4688 if test "$fast_install" = yes; then
4690 program=lt-'$outputname'$exeext
4691 progdir=\"\$thisdir/$objdir\"
4693 if test ! -f \"\$progdir/\$program\" || \\
4694 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4695 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4697 file=\"\$\$-\$program\"
4699 if test ! -d \"\$progdir\"; then
4700 $mkdir \"\$progdir\"
4702 $rm \"\$progdir/\$file\"
4707 # relink executable if necessary
4708 if test -n \"\$relink_command\"; then
4709 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4711 $echo \"\$relink_command_output\" >&2
4712 $rm \"\$progdir/\$file\"
4717 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4718 { $rm \"\$progdir/\$program\";
4719 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4720 $rm \"\$progdir/\$file\"
4724 program='$outputname'
4725 progdir=\"\$thisdir/$objdir\"
4731 if test -f \"\$progdir/\$program\"; then"
4733 # Export our shlibpath_var if we have one.
4734 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4736 # Add our own library path to $shlibpath_var
4737 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4739 # Some systems cannot cope with colon-terminated $shlibpath_var
4740 # The second colon is a workaround for a bug in BeOS R4 sed
4741 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4743 export $shlibpath_var
4747 # fixup the dll searchpath if we need to.
4748 if test -n "$dllsearchpath"; then
4750 # Add the dll search path components to the executable PATH
4751 PATH=$dllsearchpath:\$PATH
4756 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4757 # Run the actual program with our arguments.
4760 # Backslashes separate directories on plain windows
4761 *-*-mingw |
*-*-os2*)
4763 exec \$progdir\\\\\$program \${1+\"\$@\"}
4769 exec \$progdir/\$program \${1+\"\$@\"}
4774 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4778 # The program doesn't exist.
4779 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4780 \$echo \"This script is just a wrapper for \$program.\" 1>&2
4781 echo \"See the $PACKAGE documentation for more information.\" 1>&2
4792 # See if we need to build an old-fashioned archive.
4793 for oldlib
in $oldlibs; do
4795 if test "$build_libtool_libs" = convenience
; then
4796 oldobjs
="$libobjs_save"
4797 addlibs
="$convenience"
4798 build_libtool_libs
=no
4800 if test "$build_libtool_libs" = module
; then
4801 oldobjs
="$libobjs_save"
4802 build_libtool_libs
=no
4804 oldobjs
="$old_deplibs $non_pic_objects"
4806 addlibs
="$old_convenience"
4809 if test -n "$addlibs"; then
4810 gentop
="$output_objdir/${outputname}x"
4811 $show "${rm}r $gentop"
4812 $run ${rm}r
"$gentop"
4813 $show "$mkdir $gentop"
4814 $run $mkdir "$gentop"
4816 if test "$status" -ne 0 && test ! -d "$gentop"; then
4819 generated
="$generated $gentop"
4821 # Add in members from convenience archives.
4822 for xlib
in $addlibs; do
4823 # Extract the objects.
4825 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
4826 *) xabs
=`pwd`"/$xlib" ;;
4828 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4829 xdir
="$gentop/$xlib"
4831 $show "${rm}r $xdir"
4833 $show "$mkdir $xdir"
4836 if test "$status" -ne 0 && test ! -d "$xdir"; then
4839 # We will extract separately just the conflicting names and we will no
4840 # longer touch any unique names. It is faster to leave these extract
4841 # automatically by $AR in one run.
4842 $show "(cd $xdir && $AR x $xabs)"
4843 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
4844 if ($AR t
"$xabs" |
sort |
sort -uc >/dev
/null
2>&1); then
4847 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
4848 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
4849 $AR t
"$xabs" |
sort |
uniq -cd |
while read -r count name
4852 while test "$i" -le "$count"
4854 # Put our $i before any first dot (extension)
4855 # Never overwrite any file
4857 while test "X$name_to" = "X$name" ||
test -f "$xdir/$name_to"
4859 name_to
=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
4861 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
4862 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" ||
exit $?
4868 oldobjs
="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
4872 # Do each command in the archive commands.
4873 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
4874 eval cmds
=\"$old_archive_from_new_cmds\"
4876 eval cmds
=\"$old_archive_cmds\"
4878 if len
=`expr "X$cmds" : ".*"` &&
4879 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
4882 # the command line is too long to link in one step, link in parts
4883 $echo "using piecewise archive linking..."
4888 save_oldobjs
=$oldobjs
4889 # GNU ar 2.10+ was changed to match POSIX; thus no paths are
4890 # encoded into archives. This makes 'ar r' malfunction in
4891 # this piecewise linking case whenever conflicting object
4892 # names appear in distinct ar calls; check, warn and compensate.
4893 if (for obj
in $save_oldobjs
4895 $echo "X$obj" |
$Xsed -e 's%^.*/%%'
4896 done |
sort |
sort -uc >/dev
/null
2>&1); then
4899 $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
4900 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
4903 for obj
in $save_oldobjs
4905 oldobjs
="$objlist $obj"
4906 objlist
="$objlist $obj"
4907 eval test_cmds
=\"$old_archive_cmds\"
4908 if len
=`expr "X$test_cmds" : ".*"` &&
4909 test "$len" -le "$max_cmd_len"; then
4912 # the above command should be used before it gets too long
4914 test -z "$concat_cmds" || concat_cmds
=$concat_cmds~
4915 eval concat_cmds
=\"\
${concat_cmds}$old_archive_cmds\"
4921 if test "X$oldobjs" = "X" ; then
4922 eval cmds
=\"\
$concat_cmds\"
4924 eval cmds
=\"\
$concat_cmds~
$old_archive_cmds\"
4928 save_ifs
="$IFS"; IFS
='~'
4929 for cmd
in $cmds; do
4932 $run eval "$cmd" ||
exit $?
4937 if test -n "$generated"; then
4938 $show "${rm}r$generated"
4939 $run ${rm}r
$generated
4942 # Now create the libtool archive.
4946 test "$build_old_libs" = yes && old_library
="$libname.$libext"
4947 $show "creating $output"
4949 # Preserve any variables that may affect compiler behavior
4950 for var
in $variables_saved_for_relink; do
4951 if eval test -z \"\
${$var+set}\"; then
4952 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4953 elif eval var_value
=\$
$var; test -z "$var_value"; then
4954 relink_command
="$var=; export $var; $relink_command"
4956 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4957 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
4960 # Quote the link command for shipping.
4961 relink_command
="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
4962 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4964 # Only create the output if not a dry run.
4965 if test -z "$run"; then
4966 for installed
in no
yes; do
4967 if test "$installed" = yes; then
4968 if test -z "$install_libdir"; then
4971 output
="$output_objdir/$outputname"i
4972 # Replace all uninstalled libtool libraries with the installed ones
4974 for deplib
in $dependency_libs; do
4977 name
=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
4978 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
4979 if test -z "$libdir"; then
4980 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
4983 newdependency_libs
="$newdependency_libs $libdir/$name"
4985 *) newdependency_libs
="$newdependency_libs $deplib" ;;
4988 dependency_libs
="$newdependency_libs"
4990 for lib
in $dlfiles; do
4991 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4992 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4993 if test -z "$libdir"; then
4994 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4997 newdlfiles
="$newdlfiles $libdir/$name"
4999 dlfiles
="$newdlfiles"
5001 for lib
in $dlprefiles; do
5002 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5003 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5004 if test -z "$libdir"; then
5005 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5008 newdlprefiles
="$newdlprefiles $libdir/$name"
5010 dlprefiles
="$newdlprefiles"
5013 # place dlname in correct position for cygwin
5015 case $host,$output,$installed,$module,$dlname in
5016 *cygwin
*,*lai
,yes,no
,*.dll |
*mingw
*,*lai
,yes,no
,*.dll
) tdlname
=..
/bin
/$dlname ;;
5019 # $outputname - a libtool library file
5020 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5022 # Please DO NOT delete this file!
5023 # It is necessary for linking the library.
5025 # The name that we can dlopen(3).
5028 # Names of this library.
5029 library_names='$library_names'
5031 # The name of the static archive.
5032 old_library='$old_library'
5034 # Libraries that this one depends upon.
5035 dependency_libs='$dependency_libs'
5037 # Version information for $libname.
5042 # Is this an already installed library?
5043 installed=$installed
5045 # Files to dlopen/dlpreopen
5047 dlpreopen='$dlprefiles'
5049 # Directory that this library needs to be installed in:
5050 libdir='$install_libdir'"
5051 if test "$installed" = no
&& test "$need_relink" = yes; then
5053 relink_command=\"$relink_command\""
5058 # Do a symbolic link so that the libtool archive can be found in
5059 # LD_LIBRARY_PATH before the program is installed.
5060 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5061 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' ||
exit $?
5067 # libtool install mode
5069 modename
="$modename: install"
5071 # There may be an optional sh(1) argument at the beginning of
5072 # install_prog (especially on Windows NT).
5073 if test "$nonopt" = "$SHELL" ||
test "$nonopt" = /bin
/sh ||
5074 # Allow the use of GNU shtool's install command.
5075 $echo "X$nonopt" |
$Xsed |
grep shtool
> /dev
/null
; then
5076 # Aesthetically quote it.
5077 arg
=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5079 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5083 install_prog
="$arg "
5091 # The real first argument should be the name of the installation program.
5092 # Aesthetically quote it.
5093 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5095 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5099 install_prog
="$install_prog$arg"
5101 # We need to accept at least all the BSD install flags.
5111 if test -n "$dest"; then
5112 files
="$files $dest"
5130 # If the previous option needed an argument, then skip it.
5131 if test -n "$prev"; then
5140 # Aesthetically quote the argument.
5141 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5143 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5147 install_prog
="$install_prog $arg"
5150 if test -z "$install_prog"; then
5151 $echo "$modename: you must specify an install program" 1>&2
5156 if test -n "$prev"; then
5157 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5162 if test -z "$files"; then
5163 if test -z "$dest"; then
5164 $echo "$modename: no file or destination specified" 1>&2
5166 $echo "$modename: you must specify a destination" 1>&2
5172 # Strip any trailing slash from the destination.
5173 dest
=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5175 # Check to see that the destination is a directory.
5176 test -d "$dest" && isdir
=yes
5177 if test "$isdir" = yes; then
5181 destdir
=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5182 test "X$destdir" = "X$dest" && destdir
=.
5183 destname
=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5185 # Not a directory, so check to see that there is only one file specified.
5187 if test "$#" -gt 2; then
5188 $echo "$modename: \`$dest' is not a directory" 1>&2
5194 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
5196 for file in $files; do
5200 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5209 # This variable tells wrapper scripts just to set variables rather
5210 # than running their programs.
5211 libtool_install_magic
="$magic"
5216 for file in $files; do
5218 # Do each installation.
5221 # Do the static libraries later.
5222 staticlibs
="$staticlibs $file"
5226 # Check to see that this really is a libtool archive.
5227 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
5229 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5237 # If there is no directory component, then add one.
5239 */* |
*\\*) .
$file ;;
5243 # Add the libdir to current_libdirs if it is the destination.
5244 if test "X$destdir" = "X$libdir"; then
5245 case "$current_libdirs " in
5247 *) current_libdirs
="$current_libdirs $libdir" ;;
5250 # Note the libdir as a future libdir.
5251 case "$future_libdirs " in
5253 *) future_libdirs
="$future_libdirs $libdir" ;;
5257 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5258 test "X$dir" = "X$file/" && dir
=
5261 if test -n "$relink_command"; then
5262 # Determine the prefix the user has applied to our future dir.
5263 inst_prefix_dir
=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5265 # Don't allow the user to place us outside of our expected
5266 # location b/c this prevents finding dependent libraries that
5267 # are installed to the same prefix.
5268 # At present, this check doesn't affect windows .dll's that
5269 # are installed into $libdir/../bin (currently, that works fine)
5270 # but it's something to keep an eye on.
5271 if test "$inst_prefix_dir" = "$destdir"; then
5272 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5276 if test -n "$inst_prefix_dir"; then
5277 # Stick the inst_prefix_dir data into the link command.
5278 relink_command
=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5280 relink_command
=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5283 $echo "$modename: warning: relinking \`$file'" 1>&2
5284 $show "$relink_command"
5285 if $run eval "$relink_command"; then :
5287 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5292 # See the names of the shared library.
5293 set dummy
$library_names
5294 if test -n "$2"; then
5300 test -n "$relink_command" && srcname
="$realname"T
5302 # Install the shared library and build the symlinks.
5303 $show "$install_prog $dir/$srcname $destdir/$realname"
5304 $run eval "$install_prog $dir/$srcname $destdir/$realname" ||
exit $?
5305 if test -n "$stripme" && test -n "$striplib"; then
5306 $show "$striplib $destdir/$realname"
5307 $run eval "$striplib $destdir/$realname" ||
exit $?
5310 if test "$#" -gt 0; then
5311 # Delete the old symlinks, and create new ones.
5314 if test "$linkname" != "$realname"; then
5315 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5316 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5321 # Do each command in the postinstall commands.
5322 lib
="$destdir/$realname"
5323 eval cmds
=\"$postinstall_cmds\"
5324 save_ifs
="$IFS"; IFS
='~'
5325 for cmd
in $cmds; do
5328 $run eval "$cmd" ||
exit $?
5333 # Install the pseudo-library for information purposes.
5334 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5335 instname
="$dir/$name"i
5336 $show "$install_prog $instname $destdir/$name"
5337 $run eval "$install_prog $instname $destdir/$name" ||
exit $?
5339 # Maybe install the static library, too.
5340 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
5344 # Install (i.e. copy) a libtool object.
5346 # Figure out destination file name, if it wasn't already specified.
5347 if test -n "$destname"; then
5348 destfile
="$destdir/$destname"
5350 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5351 destfile
="$destdir/$destfile"
5354 # Deduce the name of the destination old-style object file.
5357 staticdest
=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5360 staticdest
="$destfile"
5364 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5370 # Install the libtool object if requested.
5371 if test -n "$destfile"; then
5372 $show "$install_prog $file $destfile"
5373 $run eval "$install_prog $file $destfile" ||
exit $?
5376 # Install the old object if enabled.
5377 if test "$build_old_libs" = yes; then
5378 # Deduce the name of the old-style object file.
5379 staticobj
=`$echo "X$file" | $Xsed -e "$lo2o"`
5381 $show "$install_prog $staticobj $staticdest"
5382 $run eval "$install_prog \$staticobj \$staticdest" ||
exit $?
5388 # Figure out destination file name, if it wasn't already specified.
5389 if test -n "$destname"; then
5390 destfile
="$destdir/$destname"
5392 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5393 destfile
="$destdir/$destfile"
5396 # If the file is missing, and there is a .exe on the end, strip it
5397 # because it is most likely a libtool script we actually want to
5402 if test ! -f "$file"; then
5403 file=`echo $file|${SED} 's,.exe$,,'`
5409 # Do a test to see if this is really a libtool program.
5412 wrapper
=`echo $file | ${SED} -e 's,.exe$,,'`
5418 if (${SED} -e '4q' $wrapper |
grep "^# Generated by .*$PACKAGE")>/dev
/null
2>&1; then
5422 # To insure that "foo" is sourced, and not "foo.exe",
5423 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5424 # which disallows the automatic-append-.exe behavior.
5426 *cygwin
* |
*mingw
*) wrapperdot
=${wrapper}.
;;
5427 *) wrapperdot
=${wrapper} ;;
5429 # If there is no directory component, then add one.
5431 */* |
*\\*) .
${wrapperdot} ;;
5432 *) . .
/${wrapperdot} ;;
5435 # Check the variables that should have been set.
5436 if test -z "$notinst_deplibs"; then
5437 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5442 for lib
in $notinst_deplibs; do
5443 # Check to see that each library is installed.
5445 if test -f "$lib"; then
5446 # If there is no directory component, then add one.
5448 */* |
*\\*) .
$lib ;;
5452 libfile
="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5453 if test -n "$libdir" && test ! -f "$libfile"; then
5454 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5460 # To insure that "foo" is sourced, and not "foo.exe",
5461 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5462 # which disallows the automatic-append-.exe behavior.
5464 *cygwin
* |
*mingw
*) wrapperdot
=${wrapper}.
;;
5465 *) wrapperdot
=${wrapper} ;;
5467 # If there is no directory component, then add one.
5469 */* |
*\\*) .
${wrapperdot} ;;
5470 *) . .
/${wrapperdot} ;;
5474 if test "$fast_install" = no
&& test -n "$relink_command"; then
5475 if test "$finalize" = yes && test -z "$run"; then
5477 test -n "$TMPDIR" && tmpdir
="$TMPDIR"
5478 tmpdir
="$tmpdir/libtool-$$"
5479 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
5481 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5484 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5485 outputname
="$tmpdir/$file"
5486 # Replace the output file specification.
5487 relink_command
=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5489 $show "$relink_command"
5490 if $run eval "$relink_command"; then :
5492 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5498 $echo "$modename: warning: cannot relink \`$file'" 1>&2
5501 # Install the binary that we compiled earlier.
5502 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5506 # remove .exe since cygwin /usr/bin/install will append another
5508 case $install_prog,$host in
5509 */usr
/bin
/install*,*cygwin
*)
5510 case $file:$destfile in
5515 destfile
=$destfile.exe
5518 destfile
=`echo $destfile | ${SED} -e 's,.exe$,,'`
5523 $show "$install_prog$stripme $file $destfile"
5524 $run eval "$install_prog\$stripme \$file \$destfile" ||
exit $?
5525 test -n "$outputname" && ${rm}r
"$tmpdir"
5530 for file in $staticlibs; do
5531 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5533 # Set up the ranlib parameters.
5534 oldlib
="$destdir/$name"
5536 $show "$install_prog $file $oldlib"
5537 $run eval "$install_prog \$file \$oldlib" ||
exit $?
5539 if test -n "$stripme" && test -n "$striplib"; then
5540 $show "$old_striplib $oldlib"
5541 $run eval "$old_striplib $oldlib" ||
exit $?
5544 # Do each command in the postinstall commands.
5545 eval cmds
=\"$old_postinstall_cmds\"
5546 save_ifs
="$IFS"; IFS
='~'
5547 for cmd
in $cmds; do
5550 $run eval "$cmd" ||
exit $?
5555 if test -n "$future_libdirs"; then
5556 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5559 if test -n "$current_libdirs"; then
5560 # Maybe just do a dry run.
5561 test -n "$run" && current_libdirs
=" -n$current_libdirs"
5562 exec_cmd
='$SHELL $0 --finish$current_libdirs'
5568 # libtool finish mode
5570 modename
="$modename: finish"
5574 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5577 libdirs
="$libdirs $dir"
5580 for libdir
in $libdirs; do
5581 if test -n "$finish_cmds"; then
5582 # Do each command in the finish commands.
5583 eval cmds
=\"$finish_cmds\"
5584 save_ifs
="$IFS"; IFS
='~'
5585 for cmd
in $cmds; do
5588 $run eval "$cmd" || admincmds
="$admincmds
5593 if test -n "$finish_eval"; then
5594 # Do the single finish_eval.
5595 eval cmds
=\"$finish_eval\"
5596 $run eval "$cmds" || admincmds
="$admincmds
5602 # Exit here if they wanted silent mode.
5603 test "$show" = : && exit 0
5605 echo "----------------------------------------------------------------------"
5606 echo "Libraries have been installed in:"
5607 for libdir
in $libdirs; do
5611 echo "If you ever happen to want to link against installed libraries"
5612 echo "in a given directory, LIBDIR, you must either use libtool, and"
5613 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5614 echo "flag during linking and do at least one of the following:"
5615 if test -n "$shlibpath_var"; then
5616 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5617 echo " during execution"
5619 if test -n "$runpath_var"; then
5620 echo " - add LIBDIR to the \`$runpath_var' environment variable"
5621 echo " during linking"
5623 if test -n "$hardcode_libdir_flag_spec"; then
5625 eval flag
=\"$hardcode_libdir_flag_spec\"
5627 echo " - use the \`$flag' linker flag"
5629 if test -n "$admincmds"; then
5630 echo " - have your system administrator run these commands:$admincmds"
5632 if test -f /etc
/ld.so.conf
; then
5633 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5636 echo "See any operating system documentation about shared libraries for"
5637 echo "more information, such as the ld(1) and ld.so(8) manual pages."
5638 echo "----------------------------------------------------------------------"
5642 # libtool execute mode
5644 modename
="$modename: execute"
5646 # The first argument is the command name.
5648 if test -z "$cmd"; then
5649 $echo "$modename: you must specify a COMMAND" 1>&2
5654 # Handle -dlopen flags immediately.
5655 for file in $execute_dlfiles; do
5656 if test ! -f "$file"; then
5657 $echo "$modename: \`$file' is not a file" 1>&2
5665 # Check to see that this really is a libtool archive.
5666 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
5668 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5673 # Read the libtool library.
5677 # If there is no directory component, then add one.
5679 */* |
*\\*) .
$file ;;
5683 # Skip this library if it cannot be dlopened.
5684 if test -z "$dlname"; then
5685 # Warn if it was a shared library.
5686 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
5690 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5691 test "X$dir" = "X$file" && dir
=.
5693 if test -f "$dir/$objdir/$dlname"; then
5696 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5702 # Just add the directory containing the .lo file.
5703 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5704 test "X$dir" = "X$file" && dir
=.
5708 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
5713 # Get the absolute pathname.
5714 absdir
=`cd "$dir" && pwd`
5715 test -n "$absdir" && dir
="$absdir"
5717 # Now add the directory to shlibpath_var.
5718 if eval "test -z \"\$$shlibpath_var\""; then
5719 eval "$shlibpath_var=\"\$dir\""
5721 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
5725 # This variable tells wrapper scripts just to set shlibpath_var
5726 # rather than running their programs.
5727 libtool_execute_magic
="$magic"
5729 # Check if any of the arguments is a wrapper script.
5736 # Do a test to see if this is really a libtool program.
5737 if (${SED} -e '4q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
5738 # If there is no directory component, then add one.
5740 */* |
*\\*) .
$file ;;
5744 # Transform arg to wrapped name.
5745 file="$progdir/$program"
5749 # Quote arguments (to preserve shell metacharacters).
5750 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
5751 args
="$args \"$file\""
5754 if test -z "$run"; then
5755 if test -n "$shlibpath_var"; then
5756 # Export the shlibpath_var.
5757 eval "export $shlibpath_var"
5760 # Restore saved environment variables
5761 if test "${save_LC_ALL+set}" = set; then
5762 LC_ALL
="$save_LC_ALL"; export LC_ALL
5764 if test "${save_LANG+set}" = set; then
5765 LANG
="$save_LANG"; export LANG
5768 # Now prepare to actually exec the command.
5769 exec_cmd
="\$cmd$args"
5771 # Display what would be done.
5772 if test -n "$shlibpath_var"; then
5773 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
5774 $echo "export $shlibpath_var"
5781 # libtool clean and uninstall mode
5783 modename
="$modename: $mode"
5789 # This variable tells wrapper scripts just to set variables rather
5790 # than running their programs.
5791 libtool_install_magic
="$magic"
5796 -f) rm="$rm $arg"; rmforce
=yes ;;
5797 -*) rm="$rm $arg" ;;
5798 *) files
="$files $arg" ;;
5802 if test -z "$rm"; then
5803 $echo "$modename: you must specify an RM program" 1>&2
5810 for file in $files; do
5811 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5812 if test "X$dir" = "X$file"; then
5816 objdir
="$dir/$objdir"
5818 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5819 test "$mode" = uninstall
&& objdir
="$dir"
5821 # Remember objdir for removal later, being careful to avoid duplicates
5822 if test "$mode" = clean
; then
5825 *) rmdirs
="$rmdirs $objdir" ;;
5829 # Don't error if the file doesn't exist and rm -f was used.
5830 if (test -L "$file") >/dev
/null
2>&1 \
5831 ||
(test -h "$file") >/dev
/null
2>&1 \
5832 ||
test -f "$file"; then
5834 elif test -d "$file"; then
5837 elif test "$rmforce" = yes; then
5845 # Possibly a libtool archive, so verify it.
5846 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
5849 # Delete the libtool libraries and symlinks.
5850 for n
in $library_names; do
5851 rmfiles
="$rmfiles $objdir/$n"
5853 test -n "$old_library" && rmfiles
="$rmfiles $objdir/$old_library"
5854 test "$mode" = clean
&& rmfiles
="$rmfiles $objdir/$name $objdir/${name}i"
5856 if test "$mode" = uninstall
; then
5857 if test -n "$library_names"; then
5858 # Do each command in the postuninstall commands.
5859 eval cmds
=\"$postuninstall_cmds\"
5860 save_ifs
="$IFS"; IFS
='~'
5861 for cmd
in $cmds; do
5865 if test "$?" -ne 0 && test "$rmforce" != yes; then
5872 if test -n "$old_library"; then
5873 # Do each command in the old_postuninstall commands.
5874 eval cmds
=\"$old_postuninstall_cmds\"
5875 save_ifs
="$IFS"; IFS
='~'
5876 for cmd
in $cmds; do
5880 if test "$?" -ne 0 && test "$rmforce" != yes; then
5886 # FIXME: should reinstall the best remaining shared library.
5892 # Possibly a libtool object, so verify it.
5893 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
5898 # Add PIC object to the list of files to remove.
5899 if test -n "$pic_object" \
5900 && test "$pic_object" != none
; then
5901 rmfiles
="$rmfiles $dir/$pic_object"
5904 # Add non-PIC object to the list of files to remove.
5905 if test -n "$non_pic_object" \
5906 && test "$non_pic_object" != none
; then
5907 rmfiles
="$rmfiles $dir/$non_pic_object"
5913 if test "$mode" = clean
; then
5917 file=`echo $file|${SED} 's,.exe$,,'`
5918 noexename
=`echo $name|${SED} 's,.exe$,,'`
5919 # $file with .exe has already been added to rmfiles,
5920 # add $file without .exe
5921 rmfiles
="$rmfiles $file"
5924 # Do a test to see if this is a libtool program.
5925 if (${SED} -e '4q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
5929 # note $name still contains .exe if it was in $file originally
5930 # as does the version of $file that was added into $rmfiles
5931 rmfiles
="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
5932 if test "$fast_install" = yes && test -n "$relink_command"; then
5933 rmfiles
="$rmfiles $objdir/lt-$name"
5935 if test "X$noexename" != "X$name" ; then
5936 rmfiles
="$rmfiles $objdir/lt-${noexename}.c"
5942 $show "$rm $rmfiles"
5943 $run $rm $rmfiles || exit_status
=1
5946 # Try to remove the ${objdir}s in the directories where we deleted files
5947 for dir
in $rmdirs; do
5948 if test -d "$dir"; then
5950 $run rmdir $dir >/dev
/null
2>&1
5958 $echo "$modename: you must specify a MODE" 1>&2
5959 $echo "$generic_help" 1>&2
5964 if test -z "$exec_cmd"; then
5965 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5966 $echo "$generic_help" 1>&2
5969 fi # test -z "$show_help"
5971 if test -n "$exec_cmd"; then
5976 # We need to display help for each of the modes.
5979 "Usage: $modename [OPTION]... [MODE-ARG]...
5981 Provide generalized library-building support services.
5983 --config show all configuration variables
5984 --debug enable verbose shell tracing
5985 -n, --dry-run display commands without modifying any files
5986 --features display basic configuration information and exit
5987 --finish same as \`--mode=finish'
5988 --help display this help message and exit
5989 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
5990 --quiet same as \`--silent'
5991 --silent don't print informational messages
5992 --tag=TAG use configuration variables from tag TAG
5993 --version print version information
5995 MODE must be one of the following:
5997 clean remove files from the build directory
5998 compile compile a source file into a libtool object
5999 execute automatically set library path, then run a program
6000 finish complete the installation of libtool libraries
6001 install install libraries or executables
6002 link create a library or an executable
6003 uninstall remove libraries from an installed directory
6005 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6006 a more detailed description of MODE."
6012 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6014 Remove files from the build directory.
6016 RM is the name of the program to use to delete files associated with each FILE
6017 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6020 If FILE is a libtool library, object or program, all the files associated
6021 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6026 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6028 Compile a source file into a libtool library object.
6030 This mode accepts the following additional options:
6032 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6033 -prefer-pic try to building PIC objects only
6034 -prefer-non-pic try to building non-PIC objects only
6035 -static always build a \`.o' file suitable for static linking
6037 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6038 from the given SOURCEFILE.
6040 The output file name is determined by removing the directory component from
6041 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6042 library object suffix, \`.lo'."
6047 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6049 Automatically set library path, then run a program.
6051 This mode accepts the following additional options:
6053 -dlopen FILE add the directory containing FILE to the library path
6055 This mode sets the library path environment variable according to \`-dlopen'
6058 If any of the ARGS are libtool executable wrappers, then they are translated
6059 into their corresponding uninstalled binary, and any of their required library
6060 directories are added to the library path.
6062 Then, COMMAND is executed, with ARGS as arguments."
6067 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6069 Complete the installation of libtool libraries.
6071 Each LIBDIR is a directory that contains libtool libraries.
6073 The commands that this mode executes may require superuser privileges. Use
6074 the \`--dry-run' option if you just want to see what would be executed."
6079 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6081 Install executables or libraries.
6083 INSTALL-COMMAND is the installation command. The first component should be
6084 either the \`install' or \`cp' program.
6086 The rest of the components are interpreted as arguments to that command (only
6087 BSD-compatible install options are recognized)."
6092 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6094 Link object files or libraries together to form another library, or to
6095 create an executable program.
6097 LINK-COMMAND is a command using the C compiler that you would use to create
6098 a program from several object files.
6100 The following components of LINK-COMMAND are treated specially:
6102 -all-static do not do any dynamic linking at all
6103 -avoid-version do not add a version suffix if possible
6104 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6105 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6106 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6107 -export-symbols SYMFILE
6108 try to export only the symbols listed in SYMFILE
6109 -export-symbols-regex REGEX
6110 try to export only the symbols matching REGEX
6111 -LLIBDIR search LIBDIR for required installed libraries
6112 -lNAME OUTPUT-FILE requires the installed library libNAME
6113 -module build a library that can dlopened
6114 -no-fast-install disable the fast-install mode
6115 -no-install link a not-installable executable
6116 -no-undefined declare that a library does not refer to external symbols
6117 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6118 -objectlist FILE Use a list of object files found in FILE to specify objects
6119 -release RELEASE specify package release information
6120 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6121 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6122 -static do not do any dynamic linking of libtool libraries
6123 -version-info CURRENT[:REVISION[:AGE]]
6124 specify library version info [each variable defaults to 0]
6126 All other options (arguments beginning with \`-') are ignored.
6128 Every other argument is treated as a filename. Files ending in \`.la' are
6129 treated as uninstalled libtool libraries, other files are standard or library
6132 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6133 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6134 required, except when creating a convenience library.
6136 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6137 using \`ar' and \`ranlib', or on Windows using \`lib'.
6139 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6140 is created, otherwise an executable program is created."
6145 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6147 Remove libraries from an installation directory.
6149 RM is the name of the program to use to delete files associated with each FILE
6150 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6153 If FILE is a libtool library, all the files associated with it are deleted.
6154 Otherwise, only FILE itself is deleted using RM."
6158 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6165 $echo "Try \`$modename --help' for more information about other modes."
6169 # The TAGs below are defined such that we never get into a situation
6170 # in which we disable both kinds of libraries. Given conflicting
6171 # choices, we go for a static library, that is the most portable,
6172 # since we can't tell whether shared libraries were disabled because
6173 # the user asked for that or because the platform doesn't support
6174 # them. This is particularly important on AIX, because we don't
6175 # support having both static and shared libraries enabled at the same
6176 # time on that platform, so we default to a shared-only configuration.
6177 # If a disable-shared tag is given, we'll fallback to a static-only
6178 # configuration. But we'll never go from static-only to shared-only.
6180 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6181 build_libtool_libs
=no
6183 # ### END LIBTOOL TAG CONFIG: disable-shared
6185 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6186 build_old_libs
=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
6187 # ### END LIBTOOL TAG CONFIG: disable-static