1 # ltmain.sh - Provide generalized library-building support services.
2 # NOTE: Changing this file will not affect anything until you rerun configure.
4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
5 # 2007 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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.
29 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
30 # is ksh but when the shell is invoked as "sh" and the current value of
31 # the _XPG environment variable is not equal to 1 (one), the special
32 # positional parameter $0, within a function call, is the name of the
36 # The name of this program:
37 progname
=`echo "$progpath" | $SED $basename`
47 TIMESTAMP
=" (1.1220.2.455 2007/06/24 02:13:29)"
49 # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
50 if test -n "${ZSH_VERSION+set}" && (emulate sh
) >/dev
/null
2>&1; then
53 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
54 # is contrary to our usage. Disable this feature.
55 alias -g '${1+"$@"}'='"$@"'
58 case `(set -o) 2>/dev/null` in *posix
*) set -o posix
;; esac
60 BIN_SH
=xpg4
; export BIN_SH
# for Tru64
61 DUALCASE
=1; export DUALCASE
# for MKS sh
63 # Check that we have a working $echo.
64 if test "X$1" = X--no-reexec
; then
65 # Discard the --no-reexec flag, and continue.
67 elif test "X$1" = X--fallback-echo
; then
68 # Avoid inline document here, it may be left over
70 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
71 # Yippee, $echo works!
74 # Restart under the correct shell, and then maybe $echo will work.
75 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
78 if test "X$1" = X--fallback-echo
; then
79 # used as fallback echo
88 help="Try \`$progname --help' for more information."
89 magic
="%%%MAGIC variable%%%"
94 # Sed substitution that helps us do robust quoting. It backslashifies
95 # metacharacters that are still active within double-quoted strings.
96 Xsed
="${SED}"' -e 1s/^X//'
97 sed_quote_subst
='s/\([\\`\\"$\\\\]\)/\\\1/g'
98 # test EBCDIC or ASCII
99 case `echo X|tr X '\101'` in
100 A
) # ASCII based system
101 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
103 NL2SP
='tr \015\012 \040\040'
105 *) # EBCDIC based system
107 NL2SP
='tr \r\n \100\100'
112 # Only set LANG and LC_ALL to C if already set.
113 # These must not be set unconditionally because not all systems understand
114 # e.g. LANG=C (notably SCO).
115 # We save the old values to restore during execute mode.
116 for lt_var
in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
118 eval "if test \"\${$lt_var+set}\" = set; then
119 save_$lt_var=\$$lt_var
125 # Make sure IFS has a sensible default
130 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
131 $echo "$modename: not configured to build any kind of library" 1>&2
132 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
147 lo2o
="s/\\.lo\$/.${objext}/"
148 o2lo
="s/\\.${objext}\$/.lo/"
152 #####################################
153 # Shell function definitions:
154 # This seems to be the best place for them
156 # func_mktempdir [string]
157 # Make a temporary directory that won't clash with other running
158 # libtool processes, and avoids race conditions if possible. If
159 # given, STRING is the basename for that directory.
162 my_template
="${TMPDIR-/tmp}/${1-$progname}"
164 if test "$run" = ":"; then
165 # Return a directory name, but don't create it in dry-run mode
166 my_tmpdir
="${my_template}-$$"
169 # If mktemp works, use that first and foremost
170 my_tmpdir
=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
172 if test ! -d "$my_tmpdir"; then
173 # Failing that, at least try and use $RANDOM to avoid a race
174 my_tmpdir
="${my_template}-${RANDOM-0}$$"
176 save_mktempdir_umask
=`umask`
179 umask $save_mktempdir_umask
182 # If we're not in dry-run mode, bomb out on failure
183 test -d "$my_tmpdir" ||
{
184 $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
189 $echo "X$my_tmpdir" |
$Xsed
193 # func_win32_libid arg
194 # return the library type of file 'arg'
196 # Need a lot of goo to handle *both* DLLs and import libs
197 # Has to be a shell function in order to 'eat' the argument
198 # that is supplied when $file_magic_command is called.
201 win32_libid_type
="unknown"
202 win32_fileres
=`file -L $1 2>/dev/null`
203 case $win32_fileres in
204 *ar\ archive\ import\ library
*) # definitely import
205 win32_libid_type
="x86 archive import"
207 *ar\ archive
*) # could be an import, or static
208 if eval $OBJDUMP -f $1 |
$SED -e '10q' 2>/dev
/null | \
209 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev
/null
; then
210 win32_nmres
=`eval $NM -f posix -A $1 | \
219 import
*) win32_libid_type
="x86 archive import";;
220 *) win32_libid_type
="x86 archive static";;
225 win32_libid_type
="x86 DLL"
227 *executable
*) # but shell scripts are "executable" too...
228 case $win32_fileres in
229 *MS\ Windows\ PE\ Intel
*)
230 win32_libid_type
="x86 DLL"
235 $echo $win32_libid_type
240 # Infer tagged configuration to use if any are available and
241 # if one wasn't chosen via the "--tag" command line option.
242 # Only attempt this if the compiler in the base compile
243 # command doesn't match the default compiler.
244 # arg is usually of the form 'gcc ...'
247 # Set the commonly-used compilers for some tags.
248 tag_compilers_CC
="*cc *xlc"
249 tag_compilers_CXX
="*++ *CC"
250 tag_compilers_F77
="*77 *fort"
251 base_compiler
=`set -- "$@"; $echo $1`
252 # If $tagname still isn't set, then try to infer if the default
253 # "CC" tag applies by matching up the base compile command to some
254 # compilers commonly used for the "CC" tag.
255 if test -z "$tagname"; then
257 eval "tag_compilers=\$tag_compilers_${z}"
258 if test -n "$tag_compilers"; then
259 for zp
in $tag_compilers; do
260 case $base_compiler in
262 # The compiler in the base compile command matches
263 # one of the common compilers for the current tag.
264 # Assume this is the tagged configuration we want.
272 if test -n "$available_tags" && test -z "$tagname"; then
276 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
280 CC_quoted
="$CC_quoted $arg"
283 # Blanks in the command may have been stripped by the calling shell,
284 # but not from the CC environment variable when configure was run.
285 " $CC "* |
"$CC "* |
" `$echo $CC` "* |
"`$echo $CC` "* |
" $CC_quoted"* |
"$CC_quoted "* |
" `$echo $CC_quoted` "* |
"`$echo $CC_quoted` "*) ;;
286 # Blanks at the start of $base_compile will cause this to fail
287 # if we don't check for them as well.
289 for z
in $available_tags; do
290 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev
/null
; then
291 # Evaluate the configuration.
292 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
295 # Double-quote args containing other shell metacharacters.
297 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
301 CC_quoted
="$CC_quoted $arg"
304 " $CC "* |
"$CC "* |
" `$echo $CC` "* |
"`$echo $CC` "* |
" $CC_quoted"* |
"$CC_quoted "* |
" `$echo $CC_quoted` "* |
"`$echo $CC_quoted` "*)
305 # The compiler in the base compile command matches
306 # the one in the tagged configuration.
307 # Assume this is the tagged configuration we want.
312 # If $tagname still isn't set, then try to infer it by
313 # matching up the base compile command to some compilers
314 # commonly used for certain tags.
315 base_compiler
=`set -- "$@"; $echo $1`
316 eval "tag_compilers=\$tag_compilers_${z}"
317 if test -n "$tag_compilers"; then
318 for zp
in $tag_compilers; do
319 case $base_compiler in
321 # The compiler in the base compile command matches
322 # one of the common compilers for the current tag.
323 # Assume this is the tagged configuration we want.
329 if test -n "$tagname"; then
335 # If $tagname still isn't set, then no tagged configuration
336 # was found and let the user know that the "--tag" command
337 # line option must be used.
338 if test -z "$tagname"; then
339 $echo "$modename: unable to infer tagged configuration"
340 $echo "$modename: specify a tag with \`--tag'" 1>&2
343 # $echo "$modename: using $tagname tagged configuration"
351 # func_extract_an_archive dir oldlib
352 func_extract_an_archive
()
354 f_ex_an_ar_dir
="$1"; shift
355 f_ex_an_ar_oldlib
="$1"
357 $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
358 $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" ||
exit $?
359 if ($AR t
"$f_ex_an_ar_oldlib" |
sort |
sort -uc >/dev
/null
2>&1); then
362 $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
367 # func_extract_archives gentop oldlib ...
368 func_extract_archives
()
370 my_gentop
="$1"; shift
378 $show "${rm}r $my_gentop"
379 $run ${rm}r
"$my_gentop"
380 $show "$mkdir $my_gentop"
381 $run $mkdir "$my_gentop"
383 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
387 for my_xlib
in $my_oldlibs; do
388 # Extract the objects.
390 [\\/]* |
[A-Za-z
]:[\\/]*) my_xabs
="$my_xlib" ;;
391 *) my_xabs
=`pwd`"/$my_xlib" ;;
393 my_xlib
=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
396 case " $extracted_archives " in
398 extracted_serial
=`expr $extracted_serial + 1`
399 my_xlib_u
=lt
$extracted_serial-$my_xlib ;;
403 extracted_archives
="$extracted_archives $my_xlib_u"
404 my_xdir
="$my_gentop/$my_xlib_u"
406 $show "${rm}r $my_xdir"
407 $run ${rm}r
"$my_xdir"
408 $show "$mkdir $my_xdir"
409 $run $mkdir "$my_xdir"
411 if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
416 $show "Extracting $my_xabs"
417 # Do not bother doing anything if just a dry run
418 if test -z "$run"; then
419 darwin_orig_dir
=`pwd`
420 cd $my_xdir ||
exit $?
421 darwin_archive
=$my_xabs
423 darwin_base_archive
=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
424 darwin_arches
=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
425 if test -n "$darwin_arches"; then
426 darwin_arches
=`echo "$darwin_arches" | $SED -e 's/.*are://'`
428 $show "$darwin_base_archive has multiple architectures $darwin_arches"
429 for darwin_arch
in $darwin_arches ; do
430 mkdir
-p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
431 lipo
-thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
432 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
433 func_extract_an_archive
"`pwd`" "${darwin_base_archive}"
435 $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
436 done # $darwin_arches
437 ## Okay now we have a bunch of thin objects, gotta fatten them up :)
438 darwin_filelist
=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
441 for darwin_file
in $darwin_filelist; do
442 darwin_files
=`find unfat-$$ -name $darwin_file -print | $NL2SP`
443 lipo
-create -output "$darwin_file" $darwin_files
444 done # $darwin_filelist
446 cd "$darwin_orig_dir"
448 cd "$darwin_orig_dir"
449 func_extract_an_archive
"$my_xdir" "$my_xabs"
454 func_extract_an_archive
"$my_xdir" "$my_xabs"
457 my_oldobjs
="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
459 func_extract_archives_result
="$my_oldobjs"
461 # End of Shell function definitions
462 #####################################
465 eval std_shrext
=\"$shrext_cmds\"
469 # Parse our command line options once, thoroughly.
470 while test "$#" -gt 0
476 -*=*) optarg
=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
480 # If the previous option needs an argument, assign it.
481 if test -n "$prev"; then
484 execute_dlfiles
="$execute_dlfiles $arg"
488 preserve_args
="${preserve_args}=$arg"
490 # Check whether tagname contains only valid characters
493 $echo "$progname: invalid tag name: $tagname" 1>&2
500 # Don't test for the "default" C tag, as we know, it's there, but
501 # not specially marked.
504 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev
/null
; then
505 taglist
="$taglist $tagname"
506 # Evaluate the configuration.
507 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
509 $echo "$progname: ignoring unknown tag $tagname" 1>&2
524 # Have we seen a non-optional argument yet?
532 $PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP
534 Copyright (C) 2007 Free Software Foundation, Inc.
535 This is free software; see the source for copying conditions. There is NO
536 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
541 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
542 # Now print the configurations for the tags.
543 for tagname
in $taglist; do
544 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
550 $echo "$progname: enabling shell trace mode"
552 preserve_args
="$preserve_args $arg"
561 if test "$build_libtool_libs" = yes; then
562 $echo "enable shared libraries"
564 $echo "disable shared libraries"
566 if test "$build_old_libs" = yes; then
567 $echo "enable static libraries"
569 $echo "disable static libraries"
574 --finish) mode
="finish" ;;
576 --mode) prevopt
="--mode" prev
=mode
;;
577 --mode=*) mode
="$optarg" ;;
579 --preserve-dup-deps) duplicate_deps
="yes" ;;
583 preserve_args
="$preserve_args $arg"
589 preserve_args
="$preserve_args --tag"
592 set tag
"$optarg" ${1+"$@"}
595 preserve_args
="$preserve_args --tag"
604 $echo "$modename: unrecognized option \`$arg'" 1>&2
616 if test -n "$prevopt"; then
617 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
622 case $disable_libs in
626 build_libtool_libs
=no
630 build_old_libs
=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
634 # If this variable is set in any of the actions, the command in it
635 # will be execed at the end. This prevents here-documents from being
636 # left over by shells.
639 if test -z "$show_help"; then
641 # Infer the operation mode.
642 if test -z "$mode"; then
643 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
644 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
646 *cc | cc
* |
*++ | gcc
* |
*-gcc* | g
++* | xlc
* |
*CC
)
658 *db |
*dbx |
*strace |
*truss
)
668 # If we have no mode, but dlfiles were specified, then do execute mode.
669 test -n "$execute_dlfiles" && mode
=execute
671 # Just use the default operation mode.
672 if test -z "$mode"; then
673 if test -n "$nonopt"; then
674 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
676 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
683 # Only execute mode is allowed to have -dlopen flags.
684 if test -n "$execute_dlfiles" && test "$mode" != execute
; then
685 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
690 # Change the help message to a mode-specific one.
692 help="Try \`$modename --help --mode=$mode' for more information."
694 # These modes are in order of execution frequency so that they run quickly.
696 # libtool compile mode
698 modename
="$modename: compile"
699 # Get the compilation command and the source file.
701 srcfile
="$nonopt" # always keep a non-empty value in "srcfile"
712 # do not "continue". Instead, add this to base_compile
724 # Accept any command-line options.
727 if test -n "$libobj" ; then
728 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
735 -static |
-prefer-pic |
-prefer-non-pic)
746 arg_mode
=arg
# the next one goes into the "base_compile" arg list
747 continue # The current "srcfile" will either be retained or
748 ;; # replaced later. I would guess that would be a bug.
751 args
=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
753 save_ifs
="$IFS"; IFS
=','
757 # Double-quote args containing other shell metacharacters.
758 # Many Bourne shells cannot handle close brackets correctly
759 # in scan sets, so we specify it separately.
761 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
765 lastarg
="$lastarg $arg"
768 lastarg
=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
770 # Add the arguments to base_compile.
771 base_compile
="$base_compile $lastarg"
776 # Accept the current argument as the source file.
777 # The previous "srcfile" becomes the current argument.
784 esac # case $arg_mode
786 # Aesthetically quote the previous argument.
787 lastarg
=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
790 # Double-quote args containing other shell metacharacters.
791 # Many Bourne shells cannot handle close brackets correctly
792 # in scan sets, and some SunOS ksh mistreat backslash-escaping
793 # in scan sets (worked around with variable expansion),
794 # and furthermore cannot handle '|' '&' '(' ')' in scan sets
795 # at all, so we specify them separately.
796 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
797 lastarg
="\"$lastarg\""
801 base_compile
="$base_compile $lastarg"
806 $echo "$modename: you must specify an argument for -Xcompile"
810 $echo "$modename: you must specify a target with \`-o'" 1>&2
814 # Get the name of the library object.
815 [ -z "$libobj" ] && libobj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
819 # Recognize several different file suffixes.
820 # If the user specifies -o file.o, it is replaced with file.lo
830 *.class
) xform
=class
;;
833 *.
[fF
][09]?
) xform
=[fF
][09].
;;
835 *.java
) xform
=java
;;
839 libobj
=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
842 *.lo
) obj
=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
844 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
849 func_infer_tag
$base_compile
851 for arg
in $later; do
870 qlibobj
=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
872 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
873 qlibobj
="\"$qlibobj\"" ;;
875 test "X$libobj" != "X$qlibobj" \
876 && $echo "X$libobj" |
grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
877 && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
878 objname
=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
879 xdir
=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
880 if test "X$xdir" = "X$obj"; then
885 lobj
=${xdir}$objdir/$objname
887 if test -z "$base_compile"; then
888 $echo "$modename: you must specify a compilation command" 1>&2
893 # Delete any leftover library objects.
894 if test "$build_old_libs" = yes; then
895 removelist
="$obj $lobj $libobj ${libobj}T"
897 removelist
="$lobj $libobj ${libobj}T"
901 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
903 # On Cygwin there's no "real" PIC flag so we must build both object types
905 cygwin
* | mingw
* | pw32
* | os2
*)
909 if test "$pic_mode" = no
&& test "$deplibs_check_method" != pass_all
; then
910 # non-PIC code in shared libraries is not supported
914 # Calculate the filename of the output object if compiler does
915 # not support -o with -c
916 if test "$compiler_c_o" = no
; then
917 output_obj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.
${objext}
918 lockfile
="$output_obj.lock"
919 removelist
="$removelist $output_obj $lockfile"
920 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
927 # Lock this critical section if it is needed
928 # We use this script file to make the link, it avoids creating a new file
929 if test "$need_locks" = yes; then
930 until $run ln "$progpath" "$lockfile" 2>/dev
/null
; do
931 $show "Waiting for $lockfile to be removed"
934 elif test "$need_locks" = warn
; then
935 if test -f "$lockfile"; then
937 *** ERROR, $lockfile exists and contains:
938 `cat $lockfile 2>/dev/null`
940 This indicates that another process is trying to use the same
941 temporary object file, and libtool could not work around it because
942 your compiler does not support \`-c' and \`-o' together. If you
943 repeat this compilation, it may succeed, by chance, but you had better
944 avoid parallel builds (make -j) in this platform, or get a better
950 $echo "$srcfile" > "$lockfile"
953 if test -n "$fix_srcfile_path"; then
954 eval srcfile
=\"$fix_srcfile_path\"
956 qsrcfile
=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
958 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
959 qsrcfile
="\"$qsrcfile\"" ;;
962 $run $rm "$libobj" "${libobj}T"
964 # Create a libtool object file (analogous to a ".la" file),
965 # but don't create it if we're doing a dry run.
966 test -z "$run" && cat > ${libobj}T
<<EOF
967 # $libobj - a libtool object file
968 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
970 # Please DO NOT delete this file!
971 # It is necessary for linking the library.
973 # Name of the PIC object.
976 # Only build a PIC object if we are building libtool libraries.
977 if test "$build_libtool_libs" = yes; then
978 # Without this assignment, base_compile gets emptied.
979 fbsd_hideous_sh_bug
=$base_compile
981 if test "$pic_mode" != no
; then
982 command="$base_compile $qsrcfile $pic_flag"
984 # Don't build PIC code
985 command="$base_compile $qsrcfile"
988 if test ! -d "${xdir}$objdir"; then
989 $show "$mkdir ${xdir}$objdir"
990 $run $mkdir ${xdir}$objdir
992 if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
997 if test -z "$output_obj"; then
998 # Place PIC objects in $objdir
999 command="$command -o $lobj"
1002 $run $rm "$lobj" "$output_obj"
1005 if $run eval "$command"; then :
1007 test -n "$output_obj" && $run $rm $removelist
1011 if test "$need_locks" = warn
&&
1012 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1014 *** ERROR, $lockfile contains:
1015 `cat $lockfile 2>/dev/null`
1017 but it should contain:
1020 This indicates that another process is trying to use the same
1021 temporary object file, and libtool could not work around it because
1022 your compiler does not support \`-c' and \`-o' together. If you
1023 repeat this compilation, it may succeed, by chance, but you had better
1024 avoid parallel builds (make -j) in this platform, or get a better
1027 $run $rm $removelist
1031 # Just move the object if needed, then go on to compile the next one
1032 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1033 $show "$mv $output_obj $lobj"
1034 if $run $mv $output_obj $lobj; then :
1037 $run $rm $removelist
1042 # Append the name of the PIC object to the libtool object file.
1043 test -z "$run" && cat >> ${libobj}T
<<EOF
1044 pic_object='$objdir/$objname'
1048 # Allow error messages only from the first compilation.
1049 if test "$suppress_opt" = yes; then
1050 suppress_output
=' >/dev/null 2>&1'
1053 # No PIC object so indicate it doesn't exist in the libtool
1055 test -z "$run" && cat >> ${libobj}T
<<EOF
1061 # Only build a position-dependent object if we build old libraries.
1062 if test "$build_old_libs" = yes; then
1063 if test "$pic_mode" != yes; then
1064 # Don't build PIC code
1065 command="$base_compile $qsrcfile"
1067 command="$base_compile $qsrcfile $pic_flag"
1069 if test "$compiler_c_o" = yes; then
1070 command="$command -o $obj"
1073 # Suppress compiler output if we already did a PIC compilation.
1074 command="$command$suppress_output"
1075 $run $rm "$obj" "$output_obj"
1077 if $run eval "$command"; then :
1079 $run $rm $removelist
1083 if test "$need_locks" = warn
&&
1084 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1086 *** ERROR, $lockfile contains:
1087 `cat $lockfile 2>/dev/null`
1089 but it should contain:
1092 This indicates that another process is trying to use the same
1093 temporary object file, and libtool could not work around it because
1094 your compiler does not support \`-c' and \`-o' together. If you
1095 repeat this compilation, it may succeed, by chance, but you had better
1096 avoid parallel builds (make -j) in this platform, or get a better
1099 $run $rm $removelist
1103 # Just move the object if needed
1104 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1105 $show "$mv $output_obj $obj"
1106 if $run $mv $output_obj $obj; then :
1109 $run $rm $removelist
1114 # Append the name of the non-PIC object the libtool object file.
1115 # Only append if the libtool object file exists.
1116 test -z "$run" && cat >> ${libobj}T
<<EOF
1117 # Name of the non-PIC object.
1118 non_pic_object='$objname'
1122 # Append the name of the non-PIC object the libtool object file.
1123 # Only append if the libtool object file exists.
1124 test -z "$run" && cat >> ${libobj}T
<<EOF
1125 # Name of the non-PIC object.
1131 $run $mv "${libobj}T" "${libobj}"
1133 # Unlock the critical section if it was locked
1134 if test "$need_locks" != no
; then
1135 $run $rm "$lockfile"
1143 modename
="$modename: link"
1145 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1146 # It is impossible to link a dll without this setting, and
1147 # we shouldn't force the makefile maintainer to figure out
1148 # which system we are compiling for in order to pass an extra
1149 # flag for every libtool invocation.
1150 # allow_undefined=no
1152 # FIXME: Unfortunately, there are problems with the above when trying
1153 # to make a dll which has undefined symbols, in which case not
1154 # even a static library is built. For now, we need to specify
1155 # -no-undefined on the libtool link line when we can be certain
1156 # that all symbols are satisfied, otherwise we get a static library.
1163 libtool_args
="$nonopt"
1164 base_compile
="$nonopt $@"
1165 compile_command
="$nonopt"
1166 finalize_command
="$nonopt"
1179 lib_search_path
=`pwd`
1188 export_symbols_regex
=
1196 notinst_path
= # paths that contain not-installed libtool libraries
1197 precious_files_regex
=
1198 prefer_static_libs
=no
1211 func_infer_tag
$base_compile
1213 # We need to know -static, to get the right output filenames.
1217 -all-static |
-static |
-static-libtool-libs)
1220 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1221 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1223 if test -n "$link_static_flag"; then
1224 dlopen_self
=$dlopen_self_static
1226 prefer_static_libs
=yes
1229 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1230 dlopen_self
=$dlopen_self_static
1232 prefer_static_libs
=built
1234 -static-libtool-libs)
1235 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1236 dlopen_self
=$dlopen_self_static
1238 prefer_static_libs
=yes
1241 build_libtool_libs
=no
1248 # See if our shared archives depend on static archives.
1249 test -n "$old_archive_from_new_cmds" && build_old_libs
=yes
1251 # Go through the arguments, transforming them on the way.
1252 while test "$#" -gt 0; do
1256 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1257 qarg
=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1261 libtool_args
="$libtool_args $qarg"
1263 # If the previous option needs an argument, assign it.
1264 if test -n "$prev"; then
1267 compile_command
="$compile_command @OUTPUT@"
1268 finalize_command
="$finalize_command @OUTPUT@"
1274 if test "$preload" = no
; then
1275 # Add the symbol object into the linking commands.
1276 compile_command
="$compile_command @SYMFILE@"
1277 finalize_command
="$finalize_command @SYMFILE@"
1281 *.la |
*.lo
) ;; # We handle these cases below.
1283 if test "$dlself" = no
; then
1291 if test "$prev" = dlprefiles
; then
1293 elif test "$prev" = dlfiles
&& test "$dlopen_self" != yes; then
1303 if test "$prev" = dlfiles
; then
1304 dlfiles
="$dlfiles $arg"
1306 dlprefiles
="$dlprefiles $arg"
1314 export_symbols
="$arg"
1315 if test ! -f "$arg"; then
1316 $echo "$modename: symbol file \`$arg' does not exist"
1323 export_symbols_regex
="$arg"
1328 inst_prefix_dir
="$arg"
1333 precious_files_regex
="$arg"
1343 if test -f "$arg"; then
1346 for fil
in `cat $save_arg`
1348 # moreargs="$moreargs $fil"
1350 # A libtool-controlled object.
1352 # Check to see that this really is a libtool object.
1353 if (${SED} -e '2q' $arg |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1358 # If there is no directory component, then add one.
1360 */* |
*\\*) .
$arg ;;
1364 if test -z "$pic_object" || \
1365 test -z "$non_pic_object" ||
1366 test "$pic_object" = none
&& \
1367 test "$non_pic_object" = none
; then
1368 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1372 # Extract subdirectory from the argument.
1373 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1374 if test "X$xdir" = "X$arg"; then
1380 if test "$pic_object" != none
; then
1381 # Prepend the subdirectory the object is found in.
1382 pic_object
="$xdir$pic_object"
1384 if test "$prev" = dlfiles
; then
1385 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1386 dlfiles
="$dlfiles $pic_object"
1390 # If libtool objects are unsupported, then we need to preload.
1395 # CHECK ME: I think I busted this. -Ossama
1396 if test "$prev" = dlprefiles
; then
1397 # Preload the old-style object.
1398 dlprefiles
="$dlprefiles $pic_object"
1403 libobjs
="$libobjs $pic_object"
1408 if test "$non_pic_object" != none
; then
1409 # Prepend the subdirectory the object is found in.
1410 non_pic_object
="$xdir$non_pic_object"
1412 # A standard non-PIC object
1413 non_pic_objects
="$non_pic_objects $non_pic_object"
1414 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1415 arg
="$non_pic_object"
1418 # If the PIC object exists, use it instead.
1419 # $xdir was prepended to $pic_object above.
1420 non_pic_object
="$pic_object"
1421 non_pic_objects
="$non_pic_objects $non_pic_object"
1424 # Only an error if not doing a dry-run.
1425 if test -z "$run"; then
1426 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1431 # Extract subdirectory from the argument.
1432 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1433 if test "X$xdir" = "X$arg"; then
1439 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1440 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1441 libobjs
="$libobjs $pic_object"
1442 non_pic_objects
="$non_pic_objects $non_pic_object"
1447 $echo "$modename: link input file \`$save_arg' does not exist"
1455 # We need an absolute path.
1457 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1459 $echo "$modename: only absolute run-paths are allowed" 1>&2
1463 # Canonicalise the pathname
1465 while test "$arg" != "$tmp"
1468 arg
=`$echo "X$arg" | $Xsed -e 's%[^/.][^/.]*/\.\.%%g' -e 's%/\./%/%g' -e 's%//*%/%g' -e 's%/$%%g'`
1470 if test "$prev" = rpath
; then
1473 *) rpath
="$rpath $arg" ;;
1478 *) xrpath
="$xrpath $arg" ;;
1485 compiler_flags
="$compiler_flags $qarg"
1487 compile_command
="$compile_command $qarg"
1488 finalize_command
="$finalize_command $qarg"
1492 linker_flags
="$linker_flags $qarg"
1493 compiler_flags
="$compiler_flags $wl$qarg"
1495 compile_command
="$compile_command $wl$qarg"
1496 finalize_command
="$finalize_command $wl$qarg"
1500 linker_flags
="$linker_flags $qarg"
1501 compiler_flags
="$compiler_flags $qarg"
1503 compile_command
="$compile_command $qarg"
1504 finalize_command
="$finalize_command $qarg"
1512 darwin_framework|darwin_framework_skip
)
1513 test "$prev" = "darwin_framework" && compiler_flags
="$compiler_flags $arg"
1514 compile_command
="$compile_command $arg"
1515 finalize_command
="$finalize_command $arg"
1520 eval "$prev=\"\$arg\""
1525 fi # test -n "$prev"
1531 if test -n "$link_static_flag"; then
1532 compile_command
="$compile_command $link_static_flag"
1533 finalize_command
="$finalize_command $link_static_flag"
1539 # FIXME: remove this flag sometime in the future.
1540 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1564 -export-symbols |
-export-symbols-regex)
1565 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
1566 $echo "$modename: more than one -exported-symbols argument is not allowed"
1569 if test "X$arg" = "X-export-symbols"; then
1577 -framework|
-arch|
-isysroot)
1579 *" ${arg} ${1} "* | *" ${arg} ${1} "*)
1580 prev
=darwin_framework_skip
;;
1581 *) compiler_flags
="$compiler_flags $arg"
1582 prev
=darwin_framework
;;
1584 compile_command
="$compile_command $arg"
1585 finalize_command
="$finalize_command $arg"
1594 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1595 # so, if we see these flags be careful not to treat them like -L
1597 case $with_gcc/$host in
1598 no
/*-*-irix* |
/*-*-irix*)
1599 compile_command
="$compile_command $arg"
1600 finalize_command
="$finalize_command $arg"
1607 dir
=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1608 # We need an absolute path.
1610 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1612 absdir
=`cd "$dir" && pwd`
1613 if test -z "$absdir"; then
1614 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1616 notinst_path
="$notinst_path $dir"
1624 deplibs
="$deplibs -L$dir"
1625 lib_search_path
="$lib_search_path $dir"
1629 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1630 testbindir
=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
1631 case :$dllsearchpath: in
1633 *) dllsearchpath
="$dllsearchpath:$dir";;
1635 case :$dllsearchpath: in
1636 *":$testbindir:"*) ;;
1637 *) dllsearchpath
="$dllsearchpath:$testbindir";;
1645 if test "X$arg" = "X-lc" ||
test "X$arg" = "X-lm"; then
1647 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-beos*)
1648 # These systems don't actually have a C or math library (as such)
1652 # These systems don't actually have a C library (as such)
1653 test "X$arg" = "X-lc" && continue
1655 *-*-openbsd* |
*-*-freebsd* |
*-*-dragonfly*)
1656 # Do not include libc due to us having libc/libc_r.
1657 test "X$arg" = "X-lc" && continue
1659 *-*-rhapsody* |
*-*-darwin1.
[012])
1660 # Rhapsody C and math libraries are in the System framework
1661 deplibs
="$deplibs -framework System"
1664 *-*-sco3.2v5
* |
*-*-sco5v6*)
1665 # Causes problems with __ctype
1666 test "X$arg" = "X-lc" && continue
1668 *-*-sysv4.2uw2
* |
*-*-sysv5* |
*-*-unixware* |
*-*-OpenUNIX*)
1669 # Compiler inserts libc in the correct place for threads to work
1670 test "X$arg" = "X-lc" && continue
1673 elif test "X$arg" = "X-lc_r"; then
1675 *-*-openbsd* |
*-*-freebsd* |
*-*-dragonfly*)
1676 # Do not include libc_r directly, use -pthread flag.
1681 deplibs
="$deplibs $arg"
1685 # Tru64 UNIX uses -model [arg] to determine the layout of C++
1686 # classes, name mangling, and exception handling.
1688 compile_command
="$compile_command $arg"
1689 compiler_flags
="$compiler_flags $arg"
1690 finalize_command
="$finalize_command $arg"
1695 -mt|
-mthreads|
-kthread|
-Kthread|
-pthread|
-pthreads|
--thread-safe|
-threads)
1696 compiler_flags
="$compiler_flags $arg"
1697 compile_command
="$compile_command $arg"
1698 finalize_command
="$finalize_command $arg"
1700 *-*-dragonfly*:-pthread)
1701 # pkgsrc hack to use -pthread in .la file for final linking
1702 deplibs
="$deplibs $arg"
1713 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
1714 # -r[0-9][0-9]* specifies the processor on the SGI compiler
1715 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
1716 # +DA*, +DD* enable 64-bit mode on the HP compiler
1717 # -q* pass through compiler args for the IBM compiler
1718 # -m* pass through architecture-specific compiler args for GCC
1719 # -m*, -t[45]*, -txscale* pass through architecture-specific
1720 # compiler args for GCC
1721 # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
1722 # -F/path gives path to uninstalled frameworks, gcc on darwin
1723 # @file GCC response files
1724 -64|
-mips[0-9]|
-r[0-9][0-9]*|
-xarch=*|
-xtarget=*|
+DA
*|
+DD
*|
-q*|
-m*| \
1725 -t[45]*|
-txscale*|
-p|
-pg|
--coverage|
-fprofile-*|
-F*|@
*)
1727 # Unknown arguments in both finalize_command and compile_command need
1728 # to be aesthetically quoted because they are evaled later.
1729 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1731 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1735 compile_command
="$compile_command $arg"
1736 finalize_command
="$finalize_command $arg"
1737 compiler_flags
="$compiler_flags $arg"
1753 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2* |
*-*-darwin*)
1754 # The PATH hackery in wrapper scripts is required on Windows
1755 # and Darwin in order for the loader to find any dlls it needs.
1756 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1757 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1760 *) no_install
=yes ;;
1777 -precious-files-regex)
1798 dir
=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1799 # We need an absolute path.
1801 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1803 $echo "$modename: only absolute run-paths are allowed" 1>&2
1809 *) xrpath
="$xrpath $dir" ;;
1814 -static |
-static-libtool-libs)
1815 # The effects of -static are defined in a previous loop.
1816 # We used to do the same as -all-static on platforms that
1817 # didn't have a PIC flag, but the assumption that the effects
1818 # would be equivalent was wrong. It would break on at least
1819 # Digital Unix and AIX.
1839 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1841 save_ifs
="$IFS"; IFS
=','
1842 for flag
in $args; do
1845 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1850 compiler_flags
="$compiler_flags $flag"
1853 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1857 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1859 save_ifs
="$IFS"; IFS
=','
1860 for flag
in $args; do
1863 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1868 compiler_flags
="$compiler_flags $wl$flag"
1869 linker_flags
="$linker_flags $flag"
1872 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1890 # Some other compiler flag.
1892 # Unknown arguments in both finalize_command and compile_command need
1893 # to be aesthetically quoted because they are evaled later.
1894 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1896 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1903 # A standard object.
1908 # A libtool-controlled object.
1910 # Check to see that this really is a libtool object.
1911 if (${SED} -e '2q' $arg |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1916 # If there is no directory component, then add one.
1918 */* |
*\\*) .
$arg ;;
1922 if test -z "$pic_object" || \
1923 test -z "$non_pic_object" ||
1924 test "$pic_object" = none
&& \
1925 test "$non_pic_object" = none
; then
1926 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1930 # Extract subdirectory from the argument.
1931 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1932 if test "X$xdir" = "X$arg"; then
1938 if test "$pic_object" != none
; then
1939 # Prepend the subdirectory the object is found in.
1940 pic_object
="$xdir$pic_object"
1942 if test "$prev" = dlfiles
; then
1943 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1944 dlfiles
="$dlfiles $pic_object"
1948 # If libtool objects are unsupported, then we need to preload.
1953 # CHECK ME: I think I busted this. -Ossama
1954 if test "$prev" = dlprefiles
; then
1955 # Preload the old-style object.
1956 dlprefiles
="$dlprefiles $pic_object"
1961 libobjs
="$libobjs $pic_object"
1966 if test "$non_pic_object" != none
; then
1967 # Prepend the subdirectory the object is found in.
1968 non_pic_object
="$xdir$non_pic_object"
1970 # A standard non-PIC object
1971 non_pic_objects
="$non_pic_objects $non_pic_object"
1972 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1973 arg
="$non_pic_object"
1976 # If the PIC object exists, use it instead.
1977 # $xdir was prepended to $pic_object above.
1978 non_pic_object
="$pic_object"
1979 non_pic_objects
="$non_pic_objects $non_pic_object"
1982 # Only an error if not doing a dry-run.
1983 if test -z "$run"; then
1984 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1989 # Extract subdirectory from the argument.
1990 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1991 if test "X$xdir" = "X$arg"; then
1997 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1998 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1999 libobjs
="$libobjs $pic_object"
2000 non_pic_objects
="$non_pic_objects $non_pic_object"
2007 deplibs
="$deplibs $arg"
2008 old_deplibs
="$old_deplibs $arg"
2013 # A libtool-controlled library.
2015 if test "$prev" = dlfiles
; then
2016 # This library was specified with -dlopen.
2017 dlfiles
="$dlfiles $arg"
2019 elif test "$prev" = dlprefiles
; then
2020 # The library was specified with -dlpreopen.
2021 dlprefiles
="$dlprefiles $arg"
2024 deplibs
="$deplibs $arg"
2029 # Some other compiler argument.
2031 # Unknown arguments in both finalize_command and compile_command need
2032 # to be aesthetically quoted because they are evaled later.
2033 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2035 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2042 # Now actually substitute the argument into the commands.
2043 if test -n "$arg"; then
2044 compile_command
="$compile_command $arg"
2045 finalize_command
="$finalize_command $arg"
2047 done # argument parsing loop
2049 if test -n "$prev"; then
2050 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
2055 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
2056 eval arg
=\"$export_dynamic_flag_spec\"
2057 compile_command
="$compile_command $arg"
2058 finalize_command
="$finalize_command $arg"
2062 # calculate the name of the file, without its directory
2063 outputname
=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
2064 libobjs_save
="$libobjs"
2066 if test -n "$shlibpath_var"; then
2067 # get the directories listed in $shlibpath_var
2068 eval shlib_search_path
=\
`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
2072 eval sys_lib_search_path
=\"$sys_lib_search_path_spec\"
2073 eval sys_lib_dlsearch_path
=\"$sys_lib_dlsearch_path_spec\"
2075 output_objdir
=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2076 if test "X$output_objdir" = "X$output"; then
2077 output_objdir
="$objdir"
2079 output_objdir
="$output_objdir/$objdir"
2081 # Create the object directory.
2082 if test ! -d "$output_objdir"; then
2083 $show "$mkdir $output_objdir"
2084 $run $mkdir $output_objdir
2086 if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
2091 # Determine the type of output
2094 $echo "$modename: you must specify an output file" 1>&2
2098 *.
$libext) linkmode
=oldlib
;;
2099 *.lo |
*.
$objext) linkmode
=obj
;;
2100 *.la
) linkmode
=lib
;;
2101 *) linkmode
=prog
;; # Anything else should be a program.
2105 *cygwin
* |
*mingw
* |
*pw32
*)
2106 # don't eliminate duplications in $postdeps and $predeps
2107 duplicate_compiler_generated_deps
=yes
2110 duplicate_compiler_generated_deps
=$duplicate_deps
2116 # Find all interdependent deplibs by searching for libraries
2117 # that are linked more than once (e.g. -la -lb -la)
2118 for deplib
in $deplibs; do
2119 if test "X$duplicate_deps" = "Xyes" ; then
2121 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2124 libs
="$libs $deplib"
2127 if test "$linkmode" = lib
; then
2128 libs
="$predeps $libs $compiler_lib_search_path $postdeps"
2130 # Compute libraries that are listed more than once in $predeps
2131 # $postdeps and mark them as special (i.e., whose duplicates are
2132 # not to be eliminated).
2134 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
2135 for pre_post_dep
in $predeps $postdeps; do
2136 case "$pre_post_deps " in
2137 *" $pre_post_dep "*) specialdeplibs
="$specialdeplibs $pre_post_deps" ;;
2139 pre_post_deps
="$pre_post_deps $pre_post_dep"
2148 need_relink
=no
# whether we're linking any uninstalled libtool libraries
2149 notinst_deplibs
= # not-installed libtool libraries
2153 for file in $dlfiles $dlprefiles; do
2157 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2169 passes
="conv scan dlopen dlpreopen link"
2174 for pass
in $passes; do
2175 if test "$linkmode,$pass" = "lib,link" ||
2176 test "$linkmode,$pass" = "prog,scan"; then
2180 if test "$linkmode" = prog
; then
2182 dlopen
) libs
="$dlfiles" ;;
2183 dlpreopen
) libs
="$dlprefiles" ;;
2184 link
) libs
="$deplibs %DEPLIBS% $dependency_libs" ;;
2187 if test "$pass" = dlopen
; then
2188 # Collect dlpreopened libraries
2189 save_deplibs
="$deplibs"
2192 for deplib
in $libs; do
2196 -mt|
-mthreads|
-kthread|
-Kthread|
-pthread|
-pthreads|
--thread-safe|
-threads)
2197 if test "$linkmode,$pass" = "prog,link"; then
2198 compile_deplibs
="$deplib $compile_deplibs"
2199 finalize_deplibs
="$deplib $finalize_deplibs"
2201 compiler_flags
="$compiler_flags $deplib"
2203 case $host:$deplib in
2204 *-*-dragonfly*:-pthread)
2205 # pkgsrc hack to use -pthread in .la file for final linking
2208 deplibs
="$deplib $deplibs"
2209 test "$pass" = conv
&& continue
2210 newdependency_libs
="$deplib $newdependency_libs"
2213 if test "$pass" = conv
; then
2214 deplibs
="$deplib $deplibs"
2217 if test "$pass" = scan
; then
2218 deplibs
="$deplib $deplibs"
2220 compile_deplibs
="$deplib $compile_deplibs"
2221 finalize_deplibs
="$deplib $finalize_deplibs"
2230 if test "$linkmode" != lib
&& test "$linkmode" != prog
; then
2231 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2234 name
=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2235 for searchdir
in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2236 for search_ext
in .la
$std_shrext .so .a
; do
2237 # Search the libtool library
2238 lib
="$searchdir/lib${name}${search_ext}"
2239 if test -f "$lib"; then
2240 if test "$search_ext" = ".la"; then
2249 if test "$found" != yes; then
2250 # deplib doesn't seem to be a libtool library
2251 if test "$linkmode,$pass" = "prog,link"; then
2252 compile_deplibs
="$deplib $compile_deplibs"
2253 finalize_deplibs
="$deplib $finalize_deplibs"
2255 deplibs
="$deplib $deplibs"
2256 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
2259 else # deplib is a libtool library
2260 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2261 # We need to do some special things here, and not later.
2262 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2263 case " $predeps $postdeps " in
2265 if (${SED} -e '2q' $lib |
2266 grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
2270 */* |
*\\*) .
$lib ;;
2273 for l
in $old_library $library_names; do
2276 if test "X$ll" = "X$old_library" ; then # only static version available
2278 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2279 test "X$ladir" = "X$lib" && ladir
="."
2280 lib
=$ladir/$old_library
2281 if test "$linkmode,$pass" = "prog,link"; then
2282 compile_deplibs
="$deplib $compile_deplibs"
2283 finalize_deplibs
="$deplib $finalize_deplibs"
2285 deplibs
="$deplib $deplibs"
2286 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
2300 deplibs
="$deplib $deplibs"
2301 test "$pass" = conv
&& continue
2302 newdependency_libs
="$deplib $newdependency_libs"
2303 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2306 if test "$pass" = conv
; then
2307 deplibs
="$deplib $deplibs"
2310 if test "$pass" = scan
; then
2311 deplibs
="$deplib $deplibs"
2313 compile_deplibs
="$deplib $compile_deplibs"
2314 finalize_deplibs
="$deplib $finalize_deplibs"
2316 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2319 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2325 if test "$pass" = link
; then
2326 dir
=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2327 # Make sure the xrpath contains only unique directories.
2330 *) xrpath
="$xrpath $dir" ;;
2333 deplibs
="$deplib $deplibs"
2336 *.la
) lib
="$deplib" ;;
2338 if test "$pass" = conv
; then
2339 deplibs
="$deplib $deplibs"
2345 case $deplibs_check_method in
2347 set dummy
$deplibs_check_method
2348 match_pattern_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2349 if eval $echo \"$deplib\" 2>/dev
/null \
2351 |
$EGREP "$match_pattern_regex" > /dev
/null
; then
2359 if test "$valid_a_lib" != yes; then
2361 $echo "*** Warning: Trying to link with static lib archive $deplib."
2362 $echo "*** I have the capability to make that library automatically link in when"
2363 $echo "*** you link to this library. But I can only do this if you have a"
2364 $echo "*** shared version of the library, which you do not appear to have"
2365 $echo "*** because the file extensions .$libext of this argument makes me believe"
2366 $echo "*** that it is just a static archive that I should not used here."
2369 $echo "*** Warning: Linking the shared library $output against the"
2370 $echo "*** static library $deplib is not portable!"
2371 deplibs
="$deplib $deplibs"
2376 if test "$pass" != link
; then
2377 deplibs
="$deplib $deplibs"
2379 compile_deplibs
="$deplib $compile_deplibs"
2380 finalize_deplibs
="$deplib $finalize_deplibs"
2387 if test "$pass" = conv
; then
2388 deplibs
="$deplib $deplibs"
2389 elif test "$linkmode" = prog
; then
2390 if test "$pass" = dlpreopen ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
2391 # If there is no dlopen support or we're linking statically,
2392 # we need to preload.
2393 newdlprefiles
="$newdlprefiles $deplib"
2394 compile_deplibs
="$deplib $compile_deplibs"
2395 finalize_deplibs
="$deplib $finalize_deplibs"
2397 newdlfiles
="$newdlfiles $deplib"
2407 if test "$found" = yes ||
test -f "$lib"; then :
2409 $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
2413 # Check to see that this really is a libtool archive.
2414 if (${SED} -e '2q' $lib |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
2416 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2420 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2421 test "X$ladir" = "X$lib" && ladir
="."
2429 # If the library was installed with an old release of libtool,
2430 # it will not redefine variables installed, or shouldnotlink
2438 */* |
*\\*) .
$lib ;;
2442 if test "$linkmode,$pass" = "lib,link" ||
2443 test "$linkmode,$pass" = "prog,scan" ||
2444 { test "$linkmode" != prog
&& test "$linkmode" != lib
; }; then
2445 test -n "$dlopen" && dlfiles
="$dlfiles $dlopen"
2446 test -n "$dlpreopen" && dlprefiles
="$dlprefiles $dlpreopen"
2449 if test "$pass" = conv
; then
2450 # Only check for convenience libraries
2451 deplibs
="$lib $deplibs"
2452 if test -z "$libdir"; then
2453 if test -z "$old_library"; then
2454 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2457 # It is a libtool convenience library, so add in its objects.
2458 convenience
="$convenience $ladir/$objdir/$old_library"
2459 old_convenience
="$old_convenience $ladir/$objdir/$old_library"
2461 for deplib
in $dependency_libs; do
2462 deplibs
="$deplib $deplibs"
2463 if test "X$duplicate_deps" = "Xyes" ; then
2464 case "$tmp_libs " in
2465 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2468 tmp_libs
="$tmp_libs $deplib"
2470 elif test "$linkmode" != prog
&& test "$linkmode" != lib
; then
2471 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2478 # Get the name of the library we link against.
2480 for l
in $old_library $library_names; do
2483 if test -z "$linklib"; then
2484 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2488 # This library was specified with -dlopen.
2489 if test "$pass" = dlopen
; then
2490 if test -z "$libdir"; then
2491 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2494 if test -z "$dlname" ||
2495 test "$dlopen_support" != yes ||
2496 test "$build_libtool_libs" = no
; then
2497 # If there is no dlname, no dlopen support or we're linking
2498 # statically, we need to preload. We also need to preload any
2499 # dependent libraries so libltdl's deplib preloader doesn't
2500 # bomb out in the load deplibs phase.
2501 dlprefiles
="$dlprefiles $lib $dependency_libs"
2503 newdlfiles
="$newdlfiles $lib"
2508 # We need an absolute path.
2510 [\\/]* |
[A-Za-z
]:[\\/]*) abs_ladir
="$ladir" ;;
2512 abs_ladir
=`cd "$ladir" && pwd`
2513 if test -z "$abs_ladir"; then
2514 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2515 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2520 laname
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2522 # Find the relevant object directory and library name.
2523 if test "X$installed" = Xyes
; then
2524 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2525 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2533 test "X$hardcode_automatic" = Xyes
&& avoidtemprpath
=yes
2535 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2538 # Remove this search path later
2539 notinst_path
="$notinst_path $abs_ladir"
2541 dir
="$ladir/$objdir"
2542 absdir
="$abs_ladir/$objdir"
2543 # Remove this search path later
2544 notinst_path
="$notinst_path $abs_ladir"
2546 fi # $installed = yes
2547 name
=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2549 # This library was specified with -dlpreopen.
2550 if test "$pass" = dlpreopen
; then
2551 if test -z "$libdir"; then
2552 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2555 # Prefer using a static library (so that no silly _DYNAMIC symbols
2556 # are required to link).
2557 if test -n "$old_library"; then
2558 newdlprefiles
="$newdlprefiles $dir/$old_library"
2559 # Otherwise, use the dlname, so that lt_dlopen finds it.
2560 elif test -n "$dlname"; then
2561 newdlprefiles
="$newdlprefiles $dir/$dlname"
2563 newdlprefiles
="$newdlprefiles $dir/$linklib"
2565 fi # $pass = dlpreopen
2567 if test -z "$libdir"; then
2568 # Link the convenience library
2569 if test "$linkmode" = lib
; then
2570 deplibs
="$dir/$old_library $deplibs"
2571 elif test "$linkmode,$pass" = "prog,link"; then
2572 compile_deplibs
="$dir/$old_library $compile_deplibs"
2573 finalize_deplibs
="$dir/$old_library $finalize_deplibs"
2575 deplibs
="$lib $deplibs" # used for prog,scan pass
2581 if test "$linkmode" = prog
&& test "$pass" != link
; then
2582 newlib_search_path
="$newlib_search_path $ladir"
2583 deplibs
="$lib $deplibs"
2586 if test "$link_all_deplibs" != no ||
test -z "$library_names" ||
2587 test "$build_libtool_libs" = no
; then
2592 for deplib
in $dependency_libs; do
2594 -L*) newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2596 # Need to link against all dependency_libs?
2597 if test "$linkalldeplibs" = yes; then
2598 deplibs
="$deplib $deplibs"
2600 # Need to hardcode shared library paths
2601 # or/and link against static libraries
2602 newdependency_libs
="$deplib $newdependency_libs"
2604 if test "X$duplicate_deps" = "Xyes" ; then
2605 case "$tmp_libs " in
2606 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2609 tmp_libs
="$tmp_libs $deplib"
2612 fi # $linkmode = prog...
2614 if test "$linkmode,$pass" = "prog,link"; then
2615 if test -n "$library_names" &&
2616 { { test "$prefer_static_libs" = no ||
2617 test "$prefer_static_libs,$installed" = "built,yes"; } ||
2618 test -z "$old_library"; }; then
2619 # We need to hardcode the library path
2620 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2621 # Make sure the rpath contains only unique directories.
2622 case "$temp_rpath " in
2625 *) temp_rpath
="$temp_rpath $absdir" ;;
2629 # Hardcode the library path.
2630 # Skip directories that are in the system default run-time
2632 case " $sys_lib_dlsearch_path " in
2635 case "$compile_rpath " in
2637 *) compile_rpath
="$compile_rpath $absdir"
2641 case " $sys_lib_dlsearch_path " in
2644 case "$finalize_rpath " in
2646 *) finalize_rpath
="$finalize_rpath $libdir"
2650 fi # $linkmode,$pass = prog,link...
2652 if test "$alldeplibs" = yes &&
2653 { test "$deplibs_check_method" = pass_all ||
2654 { test "$build_libtool_libs" = yes &&
2655 test -n "$library_names"; }; }; then
2656 # We only need to search for static libraries
2661 link_static
=no
# Whether the deplib will be linked statically
2662 use_static_libs
=$prefer_static_libs
2663 if test "$use_static_libs" = built
&& test "$installed" = yes ; then
2666 if test -n "$library_names" &&
2667 { test "$use_static_libs" = no ||
test -z "$old_library"; }; then
2668 if test "$installed" = no
; then
2669 notinst_deplibs
="$notinst_deplibs $lib"
2672 # This is a shared library
2674 # Warn about portability, can't link against -module's on
2675 # some systems (darwin)
2676 if test "$shouldnotlink" = yes && test "$pass" = link
; then
2678 if test "$linkmode" = prog
; then
2679 $echo "*** Warning: Linking the executable $output against the loadable module"
2681 $echo "*** Warning: Linking the shared library $output against the loadable module"
2683 $echo "*** $linklib is not portable!"
2685 if test "$linkmode" = lib
&&
2686 test "$hardcode_into_libs" = yes; then
2687 # Hardcode the library path.
2688 # Skip directories that are in the system default run-time
2690 case " $sys_lib_dlsearch_path " in
2693 case "$compile_rpath " in
2695 *) compile_rpath
="$compile_rpath $absdir"
2699 case " $sys_lib_dlsearch_path " in
2702 case "$finalize_rpath " in
2704 *) finalize_rpath
="$finalize_rpath $libdir"
2710 if test -n "$old_archive_from_expsyms_cmds"; then
2711 # figure out the soname
2712 set dummy
$library_names
2715 libname
=`eval \\$echo \"$libname_spec\"`
2716 # use dlname if we got it. it's perfectly good, no?
2717 if test -n "$dlname"; then
2719 elif test -n "$soname_spec"; then
2723 major
=`expr $current - $age`
2727 eval soname
=\"$soname_spec\"
2732 # Make a new name for the extract_expsyms_cmds to use
2734 soname
=`$echo $soroot | ${SED} -e 's/^.*\///'`
2735 newlib
="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2737 # If the library has no export list, then create one now
2738 if test -f "$output_objdir/$soname-def"; then :
2740 $show "extracting exported symbol list from \`$soname'"
2741 save_ifs
="$IFS"; IFS
='~'
2742 cmds
=$extract_expsyms_cmds
2743 for cmd
in $cmds; do
2747 $run eval "$cmd" ||
exit $?
2753 if test -f "$output_objdir/$newlib"; then :; else
2754 $show "generating import library for \`$soname'"
2755 save_ifs
="$IFS"; IFS
='~'
2756 cmds
=$old_archive_from_expsyms_cmds
2757 for cmd
in $cmds; do
2761 $run eval "$cmd" ||
exit $?
2765 # make sure the library variables are pointing to the new library
2768 fi # test -n "$old_archive_from_expsyms_cmds"
2770 if test "$linkmode" = prog ||
test "$mode" != relink
; then
2775 case $hardcode_action in
2776 immediate | unsupported
)
2777 if test "$hardcode_direct" = no
; then
2780 *-*-sco3.2v5.0.
[024]*) add_dir
="-L$dir" ;;
2781 *-*-sysv4*uw2
*) add_dir
="-L$dir" ;;
2782 *-*-sysv5OpenUNIX* |
*-*-sysv5UnixWare7.
[01].
[10]* | \
2783 *-*-unixware7*) add_dir
="-L$dir" ;;
2785 # if the lib is a module then we can not link against
2786 # it, someone is ignoring the new warnings I added
2787 if /usr
/bin
/file -L $add 2> /dev
/null |
2788 $EGREP ": [^:]* bundle" >/dev
/null
; then
2789 $echo "** Warning, lib $linklib is a module, not a shared library"
2790 if test -z "$old_library" ; then
2792 $echo "** And there doesn't seem to be a static archive available"
2793 $echo "** The link will probably fail, sorry"
2795 add
="$dir/$old_library"
2799 elif test "$hardcode_minus_L" = no
; then
2801 *-*-sunos*) add_shlibpath
="$dir" ;;
2805 elif test "$hardcode_shlibpath_var" = no
; then
2806 add_shlibpath
="$dir"
2813 if test "$hardcode_direct" = yes; then
2815 elif test "$hardcode_minus_L" = yes; then
2817 # Try looking first in the location we're being installed to.
2818 if test -n "$inst_prefix_dir"; then
2821 add_dir
="$add_dir -L$inst_prefix_dir$libdir"
2826 elif test "$hardcode_shlibpath_var" = yes; then
2827 add_shlibpath
="$dir"
2836 if test "$lib_linked" != yes; then
2837 $echo "$modename: configuration error: unsupported hardcode properties"
2841 if test -n "$add_shlibpath"; then
2842 case :$compile_shlibpath: in
2843 *":$add_shlibpath:"*) ;;
2844 *) compile_shlibpath
="$compile_shlibpath$add_shlibpath:" ;;
2847 if test "$linkmode" = prog
; then
2848 test -n "$add_dir" && compile_deplibs
="$add_dir $compile_deplibs"
2849 test -n "$add" && compile_deplibs
="$add $compile_deplibs"
2851 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2852 test -n "$add" && deplibs
="$add $deplibs"
2853 if test "$hardcode_direct" != yes && \
2854 test "$hardcode_minus_L" != yes && \
2855 test "$hardcode_shlibpath_var" = yes; then
2856 case :$finalize_shlibpath: in
2858 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2864 if test "$linkmode" = prog ||
test "$mode" = relink
; then
2868 # Finalize command for both is simple: just hardcode it.
2869 if test "$hardcode_direct" = yes; then
2870 add
="$libdir/$linklib"
2871 elif test "$hardcode_minus_L" = yes; then
2874 elif test "$hardcode_shlibpath_var" = yes; then
2875 case :$finalize_shlibpath: in
2877 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2880 elif test "$hardcode_automatic" = yes; then
2881 if test -n "$inst_prefix_dir" &&
2882 test -f "$inst_prefix_dir$libdir/$linklib" ; then
2883 add
="$inst_prefix_dir$libdir/$linklib"
2885 add
="$libdir/$linklib"
2888 # We cannot seem to hardcode it, guess we'll fake it.
2890 # Try looking first in the location we're being installed to.
2891 if test -n "$inst_prefix_dir"; then
2894 add_dir
="$add_dir -L$inst_prefix_dir$libdir"
2901 if test "$linkmode" = prog
; then
2902 test -n "$add_dir" && finalize_deplibs
="$add_dir $finalize_deplibs"
2903 test -n "$add" && finalize_deplibs
="$add $finalize_deplibs"
2905 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2906 test -n "$add" && deplibs
="$add $deplibs"
2909 elif test "$linkmode" = prog
; then
2910 # Here we assume that one of hardcode_direct or hardcode_minus_L
2911 # is not unsupported. This is valid on all known static and
2913 if test "$hardcode_direct" != unsupported
; then
2914 test -n "$old_library" && linklib
="$old_library"
2915 compile_deplibs
="$dir/$linklib $compile_deplibs"
2916 finalize_deplibs
="$dir/$linklib $finalize_deplibs"
2918 compile_deplibs
="-l$name -L$dir $compile_deplibs"
2919 finalize_deplibs
="-l$name -L$dir $finalize_deplibs"
2921 elif test "$build_libtool_libs" = yes; then
2922 # Not a shared library
2923 if test "$deplibs_check_method" != pass_all
; then
2924 # We're trying link a shared library against a static one
2925 # but the system doesn't support it.
2927 # Just print a warning and add the library to dependency_libs so
2928 # that the program can be linked against the static library.
2930 $echo "*** Warning: This system can not link to static lib archive $lib."
2931 $echo "*** I have the capability to make that library automatically link in when"
2932 $echo "*** you link to this library. But I can only do this if you have a"
2933 $echo "*** shared version of the library, which you do not appear to have."
2934 if test "$module" = yes; then
2935 $echo "*** But as you try to build a module library, libtool will still create "
2936 $echo "*** a static module, that should work as long as the dlopening application"
2937 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2938 if test -z "$global_symbol_pipe"; then
2940 $echo "*** However, this would only work if libtool was able to extract symbol"
2941 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2942 $echo "*** not find such a program. So, this module is probably useless."
2943 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2945 if test "$build_old_libs" = no
; then
2946 build_libtool_libs
=module
2949 build_libtool_libs
=no
2953 deplibs
="$dir/$old_library $deplibs"
2956 fi # link shared/static library?
2958 if test "$linkmode" = lib
; then
2959 if test -n "$dependency_libs" &&
2960 { test "$hardcode_into_libs" != yes ||
2961 test "$build_old_libs" = yes ||
2962 test "$link_static" = yes; }; then
2963 # Extract -R from dependency_libs
2965 for libdir
in $dependency_libs; do
2967 -R*) temp_xrpath
=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2969 *" $temp_xrpath "*) ;;
2970 *) xrpath
="$xrpath $temp_xrpath";;
2972 *) temp_deplibs
="$temp_deplibs $libdir";;
2975 dependency_libs
="$temp_deplibs"
2978 newlib_search_path
="$newlib_search_path $absdir"
2979 # Link against this library
2980 test "$link_static" = no
&& newdependency_libs
="$abs_ladir/$laname $newdependency_libs"
2981 # ... and its dependency_libs
2983 for deplib
in $dependency_libs; do
2984 newdependency_libs
="$deplib $newdependency_libs"
2985 if test "X$duplicate_deps" = "Xyes" ; then
2986 case "$tmp_libs " in
2987 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2990 tmp_libs
="$tmp_libs $deplib"
2993 if test "$link_all_deplibs" != no
; then
2994 # Add the search paths of all dependency libraries
2995 for deplib
in $dependency_libs; do
2997 -L*) path
="$deplib" ;;
2999 dir
=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
3000 test "X$dir" = "X$deplib" && dir
="."
3001 # We need an absolute path.
3003 [\\/]* |
[A-Za-z
]:[\\/]*) absdir
="$dir" ;;
3005 absdir
=`cd "$dir" && pwd`
3006 if test -z "$absdir"; then
3007 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
3012 if grep "^installed=no" $deplib > /dev
/null
; then
3013 path
="$absdir/$objdir"
3015 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3016 if test -z "$libdir"; then
3017 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3020 if test "$absdir" != "$libdir"; then
3021 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
3028 # we do not want to link against static libs,
3029 # but need to link against shared
3030 eval deplibrary_names
=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
3031 if test -n "$deplibrary_names" ; then
3032 for tmp
in $deplibrary_names ; do
3035 if test -f "$path/$depdepl" ; then
3036 depdepl
="$path/$depdepl"
3038 # do not add paths which are already there
3039 case " $newlib_search_path " in
3041 *) newlib_search_path
="$newlib_search_path $path";;
3054 # Again, we only want to link against shared libraries
3055 eval tmp_libs
=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
3056 for tmp
in $newlib_search_path ; do
3057 if test -f "$tmp/lib$tmp_libs.dylib" ; then
3058 eval depdepl
="$tmp/lib$tmp_libs.dylib"
3069 case " $deplibs " in
3071 *) deplibs
="$path $deplibs" ;;
3073 case " $deplibs " in
3075 *) deplibs
="$depdepl $deplibs" ;;
3078 fi # link_all_deplibs != no
3080 done # for deplib in $libs
3081 dependency_libs
="$newdependency_libs"
3082 if test "$pass" = dlpreopen
; then
3083 # Link the dlpreopened libraries before other libraries
3084 for deplib
in $save_deplibs; do
3085 deplibs
="$deplib $deplibs"
3088 if test "$pass" != dlopen
; then
3089 if test "$pass" != conv
; then
3090 # Make sure lib_search_path contains only unique directories.
3092 for dir
in $newlib_search_path; do
3093 case "$lib_search_path " in
3095 *) lib_search_path
="$lib_search_path $dir" ;;
3101 if test "$linkmode,$pass" != "prog,link"; then
3104 vars
="compile_deplibs finalize_deplibs"
3106 for var
in $vars dependency_libs
; do
3107 # Add libraries to $var in reverse order
3108 eval tmp_libs
=\"\$
$var\"
3110 for deplib
in $tmp_libs; do
3111 # FIXME: Pedantically, this is the right thing to do, so
3112 # that some nasty dependency loop isn't accidentally
3114 #new_libs="$deplib $new_libs"
3115 # Pragmatically, this seems to cause very few problems in
3118 -L*) new_libs
="$deplib $new_libs" ;;
3121 # And here is the reason: when a library appears more
3122 # than once as an explicit dependence of a library, or
3123 # is implicitly linked in more than once by the
3124 # compiler, it is considered special, and multiple
3125 # occurrences thereof are not removed. Compare this
3126 # with having the same library being listed as a
3127 # dependency of multiple other libraries: in this case,
3128 # we know (pedantically, we assume) the library does not
3129 # need to be listed more than once, so we keep only the
3130 # last copy. This is not always right, but it is rare
3131 # enough that we require users that really mean to play
3132 # such unportable linking tricks to link the library
3133 # using -Wl,-lname, so that libtool does not consider it
3134 # for duplicate removal.
3135 case " $specialdeplibs " in
3136 *" $deplib "*) new_libs
="$deplib $new_libs" ;;
3138 case " $new_libs " in
3140 *) new_libs
="$deplib $new_libs" ;;
3148 for deplib
in $new_libs; do
3151 case " $tmp_libs " in
3153 *) tmp_libs
="$tmp_libs $deplib" ;;
3156 *) tmp_libs
="$tmp_libs $deplib" ;;
3159 eval $var=\"$tmp_libs\"
3162 # Last step: remove runtime libs from dependency_libs
3163 # (they stay in deplibs)
3165 for i
in $dependency_libs ; do
3166 case " $predeps $postdeps $compiler_lib_search_path " in
3171 if test -n "$i" ; then
3172 tmp_libs
="$tmp_libs $i"
3175 dependency_libs
=$tmp_libs
3177 if test "$linkmode" = prog
; then
3178 dlfiles
="$newdlfiles"
3179 dlprefiles
="$newdlprefiles"
3184 if test -n "$deplibs"; then
3185 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
3188 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
3189 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3192 if test -n "$rpath"; then
3193 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3196 if test -n "$xrpath"; then
3197 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3200 if test -n "$vinfo"; then
3201 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3204 if test -n "$release"; then
3205 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3208 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
3209 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3212 # Now set the variables for building old libraries.
3213 build_libtool_libs
=no
3215 objs
="$objs$old_deplibs"
3219 # Make sure we only generate libraries of the form `libNAME.la'.
3222 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3223 eval shared_ext
=\"$shrext_cmds\"
3224 eval libname
=\"$libname_spec\"
3227 if test "$module" = no
; then
3228 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3232 if test "$need_lib_prefix" != no
; then
3233 # Add the "lib" prefix for modules if required
3234 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3235 eval shared_ext
=\"$shrext_cmds\"
3236 eval libname
=\"$libname_spec\"
3238 libname
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3243 if test -n "$objs"; then
3244 if test "$deplibs_check_method" != pass_all
; then
3245 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3249 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3250 $echo "*** objects $objs is not portable!"
3251 libobjs
="$libobjs $objs"
3255 if test "$dlself" != no
; then
3256 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3260 if test "$#" -gt 2; then
3261 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3266 if test -z "$rpath"; then
3267 if test "$build_libtool_libs" = yes; then
3268 # Building a libtool convenience library.
3269 # Some compilers have problems with a `.al' extension so
3270 # convenience libraries should have the same extension an
3271 # archive normally would.
3272 oldlibs
="$output_objdir/$libname.$libext $oldlibs"
3273 build_libtool_libs
=convenience
3277 if test -n "$vinfo"; then
3278 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3281 if test -n "$release"; then
3282 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3286 # Parse the version information argument.
3287 save_ifs
="$IFS"; IFS
=':'
3288 set dummy
$vinfo 0 0 0
3291 if test -n "$8"; then
3292 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3297 # convert absolute version numbers to libtool ages
3298 # this retains compatibility with .la files and attempts
3299 # to make the code below a bit more comprehensible
3301 case $vinfo_number in
3305 number_revision
="$4"
3307 # There are really only two kinds -- those that
3308 # use the current revision as the major version
3309 # and those that subtract age and use age as
3310 # a minor version. But, then there is irix
3311 # which has an extra 1 added just for fun
3313 case $version_type in
3314 darwin|linux|osf|windows|none
)
3315 current
=`expr $number_major + $number_minor`
3317 revision
="$number_revision"
3319 freebsd-aout|freebsd-elf|sunos
)
3320 current
="$number_major"
3321 revision
="$number_minor"
3325 current
=`expr $number_major + $number_minor`
3327 revision
="$number_minor"
3328 lt_irix_increment
=no
3339 # Check that each of the things are valid numbers.
3341 0|
[1-9]|
[1-9][0-9]|
[1-9][0-9][0-9]|
[1-9][0-9][0-9][0-9]|
[1-9][0-9][0-9][0-9][0-9]) ;;
3343 $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3344 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3350 0|
[1-9]|
[1-9][0-9]|
[1-9][0-9][0-9]|
[1-9][0-9][0-9][0-9]|
[1-9][0-9][0-9][0-9][0-9]) ;;
3352 $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3353 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3359 0|
[1-9]|
[1-9][0-9]|
[1-9][0-9][0-9]|
[1-9][0-9][0-9][0-9]|
[1-9][0-9][0-9][0-9][0-9]) ;;
3361 $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3362 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3367 if test "$age" -gt "$current"; then
3368 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3369 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3373 # Calculate the version variables.
3378 case $version_type in
3382 # Like Linux, but with the current version available in
3383 # verstring for coding it into the library header
3384 major
=.
`expr $current - $age`
3385 versuffix
="$major.$age.$revision"
3386 # Darwin ld doesn't like 0 for these options...
3387 minor_current
=`expr $current + 1`
3388 xlcverstring
="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3389 verstring
="-compatibility_version $minor_current -current_version $minor_current.$revision"
3394 versuffix
=".$current.$revision";
3399 versuffix
=".$current";
3403 if test "X$lt_irix_increment" = "Xno"; then
3404 major
=`expr $current - $age`
3406 major
=`expr $current - $age + 1`
3408 case $version_type in
3409 nonstopux
) verstring_prefix
=nonstopux
;;
3410 *) verstring_prefix
=sgi
;;
3412 verstring
="$verstring_prefix$major.$revision"
3414 # Add in all the interfaces that we are compatible with.
3416 while test "$loop" -ne 0; do
3417 iface
=`expr $revision - $loop`
3418 loop
=`expr $loop - 1`
3419 verstring
="$verstring_prefix$major.$iface:$verstring"
3422 # Before this point, $major must not contain `.'.
3424 versuffix
="$major.$revision"
3428 major
=.
`expr $current - $age`
3429 versuffix
="$major.$age.$revision"
3430 versuffix2
="$major.$age"
3434 major
=.
`expr $current - $age`
3435 versuffix
=".$current.$age.$revision"
3436 verstring
="$current.$age.$revision"
3438 # Add in all the interfaces that we are compatible with.
3440 while test "$loop" -ne 0; do
3441 iface
=`expr $current - $loop`
3442 loop
=`expr $loop - 1`
3443 verstring
="$verstring:${iface}.0"
3446 # Make executables depend on our current version.
3447 verstring
="$verstring:${current}.0"
3452 versuffix
=".$current.$revision"
3456 # Use '-' rather than '.', since we only want one
3457 # extension on DOS 8.3 filesystems.
3458 major
=`expr $current - $age`
3463 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3464 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3469 # Clear the version info if we defaulted, and they specified a release.
3470 if test -z "$vinfo" && test -n "$release"; then
3472 case $version_type in
3474 # we can't check for "0.0" in archive_cmds due to quoting
3475 # problems, so we reset it completely
3482 if test "$need_version" = no
; then
3489 # Remove version info from name if versioning should be avoided
3490 if test "$avoid_version" = yes && test "$need_version" = no
; then
3497 # Check to see if the archive will have undefined symbols.
3498 if test "$allow_undefined" = yes; then
3499 if test "$allow_undefined_flag" = unsupported
; then
3500 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3501 build_libtool_libs
=no
3505 # Don't allow undefined symbols.
3506 allow_undefined_flag
="$no_undefined_flag"
3510 if test "$mode" != relink
; then
3511 # Remove our outputs, but don't remove object files since they
3512 # may have been created when compiling PIC objects.
3514 tempremovelist
=`$echo "$output_objdir/*"`
3515 for p
in $tempremovelist; do
3519 $output_objdir/$outputname |
$output_objdir/$libname.
* |
$output_objdir/${libname}${release}.
*)
3520 if test "X$precious_files_regex" != "X"; then
3521 if echo $p |
$EGREP -e "$precious_files_regex" >/dev
/null
2>&1
3526 removelist
="$removelist $p"
3531 if test -n "$removelist"; then
3532 $show "${rm}r $removelist"
3533 $run ${rm}r
$removelist
3537 # Now set the variables for building old libraries.
3538 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience
; then
3539 oldlibs
="$oldlibs $output_objdir/$libname.$libext"
3541 # Transform .lo files to .o files.
3542 oldobjs
="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3545 # Eliminate all temporary directories.
3546 #for path in $notinst_path; do
3547 # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
3548 # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
3549 # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
3552 if test -n "$xrpath"; then
3553 # If the user specified any rpath flags, then add them.
3555 for libdir
in $xrpath; do
3556 temp_xrpath
="$temp_xrpath -R$libdir"
3557 case "$finalize_rpath " in
3559 *) finalize_rpath
="$finalize_rpath $libdir" ;;
3562 if test "$hardcode_into_libs" != yes ||
test "$build_old_libs" = yes; then
3563 dependency_libs
="$temp_xrpath $dependency_libs"
3567 # Make sure dlfiles contains only unique files that won't be dlpreopened
3568 old_dlfiles
="$dlfiles"
3570 for lib
in $old_dlfiles; do
3571 case " $dlprefiles $dlfiles " in
3573 *) dlfiles
="$dlfiles $lib" ;;
3577 # Make sure dlprefiles contains only unique files
3578 old_dlprefiles
="$dlprefiles"
3580 for lib
in $old_dlprefiles; do
3581 case "$dlprefiles " in
3583 *) dlprefiles
="$dlprefiles $lib" ;;
3587 if test "$build_libtool_libs" = yes; then
3588 if test -n "$rpath"; then
3590 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2* |
*-*-beos*)
3591 # these systems don't actually have a c library (as such)!
3593 *-*-rhapsody* |
*-*-darwin1.
[012])
3594 # Rhapsody C library is in the System framework
3595 deplibs
="$deplibs -framework System"
3598 # Don't link with libc until the a.out ld.so is fixed.
3600 *-*-openbsd* |
*-*-freebsd* |
*-*-dragonfly*)
3601 # Do not include libc due to us having libc/libc_r.
3603 *-*-sco3.2v5
* |
*-*-sco5v6*)
3604 # Causes problems with __ctype
3606 *-*-sysv4.2uw2
* |
*-*-sysv5* |
*-*-unixware* |
*-*-OpenUNIX*)
3607 # Compiler inserts libc in the correct place for threads to work
3610 # Add libc to deplibs on all other systems if necessary.
3611 if test "$build_libtool_need_lc" = "yes"; then
3612 deplibs
="$deplibs -lc"
3618 # Transform deplibs into only deplibs that can be linked in shared.
3620 libname_save
=$libname
3621 release_save
=$release
3622 versuffix_save
=$versuffix
3624 # I'm not sure if I'm treating the release correctly. I think
3625 # release should show up in the -l (ie -lgmp5) so we don't want to
3626 # add it in twice. Is that correct?
3632 case $deplibs_check_method in
3634 # Don't check for shared/static. Everything works.
3635 # This might be a little naive. We might want to check
3636 # whether the library exists or not. But this is on
3637 # osf3 & osf4 and I'm not really sure... Just
3638 # implementing what was already the behavior.
3642 # This code stresses the "libraries are programs" paradigm to its
3643 # limits. Maybe even breaks it. We compile a program, linking it
3644 # against the deplibs as a proxy for the library. Then we can check
3645 # whether they linked in statically or dynamically with ldd.
3647 cat > conftest.c
<<EOF
3648 int main() { return 0; }
3651 if $LTCC $LTCFLAGS -o conftest conftest.c
$deplibs; then
3652 ldd_output
=`ldd conftest`
3653 for i
in $deplibs; do
3654 name
=`expr $i : '-l\(.*\)'`
3655 # If $name is empty we are operating on a -L argument.
3656 if test "$name" != "" && test "$name" != "0"; then
3657 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3658 case " $predeps $postdeps " in
3660 newdeplibs
="$newdeplibs $i"
3665 if test -n "$i" ; then
3666 libname
=`eval \\$echo \"$libname_spec\"`
3667 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
3668 set dummy
$deplib_matches
3670 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3671 newdeplibs
="$newdeplibs $i"
3675 $echo "*** Warning: dynamic linker does not accept needed library $i."
3676 $echo "*** I have the capability to make that library automatically link in when"
3677 $echo "*** you link to this library. But I can only do this if you have a"
3678 $echo "*** shared version of the library, which I believe you do not have"
3679 $echo "*** because a test_compile did reveal that the linker did not use it for"
3680 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3684 newdeplibs
="$newdeplibs $i"
3688 # Error occurred in the first compile. Let's try to salvage
3689 # the situation: Compile a separate program for each library.
3690 for i
in $deplibs; do
3691 name
=`expr $i : '-l\(.*\)'`
3692 # If $name is empty we are operating on a -L argument.
3693 if test "$name" != "" && test "$name" != "0"; then
3695 if $LTCC $LTCFLAGS -o conftest conftest.c
$i; then
3696 ldd_output
=`ldd conftest`
3697 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3698 case " $predeps $postdeps " in
3700 newdeplibs
="$newdeplibs $i"
3705 if test -n "$i" ; then
3706 libname
=`eval \\$echo \"$libname_spec\"`
3707 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
3708 set dummy
$deplib_matches
3710 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3711 newdeplibs
="$newdeplibs $i"
3715 $echo "*** Warning: dynamic linker does not accept needed library $i."
3716 $echo "*** I have the capability to make that library automatically link in when"
3717 $echo "*** you link to this library. But I can only do this if you have a"
3718 $echo "*** shared version of the library, which you do not appear to have"
3719 $echo "*** because a test_compile did reveal that the linker did not use this one"
3720 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3726 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3727 $echo "*** make it link in! You will probably need to install it or some"
3728 $echo "*** library that it depends on before this library will be fully"
3729 $echo "*** functional. Installing it before continuing would be even better."
3732 newdeplibs
="$newdeplibs $i"
3738 set dummy
$deplibs_check_method
3739 file_magic_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3740 for a_deplib
in $deplibs; do
3741 name
=`expr $a_deplib : '-l\(.*\)'`
3742 # If $name is empty we are operating on a -L argument.
3743 if test "$name" != "" && test "$name" != "0"; then
3744 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3745 case " $predeps $postdeps " in
3747 newdeplibs
="$newdeplibs $a_deplib"
3752 if test -n "$a_deplib" ; then
3753 libname
=`eval \\$echo \"$libname_spec\"`
3754 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3755 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
3756 for potent_lib
in $potential_libs; do
3757 # Follow soft links.
3758 if ls -lLd "$potent_lib" 2>/dev
/null \
3759 |
grep " -> " >/dev
/null
; then
3762 # The statement above tries to avoid entering an
3763 # endless loop below, in case of cyclic links.
3764 # We might still enter an endless loop, since a link
3765 # loop can be closed while we follow links,
3767 potlib
="$potent_lib"
3768 while test -h "$potlib" 2>/dev
/null
; do
3769 potliblink
=`ls -ld $potlib | ${SED} 's/.* -> //'`
3771 [\\/]* |
[A-Za-z
]:[\\/]*) potlib
="$potliblink";;
3772 *) potlib
=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3775 if eval $file_magic_cmd \"\
$potlib\" 2>/dev
/null \
3777 |
$EGREP "$file_magic_regex" > /dev
/null
; then
3778 newdeplibs
="$newdeplibs $a_deplib"
3785 if test -n "$a_deplib" ; then
3788 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3789 $echo "*** I have the capability to make that library automatically link in when"
3790 $echo "*** you link to this library. But I can only do this if you have a"
3791 $echo "*** shared version of the library, which you do not appear to have"
3792 $echo "*** because I did check the linker path looking for a file starting"
3793 if test -z "$potlib" ; then
3794 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3796 $echo "*** with $libname and none of the candidates passed a file format test"
3797 $echo "*** using a file magic. Last file checked: $potlib"
3801 # Add a -L argument.
3802 newdeplibs
="$newdeplibs $a_deplib"
3804 done # Gone through all deplibs.
3807 set dummy
$deplibs_check_method
3808 match_pattern_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3809 for a_deplib
in $deplibs; do
3810 name
=`expr $a_deplib : '-l\(.*\)'`
3811 # If $name is empty we are operating on a -L argument.
3812 if test -n "$name" && test "$name" != "0"; then
3813 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3814 case " $predeps $postdeps " in
3816 newdeplibs
="$newdeplibs $a_deplib"
3821 if test -n "$a_deplib" ; then
3822 libname
=`eval \\$echo \"$libname_spec\"`
3823 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3824 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
3825 for potent_lib
in $potential_libs; do
3826 potlib
="$potent_lib" # see symlink-check above in file_magic test
3827 if eval $echo \"$potent_lib\" 2>/dev
/null \
3829 |
$EGREP "$match_pattern_regex" > /dev
/null
; then
3830 newdeplibs
="$newdeplibs $a_deplib"
3837 if test -n "$a_deplib" ; then
3840 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3841 $echo "*** I have the capability to make that library automatically link in when"
3842 $echo "*** you link to this library. But I can only do this if you have a"
3843 $echo "*** shared version of the library, which you do not appear to have"
3844 $echo "*** because I did check the linker path looking for a file starting"
3845 if test -z "$potlib" ; then
3846 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3848 $echo "*** with $libname and none of the candidates passed a file format test"
3849 $echo "*** using a regex pattern. Last file checked: $potlib"
3853 # Add a -L argument.
3854 newdeplibs
="$newdeplibs $a_deplib"
3856 done # Gone through all deplibs.
3860 tmp_deplibs
=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3861 -e 's/ -[LR][^ ]*//g'`
3862 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3863 for i
in $predeps $postdeps ; do
3864 # can't use Xsed below, because $i might contain '/'
3865 tmp_deplibs
=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3868 if $echo "X $tmp_deplibs" |
$Xsed -e 's/[ ]//g' \
3869 |
grep .
>/dev
/null
; then
3871 if test "X$deplibs_check_method" = "Xnone"; then
3872 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3874 $echo "*** Warning: inter-library dependencies are not known to be supported."
3876 $echo "*** All declared inter-library dependencies are being dropped."
3881 versuffix
=$versuffix_save
3883 release
=$release_save
3884 libname
=$libname_save
3888 *-*-rhapsody* |
*-*-darwin1.
[012])
3889 # On Rhapsody replace the C library is the System framework
3890 newdeplibs
=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3894 if test "$droppeddeps" = yes; then
3895 if test "$module" = yes; then
3897 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3898 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3899 $echo "*** a static module, that should work as long as the dlopening"
3900 $echo "*** application is linked with the -dlopen flag."
3901 if test -z "$global_symbol_pipe"; then
3903 $echo "*** However, this would only work if libtool was able to extract symbol"
3904 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3905 $echo "*** not find such a program. So, this module is probably useless."
3906 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3908 if test "$build_old_libs" = no
; then
3909 oldlibs
="$output_objdir/$libname.$libext"
3910 build_libtool_libs
=module
3913 build_libtool_libs
=no
3916 $echo "*** The inter-library dependencies that have been dropped here will be"
3917 $echo "*** automatically added whenever a program is linked with this library"
3918 $echo "*** or is declared to -dlopen it."
3920 if test "$allow_undefined" = no
; then
3922 $echo "*** Since this library must not contain undefined symbols,"
3923 $echo "*** because either the platform does not support them or"
3924 $echo "*** it was explicitly requested with -no-undefined,"
3925 $echo "*** libtool will only create a static version of it."
3926 if test "$build_old_libs" = no
; then
3927 oldlibs
="$output_objdir/$libname.$libext"
3928 build_libtool_libs
=module
3931 build_libtool_libs
=no
3936 # Done checking deplibs!
3941 # move library search paths that coincide with paths to not yet
3942 # installed libraries to the beginning of the library search list
3944 for path
in $notinst_path; do
3945 case " $new_libs " in
3946 *" -L$path/$objdir "*) ;;
3948 case " $deplibs " in
3949 *" -L$path/$objdir "*)
3950 new_libs
="$new_libs -L$path/$objdir" ;;
3955 for deplib
in $deplibs; do
3958 case " $new_libs " in
3960 *) new_libs
="$new_libs $deplib" ;;
3963 *) new_libs
="$new_libs $deplib" ;;
3969 # All the library-specific variables (install_libdir is set above).
3974 # Test again, we may have decided not to build it any more
3975 if test "$build_libtool_libs" = yes; then
3976 if test "$hardcode_into_libs" = yes; then
3977 # Hardcode the library paths
3980 rpath
="$finalize_rpath"
3981 test "$mode" != relink
&& rpath
="$compile_rpath$rpath"
3982 for libdir
in $rpath; do
3983 if test -n "$hardcode_libdir_flag_spec"; then
3984 if test -n "$hardcode_libdir_separator"; then
3985 if test -z "$hardcode_libdirs"; then
3986 hardcode_libdirs
="$libdir"
3988 # Just accumulate the unique libdirs.
3989 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3990 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3993 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3998 eval flag
=\"$hardcode_libdir_flag_spec\"
3999 dep_rpath
="$dep_rpath $flag"
4001 elif test -n "$runpath_var"; then
4002 case "$perm_rpath " in
4004 *) perm_rpath
="$perm_rpath $libdir" ;;
4008 # Substitute the hardcoded libdirs into the rpath.
4009 if test -n "$hardcode_libdir_separator" &&
4010 test -n "$hardcode_libdirs"; then
4011 libdir
="$hardcode_libdirs"
4012 if test -n "$hardcode_libdir_flag_spec_ld"; then
4013 case $archive_cmds in
4014 *\
$LD*) eval dep_rpath
=\"$hardcode_libdir_flag_spec_ld\" ;;
4015 *) eval dep_rpath
=\"$hardcode_libdir_flag_spec\" ;;
4018 eval dep_rpath
=\"$hardcode_libdir_flag_spec\"
4021 if test -n "$runpath_var" && test -n "$perm_rpath"; then
4022 # We should set the runpath_var.
4024 for dir
in $perm_rpath; do
4027 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
4029 test -n "$dep_rpath" && deplibs
="$dep_rpath $deplibs"
4032 shlibpath
="$finalize_shlibpath"
4033 test "$mode" != relink
&& shlibpath
="$compile_shlibpath$shlibpath"
4034 if test -n "$shlibpath"; then
4035 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
4038 # Get the real and link names of the library.
4039 eval shared_ext
=\"$shrext_cmds\"
4040 eval library_names
=\"$library_names_spec\"
4041 set dummy
$library_names
4045 if test -n "$soname_spec"; then
4046 eval soname
=\"$soname_spec\"
4050 if test -z "$dlname"; then
4054 lib
="$output_objdir/$realname"
4058 linknames
="$linknames $link"
4061 # Use standard objects if they are pic
4062 test -z "$pic_flag" && libobjs
=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4064 # Prepare the list of exported symbols
4065 if test -z "$export_symbols"; then
4066 if test "$always_export_symbols" = yes ||
test -n "$export_symbols_regex"; then
4067 $show "generating symbol list for \`$libname.la'"
4068 export_symbols
="$output_objdir/$libname.exp"
4069 $run $rm $export_symbols
4070 cmds
=$export_symbols_cmds
4071 save_ifs
="$IFS"; IFS
='~'
4072 for cmd
in $cmds; do
4075 if len
=`expr "X$cmd" : ".*"` &&
4076 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
4078 $run eval "$cmd" ||
exit $?
4079 skipped_export
=false
4081 # The command line is too long to execute in one step.
4082 $show "using reloadable object file for export list..."
4084 # Break out early, otherwise skipped_export may be
4085 # set to false by a later but shorter cmd.
4090 if test -n "$export_symbols_regex"; then
4091 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
4092 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
4093 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
4094 $run eval '$mv "${export_symbols}T" "$export_symbols"'
4099 if test -n "$export_symbols" && test -n "$include_expsyms"; then
4100 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
4104 for test_deplib
in $deplibs; do
4105 case " $convenience " in
4106 *" $test_deplib "*) ;;
4108 tmp_deplibs
="$tmp_deplibs $test_deplib"
4112 deplibs
="$tmp_deplibs"
4114 if test -n "$convenience"; then
4115 if test -n "$whole_archive_flag_spec"; then
4116 save_libobjs
=$libobjs
4117 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
4119 gentop
="$output_objdir/${outputname}x"
4120 generated
="$generated $gentop"
4122 func_extract_archives
$gentop $convenience
4123 libobjs
="$libobjs $func_extract_archives_result"
4127 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
4128 eval flag
=\"$thread_safe_flag_spec\"
4129 linker_flags
="$linker_flags $flag"
4132 # Make a backup of the uninstalled library when relinking
4133 if test "$mode" = relink
; then
4134 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' ||
exit $?
4137 # Do each of the archive commands.
4138 if test "$module" = yes && test -n "$module_cmds" ; then
4139 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4140 eval test_cmds
=\"$module_expsym_cmds\"
4141 cmds
=$module_expsym_cmds
4143 eval test_cmds
=\"$module_cmds\"
4147 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4148 eval test_cmds
=\"$archive_expsym_cmds\"
4149 cmds
=$archive_expsym_cmds
4151 eval test_cmds
=\"$archive_cmds\"
4156 if test "X$skipped_export" != "X:" &&
4157 len
=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4158 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
4161 # The command line is too long to link in one step, link piecewise.
4162 $echo "creating reloadable object files..."
4164 # Save the value of $output and $libobjs because we want to
4165 # use them later. If we have whole_archive_flag_spec, we
4166 # want to use save_libobjs as it was before
4167 # whole_archive_flag_spec was expanded, because we can't
4168 # assume the linker understands whole_archive_flag_spec.
4169 # This may have to be revisited, in case too many
4170 # convenience libraries get linked in and end up exceeding
4172 if test -z "$convenience" ||
test -z "$whole_archive_flag_spec"; then
4173 save_libobjs
=$libobjs
4176 output_la
=`$echo "X$output" | $Xsed -e "$basename"`
4178 # Clear the reloadable object creation command queue and
4179 # initialize k to one.
4186 output
=$output_objdir/$output_la-${k}.
$objext
4187 # Loop over the list of objects to be linked.
4188 for obj
in $save_libobjs
4190 eval test_cmds
=\"$reload_cmds $objlist $last_robj\"
4191 if test "X$objlist" = X ||
4192 { len
=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4193 test "$len" -le "$max_cmd_len"; }; then
4194 objlist
="$objlist $obj"
4196 # The command $test_cmds is almost too long, add a
4197 # command to the queue.
4198 if test "$k" -eq 1 ; then
4199 # The first file doesn't have a previous command to add.
4200 eval concat_cmds
=\"$reload_cmds $objlist $last_robj\"
4202 # All subsequent reloadable object files will link in
4203 # the last one created.
4204 eval concat_cmds
=\"\
$concat_cmds~
$reload_cmds $objlist $last_robj\"
4206 last_robj
=$output_objdir/$output_la-${k}.
$objext
4208 output
=$output_objdir/$output_la-${k}.
$objext
4213 # Handle the remaining objects by creating one last
4214 # reloadable object file. All subsequent reloadable object
4215 # files will link in the last one created.
4216 test -z "$concat_cmds" || concat_cmds
=$concat_cmds~
4217 eval concat_cmds
=\"\
${concat_cmds}$reload_cmds $objlist $last_robj\"
4219 if ${skipped_export-false}; then
4220 $show "generating symbol list for \`$libname.la'"
4221 export_symbols
="$output_objdir/$libname.exp"
4222 $run $rm $export_symbols
4224 # Append the command to create the export file.
4225 eval concat_cmds
=\"\
$concat_cmds~
$export_symbols_cmds\"
4228 # Set up a command to remove the reloadable object files
4229 # after they are used.
4231 while test "$i" -lt "$k"
4234 delfiles
="$delfiles $output_objdir/$output_la-${i}.$objext"
4237 $echo "creating a temporary reloadable object file: $output"
4239 # Loop through the commands generated above and execute them.
4240 save_ifs
="$IFS"; IFS
='~'
4241 for cmd
in $concat_cmds; do
4244 $run eval "$cmd" ||
exit $?
4249 # Restore the value of output.
4252 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4253 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
4255 # Expand the library linking commands again to reset the
4256 # value of $libobjs for piecewise linking.
4258 # Do each of the archive commands.
4259 if test "$module" = yes && test -n "$module_cmds" ; then
4260 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4261 cmds
=$module_expsym_cmds
4266 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4267 cmds
=$archive_expsym_cmds
4273 # Append the command to remove the reloadable object files
4274 # to the just-reset $cmds.
4275 eval cmds
=\"\
$cmds~\
$rm $delfiles\"
4277 save_ifs
="$IFS"; IFS
='~'
4278 for cmd
in $cmds; do
4282 $run eval "$cmd" ||
{
4285 # Restore the uninstalled library and exit
4286 if test "$mode" = relink
; then
4287 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
4295 # Restore the uninstalled library and exit
4296 if test "$mode" = relink
; then
4297 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' ||
exit $?
4299 if test -n "$convenience"; then
4300 if test -z "$whole_archive_flag_spec"; then
4301 $show "${rm}r $gentop"
4302 $run ${rm}r
"$gentop"
4309 # Create links to the real library.
4310 for linkname
in $linknames; do
4311 if test "$realname" != "$linkname"; then
4312 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4313 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' ||
exit $?
4317 # If -module or -export-dynamic was specified, set the dlname.
4318 if test "$module" = yes ||
test "$export_dynamic" = yes; then
4319 # On all known operating systems, these are identical.
4326 if test -n "$deplibs"; then
4327 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4330 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
4331 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4334 if test -n "$rpath"; then
4335 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4338 if test -n "$xrpath"; then
4339 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4342 if test -n "$vinfo"; then
4343 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4346 if test -n "$release"; then
4347 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4352 if test -n "$objs$old_deplibs"; then
4353 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4357 obj
=`$echo "X$output" | $Xsed -e "$lo2o"`
4365 # Delete the old objects.
4366 $run $rm $obj $libobj
4368 # Objects from convenience libraries. This assumes
4369 # single-version convenience libraries. Whenever we create
4370 # different ones for PIC/non-PIC, this we'll have to duplicate
4374 # reload_cmds runs $LD directly, so let us get rid of
4375 # -Wl from whole_archive_flag_spec and hope we can get by with
4376 # turning comma into space..
4379 if test -n "$convenience"; then
4380 if test -n "$whole_archive_flag_spec"; then
4381 eval tmp_whole_archive_flags
=\"$whole_archive_flag_spec\"
4382 reload_conv_objs
=$reload_objs\
`$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
4384 gentop
="$output_objdir/${obj}x"
4385 generated
="$generated $gentop"
4387 func_extract_archives
$gentop $convenience
4388 reload_conv_objs
="$reload_objs $func_extract_archives_result"
4392 # Create the old-style object.
4393 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
4397 save_ifs
="$IFS"; IFS
='~'
4398 for cmd
in $cmds; do
4402 $run eval "$cmd" ||
exit $?
4406 # Exit if we aren't doing a library object file.
4407 if test -z "$libobj"; then
4408 if test -n "$gentop"; then
4409 $show "${rm}r $gentop"
4416 if test "$build_libtool_libs" != yes; then
4417 if test -n "$gentop"; then
4418 $show "${rm}r $gentop"
4422 # Create an invalid libtool object if no PIC, so that we don't
4423 # accidentally link it into a program.
4424 # $show "echo timestamp > $libobj"
4425 # $run eval "echo timestamp > $libobj" || exit $?
4429 if test -n "$pic_flag" ||
test "$pic_mode" != default
; then
4430 # Only do commands if we really have different PIC objects.
4431 reload_objs
="$libobjs $reload_conv_objs"
4434 save_ifs
="$IFS"; IFS
='~'
4435 for cmd
in $cmds; do
4439 $run eval "$cmd" ||
exit $?
4444 if test -n "$gentop"; then
4445 $show "${rm}r $gentop"
4454 *cygwin
*) output
=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4456 if test -n "$vinfo"; then
4457 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4460 if test -n "$release"; then
4461 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4464 if test "$preload" = yes; then
4465 if test "$dlopen_support" = unknown
&& test "$dlopen_self" = unknown
&&
4466 test "$dlopen_self_static" = unknown
; then
4467 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4472 *-*-rhapsody* |
*-*-darwin1.
[012])
4473 # On Rhapsody replace the C library is the System framework
4474 compile_deplibs
=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4475 finalize_deplibs
=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4481 # Don't allow lazy linking, it breaks C++ global constructors
4482 if test "$tagname" = CXX
; then
4483 compile_command
="$compile_command ${wl}-bind_at_load"
4484 finalize_command
="$finalize_command ${wl}-bind_at_load"
4490 # move library search paths that coincide with paths to not yet
4491 # installed libraries to the beginning of the library search list
4493 for path
in $notinst_path; do
4494 case " $new_libs " in
4495 *" -L$path/$objdir "*) ;;
4497 case " $compile_deplibs " in
4498 *" -L$path/$objdir "*)
4499 new_libs
="$new_libs -L$path/$objdir" ;;
4504 for deplib
in $compile_deplibs; do
4507 case " $new_libs " in
4509 *) new_libs
="$new_libs $deplib" ;;
4512 *) new_libs
="$new_libs $deplib" ;;
4515 compile_deplibs
="$new_libs"
4518 compile_command
="$compile_command $compile_deplibs"
4519 finalize_command
="$finalize_command $finalize_deplibs"
4521 if test -n "$rpath$xrpath"; then
4522 # If the user specified any rpath flags, then add them.
4523 for libdir
in $rpath $xrpath; do
4524 # This is the magic to use -rpath.
4525 case "$finalize_rpath " in
4527 *) finalize_rpath
="$finalize_rpath $libdir" ;;
4532 # Now hardcode the library paths
4535 for libdir
in $compile_rpath $finalize_rpath; do
4536 if test -n "$hardcode_libdir_flag_spec"; then
4537 if test -n "$hardcode_libdir_separator"; then
4538 if test -z "$hardcode_libdirs"; then
4539 hardcode_libdirs
="$libdir"
4541 # Just accumulate the unique libdirs.
4542 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4543 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4546 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4551 eval flag
=\"$hardcode_libdir_flag_spec\"
4552 rpath
="$rpath $flag"
4554 elif test -n "$runpath_var"; then
4555 case "$perm_rpath " in
4557 *) perm_rpath
="$perm_rpath $libdir" ;;
4561 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
4562 testbindir
=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
4563 case :$dllsearchpath: in
4565 *) dllsearchpath
="$dllsearchpath:$libdir";;
4567 case :$dllsearchpath: in
4568 *":$testbindir:"*) ;;
4569 *) dllsearchpath
="$dllsearchpath:$testbindir";;
4574 # Substitute the hardcoded libdirs into the rpath.
4575 if test -n "$hardcode_libdir_separator" &&
4576 test -n "$hardcode_libdirs"; then
4577 libdir
="$hardcode_libdirs"
4578 eval rpath
=\" $hardcode_libdir_flag_spec\"
4580 compile_rpath
="$rpath"
4584 for libdir
in $finalize_rpath; do
4585 if test -n "$hardcode_libdir_flag_spec"; then
4586 if test -n "$hardcode_libdir_separator"; then
4587 if test -z "$hardcode_libdirs"; then
4588 hardcode_libdirs
="$libdir"
4590 # Just accumulate the unique libdirs.
4591 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4592 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4595 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4600 eval flag
=\"$hardcode_libdir_flag_spec\"
4601 rpath
="$rpath $flag"
4603 elif test -n "$runpath_var"; then
4604 case "$finalize_perm_rpath " in
4606 *) finalize_perm_rpath
="$finalize_perm_rpath $libdir" ;;
4610 # Substitute the hardcoded libdirs into the rpath.
4611 if test -n "$hardcode_libdir_separator" &&
4612 test -n "$hardcode_libdirs"; then
4613 libdir
="$hardcode_libdirs"
4614 eval rpath
=\" $hardcode_libdir_flag_spec\"
4616 finalize_rpath
="$rpath"
4618 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4619 # Transform all the library objects into standard objects.
4620 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4621 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4625 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
4626 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4627 dlsyms
="${outputname}S.c"
4629 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4633 if test -n "$dlsyms"; then
4637 # Discover the nlist of each of the dlfiles.
4638 nlist
="$output_objdir/${outputname}.nm"
4640 $show "$rm $nlist ${nlist}S ${nlist}T"
4641 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4643 # Parse the name list into a source file.
4644 $show "creating $output_objdir/$dlsyms"
4646 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4647 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4648 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4654 /* Prevent the only kind of declaration conflicts we can make. */
4655 #define lt_preloaded_symbols some_other_symbol
4657 /* External symbol declarations for the compiler. */\
4660 if test "$dlself" = yes; then
4661 $show "generating symbol list for \`$output'"
4663 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4665 # Add our own program objects to the symbol list.
4666 progfiles
=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4667 for arg
in $progfiles; do
4668 $show "extracting global C symbols from \`$arg'"
4669 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4672 if test -n "$exclude_expsyms"; then
4673 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4674 $run eval '$mv "$nlist"T "$nlist"'
4677 if test -n "$export_symbols_regex"; then
4678 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4679 $run eval '$mv "$nlist"T "$nlist"'
4682 # Prepare the list of exported symbols
4683 if test -z "$export_symbols"; then
4684 export_symbols
="$output_objdir/$outputname.exp"
4685 $run $rm $export_symbols
4686 $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4688 *cygwin
* |
*mingw
* )
4689 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4690 $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
4694 $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4695 $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4696 $run eval 'mv "$nlist"T "$nlist"'
4698 *cygwin
* |
*mingw
* )
4699 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4700 $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
4706 for arg
in $dlprefiles; do
4707 $show "extracting global C symbols from \`$arg'"
4708 name
=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4709 $run eval '$echo ": $name " >> "$nlist"'
4710 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4713 if test -z "$run"; then
4714 # Make sure we have at least an empty file.
4715 test -f "$nlist" ||
: > "$nlist"
4717 if test -n "$exclude_expsyms"; then
4718 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4719 $mv "$nlist"T
"$nlist"
4722 # Try sorting and uniquifying the output.
4723 if grep -v "^: " < "$nlist" |
4724 if sort -k 3 </dev
/null
>/dev
/null
2>&1; then
4729 uniq > "$nlist"S
; then
4732 grep -v "^: " < "$nlist" > "$nlist"S
4735 if test -f "$nlist"S
; then
4736 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4738 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4741 $echo >> "$output_objdir/$dlsyms" "\
4743 #undef lt_preloaded_symbols
4745 #if defined (__STDC__) && __STDC__
4746 # define lt_ptr void *
4748 # define lt_ptr char *
4752 /* The mapping between symbol names and symbols. */
4756 *cygwin
* |
*mingw
* )
4757 $echo >> "$output_objdir/$dlsyms" "\
4758 /* DATA imports from DLLs on WIN32 can't be const, because
4759 runtime relocations are performed -- see ld's documentation
4765 $echo >> "$output_objdir/$dlsyms" "\
4772 $echo >> "$output_objdir/$dlsyms" "\
4776 lt_preloaded_symbols[] =
4780 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4782 $echo >> "$output_objdir/$dlsyms" "\
4786 /* This works around a problem in FreeBSD linker */
4787 #ifdef FREEBSD_WORKAROUND
4788 static const void *lt_preloaded_setup() {
4789 return lt_preloaded_symbols;
4799 pic_flag_for_symtable
=
4801 # compiling the symbol table file with pic_flag works around
4802 # a FreeBSD bug that causes programs to crash when -lm is
4803 # linked before any other PIC object. But we must not use
4804 # pic_flag when linking with -static. The problem exists in
4805 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4806 *-*-freebsd2*|
*-*-freebsd3.0
*|
*-*-freebsdelf3.0
*)
4807 case "$compile_command " in
4809 *) pic_flag_for_symtable
=" $pic_flag -DFREEBSD_WORKAROUND";;
4812 case "$compile_command " in
4814 *) pic_flag_for_symtable
=" $pic_flag";;
4818 # Now compile the dynamic symbol file.
4819 $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4820 $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' ||
exit $?
4822 # Clean up the generated files.
4823 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4824 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4826 # Transform the symbol file into the correct name.
4828 *cygwin
* |
*mingw
* )
4829 if test -f "$output_objdir/${outputname}.def" ; then
4830 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
4831 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
4833 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4834 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4838 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4839 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4844 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4849 # We keep going just in case the user didn't refer to
4850 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4851 # really was required.
4853 # Nullify the symbol file.
4854 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
4855 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
4858 if test "$need_relink" = no ||
test "$build_libtool_libs" != yes; then
4859 # Replace the output file specification.
4860 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
4861 link_command
="$compile_command$compile_rpath"
4863 # We have no uninstalled library dependencies, so finalize right now.
4864 $show "$link_command"
4865 $run eval "$link_command"
4868 # Delete the generated files.
4869 if test -n "$dlsyms"; then
4870 $show "$rm $output_objdir/${outputname}S.${objext}"
4871 $run $rm "$output_objdir/${outputname}S.${objext}"
4877 if test -n "$shlibpath_var"; then
4878 # We should set the shlibpath_var
4880 for dir
in $temp_rpath; do
4882 [\\/]* |
[A-Za-z
]:[\\/]*)
4887 # Relative path: add a thisdir entry.
4888 rpath
="$rpath\$thisdir/$dir:"
4895 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4896 compile_command
="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4898 if test -n "$finalize_shlibpath"; then
4899 finalize_command
="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4904 if test -n "$runpath_var"; then
4905 if test -n "$perm_rpath"; then
4906 # We should set the runpath_var.
4908 for dir
in $perm_rpath; do
4911 compile_var
="$runpath_var=\"$rpath\$$runpath_var\" "
4913 if test -n "$finalize_perm_rpath"; then
4914 # We should set the runpath_var.
4916 for dir
in $finalize_perm_rpath; do
4919 finalize_var
="$runpath_var=\"$rpath\$$runpath_var\" "
4923 if test "$no_install" = yes; then
4924 # We don't need to create a wrapper script.
4925 link_command
="$compile_var$compile_command$compile_rpath"
4926 # Replace the output file specification.
4927 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4928 # Delete the old output file.
4930 # Link the executable and exit
4931 $show "$link_command"
4932 $run eval "$link_command" ||
exit $?
4936 if test "$hardcode_action" = relink
; then
4937 # Fast installation is not supported
4938 link_command
="$compile_var$compile_command$compile_rpath"
4939 relink_command
="$finalize_var$finalize_command$finalize_rpath"
4941 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4942 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4944 if test "$fast_install" != no
; then
4945 link_command
="$finalize_var$compile_command$finalize_rpath"
4946 if test "$fast_install" = yes; then
4947 relink_command
=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP`
4949 # fast_install is set to needless
4953 link_command
="$compile_var$compile_command$compile_rpath"
4954 relink_command
="$finalize_var$finalize_command$finalize_rpath"
4958 # Replace the output file specification.
4959 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4961 # Delete the old output files.
4962 $run $rm $output $output_objdir/$outputname $output_objdir/lt-
$outputname
4964 $show "$link_command"
4965 $run eval "$link_command" ||
exit $?
4967 # Now create the wrapper script.
4968 $show "creating $output"
4970 # Quote the relink command for shipping.
4971 if test -n "$relink_command"; then
4972 # Preserve any variables that may affect compiler behavior
4973 for var
in $variables_saved_for_relink; do
4974 if eval test -z \"\
${$var+set}\"; then
4975 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4976 elif eval var_value
=\$
$var; test -z "$var_value"; then
4977 relink_command
="$var=; export $var; $relink_command"
4979 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4980 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
4983 relink_command
="(cd `pwd`; $relink_command)"
4984 relink_command
=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
4987 # Quote $echo for shipping.
4988 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
4990 [\\/]* |
[A-Za-z
]:[\\/]*) qecho
="$SHELL $progpath --fallback-echo";;
4991 *) qecho
="$SHELL `pwd`/$progpath --fallback-echo";;
4993 qecho
=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4995 qecho
=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4998 # Only actually do things if our run command is non-null.
4999 if test -z "$run"; then
5000 # win32 will think the script is a binary if it has
5001 # a .exe suffix, so we strip it off here.
5003 *.exe
) output
=`$echo $output|${SED} 's,.exe$,,'` ;;
5005 # test for cygwin because mv fails w/o .exe extensions
5009 outputname
=`$echo $outputname|${SED} 's,.exe$,,'` ;;
5013 *cygwin
* |
*mingw
* )
5014 output_name
=`basename $output`
5015 output_path
=`dirname $output`
5016 cwrappersource
="$output_path/$objdir/lt-$output_name.c"
5017 cwrapper
="$output_path/$output_name.exe"
5018 $rm $cwrappersource $cwrapper
5019 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
5021 cat > $cwrappersource <<EOF
5023 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
5024 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5026 The $output program cannot be directly executed until all the libtool
5027 libraries that it depends on are installed.
5029 This wrapper executable should never be moved out of the build directory.
5030 If it is, it will not operate correctly.
5032 Currently, it simply execs the wrapper *script* "/bin/sh $output",
5033 but could eventually absorb all of the scripts functionality and
5034 exec $objdir/$outputname directly.
5037 cat >> $cwrappersource<<"EOF"
5046 #include <sys/stat.h>
5048 #if defined(PATH_MAX)
5049 # define LT_PATHMAX PATH_MAX
5050 #elif defined(MAXPATHLEN)
5051 # define LT_PATHMAX MAXPATHLEN
5053 # define LT_PATHMAX 1024
5056 #ifndef DIR_SEPARATOR
5057 # define DIR_SEPARATOR '/'
5058 # define PATH_SEPARATOR ':'
5061 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
5063 # define HAVE_DOS_BASED_FILE_SYSTEM
5064 # ifndef DIR_SEPARATOR_2
5065 # define DIR_SEPARATOR_2 '\\'
5067 # ifndef PATH_SEPARATOR_2
5068 # define PATH_SEPARATOR_2 ';'
5072 #ifndef DIR_SEPARATOR_2
5073 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
5074 #else /* DIR_SEPARATOR_2 */
5075 # define IS_DIR_SEPARATOR(ch) \
5076 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
5077 #endif /* DIR_SEPARATOR_2 */
5079 #ifndef PATH_SEPARATOR_2
5080 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
5081 #else /* PATH_SEPARATOR_2 */
5082 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
5083 #endif /* PATH_SEPARATOR_2 */
5085 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
5086 #define XFREE(stale) do { \
5087 if (stale) { free ((void *) stale); stale = 0; } \
5090 /* -DDEBUG is fairly common in CFLAGS. */
5092 #if defined DEBUGWRAPPER
5093 # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
5095 # define DEBUG(format, ...)
5098 const char *program_name = NULL;
5100 void * xmalloc (size_t num);
5101 char * xstrdup (const char *string);
5102 const char * base_name (const char *name);
5103 char * find_executable(const char *wrapper);
5104 int check_executable(const char *path);
5105 char * strendzap(char *str, const char *pat);
5106 void lt_fatal (const char *message, ...);
5109 main (int argc, char *argv[])
5114 program_name = (char *) xstrdup (base_name (argv[0]));
5115 DEBUG("(main) argv[0] : %s\n",argv[0]);
5116 DEBUG("(main) program_name : %s\n",program_name);
5117 newargz = XMALLOC(char *, argc+2);
5120 cat >> $cwrappersource <<EOF
5121 newargz[0] = (char *) xstrdup("$SHELL");
5124 cat >> $cwrappersource <<"EOF"
5125 newargz
[1] = find_executable
(argv
[0]);
5126 if (newargz
[1] == NULL
)
5127 lt_fatal
("Couldn't find %s", argv
[0]);
5128 DEBUG
("(main) found exe at : %s\n",newargz
[1]);
5129 /* we know the
script has the same name
, without the .exe
*/
5130 /* so
make sure newargz
[1] doesn
't end in .exe */
5131 strendzap(newargz[1],".exe");
5132 for (i = 1; i < argc; i++)
5133 newargz[i+1] = xstrdup(argv[i]);
5134 newargz[argc+1] = NULL;
5136 for (i=0; i<argc+1; i++)
5138 DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
5146 cat >> $cwrappersource <<EOF
5147 execv("$SHELL",(char const **)newargz);
5151 cat >> $cwrappersource <<EOF
5152 execv("$SHELL",newargz);
5157 cat >> $cwrappersource <<"EOF"
5162 xmalloc (size_t num)
5164 void * p = (void *) malloc (num);
5166 lt_fatal ("Memory exhausted");
5172 xstrdup (const char *string)
5174 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
5179 base_name (const char *name)
5183 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5184 /* Skip over the disk name in MSDOS pathnames. */
5185 if (isalpha ((unsigned char)name[0]) && name[1] == ':')
5189 for (base = name; *name; name++)
5190 if (IS_DIR_SEPARATOR (*name))
5196 check_executable(const char * path)
5200 DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
5201 if ((!path) || (!*path))
5204 if ((stat (path, &st) >= 0) &&
5206 /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
5207 #if defined (S_IXOTH)
5208 ((st.st_mode & S_IXOTH) == S_IXOTH) ||
5210 #if defined (S_IXGRP)
5211 ((st.st_mode & S_IXGRP) == S_IXGRP) ||
5213 ((st.st_mode & S_IXUSR) == S_IXUSR))
5220 /* Searches for the full path of the wrapper. Returns
5221 newly allocated full path name if found, NULL otherwise */
5223 find_executable (const char* wrapper)
5228 /* static buffer for getcwd */
5229 char tmp[LT_PATHMAX + 1];
5233 DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
5235 if ((wrapper == NULL) || (*wrapper == '\
0'))
5238 /* Absolute path? */
5239 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5240 if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
5242 concat_name = xstrdup (wrapper);
5243 if (check_executable(concat_name))
5250 if (IS_DIR_SEPARATOR (wrapper[0]))
5252 concat_name = xstrdup (wrapper);
5253 if (check_executable(concat_name))
5257 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5261 for (p = wrapper; *p; p++)
5269 /* no slashes; search PATH */
5270 const char* path = getenv ("PATH");
5273 for (p = path; *p; p = p_next)
5277 for (q = p; *q; q++)
5278 if (IS_PATH_SEPARATOR(*q))
5281 p_next = (*q == '\
0' ? q : q + 1);
5284 /* empty path: current directory */
5285 if (getcwd (tmp, LT_PATHMAX) == NULL)
5286 lt_fatal ("getcwd failed");
5287 tmp_len = strlen(tmp);
5288 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5289 memcpy (concat_name, tmp, tmp_len);
5290 concat_name[tmp_len] = '/';
5291 strcpy (concat_name + tmp_len + 1, wrapper);
5295 concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
5296 memcpy (concat_name, p, p_len);
5297 concat_name[p_len] = '/';
5298 strcpy (concat_name + p_len + 1, wrapper);
5300 if (check_executable(concat_name))
5305 /* not found in PATH; assume curdir */
5307 /* Relative path | not found in path: prepend cwd */
5308 if (getcwd (tmp, LT_PATHMAX) == NULL)
5309 lt_fatal ("getcwd failed");
5310 tmp_len = strlen(tmp);
5311 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5312 memcpy (concat_name, tmp, tmp_len);
5313 concat_name[tmp_len] = '/';
5314 strcpy (concat_name + tmp_len + 1, wrapper);
5316 if (check_executable(concat_name))
5323 strendzap(char *str, const char *pat)
5327 assert(str != NULL);
5328 assert(pat != NULL);
5331 patlen = strlen(pat);
5335 str += len - patlen;
5336 if (strcmp(str, pat) == 0)
5343 lt_error_core (int exit_status, const char * mode,
5344 const char * message, va_list ap)
5346 fprintf (stderr, "%s: %s: ", program_name, mode);
5347 vfprintf (stderr, message, ap);
5348 fprintf (stderr, ".\n");
5350 if (exit_status >= 0)
5355 lt_fatal (const char *message, ...)
5358 va_start (ap, message);
5359 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
5363 # we should really use a build-platform specific compiler
5364 # here, but OTOH, the wrappers (shell script and this C one)
5365 # are only useful if you want to execute the "real" binary.
5366 # Since the "real" binary is built for $host, then this
5367 # wrapper might as well be built for $host, too.
5368 $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
5372 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5377 # $output - temporary wrapper script for $objdir/$outputname
5378 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5380 # The $output program cannot be directly executed until all the libtool
5381 # libraries that it depends on are installed.
5383 # This wrapper script should never be moved out of the build directory.
5384 # If it is, it will not operate correctly.
5386 # Sed substitution that helps us do robust quoting. It backslashifies
5387 # metacharacters that are still active within double-quoted strings.
5388 Xsed='${SED} -e 1s
/^X
//'
5389 sed_quote_subst='$sed_quote_subst'
5391 # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
5392 if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
5395 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
5396 # is contrary to our usage. Disable this feature.
5397 alias -g '\
${1+\"\$@\"}'='\"\$@
\"'
5398 setopt NO_GLOB_SUBST
5400 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
5402 BIN_SH=xpg4; export BIN_SH # for Tru64
5403 DUALCASE=1; export DUALCASE # for MKS sh
5405 # The HP-UX ksh and POSIX shell print the target directory to stdout
5407 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5409 relink_command=\"$relink_command\"
5411 # This environment variable determines our operation mode.
5412 if test \"\$libtool_install_magic\" = \"$magic\"; then
5413 # install mode needs the following variable:
5414 notinst_deplibs='$notinst_deplibs'
5416 # When we are sourced in execute mode, \$file and \$echo are already set.
5417 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5420 # Make sure echo works.
5421 if test \"X\$1\" = X--no-reexec; then
5422 # Discard the --no-reexec flag, and continue.
5424 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X
\t'; then
5425 # Yippee, \$echo works!
5428 # Restart under the correct shell, and then maybe \$echo will work.
5429 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
5435 # Find the directory that this script lives in.
5436 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's
%/[^
/]*$
%%'\`
5437 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5439 # Follow symbolic links until we get to the real thisdir.
5440 file=\`ls -ld \"\$file\" | ${SED} -n 's
/.
*-> //p
'\`
5441 while test -n \"\$file\"; do
5442 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's
%/[^
/]*\$
%%'\`
5444 # If there was a directory component, then change thisdir.
5445 if test \"x\$destdir\" != \"x\$file\"; then
5446 case \"\$destdir\" in
5447 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5448 *) thisdir=\"\$thisdir/\$destdir\" ;;
5452 file=\`\$echo \"X\$file\" | \$Xsed -e 's
%^.
*/%%'\`
5453 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's
/.
*-> //p
'\`
5456 # Try to get the absolute directory name.
5457 absdir=\`cd \"\$thisdir\" && pwd\`
5458 test -n \"\$absdir\" && thisdir=\"\$absdir\"
5461 if test "$fast_install" = yes; then
5463 program=lt-'$outputname'$exeext
5464 progdir=\"\$thisdir/$objdir\"
5466 if test ! -f \"\$progdir/\$program\" || \\
5467 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5468 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5470 file=\"\$\$-\$program\"
5472 if test ! -d \"\$progdir\"; then
5473 $mkdir \"\$progdir\"
5475 $rm \"\$progdir/\$file\"
5480 # relink executable if necessary
5481 if test -n \"\$relink_command\"; then
5482 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5484 $echo \"\$relink_command_output\" >&2
5485 $rm \"\$progdir/\$file\"
5490 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5491 { $rm \"\$progdir/\$program\";
5492 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5493 $rm \"\$progdir/\$file\"
5497 program='$outputname'
5498 progdir=\"\$thisdir/$objdir\"
5504 if test -f \"\$progdir/\$program\"; then"
5506 # Export our shlibpath_var if we have one.
5507 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5509 # Add our own library path to $shlibpath_var
5510 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5512 # Some systems cannot cope with colon-terminated $shlibpath_var
5513 # The second colon is a workaround for a bug in BeOS R4 sed
5514 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's
/::*\$
//'\`
5516 export $shlibpath_var
5520 # fixup the dll searchpath if we need to.
5521 if test -n "$dllsearchpath"; then
5523 # Add the dll search path components to the executable PATH
5524 PATH=$dllsearchpath:\$PATH
5529 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5530 # Run the actual program with our arguments.
5533 # Backslashes separate directories on plain windows
5534 *-*-mingw | *-*-os2*)
5536 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
5542 exec \"\$progdir/\$program\" \${1+\"\$@\"}
5547 \$echo \"\$0: cannot exec \$program \$*\"
5551 # The program doesn't exist.
5552 \
$echo \"\
$0: error
: \\\
`\$progdir/\$program' does not exist\" 1>&2
5553 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5554 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5565 # See if we need to build an old-fashioned archive.
5566 for oldlib in $oldlibs; do
5568 if test "$build_libtool_libs" = convenience; then
5569 oldobjs="$libobjs_save"
5570 addlibs="$convenience"
5571 build_libtool_libs=no
5573 if test "$build_libtool_libs" = module; then
5574 oldobjs="$libobjs_save"
5575 build_libtool_libs=no
5577 oldobjs="$old_deplibs $non_pic_objects"
5579 addlibs="$old_convenience"
5582 if test -n "$addlibs"; then
5583 gentop="$output_objdir/${outputname}x"
5584 generated="$generated $gentop"
5586 func_extract_archives $gentop $addlibs
5587 oldobjs="$oldobjs $func_extract_archives_result"
5590 # Do each command in the archive commands.
5591 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5592 cmds=$old_archive_from_new_cmds
5594 # POSIX demands no paths to be encoded in archives. We have
5595 # to avoid creating archives with duplicate basenames if we
5596 # might have to extract them afterwards, e.g., when creating a
5597 # static archive out of a convenience library, or when linking
5598 # the entirety of a libtool archive into another (currently
5599 # not supported by libtool).
5600 if (for obj in $oldobjs
5602 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5603 done | sort | sort -uc >/dev/null 2>&1); then
5606 $echo "copying selected object files to avoid basename conflicts..."
5608 if test -z "$gentop"; then
5609 gentop="$output_objdir/${outputname}x"
5610 generated="$generated $gentop"
5612 $show "${rm}r $gentop"
5613 $run ${rm}r "$gentop"
5614 $show "$mkdir $gentop"
5615 $run $mkdir "$gentop"
5617 if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
5622 save_oldobjs=$oldobjs
5625 for obj in $save_oldobjs
5627 objbase=`$echo "X$obj" |
$Xsed -e 's%^.*/%%'`
5628 case " $oldobjs " in
5629 " ") oldobjs=$obj ;;
5632 # Make sure we don't pick an alternate name that also
5634 newobj=lt$counter-$objbase
5635 counter=`expr $counter + 1`
5636 case " $oldobjs " in
5637 *[\ /]"$newobj "*) ;;
5638 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
5641 $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5642 $run ln "$obj" "$gentop/$newobj" ||
5643 $run cp "$obj" "$gentop/$newobj"
5644 oldobjs="$oldobjs $gentop/$newobj"
5646 *) oldobjs="$oldobjs $obj" ;;
5651 eval cmds=\"$old_archive_cmds\"
5653 if len=`expr "X$cmds" : ".*"` &&
5654 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5655 cmds=$old_archive_cmds
5657 # the command line is too long to link in one step, link in parts
5658 $echo "using piecewise archive linking..."
5663 save_oldobjs=$oldobjs
5665 # Is there a better way of finding the last object in the list?
5666 for obj in $save_oldobjs
5670 for obj in $save_oldobjs
5672 oldobjs="$objlist $obj"
5673 objlist="$objlist $obj"
5674 eval test_cmds=\"$old_archive_cmds\"
5675 if len=`expr "X$test_cmds" : ".*" 2>/dev
/null
` &&
5676 test "$len" -le "$max_cmd_len"; then
5679 # the above command should be used before it gets too long
5681 if test "$obj" = "$last_oldobj" ; then
5684 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5685 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5691 if test "X$oldobjs" = "X" ; then
5692 eval cmds=\"\$concat_cmds\"
5694 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5698 save_ifs="$IFS"; IFS='~'
5699 for cmd in $cmds; do
5703 $run eval "$cmd" || exit $?
5708 if test -n "$generated"; then
5709 $show "${rm}r$generated"
5710 $run ${rm}r$generated
5713 # Now create the libtool archive.
5717 test "$build_old_libs" = yes && old_library="$libname.$libext"
5718 $show "creating $output"
5720 # Preserve any variables that may affect compiler behavior
5721 for var in $variables_saved_for_relink; do
5722 if eval test -z \"\${$var+set}\"; then
5723 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5724 elif eval var_value=\$$var; test -z "$var_value"; then
5725 relink_command="$var=; export $var; $relink_command"
5727 var_value=`$echo "X$var_value" |
$Xsed -e "$sed_quote_subst"`
5728 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5731 # Quote the link command for shipping.
5732 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5733 relink_command=`$echo "X$relink_command" |
$SP2NL |
$Xsed -e "$sed_quote_subst" |
$NL2SP`
5734 if test "$hardcode_automatic" = yes ; then
5739 # Only create the output if not a dry run.
5740 if test -z "$run"; then
5741 for installed in no yes; do
5742 if test "$installed" = yes; then
5743 if test -z "$install_libdir"; then
5746 output="$output_objdir/$outputname"i
5747 # Replace all uninstalled libtool libraries with the installed ones
5749 for deplib in $dependency_libs; do
5752 name=`$echo "X$deplib" |
$Xsed -e 's%^.*/%%'`
5753 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5754 if test -z "$libdir"; then
5755 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5758 newdependency_libs="$newdependency_libs $libdir/$name"
5760 *) newdependency_libs="$newdependency_libs $deplib" ;;
5763 dependency_libs="$newdependency_libs"
5765 for lib in $dlfiles; do
5766 name=`$echo "X$lib" | $Xsed -e 's
%^.
*/%%'`
5767 eval libdir=`${SED} -n -e 's
/^libdir
=\
(.
*\
)$
/\
1/p
' $lib`
5768 if test -z "$libdir"; then
5769 $echo "$modename: \`$lib' is not a valid libtool archive
" 1>&2
5772 newdlfiles="$newdlfiles $libdir/$name"
5774 dlfiles="$newdlfiles"
5776 for lib in $dlprefiles; do
5777 name=`$echo "X
$lib" | $Xsed -e 's%^.*/%%'`
5778 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5779 if test -z "$libdir"; then
5780 $echo "$modename: \
`$lib' is not a valid libtool archive" 1>&2
5783 newdlprefiles="$newdlprefiles $libdir/$name"
5785 dlprefiles="$newdlprefiles"
5788 for lib in $dlfiles; do
5790 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5791 *) abs=`pwd`"/$lib" ;;
5793 newdlfiles="$newdlfiles $abs"
5795 dlfiles="$newdlfiles"
5797 for lib in $dlprefiles; do
5799 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5800 *) abs=`pwd`"/$lib" ;;
5802 newdlprefiles="$newdlprefiles $abs"
5804 dlprefiles="$newdlprefiles"
5807 # place dlname in correct position for cygwin
5809 case $host,$output,$installed,$module,$dlname in
5810 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5813 # $outputname - a libtool library file
5814 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5816 # Please DO NOT delete this file!
5817 # It is necessary for linking the library.
5819 # The name that we can dlopen(3).
5822 # Names of this library.
5823 library_names='$library_names'
5825 # The name of the static archive.
5826 old_library='$old_library'
5828 # Libraries that this one depends upon.
5829 dependency_libs='$dependency_libs'
5831 # Version information for $libname.
5836 # Is this an already installed library?
5837 installed=$installed
5839 # Should we warn about portability when linking against -modules?
5840 shouldnotlink=$module
5842 # Files to dlopen/dlpreopen
5844 dlpreopen='$dlprefiles'
5846 # Directory that this library needs to be installed in:
5847 libdir='$install_libdir'"
5848 if test "$installed" = no && test "$need_relink" = yes; then
5850 relink_command=\"$relink_command\""
5855 # Do a symbolic link so that the libtool archive can be found in
5856 # LD_LIBRARY_PATH before the program is installed.
5857 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5858 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5864 # libtool install mode
5866 modename="$modename: install"
5868 # There may be an optional sh(1) argument at the beginning of
5869 # install_prog (especially on Windows NT).
5870 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5871 # Allow the use of GNU shtool's install command.
5872 $echo "X$nonopt" | grep shtool > /dev/null; then
5873 # Aesthetically quote it.
5874 arg=`$echo "X$nonopt" |
$Xsed -e "$sed_quote_subst"`
5876 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5880 install_prog="$arg "
5888 # The real first argument should be the name of the installation program.
5889 # Aesthetically quote it.
5890 arg=`$echo "X$arg" |
$Xsed -e "$sed_quote_subst"`
5892 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5896 install_prog="$install_prog$arg"
5898 # We need to accept at least all the BSD install flags.
5908 if test -n "$dest"; then
5909 files="$files $dest"
5917 case " $install_prog " in
5922 -g | -m | -o) prev=$arg ;;
5930 # If the previous option needed an argument, then skip it.
5931 if test -n "$prev"; then
5940 # Aesthetically quote the argument.
5941 arg=`$echo "X$arg" |
$Xsed -e "$sed_quote_subst"`
5943 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5947 install_prog="$install_prog $arg"
5950 if test -z "$install_prog"; then
5951 $echo "$modename: you must specify an install program" 1>&2
5956 if test -n "$prev"; then
5957 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5962 if test -z "$files"; then
5963 if test -z "$dest"; then
5964 $echo "$modename: no file or destination specified" 1>&2
5966 $echo "$modename: you must specify a destination" 1>&2
5972 # Canonicalise the pathname:
5976 # - strip any trailing /
5978 while test "$dest" != "$tmp"; do
5980 dest=`$echo "X$dest" | $Xsed -e 's
%[^
/.
][^
/.
]*/\.\.
%%g
' -e 's
%/\.
/%/%g
' -e 's
%//*%/%g
' -e 's
%/$
%%g
'`
5983 # Check to see that the destination is a directory.
5984 test -d "$dest" && isdir=yes
5985 if test "$isdir" = yes; then
5989 destdir=`$echo "X$dest" | $Xsed -e 's
%/[^
/]*$
%%'`
5990 test "X$destdir" = "X$dest" && destdir=.
5991 destname=`$echo "X$dest" | $Xsed -e 's
%^.
*/%%'`
5993 # Not a directory, so check to see that there is only one file specified.
5995 if test "$#" -gt 2; then
5996 $echo "$modename: \`$dest' is not a directory
" 1>&2
6002 [\\/]* | [A-Za-z]:[\\/]*) ;;
6004 for file in $files; do
6008 $echo "$modename: \
`$destdir' must be an absolute directory name" 1>&2
6017 # This variable tells wrapper scripts just to set variables rather
6018 # than running their programs.
6019 libtool_install_magic="$magic"
6024 for file in $files; do
6026 # Do each installation.
6029 # Do the static libraries later.
6030 staticlibs="$staticlibs $file"
6034 # Check to see that this really is a libtool archive.
6035 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6037 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
6045 # If there is no directory component, then add one.
6047 */* | *\\*) . $file ;;
6051 # Add the libdir to current_libdirs if it is the destination.
6052 if test "X$destdir" = "X$libdir"; then
6053 case "$current_libdirs " in
6055 *) current_libdirs="$current_libdirs $libdir" ;;
6058 # Note the libdir as a future libdir.
6059 case "$future_libdirs " in
6061 *) future_libdirs="$future_libdirs $libdir" ;;
6065 dir=`$echo "X$file" | $Xsed -e 's
%/[^
/]*$
%%'`/
6066 test "X$dir" = "X$file/" && dir=
6069 if test -n "$relink_command"; then
6070 # Determine the prefix the user has applied to our future dir.
6071 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
6073 # Don't allow the user to place us outside of our expected
6074 # location b/c this prevents finding dependent libraries that
6075 # are installed to the same prefix.
6076 # At present, this check doesn't affect windows .dll's that
6077 # are installed into $libdir/../bin (currently, that works fine)
6078 # but it's something to keep an eye on.
6079 if test "$inst_prefix_dir" = "$destdir"; then
6080 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
6084 if test -n "$inst_prefix_dir"; then
6085 # Stick the inst_prefix_dir data into the link command.
6086 relink_command
=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP`
6088 relink_command
=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
6091 $echo "$modename: warning: relinking \`$file'" 1>&2
6092 $show "$relink_command"
6093 if $run eval "$relink_command"; then :
6095 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6100 # See the names of the shared library.
6101 set dummy
$library_names
6102 if test -n "$2"; then
6108 test -n "$relink_command" && srcname
="$realname"T
6110 # Install the shared library and build the symlinks.
6111 $show "$install_prog $dir/$srcname $destdir/$realname"
6112 $run eval "$install_prog $dir/$srcname $destdir/$realname" ||
exit $?
6113 if test -n "$stripme" && test -n "$striplib"; then
6114 $show "$striplib $destdir/$realname"
6115 $run eval "$striplib $destdir/$realname" ||
exit $?
6118 if test "$#" -gt 0; then
6119 # Delete the old symlinks, and create new ones.
6120 # Try `ln -sf' first, because the `ln' binary might depend on
6121 # the symlink we replace! Solaris /bin/ln does not understand -f,
6122 # so we also need to try rm && ln -s.
6125 if test "$linkname" != "$realname"; then
6126 $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6127 $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6132 # Do each command in the postinstall commands.
6133 lib
="$destdir/$realname"
6134 cmds
=$postinstall_cmds
6135 save_ifs
="$IFS"; IFS
='~'
6136 for cmd
in $cmds; do
6140 $run eval "$cmd" ||
{
6143 # Restore the uninstalled library and exit
6144 if test "$mode" = relink
; then
6145 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
6154 # Install the pseudo-library for information purposes.
6155 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6156 instname
="$dir/$name"i
6157 $show "$install_prog $instname $destdir/$name"
6158 $run eval "$install_prog $instname $destdir/$name" ||
exit $?
6160 # Maybe install the static library, too.
6161 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
6165 # Install (i.e. copy) a libtool object.
6167 # Figure out destination file name, if it wasn't already specified.
6168 if test -n "$destname"; then
6169 destfile
="$destdir/$destname"
6171 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6172 destfile
="$destdir/$destfile"
6175 # Deduce the name of the destination old-style object file.
6178 staticdest
=`$echo "X$destfile" | $Xsed -e "$lo2o"`
6181 staticdest
="$destfile"
6185 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
6191 # Install the libtool object if requested.
6192 if test -n "$destfile"; then
6193 $show "$install_prog $file $destfile"
6194 $run eval "$install_prog $file $destfile" ||
exit $?
6197 # Install the old object if enabled.
6198 if test "$build_old_libs" = yes; then
6199 # Deduce the name of the old-style object file.
6200 staticobj
=`$echo "X$file" | $Xsed -e "$lo2o"`
6202 $show "$install_prog $staticobj $staticdest"
6203 $run eval "$install_prog \$staticobj \$staticdest" ||
exit $?
6209 # Figure out destination file name, if it wasn't already specified.
6210 if test -n "$destname"; then
6211 destfile
="$destdir/$destname"
6213 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6214 destfile
="$destdir/$destfile"
6217 # If the file is missing, and there is a .exe on the end, strip it
6218 # because it is most likely a libtool script we actually want to
6223 if test ! -f "$file"; then
6224 file=`$echo $file|${SED} 's,.exe$,,'`
6230 # Do a test to see if this is really a libtool program.
6233 wrapper
=`$echo $file | ${SED} -e 's,.exe$,,'`
6239 if (${SED} -e '4q' $wrapper |
grep "^# Generated by .*$PACKAGE")>/dev
/null
2>&1; then
6243 # Note that it is not necessary on cygwin/mingw to append a dot to
6244 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6245 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6246 # `FILE.' does not work on cygwin managed mounts.
6248 # If there is no directory component, then add one.
6250 */* |
*\\*) .
${wrapper} ;;
6251 *) . .
/${wrapper} ;;
6254 # Check the variables that should have been set.
6255 if test -z "$notinst_deplibs"; then
6256 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
6261 for lib
in $notinst_deplibs; do
6262 # Check to see that each library is installed.
6264 if test -f "$lib"; then
6265 # If there is no directory component, then add one.
6267 */* |
*\\*) .
$lib ;;
6271 libfile
="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
6272 if test -n "$libdir" && test ! -f "$libfile"; then
6273 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
6279 # Note that it is not necessary on cygwin/mingw to append a dot to
6280 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6281 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6282 # `FILE.' does not work on cygwin managed mounts.
6284 # If there is no directory component, then add one.
6286 */* |
*\\*) .
${wrapper} ;;
6287 *) . .
/${wrapper} ;;
6291 if test "$fast_install" = no
&& test -n "$relink_command"; then
6292 if test "$finalize" = yes && test -z "$run"; then
6293 tmpdir
=`func_mktempdir`
6294 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
6295 outputname
="$tmpdir/$file"
6296 # Replace the output file specification.
6297 relink_command
=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
6299 $show "$relink_command"
6300 if $run eval "$relink_command"; then :
6302 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6308 $echo "$modename: warning: cannot relink \`$file'" 1>&2
6311 # Install the binary that we compiled earlier.
6312 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
6316 # remove .exe since cygwin /usr/bin/install will append another
6318 case $install_prog,$host in
6319 */usr
/bin
/install*,*cygwin
*)
6320 case $file:$destfile in
6325 destfile
=$destfile.exe
6328 destfile
=`$echo $destfile | ${SED} -e 's,.exe$,,'`
6333 $show "$install_prog$stripme $file $destfile"
6334 $run eval "$install_prog\$stripme \$file \$destfile" ||
exit $?
6335 test -n "$outputname" && ${rm}r
"$tmpdir"
6340 for file in $staticlibs; do
6341 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6343 # Set up the ranlib parameters.
6344 oldlib
="$destdir/$name"
6346 $show "$install_prog $file $oldlib"
6347 $run eval "$install_prog \$file \$oldlib" ||
exit $?
6349 if test -n "$stripme" && test -n "$old_striplib"; then
6350 $show "$old_striplib $oldlib"
6351 $run eval "$old_striplib $oldlib" ||
exit $?
6354 # Do each command in the postinstall commands.
6355 cmds
=$old_postinstall_cmds
6356 save_ifs
="$IFS"; IFS
='~'
6357 for cmd
in $cmds; do
6361 $run eval "$cmd" ||
exit $?
6366 if test -n "$future_libdirs"; then
6367 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
6370 if test -n "$current_libdirs"; then
6371 # Maybe just do a dry run.
6372 test -n "$run" && current_libdirs
=" -n$current_libdirs"
6373 exec_cmd
='$SHELL $progpath $preserve_args --finish$current_libdirs'
6379 # libtool finish mode
6381 modename
="$modename: finish"
6385 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
6388 libdirs
="$libdirs $dir"
6391 for libdir
in $libdirs; do
6392 if test -n "$finish_cmds"; then
6393 # Do each command in the finish commands.
6395 save_ifs
="$IFS"; IFS
='~'
6396 for cmd
in $cmds; do
6400 $run eval "$cmd" || admincmds
="$admincmds
6405 if test -n "$finish_eval"; then
6406 # Do the single finish_eval.
6407 eval cmds
=\"$finish_eval\"
6408 $run eval "$cmds" || admincmds
="$admincmds
6414 # Exit here if they wanted silent mode.
6415 test "$show" = : && exit $EXIT_SUCCESS
6417 $echo "X----------------------------------------------------------------------" |
$Xsed
6418 $echo "Libraries have been installed in:"
6419 for libdir
in $libdirs; do
6423 $echo "If you ever happen to want to link against installed libraries"
6424 $echo "in a given directory, LIBDIR, you must either use libtool, and"
6425 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
6426 $echo "flag during linking and do at least one of the following:"
6427 if test -n "$shlibpath_var"; then
6428 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
6429 $echo " during execution"
6431 if test -n "$runpath_var"; then
6432 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
6433 $echo " during linking"
6435 if test -n "$hardcode_libdir_flag_spec"; then
6437 eval flag
=\"$hardcode_libdir_flag_spec\"
6439 $echo " - use the \`$flag' linker flag"
6441 if test -n "$admincmds"; then
6442 $echo " - have your system administrator run these commands:$admincmds"
6444 if test -f /etc
/ld.so.conf
; then
6445 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6448 $echo "See any operating system documentation about shared libraries for"
6449 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
6450 $echo "X----------------------------------------------------------------------" |
$Xsed
6454 # libtool execute mode
6456 modename
="$modename: execute"
6458 # The first argument is the command name.
6460 if test -z "$cmd"; then
6461 $echo "$modename: you must specify a COMMAND" 1>&2
6466 # Handle -dlopen flags immediately.
6467 for file in $execute_dlfiles; do
6468 if test ! -f "$file"; then
6469 $echo "$modename: \`$file' is not a file" 1>&2
6477 # Check to see that this really is a libtool archive.
6478 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
6480 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6485 # Read the libtool library.
6489 # If there is no directory component, then add one.
6491 */* |
*\\*) .
$file ;;
6495 # Skip this library if it cannot be dlopened.
6496 if test -z "$dlname"; then
6497 # Warn if it was a shared library.
6498 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6502 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6503 test "X$dir" = "X$file" && dir
=.
6505 if test -f "$dir/$objdir/$dlname"; then
6508 if test ! -f "$dir/$dlname"; then
6509 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6516 # Just add the directory containing the .lo file.
6517 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6518 test "X$dir" = "X$file" && dir
=.
6522 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6527 # Get the absolute pathname.
6528 absdir
=`cd "$dir" && pwd`
6529 test -n "$absdir" && dir
="$absdir"
6531 # Now add the directory to shlibpath_var.
6532 if eval "test -z \"\$$shlibpath_var\""; then
6533 eval "$shlibpath_var=\"\$dir\""
6535 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6539 # This variable tells wrapper scripts just to set shlibpath_var
6540 # rather than running their programs.
6541 libtool_execute_magic
="$magic"
6543 # Check if any of the arguments is a wrapper script.
6550 # Do a test to see if this is really a libtool program.
6551 if (${SED} -e '4q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6552 # If there is no directory component, then add one.
6554 */* |
*\\*) .
$file ;;
6558 # Transform arg to wrapped name.
6559 file="$progdir/$program"
6563 # Quote arguments (to preserve shell metacharacters).
6564 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6565 args
="$args \"$file\""
6568 if test -z "$run"; then
6569 if test -n "$shlibpath_var"; then
6570 # Export the shlibpath_var.
6571 eval "export $shlibpath_var"
6574 # Restore saved environment variables
6575 for lt_var
in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
6577 eval "if test \"\${save_$lt_var+set}\" = set; then
6578 $lt_var=\$save_$lt_var; export $lt_var
6582 # Now prepare to actually exec the command.
6583 exec_cmd
="\$cmd$args"
6585 # Display what would be done.
6586 if test -n "$shlibpath_var"; then
6587 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6588 $echo "export $shlibpath_var"
6595 # libtool clean and uninstall mode
6597 modename
="$modename: $mode"
6603 # This variable tells wrapper scripts just to set variables rather
6604 # than running their programs.
6605 libtool_install_magic
="$magic"
6610 -f) rm="$rm $arg"; rmforce
=yes ;;
6611 -*) rm="$rm $arg" ;;
6612 *) files
="$files $arg" ;;
6616 if test -z "$rm"; then
6617 $echo "$modename: you must specify an RM program" 1>&2
6624 origobjdir
="$objdir"
6625 for file in $files; do
6626 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6627 if test "X$dir" = "X$file"; then
6629 objdir
="$origobjdir"
6631 objdir
="$dir/$origobjdir"
6633 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6634 test "$mode" = uninstall
&& objdir
="$dir"
6636 # Remember objdir for removal later, being careful to avoid duplicates
6637 if test "$mode" = clean
; then
6640 *) rmdirs
="$rmdirs $objdir" ;;
6644 # Don't error if the file doesn't exist and rm -f was used.
6645 if (test -L "$file") >/dev
/null
2>&1 \
6646 ||
(test -h "$file") >/dev
/null
2>&1 \
6647 ||
test -f "$file"; then
6649 elif test -d "$file"; then
6652 elif test "$rmforce" = yes; then
6660 # Possibly a libtool archive, so verify it.
6661 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6664 # Delete the libtool libraries and symlinks.
6665 for n
in $library_names; do
6666 rmfiles
="$rmfiles $objdir/$n"
6668 test -n "$old_library" && rmfiles
="$rmfiles $objdir/$old_library"
6672 case " $library_names " in
6673 # " " in the beginning catches empty $dlname
6675 *) rmfiles
="$rmfiles $objdir/$dlname" ;;
6677 test -n "$libdir" && rmfiles
="$rmfiles $objdir/$name $objdir/${name}i"
6680 if test -n "$library_names"; then
6681 # Do each command in the postuninstall commands.
6682 cmds
=$postuninstall_cmds
6683 save_ifs
="$IFS"; IFS
='~'
6684 for cmd
in $cmds; do
6689 if test "$?" -ne 0 && test "$rmforce" != yes; then
6696 if test -n "$old_library"; then
6697 # Do each command in the old_postuninstall commands.
6698 cmds
=$old_postuninstall_cmds
6699 save_ifs
="$IFS"; IFS
='~'
6700 for cmd
in $cmds; do
6705 if test "$?" -ne 0 && test "$rmforce" != yes; then
6711 # FIXME: should reinstall the best remaining shared library.
6718 # Possibly a libtool object, so verify it.
6719 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6724 # Add PIC object to the list of files to remove.
6725 if test -n "$pic_object" \
6726 && test "$pic_object" != none
; then
6727 rmfiles
="$rmfiles $dir/$pic_object"
6730 # Add non-PIC object to the list of files to remove.
6731 if test -n "$non_pic_object" \
6732 && test "$non_pic_object" != none
; then
6733 rmfiles
="$rmfiles $dir/$non_pic_object"
6739 if test "$mode" = clean
; then
6743 file=`$echo $file|${SED} 's,.exe$,,'`
6744 noexename
=`$echo $name|${SED} 's,.exe$,,'`
6745 # $file with .exe has already been added to rmfiles,
6746 # add $file without .exe
6747 rmfiles
="$rmfiles $file"
6750 # Do a test to see if this is a libtool program.
6751 if (${SED} -e '4q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6755 # note $name still contains .exe if it was in $file originally
6756 # as does the version of $file that was added into $rmfiles
6757 rmfiles
="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6758 if test "$fast_install" = yes && test -n "$relink_command"; then
6759 rmfiles
="$rmfiles $objdir/lt-$name"
6761 if test "X$noexename" != "X$name" ; then
6762 rmfiles
="$rmfiles $objdir/lt-${noexename}.c"
6768 $show "$rm $rmfiles"
6769 $run $rm $rmfiles || exit_status
=1
6771 objdir
="$origobjdir"
6773 # Try to remove the ${objdir}s in the directories where we deleted files
6774 for dir
in $rmdirs; do
6775 if test -d "$dir"; then
6777 $run rmdir $dir >/dev
/null
2>&1
6785 $echo "$modename: you must specify a MODE" 1>&2
6786 $echo "$generic_help" 1>&2
6791 if test -z "$exec_cmd"; then
6792 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6793 $echo "$generic_help" 1>&2
6796 fi # test -z "$show_help"
6798 if test -n "$exec_cmd"; then
6803 # We need to display help for each of the modes.
6806 "Usage: $modename [OPTION]... [MODE-ARG]...
6808 Provide generalized library-building support services.
6810 --config show all configuration variables
6811 --debug enable verbose shell tracing
6812 -n, --dry-run display commands without modifying any files
6813 --features display basic configuration information and exit
6814 --finish same as \`--mode=finish'
6815 --help display this help message and exit
6816 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6817 --quiet same as \`--silent'
6818 --silent don't print informational messages
6819 --tag=TAG use configuration variables from tag TAG
6820 --version print version information
6822 MODE must be one of the following:
6824 clean remove files from the build directory
6825 compile compile a source file into a libtool object
6826 execute automatically set library path, then run a program
6827 finish complete the installation of libtool libraries
6828 install install libraries or executables
6829 link create a library or an executable
6830 uninstall remove libraries from an installed directory
6832 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6833 a more detailed description of MODE.
6835 Report bugs to <bug-libtool@gnu.org>."
6841 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6843 Remove files from the build directory.
6845 RM is the name of the program to use to delete files associated with each FILE
6846 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6849 If FILE is a libtool library, object or program, all the files associated
6850 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6855 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6857 Compile a source file into a libtool library object.
6859 This mode accepts the following additional options:
6861 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6862 -prefer-pic try to building PIC objects only
6863 -prefer-non-pic try to building non-PIC objects only
6864 -static always build a \`.o' file suitable for static linking
6866 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6867 from the given SOURCEFILE.
6869 The output file name is determined by removing the directory component from
6870 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6871 library object suffix, \`.lo'."
6876 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6878 Automatically set library path, then run a program.
6880 This mode accepts the following additional options:
6882 -dlopen FILE add the directory containing FILE to the library path
6884 This mode sets the library path environment variable according to \`-dlopen'
6887 If any of the ARGS are libtool executable wrappers, then they are translated
6888 into their corresponding uninstalled binary, and any of their required library
6889 directories are added to the library path.
6891 Then, COMMAND is executed, with ARGS as arguments."
6896 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6898 Complete the installation of libtool libraries.
6900 Each LIBDIR is a directory that contains libtool libraries.
6902 The commands that this mode executes may require superuser privileges. Use
6903 the \`--dry-run' option if you just want to see what would be executed."
6908 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6910 Install executables or libraries.
6912 INSTALL-COMMAND is the installation command. The first component should be
6913 either the \`install' or \`cp' program.
6915 The rest of the components are interpreted as arguments to that command (only
6916 BSD-compatible install options are recognized)."
6921 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6923 Link object files or libraries together to form another library, or to
6924 create an executable program.
6926 LINK-COMMAND is a command using the C compiler that you would use to create
6927 a program from several object files.
6929 The following components of LINK-COMMAND are treated specially:
6931 -all-static do not do any dynamic linking at all
6932 -avoid-version do not add a version suffix if possible
6933 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6934 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6935 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6936 -export-symbols SYMFILE
6937 try to export only the symbols listed in SYMFILE
6938 -export-symbols-regex REGEX
6939 try to export only the symbols matching REGEX
6940 -LLIBDIR search LIBDIR for required installed libraries
6941 -lNAME OUTPUT-FILE requires the installed library libNAME
6942 -module build a library that can dlopened
6943 -no-fast-install disable the fast-install mode
6944 -no-install link a not-installable executable
6945 -no-undefined declare that a library does not refer to external symbols
6946 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6947 -objectlist FILE Use a list of object files found in FILE to specify objects
6948 -precious-files-regex REGEX
6949 don't remove output files matching REGEX
6950 -release RELEASE specify package release information
6951 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6952 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6953 -static do not do any dynamic linking of uninstalled libtool libraries
6954 -static-libtool-libs
6955 do not do any dynamic linking of libtool libraries
6956 -version-info CURRENT[:REVISION[:AGE]]
6957 specify library version info [each variable defaults to 0]
6959 All other options (arguments beginning with \`-') are ignored.
6961 Every other argument is treated as a filename. Files ending in \`.la' are
6962 treated as uninstalled libtool libraries, other files are standard or library
6965 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6966 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6967 required, except when creating a convenience library.
6969 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6970 using \`ar' and \`ranlib', or on Windows using \`lib'.
6972 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6973 is created, otherwise an executable program is created."
6978 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6980 Remove libraries from an installation directory.
6982 RM is the name of the program to use to delete files associated with each FILE
6983 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6986 If FILE is a libtool library, all the files associated with it are deleted.
6987 Otherwise, only FILE itself is deleted using RM."
6991 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6998 $echo "Try \`$modename --help' for more information about other modes."
7002 # The TAGs below are defined such that we never get into a situation
7003 # in which we disable both kinds of libraries. Given conflicting
7004 # choices, we go for a static library, that is the most portable,
7005 # since we can't tell whether shared libraries were disabled because
7006 # the user asked for that or because the platform doesn't support
7007 # them. This is particularly important on AIX, because we don't
7008 # support having both static and shared libraries enabled at the same
7009 # time on that platform, so we default to a shared-only configuration.
7010 # If a disable-shared tag is given, we'll fallback to a static-only
7011 # configuration. But we'll never go from static-only to shared-only.
7013 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
7015 # ### END LIBTOOL TAG CONFIG: disable-shared
7017 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
7019 # ### END LIBTOOL TAG CONFIG: disable-static