1 # Generated from ltmain.m4sh.
3 # libtool (GNU libtool) 2.2.10
4 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
6 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
7 # 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
8 # This is free software; see the source for copying conditions. There is NO
9 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11 # GNU Libtool is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; either version 2 of the License, or
14 # (at your option) any later version.
16 # As a special exception to the GNU General Public License,
17 # if you distribute this file as part of a program or library that
18 # is built using GNU Libtool, you may include this file under the
19 # same distribution terms that you use for the rest of that program.
21 # GNU Libtool is distributed in the hope that it will be useful, but
22 # WITHOUT ANY WARRANTY; without even the implied warranty of
23 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 # General Public License for more details.
26 # You should have received a copy of the GNU General Public License
27 # along with GNU Libtool; see the file COPYING. If not, a copy
28 # can be downloaded from http://www.gnu.org/licenses/gpl.html,
29 # or obtained by writing to the Free Software Foundation, Inc.,
30 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
32 # Usage: $progname [OPTION]... [MODE-ARG]...
34 # Provide generalized library-building support services.
36 # --config show all configuration variables
37 # --debug enable verbose shell tracing
38 # -n, --dry-run display commands without modifying any files
39 # --features display basic configuration information and exit
40 # --mode=MODE use operation mode MODE
41 # --preserve-dup-deps don't remove duplicate dependency libraries
42 # --quiet, --silent don't print informational messages
43 # --no-quiet, --no-silent
44 # print informational messages (default)
45 # --tag=TAG use configuration variables from tag TAG
46 # -v, --verbose print more informational messages than default
47 # --no-verbose don't print the extra informational messages
48 # --version print version information
49 # -h, --help, --help-all print short, long, or detailed help message
51 # MODE must be one of the following:
53 # clean remove files from the build directory
54 # compile compile a source file into a libtool object
55 # execute automatically set library path, then run a program
56 # finish complete the installation of libtool libraries
57 # install install libraries or executables
58 # link create a library or an executable
59 # uninstall remove libraries from an installed directory
61 # MODE-ARGS vary depending on the MODE. When passed as first option,
62 # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
63 # Try `$progname --help --mode=MODE' for a more detailed description of MODE.
65 # When reporting a bug, please describe a test case to reproduce it and
66 # include the following information:
71 # compiler flags: $LTCFLAGS
72 # linker: $LD (gnu? $with_gnu_ld)
73 # $progname: (GNU libtool) 2.2.10
74 # automake: $automake_version
75 # autoconf: $autoconf_version
77 # Report bugs to <bug-libtool@gnu.org>.
83 package_revision
=1.3175
85 # Be Bourne compatible
86 if test -n "${ZSH_VERSION+set}" && (emulate sh
) >/dev
/null
2>&1; then
89 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
90 # is contrary to our usage. Disable this feature.
91 alias -g '${1+"$@"}'='"$@"'
94 case `(set -o) 2>/dev/null` in *posix
*) set -o posix
;; esac
96 BIN_SH
=xpg4
; export BIN_SH
# for Tru64
97 DUALCASE
=1; export DUALCASE
# for MKS sh
99 # A function that is used when there is no print builtin or printf.
100 func_fallback_echo
()
102 eval 'cat <<_LTECHO_EOF
107 # NLS nuisances: We save the old values to restore during execute mode.
110 for lt_var
in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
112 eval "if test \"\${$lt_var+set}\" = set; then
113 save_$lt_var=\$$lt_var
116 lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
117 lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
122 export LANGUAGE LC_ALL
127 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
128 # is ksh but when the shell is invoked as "sh" and the current value of
129 # the _XPG environment variable is not equal to 1 (one), the special
130 # positional parameter $0, within a function call, is the name of the
137 test "${ECHO+set}" = set || ECHO
=${as_echo-'printf %s\n'}
147 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
148 : ${Xsed="$SED -e 1s/^X//"}
153 EXIT_MISMATCH
=63 # $? = 63 is used to indicate version mismatch to missing.
154 EXIT_SKIP
=77 # $? = 77 is used to indicate a skipped test to automake.
156 exit_status
=$EXIT_SUCCESS
158 # Make sure IFS has a sensible default
163 dirname="s,/[^/]*$,,"
166 # func_dirname_and_basename file append nondir_replacement
167 # perform func_basename and func_dirname in a single function
169 # dirname: Compute the dirname of FILE. If nonempty,
170 # add APPEND to the result, otherwise set result
171 # to NONDIR_REPLACEMENT.
172 # value returned in "$func_dirname_result"
173 # basename: Compute filename of FILE.
174 # value retuned in "$func_basename_result"
175 # Implementation must be kept synchronized with func_dirname
176 # and func_basename. For efficiency, we do not delegate to
177 # those functions but instead duplicate the functionality here.
178 func_dirname_and_basename
()
180 # Extract subdirectory from the argument.
181 func_dirname_result
=`$ECHO "${1}" | $SED -e "$dirname"`
182 if test "X$func_dirname_result" = "X${1}"; then
183 func_dirname_result
="${3}"
185 func_dirname_result
="$func_dirname_result${2}"
187 func_basename_result
=`$ECHO "${1}" | $SED -e "$basename"`
190 # Generated shell functions inserted here.
192 # These SED scripts presuppose an absolute path with a trailing slash.
193 pathcar
='s,^/\([^/]*\).*$,\1,'
194 pathcdr
='s,^/[^/]*,,'
195 removedotparts
=':dotsl
199 collapseslashes
='s@/\{1,\}@/@g'
200 finalslash
='s,/*$,/,'
202 # func_normal_abspath PATH
203 # Remove doubled-up and trailing slashes, "." path components,
204 # and cancel out any ".." path components in PATH after making
205 # it an absolute path.
206 # value returned in "$func_normal_abspath_result"
207 func_normal_abspath
()
209 # Start from root dir and reassemble the path.
210 func_normal_abspath_result
=
211 func_normal_abspath_tpath
=$1
212 func_normal_abspath_altnamespace
=
213 case $func_normal_abspath_tpath in
215 # Empty path, that just means $cwd.
216 func_stripname
'' '/' "`pwd`"
217 func_normal_abspath_result
=$func_stripname_result
220 # The next three entries are used to spot a run of precisely
221 # two leading slashes without using negated character classes;
222 # we take advantage of case's first-match behaviour.
224 # Unusual form of absolute path, do nothing.
227 # Not necessarily an ordinary path; POSIX reserves leading '//'
228 # and for example Cygwin uses it to access remote file shares
229 # over CIFS/SMB, so we conserve a leading double slash if found.
230 func_normal_abspath_altnamespace
=/
233 # Absolute path, do nothing.
236 # Relative path, prepend $cwd.
237 func_normal_abspath_tpath
=`pwd`/$func_normal_abspath_tpath
240 # Cancel out all the simple stuff to save iterations. We also want
241 # the path to end with a slash for ease of parsing, so make sure
242 # there is one (and only one) here.
243 func_normal_abspath_tpath
=`$ECHO "$func_normal_abspath_tpath" | $SED \
244 -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
246 # Processed it all yet?
247 if test "$func_normal_abspath_tpath" = / ; then
248 # If we ascended to the root using ".." the result may be empty now.
249 if test -z "$func_normal_abspath_result" ; then
250 func_normal_abspath_result
=/
254 func_normal_abspath_tcomponent
=`$ECHO "$func_normal_abspath_tpath" | $SED \
256 func_normal_abspath_tpath
=`$ECHO "$func_normal_abspath_tpath" | $SED \
258 # Figure out what to do with it
259 case $func_normal_abspath_tcomponent in
261 # Trailing empty path component, ignore it.
264 # Parent dir; strip last assembled component from result.
265 func_dirname
"$func_normal_abspath_result"
266 func_normal_abspath_result
=$func_dirname_result
269 # Actual path component, append it.
270 func_normal_abspath_result
=$func_normal_abspath_result/$func_normal_abspath_tcomponent
274 # Restore leading double-slash if one was found on entry.
275 func_normal_abspath_result
=$func_normal_abspath_altnamespace$func_normal_abspath_result
278 # func_relative_path SRCDIR DSTDIR
279 # generates a relative path from SRCDIR to DSTDIR, with a trailing
280 # slash if non-empty, suitable for immediately appending a filename
281 # without needing to append a separator.
282 # value returned in "$func_relative_path_result"
283 func_relative_path
()
285 func_relative_path_result
=
286 func_normal_abspath
"$1"
287 func_relative_path_tlibdir
=$func_normal_abspath_result
288 func_normal_abspath
"$2"
289 func_relative_path_tbindir
=$func_normal_abspath_result
291 # Ascend the tree starting from libdir
293 # check if we have found a prefix of bindir
294 case $func_relative_path_tbindir in
295 $func_relative_path_tlibdir)
296 # found an exact match
297 func_relative_path_tcancelled
=
300 $func_relative_path_tlibdir*)
301 # found a matching prefix
302 func_stripname
"$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
303 func_relative_path_tcancelled
=$func_stripname_result
304 if test -z "$func_relative_path_result"; then
305 func_relative_path_result
=.
310 func_dirname
$func_relative_path_tlibdir
311 func_relative_path_tlibdir
=${func_dirname_result}
312 if test "x$func_relative_path_tlibdir" = x
; then
313 # Have to descend all the way to the root!
314 func_relative_path_result
=..
/$func_relative_path_result
315 func_relative_path_tcancelled
=$func_relative_path_tbindir
318 func_relative_path_result
=..
/$func_relative_path_result
323 # Now calculate path; take care to avoid doubling-up slashes.
324 func_stripname
'' '/' "$func_relative_path_result"
325 func_relative_path_result
=$func_stripname_result
326 func_stripname
'/' '/' "$func_relative_path_tcancelled"
327 if test "x$func_stripname_result" != x
; then
328 func_relative_path_result
=${func_relative_path_result}/${func_stripname_result}
331 # Normalisation. If bindir is libdir, return empty string,
332 # else relative path ending with a slash; either way, target
333 # file name can be directly appended.
334 if test ! -z "$func_relative_path_result"; then
335 func_stripname
'./' '' "$func_relative_path_result/"
336 func_relative_path_result
=$func_stripname_result
340 # The name of this program:
341 func_dirname_and_basename
"$progpath"
342 progname
=$func_basename_result
344 # Make sure we have an absolute path for reexecution:
346 [\\/]*|
[A-Za-z
]:\\*) ;;
348 progdir
=$func_dirname_result
349 progdir
=`cd "$progdir" && pwd`
350 progpath
="$progdir/$progname"
355 for progdir
in $PATH; do
357 test -x "$progdir/$progname" && break
360 test -n "$progdir" || progdir
=`pwd`
361 progpath
="$progdir/$progname"
365 # Sed substitution that helps us do robust quoting. It backslashifies
366 # metacharacters that are still active within double-quoted strings.
367 Xsed
="${SED}"' -e 1s/^X//'
368 sed_quote_subst
='s/\([`"$\\]\)/\\\1/g'
370 # Same as above, but do not quote variable references.
371 double_quote_subst
='s/\(["`\\]\)/\\\1/g'
373 # Re-`\' parameter expansions in output of double_quote_subst that were
374 # `\'-ed in input to the same. If an odd number of `\' preceded a '$'
375 # in input to double_quote_subst, that '$' was protected from expansion.
376 # Since each input `\' is now two `\'s, look for any number of runs of
377 # four `\'s followed by two `\'s and then a '$'. `\' that '$'.
382 sed_double_backslash
="\
386 s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
397 # Echo program name prefixed message, along with the current mode
398 # name if it has been set yet.
401 $ECHO "$progname${mode+: }$mode: $*"
404 # func_verbose arg...
405 # Echo program name prefixed message in verbose mode only.
408 $opt_verbose && func_echo
${1+"$@"}
410 # A bug in bash halts the script if the last line of a function
411 # fails when set -e is in force, so we need another command to
416 # func_echo_all arg...
417 # Invoke $ECHO with all args, space-separated.
424 # Echo program name prefixed message to standard error.
427 $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
430 # func_warning arg...
431 # Echo program name prefixed warning message to standard error.
434 $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
440 # func_fatal_error arg...
441 # Echo program name prefixed message to standard error, and exit.
448 # func_fatal_help arg...
449 # Echo program name prefixed message to standard error, followed by
450 # a help hint, and exit.
454 func_fatal_error
"$help"
456 help="Try \`$progname --help' for more information." ## default
459 # func_grep expression filename
460 # Check whether EXPRESSION matches any line of FILENAME, without output.
463 $GREP "$1" "$2" >/dev
/null
2>&1
467 # func_mkdir_p directory-path
468 # Make sure the entire path to DIRECTORY-PATH is available.
471 my_directory_path
="$1"
474 if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
476 # Protect directory names starting with `-'
477 case $my_directory_path in
478 -*) my_directory_path
="./$my_directory_path" ;;
481 # While some portion of DIR does not yet exist...
482 while test ! -d "$my_directory_path"; do
483 # ...make a list in topmost first order. Use a colon delimited
484 # list incase some portion of path contains whitespace.
485 my_dir_list
="$my_directory_path:$my_dir_list"
487 # If the last portion added has no slash in it, the list is done
488 case $my_directory_path in */*) ;; *) break ;; esac
490 # ...otherwise throw away the child directory and loop
491 my_directory_path
=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
493 my_dir_list
=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
495 save_mkdir_p_IFS
="$IFS"; IFS
=':'
496 for my_dir
in $my_dir_list; do
497 IFS
="$save_mkdir_p_IFS"
498 # mkdir can fail with a `File exist' error if two processes
499 # try to create one of the directories concurrently. Don't
501 $MKDIR "$my_dir" 2>/dev
/null ||
:
503 IFS
="$save_mkdir_p_IFS"
505 # Bail out if we (or some other process) failed to create a directory.
506 test -d "$my_directory_path" || \
507 func_fatal_error
"Failed to create \`$1'"
512 # func_mktempdir [string]
513 # Make a temporary directory that won't clash with other running
514 # libtool processes, and avoids race conditions if possible. If
515 # given, STRING is the basename for that directory.
518 my_template
="${TMPDIR-/tmp}/${1-$progname}"
520 if test "$opt_dry_run" = ":"; then
521 # Return a directory name, but don't create it in dry-run mode
522 my_tmpdir
="${my_template}-$$"
525 # If mktemp works, use that first and foremost
526 my_tmpdir
=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
528 if test ! -d "$my_tmpdir"; then
529 # Failing that, at least try and use $RANDOM to avoid a race
530 my_tmpdir
="${my_template}-${RANDOM-0}$$"
532 save_mktempdir_umask
=`umask`
535 umask $save_mktempdir_umask
538 # If we're not in dry-run mode, bomb out on failure
539 test -d "$my_tmpdir" || \
540 func_fatal_error
"cannot create temporary directory \`$my_tmpdir'"
547 # func_quote_for_eval arg
548 # Aesthetically quote ARG to be evaled later.
549 # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
550 # is double-quoted, suitable for a subsequent eval, whereas
551 # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
552 # which are still active within double quotes backslashified.
553 func_quote_for_eval
()
557 func_quote_for_eval_unquoted_result=`$ECHO "$1" |
$SED "$sed_quote_subst"` ;;
559 func_quote_for_eval_unquoted_result="$1" ;;
562 case $func_quote_for_eval_unquoted_result in
563 # Double-quote args containing shell metacharacters to delay
564 # word splitting, command substitution and and variable
565 # expansion for a subsequent eval.
566 # Many Bourne shells cannot handle close brackets correctly
567 # in scan sets, so we specify it separately.
568 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
569 func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
572 func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
577 # func_quote_for_expand arg
578 # Aesthetically quote ARG to be evaled later; same as above,
579 # but do not quote variable references.
580 func_quote_for_expand ()
584 my_arg
=`$ECHO "$1" | $SED \
585 -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
591 # Double-quote args containing shell metacharacters to delay
592 # word splitting and command substitution for a subsequent eval.
593 # Many Bourne shells cannot handle close brackets correctly
594 # in scan sets, so we specify it separately.
595 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
600 func_quote_for_expand_result
="$my_arg"
604 # func_show_eval cmd [fail_exp]
605 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
606 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
607 # is given, then evaluate it.
613 ${opt_silent-false} ||
{
614 func_quote_for_expand
"$my_cmd"
615 eval "func_echo $func_quote_for_expand_result"
618 if ${opt_dry_run-false}; then :; else
621 if test "$my_status" -eq 0; then :; else
622 eval "(exit $my_status); $my_fail_exp"
628 # func_show_eval_locale cmd [fail_exp]
629 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
630 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
631 # is given, then evaluate it. Use the saved locale for evaluation.
632 func_show_eval_locale
()
637 ${opt_silent-false} ||
{
638 func_quote_for_expand
"$my_cmd"
639 eval "func_echo $func_quote_for_expand_result"
642 if ${opt_dry_run-false}; then :; else
643 eval "$lt_user_locale
646 eval "$lt_safe_locale"
647 if test "$my_status" -eq 0; then :; else
648 eval "(exit $my_status); $my_fail_exp"
655 # Echo version message to standard output and exit.
666 /^# '$PROGRAM' (GNU /,/# warranty; / {
669 s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
676 # Echo short help message to standard output and exit.
679 $SED -n '/^# Usage:/,/^# *.*--help/ {
682 s/\$progname/'$progname'/
686 $ECHO "run \`$progname --help | more' for full usage"
691 # Echo long help message to standard output and exit,
692 # unless 'noexit' is passed as argument.
695 $SED -n '/^# Usage:/,/# Report bugs to/ {
698 s*\$progname*'$progname'*
700 s*\$SHELL*'"$SHELL"'*
702 s*\$LTCFLAGS*'"$LTCFLAGS"'*
704 s/\$with_gnu_ld/'"$with_gnu_ld"'/
705 s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
706 s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
710 if test -z "$1"; then
715 # func_missing_arg argname
716 # Echo program name prefixed message to standard error and set global
720 func_error
"missing argument for $1."
731 magic
="%%%MAGIC variable%%%"
732 magic_exe
="%%%MAGIC EXE variable%%%"
739 lo2o
="s/\\.lo\$/.${objext}/"
740 o2lo
="s/\\.${objext}\$/.lo/"
745 opt_duplicate_deps
=false
749 # If this variable is set in any of the actions, the command in it
750 # will be execed at the end. This prevents here-documents from being
751 # left over by shells.
754 # func_fatal_configuration arg...
755 # Echo program name prefixed message to standard error, followed by
756 # a configuration failure hint, and exit.
757 func_fatal_configuration
()
760 func_error
"See the $PACKAGE documentation for more information."
761 func_fatal_error
"Fatal configuration error."
766 # Display the configuration for all the tags in this script.
769 re_begincf
='^# ### BEGIN LIBTOOL'
770 re_endcf
='^# ### END LIBTOOL'
772 # Default configuration.
773 $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
775 # Now print the configurations for the tags.
776 for tagname
in $taglist; do
777 $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
784 # Display the features supported by this script.
788 if test "$build_libtool_libs" = yes; then
789 echo "enable shared libraries"
791 echo "disable shared libraries"
793 if test "$build_old_libs" = yes; then
794 echo "enable static libraries"
796 echo "disable static libraries"
802 # func_enable_tag tagname
803 # Verify that TAGNAME is valid, and either flag an error and exit, or
804 # enable the TAGNAME tag. We also add TAGNAME to the global $taglist
811 re_begincf
="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
812 re_endcf
="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
813 sed_extractcf
="/$re_begincf/,/$re_endcf/p"
818 func_fatal_error
"invalid tag name: $tagname"
822 # Don't test for the "default" C tag, as we know it's
823 # there but not specially marked.
827 if $GREP "$re_begincf" "$progpath" >/dev
/null
2>&1; then
828 taglist
="$taglist $tagname"
830 # Evaluate the configuration. Be careful to quote the path
831 # and the sed script, to avoid splitting on whitespace, but
832 # also don't use non-portable quotes within backquotes within
833 # quotes we have to do it in 2 steps:
834 extractedcf
=`$SED -n -e "$sed_extractcf" < "$progpath"`
837 func_error
"ignoring unknown tag $tagname"
843 # Parse options once, thoroughly. This comes as soon as possible in
844 # the script to make things like `libtool --version' happen quickly.
847 # Shorthand for --mode=foo, only valid as the first argument
850 shift; set dummy
--mode clean
${1+"$@"}; shift
852 compile|compil|compi|comp|com|co|c
)
853 shift; set dummy
--mode compile
${1+"$@"}; shift
855 execute|execut|execu|
exec|exe|ex|e
)
856 shift; set dummy
--mode execute
${1+"$@"}; shift
858 finish|finis|fini|fin|
fi|f
)
859 shift; set dummy
--mode finish
${1+"$@"}; shift
861 install|instal|insta|inst|ins|
in|i
)
862 shift; set dummy
--mode install ${1+"$@"}; shift
865 shift; set dummy
--mode link
${1+"$@"}; shift
867 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u
)
868 shift; set dummy
--mode uninstall
${1+"$@"}; shift
872 # Parse non-mode specific arguments:
873 while test "$#" -gt 0; do
878 --config) func_config
;;
880 --debug) preserve_args
="$preserve_args $opt"
881 func_echo
"enabling shell trace mode"
886 -dlopen) test "$#" -eq 0 && func_missing_arg
"$opt" && break
887 execute_dlfiles
="$execute_dlfiles $1"
891 --dry-run |
-n) opt_dry_run
=: ;;
892 --features) func_features
;;
893 --finish) mode
="finish" ;;
895 --mode) test "$#" -eq 0 && func_missing_arg
"$opt" && break
897 # Valid mode arguments:
907 # Catch anything else as an error
908 *) func_error
"invalid argument for $opt"
919 opt_duplicate_deps
=: ;;
921 --quiet|
--silent) preserve_args
="$preserve_args $opt"
926 --no-quiet|
--no-silent)
927 preserve_args
="$preserve_args $opt"
931 --verbose|
-v) preserve_args
="$preserve_args $opt"
936 --no-verbose) preserve_args
="$preserve_args $opt"
940 --tag) test "$#" -eq 0 && func_missing_arg
"$opt" && break
941 preserve_args
="$preserve_args $opt $1"
942 func_enable_tag
"$1" # tagname is set here
946 # Separate optargs to long options:
947 -dlopen=*|
--mode=*|
--tag=*)
948 func_opt_split
"$opt"
949 set dummy
"$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
953 -\?|
-h) func_usage
;;
954 --help) opt_help
=: ;;
955 --help-all) opt_help
=': help-all' ;;
956 --version) func_version
;;
958 -*) func_fatal_help
"unrecognized option \`$opt'" ;;
968 *cygwin
* |
*mingw
* |
*pw32
* |
*cegcc
*)
969 # don't eliminate duplications in $postdeps and $predeps
970 opt_duplicate_compiler_generated_deps
=:
973 opt_duplicate_compiler_generated_deps
=$opt_duplicate_deps
977 # Having warned about all mis-specified options, bail out if
978 # anything was wrong.
979 $exit_cmd $EXIT_FAILURE
982 # func_check_version_match
983 # Ensure that we are using m4 macros, and libtool script from the same
984 # release of libtool.
985 func_check_version_match
()
987 if test "$package_revision" != "$macro_revision"; then
988 if test "$VERSION" != "$macro_version"; then
989 if test -z "$macro_version"; then
991 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
992 $progname: definition of this LT_INIT comes from an older release.
993 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
994 $progname: and run autoconf again.
998 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
999 $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
1000 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
1001 $progname: and run autoconf again.
1006 $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
1007 $progname: but the definition of this LT_INIT comes from revision $macro_revision.
1008 $progname: You should recreate aclocal.m4 with macros from revision $package_revision
1009 $progname: of $PACKAGE $VERSION and run autoconf again.
1023 # Sanity checks first:
1024 func_check_version_match
1026 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
1027 func_fatal_configuration
"not configured to build any kind of library"
1030 test -z "$mode" && func_fatal_error
"error: you must specify a MODE."
1034 eval std_shrext
=\"$shrext_cmds\"
1037 # Only execute mode is allowed to have -dlopen flags.
1038 if test -n "$execute_dlfiles" && test "$mode" != execute
; then
1039 func_error
"unrecognized option \`-dlopen'"
1044 # Change the help message to a mode-specific one.
1045 generic_help
="$help"
1046 help="Try \`$progname --help --mode=$mode' for more information."
1051 # True iff FILE is a libtool `.la' library or `.lo' object file.
1052 # This function is only a basic sanity check; it will hardly flush out
1053 # determined imposters.
1057 $SED -e 4q
"$1" 2>/dev
/null \
1058 |
$GREP "^# Generated by .*$PACKAGE" > /dev
/null
2>&1
1061 # func_lalib_unsafe_p file
1062 # True iff FILE is a libtool `.la' library or `.lo' object file.
1063 # This function implements the same check as func_lalib_p without
1064 # resorting to external programs. To this end, it redirects stdin and
1065 # closes it afterwards, without saving the original file descriptor.
1066 # As a safety measure, use it only where a negative result would be
1067 # fatal anyway. Works if `file' does not exist.
1068 func_lalib_unsafe_p
()
1071 if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
1072 for lalib_p_l
in 1 2 3 4
1075 case "$lalib_p_line" in
1076 \
#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
1081 test "$lalib_p" = yes
1084 # func_ltwrapper_script_p file
1085 # True iff FILE is a libtool wrapper script
1086 # This function is only a basic sanity check; it will hardly flush out
1087 # determined imposters.
1088 func_ltwrapper_script_p
()
1093 # func_ltwrapper_executable_p file
1094 # True iff FILE is a libtool wrapper executable
1095 # This function is only a basic sanity check; it will hardly flush out
1096 # determined imposters.
1097 func_ltwrapper_executable_p
()
1099 func_ltwrapper_exec_suffix
=
1102 *) func_ltwrapper_exec_suffix
=.exe
;;
1104 $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev
/null
2>&1
1107 # func_ltwrapper_scriptname file
1108 # Assumes file is an ltwrapper_executable
1109 # uses $file to determine the appropriate filename for a
1110 # temporary ltwrapper_script.
1111 func_ltwrapper_scriptname
()
1113 func_ltwrapper_scriptname_result
=""
1114 if func_ltwrapper_executable_p
"$1"; then
1115 func_dirname_and_basename
"$1" "" "."
1116 func_stripname
'' '.exe' "$func_basename_result"
1117 func_ltwrapper_scriptname_result
="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
1121 # func_ltwrapper_p file
1122 # True iff FILE is a libtool wrapper script or wrapper executable
1123 # This function is only a basic sanity check; it will hardly flush out
1124 # determined imposters.
1127 func_ltwrapper_script_p
"$1" || func_ltwrapper_executable_p
"$1"
1131 # func_execute_cmds commands fail_cmd
1132 # Execute tilde-delimited COMMANDS.
1133 # If FAIL_CMD is given, eval that upon failure.
1134 # FAIL_CMD may read-access the current command in variable CMD!
1135 func_execute_cmds
()
1138 save_ifs
=$IFS; IFS
='~'
1142 func_show_eval
"$cmd" "${2-:}"
1149 # Source FILE, adding directory component if necessary.
1150 # Note that it is not necessary on cygwin/mingw to append a dot to
1151 # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
1152 # behavior happens only for exec(3), not for open(2)! Also, sourcing
1153 # `FILE.' does not work on cygwin managed mounts.
1158 */* |
*\\*) .
"$1" ;;
1164 # func_infer_tag arg
1165 # Infer tagged configuration to use if any are available and
1166 # if one wasn't chosen via the "--tag" command line option.
1167 # Only attempt this if the compiler in the base compile
1168 # command doesn't match the default compiler.
1169 # arg is usually of the form 'gcc ...'
1174 # FreeBSD-specific: where we install compilers with non-standard names
1175 tag_compilers_CC
="*cc cc* *gcc gcc* clang"
1176 tag_compilers_CXX
="*c++ c++* *g++ g++* clang++"
1177 base_compiler
=`set -- "$@"; echo $1`
1179 # If $tagname isn't set, then try to infer if the default "CC" tag applies
1180 if test -z "$tagname"; then
1181 for zp
in $tag_compilers_CC; do
1182 case $base_compiler in
1183 $zp) tagname
="CC"; break;;
1188 if test -n "$available_tags" && test -z "$tagname"; then
1191 func_quote_for_eval
"$arg"
1192 CC_quoted
="$CC_quoted $func_quote_for_eval_result"
1194 CC_expanded
=`func_echo_all $CC`
1195 CC_quoted_expanded
=`func_echo_all $CC_quoted`
1197 # Blanks in the command may have been stripped by the calling shell,
1198 # but not from the CC environment variable when configure was run.
1199 " $CC "* |
"$CC "* |
" $CC_expanded "* |
"$CC_expanded "* | \
1200 " $CC_quoted"* |
"$CC_quoted "* |
" $CC_quoted_expanded "* |
"$CC_quoted_expanded "*) ;;
1201 # Blanks at the start of $base_compile will cause this to fail
1202 # if we don't check for them as well.
1204 for z
in $available_tags; do
1205 if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev
/null
; then
1206 # Evaluate the configuration.
1207 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
1210 # Double-quote args containing other shell metacharacters.
1211 func_quote_for_eval
"$arg"
1212 CC_quoted
="$CC_quoted $func_quote_for_eval_result"
1214 CC_expanded
=`func_echo_all $CC`
1215 CC_quoted_expanded
=`func_echo_all $CC_quoted`
1217 " $CC "* |
"$CC "* |
" $CC_expanded "* |
"$CC_expanded "* | \
1218 " $CC_quoted"* |
"$CC_quoted "* |
" $CC_quoted_expanded "* |
"$CC_quoted_expanded "*)
1219 # The compiler in the base compile command matches
1220 # the one in the tagged configuration.
1221 # Assume this is the tagged configuration we want.
1227 # FreeBSD-specific: try compilers based on inferred tag
1228 if test -z "$tagname"; then
1229 eval "tag_compilers=\$tag_compilers_${z}"
1230 if test -n "$tag_compilers"; then
1231 for zp
in $tag_compilers; do
1232 case $base_compiler in
1233 $zp) tagname
=$z; break;;
1236 if test -n "$tagname"; then
1243 # If $tagname still isn't set, then no tagged configuration
1244 # was found and let the user know that the "--tag" command
1245 # line option must be used.
1246 if test -z "$tagname"; then
1247 func_echo
"unable to infer tagged configuration"
1248 func_fatal_error
"specify a tag with \`--tag'"
1250 # func_verbose "using $tagname tagged configuration"
1259 # func_write_libtool_object output_name pic_name nonpic_name
1260 # Create a libtool object file (analogous to a ".la" file),
1261 # but don't create it if we're doing a dry run.
1262 func_write_libtool_object
()
1265 if test "$build_libtool_libs" = yes; then
1271 if test "$build_old_libs" = yes; then
1272 write_oldobj
=\'${3}\'
1278 cat >${write_libobj}T
<<EOF
1279 # $write_libobj - a libtool object file
1280 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
1282 # Please DO NOT delete this file!
1283 # It is necessary for linking the library.
1285 # Name of the PIC object.
1286 pic_object=$write_lobj
1288 # Name of the non-PIC object
1289 non_pic_object=$write_oldobj
1292 $MV "${write_libobj}T" "${write_libobj}"
1296 # func_mode_compile arg...
1297 func_mode_compile
()
1300 # Get the compilation command and the source file.
1302 srcfile
="$nonopt" # always keep a non-empty value in "srcfile"
1314 # do not "continue". Instead, add this to base_compile
1326 # Accept any command-line options.
1329 test -n "$libobj" && \
1330 func_fatal_error
"you cannot specify \`-o' more than once"
1335 -pie |
-fpie |
-fPIE)
1336 pie_flag
="$pie_flag $arg"
1340 -shared |
-static |
-prefer-pic |
-prefer-non-pic)
1351 arg_mode
=arg
# the next one goes into the "base_compile" arg list
1352 continue # The current "srcfile" will either be retained or
1353 ;; # replaced later. I would guess that would be a bug.
1356 func_stripname
'-Wc,' '' "$arg"
1357 args
=$func_stripname_result
1359 save_ifs
="$IFS"; IFS
=','
1360 for arg
in $args; do
1362 func_quote_for_eval
"$arg"
1363 lastarg
="$lastarg $func_quote_for_eval_result"
1366 func_stripname
' ' '' "$lastarg"
1367 lastarg
=$func_stripname_result
1369 # Add the arguments to base_compile.
1370 base_compile
="$base_compile $lastarg"
1375 # Accept the current argument as the source file.
1376 # The previous "srcfile" becomes the current argument.
1383 esac # case $arg_mode
1385 # Aesthetically quote the previous argument.
1386 func_quote_for_eval
"$lastarg"
1387 base_compile
="$base_compile $func_quote_for_eval_result"
1392 func_fatal_error
"you must specify an argument for -Xcompile"
1395 func_fatal_error
"you must specify a target with \`-o'"
1398 # Get the name of the library object.
1399 test -z "$libobj" && {
1400 func_basename
"$srcfile"
1401 libobj
="$func_basename_result"
1406 # Recognize several different file suffixes.
1407 # If the user specifies -o file.o, it is replaced with file.lo
1410 *.ada |
*.adb |
*.ads |
*.asm | \
1411 *.c
++ |
*.cc |
*.ii |
*.class |
*.cpp |
*.cxx | \
1412 *.
[fF
][09]? |
*.
for |
*.java |
*.obj |
*.sx |
*.cu |
*.cup
)
1413 func_xform
"$libobj"
1414 libobj
=$func_xform_result
1419 *.lo
) func_lo2o
"$libobj"; obj
=$func_lo2o_result ;;
1421 func_fatal_error
"cannot determine name of library object from \`$libobj'"
1425 func_infer_tag
$base_compile
1427 for arg
in $later; do
1430 test "$build_libtool_libs" != yes && \
1431 func_fatal_configuration
"can not build a shared library"
1437 build_libtool_libs
=no
1454 func_quote_for_eval
"$libobj"
1455 test "X$libobj" != "X$func_quote_for_eval_result" \
1456 && $ECHO "X$libobj" |
$GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
1457 && func_warning
"libobj name \`$libobj' may not contain shell special characters."
1458 func_dirname_and_basename
"$obj" "/" ""
1459 objname
="$func_basename_result"
1460 xdir
="$func_dirname_result"
1461 lobj
=${xdir}$objdir/$objname
1463 test -z "$base_compile" && \
1464 func_fatal_help
"you must specify a compilation command"
1466 # Delete any leftover library objects.
1467 if test "$build_old_libs" = yes; then
1468 removelist
="$obj $lobj $libobj ${libobj}T"
1470 removelist
="$lobj $libobj ${libobj}T"
1473 # On Cygwin there's no "real" PIC flag so we must build both object types
1475 cygwin
* | mingw
* | pw32
* | os2
* | cegcc
*)
1479 if test "$pic_mode" = no
&& test "$deplibs_check_method" != pass_all
; then
1480 # non-PIC code in shared libraries is not supported
1484 # Calculate the filename of the output object if compiler does
1485 # not support -o with -c
1486 if test "$compiler_c_o" = no
; then
1487 output_obj
=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.
${objext}
1488 lockfile
="$output_obj.lock"
1495 # Lock this critical section if it is needed
1496 # We use this script file to make the link, it avoids creating a new file
1497 if test "$need_locks" = yes; then
1498 until $opt_dry_run ||
ln "$progpath" "$lockfile" 2>/dev
/null
; do
1499 func_echo
"Waiting for $lockfile to be removed"
1502 elif test "$need_locks" = warn
; then
1503 if test -f "$lockfile"; then
1505 *** ERROR, $lockfile exists and contains:
1506 `cat $lockfile 2>/dev/null`
1508 This indicates that another process is trying to use the same
1509 temporary object file, and libtool could not work around it because
1510 your compiler does not support \`-c' and \`-o' together. If you
1511 repeat this compilation, it may succeed, by chance, but you had better
1512 avoid parallel builds (make -j) in this platform, or get a better
1515 $opt_dry_run ||
$RM $removelist
1518 removelist
="$removelist $output_obj"
1519 $ECHO "$srcfile" > "$lockfile"
1522 $opt_dry_run ||
$RM $removelist
1523 removelist
="$removelist $lockfile"
1524 trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
1526 if test -n "$fix_srcfile_path"; then
1527 eval srcfile
=\"$fix_srcfile_path\"
1529 func_quote_for_eval
"$srcfile"
1530 qsrcfile
=$func_quote_for_eval_result
1532 # Only build a PIC object if we are building libtool libraries.
1533 if test "$build_libtool_libs" = yes; then
1534 # Without this assignment, base_compile gets emptied.
1535 fbsd_hideous_sh_bug
=$base_compile
1537 if test "$pic_mode" != no
; then
1538 command="$base_compile $qsrcfile $pic_flag"
1540 # Don't build PIC code
1541 command="$base_compile $qsrcfile"
1544 func_mkdir_p
"$xdir$objdir"
1546 if test -z "$output_obj"; then
1547 # Place PIC objects in $objdir
1548 command="$command -o $lobj"
1551 func_show_eval_locale
"$command" \
1552 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
1554 if test "$need_locks" = warn
&&
1555 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1557 *** ERROR, $lockfile contains:
1558 `cat $lockfile 2>/dev/null`
1560 but it should contain:
1563 This indicates that another process is trying to use the same
1564 temporary object file, and libtool could not work around it because
1565 your compiler does not support \`-c' and \`-o' together. If you
1566 repeat this compilation, it may succeed, by chance, but you had better
1567 avoid parallel builds (make -j) in this platform, or get a better
1570 $opt_dry_run ||
$RM $removelist
1574 # Just move the object if needed, then go on to compile the next one
1575 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1576 func_show_eval
'$MV "$output_obj" "$lobj"' \
1577 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
1580 # Allow error messages only from the first compilation.
1581 if test "$suppress_opt" = yes; then
1582 suppress_output
=' >/dev/null 2>&1'
1586 # Only build a position-dependent object if we build old libraries.
1587 if test "$build_old_libs" = yes; then
1588 if test "$pic_mode" != yes; then
1589 # Don't build PIC code
1590 command="$base_compile $qsrcfile$pie_flag"
1592 command="$base_compile $qsrcfile $pic_flag"
1594 if test "$compiler_c_o" = yes; then
1595 command="$command -o $obj"
1598 # Suppress compiler output if we already did a PIC compilation.
1599 command="$command$suppress_output"
1600 func_show_eval_locale
"$command" \
1601 '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
1603 if test "$need_locks" = warn
&&
1604 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1606 *** ERROR, $lockfile contains:
1607 `cat $lockfile 2>/dev/null`
1609 but it should contain:
1612 This indicates that another process is trying to use the same
1613 temporary object file, and libtool could not work around it because
1614 your compiler does not support \`-c' and \`-o' together. If you
1615 repeat this compilation, it may succeed, by chance, but you had better
1616 avoid parallel builds (make -j) in this platform, or get a better
1619 $opt_dry_run ||
$RM $removelist
1623 # Just move the object if needed
1624 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1625 func_show_eval
'$MV "$output_obj" "$obj"' \
1626 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
1631 func_write_libtool_object
"$libobj" "$objdir/$objname" "$objname"
1633 # Unlock the critical section if it was locked
1634 if test "$need_locks" != no
; then
1635 removelist
=$lockfile
1644 test "$mode" = compile
&& func_mode_compile
${1+"$@"}
1649 # We need to display help for each of the modes.
1652 # Generic help is extracted from the usage comments
1653 # at the start of this file.
1659 "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
1661 Remove files from the build directory.
1663 RM is the name of the program to use to delete files associated with each FILE
1664 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
1667 If FILE is a libtool library, object or program, all the files associated
1668 with it are deleted. Otherwise, only FILE itself is deleted using RM."
1673 "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
1675 Compile a source file into a libtool library object.
1677 This mode accepts the following additional options:
1679 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
1680 -no-suppress do not suppress compiler output for multiple passes
1681 -prefer-pic try to build PIC objects only
1682 -prefer-non-pic try to build non-PIC objects only
1683 -shared do not build a \`.o' file suitable for static linking
1684 -static only build a \`.o' file suitable for static linking
1685 -Wc,FLAG pass FLAG directly to the compiler
1687 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
1688 from the given SOURCEFILE.
1690 The output file name is determined by removing the directory component from
1691 SOURCEFILE, then substituting the C source code suffix \`.c' with the
1692 library object suffix, \`.lo'."
1697 "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
1699 Automatically set library path, then run a program.
1701 This mode accepts the following additional options:
1703 -dlopen FILE add the directory containing FILE to the library path
1705 This mode sets the library path environment variable according to \`-dlopen'
1708 If any of the ARGS are libtool executable wrappers, then they are translated
1709 into their corresponding uninstalled binary, and any of their required library
1710 directories are added to the library path.
1712 Then, COMMAND is executed, with ARGS as arguments."
1717 "Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
1719 Complete the installation of libtool libraries.
1721 Each LIBDIR is a directory that contains libtool libraries.
1723 The commands that this mode executes may require superuser privileges. Use
1724 the \`--dry-run' option if you just want to see what would be executed."
1729 "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
1731 Install executables or libraries.
1733 INSTALL-COMMAND is the installation command. The first component should be
1734 either the \`install' or \`cp' program.
1736 The following components of INSTALL-COMMAND are treated specially:
1738 -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
1740 The rest of the components are interpreted as arguments to that command (only
1741 BSD-compatible install options are recognized)."
1746 "Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
1748 Link object files or libraries together to form another library, or to
1749 create an executable program.
1751 LINK-COMMAND is a command using the C compiler that you would use to create
1752 a program from several object files.
1754 The following components of LINK-COMMAND are treated specially:
1756 -all-static do not do any dynamic linking at all
1757 -avoid-version do not add a version suffix if possible
1758 -bindir BINDIR specify path to binaries directory (for systems where
1759 libraries must be found in the PATH setting at runtime)
1760 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
1761 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
1762 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
1763 -export-symbols SYMFILE
1764 try to export only the symbols listed in SYMFILE
1765 -export-symbols-regex REGEX
1766 try to export only the symbols matching REGEX
1767 -LLIBDIR search LIBDIR for required installed libraries
1768 -lNAME OUTPUT-FILE requires the installed library libNAME
1769 -module build a library that can dlopened
1770 -no-fast-install disable the fast-install mode
1771 -no-install link a not-installable executable
1772 -no-undefined declare that a library does not refer to external symbols
1773 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
1774 -objectlist FILE Use a list of object files found in FILE to specify objects
1775 -precious-files-regex REGEX
1776 don't remove output files matching REGEX
1777 -release RELEASE specify package release information
1778 -rpath LIBDIR the created library will eventually be installed in LIBDIR
1779 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
1780 -shared only do dynamic linking of libtool libraries
1781 -shrext SUFFIX override the standard shared library file extension
1782 -static do not do any dynamic linking of uninstalled libtool libraries
1783 -static-libtool-libs
1784 do not do any dynamic linking of libtool libraries
1785 -version-info CURRENT[:REVISION[:AGE]]
1786 specify library version info [each variable defaults to 0]
1787 -weak LIBNAME declare that the target provides the LIBNAME interface
1789 -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
1791 -Xlinker FLAG pass linker-specific FLAG directly to the linker
1792 -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
1794 All other options (arguments beginning with \`-') are ignored.
1796 Every other argument is treated as a filename. Files ending in \`.la' are
1797 treated as uninstalled libtool libraries, other files are standard or library
1800 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
1801 only library objects (\`.lo' files) may be specified, and \`-rpath' is
1802 required, except when creating a convenience library.
1804 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
1805 using \`ar' and \`ranlib', or on Windows using \`lib'.
1807 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
1808 is created, otherwise an executable program is created."
1813 "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
1815 Remove libraries from an installation directory.
1817 RM is the name of the program to use to delete files associated with each FILE
1818 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
1821 If FILE is a libtool library, all the files associated with it are deleted.
1822 Otherwise, only FILE itself is deleted using RM."
1826 func_fatal_help
"invalid operation mode \`$mode'"
1831 $ECHO "Try \`$progname --help' for more information about other modes."
1834 # Now that we've collected a possible --mode arg, show help if necessary
1836 if test "$opt_help" = :; then
1841 for mode
in compile link execute
install finish uninstall clean
; do
1844 } |
sed -n '1p; 2,$s/^Usage:/ or: /p'
1847 for mode
in compile link execute
install finish uninstall clean
; do
1853 /^When reporting/,/^Report/{
1858 /information about other modes/d
1859 /more detailed .*MODE/d
1860 s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
1866 # func_mode_execute arg...
1867 func_mode_execute
()
1870 # The first argument is the command name.
1873 func_fatal_help
"you must specify a COMMAND"
1875 # Handle -dlopen flags immediately.
1876 for file in $execute_dlfiles; do
1878 || func_fatal_help
"\`$file' is not a file"
1883 # Check to see that this really is a libtool archive.
1884 func_lalib_unsafe_p
"$file" \
1885 || func_fatal_help
"\`$lib' is not a valid libtool archive"
1887 # Read the libtool library.
1892 # Skip this library if it cannot be dlopened.
1893 if test -z "$dlname"; then
1894 # Warn if it was a shared library.
1895 test -n "$library_names" && \
1896 func_warning
"\`$file' was not linked with \`-export-dynamic'"
1900 func_dirname
"$file" "" "."
1901 dir
="$func_dirname_result"
1903 if test -f "$dir/$objdir/$dlname"; then
1906 if test ! -f "$dir/$dlname"; then
1907 func_fatal_error
"cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
1913 # Just add the directory containing the .lo file.
1914 func_dirname
"$file" "" "."
1915 dir
="$func_dirname_result"
1919 func_warning
"\`-dlopen' is ignored for non-libtool libraries and objects"
1924 # Get the absolute pathname.
1925 absdir
=`cd "$dir" && pwd`
1926 test -n "$absdir" && dir
="$absdir"
1928 # Now add the directory to shlibpath_var.
1929 if eval "test -z \"\$$shlibpath_var\""; then
1930 eval "$shlibpath_var=\"\$dir\""
1932 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
1936 # This variable tells wrapper scripts just to set shlibpath_var
1937 # rather than running their programs.
1938 libtool_execute_magic
="$magic"
1940 # Check if any of the arguments is a wrapper script.
1945 -* |
*.la |
*.lo
) ;;
1947 # Do a test to see if this is really a libtool program.
1948 if func_ltwrapper_script_p
"$file"; then
1950 # Transform arg to wrapped name.
1951 file="$progdir/$program"
1952 elif func_ltwrapper_executable_p
"$file"; then
1953 func_ltwrapper_scriptname
"$file"
1954 func_source
"$func_ltwrapper_scriptname_result"
1955 # Transform arg to wrapped name.
1956 file="$progdir/$program"
1960 # Quote arguments (to preserve shell metacharacters).
1961 func_quote_for_eval
"$file"
1962 args
="$args $func_quote_for_eval_result"
1965 if test "X$opt_dry_run" = Xfalse
; then
1966 if test -n "$shlibpath_var"; then
1967 # Export the shlibpath_var.
1968 eval "export $shlibpath_var"
1971 # Restore saved environment variables
1972 for lt_var
in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
1974 eval "if test \"\${save_$lt_var+set}\" = set; then
1975 $lt_var=\$save_$lt_var; export $lt_var
1981 # Now prepare to actually exec the command.
1982 exec_cmd
="\$cmd$args"
1984 # Display what would be done.
1985 if test -n "$shlibpath_var"; then
1986 eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
1987 echo "export $shlibpath_var"
1994 test "$mode" = execute
&& func_mode_execute
${1+"$@"}
1997 # func_mode_finish arg...
2004 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
2007 libdirs
="$libdirs $dir"
2010 for libdir
in $libdirs; do
2011 if test -n "$finish_cmds"; then
2012 # Do each command in the finish commands.
2013 func_execute_cmds
"$finish_cmds" 'admincmds="$admincmds
2016 if test -n "$finish_eval"; then
2017 # Do the single finish_eval.
2018 eval cmds
=\"$finish_eval\"
2019 $opt_dry_run ||
eval "$cmds" || admincmds
="$admincmds
2025 # Exit here if they wanted silent mode.
2026 $opt_silent && exit $EXIT_SUCCESS
2028 echo "----------------------------------------------------------------------"
2029 echo "Libraries have been installed in:"
2030 for libdir
in $libdirs; do
2034 echo "If you ever happen to want to link against installed libraries"
2035 echo "in a given directory, LIBDIR, you must either use libtool, and"
2036 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
2037 echo "flag during linking and do at least one of the following:"
2038 if test -n "$shlibpath_var"; then
2039 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
2040 echo " during execution"
2042 if test -n "$runpath_var"; then
2043 echo " - add LIBDIR to the \`$runpath_var' environment variable"
2044 echo " during linking"
2046 if test -n "$hardcode_libdir_flag_spec"; then
2048 eval flag
=\"$hardcode_libdir_flag_spec\"
2050 $ECHO " - use the \`$flag' linker flag"
2052 if test -n "$admincmds"; then
2053 $ECHO " - have your system administrator run these commands:$admincmds"
2055 if test -f /etc
/ld.so.conf
; then
2056 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
2060 echo "See any operating system documentation about shared libraries for"
2062 solaris2.
[6789]|solaris2.1
[0-9])
2063 echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
2067 echo "more information, such as the ld(1) and ld.so(8) manual pages."
2070 echo "----------------------------------------------------------------------"
2074 test "$mode" = finish
&& func_mode_finish
${1+"$@"}
2077 # func_mode_install arg...
2078 func_mode_install
()
2081 # There may be an optional sh(1) argument at the beginning of
2082 # install_prog (especially on Windows NT).
2083 if test "$nonopt" = "$SHELL" ||
test "$nonopt" = /bin
/sh ||
2084 # Allow the use of GNU shtool's install command.
2085 case $nonopt in *shtool
*) :;; *) false
;; esac; then
2086 # Aesthetically quote it.
2087 func_quote_for_eval
"$nonopt"
2088 install_prog
="$func_quote_for_eval_result "
2096 # The real first argument should be the name of the installation program.
2097 # Aesthetically quote it.
2098 func_quote_for_eval
"$arg"
2099 install_prog
="$install_prog$func_quote_for_eval_result"
2100 install_shared_prog
=$install_prog
2101 case " $install_prog " in
2102 *[\\\
/]cp\
*) install_cp
=: ;;
2103 *) install_cp
=false
;;
2106 # We need to accept at least all the BSD install flags.
2118 if test -n "$dest"; then
2119 files
="$files $dest"
2127 if $install_cp; then :; else
2141 # If the previous option needed an argument, then skip it.
2142 if test -n "$prev"; then
2143 if test "x$prev" = x-m
&& test -n "$install_override_mode"; then
2144 arg2
=$install_override_mode
2155 # Aesthetically quote the argument.
2156 func_quote_for_eval
"$arg"
2157 install_prog
="$install_prog $func_quote_for_eval_result"
2158 if test -n "$arg2"; then
2159 func_quote_for_eval
"$arg2"
2161 install_shared_prog
="$install_shared_prog $func_quote_for_eval_result"
2164 test -z "$install_prog" && \
2165 func_fatal_help
"you must specify an install program"
2167 test -n "$prev" && \
2168 func_fatal_help
"the \`$prev' option requires an argument"
2170 if test -n "$install_override_mode" && $no_mode; then
2171 if $install_cp; then :; else
2172 func_quote_for_eval
"$install_override_mode"
2173 install_shared_prog
="$install_shared_prog -m $func_quote_for_eval_result"
2177 if test -z "$files"; then
2178 if test -z "$dest"; then
2179 func_fatal_help
"no file or destination specified"
2181 func_fatal_help
"you must specify a destination"
2185 # Strip any trailing slash from the destination.
2186 func_stripname
'' '/' "$dest"
2187 dest
=$func_stripname_result
2189 # Check to see that the destination is a directory.
2190 test -d "$dest" && isdir
=yes
2191 if test "$isdir" = yes; then
2195 func_dirname_and_basename
"$dest" "" "."
2196 destdir
="$func_dirname_result"
2197 destname
="$func_basename_result"
2199 # Not a directory, so check to see that there is only one file specified.
2200 set dummy
$files; shift
2201 test "$#" -gt 1 && \
2202 func_fatal_help
"\`$dest' is not a directory"
2205 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
2207 for file in $files; do
2211 func_fatal_help
"\`$destdir' must be an absolute directory name"
2218 # This variable tells wrapper scripts just to set variables rather
2219 # than running their programs.
2220 libtool_install_magic
="$magic"
2225 for file in $files; do
2227 # Do each installation.
2230 # Do the static libraries later.
2231 staticlibs
="$staticlibs $file"
2235 # Check to see that this really is a libtool archive.
2236 func_lalib_unsafe_p
"$file" \
2237 || func_fatal_help
"\`$file' is not a valid libtool archive"
2244 # Add the libdir to current_libdirs if it is the destination.
2245 if test "X$destdir" = "X$libdir"; then
2246 case "$current_libdirs " in
2248 *) current_libdirs
="$current_libdirs $libdir" ;;
2251 # Note the libdir as a future libdir.
2252 case "$future_libdirs " in
2254 *) future_libdirs
="$future_libdirs $libdir" ;;
2258 func_dirname
"$file" "/" ""
2259 dir
="$func_dirname_result"
2262 if test -n "$relink_command"; then
2263 # Determine the prefix the user has applied to our future dir.
2264 inst_prefix_dir
=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
2266 # Don't allow the user to place us outside of our expected
2267 # location b/c this prevents finding dependent libraries that
2268 # are installed to the same prefix.
2269 # At present, this check doesn't affect windows .dll's that
2270 # are installed into $libdir/../bin (currently, that works fine)
2271 # but it's something to keep an eye on.
2272 test "$inst_prefix_dir" = "$destdir" && \
2273 func_fatal_error
"error: cannot install \`$file' to a directory not ending in $libdir"
2275 if test -n "$inst_prefix_dir"; then
2276 # Stick the inst_prefix_dir data into the link command.
2277 relink_command
=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
2279 relink_command
=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
2282 func_warning
"relinking \`$file'"
2283 func_show_eval
"$relink_command" \
2284 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
2287 # See the names of the shared library.
2288 set dummy
$library_names; shift
2289 if test -n "$1"; then
2294 test -n "$relink_command" && srcname
="$realname"T
2296 # Install the shared library and build the symlinks.
2297 func_show_eval
"$install_shared_prog $dir/$srcname $destdir/$realname" \
2301 cygwin
* | mingw
* | pw32
* | cegcc
*)
2309 if test -n "$tstripme" && test -n "$striplib"; then
2310 func_show_eval
"$striplib $destdir/$realname" 'exit $?'
2313 if test "$#" -gt 0; then
2314 # Delete the old symlinks, and create new ones.
2315 # Try `ln -sf' first, because the `ln' binary might depend on
2316 # the symlink we replace! Solaris /bin/ln does not understand -f,
2317 # so we also need to try rm && ln -s.
2320 test "$linkname" != "$realname" \
2321 && func_show_eval
"(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
2325 # Do each command in the postinstall commands.
2326 lib
="$destdir/$realname"
2327 func_execute_cmds
"$postinstall_cmds" 'exit $?'
2330 # Install the pseudo-library for information purposes.
2331 func_basename
"$file"
2332 name
="$func_basename_result"
2333 instname
="$dir/$name"i
2334 func_show_eval
"$install_prog $instname $destdir/$name" 'exit $?'
2336 # Maybe install the static library, too.
2337 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
2341 # Install (i.e. copy) a libtool object.
2343 # Figure out destination file name, if it wasn't already specified.
2344 if test -n "$destname"; then
2345 destfile
="$destdir/$destname"
2347 func_basename
"$file"
2348 destfile
="$func_basename_result"
2349 destfile
="$destdir/$destfile"
2352 # Deduce the name of the destination old-style object file.
2355 func_lo2o
"$destfile"
2356 staticdest
=$func_lo2o_result
2359 staticdest
="$destfile"
2363 func_fatal_help
"cannot copy a libtool object to \`$destfile'"
2367 # Install the libtool object if requested.
2368 test -n "$destfile" && \
2369 func_show_eval
"$install_prog $file $destfile" 'exit $?'
2371 # Install the old object if enabled.
2372 if test "$build_old_libs" = yes; then
2373 # Deduce the name of the old-style object file.
2375 staticobj
=$func_lo2o_result
2376 func_show_eval
"$install_prog \$staticobj \$staticdest" 'exit $?'
2382 # Figure out destination file name, if it wasn't already specified.
2383 if test -n "$destname"; then
2384 destfile
="$destdir/$destname"
2386 func_basename
"$file"
2387 destfile
="$func_basename_result"
2388 destfile
="$destdir/$destfile"
2391 # If the file is missing, and there is a .exe on the end, strip it
2392 # because it is most likely a libtool script we actually want to
2397 if test ! -f "$file"; then
2398 func_stripname
'' '.exe' "$file"
2399 file=$func_stripname_result
2405 # Do a test to see if this is really a libtool program.
2408 if func_ltwrapper_executable_p
"$file"; then
2409 func_ltwrapper_scriptname
"$file"
2410 wrapper
=$func_ltwrapper_scriptname_result
2412 func_stripname
'' '.exe' "$file"
2413 wrapper
=$func_stripname_result
2420 if func_ltwrapper_script_p
"$wrapper"; then
2424 func_source
"$wrapper"
2426 # Check the variables that should have been set.
2427 test -z "$generated_by_libtool_version" && \
2428 func_fatal_error
"invalid libtool wrapper script \`$wrapper'"
2431 for lib
in $notinst_deplibs; do
2432 # Check to see that each library is installed.
2434 if test -f "$lib"; then
2437 libfile
="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
2438 if test -n "$libdir" && test ! -f "$libfile"; then
2439 func_warning
"\`$lib' has not been installed in \`$libdir'"
2445 func_source
"$wrapper"
2448 if test "$fast_install" = no
&& test -n "$relink_command"; then
2450 if test "$finalize" = yes; then
2451 tmpdir
=`func_mktempdir`
2452 func_basename
"$file$stripped_ext"
2453 file="$func_basename_result"
2454 outputname
="$tmpdir/$file"
2455 # Replace the output file specification.
2456 relink_command
=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
2459 func_quote_for_expand
"$relink_command"
2460 eval "func_echo $func_quote_for_expand_result"
2462 if eval "$relink_command"; then :
2464 func_error
"error: relink \`$file' with the above command before installing it"
2465 $opt_dry_run ||
${RM}r
"$tmpdir"
2470 func_warning
"cannot relink \`$file'"
2474 # Install the binary that we compiled earlier.
2475 file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
2479 # remove .exe since cygwin /usr/bin/install will append another
2481 case $install_prog,$host in
2482 */usr
/bin
/install*,*cygwin
*)
2483 case $file:$destfile in
2488 destfile
=$destfile.exe
2491 func_stripname
'' '.exe' "$destfile"
2492 destfile
=$func_stripname_result
2497 func_show_eval
"$install_prog\$stripme \$file \$destfile" 'exit $?'
2498 $opt_dry_run ||
if test -n "$outputname"; then
2505 for file in $staticlibs; do
2506 func_basename
"$file"
2507 name
="$func_basename_result"
2509 # Set up the ranlib parameters.
2510 oldlib
="$destdir/$name"
2512 func_show_eval
"$install_prog \$file \$oldlib" 'exit $?'
2514 if test -n "$stripme" && test -n "$old_striplib"; then
2515 func_show_eval
"$old_striplib $oldlib" 'exit $?'
2518 # Do each command in the postinstall commands.
2519 func_execute_cmds
"$old_postinstall_cmds" 'exit $?'
2522 test -n "$future_libdirs" && \
2523 func_warning
"remember to run \`$progname --finish$future_libdirs'"
2525 if test -n "$current_libdirs"; then
2526 # Maybe just do a dry run.
2527 $opt_dry_run && current_libdirs
=" -n$current_libdirs"
2528 exec_cmd
='$SHELL $progpath $preserve_args --finish$current_libdirs'
2534 test "$mode" = install && func_mode_install
${1+"$@"}
2537 # func_generate_dlsyms outputname originator pic_p
2538 # Extract symbols from dlprefiles and create ${outputname}S.o with
2539 # a dlpreopen symbol table.
2540 func_generate_dlsyms
()
2546 my_prefix
=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
2549 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
2550 if test -n "$NM" && test -n "$global_symbol_pipe"; then
2551 my_dlsyms
="${my_outputname}S.c"
2553 func_error
"not configured to extract global symbols from dlpreopened files"
2557 if test -n "$my_dlsyms"; then
2561 # Discover the nlist of each of the dlfiles.
2562 nlist
="$output_objdir/${my_outputname}.nm"
2564 func_show_eval
"$RM $nlist ${nlist}S ${nlist}T"
2566 # Parse the name list into a source file.
2567 func_verbose
"creating $output_objdir/$my_dlsyms"
2569 $opt_dry_run ||
$ECHO > "$output_objdir/$my_dlsyms" "\
2570 /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
2571 /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
2577 #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
2578 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
2581 /* External symbol declarations for the compiler. */\
2584 if test "$dlself" = yes; then
2585 func_verbose
"generating symbol list for \`$output'"
2587 $opt_dry_run ||
echo ': @PROGRAM@ ' > "$nlist"
2589 # Add our own program objects to the symbol list.
2590 progfiles
=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
2591 for progfile
in $progfiles; do
2592 func_verbose
"extracting global C symbols from \`$progfile'"
2593 $opt_dry_run ||
eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
2596 if test -n "$exclude_expsyms"; then
2598 eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
2599 eval '$MV "$nlist"T "$nlist"'
2603 if test -n "$export_symbols_regex"; then
2605 eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
2606 eval '$MV "$nlist"T "$nlist"'
2610 # Prepare the list of exported symbols
2611 if test -z "$export_symbols"; then
2612 export_symbols
="$output_objdir/$outputname.exp"
2615 eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
2617 *cygwin
* |
*mingw
* |
*cegcc
* )
2618 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
2619 eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
2625 eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
2626 eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
2627 eval '$MV "$nlist"T "$nlist"'
2629 *cygwin
* |
*mingw
* |
*cegcc
* )
2630 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
2631 eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
2638 for dlprefile
in $dlprefiles; do
2639 func_verbose
"extracting global C symbols from \`$dlprefile'"
2640 func_basename
"$dlprefile"
2641 name
="$func_basename_result"
2643 eval '$ECHO ": $name " >> "$nlist"'
2644 eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
2649 # Make sure we have at least an empty file.
2650 test -f "$nlist" ||
: > "$nlist"
2652 if test -n "$exclude_expsyms"; then
2653 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
2654 $MV "$nlist"T
"$nlist"
2657 # Try sorting and uniquifying the output.
2658 if $GREP -v "^: " < "$nlist" |
2659 if sort -k 3 </dev
/null
>/dev
/null
2>&1; then
2664 uniq > "$nlist"S
; then
2667 $GREP -v "^: " < "$nlist" > "$nlist"S
2670 if test -f "$nlist"S
; then
2671 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
2673 echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
2676 echo >> "$output_objdir/$my_dlsyms" "\
2678 /* The mapping between symbol names and symbols. */
2685 *cygwin
* |
*mingw
* |
*cegcc
* )
2686 echo >> "$output_objdir/$my_dlsyms" "\
2687 /* DATA imports from DLLs on WIN32 con't be const, because
2688 runtime relocations are performed -- see ld's documentation
2689 on pseudo-relocs. */"
2692 echo >> "$output_objdir/$my_dlsyms" "\
2693 /* This system does not cope well with relocations in const data */"
2696 lt_dlsym_const
=const
;;
2699 echo >> "$output_objdir/$my_dlsyms" "\
2700 extern $lt_dlsym_const lt_dlsymlist
2701 lt_${my_prefix}_LTX_preloaded_symbols[];
2702 $lt_dlsym_const lt_dlsymlist
2703 lt_${my_prefix}_LTX_preloaded_symbols[] =
2705 { \"$my_originator\", (void *) 0 },"
2707 case $need_lib_prefix in
2709 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
2712 eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
2715 echo >> "$output_objdir/$my_dlsyms" "\
2719 /* This works around a problem in FreeBSD linker */
2720 #ifdef FREEBSD_WORKAROUND
2721 static const void *lt_preloaded_setup() {
2722 return lt_${my_prefix}_LTX_preloaded_symbols;
2732 pic_flag_for_symtable
=
2733 case "$compile_command " in
2737 # compiling the symbol table file with pic_flag works around
2738 # a FreeBSD bug that causes programs to crash when -lm is
2739 # linked before any other PIC object. But we must not use
2740 # pic_flag when linking with -static. The problem exists in
2741 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
2742 *-*-freebsd2*|
*-*-freebsd3.0
*|
*-*-freebsdelf3.0
*)
2743 pic_flag_for_symtable
=" $pic_flag -DFREEBSD_WORKAROUND" ;;
2745 pic_flag_for_symtable
=" $pic_flag" ;;
2747 if test "X$my_pic_p" != Xno
; then
2748 pic_flag_for_symtable
=" $pic_flag"
2755 for arg
in $LTCFLAGS; do
2757 -pie |
-fpie |
-fPIE) ;;
2758 *) symtab_cflags
="$symtab_cflags $arg" ;;
2762 # Now compile the dynamic symbol file.
2763 func_show_eval
'(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
2765 # Clean up the generated files.
2766 func_show_eval
'$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
2768 # Transform the symbol file into the correct name.
2769 symfileobj
="$output_objdir/${my_outputname}S.$objext"
2771 *cygwin
* |
*mingw
* |
*cegcc
* )
2772 if test -f "$output_objdir/$my_outputname.def"; then
2773 compile_command
=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
2774 finalize_command
=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
2776 compile_command
=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
2777 finalize_command
=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
2781 compile_command
=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
2782 finalize_command
=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
2787 # FreeBSD doesn't need this...
2790 func_fatal_error
"unknown suffix for \`$my_dlsyms'"
2794 # We keep going just in case the user didn't refer to
2795 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
2796 # really was required.
2798 # Nullify the symbol file.
2799 compile_command
=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
2800 finalize_command
=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
2804 # func_win32_libid arg
2805 # return the library type of file 'arg'
2807 # Need a lot of goo to handle *both* DLLs and import libs
2808 # Has to be a shell function in order to 'eat' the argument
2809 # that is supplied when $file_magic_command is called.
2810 # Despite the name, also deal with 64 bit binaries.
2814 win32_libid_type
="unknown"
2815 win32_fileres
=`file -L $1 2>/dev/null`
2816 case $win32_fileres in
2817 *ar\ archive\ import\ library
*) # definitely import
2818 win32_libid_type
="x86 archive import"
2820 *ar\ archive
*) # could be an import, or static
2821 # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
2822 if eval $OBJDUMP -f $1 |
$SED -e '10q' 2>/dev
/null |
2823 $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev
/null
; then
2824 win32_nmres
=`eval $NM -f posix -A $1 |
2833 case $win32_nmres in
2834 import
*) win32_libid_type
="x86 archive import";;
2835 *) win32_libid_type
="x86 archive static";;
2840 win32_libid_type
="x86 DLL"
2842 *executable
*) # but shell scripts are "executable" too...
2843 case $win32_fileres in
2844 *MS\ Windows\ PE\ Intel
*)
2845 win32_libid_type
="x86 DLL"
2850 $ECHO "$win32_libid_type"
2855 # func_extract_an_archive dir oldlib
2856 func_extract_an_archive
()
2859 f_ex_an_ar_dir
="$1"; shift
2860 f_ex_an_ar_oldlib
="$1"
2861 if test "$lock_old_archive_extraction" = yes; then
2862 lockfile
=$f_ex_an_ar_oldlib.lock
2863 until $opt_dry_run ||
ln "$progpath" "$lockfile" 2>/dev
/null
; do
2864 func_echo
"Waiting for $lockfile to be removed"
2868 func_show_eval
"(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
2869 'stat=$?; rm -f "$lockfile"; exit $stat'
2870 if test "$lock_old_archive_extraction" = yes; then
2871 $opt_dry_run ||
rm -f "$lockfile"
2873 if ($AR t
"$f_ex_an_ar_oldlib" |
sort |
sort -uc >/dev
/null
2>&1); then
2876 func_fatal_error
"object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
2881 # func_extract_archives gentop oldlib ...
2882 func_extract_archives
()
2885 my_gentop
="$1"; shift
2886 my_oldlibs
=${1+"$@"}
2892 for my_xlib
in $my_oldlibs; do
2893 # Extract the objects.
2895 [\\/]* |
[A-Za-z
]:[\\/]*) my_xabs
="$my_xlib" ;;
2896 *) my_xabs
=`pwd`"/$my_xlib" ;;
2898 func_basename
"$my_xlib"
2899 my_xlib
="$func_basename_result"
2902 case " $extracted_archives " in
2904 func_arith
$extracted_serial + 1
2905 extracted_serial
=$func_arith_result
2906 my_xlib_u
=lt
$extracted_serial-$my_xlib ;;
2910 extracted_archives
="$extracted_archives $my_xlib_u"
2911 my_xdir
="$my_gentop/$my_xlib_u"
2913 func_mkdir_p
"$my_xdir"
2917 func_verbose
"Extracting $my_xabs"
2918 # Do not bother doing anything if just a dry run
2920 darwin_orig_dir
=`pwd`
2921 cd $my_xdir ||
exit $?
2922 darwin_archive
=$my_xabs
2924 darwin_base_archive
=`basename "$darwin_archive"`
2925 darwin_arches
=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
2926 if test -n "$darwin_arches"; then
2927 darwin_arches
=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
2929 func_verbose
"$darwin_base_archive has multiple architectures $darwin_arches"
2930 for darwin_arch
in $darwin_arches ; do
2931 func_mkdir_p
"unfat-$$/${darwin_base_archive}-${darwin_arch}"
2932 $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
2933 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
2934 func_extract_an_archive
"`pwd`" "${darwin_base_archive}"
2936 $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
2937 done # $darwin_arches
2938 ## Okay now we've a bunch of thin objects, gotta fatten them up :)
2939 darwin_filelist
=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
2942 for darwin_file
in $darwin_filelist; do
2943 darwin_files
=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
2944 $LIPO -create -output "$darwin_file" $darwin_files
2945 done # $darwin_filelist
2947 cd "$darwin_orig_dir"
2950 func_extract_an_archive
"$my_xdir" "$my_xabs"
2955 func_extract_an_archive
"$my_xdir" "$my_xabs"
2958 my_oldobjs
="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
2961 func_extract_archives_result
="$my_oldobjs"
2965 # func_emit_wrapper [arg=no]
2967 # Emit a libtool wrapper script on stdout.
2968 # Don't directly open a file because we may want to
2969 # incorporate the script contents within a cygwin/mingw
2970 # wrapper executable. Must ONLY be called from within
2971 # func_mode_link because it depends on a number of variables
2974 # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
2975 # variable will take. If 'yes', then the emitted script
2976 # will assume that the directory in which it is stored is
2977 # the $objdir directory. This is a cygwin/mingw-specific
2979 func_emit_wrapper
()
2981 func_emit_wrapper_arg1
=${1-no}
2986 # $output - temporary wrapper script for $objdir/$outputname
2987 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
2989 # The $output program cannot be directly executed until all the libtool
2990 # libraries that it depends on are installed.
2992 # This wrapper script should never be moved out of the build directory.
2993 # If it is, it will not operate correctly.
2995 # Sed substitution that helps us do robust quoting. It backslashifies
2996 # metacharacters that are still active within double-quoted strings.
2997 sed_quote_subst='$sed_quote_subst'
2999 # Be Bourne compatible
3000 if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
3003 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
3004 # is contrary to our usage. Disable this feature.
3005 alias -g '\${1+\"\$@\"}'='\"\$@\"'
3006 setopt NO_GLOB_SUBST
3008 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
3010 BIN_SH=xpg4; export BIN_SH # for Tru64
3011 DUALCASE=1; export DUALCASE # for MKS sh
3013 # The HP-UX ksh and POSIX shell print the target directory to stdout
3015 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
3017 relink_command=\"$relink_command\"
3019 # This environment variable determines our operation mode.
3020 if test \"\$libtool_install_magic\" = \"$magic\"; then
3021 # install mode needs the following variables:
3022 generated_by_libtool_version='$macro_version'
3023 notinst_deplibs='$notinst_deplibs'
3025 # When we are sourced in execute mode, \$file and \$ECHO are already set.
3026 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3029 qECHO
=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
3032 # A function that is used when there is no print builtin or printf.
3033 func_fallback_echo ()
3035 eval 'cat <<_LTECHO_EOF
3042 # Very basic option parsing. These options are (a) specific to
3043 # the libtool wrapper, (b) are identical between the wrapper
3044 # /script/ and the wrapper /executable/ which is used only on
3045 # windows platforms, and (c) all begin with the string "--lt-"
3046 # (application programs are unlikely to have options which match
3049 # There are only two supported options: --lt-debug and
3050 # --lt-dump-script. There is, deliberately, no --lt-help.
3052 # The first argument to this parsing function should be the
3053 # script's $0 value, followed by "$@
".
3055 func_parse_lt_options ()
3061 case \"\$lt_opt\" in
3062 --lt-debug) lt_option_debug=1 ;;
3064 lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
3065 test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
3066 lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
3067 cat \"\$lt_dump_D/\$lt_dump_F\"
3071 \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
3077 # Print the debug banner immediately:
3078 if test -n \"\$lt_option_debug\"; then
3079 echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
3083 # Used when --lt-debug. Prints its arguments to stdout
3084 # (redirection is the responsibility of the caller)
3085 func_lt_dump_args ()
3090 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
3091 lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
3095 # Core function for launching the target application
3096 func_exec_program_core ()
3100 # Backslashes separate directories on plain windows
3101 *-*-mingw |
*-*-os2* |
*-cegcc*)
3103 if test -n \"\$lt_option_debug\"; then
3104 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
3105 func_lt_dump_args \${1+\"\$@\"} 1>&2
3107 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
3113 if test -n \"\$lt_option_debug\"; then
3114 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
3115 func_lt_dump_args \${1+\"\$@\"} 1>&2
3117 exec \"\$progdir/\$program\" \${1+\"\$@\"}
3122 \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
3126 # A function to encapsulate launching the target application
3127 # Strips options in the --lt-* namespace from \$@ and
3128 # launches target application with the remaining arguments.
3129 func_exec_program ()
3135 *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
3139 func_exec_program_core \${1+\"\$@\"}
3143 func_parse_lt_options \"\$0\" \${1+\"\$@\"}
3145 # Find the directory that this script lives in.
3146 thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
3147 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3149 # Follow symbolic links until we get to the real thisdir.
3150 file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
3151 while test -n \"\$file\"; do
3152 destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
3154 # If there was a directory component, then change thisdir.
3155 if test \"x\$destdir\" != \"x\$file\"; then
3156 case \"\$destdir\" in
3157 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
3158 *) thisdir=\"\$thisdir/\$destdir\" ;;
3162 file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
3163 file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
3166 # Usually 'no', except on cygwin/mingw when embedded into
3168 WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
3169 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
3170 # special case for '.'
3171 if test \"\$thisdir\" = \".\"; then
3174 # remove .libs from thisdir
3175 case \"\$thisdir\" in
3176 *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
3177 $objdir ) thisdir=. ;;
3181 # Try to get the absolute directory name.
3182 absdir=\`cd \"\$thisdir\" && pwd\`
3183 test -n \"\$absdir\" && thisdir=\"\$absdir\"
3186 if test "$fast_install" = yes; then
3188 program=lt-'$outputname'$exeext
3189 progdir=\"\$thisdir/$objdir\"
3191 if test ! -f \"\$progdir/\$program\" ||
3192 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
3193 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
3195 file=\"\$\$-\$program\"
3197 if test ! -d \"\$progdir\"; then
3198 $MKDIR \"\$progdir\"
3200 $RM \"\$progdir/\$file\"
3205 # relink executable if necessary
3206 if test -n \"\$relink_command\"; then
3207 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
3209 $ECHO \"\$relink_command_output\" >&2
3210 $RM \"\$progdir/\$file\"
3215 $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
3216 { $RM \"\$progdir/\$program\";
3217 $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
3218 $RM \"\$progdir/\$file\"
3222 program='$outputname'
3223 progdir=\"\$thisdir/$objdir\"
3229 if test -f \"\$progdir/\$program\"; then"
3231 # Export our shlibpath_var if we have one.
3232 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3234 # Add our own library path to $shlibpath_var
3235 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
3237 # Some systems cannot cope with colon-terminated $shlibpath_var
3238 # The second colon is a workaround for a bug in BeOS R4 sed
3239 $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
3241 export $shlibpath_var
3245 # fixup the dll searchpath if we need to.
3246 if test -n "$dllsearchpath"; then
3248 # Add the dll search path components to the executable PATH
3249 PATH=$dllsearchpath:\$PATH
3254 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3255 # Run the actual program with our arguments.
3256 func_exec_program \${1+\"\$@\"}
3259 # The program doesn't exist.
3260 \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
3261 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
3262 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
3270 # func_to_host_path arg
3272 # Convert paths to host format when used with build tools.
3273 # Intended for use with "native" mingw (where libtool itself
3274 # is running under the msys shell), or in the following cross-
3275 # build environments:
3277 # mingw (msys) mingw [e.g. native]
3280 # where wine is equipped with the `winepath' executable.
3281 # In the native mingw case, the (msys) shell automatically
3282 # converts paths for any non-msys applications it launches,
3283 # but that facility isn't available from inside the cwrapper.
3284 # Similar accommodations are necessary for $host mingw and
3285 # $build cygwin. Calling this function does no harm for other
3286 # $host/$build combinations not listed above.
3288 # ARG is the path (on $build) that should be converted to
3289 # the proper representation for $host. The result is stored
3290 # in $func_to_host_path_result.
3291 func_to_host_path
()
3293 func_to_host_path_result
="$1"
3294 if test -n "$1"; then
3297 lt_sed_naive_backslashify
='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
3299 *mingw
* ) # actually, msys
3300 # awkward: cmd appends spaces to result
3301 func_to_host_path_result
=`( cmd //c echo "$1" ) 2>/dev/null |
3302 $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
3305 func_to_host_path_result
=`cygpath -w "$1" |
3306 $SED -e "$lt_sed_naive_backslashify"`
3309 # Unfortunately, winepath does not exit with a non-zero
3310 # error code, so we are forced to check the contents of
3311 # stdout. On the other hand, if the command is not
3312 # found, the shell will set an exit code of 127 and print
3313 # *an error message* to stdout. So we must check for both
3314 # error code of zero AND non-empty stdout, which explains
3315 # the odd construction:
3316 func_to_host_path_tmp1
=`winepath -w "$1" 2>/dev/null`
3317 if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
3318 func_to_host_path_result
=`$ECHO "$func_to_host_path_tmp1" |
3319 $SED -e "$lt_sed_naive_backslashify"`
3321 # Allow warning below.
3322 func_to_host_path_result
=
3326 if test -z "$func_to_host_path_result" ; then
3327 func_error
"Could not determine host path corresponding to"
3329 func_error
"Continuing, but uninstalled executables may not work."
3331 func_to_host_path_result
="$1"
3337 # end: func_to_host_path
3339 # func_to_host_pathlist arg
3341 # Convert pathlists to host format when used with build tools.
3342 # See func_to_host_path(), above. This function supports the
3343 # following $build/$host combinations (but does no harm for
3344 # combinations not listed here):
3346 # mingw (msys) mingw [e.g. native]
3350 # Path separators are also converted from $build format to
3351 # $host format. If ARG begins or ends with a path separator
3352 # character, it is preserved (but converted to $host format)
3355 # ARG is a pathlist (on $build) that should be converted to
3356 # the proper representation on $host. The result is stored
3357 # in $func_to_host_pathlist_result.
3358 func_to_host_pathlist
()
3360 func_to_host_pathlist_result
="$1"
3361 if test -n "$1"; then
3364 lt_sed_naive_backslashify
='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
3365 # Remove leading and trailing path separator characters from
3366 # ARG. msys behavior is inconsistent here, cygpath turns them
3367 # into '.;' and ';.', and winepath ignores them completely.
3368 func_stripname
: : "$1"
3369 func_to_host_pathlist_tmp1
=$func_stripname_result
3371 *mingw
* ) # Actually, msys.
3372 # Awkward: cmd appends spaces to result.
3373 func_to_host_pathlist_result
=`
3374 ( cmd //c echo "$func_to_host_pathlist_tmp1" ) 2>/dev/null |
3375 $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
3378 func_to_host_pathlist_result
=`cygpath -w -p "$func_to_host_pathlist_tmp1" |
3379 $SED -e "$lt_sed_naive_backslashify"`
3382 # unfortunately, winepath doesn't convert pathlists
3383 func_to_host_pathlist_result
=""
3384 func_to_host_pathlist_oldIFS
=$IFS
3386 for func_to_host_pathlist_f
in $func_to_host_pathlist_tmp1 ; do
3387 IFS
=$func_to_host_pathlist_oldIFS
3388 if test -n "$func_to_host_pathlist_f" ; then
3389 func_to_host_path
"$func_to_host_pathlist_f"
3390 if test -n "$func_to_host_path_result" ; then
3391 if test -z "$func_to_host_pathlist_result" ; then
3392 func_to_host_pathlist_result
="$func_to_host_path_result"
3394 func_append func_to_host_pathlist_result
";$func_to_host_path_result"
3399 IFS
=$func_to_host_pathlist_oldIFS
3402 if test -z "$func_to_host_pathlist_result"; then
3403 func_error
"Could not determine the host path(s) corresponding to"
3405 func_error
"Continuing, but uninstalled executables may not work."
3406 # Fallback. This may break if $1 contains DOS-style drive
3407 # specifications. The fix is not to complicate the expression
3408 # below, but for the user to provide a working wine installation
3409 # with winepath so that path translation in the cross-to-mingw
3410 # case works properly.
3411 lt_replace_pathsep_nix_to_dos
="s|:|;|g"
3412 func_to_host_pathlist_result
=`echo "$func_to_host_pathlist_tmp1" |\
3413 $SED -e "$lt_replace_pathsep_nix_to_dos"`
3415 # Now, add the leading and trailing path separators back
3417 :* ) func_to_host_pathlist_result
=";$func_to_host_pathlist_result"
3421 *: ) func_append func_to_host_pathlist_result
";"
3428 # end: func_to_host_pathlist
3430 # func_emit_cwrapperexe_src
3431 # emit the source code for a wrapper executable on stdout
3432 # Must ONLY be called from within func_mode_link because
3433 # it depends on a number of variable set therein.
3434 func_emit_cwrapperexe_src
()
3438 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
3439 Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
3441 The $output program cannot be directly executed until all the libtool
3442 libraries that it depends on are installed.
3444 This wrapper executable should never be moved out of the build directory.
3445 If it is, it will not operate correctly.
3450 # define _CRT_SECURE_NO_DEPRECATE 1
3455 # include <direct.h>
3456 # include <process.h>
3459 # include <unistd.h>
3460 # include <stdint.h>
3472 #include <sys/stat.h>
3474 /* declarations of non-ANSI functions */
3475 #if defined(__MINGW32__)
3476 # ifdef __STRICT_ANSI__
3477 int _putenv (const char *);
3479 #elif defined(__CYGWIN__)
3480 # ifdef __STRICT_ANSI__
3481 char *realpath (const char *, char *);
3482 int putenv (char *);
3483 int setenv (const char *, const char *, int);
3485 /* #elif defined (other platforms) ... */
3488 /* portability defines, excluding path handling macros */
3489 #if defined(_MSC_VER)
3490 # define setmode _setmode
3492 # define chmod _chmod
3493 # define getcwd _getcwd
3494 # define putenv _putenv
3495 # define S_IXUSR _S_IEXEC
3496 # ifndef _INTPTR_T_DEFINED
3497 # define _INTPTR_T_DEFINED
3498 # define intptr_t int
3500 #elif defined(__MINGW32__)
3501 # define setmode _setmode
3503 # define chmod _chmod
3504 # define getcwd _getcwd
3505 # define putenv _putenv
3506 #elif defined(__CYGWIN__)
3507 # define HAVE_SETENV
3508 # define FOPEN_WB "wb"
3509 /* #elif defined (other platforms) ... */
3512 #if defined(PATH_MAX)
3513 # define LT_PATHMAX PATH_MAX
3514 #elif defined(MAXPATHLEN)
3515 # define LT_PATHMAX MAXPATHLEN
3517 # define LT_PATHMAX 1024
3527 /* path handling portability macros */
3528 #ifndef DIR_SEPARATOR
3529 # define DIR_SEPARATOR '/'
3530 # define PATH_SEPARATOR ':'
3533 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
3535 # define HAVE_DOS_BASED_FILE_SYSTEM
3536 # define FOPEN_WB "wb"
3537 # ifndef DIR_SEPARATOR_2
3538 # define DIR_SEPARATOR_2 '\\'
3540 # ifndef PATH_SEPARATOR_2
3541 # define PATH_SEPARATOR_2 ';'
3545 #ifndef DIR_SEPARATOR_2
3546 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
3547 #else /* DIR_SEPARATOR_2 */
3548 # define IS_DIR_SEPARATOR(ch) \
3549 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
3550 #endif /* DIR_SEPARATOR_2 */
3552 #ifndef PATH_SEPARATOR_2
3553 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
3554 #else /* PATH_SEPARATOR_2 */
3555 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
3556 #endif /* PATH_SEPARATOR_2 */
3559 # define FOPEN_WB "w"
3562 # define _O_BINARY 0
3565 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
3566 #define XFREE(stale) do { \
3567 if (stale) { free ((void *) stale); stale = 0; } \
3570 #if defined(LT_DEBUGWRAPPER)
3571 static int lt_debug = 1;
3573 static int lt_debug = 0;
3576 const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
3578 void *xmalloc (size_t num);
3579 char *xstrdup (const char *string);
3580 const char *base_name (const char *name);
3581 char *find_executable (const char *wrapper);
3582 char *chase_symlinks (const char *pathspec);
3583 int make_executable (const char *path);
3584 int check_executable (const char *path);
3585 char *strendzap (char *str, const char *pat);
3586 void lt_debugprintf (const char *file, int line, const char *fmt, ...);
3587 void lt_fatal (const char *file, int line, const char *message, ...);
3588 static const char *nonnull (const char *s);
3589 static const char *nonempty (const char *s);
3590 void lt_setenv (const char *name, const char *value);
3591 char *lt_extend_str (const char *orig_value, const char *add, int to_end);
3592 void lt_update_exe_path (const char *name, const char *value);
3593 void lt_update_lib_path (const char *name, const char *value);
3594 char **prepare_spawn (char **argv);
3595 void lt_dump_script (FILE *f);
3599 const char * MAGIC_EXE = "$magic_exe";
3600 const char * LIB_PATH_VARNAME = "$shlibpath_var";
3603 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3604 func_to_host_pathlist "$temp_rpath"
3606 const char * LIB_PATH_VALUE = "$func_to_host_pathlist_result";
3610 const char
* LIB_PATH_VALUE
= "";
3614 if test -n "$dllsearchpath"; then
3615 func_to_host_pathlist
"$dllsearchpath:"
3617 const char * EXE_PATH_VARNAME = "PATH";
3618 const char * EXE_PATH_VALUE = "$func_to_host_pathlist_result";
3622 const char * EXE_PATH_VARNAME = "";
3623 const char * EXE_PATH_VALUE = "";
3627 if test "$fast_install" = yes; then
3629 const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
3633 const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
3640 #define LTWRAPPER_OPTION_PREFIX "--lt-"
3642 static const char
*ltwrapper_option_prefix
= LTWRAPPER_OPTION_PREFIX
;
3643 static const char
*dumpscript_opt
= LTWRAPPER_OPTION_PREFIX
"dump-script";
3644 static const char
*debug_opt
= LTWRAPPER_OPTION_PREFIX
"debug";
3647 main
(int argc
, char
*argv
[])
3652 char
*actual_cwrapper_path
;
3653 char
*actual_cwrapper_name
;
3656 intptr_t rval
= 127;
3660 program_name
= (char
*) xstrdup
(base_name
(argv
[0]));
3661 newargz
= XMALLOC
(char
*, argc
+ 1);
3663 /* very simple arg parsing
; don
't want to rely on getopt
3664 * also, copy all non cwrapper options to newargz, except
3665 * argz[0], which is handled differently
3668 for (i = 1; i < argc; i++)
3670 if (strcmp (argv[i], dumpscript_opt) == 0)
3674 *mingw* | *cygwin* )
3675 # make stdout use "unix" line endings
3676 echo " setmode(1,_O_BINARY);"
3681 lt_dump_script (stdout);
3684 if (strcmp (argv[i], debug_opt) == 0)
3689 if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
3691 /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
3692 namespace, but it is not one of the ones we know about and
3693 have already dealt with, above (inluding dump-script), then
3694 report an error. Otherwise, targets might begin to believe
3695 they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
3696 namespace. The first time any user complains about this, we'll
3697 need to
make LTWRAPPER_OPTION_PREFIX a configure-time option
3698 or a configure.ac-settable value.
3700 lt_fatal
(__FILE__
, __LINE__
,
3701 "unrecognized %s option: '%s'",
3702 ltwrapper_option_prefix
, argv
[i
]);
3705 newargz
[++newargc
] = xstrdup
(argv
[i
]);
3707 newargz
[++newargc
] = NULL
;
3711 /* The GNU banner must be the first non-error debug message */
3712 lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
3715 lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
3716 lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
3718 tmp_pathspec = find_executable (argv[0]);
3719 if (tmp_pathspec == NULL)
3720 lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
3721 lt_debugprintf (__FILE__, __LINE__,
3722 "(main) found exe (before symlink chase) at: %s\n",
3725 actual_cwrapper_path = chase_symlinks (tmp_pathspec);
3726 lt_debugprintf (__FILE__, __LINE__,
3727 "(main) found exe (after symlink chase) at: %s\n",
3728 actual_cwrapper_path);
3729 XFREE (tmp_pathspec);
3731 actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
3732 strendzap (actual_cwrapper_path, actual_cwrapper_name);
3734 /* wrapper name transforms */
3735 strendzap (actual_cwrapper_name, ".exe");
3736 tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
3737 XFREE (actual_cwrapper_name);
3738 actual_cwrapper_name = tmp_pathspec;
3741 /* target_name transforms -- use actual target program name; might have lt- prefix */
3742 target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
3743 strendzap (target_name, ".exe");
3744 tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
3745 XFREE (target_name);
3746 target_name = tmp_pathspec;
3749 lt_debugprintf (__FILE__, __LINE__,
3750 "(main) libtool target name: %s\n",
3756 XMALLOC (char, (strlen (actual_cwrapper_path) +
3757 strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
3758 strcpy (newargz[0], actual_cwrapper_path);
3759 strcat (newargz[0], "$objdir");
3760 strcat (newargz[0], "/");
3764 /* stop here
, and copy so we don
't have to do this twice */
3765 tmp_pathspec = xstrdup (newargz[0]);
3767 /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
3768 strcat (newargz[0], actual_cwrapper_name);
3770 /* DO want the lt- prefix here if it exists, so use target_name */
3771 lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
3772 XFREE (tmp_pathspec);
3773 tmp_pathspec = NULL;
3781 while ((p = strchr (newargz[0], '\\')) != NULL)
3785 while ((p = strchr (lt_argv_zero, '\\')) != NULL)
3795 XFREE (target_name);
3796 XFREE (actual_cwrapper_path);
3797 XFREE (actual_cwrapper_name);
3799 lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
3800 lt_setenv ("DUALCASE", "1"); /* for MSK sh */
3801 lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
3802 lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
3804 lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
3805 nonnull (lt_argv_zero));
3806 for (i = 0; i < newargc; i++)
3808 lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
3809 i, nonnull (newargz[i]));
3817 /* execv doesn't actually work on mingw as expected on unix
*/
3818 newargz
= prepare_spawn
(newargz
);
3819 rval
= _spawnv
(_P_WAIT
, lt_argv_zero
, (const char
* const
*) newargz
);
3822 /* failed to start process
*/
3823 lt_debugprintf
(__FILE__
, __LINE__
,
3824 "(main) failed to launch target \"%s\": %s\n",
3825 lt_argv_zero
, nonnull
(strerror
(errno
)));
3833 execv (lt_argv_zero, newargz);
3834 return rval; /* =127, but avoids unused variable warning */
3843 xmalloc
(size_t num
)
3845 void
*p
= (void
*) malloc
(num
);
3847 lt_fatal
(__FILE__
, __LINE__
, "memory exhausted");
3853 xstrdup
(const char
*string
)
3855 return string ? strcpy
((char
*) xmalloc
(strlen
(string
) + 1),
3860 base_name
(const char
*name
)
3864 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
3865 /* Skip over the disk name
in MSDOS pathnames.
*/
3866 if (isalpha
((unsigned char
) name
[0]) && name
[1] == ':')
3870 for (base
= name
; *name
; name
++)
3871 if (IS_DIR_SEPARATOR
(*name
))
3877 check_executable
(const char
*path
)
3881 lt_debugprintf
(__FILE__
, __LINE__
, "(check_executable): %s\n",
3883 if ((!path
) ||
(!*path
))
3886 if ((stat
(path
, &st
) >= 0)
3887 && (st.st_mode
& (S_IXUSR | S_IXGRP | S_IXOTH
)))
3894 make_executable
(const char
*path
)
3899 lt_debugprintf
(__FILE__
, __LINE__
, "(make_executable): %s\n",
3901 if ((!path
) ||
(!*path
))
3904 if (stat
(path
, &st
) >= 0)
3906 rval
= chmod (path
, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR
);
3911 /* Searches
for the full path of the wrapper. Returns
3912 newly allocated full path name
if found
, NULL otherwise
3913 Does not chase symlinks
, even on platforms that support them.
3916 find_executable
(const char
*wrapper
)
3921 /* static buffer
for getcwd
*/
3922 char tmp
[LT_PATHMAX
+ 1];
3926 lt_debugprintf
(__FILE__
, __LINE__
, "(find_executable): %s\n",
3927 nonempty
(wrapper
));
3929 if ((wrapper
== NULL
) ||
(*wrapper
== '\0'))
3932 /* Absolute path?
*/
3933 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
3934 if (isalpha
((unsigned char
) wrapper
[0]) && wrapper
[1] == ':')
3936 concat_name
= xstrdup
(wrapper
);
3937 if (check_executable
(concat_name
))
3939 XFREE
(concat_name
);
3944 if (IS_DIR_SEPARATOR
(wrapper
[0]))
3946 concat_name
= xstrdup
(wrapper
);
3947 if (check_executable
(concat_name
))
3949 XFREE
(concat_name
);
3951 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
3955 for (p
= wrapper
; *p
; p
++)
3963 /* no slashes
; search PATH
*/
3964 const char
*path
= getenv
("PATH");
3967 for (p
= path
; *p
; p
= p_next
)
3971 for (q
= p
; *q
; q
++)
3972 if (IS_PATH_SEPARATOR
(*q
))
3975 p_next
= (*q
== '\0' ? q
: q
+ 1);
3978 /* empty path
: current directory
*/
3979 if (getcwd
(tmp
, LT_PATHMAX
) == NULL
)
3980 lt_fatal
(__FILE__
, __LINE__
, "getcwd failed: %s",
3981 nonnull
(strerror
(errno
)));
3982 tmp_len
= strlen
(tmp
);
3984 XMALLOC
(char
, tmp_len
+ 1 + strlen
(wrapper
) + 1);
3985 memcpy
(concat_name
, tmp
, tmp_len
);
3986 concat_name
[tmp_len
] = '/';
3987 strcpy
(concat_name
+ tmp_len
+ 1, wrapper
);
3992 XMALLOC
(char
, p_len
+ 1 + strlen
(wrapper
) + 1);
3993 memcpy
(concat_name
, p
, p_len
);
3994 concat_name
[p_len
] = '/';
3995 strcpy
(concat_name
+ p_len
+ 1, wrapper
);
3997 if (check_executable
(concat_name
))
3999 XFREE
(concat_name
);
4002 /* not found
in PATH
; assume curdir
*/
4004 /* Relative path | not found
in path
: prepend cwd
*/
4005 if (getcwd
(tmp
, LT_PATHMAX
) == NULL
)
4006 lt_fatal
(__FILE__
, __LINE__
, "getcwd failed: %s",
4007 nonnull
(strerror
(errno
)));
4008 tmp_len
= strlen
(tmp
);
4009 concat_name
= XMALLOC
(char
, tmp_len
+ 1 + strlen
(wrapper
) + 1);
4010 memcpy
(concat_name
, tmp
, tmp_len
);
4011 concat_name
[tmp_len
] = '/';
4012 strcpy
(concat_name
+ tmp_len
+ 1, wrapper
);
4014 if (check_executable
(concat_name
))
4016 XFREE
(concat_name
);
4021 chase_symlinks
(const char
*pathspec
)
4024 return xstrdup
(pathspec
);
4026 char buf
[LT_PATHMAX
];
4028 char
*tmp_pathspec
= xstrdup
(pathspec
);
4030 int has_symlinks
= 0;
4031 while (strlen
(tmp_pathspec
) && !has_symlinks
)
4033 lt_debugprintf
(__FILE__
, __LINE__
,
4034 "checking path component for symlinks: %s\n",
4036 if (lstat
(tmp_pathspec
, &s
) == 0)
4038 if (S_ISLNK
(s.st_mode
) != 0)
4044 /* search backwards
for last DIR_SEPARATOR
*/
4045 p
= tmp_pathspec
+ strlen
(tmp_pathspec
) - 1;
4046 while ((p
> tmp_pathspec
) && (!IS_DIR_SEPARATOR
(*p
)))
4048 if ((p
== tmp_pathspec
) && (!IS_DIR_SEPARATOR
(*p
)))
4050 /* no
more DIR_SEPARATORS left
*/
4057 lt_fatal
(__FILE__
, __LINE__
,
4058 "error accessing file \"%s\": %s",
4059 tmp_pathspec
, nonnull
(strerror
(errno
)));
4062 XFREE
(tmp_pathspec
);
4066 return xstrdup
(pathspec
);
4069 tmp_pathspec
= realpath
(pathspec
, buf
);
4070 if (tmp_pathspec
== 0)
4072 lt_fatal
(__FILE__
, __LINE__
,
4073 "could not follow symlinks for %s", pathspec
);
4075 return xstrdup
(tmp_pathspec
);
4080 strendzap
(char
*str
, const char
*pat
)
4084 assert
(str
!= NULL
);
4085 assert
(pat
!= NULL
);
4088 patlen
= strlen
(pat
);
4092 str
+= len
- patlen
;
4093 if (strcmp
(str
, pat
) == 0)
4100 lt_debugprintf
(const char
*file, int line
, const char
*fmt, ...
)
4105 (void
) fprintf
(stderr
, "%s:%s:%d: ", program_name
, file, line
);
4106 va_start
(args
, fmt);
4107 (void
) vfprintf
(stderr
, fmt, args
);
4113 lt_error_core
(int exit_status
, const char
*file,
4114 int line
, const char
*mode
,
4115 const char
*message
, va_list ap
)
4117 fprintf
(stderr
, "%s:%s:%d: %s: ", program_name
, file, line
, mode
);
4118 vfprintf
(stderr
, message
, ap
);
4119 fprintf
(stderr
, ".\n");
4121 if (exit_status
>= 0)
4126 lt_fatal
(const char
*file, int line
, const char
*message
, ...
)
4129 va_start
(ap
, message
);
4130 lt_error_core
(EXIT_FAILURE
, file, line
, "FATAL", message
, ap
);
4135 nonnull
(const char
*s
)
4137 return s ? s
: "(null)";
4141 nonempty
(const char
*s
)
4143 return (s
&& !*s
) ?
"(empty)" : nonnull
(s
);
4147 lt_setenv
(const char
*name
, const char
*value
)
4149 lt_debugprintf
(__FILE__
, __LINE__
,
4150 "(lt_setenv) setting '%s' to '%s'\n",
4151 nonnull
(name
), nonnull
(value
));
4154 /* always
make a copy
, for consistency with
!HAVE_SETENV
*/
4155 char
*str
= xstrdup
(value
);
4156 setenv
(name
, str
, 1);
4158 int len
= strlen
(name
) + 1 + strlen
(value
) + 1;
4159 char
*str
= XMALLOC
(char
, len
);
4160 sprintf
(str
, "%s=%s", name
, value
);
4161 if (putenv
(str
) != EXIT_SUCCESS
)
4170 lt_extend_str
(const char
*orig_value
, const char
*add
, int to_end
)
4173 if (orig_value
&& *orig_value
)
4175 int orig_value_len
= strlen
(orig_value
);
4176 int add_len
= strlen
(add
);
4177 new_value
= XMALLOC
(char
, add_len
+ orig_value_len
+ 1);
4180 strcpy
(new_value
, orig_value
);
4181 strcpy
(new_value
+ orig_value_len
, add
);
4185 strcpy
(new_value
, add
);
4186 strcpy
(new_value
+ add_len
, orig_value
);
4191 new_value
= xstrdup
(add
);
4197 lt_update_exe_path
(const char
*name
, const char
*value
)
4199 lt_debugprintf
(__FILE__
, __LINE__
,
4200 "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
4201 nonnull
(name
), nonnull
(value
));
4203 if (name
&& *name
&& value
&& *value
)
4205 char
*new_value
= lt_extend_str
(getenv
(name
), value
, 0);
4206 /* some systems can
't cope with a ':'-terminated path #' */
4207 int len
= strlen
(new_value
);
4208 while (((len
= strlen
(new_value
)) > 0) && IS_PATH_SEPARATOR
(new_value
[len-1
]))
4210 new_value
[len-1
] = '\0';
4212 lt_setenv
(name
, new_value
);
4218 lt_update_lib_path
(const char
*name
, const char
*value
)
4220 lt_debugprintf
(__FILE__
, __LINE__
,
4221 "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
4222 nonnull
(name
), nonnull
(value
));
4224 if (name
&& *name
&& value
&& *value
)
4226 char
*new_value
= lt_extend_str
(getenv
(name
), value
, 0);
4227 lt_setenv
(name
, new_value
);
4237 /* Prepares an argument vector before calling spawn().
4238 Note that spawn() does not by itself call the command interpreter
4239 (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
4240 ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
4242 v.dwPlatformId == VER_PLATFORM_WIN32_NT;
4243 }) ? "cmd.exe" : "command.com").
4244 Instead it simply concatenates the arguments, separated by ' ', and calls
4245 CreateProcess(). We must quote the arguments since Win32 CreateProcess()
4246 interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
4248 - Space and tab are interpreted as delimiters. They are not treated as
4249 delimiters if they are surrounded by double quotes: "...".
4250 - Unescaped double quotes are removed from the input. Their only effect is
4251 that within double quotes, space and tab are treated like normal
4253 - Backslashes not followed by double quotes are not special.
4254 - But 2*n+1 backslashes followed by a double quote become
4255 n backslashes followed by a double quote (n >= 0):
4260 #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
4261 #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
4263 prepare_spawn (char **argv)
4269 /* Count number of arguments. */
4270 for (argc = 0; argv[argc] != NULL; argc++)
4273 /* Allocate new argument vector. */
4274 new_argv = XMALLOC (char *, argc + 1);
4276 /* Put quoted arguments into the new argument vector. */
4277 for (i = 0; i < argc; i++)
4279 const char *string = argv[i];
4281 if (string[0] == '\0')
4282 new_argv[i] = xstrdup ("\"\"");
4283 else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
4285 int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
4287 unsigned int backslashes;
4289 char *quoted_string;
4296 for (s = string; *s != '\0'; s++)
4300 length += backslashes + 1;
4308 length += backslashes + 1;
4310 quoted_string = XMALLOC (char, length + 1);
4316 for (s = string; *s != '\0'; s++)
4322 for (j = backslashes + 1; j > 0; j--)
4334 for (j = backslashes; j > 0; j--)
4340 new_argv[i] = quoted_string;
4343 new_argv[i] = (char *) string;
4345 new_argv[argc] = NULL;
4354 void lt_dump_script
(FILE
* f
)
4357 func_emit_wrapper
yes |
4358 $SED -e 's/\([\\"]\)/\\\1/g' \
4359 -e 's/^/ fputs ("/' -e 's/$/\\n", f);/'
4365 # end: func_emit_cwrapperexe_src
4367 # func_win32_import_lib_p ARG
4368 # True if ARG is an import lib, as indicated by $file_magic_cmd
4369 func_win32_import_lib_p ()
4372 case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
4378 # func_mode_link arg...
4383 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
4384 # It is impossible to link a dll without this setting, and
4385 # we shouldn't force the makefile maintainer to figure out
4386 # which system we are compiling for in order to pass an extra
4387 # flag for every libtool invocation.
4388 # allow_undefined=no
4390 # FIXME: Unfortunately, there are problems with the above when trying
4391 # to make a dll which has undefined symbols, in which case not
4392 # even a static library is built. For now, we need to specify
4393 # -no-undefined on the libtool link line when we can be certain
4394 # that all symbols are satisfied, otherwise we get a static library.
4401 libtool_args=$nonopt
4402 base_compile="$nonopt $@"
4403 compile_command=$nonopt
4404 finalize_command=$nonopt
4417 lib_search_path=`pwd`
4419 new_inherited_linker_flags=
4428 export_symbols_regex=
4436 precious_files_regex=
4437 prefer_static_libs=no
4450 single_module="${wl}-single_module"
4451 func_infer_tag $base_compile
4453 # We need to know -static, to get the right output filenames.
4458 test "$build_libtool_libs" != yes && \
4459 func_fatal_configuration "can not build a shared library"
4463 -all-static | -static | -static-libtool-libs)
4466 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
4467 func_warning "complete static linking is impossible in this configuration"
4469 if test -n "$link_static_flag"; then
4470 dlopen_self=$dlopen_self_static
4472 prefer_static_libs=yes
4475 if test -z "$pic_flag" && test -n "$link_static_flag"; then
4476 dlopen_self=$dlopen_self_static
4478 prefer_static_libs=built
4480 -static-libtool-libs)
4481 if test -z "$pic_flag" && test -n "$link_static_flag"; then
4482 dlopen_self=$dlopen_self_static
4484 prefer_static_libs=yes
4487 build_libtool_libs=no
4494 # See if our shared archives depend on static archives.
4495 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
4497 # Go through the arguments, transforming them on the way.
4498 while test "$#" -gt 0; do
4501 func_quote_for_eval "$arg"
4502 qarg=$func_quote_for_eval_unquoted_result
4503 func_append libtool_args " $func_quote_for_eval_result"
4505 # If the previous option needs an argument, assign it.
4506 if test -n "$prev"; then
4509 func_append compile_command " @OUTPUT@"
4510 func_append finalize_command " @OUTPUT@"
4521 if test "$preload" = no; then
4522 # Add the symbol object into the linking commands.
4523 func_append compile_command " @SYMFILE@"
4524 func_append finalize_command " @SYMFILE@"
4528 *.la | *.lo) ;; # We handle these cases below.
4530 if test "$dlself" = no; then
4538 if test "$prev" = dlprefiles; then
4540 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
4550 if test "$prev" = dlfiles; then
4551 dlfiles="$dlfiles $arg"
4553 dlprefiles="$dlprefiles $arg"
4561 export_symbols="$arg"
4563 || func_fatal_error "symbol file \`$arg' does not exist"
4568 export_symbols_regex="$arg"
4576 *" $qarg.ltframework "*) ;;
4577 *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
4586 inst_prefix_dir="$arg"
4591 if test -f "$arg"; then
4594 for fil in `cat "$save_arg"`
4596 # moreargs="$moreargs $fil"
4598 # A libtool-controlled object.
4600 # Check to see that this really is a libtool object.
4601 if func_lalib_unsafe_p "$arg"; then
4608 if test -z "$pic_object" ||
4609 test -z "$non_pic_object" ||
4610 test "$pic_object" = none &&
4611 test "$non_pic_object" = none; then
4612 func_fatal_error "cannot find name of object for \`$arg'"
4615 # Extract subdirectory from the argument.
4616 func_dirname "$arg" "/" ""
4617 xdir="$func_dirname_result"
4619 if test "$pic_object" != none; then
4620 # Prepend the subdirectory the object is found in.
4621 pic_object="$xdir$pic_object"
4623 if test "$prev" = dlfiles; then
4624 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
4625 dlfiles="$dlfiles $pic_object"
4629 # If libtool objects are unsupported, then we need to preload.
4634 # CHECK ME: I think I busted this. -Ossama
4635 if test "$prev" = dlprefiles; then
4636 # Preload the old-style object.
4637 dlprefiles="$dlprefiles $pic_object"
4642 func_append libobjs " $pic_object"
4647 if test "$non_pic_object" != none; then
4648 # Prepend the subdirectory the object is found in.
4649 non_pic_object="$xdir$non_pic_object"
4651 # A standard non-PIC object
4652 func_append non_pic_objects " $non_pic_object"
4653 if test -z "$pic_object" || test "$pic_object" = none ; then
4654 arg="$non_pic_object"
4657 # If the PIC object exists, use it instead.
4658 # $xdir was prepended to $pic_object above.
4659 non_pic_object="$pic_object"
4660 func_append non_pic_objects " $non_pic_object"
4663 # Only an error if not doing a dry-run.
4664 if $opt_dry_run; then
4665 # Extract subdirectory from the argument.
4666 func_dirname "$arg" "/" ""
4667 xdir="$func_dirname_result"
4670 pic_object=$xdir$objdir/$func_lo2o_result
4671 non_pic_object=$xdir$func_lo2o_result
4672 func_append libobjs " $pic_object"
4673 func_append non_pic_objects " $non_pic_object"
4675 func_fatal_error "\`$arg' is not a valid libtool object"
4680 func_fatal_error "link input file \`$arg' does not exist"
4687 precious_files_regex="$arg"
4697 # We need an absolute path.
4699 [\\/]* | [A-Za-z]:[\\/]*) ;;
4701 func_fatal_error "only absolute run-paths are allowed"
4704 if test "$prev" = rpath; then
4707 *) rpath="$rpath $arg" ;;
4712 *) xrpath="$xrpath $arg" ;;
4724 weak_libs="$weak_libs $arg"
4729 linker_flags="$linker_flags $qarg"
4730 compiler_flags="$compiler_flags $qarg"
4732 func_append compile_command " $qarg"
4733 func_append finalize_command " $qarg"
4737 compiler_flags="$compiler_flags $qarg"
4739 func_append compile_command " $qarg"
4740 func_append finalize_command " $qarg"
4744 linker_flags="$linker_flags $qarg"
4745 compiler_flags="$compiler_flags $wl$qarg"
4747 func_append compile_command " $wl$qarg"
4748 func_append finalize_command " $wl$qarg"
4752 eval "$prev=\"\$arg\""
4757 fi # test -n "$prev"
4763 if test -n "$link_static_flag"; then
4764 # See comment for -static flag below, for more details.
4765 func_append compile_command " $link_static_flag"
4766 func_append finalize_command " $link_static_flag"
4772 # FIXME: remove this flag sometime in the future.
4773 func_fatal_error "\`-allow-undefined' must not be used because it is the default"
4801 -export-symbols | -export-symbols-regex)
4802 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
4803 func_fatal_error "more than one -exported-symbols argument is not allowed"
4805 if test "X$arg" = "X-export-symbols"; then
4823 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
4824 # so, if we see these flags be careful not to treat them like -L
4826 case $with_gcc/$host in
4827 no/*-*-irix* | /*-*-irix*)
4828 func_append compile_command " $arg"
4829 func_append finalize_command " $arg"
4836 func_stripname '-L' '' "$arg"
4837 dir=$func_stripname_result
4838 if test -z "$dir"; then
4839 if test "$#" -gt 0; then
4840 func_fatal_error "require no space between \`-L' and \`$1'"
4842 func_fatal_error "need path for \`-L' option"
4845 # We need an absolute path.
4847 [\\/]* | [A-Za-z]:[\\/]*) ;;
4849 absdir=`cd "$dir" && pwd`
4850 test -z "$absdir" && \
4851 func_fatal_error "cannot determine absolute directory name of \`$dir'"
4858 deplibs="$deplibs -L$dir"
4859 lib_search_path="$lib_search_path $dir"
4863 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
4864 testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
4865 case :$dllsearchpath: in
4867 ::) dllsearchpath=$dir;;
4868 *) dllsearchpath="$dllsearchpath:$dir";;
4870 case :$dllsearchpath: in
4871 *":$testbindir:"*) ;;
4872 ::) dllsearchpath=$testbindir;;
4873 *) dllsearchpath="$dllsearchpath:$testbindir";;
4881 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
4883 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
4884 # These systems don't actually have a C or math library (as such)
4888 # These systems don't actually have a C library (as such)
4889 test "X$arg" = "X-lc" && continue
4891 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
4892 # Do not include libc due to us having libc/libc_r.
4893 test "X$arg" = "X-lc" && continue
4895 *-*-rhapsody* | *-*-darwin1.[012])
4896 # Rhapsody C and math libraries are in the System framework
4897 deplibs="$deplibs System.ltframework"
4900 *-*-sco3.2v5* | *-*-sco5v6*)
4901 # Causes problems with __ctype
4902 test "X$arg" = "X-lc" && continue
4904 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
4905 # Compiler inserts libc in the correct place for threads to work
4906 test "X$arg" = "X-lc" && continue
4909 elif test "X$arg" = "X-lc_r"; then
4911 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
4912 # Do not include libc_r directly, use -pthread flag.
4917 deplibs="$deplibs $arg"
4926 # Tru64 UNIX uses -model [arg] to determine the layout of C++
4927 # classes, name mangling, and exception handling.
4928 # Darwin uses the -arch flag to determine output architecture.
4929 -model|-arch|-isysroot)
4930 compiler_flags="$compiler_flags $arg"
4931 func_append compile_command " $arg"
4932 func_append finalize_command " $arg"
4937 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
4938 compiler_flags="$compiler_flags $arg"
4939 func_append compile_command " $arg"
4940 func_append finalize_command " $arg"
4941 case "$new_inherited_linker_flags " in
4943 * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
4945 deplibs="$deplibs $arg"
4950 single_module="${wl}-multi_module"
4961 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
4962 # The PATH hackery in wrapper scripts is required on Windows
4963 # and Darwin in order for the loader to find any dlls it needs.
4964 func_warning "\`-no-install' is ignored for $host"
4965 func_warning "assuming \`-no-fast-install' instead"
4968 *) no_install=yes ;;
4985 -precious-files-regex)
5006 func_stripname '-R' '' "$arg"
5007 dir=$func_stripname_result
5008 # We need an absolute path.
5010 [\\/]* | [A-Za-z]:[\\/]*) ;;
5012 func_fatal_error "only absolute run-paths are allowed"
5017 *) xrpath="$xrpath $dir" ;;
5023 # The effects of -shared are defined in a previous loop.
5032 -static | -static-libtool-libs)
5033 # The effects of -static are defined in a previous loop.
5034 # We used to do the same as -all-static on platforms that
5035 # didn't have a PIC flag, but the assumption that the effects
5036 # would be equivalent was wrong. It would break on at least
5037 # Digital Unix and AIX.
5063 func_stripname '-Wc,' '' "$arg"
5064 args=$func_stripname_result
5066 save_ifs="$IFS"; IFS=','
5067 for flag in $args; do
5069 func_quote_for_eval "$flag"
5070 arg="$arg $func_quote_for_eval_result"
5071 compiler_flags="$compiler_flags $func_quote_for_eval_result"
5074 func_stripname ' ' '' "$arg"
5075 arg=$func_stripname_result
5079 func_stripname '-Wl,' '' "$arg"
5080 args=$func_stripname_result
5082 save_ifs="$IFS"; IFS=','
5083 for flag in $args; do
5085 func_quote_for_eval "$flag"
5086 arg="$arg $wl$func_quote_for_eval_result"
5087 compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
5088 linker_flags="$linker_flags $func_quote_for_eval_result"
5091 func_stripname ' ' '' "$arg"
5092 arg=$func_stripname_result
5112 func_quote_for_eval "$arg"
5113 arg="$func_quote_for_eval_result"
5116 # Flags to be passed through unchanged, with rationale:
5117 # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
5118 # -r[0-9][0-9]* specify processor for the SGI compiler
5119 # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
5120 # +DA*, +DD* enable 64-bit mode for the HP compiler
5121 # -q* compiler args for the IBM compiler
5122 # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
5123 # -F/path path to uninstalled frameworks, gcc on darwin
5124 # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
5125 # @file GCC response files
5126 # -tp=* Portland pgcc target processor selection
5127 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
5128 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*)
5129 func_quote_for_eval "$arg"
5130 arg="$func_quote_for_eval_result"
5131 func_append compile_command " $arg"
5132 func_append finalize_command " $arg"
5133 compiler_flags="$compiler_flags $arg"
5137 # Some other compiler flag.
5139 func_quote_for_eval "$arg"
5140 arg="$func_quote_for_eval_result"
5144 # A standard object.
5149 # A libtool-controlled object.
5151 # Check to see that this really is a libtool object.
5152 if func_lalib_unsafe_p "$arg"; then
5159 if test -z "$pic_object" ||
5160 test -z "$non_pic_object" ||
5161 test "$pic_object" = none &&
5162 test "$non_pic_object" = none; then
5163 func_fatal_error "cannot find name of object for \`$arg'"
5166 # Extract subdirectory from the argument.
5167 func_dirname "$arg" "/" ""
5168 xdir="$func_dirname_result"
5170 if test "$pic_object" != none; then
5171 # Prepend the subdirectory the object is found in.
5172 pic_object="$xdir$pic_object"
5174 if test "$prev" = dlfiles; then
5175 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
5176 dlfiles="$dlfiles $pic_object"
5180 # If libtool objects are unsupported, then we need to preload.
5185 # CHECK ME: I think I busted this. -Ossama
5186 if test "$prev" = dlprefiles; then
5187 # Preload the old-style object.
5188 dlprefiles="$dlprefiles $pic_object"
5193 func_append libobjs " $pic_object"
5198 if test "$non_pic_object" != none; then
5199 # Prepend the subdirectory the object is found in.
5200 non_pic_object="$xdir$non_pic_object"
5202 # A standard non-PIC object
5203 func_append non_pic_objects " $non_pic_object"
5204 if test -z "$pic_object" || test "$pic_object" = none ; then
5205 arg="$non_pic_object"
5208 # If the PIC object exists, use it instead.
5209 # $xdir was prepended to $pic_object above.
5210 non_pic_object="$pic_object"
5211 func_append non_pic_objects " $non_pic_object"
5214 # Only an error if not doing a dry-run.
5215 if $opt_dry_run; then
5216 # Extract subdirectory from the argument.
5217 func_dirname "$arg" "/" ""
5218 xdir="$func_dirname_result"
5221 pic_object=$xdir$objdir/$func_lo2o_result
5222 non_pic_object=$xdir$func_lo2o_result
5223 func_append libobjs " $pic_object"
5224 func_append non_pic_objects " $non_pic_object"
5226 func_fatal_error "\`$arg' is not a valid libtool object"
5233 deplibs="$deplibs $arg"
5234 old_deplibs="$old_deplibs $arg"
5239 # A libtool-controlled library.
5241 if test "$prev" = dlfiles; then
5242 # This library was specified with -dlopen.
5243 dlfiles="$dlfiles $arg"
5245 elif test "$prev" = dlprefiles; then
5246 # The library was specified with -dlpreopen.
5247 dlprefiles="$dlprefiles $arg"
5250 deplibs="$deplibs $arg"
5255 # Some other compiler argument.
5257 # Unknown arguments in both finalize_command and compile_command need
5258 # to be aesthetically quoted because they are evaled later.
5259 func_quote_for_eval "$arg"
5260 arg="$func_quote_for_eval_result"
5264 # Now actually substitute the argument into the commands.
5265 if test -n "$arg"; then
5266 func_append compile_command " $arg"
5267 func_append finalize_command " $arg"
5269 done # argument parsing loop
5271 test -n "$prev" && \
5272 func_fatal_help "the \`$prevarg' option requires an argument"
5274 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
5275 eval arg=\"$export_dynamic_flag_spec\"
5276 func_append compile_command " $arg"
5277 func_append finalize_command " $arg"
5281 # calculate the name of the file, without its directory
5282 func_basename "$output"
5283 outputname="$func_basename_result"
5284 libobjs_save="$libobjs"
5286 if test -n "$shlibpath_var"; then
5287 # get the directories listed in $shlibpath_var
5288 eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
5292 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
5293 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
5295 func_dirname "$output" "/" ""
5296 output_objdir="$func_dirname_result$objdir"
5297 # Create the object directory.
5298 func_mkdir_p "$output_objdir"
5300 # Determine the type of output
5303 func_fatal_help "you must specify an output file"
5305 *.$libext) linkmode=oldlib ;;
5306 *.lo | *.$objext) linkmode=obj ;;
5307 *.la) linkmode=lib ;;
5308 *) linkmode=prog ;; # Anything else should be a program.
5314 # Find all interdependent deplibs by searching for libraries
5315 # that are linked more than once (e.g. -la -lb -la)
5316 for deplib in $deplibs; do
5317 if $opt_duplicate_deps ; then
5319 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
5322 libs="$libs $deplib"
5325 if test "$linkmode" = lib; then
5326 libs="$predeps $libs $compiler_lib_search_path $postdeps"
5328 # Compute libraries that are listed more than once in $predeps
5329 # $postdeps and mark them as special (i.e., whose duplicates are
5330 # not to be eliminated).
5332 if $opt_duplicate_compiler_generated_deps; then
5333 for pre_post_dep in $predeps $postdeps; do
5334 case "$pre_post_deps " in
5335 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
5337 pre_post_deps="$pre_post_deps $pre_post_dep"
5346 need_relink=no # whether we're linking any uninstalled libtool libraries
5347 notinst_deplibs= # not-installed libtool libraries
5348 notinst_path= # paths that contain not-installed libtool libraries
5352 passes="conv dlpreopen link"
5353 for file in $dlfiles $dlprefiles; do
5357 func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
5368 passes="conv scan dlopen dlpreopen link"
5374 for pass in $passes; do
5375 # The preopen pass in lib mode reverses $deplibs; put it back here
5376 # so that -L comes before libs that need it for instance...
5377 if test "$linkmode,$pass" = "lib,link"; then
5378 ## FIXME: Find the place where the list is rebuilt in the wrong
5379 ## order, and fix it there properly
5381 for deplib in $deplibs; do
5382 tmp_deplibs="$deplib $tmp_deplibs"
5384 deplibs="$tmp_deplibs"
5387 if test "$linkmode,$pass" = "lib,link" ||
5388 test "$linkmode,$pass" = "prog,scan"; then
5392 if test "$linkmode" = prog; then
5394 dlopen) libs="$dlfiles" ;;
5395 dlpreopen) libs="$dlprefiles" ;;
5396 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
5399 if test "$linkmode,$pass" = "lib,dlpreopen"; then
5400 # Collect and forward deplibs of preopened libtool libs
5401 for lib in $dlprefiles; do
5402 # Ignore non-libtool-libs
5405 *.la) func_source "$lib" ;;
5408 # Collect preopened libtool deplibs, except any this library
5409 # has declared as weak libs
5410 for deplib in $dependency_libs; do
5411 func_basename "$deplib"
5412 deplib_base=$func_basename_result
5413 case " $weak_libs " in
5414 *" $deplib_base "*) ;;
5415 *) deplibs="$deplibs $deplib" ;;
5421 if test "$pass" = dlopen; then
5422 # Collect dlpreopened libraries
5423 save_deplibs="$deplibs"
5427 for deplib in $libs; do
5431 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
5432 if test "$linkmode,$pass" = "prog,link"; then
5433 compile_deplibs="$deplib $compile_deplibs"
5434 finalize_deplibs="$deplib $finalize_deplibs"
5436 compiler_flags="$compiler_flags $deplib"
5441 deplibs="$deplib $deplibs"
5442 test "$pass" = conv && continue
5443 newdependency_libs="$deplib $newdependency_libs"
5446 if test "$pass" = conv; then
5447 deplibs="$deplib $deplibs"
5450 if test "$pass" = scan; then
5451 deplibs="$deplib $deplibs"
5453 compile_deplibs="$deplib $compile_deplibs"
5454 finalize_deplibs="$deplib $finalize_deplibs"
5464 if test "$linkmode" != lib && test "$linkmode" != prog; then
5465 func_warning "\`-l' is ignored for archives/objects"
5468 func_stripname '-l' '' "$deplib"
5469 name=$func_stripname_result
5470 if test "$linkmode" = lib; then
5471 searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
5473 searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
5475 for searchdir in $searchdirs; do
5476 for search_ext in .la $std_shrext .so .a; do
5477 # Search the libtool library
5478 lib="$searchdir/lib${name}${search_ext}"
5479 if test -f "$lib"; then
5480 if test "$search_ext" = ".la"; then
5489 if test "$found" != yes; then
5490 # deplib doesn't seem to be a libtool library
5491 if test "$linkmode,$pass" = "prog,link"; then
5492 compile_deplibs="$deplib $compile_deplibs"
5493 finalize_deplibs="$deplib $finalize_deplibs"
5495 deplibs="$deplib $deplibs"
5496 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
5499 else # deplib is a libtool library
5500 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
5501 # We need to do some special things here, and not later.
5502 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
5503 case " $predeps $postdeps " in
5505 if func_lalib_p "$lib"; then
5509 for l in $old_library $library_names; do
5512 if test "X$ll" = "X$old_library" ; then # only static version available
5514 func_dirname "$lib" "" "."
5515 ladir="$func_dirname_result"
5516 lib=$ladir/$old_library
5517 if test "$linkmode,$pass" = "prog,link"; then
5518 compile_deplibs="$deplib $compile_deplibs"
5519 finalize_deplibs="$deplib $finalize_deplibs"
5521 deplibs="$deplib $deplibs"
5522 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
5534 if test "$linkmode,$pass" = "prog,link"; then
5535 compile_deplibs="$deplib $compile_deplibs"
5536 finalize_deplibs="$deplib $finalize_deplibs"
5538 deplibs="$deplib $deplibs"
5539 if test "$linkmode" = lib ; then
5540 case "$new_inherited_linker_flags " in
5542 * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
5551 deplibs="$deplib $deplibs"
5552 test "$pass" = conv && continue
5553 newdependency_libs="$deplib $newdependency_libs"
5554 func_stripname '-L' '' "$deplib"
5555 newlib_search_path="$newlib_search_path $func_stripname_result"
5558 if test "$pass" = conv; then
5559 deplibs="$deplib $deplibs"
5562 if test "$pass" = scan; then
5563 deplibs="$deplib $deplibs"
5565 compile_deplibs="$deplib $compile_deplibs"
5566 finalize_deplibs="$deplib $finalize_deplibs"
5568 func_stripname '-L' '' "$deplib"
5569 newlib_search_path="$newlib_search_path $func_stripname_result"
5572 func_warning "\`-L' is ignored for archives/objects"
5578 if test "$pass" = link; then
5579 func_stripname '-R' '' "$deplib"
5580 dir=$func_stripname_result
5581 # Make sure the xrpath contains only unique directories.
5584 *) xrpath="$xrpath $dir" ;;
5587 deplibs="$deplib $deplibs"
5590 *.la) lib="$deplib" ;;
5592 if test "$pass" = conv; then
5593 deplibs="$deplib $deplibs"
5598 # Linking convenience modules into shared libraries is allowed,
5599 # but linking other static libraries is non-portable.
5600 case " $dlpreconveniencelibs " in
5604 case $deplibs_check_method in
5606 set dummy $deplibs_check_method; shift
5607 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
5608 if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
5609 | $EGREP "$match_pattern_regex" > /dev/null; then
5617 if test "$valid_a_lib" != yes; then
5619 $ECHO "*** Warning: Trying to link with static lib archive $deplib."
5620 echo "*** I have the capability to make that library automatically link in when"
5621 echo "*** you link to this library. But I can only do this if you have a"
5622 echo "*** shared version of the library, which you do not appear to have"
5623 echo "*** because the file extensions .$libext of this argument makes me believe"
5624 echo "*** that it is just a static archive that I should not use here."
5627 $ECHO "*** Warning: Linking the shared library $output against the"
5628 $ECHO "*** static library $deplib is not portable!"
5629 deplibs="$deplib $deplibs"
5636 if test "$pass" != link; then
5637 deplibs="$deplib $deplibs"
5639 compile_deplibs="$deplib $compile_deplibs"
5640 finalize_deplibs="$deplib $finalize_deplibs"
5647 if test "$pass" = conv; then
5648 deplibs="$deplib $deplibs"
5649 elif test "$linkmode" = prog; then
5650 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
5651 # If there is no dlopen support or we're linking statically,
5652 # we need to preload.
5653 newdlprefiles="$newdlprefiles $deplib"
5654 compile_deplibs="$deplib $compile_deplibs"
5655 finalize_deplibs="$deplib $finalize_deplibs"
5657 newdlfiles="$newdlfiles $deplib"
5668 if test "$found" = yes || test -f "$lib"; then :
5670 func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
5673 # Check to see that this really is a libtool archive.
5674 func_lalib_unsafe_p "$lib" \
5675 || func_fatal_error "\`$lib' is not a valid libtool archive"
5677 func_dirname "$lib" "" "."
5678 ladir="$func_dirname_result"
5686 inherited_linker_flags=
5687 # If the library was installed with an old release of libtool,
5688 # it will not redefine variables installed, or shouldnotlink
5697 # Convert "-framework foo" to "foo.ltframework"
5698 if test -n "$inherited_linker_flags"; then
5699 tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
5700 for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
5701 case " $new_inherited_linker_flags " in
5702 *" $tmp_inherited_linker_flag "*) ;;
5703 *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
5707 dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
5708 if test "$linkmode,$pass" = "lib,link" ||
5709 test "$linkmode,$pass" = "prog,scan" ||
5710 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
5711 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
5712 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
5715 if test "$pass" = conv; then
5716 # Only check for convenience libraries
5717 deplibs="$lib $deplibs"
5718 if test -z "$libdir"; then
5719 if test -z "$old_library"; then
5720 func_fatal_error "cannot find name of link library for \`$lib'"
5722 # It is a libtool convenience library, so add in its objects.
5723 convenience="$convenience $ladir/$objdir/$old_library"
5724 old_convenience="$old_convenience $ladir/$objdir/$old_library"
5725 elif test "$linkmode" != prog && test "$linkmode" != lib; then
5726 func_fatal_error "\`$lib' is not a convenience library"
5729 for deplib in $dependency_libs; do
5730 deplibs="$deplib $deplibs"
5731 if $opt_duplicate_deps ; then
5732 case "$tmp_libs " in
5733 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
5736 tmp_libs="$tmp_libs $deplib"
5742 # Get the name of the library we link against.
5744 for l in $old_library $library_names; do
5747 if test -z "$linklib"; then
5748 func_fatal_error "cannot find name of link library for \`$lib'"
5751 # This library was specified with -dlopen.
5752 if test "$pass" = dlopen; then
5753 if test -z "$libdir"; then
5754 func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
5756 if test -z "$dlname" ||
5757 test "$dlopen_support" != yes ||
5758 test "$build_libtool_libs" = no; then
5759 # If there is no dlname, no dlopen support or we're linking
5760 # statically, we need to preload. We also need to preload any
5761 # dependent libraries so libltdl's deplib preloader doesn't
5762 # bomb out in the load deplibs phase.
5763 dlprefiles="$dlprefiles $lib $dependency_libs"
5765 newdlfiles="$newdlfiles $lib"
5770 # We need an absolute path.
5772 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
5774 abs_ladir=`cd "$ladir" && pwd`
5775 if test -z "$abs_ladir"; then
5776 func_warning "cannot determine absolute directory name of \`$ladir'"
5777 func_warning "passing it literally to the linker, although it might fail"
5782 func_basename "$lib"
5783 laname="$func_basename_result"
5785 # Find the relevant object directory and library name.
5786 if test "X$installed" = Xyes; then
5787 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
5788 func_warning "library \`$lib' was moved."
5796 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
5798 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
5801 # Remove this search path later
5802 notinst_path="$notinst_path $abs_ladir"
5804 dir="$ladir/$objdir"
5805 absdir="$abs_ladir/$objdir"
5806 # Remove this search path later
5807 notinst_path="$notinst_path $abs_ladir"
5809 fi # $installed = yes
5810 func_stripname 'lib' '.la' "$laname"
5811 name=$func_stripname_result
5813 # This library was specified with -dlpreopen.
5814 if test "$pass" = dlpreopen; then
5815 if test -z "$libdir" && test "$linkmode" = prog; then
5816 func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
5818 # Prefer using a static library (so that no silly _DYNAMIC symbols
5819 # are required to link).
5820 if test -n "$old_library"; then
5821 newdlprefiles="$newdlprefiles $dir/$old_library"
5822 # Keep a list of preopened convenience libraries to check
5823 # that they are being used correctly in the link pass.
5824 test -z "$libdir" && \
5825 dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
5826 # Otherwise, use the dlname, so that lt_dlopen finds it.
5827 elif test -n "$dlname"; then
5828 newdlprefiles="$newdlprefiles $dir/$dlname"
5830 newdlprefiles="$newdlprefiles $dir/$linklib"
5832 fi # $pass = dlpreopen
5834 if test -z "$libdir"; then
5835 # Link the convenience library
5836 if test "$linkmode" = lib; then
5837 deplibs="$dir/$old_library $deplibs"
5838 elif test "$linkmode,$pass" = "prog,link"; then
5839 compile_deplibs="$dir/$old_library $compile_deplibs"
5840 finalize_deplibs="$dir/$old_library $finalize_deplibs"
5842 deplibs="$lib $deplibs" # used for prog,scan pass
5848 if test "$linkmode" = prog && test "$pass" != link; then
5849 newlib_search_path="$newlib_search_path $ladir"
5850 deplibs="$lib $deplibs"
5853 if test "$link_all_deplibs" != no || test -z "$library_names" ||
5854 test "$build_libtool_libs" = no; then
5859 for deplib in $dependency_libs; do
5861 -L*) func_stripname '-L' '' "$deplib"
5862 newlib_search_path="$newlib_search_path $func_stripname_result"
5865 # Need to link against all dependency_libs?
5866 if test "$linkalldeplibs" = yes; then
5867 deplibs="$deplib $deplibs"
5869 # Need to hardcode shared library paths
5870 # or/and link against static libraries
5871 newdependency_libs="$deplib $newdependency_libs"
5873 if $opt_duplicate_deps ; then
5874 case "$tmp_libs " in
5875 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
5878 tmp_libs="$tmp_libs $deplib"
5881 fi # $linkmode = prog...
5883 if test "$linkmode,$pass" = "prog,link"; then
5884 if test -n "$library_names" &&
5885 { { test "$prefer_static_libs" = no ||
5886 test "$prefer_static_libs,$installed" = "built,yes"; } ||
5887 test -z "$old_library"; }; then
5888 # We need to hardcode the library path
5889 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
5890 # Make sure the rpath contains only unique directories.
5891 case "$temp_rpath:" in
5893 *) temp_rpath="$temp_rpath$absdir:" ;;
5897 # Hardcode the library path.
5898 # Skip directories that are in the system default run-time
5900 case " $sys_lib_dlsearch_path " in
5903 case "$compile_rpath " in
5905 *) compile_rpath="$compile_rpath $absdir"
5909 case " $sys_lib_dlsearch_path " in
5912 case "$finalize_rpath " in
5914 *) finalize_rpath="$finalize_rpath $libdir"
5918 fi # $linkmode,$pass = prog,link...
5920 if test "$alldeplibs" = yes &&
5921 { test "$deplibs_check_method" = pass_all ||
5922 { test "$build_libtool_libs" = yes &&
5923 test -n "$library_names"; }; }; then
5924 # We only need to search for static libraries
5929 link_static=no # Whether the deplib will be linked statically
5930 use_static_libs=$prefer_static_libs
5931 if test "$use_static_libs" = built && test "$installed" = yes; then
5934 if test -n "$library_names" &&
5935 { test "$use_static_libs" = no || test -z "$old_library"; }; then
5937 *cygwin* | *mingw* | *cegcc*)
5938 # No point in relinking DLLs because paths are not encoded
5939 notinst_deplibs="$notinst_deplibs $lib"
5943 if test "$installed" = no; then
5944 notinst_deplibs="$notinst_deplibs $lib"
5949 # This is a shared library
5951 # Warn about portability, can't link against -module's on some
5952 # systems (darwin). Don't bleat about dlopened modules though!
5954 for dlpremoduletest in $dlprefiles; do
5955 if test "X$dlpremoduletest" = "X$lib"; then
5956 dlopenmodule="$dlpremoduletest"
5960 if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
5962 if test "$linkmode" = prog; then
5963 $ECHO "*** Warning: Linking the executable $output against the loadable module"
5965 $ECHO "*** Warning: Linking the shared library $output against the loadable module"
5967 $ECHO "*** $linklib is not portable!"
5969 if test "$linkmode" = lib &&
5970 test "$hardcode_into_libs" = yes; then
5971 # Hardcode the library path.
5972 # Skip directories that are in the system default run-time
5974 case " $sys_lib_dlsearch_path " in
5977 case "$compile_rpath " in
5979 *) compile_rpath="$compile_rpath $absdir"
5983 case " $sys_lib_dlsearch_path " in
5986 case "$finalize_rpath " in
5988 *) finalize_rpath="$finalize_rpath $libdir"
5994 if test -n "$old_archive_from_expsyms_cmds"; then
5995 # figure out the soname
5996 set dummy $library_names
6000 libname=`eval "\\$ECHO \"$libname_spec\""`
6001 # use dlname if we got it. it's perfectly good, no?
6002 if test -n "$dlname"; then
6004 elif test -n "$soname_spec"; then
6007 *cygwin* | mingw* | *cegcc*)
6008 func_arith $current - $age
6009 major=$func_arith_result
6013 eval soname=\"$soname_spec\"
6018 # Make a new name for the extract_expsyms_cmds to use
6020 func_basename "$soroot"
6021 soname="$func_basename_result"
6022 func_stripname 'lib' '.dll' "$soname"
6023 newlib=libimp-$func_stripname_result.a
6025 # If the library has no export list, then create one now
6026 if test -f "$output_objdir/$soname-def"; then :
6028 func_verbose "extracting exported symbol list from \`$soname'"
6029 func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
6033 if test -f "$output_objdir/$newlib"; then :; else
6034 func_verbose "generating import library for \`$soname'"
6035 func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
6037 # make sure the library variables are pointing to the new library
6040 fi # test -n "$old_archive_from_expsyms_cmds"
6042 if test "$linkmode" = prog || test "$mode" != relink; then
6047 case $hardcode_action in
6048 immediate | unsupported)
6049 if test "$hardcode_direct" = no; then
6052 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
6053 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
6054 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
6055 *-*-unixware7*) add_dir="-L$dir" ;;
6057 # if the lib is a (non-dlopened) module then we can not
6058 # link against it, someone is ignoring the earlier warnings
6059 if /usr/bin/file -L $add 2> /dev/null |
6060 $GREP ": [^:]* bundle" >/dev/null ; then
6061 if test "X$dlopenmodule" != "X$lib"; then
6062 $ECHO "*** Warning: lib $linklib is a module, not a shared library"
6063 if test -z "$old_library" ; then
6065 echo "*** And there doesn't seem to be a static archive available"
6066 echo "*** The link will probably fail, sorry"
6068 add="$dir/$old_library"
6070 elif test -n "$old_library"; then
6071 add="$dir/$old_library"
6075 elif test "$hardcode_minus_L" = no; then
6077 *-*-sunos*) add_shlibpath="$dir" ;;
6081 elif test "$hardcode_shlibpath_var" = no; then
6082 add_shlibpath="$dir"
6089 if test "$hardcode_direct" = yes &&
6090 test "$hardcode_direct_absolute" = no; then
6092 elif test "$hardcode_minus_L" = yes; then
6094 # Try looking first in the location we're being installed to.
6095 if test -n "$inst_prefix_dir"; then
6098 add_dir="$add_dir -L$inst_prefix_dir$libdir"
6103 elif test "$hardcode_shlibpath_var" = yes; then
6104 add_shlibpath="$dir"
6113 if test "$lib_linked" != yes; then
6114 func_fatal_configuration "unsupported hardcode properties"
6117 if test -n "$add_shlibpath"; then
6118 case :$compile_shlibpath: in
6119 *":$add_shlibpath:"*) ;;
6120 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
6123 if test "$linkmode" = prog; then
6124 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
6125 test -n "$add" && compile_deplibs="$add $compile_deplibs"
6127 test -n "$add_dir" && deplibs="$add_dir $deplibs"
6128 test -n "$add" && deplibs="$add $deplibs"
6129 if test "$hardcode_direct" != yes &&
6130 test "$hardcode_minus_L" != yes &&
6131 test "$hardcode_shlibpath_var" = yes; then
6132 case :$finalize_shlibpath: in
6134 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
6140 if test "$linkmode" = prog || test "$mode" = relink; then
6144 # Finalize command for both is simple: just hardcode it.
6145 if test "$hardcode_direct" = yes &&
6146 test "$hardcode_direct_absolute" = no; then
6147 add="$libdir/$linklib"
6148 elif test "$hardcode_minus_L" = yes; then
6151 elif test "$hardcode_shlibpath_var" = yes; then
6152 case :$finalize_shlibpath: in
6154 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
6157 elif test "$hardcode_automatic" = yes; then
6158 if test -n "$inst_prefix_dir" &&
6159 test -f "$inst_prefix_dir$libdir/$linklib" ; then
6160 add="$inst_prefix_dir$libdir/$linklib"
6162 add="$libdir/$linklib"
6165 # We cannot seem to hardcode it, guess we'll fake it.
6167 # Try looking first in the location we're being installed to.
6168 if test -n "$inst_prefix_dir"; then
6171 add_dir="$add_dir -L$inst_prefix_dir$libdir"
6178 if test "$linkmode" = prog; then
6179 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
6180 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
6182 test -n "$add_dir" && deplibs="$add_dir $deplibs"
6183 test -n "$add" && deplibs="$add $deplibs"
6186 elif test "$linkmode" = prog; then
6187 # Here we assume that one of hardcode_direct or hardcode_minus_L
6188 # is not unsupported. This is valid on all known static and
6190 if test "$hardcode_direct" != unsupported; then
6191 test -n "$old_library" && linklib="$old_library"
6192 compile_deplibs="$dir/$linklib $compile_deplibs"
6193 finalize_deplibs="$dir/$linklib $finalize_deplibs"
6195 compile_deplibs="-l$name -L$dir $compile_deplibs"
6196 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
6198 elif test "$build_libtool_libs" = yes; then
6199 # Not a shared library
6200 if test "$deplibs_check_method" != pass_all; then
6201 # We're trying link a shared library against a static one
6202 # but the system doesn't support it.
6204 # Just print a warning and add the library to dependency_libs so
6205 # that the program can be linked against the static library.
6207 $ECHO "*** Warning: This system can not link to static lib archive $lib."
6208 echo "*** I have the capability to make that library automatically link in when"
6209 echo "*** you link to this library. But I can only do this if you have a"
6210 echo "*** shared version of the library, which you do not appear to have."
6211 if test "$module" = yes; then
6212 echo "*** But as you try to build a module library, libtool will still create "
6213 echo "*** a static module, that should work as long as the dlopening application"
6214 echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
6215 if test -z "$global_symbol_pipe"; then
6217 echo "*** However, this would only work if libtool was able to extract symbol"
6218 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
6219 echo "*** not find such a program. So, this module is probably useless."
6220 echo "*** \`nm' from GNU binutils and a full rebuild may help."
6222 if test "$build_old_libs" = no; then
6223 build_libtool_libs=module
6226 build_libtool_libs=no
6230 deplibs="$dir/$old_library $deplibs"
6233 fi # link shared/static library?
6235 if test "$linkmode" = lib; then
6236 if test -n "$dependency_libs" &&
6237 { test "$hardcode_into_libs" != yes ||
6238 test "$build_old_libs" = yes ||
6239 test "$link_static" = yes; }; then
6240 # Extract -R from dependency_libs
6242 for libdir in $dependency_libs; do
6244 -R*) func_stripname '-R' '' "$libdir"
6245 temp_xrpath=$func_stripname_result
6247 *" $temp_xrpath "*) ;;
6248 *) xrpath="$xrpath $temp_xrpath";;
6250 *) temp_deplibs="$temp_deplibs $libdir";;
6253 dependency_libs="$temp_deplibs"
6256 newlib_search_path="$newlib_search_path $absdir"
6257 # Link against this library
6258 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
6259 # ... and its dependency_libs
6261 for deplib in $dependency_libs; do
6262 newdependency_libs="$deplib $newdependency_libs"
6263 if $opt_duplicate_deps ; then
6264 case "$tmp_libs " in
6265 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
6268 tmp_libs="$tmp_libs $deplib"
6271 if test "$link_all_deplibs" != no; then
6272 # Add the search paths of all dependency libraries
6273 for deplib in $dependency_libs; do
6276 -L*) path="$deplib" ;;
6278 func_dirname "$deplib" "" "."
6279 dir="$func_dirname_result"
6280 # We need an absolute path.
6282 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
6284 absdir=`cd "$dir" && pwd`
6285 if test -z "$absdir"; then
6286 func_warning "cannot determine absolute directory name of \`$dir'"
6291 if $GREP "^installed=no" $deplib > /dev/null; then
6295 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
6296 if test -n "$deplibrary_names" ; then
6297 for tmp in $deplibrary_names ; do
6300 if test -f "$absdir/$objdir/$depdepl" ; then
6301 depdepl="$absdir/$objdir/$depdepl"
6302 darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
6303 if test -z "$darwin_install_name"; then
6304 darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
6306 compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
6307 linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
6313 path="-L$absdir/$objdir"
6317 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
6318 test -z "$libdir" && \
6319 func_fatal_error "\`$deplib' is not a valid libtool archive"
6320 test "$absdir" != "$libdir" && \
6321 func_warning "\`$deplib' seems to be moved"
6327 case " $deplibs " in
6329 *) deplibs="$path $deplibs" ;;
6332 fi # link_all_deplibs != no
6334 done # for deplib in $libs
6335 if test "$pass" = link; then
6336 if test "$linkmode" = "prog"; then
6337 compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
6338 finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
6340 compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
6343 dependency_libs="$newdependency_libs"
6344 if test "$pass" = dlpreopen; then
6345 # Link the dlpreopened libraries before other libraries
6346 for deplib in $save_deplibs; do
6347 deplibs="$deplib $deplibs"
6350 if test "$pass" != dlopen; then
6351 if test "$pass" != conv; then
6352 # Make sure lib_search_path contains only unique directories.
6354 for dir in $newlib_search_path; do
6355 case "$lib_search_path " in
6357 *) lib_search_path="$lib_search_path $dir" ;;
6363 if test "$linkmode,$pass" != "prog,link"; then
6366 vars="compile_deplibs finalize_deplibs"
6368 for var in $vars dependency_libs; do
6369 # Add libraries to $var in reverse order
6370 eval tmp_libs=\"\$$var\"
6372 for deplib in $tmp_libs; do
6373 # FIXME: Pedantically, this is the right thing to do, so
6374 # that some nasty dependency loop isn't accidentally
6376 #new_libs="$deplib $new_libs"
6377 # Pragmatically, this seems to cause very few problems in
6380 -L*) new_libs="$deplib $new_libs" ;;
6383 # And here is the reason: when a library appears more
6384 # than once as an explicit dependence of a library, or
6385 # is implicitly linked in more than once by the
6386 # compiler, it is considered special, and multiple
6387 # occurrences thereof are not removed. Compare this
6388 # with having the same library being listed as a
6389 # dependency of multiple other libraries: in this case,
6390 # we know (pedantically, we assume) the library does not
6391 # need to be listed more than once, so we keep only the
6392 # last copy. This is not always right, but it is rare
6393 # enough that we require users that really mean to play
6394 # such unportable linking tricks to link the library
6395 # using -Wl,-lname, so that libtool does not consider it
6396 # for duplicate removal.
6397 case " $specialdeplibs " in
6398 *" $deplib "*) new_libs="$deplib $new_libs" ;;
6400 case " $new_libs " in
6402 *) new_libs="$deplib $new_libs" ;;
6410 for deplib in $new_libs; do
6413 case " $tmp_libs " in
6415 *) tmp_libs="$tmp_libs $deplib" ;;
6418 *) tmp_libs="$tmp_libs $deplib" ;;
6421 eval $var=\"$tmp_libs\"
6424 # Last step: remove runtime libs from dependency_libs
6425 # (they stay in deplibs)
6427 for i in $dependency_libs ; do
6428 case " $predeps $postdeps $compiler_lib_search_path " in
6433 if test -n "$i" ; then
6434 tmp_libs="$tmp_libs $i"
6437 dependency_libs=$tmp_libs
6439 if test "$linkmode" = prog; then
6440 dlfiles="$newdlfiles"
6442 if test "$linkmode" = prog || test "$linkmode" = lib; then
6443 dlprefiles="$newdlprefiles"
6448 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
6449 func_warning "\`-dlopen' is ignored for archives"
6454 func_warning "\`-l' and \`-L' are ignored for archives" ;;
6457 test -n "$rpath" && \
6458 func_warning "\`-rpath' is ignored for archives"
6460 test -n "$xrpath" && \
6461 func_warning "\`-R' is ignored for archives"
6463 test -n "$vinfo" && \
6464 func_warning "\`-version-info/-version-number' is ignored for archives"
6466 test -n "$release" && \
6467 func_warning "\`-release' is ignored for archives"
6469 test -n "$export_symbols$export_symbols_regex" && \
6470 func_warning "\`-export-symbols' is ignored for archives"
6472 # Now set the variables for building old libraries.
6473 build_libtool_libs=no
6475 objs="$objs$old_deplibs"
6479 # Make sure we only generate libraries of the form `libNAME.la'.
6482 func_stripname 'lib' '.la' "$outputname"
6483 name=$func_stripname_result
6484 eval shared_ext=\"$shrext_cmds\"
6485 eval libname=\"$libname_spec\"
6488 test "$module" = no && \
6489 func_fatal_help "libtool library \`$output' must begin with \`lib'"
6491 if test "$need_lib_prefix" != no; then
6492 # Add the "lib" prefix for modules if required
6493 func_stripname '' '.la' "$outputname"
6494 name=$func_stripname_result
6495 eval shared_ext=\"$shrext_cmds\"
6496 eval libname=\"$libname_spec\"
6498 func_stripname '' '.la' "$outputname"
6499 libname=$func_stripname_result
6504 if test -n "$objs"; then
6505 if test "$deplibs_check_method" != pass_all; then
6506 func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
6509 $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
6510 $ECHO "*** objects $objs is not portable!"
6511 libobjs="$libobjs $objs"
6515 test "$dlself" != no && \
6516 func_warning "\`-dlopen self' is ignored for libtool libraries"
6520 test "$#" -gt 1 && \
6521 func_warning "ignoring multiple \`-rpath's for a libtool library"
6526 if test -z "$rpath"; then
6527 if test "$build_libtool_libs" = yes; then
6528 # Building a libtool convenience library.
6529 # Some compilers have problems with a `.al' extension so
6530 # convenience libraries should have the same extension an
6531 # archive normally would.
6532 oldlibs="$output_objdir/$libname.$libext $oldlibs"
6533 build_libtool_libs=convenience
6537 test -n "$vinfo" && \
6538 func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
6540 test -n "$release" && \
6541 func_warning "\`-release' is ignored for convenience libraries"
6544 # Parse the version information argument.
6545 save_ifs="$IFS"; IFS=':'
6546 set dummy $vinfo 0 0 0
6551 func_fatal_help "too many parameters to \`-version-info'"
6553 # convert absolute version numbers to libtool ages
6554 # this retains compatibility with .la files and attempts
6555 # to make the code below a bit more comprehensible
6557 case $vinfo_number in
6561 number_revision="$3"
6563 # There are really only two kinds -- those that
6564 # use the current revision as the major version
6565 # and those that subtract age and use age as
6566 # a minor version. But, then there is irix
6567 # which has an extra 1 added just for fun
6569 case $version_type in
6570 darwin|linux|osf|windows|none)
6571 func_arith $number_major + $number_minor
6572 current=$func_arith_result
6574 revision="$number_revision"
6576 freebsd-aout|freebsd-elf|qnx|sunos)
6577 current="$number_major"
6578 revision="$number_minor"
6582 func_arith $number_major + $number_minor
6583 current=$func_arith_result
6585 revision="$number_minor"
6586 lt_irix_increment=no
6597 # Check that each of the things are valid numbers.
6599 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]) ;;
6601 func_error "CURRENT \`$current' must be a nonnegative integer"
6602 func_fatal_error "\`$vinfo' is not valid version information"
6607 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]) ;;
6609 func_error "REVISION \`$revision' must be a nonnegative integer"
6610 func_fatal_error "\`$vinfo' is not valid version information"
6615 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]) ;;
6617 func_error "AGE \`$age' must be a nonnegative integer"
6618 func_fatal_error "\`$vinfo' is not valid version information"
6622 if test "$age" -gt "$current"; then
6623 func_error "AGE \`$age' is greater than the current interface number \`$current'"
6624 func_fatal_error "\`$vinfo' is not valid version information"
6627 # Calculate the version variables.
6631 case $version_type in
6635 # Like Linux, but with the current version available in
6636 # verstring for coding it into the library header
6637 func_arith $current - $age
6638 major=.$func_arith_result
6639 versuffix="$major.$age.$revision"
6640 # Darwin ld doesn't like 0 for these options...
6641 func_arith $current + 1
6642 minor_current=$func_arith_result
6643 xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
6644 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
6649 versuffix=".$current.$revision";
6654 versuffix=".$current"
6658 if test "X$lt_irix_increment" = "Xno"; then
6659 func_arith $current - $age
6661 func_arith $current - $age + 1
6663 major=$func_arith_result
6665 case $version_type in
6666 nonstopux) verstring_prefix=nonstopux ;;
6667 *) verstring_prefix=sgi ;;
6669 verstring="$verstring_prefix$major.$revision"
6671 # Add in all the interfaces that we are compatible with.
6673 while test "$loop" -ne 0; do
6674 func_arith $revision - $loop
6675 iface=$func_arith_result
6676 func_arith $loop - 1
6677 loop=$func_arith_result
6678 verstring="$verstring_prefix$major.$iface:$verstring"
6681 # Before this point, $major must not contain `.'.
6683 versuffix="$major.$revision"
6687 func_arith $current - $age
6688 major=.$func_arith_result
6689 versuffix="$major.$age.$revision"
6693 func_arith $current - $age
6694 major=.$func_arith_result
6695 versuffix=".$current.$age.$revision"
6696 verstring="$current.$age.$revision"
6698 # Add in all the interfaces that we are compatible with.
6700 while test "$loop" -ne 0; do
6701 func_arith $current - $loop
6702 iface=$func_arith_result
6703 func_arith $loop - 1
6704 loop=$func_arith_result
6705 verstring="$verstring:${iface}.0"
6708 # Make executables depend on our current version.
6709 verstring="$verstring:${current}.0"
6714 versuffix=".$current"
6719 versuffix=".$current.$revision"
6723 # Use '-' rather than '.', since we only want one
6724 # extension on DOS 8.3 filesystems.
6725 func_arith $current - $age
6726 major=$func_arith_result
6731 func_fatal_configuration "unknown library version type \`$version_type'"
6735 # Clear the version info if we defaulted, and they specified a release.
6736 if test -z "$vinfo" && test -n "$release"; then
6738 case $version_type in
6740 # we can't check for "0.0" in archive_cmds due to quoting
6741 # problems, so we reset it completely
6748 if test "$need_version" = no; then
6755 # Remove version info from name if versioning should be avoided
6756 if test "$avoid_version" = yes && test "$need_version" = no; then
6762 # Check to see if the archive will have undefined symbols.
6763 if test "$allow_undefined" = yes; then
6764 if test "$allow_undefined_flag" = unsupported; then
6765 func_warning "undefined symbols not allowed in $host shared libraries"
6766 build_libtool_libs=no
6770 # Don't allow undefined symbols.
6771 allow_undefined_flag="$no_undefined_flag"
6776 func_generate_dlsyms "$libname" "$libname" "yes"
6777 libobjs="$libobjs $symfileobj"
6778 test "X$libobjs" = "X " && libobjs=
6780 if test "$mode" != relink; then
6781 # Remove our outputs, but don't remove object files since they
6782 # may have been created when compiling PIC objects.
6784 tempremovelist=`$ECHO "$output_objdir/*"`
6785 for p in $tempremovelist; do
6789 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
6790 if test "X$precious_files_regex" != "X"; then
6791 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
6796 removelist="$removelist $p"
6801 test -n "$removelist" && \
6802 func_show_eval "${RM}r \$removelist"
6805 # Now set the variables for building old libraries.
6806 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
6807 oldlibs="$oldlibs $output_objdir/$libname.$libext"
6809 # Transform .lo files to .o files.
6810 oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
6813 # Eliminate all temporary directories.
6814 #for path in $notinst_path; do
6815 # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
6816 # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
6817 # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
6820 if test -n "$xrpath"; then
6821 # If the user specified any rpath flags, then add them.
6823 for libdir in $xrpath; do
6824 temp_xrpath="$temp_xrpath -R$libdir"
6825 case "$finalize_rpath " in
6827 *) finalize_rpath="$finalize_rpath $libdir" ;;
6830 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
6831 dependency_libs="$temp_xrpath $dependency_libs"
6835 # Make sure dlfiles contains only unique files that won't be dlpreopened
6836 old_dlfiles="$dlfiles"
6838 for lib in $old_dlfiles; do
6839 case " $dlprefiles $dlfiles " in
6841 *) dlfiles="$dlfiles $lib" ;;
6845 # Make sure dlprefiles contains only unique files
6846 old_dlprefiles="$dlprefiles"
6848 for lib in $old_dlprefiles; do
6849 case "$dlprefiles " in
6851 *) dlprefiles="$dlprefiles $lib" ;;
6855 if test "$build_libtool_libs" = yes; then
6856 if test -n "$rpath"; then
6858 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
6859 # these systems don't actually have a c library (as such)!
6861 *-*-rhapsody* | *-*-darwin1.[012])
6862 # Rhapsody C library is in the System framework
6863 deplibs="$deplibs System.ltframework"
6866 # Don't link with libc until the a.out ld.so is fixed.
6868 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
6869 # Do not include libc due to us having libc/libc_r.
6871 *-*-sco3.2v5* | *-*-sco5v6*)
6872 # Causes problems with __ctype
6874 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
6875 # Compiler inserts libc in the correct place for threads to work
6878 # Add libc to deplibs on all other systems if necessary.
6879 if test "$build_libtool_need_lc" = "yes"; then
6880 deplibs="$deplibs -lc"
6886 # Transform deplibs into only deplibs that can be linked in shared.
6888 libname_save=$libname
6889 release_save=$release
6890 versuffix_save=$versuffix
6892 # I'm not sure if I'm treating the release correctly. I think
6893 # release should show up in the -l (ie -lgmp5) so we don't want to
6894 # add it in twice. Is that correct?
6900 case $deplibs_check_method in
6902 # Don't check for shared/static. Everything works.
6903 # This might be a little naive. We might want to check
6904 # whether the library exists or not. But this is on
6905 # osf3 & osf4 and I'm not really sure... Just
6906 # implementing what was already the behavior.
6910 # This code stresses the "libraries are programs" paradigm to its
6911 # limits. Maybe even breaks it. We compile a program, linking it
6912 # against the deplibs as a proxy for the library. Then we can check
6913 # whether they linked in statically or dynamically with ldd.
6914 $opt_dry_run || $RM conftest.c
6915 cat > conftest.c <<EOF
6916 int main() { return 0; }
6918 $opt_dry_run || $RM conftest
6919 if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
6920 ldd_output=`ldd conftest`
6921 for i in $deplibs; do
6924 func_stripname -l '' "$i"
6925 name=$func_stripname_result
6926 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6927 case " $predeps $postdeps " in
6929 newdeplibs="$newdeplibs $i"
6934 if test -n "$i" ; then
6935 libname=`eval "\\$ECHO \"$libname_spec\""`
6936 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
6937 set dummy $deplib_matches; shift
6939 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
6940 newdeplibs="$newdeplibs $i"
6944 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
6945 echo "*** I have the capability to make that library automatically link in when"
6946 echo "*** you link to this library. But I can only do this if you have a"
6947 echo "*** shared version of the library, which I believe you do not have"
6948 echo "*** because a test_compile did reveal that the linker did not use it for"
6949 echo "*** its dynamic dependency list that programs get resolved with at runtime."
6954 newdeplibs="$newdeplibs $i"
6959 # Error occurred in the first compile. Let's try to salvage
6960 # the situation: Compile a separate program for each library.
6961 for i in $deplibs; do
6964 func_stripname -l '' "$i"
6965 name=$func_stripname_result
6966 $opt_dry_run || $RM conftest
6967 if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
6968 ldd_output=`ldd conftest`
6969 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6970 case " $predeps $postdeps " in
6972 newdeplibs="$newdeplibs $i"
6977 if test -n "$i" ; then
6978 libname=`eval "\\$ECHO \"$libname_spec\""`
6979 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
6980 set dummy $deplib_matches; shift
6982 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
6983 newdeplibs="$newdeplibs $i"
6987 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
6988 echo "*** I have the capability to make that library automatically link in when"
6989 echo "*** you link to this library. But I can only do this if you have a"
6990 echo "*** shared version of the library, which you do not appear to have"
6991 echo "*** because a test_compile did reveal that the linker did not use this one"
6992 echo "*** as a dynamic dependency that programs can get resolved with at runtime."
6998 $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
6999 echo "*** make it link in! You will probably need to install it or some"
7000 echo "*** library that it depends on before this library will be fully"
7001 echo "*** functional. Installing it before continuing would be even better."
7005 newdeplibs="$newdeplibs $i"
7012 set dummy $deplibs_check_method; shift
7013 file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
7014 for a_deplib in $deplibs; do
7017 func_stripname -l '' "$a_deplib"
7018 name=$func_stripname_result
7019 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7020 case " $predeps $postdeps " in
7022 newdeplibs="$newdeplibs $a_deplib"
7027 if test -n "$a_deplib" ; then
7028 libname=`eval "\\$ECHO \"$libname_spec\""`
7029 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
7030 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
7031 for potent_lib in $potential_libs; do
7032 # Follow soft links.
7033 if ls -lLd "$potent_lib" 2>/dev/null |
7034 $GREP " -> " >/dev/null; then
7037 # The statement above tries to avoid entering an
7038 # endless loop below, in case of cyclic links.
7039 # We might still enter an endless loop, since a link
7040 # loop can be closed while we follow links,
7042 potlib="$potent_lib"
7043 while test -h "$potlib" 2>/dev/null; do
7044 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
7046 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
7047 *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
7050 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
7052 $EGREP "$file_magic_regex" > /dev/null; then
7053 newdeplibs="$newdeplibs $a_deplib"
7060 if test -n "$a_deplib" ; then
7063 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
7064 echo "*** I have the capability to make that library automatically link in when"
7065 echo "*** you link to this library. But I can only do this if you have a"
7066 echo "*** shared version of the library, which you do not appear to have"
7067 echo "*** because I did check the linker path looking for a file starting"
7068 if test -z "$potlib" ; then
7069 $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
7071 $ECHO "*** with $libname and none of the candidates passed a file format test"
7072 $ECHO "*** using a file magic. Last file checked: $potlib"
7077 # Add a -L argument.
7078 newdeplibs="$newdeplibs $a_deplib"
7081 done # Gone through all deplibs.
7084 set dummy $deplibs_check_method; shift
7085 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
7086 for a_deplib in $deplibs; do
7089 func_stripname -l '' "$a_deplib"
7090 name=$func_stripname_result
7091 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7092 case " $predeps $postdeps " in
7094 newdeplibs="$newdeplibs $a_deplib"
7099 if test -n "$a_deplib" ; then
7100 libname=`eval "\\$ECHO \"$libname_spec\""`
7101 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
7102 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
7103 for potent_lib in $potential_libs; do
7104 potlib="$potent_lib" # see symlink-check above in file_magic test
7105 if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
7106 $EGREP "$match_pattern_regex" > /dev/null; then
7107 newdeplibs="$newdeplibs $a_deplib"
7114 if test -n "$a_deplib" ; then
7117 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
7118 echo "*** I have the capability to make that library automatically link in when"
7119 echo "*** you link to this library. But I can only do this if you have a"
7120 echo "*** shared version of the library, which you do not appear to have"
7121 echo "*** because I did check the linker path looking for a file starting"
7122 if test -z "$potlib" ; then
7123 $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
7125 $ECHO "*** with $libname and none of the candidates passed a file format test"
7126 $ECHO "*** using a regex pattern. Last file checked: $potlib"
7131 # Add a -L argument.
7132 newdeplibs="$newdeplibs $a_deplib"
7135 done # Gone through all deplibs.
7139 tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
7140 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7141 for i in $predeps $postdeps ; do
7142 # can't use Xsed below, because $i might contain '/'
7143 tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
7146 case $tmp_deplibs in
7149 if test "X$deplibs_check_method" = "Xnone"; then
7150 echo "*** Warning: inter-library dependencies are not supported in this platform."
7152 echo "*** Warning: inter-library dependencies are not known to be supported."
7154 echo "*** All declared inter-library dependencies are being dropped."
7160 versuffix=$versuffix_save
7162 release=$release_save
7163 libname=$libname_save
7167 *-*-rhapsody* | *-*-darwin1.[012])
7168 # On Rhapsody replace the C library with the System framework
7169 newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
7173 if test "$droppeddeps" = yes; then
7174 if test "$module" = yes; then
7176 echo "*** Warning: libtool could not satisfy all declared inter-library"
7177 $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
7178 echo "*** a static module, that should work as long as the dlopening"
7179 echo "*** application is linked with the -dlopen flag."
7180 if test -z "$global_symbol_pipe"; then
7182 echo "*** However, this would only work if libtool was able to extract symbol"
7183 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
7184 echo "*** not find such a program. So, this module is probably useless."
7185 echo "*** \`nm' from GNU binutils and a full rebuild may help."
7187 if test "$build_old_libs" = no; then
7188 oldlibs="$output_objdir/$libname.$libext"
7189 build_libtool_libs=module
7192 build_libtool_libs=no
7195 echo "*** The inter-library dependencies that have been dropped here will be"
7196 echo "*** automatically added whenever a program is linked with this library"
7197 echo "*** or is declared to -dlopen it."
7199 if test "$allow_undefined" = no; then
7201 echo "*** Since this library must not contain undefined symbols,"
7202 echo "*** because either the platform does not support them or"
7203 echo "*** it was explicitly requested with -no-undefined,"
7204 echo "*** libtool will only create a static version of it."
7205 if test "$build_old_libs" = no; then
7206 oldlibs="$output_objdir/$libname.$libext"
7207 build_libtool_libs=module
7210 build_libtool_libs=no
7215 # Done checking deplibs!
7218 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
7221 newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7222 new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7223 deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7227 # move library search paths that coincide with paths to not yet
7228 # installed libraries to the beginning of the library search list
7230 for path in $notinst_path; do
7231 case " $new_libs " in
7232 *" -L$path/$objdir "*) ;;
7234 case " $deplibs " in
7235 *" -L$path/$objdir "*)
7236 new_libs="$new_libs -L$path/$objdir" ;;
7241 for deplib in $deplibs; do
7244 case " $new_libs " in
7246 *) new_libs="$new_libs $deplib" ;;
7249 *) new_libs="$new_libs $deplib" ;;
7254 # All the library-specific variables (install_libdir is set above).
7259 # Test again, we may have decided not to build it any more
7260 if test "$build_libtool_libs" = yes; then
7261 if test "$hardcode_into_libs" = yes; then
7262 # Hardcode the library paths
7265 rpath="$finalize_rpath"
7266 test "$mode" != relink && rpath="$compile_rpath$rpath"
7267 for libdir in $rpath; do
7268 if test -n "$hardcode_libdir_flag_spec"; then
7269 if test -n "$hardcode_libdir_separator"; then
7270 if test -z "$hardcode_libdirs"; then
7271 hardcode_libdirs="$libdir"
7273 # Just accumulate the unique libdirs.
7274 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
7275 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
7278 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
7283 eval flag=\"$hardcode_libdir_flag_spec\"
7284 dep_rpath="$dep_rpath $flag"
7286 elif test -n "$runpath_var"; then
7287 case "$perm_rpath " in
7289 *) perm_rpath="$perm_rpath $libdir" ;;
7293 # Substitute the hardcoded libdirs into the rpath.
7294 if test -n "$hardcode_libdir_separator" &&
7295 test -n "$hardcode_libdirs"; then
7296 libdir="$hardcode_libdirs"
7297 if test -n "$hardcode_libdir_flag_spec_ld"; then
7298 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
7300 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
7303 if test -n "$runpath_var" && test -n "$perm_rpath"; then
7304 # We should set the runpath_var.
7306 for dir in $perm_rpath; do
7309 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
7311 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
7314 shlibpath="$finalize_shlibpath"
7315 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
7316 if test -n "$shlibpath"; then
7317 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
7320 # Get the real and link names of the library.
7321 eval shared_ext=\"$shrext_cmds\"
7322 eval library_names=\"$library_names_spec\"
7323 set dummy $library_names
7328 if test -n "$soname_spec"; then
7329 eval soname=\"$soname_spec\"
7333 if test -z "$dlname"; then
7337 lib="$output_objdir/$realname"
7341 linknames="$linknames $link"
7344 # Use standard objects if they are pic
7345 test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
7346 test "X$libobjs" = "X " && libobjs=
7349 if test -n "$export_symbols" && test -n "$include_expsyms"; then
7350 $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
7351 export_symbols="$output_objdir/$libname.uexp"
7352 delfiles="$delfiles $export_symbols"
7355 orig_export_symbols=
7357 cygwin* | mingw* | cegcc*)
7358 if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
7359 # exporting using user supplied symfile
7360 if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
7361 # and it's NOT already a .def file. Must figure out
7362 # which of the given symbols are data symbols and tag
7363 # them as such. So, trigger use of export_symbols_cmds.
7364 # export_symbols gets reassigned inside the "prepare
7365 # the list of exported symbols" if statement, so the
7366 # include_expsyms logic still works.
7367 orig_export_symbols="$export_symbols"
7369 always_export_symbols=yes
7375 # Prepare the list of exported symbols
7376 if test -z "$export_symbols"; then
7377 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
7378 func_verbose "generating symbol list for \`$libname.la'"
7379 export_symbols="$output_objdir/$libname.exp"
7380 $opt_dry_run || $RM $export_symbols
7381 cmds=$export_symbols_cmds
7382 save_ifs="$IFS"; IFS='~'
7383 for cmd in $cmds; do
7387 len=$func_len_result
7388 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
7389 func_show_eval "$cmd" 'exit $?'
7390 skipped_export=false
7392 # The command line is too long to execute in one step.
7393 func_verbose "using reloadable object file for export list..."
7395 # Break out early, otherwise skipped_export may be
7396 # set to false by a later but shorter cmd.
7401 if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
7402 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
7403 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
7408 if test -n "$export_symbols" && test -n "$include_expsyms"; then
7409 tmp_export_symbols="$export_symbols"
7410 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
7411 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
7414 if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
7415 # The given exports_symbols file has to be filtered, so filter it.
7416 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
7417 # FIXME: $output_objdir/$libname.filter potentially contains lots of
7418 # 's' commands which not all seds can handle. GNU sed should be fine
7419 # though. Also, the filter scales superlinearly with the number of
7420 # global variables. join(1) would be nice here, but unfortunately
7421 # isn't a blessed tool.
7422 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
7423 delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
7424 export_symbols=$output_objdir/$libname.def
7425 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
7429 for test_deplib in $deplibs; do
7430 case " $convenience " in
7431 *" $test_deplib "*) ;;
7433 tmp_deplibs="$tmp_deplibs $test_deplib"
7437 deplibs="$tmp_deplibs"
7439 if test -n "$convenience"; then
7440 if test -n "$whole_archive_flag_spec" &&
7441 test "$compiler_needs_object" = yes &&
7442 test -z "$libobjs"; then
7443 # extract the archives, so we have objects to list.
7444 # TODO: could optimize this to just extract one archive.
7445 whole_archive_flag_spec=
7447 if test -n "$whole_archive_flag_spec"; then
7448 save_libobjs=$libobjs
7449 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
7450 test "X$libobjs" = "X " && libobjs=
7452 gentop="$output_objdir/${outputname}x"
7453 generated="$generated $gentop"
7455 func_extract_archives $gentop $convenience
7456 libobjs="$libobjs $func_extract_archives_result"
7457 test "X$libobjs" = "X " && libobjs=
7461 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
7462 eval flag=\"$thread_safe_flag_spec\"
7463 linker_flags="$linker_flags $flag"
7466 # Make a backup of the uninstalled library when relinking
7467 if test "$mode" = relink; then
7468 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
7471 # Do each of the archive commands.
7472 if test "$module" = yes && test -n "$module_cmds" ; then
7473 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
7474 eval test_cmds=\"$module_expsym_cmds\"
7475 cmds=$module_expsym_cmds
7477 eval test_cmds=\"$module_cmds\"
7481 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
7482 eval test_cmds=\"$archive_expsym_cmds\"
7483 cmds=$archive_expsym_cmds
7485 eval test_cmds=\"$archive_cmds\"
7490 if test "X$skipped_export" != "X:" &&
7491 func_len " $test_cmds" &&
7492 len=$func_len_result &&
7493 test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
7496 # The command line is too long to link in one step, link piecewise
7497 # or, if using GNU ld and skipped_export is not :, use a linker
7500 # Save the value of $output and $libobjs because we want to
7501 # use them later. If we have whole_archive_flag_spec, we
7502 # want to use save_libobjs as it was before
7503 # whole_archive_flag_spec was expanded, because we can't
7504 # assume the linker understands whole_archive_flag_spec.
7505 # This may have to be revisited, in case too many
7506 # convenience libraries get linked in and end up exceeding
7508 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
7509 save_libobjs=$libobjs
7512 func_basename "$output"
7513 output_la=$func_basename_result
7515 # Clear the reloadable object creation command queue and
7516 # initialize k to one.
7523 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
7524 output=${output_objdir}/${output_la}.lnkscript
7525 func_verbose "creating GNU ld script: $output"
7526 echo 'INPUT (' > $output
7527 for obj in $save_libobjs
7529 $ECHO "$obj" >> $output
7532 delfiles="$delfiles $output"
7533 elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
7534 output=${output_objdir}/${output_la}.lnk
7535 func_verbose "creating linker input file list: $output"
7540 if test "$compiler_needs_object" = yes; then
7546 $ECHO "$obj" >> $output
7548 delfiles="$delfiles $output"
7549 output=$firstobj\"$file_list_spec$output\"
7551 if test -n "$save_libobjs"; then
7552 func_verbose "creating reloadable object files..."
7553 output=$output_objdir/$output_la-${k}.$objext
7554 eval test_cmds=\"$reload_cmds\"
7555 func_len " $test_cmds"
7556 len0=$func_len_result
7559 # Loop over the list of objects to be linked.
7560 for obj in $save_libobjs
7563 func_arith $len + $func_len_result
7564 len=$func_arith_result
7565 if test "X$objlist" = X ||
7566 test "$len" -lt "$max_cmd_len"; then
7567 func_append objlist " $obj"
7569 # The command $test_cmds is almost too long, add a
7570 # command to the queue.
7571 if test "$k" -eq 1 ; then
7572 # The first file doesn't have a previous command to add.
7573 reload_objs=$objlist
7574 eval concat_cmds=\"$reload_cmds\"
7576 # All subsequent reloadable object files will link in
7577 # the last one created.
7578 reload_objs="$objlist $last_robj"
7579 eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
7581 last_robj=$output_objdir/$output_la-${k}.$objext
7583 k=$func_arith_result
7584 output=$output_objdir/$output_la-${k}.$objext
7586 func_len " $last_robj"
7587 func_arith $len0 + $func_len_result
7588 len=$func_arith_result
7591 # Handle the remaining objects by creating one last
7592 # reloadable object file. All subsequent reloadable object
7593 # files will link in the last one created.
7594 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
7595 reload_objs="$objlist $last_robj"
7596 eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
7597 if test -n "$last_robj"; then
7598 eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
7600 delfiles="$delfiles $output"
7606 if ${skipped_export-false}; then
7607 func_verbose "generating symbol list for \`$libname.la'"
7608 export_symbols="$output_objdir/$libname.exp"
7609 $opt_dry_run || $RM $export_symbols
7611 # Append the command to create the export file.
7612 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
7613 eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
7614 if test -n "$last_robj"; then
7615 eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
7619 test -n "$save_libobjs" &&
7620 func_verbose "creating a temporary reloadable object file: $output"
7622 # Loop through the commands generated above and execute them.
7623 save_ifs="$IFS"; IFS='~'
7624 for cmd in $concat_cmds; do
7627 func_quote_for_expand "$cmd"
7628 eval "func_echo $func_quote_for_expand_result"
7630 $opt_dry_run || eval "$cmd" || {
7633 # Restore the uninstalled library and exit
7634 if test "$mode" = relink; then
7635 ( cd "$output_objdir" && \
7636 $RM "${realname}T" && \
7637 $MV "${realname}U" "$realname" )
7645 if test -n "$export_symbols_regex" && ${skipped_export-false}; then
7646 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
7647 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
7651 if ${skipped_export-false}; then
7652 if test -n "$export_symbols" && test -n "$include_expsyms"; then
7653 tmp_export_symbols="$export_symbols"
7654 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
7655 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
7658 if test -n "$orig_export_symbols"; then
7659 # The given exports_symbols file has to be filtered, so filter it.
7660 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
7661 # FIXME: $output_objdir/$libname.filter potentially contains lots of
7662 # 's' commands which not all seds can handle. GNU sed should be fine
7663 # though. Also, the filter scales superlinearly with the number of
7664 # global variables. join(1) would be nice here, but unfortunately
7665 # isn't a blessed tool.
7666 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
7667 delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
7668 export_symbols=$output_objdir/$libname.def
7669 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
7674 # Restore the value of output.
7677 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
7678 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
7679 test "X$libobjs" = "X " && libobjs=
7681 # Expand the library linking commands again to reset the
7682 # value of $libobjs for piecewise linking.
7684 # Do each of the archive commands.
7685 if test "$module" = yes && test -n "$module_cmds" ; then
7686 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
7687 cmds=$module_expsym_cmds
7692 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
7693 cmds=$archive_expsym_cmds
7700 if test -n "$delfiles"; then
7701 # Append the command to remove temporary files to $cmds.
7702 eval cmds=\"\$cmds~\$RM $delfiles\"
7705 # Add any objects from preloaded convenience libraries
7706 if test -n "$dlprefiles"; then
7707 gentop="$output_objdir/${outputname}x"
7708 generated="$generated $gentop"
7710 func_extract_archives $gentop $dlprefiles
7711 libobjs="$libobjs $func_extract_archives_result"
7712 test "X$libobjs" = "X " && libobjs=
7715 save_ifs="$IFS"; IFS='~'
7716 for cmd in $cmds; do
7720 func_quote_for_expand "$cmd"
7721 eval "func_echo $func_quote_for_expand_result"
7723 $opt_dry_run || eval "$cmd" || {
7726 # Restore the uninstalled library and exit
7727 if test "$mode" = relink; then
7728 ( cd "$output_objdir" && \
7729 $RM "${realname}T" && \
7730 $MV "${realname}U" "$realname" )
7738 # Restore the uninstalled library and exit
7739 if test "$mode" = relink; then
7740 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
7742 if test -n "$convenience"; then
7743 if test -z "$whole_archive_flag_spec"; then
7744 func_show_eval '${RM}r "$gentop"'
7751 # Create links to the real library.
7752 for linkname in $linknames; do
7753 if test "$realname" != "$linkname"; then
7754 func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
7758 # If -module or -export-dynamic was specified, set the dlname.
7759 if test "$module" = yes || test "$export_dynamic" = yes; then
7760 # On all known operating systems, these are identical.
7767 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
7768 func_warning "\`-dlopen' is ignored for objects"
7773 func_warning "\`-l' and \`-L' are ignored for objects" ;;
7776 test -n "$rpath" && \
7777 func_warning "\`-rpath' is ignored for objects"
7779 test -n "$xrpath" && \
7780 func_warning "\`-R' is ignored for objects"
7782 test -n "$vinfo" && \
7783 func_warning "\`-version-info' is ignored for objects"
7785 test -n "$release" && \
7786 func_warning "\`-release' is ignored for objects"
7790 test -n "$objs$old_deplibs" && \
7791 func_fatal_error "cannot build library object \`$output' from non-libtool objects"
7795 obj=$func_lo2o_result
7803 # Delete the old objects.
7804 $opt_dry_run || $RM $obj $libobj
7806 # Objects from convenience libraries. This assumes
7807 # single-version convenience libraries. Whenever we create
7808 # different ones for PIC/non-PIC, this we'll have to duplicate
7812 # reload_cmds runs $LD directly, so let us get rid of
7813 # -Wl from whole_archive_flag_spec and hope we can get by with
7814 # turning comma into space..
7817 if test -n "$convenience"; then
7818 if test -n "$whole_archive_flag_spec"; then
7819 eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
7820 reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
7822 gentop="$output_objdir/${obj}x"
7823 generated="$generated $gentop"
7825 func_extract_archives $gentop $convenience
7826 reload_conv_objs="$reload_objs $func_extract_archives_result"
7830 # Create the old-style object.
7831 reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
7834 func_execute_cmds "$reload_cmds" 'exit $?'
7836 # Exit if we aren't doing a library object file.
7837 if test -z "$libobj"; then
7838 if test -n "$gentop"; then
7839 func_show_eval '${RM}r "$gentop"'
7845 if test "$build_libtool_libs" != yes; then
7846 if test -n "$gentop"; then
7847 func_show_eval '${RM}r "$gentop"'
7850 # Create an invalid libtool object if no PIC, so that we don't
7851 # accidentally link it into a program.
7852 # $show "echo timestamp > $libobj"
7853 # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
7857 if test -n "$pic_flag" || test "$pic_mode" != default; then
7858 # Only do commands if we really have different PIC objects.
7859 reload_objs="$libobjs $reload_conv_objs"
7861 func_execute_cmds "$reload_cmds" 'exit $?'
7864 if test -n "$gentop"; then
7865 func_show_eval '${RM}r "$gentop"'
7873 *cygwin*) func_stripname '' '.exe' "$output"
7874 output=$func_stripname_result.exe;;
7876 test -n "$vinfo" && \
7877 func_warning "\`-version-info' is ignored for programs"
7879 test -n "$release" && \
7880 func_warning "\`-release' is ignored for programs"
7882 test "$preload" = yes \
7883 && test "$dlopen_support" = unknown \
7884 && test "$dlopen_self" = unknown \
7885 && test "$dlopen_self_static" = unknown && \
7886 func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
7889 *-*-rhapsody* | *-*-darwin1.[012])
7890 # On Rhapsody replace the C library is the System framework
7891 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
7892 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
7898 # Don't allow lazy linking, it breaks C++ global constructors
7899 # But is supposedly fixed on 10.4 or later (yay!).
7900 if test "$tagname" = CXX ; then
7901 case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
7903 compile_command="$compile_command ${wl}-bind_at_load"
7904 finalize_command="$finalize_command ${wl}-bind_at_load"
7908 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
7909 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7910 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7915 # move library search paths that coincide with paths to not yet
7916 # installed libraries to the beginning of the library search list
7918 for path in $notinst_path; do
7919 case " $new_libs " in
7920 *" -L$path/$objdir "*) ;;
7922 case " $compile_deplibs " in
7923 *" -L$path/$objdir "*)
7924 new_libs="$new_libs -L$path/$objdir" ;;
7929 for deplib in $compile_deplibs; do
7932 case " $new_libs " in
7934 *) new_libs="$new_libs $deplib" ;;
7937 *) new_libs="$new_libs $deplib" ;;
7940 compile_deplibs="$new_libs"
7943 compile_command="$compile_command $compile_deplibs"
7944 finalize_command="$finalize_command $finalize_deplibs"
7946 if test -n "$rpath$xrpath"; then
7947 # If the user specified any rpath flags, then add them.
7948 for libdir in $rpath $xrpath; do
7949 # This is the magic to use -rpath.
7950 case "$finalize_rpath " in
7952 *) finalize_rpath="$finalize_rpath $libdir" ;;
7957 # Now hardcode the library paths
7960 for libdir in $compile_rpath $finalize_rpath; do
7961 if test -n "$hardcode_libdir_flag_spec"; then
7962 if test -n "$hardcode_libdir_separator"; then
7963 if test -z "$hardcode_libdirs"; then
7964 hardcode_libdirs="$libdir"
7966 # Just accumulate the unique libdirs.
7967 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
7968 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
7971 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
7976 eval flag=\"$hardcode_libdir_flag_spec\"
7977 rpath="$rpath $flag"
7979 elif test -n "$runpath_var"; then
7980 case "$perm_rpath " in
7982 *) perm_rpath="$perm_rpath $libdir" ;;
7986 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
7987 testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
7988 case :$dllsearchpath: in
7990 ::) dllsearchpath=$libdir;;
7991 *) dllsearchpath="$dllsearchpath:$libdir";;
7993 case :$dllsearchpath: in
7994 *":$testbindir:"*) ;;
7995 ::) dllsearchpath=$testbindir;;
7996 *) dllsearchpath="$dllsearchpath:$testbindir";;
8001 # Substitute the hardcoded libdirs into the rpath.
8002 if test -n "$hardcode_libdir_separator" &&
8003 test -n "$hardcode_libdirs"; then
8004 libdir="$hardcode_libdirs"
8005 eval rpath=\" $hardcode_libdir_flag_spec\"
8007 compile_rpath="$rpath"
8011 for libdir in $finalize_rpath; do
8012 if test -n "$hardcode_libdir_flag_spec"; then
8013 if test -n "$hardcode_libdir_separator"; then
8014 if test -z "$hardcode_libdirs"; then
8015 hardcode_libdirs="$libdir"
8017 # Just accumulate the unique libdirs.
8018 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
8019 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
8022 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
8027 eval flag=\"$hardcode_libdir_flag_spec\"
8028 rpath="$rpath $flag"
8030 elif test -n "$runpath_var"; then
8031 case "$finalize_perm_rpath " in
8033 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
8037 # Substitute the hardcoded libdirs into the rpath.
8038 if test -n "$hardcode_libdir_separator" &&
8039 test -n "$hardcode_libdirs"; then
8040 libdir="$hardcode_libdirs"
8041 eval rpath=\" $hardcode_libdir_flag_spec\"
8043 finalize_rpath="$rpath"
8045 if test -n "$libobjs" && test "$build_old_libs" = yes; then
8046 # Transform all the library objects into standard objects.
8047 compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
8048 finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
8051 func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
8053 # template prelinking step
8054 if test -n "$prelink_cmds"; then
8055 func_execute_cmds "$prelink_cmds" 'exit $?'
8058 wrappers_required=yes
8060 *cegcc* | *mingw32ce*)
8061 # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
8062 wrappers_required=no
8064 *cygwin* | *mingw* )
8065 if test "$build_libtool_libs" != yes; then
8066 wrappers_required=no
8070 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
8071 wrappers_required=no
8075 if test "$wrappers_required" = no; then
8076 # Replace the output file specification.
8077 compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
8078 link_command="$compile_command$compile_rpath"
8080 # We have no uninstalled library dependencies, so finalize right now.
8082 func_show_eval "$link_command" 'exit_status=$?'
8084 # Delete the generated files.
8085 if test -f "$output_objdir/${outputname}S.${objext}"; then
8086 func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
8092 if test -n "$compile_shlibpath$finalize_shlibpath"; then
8093 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
8095 if test -n "$finalize_shlibpath"; then
8096 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
8101 if test -n "$runpath_var"; then
8102 if test -n "$perm_rpath"; then
8103 # We should set the runpath_var.
8105 for dir in $perm_rpath; do
8108 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
8110 if test -n "$finalize_perm_rpath"; then
8111 # We should set the runpath_var.
8113 for dir in $finalize_perm_rpath; do
8116 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
8120 if test "$no_install" = yes; then
8121 # We don't need to create a wrapper script.
8122 link_command="$compile_var$compile_command$compile_rpath"
8123 # Replace the output file specification.
8124 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
8125 # Delete the old output file.
8126 $opt_dry_run || $RM $output
8127 # Link the executable and exit
8128 func_show_eval "$link_command" 'exit $?'
8132 if test "$hardcode_action" = relink; then
8133 # Fast installation is not supported
8134 link_command="$compile_var$compile_command$compile_rpath"
8135 relink_command="$finalize_var$finalize_command$finalize_rpath"
8137 func_warning "this platform does not like uninstalled shared libraries"
8138 func_warning "\`$output' will be relinked during installation"
8140 if test "$fast_install" != no; then
8141 link_command="$finalize_var$compile_command$finalize_rpath"
8142 if test "$fast_install" = yes; then
8143 relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
8145 # fast_install is set to needless
8149 link_command="$compile_var$compile_command$compile_rpath"
8150 relink_command="$finalize_var$finalize_command$finalize_rpath"
8154 # Replace the output file specification.
8155 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
8157 # Delete the old output files.
8158 $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
8160 func_show_eval "$link_command" 'exit $?'
8162 # Now create the wrapper script.
8163 func_verbose "creating $output"
8165 # Quote the relink command for shipping.
8166 if test -n "$relink_command"; then
8167 # Preserve any variables that may affect compiler behavior
8168 for var in $variables_saved_for_relink; do
8169 if eval test -z \"\${$var+set}\"; then
8170 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
8171 elif eval var_value=\$$var; test -z "$var_value"; then
8172 relink_command="$var=; export $var; $relink_command"
8174 func_quote_for_eval "$var_value"
8175 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
8178 relink_command="(cd `pwd`; $relink_command)"
8179 relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
8182 # Only actually do things if not in dry run mode.
8184 # win32 will think the script is a binary if it has
8185 # a .exe suffix, so we strip it off here.
8187 *.exe) func_stripname '' '.exe' "$output"
8188 output=$func_stripname_result ;;
8190 # test for cygwin because mv fails w/o .exe extensions
8194 func_stripname '' '.exe' "$outputname"
8195 outputname=$func_stripname_result ;;
8199 *cygwin* | *mingw* )
8200 func_dirname_and_basename "$output" "" "."
8201 output_name=$func_basename_result
8202 output_path=$func_dirname_result
8203 cwrappersource="$output_path/$objdir/lt-$output_name.c"
8204 cwrapper="$output_path/$output_name.exe"
8205 $RM $cwrappersource $cwrapper
8206 trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
8208 func_emit_cwrapperexe_src > $cwrappersource
8210 # The wrapper executable is built using the $host compiler,
8211 # because it contains $host paths and files. If cross-
8212 # compiling, it, like the target executable, must be
8213 # executed on the $host or under an emulation environment.
8215 $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
8219 # Now, create the wrapper script for func_source use:
8220 func_ltwrapper_scriptname $cwrapper
8221 $RM $func_ltwrapper_scriptname_result
8222 trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
8224 # note: this script will not be executed, so do not chmod.
8225 if test "x$build" = "x$host" ; then
8226 $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
8228 func_emit_wrapper no > $func_ltwrapper_scriptname_result
8234 trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
8236 func_emit_wrapper no > $output
8245 # See if we need to build an old-fashioned archive.
8246 for oldlib in $oldlibs; do
8248 if test "$build_libtool_libs" = convenience; then
8249 oldobjs="$libobjs_save $symfileobj"
8250 addlibs="$convenience"
8251 build_libtool_libs=no
8253 if test "$build_libtool_libs" = module; then
8254 oldobjs="$libobjs_save"
8255 build_libtool_libs=no
8257 oldobjs="$old_deplibs $non_pic_objects"
8258 if test "$preload" = yes && test -f "$symfileobj"; then
8259 oldobjs="$oldobjs $symfileobj"
8262 addlibs="$old_convenience"
8265 if test -n "$addlibs"; then
8266 gentop="$output_objdir/${outputname}x"
8267 generated="$generated $gentop"
8269 func_extract_archives $gentop $addlibs
8270 oldobjs="$oldobjs $func_extract_archives_result"
8273 # Do each command in the archive commands.
8274 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
8275 cmds=$old_archive_from_new_cmds
8278 # Add any objects from preloaded convenience libraries
8279 if test -n "$dlprefiles"; then
8280 gentop="$output_objdir/${outputname}x"
8281 generated="$generated $gentop"
8283 func_extract_archives $gentop $dlprefiles
8284 oldobjs="$oldobjs $func_extract_archives_result"
8287 # POSIX demands no paths to be encoded in archives. We have
8288 # to avoid creating archives with duplicate basenames if we
8289 # might have to extract them afterwards, e.g., when creating a
8290 # static archive out of a convenience library, or when linking
8291 # the entirety of a libtool archive into another (currently
8292 # not supported by libtool).
8293 if (for obj in $oldobjs
8295 func_basename "$obj"
8296 $ECHO "$func_basename_result"
8297 done | sort | sort -uc >/dev/null 2>&1); then
8300 echo "copying selected object files to avoid basename conflicts..."
8301 gentop="$output_objdir/${outputname}x"
8302 generated="$generated $gentop"
8303 func_mkdir_p "$gentop"
8304 save_oldobjs=$oldobjs
8307 for obj in $save_oldobjs
8309 func_basename "$obj"
8310 objbase="$func_basename_result"
8311 case " $oldobjs " in
8312 " ") oldobjs=$obj ;;
8315 # Make sure we don't pick an alternate name that also
8317 newobj=lt$counter-$objbase
8318 func_arith $counter + 1
8319 counter=$func_arith_result
8320 case " $oldobjs " in
8321 *[\ /]"$newobj "*) ;;
8322 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
8325 func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
8326 oldobjs="$oldobjs $gentop/$newobj"
8328 *) oldobjs="$oldobjs $obj" ;;
8332 eval cmds=\"$old_archive_cmds\"
8335 len=$func_len_result
8336 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
8337 cmds=$old_archive_cmds
8339 # the command line is too long to link in one step, link in parts
8340 func_verbose "using piecewise archive linking..."
8345 save_oldobjs=$oldobjs
8347 # Is there a better way of finding the last object in the list?
8348 for obj in $save_oldobjs
8352 eval test_cmds=\"$old_archive_cmds\"
8353 func_len " $test_cmds"
8354 len0=$func_len_result
8356 for obj in $save_oldobjs
8359 func_arith $len + $func_len_result
8360 len=$func_arith_result
8361 func_append objlist " $obj"
8362 if test "$len" -lt "$max_cmd_len"; then
8365 # the above command should be used before it gets too long
8367 if test "$obj" = "$last_oldobj" ; then
8370 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
8371 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
8378 if test "X$oldobjs" = "X" ; then
8379 eval cmds=\"\$concat_cmds\"
8381 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
8385 func_execute_cmds "$cmds" 'exit $?'
8388 test -n "$generated" && \
8389 func_show_eval "${RM}r$generated"
8391 # Now create the libtool archive.
8395 test "$build_old_libs" = yes && old_library="$libname.$libext"
8396 func_verbose "creating $output"
8398 # Preserve any variables that may affect compiler behavior
8399 for var in $variables_saved_for_relink; do
8400 if eval test -z \"\${$var+set}\"; then
8401 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
8402 elif eval var_value=\$$var; test -z "$var_value"; then
8403 relink_command="$var=; export $var; $relink_command"
8405 func_quote_for_eval "$var_value"
8406 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
8409 # Quote the link command for shipping.
8410 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
8411 relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
8412 if test "$hardcode_automatic" = yes ; then
8416 # Only create the output if not a dry run.
8418 for installed in no yes; do
8419 if test "$installed" = yes; then
8420 if test -z "$install_libdir"; then
8423 output="$output_objdir/$outputname"i
8424 # Replace all uninstalled libtool libraries with the installed ones
8426 for deplib in $dependency_libs; do
8429 func_basename "$deplib"
8430 name="$func_basename_result"
8431 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
8432 test -z "$libdir" && \
8433 func_fatal_error "\`$deplib' is not a valid libtool archive"
8434 newdependency_libs="$newdependency_libs $libdir/$name"
8436 *) newdependency_libs="$newdependency_libs $deplib" ;;
8439 dependency_libs="$newdependency_libs"
8442 for lib in $dlfiles; do
8445 func_basename "$lib"
8446 name="$func_basename_result"
8447 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
8448 test -z "$libdir" && \
8449 func_fatal_error "\`$lib' is not a valid libtool archive"
8450 newdlfiles="$newdlfiles $libdir/$name"
8452 *) newdlfiles="$newdlfiles $lib" ;;
8455 dlfiles="$newdlfiles"
8457 for lib in $dlprefiles; do
8460 # Only pass preopened files to the pseudo-archive (for
8461 # eventual linking with the app. that links it) if we
8462 # didn't already link the preopened objects directly into
8464 func_basename "$lib"
8465 name="$func_basename_result"
8466 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
8467 test -z "$libdir" && \
8468 func_fatal_error "\`$lib' is not a valid libtool archive"
8469 newdlprefiles="$newdlprefiles $libdir/$name"
8473 dlprefiles="$newdlprefiles"
8476 for lib in $dlfiles; do
8478 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
8479 *) abs=`pwd`"/$lib" ;;
8481 newdlfiles="$newdlfiles $abs"
8483 dlfiles="$newdlfiles"
8485 for lib in $dlprefiles; do
8487 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
8488 *) abs=`pwd`"/$lib" ;;
8490 newdlprefiles="$newdlprefiles $abs"
8492 dlprefiles="$newdlprefiles"
8495 # place dlname in correct position for cygwin
8496 # In fact, it would be nice if we could use this code for all target
8497 # systems that can't hard-code library paths into their executables
8498 # and that have no shared library path variable independent of PATH,
8499 # but it turns out we can't easily determine that from inspecting
8500 # libtool variables, so we have to hard-code the OSs to which it
8501 # applies here; at the moment, that means platforms that use the PE
8502 # object format with DLL files. See the long comment at the top of
8503 # tests/bindir.at for full details.
8505 case $host,$output,$installed,$module,$dlname in
8506 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
8507 # If a -bindir argument was supplied, place the dll there.
8508 if test "x$bindir" != x ;
8510 func_relative_path "$install_libdir" "$bindir"
8511 tdlname=$func_relative_path_result$dlname
8513 # Otherwise fall back on heuristic.
8514 tdlname=../bin/$dlname
8519 # $outputname - a libtool library file
8520 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
8522 # Please DO NOT delete this file!
8523 # It is necessary for linking the library.
8525 # The name that we can dlopen(3).
8528 # Names of this library.
8529 library_names='$library_names'
8531 # The name of the static archive.
8532 old_library='$old_library'
8534 # Linker flags that can not go in dependency_libs.
8535 inherited_linker_flags='$new_inherited_linker_flags'
8537 # Libraries that this one depends upon.
8538 dependency_libs='$dependency_libs'
8540 # Names of additional weak libraries provided by this library
8541 weak_library_names='$weak_libs'
8543 # Version information for $libname.
8548 # Is this an already installed library?
8549 installed=$installed
8551 # Should we warn about portability when linking against -modules?
8552 shouldnotlink=$module
8554 # Files to dlopen/dlpreopen
8556 dlpreopen='$dlprefiles'
8558 # Directory that this library needs to be installed in:
8559 libdir='$install_libdir'"
8560 if test "$installed" = no && test "$need_relink" = yes; then
8562 relink_command=\"$relink_command\""
8567 # Do a symbolic link so that the libtool archive can be found in
8568 # LD_LIBRARY_PATH before the program is installed.
8569 func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
8575 { test "$mode" = link || test "$mode" = relink; } &&
8576 func_mode_link ${1+"$@"}
8579 # func_mode_uninstall arg...
8580 func_mode_uninstall ()
8588 # This variable tells wrapper scripts just to set variables rather
8589 # than running their programs.
8590 libtool_install_magic="$magic"
8595 -f) RM="$RM $arg"; rmforce=yes ;;
8596 -*) RM="$RM $arg" ;;
8597 *) files="$files $arg" ;;
8602 func_fatal_help "you must specify an RM program"
8606 origobjdir="$objdir"
8607 for file in $files; do
8608 func_dirname "$file" "" "."
8609 dir="$func_dirname_result"
8610 if test "X$dir" = X.; then
8611 objdir="$origobjdir"
8613 objdir="$dir/$origobjdir"
8615 func_basename "$file"
8616 name="$func_basename_result"
8617 test "$mode" = uninstall && objdir="$dir"
8619 # Remember objdir for removal later, being careful to avoid duplicates
8620 if test "$mode" = clean; then
8623 *) rmdirs="$rmdirs $objdir" ;;
8627 # Don't error if the file doesn't exist and rm -f was used.
8628 if { test -L "$file"; } >/dev/null 2>&1 ||
8629 { test -h "$file"; } >/dev/null 2>&1 ||
8630 test -f "$file"; then
8632 elif test -d "$file"; then
8635 elif test "$rmforce" = yes; then
8643 # Possibly a libtool archive, so verify it.
8644 if func_lalib_p "$file"; then
8645 func_source $dir/$name
8647 # Delete the libtool libraries and symlinks.
8648 for n in $library_names; do
8649 rmfiles="$rmfiles $objdir/$n"
8651 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
8655 case " $library_names " in
8656 # " " in the beginning catches empty $dlname
8658 *) rmfiles="$rmfiles $objdir/$dlname" ;;
8660 test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
8663 if test -n "$library_names"; then
8664 # Do each command in the postuninstall commands.
8665 func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
8668 if test -n "$old_library"; then
8669 # Do each command in the old_postuninstall commands.
8670 func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
8672 # FIXME: should reinstall the best remaining shared library.
8679 # Possibly a libtool object, so verify it.
8680 if func_lalib_p "$file"; then
8683 func_source $dir/$name
8685 # Add PIC object to the list of files to remove.
8686 if test -n "$pic_object" &&
8687 test "$pic_object" != none; then
8688 rmfiles="$rmfiles $dir/$pic_object"
8691 # Add non-PIC object to the list of files to remove.
8692 if test -n "$non_pic_object" &&
8693 test "$non_pic_object" != none; then
8694 rmfiles="$rmfiles $dir/$non_pic_object"
8700 if test "$mode" = clean ; then
8704 func_stripname '' '.exe' "$file"
8705 file=$func_stripname_result
8706 func_stripname '' '.exe' "$name"
8707 noexename=$func_stripname_result
8708 # $file with .exe has already been added to rmfiles,
8709 # add $file without .exe
8710 rmfiles="$rmfiles $file"
8713 # Do a test to see if this is a libtool program.
8714 if func_ltwrapper_p "$file"; then
8715 if func_ltwrapper_executable_p "$file"; then
8716 func_ltwrapper_scriptname "$file"
8718 func_source $func_ltwrapper_scriptname_result
8719 rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
8722 func_source $dir/$noexename
8725 # note $name still contains .exe if it was in $file originally
8726 # as does the version of $file that was added into $rmfiles
8727 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
8728 if test "$fast_install" = yes && test -n "$relink_command"; then
8729 rmfiles="$rmfiles $objdir/lt-$name"
8731 if test "X$noexename" != "X$name" ; then
8732 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
8738 func_show_eval "$RM $rmfiles" 'exit_status=1'
8740 objdir="$origobjdir"
8742 # Try to remove the ${objdir}s in the directories where we deleted files
8743 for dir in $rmdirs; do
8744 if test -d "$dir"; then
8745 func_show_eval "rmdir $dir >/dev/null 2>&1"
8752 { test "$mode" = uninstall || test "$mode" = clean; } &&
8753 func_mode_uninstall ${1+"$@"}
8755 test -z "$mode" && {
8756 help="$generic_help"
8757 func_fatal_help "you must specify a MODE"
8760 test -z "$exec_cmd" && \
8761 func_fatal_help "invalid operation mode \`$mode'"
8763 if test -n "$exec_cmd"; then
8764 eval exec "$exec_cmd"
8771 # The TAGs below are defined such that we never get into a situation
8772 # in which we disable both kinds of libraries. Given conflicting
8773 # choices, we go for a static library, that is the most portable,
8774 # since we can't tell whether shared libraries were disabled because
8775 # the user asked for that or because the platform doesn't support
8776 # them. This is particularly important on AIX, because we don't
8777 # support having both static and shared libraries enabled at the same
8778 # time on that platform, so we default to a shared-only configuration.
8779 # If a disable-shared tag is given, we'll fallback to a static-only
8780 # configuration. But we'll never go from static-only to shared-only.
8782 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
8783 build_libtool_libs=no
8785 # ### END LIBTOOL TAG CONFIG: disable-shared
8787 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
8788 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
8789 # ### END LIBTOOL TAG CONFIG: disable-static