2 ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
3 ## by inline-source v2019-02-19.15
5 # libtool (GNU libtool) 2.4.7
6 # Provide generalized library-building support services.
7 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
9 # Copyright (C) 1996-2019, 2021-2022 Free Software Foundation, Inc.
10 # This is free software; see the source for copying conditions. There is NO
11 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 # GNU Libtool is free software; you can redistribute it and/or modify
14 # it under the terms of the GNU General Public License as published by
15 # the Free Software Foundation; either version 2 of the License, or
16 # (at your option) any later version.
18 # As a special exception to the GNU General Public License,
19 # if you distribute this file as part of a program or library that
20 # is built using GNU Libtool, you may include this file under the
21 # same distribution terms that you use for the rest of that program.
23 # GNU Libtool is distributed in the hope that it will be useful, but
24 # WITHOUT ANY WARRANTY; without even the implied warranty of
25 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
26 # General Public License for more details.
28 # You should have received a copy of the GNU General Public License
29 # along with this program. If not, see <http://www.gnu.org/licenses/>.
35 package_revision=2.4.7
42 # Run './libtool --help' for help with using this script from the
46 ## ------------------------------- ##
47 ## User overridable command paths. ##
48 ## ------------------------------- ##
50 # After configure completes, it has a better idea of some of the
51 # shell tools we need than the defaults used by the functions shared
52 # with bootstrap, so set those here where they can still be over-
53 # ridden by the user, but otherwise take precedence.
55 : ${AUTOCONF="autoconf"}
56 : ${AUTOMAKE="automake"}
59 ## -------------------------- ##
60 ## Source external libraries. ##
61 ## -------------------------- ##
63 # Much of our low-level functionality needs to be sourced from external
64 # libraries, which are installed to $pkgauxdir.
66 # Set a version string for this script.
67 scriptversion=2019-02-19.15; # UTC
69 # General shell script boiler plate, and helper functions.
70 # Written by Gary V. Vaughan, 2004
72 # This is free software. There is NO warranty; not even for
73 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
75 # Copyright (C) 2004-2019, 2021 Bootstrap Authors
77 # This file is dual licensed under the terms of the MIT license
78 # <https://opensource.org/license/MIT>, and GPL version 2 or later
79 # <http://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of
80 # these licenses when using or redistributing this software or any of
81 # the files within it. See the URLs above, or the file `LICENSE`
82 # included in the Bootstrap distribution for the full license texts.
84 # Please report bugs or propose patches to:
85 # <https://github.com/gnulib-modules/bootstrap/issues>
92 # Evaluate this file near the top of your script to gain access to
93 # the functions and variables defined here:
95 # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
97 # If you need to override any of the default environment variable
98 # settings, do that before evaluating this file.
101 ## -------------------- ##
102 ## Shell normalisation. ##
103 ## -------------------- ##
105 # Some shells need a little help to be as Bourne compatible as possible.
106 # Before doing anything else, make sure all that help has been provided!
108 DUALCASE=1; export DUALCASE # for MKS sh
109 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
112 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
113 # is contrary to our usage. Disable this feature.
114 alias -g '${1+"$@"}'='"$@"'
117 case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
120 # NLS nuisances: We save the old values in case they are required later.
123 for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
125 eval "if test set = \"\${$_G_var+set}\"; then
126 save_$_G_var=\$$_G_var
129 _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
130 _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
133 # These NLS vars are set unconditionally (bootstrap issue #24). Unset those
134 # in case the environment reset is needed later and the $save_* variant is not
135 # defined (see the code above).
138 export LANGUAGE LC_ALL
140 # Make sure IFS has a sensible default
146 # There are apparently some retarded systems that use ';' as a PATH separator!
147 if test "${PATH_SEPARATOR+set}" != set; then
149 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
150 (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
158 # Portably unset VAR.
159 # In some shells, an 'unset VAR' statement leaves a non-zero return
160 # status if VAR is already unset, which might be problematic if the
161 # statement is used at the end of a function (thus poisoning its return
162 # value) or when 'set -e' is active (causing even a spurious abort of
163 # the script in this case).
166 { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; }
170 # Make sure CDPATH doesn't cause `cd` commands to output the target dir.
173 # Make sure ${,E,F}GREP behave sanely.
174 func_unset GREP_OPTIONS
177 ## ------------------------- ##
178 ## Locate command utilities. ##
179 ## ------------------------- ##
182 # func_executable_p FILE
183 # ----------------------
184 # Check that FILE is an executable regular file.
187 test -f "$1" && test -x "$1"
191 # func_path_progs PROGS_LIST CHECK_FUNC [PATH]
192 # --------------------------------------------
193 # Search for either a program that responds to --version with output
194 # containing "GNU", or else returned by CHECK_FUNC otherwise, by
195 # trying all the directories in PATH with each of the elements of
198 # CHECK_FUNC should accept the path to a candidate program, and
199 # set $func_check_prog_result if it truncates its output less than
200 # $_G_path_prog_max characters.
208 _G_path_prog_found=false
209 _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}
210 for _G_dir in $_G_PATH; do
212 test -z "$_G_dir" && _G_dir=.
213 for _G_prog_name in $_G_progs_list; do
214 for _exeext in '' .EXE; do
215 _G_path_prog=$_G_dir/$_G_prog_name$_exeext
216 func_executable_p "$_G_path_prog" || continue
217 case `"$_G_path_prog" --version 2>&1` in
218 *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;
219 *) $_G_check_func $_G_path_prog
220 func_path_progs_result=$func_check_prog_result
223 $_G_path_prog_found && break 3
228 test -z "$func_path_progs_result" && {
229 echo "no acceptable sed could be found in \$PATH" >&2
235 # We want to be able to use the functions in this file before configure
236 # has figured out where the best binaries are kept, which means we have
237 # to search for them ourselves - except when the results are already set
238 # where we skip the searches.
240 # Unless the user overrides by setting SED, search the path for either GNU
241 # sed, or the sed that truncates its output the least.
243 _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
244 for _G_i in 1 2 3 4 5 6 7; do
245 _G_sed_script=$_G_sed_script$nl$_G_sed_script
247 echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed
250 func_check_prog_sed ()
255 printf 0123456789 >conftest.in
258 cat conftest.in conftest.in >conftest.tmp
259 mv conftest.tmp conftest.in
260 cp conftest.in conftest.nl
261 echo '' >> conftest.nl
262 "$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
263 diff conftest.out conftest.nl >/dev/null 2>&1 || break
264 _G_count=`expr $_G_count + 1`
265 if test "$_G_count" -gt "$_G_path_prog_max"; then
266 # Best one so far, save it but keep looking for a better one
267 func_check_prog_result=$_G_path_prog
268 _G_path_prog_max=$_G_count
270 # 10*(2^10) chars as input seems more than enough
271 test 10 -lt "$_G_count" && break
273 rm -f conftest.in conftest.tmp conftest.nl conftest.out
276 func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin"
278 SED=$func_path_progs_result
282 # Unless the user overrides by setting GREP, search the path for either GNU
283 # grep, or the grep that truncates its output the least.
285 func_check_prog_grep ()
291 printf 0123456789 >conftest.in
294 cat conftest.in conftest.in >conftest.tmp
295 mv conftest.tmp conftest.in
296 cp conftest.in conftest.nl
297 echo 'GREP' >> conftest.nl
298 "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break
299 diff conftest.out conftest.nl >/dev/null 2>&1 || break
300 _G_count=`expr $_G_count + 1`
301 if test "$_G_count" -gt "$_G_path_prog_max"; then
302 # Best one so far, save it but keep looking for a better one
303 func_check_prog_result=$_G_path_prog
304 _G_path_prog_max=$_G_count
306 # 10*(2^10) chars as input seems more than enough
307 test 10 -lt "$_G_count" && break
309 rm -f conftest.in conftest.tmp conftest.nl conftest.out
312 func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin"
313 GREP=$func_path_progs_result
317 ## ------------------------------- ##
318 ## User overridable command paths. ##
319 ## ------------------------------- ##
321 # All uppercase variable names are used for environment variables. These
322 # variables can be overridden by the user before calling a script that
323 # uses them if a suitable command of that name is not already available
324 # in the command search PATH.
327 : ${ECHO="printf %s\n"}
328 : ${EGREP="$GREP -E"}
329 : ${FGREP="$GREP -F"}
335 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
338 ## -------------------- ##
339 ## Useful sed snippets. ##
340 ## -------------------- ##
342 sed_dirname='s|/[^/]*$||'
343 sed_basename='s|^.*/||'
345 # Sed substitution that helps us do robust quoting. It backslashifies
346 # metacharacters that are still active within double-quoted strings.
347 sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
349 # Same as above, but do not quote variable references.
350 sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
352 # Sed substitution that turns a string into a regex matching for the
354 sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
356 # Sed substitution that converts a w32 file name or path
357 # that contains forward slashes, into one that contains
358 # (escaped) backslashes. A very naive implementation.
359 sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
361 # Re-'\' parameter expansions in output of sed_double_quote_subst that
362 # were '\'-ed in input to the same. If an odd number of '\' preceded a
363 # '$' in input to sed_double_quote_subst, that '$' was protected from
364 # expansion. Since each input '\' is now two '\'s, look for any number
365 # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'.
370 sed_double_backslash="\
373 s/^$_G_bs2$_G_dollar/$_G_bs&/
374 s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
377 # require_check_ifs_backslash
378 # ---------------------------
379 # Check if we can use backslash as IFS='\' separator, and set
380 # $check_ifs_backshlash_broken to ':' or 'false'.
381 require_check_ifs_backslash=func_require_check_ifs_backslash
382 func_require_check_ifs_backslash ()
386 _G_check_ifs_backshlash='a\\b'
387 for _G_i in $_G_check_ifs_backshlash
391 check_ifs_backshlash_broken=false
397 check_ifs_backshlash_broken=:
403 require_check_ifs_backslash=:
407 ## ----------------- ##
408 ## Global variables. ##
409 ## ----------------- ##
411 # Except for the global variables explicitly listed below, the following
412 # functions in the '^func_' namespace, and the '^require_' namespace
413 # variables initialised in the 'Resource management' section, sourcing
414 # this file will not pollute your global namespace with anything
415 # else. There's no portable way to scope variables in Bourne shell
416 # though, so actually running these functions will sometimes place
417 # results into a variable named after the function, and often use
418 # temporary variables in the '^_G_' namespace. If you are careful to
419 # avoid using those namespaces casually in your sourcing script, things
420 # should continue to work as you expect. And, of course, you can freely
421 # overwrite any of the functions or variables defined here before
422 # calling anything to customize them.
426 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
427 EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
429 # Allow overriding, eg assuming that you follow the convention of
430 # putting '$debug_cmd' at the start of all your functions, you can get
431 # bash to show function call trace with:
433 # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
434 debug_cmd=${debug_cmd-":"}
437 # By convention, finish your script with:
441 # so that you can set exit_status to non-zero if you want to indicate
442 # something went wrong during execution without actually bailing out at
443 # the point of failure.
444 exit_status=$EXIT_SUCCESS
446 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
447 # is ksh but when the shell is invoked as "sh" and the current value of
448 # the _XPG environment variable is not equal to 1 (one), the special
449 # positional parameter $0, within a function call, is the name of the
453 # The name of this program.
454 progname=`$ECHO "$progpath" |$SED "$sed_basename"`
456 # Make sure we have an absolute progpath for reexecution:
458 [\\/]*|[A-Za-z]:\\*) ;;
460 progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`
461 progdir=`cd "$progdir" && pwd`
462 progpath=$progdir/$progname
466 IFS=${PATH_SEPARATOR-:}
467 for progdir in $PATH; do
469 test -x "$progdir/$progname" && break
472 test -n "$progdir" || progdir=`pwd`
473 progpath=$progdir/$progname
478 ## ----------------- ##
479 ## Standard options. ##
480 ## ----------------- ##
482 # The following options affect the operation of the functions defined
483 # below, and should be set appropriately depending on run-time para-
484 # meters passed on the command line.
490 # Categories 'all' and 'none' are always available. Append any others
491 # you will pass as the first argument to func_warning from your own
495 # By default, display warnings according to 'opt_warning_types'. Set
496 # 'warning_func' to ':' to elide all warnings, or func_fatal_error to
497 # treat the next displayed warning as a fatal error.
498 warning_func=func_warn_and_continue
500 # Set to 'all' to display all warnings, 'none' to suppress all
501 # warnings, or a space delimited list of some subset of
502 # 'warning_categories' to display only the listed warnings.
503 opt_warning_types=all
506 ## -------------------- ##
507 ## Resource management. ##
508 ## -------------------- ##
510 # This section contains definitions for functions that each ensure a
511 # particular resource (a file, or a non-empty configuration variable for
512 # example) is available, and if appropriate to extract default values
513 # from pertinent package files. Call them using their associated
514 # 'require_*' variable to ensure that they are executed, at most, once.
516 # It's entirely deliberate that calling these functions can set
517 # variables that don't obey the namespace limitations obeyed by the rest
518 # of this file, in order that that they be as useful as possible to
522 # require_term_colors
523 # -------------------
524 # Allow display of bold text on terminals that support it.
525 require_term_colors=func_require_term_colors
526 func_require_term_colors ()
531 # COLORTERM and USE_ANSI_COLORS environment variables take
532 # precedence, because most terminfo databases neglect to describe
533 # whether color sequences are supported.
534 test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
536 if test 1 = "$USE_ANSI_COLORS"; then
537 # Standard ANSI escape sequences
539 tc_bold='
\e[1m'; tc_standout='
\e[7m'
540 tc_red='
\e[31m'; tc_green='
\e[32m'
541 tc_blue='
\e[34m'; tc_cyan='
\e[36m'
543 # Otherwise trust the terminfo database after all.
544 test -n "`tput sgr0 2>/dev/null`" && {
546 test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
548 test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
549 test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
550 test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
551 test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
552 test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
557 require_term_colors=:
561 ## ----------------- ##
562 ## Function library. ##
563 ## ----------------- ##
565 # This section contains a variety of useful functions to call in your
566 # scripts. Take note of the portable wrappers for features provided by
567 # some modern shells, which will fall back to slower equivalents on
568 # less featureful shells.
571 # func_append VAR VALUE
572 # ---------------------
573 # Append VALUE onto the existing contents of VAR.
575 # We should try to minimise forks, especially on Windows where they are
576 # unreasonably slow, so skip the feature probes when bash or zsh are
578 if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
579 : ${_G_HAVE_ARITH_OP="yes"}
580 : ${_G_HAVE_XSI_OPS="yes"}
581 # The += operator was introduced in bash 3.1
582 case $BASH_VERSION in
583 [12].* | 3.0 | 3.0*) ;;
585 : ${_G_HAVE_PLUSEQ_OP="yes"}
591 # Can be empty, in which case the shell is probed, "yes" if += is
592 # useable or anything else if it does not work.
593 test -z "$_G_HAVE_PLUSEQ_OP" \
594 && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
595 && _G_HAVE_PLUSEQ_OP=yes
597 if test yes = "$_G_HAVE_PLUSEQ_OP"
599 # This is an XSI compatible shell, allowing a faster implementation...
607 # ...otherwise fall back to using expr, which is often a shell builtin.
617 # func_append_quoted VAR VALUE
618 # ----------------------------
619 # Quote VALUE and append to the end of shell variable VAR, separated
621 if test yes = "$_G_HAVE_PLUSEQ_OP"; then
622 eval 'func_append_quoted ()
626 func_quote_arg pretty "$2"
627 eval "$1+=\\ \$func_quote_arg_result"
630 func_append_quoted ()
634 func_quote_arg pretty "$2"
635 eval "$1=\$$1\\ \$func_quote_arg_result"
640 # func_append_uniq VAR VALUE
641 # --------------------------
642 # Append unique VALUE onto the existing contents of VAR, assuming
643 # entries are delimited by the first character of VALUE. For example:
645 # func_append_uniq options " --another-option option-argument"
647 # will only append to $options if " --another-option option-argument "
648 # is not already present somewhere in $options already (note spaces at
649 # each end implied by leading space in second argument).
654 eval _G_current_value='`$ECHO $'$1'`'
655 _G_delim=`expr "$2" : '\(.\)'`
657 case $_G_delim$_G_current_value$_G_delim in
659 *) func_append "$@" ;;
666 # Set func_arith_result to the result of evaluating TERMs.
667 test -z "$_G_HAVE_ARITH_OP" \
668 && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
669 && _G_HAVE_ARITH_OP=yes
671 if test yes = "$_G_HAVE_ARITH_OP"; then
676 func_arith_result=$(( $* ))
683 func_arith_result=`expr "$@"`
690 # Set func_basename_result to FILE with everything up to and including
691 # the last / stripped.
692 if test yes = "$_G_HAVE_XSI_OPS"; then
693 # If this shell supports suffix pattern removal, then use it to avoid
694 # forking. Hide the definitions single quotes in case the shell chokes
695 # on unsupported syntax...
696 _b='func_basename_result=${1##*/}'
698 */*) func_dirname_result=${1%/*}$2 ;;
699 * ) func_dirname_result=$3 ;;
703 # ...otherwise fall back to using sed.
704 _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
705 _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"`
706 if test "X$func_dirname_result" = "X$1"; then
707 func_dirname_result=$3
709 func_append func_dirname_result "$2"
713 eval 'func_basename ()
721 # func_dirname FILE APPEND NONDIR_REPLACEMENT
722 # -------------------------------------------
723 # Compute the dirname of FILE. If nonempty, add APPEND to the result,
724 # otherwise set result to NONDIR_REPLACEMENT.
725 eval 'func_dirname ()
733 # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT
734 # --------------------------------------------------------
735 # Perform func_basename and func_dirname in a single function
737 # dirname: Compute the dirname of FILE. If nonempty,
738 # add APPEND to the result, otherwise set result
739 # to NONDIR_REPLACEMENT.
740 # value returned in "$func_dirname_result"
741 # basename: Compute filename of FILE.
742 # value retuned in "$func_basename_result"
743 # For efficiency, we do not delegate to the functions above but instead
744 # duplicate the functionality here.
745 eval 'func_dirname_and_basename ()
756 # Echo program name prefixed message.
765 for _G_line in $_G_message; do
767 $ECHO "$progname: $_G_line"
773 # func_echo_all ARG...
774 # --------------------
775 # Invoke $ECHO with all args, space-separated.
782 # func_echo_infix_1 INFIX ARG...
783 # ------------------------------
784 # Echo program name, followed by INFIX on the first line, with any
785 # additional lines not showing INFIX.
794 _G_prefix="$progname: $_G_infix: "
797 # Strip color escape sequences before counting printable length
798 for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
800 test -n "$_G_tc" && {
801 _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`
802 _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`
805 _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes
807 func_echo_infix_1_IFS=$IFS
809 for _G_line in $_G_message; do
810 IFS=$func_echo_infix_1_IFS
811 $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
814 IFS=$func_echo_infix_1_IFS
820 # Echo program name prefixed message to standard error.
827 func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2
831 # func_fatal_error ARG...
832 # -----------------------
833 # Echo program name prefixed message to standard error, and exit.
843 # func_grep EXPRESSION FILENAME
844 # -----------------------------
845 # Check whether EXPRESSION matches any line of FILENAME, without output.
850 $GREP "$1" "$2" >/dev/null 2>&1
856 # Set func_len_result to the length of STRING. STRING may not
857 # start with a hyphen.
858 test -z "$_G_HAVE_XSI_OPS" \
860 test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
861 && _G_HAVE_XSI_OPS=yes
863 if test yes = "$_G_HAVE_XSI_OPS"; then
868 func_len_result=${#1}
875 func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
880 # func_mkdir_p DIRECTORY-PATH
881 # ---------------------------
882 # Make sure the entire path to DIRECTORY-PATH is available.
890 if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
892 # Protect directory names starting with '-'
893 case $_G_directory_path in
894 -*) _G_directory_path=./$_G_directory_path ;;
897 # While some portion of DIR does not yet exist...
898 while test ! -d "$_G_directory_path"; do
899 # ...make a list in topmost first order. Use a colon delimited
900 # list incase some portion of path contains whitespace.
901 _G_dir_list=$_G_directory_path:$_G_dir_list
903 # If the last portion added has no slash in it, the list is done
904 case $_G_directory_path in */*) ;; *) break ;; esac
906 # ...otherwise throw away the child directory and loop
907 _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
909 _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
911 func_mkdir_p_IFS=$IFS; IFS=:
912 for _G_dir in $_G_dir_list; do
913 IFS=$func_mkdir_p_IFS
914 # mkdir can fail with a 'File exist' error if two processes
915 # try to create one of the directories concurrently. Don't
917 $MKDIR "$_G_dir" 2>/dev/null || :
919 IFS=$func_mkdir_p_IFS
921 # Bail out if we (or some other process) failed to create a directory.
922 test -d "$_G_directory_path" || \
923 func_fatal_error "Failed to create '$1'"
928 # func_mktempdir [BASENAME]
929 # -------------------------
930 # Make a temporary directory that won't clash with other running
931 # libtool processes, and avoids race conditions if possible. If
932 # given, BASENAME is the basename for that directory.
937 _G_template=${TMPDIR-/tmp}/${1-$progname}
939 if test : = "$opt_dry_run"; then
940 # Return a directory name, but don't create it in dry-run mode
941 _G_tmpdir=$_G_template-$$
944 # If mktemp works, use that first and foremost
945 _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
947 if test ! -d "$_G_tmpdir"; then
948 # Failing that, at least try and use $RANDOM to avoid a race
949 _G_tmpdir=$_G_template-${RANDOM-0}$$
951 func_mktempdir_umask=`umask`
954 umask $func_mktempdir_umask
957 # If we're not in dry-run mode, bomb out on failure
958 test -d "$_G_tmpdir" || \
959 func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
966 # func_normal_abspath PATH
967 # ------------------------
968 # Remove doubled-up and trailing slashes, "." path components,
969 # and cancel out any ".." path components in PATH after making
970 # it an absolute path.
971 func_normal_abspath ()
975 # These SED scripts presuppose an absolute path with a trailing slash.
976 _G_pathcar='s|^/\([^/]*\).*$|\1|'
977 _G_pathcdr='s|^/[^/]*||'
978 _G_removedotparts=':dotsl
982 _G_collapseslashes='s|/\{1,\}|/|g'
983 _G_finalslash='s|/*$|/|'
985 # Start from root dir and reassemble the path.
986 func_normal_abspath_result=
987 func_normal_abspath_tpath=$1
988 func_normal_abspath_altnamespace=
989 case $func_normal_abspath_tpath in
991 # Empty path, that just means $cwd.
992 func_stripname '' '/' "`pwd`"
993 func_normal_abspath_result=$func_stripname_result
996 # The next three entries are used to spot a run of precisely
997 # two leading slashes without using negated character classes;
998 # we take advantage of case's first-match behaviour.
1000 # Unusual form of absolute path, do nothing.
1003 # Not necessarily an ordinary path; POSIX reserves leading '//'
1004 # and for example Cygwin uses it to access remote file shares
1005 # over CIFS/SMB, so we conserve a leading double slash if found.
1006 func_normal_abspath_altnamespace=/
1009 # Absolute path, do nothing.
1012 # Relative path, prepend $cwd.
1013 func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
1017 # Cancel out all the simple stuff to save iterations. We also want
1018 # the path to end with a slash for ease of parsing, so make sure
1019 # there is one (and only one) here.
1020 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
1021 -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
1023 # Processed it all yet?
1024 if test / = "$func_normal_abspath_tpath"; then
1025 # If we ascended to the root using ".." the result may be empty now.
1026 if test -z "$func_normal_abspath_result"; then
1027 func_normal_abspath_result=/
1031 func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
1033 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
1035 # Figure out what to do with it
1036 case $func_normal_abspath_tcomponent in
1038 # Trailing empty path component, ignore it.
1041 # Parent dir; strip last assembled component from result.
1042 func_dirname "$func_normal_abspath_result"
1043 func_normal_abspath_result=$func_dirname_result
1046 # Actual path component, append it.
1047 func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
1051 # Restore leading double-slash if one was found on entry.
1052 func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
1056 # func_notquiet ARG...
1057 # --------------------
1058 # Echo program name prefixed message only when not in quiet mode.
1063 $opt_quiet || func_echo ${1+"$@"}
1065 # A bug in bash halts the script if the last line of a function
1066 # fails when set -e is in force, so we need another command to
1072 # func_relative_path SRCDIR DSTDIR
1073 # --------------------------------
1074 # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
1075 func_relative_path ()
1079 func_relative_path_result=
1080 func_normal_abspath "$1"
1081 func_relative_path_tlibdir=$func_normal_abspath_result
1082 func_normal_abspath "$2"
1083 func_relative_path_tbindir=$func_normal_abspath_result
1085 # Ascend the tree starting from libdir
1087 # check if we have found a prefix of bindir
1088 case $func_relative_path_tbindir in
1089 $func_relative_path_tlibdir)
1090 # found an exact match
1091 func_relative_path_tcancelled=
1094 $func_relative_path_tlibdir*)
1095 # found a matching prefix
1096 func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
1097 func_relative_path_tcancelled=$func_stripname_result
1098 if test -z "$func_relative_path_result"; then
1099 func_relative_path_result=.
1104 func_dirname $func_relative_path_tlibdir
1105 func_relative_path_tlibdir=$func_dirname_result
1106 if test -z "$func_relative_path_tlibdir"; then
1107 # Have to descend all the way to the root!
1108 func_relative_path_result=../$func_relative_path_result
1109 func_relative_path_tcancelled=$func_relative_path_tbindir
1112 func_relative_path_result=../$func_relative_path_result
1117 # Now calculate path; take care to avoid doubling-up slashes.
1118 func_stripname '' '/' "$func_relative_path_result"
1119 func_relative_path_result=$func_stripname_result
1120 func_stripname '/' '/' "$func_relative_path_tcancelled"
1121 if test -n "$func_stripname_result"; then
1122 func_append func_relative_path_result "/$func_stripname_result"
1125 # Normalisation. If bindir is libdir, return '.' else relative path.
1126 if test -n "$func_relative_path_result"; then
1127 func_stripname './' '' "$func_relative_path_result"
1128 func_relative_path_result=$func_stripname_result
1131 test -n "$func_relative_path_result" || func_relative_path_result=.
1137 # func_quote_portable EVAL ARG
1138 # ----------------------------
1139 # Internal function to portably implement func_quote_arg. Note that we still
1140 # keep attention to performance here so we as much as possible try to avoid
1141 # calling sed binary (so far O(N) complexity as long as func_append is O(1)).
1142 func_quote_portable ()
1146 $require_check_ifs_backslash
1148 func_quote_portable_result=$2
1150 # one-time-loop (easy break)
1154 func_quote_portable_result=`$ECHO "$2" | $SED \
1155 -e "$sed_double_quote_subst" -e "$sed_double_backslash"`
1160 case $func_quote_portable_result in
1162 # Fallback to sed for $func_check_bs_ifs_broken=:, or when the string
1163 # contains the shell wildcard characters.
1164 case $check_ifs_backshlash_broken$func_quote_portable_result in
1166 func_quote_portable_result=`$ECHO "$func_quote_portable_result" \
1167 | $SED "$sed_quote_subst"`
1172 func_quote_portable_old_IFS=$IFS
1173 for _G_char in '\' '`' '"' '$'
1175 # STATE($1) PREV($2) SEPARATOR($3)
1177 func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy
1179 for _G_part in $func_quote_portable_result
1183 func_append func_quote_portable_result "$3$2"
1184 set quote "$_G_part" "\\$_G_char"
1188 func_quote_portable_result=
1191 set quote "$_G_part" ""
1196 IFS=$func_quote_portable_old_IFS
1203 func_quote_portable_unquoted_result=$func_quote_portable_result
1204 case $func_quote_portable_result in
1205 # double-quote args containing shell metacharacters to delay
1206 # word splitting, command substitution and variable expansion
1207 # for a subsequent eval.
1208 # many bourne shells cannot handle close brackets correctly
1209 # in scan sets, so we specify it separately.
1210 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1211 func_quote_portable_result=\"$func_quote_portable_result\"
1217 # func_quotefast_eval ARG
1218 # -----------------------
1219 # Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG',
1220 # but optimized for speed. Result is stored in $func_quotefast_eval.
1221 if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then
1222 printf -v _GL_test_printf_tilde %q '~'
1223 if test '\~' = "$_GL_test_printf_tilde"; then
1224 func_quotefast_eval ()
1226 printf -v func_quotefast_eval_result %q "$1"
1229 # Broken older Bash implementations. Make those faster too if possible.
1230 func_quotefast_eval ()
1234 func_quote_portable false "$1"
1235 func_quotefast_eval_result=$func_quote_portable_result
1238 printf -v func_quotefast_eval_result %q "$1"
1244 func_quotefast_eval ()
1246 func_quote_portable false "$1"
1247 func_quotefast_eval_result=$func_quote_portable_result
1252 # func_quote_arg MODEs ARG
1253 # ------------------------
1254 # Quote one ARG to be evaled later. MODEs argument may contain zero or more
1255 # specifiers listed below separated by ',' character. This function returns two
1257 # i) func_quote_arg_result
1258 # double-quoted (when needed), suitable for a subsequent eval
1259 # ii) func_quote_arg_unquoted_result
1260 # has all characters that are still active within double
1261 # quotes backslashified. Available only if 'unquoted' is specified.
1266 # - escape shell special characters
1268 # - the same as 'eval'; but do not quote variable references
1270 # - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might
1271 # be used later in func_quote to get output like: 'echo "a b"' instead
1272 # of 'echo a\ b'. This is slower than default on some shells.
1274 # - produce also $func_quote_arg_unquoted_result which does not contain
1275 # wrapping double-quotes.
1277 # Examples for 'func_quote_arg pretty,unquoted string':
1279 # string | *_result | *_unquoted_result
1280 # ------------+-----------------------+-------------------
1283 # "a b" | "\"a b\"" | \"a b\"
1285 # z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\"
1287 # Examples for 'func_quote_arg pretty,unquoted,expand string':
1289 # string | *_result | *_unquoted_result
1290 # --------------+---------------------+--------------------
1291 # z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\"
1294 _G_quote_expand=false
1302 *,pretty,*|*,expand,*|*,unquoted,*)
1303 func_quote_portable $_G_quote_expand "$2"
1304 func_quote_arg_result=$func_quote_portable_result
1305 func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result
1308 # Faster quote-for-eval for some shells.
1309 func_quotefast_eval "$2"
1310 func_quote_arg_result=$func_quotefast_eval_result
1316 # func_quote MODEs ARGs...
1317 # ------------------------
1318 # Quote all ARGs to be evaled later and join them into single command. See
1319 # func_quote_arg's description for more info.
1323 _G_func_quote_mode=$1 ; shift
1325 while test 0 -lt $#; do
1326 func_quote_arg "$_G_func_quote_mode" "$1"
1327 if test -n "$func_quote_result"; then
1328 func_append func_quote_result " $func_quote_arg_result"
1330 func_append func_quote_result "$func_quote_arg_result"
1337 # func_stripname PREFIX SUFFIX NAME
1338 # ---------------------------------
1339 # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
1340 # PREFIX and SUFFIX must not contain globbing or regex special
1341 # characters, hashes, percent signs, but SUFFIX may contain a leading
1342 # dot (in which case that matches only a dot).
1343 if test yes = "$_G_HAVE_XSI_OPS"; then
1344 eval 'func_stripname ()
1348 # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
1349 # positional parameters, so assign one to ordinary variable first.
1350 func_stripname_result=$3
1351 func_stripname_result=${func_stripname_result#"$1"}
1352 func_stripname_result=${func_stripname_result%"$2"}
1360 .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
1361 *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
1367 # func_show_eval CMD [FAIL_EXP]
1368 # -----------------------------
1369 # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
1370 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
1371 # is given, then evaluate it.
1377 _G_fail_exp=${2-':'}
1379 func_quote_arg pretty,expand "$_G_cmd"
1380 eval "func_notquiet $func_quote_arg_result"
1385 if test 0 -ne "$_G_status"; then
1386 eval "(exit $_G_status); $_G_fail_exp"
1392 # func_show_eval_locale CMD [FAIL_EXP]
1393 # ------------------------------------
1394 # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
1395 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
1396 # is given, then evaluate it. Use the saved locale for evaluation.
1397 func_show_eval_locale ()
1402 _G_fail_exp=${2-':'}
1405 func_quote_arg expand,pretty "$_G_cmd"
1406 eval "func_echo $func_quote_arg_result"
1410 eval "$_G_user_locale
1413 eval "$_G_safe_locale"
1414 if test 0 -ne "$_G_status"; then
1415 eval "(exit $_G_status); $_G_fail_exp"
1423 # Turn $1 into a string suitable for a shell variable name.
1424 # Result is stored in $func_tr_sh_result. All characters
1425 # not in the set a-zA-Z0-9_ are replaced with '_'. Further,
1426 # if $1 begins with a digit, a '_' is prepended as well.
1432 [0-9]* | *[!a-zA-Z0-9_]*)
1433 func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
1436 func_tr_sh_result=$1
1442 # func_verbose ARG...
1443 # -------------------
1444 # Echo program name prefixed message in verbose mode only.
1449 $opt_verbose && func_echo "$*"
1455 # func_warn_and_continue ARG...
1456 # -----------------------------
1457 # Echo program name prefixed warning message to standard error.
1458 func_warn_and_continue ()
1462 $require_term_colors
1464 func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
1468 # func_warning CATEGORY ARG...
1469 # ----------------------------
1470 # Echo program name prefixed warning message to standard error. Warning
1471 # messages can be filtered according to CATEGORY, where this function
1472 # elides messages where CATEGORY is not listed in the global variable
1473 # 'opt_warning_types'.
1478 # CATEGORY must be in the warning_categories list!
1479 case " $warning_categories " in
1481 *) func_internal_error "invalid warning category '$1'" ;;
1487 case " $opt_warning_types " in
1488 *" $_G_category "*) $warning_func ${1+"$@"} ;;
1493 # func_sort_ver VER1 VER2
1494 # -----------------------
1495 # 'sort -V' is not generally available.
1496 # Note this deviates from the version comparison in automake
1497 # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
1498 # but this should suffice as we won't be specifying old
1499 # version formats or redundant trailing .0 in bootstrap.conf.
1500 # If we did want full compatibility then we should probably
1501 # use m4_version_compare from autoconf.
1506 printf '%s\n%s\n' "$1" "$2" \
1507 | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n
1510 # func_lt_ver PREV CURR
1511 # ---------------------
1512 # Return true if PREV and CURR are in the correct order according to
1513 # func_sort_ver, otherwise false. Use it like this:
1515 # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."
1520 test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`
1525 # mode: shell-script
1527 # eval: (add-hook 'before-save-hook 'time-stamp)
1528 # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
1529 # time-stamp-time-zone: "UTC"
1533 # A portable, pluggable option parser for Bourne shell.
1534 # Written by Gary V. Vaughan, 2010
1536 # This is free software. There is NO warranty; not even for
1537 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1539 # Copyright (C) 2010-2019, 2021 Bootstrap Authors
1541 # This file is dual licensed under the terms of the MIT license
1542 # <https://opensource.org/license/MIT>, and GPL version 2 or later
1543 # <http://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of
1544 # these licenses when using or redistributing this software or any of
1545 # the files within it. See the URLs above, or the file `LICENSE`
1546 # included in the Bootstrap distribution for the full license texts.
1548 # Please report bugs or propose patches to:
1549 # <https://github.com/gnulib-modules/bootstrap/issues>
1551 # Set a version string for this script.
1552 scriptversion=2019-02-19.15; # UTC
1559 # This file is a library for parsing options in your shell scripts along
1560 # with assorted other useful supporting features that you can make use
1563 # For the simplest scripts you might need only:
1566 # . relative/path/to/funclib.sh
1567 # . relative/path/to/options-parser
1569 # func_options ${1+"$@"}
1570 # eval set dummy "$func_options_result"; shift
1571 # ...rest of your script...
1573 # In order for the '--version' option to work, you will need to have a
1574 # suitably formatted comment like the one at the top of this file
1575 # starting with '# Written by ' and ending with '# Copyright'.
1577 # For '-h' and '--help' to work, you will also need a one line
1578 # description of your script's purpose in a comment directly above the
1579 # '# Written by ' line, like the one at the top of this file.
1581 # The default options also support '--debug', which will turn on shell
1582 # execution tracing (see the comment above debug_cmd below for another
1583 # use), and '--verbose' and the func_verbose function to allow your script
1584 # to display verbose messages only when your user has specified
1587 # After sourcing this file, you can plug in processing for additional
1588 # options by amending the variables from the 'Configuration' section
1589 # below, and following the instructions in the 'Option parsing'
1590 # section further down.
1592 ## -------------- ##
1593 ## Configuration. ##
1594 ## -------------- ##
1596 # You should override these variables in your script after sourcing this
1597 # file so that they reflect the customisations you have added to the
1600 # The usage line for option parsing errors and the start of '-h' and
1601 # '--help' output messages. You can embed shell variables for delayed
1602 # expansion at the time the message is displayed, but you will need to
1603 # quote other shell meta-characters carefully to prevent them being
1604 # expanded when the contents are evaled.
1605 usage='$progpath [OPTION]...'
1607 # Short help message in response to '-h' and '--help'. Add to this or
1608 # override it after sourcing this library to reflect the full set of
1609 # options your script accepts.
1611 --debug enable verbose shell tracing
1612 -W, --warnings=CATEGORY
1613 report the warnings falling in CATEGORY [all]
1614 -v, --verbose verbosely report processing
1615 --version print version information and exit
1616 -h, --help print short or long help message and exit
1619 # Additional text appended to 'usage_message' in response to '--help'.
1621 Warning categories include:
1622 'all' show all warnings
1623 'none' turn off all the warnings
1624 'error' warnings are treated as fatal errors"
1626 # Help message printed before fatal option parsing errors.
1627 fatal_help="Try '\$progname --help' for more information."
1631 ## ------------------------- ##
1632 ## Hook function management. ##
1633 ## ------------------------- ##
1635 # This section contains functions for adding, removing, and running hooks
1636 # in the main code. A hook is just a list of function names that can be
1637 # run in order later on.
1639 # func_hookable FUNC_NAME
1640 # -----------------------
1641 # Declare that FUNC_NAME will run hooks added with
1642 # 'func_add_hook FUNC_NAME ...'.
1647 func_append hookable_fns " $1"
1651 # func_add_hook FUNC_NAME HOOK_FUNC
1652 # ---------------------------------
1653 # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must
1654 # first have been declared "hookable" by a call to 'func_hookable'.
1659 case " $hookable_fns " in
1661 *) func_fatal_error "'$1' does not accept hook functions." ;;
1664 eval func_append ${1}_hooks '" $2"'
1668 # func_remove_hook FUNC_NAME HOOK_FUNC
1669 # ------------------------------------
1670 # Remove HOOK_FUNC from the list of hook functions to be called by
1676 eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
1680 # func_propagate_result FUNC_NAME_A FUNC_NAME_B
1681 # ---------------------------------------------
1682 # If the *_result variable of FUNC_NAME_A _is set_, assign its value to
1683 # *_result variable of FUNC_NAME_B.
1684 func_propagate_result ()
1688 func_propagate_result_result=:
1689 if eval "test \"\${${1}_result+set}\" = set"
1691 eval "${2}_result=\$${1}_result"
1693 func_propagate_result_result=false
1698 # func_run_hooks FUNC_NAME [ARG]...
1699 # ---------------------------------
1700 # Run all hook functions registered to FUNC_NAME.
1701 # It's assumed that the list of hook functions contains nothing more
1702 # than a whitespace-delimited list of legal shell function names, and
1703 # no effort is wasted trying to catch shell meta-characters or preserve
1709 case " $hookable_fns " in
1711 *) func_fatal_error "'$1' does not support hook functions." ;;
1714 eval _G_hook_fns=\$$1_hooks; shift
1716 for _G_hook in $_G_hook_fns; do
1717 func_unset "${_G_hook}_result"
1718 eval $_G_hook '${1+"$@"}'
1719 func_propagate_result $_G_hook func_run_hooks
1720 if $func_propagate_result_result; then
1721 eval set dummy "$func_run_hooks_result"; shift
1728 ## --------------- ##
1729 ## Option parsing. ##
1730 ## --------------- ##
1732 # In order to add your own option parsing hooks, you must accept the
1733 # full positional parameter list from your hook function. You may remove
1734 # or edit any options that you action, and then pass back the remaining
1735 # unprocessed options in '<hooked_function_name>_result', escaped
1736 # suitably for 'eval'.
1738 # The '<hooked_function_name>_result' variable is automatically unset
1739 # before your hook gets called; for best performance, only set the
1740 # *_result variable when necessary (i.e. don't call the 'func_quote'
1741 # function unnecessarily because it can be an expensive operation on some
1746 # my_options_prep ()
1750 # # Extend the existing usage message.
1751 # usage_message=$usage_message'
1752 # -s, --silent don'\''t print informational messages
1754 # # No change in '$@' (ignored completely by this hook). Leave
1755 # # my_options_prep_result variable intact.
1757 # func_add_hook func_options_prep my_options_prep
1760 # my_silent_option ()
1764 # args_changed=false
1766 # # Note that, for efficiency, we parse as many options as we can
1767 # # recognise in a loop before passing the remainder back to the
1768 # # caller on the first unrecognised argument we encounter.
1769 # while test $# -gt 0; do
1772 # --silent|-s) opt_silent=:
1775 # # Separate non-argument short options:
1776 # -s*) func_split_short_opt "$_G_opt"
1777 # set dummy "$func_split_short_opt_name" \
1778 # "-$func_split_short_opt_arg" ${1+"$@"}
1782 # *) # Make sure the first unrecognised option "$_G_opt"
1783 # # is added back to "$@" in case we need it later,
1784 # # if $args_changed was set to 'true'.
1785 # set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
1789 # # Only call 'func_quote' here if we processed at least one argument.
1790 # if $args_changed; then
1791 # func_quote eval ${1+"$@"}
1792 # my_silent_option_result=$func_quote_result
1795 # func_add_hook func_parse_options my_silent_option
1798 # my_option_validation ()
1802 # $opt_silent && $opt_verbose && func_fatal_help "\
1803 # '--silent' and '--verbose' options are mutually exclusive."
1805 # func_add_hook func_validate_options my_option_validation
1807 # You'll also need to manually amend $usage_message to reflect the extra
1808 # options you parse. It's preferable to append if you can, so that
1809 # multiple option parsing hooks can be added safely.
1812 # func_options_finish [ARG]...
1813 # ----------------------------
1814 # Finishing the option parse loop (call 'func_options' hooks ATM).
1815 func_options_finish ()
1819 func_run_hooks func_options ${1+"$@"}
1820 func_propagate_result func_run_hooks func_options_finish
1824 # func_options [ARG]...
1825 # ---------------------
1826 # All the functions called inside func_options are hookable. See the
1827 # individual implementations for details.
1828 func_hookable func_options
1833 _G_options_quoted=false
1835 for my_func in options_prep parse_options validate_options options_finish
1837 func_unset func_${my_func}_result
1838 func_unset func_run_hooks_result
1839 eval func_$my_func '${1+"$@"}'
1840 func_propagate_result func_$my_func func_options
1841 if $func_propagate_result_result; then
1842 eval set dummy "$func_options_result"; shift
1847 $_G_options_quoted || {
1848 # As we (func_options) are top-level options-parser function and
1849 # nobody quoted "$@" for us yet, we need to do it explicitly for
1851 func_quote eval ${1+"$@"}
1852 func_options_result=$func_quote_result
1857 # func_options_prep [ARG]...
1858 # --------------------------
1859 # All initialisations required before starting the option parse loop.
1860 # Note that when calling hook functions, we pass through the list of
1861 # positional parameters. If a hook function modifies that list, and
1862 # needs to propagate that back to rest of this script, then the complete
1863 # modified list must be put in 'func_run_hooks_result' before returning.
1864 func_hookable func_options_prep
1865 func_options_prep ()
1873 func_run_hooks func_options_prep ${1+"$@"}
1874 func_propagate_result func_run_hooks func_options_prep
1878 # func_parse_options [ARG]...
1879 # ---------------------------
1880 # The main option parsing loop.
1881 func_hookable func_parse_options
1882 func_parse_options ()
1886 _G_parse_options_requote=false
1887 # this just eases exit handling
1888 while test $# -gt 0; do
1889 # Defer to hook functions for initial option parsing, so they
1890 # get priority in the event of reusing an option name.
1891 func_run_hooks func_parse_options ${1+"$@"}
1892 func_propagate_result func_run_hooks func_parse_options
1893 if $func_propagate_result_result; then
1894 eval set dummy "$func_parse_options_result"; shift
1895 # Even though we may have changed "$@", we passed the "$@" array
1896 # down into the hook and it quoted it for us (because we are in
1897 # this if-branch). No need to quote it again.
1898 _G_parse_options_requote=false
1901 # Break out of the loop if we already parsed every option.
1902 test $# -gt 0 || break
1904 # We expect that one of the options parsed in this function matches
1905 # and thus we remove _G_opt from "$@" and need to re-quote.
1906 _G_match_parse_options=:
1910 --debug|-x) debug_cmd='set -x'
1911 func_echo "enabling shell trace mode" >&2
1915 --no-warnings|--no-warning|--no-warn)
1916 set dummy --warnings none ${1+"$@"}
1920 --warnings|--warning|-W)
1921 if test $# = 0 && func_missing_arg $_G_opt; then
1922 _G_parse_options_requote=:
1925 case " $warning_categories $1" in
1927 # trailing space prevents matching last $1 above
1928 func_append_uniq opt_warning_types " $1"
1931 opt_warning_types=$warning_categories
1934 opt_warning_types=none
1938 opt_warning_types=$warning_categories
1939 warning_func=func_fatal_error
1943 "unsupported warning category: '$1'"
1949 --verbose|-v) opt_verbose=: ;;
1950 --version) func_version ;;
1951 -\?|-h) func_usage ;;
1952 --help) func_help ;;
1954 # Separate optargs to long options (plugins may need this):
1955 --*=*) func_split_equals "$_G_opt"
1956 set dummy "$func_split_equals_lhs" \
1957 "$func_split_equals_rhs" ${1+"$@"}
1961 # Separate optargs to short options:
1963 func_split_short_opt "$_G_opt"
1964 set dummy "$func_split_short_opt_name" \
1965 "$func_split_short_opt_arg" ${1+"$@"}
1969 # Separate non-argument short options:
1971 func_split_short_opt "$_G_opt"
1972 set dummy "$func_split_short_opt_name" \
1973 "-$func_split_short_opt_arg" ${1+"$@"}
1977 --) _G_parse_options_requote=: ; break ;;
1978 -*) func_fatal_help "unrecognised option: '$_G_opt'" ;;
1979 *) set dummy "$_G_opt" ${1+"$@"}; shift
1980 _G_match_parse_options=false
1985 if $_G_match_parse_options; then
1986 _G_parse_options_requote=:
1990 if $_G_parse_options_requote; then
1991 # save modified positional parameters for caller
1992 func_quote eval ${1+"$@"}
1993 func_parse_options_result=$func_quote_result
1998 # func_validate_options [ARG]...
1999 # ------------------------------
2000 # Perform any sanity checks on option settings and/or unconsumed
2002 func_hookable func_validate_options
2003 func_validate_options ()
2007 # Display all warnings if -W was not given.
2008 test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
2010 func_run_hooks func_validate_options ${1+"$@"}
2011 func_propagate_result func_run_hooks func_validate_options
2013 # Bail if the options were screwed!
2014 $exit_cmd $EXIT_FAILURE
2019 ## ----------------- ##
2020 ## Helper functions. ##
2021 ## ----------------- ##
2023 # This section contains the helper functions used by the rest of the
2024 # hookable option parser framework in ascii-betical order.
2027 # func_fatal_help ARG...
2028 # ----------------------
2029 # Echo program name prefixed message to standard error, followed by
2030 # a help hint, and exit.
2035 eval \$ECHO \""Usage: $usage"\"
2036 eval \$ECHO \""$fatal_help"\"
2037 func_error ${1+"$@"}
2044 # Echo long help message to standard output and exit.
2050 $ECHO "$long_help_message"
2055 # func_missing_arg ARGNAME
2056 # ------------------------
2057 # Echo program name prefixed message to standard error and set global
2063 func_error "Missing argument for '$1'."
2068 # func_split_equals STRING
2069 # ------------------------
2070 # Set func_split_equals_lhs and func_split_equals_rhs shell variables
2071 # after splitting STRING at the '=' sign.
2072 test -z "$_G_HAVE_XSI_OPS" \
2074 test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
2075 && _G_HAVE_XSI_OPS=yes
2077 if test yes = "$_G_HAVE_XSI_OPS"
2079 # This is an XSI compatible shell, allowing a faster implementation...
2080 eval 'func_split_equals ()
2084 func_split_equals_lhs=${1%%=*}
2085 func_split_equals_rhs=${1#*=}
2086 if test "x$func_split_equals_lhs" = "x$1"; then
2087 func_split_equals_rhs=
2091 # ...otherwise fall back to using expr, which is often a shell builtin.
2092 func_split_equals ()
2096 func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
2097 func_split_equals_rhs=
2098 test "x$func_split_equals_lhs=" = "x$1" \
2099 || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
2101 fi #func_split_equals
2104 # func_split_short_opt SHORTOPT
2105 # -----------------------------
2106 # Set func_split_short_opt_name and func_split_short_opt_arg shell
2107 # variables after splitting SHORTOPT after the 2nd character.
2108 if test yes = "$_G_HAVE_XSI_OPS"
2110 # This is an XSI compatible shell, allowing a faster implementation...
2111 eval 'func_split_short_opt ()
2115 func_split_short_opt_arg=${1#??}
2116 func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
2119 # ...otherwise fall back to using expr, which is often a shell builtin.
2120 func_split_short_opt ()
2124 func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'`
2125 func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
2127 fi #func_split_short_opt
2132 # Echo short help message to standard output and exit.
2138 $ECHO "Run '$progname --help |${PAGER-more}' for full usage"
2143 # func_usage_message
2144 # ------------------
2145 # Echo short help message to standard output.
2146 func_usage_message ()
2150 eval \$ECHO \""Usage: $usage"\"
2157 /^Written by/q' < "$progpath"
2159 eval \$ECHO \""$usage_message"\"
2165 # Echo version message to standard output and exit.
2166 # The version message is extracted from the calling file's header
2167 # comments, with leading '# ' stripped:
2168 # 1. First display the progname and version
2169 # 2. Followed by the header comment line matching /^# Written by /
2170 # 3. Then a blank line followed by the first following line matching
2172 # 4. Immediately followed by any lines between the previous matches,
2173 # except lines preceding the intervening completely blank line.
2174 # For example, see the header comments of this file.
2179 printf '%s\n' "$progname $scriptversion"
2200 s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
2210 # mode: shell-script
2212 # eval: (add-hook 'before-save-hook 'time-stamp)
2213 # time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC"
2214 # time-stamp-time-zone: "UTC"
2217 # Set a version string.
2218 scriptversion='(GNU libtool) 2.4.7'
2223 # Libtool also displays the current mode in messages, so override
2224 # funclib.sh func_echo with this custom definition.
2233 for _G_line in $_G_message; do
2235 $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
2241 # func_warning ARG...
2242 # -------------------
2243 # Libtool warnings are not categorized, so override funclib.sh
2244 # func_warning with this simpler definition.
2249 $warning_func ${1+"$@"}
2253 ## ---------------- ##
2254 ## Options parsing. ##
2255 ## ---------------- ##
2257 # Hook in the functions to make sure our own options are parsed during
2258 # the option parsing loop.
2260 usage='$progpath [OPTION]... [MODE-ARG]...'
2262 # Short help message in response to '-h'.
2263 usage_message="Options:
2264 --config show all configuration variables
2265 --debug enable verbose shell tracing
2266 -n, --dry-run display commands without modifying any files
2267 --features display basic configuration information and exit
2268 --mode=MODE use operation mode MODE
2269 --no-warnings equivalent to '-Wnone'
2270 --preserve-dup-deps don't remove duplicate dependency libraries
2271 --quiet, --silent don't print informational messages
2272 --tag=TAG use configuration variables from tag TAG
2273 -v, --verbose print more informational messages than default
2274 --version print version information
2275 -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all]
2276 -h, --help, --help-all print short, long, or detailed help message
2279 # Additional text appended to 'usage_message' in response to '--help'.
2285 $ECHO "$long_help_message
2287 MODE must be one of the following:
2289 clean remove files from the build directory
2290 compile compile a source file into a libtool object
2291 execute automatically set library path, then run a program
2292 finish complete the installation of libtool libraries
2293 install install libraries or executables
2294 link create a library or an executable
2295 uninstall remove libraries from an installed directory
2297 MODE-ARGS vary depending on the MODE. When passed as first option,
2298 '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
2299 Try '$progname --help --mode=MODE' for a more detailed description of MODE.
2301 When reporting a bug, please describe a test case to reproduce it and
2302 include the following information:
2307 compiler flags: $LTCFLAGS
2308 linker: $LD (gnu? $with_gnu_ld)
2309 version: $progname (GNU libtool) 2.4.7
2310 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
2311 autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
2313 Report bugs to <bug-libtool@gnu.org>.
2314 GNU libtool home page: <http://www.gnu.org/software/libtool/>.
2315 General help using GNU software: <http://www.gnu.org/gethelp/>."
2320 # func_lo2o OBJECT-NAME
2321 # ---------------------
2322 # Transform OBJECT-NAME from a '.lo' suffix to the platform specific
2325 lo2o=s/\\.lo\$/.$objext/
2326 o2lo=s/\\.$objext\$/.lo/
2328 if test yes = "$_G_HAVE_XSI_OPS"; then
2332 *.lo) func_lo2o_result=${1%.lo}.$objext ;;
2333 * ) func_lo2o_result=$1 ;;
2337 # func_xform LIBOBJ-OR-SOURCE
2338 # ---------------------------
2339 # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
2340 # suffix to a '.lo' libtool-object suffix.
2343 func_xform_result=${1%.*}.lo
2346 # ...otherwise fall back to using sed.
2349 func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
2354 func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
2359 # func_fatal_configuration ARG...
2360 # -------------------------------
2361 # Echo program name prefixed message to standard error, followed by
2362 # a configuration failure hint, and exit.
2363 func_fatal_configuration ()
2365 func_fatal_error ${1+"$@"} \
2366 "See the $PACKAGE documentation for more information." \
2367 "Fatal configuration error."
2373 # Display the configuration for all the tags in this script.
2376 re_begincf='^# ### BEGIN LIBTOOL'
2377 re_endcf='^# ### END LIBTOOL'
2379 # Default configuration.
2380 $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
2382 # Now print the configurations for the tags.
2383 for tagname in $taglist; do
2384 $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
2393 # Display the features supported by this script.
2397 if test yes = "$build_libtool_libs"; then
2398 echo "enable shared libraries"
2400 echo "disable shared libraries"
2402 if test yes = "$build_old_libs"; then
2403 echo "enable static libraries"
2405 echo "disable static libraries"
2412 # func_enable_tag TAGNAME
2413 # -----------------------
2414 # Verify that TAGNAME is valid, and either flag an error and exit, or
2415 # enable the TAGNAME tag. We also add TAGNAME to the global $taglist
2422 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
2423 re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
2424 sed_extractcf=/$re_begincf/,/$re_endcf/p
2429 func_fatal_error "invalid tag name: $tagname"
2433 # Don't test for the "default" C tag, as we know it's
2434 # there but not specially marked.
2438 if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
2439 taglist="$taglist $tagname"
2441 # Evaluate the configuration. Be careful to quote the path
2442 # and the sed script, to avoid splitting on whitespace, but
2443 # also don't use non-portable quotes within backquotes within
2444 # quotes we have to do it in 2 steps:
2445 extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
2448 func_error "ignoring unknown tag $tagname"
2455 # func_check_version_match
2456 # ------------------------
2457 # Ensure that we are using m4 macros, and libtool script from the same
2458 # release of libtool.
2459 func_check_version_match ()
2461 if test "$package_revision" != "$macro_revision"; then
2462 if test "$VERSION" != "$macro_version"; then
2463 if test -z "$macro_version"; then
2465 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
2466 $progname: definition of this LT_INIT comes from an older release.
2467 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
2468 $progname: and run autoconf again.
2472 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
2473 $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
2474 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
2475 $progname: and run autoconf again.
2480 $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
2481 $progname: but the definition of this LT_INIT comes from revision $macro_revision.
2482 $progname: You should recreate aclocal.m4 with macros from revision $package_revision
2483 $progname: of $PACKAGE $VERSION and run autoconf again.
2492 # libtool_options_prep [ARG]...
2493 # -----------------------------
2494 # Preparation for options parsed by libtool.
2495 libtool_options_prep ()
2505 opt_preserve_dup_deps=false
2511 _G_rc_lt_options_prep=:
2513 # Shorthand for --mode=foo, only valid as the first argument
2516 shift; set dummy --mode clean ${1+"$@"}; shift
2518 compile|compil|compi|comp|com|co|c)
2519 shift; set dummy --mode compile ${1+"$@"}; shift
2521 execute|execut|execu|exec|exe|ex|e)
2522 shift; set dummy --mode execute ${1+"$@"}; shift
2524 finish|finis|fini|fin|fi|f)
2525 shift; set dummy --mode finish ${1+"$@"}; shift
2527 install|instal|insta|inst|ins|in|i)
2528 shift; set dummy --mode install ${1+"$@"}; shift
2531 shift; set dummy --mode link ${1+"$@"}; shift
2533 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
2534 shift; set dummy --mode uninstall ${1+"$@"}; shift
2537 _G_rc_lt_options_prep=false
2541 if $_G_rc_lt_options_prep; then
2542 # Pass back the list of options.
2543 func_quote eval ${1+"$@"}
2544 libtool_options_prep_result=$func_quote_result
2547 func_add_hook func_options_prep libtool_options_prep
2550 # libtool_parse_options [ARG]...
2551 # ---------------------------------
2552 # Provide handling for libtool specific options.
2553 libtool_parse_options ()
2557 _G_rc_lt_parse_options=false
2559 # Perform our own loop to consume as many options as possible in
2561 while test $# -gt 0; do
2562 _G_match_lt_parse_options=:
2566 --dry-run|--dryrun|-n)
2570 --config) func_config ;;
2573 opt_dlopen="${opt_dlopen+$opt_dlopen
2578 --preserve-dup-deps)
2579 opt_preserve_dup_deps=: ;;
2581 --features) func_features ;;
2583 --finish) set dummy --mode finish ${1+"$@"}; shift ;;
2585 --help) opt_help=: ;;
2587 --help-all) opt_help=': help-all' ;;
2589 --mode) test $# = 0 && func_missing_arg $_G_opt && break
2592 # Valid mode arguments:
2593 clean|compile|execute|finish|install|link|relink|uninstall) ;;
2595 # Catch anything else as an error
2596 *) func_error "invalid argument for $_G_opt"
2604 --no-silent|--no-quiet)
2606 func_append preserve_args " $_G_opt"
2609 --no-warnings|--no-warning|--no-warn)
2611 func_append preserve_args " $_G_opt"
2616 func_append preserve_args " $_G_opt"
2622 func_append preserve_args " $_G_opt"
2625 --tag) test $# = 0 && func_missing_arg $_G_opt && break
2627 func_append preserve_args " $_G_opt $1"
2628 func_enable_tag "$1"
2632 --verbose|-v) opt_quiet=false
2634 func_append preserve_args " $_G_opt"
2637 # An option not handled by this hook function:
2638 *) set dummy "$_G_opt" ${1+"$@"} ; shift
2639 _G_match_lt_parse_options=false
2643 $_G_match_lt_parse_options && _G_rc_lt_parse_options=:
2646 if $_G_rc_lt_parse_options; then
2647 # save modified positional parameters for caller
2648 func_quote eval ${1+"$@"}
2649 libtool_parse_options_result=$func_quote_result
2652 func_add_hook func_parse_options libtool_parse_options
2656 # libtool_validate_options [ARG]...
2657 # ---------------------------------
2658 # Perform any sanity checks on option settings and/or unconsumed
2660 libtool_validate_options ()
2662 # save first non-option argument
2663 if test 0 -lt $#; then
2669 test : = "$debug_cmd" || func_append preserve_args " --debug"
2671 # Keeping compiler generated duplicates in $postdeps and $predeps is not
2672 # harmful, and is necessary in a majority of systems that use it to satisfy
2673 # symbol dependencies.
2674 opt_duplicate_compiler_generated_deps=:
2677 # Sanity checks first:
2678 func_check_version_match
2680 test yes != "$build_libtool_libs" \
2681 && test yes != "$build_old_libs" \
2682 && func_fatal_configuration "not configured to build any kind of library"
2685 eval std_shrext=\"$shrext_cmds\"
2687 # Only execute mode is allowed to have -dlopen flags.
2688 if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
2689 func_error "unrecognized option '-dlopen'"
2694 # Change the help message to a mode-specific one.
2696 help="Try '$progname --help --mode=$opt_mode' for more information."
2699 # Pass back the unparsed argument list
2700 func_quote eval ${1+"$@"}
2701 libtool_validate_options_result=$func_quote_result
2703 func_add_hook func_validate_options libtool_validate_options
2706 # Process options as early as possible so that --help and --version
2707 # can return quickly.
2708 func_options ${1+"$@"}
2709 eval set dummy "$func_options_result"; shift
2717 magic='%%%MAGIC variable%%%'
2718 magic_exe='%%%MAGIC EXE variable%%%'
2724 # If this variable is set in any of the actions, the command in it
2725 # will be execed at the end. This prevents here-documents from being
2726 # left over by shells.
2730 # A function that is used when there is no print builtin or printf.
2731 func_fallback_echo ()
2733 eval 'cat <<_LTECHO_EOF
2738 # func_generated_by_libtool
2739 # True iff stdin has been generated by Libtool. This function is only
2740 # a basic sanity check; it will hardly flush out determined imposters.
2741 func_generated_by_libtool_p ()
2743 $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
2747 # True iff FILE is a libtool '.la' library or '.lo' object file.
2748 # This function is only a basic sanity check; it will hardly flush out
2749 # determined imposters.
2753 $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p
2756 # func_lalib_unsafe_p file
2757 # True iff FILE is a libtool '.la' library or '.lo' object file.
2758 # This function implements the same check as func_lalib_p without
2759 # resorting to external programs. To this end, it redirects stdin and
2760 # closes it afterwards, without saving the original file descriptor.
2761 # As a safety measure, use it only where a negative result would be
2762 # fatal anyway. Works if 'file' does not exist.
2763 func_lalib_unsafe_p ()
2766 if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
2767 for lalib_p_l in 1 2 3 4
2770 case $lalib_p_line in
2771 \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
2776 test yes = "$lalib_p"
2779 # func_ltwrapper_script_p file
2780 # True iff FILE is a libtool wrapper script
2781 # This function is only a basic sanity check; it will hardly flush out
2782 # determined imposters.
2783 func_ltwrapper_script_p ()
2786 $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p
2789 # func_ltwrapper_executable_p file
2790 # True iff FILE is a libtool wrapper executable
2791 # This function is only a basic sanity check; it will hardly flush out
2792 # determined imposters.
2793 func_ltwrapper_executable_p ()
2795 func_ltwrapper_exec_suffix=
2798 *) func_ltwrapper_exec_suffix=.exe ;;
2800 $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
2803 # func_ltwrapper_scriptname file
2804 # Assumes file is an ltwrapper_executable
2805 # uses $file to determine the appropriate filename for a
2806 # temporary ltwrapper_script.
2807 func_ltwrapper_scriptname ()
2809 func_dirname_and_basename "$1" "" "."
2810 func_stripname '' '.exe' "$func_basename_result"
2811 func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
2814 # func_ltwrapper_p file
2815 # True iff FILE is a libtool wrapper script or wrapper executable
2816 # This function is only a basic sanity check; it will hardly flush out
2817 # determined imposters.
2820 func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
2824 # func_execute_cmds commands fail_cmd
2825 # Execute tilde-delimited COMMANDS.
2826 # If FAIL_CMD is given, eval that upon failure.
2827 # FAIL_CMD may read-access the current command in variable CMD!
2828 func_execute_cmds ()
2832 save_ifs=$IFS; IFS='~'
2837 func_show_eval "$cmd" "${2-:}"
2844 # Source FILE, adding directory component if necessary.
2845 # Note that it is not necessary on cygwin/mingw to append a dot to
2846 # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
2847 # behavior happens only for exec(3), not for open(2)! Also, sourcing
2848 # 'FILE.' does not work on cygwin managed mounts.
2854 */* | *\\*) . "$1" ;;
2860 # func_resolve_sysroot PATH
2861 # Replace a leading = in PATH with a sysroot. Store the result into
2862 # func_resolve_sysroot_result
2863 func_resolve_sysroot ()
2865 func_resolve_sysroot_result=$1
2866 case $func_resolve_sysroot_result in
2868 func_stripname '=' '' "$func_resolve_sysroot_result"
2869 func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
2874 # func_replace_sysroot PATH
2875 # If PATH begins with the sysroot, replace it with = and
2876 # store the result into func_replace_sysroot_result.
2877 func_replace_sysroot ()
2879 case $lt_sysroot:$1 in
2881 func_stripname "$lt_sysroot" '' "$1"
2882 func_replace_sysroot_result='='$func_stripname_result
2885 # Including no sysroot.
2886 func_replace_sysroot_result=$1
2891 # func_infer_tag arg
2892 # Infer tagged configuration to use if any are available and
2893 # if one wasn't chosen via the "--tag" command line option.
2894 # Only attempt this if the compiler in the base compile
2895 # command doesn't match the default compiler.
2896 # arg is usually of the form 'gcc ...'
2901 if test -n "$available_tags" && test -z "$tagname"; then
2904 func_append_quoted CC_quoted "$arg"
2906 CC_expanded=`func_echo_all $CC`
2907 CC_quoted_expanded=`func_echo_all $CC_quoted`
2909 # Blanks in the command may have been stripped by the calling shell,
2910 # but not from the CC environment variable when configure was run.
2911 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
2912 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
2913 # Blanks at the start of $base_compile will cause this to fail
2914 # if we don't check for them as well.
2916 for z in $available_tags; do
2917 if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
2918 # Evaluate the configuration.
2919 eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
2922 # Double-quote args containing other shell metacharacters.
2923 func_append_quoted CC_quoted "$arg"
2925 CC_expanded=`func_echo_all $CC`
2926 CC_quoted_expanded=`func_echo_all $CC_quoted`
2928 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
2929 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
2930 # The compiler in the base compile command matches
2931 # the one in the tagged configuration.
2932 # Assume this is the tagged configuration we want.
2939 # If $tagname still isn't set, then no tagged configuration
2940 # was found and let the user know that the "--tag" command
2941 # line option must be used.
2942 if test -z "$tagname"; then
2943 func_echo "unable to infer tagged configuration"
2944 func_fatal_error "specify a tag with '--tag'"
2946 # func_verbose "using $tagname tagged configuration"
2955 # func_write_libtool_object output_name pic_name nonpic_name
2956 # Create a libtool object file (analogous to a ".la" file),
2957 # but don't create it if we're doing a dry run.
2958 func_write_libtool_object ()
2961 if test yes = "$build_libtool_libs"; then
2967 if test yes = "$build_old_libs"; then
2974 cat >${write_libobj}T <<EOF
2975 # $write_libobj - a libtool object file
2976 # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
2978 # Please DO NOT delete this file!
2979 # It is necessary for linking the library.
2981 # Name of the PIC object.
2982 pic_object=$write_lobj
2984 # Name of the non-PIC object
2985 non_pic_object=$write_oldobj
2988 $MV "${write_libobj}T" "$write_libobj"
2993 ##################################################
2994 # FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
2995 ##################################################
2997 # func_convert_core_file_wine_to_w32 ARG
2998 # Helper function used by file name conversion functions when $build is *nix,
2999 # and $host is mingw, cygwin, or some other w32 environment. Relies on a
3000 # correctly configured wine environment available, with the winepath program
3001 # in $build's $PATH.
3003 # ARG is the $build file name to be converted to w32 format.
3004 # Result is available in $func_convert_core_file_wine_to_w32_result, and will
3005 # be empty on error (or when ARG is empty)
3006 func_convert_core_file_wine_to_w32 ()
3010 func_convert_core_file_wine_to_w32_result=$1
3011 if test -n "$1"; then
3012 # Unfortunately, winepath does not exit with a non-zero error code, so we
3013 # are forced to check the contents of stdout. On the other hand, if the
3014 # command is not found, the shell will set an exit code of 127 and print
3015 # *an error message* to stdout. So we must check for both error code of
3016 # zero AND non-empty stdout, which explains the odd construction:
3017 func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
3018 if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
3019 func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
3020 $SED -e "$sed_naive_backslashify"`
3022 func_convert_core_file_wine_to_w32_result=
3026 # end: func_convert_core_file_wine_to_w32
3029 # func_convert_core_path_wine_to_w32 ARG
3030 # Helper function used by path conversion functions when $build is *nix, and
3031 # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
3032 # configured wine environment available, with the winepath program in $build's
3033 # $PATH. Assumes ARG has no leading or trailing path separator characters.
3035 # ARG is path to be converted from $build format to win32.
3036 # Result is available in $func_convert_core_path_wine_to_w32_result.
3037 # Unconvertible file (directory) names in ARG are skipped; if no directory names
3038 # are convertible, then the result may be empty.
3039 func_convert_core_path_wine_to_w32 ()
3043 # unfortunately, winepath doesn't convert paths, only file names
3044 func_convert_core_path_wine_to_w32_result=
3045 if test -n "$1"; then
3048 for func_convert_core_path_wine_to_w32_f in $1; do
3050 func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
3051 if test -n "$func_convert_core_file_wine_to_w32_result"; then
3052 if test -z "$func_convert_core_path_wine_to_w32_result"; then
3053 func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
3055 func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
3062 # end: func_convert_core_path_wine_to_w32
3065 # func_cygpath ARGS...
3066 # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
3067 # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
3068 # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
3069 # (2), returns the Cygwin file name or path in func_cygpath_result (input
3070 # file name or path is assumed to be in w32 format, as previously converted
3071 # from $build's *nix or MSYS format). In case (3), returns the w32 file name
3072 # or path in func_cygpath_result (input file name or path is assumed to be in
3073 # Cygwin format). Returns an empty string on error.
3075 # ARGS are passed to cygpath, with the last one being the file name or path to
3078 # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
3079 # environment variable; do not put it in $PATH.
3084 if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
3085 func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
3086 if test "$?" -ne 0; then
3087 # on failure, ensure result is empty
3088 func_cygpath_result=
3091 func_cygpath_result=
3092 func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
3098 # func_convert_core_msys_to_w32 ARG
3099 # Convert file name or path ARG from MSYS format to w32 format. Return
3100 # result in func_convert_core_msys_to_w32_result.
3101 func_convert_core_msys_to_w32 ()
3105 # awkward: cmd appends spaces to result
3106 func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
3107 $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
3109 #end: func_convert_core_msys_to_w32
3112 # func_convert_file_check ARG1 ARG2
3113 # Verify that ARG1 (a file name in $build format) was converted to $host
3114 # format in ARG2. Otherwise, emit an error message, but continue (resetting
3115 # func_to_host_file_result to ARG1).
3116 func_convert_file_check ()
3120 if test -z "$2" && test -n "$1"; then
3121 func_error "Could not determine host file name corresponding to"
3123 func_error "Continuing, but uninstalled executables may not work."
3125 func_to_host_file_result=$1
3128 # end func_convert_file_check
3131 # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
3132 # Verify that FROM_PATH (a path in $build format) was converted to $host
3133 # format in TO_PATH. Otherwise, emit an error message, but continue, resetting
3134 # func_to_host_file_result to a simplistic fallback value (see below).
3135 func_convert_path_check ()
3139 if test -z "$4" && test -n "$3"; then
3140 func_error "Could not determine the host path corresponding to"
3142 func_error "Continuing, but uninstalled executables may not work."
3143 # Fallback. This is a deliberately simplistic "conversion" and
3144 # should not be "improved". See libtool.info.
3145 if test "x$1" != "x$2"; then
3146 lt_replace_pathsep_chars="s|$1|$2|g"
3147 func_to_host_path_result=`echo "$3" |
3148 $SED -e "$lt_replace_pathsep_chars"`
3150 func_to_host_path_result=$3
3154 # end func_convert_path_check
3157 # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
3158 # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
3159 # and appending REPL if ORIG matches BACKPAT.
3160 func_convert_path_front_back_pathsep ()
3165 $1 ) func_to_host_path_result=$3$func_to_host_path_result
3169 $2 ) func_append func_to_host_path_result "$3"
3173 # end func_convert_path_front_back_pathsep
3176 ##################################################
3177 # $build to $host FILE NAME CONVERSION FUNCTIONS #
3178 ##################################################
3179 # invoked via '$to_host_file_cmd ARG'
3181 # In each case, ARG is the path to be converted from $build to $host format.
3182 # Result will be available in $func_to_host_file_result.
3185 # func_to_host_file ARG
3186 # Converts the file name ARG from $build format to $host format. Return result
3187 # in func_to_host_file_result.
3188 func_to_host_file ()
3192 $to_host_file_cmd "$1"
3194 # end func_to_host_file
3197 # func_to_tool_file ARG LAZY
3198 # converts the file name ARG from $build format to toolchain format. Return
3199 # result in func_to_tool_file_result. If the conversion in use is listed
3200 # in (the comma separated) LAZY, no conversion takes place.
3201 func_to_tool_file ()
3206 *,"$to_tool_file_cmd",*)
3207 func_to_tool_file_result=$1
3210 $to_tool_file_cmd "$1"
3211 func_to_tool_file_result=$func_to_host_file_result
3215 # end func_to_tool_file
3218 # func_convert_file_noop ARG
3219 # Copy ARG to func_to_host_file_result.
3220 func_convert_file_noop ()
3222 func_to_host_file_result=$1
3224 # end func_convert_file_noop
3227 # func_convert_file_msys_to_w32 ARG
3228 # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
3229 # conversion to w32 is not available inside the cwrapper. Returns result in
3230 # func_to_host_file_result.
3231 func_convert_file_msys_to_w32 ()
3235 func_to_host_file_result=$1
3236 if test -n "$1"; then
3237 func_convert_core_msys_to_w32 "$1"
3238 func_to_host_file_result=$func_convert_core_msys_to_w32_result
3240 func_convert_file_check "$1" "$func_to_host_file_result"
3242 # end func_convert_file_msys_to_w32
3245 # func_convert_file_cygwin_to_w32 ARG
3246 # Convert file name ARG from Cygwin to w32 format. Returns result in
3247 # func_to_host_file_result.
3248 func_convert_file_cygwin_to_w32 ()
3252 func_to_host_file_result=$1
3253 if test -n "$1"; then
3254 # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
3255 # LT_CYGPATH in this case.
3256 func_to_host_file_result=`cygpath -m "$1"`
3258 func_convert_file_check "$1" "$func_to_host_file_result"
3260 # end func_convert_file_cygwin_to_w32
3263 # func_convert_file_nix_to_w32 ARG
3264 # Convert file name ARG from *nix to w32 format. Requires a wine environment
3265 # and a working winepath. Returns result in func_to_host_file_result.
3266 func_convert_file_nix_to_w32 ()
3270 func_to_host_file_result=$1
3271 if test -n "$1"; then
3272 func_convert_core_file_wine_to_w32 "$1"
3273 func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
3275 func_convert_file_check "$1" "$func_to_host_file_result"
3277 # end func_convert_file_nix_to_w32
3280 # func_convert_file_msys_to_cygwin ARG
3281 # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
3282 # Returns result in func_to_host_file_result.
3283 func_convert_file_msys_to_cygwin ()
3287 func_to_host_file_result=$1
3288 if test -n "$1"; then
3289 func_convert_core_msys_to_w32 "$1"
3290 func_cygpath -u "$func_convert_core_msys_to_w32_result"
3291 func_to_host_file_result=$func_cygpath_result
3293 func_convert_file_check "$1" "$func_to_host_file_result"
3295 # end func_convert_file_msys_to_cygwin
3298 # func_convert_file_nix_to_cygwin ARG
3299 # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
3300 # in a wine environment, working winepath, and LT_CYGPATH set. Returns result
3301 # in func_to_host_file_result.
3302 func_convert_file_nix_to_cygwin ()
3306 func_to_host_file_result=$1
3307 if test -n "$1"; then
3308 # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
3309 func_convert_core_file_wine_to_w32 "$1"
3310 func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
3311 func_to_host_file_result=$func_cygpath_result
3313 func_convert_file_check "$1" "$func_to_host_file_result"
3315 # end func_convert_file_nix_to_cygwin
3318 #############################################
3319 # $build to $host PATH CONVERSION FUNCTIONS #
3320 #############################################
3321 # invoked via '$to_host_path_cmd ARG'
3323 # In each case, ARG is the path to be converted from $build to $host format.
3324 # The result will be available in $func_to_host_path_result.
3326 # Path separators are also converted from $build format to $host format. If
3327 # ARG begins or ends with a path separator character, it is preserved (but
3328 # converted to $host format) on output.
3330 # All path conversion functions are named using the following convention:
3331 # file name conversion function : func_convert_file_X_to_Y ()
3332 # path conversion function : func_convert_path_X_to_Y ()
3333 # where, for any given $build/$host combination the 'X_to_Y' value is the
3334 # same. If conversion functions are added for new $build/$host combinations,
3335 # the two new functions must follow this pattern, or func_init_to_host_path_cmd
3339 # func_init_to_host_path_cmd
3340 # Ensures that function "pointer" variable $to_host_path_cmd is set to the
3341 # appropriate value, based on the value of $to_host_file_cmd.
3343 func_init_to_host_path_cmd ()
3347 if test -z "$to_host_path_cmd"; then
3348 func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
3349 to_host_path_cmd=func_convert_path_$func_stripname_result
3354 # func_to_host_path ARG
3355 # Converts the path ARG from $build format to $host format. Return result
3356 # in func_to_host_path_result.
3357 func_to_host_path ()
3361 func_init_to_host_path_cmd
3362 $to_host_path_cmd "$1"
3364 # end func_to_host_path
3367 # func_convert_path_noop ARG
3368 # Copy ARG to func_to_host_path_result.
3369 func_convert_path_noop ()
3371 func_to_host_path_result=$1
3373 # end func_convert_path_noop
3376 # func_convert_path_msys_to_w32 ARG
3377 # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
3378 # conversion to w32 is not available inside the cwrapper. Returns result in
3379 # func_to_host_path_result.
3380 func_convert_path_msys_to_w32 ()
3384 func_to_host_path_result=$1
3385 if test -n "$1"; then
3386 # Remove leading and trailing path separator characters from ARG. MSYS
3387 # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
3388 # and winepath ignores them completely.
3389 func_stripname : : "$1"
3390 func_to_host_path_tmp1=$func_stripname_result
3391 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
3392 func_to_host_path_result=$func_convert_core_msys_to_w32_result
3393 func_convert_path_check : ";" \
3394 "$func_to_host_path_tmp1" "$func_to_host_path_result"
3395 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
3398 # end func_convert_path_msys_to_w32
3401 # func_convert_path_cygwin_to_w32 ARG
3402 # Convert path ARG from Cygwin to w32 format. Returns result in
3403 # func_to_host_file_result.
3404 func_convert_path_cygwin_to_w32 ()
3408 func_to_host_path_result=$1
3409 if test -n "$1"; then
3410 # See func_convert_path_msys_to_w32:
3411 func_stripname : : "$1"
3412 func_to_host_path_tmp1=$func_stripname_result
3413 func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
3414 func_convert_path_check : ";" \
3415 "$func_to_host_path_tmp1" "$func_to_host_path_result"
3416 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
3419 # end func_convert_path_cygwin_to_w32
3422 # func_convert_path_nix_to_w32 ARG
3423 # Convert path ARG from *nix to w32 format. Requires a wine environment and
3424 # a working winepath. Returns result in func_to_host_file_result.
3425 func_convert_path_nix_to_w32 ()
3429 func_to_host_path_result=$1
3430 if test -n "$1"; then
3431 # See func_convert_path_msys_to_w32:
3432 func_stripname : : "$1"
3433 func_to_host_path_tmp1=$func_stripname_result
3434 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
3435 func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
3436 func_convert_path_check : ";" \
3437 "$func_to_host_path_tmp1" "$func_to_host_path_result"
3438 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
3441 # end func_convert_path_nix_to_w32
3444 # func_convert_path_msys_to_cygwin ARG
3445 # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
3446 # Returns result in func_to_host_file_result.
3447 func_convert_path_msys_to_cygwin ()
3451 func_to_host_path_result=$1
3452 if test -n "$1"; then
3453 # See func_convert_path_msys_to_w32:
3454 func_stripname : : "$1"
3455 func_to_host_path_tmp1=$func_stripname_result
3456 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
3457 func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
3458 func_to_host_path_result=$func_cygpath_result
3459 func_convert_path_check : : \
3460 "$func_to_host_path_tmp1" "$func_to_host_path_result"
3461 func_convert_path_front_back_pathsep ":*" "*:" : "$1"
3464 # end func_convert_path_msys_to_cygwin
3467 # func_convert_path_nix_to_cygwin ARG
3468 # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
3469 # a wine environment, working winepath, and LT_CYGPATH set. Returns result in
3470 # func_to_host_file_result.
3471 func_convert_path_nix_to_cygwin ()
3475 func_to_host_path_result=$1
3476 if test -n "$1"; then
3477 # Remove leading and trailing path separator characters from
3478 # ARG. msys behavior is inconsistent here, cygpath turns them
3479 # into '.;' and ';.', and winepath ignores them completely.
3480 func_stripname : : "$1"
3481 func_to_host_path_tmp1=$func_stripname_result
3482 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
3483 func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
3484 func_to_host_path_result=$func_cygpath_result
3485 func_convert_path_check : : \
3486 "$func_to_host_path_tmp1" "$func_to_host_path_result"
3487 func_convert_path_front_back_pathsep ":*" "*:" : "$1"
3490 # end func_convert_path_nix_to_cygwin
3493 # func_dll_def_p FILE
3494 # True iff FILE is a Windows DLL '.def' file.
3495 # Keep in sync with _LT_DLL_DEF_P in libtool.m4
3500 func_dll_def_p_tmp=`$SED -n \
3502 -e '/^\(;.*\)*$/d' \
3503 -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \
3506 test DEF = "$func_dll_def_p_tmp"
3510 # func_mode_compile arg...
3511 func_mode_compile ()
3515 # Get the compilation command and the source file.
3517 srcfile=$nonopt # always keep a non-empty value in "srcfile"
3529 # do not "continue". Instead, add this to base_compile
3541 # Accept any command-line options.
3544 test -n "$libobj" && \
3545 func_fatal_error "you cannot specify '-o' more than once"
3550 -pie | -fpie | -fPIE)
3551 func_append pie_flag " $arg"
3555 -shared | -static | -prefer-pic | -prefer-non-pic)
3556 func_append later " $arg"
3566 arg_mode=arg # the next one goes into the "base_compile" arg list
3567 continue # The current "srcfile" will either be retained or
3568 ;; # replaced later. I would guess that would be a bug.
3571 func_stripname '-Wc,' '' "$arg"
3572 args=$func_stripname_result
3574 save_ifs=$IFS; IFS=,
3575 for arg in $args; do
3577 func_append_quoted lastarg "$arg"
3580 func_stripname ' ' '' "$lastarg"
3581 lastarg=$func_stripname_result
3583 # Add the arguments to base_compile.
3584 func_append base_compile " $lastarg"
3589 # Accept the current argument as the source file.
3590 # The previous "srcfile" becomes the current argument.
3597 esac # case $arg_mode
3599 # Aesthetically quote the previous argument.
3600 func_append_quoted base_compile "$lastarg"
3605 func_fatal_error "you must specify an argument for -Xcompile"
3608 func_fatal_error "you must specify a target with '-o'"
3611 # Get the name of the library object.
3612 test -z "$libobj" && {
3613 func_basename "$srcfile"
3614 libobj=$func_basename_result
3619 # Recognize several different file suffixes.
3620 # If the user specifies -o file.o, it is replaced with file.lo
3623 *.ada | *.adb | *.ads | *.asm | \
3624 *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
3625 *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
3626 func_xform "$libobj"
3627 libobj=$func_xform_result
3632 *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
3634 func_fatal_error "cannot determine name of library object from '$libobj'"
3638 func_infer_tag $base_compile
3640 for arg in $later; do
3643 test yes = "$build_libtool_libs" \
3644 || func_fatal_configuration "cannot build a shared library"
3650 build_libtool_libs=no
3667 func_quote_arg pretty "$libobj"
3668 test "X$libobj" != "X$func_quote_arg_result" \
3669 && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
3670 && func_warning "libobj name '$libobj' may not contain shell special characters."
3671 func_dirname_and_basename "$obj" "/" ""
3672 objname=$func_basename_result
3673 xdir=$func_dirname_result
3674 lobj=$xdir$objdir/$objname
3676 test -z "$base_compile" && \
3677 func_fatal_help "you must specify a compilation command"
3679 # Delete any leftover library objects.
3680 if test yes = "$build_old_libs"; then
3681 removelist="$obj $lobj $libobj ${libobj}T"
3683 removelist="$lobj $libobj ${libobj}T"
3686 # On Cygwin there's no "real" PIC flag so we must build both object types
3688 cygwin* | mingw* | pw32* | os2* | cegcc*)
3692 if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
3693 # non-PIC code in shared libraries is not supported
3697 # Calculate the filename of the output object if compiler does
3698 # not support -o with -c
3699 if test no = "$compiler_c_o"; then
3700 output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
3701 lockfile=$output_obj.lock
3708 # Lock this critical section if it is needed
3709 # We use this script file to make the link, it avoids creating a new file
3710 if test yes = "$need_locks"; then
3711 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
3712 func_echo "Waiting for $lockfile to be removed"
3715 elif test warn = "$need_locks"; then
3716 if test -f "$lockfile"; then
3718 *** ERROR, $lockfile exists and contains:
3719 `cat $lockfile 2>/dev/null`
3721 This indicates that another process is trying to use the same
3722 temporary object file, and libtool could not work around it because
3723 your compiler does not support '-c' and '-o' together. If you
3724 repeat this compilation, it may succeed, by chance, but you had better
3725 avoid parallel builds (make -j) in this platform, or get a better
3728 $opt_dry_run || $RM $removelist
3731 func_append removelist " $output_obj"
3732 $ECHO "$srcfile" > "$lockfile"
3735 $opt_dry_run || $RM $removelist
3736 func_append removelist " $lockfile"
3737 trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
3739 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
3740 srcfile=$func_to_tool_file_result
3741 func_quote_arg pretty "$srcfile"
3742 qsrcfile=$func_quote_arg_result
3744 # Only build a PIC object if we are building libtool libraries.
3745 if test yes = "$build_libtool_libs"; then
3746 # Without this assignment, base_compile gets emptied.
3747 fbsd_hideous_sh_bug=$base_compile
3749 if test no != "$pic_mode"; then
3750 command="$base_compile $qsrcfile $pic_flag"
3752 # Don't build PIC code
3753 command="$base_compile $qsrcfile"
3756 func_mkdir_p "$xdir$objdir"
3758 if test -z "$output_obj"; then
3759 # Place PIC objects in $objdir
3760 func_append command " -o $lobj"
3763 func_show_eval_locale "$command" \
3764 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
3766 if test warn = "$need_locks" &&
3767 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
3769 *** ERROR, $lockfile contains:
3770 `cat $lockfile 2>/dev/null`
3772 but it should contain:
3775 This indicates that another process is trying to use the same
3776 temporary object file, and libtool could not work around it because
3777 your compiler does not support '-c' and '-o' together. If you
3778 repeat this compilation, it may succeed, by chance, but you had better
3779 avoid parallel builds (make -j) in this platform, or get a better
3782 $opt_dry_run || $RM $removelist
3786 # Just move the object if needed, then go on to compile the next one
3787 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
3788 func_show_eval '$MV "$output_obj" "$lobj"' \
3789 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
3792 # Allow error messages only from the first compilation.
3793 if test yes = "$suppress_opt"; then
3794 suppress_output=' >/dev/null 2>&1'
3798 # Only build a position-dependent object if we build old libraries.
3799 if test yes = "$build_old_libs"; then
3800 if test yes != "$pic_mode"; then
3801 # Don't build PIC code
3802 command="$base_compile $qsrcfile$pie_flag"
3804 command="$base_compile $qsrcfile $pic_flag"
3806 if test yes = "$compiler_c_o"; then
3807 func_append command " -o $obj"
3810 # Suppress compiler output if we already did a PIC compilation.
3811 func_append command "$suppress_output"
3812 func_show_eval_locale "$command" \
3813 '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
3815 if test warn = "$need_locks" &&
3816 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
3818 *** ERROR, $lockfile contains:
3819 `cat $lockfile 2>/dev/null`
3821 but it should contain:
3824 This indicates that another process is trying to use the same
3825 temporary object file, and libtool could not work around it because
3826 your compiler does not support '-c' and '-o' together. If you
3827 repeat this compilation, it may succeed, by chance, but you had better
3828 avoid parallel builds (make -j) in this platform, or get a better
3831 $opt_dry_run || $RM $removelist
3835 # Just move the object if needed
3836 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
3837 func_show_eval '$MV "$output_obj" "$obj"' \
3838 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
3843 func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
3845 # Unlock the critical section if it was locked
3846 if test no != "$need_locks"; then
3847 removelist=$lockfile
3856 test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
3861 # We need to display help for each of the modes.
3864 # Generic help is extracted from the usage comments
3865 # at the start of this file.
3871 "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
3873 Remove files from the build directory.
3875 RM is the name of the program to use to delete files associated with each FILE
3876 (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed
3879 If FILE is a libtool library, object or program, all the files associated
3880 with it are deleted. Otherwise, only FILE itself is deleted using RM."
3885 "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
3887 Compile a source file into a libtool library object.
3889 This mode accepts the following additional options:
3891 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
3892 -no-suppress do not suppress compiler output for multiple passes
3893 -prefer-pic try to build PIC objects only
3894 -prefer-non-pic try to build non-PIC objects only
3895 -shared do not build a '.o' file suitable for static linking
3896 -static only build a '.o' file suitable for static linking
3898 -Xcompiler FLAG pass FLAG directly to the compiler
3900 COMPILE-COMMAND is a command to be used in creating a 'standard' object file
3901 from the given SOURCEFILE.
3903 The output file name is determined by removing the directory component from
3904 SOURCEFILE, then substituting the C source code suffix '.c' with the
3905 library object suffix, '.lo'."
3910 "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
3912 Automatically set library path, then run a program.
3914 This mode accepts the following additional options:
3916 -dlopen FILE add the directory containing FILE to the library path
3918 This mode sets the library path environment variable according to '-dlopen'
3921 If any of the ARGS are libtool executable wrappers, then they are translated
3922 into their corresponding uninstalled binary, and any of their required library
3923 directories are added to the library path.
3925 Then, COMMAND is executed, with ARGS as arguments."
3930 "Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
3932 Complete the installation of libtool libraries.
3934 Each LIBDIR is a directory that contains libtool libraries.
3936 The commands that this mode executes may require superuser privileges. Use
3937 the '--dry-run' option if you just want to see what would be executed."
3942 "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
3944 Install executables or libraries.
3946 INSTALL-COMMAND is the installation command. The first component should be
3947 either the 'install' or 'cp' program.
3949 The following components of INSTALL-COMMAND are treated specially:
3951 -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
3953 The rest of the components are interpreted as arguments to that command (only
3954 BSD-compatible install options are recognized)."
3959 "Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
3961 Link object files or libraries together to form another library, or to
3962 create an executable program.
3964 LINK-COMMAND is a command using the C compiler that you would use to create
3965 a program from several object files.
3967 The following components of LINK-COMMAND are treated specially:
3969 -all-static do not do any dynamic linking at all
3970 -avoid-version do not add a version suffix if possible
3971 -bindir BINDIR specify path to binaries directory (for systems where
3972 libraries must be found in the PATH setting at runtime)
3973 -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime
3974 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
3975 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
3976 -export-symbols SYMFILE
3977 try to export only the symbols listed in SYMFILE
3978 -export-symbols-regex REGEX
3979 try to export only the symbols matching REGEX
3980 -LLIBDIR search LIBDIR for required installed libraries
3981 -lNAME OUTPUT-FILE requires the installed library libNAME
3982 -module build a library that can dlopened
3983 -no-fast-install disable the fast-install mode
3984 -no-install link a not-installable executable
3985 -no-undefined declare that a library does not refer to external symbols
3986 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
3987 -objectlist FILE use a list of object files found in FILE to specify objects
3988 -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes)
3989 -precious-files-regex REGEX
3990 don't remove output files matching REGEX
3991 -release RELEASE specify package release information
3992 -rpath LIBDIR the created library will eventually be installed in LIBDIR
3993 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
3994 -shared only do dynamic linking of libtool libraries
3995 -shrext SUFFIX override the standard shared library file extension
3996 -static do not do any dynamic linking of uninstalled libtool libraries
3997 -static-libtool-libs
3998 do not do any dynamic linking of libtool libraries
3999 -version-info CURRENT[:REVISION[:AGE]]
4000 specify library version info [each variable defaults to 0]
4001 -weak LIBNAME declare that the target provides the LIBNAME interface
4003 -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
4005 -Xassembler FLAG pass linker-specific FLAG directly to the assembler
4007 -Xlinker FLAG pass linker-specific FLAG directly to the linker
4008 -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
4010 All other options (arguments beginning with '-') are ignored.
4012 Every other argument is treated as a filename. Files ending in '.la' are
4013 treated as uninstalled libtool libraries, other files are standard or library
4016 If the OUTPUT-FILE ends in '.la', then a libtool library is created,
4017 only library objects ('.lo' files) may be specified, and '-rpath' is
4018 required, except when creating a convenience library.
4020 If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created
4021 using 'ar' and 'ranlib', or on Windows using 'lib'.
4023 If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
4024 is created, otherwise an executable program is created."
4029 "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
4031 Remove libraries from an installation directory.
4033 RM is the name of the program to use to delete files associated with each FILE
4034 (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed
4037 If FILE is a libtool library, all the files associated with it are deleted.
4038 Otherwise, only FILE itself is deleted using RM."
4042 func_fatal_help "invalid operation mode '$opt_mode'"
4047 $ECHO "Try '$progname --help' for more information about other modes."
4050 # Now that we've collected a possible --mode arg, show help if necessary
4052 if test : = "$opt_help"; then
4057 for opt_mode in compile link execute install finish uninstall clean; do
4060 } | $SED -n '1p; 2,$s/^Usage:/ or: /p'
4063 for opt_mode in compile link execute install finish uninstall clean; do
4069 /^When reporting/,/^Report/{
4074 /information about other modes/d
4075 /more detailed .*MODE/d
4076 s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
4082 # func_mode_execute arg...
4083 func_mode_execute ()
4087 # The first argument is the command name.
4090 func_fatal_help "you must specify a COMMAND"
4092 # Handle -dlopen flags immediately.
4093 for file in $opt_dlopen; do
4095 || func_fatal_help "'$file' is not a file"
4100 func_resolve_sysroot "$file"
4101 file=$func_resolve_sysroot_result
4103 # Check to see that this really is a libtool archive.
4104 func_lalib_unsafe_p "$file" \
4105 || func_fatal_help "'$lib' is not a valid libtool archive"
4107 # Read the libtool library.
4112 # Skip this library if it cannot be dlopened.
4113 if test -z "$dlname"; then
4114 # Warn if it was a shared library.
4115 test -n "$library_names" && \
4116 func_warning "'$file' was not linked with '-export-dynamic'"
4120 func_dirname "$file" "" "."
4121 dir=$func_dirname_result
4123 if test -f "$dir/$objdir/$dlname"; then
4124 func_append dir "/$objdir"
4126 if test ! -f "$dir/$dlname"; then
4127 func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
4133 # Just add the directory containing the .lo file.
4134 func_dirname "$file" "" "."
4135 dir=$func_dirname_result
4139 func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
4144 # Get the absolute pathname.
4145 absdir=`cd "$dir" && pwd`
4146 test -n "$absdir" && dir=$absdir
4148 # Now add the directory to shlibpath_var.
4149 if eval "test -z \"\$$shlibpath_var\""; then
4150 eval "$shlibpath_var=\"\$dir\""
4152 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
4156 # This variable tells wrapper scripts just to set shlibpath_var
4157 # rather than running their programs.
4158 libtool_execute_magic=$magic
4160 # Check if any of the arguments is a wrapper script.
4165 -* | *.la | *.lo ) ;;
4167 # Do a test to see if this is really a libtool program.
4168 if func_ltwrapper_script_p "$file"; then
4170 # Transform arg to wrapped name.
4171 file=$progdir/$program
4172 elif func_ltwrapper_executable_p "$file"; then
4173 func_ltwrapper_scriptname "$file"
4174 func_source "$func_ltwrapper_scriptname_result"
4175 # Transform arg to wrapped name.
4176 file=$progdir/$program
4180 # Quote arguments (to preserve shell metacharacters).
4181 func_append_quoted args "$file"
4184 if $opt_dry_run; then
4185 # Display what would be done.
4186 if test -n "$shlibpath_var"; then
4187 eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
4188 echo "export $shlibpath_var"
4193 if test -n "$shlibpath_var"; then
4194 # Export the shlibpath_var.
4195 eval "export $shlibpath_var"
4198 # Restore saved environment variables
4199 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
4201 eval "if test \"\${save_$lt_var+set}\" = set; then
4202 $lt_var=\$save_$lt_var; export $lt_var
4208 # Now prepare to actually exec the command.
4213 test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
4216 # func_mode_finish arg...
4225 for opt in "$nonopt" ${1+"$@"}
4227 if test -d "$opt"; then
4228 func_append libdirs " $opt"
4230 elif test -f "$opt"; then
4231 if func_lalib_unsafe_p "$opt"; then
4232 func_append libs " $opt"
4234 func_warning "'$opt' is not a valid libtool archive"
4238 func_fatal_error "invalid argument '$opt'"
4242 if test -n "$libs"; then
4243 if test -n "$lt_sysroot"; then
4244 sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
4245 sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
4250 # Remove sysroot references
4251 if $opt_dry_run; then
4252 for lib in $libs; do
4253 echo "removing references to $lt_sysroot and '=' prefixes from $lib"
4256 tmpdir=`func_mktempdir`
4257 for lib in $libs; do
4258 $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
4260 mv -f $tmpdir/tmp-la $lib
4266 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4267 for libdir in $libdirs; do
4268 if test -n "$finish_cmds"; then
4269 # Do each command in the finish commands.
4270 func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
4273 if test -n "$finish_eval"; then
4274 # Do the single finish_eval.
4275 eval cmds=\"$finish_eval\"
4276 $opt_dry_run || eval "$cmds" || func_append admincmds "
4282 # Exit here if they wanted silent mode.
4283 $opt_quiet && exit $EXIT_SUCCESS
4285 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4286 echo "----------------------------------------------------------------------"
4287 echo "Libraries have been installed in:"
4288 for libdir in $libdirs; do
4292 echo "If you ever happen to want to link against installed libraries"
4293 echo "in a given directory, LIBDIR, you must either use libtool, and"
4294 echo "specify the full pathname of the library, or use the '-LLIBDIR'"
4295 echo "flag during linking and do at least one of the following:"
4296 if test -n "$shlibpath_var"; then
4297 echo " - add LIBDIR to the '$shlibpath_var' environment variable"
4298 echo " during execution"
4300 if test -n "$runpath_var"; then
4301 echo " - add LIBDIR to the '$runpath_var' environment variable"
4302 echo " during linking"
4304 if test -n "$hardcode_libdir_flag_spec"; then
4306 eval flag=\"$hardcode_libdir_flag_spec\"
4308 $ECHO " - use the '$flag' linker flag"
4310 if test -n "$admincmds"; then
4311 $ECHO " - have your system administrator run these commands:$admincmds"
4313 if test -f /etc/ld.so.conf; then
4314 echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'"
4318 echo "See any operating system documentation about shared libraries for"
4320 solaris2.[6789]|solaris2.1[0-9])
4321 echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
4325 echo "more information, such as the ld(1) and ld.so(8) manual pages."
4328 echo "----------------------------------------------------------------------"
4333 test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
4336 # func_mode_install arg...
4337 func_mode_install ()
4341 # There may be an optional sh(1) argument at the beginning of
4342 # install_prog (especially on Windows NT).
4343 if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
4344 # Allow the use of GNU shtool's install command.
4345 case $nonopt in *shtool*) :;; *) false;; esac
4347 # Aesthetically quote it.
4348 func_quote_arg pretty "$nonopt"
4349 install_prog="$func_quote_arg_result "
4357 # The real first argument should be the name of the installation program.
4358 # Aesthetically quote it.
4359 func_quote_arg pretty "$arg"
4360 func_append install_prog "$func_quote_arg_result"
4361 install_shared_prog=$install_prog
4362 case " $install_prog " in
4363 *[\\\ /]cp\ *) install_cp=: ;;
4364 *) install_cp=false ;;
4367 # We need to accept at least all the BSD install flags.
4379 if test -n "$dest"; then
4380 func_append files " $dest"
4388 if $install_cp; then :; else
4402 # If the previous option needed an argument, then skip it.
4403 if test -n "$prev"; then
4404 if test X-m = "X$prev" && test -n "$install_override_mode"; then
4405 arg2=$install_override_mode
4416 # Aesthetically quote the argument.
4417 func_quote_arg pretty "$arg"
4418 func_append install_prog " $func_quote_arg_result"
4419 if test -n "$arg2"; then
4420 func_quote_arg pretty "$arg2"
4422 func_append install_shared_prog " $func_quote_arg_result"
4425 test -z "$install_prog" && \
4426 func_fatal_help "you must specify an install program"
4428 test -n "$prev" && \
4429 func_fatal_help "the '$prev' option requires an argument"
4431 if test -n "$install_override_mode" && $no_mode; then
4432 if $install_cp; then :; else
4433 func_quote_arg pretty "$install_override_mode"
4434 func_append install_shared_prog " -m $func_quote_arg_result"
4438 if test -z "$files"; then
4439 if test -z "$dest"; then
4440 func_fatal_help "no file or destination specified"
4442 func_fatal_help "you must specify a destination"
4446 # Strip any trailing slash from the destination.
4447 func_stripname '' '/' "$dest"
4448 dest=$func_stripname_result
4450 # Check to see that the destination is a directory.
4451 test -d "$dest" && isdir=:
4456 func_dirname_and_basename "$dest" "" "."
4457 destdir=$func_dirname_result
4458 destname=$func_basename_result
4460 # Not a directory, so check to see that there is only one file specified.
4461 set dummy $files; shift
4462 test "$#" -gt 1 && \
4463 func_fatal_help "'$dest' is not a directory"
4466 [\\/]* | [A-Za-z]:[\\/]*) ;;
4468 for file in $files; do
4472 func_fatal_help "'$destdir' must be an absolute directory name"
4479 # This variable tells wrapper scripts just to set variables rather
4480 # than running their programs.
4481 libtool_install_magic=$magic
4486 for file in $files; do
4488 # Do each installation.
4491 # Do the static libraries later.
4492 func_append staticlibs " $file"
4496 func_resolve_sysroot "$file"
4497 file=$func_resolve_sysroot_result
4499 # Check to see that this really is a libtool archive.
4500 func_lalib_unsafe_p "$file" \
4501 || func_fatal_help "'$file' is not a valid libtool archive"
4508 # Add the libdir to current_libdirs if it is the destination.
4509 if test "X$destdir" = "X$libdir"; then
4510 case "$current_libdirs " in
4512 *) func_append current_libdirs " $libdir" ;;
4515 # Note the libdir as a future libdir.
4516 case "$future_libdirs " in
4518 *) func_append future_libdirs " $libdir" ;;
4522 func_dirname "$file" "/" ""
4523 dir=$func_dirname_result
4524 func_append dir "$objdir"
4526 if test -n "$relink_command"; then
4527 # Determine the prefix the user has applied to our future dir.
4528 inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
4530 # Don't allow the user to place us outside of our expected
4531 # location b/c this prevents finding dependent libraries that
4532 # are installed to the same prefix.
4533 # At present, this check doesn't affect windows .dll's that
4534 # are installed into $libdir/../bin (currently, that works fine)
4535 # but it's something to keep an eye on.
4536 test "$inst_prefix_dir" = "$destdir" && \
4537 func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
4539 if test -n "$inst_prefix_dir"; then
4540 # Stick the inst_prefix_dir data into the link command.
4541 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
4543 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
4546 func_warning "relinking '$file'"
4547 func_show_eval "$relink_command" \
4548 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
4551 # See the names of the shared library.
4552 set dummy $library_names; shift
4553 if test -n "$1"; then
4558 test -n "$relink_command" && srcname=${realname}T
4560 # Install the shared library and build the symlinks.
4561 func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
4565 cygwin* | mingw* | pw32* | cegcc*)
4580 if test -n "$tstripme" && test -n "$striplib"; then
4581 func_show_eval "$striplib $destdir/$realname" 'exit $?'
4584 if test "$#" -gt 0; then
4585 # Delete the old symlinks, and create new ones.
4586 # Try 'ln -sf' first, because the 'ln' binary might depend on
4587 # the symlink we replace! Solaris /bin/ln does not understand -f,
4588 # so we also need to try rm && ln -s.
4591 test "$linkname" != "$realname" \
4592 && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
4596 # Do each command in the postinstall commands.
4597 lib=$destdir/$realname
4598 func_execute_cmds "$postinstall_cmds" 'exit $?'
4601 # Install the pseudo-library for information purposes.
4602 func_basename "$file"
4603 name=$func_basename_result
4604 instname=$dir/${name}i
4605 func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
4607 # Maybe install the static library, too.
4608 test -n "$old_library" && func_append staticlibs " $dir/$old_library"
4612 # Install (i.e. copy) a libtool object.
4614 # Figure out destination file name, if it wasn't already specified.
4615 if test -n "$destname"; then
4616 destfile=$destdir/$destname
4618 func_basename "$file"
4619 destfile=$func_basename_result
4620 destfile=$destdir/$destfile
4623 # Deduce the name of the destination old-style object file.
4626 func_lo2o "$destfile"
4627 staticdest=$func_lo2o_result
4630 staticdest=$destfile
4634 func_fatal_help "cannot copy a libtool object to '$destfile'"
4638 # Install the libtool object if requested.
4639 test -n "$destfile" && \
4640 func_show_eval "$install_prog $file $destfile" 'exit $?'
4642 # Install the old object if enabled.
4643 if test yes = "$build_old_libs"; then
4644 # Deduce the name of the old-style object file.
4646 staticobj=$func_lo2o_result
4647 func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
4653 # Figure out destination file name, if it wasn't already specified.
4654 if test -n "$destname"; then
4655 destfile=$destdir/$destname
4657 func_basename "$file"
4658 destfile=$func_basename_result
4659 destfile=$destdir/$destfile
4662 # If the file is missing, and there is a .exe on the end, strip it
4663 # because it is most likely a libtool script we actually want to
4668 if test ! -f "$file"; then
4669 func_stripname '' '.exe' "$file"
4670 file=$func_stripname_result
4676 # Do a test to see if this is really a libtool program.
4679 if func_ltwrapper_executable_p "$file"; then
4680 func_ltwrapper_scriptname "$file"
4681 wrapper=$func_ltwrapper_scriptname_result
4683 func_stripname '' '.exe' "$file"
4684 wrapper=$func_stripname_result
4691 if func_ltwrapper_script_p "$wrapper"; then
4695 func_source "$wrapper"
4697 # Check the variables that should have been set.
4698 test -z "$generated_by_libtool_version" && \
4699 func_fatal_error "invalid libtool wrapper script '$wrapper'"
4702 for lib in $notinst_deplibs; do
4703 # Check to see that each library is installed.
4705 if test -f "$lib"; then
4708 libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
4709 if test -n "$libdir" && test ! -f "$libfile"; then
4710 func_warning "'$lib' has not been installed in '$libdir'"
4716 func_source "$wrapper"
4719 if test no = "$fast_install" && test -n "$relink_command"; then
4722 tmpdir=`func_mktempdir`
4723 func_basename "$file$stripped_ext"
4724 file=$func_basename_result
4725 outputname=$tmpdir/$file
4726 # Replace the output file specification.
4727 relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
4730 func_quote_arg expand,pretty "$relink_command"
4731 eval "func_echo $func_quote_arg_result"
4733 if eval "$relink_command"; then :
4735 func_error "error: relink '$file' with the above command before installing it"
4736 $opt_dry_run || ${RM}r "$tmpdir"
4741 func_warning "cannot relink '$file'"
4745 # Install the binary that we compiled earlier.
4746 file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
4750 # remove .exe since cygwin /usr/bin/install will append another
4752 case $install_prog,$host in
4753 */usr/bin/install*,*cygwin*)
4754 case $file:$destfile in
4759 destfile=$destfile.exe
4762 func_stripname '' '.exe' "$destfile"
4763 destfile=$func_stripname_result
4768 func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
4769 $opt_dry_run || if test -n "$outputname"; then
4776 for file in $staticlibs; do
4777 func_basename "$file"
4778 name=$func_basename_result
4780 # Set up the ranlib parameters.
4781 oldlib=$destdir/$name
4782 func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
4783 tool_oldlib=$func_to_tool_file_result
4785 func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
4787 if test -n "$stripme" && test -n "$old_striplib"; then
4788 func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
4791 # Do each command in the postinstall commands.
4792 func_execute_cmds "$old_postinstall_cmds" 'exit $?'
4795 test -n "$future_libdirs" && \
4796 func_warning "remember to run '$progname --finish$future_libdirs'"
4798 if test -n "$current_libdirs"; then
4799 # Maybe just do a dry run.
4800 $opt_dry_run && current_libdirs=" -n$current_libdirs"
4801 exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
4807 test install = "$opt_mode" && func_mode_install ${1+"$@"}
4810 # func_generate_dlsyms outputname originator pic_p
4811 # Extract symbols from dlprefiles and create ${outputname}S.o with
4812 # a dlpreopen symbol table.
4813 func_generate_dlsyms ()
4820 my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`
4823 if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
4824 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4825 my_dlsyms=${my_outputname}S.c
4827 func_error "not configured to extract global symbols from dlpreopened files"
4831 if test -n "$my_dlsyms"; then
4835 # Discover the nlist of each of the dlfiles.
4836 nlist=$output_objdir/$my_outputname.nm
4838 func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
4840 # Parse the name list into a source file.
4841 func_verbose "creating $output_objdir/$my_dlsyms"
4843 $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
4844 /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
4845 /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
4851 #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
4852 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
4855 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
4856 #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
4857 /* DATA imports from DLLs on WIN32 can't be const, because runtime
4858 relocations are performed -- see ld's documentation on pseudo-relocs. */
4859 # define LT_DLSYM_CONST
4860 #elif defined __osf__
4861 /* This system does not cope well with relocations in const data. */
4862 # define LT_DLSYM_CONST
4864 # define LT_DLSYM_CONST const
4867 #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
4869 /* External symbol declarations for the compiler. */\
4872 if test yes = "$dlself"; then
4873 func_verbose "generating symbol list for '$output'"
4875 $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
4877 # Add our own program objects to the symbol list.
4878 progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
4879 for progfile in $progfiles; do
4880 func_to_tool_file "$progfile" func_convert_file_msys_to_w32
4881 func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
4882 $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
4885 if test -n "$exclude_expsyms"; then
4887 eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4888 eval '$MV "$nlist"T "$nlist"'
4892 if test -n "$export_symbols_regex"; then
4894 eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4895 eval '$MV "$nlist"T "$nlist"'
4899 # Prepare the list of exported symbols
4900 if test -z "$export_symbols"; then
4901 export_symbols=$output_objdir/$outputname.exp
4904 eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4906 *cygwin* | *mingw* | *cegcc* )
4907 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4908 eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
4914 eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4915 eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4916 eval '$MV "$nlist"T "$nlist"'
4918 *cygwin* | *mingw* | *cegcc* )
4919 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4920 eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
4927 for dlprefile in $dlprefiles; do
4928 func_verbose "extracting global C symbols from '$dlprefile'"
4929 func_basename "$dlprefile"
4930 name=$func_basename_result
4932 *cygwin* | *mingw* | *cegcc* )
4933 # if an import library, we need to obtain dlname
4934 if func_win32_import_lib_p "$dlprefile"; then
4935 func_tr_sh "$dlprefile"
4936 eval "curr_lafile=\$libfile_$func_tr_sh_result"
4937 dlprefile_dlbasename=
4938 if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
4939 # Use subshell, to avoid clobbering current variable values
4940 dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
4941 if test -n "$dlprefile_dlname"; then
4942 func_basename "$dlprefile_dlname"
4943 dlprefile_dlbasename=$func_basename_result
4945 # no lafile. user explicitly requested -dlpreopen <import library>.
4946 $sharedlib_from_linklib_cmd "$dlprefile"
4947 dlprefile_dlbasename=$sharedlib_from_linklib_result
4951 if test -n "$dlprefile_dlbasename"; then
4952 eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
4954 func_warning "Could not compute DLL name from $name"
4955 eval '$ECHO ": $name " >> "$nlist"'
4957 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
4958 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
4959 $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
4961 else # not an import lib
4963 eval '$ECHO ": $name " >> "$nlist"'
4964 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
4965 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
4971 eval '$ECHO ": $name " >> "$nlist"'
4972 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
4973 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
4980 # Make sure we have at least an empty file.
4981 test -f "$nlist" || : > "$nlist"
4983 if test -n "$exclude_expsyms"; then
4984 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4985 $MV "$nlist"T "$nlist"
4988 # Try sorting and uniquifying the output.
4989 if $GREP -v "^: " < "$nlist" |
4990 if sort -k 3 </dev/null >/dev/null 2>&1; then
4995 uniq > "$nlist"S; then
4998 $GREP -v "^: " < "$nlist" > "$nlist"S
5001 if test -f "$nlist"S; then
5002 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
5004 echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
5007 func_show_eval '$RM "${nlist}I"'
5008 if test -n "$global_symbol_to_import"; then
5009 eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
5012 echo >> "$output_objdir/$my_dlsyms" "\
5014 /* The mapping between symbol names and symbols. */
5019 extern LT_DLSYM_CONST lt_dlsymlist
5020 lt_${my_prefix}_LTX_preloaded_symbols[];\
5023 if test -s "$nlist"I; then
5024 echo >> "$output_objdir/$my_dlsyms" "\
5025 static void lt_syminit(void)
5027 LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
5028 for (; symbol->name; ++symbol)
5030 $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
5031 echo >> "$output_objdir/$my_dlsyms" "\
5035 echo >> "$output_objdir/$my_dlsyms" "\
5036 LT_DLSYM_CONST lt_dlsymlist
5037 lt_${my_prefix}_LTX_preloaded_symbols[] =
5038 { {\"$my_originator\", (void *) 0},"
5040 if test -s "$nlist"I; then
5041 echo >> "$output_objdir/$my_dlsyms" "\
5042 {\"@INIT@\", (void *) <_syminit},"
5045 case $need_lib_prefix in
5047 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
5050 eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
5053 echo >> "$output_objdir/$my_dlsyms" "\
5057 /* This works around a problem in FreeBSD linker */
5058 #ifdef FREEBSD_WORKAROUND
5059 static const void *lt_preloaded_setup() {
5060 return lt_${my_prefix}_LTX_preloaded_symbols;
5070 pic_flag_for_symtable=
5071 case "$compile_command " in
5075 # compiling the symbol table file with pic_flag works around
5076 # a FreeBSD bug that causes programs to crash when -lm is
5077 # linked before any other PIC object. But we must not use
5078 # pic_flag when linking with -static. The problem exists in
5079 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
5080 *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
5081 pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
5083 pic_flag_for_symtable=" $pic_flag" ;;
5085 $my_pic_p && pic_flag_for_symtable=" $pic_flag"
5091 for arg in $LTCFLAGS; do
5093 -pie | -fpie | -fPIE) ;;
5094 *) func_append symtab_cflags " $arg" ;;
5098 # Now compile the dynamic symbol file.
5099 func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
5101 # Clean up the generated files.
5102 func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
5104 # Transform the symbol file into the correct name.
5105 symfileobj=$output_objdir/${my_outputname}S.$objext
5107 *cygwin* | *mingw* | *cegcc* )
5108 if test -f "$output_objdir/$my_outputname.def"; then
5109 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
5110 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
5112 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
5113 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
5117 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
5118 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
5123 func_fatal_error "unknown suffix for '$my_dlsyms'"
5127 # We keep going just in case the user didn't refer to
5128 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
5129 # really was required.
5131 # Nullify the symbol file.
5132 compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
5133 finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
5137 # func_cygming_gnu_implib_p ARG
5138 # This predicate returns with zero status (TRUE) if
5139 # ARG is a GNU/binutils-style import library. Returns
5140 # with nonzero status (FALSE) otherwise.
5141 func_cygming_gnu_implib_p ()
5145 func_to_tool_file "$1" func_convert_file_msys_to_w32
5146 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
5147 test -n "$func_cygming_gnu_implib_tmp"
5150 # func_cygming_ms_implib_p ARG
5151 # This predicate returns with zero status (TRUE) if
5152 # ARG is an MS-style import library. Returns
5153 # with nonzero status (FALSE) otherwise.
5154 func_cygming_ms_implib_p ()
5158 func_to_tool_file "$1" func_convert_file_msys_to_w32
5159 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
5160 test -n "$func_cygming_ms_implib_tmp"
5163 # func_win32_libid arg
5164 # return the library type of file 'arg'
5166 # Need a lot of goo to handle *both* DLLs and import libs
5167 # Has to be a shell function in order to 'eat' the argument
5168 # that is supplied when $file_magic_command is called.
5169 # Despite the name, also deal with 64 bit binaries.
5174 win32_libid_type=unknown
5175 win32_fileres=`file -L $1 2>/dev/null`
5176 case $win32_fileres in
5177 *ar\ archive\ import\ library*) # definitely import
5178 win32_libid_type="x86 archive import"
5180 *ar\ archive*) # could be an import, or static
5181 # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
5182 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
5183 $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
5184 case $nm_interface in
5186 if func_cygming_ms_implib_p "$1" ||
5187 func_cygming_gnu_implib_p "$1"
5195 func_to_tool_file "$1" func_convert_file_msys_to_w32
5196 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
5207 case $win32_nmres in
5208 import*) win32_libid_type="x86 archive import";;
5209 *) win32_libid_type="x86 archive static";;
5214 win32_libid_type="x86 DLL"
5216 *executable*) # but shell scripts are "executable" too...
5217 case $win32_fileres in
5218 *MS\ Windows\ PE\ Intel*)
5219 win32_libid_type="x86 DLL"
5224 $ECHO "$win32_libid_type"
5227 # func_cygming_dll_for_implib ARG
5229 # Platform-specific function to extract the
5230 # name of the DLL associated with the specified
5231 # import library ARG.
5232 # Invoked by eval'ing the libtool variable
5233 # $sharedlib_from_linklib_cmd
5234 # Result is available in the variable
5235 # $sharedlib_from_linklib_result
5236 func_cygming_dll_for_implib ()
5240 sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
5243 # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
5245 # The is the core of a fallback implementation of a
5246 # platform-specific function to extract the name of the
5247 # DLL associated with the specified import library LIBNAME.
5249 # SECTION_NAME is either .idata$6 or .idata$7, depending
5250 # on the platform and compiler that created the implib.
5252 # Echos the name of the DLL associated with the
5253 # specified import library.
5254 func_cygming_dll_for_implib_fallback_core ()
5258 match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
5259 $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
5260 $SED '/^Contents of section '"$match_literal"':/{
5261 # Place marker at beginning of archive member dllname section
5266 # These lines can sometimes be longer than 43 characters, but
5267 # are always uninteresting
5268 /:[ ]*file format pe[i]\{,1\}-/d
5269 /^In archive [^:]*:/d
5270 # Ensure marker is printed
5272 # Remove all lines with less than 43 characters
5274 # From remaining lines, remove first 43 characters
5277 # Join marker and all lines until next marker into a single line
5278 /^====MARK====/ b para
5287 # Remove trailing dots and whitespace
5291 # we now have a list, one entry per line, of the stringified
5292 # contents of the appropriate section of all members of the
5293 # archive that possess that section. Heuristic: eliminate
5294 # all those that have a first or second character that is
5295 # a '.' (that is, objdump's representation of an unprintable
5296 # character.) This should work for all archives with less than
5297 # 0x302f exports -- but will fail for DLLs whose name actually
5298 # begins with a literal '.' or a single character followed by
5301 # Of those that remain, print the first one.
5302 $SED -e '/^\./d;/^.\./d;q'
5305 # func_cygming_dll_for_implib_fallback ARG
5306 # Platform-specific function to extract the
5307 # name of the DLL associated with the specified
5308 # import library ARG.
5310 # This fallback implementation is for use when $DLLTOOL
5311 # does not support the --identify-strict option.
5312 # Invoked by eval'ing the libtool variable
5313 # $sharedlib_from_linklib_cmd
5314 # Result is available in the variable
5315 # $sharedlib_from_linklib_result
5316 func_cygming_dll_for_implib_fallback ()
5320 if func_cygming_gnu_implib_p "$1"; then
5321 # binutils import library
5322 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
5323 elif func_cygming_ms_implib_p "$1"; then
5324 # ms-generated import library
5325 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
5328 sharedlib_from_linklib_result=
5333 # func_extract_an_archive dir oldlib
5334 func_extract_an_archive ()
5338 f_ex_an_ar_dir=$1; shift
5339 f_ex_an_ar_oldlib=$1
5340 if test yes = "$lock_old_archive_extraction"; then
5341 lockfile=$f_ex_an_ar_oldlib.lock
5342 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
5343 func_echo "Waiting for $lockfile to be removed"
5347 func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
5348 'stat=$?; rm -f "$lockfile"; exit $stat'
5349 if test yes = "$lock_old_archive_extraction"; then
5350 $opt_dry_run || rm -f "$lockfile"
5352 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
5355 func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
5360 # func_extract_archives gentop oldlib ...
5361 func_extract_archives ()
5366 my_oldlibs=${1+"$@"}
5372 for my_xlib in $my_oldlibs; do
5373 # Extract the objects.
5375 [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
5376 *) my_xabs=`pwd`"/$my_xlib" ;;
5378 func_basename "$my_xlib"
5379 my_xlib=$func_basename_result
5382 case " $extracted_archives " in
5384 func_arith $extracted_serial + 1
5385 extracted_serial=$func_arith_result
5386 my_xlib_u=lt$extracted_serial-$my_xlib ;;
5390 extracted_archives="$extracted_archives $my_xlib_u"
5391 my_xdir=$my_gentop/$my_xlib_u
5393 func_mkdir_p "$my_xdir"
5397 func_verbose "Extracting $my_xabs"
5398 # Do not bother doing anything if just a dry run
5400 darwin_orig_dir=`pwd`
5401 cd $my_xdir || exit $?
5402 darwin_archive=$my_xabs
5404 func_basename "$darwin_archive"
5405 darwin_base_archive=$func_basename_result
5406 darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
5407 if test -n "$darwin_arches"; then
5408 darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
5410 func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
5411 for darwin_arch in $darwin_arches; do
5412 func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
5413 $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
5414 cd "unfat-$$/$darwin_base_archive-$darwin_arch"
5415 func_extract_an_archive "`pwd`" "$darwin_base_archive"
5417 $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
5418 done # $darwin_arches
5419 ## Okay now we've a bunch of thin objects, gotta fatten them up :)
5420 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u`
5423 for darwin_file in $darwin_filelist; do
5424 darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
5425 $LIPO -create -output "$darwin_file" $darwin_files
5426 done # $darwin_filelist
5428 cd "$darwin_orig_dir"
5431 func_extract_an_archive "$my_xdir" "$my_xabs"
5436 func_extract_an_archive "$my_xdir" "$my_xabs"
5439 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
5442 func_extract_archives_result=$my_oldobjs
5446 # func_emit_wrapper [arg=no]
5448 # Emit a libtool wrapper script on stdout.
5449 # Don't directly open a file because we may want to
5450 # incorporate the script contents within a cygwin/mingw
5451 # wrapper executable. Must ONLY be called from within
5452 # func_mode_link because it depends on a number of variables
5455 # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
5456 # variable will take. If 'yes', then the emitted script
5457 # will assume that the directory where it is stored is
5458 # the $objdir directory. This is a cygwin/mingw-specific
5460 func_emit_wrapper ()
5462 func_emit_wrapper_arg1=${1-no}
5467 # $output - temporary wrapper script for $objdir/$outputname
5468 # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
5470 # The $output program cannot be directly executed until all the libtool
5471 # libraries that it depends on are installed.
5473 # This wrapper script should never be moved out of the build directory.
5474 # If it is, it will not operate correctly.
5476 # Sed substitution that helps us do robust quoting. It backslashifies
5477 # metacharacters that are still active within double-quoted strings.
5478 sed_quote_subst='$sed_quote_subst'
5480 # Be Bourne compatible
5481 if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
5484 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
5485 # is contrary to our usage. Disable this feature.
5486 alias -g '\${1+\"\$@\"}'='\"\$@\"'
5487 setopt NO_GLOB_SUBST
5489 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
5491 BIN_SH=xpg4; export BIN_SH # for Tru64
5492 DUALCASE=1; export DUALCASE # for MKS sh
5494 # The HP-UX ksh and POSIX shell print the target directory to stdout
5496 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5498 relink_command=\"$relink_command\"
5500 # This environment variable determines our operation mode.
5501 if test \"\$libtool_install_magic\" = \"$magic\"; then
5502 # install mode needs the following variables:
5503 generated_by_libtool_version='$macro_version'
5504 notinst_deplibs='$notinst_deplibs'
5506 # When we are sourced in execute mode, \$file and \$ECHO are already set.
5507 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5510 func_quote_arg pretty "$ECHO"
5511 qECHO=$func_quote_arg_result
5514 # A function that is used when there is no print builtin or printf.
5515 func_fallback_echo ()
5517 eval 'cat <<_LTECHO_EOF
5524 # Very basic option parsing. These options are (a) specific to
5525 # the libtool wrapper, (b) are identical between the wrapper
5526 # /script/ and the wrapper /executable/ that is used only on
5527 # windows platforms, and (c) all begin with the string "--lt-"
5528 # (application programs are unlikely to have options that match
5531 # There are only two supported options: --lt-debug and
5532 # --lt-dump-script. There is, deliberately, no --lt-help.
5534 # The first argument to this parsing function should be the
5535 # script's $0 value, followed by "$@".
5537 func_parse_lt_options ()
5543 case \"\$lt_opt\" in
5544 --lt-debug) lt_option_debug=1 ;;
5546 lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
5547 test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
5548 lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
5549 cat \"\$lt_dump_D/\$lt_dump_F\"
5553 \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
5559 # Print the debug banner immediately:
5560 if test -n \"\$lt_option_debug\"; then
5561 echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
5565 # Used when --lt-debug. Prints its arguments to stdout
5566 # (redirection is the responsibility of the caller)
5567 func_lt_dump_args ()
5572 \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
5573 lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
5577 # Core function for launching the target application
5578 func_exec_program_core ()
5582 # Backslashes separate directories on plain windows
5583 *-*-mingw | *-*-os2* | *-cegcc*)
5585 if test -n \"\$lt_option_debug\"; then
5586 \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
5587 func_lt_dump_args \${1+\"\$@\"} 1>&2
5589 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
5595 if test -n \"\$lt_option_debug\"; then
5596 \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
5597 func_lt_dump_args \${1+\"\$@\"} 1>&2
5599 exec \"\$progdir/\$program\" \${1+\"\$@\"}
5604 \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
5608 # A function to encapsulate launching the target application
5609 # Strips options in the --lt-* namespace from \$@ and
5610 # launches target application with the remaining arguments.
5611 func_exec_program ()
5619 *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
5624 func_exec_program_core \${1+\"\$@\"}
5628 func_parse_lt_options \"\$0\" \${1+\"\$@\"}
5630 # Find the directory that this script lives in.
5631 thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
5632 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5634 # Follow symbolic links until we get to the real thisdir.
5635 file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
5636 while test -n \"\$file\"; do
5637 destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
5639 # If there was a directory component, then change thisdir.
5640 if test \"x\$destdir\" != \"x\$file\"; then
5641 case \"\$destdir\" in
5642 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5643 *) thisdir=\"\$thisdir/\$destdir\" ;;
5647 file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
5648 file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
5651 # Usually 'no', except on cygwin/mingw when embedded into
5653 WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
5654 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
5655 # special case for '.'
5656 if test \"\$thisdir\" = \".\"; then
5659 # remove .libs from thisdir
5660 case \"\$thisdir\" in
5661 *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
5662 $objdir ) thisdir=. ;;
5666 # Try to get the absolute directory name.
5667 absdir=\`cd \"\$thisdir\" && pwd\`
5668 test -n \"\$absdir\" && thisdir=\"\$absdir\"
5671 if test yes = "$fast_install"; then
5673 program=lt-'$outputname'$exeext
5674 progdir=\"\$thisdir/$objdir\"
5676 if test ! -f \"\$progdir/\$program\" ||
5677 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\
5678 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5680 file=\"\$\$-\$program\"
5682 if test ! -d \"\$progdir\"; then
5683 $MKDIR \"\$progdir\"
5685 $RM \"\$progdir/\$file\"
5690 # relink executable if necessary
5691 if test -n \"\$relink_command\"; then
5692 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5694 \$ECHO \"\$relink_command_output\" >&2
5695 $RM \"\$progdir/\$file\"
5700 $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5701 { $RM \"\$progdir/\$program\";
5702 $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5703 $RM \"\$progdir/\$file\"
5707 program='$outputname'
5708 progdir=\"\$thisdir/$objdir\"
5714 if test -f \"\$progdir/\$program\"; then"
5716 # fixup the dll searchpath if we need to.
5718 # Fix the DLL searchpath if we need to. Do this before prepending
5719 # to shlibpath, because on Windows, both are PATH and uninstalled
5720 # libraries must come first.
5721 if test -n "$dllsearchpath"; then
5723 # Add the dll search path components to the executable PATH
5724 PATH=$dllsearchpath:\$PATH
5728 # Export our shlibpath_var if we have one.
5729 if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5731 # Add our own library path to $shlibpath_var
5732 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5734 # Some systems cannot cope with colon-terminated $shlibpath_var
5735 # The second colon is a workaround for a bug in BeOS R4 sed
5736 $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
5738 export $shlibpath_var
5743 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5744 # Run the actual program with our arguments.
5745 func_exec_program \${1+\"\$@\"}
5748 # The program doesn't exist.
5749 \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2
5750 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
5751 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
5759 # func_emit_cwrapperexe_src
5760 # emit the source code for a wrapper executable on stdout
5761 # Must ONLY be called from within func_mode_link because
5762 # it depends on a number of variable set therein.
5763 func_emit_cwrapperexe_src ()
5767 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
5768 Generated by $PROGRAM (GNU $PACKAGE) $VERSION
5770 The $output program cannot be directly executed until all the libtool
5771 libraries that it depends on are installed.
5773 This wrapper executable should never be moved out of the build directory.
5774 If it is, it will not operate correctly.
5779 # define _CRT_SECURE_NO_DEPRECATE 1
5784 # include <direct.h>
5785 # include <process.h>
5788 # include <unistd.h>
5789 # include <stdint.h>
5801 #include <sys/stat.h>
5803 #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
5805 /* declarations of non-ANSI functions */
5806 #if defined __MINGW32__
5807 # ifdef __STRICT_ANSI__
5808 int _putenv (const char *);
5810 #elif defined __CYGWIN__
5811 # ifdef __STRICT_ANSI__
5812 char *realpath (const char *, char *);
5813 int putenv (char *);
5814 int setenv (const char *, const char *, int);
5816 /* #elif defined other_platform || defined ... */
5819 /* portability defines, excluding path handling macros */
5820 #if defined _MSC_VER
5821 # define setmode _setmode
5823 # define chmod _chmod
5824 # define getcwd _getcwd
5825 # define putenv _putenv
5826 # define S_IXUSR _S_IEXEC
5827 #elif defined __MINGW32__
5828 # define setmode _setmode
5830 # define chmod _chmod
5831 # define getcwd _getcwd
5832 # define putenv _putenv
5833 #elif defined __CYGWIN__
5834 # define HAVE_SETENV
5835 # define FOPEN_WB "wb"
5836 /* #elif defined other platforms ... */
5839 #if defined PATH_MAX
5840 # define LT_PATHMAX PATH_MAX
5841 #elif defined MAXPATHLEN
5842 # define LT_PATHMAX MAXPATHLEN
5844 # define LT_PATHMAX 1024
5854 /* path handling portability macros */
5855 #ifndef DIR_SEPARATOR
5856 # define DIR_SEPARATOR '/'
5857 # define PATH_SEPARATOR ':'
5860 #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
5862 # define HAVE_DOS_BASED_FILE_SYSTEM
5863 # define FOPEN_WB "wb"
5864 # ifndef DIR_SEPARATOR_2
5865 # define DIR_SEPARATOR_2 '\\'
5867 # ifndef PATH_SEPARATOR_2
5868 # define PATH_SEPARATOR_2 ';'
5872 #ifndef DIR_SEPARATOR_2
5873 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
5874 #else /* DIR_SEPARATOR_2 */
5875 # define IS_DIR_SEPARATOR(ch) \
5876 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
5877 #endif /* DIR_SEPARATOR_2 */
5879 #ifndef PATH_SEPARATOR_2
5880 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
5881 #else /* PATH_SEPARATOR_2 */
5882 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
5883 #endif /* PATH_SEPARATOR_2 */
5886 # define FOPEN_WB "w"
5889 # define _O_BINARY 0
5892 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
5893 #define XFREE(stale) do { \
5894 if (stale) { free (stale); stale = 0; } \
5897 #if defined LT_DEBUGWRAPPER
5898 static int lt_debug = 1;
5900 static int lt_debug = 0;
5903 const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
5905 void *xmalloc (size_t num);
5906 char *xstrdup (const char *string);
5907 const char *base_name (const char *name);
5908 char *find_executable (const char *wrapper);
5909 char *chase_symlinks (const char *pathspec);
5910 int make_executable (const char *path);
5911 int check_executable (const char *path);
5912 char *strendzap (char *str, const char *pat);
5913 void lt_debugprintf (const char *file, int line, const char *fmt, ...);
5914 void lt_fatal (const char *file, int line, const char *message, ...);
5915 static const char *nonnull (const char *s);
5916 static const char *nonempty (const char *s);
5917 void lt_setenv (const char *name, const char *value);
5918 char *lt_extend_str (const char *orig_value, const char *add, int to_end);
5919 void lt_update_exe_path (const char *name, const char *value);
5920 void lt_update_lib_path (const char *name, const char *value);
5921 char **prepare_spawn (char **argv);
5922 void lt_dump_script (FILE *f);
5926 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
5927 # define externally_visible volatile
5929 # define externally_visible __attribute__((externally_visible)) volatile
5931 externally_visible const char * MAGIC_EXE = "$magic_exe";
5932 const char * LIB_PATH_VARNAME = "$shlibpath_var";
5935 if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5936 func_to_host_path "$temp_rpath"
5938 const char * LIB_PATH_VALUE = "$func_to_host_path_result";
5942 const char * LIB_PATH_VALUE = "";
5946 if test -n "$dllsearchpath"; then
5947 func_to_host_path "$dllsearchpath:"
5949 const char * EXE_PATH_VARNAME = "PATH";
5950 const char * EXE_PATH_VALUE = "$func_to_host_path_result";
5954 const char * EXE_PATH_VARNAME = "";
5955 const char * EXE_PATH_VALUE = "";
5959 if test yes = "$fast_install"; then
5961 const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
5965 const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
5972 #define LTWRAPPER_OPTION_PREFIX "--lt-"
5974 static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
5975 static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
5976 static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
5979 main (int argc, char *argv[])
5984 char *actual_cwrapper_path;
5985 char *actual_cwrapper_name;
5992 program_name = (char *) xstrdup (base_name (argv[0]));
5993 newargz = XMALLOC (char *, (size_t) argc + 1);
5995 /* very simple arg parsing; don't want to rely on getopt
5996 * also, copy all non cwrapper options to newargz, except
5997 * argz[0], which is handled differently
6000 for (i = 1; i < argc; i++)
6002 if (STREQ (argv[i], dumpscript_opt))
6006 *mingw* | *cygwin* )
6007 # make stdout use "unix" line endings
6008 echo " setmode(1,_O_BINARY);"
6013 lt_dump_script (stdout);
6016 if (STREQ (argv[i], debug_opt))
6021 if (STREQ (argv[i], ltwrapper_option_prefix))
6023 /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
6024 namespace, but it is not one of the ones we know about and
6025 have already dealt with, above (inluding dump-script), then
6026 report an error. Otherwise, targets might begin to believe
6027 they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
6028 namespace. The first time any user complains about this, we'll
6029 need to make LTWRAPPER_OPTION_PREFIX a configure-time option
6030 or a configure.ac-settable value.
6032 lt_fatal (__FILE__, __LINE__,
6033 "unrecognized %s option: '%s'",
6034 ltwrapper_option_prefix, argv[i]);
6037 newargz[++newargc] = xstrdup (argv[i]);
6039 newargz[++newargc] = NULL;
6043 /* The GNU banner must be the first non-error debug message */
6044 lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
6047 lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
6048 lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
6050 tmp_pathspec = find_executable (argv[0]);
6051 if (tmp_pathspec == NULL)
6052 lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
6053 lt_debugprintf (__FILE__, __LINE__,
6054 "(main) found exe (before symlink chase) at: %s\n",
6057 actual_cwrapper_path = chase_symlinks (tmp_pathspec);
6058 lt_debugprintf (__FILE__, __LINE__,
6059 "(main) found exe (after symlink chase) at: %s\n",
6060 actual_cwrapper_path);
6061 XFREE (tmp_pathspec);
6063 actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
6064 strendzap (actual_cwrapper_path, actual_cwrapper_name);
6066 /* wrapper name transforms */
6067 strendzap (actual_cwrapper_name, ".exe");
6068 tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
6069 XFREE (actual_cwrapper_name);
6070 actual_cwrapper_name = tmp_pathspec;
6073 /* target_name transforms -- use actual target program name; might have lt- prefix */
6074 target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
6075 strendzap (target_name, ".exe");
6076 tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
6077 XFREE (target_name);
6078 target_name = tmp_pathspec;
6081 lt_debugprintf (__FILE__, __LINE__,
6082 "(main) libtool target name: %s\n",
6088 XMALLOC (char, (strlen (actual_cwrapper_path) +
6089 strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
6090 strcpy (newargz[0], actual_cwrapper_path);
6091 strcat (newargz[0], "$objdir");
6092 strcat (newargz[0], "/");
6096 /* stop here, and copy so we don't have to do this twice */
6097 tmp_pathspec = xstrdup (newargz[0]);
6099 /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
6100 strcat (newargz[0], actual_cwrapper_name);
6102 /* DO want the lt- prefix here if it exists, so use target_name */
6103 lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
6104 XFREE (tmp_pathspec);
6105 tmp_pathspec = NULL;
6113 while ((p = strchr (newargz[0], '\\')) != NULL)
6117 while ((p = strchr (lt_argv_zero, '\\')) != NULL)
6127 XFREE (target_name);
6128 XFREE (actual_cwrapper_path);
6129 XFREE (actual_cwrapper_name);
6131 lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
6132 lt_setenv ("DUALCASE", "1"); /* for MSK sh */
6133 /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
6134 be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
6135 because on Windows, both *_VARNAMEs are PATH but uninstalled
6136 libraries must come first. */
6137 lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
6138 lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
6140 lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
6141 nonnull (lt_argv_zero));
6142 for (i = 0; i < newargc; i++)
6144 lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
6145 i, nonnull (newargz[i]));
6153 /* execv doesn't actually work on mingw as expected on unix */
6154 newargz = prepare_spawn (newargz);
6155 rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
6158 /* failed to start process */
6159 lt_debugprintf (__FILE__, __LINE__,
6160 "(main) failed to launch target \"%s\": %s\n",
6161 lt_argv_zero, nonnull (strerror (errno)));
6169 execv (lt_argv_zero, newargz);
6170 return rval; /* =127, but avoids unused variable warning */
6179 xmalloc (size_t num)
6181 void *p = (void *) malloc (num);
6183 lt_fatal (__FILE__, __LINE__, "memory exhausted");
6189 xstrdup (const char *string)
6191 return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
6196 base_name (const char *name)
6200 #if defined HAVE_DOS_BASED_FILE_SYSTEM
6201 /* Skip over the disk name in MSDOS pathnames. */
6202 if (isalpha ((unsigned char) name[0]) && name[1] == ':')
6206 for (base = name; *name; name++)
6207 if (IS_DIR_SEPARATOR (*name))
6213 check_executable (const char *path)
6217 lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
6219 if ((!path) || (!*path))
6222 if ((stat (path, &st) >= 0)
6223 && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
6230 make_executable (const char *path)
6235 lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
6237 if ((!path) || (!*path))
6240 if (stat (path, &st) >= 0)
6242 rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
6247 /* Searches for the full path of the wrapper. Returns
6248 newly allocated full path name if found, NULL otherwise
6249 Does not chase symlinks, even on platforms that support them.
6252 find_executable (const char *wrapper)
6257 /* static buffer for getcwd */
6258 char tmp[LT_PATHMAX + 1];
6262 lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
6263 nonempty (wrapper));
6265 if ((wrapper == NULL) || (*wrapper == '\0'))
6268 /* Absolute path? */
6269 #if defined HAVE_DOS_BASED_FILE_SYSTEM
6270 if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
6272 concat_name = xstrdup (wrapper);
6273 if (check_executable (concat_name))
6275 XFREE (concat_name);
6280 if (IS_DIR_SEPARATOR (wrapper[0]))
6282 concat_name = xstrdup (wrapper);
6283 if (check_executable (concat_name))
6285 XFREE (concat_name);
6287 #if defined HAVE_DOS_BASED_FILE_SYSTEM
6291 for (p = wrapper; *p; p++)
6299 /* no slashes; search PATH */
6300 const char *path = getenv ("PATH");
6303 for (p = path; *p; p = p_next)
6307 for (q = p; *q; q++)
6308 if (IS_PATH_SEPARATOR (*q))
6310 p_len = (size_t) (q - p);
6311 p_next = (*q == '\0' ? q : q + 1);
6314 /* empty path: current directory */
6315 if (getcwd (tmp, LT_PATHMAX) == NULL)
6316 lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
6317 nonnull (strerror (errno)));
6318 tmp_len = strlen (tmp);
6320 XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
6321 memcpy (concat_name, tmp, tmp_len);
6322 concat_name[tmp_len] = '/';
6323 strcpy (concat_name + tmp_len + 1, wrapper);
6328 XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
6329 memcpy (concat_name, p, p_len);
6330 concat_name[p_len] = '/';
6331 strcpy (concat_name + p_len + 1, wrapper);
6333 if (check_executable (concat_name))
6335 XFREE (concat_name);
6338 /* not found in PATH; assume curdir */
6340 /* Relative path | not found in path: prepend cwd */
6341 if (getcwd (tmp, LT_PATHMAX) == NULL)
6342 lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
6343 nonnull (strerror (errno)));
6344 tmp_len = strlen (tmp);
6345 concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
6346 memcpy (concat_name, tmp, tmp_len);
6347 concat_name[tmp_len] = '/';
6348 strcpy (concat_name + tmp_len + 1, wrapper);
6350 if (check_executable (concat_name))
6352 XFREE (concat_name);
6357 chase_symlinks (const char *pathspec)
6360 return xstrdup (pathspec);
6362 char buf[LT_PATHMAX];
6364 char *tmp_pathspec = xstrdup (pathspec);
6366 int has_symlinks = 0;
6367 while (strlen (tmp_pathspec) && !has_symlinks)
6369 lt_debugprintf (__FILE__, __LINE__,
6370 "checking path component for symlinks: %s\n",
6372 if (lstat (tmp_pathspec, &s) == 0)
6374 if (S_ISLNK (s.st_mode) != 0)
6380 /* search backwards for last DIR_SEPARATOR */
6381 p = tmp_pathspec + strlen (tmp_pathspec) - 1;
6382 while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
6384 if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
6386 /* no more DIR_SEPARATORS left */
6393 lt_fatal (__FILE__, __LINE__,
6394 "error accessing file \"%s\": %s",
6395 tmp_pathspec, nonnull (strerror (errno)));
6398 XFREE (tmp_pathspec);
6402 return xstrdup (pathspec);
6405 tmp_pathspec = realpath (pathspec, buf);
6406 if (tmp_pathspec == 0)
6408 lt_fatal (__FILE__, __LINE__,
6409 "could not follow symlinks for %s", pathspec);
6411 return xstrdup (tmp_pathspec);
6416 strendzap (char *str, const char *pat)
6420 assert (str != NULL);
6421 assert (pat != NULL);
6424 patlen = strlen (pat);
6428 str += len - patlen;
6429 if (STREQ (str, pat))
6436 lt_debugprintf (const char *file, int line, const char *fmt, ...)
6441 (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
6442 va_start (args, fmt);
6443 (void) vfprintf (stderr, fmt, args);
6449 lt_error_core (int exit_status, const char *file,
6450 int line, const char *mode,
6451 const char *message, va_list ap)
6453 fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
6454 vfprintf (stderr, message, ap);
6455 fprintf (stderr, ".\n");
6457 if (exit_status >= 0)
6462 lt_fatal (const char *file, int line, const char *message, ...)
6465 va_start (ap, message);
6466 lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
6471 nonnull (const char *s)
6473 return s ? s : "(null)";
6477 nonempty (const char *s)
6479 return (s && !*s) ? "(empty)" : nonnull (s);
6483 lt_setenv (const char *name, const char *value)
6485 lt_debugprintf (__FILE__, __LINE__,
6486 "(lt_setenv) setting '%s' to '%s'\n",
6487 nonnull (name), nonnull (value));
6490 /* always make a copy, for consistency with !HAVE_SETENV */
6491 char *str = xstrdup (value);
6492 setenv (name, str, 1);
6494 size_t len = strlen (name) + 1 + strlen (value) + 1;
6495 char *str = XMALLOC (char, len);
6496 sprintf (str, "%s=%s", name, value);
6497 if (putenv (str) != EXIT_SUCCESS)
6506 lt_extend_str (const char *orig_value, const char *add, int to_end)
6509 if (orig_value && *orig_value)
6511 size_t orig_value_len = strlen (orig_value);
6512 size_t add_len = strlen (add);
6513 new_value = XMALLOC (char, add_len + orig_value_len + 1);
6516 strcpy (new_value, orig_value);
6517 strcpy (new_value + orig_value_len, add);
6521 strcpy (new_value, add);
6522 strcpy (new_value + add_len, orig_value);
6527 new_value = xstrdup (add);
6533 lt_update_exe_path (const char *name, const char *value)
6535 lt_debugprintf (__FILE__, __LINE__,
6536 "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
6537 nonnull (name), nonnull (value));
6539 if (name && *name && value && *value)
6541 char *new_value = lt_extend_str (getenv (name), value, 0);
6542 /* some systems can't cope with a ':'-terminated path #' */
6543 size_t len = strlen (new_value);
6544 while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
6546 new_value[--len] = '\0';
6548 lt_setenv (name, new_value);
6554 lt_update_lib_path (const char *name, const char *value)
6556 lt_debugprintf (__FILE__, __LINE__,
6557 "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
6558 nonnull (name), nonnull (value));
6560 if (name && *name && value && *value)
6562 char *new_value = lt_extend_str (getenv (name), value, 0);
6563 lt_setenv (name, new_value);
6573 /* Prepares an argument vector before calling spawn().
6574 Note that spawn() does not by itself call the command interpreter
6575 (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
6576 ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
6578 v.dwPlatformId == VER_PLATFORM_WIN32_NT;
6579 }) ? "cmd.exe" : "command.com").
6580 Instead it simply concatenates the arguments, separated by ' ', and calls
6581 CreateProcess(). We must quote the arguments since Win32 CreateProcess()
6582 interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
6584 - Space and tab are interpreted as delimiters. They are not treated as
6585 delimiters if they are surrounded by double quotes: "...".
6586 - Unescaped double quotes are removed from the input. Their only effect is
6587 that within double quotes, space and tab are treated like normal
6589 - Backslashes not followed by double quotes are not special.
6590 - But 2*n+1 backslashes followed by a double quote become
6591 n backslashes followed by a double quote (n >= 0):
6596 #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"
6597 #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"
6599 prepare_spawn (char **argv)
6605 /* Count number of arguments. */
6606 for (argc = 0; argv[argc] != NULL; argc++)
6609 /* Allocate new argument vector. */
6610 new_argv = XMALLOC (char *, argc + 1);
6612 /* Put quoted arguments into the new argument vector. */
6613 for (i = 0; i < argc; i++)
6615 const char *string = argv[i];
6617 if (string[0] == '\0')
6618 new_argv[i] = xstrdup ("\"\"");
6619 else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
6621 int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
6623 unsigned int backslashes;
6625 char *quoted_string;
6632 for (s = string; *s != '\0'; s++)
6636 length += backslashes + 1;
6644 length += backslashes + 1;
6646 quoted_string = XMALLOC (char, length + 1);
6652 for (s = string; *s != '\0'; s++)
6658 for (j = backslashes + 1; j > 0; j--)
6670 for (j = backslashes; j > 0; j--)
6676 new_argv[i] = quoted_string;
6679 new_argv[i] = (char *) string;
6681 new_argv[argc] = NULL;
6690 void lt_dump_script (FILE* f)
6693 func_emit_wrapper yes |
6695 s/^\(.\{79\}\)\(..*\)/\1\
6700 s/\([^\n]*\).*/ fputs ("\1", f);/p
6707 # end: func_emit_cwrapperexe_src
6709 # func_win32_import_lib_p ARG
6710 # True if ARG is an import lib, as indicated by $file_magic_cmd
6711 func_win32_import_lib_p ()
6715 case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
6721 # func_suncc_cstd_abi
6722 # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!
6723 # Several compiler flags select an ABI that is incompatible with the
6724 # Cstd library. Avoid specifying it if any are in CXXFLAGS.
6725 func_suncc_cstd_abi ()
6729 case " $compile_command " in
6730 *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)
6731 suncc_use_cstd_abi=no
6734 suncc_use_cstd_abi=yes
6739 # func_mode_link arg...
6745 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
6746 # It is impossible to link a dll without this setting, and
6747 # we shouldn't force the makefile maintainer to figure out
6748 # what system we are compiling for in order to pass an extra
6749 # flag for every libtool invocation.
6750 # allow_undefined=no
6752 # FIXME: Unfortunately, there are problems with the above when trying
6753 # to make a dll that has undefined symbols, in which case not
6754 # even a static library is built. For now, we need to specify
6755 # -no-undefined on the libtool link line when we can be certain
6756 # that all symbols are satisfied, otherwise we get a static library.
6763 libtool_args=$nonopt
6764 base_compile="$nonopt $@"
6765 compile_command=$nonopt
6766 finalize_command=$nonopt
6779 lib_search_path=`pwd`
6781 new_inherited_linker_flags=
6790 export_symbols_regex=
6799 precious_files_regex=
6800 prefer_static_libs=no
6813 single_module=$wl-single_module
6814 func_infer_tag $base_compile
6816 # We need to know -static, to get the right output filenames.
6821 test yes != "$build_libtool_libs" \
6822 && func_fatal_configuration "cannot build a shared library"
6826 -all-static | -static | -static-libtool-libs)
6829 if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
6830 func_warning "complete static linking is impossible in this configuration"
6832 if test -n "$link_static_flag"; then
6833 dlopen_self=$dlopen_self_static
6835 prefer_static_libs=yes
6838 if test -z "$pic_flag" && test -n "$link_static_flag"; then
6839 dlopen_self=$dlopen_self_static
6841 prefer_static_libs=built
6843 -static-libtool-libs)
6844 if test -z "$pic_flag" && test -n "$link_static_flag"; then
6845 dlopen_self=$dlopen_self_static
6847 prefer_static_libs=yes
6850 build_libtool_libs=no
6857 # See if our shared archives depend on static archives.
6858 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
6860 # Go through the arguments, transforming them on the way.
6861 while test "$#" -gt 0; do
6864 func_quote_arg pretty,unquoted "$arg"
6865 qarg=$func_quote_arg_unquoted_result
6866 func_append libtool_args " $func_quote_arg_result"
6868 # If the previous option needs an argument, assign it.
6869 if test -n "$prev"; then
6872 func_append compile_command " @OUTPUT@"
6873 func_append finalize_command " @OUTPUT@"
6885 # Add the symbol object into the linking commands.
6886 func_append compile_command " @SYMFILE@"
6887 func_append finalize_command " @SYMFILE@"
6891 *.la | *.lo) ;; # We handle these cases below.
6893 if test no = "$dlself"; then
6901 if test dlprefiles = "$prev"; then
6903 elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
6913 if test dlfiles = "$prev"; then
6914 func_append dlfiles " $arg"
6916 func_append dlprefiles " $arg"
6926 || func_fatal_error "symbol file '$arg' does not exist"
6931 export_symbols_regex=$arg
6939 *" $qarg.ltframework "*) ;;
6940 *) func_append deplibs " $qarg.ltframework" # this is fixed later
6949 inst_prefix_dir=$arg
6954 # Clang does not use LLVM to link, so we can simply discard any
6955 # '-mllvm $arg' options when doing the link step.
6960 if test -f "$arg"; then
6963 for fil in `cat "$save_arg"`
6965 # func_append moreargs " $fil"
6967 # A libtool-controlled object.
6969 # Check to see that this really is a libtool object.
6970 if func_lalib_unsafe_p "$arg"; then
6977 if test -z "$pic_object" ||
6978 test -z "$non_pic_object" ||
6979 test none = "$pic_object" &&
6980 test none = "$non_pic_object"; then
6981 func_fatal_error "cannot find name of object for '$arg'"
6984 # Extract subdirectory from the argument.
6985 func_dirname "$arg" "/" ""
6986 xdir=$func_dirname_result
6988 if test none != "$pic_object"; then
6989 # Prepend the subdirectory the object is found in.
6990 pic_object=$xdir$pic_object
6992 if test dlfiles = "$prev"; then
6993 if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
6994 func_append dlfiles " $pic_object"
6998 # If libtool objects are unsupported, then we need to preload.
7003 # CHECK ME: I think I busted this. -Ossama
7004 if test dlprefiles = "$prev"; then
7005 # Preload the old-style object.
7006 func_append dlprefiles " $pic_object"
7011 func_append libobjs " $pic_object"
7016 if test none != "$non_pic_object"; then
7017 # Prepend the subdirectory the object is found in.
7018 non_pic_object=$xdir$non_pic_object
7020 # A standard non-PIC object
7021 func_append non_pic_objects " $non_pic_object"
7022 if test -z "$pic_object" || test none = "$pic_object"; then
7026 # If the PIC object exists, use it instead.
7027 # $xdir was prepended to $pic_object above.
7028 non_pic_object=$pic_object
7029 func_append non_pic_objects " $non_pic_object"
7032 # Only an error if not doing a dry-run.
7033 if $opt_dry_run; then
7034 # Extract subdirectory from the argument.
7035 func_dirname "$arg" "/" ""
7036 xdir=$func_dirname_result
7039 pic_object=$xdir$objdir/$func_lo2o_result
7040 non_pic_object=$xdir$func_lo2o_result
7041 func_append libobjs " $pic_object"
7042 func_append non_pic_objects " $non_pic_object"
7044 func_fatal_error "'$arg' is not a valid libtool object"
7049 func_fatal_error "link input file '$arg' does not exist"
7061 precious_files_regex=$arg
7071 # We need an absolute path.
7073 [\\/]* | [A-Za-z]:[\\/]*) ;;
7075 func_fatal_error "only absolute run-paths are allowed"
7078 if test rpath = "$prev"; then
7081 *) func_append rpath " $arg" ;;
7086 *) func_append xrpath " $arg" ;;
7098 func_append weak_libs " $arg"
7103 func_append compiler_flags " -Xassembler $qarg"
7105 func_append compile_command " -Xassembler $qarg"
7106 func_append finalize_command " -Xassembler $qarg"
7110 func_append linker_flags " $qarg"
7111 func_append compiler_flags " $qarg"
7113 func_append compile_command " $qarg"
7114 func_append finalize_command " $qarg"
7118 func_append compiler_flags " $qarg"
7120 func_append compile_command " $qarg"
7121 func_append finalize_command " $qarg"
7125 func_append linker_flags " $qarg"
7126 func_append compiler_flags " $wl$qarg"
7128 func_append compile_command " $wl$qarg"
7129 func_append finalize_command " $wl$qarg"
7133 eval "$prev=\"\$arg\""
7138 fi # test -n "$prev"
7144 if test -n "$link_static_flag"; then
7145 # See comment for -static flag below, for more details.
7146 func_append compile_command " $link_static_flag"
7147 func_append finalize_command " $link_static_flag"
7153 # FIXME: remove this flag sometime in the future.
7154 func_fatal_error "'-allow-undefined' must not be used because it is the default"
7182 -export-symbols | -export-symbols-regex)
7183 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
7184 func_fatal_error "more than one -exported-symbols argument is not allowed"
7186 if test X-export-symbols = "X$arg"; then
7204 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
7205 # so, if we see these flags be careful not to treat them like -L
7207 case $with_gcc/$host in
7208 no/*-*-irix* | /*-*-irix*)
7209 func_append compile_command " $arg"
7210 func_append finalize_command " $arg"
7217 func_stripname "-L" '' "$arg"
7218 if test -z "$func_stripname_result"; then
7219 if test "$#" -gt 0; then
7220 func_fatal_error "require no space between '-L' and '$1'"
7222 func_fatal_error "need path for '-L' option"
7225 func_resolve_sysroot "$func_stripname_result"
7226 dir=$func_resolve_sysroot_result
7227 # We need an absolute path.
7229 [\\/]* | [A-Za-z]:[\\/]*) ;;
7231 absdir=`cd "$dir" && pwd`
7232 test -z "$absdir" && \
7233 func_fatal_error "cannot determine absolute directory name of '$dir'"
7238 *" -L$dir "* | *" $arg "*)
7239 # Will only happen for absolute or sysroot arguments
7242 # Preserve sysroot, but never include relative directories
7244 [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
7245 *) func_append deplibs " -L$dir" ;;
7247 func_append lib_search_path " $dir"
7251 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
7252 testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
7253 case :$dllsearchpath: in
7255 ::) dllsearchpath=$dir;;
7256 *) func_append dllsearchpath ":$dir";;
7258 case :$dllsearchpath: in
7259 *":$testbindir:"*) ;;
7260 ::) dllsearchpath=$testbindir;;
7261 *) func_append dllsearchpath ":$testbindir";;
7269 if test X-lc = "X$arg" || test X-lm = "X$arg"; then
7271 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
7272 # These systems don't actually have a C or math library (as such)
7276 # These systems don't actually have a C library (as such)
7277 test X-lc = "X$arg" && continue
7279 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*)
7280 # Do not include libc due to us having libc/libc_r.
7281 test X-lc = "X$arg" && continue
7283 *-*-rhapsody* | *-*-darwin1.[012])
7284 # Rhapsody C and math libraries are in the System framework
7285 func_append deplibs " System.ltframework"
7288 *-*-sco3.2v5* | *-*-sco5v6*)
7289 # Causes problems with __ctype
7290 test X-lc = "X$arg" && continue
7292 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
7293 # Compiler inserts libc in the correct place for threads to work
7294 test X-lc = "X$arg" && continue
7297 elif test X-lc_r = "X$arg"; then
7299 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*)
7300 # Do not include libc_r directly, use -pthread flag.
7305 func_append deplibs " $arg"
7319 # Tru64 UNIX uses -model [arg] to determine the layout of C++
7320 # classes, name mangling, and exception handling.
7321 # Darwin uses the -arch flag to determine output architecture.
7322 -model|-arch|-isysroot|--sysroot)
7323 func_append compiler_flags " $arg"
7324 func_append compile_command " $arg"
7325 func_append finalize_command " $arg"
7329 # Solaris ld rejects as of 11.4. Refer to Oracle bug 22985199.
7334 case "$new_inherited_linker_flags " in
7336 * ) func_append new_inherited_linker_flags " $arg" ;;
7342 -mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe \
7343 |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
7344 func_append compiler_flags " $arg"
7345 func_append compile_command " $arg"
7346 func_append finalize_command " $arg"
7347 case "$new_inherited_linker_flags " in
7349 * ) func_append new_inherited_linker_flags " $arg" ;;
7355 single_module=$wl-multi_module
7366 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
7367 # The PATH hackery in wrapper scripts is required on Windows
7368 # and Darwin in order for the loader to find any dlls it needs.
7369 func_warning "'-no-install' is ignored for $host"
7370 func_warning "assuming '-no-fast-install' instead"
7373 *) no_install=yes ;;
7395 -precious-files-regex)
7416 func_stripname '-R' '' "$arg"
7417 dir=$func_stripname_result
7418 # We need an absolute path.
7420 [\\/]* | [A-Za-z]:[\\/]*) ;;
7422 func_stripname '=' '' "$dir"
7423 dir=$lt_sysroot$func_stripname_result
7426 func_fatal_error "only absolute run-paths are allowed"
7431 *) func_append xrpath " $dir" ;;
7437 # The effects of -shared are defined in a previous loop.
7446 -static | -static-libtool-libs)
7447 # The effects of -static are defined in a previous loop.
7448 # We used to do the same as -all-static on platforms that
7449 # didn't have a PIC flag, but the assumption that the effects
7450 # would be equivalent was wrong. It would break on at least
7451 # Digital Unix and AIX.
7477 func_stripname '-Wc,' '' "$arg"
7478 args=$func_stripname_result
7480 save_ifs=$IFS; IFS=,
7481 for flag in $args; do
7483 func_quote_arg pretty "$flag"
7484 func_append arg " $func_quote_arg_result"
7485 func_append compiler_flags " $func_quote_arg_result"
7488 func_stripname ' ' '' "$arg"
7489 arg=$func_stripname_result
7493 func_stripname '-Wl,' '' "$arg"
7494 args=$func_stripname_result
7496 save_ifs=$IFS; IFS=,
7497 for flag in $args; do
7499 func_quote_arg pretty "$flag"
7500 func_append arg " $wl$func_quote_arg_result"
7501 func_append compiler_flags " $wl$func_quote_arg_result"
7502 func_append linker_flags " $func_quote_arg_result"
7505 func_stripname ' ' '' "$arg"
7506 arg=$func_stripname_result
7531 func_quote_arg pretty "$arg"
7532 arg=$func_quote_arg_result
7535 # Flags to be passed through unchanged, with rationale:
7536 # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
7537 # -r[0-9][0-9]* specify processor for the SGI compiler
7538 # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
7539 # +DA*, +DD* enable 64-bit mode for the HP compiler
7540 # -q* compiler args for the IBM compiler
7541 # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
7542 # -F/path path to uninstalled frameworks, gcc on darwin
7543 # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
7544 # -fstack-protector* stack protector flags for GCC
7545 # @file GCC response files
7546 # -tp=* Portland pgcc target processor selection
7547 # --sysroot=* for sysroot support
7548 # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
7549 # -specs=* GCC specs files
7550 # -stdlib=* select c++ std lib with clang
7551 # -fsanitize=* Clang/GCC memory and address sanitizer
7552 # -fuse-ld=* Linker select flags for GCC
7553 # -Wa,* Pass flags directly to the assembler
7554 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
7555 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
7556 -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
7557 -specs=*|-fsanitize=*|-fuse-ld=*|-Wa,*)
7558 func_quote_arg pretty "$arg"
7559 arg=$func_quote_arg_result
7560 func_append compile_command " $arg"
7561 func_append finalize_command " $arg"
7562 func_append compiler_flags " $arg"
7567 if test os2 = "`expr $host : '.*\(os2\)'`"; then
7568 # OS/2 uses -Zxxx to specify OS/2-specific options
7569 compiler_flags="$compiler_flags $arg"
7570 func_append compile_command " $arg"
7571 func_append finalize_command " $arg"
7579 # Otherwise treat like 'Some other compiler flag' below
7580 func_quote_arg pretty "$arg"
7581 arg=$func_quote_arg_result
7585 # Some other compiler flag.
7587 func_quote_arg pretty "$arg"
7588 arg=$func_quote_arg_result
7592 # A standard object.
7593 func_append objs " $arg"
7597 # A libtool-controlled object.
7599 # Check to see that this really is a libtool object.
7600 if func_lalib_unsafe_p "$arg"; then
7607 if test -z "$pic_object" ||
7608 test -z "$non_pic_object" ||
7609 test none = "$pic_object" &&
7610 test none = "$non_pic_object"; then
7611 func_fatal_error "cannot find name of object for '$arg'"
7614 # Extract subdirectory from the argument.
7615 func_dirname "$arg" "/" ""
7616 xdir=$func_dirname_result
7618 test none = "$pic_object" || {
7619 # Prepend the subdirectory the object is found in.
7620 pic_object=$xdir$pic_object
7622 if test dlfiles = "$prev"; then
7623 if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
7624 func_append dlfiles " $pic_object"
7628 # If libtool objects are unsupported, then we need to preload.
7633 # CHECK ME: I think I busted this. -Ossama
7634 if test dlprefiles = "$prev"; then
7635 # Preload the old-style object.
7636 func_append dlprefiles " $pic_object"
7641 func_append libobjs " $pic_object"
7646 if test none != "$non_pic_object"; then
7647 # Prepend the subdirectory the object is found in.
7648 non_pic_object=$xdir$non_pic_object
7650 # A standard non-PIC object
7651 func_append non_pic_objects " $non_pic_object"
7652 if test -z "$pic_object" || test none = "$pic_object"; then
7656 # If the PIC object exists, use it instead.
7657 # $xdir was prepended to $pic_object above.
7658 non_pic_object=$pic_object
7659 func_append non_pic_objects " $non_pic_object"
7662 # Only an error if not doing a dry-run.
7663 if $opt_dry_run; then
7664 # Extract subdirectory from the argument.
7665 func_dirname "$arg" "/" ""
7666 xdir=$func_dirname_result
7669 pic_object=$xdir$objdir/$func_lo2o_result
7670 non_pic_object=$xdir$func_lo2o_result
7671 func_append libobjs " $pic_object"
7672 func_append non_pic_objects " $non_pic_object"
7674 func_fatal_error "'$arg' is not a valid libtool object"
7681 func_append deplibs " $arg"
7682 func_append old_deplibs " $arg"
7687 # A libtool-controlled library.
7689 func_resolve_sysroot "$arg"
7690 if test dlfiles = "$prev"; then
7691 # This library was specified with -dlopen.
7692 func_append dlfiles " $func_resolve_sysroot_result"
7694 elif test dlprefiles = "$prev"; then
7695 # The library was specified with -dlpreopen.
7696 func_append dlprefiles " $func_resolve_sysroot_result"
7699 func_append deplibs " $func_resolve_sysroot_result"
7704 # Some other compiler argument.
7706 # Unknown arguments in both finalize_command and compile_command need
7707 # to be aesthetically quoted because they are evaled later.
7708 func_quote_arg pretty "$arg"
7709 arg=$func_quote_arg_result
7713 # Now actually substitute the argument into the commands.
7714 if test -n "$arg"; then
7715 func_append compile_command " $arg"
7716 func_append finalize_command " $arg"
7718 done # argument parsing loop
7720 test -n "$prev" && \
7721 func_fatal_help "the '$prevarg' option requires an argument"
7723 if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
7724 eval arg=\"$export_dynamic_flag_spec\"
7725 func_append compile_command " $arg"
7726 func_append finalize_command " $arg"
7730 # calculate the name of the file, without its directory
7731 func_basename "$output"
7732 outputname=$func_basename_result
7733 libobjs_save=$libobjs
7735 if test -n "$shlibpath_var"; then
7736 # get the directories listed in $shlibpath_var
7737 eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`
7741 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
7742 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
7744 # Definition is injected by LT_CONFIG during libtool generation.
7745 func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
7747 func_dirname "$output" "/" ""
7748 output_objdir=$func_dirname_result$objdir
7749 func_to_tool_file "$output_objdir/"
7750 tool_output_objdir=$func_to_tool_file_result
7751 # Create the object directory.
7752 func_mkdir_p "$output_objdir"
7754 # Determine the type of output
7757 func_fatal_help "you must specify an output file"
7759 *.$libext) linkmode=oldlib ;;
7760 *.lo | *.$objext) linkmode=obj ;;
7761 *.la) linkmode=lib ;;
7762 *) linkmode=prog ;; # Anything else should be a program.
7768 # Find all interdependent deplibs by searching for libraries
7769 # that are linked more than once (e.g. -la -lb -la)
7770 for deplib in $deplibs; do
7771 if $opt_preserve_dup_deps; then
7773 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
7776 func_append libs " $deplib"
7779 if test lib = "$linkmode"; then
7780 libs="$predeps $libs $compiler_lib_search_path $postdeps"
7782 # Compute libraries that are listed more than once in $predeps
7783 # $postdeps and mark them as special (i.e., whose duplicates are
7784 # not to be eliminated).
7786 if $opt_duplicate_compiler_generated_deps; then
7787 for pre_post_dep in $predeps $postdeps; do
7788 case "$pre_post_deps " in
7789 *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
7791 func_append pre_post_deps " $pre_post_dep"
7800 need_relink=no # whether we're linking any uninstalled libtool libraries
7801 notinst_deplibs= # not-installed libtool libraries
7802 notinst_path= # paths that contain not-installed libtool libraries
7806 passes="conv dlpreopen link"
7807 for file in $dlfiles $dlprefiles; do
7811 func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"
7822 passes="conv scan dlopen dlpreopen link"
7828 for pass in $passes; do
7829 # The preopen pass in lib mode reverses $deplibs; put it back here
7830 # so that -L comes before libs that need it for instance...
7831 if test lib,link = "$linkmode,$pass"; then
7832 ## FIXME: Find the place where the list is rebuilt in the wrong
7833 ## order, and fix it there properly
7835 for deplib in $deplibs; do
7836 tmp_deplibs="$deplib $tmp_deplibs"
7838 deplibs=$tmp_deplibs
7841 if test lib,link = "$linkmode,$pass" ||
7842 test prog,scan = "$linkmode,$pass"; then
7846 if test prog = "$linkmode"; then
7848 dlopen) libs=$dlfiles ;;
7849 dlpreopen) libs=$dlprefiles ;;
7850 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
7853 if test lib,dlpreopen = "$linkmode,$pass"; then
7854 # Collect and forward deplibs of preopened libtool libs
7855 for lib in $dlprefiles; do
7856 # Ignore non-libtool-libs
7858 func_resolve_sysroot "$lib"
7860 *.la) func_source "$func_resolve_sysroot_result" ;;
7863 # Collect preopened libtool deplibs, except any this library
7864 # has declared as weak libs
7865 for deplib in $dependency_libs; do
7866 func_basename "$deplib"
7867 deplib_base=$func_basename_result
7868 case " $weak_libs " in
7869 *" $deplib_base "*) ;;
7870 *) func_append deplibs " $deplib" ;;
7876 if test dlopen = "$pass"; then
7877 # Collect dlpreopened libraries
7878 save_deplibs=$deplibs
7882 for deplib in $libs; do
7886 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
7887 |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
7888 if test prog,link = "$linkmode,$pass"; then
7889 compile_deplibs="$deplib $compile_deplibs"
7890 finalize_deplibs="$deplib $finalize_deplibs"
7892 func_append compiler_flags " $deplib"
7893 if test lib = "$linkmode"; then
7894 case "$new_inherited_linker_flags " in
7896 * ) func_append new_inherited_linker_flags " $deplib" ;;
7903 if test lib != "$linkmode" && test prog != "$linkmode"; then
7904 func_warning "'-l' is ignored for archives/objects"
7907 func_stripname '-l' '' "$deplib"
7908 name=$func_stripname_result
7909 if test lib = "$linkmode"; then
7910 searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
7912 searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
7914 for searchdir in $searchdirs; do
7915 for search_ext in .la $std_shrext .so .a; do
7916 # Search the libtool library
7917 lib=$searchdir/lib$name$search_ext
7918 if test -f "$lib"; then
7919 if test .la = "$search_ext"; then
7929 # deplib is a libtool library
7930 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
7931 # We need to do some special things here, and not later.
7932 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
7933 case " $predeps $postdeps " in
7935 if func_lalib_p "$lib"; then
7939 for l in $old_library $library_names; do
7942 if test "X$ll" = "X$old_library"; then # only static version available
7944 func_dirname "$lib" "" "."
7945 ladir=$func_dirname_result
7946 lib=$ladir/$old_library
7947 if test prog,link = "$linkmode,$pass"; then
7948 compile_deplibs="$deplib $compile_deplibs"
7949 finalize_deplibs="$deplib $finalize_deplibs"
7951 deplibs="$deplib $deplibs"
7952 test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
7962 # deplib doesn't seem to be a libtool library
7963 if test prog,link = "$linkmode,$pass"; then
7964 compile_deplibs="$deplib $compile_deplibs"
7965 finalize_deplibs="$deplib $finalize_deplibs"
7967 deplibs="$deplib $deplibs"
7968 test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
7974 if test prog,link = "$linkmode,$pass"; then
7975 compile_deplibs="$deplib $compile_deplibs"
7976 finalize_deplibs="$deplib $finalize_deplibs"
7978 deplibs="$deplib $deplibs"
7979 if test lib = "$linkmode"; then
7980 case "$new_inherited_linker_flags " in
7982 * ) func_append new_inherited_linker_flags " $deplib" ;;
7991 deplibs="$deplib $deplibs"
7992 test conv = "$pass" && continue
7993 newdependency_libs="$deplib $newdependency_libs"
7994 func_stripname '-L' '' "$deplib"
7995 func_resolve_sysroot "$func_stripname_result"
7996 func_append newlib_search_path " $func_resolve_sysroot_result"
7999 if test conv = "$pass"; then
8000 deplibs="$deplib $deplibs"
8003 if test scan = "$pass"; then
8004 deplibs="$deplib $deplibs"
8006 compile_deplibs="$deplib $compile_deplibs"
8007 finalize_deplibs="$deplib $finalize_deplibs"
8009 func_stripname '-L' '' "$deplib"
8010 func_resolve_sysroot "$func_stripname_result"
8011 func_append newlib_search_path " $func_resolve_sysroot_result"
8014 func_warning "'-L' is ignored for archives/objects"
8020 if test link = "$pass"; then
8021 func_stripname '-R' '' "$deplib"
8022 func_resolve_sysroot "$func_stripname_result"
8023 dir=$func_resolve_sysroot_result
8024 # Make sure the xrpath contains only unique directories.
8027 *) func_append xrpath " $dir" ;;
8030 deplibs="$deplib $deplibs"
8034 func_resolve_sysroot "$deplib"
8035 lib=$func_resolve_sysroot_result
8038 if test conv = "$pass"; then
8039 deplibs="$deplib $deplibs"
8044 # Linking convenience modules into shared libraries is allowed,
8045 # but linking other static libraries is non-portable.
8046 case " $dlpreconveniencelibs " in
8050 case $deplibs_check_method in
8052 set dummy $deplibs_check_method; shift
8053 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
8054 if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
8055 | $EGREP "$match_pattern_regex" > /dev/null; then
8063 if $valid_a_lib; then
8065 $ECHO "*** Warning: Linking the shared library $output against the"
8066 $ECHO "*** static library $deplib is not portable!"
8067 deplibs="$deplib $deplibs"
8070 $ECHO "*** Warning: Trying to link with static lib archive $deplib."
8071 echo "*** I have the capability to make that library automatically link in when"
8072 echo "*** you link to this library. But I can only do this if you have a"
8073 echo "*** shared version of the library, which you do not appear to have"
8074 echo "*** because the file extensions .$libext of this argument makes me believe"
8075 echo "*** that it is just a static archive that I should not use here."
8082 if test link != "$pass"; then
8083 deplibs="$deplib $deplibs"
8085 compile_deplibs="$deplib $compile_deplibs"
8086 finalize_deplibs="$deplib $finalize_deplibs"
8093 if test conv = "$pass"; then
8094 deplibs="$deplib $deplibs"
8095 elif test prog = "$linkmode"; then
8096 if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
8097 # If there is no dlopen support or we're linking statically,
8098 # we need to preload.
8099 func_append newdlprefiles " $deplib"
8100 compile_deplibs="$deplib $compile_deplibs"
8101 finalize_deplibs="$deplib $finalize_deplibs"
8103 func_append newdlfiles " $deplib"
8114 $found || test -f "$lib" \
8115 || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
8117 # Check to see that this really is a libtool archive.
8118 func_lalib_unsafe_p "$lib" \
8119 || func_fatal_error "'$lib' is not a valid libtool archive"
8121 func_dirname "$lib" "" "."
8122 ladir=$func_dirname_result
8130 inherited_linker_flags=
8131 # If the library was installed with an old release of libtool,
8132 # it will not redefine variables installed, or shouldnotlink
8141 # Convert "-framework foo" to "foo.ltframework"
8142 if test -n "$inherited_linker_flags"; then
8143 tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
8144 for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
8145 case " $new_inherited_linker_flags " in
8146 *" $tmp_inherited_linker_flag "*) ;;
8147 *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
8151 dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8152 if test lib,link = "$linkmode,$pass" ||
8153 test prog,scan = "$linkmode,$pass" ||
8154 { test prog != "$linkmode" && test lib != "$linkmode"; }; then
8155 test -n "$dlopen" && func_append dlfiles " $dlopen"
8156 test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
8159 if test conv = "$pass"; then
8160 # Only check for convenience libraries
8161 deplibs="$lib $deplibs"
8162 if test -z "$libdir"; then
8163 if test -z "$old_library"; then
8164 func_fatal_error "cannot find name of link library for '$lib'"
8166 # It is a libtool convenience library, so add in its objects.
8167 func_append convenience " $ladir/$objdir/$old_library"
8168 func_append old_convenience " $ladir/$objdir/$old_library"
8169 elif test prog != "$linkmode" && test lib != "$linkmode"; then
8170 func_fatal_error "'$lib' is not a convenience library"
8173 for deplib in $dependency_libs; do
8174 deplibs="$deplib $deplibs"
8175 if $opt_preserve_dup_deps; then
8176 case "$tmp_libs " in
8177 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
8180 func_append tmp_libs " $deplib"
8186 # Get the name of the library we link against.
8188 if test -n "$old_library" &&
8189 { test yes = "$prefer_static_libs" ||
8190 test built,no = "$prefer_static_libs,$installed"; }; then
8191 linklib=$old_library
8193 for l in $old_library $library_names; do
8197 if test -z "$linklib"; then
8198 func_fatal_error "cannot find name of link library for '$lib'"
8201 # This library was specified with -dlopen.
8202 if test dlopen = "$pass"; then
8204 && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
8205 if test -z "$dlname" ||
8206 test yes != "$dlopen_support" ||
8207 test no = "$build_libtool_libs"
8209 # If there is no dlname, no dlopen support or we're linking
8210 # statically, we need to preload. We also need to preload any
8211 # dependent libraries so libltdl's deplib preloader doesn't
8212 # bomb out in the load deplibs phase.
8213 func_append dlprefiles " $lib $dependency_libs"
8215 func_append newdlfiles " $lib"
8220 # We need an absolute path.
8222 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;
8224 abs_ladir=`cd "$ladir" && pwd`
8225 if test -z "$abs_ladir"; then
8226 func_warning "cannot determine absolute directory name of '$ladir'"
8227 func_warning "passing it literally to the linker, although it might fail"
8232 func_basename "$lib"
8233 laname=$func_basename_result
8235 # Find the relevant object directory and library name.
8236 if test yes = "$installed"; then
8237 if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
8238 func_warning "library '$lib' was moved."
8243 dir=$lt_sysroot$libdir
8244 absdir=$lt_sysroot$libdir
8246 test yes = "$hardcode_automatic" && avoidtemprpath=yes
8248 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
8251 # Remove this search path later
8252 func_append notinst_path " $abs_ladir"
8255 absdir=$abs_ladir/$objdir
8256 # Remove this search path later
8257 func_append notinst_path " $abs_ladir"
8259 fi # $installed = yes
8260 func_stripname 'lib' '.la' "$laname"
8261 name=$func_stripname_result
8263 # This library was specified with -dlpreopen.
8264 if test dlpreopen = "$pass"; then
8265 if test -z "$libdir" && test prog = "$linkmode"; then
8266 func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
8269 # special handling for platforms with PE-DLLs.
8270 *cygwin* | *mingw* | *cegcc* )
8271 # Linker will automatically link against shared library if both
8272 # static and shared are present. Therefore, ensure we extract
8273 # symbols from the import library if a shared library is present
8274 # (otherwise, the dlopen module name will be incorrect). We do
8275 # this by putting the import library name into $newdlprefiles.
8276 # We recover the dlopen module name by 'saving' the la file
8277 # name in a special purpose variable, and (later) extracting the
8278 # dlname from the la file.
8279 if test -n "$dlname"; then
8280 func_tr_sh "$dir/$linklib"
8281 eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
8282 func_append newdlprefiles " $dir/$linklib"
8284 func_append newdlprefiles " $dir/$old_library"
8285 # Keep a list of preopened convenience libraries to check
8286 # that they are being used correctly in the link pass.
8287 test -z "$libdir" && \
8288 func_append dlpreconveniencelibs " $dir/$old_library"
8292 # Prefer using a static library (so that no silly _DYNAMIC symbols
8293 # are required to link).
8294 if test -n "$old_library"; then
8295 func_append newdlprefiles " $dir/$old_library"
8296 # Keep a list of preopened convenience libraries to check
8297 # that they are being used correctly in the link pass.
8298 test -z "$libdir" && \
8299 func_append dlpreconveniencelibs " $dir/$old_library"
8300 # Otherwise, use the dlname, so that lt_dlopen finds it.
8301 elif test -n "$dlname"; then
8302 func_append newdlprefiles " $dir/$dlname"
8304 func_append newdlprefiles " $dir/$linklib"
8308 fi # $pass = dlpreopen
8310 if test -z "$libdir"; then
8311 # Link the convenience library
8312 if test lib = "$linkmode"; then
8313 deplibs="$dir/$old_library $deplibs"
8314 elif test prog,link = "$linkmode,$pass"; then
8315 compile_deplibs="$dir/$old_library $compile_deplibs"
8316 finalize_deplibs="$dir/$old_library $finalize_deplibs"
8318 deplibs="$lib $deplibs" # used for prog,scan pass
8324 if test prog = "$linkmode" && test link != "$pass"; then
8325 func_append newlib_search_path " $ladir"
8326 deplibs="$lib $deplibs"
8328 linkalldeplibs=false
8329 if test no != "$link_all_deplibs" || test -z "$library_names" ||
8330 test no = "$build_libtool_libs"; then
8335 for deplib in $dependency_libs; do
8337 -L*) func_stripname '-L' '' "$deplib"
8338 func_resolve_sysroot "$func_stripname_result"
8339 func_append newlib_search_path " $func_resolve_sysroot_result"
8342 # Need to link against all dependency_libs?
8343 if $linkalldeplibs; then
8344 deplibs="$deplib $deplibs"
8346 # Need to hardcode shared library paths
8347 # or/and link against static libraries
8348 newdependency_libs="$deplib $newdependency_libs"
8350 if $opt_preserve_dup_deps; then
8351 case "$tmp_libs " in
8352 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
8355 func_append tmp_libs " $deplib"
8358 fi # $linkmode = prog...
8360 if test prog,link = "$linkmode,$pass"; then
8361 if test -n "$library_names" &&
8362 { { test no = "$prefer_static_libs" ||
8363 test built,yes = "$prefer_static_libs,$installed"; } ||
8364 test -z "$old_library"; }; then
8365 # We need to hardcode the library path
8366 if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
8367 # Make sure the rpath contains only unique directories.
8368 case $temp_rpath: in
8370 *) func_append temp_rpath "$absdir:" ;;
8374 # Hardcode the library path.
8375 # Skip directories that are in the system default run-time
8377 case " $sys_lib_dlsearch_path " in
8380 case "$compile_rpath " in
8382 *) func_append compile_rpath " $absdir" ;;
8386 case " $sys_lib_dlsearch_path " in
8389 case "$finalize_rpath " in
8391 *) func_append finalize_rpath " $libdir" ;;
8395 fi # $linkmode,$pass = prog,link...
8398 { test pass_all = "$deplibs_check_method" ||
8399 { test yes = "$build_libtool_libs" &&
8400 test -n "$library_names"; }; }; then
8401 # We only need to search for static libraries
8406 link_static=no # Whether the deplib will be linked statically
8407 use_static_libs=$prefer_static_libs
8408 if test built = "$use_static_libs" && test yes = "$installed"; then
8411 if test -n "$library_names" &&
8412 { test no = "$use_static_libs" || test -z "$old_library"; }; then
8414 *cygwin* | *mingw* | *cegcc* | *os2*)
8415 # No point in relinking DLLs because paths are not encoded
8416 func_append notinst_deplibs " $lib"
8420 if test no = "$installed"; then
8421 func_append notinst_deplibs " $lib"
8426 # This is a shared library
8428 # Warn about portability, can't link against -module's on some
8429 # systems (darwin). Don't bleat about dlopened modules though!
8431 for dlpremoduletest in $dlprefiles; do
8432 if test "X$dlpremoduletest" = "X$lib"; then
8433 dlopenmodule=$dlpremoduletest
8437 if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
8439 if test prog = "$linkmode"; then
8440 $ECHO "*** Warning: Linking the executable $output against the loadable module"
8442 $ECHO "*** Warning: Linking the shared library $output against the loadable module"
8444 $ECHO "*** $linklib is not portable!"
8446 if test lib = "$linkmode" &&
8447 test yes = "$hardcode_into_libs"; then
8448 # Hardcode the library path.
8449 # Skip directories that are in the system default run-time
8451 case " $sys_lib_dlsearch_path " in
8454 case "$compile_rpath " in
8456 *) func_append compile_rpath " $absdir" ;;
8460 case " $sys_lib_dlsearch_path " in
8463 case "$finalize_rpath " in
8465 *) func_append finalize_rpath " $libdir" ;;
8471 if test -n "$old_archive_from_expsyms_cmds"; then
8472 # figure out the soname
8473 set dummy $library_names
8477 libname=`eval "\\$ECHO \"$libname_spec\""`
8478 # use dlname if we got it. it's perfectly good, no?
8479 if test -n "$dlname"; then
8481 elif test -n "$soname_spec"; then
8484 *cygwin* | mingw* | *cegcc* | *os2*)
8485 func_arith $current - $age
8486 major=$func_arith_result
8490 eval soname=\"$soname_spec\"
8495 # Make a new name for the extract_expsyms_cmds to use
8497 func_basename "$soroot"
8498 soname=$func_basename_result
8499 func_stripname 'lib' '.dll' "$soname"
8500 newlib=libimp-$func_stripname_result.a
8502 # If the library has no export list, then create one now
8503 if test -f "$output_objdir/$soname-def"; then :
8505 func_verbose "extracting exported symbol list from '$soname'"
8506 func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
8510 if test -f "$output_objdir/$newlib"; then :; else
8511 func_verbose "generating import library for '$soname'"
8512 func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
8514 # make sure the library variables are pointing to the new library
8517 fi # test -n "$old_archive_from_expsyms_cmds"
8519 if test prog = "$linkmode" || test relink != "$opt_mode"; then
8524 case $hardcode_action in
8525 immediate | unsupported)
8526 if test no = "$hardcode_direct"; then
8529 *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
8530 *-*-sysv4*uw2*) add_dir=-L$dir ;;
8531 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
8532 *-*-unixware7*) add_dir=-L$dir ;;
8534 # if the lib is a (non-dlopened) module then we cannot
8535 # link against it, someone is ignoring the earlier warnings
8536 if /usr/bin/file -L $add 2> /dev/null |
8537 $GREP ": [^:]* bundle" >/dev/null; then
8538 if test "X$dlopenmodule" != "X$lib"; then
8539 $ECHO "*** Warning: lib $linklib is a module, not a shared library"
8540 if test -z "$old_library"; then
8542 echo "*** And there doesn't seem to be a static archive available"
8543 echo "*** The link will probably fail, sorry"
8545 add=$dir/$old_library
8547 elif test -n "$old_library"; then
8548 add=$dir/$old_library
8552 elif test no = "$hardcode_minus_L"; then
8554 *-*-sunos*) add_shlibpath=$dir ;;
8558 elif test no = "$hardcode_shlibpath_var"; then
8566 if test yes = "$hardcode_direct" &&
8567 test no = "$hardcode_direct_absolute"; then
8569 elif test yes = "$hardcode_minus_L"; then
8571 # Try looking first in the location we're being installed to.
8572 if test -n "$inst_prefix_dir"; then
8575 func_append add_dir " -L$inst_prefix_dir$libdir"
8580 elif test yes = "$hardcode_shlibpath_var"; then
8590 if test yes != "$lib_linked"; then
8591 func_fatal_configuration "unsupported hardcode properties"
8594 if test -n "$add_shlibpath"; then
8595 case :$compile_shlibpath: in
8596 *":$add_shlibpath:"*) ;;
8597 *) func_append compile_shlibpath "$add_shlibpath:" ;;
8600 if test prog = "$linkmode"; then
8601 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
8602 test -n "$add" && compile_deplibs="$add $compile_deplibs"
8604 test -n "$add_dir" && deplibs="$add_dir $deplibs"
8605 test -n "$add" && deplibs="$add $deplibs"
8606 if test yes != "$hardcode_direct" &&
8607 test yes != "$hardcode_minus_L" &&
8608 test yes = "$hardcode_shlibpath_var"; then
8609 case :$finalize_shlibpath: in
8611 *) func_append finalize_shlibpath "$libdir:" ;;
8617 if test prog = "$linkmode" || test relink = "$opt_mode"; then
8621 # Finalize command for both is simple: just hardcode it.
8622 if test yes = "$hardcode_direct" &&
8623 test no = "$hardcode_direct_absolute"; then
8624 add=$libdir/$linklib
8625 elif test yes = "$hardcode_minus_L"; then
8628 elif test yes = "$hardcode_shlibpath_var"; then
8629 case :$finalize_shlibpath: in
8631 *) func_append finalize_shlibpath "$libdir:" ;;
8634 elif test yes = "$hardcode_automatic"; then
8635 if test -n "$inst_prefix_dir" &&
8636 test -f "$inst_prefix_dir$libdir/$linklib"; then
8637 add=$inst_prefix_dir$libdir/$linklib
8639 add=$libdir/$linklib
8642 # We cannot seem to hardcode it, guess we'll fake it.
8644 # Try looking first in the location we're being installed to.
8645 if test -n "$inst_prefix_dir"; then
8648 func_append add_dir " -L$inst_prefix_dir$libdir"
8655 if test prog = "$linkmode"; then
8656 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
8657 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
8659 test -n "$add_dir" && deplibs="$add_dir $deplibs"
8660 test -n "$add" && deplibs="$add $deplibs"
8663 elif test prog = "$linkmode"; then
8664 # Here we assume that one of hardcode_direct or hardcode_minus_L
8665 # is not unsupported. This is valid on all known static and
8667 if test unsupported != "$hardcode_direct"; then
8668 test -n "$old_library" && linklib=$old_library
8669 compile_deplibs="$dir/$linklib $compile_deplibs"
8670 finalize_deplibs="$dir/$linklib $finalize_deplibs"
8672 compile_deplibs="-l$name -L$dir $compile_deplibs"
8673 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
8675 elif test yes = "$build_libtool_libs"; then
8676 # Not a shared library
8677 if test pass_all != "$deplibs_check_method"; then
8678 # We're trying link a shared library against a static one
8679 # but the system doesn't support it.
8681 # Just print a warning and add the library to dependency_libs so
8682 # that the program can be linked against the static library.
8684 $ECHO "*** Warning: This system cannot link to static lib archive $lib."
8685 echo "*** I have the capability to make that library automatically link in when"
8686 echo "*** you link to this library. But I can only do this if you have a"
8687 echo "*** shared version of the library, which you do not appear to have."
8688 if test yes = "$module"; then
8689 echo "*** But as you try to build a module library, libtool will still create "
8690 echo "*** a static module, that should work as long as the dlopening application"
8691 echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
8692 if test -z "$global_symbol_pipe"; then
8694 echo "*** However, this would only work if libtool was able to extract symbol"
8695 echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
8696 echo "*** not find such a program. So, this module is probably useless."
8697 echo "*** 'nm' from GNU binutils and a full rebuild may help."
8699 if test no = "$build_old_libs"; then
8700 build_libtool_libs=module
8703 build_libtool_libs=no
8707 deplibs="$dir/$old_library $deplibs"
8710 fi # link shared/static library?
8712 if test lib = "$linkmode"; then
8713 if test -n "$dependency_libs" &&
8714 { test yes != "$hardcode_into_libs" ||
8715 test yes = "$build_old_libs" ||
8716 test yes = "$link_static"; }; then
8717 # Extract -R from dependency_libs
8719 for libdir in $dependency_libs; do
8721 -R*) func_stripname '-R' '' "$libdir"
8722 temp_xrpath=$func_stripname_result
8724 *" $temp_xrpath "*) ;;
8725 *) func_append xrpath " $temp_xrpath";;
8727 *) func_append temp_deplibs " $libdir";;
8730 dependency_libs=$temp_deplibs
8733 func_append newlib_search_path " $absdir"
8734 # Link against this library
8735 test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
8736 # ... and its dependency_libs
8738 for deplib in $dependency_libs; do
8739 newdependency_libs="$deplib $newdependency_libs"
8741 -L*) func_stripname '-L' '' "$deplib"
8742 func_resolve_sysroot "$func_stripname_result";;
8743 *) func_resolve_sysroot "$deplib" ;;
8745 if $opt_preserve_dup_deps; then
8746 case "$tmp_libs " in
8747 *" $func_resolve_sysroot_result "*)
8748 func_append specialdeplibs " $func_resolve_sysroot_result" ;;
8751 func_append tmp_libs " $func_resolve_sysroot_result"
8754 if test no != "$link_all_deplibs"; then
8755 # Add the search paths of all dependency libraries
8756 for deplib in $dependency_libs; do
8759 -L*) path=$deplib ;;
8761 func_resolve_sysroot "$deplib"
8762 deplib=$func_resolve_sysroot_result
8763 func_dirname "$deplib" "" "."
8764 dir=$func_dirname_result
8765 # We need an absolute path.
8767 [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
8769 absdir=`cd "$dir" && pwd`
8770 if test -z "$absdir"; then
8771 func_warning "cannot determine absolute directory name of '$dir'"
8776 if $GREP "^installed=no" $deplib > /dev/null; then
8780 eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
8781 if test -n "$deplibrary_names"; then
8782 for tmp in $deplibrary_names; do
8785 if test -f "$absdir/$objdir/$depdepl"; then
8786 depdepl=$absdir/$objdir/$depdepl
8787 darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
8788 if test -z "$darwin_install_name"; then
8789 darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
8791 func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"
8792 func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"
8798 path=-L$absdir/$objdir
8802 eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
8803 test -z "$libdir" && \
8804 func_fatal_error "'$deplib' is not a valid libtool archive"
8805 test "$absdir" != "$libdir" && \
8806 func_warning "'$deplib' seems to be moved"
8812 case " $deplibs " in
8814 *) deplibs="$path $deplibs" ;;
8817 fi # link_all_deplibs != no
8819 done # for deplib in $libs
8820 if test link = "$pass"; then
8821 if test prog = "$linkmode"; then
8822 compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
8823 finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
8825 compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8828 dependency_libs=$newdependency_libs
8829 if test dlpreopen = "$pass"; then
8830 # Link the dlpreopened libraries before other libraries
8831 for deplib in $save_deplibs; do
8832 deplibs="$deplib $deplibs"
8835 if test dlopen != "$pass"; then
8836 test conv = "$pass" || {
8837 # Make sure lib_search_path contains only unique directories.
8839 for dir in $newlib_search_path; do
8840 case "$lib_search_path " in
8842 *) func_append lib_search_path " $dir" ;;
8848 if test prog,link = "$linkmode,$pass"; then
8849 vars="compile_deplibs finalize_deplibs"
8853 for var in $vars dependency_libs; do
8854 # Add libraries to $var in reverse order
8855 eval tmp_libs=\"\$$var\"
8857 for deplib in $tmp_libs; do
8858 # FIXME: Pedantically, this is the right thing to do, so
8859 # that some nasty dependency loop isn't accidentally
8861 #new_libs="$deplib $new_libs"
8862 # Pragmatically, this seems to cause very few problems in
8865 -L*) new_libs="$deplib $new_libs" ;;
8868 # And here is the reason: when a library appears more
8869 # than once as an explicit dependence of a library, or
8870 # is implicitly linked in more than once by the
8871 # compiler, it is considered special, and multiple
8872 # occurrences thereof are not removed. Compare this
8873 # with having the same library being listed as a
8874 # dependency of multiple other libraries: in this case,
8875 # we know (pedantically, we assume) the library does not
8876 # need to be listed more than once, so we keep only the
8877 # last copy. This is not always right, but it is rare
8878 # enough that we require users that really mean to play
8879 # such unportable linking tricks to link the library
8880 # using -Wl,-lname, so that libtool does not consider it
8881 # for duplicate removal.
8882 case " $specialdeplibs " in
8883 *" $deplib "*) new_libs="$deplib $new_libs" ;;
8885 case " $new_libs " in
8887 *) new_libs="$deplib $new_libs" ;;
8895 for deplib in $new_libs; do
8898 case " $tmp_libs " in
8900 *) func_append tmp_libs " $deplib" ;;
8903 *) func_append tmp_libs " $deplib" ;;
8906 eval $var=\"$tmp_libs\"
8910 # Add Sun CC postdeps if required:
8911 test CXX = "$tagname" && {
8914 case `$CC -V 2>&1 | $SED 5q` in
8915 *Sun\ C*) # Sun C++ 5.9
8918 if test no != "$suncc_use_cstd_abi"; then
8919 func_append postdeps ' -library=Cstd -library=Crun'
8926 func_cc_basename "$CC"
8927 case $func_cc_basename_result in
8931 if test no != "$suncc_use_cstd_abi"; then
8932 func_append postdeps ' -library=Cstd -library=Crun'
8940 # Last step: remove runtime libs from dependency_libs
8941 # (they stay in deplibs)
8943 for i in $dependency_libs; do
8944 case " $predeps $postdeps $compiler_lib_search_path " in
8949 if test -n "$i"; then
8950 func_append tmp_libs " $i"
8953 dependency_libs=$tmp_libs
8955 if test prog = "$linkmode"; then
8958 if test prog = "$linkmode" || test lib = "$linkmode"; then
8959 dlprefiles=$newdlprefiles
8964 if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
8965 func_warning "'-dlopen' is ignored for archives"
8970 func_warning "'-l' and '-L' are ignored for archives" ;;
8973 test -n "$rpath" && \
8974 func_warning "'-rpath' is ignored for archives"
8976 test -n "$xrpath" && \
8977 func_warning "'-R' is ignored for archives"
8979 test -n "$vinfo" && \
8980 func_warning "'-version-info/-version-number' is ignored for archives"
8982 test -n "$release" && \
8983 func_warning "'-release' is ignored for archives"
8985 test -n "$export_symbols$export_symbols_regex" && \
8986 func_warning "'-export-symbols' is ignored for archives"
8988 # Now set the variables for building old libraries.
8989 build_libtool_libs=no
8991 func_append objs "$old_deplibs"
8995 # Make sure we only generate libraries of the form 'libNAME.la'.
8998 func_stripname 'lib' '.la' "$outputname"
8999 name=$func_stripname_result
9000 eval shared_ext=\"$shrext_cmds\"
9001 eval libname=\"$libname_spec\"
9004 test no = "$module" \
9005 && func_fatal_help "libtool library '$output' must begin with 'lib'"
9007 if test no != "$need_lib_prefix"; then
9008 # Add the "lib" prefix for modules if required
9009 func_stripname '' '.la' "$outputname"
9010 name=$func_stripname_result
9011 eval shared_ext=\"$shrext_cmds\"
9012 eval libname=\"$libname_spec\"
9014 func_stripname '' '.la' "$outputname"
9015 libname=$func_stripname_result
9020 if test -n "$objs"; then
9021 if test pass_all != "$deplibs_check_method"; then
9022 func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
9025 $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
9026 $ECHO "*** objects $objs is not portable!"
9027 func_append libobjs " $objs"
9031 test no = "$dlself" \
9032 || func_warning "'-dlopen self' is ignored for libtool libraries"
9037 && func_warning "ignoring multiple '-rpath's for a libtool library"
9042 if test -z "$rpath"; then
9043 if test yes = "$build_libtool_libs"; then
9044 # Building a libtool convenience library.
9045 # Some compilers have problems with a '.al' extension so
9046 # convenience libraries should have the same extension an
9047 # archive normally would.
9048 oldlibs="$output_objdir/$libname.$libext $oldlibs"
9049 build_libtool_libs=convenience
9053 test -n "$vinfo" && \
9054 func_warning "'-version-info/-version-number' is ignored for convenience libraries"
9056 test -n "$release" && \
9057 func_warning "'-release' is ignored for convenience libraries"
9060 # Parse the version information argument.
9061 save_ifs=$IFS; IFS=:
9062 set dummy $vinfo 0 0 0
9067 func_fatal_help "too many parameters to '-version-info'"
9069 # convert absolute version numbers to libtool ages
9070 # this retains compatibility with .la files and attempts
9071 # to make the code below a bit more comprehensible
9073 case $vinfo_number in
9079 # There are really only two kinds -- those that
9080 # use the current revision as the major version
9081 # and those that subtract age and use age as
9082 # a minor version. But, then there is irix
9083 # that has an extra 1 added just for fun
9085 case $version_type in
9086 # correct linux to gnu/linux during the next big refactor
9087 darwin|freebsd-elf|linux|midnightbsd-elf|osf|windows|none)
9088 func_arith $number_major + $number_minor
9089 current=$func_arith_result
9091 revision=$number_revision
9093 freebsd-aout|qnx|sunos)
9094 current=$number_major
9095 revision=$number_minor
9099 func_arith $number_major + $number_minor
9100 current=$func_arith_result
9102 revision=$number_minor
9103 lt_irix_increment=no
9114 # Check that each of the things are valid numbers.
9116 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]) ;;
9118 func_error "CURRENT '$current' must be a nonnegative integer"
9119 func_fatal_error "'$vinfo' is not valid version information"
9124 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]) ;;
9126 func_error "REVISION '$revision' must be a nonnegative integer"
9127 func_fatal_error "'$vinfo' is not valid version information"
9132 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]) ;;
9134 func_error "AGE '$age' must be a nonnegative integer"
9135 func_fatal_error "'$vinfo' is not valid version information"
9139 if test "$age" -gt "$current"; then
9140 func_error "AGE '$age' is greater than the current interface number '$current'"
9141 func_fatal_error "'$vinfo' is not valid version information"
9144 # Calculate the version variables.
9148 case $version_type in
9152 # Like Linux, but with the current version available in
9153 # verstring for coding it into the library header
9154 func_arith $current - $age
9155 major=.$func_arith_result
9156 versuffix=$major.$age.$revision
9157 # Darwin ld doesn't like 0 for these options...
9158 func_arith $current + 1
9159 minor_current=$func_arith_result
9160 xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
9161 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
9162 # On Darwin other compilers
9165 verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
9168 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
9175 versuffix=.$current.$revision
9178 freebsd-elf | midnightbsd-elf)
9179 func_arith $current - $age
9180 major=.$func_arith_result
9181 versuffix=$major.$age.$revision
9185 if test no = "$lt_irix_increment"; then
9186 func_arith $current - $age
9188 func_arith $current - $age + 1
9190 major=$func_arith_result
9192 case $version_type in
9193 nonstopux) verstring_prefix=nonstopux ;;
9194 *) verstring_prefix=sgi ;;
9196 verstring=$verstring_prefix$major.$revision
9198 # Add in all the interfaces that we are compatible with.
9200 while test 0 -ne "$loop"; do
9201 func_arith $revision - $loop
9202 iface=$func_arith_result
9203 func_arith $loop - 1
9204 loop=$func_arith_result
9205 verstring=$verstring_prefix$major.$iface:$verstring
9208 # Before this point, $major must not contain '.'.
9210 versuffix=$major.$revision
9213 linux) # correct to gnu/linux during the next big refactor
9214 func_arith $current - $age
9215 major=.$func_arith_result
9216 versuffix=$major.$age.$revision
9220 func_arith $current - $age
9221 major=.$func_arith_result
9222 versuffix=.$current.$age.$revision
9223 verstring=$current.$age.$revision
9225 # Add in all the interfaces that we are compatible with.
9227 while test 0 -ne "$loop"; do
9228 func_arith $current - $loop
9229 iface=$func_arith_result
9230 func_arith $loop - 1
9231 loop=$func_arith_result
9232 verstring=$verstring:$iface.0
9235 # Make executables depend on our current version.
9236 func_append verstring ":$current.0"
9251 versuffix=.$current.$revision
9255 # Use '-' rather than '.', since we only want one
9256 # extension on DOS 8.3 file systems.
9257 func_arith $current - $age
9258 major=$func_arith_result
9263 func_fatal_configuration "unknown library version type '$version_type'"
9267 # Clear the version info if we defaulted, and they specified a release.
9268 if test -z "$vinfo" && test -n "$release"; then
9270 case $version_type in
9272 # we can't check for "0.0" in archive_cmds due to quoting
9273 # problems, so we reset it completely
9280 if test no = "$need_version"; then
9287 # Remove version info from name if versioning should be avoided
9288 if test yes,no = "$avoid_version,$need_version"; then
9294 # Check to see if the archive will have undefined symbols.
9295 if test yes = "$allow_undefined"; then
9296 if test unsupported = "$allow_undefined_flag"; then
9297 if test yes = "$build_old_libs"; then
9298 func_warning "undefined symbols not allowed in $host shared libraries; building static only"
9299 build_libtool_libs=no
9301 func_fatal_error "can't build $host shared library unless -no-undefined is specified"
9305 # Don't allow undefined symbols.
9306 allow_undefined_flag=$no_undefined_flag
9311 func_generate_dlsyms "$libname" "$libname" :
9312 func_append libobjs " $symfileobj"
9313 test " " = "$libobjs" && libobjs=
9315 if test relink != "$opt_mode"; then
9316 # Remove our outputs, but don't remove object files since they
9317 # may have been created when compiling PIC objects.
9319 tempremovelist=`$ECHO "$output_objdir/*"`
9320 for p in $tempremovelist; do
9324 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)
9325 if test -n "$precious_files_regex"; then
9326 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
9331 func_append removelist " $p"
9336 test -n "$removelist" && \
9337 func_show_eval "${RM}r \$removelist"
9340 # Now set the variables for building old libraries.
9341 if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then
9342 func_append oldlibs " $output_objdir/$libname.$libext"
9344 # Transform .lo files to .o files.
9345 oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`
9348 # Eliminate all temporary directories.
9349 #for path in $notinst_path; do
9350 # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
9351 # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
9352 # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
9355 if test -n "$xrpath"; then
9356 # If the user specified any rpath flags, then add them.
9358 for libdir in $xrpath; do
9359 func_replace_sysroot "$libdir"
9360 func_append temp_xrpath " -R$func_replace_sysroot_result"
9361 case "$finalize_rpath " in
9363 *) func_append finalize_rpath " $libdir" ;;
9366 if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then
9367 dependency_libs="$temp_xrpath $dependency_libs"
9371 # Make sure dlfiles contains only unique files that won't be dlpreopened
9372 old_dlfiles=$dlfiles
9374 for lib in $old_dlfiles; do
9375 case " $dlprefiles $dlfiles " in
9377 *) func_append dlfiles " $lib" ;;
9381 # Make sure dlprefiles contains only unique files
9382 old_dlprefiles=$dlprefiles
9384 for lib in $old_dlprefiles; do
9385 case "$dlprefiles " in
9387 *) func_append dlprefiles " $lib" ;;
9391 if test yes = "$build_libtool_libs"; then
9392 if test -n "$rpath"; then
9394 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
9395 # these systems don't actually have a c library (as such)!
9397 *-*-rhapsody* | *-*-darwin1.[012])
9398 # Rhapsody C library is in the System framework
9399 func_append deplibs " System.ltframework"
9402 # Don't link with libc until the a.out ld.so is fixed.
9404 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*)
9405 # Do not include libc due to us having libc/libc_r.
9407 *-*-sco3.2v5* | *-*-sco5v6*)
9408 # Causes problems with __ctype
9410 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
9411 # Compiler inserts libc in the correct place for threads to work
9414 # Add libc to deplibs on all other systems if necessary.
9415 if test yes = "$build_libtool_need_lc"; then
9416 func_append deplibs " -lc"
9422 # Transform deplibs into only deplibs that can be linked in shared.
9424 libname_save=$libname
9425 release_save=$release
9426 versuffix_save=$versuffix
9428 # I'm not sure if I'm treating the release correctly. I think
9429 # release should show up in the -l (ie -lgmp5) so we don't want to
9430 # add it in twice. Is that correct?
9436 case $deplibs_check_method in
9438 # Don't check for shared/static. Everything works.
9439 # This might be a little naive. We might want to check
9440 # whether the library exists or not. But this is on
9441 # osf3 & osf4 and I'm not really sure... Just
9442 # implementing what was already the behavior.
9446 # This code stresses the "libraries are programs" paradigm to its
9447 # limits. Maybe even breaks it. We compile a program, linking it
9448 # against the deplibs as a proxy for the library. Then we can check
9449 # whether they linked in statically or dynamically with ldd.
9450 $opt_dry_run || $RM conftest.c
9451 cat > conftest.c <<EOF
9452 int main() { return 0; }
9454 $opt_dry_run || $RM conftest
9455 if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
9456 ldd_output=`ldd conftest`
9457 for i in $deplibs; do
9460 func_stripname -l '' "$i"
9461 name=$func_stripname_result
9462 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
9463 case " $predeps $postdeps " in
9465 func_append newdeplibs " $i"
9470 if test -n "$i"; then
9471 libname=`eval "\\$ECHO \"$libname_spec\""`
9472 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
9473 set dummy $deplib_matches; shift
9475 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
9476 func_append newdeplibs " $i"
9480 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
9481 echo "*** I have the capability to make that library automatically link in when"
9482 echo "*** you link to this library. But I can only do this if you have a"
9483 echo "*** shared version of the library, which I believe you do not have"
9484 echo "*** because a test_compile did reveal that the linker did not use it for"
9485 echo "*** its dynamic dependency list that programs get resolved with at runtime."
9490 func_append newdeplibs " $i"
9495 # Error occurred in the first compile. Let's try to salvage
9496 # the situation: Compile a separate program for each library.
9497 for i in $deplibs; do
9500 func_stripname -l '' "$i"
9501 name=$func_stripname_result
9502 $opt_dry_run || $RM conftest
9503 if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
9504 ldd_output=`ldd conftest`
9505 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
9506 case " $predeps $postdeps " in
9508 func_append newdeplibs " $i"
9513 if test -n "$i"; then
9514 libname=`eval "\\$ECHO \"$libname_spec\""`
9515 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
9516 set dummy $deplib_matches; shift
9518 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
9519 func_append newdeplibs " $i"
9523 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
9524 echo "*** I have the capability to make that library automatically link in when"
9525 echo "*** you link to this library. But I can only do this if you have a"
9526 echo "*** shared version of the library, which you do not appear to have"
9527 echo "*** because a test_compile did reveal that the linker did not use this one"
9528 echo "*** as a dynamic dependency that programs can get resolved with at runtime."
9534 $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
9535 echo "*** make it link in! You will probably need to install it or some"
9536 echo "*** library that it depends on before this library will be fully"
9537 echo "*** functional. Installing it before continuing would be even better."
9541 func_append newdeplibs " $i"
9548 set dummy $deplibs_check_method; shift
9549 file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
9550 for a_deplib in $deplibs; do
9553 func_stripname -l '' "$a_deplib"
9554 name=$func_stripname_result
9555 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
9556 case " $predeps $postdeps " in
9558 func_append newdeplibs " $a_deplib"
9563 if test -n "$a_deplib"; then
9564 libname=`eval "\\$ECHO \"$libname_spec\""`
9565 if test -n "$file_magic_glob"; then
9566 libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
9568 libnameglob=$libname
9570 test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`
9571 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
9572 if test yes = "$want_nocaseglob"; then
9574 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
9577 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
9579 for potent_lib in $potential_libs; do
9580 # Follow soft links.
9581 if ls -lLd "$potent_lib" 2>/dev/null |
9582 $GREP " -> " >/dev/null; then
9585 # The statement above tries to avoid entering an
9586 # endless loop below, in case of cyclic links.
9587 # We might still enter an endless loop, since a link
9588 # loop can be closed while we follow links,
9591 while test -h "$potlib" 2>/dev/null; do
9592 potliblink=`ls -ld $potlib | $SED 's/.* -> //'`
9594 [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
9595 *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
9598 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
9600 $EGREP "$file_magic_regex" > /dev/null; then
9601 func_append newdeplibs " $a_deplib"
9608 if test -n "$a_deplib"; then
9611 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
9612 echo "*** I have the capability to make that library automatically link in when"
9613 echo "*** you link to this library. But I can only do this if you have a"
9614 echo "*** shared version of the library, which you do not appear to have"
9615 echo "*** because I did check the linker path looking for a file starting"
9616 if test -z "$potlib"; then
9617 $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
9619 $ECHO "*** with $libname and none of the candidates passed a file format test"
9620 $ECHO "*** using a file magic. Last file checked: $potlib"
9625 # Add a -L argument.
9626 func_append newdeplibs " $a_deplib"
9629 done # Gone through all deplibs.
9632 set dummy $deplibs_check_method; shift
9633 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
9634 for a_deplib in $deplibs; do
9637 func_stripname -l '' "$a_deplib"
9638 name=$func_stripname_result
9639 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
9640 case " $predeps $postdeps " in
9642 func_append newdeplibs " $a_deplib"
9647 if test -n "$a_deplib"; then
9648 libname=`eval "\\$ECHO \"$libname_spec\""`
9649 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
9650 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
9651 for potent_lib in $potential_libs; do
9652 potlib=$potent_lib # see symlink-check above in file_magic test
9653 if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
9654 $EGREP "$match_pattern_regex" > /dev/null; then
9655 func_append newdeplibs " $a_deplib"
9662 if test -n "$a_deplib"; then
9665 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
9666 echo "*** I have the capability to make that library automatically link in when"
9667 echo "*** you link to this library. But I can only do this if you have a"
9668 echo "*** shared version of the library, which you do not appear to have"
9669 echo "*** because I did check the linker path looking for a file starting"
9670 if test -z "$potlib"; then
9671 $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
9673 $ECHO "*** with $libname and none of the candidates passed a file format test"
9674 $ECHO "*** using a regex pattern. Last file checked: $potlib"
9679 # Add a -L argument.
9680 func_append newdeplibs " $a_deplib"
9683 done # Gone through all deplibs.
9687 tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
9688 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
9689 for i in $predeps $postdeps; do
9690 # can't use Xsed below, because $i might contain '/'
9691 tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
9694 case $tmp_deplibs in
9697 if test none = "$deplibs_check_method"; then
9698 echo "*** Warning: inter-library dependencies are not supported in this platform."
9700 echo "*** Warning: inter-library dependencies are not known to be supported."
9702 echo "*** All declared inter-library dependencies are being dropped."
9708 versuffix=$versuffix_save
9710 release=$release_save
9711 libname=$libname_save
9715 *-*-rhapsody* | *-*-darwin1.[012])
9716 # On Rhapsody replace the C library with the System framework
9717 newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
9721 if test yes = "$droppeddeps"; then
9722 if test yes = "$module"; then
9724 echo "*** Warning: libtool could not satisfy all declared inter-library"
9725 $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
9726 echo "*** a static module, that should work as long as the dlopening"
9727 echo "*** application is linked with the -dlopen flag."
9728 if test -z "$global_symbol_pipe"; then
9730 echo "*** However, this would only work if libtool was able to extract symbol"
9731 echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
9732 echo "*** not find such a program. So, this module is probably useless."
9733 echo "*** 'nm' from GNU binutils and a full rebuild may help."
9735 if test no = "$build_old_libs"; then
9736 oldlibs=$output_objdir/$libname.$libext
9737 build_libtool_libs=module
9740 build_libtool_libs=no
9743 echo "*** The inter-library dependencies that have been dropped here will be"
9744 echo "*** automatically added whenever a program is linked with this library"
9745 echo "*** or is declared to -dlopen it."
9747 if test no = "$allow_undefined"; then
9749 echo "*** Since this library must not contain undefined symbols,"
9750 echo "*** because either the platform does not support them or"
9751 echo "*** it was explicitly requested with -no-undefined,"
9752 echo "*** libtool will only create a static version of it."
9753 if test no = "$build_old_libs"; then
9754 oldlibs=$output_objdir/$libname.$libext
9755 build_libtool_libs=module
9758 build_libtool_libs=no
9763 # Done checking deplibs!
9766 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
9769 newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
9770 new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
9771 deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
9775 # move library search paths that coincide with paths to not yet
9776 # installed libraries to the beginning of the library search list
9778 for path in $notinst_path; do
9779 case " $new_libs " in
9780 *" -L$path/$objdir "*) ;;
9782 case " $deplibs " in
9783 *" -L$path/$objdir "*)
9784 func_append new_libs " -L$path/$objdir" ;;
9789 for deplib in $deplibs; do
9792 case " $new_libs " in
9794 *) func_append new_libs " $deplib" ;;
9797 *) func_append new_libs " $deplib" ;;
9802 # All the library-specific variables (install_libdir is set above).
9807 # Test again, we may have decided not to build it any more
9808 if test yes = "$build_libtool_libs"; then
9809 # Remove $wl instances when linking with ld.
9810 # FIXME: should test the right _cmds variable.
9811 case $archive_cmds in
9814 if test yes = "$hardcode_into_libs"; then
9815 # Hardcode the library paths
9818 rpath=$finalize_rpath
9819 test relink = "$opt_mode" || rpath=$compile_rpath$rpath
9820 for libdir in $rpath; do
9821 if test -n "$hardcode_libdir_flag_spec"; then
9822 if test -n "$hardcode_libdir_separator"; then
9823 func_replace_sysroot "$libdir"
9824 libdir=$func_replace_sysroot_result
9825 if test -z "$hardcode_libdirs"; then
9826 hardcode_libdirs=$libdir
9828 # Just accumulate the unique libdirs.
9829 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
9830 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
9833 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
9838 eval flag=\"$hardcode_libdir_flag_spec\"
9839 func_append dep_rpath " $flag"
9841 elif test -n "$runpath_var"; then
9842 case "$perm_rpath " in
9844 *) func_append perm_rpath " $libdir" ;;
9848 # Substitute the hardcoded libdirs into the rpath.
9849 if test -n "$hardcode_libdir_separator" &&
9850 test -n "$hardcode_libdirs"; then
9851 libdir=$hardcode_libdirs
9852 eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
9854 if test -n "$runpath_var" && test -n "$perm_rpath"; then
9855 # We should set the runpath_var.
9857 for dir in $perm_rpath; do
9858 func_append rpath "$dir:"
9860 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
9862 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
9865 shlibpath=$finalize_shlibpath
9866 test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath
9867 if test -n "$shlibpath"; then
9868 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
9871 # Get the real and link names of the library.
9872 eval shared_ext=\"$shrext_cmds\"
9873 eval library_names=\"$library_names_spec\"
9874 set dummy $library_names
9879 if test -n "$soname_spec"; then
9880 eval soname=\"$soname_spec\"
9884 if test -z "$dlname"; then
9888 lib=$output_objdir/$realname
9892 func_append linknames " $link"
9895 # Use standard objects if they are pic
9896 test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
9897 test "X$libobjs" = "X " && libobjs=
9900 if test -n "$export_symbols" && test -n "$include_expsyms"; then
9901 $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
9902 export_symbols=$output_objdir/$libname.uexp
9903 func_append delfiles " $export_symbols"
9906 orig_export_symbols=
9908 cygwin* | mingw* | cegcc*)
9909 if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
9910 # exporting using user supplied symfile
9911 func_dll_def_p "$export_symbols" || {
9912 # and it's NOT already a .def file. Must figure out
9913 # which of the given symbols are data symbols and tag
9914 # them as such. So, trigger use of export_symbols_cmds.
9915 # export_symbols gets reassigned inside the "prepare
9916 # the list of exported symbols" if statement, so the
9917 # include_expsyms logic still works.
9918 orig_export_symbols=$export_symbols
9920 always_export_symbols=yes
9926 # Prepare the list of exported symbols
9927 if test -z "$export_symbols"; then
9928 if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then
9929 func_verbose "generating symbol list for '$libname.la'"
9930 export_symbols=$output_objdir/$libname.exp
9931 $opt_dry_run || $RM $export_symbols
9932 cmds=$export_symbols_cmds
9933 save_ifs=$IFS; IFS='~'
9934 for cmd1 in $cmds; do
9936 # Take the normal branch if the nm_file_list_spec branch
9937 # doesn't work or if tool conversion is not needed.
9938 case $nm_file_list_spec~$to_tool_file_cmd in
9939 *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
9940 try_normal_branch=yes
9943 len=$func_len_result
9946 try_normal_branch=no
9949 if test yes = "$try_normal_branch" \
9950 && { test "$len" -lt "$max_cmd_len" \
9951 || test "$max_cmd_len" -le -1; }
9953 func_show_eval "$cmd" 'exit $?'
9954 skipped_export=false
9955 elif test -n "$nm_file_list_spec"; then
9956 func_basename "$output"
9957 output_la=$func_basename_result
9958 save_libobjs=$libobjs
9960 output=$output_objdir/$output_la.nm
9961 func_to_tool_file "$output"
9962 libobjs=$nm_file_list_spec$func_to_tool_file_result
9963 func_append delfiles " $output"
9964 func_verbose "creating $NM input file list: $output"
9965 for obj in $save_libobjs; do
9966 func_to_tool_file "$obj"
9967 $ECHO "$func_to_tool_file_result"
9970 func_show_eval "$cmd" 'exit $?'
9972 libobjs=$save_libobjs
9973 skipped_export=false
9975 # The command line is too long to execute in one step.
9976 func_verbose "using reloadable object file for export list..."
9978 # Break out early, otherwise skipped_export may be
9979 # set to false by a later but shorter cmd.
9984 if test -n "$export_symbols_regex" && test : != "$skipped_export"; then
9985 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
9986 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
9991 if test -n "$export_symbols" && test -n "$include_expsyms"; then
9992 tmp_export_symbols=$export_symbols
9993 test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
9994 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
9997 if test : != "$skipped_export" && test -n "$orig_export_symbols"; then
9998 # The given exports_symbols file has to be filtered, so filter it.
9999 func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
10000 # FIXME: $output_objdir/$libname.filter potentially contains lots of
10001 # 's' commands, which not all seds can handle. GNU sed should be fine
10002 # though. Also, the filter scales superlinearly with the number of
10003 # global variables. join(1) would be nice here, but unfortunately
10004 # isn't a blessed tool.
10005 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
10006 func_append delfiles " $export_symbols $output_objdir/$libname.filter"
10007 export_symbols=$output_objdir/$libname.def
10008 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
10012 for test_deplib in $deplibs; do
10013 case " $convenience " in
10014 *" $test_deplib "*) ;;
10016 func_append tmp_deplibs " $test_deplib"
10020 deplibs=$tmp_deplibs
10022 if test -n "$convenience"; then
10023 if test -n "$whole_archive_flag_spec" &&
10024 test yes = "$compiler_needs_object" &&
10025 test -z "$libobjs"; then
10026 # extract the archives, so we have objects to list.
10027 # TODO: could optimize this to just extract one archive.
10028 whole_archive_flag_spec=
10030 if test -n "$whole_archive_flag_spec"; then
10031 save_libobjs=$libobjs
10032 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
10033 test "X$libobjs" = "X " && libobjs=
10035 gentop=$output_objdir/${outputname}x
10036 func_append generated " $gentop"
10038 func_extract_archives $gentop $convenience
10039 func_append libobjs " $func_extract_archives_result"
10040 test "X$libobjs" = "X " && libobjs=
10044 if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
10045 eval flag=\"$thread_safe_flag_spec\"
10046 func_append linker_flags " $flag"
10049 # Make a backup of the uninstalled library when relinking
10050 if test relink = "$opt_mode"; then
10051 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
10054 # Do each of the archive commands.
10055 if test yes = "$module" && test -n "$module_cmds"; then
10056 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
10057 eval test_cmds=\"$module_expsym_cmds\"
10058 cmds=$module_expsym_cmds
10060 eval test_cmds=\"$module_cmds\"
10064 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
10065 eval test_cmds=\"$archive_expsym_cmds\"
10066 cmds=$archive_expsym_cmds
10068 eval test_cmds=\"$archive_cmds\"
10073 if test : != "$skipped_export" &&
10074 func_len " $test_cmds" &&
10075 len=$func_len_result &&
10076 test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
10079 # The command line is too long to link in one step, link piecewise
10080 # or, if using GNU ld and skipped_export is not :, use a linker
10083 # Save the value of $output and $libobjs because we want to
10084 # use them later. If we have whole_archive_flag_spec, we
10085 # want to use save_libobjs as it was before
10086 # whole_archive_flag_spec was expanded, because we can't
10087 # assume the linker understands whole_archive_flag_spec.
10088 # This may have to be revisited, in case too many
10089 # convenience libraries get linked in and end up exceeding
10091 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
10092 save_libobjs=$libobjs
10094 save_output=$output
10095 func_basename "$output"
10096 output_la=$func_basename_result
10098 # Clear the reloadable object creation command queue and
10099 # initialize k to one.
10106 if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
10107 output=$output_objdir/$output_la.lnkscript
10108 func_verbose "creating GNU ld script: $output"
10109 echo 'INPUT (' > $output
10110 for obj in $save_libobjs
10112 func_to_tool_file "$obj"
10113 $ECHO "$func_to_tool_file_result" >> $output
10115 echo ')' >> $output
10116 func_append delfiles " $output"
10117 func_to_tool_file "$output"
10118 output=$func_to_tool_file_result
10119 elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
10120 output=$output_objdir/$output_la.lnk
10121 func_verbose "creating linker input file list: $output"
10123 set x $save_libobjs
10126 if test yes = "$compiler_needs_object"; then
10132 func_to_tool_file "$obj"
10133 $ECHO "$func_to_tool_file_result" >> $output
10135 func_append delfiles " $output"
10136 func_to_tool_file "$output"
10137 output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
10139 if test -n "$save_libobjs"; then
10140 func_verbose "creating reloadable object files..."
10141 output=$output_objdir/$output_la-$k.$objext
10142 eval test_cmds=\"$reload_cmds\"
10143 func_len " $test_cmds"
10144 len0=$func_len_result
10147 # Loop over the list of objects to be linked.
10148 for obj in $save_libobjs
10151 func_arith $len + $func_len_result
10152 len=$func_arith_result
10153 if test -z "$objlist" ||
10154 test "$len" -lt "$max_cmd_len"; then
10155 func_append objlist " $obj"
10157 # The command $test_cmds is almost too long, add a
10158 # command to the queue.
10159 if test 1 -eq "$k"; then
10160 # The first file doesn't have a previous command to add.
10161 reload_objs=$objlist
10162 eval concat_cmds=\"$reload_cmds\"
10164 # All subsequent reloadable object files will link in
10165 # the last one created.
10166 reload_objs="$objlist $last_robj"
10167 eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
10169 last_robj=$output_objdir/$output_la-$k.$objext
10171 k=$func_arith_result
10172 output=$output_objdir/$output_la-$k.$objext
10174 func_len " $last_robj"
10175 func_arith $len0 + $func_len_result
10176 len=$func_arith_result
10179 # Handle the remaining objects by creating one last
10180 # reloadable object file. All subsequent reloadable object
10181 # files will link in the last one created.
10182 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
10183 reload_objs="$objlist $last_robj"
10184 eval concat_cmds=\"\$concat_cmds$reload_cmds\"
10185 if test -n "$last_robj"; then
10186 eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
10188 func_append delfiles " $output"
10194 ${skipped_export-false} && {
10195 func_verbose "generating symbol list for '$libname.la'"
10196 export_symbols=$output_objdir/$libname.exp
10197 $opt_dry_run || $RM $export_symbols
10199 # Append the command to create the export file.
10200 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
10201 eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
10202 if test -n "$last_robj"; then
10203 eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
10207 test -n "$save_libobjs" &&
10208 func_verbose "creating a temporary reloadable object file: $output"
10210 # Loop through the commands generated above and execute them.
10211 save_ifs=$IFS; IFS='~'
10212 for cmd in $concat_cmds; do
10215 func_quote_arg expand,pretty "$cmd"
10216 eval "func_echo $func_quote_arg_result"
10218 $opt_dry_run || eval "$cmd" || {
10221 # Restore the uninstalled library and exit
10222 if test relink = "$opt_mode"; then
10223 ( cd "$output_objdir" && \
10224 $RM "${realname}T" && \
10225 $MV "${realname}U" "$realname" )
10233 if test -n "$export_symbols_regex" && ${skipped_export-false}; then
10234 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
10235 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
10239 ${skipped_export-false} && {
10240 if test -n "$export_symbols" && test -n "$include_expsyms"; then
10241 tmp_export_symbols=$export_symbols
10242 test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
10243 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
10246 if test -n "$orig_export_symbols"; then
10247 # The given exports_symbols file has to be filtered, so filter it.
10248 func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
10249 # FIXME: $output_objdir/$libname.filter potentially contains lots of
10250 # 's' commands, which not all seds can handle. GNU sed should be fine
10251 # though. Also, the filter scales superlinearly with the number of
10252 # global variables. join(1) would be nice here, but unfortunately
10253 # isn't a blessed tool.
10254 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
10255 func_append delfiles " $export_symbols $output_objdir/$libname.filter"
10256 export_symbols=$output_objdir/$libname.def
10257 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
10262 # Restore the value of output.
10263 output=$save_output
10265 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
10266 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
10267 test "X$libobjs" = "X " && libobjs=
10269 # Expand the library linking commands again to reset the
10270 # value of $libobjs for piecewise linking.
10272 # Do each of the archive commands.
10273 if test yes = "$module" && test -n "$module_cmds"; then
10274 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
10275 cmds=$module_expsym_cmds
10280 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
10281 cmds=$archive_expsym_cmds
10288 if test -n "$delfiles"; then
10289 # Append the command to remove temporary files to $cmds.
10290 eval cmds=\"\$cmds~\$RM $delfiles\"
10293 # Add any objects from preloaded convenience libraries
10294 if test -n "$dlprefiles"; then
10295 gentop=$output_objdir/${outputname}x
10296 func_append generated " $gentop"
10298 func_extract_archives $gentop $dlprefiles
10299 func_append libobjs " $func_extract_archives_result"
10300 test "X$libobjs" = "X " && libobjs=
10303 save_ifs=$IFS; IFS='~'
10304 for cmd in $cmds; do
10309 func_quote_arg expand,pretty "$cmd"
10310 eval "func_echo $func_quote_arg_result"
10312 $opt_dry_run || eval "$cmd" || {
10315 # Restore the uninstalled library and exit
10316 if test relink = "$opt_mode"; then
10317 ( cd "$output_objdir" && \
10318 $RM "${realname}T" && \
10319 $MV "${realname}U" "$realname" )
10327 # Restore the uninstalled library and exit
10328 if test relink = "$opt_mode"; then
10329 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
10331 if test -n "$convenience"; then
10332 if test -z "$whole_archive_flag_spec"; then
10333 func_show_eval '${RM}r "$gentop"'
10340 # Create links to the real library.
10341 for linkname in $linknames; do
10342 if test "$realname" != "$linkname"; then
10343 func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
10347 # If -module or -export-dynamic was specified, set the dlname.
10348 if test yes = "$module" || test yes = "$export_dynamic"; then
10349 # On all known operating systems, these are identical.
10356 if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
10357 func_warning "'-dlopen' is ignored for objects"
10360 case " $deplibs" in
10362 func_warning "'-l' and '-L' are ignored for objects" ;;
10365 test -n "$rpath" && \
10366 func_warning "'-rpath' is ignored for objects"
10368 test -n "$xrpath" && \
10369 func_warning "'-R' is ignored for objects"
10371 test -n "$vinfo" && \
10372 func_warning "'-version-info' is ignored for objects"
10374 test -n "$release" && \
10375 func_warning "'-release' is ignored for objects"
10379 test -n "$objs$old_deplibs" && \
10380 func_fatal_error "cannot build library object '$output' from non-libtool objects"
10383 func_lo2o "$libobj"
10384 obj=$func_lo2o_result
10392 # Delete the old objects.
10393 $opt_dry_run || $RM $obj $libobj
10395 # Objects from convenience libraries. This assumes
10396 # single-version convenience libraries. Whenever we create
10397 # different ones for PIC/non-PIC, this we'll have to duplicate
10401 # if reload_cmds runs $LD directly, get rid of -Wl from
10402 # whole_archive_flag_spec and hope we can get by with turning comma
10404 case $reload_cmds in
10405 *\$LD[\ \$]*) wl= ;;
10407 if test -n "$convenience"; then
10408 if test -n "$whole_archive_flag_spec"; then
10409 eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
10410 test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
10411 reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags
10413 gentop=$output_objdir/${obj}x
10414 func_append generated " $gentop"
10416 func_extract_archives $gentop $convenience
10417 reload_conv_objs="$reload_objs $func_extract_archives_result"
10421 # If we're not building shared, we need to use non_pic_objs
10422 test yes = "$build_libtool_libs" || libobjs=$non_pic_objects
10424 # Create the old-style object.
10425 reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs
10428 func_execute_cmds "$reload_cmds" 'exit $?'
10430 # Exit if we aren't doing a library object file.
10431 if test -z "$libobj"; then
10432 if test -n "$gentop"; then
10433 func_show_eval '${RM}r "$gentop"'
10439 test yes = "$build_libtool_libs" || {
10440 if test -n "$gentop"; then
10441 func_show_eval '${RM}r "$gentop"'
10444 # Create an invalid libtool object if no PIC, so that we don't
10445 # accidentally link it into a program.
10446 # $show "echo timestamp > $libobj"
10447 # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
10451 if test -n "$pic_flag" || test default != "$pic_mode"; then
10452 # Only do commands if we really have different PIC objects.
10453 reload_objs="$libobjs $reload_conv_objs"
10455 func_execute_cmds "$reload_cmds" 'exit $?'
10458 if test -n "$gentop"; then
10459 func_show_eval '${RM}r "$gentop"'
10467 *cygwin*) func_stripname '' '.exe' "$output"
10468 output=$func_stripname_result.exe;;
10470 test -n "$vinfo" && \
10471 func_warning "'-version-info' is ignored for programs"
10473 test -n "$release" && \
10474 func_warning "'-release' is ignored for programs"
10477 && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \
10478 && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."
10481 *-*-rhapsody* | *-*-darwin1.[012])
10482 # On Rhapsody replace the C library is the System framework
10483 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
10484 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
10490 # Don't allow lazy linking, it breaks C++ global constructors
10491 # But is supposedly fixed on 10.4 or later (yay!).
10492 if test CXX = "$tagname"; then
10493 case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
10495 func_append compile_command " $wl-bind_at_load"
10496 func_append finalize_command " $wl-bind_at_load"
10500 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
10501 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
10502 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
10507 # move library search paths that coincide with paths to not yet
10508 # installed libraries to the beginning of the library search list
10510 for path in $notinst_path; do
10511 case " $new_libs " in
10512 *" -L$path/$objdir "*) ;;
10514 case " $compile_deplibs " in
10515 *" -L$path/$objdir "*)
10516 func_append new_libs " -L$path/$objdir" ;;
10521 for deplib in $compile_deplibs; do
10524 case " $new_libs " in
10526 *) func_append new_libs " $deplib" ;;
10529 *) func_append new_libs " $deplib" ;;
10532 compile_deplibs=$new_libs
10535 func_append compile_command " $compile_deplibs"
10536 func_append finalize_command " $finalize_deplibs"
10538 if test -n "$rpath$xrpath"; then
10539 # If the user specified any rpath flags, then add them.
10540 for libdir in $rpath $xrpath; do
10541 # This is the magic to use -rpath.
10542 case "$finalize_rpath " in
10544 *) func_append finalize_rpath " $libdir" ;;
10549 # Now hardcode the library paths
10552 for libdir in $compile_rpath $finalize_rpath; do
10553 if test -n "$hardcode_libdir_flag_spec"; then
10554 if test -n "$hardcode_libdir_separator"; then
10555 if test -z "$hardcode_libdirs"; then
10556 hardcode_libdirs=$libdir
10558 # Just accumulate the unique libdirs.
10559 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
10560 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
10563 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
10568 eval flag=\"$hardcode_libdir_flag_spec\"
10569 func_append rpath " $flag"
10571 elif test -n "$runpath_var"; then
10572 case "$perm_rpath " in
10574 *) func_append perm_rpath " $libdir" ;;
10578 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
10579 testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
10580 case :$dllsearchpath: in
10582 ::) dllsearchpath=$libdir;;
10583 *) func_append dllsearchpath ":$libdir";;
10585 case :$dllsearchpath: in
10586 *":$testbindir:"*) ;;
10587 ::) dllsearchpath=$testbindir;;
10588 *) func_append dllsearchpath ":$testbindir";;
10593 # Substitute the hardcoded libdirs into the rpath.
10594 if test -n "$hardcode_libdir_separator" &&
10595 test -n "$hardcode_libdirs"; then
10596 libdir=$hardcode_libdirs
10597 eval rpath=\" $hardcode_libdir_flag_spec\"
10599 compile_rpath=$rpath
10603 for libdir in $finalize_rpath; do
10604 if test -n "$hardcode_libdir_flag_spec"; then
10605 if test -n "$hardcode_libdir_separator"; then
10606 if test -z "$hardcode_libdirs"; then
10607 hardcode_libdirs=$libdir
10609 # Just accumulate the unique libdirs.
10610 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
10611 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
10614 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
10619 eval flag=\"$hardcode_libdir_flag_spec\"
10620 func_append rpath " $flag"
10622 elif test -n "$runpath_var"; then
10623 case "$finalize_perm_rpath " in
10625 *) func_append finalize_perm_rpath " $libdir" ;;
10629 # Substitute the hardcoded libdirs into the rpath.
10630 if test -n "$hardcode_libdir_separator" &&
10631 test -n "$hardcode_libdirs"; then
10632 libdir=$hardcode_libdirs
10633 eval rpath=\" $hardcode_libdir_flag_spec\"
10635 finalize_rpath=$rpath
10637 if test -n "$libobjs" && test yes = "$build_old_libs"; then
10638 # Transform all the library objects into standard objects.
10639 compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
10640 finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
10643 func_generate_dlsyms "$outputname" "@PROGRAM@" false
10645 # template prelinking step
10646 if test -n "$prelink_cmds"; then
10647 func_execute_cmds "$prelink_cmds" 'exit $?'
10650 wrappers_required=:
10652 *cegcc* | *mingw32ce*)
10653 # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
10654 wrappers_required=false
10656 *cygwin* | *mingw* )
10657 test yes = "$build_libtool_libs" || wrappers_required=false
10660 if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
10661 wrappers_required=false
10665 $wrappers_required || {
10666 # Replace the output file specification.
10667 compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
10668 link_command=$compile_command$compile_rpath
10670 # We have no uninstalled library dependencies, so finalize right now.
10672 func_show_eval "$link_command" 'exit_status=$?'
10674 if test -n "$postlink_cmds"; then
10675 func_to_tool_file "$output"
10676 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
10677 func_execute_cmds "$postlink_cmds" 'exit $?'
10680 # Delete the generated files.
10681 if test -f "$output_objdir/${outputname}S.$objext"; then
10682 func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'
10688 if test -n "$compile_shlibpath$finalize_shlibpath"; then
10689 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
10691 if test -n "$finalize_shlibpath"; then
10692 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
10697 if test -n "$runpath_var"; then
10698 if test -n "$perm_rpath"; then
10699 # We should set the runpath_var.
10701 for dir in $perm_rpath; do
10702 func_append rpath "$dir:"
10704 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
10706 if test -n "$finalize_perm_rpath"; then
10707 # We should set the runpath_var.
10709 for dir in $finalize_perm_rpath; do
10710 func_append rpath "$dir:"
10712 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
10716 if test yes = "$no_install"; then
10717 # We don't need to create a wrapper script.
10718 link_command=$compile_var$compile_command$compile_rpath
10719 # Replace the output file specification.
10720 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
10721 # Delete the old output file.
10722 $opt_dry_run || $RM $output
10723 # Link the executable and exit
10724 func_show_eval "$link_command" 'exit $?'
10726 if test -n "$postlink_cmds"; then
10727 func_to_tool_file "$output"
10728 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
10729 func_execute_cmds "$postlink_cmds" 'exit $?'
10735 case $hardcode_action,$fast_install in
10737 # Fast installation is not supported
10738 link_command=$compile_var$compile_command$compile_rpath
10739 relink_command=$finalize_var$finalize_command$finalize_rpath
10741 func_warning "this platform does not like uninstalled shared libraries"
10742 func_warning "'$output' will be relinked during installation"
10745 link_command=$finalize_var$compile_command$finalize_rpath
10746 relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
10749 link_command=$compile_var$compile_command$compile_rpath
10750 relink_command=$finalize_var$finalize_command$finalize_rpath
10753 link_command=$finalize_var$compile_command$finalize_rpath
10758 # Replace the output file specification.
10759 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
10761 # Delete the old output files.
10762 $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
10764 func_show_eval "$link_command" 'exit $?'
10766 if test -n "$postlink_cmds"; then
10767 func_to_tool_file "$output_objdir/$outputname"
10768 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
10769 func_execute_cmds "$postlink_cmds" 'exit $?'
10772 # Now create the wrapper script.
10773 func_verbose "creating $output"
10775 # Quote the relink command for shipping.
10776 if test -n "$relink_command"; then
10777 # Preserve any variables that may affect compiler behavior
10778 for var in $variables_saved_for_relink; do
10779 if eval test -z \"\${$var+set}\"; then
10780 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
10781 elif eval var_value=\$$var; test -z "$var_value"; then
10782 relink_command="$var=; export $var; $relink_command"
10784 func_quote_arg pretty "$var_value"
10785 relink_command="$var=$func_quote_arg_result; export $var; $relink_command"
10788 func_quote eval cd "`pwd`"
10789 func_quote_arg pretty,unquoted "($func_quote_result; $relink_command)"
10790 relink_command=$func_quote_arg_unquoted_result
10793 # Only actually do things if not in dry run mode.
10795 # win32 will think the script is a binary if it has
10796 # a .exe suffix, so we strip it off here.
10798 *.exe) func_stripname '' '.exe' "$output"
10799 output=$func_stripname_result ;;
10801 # test for cygwin because mv fails w/o .exe extensions
10805 func_stripname '' '.exe' "$outputname"
10806 outputname=$func_stripname_result ;;
10810 *cygwin* | *mingw* )
10811 func_dirname_and_basename "$output" "" "."
10812 output_name=$func_basename_result
10813 output_path=$func_dirname_result
10814 cwrappersource=$output_path/$objdir/lt-$output_name.c
10815 cwrapper=$output_path/$output_name.exe
10816 $RM $cwrappersource $cwrapper
10817 trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
10819 func_emit_cwrapperexe_src > $cwrappersource
10821 # The wrapper executable is built using the $host compiler,
10822 # because it contains $host paths and files. If cross-
10823 # compiling, it, like the target executable, must be
10824 # executed on the $host or under an emulation environment.
10826 $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
10830 # Now, create the wrapper script for func_source use:
10831 func_ltwrapper_scriptname $cwrapper
10832 $RM $func_ltwrapper_scriptname_result
10833 trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
10835 # note: this script will not be executed, so do not chmod.
10836 if test "x$build" = "x$host"; then
10837 $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
10839 func_emit_wrapper no > $func_ltwrapper_scriptname_result
10845 trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
10847 func_emit_wrapper no > $output
10856 # See if we need to build an old-fashioned archive.
10857 for oldlib in $oldlibs; do
10859 case $build_libtool_libs in
10861 oldobjs="$libobjs_save $symfileobj"
10862 addlibs=$convenience
10863 build_libtool_libs=no
10866 oldobjs=$libobjs_save
10867 addlibs=$old_convenience
10868 build_libtool_libs=no
10871 oldobjs="$old_deplibs $non_pic_objects"
10872 $preload && test -f "$symfileobj" \
10873 && func_append oldobjs " $symfileobj"
10874 addlibs=$old_convenience
10878 if test -n "$addlibs"; then
10879 gentop=$output_objdir/${outputname}x
10880 func_append generated " $gentop"
10882 func_extract_archives $gentop $addlibs
10883 func_append oldobjs " $func_extract_archives_result"
10886 # Do each command in the archive commands.
10887 if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then
10888 cmds=$old_archive_from_new_cmds
10891 # Add any objects from preloaded convenience libraries
10892 if test -n "$dlprefiles"; then
10893 gentop=$output_objdir/${outputname}x
10894 func_append generated " $gentop"
10896 func_extract_archives $gentop $dlprefiles
10897 func_append oldobjs " $func_extract_archives_result"
10900 # POSIX demands no paths to be encoded in archives. We have
10901 # to avoid creating archives with duplicate basenames if we
10902 # might have to extract them afterwards, e.g., when creating a
10903 # static archive out of a convenience library, or when linking
10904 # the entirety of a libtool archive into another (currently
10905 # not supported by libtool).
10906 if (for obj in $oldobjs
10908 func_basename "$obj"
10909 $ECHO "$func_basename_result"
10910 done | sort | sort -uc >/dev/null 2>&1); then
10913 echo "copying selected object files to avoid basename conflicts..."
10914 gentop=$output_objdir/${outputname}x
10915 func_append generated " $gentop"
10916 func_mkdir_p "$gentop"
10917 save_oldobjs=$oldobjs
10920 for obj in $save_oldobjs
10922 func_basename "$obj"
10923 objbase=$func_basename_result
10924 case " $oldobjs " in
10925 " ") oldobjs=$obj ;;
10926 *[\ /]"$objbase "*)
10928 # Make sure we don't pick an alternate name that also
10930 newobj=lt$counter-$objbase
10931 func_arith $counter + 1
10932 counter=$func_arith_result
10933 case " $oldobjs " in
10934 *[\ /]"$newobj "*) ;;
10935 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
10938 func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
10939 func_append oldobjs " $gentop/$newobj"
10941 *) func_append oldobjs " $obj" ;;
10945 func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
10946 tool_oldlib=$func_to_tool_file_result
10947 eval cmds=\"$old_archive_cmds\"
10950 len=$func_len_result
10951 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
10952 cmds=$old_archive_cmds
10953 elif test -n "$archiver_list_spec"; then
10954 func_verbose "using command file archive linking..."
10955 for obj in $oldobjs
10957 func_to_tool_file "$obj"
10958 $ECHO "$func_to_tool_file_result"
10959 done > $output_objdir/$libname.libcmd
10960 func_to_tool_file "$output_objdir/$libname.libcmd"
10961 oldobjs=" $archiver_list_spec$func_to_tool_file_result"
10962 cmds=$old_archive_cmds
10964 # the command line is too long to link in one step, link in parts
10965 func_verbose "using piecewise archive linking..."
10966 save_RANLIB=$RANLIB
10970 save_oldobjs=$oldobjs
10972 # Is there a better way of finding the last object in the list?
10973 for obj in $save_oldobjs
10977 eval test_cmds=\"$old_archive_cmds\"
10978 func_len " $test_cmds"
10979 len0=$func_len_result
10981 for obj in $save_oldobjs
10984 func_arith $len + $func_len_result
10985 len=$func_arith_result
10986 func_append objlist " $obj"
10987 if test "$len" -lt "$max_cmd_len"; then
10990 # the above command should be used before it gets too long
10992 if test "$obj" = "$last_oldobj"; then
10993 RANLIB=$save_RANLIB
10995 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
10996 eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
11001 RANLIB=$save_RANLIB
11003 if test -z "$oldobjs"; then
11004 eval cmds=\"\$concat_cmds\"
11006 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
11010 func_execute_cmds "$cmds" 'exit $?'
11013 test -n "$generated" && \
11014 func_show_eval "${RM}r$generated"
11016 # Now create the libtool archive.
11020 test yes = "$build_old_libs" && old_library=$libname.$libext
11021 func_verbose "creating $output"
11023 # Preserve any variables that may affect compiler behavior
11024 for var in $variables_saved_for_relink; do
11025 if eval test -z \"\${$var+set}\"; then
11026 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
11027 elif eval var_value=\$$var; test -z "$var_value"; then
11028 relink_command="$var=; export $var; $relink_command"
11030 func_quote_arg pretty,unquoted "$var_value"
11031 relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command"
11034 # Quote the link command for shipping.
11035 func_quote eval cd "`pwd`"
11036 relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
11037 func_quote_arg pretty,unquoted "$relink_command"
11038 relink_command=$func_quote_arg_unquoted_result
11039 if test yes = "$hardcode_automatic"; then
11043 # Only create the output if not a dry run.
11045 for installed in no yes; do
11046 if test yes = "$installed"; then
11047 if test -z "$install_libdir"; then
11050 output=$output_objdir/${outputname}i
11051 # Replace all uninstalled libtool libraries with the installed ones
11052 newdependency_libs=
11053 for deplib in $dependency_libs; do
11056 func_basename "$deplib"
11057 name=$func_basename_result
11058 func_resolve_sysroot "$deplib"
11059 eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
11060 test -z "$libdir" && \
11061 func_fatal_error "'$deplib' is not a valid libtool archive"
11062 func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
11065 func_stripname -L '' "$deplib"
11066 func_replace_sysroot "$func_stripname_result"
11067 func_append newdependency_libs " -L$func_replace_sysroot_result"
11070 func_stripname -R '' "$deplib"
11071 func_replace_sysroot "$func_stripname_result"
11072 func_append newdependency_libs " -R$func_replace_sysroot_result"
11074 *) func_append newdependency_libs " $deplib" ;;
11077 dependency_libs=$newdependency_libs
11080 for lib in $dlfiles; do
11083 func_basename "$lib"
11084 name=$func_basename_result
11085 eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
11086 test -z "$libdir" && \
11087 func_fatal_error "'$lib' is not a valid libtool archive"
11088 func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
11090 *) func_append newdlfiles " $lib" ;;
11093 dlfiles=$newdlfiles
11095 for lib in $dlprefiles; do
11098 # Only pass preopened files to the pseudo-archive (for
11099 # eventual linking with the app. that links it) if we
11100 # didn't already link the preopened objects directly into
11102 func_basename "$lib"
11103 name=$func_basename_result
11104 eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
11105 test -z "$libdir" && \
11106 func_fatal_error "'$lib' is not a valid libtool archive"
11107 func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
11111 dlprefiles=$newdlprefiles
11114 for lib in $dlfiles; do
11116 [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
11117 *) abs=`pwd`"/$lib" ;;
11119 func_append newdlfiles " $abs"
11121 dlfiles=$newdlfiles
11123 for lib in $dlprefiles; do
11125 [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
11126 *) abs=`pwd`"/$lib" ;;
11128 func_append newdlprefiles " $abs"
11130 dlprefiles=$newdlprefiles
11133 # place dlname in correct position for cygwin
11134 # In fact, it would be nice if we could use this code for all target
11135 # systems that can't hard-code library paths into their executables
11136 # and that have no shared library path variable independent of PATH,
11137 # but it turns out we can't easily determine that from inspecting
11138 # libtool variables, so we have to hard-code the OSs to which it
11139 # applies here; at the moment, that means platforms that use the PE
11140 # object format with DLL files. See the long comment at the top of
11141 # tests/bindir.at for full details.
11143 case $host,$output,$installed,$module,$dlname in
11144 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
11145 # If a -bindir argument was supplied, place the dll there.
11146 if test -n "$bindir"; then
11147 func_relative_path "$install_libdir" "$bindir"
11148 tdlname=$func_relative_path_result/$dlname
11150 # Otherwise fall back on heuristic.
11151 tdlname=../bin/$dlname
11156 # $outputname - a libtool library file
11157 # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
11159 # Please DO NOT delete this file!
11160 # It is necessary for linking the library.
11162 # The name that we can dlopen(3).
11165 # Names of this library.
11166 library_names='$library_names'
11168 # The name of the static archive.
11169 old_library='$old_library'
11171 # Linker flags that cannot go in dependency_libs.
11172 inherited_linker_flags='$new_inherited_linker_flags'
11174 # Libraries that this one depends upon.
11175 dependency_libs='$dependency_libs'
11177 # Names of additional weak libraries provided by this library
11178 weak_library_names='$weak_libs'
11180 # Version information for $libname.
11185 # Is this an already installed library?
11186 installed=$installed
11188 # Should we warn about portability when linking against -modules?
11189 shouldnotlink=$module
11191 # Files to dlopen/dlpreopen
11193 dlpreopen='$dlprefiles'
11195 # Directory that this library needs to be installed in:
11196 libdir='$install_libdir'"
11197 if test no,yes = "$installed,$need_relink"; then
11198 $ECHO >> $output "\
11199 relink_command=\"$relink_command\""
11204 # Do a symbolic link so that the libtool archive can be found in
11205 # LD_LIBRARY_PATH before the program is installed.
11206 func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
11212 if test link = "$opt_mode" || test relink = "$opt_mode"; then
11213 func_mode_link ${1+"$@"}
11217 # func_mode_uninstall arg...
11218 func_mode_uninstall ()
11227 # This variable tells wrapper scripts just to set variables rather
11228 # than running their programs.
11229 libtool_install_magic=$magic
11234 -f) func_append RM " $arg"; rmforce=: ;;
11235 -*) func_append RM " $arg" ;;
11236 *) func_append files " $arg" ;;
11241 func_fatal_help "you must specify an RM program"
11245 for file in $files; do
11246 func_dirname "$file" "" "."
11247 dir=$func_dirname_result
11248 if test . = "$dir"; then
11253 func_basename "$file"
11254 name=$func_basename_result
11255 test uninstall = "$opt_mode" && odir=$dir
11257 # Remember odir for removal later, being careful to avoid duplicates
11258 if test clean = "$opt_mode"; then
11259 case " $rmdirs " in
11261 *) func_append rmdirs " $odir" ;;
11265 # Don't error if the file doesn't exist and rm -f was used.
11266 if { test -L "$file"; } >/dev/null 2>&1 ||
11267 { test -h "$file"; } >/dev/null 2>&1 ||
11268 test -f "$file"; then
11270 elif test -d "$file"; then
11273 elif $rmforce; then
11281 # Possibly a libtool archive, so verify it.
11282 if func_lalib_p "$file"; then
11283 func_source $dir/$name
11285 # Delete the libtool libraries and symlinks.
11286 for n in $library_names; do
11287 func_append rmfiles " $odir/$n"
11289 test -n "$old_library" && func_append rmfiles " $odir/$old_library"
11293 case " $library_names " in
11295 *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
11297 test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
11300 if test -n "$library_names"; then
11301 # Do each command in the postuninstall commands.
11302 func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'
11305 if test -n "$old_library"; then
11306 # Do each command in the old_postuninstall commands.
11307 func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'
11309 # FIXME: should reinstall the best remaining shared library.
11316 # Possibly a libtool object, so verify it.
11317 if func_lalib_p "$file"; then
11319 # Read the .lo file
11320 func_source $dir/$name
11322 # Add PIC object to the list of files to remove.
11323 if test -n "$pic_object" && test none != "$pic_object"; then
11324 func_append rmfiles " $dir/$pic_object"
11327 # Add non-PIC object to the list of files to remove.
11328 if test -n "$non_pic_object" && test none != "$non_pic_object"; then
11329 func_append rmfiles " $dir/$non_pic_object"
11335 if test clean = "$opt_mode"; then
11339 func_stripname '' '.exe' "$file"
11340 file=$func_stripname_result
11341 func_stripname '' '.exe' "$name"
11342 noexename=$func_stripname_result
11343 # $file with .exe has already been added to rmfiles,
11344 # add $file without .exe
11345 func_append rmfiles " $file"
11348 # Do a test to see if this is a libtool program.
11349 if func_ltwrapper_p "$file"; then
11350 if func_ltwrapper_executable_p "$file"; then
11351 func_ltwrapper_scriptname "$file"
11353 func_source $func_ltwrapper_scriptname_result
11354 func_append rmfiles " $func_ltwrapper_scriptname_result"
11357 func_source $dir/$noexename
11360 # note $name still contains .exe if it was in $file originally
11361 # as does the version of $file that was added into $rmfiles
11362 func_append rmfiles " $odir/$name $odir/${name}S.$objext"
11363 if test yes = "$fast_install" && test -n "$relink_command"; then
11364 func_append rmfiles " $odir/lt-$name"
11366 if test "X$noexename" != "X$name"; then
11367 func_append rmfiles " $odir/lt-$noexename.c"
11373 func_show_eval "$RM $rmfiles" 'exit_status=1'
11376 # Try to remove the $objdir's in the directories where we deleted files
11377 for dir in $rmdirs; do
11378 if test -d "$dir"; then
11379 func_show_eval "rmdir $dir >/dev/null 2>&1"
11386 if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
11387 func_mode_uninstall ${1+"$@"}
11390 test -z "$opt_mode" && {
11392 func_fatal_help "you must specify a MODE"
11395 test -z "$exec_cmd" && \
11396 func_fatal_help "invalid operation mode '$opt_mode'"
11398 if test -n "$exec_cmd"; then
11399 eval exec "$exec_cmd"
11406 # The TAGs below are defined such that we never get into a situation
11407 # where we disable both kinds of libraries. Given conflicting
11408 # choices, we go for a static library, that is the most portable,
11409 # since we can't tell whether shared libraries were disabled because
11410 # the user asked for that or because the platform doesn't support
11411 # them. This is particularly important on AIX, because we don't
11412 # support having both static and shared libraries enabled at the same
11413 # time on that platform, so we default to a shared-only configuration.
11414 # If a disable-shared tag is given, we'll fallback to a static-only
11415 # configuration. But we'll never go from static-only to shared-only.
11417 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
11418 build_libtool_libs=no
11420 # ### END LIBTOOL TAG CONFIG: disable-shared
11422 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
11423 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
11424 # ### END LIBTOOL TAG CONFIG: disable-static
11427 # mode:shell-script