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/>.
34 VERSION="2.4.7 Debian-2.4.7-7"
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='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.
576 # Can be empty, in which case the shell is probed, "yes" if += is
577 # useable or anything else if it does not work.
578 if test -z "$_G_HAVE_PLUSEQ_OP" && \
579 __PLUSEQ_TEST="a" && \
580 __PLUSEQ_TEST+=" b" 2>/dev/null && \
581 test "a b" = "$__PLUSEQ_TEST"; then
582 _G_HAVE_PLUSEQ_OP=yes
585 if test yes = "$_G_HAVE_PLUSEQ_OP"
587 # This is an XSI compatible shell, allowing a faster implementation...
595 # ...otherwise fall back to using expr, which is often a shell builtin.
605 # func_append_quoted VAR VALUE
606 # ----------------------------
607 # Quote VALUE and append to the end of shell variable VAR, separated
609 if test yes = "$_G_HAVE_PLUSEQ_OP"; then
610 eval 'func_append_quoted ()
614 func_quote_arg pretty "$2"
615 eval "$1+=\\ \$func_quote_arg_result"
618 func_append_quoted ()
622 func_quote_arg pretty "$2"
623 eval "$1=\$$1\\ \$func_quote_arg_result"
628 # func_append_uniq VAR VALUE
629 # --------------------------
630 # Append unique VALUE onto the existing contents of VAR, assuming
631 # entries are delimited by the first character of VALUE. For example:
633 # func_append_uniq options " --another-option option-argument"
635 # will only append to $options if " --another-option option-argument "
636 # is not already present somewhere in $options already (note spaces at
637 # each end implied by leading space in second argument).
642 eval _G_current_value='`$ECHO $'$1'`'
643 _G_delim=`expr "$2" : '\(.\)'`
645 case $_G_delim$_G_current_value$_G_delim in
647 *) func_append "$@" ;;
654 # Set func_arith_result to the result of evaluating TERMs.
655 test -z "$_G_HAVE_ARITH_OP" \
656 && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
657 && _G_HAVE_ARITH_OP=yes
659 if test yes = "$_G_HAVE_ARITH_OP"; then
664 func_arith_result=$(( $* ))
671 func_arith_result=`expr "$@"`
678 # Set func_basename_result to FILE with everything up to and including
679 # the last / stripped.
680 if test yes = "$_G_HAVE_XSI_OPS"; then
681 # If this shell supports suffix pattern removal, then use it to avoid
682 # forking. Hide the definitions single quotes in case the shell chokes
683 # on unsupported syntax...
684 _b='func_basename_result=${1##*/}'
686 */*) func_dirname_result=${1%/*}$2 ;;
687 * ) func_dirname_result=$3 ;;
691 # ...otherwise fall back to using sed.
692 _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
693 _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"`
694 if test "X$func_dirname_result" = "X$1"; then
695 func_dirname_result=$3
697 func_append func_dirname_result "$2"
701 eval 'func_basename ()
709 # func_dirname FILE APPEND NONDIR_REPLACEMENT
710 # -------------------------------------------
711 # Compute the dirname of FILE. If nonempty, add APPEND to the result,
712 # otherwise set result to NONDIR_REPLACEMENT.
713 eval 'func_dirname ()
721 # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT
722 # --------------------------------------------------------
723 # Perform func_basename and func_dirname in a single function
725 # dirname: Compute the dirname of FILE. If nonempty,
726 # add APPEND to the result, otherwise set result
727 # to NONDIR_REPLACEMENT.
728 # value returned in "$func_dirname_result"
729 # basename: Compute filename of FILE.
730 # value retuned in "$func_basename_result"
731 # For efficiency, we do not delegate to the functions above but instead
732 # duplicate the functionality here.
733 eval 'func_dirname_and_basename ()
744 # Echo program name prefixed message.
753 for _G_line in $_G_message; do
755 $ECHO "$progname: $_G_line"
761 # func_echo_all ARG...
762 # --------------------
763 # Invoke $ECHO with all args, space-separated.
770 # func_echo_infix_1 INFIX ARG...
771 # ------------------------------
772 # Echo program name, followed by INFIX on the first line, with any
773 # additional lines not showing INFIX.
782 _G_prefix="$progname: $_G_infix: "
785 # Strip color escape sequences before counting printable length
786 for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
788 test -n "$_G_tc" && {
789 _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`
790 _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`
793 _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes
795 func_echo_infix_1_IFS=$IFS
797 for _G_line in $_G_message; do
798 IFS=$func_echo_infix_1_IFS
799 $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
802 IFS=$func_echo_infix_1_IFS
808 # Echo program name prefixed message to standard error.
815 func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2
819 # func_fatal_error ARG...
820 # -----------------------
821 # Echo program name prefixed message to standard error, and exit.
831 # func_grep EXPRESSION FILENAME
832 # -----------------------------
833 # Check whether EXPRESSION matches any line of FILENAME, without output.
838 $GREP "$1" "$2" >/dev/null 2>&1
844 # Set func_len_result to the length of STRING. STRING may not
845 # start with a hyphen.
846 test -z "$_G_HAVE_XSI_OPS" \
848 test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
849 && _G_HAVE_XSI_OPS=yes
851 if test yes = "$_G_HAVE_XSI_OPS"; then
856 func_len_result=${#1}
863 func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
868 # func_mkdir_p DIRECTORY-PATH
869 # ---------------------------
870 # Make sure the entire path to DIRECTORY-PATH is available.
878 if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
880 # Protect directory names starting with '-'
881 case $_G_directory_path in
882 -*) _G_directory_path=./$_G_directory_path ;;
885 # While some portion of DIR does not yet exist...
886 while test ! -d "$_G_directory_path"; do
887 # ...make a list in topmost first order. Use a colon delimited
888 # list incase some portion of path contains whitespace.
889 _G_dir_list=$_G_directory_path:$_G_dir_list
891 # If the last portion added has no slash in it, the list is done
892 case $_G_directory_path in */*) ;; *) break ;; esac
894 # ...otherwise throw away the child directory and loop
895 _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
897 _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
899 func_mkdir_p_IFS=$IFS; IFS=:
900 for _G_dir in $_G_dir_list; do
901 IFS=$func_mkdir_p_IFS
902 # mkdir can fail with a 'File exist' error if two processes
903 # try to create one of the directories concurrently. Don't
905 $MKDIR "$_G_dir" 2>/dev/null || :
907 IFS=$func_mkdir_p_IFS
909 # Bail out if we (or some other process) failed to create a directory.
910 test -d "$_G_directory_path" || \
911 func_fatal_error "Failed to create '$1'"
916 # func_mktempdir [BASENAME]
917 # -------------------------
918 # Make a temporary directory that won't clash with other running
919 # libtool processes, and avoids race conditions if possible. If
920 # given, BASENAME is the basename for that directory.
925 _G_template=${TMPDIR-/tmp}/${1-$progname}
927 if test : = "$opt_dry_run"; then
928 # Return a directory name, but don't create it in dry-run mode
929 _G_tmpdir=$_G_template-$$
932 # If mktemp works, use that first and foremost
933 _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
935 if test ! -d "$_G_tmpdir"; then
936 # Failing that, at least try and use $RANDOM to avoid a race
937 _G_tmpdir=$_G_template-${RANDOM-0}$$
939 func_mktempdir_umask=`umask`
942 umask $func_mktempdir_umask
945 # If we're not in dry-run mode, bomb out on failure
946 test -d "$_G_tmpdir" || \
947 func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
954 # func_normal_abspath PATH
955 # ------------------------
956 # Remove doubled-up and trailing slashes, "." path components,
957 # and cancel out any ".." path components in PATH after making
958 # it an absolute path.
959 func_normal_abspath ()
963 # These SED scripts presuppose an absolute path with a trailing slash.
964 _G_pathcar='s|^/\([^/]*\).*$|\1|'
965 _G_pathcdr='s|^/[^/]*||'
966 _G_removedotparts=':dotsl
970 _G_collapseslashes='s|/\{1,\}|/|g'
971 _G_finalslash='s|/*$|/|'
973 # Start from root dir and reassemble the path.
974 func_normal_abspath_result=
975 func_normal_abspath_tpath=$1
976 func_normal_abspath_altnamespace=
977 case $func_normal_abspath_tpath in
979 # Empty path, that just means $cwd.
980 func_stripname '' '/' "`pwd`"
981 func_normal_abspath_result=$func_stripname_result
984 # The next three entries are used to spot a run of precisely
985 # two leading slashes without using negated character classes;
986 # we take advantage of case's first-match behaviour.
988 # Unusual form of absolute path, do nothing.
991 # Not necessarily an ordinary path; POSIX reserves leading '//'
992 # and for example Cygwin uses it to access remote file shares
993 # over CIFS/SMB, so we conserve a leading double slash if found.
994 func_normal_abspath_altnamespace=/
997 # Absolute path, do nothing.
1000 # Relative path, prepend $cwd.
1001 func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
1005 # Cancel out all the simple stuff to save iterations. We also want
1006 # the path to end with a slash for ease of parsing, so make sure
1007 # there is one (and only one) here.
1008 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
1009 -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
1011 # Processed it all yet?
1012 if test / = "$func_normal_abspath_tpath"; then
1013 # If we ascended to the root using ".." the result may be empty now.
1014 if test -z "$func_normal_abspath_result"; then
1015 func_normal_abspath_result=/
1019 func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
1021 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
1023 # Figure out what to do with it
1024 case $func_normal_abspath_tcomponent in
1026 # Trailing empty path component, ignore it.
1029 # Parent dir; strip last assembled component from result.
1030 func_dirname "$func_normal_abspath_result"
1031 func_normal_abspath_result=$func_dirname_result
1034 # Actual path component, append it.
1035 func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
1039 # Restore leading double-slash if one was found on entry.
1040 func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
1044 # func_notquiet ARG...
1045 # --------------------
1046 # Echo program name prefixed message only when not in quiet mode.
1051 $opt_quiet || func_echo ${1+"$@"}
1053 # A bug in bash halts the script if the last line of a function
1054 # fails when set -e is in force, so we need another command to
1060 # func_relative_path SRCDIR DSTDIR
1061 # --------------------------------
1062 # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
1063 func_relative_path ()
1067 func_relative_path_result=
1068 func_normal_abspath "$1"
1069 func_relative_path_tlibdir=$func_normal_abspath_result
1070 func_normal_abspath "$2"
1071 func_relative_path_tbindir=$func_normal_abspath_result
1073 # Ascend the tree starting from libdir
1075 # check if we have found a prefix of bindir
1076 case $func_relative_path_tbindir in
1077 $func_relative_path_tlibdir)
1078 # found an exact match
1079 func_relative_path_tcancelled=
1082 $func_relative_path_tlibdir*)
1083 # found a matching prefix
1084 func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
1085 func_relative_path_tcancelled=$func_stripname_result
1086 if test -z "$func_relative_path_result"; then
1087 func_relative_path_result=.
1092 func_dirname $func_relative_path_tlibdir
1093 func_relative_path_tlibdir=$func_dirname_result
1094 if test -z "$func_relative_path_tlibdir"; then
1095 # Have to descend all the way to the root!
1096 func_relative_path_result=../$func_relative_path_result
1097 func_relative_path_tcancelled=$func_relative_path_tbindir
1100 func_relative_path_result=../$func_relative_path_result
1105 # Now calculate path; take care to avoid doubling-up slashes.
1106 func_stripname '' '/' "$func_relative_path_result"
1107 func_relative_path_result=$func_stripname_result
1108 func_stripname '/' '/' "$func_relative_path_tcancelled"
1109 if test -n "$func_stripname_result"; then
1110 func_append func_relative_path_result "/$func_stripname_result"
1113 # Normalisation. If bindir is libdir, return '.' else relative path.
1114 if test -n "$func_relative_path_result"; then
1115 func_stripname './' '' "$func_relative_path_result"
1116 func_relative_path_result=$func_stripname_result
1119 test -n "$func_relative_path_result" || func_relative_path_result=.
1125 # func_quote_portable EVAL ARG
1126 # ----------------------------
1127 # Internal function to portably implement func_quote_arg. Note that we still
1128 # keep attention to performance here so we as much as possible try to avoid
1129 # calling sed binary (so far O(N) complexity as long as func_append is O(1)).
1130 func_quote_portable ()
1134 $require_check_ifs_backslash
1136 func_quote_portable_result=$2
1138 # one-time-loop (easy break)
1142 func_quote_portable_result=`$ECHO "$2" | $SED \
1143 -e "$sed_double_quote_subst" -e "$sed_double_backslash"`
1148 case $func_quote_portable_result in
1150 # Fallback to sed for $func_check_bs_ifs_broken=:, or when the string
1151 # contains the shell wildcard characters.
1152 case $check_ifs_backshlash_broken$func_quote_portable_result in
1154 func_quote_portable_result=`$ECHO "$func_quote_portable_result" \
1155 | $SED "$sed_quote_subst"`
1160 func_quote_portable_old_IFS=$IFS
1161 for _G_char in '\' '`' '"' '$'
1163 # STATE($1) PREV($2) SEPARATOR($3)
1165 func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy
1167 for _G_part in $func_quote_portable_result
1171 func_append func_quote_portable_result "$3$2"
1172 set quote "$_G_part" "\\$_G_char"
1176 func_quote_portable_result=
1179 set quote "$_G_part" ""
1184 IFS=$func_quote_portable_old_IFS
1191 func_quote_portable_unquoted_result=$func_quote_portable_result
1192 case $func_quote_portable_result in
1193 # double-quote args containing shell metacharacters to delay
1194 # word splitting, command substitution and variable expansion
1195 # for a subsequent eval.
1196 # many bourne shells cannot handle close brackets correctly
1197 # in scan sets, so we specify it separately.
1198 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1199 func_quote_portable_result=\"$func_quote_portable_result\"
1205 # func_quotefast_eval ARG
1206 # -----------------------
1207 # Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG',
1208 # but optimized for speed. Result is stored in $func_quotefast_eval.
1209 if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then
1210 printf -v _GL_test_printf_tilde %q '~'
1211 if test '\~' = "$_GL_test_printf_tilde"; then
1212 func_quotefast_eval ()
1214 printf -v func_quotefast_eval_result %q "$1"
1217 # Broken older Bash implementations. Make those faster too if possible.
1218 func_quotefast_eval ()
1222 func_quote_portable false "$1"
1223 func_quotefast_eval_result=$func_quote_portable_result
1226 printf -v func_quotefast_eval_result %q "$1"
1232 func_quotefast_eval ()
1234 func_quote_portable false "$1"
1235 func_quotefast_eval_result=$func_quote_portable_result
1240 # func_quote_arg MODEs ARG
1241 # ------------------------
1242 # Quote one ARG to be evaled later. MODEs argument may contain zero or more
1243 # specifiers listed below separated by ',' character. This function returns two
1245 # i) func_quote_arg_result
1246 # double-quoted (when needed), suitable for a subsequent eval
1247 # ii) func_quote_arg_unquoted_result
1248 # has all characters that are still active within double
1249 # quotes backslashified. Available only if 'unquoted' is specified.
1254 # - escape shell special characters
1256 # - the same as 'eval'; but do not quote variable references
1258 # - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might
1259 # be used later in func_quote to get output like: 'echo "a b"' instead
1260 # of 'echo a\ b'. This is slower than default on some shells.
1262 # - produce also $func_quote_arg_unquoted_result which does not contain
1263 # wrapping double-quotes.
1265 # Examples for 'func_quote_arg pretty,unquoted string':
1267 # string | *_result | *_unquoted_result
1268 # ------------+-----------------------+-------------------
1271 # "a b" | "\"a b\"" | \"a b\"
1273 # z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\"
1275 # Examples for 'func_quote_arg pretty,unquoted,expand string':
1277 # string | *_result | *_unquoted_result
1278 # --------------+---------------------+--------------------
1279 # z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\"
1282 _G_quote_expand=false
1290 *,pretty,*|*,expand,*|*,unquoted,*)
1291 func_quote_portable $_G_quote_expand "$2"
1292 func_quote_arg_result=$func_quote_portable_result
1293 func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result
1296 # Faster quote-for-eval for some shells.
1297 func_quotefast_eval "$2"
1298 func_quote_arg_result=$func_quotefast_eval_result
1304 # func_quote MODEs ARGs...
1305 # ------------------------
1306 # Quote all ARGs to be evaled later and join them into single command. See
1307 # func_quote_arg's description for more info.
1311 _G_func_quote_mode=$1 ; shift
1313 while test 0 -lt $#; do
1314 func_quote_arg "$_G_func_quote_mode" "$1"
1315 if test -n "$func_quote_result"; then
1316 func_append func_quote_result " $func_quote_arg_result"
1318 func_append func_quote_result "$func_quote_arg_result"
1325 # func_stripname PREFIX SUFFIX NAME
1326 # ---------------------------------
1327 # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
1328 # PREFIX and SUFFIX must not contain globbing or regex special
1329 # characters, hashes, percent signs, but SUFFIX may contain a leading
1330 # dot (in which case that matches only a dot).
1331 if test yes = "$_G_HAVE_XSI_OPS"; then
1332 eval 'func_stripname ()
1336 # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
1337 # positional parameters, so assign one to ordinary variable first.
1338 func_stripname_result=$3
1339 func_stripname_result=${func_stripname_result#"$1"}
1340 func_stripname_result=${func_stripname_result%"$2"}
1348 .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
1349 *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
1355 # func_show_eval CMD [FAIL_EXP]
1356 # -----------------------------
1357 # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
1358 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
1359 # is given, then evaluate it.
1365 _G_fail_exp=${2-':'}
1367 func_quote_arg pretty,expand "$_G_cmd"
1368 eval "func_notquiet $func_quote_arg_result"
1373 if test 0 -ne "$_G_status"; then
1374 eval "(exit $_G_status); $_G_fail_exp"
1380 # func_show_eval_locale CMD [FAIL_EXP]
1381 # ------------------------------------
1382 # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
1383 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
1384 # is given, then evaluate it. Use the saved locale for evaluation.
1385 func_show_eval_locale ()
1390 _G_fail_exp=${2-':'}
1393 func_quote_arg expand,pretty "$_G_cmd"
1394 eval "func_echo $func_quote_arg_result"
1398 eval "$_G_user_locale
1401 eval "$_G_safe_locale"
1402 if test 0 -ne "$_G_status"; then
1403 eval "(exit $_G_status); $_G_fail_exp"
1411 # Turn $1 into a string suitable for a shell variable name.
1412 # Result is stored in $func_tr_sh_result. All characters
1413 # not in the set a-zA-Z0-9_ are replaced with '_'. Further,
1414 # if $1 begins with a digit, a '_' is prepended as well.
1420 [0-9]* | *[!a-zA-Z0-9_]*)
1421 func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
1424 func_tr_sh_result=$1
1430 # func_verbose ARG...
1431 # -------------------
1432 # Echo program name prefixed message in verbose mode only.
1437 $opt_verbose && func_echo "$*"
1443 # func_warn_and_continue ARG...
1444 # -----------------------------
1445 # Echo program name prefixed warning message to standard error.
1446 func_warn_and_continue ()
1450 $require_term_colors
1452 func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
1456 # func_warning CATEGORY ARG...
1457 # ----------------------------
1458 # Echo program name prefixed warning message to standard error. Warning
1459 # messages can be filtered according to CATEGORY, where this function
1460 # elides messages where CATEGORY is not listed in the global variable
1461 # 'opt_warning_types'.
1466 # CATEGORY must be in the warning_categories list!
1467 case " $warning_categories " in
1469 *) func_internal_error "invalid warning category '$1'" ;;
1475 case " $opt_warning_types " in
1476 *" $_G_category "*) $warning_func ${1+"$@"} ;;
1481 # func_sort_ver VER1 VER2
1482 # -----------------------
1483 # 'sort -V' is not generally available.
1484 # Note this deviates from the version comparison in automake
1485 # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
1486 # but this should suffice as we won't be specifying old
1487 # version formats or redundant trailing .0 in bootstrap.conf.
1488 # If we did want full compatibility then we should probably
1489 # use m4_version_compare from autoconf.
1494 printf '%s\n%s\n' "$1" "$2" \
1495 | 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
1498 # func_lt_ver PREV CURR
1499 # ---------------------
1500 # Return true if PREV and CURR are in the correct order according to
1501 # func_sort_ver, otherwise false. Use it like this:
1503 # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."
1508 test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`
1513 # mode: shell-script
1515 # eval: (add-hook 'before-save-hook 'time-stamp)
1516 # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
1517 # time-stamp-time-zone: "UTC"
1521 # A portable, pluggable option parser for Bourne shell.
1522 # Written by Gary V. Vaughan, 2010
1524 # This is free software. There is NO warranty; not even for
1525 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1527 # Copyright (C) 2010-2019, 2021 Bootstrap Authors
1529 # This file is dual licensed under the terms of the MIT license
1530 # <https://opensource.org/license/MIT>, and GPL version 2 or later
1531 # <http://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of
1532 # these licenses when using or redistributing this software or any of
1533 # the files within it. See the URLs above, or the file `LICENSE`
1534 # included in the Bootstrap distribution for the full license texts.
1536 # Please report bugs or propose patches to:
1537 # <https://github.com/gnulib-modules/bootstrap/issues>
1539 # Set a version string for this script.
1540 scriptversion=2019-02-19.15; # UTC
1547 # This file is a library for parsing options in your shell scripts along
1548 # with assorted other useful supporting features that you can make use
1551 # For the simplest scripts you might need only:
1554 # . relative/path/to/funclib.sh
1555 # . relative/path/to/options-parser
1557 # func_options ${1+"$@"}
1558 # eval set dummy "$func_options_result"; shift
1559 # ...rest of your script...
1561 # In order for the '--version' option to work, you will need to have a
1562 # suitably formatted comment like the one at the top of this file
1563 # starting with '# Written by ' and ending with '# Copyright'.
1565 # For '-h' and '--help' to work, you will also need a one line
1566 # description of your script's purpose in a comment directly above the
1567 # '# Written by ' line, like the one at the top of this file.
1569 # The default options also support '--debug', which will turn on shell
1570 # execution tracing (see the comment above debug_cmd below for another
1571 # use), and '--verbose' and the func_verbose function to allow your script
1572 # to display verbose messages only when your user has specified
1575 # After sourcing this file, you can plug in processing for additional
1576 # options by amending the variables from the 'Configuration' section
1577 # below, and following the instructions in the 'Option parsing'
1578 # section further down.
1580 ## -------------- ##
1581 ## Configuration. ##
1582 ## -------------- ##
1584 # You should override these variables in your script after sourcing this
1585 # file so that they reflect the customisations you have added to the
1588 # The usage line for option parsing errors and the start of '-h' and
1589 # '--help' output messages. You can embed shell variables for delayed
1590 # expansion at the time the message is displayed, but you will need to
1591 # quote other shell meta-characters carefully to prevent them being
1592 # expanded when the contents are evaled.
1593 usage='$progpath [OPTION]...'
1595 # Short help message in response to '-h' and '--help'. Add to this or
1596 # override it after sourcing this library to reflect the full set of
1597 # options your script accepts.
1599 --debug enable verbose shell tracing
1600 -W, --warnings=CATEGORY
1601 report the warnings falling in CATEGORY [all]
1602 -v, --verbose verbosely report processing
1603 --version print version information and exit
1604 -h, --help print short or long help message and exit
1607 # Additional text appended to 'usage_message' in response to '--help'.
1609 Warning categories include:
1610 'all' show all warnings
1611 'none' turn off all the warnings
1612 'error' warnings are treated as fatal errors"
1614 # Help message printed before fatal option parsing errors.
1615 fatal_help="Try '\$progname --help' for more information."
1619 ## ------------------------- ##
1620 ## Hook function management. ##
1621 ## ------------------------- ##
1623 # This section contains functions for adding, removing, and running hooks
1624 # in the main code. A hook is just a list of function names that can be
1625 # run in order later on.
1627 # func_hookable FUNC_NAME
1628 # -----------------------
1629 # Declare that FUNC_NAME will run hooks added with
1630 # 'func_add_hook FUNC_NAME ...'.
1635 func_append hookable_fns " $1"
1639 # func_add_hook FUNC_NAME HOOK_FUNC
1640 # ---------------------------------
1641 # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must
1642 # first have been declared "hookable" by a call to 'func_hookable'.
1647 case " $hookable_fns " in
1649 *) func_fatal_error "'$1' does not accept hook functions." ;;
1652 eval func_append ${1}_hooks '" $2"'
1656 # func_remove_hook FUNC_NAME HOOK_FUNC
1657 # ------------------------------------
1658 # Remove HOOK_FUNC from the list of hook functions to be called by
1664 eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
1668 # func_propagate_result FUNC_NAME_A FUNC_NAME_B
1669 # ---------------------------------------------
1670 # If the *_result variable of FUNC_NAME_A _is set_, assign its value to
1671 # *_result variable of FUNC_NAME_B.
1672 func_propagate_result ()
1676 func_propagate_result_result=:
1677 if eval "test \"\${${1}_result+set}\" = set"
1679 eval "${2}_result=\$${1}_result"
1681 func_propagate_result_result=false
1686 # func_run_hooks FUNC_NAME [ARG]...
1687 # ---------------------------------
1688 # Run all hook functions registered to FUNC_NAME.
1689 # It's assumed that the list of hook functions contains nothing more
1690 # than a whitespace-delimited list of legal shell function names, and
1691 # no effort is wasted trying to catch shell meta-characters or preserve
1697 _G_rc_run_hooks=false
1699 case " $hookable_fns " in
1701 *) func_fatal_error "'$1' does not support hook functions." ;;
1704 eval _G_hook_fns=\$$1_hooks; shift
1706 for _G_hook in $_G_hook_fns; do
1707 func_unset "${_G_hook}_result"
1708 eval $_G_hook '${1+"$@"}'
1709 func_propagate_result $_G_hook func_run_hooks
1710 if $func_propagate_result_result; then
1711 eval set dummy "$func_run_hooks_result"; shift
1718 ## --------------- ##
1719 ## Option parsing. ##
1720 ## --------------- ##
1722 # In order to add your own option parsing hooks, you must accept the
1723 # full positional parameter list from your hook function. You may remove
1724 # or edit any options that you action, and then pass back the remaining
1725 # unprocessed options in '<hooked_function_name>_result', escaped
1726 # suitably for 'eval'.
1728 # The '<hooked_function_name>_result' variable is automatically unset
1729 # before your hook gets called; for best performance, only set the
1730 # *_result variable when necessary (i.e. don't call the 'func_quote'
1731 # function unnecessarily because it can be an expensive operation on some
1736 # my_options_prep ()
1740 # # Extend the existing usage message.
1741 # usage_message=$usage_message'
1742 # -s, --silent don'\''t print informational messages
1744 # # No change in '$@' (ignored completely by this hook). Leave
1745 # # my_options_prep_result variable intact.
1747 # func_add_hook func_options_prep my_options_prep
1750 # my_silent_option ()
1754 # args_changed=false
1756 # # Note that, for efficiency, we parse as many options as we can
1757 # # recognise in a loop before passing the remainder back to the
1758 # # caller on the first unrecognised argument we encounter.
1759 # while test $# -gt 0; do
1762 # --silent|-s) opt_silent=:
1765 # # Separate non-argument short options:
1766 # -s*) func_split_short_opt "$_G_opt"
1767 # set dummy "$func_split_short_opt_name" \
1768 # "-$func_split_short_opt_arg" ${1+"$@"}
1772 # *) # Make sure the first unrecognised option "$_G_opt"
1773 # # is added back to "$@" in case we need it later,
1774 # # if $args_changed was set to 'true'.
1775 # set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
1779 # # Only call 'func_quote' here if we processed at least one argument.
1780 # if $args_changed; then
1781 # func_quote eval ${1+"$@"}
1782 # my_silent_option_result=$func_quote_result
1785 # func_add_hook func_parse_options my_silent_option
1788 # my_option_validation ()
1792 # $opt_silent && $opt_verbose && func_fatal_help "\
1793 # '--silent' and '--verbose' options are mutually exclusive."
1795 # func_add_hook func_validate_options my_option_validation
1797 # You'll also need to manually amend $usage_message to reflect the extra
1798 # options you parse. It's preferable to append if you can, so that
1799 # multiple option parsing hooks can be added safely.
1802 # func_options_finish [ARG]...
1803 # ----------------------------
1804 # Finishing the option parse loop (call 'func_options' hooks ATM).
1805 func_options_finish ()
1809 func_run_hooks func_options ${1+"$@"}
1810 func_propagate_result func_run_hooks func_options_finish
1814 # func_options [ARG]...
1815 # ---------------------
1816 # All the functions called inside func_options are hookable. See the
1817 # individual implementations for details.
1818 func_hookable func_options
1823 _G_options_quoted=false
1825 for my_func in options_prep parse_options validate_options options_finish
1827 func_unset func_${my_func}_result
1828 func_unset func_run_hooks_result
1829 eval func_$my_func '${1+"$@"}'
1830 func_propagate_result func_$my_func func_options
1831 if $func_propagate_result_result; then
1832 eval set dummy "$func_options_result"; shift
1837 $_G_options_quoted || {
1838 # As we (func_options) are top-level options-parser function and
1839 # nobody quoted "$@" for us yet, we need to do it explicitly for
1841 func_quote eval ${1+"$@"}
1842 func_options_result=$func_quote_result
1847 # func_options_prep [ARG]...
1848 # --------------------------
1849 # All initialisations required before starting the option parse loop.
1850 # Note that when calling hook functions, we pass through the list of
1851 # positional parameters. If a hook function modifies that list, and
1852 # needs to propagate that back to rest of this script, then the complete
1853 # modified list must be put in 'func_run_hooks_result' before returning.
1854 func_hookable func_options_prep
1855 func_options_prep ()
1863 func_run_hooks func_options_prep ${1+"$@"}
1864 func_propagate_result func_run_hooks func_options_prep
1868 # func_parse_options [ARG]...
1869 # ---------------------------
1870 # The main option parsing loop.
1871 func_hookable func_parse_options
1872 func_parse_options ()
1876 _G_parse_options_requote=false
1877 # this just eases exit handling
1878 while test $# -gt 0; do
1879 # Defer to hook functions for initial option parsing, so they
1880 # get priority in the event of reusing an option name.
1881 func_run_hooks func_parse_options ${1+"$@"}
1882 func_propagate_result func_run_hooks func_parse_options
1883 if $func_propagate_result_result; then
1884 eval set dummy "$func_parse_options_result"; shift
1885 # Even though we may have changed "$@", we passed the "$@" array
1886 # down into the hook and it quoted it for us (because we are in
1887 # this if-branch). No need to quote it again.
1888 _G_parse_options_requote=false
1891 # Break out of the loop if we already parsed every option.
1892 test $# -gt 0 || break
1894 # We expect that one of the options parsed in this function matches
1895 # and thus we remove _G_opt from "$@" and need to re-quote.
1896 _G_match_parse_options=:
1900 --debug|-x) debug_cmd='set -x'
1901 func_echo "enabling shell trace mode" >&2
1905 --no-warnings|--no-warning|--no-warn)
1906 set dummy --warnings none ${1+"$@"}
1910 --warnings|--warning|-W)
1911 if test $# = 0 && func_missing_arg $_G_opt; then
1912 _G_parse_options_requote=:
1915 case " $warning_categories $1" in
1917 # trailing space prevents matching last $1 above
1918 func_append_uniq opt_warning_types " $1"
1921 opt_warning_types=$warning_categories
1924 opt_warning_types=none
1928 opt_warning_types=$warning_categories
1929 warning_func=func_fatal_error
1933 "unsupported warning category: '$1'"
1939 --verbose|-v) opt_verbose=: ;;
1940 --version) func_version ;;
1941 -\?|-h) func_usage ;;
1942 --help) func_help ;;
1944 # Separate optargs to long options (plugins may need this):
1945 --*=*) func_split_equals "$_G_opt"
1946 set dummy "$func_split_equals_lhs" \
1947 "$func_split_equals_rhs" ${1+"$@"}
1951 # Separate optargs to short options:
1953 func_split_short_opt "$_G_opt"
1954 set dummy "$func_split_short_opt_name" \
1955 "$func_split_short_opt_arg" ${1+"$@"}
1959 # Separate non-argument short options:
1961 func_split_short_opt "$_G_opt"
1962 set dummy "$func_split_short_opt_name" \
1963 "-$func_split_short_opt_arg" ${1+"$@"}
1967 --) _G_parse_options_requote=: ; break ;;
1968 -*) func_fatal_help "unrecognised option: '$_G_opt'" ;;
1969 *) set dummy "$_G_opt" ${1+"$@"}; shift
1970 _G_match_parse_options=false
1975 if $_G_match_parse_options; then
1976 _G_parse_options_requote=:
1980 if $_G_parse_options_requote; then
1981 # save modified positional parameters for caller
1982 func_quote eval ${1+"$@"}
1983 func_parse_options_result=$func_quote_result
1988 # func_validate_options [ARG]...
1989 # ------------------------------
1990 # Perform any sanity checks on option settings and/or unconsumed
1992 func_hookable func_validate_options
1993 func_validate_options ()
1997 # Display all warnings if -W was not given.
1998 test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
2000 func_run_hooks func_validate_options ${1+"$@"}
2001 func_propagate_result func_run_hooks func_validate_options
2003 # Bail if the options were screwed!
2004 $exit_cmd $EXIT_FAILURE
2009 ## ----------------- ##
2010 ## Helper functions. ##
2011 ## ----------------- ##
2013 # This section contains the helper functions used by the rest of the
2014 # hookable option parser framework in ascii-betical order.
2017 # func_fatal_help ARG...
2018 # ----------------------
2019 # Echo program name prefixed message to standard error, followed by
2020 # a help hint, and exit.
2025 eval \$ECHO \""Usage: $usage"\"
2026 eval \$ECHO \""$fatal_help"\"
2027 func_error ${1+"$@"}
2034 # Echo long help message to standard output and exit.
2040 $ECHO "$long_help_message"
2045 # func_missing_arg ARGNAME
2046 # ------------------------
2047 # Echo program name prefixed message to standard error and set global
2053 func_error "Missing argument for '$1'."
2058 # func_split_equals STRING
2059 # ------------------------
2060 # Set func_split_equals_lhs and func_split_equals_rhs shell variables
2061 # after splitting STRING at the '=' sign.
2062 test -z "$_G_HAVE_XSI_OPS" \
2064 test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
2065 && _G_HAVE_XSI_OPS=yes
2067 if test yes = "$_G_HAVE_XSI_OPS"
2069 # This is an XSI compatible shell, allowing a faster implementation...
2070 eval 'func_split_equals ()
2074 func_split_equals_lhs=${1%%=*}
2075 func_split_equals_rhs=${1#*=}
2076 if test "x$func_split_equals_lhs" = "x$1"; then
2077 func_split_equals_rhs=
2081 # ...otherwise fall back to using expr, which is often a shell builtin.
2082 func_split_equals ()
2086 func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
2087 func_split_equals_rhs=
2088 test "x$func_split_equals_lhs=" = "x$1" \
2089 || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
2091 fi #func_split_equals
2094 # func_split_short_opt SHORTOPT
2095 # -----------------------------
2096 # Set func_split_short_opt_name and func_split_short_opt_arg shell
2097 # variables after splitting SHORTOPT after the 2nd character.
2098 if test yes = "$_G_HAVE_XSI_OPS"
2100 # This is an XSI compatible shell, allowing a faster implementation...
2101 eval 'func_split_short_opt ()
2105 func_split_short_opt_arg=${1#??}
2106 func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
2109 # ...otherwise fall back to using expr, which is often a shell builtin.
2110 func_split_short_opt ()
2114 func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'`
2115 func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
2117 fi #func_split_short_opt
2122 # Echo short help message to standard output and exit.
2128 $ECHO "Run '$progname --help |${PAGER-more}' for full usage"
2133 # func_usage_message
2134 # ------------------
2135 # Echo short help message to standard output.
2136 func_usage_message ()
2140 eval \$ECHO \""Usage: $usage"\"
2147 /^Written by/q' < "$progpath"
2149 eval \$ECHO \""$usage_message"\"
2155 # Echo version message to standard output and exit.
2156 # The version message is extracted from the calling file's header
2157 # comments, with leading '# ' stripped:
2158 # 1. First display the progname and version
2159 # 2. Followed by the header comment line matching /^# Written by /
2160 # 3. Then a blank line followed by the first following line matching
2162 # 4. Immediately followed by any lines between the previous matches,
2163 # except lines preceding the intervening completely blank line.
2164 # For example, see the header comments of this file.
2169 printf '%s\n' "$progname $scriptversion"
2190 s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
2200 # mode: shell-script
2202 # eval: (add-hook 'before-save-hook 'time-stamp)
2203 # time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC"
2204 # time-stamp-time-zone: "UTC"
2207 # Set a version string.
2208 scriptversion='(GNU libtool) 2.4.7'
2213 # Libtool also displays the current mode in messages, so override
2214 # funclib.sh func_echo with this custom definition.
2223 for _G_line in $_G_message; do
2225 $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
2231 # func_warning ARG...
2232 # -------------------
2233 # Libtool warnings are not categorized, so override funclib.sh
2234 # func_warning with this simpler definition.
2239 $warning_func ${1+"$@"}
2243 ## ---------------- ##
2244 ## Options parsing. ##
2245 ## ---------------- ##
2247 # Hook in the functions to make sure our own options are parsed during
2248 # the option parsing loop.
2250 usage='$progpath [OPTION]... [MODE-ARG]...'
2252 # Short help message in response to '-h'.
2253 usage_message="Options:
2254 --config show all configuration variables
2255 --debug enable verbose shell tracing
2256 -n, --dry-run display commands without modifying any files
2257 --features display basic configuration information and exit
2258 --mode=MODE use operation mode MODE
2259 --no-warnings equivalent to '-Wnone'
2260 --preserve-dup-deps don't remove duplicate dependency libraries
2261 --quiet, --silent don't print informational messages
2262 --tag=TAG use configuration variables from tag TAG
2263 -v, --verbose print more informational messages than default
2264 --version print version information
2265 -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all]
2266 -h, --help, --help-all print short, long, or detailed help message
2269 # Additional text appended to 'usage_message' in response to '--help'.
2275 $ECHO "$long_help_message
2277 MODE must be one of the following:
2279 clean remove files from the build directory
2280 compile compile a source file into a libtool object
2281 execute automatically set library path, then run a program
2282 finish complete the installation of libtool libraries
2283 install install libraries or executables
2284 link create a library or an executable
2285 uninstall remove libraries from an installed directory
2287 MODE-ARGS vary depending on the MODE. When passed as first option,
2288 '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
2289 Try '$progname --help --mode=MODE' for a more detailed description of MODE.
2291 When reporting a bug, please describe a test case to reproduce it and
2292 include the following information:
2297 compiler flags: $LTCFLAGS
2298 linker: $LD (gnu? $with_gnu_ld)
2299 version: $progname $scriptversion Debian-2.4.7-7
2300 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
2301 autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
2303 Report bugs to <bug-libtool@gnu.org>.
2304 GNU libtool home page: <http://www.gnu.org/s/libtool/>.
2305 General help using GNU software: <http://www.gnu.org/gethelp/>."
2310 # func_lo2o OBJECT-NAME
2311 # ---------------------
2312 # Transform OBJECT-NAME from a '.lo' suffix to the platform specific
2315 lo2o=s/\\.lo\$/.$objext/
2316 o2lo=s/\\.$objext\$/.lo/
2318 if test yes = "$_G_HAVE_XSI_OPS"; then
2322 *.lo) func_lo2o_result=${1%.lo}.$objext ;;
2323 * ) func_lo2o_result=$1 ;;
2327 # func_xform LIBOBJ-OR-SOURCE
2328 # ---------------------------
2329 # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
2330 # suffix to a '.lo' libtool-object suffix.
2333 func_xform_result=${1%.*}.lo
2336 # ...otherwise fall back to using sed.
2339 func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
2344 func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
2349 # func_fatal_configuration ARG...
2350 # -------------------------------
2351 # Echo program name prefixed message to standard error, followed by
2352 # a configuration failure hint, and exit.
2353 func_fatal_configuration ()
2355 func_fatal_error ${1+"$@"} \
2356 "See the $PACKAGE documentation for more information." \
2357 "Fatal configuration error."
2363 # Display the configuration for all the tags in this script.
2366 re_begincf='^# ### BEGIN LIBTOOL'
2367 re_endcf='^# ### END LIBTOOL'
2369 # Default configuration.
2370 $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
2372 # Now print the configurations for the tags.
2373 for tagname in $taglist; do
2374 $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
2383 # Display the features supported by this script.
2387 if test yes = "$build_libtool_libs"; then
2388 echo "enable shared libraries"
2390 echo "disable shared libraries"
2392 if test yes = "$build_old_libs"; then
2393 echo "enable static libraries"
2395 echo "disable static libraries"
2402 # func_enable_tag TAGNAME
2403 # -----------------------
2404 # Verify that TAGNAME is valid, and either flag an error and exit, or
2405 # enable the TAGNAME tag. We also add TAGNAME to the global $taglist
2412 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
2413 re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
2414 sed_extractcf=/$re_begincf/,/$re_endcf/p
2419 func_fatal_error "invalid tag name: $tagname"
2423 # Don't test for the "default" C tag, as we know it's
2424 # there but not specially marked.
2428 if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
2429 taglist="$taglist $tagname"
2431 # Evaluate the configuration. Be careful to quote the path
2432 # and the sed script, to avoid splitting on whitespace, but
2433 # also don't use non-portable quotes within backquotes within
2434 # quotes we have to do it in 2 steps:
2435 extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
2438 func_error "ignoring unknown tag $tagname"
2445 # func_check_version_match
2446 # ------------------------
2447 # Ensure that we are using m4 macros, and libtool script from the same
2448 # release of libtool.
2449 func_check_version_match ()
2451 if test "$package_revision" != "$macro_revision"; then
2452 if test "$VERSION" != "$macro_version"; then
2453 if test -z "$macro_version"; then
2455 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
2456 $progname: definition of this LT_INIT comes from an older release.
2457 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
2458 $progname: and run autoconf again.
2462 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
2463 $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
2464 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
2465 $progname: and run autoconf again.
2470 $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
2471 $progname: but the definition of this LT_INIT comes from revision $macro_revision.
2472 $progname: You should recreate aclocal.m4 with macros from revision $package_revision
2473 $progname: of $PACKAGE $VERSION and run autoconf again.
2482 # libtool_options_prep [ARG]...
2483 # -----------------------------
2484 # Preparation for options parsed by libtool.
2485 libtool_options_prep ()
2495 opt_preserve_dup_deps=false
2501 _G_rc_lt_options_prep=:
2503 _G_rc_lt_options_prep=:
2505 # Shorthand for --mode=foo, only valid as the first argument
2508 shift; set dummy --mode clean ${1+"$@"}; shift
2510 compile|compil|compi|comp|com|co|c)
2511 shift; set dummy --mode compile ${1+"$@"}; shift
2513 execute|execut|execu|exec|exe|ex|e)
2514 shift; set dummy --mode execute ${1+"$@"}; shift
2516 finish|finis|fini|fin|fi|f)
2517 shift; set dummy --mode finish ${1+"$@"}; shift
2519 install|instal|insta|inst|ins|in|i)
2520 shift; set dummy --mode install ${1+"$@"}; shift
2523 shift; set dummy --mode link ${1+"$@"}; shift
2525 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
2526 shift; set dummy --mode uninstall ${1+"$@"}; shift
2529 _G_rc_lt_options_prep=false
2533 if $_G_rc_lt_options_prep; then
2534 # Pass back the list of options.
2535 func_quote eval ${1+"$@"}
2536 libtool_options_prep_result=$func_quote_result
2539 func_add_hook func_options_prep libtool_options_prep
2542 # libtool_parse_options [ARG]...
2543 # ---------------------------------
2544 # Provide handling for libtool specific options.
2545 libtool_parse_options ()
2549 _G_rc_lt_parse_options=false
2551 # Perform our own loop to consume as many options as possible in
2553 while test $# -gt 0; do
2554 _G_match_lt_parse_options=:
2558 --dry-run|--dryrun|-n)
2562 --config) func_config ;;
2565 opt_dlopen="${opt_dlopen+$opt_dlopen
2570 --preserve-dup-deps)
2571 opt_preserve_dup_deps=: ;;
2573 --features) func_features ;;
2575 --finish) set dummy --mode finish ${1+"$@"}; shift ;;
2577 --help) opt_help=: ;;
2579 --help-all) opt_help=': help-all' ;;
2581 --mode) test $# = 0 && func_missing_arg $_G_opt && break
2584 # Valid mode arguments:
2585 clean|compile|execute|finish|install|link|relink|uninstall) ;;
2587 # Catch anything else as an error
2588 *) func_error "invalid argument for $_G_opt"
2596 --no-silent|--no-quiet)
2598 func_append preserve_args " $_G_opt"
2601 --no-warnings|--no-warning|--no-warn)
2603 func_append preserve_args " $_G_opt"
2608 func_append preserve_args " $_G_opt"
2614 func_append preserve_args " $_G_opt"
2617 --tag) test $# = 0 && func_missing_arg $_G_opt && break
2619 func_append preserve_args " $_G_opt $1"
2620 func_enable_tag "$1"
2624 --verbose|-v) opt_quiet=false
2626 func_append preserve_args " $_G_opt"
2629 # An option not handled by this hook function:
2630 *) set dummy "$_G_opt" ${1+"$@"} ; shift
2631 _G_match_lt_parse_options=false
2635 $_G_match_lt_parse_options && _G_rc_lt_parse_options=:
2638 if $_G_rc_lt_parse_options; then
2639 # save modified positional parameters for caller
2640 func_quote eval ${1+"$@"}
2641 libtool_parse_options_result=$func_quote_result
2644 func_add_hook func_parse_options libtool_parse_options
2648 # libtool_validate_options [ARG]...
2649 # ---------------------------------
2650 # Perform any sanity checks on option settings and/or unconsumed
2652 libtool_validate_options ()
2654 # save first non-option argument
2655 if test 0 -lt $#; then
2661 test : = "$debug_cmd" || func_append preserve_args " --debug"
2664 # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
2665 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
2666 *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
2667 # don't eliminate duplications in $postdeps and $predeps
2668 opt_duplicate_compiler_generated_deps=:
2671 opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
2676 # Sanity checks first:
2677 func_check_version_match
2679 test yes != "$build_libtool_libs" \
2680 && test yes != "$build_old_libs" \
2681 && func_fatal_configuration "not configured to build any kind of library"
2684 eval std_shrext=\"$shrext_cmds\"
2686 # Only execute mode is allowed to have -dlopen flags.
2687 if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
2688 func_error "unrecognized option '-dlopen'"
2693 # Change the help message to a mode-specific one.
2695 help="Try '$progname --help --mode=$opt_mode' for more information."
2698 # Pass back the unparsed argument list
2699 func_quote eval ${1+"$@"}
2700 libtool_validate_options_result=$func_quote_result
2702 func_add_hook func_validate_options libtool_validate_options
2705 # Process options as early as possible so that --help and --version
2706 # can return quickly.
2707 func_options ${1+"$@"}
2708 eval set dummy "$func_options_result"; shift
2716 magic='%%%MAGIC variable%%%'
2717 magic_exe='%%%MAGIC EXE variable%%%'
2723 # If this variable is set in any of the actions, the command in it
2724 # will be execed at the end. This prevents here-documents from being
2725 # left over by shells.
2729 # A function that is used when there is no print builtin or printf.
2730 func_fallback_echo ()
2732 eval 'cat <<_LTECHO_EOF
2737 # func_generated_by_libtool
2738 # True iff stdin has been generated by Libtool. This function is only
2739 # a basic sanity check; it will hardly flush out determined imposters.
2740 func_generated_by_libtool_p ()
2742 $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
2746 # True iff FILE is a libtool '.la' library or '.lo' object file.
2747 # This function is only a basic sanity check; it will hardly flush out
2748 # determined imposters.
2752 $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p
2755 # func_lalib_unsafe_p file
2756 # True iff FILE is a libtool '.la' library or '.lo' object file.
2757 # This function implements the same check as func_lalib_p without
2758 # resorting to external programs. To this end, it redirects stdin and
2759 # closes it afterwards, without saving the original file descriptor.
2760 # As a safety measure, use it only where a negative result would be
2761 # fatal anyway. Works if 'file' does not exist.
2762 func_lalib_unsafe_p ()
2765 if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
2766 for lalib_p_l in 1 2 3 4
2769 case $lalib_p_line in
2770 \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
2775 test yes = "$lalib_p"
2778 # func_ltwrapper_script_p file
2779 # True iff FILE is a libtool wrapper script
2780 # This function is only a basic sanity check; it will hardly flush out
2781 # determined imposters.
2782 func_ltwrapper_script_p ()
2785 $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p
2788 # func_ltwrapper_executable_p file
2789 # True iff FILE is a libtool wrapper executable
2790 # This function is only a basic sanity check; it will hardly flush out
2791 # determined imposters.
2792 func_ltwrapper_executable_p ()
2794 func_ltwrapper_exec_suffix=
2797 *) func_ltwrapper_exec_suffix=.exe ;;
2799 $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
2802 # func_ltwrapper_scriptname file
2803 # Assumes file is an ltwrapper_executable
2804 # uses $file to determine the appropriate filename for a
2805 # temporary ltwrapper_script.
2806 func_ltwrapper_scriptname ()
2808 func_dirname_and_basename "$1" "" "."
2809 func_stripname '' '.exe' "$func_basename_result"
2810 func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
2813 # func_ltwrapper_p file
2814 # True iff FILE is a libtool wrapper script or wrapper executable
2815 # This function is only a basic sanity check; it will hardly flush out
2816 # determined imposters.
2819 func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
2823 # func_execute_cmds commands fail_cmd
2824 # Execute tilde-delimited COMMANDS.
2825 # If FAIL_CMD is given, eval that upon failure.
2826 # FAIL_CMD may read-access the current command in variable CMD!
2827 func_execute_cmds ()
2831 save_ifs=$IFS; IFS='~'
2836 func_show_eval "$cmd" "${2-:}"
2843 # Source FILE, adding directory component if necessary.
2844 # Note that it is not necessary on cygwin/mingw to append a dot to
2845 # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
2846 # behavior happens only for exec(3), not for open(2)! Also, sourcing
2847 # 'FILE.' does not work on cygwin managed mounts.
2853 */* | *\\*) . "$1" ;;
2859 # func_resolve_sysroot PATH
2860 # Replace a leading = in PATH with a sysroot. Store the result into
2861 # func_resolve_sysroot_result
2862 func_resolve_sysroot ()
2864 func_resolve_sysroot_result=$1
2865 case $func_resolve_sysroot_result in
2867 func_stripname '=' '' "$func_resolve_sysroot_result"
2868 func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
2873 # func_replace_sysroot PATH
2874 # If PATH begins with the sysroot, replace it with = and
2875 # store the result into func_replace_sysroot_result.
2876 func_replace_sysroot ()
2878 case $lt_sysroot:$1 in
2880 func_stripname "$lt_sysroot" '' "$1"
2881 func_replace_sysroot_result='='$func_stripname_result
2884 # Including no sysroot.
2885 func_replace_sysroot_result=$1
2890 # func_infer_tag arg
2891 # Infer tagged configuration to use if any are available and
2892 # if one wasn't chosen via the "--tag" command line option.
2893 # Only attempt this if the compiler in the base compile
2894 # command doesn't match the default compiler.
2895 # arg is usually of the form 'gcc ...'
2900 if test -n "$available_tags" && test -z "$tagname"; then
2903 func_append_quoted CC_quoted "$arg"
2905 CC_expanded=`func_echo_all $CC`
2906 CC_quoted_expanded=`func_echo_all $CC_quoted`
2908 # Blanks in the command may have been stripped by the calling shell,
2909 # but not from the CC environment variable when configure was run.
2910 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
2911 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
2912 # Blanks at the start of $base_compile will cause this to fail
2913 # if we don't check for them as well.
2915 for z in $available_tags; do
2916 if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
2917 # Evaluate the configuration.
2918 eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
2921 # Double-quote args containing other shell metacharacters.
2922 func_append_quoted CC_quoted "$arg"
2924 CC_expanded=`func_echo_all $CC`
2925 CC_quoted_expanded=`func_echo_all $CC_quoted`
2927 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
2928 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
2929 # The compiler in the base compile command matches
2930 # the one in the tagged configuration.
2931 # Assume this is the tagged configuration we want.
2938 # If $tagname still isn't set, then no tagged configuration
2939 # was found and let the user know that the "--tag" command
2940 # line option must be used.
2941 if test -z "$tagname"; then
2942 func_echo "unable to infer tagged configuration"
2943 func_fatal_error "specify a tag with '--tag'"
2945 # func_verbose "using $tagname tagged configuration"
2954 # func_write_libtool_object output_name pic_name nonpic_name
2955 # Create a libtool object file (analogous to a ".la" file),
2956 # but don't create it if we're doing a dry run.
2957 func_write_libtool_object ()
2960 if test yes = "$build_libtool_libs"; then
2966 if test yes = "$build_old_libs"; then
2973 cat >${write_libobj}T <<EOF
2974 # $write_libobj - a libtool object file
2975 # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
2977 # Please DO NOT delete this file!
2978 # It is necessary for linking the library.
2980 # Name of the PIC object.
2981 pic_object=$write_lobj
2983 # Name of the non-PIC object
2984 non_pic_object=$write_oldobj
2987 $MV "${write_libobj}T" "$write_libobj"
2992 ##################################################
2993 # FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
2994 ##################################################
2996 # func_convert_core_file_wine_to_w32 ARG
2997 # Helper function used by file name conversion functions when $build is *nix,
2998 # and $host is mingw, cygwin, or some other w32 environment. Relies on a
2999 # correctly configured wine environment available, with the winepath program
3000 # in $build's $PATH.
3002 # ARG is the $build file name to be converted to w32 format.
3003 # Result is available in $func_convert_core_file_wine_to_w32_result, and will
3004 # be empty on error (or when ARG is empty)
3005 func_convert_core_file_wine_to_w32 ()
3009 func_convert_core_file_wine_to_w32_result=$1
3010 if test -n "$1"; then
3011 # Unfortunately, winepath does not exit with a non-zero error code, so we
3012 # are forced to check the contents of stdout. On the other hand, if the
3013 # command is not found, the shell will set an exit code of 127 and print
3014 # *an error message* to stdout. So we must check for both error code of
3015 # zero AND non-empty stdout, which explains the odd construction:
3016 func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
3017 if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
3018 func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
3019 $SED -e "$sed_naive_backslashify"`
3021 func_convert_core_file_wine_to_w32_result=
3025 # end: func_convert_core_file_wine_to_w32
3028 # func_convert_core_path_wine_to_w32 ARG
3029 # Helper function used by path conversion functions when $build is *nix, and
3030 # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
3031 # configured wine environment available, with the winepath program in $build's
3032 # $PATH. Assumes ARG has no leading or trailing path separator characters.
3034 # ARG is path to be converted from $build format to win32.
3035 # Result is available in $func_convert_core_path_wine_to_w32_result.
3036 # Unconvertible file (directory) names in ARG are skipped; if no directory names
3037 # are convertible, then the result may be empty.
3038 func_convert_core_path_wine_to_w32 ()
3042 # unfortunately, winepath doesn't convert paths, only file names
3043 func_convert_core_path_wine_to_w32_result=
3044 if test -n "$1"; then
3047 for func_convert_core_path_wine_to_w32_f in $1; do
3049 func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
3050 if test -n "$func_convert_core_file_wine_to_w32_result"; then
3051 if test -z "$func_convert_core_path_wine_to_w32_result"; then
3052 func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
3054 func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
3061 # end: func_convert_core_path_wine_to_w32
3064 # func_cygpath ARGS...
3065 # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
3066 # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
3067 # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
3068 # (2), returns the Cygwin file name or path in func_cygpath_result (input
3069 # file name or path is assumed to be in w32 format, as previously converted
3070 # from $build's *nix or MSYS format). In case (3), returns the w32 file name
3071 # or path in func_cygpath_result (input file name or path is assumed to be in
3072 # Cygwin format). Returns an empty string on error.
3074 # ARGS are passed to cygpath, with the last one being the file name or path to
3077 # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
3078 # environment variable; do not put it in $PATH.
3083 if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
3084 func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
3085 if test "$?" -ne 0; then
3086 # on failure, ensure result is empty
3087 func_cygpath_result=
3090 func_cygpath_result=
3091 func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
3097 # func_convert_core_msys_to_w32 ARG
3098 # Convert file name or path ARG from MSYS format to w32 format. Return
3099 # result in func_convert_core_msys_to_w32_result.
3100 func_convert_core_msys_to_w32 ()
3104 # awkward: cmd appends spaces to result
3105 func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
3106 $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
3108 #end: func_convert_core_msys_to_w32
3111 # func_convert_file_check ARG1 ARG2
3112 # Verify that ARG1 (a file name in $build format) was converted to $host
3113 # format in ARG2. Otherwise, emit an error message, but continue (resetting
3114 # func_to_host_file_result to ARG1).
3115 func_convert_file_check ()
3119 if test -z "$2" && test -n "$1"; then
3120 func_error "Could not determine host file name corresponding to"
3122 func_error "Continuing, but uninstalled executables may not work."
3124 func_to_host_file_result=$1
3127 # end func_convert_file_check
3130 # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
3131 # Verify that FROM_PATH (a path in $build format) was converted to $host
3132 # format in TO_PATH. Otherwise, emit an error message, but continue, resetting
3133 # func_to_host_file_result to a simplistic fallback value (see below).
3134 func_convert_path_check ()
3138 if test -z "$4" && test -n "$3"; then
3139 func_error "Could not determine the host path corresponding to"
3141 func_error "Continuing, but uninstalled executables may not work."
3142 # Fallback. This is a deliberately simplistic "conversion" and
3143 # should not be "improved". See libtool.info.
3144 if test "x$1" != "x$2"; then
3145 lt_replace_pathsep_chars="s|$1|$2|g"
3146 func_to_host_path_result=`echo "$3" |
3147 $SED -e "$lt_replace_pathsep_chars"`
3149 func_to_host_path_result=$3
3153 # end func_convert_path_check
3156 # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
3157 # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
3158 # and appending REPL if ORIG matches BACKPAT.
3159 func_convert_path_front_back_pathsep ()
3164 $1 ) func_to_host_path_result=$3$func_to_host_path_result
3168 $2 ) func_append func_to_host_path_result "$3"
3172 # end func_convert_path_front_back_pathsep
3175 ##################################################
3176 # $build to $host FILE NAME CONVERSION FUNCTIONS #
3177 ##################################################
3178 # invoked via '$to_host_file_cmd ARG'
3180 # In each case, ARG is the path to be converted from $build to $host format.
3181 # Result will be available in $func_to_host_file_result.
3184 # func_to_host_file ARG
3185 # Converts the file name ARG from $build format to $host format. Return result
3186 # in func_to_host_file_result.
3187 func_to_host_file ()
3191 $to_host_file_cmd "$1"
3193 # end func_to_host_file
3196 # func_to_tool_file ARG LAZY
3197 # converts the file name ARG from $build format to toolchain format. Return
3198 # result in func_to_tool_file_result. If the conversion in use is listed
3199 # in (the comma separated) LAZY, no conversion takes place.
3200 func_to_tool_file ()
3205 *,"$to_tool_file_cmd",*)
3206 func_to_tool_file_result=$1
3209 $to_tool_file_cmd "$1"
3210 func_to_tool_file_result=$func_to_host_file_result
3214 # end func_to_tool_file
3217 # func_convert_file_noop ARG
3218 # Copy ARG to func_to_host_file_result.
3219 func_convert_file_noop ()
3221 func_to_host_file_result=$1
3223 # end func_convert_file_noop
3226 # func_convert_file_msys_to_w32 ARG
3227 # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
3228 # conversion to w32 is not available inside the cwrapper. Returns result in
3229 # func_to_host_file_result.
3230 func_convert_file_msys_to_w32 ()
3234 func_to_host_file_result=$1
3235 if test -n "$1"; then
3236 func_convert_core_msys_to_w32 "$1"
3237 func_to_host_file_result=$func_convert_core_msys_to_w32_result
3239 func_convert_file_check "$1" "$func_to_host_file_result"
3241 # end func_convert_file_msys_to_w32
3244 # func_convert_file_cygwin_to_w32 ARG
3245 # Convert file name ARG from Cygwin to w32 format. Returns result in
3246 # func_to_host_file_result.
3247 func_convert_file_cygwin_to_w32 ()
3251 func_to_host_file_result=$1
3252 if test -n "$1"; then
3253 # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
3254 # LT_CYGPATH in this case.
3255 func_to_host_file_result=`cygpath -m "$1"`
3257 func_convert_file_check "$1" "$func_to_host_file_result"
3259 # end func_convert_file_cygwin_to_w32
3262 # func_convert_file_nix_to_w32 ARG
3263 # Convert file name ARG from *nix to w32 format. Requires a wine environment
3264 # and a working winepath. Returns result in func_to_host_file_result.
3265 func_convert_file_nix_to_w32 ()
3269 func_to_host_file_result=$1
3270 if test -n "$1"; then
3271 func_convert_core_file_wine_to_w32 "$1"
3272 func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
3274 func_convert_file_check "$1" "$func_to_host_file_result"
3276 # end func_convert_file_nix_to_w32
3279 # func_convert_file_msys_to_cygwin ARG
3280 # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
3281 # Returns result in func_to_host_file_result.
3282 func_convert_file_msys_to_cygwin ()
3286 func_to_host_file_result=$1
3287 if test -n "$1"; then
3288 func_convert_core_msys_to_w32 "$1"
3289 func_cygpath -u "$func_convert_core_msys_to_w32_result"
3290 func_to_host_file_result=$func_cygpath_result
3292 func_convert_file_check "$1" "$func_to_host_file_result"
3294 # end func_convert_file_msys_to_cygwin
3297 # func_convert_file_nix_to_cygwin ARG
3298 # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
3299 # in a wine environment, working winepath, and LT_CYGPATH set. Returns result
3300 # in func_to_host_file_result.
3301 func_convert_file_nix_to_cygwin ()
3305 func_to_host_file_result=$1
3306 if test -n "$1"; then
3307 # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
3308 func_convert_core_file_wine_to_w32 "$1"
3309 func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
3310 func_to_host_file_result=$func_cygpath_result
3312 func_convert_file_check "$1" "$func_to_host_file_result"
3314 # end func_convert_file_nix_to_cygwin
3317 #############################################
3318 # $build to $host PATH CONVERSION FUNCTIONS #
3319 #############################################
3320 # invoked via '$to_host_path_cmd ARG'
3322 # In each case, ARG is the path to be converted from $build to $host format.
3323 # The result will be available in $func_to_host_path_result.
3325 # Path separators are also converted from $build format to $host format. If
3326 # ARG begins or ends with a path separator character, it is preserved (but
3327 # converted to $host format) on output.
3329 # All path conversion functions are named using the following convention:
3330 # file name conversion function : func_convert_file_X_to_Y ()
3331 # path conversion function : func_convert_path_X_to_Y ()
3332 # where, for any given $build/$host combination the 'X_to_Y' value is the
3333 # same. If conversion functions are added for new $build/$host combinations,
3334 # the two new functions must follow this pattern, or func_init_to_host_path_cmd
3338 # func_init_to_host_path_cmd
3339 # Ensures that function "pointer" variable $to_host_path_cmd is set to the
3340 # appropriate value, based on the value of $to_host_file_cmd.
3342 func_init_to_host_path_cmd ()
3346 if test -z "$to_host_path_cmd"; then
3347 func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
3348 to_host_path_cmd=func_convert_path_$func_stripname_result
3353 # func_to_host_path ARG
3354 # Converts the path ARG from $build format to $host format. Return result
3355 # in func_to_host_path_result.
3356 func_to_host_path ()
3360 func_init_to_host_path_cmd
3361 $to_host_path_cmd "$1"
3363 # end func_to_host_path
3366 # func_convert_path_noop ARG
3367 # Copy ARG to func_to_host_path_result.
3368 func_convert_path_noop ()
3370 func_to_host_path_result=$1
3372 # end func_convert_path_noop
3375 # func_convert_path_msys_to_w32 ARG
3376 # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
3377 # conversion to w32 is not available inside the cwrapper. Returns result in
3378 # func_to_host_path_result.
3379 func_convert_path_msys_to_w32 ()
3383 func_to_host_path_result=$1
3384 if test -n "$1"; then
3385 # Remove leading and trailing path separator characters from ARG. MSYS
3386 # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
3387 # and winepath ignores them completely.
3388 func_stripname : : "$1"
3389 func_to_host_path_tmp1=$func_stripname_result
3390 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
3391 func_to_host_path_result=$func_convert_core_msys_to_w32_result
3392 func_convert_path_check : ";" \
3393 "$func_to_host_path_tmp1" "$func_to_host_path_result"
3394 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
3397 # end func_convert_path_msys_to_w32
3400 # func_convert_path_cygwin_to_w32 ARG
3401 # Convert path ARG from Cygwin to w32 format. Returns result in
3402 # func_to_host_file_result.
3403 func_convert_path_cygwin_to_w32 ()
3407 func_to_host_path_result=$1
3408 if test -n "$1"; then
3409 # See func_convert_path_msys_to_w32:
3410 func_stripname : : "$1"
3411 func_to_host_path_tmp1=$func_stripname_result
3412 func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
3413 func_convert_path_check : ";" \
3414 "$func_to_host_path_tmp1" "$func_to_host_path_result"
3415 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
3418 # end func_convert_path_cygwin_to_w32
3421 # func_convert_path_nix_to_w32 ARG
3422 # Convert path ARG from *nix to w32 format. Requires a wine environment and
3423 # a working winepath. Returns result in func_to_host_file_result.
3424 func_convert_path_nix_to_w32 ()
3428 func_to_host_path_result=$1
3429 if test -n "$1"; then
3430 # See func_convert_path_msys_to_w32:
3431 func_stripname : : "$1"
3432 func_to_host_path_tmp1=$func_stripname_result
3433 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
3434 func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
3435 func_convert_path_check : ";" \
3436 "$func_to_host_path_tmp1" "$func_to_host_path_result"
3437 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
3440 # end func_convert_path_nix_to_w32
3443 # func_convert_path_msys_to_cygwin ARG
3444 # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
3445 # Returns result in func_to_host_file_result.
3446 func_convert_path_msys_to_cygwin ()
3450 func_to_host_path_result=$1
3451 if test -n "$1"; then
3452 # See func_convert_path_msys_to_w32:
3453 func_stripname : : "$1"
3454 func_to_host_path_tmp1=$func_stripname_result
3455 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
3456 func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
3457 func_to_host_path_result=$func_cygpath_result
3458 func_convert_path_check : : \
3459 "$func_to_host_path_tmp1" "$func_to_host_path_result"
3460 func_convert_path_front_back_pathsep ":*" "*:" : "$1"
3463 # end func_convert_path_msys_to_cygwin
3466 # func_convert_path_nix_to_cygwin ARG
3467 # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
3468 # a wine environment, working winepath, and LT_CYGPATH set. Returns result in
3469 # func_to_host_file_result.
3470 func_convert_path_nix_to_cygwin ()
3474 func_to_host_path_result=$1
3475 if test -n "$1"; then
3476 # Remove leading and trailing path separator characters from
3477 # ARG. msys behavior is inconsistent here, cygpath turns them
3478 # into '.;' and ';.', and winepath ignores them completely.
3479 func_stripname : : "$1"
3480 func_to_host_path_tmp1=$func_stripname_result
3481 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
3482 func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
3483 func_to_host_path_result=$func_cygpath_result
3484 func_convert_path_check : : \
3485 "$func_to_host_path_tmp1" "$func_to_host_path_result"
3486 func_convert_path_front_back_pathsep ":*" "*:" : "$1"
3489 # end func_convert_path_nix_to_cygwin
3492 # func_dll_def_p FILE
3493 # True iff FILE is a Windows DLL '.def' file.
3494 # Keep in sync with _LT_DLL_DEF_P in libtool.m4
3499 func_dll_def_p_tmp=`$SED -n \
3501 -e '/^\(;.*\)*$/d' \
3502 -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \
3505 test DEF = "$func_dll_def_p_tmp"
3509 # func_mode_compile arg...
3510 func_mode_compile ()
3514 # Get the compilation command and the source file.
3516 srcfile=$nonopt # always keep a non-empty value in "srcfile"
3528 # do not "continue". Instead, add this to base_compile
3540 # Accept any command-line options.
3543 test -n "$libobj" && \
3544 func_fatal_error "you cannot specify '-o' more than once"
3549 -pie | -fpie | -fPIE)
3550 func_append pie_flag " $arg"
3554 -shared | -static | -prefer-pic | -prefer-non-pic)
3555 func_append later " $arg"
3565 arg_mode=arg # the next one goes into the "base_compile" arg list
3566 continue # The current "srcfile" will either be retained or
3567 ;; # replaced later. I would guess that would be a bug.
3570 func_stripname '-Wc,' '' "$arg"
3571 args=$func_stripname_result
3573 save_ifs=$IFS; IFS=,
3574 for arg in $args; do
3576 func_append_quoted lastarg "$arg"
3579 func_stripname ' ' '' "$lastarg"
3580 lastarg=$func_stripname_result
3582 # Add the arguments to base_compile.
3583 func_append base_compile " $lastarg"
3588 # Accept the current argument as the source file.
3589 # The previous "srcfile" becomes the current argument.
3596 esac # case $arg_mode
3598 # Aesthetically quote the previous argument.
3599 func_append_quoted base_compile "$lastarg"
3604 func_fatal_error "you must specify an argument for -Xcompile"
3607 func_fatal_error "you must specify a target with '-o'"
3610 # Get the name of the library object.
3611 test -z "$libobj" && {
3612 func_basename "$srcfile"
3613 libobj=$func_basename_result
3618 # Recognize several different file suffixes.
3619 # If the user specifies -o file.o, it is replaced with file.lo
3622 *.ada | *.adb | *.ads | *.asm | \
3623 *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
3624 *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
3625 func_xform "$libobj"
3626 libobj=$func_xform_result
3631 *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
3633 func_fatal_error "cannot determine name of library object from '$libobj'"
3637 func_infer_tag $base_compile
3639 for arg in $later; do
3642 test yes = "$build_libtool_libs" \
3643 || func_fatal_configuration "cannot build a shared library"
3649 build_libtool_libs=no
3666 func_quote_arg pretty "$libobj"
3667 test "X$libobj" != "X$func_quote_arg_result" \
3668 && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
3669 && func_warning "libobj name '$libobj' may not contain shell special characters."
3670 func_dirname_and_basename "$obj" "/" ""
3671 objname=$func_basename_result
3672 xdir=$func_dirname_result
3673 lobj=$xdir$objdir/$objname
3675 test -z "$base_compile" && \
3676 func_fatal_help "you must specify a compilation command"
3678 # Delete any leftover library objects.
3679 if test yes = "$build_old_libs"; then
3680 removelist="$obj $lobj $libobj ${libobj}T"
3682 removelist="$lobj $libobj ${libobj}T"
3685 # On Cygwin there's no "real" PIC flag so we must build both object types
3687 cygwin* | mingw* | pw32* | os2* | cegcc*)
3691 if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
3692 # non-PIC code in shared libraries is not supported
3696 # Calculate the filename of the output object if compiler does
3697 # not support -o with -c
3698 if test no = "$compiler_c_o"; then
3699 output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
3700 lockfile=$output_obj.lock
3707 # Lock this critical section if it is needed
3708 # We use this script file to make the link, it avoids creating a new file
3709 if test yes = "$need_locks"; then
3710 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
3711 func_echo "Waiting for $lockfile to be removed"
3714 elif test warn = "$need_locks"; then
3715 if test -f "$lockfile"; then
3717 *** ERROR, $lockfile exists and contains:
3718 `cat $lockfile 2>/dev/null`
3720 This indicates that another process is trying to use the same
3721 temporary object file, and libtool could not work around it because
3722 your compiler does not support '-c' and '-o' together. If you
3723 repeat this compilation, it may succeed, by chance, but you had better
3724 avoid parallel builds (make -j) in this platform, or get a better
3727 $opt_dry_run || $RM $removelist
3730 func_append removelist " $output_obj"
3731 $ECHO "$srcfile" > "$lockfile"
3734 $opt_dry_run || $RM $removelist
3735 func_append removelist " $lockfile"
3736 trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
3738 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
3739 srcfile=$func_to_tool_file_result
3740 func_quote_arg pretty "$srcfile"
3741 qsrcfile=$func_quote_arg_result
3743 # Only build a PIC object if we are building libtool libraries.
3744 if test yes = "$build_libtool_libs"; then
3745 # Without this assignment, base_compile gets emptied.
3746 fbsd_hideous_sh_bug=$base_compile
3748 if test no != "$pic_mode"; then
3749 command="$base_compile $qsrcfile $pic_flag"
3751 # Don't build PIC code
3752 command="$base_compile $qsrcfile"
3755 func_mkdir_p "$xdir$objdir"
3757 if test -z "$output_obj"; then
3758 # Place PIC objects in $objdir
3759 func_append command " -o $lobj"
3762 func_show_eval_locale "$command" \
3763 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
3765 if test warn = "$need_locks" &&
3766 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
3768 *** ERROR, $lockfile contains:
3769 `cat $lockfile 2>/dev/null`
3771 but it should contain:
3774 This indicates that another process is trying to use the same
3775 temporary object file, and libtool could not work around it because
3776 your compiler does not support '-c' and '-o' together. If you
3777 repeat this compilation, it may succeed, by chance, but you had better
3778 avoid parallel builds (make -j) in this platform, or get a better
3781 $opt_dry_run || $RM $removelist
3785 # Just move the object if needed, then go on to compile the next one
3786 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
3787 func_show_eval '$MV "$output_obj" "$lobj"' \
3788 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
3791 # Allow error messages only from the first compilation.
3792 if test yes = "$suppress_opt"; then
3793 suppress_output=' >/dev/null 2>&1'
3797 # Only build a position-dependent object if we build old libraries.
3798 if test yes = "$build_old_libs"; then
3799 if test yes != "$pic_mode"; then
3800 # Don't build PIC code
3801 command="$base_compile $qsrcfile$pie_flag"
3803 command="$base_compile $qsrcfile $pic_flag"
3805 if test yes = "$compiler_c_o"; then
3806 func_append command " -o $obj"
3809 # Suppress compiler output if we already did a PIC compilation.
3810 func_append command "$suppress_output"
3811 func_show_eval_locale "$command" \
3812 '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
3814 if test warn = "$need_locks" &&
3815 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
3817 *** ERROR, $lockfile contains:
3818 `cat $lockfile 2>/dev/null`
3820 but it should contain:
3823 This indicates that another process is trying to use the same
3824 temporary object file, and libtool could not work around it because
3825 your compiler does not support '-c' and '-o' together. If you
3826 repeat this compilation, it may succeed, by chance, but you had better
3827 avoid parallel builds (make -j) in this platform, or get a better
3830 $opt_dry_run || $RM $removelist
3834 # Just move the object if needed
3835 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
3836 func_show_eval '$MV "$output_obj" "$obj"' \
3837 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
3842 func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
3844 # Unlock the critical section if it was locked
3845 if test no != "$need_locks"; then
3846 removelist=$lockfile
3855 test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
3860 # We need to display help for each of the modes.
3863 # Generic help is extracted from the usage comments
3864 # at the start of this file.
3870 "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
3872 Remove files from the build directory.
3874 RM is the name of the program to use to delete files associated with each FILE
3875 (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed
3878 If FILE is a libtool library, object or program, all the files associated
3879 with it are deleted. Otherwise, only FILE itself is deleted using RM."
3884 "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
3886 Compile a source file into a libtool library object.
3888 This mode accepts the following additional options:
3890 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
3891 -no-suppress do not suppress compiler output for multiple passes
3892 -prefer-pic try to build PIC objects only
3893 -prefer-non-pic try to build non-PIC objects only
3894 -shared do not build a '.o' file suitable for static linking
3895 -static only build a '.o' file suitable for static linking
3897 -Xcompiler FLAG pass FLAG directly to the compiler
3899 COMPILE-COMMAND is a command to be used in creating a 'standard' object file
3900 from the given SOURCEFILE.
3902 The output file name is determined by removing the directory component from
3903 SOURCEFILE, then substituting the C source code suffix '.c' with the
3904 library object suffix, '.lo'."
3909 "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
3911 Automatically set library path, then run a program.
3913 This mode accepts the following additional options:
3915 -dlopen FILE add the directory containing FILE to the library path
3917 This mode sets the library path environment variable according to '-dlopen'
3920 If any of the ARGS are libtool executable wrappers, then they are translated
3921 into their corresponding uninstalled binary, and any of their required library
3922 directories are added to the library path.
3924 Then, COMMAND is executed, with ARGS as arguments."
3929 "Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
3931 Complete the installation of libtool libraries.
3933 Each LIBDIR is a directory that contains libtool libraries.
3935 The commands that this mode executes may require superuser privileges. Use
3936 the '--dry-run' option if you just want to see what would be executed."
3941 "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
3943 Install executables or libraries.
3945 INSTALL-COMMAND is the installation command. The first component should be
3946 either the 'install' or 'cp' program.
3948 The following components of INSTALL-COMMAND are treated specially:
3950 -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
3952 The rest of the components are interpreted as arguments to that command (only
3953 BSD-compatible install options are recognized)."
3958 "Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
3960 Link object files or libraries together to form another library, or to
3961 create an executable program.
3963 LINK-COMMAND is a command using the C compiler that you would use to create
3964 a program from several object files.
3966 The following components of LINK-COMMAND are treated specially:
3968 -all-static do not do any dynamic linking at all
3969 -avoid-version do not add a version suffix if possible
3970 -bindir BINDIR specify path to binaries directory (for systems where
3971 libraries must be found in the PATH setting at runtime)
3972 -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime
3973 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
3974 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
3975 -export-symbols SYMFILE
3976 try to export only the symbols listed in SYMFILE
3977 -export-symbols-regex REGEX
3978 try to export only the symbols matching REGEX
3979 -LLIBDIR search LIBDIR for required installed libraries
3980 -lNAME OUTPUT-FILE requires the installed library libNAME
3981 -module build a library that can dlopened
3982 -no-fast-install disable the fast-install mode
3983 -no-install link a not-installable executable
3984 -no-undefined declare that a library does not refer to external symbols
3985 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
3986 -objectlist FILE use a list of object files found in FILE to specify objects
3987 -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes)
3988 -precious-files-regex REGEX
3989 don't remove output files matching REGEX
3990 -release RELEASE specify package release information
3991 -rpath LIBDIR the created library will eventually be installed in LIBDIR
3992 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
3993 -shared only do dynamic linking of libtool libraries
3994 -shrext SUFFIX override the standard shared library file extension
3995 -static do not do any dynamic linking of uninstalled libtool libraries
3996 -static-libtool-libs
3997 do not do any dynamic linking of libtool libraries
3998 -version-info CURRENT[:REVISION[:AGE]]
3999 specify library version info [each variable defaults to 0]
4000 -weak LIBNAME declare that the target provides the LIBNAME interface
4002 -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
4004 -Xassembler FLAG pass linker-specific FLAG directly to the assembler
4006 -Xlinker FLAG pass linker-specific FLAG directly to the linker
4007 -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
4009 All other options (arguments beginning with '-') are ignored.
4011 Every other argument is treated as a filename. Files ending in '.la' are
4012 treated as uninstalled libtool libraries, other files are standard or library
4015 If the OUTPUT-FILE ends in '.la', then a libtool library is created,
4016 only library objects ('.lo' files) may be specified, and '-rpath' is
4017 required, except when creating a convenience library.
4019 If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created
4020 using 'ar' and 'ranlib', or on Windows using 'lib'.
4022 If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
4023 is created, otherwise an executable program is created."
4028 "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
4030 Remove libraries from an installation directory.
4032 RM is the name of the program to use to delete files associated with each FILE
4033 (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed
4036 If FILE is a libtool library, all the files associated with it are deleted.
4037 Otherwise, only FILE itself is deleted using RM."
4041 func_fatal_help "invalid operation mode '$opt_mode'"
4046 $ECHO "Try '$progname --help' for more information about other modes."
4049 # Now that we've collected a possible --mode arg, show help if necessary
4051 if test : = "$opt_help"; then
4056 for opt_mode in compile link execute install finish uninstall clean; do
4059 } | $SED -n '1p; 2,$s/^Usage:/ or: /p'
4062 for opt_mode in compile link execute install finish uninstall clean; do
4068 /^When reporting/,/^Report/{
4073 /information about other modes/d
4074 /more detailed .*MODE/d
4075 s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
4081 # func_mode_execute arg...
4082 func_mode_execute ()
4086 # The first argument is the command name.
4089 func_fatal_help "you must specify a COMMAND"
4091 # Handle -dlopen flags immediately.
4092 for file in $opt_dlopen; do
4094 || func_fatal_help "'$file' is not a file"
4099 func_resolve_sysroot "$file"
4100 file=$func_resolve_sysroot_result
4102 # Check to see that this really is a libtool archive.
4103 func_lalib_unsafe_p "$file" \
4104 || func_fatal_help "'$lib' is not a valid libtool archive"
4106 # Read the libtool library.
4111 # Skip this library if it cannot be dlopened.
4112 if test -z "$dlname"; then
4113 # Warn if it was a shared library.
4114 test -n "$library_names" && \
4115 func_warning "'$file' was not linked with '-export-dynamic'"
4119 func_dirname "$file" "" "."
4120 dir=$func_dirname_result
4122 if test -f "$dir/$objdir/$dlname"; then
4123 func_append dir "/$objdir"
4125 if test ! -f "$dir/$dlname"; then
4126 func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
4132 # Just add the directory containing the .lo file.
4133 func_dirname "$file" "" "."
4134 dir=$func_dirname_result
4138 func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
4143 # Get the absolute pathname.
4144 absdir=`cd "$dir" && pwd`
4145 test -n "$absdir" && dir=$absdir
4147 # Now add the directory to shlibpath_var.
4148 if eval "test -z \"\$$shlibpath_var\""; then
4149 eval "$shlibpath_var=\"\$dir\""
4151 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
4155 # This variable tells wrapper scripts just to set shlibpath_var
4156 # rather than running their programs.
4157 libtool_execute_magic=$magic
4159 # Check if any of the arguments is a wrapper script.
4164 -* | *.la | *.lo ) ;;
4166 # Do a test to see if this is really a libtool program.
4167 if func_ltwrapper_script_p "$file"; then
4169 # Transform arg to wrapped name.
4170 file=$progdir/$program
4171 elif func_ltwrapper_executable_p "$file"; then
4172 func_ltwrapper_scriptname "$file"
4173 func_source "$func_ltwrapper_scriptname_result"
4174 # Transform arg to wrapped name.
4175 file=$progdir/$program
4179 # Quote arguments (to preserve shell metacharacters).
4180 func_append_quoted args "$file"
4183 if $opt_dry_run; then
4184 # Display what would be done.
4185 if test -n "$shlibpath_var"; then
4186 eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
4187 echo "export $shlibpath_var"
4192 if test -n "$shlibpath_var"; then
4193 # Export the shlibpath_var.
4194 eval "export $shlibpath_var"
4197 # Restore saved environment variables
4198 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
4200 eval "if test \"\${save_$lt_var+set}\" = set; then
4201 $lt_var=\$save_$lt_var; export $lt_var
4207 # Now prepare to actually exec the command.
4212 test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
4215 # func_mode_finish arg...
4224 for opt in "$nonopt" ${1+"$@"}
4226 if test -d "$opt"; then
4227 func_append libdirs " $opt"
4229 elif test -f "$opt"; then
4230 if func_lalib_unsafe_p "$opt"; then
4231 func_append libs " $opt"
4233 func_warning "'$opt' is not a valid libtool archive"
4237 func_fatal_error "invalid argument '$opt'"
4241 if test -n "$libs"; then
4242 if test -n "$lt_sysroot"; then
4243 sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
4244 sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
4249 # Remove sysroot references
4250 if $opt_dry_run; then
4251 for lib in $libs; do
4252 echo "removing references to $lt_sysroot and '=' prefixes from $lib"
4255 tmpdir=`func_mktempdir`
4256 for lib in $libs; do
4257 $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
4259 mv -f $tmpdir/tmp-la $lib
4265 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4266 for libdir in $libdirs; do
4267 if test -n "$finish_cmds"; then
4268 # Do each command in the finish commands.
4269 func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
4272 if test -n "$finish_eval"; then
4273 # Do the single finish_eval.
4274 eval cmds=\"$finish_eval\"
4275 $opt_dry_run || eval "$cmds" || func_append admincmds "
4281 # Exit here if they wanted silent mode.
4282 $opt_quiet && exit $EXIT_SUCCESS
4284 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4285 echo "----------------------------------------------------------------------"
4286 echo "Libraries have been installed in:"
4287 for libdir in $libdirs; do
4291 echo "If you ever happen to want to link against installed libraries"
4292 echo "in a given directory, LIBDIR, you must either use libtool, and"
4293 echo "specify the full pathname of the library, or use the '-LLIBDIR'"
4294 echo "flag during linking and do at least one of the following:"
4295 if test -n "$shlibpath_var"; then
4296 echo " - add LIBDIR to the '$shlibpath_var' environment variable"
4297 echo " during execution"
4299 if test -n "$runpath_var"; then
4300 echo " - add LIBDIR to the '$runpath_var' environment variable"
4301 echo " during linking"
4303 if test -n "$hardcode_libdir_flag_spec"; then
4305 eval flag=\"$hardcode_libdir_flag_spec\"
4307 $ECHO " - use the '$flag' linker flag"
4309 if test -n "$admincmds"; then
4310 $ECHO " - have your system administrator run these commands:$admincmds"
4312 if test -f /etc/ld.so.conf; then
4313 echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'"
4317 echo "See any operating system documentation about shared libraries for"
4319 solaris2.[6789]|solaris2.1[0-9])
4320 echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
4324 echo "more information, such as the ld(1) and ld.so(8) manual pages."
4327 echo "----------------------------------------------------------------------"
4332 test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
4335 # func_mode_install arg...
4336 func_mode_install ()
4340 # There may be an optional sh(1) argument at the beginning of
4341 # install_prog (especially on Windows NT).
4342 if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
4343 # Allow the use of GNU shtool's install command.
4344 case $nonopt in *shtool*) :;; *) false;; esac
4346 # Aesthetically quote it.
4347 func_quote_arg pretty "$nonopt"
4348 install_prog="$func_quote_arg_result "
4356 # The real first argument should be the name of the installation program.
4357 # Aesthetically quote it.
4358 func_quote_arg pretty "$arg"
4359 func_append install_prog "$func_quote_arg_result"
4360 install_shared_prog=$install_prog
4361 case " $install_prog " in
4362 *[\\\ /]cp\ *) install_cp=: ;;
4363 *) install_cp=false ;;
4366 # We need to accept at least all the BSD install flags.
4378 if test -n "$dest"; then
4379 func_append files " $dest"
4387 if $install_cp; then :; else
4401 # If the previous option needed an argument, then skip it.
4402 if test -n "$prev"; then
4403 if test X-m = "X$prev" && test -n "$install_override_mode"; then
4404 arg2=$install_override_mode
4415 # Aesthetically quote the argument.
4416 func_quote_arg pretty "$arg"
4417 func_append install_prog " $func_quote_arg_result"
4418 if test -n "$arg2"; then
4419 func_quote_arg pretty "$arg2"
4421 func_append install_shared_prog " $func_quote_arg_result"
4424 test -z "$install_prog" && \
4425 func_fatal_help "you must specify an install program"
4427 test -n "$prev" && \
4428 func_fatal_help "the '$prev' option requires an argument"
4430 if test -n "$install_override_mode" && $no_mode; then
4431 if $install_cp; then :; else
4432 func_quote_arg pretty "$install_override_mode"
4433 func_append install_shared_prog " -m $func_quote_arg_result"
4437 if test -z "$files"; then
4438 if test -z "$dest"; then
4439 func_fatal_help "no file or destination specified"
4441 func_fatal_help "you must specify a destination"
4445 # Strip any trailing slash from the destination.
4446 func_stripname '' '/' "$dest"
4447 dest=$func_stripname_result
4449 # Check to see that the destination is a directory.
4450 test -d "$dest" && isdir=:
4455 func_dirname_and_basename "$dest" "" "."
4456 destdir=$func_dirname_result
4457 destname=$func_basename_result
4459 # Not a directory, so check to see that there is only one file specified.
4460 set dummy $files; shift
4461 test "$#" -gt 1 && \
4462 func_fatal_help "'$dest' is not a directory"
4465 [\\/]* | [A-Za-z]:[\\/]*) ;;
4467 for file in $files; do
4471 func_fatal_help "'$destdir' must be an absolute directory name"
4478 # This variable tells wrapper scripts just to set variables rather
4479 # than running their programs.
4480 libtool_install_magic=$magic
4485 for file in $files; do
4487 # Do each installation.
4490 # Do the static libraries later.
4491 func_append staticlibs " $file"
4495 func_resolve_sysroot "$file"
4496 file=$func_resolve_sysroot_result
4498 # Check to see that this really is a libtool archive.
4499 func_lalib_unsafe_p "$file" \
4500 || func_fatal_help "'$file' is not a valid libtool archive"
4507 # Add the libdir to current_libdirs if it is the destination.
4508 if test "X$destdir" = "X$libdir"; then
4509 case "$current_libdirs " in
4511 *) func_append current_libdirs " $libdir" ;;
4514 # Note the libdir as a future libdir.
4515 case "$future_libdirs " in
4517 *) func_append future_libdirs " $libdir" ;;
4521 func_dirname "$file" "/" ""
4522 dir=$func_dirname_result
4523 func_append dir "$objdir"
4525 if test -n "$relink_command"; then
4526 # Determine the prefix the user has applied to our future dir.
4527 inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
4529 # Don't allow the user to place us outside of our expected
4530 # location b/c this prevents finding dependent libraries that
4531 # are installed to the same prefix.
4532 # At present, this check doesn't affect windows .dll's that
4533 # are installed into $libdir/../bin (currently, that works fine)
4534 # but it's something to keep an eye on.
4535 test "$inst_prefix_dir" = "$destdir" && \
4536 func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
4538 if test -n "$inst_prefix_dir"; then
4539 # Stick the inst_prefix_dir data into the link command.
4540 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
4542 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
4545 func_warning "relinking '$file'"
4546 func_show_eval "$relink_command" \
4547 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
4550 # See the names of the shared library.
4551 set dummy $library_names; shift
4552 if test -n "$1"; then
4557 test -n "$relink_command" && srcname=${realname}T
4559 # Install the shared library and build the symlinks.
4560 func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
4564 cygwin* | mingw* | pw32* | cegcc*)
4579 if test -n "$tstripme" && test -n "$striplib"; then
4580 func_show_eval "$striplib $destdir/$realname" 'exit $?'
4583 if test "$#" -gt 0; then
4584 # Delete the old symlinks, and create new ones.
4585 # Try 'ln -sf' first, because the 'ln' binary might depend on
4586 # the symlink we replace! Solaris /bin/ln does not understand -f,
4587 # so we also need to try rm && ln -s.
4590 test "$linkname" != "$realname" \
4591 && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
4595 # Do each command in the postinstall commands.
4596 lib=$destdir/$realname
4597 func_execute_cmds "$postinstall_cmds" 'exit $?'
4600 # Install the pseudo-library for information purposes.
4601 func_basename "$file"
4602 name=$func_basename_result
4603 instname=$dir/${name}i
4604 func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
4606 # Maybe install the static library, too.
4607 test -n "$old_library" && func_append staticlibs " $dir/$old_library"
4611 # Install (i.e. copy) a libtool object.
4613 # Figure out destination file name, if it wasn't already specified.
4614 if test -n "$destname"; then
4615 destfile=$destdir/$destname
4617 func_basename "$file"
4618 destfile=$func_basename_result
4619 destfile=$destdir/$destfile
4622 # Deduce the name of the destination old-style object file.
4625 func_lo2o "$destfile"
4626 staticdest=$func_lo2o_result
4629 staticdest=$destfile
4633 func_fatal_help "cannot copy a libtool object to '$destfile'"
4637 # Install the libtool object if requested.
4638 test -n "$destfile" && \
4639 func_show_eval "$install_prog $file $destfile" 'exit $?'
4641 # Install the old object if enabled.
4642 if test yes = "$build_old_libs"; then
4643 # Deduce the name of the old-style object file.
4645 staticobj=$func_lo2o_result
4646 func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
4652 # Figure out destination file name, if it wasn't already specified.
4653 if test -n "$destname"; then
4654 destfile=$destdir/$destname
4656 func_basename "$file"
4657 destfile=$func_basename_result
4658 destfile=$destdir/$destfile
4661 # If the file is missing, and there is a .exe on the end, strip it
4662 # because it is most likely a libtool script we actually want to
4667 if test ! -f "$file"; then
4668 func_stripname '' '.exe' "$file"
4669 file=$func_stripname_result
4675 # Do a test to see if this is really a libtool program.
4678 if func_ltwrapper_executable_p "$file"; then
4679 func_ltwrapper_scriptname "$file"
4680 wrapper=$func_ltwrapper_scriptname_result
4682 func_stripname '' '.exe' "$file"
4683 wrapper=$func_stripname_result
4690 if func_ltwrapper_script_p "$wrapper"; then
4694 func_source "$wrapper"
4696 # Check the variables that should have been set.
4697 test -z "$generated_by_libtool_version" && \
4698 func_fatal_error "invalid libtool wrapper script '$wrapper'"
4701 for lib in $notinst_deplibs; do
4702 # Check to see that each library is installed.
4704 if test -f "$lib"; then
4707 libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
4708 if test -n "$libdir" && test ! -f "$libfile"; then
4709 func_warning "'$lib' has not been installed in '$libdir'"
4715 func_source "$wrapper"
4718 if test no = "$fast_install" && test -n "$relink_command"; then
4721 tmpdir=`func_mktempdir`
4722 func_basename "$file$stripped_ext"
4723 file=$func_basename_result
4724 outputname=$tmpdir/$file
4725 # Replace the output file specification.
4726 relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
4729 func_quote_arg expand,pretty "$relink_command"
4730 eval "func_echo $func_quote_arg_result"
4732 if eval "$relink_command"; then :
4734 func_error "error: relink '$file' with the above command before installing it"
4735 $opt_dry_run || ${RM}r "$tmpdir"
4740 func_warning "cannot relink '$file'"
4744 # Install the binary that we compiled earlier.
4745 file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
4749 # remove .exe since cygwin /usr/bin/install will append another
4751 case $install_prog,$host in
4752 */usr/bin/install*,*cygwin*)
4753 case $file:$destfile in
4758 destfile=$destfile.exe
4761 func_stripname '' '.exe' "$destfile"
4762 destfile=$func_stripname_result
4767 func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
4768 $opt_dry_run || if test -n "$outputname"; then
4775 for file in $staticlibs; do
4776 func_basename "$file"
4777 name=$func_basename_result
4779 # Set up the ranlib parameters.
4780 oldlib=$destdir/$name
4781 func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
4782 tool_oldlib=$func_to_tool_file_result
4784 func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
4786 if test -n "$stripme" && test -n "$old_striplib"; then
4787 func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
4790 # Do each command in the postinstall commands.
4791 func_execute_cmds "$old_postinstall_cmds" 'exit $?'
4794 test -n "$future_libdirs" && \
4795 func_warning "remember to run '$progname --finish$future_libdirs'"
4797 if test -n "$current_libdirs"; then
4798 # Maybe just do a dry run.
4799 $opt_dry_run && current_libdirs=" -n$current_libdirs"
4800 exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
4806 test install = "$opt_mode" && func_mode_install ${1+"$@"}
4809 # func_generate_dlsyms outputname originator pic_p
4810 # Extract symbols from dlprefiles and create ${outputname}S.o with
4811 # a dlpreopen symbol table.
4812 func_generate_dlsyms ()
4819 my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`
4822 if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
4823 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4824 my_dlsyms=${my_outputname}S.c
4826 func_error "not configured to extract global symbols from dlpreopened files"
4830 if test -n "$my_dlsyms"; then
4834 # Discover the nlist of each of the dlfiles.
4835 nlist=$output_objdir/$my_outputname.nm
4837 func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
4839 # Parse the name list into a source file.
4840 func_verbose "creating $output_objdir/$my_dlsyms"
4842 $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
4843 /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
4844 /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
4850 #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
4851 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
4854 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
4855 #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
4856 /* DATA imports from DLLs on WIN32 can't be const, because runtime
4857 relocations are performed -- see ld's documentation on pseudo-relocs. */
4858 # define LT_DLSYM_CONST
4859 #elif defined __osf__
4860 /* This system does not cope well with relocations in const data. */
4861 # define LT_DLSYM_CONST
4863 # define LT_DLSYM_CONST const
4866 #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
4868 /* External symbol declarations for the compiler. */\
4871 if test yes = "$dlself"; then
4872 func_verbose "generating symbol list for '$output'"
4874 $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
4876 # Add our own program objects to the symbol list.
4877 progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
4878 for progfile in $progfiles; do
4879 func_to_tool_file "$progfile" func_convert_file_msys_to_w32
4880 func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
4881 $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
4884 if test -n "$exclude_expsyms"; then
4886 eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4887 eval '$MV "$nlist"T "$nlist"'
4891 if test -n "$export_symbols_regex"; then
4893 eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4894 eval '$MV "$nlist"T "$nlist"'
4898 # Prepare the list of exported symbols
4899 if test -z "$export_symbols"; then
4900 export_symbols=$output_objdir/$outputname.exp
4903 eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4905 *cygwin* | *mingw* | *cegcc* )
4906 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4907 eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
4913 eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4914 eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4915 eval '$MV "$nlist"T "$nlist"'
4917 *cygwin* | *mingw* | *cegcc* )
4918 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4919 eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
4926 for dlprefile in $dlprefiles; do
4927 func_verbose "extracting global C symbols from '$dlprefile'"
4928 func_basename "$dlprefile"
4929 name=$func_basename_result
4931 *cygwin* | *mingw* | *cegcc* )
4932 # if an import library, we need to obtain dlname
4933 if func_win32_import_lib_p "$dlprefile"; then
4934 func_tr_sh "$dlprefile"
4935 eval "curr_lafile=\$libfile_$func_tr_sh_result"
4936 dlprefile_dlbasename=
4937 if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
4938 # Use subshell, to avoid clobbering current variable values
4939 dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
4940 if test -n "$dlprefile_dlname"; then
4941 func_basename "$dlprefile_dlname"
4942 dlprefile_dlbasename=$func_basename_result
4944 # no lafile. user explicitly requested -dlpreopen <import library>.
4945 $sharedlib_from_linklib_cmd "$dlprefile"
4946 dlprefile_dlbasename=$sharedlib_from_linklib_result
4950 if test -n "$dlprefile_dlbasename"; then
4951 eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
4953 func_warning "Could not compute DLL name from $name"
4954 eval '$ECHO ": $name " >> "$nlist"'
4956 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
4957 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
4958 $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
4960 else # not an import lib
4962 eval '$ECHO ": $name " >> "$nlist"'
4963 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
4964 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
4970 eval '$ECHO ": $name " >> "$nlist"'
4971 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
4972 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
4979 # Make sure we have at least an empty file.
4980 test -f "$nlist" || : > "$nlist"
4982 if test -n "$exclude_expsyms"; then
4983 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4984 $MV "$nlist"T "$nlist"
4987 # Try sorting and uniquifying the output.
4988 if $GREP -v "^: " < "$nlist" |
4989 if sort -k 3 </dev/null >/dev/null 2>&1; then
4994 uniq > "$nlist"S; then
4997 $GREP -v "^: " < "$nlist" > "$nlist"S
5000 if test -f "$nlist"S; then
5001 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
5003 echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
5006 func_show_eval '$RM "${nlist}I"'
5007 if test -n "$global_symbol_to_import"; then
5008 eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
5011 echo >> "$output_objdir/$my_dlsyms" "\
5013 /* The mapping between symbol names and symbols. */
5018 extern LT_DLSYM_CONST lt_dlsymlist
5019 lt_${my_prefix}_LTX_preloaded_symbols[];\
5022 if test -s "$nlist"I; then
5023 echo >> "$output_objdir/$my_dlsyms" "\
5024 static void lt_syminit(void)
5026 LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
5027 for (; symbol->name; ++symbol)
5029 $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
5030 echo >> "$output_objdir/$my_dlsyms" "\
5034 echo >> "$output_objdir/$my_dlsyms" "\
5035 LT_DLSYM_CONST lt_dlsymlist
5036 lt_${my_prefix}_LTX_preloaded_symbols[] =
5037 { {\"$my_originator\", (void *) 0},"
5039 if test -s "$nlist"I; then
5040 echo >> "$output_objdir/$my_dlsyms" "\
5041 {\"@INIT@\", (void *) <_syminit},"
5044 case $need_lib_prefix in
5046 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
5049 eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
5052 echo >> "$output_objdir/$my_dlsyms" "\
5056 /* This works around a problem in FreeBSD linker */
5057 #ifdef FREEBSD_WORKAROUND
5058 static const void *lt_preloaded_setup() {
5059 return lt_${my_prefix}_LTX_preloaded_symbols;
5069 pic_flag_for_symtable=
5070 case "$compile_command " in
5074 # compiling the symbol table file with pic_flag works around
5075 # a FreeBSD bug that causes programs to crash when -lm is
5076 # linked before any other PIC object. But we must not use
5077 # pic_flag when linking with -static. The problem exists in
5078 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
5079 *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
5080 pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
5082 pic_flag_for_symtable=" $pic_flag" ;;
5084 $my_pic_p && pic_flag_for_symtable=" $pic_flag"
5090 for arg in $LTCFLAGS; do
5092 -pie | -fpie | -fPIE) ;;
5093 *) func_append symtab_cflags " $arg" ;;
5097 # Now compile the dynamic symbol file.
5098 func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
5100 # Clean up the generated files.
5101 func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
5103 # Transform the symbol file into the correct name.
5104 symfileobj=$output_objdir/${my_outputname}S.$objext
5106 *cygwin* | *mingw* | *cegcc* )
5107 if test -f "$output_objdir/$my_outputname.def"; then
5108 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
5109 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
5111 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
5112 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
5116 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
5117 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
5122 func_fatal_error "unknown suffix for '$my_dlsyms'"
5126 # We keep going just in case the user didn't refer to
5127 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
5128 # really was required.
5130 # Nullify the symbol file.
5131 compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
5132 finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
5136 # func_cygming_gnu_implib_p ARG
5137 # This predicate returns with zero status (TRUE) if
5138 # ARG is a GNU/binutils-style import library. Returns
5139 # with nonzero status (FALSE) otherwise.
5140 func_cygming_gnu_implib_p ()
5144 func_to_tool_file "$1" func_convert_file_msys_to_w32
5145 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)$'`
5146 test -n "$func_cygming_gnu_implib_tmp"
5149 # func_cygming_ms_implib_p ARG
5150 # This predicate returns with zero status (TRUE) if
5151 # ARG is an MS-style import library. Returns
5152 # with nonzero status (FALSE) otherwise.
5153 func_cygming_ms_implib_p ()
5157 func_to_tool_file "$1" func_convert_file_msys_to_w32
5158 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
5159 test -n "$func_cygming_ms_implib_tmp"
5162 # func_win32_libid arg
5163 # return the library type of file 'arg'
5165 # Need a lot of goo to handle *both* DLLs and import libs
5166 # Has to be a shell function in order to 'eat' the argument
5167 # that is supplied when $file_magic_command is called.
5168 # Despite the name, also deal with 64 bit binaries.
5173 win32_libid_type=unknown
5174 win32_fileres=`file -L $1 2>/dev/null`
5175 case $win32_fileres in
5176 *ar\ archive\ import\ library*) # definitely import
5177 win32_libid_type="x86 archive import"
5179 *ar\ archive*) # could be an import, or static
5180 # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
5181 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
5182 $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
5183 case $nm_interface in
5185 if func_cygming_ms_implib_p "$1" ||
5186 func_cygming_gnu_implib_p "$1"
5194 func_to_tool_file "$1" func_convert_file_msys_to_w32
5195 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
5206 case $win32_nmres in
5207 import*) win32_libid_type="x86 archive import";;
5208 *) win32_libid_type="x86 archive static";;
5213 win32_libid_type="x86 DLL"
5215 *executable*) # but shell scripts are "executable" too...
5216 case $win32_fileres in
5217 *MS\ Windows\ PE\ Intel*)
5218 win32_libid_type="x86 DLL"
5223 $ECHO "$win32_libid_type"
5226 # func_cygming_dll_for_implib ARG
5228 # Platform-specific function to extract the
5229 # name of the DLL associated with the specified
5230 # import library ARG.
5231 # Invoked by eval'ing the libtool variable
5232 # $sharedlib_from_linklib_cmd
5233 # Result is available in the variable
5234 # $sharedlib_from_linklib_result
5235 func_cygming_dll_for_implib ()
5239 sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
5242 # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
5244 # The is the core of a fallback implementation of a
5245 # platform-specific function to extract the name of the
5246 # DLL associated with the specified import library LIBNAME.
5248 # SECTION_NAME is either .idata$6 or .idata$7, depending
5249 # on the platform and compiler that created the implib.
5251 # Echos the name of the DLL associated with the
5252 # specified import library.
5253 func_cygming_dll_for_implib_fallback_core ()
5257 match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
5258 $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
5259 $SED '/^Contents of section '"$match_literal"':/{
5260 # Place marker at beginning of archive member dllname section
5265 # These lines can sometimes be longer than 43 characters, but
5266 # are always uninteresting
5267 /:[ ]*file format pe[i]\{,1\}-/d
5268 /^In archive [^:]*:/d
5269 # Ensure marker is printed
5271 # Remove all lines with less than 43 characters
5273 # From remaining lines, remove first 43 characters
5276 # Join marker and all lines until next marker into a single line
5277 /^====MARK====/ b para
5286 # Remove trailing dots and whitespace
5290 # we now have a list, one entry per line, of the stringified
5291 # contents of the appropriate section of all members of the
5292 # archive that possess that section. Heuristic: eliminate
5293 # all those that have a first or second character that is
5294 # a '.' (that is, objdump's representation of an unprintable
5295 # character.) This should work for all archives with less than
5296 # 0x302f exports -- but will fail for DLLs whose name actually
5297 # begins with a literal '.' or a single character followed by
5300 # Of those that remain, print the first one.
5301 $SED -e '/^\./d;/^.\./d;q'
5304 # func_cygming_dll_for_implib_fallback ARG
5305 # Platform-specific function to extract the
5306 # name of the DLL associated with the specified
5307 # import library ARG.
5309 # This fallback implementation is for use when $DLLTOOL
5310 # does not support the --identify-strict option.
5311 # Invoked by eval'ing the libtool variable
5312 # $sharedlib_from_linklib_cmd
5313 # Result is available in the variable
5314 # $sharedlib_from_linklib_result
5315 func_cygming_dll_for_implib_fallback ()
5319 if func_cygming_gnu_implib_p "$1"; then
5320 # binutils import library
5321 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
5322 elif func_cygming_ms_implib_p "$1"; then
5323 # ms-generated import library
5324 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
5327 sharedlib_from_linklib_result=
5332 # func_extract_an_archive dir oldlib
5333 func_extract_an_archive ()
5337 f_ex_an_ar_dir=$1; shift
5338 f_ex_an_ar_oldlib=$1
5339 if test yes = "$lock_old_archive_extraction"; then
5340 lockfile=$f_ex_an_ar_oldlib.lock
5341 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
5342 func_echo "Waiting for $lockfile to be removed"
5346 func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
5347 'stat=$?; rm -f "$lockfile"; exit $stat'
5348 if test yes = "$lock_old_archive_extraction"; then
5349 $opt_dry_run || rm -f "$lockfile"
5351 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
5354 func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
5359 # func_extract_archives gentop oldlib ...
5360 func_extract_archives ()
5365 my_oldlibs=${1+"$@"}
5371 for my_xlib in $my_oldlibs; do
5372 # Extract the objects.
5374 [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
5375 *) my_xabs=`pwd`"/$my_xlib" ;;
5377 func_basename "$my_xlib"
5378 my_xlib=$func_basename_result
5381 case " $extracted_archives " in
5383 func_arith $extracted_serial + 1
5384 extracted_serial=$func_arith_result
5385 my_xlib_u=lt$extracted_serial-$my_xlib ;;
5389 extracted_archives="$extracted_archives $my_xlib_u"
5390 my_xdir=$my_gentop/$my_xlib_u
5392 func_mkdir_p "$my_xdir"
5396 func_verbose "Extracting $my_xabs"
5397 # Do not bother doing anything if just a dry run
5399 darwin_orig_dir=`pwd`
5400 cd $my_xdir || exit $?
5401 darwin_archive=$my_xabs
5403 func_basename "$darwin_archive"
5404 darwin_base_archive=$func_basename_result
5405 darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
5406 if test -n "$darwin_arches"; then
5407 darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
5409 func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
5410 for darwin_arch in $darwin_arches; do
5411 func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
5412 $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
5413 cd "unfat-$$/$darwin_base_archive-$darwin_arch"
5414 func_extract_an_archive "`pwd`" "$darwin_base_archive"
5416 $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
5417 done # $darwin_arches
5418 ## Okay now we've a bunch of thin objects, gotta fatten them up :)
5419 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u`
5422 for darwin_file in $darwin_filelist; do
5423 darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
5424 $LIPO -create -output "$darwin_file" $darwin_files
5425 done # $darwin_filelist
5427 cd "$darwin_orig_dir"
5430 func_extract_an_archive "$my_xdir" "$my_xabs"
5435 func_extract_an_archive "$my_xdir" "$my_xabs"
5438 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
5441 func_extract_archives_result=$my_oldobjs
5445 # func_emit_wrapper [arg=no]
5447 # Emit a libtool wrapper script on stdout.
5448 # Don't directly open a file because we may want to
5449 # incorporate the script contents within a cygwin/mingw
5450 # wrapper executable. Must ONLY be called from within
5451 # func_mode_link because it depends on a number of variables
5454 # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
5455 # variable will take. If 'yes', then the emitted script
5456 # will assume that the directory where it is stored is
5457 # the $objdir directory. This is a cygwin/mingw-specific
5459 func_emit_wrapper ()
5461 func_emit_wrapper_arg1=${1-no}
5466 # $output - temporary wrapper script for $objdir/$outputname
5467 # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
5469 # The $output program cannot be directly executed until all the libtool
5470 # libraries that it depends on are installed.
5472 # This wrapper script should never be moved out of the build directory.
5473 # If it is, it will not operate correctly.
5475 # Sed substitution that helps us do robust quoting. It backslashifies
5476 # metacharacters that are still active within double-quoted strings.
5477 sed_quote_subst='$sed_quote_subst'
5479 # Be Bourne compatible
5480 if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
5483 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
5484 # is contrary to our usage. Disable this feature.
5485 alias -g '\${1+\"\$@\"}'='\"\$@\"'
5486 setopt NO_GLOB_SUBST
5488 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
5490 BIN_SH=xpg4; export BIN_SH # for Tru64
5491 DUALCASE=1; export DUALCASE # for MKS sh
5493 # The HP-UX ksh and POSIX shell print the target directory to stdout
5495 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5497 relink_command=\"$relink_command\"
5499 # This environment variable determines our operation mode.
5500 if test \"\$libtool_install_magic\" = \"$magic\"; then
5501 # install mode needs the following variables:
5502 generated_by_libtool_version='$macro_version'
5503 notinst_deplibs='$notinst_deplibs'
5505 # When we are sourced in execute mode, \$file and \$ECHO are already set.
5506 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5509 func_quote_arg pretty "$ECHO"
5510 qECHO=$func_quote_arg_result
5513 # A function that is used when there is no print builtin or printf.
5514 func_fallback_echo ()
5516 eval 'cat <<_LTECHO_EOF
5523 # Very basic option parsing. These options are (a) specific to
5524 # the libtool wrapper, (b) are identical between the wrapper
5525 # /script/ and the wrapper /executable/ that is used only on
5526 # windows platforms, and (c) all begin with the string "--lt-"
5527 # (application programs are unlikely to have options that match
5530 # There are only two supported options: --lt-debug and
5531 # --lt-dump-script. There is, deliberately, no --lt-help.
5533 # The first argument to this parsing function should be the
5534 # script's $0 value, followed by "$@".
5536 func_parse_lt_options ()
5542 case \"\$lt_opt\" in
5543 --lt-debug) lt_option_debug=1 ;;
5545 lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
5546 test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
5547 lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
5548 cat \"\$lt_dump_D/\$lt_dump_F\"
5552 \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
5558 # Print the debug banner immediately:
5559 if test -n \"\$lt_option_debug\"; then
5560 echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
5564 # Used when --lt-debug. Prints its arguments to stdout
5565 # (redirection is the responsibility of the caller)
5566 func_lt_dump_args ()
5571 \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
5572 lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
5576 # Core function for launching the target application
5577 func_exec_program_core ()
5581 # Backslashes separate directories on plain windows
5582 *-*-mingw | *-*-os2* | *-cegcc*)
5584 if test -n \"\$lt_option_debug\"; then
5585 \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
5586 func_lt_dump_args \${1+\"\$@\"} 1>&2
5588 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
5594 if test -n \"\$lt_option_debug\"; then
5595 \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
5596 func_lt_dump_args \${1+\"\$@\"} 1>&2
5598 exec \"\$progdir/\$program\" \${1+\"\$@\"}
5603 \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
5607 # A function to encapsulate launching the target application
5608 # Strips options in the --lt-* namespace from \$@ and
5609 # launches target application with the remaining arguments.
5610 func_exec_program ()
5618 *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
5623 func_exec_program_core \${1+\"\$@\"}
5627 func_parse_lt_options \"\$0\" \${1+\"\$@\"}
5629 # Find the directory that this script lives in.
5630 thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
5631 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5633 # Follow symbolic links until we get to the real thisdir.
5634 file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
5635 while test -n \"\$file\"; do
5636 destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
5638 # If there was a directory component, then change thisdir.
5639 if test \"x\$destdir\" != \"x\$file\"; then
5640 case \"\$destdir\" in
5641 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5642 *) thisdir=\"\$thisdir/\$destdir\" ;;
5646 file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
5647 file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
5650 # Usually 'no', except on cygwin/mingw when embedded into
5652 WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
5653 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
5654 # special case for '.'
5655 if test \"\$thisdir\" = \".\"; then
5658 # remove .libs from thisdir
5659 case \"\$thisdir\" in
5660 *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
5661 $objdir ) thisdir=. ;;
5665 # Try to get the absolute directory name.
5666 absdir=\`cd \"\$thisdir\" && pwd\`
5667 test -n \"\$absdir\" && thisdir=\"\$absdir\"
5670 if test yes = "$fast_install"; then
5672 program=lt-'$outputname'$exeext
5673 progdir=\"\$thisdir/$objdir\"
5675 if test ! -f \"\$progdir/\$program\" ||
5676 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\
5677 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5679 file=\"\$\$-\$program\"
5681 if test ! -d \"\$progdir\"; then
5682 $MKDIR \"\$progdir\"
5684 $RM \"\$progdir/\$file\"
5689 # relink executable if necessary
5690 if test -n \"\$relink_command\"; then
5691 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5693 \$ECHO \"\$relink_command_output\" >&2
5694 $RM \"\$progdir/\$file\"
5699 $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5700 { $RM \"\$progdir/\$program\";
5701 $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5702 $RM \"\$progdir/\$file\"
5706 program='$outputname'
5707 progdir=\"\$thisdir/$objdir\"
5713 if test -f \"\$progdir/\$program\"; then"
5715 # fixup the dll searchpath if we need to.
5717 # Fix the DLL searchpath if we need to. Do this before prepending
5718 # to shlibpath, because on Windows, both are PATH and uninstalled
5719 # libraries must come first.
5720 if test -n "$dllsearchpath"; then
5722 # Add the dll search path components to the executable PATH
5723 PATH=$dllsearchpath:\$PATH
5727 # Export our shlibpath_var if we have one.
5728 if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5730 # Add our own library path to $shlibpath_var
5731 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5733 # Some systems cannot cope with colon-terminated $shlibpath_var
5734 # The second colon is a workaround for a bug in BeOS R4 sed
5735 $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
5737 export $shlibpath_var
5742 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5743 # Run the actual program with our arguments.
5744 func_exec_program \${1+\"\$@\"}
5747 # The program doesn't exist.
5748 \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2
5749 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
5750 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
5758 # func_emit_cwrapperexe_src
5759 # emit the source code for a wrapper executable on stdout
5760 # Must ONLY be called from within func_mode_link because
5761 # it depends on a number of variable set therein.
5762 func_emit_cwrapperexe_src ()
5766 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
5767 Generated by $PROGRAM (GNU $PACKAGE) $VERSION
5769 The $output program cannot be directly executed until all the libtool
5770 libraries that it depends on are installed.
5772 This wrapper executable should never be moved out of the build directory.
5773 If it is, it will not operate correctly.
5778 # define _CRT_SECURE_NO_DEPRECATE 1
5783 # include <direct.h>
5784 # include <process.h>
5787 # include <unistd.h>
5788 # include <stdint.h>
5800 #include <sys/stat.h>
5802 #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
5804 /* declarations of non-ANSI functions */
5805 #if defined __MINGW32__
5806 # ifdef __STRICT_ANSI__
5807 int _putenv (const char *);
5809 #elif defined __CYGWIN__
5810 # ifdef __STRICT_ANSI__
5811 char *realpath (const char *, char *);
5812 int putenv (char *);
5813 int setenv (const char *, const char *, int);
5815 /* #elif defined other_platform || defined ... */
5818 /* portability defines, excluding path handling macros */
5819 #if defined _MSC_VER
5820 # define setmode _setmode
5822 # define chmod _chmod
5823 # define getcwd _getcwd
5824 # define putenv _putenv
5825 # define S_IXUSR _S_IEXEC
5826 #elif defined __MINGW32__
5827 # define setmode _setmode
5829 # define chmod _chmod
5830 # define getcwd _getcwd
5831 # define putenv _putenv
5832 #elif defined __CYGWIN__
5833 # define HAVE_SETENV
5834 # define FOPEN_WB "wb"
5835 /* #elif defined other platforms ... */
5838 #if defined PATH_MAX
5839 # define LT_PATHMAX PATH_MAX
5840 #elif defined MAXPATHLEN
5841 # define LT_PATHMAX MAXPATHLEN
5843 # define LT_PATHMAX 1024
5853 /* path handling portability macros */
5854 #ifndef DIR_SEPARATOR
5855 # define DIR_SEPARATOR '/'
5856 # define PATH_SEPARATOR ':'
5859 #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
5861 # define HAVE_DOS_BASED_FILE_SYSTEM
5862 # define FOPEN_WB "wb"
5863 # ifndef DIR_SEPARATOR_2
5864 # define DIR_SEPARATOR_2 '\\'
5866 # ifndef PATH_SEPARATOR_2
5867 # define PATH_SEPARATOR_2 ';'
5871 #ifndef DIR_SEPARATOR_2
5872 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
5873 #else /* DIR_SEPARATOR_2 */
5874 # define IS_DIR_SEPARATOR(ch) \
5875 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
5876 #endif /* DIR_SEPARATOR_2 */
5878 #ifndef PATH_SEPARATOR_2
5879 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
5880 #else /* PATH_SEPARATOR_2 */
5881 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
5882 #endif /* PATH_SEPARATOR_2 */
5885 # define FOPEN_WB "w"
5888 # define _O_BINARY 0
5891 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
5892 #define XFREE(stale) do { \
5893 if (stale) { free (stale); stale = 0; } \
5896 #if defined LT_DEBUGWRAPPER
5897 static int lt_debug = 1;
5899 static int lt_debug = 0;
5902 const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
5904 void *xmalloc (size_t num);
5905 char *xstrdup (const char *string);
5906 const char *base_name (const char *name);
5907 char *find_executable (const char *wrapper);
5908 char *chase_symlinks (const char *pathspec);
5909 int make_executable (const char *path);
5910 int check_executable (const char *path);
5911 char *strendzap (char *str, const char *pat);
5912 void lt_debugprintf (const char *file, int line, const char *fmt, ...);
5913 void lt_fatal (const char *file, int line, const char *message, ...);
5914 static const char *nonnull (const char *s);
5915 static const char *nonempty (const char *s);
5916 void lt_setenv (const char *name, const char *value);
5917 char *lt_extend_str (const char *orig_value, const char *add, int to_end);
5918 void lt_update_exe_path (const char *name, const char *value);
5919 void lt_update_lib_path (const char *name, const char *value);
5920 char **prepare_spawn (char **argv);
5921 void lt_dump_script (FILE *f);
5925 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
5926 # define externally_visible volatile
5928 # define externally_visible __attribute__((externally_visible)) volatile
5930 externally_visible const char * MAGIC_EXE = "$magic_exe";
5931 const char * LIB_PATH_VARNAME = "$shlibpath_var";
5934 if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5935 func_to_host_path "$temp_rpath"
5937 const char * LIB_PATH_VALUE = "$func_to_host_path_result";
5941 const char * LIB_PATH_VALUE = "";
5945 if test -n "$dllsearchpath"; then
5946 func_to_host_path "$dllsearchpath:"
5948 const char * EXE_PATH_VARNAME = "PATH";
5949 const char * EXE_PATH_VALUE = "$func_to_host_path_result";
5953 const char * EXE_PATH_VARNAME = "";
5954 const char * EXE_PATH_VALUE = "";
5958 if test yes = "$fast_install"; then
5960 const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
5964 const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
5971 #define LTWRAPPER_OPTION_PREFIX "--lt-"
5973 static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
5974 static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
5975 static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
5978 main (int argc, char *argv[])
5983 char *actual_cwrapper_path;
5984 char *actual_cwrapper_name;
5991 program_name = (char *) xstrdup (base_name (argv[0]));
5992 newargz = XMALLOC (char *, (size_t) argc + 1);
5994 /* very simple arg parsing; don't want to rely on getopt
5995 * also, copy all non cwrapper options to newargz, except
5996 * argz[0], which is handled differently
5999 for (i = 1; i < argc; i++)
6001 if (STREQ (argv[i], dumpscript_opt))
6005 *mingw* | *cygwin* )
6006 # make stdout use "unix" line endings
6007 echo " setmode(1,_O_BINARY);"
6012 lt_dump_script (stdout);
6015 if (STREQ (argv[i], debug_opt))
6020 if (STREQ (argv[i], ltwrapper_option_prefix))
6022 /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
6023 namespace, but it is not one of the ones we know about and
6024 have already dealt with, above (inluding dump-script), then
6025 report an error. Otherwise, targets might begin to believe
6026 they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
6027 namespace. The first time any user complains about this, we'll
6028 need to make LTWRAPPER_OPTION_PREFIX a configure-time option
6029 or a configure.ac-settable value.
6031 lt_fatal (__FILE__, __LINE__,
6032 "unrecognized %s option: '%s'",
6033 ltwrapper_option_prefix, argv[i]);
6036 newargz[++newargc] = xstrdup (argv[i]);
6038 newargz[++newargc] = NULL;
6042 /* The GNU banner must be the first non-error debug message */
6043 lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
6046 lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
6047 lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
6049 tmp_pathspec = find_executable (argv[0]);
6050 if (tmp_pathspec == NULL)
6051 lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
6052 lt_debugprintf (__FILE__, __LINE__,
6053 "(main) found exe (before symlink chase) at: %s\n",
6056 actual_cwrapper_path = chase_symlinks (tmp_pathspec);
6057 lt_debugprintf (__FILE__, __LINE__,
6058 "(main) found exe (after symlink chase) at: %s\n",
6059 actual_cwrapper_path);
6060 XFREE (tmp_pathspec);
6062 actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
6063 strendzap (actual_cwrapper_path, actual_cwrapper_name);
6065 /* wrapper name transforms */
6066 strendzap (actual_cwrapper_name, ".exe");
6067 tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
6068 XFREE (actual_cwrapper_name);
6069 actual_cwrapper_name = tmp_pathspec;
6072 /* target_name transforms -- use actual target program name; might have lt- prefix */
6073 target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
6074 strendzap (target_name, ".exe");
6075 tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
6076 XFREE (target_name);
6077 target_name = tmp_pathspec;
6080 lt_debugprintf (__FILE__, __LINE__,
6081 "(main) libtool target name: %s\n",
6087 XMALLOC (char, (strlen (actual_cwrapper_path) +
6088 strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
6089 strcpy (newargz[0], actual_cwrapper_path);
6090 strcat (newargz[0], "$objdir");
6091 strcat (newargz[0], "/");
6095 /* stop here, and copy so we don't have to do this twice */
6096 tmp_pathspec = xstrdup (newargz[0]);
6098 /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
6099 strcat (newargz[0], actual_cwrapper_name);
6101 /* DO want the lt- prefix here if it exists, so use target_name */
6102 lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
6103 XFREE (tmp_pathspec);
6104 tmp_pathspec = NULL;
6112 while ((p = strchr (newargz[0], '\\')) != NULL)
6116 while ((p = strchr (lt_argv_zero, '\\')) != NULL)
6126 XFREE (target_name);
6127 XFREE (actual_cwrapper_path);
6128 XFREE (actual_cwrapper_name);
6130 lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
6131 lt_setenv ("DUALCASE", "1"); /* for MSK sh */
6132 /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
6133 be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
6134 because on Windows, both *_VARNAMEs are PATH but uninstalled
6135 libraries must come first. */
6136 lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
6137 lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
6139 lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
6140 nonnull (lt_argv_zero));
6141 for (i = 0; i < newargc; i++)
6143 lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
6144 i, nonnull (newargz[i]));
6152 /* execv doesn't actually work on mingw as expected on unix */
6153 newargz = prepare_spawn (newargz);
6154 rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
6157 /* failed to start process */
6158 lt_debugprintf (__FILE__, __LINE__,
6159 "(main) failed to launch target \"%s\": %s\n",
6160 lt_argv_zero, nonnull (strerror (errno)));
6168 execv (lt_argv_zero, newargz);
6169 return rval; /* =127, but avoids unused variable warning */
6178 xmalloc (size_t num)
6180 void *p = (void *) malloc (num);
6182 lt_fatal (__FILE__, __LINE__, "memory exhausted");
6188 xstrdup (const char *string)
6190 return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
6195 base_name (const char *name)
6199 #if defined HAVE_DOS_BASED_FILE_SYSTEM
6200 /* Skip over the disk name in MSDOS pathnames. */
6201 if (isalpha ((unsigned char) name[0]) && name[1] == ':')
6205 for (base = name; *name; name++)
6206 if (IS_DIR_SEPARATOR (*name))
6212 check_executable (const char *path)
6216 lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
6218 if ((!path) || (!*path))
6221 if ((stat (path, &st) >= 0)
6222 && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
6229 make_executable (const char *path)
6234 lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
6236 if ((!path) || (!*path))
6239 if (stat (path, &st) >= 0)
6241 rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
6246 /* Searches for the full path of the wrapper. Returns
6247 newly allocated full path name if found, NULL otherwise
6248 Does not chase symlinks, even on platforms that support them.
6251 find_executable (const char *wrapper)
6256 /* static buffer for getcwd */
6257 char tmp[LT_PATHMAX + 1];
6261 lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
6262 nonempty (wrapper));
6264 if ((wrapper == NULL) || (*wrapper == '\0'))
6267 /* Absolute path? */
6268 #if defined HAVE_DOS_BASED_FILE_SYSTEM
6269 if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
6271 concat_name = xstrdup (wrapper);
6272 if (check_executable (concat_name))
6274 XFREE (concat_name);
6279 if (IS_DIR_SEPARATOR (wrapper[0]))
6281 concat_name = xstrdup (wrapper);
6282 if (check_executable (concat_name))
6284 XFREE (concat_name);
6286 #if defined HAVE_DOS_BASED_FILE_SYSTEM
6290 for (p = wrapper; *p; p++)
6298 /* no slashes; search PATH */
6299 const char *path = getenv ("PATH");
6302 for (p = path; *p; p = p_next)
6306 for (q = p; *q; q++)
6307 if (IS_PATH_SEPARATOR (*q))
6309 p_len = (size_t) (q - p);
6310 p_next = (*q == '\0' ? q : q + 1);
6313 /* empty path: current directory */
6314 if (getcwd (tmp, LT_PATHMAX) == NULL)
6315 lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
6316 nonnull (strerror (errno)));
6317 tmp_len = strlen (tmp);
6319 XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
6320 memcpy (concat_name, tmp, tmp_len);
6321 concat_name[tmp_len] = '/';
6322 strcpy (concat_name + tmp_len + 1, wrapper);
6327 XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
6328 memcpy (concat_name, p, p_len);
6329 concat_name[p_len] = '/';
6330 strcpy (concat_name + p_len + 1, wrapper);
6332 if (check_executable (concat_name))
6334 XFREE (concat_name);
6337 /* not found in PATH; assume curdir */
6339 /* Relative path | not found in path: prepend cwd */
6340 if (getcwd (tmp, LT_PATHMAX) == NULL)
6341 lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
6342 nonnull (strerror (errno)));
6343 tmp_len = strlen (tmp);
6344 concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
6345 memcpy (concat_name, tmp, tmp_len);
6346 concat_name[tmp_len] = '/';
6347 strcpy (concat_name + tmp_len + 1, wrapper);
6349 if (check_executable (concat_name))
6351 XFREE (concat_name);
6356 chase_symlinks (const char *pathspec)
6359 return xstrdup (pathspec);
6361 char buf[LT_PATHMAX];
6363 char *tmp_pathspec = xstrdup (pathspec);
6365 int has_symlinks = 0;
6366 while (strlen (tmp_pathspec) && !has_symlinks)
6368 lt_debugprintf (__FILE__, __LINE__,
6369 "checking path component for symlinks: %s\n",
6371 if (lstat (tmp_pathspec, &s) == 0)
6373 if (S_ISLNK (s.st_mode) != 0)
6379 /* search backwards for last DIR_SEPARATOR */
6380 p = tmp_pathspec + strlen (tmp_pathspec) - 1;
6381 while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
6383 if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
6385 /* no more DIR_SEPARATORS left */
6392 lt_fatal (__FILE__, __LINE__,
6393 "error accessing file \"%s\": %s",
6394 tmp_pathspec, nonnull (strerror (errno)));
6397 XFREE (tmp_pathspec);
6401 return xstrdup (pathspec);
6404 tmp_pathspec = realpath (pathspec, buf);
6405 if (tmp_pathspec == 0)
6407 lt_fatal (__FILE__, __LINE__,
6408 "could not follow symlinks for %s", pathspec);
6410 return xstrdup (tmp_pathspec);
6415 strendzap (char *str, const char *pat)
6419 assert (str != NULL);
6420 assert (pat != NULL);
6423 patlen = strlen (pat);
6427 str += len - patlen;
6428 if (STREQ (str, pat))
6435 lt_debugprintf (const char *file, int line, const char *fmt, ...)
6440 (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
6441 va_start (args, fmt);
6442 (void) vfprintf (stderr, fmt, args);
6448 lt_error_core (int exit_status, const char *file,
6449 int line, const char *mode,
6450 const char *message, va_list ap)
6452 fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
6453 vfprintf (stderr, message, ap);
6454 fprintf (stderr, ".\n");
6456 if (exit_status >= 0)
6461 lt_fatal (const char *file, int line, const char *message, ...)
6464 va_start (ap, message);
6465 lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
6470 nonnull (const char *s)
6472 return s ? s : "(null)";
6476 nonempty (const char *s)
6478 return (s && !*s) ? "(empty)" : nonnull (s);
6482 lt_setenv (const char *name, const char *value)
6484 lt_debugprintf (__FILE__, __LINE__,
6485 "(lt_setenv) setting '%s' to '%s'\n",
6486 nonnull (name), nonnull (value));
6489 /* always make a copy, for consistency with !HAVE_SETENV */
6490 char *str = xstrdup (value);
6491 setenv (name, str, 1);
6493 size_t len = strlen (name) + 1 + strlen (value) + 1;
6494 char *str = XMALLOC (char, len);
6495 sprintf (str, "%s=%s", name, value);
6496 if (putenv (str) != EXIT_SUCCESS)
6505 lt_extend_str (const char *orig_value, const char *add, int to_end)
6508 if (orig_value && *orig_value)
6510 size_t orig_value_len = strlen (orig_value);
6511 size_t add_len = strlen (add);
6512 new_value = XMALLOC (char, add_len + orig_value_len + 1);
6515 strcpy (new_value, orig_value);
6516 strcpy (new_value + orig_value_len, add);
6520 strcpy (new_value, add);
6521 strcpy (new_value + add_len, orig_value);
6526 new_value = xstrdup (add);
6532 lt_update_exe_path (const char *name, const char *value)
6534 lt_debugprintf (__FILE__, __LINE__,
6535 "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
6536 nonnull (name), nonnull (value));
6538 if (name && *name && value && *value)
6540 char *new_value = lt_extend_str (getenv (name), value, 0);
6541 /* some systems can't cope with a ':'-terminated path #' */
6542 size_t len = strlen (new_value);
6543 while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
6545 new_value[--len] = '\0';
6547 lt_setenv (name, new_value);
6553 lt_update_lib_path (const char *name, const char *value)
6555 lt_debugprintf (__FILE__, __LINE__,
6556 "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
6557 nonnull (name), nonnull (value));
6559 if (name && *name && value && *value)
6561 char *new_value = lt_extend_str (getenv (name), value, 0);
6562 lt_setenv (name, new_value);
6572 /* Prepares an argument vector before calling spawn().
6573 Note that spawn() does not by itself call the command interpreter
6574 (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
6575 ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
6577 v.dwPlatformId == VER_PLATFORM_WIN32_NT;
6578 }) ? "cmd.exe" : "command.com").
6579 Instead it simply concatenates the arguments, separated by ' ', and calls
6580 CreateProcess(). We must quote the arguments since Win32 CreateProcess()
6581 interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
6583 - Space and tab are interpreted as delimiters. They are not treated as
6584 delimiters if they are surrounded by double quotes: "...".
6585 - Unescaped double quotes are removed from the input. Their only effect is
6586 that within double quotes, space and tab are treated like normal
6588 - Backslashes not followed by double quotes are not special.
6589 - But 2*n+1 backslashes followed by a double quote become
6590 n backslashes followed by a double quote (n >= 0):
6595 #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"
6596 #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"
6598 prepare_spawn (char **argv)
6604 /* Count number of arguments. */
6605 for (argc = 0; argv[argc] != NULL; argc++)
6608 /* Allocate new argument vector. */
6609 new_argv = XMALLOC (char *, argc + 1);
6611 /* Put quoted arguments into the new argument vector. */
6612 for (i = 0; i < argc; i++)
6614 const char *string = argv[i];
6616 if (string[0] == '\0')
6617 new_argv[i] = xstrdup ("\"\"");
6618 else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
6620 int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
6622 unsigned int backslashes;
6624 char *quoted_string;
6631 for (s = string; *s != '\0'; s++)
6635 length += backslashes + 1;
6643 length += backslashes + 1;
6645 quoted_string = XMALLOC (char, length + 1);
6651 for (s = string; *s != '\0'; s++)
6657 for (j = backslashes + 1; j > 0; j--)
6669 for (j = backslashes; j > 0; j--)
6675 new_argv[i] = quoted_string;
6678 new_argv[i] = (char *) string;
6680 new_argv[argc] = NULL;
6689 void lt_dump_script (FILE* f)
6692 func_emit_wrapper yes |
6694 s/^\(.\{79\}\)\(..*\)/\1\
6699 s/\([^\n]*\).*/ fputs ("\1", f);/p
6706 # end: func_emit_cwrapperexe_src
6708 # func_win32_import_lib_p ARG
6709 # True if ARG is an import lib, as indicated by $file_magic_cmd
6710 func_win32_import_lib_p ()
6714 case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
6720 # func_suncc_cstd_abi
6721 # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!
6722 # Several compiler flags select an ABI that is incompatible with the
6723 # Cstd library. Avoid specifying it if any are in CXXFLAGS.
6724 func_suncc_cstd_abi ()
6728 case " $compile_command " in
6729 *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)
6730 suncc_use_cstd_abi=no
6733 suncc_use_cstd_abi=yes
6738 # func_mode_link arg...
6744 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
6745 # It is impossible to link a dll without this setting, and
6746 # we shouldn't force the makefile maintainer to figure out
6747 # what system we are compiling for in order to pass an extra
6748 # flag for every libtool invocation.
6749 # allow_undefined=no
6751 # FIXME: Unfortunately, there are problems with the above when trying
6752 # to make a dll that has undefined symbols, in which case not
6753 # even a static library is built. For now, we need to specify
6754 # -no-undefined on the libtool link line when we can be certain
6755 # that all symbols are satisfied, otherwise we get a static library.
6762 libtool_args=$nonopt
6763 base_compile="$nonopt $@"
6764 compile_command=$nonopt
6765 finalize_command=$nonopt
6778 lib_search_path=`pwd`
6780 new_inherited_linker_flags=
6789 export_symbols_regex=
6798 precious_files_regex=
6799 prefer_static_libs=no
6812 single_module=$wl-single_module
6813 func_infer_tag $base_compile
6815 # We need to know -static, to get the right output filenames.
6820 test yes != "$build_libtool_libs" \
6821 && func_fatal_configuration "cannot build a shared library"
6825 -all-static | -static | -static-libtool-libs)
6828 if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
6829 func_warning "complete static linking is impossible in this configuration"
6831 if test -n "$link_static_flag"; then
6832 dlopen_self=$dlopen_self_static
6834 prefer_static_libs=yes
6837 if test -z "$pic_flag" && test -n "$link_static_flag"; then
6838 dlopen_self=$dlopen_self_static
6840 prefer_static_libs=built
6842 -static-libtool-libs)
6843 if test -z "$pic_flag" && test -n "$link_static_flag"; then
6844 dlopen_self=$dlopen_self_static
6846 prefer_static_libs=yes
6849 build_libtool_libs=no
6856 # See if our shared archives depend on static archives.
6857 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
6859 # Go through the arguments, transforming them on the way.
6860 while test "$#" -gt 0; do
6863 func_quote_arg pretty,unquoted "$arg"
6864 qarg=$func_quote_arg_unquoted_result
6865 func_append libtool_args " $func_quote_arg_result"
6867 # If the previous option needs an argument, assign it.
6868 if test -n "$prev"; then
6871 func_append compile_command " @OUTPUT@"
6872 func_append finalize_command " @OUTPUT@"
6884 # Add the symbol object into the linking commands.
6885 func_append compile_command " @SYMFILE@"
6886 func_append finalize_command " @SYMFILE@"
6890 *.la | *.lo) ;; # We handle these cases below.
6892 if test no = "$dlself"; then
6900 if test dlprefiles = "$prev"; then
6902 elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
6912 if test dlfiles = "$prev"; then
6913 func_append dlfiles " $arg"
6915 func_append dlprefiles " $arg"
6925 || func_fatal_error "symbol file '$arg' does not exist"
6930 export_symbols_regex=$arg
6938 *" $qarg.ltframework "*) ;;
6939 *) func_append deplibs " $qarg.ltframework" # this is fixed later
6948 inst_prefix_dir=$arg
6953 # Clang does not use LLVM to link, so we can simply discard any
6954 # '-mllvm $arg' options when doing the link step.
6959 if test -f "$arg"; then
6962 for fil in `cat "$save_arg"`
6964 # func_append moreargs " $fil"
6966 # A libtool-controlled object.
6968 # Check to see that this really is a libtool object.
6969 if func_lalib_unsafe_p "$arg"; then
6976 if test -z "$pic_object" ||
6977 test -z "$non_pic_object" ||
6978 test none = "$pic_object" &&
6979 test none = "$non_pic_object"; then
6980 func_fatal_error "cannot find name of object for '$arg'"
6983 # Extract subdirectory from the argument.
6984 func_dirname "$arg" "/" ""
6985 xdir=$func_dirname_result
6987 if test none != "$pic_object"; then
6988 # Prepend the subdirectory the object is found in.
6989 pic_object=$xdir$pic_object
6991 if test dlfiles = "$prev"; then
6992 if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
6993 func_append dlfiles " $pic_object"
6997 # If libtool objects are unsupported, then we need to preload.
7002 # CHECK ME: I think I busted this. -Ossama
7003 if test dlprefiles = "$prev"; then
7004 # Preload the old-style object.
7005 func_append dlprefiles " $pic_object"
7010 func_append libobjs " $pic_object"
7015 if test none != "$non_pic_object"; then
7016 # Prepend the subdirectory the object is found in.
7017 non_pic_object=$xdir$non_pic_object
7019 # A standard non-PIC object
7020 func_append non_pic_objects " $non_pic_object"
7021 if test -z "$pic_object" || test none = "$pic_object"; then
7025 # If the PIC object exists, use it instead.
7026 # $xdir was prepended to $pic_object above.
7027 non_pic_object=$pic_object
7028 func_append non_pic_objects " $non_pic_object"
7031 # Only an error if not doing a dry-run.
7032 if $opt_dry_run; then
7033 # Extract subdirectory from the argument.
7034 func_dirname "$arg" "/" ""
7035 xdir=$func_dirname_result
7038 pic_object=$xdir$objdir/$func_lo2o_result
7039 non_pic_object=$xdir$func_lo2o_result
7040 func_append libobjs " $pic_object"
7041 func_append non_pic_objects " $non_pic_object"
7043 func_fatal_error "'$arg' is not a valid libtool object"
7048 func_fatal_error "link input file '$arg' does not exist"
7060 precious_files_regex=$arg
7070 # We need an absolute path.
7072 [\\/]* | [A-Za-z]:[\\/]*) ;;
7074 func_fatal_error "only absolute run-paths are allowed"
7077 if test rpath = "$prev"; then
7080 *) func_append rpath " $arg" ;;
7085 *) func_append xrpath " $arg" ;;
7097 func_append weak_libs " $arg"
7102 func_append compiler_flags " -Xassembler $qarg"
7104 func_append compile_command " -Xassembler $qarg"
7105 func_append finalize_command " -Xassembler $qarg"
7109 func_append linker_flags " $qarg"
7110 func_append compiler_flags " $qarg"
7112 func_append compile_command " $qarg"
7113 func_append finalize_command " $qarg"
7117 func_append compiler_flags " $qarg"
7119 func_append compile_command " $qarg"
7120 func_append finalize_command " $qarg"
7124 func_append linker_flags " $qarg"
7125 func_append compiler_flags " $wl$qarg"
7127 func_append compile_command " $wl$qarg"
7128 func_append finalize_command " $wl$qarg"
7132 eval "$prev=\"\$arg\""
7137 fi # test -n "$prev"
7143 if test -n "$link_static_flag"; then
7144 # See comment for -static flag below, for more details.
7145 func_append compile_command " $link_static_flag"
7146 func_append finalize_command " $link_static_flag"
7152 # FIXME: remove this flag sometime in the future.
7153 func_fatal_error "'-allow-undefined' must not be used because it is the default"
7181 -export-symbols | -export-symbols-regex)
7182 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
7183 func_fatal_error "more than one -exported-symbols argument is not allowed"
7185 if test X-export-symbols = "X$arg"; then
7203 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
7204 # so, if we see these flags be careful not to treat them like -L
7206 case $with_gcc/$host in
7207 no/*-*-irix* | /*-*-irix*)
7208 func_append compile_command " $arg"
7209 func_append finalize_command " $arg"
7216 func_stripname "-L" '' "$arg"
7217 if test -z "$func_stripname_result"; then
7218 if test "$#" -gt 0; then
7219 func_fatal_error "require no space between '-L' and '$1'"
7221 func_fatal_error "need path for '-L' option"
7224 func_resolve_sysroot "$func_stripname_result"
7225 dir=$func_resolve_sysroot_result
7226 # We need an absolute path.
7228 [\\/]* | [A-Za-z]:[\\/]*) ;;
7230 absdir=`cd "$dir" && pwd`
7231 test -z "$absdir" && \
7232 func_fatal_error "cannot determine absolute directory name of '$dir'"
7237 *" -L$dir "* | *" $arg "*)
7238 # Will only happen for absolute or sysroot arguments
7241 # Preserve sysroot, but never include relative directories
7243 [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
7244 *) func_append deplibs " -L$dir" ;;
7246 func_append lib_search_path " $dir"
7250 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
7251 testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
7252 case :$dllsearchpath: in
7254 ::) dllsearchpath=$dir;;
7255 *) func_append dllsearchpath ":$dir";;
7257 case :$dllsearchpath: in
7258 *":$testbindir:"*) ;;
7259 ::) dllsearchpath=$testbindir;;
7260 *) func_append dllsearchpath ":$testbindir";;
7268 if test X-lc = "X$arg" || test X-lm = "X$arg"; then
7270 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
7271 # These systems don't actually have a C or math library (as such)
7275 # These systems don't actually have a C library (as such)
7276 test X-lc = "X$arg" && continue
7278 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*)
7279 # Do not include libc due to us having libc/libc_r.
7280 test X-lc = "X$arg" && continue
7282 *-*-rhapsody* | *-*-darwin1.[012])
7283 # Rhapsody C and math libraries are in the System framework
7284 func_append deplibs " System.ltframework"
7287 *-*-sco3.2v5* | *-*-sco5v6*)
7288 # Causes problems with __ctype
7289 test X-lc = "X$arg" && continue
7291 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
7292 # Compiler inserts libc in the correct place for threads to work
7293 test X-lc = "X$arg" && continue
7296 elif test X-lc_r = "X$arg"; then
7298 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*)
7299 # Do not include libc_r directly, use -pthread flag.
7304 func_append deplibs " $arg"
7318 # Tru64 UNIX uses -model [arg] to determine the layout of C++
7319 # classes, name mangling, and exception handling.
7320 # Darwin uses the -arch flag to determine output architecture.
7321 -model|-arch|-isysroot|--sysroot)
7322 func_append compiler_flags " $arg"
7323 func_append compile_command " $arg"
7324 func_append finalize_command " $arg"
7328 # Solaris ld rejects as of 11.4. Refer to Oracle bug 22985199.
7333 case "$new_inherited_linker_flags " in
7335 * ) func_append new_inherited_linker_flags " $arg" ;;
7341 -mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe \
7342 |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
7343 func_append compiler_flags " $arg"
7344 func_append compile_command " $arg"
7345 func_append finalize_command " $arg"
7346 case "$new_inherited_linker_flags " in
7348 * ) func_append new_inherited_linker_flags " $arg" ;;
7354 single_module=$wl-multi_module
7365 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
7366 # The PATH hackery in wrapper scripts is required on Windows
7367 # and Darwin in order for the loader to find any dlls it needs.
7368 func_warning "'-no-install' is ignored for $host"
7369 func_warning "assuming '-no-fast-install' instead"
7372 *) no_install=yes ;;
7394 -precious-files-regex)
7415 func_stripname '-R' '' "$arg"
7416 dir=$func_stripname_result
7417 # We need an absolute path.
7419 [\\/]* | [A-Za-z]:[\\/]*) ;;
7421 func_stripname '=' '' "$dir"
7422 dir=$lt_sysroot$func_stripname_result
7425 func_fatal_error "only absolute run-paths are allowed"
7430 *) func_append xrpath " $dir" ;;
7436 # The effects of -shared are defined in a previous loop.
7445 -static | -static-libtool-libs)
7446 # The effects of -static are defined in a previous loop.
7447 # We used to do the same as -all-static on platforms that
7448 # didn't have a PIC flag, but the assumption that the effects
7449 # would be equivalent was wrong. It would break on at least
7450 # Digital Unix and AIX.
7476 func_stripname '-Wc,' '' "$arg"
7477 args=$func_stripname_result
7479 save_ifs=$IFS; IFS=,
7480 for flag in $args; do
7482 func_quote_arg pretty "$flag"
7483 func_append arg " $func_quote_arg_result"
7484 func_append compiler_flags " $func_quote_arg_result"
7487 func_stripname ' ' '' "$arg"
7488 arg=$func_stripname_result
7492 func_stripname '-Wl,' '' "$arg"
7493 args=$func_stripname_result
7495 save_ifs=$IFS; IFS=,
7496 for flag in $args; do
7498 func_quote_arg pretty "$flag"
7499 func_append arg " $wl$func_quote_arg_result"
7500 func_append compiler_flags " $wl$func_quote_arg_result"
7501 func_append linker_flags " $func_quote_arg_result"
7504 func_stripname ' ' '' "$arg"
7505 arg=$func_stripname_result
7530 func_quote_arg pretty "$arg"
7531 arg=$func_quote_arg_result
7534 # Flags to be passed through unchanged, with rationale:
7535 # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
7536 # -r[0-9][0-9]* specify processor for the SGI compiler
7537 # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
7538 # +DA*, +DD* enable 64-bit mode for the HP compiler
7539 # -q* compiler args for the IBM compiler
7540 # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
7541 # -F/path path to uninstalled frameworks, gcc on darwin
7542 # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
7543 # -fstack-protector* stack protector flags for GCC
7544 # @file GCC response files
7545 # -tp=* Portland pgcc target processor selection
7546 # --sysroot=* for sysroot support
7547 # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
7548 # -specs=* GCC specs files
7549 # -stdlib=* select c++ std lib with clang
7550 # -fsanitize=* Clang/GCC memory and address sanitizer
7551 # -fuse-ld=* Linker select flags for GCC
7552 # -static-* direct GCC to link specific libraries statically
7553 # -fcilkplus Cilk Plus language extension features for C/C++
7554 # -Wa,* Pass flags directly to the assembler
7555 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
7556 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
7557 -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
7558 -specs=*|-fsanitize=*|-fuse-ld=*|-static-*|-fcilkplus|-Wa,*)
7559 func_quote_arg pretty "$arg"
7560 arg=$func_quote_arg_result
7561 func_append compile_command " $arg"
7562 func_append finalize_command " $arg"
7563 func_append compiler_flags " $arg"
7568 if test os2 = "`expr $host : '.*\(os2\)'`"; then
7569 # OS/2 uses -Zxxx to specify OS/2-specific options
7570 compiler_flags="$compiler_flags $arg"
7571 func_append compile_command " $arg"
7572 func_append finalize_command " $arg"
7580 # Otherwise treat like 'Some other compiler flag' below
7581 func_quote_arg pretty "$arg"
7582 arg=$func_quote_arg_result
7586 # Some other compiler flag.
7588 func_quote_arg pretty "$arg"
7589 arg=$func_quote_arg_result
7593 # A standard object.
7594 func_append objs " $arg"
7598 # A libtool-controlled object.
7600 # Check to see that this really is a libtool object.
7601 if func_lalib_unsafe_p "$arg"; then
7608 if test -z "$pic_object" ||
7609 test -z "$non_pic_object" ||
7610 test none = "$pic_object" &&
7611 test none = "$non_pic_object"; then
7612 func_fatal_error "cannot find name of object for '$arg'"
7615 # Extract subdirectory from the argument.
7616 func_dirname "$arg" "/" ""
7617 xdir=$func_dirname_result
7619 test none = "$pic_object" || {
7620 # Prepend the subdirectory the object is found in.
7621 pic_object=$xdir$pic_object
7623 if test dlfiles = "$prev"; then
7624 if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
7625 func_append dlfiles " $pic_object"
7629 # If libtool objects are unsupported, then we need to preload.
7634 # CHECK ME: I think I busted this. -Ossama
7635 if test dlprefiles = "$prev"; then
7636 # Preload the old-style object.
7637 func_append dlprefiles " $pic_object"
7642 func_append libobjs " $pic_object"
7647 if test none != "$non_pic_object"; then
7648 # Prepend the subdirectory the object is found in.
7649 non_pic_object=$xdir$non_pic_object
7651 # A standard non-PIC object
7652 func_append non_pic_objects " $non_pic_object"
7653 if test -z "$pic_object" || test none = "$pic_object"; then
7657 # If the PIC object exists, use it instead.
7658 # $xdir was prepended to $pic_object above.
7659 non_pic_object=$pic_object
7660 func_append non_pic_objects " $non_pic_object"
7663 # Only an error if not doing a dry-run.
7664 if $opt_dry_run; then
7665 # Extract subdirectory from the argument.
7666 func_dirname "$arg" "/" ""
7667 xdir=$func_dirname_result
7670 pic_object=$xdir$objdir/$func_lo2o_result
7671 non_pic_object=$xdir$func_lo2o_result
7672 func_append libobjs " $pic_object"
7673 func_append non_pic_objects " $non_pic_object"
7675 func_fatal_error "'$arg' is not a valid libtool object"
7682 func_append deplibs " $arg"
7683 func_append old_deplibs " $arg"
7688 # A libtool-controlled library.
7690 func_resolve_sysroot "$arg"
7691 if test dlfiles = "$prev"; then
7692 # This library was specified with -dlopen.
7693 func_append dlfiles " $func_resolve_sysroot_result"
7695 elif test dlprefiles = "$prev"; then
7696 # The library was specified with -dlpreopen.
7697 func_append dlprefiles " $func_resolve_sysroot_result"
7700 func_append deplibs " $func_resolve_sysroot_result"
7705 # Some other compiler argument.
7707 # Unknown arguments in both finalize_command and compile_command need
7708 # to be aesthetically quoted because they are evaled later.
7709 func_quote_arg pretty "$arg"
7710 arg=$func_quote_arg_result
7714 # Now actually substitute the argument into the commands.
7715 if test -n "$arg"; then
7716 func_append compile_command " $arg"
7717 func_append finalize_command " $arg"
7719 done # argument parsing loop
7721 test -n "$prev" && \
7722 func_fatal_help "the '$prevarg' option requires an argument"
7724 if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
7725 eval arg=\"$export_dynamic_flag_spec\"
7726 func_append compile_command " $arg"
7727 func_append finalize_command " $arg"
7731 # calculate the name of the file, without its directory
7732 func_basename "$output"
7733 outputname=$func_basename_result
7734 libobjs_save=$libobjs
7736 if test -n "$shlibpath_var"; then
7737 # get the directories listed in $shlibpath_var
7738 eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`
7742 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
7743 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
7745 # Definition is injected by LT_CONFIG during libtool generation.
7746 func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
7748 func_dirname "$output" "/" ""
7749 output_objdir=$func_dirname_result$objdir
7750 func_to_tool_file "$output_objdir/"
7751 tool_output_objdir=$func_to_tool_file_result
7752 # Create the object directory.
7753 func_mkdir_p "$output_objdir"
7755 # Determine the type of output
7758 func_fatal_help "you must specify an output file"
7760 *.$libext) linkmode=oldlib ;;
7761 *.lo | *.$objext) linkmode=obj ;;
7762 *.la) linkmode=lib ;;
7763 *) linkmode=prog ;; # Anything else should be a program.
7769 # Find all interdependent deplibs by searching for libraries
7770 # that are linked more than once (e.g. -la -lb -la)
7771 for deplib in $deplibs; do
7772 if $opt_preserve_dup_deps; then
7774 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
7777 func_append libs " $deplib"
7780 if test lib = "$linkmode"; then
7781 libs="$predeps $libs $compiler_lib_search_path $postdeps"
7783 # Compute libraries that are listed more than once in $predeps
7784 # $postdeps and mark them as special (i.e., whose duplicates are
7785 # not to be eliminated).
7787 if $opt_duplicate_compiler_generated_deps; then
7788 for pre_post_dep in $predeps $postdeps; do
7789 case "$pre_post_deps " in
7790 *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
7792 func_append pre_post_deps " $pre_post_dep"
7801 need_relink=no # whether we're linking any uninstalled libtool libraries
7802 notinst_deplibs= # not-installed libtool libraries
7803 notinst_path= # paths that contain not-installed libtool libraries
7807 passes="conv dlpreopen link"
7808 for file in $dlfiles $dlprefiles; do
7812 func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"
7823 passes="conv scan dlopen dlpreopen link"
7829 for pass in $passes; do
7830 # The preopen pass in lib mode reverses $deplibs; put it back here
7831 # so that -L comes before libs that need it for instance...
7832 if test lib,link = "$linkmode,$pass"; then
7833 ## FIXME: Find the place where the list is rebuilt in the wrong
7834 ## order, and fix it there properly
7836 for deplib in $deplibs; do
7837 tmp_deplibs="$deplib $tmp_deplibs"
7839 deplibs=$tmp_deplibs
7842 if test lib,link = "$linkmode,$pass" ||
7843 test prog,scan = "$linkmode,$pass"; then
7847 if test prog = "$linkmode"; then
7849 dlopen) libs=$dlfiles ;;
7850 dlpreopen) libs=$dlprefiles ;;
7852 libs="$deplibs %DEPLIBS%"
7853 test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
7857 if test lib,dlpreopen = "$linkmode,$pass"; then
7858 # Collect and forward deplibs of preopened libtool libs
7859 for lib in $dlprefiles; do
7860 # Ignore non-libtool-libs
7862 func_resolve_sysroot "$lib"
7864 *.la) func_source "$func_resolve_sysroot_result" ;;
7867 # Collect preopened libtool deplibs, except any this library
7868 # has declared as weak libs
7869 for deplib in $dependency_libs; do
7870 func_basename "$deplib"
7871 deplib_base=$func_basename_result
7872 case " $weak_libs " in
7873 *" $deplib_base "*) ;;
7874 *) func_append deplibs " $deplib" ;;
7880 if test dlopen = "$pass"; then
7881 # Collect dlpreopened libraries
7882 save_deplibs=$deplibs
7886 for deplib in $libs; do
7890 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
7891 |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
7892 if test prog,link = "$linkmode,$pass"; then
7893 compile_deplibs="$deplib $compile_deplibs"
7894 finalize_deplibs="$deplib $finalize_deplibs"
7896 func_append compiler_flags " $deplib"
7897 if test lib = "$linkmode"; then
7898 case "$new_inherited_linker_flags " in
7900 * ) func_append new_inherited_linker_flags " $deplib" ;;
7907 if test lib != "$linkmode" && test prog != "$linkmode"; then
7908 func_warning "'-l' is ignored for archives/objects"
7911 func_stripname '-l' '' "$deplib"
7912 name=$func_stripname_result
7913 if test lib = "$linkmode"; then
7914 searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
7916 searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
7918 for searchdir in $searchdirs; do
7919 for search_ext in .la $std_shrext .so .a; do
7920 # Search the libtool library
7921 lib=$searchdir/lib$name$search_ext
7922 if test -f "$lib"; then
7923 if test .la = "$search_ext"; then
7933 # deplib is a libtool library
7934 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
7935 # We need to do some special things here, and not later.
7936 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
7937 case " $predeps $postdeps " in
7939 if func_lalib_p "$lib"; then
7943 for l in $old_library $library_names; do
7946 if test "X$ll" = "X$old_library"; then # only static version available
7948 func_dirname "$lib" "" "."
7949 ladir=$func_dirname_result
7950 lib=$ladir/$old_library
7951 if test prog,link = "$linkmode,$pass"; then
7952 compile_deplibs="$deplib $compile_deplibs"
7953 finalize_deplibs="$deplib $finalize_deplibs"
7955 deplibs="$deplib $deplibs"
7956 test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
7966 # deplib doesn't seem to be a libtool library
7967 if test prog,link = "$linkmode,$pass"; then
7968 compile_deplibs="$deplib $compile_deplibs"
7969 finalize_deplibs="$deplib $finalize_deplibs"
7971 deplibs="$deplib $deplibs"
7972 test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
7978 if test prog,link = "$linkmode,$pass"; then
7979 compile_deplibs="$deplib $compile_deplibs"
7980 finalize_deplibs="$deplib $finalize_deplibs"
7982 deplibs="$deplib $deplibs"
7983 if test lib = "$linkmode"; then
7984 case "$new_inherited_linker_flags " in
7986 * ) func_append new_inherited_linker_flags " $deplib" ;;
7995 deplibs="$deplib $deplibs"
7996 test conv = "$pass" && continue
7997 newdependency_libs="$deplib $newdependency_libs"
7998 func_stripname '-L' '' "$deplib"
7999 func_resolve_sysroot "$func_stripname_result"
8000 func_append newlib_search_path " $func_resolve_sysroot_result"
8003 if test conv = "$pass"; then
8004 deplibs="$deplib $deplibs"
8007 if test scan = "$pass"; then
8008 deplibs="$deplib $deplibs"
8010 compile_deplibs="$deplib $compile_deplibs"
8011 finalize_deplibs="$deplib $finalize_deplibs"
8013 func_stripname '-L' '' "$deplib"
8014 func_resolve_sysroot "$func_stripname_result"
8015 func_append newlib_search_path " $func_resolve_sysroot_result"
8018 func_warning "'-L' is ignored for archives/objects"
8024 if test link = "$pass"; then
8025 func_stripname '-R' '' "$deplib"
8026 func_resolve_sysroot "$func_stripname_result"
8027 dir=$func_resolve_sysroot_result
8028 # Make sure the xrpath contains only unique directories.
8031 *) func_append xrpath " $dir" ;;
8034 deplibs="$deplib $deplibs"
8038 func_resolve_sysroot "$deplib"
8039 lib=$func_resolve_sysroot_result
8042 if test conv = "$pass"; then
8043 deplibs="$deplib $deplibs"
8048 # Linking convenience modules into shared libraries is allowed,
8049 # but linking other static libraries is non-portable.
8050 case " $dlpreconveniencelibs " in
8054 case $deplibs_check_method in
8056 set dummy $deplibs_check_method; shift
8057 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
8058 if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
8059 | $EGREP "$match_pattern_regex" > /dev/null; then
8067 if $valid_a_lib; then
8069 $ECHO "*** Warning: Linking the shared library $output against the"
8070 $ECHO "*** static library $deplib is not portable!"
8071 deplibs="$deplib $deplibs"
8074 $ECHO "*** Warning: Trying to link with static lib archive $deplib."
8075 echo "*** I have the capability to make that library automatically link in when"
8076 echo "*** you link to this library. But I can only do this if you have a"
8077 echo "*** shared version of the library, which you do not appear to have"
8078 echo "*** because the file extensions .$libext of this argument makes me believe"
8079 echo "*** that it is just a static archive that I should not use here."
8086 if test link != "$pass"; then
8087 deplibs="$deplib $deplibs"
8089 compile_deplibs="$deplib $compile_deplibs"
8090 finalize_deplibs="$deplib $finalize_deplibs"
8097 if test conv = "$pass"; then
8098 deplibs="$deplib $deplibs"
8099 elif test prog = "$linkmode"; then
8100 if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
8101 # If there is no dlopen support or we're linking statically,
8102 # we need to preload.
8103 func_append newdlprefiles " $deplib"
8104 compile_deplibs="$deplib $compile_deplibs"
8105 finalize_deplibs="$deplib $finalize_deplibs"
8107 func_append newdlfiles " $deplib"
8118 $found || test -f "$lib" \
8119 || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
8121 # Check to see that this really is a libtool archive.
8122 func_lalib_unsafe_p "$lib" \
8123 || func_fatal_error "'$lib' is not a valid libtool archive"
8125 func_dirname "$lib" "" "."
8126 ladir=$func_dirname_result
8134 inherited_linker_flags=
8135 # If the library was installed with an old release of libtool,
8136 # it will not redefine variables installed, or shouldnotlink
8145 # Convert "-framework foo" to "foo.ltframework"
8146 if test -n "$inherited_linker_flags"; then
8147 tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
8148 for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
8149 case " $new_inherited_linker_flags " in
8150 *" $tmp_inherited_linker_flag "*) ;;
8151 *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
8155 dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8156 if test lib,link = "$linkmode,$pass" ||
8157 test prog,scan = "$linkmode,$pass" ||
8158 { test prog != "$linkmode" && test lib != "$linkmode"; }; then
8159 test -n "$dlopen" && func_append dlfiles " $dlopen"
8160 test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
8163 if test conv = "$pass"; then
8164 # Only check for convenience libraries
8165 deplibs="$lib $deplibs"
8166 if test -z "$libdir"; then
8167 if test -z "$old_library"; then
8168 func_fatal_error "cannot find name of link library for '$lib'"
8170 # It is a libtool convenience library, so add in its objects.
8171 func_append convenience " $ladir/$objdir/$old_library"
8172 func_append old_convenience " $ladir/$objdir/$old_library"
8174 for deplib in $dependency_libs; do
8175 deplibs="$deplib $deplibs"
8176 if $opt_preserve_dup_deps; then
8177 case "$tmp_libs " in
8178 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
8181 func_append tmp_libs " $deplib"
8183 elif test prog != "$linkmode" && test lib != "$linkmode"; then
8184 func_fatal_error "'$lib' is not a convenience library"
8190 # Get the name of the library we link against.
8192 if test -n "$old_library" &&
8193 { test yes = "$prefer_static_libs" ||
8194 test built,no = "$prefer_static_libs,$installed"; }; then
8195 linklib=$old_library
8197 for l in $old_library $library_names; do
8201 if test -z "$linklib"; then
8202 func_fatal_error "cannot find name of link library for '$lib'"
8205 # This library was specified with -dlopen.
8206 if test dlopen = "$pass"; then
8208 && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
8209 if test -z "$dlname" ||
8210 test yes != "$dlopen_support" ||
8211 test no = "$build_libtool_libs"
8213 # If there is no dlname, no dlopen support or we're linking
8214 # statically, we need to preload. We also need to preload any
8215 # dependent libraries so libltdl's deplib preloader doesn't
8216 # bomb out in the load deplibs phase.
8217 func_append dlprefiles " $lib $dependency_libs"
8219 func_append newdlfiles " $lib"
8224 # We need an absolute path.
8226 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;
8228 abs_ladir=`cd "$ladir" && pwd`
8229 if test -z "$abs_ladir"; then
8230 func_warning "cannot determine absolute directory name of '$ladir'"
8231 func_warning "passing it literally to the linker, although it might fail"
8236 func_basename "$lib"
8237 laname=$func_basename_result
8239 # Find the relevant object directory and library name.
8240 if test yes = "$installed"; then
8241 if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
8242 func_warning "library '$lib' was moved."
8247 dir=$lt_sysroot$libdir
8248 absdir=$lt_sysroot$libdir
8250 test yes = "$hardcode_automatic" && avoidtemprpath=yes
8252 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
8255 # Remove this search path later
8256 func_append notinst_path " $abs_ladir"
8259 absdir=$abs_ladir/$objdir
8260 # Remove this search path later
8261 func_append notinst_path " $abs_ladir"
8263 fi # $installed = yes
8264 func_stripname 'lib' '.la' "$laname"
8265 name=$func_stripname_result
8267 # This library was specified with -dlpreopen.
8268 if test dlpreopen = "$pass"; then
8269 if test -z "$libdir" && test prog = "$linkmode"; then
8270 func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
8273 # special handling for platforms with PE-DLLs.
8274 *cygwin* | *mingw* | *cegcc* )
8275 # Linker will automatically link against shared library if both
8276 # static and shared are present. Therefore, ensure we extract
8277 # symbols from the import library if a shared library is present
8278 # (otherwise, the dlopen module name will be incorrect). We do
8279 # this by putting the import library name into $newdlprefiles.
8280 # We recover the dlopen module name by 'saving' the la file
8281 # name in a special purpose variable, and (later) extracting the
8282 # dlname from the la file.
8283 if test -n "$dlname"; then
8284 func_tr_sh "$dir/$linklib"
8285 eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
8286 func_append newdlprefiles " $dir/$linklib"
8288 func_append newdlprefiles " $dir/$old_library"
8289 # Keep a list of preopened convenience libraries to check
8290 # that they are being used correctly in the link pass.
8291 test -z "$libdir" && \
8292 func_append dlpreconveniencelibs " $dir/$old_library"
8296 # Prefer using a static library (so that no silly _DYNAMIC symbols
8297 # are required to link).
8298 if test -n "$old_library"; then
8299 func_append newdlprefiles " $dir/$old_library"
8300 # Keep a list of preopened convenience libraries to check
8301 # that they are being used correctly in the link pass.
8302 test -z "$libdir" && \
8303 func_append dlpreconveniencelibs " $dir/$old_library"
8304 # Otherwise, use the dlname, so that lt_dlopen finds it.
8305 elif test -n "$dlname"; then
8306 func_append newdlprefiles " $dir/$dlname"
8308 func_append newdlprefiles " $dir/$linklib"
8312 fi # $pass = dlpreopen
8314 if test -z "$libdir"; then
8315 # Link the convenience library
8316 if test lib = "$linkmode"; then
8317 deplibs="$dir/$old_library $deplibs"
8318 elif test prog,link = "$linkmode,$pass"; then
8319 compile_deplibs="$dir/$old_library $compile_deplibs"
8320 finalize_deplibs="$dir/$old_library $finalize_deplibs"
8322 deplibs="$lib $deplibs" # used for prog,scan pass
8328 if test prog = "$linkmode" && test link != "$pass"; then
8329 func_append newlib_search_path " $ladir"
8330 deplibs="$lib $deplibs"
8332 linkalldeplibs=false
8333 if test no != "$link_all_deplibs" || test -z "$library_names" ||
8334 test no = "$build_libtool_libs"; then
8339 for deplib in $dependency_libs; do
8341 -L*) func_stripname '-L' '' "$deplib"
8342 func_resolve_sysroot "$func_stripname_result"
8343 func_append newlib_search_path " $func_resolve_sysroot_result"
8346 # Need to link against all dependency_libs?
8347 if $linkalldeplibs; then
8348 deplibs="$deplib $deplibs"
8350 # Need to hardcode shared library paths
8351 # or/and link against static libraries
8352 newdependency_libs="$deplib $newdependency_libs"
8354 if $opt_preserve_dup_deps; then
8355 case "$tmp_libs " in
8356 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
8359 func_append tmp_libs " $deplib"
8362 fi # $linkmode = prog...
8364 if test prog,link = "$linkmode,$pass"; then
8365 if test -n "$library_names" &&
8366 { { test no = "$prefer_static_libs" ||
8367 test built,yes = "$prefer_static_libs,$installed"; } ||
8368 test -z "$old_library"; }; then
8369 # We need to hardcode the library path
8370 if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
8371 # Make sure the rpath contains only unique directories.
8372 case $temp_rpath: in
8374 *) func_append temp_rpath "$absdir:" ;;
8378 # Hardcode the library path.
8379 # Skip directories that are in the system default run-time
8381 case " $sys_lib_dlsearch_path " in
8384 case "$compile_rpath " in
8386 *) func_append compile_rpath " $absdir" ;;
8390 case " $sys_lib_dlsearch_path " in
8393 case "$finalize_rpath " in
8395 *) func_append finalize_rpath " $libdir" ;;
8399 fi # $linkmode,$pass = prog,link...
8402 { test pass_all = "$deplibs_check_method" ||
8403 { test yes = "$build_libtool_libs" &&
8404 test -n "$library_names"; }; }; then
8405 # We only need to search for static libraries
8410 link_static=no # Whether the deplib will be linked statically
8411 use_static_libs=$prefer_static_libs
8412 if test built = "$use_static_libs" && test yes = "$installed"; then
8415 if test -n "$library_names" &&
8416 { test no = "$use_static_libs" || test -z "$old_library"; }; then
8418 *cygwin* | *mingw* | *cegcc* | *os2*)
8419 # No point in relinking DLLs because paths are not encoded
8420 func_append notinst_deplibs " $lib"
8424 if test no = "$installed"; then
8425 func_append notinst_deplibs " $lib"
8430 # This is a shared library
8432 # Warn about portability, can't link against -module's on some
8433 # systems (darwin). Don't bleat about dlopened modules though!
8435 for dlpremoduletest in $dlprefiles; do
8436 if test "X$dlpremoduletest" = "X$lib"; then
8437 dlopenmodule=$dlpremoduletest
8441 if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
8443 if test prog = "$linkmode"; then
8444 $ECHO "*** Warning: Linking the executable $output against the loadable module"
8446 $ECHO "*** Warning: Linking the shared library $output against the loadable module"
8448 $ECHO "*** $linklib is not portable!"
8450 if test lib = "$linkmode" &&
8451 test yes = "$hardcode_into_libs"; then
8452 # Hardcode the library path.
8453 # Skip directories that are in the system default run-time
8455 case " $sys_lib_dlsearch_path " in
8458 case "$compile_rpath " in
8460 *) func_append compile_rpath " $absdir" ;;
8464 case " $sys_lib_dlsearch_path " in
8467 case "$finalize_rpath " in
8469 *) func_append finalize_rpath " $libdir" ;;
8475 if test -n "$old_archive_from_expsyms_cmds"; then
8476 # figure out the soname
8477 set dummy $library_names
8481 libname=`eval "\\$ECHO \"$libname_spec\""`
8482 # use dlname if we got it. it's perfectly good, no?
8483 if test -n "$dlname"; then
8485 elif test -n "$soname_spec"; then
8488 *cygwin* | mingw* | *cegcc* | *os2*)
8489 func_arith $current - $age
8490 major=$func_arith_result
8494 eval soname=\"$soname_spec\"
8499 # Make a new name for the extract_expsyms_cmds to use
8501 func_basename "$soroot"
8502 soname=$func_basename_result
8503 func_stripname 'lib' '.dll' "$soname"
8504 newlib=libimp-$func_stripname_result.a
8506 # If the library has no export list, then create one now
8507 if test -f "$output_objdir/$soname-def"; then :
8509 func_verbose "extracting exported symbol list from '$soname'"
8510 func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
8514 if test -f "$output_objdir/$newlib"; then :; else
8515 func_verbose "generating import library for '$soname'"
8516 func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
8518 # make sure the library variables are pointing to the new library
8521 fi # test -n "$old_archive_from_expsyms_cmds"
8523 if test prog = "$linkmode" || test relink != "$opt_mode"; then
8528 case $hardcode_action in
8529 immediate | unsupported)
8530 if test no = "$hardcode_direct"; then
8533 *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
8534 *-*-sysv4*uw2*) add_dir=-L$dir ;;
8535 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
8536 *-*-unixware7*) add_dir=-L$dir ;;
8538 # if the lib is a (non-dlopened) module then we cannot
8539 # link against it, someone is ignoring the earlier warnings
8540 if /usr/bin/file -L $add 2> /dev/null |
8541 $GREP ": [^:]* bundle" >/dev/null; then
8542 if test "X$dlopenmodule" != "X$lib"; then
8543 $ECHO "*** Warning: lib $linklib is a module, not a shared library"
8544 if test -z "$old_library"; then
8546 echo "*** And there doesn't seem to be a static archive available"
8547 echo "*** The link will probably fail, sorry"
8549 add=$dir/$old_library
8551 elif test -n "$old_library"; then
8552 add=$dir/$old_library
8556 elif test no = "$hardcode_minus_L"; then
8558 *-*-sunos*) add_shlibpath=$dir ;;
8562 elif test no = "$hardcode_shlibpath_var"; then
8570 if test yes = "$hardcode_direct" &&
8571 test no = "$hardcode_direct_absolute"; then
8573 elif test yes = "$hardcode_minus_L"; then
8575 # Try looking first in the location we're being installed to.
8576 if test -n "$inst_prefix_dir"; then
8579 func_append add_dir " -L$inst_prefix_dir$libdir"
8584 elif test yes = "$hardcode_shlibpath_var"; then
8594 if test yes != "$lib_linked"; then
8595 func_fatal_configuration "unsupported hardcode properties"
8598 if test -n "$add_shlibpath"; then
8599 case :$compile_shlibpath: in
8600 *":$add_shlibpath:"*) ;;
8601 *) func_append compile_shlibpath "$add_shlibpath:" ;;
8604 if test prog = "$linkmode"; then
8605 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
8606 test -n "$add" && compile_deplibs="$add $compile_deplibs"
8608 test -n "$add_dir" && deplibs="$add_dir $deplibs"
8609 test -n "$add" && deplibs="$add $deplibs"
8610 if test yes != "$hardcode_direct" &&
8611 test yes != "$hardcode_minus_L" &&
8612 test yes = "$hardcode_shlibpath_var"; then
8613 case :$finalize_shlibpath: in
8615 *) func_append finalize_shlibpath "$libdir:" ;;
8621 if test prog = "$linkmode" || test relink = "$opt_mode"; then
8625 # Finalize command for both is simple: just hardcode it.
8626 if test yes = "$hardcode_direct" &&
8627 test no = "$hardcode_direct_absolute"; then
8628 add=$libdir/$linklib
8629 elif test yes = "$hardcode_minus_L"; then
8632 elif test yes = "$hardcode_shlibpath_var"; then
8633 case :$finalize_shlibpath: in
8635 *) func_append finalize_shlibpath "$libdir:" ;;
8638 elif test yes = "$hardcode_automatic"; then
8639 if test -n "$inst_prefix_dir" &&
8640 test -f "$inst_prefix_dir$libdir/$linklib"; then
8641 add=$inst_prefix_dir$libdir/$linklib
8643 add=$libdir/$linklib
8646 # We cannot seem to hardcode it, guess we'll fake it.
8648 # Try looking first in the location we're being installed to.
8649 if test -n "$inst_prefix_dir"; then
8652 func_append add_dir " -L$inst_prefix_dir$libdir"
8659 if test prog = "$linkmode"; then
8660 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
8661 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
8663 test -n "$add_dir" && deplibs="$add_dir $deplibs"
8664 test -n "$add" && deplibs="$add $deplibs"
8667 elif test prog = "$linkmode"; then
8668 # Here we assume that one of hardcode_direct or hardcode_minus_L
8669 # is not unsupported. This is valid on all known static and
8671 if test unsupported != "$hardcode_direct"; then
8672 test -n "$old_library" && linklib=$old_library
8673 compile_deplibs="$dir/$linklib $compile_deplibs"
8674 finalize_deplibs="$dir/$linklib $finalize_deplibs"
8676 compile_deplibs="-l$name -L$dir $compile_deplibs"
8677 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
8679 elif test yes = "$build_libtool_libs"; then
8680 # Not a shared library
8681 if test pass_all != "$deplibs_check_method"; then
8682 # We're trying link a shared library against a static one
8683 # but the system doesn't support it.
8685 # Just print a warning and add the library to dependency_libs so
8686 # that the program can be linked against the static library.
8688 $ECHO "*** Warning: This system cannot link to static lib archive $lib."
8689 echo "*** I have the capability to make that library automatically link in when"
8690 echo "*** you link to this library. But I can only do this if you have a"
8691 echo "*** shared version of the library, which you do not appear to have."
8692 if test yes = "$module"; then
8693 echo "*** But as you try to build a module library, libtool will still create "
8694 echo "*** a static module, that should work as long as the dlopening application"
8695 echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
8696 if test -z "$global_symbol_pipe"; then
8698 echo "*** However, this would only work if libtool was able to extract symbol"
8699 echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
8700 echo "*** not find such a program. So, this module is probably useless."
8701 echo "*** 'nm' from GNU binutils and a full rebuild may help."
8703 if test no = "$build_old_libs"; then
8704 build_libtool_libs=module
8707 build_libtool_libs=no
8711 deplibs="$dir/$old_library $deplibs"
8714 fi # link shared/static library?
8716 if test lib = "$linkmode"; then
8717 if test -n "$dependency_libs" &&
8718 { test yes != "$hardcode_into_libs" ||
8719 test yes = "$build_old_libs" ||
8720 test yes = "$link_static"; }; then
8721 # Extract -R from dependency_libs
8723 for libdir in $dependency_libs; do
8725 -R*) func_stripname '-R' '' "$libdir"
8726 temp_xrpath=$func_stripname_result
8728 *" $temp_xrpath "*) ;;
8729 *) func_append xrpath " $temp_xrpath";;
8731 *) func_append temp_deplibs " $libdir";;
8734 dependency_libs=$temp_deplibs
8737 func_append newlib_search_path " $absdir"
8738 # Link against this library
8739 test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
8740 # ... and its dependency_libs
8742 for deplib in $dependency_libs; do
8743 newdependency_libs="$deplib $newdependency_libs"
8745 -L*) func_stripname '-L' '' "$deplib"
8746 func_resolve_sysroot "$func_stripname_result";;
8747 *) func_resolve_sysroot "$deplib" ;;
8749 if $opt_preserve_dup_deps; then
8750 case "$tmp_libs " in
8751 *" $func_resolve_sysroot_result "*)
8752 func_append specialdeplibs " $func_resolve_sysroot_result" ;;
8755 func_append tmp_libs " $func_resolve_sysroot_result"
8758 if test no != "$link_all_deplibs"; then
8759 # Add the search paths of all dependency libraries
8760 for deplib in $dependency_libs; do
8763 -L*) path=$deplib ;;
8765 func_resolve_sysroot "$deplib"
8766 deplib=$func_resolve_sysroot_result
8767 func_dirname "$deplib" "" "."
8768 dir=$func_dirname_result
8769 # We need an absolute path.
8771 [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
8773 absdir=`cd "$dir" && pwd`
8774 if test -z "$absdir"; then
8775 func_warning "cannot determine absolute directory name of '$dir'"
8780 if $GREP "^installed=no" $deplib > /dev/null; then
8784 eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
8785 if test -n "$deplibrary_names"; then
8786 for tmp in $deplibrary_names; do
8789 if test -f "$absdir/$objdir/$depdepl"; then
8790 depdepl=$absdir/$objdir/$depdepl
8791 darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
8792 if test -z "$darwin_install_name"; then
8793 darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
8795 func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"
8796 func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"
8802 path=-L$absdir/$objdir
8806 eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
8807 test -z "$libdir" && \
8808 func_fatal_error "'$deplib' is not a valid libtool archive"
8809 test "$absdir" != "$libdir" && \
8810 func_warning "'$deplib' seems to be moved"
8816 case " $deplibs " in
8818 *) deplibs="$path $deplibs" ;;
8821 fi # link_all_deplibs != no
8823 done # for deplib in $libs
8824 if test link = "$pass"; then
8825 if test prog = "$linkmode"; then
8826 compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
8827 finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
8829 compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8832 dependency_libs=$newdependency_libs
8833 if test dlpreopen = "$pass"; then
8834 # Link the dlpreopened libraries before other libraries
8835 for deplib in $save_deplibs; do
8836 deplibs="$deplib $deplibs"
8839 if test dlopen != "$pass"; then
8840 test conv = "$pass" || {
8841 # Make sure lib_search_path contains only unique directories.
8843 for dir in $newlib_search_path; do
8844 case "$lib_search_path " in
8846 *) func_append lib_search_path " $dir" ;;
8852 if test prog,link = "$linkmode,$pass"; then
8853 vars="compile_deplibs finalize_deplibs"
8857 for var in $vars dependency_libs; do
8858 # Add libraries to $var in reverse order
8859 eval tmp_libs=\"\$$var\"
8861 for deplib in $tmp_libs; do
8862 # FIXME: Pedantically, this is the right thing to do, so
8863 # that some nasty dependency loop isn't accidentally
8865 #new_libs="$deplib $new_libs"
8866 # Pragmatically, this seems to cause very few problems in
8869 -L*) new_libs="$deplib $new_libs" ;;
8872 # And here is the reason: when a library appears more
8873 # than once as an explicit dependence of a library, or
8874 # is implicitly linked in more than once by the
8875 # compiler, it is considered special, and multiple
8876 # occurrences thereof are not removed. Compare this
8877 # with having the same library being listed as a
8878 # dependency of multiple other libraries: in this case,
8879 # we know (pedantically, we assume) the library does not
8880 # need to be listed more than once, so we keep only the
8881 # last copy. This is not always right, but it is rare
8882 # enough that we require users that really mean to play
8883 # such unportable linking tricks to link the library
8884 # using -Wl,-lname, so that libtool does not consider it
8885 # for duplicate removal.
8886 case " $specialdeplibs " in
8887 *" $deplib "*) new_libs="$deplib $new_libs" ;;
8889 case " $new_libs " in
8891 *) new_libs="$deplib $new_libs" ;;
8899 for deplib in $new_libs; do
8902 case " $tmp_libs " in
8904 *) func_append tmp_libs " $deplib" ;;
8907 *) func_append tmp_libs " $deplib" ;;
8910 eval $var=\"$tmp_libs\"
8914 # Add Sun CC postdeps if required:
8915 test CXX = "$tagname" && {
8918 case `$CC -V 2>&1 | $SED 5q` in
8919 *Sun\ C*) # Sun C++ 5.9
8922 if test no != "$suncc_use_cstd_abi"; then
8923 func_append postdeps ' -library=Cstd -library=Crun'
8930 func_cc_basename "$CC"
8931 case $func_cc_basename_result in
8935 if test no != "$suncc_use_cstd_abi"; then
8936 func_append postdeps ' -library=Cstd -library=Crun'
8944 # Last step: remove runtime libs from dependency_libs
8945 # (they stay in deplibs)
8947 for i in $dependency_libs; do
8948 case " $predeps $postdeps $compiler_lib_search_path " in
8953 if test -n "$i"; then
8954 func_append tmp_libs " $i"
8957 dependency_libs=$tmp_libs
8959 if test prog = "$linkmode"; then
8962 if test prog = "$linkmode" || test lib = "$linkmode"; then
8963 dlprefiles=$newdlprefiles
8968 if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
8969 func_warning "'-dlopen' is ignored for archives"
8974 func_warning "'-l' and '-L' are ignored for archives" ;;
8977 test -n "$rpath" && \
8978 func_warning "'-rpath' is ignored for archives"
8980 test -n "$xrpath" && \
8981 func_warning "'-R' is ignored for archives"
8983 test -n "$vinfo" && \
8984 func_warning "'-version-info/-version-number' is ignored for archives"
8986 test -n "$release" && \
8987 func_warning "'-release' is ignored for archives"
8989 test -n "$export_symbols$export_symbols_regex" && \
8990 func_warning "'-export-symbols' is ignored for archives"
8992 # Now set the variables for building old libraries.
8993 build_libtool_libs=no
8995 func_append objs "$old_deplibs"
8999 # Make sure we only generate libraries of the form 'libNAME.la'.
9002 func_stripname 'lib' '.la' "$outputname"
9003 name=$func_stripname_result
9004 eval shared_ext=\"$shrext_cmds\"
9005 eval libname=\"$libname_spec\"
9008 test no = "$module" \
9009 && func_fatal_help "libtool library '$output' must begin with 'lib'"
9011 if test no != "$need_lib_prefix"; then
9012 # Add the "lib" prefix for modules if required
9013 func_stripname '' '.la' "$outputname"
9014 name=$func_stripname_result
9015 eval shared_ext=\"$shrext_cmds\"
9016 eval libname=\"$libname_spec\"
9018 func_stripname '' '.la' "$outputname"
9019 libname=$func_stripname_result
9024 if test -n "$objs"; then
9025 if test pass_all != "$deplibs_check_method"; then
9026 func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
9029 $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
9030 $ECHO "*** objects $objs is not portable!"
9031 func_append libobjs " $objs"
9035 test no = "$dlself" \
9036 || func_warning "'-dlopen self' is ignored for libtool libraries"
9041 && func_warning "ignoring multiple '-rpath's for a libtool library"
9046 if test -z "$rpath"; then
9047 if test yes = "$build_libtool_libs"; then
9048 # Building a libtool convenience library.
9049 # Some compilers have problems with a '.al' extension so
9050 # convenience libraries should have the same extension an
9051 # archive normally would.
9052 oldlibs="$output_objdir/$libname.$libext $oldlibs"
9053 build_libtool_libs=convenience
9057 test -n "$vinfo" && \
9058 func_warning "'-version-info/-version-number' is ignored for convenience libraries"
9060 test -n "$release" && \
9061 func_warning "'-release' is ignored for convenience libraries"
9064 # Parse the version information argument.
9065 save_ifs=$IFS; IFS=:
9066 set dummy $vinfo 0 0 0
9071 func_fatal_help "too many parameters to '-version-info'"
9073 # convert absolute version numbers to libtool ages
9074 # this retains compatibility with .la files and attempts
9075 # to make the code below a bit more comprehensible
9077 case $vinfo_number in
9083 # There are really only two kinds -- those that
9084 # use the current revision as the major version
9085 # and those that subtract age and use age as
9086 # a minor version. But, then there is irix
9087 # that has an extra 1 added just for fun
9089 case $version_type in
9090 # correct linux to gnu/linux during the next big refactor
9091 darwin|freebsd-elf|linux|midnightbsd-elf|osf|windows|none)
9092 func_arith $number_major + $number_minor
9093 current=$func_arith_result
9095 revision=$number_revision
9097 freebsd-aout|qnx|sunos)
9098 current=$number_major
9099 revision=$number_minor
9103 func_arith $number_major + $number_minor
9104 current=$func_arith_result
9106 revision=$number_minor
9107 lt_irix_increment=no
9110 func_fatal_configuration "$modename: unknown library version type '$version_type'"
9121 # Check that each of the things are valid numbers.
9123 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]) ;;
9125 func_error "CURRENT '$current' must be a nonnegative integer"
9126 func_fatal_error "'$vinfo' is not valid version information"
9131 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]) ;;
9133 func_error "REVISION '$revision' must be a nonnegative integer"
9134 func_fatal_error "'$vinfo' is not valid version information"
9139 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]) ;;
9141 func_error "AGE '$age' must be a nonnegative integer"
9142 func_fatal_error "'$vinfo' is not valid version information"
9146 if test "$age" -gt "$current"; then
9147 func_error "AGE '$age' is greater than the current interface number '$current'"
9148 func_fatal_error "'$vinfo' is not valid version information"
9151 # Calculate the version variables.
9155 case $version_type in
9159 # Like Linux, but with the current version available in
9160 # verstring for coding it into the library header
9161 func_arith $current - $age
9162 major=.$func_arith_result
9163 versuffix=$major.$age.$revision
9164 # Darwin ld doesn't like 0 for these options...
9165 func_arith $current + 1
9166 minor_current=$func_arith_result
9167 xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
9168 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
9169 # On Darwin other compilers
9172 verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
9175 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
9182 versuffix=.$current.$revision
9185 freebsd-elf | midnightbsd-elf)
9186 func_arith $current - $age
9187 major=.$func_arith_result
9188 versuffix=$major.$age.$revision
9192 if test no = "$lt_irix_increment"; then
9193 func_arith $current - $age
9195 func_arith $current - $age + 1
9197 major=$func_arith_result
9199 case $version_type in
9200 nonstopux) verstring_prefix=nonstopux ;;
9201 *) verstring_prefix=sgi ;;
9203 verstring=$verstring_prefix$major.$revision
9205 # Add in all the interfaces that we are compatible with.
9207 while test 0 -ne "$loop"; do
9208 func_arith $revision - $loop
9209 iface=$func_arith_result
9210 func_arith $loop - 1
9211 loop=$func_arith_result
9212 verstring=$verstring_prefix$major.$iface:$verstring
9215 # Before this point, $major must not contain '.'.
9217 versuffix=$major.$revision
9220 linux) # correct to gnu/linux during the next big refactor
9221 func_arith $current - $age
9222 major=.$func_arith_result
9223 versuffix=$major.$age.$revision
9227 func_arith $current - $age
9228 major=.$func_arith_result
9229 versuffix=.$current.$age.$revision
9230 verstring=$current.$age.$revision
9232 # Add in all the interfaces that we are compatible with.
9234 while test 0 -ne "$loop"; do
9235 func_arith $current - $loop
9236 iface=$func_arith_result
9237 func_arith $loop - 1
9238 loop=$func_arith_result
9239 verstring=$verstring:$iface.0
9242 # Make executables depend on our current version.
9243 func_append verstring ":$current.0"
9258 versuffix=.$current.$revision
9262 # Use '-' rather than '.', since we only want one
9263 # extension on DOS 8.3 file systems.
9264 func_arith $current - $age
9265 major=$func_arith_result
9270 func_fatal_configuration "unknown library version type '$version_type'"
9274 # Clear the version info if we defaulted, and they specified a release.
9275 if test -z "$vinfo" && test -n "$release"; then
9277 case $version_type in
9279 # we can't check for "0.0" in archive_cmds due to quoting
9280 # problems, so we reset it completely
9287 if test no = "$need_version"; then
9294 # Remove version info from name if versioning should be avoided
9295 if test yes,no = "$avoid_version,$need_version"; then
9301 # Check to see if the archive will have undefined symbols.
9302 if test yes = "$allow_undefined"; then
9303 if test unsupported = "$allow_undefined_flag"; then
9304 if test yes = "$build_old_libs"; then
9305 func_warning "undefined symbols not allowed in $host shared libraries; building static only"
9306 build_libtool_libs=no
9308 func_fatal_error "can't build $host shared library unless -no-undefined is specified"
9312 # Don't allow undefined symbols.
9313 allow_undefined_flag=$no_undefined_flag
9318 func_generate_dlsyms "$libname" "$libname" :
9319 func_append libobjs " $symfileobj"
9320 test " " = "$libobjs" && libobjs=
9322 if test relink != "$opt_mode"; then
9323 # Remove our outputs, but don't remove object files since they
9324 # may have been created when compiling PIC objects.
9326 tempremovelist=`$ECHO "$output_objdir/*"`
9327 for p in $tempremovelist; do
9331 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)
9332 if test -n "$precious_files_regex"; then
9333 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
9338 func_append removelist " $p"
9343 test -n "$removelist" && \
9344 func_show_eval "${RM}r \$removelist"
9347 # Now set the variables for building old libraries.
9348 if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then
9349 func_append oldlibs " $output_objdir/$libname.$libext"
9351 # Transform .lo files to .o files.
9352 oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`
9355 # Eliminate all temporary directories.
9356 #for path in $notinst_path; do
9357 # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
9358 # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
9359 # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
9362 if test -n "$xrpath"; then
9363 # If the user specified any rpath flags, then add them.
9365 for libdir in $xrpath; do
9366 func_replace_sysroot "$libdir"
9367 func_append temp_xrpath " -R$func_replace_sysroot_result"
9368 case "$finalize_rpath " in
9370 *) func_append finalize_rpath " $libdir" ;;
9373 if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then
9374 dependency_libs="$temp_xrpath $dependency_libs"
9378 # Make sure dlfiles contains only unique files that won't be dlpreopened
9379 old_dlfiles=$dlfiles
9381 for lib in $old_dlfiles; do
9382 case " $dlprefiles $dlfiles " in
9384 *) func_append dlfiles " $lib" ;;
9388 # Make sure dlprefiles contains only unique files
9389 old_dlprefiles=$dlprefiles
9391 for lib in $old_dlprefiles; do
9392 case "$dlprefiles " in
9394 *) func_append dlprefiles " $lib" ;;
9398 if test yes = "$build_libtool_libs"; then
9399 if test -n "$rpath"; then
9401 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
9402 # these systems don't actually have a c library (as such)!
9404 *-*-rhapsody* | *-*-darwin1.[012])
9405 # Rhapsody C library is in the System framework
9406 func_append deplibs " System.ltframework"
9409 # Don't link with libc until the a.out ld.so is fixed.
9411 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*)
9412 # Do not include libc due to us having libc/libc_r.
9414 *-*-sco3.2v5* | *-*-sco5v6*)
9415 # Causes problems with __ctype
9417 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
9418 # Compiler inserts libc in the correct place for threads to work
9421 # Add libc to deplibs on all other systems if necessary.
9422 if test yes = "$build_libtool_need_lc"; then
9423 func_append deplibs " -lc"
9429 # Transform deplibs into only deplibs that can be linked in shared.
9431 libname_save=$libname
9432 release_save=$release
9433 versuffix_save=$versuffix
9435 # I'm not sure if I'm treating the release correctly. I think
9436 # release should show up in the -l (ie -lgmp5) so we don't want to
9437 # add it in twice. Is that correct?
9443 case $deplibs_check_method in
9445 # Don't check for shared/static. Everything works.
9446 # This might be a little naive. We might want to check
9447 # whether the library exists or not. But this is on
9448 # osf3 & osf4 and I'm not really sure... Just
9449 # implementing what was already the behavior.
9453 # This code stresses the "libraries are programs" paradigm to its
9454 # limits. Maybe even breaks it. We compile a program, linking it
9455 # against the deplibs as a proxy for the library. Then we can check
9456 # whether they linked in statically or dynamically with ldd.
9457 $opt_dry_run || $RM conftest.c
9458 cat > conftest.c <<EOF
9459 int main() { return 0; }
9461 $opt_dry_run || $RM conftest
9462 if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
9463 ldd_output=`ldd conftest`
9464 for i in $deplibs; do
9467 func_stripname -l '' "$i"
9468 name=$func_stripname_result
9469 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
9470 case " $predeps $postdeps " in
9472 func_append newdeplibs " $i"
9477 if test -n "$i"; then
9478 libname=`eval "\\$ECHO \"$libname_spec\""`
9479 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
9480 set dummy $deplib_matches; shift
9482 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
9483 func_append newdeplibs " $i"
9487 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
9488 echo "*** I have the capability to make that library automatically link in when"
9489 echo "*** you link to this library. But I can only do this if you have a"
9490 echo "*** shared version of the library, which I believe you do not have"
9491 echo "*** because a test_compile did reveal that the linker did not use it for"
9492 echo "*** its dynamic dependency list that programs get resolved with at runtime."
9497 func_append newdeplibs " $i"
9502 # Error occurred in the first compile. Let's try to salvage
9503 # the situation: Compile a separate program for each library.
9504 for i in $deplibs; do
9507 func_stripname -l '' "$i"
9508 name=$func_stripname_result
9509 $opt_dry_run || $RM conftest
9510 if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
9511 ldd_output=`ldd conftest`
9512 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
9513 case " $predeps $postdeps " in
9515 func_append newdeplibs " $i"
9520 if test -n "$i"; then
9521 libname=`eval "\\$ECHO \"$libname_spec\""`
9522 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
9523 set dummy $deplib_matches; shift
9525 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
9526 func_append newdeplibs " $i"
9530 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
9531 echo "*** I have the capability to make that library automatically link in when"
9532 echo "*** you link to this library. But I can only do this if you have a"
9533 echo "*** shared version of the library, which you do not appear to have"
9534 echo "*** because a test_compile did reveal that the linker did not use this one"
9535 echo "*** as a dynamic dependency that programs can get resolved with at runtime."
9541 $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
9542 echo "*** make it link in! You will probably need to install it or some"
9543 echo "*** library that it depends on before this library will be fully"
9544 echo "*** functional. Installing it before continuing would be even better."
9548 func_append newdeplibs " $i"
9555 set dummy $deplibs_check_method; shift
9556 file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
9557 for a_deplib in $deplibs; do
9560 func_stripname -l '' "$a_deplib"
9561 name=$func_stripname_result
9562 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
9563 case " $predeps $postdeps " in
9565 func_append newdeplibs " $a_deplib"
9570 if test -n "$a_deplib"; then
9571 libname=`eval "\\$ECHO \"$libname_spec\""`
9572 if test -n "$file_magic_glob"; then
9573 libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
9575 libnameglob=$libname
9577 test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`
9578 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
9579 if test yes = "$want_nocaseglob"; then
9581 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
9584 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
9586 for potent_lib in $potential_libs; do
9587 # Follow soft links.
9588 if ls -lLd "$potent_lib" 2>/dev/null |
9589 $GREP " -> " >/dev/null; then
9592 # The statement above tries to avoid entering an
9593 # endless loop below, in case of cyclic links.
9594 # We might still enter an endless loop, since a link
9595 # loop can be closed while we follow links,
9598 while test -h "$potlib" 2>/dev/null; do
9599 potliblink=`ls -ld $potlib | $SED 's/.* -> //'`
9601 [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
9602 *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
9605 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
9607 $EGREP "$file_magic_regex" > /dev/null; then
9608 func_append newdeplibs " $a_deplib"
9615 if test -n "$a_deplib"; then
9618 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
9619 echo "*** I have the capability to make that library automatically link in when"
9620 echo "*** you link to this library. But I can only do this if you have a"
9621 echo "*** shared version of the library, which you do not appear to have"
9622 echo "*** because I did check the linker path looking for a file starting"
9623 if test -z "$potlib"; then
9624 $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
9626 $ECHO "*** with $libname and none of the candidates passed a file format test"
9627 $ECHO "*** using a file magic. Last file checked: $potlib"
9632 # Add a -L argument.
9633 func_append newdeplibs " $a_deplib"
9636 done # Gone through all deplibs.
9639 set dummy $deplibs_check_method; shift
9640 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
9641 for a_deplib in $deplibs; do
9644 func_stripname -l '' "$a_deplib"
9645 name=$func_stripname_result
9646 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
9647 case " $predeps $postdeps " in
9649 func_append newdeplibs " $a_deplib"
9654 if test -n "$a_deplib"; then
9655 libname=`eval "\\$ECHO \"$libname_spec\""`
9656 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
9657 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
9658 for potent_lib in $potential_libs; do
9659 potlib=$potent_lib # see symlink-check above in file_magic test
9660 if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
9661 $EGREP "$match_pattern_regex" > /dev/null; then
9662 func_append newdeplibs " $a_deplib"
9669 if test -n "$a_deplib"; then
9672 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
9673 echo "*** I have the capability to make that library automatically link in when"
9674 echo "*** you link to this library. But I can only do this if you have a"
9675 echo "*** shared version of the library, which you do not appear to have"
9676 echo "*** because I did check the linker path looking for a file starting"
9677 if test -z "$potlib"; then
9678 $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
9680 $ECHO "*** with $libname and none of the candidates passed a file format test"
9681 $ECHO "*** using a regex pattern. Last file checked: $potlib"
9686 # Add a -L argument.
9687 func_append newdeplibs " $a_deplib"
9690 done # Gone through all deplibs.
9694 tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
9695 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
9696 for i in $predeps $postdeps; do
9697 # can't use Xsed below, because $i might contain '/'
9698 tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
9701 case $tmp_deplibs in
9704 if test none = "$deplibs_check_method"; then
9705 echo "*** Warning: inter-library dependencies are not supported in this platform."
9707 echo "*** Warning: inter-library dependencies are not known to be supported."
9709 echo "*** All declared inter-library dependencies are being dropped."
9715 versuffix=$versuffix_save
9717 release=$release_save
9718 libname=$libname_save
9722 *-*-rhapsody* | *-*-darwin1.[012])
9723 # On Rhapsody replace the C library with the System framework
9724 newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
9728 if test yes = "$droppeddeps"; then
9729 if test yes = "$module"; then
9731 echo "*** Warning: libtool could not satisfy all declared inter-library"
9732 $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
9733 echo "*** a static module, that should work as long as the dlopening"
9734 echo "*** application is linked with the -dlopen flag."
9735 if test -z "$global_symbol_pipe"; then
9737 echo "*** However, this would only work if libtool was able to extract symbol"
9738 echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
9739 echo "*** not find such a program. So, this module is probably useless."
9740 echo "*** 'nm' from GNU binutils and a full rebuild may help."
9742 if test no = "$build_old_libs"; then
9743 oldlibs=$output_objdir/$libname.$libext
9744 build_libtool_libs=module
9747 build_libtool_libs=no
9750 echo "*** The inter-library dependencies that have been dropped here will be"
9751 echo "*** automatically added whenever a program is linked with this library"
9752 echo "*** or is declared to -dlopen it."
9754 if test no = "$allow_undefined"; then
9756 echo "*** Since this library must not contain undefined symbols,"
9757 echo "*** because either the platform does not support them or"
9758 echo "*** it was explicitly requested with -no-undefined,"
9759 echo "*** libtool will only create a static version of it."
9760 if test no = "$build_old_libs"; then
9761 oldlibs=$output_objdir/$libname.$libext
9762 build_libtool_libs=module
9765 build_libtool_libs=no
9770 # Done checking deplibs!
9773 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
9776 newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
9777 new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
9778 deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
9782 # move library search paths that coincide with paths to not yet
9783 # installed libraries to the beginning of the library search list
9785 for path in $notinst_path; do
9786 case " $new_libs " in
9787 *" -L$path/$objdir "*) ;;
9789 case " $deplibs " in
9790 *" -L$path/$objdir "*)
9791 func_append new_libs " -L$path/$objdir" ;;
9796 for deplib in $deplibs; do
9799 case " $new_libs " in
9801 *) func_append new_libs " $deplib" ;;
9804 *) func_append new_libs " $deplib" ;;
9809 # All the library-specific variables (install_libdir is set above).
9814 # Test again, we may have decided not to build it any more
9815 if test yes = "$build_libtool_libs"; then
9816 # Remove $wl instances when linking with ld.
9817 # FIXME: should test the right _cmds variable.
9818 case $archive_cmds in
9821 if test yes = "$hardcode_into_libs"; then
9822 # Hardcode the library paths
9825 rpath=$finalize_rpath
9826 test relink = "$opt_mode" || rpath=$compile_rpath$rpath
9827 for libdir in $rpath; do
9828 if test -n "$hardcode_libdir_flag_spec"; then
9829 if test -n "$hardcode_libdir_separator"; then
9830 func_replace_sysroot "$libdir"
9831 libdir=$func_replace_sysroot_result
9832 if test -z "$hardcode_libdirs"; then
9833 hardcode_libdirs=$libdir
9835 # Just accumulate the unique libdirs.
9836 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
9837 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
9840 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
9845 eval flag=\"$hardcode_libdir_flag_spec\"
9846 func_append dep_rpath " $flag"
9848 elif test -n "$runpath_var"; then
9849 case "$perm_rpath " in
9851 *) func_append perm_rpath " $libdir" ;;
9855 # Substitute the hardcoded libdirs into the rpath.
9856 if test -n "$hardcode_libdir_separator" &&
9857 test -n "$hardcode_libdirs"; then
9858 libdir=$hardcode_libdirs
9859 eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
9861 if test -n "$runpath_var" && test -n "$perm_rpath"; then
9862 # We should set the runpath_var.
9864 for dir in $perm_rpath; do
9865 func_append rpath "$dir:"
9867 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
9869 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
9872 shlibpath=$finalize_shlibpath
9873 test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath
9874 if test -n "$shlibpath"; then
9875 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
9878 # Get the real and link names of the library.
9879 eval shared_ext=\"$shrext_cmds\"
9880 eval library_names=\"$library_names_spec\"
9881 set dummy $library_names
9886 if test -n "$soname_spec"; then
9887 eval soname=\"$soname_spec\"
9891 if test -z "$dlname"; then
9895 lib=$output_objdir/$realname
9899 func_append linknames " $link"
9902 # Use standard objects if they are pic
9903 test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
9904 test "X$libobjs" = "X " && libobjs=
9907 if test -n "$export_symbols" && test -n "$include_expsyms"; then
9908 $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
9909 export_symbols=$output_objdir/$libname.uexp
9910 func_append delfiles " $export_symbols"
9913 orig_export_symbols=
9915 cygwin* | mingw* | cegcc*)
9916 if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
9917 # exporting using user supplied symfile
9918 func_dll_def_p "$export_symbols" || {
9919 # and it's NOT already a .def file. Must figure out
9920 # which of the given symbols are data symbols and tag
9921 # them as such. So, trigger use of export_symbols_cmds.
9922 # export_symbols gets reassigned inside the "prepare
9923 # the list of exported symbols" if statement, so the
9924 # include_expsyms logic still works.
9925 orig_export_symbols=$export_symbols
9927 always_export_symbols=yes
9933 # Prepare the list of exported symbols
9934 if test -z "$export_symbols"; then
9935 if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then
9936 func_verbose "generating symbol list for '$libname.la'"
9937 export_symbols=$output_objdir/$libname.exp
9938 $opt_dry_run || $RM $export_symbols
9939 cmds=$export_symbols_cmds
9940 save_ifs=$IFS; IFS='~'
9941 for cmd1 in $cmds; do
9943 # Take the normal branch if the nm_file_list_spec branch
9944 # doesn't work or if tool conversion is not needed.
9945 case $nm_file_list_spec~$to_tool_file_cmd in
9946 *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
9947 try_normal_branch=yes
9950 len=$func_len_result
9953 try_normal_branch=no
9956 if test yes = "$try_normal_branch" \
9957 && { test "$len" -lt "$max_cmd_len" \
9958 || test "$max_cmd_len" -le -1; }
9960 func_show_eval "$cmd" 'exit $?'
9961 skipped_export=false
9962 elif test -n "$nm_file_list_spec"; then
9963 func_basename "$output"
9964 output_la=$func_basename_result
9965 save_libobjs=$libobjs
9967 output=$output_objdir/$output_la.nm
9968 func_to_tool_file "$output"
9969 libobjs=$nm_file_list_spec$func_to_tool_file_result
9970 func_append delfiles " $output"
9971 func_verbose "creating $NM input file list: $output"
9972 for obj in $save_libobjs; do
9973 func_to_tool_file "$obj"
9974 $ECHO "$func_to_tool_file_result"
9977 func_show_eval "$cmd" 'exit $?'
9979 libobjs=$save_libobjs
9980 skipped_export=false
9982 # The command line is too long to execute in one step.
9983 func_verbose "using reloadable object file for export list..."
9985 # Break out early, otherwise skipped_export may be
9986 # set to false by a later but shorter cmd.
9991 if test -n "$export_symbols_regex" && test : != "$skipped_export"; then
9992 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
9993 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
9998 if test -n "$export_symbols" && test -n "$include_expsyms"; then
9999 tmp_export_symbols=$export_symbols
10000 test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
10001 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
10004 if test : != "$skipped_export" && test -n "$orig_export_symbols"; then
10005 # The given exports_symbols file has to be filtered, so filter it.
10006 func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
10007 # FIXME: $output_objdir/$libname.filter potentially contains lots of
10008 # 's' commands, which not all seds can handle. GNU sed should be fine
10009 # though. Also, the filter scales superlinearly with the number of
10010 # global variables. join(1) would be nice here, but unfortunately
10011 # isn't a blessed tool.
10012 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
10013 func_append delfiles " $export_symbols $output_objdir/$libname.filter"
10014 export_symbols=$output_objdir/$libname.def
10015 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
10019 for test_deplib in $deplibs; do
10020 case " $convenience " in
10021 *" $test_deplib "*) ;;
10023 func_append tmp_deplibs " $test_deplib"
10027 deplibs=$tmp_deplibs
10029 if test -n "$convenience"; then
10030 if test -n "$whole_archive_flag_spec" &&
10031 test yes = "$compiler_needs_object" &&
10032 test -z "$libobjs"; then
10033 # extract the archives, so we have objects to list.
10034 # TODO: could optimize this to just extract one archive.
10035 whole_archive_flag_spec=
10037 if test -n "$whole_archive_flag_spec"; then
10038 save_libobjs=$libobjs
10039 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
10040 test "X$libobjs" = "X " && libobjs=
10042 gentop=$output_objdir/${outputname}x
10043 func_append generated " $gentop"
10045 func_extract_archives $gentop $convenience
10046 func_append libobjs " $func_extract_archives_result"
10047 test "X$libobjs" = "X " && libobjs=
10051 if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
10052 eval flag=\"$thread_safe_flag_spec\"
10053 func_append linker_flags " $flag"
10056 # Make a backup of the uninstalled library when relinking
10057 if test relink = "$opt_mode"; then
10058 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
10061 # Do each of the archive commands.
10062 if test yes = "$module" && test -n "$module_cmds"; then
10063 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
10064 eval test_cmds=\"$module_expsym_cmds\"
10065 cmds=$module_expsym_cmds
10067 eval test_cmds=\"$module_cmds\"
10071 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
10072 eval test_cmds=\"$archive_expsym_cmds\"
10073 cmds=$archive_expsym_cmds
10075 eval test_cmds=\"$archive_cmds\"
10080 if test : != "$skipped_export" &&
10081 func_len " $test_cmds" &&
10082 len=$func_len_result &&
10083 test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
10086 # The command line is too long to link in one step, link piecewise
10087 # or, if using GNU ld and skipped_export is not :, use a linker
10090 # Save the value of $output and $libobjs because we want to
10091 # use them later. If we have whole_archive_flag_spec, we
10092 # want to use save_libobjs as it was before
10093 # whole_archive_flag_spec was expanded, because we can't
10094 # assume the linker understands whole_archive_flag_spec.
10095 # This may have to be revisited, in case too many
10096 # convenience libraries get linked in and end up exceeding
10098 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
10099 save_libobjs=$libobjs
10101 save_output=$output
10102 func_basename "$output"
10103 output_la=$func_basename_result
10105 # Clear the reloadable object creation command queue and
10106 # initialize k to one.
10113 if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
10114 output=$output_objdir/$output_la.lnkscript
10115 func_verbose "creating GNU ld script: $output"
10116 echo 'INPUT (' > $output
10117 for obj in $save_libobjs
10119 func_to_tool_file "$obj"
10120 $ECHO "$func_to_tool_file_result" >> $output
10122 echo ')' >> $output
10123 func_append delfiles " $output"
10124 func_to_tool_file "$output"
10125 output=$func_to_tool_file_result
10126 elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
10127 output=$output_objdir/$output_la.lnk
10128 func_verbose "creating linker input file list: $output"
10130 set x $save_libobjs
10133 if test yes = "$compiler_needs_object"; then
10139 func_to_tool_file "$obj"
10140 $ECHO "$func_to_tool_file_result" >> $output
10142 func_append delfiles " $output"
10143 func_to_tool_file "$output"
10144 output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
10146 if test -n "$save_libobjs"; then
10147 func_verbose "creating reloadable object files..."
10148 output=$output_objdir/$output_la-$k.$objext
10149 eval test_cmds=\"$reload_cmds\"
10150 func_len " $test_cmds"
10151 len0=$func_len_result
10154 # Loop over the list of objects to be linked.
10155 for obj in $save_libobjs
10158 func_arith $len + $func_len_result
10159 len=$func_arith_result
10160 if test -z "$objlist" ||
10161 test "$len" -lt "$max_cmd_len"; then
10162 func_append objlist " $obj"
10164 # The command $test_cmds is almost too long, add a
10165 # command to the queue.
10166 if test 1 -eq "$k"; then
10167 # The first file doesn't have a previous command to add.
10168 reload_objs=$objlist
10169 eval concat_cmds=\"$reload_cmds\"
10171 # All subsequent reloadable object files will link in
10172 # the last one created.
10173 reload_objs="$objlist $last_robj"
10174 eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
10176 last_robj=$output_objdir/$output_la-$k.$objext
10178 k=$func_arith_result
10179 output=$output_objdir/$output_la-$k.$objext
10181 func_len " $last_robj"
10182 func_arith $len0 + $func_len_result
10183 len=$func_arith_result
10186 # Handle the remaining objects by creating one last
10187 # reloadable object file. All subsequent reloadable object
10188 # files will link in the last one created.
10189 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
10190 reload_objs="$objlist $last_robj"
10191 eval concat_cmds=\"\$concat_cmds$reload_cmds\"
10192 if test -n "$last_robj"; then
10193 eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
10195 func_append delfiles " $output"
10201 ${skipped_export-false} && {
10202 func_verbose "generating symbol list for '$libname.la'"
10203 export_symbols=$output_objdir/$libname.exp
10204 $opt_dry_run || $RM $export_symbols
10206 # Append the command to create the export file.
10207 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
10208 eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
10209 if test -n "$last_robj"; then
10210 eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
10214 test -n "$save_libobjs" &&
10215 func_verbose "creating a temporary reloadable object file: $output"
10217 # Loop through the commands generated above and execute them.
10218 save_ifs=$IFS; IFS='~'
10219 for cmd in $concat_cmds; do
10222 func_quote_arg expand,pretty "$cmd"
10223 eval "func_echo $func_quote_arg_result"
10225 $opt_dry_run || eval "$cmd" || {
10228 # Restore the uninstalled library and exit
10229 if test relink = "$opt_mode"; then
10230 ( cd "$output_objdir" && \
10231 $RM "${realname}T" && \
10232 $MV "${realname}U" "$realname" )
10240 if test -n "$export_symbols_regex" && ${skipped_export-false}; then
10241 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
10242 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
10246 ${skipped_export-false} && {
10247 if test -n "$export_symbols" && test -n "$include_expsyms"; then
10248 tmp_export_symbols=$export_symbols
10249 test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
10250 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
10253 if test -n "$orig_export_symbols"; then
10254 # The given exports_symbols file has to be filtered, so filter it.
10255 func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
10256 # FIXME: $output_objdir/$libname.filter potentially contains lots of
10257 # 's' commands, which not all seds can handle. GNU sed should be fine
10258 # though. Also, the filter scales superlinearly with the number of
10259 # global variables. join(1) would be nice here, but unfortunately
10260 # isn't a blessed tool.
10261 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
10262 func_append delfiles " $export_symbols $output_objdir/$libname.filter"
10263 export_symbols=$output_objdir/$libname.def
10264 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
10269 # Restore the value of output.
10270 output=$save_output
10272 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
10273 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
10274 test "X$libobjs" = "X " && libobjs=
10276 # Expand the library linking commands again to reset the
10277 # value of $libobjs for piecewise linking.
10279 # Do each of the archive commands.
10280 if test yes = "$module" && test -n "$module_cmds"; then
10281 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
10282 cmds=$module_expsym_cmds
10287 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
10288 cmds=$archive_expsym_cmds
10295 if test -n "$delfiles"; then
10296 # Append the command to remove temporary files to $cmds.
10297 eval cmds=\"\$cmds~\$RM $delfiles\"
10300 # Add any objects from preloaded convenience libraries
10301 if test -n "$dlprefiles"; then
10302 gentop=$output_objdir/${outputname}x
10303 func_append generated " $gentop"
10305 func_extract_archives $gentop $dlprefiles
10306 func_append libobjs " $func_extract_archives_result"
10307 test "X$libobjs" = "X " && libobjs=
10310 save_ifs=$IFS; IFS='~'
10311 for cmd in $cmds; do
10316 func_quote_arg expand,pretty "$cmd"
10317 eval "func_echo $func_quote_arg_result"
10319 $opt_dry_run || eval "$cmd" || {
10322 # Restore the uninstalled library and exit
10323 if test relink = "$opt_mode"; then
10324 ( cd "$output_objdir" && \
10325 $RM "${realname}T" && \
10326 $MV "${realname}U" "$realname" )
10334 # Restore the uninstalled library and exit
10335 if test relink = "$opt_mode"; then
10336 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
10338 if test -n "$convenience"; then
10339 if test -z "$whole_archive_flag_spec"; then
10340 func_show_eval '${RM}r "$gentop"'
10347 # Create links to the real library.
10348 for linkname in $linknames; do
10349 if test "$realname" != "$linkname"; then
10350 func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
10354 # If -module or -export-dynamic was specified, set the dlname.
10355 if test yes = "$module" || test yes = "$export_dynamic"; then
10356 # On all known operating systems, these are identical.
10363 if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
10364 func_warning "'-dlopen' is ignored for objects"
10367 case " $deplibs" in
10369 func_warning "'-l' and '-L' are ignored for objects" ;;
10372 test -n "$rpath" && \
10373 func_warning "'-rpath' is ignored for objects"
10375 test -n "$xrpath" && \
10376 func_warning "'-R' is ignored for objects"
10378 test -n "$vinfo" && \
10379 func_warning "'-version-info' is ignored for objects"
10381 test -n "$release" && \
10382 func_warning "'-release' is ignored for objects"
10386 test -n "$objs$old_deplibs" && \
10387 func_fatal_error "cannot build library object '$output' from non-libtool objects"
10390 func_lo2o "$libobj"
10391 obj=$func_lo2o_result
10399 # Delete the old objects.
10400 $opt_dry_run || $RM $obj $libobj
10402 # Objects from convenience libraries. This assumes
10403 # single-version convenience libraries. Whenever we create
10404 # different ones for PIC/non-PIC, this we'll have to duplicate
10408 # if reload_cmds runs $LD directly, get rid of -Wl from
10409 # whole_archive_flag_spec and hope we can get by with turning comma
10411 case $reload_cmds in
10412 *\$LD[\ \$]*) wl= ;;
10414 if test -n "$convenience"; then
10415 if test -n "$whole_archive_flag_spec"; then
10416 eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
10417 test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
10418 reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags
10420 gentop=$output_objdir/${obj}x
10421 func_append generated " $gentop"
10423 func_extract_archives $gentop $convenience
10424 reload_conv_objs="$reload_objs $func_extract_archives_result"
10428 # If we're not building shared, we need to use non_pic_objs
10429 test yes = "$build_libtool_libs" || libobjs=$non_pic_objects
10431 # Create the old-style object.
10432 reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs
10435 func_execute_cmds "$reload_cmds" 'exit $?'
10437 # Exit if we aren't doing a library object file.
10438 if test -z "$libobj"; then
10439 if test -n "$gentop"; then
10440 func_show_eval '${RM}r "$gentop"'
10446 test yes = "$build_libtool_libs" || {
10447 if test -n "$gentop"; then
10448 func_show_eval '${RM}r "$gentop"'
10451 # Create an invalid libtool object if no PIC, so that we don't
10452 # accidentally link it into a program.
10453 # $show "echo timestamp > $libobj"
10454 # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
10458 if test -n "$pic_flag" || test default != "$pic_mode"; then
10459 # Only do commands if we really have different PIC objects.
10460 reload_objs="$libobjs $reload_conv_objs"
10462 func_execute_cmds "$reload_cmds" 'exit $?'
10465 if test -n "$gentop"; then
10466 func_show_eval '${RM}r "$gentop"'
10474 *cygwin*) func_stripname '' '.exe' "$output"
10475 output=$func_stripname_result.exe;;
10477 test -n "$vinfo" && \
10478 func_warning "'-version-info' is ignored for programs"
10480 test -n "$release" && \
10481 func_warning "'-release' is ignored for programs"
10484 && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \
10485 && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."
10488 *-*-rhapsody* | *-*-darwin1.[012])
10489 # On Rhapsody replace the C library is the System framework
10490 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
10491 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
10497 # Don't allow lazy linking, it breaks C++ global constructors
10498 # But is supposedly fixed on 10.4 or later (yay!).
10499 if test CXX = "$tagname"; then
10500 case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
10502 func_append compile_command " $wl-bind_at_load"
10503 func_append finalize_command " $wl-bind_at_load"
10507 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
10508 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
10509 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
10514 # move library search paths that coincide with paths to not yet
10515 # installed libraries to the beginning of the library search list
10517 for path in $notinst_path; do
10518 case " $new_libs " in
10519 *" -L$path/$objdir "*) ;;
10521 case " $compile_deplibs " in
10522 *" -L$path/$objdir "*)
10523 func_append new_libs " -L$path/$objdir" ;;
10528 for deplib in $compile_deplibs; do
10531 case " $new_libs " in
10533 *) func_append new_libs " $deplib" ;;
10536 *) func_append new_libs " $deplib" ;;
10539 compile_deplibs=$new_libs
10542 func_append compile_command " $compile_deplibs"
10543 func_append finalize_command " $finalize_deplibs"
10545 if test -n "$rpath$xrpath"; then
10546 # If the user specified any rpath flags, then add them.
10547 for libdir in $rpath $xrpath; do
10548 # This is the magic to use -rpath.
10549 case "$finalize_rpath " in
10551 *) func_append finalize_rpath " $libdir" ;;
10556 # Now hardcode the library paths
10559 for libdir in $compile_rpath $finalize_rpath; do
10560 if test -n "$hardcode_libdir_flag_spec"; then
10561 if test -n "$hardcode_libdir_separator"; then
10562 if test -z "$hardcode_libdirs"; then
10563 hardcode_libdirs=$libdir
10565 # Just accumulate the unique libdirs.
10566 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
10567 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
10570 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
10575 eval flag=\"$hardcode_libdir_flag_spec\"
10576 func_append rpath " $flag"
10578 elif test -n "$runpath_var"; then
10579 case "$perm_rpath " in
10581 *) func_append perm_rpath " $libdir" ;;
10585 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
10586 testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
10587 case :$dllsearchpath: in
10589 ::) dllsearchpath=$libdir;;
10590 *) func_append dllsearchpath ":$libdir";;
10592 case :$dllsearchpath: in
10593 *":$testbindir:"*) ;;
10594 ::) dllsearchpath=$testbindir;;
10595 *) func_append dllsearchpath ":$testbindir";;
10600 # Substitute the hardcoded libdirs into the rpath.
10601 if test -n "$hardcode_libdir_separator" &&
10602 test -n "$hardcode_libdirs"; then
10603 libdir=$hardcode_libdirs
10604 eval rpath=\" $hardcode_libdir_flag_spec\"
10606 compile_rpath=$rpath
10610 for libdir in $finalize_rpath; do
10611 if test -n "$hardcode_libdir_flag_spec"; then
10612 if test -n "$hardcode_libdir_separator"; then
10613 if test -z "$hardcode_libdirs"; then
10614 hardcode_libdirs=$libdir
10616 # Just accumulate the unique libdirs.
10617 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
10618 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
10621 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
10626 eval flag=\"$hardcode_libdir_flag_spec\"
10627 func_append rpath " $flag"
10629 elif test -n "$runpath_var"; then
10630 case "$finalize_perm_rpath " in
10632 *) func_append finalize_perm_rpath " $libdir" ;;
10636 # Substitute the hardcoded libdirs into the rpath.
10637 if test -n "$hardcode_libdir_separator" &&
10638 test -n "$hardcode_libdirs"; then
10639 libdir=$hardcode_libdirs
10640 eval rpath=\" $hardcode_libdir_flag_spec\"
10642 finalize_rpath=$rpath
10644 if test -n "$libobjs" && test yes = "$build_old_libs"; then
10645 # Transform all the library objects into standard objects.
10646 compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
10647 finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
10650 func_generate_dlsyms "$outputname" "@PROGRAM@" false
10652 # template prelinking step
10653 if test -n "$prelink_cmds"; then
10654 func_execute_cmds "$prelink_cmds" 'exit $?'
10657 wrappers_required=:
10659 *cegcc* | *mingw32ce*)
10660 # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
10661 wrappers_required=false
10663 *cygwin* | *mingw* )
10664 test yes = "$build_libtool_libs" || wrappers_required=false
10667 if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
10668 wrappers_required=false
10672 $wrappers_required || {
10673 # Replace the output file specification.
10674 compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
10675 link_command=$compile_command$compile_rpath
10677 # We have no uninstalled library dependencies, so finalize right now.
10679 func_show_eval "$link_command" 'exit_status=$?'
10681 if test -n "$postlink_cmds"; then
10682 func_to_tool_file "$output"
10683 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
10684 func_execute_cmds "$postlink_cmds" 'exit $?'
10687 # Delete the generated files.
10688 if test -f "$output_objdir/${outputname}S.$objext"; then
10689 func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'
10695 if test -n "$compile_shlibpath$finalize_shlibpath"; then
10696 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
10698 if test -n "$finalize_shlibpath"; then
10699 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
10704 if test -n "$runpath_var"; then
10705 if test -n "$perm_rpath"; then
10706 # We should set the runpath_var.
10708 for dir in $perm_rpath; do
10709 func_append rpath "$dir:"
10711 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
10713 if test -n "$finalize_perm_rpath"; then
10714 # We should set the runpath_var.
10716 for dir in $finalize_perm_rpath; do
10717 func_append rpath "$dir:"
10719 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
10723 if test yes = "$no_install"; then
10724 # We don't need to create a wrapper script.
10725 link_command=$compile_var$compile_command$compile_rpath
10726 # Replace the output file specification.
10727 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
10728 # Delete the old output file.
10729 $opt_dry_run || $RM $output
10730 # Link the executable and exit
10731 func_show_eval "$link_command" 'exit $?'
10733 if test -n "$postlink_cmds"; then
10734 func_to_tool_file "$output"
10735 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
10736 func_execute_cmds "$postlink_cmds" 'exit $?'
10742 case $hardcode_action,$fast_install in
10744 # Fast installation is not supported
10745 link_command=$compile_var$compile_command$compile_rpath
10746 relink_command=$finalize_var$finalize_command$finalize_rpath
10748 func_warning "this platform does not like uninstalled shared libraries"
10749 func_warning "'$output' will be relinked during installation"
10752 link_command=$finalize_var$compile_command$finalize_rpath
10753 relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
10756 link_command=$compile_var$compile_command$compile_rpath
10757 relink_command=$finalize_var$finalize_command$finalize_rpath
10760 link_command=$finalize_var$compile_command$finalize_rpath
10765 # Replace the output file specification.
10766 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
10768 # Delete the old output files.
10769 $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
10771 func_show_eval "$link_command" 'exit $?'
10773 if test -n "$postlink_cmds"; then
10774 func_to_tool_file "$output_objdir/$outputname"
10775 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'`
10776 func_execute_cmds "$postlink_cmds" 'exit $?'
10779 # Now create the wrapper script.
10780 func_verbose "creating $output"
10782 # Quote the relink command for shipping.
10783 if test -n "$relink_command"; then
10784 # Preserve any variables that may affect compiler behavior
10785 for var in $variables_saved_for_relink; do
10786 if eval test -z \"\${$var+set}\"; then
10787 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
10788 elif eval var_value=\$$var; test -z "$var_value"; then
10789 relink_command="$var=; export $var; $relink_command"
10791 func_quote_arg pretty "$var_value"
10792 relink_command="$var=$func_quote_arg_result; export $var; $relink_command"
10795 func_quote eval cd "`pwd`"
10796 func_quote_arg pretty,unquoted "($func_quote_result; $relink_command)"
10797 relink_command=$func_quote_arg_unquoted_result
10800 # Only actually do things if not in dry run mode.
10802 # win32 will think the script is a binary if it has
10803 # a .exe suffix, so we strip it off here.
10805 *.exe) func_stripname '' '.exe' "$output"
10806 output=$func_stripname_result ;;
10808 # test for cygwin because mv fails w/o .exe extensions
10812 func_stripname '' '.exe' "$outputname"
10813 outputname=$func_stripname_result ;;
10817 *cygwin* | *mingw* )
10818 func_dirname_and_basename "$output" "" "."
10819 output_name=$func_basename_result
10820 output_path=$func_dirname_result
10821 cwrappersource=$output_path/$objdir/lt-$output_name.c
10822 cwrapper=$output_path/$output_name.exe
10823 $RM $cwrappersource $cwrapper
10824 trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
10826 func_emit_cwrapperexe_src > $cwrappersource
10828 # The wrapper executable is built using the $host compiler,
10829 # because it contains $host paths and files. If cross-
10830 # compiling, it, like the target executable, must be
10831 # executed on the $host or under an emulation environment.
10833 $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
10837 # Now, create the wrapper script for func_source use:
10838 func_ltwrapper_scriptname $cwrapper
10839 $RM $func_ltwrapper_scriptname_result
10840 trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
10842 # note: this script will not be executed, so do not chmod.
10843 if test "x$build" = "x$host"; then
10844 $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
10846 func_emit_wrapper no > $func_ltwrapper_scriptname_result
10852 trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
10854 func_emit_wrapper no > $output
10863 # See if we need to build an old-fashioned archive.
10864 for oldlib in $oldlibs; do
10866 case $build_libtool_libs in
10868 oldobjs="$libobjs_save $symfileobj"
10869 addlibs=$convenience
10870 build_libtool_libs=no
10873 oldobjs=$libobjs_save
10874 addlibs=$old_convenience
10875 build_libtool_libs=no
10878 oldobjs="$old_deplibs $non_pic_objects"
10879 $preload && test -f "$symfileobj" \
10880 && func_append oldobjs " $symfileobj"
10881 addlibs=$old_convenience
10885 if test -n "$addlibs"; then
10886 gentop=$output_objdir/${outputname}x
10887 func_append generated " $gentop"
10889 func_extract_archives $gentop $addlibs
10890 func_append oldobjs " $func_extract_archives_result"
10893 # Do each command in the archive commands.
10894 if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then
10895 cmds=$old_archive_from_new_cmds
10898 # Add any objects from preloaded convenience libraries
10899 if test -n "$dlprefiles"; then
10900 gentop=$output_objdir/${outputname}x
10901 func_append generated " $gentop"
10903 func_extract_archives $gentop $dlprefiles
10904 func_append oldobjs " $func_extract_archives_result"
10907 # POSIX demands no paths to be encoded in archives. We have
10908 # to avoid creating archives with duplicate basenames if we
10909 # might have to extract them afterwards, e.g., when creating a
10910 # static archive out of a convenience library, or when linking
10911 # the entirety of a libtool archive into another (currently
10912 # not supported by libtool).
10913 if (for obj in $oldobjs
10915 func_basename "$obj"
10916 $ECHO "$func_basename_result"
10917 done | sort | sort -uc >/dev/null 2>&1); then
10920 echo "copying selected object files to avoid basename conflicts..."
10921 gentop=$output_objdir/${outputname}x
10922 func_append generated " $gentop"
10923 func_mkdir_p "$gentop"
10924 save_oldobjs=$oldobjs
10927 for obj in $save_oldobjs
10929 func_basename "$obj"
10930 objbase=$func_basename_result
10931 case " $oldobjs " in
10932 " ") oldobjs=$obj ;;
10933 *[\ /]"$objbase "*)
10935 # Make sure we don't pick an alternate name that also
10937 newobj=lt$counter-$objbase
10938 func_arith $counter + 1
10939 counter=$func_arith_result
10940 case " $oldobjs " in
10941 *[\ /]"$newobj "*) ;;
10942 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
10945 func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
10946 func_append oldobjs " $gentop/$newobj"
10948 *) func_append oldobjs " $obj" ;;
10952 func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
10953 tool_oldlib=$func_to_tool_file_result
10954 eval cmds=\"$old_archive_cmds\"
10957 len=$func_len_result
10958 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
10959 cmds=$old_archive_cmds
10960 elif test -n "$archiver_list_spec"; then
10961 func_verbose "using command file archive linking..."
10962 for obj in $oldobjs
10964 func_to_tool_file "$obj"
10965 $ECHO "$func_to_tool_file_result"
10966 done > $output_objdir/$libname.libcmd
10967 func_to_tool_file "$output_objdir/$libname.libcmd"
10968 oldobjs=" $archiver_list_spec$func_to_tool_file_result"
10969 cmds=$old_archive_cmds
10971 # the command line is too long to link in one step, link in parts
10972 func_verbose "using piecewise archive linking..."
10973 save_RANLIB=$RANLIB
10977 save_oldobjs=$oldobjs
10979 # Is there a better way of finding the last object in the list?
10980 for obj in $save_oldobjs
10984 eval test_cmds=\"$old_archive_cmds\"
10985 func_len " $test_cmds"
10986 len0=$func_len_result
10988 for obj in $save_oldobjs
10991 func_arith $len + $func_len_result
10992 len=$func_arith_result
10993 func_append objlist " $obj"
10994 if test "$len" -lt "$max_cmd_len"; then
10997 # the above command should be used before it gets too long
10999 if test "$obj" = "$last_oldobj"; then
11000 RANLIB=$save_RANLIB
11002 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
11003 eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
11008 RANLIB=$save_RANLIB
11010 if test -z "$oldobjs"; then
11011 eval cmds=\"\$concat_cmds\"
11013 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
11017 func_execute_cmds "$cmds" 'exit $?'
11020 test -n "$generated" && \
11021 func_show_eval "${RM}r$generated"
11023 # Now create the libtool archive.
11027 test yes = "$build_old_libs" && old_library=$libname.$libext
11028 func_verbose "creating $output"
11030 # Preserve any variables that may affect compiler behavior
11031 for var in $variables_saved_for_relink; do
11032 if eval test -z \"\${$var+set}\"; then
11033 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
11034 elif eval var_value=\$$var; test -z "$var_value"; then
11035 relink_command="$var=; export $var; $relink_command"
11037 func_quote_arg pretty,unquoted "$var_value"
11038 relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command"
11041 # Quote the link command for shipping.
11042 func_quote eval cd "`pwd`"
11043 relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
11044 func_quote_arg pretty,unquoted "$relink_command"
11045 relink_command=$func_quote_arg_unquoted_result
11046 if test yes = "$hardcode_automatic"; then
11050 # Only create the output if not a dry run.
11052 for installed in no yes; do
11053 if test yes = "$installed"; then
11054 if test -z "$install_libdir"; then
11057 output=$output_objdir/${outputname}i
11058 # Replace all uninstalled libtool libraries with the installed ones
11059 newdependency_libs=
11060 for deplib in $dependency_libs; do
11063 func_basename "$deplib"
11064 name=$func_basename_result
11065 func_resolve_sysroot "$deplib"
11066 eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
11067 test -z "$libdir" && \
11068 func_fatal_error "'$deplib' is not a valid libtool archive"
11069 func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
11072 func_stripname -L '' "$deplib"
11073 func_replace_sysroot "$func_stripname_result"
11074 func_append newdependency_libs " -L$func_replace_sysroot_result"
11077 func_stripname -R '' "$deplib"
11078 func_replace_sysroot "$func_stripname_result"
11079 func_append newdependency_libs " -R$func_replace_sysroot_result"
11081 *) func_append newdependency_libs " $deplib" ;;
11084 dependency_libs=$newdependency_libs
11087 for lib in $dlfiles; do
11090 func_basename "$lib"
11091 name=$func_basename_result
11092 eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
11093 test -z "$libdir" && \
11094 func_fatal_error "'$lib' is not a valid libtool archive"
11095 func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
11097 *) func_append newdlfiles " $lib" ;;
11100 dlfiles=$newdlfiles
11102 for lib in $dlprefiles; do
11105 # Only pass preopened files to the pseudo-archive (for
11106 # eventual linking with the app. that links it) if we
11107 # didn't already link the preopened objects directly into
11109 func_basename "$lib"
11110 name=$func_basename_result
11111 eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
11112 test -z "$libdir" && \
11113 func_fatal_error "'$lib' is not a valid libtool archive"
11114 func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
11118 dlprefiles=$newdlprefiles
11121 for lib in $dlfiles; do
11123 [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
11124 *) abs=`pwd`"/$lib" ;;
11126 func_append newdlfiles " $abs"
11128 dlfiles=$newdlfiles
11130 for lib in $dlprefiles; do
11132 [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
11133 *) abs=`pwd`"/$lib" ;;
11135 func_append newdlprefiles " $abs"
11137 dlprefiles=$newdlprefiles
11140 # place dlname in correct position for cygwin
11141 # In fact, it would be nice if we could use this code for all target
11142 # systems that can't hard-code library paths into their executables
11143 # and that have no shared library path variable independent of PATH,
11144 # but it turns out we can't easily determine that from inspecting
11145 # libtool variables, so we have to hard-code the OSs to which it
11146 # applies here; at the moment, that means platforms that use the PE
11147 # object format with DLL files. See the long comment at the top of
11148 # tests/bindir.at for full details.
11150 case $host,$output,$installed,$module,$dlname in
11151 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
11152 # If a -bindir argument was supplied, place the dll there.
11153 if test -n "$bindir"; then
11154 func_relative_path "$install_libdir" "$bindir"
11155 tdlname=$func_relative_path_result/$dlname
11157 # Otherwise fall back on heuristic.
11158 tdlname=../bin/$dlname
11163 # $outputname - a libtool library file
11164 # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
11166 # Please DO NOT delete this file!
11167 # It is necessary for linking the library.
11169 # The name that we can dlopen(3).
11172 # Names of this library.
11173 library_names='$library_names'
11175 # The name of the static archive.
11176 old_library='$old_library'
11178 # Linker flags that cannot go in dependency_libs.
11179 inherited_linker_flags='$new_inherited_linker_flags'
11181 # Libraries that this one depends upon.
11182 dependency_libs='$dependency_libs'
11184 # Names of additional weak libraries provided by this library
11185 weak_library_names='$weak_libs'
11187 # Version information for $libname.
11192 # Is this an already installed library?
11193 installed=$installed
11195 # Should we warn about portability when linking against -modules?
11196 shouldnotlink=$module
11198 # Files to dlopen/dlpreopen
11200 dlpreopen='$dlprefiles'
11202 # Directory that this library needs to be installed in:
11203 libdir='$install_libdir'"
11204 if test no,yes = "$installed,$need_relink"; then
11205 $ECHO >> $output "\
11206 relink_command=\"$relink_command\""
11211 # Do a symbolic link so that the libtool archive can be found in
11212 # LD_LIBRARY_PATH before the program is installed.
11213 func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
11219 if test link = "$opt_mode" || test relink = "$opt_mode"; then
11220 func_mode_link ${1+"$@"}
11224 # func_mode_uninstall arg...
11225 func_mode_uninstall ()
11234 # This variable tells wrapper scripts just to set variables rather
11235 # than running their programs.
11236 libtool_install_magic=$magic
11241 -f) func_append RM " $arg"; rmforce=: ;;
11242 -*) func_append RM " $arg" ;;
11243 *) func_append files " $arg" ;;
11248 func_fatal_help "you must specify an RM program"
11252 for file in $files; do
11253 func_dirname "$file" "" "."
11254 dir=$func_dirname_result
11255 if test . = "$dir"; then
11260 func_basename "$file"
11261 name=$func_basename_result
11262 test uninstall = "$opt_mode" && odir=$dir
11264 # Remember odir for removal later, being careful to avoid duplicates
11265 if test clean = "$opt_mode"; then
11266 case " $rmdirs " in
11268 *) func_append rmdirs " $odir" ;;
11272 # Don't error if the file doesn't exist and rm -f was used.
11273 if { test -L "$file"; } >/dev/null 2>&1 ||
11274 { test -h "$file"; } >/dev/null 2>&1 ||
11275 test -f "$file"; then
11277 elif test -d "$file"; then
11280 elif $rmforce; then
11288 # Possibly a libtool archive, so verify it.
11289 if func_lalib_p "$file"; then
11290 func_source $dir/$name
11292 # Delete the libtool libraries and symlinks.
11293 for n in $library_names; do
11294 func_append rmfiles " $odir/$n"
11296 test -n "$old_library" && func_append rmfiles " $odir/$old_library"
11300 case " $library_names " in
11302 *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
11304 test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
11307 if test -n "$library_names"; then
11308 # Do each command in the postuninstall commands.
11309 func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'
11312 if test -n "$old_library"; then
11313 # Do each command in the old_postuninstall commands.
11314 func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'
11316 # FIXME: should reinstall the best remaining shared library.
11323 # Possibly a libtool object, so verify it.
11324 if func_lalib_p "$file"; then
11326 # Read the .lo file
11327 func_source $dir/$name
11329 # Add PIC object to the list of files to remove.
11330 if test -n "$pic_object" && test none != "$pic_object"; then
11331 func_append rmfiles " $dir/$pic_object"
11334 # Add non-PIC object to the list of files to remove.
11335 if test -n "$non_pic_object" && test none != "$non_pic_object"; then
11336 func_append rmfiles " $dir/$non_pic_object"
11342 if test clean = "$opt_mode"; then
11346 func_stripname '' '.exe' "$file"
11347 file=$func_stripname_result
11348 func_stripname '' '.exe' "$name"
11349 noexename=$func_stripname_result
11350 # $file with .exe has already been added to rmfiles,
11351 # add $file without .exe
11352 func_append rmfiles " $file"
11355 # Do a test to see if this is a libtool program.
11356 if func_ltwrapper_p "$file"; then
11357 if func_ltwrapper_executable_p "$file"; then
11358 func_ltwrapper_scriptname "$file"
11360 func_source $func_ltwrapper_scriptname_result
11361 func_append rmfiles " $func_ltwrapper_scriptname_result"
11364 func_source $dir/$noexename
11367 # note $name still contains .exe if it was in $file originally
11368 # as does the version of $file that was added into $rmfiles
11369 func_append rmfiles " $odir/$name $odir/${name}S.$objext"
11370 if test yes = "$fast_install" && test -n "$relink_command"; then
11371 func_append rmfiles " $odir/lt-$name"
11373 if test "X$noexename" != "X$name"; then
11374 func_append rmfiles " $odir/lt-$noexename.c"
11380 func_show_eval "$RM $rmfiles" 'exit_status=1'
11383 # Try to remove the $objdir's in the directories where we deleted files
11384 for dir in $rmdirs; do
11385 if test -d "$dir"; then
11386 func_show_eval "rmdir $dir >/dev/null 2>&1"
11393 if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
11394 func_mode_uninstall ${1+"$@"}
11397 test -z "$opt_mode" && {
11399 func_fatal_help "you must specify a MODE"
11402 test -z "$exec_cmd" && \
11403 func_fatal_help "invalid operation mode '$opt_mode'"
11405 if test -n "$exec_cmd"; then
11406 eval exec "$exec_cmd"
11413 # The TAGs below are defined such that we never get into a situation
11414 # where we disable both kinds of libraries. Given conflicting
11415 # choices, we go for a static library, that is the most portable,
11416 # since we can't tell whether shared libraries were disabled because
11417 # the user asked for that or because the platform doesn't support
11418 # them. This is particularly important on AIX, because we don't
11419 # support having both static and shared libraries enabled at the same
11420 # time on that platform, so we default to a shared-only configuration.
11421 # If a disable-shared tag is given, we'll fallback to a static-only
11422 # configuration. But we'll never go from static-only to shared-only.
11424 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
11425 build_libtool_libs=no
11427 # ### END LIBTOOL TAG CONFIG: disable-shared
11429 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
11430 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
11431 # ### END LIBTOOL TAG CONFIG: disable-static
11434 # mode:shell-script