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
5 # Free Software Foundation, Inc.
6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 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 # define SED for historic ltconfig's generated by Libtool 1.3
37 test -z "$SED" && SED
=sed
39 # The name of this program:
40 progname
=`echo "$progpath" | $SED $basename`
50 TIMESTAMP
=" (1.1220.2.365 2005/12/18 22:14:06)"
52 # See if we are running on zsh, and set the options which allow our
53 # commands through without removal of \ escapes.
54 if test -n "${ZSH_VERSION+set}" ; then
57 # Same for EGREP, and just to be sure, do LTCC as well
58 if test "X$EGREP" = X
; then
61 if test "X$LTCC" = X
; then
64 # Same for EGREP, and just to be sure, do LTCC as well
65 if test "x$EGREP" = x
; then
68 if test "x$LTCC" = x
; then
72 # Check that we have a working $echo.
73 if test "X$1" = X--no-reexec
; then
74 # Discard the --no-reexec flag, and continue.
76 elif test "X$1" = X--fallback-echo
; then
77 # Avoid inline document here, it may be left over
79 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
80 # Yippee, $echo works!
83 # Restart under the correct shell, and then maybe $echo will work.
84 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
87 if test "X$1" = X--fallback-echo
; then
88 # used as fallback echo
97 help="Try \`$progname --help' for more information."
98 magic
="%%%MAGIC variable%%%"
103 # Sed substitution that helps us do robust quoting. It backslashifies
104 # metacharacters that are still active within double-quoted strings.
105 Xsed
="${SED}"' -e 1s/^X//'
106 sed_quote_subst
='s/\([\\`\\"$\\\\]\)/\\\1/g'
107 # test EBCDIC or ASCII
108 case `echo X|tr X '\101'` in
109 A
) # ASCII based system
110 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
112 NL2SP
='tr \015\012 \040\040'
114 *) # EBCDIC based system
116 NL2SP
='tr \r\n \100\100'
121 # Only set LANG and LC_ALL to C if already set.
122 # These must not be set unconditionally because not all systems understand
123 # e.g. LANG=C (notably SCO).
124 # We save the old values to restore during execute mode.
125 if test "${LC_ALL+set}" = set; then
126 save_LC_ALL
="$LC_ALL"; LC_ALL
=C
; export LC_ALL
128 if test "${LANG+set}" = set; then
129 save_LANG
="$LANG"; LANG
=C
; export LANG
132 # Make sure IFS has a sensible default
137 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
138 $echo "$modename: not configured to build any kind of library" 1>&2
139 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
154 lo2o
="s/\\.lo\$/.${objext}/"
155 o2lo
="s/\\.${objext}\$/.lo/"
157 if test -z "$max_cmd_len"; then
162 # If test is not a shell built-in, we'll probably end up computing a
163 # maximum length that is only half of the actual maximum length, but
165 while (test "X"`$SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \
166 = "XX$testring") >/dev
/null
2>&1 &&
167 new_result
=`expr "X$testring" : ".*" 2>&1` &&
168 max_cmd_len
="$new_result" &&
169 test $i != 17 # 1/2 MB should be enough
172 testring
="$testring$testring"
175 # Add a significant safety factor because C++ compilers can tack on massive
176 # amounts of additional arguments before passing them to the linker.
177 # It appears as though 1/2 is a usable value.
178 max_cmd_len
=`expr $max_cmd_len \/ 2`
181 if test -z "$max_cmd_len"; then
186 # If test is not a shell built-in, we'll probably end up computing a
187 # maximum length that is only half of the actual maximum length, but
189 while (test "X"`$SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \
190 = "XX$testring") >/dev
/null
2>&1 &&
191 new_result
=`expr "X$testring" : ".*" 2>&1` &&
192 max_cmd_len
="$new_result" &&
193 test "$i" != 17 # 1/2 MB should be enough
196 testring
="$testring$testring"
199 # Add a significant safety factor because C++ compilers can tack on massive
200 # amounts of additional arguments before passing them to the linker.
201 # It appears as though 1/2 is a usable value.
202 max_cmd_len
=`expr $max_cmd_len \/ 2`
205 #####################################
206 # Shell function definitions:
207 # This seems to be the best place for them
209 # func_mktempdir [string]
210 # Make a temporary directory that won't clash with other running
211 # libtool processes, and avoids race conditions if possible. If
212 # given, STRING is the basename for that directory.
215 my_template
="${TMPDIR-/tmp}/${1-$progname}"
217 if test "$run" = ":"; then
218 # Return a directory name, but don't create it in dry-run mode
219 my_tmpdir
="${my_template}-$$"
222 # If mktemp works, use that first and foremost
223 my_tmpdir
=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
225 if test ! -d "$my_tmpdir"; then
226 # Failing that, at least try and use $RANDOM to avoid a race
227 my_tmpdir
="${my_template}-${RANDOM-0}$$"
229 save_mktempdir_umask
=`umask`
232 umask $save_mktempdir_umask
235 # If we're not in dry-run mode, bomb out on failure
236 test -d "$my_tmpdir" ||
{
237 $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
242 $echo "X$my_tmpdir" |
$Xsed
246 # func_win32_libid arg
247 # return the library type of file 'arg'
249 # Need a lot of goo to handle *both* DLLs and import libs
250 # Has to be a shell function in order to 'eat' the argument
251 # that is supplied when $file_magic_command is called.
254 win32_libid_type
="unknown"
255 win32_fileres
=`file -L $1 2>/dev/null`
256 case $win32_fileres in
257 *ar\ archive\ import\ library
*) # definitely import
258 win32_libid_type
="x86 archive import"
260 *ar\ archive
*) # could be an import, or static
261 if eval $OBJDUMP -f $1 |
$SED -e '10q' 2>/dev
/null | \
262 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev
/null
; then
263 win32_nmres
=`eval $NM -f posix -A $1 | \
264 $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
266 import
*) win32_libid_type
="x86 archive import";;
267 *) win32_libid_type
="x86 archive static";;
272 win32_libid_type
="x86 DLL"
274 *executable
*) # but shell scripts are "executable" too...
275 case $win32_fileres in
276 *MS\ Windows\ PE\ Intel
*)
277 win32_libid_type
="x86 DLL"
282 $echo $win32_libid_type
287 # Infer tagged configuration to use if any are available and
288 # if one wasn't chosen via the "--tag" command line option.
289 # Only attempt this if the compiler in the base compile
290 # command doesn't match the default compiler.
291 # arg is usually of the form 'gcc ...'
294 if test -n "$available_tags" && test -z "$tagname"; then
298 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
302 CC_quoted
="$CC_quoted $arg"
305 # Blanks in the command may have been stripped by the calling shell,
306 # but not from the CC environment variable when configure was run.
307 " $CC "* |
"$CC "* |
" `$echo $CC` "* |
"`$echo $CC` "* |
" $CC_quoted"* |
"$CC_quoted "* |
" `$echo $CC_quoted` "* |
"`$echo $CC_quoted` "*) ;;
308 # Blanks at the start of $base_compile will cause this to fail
309 # if we don't check for them as well.
311 for z
in $available_tags; do
312 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev
/null
; then
313 # Evaluate the configuration.
314 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
317 # Double-quote args containing other shell metacharacters.
319 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
323 CC_quoted
="$CC_quoted $arg"
325 # user sometimes does CC=<HOST>-gcc so we need to match that to 'gcc'
326 trimedcc
=`echo ${CC} | $SED -e "s/${host}-//g"`
327 # and sometimes libtool has CC=<HOST>-gcc but user does CC=gcc
328 extendcc
=${host}-${CC}
329 # and sometimes libtool has CC=<OLDHOST>-gcc but user has CC=<NEWHOST>-gcc
330 # (Gentoo-specific hack because we always export $CHOST)
331 mungedcc
=${CHOST-${host}}-${trimedcc}
333 "cc "* |
" cc "* |
"${host}-cc "* |
" ${host}-cc "*|\
334 "gcc "* |
" gcc "* |
"${host}-gcc "* |
" ${host}-gcc "*)
337 "$trimedcc "* |
" $trimedcc "* |
"`$echo $trimedcc` "* |
" `$echo $trimedcc` "*|\
338 "$extendcc "* |
" $extendcc "* |
"`$echo $extendcc` "* |
" `$echo $extendcc` "*|\
339 "$mungedcc "* |
" $mungedcc "* |
"`$echo $mungedcc` "* |
" `$echo $mungedcc` "*|\
340 " $CC "* |
"$CC "* |
" `$echo $CC` "* |
"`$echo $CC` "* |
" $CC_quoted"* |
"$CC_quoted "* |
" `$echo $CC_quoted` "* |
"`$echo $CC_quoted` "*)
341 # The compiler in the base compile command matches
342 # the one in the tagged configuration.
343 # Assume this is the tagged configuration we want.
350 # If $tagname still isn't set, then no tagged configuration
351 # was found and let the user know that the "--tag" command
352 # line option must be used.
353 if test -z "$tagname"; then
354 $echo "$modename: unable to infer tagged configuration"
355 $echo "$modename: specify a tag with \`--tag'" 1>&2
358 # $echo "$modename: using $tagname tagged configuration"
366 # func_extract_an_archive dir oldlib
367 func_extract_an_archive
()
369 f_ex_an_ar_dir
="$1"; shift
370 f_ex_an_ar_oldlib
="$1"
372 $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
373 $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" ||
exit $?
374 if ($AR t
"$f_ex_an_ar_oldlib" |
sort |
sort -uc >/dev
/null
2>&1); then
377 $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
382 # func_extract_archives gentop oldlib ...
383 func_extract_archives
()
385 my_gentop
="$1"; shift
393 $show "${rm}r $my_gentop"
394 $run ${rm}r
"$my_gentop"
395 $show "$mkdir $my_gentop"
396 $run $mkdir "$my_gentop"
398 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
402 for my_xlib
in $my_oldlibs; do
403 # Extract the objects.
405 [\\/]* |
[A-Za-z
]:[\\/]*) my_xabs
="$my_xlib" ;;
406 *) my_xabs
=`pwd`"/$my_xlib" ;;
408 my_xlib
=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
409 my_xdir
="$my_gentop/$my_xlib"
411 $show "${rm}r $my_xdir"
412 $run ${rm}r
"$my_xdir"
413 $show "$mkdir $my_xdir"
414 $run $mkdir "$my_xdir"
416 if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
421 $show "Extracting $my_xabs"
422 # Do not bother doing anything if just a dry run
423 if test -z "$run"; then
424 darwin_orig_dir
=`pwd`
425 cd $my_xdir ||
exit $?
426 darwin_archive
=$my_xabs
428 darwin_base_archive
=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
429 darwin_arches
=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
430 if test -n "$darwin_arches"; then
431 darwin_arches
=`echo "$darwin_arches" | $SED -e 's/.*are://'`
433 $show "$darwin_base_archive has multiple architectures $darwin_arches"
434 for darwin_arch
in $darwin_arches ; do
435 mkdir
-p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
436 lipo
-thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
437 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
438 func_extract_an_archive
"`pwd`" "${darwin_base_archive}"
440 $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
441 done # $darwin_arches
442 ## Okay now we have a bunch of thin objects, gotta fatten them up :)
443 darwin_filelist
=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
446 for darwin_file
in $darwin_filelist; do
447 darwin_files
=`find unfat-$$ -name $darwin_file -print | $NL2SP`
448 lipo
-create -output "$darwin_file" $darwin_files
449 done # $darwin_filelist
451 cd "$darwin_orig_dir"
453 cd "$darwin_orig_dir"
454 func_extract_an_archive
"$my_xdir" "$my_xabs"
459 func_extract_an_archive
"$my_xdir" "$my_xabs"
462 my_oldobjs
="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
464 func_extract_archives_result
="$my_oldobjs"
466 # End of Shell function definitions
467 #####################################
470 eval std_shrext
=\"$shrext_cmds\"
474 # Parse our command line options once, thoroughly.
475 while test "$#" -gt 0
481 -*=*) optarg
=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
485 # If the previous option needs an argument, assign it.
486 if test -n "$prev"; then
489 execute_dlfiles
="$execute_dlfiles $arg"
493 preserve_args
="${preserve_args}=$arg"
495 # Check whether tagname contains only valid characters
498 $echo "$progname: invalid tag name: $tagname" 1>&2
505 # Don't test for the "default" C tag, as we know, it's there, but
506 # not specially marked.
509 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev
/null
; then
510 taglist
="$taglist $tagname"
511 # Evaluate the configuration.
512 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
514 $echo "$progname: ignoring unknown tag $tagname" 1>&2
529 # Have we seen a non-optional argument yet?
536 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
538 $echo "Copyright (C) 2005 Free Software Foundation, Inc."
539 $echo "This is free software; see the source for copying conditions. There is NO"
540 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
545 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
546 # Now print the configurations for the tags.
547 for tagname
in $taglist; do
548 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
554 $echo "$progname: enabling shell trace mode"
556 preserve_args
="$preserve_args $arg"
565 if test "$build_libtool_libs" = yes; then
566 $echo "enable shared libraries"
568 $echo "disable shared libraries"
570 if test "$build_old_libs" = yes; then
571 $echo "enable static libraries"
573 $echo "disable static libraries"
578 --finish) mode
="finish" ;;
580 --mode) prevopt
="--mode" prev
=mode
;;
581 --mode=*) mode
="$optarg" ;;
583 --preserve-dup-deps) duplicate_deps
="yes" ;;
587 preserve_args
="$preserve_args $arg"
593 preserve_args
="$preserve_args --tag"
596 set tag
"$optarg" ${1+"$@"}
599 preserve_args
="$preserve_args --tag"
608 $echo "$modename: unrecognized option \`$arg'" 1>&2
620 if test -n "$prevopt"; then
621 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
626 case $disable_libs in
630 build_libtool_libs
=no
634 build_old_libs
=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
638 # If this variable is set in any of the actions, the command in it
639 # will be execed at the end. This prevents here-documents from being
640 # left over by shells.
643 if test -z "$show_help"; then
645 # Infer the operation mode.
646 if test -z "$mode"; then
647 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
648 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
650 *cc | cc
* |
*++ | gcc
* |
*-gcc* | g
++* | xlc
*)
662 *db |
*dbx |
*strace |
*truss
)
672 # If we have no mode, but dlfiles were specified, then do execute mode.
673 test -n "$execute_dlfiles" && mode
=execute
675 # Just use the default operation mode.
676 if test -z "$mode"; then
677 if test -n "$nonopt"; then
678 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
680 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
687 # Only execute mode is allowed to have -dlopen flags.
688 if test -n "$execute_dlfiles" && test "$mode" != execute
; then
689 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
694 # Change the help message to a mode-specific one.
696 help="Try \`$modename --help --mode=$mode' for more information."
698 # These modes are in order of execution frequency so that they run quickly.
700 # libtool compile mode
702 modename
="$modename: compile"
703 # Get the compilation command and the source file.
705 srcfile
="$nonopt" # always keep a non-empty value in "srcfile"
716 # do not "continue". Instead, add this to base_compile
728 # Accept any command-line options.
731 if test -n "$libobj" ; then
732 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
739 -static |
-prefer-pic |
-prefer-non-pic)
750 arg_mode
=arg
# the next one goes into the "base_compile" arg list
751 continue # The current "srcfile" will either be retained or
752 ;; # replaced later. I would guess that would be a bug.
755 args
=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
757 save_ifs
="$IFS"; IFS
=','
761 # Double-quote args containing other shell metacharacters.
762 # Many Bourne shells cannot handle close brackets correctly
763 # in scan sets, so we specify it separately.
765 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
769 lastarg
="$lastarg $arg"
772 lastarg
=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
774 # Add the arguments to base_compile.
775 base_compile
="$base_compile $lastarg"
780 # Accept the current argument as the source file.
781 # The previous "srcfile" becomes the current argument.
788 esac # case $arg_mode
790 # Aesthetically quote the previous argument.
791 lastarg
=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
794 # Double-quote args containing other shell metacharacters.
795 # Many Bourne shells cannot handle close brackets correctly
796 # in scan sets, and some SunOS ksh mistreat backslash-escaping
797 # in scan sets (worked around with variable expansion),
798 # and furthermore cannot handle '|' '&' '(' ')' in scan sets
799 # at all, so we specify them separately.
800 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
801 lastarg
="\"$lastarg\""
805 base_compile
="$base_compile $lastarg"
810 $echo "$modename: you must specify an argument for -Xcompile"
814 $echo "$modename: you must specify a target with \`-o'" 1>&2
818 # Get the name of the library object.
819 [ -z "$libobj" ] && libobj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
823 # Recognize several different file suffixes.
824 # If the user specifies -o file.o, it is replaced with file.lo
834 *.class
) xform
=class
;;
839 *.java
) xform
=java
;;
842 libobj
=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
845 *.lo
) obj
=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
847 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
852 func_infer_tag
$base_compile
854 for arg
in $later; do
873 qlibobj
=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
875 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
876 qlibobj
="\"$qlibobj\"" ;;
878 test "X$libobj" != "X$qlibobj" \
879 && $echo "X$libobj" |
grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
880 && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
881 objname
=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
882 xdir
=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
883 if test "X$xdir" = "X$obj"; then
888 lobj
=${xdir}$objdir/$objname
890 if test -z "$base_compile"; then
891 $echo "$modename: you must specify a compilation command" 1>&2
896 # Delete any leftover library objects.
897 if test "$build_old_libs" = yes; then
898 removelist
="$obj $lobj $libobj ${libobj}T"
900 removelist
="$lobj $libobj ${libobj}T"
904 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
906 # On Cygwin there's no "real" PIC flag so we must build both object types
908 cygwin
* | mingw
* | pw32
* | os2
*)
912 if test "$pic_mode" = no
&& test "$deplibs_check_method" != pass_all
; then
913 # non-PIC code in shared libraries is not supported
917 # Calculate the filename of the output object if compiler does
918 # not support -o with -c
919 if test "$compiler_c_o" = no
; then
920 output_obj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.
${objext}
921 lockfile
="$output_obj.lock"
922 removelist
="$removelist $output_obj $lockfile"
923 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
930 # Lock this critical section if it is needed
931 # We use this script file to make the link, it avoids creating a new file
932 if test "$need_locks" = yes; then
933 until $run ln "$srcfile" "$lockfile" 2>/dev
/null
; do
934 $show "Waiting for $lockfile to be removed"
937 elif test "$need_locks" = warn
; then
938 if test -f "$lockfile"; then
940 *** ERROR, $lockfile exists and contains:
941 `cat $lockfile 2>/dev/null`
943 This indicates that another process is trying to use the same
944 temporary object file, and libtool could not work around it because
945 your compiler does not support \`-c' and \`-o' together. If you
946 repeat this compilation, it may succeed, by chance, but you had better
947 avoid parallel builds (make -j) in this platform, or get a better
953 $echo "$srcfile" > "$lockfile"
956 if test -n "$fix_srcfile_path"; then
957 eval srcfile
=\"$fix_srcfile_path\"
959 qsrcfile
=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
961 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
962 qsrcfile
="\"$qsrcfile\"" ;;
965 $run $rm "$libobj" "${libobj}T"
967 # Create a libtool object file (analogous to a ".la" file),
968 # but don't create it if we're doing a dry run.
969 test -z "$run" && cat > ${libobj}T
<<EOF
970 # $libobj - a libtool object file
971 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
973 # Please DO NOT delete this file!
974 # It is necessary for linking the library.
976 # Name of the PIC object.
979 # Only build a PIC object if we are building libtool libraries.
980 if test "$build_libtool_libs" = yes; then
981 # Without this assignment, base_compile gets emptied.
982 fbsd_hideous_sh_bug
=$base_compile
984 if test "$pic_mode" != no
; then
985 command="$base_compile $qsrcfile $pic_flag"
987 # Don't build PIC code
988 command="$base_compile $qsrcfile"
991 if test ! -d "${xdir}$objdir"; then
992 $show "$mkdir ${xdir}$objdir"
993 $run $mkdir ${xdir}$objdir
995 if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
1000 if test -z "$output_obj"; then
1001 # Place PIC objects in $objdir
1002 command="$command -o $lobj"
1005 $run $rm "$lobj" "$output_obj"
1008 if $run eval "$command"; then :
1010 test -n "$output_obj" && $run $rm $removelist
1014 if test "$need_locks" = warn
&&
1015 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1017 *** ERROR, $lockfile contains:
1018 `cat $lockfile 2>/dev/null`
1020 but it should contain:
1023 This indicates that another process is trying to use the same
1024 temporary object file, and libtool could not work around it because
1025 your compiler does not support \`-c' and \`-o' together. If you
1026 repeat this compilation, it may succeed, by chance, but you had better
1027 avoid parallel builds (make -j) in this platform, or get a better
1030 $run $rm $removelist
1034 # Just move the object if needed, then go on to compile the next one
1035 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1036 $show "$mv $output_obj $lobj"
1037 if $run $mv $output_obj $lobj; then :
1040 $run $rm $removelist
1045 # Append the name of the PIC object to the libtool object file.
1046 test -z "$run" && cat >> ${libobj}T
<<EOF
1047 pic_object='$objdir/$objname'
1051 # Allow error messages only from the first compilation.
1052 if test "$suppress_opt" = yes; then
1053 suppress_output
=' >/dev/null 2>&1'
1056 # No PIC object so indicate it doesn't exist in the libtool
1058 test -z "$run" && cat >> ${libobj}T
<<EOF
1064 # Only build a position-dependent object if we build old libraries.
1065 if test "$build_old_libs" = yes; then
1066 if test "$pic_mode" != yes; then
1067 # Don't build PIC code
1068 command="$base_compile $qsrcfile"
1070 command="$base_compile $qsrcfile $pic_flag"
1072 if test "$compiler_c_o" = yes; then
1073 command="$command -o $obj"
1076 # Suppress compiler output if we already did a PIC compilation.
1077 command="$command$suppress_output"
1078 $run $rm "$obj" "$output_obj"
1080 if $run eval "$command"; then :
1082 $run $rm $removelist
1086 if test "$need_locks" = warn
&&
1087 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1089 *** ERROR, $lockfile contains:
1090 `cat $lockfile 2>/dev/null`
1092 but it should contain:
1095 This indicates that another process is trying to use the same
1096 temporary object file, and libtool could not work around it because
1097 your compiler does not support \`-c' and \`-o' together. If you
1098 repeat this compilation, it may succeed, by chance, but you had better
1099 avoid parallel builds (make -j) in this platform, or get a better
1102 $run $rm $removelist
1106 # Just move the object if needed
1107 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1108 $show "$mv $output_obj $obj"
1109 if $run $mv $output_obj $obj; then :
1112 $run $rm $removelist
1117 # Append the name of the non-PIC object the libtool object file.
1118 # Only append if the libtool object file exists.
1119 test -z "$run" && cat >> ${libobj}T
<<EOF
1120 # Name of the non-PIC object.
1121 non_pic_object='$objname'
1125 # Append the name of the non-PIC object the libtool object file.
1126 # Only append if the libtool object file exists.
1127 test -z "$run" && cat >> ${libobj}T
<<EOF
1128 # Name of the non-PIC object.
1134 $run $mv "${libobj}T" "${libobj}"
1136 # Unlock the critical section if it was locked
1137 if test "$need_locks" != no
; then
1138 $run $rm "$lockfile"
1146 modename
="$modename: link"
1148 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1149 # It is impossible to link a dll without this setting, and
1150 # we shouldn't force the makefile maintainer to figure out
1151 # which system we are compiling for in order to pass an extra
1152 # flag for every libtool invocation.
1153 # allow_undefined=no
1155 # FIXME: Unfortunately, there are problems with the above when trying
1156 # to make a dll which has undefined symbols, in which case not
1157 # even a static library is built. For now, we need to specify
1158 # -no-undefined on the libtool link line when we can be certain
1159 # that all symbols are satisfied, otherwise we get a static library.
1166 libtool_args
="$nonopt"
1167 base_compile
="$nonopt $@"
1168 compile_command
="$nonopt"
1169 finalize_command
="$nonopt"
1182 lib_search_path
=`pwd`
1191 export_symbols_regex
=
1199 notinst_path
= # paths that contain not-installed libtool libraries
1200 precious_files_regex
=
1201 prefer_static_libs
=no
1214 func_infer_tag
$base_compile
1216 # We need to know -static, to get the right output filenames.
1220 -all-static |
-static)
1221 if test "X$arg" = "X-all-static"; then
1222 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1223 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1225 if test -n "$link_static_flag"; then
1226 dlopen_self
=$dlopen_self_static
1228 prefer_static_libs
=yes
1230 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1231 dlopen_self
=$dlopen_self_static
1233 prefer_static_libs
=built
1235 build_libtool_libs
=no
1242 # See if our shared archives depend on static archives.
1243 test -n "$old_archive_from_new_cmds" && build_old_libs
=yes
1245 # Go through the arguments, transforming them on the way.
1246 while test "$#" -gt 0; do
1250 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1251 qarg
=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1255 libtool_args
="$libtool_args $qarg"
1257 # If the previous option needs an argument, assign it.
1258 if test -n "$prev"; then
1261 compile_command
="$compile_command @OUTPUT@"
1262 finalize_command
="$finalize_command @OUTPUT@"
1268 if test "$preload" = no
; then
1269 # Add the symbol object into the linking commands.
1270 compile_command
="$compile_command @SYMFILE@"
1271 finalize_command
="$finalize_command @SYMFILE@"
1275 *.la |
*.lo
) ;; # We handle these cases below.
1277 if test "$dlself" = no
; then
1285 if test "$prev" = dlprefiles
; then
1287 elif test "$prev" = dlfiles
&& test "$dlopen_self" != yes; then
1297 if test "$prev" = dlfiles
; then
1298 dlfiles
="$dlfiles $arg"
1300 dlprefiles
="$dlprefiles $arg"
1308 export_symbols
="$arg"
1309 if test ! -f "$arg"; then
1310 $echo "$modename: symbol file \`$arg' does not exist"
1317 export_symbols_regex
="$arg"
1322 inst_prefix_dir
="$arg"
1327 precious_files_regex
="$arg"
1337 if test -f "$arg"; then
1340 for fil
in `cat $save_arg`
1342 # moreargs="$moreargs $fil"
1344 # A libtool-controlled object.
1346 # Check to see that this really is a libtool object.
1347 if (${SED} -e '2q' $arg |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1352 # If there is no directory component, then add one.
1354 */* |
*\\*) .
$arg ;;
1358 if test -z "$pic_object" || \
1359 test -z "$non_pic_object" ||
1360 test "$pic_object" = none
&& \
1361 test "$non_pic_object" = none
; then
1362 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1366 # Extract subdirectory from the argument.
1367 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1368 if test "X$xdir" = "X$arg"; then
1374 if test "$pic_object" != none
; then
1375 # Prepend the subdirectory the object is found in.
1376 pic_object
="$xdir$pic_object"
1378 if test "$prev" = dlfiles
; then
1379 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1380 dlfiles
="$dlfiles $pic_object"
1384 # If libtool objects are unsupported, then we need to preload.
1389 # CHECK ME: I think I busted this. -Ossama
1390 if test "$prev" = dlprefiles
; then
1391 # Preload the old-style object.
1392 dlprefiles
="$dlprefiles $pic_object"
1397 libobjs
="$libobjs $pic_object"
1402 if test "$non_pic_object" != none
; then
1403 # Prepend the subdirectory the object is found in.
1404 non_pic_object
="$xdir$non_pic_object"
1406 # A standard non-PIC object
1407 non_pic_objects
="$non_pic_objects $non_pic_object"
1408 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1409 arg
="$non_pic_object"
1412 # If the PIC object exists, use it instead.
1413 # $xdir was prepended to $pic_object above.
1414 non_pic_object
="$pic_object"
1415 non_pic_objects
="$non_pic_objects $non_pic_object"
1418 # Only an error if not doing a dry-run.
1419 if test -z "$run"; then
1420 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1425 # Extract subdirectory from the argument.
1426 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1427 if test "X$xdir" = "X$arg"; then
1433 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1434 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1435 libobjs
="$libobjs $pic_object"
1436 non_pic_objects
="$non_pic_objects $non_pic_object"
1441 $echo "$modename: link input file \`$save_arg' does not exist"
1449 # We need an absolute path.
1451 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1453 $echo "$modename: only absolute run-paths are allowed" 1>&2
1457 if test "$prev" = rpath
; then
1460 *) rpath
="$rpath $arg" ;;
1465 *) xrpath
="$xrpath $arg" ;;
1472 compiler_flags
="$compiler_flags $qarg"
1474 compile_command
="$compile_command $qarg"
1475 finalize_command
="$finalize_command $qarg"
1479 linker_flags
="$linker_flags $qarg"
1480 compiler_flags
="$compiler_flags $wl$qarg"
1482 compile_command
="$compile_command $wl$qarg"
1483 finalize_command
="$finalize_command $wl$qarg"
1487 linker_flags
="$linker_flags $qarg"
1488 compiler_flags
="$compiler_flags $qarg"
1490 compile_command
="$compile_command $qarg"
1491 finalize_command
="$finalize_command $qarg"
1499 darwin_framework|darwin_framework_skip
)
1500 test "$prev" = "darwin_framework" && compiler_flags
="$compiler_flags $arg"
1501 compile_command
="$compile_command $arg"
1502 finalize_command
="$finalize_command $arg"
1507 eval "$prev=\"\$arg\""
1512 fi # test -n "$prev"
1518 if test -n "$link_static_flag"; then
1519 compile_command
="$compile_command $link_static_flag"
1520 finalize_command
="$finalize_command $link_static_flag"
1526 # FIXME: remove this flag sometime in the future.
1527 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1551 -export-symbols |
-export-symbols-regex)
1552 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
1553 $echo "$modename: more than one -exported-symbols argument is not allowed"
1556 if test "X$arg" = "X-export-symbols"; then
1564 -framework|
-arch|
-isysroot)
1566 *" ${arg} ${1} "* | *" ${arg} ${1} "*)
1567 prev
=darwin_framework_skip
;;
1568 *) compiler_flags
="$compiler_flags $arg"
1569 prev
=darwin_framework
;;
1571 compile_command
="$compile_command $arg"
1572 finalize_command
="$finalize_command $arg"
1581 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1582 # so, if we see these flags be careful not to treat them like -L
1584 case $with_gcc/$host in
1585 no
/*-*-irix* |
/*-*-irix*)
1586 compile_command
="$compile_command $arg"
1587 finalize_command
="$finalize_command $arg"
1594 dir
=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1595 # We need an absolute path.
1597 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1599 absdir
=`cd "$dir" && pwd`
1600 if test -z "$absdir"; then
1601 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1603 notinst_path
="$notinst_path $dir"
1611 deplibs
="$deplibs -L$dir"
1612 lib_search_path
="$lib_search_path $dir"
1616 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1617 testbindir
=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
1618 case :$dllsearchpath: in
1620 *) dllsearchpath
="$dllsearchpath:$dir";;
1622 case :$dllsearchpath: in
1623 *":$testbindir:"*) ;;
1624 *) dllsearchpath
="$dllsearchpath:$testbindir";;
1632 if test "X$arg" = "X-lc" ||
test "X$arg" = "X-lm"; then
1634 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-beos*)
1635 # These systems don't actually have a C or math library (as such)
1639 # These systems don't actually have a C library (as such)
1640 test "X$arg" = "X-lc" && continue
1642 *-*-openbsd* |
*-*-freebsd* |
*-*-dragonfly*)
1643 # Do not include libc due to us having libc/libc_r.
1644 test "X$arg" = "X-lc" && continue
1646 *-*-rhapsody* |
*-*-darwin1.
[012])
1647 # Rhapsody C and math libraries are in the System framework
1648 deplibs
="$deplibs -framework System"
1651 *-*-sco3.2v5
* |
*-*-sco5v6*)
1652 # Causes problems with __ctype
1653 test "X$arg" = "X-lc" && continue
1655 *-*-sysv4.2uw2
* |
*-*-sysv5* |
*-*-unixware* |
*-*-OpenUNIX*)
1656 # Compiler inserts libc in the correct place for threads to work
1657 test "X$arg" = "X-lc" && continue
1660 elif test "X$arg" = "X-lc_r"; then
1662 *-*-openbsd* |
*-*-freebsd* |
*-*-dragonfly*)
1663 # Do not include libc_r directly, use -pthread flag.
1668 deplibs
="$deplibs $arg"
1672 # Tru64 UNIX uses -model [arg] to determine the layout of C++
1673 # classes, name mangling, and exception handling.
1675 compile_command
="$compile_command $arg"
1676 compiler_flags
="$compiler_flags $arg"
1677 finalize_command
="$finalize_command $arg"
1682 -mt|
-mthreads|
-kthread|
-Kthread|
-pthread|
-pthreads|
--thread-safe)
1683 compiler_flags
="$compiler_flags $arg"
1684 compile_command
="$compile_command $arg"
1685 finalize_command
="$finalize_command $arg"
1694 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
1695 # -r[0-9][0-9]* specifies the processor on the SGI compiler
1696 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
1697 # +DA*, +DD* enable 64-bit mode on the HP compiler
1698 # -q* pass through compiler args for the IBM compiler
1699 # -m* pass through architecture-specific compiler args for GCC
1700 # -m*, -t[45]*, -txscale* pass through architecture-specific
1701 # compiler args for GCC
1702 # -pg pass through profiling flag for GCC
1703 # @file GCC response files
1704 -64|
-mips[0-9]|
-r[0-9][0-9]*|
-xarch=*|
-xtarget=*|
+DA
*|
+DD
*|
-q*|
-m*|
-pg| \
1705 -t[45]*|
-txscale*|@
*)
1707 # Unknown arguments in both finalize_command and compile_command need
1708 # to be aesthetically quoted because they are evaled later.
1709 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1711 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1715 compile_command
="$compile_command $arg"
1716 finalize_command
="$finalize_command $arg"
1717 compiler_flags
="$compiler_flags $arg"
1733 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1734 # The PATH hackery in wrapper scripts is required on Windows
1735 # in order for the loader to find any dlls it needs.
1736 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1737 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1740 *) no_install
=yes ;;
1757 -precious-files-regex)
1778 dir
=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1779 # We need an absolute path.
1781 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1783 $echo "$modename: only absolute run-paths are allowed" 1>&2
1789 *) xrpath
="$xrpath $dir" ;;
1795 # The effects of -static are defined in a previous loop.
1796 # We used to do the same as -all-static on platforms that
1797 # didn't have a PIC flag, but the assumption that the effects
1798 # would be equivalent was wrong. It would break on at least
1799 # Digital Unix and AIX.
1819 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1821 save_ifs
="$IFS"; IFS
=','
1822 for flag
in $args; do
1825 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1830 compiler_flags
="$compiler_flags $flag"
1833 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1837 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1839 save_ifs
="$IFS"; IFS
=','
1840 for flag
in $args; do
1843 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1848 compiler_flags
="$compiler_flags $wl$flag"
1849 linker_flags
="$linker_flags $flag"
1852 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1870 # Some other compiler flag.
1872 # Unknown arguments in both finalize_command and compile_command need
1873 # to be aesthetically quoted because they are evaled later.
1874 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1876 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1883 # A standard object.
1888 # A libtool-controlled object.
1890 # Check to see that this really is a libtool object.
1891 if (${SED} -e '2q' $arg |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1896 # If there is no directory component, then add one.
1898 */* |
*\\*) .
$arg ;;
1902 if test -z "$pic_object" || \
1903 test -z "$non_pic_object" ||
1904 test "$pic_object" = none
&& \
1905 test "$non_pic_object" = none
; then
1906 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1910 # Extract subdirectory from the argument.
1911 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1912 if test "X$xdir" = "X$arg"; then
1918 if test "$pic_object" != none
; then
1919 # Prepend the subdirectory the object is found in.
1920 pic_object
="$xdir$pic_object"
1922 if test "$prev" = dlfiles
; then
1923 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1924 dlfiles
="$dlfiles $pic_object"
1928 # If libtool objects are unsupported, then we need to preload.
1933 # CHECK ME: I think I busted this. -Ossama
1934 if test "$prev" = dlprefiles
; then
1935 # Preload the old-style object.
1936 dlprefiles
="$dlprefiles $pic_object"
1941 libobjs
="$libobjs $pic_object"
1946 if test "$non_pic_object" != none
; then
1947 # Prepend the subdirectory the object is found in.
1948 non_pic_object
="$xdir$non_pic_object"
1950 # A standard non-PIC object
1951 non_pic_objects
="$non_pic_objects $non_pic_object"
1952 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1953 arg
="$non_pic_object"
1956 # If the PIC object exists, use it instead.
1957 # $xdir was prepended to $pic_object above.
1958 non_pic_object
="$pic_object"
1959 non_pic_objects
="$non_pic_objects $non_pic_object"
1962 # Only an error if not doing a dry-run.
1963 if test -z "$run"; then
1964 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1969 # Extract subdirectory from the argument.
1970 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1971 if test "X$xdir" = "X$arg"; then
1977 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1978 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1979 libobjs
="$libobjs $pic_object"
1980 non_pic_objects
="$non_pic_objects $non_pic_object"
1987 deplibs
="$deplibs $arg"
1988 old_deplibs
="$old_deplibs $arg"
1993 # A libtool-controlled library.
1995 if test "$prev" = dlfiles
; then
1996 # This library was specified with -dlopen.
1997 dlfiles
="$dlfiles $arg"
1999 elif test "$prev" = dlprefiles
; then
2000 # The library was specified with -dlpreopen.
2001 dlprefiles
="$dlprefiles $arg"
2004 deplibs
="$deplibs $arg"
2009 # Some other compiler argument.
2011 # Unknown arguments in both finalize_command and compile_command need
2012 # to be aesthetically quoted because they are evaled later.
2013 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2015 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2022 # Now actually substitute the argument into the commands.
2023 if test -n "$arg"; then
2024 compile_command
="$compile_command $arg"
2025 finalize_command
="$finalize_command $arg"
2027 done # argument parsing loop
2029 if test -n "$prev"; then
2030 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
2035 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
2036 eval arg
=\"$export_dynamic_flag_spec\"
2037 compile_command
="$compile_command $arg"
2038 finalize_command
="$finalize_command $arg"
2042 # calculate the name of the file, without its directory
2043 outputname
=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
2044 libobjs_save
="$libobjs"
2046 if test -n "$shlibpath_var"; then
2047 # get the directories listed in $shlibpath_var
2048 eval shlib_search_path
=\
`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
2052 eval sys_lib_search_path
=\"$sys_lib_search_path_spec\"
2053 eval sys_lib_dlsearch_path
=\"$sys_lib_dlsearch_path_spec\"
2055 output_objdir
=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2056 if test "X$output_objdir" = "X$output"; then
2057 output_objdir
="$objdir"
2059 output_objdir
="$output_objdir/$objdir"
2061 # Create the object directory.
2062 if test ! -d "$output_objdir"; then
2063 $show "$mkdir $output_objdir"
2064 $run $mkdir $output_objdir
2066 if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
2071 # Determine the type of output
2074 $echo "$modename: you must specify an output file" 1>&2
2078 *.
$libext) linkmode
=oldlib
;;
2079 *.lo |
*.
$objext) linkmode
=obj
;;
2080 *.la
) linkmode
=lib
;;
2081 *) linkmode
=prog
;; # Anything else should be a program.
2085 *cygwin
* |
*mingw
* |
*pw32
*)
2086 # don't eliminate duplications in $postdeps and $predeps
2087 duplicate_compiler_generated_deps
=yes
2090 duplicate_compiler_generated_deps
=$duplicate_deps
2096 # Find all interdependent deplibs by searching for libraries
2097 # that are linked more than once (e.g. -la -lb -la)
2098 for deplib
in $deplibs; do
2099 if test "X$duplicate_deps" = "Xyes" ; then
2101 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2104 libs
="$libs $deplib"
2107 if test "$linkmode" = lib
; then
2108 libs
="$predeps $libs $compiler_lib_search_path $postdeps"
2110 # Compute libraries that are listed more than once in $predeps
2111 # $postdeps and mark them as special (i.e., whose duplicates are
2112 # not to be eliminated).
2114 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
2115 for pre_post_dep
in $predeps $postdeps; do
2116 case "$pre_post_deps " in
2117 *" $pre_post_dep "*) specialdeplibs
="$specialdeplibs $pre_post_deps" ;;
2119 pre_post_deps
="$pre_post_deps $pre_post_dep"
2128 need_relink
=no
# whether we're linking any uninstalled libtool libraries
2129 notinst_deplibs
= # not-installed libtool libraries
2133 for file in $dlfiles $dlprefiles; do
2137 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2149 passes
="conv scan dlopen dlpreopen link"
2154 for pass
in $passes; do
2155 if test "$linkmode,$pass" = "lib,link" ||
2156 test "$linkmode,$pass" = "prog,scan"; then
2160 if test "$linkmode" = prog
; then
2162 dlopen
) libs
="$dlfiles" ;;
2163 dlpreopen
) libs
="$dlprefiles" ;;
2164 link
) libs
="$deplibs %DEPLIBS% $dependency_libs" ;;
2167 if test "$pass" = dlopen
; then
2168 # Collect dlpreopened libraries
2169 save_deplibs
="$deplibs"
2172 for deplib
in $libs; do
2176 -mt|
-mthreads|
-kthread|
-Kthread|
-pthread|
-pthreads|
--thread-safe)
2177 if test "$linkmode,$pass" = "prog,link"; then
2178 compile_deplibs
="$deplib $compile_deplibs"
2179 finalize_deplibs
="$deplib $finalize_deplibs"
2181 compiler_flags
="$compiler_flags $deplib"
2186 if test "$linkmode" != lib
&& test "$linkmode" != prog
; then
2187 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2190 name
=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2191 for searchdir
in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2192 for search_ext
in .la
$std_shrext .so .a
; do
2193 # Search the libtool library
2194 lib
="$searchdir/lib${name}${search_ext}"
2195 if test -f "$lib"; then
2196 if test "$search_ext" = ".la"; then
2205 if test "$found" != yes; then
2206 # deplib doesn't seem to be a libtool library
2207 if test "$linkmode,$pass" = "prog,link"; then
2208 compile_deplibs
="$deplib $compile_deplibs"
2209 finalize_deplibs
="$deplib $finalize_deplibs"
2211 deplibs
="$deplib $deplibs"
2212 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
2215 else # deplib is a libtool library
2216 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2217 # We need to do some special things here, and not later.
2218 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2219 case " $predeps $postdeps " in
2221 if (${SED} -e '2q' $lib |
2222 grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
2226 */* |
*\\*) .
$lib ;;
2229 for l
in $old_library $library_names; do
2232 if test "X$ll" = "X$old_library" ; then # only static version available
2234 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2235 test "X$ladir" = "X$lib" && ladir
="."
2236 lib
=$ladir/$old_library
2237 if test "$linkmode,$pass" = "prog,link"; then
2238 compile_deplibs
="$deplib $compile_deplibs"
2239 finalize_deplibs
="$deplib $finalize_deplibs"
2241 deplibs
="$deplib $deplibs"
2242 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
2256 deplibs
="$deplib $deplibs"
2257 test "$pass" = conv
&& continue
2258 newdependency_libs
="$deplib $newdependency_libs"
2259 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2262 if test "$pass" = conv
; then
2263 deplibs
="$deplib $deplibs"
2266 if test "$pass" = scan
; then
2267 deplibs
="$deplib $deplibs"
2269 compile_deplibs
="$deplib $compile_deplibs"
2270 finalize_deplibs
="$deplib $finalize_deplibs"
2272 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2275 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2281 if test "$pass" = link
; then
2282 dir
=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2283 # Make sure the xrpath contains only unique directories.
2286 *) xrpath
="$xrpath $dir" ;;
2289 deplibs
="$deplib $deplibs"
2292 *.la
) lib
="$deplib" ;;
2294 if test "$pass" = conv
; then
2295 deplibs
="$deplib $deplibs"
2301 case $deplibs_check_method in
2303 set dummy
$deplibs_check_method
2304 match_pattern_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2305 if eval $echo \"$deplib\" 2>/dev
/null \
2307 |
$EGREP "$match_pattern_regex" > /dev
/null
; then
2315 if test "$valid_a_lib" != yes; then
2317 $echo "*** Warning: Trying to link with static lib archive $deplib."
2318 $echo "*** I have the capability to make that library automatically link in when"
2319 $echo "*** you link to this library. But I can only do this if you have a"
2320 $echo "*** shared version of the library, which you do not appear to have"
2321 $echo "*** because the file extensions .$libext of this argument makes me believe"
2322 $echo "*** that it is just a static archive that I should not used here."
2325 $echo "*** Warning: Linking the shared library $output against the"
2326 $echo "*** static library $deplib is not portable!"
2327 deplibs
="$deplib $deplibs"
2332 if test "$pass" != link
; then
2333 deplibs
="$deplib $deplibs"
2335 compile_deplibs
="$deplib $compile_deplibs"
2336 finalize_deplibs
="$deplib $finalize_deplibs"
2343 if test "$pass" = conv
; then
2344 deplibs
="$deplib $deplibs"
2345 elif test "$linkmode" = prog
; then
2346 if test "$pass" = dlpreopen ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
2347 # If there is no dlopen support or we're linking statically,
2348 # we need to preload.
2349 newdlprefiles
="$newdlprefiles $deplib"
2350 compile_deplibs
="$deplib $compile_deplibs"
2351 finalize_deplibs
="$deplib $finalize_deplibs"
2353 newdlfiles
="$newdlfiles $deplib"
2363 if test "$found" = yes ||
test -f "$lib"; then :
2365 $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
2369 # Check to see that this really is a libtool archive.
2370 if (${SED} -e '2q' $lib |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
2372 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2376 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2377 test "X$ladir" = "X$lib" && ladir
="."
2385 # If the library was installed with an old release of libtool,
2386 # it will not redefine variables installed, or shouldnotlink
2394 */* |
*\\*) .
$lib ;;
2398 if test "$linkmode,$pass" = "lib,link" ||
2399 test "$linkmode,$pass" = "prog,scan" ||
2400 { test "$linkmode" != prog
&& test "$linkmode" != lib
; }; then
2401 test -n "$dlopen" && dlfiles
="$dlfiles $dlopen"
2402 test -n "$dlpreopen" && dlprefiles
="$dlprefiles $dlpreopen"
2405 if test "$pass" = conv
; then
2406 # Only check for convenience libraries
2407 deplibs
="$lib $deplibs"
2408 if test -z "$libdir"; then
2409 if test -z "$old_library"; then
2410 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2413 # It is a libtool convenience library, so add in its objects.
2414 convenience
="$convenience $ladir/$objdir/$old_library"
2415 old_convenience
="$old_convenience $ladir/$objdir/$old_library"
2417 for deplib
in $dependency_libs; do
2418 deplibs
="$deplib $deplibs"
2419 if test "X$duplicate_deps" = "Xyes" ; then
2420 case "$tmp_libs " in
2421 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2424 tmp_libs
="$tmp_libs $deplib"
2426 elif test "$linkmode" != prog
&& test "$linkmode" != lib
; then
2427 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2434 # Get the name of the library we link against.
2436 for l
in $old_library $library_names; do
2439 if test -z "$linklib"; then
2440 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2444 # This library was specified with -dlopen.
2445 if test "$pass" = dlopen
; then
2446 if test -z "$libdir"; then
2447 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2450 if test -z "$dlname" ||
2451 test "$dlopen_support" != yes ||
2452 test "$build_libtool_libs" = no
; then
2453 # If there is no dlname, no dlopen support or we're linking
2454 # statically, we need to preload. We also need to preload any
2455 # dependent libraries so libltdl's deplib preloader doesn't
2456 # bomb out in the load deplibs phase.
2457 dlprefiles
="$dlprefiles $lib $dependency_libs"
2459 newdlfiles
="$newdlfiles $lib"
2464 # We need an absolute path.
2466 [\\/]* |
[A-Za-z
]:[\\/]*) abs_ladir
="$ladir" ;;
2468 abs_ladir
=`cd "$ladir" && pwd`
2469 if test -z "$abs_ladir"; then
2470 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2471 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2476 laname
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2478 # Find the relevant object directory and library name.
2479 if test "X$installed" = Xyes
; then
2480 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2481 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2489 test "X$hardcode_automatic" = Xyes
&& avoidtemprpath
=yes
2491 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2494 # Remove this search path later
2495 notinst_path
="$notinst_path $abs_ladir"
2497 dir
="$ladir/$objdir"
2498 absdir
="$abs_ladir/$objdir"
2499 # Remove this search path later
2500 notinst_path
="$notinst_path $abs_ladir"
2502 fi # $installed = yes
2503 name
=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2505 # This library was specified with -dlpreopen.
2506 if test "$pass" = dlpreopen
; then
2507 if test -z "$libdir"; then
2508 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2511 # Prefer using a static library (so that no silly _DYNAMIC symbols
2512 # are required to link).
2513 if test -n "$old_library"; then
2514 newdlprefiles
="$newdlprefiles $dir/$old_library"
2515 # Otherwise, use the dlname, so that lt_dlopen finds it.
2516 elif test -n "$dlname"; then
2517 newdlprefiles
="$newdlprefiles $dir/$dlname"
2519 newdlprefiles
="$newdlprefiles $dir/$linklib"
2521 fi # $pass = dlpreopen
2523 if test -z "$libdir"; then
2524 # Link the convenience library
2525 if test "$linkmode" = lib
; then
2526 deplibs
="$dir/$old_library $deplibs"
2527 elif test "$linkmode,$pass" = "prog,link"; then
2528 compile_deplibs
="$dir/$old_library $compile_deplibs"
2529 finalize_deplibs
="$dir/$old_library $finalize_deplibs"
2531 deplibs
="$lib $deplibs" # used for prog,scan pass
2537 if test "$linkmode" = prog
&& test "$pass" != link
; then
2538 newlib_search_path
="$newlib_search_path $ladir"
2539 deplibs
="$lib $deplibs"
2542 if test "$link_all_deplibs" != no ||
test -z "$library_names" ||
2543 test "$build_libtool_libs" = no
; then
2548 for deplib
in $dependency_libs; do
2550 -L*) newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2552 # Need to link against all dependency_libs?
2553 if test "$linkalldeplibs" = yes; then
2554 deplibs
="$deplib $deplibs"
2556 # Need to hardcode shared library paths
2557 # or/and link against static libraries
2558 newdependency_libs
="$deplib $newdependency_libs"
2560 if test "X$duplicate_deps" = "Xyes" ; then
2561 case "$tmp_libs " in
2562 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2565 tmp_libs
="$tmp_libs $deplib"
2568 fi # $linkmode = prog...
2570 if test "$linkmode,$pass" = "prog,link"; then
2571 if test -n "$library_names" &&
2572 { test "$prefer_static_libs" = no ||
test -z "$old_library"; }; then
2573 # We need to hardcode the library path
2574 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2575 # Make sure the rpath contains only unique directories.
2576 case "$temp_rpath " in
2579 *) temp_rpath
="$temp_rpath $absdir" ;;
2583 # Hardcode the library path.
2584 # Skip directories that are in the system default run-time
2586 case " $sys_lib_dlsearch_path " in
2589 case "$compile_rpath " in
2591 *) compile_rpath
="$compile_rpath $absdir"
2595 case " $sys_lib_dlsearch_path " in
2598 case "$finalize_rpath " in
2600 *) finalize_rpath
="$finalize_rpath $libdir"
2604 fi # $linkmode,$pass = prog,link...
2606 if test "$alldeplibs" = yes &&
2607 { test "$deplibs_check_method" = pass_all ||
2608 { test "$build_libtool_libs" = yes &&
2609 test -n "$library_names"; }; }; then
2610 # We only need to search for static libraries
2615 link_static
=no
# Whether the deplib will be linked statically
2616 use_static_libs
=$prefer_static_libs
2617 if test "$use_static_libs" = built
&& test "$installed" = yes ; then
2620 if test -n "$library_names" &&
2621 { test "$use_static_libs" = no ||
test -z "$old_library"; }; then
2622 if test "$installed" = no
; then
2623 notinst_deplibs
="$notinst_deplibs $lib"
2626 # This is a shared library
2628 # Warn about portability, can't link against -module's on
2629 # some systems (darwin)
2630 if test "$shouldnotlink" = yes && test "$pass" = link
; then
2632 if test "$linkmode" = prog
; then
2633 $echo "*** Warning: Linking the executable $output against the loadable module"
2635 $echo "*** Warning: Linking the shared library $output against the loadable module"
2637 $echo "*** $linklib is not portable!"
2639 if test "$linkmode" = lib
&&
2640 test "$hardcode_into_libs" = yes; then
2641 # Hardcode the library path.
2642 # Skip directories that are in the system default run-time
2644 case " $sys_lib_dlsearch_path " in
2647 case "$compile_rpath " in
2649 *) compile_rpath
="$compile_rpath $absdir"
2653 case " $sys_lib_dlsearch_path " in
2656 case "$finalize_rpath " in
2658 *) finalize_rpath
="$finalize_rpath $libdir"
2664 if test -n "$old_archive_from_expsyms_cmds"; then
2665 # figure out the soname
2666 set dummy
$library_names
2669 libname
=`eval \\$echo \"$libname_spec\"`
2670 # use dlname if we got it. it's perfectly good, no?
2671 if test -n "$dlname"; then
2673 elif test -n "$soname_spec"; then
2677 major
=`expr $current - $age`
2681 eval soname
=\"$soname_spec\"
2686 # Make a new name for the extract_expsyms_cmds to use
2688 soname
=`$echo $soroot | ${SED} -e 's/^.*\///'`
2689 newlib
="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2691 # If the library has no export list, then create one now
2692 if test -f "$output_objdir/$soname-def"; then :
2694 $show "extracting exported symbol list from \`$soname'"
2695 save_ifs
="$IFS"; IFS
='~'
2696 cmds
=$extract_expsyms_cmds
2697 for cmd
in $cmds; do
2701 $run eval "$cmd" ||
exit $?
2707 if test -f "$output_objdir/$newlib"; then :; else
2708 $show "generating import library for \`$soname'"
2709 save_ifs
="$IFS"; IFS
='~'
2710 cmds
=$old_archive_from_expsyms_cmds
2711 for cmd
in $cmds; do
2715 $run eval "$cmd" ||
exit $?
2719 # make sure the library variables are pointing to the new library
2722 fi # test -n "$old_archive_from_expsyms_cmds"
2724 if test "$linkmode" = prog ||
test "$mode" != relink
; then
2729 case $hardcode_action in
2730 immediate | unsupported
)
2731 if test "$hardcode_direct" = no
; then
2734 *-*-sco3.2v5.0.
[024]*) add_dir
="-L$dir" ;;
2735 *-*-sysv4*uw2
*) add_dir
="-L$dir" ;;
2736 *-*-sysv5OpenUNIX* |
*-*-sysv5UnixWare7.
[01].
[10]* | \
2737 *-*-unixware7*) add_dir
="-L$dir" ;;
2739 # if the lib is a module then we can not link against
2740 # it, someone is ignoring the new warnings I added
2741 if /usr
/bin
/file -L $add 2> /dev
/null |
2742 $EGREP ": [^:]* bundle" >/dev
/null
; then
2743 $echo "** Warning, lib $linklib is a module, not a shared library"
2744 if test -z "$old_library" ; then
2746 $echo "** And there doesn't seem to be a static archive available"
2747 $echo "** The link will probably fail, sorry"
2749 add
="$dir/$old_library"
2753 elif test "$hardcode_minus_L" = no
; then
2755 *-*-sunos*) add_shlibpath
="$dir" ;;
2759 elif test "$hardcode_shlibpath_var" = no
; then
2760 add_shlibpath
="$dir"
2767 if test "$hardcode_direct" = yes; then
2769 elif test "$hardcode_minus_L" = yes; then
2771 # Try looking first in the location we're being installed to.
2772 if test -n "$inst_prefix_dir"; then
2775 add_dir
="$add_dir -L$inst_prefix_dir$libdir"
2780 elif test "$hardcode_shlibpath_var" = yes; then
2781 add_shlibpath
="$dir"
2790 if test "$lib_linked" != yes; then
2791 $echo "$modename: configuration error: unsupported hardcode properties"
2795 if test -n "$add_shlibpath"; then
2796 case :$compile_shlibpath: in
2797 *":$add_shlibpath:"*) ;;
2798 *) compile_shlibpath
="$compile_shlibpath$add_shlibpath:" ;;
2801 if test "$linkmode" = prog
; then
2802 test -n "$add_dir" && compile_deplibs
="$add_dir $compile_deplibs"
2803 test -n "$add" && compile_deplibs
="$add $compile_deplibs"
2805 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2806 test -n "$add" && deplibs
="$add $deplibs"
2807 if test "$hardcode_direct" != yes && \
2808 test "$hardcode_minus_L" != yes && \
2809 test "$hardcode_shlibpath_var" = yes; then
2810 case :$finalize_shlibpath: in
2812 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2818 if test "$linkmode" = prog ||
test "$mode" = relink
; then
2822 # Finalize command for both is simple: just hardcode it.
2823 if test "$hardcode_direct" = yes; then
2824 add
="$libdir/$linklib"
2825 elif test "$hardcode_minus_L" = yes; then
2828 elif test "$hardcode_shlibpath_var" = yes; then
2829 case :$finalize_shlibpath: in
2831 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2834 elif test "$hardcode_automatic" = yes; then
2835 if test -n "$inst_prefix_dir" &&
2836 test -f "$inst_prefix_dir$libdir/$linklib" ; then
2837 add
="$inst_prefix_dir$libdir/$linklib"
2839 add
="$libdir/$linklib"
2842 # We cannot seem to hardcode it, guess we'll fake it.
2844 # Try looking first in the location we're being installed to.
2845 if test -n "$inst_prefix_dir"; then
2848 add_dir
="$add_dir -L$inst_prefix_dir$libdir"
2855 if test "$linkmode" = prog
; then
2856 test -n "$add_dir" && finalize_deplibs
="$add_dir $finalize_deplibs"
2857 test -n "$add" && finalize_deplibs
="$add $finalize_deplibs"
2859 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2860 test -n "$add" && deplibs
="$add $deplibs"
2863 elif test "$linkmode" = prog
; then
2864 # Here we assume that one of hardcode_direct or hardcode_minus_L
2865 # is not unsupported. This is valid on all known static and
2867 if test "$hardcode_direct" != unsupported
; then
2868 test -n "$old_library" && linklib
="$old_library"
2869 compile_deplibs
="$dir/$linklib $compile_deplibs"
2870 finalize_deplibs
="$dir/$linklib $finalize_deplibs"
2872 compile_deplibs
="-l$name -L$dir $compile_deplibs"
2873 finalize_deplibs
="-l$name -L$dir $finalize_deplibs"
2875 elif test "$build_libtool_libs" = yes; then
2876 # Not a shared library
2877 if test "$deplibs_check_method" != pass_all
; then
2878 # We're trying link a shared library against a static one
2879 # but the system doesn't support it.
2881 # Just print a warning and add the library to dependency_libs so
2882 # that the program can be linked against the static library.
2884 $echo "*** Warning: This system can not link to static lib archive $lib."
2885 $echo "*** I have the capability to make that library automatically link in when"
2886 $echo "*** you link to this library. But I can only do this if you have a"
2887 $echo "*** shared version of the library, which you do not appear to have."
2888 if test "$module" = yes; then
2889 $echo "*** But as you try to build a module library, libtool will still create "
2890 $echo "*** a static module, that should work as long as the dlopening application"
2891 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2892 if test -z "$global_symbol_pipe"; then
2894 $echo "*** However, this would only work if libtool was able to extract symbol"
2895 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2896 $echo "*** not find such a program. So, this module is probably useless."
2897 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2899 if test "$build_old_libs" = no
; then
2900 build_libtool_libs
=module
2903 build_libtool_libs
=no
2907 deplibs
="$dir/$old_library $deplibs"
2910 fi # link shared/static library?
2912 if test "$linkmode" = lib
; then
2913 if test -n "$dependency_libs" &&
2914 { test "$hardcode_into_libs" != yes ||
2915 test "$build_old_libs" = yes ||
2916 test "$link_static" = yes; }; then
2917 # Extract -R from dependency_libs
2919 for libdir
in $dependency_libs; do
2921 -R*) temp_xrpath
=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2923 *" $temp_xrpath "*) ;;
2924 *) xrpath
="$xrpath $temp_xrpath";;
2926 *) temp_deplibs
="$temp_deplibs $libdir";;
2929 dependency_libs
="$temp_deplibs"
2932 newlib_search_path
="$newlib_search_path $absdir"
2933 # Link against this library
2934 test "$link_static" = no
&& newdependency_libs
="$abs_ladir/$laname $newdependency_libs"
2935 # ... and its dependency_libs
2937 for deplib
in $dependency_libs; do
2938 newdependency_libs
="$deplib $newdependency_libs"
2939 if test "X$duplicate_deps" = "Xyes" ; then
2940 case "$tmp_libs " in
2941 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2944 tmp_libs
="$tmp_libs $deplib"
2947 if test "$link_all_deplibs" != no
; then
2948 # Add the search paths of all dependency libraries
2949 for deplib
in $dependency_libs; do
2951 -L*) path
="$deplib" ;;
2953 dir
=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2954 test "X$dir" = "X$deplib" && dir
="."
2955 # We need an absolute path.
2957 [\\/]* |
[A-Za-z
]:[\\/]*) absdir
="$dir" ;;
2959 absdir
=`cd "$dir" && pwd`
2960 if test -z "$absdir"; then
2961 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2966 if grep "^installed=no" $deplib > /dev
/null
; then
2967 path
="$absdir/$objdir"
2969 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2970 if test -z "$libdir"; then
2971 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2974 if test "$absdir" != "$libdir"; then
2975 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2982 # we do not want to link against static libs,
2983 # but need to link against shared
2984 eval deplibrary_names
=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2985 if test -n "$deplibrary_names" ; then
2986 for tmp
in $deplibrary_names ; do
2989 if test -f "$path/$depdepl" ; then
2990 depdepl
="$path/$depdepl"
2992 # do not add paths which are already there
2993 case " $newlib_search_path " in
2995 *) newlib_search_path
="$newlib_search_path $path";;
3008 # Again, we only want to link against shared libraries
3009 eval tmp_libs
=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
3010 for tmp
in $newlib_search_path ; do
3011 if test -f "$tmp/lib$tmp_libs.dylib" ; then
3012 eval depdepl
="$tmp/lib$tmp_libs.dylib"
3023 case " $deplibs " in
3025 *) deplibs
="$path $deplibs" ;;
3027 case " $deplibs " in
3029 *) deplibs
="$depdepl $deplibs" ;;
3032 fi # link_all_deplibs != no
3034 done # for deplib in $libs
3035 dependency_libs
="$newdependency_libs"
3036 if test "$pass" = dlpreopen
; then
3037 # Link the dlpreopened libraries before other libraries
3038 for deplib
in $save_deplibs; do
3039 deplibs
="$deplib $deplibs"
3042 if test "$pass" != dlopen
; then
3043 if test "$pass" != conv
; then
3044 # Make sure lib_search_path contains only unique directories.
3046 for dir
in $newlib_search_path; do
3047 case "$lib_search_path " in
3049 *) lib_search_path
="$lib_search_path $dir" ;;
3055 if test "$linkmode,$pass" != "prog,link"; then
3058 vars
="compile_deplibs finalize_deplibs"
3060 for var
in $vars dependency_libs
; do
3061 # Add libraries to $var in reverse order
3062 eval tmp_libs
=\"\$
$var\"
3064 for deplib
in $tmp_libs; do
3065 # FIXME: Pedantically, this is the right thing to do, so
3066 # that some nasty dependency loop isn't accidentally
3068 #new_libs="$deplib $new_libs"
3069 # Pragmatically, this seems to cause very few problems in
3072 -L*) new_libs
="$deplib $new_libs" ;;
3075 # And here is the reason: when a library appears more
3076 # than once as an explicit dependence of a library, or
3077 # is implicitly linked in more than once by the
3078 # compiler, it is considered special, and multiple
3079 # occurrences thereof are not removed. Compare this
3080 # with having the same library being listed as a
3081 # dependency of multiple other libraries: in this case,
3082 # we know (pedantically, we assume) the library does not
3083 # need to be listed more than once, so we keep only the
3084 # last copy. This is not always right, but it is rare
3085 # enough that we require users that really mean to play
3086 # such unportable linking tricks to link the library
3087 # using -Wl,-lname, so that libtool does not consider it
3088 # for duplicate removal.
3089 case " $specialdeplibs " in
3090 *" $deplib "*) new_libs
="$deplib $new_libs" ;;
3092 case " $new_libs " in
3094 *) new_libs
="$deplib $new_libs" ;;
3102 for deplib
in $new_libs; do
3105 case " $tmp_libs " in
3107 *) tmp_libs
="$tmp_libs $deplib" ;;
3110 *) tmp_libs
="$tmp_libs $deplib" ;;
3113 eval $var=\"$tmp_libs\"
3116 # Last step: remove runtime libs from dependency_libs
3117 # (they stay in deplibs)
3119 for i
in $dependency_libs ; do
3120 case " $predeps $postdeps $compiler_lib_search_path " in
3125 if test -n "$i" ; then
3126 tmp_libs
="$tmp_libs $i"
3129 dependency_libs
=$tmp_libs
3131 if test "$linkmode" = prog
; then
3132 dlfiles
="$newdlfiles"
3133 dlprefiles
="$newdlprefiles"
3138 if test -n "$deplibs"; then
3139 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
3142 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
3143 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3146 if test -n "$rpath"; then
3147 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3150 if test -n "$xrpath"; then
3151 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3154 if test -n "$vinfo"; then
3155 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3158 if test -n "$release"; then
3159 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3162 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
3163 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3166 # Now set the variables for building old libraries.
3167 build_libtool_libs
=no
3169 objs
="$objs$old_deplibs"
3173 # Make sure we only generate libraries of the form `libNAME.la'.
3176 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3177 eval shared_ext
=\"$shrext_cmds\"
3178 eval libname
=\"$libname_spec\"
3181 if test "$module" = no
; then
3182 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3186 if test "$need_lib_prefix" != no
; then
3187 # Add the "lib" prefix for modules if required
3188 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3189 eval shared_ext
=\"$shrext_cmds\"
3190 eval libname
=\"$libname_spec\"
3192 libname
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3197 if test -n "$objs"; then
3198 if test "$deplibs_check_method" != pass_all
; then
3199 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3203 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3204 $echo "*** objects $objs is not portable!"
3205 libobjs
="$libobjs $objs"
3209 if test "$dlself" != no
; then
3210 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3214 if test "$#" -gt 2; then
3215 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3220 if test -z "$rpath"; then
3221 if test "$build_libtool_libs" = yes; then
3222 # Building a libtool convenience library.
3223 # Some compilers have problems with a `.al' extension so
3224 # convenience libraries should have the same extension an
3225 # archive normally would.
3226 oldlibs
="$output_objdir/$libname.$libext $oldlibs"
3227 build_libtool_libs
=convenience
3231 if test -n "$vinfo"; then
3232 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3235 if test -n "$release"; then
3236 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3240 # Parse the version information argument.
3241 save_ifs
="$IFS"; IFS
=':'
3242 set dummy
$vinfo 0 0 0
3245 if test -n "$8"; then
3246 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3251 # convert absolute version numbers to libtool ages
3252 # this retains compatibility with .la files and attempts
3253 # to make the code below a bit more comprehensible
3255 case $vinfo_number in
3259 number_revision
="$4"
3261 # There are really only two kinds -- those that
3262 # use the current revision as the major version
3263 # and those that subtract age and use age as
3264 # a minor version. But, then there is irix
3265 # which has an extra 1 added just for fun
3267 case $version_type in
3268 darwin|linux|osf|windows
)
3269 current
=`expr $number_major + $number_minor`
3271 revision
="$number_revision"
3273 freebsd-aout|freebsd-elf|sunos
)
3274 current
="$number_major"
3275 revision
="$number_minor"
3279 current
=`expr $number_major + $number_minor - 1`
3281 revision
="$number_minor"
3292 # Check that each of the things are valid numbers.
3294 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]) ;;
3296 $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3297 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3303 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]) ;;
3305 $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3306 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3312 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]) ;;
3314 $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3315 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3320 if test "$age" -gt "$current"; then
3321 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3322 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3326 # Calculate the version variables.
3330 case $version_type in
3334 # Like Linux, but with the current version available in
3335 # verstring for coding it into the library header
3336 major
=.
`expr $current - $age`
3337 versuffix
="$major.$age.$revision"
3338 # Darwin ld doesn't like 0 for these options...
3339 minor_current
=`expr $current + 1`
3340 verstring
="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3345 versuffix
=".$current.$revision";
3350 versuffix
=".$current";
3354 major
=`expr $current - $age + 1`
3356 case $version_type in
3357 nonstopux
) verstring_prefix
=nonstopux
;;
3358 *) verstring_prefix
=sgi
;;
3360 verstring
="$verstring_prefix$major.$revision"
3362 # Add in all the interfaces that we are compatible with.
3364 while test "$loop" -ne 0; do
3365 iface
=`expr $revision - $loop`
3366 loop
=`expr $loop - 1`
3367 verstring
="$verstring_prefix$major.$iface:$verstring"
3370 # Before this point, $major must not contain `.'.
3372 versuffix
="$major.$revision"
3376 major
=.
`expr $current - $age`
3377 versuffix
="$major.$age.$revision"
3381 major
=.
`expr $current - $age`
3382 versuffix
=".$current.$age.$revision"
3383 verstring
="$current.$age.$revision"
3385 # Add in all the interfaces that we are compatible with.
3387 while test "$loop" -ne 0; do
3388 iface
=`expr $current - $loop`
3389 loop
=`expr $loop - 1`
3390 verstring
="$verstring:${iface}.0"
3393 # Make executables depend on our current version.
3394 verstring
="$verstring:${current}.0"
3399 versuffix
=".$current.$revision"
3403 # Use '-' rather than '.', since we only want one
3404 # extension on DOS 8.3 filesystems.
3405 major
=`expr $current - $age`
3410 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3411 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3416 # Clear the version info if we defaulted, and they specified a release.
3417 if test -z "$vinfo" && test -n "$release"; then
3419 case $version_type in
3421 # we can't check for "0.0" in archive_cmds due to quoting
3422 # problems, so we reset it completely
3429 if test "$need_version" = no
; then
3436 # Remove version info from name if versioning should be avoided
3437 if test "$avoid_version" = yes && test "$need_version" = no
; then
3443 # Check to see if the archive will have undefined symbols.
3444 if test "$allow_undefined" = yes; then
3445 if test "$allow_undefined_flag" = unsupported
; then
3446 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3447 build_libtool_libs
=no
3451 # Don't allow undefined symbols.
3452 allow_undefined_flag
="$no_undefined_flag"
3456 if test "$mode" != relink
; then
3457 # Remove our outputs, but don't remove object files since they
3458 # may have been created when compiling PIC objects.
3460 tempremovelist
=`$echo "$output_objdir/*"`
3461 for p
in $tempremovelist; do
3465 $output_objdir/$outputname |
$output_objdir/$libname.
* |
$output_objdir/${libname}${release}.
*)
3466 if test "X$precious_files_regex" != "X"; then
3467 if echo $p |
$EGREP -e "$precious_files_regex" >/dev
/null
2>&1
3472 removelist
="$removelist $p"
3477 if test -n "$removelist"; then
3478 $show "${rm}r $removelist"
3479 $run ${rm}r
$removelist
3483 # Now set the variables for building old libraries.
3484 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience
; then
3485 oldlibs
="$oldlibs $output_objdir/$libname.$libext"
3487 # Transform .lo files to .o files.
3488 oldobjs
="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3491 # Eliminate all temporary directories.
3492 for path
in $notinst_path; do
3493 lib_search_path
=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
3494 deplibs
=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
3495 dependency_libs
=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
3498 if test -n "$xrpath"; then
3499 # If the user specified any rpath flags, then add them.
3501 for libdir
in $xrpath; do
3502 temp_xrpath
="$temp_xrpath -R$libdir"
3503 case "$finalize_rpath " in
3505 *) finalize_rpath
="$finalize_rpath $libdir" ;;
3508 if test "$hardcode_into_libs" != yes ||
test "$build_old_libs" = yes; then
3509 dependency_libs
="$temp_xrpath $dependency_libs"
3513 # Make sure dlfiles contains only unique files that won't be dlpreopened
3514 old_dlfiles
="$dlfiles"
3516 for lib
in $old_dlfiles; do
3517 case " $dlprefiles $dlfiles " in
3519 *) dlfiles
="$dlfiles $lib" ;;
3523 # Make sure dlprefiles contains only unique files
3524 old_dlprefiles
="$dlprefiles"
3526 for lib
in $old_dlprefiles; do
3527 case "$dlprefiles " in
3529 *) dlprefiles
="$dlprefiles $lib" ;;
3533 if test "$build_libtool_libs" = yes; then
3534 if test -n "$rpath"; then
3536 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2* |
*-*-beos*)
3537 # these systems don't actually have a c library (as such)!
3539 *-*-rhapsody* |
*-*-darwin1.
[012])
3540 # Rhapsody C library is in the System framework
3541 deplibs
="$deplibs -framework System"
3544 # Don't link with libc until the a.out ld.so is fixed.
3546 *-*-openbsd* |
*-*-freebsd* |
*-*-dragonfly*)
3547 # Do not include libc due to us having libc/libc_r.
3549 *-*-sco3.2v5
* |
*-*-sco5v6*)
3550 # Causes problems with __ctype
3552 *-*-sysv4.2uw2
* |
*-*-sysv5* |
*-*-unixware* |
*-*-OpenUNIX*)
3553 # Compiler inserts libc in the correct place for threads to work
3556 # Add libc to deplibs on all other systems if necessary.
3557 if test "$build_libtool_need_lc" = "yes"; then
3558 deplibs
="$deplibs -lc"
3564 # Transform deplibs into only deplibs that can be linked in shared.
3566 libname_save
=$libname
3567 release_save
=$release
3568 versuffix_save
=$versuffix
3570 # I'm not sure if I'm treating the release correctly. I think
3571 # release should show up in the -l (ie -lgmp5) so we don't want to
3572 # add it in twice. Is that correct?
3578 case $deplibs_check_method in
3580 # Don't check for shared/static. Everything works.
3581 # This might be a little naive. We might want to check
3582 # whether the library exists or not. But this is on
3583 # osf3 & osf4 and I'm not really sure... Just
3584 # implementing what was already the behavior.
3588 # This code stresses the "libraries are programs" paradigm to its
3589 # limits. Maybe even breaks it. We compile a program, linking it
3590 # against the deplibs as a proxy for the library. Then we can check
3591 # whether they linked in statically or dynamically with ldd.
3593 cat > conftest.c
<<EOF
3594 int main() { return 0; }
3597 $LTCC $LTCFLAGS -o conftest conftest.c
$deplibs
3598 if test "$?" -eq 0 ; then
3599 ldd_output
=`ldd conftest`
3600 for i
in $deplibs; do
3601 name
=`expr $i : '-l\(.*\)'`
3602 # If $name is empty we are operating on a -L argument.
3603 if test "$name" != "" && test "$name" -ne "0"; then
3604 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3605 case " $predeps $postdeps " in
3607 newdeplibs
="$newdeplibs $i"
3612 if test -n "$i" ; then
3613 libname
=`eval \\$echo \"$libname_spec\"`
3614 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
3615 set dummy
$deplib_matches
3617 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3618 newdeplibs
="$newdeplibs $i"
3622 $echo "*** Warning: dynamic linker does not accept needed library $i."
3623 $echo "*** I have the capability to make that library automatically link in when"
3624 $echo "*** you link to this library. But I can only do this if you have a"
3625 $echo "*** shared version of the library, which I believe you do not have"
3626 $echo "*** because a test_compile did reveal that the linker did not use it for"
3627 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3631 newdeplibs
="$newdeplibs $i"
3635 # Error occurred in the first compile. Let's try to salvage
3636 # the situation: Compile a separate program for each library.
3637 for i
in $deplibs; do
3638 name
=`expr $i : '-l\(.*\)'`
3639 # If $name is empty we are operating on a -L argument.
3640 if test "$name" != "" && test "$name" != "0"; then
3642 $LTCC $LTCFLAGS -o conftest conftest.c
$i
3644 if test "$?" -eq 0 ; then
3645 ldd_output
=`ldd conftest`
3646 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3647 case " $predeps $postdeps " in
3649 newdeplibs
="$newdeplibs $i"
3654 if test -n "$i" ; then
3655 libname
=`eval \\$echo \"$libname_spec\"`
3656 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
3657 set dummy
$deplib_matches
3659 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3660 newdeplibs
="$newdeplibs $i"
3664 $echo "*** Warning: dynamic linker does not accept needed library $i."
3665 $echo "*** I have the capability to make that library automatically link in when"
3666 $echo "*** you link to this library. But I can only do this if you have a"
3667 $echo "*** shared version of the library, which you do not appear to have"
3668 $echo "*** because a test_compile did reveal that the linker did not use this one"
3669 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3675 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3676 $echo "*** make it link in! You will probably need to install it or some"
3677 $echo "*** library that it depends on before this library will be fully"
3678 $echo "*** functional. Installing it before continuing would be even better."
3681 newdeplibs
="$newdeplibs $i"
3687 set dummy
$deplibs_check_method
3688 file_magic_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3689 for a_deplib
in $deplibs; do
3690 name
=`expr $a_deplib : '-l\(.*\)'`
3691 # If $name is empty we are operating on a -L argument.
3692 if test "$name" != "" && test "$name" != "0"; then
3693 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3694 case " $predeps $postdeps " in
3696 newdeplibs
="$newdeplibs $a_deplib"
3701 if test -n "$a_deplib" ; then
3702 libname
=`eval \\$echo \"$libname_spec\"`
3703 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3704 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
3705 for potent_lib
in $potential_libs; do
3706 # Follow soft links.
3707 if ls -lLd "$potent_lib" 2>/dev
/null \
3708 |
grep " -> " >/dev
/null
; then
3711 # The statement above tries to avoid entering an
3712 # endless loop below, in case of cyclic links.
3713 # We might still enter an endless loop, since a link
3714 # loop can be closed while we follow links,
3716 potlib
="$potent_lib"
3717 while test -h "$potlib" 2>/dev
/null
; do
3718 potliblink
=`ls -ld $potlib | ${SED} 's/.* -> //'`
3720 [\\/]* |
[A-Za-z
]:[\\/]*) potlib
="$potliblink";;
3721 *) potlib
=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3724 # It is ok to link against an archive when
3725 # building a shared library.
3726 if $AR -t $potlib > /dev
/null
2>&1; then
3727 newdeplibs
="$newdeplibs $a_deplib"
3731 if eval $file_magic_cmd \"\
$potlib\" 2>/dev
/null \
3733 |
$EGREP "$file_magic_regex" > /dev
/null
; then
3734 newdeplibs
="$newdeplibs $a_deplib"
3741 if test -n "$a_deplib" ; then
3744 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3745 $echo "*** I have the capability to make that library automatically link in when"
3746 $echo "*** you link to this library. But I can only do this if you have a"
3747 $echo "*** shared version of the library, which you do not appear to have"
3748 $echo "*** because I did check the linker path looking for a file starting"
3749 if test -z "$potlib" ; then
3750 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3752 $echo "*** with $libname and none of the candidates passed a file format test"
3753 $echo "*** using a file magic. Last file checked: $potlib"
3757 # Add a -L argument.
3758 newdeplibs
="$newdeplibs $a_deplib"
3760 done # Gone through all deplibs.
3763 set dummy
$deplibs_check_method
3764 match_pattern_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3765 for a_deplib
in $deplibs; do
3766 name
=`expr $a_deplib : '-l\(.*\)'`
3767 # If $name is empty we are operating on a -L argument.
3768 if test -n "$name" && test "$name" != "0"; then
3769 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3770 case " $predeps $postdeps " in
3772 newdeplibs
="$newdeplibs $a_deplib"
3777 if test -n "$a_deplib" ; then
3778 libname
=`eval \\$echo \"$libname_spec\"`
3779 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3780 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
3781 for potent_lib
in $potential_libs; do
3782 potlib
="$potent_lib" # see symlink-check above in file_magic test
3783 if eval $echo \"$potent_lib\" 2>/dev
/null \
3785 |
$EGREP "$match_pattern_regex" > /dev
/null
; then
3786 newdeplibs
="$newdeplibs $a_deplib"
3793 if test -n "$a_deplib" ; then
3796 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3797 $echo "*** I have the capability to make that library automatically link in when"
3798 $echo "*** you link to this library. But I can only do this if you have a"
3799 $echo "*** shared version of the library, which you do not appear to have"
3800 $echo "*** because I did check the linker path looking for a file starting"
3801 if test -z "$potlib" ; then
3802 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3804 $echo "*** with $libname and none of the candidates passed a file format test"
3805 $echo "*** using a regex pattern. Last file checked: $potlib"
3809 # Add a -L argument.
3810 newdeplibs
="$newdeplibs $a_deplib"
3812 done # Gone through all deplibs.
3816 tmp_deplibs
=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3817 -e 's/ -[LR][^ ]*//g'`
3818 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3819 for i
in $predeps $postdeps ; do
3820 # can't use Xsed below, because $i might contain '/'
3821 tmp_deplibs
=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3824 if $echo "X $tmp_deplibs" |
$Xsed -e 's/[ ]//g' \
3825 |
grep .
>/dev
/null
; then
3827 if test "X$deplibs_check_method" = "Xnone"; then
3828 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3830 $echo "*** Warning: inter-library dependencies are not known to be supported."
3832 $echo "*** All declared inter-library dependencies are being dropped."
3837 versuffix
=$versuffix_save
3839 release
=$release_save
3840 libname
=$libname_save
3844 *-*-rhapsody* |
*-*-darwin1.
[012])
3845 # On Rhapsody replace the C library is the System framework
3846 newdeplibs
=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3850 if test "$droppeddeps" = yes; then
3851 if test "$module" = yes; then
3853 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3854 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3855 $echo "*** a static module, that should work as long as the dlopening"
3856 $echo "*** application is linked with the -dlopen flag."
3857 if test -z "$global_symbol_pipe"; then
3859 $echo "*** However, this would only work if libtool was able to extract symbol"
3860 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3861 $echo "*** not find such a program. So, this module is probably useless."
3862 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3864 if test "$build_old_libs" = no
; then
3865 oldlibs
="$output_objdir/$libname.$libext"
3866 build_libtool_libs
=module
3869 build_libtool_libs
=no
3872 $echo "*** The inter-library dependencies that have been dropped here will be"
3873 $echo "*** automatically added whenever a program is linked with this library"
3874 $echo "*** or is declared to -dlopen it."
3876 if test "$allow_undefined" = no
; then
3878 $echo "*** Since this library must not contain undefined symbols,"
3879 $echo "*** because either the platform does not support them or"
3880 $echo "*** it was explicitly requested with -no-undefined,"
3881 $echo "*** libtool will only create a static version of it."
3882 if test "$build_old_libs" = no
; then
3883 oldlibs
="$output_objdir/$libname.$libext"
3884 build_libtool_libs
=module
3887 build_libtool_libs
=no
3892 # Done checking deplibs!
3897 # move library search paths that coincide with paths to not yet
3898 # installed libraries to the beginning of the library search list
3900 for path
in $notinst_path; do
3901 case " $new_libs " in
3902 *" -L$path/$objdir "*) ;;
3904 case " $deplibs " in
3905 *" -L$path/$objdir "*)
3906 new_libs
="$new_libs -L$path/$objdir" ;;
3911 for deplib
in $deplibs; do
3914 case " $new_libs " in
3916 *) new_libs
="$new_libs $deplib" ;;
3919 *) new_libs
="$new_libs $deplib" ;;
3925 # All the library-specific variables (install_libdir is set above).
3930 # Test again, we may have decided not to build it any more
3931 if test "$build_libtool_libs" = yes; then
3932 if test "$hardcode_into_libs" = yes; then
3933 # Hardcode the library paths
3936 rpath
="$finalize_rpath"
3937 test "$mode" != relink
&& rpath
="$compile_rpath$rpath"
3938 for libdir
in $rpath; do
3939 if test -n "$hardcode_libdir_flag_spec"; then
3940 if test -n "$hardcode_libdir_separator"; then
3941 if test -z "$hardcode_libdirs"; then
3942 hardcode_libdirs
="$libdir"
3944 # Just accumulate the unique libdirs.
3945 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3946 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3949 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3954 eval flag
=\"$hardcode_libdir_flag_spec\"
3955 dep_rpath
="$dep_rpath $flag"
3957 elif test -n "$runpath_var"; then
3958 case "$perm_rpath " in
3960 *) perm_rpath
="$perm_rpath $libdir" ;;
3964 # Substitute the hardcoded libdirs into the rpath.
3965 if test -n "$hardcode_libdir_separator" &&
3966 test -n "$hardcode_libdirs"; then
3967 libdir
="$hardcode_libdirs"
3968 if test -n "$hardcode_libdir_flag_spec_ld"; then
3969 eval dep_rpath
=\"$hardcode_libdir_flag_spec_ld\"
3971 eval dep_rpath
=\"$hardcode_libdir_flag_spec\"
3974 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3975 # We should set the runpath_var.
3977 for dir
in $perm_rpath; do
3980 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3982 test -n "$dep_rpath" && deplibs
="$dep_rpath $deplibs"
3985 shlibpath
="$finalize_shlibpath"
3986 test "$mode" != relink
&& shlibpath
="$compile_shlibpath$shlibpath"
3987 if test -n "$shlibpath"; then
3988 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3991 # Get the real and link names of the library.
3992 eval shared_ext
=\"$shrext_cmds\"
3993 eval library_names
=\"$library_names_spec\"
3994 set dummy
$library_names
3998 if test -n "$soname_spec"; then
3999 eval soname
=\"$soname_spec\"
4003 if test -z "$dlname"; then
4007 lib
="$output_objdir/$realname"
4011 linknames
="$linknames $link"
4014 # Use standard objects if they are pic
4015 test -z "$pic_flag" && libobjs
=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4017 # Prepare the list of exported symbols
4018 if test -z "$export_symbols"; then
4019 if test "$always_export_symbols" = yes ||
test -n "$export_symbols_regex"; then
4020 $show "generating symbol list for \`$libname.la'"
4021 export_symbols
="$output_objdir/$libname.exp"
4022 $run $rm $export_symbols
4023 cmds
=$export_symbols_cmds
4024 save_ifs
="$IFS"; IFS
='~'
4025 for cmd
in $cmds; do
4028 if len
=`expr "X$cmd" : ".*"` &&
4029 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
4031 $run eval "$cmd" ||
exit $?
4032 skipped_export
=false
4034 # The command line is too long to execute in one step.
4035 $show "using reloadable object file for export list..."
4037 # Break out early, otherwise skipped_export may be
4038 # set to false by a later but shorter cmd.
4043 if test -n "$export_symbols_regex"; then
4044 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
4045 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
4046 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
4047 $run eval '$mv "${export_symbols}T" "$export_symbols"'
4052 if test -n "$export_symbols" && test -n "$include_expsyms"; then
4053 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
4057 for test_deplib
in $deplibs; do
4058 case " $convenience " in
4059 *" $test_deplib "*) ;;
4061 tmp_deplibs
="$tmp_deplibs $test_deplib"
4065 deplibs
="$tmp_deplibs"
4067 if test -n "$convenience"; then
4068 if test -n "$whole_archive_flag_spec"; then
4069 save_libobjs
=$libobjs
4070 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
4072 gentop
="$output_objdir/${outputname}x"
4073 generated
="$generated $gentop"
4075 func_extract_archives
$gentop $convenience
4076 libobjs
="$libobjs $func_extract_archives_result"
4080 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
4081 eval flag
=\"$thread_safe_flag_spec\"
4082 linker_flags
="$linker_flags $flag"
4085 # Make a backup of the uninstalled library when relinking
4086 if test "$mode" = relink
; then
4087 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' ||
exit $?
4090 # Do each of the archive commands.
4091 if test "$module" = yes && test -n "$module_cmds" ; then
4092 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4093 eval test_cmds
=\"$module_expsym_cmds\"
4094 cmds
=$module_expsym_cmds
4096 eval test_cmds
=\"$module_cmds\"
4100 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4101 eval test_cmds
=\"$archive_expsym_cmds\"
4102 cmds
=$archive_expsym_cmds
4104 eval test_cmds
=\"$archive_cmds\"
4109 if test "X$skipped_export" != "X:" &&
4110 len
=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4111 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
4114 # The command line is too long to link in one step, link piecewise.
4115 $echo "creating reloadable object files..."
4117 # Save the value of $output and $libobjs because we want to
4118 # use them later. If we have whole_archive_flag_spec, we
4119 # want to use save_libobjs as it was before
4120 # whole_archive_flag_spec was expanded, because we can't
4121 # assume the linker understands whole_archive_flag_spec.
4122 # This may have to be revisited, in case too many
4123 # convenience libraries get linked in and end up exceeding
4125 if test -z "$convenience" ||
test -z "$whole_archive_flag_spec"; then
4126 save_libobjs
=$libobjs
4129 output_la
=`$echo "X$output" | $Xsed -e "$basename"`
4131 # Clear the reloadable object creation command queue and
4132 # initialize k to one.
4139 output
=$output_objdir/$output_la-${k}.
$objext
4140 # Loop over the list of objects to be linked.
4141 for obj
in $save_libobjs
4143 eval test_cmds
=\"$reload_cmds $objlist $last_robj\"
4144 if test "X$objlist" = X ||
4145 { len
=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4146 test "$len" -le "$max_cmd_len"; }; then
4147 objlist
="$objlist $obj"
4149 # The command $test_cmds is almost too long, add a
4150 # command to the queue.
4151 if test "$k" -eq 1 ; then
4152 # The first file doesn't have a previous command to add.
4153 eval concat_cmds
=\"$reload_cmds $objlist $last_robj\"
4155 # All subsequent reloadable object files will link in
4156 # the last one created.
4157 eval concat_cmds
=\"\
$concat_cmds~
$reload_cmds $objlist $last_robj\"
4159 last_robj
=$output_objdir/$output_la-${k}.
$objext
4161 output
=$output_objdir/$output_la-${k}.
$objext
4166 # Handle the remaining objects by creating one last
4167 # reloadable object file. All subsequent reloadable object
4168 # files will link in the last one created.
4169 test -z "$concat_cmds" || concat_cmds
=$concat_cmds~
4170 eval concat_cmds
=\"\
${concat_cmds}$reload_cmds $objlist $last_robj\"
4172 if ${skipped_export-false}; then
4173 $show "generating symbol list for \`$libname.la'"
4174 export_symbols
="$output_objdir/$libname.exp"
4175 $run $rm $export_symbols
4177 # Append the command to create the export file.
4178 eval concat_cmds
=\"\
$concat_cmds~
$export_symbols_cmds\"
4181 # Set up a command to remove the reloadable object files
4182 # after they are used.
4184 while test "$i" -lt "$k"
4187 delfiles
="$delfiles $output_objdir/$output_la-${i}.$objext"
4190 $echo "creating a temporary reloadable object file: $output"
4192 # Loop through the commands generated above and execute them.
4193 save_ifs
="$IFS"; IFS
='~'
4194 for cmd
in $concat_cmds; do
4197 $run eval "$cmd" ||
exit $?
4202 # Restore the value of output.
4205 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4206 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
4208 # Expand the library linking commands again to reset the
4209 # value of $libobjs for piecewise linking.
4211 # Do each of the archive commands.
4212 if test "$module" = yes && test -n "$module_cmds" ; then
4213 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4214 cmds
=$module_expsym_cmds
4219 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4220 cmds
=$archive_expsym_cmds
4226 # Append the command to remove the reloadable object files
4227 # to the just-reset $cmds.
4228 eval cmds
=\"\
$cmds~\
$rm $delfiles\"
4230 save_ifs
="$IFS"; IFS
='~'
4231 for cmd
in $cmds; do
4235 $run eval "$cmd" ||
{
4238 # Restore the uninstalled library and exit
4239 if test "$mode" = relink
; then
4240 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
4248 # Restore the uninstalled library and exit
4249 if test "$mode" = relink
; then
4250 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' ||
exit $?
4252 if test -n "$convenience"; then
4253 if test -z "$whole_archive_flag_spec"; then
4254 $show "${rm}r $gentop"
4255 $run ${rm}r
"$gentop"
4262 # Create links to the real library.
4263 for linkname
in $linknames; do
4264 if test "$realname" != "$linkname"; then
4265 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4266 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' ||
exit $?
4270 # If -module or -export-dynamic was specified, set the dlname.
4271 if test "$module" = yes ||
test "$export_dynamic" = yes; then
4272 # On all known operating systems, these are identical.
4279 if test -n "$deplibs"; then
4280 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4283 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
4284 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4287 if test -n "$rpath"; then
4288 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4291 if test -n "$xrpath"; then
4292 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4295 if test -n "$vinfo"; then
4296 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4299 if test -n "$release"; then
4300 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4305 if test -n "$objs$old_deplibs"; then
4306 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4310 obj
=`$echo "X$output" | $Xsed -e "$lo2o"`
4318 # Delete the old objects.
4319 $run $rm $obj $libobj
4321 # Objects from convenience libraries. This assumes
4322 # single-version convenience libraries. Whenever we create
4323 # different ones for PIC/non-PIC, this we'll have to duplicate
4327 # reload_cmds runs $LD directly, so let us get rid of
4328 # -Wl from whole_archive_flag_spec
4331 if test -n "$convenience"; then
4332 if test -n "$whole_archive_flag_spec"; then
4333 eval reload_conv_objs
=\"\
$reload_objs $whole_archive_flag_spec\"
4335 gentop
="$output_objdir/${obj}x"
4336 generated
="$generated $gentop"
4338 func_extract_archives
$gentop $convenience
4339 reload_conv_objs
="$reload_objs $func_extract_archives_result"
4343 # Create the old-style object.
4344 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
4348 save_ifs
="$IFS"; IFS
='~'
4349 for cmd
in $cmds; do
4353 $run eval "$cmd" ||
exit $?
4357 # Exit if we aren't doing a library object file.
4358 if test -z "$libobj"; then
4359 if test -n "$gentop"; then
4360 $show "${rm}r $gentop"
4367 if test "$build_libtool_libs" != yes; then
4368 if test -n "$gentop"; then
4369 $show "${rm}r $gentop"
4373 # Create an invalid libtool object if no PIC, so that we don't
4374 # accidentally link it into a program.
4375 # $show "echo timestamp > $libobj"
4376 # $run eval "echo timestamp > $libobj" || exit $?
4380 if test -n "$pic_flag" ||
test "$pic_mode" != default
; then
4381 # Only do commands if we really have different PIC objects.
4382 reload_objs
="$libobjs $reload_conv_objs"
4385 save_ifs
="$IFS"; IFS
='~'
4386 for cmd
in $cmds; do
4390 $run eval "$cmd" ||
exit $?
4395 if test -n "$gentop"; then
4396 $show "${rm}r $gentop"
4405 *cygwin
*) output
=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4407 if test -n "$vinfo"; then
4408 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4411 if test -n "$release"; then
4412 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4415 if test "$preload" = yes; then
4416 if test "$dlopen_support" = unknown
&& test "$dlopen_self" = unknown
&&
4417 test "$dlopen_self_static" = unknown
; then
4418 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4423 *-*-rhapsody* |
*-*-darwin1.
[012])
4424 # On Rhapsody replace the C library is the System framework
4425 compile_deplibs
=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4426 finalize_deplibs
=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4432 # Don't allow lazy linking, it breaks C++ global constructors
4433 if test "$tagname" = CXX
; then
4434 compile_command
="$compile_command ${wl}-bind_at_load"
4435 finalize_command
="$finalize_command ${wl}-bind_at_load"
4441 # move library search paths that coincide with paths to not yet
4442 # installed libraries to the beginning of the library search list
4444 for path
in $notinst_path; do
4445 case " $new_libs " in
4446 *" -L$path/$objdir "*) ;;
4448 case " $compile_deplibs " in
4449 *" -L$path/$objdir "*)
4450 new_libs
="$new_libs -L$path/$objdir" ;;
4455 for deplib
in $compile_deplibs; do
4458 case " $new_libs " in
4460 *) new_libs
="$new_libs $deplib" ;;
4463 *) new_libs
="$new_libs $deplib" ;;
4466 compile_deplibs
="$new_libs"
4469 compile_command
="$compile_command $compile_deplibs"
4470 finalize_command
="$finalize_command $finalize_deplibs"
4472 if test -n "$rpath$xrpath"; then
4473 # If the user specified any rpath flags, then add them.
4474 for libdir
in $rpath $xrpath; do
4475 # This is the magic to use -rpath.
4476 case "$finalize_rpath " in
4478 *) finalize_rpath
="$finalize_rpath $libdir" ;;
4483 # Now hardcode the library paths
4486 for libdir
in $compile_rpath $finalize_rpath; do
4487 if test -n "$hardcode_libdir_flag_spec"; then
4488 if test -n "$hardcode_libdir_separator"; then
4489 if test -z "$hardcode_libdirs"; then
4490 hardcode_libdirs
="$libdir"
4492 # Just accumulate the unique libdirs.
4493 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4494 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4497 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4502 eval flag
=\"$hardcode_libdir_flag_spec\"
4503 rpath
="$rpath $flag"
4505 elif test -n "$runpath_var"; then
4506 case "$perm_rpath " in
4508 *) perm_rpath
="$perm_rpath $libdir" ;;
4512 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
4513 testbindir
=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
4514 case :$dllsearchpath: in
4516 *) dllsearchpath
="$dllsearchpath:$libdir";;
4518 case :$dllsearchpath: in
4519 *":$testbindir:"*) ;;
4520 *) dllsearchpath
="$dllsearchpath:$testbindir";;
4525 # Substitute the hardcoded libdirs into the rpath.
4526 if test -n "$hardcode_libdir_separator" &&
4527 test -n "$hardcode_libdirs"; then
4528 libdir
="$hardcode_libdirs"
4529 eval rpath
=\" $hardcode_libdir_flag_spec\"
4531 compile_rpath
="$rpath"
4535 for libdir
in $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 "$finalize_perm_rpath " in
4557 *) finalize_perm_rpath
="$finalize_perm_rpath $libdir" ;;
4561 # Substitute the hardcoded libdirs into the rpath.
4562 if test -n "$hardcode_libdir_separator" &&
4563 test -n "$hardcode_libdirs"; then
4564 libdir
="$hardcode_libdirs"
4565 eval rpath
=\" $hardcode_libdir_flag_spec\"
4567 finalize_rpath
="$rpath"
4569 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4570 # Transform all the library objects into standard objects.
4571 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4572 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4576 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
4577 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4578 dlsyms
="${outputname}S.c"
4580 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4584 if test -n "$dlsyms"; then
4588 # Discover the nlist of each of the dlfiles.
4589 nlist
="$output_objdir/${outputname}.nm"
4591 $show "$rm $nlist ${nlist}S ${nlist}T"
4592 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4594 # Parse the name list into a source file.
4595 $show "creating $output_objdir/$dlsyms"
4597 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4598 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4599 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4605 /* Prevent the only kind of declaration conflicts we can make. */
4606 #define lt_preloaded_symbols some_other_symbol
4608 /* External symbol declarations for the compiler. */\
4611 if test "$dlself" = yes; then
4612 $show "generating symbol list for \`$output'"
4614 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4616 # Add our own program objects to the symbol list.
4617 progfiles
=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4618 for arg
in $progfiles; do
4619 $show "extracting global C symbols from \`$arg'"
4620 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4623 if test -n "$exclude_expsyms"; then
4624 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4625 $run eval '$mv "$nlist"T "$nlist"'
4628 if test -n "$export_symbols_regex"; then
4629 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4630 $run eval '$mv "$nlist"T "$nlist"'
4633 # Prepare the list of exported symbols
4634 if test -z "$export_symbols"; then
4635 export_symbols
="$output_objdir/$outputname.exp"
4636 $run $rm $export_symbols
4637 $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4639 *cygwin
* |
*mingw
* )
4640 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4641 $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
4645 $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4646 $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4647 $run eval 'mv "$nlist"T "$nlist"'
4649 *cygwin
* |
*mingw
* )
4650 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4651 $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
4657 for arg
in $dlprefiles; do
4658 $show "extracting global C symbols from \`$arg'"
4659 name
=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4660 $run eval '$echo ": $name " >> "$nlist"'
4661 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4664 if test -z "$run"; then
4665 # Make sure we have at least an empty file.
4666 test -f "$nlist" ||
: > "$nlist"
4668 if test -n "$exclude_expsyms"; then
4669 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4670 $mv "$nlist"T
"$nlist"
4673 # Try sorting and uniquifying the output.
4674 if grep -v "^: " < "$nlist" |
4675 if sort -k 3 </dev
/null
>/dev
/null
2>&1; then
4680 uniq > "$nlist"S
; then
4683 grep -v "^: " < "$nlist" > "$nlist"S
4686 if test -f "$nlist"S
; then
4687 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4689 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4692 $echo >> "$output_objdir/$dlsyms" "\
4694 #undef lt_preloaded_symbols
4696 #if defined (__STDC__) && __STDC__
4697 # define lt_ptr void *
4699 # define lt_ptr char *
4703 /* The mapping between symbol names and symbols. */
4707 *cygwin
* |
*mingw
* )
4708 $echo >> "$output_objdir/$dlsyms" "\
4709 /* DATA imports from DLLs on WIN32 can't be const, because
4710 runtime relocations are performed -- see ld's documentation
4716 $echo >> "$output_objdir/$dlsyms" "\
4723 $echo >> "$output_objdir/$dlsyms" "\
4727 lt_preloaded_symbols[] =
4731 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4733 $echo >> "$output_objdir/$dlsyms" "\
4737 /* This works around a problem in FreeBSD linker */
4738 #ifdef FREEBSD_WORKAROUND
4739 static const void *lt_preloaded_setup() {
4740 return lt_preloaded_symbols;
4750 pic_flag_for_symtable
=
4752 # compiling the symbol table file with pic_flag works around
4753 # a FreeBSD bug that causes programs to crash when -lm is
4754 # linked before any other PIC object. But we must not use
4755 # pic_flag when linking with -static. The problem exists in
4756 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4757 *-*-freebsd2*|
*-*-freebsd3.0
*|
*-*-freebsdelf3.0
*)
4758 case "$compile_command " in
4760 *) pic_flag_for_symtable
=" $pic_flag -DFREEBSD_WORKAROUND";;
4763 case "$compile_command " in
4765 *) pic_flag_for_symtable
=" $pic_flag";;
4769 # Now compile the dynamic symbol file.
4770 $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4771 $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' ||
exit $?
4773 # Clean up the generated files.
4774 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4775 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4777 # Transform the symbol file into the correct name.
4779 *cygwin
* |
*mingw
* )
4780 if test -f "$output_objdir/${outputname}.def" ; then
4781 compile_command
=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
4782 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
4784 compile_command
=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4785 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4789 compile_command
=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4790 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4795 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4800 # We keep going just in case the user didn't refer to
4801 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4802 # really was required.
4804 # Nullify the symbol file.
4805 compile_command
=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4806 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4809 if test "$need_relink" = no ||
test "$build_libtool_libs" != yes; then
4810 # Replace the output file specification.
4811 compile_command
=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4812 link_command
="$compile_command$compile_rpath"
4814 # We have no uninstalled library dependencies, so finalize right now.
4815 $show "$link_command"
4816 $run eval "$link_command"
4819 # Delete the generated files.
4820 if test -n "$dlsyms"; then
4821 $show "$rm $output_objdir/${outputname}S.${objext}"
4822 $run $rm "$output_objdir/${outputname}S.${objext}"
4828 if test -n "$shlibpath_var"; then
4829 # We should set the shlibpath_var
4831 for dir
in $temp_rpath; do
4833 [\\/]* |
[A-Za-z
]:[\\/]*)
4838 # Relative path: add a thisdir entry.
4839 rpath
="$rpath\$thisdir/$dir:"
4846 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4847 compile_command
="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4849 if test -n "$finalize_shlibpath"; then
4850 finalize_command
="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4855 if test -n "$runpath_var"; then
4856 if test -n "$perm_rpath"; then
4857 # We should set the runpath_var.
4859 for dir
in $perm_rpath; do
4862 compile_var
="$runpath_var=\"$rpath\$$runpath_var\" "
4864 if test -n "$finalize_perm_rpath"; then
4865 # We should set the runpath_var.
4867 for dir
in $finalize_perm_rpath; do
4870 finalize_var
="$runpath_var=\"$rpath\$$runpath_var\" "
4874 if test "$no_install" = yes; then
4875 # We don't need to create a wrapper script.
4876 link_command
="$compile_var$compile_command$compile_rpath"
4877 # Replace the output file specification.
4878 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4879 # Delete the old output file.
4881 # Link the executable and exit
4882 $show "$link_command"
4883 $run eval "$link_command" ||
exit $?
4887 if test "$hardcode_action" = relink
; then
4888 # Fast installation is not supported
4889 link_command
="$compile_var$compile_command$compile_rpath"
4890 relink_command
="$finalize_var$finalize_command$finalize_rpath"
4892 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4893 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4895 if test "$fast_install" != no
; then
4896 link_command
="$finalize_var$compile_command$finalize_rpath"
4897 if test "$fast_install" = yes; then
4898 relink_command
=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4900 # fast_install is set to needless
4904 link_command
="$compile_var$compile_command$compile_rpath"
4905 relink_command
="$finalize_var$finalize_command$finalize_rpath"
4909 # Replace the output file specification.
4910 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4912 # Delete the old output files.
4913 $run $rm $output $output_objdir/$outputname $output_objdir/lt-
$outputname
4915 $show "$link_command"
4916 $run eval "$link_command" ||
exit $?
4918 # Now create the wrapper script.
4919 $show "creating $output"
4921 # Quote the relink command for shipping.
4922 if test -n "$relink_command"; then
4923 # Preserve any variables that may affect compiler behavior
4924 for var
in $variables_saved_for_relink; do
4925 if eval test -z \"\
${$var+set}\"; then
4926 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4927 elif eval var_value
=\$
$var; test -z "$var_value"; then
4928 relink_command
="$var=; export $var; $relink_command"
4930 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4931 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
4934 relink_command
="(cd `pwd`; $relink_command)"
4935 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4938 # Quote $echo for shipping.
4939 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
4941 [\\/]* |
[A-Za-z
]:[\\/]*) qecho
="$SHELL $progpath --fallback-echo";;
4942 *) qecho
="$SHELL `pwd`/$progpath --fallback-echo";;
4944 qecho
=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4946 qecho
=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4949 # Only actually do things if our run command is non-null.
4950 if test -z "$run"; then
4951 # win32 will think the script is a binary if it has
4952 # a .exe suffix, so we strip it off here.
4954 *.exe
) output
=`$echo $output|${SED} 's,.exe$,,'` ;;
4956 # test for cygwin because mv fails w/o .exe extensions
4960 outputname
=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4964 *cygwin
* |
*mingw
* )
4965 output_name
=`basename $output`
4966 output_path
=`dirname $output`
4967 cwrappersource
="$output_path/$objdir/lt-$output_name.c"
4968 cwrapper
="$output_path/$output_name.exe"
4969 $rm $cwrappersource $cwrapper
4970 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4972 cat > $cwrappersource <<EOF
4974 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4975 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4977 The $output program cannot be directly executed until all the libtool
4978 libraries that it depends on are installed.
4980 This wrapper executable should never be moved out of the build directory.
4981 If it is, it will not operate correctly.
4983 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4984 but could eventually absorb all of the scripts functionality and
4985 exec $objdir/$outputname directly.
4988 cat >> $cwrappersource<<"EOF"
4997 #include <sys/stat.h>
4999 #if defined(PATH_MAX)
5000 # define LT_PATHMAX PATH_MAX
5001 #elif defined(MAXPATHLEN)
5002 # define LT_PATHMAX MAXPATHLEN
5004 # define LT_PATHMAX 1024
5007 #ifndef DIR_SEPARATOR
5008 # define DIR_SEPARATOR '/'
5009 # define PATH_SEPARATOR ':'
5012 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
5014 # define HAVE_DOS_BASED_FILE_SYSTEM
5015 # ifndef DIR_SEPARATOR_2
5016 # define DIR_SEPARATOR_2 '\\'
5018 # ifndef PATH_SEPARATOR_2
5019 # define PATH_SEPARATOR_2 ';'
5023 #ifndef DIR_SEPARATOR_2
5024 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
5025 #else /* DIR_SEPARATOR_2 */
5026 # define IS_DIR_SEPARATOR(ch) \
5027 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
5028 #endif /* DIR_SEPARATOR_2 */
5030 #ifndef PATH_SEPARATOR_2
5031 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
5032 #else /* PATH_SEPARATOR_2 */
5033 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
5034 #endif /* PATH_SEPARATOR_2 */
5036 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
5037 #define XFREE(stale) do { \
5038 if (stale) { free ((void *) stale); stale = 0; } \
5041 /* -DDEBUG is fairly common in CFLAGS. */
5043 #if defined DEBUGWRAPPER
5044 # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
5046 # define DEBUG(format, ...)
5049 const char *program_name = NULL;
5051 void * xmalloc (size_t num);
5052 char * xstrdup (const char *string);
5053 const char * base_name (const char *name);
5054 char * find_executable(const char *wrapper);
5055 int check_executable(const char *path);
5056 char * strendzap(char *str, const char *pat);
5057 void lt_fatal (const char *message, ...);
5060 main (int argc, char *argv[])
5065 program_name = (char *) xstrdup (base_name (argv[0]));
5066 DEBUG("(main) argv[0] : %s\n",argv[0]);
5067 DEBUG("(main) program_name : %s\n",program_name);
5068 newargz = XMALLOC(char *, argc+2);
5071 cat >> $cwrappersource <<EOF
5072 newargz[0] = (char *) xstrdup("$SHELL");
5075 cat >> $cwrappersource <<"EOF"
5076 newargz
[1] = find_executable
(argv
[0]);
5077 if (newargz
[1] == NULL
)
5078 lt_fatal
("Couldn't find %s", argv
[0]);
5079 DEBUG
("(main) found exe at : %s\n",newargz
[1]);
5080 /* we know the
script has the same name
, without the .exe
*/
5081 /* so
make sure newargz
[1] doesn
't end in .exe */
5082 strendzap(newargz[1],".exe");
5083 for (i = 1; i < argc; i++)
5084 newargz[i+1] = xstrdup(argv[i]);
5085 newargz[argc+1] = NULL;
5087 for (i=0; i<argc+1; i++)
5089 DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
5097 cat >> $cwrappersource <<EOF
5098 execv("$SHELL",(char const **)newargz);
5102 cat >> $cwrappersource <<EOF
5103 execv("$SHELL",newargz);
5108 cat >> $cwrappersource <<"EOF"
5113 xmalloc (size_t num)
5115 void * p = (void *) malloc (num);
5117 lt_fatal ("Memory exhausted");
5123 xstrdup (const char *string)
5125 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
5130 base_name (const char *name)
5134 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5135 /* Skip over the disk name in MSDOS pathnames. */
5136 if (isalpha ((unsigned char)name[0]) && name[1] == ':')
5140 for (base = name; *name; name++)
5141 if (IS_DIR_SEPARATOR (*name))
5147 check_executable(const char * path)
5151 DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
5152 if ((!path) || (!*path))
5155 if ((stat (path, &st) >= 0) &&
5157 /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
5158 #if defined (S_IXOTH)
5159 ((st.st_mode & S_IXOTH) == S_IXOTH) ||
5161 #if defined (S_IXGRP)
5162 ((st.st_mode & S_IXGRP) == S_IXGRP) ||
5164 ((st.st_mode & S_IXUSR) == S_IXUSR))
5171 /* Searches for the full path of the wrapper. Returns
5172 newly allocated full path name if found, NULL otherwise */
5174 find_executable (const char* wrapper)
5179 /* static buffer for getcwd */
5180 char tmp[LT_PATHMAX + 1];
5184 DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
5186 if ((wrapper == NULL) || (*wrapper == '\
0'))
5189 /* Absolute path? */
5190 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5191 if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
5193 concat_name = xstrdup (wrapper);
5194 if (check_executable(concat_name))
5201 if (IS_DIR_SEPARATOR (wrapper[0]))
5203 concat_name = xstrdup (wrapper);
5204 if (check_executable(concat_name))
5208 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5212 for (p = wrapper; *p; p++)
5220 /* no slashes; search PATH */
5221 const char* path = getenv ("PATH");
5224 for (p = path; *p; p = p_next)
5228 for (q = p; *q; q++)
5229 if (IS_PATH_SEPARATOR(*q))
5232 p_next = (*q == '\
0' ? q : q + 1);
5235 /* empty path: current directory */
5236 if (getcwd (tmp, LT_PATHMAX) == NULL)
5237 lt_fatal ("getcwd failed");
5238 tmp_len = strlen(tmp);
5239 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5240 memcpy (concat_name, tmp, tmp_len);
5241 concat_name[tmp_len] = '/';
5242 strcpy (concat_name + tmp_len + 1, wrapper);
5246 concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
5247 memcpy (concat_name, p, p_len);
5248 concat_name[p_len] = '/';
5249 strcpy (concat_name + p_len + 1, wrapper);
5251 if (check_executable(concat_name))
5256 /* not found in PATH; assume curdir */
5258 /* Relative path | not found in path: prepend cwd */
5259 if (getcwd (tmp, LT_PATHMAX) == NULL)
5260 lt_fatal ("getcwd failed");
5261 tmp_len = strlen(tmp);
5262 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5263 memcpy (concat_name, tmp, tmp_len);
5264 concat_name[tmp_len] = '/';
5265 strcpy (concat_name + tmp_len + 1, wrapper);
5267 if (check_executable(concat_name))
5274 strendzap(char *str, const char *pat)
5278 assert(str != NULL);
5279 assert(pat != NULL);
5282 patlen = strlen(pat);
5286 str += len - patlen;
5287 if (strcmp(str, pat) == 0)
5294 lt_error_core (int exit_status, const char * mode,
5295 const char * message, va_list ap)
5297 fprintf (stderr, "%s: %s: ", program_name, mode);
5298 vfprintf (stderr, message, ap);
5299 fprintf (stderr, ".\n");
5301 if (exit_status >= 0)
5306 lt_fatal (const char *message, ...)
5309 va_start (ap, message);
5310 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
5314 # we should really use a build-platform specific compiler
5315 # here, but OTOH, the wrappers (shell script and this C one)
5316 # are only useful if you want to execute the "real" binary.
5317 # Since the "real" binary is built for $host, then this
5318 # wrapper might as well be built for $host, too.
5319 $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
5323 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5328 # $output - temporary wrapper script for $objdir/$outputname
5329 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5331 # The $output program cannot be directly executed until all the libtool
5332 # libraries that it depends on are installed.
5334 # This wrapper script should never be moved out of the build directory.
5335 # If it is, it will not operate correctly.
5337 # Sed substitution that helps us do robust quoting. It backslashifies
5338 # metacharacters that are still active within double-quoted strings.
5339 Xsed='${SED} -e 1s
/^X
//'
5340 sed_quote_subst='$sed_quote_subst'
5342 # The HP-UX ksh and POSIX shell print the target directory to stdout
5344 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5346 relink_command=\"$relink_command\"
5348 # This environment variable determines our operation mode.
5349 if test \"\$libtool_install_magic\" = \"$magic\"; then
5350 # install mode needs the following variable:
5351 notinst_deplibs='$notinst_deplibs'
5353 # When we are sourced in execute mode, \$file and \$echo are already set.
5354 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5357 # Make sure echo works.
5358 if test \"X\$1\" = X--no-reexec; then
5359 # Discard the --no-reexec flag, and continue.
5361 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X
\t'; then
5362 # Yippee, \$echo works!
5365 # Restart under the correct shell, and then maybe \$echo will work.
5366 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
5372 # Find the directory that this script lives in.
5373 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's
%/[^
/]*$
%%'\`
5374 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5376 # Follow symbolic links until we get to the real thisdir.
5377 file=\`ls -ld \"\$file\" | ${SED} -n 's
/.
*-> //p
'\`
5378 while test -n \"\$file\"; do
5379 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's
%/[^
/]*\$
%%'\`
5381 # If there was a directory component, then change thisdir.
5382 if test \"x\$destdir\" != \"x\$file\"; then
5383 case \"\$destdir\" in
5384 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5385 *) thisdir=\"\$thisdir/\$destdir\" ;;
5389 file=\`\$echo \"X\$file\" | \$Xsed -e 's
%^.
*/%%'\`
5390 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's
/.
*-> //p
'\`
5393 # Try to get the absolute directory name.
5394 absdir=\`cd \"\$thisdir\" && pwd\`
5395 test -n \"\$absdir\" && thisdir=\"\$absdir\"
5398 if test "$fast_install" = yes; then
5400 program=lt-'$outputname'$exeext
5401 progdir=\"\$thisdir/$objdir\"
5403 if test ! -f \"\$progdir/\$program\" || \\
5404 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5405 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5407 file=\"\$\$-\$program\"
5409 if test ! -d \"\$progdir\"; then
5410 $mkdir \"\$progdir\"
5412 $rm \"\$progdir/\$file\"
5417 # relink executable if necessary
5418 if test -n \"\$relink_command\"; then
5419 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5421 $echo \"\$relink_command_output\" >&2
5422 $rm \"\$progdir/\$file\"
5427 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5428 { $rm \"\$progdir/\$program\";
5429 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5430 $rm \"\$progdir/\$file\"
5434 program='$outputname'
5435 progdir=\"\$thisdir/$objdir\"
5441 if test -f \"\$progdir/\$program\"; then"
5443 # Export our shlibpath_var if we have one.
5444 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5446 # Add our own library path to $shlibpath_var
5447 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5449 # Some systems cannot cope with colon-terminated $shlibpath_var
5450 # The second colon is a workaround for a bug in BeOS R4 sed
5451 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's
/::*\$
//'\`
5453 export $shlibpath_var
5457 # fixup the dll searchpath if we need to.
5458 if test -n "$dllsearchpath"; then
5460 # Add the dll search path components to the executable PATH
5461 PATH=$dllsearchpath:\$PATH
5466 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5467 # Run the actual program with our arguments.
5469 # Make sure env LD_LIBRARY_PATH does not mess us up
5470 if test -n \"\${LD_LIBRARY_PATH+set}\"; then
5471 export LD_LIBRARY_PATH=\$progdir:\$LD_LIBRARY_PATH
5475 # Backslashes separate directories on plain windows
5476 *-*-mingw | *-*-os2*)
5478 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
5484 exec \"\$progdir/\$program\" \${1+\"\$@\"}
5489 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
5493 # The program doesn't exist.
5494 \
$echo \"\
$0: error
: \\\
`\$progdir/\$program' does not exist\" 1>&2
5495 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5496 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5507 # See if we need to build an old-fashioned archive.
5508 for oldlib in $oldlibs; do
5510 if test "$build_libtool_libs" = convenience; then
5511 oldobjs="$libobjs_save"
5512 addlibs="$convenience"
5513 build_libtool_libs=no
5515 if test "$build_libtool_libs" = module; then
5516 oldobjs="$libobjs_save"
5517 build_libtool_libs=no
5519 oldobjs="$old_deplibs $non_pic_objects"
5521 addlibs="$old_convenience"
5524 if test -n "$addlibs"; then
5525 gentop="$output_objdir/${outputname}x"
5526 generated="$generated $gentop"
5528 func_extract_archives $gentop $addlibs
5529 oldobjs="$oldobjs $func_extract_archives_result"
5532 # Do each command in the archive commands.
5533 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5534 cmds=$old_archive_from_new_cmds
5536 # POSIX demands no paths to be encoded in archives. We have
5537 # to avoid creating archives with duplicate basenames if we
5538 # might have to extract them afterwards, e.g., when creating a
5539 # static archive out of a convenience library, or when linking
5540 # the entirety of a libtool archive into another (currently
5541 # not supported by libtool).
5542 if (for obj in $oldobjs
5544 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5545 done | sort | sort -uc >/dev/null 2>&1); then
5548 $echo "copying selected object files to avoid basename conflicts..."
5550 if test -z "$gentop"; then
5551 gentop="$output_objdir/${outputname}x"
5552 generated="$generated $gentop"
5554 $show "${rm}r $gentop"
5555 $run ${rm}r "$gentop"
5556 $show "$mkdir $gentop"
5557 $run $mkdir "$gentop"
5559 if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
5564 save_oldobjs=$oldobjs
5567 for obj in $save_oldobjs
5569 objbase=`$echo "X$obj" |
$Xsed -e 's%^.*/%%'`
5570 case " $oldobjs " in
5571 " ") oldobjs=$obj ;;
5574 # Make sure we don't pick an alternate name that also
5576 newobj=lt$counter-$objbase
5577 counter=`expr $counter + 1`
5578 case " $oldobjs " in
5579 *[\ /]"$newobj "*) ;;
5580 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
5583 $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5584 $run ln "$obj" "$gentop/$newobj" ||
5585 $run cp "$obj" "$gentop/$newobj"
5586 oldobjs="$oldobjs $gentop/$newobj"
5588 *) oldobjs="$oldobjs $obj" ;;
5593 eval cmds=\"$old_archive_cmds\"
5595 if len=`expr "X$cmds" : ".*"` &&
5596 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5597 cmds=$old_archive_cmds
5599 # the command line is too long to link in one step, link in parts
5600 $echo "using piecewise archive linking..."
5605 save_oldobjs=$oldobjs
5607 # Is there a better way of finding the last object in the list?
5608 for obj in $save_oldobjs
5612 for obj in $save_oldobjs
5614 oldobjs="$objlist $obj"
5615 objlist="$objlist $obj"
5616 eval test_cmds=\"$old_archive_cmds\"
5617 if len=`expr "X$test_cmds" : ".*" 2>/dev
/null
` &&
5618 test "$len" -le "$max_cmd_len"; then
5621 # the above command should be used before it gets too long
5623 if test "$obj" = "$last_oldobj" ; then
5626 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5627 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5633 if test "X$oldobjs" = "X" ; then
5634 eval cmds=\"\$concat_cmds\"
5636 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5640 save_ifs="$IFS"; IFS='~'
5641 for cmd in $cmds; do
5645 $run eval "$cmd" || exit $?
5650 if test -n "$generated"; then
5651 $show "${rm}r$generated"
5652 $run ${rm}r$generated
5655 # Now create the libtool archive.
5659 test "$build_old_libs" = yes && old_library="$libname.$libext"
5660 $show "creating $output"
5662 # Preserve any variables that may affect compiler behavior
5663 for var in $variables_saved_for_relink; do
5664 if eval test -z \"\${$var+set}\"; then
5665 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5666 elif eval var_value=\$$var; test -z "$var_value"; then
5667 relink_command="$var=; export $var; $relink_command"
5669 var_value=`$echo "X$var_value" |
$Xsed -e "$sed_quote_subst"`
5670 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5673 # Quote the link command for shipping.
5674 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5675 relink_command=`$echo "X$relink_command" |
$Xsed -e "$sed_quote_subst"`
5676 if test "$hardcode_automatic" = yes ; then
5681 # Only create the output if not a dry run.
5682 if test -z "$run"; then
5683 for installed in no yes; do
5684 if test "$installed" = yes; then
5685 if test -z "$install_libdir"; then
5688 output="$output_objdir/$outputname"i
5689 # Replace all uninstalled libtool libraries with the installed ones
5691 for deplib in $dependency_libs; do
5694 name=`$echo "X$deplib" |
$Xsed -e 's%^.*/%%'`
5695 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5696 if test -z "$libdir"; then
5697 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5700 if test "X$EGREP" = X ; then
5703 # We do not want portage's
install root
($D) present. Check only
for
5704 # this if the .la is being installed.
5705 if test "$installed" = yes && test "$D"; then
5706 eval mynewdependency_lib
=`echo "$libdir/$name" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
5708 mynewdependency_lib
="$libdir/$name"
5710 # Do not add duplicates
5711 if test "$mynewdependency_lib"; then
5712 my_little_ninja_foo_1
=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"`
5713 if test -z "$my_little_ninja_foo_1"; then
5714 newdependency_libs
="$newdependency_libs $mynewdependency_lib"
5719 if test "$installed" = yes; then
5720 # Rather use S=WORKDIR if our version of portage supports it.
5721 # This is because some ebuild (gcc) do not use $S as buildroot.
5722 if test "$PWORKDIR"; then
5725 # We do not want portage's build root ($S) present.
5726 my_little_ninja_foo_2
=`echo $deplib |$EGREP -e "$S"`
5727 # We do not want portage's install root ($D) present.
5728 my_little_ninja_foo_3
=`echo $deplib |$EGREP -e "$D"`
5729 if test -n "$my_little_ninja_foo_2" && test "$S"; then
5730 mynewdependency_lib
=""
5731 elif test -n "$my_little_ninja_foo_3" && test "$D"; then
5732 eval mynewdependency_lib
=`echo "$deplib" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
5734 mynewdependency_lib
="$deplib"
5737 mynewdependency_lib
="$deplib"
5739 # Do not add duplicates
5740 if test "$mynewdependency_lib"; then
5741 my_little_ninja_foo_4
=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"`
5742 if test -z "$my_little_ninja_foo_4"; then
5743 newdependency_libs
="$newdependency_libs $mynewdependency_lib"
5749 dependency_libs
="$newdependency_libs"
5751 for lib
in $dlfiles; do
5752 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5753 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5754 if test -z "$libdir"; then
5755 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5758 newdlfiles
="$newdlfiles $libdir/$name"
5760 dlfiles
="$newdlfiles"
5762 for lib
in $dlprefiles; do
5763 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5764 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5765 if test -z "$libdir"; then
5766 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5769 newdlprefiles
="$newdlprefiles $libdir/$name"
5771 dlprefiles
="$newdlprefiles"
5774 for lib
in $dlfiles; do
5776 [\\/]* |
[A-Za-z
]:[\\/]*) abs
="$lib" ;;
5777 *) abs
=`pwd`"/$lib" ;;
5779 newdlfiles
="$newdlfiles $abs"
5781 dlfiles
="$newdlfiles"
5783 for lib
in $dlprefiles; do
5785 [\\/]* |
[A-Za-z
]:[\\/]*) abs
="$lib" ;;
5786 *) abs
=`pwd`"/$lib" ;;
5788 newdlprefiles
="$newdlprefiles $abs"
5790 dlprefiles
="$newdlprefiles"
5793 # place dlname in correct position for cygwin
5795 case $host,$output,$installed,$module,$dlname in
5796 *cygwin
*,*lai
,yes,no
,*.dll |
*mingw
*,*lai
,yes,no
,*.dll
) tdlname
=..
/bin
/$dlname ;;
5798 # Do not add duplicates
5799 if test "$installed" = yes && test "$D"; then
5800 install_libdir
=`echo "$install_libdir" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
5803 # $outputname - a libtool library file
5804 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5806 # Please DO NOT delete this file!
5807 # It is necessary for linking the library.
5809 # The name that we can dlopen(3).
5812 # Names of this library.
5813 library_names='$library_names'
5815 # The name of the static archive.
5816 old_library='$old_library'
5818 # Libraries that this one depends upon.
5819 dependency_libs='$dependency_libs'
5821 # Version information for $libname.
5826 # Is this an already installed library?
5827 installed=$installed
5829 # Should we warn about portability when linking against -modules?
5830 shouldnotlink=$module
5832 # Files to dlopen/dlpreopen
5834 dlpreopen='$dlprefiles'
5836 # Directory that this library needs to be installed in:
5837 libdir='$install_libdir'"
5838 if test "$installed" = no
&& test "$need_relink" = yes; then
5840 relink_command=\"$relink_command\""
5845 # Do a symbolic link so that the libtool archive can be found in
5846 # LD_LIBRARY_PATH before the program is installed.
5847 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5848 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' ||
exit $?
5854 # libtool install mode
5856 modename
="$modename: install"
5858 # There may be an optional sh(1) argument at the beginning of
5859 # install_prog (especially on Windows NT).
5860 if test "$nonopt" = "$SHELL" ||
test "$nonopt" = /bin
/sh ||
5861 # Allow the use of GNU shtool's install command.
5862 $echo "X$nonopt" |
grep shtool
> /dev
/null
; then
5863 # Aesthetically quote it.
5864 arg
=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5866 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5870 install_prog
="$arg "
5878 # The real first argument should be the name of the installation program.
5879 # Aesthetically quote it.
5880 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5882 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5886 install_prog
="$install_prog$arg"
5888 # We need to accept at least all the BSD install flags.
5898 if test -n "$dest"; then
5899 files
="$files $dest"
5907 case " $install_prog " in
5912 -g |
-m |
-o) prev
=$arg ;;
5920 # If the previous option needed an argument, then skip it.
5921 if test -n "$prev"; then
5930 # Aesthetically quote the argument.
5931 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5933 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5937 install_prog
="$install_prog $arg"
5940 if test -z "$install_prog"; then
5941 $echo "$modename: you must specify an install program" 1>&2
5946 if test -n "$prev"; then
5947 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5952 if test -z "$files"; then
5953 if test -z "$dest"; then
5954 $echo "$modename: no file or destination specified" 1>&2
5956 $echo "$modename: you must specify a destination" 1>&2
5962 # Strip any trailing slash from the destination.
5963 dest
=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5965 # Check to see that the destination is a directory.
5966 test -d "$dest" && isdir
=yes
5967 if test "$isdir" = yes; then
5971 destdir
=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5972 test "X$destdir" = "X$dest" && destdir
=.
5973 destname
=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5975 # Not a directory, so check to see that there is only one file specified.
5977 if test "$#" -gt 2; then
5978 $echo "$modename: \`$dest' is not a directory" 1>&2
5984 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
5986 for file in $files; do
5990 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5999 # This variable tells wrapper scripts just to set variables rather
6000 # than running their programs.
6001 libtool_install_magic
="$magic"
6006 for file in $files; do
6008 # Do each installation.
6011 # Do the static libraries later.
6012 staticlibs
="$staticlibs $file"
6016 # Check to see that this really is a libtool archive.
6017 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
6019 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
6027 # If there is no directory component, then add one.
6029 */* |
*\\*) .
$file ;;
6033 # Add the libdir to current_libdirs if it is the destination.
6034 if test "X$destdir" = "X$libdir"; then
6035 case "$current_libdirs " in
6037 *) current_libdirs
="$current_libdirs $libdir" ;;
6040 # Note the libdir as a future libdir.
6041 case "$future_libdirs " in
6043 *) future_libdirs
="$future_libdirs $libdir" ;;
6047 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
6048 test "X$dir" = "X$file/" && dir
=
6051 if test -n "$relink_command"; then
6052 # Determine the prefix the user has applied to our future dir.
6053 inst_prefix_dir
=`$echo "$destdir" | $SED "s%$libdir\$%%"`
6055 # Don't allow the user to place us outside of our expected
6056 # location b/c this prevents finding dependent libraries that
6057 # are installed to the same prefix.
6058 # At present, this check doesn't affect windows .dll's that
6059 # are installed into $libdir/../bin (currently, that works fine)
6060 # but it's something to keep an eye on.
6061 if test "$inst_prefix_dir" = "$destdir"; then
6062 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
6066 if test -n "$inst_prefix_dir"; then
6067 # Stick the inst_prefix_dir data into the link command.
6068 relink_command
=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
6070 relink_command
=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
6073 $echo "$modename: warning: relinking \`$file'" 1>&2
6074 $show "$relink_command"
6075 if $run eval "$relink_command"; then :
6077 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6082 # See the names of the shared library.
6083 set dummy
$library_names
6084 if test -n "$2"; then
6090 test -n "$relink_command" && srcname
="$realname"T
6092 # Install the shared library and build the symlinks.
6093 $show "$install_prog $dir/$srcname $destdir/$realname"
6094 $run eval "$install_prog $dir/$srcname $destdir/$realname" ||
exit $?
6095 if test -n "$stripme" && test -n "$striplib"; then
6096 $show "$striplib $destdir/$realname"
6097 $run eval "$striplib $destdir/$realname" ||
exit $?
6100 if test "$#" -gt 0; then
6101 # Delete the old symlinks, and create new ones.
6102 # Try `ln -sf' first, because the `ln' binary might depend on
6103 # the symlink we replace! Solaris /bin/ln does not understand -f,
6104 # so we also need to try rm && ln -s.
6107 if test "$linkname" != "$realname"; then
6108 $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6109 $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6114 # Do each command in the postinstall commands.
6115 lib
="$destdir/$realname"
6116 cmds
=$postinstall_cmds
6117 save_ifs
="$IFS"; IFS
='~'
6118 for cmd
in $cmds; do
6122 $run eval "$cmd" ||
{
6125 # Restore the uninstalled library and exit
6126 if test "$mode" = relink
; then
6127 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
6136 # Install the pseudo-library for information purposes.
6137 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6138 instname
="$dir/$name"i
6139 $show "$install_prog $instname $destdir/$name"
6140 $run eval "$install_prog $instname $destdir/$name" ||
exit $?
6142 # Maybe install the static library, too.
6143 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
6147 # Install (i.e. copy) a libtool object.
6149 # Figure out destination file name, if it wasn't already specified.
6150 if test -n "$destname"; then
6151 destfile
="$destdir/$destname"
6153 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6154 destfile
="$destdir/$destfile"
6157 # Deduce the name of the destination old-style object file.
6160 staticdest
=`$echo "X$destfile" | $Xsed -e "$lo2o"`
6163 staticdest
="$destfile"
6167 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
6173 # Install the libtool object if requested.
6174 if test -n "$destfile"; then
6175 $show "$install_prog $file $destfile"
6176 $run eval "$install_prog $file $destfile" ||
exit $?
6179 # Install the old object if enabled.
6180 if test "$build_old_libs" = yes; then
6181 # Deduce the name of the old-style object file.
6182 staticobj
=`$echo "X$file" | $Xsed -e "$lo2o"`
6184 $show "$install_prog $staticobj $staticdest"
6185 $run eval "$install_prog \$staticobj \$staticdest" ||
exit $?
6191 # Figure out destination file name, if it wasn't already specified.
6192 if test -n "$destname"; then
6193 destfile
="$destdir/$destname"
6195 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6196 destfile
="$destdir/$destfile"
6199 # If the file is missing, and there is a .exe on the end, strip it
6200 # because it is most likely a libtool script we actually want to
6205 if test ! -f "$file"; then
6206 file=`$echo $file|${SED} 's,.exe$,,'`
6212 # Do a test to see if this is really a libtool program.
6215 wrapper
=`$echo $file | ${SED} -e 's,.exe$,,'`
6221 if (${SED} -e '4q' $wrapper |
grep "^# Generated by .*$PACKAGE")>/dev
/null
2>&1; then
6225 # Note that it is not necessary on cygwin/mingw to append a dot to
6226 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6227 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6228 # `FILE.' does not work on cygwin managed mounts.
6230 # If there is no directory component, then add one.
6232 */* |
*\\*) .
${wrapper} ;;
6233 *) . .
/${wrapper} ;;
6236 # Check the variables that should have been set.
6237 if test -z "$notinst_deplibs"; then
6238 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
6243 for lib
in $notinst_deplibs; do
6244 # Check to see that each library is installed.
6246 if test -f "$lib"; then
6247 # If there is no directory component, then add one.
6249 */* |
*\\*) .
$lib ;;
6253 libfile
="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
6254 if test -n "$libdir" && test ! -f "$libfile"; then
6255 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
6261 # Note that it is not necessary on cygwin/mingw to append a dot to
6262 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6263 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6264 # `FILE.' does not work on cygwin managed mounts.
6266 # If there is no directory component, then add one.
6268 */* |
*\\*) .
${wrapper} ;;
6269 *) . .
/${wrapper} ;;
6273 if test "$fast_install" = no
&& test -n "$relink_command"; then
6274 if test "$finalize" = yes && test -z "$run"; then
6275 tmpdir
=`func_mktempdir`
6276 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
6277 outputname
="$tmpdir/$file"
6278 # Replace the output file specification.
6279 relink_command
=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
6281 $show "$relink_command"
6282 if $run eval "$relink_command"; then :
6284 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6290 $echo "$modename: warning: cannot relink \`$file'" 1>&2
6293 # Install the binary that we compiled earlier.
6294 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
6298 # remove .exe since cygwin /usr/bin/install will append another
6300 case $install_prog,$host in
6301 */usr
/bin
/install*,*cygwin
*)
6302 case $file:$destfile in
6307 destfile
=$destfile.exe
6310 destfile
=`$echo $destfile | ${SED} -e 's,.exe$,,'`
6315 $show "$install_prog$stripme $file $destfile"
6316 $run eval "$install_prog\$stripme \$file \$destfile" ||
exit $?
6317 test -n "$outputname" && ${rm}r
"$tmpdir"
6322 for file in $staticlibs; do
6323 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6325 # Set up the ranlib parameters.
6326 oldlib
="$destdir/$name"
6328 $show "$install_prog $file $oldlib"
6329 $run eval "$install_prog \$file \$oldlib" ||
exit $?
6331 if test -n "$stripme" && test -n "$old_striplib"; then
6332 $show "$old_striplib $oldlib"
6333 $run eval "$old_striplib $oldlib" ||
exit $?
6336 # Do each command in the postinstall commands.
6337 cmds
=$old_postinstall_cmds
6338 save_ifs
="$IFS"; IFS
='~'
6339 for cmd
in $cmds; do
6343 $run eval "$cmd" ||
exit $?
6348 if test -n "$future_libdirs"; then
6349 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
6352 if test -n "$current_libdirs"; then
6353 # Maybe just do a dry run.
6354 test -n "$run" && current_libdirs
=" -n$current_libdirs"
6355 exec_cmd
='$SHELL $progpath $preserve_args --finish$current_libdirs'
6361 # libtool finish mode
6363 modename
="$modename: finish"
6367 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
6370 libdirs
="$libdirs $dir"
6373 for libdir
in $libdirs; do
6374 if test -n "$finish_cmds"; then
6375 # Do each command in the finish commands.
6377 save_ifs
="$IFS"; IFS
='~'
6378 for cmd
in $cmds; do
6382 $run eval "$cmd" || admincmds
="$admincmds
6387 if test -n "$finish_eval"; then
6388 # Do the single finish_eval.
6389 eval cmds
=\"$finish_eval\"
6390 $run eval "$cmds" || admincmds
="$admincmds
6396 # Exit here if they wanted silent mode.
6397 test "$show" = : && exit $EXIT_SUCCESS
6399 $echo "X----------------------------------------------------------------------" |
$Xsed
6400 $echo "Libraries have been installed in:"
6401 for libdir
in $libdirs; do
6405 $echo "If you ever happen to want to link against installed libraries"
6406 $echo "in a given directory, LIBDIR, you must either use libtool, and"
6407 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
6408 $echo "flag during linking and do at least one of the following:"
6409 if test -n "$shlibpath_var"; then
6410 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
6411 $echo " during execution"
6413 if test -n "$runpath_var"; then
6414 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
6415 $echo " during linking"
6417 if test -n "$hardcode_libdir_flag_spec"; then
6419 eval flag
=\"$hardcode_libdir_flag_spec\"
6421 $echo " - use the \`$flag' linker flag"
6423 if test -n "$admincmds"; then
6424 $echo " - have your system administrator run these commands:$admincmds"
6426 if test -f /etc
/ld.so.conf
; then
6427 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6430 $echo "See any operating system documentation about shared libraries for"
6431 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
6432 $echo "X----------------------------------------------------------------------" |
$Xsed
6436 # libtool execute mode
6438 modename
="$modename: execute"
6440 # The first argument is the command name.
6442 if test -z "$cmd"; then
6443 $echo "$modename: you must specify a COMMAND" 1>&2
6448 # Handle -dlopen flags immediately.
6449 for file in $execute_dlfiles; do
6450 if test ! -f "$file"; then
6451 $echo "$modename: \`$file' is not a file" 1>&2
6459 # Check to see that this really is a libtool archive.
6460 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
6462 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6467 # Read the libtool library.
6471 # If there is no directory component, then add one.
6473 */* |
*\\*) .
$file ;;
6477 # Skip this library if it cannot be dlopened.
6478 if test -z "$dlname"; then
6479 # Warn if it was a shared library.
6480 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6484 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6485 test "X$dir" = "X$file" && dir
=.
6487 if test -f "$dir/$objdir/$dlname"; then
6490 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6496 # Just add the directory containing the .lo file.
6497 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6498 test "X$dir" = "X$file" && dir
=.
6502 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6507 # Get the absolute pathname.
6508 absdir
=`cd "$dir" && pwd`
6509 test -n "$absdir" && dir
="$absdir"
6511 # Now add the directory to shlibpath_var.
6512 if eval "test -z \"\$$shlibpath_var\""; then
6513 eval "$shlibpath_var=\"\$dir\""
6515 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6519 # This variable tells wrapper scripts just to set shlibpath_var
6520 # rather than running their programs.
6521 libtool_execute_magic
="$magic"
6523 # Check if any of the arguments is a wrapper script.
6530 # Do a test to see if this is really a libtool program.
6531 if (${SED} -e '4q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6532 # If there is no directory component, then add one.
6534 */* |
*\\*) .
$file ;;
6538 # Transform arg to wrapped name.
6539 file="$progdir/$program"
6543 # Quote arguments (to preserve shell metacharacters).
6544 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6545 args
="$args \"$file\""
6548 if test -z "$run"; then
6549 if test -n "$shlibpath_var"; then
6550 # Export the shlibpath_var.
6551 eval "export $shlibpath_var"
6554 # Restore saved environment variables
6555 if test "${save_LC_ALL+set}" = set; then
6556 LC_ALL
="$save_LC_ALL"; export LC_ALL
6558 if test "${save_LANG+set}" = set; then
6559 LANG
="$save_LANG"; export LANG
6562 # Now prepare to actually exec the command.
6563 exec_cmd
="\$cmd$args"
6565 # Display what would be done.
6566 if test -n "$shlibpath_var"; then
6567 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6568 $echo "export $shlibpath_var"
6575 # libtool clean and uninstall mode
6577 modename
="$modename: $mode"
6583 # This variable tells wrapper scripts just to set variables rather
6584 # than running their programs.
6585 libtool_install_magic
="$magic"
6590 -f) rm="$rm $arg"; rmforce
=yes ;;
6591 -*) rm="$rm $arg" ;;
6592 *) files
="$files $arg" ;;
6596 if test -z "$rm"; then
6597 $echo "$modename: you must specify an RM program" 1>&2
6604 origobjdir
="$objdir"
6605 for file in $files; do
6606 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6607 if test "X$dir" = "X$file"; then
6609 objdir
="$origobjdir"
6611 objdir
="$dir/$origobjdir"
6613 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6614 test "$mode" = uninstall
&& objdir
="$dir"
6616 # Remember objdir for removal later, being careful to avoid duplicates
6617 if test "$mode" = clean
; then
6620 *) rmdirs
="$rmdirs $objdir" ;;
6624 # Don't error if the file doesn't exist and rm -f was used.
6625 if (test -L "$file") >/dev
/null
2>&1 \
6626 ||
(test -h "$file") >/dev
/null
2>&1 \
6627 ||
test -f "$file"; then
6629 elif test -d "$file"; then
6632 elif test "$rmforce" = yes; then
6640 # Possibly a libtool archive, so verify it.
6641 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6644 # Delete the libtool libraries and symlinks.
6645 for n
in $library_names; do
6646 rmfiles
="$rmfiles $objdir/$n"
6648 test -n "$old_library" && rmfiles
="$rmfiles $objdir/$old_library"
6652 case " $library_names " in
6653 # " " in the beginning catches empty $dlname
6655 *) rmfiles
="$rmfiles $objdir/$dlname" ;;
6657 test -n "$libdir" && rmfiles
="$rmfiles $objdir/$name $objdir/${name}i"
6660 if test -n "$library_names"; then
6661 # Do each command in the postuninstall commands.
6662 cmds
=$postuninstall_cmds
6663 save_ifs
="$IFS"; IFS
='~'
6664 for cmd
in $cmds; do
6669 if test "$?" -ne 0 && test "$rmforce" != yes; then
6676 if test -n "$old_library"; then
6677 # Do each command in the old_postuninstall commands.
6678 cmds
=$old_postuninstall_cmds
6679 save_ifs
="$IFS"; IFS
='~'
6680 for cmd
in $cmds; do
6685 if test "$?" -ne 0 && test "$rmforce" != yes; then
6691 # FIXME: should reinstall the best remaining shared library.
6698 # Possibly a libtool object, so verify it.
6699 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6704 # Add PIC object to the list of files to remove.
6705 if test -n "$pic_object" \
6706 && test "$pic_object" != none
; then
6707 rmfiles
="$rmfiles $dir/$pic_object"
6710 # Add non-PIC object to the list of files to remove.
6711 if test -n "$non_pic_object" \
6712 && test "$non_pic_object" != none
; then
6713 rmfiles
="$rmfiles $dir/$non_pic_object"
6719 if test "$mode" = clean
; then
6723 file=`$echo $file|${SED} 's,.exe$,,'`
6724 noexename
=`$echo $name|${SED} 's,.exe$,,'`
6725 # $file with .exe has already been added to rmfiles,
6726 # add $file without .exe
6727 rmfiles
="$rmfiles $file"
6730 # Do a test to see if this is a libtool program.
6731 if (${SED} -e '4q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6735 # note $name still contains .exe if it was in $file originally
6736 # as does the version of $file that was added into $rmfiles
6737 rmfiles
="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6738 if test "$fast_install" = yes && test -n "$relink_command"; then
6739 rmfiles
="$rmfiles $objdir/lt-$name"
6741 if test "X$noexename" != "X$name" ; then
6742 rmfiles
="$rmfiles $objdir/lt-${noexename}.c"
6748 $show "$rm $rmfiles"
6749 $run $rm $rmfiles || exit_status
=1
6751 objdir
="$origobjdir"
6753 # Try to remove the ${objdir}s in the directories where we deleted files
6754 for dir
in $rmdirs; do
6755 if test -d "$dir"; then
6757 $run rmdir $dir >/dev
/null
2>&1
6765 $echo "$modename: you must specify a MODE" 1>&2
6766 $echo "$generic_help" 1>&2
6771 if test -z "$exec_cmd"; then
6772 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6773 $echo "$generic_help" 1>&2
6776 fi # test -z "$show_help"
6778 if test -n "$exec_cmd"; then
6783 # We need to display help for each of the modes.
6786 "Usage: $modename [OPTION]... [MODE-ARG]...
6788 Provide generalized library-building support services.
6790 --config show all configuration variables
6791 --debug enable verbose shell tracing
6792 -n, --dry-run display commands without modifying any files
6793 --features display basic configuration information and exit
6794 --finish same as \`--mode=finish'
6795 --help display this help message and exit
6796 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6797 --quiet same as \`--silent'
6798 --silent don't print informational messages
6799 --tag=TAG use configuration variables from tag TAG
6800 --version print version information
6802 MODE must be one of the following:
6804 clean remove files from the build directory
6805 compile compile a source file into a libtool object
6806 execute automatically set library path, then run a program
6807 finish complete the installation of libtool libraries
6808 install install libraries or executables
6809 link create a library or an executable
6810 uninstall remove libraries from an installed directory
6812 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6813 a more detailed description of MODE.
6815 Report bugs to <bug-libtool@gnu.org>."
6821 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6823 Remove files from the build directory.
6825 RM is the name of the program to use to delete files associated with each FILE
6826 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6829 If FILE is a libtool library, object or program, all the files associated
6830 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6835 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6837 Compile a source file into a libtool library object.
6839 This mode accepts the following additional options:
6841 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6842 -prefer-pic try to building PIC objects only
6843 -prefer-non-pic try to building non-PIC objects only
6844 -static always build a \`.o' file suitable for static linking
6846 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6847 from the given SOURCEFILE.
6849 The output file name is determined by removing the directory component from
6850 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6851 library object suffix, \`.lo'."
6856 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6858 Automatically set library path, then run a program.
6860 This mode accepts the following additional options:
6862 -dlopen FILE add the directory containing FILE to the library path
6864 This mode sets the library path environment variable according to \`-dlopen'
6867 If any of the ARGS are libtool executable wrappers, then they are translated
6868 into their corresponding uninstalled binary, and any of their required library
6869 directories are added to the library path.
6871 Then, COMMAND is executed, with ARGS as arguments."
6876 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6878 Complete the installation of libtool libraries.
6880 Each LIBDIR is a directory that contains libtool libraries.
6882 The commands that this mode executes may require superuser privileges. Use
6883 the \`--dry-run' option if you just want to see what would be executed."
6888 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6890 Install executables or libraries.
6892 INSTALL-COMMAND is the installation command. The first component should be
6893 either the \`install' or \`cp' program.
6895 The rest of the components are interpreted as arguments to that command (only
6896 BSD-compatible install options are recognized)."
6901 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6903 Link object files or libraries together to form another library, or to
6904 create an executable program.
6906 LINK-COMMAND is a command using the C compiler that you would use to create
6907 a program from several object files.
6909 The following components of LINK-COMMAND are treated specially:
6911 -all-static do not do any dynamic linking at all
6912 -avoid-version do not add a version suffix if possible
6913 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6914 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6915 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6916 -export-symbols SYMFILE
6917 try to export only the symbols listed in SYMFILE
6918 -export-symbols-regex REGEX
6919 try to export only the symbols matching REGEX
6920 -LLIBDIR search LIBDIR for required installed libraries
6921 -lNAME OUTPUT-FILE requires the installed library libNAME
6922 -module build a library that can dlopened
6923 -no-fast-install disable the fast-install mode
6924 -no-install link a not-installable executable
6925 -no-undefined declare that a library does not refer to external symbols
6926 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6927 -objectlist FILE Use a list of object files found in FILE to specify objects
6928 -precious-files-regex REGEX
6929 don't remove output files matching REGEX
6930 -release RELEASE specify package release information
6931 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6932 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6933 -static do not do any dynamic linking of libtool libraries
6934 -version-info CURRENT[:REVISION[:AGE]]
6935 specify library version info [each variable defaults to 0]
6937 All other options (arguments beginning with \`-') are ignored.
6939 Every other argument is treated as a filename. Files ending in \`.la' are
6940 treated as uninstalled libtool libraries, other files are standard or library
6943 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6944 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6945 required, except when creating a convenience library.
6947 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6948 using \`ar' and \`ranlib', or on Windows using \`lib'.
6950 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6951 is created, otherwise an executable program is created."
6956 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6958 Remove libraries from an installation directory.
6960 RM is the name of the program to use to delete files associated with each FILE
6961 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6964 If FILE is a libtool library, all the files associated with it are deleted.
6965 Otherwise, only FILE itself is deleted using RM."
6969 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6976 $echo "Try \`$modename --help' for more information about other modes."
6980 # The TAGs below are defined such that we never get into a situation
6981 # in which we disable both kinds of libraries. Given conflicting
6982 # choices, we go for a static library, that is the most portable,
6983 # since we can't tell whether shared libraries were disabled because
6984 # the user asked for that or because the platform doesn't support
6985 # them. This is particularly important on AIX, because we don't
6986 # support having both static and shared libraries enabled at the same
6987 # time on that platform, so we default to a shared-only configuration.
6988 # If a disable-shared tag is given, we'll fallback to a static-only
6989 # configuration. But we'll never go from static-only to shared-only.
6991 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6993 # ### END LIBTOOL TAG CONFIG: disable-shared
6995 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6997 # ### END LIBTOOL TAG CONFIG: disable-static